/* ════════════════════════════════════════════════════════════════════════════
   BLACKSYNQ Console — design system
   Brand: near-black canvas · white text · #6a5bfd. Apple-native type (no web fonts).
   Motion is GPU-only (transform/opacity), ≤200ms, and respects reduced-motion.
   Order: tokens → base → motion → layout → sidebar → components → responsive.
   ════════════════════════════════════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; }

:root {
  /* Light default (mirrors the client dashboard); dark via [data-theme="dark"] below. */
  /* ── surfaces ── */
  --bg:#f4f4f6; --bg-2:#eeeef1;
  --panel:#ffffff; --panel-2:#f7f7f9; --panel-3:#eeeef1;
  --line:#e6e6ea; --line-2:#d9d9e0;
  /* ── ink ── */
  --fg:#0d0d0f; --fg-2:#42424c; --mut:#8a8a93;
  /* ── brand accent ── */
  --acc:#6a5bfd; --acc-2:#5749e6; --acc-press:#5749e6;
  --acc-soft:rgba(106,91,253,.12); --acc-dim:#e9e6ff;
  --acc-grad:linear-gradient(135deg,#6a5bfd,#8b7bff);
  /* ── status ── */
  --ok:#1f9d57; --bad:#e0455a; --warn:#b5790a;
  --ok-soft:rgba(31,157,87,.12); --bad-soft:rgba(224,69,90,.12); --warn-soft:rgba(181,121,10,.12);
  /* ── radius / elevation ── */
  --r:14px; --r-md:11px; --r-sm:8px; --r-xs:6px;
  --sh-1:0 1px 2px rgba(16,16,24,.06),0 1px 3px rgba(16,16,24,.04);
  --sh-2:0 4px 14px rgba(16,16,24,.08),0 2px 6px rgba(16,16,24,.05);
  --sh-3:0 18px 50px rgba(16,16,24,.18),0 6px 18px rgba(16,16,24,.10);
  --glow:0 0 0 3px var(--acc-soft);
  --header-bg:rgba(255,255,255,.72);
  --sidebar-w:260px;
  /* ── motion ── */
  --ease:cubic-bezier(.4,0,.2,1); --ease-out:cubic-bezier(.16,1,.3,1); --ease-spring:cubic-bezier(.34,1.56,.64,1);
  --t-fast:.12s; --t:.18s; --t-slow:.26s;
  font-synthesis:none;
  color-scheme:light;
}
[data-theme="dark"] {
  /* ── surfaces (near-black, faint violet cast) ── */
  --bg:#08080a; --bg-2:#0d0d10;
  --panel:#131318; --panel-2:#191920; --panel-3:#22222b;
  --line:#26262f; --line-2:#34343f;
  /* ── ink ── */
  --fg:#f6f6f8; --fg-2:#b4b4c0; --mut:#74747e;
  /* ── brand accent ── */
  --acc-2:#8b7bff;
  --acc-soft:rgba(106,91,253,.14); --acc-dim:#221d44;
  /* ── status ── */
  --ok:#4ec479; --bad:#f0626b; --warn:#e0a93b;
  --ok-soft:rgba(78,196,121,.12); --bad-soft:rgba(240,98,107,.12); --warn-soft:rgba(224,169,59,.12);
  /* ── elevation ── */
  --sh-1:0 1px 2px rgba(0,0,0,.4);
  --sh-2:0 6px 20px rgba(0,0,0,.38);
  --sh-3:0 24px 64px rgba(0,0,0,.55);
  --header-bg:rgba(8,8,10,.72);
  color-scheme:dark;
}

/* ── base ── */
html, body { height:100%; }
body { margin:0; background:var(--bg); color:var(--fg);
  font:14px/1.55 -apple-system,BlinkMacSystemFont,"SF Pro Text","Segoe UI",Roboto,Helvetica,sans-serif;
  -webkit-font-smoothing:antialiased; text-rendering:optimizeLegibility; overflow:hidden;
  transition:background var(--t) var(--ease), color var(--t) var(--ease); }
.mono { font-family:ui-monospace,"SF Mono",SFMono-Regular,Menlo,Consolas,monospace; font-size:12.5px; letter-spacing:-.01em; }
.mut { color:var(--mut); } .fg2 { color:var(--fg-2); }
a { color:var(--acc-2); text-decoration:none; } a:hover { color:var(--acc); }
::selection { background:var(--acc-soft); color:#fff; }
:focus-visible { outline:none; box-shadow:var(--glow); border-radius:var(--r-xs); }
::-webkit-scrollbar { width:10px; height:10px; }
::-webkit-scrollbar-thumb { background:var(--line-2); border-radius:6px; border:2px solid transparent; background-clip:content-box; }
::-webkit-scrollbar-thumb:hover { background:var(--mut); background-clip:content-box; }

/* ── motion keyframes ── */
@keyframes fade-in { from { opacity:0; } to { opacity:1; } }
@keyframes rise { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:none; } }
@keyframes pop { from { opacity:0; transform:scale(.96) translateY(6px); } to { opacity:1; transform:none; } }
@keyframes sheet-up { from { transform:translateY(24px); opacity:.6; } to { transform:none; opacity:1; } }
@keyframes shimmer { from { background-position:-450px 0; } to { background-position:450px 0; } }
@keyframes indeterminate { 0% { left:-40%; width:40%; } 50% { width:55%; } 100% { left:100%; width:40%; } }
@keyframes pulse-dot { 0%,100% { opacity:1; } 50% { opacity:.35; } }
@keyframes toast-in { from { opacity:0; transform:translateY(12px) scale(.98); } to { opacity:1; transform:none; } }

.stagger > * { animation:rise var(--t-slow) var(--ease-out) both; }
.stagger > *:nth-child(2){animation-delay:.03s} .stagger > *:nth-child(3){animation-delay:.06s}
.stagger > *:nth-child(4){animation-delay:.09s} .stagger > *:nth-child(5){animation-delay:.12s}
.stagger > *:nth-child(6){animation-delay:.15s} .stagger > *:nth-child(n+7){animation-delay:.18s}
::view-transition-old(root),::view-transition-new(root){ animation-duration:var(--t); }

/* ── top progress bar ── */
#progress { position:fixed; top:0; left:0; right:0; height:2px; z-index:100; pointer-events:none; opacity:0; transition:opacity .3s; }
#progress.on { opacity:1; }
#progress::after { content:""; position:absolute; top:0; height:100%; background:var(--acc-grad); box-shadow:0 0 8px var(--acc); animation:indeterminate 1.1s var(--ease) infinite; }

/* ── header ── */
header { display:flex; align-items:center; gap:12px; padding:0 16px; height:56px; flex:none;
  background:var(--header-bg); backdrop-filter:saturate(160%) blur(14px); border-bottom:1px solid var(--line); position:relative; z-index:30; }
/* white logo is baked into logo.svg — invert it on the light header (mirrors the client) */
:root header .brand img { filter:invert(1); }
[data-theme="dark"] header .brand img { filter:none; }
header .brand { display:flex; align-items:center; gap:9px; }
header .brand img { height:17px; display:block; }
header .brand-sub { color:var(--mut); font-size:12.5px; font-weight:500; letter-spacing:.02em; }
header .spacer { flex:1; }
.icon-btn { display:none; width:36px; height:36px; align-items:center; justify-content:center; padding:0; }
/* always-visible header theme toggle (unlike .icon-btn, which is mobile-only) */
.theme-btn { display:inline-flex; width:34px; height:34px; align-items:center; justify-content:center; padding:0; border:1px solid var(--line); background:var(--panel); color:var(--fg-2); border-radius:var(--r-sm); cursor:pointer; transition:background var(--t-fast),color var(--t-fast),border-color var(--t-fast); }
.theme-btn:hover { color:var(--fg); border-color:var(--line-2); background:var(--panel-2); }
.theme-btn svg { width:17px; height:17px; }
.icon-btn svg { width:18px; height:18px; }

/* search */
.search { position:relative; }
.search svg { position:absolute; left:10px; top:50%; transform:translateY(-50%); width:15px; height:15px; color:var(--mut); pointer-events:none; }
#search { width:230px; padding-left:32px; padding-right:46px; background:var(--panel); }
.search kbd { position:absolute; right:8px; top:50%; transform:translateY(-50%); font:11px/1 ui-monospace,monospace;
  color:var(--mut); background:var(--panel-3); border:1px solid var(--line-2); border-radius:5px; padding:3px 5px; pointer-events:none; }

/* ── system status cluster (replaces the 3 cramped pills) ── */
.status { position:relative; }
.status-btn { display:flex; align-items:center; gap:8px; padding:6px 11px; border-radius:20px;
  background:var(--panel); border:1px solid var(--line); color:var(--fg-2); font-size:12px; cursor:pointer; transition:border-color var(--t),background var(--t); }
.status-btn:hover { border-color:var(--line-2); background:var(--panel-2); }
.status-btn .dot { width:7px; height:7px; border-radius:50%; background:var(--mut); flex:none; }
.status-btn .dot.ok { background:var(--ok); box-shadow:0 0 7px var(--ok); }
.status-btn .dot.warn { background:var(--warn); box-shadow:0 0 7px var(--warn); }
.status-btn .dot.bad { background:var(--bad); box-shadow:0 0 7px var(--bad); }
.popover { position:absolute; right:0; top:calc(100% + 8px); width:300px; background:var(--panel); border:1px solid var(--line-2);
  border-radius:var(--r-md); box-shadow:var(--sh-3); padding:14px; z-index:40; animation:pop var(--t) var(--ease-out) both; }
.popover .row-kv { display:flex; align-items:center; justify-content:space-between; gap:10px; padding:7px 0; border-bottom:1px solid var(--line); }
.popover .row-kv:last-of-type { border-bottom:0; }
.popover .row-kv .k { color:var(--mut); font-size:12px; } .popover .row-kv .v { font-size:12.5px; display:flex; align-items:center; gap:7px; }
.popover .actions { display:flex; gap:8px; margin-top:12px; } .popover .actions button { flex:1; }

/* hover/focus help tooltip (single body-level node, positioned in JS) */
.tip { position:fixed; z-index:50; max-width:240px; pointer-events:none; opacity:0;
  background:var(--panel-2); border:1px solid var(--line-2); border-radius:var(--r-sm);
  box-shadow:var(--sh-2); padding:7px 10px; font-size:12px; line-height:1.45; color:var(--fg-2); }
.tip.show { opacity:1; animation:pop var(--t-fast) var(--ease-out); }

/* ── layout ── */
.layout { display:grid; grid-template-columns:var(--sidebar-w) 1fr; height:calc(100% - 56px); }
aside { border-right:1px solid var(--line); background:var(--bg-2); display:flex; flex-direction:column; overflow:hidden; }
.side-scroll { flex:1; overflow-y:auto; padding:12px 10px; }
/* account cluster pinned to the sidebar bottom */
.side-foot { flex:none; margin-top:auto; padding:10px; border-top:1px solid var(--line); display:flex; flex-direction:column; gap:8px; }
.side-foot .acct { display:flex; align-items:center; gap:9px; padding:2px 4px; }
.side-foot .acct .ava { width:30px; height:30px; border-radius:9px; background:var(--panel-3); color:var(--fg); font-size:13px; display:flex; align-items:center; justify-content:center; font-weight:700; flex:none; }
.side-foot .acct .meta { overflow:hidden; }
.side-foot .acct .meta .e { font-size:12.5px; font-weight:560; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.side-foot .row2 { display:flex; gap:8px; align-items:center; }
.side-foot .row2 .sm { display:inline-flex; align-items:center; justify-content:center; gap:6px; }
.side-foot .row2 .sm .i svg { width:15px; height:15px; }

/* ── login screen (Google sign-in) ── */
body.login header, body.login .layout, body.login .sidebar-resize { display:none; }
.auth-wrap { min-height:100vh; display:flex; align-items:center; justify-content:center; padding:20px; background:radial-gradient(1200px 600px at 50% -10%, var(--acc-soft), transparent 60%), var(--bg); }
.auth-card { width:380px; max-width:100%; background:var(--panel); border:1px solid var(--line); border-radius:var(--r); padding:30px; box-shadow:var(--sh-2); animation:pop var(--t) var(--ease-out) both; }
.auth-card .logo { display:flex; justify-content:center; margin-bottom:10px; } .auth-card .logo img { height:22px; }
:root .auth-card .logo img { filter:invert(1); }
[data-theme="dark"] .auth-card .logo img { filter:none; }
.auth-card h1 { text-align:center; font-size:21px; margin:0 0 4px; }
.auth-card .sub { text-align:center; color:var(--mut); margin:0 0 22px; font-size:13px; }
#gbtn-wrap { display:flex; justify-content:center; min-height:44px; }
/* draggable sidebar width — thin handle at the sidebar's right edge (desktop only) */
.sidebar-resize { position:fixed; top:56px; bottom:0; left:calc(var(--sidebar-w) - 3px); width:6px; cursor:col-resize; z-index:40; }
.sidebar-resize::after { content:""; position:absolute; inset:0 2px; background:transparent; transition:background var(--t-fast); }
.sidebar-resize:hover::after, .sidebar-resize.dragging::after { background:var(--acc); }
main { overflow-y:auto; padding:26px 32px 60px; }
.page { max-width:1080px; margin:0 auto; }
.page.wide { max-width:none; }
.scrim { display:none; }

/* ── sidebar ── */
.navlink { display:flex; align-items:center; gap:10px; padding:9px 11px; border-radius:var(--r-sm); cursor:pointer;
  color:var(--fg-2); font-weight:500; transition:background var(--t-fast),color var(--t-fast); }
.navlink svg { width:16px; height:16px; flex:none; opacity:.85; }
.navlink:hover { background:var(--panel); color:var(--fg); }
.navlink.active { background:var(--acc-soft); color:#fff; }
.navlink.active svg { color:var(--acc-2); opacity:1; }
.ws-head { display:flex; align-items:center; gap:7px; padding:8px 9px; margin-top:10px; border-radius:var(--r-sm); cursor:pointer; color:var(--fg-2); transition:background var(--t-fast); }
.ws-head:hover { background:var(--panel); }
.ws-head .chev { color:var(--mut); width:11px; height:11px; transition:transform var(--t); flex:none; }
.ws-head.collapsed .chev { transform:rotate(-90deg); }
.ws-head .ws-name { font-size:11px; text-transform:uppercase; letter-spacing:.07em; font-weight:700; flex:1; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.ws-head .ws-count { font-size:10.5px; color:var(--mut); background:var(--panel-3); border-radius:10px; padding:1px 7px; }
.ws-head .ws-menu { color:var(--mut); width:22px; height:22px; display:flex; align-items:center; justify-content:center; border-radius:5px; opacity:0; transition:opacity var(--t-fast),background var(--t-fast); }
.ws-head:hover .ws-menu { opacity:1; } .ws-head .ws-menu:hover { color:var(--fg); background:var(--panel-3); }
.ws-bots { margin:3px 0 2px 7px; padding-left:9px; border-left:1px solid var(--line); display:flex; flex-direction:column; gap:1px; }
.botitem { display:flex; align-items:center; gap:9px; padding:7px 9px; border-radius:var(--r-sm); cursor:pointer; color:var(--fg-2); transition:background var(--t-fast),color var(--t-fast); }
.botitem:hover { background:var(--panel); color:var(--fg); }
.botitem.active { background:var(--acc-dim); color:#fff; }
.botitem .dot { width:7px; height:7px; border-radius:50%; background:var(--ok); flex:none; box-shadow:0 0 6px var(--ok-soft); }
.botitem .dot.off { background:var(--mut); box-shadow:none; }
.botitem .nm { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; flex:1; }
.botitem .id { font-size:11px; color:var(--mut); }
/* second status dot: live-in-production (filled accent when live, hollow ring when not) */
.botitem .livedot { width:7px; height:7px; border-radius:50%; flex:none; margin-left:-5px; background:var(--acc); box-shadow:0 0 6px var(--acc-soft); }
.botitem .livedot.off { background:transparent; border:1.5px solid var(--line-2); box-shadow:none; }
/* client email under a workspace name (normal case, muted) */
.ws-head .ws-name .ws-client { display:block; font-size:10px; font-weight:400; color:var(--mut); text-transform:none; letter-spacing:0; overflow:hidden; text-overflow:ellipsis; margin-top:1px; }
/* client-labelled workspaces show a proper name/email — normal case reads better than the uppercase category style */
.ws-head .ws-name--client { text-transform:none; letter-spacing:0; font-size:13px; }
.side-empty { color:var(--mut); font-size:12px; padding:12px 10px; text-align:center; }

/* ── context menu (workspace ⋯) ── */
.menu { position:fixed; min-width:170px; background:var(--panel); border:1px solid var(--line-2); border-radius:var(--r-sm);
  box-shadow:var(--sh-3); padding:5px; z-index:70; animation:pop var(--t-fast) var(--ease-out) both; }
.menu .mi { display:flex; align-items:center; gap:9px; padding:8px 10px; border-radius:var(--r-xs); cursor:pointer; color:var(--fg-2); font-size:13px; }
.menu .mi svg { width:15px; height:15px; }
.menu .mi:hover { background:var(--panel-2); color:var(--fg); }
.menu .mi.danger { color:var(--bad); } .menu .mi.danger:hover { background:var(--bad-soft); }
.menu .sep { height:1px; background:var(--line); margin:4px 2px; }

/* ── typography ── */
h1 { font-size:24px; margin:0; letter-spacing:-.02em; font-weight:680; }
h2 { font-size:16px; margin:0 0 12px; letter-spacing:-.01em; font-weight:620; }
/* Card headings sit ABOVE their label and description, so they must not be smaller than either — 11.5px
   under a 12px label inverted the order a reader expects. Same fix as the client dashboard: the scale now
   descends heading 13 > label 12 > description 11.5 > prompt body 11.5. */
h3 { font-size:13px; margin:0; color:var(--mut); font-weight:650; text-transform:uppercase; letter-spacing:.06em; }
.sub { color:var(--mut); font-size:13.5px; margin-top:5px; }
.page-head { margin-bottom:22px; }
.eyebrow { font-size:11px; text-transform:uppercase; letter-spacing:.08em; color:var(--acc-2); font-weight:650; margin-bottom:7px; }

/* ── cards ── */
.card { background:var(--panel); border:1px solid var(--line); border-radius:var(--r); padding:20px; box-shadow:var(--sh-1); }
.cards { display:flex; flex-direction:column; gap:16px; }
.card-title { display:flex; align-items:center; gap:10px; margin-bottom:15px; }
.card-title h3 { margin:0; } .card-title .right { margin-left:auto; }
.grid { display:grid; gap:16px; }
.grid.cols2 { grid-template-columns:1fr 1fr; }
.row { display:flex; gap:14px; flex-wrap:wrap; align-items:flex-end; }
.row > .field { flex:1; min-width:180px; margin:0; }
.flush { display:flex; gap:10px; align-items:center; flex-wrap:wrap; }
.right { margin-left:auto; }

/* ── KPI hero ── */
.kpis { display:grid; grid-template-columns:repeat(auto-fit,minmax(150px,1fr)); gap:14px; margin-bottom:18px; }
.kpi { position:relative; background:var(--panel); border:1px solid var(--line); border-radius:var(--r); padding:18px 18px 16px; overflow:hidden; box-shadow:var(--sh-1); transition:transform var(--t),border-color var(--t); }
.kpi:hover { transform:translateY(-2px); border-color:var(--line-2); }
.kpi .k { font-size:11px; color:var(--mut); text-transform:uppercase; letter-spacing:.05em; display:flex; align-items:center; gap:7px; }
.kpi .k svg { width:14px; height:14px; color:var(--acc-2); }
.kpi .n { font-size:32px; font-weight:700; letter-spacing:-.03em; margin-top:8px; font-variant-numeric:tabular-nums; }
.kpi .meta { font-size:12px; color:var(--fg-2); margin-top:3px; }
.kpi::after { content:""; position:absolute; inset:0 0 auto 0; height:2px; background:var(--acc-grad); opacity:.0; transition:opacity var(--t); }
.kpi:hover::after { opacity:.9; }

/* ── pills / badges / chips ── */
.badge { font-size:10.5px; padding:2.5px 8px; border-radius:6px; background:var(--panel-3); color:var(--fg-2); white-space:nowrap; font-weight:500; }
.badge.ok { color:var(--ok); background:var(--ok-soft); } .badge.bad { color:var(--bad); background:var(--bad-soft); }
.badge.mut { color:var(--mut); } .badge.acc { color:#cfc7ff; background:var(--acc-soft); }
.chips { display:flex; gap:8px; flex-wrap:wrap; align-items:center; margin-top:10px; }
.chip { font-size:11.5px; padding:4px 10px; border-radius:7px; background:var(--panel-2); border:1px solid var(--line); color:var(--fg-2); display:inline-flex; gap:7px; align-items:center; }
.chip b { color:var(--fg); font-weight:600; }
.chip .d { width:6px; height:6px; border-radius:50%; background:var(--mut); }
.chip .d.ok { background:var(--ok); } .chip .d.bad { background:var(--bad); } .chip .d.acc { background:var(--acc); }
.chip.live .d.ok { animation:pulse-dot 2s var(--ease) infinite; }

/* ── tabs (segmented w/ sliding indicator) ── */
.tabs { position:relative; display:flex; gap:2px; background:var(--panel); border:1px solid var(--line); border-radius:10px; padding:4px; margin:20px 0 22px; width:fit-content; max-width:100%; overflow:auto; }
.tab { position:relative; z-index:1; padding:8px 15px; cursor:pointer; color:var(--mut); font-size:13px; font-weight:550; border-radius:7px; white-space:nowrap; transition:color var(--t); text-transform:capitalize; }
.tab:hover { color:var(--fg-2); } .tab.active { color:#fff; }
.tab-ind { position:absolute; top:4px; bottom:4px; z-index:0; background:var(--acc); border-radius:7px; box-shadow:var(--sh-1);
  transition:left var(--t-slow) var(--ease-out),width var(--t-slow) var(--ease-out); }

/* ── forms ── */
.field { margin-bottom:15px; }
label { display:block; font-size:12px; color:var(--fg-2); margin-bottom:6px; font-weight:550; }
.hint { font-size:11.5px; color:var(--mut); margin-top:5px; line-height:1.45; }
.hint.bad { color:var(--bad); } .hint.ok { color:var(--ok); }
input, textarea, select { font:inherit; width:100%; background:var(--bg-2); border:1px solid var(--line-2); color:var(--fg);
  padding:10px 12px; border-radius:var(--r-sm); transition:border-color var(--t),box-shadow var(--t),background var(--t); }
input:focus, textarea:focus, select:focus { outline:none; border-color:var(--acc); box-shadow:var(--glow); background:var(--bg); }
/* checkboxes/radios must not inherit the width:100% + padding from the rule above (it squeezes inline labels) */
input[type=checkbox], input[type=radio] { width:auto; flex:none; padding:0; }
input::placeholder, textarea::placeholder { color:var(--mut); }
input.invalid { border-color:var(--bad); } input.invalid:focus { box-shadow:0 0 0 3px var(--bad-soft); }
textarea { min-height:110px; font-family:ui-monospace,Menlo,monospace; font-size:12px; line-height:1.5; resize:vertical; }
select { appearance:none; background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2374747e' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat:no-repeat; background-position:right 11px center; padding-right:30px; }
label.ck { display:flex; align-items:center; gap:9px; font-size:12.5px; color:var(--fg-2); cursor:pointer; margin:0; }
label.ck input { width:auto; }

/* ── buttons ── */
button { font:inherit; cursor:pointer; border:1px solid var(--line-2); background:var(--panel-2); color:var(--fg);
  padding:9px 15px; border-radius:var(--r-sm); font-weight:500; display:inline-flex; align-items:center; gap:7px;
  transition:border-color var(--t),background var(--t),transform var(--t-fast),box-shadow var(--t); }
button svg { width:15px; height:15px; }
button:hover { border-color:var(--line-2); background:var(--panel-3); }
button:active { transform:scale(.975); }
button:disabled { opacity:.45; cursor:default; transform:none; }
button.primary { background:var(--acc); border-color:transparent; color:#fff; font-weight:600; box-shadow:0 1px 0 rgba(255,255,255,.08) inset, 0 2px 10px rgba(106,91,253,.3); }
button.primary:hover { background:var(--acc-press); }
button.danger { color:var(--bad); border-color:var(--bad-soft); background:transparent; }
button.danger:hover { background:var(--bad-soft); border-color:var(--bad); }
button.ghost { background:transparent; } button.ghost:hover { background:var(--panel-2); }
button.sm { padding:6px 11px; font-size:12px; }

/* ── icons ── */
.i { display:inline-flex; align-items:center; flex:none; }
.card-title .i { color:var(--acc-2); } .card-title svg { width:16px; height:16px; }
.ws-head .ws-menu svg { width:15px; height:15px; }
.empty .i svg { width:26px; height:26px; }
.menu .mi .i svg { width:15px; height:15px; }
.kpi .k .i svg { width:14px; height:14px; }

/* ── tables ── */
.tbl-wrap { overflow-x:auto; border-radius:var(--r-sm); }
table { width:100%; border-collapse:collapse; font-size:13px; }
th, td { text-align:left; padding:10px 12px; border-bottom:1px solid var(--line); }
th { color:var(--mut); font-weight:550; font-size:10.5px; text-transform:uppercase; letter-spacing:.05em; }
td.mono { font-size:12px; } tr:last-child td { border-bottom:0; }
tr.clickable { cursor:pointer; } tr.clickable:hover td { background:var(--panel-2); }

/* ── pager ── */
.pager { display:flex; gap:5px; align-items:center; margin-top:16px; flex-wrap:wrap; }
.pager button { padding:5px 10px; font-size:12px; min-width:32px; justify-content:center; }
.pager button.cur { background:var(--acc); border-color:transparent; color:#fff; font-weight:600; }
.pager .pinfo { color:var(--mut); font-size:11.5px; margin-left:auto; }

/* ── stat tiles (Data tab) ── */
.tiles { display:grid; grid-template-columns:repeat(auto-fill,minmax(118px,1fr)); gap:11px; }
.tile { background:var(--panel-2); border:1px solid var(--line); border-radius:var(--r-sm); padding:13px 15px; }
.tile .n { font-size:22px; font-weight:680; letter-spacing:-.02em; font-variant-numeric:tabular-nums; }
.tile .k { font-size:11px; color:var(--mut); text-transform:uppercase; letter-spacing:.04em; margin-top:3px; }

/* ── signal list (dashboard) ── */
.sig { display:flex; flex-direction:column; gap:2px; }
.sig-item { display:flex; gap:11px; align-items:baseline; padding:9px 0; border-bottom:1px solid var(--line); cursor:pointer; }
.sig-item:last-child { border-bottom:0; } .sig-item:hover .sig-main { color:var(--fg); }
.sig-item .sig-main { color:var(--fg-2); flex:1; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; transition:color var(--t-fast); }
.sig-item .sig-bot { font-size:11px; color:var(--acc-2); white-space:nowrap; }
.sig-item .sig-t { font-size:11px; color:var(--mut); white-space:nowrap; }

/* ── empty states ── */
.empty { color:var(--mut); padding:30px 16px; text-align:center; }
.empty svg { width:26px; height:26px; opacity:.5; margin-bottom:10px; }
.empty .cta { margin-top:14px; display:inline-flex; }

/* ── skeletons ── */
.sk { position:relative; overflow:hidden; background:var(--panel-2); border-radius:var(--r-xs); }
.sk::after { content:""; position:absolute; inset:0; background:linear-gradient(90deg,transparent,rgba(255,255,255,.045),transparent);
  background-size:450px 100%; animation:shimmer 1.3s infinite linear; }
.sk-line { height:12px; margin:9px 0; } .sk-kpi { height:92px; border-radius:var(--r); } .sk-row { height:38px; margin:6px 0; }

/* ── live log / transcript panels ── */
.logs { font-family:ui-monospace,Menlo,monospace; font-size:12px; background:var(--bg-2); border:1px solid var(--line); border-radius:var(--r-sm); max-height:60vh; overflow:auto; padding:5px 0; }
.logs.pre { white-space:pre-wrap; word-break:break-word; color:var(--fg-2); line-height:1.6; padding:12px; }
.logrow { display:flex; gap:10px; padding:3px 13px; white-space:nowrap; }
.logrow:hover { background:var(--panel); }
.logrow .lt { color:var(--mut); } .logrow .lv { width:34px; } .logrow .lm { white-space:pre-wrap; word-break:break-word; color:var(--fg-2); }
.lv-in{color:var(--warn)} .lv-out{color:var(--ok)} .lv-llm{color:var(--acc)} .lv-err{color:var(--bad)} .lv-sys{color:var(--mut)} .lv-agent{color:var(--acc)}

/* ── deploy / ingest step log ── */
.deploylog { font-family:ui-monospace,Menlo,monospace; font-size:12px; background:var(--bg-2); border:1px solid var(--line); border-radius:var(--r-sm); max-height:36vh; overflow:auto; padding:8px 0; margin-top:14px; }
.deploylog .logrow { white-space:normal; animation:fade-in var(--t) both; }
.l-ok{color:var(--ok)} .l-err{color:var(--bad)} .l-warn{color:var(--warn)}

/* Editable auto-build plan review (#ai-out) */
#ai-out { max-height:46vh; overflow:auto; }
#ai-out .pe-ta, #ai-out .pe-slide { min-height:0; }
#ai-out .pe-cat { background:var(--bg-2); }
#ai-out details summary { cursor:pointer; padding:6px 0; user-select:none; }
#ai-out details[open] summary { color:var(--fg-2); }

/* ── New-bot modes (segmented) ── */
.modes { display:flex; gap:3px; background:var(--panel-2); border:1px solid var(--line); border-radius:9px; padding:4px; margin-bottom:18px; }
.mode { flex:1; text-align:center; padding:8px 6px; border-radius:6px; cursor:pointer; color:var(--fg-2); font-size:12.5px; font-weight:500; transition:color var(--t),background var(--t); }
.mode:hover { color:var(--fg); } .mode.active { background:var(--acc); color:#fff; font-weight:600; box-shadow:var(--sh-1); }

/* ── modal / bottom-sheet ── */
.modal-bg { position:fixed; inset:0; background:rgba(0,0,0,.6); display:none; align-items:center; justify-content:center; z-index:80; backdrop-filter:blur(4px); }
.modal-bg.show { display:flex; animation:fade-in var(--t) both; }
.modal { background:var(--panel); border:1px solid var(--line-2); border-radius:var(--r); padding:24px; width:520px; max-width:calc(100vw - 32px); max-height:88vh; overflow:auto; box-shadow:var(--sh-3); animation:pop var(--t-slow) var(--ease-out) both; }
.modal h2 { margin-bottom:18px; }

/* ── toast ── */
#toast { position:fixed; bottom:22px; right:22px; background:var(--panel); border:1px solid var(--line-2); padding:12px 16px;
  border-radius:var(--r-md); display:none; max-width:420px; z-index:90; box-shadow:var(--sh-3); align-items:center; gap:10px; font-size:13px; }
#toast.show { display:flex; animation:toast-in var(--t-slow) var(--ease-out) both; }
#toast::before { content:""; width:8px; height:8px; border-radius:50%; background:var(--ok); flex:none; box-shadow:0 0 8px var(--ok); }
#toast.bad::before { background:var(--bad); box-shadow:0 0 8px var(--bad); }

/* ── responsive ── */
@media (max-width:1024px) { .layout { grid-template-columns:220px 1fr; } main { padding:22px 24px 60px; } .grid.cols2 { grid-template-columns:1fr; } .sidebar-resize { display:none; } }
@media (max-width:760px) {
  .icon-btn { display:inline-flex; }
  #search { width:170px; } .search kbd { display:none; }
  .layout { grid-template-columns:1fr; }
  aside { position:fixed; top:56px; bottom:0; left:0; width:280px; max-width:84vw; z-index:60; transform:translateX(-100%);
    transition:transform var(--t-slow) var(--ease-out); box-shadow:var(--sh-3); }
  body.drawer aside { transform:none; }
  body.drawer .scrim { display:block; position:fixed; inset:56px 0 0; background:rgba(0,0,0,.5); z-index:55; animation:fade-in var(--t) both; }
  main { padding:18px 16px 50px; }
  .kpis { grid-template-columns:1fr 1fr; gap:10px; }
  .kpi .n { font-size:26px; }
  h1 { font-size:21px; }
  .modal { position:fixed; left:0; right:0; bottom:0; width:100%; max-width:100%; border-radius:var(--r) var(--r) 0 0;
    max-height:90vh; animation:sheet-up var(--t-slow) var(--ease-out) both; }
  .modal-bg { align-items:flex-end; }
  .row > .field { min-width:100%; }
  button, .tab, .mode, .navlink, .botitem { min-height:44px; }
  .popover { position:fixed; left:12px; right:12px; top:62px; width:auto; }
}
/* The header is one non-wrapping flex row — hamburger, logo, search, status, New bot — and its
   natural width is ~530px. On an iPhone that stretched the document to 512px in a 390px viewport:
   the whole page scrolled sideways, the hamburger was crushed to 20px, and New bot sat off-screen.
   Let the search absorb the squeeze and drop the two right-hand controls to icons only. */
@media (max-width:560px) {
  .brand-sub { display:none; }
  .icon-btn, .theme-btn, .status, #newbot-btn { flex:none; }
  /* .spacer is flex:1 too, so it split the slack with the search and left it a ~50px stub. */
  header .spacer { display:none; }
  .search { flex:1; min-width:0; }
  #search { width:100%; padding-right:12px; }
  /* The status button's label is a bare text node with no element to hide, so collapse it with
     font-size:0 — the dot keeps its px dimensions and survives. */
  .status-btn { font-size:0; gap:0; padding:8px 10px; }
  #newbot-btn .lbl { display:none; }
  /* Safari on iOS zooms the whole page when a focused field is under 16px, and never zooms back. */
  input, textarea, select { font-size:16px; }
}
@media (max-width:420px) { .kpis { grid-template-columns:1fr; } header { gap:8px; padding:0 12px; } }
/* Touch devices have no hover — keep workspace actions reachable. */
@media (hover:none) { .ws-head .ws-menu { opacity:1; } }

@media (prefers-reduced-motion:reduce) {
  *, *::before, *::after { animation-duration:.001ms !important; animation-iteration-count:1 !important; transition-duration:.001ms !important; }
  .tab-ind { transition:none; }
}

/* ── AI Studio ──────────────────────────────────────────────────────────── */
.st-steps { display:flex; align-items:center; gap:9px; margin:4px 0 18px; font-size:12px; font-weight:600; }
.st-step { color:var(--mut); }
.st-step.on { color:var(--acc-2); } .st-step.done { color:var(--fg-2); }
.st-sep { color:var(--line-2); }
.st-form .row { gap:14px; }
/* crawl-preview cluster (nested directly under the Website URL): result chip + embed control */
.st-crawlrow { display:flex; align-items:center; justify-content:space-between; gap:12px 16px; margin:8px 0 0; flex-wrap:wrap; }
.st-crawl { font-size:12px; color:var(--mut); display:flex; align-items:center; gap:8px; min-height:22px; }
.st-embed { display:flex; align-items:center; gap:7px; flex:none; font-size:12px; color:var(--fg-2); }
.st-embed label { margin:0; font-size:12px; color:var(--fg-2); }
.st-embed input { width:58px; text-align:center; padding:6px 8px; }
.st-chip { display:inline-flex; align-items:center; gap:5px; font-size:11.5px; font-weight:600; padding:3px 9px; border-radius:999px;
  background:var(--panel-3); border:1px solid var(--line-2); color:var(--fg-2); }
.st-chip.ok { background:var(--ok-soft); border-color:transparent; color:var(--ok); }
.st-spin, .spin { display:inline-block; animation:fvspin 1s linear infinite; }
@keyframes fvspin { to { transform:rotate(360deg); } }
.st-reason-wrap summary { cursor:pointer; }
.st-reason { background:#000; border:1px solid var(--line); border-radius:10px; padding:11px 13px; margin-top:8px; max-height:32vh; overflow:auto;
  font-family:ui-monospace,Menlo,monospace; font-size:11.5px; color:var(--fg-2); white-space:pre-wrap; word-break:break-word; }
.st-h { font-size:12px; text-transform:uppercase; letter-spacing:.05em; color:var(--mut); margin:22px 0 10px; font-weight:700; }
.st-review { max-width:860px; }
.st-change { border:1px solid var(--line); border-radius:12px; padding:13px 15px; margin-bottom:9px; background:var(--panel); transition:border-color .15s,opacity .15s; }
.st-change.off { opacity:.5; }
.st-chead { display:flex; align-items:center; gap:10px; }
.st-ck { display:flex; align-items:center; }
.st-ck input { width:16px; height:16px; accent-color:var(--acc); cursor:pointer; }
.st-ctitle { font-size:13.5px; font-weight:650; color:var(--fg); flex:1; }
.st-cbadge { font-size:9.5px; font-weight:700; letter-spacing:.04em; }
.st-cdesc { font-size:12px; color:var(--mut); margin:5px 0 0 26px; }
.st-clinks { display:flex; gap:16px; margin:9px 0 0 26px; }
.st-clinks a { font-size:12px; font-weight:600; color:var(--acc-2); }
.st-diff { margin:11px 0 0 26px; display:grid; gap:8px; }
/* the display:grid/flex above beat the UA [hidden]{display:none}; restore hide-on-hidden so the
   "Show changes" / "Add note" toggles actually collapse these (otherwise they're always visible) */
.st-diff[hidden], .st-note[hidden] { display:none; }
.st-before, .st-after { font-size:12px; line-height:1.5; white-space:pre-wrap; word-break:break-word; border-left:3px solid var(--line-2); padding:8px 11px; border-radius:0 7px 7px 0; background:var(--bg-2); max-height:240px; overflow:auto; }
.st-before { color:var(--mut); } .st-after { color:var(--ok); border-left-color:var(--ok); }
.st-note { margin:10px 0 0 26px; display:flex; gap:8px; align-items:flex-start; }
.st-note textarea { flex:1; }
.st-customrow { display:flex; gap:8px; margin-bottom:8px; align-items:center; }
.st-customrow input { flex:1; }
.st-cats { display:grid; grid-template-columns:repeat(auto-fill,minmax(220px,1fr)); gap:9px; }
.st-cats .st-change { margin-bottom:0; }

/* Utility. app.js toggles this class in ~20 places (schedule field, segment condition inputs, template
   header value, the phone-preview options sheet, the campaign code field) and it was never defined here —
   so every one of those show/hide toggles was inert and the element stayed visible. Found by rendering the
   campaign modal in a browser; no API test can see it. !important and last in the file because it has to
   beat same-specificity display rules like .wa-sheet-back{display:flex}. */
.hidden { display:none !important; }

/* Reveal-password toggle. The wrapper is added by app.js at runtime (it scans for input[type=password]), so
   these rules have to work for a field in ANY container — hence positioning against .pw-wrap, not the form. */
.pw-wrap { position:relative; display:block; }
.pw-wrap > input { width:100%; padding-right:38px; }          /* room for the button, so text never runs under it */
.pw-eye {
  position:absolute; right:6px; top:50%; transform:translateY(-50%);
  display:flex; align-items:center; justify-content:center;
  width:26px; height:26px; padding:0; border:0; border-radius:6px;
  background:transparent; color:var(--mut,#74747e); cursor:pointer;
}
.pw-eye:hover { color:var(--fg,#f6f6f8); background:var(--panel-2,rgba(255,255,255,.06)); }
.pw-eye:focus-visible { outline:2px solid var(--acc,#6a5bfd); outline-offset:1px; }
.pw-eye svg { width:15px; height:15px; display:block; }

/* The `hidden` ATTRIBUTE must actually hide. The UA stylesheet's [hidden]{display:none} loses to any author
   `display` rule, so `.st-diff { display:grid }` silently defeated `<div class="st-diff" hidden>` — the box was
   always visible and its "Show update" toggle appeared to do nothing. Same failure as the `.hidden` class, which
   was used in ~20 places and defined nowhere. Declared once, globally, so neither can recur. */
[hidden] { display:none !important; }

/* Long-form prompt boxes inherit body's 14px, so an agent's own prompt rendered LARGER than the sentence
   describing it. Held at the description's size. Single-line inputs stay at body size — there the label is a
   label, not a description, and shrinking a field ops types into helps nobody. */
#pe-prompt, #kb-prompt, .au-prompt { font-size:11.5px; line-height:1.6; }
/* …but not on a phone: tapping into an 11.5px field makes iOS zoom the page in and never zoom back,
   which strands the rest of the console off-screen. Density loses to that. Lives here rather than in
   the responsive section because it has to beat the rule directly above on source order. */
@media (max-width:560px) { #pe-prompt, #kb-prompt, .au-prompt { font-size:16px; } }

/* Outbound entitlement, visible on the workspace row — the flag is billable and Meta-sensitive, so ops should
   be able to see who has it without opening each workspace. */
.ws-ob { font-size:9.5px; font-weight:700; letter-spacing:.04em; padding:2px 5px; border-radius:4px;
  background:var(--ok-soft); color:var(--ok); flex:none; }

/* Keep the per-row action buttons on one line in the knowledge-bases table. */
.nowrap { white-space:nowrap; }

/* Ring spinner for waiting() status lines. The existing `.st-spin, .spin` rule only animates a glyph; this
   gives an EMPTY span something to draw, without touching the ↻ usages that pass their own character. */
.spin:empty { display:inline-block; width:11px; height:11px; border:2px solid var(--line-2);
  border-top-color:var(--acc); border-radius:50%; vertical-align:-1px; margin-right:5px; }

/* The WhatsApp conversation thread (.wa-thread / .wa-bub / .wa-cards / …) used to live here, and an identical
   copy lived in the other console's stylesheet. It is now shared/public/wa-thread.css, linked from index.html
   after this file — see that file's header for why, and for the chained-token trick that lets one stylesheet read
   correctly in this console and the other. The layout it sits inside stays below, because that IS per-console. */

/* ── Conversations: list left, chat right ──────────────────────────────────────────────────────────────────
   The transcript used to render below the table, so opening a chat meant scrolling past every customer the bot
   had ever spoken to. Two independently scrolling columns: the list cannot push the chat away, and the chat
   cannot move the list. Stacks back to one column on a narrow screen, where side-by-side would leave neither
   readable. */
/* minmax(0,1fr), not 1fr: a bare `1fr` track is floored at its content's min-content width, so the carousel strip
   inside a bubble (150px per card, ten of them) widened the column instead of scrolling inside itself — and the
   whole page then scrolled sideways. minmax(0,…) lets the track shrink and hands the overflow back to the strip. */
.conv-split { display: grid; grid-template-columns: minmax(240px, 340px) minmax(0, 1fr); gap: 14px; align-items: start; }
.conv-list { max-height: calc(100vh - 210px); overflow: auto; }
.conv-pane { position: sticky; top: 0; }
.conv-card { display: flex; flex-direction: column; max-height: calc(100vh - 210px); }
.conv-body { overflow: auto; flex: 1; margin-top: 12px; }
.conv-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }

/* The row carries name, number and count in one cell so the left column stays narrow. */
.cv-who { font-weight: 600; }
.cv-sub { font-size: 11px; color: var(--mut, #74747e); margin-top: 2px; }
.cv-when { white-space: nowrap; font-size: 11.5px; }
tr[data-p].sel td { background: var(--acc-soft, rgba(106, 91, 253, .14)); }

/* Segmented control, not two loose buttons — it is one choice with two states. */
.conv-switch { display: inline-flex; background: var(--bg-2, #0d0d10); border: 1px solid var(--line-2, #34343f); border-radius: 8px; padding: 2px; }
.cv-tab { border: 0; background: none; color: var(--mut, #74747e); font: inherit; font-size: 12px; padding: 5px 12px; border-radius: 6px; cursor: pointer; }
.cv-tab.on { background: var(--panel-2, #191920); color: var(--fg, #f6f6f8); }
.cv-tab:hover:not(.on) { color: var(--fg-2, #b4b4c0); }

@media (max-width: 900px) {
  .conv-split { grid-template-columns: 1fr; }
  .conv-list, .conv-card { max-height: none; }
  .conv-pane { position: static; }
}

/* ── Restore points ──────────────────────────────────────────────────────────────────────
   A list, not a table. The table had four columns of which one (FLOWS) read "14" on every
   row and one held nothing but a repeated button, and its dates wrapped onto two lines. A
   row here is one line: when, why, and a quiet way back.

   The live row is marked ONCE, with a left rule. It previously carried a background tint
   AND a badge AND replaced its button with the words "already running" — three signals for
   one fact, which is how a section ends up feeling cluttered without any one thing being
   wrong. */
.snaps { display:flex; flex-direction:column; }
.snap {
  display:grid; grid-template-columns:auto 1fr auto; gap:14px; align-items:center;
  padding:9px 12px; border-bottom:1px solid var(--line); border-left:2px solid transparent;
}
.snap:last-child { border-bottom:0; }
.snap-when { color:var(--mut); font-size:12px; white-space:nowrap; font-variant-numeric:tabular-nums; }
.snap-why { color:var(--fg-2); font-size:12.5px; line-height:1.4; min-width:0; }
.snap-act { display:flex; justify-content:flex-end; }
.snap.is-live { border-left-color:var(--ok); background:var(--panel-2); }
.snap.is-live .snap-why { color:var(--fg); }
.btn.ghost.sm { padding:4px 10px; font-size:11.5px; }

/* ── onboarding (read-only recreation of the salon checklist) ── */
.ob-layout { display:grid; grid-template-columns:300px minmax(0,1fr); gap:16px; align-items:start; }
.ob-list { padding:8px; display:flex; flex-direction:column; gap:4px; position:sticky; top:16px; max-height:calc(100vh - 140px); overflow:auto; }
.ob-row { all:unset; box-sizing:border-box; cursor:pointer; display:flex; flex-direction:column; gap:4px; padding:10px 12px; border-radius:var(--r-sm); }
.ob-row:hover { background:var(--panel-2); } .ob-row.on { background:var(--acc-soft); }
.ob-row-top { display:flex; justify-content:space-between; gap:8px; align-items:center; }
.ob-row-top b { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.ob-row-sub { font-size:11.5px; color:var(--mut); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.ob-mini, .ob-bar { height:5px; border-radius:99px; background:var(--panel-3); overflow:hidden; }
.ob-mini > i, .ob-bar > i { display:block; height:100%; background:var(--acc); border-radius:inherit; }
.ob-head h2 { margin:0 0 4px; font-size:20px; }
.ob-head-top { display:flex; justify-content:space-between; gap:16px; flex-wrap:wrap; align-items:flex-start; }
.ob-dl { display:flex; gap:8px; flex-wrap:wrap; }
.ob-prog { display:flex; justify-content:space-between; gap:12px; flex-wrap:wrap; font-size:12.5px; color:var(--fg-2); margin:16px 0 8px; }
.ob-bar { height:7px; }
.ob-step { margin-top:12px; }
.ob-step-top { display:flex; align-items:center; gap:12px; margin-bottom:14px; }
.ob-step-top h3 { margin:0; font-size:14.5px; } .ob-step-top .right { margin-left:auto; font-size:12px; }
.ob-n { width:26px; height:26px; border-radius:50%; border:1.5px solid var(--line-2); display:grid; place-items:center; font-size:12px; font-weight:650; color:var(--fg-2); flex:none; }
.ob-step.done .ob-n { background:var(--ok); border-color:var(--ok); color:#fff; }
.ob-req { color:var(--bad); margin-left:3px; }
.ob-step-body { display:flex; flex-direction:column; gap:12px; padding-left:38px; }
.ob-f label em { font-style:normal; color:var(--mut); font-weight:500; }
.ob-val { background:var(--bg-2); border:1px solid var(--line-2); border-radius:var(--r-sm); padding:9px 12px; white-space:pre-wrap; word-break:break-word; }
.ob-val.empty { color:var(--mut); font-style:italic; background:transparent; border-style:dashed; }
.ob-grid2 { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.ob-cats { display:flex; flex-direction:column; gap:6px; background:var(--bg-2); border:1px solid var(--line-2); border-radius:var(--r-sm); padding:10px 12px; }
.ob-files { display:grid; grid-template-columns:repeat(auto-fill,minmax(150px,1fr)); gap:10px; }
.ob-files.big { grid-template-columns:repeat(auto-fill,minmax(200px,1fr)); }
.ob-file { border:1px solid var(--line); border-radius:var(--r-sm); overflow:hidden; background:var(--panel-2); display:flex; flex-direction:column; }
.ob-thumb { aspect-ratio:4/3; background:var(--panel-3); display:grid; place-items:center; overflow:hidden; }
.ob-thumb img, .ob-thumb video { width:100%; height:100%; object-fit:cover; display:block; }
.ob-files.big .ob-thumb img { object-fit:contain; }
.ob-ext { font-weight:700; color:var(--mut); letter-spacing:.06em; }
.ob-fmeta { display:flex; flex-direction:column; padding:8px 10px 4px; font-size:12px; min-width:0; }
.ob-fname { font-weight:550; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.ob-facts { display:flex; gap:6px; padding:4px 10px 10px; } .ob-facts button:first-child { flex:1; }
.ob-warn { background:var(--warn-soft); color:var(--fg); border-radius:var(--r-sm); padding:9px 12px; font-size:12.5px; }
@media (max-width:760px) {
  .ob-layout { grid-template-columns:1fr; }
  .ob-list { position:static; max-height:none; }
  .ob-step-body { padding-left:0; }
  .ob-grid2 { grid-template-columns:1fr; }
}
