:root {
  color-scheme: light;
  --ink: #2b2928;
  --muted: #756f6b;
  --line: #e6dfda;
  --surface: #ffffff;
  --soft: #fff7f1;
  --orange: #e96818;
  --orange-dark: #a83d08;
  --green: #23834e;
  --red: #b42318;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: #f8f6f4; color: var(--ink); }
button, select { font: inherit; }
.admin-shell { width: min(1180px, calc(100% - 32px)); margin: 0 auto; padding: 34px 0 64px; }
.admin-header { display: flex; justify-content: space-between; gap: 36px; align-items: flex-end; border-bottom: 1px solid var(--line); padding-bottom: 26px; }
.brand { display: inline-flex; align-items: center; gap: 9px; color: var(--ink); text-decoration: none; font-size: .86rem; }
.brand-mark { display: grid; place-items: center; width: 25px; height: 25px; border-radius: 7px; background: var(--orange); color: white; font-weight: 900; }
.eyebrow { margin: 22px 0 5px; color: var(--orange-dark); font-size: .7rem; font-weight: 850; letter-spacing: .1em; text-transform: uppercase; }
h1 { margin: 0; font-size: clamp(2rem, 5vw, 3.2rem); letter-spacing: -.055em; }
.intro { max-width: 720px; margin: 10px 0 0; color: var(--muted); line-height: 1.6; font-size: .9rem; }
.header-actions { display: flex; gap: 9px; flex-wrap: wrap; }
.header-actions button, .header-actions a { border: 1px solid var(--line); border-radius: 9px; padding: 10px 14px; background: white; color: var(--ink); text-decoration: none; font-size: .78rem; font-weight: 750; cursor: pointer; }
.header-actions button { border-color: var(--orange); background: var(--orange); color: white; }
.header-actions #browser-alerts { border-color: var(--line); background: white; color: var(--ink); }
.header-actions #browser-alerts.enabled { border-color: #b8dfca; background: #f1fbf5; color: var(--green); }
.header-actions #browser-alerts:disabled { cursor: not-allowed; opacity: .65; }
.notice { margin-top: 24px; border: 1px solid #edc7ad; border-radius: 12px; background: var(--soft); padding: 18px; display: grid; gap: 5px; }
.pulse-row { display: flex; gap: 8px; align-items: center; margin: 18px 0; color: var(--muted); font-size: .75rem; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px #dff3e8; }
.pulse-row strong { color: var(--green); }
.notification-state { margin-left: auto; }
.summary-grid { display: grid; grid-template-columns: repeat(7, minmax(105px, 1fr)); gap: 10px; }
.summary-card { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); padding: 15px; }
.summary-card span { display: block; color: var(--muted); font-size: .69rem; }
.summary-card strong { display: block; margin-top: 7px; font-size: 1.65rem; letter-spacing: -.05em; }
.summary-card.active strong { color: var(--orange-dark); }
.summary-card.problem strong { color: var(--red); }
.funnel-panel, .panel { margin-top: 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); padding: 20px; }
.section-heading { display: flex; justify-content: space-between; gap: 16px; align-items: flex-end; margin-bottom: 16px; }
.section-heading .eyebrow { margin: 0 0 4px; }
h2 { margin: 0; font-size: 1.05rem; letter-spacing: -.025em; }
.section-heading > span { color: var(--muted); font-size: .7rem; }
.funnel { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.funnel-step { position: relative; min-height: 86px; border-radius: 10px; padding: 13px; background: var(--soft); overflow: hidden; }
.funnel-step::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: var(--orange); transform-origin: left; transform: scaleX(var(--fill, 0)); }
.funnel-step span { display: block; color: var(--muted); font-size: .68rem; }
.funnel-step strong { display: block; margin-top: 8px; font-size: 1.35rem; }
.download-mix { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.download-kind { border: 1px solid var(--line); border-radius: 999px; background: #faf8f7; padding: 6px 10px; color: var(--muted); font-size: .68rem; }
.download-kind strong { color: var(--ink); }
.attribution-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 12px; color: var(--muted); font-size: .68rem; }
.attribution-row .download-mix { margin-top: 0; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(300px, .85fr); gap: 16px; }
.panel { min-width: 0; }
select { border: 1px solid var(--line); border-radius: 8px; background: white; padding: 8px 10px; color: var(--ink); font-size: .73rem; }
.activity-list, .job-list { display: grid; gap: 8px; }
.activity-row, .job-row { display: grid; grid-template-columns: 90px minmax(0, 1fr) auto; gap: 12px; align-items: center; border-top: 1px solid #eee9e5; padding: 12px 0 4px; }
.activity-row:first-child, .job-row:first-child { border-top: 0; }
.activity-time { color: var(--muted); font-size: .67rem; }
.activity-copy strong, .job-copy strong { display: block; font-size: .78rem; }
.activity-copy span, .job-copy span { display: block; margin-top: 3px; color: var(--muted); font-size: .68rem; line-height: 1.4; overflow-wrap: anywhere; }
.identity, .state { border: 1px solid var(--line); border-radius: 999px; padding: 5px 8px; background: #faf8f7; color: var(--muted); font-size: .63rem; white-space: nowrap; }
.state.completed { color: var(--green); border-color: #b8dfca; background: #f1fbf5; }
.state.failed, .state.cancelled { color: var(--red); border-color: #efc0bb; background: #fff5f4; }
.state.training, .state.queued, .state.preprocessing, .state.extracting, .state.validating { color: var(--orange-dark); border-color: #edc7ad; background: var(--soft); }
.copy-job { margin-top: 5px; border: 0; padding: 0; background: transparent; color: var(--orange-dark); font-size: .64rem; font-weight: 750; cursor: pointer; }
.empty { padding: 28px 0; color: var(--muted); font-size: .78rem; text-align: center; }
@media (max-width: 900px) {
  .summary-grid { grid-template-columns: repeat(4, 1fr); }
  .dashboard-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .admin-shell { width: min(100% - 20px, 1180px); padding-top: 20px; }
  .admin-header { align-items: flex-start; flex-direction: column; }
  .summary-grid { grid-template-columns: repeat(2, 1fr); }
  .funnel { grid-template-columns: 1fr; }
  .activity-row, .job-row { grid-template-columns: 72px minmax(0, 1fr); }
  .identity, .state { grid-column: 2; justify-self: start; }
}
