/* =====================================================================
   Stale — stylesheet
   Aesthetic: sharp, editorial, precise. Geist grotesque type, hairline
   borders, tight corners, near-monochrome graphite surfaces with a single
   cool accent. Semantic warmth reserved for state (amber = stale, green =
   fresh). Built to read perfectly at every glance.
   ===================================================================== */

/* ---------- type: Geist (SIL OFL) bundled for offline parity ---------- */
@font-face { font-family: "Geist"; font-weight: 400; font-style: normal; font-display: swap;
  src: url("../fonts/Geist-Regular.woff2") format("woff2"); }
@font-face { font-family: "Geist"; font-weight: 500; font-style: normal; font-display: swap;
  src: url("../fonts/Geist-Medium.woff2") format("woff2"); }
@font-face { font-family: "Geist"; font-weight: 600; font-style: normal; font-display: swap;
  src: url("../fonts/Geist-SemiBold.woff2") format("woff2"); }
@font-face { font-family: "Geist"; font-weight: 700; font-style: normal; font-display: swap;
  src: url("../fonts/Geist-Bold.woff2") format("woff2"); }
@font-face { font-family: "Geist Mono"; font-weight: 400; font-style: normal; font-display: swap;
  src: url("../fonts/GeistMono-Regular.woff2") format("woff2"); }

:root {
  /* light (default) — clean paper, graphite ink */
  --bg: #ececed;
  --bg2: #f6f6f7;
  --win: #ffffff;
  --text: #0c0c0e;
  --dim: #5c5c63;
  --dimmer: #9596a0;
  --line: #e7e7ea;
  --line2: #d4d4d9;
  --chip: #f1f1f3;

  --blue: #0a6dff;
  --blue-d: #0356d6;
  --green: #1db954;
  --green-d: #137d44;
  --amber: #e8820e;
  --amber-d: #b5650b;
  --red: #e22a20;
  --red-d: #b71d15;

  --shadow-win: 0 28px 60px -30px rgba(0,0,0,0.30), 0 8px 20px -14px rgba(0,0,0,0.16);
  --shadow-sm: 0 1px 1px rgba(0,0,0,0.04);
  --ring-focus: 0 0 0 3px color-mix(in srgb, var(--blue) 30%, transparent);

  --sans: "Geist", -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  /* sharp corners — tight, deliberate */
  --radius-sm: 6px;
  --radius: 9px;
  --radius-lg: 12px;

  --ease: cubic-bezier(.2,.8,.2,1);
}

@media (prefers-color-scheme: dark) {
  :root {
    /* near-black graphite, crisp hairlines */
    --bg: #0d0d0f;
    --bg2: #161619;
    --win: #1c1c20;
    --text: #f4f4f6;
    --dim: #9b9ba4;
    --dimmer: #65656e;
    --line: #2a2a30;
    --line2: #36363d;
    --chip: #26262c;

    --blue: #4d9bff;
    --blue-d: #7fb6ff;
    --green: #2fce72;
    --green-d: #5ee08e;
    --amber: #ffae3a;
    --amber-d: #ffc46e;
    --red: #ff5a4f;
    --red-d: #ff8076;

    --shadow-win: 0 28px 60px -30px rgba(0,0,0,0.75), 0 8px 20px -14px rgba(0,0,0,0.55);
    --shadow-sm: 0 1px 1px rgba(0,0,0,0.25);
    --ring-focus: 0 0 0 3px color-mix(in srgb, var(--blue) 38%, transparent);
  }
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "cv01", "ss03";          /* Geist: open digits, sharper a/g */
  padding: clamp(16px, 4vw, 40px) 16px 30px;
}

::selection { background: color-mix(in srgb, var(--blue) 26%, transparent); }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ---------- icons (Lucide, inline SVG, inherit color + size) ---------- */
.icon {
  width: 1.05em; height: 1.05em; flex: none;
  display: inline-block; vertical-align: -0.16em;
  stroke-width: 2; overflow: visible;
}
/* buttons that lead with an icon: align + space it from the label */
.btn .icon, .copy-btn .icon, .install-btn .icon { vertical-align: -0.18em; margin-right: 1px; }
.icon.inline { width: 1em; height: 1em; vertical-align: -0.14em; }
.icon.tiny { width: 13px; height: 13px; vertical-align: -0.18em; margin-right: 3px; }
.ver.same .icon.tiny { color: var(--green-d); }
.update-status .icon.tiny { vertical-align: -0.16em; }

/* ---------- window chrome ---------- */
.window {
  max-width: 760px; margin: 0 auto;
  background: var(--win);
  border: 1px solid var(--line2);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-win);
  overflow: hidden;
}
.titlebar {
  position: relative;              /* anchor for the absolutely-centered title */
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--win);
}
.traffic { display: flex; gap: 8px; }
.traffic i { width: 11px; height: 11px; border-radius: 50%; display: block; }
.traffic i:nth-child(1){ background:#ff5f57; } .traffic i:nth-child(2){ background:#febc2e; } .traffic i:nth-child(3){ background:#28c840; }
/* Title is centered to the WINDOW, not to the leftover flex space — so uneven
   left/right groups (e.g. the wide "apps tracked" status) never shift it off-center.
   pointer-events:none keeps clicks passing through to anything beneath. */
.title {
  position: absolute; left: 50%; transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: 6px;
  white-space: nowrap; pointer-events: none;
  font-size: 12.5px; font-weight: 600; color: var(--dim); user-select: none; letter-spacing: 0.02em;
}
.titlebar-right { display: flex; align-items: center; gap: 10px; margin-left: auto; }

.install-btn {
  appearance: none; border: 1px solid var(--blue); background: color-mix(in srgb, var(--blue) 12%, transparent);
  color: var(--blue-d); font-family: var(--sans); font-size: 12px; font-weight: 600;
  padding: 5px 11px; border-radius: 8px; cursor: pointer; white-space: nowrap;
  transition: background .15s, transform .05s;
}
.install-btn:hover { background: color-mix(in srgb, var(--blue) 20%, transparent); }
.install-btn:active { transform: translateY(1px); }

.db { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--dimmer); white-space: nowrap; }
.db .led { width: 7px; height: 7px; border-radius: 50%; background: var(--dimmer); transition: background .3s, box-shadow .3s; }
.db.ready .led { background: var(--green); box-shadow: 0 0 7px var(--green); }
.db.error .led { background: var(--red); box-shadow: 0 0 7px var(--red); }

/* ---------- body ---------- */
.body { padding: clamp(22px, 4vw, 34px) clamp(18px, 4vw, 34px) 32px; }

/* hero */
.hero { text-align: center; margin-bottom: 26px; }
.leaf-mark { line-height: 1; color: var(--green-d); display: inline-flex; }
.leaf-mark .icon { width: 34px; height: 34px; stroke-width: 1.75; }
.title .icon.title-leaf { width: 14px; height: 14px; color: var(--green-d); vertical-align: -0.16em; }
.privacy .icon { color: var(--dim); }
.hero h1 {
  font-size: clamp(24px, 4.4vw, 32px); font-weight: 600; letter-spacing: -0.035em;
  margin-top: 10px; line-height: 1.05;
}
.hero .lede { color: var(--dim); font-size: 14.5px; max-width: 480px; margin: 10px auto 0; line-height: 1.45; }
.hero .privacy { font-size: 12px; color: var(--dimmer); margin-top: 14px; letter-spacing: 0; }
.hero .privacy strong { color: var(--dim); font-weight: 600; }
.hero .privacy .lock { margin-right: 2px; }

/* resume banner */
.resume {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  background: color-mix(in srgb, var(--blue) 8%, var(--bg2));
  border: 1px solid color-mix(in srgb, var(--blue) 25%, var(--line));
  border-radius: var(--radius); padding: 12px 16px; margin-bottom: 20px;
}
.resume-text { font-size: 13.5px; }
.resume-text strong { font-weight: 600; }
.resume-text span { color: var(--dim); }

/* steps */
.steps { list-style: none; display: flex; flex-direction: column; gap: 20px; }
.step-label { display: flex; align-items: center; gap: 9px; font-weight: 600; font-size: 14.5px; margin-bottom: 9px; flex-wrap: wrap; }
.step-label .num {
  width: 22px; height: 22px; border-radius: 50%; background: var(--blue); color: #fff;
  display: grid; place-items: center; font-size: 12px; font-weight: 700; flex: none;
}
.step-label .sub { color: var(--dim); font-weight: 400; font-size: 13px; }

.cmd {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg2); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 11px 11px 11px 15px;
}
.cmd code { font-family: var(--mono); font-size: 13px; color: var(--text); flex: 1; overflow-x: auto; white-space: nowrap; }
.cmd code .muted { color: var(--dimmer); }
.cmd code::-webkit-scrollbar { height: 0; }

.copy-btn {
  flex: none; appearance: none; border: 1px solid var(--line2); background: var(--win); color: var(--text);
  font-family: var(--sans); font-size: 12.5px; font-weight: 500; padding: 7px 14px; border-radius: var(--radius-sm); cursor: pointer;
  transition: background .12s, border-color .12s, color .12s, transform .05s;
}
.copy-btn:hover { border-color: var(--blue); color: var(--blue); }
.copy-btn:active { transform: translateY(1px); }
.copy-btn.done { background: var(--green); border-color: var(--green); color: #fff; }

textarea#input {
  width: 100%; min-height: 96px; resize: vertical;
  background: var(--bg2); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 13px 15px; font-family: var(--mono); font-size: 12.5px; color: var(--text); line-height: 1.6;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
textarea#input:focus { outline: none; border-color: var(--blue); box-shadow: var(--ring-focus); }
textarea#input::placeholder { color: var(--dimmer); }
textarea#input.dragover { border-color: var(--blue); border-style: dashed; background: color-mix(in srgb, var(--blue) 7%, var(--bg2)); }

.row-actions { display: flex; gap: 10px; align-items: center; margin-top: 12px; flex-wrap: wrap; }

.btn {
  appearance: none; font-family: var(--sans); font-weight: 500; font-size: 13.5px; border-radius: var(--radius-sm);
  padding: 9px 16px; cursor: pointer; border: 1px solid var(--line2); background: var(--win); color: var(--text);
  transition: filter .12s, background .12s, border-color .12s, transform .05s, opacity .12s;
  display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; letter-spacing: -0.01em;
}
.btn:hover { border-color: var(--blue); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: var(--ring-focus); }
.btn.primary { background: var(--text); color: var(--win); border-color: var(--text); font-weight: 600; }
.btn.primary:hover { filter: none; opacity: .88; }
.btn.primary:disabled { opacity: .4; cursor: not-allowed; }
.btn.link { border: none; background: none; color: var(--dim); padding: 9px 6px; }
.btn.link:hover { color: var(--text); }
.btn.small { font-size: 12.5px; padding: 7px 12px; }
.btn.ghost { background: var(--bg2); }
.btn.ghost:hover { background: var(--chip); }

/* ===================== results ===================== */
.results { animation: rise .32s var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* scoreboard + gauge */
.scoreboard {
  display: flex; align-items: center; gap: clamp(16px, 4vw, 30px);
  background: var(--bg2); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 22px clamp(18px, 4vw, 28px); margin-bottom: 14px;
}
.gauge-wrap { position: relative; width: 124px; height: 124px; flex: none; }
.gauge { width: 124px; height: 124px; transform: rotate(-90deg); }
.gauge-track { fill: none; stroke: var(--line2); stroke-width: 9; opacity: .6; }
.gauge-fill {
  fill: none; stroke: var(--green); stroke-width: 9; stroke-linecap: round;
  stroke-dasharray: 326.7; stroke-dashoffset: 326.7;            /* 2πr, r=52 */
  transition: stroke-dashoffset 1.1s var(--ease), stroke .8s ease;
}
.gauge-center {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.gauge-score { font-size: 40px; font-weight: 600; line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: -0.04em; }
.gauge-cap { font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.16em; color: var(--dimmer); margin-top: 4px; font-weight: 600; }
.scoreboard-text { min-width: 0; }
.scoreboard-text h2 { font-size: clamp(19px, 3.4vw, 24px); letter-spacing: -0.03em; font-weight: 600; }
.muted-text { color: var(--dim); font-size: 13.5px; margin-top: 4px; }

.diff { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 7px; }
.diff .pill-diff {
  font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px;
  background: var(--win); border: 1px solid var(--line2);
}
.diff .pill-diff.up { color: var(--green-d); border-color: color-mix(in srgb, var(--green) 40%, var(--line2)); }
.diff .pill-diff.new { color: var(--blue-d); border-color: color-mix(in srgb, var(--blue) 40%, var(--line2)); }

/* summary chips */
.summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 16px; }
.sumcard {
  background: var(--bg2); border: 1px solid var(--line); border-radius: var(--radius); padding: 13px 15px;
  cursor: pointer; transition: border-color .12s, transform .06s, background .12s;
  color: var(--text); font: inherit; text-align: left; appearance: none;  /* <button> resets — else numbers default to black */
}
.sumcard:hover { border-color: var(--line2); }
.sumcard:active { transform: translateY(1px); }
/* default number color is explicit (a <button> doesn't inherit text color) */
.sumcard .n { font-size: 26px; font-weight: 600; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; line-height: 1; color: var(--text); }
.sumcard .l { font-size: 10.5px; color: var(--dim); font-weight: 500; margin-top: 6px; text-transform: uppercase; letter-spacing: 0.06em; }
.sumcard.act .n { color: var(--amber-d); }
.sumcard.ok .n { color: var(--green-d); }

/* toolbar */
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.searchbar { position: relative; flex: 1; min-width: 180px; }
.searchbar .search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--dimmer); display: inline-flex; }
.searchbar .search-icon .icon { width: 15px; height: 15px; }
.searchbar input {
  width: 100%; background: var(--bg2); border: 1px solid var(--line); border-radius: 11px;
  padding: 10px 14px 10px 34px; font-family: var(--sans); font-size: 14px; color: var(--text);
}
.searchbar input:focus { outline: none; border-color: var(--blue); box-shadow: var(--ring-focus); }
.toolbar-actions { display: flex; gap: 8px; }

/* groups */
.group { margin-bottom: 12px; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--win); }
.group > summary {
  list-style: none; cursor: pointer; padding: 13px 16px; display: flex; align-items: center; gap: 10px;
  font-weight: 600; font-size: 14px; user-select: none; background: var(--bg2);
}
.group > summary::-webkit-details-marker { display: none; }
.group > summary:focus-visible { outline: none; box-shadow: inset var(--ring-focus); }
.group > summary .dot { display: inline-flex; }
.group > summary .dot .icon { width: 16px; height: 16px; }
/* tint each group's icon with its semantic color */
.group.action > summary .dot { color: var(--amber-d); }
.group.self   > summary .dot { color: var(--dim); }
.group.ok     > summary .dot { color: var(--green-d); }
.group.unknown> summary .dot { color: var(--dimmer); }
.group.mas    > summary .dot { color: var(--blue); }
.group > summary .badge { font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 999px; color: #fff; }
.group > summary .chev { margin-left: auto; color: var(--dimmer); display: inline-flex; transition: transform .18s var(--ease); }
.group > summary .chev .icon { width: 15px; height: 15px; }
.group[open] > summary .chev { transform: rotate(90deg); }
.group.action > summary .badge { background: var(--amber); }
.group.self   > summary .badge { background: var(--dimmer); }
.group.ok     > summary .badge { background: var(--green); }
.group.unknown> summary .badge { background: var(--line2); color: var(--dim); }
.group.mas    > summary .badge { background: var(--blue); }
.group .group-head-extra { margin-left: 8px; }
.group > summary .mas-note { margin-left: auto; }
.group > summary .mas-note + .chev { margin-left: 10px; }
.group > summary .mas-note.warn { color: var(--amber-d); background: color-mix(in srgb, var(--amber) 14%, transparent); }

.applist { padding: 4px; }
.app { display: flex; align-items: center; gap: 13px; padding: 11px 12px; border-radius: 10px; }
.app + .app { border-top: 1px solid var(--line); }
.app .avatar {
  width: 34px; height: 34px; border-radius: 8px; flex: none; display: grid; place-items: center;
  color: #fff; font-weight: 600; font-size: 15px; overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.06), var(--shadow-sm);
}
/* when a real logo is present, drop the colored tile so transparent icon edges read true;
   keep a hairline ring so pale/transparent icons still have an edge on light surfaces */
.app .avatar.has-img { background: transparent !important; box-shadow: inset 0 0 0 1px rgba(128,128,128,0.14); }
.app .avatar img { width: 100%; height: 100%; object-fit: contain; display: block; }
.app .meta { flex: 1; min-width: 0; }
.app .name { font-weight: 600; font-size: 14px; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app .ver { font-size: 12.5px; color: var(--dim); font-variant-numeric: tabular-nums; margin-top: 2px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.app .ver .old { color: var(--dim); }
.app .ver .arrow { color: var(--dimmer); }
.app .ver .new { color: var(--amber-d); font-weight: 600; }
.app .ver.same .cur { color: var(--green-d); }
.sev {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px;
  padding: 2px 6px; border-radius: 5px;
}
.sev.major { background: color-mix(in srgb, var(--red) 16%, transparent); color: var(--red-d); }
.sev.minor { background: color-mix(in srgb, var(--amber) 18%, transparent); color: var(--amber-d); }
.sev.patch { background: var(--chip); color: var(--dim); }

.app .right { display: flex; align-items: center; gap: 7px; flex: none; }
.tag { font-size: 10.5px; font-weight: 600; color: var(--dim); background: var(--chip); padding: 3px 8px; border-radius: 6px; white-space: nowrap; }
.app .pill {
  font-family: var(--mono); font-size: 11px; color: var(--dim); background: var(--chip);
  border: 1px solid var(--line); padding: 4px 8px; border-radius: 7px; cursor: pointer; white-space: nowrap;
  transition: border-color .12s, color .12s;
}
.app .pill:hover { border-color: var(--blue); color: var(--blue); }

/* one-click update button + live progress */
.app .update-btn {
  font-family: var(--sans); font-weight: 600; color: var(--win); background: var(--blue);
  border-color: var(--blue);
}
.app .update-btn:hover { filter: brightness(1.06); color: var(--win); }
.app .update-btn:disabled { opacity: .65; cursor: default; }
.app .update-btn.done { background: var(--green); border-color: var(--green); }
.app .update-status {
  display: block; margin-top: 3px; font-family: var(--mono); font-size: 11px; color: var(--dim);
  font-variant-numeric: tabular-nums;
}
.app .update-status.running { color: var(--blue-d); }
.app .update-status.ok { color: var(--green-d); }
.app .update-status.err { color: var(--red-d); }
.app .open {
  width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--line2); background: var(--bg2);
  display: grid; place-items: center; color: var(--blue); text-decoration: none; font-size: 13px; transition: background .12s, color .12s;
}
.app .open:hover { background: var(--blue); color: #fff; border-color: var(--blue); }

.group-actions { padding: 8px 12px 12px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; }

.empty { text-align: center; color: var(--dim); font-size: 14px; padding: 28px 12px; }

.disclaimer {
  margin-top: 12px; font-size: 12px; color: var(--dimmer); line-height: 1.65;
  border-top: 1px solid var(--line); padding-top: 16px;
}
.disclaimer strong { color: var(--dim); font-weight: 600; }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(22px);
  background: var(--text); color: var(--win); font-weight: 600; font-size: 13px;
  padding: 11px 18px; border-radius: 11px; box-shadow: var(--shadow-win);
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s var(--ease); z-index: 80; max-width: 90vw;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.footnote { text-align: center; color: var(--dimmer); font-size: 12px; margin-top: 20px; line-height: 1.7; }
.footnote a { color: var(--dim); text-decoration: none; border-bottom: 1px dotted var(--dimmer); }
.footnote a:hover { color: var(--text); }

/* responsive */
@media (max-width: 600px) {
  .summary { grid-template-columns: repeat(2, 1fr); }
  .scoreboard { flex-direction: column; text-align: center; }
  .diff { justify-content: center; }
}

/* respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
  .gauge-fill { transition: none; }
}

/* build identity badge — marks this as the Local vs Web entity */
.build-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 999px;
  margin-left: 8px;
  line-height: 1.5;
  border: 1px solid transparent;
  vertical-align: middle;
  user-select: none;
}
[data-build="local"] .title .build-badge {
  color: var(--amber-d);
  background: color-mix(in srgb, var(--amber) 16%, transparent);
  border-color: color-mix(in srgb, var(--amber) 40%, transparent);
}
[data-build="web"] .title .build-badge {
  color: var(--blue);
  background: color-mix(in srgb, var(--blue) 14%, transparent);
  border-color: color-mix(in srgb, var(--blue) 38%, transparent);
}
[data-build="app"] .title .build-badge {
  color: var(--green);
  background: color-mix(in srgb, var(--green) 16%, transparent);
  border-color: color-mix(in srgb, var(--green) 40%, transparent);
}

/* ---------- Native app mode ---------- */
/* The one-click scanner; hidden by default, shown only inside Stale.app. */
.native-scan { display: none; margin-top: 6px; text-align: center; }
.native-hint { color: var(--dim); font-size: 12.5px; margin-top: 10px; }
.btn.big { font-size: 15px; padding: 13px 28px; border-radius: var(--radius); }

html[data-native="true"] .native-scan { display: block; }
/* In the native app there's no Terminal step and no "Add to Dock" — hide them. */
html[data-native="true"] .steps,
html[data-native="true"] #installBtn { display: none !important; }

/* ---------- Native app mode: dissolve the fake browser window ----------
   In Stale.app the page IS the window, so we drop the simulated window chrome
   (border / radius / shadow / max-width) and the fake traffic-light dots — the
   real macOS title bar already provides those. Everything goes edge-to-edge,
   and a single, subtle scroll area replaces the page-in-a-page look. */
/* Keep the document layout simple (height:100% only — this is the version that renders
   reliably in the WKWebView). We do NOT touch html/body overflow. */
html[data-native="true"], html[data-native="true"] body {
  height: 100%;
}
html[data-native="true"] body {
  padding: 0;
  margin: 0;
  background: var(--win);          /* one seamless surface, no outer frame */
}
html[data-native="true"] .window {
  max-width: none;
  width: 100%;
  margin: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
}
/* real macOS traffic lights replace the fake ones */
html[data-native="true"] .traffic { display: none; }
/* Pin the header to the viewport top with position:fixed — immune to whatever the
   WKWebView's scroll view does, so it can never scroll away. The body is padded down
   by the header height so content starts below it. */
html[data-native="true"] .titlebar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 20;
  padding: 12px 16px 12px 80px;
  background: var(--win);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 60%, transparent);
  -webkit-user-select: none;
}
html[data-native="true"] .body {
  padding-top: 58px;               /* clear the fixed header */
}
/* keep the footer pinned, quiet, inside the window (no extra scroll height) */
html[data-native="true"] .footnote {
  flex: none;
  margin: 0;
  padding: 10px 16px 12px;
  border-top: 1px solid color-mix(in srgb, var(--line) 50%, transparent);
}

/* a refined, unobtrusive scrollbar for the native content area
   (overrides macOS "always show scroll bars" being loud and chunky) */
html[data-native="true"] .body::-webkit-scrollbar { width: 9px; }
html[data-native="true"] .body::-webkit-scrollbar-track { background: transparent; }
html[data-native="true"] .body::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--text) 18%, transparent);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
html[data-native="true"] .body::-webkit-scrollbar-thumb:hover {
  background: color-mix(in srgb, var(--text) 32%, transparent);
  background-clip: padding-box;
}

/* standalone (installed to Dock) tweaks */
@media (display-mode: standalone) {
  body { padding-top: 18px; }
  .install-btn { display: none !important; }
}
