@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../fonts/inter-latin-variable.woff2") format("woff2");
}

/* Brand tokens: ink blue + ember redaction bar (design/brand/build_svgs.py). */
:root {
  --bg: #eef0f4;
  --card: #fcfcfd;
  --line: #d8dce5;
  --line-strong: #b6bccb;
  --text: #161c2e;
  --muted: #586079;
  --ink: #1c2846;
  --ink-deep: #121a30;
  --ember: #c4572a;
  --ember-soft: #fbe9df;
  --ok: #2d6a4f;
  --ok-soft: #e3f1e9;
  --warn: #8a5a12;
  --warn-soft: #fbf0d9;
  --danger: #a93a2f;
  --danger-soft: #f9e3e0;
  --radius: 10px;
  --font: "Inter", -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", Consolas, monospace;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
}

a { color: var(--ink); }
a:hover { color: var(--ember); }

code, .mono { font-family: var(--mono); font-size: 0.92em; }

/* -- header ---------------------------------------------------------------- */
.site-header {
  background: var(--ink);
  color: #fff;
  border-bottom: 3px solid var(--ember);
}

.site-header .inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.site-header .brand img { height: 28px; display: block; }

.site-header nav { display: flex; gap: 4px; flex-wrap: wrap; flex: 1; }

.site-header nav a {
  color: #dfe3ee;
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 6px;
  font-weight: 500;
}

.site-header nav a:hover, .site-header nav a.active { background: rgba(255, 255, 255, 0.12); color: #fff; }

.site-header .account { display: flex; align-items: center; gap: 12px; color: #c8cede; font-size: 14px; }

.site-header .account form { margin: 0; }

.site-header .account button {
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.35);
  padding: 4px 10px;
  font-size: 13px;
}

main {
  max-width: 1080px;
  margin: 0 auto;
  padding: 24px 16px 64px;
}

footer.site-footer {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 16px 32px;
  color: var(--muted);
  font-size: 13px;
}

/* -- layout pieces ----------------------------------------------------------- */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

h1 { font-size: 26px; line-height: 1.2; margin: 0 0 6px; letter-spacing: -0.01em; }
h2 { font-size: 18px; margin: 0 0 8px; }
h3 { font-size: 15px; margin: 16px 0 6px; }

.lead { color: var(--muted); margin: 0; max-width: 70ch; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
}

.card > :last-child { margin-bottom: 0; }

.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }

.steps { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 20px; padding: 0; list-style: none; }

.steps li {
  font-size: 13px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #e2e6ee;
  color: var(--muted);
}

.steps li.done { background: var(--ok-soft); color: var(--ok); }
.steps li.current { background: var(--ink); color: #fff; }

.muted { color: var(--muted); }
.small { font-size: 13px; }

/* -- forms ------------------------------------------------------------------- */
label { display: block; font-weight: 600; margin: 12px 0 4px; }
label.inline { display: flex; align-items: flex-start; gap: 8px; font-weight: 400; }
label .hint { display: block; font-weight: 400; color: var(--muted); font-size: 13px; }

input[type="text"], input[type="password"], input[type="file"], textarea, select {
  width: 100%;
  max-width: 520px;
  font: inherit;
  padding: 8px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: #fff;
  color: var(--text);
}

textarea { min-height: 90px; max-width: 100%; }

input:focus, textarea:focus, select:focus, button:focus-visible, a:focus-visible {
  outline: 3px solid rgba(196, 87, 42, 0.35);
  outline-offset: 1px;
}

button, .button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font: inherit;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 7px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: #fff;
  cursor: pointer;
  text-decoration: none;
}

button:hover, .button:hover { background: var(--ink-deep); color: #fff; }

button.secondary, .button.secondary { background: #fff; color: var(--ink); }
button.secondary:hover, .button.secondary:hover { background: #eef1f7; color: var(--ink); }

button.danger, .button.danger { background: var(--danger); border-color: var(--danger); }
button.small, .button.small { padding: 4px 10px; font-size: 13px; }

button:disabled, .button.disabled { opacity: 0.5; cursor: not-allowed; pointer-events: none; }

.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 16px; }

form.inline { display: inline; margin: 0; }

/* -- messages and badges ------------------------------------------------------ */
.notice {
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  background: #fff;
}

.notice.ok { background: var(--ok-soft); border-color: #b7dbc6; }
.notice.warn { background: var(--warn-soft); border-color: #ecd39f; }
.notice.error { background: var(--danger-soft); border-color: #eeb9b2; }
.notice.privacy { background: var(--ember-soft); border-color: #efc3ae; }
.notice > :last-child { margin-bottom: 0; }
.notice ul { margin: 6px 0 0; padding-left: 20px; }

.badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  background: #e2e6ee;
  color: var(--muted);
  white-space: nowrap;
}

.badge.safe, .badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.review { background: var(--warn-soft); color: var(--warn); }
.badge.blocked, .badge.danger { background: var(--danger-soft); color: var(--danger); }
.badge.ink { background: var(--ink); color: #fff; }

.code-chip {
  font-family: var(--mono);
  font-size: 13px;
  background: var(--ink);
  color: #fff;
  padding: 1px 6px;
  border-radius: 4px;
  white-space: nowrap;
}

/* -- tables ------------------------------------------------------------------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }

th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }

th { font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); font-weight: 600; }

tr:last-child td { border-bottom: 0; }

td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

.diff-old { color: var(--muted); text-decoration: line-through; }
.diff-new { color: var(--ok); font-weight: 600; }

.feedback-cell { max-width: 420px; white-space: pre-wrap; }

/* -- review ------------------------------------------------------------------- */
.previews { display: flex; flex-wrap: wrap; gap: 10px; }
.previews img { max-width: 220px; max-height: 280px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }

pre.text-preview {
  white-space: pre-wrap;
  word-break: break-word;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  max-height: 480px;
  overflow: auto;
  font-size: 13px;
}

.progress { height: 10px; background: #e2e6ee; border-radius: 999px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--ember); transition: width 0.4s; }

.term-list { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; padding: 0; list-style: none; }
.term-list li { background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 2px 8px; font-size: 13px; }

details summary { cursor: pointer; font-weight: 600; }

/* -- login ------------------------------------------------------------------- */
.auth-shell { max-width: 400px; margin: 48px auto; }
.auth-shell .logo { display: block; margin: 0 auto 24px; height: 44px; }

@media (max-width: 640px) {
  main { padding: 16px 16px 48px; }
  h1 { font-size: 22px; }
  .card { padding: 16px; }
  .site-header .inner { gap: 10px; }
}

.site-header .account-link { color: inherit; }
.actions.tight { margin: 0 0 6px; }
.password-box { font-family: var(--mono); font-size: 22px; letter-spacing: 0.04em; background: #fff; border: 2px dashed var(--ember); border-radius: 8px; padding: 12px 16px; display: inline-block; user-select: all; }
