:root {
  color-scheme: light;
  --navy: #17213a;
  --navy-2: #23304f;
  --gold: #8b651f;
  --gold-light: #d9bd7a;
  --paper: #fff;
  --bg: #eef1f5;
  --line: #d9dee7;
  --text: #182033;
  --muted: #667085;
  --danger: #b3261e;
  --danger-soft: #fff1f0;
  --ok: #067647;
  --ok-soft: #ecfdf3;
  --info: #3568b8;
  --info-soft: #eef4ff;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body { margin: 0; color: var(--text); background: var(--bg); font-size: 14px; line-height: 1.5; }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .52; }
[hidden] { display: none !important; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 68px;
  padding: 10px 22px;
  border-bottom: 1px solid rgba(255,255,255,.1);
  color: #fff;
  background: var(--navy);
  box-shadow: 0 8px 28px rgba(23,33,58,.18);
}

.brand { display: inline-flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; }
.brand img { width: 40px; height: 40px; object-fit: contain; }
.brand strong, .brand small { display: block; }
.brand strong { font-family: Georgia, serif; font-size: 18px; }
.brand small { margin-top: 2px; color: #c8cfdd; font-size: 11px; }
.top-actions { display: flex; align-items: center; gap: 8px; }

.button {
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: 7px;
  padding: 0 14px;
  font-weight: 750;
}
.button.primary { color: #fff; background: var(--gold); }
.button.secondary { border-color: rgba(255,255,255,.24); color: #fff; background: transparent; }
.button.ghost { border-color: var(--line); color: var(--navy); background: #fff; }
.button:hover { filter: brightness(1.06); }
.button:focus-visible, .drop-zone:focus-visible, input:focus-visible { outline: 3px solid rgba(179,135,49,.2); outline-offset: 2px; }

.workspace {
  display: grid;
  gap: 14px;
  width: min(1120px, calc(100% - 36px));
  min-height: calc(100vh - 68px);
  margin: 0 auto;
  padding: 22px 0 30px;
  align-content: start;
}

.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: #f8f9fb;
}
.eyebrow { color: var(--gold); font-size: 10px; font-weight: 850; letter-spacing: .1em; text-transform: uppercase; }
.page-head h1 { margin: 5px 0 4px; color: var(--navy); font-family: Georgia, serif; font-size: 28px; line-height: 1.15; }
.page-head p { margin: 0; color: var(--muted); font-size: 13px; }
.page-head p strong { color: var(--navy); }
.privacy-note { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; border-left: 1px solid var(--line); padding-left: 22px; }
.privacy-note > span { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; color: #fff; background: var(--ok); font-weight: 900; }
.privacy-note strong, .privacy-note small { display: block; }
.privacy-note strong { color: var(--navy); font-size: 12px; }
.privacy-note small { margin-top: 2px; color: var(--muted); font-size: 10px; }

.panel, .empty-state { border: 1px solid var(--line); border-radius: 8px; background: var(--paper); }
.panel { padding: 18px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 14px; }
.panel-head h2 { margin: 0; color: var(--navy); font-family: Georgia, serif; font-size: 20px; }
.panel-head p { margin: 3px 0 0; color: var(--muted); font-size: 11px; font-weight: 650; }

.limit-field { display: grid; gap: 5px; color: #344054; font-size: 11px; font-weight: 650; }
.limit-field span { display: flex; align-items: center; gap: 6px; color: var(--muted); }
.limit-field input { width: 72px; min-height: 38px; border: 1px solid #cfd5df; border-radius: 6px; padding: 0 9px; outline: none; color: var(--text); background: #fff; font-weight: 750; }
.limit-field input:focus { border-color: var(--gold); }

.drop-zone {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-height: 126px;
  border: 1px dashed #b9c2d0;
  border-radius: 8px;
  padding: 22px;
  background: #f8f9fb;
  cursor: pointer;
  transition: border-color .16s ease, background .16s ease;
}
.drop-zone:hover, .drop-zone.dragging { border-color: var(--gold); background: #fffaf0; }
.upload-mark { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 8px; color: #fff; background: var(--gold); font-size: 24px; font-weight: 850; }
.drop-copy h3 { margin: 0 0 4px; color: var(--navy); font-size: 15px; }
.drop-copy p { margin: 0; color: var(--muted); font-size: 11px; }
.drop-copy p strong { color: var(--navy); }

.criteria { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.criteria span { border: 1px solid #e4e8ef; border-radius: 6px; padding: 8px 9px; color: var(--muted); background: #fafbfc; font-size: 10px; font-weight: 700; text-align: center; }
.criteria b { color: var(--ok); }

.empty-state {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 6px;
  min-height: 190px;
  border-style: dashed;
  color: var(--muted);
  text-align: center;
}
.empty-state strong { color: var(--navy); font-family: Georgia, serif; font-size: 20px; }
.empty-state span { font-size: 11px; }

.results-toolbar { margin-bottom: 12px; }
.summary { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 12px; }
.summary-chip { display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; padding: 6px 10px; font-size: 10px; font-weight: 750; }
.summary-chip.error { color: var(--danger); background: var(--danger-soft); }
.summary-chip.ready { color: var(--ok); background: var(--ok-soft); }
.summary-chip.reference { color: #315e9f; background: var(--info-soft); }
.results { display: grid; gap: 10px; }

.result-card { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; border: 1px solid var(--line); border-left-width: 4px; border-radius: 8px; padding: 14px; background: #fff; }
.result-card.error { border-left-color: var(--danger); background: linear-gradient(90deg, var(--danger-soft), #fff 24%); }
.result-card.ready { border-left-color: var(--ok); }
.result-card.reference { border-left-color: var(--info); }
.status-icon { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; color: #fff; font-size: 13px; font-weight: 900; }
.error .status-icon { background: var(--danger); }
.ready .status-icon { background: var(--ok); }
.reference .status-icon { background: var(--info); }
.result-content { min-width: 0; }
.result-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.eyebrow { display: block; }
.result-heading h3 { max-width: 760px; margin: 3px 0 0; overflow: hidden; color: var(--navy); font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.status-pill { flex: 0 0 auto; border-radius: 999px; padding: 4px 8px; font-size: 9px; font-weight: 850; text-transform: uppercase; }
.error .status-pill { color: var(--danger); background: #ffd9d6; }
.ready .status-pill { color: var(--ok); background: #d6f5e3; }
.reference .status-pill { color: #315e9f; background: #dce9ff; }
.result-message { margin: 9px 0 12px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.result-message strong { color: var(--navy); }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 0; }
.metrics div, .signature-grid div { min-width: 0; }
dt { color: var(--muted); font-size: 8px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
dd { margin: 3px 0 0; overflow-wrap: anywhere; font-size: 11px; font-weight: 750; }
details { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 10px; }
summary { color: var(--info); font-size: 10px; font-weight: 800; cursor: pointer; }
.signature-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 11px 0 0; }
.technical-note { margin: 11px 0 0; color: var(--muted); font-size: 9px; line-height: 1.5; }
.no-errors { display: grid; justify-items: center; padding: 26px; border-radius: 8px; color: var(--ok); background: var(--ok-soft); text-align: center; }
.no-errors span { font-size: 24px; }
.no-errors strong { margin-top: 4px; }
.no-errors p { margin: 4px 0 0; color: var(--muted); font-size: 10px; }

office-site-footer { display: block; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }

@media (max-width: 760px) {
  .page-head, .panel-head { align-items: flex-start; flex-direction: column; }
  .privacy-note { width: 100%; border-top: 1px solid var(--line); border-left: 0; padding: 14px 0 0; }
  .drop-zone { grid-template-columns: auto minmax(0, 1fr); }
  .drop-zone .button { grid-column: 1 / -1; width: 100%; }
  .criteria { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 520px) {
  .topbar { align-items: flex-start; flex-direction: column; }
  .top-actions { width: 100%; justify-content: flex-end; }
  .workspace { width: min(100% - 24px, 1120px); padding-top: 14px; }
  .page-head, .panel { padding: 14px; }
  .drop-zone { grid-template-columns: 1fr; justify-items: center; text-align: center; padding: 18px; }
  .criteria, .metrics, .signature-grid { grid-template-columns: 1fr 1fr; }
  .result-card { grid-template-columns: 1fr; }
  .result-heading h3 { white-space: normal; }
}

@media (prefers-reduced-motion: reduce) {
  .drop-zone { transition: none; }
}
