/* WeProjectManagement — design system
   One family (Manrope), cool paper background, violet brand, PMO signal vocabulary
   (green / orange / red / blue / grey) always paired with a text label. Cards are plain
   surfaces with a hairline border: no coloured side borders, no decorative shadows. */

:root {
  color-scheme: light;
  --ink: #1a1530;
  --ink-2: #4a4560;
  --ink-3: #6b6685;
  --ink-4: #7d7892;
  --paper: #f6f5fa;
  --surface: #ffffff;
  --surface-2: #faf9fd;
  --line: #e5e2ee;
  --line-soft: #eeebf4;
  --line-2: #d3cfe0;
  --violet: #5b2bd6;
  --violet-2: #6c2bd9;
  --violet-ink: #3f1c9c;
  --lavender: #eee9fb;
  --lavender-2: #e2d9f8;
  --primary: #5b2bd6;
  --primary-hover: #3f1c9c;
  --green: #18774c;
  --green-bg: #e3f4ea;
  --green-line: #bfe3cd;
  --green-ink: #155c3b;
  --orange: #9a5800;
  --orange-bg: #fdf0d8;
  --orange-line: #f1d9a3;
  --orange-ink: #7a4a02;
  --red: #c2303c;
  --red-bg: #fbe4e6;
  --red-line: #f0bfc4;
  --red-ink: #8f1f29;
  --blue: #2457d6;
  --blue-bg: #e4ebfc;
  --blue-line: #c3d2f7;
  --blue-ink: #1c3f9e;
  --yellow-bg: #fdf3cf;
  --warm-bg: #fdf7ea;
  --grey: #8a869a;
  --grey-bg: #ecebf1;
  --heat-1: #ece8f9;
  --heat-2: #d9d0f5;
  --heat-3: #bfb0ee;
  --weekend: #f3f2f7;
  --holiday: #f3e9e9;
  --task-bg: #dfe5f3;
  --baseline: #b3afc4;
  --chrome: #1a1530;
  --chrome-edge: transparent;
  --strong-bg: #1a1530;
  --strong-fg: #ffffff;
  --tint-tag: rgba(255, 255, 255, 0.7);
  --shade: rgba(26, 21, 48, 0.08);
  --overlay: rgba(26, 21, 48, 0.45);
  --radius: 8px;
  --radius-s: 6px;
  --sidebar: 236px;
  --topbar: 56px;
  --font: "Manrope", "Segoe UI", system-ui, -apple-system, sans-serif;
  --shadow-pop: 0 12px 32px rgba(26, 21, 48, 0.14);
  --focus: 0 0 0 3px rgba(91, 43, 214, 0.28);
}

*, *::before, *::after { box-sizing: border-box; }
html { font-size: 14px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.5;
  color: var(--ink);
  background: var(--paper);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--violet); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; line-height: 1.25; letter-spacing: -0.01em; }
h1 { font-size: 1.75rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
h4 { font-size: 0.95rem; }
p { margin: 0 0 0.75rem; }
small, .small { font-size: 0.86rem; }
.muted { color: var(--ink-3); }
.strong { font-weight: 600; }
.num { font-variant-numeric: tabular-nums; text-align: right; }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 4px; }
::selection { background: var(--lavender-2); }
button, input, select, textarea { font: inherit; color: inherit; }
img, svg { vertical-align: middle; }
.icon { width: 18px; height: 18px; flex: none; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Shell: dark section bar on top, light page menu on the left ---------- */
.topbar {
  height: var(--topbar); background: var(--chrome); color: #e9e5f5; box-shadow: inset 0 -1px 0 var(--chrome-edge);
  display: flex; align-items: center; gap: 10px; padding: 0 16px 0 14px; position: sticky; top: 0; z-index: 30;
}
.brand { display: flex; align-items: center; gap: 9px; color: #fff; margin-right: 10px; }
.brand:hover { text-decoration: none; }
.brand .logo { width: 30px; height: 30px; flex: none; display: block; }
.brand .name { font-weight: 700; letter-spacing: -0.01em; white-space: nowrap; }
.brand .name span { color: #c9b8f6; }
.sections { display: flex; gap: 2px; height: 100%; align-items: stretch; overflow-x: auto; }
.sections a { display: flex; align-items: center; gap: 7px; padding: 0 11px; color: #c8c2dd; font-weight: 600; font-size: 0.93rem; white-space: nowrap; border-bottom: 3px solid transparent; border-top: 3px solid transparent; }
.sections a svg { width: 17px; height: 17px; opacity: 0.85; }
.sections a:hover { color: #fff; text-decoration: none; background: rgba(255, 255, 255, 0.05); }
.sections a.active { color: #fff; border-bottom-color: var(--violet-2); }
.topbar .spacer { flex: 1; }
.search-trigger {
  display: flex; align-items: center; gap: 8px; min-width: 230px; padding: 6px 10px;
  border: 1px solid rgba(255, 255, 255, 0.14); border-radius: 6px; background: rgba(255, 255, 255, 0.07); color: #b9b2d4; cursor: text;
}
.search-trigger svg { width: 16px; height: 16px; }
.search-trigger kbd { margin-left: auto; font-family: inherit; font-size: 0.75rem; border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 4px; padding: 0 5px; }
.icon-btn { width: 36px; height: 36px; border-radius: 6px; border: 1px solid transparent; background: transparent; display: grid; place-items: center; cursor: pointer; color: inherit; position: relative; }
.topbar .icon-btn { color: #d9d4ea; }
.topbar .icon-btn:hover { background: rgba(255, 255, 255, 0.08); }
.icon-btn .dot { position: absolute; top: 7px; right: 7px; width: 8px; height: 8px; border-radius: 50%; background: var(--red); border: 2px solid var(--chrome); }
.menu-toggle { display: none; }
.avatar-btn .avatar { background: var(--primary); color: #fff; }

.shell { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: calc(100vh - var(--topbar)); }
.sidebar {
  background: var(--surface); border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
  position: sticky; top: var(--topbar); height: calc(100vh - var(--topbar)); overflow-y: auto;
}
.side-head { padding: 16px 16px 8px; }
.side-head strong { font-size: 1.02rem; }
.side-project { margin-top: 8px; display: flex; flex-direction: column; gap: 6px; }
.side-project strong { font-size: 0.98rem; line-height: 1.3; }
.nav { padding: 4px 10px 16px; display: flex; flex-direction: column; gap: 1px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 6px; color: var(--ink-2); font-weight: 500; white-space: nowrap; }
.nav a svg { width: 18px; height: 18px; flex: none; color: var(--ink-3); }
.nav a:hover { background: var(--paper); color: var(--ink); text-decoration: none; }
.nav a.active { background: var(--lavender); color: var(--violet-ink); font-weight: 600; }
.nav a.active svg { color: var(--violet); }
.sidebar-foot { margin-top: auto; padding: 12px 16px 16px; border-top: 1px solid var(--line); }
.demo-bar { background: var(--lavender); color: var(--violet-ink); font-weight: 600; padding: 8px 24px; display: flex; gap: 8px; align-items: center; font-size: 0.9rem; }

.main { min-width: 0; display: flex; flex-direction: column; }
.content { padding: 20px 24px 48px; flex: 1; }
.content.narrow { max-width: 960px; }
.crumbs { display: flex; align-items: center; gap: 6px; color: var(--ink-3); font-size: 0.9rem; margin-bottom: 10px; }
.crumbs a { color: var(--ink-3); }
.crumbs .sep { opacity: 0.6; }
.crumbs .current { color: var(--ink-2); font-weight: 600; }
.menu-head { padding: 8px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 6px; font-weight: 600; }
.menu-head small { display: block; color: var(--ink-3); font-weight: 500; }

/* ---------- Page header ---------- */
.page-head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head .title { min-width: 0; flex: 1 1 320px; }
.page-head .title p { color: var(--ink-3); margin: 4px 0 0; max-width: 70ch; }
.page-head .actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.page-head .pre { color: var(--ink-3); font-size: 0.9rem; margin-bottom: 2px; display: flex; gap: 8px; align-items: center; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 7px; padding: 7px 13px; border-radius: 6px;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); font-weight: 600; font-size: 0.93rem;
  cursor: pointer; line-height: 1.3; text-decoration: none; white-space: nowrap;
}
.btn:hover { background: var(--paper); text-decoration: none; }
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn-danger { color: var(--red); }
.btn-danger:hover { background: var(--red-bg); border-color: var(--red); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: var(--lavender); }
.btn-sm { padding: 4px 9px; font-size: 0.86rem; }
.btn-lg { padding: 10px 18px; font-size: 1rem; }
.btn[disabled], .btn.disabled { opacity: 0.5; pointer-events: none; }
.btn-group { display: inline-flex; }
.btn-group .btn { border-radius: 0; margin-left: -1px; }
.btn-group .btn:first-child { border-radius: 6px 0 0 6px; margin-left: 0; }
.btn-group .btn:last-child { border-radius: 0 6px 6px 0; }
.btn-group .btn.active { background: var(--lavender); color: var(--violet-ink); border-color: var(--lavender-2); position: relative; z-index: 1; }

/* ---------- Cards & grids ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.card-body { padding: 16px 18px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.card-head h2, .card-head h3 { font-size: 1rem; }
.card-head .more { color: var(--ink-3); font-size: 0.9rem; }
.card-foot { padding: 10px 18px; border-top: 1px solid var(--line); color: var(--ink-3); font-size: 0.9rem; }
.card + .card { margin-top: 16px; }
.grid > .card + .card, .row > .card + .card { margin-top: 0; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.grid-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }
.span-3 { grid-column: span 3; }
.stack > * + * { margin-top: 16px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.row.end { justify-content: flex-end; }
.gap-s { gap: 6px; }
.mt { margin-top: 16px; }
.mt-s { margin-top: 8px; }
.mb { margin-bottom: 16px; }

/* KPI tiles: the number is the content, label is quiet */
.kpi { padding: 14px 18px; }
.kpi .label { color: var(--ink-3); font-size: 0.9rem; }
.kpi .value { font-size: 1.75rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; margin-top: 2px; }
.kpi .value small { font-size: 0.95rem; font-weight: 500; color: var(--ink-3); margin-left: 4px; }
.kpi .delta { font-size: 0.86rem; margin-top: 4px; color: var(--ink-3); }
.kpi .delta.up { color: var(--green); }
.kpi .delta.down { color: var(--red); }
.kpi.signal-green .value { color: var(--green); }
.kpi.signal-orange .value { color: var(--orange); }
.kpi.signal-red .value { color: var(--red); }

/* ---------- Signals ---------- */
.sig { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 0.9rem; }
.sig::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--grey); flex: none; }
.sig-green::before { background: var(--green); } .sig-green { color: var(--green); }
.sig-orange::before { background: var(--orange); } .sig-orange { color: var(--orange); }
.sig-red::before { background: var(--red); } .sig-red { color: var(--red); }
.sig-blue::before { background: var(--blue); } .sig-blue { color: var(--blue); }
.sig-grey::before { background: var(--grey); } .sig-grey { color: var(--ink-3); }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--grey); vertical-align: middle; }
.dot-green { background: var(--green); } .dot-orange { background: var(--orange); } .dot-red { background: var(--red); } .dot-blue { background: var(--blue); } .dot-grey { background: var(--grey); }
.dot-lg { width: 14px; height: 14px; }
.false-green { display: inline-flex; align-items: center; gap: 4px; color: var(--red); font-weight: 600; font-size: 0.82rem; }

/* Pills & tags */
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 1px 9px; border-radius: 999px; font-size: 0.82rem; font-weight: 600; background: var(--grey-bg); color: var(--ink-2); white-space: nowrap; line-height: 1.5; }
.pill-green { background: var(--green-bg); color: var(--green); }
.pill-orange { background: var(--orange-bg); color: var(--orange); }
.pill-red { background: var(--red-bg); color: var(--red); }
.pill-blue { background: var(--blue-bg); color: var(--blue); }
.pill-violet { background: var(--lavender); color: var(--violet-ink); }
.pill-outline { background: transparent; border: 1px solid var(--line-2); }
.class-badge { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 6px; font-weight: 700; font-size: 0.85rem; background: var(--grey-bg); color: var(--ink-2); }
.class-A { background: var(--primary); color: #fff; }
.class-B { background: var(--lavender-2); color: var(--violet-ink); }
.class-C { background: var(--grey-bg); color: var(--ink-2); }
.code { font-weight: 600; color: var(--ink-3); font-size: 0.9rem; letter-spacing: 0.01em; }

/* Phase strip: nine segments P0..P8, the lifecycle position at a glance */
.phase-strip { display: inline-grid; grid-template-columns: repeat(9, 14px); gap: 2px; vertical-align: middle; }
.phase-strip i { height: 8px; border-radius: 2px; background: var(--line-2); display: block; }
.phase-strip i.done { background: var(--violet-2); }
.phase-strip i.current { background: var(--violet-2); box-shadow: inset 0 0 0 2px var(--surface), inset 0 0 0 3px var(--violet-2); background: var(--surface); }
.phase-strip.lg { grid-template-columns: repeat(9, minmax(0, 1fr)); width: 100%; }
.phase-strip.lg i { height: 10px; }
.phase-labels { display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); font-size: 0.78rem; color: var(--ink-3); margin-top: 4px; }
.phase-labels span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-right: 2px; }
.phase-labels span.current { color: var(--violet-ink); font-weight: 700; overflow: visible; }
@media (max-width: 1100px) { .phase-labels span:not(.current) { visibility: hidden; } }

/* Progress */
.progress { height: 8px; border-radius: 999px; background: var(--grey-bg); overflow: hidden; min-width: 60px; }
.progress > i { display: block; height: 100%; background: var(--violet-2); border-radius: 999px; }
.progress.thin { height: 5px; }
.progress-row { display: flex; align-items: center; gap: 8px; }
.progress-row .pct { width: 42px; text-align: right; font-size: 0.86rem; color: var(--ink-2); font-weight: 600; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 0.93rem; }
.table th, .table td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th { font-weight: 600; color: var(--ink-3); font-size: 0.86rem; background: var(--surface-2); white-space: nowrap; position: sticky; top: 0; }
.table tbody tr:hover { background: var(--surface-2); }
.table tr.clickable { cursor: pointer; }
.table td.num, .table th.num { text-align: right; }
.table .actions { text-align: right; white-space: nowrap; }
.table .actions .btn { visibility: hidden; }
.table tr:hover .actions .btn, .table .actions.always .btn { visibility: visible; }
.table.compact th, .table.compact td { padding: 6px 10px; }
.table tfoot td { font-weight: 600; background: var(--surface-2); }
.table .row-link { color: var(--ink); font-weight: 600; }
.table a.row-link:hover { color: var(--violet); }
.sort-link { color: inherit; display: inline-flex; gap: 4px; align-items: center; }
.sort-link.active { color: var(--violet-ink); }

/* Toolbar / filters */
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .field { margin: 0; }
.toolbar input, .toolbar select { padding: 6px 9px; min-width: 0; }
.toolbar select, .toolbar input:not([type="checkbox"]):not([type="radio"]) { border: 1px solid var(--line-2); border-radius: 6px; background-color: var(--surface); color: var(--ink); }
.toolbar select:focus, .toolbar input:focus { border-color: var(--violet); box-shadow: var(--focus); outline: none; }
.toolbar .grow { flex: 1; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { padding: 4px 11px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); font-size: 0.88rem; font-weight: 600; color: var(--ink-2); cursor: pointer; text-decoration: none; }
.chip:hover { background: var(--paper); text-decoration: none; }
.chip.active { background: var(--strong-bg); color: var(--strong-fg); border-color: var(--strong-bg); }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.field label { font-weight: 600; font-size: 0.9rem; color: var(--ink-2); }
.field label abbr { color: var(--red); text-decoration: none; }
.field input, .field select, .field textarea, .input {
  padding: 8px 10px; border: 1px solid var(--line-2); border-radius: 6px; background: var(--surface); width: 100%; min-width: 0;
}
.field input:focus, .field select:focus, .field textarea:focus, .input:focus { border-color: var(--violet); box-shadow: var(--focus); outline: none; }
.field textarea { resize: vertical; min-height: 80px; }
.field-hint { color: var(--ink-3); font-size: 0.86rem; }
.field-error { color: var(--red); font-size: 0.86rem; font-weight: 600; }
.has-error input, .has-error select, .has-error textarea { border-color: var(--red); }
.field-checkbox .checkbox { display: flex; align-items: center; gap: 8px; font-weight: 500; cursor: pointer; }
.field-checkbox input { width: 16px; height: 16px; accent-color: var(--violet); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }
.form-grid .full { grid-column: 1 / -1; }
.form-actions { display: flex; gap: 8px; justify-content: flex-end; padding-top: 8px; border-top: 1px solid var(--line); margin-top: 8px; }
fieldset { border: 0; padding: 0; margin: 0 0 8px; }
legend { font-weight: 700; font-size: 0.95rem; padding: 0; margin-bottom: 10px; color: var(--ink); }
.inline-form { display: inline; }

/* ---------- Alerts & flash ---------- */
.alert { padding: 10px 14px; border-radius: 6px; border: 1px solid var(--line); background: var(--surface); margin-bottom: 16px; display: flex; gap: 10px; align-items: flex-start; }
.alert-success { background: var(--green-bg); border-color: var(--green-line); color: var(--green-ink); }
.alert-error { background: var(--red-bg); border-color: var(--red-line); color: var(--red-ink); }
.alert-warning { background: var(--orange-bg); border-color: var(--orange-line); color: var(--orange-ink); }
.alert-info { background: var(--blue-bg); border-color: var(--blue-line); color: var(--blue-ink); }
.toast-host { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 100; }
.toast { background: var(--strong-bg); color: var(--strong-fg); padding: 10px 14px; border-radius: 8px; box-shadow: var(--shadow-pop); font-weight: 600; }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tabs a { padding: 9px 13px; color: var(--ink-2); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--ink); text-decoration: none; }
.tabs a.active { color: var(--violet-ink); border-bottom-color: var(--violet); }
.tabs a .count { color: var(--ink-3); font-weight: 500; margin-left: 4px; }

/* ---------- Avatars & people ---------- */
.avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--lavender-2); color: var(--violet-ink); display: inline-grid; place-items: center; font-size: 0.75rem; font-weight: 700; flex: none; }
.avatar.lg { width: 40px; height: 40px; font-size: 0.95rem; }
@supports (color: color-mix(in srgb, red 50%, blue)) {
  .avatar.tinted { background: color-mix(in srgb, var(--av) 13%, var(--surface)); color: var(--av); }
}
.avatar-btn .avatar, .avatar-btn .avatar.tinted { background: var(--primary); color: #fff; }
.person { display: inline-flex; align-items: center; gap: 8px; }
.person .who { line-height: 1.2; }
.person .who small { display: block; color: var(--ink-3); }
.avatars { display: inline-flex; }
.avatars .avatar { border: 2px solid var(--surface); margin-left: -8px; }
.avatars .avatar:first-child { margin-left: 0; }

/* ---------- Dropdown & dialog ---------- */
.dropdown { position: relative; }
.menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 200px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow-pop); padding: 6px; z-index: 30; display: none; }
.menu.open { display: block; }
.menu a, .menu button { display: flex; width: 100%; text-align: left; gap: 8px; align-items: center; padding: 8px 10px; border-radius: 6px; color: var(--ink); background: none; border: 0; cursor: pointer; }
.menu a:hover, .menu button:hover { background: var(--paper); text-decoration: none; }
.menu .sep { height: 1px; background: var(--line); margin: 6px 0; }
.menu .danger { color: var(--red); }
dialog.modal { border: 0; border-radius: 12px; padding: 0; background: var(--surface); color: var(--ink); width: min(640px, 94vw); box-shadow: var(--shadow-pop); }
dialog.modal::backdrop { background: var(--overlay); }
dialog.modal.wide { width: min(960px, 96vw); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px 10px; }
.modal-body { padding: 4px 20px 20px; max-height: 75vh; overflow: auto; }

/* ---------- Lists ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: 10px 0; border-bottom: 1px solid var(--line); display: flex; gap: 12px; align-items: flex-start; }
.list li:last-child { border-bottom: 0; }
.list .when { color: var(--ink-3); font-size: 0.86rem; white-space: nowrap; }
.dl { display: grid; grid-template-columns: minmax(120px, 36%) 1fr; gap: 6px 14px; margin: 0; font-size: 0.93rem; }
.dl dt { color: var(--ink-3); }
.dl dd { margin: 0; font-weight: 500; }
.empty { text-align: center; padding: 36px 20px; color: var(--ink-3); }
.empty h3 { color: var(--ink); margin-bottom: 6px; }
.empty .btn { margin-top: 12px; }

/* ---------- Pagination ---------- */
.pagination { display: flex; gap: 4px; align-items: center; justify-content: flex-end; margin-top: 14px; font-size: 0.9rem; }
.pagination a, .pagination span { padding: 5px 10px; border-radius: 6px; border: 1px solid var(--line); color: var(--ink-2); }
.pagination .active { background: var(--strong-bg); color: var(--strong-fg); border-color: var(--strong-bg); }
.pagination .info { border: 0; color: var(--ink-3); margin-right: auto; }

/* ---------- Command palette ---------- */
.palette { border: 0; border-radius: 12px; padding: 0; background: var(--surface); color: var(--ink); width: min(640px, 94vw); box-shadow: var(--shadow-pop); margin-top: 10vh; }
.palette::backdrop { background: var(--overlay); }
.palette input { width: 100%; border: 0; border-bottom: 1px solid var(--line); padding: 14px 18px; font-size: 1.05rem; outline: none; border-radius: 12px 12px 0 0; background: var(--surface); color: var(--ink); }
.palette ul { list-style: none; margin: 0; padding: 8px; max-height: 50vh; overflow: auto; }
.palette li a { display: flex; gap: 10px; align-items: center; padding: 9px 10px; border-radius: 6px; color: var(--ink); }
.palette li a .kind { margin-left: auto; color: var(--ink-3); font-size: 0.82rem; }
.palette li.active a, .palette li a:hover { background: var(--lavender); text-decoration: none; }

/* ---------- Gantt ---------- */
.gantt-wrap { display: grid; grid-template-columns: minmax(260px, 34%) 1fr; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.gantt-table { overflow: auto; border-right: 1px solid var(--line); }
.gantt-table table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.gantt-table th { position: sticky; top: 0; background: var(--surface-2); z-index: 2; height: 44px; padding: 0 10px; text-align: left; color: var(--ink-3); font-weight: 600; border-bottom: 1px solid var(--line); }
.gantt-table td { height: 32px; padding: 0 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.gantt-table tr.summary td { font-weight: 700; }
.gantt-table tr.milestone td .name::before { content: "◆ "; color: var(--violet-ink); }
.gantt-table .indent-1 { padding-left: 22px; } .gantt-table .indent-2 { padding-left: 36px; } .gantt-table .indent-3 { padding-left: 50px; }
.gantt-chart { overflow: auto; position: relative; }
.gantt-chart svg { display: block; }
.gantt-legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 0.86rem; color: var(--ink-2); margin-top: 10px; }
.gantt-legend i { display: inline-block; width: 14px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }

/* ---------- Kanban ---------- */
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(260px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.kanban-col { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; min-height: 200px; }
.kanban-col h3 { font-size: 0.93rem; display: flex; justify-content: space-between; margin-bottom: 10px; color: var(--ink-2); }
.kanban-card { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; margin-bottom: 8px; cursor: grab; }
.kanban-card.dragging { opacity: 0.5; }
.kanban-card .meta { display: flex; justify-content: space-between; color: var(--ink-3); font-size: 0.82rem; margin-top: 6px; }

/* ---------- Heatmap (workload) ---------- */
.heat { font-size: 0.86rem; }
.heat td.cell { text-align: center; font-weight: 600; min-width: 46px; }
.heat .h0 { background: var(--surface); color: var(--ink-3); }
.heat .h1 { background: var(--heat-1); } .heat .h2 { background: var(--heat-2); } .heat .h3 { background: var(--heat-3); color: var(--violet-ink); }
.heat .over { background: var(--red-bg); color: var(--red); }
.heat .warn { background: var(--orange-bg); color: var(--orange); }

/* ---------- Matrix (risk) ---------- */
.matrix { display: grid; grid-template-columns: auto repeat(5, 1fr); gap: 3px; font-size: 0.86rem; }
.matrix .axis { color: var(--ink-3); display: grid; place-items: center; padding: 4px; }
.matrix .cell { min-height: 54px; border-radius: 4px; padding: 4px 6px; background: var(--green-bg); }
.matrix .cell.c2 { background: var(--yellow-bg); } .matrix .cell.c3 { background: var(--orange-bg); } .matrix .cell.c4 { background: var(--red-bg); }
.matrix .cell a { display: inline-block; margin: 1px 2px 1px 0; font-weight: 600; color: var(--ink); background: var(--tint-tag); border-radius: 3px; padding: 0 4px; }

/* ---------- Timeline (gates) ---------- */
.gates { display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); gap: 8px; }
.gate { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; background: var(--surface); text-align: center; }
.gate .code { font-size: 1.05rem; color: var(--ink); }
.gate .name { font-size: 0.82rem; color: var(--ink-2); min-height: 2.4em; }
.gate .date { font-size: 0.86rem; margin-top: 4px; }
.gate.passed { background: var(--lavender); border-color: var(--lavender-2); }
.gate.skipped { opacity: 0.45; }
.gate.threatened .date { color: var(--orange); font-weight: 700; }
.gate.compromised .date { color: var(--red); font-weight: 700; }

/* ---------- Auth ---------- */
.auth-shell { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-side { background: var(--chrome); color: #e9e5f5; padding: 48px; display: flex; flex-direction: column; }
.auth-side h1 { font-size: 2.3rem; color: #fff; max-width: 14ch; margin-top: auto; letter-spacing: -0.02em; }
.auth-side p { color: #b9b2d4; max-width: 44ch; font-size: 1.05rem; margin-top: 14px; }
.auth-side .signals { display: flex; gap: 18px; margin-top: 26px; color: #d9d4ea; }
.auth-form { display: grid; place-items: center; padding: 32px; }
.auth-form .card { width: min(420px, 100%); }
.auth-form h2 { margin-bottom: 4px; }

/* ---------- Print ---------- */
.print-only { display: none; }
@media print {
  .sidebar, .topbar, .no-print, .toolbar, .tabs { display: none !important; }
  .shell { grid-template-columns: 1fr; }
  .content { padding: 0; }
  body { background: #fff; font-size: 11px; }
  .card { break-inside: avoid; }
  .print-only { display: block; }
  a { color: inherit; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1500px) {
  .sections a span { display: none; }
  .sections a.active span { display: inline; }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: var(--topbar); width: var(--sidebar); z-index: 40; transform: translateX(-100%); transition: transform 0.2s; box-shadow: var(--shadow-pop); }
  .shell.nav-open .sidebar { transform: none; }
  .menu-toggle { display: grid; }
  .brand .name { display: none; }
  .content { padding: 16px; }
  .grid-2, .grid-3, .grid-4, .grid-5, .grid-6 { grid-template-columns: 1fr; }
  .grid > * { min-width: 0; }
  .sections { flex: 1 1 auto; min-width: 0; }
  .search-trigger kbd { display: none; }
  .topbar { gap: 6px; padding: 0 10px; }
  .span-2, .span-3 { grid-column: auto; }
  .form-grid { grid-template-columns: 1fr; }
  .search-trigger { min-width: 0; }
  .search-trigger span { display: none; }
  .auth-shell { grid-template-columns: 1fr; }
  .auth-side { display: none; }
  .gantt-wrap { grid-template-columns: 1fr; }
  .gates { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 560px) {
  .sections a.active span { display: none; }
  .page-head .actions { width: 100%; }
  .toolbar select, .toolbar input[type=search] { flex: 1 1 100%; min-width: 0; }
  .kpi .value { font-size: 1.5rem; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* ---------- Plan additions ---------- */
.gantt-table tr.selected td { background: var(--lavender); }
.gantt-table tbody tr:hover td { background: var(--surface-2); }
.dot-violet { background: var(--violet); }
.toast-error { background: var(--red); }

/* ---------- Charts ---------- */
.chart-legend { list-style: none; margin: 0; padding: 0; font-size: 0.9rem; }
.chart-legend li { display: flex; align-items: center; gap: 8px; padding: 3px 0; }
.chart-legend li span { flex: 1; color: var(--ink-2); }
.chart-legend i, .chart-legend-inline i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; }
.chart-legend-inline { display: flex; gap: 14px; flex-wrap: wrap; font-size: 0.86rem; color: var(--ink-2); margin-top: 6px; }
.chart-legend-inline span { display: inline-flex; align-items: center; gap: 6px; }
.chart-row { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.chart-row svg { flex: none; }
.chart-row .chart-legend { flex: 1; min-width: 160px; }
.deck-card { break-inside: avoid; }

/* Scoring matrix */
.scoring-table .score-input { width: 56px; text-align: center; padding: 4px 6px; }
form.contents { display: contents; }
.text-green { color: var(--green); } .text-orange { color: var(--orange); } .text-red { color: var(--red); }
.list.plain li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.list.plain li:last-child { border-bottom: 0; }
.chart-with-legend { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }

/* Switch & key-value lists */
.switch { position: relative; width: 36px; height: 20px; border-radius: 999px; border: 0; background: var(--grey); cursor: pointer; padding: 0; vertical-align: middle; transition: background .15s; }
.switch i { position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: left .15s; }
.switch.on { background: var(--green); } .switch.on i { left: 18px; }
.btn-ghost.active { color: var(--violet); background: var(--lavender); }
.kv { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; }
.kv > div { display: flex; justify-content: space-between; gap: 8px; font-size: .9rem; border-bottom: 1px dashed var(--line); padding: 4px 0; }
.kv span { color: var(--ink-3); }

/* Master plan & roadmap */
.timeline-wrap { overflow-x: auto; }
.legend-inline { font-size: .8rem; color: var(--ink-3); display: inline-flex; align-items: center; gap: 6px; }
.legend-inline .dot { width: 9px; height: 9px; margin-left: 6px; }
.toolbar label.check { display: inline-flex; align-items: center; gap: 6px; font-size: .85rem; color: var(--ink-2); }
.roadmap-wrap { overflow-x: auto; }
.roadmap { width: 100%; border-collapse: collapse; table-layout: fixed; min-width: 1100px; }
.roadmap th.lane-head { width: 200px; text-align: left; padding: 10px 14px; font-size: .9rem; vertical-align: top; background: var(--surface-2); border-right: 1px solid var(--line); }
.roadmap th.year { text-align: left; padding: 8px 10px; font-size: .85rem; border-bottom: 1px solid var(--line); border-left: 1px solid var(--line-2); }
.roadmap th.q { font-size: .72rem; font-weight: 600; color: var(--ink-3); padding: 4px 0 6px; text-align: center; border-bottom: 1px solid var(--line); border-left: 1px solid var(--line); }
.roadmap th.q.current { color: var(--violet); background: var(--lavender); }
.roadmap td { height: 44px; border-left: 1px solid var(--line); border-bottom: 1px dashed var(--line); padding: 4px 3px; vertical-align: middle; }
.roadmap tr.lane-first td, .roadmap tr.lane-first th { border-top: 1px solid var(--line-2); }
.roadmap-bar { position: relative; display: block; height: 32px; border-radius: 6px; background: var(--grey-bg); overflow: hidden; color: var(--ink); text-decoration: none; font-size: .78rem; line-height: 32px; padding: 0 8px; white-space: nowrap; }
.roadmap-bar.signal-green { background: var(--green-bg); } .roadmap-bar.signal-orange { background: var(--orange-bg); } .roadmap-bar.signal-red { background: var(--red-bg); }
.roadmap-bar .bar-progress { position: absolute; left: 0; top: 0; bottom: 0; background: var(--shade); }
.roadmap-bar .bar-label { position: relative; display: flex; align-items: center; gap: 6px; overflow: hidden; text-overflow: ellipsis; }
.roadmap-bar .bar-label small { color: var(--ink-3); }
.roadmap-bar .ms { position: absolute; top: 11px; width: 10px; height: 10px; margin-left: -5px; transform: rotate(45deg); background: var(--surface); border: 1.5px solid var(--ink); }
.roadmap-bar .ms-passed, .roadmap-bar .ms-passed_with_conditions { background: var(--green); } .roadmap-bar .ms-threatened { background: var(--orange); } .roadmap-bar .ms-compromised { background: var(--red); }
@media print { .roadmap { min-width: 0; } }
.roadmap-bar .class-badge { width: 18px; height: 18px; font-size: .68rem; line-height: 18px; border-radius: 4px; flex: 0 0 18px; }
.roadmap-bar .ms { top: auto; bottom: -5px; width: 9px; height: 9px; }

/* Workflow steps */
.steps { display: flex; gap: 6px; flex-wrap: wrap; }
.steps .step { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px 6px 8px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: .82rem; color: var(--ink-3); }
.steps .step .n { width: 20px; height: 20px; border-radius: 50%; background: var(--grey-bg); display: inline-flex; align-items: center; justify-content: center; font-size: .72rem; font-weight: 700; }
.steps .step.done { color: var(--green); border-color: var(--green-bg); background: var(--green-bg); } .steps .step.done .n { background: var(--green); color: var(--surface); }
.steps .step.current { color: var(--violet-ink); border-color: var(--lavender-2); background: var(--lavender); font-weight: 600; } .steps .step.current .n { background: var(--primary); color: #fff; }
.steps .step.rejected { color: var(--red); border-color: var(--red-bg); background: var(--red-bg); } .steps .step.rejected .n { background: var(--red); color: var(--surface); }
.prose p { margin: 0 0 8px; } .prose.small { font-size: .85rem; }
.form-section { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); margin: 18px 0 10px; }
.form-section:first-child { margin-top: 0; }

/* Engagement map & chips */
.matrix-3 { width: 100%; border-collapse: separate; border-spacing: 4px; }
.matrix-3 th { font-size: .72rem; color: var(--ink-3); font-weight: 600; text-align: center; width: 70px; }
.matrix-3 td { background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; min-height: 56px; height: 64px; vertical-align: top; padding: 6px; width: 30%; }
.matrix-3 td.warm { background: var(--warm-bg); } .matrix-3 td.hot { background: var(--orange-bg); }
.chip { display: inline-block; font-size: .72rem; padding: 2px 8px; border-radius: 999px; background: var(--grey-bg); color: var(--ink); margin: 1px 2px 1px 0; text-decoration: none; }
.chip.att-supporter { background: var(--green-bg); color: var(--green); } .chip.att-resistant { background: var(--red-bg); color: var(--red); } .chip.att-neutral { background: var(--grey-bg); }

/* Governance */
.date-chip { width: 44px; flex: 0 0 44px; text-align: center; background: var(--lavender); border-radius: 8px; padding: 4px 0; line-height: 1.1; }
.date-chip strong { display: block; font-size: 1.05rem; color: var(--violet-ink); } .date-chip span { font-size: .68rem; color: var(--ink-3); text-transform: uppercase; }
ol.agenda { margin: 0; padding-left: 22px; } ol.agenda li { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--line); } ol.agenda li:last-child { border-bottom: 0; }
.check-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 14px; }
.check-grid label.check { display: flex; align-items: center; gap: 6px; font-size: .88rem; }

/* Knowledge */
.kb p { margin: 0 0 10px; line-height: 1.6; } .kb p:last-child { margin-bottom: 0; }
.kb-list { margin: 0 0 10px; padding-left: 20px; line-height: 1.6; }
.kb-table th:first-child, .kb-table td:first-child { white-space: nowrap; }
.kb-blank { height: 72px; border: 1px dashed var(--line-2); border-radius: 6px; margin-top: 6px; }
.lifecycle { display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); gap: 6px; }
.lc-phase { background: var(--lavender); border-radius: 8px; padding: 10px 8px; text-align: center; position: relative; }
.lc-name strong { display: block; color: var(--violet-ink); font-size: 1rem; } .lc-name span { font-size: .72rem; color: var(--ink-2); }
.lc-gate { margin-top: 8px; font-size: .78rem; font-weight: 600; color: var(--ink); } .lc-gate small { display: block; font-weight: 500; color: var(--ink-3); font-size: .66rem; line-height: 1.2; margin-top: 2px; }
@media (max-width: 1100px) { .lifecycle { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* Admin */
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .82rem; }
textarea.mono { line-height: 1.5; }
.import-row { display: flex; justify-content: space-between; gap: 14px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.import-row:last-of-type { border-bottom: 0; }
details.card > summary { list-style: none; } details.card > summary::-webkit-details-marker { display: none; }
details.card > summary h3::before { content: '▸ '; color: var(--ink-3); } details.card[open] > summary h3::before { content: '▾ '; }

/* Demo login */
.demo-accounts { display: grid; gap: 6px; margin-top: 8px; }
.demo-account { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: var(--surface); }
.demo-account:hover { border-color: var(--violet); background: var(--lavender); text-decoration: none; }
.demo-account span { display: flex; flex-direction: column; min-width: 0; }
.demo-account strong { font-size: .92rem; }
.demo-account small { color: var(--ink-3); font-size: .8rem; }

/* Narrative synthesis */
.narrative p { margin: 0 0 6px; line-height: 1.55; max-width: 80ch; }
.narrative p:first-child { font-weight: 600; }
.narrative p:last-child { margin-bottom: 0; }

/* Organisation 360 load chips */
.load { display: inline-block; min-width: 46px; padding: 2px 6px; border-radius: 4px; font-weight: 600; font-size: .82rem; text-align: center; color: var(--ink-3); }
.load.ok { background: var(--lavender); color: var(--violet-ink); }
.load.warn { background: var(--orange-bg); color: var(--orange); }
.load.over { background: var(--red-bg); color: var(--red); }

/* Community */
.threads { list-style: none; margin: 0; padding: 0; }
.threads li { display: flex; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); align-items: flex-start; }
.threads li:last-child { border-bottom: 0; }
.thread-main { flex: 1; min-width: 0; }
.thread-main p { margin: 6px 0 0; color: var(--ink-2); }
.thread-meta { display: flex; flex-direction: column; align-items: center; min-width: 64px; }
.thread-meta strong { font-size: 1.2rem; }
.post-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }

/* ---------- We IA ---------- */
.ai-trigger {
  display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 12px 0 10px; border-radius: 999px; cursor: pointer;
  border: 1px solid rgba(201, 184, 246, 0.35); background: linear-gradient(135deg, rgba(91, 43, 214, 0.55), rgba(145, 102, 245, 0.35)); color: #fff; font-weight: 700; font-size: 0.9rem;
}
.ai-trigger svg { width: 17px; height: 17px; color: #f2c46d; }
.ai-trigger:hover { background: linear-gradient(135deg, rgba(91, 43, 214, 0.8), rgba(145, 102, 245, 0.55)); }
.ai-trigger[aria-expanded="true"] { background: var(--violet-2); }
.ai-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ai-title img { border-radius: 8px; }

.ai-drawer {
  position: fixed; top: var(--topbar); right: 0; bottom: 0; width: min(440px, 100vw); z-index: 40;
  background: var(--surface); border-left: 1px solid var(--line); box-shadow: var(--shadow-pop);
  display: flex; flex-direction: column;
}
.ai-drawer-head { display: flex; align-items: center; gap: 10px; padding: 12px 12px 12px 16px; border-bottom: 1px solid var(--line); }
.ai-drawer-head img { border-radius: 8px; }
.ai-drawer-head div { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ai-drawer-head small { color: var(--ink-3); font-size: 0.8rem; }

.ai-chat { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.ai-card .ai-chat { height: min(72vh, 760px); }
.ai-thread { flex: 1; overflow-y: auto; padding: 18px 16px 8px; display: flex; flex-direction: column; gap: 12px; min-height: 0; }
.ai-welcome { margin: auto 0; text-align: center; padding: 24px 12px; color: var(--ink-2); }
.ai-welcome img { border-radius: 12px; margin-bottom: 10px; }
.ai-welcome h3 { font-size: 1.2rem; margin-bottom: 6px; color: var(--ink); }
.ai-msg { max-width: 92%; }
.ai-user { align-self: flex-end; background: var(--primary); color: #fff; padding: 9px 13px; border-radius: 14px 14px 4px 14px; }
.ai-assistant { align-self: flex-start; background: var(--surface-2); border: 1px solid var(--line); padding: 11px 14px; border-radius: 14px 14px 14px 4px; }
.ai-body p { margin: 0 0 8px; }
.ai-body p:last-child, .ai-body ul:last-child, .ai-body ol:last-child { margin-bottom: 0; }
.ai-body ul, .ai-body ol { margin: 4px 0 8px; padding-left: 18px; }
.ai-body li { margin: 3px 0; }
.ai-body h4 { margin: 8px 0 4px; font-size: 0.95rem; }
.ai-body code { background: var(--paper); padding: 0 4px; border-radius: 4px; }
.ai-meta { margin-top: 6px; font-size: 0.75rem; color: var(--ink-3); }
.ai-notice { color: var(--orange); font-size: 0.86rem; }
.ai-typing { display: inline-flex; gap: 4px; padding: 4px 0; }
.ai-typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--violet); opacity: 0.35; animation: ai-dot 1.1s infinite ease-in-out; }
.ai-typing i:nth-child(2) { animation-delay: 0.15s; }
.ai-typing i:nth-child(3) { animation-delay: 0.3s; }
@keyframes ai-dot { 0%, 80%, 100% { opacity: 0.25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) { .ai-typing i { animation: none; opacity: 0.7; } }
.ai-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 16px; }
.ai-chip { border: 1px solid var(--lavender-2); background: var(--lavender); color: var(--violet-ink); border-radius: 999px; padding: 5px 11px; font-size: 0.84rem; font-weight: 600; cursor: pointer; text-align: left; }
.ai-chip:hover { background: var(--lavender-2); }
.ai-form { display: flex; gap: 8px; align-items: flex-end; padding: 10px 12px 12px; border-top: 1px solid var(--line); }
.ai-form textarea { flex: 1; resize: none; min-height: 40px; max-height: 160px; padding: 9px 12px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--surface); line-height: 1.4; }
.ai-form textarea:focus { outline: none; border-color: var(--violet); box-shadow: var(--focus); }
.ai-send { height: 40px; width: 44px; padding: 0; justify-content: center; }
.ai-form.busy .ai-send { opacity: 0.6; pointer-events: none; }
.ai-capabilities { list-style: none; margin: 0; padding: 4px 18px 14px; display: flex; flex-direction: column; gap: 10px; }
.ai-capabilities li { display: flex; flex-direction: column; font-size: 0.9rem; }
.ai-capabilities span { color: var(--ink-3); }
.ai-agenda { margin: 0; padding: 8px 18px 14px 38px; display: flex; flex-direction: column; gap: 10px; }
.ai-agenda li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ai-agenda label.check { display: flex; gap: 8px; align-items: flex-start; flex: 1; min-width: 240px; }
.ai-presets { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.ai-presets li { display: flex; flex-direction: column; }
.ai-presets code { font-size: 0.78rem; color: var(--ink-3); word-break: break-all; }
.upgrade-card { max-width: 640px; margin: 24px auto; text-align: left; }
.upgrade-card img { border-radius: 10px; }
.btn.busy { opacity: 0.6; pointer-events: none; }
@media (max-width: 760px) {
  .ai-trigger span { display: none; }
  .ai-trigger { width: 36px; padding: 0; justify-content: center; }
  .ai-drawer { width: 100vw; }
}
.ai-propose svg { color: var(--violet); }
.card-head .ai-propose { margin-left: auto; }
.nb { white-space: nowrap; }
.lang-switch { display: flex; gap: 4px; justify-content: flex-end; margin-bottom: 10px; }
.lang-switch a { padding: 4px 10px; border-radius: 999px; color: var(--ink-3); font-weight: 600; font-size: 0.85rem; }
.lang-switch a[aria-current] { background: var(--lavender); color: var(--violet-ink); }
.menu-langs { display: flex; align-items: center; gap: 4px; padding: 6px 10px; color: var(--ink-3); }
.menu-langs a { padding: 2px 8px; border-radius: 6px; font-weight: 700; font-size: 0.8rem; color: var(--ink-2); }
.menu-langs a[aria-current] { background: var(--lavender); color: var(--violet-ink); }
.menu-langs a:hover { text-decoration: none; background: var(--paper); }

/* ---------- Connectors ---------- */
.connector-group { margin-bottom: 22px; }
.connector-group h2 { font-size: 1.05rem; margin: 0 0 10px; color: var(--ink-2); }
.connector-card { color: inherit; display: block; transition: border-color .15s ease, box-shadow .15s ease; }
.connector-card:hover { text-decoration: none; border-color: var(--violet); box-shadow: 0 6px 18px rgba(91, 43, 214, 0.08); }
.connector-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.connector-head strong { flex: 1; }
.connector-icon { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: var(--lavender); color: var(--violet); flex: none; }
.connector-help ol, .connector-help ul { padding-left: 18px; margin: 4px 0 8px; }
.connector-help li { margin: 3px 0; }
.connector-runs { padding: 4px 18px 12px; }
.connector-runs li { display: flex; flex-direction: column; gap: 3px; align-items: flex-start; }
.copy-field { display: flex; gap: 6px; align-items: center; }
.copy-field input { flex: 1; min-width: 0; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.8rem; padding: 7px 9px; border: 1px solid var(--line-2); border-radius: 6px; background: var(--surface-2); color: var(--ink-2); }
.code-block { white-space: pre-wrap; word-break: break-all; font-size: 0.78rem; background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; color: var(--ink-2); }
.dataset-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.dataset-list li { display: flex; flex-direction: column; }
.dataset-list code { font-size: 0.76rem; color: var(--ink-3); word-break: break-all; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px 14px; }
.sso-button { width: 100%; justify-content: center; margin-bottom: 4px; }
.sso-or { display: flex; align-items: center; gap: 10px; color: var(--ink-3); font-size: 0.82rem; margin: 12px 0; }
.sso-or::before, .sso-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.licence-table th.current, .licence-table td.current { background: var(--lavender); }
.licence-name { font-size: 1.6rem; font-weight: 800; color: var(--violet-ink); margin: 0 0 6px; }
.text-green { color: var(--green); }
.field .check-grid label.check { display: flex; align-items: flex-start; gap: 8px; font-weight: 500; text-align: left; margin: 0; }
.check-grid label.check input[type="checkbox"] { width: auto; flex: none; margin-top: 3px; }
.check-grid label.check input[type="checkbox"] { padding: 0; height: auto; border: 0; box-shadow: none; accent-color: var(--violet); }

/* ---------- Chart roles ----------
   Charts, timelines and the Gantt keep literal SVG colours (exports, e-mails); on screen these roles take the
   theme's colours. Data colours (series, signals, categories) have no role and stay identical to the legends. */
.ch-ink { fill: var(--ink); }
.ch-ink2 { fill: var(--ink-2); }
.ch-ink3 { fill: var(--ink-3); }
.ch-ink4 { fill: var(--ink-4); }
.ch-grid { stroke: var(--line); }
.ch-grid-soft { stroke: var(--line-soft); }
.ch-grid-strong { stroke: var(--line-2); }
.ch-track { stroke: var(--grey-bg); }
.ch-plot { fill: var(--surface-2); stroke: var(--line); }
.ch-band { fill: var(--paper); }
.ch-halo, .ch-ring { stroke: var(--surface); }
line.ch-today { stroke: var(--violet); }
text.ch-today { fill: var(--violet); }
.ch-edge { stroke: var(--ink); }
.ch-open { fill: var(--surface); }
.ch-skipped { fill: var(--line-2); }
.g-weekend { fill: var(--weekend); }
.g-holiday { fill: var(--holiday); }
.g-head { fill: var(--surface-2); }
.g-baseline { fill: var(--baseline); }
.g-base { fill: var(--task-bg); }
.g-base-critical { fill: var(--lavender-2); stroke: var(--violet); }
.g-critical { fill: var(--violet); }
.g-milestone { fill: var(--violet-ink); }
.g-summary-progress { fill: var(--violet-2); }
.g-late { stroke: var(--red); }
.g-links { stroke: var(--ink-4); }
.gantt-legend .lg-task { background: #4d6fb8; }
.gantt-legend .lg-critical { background: var(--violet); }
.gantt-legend .lg-summary { background: var(--ink); }
.gantt-legend .lg-baseline { background: var(--baseline); height: 4px; }
.gantt-legend .lg-late { border: 1.5px solid var(--red); background: transparent; }
.menu-themes a { gap: 4px; justify-content: center; }
.menu-themes a svg { width: 14px; height: 14px; }
.auth-prefs { display: flex; gap: 10px; justify-content: flex-end; align-items: center; flex-wrap: wrap; margin-bottom: 10px; width: min(420px, 100%); }
.auth-prefs .lang-switch { margin: 0; }
.theme-switch { display: flex; gap: 2px; }
.theme-switch a { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 999px; color: var(--ink-3); }
.theme-switch a svg { width: 16px; height: 16px; }
.theme-switch a:hover { background: var(--lavender); color: var(--violet-ink); }
.theme-switch a[aria-current] { background: var(--lavender); color: var(--violet-ink); }
.auth-by { margin-top: auto; color: #8f88ad; }
