/* Shared colors and surfaces for the public site and OCR workspace. */
body.ocr-theme {
  --bg: #fbfcf8;
  --surface: #fff;
  --surface-soft: #eff5ed;
  --surface-glass: #fff;
  --text: #152c25;
  --muted: #465b52;
  --brand: #245947;
  --brand-light: #e5f1e7;
  --brand-gradient: linear-gradient(135deg, #245947, #1e4e3d);
  --brand-glow: #24594726;
  --accent: #245947;
  --accent-light: #e5f1e7;
  --accent-gradient: var(--brand-gradient);
  --accent-glow: var(--brand-glow);
  --line: #dbe3da;
  --line-hover: #8ba99a;
  --shadow-sm: 0 2px 10px #203e320b;
  --shadow-md: 0 12px 30px #203e3214;
  --shadow-lg: 0 22px 55px -26px #284a3b76;
  --max: 1180px;
  --page-gutters: 56px;
  --page-heading: linear-gradient(125deg, #f8f6ec, #f3f8ef);
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  color-scheme: light;
  font-family: "Plus Jakarta Sans", system-ui, sans-serif;
  overflow-x: clip;
}

.ocr-theme h1, .ocr-theme h2, .ocr-theme h3 { color: var(--text); font-family: "Space Grotesk", system-ui, sans-serif; }
.ocr-theme .guide-lead, .ocr-theme .guide-crumb, .ocr-theme .guide-tile p { color: var(--muted); }
.ocr-theme .guide-crumb a, .ocr-theme .guide-panel a:not(.guide-btn), .ocr-theme .guide-tile span { color: var(--brand); }
.ocr-theme :is(.container, .guide-wrap) { width: min(var(--max), calc(100% - var(--page-gutters))); }
@media (max-width: 820px) { body.ocr-theme { --page-gutters: 32px; } }
.ocr-theme .guide-panel, .ocr-theme .guide-tile, .ocr-theme .card { border-color: var(--line); }
.ocr-theme .guide-panel, .ocr-theme .guide-tile { color: var(--text); background: var(--surface); }
.ocr-theme .guide-panel { min-width: 0; }
.ocr-theme .guide-tile:hover { border-color: var(--line-hover); }
.ocr-theme .guide-table, .ocr-theme .guide-table :is(th, td) { border-color: var(--line); }
.ocr-theme .guide-table th { background: var(--surface-soft); color: var(--text); }
@media (max-width: 760px) {
  .ocr-theme :is(.guide-hero, .guide-main) { grid-template-columns: minmax(0, 1fr); }
}
.ocr-theme .page-hero { background: var(--page-heading); border-bottom: 1px solid var(--line); }
.ocr-theme .feature-image::before { background: none; }

.ocr-theme .btn, .ocr-theme .guide-btn { border-radius: 9px; box-shadow: none; }
.ocr-theme :is(.btn-primary, .guide-btn) { background: var(--brand); color: #fff; }
.ocr-theme :is(.btn-primary, .guide-btn):hover { background: #174638; color: #fff; }
.ocr-theme .btn-secondary { background: #fff; border-color: var(--line); color: var(--brand); }
.ocr-theme .btn-secondary:hover { background: var(--surface-soft); border-color: var(--line-hover); }
.ocr-theme :is(a, button, input, select, summary):focus-visible { outline-color: #30684d; }

.ocr-theme :is(.footer, .guide-foot, .home-footer) {
  background: var(--bg);
  color: var(--muted);
  border-top: 1px solid var(--line);
}
.ocr-theme :is(.footer, .guide-foot, .home-footer) a { color: var(--muted); }
.ocr-theme :is(.footer, .guide-foot, .home-footer) a:hover { color: var(--brand); }

.dashboard-page .workspace-lead {
  padding-block: clamp(36px, 5vw, 64px);
  background: var(--page-heading);
  border-bottom: 1px solid var(--line);
}
.dashboard-page .workspace-lead h1 {
  margin: 0 0 8px;
  font-size: clamp(2.3rem, 5vw, 4.15rem);
  line-height: 1;
  letter-spacing: -.06em;
}
.dashboard-page .workspace-lead p { margin: 0; }
.dashboard-page .workspace-content { padding-block: clamp(20px, 5vw, 64px); }
.dashboard-page .container { max-width: var(--max); }
.dashboard-page .app-shell {
  padding: clamp(16px, 4vw, 40px);
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow-md);
}
.dashboard-page .app-shell::before { content: none; }
.dashboard-page .workspace-card, .dashboard-page .history-run-card {
  background: var(--surface-soft);
  color: var(--text);
  border-color: var(--line);
}
.dashboard-page .history-run-card:hover { background: var(--brand-light); border-color: var(--line-hover); }
.dashboard-page .history-run-card[aria-pressed="true"] {
  background: var(--brand-light);
  border-color: var(--brand);
  box-shadow: 0 0 0 1px var(--brand);
}
.dashboard-page :is(.history-run-card, #historyEmptyState) .text-white { color: var(--text); }
.dashboard-page .history-run-card .text-slate-200 { color: var(--muted); }
.dashboard-page .modal-card { background: var(--surface); border-color: var(--line); }
.dashboard-page .modal-overlay { background: #152c257a; }
.dashboard-page .usage-info-card { background: var(--surface-soft); border-color: var(--line); }
.dashboard-page .usage-bar-bg { background: #dce8dd; }
.dashboard-page .usage-bar-fill:not(.danger):not(.warning) { background: var(--brand-gradient); }
.dashboard-page .ocr-replica-stage, .dashboard-page .ocr-page-card, .dashboard-page .ocr-replica-note,
.dashboard-page .ocr-box-format-toolbar { background: var(--surface-soft); color: var(--text); border-color: var(--line); box-shadow: none; }
.dashboard-page .ocr-page-kicker { color: var(--muted); }
.dashboard-page :is(.ocr-text-container, .ocr-table-container) { background: var(--surface) !important; color: var(--text); border-color: var(--line) !important; }
.dashboard-page #ocrResultTable td { border-color: var(--line) !important; }
.dashboard-page #fileInput {
  display: block;
  width: 100%;
  min-width: 0;
  border: 1px dashed #91aa99;
  border-radius: 12px;
  padding: 12px;
  background: var(--surface-soft);
  color: var(--text);
  font: inherit;
  font-size: .88rem;
}
.dashboard-page #fileInput::file-selector-button {
  margin-inline-end: 10px;
  padding: 9px 12px;
  border: 0;
  border-radius: 7px;
  background: var(--brand);
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.dashboard-page #fileInput:disabled::file-selector-button { opacity: .65; cursor: wait; }
.dashboard-page #runOcrBtn:disabled { opacity: .55; cursor: not-allowed; }
.dashboard-page :is(#stepUpload, #uploadFormContainer, #fileInput) { scroll-margin-top: 95px; }
.dashboard-page footer { margin-top: 14px; }

.signin-page { display: flex; flex-direction: column; }
.signin-page .signin-main {
  flex: 1;
  display: grid;
  place-items: center;
  padding: clamp(32px, 9vw, 100px) 18px;
  background: var(--page-heading);
}
.signin-page .signin-panel {
  display: grid;
  justify-items: center;
  max-width: 460px;
  width: 100%;
  padding: clamp(18px, 5vw, 40px);
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow-md);
  text-align: center;
}
.signin-page .signin-icon {
  display: grid;
  width: 50px;
  height: 50px;
  place-items: center;
  margin-bottom: 15px;
  border-radius: 13px;
  background: var(--brand-light);
  color: var(--brand);
}
.signin-page h1 { margin-bottom: 10px; font-size: clamp(1.8rem, 5vw, 2.6rem); }
.signin-page p { color: var(--muted); }
.signin-page #authStatus { margin: 0 0 10px; color: var(--brand); font-size: .86rem; min-height: 1.5em; }
.signin-page .google-btn-wrap { display: flex; justify-content: center; width: 100%; min-height: 44px; }
.signin-page .signin-note { margin: 16px 0 0; font-size: .81rem; }
.signin-page footer { padding-block: 25px; }

.result-page-theme .result-page { max-width: var(--max); }
.result-page-theme .review-panel { border-color: var(--line); background: var(--surface-soft); }
.result-page-theme .review-head { background: var(--surface); border-color: var(--line); }
.result-page-theme .ocr-table-heading, .result-page-theme .box-format-toolbar { background: #193c31; }
.result-page-theme .ocr-table-heading h3 { color: #f8fbf7; }

.document-editor .workspace, .document-editor .table-result { border-color: var(--line); }
.document-editor .panel { background: var(--surface-soft); }
.document-editor .panel-head, .document-editor .table-heading { background: var(--surface); border-color: var(--line); }
.document-editor .primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.document-editor .primary:hover { background: #174638; }
.document-editor main a:not(.primary) { color: var(--brand); }
.document-editor .editor-back { display: inline-block; margin-bottom: 16px; font-size: .88rem; }
.document-editor footer { padding: 20px clamp(18px,3vw,48px); font-size: .85rem; }
.document-editor footer nav { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
