/* X-Options 2.0 design system (styles.css of X-Options, UI refresh 10 Oct 2026): tokens, rail, cards, tabs, KPI tiles,
   pills, tables and the log panel are taken over as they are. */
:root {
  --ink: #12261F; --ink2: #3B4A44; --muted: #5F6D67; --muted-l: #6A7872;
  --page: #F3F5F4; --card: #FFFFFF; --hair: #E2E7E4; --hair2: #EDF1EE; --ctl: #C3CDC8; --track: #E9EEEB; --added: #F6F8F7;
  --g: #2E8763; --gl: #48D49C; --gd: #123627;
  --acc: #2E8763; --acc-d: #1F6B4C; --acc-dd: #17583E; --acc-l: #B5DFCB; --acc-t: #EAF5EF;
  --ns-t: #8A6A1F; --ns-f: #FDF6E3; --ns-b: #E7CF94;
  --loss: #B5473C; --loss-d: #A33A30; --loss-l: #F3DEDB; --err: #9A3412;
  --info: #1F5FAF; --info-t: #EAF1FB;
  --plain: #C9D3CE; --plain-d: #A9B5AF; --ctl-in: #899791; /* text field border, 3:1 on white */
  --r-sm: 6px; --r-md: 8px; --r-lg: 12px;
  --sh-card: 0 1px 2px rgba(18, 54, 39, .04);
  --sh-thumb: 0 1px 2px rgba(18, 54, 39, .16), 0 0 0 1px rgba(18, 54, 39, .04);
  --sh-pop: 0 14px 34px -12px rgba(18, 54, 39, .30);
  --focus: 0 0 0 3px rgba(46, 135, 99, .26);
  --fs-label: 12px; --fs-title: 15px; --fs-page: 22px;
  --mono: ui-monospace, SFMono-Regular, Menlo, monospace;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body { margin: 0; background: var(--page); color: var(--ink); font: 13.5px/1.5 Inter, system-ui, sans-serif; font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
a { color: var(--acc-d); text-decoration: none; } a:hover { color: var(--acc-dd); text-decoration: underline; text-underline-offset: 2px; }
button { font: inherit; cursor: pointer; color: inherit; }
input, select { font: inherit; color: var(--ink); }
:where(a, button, input, select, summary, [tabindex]):focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }
.mono { font-family: var(--mono); font-size: 12px; }
.muted { color: var(--muted); }
.shell { display: flex; min-height: 100%; }
/* rail */
.rail { width: 216px; flex: none; background: var(--card); border-right: 1px solid var(--hair); padding: 14px 10px 16px; display: flex; flex-direction: column; }
.rail .logo { padding: 6px 12px 14px; display: inline-flex; align-items: baseline; font-size: 17px; font-weight: 700; letter-spacing: -.01em; color: #123627; }
.logo-x { font-style: italic; font-weight: 800; color: #2E8763; margin-right: 1px; font-size: 21px; }
.rail h6 { margin: 18px 12px 6px; font-size: 11px; color: var(--muted-l); font-weight: 600; text-transform: uppercase; letter-spacing: .07em; }
.rail nav a { position: relative; display: flex; align-items: center; gap: 8px; min-height: 36px; padding: 7px 10px 7px 12px; margin-bottom: 2px; border-radius: var(--r-md); color: var(--ink2); text-decoration: none; transition: background-color .15s; }
.rail nav a b { flex: 1; min-width: 0; font-size: 13.5px; font-weight: 500; line-height: 1.3; }
.rail nav a:hover { text-decoration: none; color: var(--ink); }
.rail nav a span { font-size: 11.5px; line-height: 1.35; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rail nav a:hover { background: var(--page); }
.rail nav a.on { background: var(--acc-t); }
.rail nav a.on b { color: var(--acc-d); font-weight: 600; }
.rail nav a.on::before { content: ''; position: absolute; left: 0; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--acc); }
.rail .user { margin-top: auto; padding: 14px 6px 0; border-top: 1px solid var(--hair2); font-size: 12px; color: var(--muted); display: grid; gap: 10px; }
.rail .user .who { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 0 10px; align-items: center; }
.rail .user .av { grid-row: span 2; width: 32px; height: 32px; border-radius: 50%; background: var(--acc-t); color: var(--acc-d); font-weight: 700; font-size: 12px; display: flex; align-items: center; justify-content: center; }
.rail .user b { color: var(--ink); font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rail .user .sso { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.rail .user .sso i { width: 7px; height: 7px; border-radius: 50%; background: var(--acc); }
.rail .user .out { justify-self: start; }
main { flex: 1; min-width: 0; padding: 18px 28px 64px; }
.page { max-width: 1320px; }
h1 { font-size: var(--fs-page); line-height: 1.25; margin: 2px 0 0; font-weight: 600; letter-spacing: -.02em; }
h2 { font-size: 18px; font-weight: 600; margin: 0 0 4px; letter-spacing: -.01em; }
.lead { color: var(--ink2); margin: 6px 0 18px; max-width: 86ch; font-size: 14px; }
/* live bar: stream state, clock */
.livebar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: rgba(255,255,255,.94); backdrop-filter: blur(6px); color: var(--ink2); border-bottom: 1px solid var(--hair); margin: -18px -28px 18px; padding: 8px 28px; min-height: 48px; font-size: 12.5px; }
.livebar b { color: var(--ink); font-weight: 600; }
.livebar .lb-l { font-weight: 600; color: var(--ink); }
.livebar .tz { color: var(--muted); }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--acc); box-shadow: 0 0 0 0 rgba(46,135,99,.5); animation: pulse 1.6s infinite; flex: none; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(46,135,99,.45); } 70% { box-shadow: 0 0 0 7px rgba(46,135,99,0); } 100% { box-shadow: 0 0 0 0 rgba(46,135,99,0); } }
@media (prefers-reduced-motion: reduce) { .live-dot { animation: none; } }
.livebar.stale .live-dot { animation: none; background: var(--ns-t); }
.livebar.off .live-dot { animation: none; background: var(--plain-d); }
.livebar .lb-w { font-weight: 600; color: var(--ns-t); }
.livebar .clock { font-weight: 700; font-size: 14px; color: var(--ink); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.livebar .sp { flex: 1; }
/* cards */
.card { background: var(--card); border: 1px solid var(--hair); border-radius: var(--r-lg); padding: 20px 22px; min-width: 0; box-shadow: var(--sh-card); }
.card h3 { font-size: var(--fs-title); line-height: 1.35; margin: 0 0 12px; font-weight: 600; }
.card.xf { padding: 22px 24px; }
.xf-head { display: flex; align-items: flex-start; gap: 12px; margin: 0 0 14px; }
.xf-text { flex: 1 1 auto; min-width: 0; }
.xf-title { font-size: 18px; font-weight: 600; line-height: 1.3; margin: 0; letter-spacing: -.01em; }
.xf-q { margin: 4px 0 0; font-size: 14.5px; line-height: 1.4; color: var(--ink2); }
.xf-tools { display: flex; align-items: center; gap: 8px; flex: none; flex-wrap: wrap; justify-content: flex-end; }
.xf-sub .xf-title { font-size: 15px; } .xf-sub .xf-q { font-size: 13.5px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 16px; }
.grid2 > *, .grid5 > *, .stack > * { min-width: 0; }
.grid5 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 172px), 1fr)); gap: 12px; }
.stack { display: grid; gap: 16px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.sp { flex: 1; }
.head { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.head .t { min-width: 0; }
.crumb { color: var(--muted); font-size: 13px; }
.crumb a { color: var(--muted); }
/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 32px; margin: 0; padding: 6px 14px;
  border: 1px solid var(--ctl); border-radius: var(--r-md); background: #fff; color: var(--ink); font-size: 13px; font-weight: 600; line-height: 1.2;
  white-space: nowrap; text-decoration: none; transition: background-color .12s, border-color .12s, color .12s; }
.btn:hover:not(:disabled) { border-color: var(--acc); color: var(--acc-d); text-decoration: none; }
.btn.primary { background: var(--acc-d); border-color: var(--acc-d); color: #fff; }
.btn.primary:hover:not(:disabled) { background: var(--acc-dd); border-color: var(--acc-dd); color: #fff; }
.btn.danger { color: var(--loss); border-color: #E3B8B2; }
.btn.danger:hover:not(:disabled) { border-color: var(--loss); color: var(--loss); background: #FBF1EF; }
.btn.danger.solid { background: var(--loss); border-color: var(--loss); color: #fff; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.sm { min-height: 28px; padding: 4px 10px; font-size: 12.5px; }
.lnk { background: none; border: 0; padding: 0; color: var(--acc-d); font-weight: 600; }
.lnk:hover { text-decoration: underline; }
/* pills */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; line-height: 1.5; white-space: nowrap; }
.pill i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.st-running { background: var(--info-t); color: var(--info); }
.st-success { background: var(--acc-t); color: var(--acc-d); }
.st-idle, .st-ended { background: var(--hair2); color: var(--muted); }
.st-paused, .st-pausing, .st-infeasible { background: var(--ns-f); color: var(--ns-t); }
.st-crashed, .st-failed, .st-stopped { background: var(--loss-l); color: var(--loss); }
.st-stalled { background: var(--loss-l); color: var(--loss); }
.st-unknown { background: var(--hair2); color: var(--muted); }
.st-offline { background: transparent; color: var(--muted); border: 1px dashed var(--plain-d); }
.st-offline i { background: transparent; border: 1.5px solid var(--plain-d); }
.st-running i { animation: pulse-b 1.6s infinite; }
@keyframes pulse-b { 50% { opacity: .35; } }
.chip { display: inline-block; padding: 1px 7px; border-radius: 5px; font-size: 11.5px; font-weight: 600; white-space: nowrap; background: var(--hair2); color: var(--ink2); }
.chip.prod { background: #E7EEF9; color: var(--info); }
.chip.cg { background: var(--acc-t); color: var(--acc-d); }
/* tables */
table.t { width: 100%; border-collapse: collapse; }
table.t th { text-align: left; font-size: var(--fs-label); color: var(--muted); font-weight: 600; padding: 10px 12px; border-bottom: 1px solid var(--hair); line-height: 1.35; vertical-align: bottom; white-space: nowrap; }
table.t td { padding: 11px 12px; border-bottom: 1px solid var(--hair2); vertical-align: middle; }
table.t tbody tr:last-child td { border-bottom: 0; }
table.t .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.t tr.click { cursor: pointer; } table.t tr.click:hover td { background: var(--added); }
table.t tr.grp td { background: var(--page); color: var(--ink2); font-size: 12.5px; font-weight: 600; padding: 7px 12px; border-bottom: 1px solid var(--hair); }
table.t tr.grp td span { color: var(--muted); font-weight: 500; }
.scroll { overflow-x: auto; }
.w-name { font-weight: 600; white-space: nowrap; }
.w-sub { font-size: 12px; color: var(--muted); white-space: nowrap; }
.jn { font-weight: 600; display: block; max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jsub { font-size: 12px; color: var(--muted); white-space: nowrap; }
.steps { display: inline-flex; gap: 3px; align-items: center; }
.steps span { font-size: 11px; padding: 1px 7px; border-radius: 4px; background: var(--track); color: var(--muted); font-weight: 600; }
.steps span.done { background: var(--acc-t); color: var(--acc-d); }
.steps span.now { background: var(--acc-d); color: #fff; }
.prog { font-size: 12px; color: var(--muted); margin-top: 3px; white-space: nowrap; }
.prog b { color: var(--ink); font-weight: 600; }
.bars { display: grid; grid-template-columns: 30px minmax(56px, 1fr); gap: 3px 6px; align-items: center; font-size: 11.5px; color: var(--muted); min-width: 100px; }
.bar { height: 6px; border-radius: 3px; background: var(--track); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--acc); }
.bar.hi i { background: #D99A00; }
/* tabs, segmented controls */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--hair); margin: 14px 0 18px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { padding: 10px 14px; color: var(--muted); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; text-decoration: none; }
.tabs a:hover { color: var(--ink); border-bottom-color: var(--hair); text-decoration: none; }
.tabs a.on { color: var(--ink); font-weight: 600; border-bottom-color: var(--acc); }
.tabs .badge { margin-left: 6px; font-size: 12px; font-weight: 600; color: var(--acc-d); }
.seg { display: inline-flex; background: var(--track); border-radius: 9px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; padding: 5px 12px; border-radius: 7px; font-weight: 500; color: var(--muted); line-height: 1.35; }
.seg button:hover:not(.on):not(:disabled) { color: var(--ink); }
.seg button.on { background: #fff; color: var(--ink); font-weight: 600; box-shadow: var(--sh-thumb); }
.seg button:disabled { cursor: not-allowed; opacity: .6; }
.seg.sm { padding: 2px; border-radius: 7px; } .seg.sm button { padding: 3px 9px; font-size: 12px; border-radius: 5px; }
/* KPI tiles */
.kpi { padding: 14px 16px; }
.kpi .lab { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.kpi .val { font-size: 26px; font-weight: 700; letter-spacing: -.02em; line-height: 1.15; margin: 6px 0 4px; font-variant-numeric: proportional-nums; }
.kpi .val .u { font-size: 14px; font-weight: 600; letter-spacing: 0; color: var(--muted); }
.kpi .sub { font-size: 12px; color: var(--muted); }
.kpi.flag { border-color: var(--ns-b); background: var(--ns-f); }
.kpi.flag .sub { color: var(--ns-t); }
.pos { color: var(--acc-d); } .neg { color: var(--loss); } .amb { color: var(--ns-t); }
/* log panel (X-Options .logs) */
.logbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.logbar input[type=search] { min-height: 32px; border: 1px solid var(--ctl-in); border-radius: 7px; padding: 5px 10px; background: #fff; width: 220px; max-width: 100%; }
.logbar input:focus { outline: none; border-color: var(--acc); box-shadow: var(--focus); }
.logs { background: var(--gd); color: #E6F0EB; border-radius: 10px; padding: 12px 0; height: 520px; overflow: auto; font: 12.5px/1.55 var(--mono); position: relative; }
.logs .ln { display: grid; grid-template-columns: 66px 58px minmax(0, 1fr); gap: 10px; padding: 0 16px; }
.logs.multi .ln { grid-template-columns: 66px 58px 104px minmax(0, 1fr); }
.logs .ln:hover { background: rgba(255,255,255,.04); }
.logs .ts { color: #8FB3A3; }
.logs .lv { font-weight: 600; color: #A9C2B7; }
.logs .wk { color: #B5DFCB; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.logs .tx { white-space: pre-wrap; word-break: break-word; }
.logs .lv-STEP .lv { color: #48D49C; } .logs .lv-STEP .tx { color: #D7F0E4; }
.logs .lv-SOLVER .lv { color: #9CC7F2; }
.logs .lv-WARN .lv, .logs .lv-WARN .tx { color: #F5D58A; }
.logs .lv-ERROR .lv, .logs .lv-ERROR .tx { color: #F3A79E; }
.logs .lv-CTRL { background: rgba(72,212,156,.10); } .logs .lv-CTRL .lv, .logs .lv-CTRL .tx { color: #7FE0B8; font-weight: 600; }
.logs .empty-l { padding: 24px 16px; color: #A9C2B7; font-family: Inter, system-ui, sans-serif; }
.logs .new { animation: fadein .6s ease-out; }
@keyframes fadein { from { background: rgba(72,212,156,.18); } to { background: transparent; } }
.logfoot { display: flex; gap: 12px; align-items: center; font-size: 12.5px; color: var(--muted); margin-top: 8px; flex-wrap: wrap; }
/* fields and settings */
.fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); gap: 14px 18px; }
.field label, .field .lbl { display: block; font-size: 12px; color: var(--muted); font-weight: 500; margin-bottom: 5px; }
.field .v { font-weight: 600; }
.field input[type=number], .field input[type=text], .field select { width: 100%; min-height: 34px; border: 1px solid var(--ctl-in); border-radius: 7px; padding: 6px 9px; background: #fff; }
.field input:focus, .field select:focus { outline: none; border-color: var(--acc); box-shadow: var(--focus); }
.field .help { font-size: 12px; color: var(--muted); margin-top: 5px; }
.field.changed input, .field.changed select { border-color: #D99A00; background: var(--ns-f); }
.checks { display: flex; flex-wrap: wrap; gap: 6px; }
.checks label { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--hair); border-radius: 8px; padding: 5px 10px; font-size: 13px; cursor: pointer; background: #fff; }
.checks label:has(input:checked) { border-color: var(--acc); background: var(--acc-t); color: var(--acc-d); font-weight: 600; }
.checks input { accent-color: var(--acc-d); margin: 0; }
.fs { border: 0; padding: 0; margin: 0 0 18px; }
.fs legend { font-size: 13.5px; font-weight: 600; margin-bottom: 10px; padding: 0; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; font-size: 13px; margin: 0; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; font-weight: 500; }
.note { font-size: 12.5px; color: var(--ink2); background: var(--hair2); border-radius: 8px; padding: 9px 12px; }
.note.warn { background: var(--ns-f); color: var(--ns-t); }
.note.info { background: var(--info-t); color: var(--info); }
.lock { font-size: 12.5px; color: var(--ns-t); display: flex; gap: 6px; align-items: center; }
/* stepper */
.stepper { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.stepper .s { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; font-size: 13px; color: var(--muted); }
.stepper .s .ic { width: 20px; height: 20px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; border: 1.5px solid var(--plain-d); font-size: 11px; color: #fff; flex: none; }
.stepper .s.done { color: var(--acc-d); } .stepper .s.done .ic { background: var(--acc-d); border-color: var(--acc-d); }
.stepper .s.now { color: var(--info); } .stepper .s.now .ic { border-color: var(--info); background: var(--info-t); }
.stepper .s.bad { color: var(--loss); } .stepper .s.bad .ic { background: var(--loss); border-color: var(--loss); }
.stepper .s small { font-weight: 500; color: var(--muted); }
.stepper .arr { color: var(--plain-d); }
/* time bars */
.tbar { display: grid; grid-template-columns: minmax(110px, 38%) minmax(0, 1fr) 64px; gap: 10px; align-items: center; padding: 5px 0; font-size: 13px; }
.tbar .tt { position: relative; height: 12px; background: var(--track); border-radius: 3px; overflow: hidden; }
.tbar .tt i { position: absolute; top: 0; bottom: 0; left: 0; border-radius: 3px; background: var(--acc); }
.tbar .tt i.sv { background: var(--info); } .tbar .tt i.wr { background: var(--plain-d); }
.tbar b { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.tbar .mono { font-size: 12px; color: var(--ink2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.phasebar { display: flex; height: 28px; border-radius: 7px; overflow: hidden; font-size: 12px; font-weight: 600; margin: 4px 0 6px; }
.phasebar div { display: flex; align-items: center; padding: 0 9px; white-space: nowrap; overflow: hidden; min-width: 0; }
.ph-b { background: var(--acc-l); color: var(--gd); } .ph-s { background: var(--info); color: #fff; } .ph-w { background: var(--plain); color: var(--gd); }
/* alerts */
.alert { display: grid; grid-template-columns: 44px 20px minmax(0, 1fr); gap: 0 10px; align-items: start; padding: 12px 0; border-top: 1px solid var(--hair2); }
.alert:first-child { border-top: 0; padding-top: 2px; }
.alert .at { color: var(--muted); font-size: 12.5px; padding-top: 1px; font-variant-numeric: tabular-nums; }
.alert .tico { margin-top: 1px; }
.alert .al-h { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; }
.alert .al-h b { font-weight: 600; font-size: 13.5px; }
.alert .al-w { font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.alert p { margin: 3px 0 0; font-size: 13px; color: var(--ink2); }
.alert .al-why code { font: 11.5px var(--mono); color: var(--muted); background: var(--hair2); border-radius: 4px; padding: 0 5px; white-space: nowrap; }
.alert .al-next { display: flex; gap: 8px; align-items: baseline; }
.alert .al-next > span { flex: none; font-size: 11px; font-weight: 700; color: var(--acc-d); text-transform: uppercase; letter-spacing: .06em; }
.alert .al-who { font-size: 12px; color: var(--muted); white-space: nowrap; }
/* matrix */
table.mx td, table.mx th { text-align: center; }
table.mx td:first-child, table.mx th:first-child { text-align: left; }
table.mx select { min-height: 32px; border: 1px solid var(--ctl); border-radius: 7px; padding: 4px 8px; background: #fff; font-weight: 600; }
table.mx select.cg { border-color: var(--acc); background: var(--acc-t); color: var(--acc-d); }
table.mx select.chg { box-shadow: 0 0 0 2px #E7CF94; }
.ackgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr)); gap: 6px 14px; font-size: 12.5px; }
.ackgrid span { display: flex; gap: 7px; align-items: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ackgrid i { width: 8px; height: 8px; border-radius: 50%; background: var(--plain); flex: none; }
.ackgrid i.ok { background: var(--acc); }
/* plan pages */
.prose p, .prose li { color: var(--ink2); }
.cols3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 14px; }
.gate { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 12px; }
.gate .n { width: 28px; height: 28px; border-radius: 50%; background: var(--acc-t); color: var(--acc-d); font-weight: 700; display: flex; align-items: center; justify-content: center; }
.yes { color: var(--acc-d); font-weight: 600; } .no { color: var(--muted); }
ul.clean { margin: 0; padding-left: 18px; } ul.clean li { margin: 3px 0; color: var(--ink2); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12px; color: var(--ink2); margin-bottom: 8px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.legend i.dash { height: 0; border-top: 2px dashed var(--plain-d); border-radius: 0; vertical-align: 3px; width: 14px; }
.legend i.line { height: 0; border-top: 2.5px solid var(--acc); border-radius: 0; vertical-align: 3px; width: 14px; }
svg text { font-family: Inter, system-ui, sans-serif; font-variant-numeric: tabular-nums; }
.empty { padding: 28px 16px; text-align: center; color: var(--muted); }
/* dialog, toast */
dialog { border: 0; border-radius: 14px; padding: 0; width: min(560px, calc(100vw - 32px)); box-shadow: var(--sh-pop); color: var(--ink); }
dialog::backdrop { background: rgba(18, 38, 31, .35); }
.dlg { padding: 22px 24px 20px; }
.dlg h3 { margin: 0 0 6px; font-size: 18px; font-weight: 600; }
.dlg p { margin: 6px 0; color: var(--ink2); }
.dlg .acts { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; }
.dlg input[type=text] { width: 100%; min-height: 36px; border: 1px solid var(--ctl-in); border-radius: 7px; padding: 6px 10px; margin-top: 6px; }
.dlg input[type=text]:focus { outline: none; border-color: var(--acc); box-shadow: var(--focus); }
.dlg table.t { margin-top: 10px; font-size: 13px; } .dlg table.t td, .dlg table.t th { padding: 7px 10px; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); background: var(--gd); color: #fff; padding: 9px 16px; border-radius: 9px; font-size: 13px; font-weight: 500; box-shadow: var(--sh-pop); opacity: 0; transition: opacity .2s, transform .2s; pointer-events: none; z-index: 20; max-width: calc(100vw - 32px); }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.foot { font-size: 12px; color: var(--muted); margin-top: 28px; padding-top: 12px; border-top: 1px solid var(--hair); max-width: 1320px; }

/* ===== shared components (D, 2026-10-27; markup in xw/notes/D.md "COMPONENTS") ===== */
.sr { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
/* count badge (rail and tabs) */
.nb { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--hair2); color: var(--ink2); font: 600 11.5px/1 Inter, system-ui, sans-serif; font-style: normal; font-variant-numeric: tabular-nums; flex: none; }
.nb:empty { display: none; }
.nb.live { background: var(--info-t); color: var(--info); gap: 4px; }
.nb.live::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; animation: pulse-b 1.6s infinite; }
@media (prefers-reduced-motion: reduce) { .nb.live::before { animation: none; } }
.nb.warn { background: var(--ns-f); color: var(--ns-t); }
.nb.bad { background: var(--loss-l); color: var(--loss-d); }
/* tone icon: shape and colour both carry the tone (info i, good tick, warn !, bad x, ctrl sliders) */
.tico { display: inline-block; width: 18px; height: 18px; flex: none; background: center / 18px 18px no-repeat; vertical-align: -4px; }
.t-info { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18'%3E%3Ccircle cx='9' cy='9' r='8.5' fill='%23EAF1FB' stroke='%23C9DAF2'/%3E%3Ccircle cx='9' cy='5.5' r='1.25' fill='%231F5FAF'/%3E%3Crect x='8' y='7.7' width='2' height='5.6' rx='1' fill='%231F5FAF'/%3E%3C/svg%3E"); }
.t-good { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18'%3E%3Ccircle cx='9' cy='9' r='9' fill='%232E8763'/%3E%3Cpath d='M5.3 9.4l2.5 2.4 4.9-5.3' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.t-warn { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18'%3E%3Cpath d='M9 1.2l8.2 14.6H.8z' fill='%23D99A00' stroke='%23D99A00' stroke-linejoin='round' stroke-width='1.4'/%3E%3Crect x='8' y='6' width='2' height='5.4' rx='1' fill='%23fff'/%3E%3Ccircle cx='9' cy='13.4' r='1.15' fill='%23fff'/%3E%3C/svg%3E"); }
.t-bad { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18'%3E%3Ccircle cx='9' cy='9' r='9' fill='%23B5473C'/%3E%3Cpath d='M6.2 6.2l5.6 5.6M11.8 6.2l-5.6 5.6' stroke='%23fff' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E"); }
.t-ctrl { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18'%3E%3Crect width='18' height='18' rx='5' fill='%23123627'/%3E%3Cpath d='M4.5 6.5h9M4.5 11.5h9' stroke='%237FE0B8' stroke-width='1.5' stroke-linecap='round'/%3E%3Ccircle cx='7' cy='6.5' r='1.9' fill='%237FE0B8'/%3E%3Ccircle cx='11' cy='11.5' r='1.9' fill='%237FE0B8'/%3E%3C/svg%3E"); }
/* event kind marks: ONE vocabulary for chart markers, legends and feeds (shape = kind; same glyphs as the Overview legend)
   plan dot, bound diamond, done check circle (done-bad x, done-warn !), err red triangle, warn amber triangle, ctrl dark square, info grey dot */
.kico { display: inline-block; width: 15px; height: 15px; flex: none; background: center / 15px 15px no-repeat; vertical-align: -3px; }
.k-plan { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-7.5 -7.5 15 15'%3E%3Ccircle r='4.5' fill='%231F6B4C' stroke='%23fff' stroke-width='1.5'/%3E%3C/svg%3E"); }
.k-bound { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-7.5 -7.5 15 15'%3E%3Cpath d='M0 -5L5 0L0 5L-5 0Z' fill='%23fff' stroke='%23123627' stroke-width='1.6'/%3E%3C/svg%3E"); }
.k-done { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-7.5 -7.5 15 15'%3E%3Ccircle r='6.5' fill='%231F6B4C' stroke='%23fff' stroke-width='1.5'/%3E%3Cpath d='M-3 0.1L-0.9 2.3L3.1 -2.1' fill='none' stroke='%23fff' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.k-done-bad { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-7.5 -7.5 15 15'%3E%3Ccircle r='6.5' fill='%23B5473C' stroke='%23fff' stroke-width='1.5'/%3E%3Cpath d='M-2.5 -2.5L2.5 2.5M2.5 -2.5L-2.5 2.5' fill='none' stroke='%23fff' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.k-done-warn { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-7.5 -7.5 15 15'%3E%3Ccircle r='6.5' fill='%23B07A00' stroke='%23fff' stroke-width='1.5'/%3E%3Cpath d='M0 -3.4V0.6M0 3V3.1' fill='none' stroke='%23fff' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.k-err { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-7.5 -7.5 15 15'%3E%3Cpath d='M0 -6.2L6.4 5.2H-6.4Z' fill='%23B5473C' stroke='%23fff' stroke-width='1.5'/%3E%3Cpath d='M0 -2.2V1.4M0 3.3V3.4' fill='none' stroke='%23fff' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.k-warn { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-7.5 -7.5 15 15'%3E%3Cpath d='M0 -6.2L6.4 5.2H-6.4Z' fill='%23B07A00' stroke='%23fff' stroke-width='1.5'/%3E%3C/svg%3E"); }
.k-ctrl { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-7.5 -7.5 15 15'%3E%3Crect x='-4.6' y='-4.6' width='9.2' height='9.2' rx='1.5' fill='%23123627' stroke='%23fff' stroke-width='1.5'/%3E%3C/svg%3E"); }
.k-sub { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-7.5 -7.5 15 15'%3E%3Ccircle r='3.2' fill='%23fff' stroke='%23123627' stroke-width='1.5'/%3E%3C/svg%3E"); }
.k-info { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-7.5 -7.5 15 15'%3E%3Ccircle r='3' fill='%23A9B5AF'/%3E%3C/svg%3E"); }
/* event feed: parsed log events and audit entries */
.feed { list-style: none; margin: 0; padding: 0; }
.ev { position: relative; display: grid; grid-template-columns: 62px 18px minmax(0, 1fr) auto; gap: 0 10px; align-items: start; padding: 6px 0; }
.ev-t { font-size: 12px; color: var(--muted); line-height: 18px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ev-b { min-width: 0; line-height: 18px; font-size: 13px; }
.ev-title { font-weight: 600; color: var(--ink); }
.ev-d { color: var(--muted); font-size: 12.5px; }
.ev-title + .ev-d::before { content: "·"; margin: 0 6px; color: var(--plain-d); }
.ev-w { font-size: 12px; font-weight: 600; white-space: nowrap; margin-right: 6px; }
.ev-x { font-size: 12.5px; font-weight: 600; color: var(--ink); white-space: nowrap; line-height: 18px; text-align: right; }
.ev.ev-bad .ev-title { color: var(--loss); } .ev.ev-warn .ev-title { color: var(--ns-t); }
.ev.ev-ctrl { background: var(--acc-t); border-radius: var(--r-sm); margin: 2px -8px; padding: 6px 8px; }
.feed.line .ev:not(:last-child)::after { content: ""; position: absolute; left: 80.5px; top: 26px; bottom: -4px; width: 1px; background: var(--hair); }
.feed.line .ev.ev-ctrl:not(:last-child)::after { left: 88.5px; }
.feed.two .ev-d { display: block; } .feed.two .ev-title + .ev-d::before { content: none; }
.feed.compact .ev { padding: 3px 0; }
.ev.new { animation: evin .7s ease-out; }
@keyframes evin { from { background: rgba(72, 212, 156, .16); } to { background: transparent; } }
@media (prefers-reduced-motion: reduce) { .ev.new { animation: none; } }
/* chip buttons: single select (role=radio, aria-checked) or multi select (.multi, aria-pressed) */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips button { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 4px 12px; border: 1px solid var(--ctl); border-radius: 999px; background: #fff; color: var(--ink2); font-size: 12.5px; font-weight: 500; line-height: 1.2; white-space: nowrap; transition: background-color .12s, border-color .12s; }
.chips button:hover:not(:disabled) { border-color: var(--acc); color: var(--ink); }
.chips button.on, .chips button[aria-pressed="true"], .chips button[aria-checked="true"] { background: var(--acc-t); border-color: var(--acc); color: var(--acc-dd); font-weight: 600; }
.chips.multi button::before { content: ""; width: 12px; height: 12px; border-radius: 3px; border: 1.5px solid var(--ctl); background: #fff center / 10px 10px no-repeat; flex: none; }
.chips.multi button.on::before, .chips.multi button[aria-pressed="true"]::before { border-color: var(--acc-d); background-color: var(--acc-d); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M2 5.2l2 2 4-4.4' fill='none' stroke='%23fff' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.chips button .n { font-size: 11.5px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.chips button.on .n, .chips button[aria-pressed="true"] .n, .chips button[aria-checked="true"] .n { color: var(--acc-d); }
.chips button:disabled { opacity: .55; cursor: not-allowed; }
.chips button.chg { box-shadow: 0 0 0 2px var(--ns-b); }
.chips.sm button { min-height: 26px; padding: 2px 10px; font-size: 12px; }
/* choice tiles: 2 to 4 options with a value under each */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); gap: 10px; }
.tile { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-height: 60px; padding: 11px 34px 11px 14px; border: 1px solid var(--ctl); border-radius: var(--r-md); background: #fff; color: var(--ink); text-align: left; transition: border-color .12s, background-color .12s; }
.tile:hover:not(:disabled) { border-color: var(--acc); }
.tile-t { font-size: 13.5px; font-weight: 600; line-height: 1.3; }
.tile-d { font-size: 12px; color: var(--muted); line-height: 1.35; }
.tile::after { content: ""; position: absolute; top: 11px; right: 11px; width: 16px; height: 16px; border-radius: 50%; border: 1.5px solid var(--ctl); background: #fff center / 10px 10px no-repeat; }
.tile.on, .tile[aria-checked="true"], .tile[aria-pressed="true"] { border-color: var(--acc); box-shadow: inset 0 0 0 1px var(--acc); background: var(--acc-t); }
.tile.on::after, .tile[aria-checked="true"]::after, .tile[aria-pressed="true"]::after { border-color: var(--acc-d); background-color: var(--acc-d); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M2 5.2l2 2 4-4.4' fill='none' stroke='%23fff' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.tile.on .tile-d, .tile[aria-checked="true"] .tile-d { color: var(--acc-dd); }
.tile.chg { box-shadow: inset 0 0 0 1px var(--acc), 0 0 0 3px var(--ns-b); }
.tile:disabled { opacity: .55; cursor: not-allowed; }
.tiles.sm .tile { min-height: 44px; padding: 8px 30px 8px 12px; } .tiles.sm .tile::after { top: 8px; right: 9px; }
/* toggle switch: instant on/off */
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; min-height: 32px; cursor: pointer; font-size: 13px; font-weight: 500; color: var(--ink); }
.switch input { position: absolute; opacity: 0; width: 36px; height: 20px; margin: 0; cursor: pointer; }
.switch .track { pointer-events: none; position: relative; width: 36px; height: 20px; border-radius: 999px; background: var(--muted-l); flex: none; transition: background-color .15s; }
.switch .track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: var(--sh-thumb); transition: transform .15s; }
.switch input:checked + .track { background: var(--acc-d); }
.switch input:checked + .track::after { transform: translateX(16px); }
.switch input:focus-visible + .track { outline: 2px solid var(--acc); outline-offset: 2px; }
.switch:has(input:disabled) { cursor: not-allowed; opacity: .55; }
.switch .st { font-size: 12px; font-weight: 600; color: var(--muted); }
.switch input:checked ~ .st { color: var(--acc-d); }
@media (prefers-reduced-motion: reduce) { .switch .track, .switch .track::after { transition: none; } }
/* compact key/value grid */
.kvg { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 128px), 1fr)); gap: 12px 20px; margin: 0; }
.kvg > div { min-width: 0; }
.kvg dt { font-size: 12px; color: var(--muted); font-weight: 500; line-height: 1.35; }
.kvg dd { margin: 3px 0 0; font-size: 14px; font-weight: 600; color: var(--ink); line-height: 1.3; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.kvg dd small { font-size: 12px; font-weight: 500; color: var(--muted); }
.kvg.lg dd { font-size: 20px; font-weight: 700; letter-spacing: -.01em; }
.kvg.rule > div { border-left: 2px solid var(--hair); padding-left: 12px; }
/* old -> new value */
.diff { display: inline-flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.diff s { color: var(--muted); text-decoration-color: var(--plain-d); }
.diff i { font-style: normal; color: var(--plain-d); }
.diff b { font-weight: 600; color: var(--ink); }
/* sticky change bar: unsaved changes with discard and publish */
.changebar { position: sticky; bottom: 14px; z-index: 6; display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; margin-top: 16px; padding: 10px 12px 10px 16px; background: var(--gd); color: #D7E6DE; border-radius: var(--r-lg); box-shadow: var(--sh-pop); font-size: 13px; }
.changebar .cb-n { font-weight: 600; color: #fff; white-space: nowrap; }
.changebar .cb-n b { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; padding: 0 6px; margin-right: 6px; border-radius: 999px; background: var(--gl); color: var(--gd); font-size: 12px; }
.changebar .cb-d { flex: 1 1 220px; min-width: 0; color: #B5DFCB; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.changebar .cb-d s { color: #8FB3A3; } .changebar .cb-d b { color: #fff; font-weight: 600; }
.changebar .btn { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .35); }
.changebar .btn:hover:not(:disabled) { border-color: #fff; color: #fff; }
.changebar .btn.primary { background: var(--gl); border-color: var(--gl); color: var(--gd); }
.changebar .btn.primary:hover:not(:disabled) { background: #6FE0B4; border-color: #6FE0B4; color: var(--gd); }
.changebar :focus-visible { outline-color: var(--gl); }
/* a toast never covers an open change bar */
body:has(.changebar:not([hidden])) .toast { bottom: 84px; }
@media (max-width: 600px) { body:has(.changebar:not([hidden])) .toast { bottom: 136px; } }
@media (max-width: 900px) {
  .shell { flex-direction: column; }
  .rail { width: auto; flex-direction: row; align-items: center; border-right: 0; border-bottom: 1px solid var(--hair); padding: 8px 10px; gap: 6px; overflow-x: auto; }
  .rail .logo { padding: 4px 8px; flex: none; }
  .rail h6, .rail nav a span, .rail .user .who { display: none; }
  .rail .user { display: flex; flex: none; margin: 0 0 0 6px; padding: 0 0 0 10px; border-top: 0; border-left: 1px solid var(--hair2); }
  .rail nav { display: flex; gap: 2px; flex: none; }
  .rail nav a { padding: 7px 10px; margin: 0; white-space: nowrap; }
  .rail nav a.on::before { display: none; }
  main { padding: 14px 16px 48px; }
  .livebar { margin: -14px -16px 14px; padding: 6px 16px; min-height: 44px; gap: 8px; }
  .rail nav a { min-height: 34px; }
  .rail nav a .nb { min-width: 18px; height: 18px; font-size: 11px; }
}
@media (max-width: 600px) {
  .xf-head { flex-wrap: wrap; }
  .xf-tools { justify-content: flex-start; }
  .card.xf { padding: 18px 16px; }
  .livebar .tz { display: none; }
  .logs .ln, .logs.multi .ln { grid-template-columns: 62px minmax(0, 1fr); }
  .logs .lv, .logs .wk { display: none; }
}
