@font-face {
  font-family: "Noto Serif";
  src: url("/fonts/NotoSerif-Regular.ttf") format("truetype");
  font-weight: 400;
}
@font-face {
  font-family: "Noto Serif";
  src: url("/fonts/NotoSerif-Bold.ttf") format("truetype");
  font-weight: 700;
}
@font-face {
  font-family: "Noto Serif";
  src: url("/fonts/NotoSerif-Italic.ttf") format("truetype");
  font-style: italic;
}
@font-face {
  font-family: Inter;
  src: url("/fonts/Inter-Regular.ttf") format("truetype");
  font-weight: 400;
}
@font-face {
  font-family: Inter;
  src: url("/fonts/Inter-Medium.ttf") format("truetype");
  font-weight: 500;
}
@font-face {
  font-family: Inter;
  src: url("/fonts/Inter-SemiBold.ttf") format("truetype");
  font-weight: 600;
}

:root {
  --ink: #1a1a1a;
  --paper: #f3eee4;
  --paper-2: #e7e0d2;
  --red: #d62020;
  --line: #ddd4c4;
  --muted: #5e584e;
  --white: #fffdf8;
  --good: #145c32;
  --good-bg: #e5f2e9;
  --mid: #1a3e78;
  --mid-bg: #e7eef8;
  --warn: #6a4b00;
  --warn-bg: #f8f0d8;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.45;
}
h1, h2, h3 { font-family: "Noto Serif", Georgia, serif; font-weight: 400; letter-spacing: -0.03em; }
h1 { font-size: 2.6rem; margin: 0.1em 0; }
a { color: inherit; }
.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 28px;
  background: var(--ink);
  color: var(--paper);
}
.mark { text-decoration: none; font-weight: 600; letter-spacing: -0.04em; font-size: 1.15rem; }
.mark span { color: #e7c96a; font-weight: 500; margin-left: 8px; letter-spacing: 0.08em; font-size: 0.72rem; text-transform: uppercase; }
.top-nav { display: flex; gap: 16px; align-items: center; }
.top-nav a { color: var(--paper); text-decoration: none; font-weight: 600; }
.frame-note { display: grid; grid-template-columns: minmax(180px, 280px) 1fr; gap: 8px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.frame-note input[type="checkbox"], .choice input { width: auto; }
.runs form { display: inline; }
.log-table { width: 100%; border-collapse: collapse; }
.log-table th, .log-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
button, .button {
  background: var(--red);
  color: white;
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  font: 600 0.95rem Inter, sans-serif;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}
button.secondary, button.text { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.top button.text { color: var(--paper); border-color: #444; }
button.full { width: 100%; }
.page { width: min(1100px, calc(100% - 40px)); margin: 32px auto 64px; }
.page.narrow { width: min(640px, calc(100% - 40px)); }
.page-head, .studio-head { display: flex; justify-content: space-between; gap: 24px; align-items: end; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.14em; font-size: 0.72rem; color: var(--red); font-weight: 600; margin: 0; }
.lede, .hint, .empty { color: var(--muted); }
.cards { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.cards a {
  display: flex; flex-direction: column; gap: 6px;
  background: var(--white); border: 1px solid var(--line); border-radius: 16px;
  padding: 18px; text-decoration: none; min-height: 140px;
}
.cards strong { font-family: "Noto Serif", Georgia, serif; font-size: 1.4rem; }
.mode, .tag {
  display: inline-block; border-radius: 999px; padding: 2px 8px;
  background: var(--paper-2); font-size: 0.75rem; letter-spacing: 0.04em; text-transform: uppercase;
}
.login-body { min-height: 100vh; display: grid; place-items: center; background: radial-gradient(circle at 20% 0%, #fff, var(--paper) 55%); }
.login-card { width: min(460px, calc(100% - 32px)); }
.stack { display: grid; gap: 8px; }
label { font-size: 0.85rem; font-weight: 600; }
input, textarea {
  width: 100%; border: 1px solid var(--line); background: var(--white);
  border-radius: 12px; padding: 12px; font: inherit; color: inherit;
}
fieldset { border: 1px solid var(--line); border-radius: 12px; }
.choice { font-weight: 500; display: block; margin: 8px 0; }
.error { color: var(--red); }
.studio { width: min(1280px, calc(100% - 28px)); margin: 24px auto 48px; }
.studio-grid { display: grid; grid-template-columns: 320px 1fr; gap: 18px; margin-top: 18px; }
.panel, .empty-board, .tab { background: var(--white); border: 1px solid var(--line); border-radius: 18px; padding: 16px; }
.rail { display: grid; gap: 12px; align-content: start; }
.file-list { padding-left: 18px; margin: 8px 0; color: var(--muted); }
.stage { font-weight: 600; }
.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.tabs button { background: transparent; color: var(--ink); border: 1px solid var(--line); padding: 8px 12px; }
.tabs button.on { background: var(--ink); color: var(--paper); }
.board-img { width: 100%; height: auto; border-radius: 12px; background: #111; }
.downloads { display: flex; flex-wrap: wrap; gap: 10px; margin: 10px 0; }
.downloads a { font-size: 0.9rem; }
.frame-list { display: grid; gap: 10px; }
.frame-list article { border-top: 1px solid var(--line); padding-top: 8px; }
.tag-Observed { background: var(--good-bg); color: var(--good); }
.tag-Source-supported { background: var(--mid-bg); color: var(--mid); }
.tag-Inferred { background: var(--warn-bg); color: var(--warn); }
.fact { margin: 4px 0; }
.qc-row { display: grid; grid-template-columns: minmax(160px, 220px) 120px 1fr; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); align-items: start; }
.pass { color: var(--good); }
.fail { color: var(--red); }
.gap, .needs_human { color: var(--warn); }
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.compare img { width: 100%; border-radius: 12px; }
.log { display: grid; gap: 12px; padding-left: 18px; }
blockquote { border-left: 3px solid var(--red); margin-left: 0; padding-left: 12px; }
.feedback { margin-top: 14px; }
select { width: 100%; border: 1px solid var(--line); background: var(--white); border-radius: 12px; padding: 12px; font: inherit; }
textarea.brief { min-height: 220px; font-size: 1.05rem; line-height: 1.5; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.slots { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.drop {
  display: grid; gap: 8px; place-items: center; text-align: center;
  border: 2px dashed var(--line); border-radius: 16px; padding: 28px 16px;
  background: var(--white); font-weight: 600; cursor: pointer;
}
.drop.over { border-color: var(--red); background: #fff6f4; }
.drop input { max-width: 280px; }
.review-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.asset-card { display: grid; gap: 6px; padding: 10px; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); }
.asset-card.low { outline: 2px solid var(--red); }
.thumb { width: 100%; height: 140px; object-fit: contain; background: #161616; border-radius: 8px; }
.file-fallback { display: grid; place-items: center; color: var(--paper); text-transform: uppercase; letter-spacing: 0.08em; }
.slots label { display: grid; gap: 6px; background: var(--paper); border-radius: 12px; padding: 12px; }
.banner { background: var(--ink); color: var(--paper); border-radius: 14px; padding: 14px 16px; }
.banner a { color: #f2c200; }
.result-block { margin: 18px 0; }
.result-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.needed { list-style: none; padding: 0; display: grid; gap: 12px; }
.needed li { display: grid; gap: 4px; }
.needed span, .runs em { color: var(--muted); }
.runs { list-style: none; padding: 0; display: grid; gap: 8px; }
.runs li { display: flex; flex-wrap: wrap; gap: 10px; align-items: baseline; }
.stages { list-style: none; padding: 0; display: grid; gap: 8px; }
.stages li { padding: 8px 12px; border-radius: 10px; background: var(--white); border: 1px solid var(--line); }
.stage-done { color: var(--good); }
.stage-current { border-color: var(--ink); font-weight: 700; }
.stage-error { color: var(--red); }
.add-file { margin-top: 12px; }
h2 { font-size: 1.6rem; }
@media (max-width: 900px) {
  .studio-grid, .compare, .qc-row, .slots, .result-grid { grid-template-columns: 1fr; }
  h1 { font-size: 2rem; }
}
