/* Grabr console — compact workspace, readable evidence, touch-first navigation.
   Legacy feature styles live in style.css; this file owns the visual system. */
:root, :root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #10191c;
  --surface: #162125;
  --surface-2: #1c282d;
  --surface-3: #25343a;
  --text: #edf3f2;
  --muted: #a2b2b7;
  --faint: #83969d;
  --border: #35464d;
  --border-soft: #2a393f;
  --accent: #8de4c2;
  --accent-hover: #a8efd3;
  --accent-soft: #8de4c211;
  --on-accent: #122b22;
  --danger: #fa9294;
  --green: #8de4c2;
  --amber: #e7bf7a;
  --purple: #b8b0e7;
  --sidebar-bg: #0d1518;
  --shadow-sm: 0 1px 2px #00000010;
  --shadow: 0 8px 24px #00000025;
  --shadow-lg: 0 24px 72px #00000060;
  --radius: 10px;
  --radius-lg: 12px;
  --radius-sm: 7px;
  --sidebar-w: 224px;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f6f8f8;
  --surface: #ffffff;
  --surface-2: #f0f4f3;
  --surface-3: #e5ece9;
  --text: #182d30;
  --muted: #526b70;
  --faint: #627a80;
  --border: #c8d5d4;
  --border-soft: #dce5e3;
  --accent: #177657;
  --accent-hover: #0d6247;
  --accent-soft: #17765710;
  --on-accent: #ffffff;
  --green: #177657;
  --amber: #916019;
  --danger: #b83642;
  --purple: #6c5ea0;
  --sidebar-bg: #edf2f0;
  --shadow: 0 8px 24px #16312b0c;
  --shadow-lg: 0 24px 72px #16312b25;
}
html { -webkit-tap-highlight-color: transparent; -webkit-text-size-adjust: 100%; overscroll-behavior: none; }
body { font-size: 14px; letter-spacing: -.01em; overscroll-behavior: none; }
button, input, select, textarea { font: inherit; }
button, summary, [role="button"], .qa-file { touch-action: manipulation; -webkit-user-select: none; user-select: none; }
a { touch-action: manipulation; }
button { color: inherit; }
button:disabled { cursor: not-allowed; }
button:focus-visible, a:focus-visible, summary:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
input, select, textarea { min-width: 0; max-width: 100%; }
input[type="search"] { appearance: none; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 7px; padding: 10px 12px; }
input::placeholder, textarea::placeholder { color: var(--faint); opacity: 1; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--accent); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link { position: fixed; top: -100px; left: 16px; z-index: 2000; padding: 12px 20px; background: var(--accent); color: var(--on-accent); border-radius: 6px; }
.skip-link:focus { top: 12px; }
[data-icon] { display: inline-flex; flex: 0 0 auto; align-items: center; justify-content: center; }
[data-icon] svg, .sidebar-toggle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
kbd { font: 10px var(--mono); color: var(--muted); border: 1px solid var(--border); border-bottom-width: 2px; padding: 2px 5px; border-radius: 4px; white-space: nowrap; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 7px; font-size: 12px; font-weight: 600; min-height: 36px; padding: 8px 13px; box-shadow: none; }
.btn-primary { color: var(--on-accent); background: var(--accent); }
.btn-secondary { background: var(--surface-2); border-color: var(--border); }
.btn-sm { min-height: 30px; font-size: 11px; padding: 5px 10px; }
.btn-danger-solid { background: var(--danger); color: #24080b; }
.icon-button { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; padding: 0; background: transparent; border: 1px solid var(--border-soft); border-radius: 7px; cursor: pointer; font-size: 22px; }
.icon-button:active, .text-button:active, .nav-item:active, .metric:active, .recent-profile:active { background: var(--surface-3); }
.text-button { display: inline-flex; align-items: center; gap: 8px; border: 0; background: none; color: var(--muted); padding: 8px 0 8px 8px; font-size: 11px; cursor: pointer; white-space: nowrap; }
.card { box-shadow: none; border-color: var(--border-soft); }
.layout { height: 100dvh; min-height: 0; overflow: hidden; }
.sidebar { height: 100dvh; padding: 25px 15px 16px; background: var(--sidebar-bg); position: relative; overflow-y: auto; overscroll-behavior: contain; }
.brand { font-size: 26px; font-weight: 750; letter-spacing: -1px; gap: 10px; padding: 0 9px 25px; line-height: 1; }
.brand-logo { width: 35px; height: 35px; border-radius: 10px; }
.brand-caption { display: block; color: var(--faint); font: 7px var(--mono); letter-spacing: 1.1px; margin-top: 7px; }
#sidebar-close { display: none; margin-left: auto; }
.workspace-switch { display: flex; align-items: center; gap: 9px; width: 100%; text-align: left; padding: 11px 9px; border: 1px solid var(--border-soft); background: var(--surface); border-radius: 8px; font-size: 11px; cursor: pointer; }
.workspace-switch small { display: block; color: var(--faint); font-size: 9px; margin-top: 2px; }
.workspace-avatar { display: grid; place-items: center; width: 26px; height: 26px; background: var(--accent-soft); border: 1px solid color-mix(in srgb,var(--accent) 20%,transparent); color: var(--accent); border-radius: 6px; font: 12px var(--mono); }
.workspace-chevron { margin-left: auto; color: var(--muted); }
.command-trigger { display: flex; align-items: center; gap: 8px; padding: 10px 5px; margin-top: 12px; width: 100%; background: transparent; border: 0; color: var(--muted); font-size: 10px; cursor: pointer; }
.command-trigger kbd { margin-left: auto; font-size: 8px; }
.command-trigger svg { width: 14px; }
.nav-label { display: flex; justify-content: space-between; padding: 24px 10px 12px; color: var(--faint); font: 9px var(--mono); letter-spacing: 1.2px; }
.nav-label span { color: var(--border); }
.nav { gap: 4px; }
.nav-item { min-height: 39px; border-radius: 6px; font-size: 12px; color: var(--muted); padding: 10px; gap: 11px; }
.nav-item svg { width: 16px; height: 16px; stroke-width: 1.6; }
.nav-item.active { color: var(--accent); background: var(--accent-soft); box-shadow: inset 2px 0 0 var(--accent); font-weight: 600; }
.nav-meta { margin-left: auto; font: 10px var(--mono); color: var(--faint); }
.nav-item.active .nav-meta { color: var(--accent); }
.nav-foot { padding-top: 24px; gap: 10px; }
.sidebar-note { border: 1px solid var(--border-soft); border-radius: 8px; padding: 12px; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; color: var(--faint); font-size: 10px; line-height: 1.65; margin-bottom: 16px; }
.sidebar-note [data-icon] { color: var(--accent); }
.sidebar-note strong { font-size: 11px; color: var(--text); font-weight: 500; }
.db-pill { border: 0; border-radius: 0; background: none; padding: 0 10px; font-size: 10px; }
.db-pill .dot { width: 5px; height: 5px; box-shadow: 0 0 0 3px var(--accent-soft); }
.nav-foot #logout-btn { font-size: 11px; min-height: 32px; }
.main { height: 100dvh; overflow: hidden; }
.topbar { flex: 0 0 auto; min-height: 59px; padding: 12px 30px; background: var(--bg); backdrop-filter: none; position: relative; border-bottom: 1px solid var(--border-soft); gap: 8px; }
.breadcrumb { display: flex; align-items: center; min-width: 0; gap: 12px; color: var(--faint); font-size: 11px; }
.breadcrumb-workspace { display: flex; gap: 12px; }
.breadcrumb-separator { color: var(--border); }
.topbar h1 { font-size: 12px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-right { gap: 15px; flex-shrink: 0; }
.topbar-date { color: var(--faint); font: 10px var(--mono); text-transform: uppercase; letter-spacing: .5px; }
.operator-avatar { display: grid; place-items: center; width: 29px; height: 29px; border: 1px solid var(--border); background: var(--surface-3); border-radius: 50%; font-size: 10px; cursor: pointer; }
.scroll { padding: 30px 30px 36px; overflow: auto; overscroll-behavior: contain; min-height: 0; scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
.view, #view-search, #view-settings { max-width: 1500px; width: 100%; margin-inline: auto; }
.view:not(.hidden) { animation: none; }
.workspace-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 27px; }
.eyebrow { font: 9px var(--mono); color: var(--faint); letter-spacing: 1.4px; text-transform: uppercase; display: flex; align-items: center; gap: 7px; }
.signal-mark { width: 5px; height: 5px; border: 1px solid var(--accent); transform: rotate(45deg); }
.workspace-heading h2 { font-size: clamp(25px, 2.65vw, 38px); line-height: 1.18; letter-spacing: -1.5px; font-weight: 550; margin: 12px 0 9px; }
.workspace-heading h2 > span { color: var(--accent); }
.workspace-heading p { margin: 0; font-size: 12px; color: var(--muted); }
.workspace-heading > .btn { align-self: flex-end; margin-bottom: 5px; }
.workspace-metrics { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); border: 1px solid var(--border-soft); border-radius: 10px; overflow: hidden; margin-bottom: 23px; background: var(--surface); }
.metric { display: flex; flex-direction: column; text-align: left; padding: 17px 18px 13px; border: 0; border-right: 1px solid var(--border-soft); background: none; min-width: 0; cursor: pointer; }
.metric:last-child { border-right: 0; }
.metric-label { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: 11px; color: var(--muted); }
.metric-label svg { width: 15px; height: 15px; color: var(--faint); }
.metric-main { display: flex; align-items: baseline; gap: 9px; margin-top: 9px; }
.metric-main strong { font-size: 29px; line-height: 1.2; font-weight: 500; letter-spacing: -1px; font-variant-numeric: tabular-nums; }
.metric-main > span { font-size: 9px; color: var(--faint); }
.metric-note { display: flex; align-items: center; gap: 6px; margin-top: 13px; color: var(--faint); font-size: 9px; }
.metric-note > span:last-child:not(:first-child) { margin-left: auto; }
.metric:first-child .metric-note > span { margin-left: 0; }
.metric:first-child .metric-main strong { color: var(--accent); }
.status-dot { display: inline-block; width: 5px; height: 5px; flex-shrink: 0; border-radius: 50%; background: var(--accent); }
.status-dot.off { background: var(--amber); }
.search-panel { padding: 21px 22px 0; margin-bottom: 0; border-color: color-mix(in srgb,var(--accent) 24%, var(--border-soft)); position: relative; }
.search-panel::before { content: ""; height: 2px; width: 50px; position: absolute; top: -1px; left: 22px; background: var(--accent); }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.panel-heading h3 { margin: 5px 0 0; font-size: 15px; font-weight: 550; letter-spacing: -.3px; }
.panel-caption { display: inline-flex; gap: 6px; align-items: center; font-size: 10px; color: var(--faint); }
.panel-caption svg { width: 14px; height: 14px; }
.profile-row { margin-bottom: 13px; gap: 8px; }
.profile-row label { font-size: 10px; }
.profile-row select { font-size: 11px; min-width: 160px; max-width: 260px; padding: 5px 9px; height: 30px; background: var(--bg); border-color: var(--border-soft); }
.profile-row .btn { font-size: 10px; min-height: 30px; padding: 3px 9px; }
#project-note { margin-left: auto; font-size: 10px; }
.search-row { display: grid; grid-template-columns: minmax(0,1fr) 150px 142px; gap: 8px; }
.query-field { display: flex; align-items: center; min-width: 0; gap: 9px; border: 1px solid var(--border); border-radius: 7px; background: var(--bg); padding: 0 12px; }
.query-field > [data-icon] { color: var(--accent); }
.query-field:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.query-field kbd { margin-left: auto; color: var(--faint); }
.search-row #q { background: transparent; border: 0; padding: 14px 0; font-size: 13px; box-shadow: none; width: 100%; min-width: 0; }
.search-row #type { font-size: 11px; padding: 10px 12px; background: var(--bg); }
.search-row #go { min-height: 48px; font-size: 12px; justify-content: space-between; }
.query-bottom { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 13px 0 18px; }
.query-types { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.query-types > span { color: var(--faint); font: 8px var(--mono); letter-spacing: .7px; margin-right: 7px; }
.query-types button { color: var(--muted); font-size: 10px; background: transparent; border: 1px solid var(--border-soft); border-radius: 4px; padding: 4px 8px; cursor: pointer; }
.query-types button.active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
#detected { margin: 0; font-size: 10px; }
.query-context { display: flex; align-items: center; gap: 20px; border-top: 1px solid var(--border-soft); padding: 10px 0; color: var(--faint); font-size: 9px; }
.query-context > span { display: inline-flex; align-items: center; gap: 7px; }
.query-context > .keyboard-hint { margin-left: auto; }
.query-context kbd { font-size: 8px; }
.status:empty { display: none; }
.status { margin: 16px 0; padding: 12px; border: 1px solid var(--border-soft); border-radius: 8px; font-size: 12px; }
.workspace-overview { display: grid; grid-template-columns: minmax(0,1.1fr) minmax(0,1fr); gap: 18px; margin-top: 22px; }
.overview-panel { border: 1px solid var(--border-soft); border-radius: 10px; background: var(--surface); min-width: 0; overflow: hidden; }
.overview-panel .panel-heading { padding: 19px 20px 0; margin-bottom: 16px; }
.recent-profiles { min-height: 156px; padding: 0 10px; }
.recent-profile { display: flex; align-items: center; text-align: left; gap: 11px; width: 100%; padding: 11px 10px; color: var(--text); border: 0; border-top: 1px solid var(--border-soft); background: none; cursor: pointer; }
.recent-profile:first-child { border-top: 0; }
.recent-initial { display: grid; place-items: center; width: 31px; height: 31px; border-radius: 7px; background: var(--surface-3); color: var(--accent); border: 1px solid var(--border); flex-shrink: 0; font-size: 12px; }
.recent-initial img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.recent-identity { min-width: 0; flex: 1; }
.recent-identity strong { display: block; font-size: 11px; font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent-identity small { display: block; font-size: 9px; color: var(--faint); margin-top: 2px; }
.recent-search-count { text-align: right; font: 12px var(--mono); color: var(--muted); flex: 0 0 auto; }
.recent-search-count small { display: block; font: 8px var(--font); color: var(--faint); }
.recent-arrow { color: var(--faint); font-size: 13px; margin-left: 9px; }
.panel-create { display: flex; align-items: center; gap: 9px; border: 0; border-top: 1px solid var(--border-soft); background: none; color: var(--accent); font-size: 10px; padding: 13px 20px; width: 100%; text-align: left; cursor: pointer; }
.panel-create > span:last-child { margin-left: auto; font-size: 9px; color: var(--faint); }
.coverage-list { padding: 0 20px 11px; }
.coverage-row { display: grid; grid-template-columns: 25px minmax(0,1fr) 70px 41px; align-items: center; gap: 8px; padding: 8px 0; font-size: 10px; }
.coverage-row > [data-icon] { color: var(--faint); }
.coverage-row svg { width: 14px; height: 14px; }
.coverage-row > strong { text-align: right; font: 9px var(--mono); color: var(--muted); }
.coverage-track { height: 3px; border-radius: 2px; background: var(--surface-3); overflow: hidden; }
.coverage-track > span { display: block; background: var(--accent); height: 100%; }
.coverage-row.unavailable .coverage-track > span { background: var(--faint); }
.panel-foot { display: flex; align-items: center; gap: 7px; font-size: 9px; color: var(--faint); padding: 11px 20px; border-top: 1px solid var(--border-soft); }
.panel-placeholder { padding: 25px 10px; font-size: 12px; color: var(--muted); line-height: 1.8; }
.panel-placeholder strong { display: block; color: var(--text); font-size: 13px; font-weight: 500; }
.workflow-panel { grid-column: 1 / -1; display: grid; grid-template-columns: 1.3fr 1fr 1fr 1fr; gap: 0; padding: 17px 19px; border: 1px solid var(--border-soft); border-radius: 10px; }
.workflow-title { display: flex; align-items: center; gap: 13px; }
.workflow-title > [data-icon] { color: var(--accent); }
.workflow-title h3 { font-size: 11px; font-weight: 500; margin: 6px 0 0; }
.workflow-title .eyebrow { font-size: 8px; letter-spacing: 1px; }
.workflow-panel > button { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 16px; background: none; border: 0; border-left: 1px solid var(--border-soft); text-align: left; cursor: pointer; min-width: 0; }
.workflow-panel > button strong { font-size: 11px; font-weight: 500; }
.workflow-panel > button small { display: block; font-size: 9px; color: var(--faint); margin-top: 3px; }
.workflow-panel > button > span:last-child { font-size: 12px; color: var(--faint); }
.step-number { font: 10px var(--mono); color: var(--accent); }
.live-footer { margin-top: 20px; padding-top: 0; border: none; }
.lf-title { font: 8px var(--mono); letter-spacing: 1px; color: var(--faint); margin-bottom: 10px; }
.lf-chips { gap: 5px; }
.lf-chip { font-size: 9px; padding: 4px 7px; border-radius: 4px; background: transparent; box-shadow: none; }
.lf-chip .dot { width: 4px; height: 4px; }
.view-head { gap: 16px; align-items: flex-end; margin-bottom: 22px; }
.view-title { font-size: 28px; font-weight: 550; letter-spacing: -1px; margin: 9px 0 5px; }
.view-head .sub { font-size: 12px; max-width: 720px; line-height: 1.7; }
.profile-filterbar { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 18px; }
.filter-input { display: flex; align-items: center; gap: 8px; padding: 0 11px; background: var(--surface); border: 1px solid var(--border); border-radius: 7px; flex: 1; min-width: 170px; }
.filter-input:focus-within { border-color: var(--accent); }
.filter-input > [data-icon] { color: var(--faint); }
.filter-input input { flex: 1; width: 100%; padding: 10px 0; border: 0; background: none; font-size: 12px; box-shadow: none; }
.profile-filterbar .hint { font: 10px var(--mono); }
.segmented { padding: 3px; background: var(--surface-2); border: 1px solid var(--border-soft); border-radius: 7px; }
.seg { font-size: 11px; padding: 6px 11px; border-radius: 4px; }
.seg.active { background: var(--surface-3); color: var(--text); box-shadow: none; }
.dash-bar { justify-content: flex-end; margin-bottom: 14px; }
.ghost-btn { border-radius: 6px; font-size: 11px; }
.pgroup { background: none; padding: 0; border: 0; margin-bottom: 27px; }
.pgroup-title { font-size: 13px; font-weight: 500; }
.pgroup-count { border-radius: 4px; font: 9px var(--mono); color: var(--muted); }
.pgroup-acts button { font-size: 10px; border-radius: 5px; }
.pgroup-body { display: grid; grid-template-columns: repeat(auto-fill,minmax(min(100%,285px),1fr)); gap: 12px; }
.pcard { padding: 16px; border-radius: 10px; }
.pcard-top { border: 0; padding: 0; width: 100%; text-align: left; background: none; color: inherit; }
.pcard-top > .recent-arrow { margin-left: auto; }
.pc-avatar { width: 40px; height: 40px; border-radius: 9px; background: var(--accent-soft); border: 1px solid color-mix(in srgb,var(--accent) 20%,var(--border-soft)); color: var(--accent); font-size: 18px; }
.pcard .pname { font-size: 14px; overflow-wrap: anywhere; display: block; }
.pcard .pmeta { font: 9px var(--mono); margin-top: 5px; display: block; }
.pcard-note { font-size: 11px; line-height: 1.6; margin-top: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pcard-actions { border-top: 1px solid var(--border-soft); margin-top: 15px; padding-top: 11px; align-items: center; }
.pcard-actions button { font-size: 10px; padding: 5px 9px; border-radius: 5px; }
.action-menu { position: relative; margin-left: auto; font-size: 11px; }
.action-menu summary { list-style: none; cursor: pointer; border: 1px solid var(--border); border-radius: 6px; padding: 7px 11px; color: var(--muted); background: var(--surface-2); white-space: nowrap; }
.action-menu summary::-webkit-details-marker { display: none; }
.action-menu[open] { z-index: 30; }
.action-popover { position: absolute; z-index: 31; right: 0; top: calc(100% + 6px); min-width: 175px; padding: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: 9px; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; gap: 3px; }
.action-popover button { justify-content: flex-start; text-align: left; background: transparent; border: 0; width: 100%; min-height: 33px; font-size: 11px; }
.action-popover button.danger { color: var(--danger); }
.action-popover .menu-divider { height: 1px; margin: 4px; background: var(--border-soft); }
.profile-hero { padding: 22px; border-radius: 10px; margin-bottom: 17px; }
.hero-main { display: grid; grid-template-columns: 55px minmax(0,1fr); gap: 14px; }
.hero-avatar { width: 55px; height: 55px; background: var(--accent-soft); color: var(--accent); border: 1px solid var(--border); border-radius: 11px; }
.hero-id h2 { font-size: 25px; line-height: 1.2; overflow-wrap: anywhere; font-weight: 550; }
.hero-actions { grid-column: 1 / -1; border-top: 1px solid var(--border-soft); padding-top: 15px; gap: 7px; align-items: center; }
.hero-caseid { transform: none; border: 1px solid var(--border); background: var(--surface-2); border-radius: 4px; box-shadow: none; font: 9px var(--mono); letter-spacing: .5px; padding: 4px 7px; }
.bio-grid { gap: 15px; }
.bio-gtitle { font: 9px var(--mono); letter-spacing: 1px; }
.bio-gfields { grid-template-columns: repeat(auto-fill,minmax(min(100%,160px),1fr)); gap: 13px; }
.bio-field { min-width: 0; }
.bio-field .k { font-size: 9px; color: var(--faint); letter-spacing: .5px; }
.bio-field .v { font-size: 12px; overflow-wrap: anywhere; }
.bio-summary { font-size: 12px; }
.results-header { gap: 9px; margin: 18px 0; }
.summary { font-size: 12px; }
.downloads { margin-left: auto; }
.downloads span { font-size: 10px; }
.dl { font: 9px var(--mono); border-radius: 4px; padding: 5px 8px; }
.quick-add { border-style: solid; border-radius: 8px; padding: 12px; cursor: default; will-change: auto; }
.quick-add #qa-input { min-width: 0; font-size: 12px; flex: 1 1 240px; }
.qa-hint:empty { display: none; }
.qa-drop { font-size: 10px; }
.dossier-filterbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 20px 0 14px; }
.dossier-filterbar label:not(.filter-input) { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 11px; cursor: pointer; }
.dossier-filterbar .filter-input { max-width: 320px; }
.dossier-filterbar > .hint { margin-left: auto; font: 9px var(--mono); }
#detail-sections { column-count: 2; column-gap: 14px; }
#detail-sections .dsec { break-inside: avoid; margin-bottom: 14px; padding: 15px; border-radius: 9px; }
#detail-sections .span-all { column-span: all; }
.dsec-head { gap: 8px; flex-wrap: wrap; margin-bottom: 11px; }
.dsec-head h3 { font-size: 12px; font-weight: 550; }
.dsec-ico { font-size: 12px; filter: grayscale(.65); }
.dsec-empty { font-size: 11px; }
.ditem .ititle { font-size: 12px; }
.ditem .inote, .imeta { font-size: 11px; }
.ditem { gap: 8px; }
.iacts { gap: 3px; }
.dsec .btn-sm { font-size: 10px; padding: 4px 7px; min-height: 27px; }
.cards, .sources-grid, .tools-grid, .lab-tools { grid-template-columns: repeat(auto-fill,minmax(min(100%,270px),1fr)); gap: 12px; }
.result-card, .mod, .tool-card, .lab-tool { border-radius: 9px; padding: 15px; box-shadow: none; }
.card-head .title, .mod .mname, .tool-name { font-size: 12px; }
.result-card .detail, .tool-desc, .lab-tool-desc { font-size: 11px; line-height: 1.65; }
.result-card .meta { font-size: 9px; }
.group h3 { font-size: 13px; }
.mod .types, .mod .reason { font-size: 10px; }
.mod.off { opacity: .8; }
.mod .dot { height: 6px; width: 6px; }
.sources-summary { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.sources-summary span { padding: 6px 10px; border: 1px solid var(--border-soft); border-radius: 5px; color: var(--muted); font-size: 11px; }
.sources-summary strong { color: var(--accent); font-weight: 500; margin-right: 4px; }
.badge, .conf { font-size: 9px; border-radius: 4px; padding: 2px 5px; }
.badge.high { color: var(--green); }
.badge.medium, .risk-badge.medium { color: var(--amber); }
.badge.low, .risk-badge.high { color: var(--danger); }
.lab-drop { border-radius: 8px; padding: 24px; }
.lab-drop-t { font-size: 15px; }
.lab-drop-s, .lab-status { font-size: 11px; }
.lab-drop-ico { filter: grayscale(1); }
.setting-list { box-shadow: none; }
.settings-section h2 { font-size: 14px; }
.setting-row .label { font-size: 12px; }
.setting-row .desc { font-size: 11px; line-height: 1.7; }
.setting-row { padding: 16px 18px; }
.mcp-key { overflow-wrap: anywhere; }
.mcp-url { max-width: 100%; overflow-wrap: anywhere; }
.modal-root { padding: 20px; }
.modal-card { border-radius: 12px; padding: 24px; max-height: calc(100dvh - 48px); overscroll-behavior: contain; animation: none; }
.modal-backdrop { background: #060c10aa; backdrop-filter: blur(3px); }
.modal-card h3 { font-size: 18px; }
.modal-card p { font-size: 12px; line-height: 1.7; }
.modal-card.form-grouped { width: min(620px, 100%); }
.form-section { margin-top: 9px; border: 1px solid var(--border-soft); border-radius: 8px; }
.form-section summary { display: flex; align-items: center; gap: 10px; padding: 14px; font-size: 12px; list-style: none; cursor: pointer; }
.form-section summary::-webkit-details-marker { display: none; }
.form-section summary > span:last-child { color: var(--accent); }
.form-section[open] summary { border-bottom: 1px solid var(--border-soft); }
.form-section[open] summary > span:last-child { transform: rotate(45deg); }
.form-section-count { margin-left: auto; color: var(--faint); font: 10px var(--mono); }
.form-section-fields { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; padding: 15px; }
.form-section-fields .field { margin: 0; min-width: 0; }
.form-section-fields .field:has(textarea) { grid-column: 1 / -1; }
.form-section-fields .field label { font-size: 11px; }
.form-section-fields input, .form-section-fields select, .form-section-fields textarea { width: 100%; }
.modal-actions { border-top: 1px solid var(--border-soft); margin-top: 16px; padding-top: 16px; }
.modal-open .scroll { overflow: hidden; }
.toast-root { bottom: 22px; max-width: calc(100% - 24px); }
.toast { font-size: 12px; padding: 12px 18px; border-radius: 9px; }
.command-dialog { padding: 0; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 12px; width: min(540px,calc(100% - 28px)); max-height: min(600px,calc(100dvh - 60px)); margin: 14dvh auto auto; box-shadow: var(--shadow-lg); }
.command-dialog::backdrop { background: #070e14aa; backdrop-filter: blur(3px); }
.command-search { display: flex; align-items: center; padding: 14px; gap: 10px; border-bottom: 1px solid var(--border-soft); }
.command-search > [data-icon] { color: var(--accent); }
.command-search input { border: 0; background: none; box-shadow: none; padding: 5px; flex: 1; font-size: 14px; }
.command-results { overflow-y: auto; overscroll-behavior: contain; max-height: 360px; padding: 8px; }
.command-option { display: flex; align-items: center; text-align: left; gap: 12px; width: 100%; background: none; border: 0; border-radius: 6px; padding: 12px; cursor: pointer; font-size: 12px; }
.command-option small { margin-left: auto; color: var(--faint); font: 9px var(--mono); }
.command-option.selected { background: var(--accent-soft); color: var(--accent); }
.command-footer { display: flex; justify-content: space-between; padding: 10px 16px; border-top: 1px solid var(--border-soft); color: var(--faint); font-size: 9px; }
.mobile-nav { display: none; }
#detail-sections:not(.view-folders) > .dsec:hover, .pcard:hover, .sp-card:hover { transform: none; box-shadow: none; }
.login-wrap { min-height: 100dvh; background: var(--bg); padding: 28px; }
.login-card { max-width: 410px; padding: 34px; border: 1px solid var(--border); border-radius: 14px; text-align: left; box-shadow: var(--shadow); }
.login-logo { width: 48px; height: 48px; margin: 0 0 26px; border-radius: 12px; box-shadow: none; }
.login-card h1 { font-size: 27px; letter-spacing: -1px; font-weight: 550; margin-bottom: 8px; }
.login-card > .eyebrow { margin-bottom: 12px; }
.login-card .sub { font-size: 12px; line-height: 1.7; margin-bottom: 25px; }
.login-card input { text-align: left; font-size: 16px; padding: 12px; background: var(--bg); }
.login-card .btn { min-height: 44px; font-size: 13px; }
.login-card label { display: flex; flex-direction: column; gap: 7px; color: var(--muted); font-size: 11px; }
.login-foot { border-top: 1px solid var(--border-soft); padding-top: 20px; font-size: 10px; }
@media (hover: hover) and (pointer: fine) {
  .btn-primary:hover { color: var(--on-accent); background: var(--accent-hover); }
  .nav-item:hover:not(.active), .recent-profile:hover, .metric:hover, .command-option:hover, .action-popover button:hover { background: var(--surface-2); }
  .text-button:hover, .command-trigger:hover, .workflow-panel > button:hover, .panel-create:hover { color: var(--accent); }
  .query-types button:hover, .icon-button:hover { border-color: var(--accent); color: var(--accent); }
}
@media (min-width: 1600px) {
  .scroll { padding: 35px 45px; }
  .metric { padding: 21px 23px 17px; }
  .workspace-overview { gap: 22px; }
  .recent-profile { padding-block: 14px; }
}
@media (max-width: 1120px) and (min-width: 861px) {
  :root { --sidebar-w: 194px; }
  .sidebar { padding-inline: 10px; }
  .brand-caption { font-size: 6px; }
  .scroll { padding: 25px 22px; }
  .metric { padding: 14px 12px; }
  .metric-main { flex-wrap: wrap; gap: 2px 7px; }
  .metric-main > span { width: 100%; }
  .metric-note { font-size: 8px; }
  .workflow-panel { grid-template-columns: repeat(3,1fr); row-gap: 18px; }
  .workflow-title { grid-column: 1 / -1; }
  .workflow-panel > button:nth-child(2) { border-left: 0; padding-left: 0; }
  #project-note { display: none; }
}
/* Native-size hit areas are independent of viewport width (touch laptops too). */
@media (pointer: coarse) {
  input[type="text"], input[type="password"], input[type="search"], input[type="email"], input[type="tel"], input[type="url"], input[type="number"], textarea, select,
  .search-row #q, .search-row #type, .profile-row select, .quick-add #qa-input, .filter-input input { font-size: 16px; }
  .btn, .btn-sm, .seg, .iedit, .idel, .pb, .atool, .pcard-actions button, .pgroup-acts button, .action-menu summary, .action-popover button, .icon-button, .text-button, .ghost-btn { min-height: 44px; }
  .iedit, .idel, .pb, .atool, .icon-button { min-width: 44px; }
  .query-types button { min-height: 44px; padding-inline: 10px; }
}
@media (max-width: 860px) {
  .layout, .main { height: 100dvh; }
  .sidebar { position: fixed; z-index: 61; left: 0; top: 0; width: min(310px, calc(100vw - 45px)); height: 100dvh; padding: calc(25px + env(safe-area-inset-top)) 18px calc(20px + env(safe-area-inset-bottom)); transform: translateX(-102%); transition: transform 200ms var(--ease-out), visibility 200ms; visibility: hidden; }
  .sidebar.open { transform: translateX(0); visibility: visible; }
  .sidebar .nav-item { min-height: 44px; font-size: 13px; }
  .sidebar-note { display: none; }
  #sidebar-close { display: inline-flex; }
  .sidebar-toggle { display: flex; position: fixed; z-index: 25; top: calc(10px + env(safe-area-inset-top)); left: calc(10px + env(safe-area-inset-left)); width: 38px; height: 38px; border: 0; background: none; border-radius: 7px; box-shadow: none; color: var(--text); }
  .topbar { min-height: calc(59px + env(safe-area-inset-top)); padding: calc(10px + env(safe-area-inset-top)) calc(16px + env(safe-area-inset-right)) 10px calc(58px + env(safe-area-inset-left)); }
  .topbar h1 { font-size: 13px; }
  .topbar-date, .breadcrumb-workspace { display: none; }
  .topbar-right { gap: 10px; }
  .scroll { padding: 24px max(16px, env(safe-area-inset-right)) calc(90px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); }
  .mobile-nav { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); position: fixed; z-index: 30; bottom: 0; left: 0; right: 0; padding: 6px max(8px, env(safe-area-inset-right)) calc(6px + env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left)); background: var(--sidebar-bg); border-top: 1px solid var(--border); }
  .mobile-nav .nav-item { display: flex; flex-direction: column; gap: 4px; padding: 7px 4px 5px; min-height: 51px; justify-content: center; font-size: 10px; border-radius: 6px; }
  .mobile-nav .nav-item.active { box-shadow: none; background: var(--accent-soft); }
  .mobile-nav svg { width: 19px; height: 19px; }
  .backdrop { position: fixed; inset: 0; z-index: 60; background: #050b10b3; backdrop-filter: blur(2px); }
  .workspace-heading { margin-bottom: 23px; }
  .workspace-heading h2 { font-size: 31px; letter-spacing: -1.2px; }
  .workspace-heading p { font-size: 12px; max-width: 370px; }
  .workspace-metrics { margin-bottom: 20px; }
  .metric { padding: 14px; }
  .metric-main { flex-wrap: wrap; gap: 3px 6px; }
  .metric-main > span { width: 100%; }
  .metric-note { font-size: 8px; }
  .search-panel { padding: 18px 18px 0; }
  .search-row { grid-template-columns: minmax(0,1fr) 135px; }
  .query-field { grid-column: 1 / -1; }
  .search-row #type { width: 100%; }
  .query-field kbd, .keyboard-hint { display: none !important; }
  .search-row #go { justify-content: center; }
  #project-note { display: none; }
  .query-types { gap: 6px; }
  .query-types > span { flex-basis: 100%; margin: 0 0 2px; }
  .query-context { gap: 8px; justify-content: space-between; font-size: 9px; }
  .query-context > span { max-width: 50%; }
  .workflow-panel { grid-template-columns: repeat(3, minmax(0,1fr)); row-gap: 17px; }
  .workflow-title { grid-column: 1 / -1; }
  .workflow-panel > button { padding-inline: 10px; gap: 7px; }
  .workflow-panel > button:nth-child(2) { border-left: 0; padding-left: 0; }
  .workflow-panel > button > span:last-child { display: none; }
  .workflow-panel > button small { font-size: 9px; }
  .view-title { font-size: 26px; }
  .view-head { align-items: flex-start; }
  .view-head > .btn { flex-shrink: 0; }
  #detail-sections { column-count: 1; }
  .hero-actions { gap: 6px; }
  .hero-actions .btn { font-size: 11px; }
  .toast-root { bottom: calc(81px + env(safe-area-inset-bottom)); }
  .modal-root { align-items: flex-end; padding: 0; }
  .modal-card { width: 100%; max-width: 640px; border-radius: 17px 17px 0 0; padding: 26px 20px calc(20px + env(safe-area-inset-bottom)); max-height: calc(100dvh - env(safe-area-inset-top) - 20px); }
  .modal-card.form-grouped { width: 100%; }
  .modal-card::before { content: ""; display: block; width: 32px; height: 3px; border-radius: 3px; background: var(--border); margin: -14px auto 19px; }
  .modal-actions { position: sticky; bottom: calc(-20px - env(safe-area-inset-bottom)); padding-bottom: calc(10px + env(safe-area-inset-bottom)); background: var(--surface); }
  .modal-actions .btn { min-height: 44px; flex: 1; }
  .img-picker-ov { padding: 12px; }
  .img-picker { max-height: calc(100dvh - 24px); }
  .lightbox { padding: 12px; }
  .lb-content img, .lb-content video { max-width: calc(100vw - 24px); max-height: calc(100dvh - 100px); }
  .annot-wrap { height: 94dvh; }
  .command-dialog { margin-top: calc(14px + env(safe-area-inset-top)); }
}
@media (max-width: 580px) {
  .workspace-heading > .btn { display: none; }
  .workspace-heading h2 { font-size: 30px; }
  .workspace-heading p { font-size: 11px; line-height: 1.65; max-width: 300px; }
  .eyebrow { font-size: 8px; letter-spacing: 1.2px; }
  .workspace-metrics { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .metric { padding: 13px 14px 12px; }
  .metric:nth-child(2) { border-right: 0; }
  .metric:nth-child(-n+2) { border-bottom: 1px solid var(--border-soft); }
  .metric-main { margin-top: 7px; }
  .metric-main strong { font-size: 27px; }
  .metric-main > span { font-size: 9px; width: auto; }
  .metric-label { font-size: 10px; }
  .metric-note { display: none; }
  .panel-caption { display: none; }
  .panel-heading { margin-bottom: 17px; }
  .search-panel { padding-inline: 14px; }
  .profile-row label { flex-basis: 100%; }
  .profile-row select { min-width: 0; flex: 1; max-width: none; height: 38px; }
  .profile-row .btn { min-height: 38px; }
  .query-field { padding-inline: 10px; }
  .query-field > [data-icon] { display: none; }
  .search-row #q { padding-block: 14px; font-size: 16px; }
  .search-row #type { font-size: 16px; }
  .query-bottom { padding-bottom: 14px; }
  .query-types button { font-size: 10px; }
  .query-context { align-items: flex-start; gap: 10px; line-height: 1.5; }
  .query-context > span:last-of-type { display: none; }
  .workspace-overview { grid-template-columns: minmax(0,1fr); gap: 16px; margin-top: 18px; }
  .overview-panel .panel-heading { padding: 17px 16px 0; }
  .recent-profiles { min-height: 0; padding-inline: 6px; }
  .recent-profile { min-height: 66px; }
  .recent-identity strong { font-size: 12px; }
  .recent-identity small { font-size: 10px; }
  .panel-create { min-height: 46px; padding-inline: 16px; }
  .panel-create > span:last-child { font-size: 8px; }
  .coverage-row { padding-block: 10px; font-size: 11px; }
  .workflow-panel { padding: 17px 14px; }
  .workflow-panel > button { align-items: flex-start; flex-direction: column; min-height: 68px; }
  .workflow-panel > button small { line-height: 1.5; }
  .live-footer { margin-top: 22px; }
  .lf-chip { font-size: 9px; }
  .view-head { flex-wrap: wrap; gap: 14px; }
  .view-head > .btn { width: 100%; }
  .view-head .sub { font-size: 12px; }
  .view-title { font-size: 25px; }
  .profile-filterbar { gap: 10px; }
  .profile-filterbar > .filter-input { flex-basis: 100%; }
  .profile-filterbar > .hint { margin-right: auto; }
  .pgroup-head { gap: 12px; }
  .pgroup-acts { gap: 5px; }
  .pgroup-acts button { font-size: 10px; padding: 5px 8px; }
  .pgroup-body { grid-template-columns: minmax(0,1fr); }
  .pcard { padding: 15px; }
  .pcard .pname { font-size: 15px; }
  .pcard .pmeta { font-size: 10px; }
  .pcard-note { font-size: 12px; }
  .pcard-actions { gap: 5px; }
  .pcard-actions button { padding-inline: 9px; font-size: 11px; }
  .profile-hero { padding: 16px; }
  .hero-main { grid-template-columns: 49px minmax(0,1fr); gap: 12px; }
  .hero-avatar { width: 49px; height: 49px; }
  .hero-id h2 { font-size: 23px; }
  #hero-sub { font-size: 11px; margin-top: 4px; }
  .hero-actions > .btn { flex: 1 1 auto; }
  .hero-actions .action-menu { flex: 1 1 auto; margin: 0; }
  .hero-actions .action-menu summary { text-align: center; }
  .bio-gfields { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .bio-field .k { font-size: 9px; }
  .bio-field .v { font-size: 12px; }
  .results-header { flex-wrap: wrap; }
  .results-header .summary { flex-basis: 100%; }
  .downloads { margin-left: 0; }
  .quick-add #qa-input { flex-basis: 100%; }
  .quick-add .qa-file { flex: 1; }
  .qa-drop { line-height: 1.65; }
  .dossier-filterbar > .filter-input { max-width: none; flex-basis: 100%; }
  .dossier-filterbar .hint { font-size: 9px; }
  .dsec-head h3 { font-size: 13px; }
  .dsec .btn-sm { min-height: 36px; }
  .ditem { flex-wrap: wrap; }
  .ditem .ibody { flex-basis: calc(100% - 110px); }
  .ditem .ititle { font-size: 13px; }
  .ditem .inote, .imeta { font-size: 12px; }
  .ditem .iacts { margin-left: auto; }
  .media-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
  .imedia { max-width: 100%; }
  .poc-file { flex-wrap: wrap; }
  .poc-file audio { width: 100%; }
  .card-head { flex-wrap: wrap; gap: 8px; }
  .card-head .title { flex-basis: calc(100% - 50px); font-size: 13px; }
  .card-head .isave { width: auto; padding-inline: 10px; min-height: 36px; }
  .result-card .detail, .tool-desc, .lab-tool-desc { font-size: 12px; }
  .tools-bar #tools-q, .tools-bar #tools-cat { flex-basis: 100%; width: 100%; min-width: 0; }
  .setting-row { align-items: flex-start; flex-wrap: wrap; gap: 12px; padding: 16px; }
  .setting-row .label { font-size: 13px; }
  .setting-row .desc { font-size: 12px; }
  .lab-drop { padding: 18px 13px; }
  .lab-src-row { align-items: stretch; }
  .lab-src-row > .btn { flex: 1; }
  .sp-k { min-width: 85px; }
  .sp-row { font-size: 12px; }
  .b64-img { max-width: 100%; }
  .annot-bar { padding: 8px; gap: 8px; }
  .annot-actions { margin-left: 0; flex-wrap: wrap; }
  .command-footer { font-size: 8px; padding: 10px; }
  .login-wrap { padding: 20px; }
  .login-card { padding: 27px; }
  .form-section-fields { grid-template-columns: minmax(0,1fr); }
}
@media (max-width: 360px) {
  .scroll { padding-inline: 12px; }
  .metric-main > span { flex-basis: 100%; }
  .search-row { grid-template-columns: minmax(0,1fr) 118px; }
  .panel-create > span:last-child { display: none; }
  .bio-gfields { grid-template-columns: minmax(0,1fr); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
@media (pointer: coarse) {
  .dl, .rbtn, .dsec .btn-sm, .card-head .isave, .sidebar-toggle { min-height: 44px; }
  .sidebar-toggle { min-width: 44px; }
  .dossier-filterbar > label { min-height: 44px; }
}
