/* MuseKai P6 Studio. Reads the SGA ERP design tokens (tokens.css) only: no colours or fonts of its own.
   Colour roles: ink = critical path and where you are; blue = planned work; red = the contract date and what is
   past it; amber = needs a look. Every colour comes with a word. */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: var(--fs-body)/var(--lh-body) var(--font); color: var(--text); background: var(--canvas); min-height: 100vh; }
body.busy { cursor: progress; }
h1, h2, h3, p, ul, dl, dd { margin: 0; }
h1 { font: 700 var(--fs-title)/1.25 var(--font-display); }
h2 { font: 700 var(--fs-section)/1.3 var(--font-display); }
h3 { font: 600 var(--fs-body)/1.4 var(--font); }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; inset-inline-start: 8px; top: -60px; z-index: 50; padding: 8px 14px; background: var(--surface-solid); border-radius: var(--radius-control); }
.skip:focus { top: 8px; }
.grow { flex: 1 1 auto; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: var(--fs-small); }
.code { font-weight: 600; text-decoration: underline; text-decoration-color: color-mix(in srgb, currentColor 40%, transparent); text-underline-offset: 3px; }
.num { text-align: end; font-variant-numeric: tabular-nums; }

/* ---------- controls ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: var(--control-height); padding: 0 14px; border: 1px solid transparent; border-radius: var(--radius-pill); background: var(--btn-bg); color: var(--text); font: 600 var(--fs-small)/1 var(--font); text-decoration: none; cursor: pointer; white-space: nowrap; transition: background var(--t-hover) ease; }
.btn:hover { background: var(--btn-bg-hover); }
.btn.primary { background: var(--primary-bg); color: var(--primary-ink); }
.btn.primary:hover { background: var(--primary-bg-hover); }
.btn.ghost { background: transparent; border-color: var(--control); }
.btn.ghost:hover { background: var(--tonal); }
.btn.small { min-height: 28px; padding: 0 10px; }
.btn.wide { width: 100%; min-height: var(--input-height); }
.btn.warn { color: var(--amber-ink); border-color: var(--amber-mark); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.on-shell { background: var(--shell-3); color: var(--on-shell); }
.btn.on-shell.ghost { background: transparent; border-color: var(--shell-line); color: var(--on-shell-2); }
.btn.on-shell:hover { background: var(--shell-line); color: var(--on-shell); }
.btn.on-shell:focus-visible, .input.on-shell:focus-visible { outline-color: var(--focus-on-shell); }
.input { width: 100%; min-height: var(--input-height); padding: 6px 10px; border: 1px solid var(--control); border-radius: var(--radius-control); background: var(--surface); color: var(--text); font: inherit; }
textarea.input { resize: vertical; min-height: 60px; }
.input.small { min-height: 32px; width: auto; max-width: 100%; padding: 2px 8px; font-size: var(--fs-small); }
.input.num { text-align: end; }
.input:disabled { background: var(--surface-2); color: var(--text-2); }
.input.on-shell { background: var(--shell-2); color: var(--on-shell); border-color: var(--shell-line); width: auto; max-width: min(46vw, 420px); min-height: var(--control-height); }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field label, .inline > span { font-size: var(--fs-small); font-weight: 600; color: var(--text-2); }
.hint { font-size: var(--fs-small); color: var(--text-2); }
.hint.warn { color: var(--amber-ink); }
.hint.neg { color: var(--red-ink); }
.form-error { color: var(--red-ink); font-size: var(--fs-small); font-weight: 600; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: var(--fs-small); cursor: pointer; min-height: 28px; }
.check input { width: 16px; height: 16px; accent-color: var(--primary); margin: 0; }
.inline { display: inline-flex; align-items: center; gap: 6px; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.row.between { justify-content: space-between; align-items: flex-start; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.grid2 .span2 { grid-column: 1 / -1; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.plain { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: var(--fs-small); }
.note { padding: 12px 14px; border-radius: var(--radius-inner); background: var(--surface-2); color: var(--text-2); }
.note.ok { color: var(--green-ink); background: var(--green-tint); }
.pill { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: var(--radius-pill); font-size: var(--fs-small); font-weight: 600; background: var(--surface-3); color: var(--text); white-space: nowrap; }
.pill.info { background: var(--blue-tint); color: var(--blue-ink); }
.pill.pos { background: var(--green-tint); color: var(--green-ink); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px; border-radius: var(--radius-pill); font-size: var(--fs-small); font-weight: 600; }
.chip .ic { display: inline-grid; place-items: center; width: 15px; height: 15px; border-radius: 50%; border: 1.5px solid currentColor; font-size: 10px; font-weight: 800; line-height: 1; }
.chip.neg { background: var(--red-tint); color: var(--red-ink); }
.chip.warn { background: var(--amber-tint); color: var(--amber-ink); }
.table { width: 100%; border-collapse: collapse; font-size: var(--fs-small); }
.table th { text-align: start; font-weight: 600; color: var(--text-2); padding: 6px 6px; border-block-end: 1px solid var(--line); }
.table th.num, .table td.num { text-align: end; }
.table td { padding: 6px 6px; border-block-end: 1px solid var(--line-soft); vertical-align: middle; }
.scroll-x { overflow-x: auto; max-height: 240px; }
.scroll-x.tall { max-height: 46vh; overflow-y: auto; }
details summary { cursor: pointer; font-size: var(--fs-small); font-weight: 600; color: var(--text-2); }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; font-size: var(--fs-small); }
.kv dt { color: var(--text-2); }

/* ---------- shell ---------- */
.topbar { position: sticky; top: 0; z-index: 30; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 16px; background: var(--shell); color: var(--on-shell); backdrop-filter: blur(var(--blur)); }
.brand { display: inline-flex; align-items: center; gap: 10px; font: 700 15px/1 var(--font-display); margin-inline-end: 8px; }
.brand .mark { display: inline-grid; place-items: center; height: 28px; padding: 0 8px; border-radius: 6px; background: var(--red); color: #fff; font: 800 12px/1 var(--font-display); }
.who { display: inline-flex; flex-direction: column; font-size: var(--fs-small); line-height: 1.25; color: var(--on-shell); text-align: end; }
.who .role { color: var(--on-shell-2); font-size: var(--fs-tiny); }
main { padding: 16px; max-width: 1920px; margin: 0 auto; }
.panel { background: var(--panel-bg); border: 1px solid var(--panel-line); border-radius: var(--radius-card); box-shadow: var(--panel-shadow); min-width: 0; }
.empty { max-width: 520px; margin: 12vh auto; display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.headline { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; margin-block-end: 14px; }
.title-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.headline .meta { color: var(--text-2); font-size: var(--fs-small); margin-block-start: 2px; }
.headline .today { margin-block-start: 8px; font-size: var(--fs-section); max-width: 70ch; }
.headline-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); background: var(--panel-bg); border: 1px solid var(--panel-line); border-radius: var(--radius-card); margin-block-end: 14px; }
.kpi { padding: 14px 18px; min-width: 0; }
.kpi + .kpi { border-inline-start: 1px solid var(--line); }
.kpi-label { color: var(--text-2); font-size: 13px; }
.kpi-value { margin-block-start: 2px; font: 700 22px/1.2 var(--font-figure); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-value small { font: 600 var(--fs-small) var(--font); color: var(--text-2); }
.kpi-note { margin-block-start: 4px; font-size: var(--fs-small); color: var(--text-2); min-height: 20px; }

/* ---------- P6-style workspace: directory bar | window (checks, project, BOQ ...) | Activities ---------- */
:root, html[data-theme="light"] {
  --p6-crit: #D62828; --p6-actual: #1F5FBF; --p6-norm: #2E9B4F; --p6-base: #E8B422; --p6-dd: #1B66D1; --p6-sel: #CFE3FA; --p6-sel-line: #1B66D1;
  --p6-band-0: #FFE680; --p6-band-1: #A8E6A1; --p6-band-2: #BFD9F2; --p6-band-3: #E3E7EC; --p6-band-ink: #15171A;
}
html[data-theme="dark"] {
  --p6-crit: #FF5A5F; --p6-actual: #6BA8FF; --p6-norm: #4CCB7A; --p6-base: #F5B342; --p6-dd: #6BA8FF; --p6-sel: #1D3557; --p6-sel-line: #6BA8FF;
  --p6-band-0: #5C4F12; --p6-band-1: #1F4D2A; --p6-band-2: #1E3A5C; --p6-band-3: #2A2E33; --p6-band-ink: #F3F1EC;
}
.p6 { display: grid; grid-template-columns: 128px minmax(320px, 400px) minmax(0, 1fr); gap: 10px; align-items: start; }
.p6.wide { grid-template-columns: 128px minmax(0, 1fr); }
.tabs { display: flex; }
.dirbar { flex-direction: column; gap: 2px; padding: 6px; position: sticky; top: 68px; background: var(--panel-bg); border: 1px solid var(--panel-line); border-radius: var(--radius-card); }
.dirbar [role=tab], .dirbar .win { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 9px 10px; border: 0; border-radius: 8px; background: none; color: var(--text-2); font: 500 var(--fs-small)/1.2 var(--font); text-align: start; cursor: pointer; }
.dirbar [role=tab]:hover, .dirbar .win:hover { background: var(--tonal); color: var(--text); }
.dirbar [role=tab][aria-selected=true] { background: var(--surface-3); color: var(--text); font-weight: 700; box-shadow: inset 3px 0 0 var(--line-strong); }
html[dir="rtl"] .dirbar [role=tab][aria-selected=true] { box-shadow: inset -3px 0 0 var(--line-strong); }
.tabs .count { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--amber-tint); color: var(--amber-ink); font-size: 11px; font-weight: 700; }
.side { display: flex; flex-direction: column; max-height: calc(100vh - 84px); position: sticky; top: 68px; }
.pane { padding: 16px; overflow-y: auto; display: flex; flex-direction: column; gap: 18px; }
.pane section + section, .pane form + section { padding-block-start: 16px; border-block-start: 1px solid var(--line-soft); }
.question { display: flex; flex-direction: column; gap: 8px; padding-block-end: 16px; border-block-end: 1px solid var(--line-soft); }
.question:last-child { border: 0; padding: 0; }
.question header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.question .for { font-size: var(--fs-small); color: var(--text-2); }
.question .options { display: flex; flex-direction: column; align-items: stretch; gap: 6px; }
.question .options .btn { white-space: normal; text-align: start; justify-content: flex-start; padding-block: 8px; line-height: 1.35; border-radius: var(--radius-control); }
.boq-row { display: flex; flex-direction: column; gap: 8px; padding-block-end: 14px; border-block-end: 1px solid var(--line-soft); }
.boq-head { display: flex; align-items: center; justify-content: space-between; }
.sticky-foot { position: sticky; bottom: -16px; padding: 10px 0; background: var(--surface); justify-content: flex-end; }
html[data-theme="dark"] .sticky-foot { background: var(--surface-solid); }
.log li { display: flex; flex-direction: column; }

/* ---------- Activities window ---------- */
.chart { display: flex; flex-direction: column; min-width: 0; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 8px 12px; border-block-end: 1px solid var(--line); }
.toolbar .layout-name { font-size: var(--fs-small); font-weight: 700; padding-inline-end: 4px; }
.toolbar .zoom { display: inline-flex; gap: 2px; }
.toolbar .zoom .btn { min-width: 30px; padding: 0 8px; }
.menu { position: relative; }
.menu summary { list-style: none; }
.menu summary::-webkit-details-marker { display: none; }
.menu-body { position: absolute; z-index: 20; inset-block-start: calc(100% + 4px); inset-inline-start: 0; min-width: 210px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; background: var(--surface-solid); border: 1px solid var(--line); border-radius: var(--radius-inner); box-shadow: var(--popover-shadow); }
.seg { display: inline-flex; padding: 3px; border-radius: var(--radius-pill); background: var(--track-bg); }
.seg [role=tab] { border: 0; background: none; padding: 5px 14px; border-radius: var(--radius-pill); font: 600 var(--fs-small)/1.2 var(--font); color: var(--text-2); cursor: pointer; }
.seg [role=tab][aria-selected=true] { background: var(--tab-on-bg); color: var(--text); box-shadow: var(--tab-on-shadow); }
.legend { display: flex; flex-wrap: wrap; gap: 4px 16px; padding: 6px 12px; font-size: var(--fs-small); color: var(--text-2); }
.legend-item { display: inline-flex; align-items: center; gap: 6px; }
.swatch { display: inline-block; width: 18px; height: 9px; }
.swatch.crit { background: var(--p6-crit); background-image: repeating-linear-gradient(45deg, transparent, transparent 3px, rgba(255, 255, 255, 0.35) 3px, rgba(255, 255, 255, 0.35) 5px); }
.swatch.norm { background: var(--p6-norm); }
.swatch.actual { background: var(--p6-actual); }
.swatch.plan { background: var(--chart-2); }
.swatch.ms { width: 9px; height: 9px; background: var(--text); transform: rotate(45deg); margin-inline: 4px; }
.swatch.sum { height: 5px; background: var(--text); }
.swatch.base { height: 4px; background: var(--p6-base); }
.swatch.dd { width: 2px; height: 14px; background: var(--p6-dd); margin-inline: 8px; }
.swatch.contract { width: 0; height: 14px; border-inline-start: 2px dashed var(--p6-crit); margin-inline: 8px; }
.gantt { display: grid; grid-template-columns: var(--g-w, 50%) 6px minmax(0, 1fr); grid-template-rows: 40px minmax(0, 1fr); height: clamp(260px, calc(100vh - 400px), 1600px); font-size: 12px; border-block: 1px solid var(--line); }
.g-treegrid { display: contents; }
.g-th { grid-column: 1; grid-row: 1; }
.g-split-top { grid-column: 2; grid-row: 1; }
.g-bh { grid-column: 3; grid-row: 1; }
.g-tb { grid-column: 1; grid-row: 2; }
.g-split { grid-column: 2; grid-row: 2; }
.g-bb { grid-column: 3; grid-row: 2; }
.g-th, .g-bh { overflow: hidden; background: var(--surface-2); border-block-end: 1px solid var(--control); }
/* both panes always carry a horizontal scrollbar, so their heights (and the last row) stay in step */
.g-tb { overflow-x: scroll; overflow-y: hidden; }
.g-bb { overflow: scroll; }
.g-split, .g-split-top { background: var(--line); }
.g-split { cursor: col-resize; touch-action: none; }
.g-split:hover, .g-split:focus-visible { background: var(--p6-sel-line); outline: none; }
.g-row { display: grid; grid-template-columns: var(--g-cols); width: var(--g-tw); height: 24px; align-items: stretch; padding: 0; border: 0; border-block-end: 1px solid var(--line-soft); background: var(--surface); color: inherit; font: inherit; text-align: start; cursor: pointer; }
.g-headrow { height: 39px; font-weight: 700; color: var(--text); background: var(--surface-2); cursor: default; border: 0; }
.g-row .c { display: flex; align-items: center; padding: 0 6px; overflow: hidden; white-space: nowrap; border-inline-end: 1px solid var(--line-soft); min-width: 0; }
.g-row .c.name, .g-row .c.bandname { display: block; line-height: 23px; text-overflow: ellipsis; }
.g-headrow .c { display: block; line-height: 38px; text-overflow: ellipsis; border-inline-end-color: var(--line); }
.g-headrow .hc { border: 0; border-inline-end: 1px solid var(--line); background: none; color: inherit; font: inherit; font-weight: 700; text-align: start; cursor: pointer; padding: 0 6px; }
.g-headrow .hc.n { text-align: end; }
.g-headrow .hc:hover { background: var(--tonal); }
.g-headrow .hc:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.g-row .c.n { justify-content: flex-end; text-align: end; font-variant-numeric: tabular-nums; }
.g-row .c.id { gap: 6px; }
.g-row .bandname { grid-column: 1 / span 2; font-weight: 700; }
.g-row .twist { display: inline-grid; place-items: center; width: 13px; height: 13px; margin-inline-end: 6px; border: 1px solid currentColor; font: 700 11px/1 var(--font); vertical-align: -1px; }
.g-row .twist.lv1 { margin-inline-start: 10px; } .g-row .twist.lv2 { margin-inline-start: 20px; } .g-row .twist.lv3 { margin-inline-start: 30px; }
.g-row.g-band { color: var(--p6-band-ink); font-weight: 700; }
.g-row.g-band .c { border-inline-end-color: transparent; }
.g-row.g-band.l0, rect.g-band.l0 { background: var(--p6-band-0); fill: var(--p6-band-0); }
.g-row.g-band.l1, rect.g-band.l1 { background: var(--p6-band-1); fill: var(--p6-band-1); }
.g-row.g-band.l2, rect.g-band.l2 { background: var(--p6-band-2); fill: var(--p6-band-2); }
.g-row.g-band.l3, rect.g-band.l3 { background: var(--p6-band-3); fill: var(--p6-band-3); }
.g-actrow:hover { background: var(--surface-2); }
.g-actrow.sel { background: var(--p6-sel); box-shadow: inset 0 0 0 1px var(--p6-sel-line); }
.g-row:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--p6-norm); }
.dot.crit { background: var(--p6-crit); }
.dot.ms { border-radius: 0; background: var(--text); transform: rotate(45deg); }
.g-svg { display: block; }
.g-grid { stroke: var(--chart-grid); stroke-width: 1; }
.g-grid.year { stroke: var(--control); }
.g-grid.week { stroke-dasharray: 1 3; }
.g-selrow { fill: var(--p6-sel); }
.g-month { font: 500 11px var(--font); fill: var(--chart-tick); }
.g-year { font: 700 12px var(--font); fill: var(--text); }
.g-bar { fill: var(--p6-norm); stroke: color-mix(in srgb, var(--p6-norm) 60%, #000); stroke-width: 1; }
.g-bar.crit { fill: var(--p6-crit); stroke: color-mix(in srgb, var(--p6-crit) 60%, #000); }
.g-hatch { stroke: rgba(255, 255, 255, 0.35); stroke-width: 1.5; }
.g-bar-hatch { pointer-events: none; }
.g-bar.loe { fill: var(--chart-3); stroke: var(--text-2); }
.g-bar.actual { fill: var(--p6-actual); stroke: color-mix(in srgb, var(--p6-actual) 60%, #000); }
.g-milestone.done { fill: var(--p6-actual); }
.g-bar.query { fill: none; stroke: var(--amber-mark); stroke-width: 2; stroke-dasharray: 3 2; }
.g-base { fill: var(--p6-base); stroke: color-mix(in srgb, var(--p6-base) 60%, #000); stroke-width: 0.5; }
.g-float { stroke: var(--chart-3); stroke-width: 1.5; }
.g-summary { fill: var(--text); }
.g-milestone { fill: var(--text); }
.g-link { fill: none; stroke: var(--text-2); stroke-width: 1; opacity: 0.75; }
.g-link.crit { stroke: var(--p6-crit); opacity: 1; }
.g-datadate { stroke: var(--p6-dd); stroke-width: 2; }
.g-contract { stroke: var(--p6-crit); stroke-width: 1.5; stroke-dasharray: 5 3; }
.g-contract-mark { fill: var(--p6-crit); }
.g-act { cursor: pointer; }
.g-label { font: 500 11px var(--font); fill: var(--text); }
.g-label.strong { font-weight: 700; }
/* Details window */
.details { border-block-start: 3px solid var(--line); min-height: 172px; max-height: 340px; overflow: auto; font-size: var(--fs-small); }
.dtabs { display: flex; gap: 2px; padding: 6px 10px 0; border-block-end: 1px solid var(--control); position: sticky; top: 0; background: var(--surface-solid); z-index: 1; }
.dtabs [role=tab] { padding: 5px 12px; border: 1px solid var(--line); border-block-end: 0; border-radius: 6px 6px 0 0; background: var(--surface-2); color: var(--text-2); font: 600 var(--fs-small)/1.3 var(--font); cursor: pointer; }
.dtabs [role=tab][aria-selected=true] { background: var(--surface); color: var(--text); border-color: var(--control); margin-block-end: -1px; padding-block-end: 6px; }
.dhead { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 12px 0; }
.dhead .dlabel { color: var(--text-2); }
.dhead .chip:not(.neg) { background: var(--surface-3); }
.dpad { padding: 10px 12px 12px; }
.dcols { display: grid; grid-template-columns: minmax(200px, 1.2fr) 1fr 1fr; gap: 12px 28px; align-items: start; }
.dcols.two { grid-template-columns: 1fr 1fr; }
.details h4 { margin: 0 0 4px; font: 700 var(--fs-small)/1.3 var(--font); }
.rel-scroll { max-height: 170px; overflow: auto; }
.details .table td { padding-block: 3px; }
.details .table td.actions { white-space: nowrap; text-align: end; }
.details .table td.actions .btn { margin-inline-start: 4px; }
.details .input.lag { width: 68px; }
.details .input.pick { flex: 1 1 180px; min-width: 140px; }
.details .adder { flex-wrap: wrap; }
.tag { display: inline-block; margin-inline-start: 6px; padding: 0 6px; border-radius: 4px; background: var(--blue-tint); color: var(--blue-ink); font-size: 11px; font-weight: 600; }
.net-wrap { overflow: auto; height: clamp(260px, calc(100vh - 400px), 1600px); border-block: 1px solid var(--line); background: var(--surface-2); }
.net { display: block; }
.nbox { cursor: pointer; }
.nrect { fill: var(--surface); stroke: var(--p6-norm); stroke-width: 2; }
.nbox.crit .nrect { stroke: var(--p6-crit); }
.nbox.done .nrect { stroke: var(--p6-actual); }
.nbox.sel .nrect { fill: var(--p6-sel); stroke-width: 3; }
.nbox:focus-visible { outline: none; } .nbox:focus-visible .nrect { stroke-width: 4; }
.nline { stroke: var(--line); }
.nid { font: 700 12px var(--font); fill: var(--text); }
.nname { font: 600 11px var(--font); fill: var(--text); }
.nmeta { font: 500 10.5px var(--font); fill: var(--text-2); }
#viewScurve { padding: 16px; display: flex; flex-direction: column; gap: 10px; }
#viewScurve .legend { padding: 0; }
.scurve { width: 100%; height: auto; max-width: 980px; }
.sc-plan { fill: none; stroke: var(--chart-2); stroke-width: 2.5; }
.sc-base { fill: none; stroke: var(--chart-4); stroke-width: 2; stroke-dasharray: 6 4; }
.sc-pv { fill: none; stroke: var(--chart-1, #2563eb); stroke-width: 2.2; stroke-dasharray: 4 3; }
.sc-ev { fill: none; stroke: var(--ok, #16a34a); stroke-width: 2.5; }
.sc-ac { fill: none; stroke: var(--bad, #dc2626); stroke-width: 2.5; }
.sc-dot { fill: var(--chart-2); }
.sc-dot-ev { fill: var(--ok, #16a34a); }
.sc-dot-ac { fill: var(--bad, #dc2626); }
.swatch.pv { background: var(--chart-1, #2563eb); }
.swatch.ev { background: var(--ok, #16a34a); }
.swatch.ac { background: var(--bad, #dc2626); }
.scurve-table { max-width: 780px; }

/* ---------- earned value view ---------- */
#viewEvm { padding: 16px; display: flex; flex-direction: column; gap: 14px; overflow-y: auto; }
.evm-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 8px; }
.evm-card { padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-2); display: flex; flex-direction: column; gap: 2px; }
.evm-card .lbl { font-size: 11px; color: var(--text-2); font-weight: 600; }
.evm-card .val { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.evm-card.bad { border-color: var(--bad, #dc2626); background: color-mix(in srgb, var(--bad, #dc2626) 8%, var(--surface-2)); }
.evm-card.warn { border-color: var(--warn, #d97706); background: color-mix(in srgb, var(--warn, #d97706) 8%, var(--surface-2)); }
.evm-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 6px; }
.evm-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.evm-table th, .evm-table td { padding: 5px 8px; border-bottom: 1px solid var(--line-soft); white-space: nowrap; }
.evm-table th { background: var(--surface-2); font-weight: 600; text-align: start; position: sticky; top: 0; }
.evm-table th.num, .evm-table td.num { text-align: end; font-variant-numeric: tabular-nums; }
.evm-row.wbs { background: var(--surface-2); font-weight: 600; }
.evm-row.over-budget { background: color-mix(in srgb, var(--bad, #dc2626) 10%, transparent); }
.evm-row.behind-schedule { background: color-mix(in srgb, var(--warn, #d97706) 10%, transparent); }
.evm-row.over-budget.behind-schedule { background: color-mix(in srgb, var(--bad, #dc2626) 15%, transparent); }
.evm-idx-bad { color: var(--bad, #dc2626); font-weight: 700; }
.evm-idx-warn { color: var(--warn, #d97706); font-weight: 700; }
.evm-idx-ok { color: var(--ok, #16a34a); font-weight: 600; }
.evm-in { width: 76px; padding: 2px 5px; font-size: 12px; text-align: end; }
.evm-pf-in { width: 58px; padding: 2px 5px; font-size: 12px; text-align: end; }
.evm-section { display: flex; flex-direction: column; gap: 6px; }
.evm-section h4 { margin: 0; font-size: 13px; }
.fp-wrap { display: flex; flex-direction: column; gap: 12px; padding: 12px; overflow: auto; }
.fp-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.fp-head { display: flex; flex-direction: column; gap: 2px; }
.fp-head h3 { margin: 0; font-size: 15px; }
.fp-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; }
.fp-card { padding: 8px 10px; border: 1px solid var(--line); border-inline-start: 4px solid var(--ok, #16a34a); border-radius: 6px; background: var(--surface-2); display: flex; flex-direction: column; gap: 4px; }
.fp-card.crit { border-inline-start-color: var(--bad, #dc2626); background: color-mix(in srgb, var(--bad, #dc2626) 6%, var(--surface-2)); }
.fp-card-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.fp-card .lbl { font-size: 13px; font-weight: 700; }
.fp-card .fp-float { font-size: 12px; font-weight: 600; color: var(--text-2); font-variant-numeric: tabular-nums; }
.fp-card-meta { display: flex; justify-content: space-between; gap: 8px; font-size: 11px; color: var(--text-2); }
.fp-band td { background: var(--surface-2); font-weight: 700; }
.fp-band.crit td { background: color-mix(in srgb, var(--bad, #dc2626) 10%, var(--surface-2)); }
.fp-band.unassigned td { color: var(--text-2); }
.fp-act-row { cursor: pointer; }
.fp-act-row:hover td { background: var(--surface-2); }
.fp-act-row.sel td { background: var(--p6-sel, var(--surface-3)); }

/* ---------- menu bar and right-click menu (P6's File, Edit, View ...) ---------- */
.menubar { position: sticky; top: 52px; z-index: 28; display: flex; flex-wrap: wrap; gap: 0; padding: 0 12px; background: var(--surface-solid); border-block-end: 1px solid var(--line); }
.menu-top { position: relative; }
.mtop { border: 0; background: none; color: var(--text); font: 500 var(--fs-small)/1 var(--font); padding: 9px 12px; cursor: pointer; }
.mtop:hover, .mtop[aria-expanded=true] { background: var(--surface-3); }
.mlist, .ctx { min-width: 240px; padding: 4px; background: var(--surface-solid); border: 1px solid var(--control); border-radius: 6px; box-shadow: var(--popover-shadow); display: flex; flex-direction: column; }
.mlist { position: absolute; z-index: 40; inset-block-start: 100%; inset-inline-start: 0; max-height: 76vh; overflow-y: auto; }
.ctx { position: fixed; z-index: 70; }
.mitem { display: flex; align-items: center; gap: 4px; padding: 6px 12px 6px 4px; border: 0; border-radius: 4px; background: none; color: var(--text); font: 500 var(--fs-small)/1.3 var(--font); text-align: start; cursor: pointer; white-space: nowrap; }
.mitem:hover:not(:disabled), .mitem:focus-visible { background: var(--p6-sel); outline: none; }
.mitem:disabled { color: var(--text-3); opacity: 0.55; cursor: default; }
.mtick { flex: none; width: 18px; text-align: center; font-weight: 700; }
.msep { height: 1px; margin: 4px 6px; background: var(--line); }
.progress-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding-block-end: 10px; border-block-end: 1px solid var(--line-soft); }
kbd { display: inline-block; padding: 1px 6px; border: 1px solid var(--control); border-radius: 4px; background: var(--surface-2); font: 600 12px var(--font); }
dialog.small { width: min(460px, calc(100vw - 24px)); }
.frow .fval { flex: 1 1 120px; min-width: 100px; }

/* ---------- dialog, toast, login ---------- */
dialog { width: min(760px, calc(100vw - 24px)); max-height: calc(100vh - 24px); padding: 0; border: 1px solid var(--panel-line); border-radius: var(--radius-card); background: var(--surface-solid); color: var(--text); box-shadow: var(--popover-shadow); }
dialog::backdrop { background: var(--overlay); }
dialog form { display: flex; flex-direction: column; max-height: calc(100vh - 26px); }
dialog header, dialog footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 14px 18px; }
dialog footer { border-block-start: 1px solid var(--line); }
.dlg-body { padding: 4px 18px 16px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
.toast { position: fixed; inset-block-end: 18px; inset-inline-end: 18px; z-index: 60; max-width: min(440px, calc(100vw - 36px)); padding: 12px 16px; border-radius: var(--radius-inner); background: var(--surface-solid); color: var(--text); border: 1px solid var(--line-strong); box-shadow: var(--popover-shadow); font-size: var(--fs-small); font-weight: 600; }
.toast.error { border-color: var(--red-mark); color: var(--red-ink); }
.login-page { display: grid; place-items: center; padding: 16px; }
.login { width: min(380px, 100%); padding: 28px; display: flex; flex-direction: column; gap: 16px; }
.login form { display: flex; flex-direction: column; gap: 12px; }
.login .brand { color: var(--text); }

/* ---------- touch, small screens, motion ---------- */
@media (pointer: coarse) {
  .btn, .btn.small, .input, .input.small, .dirbar [role=tab], .dtabs [role=tab], .seg [role=tab], .check { min-height: 44px; }
  .check input { width: 22px; height: 22px; }
  .g-split, .g-split-top { width: 14px; }
  .gantt { grid-template-columns: var(--g-w, 50%) 14px minmax(0, 1fr); }
}
@media (max-width: 1100px) {
  .p6, .p6.wide { grid-template-columns: minmax(0, 1fr); }
  .dirbar { flex-direction: row; position: static; overflow-x: auto; scrollbar-width: none; }
  .dirbar [role=tab], .dirbar .win { white-space: nowrap; min-height: 44px; }
  .dirbar [role=tab][aria-selected=true], html[dir="rtl"] .dirbar [role=tab][aria-selected=true] { box-shadow: inset 0 -3px 0 var(--line-strong); }
  .side { position: static; max-height: none; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi + .kpi { border-inline-start: 0; } .kpi { border-block-end: 1px solid var(--line); }
  .kpi:nth-child(even) { border-inline-start: 1px solid var(--line); }
  .kpi:last-child { grid-column: 1 / -1; border-block-end: 0; border-inline-start: 0; }
  .gantt { height: 62vh; }
  .dcols, .dcols.two { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  main { padding: 10px; }
  .who { display: none; }
  .grid2 { grid-template-columns: minmax(0, 1fr); }
  .kpi-value { font-size: 18px; }
  .toolbar .layout-name { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
@media (forced-colors: active) { .g-bar, .g-milestone, .g-summary { fill: CanvasText; } .g-bar.crit { fill: Highlight; } .btn { border-color: ButtonText; } }

/* ---------- print (A3 landscape from the browser; the PDF export uses A1) ---------- */
#printSheet { background: #fff; color: #15171A; padding: 4px; }
.print-head { display: flex; justify-content: space-between; gap: 24px; padding-block-end: 8px; border-block-end: 2px solid #15171A; margin-block-end: 6px; }
.print-head .end { text-align: end; }
.print-head p { font-size: 12px; }
.gantt.print { height: auto; grid-template-columns: var(--g-tw) 1px minmax(0, 1fr); grid-template-rows: 40px auto; }
.gantt.print .g-tb, .gantt.print .g-bb { overflow: visible; }
.gantt.print .g-actrow, .gantt.print .g-headrow { background: #fff; }
@media print {
  @page { size: A3 landscape; margin: 10mm; }
  body { background: #fff; }
  .toast, .skip { display: none !important; }
  main { padding: 0; max-width: none; }
  .g-row { break-inside: avoid; }
  .print-page { break-after: page; break-inside: avoid; }
  .print-page:last-child { break-after: auto; }
}

/* ---------- steps, expenses, risks, projects ---------- */
.dirbar .win:first-of-type { margin-block-start: 6px; border-block-start: 1px solid var(--line); border-radius: 0 0 8px 8px; }
dialog.wide { width: min(1320px, calc(100vw - 24px)); }
.scrollx { overflow-x: auto; }
.table tfoot th { padding: 6px; border-block-start: 1px solid var(--control); text-align: start; }
.table tfoot th.num { text-align: end; }
.table tr.sel td { background: var(--surface-3); }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 14px; }
.riskhead { display: grid; grid-template-columns: 1fr auto; gap: 18px; align-items: start; }
.riskform { padding: 14px; border: 1px solid var(--control); border-radius: var(--radius-card); background: var(--surface-2); }
.matrix { width: auto; }
.matrix th, .matrix td { padding: 4px 10px; font-size: var(--fs-micro, 12px); }
.matrix td { min-width: 62px; text-align: center; font-weight: 700; border: 1px solid var(--surface-solid); }
.risk-low { background: #d9efe0; color: #14532d; }
.risk-medium { background: #fbe8b6; color: #6b4a00; }
.risk-high { background: #f6c9c5; color: #7a1410; }
html[data-theme="dark"] .risk-low { background: #173d28; color: #b9ecc9; }
html[data-theme="dark"] .risk-medium { background: #4a3a0c; color: #f6dd9a; }
html[data-theme="dark"] .risk-high { background: #5a1b17; color: #ffc9c4; }
.table.eps td { white-space: nowrap; }
.table.eps th { vertical-align: bottom; }
.table.eps thead th { max-width: 96px; }
.table.eps td:first-child { white-space: normal; min-width: 190px; }
.epsband th, .epsband td { background: var(--surface-3); font-weight: 700; }
.epsbar rect.ok { fill: #3f9b57; } .epsbar rect.late { fill: #d0342c; } .epsbar rect.sum { fill: var(--text); }
.linkbtn { padding: 0; border: 0; background: none; color: var(--link, var(--text)); font: 600 var(--fs-small)/1.3 var(--font); text-align: start; text-decoration: underline; cursor: pointer; }
@media (max-width: 820px) { .grid3, .riskhead { grid-template-columns: minmax(0, 1fr); } .linkbtn { min-height: 44px; } }
.table td.wide { min-width: 200px; }
.riskhead > * { min-width: 0; }
.print-page + .print-page { margin-block-start: 18px; }
.print-cont { font-size: 12px; margin-block-end: 6px; }
dialog .toast { z-index: 5; }
.welcome-actions { display: flex; flex-direction: column; gap: 8px; }
.welcome-actions .btn { width: 100%; justify-content: center; }
.eps-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding-block-end: 8px; border-block-end: 1px solid var(--line); }
.eps-inline { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-inner); background: var(--surface-2); }
.epsband.sel th, .epsband.sel td { outline: 2px solid var(--accent, var(--link, var(--text))); outline-offset: -2px; }
.table.eps tbody tr { cursor: pointer; }
.eps-clip-note { font-size: var(--fs-small); color: var(--text-2); }
.eps-layout { display: grid; grid-template-columns: minmax(260px, 340px) minmax(0, 1fr); gap: 14px; align-items: start; margin-block-start: 8px; }
.eps-tree-pane { border: 1px solid var(--line); border-radius: var(--radius-inner); background: var(--surface-2); padding: 8px; max-height: 62vh; overflow-y: auto; }
.eps-detail-pane { min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.eps-tree-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.eps-tree-row { display: flex; align-items: center; gap: 6px; padding: 5px 8px; border-radius: 6px; cursor: pointer; font-size: var(--fs-small); border: 1px solid transparent; }
.eps-tree-row:hover { background: var(--surface-3); }
.eps-tree-row.sel { background: var(--p6-sel, var(--surface-3)); border-color: var(--accent, var(--link, var(--text))); font-weight: 600; }
.eps-tree-row.dragover { outline: 2px dashed var(--accent, var(--link, var(--text))); background: var(--surface-3); }
.eps-toggle { width: 18px; height: 18px; padding: 0; border: 0; background: none; color: var(--text-2); cursor: pointer; flex: 0 0 18px; font-size: 11px; line-height: 1; }
.eps-node-code { font-size: 11px; color: var(--text-2); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.eps-node-name { flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.eps-node-badge { font-size: 11px; padding: 1px 6px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--text-2); }
.eps-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; }
.eps-kpi { padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-inner); background: var(--surface-2); }
.eps-kpi-label { font-size: 11px; color: var(--text-2); }
.eps-kpi-val { font-size: var(--fs-body); font-weight: 700; margin-block-start: 2px; }
.eps-path-crumb { font-size: var(--fs-small); color: var(--text-2); }
.eps-d1 { padding-inline-start: 16px; }
.eps-d2 { padding-inline-start: 32px; }
.eps-d3 { padding-inline-start: 48px; }
.eps-d4 { padding-inline-start: 64px; }
.eps-d5 { padding-inline-start: 80px; }
.eps-d6 { padding-inline-start: 96px; }
.eps-d7 { padding-inline-start: 112px; }
.eps-d8 { padding-inline-start: 128px; }
.obs-mgr-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-inner); background: var(--surface-2); }
.obs-sec-title { margin: 8px 0 4px; font-size: var(--fs-small); font-weight: 700; color: var(--text-2); }
.obs-node-mgr { font-size: 11px; color: var(--text-2); max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 820px) { .eps-layout { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 820px) {
  .mtop, .mitem { min-height: 44px; }
  .mlist { max-height: calc(100vh - 210px); }
  #colMenu[open] > :not(summary) { position: fixed; inset-inline: 8px; inset-block-start: 120px; max-height: calc(100vh - 150px); overflow-y: auto; }
}
.table tr.muted td { color: var(--text-3); }
.slog { margin: 0; padding: 12px; max-height: 62vh; overflow: auto; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: pre; }
.trace { display: grid; grid-template-columns: 1fr minmax(180px, 0.6fr) 1fr; gap: 14px; align-items: start; }
.tcol { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.tcol.mid { align-self: center; }
.tlevel.l2 { margin-inline-start: 18px; } .tlevel.l3 { margin-inline-start: 36px; } .tlevel.l4 { margin-inline-start: 54px; }
.tbox { display: flex; flex-direction: column; gap: 1px; width: 100%; padding: 6px 8px; border: 1px solid var(--control); border-inline-start: 4px solid #3f9b57; border-radius: 6px; background: var(--surface); color: var(--text); font: 500 var(--fs-small)/1.3 var(--font); text-align: start; cursor: pointer; }
.tbox.crit { border-inline-start-color: #d0342c; }
.tbox.here { background: var(--p6-sel, var(--surface-3)); cursor: default; opacity: 1; }
.tbox span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tbox small { color: var(--text-2); } .tbox small.drv { color: var(--text); font-weight: 700; }
@media (max-width: 820px) { .trace { grid-template-columns: minmax(0, 1fr); } .tbox { min-height: 44px; } }
.g-actrow.multi { background: var(--p6-sel, var(--surface-3)); }
.cellinput { width: 100%; min-width: 0; padding: 0 4px; border: 2px solid var(--focus, #2563eb); border-radius: 3px; background: var(--surface-solid); color: var(--text); font: inherit; }
.g-bar.drag { cursor: ew-resize; touch-action: none; }
.cmp-wrap { display: flex; flex-direction: column; gap: 12px; padding: 10px 12px; }
.cmp-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.cmp-head { display: flex; flex-direction: column; gap: 2px; }
.cmp-head h3 { margin: 0; font-size: var(--fs-body); }
.cmp-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; }
.cmp-card { padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-inner); background: var(--surface-2); }
.cmp-card.delayed { border-color: #d0342c; }
.cmp-card .lbl { font-size: 11px; color: var(--text-2); }
.cmp-card .val { font-size: var(--fs-body); font-weight: 700; margin-block-start: 2px; }
.cmp-card .sub { font-size: 11px; color: var(--text-2); margin-block-start: 2px; }
.cmp-filters { display: flex; flex-wrap: wrap; gap: 6px; }
.cmp-badge { display: inline-block; padding: 1px 6px; border-radius: 999px; font-size: 11px; font-weight: 600; border: 1px solid var(--line); background: var(--surface-2); }
.cmp-badge.added { color: #1f7a3e; border-color: #1f7a3e; }
.cmp-badge.deleted { color: #b91c1c; border-color: #b91c1c; }
.cmp-badge.changed { color: #1d4ed8; border-color: #1d4ed8; }
.cmp-badge.delayed { color: #b91c1c; border-color: #b91c1c; margin-inline-start: 4px; }
.cmp-badge.earlier { color: #1f7a3e; border-color: #1f7a3e; margin-inline-start: 4px; }
.cmp-changes { display: flex; flex-direction: column; gap: 3px; font-size: var(--fs-small); }
.cmp-chg-item { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px; }
.cmp-chg-field { font-weight: 600; color: var(--text-2); }
.cmp-old { text-decoration: line-through; color: var(--text-2); }
.cmp-new { font-weight: 600; }
.cmp-sec-title { margin: 6px 0 4px; font-size: var(--fs-small); font-weight: 700; color: var(--text-2); }
.gcal-layout { display: grid; grid-template-columns: minmax(220px, 280px) minmax(0, 1fr); gap: 14px; min-height: 420px; }
.gcal-list { display: flex; flex-direction: column; gap: 6px; border-inline-end: 1px solid var(--line); padding-inline-end: 12px; }
.gcal-item { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-inner); background: var(--surface-2); cursor: pointer; text-align: start; font: inherit; color: var(--text); }
.gcal-item.active { border-color: var(--focus, #2563eb); background: var(--surface-3); }
.gcal-item-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-weight: 600; }
.gcal-item-meta { font-size: 11px; color: var(--text-2); }
.gcal-badge { display: inline-block; padding: 1px 6px; border-radius: 999px; font-size: 10px; font-weight: 600; border: 1px solid var(--line); background: var(--surface-solid); }
.gcal-editor { display: flex; flex-direction: column; gap: 12px; }
.gcal-week-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.lay-levels { display: flex; flex-direction: column; gap: 6px; }
.lay-level-row { display: flex; align-items: center; gap: 6px; }
.lay-cols-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(175px, 1fr)); gap: 6px; }
.lay-col-item { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 4px 8px; border: 1px solid var(--line); border-radius: var(--radius-inner); background: var(--surface-2); font-size: var(--fs-small); }
.lay-col-w { width: 58px; }
.fund-wrap { display: flex; flex-direction: column; gap: 12px; }
.fund-tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.fund-tabs .btn.active { background: var(--focus, #2563eb); color: #fff; border-color: var(--focus, #2563eb); }
.fund-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; padding: 10px; border: 1px solid var(--line); border-radius: var(--radius-inner); background: var(--surface-2); align-items: end; }
.fund-form .field { display: flex; flex-direction: column; gap: 3px; }
.fund-form label { font-size: 11px; color: var(--text-2); }
.fund-chart-wrap { border: 1px solid var(--line); border-radius: var(--radius-inner); background: var(--surface-2); padding: 10px; overflow-x: auto; }
.fund-legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 11px; color: var(--text-2); margin-bottom: 6px; }
.fund-legend span { display: inline-flex; align-items: center; gap: 5px; }
.fund-swatch { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.fund-gap-pos { border-color: #d0342c; }
.fund-gap-neg { border-color: #1f7a3e; }
.ts-wrap { display: flex; flex-direction: column; gap: 12px; }
.ts-grid input.ts-hr { width: 58px; text-align: end; padding: 3px 5px; }
.ts-badge { display: inline-block; padding: 2px 7px; border-radius: 999px; font-size: 11px; font-weight: 600; text-transform: capitalize; }
.ts-badge.draft { background: var(--surface-2); border: 1px solid var(--line); color: var(--text-2); }
.ts-badge.submitted { background: #dbeafe; color: #1d4ed8; }
.ts-badge.approved { background: #dcfce7; color: #15803d; }
.ts-badge.rejected { background: #fee2e2; color: #b91c1c; }
.ts-reject-box { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
@media (max-width: 760px) { .gcal-layout { grid-template-columns: minmax(0, 1fr); } .gcal-list { border-inline-end: 0; padding-inline-end: 0; border-bottom: 1px solid var(--line); padding-bottom: 10px; } .pf-layout { grid-template-columns: minmax(0, 1fr); } .pf-sidebar { border-inline-end: 0; padding-inline-end: 0; border-bottom: 1px solid var(--line); padding-bottom: 10px; } }
.pf-layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 14px; }
.pf-sidebar { border-inline-end: 1px solid var(--line); padding-inline-end: 12px; display: flex; flex-direction: column; gap: 8px; }
.pf-item { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-inner); background: var(--surface-2); cursor: pointer; text-align: start; }
.pf-item.active { border-color: var(--focus, #2563eb); background: var(--surface); }
.pf-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(125px, 1fr)); gap: 8px; }
.pf-card { padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-inner); background: var(--surface-2); }
.pf-card .k { font-size: 11px; color: var(--text-2); }
.pf-card .v { font-size: 15px; font-weight: 600; margin-top: 2px; }
.pf-members { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 6px; max-height: 180px; overflow-y: auto; padding: 8px; border: 1px solid var(--line); border-radius: var(--radius-inner); background: var(--surface); }
.pf-members label { display: flex; align-items: center; gap: 6px; font-size: var(--fs-small); cursor: pointer; }
.pf-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-inner); background: var(--surface-2); }
