/* OBSCURIQ — OSINT case desk workspace. All rules are scoped under .oq-app (the mount's child) or
   .uwapp-root.uwapp-obscuriq, never the bare .uwapp-obscuriq class (it is on <body> too). Deep teal + night blue;
   light and dark themes via [data-theme] on .oq-app (follows uw_theme / html[data-theme] unless the user picks one). */
.uwapp-root.uwapp-obscuriq { background: #f2f5f4; }
.uwapp-root.uwapp-obscuriq:has(.oq-app[data-theme='dark']) { background: #0c1417; }
.oq-app {
  --oq-accent: #176a64;
  --oq-accent-hover: #10514c;
  --oq-accent-soft: #e1f0ed;
  --oq-accent-text: #11564f;
  --oq-on-accent: #ffffff;
  --oq-bg: #f2f5f4;
  --oq-panel: #ffffff;
  --oq-panel-2: #f5f8f7;
  --oq-ink: #10212a;
  --oq-muted: #4f6169;
  --oq-line: #d6e0de;
  --oq-line-2: #bccac7;
  --oq-control: #6c807d;
  --oq-focus: #b45309;
  --oq-k-source: #0f5a52; --oq-k-source-bg: #def2ee;
  --oq-k-indicator: #7a4a00; --oq-k-indicator-bg: #fdf0d9;
  --oq-k-note: #5b3d9a; --oq-k-note-bg: #ede8fa;
  --oq-k-pivot: #1d4f91; --oq-k-pivot-bg: #e2ecfb;
  --oq-k-file: #3d4b55; --oq-k-file-bg: #e8edf0;
  --oq-good: #13652f; --oq-good-bg: #dff3e5;
  --oq-warn: #8a3b00; --oq-warn-bg: #fde8d4;
  --oq-bad: #a1261b; --oq-bad-bg: #fde4e1;
  --oq-plain-bg: #eef2f2;
  --oq-shadow: 0 10px 30px rgba(16, 33, 42, .14);
  --oq-radius: 12px;
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  grid-template-columns: minmax(0, 1fr);
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  background: var(--oq-bg);
  color: var(--oq-ink);
  font: 14px/1.5 system-ui, -apple-system, 'Segoe UI', Roboto, 'Noto Sans', 'Noto Sans Arabic', sans-serif;
}
.oq-app[data-theme='dark'] {
  --oq-accent: #4fd1bf;
  --oq-accent-hover: #86e3d6;
  --oq-accent-soft: #143633;
  --oq-accent-text: #7ee0d2;
  --oq-on-accent: #05211d;
  --oq-bg: #0c1417;
  --oq-panel: #121e22;
  --oq-panel-2: #18272c;
  --oq-ink: #e3eeec;
  --oq-muted: #a4b7b4;
  --oq-line: #26383d;
  --oq-line-2: #3a5157;
  --oq-control: #7e9894;
  --oq-focus: #fbbf24;
  --oq-k-source: #7ee0d2; --oq-k-source-bg: #133431;
  --oq-k-indicator: #f6c66b; --oq-k-indicator-bg: #3a2a0c;
  --oq-k-note: #c9b5ff; --oq-k-note-bg: #2a2145;
  --oq-k-pivot: #9cc3ff; --oq-k-pivot-bg: #142a48;
  --oq-k-file: #c3d0d6; --oq-k-file-bg: #24323a;
  --oq-good: #8ce0a6; --oq-good-bg: #12301e;
  --oq-warn: #ffb877; --oq-warn-bg: #3b2412;
  --oq-bad: #ffa69c; --oq-bad-bg: #3d1714;
  --oq-plain-bg: #1f2e33;
  --oq-shadow: 0 10px 30px rgba(0, 0, 0, .5);
  color-scheme: dark;
}

/* resets against platform element styles (zero specificity on the scope, so .oq-* classes win) */
:where(.oq-app) button, :where(.oq-print-root) button { font: inherit; font-size: inherit; font-weight: inherit; width: auto; min-height: 0; padding: 0; margin: 0; border: 0; border-radius: 0; background: none; color: inherit; cursor: pointer; text-align: start; }
:where(.oq-app) button:hover { background: none; }
:where(.oq-app) input, :where(.oq-app) select, :where(.oq-app) textarea { font: inherit; color: inherit; }
:where(.oq-app) h1, :where(.oq-app) h2, :where(.oq-app) h3, :where(.oq-app) h4 { margin: 0; letter-spacing: 0; }
:where(.oq-app) p, :where(.oq-app) figure { margin: 0; }
:where(.oq-app) ul, :where(.oq-app) ol { margin: 0; }
:where(.oq-app) code, :where(.oq-app) kbd, :where(.oq-app) pre { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: none; color: inherit; }
:where(.oq-app) table { border-collapse: collapse; }
:where(.oq-app) th, :where(.oq-app) td { background: none; color: inherit; }
.oq-app [hidden] { display: none !important; }
.oq-app a { color: var(--oq-accent-text); text-underline-offset: 2px; }
.oq-app a:hover { color: var(--oq-accent-hover); }
.oq-app :focus-visible { outline: 3px solid var(--oq-focus); outline-offset: 2px; }
.oq-app .oq-input:focus-visible { outline-offset: 0; }
.oq-sr { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.oq-ico { flex: none; }
.oq-muted { color: var(--oq-muted); }
.oq-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; }
.oq-hash { overflow-wrap: anywhere; word-break: break-all; }

/* ---------------------------------------------------------------- toolbar */
.oq-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; padding: 6px 10px; background: var(--oq-panel); border-bottom: 1px solid var(--oq-line); }
.oq-toolbar-start, .oq-toolbar-end { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; }
.oq-toolbar-start { flex: 1 1 420px; }
.oq-menus { display: flex; flex-wrap: wrap; gap: 2px; }
.oq-menubtn { display: inline-flex; align-items: center; gap: 4px; min-height: 34px; min-width: 24px; padding: 4px 9px; border-radius: 8px; font-weight: 600; }
.oq-menubtn:hover, .oq-menubtn[aria-expanded='true'] { background: var(--oq-accent-soft); color: var(--oq-accent-text); }
.oq-projname { flex: 1 1 200px; max-width: 360px; min-width: 150px; font-weight: 600; }
.oq-menu-all { display: none; border: 1px solid var(--oq-line-2); }

/* ---------------------------------------------------------------- buttons & inputs */
.oq-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 36px; padding: 6px 14px; border: 1px solid var(--oq-line-2); border-radius: 9px; background: var(--oq-panel); color: var(--oq-ink); font-weight: 600; line-height: 1.2; text-align: center; }
.oq-btn:hover { border-color: var(--oq-accent); color: var(--oq-accent-text); background: var(--oq-panel); }
.oq-btn:disabled, .oq-ibtn:disabled { opacity: .55; cursor: not-allowed; }
.oq-btn-primary { background: var(--oq-accent); border-color: var(--oq-accent); color: var(--oq-on-accent); }
.oq-btn-primary:hover { background: var(--oq-accent-hover); border-color: var(--oq-accent-hover); color: var(--oq-on-accent); }
.oq-btn-secondary { border-color: var(--oq-accent); color: var(--oq-accent-text); }
.oq-btn-danger { background: var(--oq-bad); border-color: var(--oq-bad); color: var(--oq-panel); }
.oq-btn-danger:hover { background: var(--oq-bad); color: var(--oq-panel); filter: brightness(1.08); }
.oq-btn-quiet { border-color: transparent; background: transparent; color: var(--oq-accent-text); }
.oq-btn-quiet:hover { background: var(--oq-accent-soft); border-color: transparent; }
.oq-btn-link { min-height: 24px; padding: 0 2px; border: 0; background: none; color: var(--oq-accent-text); text-decoration: underline; text-underline-offset: 2px; }
.oq-ibtn { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; color: var(--oq-ink); flex: none; }
.oq-ibtn:hover { background: var(--oq-accent-soft); color: var(--oq-accent-text); }
.oq-ibtn[aria-pressed='true'] { background: var(--oq-accent-soft); color: var(--oq-accent-text); }
.oq-input { width: 100%; min-width: 0; min-height: 36px; padding: 6px 9px; border: 1px solid var(--oq-control); border-radius: 8px; background: var(--oq-panel); color: var(--oq-ink); }
textarea.oq-input { resize: vertical; line-height: 1.45; }
.oq-input[aria-invalid='true'] { border-color: var(--oq-bad); box-shadow: 0 0 0 1px var(--oq-bad); }
.oq-input[type='date'] { max-width: 14rem; }
.oq-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.oq-row > .oq-field { flex: 1 1 180px; }
.oq-field > label { font-weight: 600; font-size: 13px; }
.oq-help { color: var(--oq-muted); font-size: 12.5px; }
.oq-help .oq-ico { vertical-align: -2px; margin-inline-end: 4px; }
.oq-privacy { color: var(--oq-ink); }
.oq-row { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: flex-start; }
.oq-row-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.oq-check { display: inline-flex; align-items: center; gap: 8px; min-height: 28px; cursor: pointer; }
.oq-check input { width: 18px; height: 18px; accent-color: var(--oq-accent); flex: none; margin: 0; }
.oq-fieldset { border: 1px solid var(--oq-line); border-radius: 10px; padding: 8px 12px 10px; margin: 0; min-width: 0; }
.oq-fieldset legend { font-weight: 600; font-size: 13px; padding: 0 4px; }
.oq-error-text { color: var(--oq-bad); font-weight: 600; }
.oq-callout { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 8px 12px; border-radius: 10px; background: var(--oq-accent-soft); color: var(--oq-ink); border-inline-start: 3px solid var(--oq-accent); }
.oq-callout-warn { background: var(--oq-warn-bg); border-inline-start-color: var(--oq-warn); }
.oq-callout ul { margin: 4px 0 0; padding-inline-start: 18px; width: 100%; }

/* ---------------------------------------------------------------- body layout */
.oq-body { display: grid; grid-template-columns: minmax(220px, 270px) minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); min-height: 0; }
.oq-side { position: relative; display: flex; flex-direction: column; gap: 8px; min-height: 0; padding: 10px; background: var(--oq-panel); border-inline-end: 1px solid var(--oq-line); overflow: auto; }
.oq-side-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 2px 4px; }
.oq-side-head h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--oq-muted); }
.oq-cases { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.oq-caseitem { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; column-gap: 8px; width: 100%; min-height: 44px; padding: 7px 9px; border-radius: 9px; color: var(--oq-ink); }
.oq-caseitem:hover { background: var(--oq-panel-2); }
.oq-caseitem[aria-current='true'] { background: var(--oq-accent-soft); box-shadow: inset 3px 0 0 var(--oq-accent); }
[dir='rtl'] .oq-caseitem[aria-current='true'] { box-shadow: inset -3px 0 0 var(--oq-accent); }
.oq-casename { font-weight: 600; overflow-wrap: anywhere; }
.oq-casemeta { grid-column: 2; color: var(--oq-muted); font-size: 12px; }
.oq-caseitem[aria-current='true'] .oq-casemeta { color: var(--oq-ink); }
.oq-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--oq-accent); }
.oq-dot-paused { background: var(--oq-warn); }
.oq-dot-closed { background: var(--oq-control); }
.oq-side-note { display: flex; gap: 6px; margin-top: auto; padding: 10px; border-radius: 10px; background: var(--oq-panel-2); color: var(--oq-muted); font-size: 12px; }
.oq-side-note .oq-ico { margin-top: 2px; color: var(--oq-accent-text); }

.oq-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.oq-casehead { padding: 12px 18px 8px; background: var(--oq-panel); border-bottom: 1px solid var(--oq-line); display: flex; flex-direction: column; gap: 6px; }
.oq-casehead-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; }
.oq-casetitle { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 20px; line-height: 1.25; overflow-wrap: anywhere; }
.oq-status-pill { display: inline-flex; align-items: center; min-height: 22px; padding: 1px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--oq-accent-soft); color: var(--oq-accent-text); }
.oq-pill-paused { background: var(--oq-warn-bg); color: var(--oq-warn); }
.oq-pill-closed { background: var(--oq-plain-bg); color: var(--oq-muted); }
.oq-brief { max-width: 80ch; color: var(--oq-ink); display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.oq-chips { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.oq-chips li { padding: 2px 9px; border-radius: 999px; background: var(--oq-panel-2); border: 1px solid var(--oq-line); font-size: 12.5px; }
.oq-chips .oq-chip-warn { background: var(--oq-warn-bg); color: var(--oq-warn); border-color: transparent; font-weight: 600; }
.oq-chips .oq-chip-muted { color: var(--oq-muted); border-style: dashed; }
.oq-tabrow { display: flex; align-items: center; gap: 6px; padding: 0 12px; background: var(--oq-panel); border-bottom: 1px solid var(--oq-line); }
.oq-listtoggle { display: none; align-items: center; gap: 6px; min-height: 36px; padding: 4px 10px; border: 1px solid var(--oq-line-2); border-radius: 8px; font-weight: 600; flex: none; }
.oq-tabs { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: thin; min-width: 0; }
.oq-tab { display: inline-flex; align-items: center; gap: 6px; min-height: 42px; padding: 8px 12px; border-bottom: 3px solid transparent; color: var(--oq-muted); font-weight: 600; white-space: nowrap; }
.oq-tab:hover { color: var(--oq-ink); }
.oq-tab[aria-selected='true'] { color: var(--oq-accent-text); border-bottom-color: var(--oq-accent); }
.oq-hint { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 10px 18px 0; padding: 8px 12px; border-radius: 10px; background: var(--oq-accent-soft); color: var(--oq-ink); }
.oq-hint > span { flex: 1 1 260px; }
.oq-panel { position: relative; flex: 1 1 auto; min-height: 0; overflow: auto; padding: 16px 18px 28px; display: flex; flex-direction: column; gap: 14px; outline: none; }
.oq-panel > :not(.oq-sr) { max-width: 1180px; width: 100%; }
.oq-panel-title { font-size: 17px; }
.oq-lede { color: var(--oq-muted); max-width: 75ch; margin-top: -8px; }

/* ---------------------------------------------------------------- status bar */
.oq-status { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; padding: 5px 12px; background: var(--oq-panel); border-top: 1px solid var(--oq-line); font-size: 12.5px; color: var(--oq-muted); }
.oq-status-msg { color: var(--oq-ink); min-height: 1.4em; }
.oq-status-good { color: var(--oq-good); }
.oq-status-error { color: var(--oq-bad); font-weight: 600; }

/* ---------------------------------------------------------------- research log */
.oq-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.oq-filters .oq-input { width: auto; max-width: 100%; }
.oq-search { position: relative; flex: 1 1 240px; display: flex; align-items: center; }
.oq-search .oq-ico { position: absolute; inset-inline-start: 9px; color: var(--oq-muted); pointer-events: none; }
.oq-search .oq-input { width: 100%; padding-inline-start: 32px; }
.oq-pinfilter { padding: 0 4px; }
.oq-count { color: var(--oq-muted); font-size: 13px; }
.oq-log { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.oq-entry > article { position: relative; padding: 12px 14px 10px; border: 1px solid var(--oq-line); border-inline-start: 4px solid var(--oq-k-source); border-radius: var(--oq-radius); background: var(--oq-panel); display: flex; flex-direction: column; gap: 6px; }
.oq-entry-indicator > article { border-inline-start-color: var(--oq-k-indicator); }
.oq-entry-note > article { border-inline-start-color: var(--oq-k-note); }
.oq-entry-pivot > article { border-inline-start-color: var(--oq-k-pivot); }
.oq-entry-file > article { border-inline-start-color: var(--oq-k-file); }
.oq-pinned > article { box-shadow: 0 0 0 1px var(--oq-accent) inset; }
.oq-entry-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding-inline-end: 160px; }
.oq-entry-title { font-size: 15px; line-height: 1.3; overflow-wrap: anywhere; flex: 1 1 200px; }
.oq-time { color: var(--oq-muted); font-size: 12.5px; }
.oq-kind { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--oq-k-source-bg); color: var(--oq-k-source); }
.oq-kind-indicator { background: var(--oq-k-indicator-bg); color: var(--oq-k-indicator); }
.oq-kind-note { background: var(--oq-k-note-bg); color: var(--oq-k-note); }
.oq-kind-pivot { background: var(--oq-k-pivot-bg); color: var(--oq-k-pivot); }
.oq-kind-file { background: var(--oq-k-file-bg); color: var(--oq-k-file); }
.oq-value { white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word; }
.oq-value-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; }
.oq-context { white-space: pre-wrap; overflow-wrap: anywhere; color: var(--oq-ink); }
.oq-meta { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.oq-meta li { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 6px; font-size: 12px; background: var(--oq-plain-bg); color: var(--oq-ink); }
.oq-meta .oq-tag { padding: 0; background: none; }
.oq-tagbtn { display: inline-flex; align-items: center; min-height: 24px; padding: 1px 8px; border-radius: 6px; background: var(--oq-accent-soft); color: var(--oq-accent-text); font-weight: 600; font-size: 12px; }
.oq-tagbtn:hover { text-decoration: underline; }
.oq-review { font-weight: 600; }
.oq-app .oq-review-reviewed { background: var(--oq-good-bg); color: var(--oq-good); }
.oq-app .oq-review-follow-up { background: var(--oq-warn-bg); color: var(--oq-warn); }
.oq-app .oq-review-unreviewed { background: var(--oq-plain-bg); color: var(--oq-muted); }
.oq-app .oq-rel-high { color: var(--oq-good); }
.oq-app .oq-rel-medium { color: var(--oq-k-indicator); }
.oq-app .oq-rel-low { color: var(--oq-bad); }
.oq-app .oq-rel-unrated { color: var(--oq-muted); }
.oq-entry-actions { position: absolute; inset-block-start: 6px; inset-inline-end: 6px; display: flex; gap: 2px; }
.oq-more { display: inline-flex; align-items: center; justify-content: center; gap: 2px; min-width: 34px; min-height: 34px; padding: 4px 6px; border-radius: 8px; }
.oq-more:hover, .oq-more[aria-expanded='true'] { background: var(--oq-accent-soft); color: var(--oq-accent-text); }
.oq-ext { display: inline-flex; align-items: center; gap: 4px; min-height: 24px; overflow-wrap: anywhere; word-break: break-word; }
.oq-ext .oq-ico { opacity: .8; }
.oq-value-link { display: inline; }
.oq-empty { padding: 26px 20px; border: 1px dashed var(--oq-line-2); border-radius: var(--oq-radius); background: var(--oq-panel); text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; margin-top: 6px; }
.oq-empty-title { font-weight: 700; font-size: 15px; }
.oq-empty p { max-width: 60ch; }
.oq-empty-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 4px; }

/* ---------------------------------------------------------------- menus */
.oq-menu { z-index: 1000; min-width: 220px; max-height: min(70vh, 520px); overflow: auto; padding: 6px; border: 1px solid var(--oq-line-2); border-radius: 10px; background: var(--oq-panel); color: var(--oq-ink); box-shadow: var(--oq-shadow); }
.oq-menu-item { display: flex; align-items: center; justify-content: space-between; gap: 16px; width: 100%; min-height: 34px; padding: 6px 10px; border-radius: 7px; text-align: start; }
.oq-menu-item:hover, .oq-menu-item:focus { background: var(--oq-accent-soft); color: var(--oq-accent-text); }
.oq-menu-item:disabled { opacity: .5; cursor: not-allowed; }
.oq-menu-item[aria-checked='true'] > span:first-child::before { content: '✓ '; }
.oq-menu-hint { color: var(--oq-muted); font-size: 12px; }
.oq-menu-sep { height: 1px; margin: 5px 4px; background: var(--oq-line); }
.oq-menu-heading { padding: 4px 10px 2px; color: var(--oq-muted); font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }

/* ---------------------------------------------------------------- dialogs */
.oq-dialog { width: min(560px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); padding: 0; border: 1px solid var(--oq-line-2); border-radius: 14px; background: var(--oq-panel); color: var(--oq-ink); box-shadow: var(--oq-shadow); }
.oq-dialog-wide { width: min(760px, calc(100vw - 24px)); }
.oq-dialog-narrow { width: min(440px, calc(100vw - 24px)); }
.oq-dialog::backdrop { background: rgba(8, 18, 22, .55); }
.oq-dialog-head { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; background: var(--oq-panel); border-bottom: 1px solid var(--oq-line); }
.oq-dialog-head h2 { font-size: 16px; }
.oq-dialog-body { padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.oq-dialog-body h3 { font-size: 14px; margin-top: 4px; }
.oq-dialog-body ul { padding-inline-start: 20px; display: flex; flex-direction: column; gap: 4px; }
.oq-dialog-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 4px; }
.oq-templates, .oq-recent { list-style: none; padding: 0 !important; display: grid; gap: 8px; }
.oq-templates { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.oq-template { display: flex; flex-direction: column; gap: 4px; width: 100%; height: 100%; padding: 12px; border: 1px solid var(--oq-line); border-radius: 10px; background: var(--oq-panel-2); text-align: start; }
.oq-template:hover { border-color: var(--oq-accent); }
.oq-template span { color: var(--oq-muted); font-size: 13px; }
.oq-recent li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.oq-recent li > .oq-btn { flex: 1 1 200px; justify-content: flex-start; text-align: start; }
.oq-import-results { max-height: 40vh; overflow: auto; }
.oq-imp-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 2px 10px; padding: 3px 0; border-bottom: 1px solid var(--oq-line); }
.oq-imp-row code { overflow-wrap: anywhere; word-break: break-all; }
.oq-table { width: 100%; font-size: 13px; }
.oq-table caption { text-align: start; font-weight: 600; padding: 4px 0; }
.oq-table th, .oq-table td { padding: 6px 8px; border-bottom: 1px solid var(--oq-line); text-align: start; vertical-align: top; }
.oq-table thead th { background: var(--oq-panel-2); font-weight: 700; }
.oq-table td { overflow-wrap: anywhere; }
.oq-num { text-align: end !important; font-variant-numeric: tabular-nums; }
.oq-tablewrap { overflow: auto; max-width: 100%; border: 1px solid var(--oq-line); border-radius: 10px; }
.oq-app kbd { display: inline-block; padding: 1px 6px; border: 1px solid var(--oq-line-2); border-bottom-width: 2px; border-radius: 5px; font-size: 12px; background: var(--oq-panel-2); }

/* ---------------------------------------------------------------- toasts */
.oq-toasts { position: fixed; inset-block-end: 44px; inset-inline-end: 14px; z-index: 2000; display: flex; flex-direction: column; gap: 6px; max-width: min(420px, calc(100vw - 28px)); }
.oq-toast { display: flex; gap: 8px; align-items: flex-start; padding: 9px 12px; border-radius: 10px; background: var(--oq-ink); color: var(--oq-panel); box-shadow: var(--oq-shadow); }
.oq-toast-error { background: var(--oq-bad); color: #fff; }
.oq-app[data-theme='dark'] .oq-toast-error { color: #2a0703; }

/* ---------------------------------------------------------------- desks */
.oq-card { padding: 14px 16px; border: 1px solid var(--oq-line); border-radius: var(--oq-radius); background: var(--oq-panel); display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.oq-card-title { font-size: 15px; }
.oq-desk-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); gap: 14px; align-items: start; }
.oq-pivot-input { font-size: 14px; min-height: 42px; }
.oq-pivot-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 10px 16px; }
.oq-pivot-group h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--oq-muted); margin-bottom: 4px; }
.oq-linklist { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.oq-lookups { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.oq-lookup { padding-bottom: 12px; border-bottom: 1px solid var(--oq-line); display: flex; flex-direction: column; gap: 6px; }
.oq-lookup:last-child { border-bottom: 0; padding-bottom: 0; }
.oq-lookup-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 10px; }
.oq-result { display: flex; flex-direction: column; gap: 8px; padding: 10px; border-radius: 10px; background: var(--oq-panel-2); border: 1px solid var(--oq-line); }
.oq-result-summary { font-weight: 600; }
.oq-result-actions { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; }
.oq-metrics { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px 12px; margin: 0; }
.oq-metrics dt { color: var(--oq-muted); font-size: 12px; }
.oq-metrics dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.oq-busy { display: flex; align-items: center; gap: 8px; color: var(--oq-muted); }
.oq-spinner { width: 16px; height: 16px; border: 2px solid var(--oq-line-2); border-top-color: var(--oq-accent); border-radius: 50%; flex: none; }
@media (prefers-reduced-motion: no-preference) { .oq-spinner { animation: oq-spin .8s linear infinite; } }
@keyframes oq-spin { to { transform: rotate(360deg); } }
.oq-qlist { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.oq-qlist li { display: flex; flex-direction: column; gap: 2px; padding: 8px; border-radius: 8px; background: var(--oq-panel-2); }
.oq-qpurpose { font-size: 12px; color: var(--oq-muted); font-weight: 600; }
.oq-qlist code { overflow-wrap: anywhere; }
.oq-qlinks { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.oq-cleaned { padding: 8px; border-radius: 8px; background: var(--oq-panel-2); overflow-wrap: anywhere; word-break: break-all; }
.oq-removed { padding-inline-start: 18px; }
.oq-indlist { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.oq-indlist li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 10px; padding: 4px 0; border-bottom: 1px solid var(--oq-line); }
.oq-indlist code { overflow-wrap: anywhere; word-break: break-all; }
.oq-dropzone { display: flex; gap: 12px; align-items: center; padding: 14px; border: 2px dashed var(--oq-line-2); border-radius: var(--oq-radius); background: var(--oq-panel); }
.oq-dropzone > .oq-ico { color: var(--oq-accent-text); }
.oq-dropzone .oq-field { flex: 1; }
.oq-file { max-width: 100%; min-height: 36px; }
.oq-drop .oq-panel { outline: 3px dashed var(--oq-accent); outline-offset: -8px; }
.oq-files { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 14px; }
.oq-filename { overflow-wrap: anywhere; }
.oq-dl { display: grid; grid-template-columns: minmax(8rem, max-content) minmax(0, 1fr); gap: 4px 12px; margin: 0; }
.oq-dl dt { color: var(--oq-muted); font-size: 12.5px; }
.oq-dl dd { margin: 0; overflow-wrap: anywhere; }
.oq-verdict { font-weight: 700; }
.oq-verdict.oq-good { color: var(--oq-good); }
.oq-verdict.oq-bad { color: var(--oq-bad); }
.oq-srv > summary { cursor: pointer; font-weight: 600; color: var(--oq-accent-text); min-height: 28px; display: flex; align-items: center; }
.oq-srv[open] > summary { margin-bottom: 8px; }
.oq-srv > * + * { margin-top: 8px; }

/* ---------------------------------------------------------------- timeline */
.oq-panel > .oq-tl-figure { width: fit-content; min-width: min(100%, 360px); }
.oq-tl-figure { padding: 10px 12px; border: 1px solid var(--oq-line); border-radius: var(--oq-radius); background: var(--oq-panel); }
.oq-tl-scroll { min-width: 0; }
.oq-tl-chart { display: block; max-width: 100%; height: auto; }
.oq-tl-chart .oq-bar { fill: var(--oq-accent); }
.oq-tl-chart .oq-bar-empty { fill: var(--oq-line-2); }
.oq-tl-chart .oq-axis { stroke: var(--oq-line-2); stroke-width: 1; }
.oq-tl-figure figcaption { display: flex; justify-content: space-between; font-size: 12px; margin-top: 4px; }
.oq-tl { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 16px; }
.oq-tl-month h3 { font-size: 14px; margin-bottom: 6px; color: var(--oq-accent-text); }
.oq-tl-items { list-style: none; padding: 0; padding-inline-start: 14px; border-inline-start: 2px solid var(--oq-line-2); display: flex; flex-direction: column; gap: 6px; }
.oq-tl-item { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 6px 10px; border-radius: 10px; background: var(--oq-panel); border: 1px solid var(--oq-line); }
.oq-tl-item::before { content: ''; position: absolute; inset-inline-start: -21px; top: 14px; width: 10px; height: 10px; border-radius: 50%; background: var(--oq-panel); border: 2px solid var(--oq-accent); }
.oq-tl-date { font-variant-numeric: tabular-nums; color: var(--oq-muted); font-size: 12.5px; min-width: 7.5em; }
.oq-tl-title { display: inline-flex; align-items: center; gap: 4px; min-height: 28px; font-weight: 600; text-align: start; overflow-wrap: anywhere; flex: 1 1 200px; }
.oq-tl-title:hover { color: var(--oq-accent-text); text-decoration: underline; }
.oq-tl-item .oq-review { padding: 1px 8px; border-radius: 6px; font-size: 12px; }

/* ---------------------------------------------------------------- report */
.oq-report-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.oq-report-bar .oq-panel-title { flex: 1 1 100%; }
.oq-report-bar .oq-input { width: auto; }
.oq-report { padding: 18px 20px; border: 1px solid var(--oq-line); border-radius: var(--oq-radius); background: var(--oq-panel); display: flex; flex-direction: column; gap: 12px; }
.oq-report-head { display: flex; flex-direction: column; gap: 6px; }
.oq-report-brand { font-weight: 800; letter-spacing: .14em; font-size: 12px; color: var(--oq-accent-text); }
.oq-report h2 { font-size: 20px; }
.oq-report h3 { font-size: 16px; margin-top: 8px; }
.oq-report h4 { font-size: 14px; margin-top: 6px; }
.oq-report-case { display: flex; flex-direction: column; gap: 8px; }
.oq-report-pins { padding-inline-start: 20px; }
.oq-report-foot { font-size: 12.5px; border-top: 1px solid var(--oq-line); padding-top: 8px; }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 860px) {
  .oq-body { grid-template-columns: minmax(0, 1fr); position: relative; }
  .oq-listtoggle { display: inline-flex; }
  .oq-side { position: absolute; inset-block: 0; inset-inline-start: 0; z-index: 30; width: min(320px, 88vw); box-shadow: var(--oq-shadow); visibility: hidden; transform: translateX(-102%); }
  [dir='rtl'] .oq-side { transform: translateX(102%); }
  .oq-list-open .oq-side { visibility: visible; transform: none; }
  .oq-casehead { padding: 10px 12px 6px; }
  .oq-panel { padding: 12px 12px 24px; }
  .oq-hint { margin: 8px 12px 0; }
  .oq-tabrow { padding: 0 8px; }
}
@media (prefers-reduced-motion: no-preference) { .oq-side { transition: transform .18s ease, visibility .18s; } }
@media (max-width: 560px) {
  .oq-toolbar { padding: 4px 6px; flex-wrap: nowrap; }
  .oq-toolbar-start { flex: 1 1 auto; }
  .oq-projname { display: none; }
  .oq-toolbar-end .oq-ibtn { display: none; }
  .oq-menus { display: none; }
  .oq-menu-all { display: inline-flex; }
  .oq-addentry span { display: none; }
  .oq-addentry { padding: 6px 10px; }
  .oq-brief, .oq-chips { display: none; }
  .oq-casehead-top { flex-wrap: nowrap; }
  .oq-casehead-top .oq-btn span { display: none; }
  .oq-status-right { display: none; }
  .oq-tab { padding: 8px 9px; }
  .oq-tab span { font-size: 13px; }
  .oq-entry-head { padding-inline-end: 0; padding-top: 34px; }
  .oq-casetitle { font-size: 17px; }
  .oq-filters > select, .oq-filters .oq-input { flex: 1 1 140px; }
  .oq-dl { grid-template-columns: minmax(0, 1fr); }
  .oq-dl dd { margin-bottom: 4px; }
  .oq-dropzone { flex-direction: column; align-items: stretch; }
  .oq-tl-date { min-width: 0; }
}

/* ---------------------------------------------------------------- print */
.oq-print-root { display: none; }
@media print {
  html.oq-printing, html.oq-printing body { display: block !important; height: auto !important; min-height: 0 !important; overflow: visible !important; background: #fff !important; }
  html.oq-printing body > :not(.oq-print-root) { display: none !important; }
  html.oq-printing .oq-print-root { display: block; padding: 0 6px; color: #111; background: #fff; font: 12px/1.45 system-ui, sans-serif; --oq-ink: #111; --oq-muted: #444; --oq-line: #bbb; --oq-panel: #fff; --oq-panel-2: #f4f4f4; --oq-accent-text: #0d4f49; --oq-accent-soft: #eef6f4; --oq-accent: #176a64; }
  .oq-print-root .oq-report { border: 0; padding: 0; display: block; }
  .oq-print-root .oq-report > * + * { margin-top: 10px; }
  .oq-print-root h2 { font-size: 18px; margin: 0 0 4px; }
  .oq-print-root h3 { font-size: 15px; margin: 14px 0 6px; }
  .oq-print-root h4 { font-size: 13px; margin: 10px 0 4px; }
  .oq-print-root p { margin: 0 0 4px; }
  .oq-print-root .oq-report-brand { font-weight: 800; letter-spacing: .14em; font-size: 11px; color: #0d4f49; }
  .oq-print-root .oq-callout { border-inline-start: 3px solid #176a64; padding: 4px 8px; background: #eef6f4; }
  .oq-print-root .oq-dl { display: grid; grid-template-columns: max-content 1fr; gap: 2px 12px; margin: 0; }
  .oq-print-root .oq-dl dt { color: #444; }
  .oq-print-root .oq-dl dd { margin: 0; }
  .oq-print-root .oq-tablewrap { overflow: visible; border: 0; }
  .oq-print-root .oq-table { border-collapse: collapse; width: 100%; font-size: 10.5px; }
  .oq-print-root .oq-table th, .oq-print-root .oq-table td { border: 1px solid #bbb; padding: 3px 5px; text-align: start; vertical-align: top; overflow-wrap: anywhere; }
  .oq-print-root .oq-table thead th { background: #f0f0f0; }
  .oq-print-root tr { break-inside: avoid; }
  .oq-print-root .oq-mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 10px; }
  .oq-print-root .oq-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .oq-print-root .oq-report-foot { color: #444; border-top: 1px solid #bbb; padding-top: 6px; font-size: 10.5px; }
}

/* report table: keep short columns readable (no letter-by-letter wrapping) */
.oq-report-table { min-width: 860px; }
.oq-report-table td { overflow-wrap: normal; word-break: normal; }
.oq-report-table td.oq-mono { overflow-wrap: anywhere; word-break: break-all; min-width: 14em; }
.oq-report-table th:nth-child(1), .oq-report-table td:nth-child(1), .oq-report-table th:nth-child(2), .oq-report-table td:nth-child(2) { white-space: nowrap; }
@media print { .oq-print-root .oq-report-table { min-width: 0; } .oq-print-root .oq-report-table th, .oq-print-root .oq-report-table td { white-space: normal; } }
