/* shared/oi.css — OI Analytics design tokens and base components.
   Reference, never modified in an SPA session. SPAs add their own layout in
   a <style> block using these tokens; they do not restyle these classes.
   Tokens are the client-error-tool's, so both tools look like one family. */

:root {
  --bg:            #F4F5F7;
  --bg-elev:       #FFFFFF;
  --bg-card:       #FFFFFF;
  --bg-inset:      #F7F8FA;
  --bg-hover:      rgba(0, 0, 0, .035);
  --line:          #DDE1E6;
  --line-soft:     #ECEFF1;
  --line-strong:   #BFC4CA;
  --text:          #1F2A33;
  --text-dim:      #5C6770;
  --text-faint:    #8A929A;
  --text-mute:     #B0B6BD;
  --orange:        #F7912C;
  --orange-text:   #B85F18;
  --green:         #468847;
  --green-bright:  #5CB270;
  --amber:         #F58F39;
  --blue:          #006D9C;
  --blue-bright:   #1182D2;
  --teal:          #1E93AE;
  --red:           #B43A2A;
  --magenta:       #A1395D;
  /* Severity scale (OI.ui.severity, timeline and bands charts): ITSI's seven levels. The light set is ITSI's
     published palette, verbatim; ITSI has no dark theme, so the dark set below is the platform's own. */
  --sev-unknown:   #A1A2A2;
  --sev-info:      #81D2FB;
  --sev-normal:    #99D18B;
  --sev-low:       #FEEA8B;
  --sev-medium:    #FCB64D;
  --sev-high:      #F26935;
  --sev-critical:  #B60000;
  --accent:        var(--blue);
  --warn:          var(--orange-text);
  --bad:           var(--red);
  --good:          var(--green);
  --r-1: 2px;
  --r-2: 3px;
  --r-3: 5px;
  --shadow-card: 0 1px 0 rgba(20, 30, 40, .03), 0 2px 6px rgba(20, 30, 40, .05);
  --shadow-pop:  0 4px 16px rgba(20, 30, 40, .12);
  --font-sans: "IBM Plex Sans", "Helvetica Neue", Helvetica, Arial, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", "SF Mono", Menlo, Consolas, monospace;
  /* Categorical series palette, in order. OI.ui.chart applies it. */
  --series-1: #1182D2;
  --series-2: #F7912C;
  --series-3: #468847;
  --series-4: #A1395D;
  --series-5: #1E93AE;
  --series-6: #B43A2A;
  --series-7: #5C6770;
  --series-8: #F58F39;
  --series-9: #7B61A8;
  --series-10: #2E8B57;
  --series-11: #E2B93B;
  --series-12: #17BECF;
  --series-13: #8C564B;
  --series-14: #E377C2;
  --series-15: #BCBD22;
  --series-16: #9467BD;
  --series-17: #FF7F0E;
  --series-18: #2CA02C;
  --series-19: #D62728;
  --series-20: #7F7F7F;
  --series-21: #AEC7E8;
  --series-22: #FFBB78;
  --series-23: #98DF8A;
  --series-24: #C5B0D5;
  /* Surfaces that were literals; same values, so the light theme is unchanged. */
  --on-accent:     #FFFFFF;                  /* text on an accent background (primary button, open help) */
  --bg-overlay:    rgba(255, 255, 255, .85); /* loading / error veil over a panel body */
  --bg-tooltip:    rgba(255, 255, 255, .98); /* chart tooltips */
}

/* ── dark theme ──
   Two copies of one block: data-theme="dark" (OI.prefs theme "dark"), and the
   OS preference when the viewer chose "auto" (no attribute). Keep them identical.
   Series keep their hue; the darker ones are lifted to read on --bg-card. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg:            #14181C;
  --bg-elev:       #1C2228;
  --bg-card:       #1C2228;
  --bg-inset:      #232A31;
  --bg-hover:      rgba(255, 255, 255, .05);
  --line:          #333C45;
  --line-soft:     #29313A;
  --line-strong:   #4A545E;
  --text:          #E3E7EB;
  --text-dim:      #A3ADB6;
  --text-faint:    #838E98;
  --text-mute:     #5E6872;
  --orange:        #F7912C;
  --orange-text:   #F0A55C;
  --green:         #62B563;
  --green-bright:  #72C685;
  --amber:         #F59E4F;
  --blue:          #4A9EDB;
  --blue-bright:   #6BB3E8;
  --teal:          #45B5CE;
  --red:           #EB6B5A;
  --magenta:       #D46B91;
  --sev-unknown:   #5F6468;   /* dark severity set: same order and hue family as the light set, muted for a dark card */
  --sev-info:      #3D86B0;
  --sev-normal:    #4F8F4A;
  --sev-low:       #A8923A;
  --sev-medium:    #B9772A;
  --sev-high:      #B04A26;
  --sev-critical:  #8A1C1C;
  --shadow-card: 0 1px 0 rgba(0, 0, 0, .25), 0 2px 6px rgba(0, 0, 0, .35);
  --shadow-pop:  0 4px 16px rgba(0, 0, 0, .55);
  --series-1: #3D9BE0;
  --series-3: #5FAE60;
  --series-4: #CF5F87;
  --series-5: #2FAFCB;
  --series-6: #E0604E;
  --series-7: #8C98A2;
  --series-9: #A08BD0;
  --series-10: #3FB070;
  --series-13: #B77A6E;
  --series-16: #AE8AD6;
  --series-18: #3DBB3D;
  --series-19: #E85454;
  --series-20: #A0A0A0;
  --on-accent:     #0E1A24;
  --bg-overlay:    rgba(20, 24, 28, .85);
  --bg-tooltip:    rgba(35, 42, 49, .98);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg:            #14181C;
    --bg-elev:       #1C2228;
    --bg-card:       #1C2228;
    --bg-inset:      #232A31;
    --bg-hover:      rgba(255, 255, 255, .05);
    --line:          #333C45;
    --line-soft:     #29313A;
    --line-strong:   #4A545E;
    --text:          #E3E7EB;
    --text-dim:      #A3ADB6;
    --text-faint:    #838E98;
    --text-mute:     #5E6872;
    --orange:        #F7912C;
    --orange-text:   #F0A55C;
    --green:         #62B563;
    --green-bright:  #72C685;
    --amber:         #F59E4F;
    --blue:          #4A9EDB;
    --blue-bright:   #6BB3E8;
    --teal:          #45B5CE;
    --red:           #EB6B5A;
    --magenta:       #D46B91;
    --sev-unknown:   #5F6468;
    --sev-info:      #3D86B0;
    --sev-normal:    #4F8F4A;
    --sev-low:       #A8923A;
    --sev-medium:    #B9772A;
    --sev-high:      #B04A26;
    --sev-critical:  #8A1C1C;
    --shadow-card: 0 1px 0 rgba(0, 0, 0, .25), 0 2px 6px rgba(0, 0, 0, .35);
    --shadow-pop:  0 4px 16px rgba(0, 0, 0, .55);
    --series-1: #3D9BE0;
    --series-3: #5FAE60;
    --series-4: #CF5F87;
    --series-5: #2FAFCB;
    --series-6: #E0604E;
    --series-7: #8C98A2;
    --series-9: #A08BD0;
    --series-10: #3FB070;
    --series-13: #B77A6E;
    --series-16: #AE8AD6;
    --series-18: #3DBB3D;
    --series-19: #E85454;
    --series-20: #A0A0A0;
    --on-accent:     #0E1A24;
    --bg-overlay:    rgba(20, 24, 28, .85);
    --bg-tooltip:    rgba(35, 42, 49, .98);
  }
}

/* ── base ── */
*, *::before, *::after { box-sizing: border-box; }
html { height: 100%; }
body {
  margin: 0; min-height: 100%;
  background: var(--bg); color: var(--text);
  font: 14px/1.45 var(--font-sans);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code, pre, .mono { font-family: var(--font-mono); font-size: 12.5px; }
h1 { font-size: 18px; font-weight: 600; margin: 0; }
h2 { font-size: 15px; font-weight: 600; margin: 0 0 8px; }
button, input, select, textarea { font: inherit; color: inherit; }

/* ── toolbar (OI.ui.toolbar) ── */
.oi-toolbar {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 10px 20px; background: var(--bg-elev);
  border-bottom: 1px solid var(--line); box-shadow: var(--shadow-card);
  position: sticky; top: 0; z-index: 10;
}
.oi-toolbar .oi-title { display: flex; align-items: baseline; gap: 10px; margin-right: auto; }
.oi-toolbar .oi-title .oi-sub { color: var(--text-dim); font-size: 12.5px; }
.oi-toolbar .oi-who { color: var(--text-dim); font-size: 12.5px; }
.oi-toolbar .oi-who b { color: var(--text); font-weight: 500; }
.oi-scope {
  display: inline-block; padding: 1px 7px; border-radius: 10px;
  background: var(--bg-inset); border: 1px solid var(--line); font-family: var(--font-mono); font-size: 11.5px;
}
.oi-scope.internal { border-color: var(--teal); color: var(--teal); }
/* viewer preference toggles (UTC / local, theme) */
.oi-toolbar .oi-prefs { display: flex; gap: 6px; }
.oi-toolbar .oi-btn.oi-pref { height: 26px; padding: 0 9px; font-size: 12px; font-weight: 400; color: var(--text-dim); border-color: var(--line-strong); }
.oi-toolbar .oi-btn.oi-pref:hover { background: var(--bg-inset); border-color: var(--accent); color: var(--text); }
.oi-toolbar .oi-btn.oi-pref:focus-visible { outline: 2px solid var(--blue-bright); outline-offset: 1px; }

/* ── page layout ── */
.oi-main { padding: 16px 20px; display: grid; gap: 16px; }
.oi-row { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }

/* ── inputs (OI.ui.inputs) ── */
.oi-inputs { display: flex; flex-wrap: wrap; gap: 12px 18px; align-items: flex-end; }
.oi-field { display: flex; flex-direction: column; gap: 4px; min-width: 140px; }
.oi-field label { font-size: 11.5px; color: var(--text-dim); text-transform: uppercase; letter-spacing: .03em; }
.oi-field input, .oi-field select {
  height: 30px; padding: 0 8px; border: 1px solid var(--line-strong); border-radius: var(--r-2);
  background: var(--bg-elev); min-width: 140px;
}
.oi-field select[multiple] { height: auto; min-height: 30px; padding: 4px; }
.oi-field input:focus, .oi-field select:focus { outline: 2px solid var(--blue-bright); outline-offset: -1px; }
.oi-field .oi-hint { font-size: 11.5px; color: var(--bad); min-height: 1em; }
.oi-btn {
  height: 30px; padding: 0 14px; border-radius: var(--r-2); border: 1px solid var(--accent);
  background: var(--accent); color: var(--on-accent); cursor: pointer; font-weight: 500;
}
.oi-btn:hover { background: var(--blue-bright); border-color: var(--blue-bright); }
.oi-btn.secondary { background: var(--bg-elev); color: var(--accent); }
.oi-btn:disabled { opacity: .5; cursor: default; }
.oi-btn.oi-refresh, .oi-btn.oi-source-btn { padding: 0 8px; min-width: 30px; font-size: 15px; line-height: 1; }

/* ── multi-select (OI.ui.multiselect; every multi param in OI.ui.inputs) ──
   The client-error-tool's control. Selectors inside .oi-ms outrank the
   .oi-field input/label rules above, which would otherwise reach in. */
.oi-ms { position: relative; min-width: 140px; }
.oi-ms-trigger {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%;
  height: 30px; padding: 0 8px; border: 1px solid var(--line-strong); border-radius: var(--r-2);
  background: var(--bg-elev); cursor: pointer; text-align: left; white-space: nowrap;
}
.oi-ms-trigger:hover { border-color: var(--accent); }
.oi-ms-trigger:focus-visible { outline: 2px solid var(--blue-bright); outline-offset: -1px; }
.oi-ms-name { font-weight: 500; overflow: hidden; text-overflow: ellipsis; }
.oi-ms-count { flex: none; color: var(--text-faint); font-size: 11px; letter-spacing: .02em; font-variant-numeric: tabular-nums; }
.oi-ms-count.active { color: var(--orange-text); font-weight: 600; }   /* a filter is on: "3 / 42" */
.oi-ms-pop {
  position: absolute; top: calc(100% + 4px); left: 0; z-index: 5; /* over later panels, under the sticky toolbar (10) */
  min-width: max(100%, 240px); max-width: min(420px, calc(100vw - 16px));
  background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--r-2); box-shadow: var(--shadow-pop);
}
.oi-ms-pop[hidden] { display: none; }
.oi-ms-bar {
  display: flex; align-items: center; gap: 6px; padding: 6px 8px;
  background: var(--bg-inset); border-bottom: 1px solid var(--line-soft); border-radius: var(--r-2) var(--r-2) 0 0;
}
.oi-ms-filter-wrap { position: relative; flex: 1 1 auto; min-width: 0; display: flex; }
.oi-ms .oi-ms-filter {
  flex: 1; min-width: 0; height: 22px; padding: 3px 20px 3px 8px; font-size: 11.5px;
  border: 1px solid var(--line); border-radius: var(--r-1); background: var(--bg-card);
}
.oi-ms .oi-ms-filter:focus { outline: 2px solid var(--blue-bright); outline-offset: -1px; }
.oi-ms .oi-ms-filter::placeholder { color: var(--text-faint); }
.oi-ms-clear {
  position: absolute; right: 2px; top: 50%; transform: translateY(-50%); padding: 0 4px;
  border: 0; background: none; color: var(--text-faint); font-size: 15px; line-height: 1; cursor: pointer;
}
.oi-ms-clear[hidden] { display: none; }
.oi-ms-clear:hover { color: var(--text); }
.oi-ms-all {
  flex: none; padding: 3px 10px; border: 1px solid var(--line); border-radius: var(--r-1); background: transparent;
  color: var(--text-dim); font-size: 10px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; cursor: pointer;
}
.oi-ms-all:hover { color: var(--text); border-color: var(--line-strong); background: var(--bg-card); }
.oi-ms-all:focus-visible { outline: 2px solid var(--blue-bright); outline-offset: 1px; }
.oi-ms-list { max-height: 300px; overflow-y: auto; padding: 2px 0; }
.oi-ms label.oi-ms-opt {
  display: flex; align-items: center; gap: 9px; padding: 5px 12px; cursor: pointer; user-select: none;
  color: var(--text); font-size: 12.5px; text-transform: none; letter-spacing: normal;
}
.oi-ms .oi-ms-opt:hover, .oi-ms .oi-ms-opt.hi { background: var(--bg-hover); }
.oi-ms .oi-ms-opt input[type="checkbox"] {
  all: revert; flex: none; margin: 0; width: 12px; height: 12px; accent-color: var(--accent); cursor: pointer;
}
.oi-ms .oi-ms-opt input[type="checkbox"]:focus { outline: none; }
.oi-ms .oi-ms-opt input[type="checkbox"]:focus-visible { outline: 2px solid var(--blue-bright); outline-offset: 1px; }
.oi-ms-text { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.oi-ms-tag {   /* a selected value that is not among the options */
  flex: none; padding: 0 5px; border: 1px solid var(--line); border-radius: var(--r-1); line-height: 15px;
  color: var(--accent); font-size: 9px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; opacity: .85;
}
.oi-ms-remove { flex: none; padding: 0 2px; border: 0; background: none; color: var(--text-faint); font-size: 14px; line-height: 1; cursor: pointer; }
.oi-ms-remove:hover { color: var(--bad); }
.oi-ms-add {   /* "+ Add …": the typed value, Enter or click */
  display: flex; align-items: center; gap: 8px; width: 100%; padding: 6px 12px; text-align: left; cursor: pointer;
  border: 0; border-top: 1px dashed var(--line-soft); background: none; color: var(--accent); font-size: 12.5px;
}
.oi-ms-add:hover { background: var(--bg-hover); }
.oi-ms-add .oi-ms-add-icon { flex: none; width: 12px; font-weight: 700; font-size: 14px; line-height: 1; text-align: center; }
.oi-ms-add strong { font-family: var(--font-mono); font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.oi-ms-add .oi-ms-kbd {
  flex: none; margin-left: auto; padding: 0 6px; border: 1px solid var(--line); border-radius: var(--r-1);
  color: var(--text-faint); font-size: 10.5px; line-height: 16px;
}
.oi-ms-empty { padding: 8px 12px; color: var(--text-faint); font-size: 11.5px; font-style: italic; }

/* ── time picker (the time field of OI.ui.inputs) ──
   The client-error-tool's picker on these tokens. Selectors inside .oi-tp
   outrank the .oi-field input/label rules above. */
.oi-tp { position: relative; min-width: 180px; }
.oi-tp-trigger {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%;
  height: 30px; padding: 0 8px; border: 1px solid var(--line-strong); border-radius: var(--r-2);
  background: var(--bg-elev); cursor: pointer; text-align: left; white-space: nowrap; font-weight: 500;
}
.oi-tp-trigger:hover { border-color: var(--accent); }
.oi-tp-trigger:focus-visible { outline: 2px solid var(--blue-bright); outline-offset: -1px; }
.oi-tp-text { overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.oi-tp-caret { flex: none; color: var(--text-faint); font-size: 11px; }
.oi-tp-pop {
  position: absolute; top: calc(100% + 4px); left: 0; z-index: 5; /* as .oi-ms-pop: under the sticky toolbar */
  display: flex; width: 520px; max-width: calc(100vw - 16px); max-height: 380px; overflow: hidden;
  background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--r-2); box-shadow: var(--shadow-pop);
}
.oi-tp-pop[hidden] { display: none; }
.oi-tp-tabs {
  flex: none; display: flex; flex-direction: column; min-width: 130px; padding: 6px 0;
  background: var(--bg-inset); border-right: 1px solid var(--line);
}
.oi-tp-tab {
  padding: 8px 14px; border: 0; border-left: 2px solid transparent; background: transparent; text-align: left;
  color: var(--text-dim); font-size: 12px; font-weight: 500; cursor: pointer; white-space: nowrap;
}
.oi-tp-tab:hover { color: var(--text); background: var(--bg-hover); }
.oi-tp-tab[aria-selected="true"] { color: var(--text); background: var(--bg-card); border-left-color: var(--orange); }
.oi-tp-tab:focus-visible { outline: 2px solid var(--blue-bright); outline-offset: -2px; }
.oi-tp-body { flex: 1; min-width: 0; padding: 12px 14px; overflow-y: auto; }
.oi-tp-pane[hidden] { display: none; }
.oi-tp-presets { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 8px; }
.oi-tp-preset {
  padding: 6px 10px; border: 1px solid var(--line); border-radius: var(--r-2); background: transparent;
  color: var(--text); font-size: 12px; font-weight: 500; text-align: left; cursor: pointer;
}
.oi-tp-preset:hover { background: var(--bg-hover); border-color: var(--line-strong); }
.oi-tp-preset.selected { border-color: var(--accent); color: var(--accent); font-weight: 600; background: color-mix(in srgb, var(--accent) 9%, transparent); }
.oi-tp-preset:focus-visible, .oi-tp-apply:focus-visible { outline: 2px solid var(--blue-bright); outline-offset: 1px; }
.oi-tp-form { display: flex; flex-direction: column; gap: 10px; }
.oi-tp-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.oi-tp .oi-tp-row label { min-width: 60px; color: var(--text-faint); font-size: 10.5px; letter-spacing: .08em; }
.oi-tp .oi-tp-row input, .oi-tp .oi-tp-row select {
  height: 26px; min-width: 0; padding: 0 8px; font-size: 12px;
  border: 1px solid var(--line); border-radius: var(--r-2); background: var(--bg-card);
}
.oi-tp .oi-tp-row input[type="text"] { flex: 1; font-family: var(--font-mono); }
.oi-tp .oi-tp-row input.oi-tp-num { width: 70px; }
.oi-tp .oi-tp-row input:focus, .oi-tp .oi-tp-row select:focus { outline: 2px solid var(--blue-bright); outline-offset: -1px; }
.oi-tp-static { color: var(--text-dim); font-family: var(--font-mono); font-size: 12px; }
.oi-tp-preview {
  padding: 6px 8px; color: var(--text-faint); font-size: 11px; font-variant-numeric: tabular-nums;
  background: var(--bg-inset); border: 1px solid var(--line-soft); border-radius: var(--r-1);
}
.oi-tp-preview.bad { color: var(--bad); }
.oi-tp-preview code, .oi-tp-note code { padding: 0 2px; color: var(--text); font-size: 11px; }
.oi-tp-note { color: var(--text-faint); font-size: 11px; }
.oi-tp-err { margin-top: 8px; color: var(--bad); font-size: 11.5px; }
.oi-tp-err:empty { display: none; }
.oi-tp-actions { display: flex; justify-content: flex-end; }
.oi-tp-apply {
  height: 26px; padding: 0 14px; border: 1px solid var(--accent); border-radius: var(--r-2);
  background: var(--accent); color: var(--on-accent); font-size: 12px; font-weight: 600; cursor: pointer;
}
.oi-tp-apply:hover { background: var(--blue-bright); border-color: var(--blue-bright); }
@media (max-width: 560px) {   /* phones: the tabs become a scrolling row above the body */
  .oi-tp-pop { flex-direction: column; max-height: none; }
  .oi-tp-tabs { flex-direction: row; min-width: 0; padding: 0; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .oi-tp-tab { border-left: 0; border-bottom: 2px solid transparent; }
  .oi-tp-tab[aria-selected="true"] { border-bottom-color: var(--orange); }
}

/* ── panel frame (OI.ui.panel) ── */
.oi-panel {
  position: relative; /* containing block for .oi-panel-status, which is a sibling of the body */
  background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--r-3);
  box-shadow: var(--shadow-card); display: flex; flex-direction: column; min-height: 120px;
}
.oi-panel-head {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 10px 14px;
  border-bottom: 1px solid var(--line-soft);
}
.oi-panel-head h2 { margin: 0; flex: 1 1 auto; }
/* Actions are one unit: buttons keep their text on one line and the whole group
   moves to a second row, right-aligned, when the head is too narrow. */
.oi-panel-head .oi-actions { display: flex; align-items: center; gap: 6px; flex: none; margin-left: auto; }
.oi-panel-head .oi-actions .oi-btn { white-space: nowrap; }
.oi-panel-head .oi-meta { color: var(--text-faint); font-size: 11.5px; font-family: var(--font-mono); }
.oi-panel-body { position: relative; padding: 12px 14px; flex: 1 1 auto; min-height: 80px; }
.oi-panel-body.chart { flex: 1 1 auto; min-height: 300px; padding: 4px; } /* grows to the row's height; the ResizeObserver in OI.ui.chart re-lays out */
.oi-panel-status {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  text-align: center; padding: 16px; color: var(--text-dim); background: var(--bg-overlay);
  font-size: 13px;
}
.oi-panel-status.error { color: var(--bad); }
.oi-panel-status .oi-progress { display: block; margin-top: 6px; font-family: var(--font-mono); font-size: 11.5px; color: var(--text-faint); }
.oi-spinner {
  width: 16px; height: 16px; border: 2px solid var(--line-strong); border-top-color: var(--accent);
  border-radius: 50%; animation: oi-spin .8s linear infinite; margin-right: 8px; flex: none;
}
@keyframes oi-spin { to { transform: rotate(360deg); } }
.oi-panel-status .oi-status-line { position: relative; display: flex; align-items: center; } /* above the skeleton */
/* First-load placeholder (OI.ui.panel): the view's shape in muted blocks behind the
   status line. Bars from the baseline for a chart, rows for a table; a slow shimmer
   says "coming", none under prefers-reduced-motion. Gone with the status line. */
.oi-skeleton { position: absolute; inset: 14px; display: flex; gap: 8px; pointer-events: none; }
.oi-skeleton i { display: block; border-radius: 3px; background: var(--bg-inset);
  background-image: linear-gradient(90deg, var(--bg-inset) 0%, var(--line-strong) 50%, var(--bg-inset) 100%);
  background-size: 200% 100%; animation: oi-shimmer 1.8s linear infinite; }
.oi-skeleton.chart { align-items: flex-end; }
.oi-skeleton.chart i { flex: 1 1 0; }
.oi-skeleton.table { flex-direction: column; gap: 10px; }
.oi-skeleton.table i { height: 12px; }
.oi-skeleton.table i:first-child { height: 14px; }
@keyframes oi-shimmer { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .oi-skeleton i, .oi-spinner { animation: none; } }

/* ── panel help (OI.ui.panel {help}) ── */
.oi-panel.has-help .oi-panel-head h2 { flex: 0 1 auto; }
.oi-panel.has-help .oi-help-btn { margin-right: auto; }
/* head and note stay readable and clickable above the loading overlay */
.oi-panel.has-help .oi-panel-head, .oi-help { position: relative; z-index: 1; background: var(--bg-card); border-radius: var(--r-3) var(--r-3) 0 0; }
.oi-help-btn {
  flex: none; width: 18px; height: 18px; padding: 0; border-radius: 50%;
  border: 1px solid var(--line-strong); background: var(--bg-elev); color: var(--text-faint);
  font-size: 11px; font-weight: 600; line-height: 16px; text-align: center; cursor: pointer;
}
.oi-help-btn:hover { color: var(--accent); border-color: var(--accent); }
.oi-help-btn:focus-visible { outline: 2px solid var(--blue-bright); outline-offset: 1px; }
.oi-help-btn[aria-expanded="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.oi-help { border-radius: 0; padding: 8px 14px; background: var(--bg-inset); border-bottom: 1px solid var(--line-soft); color: var(--text-dim); font-size: 12.5px; }
.oi-help[hidden] { display: none; }

/* ── prose (OI.ui.text, OI.ui.markdown, help notes) ── */
.oi-md { line-height: 1.5; }
.oi-md > :first-child { margin-top: 0; }
.oi-md > :last-child { margin-bottom: 0; }
.oi-md p, .oi-md ul, .oi-md ol, .oi-md pre { margin: 0 0 8px; }
.oi-md ul, .oi-md ol { padding-left: 20px; }
.oi-md li + li { margin-top: 2px; }
.oi-md h3, .oi-md h4, .oi-md h5 { margin: 12px 0 6px; font-weight: 600; color: var(--text); }
.oi-md h3 { font-size: 14px; }
.oi-md h4 { font-size: 13px; }
.oi-md h5 { font-size: 12px; text-transform: uppercase; letter-spacing: .03em; color: var(--text-dim); }
.oi-md code { padding: 0 3px; border-radius: var(--r-1); background: var(--bg-inset); border: 1px solid var(--line-soft); }
.oi-md pre { padding: 8px 10px; background: var(--bg-inset); border: 1px solid var(--line-soft); border-radius: var(--r-2); overflow: auto; }
.oi-md pre code { padding: 0; border: 0; background: none; }
.oi-help code, .oi-help pre { background: var(--bg-card); }
.oi-text { min-height: 0; }
.oi-text .oi-panel-body { min-height: 0; max-width: 80ch; }

/* ── table (OI.ui.table) ── */
.oi-table-wrap { overflow: auto; max-height: 480px; }
table.oi-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.oi-table th, .oi-table td { padding: 6px 10px; text-align: left; border-bottom: 1px solid var(--line-soft); white-space: nowrap; }
.oi-table th {
  position: sticky; top: 0; background: var(--bg-inset); color: var(--text-dim);
  font-weight: 500; font-size: 11.5px; text-transform: uppercase; letter-spacing: .03em; cursor: pointer; user-select: none;
}
.oi-table th.sorted::after { content: " ▲"; font-size: 9px; }
.oi-table th.sorted.desc::after { content: " ▼"; }
.oi-table td.num, .oi-table th.num { text-align: right; font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.oi-table tbody tr:hover { background: var(--bg-hover); }
.oi-table-foot { display: flex; gap: 12px; align-items: center; padding: 8px 4px 0; color: var(--text-faint); font-size: 11.5px; }
.oi-table-foot button { border: 1px solid var(--line); background: var(--bg-elev); border-radius: var(--r-2); padding: 2px 8px; cursor: pointer; }
.oi-table-foot button:disabled { opacity: .4; cursor: default; }

/* ── stat tile (OI.ui.stat) ── */
.oi-stat { display: flex; flex-direction: column; gap: 2px; }
.oi-stat .oi-stat-value { font-size: 28px; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.1; }
.oi-stat .oi-stat-label { color: var(--text-dim); font-size: 12px; }

/* ── collapsible section (OI.ui.section) ── */
details.oi-section { display: grid; gap: 16px; }
details.oi-section > summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; user-select: none;
  color: var(--text-dim); padding: 2px 0; margin-bottom: -8px;
}
details.oi-section > summary::-webkit-details-marker { display: none; }
details.oi-section > summary h2 { margin: 0; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-dim); }
details.oi-section > summary:hover h2 { color: var(--text); }
details.oi-section > summary .oi-chevron { display: inline-block; font-size: 18px; line-height: 1; transition: transform .15s; }
details.oi-section[open] > summary .oi-chevron { transform: rotate(90deg); }
details.oi-section[open] > summary { margin-bottom: 0; }

/* ── share box (OI.ui.shareBox) ── */
.oi-share {
  border: 1px solid var(--line); border-radius: var(--r-3); box-shadow: var(--shadow-pop);
  padding: 18px 20px; width: min(680px, 92vw); background: var(--bg-card); color: var(--text); font: inherit;
}
.oi-share::backdrop { background: rgba(20, 30, 40, .35); }
.oi-share h2 { margin-bottom: 4px; }
.oi-share .oi-sub { color: var(--text-dim); font-size: 12.5px; margin: 0; }
.oi-share input { width: 100%; margin: 12px 0; height: 32px; padding: 0 8px; border: 1px solid var(--line-strong); border-radius: var(--r-2); background: var(--bg-inset); }
.oi-share-actions { display: flex; gap: 8px; align-items: center; justify-content: flex-end; }
.oi-share-status { margin-right: auto; color: var(--text-dim); font-size: 12.5px; }

/* ── source dialog (OI.ui.source): the search behind a result, internal users ── */
.oi-source { width: min(920px, 94vw); max-height: 90vh; overflow: auto; }
.oi-source-sec { margin: 12px 0 0; padding-top: 10px; border-top: 1px solid var(--line-soft); }
.oi-source-sec h3 { margin: 0 0 6px; font-size: 13px; font-weight: 600; }
.oi-source pre { margin: 4px 0 8px; padding: 8px 10px; font-family: var(--font-mono); font-size: 12px; white-space: pre-wrap; overflow: auto; background: var(--bg-inset); border: 1px solid var(--line-soft); border-radius: var(--r-2); }
.oi-source .oi-kv { margin: 2px 0; color: var(--text-dim); font-size: 12.5px; }
.oi-source .oi-warn { margin: 2px 0 6px; color: var(--warn); font-size: 12.5px; }
.oi-source-links { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 4px 0 8px; }
.oi-source-links a.oi-btn { text-decoration: none; display: inline-flex; align-items: center; }

/* ── messages ── */
.oi-notice {
  max-width: 560px; margin: 80px auto; padding: 24px 28px; background: var(--bg-card);
  border: 1px solid var(--line); border-radius: var(--r-3); box-shadow: var(--shadow-card);
}
.oi-notice h1 { margin-bottom: 8px; }
.oi-notice p { color: var(--text-dim); margin: 6px 0; }
.oi-badge { display: inline-block; padding: 1px 6px; border-radius: var(--r-2); font-size: 11px; font-weight: 500; background: var(--bg-inset); border: 1px solid var(--line); color: var(--text-dim); }
.oi-badge.dev { border-color: var(--orange); color: var(--orange-text); }
