/* phantocite design system — the ONLY place fonts, sizes, colours and radii are
   defined. Pages may add layout rules; they must not introduce new values
   (tests/test_design_tokens.py enforces this). */
:root {
  --bg: #f6f4ef; --bg-2: #fcfbf8; --card: #ffffff; --ink: #26241f; --muted: #6f6a5f;
  --border: #e2ddd2; --accent: #1f6f5c; --accent-strong: #1a5f4f; --focus: rgba(31, 111, 92, .18);
  --ok: #1f6f5c; --ok-bg: #dfeee8; --warn: #8a5a12; --warn-bg: #f6ecd0;
  --bad: #b3392f; --bad-bg: #f6dcd8; --info: #4a5f8a; --info-bg: #e4e9f2;
  --code-bg: #2b2a27; --code-ink: #f3efe6;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --fs-xs: .75rem; --fs-sm: .875rem; --fs-md: 1rem; --fs-lg: 1.25rem; --fs-xl: 1.75rem;
  --r: 8px; --r-pill: 999px;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: var(--font); font-size: var(--fs-md); line-height: 1.5; background: var(--bg); color: var(--ink); }
a { color: var(--accent); }
h1 { font-size: var(--fs-xl); font-weight: 600; margin: 0; line-height: 1.2; }
h1 em { color: var(--accent); font-style: normal; font-weight: 400; }
h2 { font-size: var(--fs-lg); font-weight: 600; margin: 2rem 0 .5rem; }
h3 { font-size: var(--fs-md); font-weight: 600; margin: 1.5rem 0 .25rem; }
p { margin: 0 0 .75rem; }
.wrap { max-width: min(960px, 94%); margin: 0 auto; padding: 0 1.5rem; }
.muted { color: var(--muted); }
.small { font-size: var(--fs-sm); }
.hidden { display: none !important; }

/* Label: the one style for form labels, section titles and table heads. */
.label { display: block; font-size: var(--fs-xs); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 1rem 0 .25rem; }
.help { font-size: var(--fs-sm); color: var(--muted); margin-top: .25rem; }

/* Panel: the one card surface. */
.panel { background: var(--card); border: 1px solid var(--border); border-radius: var(--r); padding: 1rem 1.25rem; }
.panel.inset { background: var(--bg-2); }
.panel.tone-ok { border-left: 3px solid var(--ok); }
.panel.tone-warn { border-left: 3px solid var(--warn); }
.panel.tone-bad { border-left: 3px solid var(--bad); }
.panel.tone-info { border-left: 3px solid var(--info); }

/* Chip: status, severity, verdicts, field statuses, summary counts. */
.chip { display: inline-flex; align-items: center; gap: .3rem; padding: .15rem .6rem; border-radius: var(--r-pill); font-size: var(--fs-xs); font-weight: 600; line-height: 1.4; color: #fff; background: var(--muted); vertical-align: middle; white-space: nowrap; }
.chip.ok { background: var(--ok); } .chip.warn { background: var(--warn); }
.chip.bad { background: var(--bad); } .chip.info { background: var(--info); }
.chip.soft { color: var(--muted); background: var(--bg); border: 1px solid var(--border); }
.chip.soft.ok { color: var(--ok); background: var(--ok-bg); border-color: transparent; }
.chip.soft.warn { color: var(--warn); background: var(--warn-bg); border-color: transparent; }
.chip.soft.bad { color: var(--bad); background: var(--bad-bg); border-color: transparent; }
.chip.soft.info { color: var(--info); background: var(--info-bg); border-color: transparent; }

/* Button: primary / secondary / ghost, one height. */
.btn { display: inline-flex; align-items: center; gap: .35rem; padding: .6rem 1.1rem; border-radius: var(--r); border: 1px solid transparent; background: var(--card); color: var(--accent); font: inherit; font-size: var(--fs-sm); font-weight: 600; line-height: 1.3; cursor: pointer; text-decoration: none; transition: background .15s, color .15s, border-color .15s; }
.btn.primary { background: var(--accent); color: #fff; }
.btn.primary:hover:not(:disabled) { background: var(--accent-strong); }
.btn.secondary { border-color: var(--accent); }
.btn.secondary:hover:not(:disabled) { background: var(--accent); color: #fff; }
.btn.secondary.bad { border-color: var(--bad); color: var(--bad); }
.btn.secondary.bad:hover:not(:disabled) { background: var(--bad); color: #fff; }
.btn.ghost { background: none; color: var(--muted); padding: .4rem .6rem; }
.btn.ghost:hover:not(:disabled) { color: var(--accent); }
.btn.small { padding: .35rem .75rem; }
.btn:disabled { opacity: .55; cursor: wait; }

/* Fields. */
input[type=file], input[type=password], input[type=text], input[type=number], select {
  width: 100%; padding: .6rem .75rem; border: 1px solid var(--border); border-radius: var(--r);
  font: inherit; font-size: var(--fs-md); background: var(--card); color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
input:hover, select:hover { border-color: var(--muted); }
input:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--focus); }
select { appearance: none; -webkit-appearance: none; padding-right: 2.2rem; background-repeat: no-repeat; background-position: right .8rem center;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5' fill='none' stroke='%236f6a5f' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
input[type=file] { border-style: dashed; background: var(--bg-2); color: var(--muted); cursor: pointer; padding: .75rem .9rem; }
input[type=file]:hover { border-color: var(--accent); }
input[type=file]::file-selector-button { background: var(--card); color: var(--accent); border: 1px solid var(--accent); border-radius: var(--r); padding: .4rem .9rem; margin-right: .9rem; font: inherit; font-size: var(--fs-sm); font-weight: 600; cursor: pointer; }
input[type=file]::file-selector-button:hover { background: var(--accent); color: #fff; }
input[type=checkbox] { accent-color: var(--accent); }

/* Table. */
.table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.table th { text-align: left; padding: .35rem .5rem .35rem 0; font-size: var(--fs-xs); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.table td { padding: .4rem .5rem .4rem 0; border-top: 1px solid var(--border); vertical-align: top; }

/* Details/summary without the default marker. */
details > summary { list-style: none; cursor: pointer; }
details > summary::-webkit-details-marker { display: none; }

/* Code (EduGenAI page only — the one intentional second family). */
code.inline { font-family: var(--mono); font-size: .9em; background: var(--border); padding: .1rem .35rem; border-radius: var(--r); }
pre { font-family: var(--mono); font-size: var(--fs-sm); line-height: 1.5; background: var(--code-bg); color: var(--code-ink); border-radius: var(--r); padding: 1rem 1.1rem; overflow-x: auto; }

/* Cookie bar: consent notice pinned to the bottom of the page. */
.cookie-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .75rem 1.5rem; padding: .75rem 1.5rem; background: var(--card); border-top: 1px solid var(--border); font-size: var(--fs-sm); color: var(--ink); }
.cookie-bar[hidden] { display: none; }
.cookie-bar .cookie-text { flex: 1 1 28rem; max-width: 60rem; }
.cookie-bar .cookie-actions { display: inline-flex; gap: .5rem; }
