@charset "UTF-8";

:root {
  color-scheme: light;
  --canvas: #f4f6fa;
  --surface: #ffffff;
  --surface-soft: #f8faff;
  --ink: #17243b;
  --muted: #66758d;
  --line: #e3e8f0;
  --line-strong: #cfd8e6;
  --accent: #315fe8;
  --accent-dark: #234cc6;
  --accent-soft: #edf2ff;
  --navy: #14243e;
  --navy-deep: #102039;
  --green: #18765b;
  --amber: #9c640c;
  --red: #ba3e48;
  --purple: #7052b3;
  --radius: 16px;
  --shadow: 0 3px 14px rgb(26 43 76 / 3%);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Noto Sans CJK SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  font-size: 14px;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

*, *::before, *::after { box-sizing: border-box; }
html { min-width: 320px; background: var(--canvas); scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); font-size: 14px; line-height: 1.65; }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
button, input, select, textarea { touch-action: manipulation; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
button, a, input, select, textarea, summary { outline-offset: 3px; }
:focus-visible { outline: 3px solid #86a4ff; outline-offset: 3px; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline-offset: 1px; }
::selection { background: #dce6ff; color: #183771; }
h1, h2, h3, h4, p { margin-top: 0; }
h1, h2, h3, h4 { color: var(--ink); font-weight: 650; line-height: 1.4; }
h1 { margin-bottom: 8px; font-size: clamp(24px, 2.1vw, 30px); letter-spacing: -.04em; }
h2 { margin-bottom: 14px; font-size: 19px; letter-spacing: -.025em; }
h3 { margin-bottom: 10px; font-size: 16px; }
h4 { margin-bottom: 8px; font-size: 14px; }
p { margin-bottom: 12px; }
p:last-child { margin-bottom: 0; }
small { font-size: 13px; }
strong, b { font-weight: 650; }
svg { flex-shrink: 0; vertical-align: middle; }
[hidden] { display: none !important; }

/* Request intake: explain the selected category without expanding the whole form. */
.request-type-field select { max-width: 340px; }
.request-type-guidance { margin-top: 6px; padding: 8px 10px; border-left: 3px solid var(--line-strong); background: var(--surface-soft); font-size: 13px; }
.request-type-guidance p { margin: 0 0 3px; }
.request-type-guidance small { display: block; color: var(--muted); font-size: 12px; }
.request-type-help { font-size: 13px; }
.request-type-help summary { width: fit-content; min-height: 32px; padding: 4px 0; color: var(--accent-dark); cursor: pointer; }
.request-type-help dl { margin: 4px 0 0; }
.request-type-help dl > div { display: grid; grid-template-columns: 110px minmax(0,1fr); gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.request-type-help dt { font-weight: 600; }
.request-type-help dd { margin: 0; }
.request-type-help dd small { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; }
.request-behalf-fields { grid-column: 1 / -1; min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-soft); }
.request-behalf-fields .form-grid { gap: 12px 16px; }
.request-behalf-fields .full { grid-column: 1 / -1; }
.request-intake-summary { padding: 10px 12px; background: var(--surface-soft); border-left: 3px solid var(--line-strong); }
.request-intake-summary p, .request-recorder p { margin: 0; }
.request-intake-summary small { color: var(--muted); }
#request-manual-notice { justify-content: center; }
@media (max-width: 600px) {
  .request-type-field select { max-width: none; }
  .request-type-help summary { min-height: 44px; padding: 10px 0; }
  .request-type-help dl > div { grid-template-columns: 1fr; gap: 3px; }
}

.app-shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100dvh; }
.sidebar { position: sticky; top: 0; display: flex; flex-direction: column; height: 100dvh; padding: 30px 18px 20px; overflow-y: auto; color: #b9c6dc; background: linear-gradient(165deg, var(--navy), var(--navy-deep)); }
.brand { display: flex; align-items: center; gap: 12px; margin: 0 8px 38px; color: #fff; text-decoration: none; }
.brand > span:last-child { color: #fff; font-size: 16px; font-weight: 600; line-height: 1.5; }
.brand-mark { display: inline-flex; flex-shrink: 0; align-items: center; justify-content: center; width: 40px; height: 40px; border: 1px solid rgb(255 255 255 / 20%); border-radius: 12px; background: linear-gradient(135deg, #5f82f5, #355bd3); box-shadow: 0 5px 14px rgb(0 0 0 / 12%); color: #fff; font-size: 21px; font-weight: 750; letter-spacing: -.08em; }
.brand strong, .brand b { display: block; color: #fff; font-size: 17px; letter-spacing: .02em; line-height: 1.45; }
.brand small, .brand .muted { display: block; margin-top: 2px; color: #9eafca; font-size: 13px; font-weight: 400; }
.nav-list { display: flex; flex-direction: column; gap: 7px; padding: 0; margin: 0; list-style: none; }
.nav-caption { padding: 0 15px; margin-bottom: 12px; color: #8095b5; font-size: 13px; font-weight: 500; letter-spacing: .08em; }
.nav-count { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; min-height: 22px; padding: 1px 6px; margin-left: auto; border-radius: 5px; background: rgb(255 255 255 / 11%); color: #dbe6fa; font-size: 13px; font-variant-numeric: tabular-nums; }
.nav-count:empty { display: none; }
.nav-item { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 46px; padding: 11px 15px; border: 1px solid transparent; border-radius: 10px; background: transparent; color: #bfcbe0; font-size: 14px; font-weight: 500; line-height: 1.5; text-align: left; text-decoration: none; white-space: nowrap; transition: background .16s, color .16s, border-color .16s; }
.nav-item:hover { background: rgb(255 255 255 / 7%); color: #fff; }
.nav-item.active, .nav-item[aria-current="page"] { border-color: rgb(132 160 255 / 26%); background: #294874; color: #fff; box-shadow: inset 3px 0 #7d9aff; }
.nav-item svg { width: 19px; height: 19px; opacity: .88; }
.nav-item .nav-icon { width: 20px; font-size: 18px; text-align: center; }
.nav-item .badge { margin-left: auto; padding: 0 7px; background: rgb(255 255 255 / 13%); color: #e5edff; font-size: 13px; }
.sidebar-bottom { display: flex; flex-direction: column; gap: 8px; padding: 22px 8px 0; margin-top: auto; color: #aabbd6; font-size: 13px; }
.sidebar-bottom::before { display: block; height: 1px; margin-bottom: 12px; background: rgb(255 255 255 / 12%); content: ""; }
.sidebar-bottom .button, .sidebar-bottom .link-button { justify-content: flex-start; padding-left: 0; border-color: transparent; background: transparent; color: #c5d1e7; text-align: left; }
.sidebar-bottom .button:hover, .sidebar-bottom .link-button:hover { color: #fff; }
.sidebar-bottom .muted { color: #9bacc7; }
.sidebar-bottom p { margin: 2px 0 5px; color: #91a5c4; font-size: 13px; line-height: 1.8; }
.pilot-label { display: flex; align-items: center; gap: 8px; color: #cad6e9; font-size: 13px; font-weight: 500; }
.live-dot { display: inline-block; flex-shrink: 0; width: 6px; height: 6px; border-radius: 50%; background: #74baa5; box-shadow: 0 0 0 3px rgb(116 186 165 / 10%); }
.main-shell { display: flex; flex-direction: column; min-width: 0; min-height: 100dvh; }
.avatar { display: inline-flex; flex-shrink: 0; align-items: center; justify-content: center; width: 34px; height: 34px; margin-left: 6px; border: 1px solid #dbe3f0; border-radius: 50%; background: #edf1fa; color: #5a7297; font-size: 13px; font-weight: 600; }
.topbar { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 78px; padding: 18px clamp(22px, 3vw, 44px); border-bottom: 1px solid var(--line); background: rgb(255 255 255 / 93%); }
.breadcrumbs { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; color: var(--muted); font-size: 13px; }
.breadcrumbs strong { color: #34455f; font-weight: 500; }
.top-actions, .page-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; }
.top-actions { justify-content: flex-end; }
.prototype-badge { display: inline-flex; align-items: center; gap: 6px; width: fit-content; padding: 4px 9px; border: 1px solid #d7e1fa; border-radius: 6px; background: #f4f7ff; color: #486394; font-size: 13px; font-weight: 500; white-space: nowrap; }
.prototype-badge::before { width: 5px; height: 5px; border-radius: 50%; background: #6d8cc9; content: ""; }
.page-main { flex: 1; width: 100%; max-width: 1580px; padding: 30px clamp(22px, 3vw, 44px) 36px; margin: 0 auto; }
#content { min-width: 0; }
#content > :is(.grid, .card, .stack, .notice, .toolbar, .page-actions) + :is(.grid, .card, .stack, .notice, .toolbar, .page-actions) { margin-top: 20px; }
.page-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 22px; margin-bottom: 24px; }
.page-heading > div:first-child { min-width: 0; }
.page-heading p { max-width: 780px; margin-bottom: 0; color: var(--muted); font-size: 14px; }
.page-heading .page-actions { flex-shrink: 0; padding-top: 5px; }
.eyebrow { margin-bottom: 7px; color: #697e9e; font-size: 13px; font-weight: 600; line-height: 1.5; letter-spacing: .08em; }
.muted { color: var(--muted); }
.footer-note { margin-top: 24px; color: #718098; font-size: 13px; line-height: 1.75; }
.main-shell > .footer-note { align-self: center; width: 100%; max-width: 1580px; padding: 0 clamp(22px, 3vw, 44px) 23px; margin: 0; color: #8a97aa; }

.button, .icon-button, .dialog-close, .link-button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 38px; padding: 8px 14px; border: 1px solid var(--line-strong); border-radius: 8px; background: #fff; color: #34445e; font-size: 14px; font-weight: 500; line-height: 1.4; text-align: center; text-decoration: none; vertical-align: middle; transition: background .14s, border-color .14s, box-shadow .14s, color .14s; }
.button:hover, .icon-button:hover, .dialog-close:hover { border-color: #aebed6; background: #f8faff; box-shadow: 0 2px 5px rgb(21 42 80 / 3%); }
.button.primary { border-color: var(--accent); background: var(--accent); color: #fff; box-shadow: 0 3px 7px rgb(49 95 232 / 12%); }
.button.primary:hover { border-color: var(--accent-dark); background: var(--accent-dark); box-shadow: 0 4px 10px rgb(49 95 232 / 19%); }
.button.danger { border-color: #edc6cb; background: #fff7f8; color: var(--red); }
.button.danger:hover { border-color: #dca2aa; background: #ffeff1; }
.button.ghost { border-color: transparent; background: transparent; color: #5f6e85; box-shadow: none; }
.button.ghost:hover { background: #eaf0fa; color: #284fba; }
.button.small { min-height: 31px; padding: 5px 10px; border-radius: 7px; font-size: 13px; }
.button svg, .icon-button svg, .dialog-close svg { width: 17px; height: 17px; }
.button:disabled, .icon-button:disabled, .link-button:disabled { border-color: #e2e7ef; background: #f3f5f8; color: #94a0b2; box-shadow: none; }
.icon-button, .dialog-close { flex-shrink: 0; width: 34px; min-height: 34px; padding: 4px; font-size: 19px; }
.dialog-close { border-color: transparent; background: #f0f3f8; color: #6d7c94; }
.link-button { min-height: 28px; padding: 3px 0; border: 0; border-radius: 3px; background: transparent; color: var(--accent); font-size: inherit; text-align: left; }
.link-button:hover { color: var(--accent-dark); text-decoration: underline; text-underline-offset: 3px; }

.card { min-width: 0; padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.card + .card { margin-top: 18px; }
.grid > .card + .card { margin-top: 0; }
.card-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 18px; }
.card-header h2, .card-header h3, .card-header .section-title { margin-bottom: 0; }
.card-header > div { min-width: 0; }
.card-header p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.card-body { min-width: 0; }
.section-title { display: flex; align-items: center; gap: 9px; margin: 0 0 16px; font-size: 16px; font-weight: 650; }
.grid { display: grid; gap: 18px; min-width: 0; }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid > * { min-width: 0; }
.stack { display: flex; flex-direction: column; gap: 18px; }
.stack > .card + .card { margin-top: 0; }
.stack.small { gap: 9px; }
.stat { min-width: 0; padding: 21px 22px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); }
.stat-label { display: block; color: #63738b; font-size: 13px; font-weight: 500; }
.stat-value { display: block; margin: 10px 0 7px; color: #213552; font-size: 32px; font-weight: 650; font-variant-numeric: tabular-nums; letter-spacing: -.04em; line-height: 1.25; }
.stat-value small, .stat-value span.unit, .stat-value > .muted { margin-left: 4px; color: #77869c; font-size: 13px; font-weight: 400; letter-spacing: 0; }
.stat-foot { color: #7b879a; font-size: 13px; line-height: 1.6; }
.stat .badge { vertical-align: middle; }
.metric-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.metric { min-width: 0; padding: 14px 16px; border: 1px solid #e5ebf5; border-radius: 10px; background: #f7f9fd; }
.metric > small, .metric > span:first-child, .metric > label { display: block; margin-bottom: 5px; color: var(--muted); font-size: 13px; }
.metric > strong, .metric > b { display: block; color: #263b5e; font-size: 23px; font-variant-numeric: tabular-nums; line-height: 1.4; }
.metric > p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 28px; }
.key-value { min-width: 0; margin: 0; }
.key-value > small, .key-value > label, .key-value > dt, .key-value > .muted:first-child { display: block; margin: 0 0 5px; color: var(--muted); font-size: 13px; }
.key-value > dd { margin: 0 0 14px; overflow-wrap: anywhere; }
.key-value > dd:last-child { margin-bottom: 0; }
.metric-grid + .key-value { margin-top: 20px; }
.key-value > strong, .key-value > p, .key-value > div:last-child { overflow-wrap: anywhere; }
.key-value > p { margin: 0; }
.detail-grid .full, .grid .full { grid-column: 1 / -1; }
.divider { height: 1px; margin: 21px 0; border: 0; background: var(--line); }

.toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }
.toolbar > .field { display: flex; flex-direction: column; gap: 6px; }
.toolbar > .field:first-child { flex: 1 1 280px; max-width: 420px; }
.toolbar > .field > span { color: #6a7b94; font-size: 13px; }
.toolbar > .field input, .toolbar > .field select { flex: initial; width: 100%; }
.toolbar > .muted { align-self: flex-end; padding-bottom: 10px; }
.toolbar input { flex: 1 1 220px; width: auto; max-width: 420px; }
.toolbar select { flex: 0 1 170px; width: auto; min-width: 140px; }
.toolbar .muted { margin-left: auto; font-size: 13px; }
.table-wrap { min-width: 0; width: 100%; overflow: auto; border: 1px solid var(--line); border-radius: 11px; background: #fff; -webkit-overflow-scrolling: touch; }
table { width: 100%; min-width: 730px; border-spacing: 0; border-collapse: separate; font-size: 14px; text-align: left; }
th { padding: 13px 16px; border-bottom: 1px solid var(--line); background: #f7f9fc; color: #728098; font-size: 13px; font-weight: 500; white-space: nowrap; }
td { padding: 16px; border-bottom: 1px solid #edf0f5; vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #fbfcff; }
td:first-child { min-width: 180px; }
td > strong { display: block; color: #263954; font-weight: 600; }
td .muted, td small { display: block; margin-top: 3px; font-size: 13px; }
td .button, td .link-button, td .badge { white-space: nowrap; }
td .button + .button, td .link-button + .link-button { margin-left: 7px; }
td .page-actions { flex-wrap: nowrap; }
td .progress-track { min-width: 90px; max-width: 140px; }
.badge, .tag { display: inline-flex; align-items: center; justify-content: center; gap: 4px; width: fit-content; max-width: 100%; padding: 3px 9px; border: 1px solid transparent; border-radius: 5px; background: #f0f3f7; color: #64728a; font-size: 13px; font-weight: 500; line-height: 1.5; white-space: nowrap; }
.badge.blue { background: #edf2ff; color: #315dc6; }
.badge.green { background: #e9f6ef; color: #247556; }
.badge.amber { background: #fff5e4; color: #9c6715; }
.badge.red { background: #fff0f1; color: #bb444f; }
.badge.gray { background: #f0f3f7; color: #67748b; }
.badge.purple { background: #f2edfc; color: #7454b5; }
.tag { padding: 2px 8px; border-color: #e1e7f0; background: #f9fafc; color: #67768e; font-weight: 400; }
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; min-height: 200px; padding: 40px 22px; color: var(--muted); text-align: center; }
.empty-state strong, .empty-state h3 { margin: 0; color: #415470; font-size: 16px; }
.empty-state p { max-width: 440px; margin: 0 0 7px; font-size: 14px; }
.empty-state .button { margin-top: 4px; }
.progress-track { height: 7px; margin: 7px 0; overflow: hidden; border-radius: 99px; background: #edf1f7; }
.progress-fill { display: block; height: 100%; max-width: 100%; border-radius: inherit; background: #5c7fe8; transition: width .24s; }
.progress-fill.green { background: #4da982; }
.progress-fill.amber { background: #d6a23e; }
.capacity-bar { display: flex; height: 15px; overflow: hidden; border: 1px solid rgb(20 45 86 / 4%); border-radius: 5px; background: #edf1f7; }
.bar-segment { flex-shrink: 0; height: 100%; min-width: 0; background: #6c8cef; }
.bar-segment + .bar-segment { border-left: 2px solid #fff; }
.bar-segment.operations, .bar-segment.gray { background: #9cabc3; }
.bar-segment.reserve, .bar-segment.amber { background: #e8c782; }
.bar-segment.committed, .bar-segment.blue { background: #5d7fe7; }
.bar-segment.remaining, .bar-segment.green { background: #c3ddcf; }
.bar-segment[data-kind="operations"] { background: #9cabc3; }
.bar-segment[data-kind="reserve"] { background: #e8c782; }
.bar-segment[data-kind="committed"] { background: #5d7fe7; }
.bar-segment[data-kind="remaining"] { background: #c3ddcf; }
.tag[data-kind] { gap: 6px; border: 0; background: transparent; }
.tag[data-kind]::before { flex-shrink: 0; width: 7px; height: 7px; border-radius: 2px; content: ""; }
.tag[data-kind="operations"]::before { background: #9cabc3; }
.tag[data-kind="reserve"]::before { background: #e8c782; }
.tag[data-kind="committed"]::before { background: #5d7fe7; }
.tag[data-kind="remaining"]::before { background: #c3ddcf; }
.capacity-legend { display: flex; flex-wrap: wrap; gap: 8px 17px; margin-top: 13px; color: var(--muted); font-size: 13px; }
.capacity-bar + .page-actions { gap: 4px 8px; margin-top: 12px; }

.flow-rail { display: flex; align-items: stretch; gap: 18px; min-width: 0; }
.flow-step { position: relative; flex: 1; min-width: 0; padding: 15px 13px; border: 1px solid #e6ecf6; border-radius: 10px; background: #f9fbfe; }
.flow-step + .flow-step::before { position: absolute; top: 50%; left: -15px; color: #a3b1c7; font-size: 14px; transform: translateY(-50%); content: "→"; }
.flow-step strong, .flow-step b { display: block; color: #314866; font-size: 15px; }
.flow-step .muted, .flow-step small { display: block; margin-top: 5px; font-size: 13px; }
.flow-step .stat-value { margin: 7px 0 4px; color: #315ed1; font-size: 26px; }
.flow-step.active { border-color: #c2d0f4; background: #f0f4ff; }
.activity-list, .timeline { padding: 0; margin: 0; list-style: none; }
.activity-item { position: relative; display: flex; align-items: flex-start; gap: 12px; padding: 14px 0; border-bottom: 1px solid #eef1f6; }
.activity-item:first-child { padding-top: 0; }
.activity-item:last-child { padding-bottom: 0; border-bottom: 0; }
.activity-item > div { min-width: 0; }
.activity-item p { margin-bottom: 3px; }
.activity-item .muted, .activity-item small, .activity-item time { color: #7d8a9d; font-size: 13px; }
.activity-item .badge { flex-shrink: 0; }
.timeline { padding-left: 5px; }
.timeline-item { position: relative; padding: 0 0 22px 22px; border-left: 1px solid #dce4f1; }
.timeline-item::before { position: absolute; top: 7px; left: -4px; width: 7px; height: 7px; border-radius: 50%; background: #91a8d8; box-shadow: 0 0 0 4px #f4f7fd; content: ""; }
.timeline-item:last-child { padding-bottom: 0; border-left-color: transparent; }
.timeline-item p { margin: 5px 0 0; }
.timeline-item time, .timeline-item small { display: block; margin-bottom: 3px; color: var(--muted); font-size: 13px; }
.timeline-item strong { font-size: 14px; }
.notice { padding: 14px 16px; border: 1px solid #dce7fb; border-radius: 10px; background: #f4f8ff; color: #4c6487; font-size: 13px; line-height: 1.75; }
.notice strong { color: inherit; }
.notice p { margin: 0; }
.notice p + p { margin-top: 6px; }
.notice.info { border-color: #dce7fb; background: #f4f8ff; color: #4c6487; }
.notice.warning { border-color: #efdfbb; background: #fffaf0; color: #896626; }
.notice.success { border-color: #d6e9dd; background: #f1f9f4; color: #47775b; }
.notice .button { margin-top: 9px; }
.check-list { display: flex; flex-direction: column; gap: 9px; padding: 0; margin: 0; list-style: none; }
.check-list li { position: relative; padding-left: 22px; color: #596c86; font-size: 14px; }
.check-list li::before { position: absolute; top: 1px; left: 0; color: #6b89c8; font-size: 13px; content: "✓"; }
.check-list li.missing::before { color: #b98027; content: "!"; }
.task-row { display: flex; align-items: center; gap: 12px; padding: 15px 0; border-bottom: 1px solid var(--line); }
.task-row:first-child { padding-top: 0; }
.task-row:last-child { padding-bottom: 0; border-bottom: 0; }
.task-row > div:first-child { flex: 1; min-width: 0; }
.task-row strong { display: block; }
.task-row p { margin: 4px 0 0; }
.task-row small, .task-row .muted { display: block; margin-top: 3px; color: var(--muted); font-size: 13px; }
.task-row select { flex: 0 0 125px; width: 125px; }
.review-card { padding: 19px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.review-card + .review-card { margin-top: 14px; }
.review-card .card-header { margin-bottom: 12px; }
.review-card p { overflow-wrap: anywhere; }
.tabs { display: flex; gap: 5px; padding: 4px; margin: 0 0 20px; overflow-x: auto; border: 1px solid var(--line); border-radius: 9px; background: #edf1f7; }
.tab { flex-shrink: 0; min-height: 35px; padding: 7px 14px; border: 1px solid transparent; border-radius: 6px; background: transparent; color: var(--muted); font-size: 14px; font-weight: 500; }
.tab.active, .tab[aria-selected="true"] { border-color: #e1e6f0; background: #fff; color: var(--accent); box-shadow: 0 1px 3px rgb(20 40 80 / 5%); }

input, select, textarea { width: 100%; min-width: 0; min-height: 41px; padding: 9px 12px; border: 1px solid #d5deeb; border-radius: 8px; background: #fff; color: var(--ink); font-size: 14px; line-height: 1.5; transition: border-color .14s, box-shadow .14s; }
input:hover, select:hover, textarea:hover { border-color: #b7c6df; }
input:focus, select:focus, textarea:focus { border-color: #7295f5; box-shadow: 0 0 0 3px rgb(49 95 232 / 8%); }
input::placeholder, textarea::placeholder { color: #94a0b3; }
input:disabled, select:disabled, textarea:disabled, input[readonly], textarea[readonly] { border-color: #e2e7ef; background: #f4f6fa; color: #75839a; }
input:disabled, select:disabled, textarea:disabled { cursor: not-allowed; }
textarea { display: block; min-height: 96px; resize: vertical; }
input[type="checkbox"], input[type="radio"] { flex: 0 0 16px; width: 16px; height: 16px; min-height: 16px; padding: 0; margin: 3px 0 0; accent-color: var(--accent); box-shadow: none; }
input[type="file"] { padding: 7px; font-size: 13px; }
input[type="file"]::file-selector-button { padding: 6px 10px; margin-right: 10px; border: 0; border-radius: 5px; background: #edf2ff; color: #315dc6; font: inherit; cursor: pointer; }
dialog.modal { width: min(760px, calc(100vw - 36px)); max-width: 900px; max-height: calc(100dvh - 64px); padding: 0; overflow: auto; border: 1px solid #dde4ee; border-radius: 18px; background: #fff; color: var(--ink); box-shadow: 0 28px 100px rgb(12 29 57 / 25%); }
dialog.modal::backdrop { background: rgb(17 31 53 / 43%); backdrop-filter: blur(3px); }
dialog.modal.wide { width: min(900px, calc(100vw - 36px)); }
dialog.modal[open] { animation: dialog-in .15s ease-out; }
.modal-header { position: sticky; z-index: 2; top: 0; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 21px 25px; border-bottom: 1px solid var(--line); background: #fff; }
.modal-header h2, .modal-header h3 { margin: 0; font-size: 20px; }
.modal-header p { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.modal-body { padding: 24px 25px; }
.modal-body > .notice { margin-bottom: 20px; }
.modal-body .card { padding: 17px; box-shadow: none; }
.modal-body .form-grid + h3, .modal-body .form-grid + section { margin-top: 24px; }
.modal-body .form-grid + .check-list { margin-top: 20px; }
.modal-body .check-list + .notice { margin-top: 17px; margin-bottom: 20px; }
.modal-body .stack .card .form-grid { margin-top: 13px; }
.modal-footer { position: sticky; z-index: 2; bottom: 0; display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 10px; padding: 17px 25px; border-top: 1px solid var(--line); background: #fafbfd; }
.modal-footer .muted, .modal-footer .field-hint { flex: 1; margin: 0; text-align: left; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 20px; }
.field { min-width: 0; }
.field.full { grid-column: 1 / -1; }
.field > label { display: block; margin-bottom: 7px; color: #3f506a; font-size: 14px; font-weight: 500; }
.field label .required, .required { color: #bd4a55; }
.field-hint { display: block; margin: 6px 0 0; color: #7c8a9f; font-size: 13px; line-height: 1.6; }
.field-error, .form-error { color: #af3440; font-size: 13px; }
.form-error { padding: 11px 14px; margin: 0 0 18px; border: 1px solid #f0cfd3; border-radius: 8px; background: #fff3f4; line-height: 1.7; }
.form-error:empty { display: none; }
[aria-invalid="true"] { border-color: #cc6170; }
.check-field { display: flex; align-items: flex-start; gap: 9px; min-width: 0; padding: 11px 13px; border: 1px solid #e0e7f1; border-radius: 8px; background: #fafbfd; color: #4e607a; font-size: 14px; cursor: pointer; }
.check-field label { flex: 1; margin: 0; cursor: pointer; }
.check-field input { flex-shrink: 0; }
.check-field:has(input:checked) { border-color: #c0d0f7; background: #f1f5ff; }
.check-field .muted { display: block; margin-top: 4px; font-size: 13px; }
.choice-row { display: flex; align-items: stretch; flex-wrap: wrap; gap: 9px; }
.choice-row > label, .choice-row > .check-field { flex: 1 1 140px; }
.choice-row > label { display: flex; align-items: flex-start; gap: 8px; padding: 11px 13px; border: 1px solid #dfe6f1; border-radius: 8px; background: #fff; color: #4c607f; cursor: pointer; }
.choice-row > label:has(input:checked) { border-color: #98b2f5; background: #f0f4ff; color: #315fca; }
.step-hint { padding: 12px 15px; margin-bottom: 20px; border-left: 3px solid #91acf1; border-radius: 0 7px 7px 0; background: #f5f8fe; color: #587199; font-size: 13px; }
.guide-steps { padding: 0; margin: 24px 0 15px; list-style: none; counter-reset: guide-step; }
.guide-steps > li { position: relative; padding: 1px 0 23px 45px; counter-increment: guide-step; }
.guide-steps > li::before { position: absolute; z-index: 1; top: 0; left: 0; display: flex; align-items: center; justify-content: center; width: 29px; height: 29px; border: 1px solid #d5e1ff; border-radius: 9px; background: #edf2ff; color: var(--accent); font-size: 14px; font-weight: 600; content: counter(guide-step); }
.guide-steps > li:not(:last-child)::after { position: absolute; top: 31px; bottom: 2px; left: 14px; width: 1px; background: #e0e7f3; content: ""; }
.guide-steps strong { color: #344d70; font-size: 14px; }
.guide-steps p { margin: 7px 0 0; color: var(--muted); font-size: 13px; line-height: 1.8; }
.storage-warning { padding: 12px 20px; border-bottom: 1px solid #edd6a6; background: #fff6e3; color: #906722; font-size: 13px; }
#toast, .toast { position: fixed; z-index: 1000; right: 28px; bottom: 26px; width: fit-content; max-width: min(460px, calc(100vw - 36px)); padding: 13px 19px; border: 1px solid rgb(255 255 255 / 12%); border-radius: 10px; background: #213955; color: #fff; box-shadow: 0 8px 30px rgb(17 36 66 / 18%); font-size: 14px; line-height: 1.6; opacity: 0; visibility: hidden; transform: translateY(12px); transition: opacity .18s, transform .18s, visibility .18s; pointer-events: none; }
#toast.show, .toast.show { opacity: 1; visibility: visible; transform: translateY(0); }
.toast.error, #toast.error { background: #963c49; }

@keyframes dialog-in { from { opacity: 0; transform: translateY(8px) scale(.99); } to { opacity: 1; transform: translateY(0) scale(1); } }

@media (min-width: 1450px) {
  .page-main { padding-top: 36px; }
  .card { padding: 25px; }
  .stat { padding: 23px 25px; }
}

@media (max-width: 1100px) {
  .app-shell { grid-template-columns: 212px minmax(0, 1fr); }
  .sidebar { padding-right: 13px; padding-left: 13px; }
  .page-main { padding-right: 24px; padding-left: 24px; }
  .topbar { padding-right: 24px; padding-left: 24px; }
  .main-shell > .footer-note { padding-right: 24px; padding-left: 24px; }
  .grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .flow-rail { flex-wrap: wrap; gap: 12px; }
  .flow-step { flex: 1 1 calc(33.333% - 12px); }
  .flow-step + .flow-step::before { display: none; }
  .page-heading { flex-wrap: wrap; gap: 16px; }
  .page-heading .page-actions { padding-top: 0; }
  .card { padding: 20px; }
  .metric-grid { gap: 9px; }
  .metric { padding: 12px; }
}

@media (max-width: 850px) {
  .app-shell { display: block; }
  .sidebar { position: relative; z-index: 5; height: auto; padding: 17px 20px 12px; overflow: visible; }
  .main-shell { min-height: calc(100dvh - 145px); }
  .brand { margin: 0 0 17px; }
  .brand-mark { width: 35px; height: 35px; border-radius: 10px; font-size: 19px; }
  .brand strong, .brand b { font-size: 16px; }
  .brand small, .brand .muted { font-size: 13px; }
  .nav-list { flex-direction: row; gap: 5px; width: calc(100% + 12px); padding: 0 6px 6px; margin-left: -6px; overflow-x: auto; scrollbar-width: thin; scrollbar-color: #576985 transparent; }
  .nav-list > * { flex-shrink: 0; }
  .nav-caption { display: none; }
  .nav-item { width: auto; min-height: 40px; padding: 9px 13px; border-radius: 8px; }
  .nav-item.active, .nav-item[aria-current="page"] { box-shadow: inset 0 -2px #8aa4ff; }
  .nav-item .badge { margin-left: 0; }
  .nav-count { margin-left: 0; }
  .sidebar-bottom { display: none; }
  .topbar { min-height: 65px; padding: 13px 24px; }
  .top-actions { gap: 6px; }
  .top-actions .button { min-height: 33px; padding: 6px 10px; font-size: 13px; }
  .page-main { padding-top: 25px; }
  .page-heading { margin-bottom: 21px; }
  .grid.cols-2 { gap: 15px; }
  .grid.cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-value { font-size: 30px; }
  .flow-rail { gap: 10px; }
  .flow-step { flex-basis: calc(33.333% - 10px); }
  table { min-width: 700px; }
  dialog.modal { max-height: calc(100dvh - 40px); }
}

@media (max-width: 650px) {
  .sidebar { padding: 16px 16px 9px; }
  .brand { gap: 10px; margin-bottom: 14px; }
  .nav-list { padding-bottom: 6px; }
  .nav-item { gap: 7px; min-height: 40px; padding: 9px 12px; font-size: 13px; }
  .nav-item svg { width: 17px; height: 17px; }
  .topbar { align-items: flex-start; flex-direction: column; gap: 10px; padding: 13px 16px; }
  .top-actions { justify-content: flex-start; gap: 7px; }
  .avatar { width: 30px; height: 30px; margin-left: 3px; }
  .breadcrumbs { gap: 7px; }
  .prototype-badge { padding: 3px 7px; }
  .page-main { padding: 22px 16px 30px; }
  .page-heading { gap: 14px; margin-bottom: 20px; }
  .page-heading h1 { font-size: 24px; }
  .page-heading p { font-size: 13px; line-height: 1.8; }
  .page-actions { gap: 8px; }
  .page-heading .page-actions { width: 100%; }
  .page-heading .page-actions .button { min-height: 40px; }
  .eyebrow { margin-bottom: 5px; }
  .grid { gap: 13px; }
  .grid.cols-2, .grid.cols-3 { grid-template-columns: minmax(0, 1fr); }
  .grid.cols-4 { gap: 12px; }
  .card { padding: 17px; border-radius: 13px; }
  .card-header { align-items: flex-start; gap: 10px; margin-bottom: 15px; }
  .card-header h2 { font-size: 17px; }
  .card-header h3, .section-title { font-size: 15px; }
  .stat { padding: 16px; border-radius: 13px; }
  .stat-value { margin: 9px 0 5px; font-size: 28px; }
  .stat-label, .stat-foot { font-size: 13px; }
  .metric-grid { grid-template-columns: minmax(0, 1fr); }
  .metric { display: flex; align-items: center; flex-wrap: wrap; justify-content: space-between; gap: 4px 15px; padding: 12px 14px; }
  .metric > small, .metric > span:first-child, .metric > label { margin: 0; }
  .metric > strong, .metric > b { font-size: 21px; }
  .metric > p { flex-basis: 100%; }
  .detail-grid { grid-template-columns: minmax(0, 1fr); gap: 15px; }
  .toolbar { align-items: stretch; gap: 9px; margin-bottom: 14px; }
  .toolbar input { flex-basis: 100%; max-width: none; }
  .toolbar > .field:first-child { flex-basis: 100%; max-width: none; }
  .toolbar > .field { flex: 1 1 140px; }
  .toolbar select { flex: 1 1 140px; min-width: 0; }
  .toolbar .muted { align-self: center; margin-left: 0; }
  input, select, textarea { min-height: 43px; font-size: 16px; }
  textarea { min-height: 100px; }
  .field > label, .check-field, .choice-row > label { font-size: 14px; }
  th { padding: 12px 14px; }
  td { padding: 14px; }
  .table-wrap { border-radius: 9px; }
  .table-wrap .button { min-height: 34px; }
  .flow-rail { gap: 9px; }
  .flow-step { flex-basis: calc(50% - 9px); padding: 13px; }
  .flow-step strong { font-size: 14px; }
  .flow-step .stat-value { font-size: 24px; }
  .activity-item { gap: 9px; }
  .notice { padding: 12px 14px; }
  .task-row { align-items: flex-start; flex-wrap: wrap; gap: 9px; }
  .task-row > div:first-child { flex-basis: calc(100% - 90px); }
  .task-row select { flex-basis: 100%; width: 100%; }
  .review-card { padding: 15px; }
  .tabs { margin-bottom: 17px; }
  .tab { min-height: 38px; padding-right: 12px; padding-left: 12px; font-size: 13px; }
  dialog.modal, dialog.modal.wide { width: calc(100vw - 20px); max-height: calc(100dvh - 24px); border-radius: 14px; }
  .modal-header { gap: 14px; padding: 17px 18px; }
  .modal-header h2, .modal-header h3 { font-size: 18px; }
  .modal-body { padding: 19px 18px; }
  .modal-footer { gap: 8px; padding: 14px 18px calc(14px + env(safe-area-inset-bottom)); }
  .modal-footer .button { min-height: 42px; }
  .modal-footer .muted, .modal-footer .field-hint { flex-basis: 100%; margin-bottom: 2px; }
  .form-grid { grid-template-columns: minmax(0, 1fr); gap: 17px; }
  .form-grid .field.full { grid-column: auto; }
  .choice-row > label, .choice-row > .check-field { flex-basis: calc(50% - 9px); }
  .check-field { padding: 12px; }
  #toast, .toast { right: 16px; bottom: calc(17px + env(safe-area-inset-bottom)); max-width: calc(100vw - 32px); padding: 12px 16px; }
  .footer-note { margin-top: 20px; }
  .main-shell > .footer-note { padding: 0 16px 20px; margin: 0; }
}

@media (max-width: 380px) {
  .page-main { padding-right: 12px; padding-left: 12px; }
  .stat { padding: 14px 12px; }
  .stat-value { font-size: 26px; }
  .card { padding: 15px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

@media print {
  .app-shell { display: block; }
  .sidebar, .top-actions, .page-actions, .toolbar, .footer-note, #toast, dialog.modal { display: none !important; }
  .topbar { min-height: auto; padding: 12px 0; background: #fff; }
  .page-main { max-width: none; padding: 20px 0; }
  body, html { background: #fff; }
  .card, .stat { break-inside: avoid; box-shadow: none; }
  .table-wrap { overflow: visible; }
  table { min-width: 0; font-size: 13px; }
  td, th { padding: 9px; }
}

/* Business-goal extension: two-level goal / initiative views. */
.goals-card-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin: 0 0 20px; }
.goals-card-grid > .card { margin: 0; }
.goals-card { min-width: 0; }
.goals-card .card-header { align-items: flex-start; }
.goals-card .card-header h2 { margin-top: 5px; overflow-wrap: anywhere; }
.goals-card > .card-body > .muted { font-size: 13px; }
.goals-metric-line { display: grid; gap: 8px; padding: 15px 17px; margin: 15px 0 19px; border-radius: 10px; background: var(--surface-soft); overflow-wrap: anywhere; }
.goals-metric-line > span { font-size: 13px; color: var(--muted); }
.goals-metric-line > strong { font-size: 23px; font-weight: 650; font-variant-numeric: tabular-nums; line-height: 1.5; }
.goals-metric-line > strong > span { color: var(--muted); font-weight: 400; margin: 0 5px; }
.goals-metric-line small { font-size: 14px; font-weight: 400; }
.goals-counts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 0 0 19px; }
.goals-counts > span { display: flex; flex-direction: column; gap: 2px; min-width: 0; color: var(--muted); font-size: 13px; }
.goals-counts strong { font-size: 23px; font-weight: 650; font-variant-numeric: tabular-nums; color: var(--ink); }
.goals-tree { border-top: 1px solid var(--line); margin-top: 18px; padding-top: 14px; }
.goals-tree > summary { min-height: 34px; padding: 4px 0; color: var(--ink); cursor: pointer; font-weight: 600; overflow-wrap: anywhere; }
.goals-tree > summary::marker { color: var(--accent); }
.goals-tree > summary .tag { margin-left: 6px; font-weight: 400; }
.goals-tree > ul { margin: 12px 0 0 6px; padding: 0 0 0 16px; list-style: none; border-left: 1px solid var(--line-strong); }
.goals-tree > ul > li { position: relative; padding: 13px 0 13px 1px; }
.goals-tree > ul > li::before { content: ''; position: absolute; left: -17px; top: 25px; width: 10px; height: 1px; background: var(--line-strong); }
.goals-tree > ul > li + li { border-top: 1px solid var(--line); }
.goals-tree-content { display: flex; align-items: flex-start; gap: 12px; justify-content: space-between; min-width: 0; }
.goals-tree-content > div { min-width: 0; flex: 1 1 0; }
.goals-tree-content strong { overflow-wrap: anywhere; font-weight: 600; }
.goals-tree-content p { margin: 5px 0 8px; font-size: 13px; }
.goals-tree-content > .button { flex-shrink: 0; }
.goals-tree-content .badge { font-size: 13px; }
.goals-tree-empty { margin: 10px 0 0; padding: 9px 0; }
.goals-summary { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 0; margin: 20px 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.goals-summary-item { display: grid; align-content: start; gap: 6px; padding: 19px 16px; min-width: 0; }
.goals-summary-item + .goals-summary-item { border-left: 1px solid var(--line); }
.goals-summary-item > strong { font-size: 25px; font-weight: 650; line-height: 1.4; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.goals-summary-item .muted { font-size: 13px; overflow-wrap: anywhere; }
.goals-path { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 9px; margin-bottom: 15px; color: var(--muted); font-size: 13px; }
.goals-path > [aria-current] { color: var(--ink); overflow-wrap: anywhere; min-width: 0; }
.goals-path .button { padding-left: 0; padding-right: 0; text-align: left; white-space: normal; }
.goals-affiliation { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 7px; margin-top: 6px; max-width: 100%; }
.goals-affiliation > .muted { font-size: 13px; }
.goals-affiliation .button { padding: 3px 0; min-height: 28px; text-align: left; white-space: normal; overflow-wrap: anywhere; }
.goals-affiliation .badge { font-size: 13px; }
.goals-gate-warning { color: var(--amber); font-size: 13px; margin: 8px 0 0; }
.goals-callout { display: flex; align-items: center; justify-content: space-between; gap: 10px 18px; flex-wrap: wrap; }
.goals-callout > div { min-width: 0; flex: 1 1 280px; overflow-wrap: anywhere; }
.goals-callout > .button { flex-shrink: 0; }
.goals-callout p { margin: 4px 0 0; }
.goals-filter { min-width: 190px; }
.goals-filter select { max-width: 100%; }

/* Goal browsing keeps result comparison compact; goal-detail layouts stay unchanged. */
.page-main.goal-browse-page { padding-top: 14px; }
.role-banner:has(+ .goal-browse-page) { margin-bottom: 4px; }
.goal-list-heading { align-items: center; gap: 12px; margin-bottom: 10px; }
.goal-list-heading h1 { margin-bottom: 3px; font-size: 26px; }
.goal-list-heading p { font-size: 13px; }
.goal-list-heading .page-actions { padding-top: 0; }
.goal-toolbar { min-width: 0; margin: 10px 0; }
.goal-toolbar-top { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.goal-scope-switch, .goal-view-switch { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; min-width: 0; }
.goal-scope-button { min-height: 44px; padding: 8px 11px; border-color: transparent; background: transparent; color: var(--muted); }
.goal-scope-button[aria-pressed="true"] { border-color: var(--line-strong); background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.goal-scope-count { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; padding: 0 5px; border-radius: 5px; background: var(--line); color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.goal-scope-button[aria-pressed="true"] .goal-scope-count { background: var(--accent-soft); color: var(--accent-dark); }
.goal-view-switch { gap: 0; padding: 3px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); }
.goal-view-button { min-height: 44px; padding: 8px 13px; border-color: transparent; border-radius: 6px; color: var(--muted); box-shadow: none; }
.goal-view-button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent-dark); }
.goal-filter-grid { display: grid; grid-template-columns: minmax(200px, 1.8fr) repeat(4, minmax(0, 1fr)); gap: 10px; min-width: 0; }
.goal-toolbar .field > label { margin-bottom: 4px; color: var(--muted); font-size: 13px; font-weight: 400; }
.goal-toolbar input, .goal-toolbar select { min-height: 44px; }
.goal-results-bar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; margin-top: 6px; }
.goal-result-count { margin: 0; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.goal-result-count strong { color: var(--ink); font-weight: 600; }
.goal-result-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; }
.goal-result-controls .field { display: flex; align-items: center; gap: 7px; }
.goal-result-controls .field > label { flex-shrink: 0; margin: 0; }
.goal-result-controls select { width: auto; max-width: 168px; padding-right: 28px; }
.goal-result-controls > .button { min-height: 44px; padding: 8px 10px; }
.goal-scope-note { margin: 8px 0 0; color: var(--muted); font-size: 13px; }
.goal-list-wrap { min-width: 0; width: 100%; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.goal-list-table { width: 100%; min-width: 0; table-layout: fixed; border-radius: inherit; }
.goal-list-table .goal-col-name { width: 29%; }
.goal-list-table .goal-col-period { width: 14%; }
.goal-list-table .goal-col-metric { width: 19%; }
.goal-list-table .goal-col-actual { width: 15%; }
.goal-list-table .goal-col-result { width: 14%; }
.goal-list-table .goal-col-children { width: 9%; }
.goal-list-table > thead > tr > th { padding: 12px; white-space: normal; }
.goal-list-table > thead > tr > th:first-child { border-top-left-radius: 12px; }
.goal-list-table > thead > tr > th:last-child { border-top-right-radius: 12px; }
.goal-list-table > tbody > tr > td { min-width: 0; padding: 8px 12px; vertical-align: middle; overflow-wrap: anywhere; }
.goal-list-table > tbody > .goal-list-row > td { border-bottom: 1px solid var(--line); }
.goal-list-table > tbody > .goal-list-row:last-of-type > td { border-bottom: 0; }
.goal-list-table > tbody > tr > td .badge { max-width: 100%; white-space: normal; }
.goal-title-button { display: block; width: fit-content; min-width: 44px; max-width: 100%; min-height: 44px; padding: 5px 0; border: 0; border-radius: 4px; background: transparent; color: var(--ink); font-weight: 600; line-height: 1.5; text-align: left; overflow-wrap: anywhere; }
.goal-title-button:hover { color: var(--accent-dark); text-decoration: underline; text-underline-offset: 3px; }
.goal-owner-line { display: block; margin: 0 0 2px; color: var(--muted); font-size: 13px; line-height: 1.4; }
.goal-identifiers { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.goal-identifiers .badge { padding: 0 5px; font-size: 12px; }
.goal-cell-content { display: block; min-width: 0; }
.goal-cell-secondary { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.goal-metric-name { display: block; margin-bottom: 3px; font-size: 13px; line-height: 1.5; }
.goal-target-value, .goal-actual-value { display: block; color: var(--ink); font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.5; }
.goal-target-value small, .goal-actual-value small { display: inline; margin: 0; font-size: 12px; font-weight: 400; }
.goal-history-note { display: block; margin-top: 4px; color: var(--amber); font-size: 12px; line-height: 1.5; }
.goal-expand-button.button { display: inline-flex; min-width: 44px; min-height: 44px; gap: 3px; padding: 7px 0; color: var(--accent-dark); white-space: normal; }
.goal-expand-button svg { width: 12px; height: 12px; transition: transform .14s; }
.goal-expand-button[aria-expanded="true"] svg { transform: rotate(90deg); }
.goal-list-table > tbody > .goal-expanded-row > td { padding: 0; background: var(--surface-soft); }
.goal-expanded-content { padding: 16px 20px 20px; border-bottom: 1px solid var(--line); }
.goal-expanded-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; margin-bottom: 10px; }
.goal-expanded-heading h3 { margin: 0; font-size: 14px; }
.goal-expanded-content .button { min-height: 44px; }
.goal-expanded-content .table-wrap { max-width: 100%; }
.goal-expanded-content table { min-width: 650px; font-size: 13px; }
.goal-expanded-content td, .goal-expanded-content th { padding: 10px 12px; }
.goal-expanded-content td:first-child { min-width: 180px; }
.goal-expanded-content > .muted { margin: 0; }
.goal-list-empty { padding: 8px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.goal-list-empty .button { min-height: 44px; }
.goal-pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; color: var(--muted); font-size: 13px; }
.goal-pagination > div { display: flex; gap: 8px; }
.goal-pagination .button { min-height: 44px; }
.goal-visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.goal-browse-cards { align-items: start; gap: 16px; }
.goal-browse-cards .goals-card { padding: 20px; }
.goal-browse-cards .card-header { margin-bottom: 12px; }
.goal-browse-cards .goal-title-button { font-size: 18px; }
.goal-browse-cards .goals-metric-line { margin: 12px 0; padding: 12px 14px; }
.goal-browse-cards .goals-metric-line > strong { font-size: 20px; }
.goal-card-observation { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 0 0 14px; }
.goal-card-observation > div { min-width: 0; overflow-wrap: anywhere; }
.goal-card-observation > div > .goal-cell-secondary:first-child { margin: 0 0 5px; }
.goal-card-observation .badge { white-space: normal; }
.goal-card-counts { display: flex; flex-wrap: wrap; gap: 7px 16px; padding: 12px 0; margin-bottom: 6px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.goal-card-counts strong { color: var(--ink); font-weight: 600; }
.goal-browse-cards .button, .goal-browse-cards .goals-tree > summary { min-height: 44px; }
.goal-browse-cards .goals-tree { margin-top: 12px; padding-top: 8px; }
@media (min-width: 701px) and (pointer: fine) {
  .goal-list-table .goal-title-button { width: 100%; min-height: 30px; padding: 3px 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .goal-list-table .goal-owner-line { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
@media (max-width: 1100px) {
  .goal-filter-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .goal-filter-grid .goal-search { grid-column: span 2; }
  .goal-filter-grid .field:last-child { grid-column: span 2; }
  .goal-list-table > thead > tr > th, .goal-list-table > tbody > tr > td { padding-left: 9px; padding-right: 9px; }
  .goal-list-table .goal-col-name { width: 27%; }
  .goal-list-table .goal-col-period { width: 15%; }
  .goal-list-table .goal-col-result { width: 15%; }
}
@media (max-width: 700px) {
  .goal-list-heading { align-items: flex-start; flex-wrap: wrap; }
  .goal-list-heading h1 { font-size: 24px; }
  .goal-list-heading .button { min-height: 44px; }
  .goal-toolbar-top { align-items: flex-start; gap: 10px; margin-bottom: 12px; }
  .goal-scope-switch { width: 100%; gap: 4px 6px; }
  .goal-scope-button { padding: 7px 9px; }
  .goal-view-switch { margin-left: auto; }
  .goal-filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .goal-filter-grid .goal-search { grid-column: 1 / -1; }
  .goal-filter-grid .field:last-child { grid-column: auto; }
  .goal-results-bar { gap: 10px; }
  .goal-result-controls { justify-content: space-between; width: 100%; gap: 8px; }
  .goal-result-controls .field { gap: 5px; }
  .goal-result-controls select { max-width: 140px; padding-left: 8px; }
  .goal-result-controls > .button { padding: 8px 0; }
  .goal-list-wrap { border-radius: 10px; }
  .goal-list-table, .goal-list-table > tbody { display: block; width: 100%; }
  .goal-list-table > colgroup { display: none; }
  .goal-list-table > thead { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
  .goal-list-table > tbody > .goal-list-row { display: block; padding: 10px 14px 12px; border-bottom: 1px solid var(--line); }
  .goal-list-table > tbody > .goal-list-row > td { display: grid; grid-template-columns: 76px minmax(0, 1fr); align-items: start; gap: 8px; width: 100%; min-width: 0; padding: 7px 0; border: 0; }
  .goal-list-table > tbody > .goal-list-row > td::before { content: attr(data-label); padding-top: 1px; color: var(--muted); font-size: 13px; }
  .goal-list-table > tbody > .goal-list-row > td.goal-name-cell { display: block; padding: 0 0 10px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
  .goal-list-table > tbody > .goal-list-row > td.goal-name-cell::before { content: none; }
  .goal-list-table > tbody > .goal-list-row > td:last-child { align-items: center; padding: 0; }
  .goal-list-table > tbody > .goal-list-row > td:last-child > .goal-expand-button { justify-self: start; }
  .goal-list-table .goal-title-button { width: 100%; font-size: 15px; }
  .goal-list-table .goal-identifiers { margin-bottom: 2px; }
  .goal-list-table .goal-cell-secondary { display: inline; margin-left: 5px; }
  .goal-list-table .goal-metric-name, .goal-list-table .goal-history-note { display: block; }
  .goal-list-table .goal-target-value, .goal-list-table .goal-actual-value { display: inline; }
  .goal-list-table > tbody > .goal-expanded-row { display: block; }
  .goal-list-table > tbody > .goal-expanded-row > td { display: block; width: 100%; padding: 0; }
  .goal-expanded-content { padding: 12px; }
  .goal-expanded-heading { margin-bottom: 8px; }
  .goal-expanded-content .table-wrap { overflow-x: auto; }
  .goal-browse-cards .goals-card { padding: 16px; }
  .goal-card-observation { gap: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .goal-expand-button svg { transition: none; }
}
@media (max-width: 1150px) {
  .goals-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .goals-summary-item:nth-child(4) { border-left: 0; }
  .goals-summary-item:nth-child(n+4) { border-top: 1px solid var(--line); }
}
@media (max-width: 700px) {
  .goals-card-grid { grid-template-columns: minmax(0, 1fr); gap: 15px; }
  .goals-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .goals-summary-item:nth-child(odd) { border-left: 0; }
  .goals-summary-item:nth-child(even) { border-left: 1px solid var(--line); }
  .goals-summary-item:nth-child(n+3) { border-top: 1px solid var(--line); }
  .goals-summary-item { padding: 15px; }
  .goals-filter { min-width: 0; }
  .goals-tree-content { flex-wrap: wrap; }
  .goals-tree-content > div { flex-basis: 100%; }
  .goals-path { gap: 3px 7px; }
  .goals-affiliation .button { min-height: 34px; }
}
@media print {
  .goals-path, .goals-callout > .button { display: none; }
  .goals-card-grid { display: block; }
  .goals-card-grid > .card { margin-bottom: 18px; }
}
@media (pointer: coarse) {
  .goals-tree > summary, .goals-affiliation .button { min-height: 44px; }
}

/* V3 responsibility and value-loop views. */
.role-switch { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; font-size: 13px; color: var(--muted); min-width: 0; }
.role-switch select { min-width: 150px; max-width: 240px; min-height: 36px; padding: 6px 26px 6px 10px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); color: var(--ink); font-size: 13px; }
.role-banner { padding: 11px 16px; margin: 0 0 20px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-soft); color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.role-banner:empty { display: none; }
.loop-role-context p { margin: 4px 0 0; }
.loop-section-heading { margin-top: 26px; }
.loop-section-heading h2 { margin-bottom: 5px; }
.loop-section-heading + .goals-summary { margin-top: 14px; }
.loop-goal-effect { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 15px 25px; padding: 8px 0 18px; }
.loop-goal-effect > div:first-child { display: grid; gap: 6px; min-width: 0; }
.loop-goal-effect strong { font-size: 30px; font-weight: 650; font-variant-numeric: tabular-nums; line-height: 1.4; overflow-wrap: anywhere; }
.loop-goal-effect > div:last-child p { margin: 6px 0 0; }
.loop-goal-latest { font-size: 13px; color: var(--muted); margin: 0 0 14px; }
.loop-metric-warning { padding: 10px 12px; border-left: 3px solid var(--amber); background: #fff8e9; border-radius: 0 7px 7px 0; margin-bottom: 15px; }
.loop-history { border-top: 1px solid var(--line); margin-top: 15px; padding-top: 10px; }
.loop-history > summary { cursor: pointer; color: var(--ink); padding: 7px 0; min-height: 36px; font-weight: 600; overflow-wrap: anywhere; }
.loop-history > summary::marker { color: var(--accent); }
.loop-history > summary > .muted { margin-left: 14px; font-size: 13px; font-weight: 400; }
.loop-history-body { padding: 15px 0 4px; }
.loop-history-body > .metric-grid { margin-bottom: 20px; }
.loop-history-body .key-value dd { white-space: pre-wrap; overflow-wrap: anywhere; }
.loop-item-progress { display: grid; gap: 5px; min-width: 0; max-width: 340px; margin: 8px 0; font-size: 13px; font-variant-numeric: tabular-nums; }
.loop-item-progress .progress-track { margin: 0; }
.loop-item-progress p, .loop-progress-unknown p { margin: 2px 0 0; font-size: 13px; }
.loop-progress-unknown { margin: 8px 0; }
.loop-task-group + .loop-task-group { margin-top: 24px; padding-top: 23px; border-top: 1px solid var(--line); }
.loop-task-heading { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 14px; margin-bottom: 15px; }
.loop-task-heading > div { min-width: 0; flex: 1 1 300px; }
.loop-task-heading h3 { margin: 4px 0 8px; }
.loop-task-heading .loop-item-progress { max-width: 360px; }
.loop-task-table table { min-width: 780px; }
.loop-task-table th:first-child { width: 30%; }
.loop-task-table td { vertical-align: top; }
.loop-task-table a { overflow-wrap: anywhere; }
.loop-note { max-width: 42ch; margin: 7px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--muted); font-size: 13px; }
.loop-link-hint { font-size: 13px; color: var(--muted); }
.loop-unmapped .loop-task-heading h3 { color: var(--amber); }
.loop-followup { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px 18px; padding: 16px; margin-top: 18px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-soft); }
.loop-followup > div { min-width: 0; flex: 1 1 240px; }
.loop-followup strong { display: block; overflow-wrap: anywhere; }
.loop-followup p { margin: 6px 0 0; font-size: 13px; }
.loop-followup .page-actions { margin-top: 8px; }
.loop-followup .tag { font-size: 13px; }
.loop-followup.compact { display: block; padding: 10px 0 0; margin-top: 8px; border: 0; border-radius: 0; background: transparent; }
.loop-followup.compact > .button { margin-top: 9px; }
.loop-followup.compact .page-actions { gap: 5px; }
.button:disabled { opacity: .55; cursor: not-allowed; }
@media (max-width: 1100px) {
  .topbar { flex-wrap: wrap; gap: 12px; }
  .role-switch select { max-width: 220px; }
}
@media (max-width: 650px) {
  .role-switch { flex: 1 1 100%; }
  .role-switch select { flex: 1 1 auto; max-width: 100%; min-height: 43px; font-size: 16px; }
  .role-banner { padding: 11px 13px; margin-bottom: 15px; }
  .loop-goal-effect strong { font-size: 26px; }
  .loop-history > summary > .muted { display: block; margin: 4px 0 0; }
  .loop-followup { padding: 13px; }
  .loop-followup > div { flex-basis: 100%; }
  .loop-task-heading > div { flex-basis: 100%; }
  .loop-history-body { padding-top: 12px; }
}
@media (pointer: coarse) {
  .loop-history > summary { min-height: 44px; }
  .loop-task-table .button { min-height: 44px; }
}

/* DEVS: account, administration, validation and async states. */
[hidden] { display: none !important; }
.account-chip { color: var(--text, #17253b); background: #edf2fa; border: 1px solid #d7e0ee; padding: 7px 12px; border-radius: 20px; font-size: 13px; overflow-wrap: anywhere; }
.admin-nav { margin-top: 20px; }
.sidebar { overflow-y: auto; }
.auth-state { max-width: 680px; margin: 40px auto; }
.auth-state h1 { font-size: clamp(22px, 4vw, 30px); line-height: 1.4; }
.auth-state p { line-height: 1.75; }
.auth-state .page-actions { margin-top: 24px; }
.field legend { font-weight: 600; font-size: 13px; padding: 0; margin-bottom: 8px; }
fieldset.field { border: 0; margin: 0; padding: 0; min-width: 0; }
.check-list.inline { display: flex; flex-wrap: wrap; gap: 10px 20px; }
.check-list.inline .check-field { flex: 0 1 auto; }
.person-picker input[type=search] { margin-bottom: 7px; }
.person-picker select { width: 100%; min-width: 0; }
.person-hint { min-height: 1.5em; }
.access-reason { display: block; max-width: 220px; color: #64748b; font-size: 12px; line-height: 1.5; }
.overdue { color: #9b412b; font-size: 12px; font-weight: 600; }
.admin-detail { max-width: 520px; overflow-wrap: anywhere; white-space: pre-wrap; }
.form-error { margin-bottom: 18px; }
.form-error:focus { outline: 3px solid #93b4ff; outline-offset: 3px; }
.form-error p { margin: 7px 0; }
.field-error { display: block; color: #a12424; margin-top: 5px; }
[aria-invalid=true] { border-color: #b63232 !important; }
.modal[aria-busy=true] .modal-body { opacity: .75; }
.button[disabled] { cursor: not-allowed; }
@media (max-width: 850px) {
 .sidebar { overflow: visible; }
 .admin-nav { margin-top: 8px; }
 .admin-nav .nav-caption { display: none; }
 .admin-nav .nav-list { display: flex; overflow-x: auto; }
 .top-actions { max-width: 100%; flex-wrap: wrap; }
}
@media (max-width: 650px) {
 .account-chip { max-width: 100%; }
 .auth-state { margin: 18px 0; }
 .access-reason { max-width: none; }
 .check-list.inline { gap: 8px 14px; }
 .person-picker select { font-size: 16px; }
}

/* Keep the two creation routes actionable, including the first-use state. */
.creation-empty { max-width: 860px; margin: 10px auto; padding: 16px 0; }
.creation-empty > h3 { font-size: 20px; }
.creation-paths { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; margin: 24px 0 18px; }
.creation-paths > div { padding: 20px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-soft); }
.creation-paths p { color: var(--muted); min-height: 3.3em; }
select.creation-source-list { height: auto; min-height: 180px; padding: 6px; background-image: none; white-space: normal; }
.creation-source-list option { padding: 9px; white-space: normal; overflow-wrap: anywhere; }
.creation-next > p { margin: 6px 0 12px; }
.creation-drafts { margin: 20px 0; }
@media (max-width: 640px) { .creation-paths { grid-template-columns: minmax(0, 1fr); gap: 12px; } .creation-paths p { min-height: 0; } }
