.login-page { display: grid; justify-items: center; padding-top: 18px; }
.login-card { width: min(100%, 430px); padding: 22px; }
.login-intro { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.login-mark { display: grid; width: 40px; height: 40px; place-items: center; border: 1px solid #d8e8e6; border-radius: 10px; background: #eff8f6; color: #178b80; font-size: 12px; font-weight: 750; }
.login-intro h2 { margin: 0 0 4px; color: #294852; font-size: 13px; }
.login-intro p, .login-footnote { margin: 0; color: #819097; font-size: 8px; line-height: 1.5; }
.login-footnote { margin-top: 14px; padding-top: 12px; border-top: 1px solid #eef1f2; }
.form-stack { display: grid; gap: 12px; }
.password-field-wrap { position: relative; width: 100%; }
.field .password-field-wrap input { padding-right: 39px; }
.password-toggle { position: absolute; top: 50%; right: 5px; display: grid; width: 29px; height: 29px; place-items: center; padding: 0; transform: translateY(-50%); border: 0; border-radius: 5px; background: transparent; color: var(--muted); cursor: pointer; }
.password-toggle:hover { background: var(--teal-light); color: var(--teal-dark); }
.password-toggle svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }
.password-toggle .eye-closed, .password-toggle[aria-pressed="true"] .eye-open { display: none; }
.password-toggle[aria-pressed="true"] .eye-closed { display: block; }
.login-error { padding: 9px 10px; border: 1px solid #ecd8d4; border-radius: 6px; background: #fcf6f5; color: #9b5e53; font-size: 8px; line-height: 1.5; }
.dashboard-page > .page-heading { align-items: center; }
.history-tabs { display: flex; gap: 6px; margin: 0 0 11px; border-bottom: 1px solid #e4eaec; }
.history-tab { position: relative; padding: 9px 12px; border: 0; background: transparent; color: #829096; font-size: 8px; cursor: pointer; }
.history-tab.is-selected { color: #287f77; font-weight: 700; }
.history-tab.is-selected::after { position: absolute; right: 8px; bottom: -1px; left: 8px; height: 2px; background: #299589; content: ""; }
.history-filter { margin-bottom: 12px; }
.history-filter-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 12px; }
.history-filter-heading h2 { margin: 0 0 4px; color: #38535d; font-size: 11px; }
.history-filter-heading p { margin: 0; color: #859298; font-size: 8px; line-height: 1.5; }
.history-filter-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr 1fr; gap: 9px; }
.csv-filter-grid { grid-template-columns: 1.5fr 1fr 1fr 1fr; }
.history-load-message { margin-top: 11px; padding: 10px 11px; border: 1px dashed #d9e4e5; border-radius: 6px; background: #fafcfc; color: #74858b; font-size: 8px; }
.history-results { display: grid; gap: 10px; }
.history-results-heading { display: flex; justify-content: space-between; gap: 12px; color: #839096; font-size: 8px; }
.history-results-heading strong { color: #526a72; font-size: 9px; }
.history-card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.history-card { display: grid; min-width: 0; gap: 9px; padding: 13px; border: 1px solid #e4eaec; border-radius: 8px; background: #fff; box-shadow: 0 3px 10px rgba(31,61,71,.025); }
.analysis-history-card { align-content: start; }
.history-card-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.status-chip { display: inline-flex; width: fit-content; align-items: center; padding: 4px 7px; border-radius: 99px; background: #f1f4f5; color: #78878d; font-size: 7px; font-weight: 650; }
.status-in_progress { background: #fff6e8; color: #94723e; }
.status-completed, .status-retained { background: #edf7f1; color: #438168; }
.status-failed, .status-not-retained { background: #f4f2ef; color: #807a70; }
.history-date { color: #8a979c; font-size: 7px; text-align: right; }
.history-card h3 { overflow-wrap: anywhere; margin: 0; color: #3d5861; font-size: 10px; font-weight: 680; line-height: 1.45; }
.history-question { display: -webkit-box; overflow: hidden; margin: 0; color: #819096; font-size: 8px; line-height: 1.5; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.history-card-meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px; padding-top: 8px; border-top: 1px solid #eef1f2; color: #819096; font-size: 7px; }
.history-type { color: #337e76; font-weight: 650; }
.hash-short { color: #9aa4a8; font-family: ui-monospace, monospace; }
.history-card .button { justify-self: start; min-height: 28px; }
.history-no-results { grid-column: 1 / -1; padding: 20px; border: 1px dashed #dce5e6; border-radius: 7px; color: #7e8d93; font-size: 8px; text-align: center; }
.history-pagination { display: flex; justify-content: center; align-items: center; gap: 12px; color: #7e8d93; font-size: 8px; }
.history-pagination .button { min-height: 28px; }
.history-panel { display: none; }
.history-panel.is-visible { display: block; }
.detail-summary { display: grid; gap: 8px; margin-bottom: 12px; }
.detail-summary-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.detail-summary .eyebrow { margin: 4px 0 0; }
.detail-summary h2 { margin: 0; color: #39545e; font-size: 13px; line-height: 1.5; }
.detail-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 5px; }
.detail-fact { display: grid; gap: 4px; padding: 9px; border: 1px solid #edf0f1; border-radius: 6px; background: #fbfcfc; }
.detail-fact small { color: #89969b; font-size: 7px; }
.detail-fact strong { color: #536970; font-size: 8px; font-weight: 620; }
.process-timeline { display: grid; gap: 8px; }
.timeline-step { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 9px; padding: 10px; border: 1px solid #edf0f1; border-radius: 7px; background: #fcfdfd; }
.timeline-number { display: grid; width: 24px; height: 24px; place-items: center; border-radius: 6px; background: #eef7f5; color: #38847b; font-size: 7px; font-weight: 700; }
.timeline-content { display: grid; gap: 6px; min-width: 0; }
.timeline-step-head { color: #4c626b; font-size: 8px; font-weight: 680; }
.timeline-json { border: 1px solid #edf0f1; border-radius: 5px; background: #fff; }
.timeline-json summary { padding: 7px 8px; color: #708087; font-size: 7px; cursor: pointer; }
.timeline-json pre { overflow: auto; max-height: 250px; margin: 0; padding: 8px; border-top: 1px solid #eef1f2; color: #61747b; font: 7px/1.5 ui-monospace, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.backend-transfer { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 14px; margin-bottom: 12px; padding: 12px 14px; border: 1px solid #dce8e5; border-radius: 8px; background: #f8fbfa; }
.backend-transfer h2 { margin: 4px 0; color: #45665f; font-size: 10px; }
.backend-transfer p { max-width: 760px; margin: 0; color: #7d9089; font-size: 8px; line-height: 1.5; }
.backend-transfer-status { margin-top: 5px; color: #71857c; font-size: 7px; }
.retain-csv-option { display: flex; align-items: flex-start; gap: 7px; margin-top: 9px; color: #5f746d; cursor: pointer; }
.retain-csv-option input { margin: 2px 0 0; accent-color: var(--teal); }
.retain-csv-option span { display: grid; gap: 3px; }
.retain-csv-option strong { font-size: 8px; font-weight: 650; }
.retain-csv-option small { color: #819087; font-size: 7px; }
.backend-transfer .button { white-space: nowrap; }
.quality-controls { display: grid; grid-template-columns: minmax(220px, .8fr) minmax(0, 1.5fr); align-items: center; gap: 15px; margin-bottom: 12px; }
.quality-controls h2 { margin-bottom: 4px; }
.quality-controls p { margin: 0; color: #87949a; font-size: 8px; }
.control-row { display: flex; align-items: flex-end; gap: 10px; }
.control-row .field { flex: 1; }
.quality-output { display: grid; gap: 12px; }
.quality-output .metric-grid { margin-bottom: 0; }
.quality-detail-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 12px; }
.finding-list { display: grid; gap: 8px; margin: 0; padding: 0 0 0 16px; color: #6f8087; font-size: 8px; line-height: 1.55; }
.finding-list li::marker { color: var(--gold); }
.variant-stat { display: flex; align-items: baseline; gap: 8px; padding: 15px 10px; border: 1px solid #edf0f1; border-radius: 7px; background: #fbfcfc; }
.variant-stat strong { color: #4c6b66; font-size: 22px; font-weight: 680; letter-spacing: -.04em; }
.variant-stat span { color: #839197; font-size: 8px; }
.small-note { color: #89979d; font-size: 8px; line-height: 1.55; }
.decision-callout { padding: 10px 12px; border: 1px solid #e5ebe8; border-radius: 7px; background: #f8fbf9; color: #607a6e; font-size: 8px; line-height: 1.55; }

.standardize-controls { display: grid; grid-template-columns: minmax(0, 1fr) minmax(250px, .6fr); align-items: center; gap: 15px; margin-bottom: 12px; }
.standardize-controls h2 { margin-bottom: 4px; }
.standardize-controls p { margin: 0; color: #87949a; font-size: 8px; }
.mapping-empty { display: flex; align-items: center; gap: 12px; min-height: 120px; }
.empty-illustration { display: grid; width: 42px; height: 42px; flex: 0 0 42px; place-items: center; border-radius: 11px; background: var(--teal-light); color: var(--teal); font-size: 17px; font-weight: 720; letter-spacing: -.06em; }
.mapping-empty h2 { margin-bottom: 5px; }
.mapping-empty p { margin: 0; color: #89969b; font-size: 8px; line-height: 1.55; }
.mapping-workspace { display: grid; gap: 12px; }
.mapping-hint { margin: 0 0 10px; padding: 8px 10px; border-left: 2px solid #78b2a8; background: #f5faf8; color: #627e75; font-size: 8px; line-height: 1.5; }
.mapping-table { min-width: 820px; }
.mapping-table td { vertical-align: middle; }
.exclude-row-option { display: flex; min-width: 112px; align-items: center; gap: 5px; color: #806747; font-size: 7px; line-height: 1.35; cursor: pointer; }
.exclude-row-option input { margin: 0; accent-color: #a56d48; }
.mapping-input:disabled { background: #f3f4f4; color: #879297; cursor: not-allowed; }
.mapping-table .mapping-raw { max-width: 200px; overflow-wrap: anywhere; white-space: normal; }
.mapping-input { width: min(260px, 100%); min-height: 30px; padding: 5px 8px; border: 1px solid #dfe7e9; border-radius: 5px; background: #fff; color: #405963; font-size: 8px; }
.mapping-input:focus { border-color: #8dbdb6; outline: 2px solid rgba(19,136,126,.12); }
.pattern-pill { display: inline-flex; padding: 4px 6px; border-radius: 4px; background: #f1f3f4; color: #7d8a90; font-size: 7px; }
.pattern-found { background: var(--gold-light); color: #9a753c; }
.truncated-warning { margin-top: 10px; padding: 9px 10px; border: 1px solid #ebdfc8; border-radius: 6px; background: #fcf8ef; color: #806c49; font-size: 8px; line-height: 1.5; }
.mapping-actions { margin-top: 11px; }
.saved-rules-list { display: grid; gap: 7px; }
.saved-rule-row { display: flex; justify-content: space-between; gap: 10px; padding: 8px 9px; border: 1px solid #edf0f1; border-radius: 6px; background: #fbfcfc; }
.saved-rule-row strong { color: #4b656d; font-size: 8px; }
.saved-rule-row span { color: #89969b; font-size: 8px; text-align: right; }

.objective-guidance { margin-bottom: 11px; padding: 9px 11px; border-left: 2px solid #82b2aa; border-radius: 0 6px 6px 0; background: #f3faf8; color: #5c7c72; font-size: 8px; line-height: 1.55; }
.preparation-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.prep-section { min-width: 0; }
.prep-section .form-section-heading { margin-bottom: 12px; }
.prep-section .field-grid { gap: 9px; }
.prep-section .field { align-content: start; }
.mapping-plan-list, .row-exclusion-list { display: grid; gap: 7px; }
.mapping-plan-exclusion { background: #f8efe9; color: #9a6849; }
.mapping-plan-row { display: flex; align-items: center; gap: 8px; min-height: 33px; padding: 6px 8px; border: 1px solid #edf0f1; border-radius: 6px; background: #fbfcfc; }
.mapping-plan-check { display: grid; width: 18px; height: 18px; place-items: center; border-radius: 5px; background: var(--green-light); color: var(--green); font-size: 6px; font-weight: 800; }
.mapping-plan-row strong { color: #50666e; font-size: 8px; }
.mapping-plan-row small { margin-left: auto; color: #8a979d; font-size: 7px; }
.recipe-preview { margin-top: 12px; padding: 11px 12px; border: 1px solid #dfeae6; border-radius: 7px; background: #f6faf8; color: #637b70; }
.recipe-preview strong { color: #426d5c; font-size: 8px; }
.recipe-preview p { margin: 5px 0; font-size: 8px; line-height: 1.5; }
.recipe-preview small { color: #87968e; font-size: 7px; }

.model-picker { margin-bottom: 12px; }
.model-picker-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.model-picker-heading h2 { margin: 5px 0 4px; font-size: 15px; }
.model-picker-heading p { margin: 0; color: #859299; font-size: 8px; }
.model-picker .field-grid { grid-template-columns: 1fr 1fr; }
.parameter-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 11px; padding-top: 11px; border-top: 1px solid #edf0f1; }
.parameter-grid:empty { display: none; }
.feature-picker { margin-top: 12px; }
.feature-toolbar { display: flex; align-items: center; gap: 7px; margin-bottom: 10px; }
.search-field { display: flex; min-height: 31px; flex: 1; align-items: center; gap: 6px; padding: 0 8px; border: 1px solid #e1e8ea; border-radius: 6px; background: #fff; }
.search-field svg { width: 13px; height: 13px; flex: 0 0 13px; fill: none; stroke: #8b999f; stroke-linecap: round; stroke-width: 1.5; }
.search-field input { width: 100%; border: 0; outline: 0; color: #405963; font-size: 8px; }
.search-field input::placeholder { color: #a1adb1; }
.feature-list { display: grid; max-height: 360px; grid-template-columns: 1fr 1fr; gap: 6px; overflow: auto; padding: 1px; }
.feature-item { display: grid; min-width: 0; grid-template-columns: 14px 14px minmax(0,1fr) auto; align-items: center; gap: 7px; padding: 8px; border: 1px solid #e9edef; border-radius: 6px; background: #fff; cursor: pointer; }
.feature-item:hover { border-color: #c9d9db; background: #fbfcfc; }
.feature-item input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.feature-check { display: grid; width: 14px; height: 14px; place-items: center; border: 1px solid #c9d5d8; border-radius: 4px; background: #fff; }
.feature-item input:checked + .feature-check { border-color: var(--teal); background: var(--teal); }
.feature-item input:checked + .feature-check::after { width: 6px; height: 3px; border-bottom: 1.5px solid #fff; border-left: 1.5px solid #fff; content: ""; transform: rotate(-45deg) translateY(-1px); }
.feature-item input:disabled + .feature-check { background: #e9edef; }
.feature-copy { display: grid; min-width: 0; gap: 4px; }
.feature-copy strong { overflow: hidden; color: #48606a; font-size: 8px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.feature-copy small { overflow: hidden; color: #89979d; font-size: 7px; text-overflow: ellipsis; white-space: nowrap; }
.feature-tags { display: flex; align-items: center; gap: 3px; }
.suggestion-pill, .target-pill { padding: 3px 4px; border-radius: 4px; background: #f7f1e6; color: #967440; font-size: 6px; white-space: nowrap; }
.target-pill { background: var(--teal-light); color: #327a72; }
.analysis-note { margin-top: 10px; padding: 9px 10px; border-left: 2px solid #d1b06c; background: #fcf9f2; color: #806c48; font-size: 8px; line-height: 1.5; }

.backend-pending { display: flex; align-items: flex-start; gap: 13px; margin-bottom: 12px; padding: 15px; border: 1px solid #e9dfcb; border-radius: 9px; background: #fcf9f2; }
.backend-symbol { display: grid; width: 35px; height: 35px; flex: 0 0 35px; place-items: center; border-radius: 8px; background: #f4ead7; color: #a47a3d; }
.backend-symbol svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.5; }
.backend-pending h2 { margin: 7px 0 6px; color: #5c4c32; font-size: 12px; }
.backend-pending p { max-width: 840px; margin: 0; color: #887958; font-size: 8px; line-height: 1.6; }
.summary-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; margin-bottom: 12px; }
.summary-card { min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: 7px; background: #fff; }
.summary-card small { display: block; color: #829198; font-size: 7px; font-weight: 650; }
.summary-card strong { display: block; overflow: hidden; margin-top: 7px; color: #38515b; font-size: 10px; font-weight: 650; text-overflow: ellipsis; }
.summary-card p { display: -webkit-box; overflow: hidden; margin: 5px 0 0; color: #8a979d; font-size: 7px; line-height: 1.45; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.output-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.output-item { display: grid; grid-template-columns: 25px 1fr; align-items: center; gap: 4px 8px; padding: 9px; border: 1px solid #edf0f1; border-radius: 6px; background: #fbfcfc; }
.output-index { display: grid; width: 23px; height: 23px; grid-row: span 2; place-items: center; border-radius: 6px; background: var(--teal-light); color: var(--teal-dark); font-size: 7px; font-weight: 750; }
.output-item strong { color: #536a73; font-size: 8px; font-weight: 650; }
.output-item small { color: #909da2; font-size: 7px; }

@media (max-width: 900px) {
  .history-filter-grid, .csv-filter-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .history-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .quality-controls { grid-template-columns: 1fr; }
  .quality-detail-grid { grid-template-columns: 1fr 1fr; }
  .summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .feature-list { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .history-filter-heading { align-items: stretch; flex-direction: column; }
  .history-filter-heading .button { align-self: flex-end; }
  .history-filter-grid, .csv-filter-grid { grid-template-columns: 1fr 1fr; }
  .history-card-grid { grid-template-columns: 1fr; }
  .history-results-heading { align-items: flex-start; flex-direction: column; }
  .detail-facts { grid-template-columns: 1fr 1fr; }
  .dashboard-page > .page-heading { align-items: flex-start; flex-direction: column; }
  .quality-controls { gap: 10px; }
  .backend-transfer { grid-template-columns: 1fr; align-items: stretch; }
  .backend-transfer .button { justify-self: start; }
  .control-row { align-items: flex-start; flex-direction: column; }
  .control-row .button { align-self: flex-end; }
  .quality-detail-grid, .preparation-grid, .model-picker .field-grid { grid-template-columns: 1fr; }
  .standardize-controls { grid-template-columns: 1fr; }
  .mapping-actions { align-items: flex-start; flex-direction: column; }
  .mapping-actions .button { align-self: flex-end; }
  .parameter-grid { grid-template-columns: 1fr 1fr; }
  .feature-toolbar { flex-wrap: wrap; }
  .search-field { flex-basis: 100%; }
  .feature-toolbar .button { flex: 1; padding: 0 6px; font-size: 7px; }
  .feature-list { max-height: 400px; grid-template-columns: 1fr; }
  .feature-item { grid-template-columns: 14px 14px minmax(0,1fr) auto; }
  .summary-grid { grid-template-columns: 1fr 1fr; }
  .output-grid { grid-template-columns: 1fr; }
  .backend-pending { padding: 11px; }
  .backend-pending h2 { font-size: 10px; }
  .backend-pending p { font-size: 7px; }
}
@media (max-width: 380px) {
  .history-filter-grid, .csv-filter-grid, .detail-facts { grid-template-columns: 1fr; }
  .choice-grid { grid-template-columns: 1fr; }
  .choice-card { min-height: 74px; }
  .summary-grid { grid-template-columns: 1fr; }
  .parameter-grid { grid-template-columns: 1fr; }
  .feature-item { grid-template-columns: 14px 14px minmax(0,1fr); }
  .feature-tags { grid-column: 3; }
}
