/* Orgestrate surfaces: slide-ins, drawers, modals, drill-down cards and nav, the Records Explorer stage (Carousel Workspace),
   dots/labels navigation, side-icons, context notices, dropdown menus, toasts and empty bodies. Rules copied verbatim from
   listiq-explorer/host/Domains/Explorer/resources/assets/app.css (read-only source); tokens resolved by bridge.css. */
.btn.sm .icon { width: 16px; height: 16px; }
.side { background: var(--surface); border-right: 1px solid var(--border); display: flex; flex-direction: column; min-height: 0; }
.side-section { padding: var(--s4) var(--s2) var(--s1); display: flex; align-items: center; justify-content: space-between; }
.side-section h3 { margin: 0 0 0 var(--s2); font-weight: var(--title-weight); }
.side-lists { overflow: auto; flex: 1; padding-bottom: var(--s4); }
.side-foot { border-top: 1px solid var(--border); padding: var(--s3) var(--s4); font-size: 12px; color: var(--text-3); display: flex; gap: var(--s3); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--text-2); box-shadow: none; }
.btn.ghost:hover:not(:disabled) { background: var(--surface-2); color: var(--text); }
.btn.sm { height: var(--control-sm); padding: 0 10px; font-size: 13px; }
.btn.sm.icon-only { width: var(--control-sm); }
@media (max-width: 760px) {
  .slidein.form-panel { height: 100dvh; width: 100vw; max-width: 100vw; }
  .slidein.form-panel > .hd, .slidein.form-panel > .bd, .slidein.form-panel > .ft { padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
  .slidein.form-panel > .hd { padding-top: max(16px, env(safe-area-inset-top)); }
  .slidein.form-panel > .ft { padding-bottom: max(16px, env(safe-area-inset-bottom)); flex-wrap: wrap; }
}
.chip { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); font-size: 12px; color: var(--text-2); white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.chip .dot { width: 7px; height: 7px; border-radius: 50%; flex: none; background: var(--text-3); }
.chip.primary { border-color: var(--border-strong); color: var(--text); font-weight: 600; }
.chip.clickable { cursor: pointer; transition: background var(--fast); }
.chip.clickable:hover { background: var(--surface-3); }
.chip.on { background: var(--accent-weak); border-color: var(--accent); color: var(--accent); }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(620px, 100vw); border-left: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow-lg); z-index: 41; display: flex; flex-direction: column; animation: slide var(--med) var(--ease); }
.drawer .hd { padding: var(--s4) var(--s5); border-bottom: 1px solid var(--border); display: flex; gap: var(--s3); align-items: flex-start; }
.drawer .bd { padding: var(--s4) var(--s5); overflow: auto; flex: 1; }
.modal { position: fixed; z-index: 42; left: 50%; top: 8vh; transform: translateX(-50%); width: min(640px, calc(100vw - 32px)); max-height: 84vh; display: flex; flex-direction: column; background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); animation: rise var(--med) var(--ease); }
.modal.wide { width: min(960px, calc(100vw - 32px)); }
.modal .hd { padding: var(--s4) var(--s5); border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: var(--s2); }
.modal .bd { padding: var(--s4) var(--s5); overflow: auto; }
.modal .ft { padding: var(--s3) var(--s5); border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: var(--s2); }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin: 0 calc(-1 * var(--s5)) var(--s4); padding: 0 var(--s5); }
.tabs button { background: none; border: 0; padding: 8px 10px; font: 500 13px var(--font); color: var(--text-2); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button.on { color: var(--accent); border-color: var(--accent); font-weight: 650; }
.empty .glyph { width: 44px; height: 44px; margin: 0 auto var(--s3); border-radius: 12px; background: var(--accent-weak); color: var(--accent); display: grid; place-items: center; }
.empty .glyph .icon { width: 22px; height: 22px; }
.empty h2 { margin-bottom: 6px; font-weight: var(--title-weight); }
.empty p { margin: 0 auto var(--s4); max-width: 440px; color: var(--text-3); }
.toasts { position: fixed; bottom: var(--s4); right: var(--s4); z-index: 60; display: grid; gap: var(--s2); width: 360px; }
.toast { background: var(--text); color: var(--bg); padding: 10px 14px; border-radius: var(--radius); box-shadow: var(--shadow-lg); font-size: 13px; display: flex; gap: var(--s2); align-items: flex-start; animation: rise var(--med) var(--ease); }
.toast.error { background: var(--danger); color: #fff; }
.modal { --tx: -50%; }
@media (max-width: 900px) {
  .side { display: none; }
}
.side-foot { align-items: center; }
.side-foot { flex-wrap: wrap; row-gap: var(--s2); }
.side-foot > span { white-space: nowrap; }
.side-foot .theme-switch { margin-left: 0; width: 100%; justify-content: space-between; }
.side-foot .theme-switch button { flex: 1; }
.side-lists { overflow: visible; flex: none; }
.tabs button { font-size: 14px; padding: 10px 4px; margin-right: var(--s4); font-weight: 600; color: var(--text-3); }
.tabs button:hover { color: var(--text-2); }
.slidein.wide { width: min(880px, 100vw); }
.slidein .hd { padding: var(--s5) var(--s5) var(--s4); display: flex; gap: var(--s3); align-items: flex-start; border-bottom: 1px solid var(--border); }
.slidein .hd h2 { margin: 0; font-size: 18px; font-weight: 600; color: var(--text); }
.slidein .hd p { margin: 2px 0 0; color: var(--text-3); font-size: 14px; }
.slidein .bd { padding: var(--s5); overflow: auto; flex: 1; display: grid; gap: var(--s5); align-content: start; }
.slidein .ft { padding: var(--s4) var(--s5); border-top: 1px solid var(--border); display: flex; gap: var(--s3); justify-content: flex-end; background: var(--surface); }
.slidein .ft .btn { min-width: 96px; justify-content: center; }
.scrim.over { z-index: 44; }
.modal.account-menu { --tx: 0; left: 72px; top: auto; bottom: 12px; transform: none; width: min(340px, calc(100vw - 88px)); max-height: calc(100dvh - 24px); }
.modal.organization-menu { --tx: 0; left: 72px; top: auto; bottom: 12px; transform: none; width: min(380px, calc(100vw - 88px)); max-height: calc(100dvh - 24px); }
.context-notice { display: flex; align-items: flex-start; gap: 8px; padding: 10px 24px; background: var(--accent-weak); border-bottom: 1px solid var(--border); color: var(--text-2); font-size: 13px; }
.context-notice > span:first-child { flex: none; margin-top: 2px; }
.context-notice > span:nth-child(2) { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.context-notice > .icon-btn { flex: none; margin: -3px -5px -3px 0; }
@media (max-width: 600px) {
  .modal.organization-menu { left: 64px; width: calc(100vw - 72px); bottom: 8px; max-height: calc(100dvh - 16px); }
  .context-notice { padding: 10px 12px; }
}
@media (max-width: 900px) {
  .modal.account-menu { left: 64px; width: min(340px, calc(100vw - 80px)); }
}
.side-icons { position: sticky; top: var(--s4); display: flex; flex-direction: column; gap: 4px; padding: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.si { position: relative; width: 38px; height: 38px; display: grid; place-items: center; border: 0; border-radius: 8px; background: transparent; color: var(--text-3); cursor: pointer; }
.si:hover { background: var(--surface-3); color: var(--text); }
.si.on { background: var(--accent-weak); color: var(--accent); }
.si .ct { position: absolute; top: 1px; right: 1px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--accent); color: #fff; font: 700 10px/16px var(--font); font-style: normal; text-align: center; }
.si[data-tip]:hover::after { content: attr(data-tip); position: absolute; right: calc(100% + 8px); top: 50%; transform: translateY(-50%); white-space: nowrap; background: var(--text); color: var(--bg);
  font: 600 12px var(--font); padding: 5px 9px; border-radius: 6px; pointer-events: none; z-index: 60; }
.rec-grid { flex: 1; min-height: 0; display: grid; gap: 0; padding: 12px 8px 12px 12px; align-items: stretch; }
.rec-card { min-width: 0; min-height: 0; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.gutter { cursor: col-resize; position: relative; }
.gutter::after { content: ''; position: absolute; top: 50%; left: 50%; width: 4px; height: 36px; transform: translate(-50%, -50%); border-radius: 2px; background: var(--border-strong); opacity: .6; }
.gutter:hover::after { background: var(--accent); opacity: 1; }
.dd-menu { position: absolute; top: calc(100% + 4px); right: 0; min-width: 220px; z-index: 30; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-lg); padding: 6px; display: grid; gap: 2px; }
.dd-menu.up { top: auto; bottom: calc(100% + 6px); left: 0; right: auto; max-height: 60vh; overflow: auto; }
.dd-menu button, .dd-menu a { display: flex; align-items: center; gap: 8px; width: 100%; padding: 7px 10px; border: 0; border-radius: 6px; background: transparent; color: var(--text); font: 14px var(--font); text-align: left; cursor: pointer; }
.dd-menu button:hover, .dd-menu a:hover { background: var(--surface-2); text-decoration: none; }
.dd-menu button.on { background: var(--accent-weak); color: var(--accent); }
.rec-page .panel-header-icon { display: grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 9px; background: var(--accent-weak); color: var(--accent); }
.rec-page .panel-header-copy { flex: 1; min-width: 0; }
.rec-page .panel-header-copy h2 { font-size: 15px; font-weight: var(--title-weight); line-height: 1.4; overflow-wrap: anywhere; }
.rec-page .panel-header-copy p { margin: 3px 0 0; font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
.rec-page .panel-header-controls { display: flex; gap: 2px; flex: none; }
.rec-page .panel-header-controls .icon-btn:focus-visible, .rec-page .side-icons .si:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.rec-page .panel-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.rec-page .panel-actions .rr-link { min-height: 30px; }
.rec-page .panel-modal .panel-header { padding: max(12px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) 12px max(14px, env(safe-area-inset-left)); align-items: center; }
.rec-page .panel-modal .panel-header-controls .icon-btn { width: 44px; height: 44px; }
.rec-page .panel-modal .panel-actions .btn, .rec-page .panel-modal .panel-actions .rr-link, .rec-page .panel-modal .rr-scroll button { min-height: 44px; }
.rec-page .panel-modal .rr-scroll { padding-bottom: max(20px, env(safe-area-inset-bottom)); overscroll-behavior: contain; }
@media (max-width: 760px) {
  .rec-page .side-icons { padding: 4px; gap: 2px; }
  .rec-page .side-icons .si { width: 44px; height: 44px; }
}
@media (max-width: 1100px) {
  .rec-grid { padding: 8px; }
}
.rec-grid.overlay .rec-right { position: absolute; top: 12px; bottom: 12px; right: 72px; width: var(--rr); z-index: 20; box-shadow: var(--shadow-lg); }
.cmode { display: inline-flex; padding: 2px; border-radius: 8px; background: var(--surface-3); gap: 2px; }
.cmode button { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 9px; border: 0; border-radius: 6px; background: transparent; color: var(--text-2); font: 500 12px var(--font); cursor: pointer; }
.cmode button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(16,24,40,.08); }
.rec-dots { display: none; }
.rec-grid.columns .rec-stage { display: flex; flex-direction: column; flex: 1; min-width: 0; min-height: 0; }
.rec-grid.columns .rec-track { display: flex; gap: 12px; flex: 1; min-height: 0; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scroll-padding: 0 12px;
  overscroll-behavior-x: contain; scrollbar-width: none; padding: 2px 2px 4px; outline: none; }
.rec-grid.columns .rec-track::-webkit-scrollbar { display: none; }
.rec-grid.columns .gutter { display: none; }
.rec-grid.columns .rec-card { flex: 0 0 auto; scroll-snap-align: center; transition: box-shadow .2s, border-color .2s, opacity .2s; }
.rec-grid.columns .rec-card:first-child { scroll-snap-align: start; }
.rec-grid.columns .rec-card:last-child { scroll-snap-align: end; }
.rec-grid.columns .rec-track[data-card-framed] { scroll-padding-inline: 0; }
.rec-grid.columns .rec-card[data-frame-edge="start"] { scroll-snap-align: start; }
.rec-grid.columns .rec-card[data-frame-edge="end"] { scroll-snap-align: end; }
.rec-grid.columns .rec-card { width: calc(100% - 2 * (var(--peek) + 12px)); min-width: min(300px, 100%); max-width: 960px; }
.rec-grid.columns .rec-right { position: static; box-shadow: none; }
.rec-grid.columns .rec-card:not(.staged) { opacity: .82; }
.rec-grid.columns .rec-card.staged { border-color: color-mix(in srgb, var(--accent) 35%, var(--border)); box-shadow: 0 4px 16px rgba(16,24,40,.08); opacity: 1; }
.rec-grid.columns .side-icons { flex: none; margin-left: 0; }
.rec-grid.columns .rec-dots { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 0 0; flex: none; position: relative; }
.rec-dots .dot { width: 8px; height: 8px; padding: 0; border: 0; border-radius: 999px; background: var(--border-strong); cursor: pointer; transition: width .25s ease, background .25s ease; }
.rec-dots .dot:hover { background: var(--text-3); }
.rec-dots .dot.on { width: 24px; background: var(--accent); }
.rec-dots .dot-arrow { display: grid; place-items: center; width: 24px; height: 24px; border: 0; border-radius: 999px; background: transparent; color: var(--text-2); cursor: pointer; }
.rec-dots .dot-arrow:hover:not(:disabled) { background: var(--surface-3); color: var(--text); }
.rec-dots .dot-arrow:disabled { opacity: .3; cursor: default; }
.rec-dots .dot-label { position: absolute; right: 4px; font-size: 12px; color: var(--text-3); max-width: 30%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 760px) {
  .rec-dots .dot-label { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .rec-grid.columns .rec-track { scroll-behavior: auto; }
  .rec-dots .dot { transition: none; }
}
.rec-grid.columns.split .rec-card:not(.in-split) { display: none; }
.rec-grid.columns.split .rec-card.in-split { flex: 1 1 0; width: auto !important; min-width: 300px; opacity: 1; box-shadow: none; border-color: var(--border); }
.rec-dots .dot.on + .dot.on { margin-left: -2px; }
.rec-dots .dot-hint { position: absolute; left: 4px; font-size: 12px; color: var(--text-4); }
.split-chip { position: absolute; right: 4px; display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 8px 0 10px; border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--border));
  border-radius: 999px; background: var(--accent-weak); color: var(--accent); font: 600 12px var(--font); cursor: pointer; }
.split-chip:hover { background: color-mix(in srgb, var(--accent) 18%, var(--surface)); }
@media (max-width: 760px) {
  .rec-dots .dot-hint { display: none; }
  .rec-grid.columns.split .rec-card.in-split { min-width: 240px; width: auto !important; }
}
.slide-scrim { position: absolute; inset: 0 0 34px 0; background: rgba(16,24,40,.12); border-radius: 12px; z-index: 24; pointer-events: none; }
.rec-grid.columns .rec-card.rec-right.slide { display: flex; position: absolute; top: 2px; bottom: 38px; right: 2px; width: min(420px, calc(100% - 24px)) !important; z-index: 25; opacity: 1;
  border-color: var(--border); box-shadow: -12px 0 32px rgba(16,24,40,.16), 0 2px 6px rgba(16,24,40,.08); animation: slide-in .22s cubic-bezier(.2,.8,.2,1); }
@media (prefers-reduced-motion: reduce) {
  .rec-grid.columns .rec-card.rec-right.slide { animation: none; }
}
.rec-grid.columns.split .gutter.on { display: block; flex: none; width: 10px; }
.rec-grid.columns.split .rec-card.in-split { min-width: 260px; }
.rec-grid.columns .rec-card.mobile { width: var(--mw, 400px); min-width: min(var(--mw, 400px), 100%); max-width: var(--mw, 400px); }
.rec-grid.columns.split .rec-track { justify-content: flex-start; justify-content: safe center; }
.rec-grid.columns.split .rec-card.in-split.mobile { flex: 0 0 var(--mw, 400px); width: var(--mw, 400px) !important; min-width: 0; }
.rec-grid.columns.split .rec-card.in-split.content { min-width: min(var(--cmin, 480px), 100%); }
.rec-grid.columns .rec-card.rec-right.slide.mobile { width: min(var(--mw, 400px), calc(100% - 24px)) !important; max-width: none; }
.rec-grid.columns .rec-card.rec-right.slide.content { width: min(820px, calc(100% - 24px)) !important; max-width: none; }
.stage-track { list-style: none; margin: 0; padding: 0; display: flex; gap: 2px; overflow-x: auto; scrollbar-width: thin; }
.stage-track li { flex: 1 1 0; min-width: 84px; }
.stage-track .stage { position: relative; display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; height: 34px; padding: 0 14px 0 18px; border: 0; background: var(--surface-3);
  color: var(--text-2); font: 500 13px var(--font); clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 0 100%, 10px 50%); cursor: pointer; }
.stage-track li:first-child .stage { clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 0 100%); border-radius: 6px 0 0 6px; padding-left: 12px; }
.stage-track button.stage:hover:not(:disabled) { background: color-mix(in srgb, var(--accent) 16%, var(--surface-3)); color: var(--text); }
.stage-track .stage.done { background: color-mix(in srgb, var(--accent) 22%, var(--surface)); color: var(--accent); }
.stage-track .stage.on { background: var(--accent); color: #fff; font-weight: 600; }
.stage-track .stage i { font-style: normal; font-size: 11px; padding: 0 6px; border-radius: 999px; background: rgba(255,255,255,.25); }
.stage-track.sm .stage { height: 26px; font-size: 12px; cursor: default; }
.stage-track.sm .stage:not(.on) i { background: var(--surface); }
.rec-grid .rec-card[data-kind="pipeline"] .ag-empty { padding: 12px 4px; }
.rec-grid.columns .pipe-slide { bottom: 38px; }
.dot-st { width: 8px; height: 8px; border-radius: 999px; background: var(--border-strong); margin-left: auto; flex: none; }
.dot-st.on { background: #12B76A; }
.chip.warn { background: #FFFAEB; color: #B54708; }
.chip.sm { font-size: 10px; padding: 1px 6px; }
.chip.off { opacity: .5; text-decoration: line-through; }
.rec-card[data-kind="pipeline"] .pc-head { padding: 4px 2px 10px; border-bottom: 0; }
.rec-card[data-kind="pipeline"] .pc-head h2 { font-size: 12px; font-weight: var(--title-weight); text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); }
.rec-card[data-kind="pipeline"] .pc-scroll { padding: 0 2px 8px; }
.rec-card[data-kind="pipeline"] .pc-field { display: none; }
.rec-card[data-kind="pipeline"] .pstack { gap: 8px; }
.rec-card[data-kind="pipeline"] .pstack::before { display: none; }
.rec-card[data-kind="pipeline"] .pblock { min-height: 48px; border-radius: 12px; box-shadow: 0 1px 2px rgba(16,24,40,.06); }
.rec-card[data-kind="pipeline"] .pblock:hover { transform: translateY(-1px); box-shadow: 0 4px 10px rgba(16,24,40,.10); }
.rec-card[data-kind="pipeline"] .pblock.later { background: var(--surface); }
.rec-card[data-kind="pipeline"] .pblock.current { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent), 0 4px 12px rgba(21,94,239,.18); }
.rec-card[data-kind="pipeline"] .pblock.done, .rec-card[data-kind="pipeline"] .pblock.fold { min-height: 36px; background: color-mix(in srgb, var(--surface) 70%, transparent); box-shadow: none; }
.rec-card[data-kind="pipeline"] .pblock { transition: transform .12s, box-shadow .15s, border-color .15s; }
@media (prefers-reduced-motion: reduce) {
  .rec-card[data-kind="pipeline"] .pblock { transition: none; }
  .rec-card[data-kind="pipeline"] .pblock:hover { transform: none; }
}
.rec-dots .dot.dragging { width: 26px; height: 12px; background: var(--accent); }
.side-icons .si.dragging { background: var(--surface); outline: 2px solid var(--accent); }
.side-icons.reordering [data-reorder].drop-before { box-shadow: 0 -3px 0 var(--accent); }
.side-icons .si.docked { position: relative; }
.side-icons .si.docked::after { content: ''; position: absolute; left: 4px; top: 50%; width: 3px; height: 14px; transform: translateY(-50%); border-radius: 2px; background: var(--accent); }
.signin-card { width: min(400px, 100%); background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 28px; display: grid; gap: 14px; box-shadow: var(--shadow-lg); }
.signin-card h1 { margin: 0; font-size: 22px; }
.signin-brand { display: flex; align-items: center; gap: 10px; font-size: 16px; }
.signin-brand .mark { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--accent); color: #fff; font-weight: 800; }
.drill-track { --peek: clamp(24px, 6%, 120px); flex: 1; min-height: 0; display: flex; gap: 12px; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x proximity; padding: 12px 16px 6px;
  scrollbar-width: none; overscroll-behavior-x: contain; }
.drill-track::-webkit-scrollbar { display: none; }
.drill-card { flex: 0 0 auto; display: flex; flex-direction: column; min-height: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; overflow: hidden;
  scroll-snap-align: center; transition: border-color .2s, box-shadow .2s, opacity .2s; }
.drill-card:first-child { scroll-snap-align: start; }
.drill-card:last-child { scroll-snap-align: end; }
.drill-card.mobile { width: min(380px, calc(100% - 40px)); }
.drill-card.content { width: min(960px, calc(100% - 2 * var(--peek) - 24px)); min-width: min(480px, calc(100% - 40px)); }
.drill-card.focus { border-color: color-mix(in srgb, var(--accent) 35%, var(--border)); box-shadow: 0 4px 16px rgba(16,24,40,.08); }
.drill-card:not(.focus) { opacity: .9; }
.drill-hd { display: flex; align-items: center; gap: 8px; padding: 14px 16px; border-bottom: 1px solid var(--border); min-height: 52px; }
.drill-hd h2 { margin: 0; font-size: 15px; font-weight: var(--title-weight); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drill-bd { flex: 1; min-height: 0; overflow: auto; padding: 12px 16px 16px; }
.drill-row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; border-radius: 8px; background: transparent; color: var(--text); text-align: left; cursor: pointer; font: 14px var(--font); min-width: 0; }
.drill-row:hover { background: var(--surface-2); }
.drill-row.on { background: var(--accent-weak); color: var(--accent); }
.drill-row .ct { margin-left: auto; color: var(--text-3); font-size: 12px; font-variant-numeric: tabular-nums; flex: none; }
.drill-row .chev { color: var(--text-4); flex: none; }
.drill-group { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); padding: 10px 10px 4px; }
.drill-nav { display: flex; align-items: center; gap: 12px; padding: 4px 16px 10px; min-height: 36px; }
.drill-crumbs { display: flex; align-items: center; gap: 2px; min-width: 0; flex: 1; overflow: hidden; }
.drill-crumb { display: inline-flex; align-items: center; gap: 2px; min-width: 0; color: var(--text-4); }
.drill-crumb button { border: 0; background: transparent; padding: 2px 6px; border-radius: 6px; font: 13px var(--font); color: var(--text-2); cursor: pointer; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drill-crumb button:hover { background: var(--surface-2); }
.drill-crumb button.on { color: var(--text); font-weight: 600; }
.drill-dots { display: flex; padding: 0; position: static; }
@media (max-width: 700px) {
  .drill-nav .drill-crumbs { display: none; }
}
.drill-card.drill-pad { overflow: auto; padding: var(--s5); display: block; }
.drill-inline { display: flex; flex-direction: column; height: calc(100vh - 230px); min-height: 360px; margin: 0 -16px; }
.drill-card .drill-bd > .stack > .card { box-shadow: none; }
.drill-card .drill-bd.stack { padding: 0; gap: 0; }
.drill-card .drill-bd > .stack { gap: 0; }
.drill-card .drill-bd > .stack > .card, .drill-card .drill-bd > .card { border: 0; border-radius: 0; box-shadow: none; background: transparent; }
.drill-card .drill-bd > .stack > .card + .card { border-top: 1px solid var(--border); }
.drill-card .drill-bd > .stack > .card > .hd { position: sticky; top: 0; z-index: 2; background: var(--surface); }
.drill-card .drill-bd > .stack > .card .t thead th { position: sticky; top: 56px; z-index: 1; }
.drill-card .list-row:focus-visible, .drill-card .drill-row:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.dd-menu.up.tpl-menu { left: auto; right: 0; }
.drill-card { position: relative; transition: border-color .2s, box-shadow .2s; }
.drill-card:not(.focus) { opacity: 1; }
.drill-card.mobile { width: 380px; flex: 0 0 auto; }
.drill-card.content { width: 720px; min-width: 420px; flex: 0 0 auto; }
.drill-card.drill-last { flex: 1 0 auto; width: auto; min-width: min(560px, calc(100% - 40px)); }
.drill-card.mobile.drill-last { min-width: 380px; max-width: none; }
.drill-card.focus { border-color: var(--border); box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 28%, transparent), 0 6px 18px rgba(16,24,40,.07); }
.drill-handle { position: absolute; top: 0; right: -8px; bottom: 0; width: 10px; cursor: col-resize; z-index: 3; }
.drill-handle::after { content: ''; position: absolute; top: 50%; left: 4px; width: 3px; height: 36px; border-radius: 3px; transform: translateY(-50%); background: var(--border-strong); opacity: 0; transition: opacity .15s; }
.drill-card:hover > .drill-handle::after, .drill-card.resizing > .drill-handle::after { opacity: 1; }
.drill-handle:hover::after, .drill-card.resizing > .drill-handle::after { background: var(--accent); }
.drill-nav { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; padding: 2px 16px 10px; min-height: 34px; }
.drill-nav .drill-dots { justify-self: center; }
.drill-nav.single .drill-dots { display: none; }
.drill-card.content:not(.drill-last) { width: clamp(420px, 40%, 640px); }
.drill-card.mobile:not(.drill-last) { width: clamp(300px, 30%, 380px); }
.drill-card.drill-last { min-width: min(480px, calc(100% - 24px)); }
.drill-handle { right: -6px; width: 8px; }
.drill-card.drill-last { flex: 1 1 0; width: auto; }
.si-caption { font-size: 11px; line-height: 1.25; white-space: normal; }
.drill-card.as-drawer { top: 0; right: 0; bottom: 0; border-radius: 12px 0 0 12px; width: min(820px, calc(100vw - 80px)) !important; z-index: 48; }
.drill-card.as-modal { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); width: min(760px, calc(100vw - 48px)) !important; min-width: 0 !important;
  height: min(80vh, 760px); z-index: 48; box-shadow: 0 24px 64px rgba(16,24,40,.28); animation: drill-pop .18s ease-out; }
@media (prefers-reduced-motion: reduce) {
  .drill-card.as-slide, .drill-card.as-drawer, .drill-card.as-modal { animation: none; }
}
.drill-hd > .drill-pop { margin-left: auto; flex: none; }
.drill-card > .drill-pop { position: absolute; top: 12px; right: 12px; z-index: 4; background: var(--surface); }
.drill-card .drill-x { position: absolute; top: 12px; right: 12px; z-index: 4; background: var(--surface); }
.drill-card.as-slide .drill-hd, .drill-card.as-drawer .drill-hd, .drill-card.as-modal .drill-hd { padding-right: 52px; }
.drill-card.as-slide > .drill-handle, .drill-card.as-drawer > .drill-handle, .drill-card.as-modal > .drill-handle { display: none; }
.drill-scrim { position: fixed; inset: 0; background: rgba(16,24,40,.32); z-index: 47; }
.drill-mode-menu { position: fixed; top: auto; right: auto; min-width: 200px; z-index: 60; }
.rec-dots .dot.over { background: color-mix(in srgb, var(--accent) 40%, var(--border-strong)); outline: 2px solid color-mix(in srgb, var(--accent) 35%, transparent); outline-offset: 1px; }
.drill-nav.has-slide .drill-dots, .drill-nav.has-slide .drill-crumb button { position: relative; z-index: 47; }
.drill-nav .drill-dots .dot { flex: none; display: block; height: 8px; margin: 0; }
.drill-nav .drill-dots .dot.on + .dot.on { margin-left: 0; }
.drill-nav .drill-dots .dot.over { outline: 0; box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 30%, transparent); }
.drill-card.as-slide.from-left { right: auto; left: 64px; border-left: 0; border-right: 1px solid var(--border); animation-name: drill-slide-l; }
@media (max-width: 900px) {
  .drill-card.as-slide.from-left, .shell:has(.cascade.pinned:not([style*="display: none"])) .drill-card.as-slide.from-left { left: 56px; }
}
.drill-card.as-slide.slide-under { visibility: hidden; pointer-events: none; animation: none; }
.drill-card.as-slide:has(> .slide-back) { animation: drill-cascade .18s cubic-bezier(.2,.8,.2,1); }
.drill-card.as-slide:has(> .slide-back) > .drill-x { top: 52px; }
@media (prefers-reduced-motion: reduce) {
  .drill-card.as-slide.from-left, .drill-card.as-slide:has(> .slide-back) { animation: none; }
}
.dot-live { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px var(--ok-weak); }
.chip.inh { background: transparent; border: 1px dashed var(--border-strong); color: var(--text-2); }
.sheet-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.sheet-card { display: grid; gap: 8px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: inherit; text-decoration: none; transition: border-color .15s, box-shadow .15s; }
.sheet-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm, 0 1px 3px rgba(16,24,40,.08)); }
.sheet-mini { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.sheet-mini span { display: grid; place-items: center; gap: 1px; padding: 6px 0; border-radius: 8px; background: var(--surface-2); border-top: 3px solid var(--c); }
.sheet-mini b { font-size: 16px; }
.sheet-mini i { font-style: normal; font-size: 11px; color: var(--text-3); }
.sheet-pos { display: inline-grid; place-items: center; min-width: 38px; height: 22px; padding: 0 7px; border-radius: 6px; background: color-mix(in srgb, var(--c, var(--accent)) 16%, transparent); color: var(--c, var(--accent)); font: 700 12px var(--font); flex: none; }
.sheet-search { width: 240px; }
.sheet-search .input { width: 100%; }
.sheet-metrics-bar { display: flex; align-items: stretch; gap: 8px; margin-top: var(--s3); padding: 4px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.sheet-metrics { display: grid; grid-template-columns: repeat(5, minmax(100px, 1fr)); flex: 1; min-width: 0; overflow-x: auto; }
.sheet-metric { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border: 0; border-radius: 6px; background: transparent; text-align: left; font: inherit; color: inherit; cursor: pointer; min-width: 0; }
.sheet-metric + .sheet-metric { border-left: 1px solid var(--border); }
.sheet-metric:hover { background: var(--surface-2); }
.sheet-metric-label { display: flex; align-items: center; gap: 6px; min-width: 0; color: var(--text-2); font-size: 12px; }
.sheet-metric-label > span:first-child { flex: none; color: var(--text-3); }
.sheet-metric b { flex: none; font-size: 20px; line-height: 1.1; }
.sheet-metrics-more { flex: none; align-self: center; }
.sheet-metrics-more > span:last-child { display: flex; }
.sheet-metrics-more .open { transform: rotate(180deg); }
.sheet-metric-details { margin-top: 10px; padding: 12px; max-height: min(260px, 20vh); overflow: auto; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.sheet-progress { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; }
.sheet-progress-item { display: grid; align-content: start; gap: 6px; min-width: 0; }
.sheet-progress-item .meter { height: 4px; }
.sheet-alerts { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.sheet-alert { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; border: 0; font: 500 12px var(--font); cursor: pointer; background: var(--warn-weak); color: var(--warn); }
.sheet-alert.danger { background: var(--danger-weak); color: var(--danger); }
.sheet-body { flex: 1; min-height: 0; overflow: auto; padding: 4px 24px 40px; display: flex; flex-direction: column; gap: 14px; }
.empty.sm { padding: 18px; }
.empty.sm p { margin: 0; }
@media (max-width: 900px) {
  .sheet-progress { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .sheet-search { width: 100%; order: 9; }
  .sheet-body { padding: 4px 12px 40px; }
}
@media (max-width: 650px) {
  .sheet-metrics { grid-template-columns: repeat(5, minmax(90px, 1fr)); }
  .sheet-progress { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sheet-metric { gap: 8px; padding: 8px; }
}
.sheet-head-controls .sheet-next-split { position: static; flex: none; }
.sheet-head-controls .sheet-routine-menu { left: auto; right: 0; width: min(320px, calc(100vw - 16px)); min-width: 0; max-width: calc(100% - 8px); max-height: calc(100vh - 150px); overflow-y: auto; z-index: 60; }
.sheet-routine-copy { display: grid; flex: 1; min-width: 0; white-space: normal; overflow-wrap: anywhere; }
.sheet-head-controls .sheet-targeting-icon { display: none; }
@media (max-width: 560px) {
  .sheet-page .sheet-head .sheet-head-controls .sheet-targeting-toggle { width: 32px; max-width: 32px; padding: 0 3px; justify-content: center; }
  .sheet-head-controls .sheet-targeting-label, .sheet-head-controls .sheet-targeting-word { display: none; }
  .sheet-head-controls .sheet-targeting-icon { display: inline-flex; }
  .sheet-head-controls .sheet-targeting-rings { width: 24px; height: 24px; }
}
.sheet-page .sheet-cadence { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sheet-page .sheet-head .sheet-metric-details { position: fixed; top: 0; bottom: 0; left: auto; right: 0; z-index: 148; width: min(540px, 100vw); margin: 0; max-height: none; padding: 20px; border-radius: 0; box-shadow: var(--shadow-lg); }
.sheet-metric-details .sheet-progress { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 700px) {
  .sheet-page .sheet-cadence { display: none; }
}
.sheet-page .aging-drawer.open { flex-shrink: 1; min-height: 40px; }
@media (max-width: 560px) {
  .sheet-page .ad-bar { gap: 4px; min-width: 0; }
  .sheet-page .ad-bar > .btn { flex: none; padding-left: 8px; padding-right: 8px; }
  .sheet-page .ad-bar > .btn.icon-only { width: 32px; padding: 0; }
  .sheet-page .ad-toggle { gap: 6px; }
  .sheet-page .ad-label { min-width: 0; }
  .sheet-page .ad-progress { flex: none; white-space: nowrap; }
  .sheet-page .ad-source-status { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}
.sheet-targets .st-lbl { align-self: center; margin-right: 4px; }
.sheet-targeting-rings { display: block; flex: none; width: 28px; height: 28px; overflow: visible; }
.sheet-targeting-rings circle { fill: none; stroke-width: 2; }
.sheet-targeting-rings .targeting-ring-track { stroke: var(--border); }
.sheet-targeting-rings .targeting-ring-time { stroke: var(--accent); stroke-linecap: round; }
.sheet-targeting-rings .targeting-ring-work { stroke: var(--text-2); stroke-linecap: round; }
.sheet-targeting-label { display: grid; min-width: 0; text-align: left; font-variant-numeric: tabular-nums; line-height: 12px; }
.sheet-targeting-label > b { overflow: hidden; text-overflow: ellipsis; font-size: 11px; font-weight: 600; }
.sheet-targeting-label > span { overflow: hidden; text-overflow: ellipsis; color: var(--text-3); font-size: 10px; }
.sheet-targeting-scrim { position: fixed; inset: 0; z-index: 151; background: var(--polish-scrim); }
.sheet-page .sheet-targeting-options { z-index: 152; }
.sheet-targeting-current { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 20px; padding: 12px; border: 1px solid var(--border); border-radius: 8px; }
.sheet-targeting-current .sheet-targeting-rings { width: 88px; height: 88px; }
.sheet-targeting-current > div { display: grid; flex: 1; min-width: 0; gap: 4px; }
.sheet-targeting-total { font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; }
.sheet-targeting-legend { width: 100%; margin: 0; font-size: 11px; }
.sheet-targeting-options .field { margin: 0; }
.sheet-overview .sheet-overview-head { flex: none; padding: 4px 0; border-bottom: 1px solid var(--border); }
.sheet-overview-head .row1 { min-height: 36px; }
.sheet-overview-head h1 { font-size: 18px; }
.sheet-overview .sheet-overview-scroll { display: flex; flex: 1; flex-direction: column; gap: 6px; min-height: 0; min-width: 0; padding: 0 0 8px; overflow: auto; }
.sheet-head > .bulkbar { position: absolute; top: 100%; left: 0; right: 0; z-index: 45; margin: 0; border-bottom: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow-sm); }
.sheet-list-insight { padding: 14px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); }
.sheet-list-insight-heading, .sheet-options-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 28px; margin-bottom: 10px; }
.sheet-list-insight-heading h3, .sheet-options-section-heading h3 { min-width: 0; margin: 0; color: var(--text); font: 600 13px/1.4 var(--font); }
.sheet-list-insight-heading > span { flex: none; font-size: 11px; }
.sheet-list-insight-stats { display: grid; grid-template-columns: 1fr 1.35fr; gap: 16px; margin: 0; }
.sheet-list-insight-stats > div + div { padding-left: 16px; border-left: 1px solid var(--border); }
.sheet-list-insight-stats dt { margin-bottom: 3px; color: var(--text-3); font-size: 11px; }
.sheet-list-insight-stats dd { margin: 0; color: var(--text); font-size: 19px; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.4; }
.sheet-list-insight-stats > div + div dd { font-size: 15px; }
.sheet-options-scope { margin: 10px 0 0; color: var(--text-3); font-size: 11px; }
.sheet-options-direction { display: flex; align-items: flex-start; gap: 8px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border); }
.sheet-options-direction > span { display: flex; flex: none; margin-top: 2px; color: var(--text-3); }
.sheet-options-direction p { margin: 0; color: var(--text-2); font-size: 12px; line-height: 1.5; }
.sheet-list-insight > .btn { margin-top: 8px; }
.sheet-options-section + .sheet-options-section { padding-top: 16px; border-top: 1px solid var(--border); }
.sheet-options-section-heading > .btn { margin: -4px 0; }
.sheet-options-section-heading > span { font-size: 11px; }
.sheet-list-options .sheet-options-query, .sheet-list-options .sheet-options-query .input { width: 100%; }
.sheet-options-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.sheet-options-controls > .small { margin-left: auto; font-size: 11px; }
.sheet-options-sheet-query { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; padding-left: 8px; border-left: 2px solid var(--border-strong); }
.sheet-options-sheet-query > span { min-width: 0; overflow-wrap: anywhere; }
.sheet-options-display-controls { justify-content: space-between; }
.sheet-options-page { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.sheet-options-page > label { margin-right: auto; gap: 8px; }
.sheet-options-page .select { width: auto; }
.sheet-options-saved .smartlist-toolbar, .sheet-options-saved .smartlist-pagination { display: none; }
.sheet-list-options .sheet-options-saved { min-width: 0; overflow: visible; }
.sheet-list-options .sheet-options-saved .smartlist-header { display: block; height: auto; min-height: 0; max-height: none; overflow: visible; }
.sheet-list-options .sheet-options-saved .smartlist-views { align-items: center; flex-wrap: wrap; height: auto; min-height: 0; max-height: none; padding-bottom: 8px; overflow: visible; border-bottom: 0; }
.sheet-list-options .sheet-options-saved .smartlist-view { height: auto; max-width: 100%; white-space: normal; overflow-wrap: anywhere; text-align: left; }
.sheet-list-options .sheet-options-saved .smartlist-label { flex-basis: 100%; width: auto; margin-bottom: 2px; }
.sheet-list-options .sheet-options-saved .smartlist-state { margin-left: 0; white-space: normal; flex-wrap: wrap; }
.sheet-page .sheet-tab[data-group="1"] { --tab-flash: #3b82f6; }
.sheet-page .sheet-tab[data-group="2"] { --tab-flash: #0d9488; }
.sheet-page .sheet-tab[data-group="3"] { --tab-flash: #9366c5; }
.rec-grid.rec-stage-navigation-enabled > .side-icons { min-height: 0; max-height: 100%; overflow-y: auto; }
.rec-navigation-modes .rec-nav-entry { display: inline-flex; align-items: center; flex: none; }
.rec-navigation-modes .rec-nav-separator { flex: none; margin: 0 10px; color: var(--text-3); }
.rec-grid.columns .rec-dots.rec-nav-labels { min-width: 0; max-width: 100%; justify-content: flex-start; gap: 0; overflow-x: auto; overflow-y: hidden; padding: 6px 4px 2px; scroll-padding-inline: 4px; }
.rec-nav-labels .dot, .rec-nav-labels .dot.on { flex: none; width: auto; height: auto; min-height: 28px; padding: 3px 2px; border-radius: 3px; background: transparent; color: var(--text-2); font-size: 12px; line-height: 20px; white-space: nowrap; transition: none; }
.rec-nav-labels .dot.on { color: var(--accent); font-weight: 600; }
.rec-nav-labels .dot:hover { background: var(--surface-3); color: var(--text); }
.rec-nav-labels .dot:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.rec-nav-labels .split-chip { position: static; flex: none; margin-left: 12px; }
.rec-navigation-toggle { font-size: 10px; font-weight: 600; }
/* Base surface rules (app.css lines 14, 167, 210-212, 279-280; polish.css 218). */
.icon { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: var(--icon-stroke); stroke-linecap: round; stroke-linejoin: round; display: inline-block; vertical-align: -3px; }
.scrim { position: fixed; inset: 0; background: rgba(10, 16, 24, .38); z-index: 40; animation: fade var(--med) var(--ease); }
@keyframes fade { from { opacity: 0 } }
@keyframes slide { from { transform: translateX(24px); opacity: 0 } }
@keyframes rise { from { transform: translate(var(--tx, 0), 8px); opacity: 0 } }
.slidein { position: fixed; top: 0; right: 0; bottom: 0; width: min(500px, 100vw); background: var(--surface); z-index: 45; display: flex; flex-direction: column;
  box-shadow: var(--shadow-lg), -1px 0 0 var(--border); animation: slide var(--med) var(--ease); border-left: 1px solid var(--border); }
@media (prefers-reduced-motion: reduce) { .slidein, .drawer, .modal, .scrim { animation: none; } }
/* Columns mode base (app.css 763-766, 677): the card track and the control rail sit side by side. */
.rec-stage, .rec-track { display: contents; }
.rec-grid .side-icons { position: static; margin-left: 8px; align-self: start; }
.rec-grid.columns { display: flex; gap: 8px; }
/* Columns peek (app.css 778-779): every card leaves room for its neighbours to peek in so you can tell there is more. */
.rec-grid.columns .rec-track { --peek: clamp(40px, 16%, 200px); }
