/* EVA web client hub
   Look: the native EVA desktop app (Devis screen) — system type, dense lists, segmented tabs,
   key-value fields, action bar — with EVA magenta as the single accent.
   Tokens first; light and dark follow the OS. */

/* Brand tokens from experval.pro (css/style.css): --primary #E0007A, --primary-soft #F8D2E4, --bg #F6F6F6,
   --text #333, --text-muted #666, --border #DDD, --dark #5C5C5C, --light #C7C7C7, --radius 12px, soft shadow.
   The logo's three colours (dark grey, light grey, magenta) carry the trajectory chart. */
:root {
	--canvas: #F6F6F6;
	--surface: #FFFFFF;
	--side: #FFFFFF;
	--ink: #333333;
	--ink-2: #666666;
	--ink-3: #999999;
	--line: #DDDDDD;
	--line-2: #CFCFCF;
	--accent: #E0007A;
	--accent-ink: #FFFFFF;
	--accent-soft: #F8D2E4;
	--accent-tint: #FDF0F6;
	--sel: #E0007A;
	--sel-soft: #FDF0F6;
	--brand-dark: #5C5C5C;
	--brand-light: #C7C7C7;
	--ok: #1F8A57; --ok-soft: #E3F4EA;
	--warn: #B26B00; --warn-soft: #FDF1DC;
	--bad: #C7362F; --bad-soft: #FBE5E3;
	--info: #2C64B5; --info-soft: #E5EDFA;
	--pv: #5C5C5C;
	--shadow: 0 2px 10px rgba(0, 0, 0, .05);
	--radius: 12px;
	--radius-s: 8px;
	--font: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	--fs: 14px;
	--row: 30px;
	color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
	:root {
		--canvas: #1E1E20; --surface: #28282B; --side: #232326;
		--ink: #ECECEC; --ink-2: #A8A8A8; --ink-3: #777777;
		--line: #3A3A3D; --line-2: #48484C;
		--accent: #F2389A; --accent-soft: #4A2236; --accent-tint: #33202A; --sel: #E0007A; --sel-soft: #33202A;
		--brand-dark: #A8A8A8; --brand-light: #5C5C5C;
		--ok: #4CC38A; --ok-soft: #1E3529; --warn: #E2A93B; --warn-soft: #3A3020; --bad: #F06A62; --bad-soft: #3D2322; --info: #6EA0F0; --info-soft: #1F2E47;
		--pv: #A8A8A8; --shadow: 0 2px 10px rgba(0, 0, 0, .3);
	}
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; font: var(--fs)/1.45 var(--font); color: var(--ink); background: var(--canvas); -webkit-font-smoothing: antialiased; font-feature-settings: "tnum" 0; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.01em; }
p { margin: 0; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.strong { font-weight: 600; }
.muted { color: var(--ink-2); }
.hint { color: var(--ink-2); font-size: 12.5px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 6px 10px; border-radius: var(--radius-s); z-index: 10; }
.skip:focus { left: 8px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
[hidden] { display: none !important; }

.loading { padding: 40px; color: var(--ink-2); }
.empty { padding: 28px; color: var(--ink-2); display: grid; gap: 14px; justify-items: start; max-width: 60ch; }
.empty.center { margin: 12vh auto 0; justify-items: center; text-align: center; }

/* ---------- brand ---------- */
.mark { display: inline-flex; align-items: center; gap: 9px; font-weight: 600; font-size: 16px; letter-spacing: .01em; color: var(--ink); }
.mark img { width: 26px; height: 26px; display: block; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand .demo { font-size: 11.5px; color: var(--accent); background: var(--accent-soft); padding: 2px 8px; border-radius: 999px; }

/* ---------- buttons and fields ---------- */
.btn { appearance: none; border: 1px solid var(--accent-soft); background: var(--surface); color: var(--accent); padding: 7px 16px; border-radius: 999px; cursor: pointer; font-weight: 500; line-height: 1.3; }
.btn:hover:not(:disabled) { background: var(--accent-tint); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover:not(:disabled) { filter: brightness(1.06); border-color: var(--accent); }
.btn.bad { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.quiet-bad { color: var(--bad); border-color: var(--bad-soft); }
.btn.quiet-bad:hover:not(:disabled) { background: var(--bad-soft); }
.btn.wide { width: 100%; padding: 10px 16px; }
.link { appearance: none; border: 0; background: none; color: var(--accent); cursor: pointer; padding: 0; }

.field { display: grid; gap: 5px; }
.field > span { font-size: 12.5px; color: var(--ink-2); }
.field input, .field textarea, .field select, input.search {
	width: 100%; padding: 7px 10px; border: 1px solid var(--line-2); border-radius: var(--radius-s); background: var(--surface);
}
.field textarea { resize: vertical; min-height: 84px; }
.check { display: flex; gap: 10px; align-items: flex-start; }
.check input { margin-top: 3px; accent-color: var(--accent); }
input.search { padding-left: 30px; background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Ccircle cx='7' cy='7' r='4.5' fill='none' stroke='%23999' stroke-width='1.5'/%3E%3Cpath d='M10.5 10.5 14 14' stroke='%23999' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat 9px 50% / 14px; }
.form-error { color: var(--bad); background: var(--bad-soft); padding: 8px 10px; border-radius: var(--radius-s); }

/* ---------- login ---------- */
.login { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.login-card { width: min(400px, 100%); display: grid; gap: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 32px 28px; }
.login-card h1 { font-weight: 700; }
.login-card h1 { font-size: 22px; }
.login-card .lead { color: var(--ink-2); margin-top: -8px; }
.lang { display: flex; gap: 4px; justify-self: center; }
.lang button { border: 0; background: none; color: var(--ink-2); padding: 2px 8px; border-radius: 999px; cursor: pointer; font-size: 12.5px; }
.lang button.on { background: var(--accent-soft); color: var(--accent); }

/* ---------- shell: sidebar | list | content ---------- */
.shell { display: grid; grid-template-columns: 220px 300px minmax(0, 1fr); height: 100vh; height: 100dvh; }
.shell.no-list { grid-template-columns: 220px minmax(0, 1fr); }

.side { background: var(--side); border-right: 1px solid var(--line); padding: 18px 10px 14px; display: flex; flex-direction: column; gap: 2px; min-height: 0; }
.side .brand { padding: 0 10px 18px; }
.side-head { font-size: 12px; font-weight: 600; color: var(--ink-2); padding: 0 10px 6px; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: var(--radius-s); text-decoration: none; }
.nav-item:hover { background: var(--canvas); }
.nav-item.on { background: var(--accent-tint); color: var(--accent); font-weight: 600; }
.nav-item .ico { width: 18px; height: 18px; fill: none; stroke: var(--accent); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.nav-item .badge { margin-left: auto; background: var(--accent); color: var(--accent-ink); font-size: 11.5px; font-weight: 600; min-width: 20px; text-align: center; border-radius: 999px; padding: 0 6px; }
.side-foot { margin-top: auto; display: grid; gap: 2px; padding-top: 10px; border-top: 1px solid var(--line); }
.side-foot .nav-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-link { appearance: none; border: 0; background: none; text-align: left; padding: 6px 10px 6px 38px; color: var(--ink-2); cursor: pointer; border-radius: var(--radius-s); }
.side-link:hover { color: var(--ink); background: rgba(127, 127, 127, .10); }

.list { border-right: 1px solid var(--line); background: var(--surface); display: flex; flex-direction: column; min-height: 0; }
.list-head { display: flex; align-items: baseline; gap: 8px; padding: 18px 16px 10px; }
.list-head h2 { font-size: 18px; font-weight: 700; }
.list-head .count { color: var(--ink-3); font-variant-numeric: tabular-nums; }
.list .search { margin: 0 12px 8px; width: calc(100% - 24px); }
.items { list-style: none; margin: 0; padding: 0 8px 12px; overflow: auto; }
.items a { display: flex; gap: 10px; align-items: center; padding: 9px 10px; border-radius: var(--radius-s); text-decoration: none; }
.items a:hover { background: var(--canvas); }
.items a.on { background: var(--sel-soft); box-shadow: inset 3px 0 0 var(--sel); }
.li-main { display: grid; gap: 3px; min-width: 0; flex: 1; }
.li-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.li-sub { color: var(--ink-2); font-size: 12.5px; min-width: 0; }
.items .num { color: var(--ink-2); font-size: 12.5px; }
.empty-list { padding: 12px 18px; color: var(--ink-2); }

.dot::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 6px; background: currentColor; vertical-align: 1px; }
.dot.tone-action, .dot.tone-neutral { color: var(--ink-2); }
.dot.tone-action::before { background: var(--accent); }
.dot.tone-ok::before { background: var(--ok); }
.dot.tone-warn::before { background: var(--warn); }
.dot.tone-bad::before { background: var(--bad); }
.dot.tone-info::before { background: var(--info); }
.dot.tone-muted::before { background: var(--ink-3); }

.content { min-width: 0; min-height: 0; overflow: auto; display: flex; flex-direction: column; }
.back { display: none; }

/* ---------- detail ---------- */
.detail { display: flex; flex-direction: column; min-height: 100%; }
.project-detail { flex-shrink: 0; }
.project-heading { position: sticky; top: 0; z-index: 4; background: var(--canvas); }
.project-heading .tabs { margin-bottom: 0; }
.project-detail > .detail-body { padding-top: 18px; }
.detail-head { padding: 22px 28px 14px; display: grid; gap: 14px; }
.head-title { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.head-title h1 { font-size: 24px; font-weight: 700; }
.head-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px 24px; }
.hf { display: grid; gap: 1px; min-width: 0; }
.hf-k { font-size: 12px; color: var(--ink-2); }
.hf-v { overflow: hidden; text-overflow: ellipsis; }

.chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; }
.chip.tone-action { background: var(--accent-soft); color: var(--accent); }
.chip.tone-ok { background: var(--ok-soft); color: var(--ok); }
.chip.tone-warn { background: var(--warn-soft); color: var(--warn); }
.chip.tone-bad { background: var(--bad-soft); color: var(--bad); }
.chip.tone-info { background: var(--info-soft); color: var(--info); }
.chip.tone-neutral, .chip.tone-muted { background: var(--canvas); color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line); }

.segmented { align-self: center; display: inline-flex; gap: 2px; padding: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; margin: 2px 0 14px; max-width: calc(100% - 32px); overflow-x: auto; }
.segmented a { padding: 5px 15px; border-radius: 999px; text-decoration: none; color: var(--ink-2); white-space: nowrap; font-weight: 500; }
.segmented a:hover { color: var(--ink); }
.segmented a.on { background: var(--accent); color: var(--accent-ink); }

.detail-body { flex: 1; padding: 0 28px 20px; min-height: 0; }

.action-bar { position: sticky; bottom: 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 12px 28px; background: color-mix(in srgb, var(--canvas) 88%, transparent); backdrop-filter: blur(10px); border-top: 1px solid var(--line); }
.action-bar .spacer { flex: 1; }
.notice { color: var(--ink-2); font-size: 12.5px; margin-right: 6px; }

/* ---------- panels ---------- */
.summary-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.summary-grid .wide { grid-column: 1 / -1; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; display: grid; gap: 12px; align-content: start; }
.panel h2 { font-size: 14px; }
.panel.narrow { max-width: 560px; }
.panel-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }

.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0; }
.kv dt { color: var(--ink-2); }
.kv dd { margin: 0; font-variant-numeric: tabular-nums; text-align: right; }
.kv dd.tone-warn { color: var(--warn); font-weight: 600; }
.kv dd.tone-bad { color: var(--bad); font-weight: 600; }
.kv dd.tone-ok { color: var(--ok); font-weight: 600; }
.kv dd.tone-info { color: var(--info); font-weight: 600; }

.counts { display: flex; gap: 18px; color: var(--ink-2); }
.counts strong { color: var(--ink); font-size: 16px; }
.scope { list-style: none; margin: 0; padding: 0; display: grid; }
.scope li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 4px 14px; align-items: baseline; padding: 7px 0; border-top: 1px solid var(--line); }
.scope li:first-child { border-top: 0; }
.s-dim { color: var(--ink-2); font-size: 12.5px; text-align: right; }
.scope.with-progress li { grid-template-columns: minmax(0, 1fr) 11rem; align-items: center; }

table.sum { width: 100%; border-collapse: collapse; }
.sum th { text-align: left; font-weight: 400; color: var(--ink-2); padding: 5px 0; }
.sum td { text-align: right; padding: 5px 0; }
.sum tr.sub th, .sum tr.sub td { border-top: 1px solid var(--line); padding-top: 9px; color: var(--ink); }
.sum tr.total th, .sum tr.total td { border-top: 1px solid var(--line-2); padding-top: 10px; font-size: 20px; font-weight: 650; color: var(--ink); letter-spacing: -0.01em; }

.plan-grid { display: grid; grid-template-columns: minmax(220px, 280px) minmax(0, 1fr); gap: 24px; align-items: center; }

/* progress headline */
.progress-head { gap: 14px; }
.big { display: flex; align-items: baseline; gap: 10px; }
.big-num { font-size: 40px; font-weight: 650; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; line-height: 1; }
.big-label { color: var(--ink-2); }
.meter { position: relative; height: 8px; background: var(--canvas); border-radius: 999px; box-shadow: inset 0 0 0 1px var(--line); }
.meter > span { position: absolute; inset: 0 auto 0 0; background: var(--accent); border-radius: 999px; }
.meter-plan { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--pv); border-radius: 1px; }

.pbar { display: inline-grid; grid-template-columns: minmax(48px, 1fr) 4.2em; gap: 8px; align-items: center; width: 100%; }
.pbar-track { height: 6px; background: var(--canvas); border-radius: 999px; box-shadow: inset 0 0 0 1px var(--line); overflow: hidden; }
.pbar-fill { display: block; height: 100%; background: var(--accent); }
.pbar-fill.done { background: var(--ok); }
.pbar .num { text-align: right; color: var(--ink-2); font-size: 12.5px; }

/* ---------- trajectory chart: the one bold element ---------- */
.trajectory { margin: 0; display: grid; gap: 8px; }
.chart-wrap { position: relative; border-radius: var(--radius-s); background: color-mix(in srgb, var(--canvas) 52%, var(--surface)); }
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart .grid line { stroke: var(--line); stroke-width: 1; }
.chart .tick { fill: var(--ink-2); font-size: 12px; font-variant-numeric: tabular-nums; }
.chart .pv-fill stop { stop-color: var(--pv); }
.chart .ev-fill stop { stop-color: var(--accent); }
.chart .pv-line-light { stroke: var(--brand-light); }
.chart .pv-line { fill: none; stroke: var(--pv); stroke-width: 1.8; stroke-dasharray: 5 4; }
.chart .ev-line { fill: none; stroke: var(--accent); stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }
.chart .point-pv { fill: var(--surface); stroke: var(--pv); stroke-width: 2; }
.chart .point-ev { fill: var(--accent); stroke: var(--surface); stroke-width: 1.5; }
.chart .today { stroke: var(--ink-3); stroke-width: 1; stroke-dasharray: 2 3; }
.chart .today-label { fill: var(--ink-2); font-size: 11px; }
.chart .cross { stroke: var(--ink-3); stroke-width: 1; stroke-dasharray: 3 3; }
.chart .gap line { stroke-width: 2; }
.chart .gap-late line, .chart .gap-late .gap-dot-ev { stroke: var(--warn); }
.chart .gap-critical line, .chart .gap-critical .gap-dot-ev { stroke: var(--bad); }
.chart .gap-ahead line, .chart .gap-ahead .gap-dot-ev { stroke: var(--ok); }
.chart .gap-dot-pv { fill: var(--surface); stroke: var(--pv); stroke-width: 2; }
.chart .gap-dot-ev { fill: var(--accent); stroke-width: 0; }
.chart .gap-pill { fill: var(--surface); stroke-width: 1.5; }
.chart .gap-late .gap-pill { stroke: var(--warn); } .chart .gap-late .gap-label { fill: var(--warn); }
.chart .gap-critical .gap-pill { stroke: var(--bad); } .chart .gap-critical .gap-label { fill: var(--bad); }
.chart .gap-ahead .gap-pill { stroke: var(--ok); } .chart .gap-ahead .gap-label { fill: var(--ok); }
.chart .gap-label { font-size: 12px; font-weight: 650; }
.chart-tip { position: absolute; top: 6px; transform: translateX(-50%); background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius-s); padding: 8px 11px; display: grid; gap: 3px; max-width: 100%; font-size: 12px; pointer-events: none; box-shadow: var(--shadow); }
.chart-tip strong { padding-bottom: 3px; border-bottom: 1px solid var(--line); }
.legend { display: flex; flex-wrap: wrap; gap: 4px 18px; color: var(--ink-2); font-size: 12.5px; }
.k-pv::before, .k-ev::before { content: ""; display: inline-block; width: 18px; height: 0; margin-right: 6px; vertical-align: 3px; }
.k-pv::before { border-top: 2px dashed var(--pv); }
.k-ev::before { border-top: 3px solid var(--accent); }

/* ---------- tree-grid (desktop CollectionView) ---------- */
.split { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
.grid-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column; min-width: 0; }
.grid-tools { display: flex; align-items: center; gap: 12px; padding: 10px 10px 8px; }
.grid-tools .search { max-width: 320px; }
.grid-tools .link { margin-left: auto; font-size: 12.5px; }
.grid-scroll { overflow: auto; max-height: calc(100dvh - 330px); min-height: 220px; }
table.grid { width: 100%; border-collapse: separate; border-spacing: 0; }
.grid th { position: sticky; top: 0; background: var(--surface); text-align: left; font-weight: 500; color: var(--ink-2); font-size: 12.5px; padding: 6px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; z-index: 1; }
.grid td { padding: 0 10px; height: var(--row); border-bottom: 1px solid color-mix(in srgb, var(--line) 60%, transparent); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 28rem; }
.grid tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--canvas) 55%, var(--surface)); }
.grid tbody tr { cursor: default; }
.grid tbody tr:hover td { background: var(--canvas); }
.grid tbody tr.sel td { background: var(--sel); color: #fff; }
.grid tbody tr.sel td .muted, .grid tbody tr.sel td .num, .grid tbody tr.sel .pbar .num { color: #fff; }
.grid tbody tr:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.grid .a-right { text-align: right; }
.grid td.name { display: flex; align-items: center; gap: 4px; max-width: none; }
.grid .label { overflow: hidden; text-overflow: ellipsis; }
.disc { appearance: none; border: 0; background: none; width: 18px; height: 18px; padding: 0; color: var(--ink-3); cursor: pointer; flex: none; font-size: 11px; line-height: 18px; }
.sel .disc { color: #fff; }
.disc-sp { width: 18px; flex: none; }
.grid tr.lvl-0 td { font-weight: 650; font-size: 14.5px; }
.grid tr.cls-ProjectContainerProductElement.lvl-1 td.name { font-weight: 650; }
.grid tr.cls-ProjectWorkElement td.name .label { font-style: italic; }
.grid .dims { color: var(--ink-2); }
.sel .dims { color: #fff; }
.grid-footer { padding: 7px 12px; color: var(--ink-3); font-size: 12px; text-align: center; border-top: 1px solid var(--line); }

.gantt { position: relative; display: block; height: 10px; background: color-mix(in srgb, var(--canvas) 70%, transparent); border-radius: 3px; }
.gantt-bar { position: absolute; top: 0; bottom: 0; background: var(--accent); border-radius: 3px; opacity: .85; }
.sel .gantt-bar { background: #fff; }

.inspector { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; display: grid; gap: 12px; position: sticky; top: 8px; }
.inspector h2 { font-size: 15px; }
.inspector h3 { font-size: 12.5px; color: var(--ink-2); font-weight: 500; }
.inspector .kv dd { text-align: right; }
.progress-log { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 12.5px; }
.progress-log li { display: grid; grid-template-columns: 6.5em 4em 1fr; gap: 6px; color: var(--ink-2); }

/* ---------- journal ---------- */
.journal { list-style: none; margin: 0 auto; padding: 0; max-width: 760px; display: grid; }
.journal li { position: relative; padding: 12px 0 14px 22px; border-left: 2px solid var(--line); margin-left: 6px; display: grid; gap: 4px; }
.journal li::before { content: ""; position: absolute; left: -6px; top: 17px; width: 10px; height: 10px; border-radius: 50%; background: var(--surface); border: 2px solid var(--ink-3); }
.journal li.auto::before { border-color: var(--pv); background: var(--canvas); }
.journal li.mine::before { border-color: var(--accent); background: var(--accent); }
.journal .j-kind-5::before, .journal .j-kind-6::before, .journal .j-kind-7::before { border-color: var(--warn); }
.journal .j-kind-9::before { border-color: var(--accent); }
.j-meta { display: flex; gap: 10px; color: var(--ink-2); font-size: 12.5px; flex-wrap: wrap; }
.j-kind { font-weight: 600; }
.journal h3 { font-size: 14.5px; }
.journal p { color: var(--ink); max-width: 68ch; }

/* ---------- dialog and toast ---------- */
.dlg { border: 1px solid var(--line-2); border-radius: 12px; padding: 0; width: min(480px, calc(100% - 32px)); background: var(--surface); color: var(--ink); box-shadow: 0 24px 60px rgba(0, 0, 0, .25); }
.dlg::backdrop { background: rgba(20, 20, 24, .38); }
.dlg form { display: grid; gap: 14px; padding: 22px; }
.dlg h2 { font-size: 17px; }
.dlg .lead { color: var(--ink-2); }
.dlg-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }
.toast { position: fixed; left: 50%; bottom: 76px; transform: translate(-50%, 16px); opacity: 0; background: var(--ink); color: var(--surface); padding: 9px 16px; border-radius: 999px; transition: opacity .2s, transform .2s; pointer-events: none; z-index: 20; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.tone-err { background: var(--bad); color: #fff; }


/* ======================================================================
   Layout v2 — follows the EVA web prototype (sidebar sections, list with dots,
   breadcrumb bar, header with tile and meta line, icon tabs, KPI tiles, cards).
   ====================================================================== */
.ico { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* sidebar */
.shell { grid-template-columns: 200px 260px minmax(0, 1fr); }
.shell.no-list { grid-template-columns: 200px minmax(0, 1fr); }
.side { padding: 22px 12px 16px; gap: 2px; }
.brand-block { display: flex; align-items: center; gap: 10px; padding: 0 8px 26px; }
.brand-block img { width: 34px; height: 34px; }
.brand-text { display: grid; line-height: 1; }
.brand-eva { font-size: 22px; font-weight: 700; letter-spacing: -0.01em; color: var(--ink); }
.brand-by { white-space: nowrap; font-size: 9.5px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2); margin-top: 3px; }
.side-head { font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2); padding: 8px 8px 8px; }
.nav-item { padding: 8px 10px; border-radius: var(--radius-s); color: var(--ink-2); }
.nav-item .ico { stroke: currentColor; }
.nav-item.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.side-foot { border-top: 0; gap: 8px; }
.mode { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink-2); padding: 0 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mode-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); flex: none; }
.side-link { display: flex; align-items: center; gap: 10px; padding: 8px 10px; }

/* list column */
.list { background: var(--canvas); }
.list-head { align-items: center; gap: 10px; padding: 22px 16px 14px; }
.list-head .ico { color: var(--accent); width: 20px; height: 20px; }
.list-head .count { margin-left: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 0 9px; font-size: 12px; color: var(--ink-2); }
.list .search { margin: 0 14px 14px; width: calc(100% - 28px); border-radius: var(--radius-s); }
.items { padding: 0 10px 12px; flex: 1; }
.items li + li { margin-top: 6px; }
.items a { gap: 10px; padding: 10px 12px; border-radius: var(--radius-s); }
.items a:hover { background: var(--surface); }
.items a.on { background: var(--accent-soft); box-shadow: none; }
.items .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--ink-3); }
.items .dot::before { display: none; }
.items .dot.tone-ok { background: var(--ok); } .items .dot.tone-action { background: var(--accent); } .items .dot.tone-warn { background: var(--warn); }
.items .dot.tone-bad { background: var(--bad); } .items .dot.tone-info { background: var(--info); }
.li-title { flex: 1; min-width: 0; font-weight: 500; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.li-meta { color: var(--ink-3); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* main column: breadcrumb bar + content */
.main-col { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 12px 28px; border-bottom: 1px solid var(--line); background: var(--surface); }
.crumbs { display: flex; gap: 10px; color: var(--ink-2); font-size: 13px; }
.crumbs .sep { color: var(--ink-3); }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.pill-badge { border: 1px solid var(--accent-soft); color: var(--accent); background: var(--accent-tint); border-radius: var(--radius-s); padding: 3px 10px; font-size: 12.5px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 12.5px; text-decoration: none; }
.content { flex: 1; }

/* header */
.detail-head { padding: 24px 28px 16px; gap: 12px; }
.head-title { gap: 12px; }
.tile { width: 40px; height: 40px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; flex: none; }
.tile .ico { width: 20px; height: 20px; }
.head-title h1 { font-size: 26px; font-weight: 700; letter-spacing: -0.015em; }
.version { border: 1px solid var(--accent-soft); background: var(--accent-tint); color: var(--accent); border-radius: 6px; padding: 1px 8px; font-size: 12.5px; font-weight: 600; }
.head-status { margin-left: auto; }
.head-meta { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 22px; color: var(--ink-2); font-size: 13.5px; }
.head-meta li { display: flex; align-items: center; gap: 6px; }
.head-meta .ico { color: var(--accent); width: 16px; height: 16px; }
.chip { border-radius: 8px; font-weight: 500; }
.chip.tone-ok::before, .chip.tone-action::before, .chip.tone-warn::before, .chip.tone-info::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip.tone-ok { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ok) 30%, transparent); }

/* tabs */
.tabs { display: flex; gap: 6px; padding: 0 28px 14px; border-bottom: 1px solid var(--line); margin: 0 0 18px; overflow-x: auto; }
.tabs a { display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border-radius: var(--radius-s); color: var(--ink-2); text-decoration: none; white-space: nowrap; }
.tabs a:hover { color: var(--ink); background: var(--canvas); }
.tabs a.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.tabs .ico { width: 16px; height: 16px; }

/* summary: KPIs, two-column rows, cards */
.summary { display: grid; gap: 14px; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.kpi { display: flex; align-items: center; gap: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; min-width: 0; }
.kpi-ico { width: 40px; height: 40px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; flex: none; }
.kpi-text { display: grid; gap: 2px; min-width: 0; }
.kpi-label { font-size: 12px; color: var(--ink-2); }
.kpi-value { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.row-2.wide-left { grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; display: grid; gap: 12px; align-content: start; min-width: 0; }
.card-head { display: flex; align-items: center; gap: 10px; }
.card-head h2 { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 700; }
.card-head h2 .ico { color: var(--accent); width: 17px; height: 17px; }
.card-head > :last-child:not(h2) { margin-left: auto; }
.card-sub { color: var(--ink-2); font-size: 12.5px; margin-top: -8px; }
.card-foot { color: var(--ink-3); font-size: 12px; }
.legend-chips { display: flex; gap: 6px; }
.lc { border: 1px solid var(--line); border-radius: 6px; padding: 2px 8px; font-size: 11.5px; color: var(--ink-2); display: inline-flex; align-items: center; }
.lc.k-pv::before, .lc.k-ev::before { width: 12px; margin-right: 5px; }

.rows { display: grid; grid-template-columns: 1fr auto; gap: 9px 16px; margin: 0; }
.rows dt { color: var(--ink-2); }
.rows dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.callout { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-radius: var(--radius-s); font-size: 13px; }
.callout .ico { width: 16px; height: 16px; }
.callout strong { font-weight: 700; }
.callout.tone-warn { background: var(--warn-soft); color: var(--warn); }
.callout.tone-bad { background: var(--bad-soft); color: var(--bad); }
.callout.tone-ok { background: var(--ok-soft); color: var(--ok); }
.callout.tone-info { background: var(--info-soft); color: var(--info); }
.grand-total { display: flex; justify-content: space-between; align-items: baseline; border-top: 1px solid var(--line); padding-top: 12px; }
.grand-total strong { font-size: 22px; font-weight: 700; color: var(--ink); }

.scope-bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.sb-row { display: flex; align-items: center; gap: 10px; }
.sb-row .ico { color: var(--accent); width: 16px; height: 16px; }
.sb-name { flex: 1; min-width: 0; }
.sb-pct { font-weight: 700; font-variant-numeric: tabular-nums; font-size: 13px; }
.sb-track { display: block; height: 4px; margin: 6px 0 0 26px; background: var(--canvas); border-radius: 999px; overflow: hidden; }
.sb-fill { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.scope-list { list-style: none; margin: 0; padding: 0; display: grid; }
.scope-list li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.scope-list li:first-child { border-top: 0; }
.scope-list .ico { color: var(--accent); width: 16px; height: 16px; }
.sl-name { flex: 1; min-width: 0; display: grid; }
.sl-name small { color: var(--ink-2); font-size: 12px; }

/* actions under the content */
.actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; padding: 18px 0 8px; }
.actions .spacer { flex: 1; }
.actions .notice { color: var(--ink-2); font-size: 13px; }
.btn { display: inline-flex; align-items: center; gap: 8px; }
.btn .ico { width: 16px; height: 16px; }
.btn:not(.primary):not(.bad):not(.quiet-bad) { border-color: var(--line-2); color: var(--ink); font-weight: 600; }
.btn:not(.primary):not(.bad):not(.quiet-bad):hover:not(:disabled) { background: var(--canvas); }
.btn.primary { font-weight: 600; padding: 8px 18px; border-radius: var(--radius-s); }
.actions .btn { border-radius: var(--radius-s); }

/* ---------- responsive: phone and small tablet ---------- */
@media (max-width: 1180px) {
	.row-2, .row-2.wide-left { grid-template-columns: minmax(0, 1fr); }
	.kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.split { grid-template-columns: minmax(0, 1fr); }
	.inspector { position: static; }
	.summary-grid { grid-template-columns: minmax(0, 1fr); }
	.plan-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) {
	.shell, .shell.no-list { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
	.side { flex-direction: row; align-items: center; padding: 8px 10px; gap: 4px; border-right: 0; border-bottom: 1px solid var(--line); overflow-x: auto; }
	.side .brand { padding: 0 8px 0 4px; }
	.side-head, .side-link { display: none; }
	.side-foot { margin: 0 0 0 auto; border: 0; padding: 0; }
	.side-foot .nav-item span { display: none; }
	.nav-item { padding: 6px 10px; }
	.shell.has-detail .list { display: none; }
	.side .brand-block { padding: 0 6px 0 2px; }
	.brand-block img { width: 28px; height: 28px; }
	.side-foot .mode { display: none; }
	.side-link span { display: none; }
	.topbar { padding: 10px 14px; }
	.crumbs { display: none; }
	.tabs { padding: 0 12px 10px; }
	.head-status { margin-left: 0; }
	.kpis { gap: 10px; }
	.kpi { padding: 12px; gap: 10px; }
	.kpi-ico { width: 32px; height: 32px; }
	.kpi-value { font-size: 16px; white-space: normal; }
	.shell:not(.has-detail) .main-col { display: none; }
	.list { border-right: 0; }
	.back { display: inline-block; padding: 12px 16px 0; color: var(--accent); text-decoration: none; }
	.detail-head { padding: 12px 16px; }
	.project-heading h1 { font-size: 20px; }
	.project-heading .head-meta { font-size: 12px; gap: 4px 14px; }
	.detail-body { padding: 0 12px 16px; }
	.action-bar { padding: 10px 12px; }
	.action-bar .notice { flex-basis: 100%; order: -1; }
	.grid-scroll { max-height: none; }
	.big-num { font-size: 34px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
@media (max-width: 520px) {
	.chart .tick, .chart .today-label { font-size: 18px; }
	.chart .date-tick:nth-of-type(even) { display: none; }
}

/* ---------- print ---------- */
#print-root { display: none; }
@media print {
	body { background: #fff; color: #000; }
	#app, .toast, .dlg { display: none !important; }
	#print-root { display: block; }
	.p-doc { font: 10.5pt/1.4 var(--font); }
	.p-parties { display: flex; justify-content: space-between; gap: 24px; margin-bottom: 18pt; }
	.p-doc h1 { font-size: 16pt; margin-bottom: 8pt; }
	.p-doc dl { display: grid; grid-template-columns: max-content 1fr max-content 1fr; gap: 2pt 12pt; margin: 0 0 14pt; }
	.p-doc dd { margin: 0; }
	.p-table { width: 100%; border-collapse: collapse; font-size: 9.5pt; }
	.p-table th { text-align: left; border-bottom: 1pt solid #000; padding: 3pt 4pt; }
	.p-table td { padding: 2pt 4pt; border-bottom: .5pt solid #ccc; }
	.p-table .r { text-align: right; font-variant-numeric: tabular-nums; }
	.p-table tr.d0 td { font-weight: 700; }
	.p-table tr.ProjectContainerProductElement td { font-weight: 700; }
	.p-table tr.ProjectWorkElement td:first-child { font-style: italic; }
	.p-sum { margin: 12pt 0 0 auto; border-collapse: collapse; }
	.p-sum th { text-align: left; font-weight: 400; padding: 2pt 18pt 2pt 0; }
	.p-sum td { text-align: right; }
	.p-sum .tot th, .p-sum .tot td { font-weight: 700; font-size: 12pt; border-top: 1pt solid #000; padding-top: 4pt; }
	.p-foot { margin-top: 24pt; color: #666; font-size: 8.5pt; }
	tr { break-inside: avoid; }
}

/* ---------- v3: bigger disclosure chevrons, sticky action bar, messaging ---------- */
.disc { width: 24px; height: 24px; border-radius: 6px; color: var(--ink-2); display: inline-grid; place-items: center; font-size: 0; }
.disc svg { width: 16px; height: 16px; transition: transform .15s ease; }
.disc.open svg { transform: rotate(90deg); }
.disc:hover { background: var(--accent-soft); color: var(--accent); }
.disc-sp { width: 24px; }
.grid tbody tr.sel .disc { color: #fff; }
.grid tbody tr.sel .disc:hover { background: rgba(255, 255, 255, .2); }

/* the content column scrolls; the actions stay pinned to its bottom edge */
.detail { min-height: 100%; }
.detail-body { display: flex; flex-direction: column; }
.detail-body > .actions { position: sticky; bottom: 0; z-index: 3; margin: auto -28px 0; padding: 12px 28px; background: color-mix(in srgb, var(--canvas) 90%, transparent);
	backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border-top: 1px solid var(--line); }
.detail-body > :not(.actions):last-of-type { margin-bottom: 16px; }
.detail-body { padding-bottom: 0; }
.grid-scroll { max-height: calc(100dvh - 400px); }
.icon-btn { appearance: none; border: 1px solid var(--accent-soft); background: var(--surface); color: var(--accent); width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; cursor: pointer; margin-left: 6px; }
.icon-btn:hover { background: var(--accent-tint); }
.icon-btn .ico { width: 16px; height: 16px; }
.list-head .count + .icon-btn { margin-left: 6px; }
.list-head .count { margin-left: auto; }

.items a.msg { align-items: flex-start; }
.items a.msg .dot { margin-top: 6px; }
.items .dot.tone-none { background: transparent; }
.msg-main { flex: 1; min-width: 0; display: grid; gap: 2px; }
.msg-who { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-subject { font-size: 12.5px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.items a.msg.unread .msg-who, .items a.msg.unread .msg-subject { font-weight: 700; color: var(--ink); }
.items a.msg .li-meta { margin-top: 2px; }
.message-card { max-width: 860px; }
.message-body { white-space: pre-wrap; line-height: 1.6; max-width: 72ch; overflow-wrap: anywhere; }
@media (max-width: 860px) {
	.detail-body > .actions { margin: auto -12px 0; padding: 10px 12px; }
}
.list-head h2 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }

/* ---------- v4: editable profile ---------- */
.profile-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 14px; align-items: start; }
.profile-col { display: grid; gap: 14px; align-content: start; }
.profile-grid .card { display: grid; gap: 12px; align-content: start; }
.profile-grid .card-head { margin-bottom: 0; }
.form-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.form-row > .field.narrow { max-width: none; }
.form-row:has(> .narrow) { grid-template-columns: minmax(96px, 0.42fr) minmax(0, 1fr); }
.field input:focus-visible, .field select:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.field input::placeholder { color: var(--ink-3, #9aa0a6); }
.profile-grid .lang { justify-self: start; }
.role-chips { display: inline-flex; gap: 6px; }
.form-error[hidden] { display: none; }
@media (max-width: 1100px) { .profile-grid { grid-template-columns: minmax(0, 1fr); } .profile-col { display: contents; } .profile-prefs { order: 3; } }
@media (max-width: 520px) { .form-row { grid-template-columns: minmax(0, 1fr); } .form-row:has(> .narrow) { grid-template-columns: minmax(84px, 0.4fr) minmax(0, 1fr); } }
.mode.offline .mode-dot { background: var(--warn); }
.stale-note { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; background: var(--warn-soft); color: var(--ink); border-radius: var(--radius-s); padding: 10px 14px; margin-bottom: 14px; }
.stale-note[hidden] { display: none; }
.stale-note .btn { margin-left: auto; }

/* ---------- v5: resizable side columns (js/ui/resize.js) ---------- */
.shell { grid-template-columns: var(--side-w, 200px) var(--list-w, 280px) minmax(0, 1fr); }
.shell.no-list { grid-template-columns: var(--side-w, 200px) minmax(0, 1fr); }
.side, .list { position: relative; min-width: 0; }
.list-head h2, .li-title, .msg-who, .msg-subject, .nav-item > span:not(.badge) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.col-resizer { position: absolute; top: 0; right: -4px; width: 8px; height: 100%; cursor: col-resize; z-index: 5; touch-action: none; }
.col-resizer::after { content: ""; position: absolute; top: 0; bottom: 0; left: 3px; width: 2px; background: transparent; transition: background .15s; }
/* Only the separator under the pointer, focused, or being dragged; never the other one during a drag. */
.shell:not(.resizing) .col-resizer:hover::after, .col-resizer:focus-visible::after, .col-resizer.dragging::after { background: var(--accent); }
.col-resizer:focus-visible { outline: none; }
.shell.resizing, .shell.resizing * { cursor: col-resize !important; user-select: none; }
/* Icon rail: the sidebar narrowed below the snap point keeps icons only (labels as tooltips). */
.shell.rail .side { padding-left: 8px; padding-right: 8px; align-items: stretch; }
.shell.rail .brand-text, .shell.rail .side-head, .shell.rail .nav-item > span:not(.badge), .shell.rail .side-link > span, .shell.rail .side-foot .mode { display: none; }
.shell.rail .brand-block { justify-content: center; padding-left: 0; padding-right: 0; }
.shell.rail .nav-item, .shell.rail .side-link { justify-content: center; padding-left: 0; padding-right: 0; position: relative; }
.shell.rail .nav-item .badge { position: absolute; top: 2px; right: 6px; min-width: 16px; font-size: 10px; line-height: 16px; padding: 0 4px; }
.shell.rail .side-head + .nav-item, .shell.rail .nav-item + .side-head + .nav-item { margin-top: 10px; }
@media (max-width: 860px) {
	.col-resizer { display: none; }
	.shell, .shell.no-list { grid-template-columns: minmax(0, 1fr); }
	.shell.rail .nav-item > span:not(.badge) { display: initial; }
}
/* The detail area reflows on its own width (it changes when the side columns are resized), not the window's. */
.content { container-type: inline-size; container-name: detail; }
@container detail (max-width: 980px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@container detail (max-width: 820px) {
	.summary-grid, .row-2, .row-2.wide-left, .split, .plan-grid, .profile-grid { grid-template-columns: minmax(0, 1fr); }
	.profile-col { display: contents; } .profile-prefs { order: 3; }
}
@container detail (max-width: 460px) { .kpis { grid-template-columns: minmax(0, 1fr); } }

/* ======================================================================
   v6 — subscriber side: company, resources, utilization, agenda
   ====================================================================== */
.small { font-size: 12px; }
.mt { margin-top: 14px; }
.tone-bad-text { color: var(--bad); }
.notice.below { margin: 4px 2px 0; color: var(--ink-2); font-size: 12.5px; }
.kpis.kpis-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kpi-value .chip { font-size: 13px; }
.field-hint { margin: -4px 0 0; font-size: 12px; color: var(--ink-2); }
.with-suffix { position: relative; display: block; }
.with-suffix input { width: 100%; padding-right: 30px; }
.with-suffix .suffix { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); color: var(--ink-2); pointer-events: none; }

/* segmented control (list status tabs, agenda filters) */
.seg { display: flex; gap: 2px; padding: 3px; margin: 0 14px 10px; background: var(--canvas); border: 1px solid var(--line); border-radius: 10px; }
.seg button { flex: 1; appearance: none; border: 0; background: transparent; color: var(--ink-2); font: inherit; font-size: 12.5px; font-weight: 600; padding: 6px 8px; border-radius: 7px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap; }
.seg button:hover { color: var(--ink); }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08), 0 0 0 1px var(--line); }
.seg-count { font-size: 11px; font-weight: 700; min-width: 18px; padding: 0 5px; border-radius: 999px; background: var(--line); color: var(--ink-2); }
.seg button.on .seg-count { background: var(--accent-soft); color: var(--accent); }
.seg button.warn .seg-count { background: var(--bad-soft); color: var(--bad); }
.items .dot.tone-muted { background: var(--ink-3); }

/* simple tables */
table.simple { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.simple th { text-align: left; font-size: 11.5px; font-weight: 600; color: var(--ink-2); text-transform: uppercase; letter-spacing: .04em; padding: 0 8px 8px; border-bottom: 1px solid var(--line); }
table.simple td { padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.simple tr:last-child td { border-bottom: 0; }
table.simple .num { text-align: right; font-variant-numeric: tabular-nums; }

/* company: plan */
.plan-hero { display: flex; flex-wrap: wrap; gap: 20px; align-items: center; justify-content: space-between; padding: 22px 24px; border-radius: var(--radius);
	background: linear-gradient(120deg, var(--accent-tint), var(--surface) 70%); border: 1px solid var(--accent-soft); box-shadow: var(--shadow); margin-bottom: 14px; }
.plan-kicker { margin: 0; font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }
.plan-name { margin: 4px 0 6px; font-size: 26px; }
.plan-desc { margin: 0; color: var(--ink-2); max-width: 52ch; }
.plan-price { display: grid; justify-items: end; gap: 4px; }
.plan-price .amount { font-size: 30px; font-weight: 800; font-variant-numeric: tabular-nums; }
.plan-price .cycle { color: var(--ink-2); font-size: 13px; }
.feature-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.feature-list li { display: grid; grid-template-columns: 18px 1fr auto; gap: 10px; align-items: center; }
.feature-list .ico { color: var(--ok); width: 16px; height: 16px; }

/* resources: detail */
.res-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: start; }
.res-grid .span-2, .res-grid .card.span-2 { grid-column: 1 / -1; }
.person { display: flex; gap: 14px; align-items: center; margin-bottom: 12px; }
.person-name { margin: 0; font-weight: 700; font-size: 16px; }
.person .muted { margin: 2px 0 0; }
.contact-lines { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.contact-lines li { display: flex; gap: 10px; align-items: center; min-width: 0; }
.contact-lines a { color: var(--ink); text-decoration: none; overflow: hidden; text-overflow: ellipsis; }
.contact-lines a:hover { color: var(--accent); text-decoration: underline; }
.contact-lines .ico { color: var(--ink-2); }
.avatar-dot { width: 28px; height: 28px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 11px; font-weight: 700; flex: none; color: #fff; background: var(--ink-3); border: 2px solid var(--surface); }
.avatar-dot.lg { width: 48px; height: 48px; font-size: 16px; }
.avatar-dot.hue-0 { background: #d63384; } .avatar-dot.hue-1 { background: #6f42c1; } .avatar-dot.hue-2 { background: #0d8a6a; }
.avatar-dot.hue-3 { background: #c2410c; } .avatar-dot.hue-4 { background: #2563eb; } .avatar-dot.hue-5 { background: #8a6d00; }
.avatar-dot.more { background: var(--canvas); color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line); }
.quals { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.quals li { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; }
.q-name { font-weight: 600; }
.q-level { display: inline-flex; gap: 3px; }
.q-level span { width: 14px; height: 6px; border-radius: 3px; background: var(--line); }
.q-level span.on { background: var(--accent); }
.q-level-label { font-size: 12px; color: var(--ink-2); min-width: 72px; }

/* utilization bars */
.util { display: grid; grid-template-columns: minmax(60px, 1fr) 46px; gap: 10px; align-items: center; }
.util-track { position: relative; height: 8px; border-radius: 999px; background: var(--canvas); box-shadow: inset 0 0 0 1px var(--line); overflow: hidden; display: block; }
.util-fill { position: absolute; inset: 0 auto 0 0; border-radius: 999px; background: var(--ok); }
.util-excess { position: absolute; inset: 0 0 0 auto; background: repeating-linear-gradient(-45deg, var(--bad) 0 4px, transparent 4px 7px); opacity: .9; }
.util-mid .util-fill { background: var(--info); } .util-high .util-fill { background: var(--warn); } .util-over .util-fill { background: var(--bad); }
.util-low .util-fill { background: var(--ink-3); }
.util-num { font-size: 12.5px; font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }
.util-over .util-num { color: var(--bad); }
.util-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.util-pair .kpi-label { margin: 0 0 6px; }

/* day strip */
.strip { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(6px, 1fr); gap: 3px; }
.strip .cell, .strip-legend .cell { height: 22px; border-radius: 4px; background: var(--canvas); box-shadow: inset 0 0 0 1px var(--line); display: block; }
.strip.compact .cell { height: 16px; border-radius: 3px; }
.strip .cell.monday { margin-left: 3px; }
.cell.off { background: transparent; box-shadow: none; }
.strip .cell.off { background: repeating-linear-gradient(90deg, var(--line) 0 1px, transparent 1px 3px); opacity: .5; }
.cell.l1 { background: var(--canvas); }
.cell.l2 { background: color-mix(in srgb, var(--ok) 25%, var(--surface)); box-shadow: none; }
.cell.l3 { background: color-mix(in srgb, var(--ok) 55%, var(--surface)); box-shadow: none; }
.cell.l4 { background: var(--ok); box-shadow: none; }
.cell.over { background: var(--bad); box-shadow: none; }
.cell.absent { background: repeating-linear-gradient(-45deg, var(--warn) 0 3px, var(--warn-soft) 3px 6px); box-shadow: none; }
.strip .cell.today { outline: 2px solid var(--accent); outline-offset: 1px; }
.strip-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 11.5px; color: var(--ink-2); margin-top: 8px; }
.card-head .strip-legend { margin: 0; }
.strip-legend > span { display: inline-flex; align-items: center; gap: 6px; }
.strip-legend .cell { width: 12px; height: 12px; display: inline-block; }
.entries { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 2px; }
.entries li { display: grid; grid-template-columns: 150px minmax(0, 1.4fr) minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 8px 10px; border-radius: 8px; font-size: 13.5px; }
.entries li:nth-child(odd) { background: var(--canvas); }
.entries .e-when { color: var(--ink-2); font-variant-numeric: tabular-nums; }
.entries .e-what { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.entries .e-where { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.entries .e-hours { font-variant-numeric: tabular-nums; color: var(--ink-2); }
.entries li.absence { background: var(--warn-soft); }
.entries li.absence .e-what { color: var(--warn); }
.entries.compiled li { grid-template-columns: 120px minmax(0, 1.2fr) minmax(0, 1fr) 64px; }
.entries.compiled .e-hours, .entries.compiled .chip { justify-self: end; }

/* utilization table */
.util-table { display: grid; }
.ut-row { display: grid; grid-template-columns: minmax(180px, 1.3fr) minmax(120px, .7fr) minmax(120px, .7fr) minmax(260px, 2.2fr); gap: 18px; align-items: center; padding: 10px 6px; border-bottom: 1px solid var(--line); color: inherit; text-decoration: none; border-radius: 8px; }
a.ut-row:hover { background: var(--canvas); }
.ut-row:last-child { border-bottom: 0; }
.ut-head { font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-2); padding-top: 0; }
.ut-head > span:first-letter { text-transform: uppercase; }
.ut-who { display: flex; gap: 10px; align-items: center; min-width: 0; }
.ut-who > span:last-child { display: grid; min-width: 0; }
.ut-who strong, .ut-who small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ut-who small { color: var(--ink-2); }
.strip-weeks { display: grid; grid-template-columns: repeat(6, 1fr); text-transform: none; letter-spacing: 0; font-weight: 500; }

/* agenda */
.agenda .kpis { margin-bottom: 14px; }
.week-strip { display: grid; grid-template-columns: repeat(14, minmax(0, 1fr)); gap: 6px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 14px; }
.ws-day { appearance: none; border: 0; background: transparent; font: inherit; color: var(--ink-2); display: grid; justify-items: center; gap: 4px; padding: 4px 0; border-radius: 8px; cursor: pointer; }
.ws-day:hover { background: var(--canvas); color: var(--ink); }
.ws-day:nth-child(7) { margin-right: 6px; }
.ws-name { font-size: 11px; text-transform: uppercase; }
.ws-bar { width: 60%; max-width: 22px; height: 40px; border-radius: 6px; background: var(--canvas); display: flex; align-items: flex-end; overflow: hidden; }
.ws-bar span { display: block; width: 100%; background: var(--accent); border-radius: 6px 6px 0 0; opacity: .75; }
.ws-num { font-size: 13px; font-weight: 700; color: var(--ink); width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; }
.ws-day.today .ws-num { background: var(--accent); color: var(--accent-ink); }
.ws-day.today .ws-bar span { opacity: 1; }
.ws-day.weekend { opacity: .55; }
.ws-day.past .ws-bar span { background: var(--ink-3); }
.ag-filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 6px; position: sticky; top: 0; z-index: 3; padding: 10px 0; background: var(--canvas); }
.ag-filters .seg { margin: 0; }
.ag-filters .seg button { flex: none; padding: 6px 12px; }
.agenda-project { max-width: 240px; }
.agenda-search { width: 230px; margin: 0; }
.ag-group { margin-top: 10px; scroll-margin-top: 64px; }
.ag-head { display: flex; align-items: baseline; gap: 10px; font-size: 15px; margin: 14px 4px 8px; }
.ag-head small { color: var(--ink-2); font-weight: 500; font-size: 13px; }
.ag-head .count { margin-left: auto; font-size: 12px; color: var(--ink-2); font-weight: 600; }
.ag-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ag-card { display: grid; grid-template-columns: 88px minmax(0, 1fr) auto; gap: 16px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--line-2); border-radius: var(--radius); padding: 12px 16px 12px 14px; box-shadow: var(--shadow); transition: transform .12s, box-shadow .12s; }
.ag-card:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(0,0,0,.07); }
.ag-card.st-late { border-left-color: var(--bad); }
.ag-card.st-running { border-left-color: var(--info); }
.ag-card.st-due { border-left-color: var(--warn); }
.ag-card.st-upcoming { border-left-color: var(--accent-soft); }
.ag-time { display: grid; gap: 1px; font-variant-numeric: tabular-nums; }
.ag-time strong { font-size: 17px; }
.ag-time span { color: var(--ink-2); font-size: 12.5px; }
.ag-time small { color: var(--ink-3); font-size: 11.5px; }
.ag-main { min-width: 0; display: grid; gap: 6px; }
.ag-title { display: flex; gap: 10px; align-items: center; min-width: 0; font-weight: 650; font-size: 14.5px; }
.ag-title > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ag-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; color: var(--ink-2); font-size: 12.5px; }
.ag-meta > span { display: inline-flex; gap: 5px; align-items: center; min-width: 0; }
.ag-meta .ico { width: 14px; height: 14px; }
.ag-loc { color: var(--ink); font-weight: 600; }
.ag-progress { display: grid; grid-template-columns: minmax(80px, 220px) auto; gap: 8px; align-items: center; font-size: 12px; color: var(--ink-2); }
.ag-progress .pbar-fill { background: var(--info); }
.ag-side { display: flex; align-items: center; gap: 14px; }
.ag-who { display: flex; }
.ag-who .avatar-dot + .avatar-dot { margin-left: -8px; }
.ag-unassigned { font-size: 12px; color: var(--ink-3); font-style: italic; }
.ag-card .btn { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; min-width: 108px; justify-content: center; }
.ag-card .btn .ico { width: 15px; height: 15px; }
.ag-card .btn.finish { border-color: var(--ok); color: var(--ok); }
.ag-card .btn.finish:hover:not(:disabled) { background: var(--ok-soft); }
.ag-empty { padding: 48px 0; color: var(--ink-2); display: grid; justify-items: center; gap: 8px; }
.ag-empty .ico { width: 36px; height: 36px; color: var(--ink-3); }

@container detail (max-width: 980px) {
	.res-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.ut-row { grid-template-columns: minmax(150px, 1fr) minmax(110px, .8fr) minmax(110px, .8fr); }
	.ut-row > span:last-child { grid-column: 1 / -1; }
	.ut-head > span:last-child { display: none; }
	.entries li, .entries.compiled li { grid-template-columns: 110px minmax(0, 1fr) auto; }
	.entries .e-where { display: none; }
	/* compiled: the client goes under the project rather than away */
	.entries.compiled li { row-gap: 2px; }
	.entries.compiled .e-where { display: block; grid-column: 2; grid-row: 2; font-size: 12.5px; }
	.entries.compiled .e-where:empty { display: none; }
	.entries.compiled .e-when { grid-row: 1 / span 2; }
	.entries.compiled .e-hours, .entries.compiled .chip { grid-column: 3; grid-row: 1 / span 2; }
}
@container detail (max-width: 700px) {
	.res-grid, .util-pair { grid-template-columns: minmax(0, 1fr); }
	.ag-card { grid-template-columns: 64px minmax(0, 1fr); }
	.ag-side { grid-column: 1 / -1; justify-content: space-between; }
	.week-strip { grid-template-columns: repeat(7, minmax(0, 1fr)); }
	.ws-day:nth-child(n+8) { display: none; }
	.agenda-search, .agenda-project { width: 100%; max-width: none; }
	.kpis.kpis-3 { grid-template-columns: minmax(0, 1fr); }
}
.ag-filters select.agenda-project { appearance: none; font: inherit; color: var(--ink); background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 6l4 4 4-4' fill='none' stroke='%23888' stroke-width='1.6'/%3E%3C/svg%3E") no-repeat right 10px center / 14px;
	border: 1px solid var(--line-2); border-radius: var(--radius-s); padding: 8px 32px 8px 12px; min-width: 180px; max-width: 260px; cursor: pointer; }
.ag-filters select.agenda-project:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.ag-filters input.agenda-search { flex: 0 1 280px; width: auto; margin: 0; }
.ag-filters .spacer { flex: 1; }
.form-row.tax-row { grid-template-columns: minmax(0, 1fr) 130px; }
.with-suffix input { color: var(--ink); }
.detail-body > .kpis { margin-bottom: 14px; }
.list .seg button { flex: 1 1 0; min-width: 0; padding: 6px 4px; gap: 4px; font-size: 12px; }
.list .seg-count { min-width: 16px; padding: 0 4px; }
.strip .cell.off { background: transparent; box-shadow: inset 0 -2px 0 var(--line); opacity: 1; }
.entries li { grid-template-columns: 170px minmax(0, 1.4fr) minmax(0, 1fr) auto; }
.entries .e-when { white-space: nowrap; }
/* primary buttons keep their fill on hover (the generic .btn:hover tint made white text unreadable) */
.btn.primary:hover:not(:disabled) { background: var(--accent); }
.ag-card .ag-side .btn.finish:not(.primary) { border-color: var(--ok); color: var(--ok); }
.ag-card .ag-side .btn.finish:not(.primary):hover:not(:disabled) { background: var(--ok-soft); }
@media (max-width: 860px) {
	.agenda .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.ag-filters .seg { overflow-x: auto; max-width: 100%; }
}

/* resource detail: sticky identity banner and editor */
.res-detail .res-banner { position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--canvas) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.res-banner .head-title { align-items: center; gap: 16px; flex-wrap: nowrap; }
.res-banner h1 { margin: 0; }
.res-id { display: grid; gap: 6px; min-width: 0; flex: 0 1 auto; }
.res-facts { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 18px; color: var(--ink-2); font-size: 13px; }
.res-facts li { display: inline-flex; align-items: center; gap: 6px; }
.res-facts .ico { width: 15px; height: 15px; color: var(--accent); }
.res-banner .head-status { margin-left: auto; }
.res-quick { display: flex; gap: 6px; flex: none; align-items: center; }
.res-quick .btn { white-space: nowrap; }
.res-quick .icon-btn { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink-2); }
.res-quick .icon-btn:hover { color: var(--accent); border-color: var(--accent-soft); }
.avatar-dot.md { width: 52px; height: 52px; font-size: 18px; }
.res-col { display: grid; gap: 14px; align-content: start; }
.res-grid > .card, .res-col > .card { display: grid; gap: 12px; align-content: start; }
.field input:disabled, .field select:disabled { background: var(--canvas); color: var(--ink-2); cursor: not-allowed; }
.field-hint.lock { display: flex; gap: 8px; align-items: flex-start; margin: 0; padding: 8px 10px; border-radius: var(--radius-s); background: var(--info-soft); color: var(--ink); }
.field-hint.lock .ico { color: var(--info); flex: none; margin-top: 1px; }
.derived-row { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; align-items: baseline; padding: 10px 12px; border-radius: var(--radius-s); background: var(--canvas); }
.derived-row > span { font-size: 13px; color: var(--ink-2); }
.derived-row output { font-weight: 700; font-variant-numeric: tabular-nums; justify-self: end; }
.derived-row small { grid-column: 1 / -1; color: var(--ink-3); font-size: 11.5px; }
@container detail (max-width: 700px) { .res-banner .head-title { flex-wrap: wrap; } .res-banner .head-status { margin-left: 0; } }
.res-detail > .detail-body { padding-top: 16px; }
.res-detail .res-banner { background: color-mix(in srgb, var(--canvas) 97%, transparent); }

/* ---------- v7: clients (mini CRM) ---------- */
.btn.sm { padding: 6px 12px; font-size: 13px; min-height: 0; }
.res-quick .btn.sm { margin-left: 4px; }
.res-facts .on-eva { color: var(--ok); font-weight: 600; }

/* list: two lines per client */
.client-items a { align-items: flex-start; }
.client-items .dot { margin-top: 6px; }
.ci-text { flex: 1; min-width: 0; display: grid; gap: 2px; }
.ci-line { display: flex; gap: 8px; align-items: baseline; min-width: 0; }
.ci-sub { display: flex; gap: 5px; align-items: center; color: var(--ink-3); font-size: 12px; min-width: 0; }
.ci-sub > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ci-sub .ico { width: 13px; height: 13px; flex: none; }
.client-item.follow .ci-sub { color: var(--warn); font-weight: 500; }

/* detail */
.crm-alert { display: flex; gap: 10px; align-items: center; padding: 10px 14px; margin-bottom: 14px; border-radius: var(--radius-s); background: var(--warn-soft); color: var(--warn); font-size: 13.5px; }
.crm-alert .ico { width: 18px; height: 18px; flex: none; }
.crm-alert strong { font-weight: 700; }
.crm-kpis { margin-bottom: 16px; }
.kpi-sub { display: block; font-size: 11.5px; font-weight: 500; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crm-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(300px, 1fr); gap: 16px; align-items: start; }
.crm-side { display: grid; gap: 16px; min-width: 0; }
.card-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 12px; }

/* quick entry */
.composer { border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--canvas); padding: 10px; display: grid; gap: 8px; margin-bottom: 18px; }
.composer:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.type-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.type-pill { display: inline-flex; align-items: center; gap: 5px; padding: 5px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink-2); font: inherit; font-size: 12.5px; cursor: pointer; }
.type-pill .ico { width: 14px; height: 14px; }
.type-pill:hover { border-color: var(--line-2); color: var(--ink); }
.type-pill.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.composer-text { width: 100%; resize: vertical; min-height: 64px; border: 0; background: transparent; font: inherit; font-size: 14px; color: var(--ink); padding: 4px 2px; outline: none; }
.composer-foot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.composer-when { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); }
.composer-when .ico { width: 15px; height: 15px; }
.composer-date { font: inherit; font-size: 13px; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 4px 6px; }
.composer-foot .spacer { flex: 1; }

/* timeline */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 15px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.ev { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 12px; padding: 6px 0; position: relative; }
.ev-dot { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); border: 2px solid var(--line); color: var(--ink-2); z-index: 1; }
.ev-dot .ico { width: 15px; height: 15px; }
.ev-interaction .ev-dot { background: var(--accent-soft); border-color: var(--accent-soft); color: var(--accent-ink); }
.ev-interaction.it-6 .ev-dot { background: var(--bad-soft); border-color: var(--bad-soft); color: var(--bad); }
.ev-milestone.tone-ok .ev-dot { color: var(--ok); border-color: var(--ok-soft); background: var(--ok-soft); }
.ev-milestone.tone-bad .ev-dot { color: var(--bad); border-color: var(--bad-soft); background: var(--bad-soft); }
.ev-milestone.tone-warn .ev-dot { color: var(--warn); border-color: var(--warn-soft); background: var(--warn-soft); }
.ev-body { min-width: 0; padding-top: 5px; }
.ev-head { display: flex; align-items: center; gap: 6px; margin: 0; font-size: 13.5px; flex-wrap: wrap; }
.ev-head .spacer { flex: 1; }
.ev-head time { color: var(--ink-3); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ev-milestone .ev-head { color: var(--ink-2); }
.ev-milestone .ev-head strong { color: var(--ink); font-weight: 600; }
.ev-text { margin: 4px 0 6px; padding: 10px 12px; background: var(--canvas); border-radius: var(--radius-s); white-space: pre-wrap; font-size: 14px; line-height: 1.5; }
.ev-del { width: 28px; height: 28px; opacity: 0; transition: opacity .15s; }
.ev-del .ico { width: 15px; height: 15px; }
.ev:hover .ev-del, .ev-del:focus-visible { opacity: 1; }
@media (hover: none) { .ev-del { opacity: .6; } }
.timeline + .btn { margin: 8px 0 0 44px; }
.timeline-empty { padding: 8px 0 4px; color: var(--ink-2); }
.timeline-empty p { margin: 0 0 10px; }
.suggest { display: flex; gap: 8px; flex-wrap: wrap; }

/* projects card */
.crm-projects { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.crm-project { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-s); border-left: 3px solid var(--line-2); }
.crm-project.stage-3 { border-left-color: var(--warn); } .crm-project.stage-4 { border-left-color: var(--ok); } .crm-project.stage-6 { border-left-color: var(--bad); }
.cp-main { flex: 1; min-width: 0; display: grid; gap: 2px; }
.cp-main strong { font-weight: 600; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cp-main small { font-size: 12px; }

@container detail (max-width: 980px) { .crm-grid { grid-template-columns: minmax(0, 1fr); } }
@container detail (max-width: 700px) { .res-quick .btn.sm span { display: none; } }
@container detail (max-width: 460px) { .crm-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .crm-kpis .kpi-ico { display: none; } }

/* ---------- v7: invitations ---------- */
.btn.invite-btn { background: var(--surface); border: 1px dashed var(--accent); color: var(--accent); margin-right: 4px; }
.btn.invite-btn:hover { background: var(--accent-soft); }
.res-facts .invite-note { color: var(--ink-3); }
.invite-who { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 4px 0 12px; padding: 12px 14px; background: var(--canvas); border-radius: var(--radius-s); font-size: 14px; }
.invite-who dt { color: var(--ink-2); }
.invite-who dd { margin: 0; }
.dlg .small { font-size: 12.5px; }
@container detail (max-width: 700px) { .invite-btn span { display: none; } }

/* Pinned identity banner: the detail must grow with its content (a shrunk flex item ends the sticky range early — seen on phones). */
.content > .detail { flex-shrink: 0; }
/* Phones: a compact pinned banner (avatar and name on one line, facts on one line, status and actions below). */
@container detail (max-width: 560px) {
	.res-detail .res-banner { padding: 10px 12px; }
	.res-banner .head-title { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; grid-template-areas: "av id id" "st qk qk"; gap: 6px 10px; align-items: center; }
	.res-banner .head-title > .avatar-dot { grid-area: av; width: 40px; height: 40px; font-size: 14px; }
	.res-banner .res-id { grid-area: id; gap: 2px; }
	.res-banner h1 { font-size: 19px; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
	.res-banner .res-facts { flex-wrap: nowrap; overflow: hidden; font-size: 12px; gap: 0 12px; -webkit-mask-image: linear-gradient(90deg, #000 88%, transparent); mask-image: linear-gradient(90deg, #000 88%, transparent); }
	.res-banner .res-facts li { flex: none; white-space: nowrap; }
	.res-banner .head-status { grid-area: st; margin: 0; }
	.res-banner .res-quick { grid-area: qk; justify-self: end; gap: 4px; }
	.res-banner .res-quick .icon-btn { width: 32px; height: 32px; }
}
/* A two-column card in a one-column grid would add an implicit column (the load card overflowed on phones). */
@container detail (max-width: 700px) { .res-grid > .span-2 { grid-column: 1 / -1; } }
.card { grid-template-columns: minmax(0, 1fr); }
@container detail (max-width: 560px) { .strip { grid-auto-columns: minmax(3px, 1fr); gap: 2px; } .strip .cell.monday { margin-left: 2px; } }
