*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #ffffff;
  --s1: #f9fafb;
  --s2: #f3f4f6;
  --border: #e5e7eb;
  --border-strong: #d1d5db;
  --border-stronger: rgba(156,163,175,0.6);
  --text: #111827;
  --muted: #6b7280;
  --commit: #16a34a;
  --merge: #9333ea;
  --release: #2563eb;
  --gh: #388BFD;
  --gl: #FC6D26;
  --danger: #dc2626;
  --danger-bg: rgba(220,38,38,0.08);
  --danger-border: rgba(220,38,38,0.25);
  --commit-bg: rgba(22,163,74,0.10);
  --merge-bg: rgba(147,51,234,0.10);
  --release-bg: rgba(37,99,235,0.10);
  --gh-bg: rgba(56,139,253,0.12);
  --gl-bg: rgba(252,109,38,0.12);
  --hm-0: #ebedef;
  --hm-1: rgba(22,163,74,0.25);
  --hm-2: rgba(22,163,74,0.45);
  --hm-3: rgba(22,163,74,0.70);
  --hm-4: #16a34a;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
  --sans: var(--mono);
  --radius: 8px;
}

html.dark {
  --bg: #000000;
  --s1: #111827;
  --s2: #1f2937;
  --border: #1f2937;
  --border-strong: #374151;
  --border-stronger: rgba(156,163,175,0.4);
  --text: #f9fafb;
  --muted: #9ca3af;
  --commit: #4ade80;
  --merge: #c084fc;
  --release: #60a5fa;
  --gh: #58A6FF;
  --gl: #FD8C5A;
  --danger: #f87171;
  --danger-bg: rgba(248,113,113,0.12);
  --danger-border: rgba(248,113,113,0.3);
  --commit-bg: rgba(74,222,128,0.12);
  --merge-bg: rgba(192,132,252,0.12);
  --release-bg: rgba(96,165,250,0.12);
  --gh-bg: rgba(56,139,253,0.18);
  --gl-bg: rgba(252,109,38,0.18);
  --hm-0: #1f2937;
  --hm-1: rgba(74,222,128,0.2);
  --hm-2: rgba(74,222,128,0.4);
  --hm-3: rgba(74,222,128,0.65);
  --hm-4: #4ade80;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  transition: background-color .3s, color .3s;
}

/* Layout */
.container { max-width: 64rem; margin: 0 auto; }
.site-header { padding: 48px 16px; text-align: center; }
.main { padding: 24px 16px 96px; }
@media (min-width: 640px) {
  .site-header { padding: 64px 24px; }
  .main { padding: 24px 24px 96px; }
}
@media (min-width: 1024px) {
  .site-header { padding: 64px 32px; }
  .main { padding: 24px 32px 96px; }
}

/* Brand */
.brand { display: inline-flex; align-items: center; gap: 14px; text-decoration: none; color: var(--text); transition: opacity .15s; }
.brand:hover { opacity: 0.82; }
.brand-logo { width: 44px; height: 44px; display: block; flex-shrink: 0; }
.brand-title { font-size: 36px; font-weight: 300; letter-spacing: -0.02em; line-height: 1; }
@media (min-width: 640px) { .brand-title { font-size: 44px; } }
.brand-subtitle { margin-top: 12px; font-size: 13px; color: var(--muted); letter-spacing: 0.01em; }
@media (min-width: 640px) { .brand-subtitle { font-size: 15px; } }

/* Header controls */
.hdr-r { display: flex; align-items: center; gap: 8px; }
.ts { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.ic { width: 14px; height: 14px; display: block; }
.ic-lock { width: 13px; height: 13px; display: block; }
.fico .ic-f { width: 15px; height: 15px; display: inline-block; vertical-align: middle; }
.rst .ic-s { width: 12px; height: 12px; display: inline-block; vertical-align: -2px; }

.btn { display: inline-flex; align-items: center; gap: 5px; background: var(--s1); color: var(--muted); border: 1px solid var(--border-strong); border-radius: var(--radius); padding: 6px 11px; font-size: 12px; font-family: var(--mono); cursor: pointer; transition: color .15s, border-color .15s, background-color .15s; }
.btn:hover { color: var(--text); border-color: var(--text); }
.btn-p { background: var(--text); color: var(--bg); border-color: transparent; font-weight: 500; }
.btn-p:hover { background: var(--text); color: var(--bg); border-color: transparent; opacity: 0.85; }

/* Error */
.err { background: var(--danger-bg); border: 1px solid var(--danger-border); border-radius: var(--radius); color: var(--danger); font-size: 12px; padding: 8px 12px; margin-bottom: 12px; }

/* Settings */
.stg { background: var(--s1); border: 1px solid var(--border); border-radius: 12px; padding: 18px; margin-bottom: 16px; }
.slbl { font-size: 11px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-bottom: 12px; }
.sg { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.pf { display: flex; flex-direction: column; gap: 8px; }
.ph { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; margin-bottom: 2px; }
.fdot { width: 7px; height: 7px; border-radius: 50%; }
.fld { display: flex; flex-direction: column; gap: 3px; }
.flbl { display: flex; align-items: center; gap: 4px; font-size: 11px; color: var(--muted); }

.tip { position: relative; display: inline-flex; }
.tbtn { width: 14px; height: 14px; border-radius: 50%; border: 1px solid var(--border-strong); background: transparent; font-size: 9px; font-weight: 500; color: var(--muted); cursor: help; display: flex; align-items: center; justify-content: center; font-family: var(--mono); }
.tbox { display: none; position: absolute; left: 18px; top: -2px; background: var(--s2); border: 1px solid var(--border-strong); border-radius: var(--radius); padding: 10px 12px; width: 220px; z-index: 50; font-size: 11px; line-height: 1.65; color: var(--text); box-shadow: 0 8px 24px rgba(0,0,0,0.25); }
.tbox b { display: block; font-weight: 500; margin-bottom: 5px; }
.tbox ol { padding-left: 16px; list-style: decimal; }
.tbox li { margin-bottom: 2px; color: var(--muted); }
.tbox code { font-family: var(--mono); font-size: 10px; background: var(--bg); padding: 1px 4px; border-radius: 3px; }
.tip:hover .tbox { display: block; }

input[type="text"], input[type="password"] { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); font-family: var(--mono); font-size: 12px; padding: 7px 10px; min-height: 48px; width: 100%; outline: none; transition: border-color .15s, box-shadow .15s; }
input:focus { border-color: var(--border-strong); box-shadow: 0 0 0 2px var(--border); }

/* Heatmap */
.hm-card { background: var(--s1); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; margin-bottom: 12px; }
.hm-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.hm-sel-info { font-size: 11px; color: var(--muted); font-family: var(--mono); }
.hm-sel-info span { color: var(--text); }
.hm-wrap { overflow-x: auto; padding-bottom: 4px; flex: 1; min-width: 0; }
.hm-grid { display: flex; gap: 2px; align-items: flex-start; }
.hm-col { display: flex; flex-direction: column; gap: 2px; }
.hm-month-row { position: relative; height: 14px; margin-bottom: 4px; }
.hm-day-labels { display: flex; flex-direction: column; gap: 2px; margin-right: 4px; padding-top: 18px; }
.hm-day-lbl { height: 12px; font-size: 9px; font-family: var(--mono); color: var(--muted); line-height: 12px; }
.hm-cell { width: 12px; height: 12px; border-radius: 2px; cursor: pointer; transition: opacity .1s; flex-shrink: 0; }
.hm-cell:hover { opacity: 0.75; }
.hm-cell.selected { outline: 2px solid var(--border-stronger); outline-offset: 1px; }
.hm-l0 { background: var(--hm-0); }
.hm-l1 { background: var(--hm-1); }
.hm-l2 { background: var(--hm-2); }
.hm-l3 { background: var(--hm-3); }
.hm-l4 { background: var(--hm-4); }
.hm-sw { width: 12px; height: 12px; border-radius: 2px; }

/* Heatmap tooltip */
.hm-tooltip { display: none; position: fixed; background: var(--s2); border: 1px solid var(--border-strong); border-radius: var(--radius); padding: 8px 10px; font-size: 11px; z-index: 100; pointer-events: none; min-width: 140px; box-shadow: 0 4px 16px rgba(0,0,0,0.2); }
.hm-tooltip.visible { display: block; }
.hm-tt-date { font-weight: 500; margin-bottom: 4px; color: var(--text); font-family: var(--mono); }
.hm-tt-row { display: flex; align-items: center; gap: 5px; color: var(--muted); margin-top: 2px; }
.hm-tt-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }

/* Stats */
#sRow { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 12px; }
.sc { background: var(--s1); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; }
.sn { font-family: var(--mono); font-size: 28px; font-weight: 500; line-height: 1; margin-bottom: 4px; }
.sl { font-size: 11px; color: var(--muted); letter-spacing: 0.05em; text-transform: uppercase; }
.speriod { font-size: 10px; color: var(--muted); margin-top: 3px; font-family: var(--mono); }

/* Feed */
.fc { background: var(--s1); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; margin-bottom: 12px; }
.fhdr { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.fi { display: grid; grid-template-columns: 18px 1fr auto; gap: 10px; align-items: center; padding: 9px 16px; border-bottom: 1px solid var(--border); transition: background .1s; }
.fi:last-child { border-bottom: none; }
.fi:hover { background: var(--s2); }
.fico { font-size: 15px; text-align: center; }
.fib { min-width: 0; }
.firp { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.firp-owner { color: var(--muted); font-family: var(--mono); }
.firp-name { font-family: var(--mono); }
.fisb { font-size: 11px; color: var(--muted); font-family: var(--mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.fim { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; flex-shrink: 0; }
.fib2 { display: flex; gap: 3px; }
.fit { font-size: 10px; color: var(--muted); font-family: var(--mono); }

/* Badges */
.bdg { font-size: 10px; font-weight: 500; padding: 2px 6px; border-radius: 4px; font-family: var(--mono); }
.bgh { background: var(--gh-bg); color: var(--gh); }
.bgl { background: var(--gl-bg); color: var(--gl); }
.bcm { background: var(--commit-bg); color: var(--commit); }
.bmg { background: var(--merge-bg); color: var(--merge); }
.brl { background: var(--release-bg); color: var(--release); }
.bnt { background: var(--s2); color: var(--muted); }

/* Repos */
.rg { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; padding: 14px 16px; }
.rg .spin { grid-column: 1 / -1; }
.rc { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 13px 15px; }
.rch { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 10px; }
.rn { font-size: 12px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rn-owner { font-family: var(--mono); color: var(--muted); font-weight: 400; }
.rn-name { font-family: var(--mono); }
.rss { display: flex; gap: 10px; flex-wrap: wrap; }
.rst { font-size: 11px; color: var(--muted); display: flex; align-items: center; gap: 4px; }
.rsn { font-family: var(--mono); font-weight: 500; color: var(--text); }

/* Privacy notice (in footer) */
.privacy-icon { flex-shrink: 0; font-size: 13px; margin-top: 1px; }
.spin { display: flex; gap: 5px; justify-content: center; padding: 28px; }
.spin-inline { padding: 4px 0; justify-content: flex-start; }
.hm-grid .spin { flex: 1; }
.sd { width: 5px; height: 5px; border-radius: 50%; background: var(--muted); animation: sp 1s ease-in-out infinite; }
.sd:nth-child(2) { animation-delay: .15s; }
.sd:nth-child(3) { animation-delay: .3s; }
@keyframes sp { 0%,80%,100% { opacity: .25; transform: scale(.7); } 40% { opacity: 1; transform: scale(1); } }
.emp { padding: 28px; text-align: center; color: var(--muted); font-size: 13px; }
.hidden { display: none !important; }

/* Footer */
.site-footer { margin-top: 2rem; padding-top: 2rem; border-top: 1px solid var(--border); text-align: center; color: var(--muted); }
.footer-privacy { display: flex; align-items: center; gap: 8px; margin-bottom: 20px; font-size: 13px; flex-direction: column; }
.footer-copy { font-size: 13px; }
.footer-version { font-size: 11px; margin-top: 8px; font-family: var(--mono); }
