/* PasteSafe. Tokens first, then components. Components use tokens only. */

@font-face {
  font-family: "IBM Plex Sans";
  src: url("fonts/ibm-plex-sans-latin.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("fonts/jetbrains-mono-latin.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  /* colour, light */
  --bg: #F8FAFC;
  --surface: #FFFFFF;
  --raised: #F1F5F9;
  --border: #E2E8F0;
  --border-strong: #CBD5E1;
  --text: #0F172A;
  --muted: #475569;
  --accent: #15803D;
  --accent-hover: #166534;
  --on-accent: #FFFFFF;
  --accent-soft: #DCFCE7;
  --ph-bg: #DCFCE7;
  --ph-text: #166534;
  --danger: #DC2626;
  --danger-soft: #FEE2E2;
  --glow: rgba(21, 128, 61, .08);
  --beam: rgba(21, 128, 61, .16);
  --shadow-1: 0 1px 2px rgba(15, 23, 42, .06);
  --shadow-2: 0 4px 12px -2px rgba(15, 23, 42, .08), 0 1px 3px rgba(15, 23, 42, .06);
  --shadow-3: 0 24px 48px -16px rgba(15, 23, 42, .18), 0 2px 6px rgba(15, 23, 42, .05);

  /* type: 12 / 14 / 16 / 18 / 24 / 32 / 48 */
  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --fs-12: .75rem;
  --fs-14: .875rem;
  --fs-16: 1rem;
  --fs-18: 1.125rem;
  --fs-24: 1.5rem;
  --fs-32: 2rem;
  --fs-48: 3rem;

  /* space: 4 / 8 scale */
  --s-1: .25rem;
  --s-2: .5rem;
  --s-3: .75rem;
  --s-4: 1rem;
  --s-5: 1.5rem;
  --s-6: 2rem;
  --s-7: 3rem;
  --s-8: 4rem;
  --gutter: var(--s-4);

  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-full: 999px;

  /* z-index: page UI stays below the ad anchor (showcase.css uses 40); only the toast and skip link go above it */
  --z-raise: 1;
  --z-overlay: 5;
  --z-toast: 50;
  --z-skip: 60;

  /* motion: exits run at about 65% of enters */
  --fast: 150ms;
  --base: 250ms;
  --slow: 400ms;
  --fast-out: 100ms;
  --base-out: 170ms;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-in: cubic-bezier(.7, 0, .84, 0);
  --target: 44px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0B1120;
    --surface: #0F172A;
    --raised: #1E293B;
    --border: #334155;
    --border-strong: #475569;
    --text: #F8FAFC;
    --muted: #94A3B8;
    --accent: #22C55E;
    --accent-hover: #4ADE80;
    --on-accent: #0B1120;
    --accent-soft: rgba(34, 197, 94, .14);
    --ph-bg: rgba(34, 197, 94, .14);
    --ph-text: #22C55E;
    --danger: #EF4444;
    --danger-soft: rgba(239, 68, 68, .28);
    --glow: rgba(34, 197, 94, .09);
    --beam: rgba(34, 197, 94, .2);
    --shadow-1: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-2: 0 6px 16px -4px rgba(0, 0, 0, .5);
    --shadow-3: 0 28px 56px -20px rgba(0, 0, 0, .75), 0 0 0 1px rgba(255, 255, 255, .02);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0B1120;
  --surface: #0F172A;
  --raised: #1E293B;
  --border: #334155;
  --border-strong: #475569;
  --text: #F8FAFC;
  --muted: #94A3B8;
  --accent: #22C55E;
  --accent-hover: #4ADE80;
  --on-accent: #0B1120;
  --accent-soft: rgba(34, 197, 94, .14);
  --ph-bg: rgba(34, 197, 94, .14);
  --ph-text: #22C55E;
  --danger: #EF4444;
  --danger-soft: rgba(239, 68, 68, .28);
  --glow: rgba(34, 197, 94, .09);
  --beam: rgba(34, 197, 94, .2);
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-2: 0 6px 16px -4px rgba(0, 0, 0, .5);
  --shadow-3: 0 28px 56px -20px rgba(0, 0, 0, .75), 0 0 0 1px rgba(255, 255, 255, .02);
}

/* ---- base ---- */

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: var(--s-4); }
body {
  margin: 0;
  color: var(--text);
  background: radial-gradient(56rem 32rem at 20% -8rem, var(--glow), transparent 70%) no-repeat, var(--bg);
  font: 400 var(--fs-16)/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-underline-offset: .2em; text-decoration-thickness: 1px; }
a:hover { color: var(--accent-hover); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
code, kbd { font-family: var(--mono); font-size: .875em; }
code { padding: .1em .35em; border-radius: var(--r-sm); background: var(--raised); overflow-wrap: anywhere; }
kbd { display: inline-block; min-width: 1.6em; padding: .05em .4em; border: 1px solid var(--border-strong); border-bottom-width: 2px; border-radius: var(--r-sm); background: var(--surface); color: var(--text); text-align: center; line-height: 1.4; }
h1, h2, h3 { margin: 0; line-height: 1.2; font-weight: 600; letter-spacing: -.01em; }
p { margin: 0; }
button { font: inherit; }
* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.i { width: 1.25em; height: 1.25em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: var(--s-4); top: -10rem; z-index: var(--z-skip); padding: var(--s-2) var(--s-4); border-radius: var(--r-md); color: var(--on-accent); background: var(--accent); font-weight: 600; }
.skip:focus { top: var(--s-4); color: var(--on-accent); }

/* ---- layout: content column, and the ad in a right rail from 75rem ---- */

.shell { width: 100%; max-width: 92.5rem; margin-inline: auto; padding-inline: var(--gutter); }
@media (min-width: 40rem) { :root { --gutter: var(--s-6); } }
@media (min-width: 75rem) {
  .shell { display: grid; grid-template-columns: minmax(0, 1fr) 300px; column-gap: var(--s-6); }
  .showcase-slot { grid-column: 2; padding-top: var(--s-5); }
}
.page { min-width: 0; container: page / inline-size; }

.top { display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); min-height: 4rem; }
.brand { display: inline-flex; align-items: center; gap: var(--s-2); min-height: var(--target); color: var(--text); font-weight: 600; font-size: var(--fs-18); text-decoration: none; letter-spacing: -.01em; }
.brand:hover { color: var(--text); }
.logo { width: 1.75rem; height: 1.75rem; }
.logo-bg { fill: var(--accent); }
.logo-line { fill: var(--on-accent); }
.logo-ph { fill: var(--on-accent); opacity: .55; }
.nav { display: flex; gap: var(--s-1); }
.nav a { display: inline-flex; align-items: center; min-height: var(--target); padding-inline: var(--s-3); border-radius: var(--r-md); color: var(--muted); font-size: var(--fs-14); font-weight: 500; text-decoration: none; transition: color var(--fast) var(--ease-out); }
.nav a:hover { color: var(--text); }
.nav-wide { display: none !important; }
@media (min-width: 48rem) { .nav-wide { display: inline-flex !important; } }

.hero { padding-block: var(--s-4) var(--s-5); }
h1 { font-size: var(--fs-32); font-weight: 700; letter-spacing: -.025em; line-height: 1.1; text-wrap: balance; }
.sub { margin-top: var(--s-3); max-width: 44rem; color: var(--muted); font-size: var(--fs-16); }
@media (min-width: 48rem) {
  .hero { padding-block: var(--s-6) var(--s-6); }
  h1 { font-size: var(--fs-48); }
  .sub { font-size: var(--fs-18); }
}

/* ---- buttons ---- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  min-height: var(--target); padding: 0 var(--s-4); border: 1px solid transparent; border-radius: var(--r-md);
  font: 600 var(--fs-14)/1.2 var(--sans); white-space: nowrap; text-decoration: none; cursor: pointer; touch-action: manipulation;
  transition: background-color var(--fast) var(--ease-out), border-color var(--fast) var(--ease-out), color var(--fast) var(--ease-out), transform var(--fast) var(--ease-out);
}
.btn:active:not(:disabled) { transform: scale(.98); }
.btn:disabled { cursor: not-allowed; opacity: .5; }
.btn-primary { color: var(--on-accent); background: var(--accent); }
.btn-primary:hover:not(:disabled) { color: var(--on-accent); background: var(--accent-hover); }
.btn-ghost { color: var(--text); background: var(--surface); border-color: var(--border-strong); }
.btn-ghost:hover:not(:disabled) { color: var(--text); border-color: var(--accent); background: var(--raised); }
.btn-lg { min-height: 3.25rem; padding: 0 var(--s-5); font-size: var(--fs-16); border-radius: var(--r-md); }
.btn-sm { font-size: var(--fs-14); padding: 0 var(--s-3); }
.icon-btn { display: inline-grid; place-items: center; width: var(--target); height: var(--target); padding: 0; border: 0; border-radius: var(--r-md); color: var(--muted); background: transparent; cursor: pointer; }
.icon-btn:hover { color: var(--text); background: var(--raised); }
.icon-btn[aria-pressed="true"] { color: var(--accent); }

/* ---- windows: the editor, the restore boxes and the share text all share this frame ---- */

.window { min-width: 0; overflow: hidden; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-2); }
.window:focus-within { border-color: var(--accent); }
.win-bar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); min-height: 3.25rem; padding: var(--s-1) var(--s-2) var(--s-1) var(--s-4); background: var(--raised); border-bottom: 1px solid var(--border); }
.win-dots { display: none; gap: 6px; margin-right: var(--s-2); }
.win-dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--border-strong); }
@media (min-width: 30rem) { .win-dots { display: inline-flex; } }
.file-tab { display: inline-flex; align-items: center; gap: var(--s-2); min-width: 0; color: var(--text); font: 500 var(--fs-14)/1.3 var(--mono); }
.file-tab .i { color: var(--muted); }
.file-tab > span, .file-tab label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.win-tools { display: flex; align-items: center; gap: var(--s-1); margin-left: auto; }

.code-area {
  display: block; width: 100%; margin: 0; border: 0; border-radius: 0; resize: none;
  padding: var(--s-4) var(--s-5); color: var(--text); background: transparent;
  font: 400 var(--fs-14)/1.7 var(--mono); tab-size: 2;
}
.code-area:focus-visible { outline: none; }
.code-area::placeholder { color: var(--muted); opacity: 1; }
.roomy { min-height: 18rem; resize: vertical; }
.prose-area { display: block; width: 100%; min-height: 10rem; margin: 0; padding: var(--s-4); border: 0; resize: vertical; color: var(--text); background: transparent; font: var(--fs-16)/1.55 var(--sans); }
.prose-area:focus-visible { outline: none; }

/* ---- workbench: editor, actions and findings ---- */

.workbench { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-5); }
@container page (min-width: 60rem) {
  .workbench { grid-template-columns: minmax(0, 1fr) 18.5rem; align-items: stretch; }
  .findings { contain: size; min-height: 0; }
  /* beside the editor the toggles become a tidy checklist, counts aligned right */
  .findings .chips { flex-direction: column; flex-wrap: nowrap; gap: 2px; }
  .findings .chip, .findings .chip:has(input:checked) { width: 100%; padding-inline: var(--s-2); border-color: transparent; background: transparent; }
  .findings .chip:hover { background: var(--raised); }
}
.ed-col { min-width: 0; }

.editor { position: relative; box-shadow: var(--shadow-3); transition: border-color var(--base) var(--ease-out); }
.editor .win-bar { padding-left: var(--s-4); }
.tabs { display: inline-flex; padding: 3px; border-radius: var(--r-md); background: var(--bg); border: 1px solid var(--border); }
.tab {
  min-height: calc(var(--target) - 8px); padding: 0 var(--s-3); border: 0; border-radius: 7px;
  color: var(--muted); background: transparent; font: 600 var(--fs-14)/1 var(--sans); cursor: pointer;
  transition: color var(--fast) var(--ease-out), background-color var(--fast) var(--ease-out);
}
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] { color: var(--text); background: var(--surface); box-shadow: var(--shadow-1); }
.tab:focus-visible { outline-offset: 0; }
.editor[data-state="empty"] .tabs { visibility: hidden; }

.ed-body { position: relative; height: 60vh; height: max(20rem, 60svh); overflow: hidden; background: var(--surface); }
@media (min-width: 48rem) { .ed-body { height: max(24rem, min(70svh, 44rem)); } }
.ed-panel { position: absolute; inset: 0; }
.ed-panel .code-area { height: 100%; }
.code-pre {
  position: relative; height: 100%; margin: 0; overflow: auto; padding: var(--s-4) var(--s-5);
  color: var(--text); font: 400 var(--fs-14)/1.7 var(--mono); tab-size: 2; white-space: pre;
}
.code-pre:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.editor.is-wrap .code-pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.editor:not(.is-wrap) .code-area { white-space: pre; overflow-x: auto; }
.code-area, .code-pre { scrollbar-gutter: stable; }

/* placeholder chips in the cleaned view */
.hit {
  display: inline-block; padding: 0 .3em; border-radius: 4px;
  color: var(--ph-text); background: var(--ph-bg); font-weight: 600; line-height: 1.45;
}
.hit.is-raw { padding: 0; color: var(--text); font-weight: 400; background: transparent; }
.hit.is-found { background: var(--danger-soft); box-shadow: inset 0 -2px 0 var(--danger); }
.hit.is-flash { outline: 2px solid var(--accent); outline-offset: 1px; }

.big { position: absolute; inset: 0; display: flex; flex-direction: column; }
.big-note { padding: var(--s-2) var(--s-5); color: var(--muted); font-size: var(--fs-14); border-bottom: 1px solid var(--border); background: var(--raised); }
.big .code-area { flex: 1; min-height: 0; }

/* empty state, drawn over the (still focusable) textarea */
.ed-empty {
  position: absolute; inset: 0; z-index: var(--z-overlay);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--s-4);
  padding: var(--s-5); text-align: center; pointer-events: none;
}
.editor:not([data-state="empty"]) .ed-empty { display: none; }
.editor[data-state="empty"] #input { caret-color: transparent; }
.ed-empty button { pointer-events: auto; }
.typer { min-height: 1.4em; max-width: 100%; color: var(--text); font: 500 var(--fs-18)/1.4 var(--mono); letter-spacing: -.01em; }
.typer-prompt { color: var(--accent); }
.caret { display: inline-block; width: .55em; height: 1.1em; margin-left: 2px; vertical-align: -.18em; background: var(--accent); animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.empty-hint, .empty-drop { color: var(--muted); font-size: var(--fs-14); }
.empty-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--s-2); }
.empty-drop { display: inline-flex; align-items: center; gap: var(--s-2); }
.empty-msg { max-width: 30rem; color: var(--text); font-size: var(--fs-14); }
.empty-msg:empty { display: none; }
@media (min-width: 48rem) { .typer { font-size: var(--fs-24); } .ed-empty { gap: var(--s-5); } }

/* the scan beam, the large-paste progress bar and the drop target */
.ed-beam {
  position: absolute; left: 0; right: 0; top: 0; z-index: var(--z-overlay); height: 7rem; margin-top: -7rem;
  background: linear-gradient(180deg, transparent, var(--beam)); border-bottom: 2px solid var(--accent);
  opacity: 0; pointer-events: none;
}
.ed-progress { position: absolute; left: 0; right: 0; top: 0; z-index: var(--z-overlay); height: 3px; overflow: hidden; opacity: 0; pointer-events: none; }
.ed-progress i { position: absolute; inset: 0; width: 40%; background: var(--accent); animation: progress 1.1s var(--ease-out) infinite; }
.editor.is-busy .ed-progress { opacity: 1; }
@keyframes progress { from { transform: translateX(-100%); } to { transform: translateX(250%); } }
.ed-drop {
  position: absolute; inset: var(--s-2); z-index: var(--z-overlay); display: flex; align-items: center; justify-content: center; gap: var(--s-2);
  border: 2px dashed var(--accent); border-radius: var(--r-md); background: var(--surface); color: var(--accent);
  font-weight: 600; font-size: var(--fs-18); opacity: 0; pointer-events: none; transition: opacity var(--fast-out) var(--ease-in);
}
.editor.is-dragging .ed-drop { opacity: .96; transition: opacity var(--fast) var(--ease-out); }

.win-status {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s-1) var(--s-4);
  padding: var(--s-2) var(--s-4); background: var(--raised); border-top: 1px solid var(--border);
  color: var(--muted); font: 400 var(--fs-12)/1.5 var(--mono);
}
.st-group { display: inline-flex; flex-wrap: wrap; align-items: center; gap: var(--s-1) var(--s-4); }
.st-group > span { display: inline-flex; align-items: center; gap: var(--s-1); }
.st-masked { color: var(--ph-text); font-weight: 600; }
.st-net .i, .st-conn .i { width: 1.1em; height: 1.1em; }
.st-net.is-bad { color: var(--danger); font-weight: 600; }
.st-conn.is-offline { color: var(--accent); font-weight: 600; }
.bump { display: inline-block; }

/* Sits in place right under the editor. Not sticky: a floating bar covered other content on narrow screens. */
.ed-actions {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-2);
  padding-block: var(--s-3);
}
.editor[data-state="empty"] ~ .ed-actions { display: none; }
.ed-secondary { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.btn .i-done, .lbl-done { display: none; }
.is-copied .i-copy, .is-copied .lbl { display: none; }
.is-copied .i-done { display: block; }
.is-copied .lbl-done { display: inline; }
@media (max-width: 35.99rem) {
  .ed-actions { flex-wrap: nowrap; }
  #copy { flex: 1; min-width: 0; padding-inline: var(--s-3); }
  .ed-secondary { flex-wrap: nowrap; }
  .ed-secondary [data-action="sample"] { display: none; }
  .ed-secondary .btn { width: var(--target); padding: 0; }
  .ed-secondary .btn-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}
@media (max-width: 21.99rem) { .lbl-long { display: none; } }
.status { margin-top: var(--s-3); color: var(--text); font-size: var(--fs-14); }
.limits, .tip { margin-top: var(--s-1); color: var(--muted); font-size: var(--fs-14); }
.notice { margin-bottom: var(--s-4); padding: var(--s-3); border-radius: var(--r-md); background: var(--accent-soft); }

/* findings */
.findings { display: flex; flex-direction: column; gap: var(--s-4); min-width: 0; padding: var(--s-4); background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-2); }
.findings-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-2); }
.findings-head h3 { font-size: var(--fs-18); }
.badge { min-width: 1.75rem; padding: 0 var(--s-2); border-radius: var(--r-full); color: var(--on-accent); background: var(--accent); font: 600 var(--fs-12)/1.75 var(--mono); text-align: center; }
fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
legend { margin-bottom: var(--s-2); padding: 0; color: var(--muted); font-size: var(--fs-12); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.chips { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.chip {
  display: inline-flex; align-items: center; gap: var(--s-2); min-height: var(--target); padding: 0 var(--s-3) 0 var(--s-2);
  border: 1px solid var(--border-strong); border-radius: var(--r-md); background: var(--surface);
  font-size: var(--fs-14); line-height: 1.2; cursor: pointer; user-select: none;
  transition: border-color var(--fast) var(--ease-out), background-color var(--fast) var(--ease-out);
}
.chip:hover { border-color: var(--accent); }
.chip:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.chip:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.chip input {
  appearance: none; display: grid; place-items: center; flex: none; width: 1.125rem; height: 1.125rem; margin: 0;
  border: 1.5px solid var(--border-strong); border-radius: 4px; background: var(--surface); cursor: pointer;
}
.chip input::after { content: ""; width: .3rem; height: .6rem; margin-top: -2px; border: solid var(--on-accent); border-width: 0 2px 2px 0; transform: rotate(45deg) scale(0); transition: transform var(--fast) var(--ease-out); }
.chip input:checked { border-color: var(--accent); background: var(--accent); }
.chip input:checked::after { transform: rotate(45deg) scale(1); }
.chip input:focus-visible { outline: none; }
.count { margin-left: auto; min-width: 1.5rem; padding: 0 var(--s-1); border-radius: var(--r-full); color: var(--text); background: var(--raised); font: 600 var(--fs-12)/1.6 var(--mono); text-align: center; }
.chip:has(input:checked) .count { color: var(--on-accent); background: var(--accent); }
.count:empty { display: none; }
.chip:has(input:checked) .count.is-zero { color: var(--muted); background: var(--raised); }

.list { min-height: 0; overflow: auto; margin-inline: calc(var(--s-2) * -1); padding-inline: var(--s-2); }
.list h4 { display: flex; justify-content: space-between; margin: var(--s-3) 0 var(--s-1); color: var(--muted); font-size: var(--fs-12); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.list h4:first-child { margin-top: 0; }
.list ul { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; margin: 0; padding: 0; list-style: none; }
.row {
  display: flex; align-items: center; gap: var(--s-2); width: 100%; min-height: var(--target); padding: var(--s-1) var(--s-2);
  border: 0; border-radius: var(--r-sm); color: var(--text); background: transparent; text-align: left; cursor: pointer;
}
.row:hover { background: var(--raised); }
.row code { flex: none; max-width: 60%; overflow: hidden; text-overflow: ellipsis; padding: .15em .4em; color: var(--ph-text); background: var(--ph-bg); font-size: var(--fs-12); font-weight: 600; }
.row .val { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font: var(--fs-12)/1.4 var(--mono); }
.row .n { flex: none; color: var(--muted); font: var(--fs-12)/1 var(--mono); }
.empty { color: var(--muted); font-size: var(--fs-14); }

/* ---- sections ---- */

.section { padding-top: var(--s-8); }
.section-head { margin-bottom: var(--s-5); }
.section h2 { font-size: var(--fs-24); }
@media (min-width: 48rem) { .section h2 { font-size: var(--fs-32); } }
.lead { margin-top: var(--s-2); max-width: 44rem; color: var(--muted); font-size: var(--fs-16); }
.prose p, .prose h3 { max-width: 44rem; }
.prose h2 { margin-bottom: var(--s-4); }
.prose h3 { margin: var(--s-5) 0 var(--s-2); font-size: var(--fs-18); }
.prose p + p { margin-top: var(--s-3); }

.pair { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-4); }
@container page (min-width: 48rem) { .pair { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }

.card-out { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-4); margin-top: var(--s-5); }
@container page (min-width: 56rem) { .card-out { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); align-items: start; } }
.card-preview canvas { display: block; width: 100%; height: auto; }
.card-side { display: grid; gap: var(--s-3); justify-items: start; }
.card-side .window { width: 100%; }

.checks { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-4); }
@container page (min-width: 48rem) { .checks { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.check { display: grid; align-content: start; gap: var(--s-3); min-width: 0; padding: var(--s-5); background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-1); }
.check h3 { display: flex; align-items: center; gap: var(--s-2); font-size: var(--fs-18); }
.check h3 .i { color: var(--accent); }
.check > p:last-child { color: var(--muted); font-size: var(--fs-14); }
.meter { display: flex; align-items: baseline; flex-wrap: wrap; gap: var(--s-1) var(--s-3); }
.meter-n { color: var(--accent); font: 700 var(--fs-48)/1 var(--mono); font-variant-numeric: tabular-nums; }
.meter-label { color: var(--text); font-size: var(--fs-16); }
.check[data-state="bad"] .meter-n { color: var(--danger); }
.net-list { display: grid; gap: var(--s-1); max-height: 10rem; overflow: auto; margin: 0; padding: var(--s-2) var(--s-3); list-style: none; border-radius: var(--r-md); background: var(--danger-soft); font: var(--fs-12)/1.5 var(--mono); overflow-wrap: anywhere; }
.conn, .sw-state { display: flex; align-items: center; gap: var(--s-2); font-weight: 500; }
.conn { padding: var(--s-3); border: 1px solid var(--border); border-radius: var(--r-md); background: var(--raised); }
.conn .conn-offline { display: none; }
.check[data-state="offline"] .conn { border-color: var(--accent); background: var(--accent-soft); }
.check[data-state="offline"] .conn .i { color: var(--accent); }
.check[data-state="offline"] .conn-online { display: none; }
.check[data-state="offline"] .conn-offline { display: block; }
.sw-state { color: var(--muted); font-size: var(--fs-14); }
.sw-state[data-ready="true"] { color: var(--text); }
.sw-state[data-ready="true"] .i { color: var(--accent); }


.stats { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-4); margin: 0; padding: 0; list-style: none; }
@container page (min-width: 40rem) { .stats { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.stats li { padding: var(--s-5); background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); color: var(--muted); }
.stats b { display: block; margin-bottom: var(--s-2); color: var(--text); font: 700 var(--fs-32)/1.1 var(--sans); letter-spacing: -.02em; }
.stats .src { display: block; margin-top: var(--s-3); font-size: var(--fs-14); }

.team { display: grid; gap: var(--s-4); align-items: center; margin-top: var(--s-8); padding: var(--s-5); border: 1px solid var(--accent); border-radius: var(--r-lg); background: var(--accent-soft); }
.team h2 { font-size: var(--fs-24); }
.team p { margin-top: var(--s-2); max-width: 44rem; }
@container page (min-width: 48rem) { .team { grid-template-columns: minmax(0, 1fr) auto; padding: var(--s-6); } }

.foot { margin-top: var(--s-7); padding-block: var(--s-5) var(--s-6); border-top: 1px solid var(--border); color: var(--muted); font-size: var(--fs-14); }

.toast {
  position: fixed; left: 50%; bottom: calc(var(--s-4) + env(safe-area-inset-bottom)); z-index: var(--z-toast);
  display: flex; align-items: center; gap: var(--s-3); max-width: calc(100% - 2 * var(--s-4)); padding: var(--s-2) var(--s-2) var(--s-2) var(--s-4);
  border: 1px solid var(--border-strong); border-radius: var(--r-lg); background: var(--raised); color: var(--text); box-shadow: var(--shadow-3);
  font-size: var(--fs-14); transform: translateX(-50%); animation: toast-in var(--base) var(--ease-out);
}
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, .75rem); } }
@media (max-width: 74.99rem) { body.has-showcase-bar .toast { bottom: calc(7rem + env(safe-area-inset-bottom)); } }

@media (pointer: coarse) { .empty-hint, .empty-drop { display: none; } }

/* No typewriter, sweep or morph (app.js checks the same query); the ad unit handles its own. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .page *, .page *::after, .toast { transition: none !important; animation: none !important; }
  .ed-progress i { width: 100%; transform: none; opacity: .5; }
}
