/* Unreject — "review desk". Color comes from Google's code families; the rest stays quiet. */
:root {
  --bg: #f7f8fa;
  --surface: #ffffff;
  --ink: #15171c;
  --ink-2: #444a57;
  --line: #dde1e8;
  --action: #2a3fd1;
  --action-ink: #ffffff;
  --action-hover: #1f2fa6;
  --focus: #2a3fd1;
  --add-bg: #e3f6e8; --add-ink: #11602c;
  --del-bg: #fde8e6; --del-ink: #9b1c12;
  --high: #c62f1f; --medium: #b86e00; --info: #6b7280;
  --blue: #1a5fd0; --yellow: #f2b705; --purple: #7b3fc4; --red: #d23a2a; --grey: #5f6672;
  --radius: 8px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.6 var(--sans); }
img { max-width: 100%; }
a { color: var(--action); text-underline-offset: 2px; }
a:hover { color: var(--action-hover); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
code { font-family: var(--mono); font-size: 0.88em; background: #eef0f4; padding: 0.1em 0.35em; border-radius: 4px; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -0.015em; margin: 0 0 0.5em; }
h1 { font-size: clamp(1.8rem, 1.2rem + 2.4vw, 2.4rem); }
h2 { font-size: 1.45rem; margin-top: 2.2rem; }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; }
.lede { font-size: 1.15rem; color: var(--ink-2); max-width: 68ch; }
[hidden] { display: none !important; }

/* Header / footer */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); }
.site-header__inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 60px; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.1rem; color: var(--ink); text-decoration: none; }
.site-header nav { display: flex; gap: 6px; }
.site-header nav a { color: var(--ink-2); text-decoration: none; padding: 8px 12px; border-radius: 6px; font-weight: 500; }
.site-header nav a:hover { background: #eef0f4; color: var(--ink); }
.site-header nav a[aria-current="page"] { color: var(--ink); box-shadow: inset 0 -2px 0 var(--action); border-radius: 0; }
.site-footer { margin-top: 64px; border-top: 1px solid var(--line); padding: 28px 0 40px; color: var(--ink-2); font-size: 0.92rem; }
.site-footer p { max-width: 80ch; }

/* Buttons and fields */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 18px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: 600 1rem/1 var(--sans); cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { border-color: #b9bfcb; }
.btn--primary { background: var(--action); border-color: var(--action); color: var(--action-ink); }
.btn--primary:hover { background: var(--action-hover); border-color: var(--action-hover); color: var(--action-ink); }
.btn--small { min-height: 34px; padding: 0 12px; font-size: 0.88rem; }
.btn--link { border: 0; background: none; color: var(--action); min-height: 32px; padding: 0 4px; font-weight: 500; text-decoration: underline; text-underline-offset: 2px; }
.btn:disabled { opacity: 0.6; cursor: progress; }
.btn.is-done { background: var(--add-bg); border-color: #9ad3aa; color: var(--add-ink); }
input[type=search], input[type=email], textarea { width: 100%; font: inherit; color: var(--ink); background: var(--surface); border: 1px solid #c3c8d2; border-radius: var(--radius); padding: 10px 14px; }
input[type=search], input[type=email] { min-height: 48px; }
textarea { font-family: var(--mono); font-size: 0.9rem; line-height: 1.5; resize: vertical; }
input:focus-visible, textarea:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; border-color: var(--focus); }
[aria-invalid="true"] { border-color: var(--high); }
.field-error { color: var(--high); font-weight: 500; margin: 8px 0 0; }
.field-row { display: flex; gap: 8px; }
.field-row input { flex: 1; min-width: 0; }

/* Chips: the identity element */
.chip { display: inline-flex; align-items: center; gap: 7px; font: 600 0.9rem/1 var(--mono); padding: 6px 10px 6px 8px; border-radius: 6px; background: var(--surface); border: 1px solid var(--line); color: var(--ink); text-decoration: none; white-space: nowrap; }
.chip::before { content: ""; width: 12px; height: 12px; border-radius: 3px; background: var(--c, var(--grey)); flex: none; }
.chip--blue { --c: var(--blue); } .chip--yellow { --c: var(--yellow); } .chip--purple { --c: var(--purple); } .chip--red { --c: var(--red); } .chip--grey { --c: var(--grey); }
a.chip:hover { border-color: var(--c); }
.swatch { display: inline-block; width: 14px; height: 14px; border-radius: 3px; margin-right: 10px; vertical-align: -1px; }
.swatch--blue { background: var(--blue); } .swatch--yellow { background: var(--yellow); } .swatch--purple { background: var(--purple); } .swatch--red { background: var(--red); } .swatch--grey { background: var(--grey); }

/* Home */
.hero { background: var(--surface); border-bottom: 1px solid var(--line); padding: 56px 0 40px; }
.hero h1 { max-width: 30ch; }
.hero__lede { font-size: 1.15rem; color: var(--ink-2); max-width: 60ch; }
.lookup { display: flex; gap: 10px; max-width: 640px; margin: 24px 0 12px; }
.lookup input { font: 500 1.15rem var(--mono); min-height: 56px; }
.lookup .btn { min-height: 56px; padding: 0 24px; }
.hero__alt { color: var(--ink-2); }
.popular { list-style: none; padding: 0; margin: 28px 0 0; display: grid; grid-template-columns: repeat(2, minmax(0, 500px)); gap: 2px 24px; }
.popular a { display: grid; grid-template-columns: 178px minmax(0, 1fr); align-items: center; gap: 10px; text-decoration: none; color: var(--ink-2); font-size: 0.92rem; padding: 4px 10px 4px 4px; border-radius: 8px; border: 1px solid transparent; }
.popular .chip { justify-self: start; }
.popular a:hover { border-color: var(--line); background: var(--bg); color: var(--ink); }
.popular .chip { border-color: transparent; background: #eef0f4; }
.popular--list { grid-template-columns: minmax(0, 520px); }
.codes { padding-top: 40px; }
.codes__head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.codes__head h2 { margin-top: 0; }
.codes__head p { color: var(--ink-2); margin: 0; }
.family { margin-top: 28px; }
.family__title { display: flex; align-items: center; flex-wrap: wrap; gap: 0 4px; font-size: 1.05rem; text-transform: none; }
.family__theme { font-weight: 400; color: var(--ink-2); margin-left: 8px; font-size: 0.95rem; }
.code-list { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.code-row + .code-row { border-top: 1px solid var(--line); }
.code-row a { display: grid; grid-template-columns: 190px 240px 1fr auto; gap: 6px 20px; align-items: center; padding: 12px 16px; color: var(--ink); text-decoration: none; }
.code-row a:hover { background: #f2f4f8; }
.code-row a:focus-visible { outline-offset: -2px; }
.code-row__section { font-weight: 600; font-size: 0.95rem; }
.code-row__plain { color: var(--ink-2); font-size: 0.95rem; }
.code-row__go { font-size: 0.9rem; color: var(--ink-2); white-space: nowrap; }
.code-row--deep .code-row__go { color: var(--action); font-weight: 600; }
.codes__empty { margin-top: 24px; }

/* Code page */
.code-page { padding-top: 24px; }
.crumbs { font-size: 0.92rem; color: var(--ink-2); margin-bottom: 20px; }
.code-page__head { max-width: 820px; margin-bottom: 8px; }
.code-page__chip { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.code-page__chip .chip { font-size: 1rem; padding: 8px 12px 8px 10px; }
.code-page__section { color: var(--ink-2); font-weight: 500; }
.code-page__grid { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 48px; align-items: start; }
.code-page__body { max-width: 780px; }
.code-page__body > section:first-child h2 { margin-top: 1rem; }
.toc { position: sticky; top: 20px; font-size: 0.92rem; padding-top: 1.4rem; }
.toc__title { font-weight: 700; margin-bottom: 6px; }
.toc ol { list-style: none; padding: 0; margin: 0 0 16px; border-left: 2px solid var(--line); }
.toc li a { display: block; padding: 5px 12px; color: var(--ink-2); text-decoration: none; }
.toc li a:hover { color: var(--action); }
.toc__scan { font-weight: 600; }
.triggers li, .checklist li { margin-bottom: 0.6em; }
.triggers { padding-left: 1.2em; }
.checklist { list-style: none; padding: 0; counter-reset: step; }
.checklist label { display: grid; grid-template-columns: 28px 1fr; gap: 10px; align-items: start; padding: 10px 12px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); cursor: pointer; }
.checklist input { width: 20px; height: 20px; margin: 3px 0 0; accent-color: var(--action); }
.checklist input:checked + span { color: var(--ink-2); text-decoration: line-through; text-decoration-color: #9aa1ad; }
.hint { color: var(--ink-2); font-size: 0.92rem; }
.callout { background: #fff8e1; border-left: 4px solid var(--yellow); padding: 12px 16px; border-radius: 0 var(--radius) var(--radius) 0; }
.official { color: var(--ink-2); font-size: 0.95rem; margin-top: 24px; }

/* Diff: the main component */
.diff { margin: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.diff__head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 8px 8px 8px 14px; border-bottom: 1px solid var(--line); background: #f2f4f8; }
.diff__file { font: 600 0.9rem var(--mono); }
.diff__legend { display: flex; gap: 10px; font: 0.82rem var(--mono); margin-right: auto; }
.diff__key--del { color: var(--del-ink); } .diff__key--add { color: var(--add-ink); }
.diff__body { margin: 0; overflow-x: auto; font: 0.88rem/1.55 var(--mono); padding: 8px 0; }
.diff__body code { background: none; padding: 0; font-size: inherit; display: block; min-width: max-content; }
.diff__line { display: block; padding: 0 16px 0 0; white-space: pre; }
.diff__sign { display: inline-block; width: 28px; text-align: center; color: var(--ink-2); user-select: none; }
.diff__line--add { background: var(--add-bg); color: var(--add-ink); }
.diff__line--del { background: var(--del-bg); color: var(--del-ink); }
.diff__line--add .diff__sign { color: var(--add-ink); font-weight: 700; }
.diff__line--del .diff__sign { color: var(--del-ink); font-weight: 700; }
.diff__note { color: var(--ink-2); margin-top: 12px; }

/* Appeal */
.appeal { position: relative; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.appeal__text { margin: 0; padding: 16px 16px 56px; font: 0.88rem/1.55 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; }
.appeal .btn { position: absolute; right: 10px; bottom: 10px; }

/* Fix Pack */
.fixpack { margin: 48px 0 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px 32px; align-items: center; padding: 24px; background: #eef1ff; border: 1px solid #cdd4fb; border-radius: 12px; }
.fixpack h2 { margin: 0 0 8px; font-size: 1.25rem; }
.fixpack p { margin-bottom: 8px; max-width: 60ch; }
.fixpack__honest { color: var(--ink-2); font-size: 0.92rem; }
.fixpack__action { min-width: 300px; }
.fixpack__form label { display: block; font-weight: 600; margin-bottom: 6px; }
.fixpack__done { font-weight: 500; margin: 0; max-width: 34ch; }

/* Scanner */
.scanner { padding-top: 32px; }
.scanner__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; align-items: start; margin-top: 16px; }
.field { margin-bottom: 16px; }
.field__label-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.field__label-row label { font: 600 0.95rem var(--mono); }
details.field summary { cursor: pointer; font-weight: 600; padding: 8px 0; }
details.field textarea { margin-top: 8px; }
.scanner__actions { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.scanner__actions .btn { min-width: 140px; }
.privacy { margin: 0; color: var(--add-ink); font-weight: 500; font-size: 0.95rem; }
.privacy::before { content: "● "; }
.scanner__results { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; min-height: 300px; }
.scanner__results h2 { margin-top: 0; font-size: 1.2rem; }
.empty { color: var(--ink-2); }
.summary { font-size: 1.05rem; }
.codes-hit { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.findings { list-style: none; padding: 0; margin: 16px 0 0; }
.finding { border-left: 4px solid var(--info); padding: 10px 0 10px 14px; margin-bottom: 10px; background: #fafbfc; border-radius: 0 6px 6px 0; }
.finding--high { border-left-color: var(--high); }
.finding--medium { border-left-color: var(--medium); }
.finding__meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 4px; }
.finding__sev { font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--info); }
.finding--high .finding__sev { color: var(--high); }
.finding--medium .finding__sev { color: var(--medium); }
.finding .chip { font-size: 0.8rem; padding: 4px 8px 4px 6px; }
.finding__path { font-size: 0.8rem; }
.finding__title { font-weight: 600; margin-bottom: 2px; overflow-wrap: anywhere; }
.finding__detail { color: var(--ink-2); margin: 0; font-size: 0.95rem; padding-right: 10px; }
.files summary { cursor: pointer; font-weight: 500; }
.files ul { padding-left: 1.2em; }
.files li span { color: var(--ink-2); font-size: 0.85rem; }
.scanner__limits { color: var(--ink-2); font-size: 0.95rem; max-width: 80ch; margin-top: 24px; }

@media (max-width: 960px) {
  .code-row a { grid-template-columns: 180px 1fr; }
  .code-row__plain { grid-column: 1 / -1; }
  .code-row__go { grid-column: 1 / -1; }
  .code-page__grid { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .toc { display: none; }
}
@media (max-width: 860px) {
  .scanner__grid { grid-template-columns: 1fr; }
  .fixpack { grid-template-columns: 1fr; }
  .fixpack__action { min-width: 0; }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .hero { padding: 36px 0 28px; }
  .lookup { flex-direction: column; }
  .code-row a { grid-template-columns: 1fr; gap: 4px; }
  .field-row { flex-direction: column; }
  .site-header__inner { flex-wrap: nowrap; gap: 8px; }
  .brand { gap: 8px; }
  .site-header nav { gap: 0; }
  .site-header nav a { padding: 8px 6px; font-size: 0.92rem; }
  h1 { font-size: 1.65rem; }
  .hero__lede { font-size: 1.05rem; }
  .lookup { margin-top: 18px; }
  .popular { grid-template-columns: minmax(0, 1fr); }
  .popular a { grid-template-columns: 158px minmax(0, 1fr); font-size: 0.88rem; }
  .popular .chip { font-size: 0.82rem; }
  .diff__head { padding: 8px 8px 8px 12px; }
  .diff__legend { margin-right: 0; }
  .diff__head .btn { margin-left: auto; }
  .scanner__results { padding: 16px 14px; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }
