/* ClickScout — Material 3 (Material Web components), monochrome scheme. */
:root {
  /* Primary (brand): Jersey 15 for logo, display, headline, title. Secondary (plain): Roboto Serif for body & labels. */
  --md-ref-typeface-brand: 'Jersey 15', system-ui, sans-serif;
  --md-ref-typeface-plain: 'Roboto Serif', Georgia, serif;
  --logo-font: var(--md-ref-typeface-brand);
  --mono: 'Roboto Mono', ui-monospace, Menlo, Consolas, monospace;

  /* Light monochrome scheme (M3 color roles) */
  --md-sys-color-primary: #000000;
  --md-sys-color-on-primary: #ffffff;
  --md-sys-color-primary-container: #e2e2e2;
  --md-sys-color-on-primary-container: #000000;
  --md-sys-color-secondary: #3b3b3b;
  --md-sys-color-on-secondary: #ffffff;
  --md-sys-color-secondary-container: #e2e2e2;
  --md-sys-color-on-secondary-container: #000000;
  --md-sys-color-surface: #ffffff;
  --md-sys-color-on-surface: #000000;
  --md-sys-color-on-surface-variant: #474747;
  --md-sys-color-surface-container-lowest: #ffffff;
  --md-sys-color-surface-container-low: #f7f7f7;
  --md-sys-color-surface-container: #f0f0f0;
  --md-sys-color-surface-container-high: #e8e8e8;
  --md-sys-color-surface-container-highest: #e0e0e0;
  --md-sys-color-inverse-surface: #000000;
  --md-sys-color-inverse-on-surface: #ffffff;
  --md-sys-color-outline: #7a7a7a;
  --md-sys-color-outline-variant: #cfcfcf;
  --md-sys-color-shadow: #000000;
  --md-sys-color-error: #000000;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --md-sys-color-primary: #ffffff; --md-sys-color-on-primary: #000000;
    --md-sys-color-primary-container: #2a2a2a; --md-sys-color-on-primary-container: #ffffff;
    --md-sys-color-secondary: #c6c6c6; --md-sys-color-on-secondary: #000000;
    --md-sys-color-secondary-container: #2a2a2a; --md-sys-color-on-secondary-container: #ffffff;
    --md-sys-color-surface: #000000; --md-sys-color-on-surface: #ffffff; --md-sys-color-on-surface-variant: #bdbdbd;
    --md-sys-color-surface-container-lowest: #000000; --md-sys-color-surface-container-low: #0d0d0d;
    --md-sys-color-surface-container: #141414; --md-sys-color-surface-container-high: #1e1e1e;
    --md-sys-color-surface-container-highest: #292929;
    --md-sys-color-inverse-surface: #ffffff; --md-sys-color-inverse-on-surface: #000000;
    --md-sys-color-outline: #8c8c8c; --md-sys-color-outline-variant: #333333; --md-sys-color-error: #ffffff;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --md-sys-color-primary: #ffffff; --md-sys-color-on-primary: #000000;
  --md-sys-color-primary-container: #2a2a2a; --md-sys-color-on-primary-container: #ffffff;
  --md-sys-color-secondary: #c6c6c6; --md-sys-color-on-secondary: #000000;
  --md-sys-color-secondary-container: #2a2a2a; --md-sys-color-on-secondary-container: #ffffff;
  --md-sys-color-surface: #000000; --md-sys-color-on-surface: #ffffff; --md-sys-color-on-surface-variant: #bdbdbd;
  --md-sys-color-surface-container-lowest: #000000; --md-sys-color-surface-container-low: #0d0d0d;
  --md-sys-color-surface-container: #141414; --md-sys-color-surface-container-high: #1e1e1e;
  --md-sys-color-surface-container-highest: #292929;
  --md-sys-color-inverse-surface: #ffffff; --md-sys-color-inverse-on-surface: #000000;
  --md-sys-color-outline: #8c8c8c; --md-sys-color-outline-variant: #333333; --md-sys-color-error: #ffffff;
  color-scheme: dark;
}

/* Stock M3 type scale. Jersey 15 has one weight and a small x-height, so brand roles run at 400 and a touch larger. */
:root {
  --md-outlined-text-field-input-text-size: 18px;
  --md-sys-typescale-display-large-weight: 400; --md-sys-typescale-display-medium-weight: 400; --md-sys-typescale-display-small-weight: 400;
  --md-sys-typescale-headline-large-weight: 400; --md-sys-typescale-headline-medium-weight: 400; --md-sys-typescale-headline-small-weight: 400;
  --md-sys-typescale-title-large-weight: 400; --md-sys-typescale-title-medium-weight: 400; --md-sys-typescale-title-small-weight: 400;
  --md-sys-typescale-headline-large-size: 40px; --md-sys-typescale-headline-medium-size: 34px; --md-sys-typescale-headline-small-size: 30px;
  --md-sys-typescale-title-large-size: 26px;
}
body { font-optical-sizing: auto; }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0; background: var(--md-sys-color-surface); color: var(--md-sys-color-on-surface);
  font-family: var(--md-ref-typeface-plain); font-size: 16px; line-height: 1.5;
  transition: background .3s, color .3s;
}
md-icon { font-variation-settings: 'FILL' 0; }
.muted { color: var(--md-sys-color-on-surface-variant); margin: 0; }
.caveat { display: flex; gap: 8px; align-items: flex-start; margin: -4px 0 0; color: var(--md-sys-color-on-surface-variant); }
.caveat md-icon { --md-icon-size: 18px; flex: none; margin-top: 1px; }

/* ---------- top app bar (M3 small top app bar) ---------- */
.top-app-bar {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between;
  height: 64px; padding: 0 8px 0 16px; background: var(--md-sys-color-surface);
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
}
.brand { display: flex; align-items: center; gap: 12px; }
.logo { display: grid; place-items: center; width: 32px; height: 40px; }
.logo svg { display: block; }
.wordmark { font-family: var(--logo-font); font-size: 34px; letter-spacing: .02em; line-height: 1; }

main { max-width: 920px; margin: 0 auto; padding: 0 16px 48px; }

/* ---------- hero ---------- */
.hero { padding: 56px 0 24px; }
h1 { font-family: var(--md-ref-typeface-brand); font-size: clamp(48px, 10vw, 80px); line-height: 1; letter-spacing: .01em; margin: 0 0 16px; font-weight: 400; }
h1 em {
  font-style: normal; display: inline-block; line-height: .95; padding: 0 .16em .04em; border-radius: 12px;
  background: var(--md-sys-color-primary); color: var(--md-sys-color-on-primary);
}
.lede { color: var(--md-sys-color-on-surface-variant); max-width: 640px; margin: 0 0 32px; }

.search { display: flex; gap: 12px; align-items: flex-start; }
.search md-outlined-text-field { flex: 1; min-width: 0; }
.search md-filled-button { height: 56px; margin-top: 4px; --md-filled-button-container-height: 56px; --md-filled-button-container-shape: 16px; padding-inline: 8px; }

.examples { display: flex; align-items: center; gap: 12px; margin-top: 12px; flex-wrap: wrap; }
.label, .section-title { color: var(--md-sys-color-on-surface-variant); font-weight: 500; }
.section-title { margin: 0 0 8px; }

/* ---------- results ---------- */
.results { display: grid; gap: 16px; margin-top: 16px; }
.result {
  display: grid; gap: 20px; padding: 24px;
  --md-outlined-card-container-shape: 28px;
  --md-outlined-card-container-color: var(--md-sys-color-surface-container-low);
  color: var(--md-sys-color-on-surface);
  animation: rise .4s cubic-bezier(.2, 0, 0, 1);
}
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }

/* Dangerous flips the card to the inverse scheme — every M3 component inside follows automatically. */
.result[data-level="danger"] {
  --md-sys-color-primary: var(--md-sys-color-inverse-on-surface);
  --md-sys-color-on-primary: var(--md-sys-color-inverse-surface);
  --md-sys-color-surface: var(--md-sys-color-inverse-surface);
  --md-sys-color-on-surface: var(--md-sys-color-inverse-on-surface);
  --md-sys-color-on-surface-variant: color-mix(in srgb, var(--md-sys-color-inverse-on-surface) 72%, var(--md-sys-color-inverse-surface));
  --md-sys-color-surface-container: color-mix(in srgb, var(--md-sys-color-inverse-on-surface) 10%, var(--md-sys-color-inverse-surface));
  --md-sys-color-surface-container-high: color-mix(in srgb, var(--md-sys-color-inverse-on-surface) 18%, var(--md-sys-color-inverse-surface));
  --md-sys-color-surface-container-highest: color-mix(in srgb, var(--md-sys-color-inverse-on-surface) 24%, var(--md-sys-color-inverse-surface));
  --md-sys-color-outline: color-mix(in srgb, var(--md-sys-color-inverse-on-surface) 55%, var(--md-sys-color-inverse-surface));
  --md-sys-color-outline-variant: color-mix(in srgb, var(--md-sys-color-inverse-on-surface) 25%, var(--md-sys-color-inverse-surface));
  --md-outlined-card-container-color: var(--md-sys-color-inverse-surface);
  --md-outlined-card-outline-color: var(--md-sys-color-inverse-surface);
}
.result[data-level="suspicious"] {
  --md-outlined-card-container-color: var(--md-sys-color-surface-container-high);
  --md-outlined-card-outline-color: var(--md-sys-color-outline);
}
.result[data-level="safe"] { --md-outlined-card-container-color: var(--md-sys-color-surface); }

.result-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.overline { color: var(--md-sys-color-on-surface-variant); }
.email { margin: 4px 0 0; font-weight: 400; word-break: break-all; line-height: 1.2; }
.email .at { opacity: .45; }
.verdict { text-align: right; flex: none; }
.score { font-family: var(--md-ref-typeface-brand); font-size: 56px; font-weight: 400; line-height: 1; min-height: 52px; display: flex; justify-content: flex-end; align-items: center; }
.verdict-label { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
md-icon.big { --md-icon-size: 48px; }
md-circular-progress { --md-circular-progress-size: 48px; }
md-linear-progress { --md-linear-progress-track-height: 8px; --md-linear-progress-active-indicator-height: 8px; --md-linear-progress-track-shape: 999px; width: 100%; }

.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.tile { background: var(--md-sys-color-surface-container); border-radius: 16px; padding: 14px 16px; min-width: 0; }
.result[data-level="suspicious"] .tile { background: var(--md-sys-color-surface); }
.tile-label { display: flex; align-items: center; gap: 6px; color: var(--md-sys-color-on-surface-variant); }
.tile-label md-icon { --md-icon-size: 18px; }
.tile-value { margin-top: 6px; overflow-wrap: anywhere; line-height: 1.1; }
.tile-sub { color: var(--md-sys-color-on-surface-variant); margin-top: 2px; }

.findings {
  --md-list-container-color: var(--md-sys-color-surface-container);
  --md-list-item-container-color: transparent;
  border-radius: 16px; overflow: hidden; padding: 0;
}
.sev {
  display: inline-block; min-width: 68px; padding: 2px 6px; text-align: center; text-transform: capitalize;
  border-radius: 8px; border: 1px solid var(--md-sys-color-outline); color: var(--md-sys-color-on-surface);
}
[data-sev="critical"] .sev { background: var(--md-sys-color-on-surface); color: var(--md-sys-color-surface); border-color: var(--md-sys-color-on-surface); }
[data-sev="high"] .sev { border: 2px solid var(--md-sys-color-on-surface); }
[data-sev="info"] .sev { border-style: dotted; color: var(--md-sys-color-on-surface-variant); }
.pts { color: var(--md-sys-color-on-surface-variant); }

md-assist-chip[data-state="bad"], md-assist-chip[data-level="danger"] {
  --md-assist-chip-outline-color: var(--md-sys-color-on-surface);
  --md-assist-chip-outline-width: 2px;
}
md-assist-chip[data-state="err"] { opacity: .7; }
md-assist-chip[data-state="loading"] md-icon { animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .25; } }

.raw summary { display: flex; align-items: center; gap: 6px; cursor: pointer; list-style: none; color: var(--md-sys-color-on-surface-variant); }
.raw summary::-webkit-details-marker { display: none; }
.raw summary md-icon { transition: transform .2s; }
.raw[open] summary md-icon { transform: rotate(180deg); }
.raw dl { display: grid; grid-template-columns: 150px 1fr; gap: 6px 16px; margin: 12px 0 0; }
.raw dt { font-size: 14px; font-weight: 500; color: var(--md-sys-color-on-surface-variant); }
.raw dd { margin: 0; font-family: var(--mono); font-size: 13px; white-space: pre-wrap; overflow-wrap: anywhere; letter-spacing: 0; }

.actions { display: flex; flex-wrap: wrap; gap: 4px; margin: -8px -12px -12px; }

/* ---------- history / about ---------- */
.history { margin-top: 40px; }
.section-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.section-head .section-title { margin: 0; }
.about { margin-top: 40px; padding: 24px; display: grid; gap: 16px; --md-outlined-card-container-shape: 28px; }
.checks { display: grid; grid-template-columns: 1fr 1fr; background: transparent; padding: 0; --md-list-container-color: transparent; }
.site-footer { text-align: center; padding: 24px 16px 40px; color: var(--md-sys-color-on-surface-variant); }

/* ---------- responsive ---------- */
@media (max-width: 720px) {
  .grid { grid-template-columns: 1fr 1fr; }
  .checks { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .hero { padding-top: 32px; }
  .search { flex-direction: column; align-items: stretch; }
  .result { padding: 20px 16px; }
  .result-head { flex-direction: column-reverse; }
  .verdict { text-align: left; display: flex; align-items: center; gap: 12px; }
  .score { font-size: 48px; justify-content: flex-start; }
  .verdict-label { justify-content: flex-start; }
  .raw dl { grid-template-columns: 1fr; gap: 2px; }
  .raw dd { margin-bottom: 8px; }
  .sev { min-width: 60px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---------- links ---------- */
.overline { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.overline md-icon { --md-icon-size: 16px; }
.email.url .path { display: block; font-size: .5em; line-height: 1.3; opacity: .7; margin-top: 4px; }
.email.url s { text-decoration-thickness: 2px; }

/* ---------- extension popup ---------- */
body.popup { width: 440px; min-height: 480px; }
body.popup main { padding: 0 12px 16px; }
body.popup .hero { padding: 12px 0 0; }
body.popup h1, body.popup .lede, body.popup .examples, body.popup .about, body.popup .site-footer, body.popup .history { display: none; }
body.popup .top-app-bar { height: 56px; }
body.popup .search { flex-direction: column; align-items: stretch; }
body.popup .search md-filled-button { height: 44px; --md-filled-button-container-height: 44px; margin: 0; }
body.popup .result { padding: 16px; gap: 14px; }
body.popup .result-head { flex-direction: column-reverse; }
body.popup .verdict { text-align: left; display: flex; align-items: center; gap: 12px; }
body.popup .score { font-size: 44px; justify-content: flex-start; }
body.popup .grid { grid-template-columns: 1fr 1fr; }
body.popup .raw dl { grid-template-columns: 1fr; gap: 2px; }
.ext-settings { display: grid; gap: 12px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--md-sys-color-outline-variant); }
.ext-settings label { display: flex; gap: 14px; align-items: center; cursor: pointer; }
.ext-settings b { font-weight: 500; }
.ext-settings small { color: var(--md-sys-color-on-surface-variant); }
.ext-settings md-text-button { justify-self: start; }

/* ---------- privacy policy ---------- */
.policy { max-width: 720px; padding-top: 40px; }
.policy h1 { font-size: 56px; margin-bottom: 8px; }
.policy h2 { margin: 32px 0 8px; font-weight: 400; }
.policy p, .policy li { line-height: 1.65; }
.policy ul { padding-left: 20px; display: grid; gap: 8px; }
.policy code { font-family: var(--mono); font-size: .9em; }
.policy a, .site-footer a { color: inherit; }
.ext-access { display: grid; gap: 10px; margin-bottom: 16px; }
.ext-access[hidden] { display: none; }
.ext-access h1 { margin: 8px 0 4px; }
.ext-access-card { display: flex; gap: 14px; padding: 16px; border-radius: 20px; background: var(--md-sys-color-inverse-surface); color: var(--md-sys-color-inverse-on-surface);
  --md-sys-color-primary: var(--md-sys-color-inverse-on-surface); --md-sys-color-on-primary: var(--md-sys-color-inverse-surface); }
.ext-access-card > md-icon { --md-icon-size: 28px; flex: none; margin-top: 2px; }
.ext-access-card b { font-family: var(--md-ref-typeface-brand); font-weight: 400; font-size: 24px; }
.ext-access-card p { margin: 4px 0 12px; font-size: 14px; opacity: .85; }
.ext-note { margin: 0; font-size: 13px; color: var(--md-sys-color-on-surface-variant); }
.ext-credit { margin: 0; text-align: center; font-size: 12px; color: var(--md-sys-color-on-surface-variant); }
.ext-credit a { color: inherit; }
.ext-links { display: flex; justify-content: space-between; flex-wrap: wrap; }

/* ---------- extension popup: page scan ---------- */
.page-scan { display: grid; gap: 12px; margin-top: 16px; }
.page-scan[hidden] { display: none; }
.page-scan md-outlined-button { height: 44px; }
.scan-summary { margin: 0; display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; font-size: 14px; }
.scan-summary b { font-family: var(--md-ref-typeface-brand); font-weight: 400; font-size: 24px; margin-right: 4px; }
.scan-summary span { padding: 2px 10px; border-radius: 999px; border: 1px solid var(--md-sys-color-outline); }
.scan-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.scan-list li { display: flex; align-items: center; gap: 4px; border-radius: 16px; border: 1px solid var(--md-sys-color-outline); }
.scan-list li[data-level="danger"] { background: var(--md-sys-color-inverse-surface); color: var(--md-sys-color-inverse-on-surface); border-color: transparent; --md-icon-button-icon-color: currentColor; }
.scan-item { all: unset; box-sizing: border-box; flex: 1; min-width: 0; display: flex; gap: 12px; align-items: flex-start; padding: 12px 4px 12px 14px; cursor: pointer; border-radius: 16px; }
.scan-item:focus-visible { outline: 2px solid currentColor; outline-offset: -4px; }
.scan-item > md-icon { flex: none; margin-top: 1px; }
.scan-item span { min-width: 0; display: grid; gap: 2px; }
.scan-item b { font-weight: 600; overflow-wrap: anywhere; }
.scan-item small { font-size: 12.5px; opacity: .8; overflow-wrap: anywhere; }
.scan-mark { display: flex; gap: 12px; align-items: center; cursor: pointer; font-size: 14px; }
