/*
 * GitPulse — tool stylesheet.
 *
 * Loaded after the suite's shared package (vendor/thestaticdev-ui/css/
 * tokens.css + components.css), which provides the palette, layout, brand
 * header, buttons, banners, settings card, form controls, tooltip, spinner
 * and footer. This file only holds GitPulse's own colours, the few places
 * where it differs from the suite, and its own components.
 */

:root {
  /* GitPulse's own second brand colour (logo bottom half), invariant across
     themes. #13161C on #65A30D is 5.9:1 (white would be 3.1:1), which is the
     suite's default --on-accent, so .btn-p needs nothing else. */
  --accent: #65A30D;

  /* GitPulse-only colours, deliberately outside the shared palette: they carry
     meaning (activity type, platform) a single accent can't express. */
  --border-stronger: rgba(150,157,168,0.4);
  --commit: #4ade80;
  --merge: #c084fc;
  --release: #60a5fa;
  --gh: #58A6FF;
  --gl: #FD8C5A;
  --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;
}

html.light {
  --border-stronger: rgba(150,157,168,0.6);
  --commit: #16a34a;
  --merge: #9333ea;
  --release: #2563eb;
  --gh: #388BFD;
  --gl: #FC6D26;
  --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;
}

/* ── Where GitPulse differs from the suite ───────────────────────────── */

/* Icons: 14px in the header buttons (the suite default in buttons is 13px),
   sized per context in the feed and repo stats. */
.ic, .btn .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; }

/* Loading: padded block by default, inline variant for small spots */
.spin { padding: 28px; }
.spin-inline { padding: 4px 0; justify-content: flex-start; }
.hm-grid .spin { flex: 1; }

/* ── Header controls ─────────────────────────────────────────────────── */

.hdr-r { display: flex; align-items: center; gap: 8px; }
.ts { font-family: var(--mono); font-size: 11px; color: var(--muted); }

/* ── Token panel ─────────────────────────────────────────────────────── */

.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); }

/* Footer row: "Remember me" on the left, the primary action on the right (wraps on narrow screens) */
.cfg-actions { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; margin-top: 14px; }
.cfg-actions .btn { margin-left: auto; } /* stays right-aligned even when it wraps under the checkbox */
/* Same checkbox as GitDash. The whole label is the tap target (48px tall);
   its focus outline comes from the shared package. */
.chk { display: flex; align-items: center; gap: 10px; min-height: 48px; font-size: 13px; cursor: pointer; }
.chk input { width: 18px; height: 18px; flex-shrink: 0; accent-color: var(--accent); cursor: pointer; }

/* 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; flex-wrap: wrap; gap: 4px 12px; 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); }

/* Demo mode (see js/demo.js): a dashed banner on top, and a "Demo" badge on each section, shown only while html.is-demo is set */
.demo { display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; margin: 0 0 16px; padding: 12px 16px; background: var(--surface); border: 1px dashed var(--spark-text); border-radius: var(--radius); font-size: 13px; line-height: 1.5; }
.demo strong { color: var(--spark-text); font-weight: 500; }
.hdg { display: flex; align-items: center; gap: 8px; }
.demo-only { display: none; }
.is-demo .demo-only { display: inline-block; }
.bdemo { color: var(--spark-text); border: 1px solid var(--spark-text); }

/* 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); }

/* New-version notice (js/register-sw.js): bottom-left, leaving room for the theme toggle on the right */
.update-wrap { position: fixed; left: 16px; right: 96px; bottom: 16px; z-index: 60; max-width: 440px; }
.update { display: flex; align-items: center; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; padding: 12px 16px; background: var(--surface-2); border: 1px solid var(--border-strong); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(0,0,0,0.25); font-size: 13px; line-height: 1.5; }
.update p { margin: 0; }
.update-actions { display: flex; gap: 8px; }
.update .btn { min-height: 48px; }
