:root {
  color-scheme: light;
  --ink: #17211d;
  --muted: #68736d;
  --line: #dfe5e1;
  --surface: #ffffff;
  --wash: #f4f7f5;
  --accent: #0b7355;
  --accent-dark: #07583f;
  --warning: #9a5d13;
  --error: #a13232;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--wash); color: var(--ink); }
main { width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: 64px 0 80px; }
header { max-width: 760px; margin-bottom: 36px; }
nav { display: flex; gap: 18px; margin-bottom: 34px; }
nav a { color: var(--muted); text-decoration: none; font-size: .84rem; font-weight: 700; }
nav a.active, nav a:hover { color: var(--accent); }
h1 { margin: 8px 0 14px; font-size: clamp(2.25rem, 5vw, 4.25rem); line-height: 1; letter-spacing: -0.055em; }
h2 { margin: 0; font-size: 1.25rem; letter-spacing: -0.02em; }
.eyebrow { margin: 0; color: var(--accent); font-size: .72rem; font-weight: 750; letter-spacing: .14em; }
.lede { color: var(--muted); font-size: 1.08rem; }
.workspace { display: grid; grid-template-columns: minmax(340px, .85fr) minmax(420px, 1.15fr); gap: 20px; align-items: start; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 12px 40px rgba(30, 50, 40, .05); }
.input-panel { padding: 24px; }
.result-panel { min-height: 620px; padding: 24px; }
.field-label { display: block; margin-bottom: 9px; font-size: .82rem; font-weight: 700; }
.ontology-label { margin-top: 22px; }
.drop-zone { display: flex; min-height: 105px; border: 1.5px dashed #aebbb4; border-radius: 12px; align-items: center; justify-content: center; flex-direction: column; gap: 6px; padding: 20px; cursor: pointer; background: #fafcfb; text-align: center; }
.drop-zone:hover { border-color: var(--accent); }
.drop-zone small { color: var(--muted); }
input[type="file"] { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
textarea { width: 100%; min-height: 330px; resize: vertical; border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: #101814; color: #dce9e2; font: .77rem/1.55 "SFMono-Regular", Consolas, monospace; }
.primary { width: 100%; border: 0; border-radius: 10px; padding: 13px 18px; margin-top: 16px; background: var(--accent); color: white; font-weight: 750; cursor: pointer; }
.primary:hover { background: var(--accent-dark); }
.primary:disabled { opacity: .6; cursor: wait; }
.error { margin-top: 14px; padding: 11px 13px; border-radius: 9px; background: #fff0f0; color: var(--error); font-size: .85rem; }
.empty-state { display: flex; min-height: 570px; align-items: center; justify-content: center; flex-direction: column; text-align: center; color: var(--muted); }
.empty-state p { max-width: 340px; }
.empty-icon { color: var(--accent); font-size: 2.6rem; }
video { display: block; width: 100%; max-height: 320px; border-radius: 12px; background: #111; }
.result-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin: 24px 0 12px; }
.result-heading h2 { margin-top: 4px; text-transform: capitalize; }
.chip { padding: 5px 9px; border-radius: 999px; background: #eaf4ef; color: var(--accent); font-size: .7rem; font-weight: 700; }
.attribute { padding: 16px 0; border-top: 1px solid var(--line); }
.attribute-header { display: flex; justify-content: space-between; gap: 20px; align-items: baseline; }
.attribute-name { font-size: .74rem; font-weight: 750; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.attribute-value { margin-top: 4px; font-size: 1.05rem; font-weight: 650; }
.attribute-value.empty { color: #87918c; font-weight: 500; }
.reason { color: var(--warning); font-size: .78rem; }
.candidate { margin-top: 6px; color: var(--muted); font-size: .82rem; }
.evidence-list { display: flex; flex-direction: column; gap: 7px; margin-top: 11px; }
.evidence { display: flex; align-items: flex-start; gap: 9px; color: #4c5852; font-size: .8rem; line-height: 1.45; }
.evidence-type { flex: 0 0 auto; padding: 2px 6px; border-radius: 4px; background: #edf1ef; font-size: .64rem; font-weight: 750; text-transform: uppercase; }
.timestamp { border: 0; padding: 0; background: transparent; color: var(--accent); font: inherit; font-weight: 750; cursor: pointer; }
.run-meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 22px 0 0; padding-top: 16px; border-top: 1px solid var(--line); }
.run-meta div { min-width: 0; }
.run-meta dt { color: var(--muted); font-size: .68rem; text-transform: uppercase; letter-spacing: .07em; }
.run-meta dd { margin: 3px 0 0; font-size: .82rem; font-weight: 650; }
.history-link, .error-history-link { display: inline-block; margin-top: 14px; color: var(--accent); font-size: .82rem; font-weight: 700; }
.history-main { width: min(1480px, calc(100% - 40px)); }
.history-header { max-width: 900px; }
.history-header h1 { font-size: clamp(2.25rem, 4vw, 3.8rem); }
.history-layout { display: grid; grid-template-columns: minmax(290px, 380px) minmax(600px, 1fr); gap: 20px; align-items: start; }
.history-list-panel { padding: 18px; position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow: auto; }
.history-detail-panel { padding: 26px; min-height: 660px; }
.list-heading, .detail-heading, .history-row-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.history-list { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.history-row { width: 100%; border: 1px solid var(--line); border-radius: 11px; padding: 12px; background: #fff; color: var(--ink); text-align: left; cursor: pointer; }
.history-row:hover, .history-row.selected { border-color: #71a895; background: #f3faf7; }
.history-row strong { display: block; margin: 9px 0 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-row time, .history-row-model, .history-row-stats { display: block; color: var(--muted); font-size: .69rem; line-height: 1.45; }
.history-row-stats { margin-top: 6px; color: #3e4b45; }
.status { display: inline-block; border-radius: 999px; padding: 4px 8px; font-size: .65rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.status.succeeded { background: #e1f5ea; color: #176843; }
.status.failed { background: #ffe5e5; color: var(--error); }
.status.processing { background: #fff2d7; color: var(--warning); }
.detail-heading { align-items: flex-start; margin-bottom: 18px; }
.detail-heading h2 { margin-top: 4px; font-size: 1.5rem; }
.detail-subtitle { margin: 5px 0 0; color: var(--muted); font: .7rem/1.5 "SFMono-Regular", Consolas, monospace; overflow-wrap: anywhere; }
.history-video { max-height: 430px; }
.developer-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 18px 0 26px; }
.metric-card { margin: 0; padding: 13px; border: 1px solid var(--line); border-radius: 10px; background: #fafcfb; min-width: 0; }
.metric-card dt { color: var(--muted); font-size: .67rem; font-weight: 750; text-transform: uppercase; letter-spacing: .07em; }
.metric-card dd { margin: 4px 0; font-size: 1rem; font-weight: 700; overflow-wrap: anywhere; }
.metric-card small { display: block; color: var(--muted); font-size: .66rem; line-height: 1.45; }
.catalog-section, .developer-section { margin-top: 30px; }
.developer-section { padding-top: 24px; border-top: 1px solid var(--line); }
.raw-section { margin-top: 10px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.raw-section summary { padding: 12px 14px; background: #f8faf9; cursor: pointer; font-size: .78rem; font-weight: 750; }
.raw-section pre { max-height: 460px; margin: 0; padding: 14px; overflow: auto; border-top: 1px solid var(--line); background: #101814; color: #dce9e2; white-space: pre-wrap; word-break: break-word; font: .72rem/1.55 "SFMono-Regular", Consolas, monospace; }
.muted { color: var(--muted); font-size: .84rem; }
.empty-state.compact { min-height: 580px; }
@media (max-width: 820px) {
  main { width: min(100% - 24px, 640px); padding-top: 38px; }
  .workspace { grid-template-columns: 1fr; }
  .result-panel { min-height: 420px; }
  .empty-state { min-height: 370px; }
  .history-layout { grid-template-columns: 1fr; }
  .history-list-panel { position: static; max-height: 430px; }
  .developer-metrics { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 520px) { .developer-metrics { grid-template-columns: 1fr; } }
