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

:root {
  /* The Static Dev — base palette (dark, the suite's default). See CLAUDE.md
     → Branding. Dark ships unclassed; html.light overrides below carry the
     light palette instead — the inverse of this file's pre-rebrand pattern
     (light default + html.dark), flipped to match Flatify/thestatic.dev.
     Token names (`--ink`/`--surface`/`--surface-2`) and `--border-strong`'s
     value match Prettify/Flatify now too — see CHANGELOG. */
  --ink: #13161C;
  --surface: #1C212B;
  --surface-2: #232934;
  --border: #2A303C;
  /* Solved for ≥3:1 (WCAG 1.4.11) against every surface it sits on — see
     Prettify's src/styles/main.css header for the full derivation. Was
     #424856, an unaudited legacy value. */
  --border-strong: #767A83;
  --border-stronger: rgba(150,157,168,0.4);
  --text: #E7E9EE;
  --muted: #8B93A1;
  --spark: #F2B33D;
  /* GitPulse's own second brand color (logo bottom half), invariant across
     themes like --spark. Used for focus rings and the primary button fill —
     see .btn-p's comment for why its text pairs with a literal dark, not a
     theme-variant token. */
  --accent: #65A30D;
  --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;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
  --sans: var(--mono);
  --radius: 8px;
}

html.light {
  --ink: #EEF0F3;
  --surface: #FFFFFF;
  --surface-2: #EEF0F3;
  --border: #D8DCE3;
  --border-strong: #82868E;
  --border-stronger: rgba(150,157,168,0.6);
  --text: #1A1E27;
  --muted: #5B6472;
  --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;
}

body {
  background: var(--ink);
  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(--surface); 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:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* Fixed dark text, not var(--ink) — --accent doesn't change with the theme,
   so its paired text can't either. #65A30D clears AA (5.9:1) with a dark
   foreground but not white (3.1:1), so this is deliberately the literal
   dark ink rather than the light one a theme flip could land on. */
.btn-p { background: var(--accent); color: #13161C; border-color: transparent; font-weight: 500; }
.btn-p:hover { background: var(--accent); color: #13161C; 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(--surface); 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; }
@media (max-width: 639px) { .sg { grid-template-columns: 1fr; } }
.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; }
/* Real 48x48 hit target, occupying genuine layout space (no negative margin — that trick made the
   button's hit box physically overlap the input below it). The visible "?" stays a small 14px dot (.tbtn-dot). */
.tbtn { width: 48px; height: 48px; margin: 0; padding: 0; border: none; background: transparent; cursor: help; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.tbtn-dot { width: 14px; height: 14px; border-radius: 50%; border: 1px solid var(--border-strong); font-size: 9px; font-weight: 500; color: var(--muted); font-family: var(--mono); display: flex; align-items: center; justify-content: center; pointer-events: none; }
.tbox { display: none; position: absolute; left: 18px; top: -2px; background: var(--surface-2); 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(--ink); padding: 1px 4px; border-radius: 3px; }
.tip:hover .tbox, .tip:focus-within .tbox { display: block; }

input[type="text"], input[type="password"] { background: var(--ink); 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(--accent); box-shadow: 0 0 0 2px var(--accent); }

/* Heatmap */
.hm-card { background: var(--surface); 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-cell:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
.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(--surface-2); 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(--surface); 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(--surface); 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(--surface-2); }
.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(--surface-2); 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(--ink); 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); }

/* Respect the user's motion preference */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
