:root {
  --bg: #f5f7fb;
  --card: #ffffff;
  --ink: #14213d;
  --muted: #637083;
  --blue: #1f6feb;
  --blue-dark: #0f3d83;
  --green: #138a36;
  --yellow: #9a6700;
  --red: #b42318;
  --border: #d7deea;
  --shadow: 0 8px 22px rgba(20, 33, 61, 0.06);
}
* { box-sizing: border-box; }
body { margin: 0; font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; background: var(--bg); color: var(--ink); }
.hero { background: linear-gradient(135deg, #0b1f3a, #174ea6); color: white; padding: 22px clamp(18px, 5vw, 64px); display: grid; grid-template-columns: 1.8fr minmax(240px, .8fr); gap: 18px; align-items: center; }
.simple-hero { align-items: center; }
.eyebrow { margin: 0 0 8px; text-transform: uppercase; letter-spacing: .12em; font-weight: 800; color: #b8d4ff; font-size: .78rem; }
h1 { margin: 0; font-size: clamp(2rem, 4.8vw, 3.8rem); letter-spacing: -0.04em; }
h2 { margin: 4px 0 0; font-size: clamp(1.1rem, 2.2vw, 1.8rem); font-weight: 650; }
.tagline { font-size: 1.08rem; margin: 8px 0 0; color: #eaf2ff; }
.hero-note { max-width: 860px; color: #cbdcf6; }
.hero-card { background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.2); border-radius: 14px; padding: 13px 15px; box-shadow: none; }
.hero-card p { color: #edf4ff; margin: 6px 0 0; font-size: .9rem; line-height: 1.4; }
.tabs { display: flex; gap: 6px; padding: 10px clamp(14px, 5vw, 64px); background: white; border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 5; overflow-x: auto; }
.tab, button, .file-label { border: 0; background: var(--blue); color: white; border-radius: 12px; padding: 10px 14px; font-weight: 750; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.tab { background: transparent; color: var(--blue-dark); text-decoration: none; white-space: nowrap; }
.tab.active { background: var(--blue); color: white; }
button.secondary, .file-label.secondary { background: #edf3ff; color: var(--blue-dark); border: 1px solid #c9d8f5; }
.layout { display: grid; grid-template-columns: 286px 1fr; gap: 18px; padding: 20px clamp(14px, 5vw, 64px); }
.layout.reference-mode { grid-template-columns: 1fr; }
.layout.reference-mode .sidebar { display: none; }
.layout.reference-mode .content { max-width: 1180px; width: 100%; margin: 0 auto; }
.layout.reference-mode .workflow-rail { display: none; }
.sidebar { background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 16px; box-shadow: var(--shadow); align-self: start; position: sticky; top: 72px; }
.sidebar h3 { margin-top: 0; }
.sidebar-heading h3 { margin-bottom: 4px; }
.sidebar-heading p { margin: 0 0 12px; color: var(--muted); font-size: .88rem; line-height: 1.35; }
.sidebar-help { margin: -2px 0 10px; }
.sidebar-help summary { color: var(--muted); font-size: .78rem; font-weight: 750; }
.sidebar-help p { margin: 8px 0 0; color: var(--muted); font-size: .82rem; line-height: 1.35; }
label { display: grid; gap: 6px; margin: 10px 0; font-weight: 700; color: #24324a; }
.check-label { grid-template-columns: auto 1fr; align-items: center; gap: 9px; }
.check-label input { width: auto; }
.inline-select { min-width: 260px; margin: 0; }
input, select, textarea { width: 100%; border: 1px solid var(--border); border-radius: 12px; padding: 10px 11px; font: inherit; background: white; color: var(--ink); }
.sidebar-note { color: var(--muted); font-size: .82rem; line-height: 1.35; margin: -4px 0 10px; }
.content { min-width: 0; }
.content-page { max-width: 1080px; margin: 0 auto; padding: 24px clamp(14px, 5vw, 64px); }
.panel { display: none; }
.panel.active { display: block; }
.panel-header { display: flex; justify-content: space-between; gap: 18px; align-items: center; margin-bottom: 16px; }
.panel-header p { color: var(--muted); margin-top: 4px; }
.button-row { display: flex; flex-wrap: wrap; gap: 9px; }
.stack { flex-direction: column; }
.cards { display: grid; grid-template-columns: repeat(4, minmax(160px, 1fr)); gap: 12px; margin: 14px 0; }
.metric-card { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 14px; box-shadow: var(--shadow); }
.metric-card .label { color: var(--muted); font-size: .82rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.metric-card .value { margin-top: 6px; font-size: 1.55rem; font-weight: 850; letter-spacing: -0.03em; }
.metric-card .note { margin-top: 4px; color: var(--muted); font-size: .86rem; }
.section-card { background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 16px; box-shadow: var(--shadow); margin: 14px 0; }
.subtle-card { box-shadow: none; background: #fbfcff; }
.mode-note { margin: 0 0 14px; color: var(--muted); font-weight: 650; }
details summary { cursor: pointer; color: var(--blue-dark); font-weight: 850; list-style-position: outside; }
details summary::marker { color: var(--blue); }
.advanced-panel { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.advanced-panel summary { margin-bottom: 8px; }
.section-title-row { display: flex; justify-content: space-between; align-items: center; gap: 18px; }
.table-wrap { overflow: auto; border: 1px solid var(--border); border-radius: 14px; }
.table-wrap.large { max-height: 520px; }
table { width: 100%; border-collapse: collapse; background: white; }
th, td { text-align: left; padding: 10px 11px; border-bottom: 1px solid var(--border); vertical-align: top; white-space: nowrap; }
th { background: #f1f5fb; font-size: .79rem; text-transform: uppercase; letter-spacing: .04em; color: #34445e; }
tbody tr:hover { background: #f9fbff; }
.badge { display: inline-flex; border-radius: 999px; padding: 4px 9px; font-weight: 800; font-size: .78rem; }
.badge.high { background: #fee4e2; color: var(--red); }
.badge.medium { background: #fff3cd; color: var(--yellow); }
.badge.low { background: #dcfae6; color: var(--green); }
.badge.excluded { background: #e8edf5; color: #526072; }
.notice { background: #fff8e6; border: 1px solid #ffd98a; color: #6f4a00; padding: 12px 14px; border-radius: 14px; font-weight: 700; }
.notice.warning { background: #fff1f0; border-color: #ffb4ab; color: #8a1f11; margin-top: 12px; }
.upload-status {
  display: grid;
  gap: 4px;
  margin: 12px 0 16px;
  padding: 13px 15px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: #f8fbff;
  color: #24324a;
}
.upload-status strong {
  color: var(--blue-dark);
}
.upload-status span {
  color: var(--muted);
}
.upload-status.upload-loading {
  border-color: #a9c7ff;
  background: #edf3ff;
}
.upload-status.upload-success {
  border-color: #9fd6ae;
  background: #effaf2;
}
.upload-status.upload-warning {
  border-color: #ffd98a;
  background: #fff8e6;
}
.upload-status.upload-error {
  border-color: #ffb4ab;
  background: #fff1f0;
}
.upload-status.upload-error strong,
.upload-status.upload-error span {
  color: #8a1f11;
}
.hidden { display: none !important; }
.mapping-grid { display: grid; grid-template-columns: repeat(3, minmax(180px, 1fr)); gap: 12px; }
.quality-grid { display: grid; grid-template-columns: repeat(4, minmax(140px, 1fr)); gap: 10px; }
.quality-item { background: #f7f9fc; border: 1px solid var(--border); border-radius: 14px; padding: 12px; }
.quality-item strong { display: block; font-size: 1.5rem; }
.filters { display: grid; grid-template-columns: repeat(8, minmax(120px, 1fr)); gap: 10px; align-items: end; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.rollup-row { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--border); padding: 8px 0; }
.waterfall-grid { display: grid; grid-template-columns: repeat(6, minmax(145px, 1fr)); gap: 10px; overflow-x: auto; padding: 4px 0; }
.waterfall-stage { position: relative; display: grid; gap: 5px; min-width: 145px; padding: 13px; border: 1px solid var(--border); border-top: 4px solid var(--blue); border-radius: 13px; background: #f8fbff; }
.waterfall-stage > span { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 999px; background: #dfe9fa; color: var(--blue-dark); font-weight: 850; font-size: .78rem; }
.waterfall-stage strong { min-height: 2.4em; font-size: .86rem; }
.waterfall-stage b { color: var(--blue-dark); font-size: 1.15rem; }
.waterfall-stage small { color: var(--muted); }
.waterfall-stage:not(:last-child)::after { content: "→"; position: absolute; right: -10px; top: 50%; z-index: 1; color: var(--blue); font-weight: 900; }
.pattern-grid { display: grid; grid-template-columns: repeat(4, minmax(150px, 1fr)); gap: 10px; margin: 12px 0; }
.pattern-card { background: #f7f9fc; border: 1px solid var(--border); border-radius: 14px; padding: 12px; }
.pattern-card strong { display: block; font-size: 1.4rem; }
.flag-list { display: flex; flex-wrap: wrap; gap: 6px; }
.flag-chip { display: inline-flex; align-items: center; border-radius: 999px; padding: 4px 8px; background: #fff3cd; color: var(--yellow); font-size: .76rem; font-weight: 850; }
.flag-chip.compliance { background: #fee4e2; color: var(--red); }
.flag-chip.revenue { background: #dcfae6; color: var(--green); }
.prose { line-height: 1.6; }
pre { white-space: pre-wrap; background: #0b1220; color: #dbeafe; padding: 16px; border-radius: 14px; overflow: auto; }
footer { padding: 22px clamp(14px, 5vw, 64px); color: #546176; border-top: 1px solid var(--border); }
footer p { color: #68758a; }
@media (max-width: 1100px) { .hero, .layout { grid-template-columns: 1fr; } .sidebar { position: static; } .cards { grid-template-columns: repeat(2, 1fr); } .filters, .mapping-grid { grid-template-columns: 1fr 1fr; } .waterfall-grid { grid-template-columns: repeat(6, 150px); } }
@media (max-width: 680px) { .cards, .grid-2, .filters, .mapping-grid, .quality-grid { grid-template-columns: 1fr; } .panel-header, .section-title-row { flex-direction: column; align-items: stretch; } }
@media print { .tabs, .sidebar, .button-row, .file-label, button, #mappingPanel, #filtersPanel { display: none !important; } .layout { display: block; padding: 0; } .section-card, .metric-card { box-shadow: none; break-inside: avoid; } }
.muted { color: var(--muted); margin-top: -4px; }
.field-kind { display: inline-flex; margin-left: 6px; padding: 2px 7px; border-radius: 999px; background: #edf3ff; color: var(--blue-dark); font-size: .7rem; text-transform: uppercase; letter-spacing: .04em; }
.small-btn { padding: 7px 10px; border-radius: 9px; font-size: .82rem; }
.detail-grid { display: grid; grid-template-columns: minmax(360px, 1fr) minmax(300px, .85fr); gap: 18px; align-items: start; }
.detail-grid h4 { margin: 12px 0 8px; }
.checklist, .warning-list { padding-left: 20px; }
.checklist.compact { margin-top: 8px; }
.warning-list li { color: var(--red); font-weight: 700; }
.quality-item { min-height: 82px; }
#quickTable input { min-width: 120px; }
#quickTable select { min-width: 0; width: 100%; }
#quickTable input[type="number"] { min-width: 90px; }
@media print {
  nav.tabs, .sidebar, button, .file-label { display: none !important; }
  .layout { display: block; }
  .panel { display: block !important; }
}

/* Quick Estimate layout refinements */
.quick-export-row {
  justify-content: flex-end;
}
.quick-row-actions {
  align-items: center;
}
#quickTable {
  table-layout: fixed;
  min-width: 1302px;
}
#quickTable th:nth-child(1), #quickTable td:nth-child(1) { width: 210px; }
#quickTable th:nth-child(2), #quickTable td:nth-child(2) { width: 130px; }
#quickTable th:nth-child(3), #quickTable td:nth-child(3) { width: 104px; }
#quickTable th:nth-child(4), #quickTable td:nth-child(4) { width: 120px; }
#quickTable th:nth-child(5), #quickTable td:nth-child(5) { width: 120px; }
#quickTable th:nth-child(6), #quickTable td:nth-child(6) { width: 140px; }
#quickTable th:nth-child(7), #quickTable td:nth-child(7) { width: 130px; }
#quickTable th:nth-child(8), #quickTable td:nth-child(8) { width: 130px; }
#quickTable th:nth-child(9), #quickTable td:nth-child(9) { width: 120px; }
#quickTable th:nth-child(10), #quickTable td:nth-child(10) { width: 96px; }
#quickTable input {
  min-width: 0;
  width: 100%;
}
#quickTable .quick-number-input,
#quickTable .quick-small-input {
  max-width: 82px;
  padding-left: 8px;
  padding-right: 8px;
}
#quickTable .quick-period-input {
  max-width: 112px;
}
#quickTable .quick-text-input {
  max-width: 190px;
}
#quickTable td,
#quickTable th {
  padding-left: 8px;
  padding-right: 8px;
}
#quickTable th {
  white-space: normal;
  overflow-wrap: break-word;
  vertical-align: bottom;
  line-height: 1.15;
}
@media (max-width: 680px) {
  .quick-export-row { justify-content: stretch; }
  .quick-export-row button,
  .quick-row-actions .button-row button { width: 100%; }
  .detail-grid { grid-template-columns: 1fr; }
}

/* Added workflow, profile, audit, and report refinements */
.wizard-card {
  margin-top: 0;
}
.workflow-steps {
  counter-reset: wfstep;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(285px, 1fr));
  gap: 10px;
}
.workflow-step {
  counter-increment: wfstep;
  position: relative;
  display: grid;
  grid-template-columns: minmax(96px, 0.42fr) minmax(0, 1fr);
  align-items: center;
  column-gap: 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  min-height: 68px;
  padding: 11px 12px 11px 46px;
  background: #f8fbff;
  text-align: left;
  cursor: pointer;
}
.workflow-step::before {
  content: counter(wfstep);
  position: absolute;
  left: 12px;
  top: 11px;
  width: 25px;
  height: 25px;
  border-radius: 999px;
  background: #e4ebf6;
  color: #56657d;
  font-weight: 850;
  font-size: .82rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.workflow-step strong {
  display: block;
  color: var(--ink);
  font-size: .92rem;
  line-height: 1.1;
  min-width: 0;
  overflow-wrap: anywhere;
  text-align: left;
}
.workflow-step span {
  color: var(--muted);
  font-size: .8rem;
  line-height: 1.32;
  min-width: 0;
  overflow-wrap: break-word;
  text-align: left;
}
.workflow-step.active {
  border-color: var(--blue);
  background: #edf3ff;
  box-shadow: 0 0 0 3px rgba(31,111,235,.12);
}
.workflow-step.active strong {
  color: var(--blue-dark);
}
.workflow-step.active::before {
  background: var(--blue);
  color: #fff;
}
.workflow-step.done {
  border-color: #9fd6ae;
  background: #effaf2;
}
.workflow-step.done::before {
  content: "\2713";
  background: var(--green);
  color: #fff;
}
.phi-preflight {
  border-left: 5px solid var(--blue);
}
.profile-editor-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 12px;
}
.sensitivity-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(210px, 1fr));
  gap: 12px;
}
.sensitivity-card {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px;
  background: #f8fbff;
}
.sensitivity-card h4 {
  margin: 0 0 8px;
  color: var(--blue-dark);
}
.bar-list {
  display: grid;
  gap: 8px;
}
.bar-row {
  display: grid;
  gap: 4px;
}
.bar-label {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: .86rem;
  font-weight: 750;
}
.bar-track {
  height: 10px;
  border-radius: 999px;
  background: #e4ebf6;
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--blue), var(--green));
}
#auditTrailTable {
  min-width: 960px;
}
.note-editor {
  min-height: 90px;
}
.reviewer-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 1100px) {
  .workflow-steps,
  .profile-editor-grid,
  .sensitivity-grid {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 680px) {
  .workflow-steps,
  .profile-editor-grid,
  .sensitivity-grid,
  .reviewer-row {
    grid-template-columns: 1fr;
  }
}

/* ================= Planning-clarity UI ================= */
.section-eyebrow { display:inline-flex; align-items:center; gap:6px; font-size:.72rem; font-weight:850; letter-spacing:.08em; text-transform:uppercase; color: var(--blue); margin:0 0 6px; }

/* Always-visible workflow rail */
.workflow-rail { background: var(--card); border:1px solid var(--border); border-radius:16px; padding:14px 16px; box-shadow: var(--shadow); margin-bottom:16px; }
.workflow-rail-head { display:flex; justify-content:space-between; align-items:flex-start; gap:14px; margin-bottom:12px; }
.workflow-rail-head h3 { margin:2px 0 0; font-size:1.02rem; }
.workflow-rail-head p { margin:3px 0 0; color:var(--muted); font-size:.84rem; max-width:660px; }

/* Per-mode guide: You need / It calculates / Use it to */
.mode-guide { display:grid; grid-template-columns: repeat(3, 1fr); gap:12px; margin:0 0 16px; }
.mode-guide-item { background:#f8fbff; border:1px solid var(--border); border-left:4px solid var(--blue); border-radius:12px; padding:11px 13px; }
.mode-guide-item .mg-label { font-size:.72rem; font-weight:850; letter-spacing:.05em; text-transform:uppercase; color:var(--blue-dark); }
.mode-guide-item p { margin:5px 0 0; font-size:.86rem; color:#3a4761; line-height:1.42; }
.mode-guide-item.use { border-left-color: var(--green); }
.mode-guide-item.use .mg-label { color: var(--green); }

/* Explanation callouts (how it's calculated / how to read) */
.callout { display:grid; gap:8px; background:#f8fbff; border:1px solid var(--border); border-left:4px solid var(--blue); border-radius:12px; padding:12px 14px; margin:14px 0; }
.callout .callout-title { font-weight:850; color:var(--blue-dark); font-size:.9rem; }
.callout p { margin:0; color:#3a4761; font-size:.88rem; line-height:1.45; }
.callout .formula { margin:0; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; background:#eef3fb; border:1px solid #dbe5f4; border-radius:8px; padding:8px 10px; color:#27406b; font-size:.82rem; line-height:1.55; }

/* Inline help dot — click/tap toggles the definition (hover titles are
   invisible on touch and keyboard). */
.lbl-text { display:inline-flex; align-items:center; flex-wrap:wrap; }
.help { display:inline-flex; align-items:center; justify-content:center; width:16px; height:16px; border-radius:999px; background:#dfe8f7; color:var(--blue-dark); font-size:.7rem; font-weight:850; cursor:pointer; margin-left:5px; font-style:normal; vertical-align:middle; border:0; padding:0; line-height:1; }
.help:hover, .help:focus-visible { background:#c9d9f2; outline:2px solid var(--blue-dark); outline-offset:1px; }
.help-pop { display:block; margin-top:6px; padding:8px 10px; background:#eef3fb; border:1px solid #c9d9f2; border-left:3px solid var(--blue-dark); border-radius:8px; font-size:.8rem; font-weight:400; line-height:1.45; color:#27406b; }

/* Local session autosave box (sidebar) */
.session-box { background:#f7fbf7; border:1px solid #d9ead9; border-radius:12px; padding:8px 10px; margin-bottom:12px; }
.session-box summary { color:#2c5235; font-size:.82rem; font-weight:800; }
.session-box p { margin:8px 0; font-size:.8rem; color:#2c5235; line-height:1.4; }
.session-box button { justify-self:start; }

/* Quick-estimate period selector */
.period-type-select { font-size:.85rem; }
.period-type-select select { margin-left:6px; }
.persist-rows-label { margin-top:10px; font-weight:600; }

/* Results header above metric cards */
.results-head { display:flex; align-items:baseline; justify-content:space-between; gap:14px; margin:4px 0 -2px; flex-wrap:wrap; }
.results-head .section-eyebrow { margin:0; }
.results-head .results-note { color:var(--muted); font-size:.84rem; font-weight:650; }

/* Metric card emphasis */
.metric-card { border-top:3px solid var(--blue); }
.metric-card .value { color: var(--blue-dark); }

/* Tab grouping divider (workflow vs reference) */
.tab-sep { width:1px; align-self:center; height:22px; background:var(--border); margin:0 5px; flex:0 0 auto; }

/* Step eyebrow inside panel headers */
.panel-step { display:block; color:var(--blue); font-weight:850; font-size:.72rem; letter-spacing:.08em; text-transform:uppercase; margin-bottom:3px; }

/* Medical direction 7-step review */
.medical-direction-guidance {
  margin: -4px 0 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #f8fbff;
  padding: 9px 12px;
}
.medical-direction-guidance summary {
  color: var(--blue-dark);
  font-size: .86rem;
  font-weight: 850;
}
.medical-direction-guidance p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: .86rem;
  line-height: 1.45;
}
.medical-direction-layout {
  grid-template-columns: minmax(0, 1fr) minmax(320px, .72fr);
  align-items: start;
}
.medical-direction-fast-grid {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(180px, .55fr) minmax(150px, .42fr);
  gap: 12px;
}
.medical-direction-form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(170px, 1fr));
  gap: 12px;
}
.medical-direction-optional-details {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.medical-direction-optional-details summary,
.medical-direction-item-optional summary {
  color: var(--muted);
  font-size: .84rem;
}
.medical-direction-step-tools {
  align-items: center;
  margin-bottom: 12px;
}
.medical-direction-checklist {
  display: grid;
  gap: 9px;
}
.medical-direction-item {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #f8fbff;
  padding: 11px 12px;
}
.medical-direction-item-head {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
}
.medical-direction-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: #e4ebf6;
  color: var(--blue-dark);
  font-size: .82rem;
  font-weight: 850;
}
.medical-direction-title {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  color: var(--ink);
  font-size: .96rem;
  font-weight: 850;
  line-height: 1.22;
}
.medical-direction-text {
  color: var(--muted);
  font-size: .86rem;
  line-height: 1.38;
  margin-top: 4px;
}
.medical-direction-verify {
  display: inline-flex;
  grid-template-columns: none;
  align-items: center;
  gap: 8px;
  margin: 2px 0 0;
  white-space: nowrap;
  color: var(--ink);
}
.medical-direction-verify input {
  width: 18px;
  height: 18px;
  padding: 0;
  accent-color: var(--blue);
}
.medical-direction-evidence-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  margin-top: 8px;
}
.medical-direction-item-optional {
  margin-top: 8px;
}
.medical-direction-item-optional label {
  max-width: 220px;
}
.medical-direction-report-card {
  position: sticky;
  top: 72px;
}
.medical-direction-status {
  display: grid;
  gap: 4px;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 13px 15px;
  background: #fff8e6;
  color: var(--yellow);
}
.medical-direction-status strong {
  color: inherit;
  font-size: 1.05rem;
}
.medical-direction-status span {
  color: #6f4a00;
  font-size: .88rem;
  line-height: 1.38;
}
.medical-direction-status.success {
  border-color: #9fd6ae;
  background: #effaf2;
  color: var(--green);
}
.medical-direction-status.success span {
  color: #1f5f36;
}
.medical-direction-status.error {
  border-color: #ffb4ab;
  background: #fff1f0;
  color: var(--red);
}
.medical-direction-status.error span {
  color: #8a1f11;
}
.medical-direction-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 0;
  margin: 10px 0 12px;
  list-style: none;
  color: var(--muted);
  font-size: .78rem;
}
.medical-direction-summary li {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #f8fbff;
  padding: 4px 8px;
}
.medical-direction-report {
  min-height: 420px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .78rem;
  line-height: 1.5;
  white-space: pre;
}
.medical-direction-report-details,
.medical-direction-legal-note {
  margin-top: 10px;
}
.medical-direction-report-details summary,
.medical-direction-legal-note summary {
  color: var(--blue-dark);
  font-size: .86rem;
}
.medical-direction-report-details label {
  margin-top: 8px;
}
.medical-direction-legal-note p {
  margin: 8px 0 0;
}

@media (max-width: 1100px) {
  .mode-guide { grid-template-columns: 1fr; }
  .medical-direction-layout,
  .medical-direction-fast-grid,
  .medical-direction-form-grid,
  .medical-direction-evidence-grid {
    grid-template-columns: 1fr;
  }
  .medical-direction-report-card {
    position: static;
  }
}
@media (max-width: 680px) {
  .workflow-rail-head { flex-direction:column; align-items:stretch; }
  .medical-direction-item-head {
    grid-template-columns: 32px minmax(0, 1fr);
  }
  .medical-direction-verify {
    grid-column: 2;
    justify-self: start;
  }
}
