/* Spectrum AI Lakehouse: the app shell and page patterns.
   Built on ds/tokens.css (colours, type, density), ds/workbench.css (wb-* shell) and
   ds/components.css (ds-* components). The design's inline styles live here as classes so the
   page scripts only emit class names. */

html, body { margin: 0; background: var(--surface-0); }
body { font-family: var(--font-sans); }
[hidden] { display: none !important; }
a { color: var(--fg-1); }
a:hover { color: var(--fg-2); }
:focus-visible { outline: var(--focus-ring-width) solid var(--focus-ring); outline-offset: var(--focus-ring-offset); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* page density, from the design's helmet */
.aw-body { --pg-pad: 20px; --pg-gap: 24px; --pg-col: 16px; --pg-head: 10px; }
[data-density="comfortable"] .aw-body { --pg-pad: 28px; --pg-gap: 32px; --pg-col: 24px; --pg-head: 12px; }
[data-density="compact"] .aw-body { --pg-pad: 12px; --pg-gap: 16px; --pg-col: 10px; --pg-head: 8px; }
.aw-body .wb-kpis { gap: var(--pg-col); }

/* ---------- shell ---------- */
.wb-app.app { height: auto; min-height: 100vh; overflow: visible; }
.app-bar { position: sticky; top: 0; z-index: 50; background: var(--surface-0); }
.app-bar .wb-cmd { gap: 16px; }
.app-bar .wb-pn b { color: var(--fg-1); }
.app-bar .wb-pn span { display: block; }
.gb-search { position: relative; flex: 0 1 520px; display: flex; }
.gb-search .wb-search { flex: 1 1 auto; width: 100%; }
.gb-search input::-webkit-search-cancel-button { display: none; }
.wb-cmd-r { gap: 8px; }
.wb-asat { align-items: center; gap: 6px; padding: 4px; }
.pop-scrim { position: fixed; inset: 0; background: transparent; border: 0; z-index: 60; cursor: default; }
.pop { position: absolute; z-index: 61; padding: 6px; gap: 0; box-shadow: var(--shadow-surface-3, 0 12px 32px rgba(0,0,0,.45)); }
.pop-search { left: 0; right: 0; top: calc(100% + 6px); max-height: min(70vh, 560px); overflow: auto; }
.pop-notes { right: 0; top: calc(100% + 8px); width: 400px; max-width: calc(100vw - 24px); }
.pop-acct { right: 0; top: calc(100% + 8px); width: 340px; max-width: calc(100vw - 24px); gap: 2px; }
.pop-h { padding: 8px 12px 2px; font-size: var(--text-sm); font-weight: 600; color: var(--fg-1); }
.pop-g { padding: 10px 12px 4px; font-size: var(--text-2xs); font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--fg-3); }
.pop-i { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 6px; text-decoration: none; color: var(--fg-1); }
.pop-i:hover, .pop-i[aria-selected="true"] { background: var(--hover-bg); color: var(--fg-1); }
.pop-i .ic { display: inline-flex; color: var(--fg-3); }
.pop-i .tx { display: flex; flex-direction: column; min-width: 0; }
.pop-i .tx b { font-size: var(--text-sm); font-weight: 500; }
.pop-i .tx small { font-size: var(--text-xs); line-height: var(--text-xs-lh); color: var(--fg-3); }
.pop-f { display: flex; justify-content: space-between; gap: 8px; padding: 8px 12px 4px; border-top: 1px solid var(--border-subtle); margin-top: 4px; font-size: var(--text-xs); color: var(--fg-3); }
.pop-f a { color: var(--fg-2); }
.pop-none { padding: 16px 12px; font-size: var(--text-sm); color: var(--fg-2); }
.note-i { display: flex; gap: 10px; padding: 10px 12px; border-radius: 6px; text-decoration: none; color: var(--fg-1); }
.note-i:hover { background: var(--hover-bg); color: var(--fg-1); }
.note-i[data-unread] { background: color-mix(in srgb, var(--hover-bg) 60%, transparent); }
.note-i .d { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; flex: none; background: var(--border-control); }
.note-i[data-tone="bad"] .d { background: var(--critical-solid); }
.note-i[data-tone="warn"] .d { background: var(--medium-fg); }
.note-i[data-tone="info"] .d { background: var(--chart-1); }
.note-i .tx { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.note-i .tx b { font-size: var(--text-sm); font-weight: 500; }
.note-i[data-unread] .tx b { font-weight: 600; }
.note-i .tx small { font-size: var(--text-xs); line-height: var(--text-xs-lh); color: var(--fg-3); }
.notes-head { display: flex; align-items: center; padding: 8px 12px; }
.notes-head b { font-weight: 600; font-size: 14px; }
.notes-head span { margin-inline-start: 8px; font-size: var(--text-xs); color: var(--fg-3); }
.link-btn { border: 0; background: transparent; color: var(--fg-2); font: inherit; font-size: var(--text-xs); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; padding: 0; }
.link-btn:hover { color: var(--fg-1); }
.acct-who { display: flex; align-items: center; gap: 12px; padding: 10px 16px 14px; margin: 0 -6px 4px; border-bottom: 1px solid var(--border-default); }
.acct-who .tx { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.acct-who .tx b { font-weight: 600; font-size: 14px; }
.acct-who .tx small { font-size: var(--text-xs); line-height: var(--text-xs-lh); color: var(--fg-3); overflow: hidden; text-overflow: ellipsis; }
.acct-role { margin-inline-start: auto; flex: none; font-size: var(--text-2xs); font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--bg-muted); color: var(--fg-1); }
.acct-l { padding: 10px 10px 4px; font-size: var(--text-2xs); font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--fg-3); }
.seg3 { margin: 2px 10px 6px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2px; padding: 2px; background: var(--bg-muted); border-radius: var(--radius); border: 1px solid var(--border-default); }
.seg3 button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: calc(var(--control-h-sm) - 2px); padding: 0 8px; border: 0; border-radius: calc(var(--radius) - 2px); font-family: var(--font-sans); font-size: var(--text-sm); font-weight: 500; cursor: pointer; background: transparent; color: var(--fg-2); }
.seg3 button[aria-checked="true"] { background: var(--surface-1); color: var(--fg-1); box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.seg3 svg { width: 14px; height: 14px; }
.menu-i { display: flex; align-items: center; gap: 10px; width: 100%; height: 34px; padding: 0 10px; box-sizing: border-box; border: 0; border-radius: 6px; background: transparent; color: var(--fg-1); font: inherit; font-size: var(--text-sm); text-align: start; cursor: pointer; text-decoration: none; }
.menu-i:hover { background: var(--hover-bg); color: var(--fg-1); }
.menu-i .k { margin-inline-start: auto; font-size: var(--text-2xs); color: var(--fg-3); }
.menu-i.danger, .menu-i.danger:hover { color: var(--critical-fg); }
.menu-sep { height: 1px; background: var(--border-default); margin: 6px 4px; }

/* nav */
.app-nav { width: 216px; flex: none; display: flex; flex-direction: column; gap: var(--wb-gap); align-self: flex-start; position: sticky; top: 54px; max-height: calc(100vh - 60px); }
.app-nav > .wb-tile { padding: 4px 0 8px; overflow: auto; }
.app-nav .wb-nv { text-decoration: none; }
.nav-g { padding: 6px 0 2px; }
.nav-gl { display: flex; align-items: center; padding: 6px var(--pad-x) 4px; }
.nav-gl span { font-size: var(--text-2xs); font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--fg-3); }
.nav-gl em { margin-inline-start: auto; font-size: 10px; letter-spacing: .04em; font-style: normal; font-weight: 500; color: var(--fg-3); }
.nav-sep { display: none; height: 1px; background: var(--border-subtle); margin: 6px 12px; }
.nav-dot { display: none; position: absolute; top: 7px; right: 14px; width: 8px; height: 8px; border-radius: 50%; background: var(--critical-solid); box-shadow: 0 0 0 2px var(--surface-1); }
.app[data-nav="collapsed"] .app-nav { width: 64px; }
.app[data-nav="collapsed"] .wb-nl, .app[data-nav="collapsed"] .nav-gl, .app[data-nav="collapsed"] .wb-nb { display: none; }
.app[data-nav="collapsed"] .nav-sep { display: block; }
.app[data-nav="collapsed"] .wb-nb:not(:empty) ~ .nav-dot { display: block; }
.app[data-nav="collapsed"] .wb-nv { justify-content: center; padding-inline: 0; }
.app-body { flex-wrap: nowrap; align-items: flex-start; }
.app-main { flex: 999 1 560px; min-width: 0; }
.nav-toggle { display: none; }

@media (max-width: 860px) {
  .app-nav { position: fixed; top: 54px; left: 6px; bottom: 6px; max-height: none; z-index: 70; transform: translateX(-110%); transition: transform var(--motion-base) var(--ease-standard); }
  .app-nav .wb-tile { box-shadow: var(--shadow-surface-3); }
  .app.menu-open .app-nav { transform: none; }
  .app .wb-left { display: flex; }
  .nav-toggle { display: grid; }
  .app-bar .wb-brand { min-width: 0; }
  .app[data-nav="collapsed"] .app-nav { width: 216px; }
}

/* ---------- page frame ---------- */
.pg { overflow: visible; }
.pg > .wb-tile { overflow: visible; }
.ph { position: static; border: 0; border-bottom: 1px solid var(--border-default); border-radius: var(--wb-r) var(--wb-r) 0 0; background: var(--surface-1); padding: 14px var(--panel-pad) 14px 16px; min-height: 72px; flex-wrap: wrap; }
.ph .wb-ph-l { gap: 4px; }
.ph .wb-ph-s { white-space: normal; }
.ph-acts { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.ph-badges { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ptabs { padding: 0 12px; border-bottom: 1px solid var(--border-default); background: var(--surface-1); }
.ptabs nav { display: flex; flex-wrap: wrap; border-bottom: 1px solid var(--border-default); margin-bottom: -1px; }
.ptab { display: inline-flex; align-items: center; gap: var(--sp-6); height: var(--control-h); padding: 0 var(--pad-x); font-family: var(--font-sans); font-size: var(--font-body); font-weight: 500; color: var(--fg-3); border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; text-decoration: none; white-space: nowrap; background: transparent; cursor: pointer; }
/* .ptabs prefix: outranks the design system's .wb-app a, so link tabs stay muted until chosen */
.ptabs .ptab { color: var(--fg-3); }
.ptabs .ptab:hover { color: var(--fg-1); }
.ptabs .ptab[aria-current="page"], .ptabs .ptab[aria-selected="true"] { font-weight: 600; color: var(--fg-1); border-bottom-color: var(--fg-1); }
.ptab .cnt { font-family: var(--font-mono); font-size: 11px; color: var(--fg-3); font-weight: 500; }
.aw-body { padding: var(--pg-pad); display: flex; flex-direction: column; gap: var(--pg-gap); background: color-mix(in srgb, var(--surface-0) 60%, var(--surface-1)); border-radius: 0 0 var(--wb-r) var(--wb-r); min-height: 320px; }

/* section: eyebrow heading + count pill + links, then a tile */
.sec { display: flex; flex-direction: column; gap: var(--pg-head); min-width: 0; }
.sec-h { display: flex; align-items: center; gap: 10px; min-height: 24px; padding: 0 2px; flex-wrap: wrap; }
.sec-h h2 { margin: 0; font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--fg-2); }
.sec-r { margin-inline-start: auto; display: flex; align-items: center; gap: 10px; font-size: var(--text-xs); line-height: var(--text-xs-lh); color: var(--fg-3); flex-wrap: wrap; }
.pill { display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: 999px; border: 1px solid var(--border-default); font-family: var(--font-mono); font-size: 11px; color: var(--fg-2); }
.ul { color: var(--fg-1); font-weight: 500; text-decoration: underline; text-decoration-color: var(--border-control); text-underline-offset: 3px; cursor: pointer; background: none; border: 0; padding: 0; font: inherit; }
.ul:hover { color: var(--fg-1); text-decoration-color: var(--fg-1); }
.ul.plain { font-weight: 400; }
.grid2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--pg-col); align-items: start; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--pg-col); align-items: start; }
.grid-2-1 { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: var(--pg-col); align-items: start; }
@media (max-width: 1100px) { .grid2, .grid3, .grid-2-1 { grid-template-columns: minmax(0, 1fr); } }
.toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.toolbar .grow { flex: 1 1 auto; }
.muted { color: var(--fg-3); }
.dim2 { color: var(--fg-2); }
.small { font-size: var(--text-xs); line-height: var(--text-xs-lh); }
.sm { font-size: var(--text-sm); line-height: var(--text-sm-lh); }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.num { font-variant-numeric: tabular-nums; }
.bad { color: var(--critical-fg); }
.good { color: var(--approved-fg); }
.warn { color: var(--medium-fg); }
.stack { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.wrap { flex-wrap: wrap; }
.end { margin-inline-start: auto; }
.prose { margin: 0; font-size: var(--text-sm); line-height: var(--text-sm-lh); color: var(--fg-2); max-width: 72ch; }

/* KPI tiles */
.kpis { grid-template-columns: repeat(var(--n, 4), minmax(0, 1fr)); }
@media (max-width: 1100px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .kpis { grid-template-columns: minmax(0, 1fr); } }
.kpi { padding: 12px var(--pad-x); gap: 6px; }
.kpi > .l { font-size: var(--text-sm); line-height: var(--text-sm-lh); color: var(--fg-2); }
.kpi > .m { display: flex; align-items: center; gap: 12px; min-width: 0; }
.kpi .v { display: flex; align-items: baseline; gap: 5px; white-space: nowrap; flex: 1 1 auto; min-width: 0; }
.kpi .v b { font-size: 24px; font-weight: 600; letter-spacing: -.02em; line-height: 1.15; font-variant-numeric: tabular-nums; color: var(--fg-1); }
.kpi .v span { font-size: var(--text-sm); line-height: var(--text-sm-lh); font-weight: 500; color: var(--fg-2); }
.kpi .spark { display: flex; margin-inline-start: auto; flex: none; color: var(--chart-1); }
.kpi > .s { font-size: var(--text-xs); line-height: var(--text-xs-lh); color: var(--fg-3); }
.kpi > .s.bad { color: var(--critical-fg); }

/* tables */
.tw { overflow-x: auto; }
.wb-table td.wrap, .wb-table th.wrap { white-space: normal; }
.wb-table td { padding-top: 6px; padding-bottom: 6px; }
.wb-table .n, .wb-table td.n { text-align: end; font-variant-numeric: tabular-nums; }
.wb-table tr.hl td { background: var(--selection-bg); }
.who { display: flex; align-items: center; gap: 10px; padding: 2px 0; }
.who .tx { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.who .tx b { font-weight: 600; }
.who .tx small { font-size: var(--text-xs); line-height: var(--text-xs-lh); color: var(--fg-3); }
.t-foot { display: flex; align-items: center; gap: 8px; padding: 10px var(--pad-x); border-top: 1px solid var(--border-subtle); font-size: var(--text-xs); line-height: var(--text-xs-lh); color: var(--fg-3); flex-wrap: wrap; }
.t-foot .end { display: flex; gap: 6px; }
.t-empty { padding: 28px var(--pad-x); text-align: center; color: var(--fg-3); font-size: var(--text-sm); }

/* key-value lists */
.kv { display: grid; grid-template-columns: minmax(120px, 34%) minmax(0, 1fr); gap: 10px 16px; padding: 14px var(--pad-x); font-size: var(--text-sm); line-height: var(--text-sm-lh); margin: 0; }
.kv dt { color: var(--fg-3); }
.kv dd { margin: 0; color: var(--fg-1); min-width: 0; overflow-wrap: anywhere; }

/* horizontal bars (sign-ins, failures by dataset) */
.hbars { padding: 14px var(--pad-x); display: grid; grid-template-columns: max-content minmax(0, 1fr) max-content; align-items: center; gap: 12px 12px; font-size: var(--text-sm); }
.hbars .l { text-align: end; color: var(--fg-2); white-space: nowrap; }
.hbars .t { height: 14px; border-radius: 3px; background: transparent; position: relative; }
.hbars .t i { position: absolute; inset-block: 0; inset-inline-start: 0; border-radius: 3px; background: var(--chart-1); min-width: 2px; }
.hbars .v { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--fg-2); }
.hbars a.l { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--border-control); }

/* status dot + label */
.st { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.st::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--fg-3); flex: none; }
.st[data-s="ok"]::before { background: var(--approved-fg); }
.st[data-s="warn"]::before { background: var(--medium-fg); }
.st[data-s="bad"]::before { background: var(--critical-solid); }
.st[data-s="run"]::before { background: var(--chart-1); }
.st[data-s="off"]::before { background: var(--border-control); }

/* field */
.field { display: flex; flex-direction: column; gap: 6px; font-size: var(--text-sm); color: var(--fg-1); min-width: 0; }
.field > .lbl { font-weight: 500; }
.field > .lbl .req { color: var(--critical-fg); }
.field > .hint { font-size: var(--text-xs); line-height: var(--text-xs-lh); color: var(--fg-3); }
.field > .err { font-size: var(--text-xs); color: var(--critical-fg); }
.form { display: flex; flex-direction: column; gap: 14px; }
.check-row { display: flex; align-items: center; gap: 8px; font-size: var(--text-sm); cursor: pointer; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px; border: 1px solid var(--border-control); border-radius: var(--radius); min-height: var(--control-h); align-items: center; }
.chips input { border: 0; outline: 0; background: transparent; color: var(--fg-1); font: inherit; flex: 1 1 120px; min-width: 80px; }
.chip-x { border: 0; background: transparent; padding: 0; color: inherit; cursor: pointer; display: inline-flex; }

/* native select dressed as the design's select trigger */
select.ds-sel-trig { appearance: none; -webkit-appearance: none; color: var(--fg-1); font: inherit; font-size: var(--font-body); cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 8px center; background-size: 16px; padding-inline-end: 30px; }
select.ds-sel-trig option { background: var(--surface-2); color: var(--fg-1); }
select.ds-sel-trig.sm { height: var(--control-h-sm); }
.ds-in.sm { height: var(--control-h-sm); }

/* menu (row "More" actions) */
.menu { position: absolute; z-index: 80; min-width: 200px; background: var(--surface-2); border: 1px solid var(--border-default); border-radius: var(--radius); box-shadow: var(--shadow-surface-2); padding: var(--sp-4); }

/* dialogs: native <dialog> wearing the design's dialog panel */
dialog.dlg { border: 0; padding: 0; background: transparent; color: var(--fg-1); max-width: calc(100vw - 32px); overflow: visible; }
dialog.dlg::backdrop { background: rgba(9, 9, 11, .6); }
.dlg-p { position: relative; width: min(var(--w, 440px), calc(100vw - 32px)); box-sizing: border-box; background: var(--surface-3); color: var(--fg-1); border: 1px solid var(--border-default); border-radius: calc(var(--radius) + 2px); box-shadow: var(--shadow-surface-3); padding: calc(var(--panel-pad) + 8px); font-family: var(--font-sans); max-height: calc(100vh - 48px); overflow: auto; }
.dlg-x { position: absolute; top: calc(var(--panel-pad) + 2px); right: calc(var(--panel-pad) + 2px); width: var(--control-h-sm); height: var(--control-h-sm); display: inline-flex; align-items: center; justify-content: center; color: var(--fg-3); border: 0; background: transparent; border-radius: var(--radius); cursor: pointer; }
.dlg-x:hover { background: var(--hover-bg); color: var(--fg-1); }
.dlg-h { display: flex; flex-direction: column; gap: var(--sp-4); margin-bottom: calc(var(--gap) * 2); padding-inline-end: calc(var(--control-h-sm) + 8px); }
.dlg-h h2 { margin: 0; font-size: var(--text-lg); line-height: var(--text-lg-lh); font-weight: 600; color: var(--fg-1); }
.dlg-h p { margin: 0; font-size: var(--font-body); line-height: var(--lh-body); color: var(--fg-3); }
.dlg-b { display: flex; flex-direction: column; gap: 14px; }
.dlg-f { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: var(--gap); margin-top: calc(var(--gap) * 3); align-items: center; }
.dlg-f .start { margin-inline-end: auto; }
.dlg-err { font-size: var(--text-sm); color: var(--critical-fg); }

/* side sheet (wraps the design's .ds-sheet classes) */
.sheet-wrap { position: fixed; inset: 0; z-index: 1000; }
.ds-sheet .ds-sheet-head h2 { margin: 0; font-size: var(--text-lg); line-height: var(--text-lg-lh); font-weight: 600; }
.ds-sheet .ds-sheet-head p { margin: 2px 0 0; color: var(--fg-3); font-size: var(--font-body); }
.ds-sheet .ds-sheet-head > div { display: flex; flex-direction: column; gap: var(--sp-2); flex: 1; min-width: 0; }

/* toast */
.toast { position: fixed; z-index: 1200; bottom: 20px; right: 20px; transform: translateY(20px); opacity: 0; pointer-events: none; display: flex; align-items: flex-start; gap: 10px; width: 340px; max-width: calc(100vw - 32px); box-sizing: border-box; padding: 12px 14px; background: var(--surface-3); color: var(--fg-1); border: 1px solid var(--border-default); border-left: 3px solid var(--approved-solid); border-radius: var(--radius); box-shadow: var(--shadow-surface-3); transition: opacity var(--motion-base), transform var(--motion-base); font-size: var(--text-sm); }
.toast.show { opacity: 1; transform: none; pointer-events: auto; }
.toast-ic { display: inline-flex; margin-top: 1px; color: var(--approved-solid); }
.toast-tx { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.toast b { font-weight: 600; font-size: var(--text-sm); }
.toast-tx > span { font-size: var(--text-xs); color: var(--fg-2); }
.toast[data-tone="info"] { border-left-color: var(--chart-1); } .toast[data-tone="info"] .toast-ic { color: var(--chart-1); }
.toast[data-tone="bad"] { border-left-color: var(--critical-solid); } .toast[data-tone="bad"] .toast-ic { color: var(--critical-solid); }
/* table rows with a main link (data-row-main) open it on a click anywhere in the row (ui.js) */
.wb-table tbody tr:has([data-row-main]) { cursor: pointer; }
.wb-table tbody tr:has([data-row-main]):hover td { background: var(--hover-bg); }

/* boxed steps / cards */
.card-list { display: flex; flex-direction: column; gap: var(--pg-col); }
.card { padding: 14px var(--pad-x); gap: 10px; }
.card-h { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.card-h b { font-weight: 600; }
.quote { margin: 0; padding: 8px 12px; border-inline-start: 2px solid var(--border-control); color: var(--fg-2); font-size: var(--text-sm); }

/* collapsible */
details.more { border-top: 1px solid var(--border-subtle); }
details.more > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; padding: 10px var(--pad-x); font-weight: 500; }
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary svg { transition: transform var(--motion-fast); }
details.more[open] > summary svg { transform: rotate(90deg); }

/* sparklines and small charts */
.spk { display: block; color: var(--chart-1); }
.spk path { fill: none; stroke: currentColor; stroke-width: 1.5; }
.chart { padding: 12px var(--pad-x); position: relative; }
.chart .hit { fill: transparent; cursor: crosshair; }
.chart .guide { stroke: var(--fg-3); stroke-width: 1; stroke-dasharray: 3 3; visibility: hidden; }
.chart .hl { fill: var(--chart-1); stroke: var(--surface-1); stroke-width: 2; visibility: hidden; }
.chart.on .guide, .chart.on .hl { visibility: visible; }
.chart-tip { position: absolute; pointer-events: none; z-index: 5; transform: translate(-50%, calc(-100% - 12px)); background: var(--fg-1); color: var(--surface-1); font-size: var(--text-xs); font-weight: 500; line-height: 1.3; padding: 5px 9px; border-radius: 6px; white-space: nowrap; font-variant-numeric: tabular-nums; box-shadow: 0 2px 8px rgba(0,0,0,.25); }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart .ax { fill: var(--fg-3); font-size: 11px; font-family: var(--font-sans); }
.chart .gl { stroke: var(--border-subtle); }
.chart .bar { fill: var(--chart-1); }
.chart .ln { fill: none; stroke: var(--chart-1); stroke-width: 2; }
.chart .ar { fill: color-mix(in srgb, var(--chart-1) 18%, transparent); }
.legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: var(--text-xs); color: var(--fg-3); padding: 0 var(--pad-x) 12px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-inline-end: 6px; vertical-align: -1px; background: var(--chart-1); }

/* "not available yet" note for features waiting on a backend */
.soon { display: inline-flex; align-items: center; gap: 6px; font-size: var(--text-xs); color: var(--fg-3); }

/* loading */
.loading { display: flex; flex-direction: column; gap: 10px; padding: 16px var(--pad-x); }
.app-err { padding: 32px; }

/* boot screen while the shell loads */
.boot { min-height: 100vh; display: grid; place-items: center; color: var(--fg-3); background: var(--surface-0); font-family: var(--font-sans); }

/* charts keep their own size (workbench.css sizes every svg in the app as an icon) */
.wb-app svg.spk { width: auto; height: auto; }
.wb-app .chart svg { width: 100%; height: auto; }
.wb-table td.wrap, .wb-table th.wrap { white-space: normal; }

/* Skip to content: first Tab stop, shown only while it has focus */
.skip-link{position:absolute;left:12px;top:-60px;z-index:1000;padding:8px 14px;border-radius:8px;background:var(--surface-1);color:var(--fg-1);border:2px solid currentColor;font:inherit;cursor:pointer}
.skip-link:focus{top:12px}
/* a page heading receives focus after navigation (screen readers announce it); no ring for that */
.wb-main h1[tabindex="-1"]:focus{outline:none}

/* Header on narrow screens: the entity line goes and the name shortens (860 px); on a phone only
   the brand mark stays and search takes the room, so the bell and account stay on screen */
@media (max-width: 860px) {
  .app-bar .wb-pn span { display: none; }
  .app-bar .wb-pn b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}
@media (max-width: 560px) {
  .app-bar .wb-pn, .app-bar .wb-kbd, .app-bar .wb-sep { display: none; }
  .app-bar .wb-brand { flex: 0 0 auto; min-width: 0; }
  .app-bar .gb-search { flex: 1 1 auto; min-width: 0; }
  .app-bar .wb-search { min-width: 0; }
  .app-bar .wb-cmd-r { flex: 0 0 auto; min-width: 0; }
}

/* (i) tip beside a label: the text shows on hover and on keyboard focus */
.tip { position: relative; display: inline-flex; vertical-align: -2px; margin-left: 6px; color: var(--fg-3); cursor: help; border-radius: 50%; }
.tip:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.tip::after { content: attr(data-tip); position: absolute; z-index: 60; left: 50%; bottom: calc(100% + 8px); transform: translateX(-50%); width: max-content; max-width: 280px; padding: 8px 10px; border-radius: var(--radius); background: var(--fg-1); color: var(--surface-1); font: 400 var(--text-xs)/1.45 var(--font-sans); text-transform: none; letter-spacing: 0; white-space: normal; opacity: 0; pointer-events: none; transition: opacity var(--motion-fast); }
.tip:hover::after, .tip:focus::after { opacity: 1; }
.hint.err, .field .err { color: var(--critical-fg); }
/* several choices from a short list (multiSelect in ui.js) */
.msel { position: relative; }
.msel > summary { list-style: none; display: flex; align-items: center; cursor: pointer; width: 100%; overflow: hidden; }
.msel > summary::-webkit-details-marker { display: none; }
.msel-t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msel[data-disabled] > summary { cursor: default; opacity: .7; pointer-events: none; }
.msel-pop { position: absolute; z-index: 50; top: calc(100% + 4px); left: 0; min-width: 100%; display: flex; flex-direction: column; gap: 8px; padding: 12px; border: 1px solid var(--border-default); border-radius: var(--radius); background: var(--surface-1); box-shadow: var(--shadow-surface-3); }

/* on a phone an alert's action goes under its text instead of squeezing it into a column */
@media (max-width: 640px) { .ds-alert-action { grid-column: 2; grid-row: auto; margin-top: 10px; align-self: start; flex-wrap: wrap; } }
