/* ==========================================================================
   Linkrot: an inspection report on paper. Warm paper layers, ink text, one
   rust signal for what is broken, moss for what is fine. Fraunces for
   headings and numbers, IBM Plex Sans for reading, IBM Plex Mono only for
   URLs and codes. Deliberately unlike the dark Krypton tools (Audyt).
   ========================================================================== */
@font-face { font-family: "Fraunces"; src: url("/fonts/fraunces-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Fraunces"; src: url("/fonts/fraunces-latin-ext-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "IBM Plex Sans"; src: url("/fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "IBM Plex Sans"; src: url("/fonts/ibm-plex-sans-latin-ext-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "IBM Plex Sans"; src: url("/fonts/ibm-plex-sans-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "IBM Plex Sans"; src: url("/fonts/ibm-plex-sans-latin-ext-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "IBM Plex Sans"; src: url("/fonts/ibm-plex-sans-latin-600-normal.woff2") format("woff2"); font-weight: 600 700; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "IBM Plex Sans"; src: url("/fonts/ibm-plex-sans-latin-ext-600-normal.woff2") format("woff2"); font-weight: 600 700; font-display: swap; unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "IBM Plex Mono"; src: url("/fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "IBM Plex Mono"; src: url("/fonts/ibm-plex-mono-latin-ext-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "IBM Plex Mono"; src: url("/fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2"); font-weight: 500 700; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "IBM Plex Mono"; src: url("/fonts/ibm-plex-mono-latin-ext-500-normal.woff2") format("woff2"); font-weight: 500 700; font-display: swap; unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  color-scheme: light;
  --paper: #f3efe6;
  --paper-2: #ebe5d8;
  --sheet: #fbf9f4;
  --ink: #1c1a17;
  --ink-2: #4f4a42;
  --ink-3: #847d71;
  --rule: #d9d1c1;
  --rule-strong: #b9b0a0;

  --rust: #c2410c;
  --rust-soft: #fbe6da;
  --moss: #2f6b3a;
  --moss-soft: #e3eedf;
  --amber: #8f6d00;
  --amber-soft: #f4ecc9;
  --sky: #1d5fa8;
  --sky-soft: #e0eaf5;
  --plum: #6d4c9f;
  --plum-soft: #ece4f5;

  /* status names the scripts use */
  --good: var(--moss);
  --redirect: var(--sky);
  --bad4: var(--amber);
  --bad5: var(--rust);
  --err: var(--rust);
  --blocked: var(--plum);
  --text: var(--ink);
  --muted: var(--ink-2);
  --dim: var(--ink-3);

  --ff-display: "Fraunces", ui-serif, Georgia, serif;
  --ff-body: "IBM Plex Sans", ui-sans-serif, system-ui, sans-serif;
  --ff-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 0 rgb(28 26 23 / 0.04), 0 8px 24px -16px rgb(28 26 23 / 0.25);
  --shadow-lift: 0 2px 0 rgb(28 26 23 / 0.05), 0 18px 36px -20px rgb(28 26 23 / 0.35);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  --container: 72rem;
  --gutter: clamp(1rem, 0.4rem + 3vw, 3rem);
  --text-sm: 0.875rem;
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--paper); -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100dvh;
  background: var(--paper); color: var(--ink);
  font-family: var(--ff-body); font-size: 1rem; line-height: 1.55;
  -webkit-font-smoothing: antialiased; overflow-x: clip;
}
/* faint ruled-paper texture behind everything */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: repeating-linear-gradient(180deg, transparent 0 31px, rgb(185 176 160 / 0.18) 31px 32px);
  -webkit-mask-image: linear-gradient(180deg, #000 0, transparent 60vh);
  mask-image: linear-gradient(180deg, #000 0, transparent 60vh);
}
::selection { background: var(--rust); color: #fff; }
a { color: var(--ink); text-decoration-color: var(--rule-strong); text-underline-offset: 3px; }
a:hover { color: var(--rust); text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid var(--rust); outline-offset: 2px; border-radius: 4px; }
[hidden] { display: none !important; }
.hidden { display: none !important; }
code { font-family: var(--ff-mono); font-size: 0.875em; background: var(--paper-2); padding: 1px 5px; border-radius: 4px; }

.container { width: 100%; max-width: calc(var(--container) + 2 * var(--gutter)); margin-inline: auto; padding-inline: var(--gutter); }
.wrap { padding-bottom: 4rem; }

/* ---------------------------------------------------------------------
   Header, hero, scan form
   --------------------------------------------------------------------- */
.app-header { border-bottom: 1px solid var(--rule); background: rgb(243 239 230 / 0.9); position: sticky; top: 0; z-index: 40; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.app-header .bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; height: 4rem; }
.wordmark { display: inline-flex; align-items: baseline; gap: 0.5rem; font-family: var(--ff-display); font-weight: 600; font-size: 1.5rem; letter-spacing: -0.01em; color: var(--ink); text-decoration: none; }
.wordmark .mark { display: inline-block; width: 0.55em; height: 0.55em; border-radius: 50%; background: var(--rust); transform: translateY(-0.05em); }
.wordmark:hover { color: var(--ink); }
.header-note { margin: 0; font-size: 0.8125rem; color: var(--ink-3); }

.hero {
  padding-block: clamp(2.5rem, 2rem + 4vw, 5rem) 2rem;
  display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: clamp(2rem, 4vw, 4rem); align-items: center;
}
.hero-main { display: grid; gap: 2rem; min-width: 0; }

/* sample inspection slip next to the hero (decorative) */
.slip-sample {
  position: absolute; top: -12px; right: 22px; transform: rotate(4deg);
  padding: 2px 10px; background: var(--ink); color: var(--paper); border-radius: 3px;
  font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase;
}
.slip {
  position: relative; padding: 22px 22px 18px;
  background: var(--sheet); border: 1px solid var(--rule); border-radius: 4px;
  box-shadow: var(--shadow-lift); transform: rotate(1.2deg);
  font-size: 0.8125rem;
}
.slip::before {
  content: ""; position: absolute; left: 18px; right: 18px; top: -7px; height: 14px;
  background: radial-gradient(circle at 7px 7px, var(--paper) 4px, transparent 4.5px) 0 0 / 22px 14px repeat-x;
}
.slip-head { display: flex; justify-content: space-between; gap: 12px; padding-bottom: 12px; margin-bottom: 6px; border-bottom: 1px dashed var(--rule-strong); font-weight: 600; color: var(--ink-2); }
.slip-head span:last-child { font-family: var(--ff-mono); font-weight: 400; color: var(--ink-3); }
.slip-rows { list-style: none; margin: 0; padding: 0; }
.slip-rows li { display: grid; grid-template-columns: 2.6rem minmax(0, 1fr); column-gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--paper-2); }
.slip-rows .c { grid-row: span 2; font-family: var(--ff-mono); font-weight: 500; }
.slip-rows .u { font-family: var(--ff-mono); color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.slip-rows .w { color: var(--ink-3); font-size: 0.75rem; }
.slip .ok { color: var(--moss); } .slip .bad { color: var(--rust); } .slip .info { color: var(--sky); } .slip .warn { color: var(--amber); } .slip .blk { color: var(--plum); }
.slip-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; color: var(--ink-3); }
.stamp {
  display: inline-block; padding: 4px 12px; transform: rotate(-4deg);
  border: 2px solid var(--rust); border-radius: 4px; color: var(--rust);
  font-family: var(--ff-display); font-weight: 600; font-size: 1.125rem; letter-spacing: 0.02em;
}
.eyebrow { margin: 0; font-size: 0.8125rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--rust); }
.hero-title {
  margin: 0.5rem 0 0; max-width: 16ch;
  font-family: var(--ff-display); font-weight: 600;
  font-size: clamp(2.5rem, 1.6rem + 4vw, 4.75rem); line-height: 1.02; letter-spacing: -0.025em;
  text-wrap: balance;
}
.hero-title em { font-style: normal; color: var(--rust); }
.lede { margin: 1.25rem 0 0; max-width: 38rem; font-size: 1.125rem; color: var(--ink-2); }

.scan-form {
  display: grid; gap: 12px; max-width: 48rem;
  padding: 18px; background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--radius); box-shadow: var(--shadow);
}
.scan-row { display: flex; gap: 10px; }
.scan-input {
  flex: 1; min-width: 0; min-height: 3.5rem; padding: 0 18px;
  background: #fff; color: var(--ink); border: 1px solid var(--rule-strong); border-radius: var(--radius-sm);
  font-family: var(--ff-mono); font-size: 1.0625rem;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.scan-input::placeholder { color: var(--ink-3); }
.scan-input:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 4px rgb(194 65 12 / 0.12); }
.scan-input:disabled { background: var(--paper-2); }
.scan-hint { margin: 0; font-size: 0.8125rem; color: var(--ink-3); }
.facts { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 0; padding: 0; list-style: none; font-size: 0.875rem; color: var(--ink-2); }
.facts li { display: inline-flex; align-items: center; gap: 8px; }
.facts li::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--moss); }
.facts li:nth-child(2)::before { background: var(--rust); }
.facts li:nth-child(3)::before { background: var(--amber); }

/* recent domains as chips under the form */
.saved-domains { max-width: 48rem; }
.saved-domains-title { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 8px; }
.saved-domains-list { display: flex; flex-wrap: wrap; gap: 8px; }
.saved-domain-row {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 4px 6px 4px 4px; background: var(--sheet); border: 1px solid var(--rule); border-radius: 999px;
}
.saved-domain-row:hover { border-color: var(--rule-strong); }
.saved-domain-pin, .saved-domain-remove { min-height: 0; padding: 2px 6px; background: transparent; border: none; color: var(--ink-3); font-size: 0.875rem; line-height: 1; border-radius: 999px; }
.saved-domain-pin:hover, .saved-domain-remove:hover { background: var(--paper-2); }
.saved-domain-pin.active { color: var(--amber); }
.saved-domain-remove:hover { color: var(--rust); }
button.saved-domain-name { min-height: 0; padding: 0; background: transparent; border: none; font-family: var(--ff-mono); font-size: 0.8125rem; font-weight: 500; color: var(--ink); }
button.saved-domain-name:hover { background: transparent; color: var(--rust); }
.saved-domain-summary { font-size: 0.75rem; }
.saved-domain-time { font-size: 0.75rem; color: var(--ink-3); }

/* ---------------------------------------------------------------------
   Buttons
   --------------------------------------------------------------------- */
button {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  min-height: 2.5rem; padding: 0 1rem;
  background: var(--sheet); color: var(--ink); border: 1px solid var(--rule-strong); border-radius: var(--radius-sm);
  font-family: var(--ff-body); font-weight: 600; font-size: 0.875rem; cursor: pointer;
  transition: background-color 0.2s var(--ease), border-color 0.2s var(--ease), color 0.2s var(--ease), transform 0.15s var(--ease), box-shadow 0.2s var(--ease);
}
button:hover { background: #fff; border-color: var(--ink); }
button:active { transform: translateY(1px); }
button:disabled { opacity: 0.45; cursor: default; }
button:disabled:hover { background: var(--sheet); border-color: var(--rule-strong); }
button.primary { background: var(--ink); color: var(--paper); border-color: var(--ink); }
button.primary:hover { background: var(--rust); border-color: var(--rust); color: #fff; }
.scan-row button.primary { min-height: 3.5rem; padding: 0 1.5rem; font-size: 1rem; }
button.danger:hover { border-color: var(--rust); color: var(--rust); background: var(--rust-soft); }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 4px; }

/* ---------------------------------------------------------------------
   Inspection sheet: the one card a running job lives in
   --------------------------------------------------------------------- */
.job-bar { display: flex; align-items: center; gap: 14px; min-width: 0; }
.job-domain { font-family: var(--ff-mono); font-size: 0.875rem; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.job-phase { font-size: 0.8125rem; color: var(--ink-3); white-space: nowrap; }
.new-btn { font-size: 0.875rem; font-weight: 600; color: var(--ink); white-space: nowrap; }
.app-header .bar { gap: 1.5rem; }

.sheet {
  margin-top: clamp(1.5rem, 1rem + 2vw, 2.5rem);
  padding: clamp(18px, 2vw, 28px);
  background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--radius); box-shadow: var(--shadow);
  background-image: repeating-linear-gradient(180deg, transparent 0 31px, rgb(185 176 160 / 0.16) 31px 32px);
}
.sheet-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 16px; padding-bottom: 12px; border-bottom: 2px solid var(--ink); }
.sheet-title { margin: 0; font-family: var(--ff-display); font-weight: 600; font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2.25rem); line-height: 1.1; letter-spacing: -0.015em; overflow-wrap: anywhere; }
.sheet-meta { font-size: 0.875rem; color: var(--ink-3); }
.sheet.working .sheet-meta::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 8px; border-radius: 50%; background: var(--rust); vertical-align: 1px; animation: pulse 1.1s var(--ease) infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgb(194 65 12 / 0.45); } 100% { box-shadow: 0 0 0 7px rgb(194 65 12 / 0); } }

.sheet-notes { padding: 10px 0 0; }
.sheet-notes:empty { display: none; }
.note { position: relative; margin: 0; padding: 6px 0 6px 26px; font-size: 0.9375rem; line-height: 1.55; color: var(--ink-2); overflow-wrap: anywhere; }
.note b { color: var(--ink); font-weight: 600; }
.note .sub { display: block; font-size: 0.8125rem; color: var(--ink-3); }
.note > .busy, .note > [class^="mark-"] { position: absolute; left: 2px; top: 9px; }
.mark-ok { color: var(--moss); font-weight: 700; }
.mark-bad { color: var(--rust); font-weight: 700; }
.note.bad { color: var(--ink-2); }
.busy { width: 13px; height: 13px; border: 2px solid var(--rule-strong); border-top-color: var(--rust); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.sheet-step { padding-top: 16px; }
.sheet-step:empty { display: none; }
.sheet-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-top: 16px; }
.link-btn { min-height: 0; padding: 4px 0; background: transparent; border: none; color: var(--ink-2); font-weight: 500; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--rule-strong); }
.link-btn:hover { background: transparent; color: var(--rust); text-decoration-color: currentColor; }
.link-btn:disabled:hover { background: transparent; color: var(--ink-2); }
.primary-link { display: inline-flex; align-items: center; min-height: 2.5rem; padding: 0 1rem; border-radius: var(--radius-sm); background: var(--ink); color: var(--paper); font-weight: 600; font-size: 0.875rem; text-decoration: none; }
.primary-link:hover { background: var(--rust); color: #fff; }

/* scope */
.scope fieldset { margin: 0; padding: 0; border: none; min-width: 0; }
.scope legend { padding: 0; margin-bottom: 10px; font-family: var(--ff-display); font-weight: 600; font-size: 1.25rem; }
.option { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; margin-bottom: 8px; background: #fff; border: 1px solid var(--rule); border-radius: var(--radius-sm); cursor: pointer; transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease); }
.option:hover { border-color: var(--rule-strong); }
.option:has(input:checked) { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.option input { margin-top: 4px; }
.option-body { display: flex; flex-direction: column; gap: 2px; }
.option-name { font-family: var(--ff-display); font-weight: 600; font-size: 1.125rem; }
.option-desc { font-size: 0.875rem; color: var(--ink-2); }
.lock-tag { margin-left: 6px; padding: 0 7px; border-radius: 999px; background: var(--paper-2); color: var(--ink-3); font-family: var(--ff-body); font-weight: 500; font-size: 0.75rem; vertical-align: 3px; }
.scope-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding: 10px 0; border-bottom: 1px solid var(--rule); }
.scope-domain { font-family: var(--ff-mono); font-weight: 500; font-size: 0.9375rem; overflow-wrap: anywhere; }
.scope-count { margin-left: 6px; font-family: var(--ff-body); font-weight: 400; font-size: 0.8125rem; color: var(--ink-3); }
.seg { display: inline-flex; border: 1px solid var(--rule-strong); border-radius: 999px; overflow: hidden; }
.seg label { position: relative; cursor: pointer; }
.seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg span { display: inline-block; padding: 5px 16px; font-size: 0.8125rem; font-weight: 500; color: var(--ink-2); }
.seg input:checked + span { background: var(--ink); color: var(--paper); }
.seg input:focus-visible + span { outline: 2px solid var(--rust); outline-offset: -2px; }
.scope-help { margin: 10px 0 0; font-size: 0.8125rem; color: var(--ink-3); }

.pw { margin-top: 6px; padding: 14px; background: #fff; border: 1px solid var(--rule); border-left: 3px solid var(--rust); border-radius: var(--radius-sm); max-width: 32rem; }
.pw-label { display: block; margin-bottom: 6px; font-weight: 600; font-size: 0.875rem; }
.pw-help { margin: 6px 0 0; font-size: 0.8125rem; color: var(--ink-3); }
.auth-field { position: relative; display: flex; }
.auth-field input {
  flex: 1; min-width: 0; min-height: 2.75rem; padding: 0 70px 0 14px;
  background: var(--sheet); color: var(--ink); border: 1px solid var(--rule-strong); border-radius: var(--radius-sm);
  font-family: var(--ff-mono); font-size: 1rem; letter-spacing: 0.06em;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.auth-field input:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 4px rgb(194 65 12 / 0.12); }
.auth-toggle { position: absolute; right: 5px; top: 5px; bottom: 5px; min-height: 0; padding: 0 10px; border: none; background: transparent; color: var(--ink-3); font-size: 0.75rem; }
.auth-toggle:hover { background: var(--paper-2); border: none; color: var(--ink); }
.form-error { min-height: 0; margin: 8px 0 0; color: var(--rust); font-size: 0.875rem; }
.form-error:empty { display: none; }
.scope.shake .pw { animation: shake 0.35s var(--ease); border-color: var(--rust); }
@keyframes shake { 20%, 60% { transform: translateX(-4px); } 40%, 80% { transform: translateX(4px); } }

/* progress */
.progress-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; margin-bottom: 8px; }
.progress-label { font-weight: 600; }
.progress-count { font-family: var(--ff-mono); font-size: 0.875rem; color: var(--ink-2); }
.progress-track { height: 6px; background: var(--paper-2); border-radius: 999px; overflow: hidden; }
.progress-fill { display: block; width: 0; height: 100%; background: var(--rust); border-radius: 999px; transition: width 0.25s var(--ease); }
.progress-fill.scanning { background-image: linear-gradient(90deg, var(--rust), #e07a45, var(--rust)); background-size: 200% 100%; animation: sweep 1.4s linear infinite; }
@keyframes sweep { to { background-position: -200% 0; } }
.marginalia { list-style: none; margin: 12px 0 0; padding: 0; min-height: 4.5rem; }
.marginalia li { display: flex; gap: 12px; padding: 2px 0; font-family: var(--ff-mono); font-size: 0.8125rem; color: var(--ink-3); }
.marginalia li:first-child { color: var(--ink-2); }
.marginalia .c { width: 2.6rem; flex-shrink: 0; }
.marginalia .c.ok { color: var(--moss); } .marginalia .c.bad { color: var(--rust); } .marginalia .c.blk { color: var(--plum); }
.marginalia .u { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* done */
.sheet-done { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; }
.done-line { margin: 0; font-size: 1rem; color: var(--ink-2); }
.done-line .mono { font-family: var(--ff-mono); color: var(--ink); }
.sheet-done .sheet-actions, .sheet-done .share-result { flex-basis: 100%; margin-top: 0; }
.stamp.ok { border-color: var(--moss); color: var(--moss); }

body.has-job .results-area { margin-top: 1.5rem; }

/* ---------------------------------------------------------------------
   Results
   --------------------------------------------------------------------- */
.results-area { margin-top: 2.5rem; }
.domain-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.domain-tab { min-height: 2.25rem; border-radius: 999px; font-family: var(--ff-mono); font-weight: 500; font-size: 0.8125rem; color: var(--ink-2); gap: 8px; }
.domain-tab.active { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.domain-tab-badge { font-size: 0.75rem; color: inherit; opacity: 0.8; }
.domain-tab-badge-bad { color: #fff; background: var(--rust); border-radius: 999px; padding: 0 7px; font-weight: 700; }
.domain-tab-badge-ok { color: var(--moss); font-weight: 700; }
.domain-tab.active .domain-tab-badge-ok { color: #9fd4a8; }
.domain-panel { display: none; }
.domain-panel.active { display: block; }
.domain-tab-panels { background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--radius); box-shadow: var(--shadow); padding: clamp(16px, 2vw, 28px); }
.domain-panel-subtitle { font-family: var(--ff-mono); font-size: 0.75rem; color: var(--ink-3); margin-bottom: 14px; overflow-wrap: anywhere; }

.notice { margin: 0 0 10px; padding: 10px 14px; background: var(--paper); border-radius: var(--radius-sm); font-size: 0.875rem; color: var(--ink-2); }
.notice b { color: var(--ink); font-weight: 600; }
.notice.warn { background: var(--amber-soft); color: #6b4a10; }

/* verdict: a headline, each finding in its own colour */
.health-strip {
  display: flex; align-items: flex-start; gap: 12px;
  margin: 18px 0 20px; padding: 18px 0 18px;
  border-top: 2px solid var(--ink); border-bottom: 1px solid var(--rule);
  color: var(--ink-2);
}
.health-icon {
  flex-shrink: 0; display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 50%;
  background: var(--tone); color: #fff; font-size: 0.9rem; margin-top: 2px;
}
.health-text { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; font-family: var(--ff-display); font-weight: 600; font-size: clamp(1.125rem, 1rem + 0.5vw, 1.375rem); line-height: 1.3; letter-spacing: -0.01em; }
.health-good { --tone: var(--moss); }
.health-warn { --tone: var(--amber); }
.health-bad { --tone: var(--rust); }
.v-good { color: var(--moss); }
.v-bad { color: var(--rust); }
.v-warn { color: var(--amber); }
.v-blocked { color: var(--plum); }
.v-sep { color: var(--rule-strong); }

/* summary tally: printed-form rows with dotted leaders */
.ledger { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 40px; margin: 0 0 24px; }
.ledger--single { grid-template-columns: minmax(0, 24rem); }
.ledger-h { margin: 0 0 4px; padding-bottom: 6px; border-bottom: 1px solid var(--ink); font-size: 0.75rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); }
.tally {
  display: flex; align-items: baseline; gap: 8px; width: 100%;
  min-height: 0; padding: 7px 4px; margin: 0;
  background: transparent; border: none; border-bottom: 1px solid var(--paper-2); border-radius: 0;
  font-weight: 400; font-size: 0.9375rem; color: var(--ink-2); text-align: left;
}
@media (hover: hover) {
  .tally:hover { background: var(--paper); border-color: var(--paper-2); }
  .tally:hover .tally-l { color: var(--ink); }
}
.tally-l { flex-shrink: 0; }
.tally-dots { flex: 1; min-width: 12px; border-bottom: 1.5px dotted var(--rule-strong); transform: translateY(-4px); }
.tally-n { font-family: var(--ff-display); font-weight: 600; font-size: 1.375rem; line-height: 1; font-variant-numeric: tabular-nums lining-nums; color: var(--ink); }
.tally-n.zero { color: var(--rule-strong); }
.tone-ok { color: var(--moss); } .tone-bad { color: var(--rust); } .tone-warn { color: var(--amber); }
.tone-info { color: var(--sky); } .tone-blk { color: var(--plum); } .tone-ink { color: var(--ink); }
/* the selected filter gets a hand-drawn underline, like a pen mark on the form */
.tally.active .tally-l { color: var(--ink); font-weight: 600; background: linear-gradient(transparent 62%, rgb(194 65 12 / 0.22) 62%, rgb(194 65 12 / 0.22) 92%, transparent 92%); }

.controls { margin: 0 0 20px; padding: 0; }
.controls-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.share-result { display: none; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 10px; font-size: 0.8125rem; color: var(--ink-2); }
.share-result.visible { display: flex; }
.share-result-link { font-family: var(--ff-mono); color: var(--rust); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.share-result-error { color: var(--rust); }

/* view tabs */
.view-tabs { display: flex; flex-wrap: wrap; gap: 4px; margin: 4px 0 16px; border-bottom: 1px solid var(--rule); }
.view-tab {
  min-height: 2.75rem; margin-bottom: -1px; padding: 0 14px;
  background: transparent; border: none; border-bottom: 2px solid transparent; border-radius: 0;
  color: var(--ink-2); font-weight: 500;
}
.view-tab:hover { background: transparent; color: var(--ink); border-bottom-color: var(--rule-strong); }
.view-tab.active { color: var(--ink); font-weight: 600; border-bottom-color: var(--rust); }
.view-tab .count { font-size: 0.75rem; font-weight: 600; color: var(--ink-3); background: var(--paper-2); border-radius: 999px; padding: 0 7px; }
.view-tab .count.bad { color: #fff; background: var(--rust); }
.view { display: none; }
.view.active { display: block; }

.view-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; }
.url-search {
  flex: 1 1 240px; min-height: 2.5rem; padding: 0 12px;
  background: #fff; color: var(--ink); border: 1px solid var(--rule-strong); border-radius: var(--radius-sm);
  font-family: var(--ff-body); font-size: 0.875rem;
}
.url-search:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgb(194 65 12 / 0.1); }
.url-search::placeholder { color: var(--ink-3); }
.chip { min-height: 2.125rem; padding: 0 12px; border-radius: 999px; font-weight: 500; font-size: 0.8125rem; color: var(--ink-2); gap: 6px; }
.chip .n { font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.chip.active { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.chip.active .n { color: var(--paper); }
.chip:disabled { opacity: 0.35; }
.toggle { display: inline-flex; align-items: center; gap: 8px; font-size: 0.875rem; color: var(--ink-2); cursor: pointer; }
.segmented { display: inline-flex; border: 1px solid var(--rule-strong); border-radius: var(--radius-sm); overflow: hidden; }
.segmented button { min-height: 2.25rem; border: none; border-radius: 0; background: #fff; font-weight: 500; font-size: 0.8125rem; color: var(--ink-2); }
.segmented button + button { border-left: 1px solid var(--rule-strong); }
.segmented button.active { background: var(--ink); color: var(--paper); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0 0 12px; font-size: 0.8125rem; color: var(--ink-3); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }

/* table */
.table-scroll { overflow: auto; max-height: 70vh; background: #fff; border: 1px solid var(--rule); border-radius: var(--radius-sm); }
table { width: 100%; border-collapse: collapse; }
.table-scroll table { min-width: 620px; }
thead th {
  position: sticky; top: 0; z-index: 1; height: 2.75rem; padding: 0 14px; text-align: left;
  background: var(--paper); border-bottom: 1px solid var(--rule);
  font-size: 0.75rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3);
}
tbody td { padding: 12px 14px; border-bottom: 1px solid var(--rule); font-size: 0.875rem; vertical-align: top; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--paper); }
.url-cell a { font-family: var(--ff-mono); font-size: 0.8125rem; color: var(--ink); text-decoration: none; overflow-wrap: anywhere; }
.url-cell a:hover { color: var(--rust); text-decoration: underline; }
.final-url { margin-top: 3px; font-family: var(--ff-mono); font-size: 0.75rem; color: var(--sky); overflow-wrap: anywhere; }
.error-msg { margin-top: 3px; font-size: 0.8125rem; color: var(--rust); }
.blocked-msg { margin-top: 3px; font-size: 0.8125rem; color: var(--plum); }
.col-findings { width: 300px; }
.findings { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.details-btn { min-height: 1.875rem; padding: 0 10px; font-size: 0.8125rem; font-weight: 500; }

.status-cell { display: inline-flex; align-items: center; gap: 7px; font-family: var(--ff-mono); font-weight: 500; font-size: 0.8125rem; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.status-cell-ok { color: var(--moss); }
.status-cell-redirect { color: var(--sky); }
.status-cell-c4xx, .status-cell-c5xx, .status-cell-err { color: var(--rust); }
.status-cell-blocked { color: var(--plum); }

/* tags */
.tags { display: inline-flex; flex-wrap: wrap; gap: 4px; vertical-align: middle; margin-left: 4px; }
.tag { display: inline-block; padding: 1px 8px; border-radius: 999px; background: var(--paper-2); color: var(--ink-2); font-size: 0.75rem; font-weight: 500; line-height: 1.25rem; white-space: nowrap; }
.tag.bad { background: var(--rust-soft); color: #9a3412; }
.tag.warn { background: var(--amber-soft); color: #7c4a03; }
.tag.info { background: var(--sky-soft); color: #174a82; }
.tag.ok { background: var(--moss-soft); color: #24532d; }
.tag.blocked { background: var(--plum-soft); color: #553a80; }

/* link lists */
.list-panel { max-height: 72vh; overflow: auto; background: #fff; border: 1px solid var(--rule); border-radius: var(--radius-sm); }
.list-empty { padding: 24px 18px; color: var(--ink-3); font-size: 0.9375rem; }
.list-more { padding: 12px 16px; border-top: 1px solid var(--rule); }
.lk { padding: 14px 16px; border-bottom: 1px solid var(--rule); }
.lk:last-child { border-bottom: none; }
.lk-head { display: flex; gap: 14px; align-items: flex-start; }
.lk-head .status-cell { min-width: 58px; padding-top: 1px; }
.lk-main { flex: 1; min-width: 0; }
.lk-url { font-family: var(--ff-mono); font-size: 0.8125rem; font-weight: 500; color: var(--ink); text-decoration: none; overflow-wrap: anywhere; }
a.lk-url:hover { color: var(--rust); text-decoration: underline; }
.lk-note { margin-top: 4px; font-size: 0.8125rem; color: var(--ink-3); overflow-wrap: anywhere; }
.lk-note.bad { color: var(--rust); }
.lk-note.warn { color: var(--amber); }
.lk-note.info { color: var(--sky); }
.lk-note.blocked { color: var(--plum); }
.occ { list-style: none; margin: 8px 0 0; padding: 0 0 0 12px; border-left: 2px solid var(--paper-2); }
.occ li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 8px; padding: 3px 0; font-size: 0.8125rem; color: var(--ink-2); }
.occ a { font-family: var(--ff-mono); font-size: 0.75rem; color: var(--ink); text-decoration: none; overflow-wrap: anywhere; }
.occ a:hover { color: var(--rust); text-decoration: underline; }
.anchor-text { font-style: italic; color: var(--ink-2); }
.anchor-text::before { content: "“"; }
.anchor-text::after { content: "”"; }
.occ-toggle { min-height: 0; margin-top: 4px; padding: 2px 0; background: transparent; border: none; color: var(--rust); font-weight: 600; font-size: 0.8125rem; }
.occ-toggle:hover { background: transparent; text-decoration: underline; }
.page-group-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px; padding: 14px 16px 4px; border-top: 1px solid var(--rule); }
.page-group:first-child .page-group-head { border-top: none; }
.page-group-head a { font-family: var(--ff-mono); font-size: 0.8125rem; font-weight: 500; color: var(--ink); overflow-wrap: anywhere; }
.page-group .lk { padding: 8px 16px 8px 30px; border-bottom: none; }

/* tree */
.tree-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0 0 12px; font-size: 0.8125rem; color: var(--ink-3); }
.tree-legend span { display: inline-flex; align-items: center; gap: 6px; }
.tree-panel { max-height: 65vh; overflow: auto; padding: 14px; background: #fff; border: 1px solid var(--rule); border-radius: var(--radius-sm); font-family: var(--ff-mono); font-size: 0.8125rem; }
.tree-root-label { font-weight: 500; color: var(--rust); margin-bottom: 6px; }
.tree-item { position: relative; }
.tree-row { display: flex; align-items: center; gap: 8px; padding: 4px 6px; border-radius: 4px; white-space: nowrap; }
.tree-row:hover { background: var(--paper); }
.tree-row.has-children { cursor: pointer; }
.tree-toggle { width: 12px; color: var(--ink-3); font-size: 10px; text-align: center; flex-shrink: 0; }
.tree-icon { width: 14px; text-align: center; flex-shrink: 0; }
.tree-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; background: var(--ink-3); }
.dot-ok { background: var(--moss); }
.dot-redirect { background: var(--sky); }
.dot-c4xx, .dot-c5xx, .dot-err { background: var(--rust); }
.dot-blocked { background: var(--plum); }
.tree-name { color: var(--ink); text-decoration: none; overflow: hidden; text-overflow: ellipsis; }
a.tree-name:hover { color: var(--rust); }
.has-children > .tree-name { font-weight: 500; }
.tree-count { font-size: 0.6875rem; color: var(--ink-3); background: var(--paper-2); border-radius: 999px; padding: 0 7px; }
.tree-children { margin-left: 10px; padding-left: 12px; border-left: 1px solid var(--rule); }
.tree-children.collapsed { display: none; }

/* modal */
.modal-overlay {
  position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 24px;
  background: rgb(28 26 23 / 0.35); visibility: hidden; opacity: 0;
  transition: opacity 0.2s var(--ease), visibility 0.2s var(--ease);
}
.modal-overlay.open { visibility: visible; opacity: 1; }
.modal-panel { width: 100%; max-width: 680px; max-height: 85vh; overflow-y: auto; background: var(--sheet); border-radius: var(--radius); box-shadow: 0 30px 80px -20px rgb(28 26 23 / 0.5); transform: translateY(10px); transition: transform 0.3s var(--ease); }
.modal-overlay.open .modal-panel { transform: none; }
.modal-header { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; padding: 16px 22px; background: var(--sheet); border-bottom: 1px solid var(--rule); }
.modal-title { font-family: var(--ff-display); font-weight: 600; font-size: 1.375rem; }
.modal-close { min-width: 2.25rem; min-height: 2.25rem; padding: 0; border: none; background: transparent; font-size: 1.5rem; color: var(--ink-3); }
.modal-close:hover { background: var(--paper-2); color: var(--ink); }
.modal-body { padding: 18px 22px 24px; }
.modal-url { margin-bottom: 14px; font-family: var(--ff-mono); font-size: 0.8125rem; overflow-wrap: anywhere; }
.modal-section { margin-top: 18px; }
.modal-label { margin-bottom: 4px; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
.modal-value { font-size: 0.9375rem; color: var(--ink-2); }

/* ---------------------------------------------------------------------
   Footer, toasts, floating button
   --------------------------------------------------------------------- */
footer.app-footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; margin-top: 4rem; padding-top: 1.25rem; border-top: 1px solid var(--rule); font-size: 0.8125rem; color: var(--ink-3); }
.footer-btn { min-height: 0; padding: 0; background: transparent; border: none; color: var(--ink-2); font-weight: 500; font-size: 0.8125rem; text-decoration: underline; text-underline-offset: 3px; }
.footer-btn:hover { background: transparent; color: var(--rust); }

.jump-fab { position: fixed; right: 20px; bottom: 20px; z-index: 50; box-shadow: var(--shadow-lift); }
.toast-stack { position: fixed; left: 20px; bottom: 20px; z-index: 70; display: flex; flex-direction: column-reverse; gap: 10px; width: min(380px, calc(100vw - 40px)); pointer-events: none; }
.toast {
  display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; pointer-events: auto;
  background: var(--ink); color: var(--paper); border-radius: var(--radius-sm); box-shadow: var(--shadow-lift);
  border-left: 4px solid var(--moss);
  opacity: 0; transform: translateY(10px); transition: opacity 0.3s var(--ease), transform 0.4s var(--ease);
}
.toast.visible { opacity: 1; transform: none; }
.toast.toast-warn { border-left-color: var(--rust); }
.toast.clickable { cursor: pointer; }
.toast-body { flex: 1; min-width: 0; }
.toast-title { font-weight: 600; font-size: 0.9375rem; }
.toast-detail { font-size: 0.8125rem; color: #cfc8bb; margin-top: 2px; }
.toast-close { min-height: 0; padding: 0 4px; background: transparent; border: none; color: #cfc8bb; font-size: 1.125rem; }
.toast-close:hover { background: transparent; color: #fff; }

/* report page */
.report-head { padding-block: 3rem 1.5rem; }
.report-head h1 { margin: 0.25rem 0 0.5rem; font-family: var(--ff-display); font-weight: 600; font-size: clamp(2rem, 1.4rem + 2.5vw, 3.25rem); line-height: 1.05; letter-spacing: -0.02em; overflow-wrap: anywhere; }
.report-head p { margin: 0; color: var(--ink-2); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

@media (max-width: 960px) {
  .hero { grid-template-columns: 1fr; }
  .slip { display: none; }
}

@media (max-width: 760px) {
  .job-phase { display: none; }
  .job-domain { max-width: 40vw; }
  .scan-row { flex-direction: column; }
  .scan-row button.primary { width: 100%; }
  .header-note { display: none; }
  .ledger { grid-template-columns: 1fr; gap: 18px; }
  .col-findings { width: auto; }
  .lk-head { flex-direction: column; gap: 6px; }
  .page-group .lk { padding-left: 16px; }
  .modal-overlay { padding: 10px; }
  .modal-body, .modal-header { padding-inline: 16px; }
  .jump-fab { right: 14px; bottom: 14px; }
  .toast-stack { left: 14px; right: 14px; bottom: 14px; width: auto; }
}
