/* Navigation tools share the same card and backdrop as Settings. */
.nav-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-bottom: 16px;
}
.pane--nav .navlist {
  overflow: visible;
  padding-bottom: 0;
}
@media (max-width: 1099.98px) {
  .app .pane--nav { top: var(--appbar-h); }
}
.pane--nav .navitem { flex: 0 0 auto; }
.nav-dialog .nav-dialog-body {
  min-height: 0;
  max-height: calc(86vh - 55px);
  overflow-y: auto;
  padding: 16px 20px 22px;
  border: 0;
  font-size: 12px;
  color: var(--nav-text);
}
.nav-dialog .nav-dialog-body .np-title { margin-top: 2px; }
.nav-dialog .nav-dialog-body .np-item { padding: 10px 12px; }
.nav-dialog .nav-dialog-body .np-section + .np-section { margin-top: 20px; }
.nav-dialog .nav-dialog-body .np-actions { gap: 8px; margin-top: 10px; }
.decision-create { display: grid; gap: 10px; }
.decision-create p { margin: 0; color: var(--nav-text-dim); }
.decision-create label { color: var(--nav-text); font-size: 14px; font-weight: 600; }
.decision-create textarea {
  width: 100%; min-width: 0; padding: 10px 12px; resize: vertical;
  border: 1px solid var(--nav-line); border-radius: 8px;
  background: var(--nav-hover); color: var(--nav-text); font: inherit; font-size: 14px;
}
.decision-create textarea::placeholder { color: var(--nav-text-dim); }
.decision-create .decision-create-error { color: #ffb4a9; }
.decision-create-actions { display: flex; justify-content: flex-end; gap: 8px; }

/* A continuous, quieter backdrop anchors the whole decision cockpit. */
.pane--cockpit,
.pane--cockpit .cockpit-head,
.pane--cockpit .cockpit-body {
  background: #eaf0f7;
}
.pane--cockpit { box-shadow: inset 1px 0 0 rgba(42, 66, 96, 0.1); }
.pane--cockpit .cockpit-head {
  border-bottom-color: rgba(91, 115, 147, 0.16);
  backdrop-filter: none;
}
.gw-brand .brand-image,
.report-brand .brand-image {
  display: block;
  flex: 0 0 auto;
  width: 112px;
  height: 44px;
  object-fit: contain;
  border-radius: 4px;
}
.brand-logo-window { position: relative; display: block; flex: 0 0 auto; width: 112px; height: 44px; overflow: hidden; }
.brand-logo-window img { position: absolute; display: block; width: 100%; max-width: none; height: auto; top: 50%; left: 0; transform: translateY(-50%); }
.brand-logo-window--compact { width: 72px; height: 28px; }
@media (max-width: 759.98px) { .brand-logo-window--compact { width: 56px; height: 24px; } }
@media (max-width: 420px) { .gw-brand .brand-logo-window { width: 96px; height: 38px; } }
@media (max-width: 420px) {
  .gw-brand .brand-image { width: 96px; height: 38px; }
}
.profile-avatar-details { border: 1px solid var(--line); border-radius: var(--radius); }
.profile-avatar-details summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  color: var(--text);
  cursor: pointer;
  list-style: none;
}
.profile-avatar-details summary::-webkit-details-marker { display: none; }
.profile-avatar-details summary::after { content: '更换 ›'; margin-left: auto; color: var(--text-3); font-size: 11px; }
.profile-avatar-details[open] summary::after { content: '收起'; }
.profile-avatar-details summary small { display: block; color: var(--text-3); font-size: 10px; }
.profile-avatar-preview { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 9px; background: var(--surface-3); font-size: 20px; }
.profile-avatar-details .avatar-picker { padding: 0 10px 10px; }
.profile-error { margin: 0; color: var(--danger); font-size: 12px; }
.profile-error[hidden] { display: none; }
.appbar .brand-mark.brand-image {
  display: block;
  flex: 0 0 auto;
  width: 72px;
  height: 28px;
  padding: 0;
  object-fit: contain;
  border-radius: 3px;
  background: transparent;
  box-shadow: none;
}
@media (max-width: 759.98px) {
  .appbar .brand-mark.brand-image { width: 56px; height: 24px; }
}
/* Settings are grouped by purpose, with frequently used controls first. */
#settings-dialog { width: min(780px, calc(100vw - 32px)); }
#settings-dialog .settings-head { padding: 16px 20px; font-size: 16px; }
#settings-dialog .settings-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 20px 20px;
}
.settings-tabs {
  display: flex;
  gap: 4px;
  width: 100%;
  padding: 4px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 10px;
  background: rgba(255,255,255,.035);
}
.settings-tabs button {
  flex: 1 1 0;
  padding: 8px 6px;
  border-radius: 7px;
  color: var(--nav-text-dim);
  font-size: 12px;
  white-space: nowrap;
}
.settings-tabs button:hover { color: var(--nav-text); background: var(--nav-hover); }
.settings-tabs button[aria-pressed="true"] { color: #f4e6c6; background: var(--nav-active); font-weight: 600; }
#settings-dialog .settings-body > .np-section {
  width: 100%;
  margin: 0;
  padding: 16px;
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 10px;
  background: rgba(255,255,255,.035);
}
#settings-dialog .settings-body > .np-section[hidden] { display: none; }
#settings-dialog [data-settings-order="1"] { order: 1; }
#settings-dialog [data-settings-order="2"] { order: 2; }
#settings-dialog [data-settings-order="3"] { order: 3; }
#settings-dialog .np-title { margin: 0 0 8px; font-size: 12px; letter-spacing: .04em; }
#settings-dialog .np-empty { padding: 0; line-height: 1.6; }
#settings-dialog .np-note { line-height: 1.65; }
#settings-dialog .np-actions { gap: 8px; margin-top: 12px; }
#settings-dialog .np-btn { padding: 5px 10px; }
#settings-dialog .np-source-form { max-width: 480px; gap: 8px; }
#settings-dialog .password-form label { color: #c4d0e1; font-size: 12px; margin-top: 4px; }
#settings-dialog .password-form button { justify-self: start; }
#password-status { font-size: 12px; line-height: 1.5; min-height: 1em; }
#password-status[data-state="error"] { color: #ffc2bd; }
#password-status[data-state="success"] { color: #a1dfc3; }
#password-status[data-state="pending"] { color: #c4d0e1; }
.password-input { position: relative; min-width: 0; }
.password-input input { box-sizing: border-box; padding-right: 42px; }
.password-input .password-toggle { position: absolute; right: 2px; top: 50%; transform: translateY(-50%); display: grid; place-items: center; width: 38px; height: 34px; padding: 0; border: 0; border-radius: 6px; color: #798ba5; background: transparent; cursor: pointer; }
.password-input .password-toggle:hover { color: #b58b3d; background: rgba(181, 139, 61, .09); }
.password-input .password-toggle:focus-visible { outline: 2px solid #c9a45d; outline-offset: -2px; }
.password-input .password-toggle svg { width: 18px; height: 18px; }
.password-input .password-toggle[aria-pressed="true"] .password-toggle-slash { display: none; }
.gateway .gw-forgot { display: flex; justify-content: flex-end; margin-top: -6px; }
.gateway .gw-email-note { margin-top: 18px; color: var(--text-2); font-size: 13px; line-height: 1.6; }
#settings-dialog [data-action="delete-enterprise"] { margin-left: auto; }
@media (max-width: 500px) {
  #settings-dialog .settings-body { padding: 12px; }
  .settings-tabs button { font-size: 11px; padding: 8px 2px; }
  #settings-dialog .settings-body > .np-section { padding: 12px; }
  #settings-dialog [data-action="delete-enterprise"] { margin-left: 0; }
}
#settings-dialog .settings-danger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid rgba(255,255,255,.1);
}
#settings-dialog .settings-danger strong { color: #eab5ad; font-size: 11px; }
@media (max-width: 500px) {
  #settings-dialog .settings-danger { align-items: flex-start; flex-direction: column; }
}
/* Compact avatar control: the pencil is the edit affordance. */
.profile-avatar-details { border: 0; }
.profile-avatar-details summary { display: inline-flex; position: relative; padding: 0; border-radius: 12px; }
.profile-avatar-details summary::after,
.profile-avatar-details[open] summary::after { content: none; }
.profile-avatar-preview { width: 56px; height: 56px; border: 1px solid var(--line); border-radius: 12px; font-size: 25px; background: #eaf0f7; }
.profile-avatar-edit { position: absolute; right: -4px; bottom: -4px; display: grid; place-items: center; width: 21px; height: 21px; border: 2px solid white; border-radius: 50%; background: var(--navy); color: white; font-size: 12px; line-height: 1; }
.profile-avatar-details .avatar-picker { max-width: 420px; padding: 12px 0 4px; }
.profile-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; }
@media (max-width: 420px) { .profile-form-grid { grid-template-columns: 1fr; } }
.enterprise-record { overflow: hidden; border: 1px solid rgba(213,180,116,.22); border-radius: 12px; background: linear-gradient(145deg,rgba(211,176,103,.09),rgba(255,255,255,.025) 55%); }
.enterprise-record-head { display: flex; align-items: center; gap: 14px; padding: 18px; border-bottom: 1px solid rgba(255,255,255,.08); }
.enterprise-record-avatar { display: grid; place-items: center; flex: 0 0 auto; width: 52px; height: 52px; border: 1px solid rgba(255,255,255,.18); border-radius: 12px; background: var(--record-avatar); font-size: 25px; }
.enterprise-record-identity { min-width: 0; flex: 1; }
.enterprise-record-kicker { color: var(--gold); font-size: 9px; letter-spacing: .1em; }
.enterprise-record-identity h3 { margin: 4px 0 2px; color: #f6f8fc; font-size: 17px; }
.enterprise-record-identity p { margin: 0; color: var(--nav-text-dim); font-size: 11px; }
.enterprise-record-label { padding: 16px 18px 0; color: var(--gold-soft); font-size: 11px; font-weight: 600; }
.enterprise-record-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 0 24px; margin: 0; padding: 6px 18px 16px; }
.enterprise-record-grid > div { min-width: 0; padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,.06); }
.enterprise-record-grid dt { margin-bottom: 4px; color: var(--nav-text-dim); font-size: 10px; }
.enterprise-record-grid dd { margin: 0; color: var(--nav-text); overflow-wrap: anywhere; font-size: 12px; }
.enterprise-record-grid dd.is-empty { color: #7d8ea9; }
.enterprise-record-switch { margin-top: 18px; }
@media (max-width: 480px) {
  .enterprise-record-head { flex-wrap: wrap; padding: 14px; }
  .enterprise-record-grid { gap: 0 12px; padding-inline: 14px; }
}
.nav-dialog .np-report-grid { gap: 8px; }
.nav-dialog .np-report-grid .report-choice { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; min-height: 56px; padding: 10px 12px; text-align: left; }
.report-choice strong { color: var(--nav-text); font-size: 11px; }
.report-choice small { color: var(--nav-text-dim); font-size: 10px; line-height: 1.4; }
/* Profile choices retain a free-form option for existing and unusual values. */
.profile-form-grid input[hidden] { display: none; }
.profile-region-field { grid-column: 1 / -1; }
.profile-region-selects { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 8px; }
.profile-region-selects select { min-width: 0; }

/* Keep the settings shell stable while its content scrolls. */
#settings-dialog[open] { display: flex; flex-direction: column; height: min(680px, calc(100dvh - 32px)); }
#settings-dialog .settings-head { flex: 0 0 auto; }
#settings-dialog .settings-body { flex: 1 1 auto; min-height: 0; max-height: none; }
#settings-dialog .settings-tabs { flex: 0 0 auto; position: sticky; top: -16px; z-index: 2; background: #15243a; }
.theme-options { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.theme-option { display: inline-flex; align-items: center; gap: 7px; min-height: 36px; padding: 7px 10px; border: 1px solid rgba(255,255,255,.14); border-radius: 8px; color: var(--nav-text); text-align: left; font-size: 12px; }
.theme-option[aria-pressed="true"] { border-color: var(--gold); background: var(--nav-active); font-weight: 650; }
.theme-option i { flex: 0 0 14px; height: 14px; border-radius: 50%; background: var(--theme-swatch); border: 1px solid rgba(255,255,255,.35); }
.theme-option[data-theme="navy"] { --theme-swatch: #456c99; }
@media (max-width: 560px) {
  .theme-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
#settings-dialog .settings-display-title { margin-top: 20px; }

/* Decision status groups and actions share one row per decision. */
.decision-list-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 16px; }
.decision-list-head strong { color: #fff; font-size: 13px; }
.decision-list-head span { margin-left: 8px; color: var(--nav-text-dim); font-size: 10px; }
.decision-group h3, .decision-history summary { margin: 0 0 8px; color: var(--gold-soft); font-size: 11px; font-weight: 600; }
.decision-group h3 span, .decision-history small { color: var(--nav-text-dim); font-size: 10px; font-weight: 400; }
.decision-list .np-dec { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 8px; margin: 0 0 8px; padding: 4px; border: 1px solid rgba(255,255,255,.08); border-radius: 9px; background: rgba(255,255,255,.025); }
.decision-list .np-dec.is-current { border-color: rgba(201,164,93,.45); background: var(--nav-active); }
.decision-list .np-dec.is-archived { opacity: .7; }
.decision-list .np-item[aria-current="true"] { background: transparent; border-color: transparent; }
.decision-list .np-dec .np-actions { margin: 0 8px 0 0; }
.decision-list .np-btn--danger { margin-top: 0; }
.decision-current { color: var(--gold-soft); font-size: 10px; font-weight: 400; }
.decision-history { margin-top: 16px; }
.decision-history summary { display: flex; justify-content: space-between; cursor: pointer; list-style: none; padding: 10px 0; border-top: 1px solid rgba(255,255,255,.1); }
.decision-history summary::-webkit-details-marker { display: none; }
@media (max-width: 450px) { .decision-list .np-dec { grid-template-columns: 1fr; } .decision-list .np-dec .np-actions { margin: 0 12px 8px; } }

/* Compact KPI cards: provenance remains available on expansion. */
.kpi { min-height: 98px; }
.kpi-foot { min-height: 18px; flex-wrap: nowrap; }
.kpi-label { padding-right: 14px; }

/* Theme choices tint the shell and canvas. Content and status colors keep their own roles. */
html[data-theme="forest"], .theme-option[data-theme="forest"] {
  --theme-shell: #102923; --theme-edge: #193a30; --theme-canvas: #e8f1eb;
  --theme-accent: #9ac6aa; --theme-accent-ink: #326648; --theme-accent-soft: #d4e8d7; --theme-swatch: #598575;
}
html[data-theme="warm"], .theme-option[data-theme="warm"] {
  --theme-shell: #2e211b; --theme-edge: #443024; --theme-canvas: #f3ece4;
  --theme-accent: #dbb37a; --theme-accent-ink: #89552e; --theme-accent-soft: #f0ddc3; --theme-swatch: #ba8a62;
}
html[data-theme="ice"], .theme-option[data-theme="ice"] {
  --theme-shell: #102337; --theme-edge: #19394f; --theme-canvas: #e8f4fc;
  --theme-accent: #9bcce9; --theme-accent-ink: #28618a; --theme-accent-soft: #cceafc; --theme-swatch: #9ed7f5;
}
html[data-theme="mist"], .theme-option[data-theme="mist"] {
  --theme-shell: #231c34; --theme-edge: #362b49; --theme-canvas: #f0edf8;
  --theme-accent: #c6b5e9; --theme-accent-ink: #604686; --theme-accent-soft: #e6dcf8; --theme-swatch: #b6a5d9;
}
html[data-theme="teal"], .theme-option[data-theme="teal"] {
  --theme-shell: #14292d; --theme-edge: #1b363a; --theme-canvas: #e8f3f1;
  --theme-accent: #9acfc8; --theme-accent-ink: #336a66; --theme-accent-soft: #d3edeb; --theme-swatch: #74b5ae;
}
html[data-theme="graphite"], .theme-option[data-theme="graphite"] {
  --theme-shell: #1f242c; --theme-edge: #313740; --theme-canvas: #edeff3;
  --theme-accent: #bdc5d2; --theme-accent-ink: #4c5c72; --theme-accent-soft: #e5eaf1; --theme-swatch: #939eae;
}
html[data-theme="berry"], .theme-option[data-theme="berry"] {
  --theme-shell: #2b202c; --theme-edge: #432c3d; --theme-canvas: #f8edf3;
  --theme-accent: #ddaebf; --theme-accent-ink: #873e61; --theme-accent-soft: #f3dce5; --theme-swatch: #cb94ae;
}
html[data-theme="rice"], .theme-option[data-theme="rice"] {
  --theme-shell: #29251d; --theme-edge: #393124; --theme-canvas: #f6f1e5;
  --theme-accent: #e4ba79; --theme-accent-ink: #755624; --theme-accent-soft: #f3e3c4; --theme-swatch: #e5d4a9;
}
html[data-theme]:not([data-theme="navy"]) {
  --navy: var(--theme-shell);
  --navy-700: var(--theme-edge);
  --navy-600: var(--theme-edge);
  --nav-surface: var(--theme-shell);
  --nav-surface-2: var(--theme-edge);
  --gold: var(--theme-accent);
  --gold-strong: var(--theme-accent-ink);
  --gold-soft: var(--theme-accent-soft);
  --gold-wash: color-mix(in srgb, var(--theme-accent) 12%, transparent);
  --nav-active: color-mix(in srgb, var(--theme-accent) 18%, transparent);
  --bg: var(--theme-canvas);
}
html[data-theme]:not([data-theme="navy"]) .appbar {
  background: linear-gradient(90deg, var(--theme-shell), var(--theme-edge));
}
html[data-theme]:not([data-theme="navy"]) .pane--nav {
  background: linear-gradient(180deg, var(--theme-shell), var(--theme-edge));
}
html[data-theme]:not([data-theme="navy"]) :is(.pane--cockpit, .pane--cockpit .cockpit-head, .pane--cockpit .cockpit-body) {
  background: var(--theme-canvas);
}
html[data-theme]:not([data-theme="navy"]) .settings-dialog { background: var(--theme-shell); }
html[data-theme]:not([data-theme="navy"]) #settings-dialog .settings-tabs { background: var(--theme-edge); }
.pane--chat, .pane--cockpit { --text-3: #576980; }
html[data-theme="navy"] :is(.pane--chat, .pane--cockpit) { --gold-strong: #775c2c; }
html[data-theme="rice"] :is(.pane--chat, .pane--cockpit) {
  --surface: #fffcf5;
  --surface-2: #fcf7eb;
  --surface-3: #f4ecd9;
  --line: #e2d7c0;
  --line-strong: #cdbd9e;
  --text: #2f2a22;
  --text-2: #5d5547;
  --text-3: #675d4d;
  --ink: #2f2a22;
}
html[data-theme="rice"] :is(.pane--chat, .pane--cockpit) :is(.card, .kpi, .composer, .ps-cell, .chat-head) {
  background: var(--surface);
}
html[data-theme="rice"] .pane--cockpit { box-shadow: inset 1px 0 0 var(--line); }
/* The stage card stays directly below Settings in the scrollable navigation. */
.nav-stage-card {
  --stage-row: 44px;
  --stage-gap: 11px;
  margin: 18px 10px 0;
  padding: 10px 9px;
  border: 1px solid var(--nav-line-strong);
  border-radius: 11px;
  background: var(--nav-hover);
}
.nav-stage-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px;
  border-bottom: 1px solid var(--nav-line);
  margin-bottom: 9px;
  padding-bottom: 7px;
  white-space: nowrap;
}
.nav-stage-head h2 { margin: 0; color: var(--nav-text); font-size: 13px; }
.nav-stage-head > span, .nav-stage-head .stage-progress-pct { color: var(--nav-text-dim); font-size: 10px; }
.nav-stage-list { position: relative; }
.nav-stage-track {
  position: absolute;
  inset: calc(var(--stage-row) / 2) auto calc(var(--stage-row) / 2) 8px;
  width: 2px;
  border-radius: 2px;
  background: var(--nav-line-strong);
}
.nav-stage-track i { display: block; width: 100%; height: 0; border-radius: inherit; background: #8cc5a6; }
.nav-stage-card[data-advance="true"] .nav-stage-track i { transition: height 270ms ease-out; }
.nav-stage-card .stages {
  position: relative;
  display: grid;
  gap: var(--stage-gap);
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  list-style: none;
  overflow: visible;
}
.nav-stage-card .stage {
  display: grid;
  grid-template-columns: 18px auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 5px;
  width: 100%;
  min-height: var(--stage-row);
  padding: 3px 3px 3px 0;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--nav-text);
}
.nav-stage-card .stage:hover, .nav-stage-card .stage[aria-expanded="true"] {
  color: var(--nav-text);
  background: var(--nav-active);
}
.nav-stage-card .stage[aria-current="step"] {
  border-color: var(--nav-line-strong);
  background: #433727;
}
.nav-stage-card .stage .stage-idx,
.nav-stage-card .stage .stage-name { color: inherit; }
.stage-node {
  display: grid;
  place-items: center;
  width: 17px;
  height: 17px;
  border: 1px solid currentColor;
  border-radius: 50%;
  background: var(--nav-surface);
  color: var(--stage-tone, #c9c3bc);
  z-index: 1;
}
.stage-node .icon { width: 11px; height: 11px; }
.stage-badge {
  padding: 2px 4px;
  border-radius: 4px;
  background: var(--stage-label-bg, #433e3a);
  color: var(--stage-tone, #c9c3bc);
  font-size: 9px;
  line-height: 1.4;
  white-space: nowrap;
}
.nav-stage-card .stage[data-status="completed"] { --stage-tone: #a3d8b6; --stage-label-bg: #2c4838; }
.nav-stage-card .stage:is([data-status="active"], [data-status="ready_for_review"]) { --stage-tone: #f4cf8c; --stage-label-bg: #574126; }
.nav-stage-card .stage[data-status="needs_evidence"] { --stage-tone: #ffc398; --stage-label-bg: #583929; }
.nav-stage-card .stage[data-status="review"] { --stage-tone: #debfef; --stage-label-bg: #4b3857; }
.nav-stage-card .stage[data-motion="current"] .stage-node { animation: stage-beacon 420ms ease-in-out 2; }
.nav-stage-card .stage[data-motion="confirmed"] .stage-node .icon { animation: stage-check 160ms ease-out; }
@keyframes stage-beacon {
  50% { box-shadow: 0 0 0 4px color-mix(in srgb, currentColor 23%, transparent); }
}
@keyframes stage-check { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .nav-stage-card .stage[data-motion] .stage-node,
  .nav-stage-card .stage[data-motion] .stage-node .icon,
  .nav-stage-card[data-advance] .nav-stage-track i { animation: none; transition: none; }
}
@media (max-height: 720px) {
  .nav-stage-card { --stage-gap: 7px; }
}
.nav-foot .workspace-sync { max-width: 42%; white-space: normal; }
.nav-foot .workspace-sync:empty { display: none; }
.cockpit-meta .badge--mock { color: #715526; background: #f8ecd5; }
/* Document center: current, unassigned and other decisions remain distinct. */
.upload-center-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.upload-center-head strong { display: block; color: #fff; font-size: 13px; }
.upload-center-head span { display: block; margin-top: 3px; color: var(--nav-text-dim); font-size: 10px; }
.upload-group { margin-top: 14px; }
.upload-group h3, .upload-group > summary { margin: 0 0 8px; color: var(--gold-soft); font-size: 11px; font-weight: 600; }
.upload-group > summary { cursor: pointer; padding: 10px 0; border-top: 1px solid rgba(255,255,255,.1); }
.upload-group h3 span, .upload-group > summary span { color: var(--nav-text-dim); font-size: 10px; font-weight: 400; }
.upload-card { display: flex; align-items: center; gap: 10px; padding: 10px; margin-bottom: 7px; border: 1px solid rgba(255,255,255,.08); border-radius: 9px; background: rgba(255,255,255,.025); }
.upload-icon { display: grid; place-items: center; flex: 0 0 32px; height: 32px; border-radius: 7px; color: var(--gold); background: var(--nav-active); }
.upload-icon .icon { width: 15px; height: 15px; }
.upload-info { flex: 1; min-width: 0; }
.upload-info strong { display: block; overflow-wrap: anywhere; color: var(--nav-text); font-size: 11px; font-weight: 550; }
.upload-info > span { color: var(--nav-text-dim); font-size: 10px; }
.upload-assignment { display: grid; gap: 3px; color: var(--nav-text-dim); font-size: 9px; }
.upload-assignment select { width: 165px; max-width: 28vw; padding: 5px 6px; border: 1px solid rgba(255,255,255,.17); border-radius: 6px; color: var(--nav-text); background: var(--navy-700); font-size: 10px; }
.upload-organize-status { min-height: 0; margin: 0; color: var(--gold-soft); font-size: 10px; }
.upload-add-source > summary { cursor: pointer; color: var(--gold-soft); padding: 8px 0; font-size: 11px; }
@media (max-width: 450px) { .upload-card { flex-wrap: wrap; } .upload-assignment { flex-basis: 100%; margin-left: 42px; } .upload-assignment select { width: 100%; max-width: none; } }
.report-section-head { padding-bottom: 6px; }
.report-section-head strong { display: block; color: #fff; font-size: 13px; }
.report-section-head span { display: block; margin-top: 3px; color: var(--nav-text-dim); font-size: 10px; }
.report-primary-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
.report-more-formats > summary { margin-top: 12px; padding: 8px 0; color: var(--gold-soft); cursor: pointer; font-size: 11px; }
.report-history-list { margin-top: 20px; padding-top: 16px; border-top: 1px solid rgba(255,255,255,.1); }
@media (max-width: 500px) { .report-primary-grid { grid-template-columns: 1fr; } }
/* Consistent tree rows, including leaves directly below the root. */
.issue-tree { padding-bottom: 8px; }
.issue-tree .issue-tree-children { position: relative; margin-left: 21px; padding-left: 16px; border-left: 1px solid #d5dfeb; }
.issue-tree .issue-tree-primary { margin-top: 8px; }
.issue-tree .issue-tree-branch { border: 0; }
.issue-tree .issue-tree-branch > summary, .issue-tree .issue-tree-leaf { position: relative; display: grid; grid-template-columns: 16px minmax(0,1fr) auto; align-items: start; gap: 8px; width: 100%; padding: 10px 12px 10px 0; border: 0; border-radius: 8px; }
.issue-tree .issue-tree-branch > summary::before, .issue-tree .issue-tree-leaf::before { content: ''; position: absolute; left: -16px; top: 19px; width: 16px; border-top: 1px solid #d5dfeb; }
.issue-tree .issue-tree-branch > summary { background: rgba(232,239,247,.52); }
.issue-tree .issue-tree-branch > summary:hover { background: #e8eff7; }
.issue-tree .issue-tree-branch > summary .chev { width: 14px; height: 14px; margin: 2px 0 0 2px; }
.issue-tree .issue-tree-leaf .issue-tree-dot { width: 7px; height: 7px; margin: 6px 0 0 5px; border-radius: 50%; background: #a3b3c8; }
.issue-tree .node-main { display: block; min-width: 0; }
.issue-tree .node-title { display: block; color: var(--text); font-weight: 600; line-height: 1.45; overflow-wrap: anywhere; }
.issue-tree .node-sub { display: block; margin-top: 3px; color: var(--text-3); line-height: 1.45; overflow-wrap: anywhere; }
.issue-tree .issue-tree-leaf > .chip, .issue-tree summary > .chip { justify-self: end; margin: 1px 0 0; white-space: nowrap; }
@media (max-width: 520px) {
  .issue-tree .issue-tree-children { margin-left: 10px; padding-left: 10px; }
  .issue-tree .issue-tree-branch > summary, .issue-tree .issue-tree-leaf { grid-template-columns: 14px minmax(0,1fr); }
  .issue-tree .issue-tree-branch > summary > .chip, .issue-tree .issue-tree-leaf > .chip { grid-column: 2; justify-self: start; }
  .issue-tree .issue-tree-branch > summary::before, .issue-tree .issue-tree-leaf::before { left: -10px; width: 10px; }
}

.upload-organize-status:not(:empty) {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 8px;
  border-radius: 6px;
  background: var(--navy-700);
  white-space: pre-line;
}
.upload-organize-status[data-tone="error"] { color: #ffd1c9; }
.upload-info details > summary { margin-top: 5px; cursor: pointer; color: var(--gold-soft); font-size: 11px; }
.upload-preview { margin-top: 6px; max-height: 125px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 11px; }
.upload-candidates { display: grid; gap: 5px; margin-top: 9px; }
.upload-candidates > div { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 10px; font-size: 11px; }
.composer-attachment { display: inline-flex; align-items: center; gap: 7px; max-width: 100%; padding: 2px 3px 2px 8px; margin-bottom: 6px; border: 1px solid var(--line); border-radius: 7px; font-size: 11px; }
.composer-attachment[hidden] { display: none; }
.composer-attachment span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.composer-attachment button { flex: none; }
.msg-attachment { display: block; padding-bottom: 4px; margin-bottom: 5px; border-bottom: 1px solid currentColor; font-size: 11px; overflow-wrap: anywhere; }
.form-feedback:empty { display: none; }
.form-feedback { margin: 0; font-size: 12px; color: var(--text-2); }
@media (max-width: 540px) {
  .upload-card { flex-wrap: wrap; }
  .upload-info { min-width: 65%; }
}

/* Overview follows the decision flow within the existing right pane. */
.view--overview {
  display: grid;
  align-content: start;
  gap: 12px;
  container-type: inline-size;
}
.view--overview > .sec { margin: 0; }
.view--overview .kpi-grid { grid-template-columns: repeat(auto-fit, minmax(119px, 1fr)); }
.view--overview .kpi-grid .overview-kpi-evidence { grid-column: 1 / -1; padding: 5px 8px; }
.overview-current, .overview-report {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 16px;
  padding: 12px 14px;
}
.overview-current-main { min-width: 0; flex: 1 1 250px; }
.overview-current-label { flex-wrap: wrap; gap: 7px; color: var(--text-2); font-size: 11px; }
.overview-current h2 { margin: 4px 0 2px; color: var(--text); font-size: 17px; overflow-wrap: anywhere; }
.overview-current p { margin: 3px 0; color: var(--text-2); font-size: 12px; overflow-wrap: anywhere; }
.overview-gaps { margin: 6px 0 0; padding-inline-start: 18px; color: var(--text-2); font-size: 11px; }
.overview-evidence-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 10px;
}
.overview-evidence-grid .card { min-width: 0; }
.overview-evidence-grid .mini-row { align-items: flex-start; }
.overview-evidence-grid .mini-row .chip { white-space: nowrap; }
.overview-empty-note { margin: 0; padding: 9px 12px; color: var(--text-2); font-size: 11px; }
.overview-stage-list { padding: 4px 9px; }
.overview-stage-row {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) 12px;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 37px;
  padding: 5px 3px;
  text-align: start;
}
.overview-stage-row + .overview-stage-row { border-top: 1px solid var(--line); }
.overview-stage-row:hover { background: var(--surface-2); }
.overview-stage-row > strong { font-size: 12px; white-space: nowrap; }
.overview-stage-sub { color: var(--text-2); font-size: 11px; overflow-wrap: anywhere; }
.overview-stage-row > .icon { width: 12px; transform: rotate(-90deg); }
.overview-stage-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 6px;
  border-radius: 4px;
  color: #625850;
  background: #f0ede8;
  font-size: 10px;
  white-space: nowrap;
}
.overview-stage-badge .icon { width: 12px; height: 12px; }
.overview-stage-badge[data-status="completed"] { color: #216345; background: #e7f2e9; }
.overview-stage-badge:is([data-status="active"], [data-status="ready_for_review"]) { color: #704e1e; background: #faefd8; }
.overview-stage-badge[data-status="needs_evidence"] { color: #884619; background: #fff0e3; }
.overview-stage-badge[data-status="review"] { color: #5c4772; background: #f1e9fa; }
.overview-dimensions {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(220px, 1.55fr);
  align-items: center;
  gap: 8px;
  padding: 10px;
}
.overview-dimensions #dim-radar { min-height: 168px; display: grid; place-items: center; }
.overview-dimensions .dim-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}
.overview-dimensions .dim-row {
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
  min-width: 0;
  min-height: 53px;
  gap: 3px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-2);
  text-align: start;
}
.overview-dimensions .dim-row:hover { border-color: var(--gold-strong); }
.overview-dimensions .dim-name { color: var(--text); font-weight: 600; white-space: normal; }
.overview-dimensions .dim-count { display: flex; gap: 5px 10px; flex-wrap: wrap; text-align: start; }
.overview-dimensions .dim-row .bar { height: 4px; }
.overview-operating-charts { padding: 8px 10px; }
.overview-chart-tabs { display: flex; flex-wrap: wrap; gap: 4px; }
.overview-chart-tabs [aria-pressed="true"] { color: var(--text); background: var(--gold-wash); border-color: var(--gold-strong); }
.overview-chart-data { padding: 4px 9px; color: var(--text-2); font-size: 11px; }
.overview-chart-data .kv { margin-top: 5px; }
.overview-chart-data summary { cursor: pointer; }
.overview-report-info, .overview-report .hstack { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; }
.overview-report-info > strong { display: inline-flex; align-items: center; gap: 5px; color: var(--text); font-size: 13px; }
.overview-report-info > span { font-size: 11px; color: var(--text-2); }
.overview-report .overview-empty-note { flex-basis: 100%; padding: 0; }
.overview-timeline > summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  cursor: pointer;
  list-style: none;
}
.overview-timeline > summary::-webkit-details-marker { display: none; }
.overview-timeline > summary > .icon:last-child { margin-inline-start: auto; }
.overview-timeline[open] > summary > .icon:last-child { transform: rotate(180deg); }
.evidence-target { outline: 2px solid var(--gold-strong); outline-offset: -2px; }
@container (max-width: 530px) {
  .overview-evidence-grid, .overview-dimensions { grid-template-columns: minmax(0, 1fr); }
}
@container (max-width: 350px) {
  .view--overview .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .overview-stage-row { grid-template-columns: auto auto minmax(0, 1fr); gap: 4px; }
  .overview-stage-row > .icon { display: none; }
}
.overview-profile-title { margin: 0 0 7px; color: var(--text); font-size: 13px; }
#overview-income-mix { height: 86px; }
