:root {
  /* Palette from the Sofigate Brand Book 2026: Petrol, Coral Red, Burgundy, Sand. */
  --petrol: #004650;
  --coral: #FA4B55;
  --burgundy: #6F0F10;
  --sand: #F0E6D2;
  --ink: #1a1a1a;
  --muted: #5c5f61;
  --faint: #8d8f90;
  --line: #e9e2d4;
  --bg: #faf6ee;
  --card: #fff;
  --petrol-soft: #e2eced;
  --burgundy-soft: #f7ecea;
  --r: 14px;
}
* { box-sizing: border-box; }

body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.55 Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  display: flex; flex-direction: column; min-height: 100vh;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

.top {
  background: var(--petrol); color: #fff; box-shadow: 0 0 0 100vmax var(--petrol); clip-path: inset(0 -100vmax);
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  max-width: 1120px; width: 100%; margin: 0 auto 20px; padding: 22px 24px 14px;
}
.brand { display: flex; gap: 12px; align-items: center; }
.mark { width: 36px; height: 36px; border-radius: 10px; background: var(--coral); flex: none; position: relative; }
.mark::before, .mark::after { content: ""; position: absolute; background: #fff; border-radius: 3px; height: 4px; }
.mark::before { left: 9px; top: 10px; width: 18px; }
.mark::after { left: 9px; top: 18px; width: 11px; opacity: .7; }
.eyebrow { margin: 0; font-size: 12px; font-weight: 600; color: var(--sand); letter-spacing: .02em; }
h1 { margin: 0; font-size: 18px; font-weight: 600; letter-spacing: -0.01em; }
.tabs { display: flex; gap: 4px; background: rgba(255,255,255,.12); padding: 4px; border-radius: 10px; }
.tabs button { border: 0; background: none; padding: 6px 14px; border-radius: 7px; font-size: 14px; color: rgba(255,255,255,.8); }
.tabs button[aria-selected="true"] { background: #fff; color: var(--ink); }
.badge { font-size: 11px; color: var(--coral); font-weight: 600; margin-left: 2px; }

.layout {
  max-width: 1120px; width: 100%; margin: 0 auto; padding: 0 24px 16px;
  display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 20px; flex: 1; align-items: start;
}
.layout[hidden], .tests[hidden] { display: none; }

/* Side column */
.side { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.side section { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; }
.side h2 { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); margin: 0 0 10px; font-weight: 600; }
.queue, .incidents { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.queue button { width: 100%; text-align: left; border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 9px 11px; display: block; }
.queue button:hover { border-color: var(--petrol); }
.queue button[aria-current="true"] { border-color: var(--petrol); box-shadow: inset 3px 0 0 var(--petrol); background: #fbfdfd; }
.queue .row { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.queue .row strong { font-weight: 600; }
.queue .row small { color: var(--faint); white-space: nowrap; }
.queue .snip { display: block; font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.queue .done { opacity: .62; }
.chip { display: inline-block; font-size: 11px; font-weight: 600; padding: 1px 8px; border-radius: 999px; margin-top: 4px; }
.chip.linked { background: var(--petrol-soft); color: var(--petrol); }
.chip.separate { background: var(--burgundy-soft); color: var(--burgundy); }
.chip.waiting { background: var(--sand); color: var(--muted); }
.incidents li { font-size: 13px; line-height: 1.35; padding: 8px 10px; border-radius: 9px; background: #fdfbf7; border: 1px solid var(--line); }
.incidents strong { display: block; }
.incidents small { color: var(--muted); }
.count { color: var(--petrol); font-weight: 600; }
.ghost { border: 1px solid var(--line); background: #fff; border-radius: 9px; padding: 7px 14px; font-size: 13px; color: var(--ink); }
.ghost:hover { border-color: var(--petrol); }
.wide { width: 100%; margin-top: 8px; color: var(--muted); }

/* Work area */
.work { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 20px; }
.ticket-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: baseline; }
.ticket-head h2 { margin: 0; font-size: 17px; font-weight: 600; }
.ticket-head span { font-size: 13px; color: var(--faint); }
.fields { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 8px 0 12px; font-size: 13px; color: var(--muted); padding: 0; list-style: none; }
.fields b { color: var(--ink); font-weight: 600; }
.fields .missing b { color: var(--coral); }
.quote { margin: 0; font-size: 16px; line-height: 1.6; }
mark { background: var(--sand); color: inherit; border-radius: 3px; padding: 0 2px; }

.verdict { border-left: 4px solid var(--petrol); }
.verdict.separate { border-left-color: var(--burgundy); }
.verdict.ask { border-left-color: var(--coral); }
.verdict.new { border-left-color: var(--faint); }
.flag { font-size: 12px; font-weight: 600; display: inline-block; padding: 2px 9px; border-radius: 999px; margin: 0 0 8px; background: var(--petrol-soft); color: var(--petrol); }
.separate .flag { background: var(--burgundy-soft); color: var(--burgundy); }
.ask .flag { background: #fff0f0; color: #b8232c; }
.new .flag { background: #f1f1f0; color: var(--muted); }
.verdict h3 { margin: 0 0 2px; font-size: 20px; font-weight: 600; letter-spacing: -0.01em; }
.verdict .inc { margin: 0 0 14px; color: var(--muted); font-size: 14px; }
.evidence { list-style: none; margin: 0 0 16px; padding: 0; display: flex; flex-direction: column; gap: 7px; font-size: 14px; }
.evidence li { display: flex; gap: 10px; align-items: flex-start; }
.tick { width: 20px; height: 20px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 12px; font-weight: 700; flex: none; margin-top: 1px; }
.tick.ok { background: var(--petrol-soft); color: var(--petrol); }
.tick.no { background: var(--burgundy); color: #fff; }
.tick.unknown { background: var(--sand); color: var(--burgundy); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.primary { border: 0; background: var(--coral); color: #fff; border-radius: 10px; padding: 10px 18px; font-weight: 600; font-size: 14px; }
.primary:hover { filter: brightness(.95); }
.secondary { border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 10px 16px; font-size: 14px; }
.secondary:hover { border-color: var(--petrol); }
textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fffaf9; resize: vertical; margin: 0 0 12px; font-size: 14px; }
.decided { font-size: 14px; color: var(--muted); margin: 0; }
.decided strong { color: var(--ink); }

.form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.form label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.form .full { grid-column: 1 / -1; }
.form select, .form input, .form textarea { padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--ink); font-size: 14px; margin: 0; }
.hint { font-size: 13px; color: var(--muted); margin: 0 0 12px; }

.status { margin: 0; font-size: 13px; color: var(--muted); }
.tally { margin: 0; font-size: 13px; color: var(--muted); }
.all-done { text-align: center; padding: 34px 20px; }
.all-done h3 { margin: 0 0 6px; font-size: 20px; }

/* Tests */
.tests { max-width: 1120px; width: 100%; margin: 0 auto; padding: 0 24px 16px; flex: 1; }
.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.metric { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; }
.metric b { display: block; font-size: 24px; font-weight: 600; color: var(--petrol); }
.metric span { font-size: 13px; color: var(--muted); }
.metric.bad b { color: var(--burgundy); }
table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; font-size: 14px; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--faint); font-weight: 600; background: #fdfbf7; }
td small { display: block; color: var(--muted); }
tr.ok td:last-child { color: var(--petrol); font-weight: 600; }
tr.fail td:last-child { color: #b42318; font-weight: 600; }
tr:last-child td { border-bottom: 0; }

footer { text-align: center; font-size: 12px; color: var(--faint); padding: 14px; }
footer a { color: inherit; }

@media (max-width: 860px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .work { order: -1; }
  .metrics { grid-template-columns: 1fr 1fr; }
  .form { grid-template-columns: 1fr; }
}
.muted { color: var(--muted); font-size: 14px; }
