/* Spectrum 360 look: dark navy, brand ribbon, Titillium Web, orange primary. */
:root {
  --bg-0: #0D1425;
  --bg-1: #0E1526;
  --panel: #141D38;
  --panel-2: #182240;
  --panel-border: rgba(74, 157, 195, .22);
  --line: rgba(199, 208, 224, .12);
  --ink: #E8EDF5;
  --ink-2: #C7D0E0;
  --muted: #7C89A6;
  --muted-2: #5B6B8C;
  --primary: #E87722;
  --primary-hover: #D56A1A;
  --blue: #3A9BD5;
  /* chart series (validated for the dark surface) */
  --s1: #3A9BD5; --s2: #D5731F; --s3: #A673B8; --s4: #7A9C22;
  /* status */
  --good: #8DBF3F; --good-bg: rgba(141, 191, 63, .14);
  --warn: #F5C948; --warn-bg: rgba(245, 201, 72, .13);
  --bad: #F07B78;  --bad-bg: rgba(196, 47, 44, .18);
  --info: #6CB8E6; --info-bg: rgba(58, 155, 213, .15);
  --ribbon: linear-gradient(90deg, #A8C22E 0%, #3A9BD5 22%, #9B59A6 44%, #E23E28 60%, #F29A2E 78%, #F5C948 100%);
  --radius: 12px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { color-scheme: dark; -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Titillium Web', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(900px 420px at 12% -60px, rgba(168,194,46,.08), transparent 60%),
    radial-gradient(900px 420px at 88% -60px, rgba(58,155,213,.10), transparent 60%),
    radial-gradient(1000px 500px at 50% 110%, rgba(232,119,34,.08), transparent 60%),
    linear-gradient(180deg, #0E1526 0%, #10182C 60%, #0D1425 100%);
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
a { color: var(--info); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 24px; font-weight: 700; letter-spacing: .01em; }
h2 { font-size: 17px; font-weight: 700; margin-bottom: 12px; }
h3 { font-size: 14px; font-weight: 600; color: var(--ink-2); }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- layout ---------- */
.shell { display: grid; grid-template-columns: var(--side-w, 232px) 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  background: linear-gradient(180deg, rgba(20,29,56,.92), rgba(14,21,38,.96));
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
}
.sidebar::before { content: ''; display: block; height: 3px; background: var(--ribbon); }
.brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 16px; }
.brand img { height: 38px; width: auto; filter: drop-shadow(0 4px 12px rgba(0,0,0,.45)); }
.brand .t { font-weight: 700; font-size: 16px; line-height: 1.1; }
.brand .s { font-size: 11px; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; }
.nav { padding: 6px 10px; display: flex; flex-direction: column; gap: 2px; }
.nav .sec { font-size: 11px; color: var(--muted-2); text-transform: uppercase; letter-spacing: .08em; padding: 14px 10px 6px; }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px;
  color: var(--ink-2); font-weight: 600; font-size: 14px;
}
.nav a svg { width: 17px; height: 17px; flex: none; opacity: .8; }
.nav a:hover { background: rgba(255,255,255,.04); text-decoration: none; color: var(--ink); }
.nav a.active { background: rgba(232,119,34,.13); color: #FFB37A; }
.nav a.active svg { opacity: 1; }
.side-foot { margin-top: auto; padding: 14px 16px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.side-foot .who { color: var(--ink-2); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-foot form { display: inline; }
.linkbtn { background: none; border: 0; color: var(--info); cursor: pointer; font: inherit; padding: 0; }
.linkbtn:hover { text-decoration: underline; }

.main { padding: 22px 28px 48px; min-width: 0; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.topbar .sub { color: var(--muted); font-size: 13px; margin-top: 2px; }

/* ---------- cards ---------- */
.card {
  background: linear-gradient(165deg, var(--panel-2), #121B33);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 18px 18px 16px;
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
  min-width: 0;
}
.card.ribbon { position: relative; overflow: hidden; }
.card.ribbon::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--ribbon); }
.grid { display: grid; gap: 16px; }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stack > * + * { margin-top: 16px; }
.section { margin-top: 22px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }

/* ---------- stat tiles ---------- */
.tile { display: block; color: inherit; }
.tile:hover { text-decoration: none; border-color: rgba(232,119,34,.45); }
.tile .lbl { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.tile .val { font-size: 32px; font-weight: 700; margin: 4px 0 2px; font-variant-numeric: tabular-nums; }
.tile .meta { font-size: 12px; color: var(--muted); display: flex; gap: 10px; flex-wrap: wrap; }
.delta-good { color: var(--good); }
.delta-bad { color: var(--bad); }

/* ---------- buttons & inputs ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 8px; border: 0;
  background: var(--primary); color: #fff; font: inherit; font-weight: 600; cursor: pointer; transition: background .2s;
  text-decoration: none;
}
.btn:hover { background: var(--primary-hover); text-decoration: none; }
.btn:disabled { opacity: .6; cursor: progress; }
.btn.ghost { background: rgba(255,255,255,.05); color: var(--ink-2); border: 1px solid var(--line); }
.btn.ghost:hover { background: rgba(255,255,255,.09); }
.btn.sm { padding: 5px 10px; font-size: 12px; }
.btn svg { width: 16px; height: 16px; }
/* ---------- fields: one style for every text field, select and text area ----------
   :where() keeps it at the lowest priority, so a component (Taha's message box, table filters…) can adjust it with one class.
   Sizes: default 38px; .sm (or inside a data table / a compact form) 32px. */
:root { --field-bg: rgba(255,255,255,.035); --field-bg-hover: rgba(255,255,255,.055); --field-border: rgba(199,208,224,.16);
  --field-border-hover: rgba(199,208,224,.32); --field-focus: #E87722; --field-ring: rgba(232,119,34,.20); --field-radius: 10px;
  --field-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237C89A6' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); }
:where(input:not([type]), input[type=text], input[type=password], input[type=search], input[type=email], input[type=number], input[type=url],
       input[type=tel], input[type=date], input[type=time], input[type=datetime-local], input[type=month], select, textarea) {
  box-sizing: border-box; height: 38px; padding: 0 12px; font: inherit; font-size: 14px; line-height: 1.4; color: var(--ink);
  background-color: var(--field-bg); border: 1px solid var(--field-border); border-radius: var(--field-radius);
  transition: border-color .15s, box-shadow .15s, background-color .15s; color-scheme: dark; max-width: 100%;
}
:where(textarea) { height: auto; min-height: 76px; padding: 9px 12px; line-height: 1.5; resize: vertical; }
:where(textarea.mono) { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; }
:where(select) { appearance: none; -webkit-appearance: none; padding-right: 34px; cursor: pointer;
  background-image: var(--field-chevron); background-repeat: no-repeat; background-position: right 10px center; background-size: 16px; }
:where(select[multiple]) { height: auto; padding: 6px; background-image: none; }
:where(input, select, textarea):where(:hover:not(:disabled):not(:focus)) { border-color: var(--field-border-hover); background-color: var(--field-bg-hover); }
:where(input, select, textarea):where(:focus) { outline: none; border-color: var(--field-focus); box-shadow: 0 0 0 3px var(--field-ring); background-color: var(--field-bg-hover); }
:where(input, textarea)::placeholder { color: var(--muted-2); opacity: 1; }
:where(input, select, textarea):where(:disabled) { opacity: .55; cursor: not-allowed; }
:where(input, select, textarea):where(:user-invalid) { border-color: var(--bad); }
:where(input[type=search])::-webkit-search-cancel-button { cursor: pointer; }
:where(input[type=date], input[type=time])::-webkit-calendar-picker-indicator { opacity: .6; cursor: pointer; }
:where(.sm, .data, .compact) :where(input:not([type=checkbox]):not([type=radio]), select), :where(input.sm, select.sm) {
  height: 32px; font-size: 13px; padding-left: 10px; border-radius: 8px; }
:where(.data) :where(select), :where(select.sm) { padding-right: 30px; background-position: right 8px center; }
:where(input[type=checkbox], input[type=radio]) { accent-color: var(--primary); width: 16px; height: 16px; margin: 0; cursor: pointer; vertical-align: -3px; }
:where(input[type=file]) { font: inherit; font-size: 13px; color: var(--muted); }
:where(input[type=file])::file-selector-button { font: inherit; font-size: 13px; font-weight: 600; margin-right: 10px; padding: 7px 12px; cursor: pointer;
  color: var(--ink); background: rgba(255,255,255,.05); border: 1px solid var(--field-border); border-radius: 8px; }
:where(input[type=file])::file-selector-button:hover { border-color: var(--field-border-hover); }
input:-webkit-autofill { -webkit-box-shadow: 0 0 0 60px #141c31 inset; -webkit-text-fill-color: var(--ink); caret-color: var(--ink); }
.form-group input { width: 100%; height: 44px; padding: 0 14px; }
/* a checkbox or radio with its text: the text stays beside it */
label.row:has(> input[type=checkbox], > input[type=radio]) { flex-wrap: nowrap; }
label.row > input[type=checkbox], label.row > input[type=radio] { flex: none; margin-top: 2px; }
label.row > input[type=checkbox] + span, label.row > input[type=radio] + span { flex: 1; min-width: 0; }
label.f { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }

/* ---------- chips & badges ---------- */
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  border: 1px solid var(--line); background: rgba(255,255,255,.03); color: var(--ink-2);
  border-radius: 999px; padding: 4px 12px; font: inherit; font-size: 12px; font-weight: 600; cursor: pointer;
}
.chip:hover { border-color: rgba(232,119,34,.5); }
label.chip input[type=radio] { position: absolute; opacity: 0; pointer-events: none; }
label.chip:has(input:checked) { background: rgba(232,119,34,.16); border-color: rgba(232,119,34,.6); color: #FFB37A; }
label.chip:has(input:focus-visible) { outline: 2px solid var(--field-focus); outline-offset: 2px; }
.chip.on { background: rgba(232,119,34,.16); border-color: rgba(232,119,34,.6); color: #FFB37A; }
.chip .n { color: var(--muted); margin-left: 4px; font-weight: 400; }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.badge svg { width: 12px; height: 12px; }
.b-good { background: var(--good-bg); color: var(--good); }
.b-warn { background: var(--warn-bg); color: var(--warn); }
.b-bad  { background: var(--bad-bg);  color: var(--bad); }
.b-info { background: var(--info-bg); color: var(--info); }
.b-mute { background: rgba(255,255,255,.06); color: var(--muted); }

/* ---------- alerts ---------- */
.alert { border-radius: 10px; padding: 12px 14px; font-size: 13px; display: flex; gap: 10px; align-items: flex-start; }
.alert svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.alert.err { background: var(--bad-bg); border: 1px solid rgba(240,123,120,.35); color: var(--bad); }
.alert.warn { background: var(--warn-bg); border: 1px solid rgba(245,201,72,.3); color: #F3DA8B; }
.alert.ok { background: var(--good-bg); border: 1px solid rgba(141,191,63,.35); color: #B9DA84; }
.alert.info { background: var(--info-bg); border: 1px solid rgba(58,155,213,.35); color: #A9D3EE; }
.alert ul { margin: 4px 0 0 16px; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th {
  text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted);
  font-weight: 600; padding: 9px 12px; border-bottom: 1px solid var(--line); background: rgba(14,21,38,.6);
  position: sticky; top: 0; cursor: pointer; user-select: none; white-space: nowrap;
}
table.data th[data-sort-dir=asc]::after { content: ' ▲'; color: var(--primary); }
table.data th[data-sort-dir=desc]::after { content: ' ▼'; color: var(--primary); }
table.data td { padding: 8px 12px; border-bottom: 1px solid rgba(199,208,224,.06); vertical-align: top; }
table.data tr:hover td { background: rgba(255,255,255,.025); }
table.data td.r, table.data th.r { text-align: right; }
.table-tools { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.table-tools input[type=search] { min-width: 260px; }
.count-note { font-size: 12px; color: var(--muted); }

/* ---------- progress ---------- */
.bar { height: 8px; border-radius: 999px; background: rgba(255,255,255,.07); overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: 999px; background: var(--s1); }
.bar.good > span { background: var(--good); }
.kpi { display: grid; grid-template-columns: minmax(120px, 1fr) minmax(60px, 120px) auto; gap: 10px; align-items: center; font-size: 12px; margin-top: 6px; }

/* ---------- charts ---------- */
.chart-box { position: relative; height: 170px; }
.chart-title { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 6px; }
.chart-title .now { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.empty-chart { height: 170px; display: grid; place-items: center; color: var(--muted); font-size: 12px; text-align: center; border: 1px dashed var(--line); border-radius: 8px; }

/* ---------- plan ---------- */
.phase { margin-top: 18px; }
.phase-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.item { display: grid; grid-template-columns: 84px minmax(0, 1fr) 180px; gap: 14px; padding: 12px 4px; border-top: 1px solid rgba(199,208,224,.07); align-items: start; }
.meta-col { display: flex; flex-direction: column; gap: 5px; }
.meta-col svg { width: 13px; height: 13px; vertical-align: -2px; margin-right: 4px; opacity: .7; }
.nowrap { white-space: nowrap; }
.item:first-of-type { border-top: 0; }
.item .sum { font-weight: 600; }

/* ---------- login ---------- */
.login-body { display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-container {
  background: linear-gradient(165deg, #182240, #121B33); border: 1px solid rgba(74,157,195,.25);
  border-radius: 16px; padding: 44px 40px 36px; box-shadow: 0 20px 60px rgba(0,0,0,.5);
  max-width: 400px; width: 100%; text-align: center; position: relative; overflow: hidden;
}
.login-container::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px; background: var(--ribbon); }
.login-container .logo { display: block; height: 96px; margin: 0 auto 18px; filter: drop-shadow(0 8px 24px rgba(0,0,0,.45)); }
.login-container h1 { font-size: 26px; color: var(--ink); margin-bottom: 6px; letter-spacing: .02em; }
.login-container .subtitle { font-size: 14px; color: var(--muted); margin-bottom: 30px; }
.sso-btn {
  display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%; padding: 13px;
  background: #FFFFFF; color: #1F2937; border: none; border-radius: 8px; font-size: 15px; font-weight: 600;
  text-decoration: none; transition: transform .15s, box-shadow .15s;
}
.sso-btn:hover { transform: translateY(-1px); box-shadow: 0 8px 24px rgba(232,119,34,.25); text-decoration: none; }
.sso-note { margin-top: 14px; font-size: 12px; color: var(--muted-2); }
.divider { display: flex; align-items: center; gap: 12px; margin: 22px 0; font-size: 12px; color: var(--muted-2); }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: rgba(199,208,224,.15); }
.form-group { margin-bottom: 18px; text-align: left; }
button.submit { width: 100%; padding: 14px; font-size: 16px; justify-content: center; }
.login-container .error { text-align: left; margin-bottom: 20px; }
.footer { margin-top: 28px; font-size: 12px; color: var(--muted-2); letter-spacing: .08em; }

/* ---------- responsive ---------- */
@media (max-width: 1180px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
  .nav { flex-direction: row; flex-wrap: wrap; }
  .nav .sec { display: none; }
  .side-foot { display: none; }
  .main { padding: 16px; }
  .g4, .g3, .g2 { grid-template-columns: 1fr; }
  .item { grid-template-columns: 1fr; gap: 4px; }
  .table-tools input[type=search] { min-width: 0; width: 100%; }
}

/* ---------- multi-instance: switcher, settings ---------- */
.switcher { padding: 4px 16px 10px; }
.switcher label { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted-2); margin-bottom: 4px; }
.switcher select { width: 100%; height: 34px; font-size: 13px; }
.iconbtn { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 8px; color: var(--ink-2);
  border: 1px solid var(--line); background: rgba(255,255,255,.04); }
.iconbtn:hover { color: #FFB37A; border-color: rgba(232,119,34,.5); text-decoration: none; }
.iconbtn svg { width: 18px; height: 18px; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 16px; border-bottom: 1px solid var(--line); }
.tab { display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; color: var(--ink-2); font-weight: 600;
  border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab svg { width: 16px; height: 16px; opacity: .8; }
.tab:hover { text-decoration: none; color: var(--ink); }
.tab.on { color: #FFB37A; border-bottom-color: var(--primary); }
.btn.danger { background: #B5382F; }
.btn.danger:hover { background: #9B2F27; }
.btn.danger:disabled { background: rgba(181,56,47,.4); }
.htmx-indicator { display: none; }
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator { display: inline; }

/* ---------- ratings ---------- */
.r-good { background: var(--good-bg); color: var(--good); }
.r-fine { background: var(--warn-bg); color: var(--warn); }
.r-low  { background: var(--bad-bg);  color: var(--bad); }
[hidden] { display: none !important; }

/* ---------- scoreboard & nav sections ---------- */
.scorecard { border-top: 3px solid var(--line); }
.scorecard.sc-good { border-top-color: var(--good); }
.scorecard.sc-fine { border-top-color: var(--warn); }
.scorecard.sc-low  { border-top-color: var(--bad); }
details.navsec > summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; }
details.navsec > summary::-webkit-details-marker { display: none; }
details.navsec > summary::after { content: '▸'; font-size: 11px; color: var(--muted-2); transition: transform .15s; }
details.navsec[open] > summary::after { transform: rotate(90deg); }
a.chip { text-decoration: none; display: inline-flex; align-items: center; }

/* ---------- AI assistant ---------- */
.chat { display: flex; flex-direction: column; gap: 8px; max-height: 460px; overflow-y: auto; padding: 4px; }
.msg { padding: 9px 12px; border-radius: 10px; max-width: 92%; font-size: 13px; white-space: pre-wrap; }
.msg.me { align-self: flex-end; background: rgba(232,119,34,.16); border: 1px solid rgba(232,119,34,.35); }
.msg.ai { align-self: flex-start; background: rgba(58,155,213,.12); border: 1px solid rgba(58,155,213,.3); }
.msg.err { background: var(--bad-bg); border-color: rgba(240,123,120,.35); color: var(--bad); }
pre.yaml { background: var(--bg-1); border: 1px solid var(--line); border-radius: 8px; padding: 10px; font-size: 12px;
  max-height: 340px; overflow: auto; white-space: pre; color: var(--ink-2); }

/* ---------- dashboards ---------- */
.dgrid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.dw.s1 { grid-column: span 1; } .dw.s2 { grid-column: span 2; } .dw.s4 { grid-column: span 4; }
table.heat td.hc { white-space: nowrap; }
td.r-good { background: var(--good-bg); color: var(--good); } td.r-fine { background: var(--warn-bg); color: var(--warn); }
td.r-low { background: var(--bad-bg); color: var(--bad); } td.r-na, td.r-none { background: rgba(255,255,255,.03); }
.dist { display: flex; height: 10px; border-radius: 999px; overflow: hidden; background: rgba(255,255,255,.06); gap: 2px; margin-top: 4px; }
.dist span { display: block; height: 100%; }
.r-good-bg { background: var(--good); } .r-fine-bg { background: var(--warn); } .r-low-bg { background: var(--bad); }
@media (max-width: 1180px) { .dgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .dw.s4 { grid-column: span 2; } }
@media (max-width: 860px) { .dgrid { grid-template-columns: 1fr; } .dw.s1, .dw.s2, .dw.s4 { grid-column: span 1; } }

/* ---------- plan (in the app) ---------- */
details.menu { position: relative; }
details.menu > summary { list-style: none; }
details.menu > summary::-webkit-details-marker { display: none; }
a.linkchip {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px 3px 3px; border-radius: 999px;
  border: 1px solid var(--line); font-size: 12px; color: var(--ink-2); text-decoration: none; max-width: 100%;
}
a.linkchip:hover { border-color: rgba(232,119,34,.5); }
a.linkchip > span:not(.badge) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plan-item.is-done .sum { color: var(--muted); }

/* ---------- print (plan / reports) ---------- */
.print-page { background: #fff; color: #111; font-family: 'Titillium Web', system-ui, sans-serif; padding: 28px; max-width: 1000px; margin: 0 auto; }
.print-page h1 { font-size: 24px; margin: 0 0 4px; }
.print-page h2 { font-size: 16px; margin: 22px 0 8px; border-bottom: 2px solid #E87722; padding-bottom: 4px; }
.print-page table { width: 100%; border-collapse: collapse; font-size: 12px; }
.print-page th, .print-page td { text-align: left; border-bottom: 1px solid #ddd; padding: 6px 8px; vertical-align: top; }
.print-page th { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: #555; }
.print-page .r-good, .print-page .r-fine, .print-page .r-low, .print-page .r-na { background: none; }
.print-page .r-good { color: #4C7A12; font-weight: 700; } .print-page .r-fine { color: #A06A00; font-weight: 700; } .print-page .r-low { color: #B3261E; font-weight: 700; }
.print-page .muted { color: #666; }
@media print { .no-print { display: none !important; } .print-page { padding: 0; } @page { margin: 14mm; } }
/* icons placed directly in small text (alerts, plan notes) */
.small > svg, .meta-col > div > svg, a.linkchip > svg { width: 1em; height: 1em; vertical-align: -0.15em; flex: none; }
.remediation { background: rgba(58,155,213,.08); border: 1px solid rgba(58,155,213,.25); border-radius: 8px; padding: 8px 10px; }

/* ---------- settings sidebar ---------- */
.nav .back-link { color: var(--muted); font-size: 13px; margin-bottom: 4px; }
.nav .back-link:hover { color: var(--ink); }
.settings-title { display: flex; align-items: center; gap: 8px; padding: 6px 12px 2px; font-weight: 700; color: var(--ink); font-size: 15px; }
.settings-title svg { width: 16px; height: 16px; color: var(--primary); }

/* ---------- icon default size: no icon can render larger than the text around it ---------- */
:where(.main, .sidebar) svg { width: 1.05em; height: 1.05em; vertical-align: -0.15em; flex: none; }

/* ---------- compact scorecards: the rating is the colour ---------- */
.sc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.card.scorecard { padding: 10px 12px; border-top: 0; border-left: 4px solid var(--line); }
.scorecard.sc-good { border-left-color: var(--good); background: linear-gradient(90deg, rgba(141,191,63,.07), transparent 60%), var(--panel); }
.scorecard.sc-fine { border-left-color: var(--warn); background: linear-gradient(90deg, rgba(245,201,72,.07), transparent 60%), var(--panel); }
.scorecard.sc-low  { border-left-color: var(--bad);  background: linear-gradient(90deg, rgba(240,123,120,.08), transparent 60%), var(--panel); }
.sc-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.sc-label { font-weight: 600; font-size: 13.5px; line-height: 1.3; }
.sc-value { font-weight: 700; font-size: 15px; white-space: nowrap; }
.sc-good .sc-value, .sc-good .sc-rating { color: var(--good); }
.sc-fine .sc-value, .sc-fine .sc-rating { color: var(--warn); }
.sc-low .sc-value, .sc-low .sc-rating { color: var(--bad); }
.scorecard .small { margin-top: 2px; }
.sc-actions:empty { display: none; }
.sc-actions a { margin-right: 10px; }
.tile.sm { padding: 10px 14px; }
.tile.sm .val { font-size: 22px; margin: 2px 0; }
.tile.sm .lbl { font-size: 11px; }

/* ---------- plan: bar, views, phase strip ---------- */
.plan-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.jira-box { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 6px 10px; border: 1px solid var(--line); border-radius: 10px; }
.phase-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin-bottom: 14px; }
.ps-cell { background: var(--panel); border: 1px solid var(--panel-border); border-radius: 10px; padding: 8px 12px; }
.ps-cell .lbl { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; }
.ps-cell .v { font-size: 18px; font-weight: 700; margin: 2px 0 4px; }
.ps-cell .v .muted { font-size: 13px; font-weight: 400; }
.late { color: var(--bad); }

/* ---------- kanban ---------- */
.kanban { display: grid; grid-template-columns: repeat(4, minmax(220px, 1fr)); gap: 10px; overflow-x: auto; align-items: start; }
.kb-col { background: rgba(255,255,255,.025); border: 1px solid var(--line); border-radius: 12px; padding: 8px; min-height: 120px; }
.kb-col.over { border-color: var(--primary); background: rgba(232,119,34,.06); }
.kb-head { display: flex; justify-content: space-between; align-items: center; padding: 2px 4px 8px; }
.kb-list { display: flex; flex-direction: column; gap: 8px; min-height: 40px; }
.kb-card { background: var(--panel); border: 1px solid var(--panel-border); border-radius: 10px; padding: 8px 10px; cursor: grab; }
.kb-card[draggable="false"] { cursor: default; }
.kb-card.dragging { opacity: .5; }
.kb-title { font-weight: 600; font-size: 13px; line-height: 1.3; }
.kb-title a { color: var(--ink); }
.kb-tags { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; margin: 6px 0 4px; }
.kb-meta { display: flex; gap: 10px; flex-wrap: wrap; color: var(--muted); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; padding: 0; background: var(--muted-2); }
.dot.r-good { background: var(--good); } .dot.r-fine { background: var(--warn); } .dot.r-low { background: var(--bad); }

/* ---------- timeline ---------- */
.timeline { overflow-x: auto; }
.tl-grid { display: grid; grid-template-columns: minmax(180px, 260px) minmax(560px, 1fr); }
.tl-label { padding: 5px 10px 5px 0; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-top: 1px solid rgba(199,208,224,.05); }
.tl-label a { color: var(--ink-2); }
.tl-track { position: relative; min-height: 28px; border-top: 1px solid rgba(199,208,224,.05); }
.tl-weeks { min-height: 24px; border-top: 0; }
.tl-week { position: absolute; top: 2px; font-size: 11px; color: var(--muted); border-left: 1px solid var(--line); padding-left: 4px; overflow: hidden; white-space: nowrap; }
.tl-gridline { position: absolute; top: 0; bottom: 0; border-left: 1px solid rgba(199,208,224,.05); }
.tl-today { position: absolute; top: 0; bottom: 0; width: 0; border-left: 2px solid var(--primary); z-index: 2; }
.tl-phase { font-weight: 700; color: var(--ink); padding-top: 12px; }
.tl-phase-track { min-height: 34px; }
.tl-bar { position: absolute; top: 7px; height: 14px; border-radius: 7px; background: var(--s1); z-index: 1; }
.tl-bar.st-todo, .tl-key.st-todo { background: var(--muted-2); }
.tl-bar.st-in_progress, .tl-key.st-in_progress { background: var(--s1); }
.tl-bar.st-blocked, .tl-key.st-blocked { background: var(--bad); }
.tl-bar.st-done, .tl-key.st-done { background: var(--good); }
.tl-bar.st-dropped { background: rgba(255,255,255,.12); }
.tl-bar.late, .tl-key.late { box-shadow: 0 0 0 2px var(--bad); }
.tl-key { display: inline-block; width: 18px; height: 8px; border-radius: 4px; margin: 0 4px 0 10px; vertical-align: 0; }

/* ---------- wizard ---------- */
.wz-steps { display: flex; gap: 6px; list-style: none; padding: 0; margin: 0 0 14px; flex-wrap: wrap; counter-reset: wz; }
.wz-steps li { counter-increment: wz; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.wz-steps li::before { content: counter(wz) ". "; }
.wz-steps li.on { border-color: var(--primary); color: #FFB37A; background: rgba(232,119,34,.12); }
.wz-steps li.done { color: var(--ink-2); }
.wz-choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 10px; }
.wz-choice { display: grid; grid-template-columns: 22px 1fr; gap: 2px 6px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.wz-choice input { grid-row: span 2; margin-top: 3px; }
.wz-choice:has(input:checked) { border-color: var(--primary); background: rgba(232,119,34,.08); }
.wz-choice:has(input:disabled) { opacity: .5; cursor: not-allowed; }
.wz-review { border: 1px solid var(--line); border-radius: 10px; }
.wz-review-row { display: grid; grid-template-columns: 150px 1fr auto; gap: 12px; align-items: center; padding: 10px 14px; }
.wz-review-row + .wz-review-row { border-top: 1px solid var(--line); }
.wz-review-k { color: var(--muted); font-size: 12.5px; font-weight: 600; }
.wz-review-v { font-size: 13px; }
.wz-review-v > div + div { margin-top: 4px; }
.wz-review-v .badge { margin-left: 6px; }
@media (max-width: 640px) { .wz-review-row { grid-template-columns: 1fr auto; } .wz-review-k { grid-column: 1 / -1; } }
.wz-list { max-height: 320px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; margin-top: 6px; }
@media (max-width: 760px) { .kanban { grid-template-columns: repeat(4, 240px); } }

/* ---------- plan item pop-up (Jira-style issue view) ---------- */
.ip-dialog { margin: auto; border: 1px solid var(--panel-border); border-radius: var(--radius); padding: 0; width: min(1020px, 94vw); max-height: 90vh;
  background: var(--panel-2); color: var(--ink); box-shadow: 0 24px 70px rgba(0,0,0,.55); }
.ip-dialog::backdrop { background: rgba(5,10,22,.6); }
.ip { display: flex; flex-direction: column; max-height: 90vh; }
.ip-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.ip-crumbs { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.iconbtn.sm { width: 30px; height: 30px; font-size: 14px; }
.ip-body { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 22px; padding: 16px 18px; overflow-y: auto; }
.ip-main > * + * { margin-top: 10px; }
.ip-main textarea { width: 100%; resize: vertical; }
.ip-title { height: auto !important; font-size: 22px !important; font-weight: 700; border-color: transparent !important; background: transparent !important; padding: 4px 6px !important;
  resize: none !important; overflow: hidden; line-height: 1.3; }
.ip-title:hover:not(:disabled) { background: rgba(255,255,255,.04) !important; }
.ip-title:focus { border-color: var(--primary) !important; background: var(--bg-1) !important; }
.ip-sec { border-top: 1px solid var(--line); padding-top: 10px; }
.ip-links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.ip-rules { margin-top: 8px; }
.ip-rule-list { max-height: 220px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; padding: 4px 10px; margin-top: 6px; }
.ip-rule { padding: 3px 0; }
.ip-side { display: flex; flex-direction: column; gap: 10px; }
.ip-status { font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: .03em; width: max-content; min-width: 140px; cursor: pointer; }
.ip-status.st-done { background: var(--good-bg) !important; color: var(--good) !important; border-color: transparent !important; }
.ip-status.st-in_progress { background: var(--info-bg) !important; color: var(--info) !important; border-color: transparent !important; }
.ip-status.st-blocked { background: var(--bad-bg) !important; color: var(--bad) !important; border-color: transparent !important; }
.ip-details { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 8px 10px; align-items: center; }
.ip-details .ip-dh { grid-column: 1 / -1; font-weight: 700; font-size: 13px; padding-bottom: 4px; border-bottom: 1px solid var(--line); }
.ip-details label { font-size: 12px; color: var(--muted); font-weight: 600; }
.ip-details input, .ip-details select { width: 100%; height: 32px; font-size: 13px; }
.ip-meta { line-height: 1.6; }
.ip-foot { display: flex; align-items: center; gap: 12px; padding: 10px 18px; border-top: 1px solid var(--line); }
.item-open { color: var(--ink); font-weight: 600; cursor: pointer; }
.item-open:hover { color: var(--info); }
.kb-card[data-item] { cursor: pointer; }
.kb-card[data-item]:hover { border-color: rgba(232,119,34,.45); }
@media (max-width: 760px) { .ip-body { grid-template-columns: 1fr; } }

/* ---------- timeline editing ---------- */
.tl-grid[data-editable="1"] .tl-bar { cursor: grab; touch-action: none; }
.tl-bar.dragging { cursor: grabbing; opacity: .85; z-index: 3; }
.tl-h { position: absolute; top: -2px; bottom: -2px; width: 8px; cursor: ew-resize; }
.tl-h.l { left: -3px; } .tl-h.r { right: -3px; }
.tl-bar:hover .tl-h { background: rgba(255,255,255,.35); border-radius: 3px; }
.tl-tip { position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%); white-space: nowrap; font-size: 11px; font-style: normal;
  background: var(--panel-2); color: var(--ink); border: 1px solid var(--panel-border); border-radius: 6px; padding: 2px 6px; pointer-events: none; }

/* pop-up messages (bottom left) */
.toasts { position: fixed; left: 16px; bottom: 16px; z-index: 1000; display: flex; flex-direction: column; gap: 8px; max-width: min(420px, calc(100vw - 32px)); }
.toast { display: flex; align-items: flex-start; gap: 10px; padding: 10px 10px 10px 12px; border-radius: 8px; background: var(--panel-2); color: var(--ink);
  border: 1px solid var(--line, rgba(255,255,255,.12)); border-left: 4px solid var(--info, #3a9bd5); box-shadow: 0 8px 24px rgba(0,0,0,.35); font-size: 14px; line-height: 1.4;
  animation: toast-in .18s ease-out; }
.toast.err { border-left-color: var(--bad, #f07b78); }
.toast.ok { border-left-color: var(--good, #8dbf3f); }
.toast.out { opacity: 0; transform: translateY(6px); transition: all .2s; }
.toast-ic { flex: none; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 12px; color: #fff; background: var(--info, #3a9bd5); }
.toast.err .toast-ic { background: var(--bad, #f07b78); }
.toast.ok .toast-ic { background: var(--good, #8dbf3f); }
.toast-txt { flex: 1; padding-top: 1px; word-break: break-word; }
.toast-x { flex: none; background: none; border: 0; color: inherit; opacity: .6; cursor: pointer; font-size: 13px; padding: 2px 4px; }
.toast-x:hover { opacity: 1; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* plan: flags, dependencies, swimlanes, richer timeline rows */
.flag { display: inline-flex; vertical-align: middle; }
.flag svg { width: 14px; height: 14px; }
.flag.warn { color: var(--warn); }
.flag.bad { color: var(--bad); }
.ip-norule { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; padding: 8px 10px; border-radius: 8px; background: var(--warn-bg); color: var(--ink-2); }
.ip-norule svg { flex: none; width: 16px; height: 16px; color: var(--warn); margin-top: 2px; }
.ip-deps { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.depchip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px; border-radius: 999px; font-size: 12.5px; border: 1px solid var(--line); border-left: 3px solid var(--good); }
.depchip.dep-risk { border-left-color: var(--warn); }
.depchip.dep-problem { border-left-color: var(--bad); }
.depchip a { color: inherit; }
.depchip-x { background: none; border: 0; color: inherit; opacity: .6; cursor: pointer; padding: 0 2px; font-size: 11px; }
.kanban-board { display: flex; flex-direction: column; gap: 8px; }
.kb-lane-head { padding: 8px 2px 2px; border-top: 1px solid var(--line); font-size: 13.5px; }
.kb-lane-head:first-child { border-top: 0; }
.tl-grid { position: relative; }
.tl-label { white-space: normal; }
.tl-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-meta { display: flex; gap: 6px; align-items: center; font-size: 11px; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; }
.tl-meta .badge { font-size: 10.5px; padding: 0 5px; }
.tl-owner { display: inline-flex; align-items: center; gap: 3px; overflow: hidden; text-overflow: ellipsis; }
.tl-owner svg { width: 11px; height: 11px; }
.tl-st::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 4px; background: var(--muted-2); vertical-align: 0; }
.tl-st.st-in_progress::before { background: var(--blue); }
.tl-st.st-blocked::before { background: var(--bad); }
.tl-st.st-done::before { background: var(--good); }
svg.tl-links { position: absolute; inset: 0; pointer-events: none; overflow: visible; }
.tl-link { fill: none; stroke-width: 1.5; stroke: var(--muted); opacity: .8; }
.tl-link.risk { stroke: var(--warn); stroke-width: 2; opacity: 1; }
.tl-link.problem { stroke: var(--bad); stroke-width: 2; opacity: 1; }
.tl-arrow { fill: var(--muted); } .tl-arrow.risk { fill: var(--warn); } .tl-arrow.problem { fill: var(--bad); }
.tl-dep { display: inline-block; width: 18px; height: 0; border-top: 2px solid var(--muted); vertical-align: middle; margin: 0 3px 0 6px; }
.tl-dep.risk { border-color: var(--warn); } .tl-dep.problem { border-color: var(--bad); }
.tl-track .tl-bar { top: calc(50% - 7px); }
.tl-deadline { position: absolute; top: 0; bottom: 0; width: 0; border-left: 2px dashed var(--bad); z-index: 2; }
.tl-deadline em { position: absolute; top: 2px; left: 4px; font-size: 10.5px; font-style: normal; color: var(--bad); white-space: nowrap; }
.plan-dates { color: var(--ink-2); display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.phase-info { margin: 6px 0 10px; padding: 10px 12px; border-radius: 8px; background: var(--panel-2); font-size: 13.5px; color: var(--ink-2); }
.phase-info ul { margin: 4px 0 0 18px; }
.ps-phase { border-bottom: 1px solid var(--line); padding-bottom: 4px; }

/* timeline zoom: the track gets a fixed width (days × pixels per day); names stay pinned on the left */
.tl-zoom { gap: 6px; margin-bottom: 10px; flex-wrap: wrap; }
.tl-zoom .btn.sm { min-width: 30px; justify-content: center; }
.tl-grid { grid-template-columns: minmax(180px, 260px) var(--tl-w, minmax(560px, 1fr)); }
.timeline .tl-label { position: sticky; left: 0; z-index: 4; background: var(--panel); }
.timeline svg.tl-links { z-index: 3; }
.tl-day { position: absolute; top: 2px; font-size: 10.5px; color: var(--muted); display: none; transform: translateX(2px); white-space: nowrap; }
.tl-day.we { opacity: .55; }
.tl-grid.z-days .tl-week { display: none; }
.tl-grid.z-days .tl-day { display: block; }
.tl-grid.z-days .tl-week.month-start::after { content: none; }
.tl-grid.z-sparse .tl-week { color: transparent; border-left-color: transparent; }
.tl-grid.z-sparse .tl-week.month-start { color: var(--muted); border-left-color: var(--line); }
.tl-grid.z-sparse .tl-week.month-start::before { content: attr(data-month); color: var(--ink-2); }
.tl-grid.z-sparse .tl-week.month-start { font-size: 0; }
.tl-grid.z-sparse .tl-week.month-start::before { font-size: 11px; }
.tl-grid.z-sparse .tl-gridline { display: none; }
@media (min-width: 861px) { .plan-item { grid-template-columns: 112px minmax(0, 1fr) 180px; } }
.plan-item .badge { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: top; }
.role-tag { color: var(--ink-2); }

/* plans: cards, overview, dashboard */
.plan-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.plan-card { display: flex; flex-direction: column; gap: 8px; color: inherit; text-decoration: none; }
.plan-card:hover { border-color: var(--primary); text-decoration: none; }
.pc-name { font-size: 16px; }
.pc-scope { display: flex; flex-wrap: wrap; gap: 4px 12px; }
.checklist { list-style: none; margin: 10px 0 0; display: flex; flex-direction: column; }
.checklist li { display: grid; grid-template-columns: 22px 1fr auto; gap: 8px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.checklist li.done { opacity: .6; }
.checklist .ck { font-weight: 700; color: var(--warn); } .checklist li.done .ck { color: var(--good); }
.ov-phase { margin: 10px 0; } .ov-phase .bar { margin-top: 4px; }
.ov-task { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-top: 1px solid var(--line); }
.ov-inst { padding: 6px 0; border-top: 1px solid var(--line); } .ov-inst:first-of-type { border-top: 0; }
.ov-role { padding: 4px 0; }
.hbar { display: grid; grid-template-columns: minmax(120px, 40%) 1fr 56px; gap: 10px; align-items: center; margin: 8px 0; font-size: 13.5px; }
.hb-l { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hb-b { height: 10px; background: var(--line); border-radius: 5px; overflow: hidden; display: flex; }
.hb-b i { display: block; height: 100%; background: var(--good); }
.hb-b.stack3 i.f { background: var(--warn); } .hb-b.stack3 i.l { background: var(--bad); }
.hb-v { text-align: right; color: var(--muted); font-size: 12.5px; }
.lg { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin: 0 4px 0 8px; vertical-align: -1px; }
.lg.g { background: var(--good); } .lg.f { background: var(--warn); } .lg.l { background: var(--bad); }
.nav details.navsec.sub > summary.sec { padding-left: 14px; font-size: 10.5px; }

/* new plan wizard */
.tpl-phase { margin: 6px 0; } .tpl-phase summary { cursor: pointer; padding: 4px 0; }
.tpl-task { padding: 3px 0 3px 18px; align-items: flex-start; }
.ai-chat { display: flex; flex-direction: column; gap: 8px; max-height: 420px; overflow-y: auto; padding: 4px; }
.ai-msg { padding: 8px 12px; border-radius: 10px; font-size: 14px; line-height: 1.45; white-space: pre-line; max-width: 85%; }
.ai-msg.ai { background: var(--panel-2); border: 1px solid var(--line); align-self: flex-start; }
.ai-msg.me { background: rgba(232,119,34,.15); align-self: flex-end; }
.ai-msg.err { background: var(--bad-bg); color: var(--bad); }
.ai-draft { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.ai-input { display: flex; gap: 8px; align-items: flex-end; margin-top: 10px; }
.ai-input textarea { flex: 1; }
.sp-many { display: flex; flex-direction: column; gap: 4px; max-height: 180px; overflow-y: auto; }
table.review td:first-child { color: var(--muted); }
.flag.ok { color: var(--good); } .flag.muted-flag { color: var(--muted); }
.people-tbl input:not([type=checkbox]), .people-tbl select { width: 100%; }

/* navigation: fixed sidebar, object headers with tabs */
.nav .sub-link { padding-left: 34px; font-size: 12.5px; color: var(--ink-2); }
.nav .sub-link .star { display: inline-block; width: 12px; margin-left: -16px; margin-right: 4px; color: var(--muted-2); }
.nav .sub-link .star.on { color: var(--warn); }
.nav .nav-gap { height: 14px; }
.crumbs { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.crumbs a { color: var(--muted); }
.menu.switch > summary { cursor: pointer; list-style: none; color: var(--ink-2); }
.menu.switch > summary::-webkit-details-marker { display: none; }
.obj-title { display: flex; align-items: center; gap: 8px; margin: 2px 0; }
.star-form { display: inline; }
.star-btn { background: none; border: 0; cursor: pointer; font-size: 20px; color: var(--muted); line-height: 1; padding: 0 2px; }
.star-btn.on { color: var(--warn); }
.obj-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; }
.chip-link { color: var(--ink-2); font-size: 12.5px; }
.tabs { display: flex; gap: 2px; overflow-x: auto; }
.tabs a { padding: 9px 14px; color: var(--ink-2); border-bottom: 2px solid transparent; font-weight: 600; font-size: 14px; white-space: nowrap; }
.tabs a:hover { color: var(--ink); text-decoration: none; }
.tabs a.on { color: var(--ink); border-bottom-color: var(--primary); }

/* context switcher (sidebar), emoji lists, emoji picker */
.ctx-switch { position: relative; margin: 4px 10px 10px; }
.ctx-switch > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 8px 10px;
  border: 1px solid var(--panel-border); border-radius: 10px; background: var(--panel-2); }
.ctx-switch > summary::-webkit-details-marker { display: none; }
.ctx-switch > summary:hover, .ctx-switch[open] > summary { border-color: var(--primary); }
.cs-emoji { font-size: 18px; line-height: 1; flex: none; width: 22px; text-align: center; }
.cs-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.cs-text small { font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.cs-text b { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cs-chev { color: var(--muted); font-size: 14px; }
.cs-menu { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 50; background: var(--panel); border: 1px solid var(--panel-border);
  border-radius: 10px; box-shadow: 0 12px 32px rgba(0,0,0,.35); padding: 6px; display: flex; flex-direction: column; gap: 4px; }
.cs-filter { width: 100%; font-size: 13px; }
.cs-list { max-height: 50vh; overflow-y: auto; display: flex; flex-direction: column; }
.cs-list a { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 6px; color: var(--ink-2); font-size: 13px; }
.cs-list a span:nth-child(2) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cs-list a:hover { background: var(--panel-2); text-decoration: none; color: var(--ink); }
.cs-list a.on { background: rgba(232,119,34,.14); color: var(--ink); font-weight: 600; }
.cs-star { font-size: 11px; color: var(--warn); }
.cs-foot { display: flex; justify-content: space-between; border-top: 1px solid var(--line); padding: 6px 8px 2px; font-size: 12.5px; }
.nav a.obj-link { display: flex; align-items: center; gap: 8px; padding: 5px 12px 5px 30px; font-size: 13px; color: var(--ink-2); }
.obj-link .ol-emoji { font-size: 15px; width: 18px; text-align: center; flex: none; }
.obj-link .ol-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.obj-link .ol-star { color: var(--warn); font-size: 11px; }
.emoji-pick { position: relative; display: inline-block; }
.emoji-pick > summary { list-style: none; }
.emoji-pick > summary::-webkit-details-marker { display: none; }
.emoji-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; font-size: 24px; cursor: pointer; }
.emoji-pick .emoji-btn:hover { background: var(--panel-2); }
.emoji-btn.static { cursor: default; }
.emoji-pop { position: absolute; top: 46px; left: 0; z-index: 60; width: 320px; background: var(--panel); border: 1px solid var(--panel-border);
  border-radius: 12px; box-shadow: 0 12px 32px rgba(0,0,0,.35); padding: 10px; font-size: 14px; font-weight: 400; }
.emoji-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; }
.emoji-grid button { background: none; border: 0; font-size: 20px; padding: 4px; border-radius: 6px; cursor: pointer; }
.emoji-grid button:hover, .emoji-grid button.on { background: var(--panel-2); }

/* inventory product groups in the instance sidebar */
.nav details.nav-group { border-radius: 10px; }
.nav details.nav-group > summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px;
  color: var(--ink-2); font-weight: 600; font-size: 14px; user-select: none;
}
.nav details.nav-group > summary::-webkit-details-marker { display: none; }
.nav details.nav-group > summary:hover { background: rgba(255,255,255,.04); color: var(--ink); }
.nav details.nav-group > summary svg { width: 17px; height: 17px; flex: none; opacity: .8; }
.nav details.nav-group .ng-t { flex: 1; }
.nav details.nav-group .ng-n { font-size: 11px; font-weight: 600; color: var(--muted-2); background: rgba(255,255,255,.06); border-radius: 999px; padding: 1px 7px; }
.nav details.nav-group .ng-chev { display: inline-flex; transition: transform .18s ease; }
.nav details.nav-group .ng-chev svg { width: 14px; height: 14px; opacity: .6; }
.nav details.nav-group[open] .ng-chev { transform: rotate(90deg); }
.nav details.nav-group[open] { background: rgba(255,255,255,.02); }
.nav details.nav-group .ng-body { display: flex; flex-direction: column; gap: 1px; margin: 2px 0 6px 18px; padding-left: 8px; border-left: 1px solid var(--line); }
.nav details.nav-group .ng-body a { font-size: 13px; padding: 6px 8px; font-weight: 500; }
.nav details.nav-group .ng-body a svg { width: 15px; height: 15px; }
.nav details.nav-group .ng-sub { font-size: 10.5px; color: var(--muted-2); text-transform: uppercase; letter-spacing: .07em; padding: 8px 8px 3px; }

/* sidebar width: drag the edge (saved per browser), double-click to reset */
.side-resize { position: fixed; top: 0; bottom: 0; left: calc(var(--side-w, 232px) - 3px); width: 7px; cursor: col-resize; z-index: 40; touch-action: none; }
.side-resize::after { content: ''; position: absolute; top: 0; bottom: 0; left: 3px; width: 1px; background: transparent; transition: background .15s, width .15s; }
.side-resize:hover::after, .side-resize:focus-visible::after, body.resizing .side-resize::after { background: var(--accent, #E87722); width: 2px; }
.side-resize:focus { outline: none; }
body.resizing { cursor: col-resize; user-select: none; }
.sidebar .ol-name, .sidebar .cs-text b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 860px) { .side-resize { display: none; } }

/* deep scan panel (Screens page) */
.deep-scan { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 14px; margin: 0 0 12px;
  border: 1px solid var(--line); border-radius: 10px; background: rgba(255,255,255,.02); }
.deep-scan .ds-text { display: flex; flex-direction: column; gap: 3px; }
.deep-scan .ds-go { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; text-align: right; }
@media (max-width: 860px) { .deep-scan { flex-direction: column; align-items: stretch; } .deep-scan .ds-go { align-items: stretch; text-align: left; } }

/* standardisation */
.std-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }
.std-dot.std-shared { background: var(--good); } .std-dot.std-pair { background: var(--warn); } .std-dot.std-own { background: var(--bad); }
.std-hint { color: var(--muted); font-size: 11.5px; margin-top: 2px; } .std-hint.good { color: var(--good); }
.tile .val.good { color: var(--good); } .tile .val.warn { color: var(--warn); } .tile .val.bad { color: var(--bad); }

/* AI configuration review */
.ai-review h2 { font-size: 16px; }

/* Taha, the assistant */
.taha-ask { display: inline-flex; align-items: center; gap: 8px; min-width: 240px; height: 34px; padding: 0 8px 0 12px; border-radius: 999px;
  border: 1px solid var(--line); background: rgba(255,255,255,.04); color: var(--muted); cursor: pointer; font-size: 13px; transition: border-color .15s, background .15s; }
.taha-ask:hover { border-color: rgba(232,119,34,.55); background: rgba(232,119,34,.07); color: var(--ink); }
.taha-ask .ta-spark { color: #F28C38; font-size: 15px; }
.taha-ask .ta-text { flex: 1; text-align: left; }
.taha-ask kbd { font: 600 11px/1 inherit; color: var(--muted); border: 1px solid var(--line); border-radius: 6px; padding: 3px 6px; }
@media (max-width: 1100px) { .taha-ask { min-width: 0; } .taha-ask .ta-text, .taha-ask kbd { display: none; } }

.taha { position: fixed; top: 12px; right: 12px; bottom: 12px; width: min(460px, calc(100vw - 24px)); z-index: 70; display: flex; flex-direction: column;
  background: var(--panel); border: 1px solid var(--line); border-radius: 18px; overflow: hidden;
  box-shadow: 0 24px 60px rgba(0,0,0,.45), 0 0 0 1px rgba(255,255,255,.02); animation: thIn .18s ease-out; }
.taha.wide { width: min(820px, calc(100vw - 24px)); }
.taha[hidden] { display: none; }
@keyframes thIn { from { opacity: 0; transform: translateY(-6px) scale(.99); } to { opacity: 1; transform: none; } }
.taha svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.th-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 12px 12px 14px;
  background: linear-gradient(180deg, rgba(232,119,34,.10), transparent); border-bottom: 1px solid var(--line); }
.th-id { display: flex; align-items: center; gap: 10px; min-width: 0; }
.th-avatar { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; color: #fff; font-size: 17px; flex: none;
  background: conic-gradient(from 210deg, #E87722, #F5A25D, #4A9DC3, #E87722); box-shadow: 0 4px 14px rgba(232,119,34,.35); }
.th-titles { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.th-titles b { font-size: 15px; }
.th-chat-title { all: unset; cursor: pointer; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 240px; }
.th-chat-title:hover:not(:disabled) { color: var(--ink); text-decoration: underline dotted; }
.th-chat-title:disabled { cursor: default; }
.th-actions { display: flex; gap: 2px; }
.th-icon { border: 0; background: none; color: var(--muted); cursor: pointer; width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; }
.th-icon:hover { background: rgba(255,255,255,.07); color: var(--ink); }
.th-icon.sm { width: 26px; height: 26px; } .th-icon.sm svg { width: 14px; height: 14px; }
.th-body { position: relative; flex: 1; min-height: 0; display: flex; }
.th-log { flex: 1; overflow-y: auto; padding: 18px 16px 10px; display: flex; flex-direction: column; gap: 16px; scroll-behavior: smooth; }

.th-history { position: absolute; inset: 0; z-index: 3; background: var(--panel); display: flex; flex-direction: column; animation: thSlide .15s ease-out; }
.th-history[hidden] { display: none; }
@keyframes thSlide { from { opacity: 0; transform: translateX(-8px); } to { opacity: 1; transform: none; } }
.th-history-top { display: flex; gap: 8px; padding: 12px; border-bottom: 1px solid var(--line); }
.th-history-top input { flex: 1; }
.th-history-list { flex: 1; overflow-y: auto; padding: 6px 8px 12px; }
.th-h-group { font-size: 11px; font-weight: 700; color: var(--muted-2); text-transform: uppercase; letter-spacing: .06em; padding: 12px 8px 4px; }
.th-h-item { display: flex; align-items: center; gap: 2px; border-radius: 10px; padding-right: 4px; }
.th-h-item:hover, .th-h-item.on { background: rgba(255,255,255,.05); }
.th-h-item.on { box-shadow: inset 2px 0 0 #E87722; }
.th-h-item .th-icon { opacity: 0; } .th-h-item:hover .th-icon { opacity: 1; }
.th-h-open { all: unset; flex: 1; min-width: 0; display: flex; gap: 8px; align-items: center; padding: 8px; cursor: pointer; font-size: 13px; }
.th-h-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.th-empty { margin: auto 0; display: flex; flex-direction: column; gap: 14px; padding: 8px 2px 4px; }
.th-hello { text-align: center; }
.th-hello h3 { margin: 10px 0 4px; font-size: 19px; }
.th-hello p { margin: 0 auto; color: var(--muted); font-size: 13px; max-width: 340px; }
.th-big { font-size: 30px; display: inline-grid; place-items: center; width: 56px; height: 56px; border-radius: 18px; background: rgba(255,255,255,.04); border: 1px solid var(--line); }
.th-big.th-spark { color: #fff; background: conic-gradient(from 210deg, #E87722, #F5A25D, #4A9DC3, #E87722); border: 0; box-shadow: 0 8px 24px rgba(232,119,34,.35); }
.th-try { display: flex; flex-direction: column; gap: 6px; }
.th-try-t { font-size: 11px; font-weight: 700; color: var(--muted-2); text-transform: uppercase; letter-spacing: .06em; margin-top: 4px; }
.th-example { text-align: left; border: 1px solid var(--line); background: rgba(255,255,255,.02); color: var(--ink); border-radius: 12px; padding: 9px 12px; cursor: pointer; font-size: 13px; }
.th-example:hover { border-color: rgba(232,119,34,.5); background: rgba(232,119,34,.06); }
.th-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; }
.th-card { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; text-align: left; border: 1px solid var(--line); background: rgba(255,255,255,.02);
  color: var(--ink); border-radius: 14px; padding: 11px 12px; cursor: pointer; transition: transform .12s, border-color .12s; }
.th-card:hover { border-color: rgba(232,119,34,.5); transform: translateY(-1px); }
.th-card-e { font-size: 18px; } .th-card b { font-size: 13px; } .th-card small { color: var(--muted); font-size: 11.5px; line-height: 1.35; }
.th-back { align-self: center; border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 12.5px; }
.th-back:hover { color: var(--ink); }
.th-note { color: var(--muted); font-size: 12.5px; text-align: center; }

.tm { display: flex; gap: 10px; font-size: 13.5px; line-height: 1.55; animation: thMsg .2s ease-out; }
@keyframes thMsg { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.tm p { margin: 0 0 8px; } .tm p:last-child { margin-bottom: 0; } .tm ul, .tm ol { margin: 4px 0 8px 18px; padding: 0; } .tm li { margin: 2px 0; }
.tm code { font-size: 12px; background: rgba(255,255,255,.07); padding: 1px 5px; border-radius: 5px; }
.tm-me { justify-content: flex-end; }
.tm-bubble { max-width: 85%; padding: 9px 13px; border-radius: 16px 16px 4px 16px; color: #fff; white-space: pre-wrap;
  background: linear-gradient(135deg, #E87722, #C8601D); box-shadow: 0 4px 14px rgba(232,119,34,.25); }
.tm-bubble p { margin: 0; }
.tm-av { width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; flex: none; font-size: 14px; background: rgba(255,255,255,.06); border: 1px solid var(--line); }
.tm-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.tm-who { font-size: 12px; font-weight: 700; color: var(--ink-2); display: flex; gap: 8px; align-items: baseline; }
.tm-who span { font-weight: 400; color: var(--muted-2); font-size: 11px; }
.tm-err .tm-text { color: #F2A0A3; } .tm-err .tm-av { border-color: rgba(229,72,77,.5); }
.tm-typing { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12.5px; }
.tm-typing .dots { display: inline-flex; gap: 4px; } .tm-typing .dots i { width: 6px; height: 6px; border-radius: 50%; background: #E87722; animation: tahadot 1.1s infinite; }
.tm-typing .dots i:nth-child(2) { animation-delay: .15s; } .tm-typing .dots i:nth-child(3) { animation-delay: .3s; }
@keyframes tahadot { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-2px); } }

.tc-row { display: flex; flex-wrap: wrap; gap: 6px; }
.tc-chip { border: 1px solid var(--line); background: rgba(255,255,255,.03); color: var(--ink); border-radius: 999px; padding: 5px 11px; cursor: pointer; font-size: 12.5px; }
.tc-chip:hover { border-color: rgba(232,119,34,.55); }
.tc-link { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 600; padding: 5px 10px; border-radius: 999px; border: 1px solid var(--line); text-decoration: none; }
.tc-link:hover { border-color: rgba(74,157,195,.6); text-decoration: none; }
.tc-link svg { width: 13px; height: 13px; }
.tc-handoff { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; cursor: pointer; color: var(--ink); padding: 10px 12px; border-radius: 14px;
  border: 1px solid rgba(232,119,34,.45); background: linear-gradient(135deg, rgba(232,119,34,.14), rgba(232,119,34,.04)); }
.tc-handoff:hover { border-color: #E87722; }
.tc-handoff > span:nth-child(2) { flex: 1; display: flex; flex-direction: column; } .tc-handoff small { color: var(--muted); font-size: 11.5px; }
.tc-av { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; background: rgba(255,255,255,.07); font-size: 15px; }
.tc-block { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.tc-block-t { font-size: 12.5px; font-weight: 700; padding: 8px 10px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.02); }
.tc-block-t span { font-weight: 400; color: var(--muted); }
.tc-block pre { white-space: pre-wrap; font-size: 11.5px; max-height: 280px; overflow: auto; margin: 0; padding: 10px; background: rgba(0,0,0,.18); }
.tc-block details { padding: 6px 10px; border-top: 1px solid var(--line); } .tc-block details:first-of-type { border-top: 0; }
.tc-block summary { cursor: pointer; font-size: 12.5px; } .tc-block summary span { color: var(--muted); } .tc-block ul { margin: 6px 0 2px 18px; font-size: 12.5px; }
.tc-note { font-size: 12px; color: var(--muted); } .tc-note.bad { color: var(--bad); }
.tc-actions, .tc-form { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.tc-finding { border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; background: rgba(255,255,255,.02); }
.tc-f-head { display: flex; gap: 8px; align-items: center; } .tc-f-meta { font-size: 11.5px; color: var(--muted); } .tc-f-why { font-size: 12.5px; }
.tc-finding details { font-size: 12.5px; } .tc-finding summary { cursor: pointer; color: var(--muted); } .tc-finding ol { margin: 6px 0 0 18px; }
.tc-objs { display: flex; flex-wrap: wrap; gap: 4px; } .tc-objs span { font-size: 11px; padding: 2px 8px; border-radius: 999px; background: rgba(255,255,255,.06); }
.tc-event { align-self: flex-start; }

.th-composer { padding: 10px 12px 10px; border-top: 1px solid var(--line); }
.th-box { border: 1px solid var(--line); border-radius: 16px; background: rgba(255,255,255,.03); padding: 8px 8px 8px 12px; transition: border-color .15s, box-shadow .15s; }
.th-box:focus-within { border-color: rgba(232,119,34,.6); box-shadow: 0 0 0 3px rgba(232,119,34,.12); }
.th-ctx { font-size: 11.5px; color: var(--muted); margin-bottom: 2px; } .th-ctx:empty { display: none; }
.th-box textarea { width: 100%; border: 0; background: none; resize: none; outline: none; box-shadow: none; padding: 4px 0; min-height: 24px; max-height: 180px;
  color: var(--ink); font: inherit; font-size: 14px; line-height: 1.45; }
.th-box textarea:focus { outline: none; box-shadow: none; border: 0; }
.th-box-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 4px; }
.th-pick { position: relative; }
.th-agent-btn { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 8px 0 9px; border-radius: 999px; border: 1px solid var(--line);
  background: rgba(255,255,255,.04); color: var(--ink); cursor: pointer; font-size: 12.5px; font-weight: 600; }
.th-agent-btn:hover { border-color: rgba(232,119,34,.5); }
.th-agent-btn svg { width: 14px; height: 14px; color: var(--muted); }
.th-agents { position: absolute; bottom: calc(100% + 8px); left: -4px; width: 340px; max-width: calc(100vw - 48px); max-height: 60vh; overflow-y: auto; z-index: 4;
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 6px; box-shadow: 0 18px 44px rgba(0,0,0,.45); }
.th-agents[hidden] { display: none; }
.th-agent { display: flex; gap: 10px; align-items: flex-start; width: 100%; text-align: left; padding: 8px; border: 0; border-radius: 10px; background: none; color: var(--ink); cursor: pointer; }
.th-agent:hover, .th-agent.on { background: rgba(232,119,34,.12); }
.th-agent > span:last-child { display: flex; flex-direction: column; gap: 1px; font-size: 13px; } .th-agent small { color: var(--muted); font-size: 11.5px; }
.th-agent .ta-emoji { font-size: 16px; width: 22px; text-align: center; }
.th-send { width: 34px; height: 34px; border-radius: 11px; border: 0; cursor: pointer; display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, #E87722, #C8601D); box-shadow: 0 4px 12px rgba(232,119,34,.3); }
.th-send:hover { filter: brightness(1.08); }
.th-hint { font-size: 11px; color: var(--muted-2); text-align: center; margin-top: 6px; }
@media (max-width: 860px) { .taha { top: 0; right: 0; bottom: 0; width: 100vw; border-radius: 0; } }

/* cleaning */
.cl-cat { display: flex; flex-direction: column; gap: 6px; min-height: 160px; }
.cl-cat svg { width: 18px; height: 18px; }
.cl-cat .tile-n { font-size: 24px; font-weight: 700; }

/* documents */
a.doc-type { display: flex; flex-direction: column; gap: 6px; text-decoration: none; color: var(--ink); min-height: 140px; }
a.doc-type:hover { border-color: rgba(232,119,34,.5); text-decoration: none; }
a.doc-type svg { width: 18px; height: 18px; }
.doc-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; position: sticky; top: 8px; z-index: 5; }
.doc-sec { margin-bottom: 12px; scroll-margin-top: 120px; }
.doc-sec h2 { font-size: 17px; }
.doc-guide { margin: 4px 0 0; }
.doc-body { margin-top: 10px; line-height: 1.55; }
.doc-body table { border-collapse: collapse; width: 100%; margin: 8px 0; font-size: 13px; }
.doc-body th, .doc-body td { border: 1px solid var(--line); padding: 5px 8px; text-align: left; vertical-align: top; }
.doc-body th { background: rgba(255,255,255,.04); }
.doc-body blockquote { border-left: 3px solid var(--primary); margin: 8px 0; padding: 2px 10px; color: var(--muted); }
.doc-body h3 { font-size: 14px; margin: 14px 0 6px; }
.doc-edit { display: none; margin-top: 10px; }
.doc-sec.editing .doc-edit { display: block; }
.doc-sec.editing .doc-body { display: none; }
/* Library → Document skills */
details.sk-type { border-top: 1px solid var(--line); margin-top: 14px; padding-top: 10px; }
details.sk-type > summary { cursor: pointer; padding: 4px 0; }
details.sk-type label.f { margin-top: 10px; }
