/* TypeUI Enterprise visual layer. Geometry of Gantt rows and bars stays in styles.css. */
:root {
  --ui-ink: #17233b;
  --ui-muted: #64748b;
  --ui-line: #dce3ed;
  --ui-surface: #fff;
  --ui-canvas: #f3f6fa;
  --ui-blue: #3455d1;
  --ui-blue-dark: #2844ad;
  --ui-blue-soft: #edf1ff;
  --ui-radius: 10px;
  --ui-shadow: 0 1px 2px rgba(19, 35, 66, .04), 0 8px 24px rgba(19, 35, 66, .035);
}
html { color-scheme: light; }
body { font: 13px/1.48 Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; color: var(--ui-ink); background: var(--ui-canvas); }
button, input, select, textarea { font: inherit; }
button { transition: background-color .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible { outline: 2px solid var(--ui-blue); outline-offset: 2px; }
input, select, textarea { color: var(--ui-ink); accent-color: var(--ui-blue); }
select, input:not([type="checkbox"]):not([type="radio"]), textarea { background: #fff; border: 1px solid #cdd7e4; border-radius: 7px; min-height: 30px; }
select:hover, input:not([type="checkbox"]):not([type="radio"]):hover, textarea:hover { border-color: #9aabc2; }
select:focus, input:not([type="checkbox"]):not([type="radio"]):focus, textarea:focus { border-color: var(--ui-blue); }

.app { min-height: 100vh; }
.topbar { padding: 0; background: var(--ui-surface); border-bottom: 1px solid var(--ui-line); box-shadow: 0 1px 3px rgba(19, 35, 66, .03); }
.workspace-header { min-height: 58px; padding: 9px 24px; display: flex; align-items: center; gap: 11px; border-bottom: 1px solid #edf1f5; }
.brand-mark { width: 34px; height: 34px; flex: none; display: grid; place-items: center; border-radius: 9px; background: #1c2b4d; color: #fff; font-size: 17px; font-weight: 800; letter-spacing: -.08em; box-shadow: inset 0 -3px 0 rgba(0,0,0,.12); }
.brand-copy { line-height: 1.16; }
.brand-name { font-size: 13px; font-weight: 760; letter-spacing: -.02em; }
.brand-name span { margin-left: 4px; padding: 2px 5px; border: 1px solid #cdd7e4; border-radius: 4px; color: #65758d; font-size: 9px; font-weight: 750; letter-spacing: .04em; text-transform: uppercase; }
.crumbs { margin: 5px 0 0; color: #748299; font-size: 10.5px; }
.workspace-status { margin-left: auto; color: #59708d; font-size: 11px; font-weight: 600; white-space: nowrap; }
.workspace-status span { display: inline-block; width: 7px; height: 7px; margin-right: 5px; border-radius: 50%; background: #24a276; box-shadow: 0 0 0 3px #e4f7ef; }
.title-row { padding: 15px 24px 14px; gap: 18px; justify-content: space-between; border-bottom: 1px solid #edf1f5; }
.page-eyebrow { color: #8190a7; font-size: 9px; font-weight: 800; letter-spacing: .14em; }
h1 { margin-top: 1px; color: #17233b; font-size: 23px; line-height: 1.15; font-weight: 760; letter-spacing: -.035em; }
#views { gap: 5px; justify-content: flex-end; }
.view-btn, .chip-btn, .row-action, .add-btn { border: 1px solid #cfd8e6; border-radius: 7px; background: #fff; color: #33445e; font-weight: 590; box-shadow: 0 1px 1px rgba(18, 34, 62, .025); }
.view-btn, .chip-btn { min-height: 30px; padding: 4px 10px; }
.view-btn:hover, .chip-btn:hover, .row-action:hover, .add-btn:hover { border-color: #aebddd; background: #f5f7ff; color: #233f9d; }
.view-btn.active { background: #263b70; border-color: #263b70; color: #fff; }
.chip-btn.active { background: var(--ui-blue-soft); border-color: #a8b8ef; color: #2544b7; box-shadow: inset 0 0 0 1px #dfe6ff; }
.chip-btn.primary, .hint-btns .chip-btn.primary { background: var(--ui-blue); border-color: var(--ui-blue); color: #fff; }
.chip-btn.primary:hover, .hint-btns .chip-btn.primary:hover { background: var(--ui-blue-dark); border-color: var(--ui-blue-dark); }
.chip-btn:disabled, .view-btn:disabled { opacity: .48; box-shadow: none; }
.tool-toolbar { margin: 0; padding: 9px 24px 11px; gap: 8px 12px; align-items: center; background: #fbfcfe; font-size: 11.5px; color: #465771; }
.tool-toolbar > span:not(.ctl-sep), .tool-toolbar > label { min-height: 30px; display: inline-flex; align-items: center; gap: 5px; }
.tool-toolbar .toolbar-label { padding-right: 4px; color: #71819a; font-size: 10.5px; font-weight: 700; }
.tool-toolbar .ctl-sep { background: #dce4ee; margin: 0 2px; }
.tool-toolbar label { white-space: nowrap; }
.tool-toolbar label:has(input[type="checkbox"]:checked) { color: #2946aa; }
.tool-toolbar select { min-height: 30px; padding: 3px 8px; }
.tool-toolbar #profile-btn { border-color: #aab9cf; background: #f6f8fb; }
.toggle-critical { color: #b33243; }

#statusline { padding: 8px 24px; color: #5f7088; font-size: 11px; }
#statusline code { background: #e9eef8; border-radius: 4px; color: #354a72; }
#showmode-banner { margin: 10px 24px 0; }
#gantt-wrap, #board-wrap, #screen-wrap { margin: 0 24px; border: 1px solid var(--ui-line); border-radius: var(--ui-radius); background: #fff; box-shadow: var(--ui-shadow); }
#screen-wrap { padding: 20px; }
.gantt-header { background: #f8fafd; border-bottom-color: var(--ui-line); }
.g-label.head { background: #f8fafd; border-right-color: var(--ui-line); color: #4d607c; font-size: 11px; text-transform: uppercase; letter-spacing: .065em; }
.tier-cell { border-left-color: #edf1f6; color: #7888a0; }
.tier-cell.top { color: #334665; border-left-color: #dce3ed; }
.tier-cell.weekend, .weekend-bg { background: #f7f9fc; }
.labels { border-right-color: var(--ui-line); }
.g-label { border-bottom-color: #edf1f6; }
.g-label.group { background: #f7f9fc; color: #233553; }
.g-label.section, .g-track-row.section { background: #eef3f9; color: #425574; }
.g-label .key { color: #4564b1; font-weight: 650; }
.g-label:hover { background: #f7f9ff; }
.g-track-row { border-bottom-color: #edf1f6; }
.bar { box-shadow: inset 0 0 0 1px rgba(34, 54, 93, .07); font-weight: 600; }
.bar.st-inprogress { background: #bcd0fa; color: #203e7c; }
.bar.st-done { background: #b8e9d3; color: #176747; }
.bar.st-queue { background: #e8edf5; color: #42536b; border-color: #cfdae7; }
.bar.rollup { box-shadow: none; background: #bbc9db; }
.bar.baseline { box-shadow: none; }
.drop-line { background: var(--ui-blue); }
.g-label.drop-into { outline-color: var(--ui-blue); background: #edf1ff; }
.row-actions { box-shadow: -10px 0 8px #fff; }
.row-action, .add-btn { color: #2f4fc4; }

.screen-head { justify-content: space-between; margin-bottom: 14px; }
.screen-head h2 { font-size: 20px; line-height: 1.2; letter-spacing: -.025em; color: #17233b; }
.screen-head .muted { color: #75849a; }
.dash-controls, .dash-add, .flow-filters { padding: 10px 12px; border: 1px solid #e3e9f2; border-radius: 8px; background: #f8fafd; }
.dash-grid { gap: 12px; }
.dash-widget, .flow-card, .flow-compare { border: 1px solid var(--ui-line); border-radius: 9px; background: #fff; box-shadow: var(--ui-shadow); }
.dash-widget { padding: 16px 18px; }
.dash-widget:hover, .flow-card:hover { border-color: #bccbe3; }
.dash-widget-head h3 { color: #263956; font-size: 13px; }
.widget-name { color: #465a78; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.widget-value { color: #1b2d53; letter-spacing: -.04em; }
.dash-bar-track { background: #e7edf8; }
.dash-bar-track i { background: #5978db; }
.flow-metrics { border-top-color: var(--ui-line); }
.flow-card h4, .flow-compare h3 { color: #263956; }
.flow-card strong, .flow-compare strong { color: #1c315f; }
.flow-source, .flow-audit { background: #eff3fa; color: #526786; }
.dash-share-box { border-color: #b9c7ee; background: #f4f6ff; }
.empty-state { max-width: 540px; margin: 30px auto; padding: 42px 28px; border: 1px dashed #bac8df; border-radius: 12px; background: #f9fbff; }
.empty-state h2 { color: #233858; }

.dir-scroll, .hm-scroll { border: 1px solid var(--ui-line); border-radius: 9px; }
.dir-table th { position: sticky; top: 0; z-index: 2; padding: 9px 10px; border-bottom: 1px solid #dce3ed; background: #f5f8fc; color: #49607d; font-size: 11px; font-weight: 750; letter-spacing: .02em; }
.dir-table td { padding: 9px 10px; border-bottom-color: #edf1f6; }
.dir-table tr:nth-child(even) td { background: #fbfcfe; }
.dir-table tr:hover td { background: #eef3ff; }
.dir-profile { color: #3150b9; font-weight: 650; }
.colpop { border-color: var(--ui-line); background: #f9fbfe; }
.hm-grid { padding: 12px; }
.hm-row.hm-head { color: #73849c; font-weight: 650; }
.hm-person { color: #273a59; }
.hm-row:not(.hm-head):hover .hm-person { background: #f2f5fc; }
.hm-cell { border-radius: 6px; }
.hm-cell.hm-active { background: #199766; }
.hm-cell.hm-epic { background: #c4e9db; color: #176747; }
.hm-cell.hm-idle { background: #eef1f5; color: #697b92; }
.hm-cell.hm-absent { background: #fff0c2; color: #9b6116; }
.hm-cell.hm-out { background: #e5e9ef; color: #64748b; }

.board-col { border: 1px solid #e8edf4; background: #f5f8fc; }
.board-col-head { color: #344a69; }
.board-card { border-color: var(--ui-line); border-radius: 8px; box-shadow: var(--ui-shadow); }
.board-card:hover { border-color: #b4c3e4; box-shadow: 0 3px 10px rgba(25, 44, 87, .08); }
#card-drawer, #side-panel { border-left-color: var(--ui-line); box-shadow: -8px 0 32px rgba(19, 35, 66, .12); }
.card-tabs { border-bottom-color: var(--ui-line); }
.card-tab.active { color: #2d4ec1; border-bottom-color: var(--ui-blue); }
#profile-pop, #snapshot-pop, #risks-panel, #history-panel { border-color: var(--ui-line); border-radius: 10px; box-shadow: 0 14px 40px rgba(20, 37, 68, .15); }
#hint-pop { margin: 12px 24px; border: 1px solid #354b75; background: #203251; box-shadow: 0 10px 26px rgba(23, 40, 76, .16); }
.hint-target { outline-color: #4a67d7; }
.process-note { margin: 8px 24px; border-color: #c8d5ef; background: #f1f5ff; color: #354b6c; }
.process-note strong { color: #2f4ca0; }
.legend { padding: 10px 24px; color: #62748b; }
.footnote { margin: 0 24px 12px; border-color: #e7d8a1; background: #fffbed; }

@media (max-width: 900px) {
  .workspace-header, .title-row, .tool-toolbar { padding-left: 14px; padding-right: 14px; }
  .workspace-status { display: none; }
  .title-row { align-items: flex-start; }
  #views { justify-content: flex-start; }
  .tool-toolbar .ctl-sep { display: none; }
  #gantt-wrap, #board-wrap, #screen-wrap { margin-left: 12px; margin-right: 12px; }
  #screen-wrap { padding: 14px; }
  .legend { padding-left: 12px; padding-right: 12px; }
  .process-note, #hint-pop { margin-left: 12px; margin-right: 12px; }
}
@media (max-width: 600px) {
  .tool-toolbar { gap: 7px; }
  .tool-toolbar > span:not(.ctl-sep) { flex-wrap: wrap; }
  .toolbar-label { width: 100%; }
  .view-btn { max-width: 100%; }
  .screen-head h2 { font-size: 18px; }
  .dash-grid, .flow-cards, .trans-cols { grid-template-columns: 1fr; }
  .dash-widget.wide { grid-column: auto; }
}
@media (prefers-reduced-motion: reduce) {
  button { transition: none; }
  #card-drawer, #side-panel, #toast { transition: none; }
}

/* TypeUI Enterprise's dark cloud-platform palette. */
:root {
  color-scheme: dark;
  --ui-ink: #f4f7fb;
  --ui-muted: #aab7c9;
  --ui-line: #2b3545;
  --ui-surface: #111722;
  --ui-canvas: #090d15;
  --ui-blue: #0c5cab;
  --ui-blue-dark: #0a4a8a;
  --ui-blue-soft: #183b61;
  --ui-shadow: 0 1px 2px rgba(0,0,0,.2), 0 8px 24px rgba(0,0,0,.12);
}
html { color-scheme: dark; }
body { font-family: 'IBM Plex Sans', 'Noto Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; color: var(--ui-ink); background: var(--ui-canvas); }
input, select, textarea { color: #f4f7fb; accent-color: #58a8ff; }
select, input:not([type="checkbox"]):not([type="radio"]), textarea,
.dash-controls input, .dash-controls select, .dash-add input, .dash-add select,
.dash-tql input, .flow-filters input, .flow-filters select, .flow-compare select {
  background: #141e2e; border-color: #3a4a62; color: #f4f7fb;
}
input::placeholder, textarea::placeholder { color: #92a1b7; }
select:hover, input:not([type="checkbox"]):not([type="radio"]):hover, textarea:hover { border-color: #7991b3; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible { outline-color: #78b5ff; }
.topbar { background: #111722; border-bottom-color: #344054; box-shadow: 0 3px 18px rgba(0,0,0,.12); }
.workspace-header, .title-row { border-bottom-color: #263243; }
.brand-mark { background: linear-gradient(145deg, #0c5cab, #173870); box-shadow: inset 0 1px 0 rgba(255,255,255,.16), 0 4px 14px rgba(0,0,0,.2); }
.brand-name, h1, .screen-head h2 { color: #f8fafc; }
.brand-name span { color: #9bb6d4; border-color: #40516a; }
.crumbs, .page-eyebrow, .workspace-status { color: #a9b7c9; }
.workspace-status span { background: #10b981; box-shadow: 0 0 0 3px #123e36; }
.tool-toolbar { background: #151d2a; color: #c8d2df; }
.tool-toolbar .toolbar-label { color: #a8b8cd; }
.tool-toolbar .ctl-sep { background: #3d4b60; }
.tool-toolbar label:has(input[type="checkbox"]:checked) { color: #b4d7ff; }
.view-btn, .chip-btn, .row-action, .add-btn { background: #1b2636; border-color: #405068; color: #e6edf5; box-shadow: 0 1px 1px rgba(0,0,0,.14); }
.view-btn:hover, .chip-btn:hover, .row-action:hover, .add-btn:hover { background: #233754; border-color: #6684ae; color: #fff; }
.view-btn.active { background: #0c5cab; border-color: #2681d4; color: #fff; }
.chip-btn.active { background: #17436c; border-color: #3982c2; color: #e6f3ff; box-shadow: inset 0 0 0 1px rgba(115,184,255,.12); }
.tool-toolbar #profile-btn { background: #243550; border-color: #597393; }
.chip-btn.primary, .hint-btns .chip-btn.primary { background: #0c5cab; border-color: #3c9af0; color: #fff; }
.chip-btn.primary:hover, .hint-btns .chip-btn.primary:hover { background: #0a4a8a; border-color: #64b3ff; }
#statusline { color: #b7c5d7; }
#statusline code { background: #263550; color: #d4e6ff; }
#gantt-wrap, #board-wrap, #screen-wrap, .dir-scroll, .hm-scroll { background: #121a27; border-color: #303d4f; box-shadow: var(--ui-shadow); }
.gantt-header, .g-label.head { background: #1d2939; color: #d7e1ee; border-color: #3a4759; }
.tier-cell { color: #b6c4d5; border-left-color: #344154; }
.tier-cell.top { color: #e3ebf5; border-left-color: #46546a; }
.tier-cell.weekend, .weekend-bg { background: #1a2331; }
.labels { background: #121a27; border-right-color: #394759; }
.g-label { background: #151e2c; color: #e8edf5; border-bottom-color: #2c394b; }
.g-label.group { background: #202c3d; color: #f6f8fc; }
.g-label.section, .g-track-row.section { background: #26374c; color: #e3ebf5; }
.g-label .key, .g-label .title { color: #c7dcff; }
.g-label .muted, .muted { color: #a8b6c9; }
.g-label:hover, .g-label.drop-into { background: #253a59; }
.g-track-row { border-bottom-color: #2b384b; }
.bar.st-inprogress { background: #214a87; color: #f1f7ff; border: 1px solid #4b82c7; }
.bar.st-done { background: #165f50; color: #e4fff4; border: 1px solid #349579; }
.bar.st-queue { background: #34455e; color: #f4f7fc; border-color: #667c9a; }
.bar.rollup { background: #71849d; }
.bar.estimate { background: repeating-linear-gradient(45deg,#283548 0 6px,#35445b 6px 12px); color: #f0f5fc; border-color: #90a1b8; }
.bar.risk, .bar.absence { background: repeating-linear-gradient(45deg,#674518 0 8px,#765322 8px 16px); color: #fff3d6; border-color: #e4a442; }
.bar.baseline, .bar.fact { background: #a9b8ce; }
.bar.fact { color: #121a27; }
.bar-note, .tier-cell, .g-label .reason { color: #c8d5e5; }
.status.st-done, .tag.shared { background: #173f38; color: #a3efd1; }
.status.st-inprogress { background: #173b6b; color: #bad9ff; }
.status.st-queue, .tag.title-only { background: #324056; color: #e0e7f0; border-color: #60738d; }
.tag.overdue, .tag.conflict { background: #552838; color: #ffd5dc; border-color: #e57a8b; }
.tag.risk { background: #5b3b1d; color: #ffe0a1; border-color: #e2a043; }
.est { border-color: #60718a; color: #d5e0ef; }
.row-actions { background: #182435; box-shadow: -10px 0 8px #182435; }
.row-action { color: #c2dcff; }
.board-col, .dash-controls, .dash-add, .flow-filters { background: #192333; border-color: #354259; }
.board-col-head, .dash-widget-head h3, .flow-card h4, .flow-compare h3 { color: #e6edf7; }
.board-card, .dash-widget, .flow-card, .flow-compare, .empty-state { background: #1b2636; border-color: #35435a; color: #e8eef7; box-shadow: var(--ui-shadow); }
.board-card:hover, .dash-widget:hover, .flow-card:hover { border-color: #6485b3; }
.widget-name, .dash-duo span { color: #b8c9dd; }
.widget-value, .flow-card strong, .flow-compare strong { color: #f6f9ff; }
.dash-bar-track { background: #354661; }
.dash-bar-track i { background: #4f98e8; }
.dash-tql, .flow-card p, .flow-compare p, .flow-filters label { color: #c2cfdf; }
.flow-metrics { border-top-color: #39475b; }
.flow-source, .flow-audit, .dash-share-box { background: #21324b; border-color: #466082; color: #d6e7fb; }
.empty-state h2 { color: #f1f6ff; }
.empty-state p { color: #bbcade; }
.dir-table th { background: #213047; border-color: #42536c; color: #e3ecfa; }
.dir-table td { background: #172131; color: #edf2f8; border-color: #2f3c50; }
.dir-table tr:nth-child(even) td { background: #1b2738; }
.dir-table tr:hover td { background: #284063; }
.dir-profile { color: #9ccaff; }
.mask { color: #aebcd0; }
.colpop { background: #202e42; border-color: #42536b; }
.hm-person { background: #172131; color: #f0f4fa; }
.hm-row:not(.hm-head):hover .hm-person { background: #263b58; }
.hm-row.hm-head, .hm-total { color: #bdccdf; }
.hm-cell.hm-active { background: #107c5b; color: #fff; }
.hm-cell.hm-epic { background: #235942; color: #e4fff3; }
.hm-cell.hm-idle { background: #303c4b; color: #e5edf7; }
.hm-cell.hm-absent { background: #69501f; color: #fff0c1; }
.hm-cell.hm-out { background: #35404f; color: #d5deeb; }
#card-drawer, #side-panel, #profile-pop, #snapshot-pop, #risks-panel, #history-panel { background: #172131; border-color: #42516a; color: #ecf3fc; box-shadow: -8px 0 32px rgba(0,0,0,.32); }
.card-tab { color: #c1cede; }
.card-tab.active { color: #a9d4ff; border-bottom-color: #4c9ce9; }
.card-grid, .card-body, .hist-entry { color: #d9e3ef; }
#hint-pop { background: linear-gradient(145deg,#183761,#122741); border-color: #447bb9; color: #fff; }
.hint-head, .hint-text { color: #d7e5f6; }
.process-note { background: #1b334d; border-color: #426892; color: #dceaff; }
.process-note strong { color: #c4e0ff; }
.legend, .footnote { color: #c0ccda; }
.footnote { background: #3b311e; border-color: #8e733e; color: #ffedc1; }
#showmode-banner, .frozen-banner { background: #4b351e; border-color: #ac7840; color: #ffdfaf; }
.flow-audit, .audit-summary, .frozen-sheet { color: #dce7f5; }
.dash-load-table th, .dash-load-table td { border-color: #43526a; }
.dash-load-table th:first-child { background: #27364a; }
.dash-load-normal { background: #195642; color: #e6fff5; }
.dash-load-full { background: #5b4b1f; color: #fff1bf; }
.dash-load-overload { background: #693620; color: #ffe0ca; }
.dash-load-absent { background: #37465c; color: #e5edfa; }
@media (pointer: coarse) {
  .view-btn, .chip-btn, .row-action, .add-btn, .card-tab { min-height: 44px; }
  .tool-toolbar select, .tool-toolbar input:not([type="checkbox"]) { min-height: 44px; }
}

.gantt-controls { display: contents; }
.gantt-controls > span:not(.ctl-sep), .gantt-controls > label { min-height: 30px; display: inline-flex; align-items: center; gap: 5px; }
body:not([data-mode="gantt"]) [data-gantt-controls] { display: none; }
body:not([data-mode="gantt"]):not([data-mode="board"]) [data-ticket-views] { display: none; }
body:not([data-mode="gantt"]):not([data-mode="board"]) #statusline { display: none; }
.dash-filter-help { flex-basis: 100%; margin: 2px 0 0; color: #c2cfdf; font-size: 12px; }
.dash-filter-help code { display: inline-block; padding: 2px 5px; border-radius: 4px; color: #e7f1ff; background: #273b56; }
.dash-filter-help .chip-btn { margin-right: 6px; }
#shift-preview { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 8px 24px 12px; padding: 12px 16px; border: 1px solid #547dad; border-radius: 9px; background: #1d3652; color: #e5f1ff; box-shadow: var(--ui-shadow); }
#shift-preview[hidden] { display: none; }
#shift-preview > div:first-child { display: grid; gap: 3px; flex: 1 1 320px; }
#shift-preview .shift-preview-actions { display: flex; flex-wrap: wrap; gap: 8px; }
#shift-preview .chip-btn { flex: none; }
#toast.success { background: #12684f; color: #fff; }
@media (max-width: 900px) { #shift-preview { margin-left: 12px; margin-right: 12px; } }

/* Readable data surfaces and bounded floating panels. */
.dash-widget, .flow-card, .trans-cols > *, .screen-head > * { min-width: 0; overflow-wrap: anywhere; }
.dash-widget-head { padding-right: 24px; }
.dash-bar-row span, .hm-person { white-space: normal; overflow-wrap: anywhere; }
.hm-person { line-height: 1.4; }
.dir-table td { white-space: normal; min-width: 8ch; }
#card-drawer, #side-panel, #history-panel, #profile-pop, #snapshot-pop,
#risks-panel { max-width: calc(100vw - 24px); max-height: 90vh; overflow: auto; }
#risks-panel { right: 12px; }
.bar-text { overflow: hidden; min-width: 0; white-space: nowrap; }
.tracks, .tiers { transform: translateX(var(--zoom-offset, 0px)); }
#toggle-risks { color: #ffcf8c; background: #372b20; }
.today-line span { top: 38px; color: #ffacac; background: #192333; padding: 0 3px; font-size: 12px; }

/* Compact enterprise workspace. One scrolling timeline; navigation stays in view. */
:root { --gantt-row-height: 46px; --ui-radius: 6px; }
body { font-size: 13px; }
.app { height: 100dvh; min-height: 0; overflow: hidden; }
.topbar { position: relative; z-index: 45; flex: none; max-height: none; overflow: visible; }
.workspace-header { display: flex; min-height: 52px; padding: 8px 20px; gap: 12px; }
.brand-mark { width: 30px; height: 30px; border-radius: 6px; background: #125b9b; box-shadow: none; }
.brand-copy { flex: none; }
.crumbs { font-size: 10px; margin-top: 4px; }
.view-tabs { display: flex; align-items: center; gap: 4px; margin-left: 24px; overflow-x: auto; min-width: 0; }
.view-tabs .chip-btn { border-color: transparent; background: transparent; box-shadow: none; border-radius: 4px; white-space: nowrap; font-size: 12px; padding: 4px 10px; }
.view-tabs .chip-btn.active { background: #203751; color: #cce6ff; border-color: #365474; }
#profile-btn { margin-left: auto; flex: none; font-size: 12px; }
.title-row { padding: 8px 20px; min-height: 52px; justify-content: flex-start; gap: 16px; flex-wrap: nowrap; }
.page-heading { display: flex; align-items: baseline; gap: 12px; flex: none; }
h1 { font-size: 20px; line-height: 1.2; }
.page-eyebrow { font-size: 11px; font-weight: 400; letter-spacing: 0; color: #9caec4; }
.workspace-actions { margin-left: auto; display: flex; gap: 8px; flex: none; }
.chip-btn, .view-btn { min-height: 30px; border-radius: 4px; font-size: 12px; padding: 4px 8px; }
.chip-btn:active, .view-btn:active { background: #2b4564; }
.tool-toolbar { padding: 8px 20px; gap: 12px; min-height: 46px; position: static; flex-wrap: wrap; font-size: 12px; }
.tool-toolbar label { font-size: 12px; white-space: nowrap; }
.tool-toolbar select { min-height: 28px; padding: 2px 6px; font-size: 12px; }
.zoom-strip { position: static; display: inline-flex; justify-content: flex-start; height: auto; padding: 0; border: 0; background: transparent; gap: 0; }
.zoom-strip .chip-btn { border-radius: 0; margin-left: -1px; min-width: 30px; font-size: 12px; }
.zoom-strip .chip-btn:first-child { border-radius: 4px 0 0 4px; margin-left: 0; }
.zoom-strip .chip-btn:last-child { border-radius: 0 4px 4px 0; }
#zoom-tools { display: block; }
.workspace-settings, .view-picker { position: relative; }
.workspace-settings { margin-left: auto; }
.workspace-settings summary, .view-picker summary { cursor: pointer; list-style: none; white-space: nowrap; }
.workspace-settings summary::-webkit-details-marker, .view-picker summary::-webkit-details-marker { display: none; }
.workspace-settings summary::after, .view-picker summary::after { content: '⌄'; margin-left: 8px; color: #9eb5d0; }
.workspace-settings[open] > summary { border-color: #6c99c8; background: #203b58; }
.settings-content, #views { position: absolute; z-index: 3; top: calc(100% + 8px); padding: 12px; border: 1px solid #43536a; border-radius: 6px; background: #172231; box-shadow: 0 12px 28px rgba(0,0,0,.22); }
.settings-content { right: 0; width: 360px; max-height: min(560px, 70dvh); overflow: auto; display: grid; gap: 12px; }
.settings-content fieldset { min-width: 0; margin: 0; padding: 12px; border: 1px solid #34445b; border-radius: 4px; display: grid; gap: 12px; }
.settings-content legend { padding: 0 4px; color: #afc6e0; font-size: 11px; font-weight: 600; }
.settings-content label { display: flex; align-items: center; gap: 8px; white-space: normal; flex-wrap: wrap; }
.settings-content select { min-width: 0; max-width: 100%; }
#shift-threshold { width: 56px; }
.toolbar-group { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.view-picker { min-width: 0; }
.view-picker summary { padding: 4px 8px; border: 1px solid #3d4f68; border-radius: 4px; color: #d2e4fa; font-size: 12px; overflow: hidden; text-overflow: ellipsis; }
#views { left: 0; width: 300px; display: grid; gap: 4px; }
#views .view-btn { text-align: left; width: 100%; border-color: transparent; background: transparent; }
#views .view-btn:hover { background: #203851; }
#views .view-btn.active { background: #17436c; }
#statusline { order: 0; padding: 6px 20px; height: 30px; flex: none; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 11px; }
#gantt-wrap, #board-wrap, #screen-wrap { flex: 1 1 0; min-height: 0; height: auto; margin: 0 16px; border-radius: 6px; box-shadow: none; }
#gantt-wrap { isolation: isolate; }
#screen-wrap { overflow: auto; padding: 16px; }
#board-wrap { overflow: auto; }
#gantt-scroll { overscroll-behavior: contain; scrollbar-width: none; }
#gantt-scroll::-webkit-scrollbar { display: none; }
#gantt-scroll.is-panning, #gantt-scroll.is-panning * { cursor: grabbing; user-select: none; }
.gantt-pan-tip { margin-left: 18px; font-size: 12px; color: var(--ui-muted); }
@media (pointer: coarse), (max-width: 700px) { .gantt-pan-tip { display: none; } }
.labels, .g-label.head { position: sticky; left: 0; }
.g-label:not(.head) { height: var(--gantt-row-height); line-height: 18px; padding: 4px 10px; white-space: normal; overflow: hidden; font-size: 12px; }
.g-label .muted, .g-label .key, .status, .tag, .est { font-size: 11px; }
.g-label.section { display: flex; align-items: center; }
.g-track-row { height: var(--gantt-row-height); }
.g-label.head, .tier-cell { font-size: 11px; }
.legend { flex: none; order: 0; padding: 6px 20px; font-size: 10px; gap: 12px; max-height: 44px; overflow: auto; }
.legend .item { white-space: nowrap; }
.footnote { display: none; }
.workspace-footer { display: flex; align-items: center; justify-content: space-between; padding: 2px 16px; flex: none; }
.workspace-footer #toggle-history { position: static; margin: 0 0 0 auto; min-height: 26px; box-shadow: none; }
.app > .legend { padding-right: 150px; }
#process-slot { flex: none; }
.process-note { margin: 4px 20px; padding: 4px 8px; font-size: 11px; display: flex; gap: 8px; align-items: center; }
.process-note .chip-btn { min-height: 24px; padding: 2px 6px; font-size: 11px; }
#onboarding-slot { flex: none; }
#hint-pop { position: fixed; z-index: 60; bottom: 48px; right: 20px; width: min(380px, calc(100vw - 40px)); margin: 0; }
.hint-text { font-size: 12px; }
#shift-preview { flex: none; padding: 8px 12px; margin: 4px 16px 8px; font-size: 12px; }
.date-editor { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; margin: 12px 0; padding: 12px; border: 1px solid #3b4d64; border-radius: 6px; background: #162334; }
.date-editor label { display: grid; gap: 4px; font-size: 12px; }
.date-editor input { padding: 4px 8px; max-width: 100%; }
.dependency-link { border: 0; background: transparent; color: #9ccaff; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; padding: 4px; }
.dependency-link:hover { color: #d6eaff; background: #203b58; }
.drag-date-hint { position: fixed; z-index: 70; pointer-events: none; padding: 8px 12px; border: 1px solid #7da4d1; border-radius: 4px; background: #172b44; color: #f1f7ff; font-size: 12px; box-shadow: 0 4px 16px rgba(0,0,0,.2); }
.bar:focus-visible { outline: 2px solid #a8d2ff; outline-offset: 3px; z-index: 5; }
@media (max-width: 1100px) {
  .page-eyebrow { display: none; }
  .workspace-header, .title-row, .tool-toolbar { padding-left: 12px; padding-right: 12px; }
  .view-tabs { margin-left: 8px; }
  .view-tabs .chip-btn { padding-inline: 6px; }
  .tool-toolbar { gap: 8px; }
}
@media (max-width: 700px) {
  .app { min-width: 320px; }
  body[data-mode="gantt"] .topbar, body[data-mode="gantt"].tools-open .topbar { display: block; position: relative; inset: auto; max-height: none; }
  .workspace-header { flex-wrap: wrap; gap: 8px; }
  .view-tabs { flex: 1 0 100%; order: 2; margin: 0; }
  .title-row { gap: 8px; flex-wrap: wrap; }
  .workspace-actions { gap: 4px; }
  .workspace-actions .chip-btn { font-size: 11px; }
  .view-picker { max-width: calc(100% - 68px); }
  .tool-toolbar { gap: 8px; }
  .tool-toolbar > label { font-size: 11px; }
  .zoom-strip { gap: 0; }
  .zoom-strip .chip-btn { padding-inline: 6px; font-size: 11px; }
  .settings-content { width: min(360px, calc(100vw - 24px)); }
  #gantt-wrap, #board-wrap, #screen-wrap { margin-inline: 8px; }
  #statusline { padding-inline: 12px; }
  .process-note { margin: 4px 8px; }
  .legend { max-height: 30px; }
  .app > .legend { padding-right: 12px; }
  .workspace-footer { padding-inline: 8px; }
}
@media (max-height: 600px) {
  .workspace-header { min-height: 40px; padding-block: 4px; }
  .title-row { min-height: 40px; padding-block: 4px; }
  .tool-toolbar { min-height: 40px; padding-block: 4px; }
  .process-note { display: none; }
}
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.gantt-search { display: flex; align-items: center; gap: 8px; margin-left: auto; min-width: 100px; }
.gantt-search input { width: 180px; min-width: 0; padding: 4px 8px; font-size: 12px; }
.gantt-search output { color: #a9c7e9; font-size: 11px; white-space: nowrap; }
.gantt-search + .workspace-actions { margin-left: 0; }
.g-label.search-match { background: #294968; box-shadow: inset 3px 0 #8ac3ff; }
@media (max-width: 1100px) { .gantt-search input { width: 140px; } }
@media (max-width: 850px) { .gantt-search { order: 2; flex: 1; margin: 0; } .gantt-search input { width: 100%; } .workspace-actions { margin-left: auto; } .title-row { flex-wrap: wrap; } }
/* Keep complete status labels and readable secondary actions at laptop widths. */
.status, .tag, .est { display: inline-block; white-space: nowrap; vertical-align: baseline; line-height: 16px; }
.g-label { overflow-wrap: normal; }
.g-label .muted, .g-label .key, .status, .tag, .est { font-size: 12px; }
.g-label:not(.head) { line-height: 18px; }
.view-tabs .chip-btn, .chip-btn, .view-btn, .tool-toolbar label, .tool-toolbar select, .zoom-strip .chip-btn { font-size: 12px; }
.g-label.head, .tier-cell, #statusline, .legend, .process-note, .process-note .chip-btn, #toggle-history { font-size: 12px; }
.gantt-header { min-width: 100%; }
.title-row { flex-wrap: wrap; }
.page-heading { min-width: 0; }
.gantt-search input { width: clamp(120px, 12vw, 180px); }
@media (max-width: 1280px) {
  .page-eyebrow { display: none; }
  .title-row { gap: 12px; }
  .view-picker { max-width: 240px; }
}
@media (max-width: 850px) { .gantt-search input { width: 100%; } }
#hint-disclosure { flex: none; }
#hint-disclosure > summary { display: none; }
#hint-disclosure:not(:has(#hint-pop)) { display: none; }
@media (max-width: 700px) {
  #hint-disclosure { margin: 4px 8px; border: 1px solid #3e5878; border-radius: 4px; background: #172a43; }
  #hint-disclosure > summary { display: list-item; cursor: pointer; padding: 6px 12px; font-size: 12px; color: #cce2ff; }
  #hint-pop { position: static; width: auto; max-width: none; margin: 0; padding: 8px 12px; border: 0; box-shadow: none; border-radius: 0; }
  #hint-pop .hint-head { display: none; }
  #hint-pop .hint-title { font-size: 12px; margin-bottom: 4px; }
  #hint-pop .hint-text { font-size: 12px; line-height: 1.4; }
  #hint-pop .hint-btns { margin-top: 8px; gap: 4px; }
  #hint-pop .chip-btn { min-height: 28px; font-size: 11px; padding: 4px 6px; }
  .workspace-actions { flex-wrap: wrap; }
}
.settings-content fieldset[hidden] { display: none; }
.labels .g-label { width: 100%; }
#statusline { display: flex; align-items: center; gap: 12px; overflow: visible; position: relative; z-index: 44; }
.selection-summary { overflow: hidden; text-overflow: ellipsis; }
.selection-diagnostics { margin-left: auto; flex: none; }
.selection-diagnostics > summary { cursor: pointer; color: #a9c9ec; }
.selection-diagnostics > div { position: absolute; right: 16px; top: 100%; max-width: min(520px, calc(100vw - 32px)); padding: 12px; white-space: normal; overflow-wrap: anywhere; border: 1px solid #425770; border-radius: 6px; background: #162436; box-shadow: 0 8px 24px rgba(0,0,0,.2); line-height: 1.8; }
.settings-content .process-note { margin: 0; padding: 0; border: 0; background: transparent; flex-wrap: wrap; align-items: start; }
.settings-content .process-note textarea, .settings-content .process-note input { width: 100%; }
body:has(.workspace-settings[open]) #hint-disclosure { visibility: hidden; }
.task-primary { display: flex; align-items: baseline; gap: 6px; min-width: 0; line-height: 18px; }
.task-primary .title, .task-primary b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-weight: 600; }
.task-primary .key { flex: none; font-size: 11px; color: #9db2cc; }
.task-secondary { display: flex; align-items: center; gap: 6px; min-width: 0; padding-left: 18px; line-height: 18px; }
.task-secondary .owner { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #acbbce; font-size: 11px; }
.task-secondary .status, .task-secondary .est { flex: none; margin-left: auto; }
.task-secondary .est { margin-left: 0; }
.g-label:has(.task-primary) { display: grid; grid-template-columns: 16px minmax(0, 1fr); grid-template-rows: 18px 18px; column-gap: 4px; align-content: center; }
.g-label > .task-primary { grid-column: 2; grid-row: 1; }
.g-label > .task-secondary { grid-column: 2; grid-row: 2; padding-left: 0; overflow: hidden; }
.g-label > .expander, .g-label > .grip { grid-column: 1; grid-row: 1 / 3; align-self: center; }
.task-secondary .muted { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.task-secondary .tag { overflow: hidden; text-overflow: ellipsis; max-width: 75%; margin-left: auto; }
@media (max-width: 700px) {
  .g-label:has(.task-primary) { grid-template-columns: 10px minmax(0, 1fr); gap: 0 2px; padding-inline: 4px; }
  .task-primary { gap: 4px; }
  .task-secondary { gap: 4px; }
  .task-secondary .est { display: none; }
  .task-secondary .status { max-width: 70%; overflow: hidden; text-overflow: ellipsis; }
}
.toggle-critical { color: #efacb4; }
summary:focus-visible { outline: 2px solid #78b5ff; outline-offset: 3px; border-radius: 4px; }

.calendar-column { position: absolute; inset-block: 0; border-left: 1px solid #243244; pointer-events: none; }
.gantt-legend { position: relative; flex: none; margin: 0; padding-block: 4px; width: max-content; color: #c9d6e7; font-size: 12px; }
.gantt-legend summary { cursor: pointer; padding: 3px 0; }
.legend-entries { position: absolute; z-index: 34; left: 0; bottom: 100%; display: grid; gap: 8px; min-width: 220px; padding: 12px 16px; border: 1px solid #43536a; border-radius: 4px; background: #172231; }
.legend-entries span { display: grid; grid-template-columns: 24px auto; gap: 12px; align-items: center; }
.legend-entries i { position: static; height: 12px; width: 24px; padding: 0; pointer-events: none; }
.legend-entries .baseline { height: 4px; }
.legend-entries .milestone { width: 10px; height: 10px; margin-left: 6px; }
.legend-entries .fact-tick, .legend-entries .today-line { width: 3px; height: 14px; margin-left: 9px; }
.g-track-row > .bar:not(.baseline):not(.rollup) { top: calc(50% - 10px); }
.g-track-row > .bar.rollup { top: calc(50% - 5px); }
.g-track-row > .bar.baseline { top: calc(50% + 12px); }
.g-track-row > .milestone { top: calc(50% - 7.5px); }
.g-track-row > .bar-tags { top: calc(50% - 10px); }

/* Transition data keeps whole identifiers and dates inside local scroll areas. */
.trans-cols { grid-template-columns: minmax(600px, 1fr) minmax(1040px, 1.5fr); }
.trans-cols > * { overflow-wrap: normal; }
.trans-table-scroll, .frozen-sheet { max-width: 100%; overflow: auto; overscroll-behavior-inline: contain; scrollbar-color: #50647e #172231; }
.trans-table-scroll:focus-visible, .frozen-sheet:focus-visible { outline: 2px solid #79b7ff; outline-offset: 2px; }
.trans-cols .dir-table { table-layout: auto; }
.trans-cols .dir-table th, .trans-cols .dir-table td { overflow-wrap: normal; word-break: normal; vertical-align: top; line-height: 1.5; }
.trans-checklist { min-width: 480px; }
.trans-audit { min-width: 600px; }
.trans-audit td:first-child, .trans-audit td:nth-child(3), .trans-audit td:last-child { white-space: nowrap; }
.frozen-sheet { opacity: 1; }
.trans-cols .dir-table.frozen { min-width: 1040px; filter: none; }
.trans-cols .frozen td { white-space: nowrap; }
.trans-cols .frozen td:nth-child(2) { min-width: 240px; max-width: 320px; white-space: normal; }
.trans-cols .frozen tr:first-child td { background: #213047; font-weight: 700; }
@media (max-width: 1800px) { .trans-cols { grid-template-columns: minmax(0, 1fr); } }

/* Gantt summary values use the same dark surfaces as the timeline. */
.g-label.absent-count { background: #151e2c; }
.cnt { top: 12px; line-height: 22px; color: #ffd39b; font-variant-numeric: tabular-nums; }
.cnt.zero { color: #a8b6c9; }
.cnt.load-cell.has { color: #e8f1ff; }
.cnt.load-cell.overload { color: #ffe0e6; background: #602b3c; }
.cnt.load-cell.zero-norm { color: #ffedc2; background: #684c20; }
.g-label.absence .reason { color: #ead6ad; }
