
:root {
  --bg: #0d1117;
  --surface: #161b22;
  --surface-hover: #1c2128;
  --border: #30363d;
  --text: #c9d1d9;
  --text-dim: #8b949e;
  --accent: #2f81f7;
  --confirmed: #3fb950;
  --unconfirmed: #d29922;
  --none: #8b949e;
  --radius: 8px;
  --heat-0: #161b22;
  --heat-1: #0e4429;
  --heat-2: #006d32;
  --heat-3: #26a641;
  --heat-4: #39d353;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

.container {
  max-width: 920px;
  margin: 0 auto;
  padding: 24px 20px 60px;
}

header.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

header.topbar a { color: var(--text); text-decoration: none; font-weight: 600; }
header.topbar .logout { color: var(--text-dim); font-weight: 400; font-size: 14px; }

h1 { font-size: 22px; margin: 0 0 4px; }
h2 { font-size: 18px; margin: 0 0 12px; }

.meta { color: var(--text-dim); font-size: 13px; margin-bottom: 20px; }

.filter-bar {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.filter-bar select, .filter-bar a.clear {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 6px 12px;
  border-radius: var(--radius);
  font-size: 13px;
  text-decoration: none;
}

.issue-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 10px;
  text-decoration: none;
  color: var(--text);
  transition: background 0.15s ease, border-color 0.15s ease;
}

.issue-card:hover { background: var(--surface-hover); border-color: #3a4150; }

.issue-title { font-size: 15px; font-weight: 600; margin-bottom: 6px; }

.issue-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }

.badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 100px;
  white-space: nowrap;
}
.badge.confirmed { background: rgba(76,175,125,0.15); color: var(--confirmed); }
.badge.unconfirmed { background: rgba(217,164,65,0.15); color: var(--unconfirmed); }
.badge.none { background: rgba(107,114,128,0.15); color: var(--none); }

.issue-sub { color: var(--text-dim); font-size: 12px; }

.pagination { display: flex; gap: 8px; justify-content: center; margin-top: 24px; }
.pagination a, .pagination span {
  padding: 6px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
  font-size: 13px;
}
.pagination span.current { background: var(--accent); color: #14171c; border-color: var(--accent); }

.back-link { color: var(--text-dim); font-size: 13px; text-decoration: none; display: inline-block; margin-bottom: 16px; }
.back-link:hover { color: var(--text); }

.detail-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
}

.detail-block .label { color: var(--text-dim); font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 6px; }
.detail-block p { margin: 0; white-space: pre-wrap; }

.source-message {
  border-left: 2px solid var(--border);
  padding: 10px 0 10px 16px;
  margin-bottom: 12px;
}
.source-message .author { font-weight: 600; font-size: 13px; }
.source-message .time { color: var(--text-dim); font-size: 12px; margin-left: 8px; }
.source-message .text { margin-top: 4px; font-size: 14px; }
.source-message img, .source-message video {
  max-width: 100%;
  border-radius: var(--radius);
  margin-top: 8px;
  display: block;
}

/* Login page */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  width: 320px;
}
.login-card h1 { text-align: center; margin-bottom: 24px; }
.login-card input {
  width: 100%;
  padding: 10px 12px;
  margin-bottom: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 14px;
}
.login-card button {
  width: 100%;
  padding: 10px;
  background: var(--accent);
  border: none;
  border-radius: var(--radius);
  color: #14171c;
  font-weight: 600;
  cursor: pointer;
  font-size: 14px;
}
.login-error { color: #e0655b; font-size: 13px; margin-bottom: 12px; }


/* Светлая тема — переопределяет переменные при наличии класса .theme-light на <html> */

.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 5px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
}
.theme-toggle:hover { color: var(--text); }







html.theme-light {
  --bg: #ffffff;
  --surface: #f6f8fa;
  --surface-hover: #eaeef2;
  --border: #d0d7de;
  --text: #1f2328;
  --text-dim: #656d76;
  --accent: #0969da;
  --confirmed: #1a7f37;
  --unconfirmed: #9a6700;
  --none: #656d76;
  --heat-0: #ebedf0;
  --heat-1: #9be9a8;
  --heat-2: #40c463;
  --heat-3: #30a14e;
  --heat-4: #216e39;
}


/* Полоса heatmap-календаря на несколько месяцев, сверху главной страницы */
.heatmap-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 20px;
  overflow-x: auto;
}

.heatmap-months {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 13px;
  gap: 3px;
  margin-bottom: 4px;
  font-size: 11px;
  color: var(--text-dim);
  height: 14px;
}

.heatmap-grid {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 13px;
  grid-template-rows: repeat(7, 11px);
  gap: 3px;
}

.heat-cell {
  width: 11px;
  height: 11px;
  border-radius: 2px;
}


.cal-tooltip {
  position: fixed;
  background: #000;
  color: #fff;
  font-size: 11px;
  padding: 5px 9px;
  border-radius: 5px;
  pointer-events: none;
  white-space: nowrap;
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.1s ease;
}
.cal-tooltip.visible { opacity: 1; }
