/* Tokens match the gateway design system: white sheet, Inter, JetBrains Mono,
   black rules, Harper orange. No off-white page fill. */

:root {
  color-scheme: light;
  --black: #000;
  --white: #fff;
  --orange: #f97316;
  --line: #e2e8f0;
  --muted: #64748b;
  --label: #94a3b8;
  --ink: #0f172a;
  --glow: 0 0 15px 2px rgba(249, 115, 22, 0.25);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--white);
  color: var(--black);
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

[hidden] { display: none !important; }

button, input, textarea { font: inherit; color: inherit; }

.mono { font-family: "JetBrains Mono", ui-monospace, monospace; }

.muted { color: var(--muted); }

.mast {
  border-bottom: 1px solid var(--black);
  background: var(--white);
}

.mast-inner, main {
  max-width: 1040px;
  margin: 0 auto;
}

.mast-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 32px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  color: inherit;
  text-decoration: none;
  min-width: 0;
}

.brand img { height: 28px; width: auto; display: block; }

.product {
  font-size: 20px;
  font-weight: 300;
  letter-spacing: -0.03em;
  padding-left: 14px;
  border-left: 1px solid var(--line);
}

.mast-actions { display: flex; align-items: center; gap: 16px; }

.tabs, .models { display: flex; gap: 8px; }

.tab, .model, .btn {
  background: var(--white);
  color: var(--black);
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

.tab.is-on, .model.is-on {
  border-color: var(--black);
  box-shadow: var(--glow);
}

.price {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11px;
  color: var(--muted);
}

.model.is-on .price { color: var(--black); }

.link {
  font-size: 12px;
  color: var(--muted);
  text-underline-offset: 4px;
}

.link:hover { color: var(--black); }

main { padding: 22px 32px 72px; }

.banner {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  border: 1px solid var(--black);
  border-radius: 2px;
  padding: 10px 12px;
  margin: 0 0 16px;
  background: var(--white);
}

.banner p { margin: 0; font-size: 13px; line-height: 1.45; }

.kicker {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--label);
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--orange);
  flex: none;
  margin-top: 2px;
}

.banner .dot { margin-top: 6px; }

h1 {
  margin: 0;
  font-size: 32px;
  font-weight: 300;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.lede { margin: 8px 0 0; color: var(--muted); font-size: 14px; max-width: 62ch; }

.intro-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.drop {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 16px;
  padding: 18px 16px;
  border: 1px dashed #cbd5e1;
  border-radius: 2px;
  background: var(--white);
  cursor: pointer;
}

.drop-big { display: flex; flex-direction: column; gap: 2px; }
.drop-title { font-weight: 500; }
.drop-slim { display: none; font-weight: 500; }
.drop.is-slim .drop-big { display: none; }
.drop.is-slim .drop-slim { display: inline; }
.drop.is-slim { padding: 10px 14px; }

.file {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

body.is-dragging .drop {
  border-style: solid;
  border-color: var(--black);
  box-shadow: var(--glow);
}

.note { margin: 8px 0 0; font-size: 12px; color: var(--muted); }

.summary {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin: 14px 0 8px;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 12px;
  color: #334155;
}

.linkish {
  background: none;
  border: none;
  padding: 0;
  font-family: Inter, sans-serif;
  font-size: 12px;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.linkish:hover { color: var(--black); }

.strip { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }

.chip {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--white);
  padding: 4px 8px 4px 4px;
  color: inherit;
  text-decoration: none;
  font-size: 12px;
}

.chip:hover { border-color: var(--black); }

.chip img { width: 32px; height: 32px; object-fit: cover; background: var(--white); }

.chip .pct {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 13px;
  font-weight: 500;
}

.chip.band-ai .pct { color: var(--orange); }
.chip.band-unsure .pct { color: var(--muted); }

.cards { display: flex; flex-direction: column; gap: 22px; }

.card {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 14px;
  padding: 12px;
  border: none;
  border-radius: 2px;
  background: var(--white);
}

.card.band-ai { box-shadow: 0 0 0 1px rgba(249, 115, 22, 0.55), 0 0 26px 6px rgba(249, 115, 22, 0.32); }
.card.band-human { box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.5), 0 0 24px 6px rgba(0, 0, 0, 0.16); }
.card.band-unsure { box-shadow: 0 0 0 1px rgba(100, 116, 139, 0.75), 0 0 24px 6px rgba(100, 116, 139, 0.38); }
.card.band-wait { box-shadow: 0 0 0 1px var(--line); }
.card.band-error { box-shadow: 0 0 0 1px rgba(185, 28, 28, 0.4), 0 0 20px 3px rgba(185, 28, 28, 0.16); }

.thumb {
  position: relative;
  width: 120px;
  height: 120px;
  border: 1px solid var(--line);
  background: var(--white);
}

.thumb img, .thumb canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.thumb img { object-fit: contain; background: var(--white); }
.thumb canvas { pointer-events: none; mix-blend-mode: multiply; }

.head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}

.name {
  font-size: 13px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--line);
}

.status-dot.queued { background: var(--white); box-shadow: inset 0 0 0 1px var(--label); }
.status-dot.analysing {
  background: var(--orange);
  animation: pulse 1.1s ease-in-out infinite;
}
.status-dot.done, .status-dot.error { background: var(--black); }

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(249, 115, 22, 0.35); }
  50% { box-shadow: 0 0 8px 2px rgba(249, 115, 22, 0.55); }
}

.scoreline {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-top: 4px;
}

.score {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 1;
}

.band-ai .score { color: var(--orange); }
.band-unsure .score { color: var(--muted); }

.prediction { font-size: 16px; font-weight: 500; }

.facts {
  display: grid;
  grid-template-columns: 132px 1fr 132px 1fr;
  column-gap: 18px;
  margin: 10px 0 0;
}

.facts dt, .facts dd {
  margin: 0;
  padding: 4px 0;
  border-bottom: 1px solid var(--line);
}

.facts dt {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--label);
}

.facts dd {
  font-size: 13px;
  color: var(--ink);
  overflow-wrap: break-word;
}

.facts dd.mono {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: -0.03em;
}

.facts dd.muted { color: var(--label); }

.api-thumb {
  width: 64px;
  height: auto;
  margin-top: 8px;
  border: 1px solid var(--line);
  background: var(--white);
  display: block;
}

.caption {
  margin: 4px 0 0;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--label);
}

details.raw { margin-top: 8px; }

details.raw summary {
  cursor: pointer;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--label);
}

details.raw pre {
  margin: 8px 0 0;
  padding: 10px;
  border: 1px solid var(--line);
  background: var(--white);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11px;
  line-height: 1.45;
  overflow: auto;
  max-height: 280px;
  color: var(--ink);
}

.msg-error { color: #b91c1c; font-size: 13px; margin: 6px 0 0; }

.card-actions { display: flex; gap: 12px; margin-top: 8px; }

textarea {
  width: 100%;
  margin-top: 16px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--white);
  resize: vertical;
  line-height: 1.5;
}

input[type="password"] {
  width: 100%;
  margin-top: 6px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--white);
}

textarea:focus, input[type="password"]:focus {
  outline: none;
  border-color: var(--black);
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.18);
}

.text-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
}

.primary {
  background: var(--black);
  color: var(--white);
  border: 1px solid var(--black);
  border-radius: 2px;
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}

.primary:hover { background: var(--orange); border-color: var(--orange); }
.primary:disabled { opacity: 0.45; cursor: default; }
.primary:disabled:hover { background: var(--black); border-color: var(--black); }

.bar {
  display: flex;
  height: 8px;
  width: min(420px, 100%);
  margin-top: 10px;
  border: 1px solid var(--line);
  background: var(--white);
}

.seg.human { background: var(--black); }
.seg.assisted { background: var(--orange); }
.seg.ai { background: #fdba74; }

.legend {
  display: flex;
  gap: 14px;
  margin-top: 6px;
  font-size: 11px;
  color: var(--muted);
}

.swatch {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 4px;
  vertical-align: -1px;
}

.window {
  margin-top: 8px;
  padding: 6px 10px;
  border-left: 3px solid var(--line);
  background: var(--white);
}

.window.ai { border-color: #fdba74; }
.window.assisted { border-color: var(--orange); }
.window.human { border-color: var(--black); }

.window p { margin: 4px 0 0; }

.login-wrap {
  max-width: 420px;
  margin: 12vh auto;
  padding: 0 20px;
}

.sheet h1 { margin-top: 18px; }

.login-logo { height: 36px; width: auto; }

.field {
  display: block;
  margin-top: 18px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--label);
}

.sheet .primary { margin-top: 14px; }

@media (max-width: 720px) {
  .mast-inner, main { padding-left: 16px; padding-right: 16px; }
  h1 { font-size: 26px; }
  .card { grid-template-columns: 96px 1fr; }
  .thumb { width: 96px; height: 96px; }
  .facts { grid-template-columns: 110px 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .status-dot.analysing { animation: none; }
}
