/* ===========================================================================
   Tools Hub — Extra Tools styles  (loaded AFTER style.css)
   1. Missing shared utility classes used by tools-extra.js
   2. Per-tool styles
   3. App-wide frosted-glass blur (mirrors the dashboard cards)
   4. Global mobile-responsive pass
   Uses the same design tokens as style.css: --accent, --accent-2, --glass,
   --glass-border, --glass-hover, --glass-inset, --text-primary/-secondary/-muted,
   --success, --danger, --radius-sm/-md.
   =========================================================================== */

/* ── 1. shared utility classes ──────────────────────────────────────────── */
.util-inline { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.util-inline .tool-ctrl-label { margin: 0; white-space: nowrap; }
.util-sep { border: none; border-top: 1px solid var(--glass-border); margin: .7rem 0; }

.util-bigresult {
  font-family: ui-monospace, 'JetBrains Mono', monospace;
  font-size: 1.4rem; font-weight: 700; color: var(--text-primary);
  background: rgba(0,0,0,.28); border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm); padding: .8rem .9rem; word-break: break-word;
  min-height: 1.2em;
}
.util-copy-btn {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .25rem .55rem; font-size: .74rem; font-weight: 600;
  border-radius: var(--radius-sm); background: var(--glass);
  border: 1px solid var(--glass-border); color: var(--text-secondary);
  cursor: pointer; transition: background .15s, color .15s, border-color .15s, transform .1s;
}
.util-copy-btn:hover { background: var(--glass-hover); color: var(--text-primary); border-color: rgba(167,139,250,.4); }
.util-copy-btn:active { transform: scale(.95); }
.util-copy-btn.copied { color: var(--success); border-color: rgba(52,211,153,.5); }

.util-mini-btn.primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; border-color: transparent; }
.util-mini-btn.primary:hover { color: #fff; }

.util-pill {
  display: inline-block; min-width: 1.4em; text-align: center;
  padding: .05rem .45rem; font-size: .72rem; font-weight: 700;
  border-radius: 999px; background: rgba(167,139,250,.18); color: var(--accent-2);
}
.util-ok {
  font-size: .85rem; color: var(--success); font-weight: 600;
  display: inline-flex; align-items: center; gap: .35rem;
}
.util-help { margin: 0; padding-left: 1.1rem; color: var(--text-secondary); font-size: .85rem; line-height: 1.7; }
.util-help code, .util-muted code, .util-help b { color: var(--accent-2); }

.util-code-out {
  margin: 0; padding: .8rem .9rem; max-height: 380px; overflow: auto;
  background: rgba(0,0,0,.34); border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm); color: var(--text-primary);
  font-family: ui-monospace, 'JetBrains Mono', monospace; font-size: .8rem;
  line-height: 1.55; white-space: pre; tab-size: 2;
}
.util-drop {
  border: 1.5px dashed var(--glass-border); border-radius: var(--radius-md);
  padding: 1rem; text-align: center; background: rgba(0,0,0,.18); transition: border-color .15s, background .15s;
}
.util-drop:hover { border-color: rgba(167,139,250,.5); background: rgba(167,139,250,.06); }
.util-drop-label { display: inline-flex; align-items: center; gap: .45rem; cursor: pointer; font-weight: 600; color: var(--text-secondary); }
.util-drop-label:hover { color: var(--text-primary); }
.util-drop-label i { font-size: 1.1rem; color: var(--accent-2); }

.tool-input { /* reinforce in case a variant is missing */ width: 100%; }

/* ── 2. per-tool styles ─────────────────────────────────────────────────── */

/* World clock */
.wc-clocks { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 140px), 1fr)); gap: .55rem; }
.wc-clock { background: rgba(0,0,0,.26); border: 1px solid var(--glass-border); border-radius: var(--radius-sm); padding: .55rem .6rem; }
.wc-city { font-size: .78rem; font-weight: 600; color: var(--text-secondary); display: flex; justify-content: space-between; }
.wc-abbr { font-size: .66rem; color: var(--accent-2); font-weight: 700; }
.wc-time { font-family: ui-monospace, monospace; font-size: .98rem; font-weight: 700; color: var(--text-primary); margin-top: .15rem; }

/* Percentage */
.pct-row { display: flex; align-items: center; gap: .45rem; flex-wrap: wrap; margin-bottom: .7rem; font-size: .85rem; color: var(--text-secondary); }
.pct-in { width: 92px !important; }
.pct-eq { margin-left: auto; font-size: .95rem; }
.pct-eq b { color: var(--accent-2); font-family: ui-monospace, monospace; }

/* Scientific calculator */
.sci-display { font-family: ui-monospace, monospace; font-size: 1rem; }
.sci-result { font-family: ui-monospace, monospace; font-size: 1.6rem; font-weight: 700; color: var(--accent-2); text-align: right; padding: .3rem .2rem .5rem; min-height: 1.4em; word-break: break-all; }
.sci-pad { display: flex; flex-direction: column; gap: .4rem; }
.sci-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: .4rem; }
.sci-key {
  padding: .7rem .2rem; font-size: .92rem; font-weight: 600; cursor: pointer;
  background: var(--glass); border: 1px solid var(--glass-border); color: var(--text-primary);
  border-radius: var(--radius-sm); transition: background .12s, transform .08s;
}
.sci-key:hover { background: var(--glass-hover); }
.sci-key:active { transform: scale(.94); }
.sci-wide { grid-column: span 2; }
.sci-eq { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; border-color: transparent; }

/* Stopwatch */
.sw-display { font-family: ui-monospace, monospace; font-size: 2.6rem; font-weight: 800; text-align: center; color: var(--text-primary); padding: .6rem 0; letter-spacing: 1px; }
.sw-ctrls { display: flex; gap: .5rem; justify-content: center; flex-wrap: wrap; }
.pm-phase-wrap { text-align: center; margin-bottom: .4rem; }
.pm-phase { display: inline-block; padding: .2rem .8rem; border-radius: 999px; font-size: .76rem; font-weight: 800; letter-spacing: 1px; background: rgba(167,139,250,.18); color: var(--accent-2); }

/* CSV table */
.cj-table-wrap { max-height: 280px; overflow: auto; border: 1px solid var(--glass-border); border-radius: var(--radius-sm); }
.cj-table { width: 100%; border-collapse: collapse; font-size: .76rem; }
.cj-table th { position: sticky; top: 0; background: rgba(20,20,35,.96); color: var(--accent-2); font-weight: 700; text-align: left; padding: .4rem .55rem; border-bottom: 1px solid var(--glass-border); }
.cj-table td { padding: .35rem .55rem; border-bottom: 1px solid rgba(255,255,255,.05); color: var(--text-secondary); white-space: nowrap; }

/* CSS generator preview */
.cg-preview { height: 170px; border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; text-shadow: 0 1px 4px rgba(0,0,0,.4); overflow: hidden; }
.cg-checker { background-image: linear-gradient(45deg, #ccc 25%, transparent 25%), linear-gradient(-45deg, #ccc 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #ccc 75%), linear-gradient(-45deg, transparent 75%, #ccc 75%); background-size: 20px 20px; background-position: 0 0, 0 10px, 10px -10px, -10px 0; }

/* List tools */
.lt-btns { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .6rem; }

/* Chmod */
.chmod-grp { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; padding: .4rem 0; border-bottom: 1px solid rgba(255,255,255,.05); }
.chmod-who { font-size: .82rem; font-weight: 700; color: var(--accent-2); min-width: 64px; }

/* HTTP / MIME reference */
.hr-list { max-height: 460px; overflow: auto; }
.hr-badge { display: inline-block; min-width: 2.4em; text-align: center; padding: .12rem .4rem; border-radius: var(--radius-sm); font-weight: 700; font-size: .76rem; color: #fff; }
.hr-1xx { background: #64748b; } .hr-2xx { background: #10b981; } .hr-3xx { background: #f59e0b; } .hr-4xx { background: #ef4444; } .hr-5xx { background: #b91c1c; }

/* Image filter controls */
.imf-ctrl { display: flex; flex-direction: column; gap: .15rem; margin-top: .45rem; }
.imf-ctrl input[type=range] { width: 100%; }
.imf-ctrl .tool-ctrl-label span { color: var(--accent-2); font-family: ui-monospace, monospace; }

/* Redact stage / ascii */
.red-stage { padding: .3rem; background: repeating-conic-gradient(#0000000d 0% 25%, transparent 0% 50%) 50% / 18px 18px; }
.ascii-out { margin: 0; padding: .6rem; overflow: auto; max-height: 460px; background: #0b0b14; color: #d6d6e7; font-family: ui-monospace, monospace; font-size: 6px; line-height: 6px; white-space: pre; letter-spacing: 0; }

/* Email header analyzer */
.eh-hops { display: flex; flex-direction: column; gap: .45rem; }
.eh-hop { display: flex; gap: .55rem; background: rgba(0,0,0,.24); border: 1px solid var(--glass-border); border-radius: var(--radius-sm); padding: .5rem .6rem; }
.eh-hop-n { flex: 0 0 auto; width: 22px; height: 22px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; font-size: .72rem; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.eh-hop-path { font-size: .82rem; color: var(--text-primary); font-weight: 600; }
.eh-hop-raw { font-size: .7rem; word-break: break-all; margin-top: .15rem; }

/* WebSocket tester */
.ws-state { font-size: .82rem; font-weight: 700; margin-top: .5rem; }
.ws-open { color: var(--success); } .ws-closed { color: var(--text-muted); } .ws-connecting { color: #f59e0b; }
.ws-log { display: flex; flex-direction: column; gap: .25rem; max-height: 380px; overflow: auto; font-family: ui-monospace, monospace; font-size: .78rem; }
.ws-line { padding: .3rem .45rem; border-radius: var(--radius-sm); background: rgba(0,0,0,.24); word-break: break-word; }
.ws-time { color: var(--text-muted); font-size: .68rem; margin-right: .3rem; }
.ws-in { border-left: 2px solid var(--success); } .ws-out { border-left: 2px solid var(--accent-2); }
.ws-sys { color: var(--text-muted); } .ws-err { color: var(--danger); border-left: 2px solid var(--danger); }

.jwt-out { color: var(--text-primary); }

/* ── 3. app-wide frosted-glass blur (mirrors dashboard cards) ───────────── */
.util-pane,
.studio-tool-card,
.studio-hub-section,
.glass-card {
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
}
.util-pane { background: var(--glass, rgba(255,255,255,.04)); border: 1px solid var(--glass-border); }
.util-preview-box {
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  background: rgba(0,0,0,.18);
}

/* ── 4. global mobile-responsive pass ───────────────────────────────────── */
@media (max-width: 860px) {
  .util-grid { grid-template-columns: 1fr !important; gap: .85rem; }
  .wc-clocks { grid-template-columns: repeat(auto-fill, minmax(min(100%, 120px), 1fr)); }
}

@media (max-width: 768px) {
  /* hub headers / titles scale down */
  .studio-hub-title { font-size: 1.35rem !important; }
  .studio-hub-sub { font-size: .82rem !important; }
  .studio-hub-wrap { padding-left: .85rem !important; padding-right: .85rem !important; }
  .studio-section-head h3 { font-size: 1rem !important; }
  .studio-section-head p { font-size: .78rem !important; }
  .studio-hub-grid { gap: 1rem !important; }

  /* tool cards: comfortable 2-up that never overflows */
  .studio-tool-cards { display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: .55rem !important; }
  .studio-tool-card { padding: .7rem .6rem !important; }
  .tool-card-name { font-size: .82rem !important; }
  .tool-card-desc { font-size: .7rem !important; }

  /* breadcrumb wraps instead of overflowing */
  .breadcrumb, .util-breadcrumb, [class*="breadcrumb"] { flex-wrap: wrap !important; row-gap: .25rem; }

  /* dashboard hero text down a notch */
  .dash-title { font-size: 1.45rem !important; }
  .dash-sub { font-size: .82rem !important; }
  .dash-hero { padding: 1rem 1.05rem !important; }

  /* sci calculator keys a touch smaller */
  .sci-key { padding: .6rem .2rem; font-size: .86rem; }
  .sw-display { font-size: 2.1rem; }

  /* big result / code blocks never blow out the viewport */
  .util-bigresult { font-size: 1.15rem; }
  .util-code-out, .ws-log, .hr-list, .cj-table-wrap { max-height: 320px; }
}

@media (max-width: 480px) {
  .studio-hub-title { font-size: 1.18rem !important; }
  .studio-tool-cards { grid-template-columns: 1fr !important; }
  .util-pane { padding: .85rem .8rem 1rem !important; }
  .util-seg { width: 100%; justify-content: center; }
  .util-seg-btn { padding: .4rem .6rem; font-size: .78rem; }
  .util-inline { gap: .4rem; }
  .pct-in { width: 70px !important; }
  .sw-display { font-size: 1.8rem; }
  .util-bigresult { font-size: 1.05rem; }
  .wc-clocks { grid-template-columns: repeat(auto-fill, minmax(min(100%, 104px), 1fr)); }
  /* keep number/text inputs from forcing horizontal scroll */
  .tool-input, .tool-select, .util-textarea { max-width: 100%; }
  /* dashboard stat numbers / titles */
  .dash-title { font-size: 1.25rem !important; }
}

/* very small / older phones: stop any accidental horizontal scroll */
@media (max-width: 380px) {
  .sci-row { gap: .3rem; }
  .sci-key { padding: .52rem .1rem; font-size: .8rem; }
  .lt-btns .util-mini-btn { font-size: .74rem; padding: .35rem .5rem; }
}

/* ===========================================================================
   NOTES APP — full layout override (mobile-first notebook → notes → editor)
   Loaded after style.css so these win. The shell now has THREE panes; old
   style.css treated it as a 2-column grid, which is the header/“new note”
   conflict this fixes.
   =========================================================================== */
.notes-app-shell {
  display: grid;
  grid-template-columns: 230px 300px 1fr;
  gap: 0; height: 100%; min-height: 66vh;
  background: transparent; position: relative; overflow: hidden;
  border-radius: var(--radius-md);
}
.notes-sidebar  { border-radius: var(--radius-md) 0 0 var(--radius-md); }
.notes-main     { display: flex; flex-direction: column; overflow: hidden; border-right: 1px solid var(--glass-border); border-radius: 0; min-width: 0; }
.note-editor-wrap { flex: none; display: flex; flex-direction: column; overflow: hidden; padding: 0; gap: 0; border-radius: 0 var(--radius-md) var(--radius-md) 0; min-width: 0; }

/* Notes list header: back · title · new (search sits on its own row below) */
.notes-main-head { display: flex; align-items: center; gap: .5rem; padding: .7rem .85rem; border-bottom: 1px solid var(--glass-border); flex-shrink: 0; }
.notes-main-head h4 { flex: 1; min-width: 0; font-size: .95rem; font-weight: 700; margin: 0; display: flex; align-items: center; gap: .4rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.notes-main-head .notes-new-inline { flex-shrink: 0; }
.notes-search-wrap { margin: .55rem .85rem 0; flex: none; max-width: none; }
.notes-search-wrap input { width: 100%; }
.notes-file-list { flex: 1; overflow-y: auto; padding: .35rem 0 4rem; }

/* per-note rename/delete actions */
.note-file-item { position: relative; align-items: center; }
.note-file-actions { display: flex; gap: .15rem; flex-shrink: 0; opacity: 0; transition: opacity var(--t-fast, .15s); }
.note-file-item:hover .note-file-actions, .note-file-item.active .note-file-actions { opacity: 1; }
.note-file-actions button { background: transparent; border: none; color: var(--text-muted); cursor: pointer; padding: .25rem .35rem; border-radius: 6px; font-size: .82rem; line-height: 1; }
.note-file-actions button:hover { background: rgba(255,255,255,.1); color: var(--text-primary); }
.note-file-actions .nfile-del:hover { color: var(--danger); background: rgba(248,113,113,.14); }

/* editor: top bar + content */
.note-editor-bar { display: flex; align-items: center; gap: .5rem; padding: .6rem .8rem; border-bottom: 1px solid var(--glass-border); flex-shrink: 0; }
.note-editor-barttl { flex: 1; min-width: 0; font-weight: 700; font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text-primary); }
.note-editor-baracts { display: flex; gap: .35rem; flex-shrink: 0; }
.note-editor-content { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: .55rem; padding: .9rem; overflow: hidden; }
.note-editor-title { font-size: 1.1rem; font-weight: 700; background: none; border: none; outline: none; color: var(--text-primary); width: 100%; padding: .3rem .35rem; border-radius: 6px; }
.note-editor-title:focus { background: rgba(255,255,255,.06); }
.note-editor-body { flex: 1; min-height: 0; resize: none; }
.note-editor-foot { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; flex-shrink: 0; }
.note-editor-foot .util-muted { font-size: .73rem; }

/* back buttons + FAB — hidden on desktop, shown on mobile */
.notes-back { display: none; align-items: center; justify-content: center; background: var(--glass); border: 1px solid var(--glass-border); color: var(--text-secondary); width: 34px; height: 34px; border-radius: 9px; cursor: pointer; flex-shrink: 0; font-size: 1rem; }
.notes-back:hover { background: var(--glass-hover); color: var(--text-primary); }
.notes-fab { display: none; position: absolute; right: 1rem; bottom: 1rem; width: 52px; height: 52px; border-radius: 50%; border: none; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; font-size: 1.4rem; box-shadow: 0 8px 22px rgba(124,58,237,.45); cursor: pointer; z-index: 5; align-items: center; justify-content: center; }
.notes-fab:active { transform: scale(.92); }

/* ── mobile: one pane at a time (drill-down) ───────────────────────────── */
@media (max-width: 760px) {
  .notes-app-shell { display: block; min-height: 74vh; height: 74vh; }
  .notes-app-shell > #notesPaneFolders,
  .notes-app-shell > #notesPaneList,
  .notes-app-shell > #notesPaneEditor { display: none; height: 100%; border-radius: var(--radius-md); }
  .notes-app-shell[data-pane="folders"] > #notesPaneFolders { display: flex; }
  .notes-app-shell[data-pane="list"]    > #notesPaneList    { display: flex; }
  .notes-app-shell[data-pane="editor"]  > #notesPaneEditor  { display: flex; }
  .notes-main { border-right: none; }
  .notes-back { display: inline-flex; }
  .notes-fab  { display: flex; }
  .notes-new-inline { padding: .4rem .55rem; }
  .note-file-actions { opacity: 1; }          /* always tappable on touch */
  .notes-folder-item { padding: .7rem .9rem; font-size: .92rem; }  /* bigger touch targets */
  .note-file-item { padding: .85rem .9rem; }
}
@media (max-width: 420px) {
  .notes-new-txt { display: none; }            /* icon-only new button; FAB is primary */
  .notes-app-shell { height: 78vh; min-height: 78vh; }
}

/* ===========================================================================
   NETWORK & CYBER — animated "live probe" loading + streaming reveal
   =========================================================================== */
.net-out.net-loading { display: flex; align-items: center; min-height: 120px; }
.net-out.net-error { color: var(--danger); }
.net-out { transition: box-shadow .3s; }
.net-out.net-loading, .net-running ~ * .net-out { box-shadow: 0 0 0 1px rgba(167,139,250,.35), inset 0 0 26px rgba(124,58,237,.12); }

.net-probe { display: flex; align-items: center; gap: 1rem; width: 100%; }
.net-radar {
  position: relative; flex: 0 0 auto; width: 64px; height: 64px; border-radius: 50%;
  background: radial-gradient(circle, rgba(124,58,237,.12), transparent 70%);
  display: flex; align-items: center; justify-content: center;
}
.net-radar i { color: var(--accent-2); font-size: 1.2rem; z-index: 2; }
.net-radar::after {            /* sweeping radar beam */
  content: ''; position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(from 0deg, rgba(167,139,250,.55), transparent 60deg);
  -webkit-mask: radial-gradient(circle, transparent 30%, #000 31%);
          mask: radial-gradient(circle, transparent 30%, #000 31%);
  animation: net-sweep 1.1s linear infinite;
}
.net-radar span {              /* concentric pulse rings */
  position: absolute; inset: 0; border: 1px solid rgba(167,139,250,.5); border-radius: 50%;
  animation: net-ping 1.8s cubic-bezier(0,0,.2,1) infinite; opacity: 0;
}
.net-radar span:nth-child(2) { animation-delay: .6s; }
.net-radar span:nth-child(3) { animation-delay: 1.2s; }
@keyframes net-sweep { to { transform: rotate(360deg); } }
@keyframes net-ping { 0% { transform: scale(.4); opacity: .7; } 100% { transform: scale(1.15); opacity: 0; } }

.net-probe-txt { flex: 1; min-width: 0; }
.net-probe-host { font-weight: 700; color: var(--text-primary); font-size: .9rem; word-break: break-all; }
.net-probe-status { color: var(--accent-2); font-size: .82rem; margin-top: .2rem; }
.net-probe-status::after { content: '▋'; margin-left: 2px; animation: net-blink 1s step-end infinite; }
@keyframes net-blink { 50% { opacity: 0; } }
.net-probe-timer { flex: 0 0 auto; font-family: ui-monospace, monospace; font-size: 1.1rem; font-weight: 700; color: var(--text-secondary); }

/* Run button: subtle pulse while a probe is in flight */
.btn-primary-gl.net-running { position: relative; opacity: .85; }
.btn-primary-gl.net-running i { animation: net-spin 0.8s linear infinite; }
@keyframes net-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .net-radar::after, .net-radar span, .net-probe-status::after, .btn-primary-gl.net-running i { animation: none; }
}

/* ===========================================================================
   APPS — Whiteboard, Kanban, Time Management, Expense, Habit, SEO Toolkit
   =========================================================================== */
/* Whiteboard */
.wb-app { display: flex; flex-direction: column; gap: .6rem; padding: .8rem; }
/* Groups flow left-to-right with one consistent gap; the board name + save / share /
   lock / export / fullscreen controls sit together on the right (margin-left:auto)
   instead of being flung apart by space-between, which left big gaps in the toolbar. */
.wb-bar { display: flex; flex-wrap: wrap; gap: .4rem .5rem; align-items: center; justify-content: flex-start; }
.wb-tools, .wb-opts, .wb-proj { display: flex; align-items: center; gap: .3rem; flex-wrap: wrap; }
.wb-proj { margin-left: auto; }
.wb-tool { width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; background: var(--glass); border: 1px solid var(--glass-border); color: var(--text-secondary); cursor: pointer; transition: background .15s, color .15s; }
.wb-tool:hover { background: var(--glass-hover); color: var(--text-primary); }
.wb-tool.active { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; border-color: transparent; }
.wb-opts input[type=color] { width: 34px; height: 34px; padding: 2px; border: 1px solid var(--glass-border); border-radius: 8px; background: var(--glass-inset); }
.wb-opts input[type=range] { width: 90px; }
.wb-stage { overflow: auto; background: repeating-conic-gradient(#0000000d 0% 25%, transparent 0% 50%) 50% / 22px 22px; border: 1px solid var(--glass-border); border-radius: var(--radius-sm); padding: 8px; max-height: 64vh; }
.wb-stage canvas { box-shadow: 0 6px 22px rgba(0,0,0,.3); border-radius: 4px; }
.wb-status { font-size: .78rem; color: var(--text-muted); min-height: 1.2em; }
/* Full screen: make the editor fill the viewport and let the stage (canvas area)
   grow so resizeCanvas() reads the full size and the board itself goes full screen.
   Targets the :fullscreen element AND the .wb-fullscreen class the JS toggles. */
#wbEditor:fullscreen, #wbEditor:-webkit-full-screen, #wbEditor.wb-fullscreen {
  width: 100vw; height: 100vh; box-sizing: border-box; padding: .6rem;
  display: flex; flex-direction: column; gap: .5rem;
  background: var(--bg-base, #0d0b1e);
}
#wbEditor:fullscreen .wb-bar, #wbEditor:-webkit-full-screen .wb-bar, #wbEditor.wb-fullscreen .wb-bar { flex: 0 0 auto; }
#wbEditor:fullscreen .wb-stage, #wbEditor:-webkit-full-screen .wb-stage, #wbEditor.wb-fullscreen .wb-stage {
  flex: 1 1 auto; min-height: 0; max-height: none;
  display: flex; align-items: flex-start; justify-content: center;
}
#wbEditor:fullscreen .wb-status, #wbEditor:-webkit-full-screen .wb-status, #wbEditor.wb-fullscreen .wb-status { flex: 0 0 auto; }

/* Kanban */
.kb-app { display: grid; grid-template-columns: repeat(3, 1fr); gap: .7rem; padding: .4rem; align-items: start; }
.kb-col { background: rgba(0,0,0,.2); border: 1px solid var(--glass-border); border-radius: var(--radius-md); padding: .6rem; display: flex; flex-direction: column; gap: .5rem; min-height: 120px; }
.kb-col-head { display: flex; justify-content: space-between; align-items: center; font-weight: 700; font-size: .85rem; color: var(--text-secondary); }
.kb-count { background: rgba(167,139,250,.18); color: var(--accent-2); border-radius: 999px; padding: 0 .5rem; font-size: .72rem; }
.kb-cards { display: flex; flex-direction: column; gap: .45rem; min-height: 40px; }
.kb-card { position: relative; display: flex; flex-direction: column; gap: .45rem; background: var(--glass); border: 1px solid var(--glass-border); border-left: 3px solid var(--glass-border); border-radius: 8px; padding: .55rem .65rem; cursor: grab; font-size: .84rem; color: var(--text-primary); transition: border-color .15s, transform .1s, box-shadow .15s; }
.kb-card:hover { border-color: rgba(167,139,250,.45); box-shadow: 0 4px 14px rgba(0,0,0,.25); }
.kb-card:active { cursor: grabbing; }
.kb-card-text { flex: 1; word-break: break-word; }
.kb-del { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 1.1rem; line-height: 1; padding: 0 .2rem; }
.kb-del:hover { color: var(--danger); }
.kb-ghost { opacity: .4; }
.kb-input { font-size: .82rem; }

/* Kanban — professional card layout (title + assignee + priority + due) */
.kb-card.pr-urgent { border-left-color: #ef4444; }
.kb-card.pr-high   { border-left-color: #f59e0b; }
.kb-card.pr-normal { border-left-color: #60a5fa; }
.kb-card.pr-low    { border-left-color: #34d399; }
.kb-card-title { font-weight: 600; line-height: 1.35; word-break: break-word; padding-right: 3.4rem; }
.kb-card-desc { margin-top: .3rem; font-size: .78rem; line-height: 1.4; color: var(--text-muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.kb-card-foot { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.kb-assignee { display: inline-flex; align-items: center; gap: .35rem; min-width: 0; color: var(--text-secondary); font-size: .76rem; }
.kb-assignee .mini-av { width: 18px; height: 18px; font-size: .62rem; }
.kb-assignee-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 9rem; }
.kb-card-foot .kb-due { margin-left: auto; }
.kb-pr-tag { position: absolute; top: .5rem; right: .55rem; font-size: .6rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; padding: .1rem .4rem; border-radius: 5px; }
.kb-pr-urgent { background: rgba(239,68,68,.18); color: #f87171; }
.kb-pr-high   { background: rgba(245,158,11,.18); color: #f59e0b; }
.kb-pr-normal { background: rgba(96,165,250,.16); color: #60a5fa; }
.kb-pr-low    { background: rgba(52,211,153,.16); color: #34d399; }
.kb-add-btn { background: rgba(255,255,255,.04); border: 1px dashed var(--glass-border); color: var(--text-muted); border-radius: 8px; padding: .45rem; font-size: .8rem; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: .35rem; transition: background .15s, color .15s, border-color .15s; }
.kb-add-btn:hover { background: var(--glass-hover); color: var(--text-primary); border-color: rgba(167,139,250,.5); }
.kb-scope { font-size: .76rem; color: var(--text-muted); display: inline-flex; align-items: center; gap: .3rem; }
.kb-filter { max-width: 170px; width: auto; font-size: .82rem; color: var(--text-primary); background-color: rgba(15,13,26,.85); }
/* Native dropdown list — force dark-theme colours so options are readable (was
   unreadable system-default text on the dark board). */
.kb-toolbar select option, .kb-filter option, select.tool-input option, .tool-select option {
  background-color: #16131f; color: #e8eaf2;
}

/* Kanban — task editor modal */
.kb-modal { position: fixed; inset: 0; z-index: 1500; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.kb-modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.55); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.kb-modal-card { position: relative; z-index: 1; width: 100%; max-width: 460px; max-height: 90vh; overflow: auto; background: var(--glass); -webkit-backdrop-filter: blur(28px); backdrop-filter: blur(28px); border: 1px solid var(--glass-border); border-radius: 16px; box-shadow: 0 24px 70px rgba(0,0,0,.6); }
.kb-modal-head { display: flex; align-items: center; justify-content: space-between; padding: .9rem 1.1rem; border-bottom: 1px solid var(--glass-border); }
.kb-modal-head h3 { margin: 0; font-size: 1.02rem; }
.kb-modal-x { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 1.05rem; line-height: 1; }
.kb-modal-x:hover { color: var(--text-primary); }
.kb-modal-body { padding: 1rem 1.1rem; display: flex; flex-direction: column; gap: .7rem; }
.kb-f { display: flex; flex-direction: column; gap: .3rem; font-size: .8rem; color: var(--text-secondary); }
.kb-f > span { font-weight: 600; }
.kb-f-row { display: flex; gap: .7rem; }
.kb-f-row .kb-f { flex: 1; min-width: 0; }
.kb-modal-foot { display: flex; align-items: center; gap: .5rem; padding: .85rem 1.1rem; border-top: 1px solid var(--glass-border); }
.kb-modal-foot .btn-primary-gl, .kb-modal-foot .btn-secondary-gl { width: auto !important; padding: .5rem 1rem !important; }
.kb-del-btn { color: #f87171; }
.kb-del-btn:hover { color: #fff; background: rgba(239,68,68,.2); }

/* Time Management */
.tm-timer { font-family: ui-monospace, monospace; font-size: 2.4rem; font-weight: 800; text-align: center; color: var(--accent-2); letter-spacing: 1px; padding: .5rem 0; }

/* Habit tracker */
.hb-list { display: flex; flex-direction: column; gap: .6rem; }
.hb-row { background: rgba(0,0,0,.2); border: 1px solid var(--glass-border); border-radius: var(--radius-sm); padding: .6rem .7rem; }
.hb-name { display: flex; align-items: center; gap: .5rem; font-weight: 600; font-size: .9rem; }
.hb-name > span:first-child { flex: 1; }
.hb-streak { color: #f59e0b; font-size: .82rem; }
.hb-del { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 1.1rem; }
.hb-del:hover { color: var(--danger); }
.hb-week { display: grid; grid-template-columns: repeat(7, 1fr); gap: .35rem; margin-top: .5rem; }
.hb-cell { aspect-ratio: 1; border-radius: 8px; border: 1px solid var(--glass-border); background: var(--glass-inset); color: var(--text-muted); font-size: .72rem; cursor: pointer; transition: background .15s, transform .1s; }
.hb-cell:hover { transform: scale(1.06); }
.hb-cell.on { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; border-color: transparent; }

/* SEO Toolkit app */
.seo-app { padding: .5rem; }
.seo-app-hero { display: flex; align-items: center; gap: .9rem; padding: 1rem 1.1rem; margin-bottom: 1rem; border-radius: var(--radius-md); background: linear-gradient(135deg, rgba(124,58,237,.18), rgba(14,165,233,.12)); border: 1px solid var(--glass-border); }
.seo-app-hero-ic { width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.4rem; color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-2)); flex: 0 0 auto; }
.seo-app-hero h3 { margin: 0; font-size: 1.15rem; }
.seo-app-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr)); gap: .7rem; }
.seo-app-tile { display: flex; flex-direction: column; gap: .25rem; align-items: flex-start; text-align: left; padding: .85rem .9rem; border-radius: var(--radius-md); background: var(--glass); border: 1px solid var(--glass-border); color: var(--text-primary); cursor: pointer; transition: transform .12s, border-color .15s, background .15s; }
.seo-app-tile:hover { transform: translateY(-2px); border-color: rgba(167,139,250,.45); background: var(--glass-hover); }
.seo-app-tile > i { font-size: 1.3rem; color: var(--accent-2); }
.seo-app-name { font-weight: 700; font-size: .9rem; }
.seo-app-desc { font-size: .76rem; color: var(--text-muted); }

@media (max-width: 760px) {
  .kb-app { grid-template-columns: 1fr; }
  .wb-bar { gap: .4rem; }
  .wb-opts input[type=range] { width: 64px; }
  .tm-timer { font-size: 2rem; }
}

/* Kanban card colour label + whiteboard image button */
.kb-label { width: 13px; height: 13px; border-radius: 50%; border: 1px solid var(--glass-border); flex: 0 0 auto; margin-top: .15rem; cursor: pointer; transition: transform .1s; }
.kb-label:hover { transform: scale(1.25); }
.wb-tool#wbImgBtn { position: relative; overflow: hidden; }
.wb-tool#wbImgBtn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.wb-tool#wbFill.active, .wb-tool#wbImgBtn:hover { background: var(--glass-hover); color: var(--text-primary); }

/* Whiteboard projects landing (like Diagrams) */
.wb-projects { padding: 1rem 1.1rem; }
.wb-proj-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.wb-proj-head h3 { margin: 0; font-size: 1.1rem; display: flex; align-items: center; gap: .5rem; }
.wb-proj-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 170px), 1fr)); gap: .8rem; }
.wb-proj-card { position: relative; display: flex; flex-direction: column; gap: 0; padding: 0; border-radius: var(--radius-md); background: var(--glass); border: 1px solid var(--glass-border); cursor: pointer; overflow: hidden; transition: transform .12s, border-color .15s; text-align: left; }
.wb-proj-card:hover { transform: translateY(-2px); border-color: rgba(167,139,250,.45); }
.wb-proj-thumb { height: 96px; display: flex; align-items: center; justify-content: center; font-size: 2rem; color: var(--accent-2); background: repeating-conic-gradient(#0000000d 0% 25%, transparent 0% 50%) 50% / 18px 18px; border-bottom: 1px solid var(--glass-border); }
.wb-proj-meta { display: flex; flex-direction: column; padding: .55rem .65rem; }
.wb-proj-name { font-weight: 700; font-size: .86rem; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wb-proj-sub { font-size: .72rem; color: var(--text-muted); }
.wb-proj-del { position: absolute; top: .35rem; right: .35rem; width: 24px; height: 24px; border-radius: 6px; border: none; background: rgba(0,0,0,.45); color: #fff; cursor: pointer; font-size: 1rem; line-height: 1; opacity: 0; transition: opacity .15s; }
.wb-proj-card:hover .wb-proj-del { opacity: 1; }
.wb-proj-del:hover { background: var(--danger); }
.wb-proj-new { align-items: center; justify-content: center; gap: .4rem !important; flex-direction: column; min-height: 150px; color: var(--accent-2); border-style: dashed; }
.wb-proj-new i { font-size: 1.8rem; }
/* ─── New-whiteboard creation modal (diagram-style: name + starting canvas) ─── */
/* True viewport overlay (NOT confined to the section). Fixed + high z-index so it
   centres over the whole desktop view when the board list is short OR tall. */
.wb-create { position: fixed; inset: 0; z-index: 4000; display: flex; align-items: center; justify-content: center; padding: 1rem; overflow-y: auto;
  background: rgba(8,11,20,.6); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); }
/* Keep .wb-app as the editor's positioning context, but DON'T let its glass
   backdrop-filter become the containing block — that's what trapped the modal
   inside the section. Background/border stay; only the blur is dropped here. */
.wb-app { position: relative; -webkit-backdrop-filter: none; backdrop-filter: none; }
.wb-create-box { width: min(440px, 96vw); max-height: calc(100vh - 3rem); overflow-y: auto; padding: 1.1rem 1.2rem 1.2rem; border-radius: var(--radius-md); margin: auto; }
.wb-create-head { display: flex; align-items: center; justify-content: space-between; font-size: 1.02rem; font-weight: 700; color: var(--text-primary); margin-bottom: .9rem; }
.wb-create-head .bi { color: var(--accent-2); margin-right: .35rem; }
.wb-create-x { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 1rem; padding: .2rem; border-radius: 6px; }
.wb-create-x:hover { background: var(--glass-hover); color: var(--text-primary); }
.wb-create-lbl { display: block; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--text-muted); margin: .9rem 0 .4rem; }
.wb-create-lbl:first-of-type { margin-top: 0; }
.wb-tpl-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: .55rem; }
@media (max-width: 480px) { .wb-tpl-grid { grid-template-columns: repeat(2, 1fr); } }
.wb-tpl { display: flex; flex-direction: column; align-items: center; gap: .4rem; padding: .5rem .35rem; border-radius: 10px; cursor: pointer;
  background: rgba(255,255,255,.04); border: 1.5px solid var(--glass-border); color: var(--text-secondary); font-size: .73rem; transition: border-color .15s, background .15s, transform .12s; }
.wb-tpl:hover { transform: translateY(-2px); border-color: rgba(167,139,250,.4); }
.wb-tpl.active { border-color: var(--accent-2); background: rgba(124,58,237,.12); color: var(--text-primary); }
.wb-tpl-prev { width: 100%; height: 46px; border-radius: 7px; background-color: #fff; border: 1px solid #e2e8f0; }
.wb-tpl-prev.dots  { background-image: radial-gradient(#c4ccd6 1.3px, transparent 1.3px); background-size: 9px 9px; }
.wb-tpl-prev.lines { background-image: linear-gradient(#dbe2ea 1px, transparent 1px); background-size: 100% 9px; }
.wb-tpl-prev.grid  { background-image: linear-gradient(#dbe2ea 1px, transparent 1px), linear-gradient(90deg, #dbe2ea 1px, transparent 1px); background-size: 9px 9px; }
.wb-create-actions { display: flex; justify-content: flex-end; gap: .5rem; margin-top: 1.1rem; }
.wb-name-lbl { font-weight: 700; font-size: .85rem; color: var(--text-primary); max-width: 160px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; padding: .1rem .3rem; border-radius: 6px; }
.wb-name-lbl:hover { background: var(--glass-hover); }
.wb-name-lbl.wb-name-ro { cursor: default; opacity: .8; }
.wb-name-lbl.wb-name-ro:hover { background: none; }
/* Inline rename field (swaps in for the name label on click). */
.wb-name-input { width: 170px; max-width: 46vw; height: 30px; font-size: .85rem; font-weight: 600; padding: .15rem .45rem; }
/* Per-card ops (rename + delete) — both live in a top-right cluster, shown on hover. */
.wb-proj-ops { position: absolute; top: .35rem; right: .35rem; display: flex; gap: .25rem; opacity: 0; transition: opacity .15s; }
.wb-proj-card:hover .wb-proj-ops { opacity: 1; }
.wb-proj-rename, .wb-proj-ops .wb-proj-del { position: static; opacity: 1; width: 24px; height: 24px; display: inline-flex; align-items: center; justify-content: center; border-radius: 6px; border: none; background: rgba(0,0,0,.5); color: #fff; cursor: pointer; line-height: 1; }
.wb-proj-rename { font-size: .82rem; }
.wb-proj-rename:hover { background: var(--accent); }
/* Private / locked flags on the thumbnail. */
.wb-proj-flag { position: absolute; top: .35rem; left: .35rem; display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 6px; background: rgba(0,0,0,.5); color: #fff; font-size: .72rem; }
.wb-proj-flag.locked { left: 2.05rem; color: #fbbf24; }
/* Editor private/lock toggles — tinted when active. */
#wbPrivate.active { color: #38bdf8; border-color: rgba(56,189,248,.5); }
#wbLock.active { color: #fbbf24; border-color: rgba(251,191,36,.5); }
.wb-bar #wbBack { flex: 0 0 auto; }

/* Notes search — compact, fits the section (was oversized) */
.notes-search-wrap { margin: .5rem .85rem 0 !important; max-width: 260px !important; }
.notes-search-wrap input { height: 34px; font-size: .84rem; padding: .35rem .6rem .35rem 2rem; }
@media (max-width: 760px) { .notes-search-wrap { max-width: none !important; } }

/* Realtime chat */
.chat-log { display: flex; flex-direction: column; gap: .4rem; height: 340px; overflow-y: auto; padding: .3rem; }
.chat-msg { display: flex; gap: .4rem; align-items: flex-end; max-width: 85%; }
.chat-msg.mine { align-self: flex-end; flex-direction: row-reverse; }
.chat-bubble { background: var(--glass); border: 1px solid var(--glass-border); border-radius: 12px; padding: .4rem .6rem; }
.chat-msg.mine .chat-bubble { background: linear-gradient(135deg, rgba(124,58,237,.35), rgba(168,85,247,.3)); }
.chat-who { display: block; font-size: .68rem; font-weight: 700; color: var(--accent-2); }
.chat-text { font-size: .86rem; color: var(--text-primary); word-break: break-word; }
.chat-tr { font-size: .8rem; color: var(--text-secondary); margin-top: .2rem; border-top: 1px dashed var(--glass-border); padding-top: .2rem; }
.chat-trbtn { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: .9rem; flex: 0 0 auto; }
.chat-trbtn:hover { color: var(--accent-2); }
.chat-send { display: flex; gap: .4rem; margin-top: .5rem; }
.chat-send .tool-input { flex: 1; }

/* Video room */
.vr-videos { position: relative; background: #0b0b14; border: 1px solid var(--glass-border); border-radius: var(--radius-md); overflow: hidden; aspect-ratio: 16/10; }
.vr-vid { position: absolute; inset: 0; }
.vr-vid video { width: 100%; height: 100%; object-fit: cover; background: #0b0b14; }
.vr-local { inset: auto 10px 10px auto; width: 30%; max-width: 180px; aspect-ratio: 4/3; border-radius: 10px; overflow: hidden; border: 2px solid rgba(255,255,255,.25); box-shadow: 0 6px 18px rgba(0,0,0,.4); }
.vr-tag { position: absolute; left: 8px; bottom: 6px; font-size: .68rem; font-weight: 700; color: #fff; background: rgba(0,0,0,.5); padding: .1rem .4rem; border-radius: 5px; }
.vr-local .vr-tag { left: 6px; bottom: 4px; }

/* Network Request Monitor */
.nm-list { display: flex; flex-direction: column; gap: .2rem; max-height: 420px; overflow: auto; font-size: .78rem; }
.nm-row { display: grid; grid-template-columns: auto 1fr auto auto auto; gap: .5rem; align-items: center; padding: .3rem .45rem; border-radius: 6px; background: rgba(0,0,0,.22); }
.nm-row > i { color: var(--accent-2); }
.nm-url { font-family: ui-monospace, monospace; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text-primary); }
.nm-proto { font-size: .68rem; color: var(--text-muted); text-transform: uppercase; }
.nm-size { font-family: ui-monospace, monospace; color: var(--text-secondary); }
.nm-ms { font-family: ui-monospace, monospace; color: var(--accent-2); min-width: 44px; text-align: right; }

/* ===========================================================================
   WhatsApp-style chat (.wa-*) + Zoom/Teams-style video room (.vr-*)
   =========================================================================== */
.wa-app { display: flex; flex-direction: column; height: 70vh; min-height: 460px; border-radius: var(--radius-md); overflow: hidden; }
.wa-head { display: flex; align-items: center; justify-content: space-between; gap: .6rem; padding: .55rem .7rem; background: rgba(0,0,0,.3); border-bottom: 1px solid var(--glass-border); flex-wrap: wrap; }
.wa-room { display: flex; align-items: center; gap: .4rem; color: var(--accent-2); font-weight: 700; }
.wa-room-input { background: rgba(0,0,0,.3); border: 1px solid var(--glass-border); color: var(--text-primary); border-radius: 8px; padding: .3rem .55rem; max-width: 130px; }
.wa-opts { display: flex; align-items: center; gap: .5rem; }
.wa-log { flex: 1; overflow-y: auto; padding: .8rem; display: flex; flex-direction: column; gap: .4rem;
  background:
    radial-gradient(circle at 20% 10%, rgba(124,58,237,.06), transparent 40%),
    radial-gradient(circle at 80% 80%, rgba(14,165,233,.05), transparent 40%), rgba(0,0,0,.18); }
.wa-msg { display: flex; align-items: flex-end; gap: .4rem; max-width: 80%; align-self: flex-start; }
.wa-msg.mine { align-self: flex-end; flex-direction: row-reverse; }
.wa-avatar { flex: 0 0 auto; width: 26px; height: 26px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; display: flex; align-items: center; justify-content: center; font-size: .72rem; font-weight: 700; }
.wa-bubble { position: relative; background: var(--glass-solid, rgba(255,255,255,.09)); border: 1px solid var(--glass-border); border-radius: 12px 12px 12px 4px; padding: .4rem .6rem .9rem; min-width: 70px; }
.wa-msg.mine .wa-bubble { background: linear-gradient(135deg, rgba(167,139,250,.32), rgba(56,189,248,.24)); border-radius: 12px 12px 4px 12px; }
.wa-bubble.wa-del { opacity: .6; font-style: italic; padding: .45rem .6rem; }
.wa-who { display: block; font-size: .68rem; font-weight: 700; color: var(--accent-2); margin-bottom: .1rem; }
.wa-text { font-size: .88rem; color: var(--text-primary); word-break: break-word; white-space: pre-wrap; }
.wa-meta { position: absolute; right: .55rem; bottom: .25rem; font-size: .62rem; color: var(--text-muted); }
.wa-trbox { font-size: .8rem; color: var(--text-secondary); margin-top: .3rem; padding-top: .25rem; border-top: 1px dashed var(--glass-border); }
.wa-acts { display: flex; gap: .1rem; opacity: 0; transition: opacity .15s; align-self: center; }
.wa-msg:hover .wa-acts { opacity: 1; }
.wa-act { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: .82rem; padding: .15rem .25rem; border-radius: 5px; }
.wa-act:hover { color: var(--accent-2); background: rgba(255,255,255,.08); }
.wa-act.wa-del-btn:hover { color: var(--danger); }
.wa-editbar { display: flex; align-items: center; gap: .4rem; font-size: .76rem; color: var(--accent-2); padding: .3rem .7rem; background: rgba(167,139,250,.1); }
.wa-editbar .wa-x { margin-left: auto; background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 1.1rem; }
.wa-send { display: flex; gap: .5rem; padding: .55rem .7rem; background: rgba(0,0,0,.3); border-top: 1px solid var(--glass-border); }
.wa-input { flex: 1; background: rgba(0,0,0,.3); border: 1px solid var(--glass-border); color: var(--text-primary); border-radius: 999px; padding: .55rem .9rem; }
.wa-sendbtn { flex: 0 0 auto; width: 42px; height: 42px; border-radius: 50%; border: none; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; cursor: pointer; font-size: 1rem; }
.wa-sendbtn:disabled { opacity: .5; }

/* Video room */
.vr-app { display: flex; flex-direction: column; gap: 0; overflow: hidden; }
.vr-topbar { display: flex; align-items: center; justify-content: space-between; gap: .6rem; padding: .55rem .8rem; flex-wrap: wrap; }
.vr-title { font-weight: 700; color: var(--accent-2); display: flex; align-items: center; gap: .4rem; }
.vr-join { display: flex; gap: .4rem; align-items: center; }
.vr-join .tool-input { max-width: 140px; }
.vr-stage { position: relative; background: #0a0a12; aspect-ratio: 16/9; overflow: hidden; }
/* Desktop-class video room: give the stage real height so it feels like a
   dedicated call window, not a small embedded widget. */
@media (min-width: 821px) {
  .vr-app { max-width: 1100px; margin-inline: auto; }
  .vr-stage { aspect-ratio: auto; min-height: clamp(440px, 58vh, 720px); }
}
.vr-stage:fullscreen { min-height: 0; height: 100%; aspect-ratio: auto; }
.vr-stage:fullscreen > #vrRemote { height: 100%; }
.vr-stage > #vrRemote { width: 100%; height: 100%; object-fit: contain; background: #0a0a12; }
.vr-empty { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .5rem; color: var(--text-muted); text-align: center; padding: 1rem; }
.vr-empty i { font-size: 2.6rem; opacity: .4; }
.vr-pip { position: absolute; right: 14px; bottom: 14px; width: 26%; max-width: 220px; aspect-ratio: 4/3; border-radius: 12px; overflow: hidden; border: 2px solid rgba(255,255,255,.3); box-shadow: 0 8px 24px rgba(0,0,0,.5); background: #000; }
.vr-pip video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.vr-tag { position: absolute; left: 6px; bottom: 5px; font-size: .64rem; font-weight: 700; color: #fff; background: rgba(0,0,0,.55); padding: .08rem .35rem; border-radius: 5px; }
/* ── mediasoup SFU participant grid (multi-party / Zoom-grade) ── */
.vr-count { font-size: .72rem; font-weight: 700; color: #fff; background: rgba(255,255,255,.14); padding: .12rem .5rem; border-radius: 999px; display: inline-flex; align-items: center; gap: .3rem; }
.vr-grid { position: absolute; inset: 0; display: grid; gap: .5rem; padding: .5rem; align-content: center; justify-items: stretch; }
.vr-tile { position: relative; background: #0b0e16; border-radius: 12px; overflow: hidden; aspect-ratio: 16/9; border: 2px solid transparent; min-height: 0; transition: border-color .15s; }
.vr-tile.speaking { border-color: var(--success, #34d399); box-shadow: 0 0 0 2px rgba(52,211,153,.35); }
.vr-tile video { width: 100%; height: 100%; object-fit: cover; background: #0b0e16; display: block; }
.vr-tile.vr-tile-novideo video { visibility: hidden; }
.vr-tile-ph { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; color: rgba(255,255,255,.25); font-size: 2.6rem; }
.vr-tile.vr-tile-novideo .vr-tile-ph { display: flex; }
.vr-tile-bar { position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: center; justify-content: space-between; gap: .4rem; padding: .28rem .5rem; background: linear-gradient(transparent, rgba(0,0,0,.62)); font-size: .76rem; color: #fff; }
.vr-tile-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.vr-tile-mic { font-size: .8rem; flex-shrink: 0; }
.vr-tile-mic.off { color: #f87171; }
.vr-controls { display: flex; align-items: center; justify-content: center; gap: .7rem; padding: .8rem; background: rgba(0,0,0,.35); flex-wrap: wrap; }
.vr-ctrl { width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--glass-border); background: var(--glass); color: var(--text-primary); cursor: pointer; font-size: 1.1rem; display: inline-flex; align-items: center; justify-content: center; transition: background .15s, transform .1s; }
.vr-ctrl:hover { background: var(--glass-hover); } .vr-ctrl:active { transform: scale(.92); }
.vr-ctrl:disabled { opacity: .4; cursor: default; }
.vr-ctrl.off { background: var(--danger); color: #fff; border-color: transparent; }
.vr-ctrl.vr-call { background: #16a34a; color: #fff; border-color: transparent; }
.vr-ctrl#vrShare.on { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; border-color: transparent; box-shadow: 0 0 0 3px rgba(167,139,250,.25); }
.vr-ctrl.vr-end { background: var(--danger); color: #fff; border-color: transparent; }
.vr-ctrl.vr-start { width: auto; border-radius: 999px; padding: 0 1.1rem; gap: .4rem; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; border-color: transparent; }
.vr-ctrl.vr-start span { font-size: .85rem; font-weight: 600; }
@media (max-width: 560px) { .wa-app { height: 76vh; } .vr-ctrl { width: 44px; height: 44px; } }

/* E2EE locked message bubble */
.wa-text.wa-locked { color: var(--text-muted); font-style: italic; }
.wa-text.wa-locked i { color: #f59e0b; }
#chKey, #vrKey { font-size: .82rem; }

/* ===========================================================================
   PROFESSIONAL POLISH — button sizing + mobile IDE layout
   The global .btn-primary-gl is width:100% (right for login forms, but a giant
   bar as a tool action button). Inside the tools/apps host, size to content.
   =========================================================================== */
#studioUtilContent .btn-primary-gl,
.wa-app .btn-primary-gl,
.vr-app .btn-primary-gl,
.seo-app .btn-primary-gl { width: auto; padding: .5rem 1.05rem; font-size: .86rem; display: inline-flex; align-items: center; gap: .4rem; }
#studioUtilContent .btn-primary-gl i { margin: 0; }

/* Tighten oversized controls generally inside tools */
#studioUtilContent .util-mini-btn { font-size: .8rem; }

/* ── Mobile "IDE" layout: anything oversized shrinks & stacks cleanly ─────── */
@media (max-width: 820px) {
  #studioUtilContent .btn-primary-gl { width: 100%; justify-content: center; }   /* full-width but normal height on phones */
  .util-grid { grid-template-columns: 1fr !important; }
  .util-pane { padding: .8rem .75rem 1rem !important; }
  .util-textarea { font-size: .82rem; }
  .wa-head, .vr-topbar { gap: .4rem; }
  .wa-opts { width: 100%; }
  .wa-opts #chKey, .wa-opts select { flex: 1; max-width: none !important; }
  .vr-join { width: 100%; flex-wrap: wrap; }
  .vr-join .tool-input { flex: 1; min-width: 90px; }
}
@media (max-width: 560px) {
  .studio-hub-title { font-size: 1.15rem !important; }
  .studio-tool-cards { grid-template-columns: 1fr !important; }
  .util-seg { width: 100%; justify-content: center; flex-wrap: wrap; }
  .util-out-head { flex-wrap: wrap; gap: .35rem; }
  .util-bigresult { font-size: 1rem; }
  .wb-bar, .wb-tools, .wb-opts, .wb-proj { gap: .3rem; }
  .wb-tool { width: 30px; height: 30px; font-size: .85rem; }
  .vr-controls { gap: .5rem; padding: .6rem; }
}

/* ===========================================================================
   Chat + Video — use the dashboard cards' frosted-glass UI (blur + tint)
   Dashboard card = linear-gradient(160deg, rgba(255,255,255,.07), .02) + blur(14px)
   =========================================================================== */
.wa-app, .vr-app {
  background: linear-gradient(160deg, rgba(255,255,255,.07), rgba(255,255,255,.02)) !important;
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
}
/* bars / send / controls: lighter frosted tint instead of heavy black */
.wa-head, .wa-send,
.vr-topbar, .vr-controls {
  background: linear-gradient(160deg, rgba(255,255,255,.06), rgba(255,255,255,.015)) !important;
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
}
.wa-editbar { background: linear-gradient(160deg, rgba(167,139,250,.16), rgba(167,139,250,.05)) !important; }
/* chat log: subtle frosted backdrop (keeps the soft accent glows) */
.wa-log {
  background:
    radial-gradient(circle at 20% 8%, rgba(124,58,237,.10), transparent 42%),
    radial-gradient(circle at 82% 86%, rgba(14,165,233,.08), transparent 42%),
    linear-gradient(160deg, rgba(255,255,255,.04), rgba(255,255,255,.01)) !important;
}
/* inputs + bubbles + round buttons: glassy, not black */
.wa-room-input, .wa-input { background: rgba(255,255,255,.06) !important; -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); }
.wa-bubble { background: linear-gradient(160deg, rgba(255,255,255,.10), rgba(255,255,255,.03)) !important; -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); }
.wa-msg.mine .wa-bubble { background: linear-gradient(135deg, rgba(167,139,250,.34), rgba(56,189,248,.22)) !important; border-color: rgba(167,139,250,.38) !important; }
.vr-ctrl { background: linear-gradient(160deg, rgba(255,255,255,.10), rgba(255,255,255,.03)); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); }
.vr-ctrl.vr-call { background: linear-gradient(135deg, #16a34a, #15803d); }
.vr-ctrl.vr-end, .vr-ctrl.off { background: linear-gradient(135deg, #ef4444, #dc2626); }
.vr-pip { border-color: rgba(255,255,255,.35); box-shadow: 0 8px 26px rgba(124,58,237,.35); }

/* ===========================================================================
   ROOMS LANDING — create → list → enter (chat + video). Owner + members +
   lock + private, admin-sees-all. Mirrors the dashboard project cards.
   =========================================================================== */
.rooms-host { display: block; }
.wa-back { background: rgba(255,255,255,.08); border: 1px solid var(--glass-border); color: var(--text-primary); width: 30px; height: 30px; border-radius: 50%; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; transition: background .15s; }
.wa-back:hover { background: var(--accent); color: #fff; border-color: transparent; }
.wa-room-name, #vrRoomName { font-weight: 700; }
.room-landing { display: flex; flex-direction: column; gap: 1rem; }
.room-landing-head { display: flex; align-items: center; justify-content: space-between; gap: .8rem; flex-wrap: wrap; }
.room-landing-head .studio-card-label { margin: 0; }
.room-landing-tools { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.room-joinbox { display: flex; align-items: center; gap: .35rem; }
.room-joinbox .room-join-code { max-width: 180px; }
.room-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: .9rem; }
.room-card { position: relative; display: flex; flex-direction: column; gap: .55rem; padding: 1rem; border-radius: var(--radius-md); border: 1px solid var(--glass-border); background: linear-gradient(160deg, rgba(255,255,255,.07), rgba(255,255,255,.02)); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); transition: transform .15s, border-color .15s, box-shadow .15s; }
.room-card:hover { transform: translateY(-2px); border-color: rgba(167,139,250,.45); box-shadow: 0 12px 30px rgba(0,0,0,.25); }
.room-card-top { display: flex; align-items: flex-start; gap: .6rem; }
.room-ic { flex: 0 0 auto; width: 40px; height: 40px; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center; font-size: 1.15rem; color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
.room-card-meta { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.room-name { font-weight: 700; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.room-sub { font-size: .76rem; color: var(--text-muted); }
.room-gear { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 1rem; padding: .15rem .3rem; border-radius: 6px; flex-shrink: 0; }
.room-gear:hover { color: var(--accent-2); background: rgba(255,255,255,.08); }
.room-badges { display: flex; gap: .35rem; flex-wrap: wrap; }
.room-badge { display: inline-flex; align-items: center; gap: .25rem; font-size: .68rem; font-weight: 700; padding: .15rem .5rem; border-radius: 999px; border: 1px solid transparent; }
.room-badge.pub  { color: #6ee7b7; background: rgba(16,185,129,.14); border-color: rgba(16,185,129,.3); }
.room-badge.priv { color: #c4b5fd; background: rgba(167,139,250,.16); border-color: rgba(167,139,250,.35); }
.room-badge.lock { color: #fcd34d; background: rgba(251,191,36,.14); border-color: rgba(251,191,36,.3); }
.room-card-actions { display: flex; gap: .4rem; margin-top: auto; }
.room-card-actions .room-enter { flex: 1; justify-content: center; }
.room-manage { display: flex; flex-direction: column; gap: .55rem; padding-top: .6rem; margin-top: .2rem; border-top: 1px dashed var(--glass-border); }
.room-add { display: flex; gap: .35rem; }
.room-add .room-add-user { flex: 1; min-width: 0; }
.room-mems { display: flex; flex-wrap: wrap; gap: .35rem; }
.room-mem { display: inline-flex; align-items: center; gap: .3rem; font-size: .74rem; font-weight: 600; padding: .15rem .25rem .15rem .55rem; border-radius: 999px; background: rgba(255,255,255,.08); border: 1px solid var(--glass-border); }
.room-mem-x { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 1rem; line-height: 1; padding: 0 .15rem; border-radius: 50%; }
.room-mem-x:hover { color: var(--danger); }
.room-toggles { display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; font-size: .8rem; }
.room-card.room-new { align-items: center; justify-content: center; gap: .5rem; min-height: 150px; border-style: dashed; color: var(--accent); cursor: pointer; text-align: center; font-weight: 600; }
.room-card.room-new i { font-size: 1.8rem; }
.room-card.room-new:hover { color: #fff; background: linear-gradient(135deg, rgba(167,139,250,.22), rgba(56,189,248,.16)); }
@media (max-width: 560px) {
  .room-grid { grid-template-columns: 1fr; }
  .room-landing-head { gap: .5rem; }
  .room-landing-tools, .room-joinbox { width: 100%; }
  .room-joinbox .room-join-code { flex: 1; max-width: none; }
  .room-landing-tools .room-search { flex: 1; max-width: none !important; }
}

/* ===========================================================================
   INTRO ORBIT FIX
   .intro-shell has overflow:hidden which clips orbit icons that extend 29px
   outside their container. The parent .intro-screen already has overflow-x:hidden
   so no horizontal scroll is introduced by removing this clip.
   Also raise the orbit on desktop via align-self so it stays near the top of
   the grid cell (the chips section makes the left column tall; centering pushed
   the orbit too far down).
   =========================================================================== */
.intro-shell { overflow: visible !important; }
@media (min-width: 769px) {
  .intro-orbit { align-self: flex-start; padding-top: clamp(1.5rem, 3vw, 3rem); }
}

/* ===========================================================================
   COMPREHENSIVE MOBILE DEEP-FIX
   Dashboard cards, stat grids, hub nav cards, tools grid, and hub sections
   are still oversized on phones. These rules override style.css defaults
   (loaded first) via !important so they always win on small viewports.
   =========================================================================== */

/* ── 768 px (tablets / large phones landscape) ─────────────────────────── */
@media (max-width: 768px) {
  /* page chrome */
  .dash-main  { padding: 1rem !important; }
  .dash-wrap  { gap: 1.25rem !important; }
  .dash-section { gap: .75rem !important; }

  /* stat cards row */
  .dash-stats-grid { gap: .65rem !important; }
  .dash-stat-card  { padding: .75rem .85rem !important; gap: .65rem !important; }
  .dash-stat-ic    { width: 36px !important; height: 36px !important; font-size: 1rem !important; }
  .dash-stat-num   { font-size: 1.15rem !important; }

  /* hub nav cards */
  .dash-hub-grid   { gap: .65rem !important; }
  .dash-hub-card   { padding: .75rem 1rem !important; gap: .75rem !important; }
  .dash-hub-ic     { width: 38px !important; height: 38px !important; font-size: 1.1rem !important; }

  /* recent / pinned tools grid */
  .dash-tools-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px),1fr)) !important; gap: .65rem !important; }
  .dash-tool-card  { padding: .8rem .85rem !important; }
  .dash-tool-ic    { width: 36px !important; height: 36px !important; margin-bottom: .55rem !important; }
}

/* ── 480 px (phones portrait) ──────────────────────────────────────────── */
@media (max-width: 480px) {
  /* page chrome */
  .dash-main  { padding: .7rem !important; }
  .dash-wrap  { gap: .85rem !important; }
  .dash-section { gap: .6rem !important; }
  .dash-section-title { font-size: .72rem !important; }

  /* stat cards: force 2-col on narrow phones */
  .dash-stats-grid { grid-template-columns: repeat(2, 1fr) !important; gap: .5rem !important; }
  .dash-stat-card  { padding: .58rem .65rem !important; gap: .45rem !important; }
  .dash-stat-ic    { width: 30px !important; height: 30px !important; font-size: .86rem !important; border-radius: 8px !important; }
  .dash-stat-num   { font-size: .95rem !important; }
  .dash-stat-lbl   { font-size: .62rem !important; }

  /* hub nav cards: full-width + tighter padding */
  .dash-hub-grid   { grid-template-columns: 1fr !important; gap: .45rem !important; }
  .dash-hub-card   { padding: .6rem .8rem !important; gap: .6rem !important; }
  .dash-hub-ic     { width: 34px !important; height: 34px !important; font-size: .95rem !important; border-radius: 9px !important; }
  .dash-hub-body strong { font-size: .82rem !important; }
  .dash-hub-body p      { font-size: .7rem !important; }

  /* recent tools: 2 columns, compact cards */
  .dash-tools-grid  { grid-template-columns: repeat(2, 1fr) !important; gap: .5rem !important; }
  .dash-tool-card   { padding: .6rem .65rem !important; }
  .dash-tool-ic     { width: 32px !important; height: 32px !important; font-size: .88rem !important; border-radius: 9px !important; margin-bottom: .45rem !important; }
  .dash-tool-card strong { font-size: .78rem !important; }
  .dash-tool-card p      { font-size: .65rem !important; }

  /* hub section content area */
  .studio-hub-section  { padding: .7rem .75rem !important; margin-bottom: .85rem !important; }
  .studio-section-head { margin-bottom: .55rem !important; }
  .studio-section-head h3 { font-size: .9rem !important; }
  .studio-section-head p  { font-size: .7rem !important; }
  .studio-section-icon { width: 38px !important; height: 38px !important; font-size: 1.05rem !important; border-radius: 9px !important; }

  /* feat intro cards: reduce padding */
  .feat-card { padding: .85rem .9rem !important; }
  .feat-card h3 { font-size: .88rem !important; }
  .feat-card p  { font-size: .78rem !important; }
}

/* ── 380 px (very small / older phones) ────────────────────────────────── */
@media (max-width: 380px) {
  .dash-main { padding: .5rem !important; }
  .dash-stats-grid { gap: .38rem !important; }
  .dash-stat-card  { padding: .5rem .55rem !important; gap: .35rem !important; }
  .dash-stat-ic    { width: 26px !important; height: 26px !important; font-size: .76rem !important; }
  .dash-stat-num   { font-size: .88rem !important; }
  .dash-tools-grid  { gap: .38rem !important; }
  .dash-tool-card   { padding: .5rem .55rem !important; }
  .studio-hub-section { padding: .55rem .6rem !important; }
  .feat-card { padding: .7rem .75rem !important; }
}

/* ===========================================================================
   NEW TOOLS — Invoice preview (Business Suite)
   =========================================================================== */
.inv-preview { background: rgba(255,255,255,.04); border: 1px solid var(--glass-border); border-radius: var(--radius-md); padding: .9rem; min-height: 120px; }
.inv-doc { font-size: .82rem; color: var(--text-primary); }
.inv-hd { display: flex; align-items: flex-start; justify-content: space-between; gap: .5rem; flex-wrap: wrap; padding-bottom: .5rem; border-bottom: 1px solid var(--glass-border); }
.inv-tbl { width: 100%; border-collapse: collapse; margin: .5rem 0; font-size: .8rem; }
.inv-tbl th, .inv-tbl td { text-align: left; padding: .3rem .4rem; border-bottom: 1px solid var(--glass-border); }
.inv-tbl th { color: var(--text-secondary); font-weight: 600; }
.inv-tbl td:nth-child(n+2), .inv-tbl th:nth-child(n+2) { text-align: right; }
.inv-tot { text-align: right; margin-top: .5rem; line-height: 1.6; }
.inv-tot strong { font-size: 1.05rem; color: var(--accent-2); }

/* ===========================================================================
   TOOL FAVORITES (★) + RECENT — advanced feature shared by every Tools-Hub tool
   =========================================================================== */
.studio-tool-card { position: relative; }
.tool-fav-star {
  position: absolute; top: 6px; right: 8px; z-index: 3;
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; border-radius: 50%; cursor: pointer;
  color: var(--text-muted); font-size: .92rem; opacity: 0;
  transition: opacity .15s, color .15s, background .15s, transform .1s;
}
.studio-tool-card:hover .tool-fav-star { opacity: 1; }
.tool-fav-star:hover { background: rgba(255,255,255,.1); color: #fbbf24; transform: scale(1.12); }
.tool-fav-star.on { opacity: 1; color: #fbbf24; }
#hubQuickRow { display: flex; flex-direction: column; gap: .5rem; margin: .2rem 0 .4rem; }
.hub-quick { display: flex; align-items: flex-start; gap: .6rem; flex-wrap: wrap; }
.hub-quick-lbl { display: inline-flex; align-items: center; gap: .35rem; font-size: .76rem; font-weight: 700; color: var(--text-secondary); padding-top: .25rem; white-space: nowrap; }
.hub-quick-lbl .bi-star-fill { color: #fbbf24; }
.hub-chips { display: flex; flex-wrap: wrap; gap: .35rem; }
.hub-chip {
  display: inline-flex; align-items: center; gap: .35rem; cursor: pointer;
  padding: .28rem .6rem; font-size: .78rem; font-weight: 600;
  border-radius: 999px; border: 1px solid var(--glass-border);
  background: linear-gradient(160deg, rgba(255,255,255,.08), rgba(255,255,255,.02));
  color: var(--text-primary); transition: border-color .15s, transform .1s, background .15s;
}
.hub-chip:hover { border-color: rgba(167,139,250,.5); background: rgba(167,139,250,.14); transform: translateY(-1px); }
.hub-chip i { color: var(--accent-2); }

/* ===========================================================================
   NEW TOOLS — BATCH 2 previews (Design/CSS · SEO · System)
   =========================================================================== */
.tool-range { width: 100%; accent-color: var(--accent); cursor: pointer; }
.cg-grid-preview { margin-top: .7rem; min-height: 90px; }
.cg-cell { background: linear-gradient(135deg, rgba(167,139,250,.3), rgba(56,189,248,.22)); border: 1px solid var(--glass-border); border-radius: 6px; padding: .6rem .2rem; text-align: center; font-size: .78rem; font-weight: 700; color: var(--text-primary); }
.fx-preview { margin-top: .7rem; min-height: 120px; border: 1px dashed var(--glass-border); border-radius: var(--radius-sm); padding: .5rem; }
.fx-item { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; font-weight: 700; border-radius: 6px; padding: .5rem .8rem; }
.cf-preview { margin-top: .7rem; height: 150px; border-radius: var(--radius-sm); background-image: linear-gradient(135deg, #f59e0b, #ef4444, #8b5cf6, #06b6d4); background-size: cover; }
.brad-preview { margin-top: .8rem; height: 130px; background: linear-gradient(135deg, var(--accent), var(--accent-2)); border: 2px solid rgba(255,255,255,.25); }
.cp-swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 90px), 1fr)); gap: .5rem; }
.cp-sw { height: 70px; border-radius: var(--radius-sm); border: 1px solid var(--glass-border); cursor: pointer; display: flex; align-items: flex-end; justify-content: center; padding: .3rem; transition: transform .1s; }
.cp-sw:hover { transform: scale(1.05); }
.cp-sw span { font-size: .68rem; font-weight: 700; background: rgba(0,0,0,.5); color: #fff; padding: .1rem .35rem; border-radius: 4px; }
.serp-prev { background: #fff; border-radius: 8px; padding: .9rem 1rem; }
.serp-url { color: #202124; font-size: .82rem; }
.serp-title { color: #1a0dab; font-size: 1.15rem; line-height: 1.3; margin: .1rem 0; }
.serp-desc { color: #4d5156; font-size: .85rem; line-height: 1.45; }

/* ===========================================================================
   NEW TOOLS — BATCH 3 (CSS animation preview · daily planner)
   =========================================================================== */
.ca-box { width: 64px; height: 64px; margin: 0 auto; display: flex; align-items: center; justify-content: center; font-size: 1.6rem; color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-2)); border-radius: 12px; }
.dp-rows { display: flex; flex-direction: column; gap: .3rem; max-height: 460px; overflow: auto; }
.dp-row { display: flex; align-items: center; gap: .5rem; }
.dp-time { flex: 0 0 64px; font-size: .76rem; font-weight: 700; color: var(--accent-2); text-align: right; }
.dp-in { flex: 1; }

/* ===========================================================================
   NEW TOOLS — BATCH 4 (Database · Education apps · Design)
   =========================================================================== */
.mm-prev { background: rgba(255,255,255,.04); border: 1px solid var(--glass-border); border-radius: var(--radius-md); padding: .8rem; min-height: 160px; overflow: auto; text-align: center; }
.mm-prev svg { max-width: 100%; height: auto; }
.rx-list { display: flex; flex-direction: column; gap: .35rem; max-height: 420px; overflow: auto; }
.rx-item { display: flex; flex-direction: column; gap: .15rem; text-align: left; padding: .45rem .6rem; border-radius: var(--radius-sm); border: 1px solid var(--glass-border); background: rgba(255,255,255,.04); color: var(--text-primary); cursor: pointer; }
.rx-item:hover { border-color: rgba(167,139,250,.5); background: rgba(167,139,250,.1); }
.rx-item code { font-size: .72rem; color: var(--accent-2); word-break: break-all; }
.flash-card { position: relative; min-height: 160px; display: flex; align-items: center; justify-content: center; padding: 1.2rem; text-align: center; cursor: pointer; border-radius: var(--radius-md); border: 1px solid var(--glass-border); background: linear-gradient(160deg, rgba(255,255,255,.08), rgba(255,255,255,.02)); transition: background .2s; }
.flash-card.flipped { background: linear-gradient(160deg, rgba(167,139,250,.2), rgba(56,189,248,.12)); }
.fc-text { font-size: 1.3rem; font-weight: 700; color: var(--text-primary); }
.fc-side { position: absolute; top: 8px; right: 12px; font-size: .68rem; text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted); }
.qz-q { margin-bottom: 1rem; }
.qz-qt { font-weight: 700; margin-bottom: .4rem; color: var(--text-primary); }
.qz-opt { display: block; padding: .4rem .6rem; margin-bottom: .3rem; border-radius: var(--radius-sm); border: 1px solid var(--glass-border); cursor: pointer; transition: background .15s; }
.qz-opt:hover { background: rgba(255,255,255,.06); }
.qz-opt.qz-right { background: rgba(52,211,153,.18); border-color: rgba(52,211,153,.5); }
.qz-opt.qz-wrong { background: rgba(248,113,113,.18); border-color: rgba(248,113,113,.5); }
.neu-stage { display: flex; align-items: center; justify-content: center; min-height: 240px; border-radius: var(--radius-md); border: 1px solid var(--glass-border); }
.neu-box { transition: box-shadow .2s, border-radius .2s; }

/* ===========================================================================
   NEW TOOLS — BATCH 5 (API viewers · planners · goals · SEO)
   =========================================================================== */
.oa-list { display: flex; flex-direction: column; gap: .3rem; max-height: 440px; overflow: auto; }
.oa-ep { display: flex; align-items: center; gap: .5rem; padding: .4rem .55rem; border-radius: var(--radius-sm); background: rgba(255,255,255,.04); border: 1px solid var(--glass-border); }
.oa-m { flex: 0 0 auto; font-size: .66rem; font-weight: 800; color: #fff; padding: .12rem .4rem; border-radius: 4px; min-width: 50px; text-align: center; }
.oa-path { font-family: ui-monospace, monospace; font-size: .8rem; color: var(--text-primary); }
.oa-sum { font-size: .74rem; color: var(--text-muted); margin-left: auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 40%; }
.hs-out { display: flex; flex-direction: column; gap: .2rem; }
.hs-line { font-size: .84rem; color: var(--text-secondary); padding: .15rem 0; }
.hs-tag { font-size: .68rem; font-weight: 800; color: var(--accent-2); }
.wp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)); gap: .5rem; }
.wp-day { display: flex; flex-direction: column; }
.wp-dh { font-size: .76rem; font-weight: 800; color: var(--accent-2); margin-bottom: .25rem; }
.wp-in { font-size: .8rem; }
.gl-list { display: flex; flex-direction: column; gap: .6rem; }
.gl-item { padding: .6rem .7rem; border-radius: var(--radius-sm); border: 1px solid var(--glass-border); background: rgba(255,255,255,.04); }
.gl-top { display: flex; justify-content: space-between; align-items: center; }
.gl-del { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 1.1rem; }
.gl-del:hover { color: var(--danger); }
.gl-bar { height: 8px; border-radius: 999px; background: rgba(0,0,0,.3); overflow: hidden; margin: .4rem 0; }
.gl-fill { height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .3s; }
.gl-row { font-size: .8rem; color: var(--text-secondary); display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }

/* ===========================================================================
   NEW TOOLS — BATCH 6 (PDF compare · word cloud · image slider · emoji)
   =========================================================================== */
.pc-diff { max-height: 380px; overflow: auto; font-family: ui-monospace, monospace; font-size: .78rem; }
.pc-h { font-weight: 700; color: var(--text-secondary); margin: .5rem 0 .25rem; }
.pc-del { color: #fca5a5; background: rgba(248,113,113,.1); padding: .1rem .4rem; border-radius: 3px; }
.pc-add { color: #6ee7b7; background: rgba(52,211,153,.1); padding: .1rem .4rem; border-radius: 3px; }
.wc-cloud { display: flex; flex-wrap: wrap; gap: .2rem .55rem; align-items: center; justify-content: center; padding: 1rem; min-height: 120px; line-height: 1.4; }
.wc-w { font-weight: 700; cursor: default; transition: transform .12s; }
.wc-w:hover { transform: scale(1.12); }
.ic-stage { position: relative; border-radius: var(--radius-md); overflow: hidden; border: 1px solid var(--glass-border); min-height: 120px; background: #0b0b14; }
.ic-stage .ic-empty { display: flex; align-items: center; justify-content: center; min-height: 160px; }
.ic-img { display: block; width: 100%; height: auto; }
.ic-top { position: absolute; inset: 0 auto 0 0; width: 50%; overflow: hidden; }
.ic-top .ic-img { position: absolute; top: 0; left: 0; height: 100%; width: auto; max-width: none; }
.ic-handle { position: absolute; top: 0; bottom: 0; left: 50%; width: 2px; background: #fff; transform: translateX(-1px); display: flex; align-items: center; justify-content: center; pointer-events: none; }
.ic-handle i { background: #fff; color: #111; border-radius: 50%; width: 26px; height: 26px; display: flex; align-items: center; justify-content: center; font-size: .8rem; box-shadow: 0 2px 8px rgba(0,0,0,.4); }
.em-grid { max-height: 420px; overflow: auto; }
.em-cat { font-size: .76rem; font-weight: 700; color: var(--accent-2); margin: .5rem 0 .25rem; }
.em-row { display: flex; flex-wrap: wrap; gap: .15rem; }
.em-b { font-size: 1.5rem; line-height: 1; padding: .2rem .3rem; background: none; border: 1px solid transparent; border-radius: 8px; cursor: pointer; }
.em-b:hover { background: rgba(255,255,255,.1); border-color: var(--glass-border); transform: scale(1.15); }

/* ===========================================================================
   NEW TOOLS — BATCH 7 (receipt · pomodoro)
   =========================================================================== */
.rcpt { background: #fff; color: #222; font-family: ui-monospace, monospace; font-size: .82rem; max-width: 300px; margin: 0 auto; padding: 1rem; border-radius: 6px; }
.rcpt-h { text-align: center; font-weight: 700; font-size: 1.05rem; }
.rcpt-sub { text-align: center; color: #666; font-size: .72rem; margin-bottom: .3rem; }
.rcpt-rule { border-top: 1px dashed #999; margin: .4rem 0; }
.rcpt-l { display: flex; justify-content: space-between; gap: 1rem; }
.rcpt-tot { font-weight: 700; font-size: .95rem; }
.rcpt-ty { text-align: center; margin-top: .4rem; }
.pomo-time { font-family: ui-monospace, monospace; font-size: 3.2rem; font-weight: 800; text-align: center; color: var(--accent-2); padding: .4rem 0; letter-spacing: 2px; }
.pomo-bars { display: flex; align-items: flex-end; gap: .4rem; height: 110px; margin-top: .8rem; padding: .4rem; }
.pomo-bar { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; }
.pomo-bar > .pomo-fill { width: 70%; min-height: 2px; background: linear-gradient(180deg, var(--accent), var(--accent-2)); border-radius: 4px 4px 0 0; }
.pomo-bar > span { font-size: .62rem; color: var(--text-muted); margin-top: .25rem; }

/* ===========================================================================
   NEW TOOLS — BATCH 8 (calendar planner)
   =========================================================================== */
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-dow { text-align: center; font-size: .68rem; font-weight: 700; color: var(--text-muted); padding: .2rem 0; }
.cal-cell { position: relative; aspect-ratio: 1; display: flex; align-items: center; justify-content: center; border-radius: 8px; border: 1px solid var(--glass-border); background: rgba(255,255,255,.03); cursor: pointer; font-size: .82rem; font-weight: 600; transition: background .12s, border-color .12s; }
.cal-cell:hover { background: rgba(167,139,250,.15); border-color: rgba(167,139,250,.4); }
.cal-cell.cal-empty { border: none; background: none; cursor: default; }
.cal-cell.cal-today { border-color: var(--accent); color: var(--accent-2); }
.cal-cell.cal-has { background: rgba(56,189,248,.16); }
.cal-cell .bi-dot { position: absolute; bottom: -2px; color: var(--accent-2); font-size: 1.1rem; }

/* ===========================================================================
   NEW TOOLS — SECURITY SUITE A (IOC headers · cookie cards)
   =========================================================================== */
.ioc-h { font-size: .74rem; font-weight: 800; color: var(--accent-2); text-transform: uppercase; letter-spacing: .5px; margin: .55rem 0 .2rem; }
.ck-card { padding: .55rem .7rem; margin-bottom: .5rem; border-radius: var(--radius-sm); border: 1px solid var(--glass-border); background: rgba(255,255,255,.04); }
.ck-name { font-weight: 700; color: var(--text-primary); margin-bottom: .3rem; display: flex; align-items: center; gap: .35rem; }

/* ===========================================================================
   Tools-Hub grid: equal-height cards + fill the row (no auto-fill gaps).
   In any grid view, stretch cards so uneven description lengths never leave
   vertical gaps, and let cards fill the row instead of leaving empty tracks.
   =========================================================================== */
.studio-tool-cards { align-items: stretch; }
.studio-tool-cards .studio-tool-card { height: 100%; }


/* ===========================================================================
   Website Vulnerability Scanner (app: vulnscan) — professional report UI.
   Uses the existing glass-card / blur theme + accent variables.
   =========================================================================== */
.vs-app { padding: .5rem; display: flex; flex-direction: column; gap: 1rem; }
.vs-intro { display: flex; align-items: center; gap: .9rem; padding: 1rem 1.1rem; border-radius: var(--radius-md); }
.vs-intro-ic { width: 50px; height: 50px; flex: 0 0 auto; border-radius: 13px; display: flex; align-items: center; justify-content: center; font-size: 1.5rem; color: #fff; background: linear-gradient(135deg, #ef4444, #b91c1c); }
.vs-intro-copy h3 { margin: 0 0 .2rem; font-size: 1.1rem; }
.vs-form { padding: .9rem 1rem; border-radius: var(--radius-md); }
.vs-consent { display: flex; align-items: center; gap: .45rem; margin-top: .6rem; font-size: .82rem; color: var(--text-secondary); cursor: pointer; }
.vs-consent input { accent-color: var(--accent); }
.vs-consent.vs-flash { color: #f59e0b; animation: vsFlash .4s ease 2; }
@keyframes vsFlash { 50% { opacity: .35; } }
/* Busy / loading */
.vs-busy-card { padding: 1.6rem 1.2rem; border-radius: var(--radius-md); text-align: center; }
.vs-spin { width: 38px; height: 38px; margin: 0 auto .7rem; border-radius: 50%; border: 3px solid var(--glass-border); border-top-color: var(--accent); animation: vsSpin .8s linear infinite; }
@keyframes vsSpin { to { transform: rotate(360deg); } }
.vs-busy-txt { font-weight: 600; color: var(--text-primary); }
.vs-error { padding: 1rem 1.1rem; border-radius: var(--radius-md); color: #fca5a5; border: 1px solid rgba(239,68,68,.35) !important; }
/* Report */
.vs-report { display: flex; flex-direction: column; gap: 1.1rem; }
.vs-hero { display: flex; align-items: center; gap: 1.2rem; padding: 1.2rem 1.3rem; border-radius: var(--radius-md); flex-wrap: wrap; }
.vs-gauge { width: 96px; height: 96px; flex: 0 0 auto; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; background: radial-gradient(circle at 50% 40%, rgba(255,255,255,.06), transparent 70%); border: 4px solid var(--g, #94a3b8); box-shadow: 0 0 24px -6px var(--g, #94a3b8); }
.vs-grade { font-size: 2.3rem; font-weight: 800; line-height: 1; color: var(--g, #fff); }
.vs-score { font-size: .72rem; color: var(--text-secondary); font-variant-numeric: tabular-nums; margin-top: .15rem; }
.vs-hero-meta { flex: 1; min-width: 220px; }
.vs-hero-meta h3 { margin: 0 0 .15rem; font-size: 1.15rem; display: flex; align-items: center; gap: .45rem; }
.vs-target { font-size: .8rem; color: var(--accent-2); word-break: break-all; text-decoration: none; }
.vs-target:hover { text-decoration: underline; }
.vs-state-chips { display: flex; flex-wrap: wrap; gap: .45rem; margin: .7rem 0 .5rem; }
.vs-chip { display: inline-flex; align-items: center; gap: .35rem; font-size: .8rem; font-weight: 700; padding: .28rem .7rem; border-radius: 20px; border: 1px solid transparent; }
.vs-chip.risk   { color: #fca5a5; background: rgba(239,68,68,.12); border-color: rgba(239,68,68,.32); }
.vs-chip.middle { color: #fcd34d; background: rgba(245,158,11,.12); border-color: rgba(245,158,11,.32); }
.vs-chip.safe   { color: #6ee7b7; background: rgba(16,185,129,.12); border-color: rgba(16,185,129,.32); }
.vs-meta { font-size: .76rem; }
.vs-actions { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .7rem; }
.vs-h { margin: .2rem 0 -.2rem; font-size: 1rem; display: flex; align-items: center; gap: .45rem; color: var(--text-primary); }
/* Attack-coverage matrix */
.vs-cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr)); gap: .6rem; }
.vs-cat { display: flex; align-items: center; gap: .55rem; padding: .6rem .7rem; border-radius: 12px; background: rgba(255,255,255,.04); border: 1px solid var(--glass-border); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); transition: transform .12s, border-color .15s; }
.vs-cat-click { cursor: pointer; }
.vs-cat-click:hover { transform: translateY(-2px); border-color: var(--accent); }
.vs-cat-ic { font-size: 1.05rem; flex: 0 0 auto; color: var(--text-secondary); }
.vs-cat-name { flex: 1; font-size: .8rem; font-weight: 600; line-height: 1.25; }
.vs-cat-badge { display: inline-flex; align-items: center; gap: .3rem; font-size: .68rem; font-weight: 700; padding: .18rem .5rem; border-radius: 7px; white-space: nowrap; flex: 0 0 auto; }
.vs-cat-risk   { border-left: 3px solid #ef4444; }
.vs-cat-middle { border-left: 3px solid #f59e0b; }
.vs-cat-safe   { border-left: 3px solid #10b981; }
.vs-risk   { color: #fca5a5; background: rgba(239,68,68,.14); }   .vs-cat-risk .vs-cat-ic   { color: #fca5a5; }
.vs-middle { color: #fcd34d; background: rgba(245,158,11,.14); }  .vs-cat-middle .vs-cat-ic { color: #fcd34d; }
.vs-safe   { color: #6ee7b7; background: rgba(16,185,129,.14); }  .vs-cat-safe .vs-cat-ic   { color: #6ee7b7; }
/* Findings */
.vs-filters { display: flex; flex-wrap: wrap; gap: .4rem; }
.vs-filter { font-size: .76rem; font-weight: 700; padding: .3rem .7rem; border-radius: 20px; cursor: pointer; background: rgba(255,255,255,.05); border: 1px solid var(--glass-border); color: var(--text-secondary); border-left: 3px solid var(--sv, var(--accent)); }
.vs-filter.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.vs-findings { display: flex; flex-direction: column; gap: .55rem; margin-top: .2rem; }
.vs-find { border-radius: 12px; background: rgba(255,255,255,.035); border: 1px solid var(--glass-border); border-left: 4px solid var(--text-secondary); overflow: hidden; -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); }
.vs-find.vs-sev-critical { border-left-color: #ef4444; }
.vs-find.vs-sev-high     { border-left-color: #f97316; }
.vs-find.vs-sev-medium   { border-left-color: #f59e0b; }
.vs-find.vs-sev-low      { border-left-color: #eab308; }
.vs-find.vs-sev-info     { border-left-color: #38bdf8; }
.vs-find > summary { display: flex; align-items: center; gap: .55rem; padding: .65rem .8rem; cursor: pointer; list-style: none; font-size: .88rem; }
.vs-find > summary::-webkit-details-marker { display: none; }
.vs-sev-badge { font-size: .64rem; font-weight: 800; text-transform: uppercase; letter-spacing: .03em; padding: .16rem .45rem; border-radius: 6px; color: #fff; background: var(--sv, #64748b); flex: 0 0 auto; }
.vs-find-title { flex: 1; font-weight: 600; }
.vs-find-cat { font-size: .7rem; color: var(--text-secondary); white-space: nowrap; }
.vs-find-body { padding: 0 .85rem .8rem; font-size: .84rem; color: var(--text-secondary); line-height: 1.55; }
.vs-evidence { margin: .5rem 0; padding: .5rem .65rem; border-radius: 8px; background: rgba(0,0,0,.28); border: 1px solid var(--glass-border); font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: .76rem; color: #e2e8f0; white-space: pre-wrap; word-break: break-word; max-height: 160px; overflow: auto; }
.vs-fix { margin: .4rem 0 0; color: var(--text-primary); }
.vs-fix .bi { color: #6ee7b7; }
.vs-clean { padding: 1.1rem 1.2rem; border-radius: var(--radius-md); color: #6ee7b7; display: flex; align-items: center; gap: .6rem; font-weight: 600; }
.vs-disclaimer { font-size: .76rem; margin-top: .3rem; }
@media (max-width: 560px) { .vs-cat-grid { grid-template-columns: 1fr 1fr; } .vs-cat-name { font-size: .74rem; } .vs-gauge { width: 80px; height: 80px; } }
@media (max-width: 380px) { .vs-cat-grid { grid-template-columns: 1fr; } }
/* Print: just the report, expanded */
@media print { .vs-intro, .vs-form, .vs-busy, .vs-actions, .vs-filters { display: none !important; } .vs-find[open] .vs-find-body, .vs-find .vs-find-body { display: block !important; } .vs-find { break-inside: avoid; } }

/* ===========================================================================
   Security apps (Phishing / CVSS / security.txt) — shared .sa-* styles.
   Reuses the .vs-* finding styles; desktop-clean + fully mobile-responsive.
   =========================================================================== */
.sa-app { padding: .5rem; display: flex; flex-direction: column; gap: 1rem; }
.sa-intro { display: flex; align-items: center; gap: .9rem; padding: 1rem 1.1rem; border-radius: var(--radius-md); }
.sa-intro-ic { width: 50px; height: 50px; flex: 0 0 auto; border-radius: 13px; display: flex; align-items: center; justify-content: center; font-size: 1.5rem; color: #fff; }
.sa-intro h3 { margin: 0 0 .2rem; font-size: 1.08rem; }
.sa-form { padding: .9rem 1rem; border-radius: var(--radius-md); }
.sa-opt { display: flex; align-items: center; gap: .45rem; margin-top: .6rem; font-size: .82rem; color: var(--text-secondary); cursor: pointer; }
.sa-opt input { accent-color: var(--accent); }
.sa-error { padding: 1rem 1.1rem; border-radius: var(--radius-md); color: #fca5a5; border: 1px solid rgba(239,68,68,.35) !important; }
.sa-report { display: flex; flex-direction: column; gap: 1rem; }
.sa-hero { display: flex; align-items: center; gap: 1.1rem; padding: 1.1rem 1.2rem; border-radius: var(--radius-md); flex-wrap: wrap; }
.sa-gauge { width: 88px; height: 88px; flex: 0 0 auto; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; border: 4px solid var(--g, #94a3b8); box-shadow: 0 0 22px -6px var(--g, #94a3b8); }
.sa-gauge-n { font-size: 1.9rem; font-weight: 800; line-height: 1; color: var(--g, #fff); }
.sa-gauge-l { font-size: .68rem; color: var(--text-secondary); margin-top: .1rem; }
.sa-hero-meta { flex: 1; min-width: 200px; }
.sa-hero-meta h3 { margin: 0 0 .35rem; font-size: 1.1rem; }
.sa-stat-row { display: flex; flex-wrap: wrap; gap: .4rem .9rem; }
.sa-stat { font-size: .8rem; color: var(--text-secondary); }
.sa-stat b { color: var(--text-primary); font-variant-numeric: tabular-nums; }
.sa-h { margin: .2rem 0 -.1rem; font-size: 1rem; display: flex; align-items: center; gap: .45rem; color: var(--text-primary); }
.sa-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.sa-cell { display: flex; flex-direction: column; gap: .15rem; padding: .55rem .7rem; border-radius: 10px; background: rgba(255,255,255,.04); border: 1px solid var(--glass-border); }
.sa-cell-k { font-size: .68rem; text-transform: uppercase; letter-spacing: .03em; color: var(--text-secondary); }
.sa-cell-v { font-size: .9rem; font-weight: 700; color: var(--text-primary); }
.sa-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: .35rem; }
.sa-bad { color: #fca5a5; display: flex; align-items: center; gap: .4rem; font-size: .86rem; }
.sa-good { color: #6ee7b7; display: flex; align-items: center; gap: .4rem; font-size: .9rem; margin: .2rem 0; }
.sa-findings { display: flex; flex-direction: column; gap: .5rem; }
.sa-cols { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
.sa-cols .vs-evidence { max-height: 220px; }
/* CVSS metric button-groups */
.cvss-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem 1.4rem; }
.cvss-label { font-size: .82rem; font-weight: 600; margin-bottom: .35rem; color: var(--text-primary); }
.sa-bg { display: flex; flex-wrap: wrap; gap: .35rem; }
.sa-bg-btn { font-size: .78rem; font-weight: 600; padding: .32rem .7rem; border-radius: 8px; cursor: pointer; background: rgba(255,255,255,.05); border: 1px solid var(--glass-border); color: var(--text-secondary); }
.sa-bg-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.cvss-group-h { font-size: .82rem; font-weight: 700; color: var(--accent-2); margin: 1rem 0 .5rem; }
.cvss-hint { font-size: .78rem; color: var(--text-secondary); cursor: help; opacity: .7; }
.cvss-scores { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: .8rem; margin-bottom: .8rem; }
.cvss-score-card { padding: .8rem 1rem; }
.cvss-score-title { font-size: .76rem; text-transform: uppercase; letter-spacing: .04em; }
.cvss-vec-box { padding: .8rem 1rem; }
/* security.txt form grid */
.stxt-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; }
.stxt-grid label { display: flex; flex-direction: column; gap: .25rem; font-size: .8rem; color: var(--text-secondary); }
@media (max-width: 640px) {
  .sa-cols, .cvss-grid, .stxt-grid { grid-template-columns: 1fr; }
  .sa-grid { grid-template-columns: 1fr; }
  .sa-hero { gap: .8rem; }
  .sa-gauge { width: 72px; height: 72px; }
  .sa-gauge-n { font-size: 1.5rem; }
  .sa-intro { flex-direction: row; }
}

/* Cyber Security Toolkit launcher — grouped tile sections (reuses .seo-app-*) */
.cyber-group { margin-bottom: 1.1rem; }
.cyber-group-h { display: flex; align-items: center; gap: .5rem; font-size: .92rem; font-weight: 700; margin: .2rem 0 .6rem; color: var(--text-primary); }
.cyber-group-h .bi { color: var(--accent-2); }
.cyber-group-n { font-size: .68rem; font-weight: 700; color: var(--text-secondary); background: rgba(255,255,255,.07); border: 1px solid var(--glass-border); border-radius: 20px; padding: .05rem .5rem; }

/* ─── OWASP Suite (categorised catalog of OWASP projects) ─────────────────────── */
.owasp-chips { display: flex; flex-wrap: wrap; gap: .45rem; margin-bottom: 1rem; }
.owasp-chip { display: inline-flex; align-items: center; gap: .4rem; font-size: .78rem; font-weight: 600; color: var(--text-secondary); background: var(--glass); border: 1px solid var(--glass-border); border-radius: 999px; padding: .35rem .7rem; cursor: pointer; transition: border-color .15s, background .15s, color .15s; }
.owasp-chip:hover { background: var(--glass-hover); color: var(--text-primary); }
.owasp-chip.active { color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-2)); border-color: transparent; }
.owasp-chip .bi { font-size: .9rem; }
.owasp-chip-n { font-size: .66rem; font-weight: 700; background: rgba(255,255,255,.15); border-radius: 999px; padding: 0 .4rem; }
.owasp-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); gap: .7rem; }
.owasp-card { display: flex; flex-direction: column; gap: .4rem; padding: .9rem; border-radius: var(--radius-md); background: linear-gradient(160deg, rgba(255,255,255,.06), rgba(255,255,255,.02)); border: 1px solid var(--glass-border); color: var(--text-primary); text-decoration: none; -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); transition: transform .14s, border-color .15s, box-shadow .15s; }
.owasp-card:hover { transform: translateY(-3px); border-color: rgba(167,139,250,.5); box-shadow: 0 14px 30px rgba(0,0,0,.32); }
.owasp-card-top { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.owasp-card-top > .bi { font-size: 1.4rem; color: var(--accent-2); }
.owasp-type { font-size: .64rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; padding: .12rem .45rem; border-radius: 6px; background: rgba(255,255,255,.08); color: var(--text-secondary); border: 1px solid var(--glass-border); }
.owasp-type.t-tool { background: rgba(14,165,233,.16); color: #38bdf8; border-color: rgba(56,189,248,.35); }
.owasp-type.t-app  { background: rgba(239,68,68,.16);  color: #f87171; border-color: rgba(248,113,113,.35); }
.owasp-type.t-lib  { background: rgba(52,211,153,.16);  color: #34d399; border-color: rgba(52,211,153,.35); }
.owasp-type.t-std  { background: rgba(167,139,250,.18); color: #a78bfa; border-color: rgba(167,139,250,.4); }
.owasp-type.t-doc  { background: rgba(251,191,36,.16);  color: #fbbf24; border-color: rgba(251,191,36,.35); }
.owasp-card-name { font-weight: 700; font-size: .92rem; }
.owasp-card-desc { font-size: .78rem; color: var(--text-muted); line-height: 1.45; flex: 1; }
.owasp-card-go { font-size: .76rem; font-weight: 600; color: var(--accent-2); display: inline-flex; align-items: center; gap: .35rem; }
.owasp-run-badge { font-size: .6rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: #34d399; background: rgba(52,211,153,.16); border: 1px solid rgba(52,211,153,.35); border-radius: 6px; padding: .1rem .4rem; display: inline-flex; align-items: center; gap: .25rem; margin-left: auto; }
.owasp-card-foot { display: flex; align-items: center; gap: .5rem; margin-top: .2rem; }
.owasp-open { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: .4rem; font-size: .8rem; font-weight: 700; color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-2)); border: none; border-radius: 8px; padding: .45rem .6rem; cursor: pointer; transition: filter .15s; }
.owasp-open:hover { filter: brightness(1.08); }
.owasp-card-link { font-size: .72rem; color: var(--text-muted); text-decoration: none; white-space: nowrap; }
.owasp-card-link:hover { color: var(--accent-2); }

/* OWASP runnable tools — shared bits */
.owasp-enc { display: flex; flex-direction: column; gap: .6rem; }
.owasp-enc-row { display: flex; flex-direction: column; gap: .25rem; }
.owasp-enc-h { display: flex; align-items: center; justify-content: space-between; gap: .5rem; font-size: .76rem; font-weight: 700; color: var(--text-secondary); }
.owasp-note { font-size: .82rem; line-height: 1.55; color: var(--text-secondary); }
.owasp-note ol, .owasp-note ul { margin: .4rem 0 .4rem 1.1rem; }
.owasp-note li { margin: .25rem 0; }
.owasp-note code { font-family: ui-monospace, monospace; background: rgba(255,255,255,.06); padding: .05rem .3rem; border-radius: 5px; }
.owasp-prev { border: 1px solid var(--glass-border); border-radius: 10px; padding: .7rem; background: #fff; color: #111; max-height: 220px; overflow: auto; }
.owasp-hr { border: none; border-top: 1px solid var(--glass-border); margin: 1rem 0; }
.owasp-verdict { display: flex; align-items: center; gap: .5rem; font-weight: 600; font-size: .86rem; padding: .6rem .7rem; border-radius: 10px; }
.owasp-verdict.ok { color: #34d399; background: rgba(52,211,153,.12); border: 1px solid rgba(52,211,153,.3); }
.owasp-verdict.bad { color: #f87171; background: rgba(248,113,113,.12); border: 1px solid rgba(248,113,113,.3); }
/* SCA results */
.owasp-sca-out { display: flex; flex-direction: column; gap: .6rem; }
.owasp-sca-pkg { border: 1px solid var(--glass-border); border-left: 3px solid #f87171; border-radius: 10px; padding: .6rem .7rem; background: rgba(255,255,255,.03); }
.owasp-sca-name { font-weight: 700; font-size: .88rem; display: flex; align-items: center; gap: .4rem; margin-bottom: .4rem; }
.owasp-sca-n { font-size: .66rem; font-weight: 700; color: #f87171; background: rgba(248,113,113,.16); border-radius: 999px; padding: 0 .45rem; }
.owasp-sca-vuln { font-size: .8rem; padding: .25rem 0; border-top: 1px dashed var(--glass-border); }
.owasp-sca-vuln:first-of-type { border-top: none; }
.owasp-sca-vuln a { color: var(--accent-2); font-weight: 600; text-decoration: none; }
.owasp-sca-sum { font-size: .76rem; margin-top: .15rem; }
.owasp-cve { font-family: ui-monospace, monospace; font-size: .72rem; color: var(--text-secondary); }
.owasp-sev { font-size: .64rem; font-weight: 700; border-radius: 5px; padding: .05rem .35rem; text-transform: uppercase; }
.owasp-sev.s-critical { background: rgba(220,38,38,.2); color: #f87171; }
.owasp-sev.s-high { background: rgba(239,68,68,.18); color: #fb7185; }
.owasp-sev.s-moderate, .owasp-sev.s-medium { background: rgba(251,191,36,.18); color: #fbbf24; }
.owasp-sev.s-low { background: rgba(56,189,248,.16); color: #38bdf8; }
/* ASVS checklist */
.owasp-asvs-bar { display: flex; align-items: center; gap: .6rem; margin: .9rem 0 1rem; }
.owasp-asvs-prog { flex: 1; height: 8px; border-radius: 999px; background: rgba(255,255,255,.08); overflow: hidden; }
.owasp-asvs-prog > span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .25s; }
.owasp-asvs-grp { margin-bottom: 1rem; }
.owasp-asvs-h { font-size: .82rem; font-weight: 700; color: var(--accent-2); margin: .2rem 0 .5rem; }
.owasp-asvs-item { display: flex; align-items: flex-start; gap: .55rem; padding: .4rem .55rem; border-radius: 8px; font-size: .84rem; line-height: 1.45; cursor: pointer; transition: background .12s; }
.owasp-asvs-item:hover { background: var(--glass-hover); }
.owasp-asvs-item input { margin-top: .2rem; flex-shrink: 0; }
/* shared checklist engine: score header + toolbar */
.owc-score { display: flex; align-items: center; gap: 1rem; padding: .8rem 1rem; margin: .9rem 0 .8rem; flex-wrap: wrap; }
.owc-score-grade { display: flex; align-items: center; gap: .7rem; }
.owc-grade-letter { font-size: 1.4rem; font-weight: 800; color: #fff; background: #ef4444; border-radius: 10px; width: 2.2rem; height: 2.2rem; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.owc-grade-meta { display: flex; flex-direction: column; line-height: 1.3; }
.owc-score-text { font-size: .92rem; }
.owc-grade-sub { font-size: .72rem; }
.owc-score-prog { flex: 1; min-width: 140px; }
.owc-grp-count { background: rgba(255,255,255,.08); color: var(--text-secondary); font-weight: 700; }
.owc-toolbar { display: flex; align-items: center; justify-content: space-between; gap: .6rem; flex-wrap: wrap; margin-bottom: .7rem; }
.owc-filters, .owc-actions { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.owc-filter.active { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; border-color: transparent; }
.owc-import-lbl { cursor: pointer; }
/* Top 10 reference (accordion) */
.owasp-t10-list { display: flex; flex-direction: column; gap: .5rem; }
.owasp-t10 { border: 1px solid var(--glass-border); border-radius: 10px; background: rgba(255,255,255,.03); overflow: hidden; }
.owasp-t10 > summary { display: flex; align-items: center; gap: .6rem; padding: .65rem .8rem; cursor: pointer; font-weight: 600; list-style: none; }
.owasp-t10 > summary::-webkit-details-marker { display: none; }
.owasp-t10[open] > summary { border-bottom: 1px solid var(--glass-border); }
.owasp-rank { font-size: .7rem; font-weight: 800; color: #fff; background: linear-gradient(135deg, #ef4444, #7c3aed); border-radius: 6px; padding: .15rem .45rem; flex-shrink: 0; }
.owasp-t10-name { font-size: .9rem; }
.owasp-t10-b { padding: .7rem .8rem; font-size: .84rem; line-height: 1.55; color: var(--text-secondary); }
.owasp-t10-prev { margin-top: .5rem; }
.owasp-t10-prev b { font-size: .8rem; color: var(--text-primary); }
.owasp-t10-prev ul { margin: .35rem 0 0 1.1rem; }
.owasp-t10-prev li { margin: .2rem 0; }
/* STRIDE worksheet */
.owasp-stride { border: 1px solid var(--glass-border); border-radius: 10px; padding: .6rem .7rem; margin-bottom: .6rem; background: rgba(255,255,255,.03); }
.owasp-stride-h { display: flex; align-items: center; gap: .45rem; font-size: .9rem; }
.owasp-stride-h .bi { color: var(--accent-2); }
.owasp-stride-l { font-size: .7rem; font-weight: 800; color: #fff; background: var(--accent); border-radius: 6px; padding: .1rem .4rem; }
.owasp-stride-d { font-size: .76rem; margin: .3rem 0 .45rem; }
.owasp-stride-m { display: block; color: var(--accent-2); margin-top: .15rem; }
.owasp-stride-ta { min-height: 48px; }
.owtm-risk { font-weight: 700; background: rgba(148,163,184,.18); color: #94a3b8; margin-left: auto; }
.owtm-controls { margin-top: .5rem; gap: .8rem; }
.owtm-sel-lbl { display: inline-flex; align-items: center; gap: .35rem; font-size: .76rem; color: var(--text-secondary); }
.owtm-sel-lbl select { width: auto; min-width: 5.5rem; padding: .25rem .4rem; font-size: .78rem; }
.owtm-mit-lbl { display: inline-flex; align-items: center; gap: .35rem; font-size: .78rem; color: var(--text-secondary); cursor: pointer; }

/* ─── PCAP / Capture Analyzer (Wireshark-style) ─────────────────────────────── */
.pcap-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: .7rem; margin: .9rem 0; }
.pcap-sum-grp { border: 1px solid var(--glass-border); border-radius: 10px; padding: .7rem .8rem; background: rgba(255,255,255,.03); }
.pcap-sum-grp h4 { font-size: .8rem; margin: 0 0 .5rem; color: var(--accent-2); display: flex; align-items: center; gap: .4rem; }
.pcap-chip { display: inline-flex; align-items: center; gap: .3rem; font-size: .72rem; font-family: ui-monospace, monospace; background: rgba(255,255,255,.06); border: 1px solid var(--glass-border); border-radius: 6px; padding: .12rem .45rem; margin: .15rem .25rem .15rem 0; }
.pcap-chip b { color: var(--accent-2); }
.pcap-table-wrap { max-height: 420px; overflow: auto; border: 1px solid var(--glass-border); border-radius: 10px; }
.pcap-table { width: 100%; border-collapse: collapse; font-size: .76rem; font-family: ui-monospace, monospace; }
.pcap-table thead th { position: sticky; top: 0; background: rgba(20,16,38,.97); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); text-align: left; padding: .45rem .55rem; font-weight: 700; color: var(--text-secondary); border-bottom: 1px solid var(--glass-border); white-space: nowrap; }
.pcap-table td { padding: .35rem .55rem; border-bottom: 1px solid rgba(255,255,255,.05); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 280px; }
.pcap-table tbody tr { cursor: pointer; }
.pcap-table tbody tr:hover { background: var(--glass-hover); }
.pcap-table tbody tr.sel { background: rgba(124,58,237,.18); }
.pcap-proto { font-weight: 700; padding: .05rem .4rem; border-radius: 5px; background: rgba(255,255,255,.08); font-size: .7rem; }
.pcap-proto.p-tcp, .pcap-proto.p-https, .pcap-proto.p-tls, .pcap-proto.p-http { background: rgba(56,189,248,.18); color: #38bdf8; }
.pcap-proto.p-udp, .pcap-proto.p-dns, .pcap-proto.p-dhcp, .pcap-proto.p-ntp { background: rgba(52,211,153,.16); color: #34d399; }
.pcap-proto.p-arp { background: rgba(251,191,36,.16); color: #fbbf24; }
.pcap-proto.p-icmp, .pcap-proto.p-icmpv6 { background: rgba(248,113,113,.16); color: #f87171; }
.pcap-detail { margin-top: .7rem; }
.pcap-detail-h { font-size: .8rem; font-weight: 700; color: var(--text-primary); margin-bottom: .35rem; }
.pcap-hex { font-family: ui-monospace, monospace; font-size: .74rem; line-height: 1.5; background: rgba(0,0,0,.3); border: 1px solid var(--glass-border); border-radius: 8px; padding: .6rem .7rem; max-height: 260px; overflow: auto; white-space: pre; }

/* ─── Code Snippet Generator (compiler.gocourse.in "Editor" builder) ─────────── */
.csg-app .csg-intro { font-size: .82rem; margin: .2rem 0 .9rem; }
.csg-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem; align-items: start; }
@media (max-width: 880px) { .csg-grid { grid-template-columns: 1fr; } }
.csg-controls { display: flex; flex-wrap: wrap; gap: .6rem; margin-bottom: .55rem; }
.csg-field { display: flex; flex-direction: column; gap: .25rem; flex: 1 1 150px; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .02em; color: var(--text-muted); }
.csg-field.csg-sm { flex: 0 0 78px; }
.csg-field select, .csg-field input { text-transform: none; font-weight: 500; letter-spacing: 0; }
.csg-lbl { display: flex; align-items: center; gap: .4rem; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--text-muted); margin: .8rem 0 .35rem; }
.csg-lbl .util-muted { text-transform: none; letter-spacing: 0; font-weight: 500; font-size: .72rem; }
.csg-ex-btn { margin-left: auto; text-transform: none; letter-spacing: 0; padding: .12rem .5rem; font-size: .72rem; }
.csg-code-ta { min-height: 130px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .82rem; line-height: 1.5; }
.csg-out-ta { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .82rem; }
.csg-app .CodeMirror { border: 1px solid var(--glass-border); border-radius: 10px; height: auto; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .82rem; }
.csg-import { margin-top: .9rem; border: 1px solid var(--glass-border); border-radius: 10px; padding: .55rem .75rem; background: rgba(255,255,255,.02); }
.csg-import summary { cursor: pointer; font-size: .82rem; font-weight: 600; color: var(--text-secondary); }
.csg-import summary:hover { color: var(--text-primary); }
.csg-import-actions { display: flex; gap: .5rem; margin-top: .5rem; flex-wrap: wrap; }
.csg-import-actions .util-mini-btn { cursor: pointer; }
.csg-import-info { margin-top: .55rem; font-size: .78rem; }
.csg-ok { color: #34d399; display: inline-flex; align-items: center; gap: .35rem; }
.csg-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--text-muted); margin: 0 0 .4rem; }
.csg-head-gen { margin-top: .9rem; }
.csg-head-btns { display: flex; gap: .35rem; }
.csg-gen { background: rgba(0,0,0,.32); border: 1px solid var(--glass-border); border-radius: 10px; padding: .7rem .8rem; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .76rem; line-height: 1.5; color: #e6edf3; white-space: pre; overflow: auto; max-height: 320px; margin: 0; }
.csg-preview { border: 1px dashed var(--glass-border); border-radius: 10px; padding: .8rem; background: rgba(255,255,255,.02); }
/* Faithful mini render of the live-site "Editor" block */
.csg-pv-card { background: #0f1117; border: 1px solid #232a36; border-radius: 11px; overflow: hidden; }
.csg-pv-top { display: flex; align-items: center; gap: .5rem; padding: .45rem .6rem; background: #161b25; border-bottom: 1px solid #232a36; }
.csg-pv-badge { font-size: .68rem; font-weight: 700; color: #fff; background: linear-gradient(135deg, #6366f1, #22d3ee); padding: .12rem .5rem; border-radius: 6px; }
.csg-pv-id { font-family: ui-monospace, monospace; font-size: .72rem; color: #94a3b8; }
.csg-pv-copy { margin-left: auto; font-size: .7rem; background: #232a36; color: #cbd5e1; border: 1px solid #2c3543; border-radius: 6px; padding: .2rem .55rem; cursor: pointer; }
.csg-pv-copy:hover { background: #2c3543; color: #fff; }
.csg-pv-codewrap { padding: .6rem; overflow: auto; }
.csg-pv-code { max-width: 100%; min-width: 100%; box-sizing: border-box; background: #0b0d12; color: #d1d5db; border: 1px solid #232a36; border-radius: 8px; font-family: ui-monospace, monospace; font-size: .8rem; line-height: 1.5; padding: .5rem .6rem; resize: none; }
.csg-pv-out { margin: 0 .6rem .6rem; padding: .5rem .65rem; background: #0b1f17; border: 1px solid #14532d; border-radius: 8px; color: #86efac; font-family: ui-monospace, monospace; font-size: .78rem; white-space: pre-wrap; word-break: break-word; }
.csg-pv-actions { display: flex; gap: .5rem; padding: 0 .6rem .65rem; flex-wrap: wrap; }
.csg-pv-try { background: linear-gradient(135deg, #22c55e, #16a34a); color: #fff; border: none; border-radius: 8px; padding: .4rem .8rem; font-size: .75rem; font-weight: 600; cursor: pointer; }
.csg-pv-ai { display: inline-flex; align-items: center; gap: .35rem; background: #232a36; color: #cbd5e1; border: 1px solid #2c3543; border-radius: 8px; padding: .4rem .8rem; font-size: .75rem; cursor: pointer; }

/* ─── Reusable custom dropdown (beautiful styled listbox over a native <select>) ─── */
.cs-dd-native { display: none !important; }
.cs-dd { position: relative; width: 100%; }
.cs-dd-btn { display: flex; align-items: center; justify-content: space-between; gap: .5rem; width: 100%; padding: .55rem .8rem; border-radius: var(--radius-sm); cursor: pointer; font-size: .9rem; text-align: left; color: var(--text-primary); background: rgba(36,30,62,.55); border: 1px solid rgba(167,139,250,.2); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); transition: border-color .2s, box-shadow .2s; }
.cs-dd-btn:hover { border-color: rgba(167,139,250,.45); }
.cs-dd.open .cs-dd-btn { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(167,139,250,.18); }
.cs-dd-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cs-dd-caret { font-size: .8rem; color: var(--text-muted); transition: transform .2s; flex-shrink: 0; }
.cs-dd.open .cs-dd-caret { transform: rotate(180deg); }
.cs-dd-menu { position: absolute; top: calc(100% + 5px); left: 0; right: 0; z-index: 60; display: none; max-height: 260px; overflow-y: auto; padding: .3rem; border-radius: 12px; background: rgba(20,16,38,.97); border: 1px solid var(--glass-border); box-shadow: 0 18px 44px rgba(0,0,0,.45); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); }
.cs-dd.open .cs-dd-menu { display: block; animation: csddIn .14s ease; }
@keyframes csddIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.cs-dd-opt { display: flex; align-items: center; gap: .5rem; padding: .5rem .65rem; border-radius: 8px; font-size: .86rem; color: var(--text-secondary); cursor: pointer; transition: background .12s, color .12s; }
.cs-dd-opt:hover { background: rgba(167,139,250,.14); color: var(--text-primary); }
.cs-dd-opt.active { background: linear-gradient(135deg, rgba(99,102,241,.25), rgba(34,211,238,.18)); color: var(--text-primary); font-weight: 600; }
.cs-dd-opt.active::after { content: "\2713"; margin-left: auto; color: var(--accent-2); font-weight: 700; }

/* ─── Snippet-gen: web-preview modal + button ─── */
.csg-pv-web { display: inline-flex; align-items: center; gap: .35rem; background: linear-gradient(135deg, #6366f1, #22d3ee); color: #fff; border: none; border-radius: 8px; padding: .4rem .8rem; font-size: .75rem; font-weight: 600; cursor: pointer; }
.csg-pv-web:hover { filter: brightness(1.07); }
.csg-web-modal { position: fixed; inset: 0; z-index: 4000; display: none; align-items: center; justify-content: center; padding: 1.2rem; background: rgba(6,8,15,.62); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); }
.csg-web-modal.open { display: flex; }
.csg-web-box { width: min(1000px, 96vw); height: min(80vh, 760px); display: flex; flex-direction: column; padding: 0; overflow: hidden; border-radius: var(--radius-md); }
.csg-web-head { display: flex; align-items: center; justify-content: space-between; gap: .6rem; padding: .65rem .9rem; border-bottom: 1px solid var(--glass-border); font-size: .9rem; font-weight: 600; color: var(--text-primary); }
.csg-web-head .bi { color: var(--accent-2); }
.csg-web-btns { display: flex; gap: .4rem; }
.csg-web-note { padding: .5rem .9rem; font-size: .76rem; color: #fcd34d; background: rgba(251,191,36,.1); border-bottom: 1px solid rgba(251,191,36,.25); }
.csg-web-body { flex: 1; min-height: 0; background: #fff; }
.csg-web-frame { width: 100%; height: 100%; border: 0; background: #fff; }

/* ─── Code Snippet Generator — mobile (compact, no overflow) ─── */
@media (max-width: 768px) {
  .csg-app { padding: 0; }
  .csg-grid { grid-template-columns: 1fr; gap: .7rem; }
  .csg-controls { gap: .5rem; }
  .csg-field { flex: 1 1 100%; }
  .csg-field.csg-sm { flex: 1 1 calc(33% - .5rem); }
  .csg-code-ta { min-height: 110px; }
  .csg-app .CodeMirror { font-size: .78rem; }
  .csg-gen { max-height: 200px; font-size: .72rem; }
  .csg-preview { padding: .6rem; }
  .csg-pv-code { font-size: .74rem; }
  .csg-pv-codewrap { overflow-x: auto; }
  .csg-pv-actions { gap: .4rem; }
  .csg-pv-actions button { flex: 1 1 auto; justify-content: center; }
  .csg-web-box { width: 100%; height: 90vh; }
}
/* Safety: keep any util/app pane from causing horizontal scroll on phones */
@media (max-width: 768px) {
  .util-pane, .csg-app, .wb-app, .seo-app { min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
  .util-pane pre, .csg-gen, .csg-pv-out { max-width: 100%; overflow-x: auto; }
}

/* ─── Realtime Chat — WhatsApp-style two-pane (desktop) ─────────────────────────
   On ≥860px the rooms list (left) and the open conversation (right) sit side-by-side.
   We force both panes visible (the per-message JS uses .show()/.hide() for the mobile
   drill-down; !important wins on desktop so both stay open). On phones it's untouched. */
@media (min-width: 860px) {
  .chat-2pane { display: flex; align-items: stretch; gap: 0; min-height: 460px; height: 68vh; max-height: 760px;
    border: 1px solid var(--glass-border); border-radius: var(--radius-md); overflow: hidden; background: rgba(0,0,0,.12); }
  .chat-2pane #chLanding { display: block !important; flex: 0 0 320px; max-width: 320px; min-width: 0;
    border-right: 1px solid var(--glass-border); overflow-y: auto; padding: .6rem .6rem 1rem; }
  .chat-2pane #chInRoom { display: flex !important; flex: 1 1 auto; min-width: 0; }
  .chat-2pane #chInRoom .wa-app { flex: 1; display: flex; flex-direction: column; min-height: 0; }
  .chat-2pane #chInRoom .wa-log { flex: 1; min-height: 0; }
  .chat-2pane .wa-back { display: none; }            /* no "back" — the list is always there */
  /* The rooms list packs tighter in the narrow sidebar */
  .chat-2pane #chLanding .room-landing-head { flex-direction: column; align-items: stretch; gap: .5rem; }
  .chat-2pane #chLanding .room-grid { grid-template-columns: 1fr !important; gap: .45rem; }
  .chat-2pane #chLanding .room-search { max-width: 100% !important; }
  /* Empty-state hint when no chat is open yet (the log is empty + input disabled) */
  .chat-2pane #chInRoom .wa-app::before { content: none; }
}

/* Breadcrumb back-tracking: when a "section" crumb returns you to the hub, the
   target section briefly flashes so you can see where you landed. */
@keyframes hubSectionFlash {
  0%   { box-shadow: 0 0 0 0 rgba(124, 58, 237, 0); }
  20%  { box-shadow: 0 0 0 3px rgba(124, 58, 237, .55), 0 0 26px 2px rgba(124, 58, 237, .35); }
  100% { box-shadow: 0 0 0 0 rgba(124, 58, 237, 0); }
}
.studio-hub-section.hub-section-flash {
  animation: hubSectionFlash 1.6s ease-out;
  border-radius: 16px;
  scroll-margin-top: 90px;   /* clear the sticky breadcrumb/top bar when scrolled to */
}

/* ── AI Tools section + "Coming Soon" cards/panel ──────────────────────────── */
.studio-section-icon.ai {
  background: linear-gradient(135deg, #7c3aed, #ec4899);
  color: #fff;
}
.ai-soon-pill {
  display: inline-block; margin-left: .35rem; padding: .08rem .5rem; border-radius: 999px;
  font-size: .66rem; font-weight: 700; letter-spacing: .02em; vertical-align: middle;
  color: #fff; background: linear-gradient(135deg, #7c3aed, #ec4899);
}
.ai-tool-card { position: relative; }
.ai-tool-card .ai-soon-tag {
  position: absolute; top: .5rem; right: .5rem; padding: .05rem .42rem; border-radius: 999px;
  font-size: .58rem; font-weight: 700; letter-spacing: .03em; text-transform: uppercase;
  color: #fff; background: linear-gradient(135deg, #7c3aed, #ec4899); opacity: .92;
}
/* the AI cards are placeholders → softly dim the icon so they read as "upcoming" */
.ai-tool-card > .bi { opacity: .85; }

/* Coming Soon panel (rendered by X._comingSoonRender) */
.cs-soon { max-width: 520px; margin: 2.2rem auto; text-align: center; padding: 1.5rem 1.25rem; }
.cs-soon-orb {
  position: relative; width: 92px; height: 92px; margin: 0 auto 1.1rem; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 2.2rem; color: #fff;
  background: linear-gradient(135deg, #7c3aed, #ec4899);
  box-shadow: 0 12px 34px rgba(124, 58, 237, .45);
}
.cs-soon-orb .cs-soon-ring {
  position: absolute; inset: 0; border-radius: 50%; border: 2px solid rgba(124, 58, 237, .5);
  animation: csSoonPulse 2.4s ease-out infinite;
}
.cs-soon-orb .cs-soon-ring.r2 { animation-delay: 1.2s; }
@keyframes csSoonPulse {
  0%   { transform: scale(1); opacity: .7; }
  100% { transform: scale(1.7); opacity: 0; }
}
.cs-soon h2 { margin: .2rem 0 .5rem; font-size: 1.45rem; }
.cs-soon-badge {
  display: inline-block; margin: 0 0 .9rem; padding: .2rem .7rem; border-radius: 999px;
  font-size: .78rem; font-weight: 700; color: #fff; background: linear-gradient(135deg, #7c3aed, #ec4899);
}
.cs-soon-desc { color: var(--text-secondary); margin: 0 auto 1.1rem; max-width: 440px; line-height: 1.55; }
.cs-soon-note {
  display: flex; gap: .5rem; align-items: flex-start; text-align: left; margin: 0 auto 1.3rem;
  max-width: 440px; padding: .7rem .85rem; border-radius: 12px; font-size: .85rem;
  color: var(--text-secondary); background: var(--glass); border: 1px solid var(--glass-border);
}
.cs-soon-note .bi { color: var(--accent); margin-top: .1rem; }

/* ── Inspector tools: shared stat grid + frequency bars ───────────────────── */
.ins-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: .5rem; }
.ins-stat { background: var(--glass); border: 1px solid var(--glass-border); border-radius: 10px; padding: .55rem .7rem; min-width: 0; }
.ins-val { display: block; font-size: 1.2rem; font-weight: 700; color: var(--text-primary); word-break: break-word; line-height: 1.2; }
.ins-lbl { display: block; font-size: .72rem; color: var(--text-muted); margin-top: .15rem; }
.wf-row { position: relative; display: flex; align-items: center; gap: .5rem; padding: .3rem .5rem; border-radius: 8px; margin-bottom: .25rem; overflow: hidden; }
.wf-bar { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(90deg, rgba(124,58,237,.30), rgba(124,58,237,.10)); z-index: 0; }
.wf-w { position: relative; z-index: 1; flex: 1; word-break: break-word; }
.wf-n { position: relative; z-index: 1; font-weight: 700; color: var(--accent); }
.csv-view-table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.csv-view-table th, .csv-view-table td { border: 1px solid var(--glass-border); padding: .35rem .55rem; text-align: left; white-space: nowrap; }
.csv-view-table th { background: var(--glass); position: sticky; top: 0; font-weight: 700; }
.csv-view-table tr:nth-child(even) td { background: rgba(255,255,255,.02); }
.ascii-table td { font-family: monospace; }

/* ════════════════════════════════════════════════════════════════════════════
   MOBILE UX POLISH for tools/apps (2026-06-15) — professional touch experience.
   Loaded on the main app. Two goals: (1) NO iOS focus-zoom — every focusable
   field is ≥16px on phones; (2) comfortable ≥42px tap targets and a clean,
   roomy two-pane stack. Last in the cascade so it wins over earlier patches.
   ════════════════════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  /* Prevent the jarring auto-zoom iOS does when focusing a <16px field. */
  #studioUtilView .tool-input,
  #studioUtilView .tool-select,
  #studioUtilView .util-textarea,
  #studioUtilView input[type="text"],
  #studioUtilView input[type="number"],
  #studioUtilView input[type="search"],
  #studioUtilView input[type="time"],
  #studioUtilView input[type="date"],
  #studioUtilView textarea,
  #studioUtilView select { font-size: 16px !important; }
  /* Finger-friendly controls. */
  #studioUtilView .tool-input,
  #studioUtilView .tool-select,
  #studioUtilView select { min-height: 44px; }
  #studioUtilView .util-mini-btn { min-height: 38px; padding: .45rem .7rem; }
  #studioUtilView .btn-primary-gl { min-height: 46px; }
  /* Two-pane tool shell stacks with breathing room; output is comfortable. */
  .util-grid { grid-template-columns: 1fr !important; gap: .8rem; }
  .util-pane { padding: .9rem; }
  .util-bigresult { word-break: break-word; }
  /* Tool view header: compact title + scrollable breadcrumb, never overflow. */
  #studioUtilView .studio-util-head { gap: .5rem; }
  .breadcrumb-list { flex-wrap: wrap; }
}
@media (max-width: 420px) {
  /* Smallest phones: inspector stat grid two-up, color swatches full width. */
  .ins-grid { grid-template-columns: 1fr 1fr; }
}

/* ── API Analyzer / Link Tag Analyzer result rows ── */
.net-out-wrap { max-height: 460px; overflow: auto; }
.api-anz-row { display: flex; align-items: center; gap: .5rem; padding: .35rem .5rem; border-bottom: 1px solid var(--glass-border); font-size: .82rem; }
.api-anz-row:hover { background: var(--glass-hover); }
.api-anz-method { flex: 0 0 auto; min-width: 3.4em; text-align: center; padding: .08rem .4rem; border-radius: 5px; font-weight: 700; font-size: .68rem; letter-spacing: .04em; background: rgba(56,189,248,.18); color: var(--accent-2); }
.api-anz-kind { flex: 0 0 auto; padding: .08rem .4rem; border-radius: 5px; font-size: .66rem; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; background: rgba(167,139,250,.16); color: var(--accent); }
.api-anz-url { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--mono, monospace); color: var(--text-primary); }
.api-anz-src { flex: 0 0 auto; max-width: 40%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-muted); font-size: .72rem; }
.link-anz-sec { margin-bottom: .6rem; border: 1px solid var(--glass-border); border-radius: 10px; overflow: hidden; }
.link-anz-sec > summary { cursor: pointer; padding: .5rem .7rem; font-weight: 600; font-size: .85rem; background: var(--glass); display: flex; align-items: center; gap: .45rem; }
.link-anz-sec > summary::-webkit-details-marker { display: none; }
.link-anz-n { margin-left: auto; padding: .05rem .5rem; border-radius: 999px; background: rgba(167,139,250,.18); color: var(--accent); font-size: .72rem; font-weight: 700; }

/* ── Internet Speed Test (Ookla-style) — horizontal: gauge left, results right ── */
.st-app { max-width: 780px; margin: 0 auto; padding: .5rem; }
.st-horizontal { display: flex; align-items: center; gap: 1.8rem; }
.st-left { flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: 1.1rem; }
.st-right { flex: 1 1 0; min-width: 0; }
.st-gauge-wrap { position: relative; width: 250px; max-width: 58vw; }
.st-gauge { width: 100%; height: auto; display: block; }
.st-readout { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; }
.st-value { font-size: 2.7rem; font-weight: 800; line-height: 1; font-family: var(--app-font); color: var(--text-primary); }
.st-unit { font-size: .8rem; color: var(--text-muted); margin-top: .1rem; letter-spacing: .08em; }
.st-phase { margin-top: .5rem; font-size: .82rem; font-weight: 600; color: var(--accent-2); min-height: 1.1em; }
.st-go { width: 100%; max-width: 250px; }
.st-results { display: flex; flex-direction: column; gap: .6rem; }
.st-tile { display: flex; align-items: center; gap: .85rem; padding: .8rem 1rem; border: 1px solid var(--glass-border); border-radius: 14px; background: var(--glass); transition: border-color .2s, transform .2s; }
.st-tile-ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-size: 1.15rem; flex: 0 0 auto; }
.st-tile[data-k="down"] .st-tile-ic { background: rgba(56,189,248,.16); color: #38bdf8; }
.st-tile[data-k="up"]   .st-tile-ic { background: rgba(167,139,250,.16); color: #a78bfa; }
.st-tile[data-k="ping"] .st-tile-ic { background: rgba(52,211,153,.16); color: #34d399; }
.st-tile[data-k="jit"]  .st-tile-ic { background: rgba(251,191,36,.16); color: #fbbf24; }
.st-tile-body { display: flex; flex-direction: column; min-width: 0; }
.st-tile-l { font-size: .72rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; }
.st-tile-vrow { display: flex; align-items: baseline; gap: .3rem; }
.st-tile-v { font-size: 1.55rem; font-weight: 800; color: var(--text-primary); line-height: 1.15; }
.st-tile-u { font-size: .72rem; color: var(--text-muted); }
.st-hint { font-size: .76rem; margin-top: 1rem; display: flex; gap: .45rem; align-items: flex-start; }
.st-hint i { color: var(--accent-2); margin-top: .1rem; }
@media (max-width: 640px) { .st-horizontal { flex-direction: column; gap: 1.2rem; } .st-right { width: 100%; } .st-value { font-size: 2.2rem; } }

/* ── OSINT Username Search result grid ── */
.osu-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .5rem; max-height: 420px; overflow: auto; }
.osu-link { display: flex; align-items: center; gap: .45rem; padding: .5rem .65rem; border: 1px solid var(--glass-border); border-radius: 10px; background: var(--glass); color: var(--text-primary); font-size: .85rem; text-decoration: none; transition: border-color .15s, background .15s; }
.osu-link:hover { border-color: rgba(167,139,250,.5); background: var(--glass-hover); }
.osu-link i { color: var(--accent-2); font-size: .85rem; }

/* ── Security Log admin view ── */
.sec-chips { display: flex; gap: .4rem; flex-wrap: wrap; }
.sec-sev { display: inline-block; padding: .12rem .5rem; border-radius: 999px; font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .03em; }
.la-table .sec-url, .la-table .sec-detail { max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .8rem; }
.la-table .sec-url { font-family: ui-monospace, monospace; color: var(--text-secondary); }

/* ── OSINT: SSL/TLS Certificate Analyzer ── */
.ssl-grid { display: flex; flex-direction: column; gap: .3rem; }
.ssl-row { display: flex; gap: .6rem; align-items: baseline; padding: .3rem .1rem; border-bottom: 1px dashed var(--glass-border); }
.ssl-k { flex: 0 0 110px; color: var(--text-secondary); font-size: .8rem; }
.ssl-v { flex: 1; min-width: 0; word-break: break-all; font-family: ui-monospace, monospace; font-size: .82rem; color: var(--text-primary); }
.ssl-chain { padding: .45rem .6rem; margin-bottom: .4rem; border: 1px solid var(--glass-border); border-radius: 8px; background: var(--glass); font-size: .82rem; word-break: break-word; }

/* ===========================================================================
   WHOLE-SITE SCANNERS — Website Link Analyzer + API Endpoint Analyzer
   Shared ".scan-*" live-crawl UI: radar sweep, progress bar, live log, counters,
   result tabs/tables. Uses the existing glass/dark tokens.
   =========================================================================== */
.scan-app { display: flex; flex-direction: column; gap: 1rem; }
.scan-intro { display: flex; gap: 1rem; align-items: flex-start; padding: 1.1rem 1.2rem; border-radius: var(--radius-md); }
.scan-intro-ic { flex: 0 0 auto; width: 46px; height: 46px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.3rem; color: #fff; }
.scan-intro h3 { margin: 0 0 .2rem; font-size: 1.12rem; }
.scan-intro p { margin: 0; font-size: .85rem; }
.scan-form { padding: 1rem 1.1rem; border-radius: var(--radius-md); }
.scan-max { display: inline-flex; align-items: center; gap: .4rem; font-size: .8rem; color: var(--text-secondary); white-space: nowrap; }
.scan-consent { display: flex; align-items: center; gap: .45rem; margin-top: .6rem; font-size: .82rem; color: var(--text-secondary); cursor: pointer; }
.scan-consent input { accent-color: var(--accent); }
.scan-consent.scan-flash { color: #f59e0b; animation: scanFlash .4s ease 2; }
@keyframes scanFlash { 50% { opacity: .35; } }
.scan-stop { color: #fca5a5; border-color: rgba(239,68,68,.35) !important; }
.scan-stop:hover { background: rgba(239,68,68,.14); }

/* Live panel */
.scan-live { padding: 1rem 1.1rem; border-radius: var(--radius-md); display: flex; flex-direction: column; gap: .75rem; }
.scan-live-head { display: flex; align-items: center; gap: 1rem; }
.scan-live-status { flex: 1; min-width: 0; }
.scan-status-line { font-size: .86rem; color: var(--text-primary); margin-bottom: .5rem; }
.scan-status-line b { color: var(--accent-2); }

/* Radar sweep — concentric pulse rings + a rotating sweep arm */
.scan-radar { flex: 0 0 auto; position: relative; width: 56px; height: 56px; border-radius: 50%;
  background: radial-gradient(circle, rgba(56,189,248,.12), transparent 70%);
  border: 1px solid rgba(56,189,248,.35); overflow: hidden; }
.scan-radar::after { content: ''; position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(from 0deg, rgba(56,189,248,.55), transparent 25%);
  animation: scanSweep 1.5s linear infinite; }
.scan-radar span { position: absolute; left: 50%; top: 50%; width: 8px; height: 8px; border-radius: 50%;
  transform: translate(-50%, -50%); border: 1px solid rgba(56,189,248,.6); opacity: 0; animation: scanPulse 2.1s ease-out infinite; }
.scan-radar span:nth-child(2) { animation-delay: .7s; }
.scan-radar span:nth-child(3) { animation-delay: 1.4s; }
.scan-radar.done::after { animation: none; background: conic-gradient(from 0deg, rgba(52,211,153,.5), transparent 60%); }
.scan-radar.done { border-color: rgba(52,211,153,.45); }
.scan-radar.done span { animation: none; opacity: 0; }
@keyframes scanSweep { to { transform: rotate(360deg); } }
@keyframes scanPulse { 0% { width: 6px; height: 6px; opacity: .8; } 100% { width: 52px; height: 52px; opacity: 0; } }

/* Progress bar */
.scan-bar { height: 7px; border-radius: 6px; background: rgba(255,255,255,.07); overflow: hidden; }
.scan-bar-fill { height: 100%; width: 0; border-radius: 6px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .3s ease; box-shadow: 0 0 10px -2px var(--accent-2); }

/* Counter chips */
.scan-counters { display: flex; flex-wrap: wrap; gap: .4rem; }
.scan-chip { display: inline-flex; align-items: center; gap: .35rem; font-size: .76rem; font-weight: 600; padding: .26rem .6rem; border-radius: 20px; background: var(--glass); border: 1px solid var(--glass-border); color: var(--text-secondary); }
.scan-chip i { color: var(--accent-2); }

/* Live log */
.scan-logwrap { max-height: 240px; overflow: auto; border: 1px solid var(--glass-border); border-radius: 10px; background: rgba(0,0,0,.22); }
.scan-log { display: flex; flex-direction: column; }
.scan-row { display: flex; align-items: center; gap: .55rem; padding: .3rem .6rem; border-bottom: 1px solid rgba(255,255,255,.04); font-size: .78rem; animation: scanRowIn .25s ease; }
@keyframes scanRowIn { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; transform: none; } }
.scan-row-state { flex: 0 0 16px; display: inline-flex; align-items: center; justify-content: center; }
.scan-row-ic.dim { color: var(--text-muted); }
.scan-row-ic.ok { color: #34d399; }
.scan-row-ic.err { color: var(--danger); }
.scan-row-spin { width: 13px; height: 13px; border-radius: 50%; border: 2px solid var(--glass-border); border-top-color: var(--accent-2); animation: vsSpin .7s linear infinite; }
.scan-row-url { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: ui-monospace, monospace; color: var(--text-secondary); }
.scan-row-scanning .scan-row-url { color: var(--text-primary); }
.scan-row-note { flex: 0 0 auto; font-size: .72rem; color: var(--text-muted); }
.scan-row-done .scan-row-note { color: #6ee7b7; }
.scan-row-error .scan-row-note { color: #fca5a5; }

/* Results */
.scan-report { display: flex; flex-direction: column; gap: .9rem; margin-top: 1rem; }
.scan-summary { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; padding: .8rem 1rem; border-radius: var(--radius-md); font-size: .85rem; }
.scan-summary > i { color: var(--accent-2); font-size: 1.05rem; }
.scan-spec { display: flex; align-items: center; gap: .5rem; padding: .7rem 1rem; border-radius: var(--radius-md); font-size: .86rem; border: 1px solid rgba(52,211,153,.35) !important; }
.scan-spec > i { color: #34d399; }
.scan-spec a { color: var(--accent-2); word-break: break-all; }
.scan-note { font-size: .78rem; display: flex; gap: .4rem; align-items: flex-start; }
.scan-note i { color: #f59e0b; margin-top: .1rem; }

/* Link analyzer — tabs + lists */
.scan-tabs { display: flex; flex-wrap: wrap; gap: .4rem; }
.scan-tab { display: inline-flex; align-items: center; gap: .4rem; padding: .35rem .7rem; border-radius: 8px; font-size: .8rem; font-weight: 600; cursor: pointer; background: var(--glass); border: 1px solid var(--glass-border); color: var(--text-secondary); }
.scan-tab:hover { color: var(--text-primary); border-color: rgba(167,139,250,.4); }
.scan-tab.active { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; border-color: transparent; }
.scan-tab-n { font-size: .72rem; font-weight: 700; padding: .04rem .4rem; border-radius: 20px; background: rgba(0,0,0,.22); }
.scan-pane-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .4rem; font-size: .8rem; }
.scan-pane-acts { display: flex; gap: .35rem; }
.scan-lwrap { max-height: 460px; overflow: auto; border: 1px solid var(--glass-border); border-radius: 10px; background: rgba(0,0,0,.18); padding: .3rem 0; }
.scan-lrow { display: flex; align-items: center; gap: .6rem; padding: .32rem .7rem; border-bottom: 1px solid rgba(255,255,255,.04); }
.scan-lurl { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; padding: .3rem .7rem; font-family: ui-monospace, monospace; font-size: .8rem; color: var(--accent-2); text-decoration: none; border-bottom: 1px solid rgba(255,255,255,.04); }
.scan-lrow .scan-lurl { padding: 0; border: none; }
.scan-lurl:hover { text-decoration: underline; }
.scan-lcount { flex: 0 0 auto; font-size: .72rem; font-weight: 700; color: var(--text-muted); padding: .08rem .45rem; border-radius: 20px; background: rgba(167,139,250,.14); }
.scan-extgrp { border-bottom: 1px solid rgba(255,255,255,.04); }
.scan-extgrp > summary { display: flex; align-items: center; justify-content: space-between; gap: .6rem; padding: .42rem .7rem; cursor: pointer; list-style: none; }
.scan-extgrp > summary::-webkit-details-marker { display: none; }
.scan-extgrp[open] > summary { background: var(--glass-hover); }
.scan-dom { font-weight: 600; color: var(--text-primary); font-size: .84rem; }

/* API analyzer — table */
.scan-h { margin: .4rem 0 -.1rem; font-size: .95rem; display: flex; align-items: center; gap: .45rem; color: var(--text-primary); }
.scan-h i { color: var(--accent-2); }
.scan-table { border: 1px solid var(--glass-border); border-radius: 10px; overflow: hidden; background: rgba(0,0,0,.18); }
.scan-trow { display: grid; grid-template-columns: 5em 1fr 4.5em 6.5em; gap: .6rem; align-items: center; padding: .38rem .7rem; border-bottom: 1px solid rgba(255,255,255,.04); font-size: .8rem; }
.scan-trow:last-child { border-bottom: none; }
.scan-thead { font-size: .68rem; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); font-weight: 700; background: rgba(255,255,255,.03); }
.scan-tep { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: ui-monospace, monospace; color: var(--text-primary); }
.scan-torigin { font-size: .68rem; font-weight: 700; text-transform: uppercase; text-align: center; padding: .06rem .35rem; border-radius: 5px; }
.scan-torigin.same { color: #6ee7b7; background: rgba(16,185,129,.14); }
.scan-torigin.cross { color: #fcd34d; background: rgba(245,158,11,.14); }
.scan-tsrc { font-size: .72rem; color: var(--text-muted); text-align: right; }
.api-anz-method.m-get { background: rgba(56,189,248,.18); color: var(--accent-2); }
.api-anz-method.m-post { background: rgba(52,211,153,.18); color: #6ee7b7; }
.api-anz-method.m-put, .api-anz-method.m-patch { background: rgba(245,158,11,.18); color: #fcd34d; }
.api-anz-method.m-delete { background: rgba(239,68,68,.18); color: #fca5a5; }
.api-anz-method.m-head, .api-anz-method.m-options { background: rgba(167,139,250,.18); color: var(--accent); }

@media (max-width: 600px) {
  .scan-trow { grid-template-columns: 4em 1fr; }
  .scan-trow > .scan-torigin, .scan-trow > .scan-tsrc, .scan-thead > span:nth-child(3), .scan-thead > span:nth-child(4) { display: none; }
}

/* ============================================================
   PROFESSIONAL MESSENGER CHAT (ch-*)
   Two-panel Signal/Telegram-style layout
   ============================================================ */

.ch-app {
  display: flex;
  height: 78vh;
  min-height: 540px;
  max-height: 880px;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--glass-border);
  background: rgba(0,0,0,.22);
}

/* ── LEFT: Sidebar (rooms list) ── */
.ch-sidebar {
  flex: 0 0 290px;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--glass-border);
  background: rgba(0,0,0,.18);
  overflow: hidden;
  transition: transform .22s;
}

.ch-sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .75rem 1rem;
  border-bottom: 1px solid var(--glass-border);
  background: rgba(0,0,0,.18);
  gap: .5rem;
}

.ch-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -.02em;
}

.ch-sidebar-actions { display: flex; gap: .3rem; }

.ch-icon-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,.06);
  color: var(--text-secondary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: .85rem;
  transition: background .14s, color .14s;
  flex-shrink: 0;
}
.ch-icon-btn:hover { background: rgba(255,255,255,.14); color: var(--accent); }
.ch-icon-btn.active { background: rgba(167,139,250,.22); color: var(--accent); }

.ch-search-wrap {
  padding: .5rem .75rem;
  border-bottom: 1px solid rgba(255,255,255,.04);
}
.ch-search {
  width: 100%;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 999px;
  padding: .38rem .9rem;
  color: var(--text-primary);
  font-size: .83rem;
  outline: none;
  transition: border-color .14s, background .14s;
}
.ch-search::placeholder { color: var(--text-muted); }
.ch-search:focus { border-color: rgba(167,139,250,.5); background: rgba(255,255,255,.09); }

.ch-room-list { flex: 1; overflow-y: auto; }
.ch-room-list::-webkit-scrollbar { width: 3px; }
.ch-room-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 3px; }

.ch-room-item {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .65rem 1rem;
  cursor: pointer;
  border-bottom: 1px solid rgba(255,255,255,.03);
  transition: background .12s;
  position: relative;
  min-width: 0;
}
.ch-room-item:hover { background: rgba(255,255,255,.04); }
.ch-room-item.active {
  background: rgba(167,139,250,.11);
}
.ch-room-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  border-radius: 0 3px 3px 0;
}

.ch-room-avatar {
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .95rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  position: relative;
  text-transform: uppercase;
}
.ch-room-avatar.dm { border-radius: 12px; }

.ch-online-dot {
  position: absolute;
  right: 1px; bottom: 1px;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: #22c55e;
  border: 2px solid rgba(0,0,0,.6);
}

.ch-room-info { flex: 1; min-width: 0; }
.ch-room-row1 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: .12rem;
  gap: .3rem;
}
.ch-room-name-label {
  font-size: .85rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}
.ch-room-time {
  font-size: .68rem;
  color: var(--text-muted);
  flex-shrink: 0;
}
.ch-room-preview {
  font-size: .77rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ch-unread-badge {
  flex-shrink: 0;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  padding: 0 .25rem;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  font-size: .64rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ch-new-btn {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .65rem 1rem;
  cursor: pointer;
  color: var(--accent);
  font-size: .82rem;
  font-weight: 600;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  border-bottom: 1px solid rgba(255,255,255,.04);
  transition: background .12s;
}
.ch-new-btn:hover { background: rgba(167,139,250,.07); }
.ch-new-btn i { font-size: 1rem; }

.ch-sidebar-footer {
  padding: .5rem .75rem;
  border-top: 1px solid var(--glass-border);
  display: flex;
  gap: .35rem;
}
.ch-sidebar-footer .ch-icon-btn { flex: 1; width: auto; border-radius: 8px; font-size: .78rem; gap: .3rem; }
.ch-sidebar-footer .ch-icon-btn i { font-size: .85rem; }

/* ── RIGHT: Chat body ── */
.ch-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: rgba(0,0,0,.1);
  position: relative;
}

.ch-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .7rem;
  color: var(--text-muted);
  text-align: center;
  padding: 2rem;
}
.ch-empty > i { font-size: 3.5rem; opacity: .18; }
.ch-empty h3 { font-size: 1.05rem; font-weight: 600; color: var(--text-secondary); margin: 0; }
.ch-empty p { font-size: .82rem; margin: 0; max-width: 260px; }

.ch-active { display: flex; flex-direction: column; height: 100%; min-height: 0; }

/* Chat top bar */
.ch-head {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .6rem 1rem;
  border-bottom: 1px solid var(--glass-border);
  background: rgba(0,0,0,.22);
  flex-shrink: 0;
}

.ch-back-btn {
  display: none;
  width: 32px; height: 32px;
  border-radius: 50%;
  border: none;
  background: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 1rem;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ch-head-info { display: flex; align-items: center; gap: .6rem; flex: 1; min-width: 0; }

.ch-head-avatar {
  flex: 0 0 36px;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .9rem;
  font-weight: 700;
  text-transform: uppercase;
  flex-shrink: 0;
}

.ch-head-name { font-size: .9rem; font-weight: 700; color: var(--text-primary); }
.ch-head-sub { font-size: .72rem; color: var(--text-muted); }
.ch-head-sub .ch-online { color: #22c55e; font-weight: 600; }

.ch-head-actions { display: flex; gap: .25rem; margin-left: auto; }

/* Notification permission bar */
.ch-notif-bar {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .4rem .9rem;
  background: rgba(56,189,248,.07);
  border-bottom: 1px solid rgba(56,189,248,.18);
  font-size: .8rem;
  color: var(--text-secondary);
  flex-shrink: 0;
  flex-wrap: wrap;
}
.ch-notif-allow {
  background: rgba(56,189,248,.2);
  border: none;
  color: var(--accent-2);
  border-radius: 6px;
  padding: .2rem .6rem;
  cursor: pointer;
  font-size: .78rem;
  font-weight: 600;
}
.ch-notif-dismiss {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  margin-left: auto;
  font-size: 1rem;
  line-height: 1;
}

/* Message log */
.ch-log {
  flex: 1;
  overflow-y: auto;
  padding: .7rem 1rem;
  display: flex;
  flex-direction: column;
  gap: .25rem;
  min-height: 0;
}
.ch-log::-webkit-scrollbar { width: 5px; }
.ch-log::-webkit-scrollbar-track { background: transparent; }
.ch-log::-webkit-scrollbar-thumb { background: rgba(255,255,255,.09); border-radius: 5px; }
.ch-log::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.18); }

/* Date separator */
.ch-date-sep {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .7rem;
  color: var(--text-muted);
  margin: .5rem 0 .2rem;
  text-align: center;
  user-select: none;
}
.ch-date-sep::before, .ch-date-sep::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(255,255,255,.06);
}

/* Message wrapper */
.ch-msg {
  display: flex;
  flex-direction: column;
  max-width: 70%;
  position: relative;
}
.ch-msg.mine { align-self: flex-end; align-items: flex-end; }
.ch-msg.theirs { align-self: flex-start; align-items: flex-start; }

.ch-msg-row { display: flex; align-items: flex-end; gap: .4rem; }
.ch-msg.mine .ch-msg-row { flex-direction: row-reverse; }

.ch-av-sm {
  flex-shrink: 0;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .66rem;
  font-weight: 700;
  text-transform: uppercase;
  align-self: flex-end;
}

/* Bubble */
.ch-bubble {
  position: relative;
  padding: .48rem .75rem .85rem;
  border-radius: 16px;
  word-break: break-word;
  white-space: pre-wrap;
  max-width: 100%;
  font-size: .875rem;
}
.ch-msg.theirs .ch-bubble {
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 4px 16px 16px 16px;
  color: var(--text-primary);
}
.ch-msg.mine .ch-bubble {
  background: linear-gradient(135deg, rgba(167,139,250,.35), rgba(56,189,248,.25));
  border: 1px solid rgba(167,139,250,.28);
  border-radius: 16px 4px 16px 16px;
  color: var(--text-primary);
}
.ch-bubble.ch-del { opacity: .55; font-style: italic; padding: .42rem .75rem; }

/* Reply quote */
.ch-reply-quote {
  background: rgba(0,0,0,.22);
  border-left: 3px solid var(--accent-2);
  border-radius: 0 6px 6px 0;
  padding: .22rem .55rem;
  margin-bottom: .3rem;
  font-size: .76rem;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}
.ch-reply-who { font-weight: 700; color: var(--accent-2); margin-right: .3rem; }

.ch-who { display: block; font-size: .68rem; font-weight: 700; color: var(--accent-2); margin-bottom: .12rem; }
.ch-msg.mine .ch-who { display: none; }

.ch-text { color: var(--text-primary); line-height: 1.45; }
.ch-locked { color: var(--text-muted); font-style: italic; }
.ch-locked i { color: #f59e0b; }

.ch-meta {
  position: absolute;
  right: .5rem; bottom: .2rem;
  font-size: .63rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: .2rem;
  white-space: nowrap;
}
.ch-edited { opacity: .7; }

/* Translation */
.ch-trbox { font-size: .78rem; color: var(--text-secondary); margin-top: .3rem; padding-top: .22rem; border-top: 1px dashed rgba(255,255,255,.08); display: none; }

/* Hover action bar */
.ch-actions {
  position: absolute;
  top: -20px;
  right: .2rem;
  display: none;
  background: rgba(10,10,20,.97);
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  padding: .1rem .25rem;
  gap: .05rem;
  align-items: center;
  box-shadow: 0 4px 14px rgba(0,0,0,.45);
  z-index: 10;
  white-space: nowrap;
}
.ch-msg:hover .ch-actions { display: flex; }
.ch-msg.mine .ch-actions { right: auto; left: .2rem; }

.ch-act {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: .8rem;
  padding: .18rem .3rem;
  border-radius: 999px;
  transition: color .1s, background .1s;
  display: inline-flex;
  align-items: center;
}
.ch-act:hover { color: var(--text-primary); background: rgba(255,255,255,.1); }
.ch-act.danger:hover { color: #f87171; }

/* Emoji picker inline (quick reactions) */
.ch-react-picker {
  display: flex;
  gap: .15rem;
  padding: .15rem .2rem;
  border-right: 1px solid rgba(255,255,255,.1);
  margin-right: .15rem;
}
.ch-react-pick {
  background: none;
  border: none;
  font-size: .88rem;
  cursor: pointer;
  border-radius: 5px;
  padding: .08rem .18rem;
  line-height: 1;
  transition: transform .1s;
}
.ch-react-pick:hover { transform: scale(1.3); background: rgba(255,255,255,.08); }

/* Reactions display */
.ch-reactions {
  display: flex;
  flex-wrap: wrap;
  gap: .2rem;
  margin-top: .25rem;
}
.ch-reaction {
  display: inline-flex;
  align-items: center;
  gap: .2rem;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 999px;
  padding: .1rem .42rem;
  font-size: .82rem;
  cursor: pointer;
  transition: background .12s, border-color .12s;
  line-height: 1;
}
.ch-reaction:hover { background: rgba(167,139,250,.18); border-color: rgba(167,139,250,.38); }
.ch-reaction.mine-react { background: rgba(167,139,250,.2); border-color: rgba(167,139,250,.42); }
.ch-react-ct { font-size: .7rem; font-weight: 700; color: var(--text-secondary); }

/* Typing indicator */
.ch-typing {
  display: flex;
  align-items: center;
  gap: .45rem;
  padding: .28rem 1rem;
  font-size: .77rem;
  color: var(--text-muted);
  flex-shrink: 0;
  min-height: 26px;
}
.ch-typing-dots { display: flex; gap: 3px; }
.ch-typing-dots span {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: chBounce 1.1s ease-in-out infinite;
  opacity: .5;
}
.ch-typing-dots span:nth-child(2) { animation-delay: .18s; }
.ch-typing-dots span:nth-child(3) { animation-delay: .36s; }
@keyframes chBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: .4; }
  30% { transform: translateY(-5px); opacity: 1; }
}

/* Edit / Reply bars */
.ch-editbar, .ch-replybar {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .38rem .9rem;
  font-size: .8rem;
  flex-shrink: 0;
}
.ch-editbar { background: rgba(167,139,250,.08); border-top: 1px solid rgba(167,139,250,.2); color: var(--accent); }
.ch-replybar { background: rgba(56,189,248,.06); border-top: 1px solid rgba(56,189,248,.18); color: var(--accent-2); }
.ch-editbar i, .ch-replybar i { font-size: .9rem; }
.ch-replybar-txt { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-cancel-x {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0 .2rem;
  border-radius: 4px;
  flex-shrink: 0;
}
.ch-cancel-x:hover { color: #f87171; }

/* Input area */
.ch-input-area {
  display: flex;
  align-items: center;
  gap: .45rem;
  padding: .55rem .85rem;
  background: rgba(0,0,0,.28);
  border-top: 1px solid var(--glass-border);
  flex-shrink: 0;
}
.ch-input {
  flex: 1;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 999px;
  padding: .52rem 1rem;
  color: var(--text-primary);
  font-size: .875rem;
  outline: none;
  transition: border-color .14s, background .14s;
}
.ch-input:focus { border-color: rgba(167,139,250,.5); background: rgba(255,255,255,.09); }
.ch-input::placeholder { color: var(--text-muted); }
.ch-input:disabled { opacity: .45; }

.ch-send-btn {
  flex-shrink: 0;
  width: 40px; height: 40px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  cursor: pointer;
  font-size: .95rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity .14s, transform .1s;
  box-shadow: 0 3px 10px rgba(167,139,250,.35);
}
.ch-send-btn:disabled { opacity: .38; cursor: default; box-shadow: none; }
.ch-send-btn:not(:disabled):hover { opacity: .88; }
.ch-send-btn:not(:disabled):active { transform: scale(.88); }
.ch-send-btn.editing { background: linear-gradient(135deg, #10b981, #22d3ee); }

/* E2EE toolbar */
.ch-e2ee-bar {
  display: flex;
  align-items: center;
  gap: .45rem;
  padding: .38rem .85rem;
  background: rgba(245,158,11,.06);
  border-top: 1px solid rgba(245,158,11,.18);
  flex-shrink: 0;
  flex-wrap: wrap;
}
.ch-e2ee-input {
  flex: 1;
  min-width: 110px;
  background: rgba(0,0,0,.22);
  border: 1px solid rgba(245,158,11,.28);
  border-radius: 8px;
  padding: .28rem .6rem;
  color: var(--text-primary);
  font-size: .8rem;
  outline: none;
}
.ch-e2ee-input:focus { border-color: rgba(245,158,11,.55); }
.ch-lang-sel {
  background: rgba(0,0,0,.22);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 8px;
  padding: .28rem .5rem;
  color: var(--text-primary);
  font-size: .8rem;
  cursor: pointer;
}
.ch-auto-lbl { font-size: .78rem; color: var(--text-muted); display: flex; align-items: center; gap: .28rem; cursor: pointer; white-space: nowrap; }
.ch-e2ee-active .ch-input { border-color: rgba(245,158,11,.4); }

/* No messages */
.ch-no-msgs {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  gap: .6rem;
  color: var(--text-muted);
  text-align: center;
  padding: 2rem;
}
.ch-no-msgs i { font-size: 2.2rem; opacity: .25; }

/* ── Mobile: stacked panels ── */
@media (max-width: 720px) {
  .ch-app { height: 83vh; min-height: 0; border-radius: var(--radius-sm); }
  .ch-sidebar { flex: 1 1 100%; max-width: 100%; border-right: none; }
  .ch-body { position: absolute; inset: 0; z-index: 20; background: var(--bg-base, #0d0b1e); display: none; }
  .ch-app.ch-open .ch-sidebar { display: none; }
  .ch-app.ch-open .ch-body { display: flex; }
  .ch-back-btn { display: inline-flex !important; }
  .ch-msg { max-width: 86%; }
}

/* ============================================================
   PROFESSIONAL VIDEO ROOM (vr-* overrides / extensions)
   Zoom-style layout with in-call chat panel
   ============================================================ */

/* Outer wrapper when chat is open */
.vr-with-chat { display: flex; gap: 0; height: 100%; overflow: hidden; }
.vr-with-chat .vr-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.vr-chat-panel {
  flex: 0 0 280px;
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--glass-border);
  background: rgba(0,0,0,.28);
  transition: all .22s;
}
.vr-chat-panel.hidden { flex: 0 0 0; overflow: hidden; }

.vr-chat-log {
  flex: 1;
  overflow-y: auto;
  padding: .6rem .75rem;
  display: flex;
  flex-direction: column;
  gap: .3rem;
  font-size: .82rem;
}
.vr-chat-log::-webkit-scrollbar { width: 3px; }
.vr-chat-log::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 3px; }

.vr-chat-msg { display: flex; flex-direction: column; }
.vr-chat-who { font-size: .68rem; font-weight: 700; color: var(--accent-2); margin-bottom: .1rem; }
.vr-chat-text { background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.09); border-radius: 10px; padding: .3rem .55rem; color: var(--text-primary); word-break: break-word; white-space: pre-wrap; }
.vr-chat-msg.mine .vr-chat-text { background: rgba(167,139,250,.2); border-color: rgba(167,139,250,.25); }

.vr-chat-input-row {
  display: flex;
  gap: .4rem;
  padding: .5rem .6rem;
  border-top: 1px solid var(--glass-border);
  flex-shrink: 0;
}
.vr-chat-inp {
  flex: 1;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 999px;
  padding: .38rem .75rem;
  color: var(--text-primary);
  font-size: .82rem;
  outline: none;
}
.vr-chat-inp:focus { border-color: rgba(167,139,250,.4); }
.vr-chat-send {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  cursor: pointer;
  font-size: .82rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Upgraded participant grid */
.vr-grid-wrap { flex: 1; overflow: hidden; position: relative; }
.vr-grid { position: absolute; inset: 0; display: grid; gap: .4rem; padding: .4rem; align-content: center; }
.vr-tile {
  position: relative;
  background: #0a0c14;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid transparent;
  transition: border-color .2s, box-shadow .2s;
}
.vr-tile.speaking { border-color: #22c55e; box-shadow: 0 0 0 2px rgba(34,197,94,.3); }
.vr-tile.pinned { border-color: var(--accent-2); }
.vr-tile video { width: 100%; height: 100%; object-fit: cover; display: block; background: #0a0c14; }
.vr-tile.vr-tile-novideo video { visibility: hidden; }
.vr-tile-ph { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; }
.vr-tile.vr-tile-novideo .vr-tile-ph { display: flex; }
.vr-tile-av {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  font-weight: 700;
}
.vr-tile-bar {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: .3rem .55rem;
  background: linear-gradient(transparent, rgba(0,0,0,.65));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .35rem;
}
.vr-tile-name { font-size: .75rem; font-weight: 600; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vr-tile-mic { font-size: .78rem; flex-shrink: 0; color: rgba(255,255,255,.7); }
.vr-tile-mic.off { color: #f87171; }

/* Upgraded controls toolbar */
.vr-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  padding: .7rem 1rem;
  background: rgba(0,0,0,.42);
  border-top: 1px solid rgba(255,255,255,.06);
  flex-wrap: wrap;
  flex-shrink: 0;
}
.vr-ctrl {
  width: 46px; height: 46px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.1);
  background: rgba(255,255,255,.07);
  color: var(--text-primary);
  cursor: pointer;
  font-size: 1.05rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background .14s, transform .1s, border-color .14s;
  position: relative;
}
.vr-ctrl:hover { background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.22); }
.vr-ctrl:active { transform: scale(.9); }
.vr-ctrl:disabled { opacity: .35; cursor: default; }
.vr-ctrl.off { background: rgba(239,68,68,.25); color: #f87171; border-color: rgba(239,68,68,.38); }
.vr-ctrl.vr-end { background: #ef4444; color: #fff; border-color: transparent; border-radius: 999px; padding: 0 1.2rem; width: auto; gap: .35rem; font-size: .85rem; font-weight: 600; }
.vr-ctrl.vr-end:hover { background: #dc2626; }
.vr-ctrl.vr-call { background: #16a34a; color: #fff; border-color: transparent; }
.vr-ctrl.on { background: linear-gradient(135deg, rgba(167,139,250,.35), rgba(56,189,248,.25)); border-color: rgba(167,139,250,.45); color: var(--accent); }
.vr-ctrl-label { position: absolute; bottom: -17px; font-size: .6rem; color: var(--text-muted); white-space: nowrap; pointer-events: none; }
.vr-ctrl-wrap { display: flex; flex-direction: column; align-items: center; padding-bottom: .3rem; }
.vr-ctrl.vr-start { border-radius: 999px; padding: 0 1.2rem; width: auto; gap: .4rem; font-size: .85rem; font-weight: 600; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; border-color: transparent; }

/* Meeting time counter */
.vr-timer { font-size: .78rem; color: var(--text-muted); font-variant-numeric: tabular-nums; letter-spacing: .03em; }

/* Participant sidebar (right, toggle) */
.vr-participants {
  position: absolute;
  right: 0; top: 0; bottom: 0;
  width: 220px;
  background: rgba(0,0,0,.55);
  border-left: 1px solid rgba(255,255,255,.07);
  backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  z-index: 5;
  transition: transform .2s;
}
.vr-participants.hidden { transform: translateX(100%); }
.vr-participants-head { padding: .55rem .75rem; border-bottom: 1px solid rgba(255,255,255,.07); font-size: .82rem; font-weight: 700; color: var(--text-primary); }
.vr-participants-list { flex: 1; overflow-y: auto; }
.vr-part-row { display: flex; align-items: center; gap: .55rem; padding: .5rem .75rem; border-bottom: 1px solid rgba(255,255,255,.04); }
.vr-part-av { width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; display: flex; align-items: center; justify-content: center; font-size: .8rem; font-weight: 700; flex-shrink: 0; }
.vr-part-name { flex: 1; font-size: .8rem; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vr-part-icons { display: flex; gap: .25rem; flex-shrink: 0; }
.vr-part-icons i { font-size: .75rem; color: var(--text-muted); }
.vr-part-icons i.off { color: #f87171; }

/* Top bar with room info */
.vr-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .6rem;
  padding: .55rem .85rem;
  background: rgba(0,0,0,.35);
  border-bottom: 1px solid rgba(255,255,255,.06);
  flex-shrink: 0;
  flex-wrap: wrap;
}
.vr-title {
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: .45rem;
  font-size: .9rem;
}
.vr-badges { display: flex; align-items: center; gap: .4rem; }
.vr-badge {
  font-size: .7rem;
  font-weight: 600;
  padding: .12rem .45rem;
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  color: var(--text-secondary);
  border: 1px solid rgba(255,255,255,.1);
  display: flex;
  align-items: center;
  gap: .25rem;
}
.vr-badge.live { background: rgba(239,68,68,.22); color: #f87171; border-color: rgba(239,68,68,.3); }
.vr-badge.secure { background: rgba(34,197,94,.14); color: #6ee7b7; border-color: rgba(34,197,94,.28); }
.vr-count-badge { background: rgba(56,189,248,.15); color: var(--accent-2); border-color: rgba(56,189,248,.28); }
.vr-topbar-actions { display: flex; gap: .3rem; align-items: center; }

@media (max-width: 600px) {
  .vr-controls { gap: .4rem; padding: .55rem .75rem; }
  .vr-ctrl { width: 42px; height: 42px; font-size: .95rem; }
  .vr-ctrl.vr-end, .vr-ctrl.vr-start { padding: 0 .9rem; font-size: .8rem; }
  .vr-chat-panel { flex: 0 0 0; overflow: hidden; }
}

/* ══════════════════════════════════════════════════════════════════════════════
   AI STUDIO — ChatGPT/Claude/Gemini-style interface using existing glass system
   ══════════════════════════════════════════════════════════════════════════════ */
.ai-studio {
  display: flex; height: 100%; min-height: 580px; border-radius: 18px; overflow: hidden;
  background: var(--glass); border: 1px solid var(--glass-border);
  backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
  box-shadow: var(--glass-shadow);
}
/* ── Sidebar ── */
.ai-sidebar {
  flex: 0 0 260px; width: 260px; display: flex; flex-direction: column;
  background: rgba(0,0,0,.28); border-right: 1px solid var(--glass-border);
  overflow: hidden; transition: width .22s ease, opacity .22s ease;
}
.ai-sidebar.collapsed { flex: 0 0 0; width: 0; opacity: 0; pointer-events: none; }
.ai-sidebar-top { flex: 1; display: flex; flex-direction: column; overflow: hidden; padding: .65rem; gap: .4rem; }
.ai-new-chat {
  display: flex; align-items: center; justify-content: center; gap: .45rem;
  width: 100%; padding: .6rem .8rem; border-radius: 12px; border: 1px solid var(--glass-border);
  background: var(--glass-solid); color: var(--text-primary); font-weight: 600; font-size: .85rem;
  cursor: pointer; transition: background .15s;
}
.ai-new-chat:hover { background: var(--glass-hover); }
.ai-new-chat i { color: var(--accent); font-size: 1rem; }
.ai-conv-search { position: relative; margin-bottom: .2rem; }
.ai-conv-search input {
  width: 100%; padding: .42rem .75rem .42rem 2rem; border-radius: 9px;
  background: var(--glass-inset); border: 1px solid var(--glass-inset-border);
  color: var(--text-primary); font-size: .8rem;
}
.ai-conv-search i { position: absolute; left: .6rem; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-size: .8rem; }
.ai-conv-list { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.ai-conv-item {
  display: flex; align-items: center; gap: .5rem; padding: .55rem .6rem; border-radius: 11px;
  cursor: pointer; transition: background .13s; position: relative; min-width: 0;
}
.ai-conv-item:hover { background: var(--glass-solid); }
.ai-conv-item.active { background: rgba(167,139,250,.18); border: 1px solid rgba(167,139,250,.3); }
.ai-conv-dot { flex-shrink: 0; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.ai-conv-dot.claude { background: #a78bfa; }
.ai-conv-dot.openai { background: #10a37f; }
.ai-conv-dot.gemini { background: #1a73e8; }
.ai-conv-dot.local { background: #f59e0b; }
.ai-conv-title { flex: 1; font-size: .8rem; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.ai-conv-del, .ai-conv-edit { flex-shrink: 0; background: none; border: none; color: var(--text-muted); padding: .2rem; cursor: pointer; border-radius: 5px; font-size: .8rem; opacity: 0; transition: opacity .12s, color .12s; }
.ai-conv-item:hover .ai-conv-del, .ai-conv-item:hover .ai-conv-edit { opacity: 1; }
.ai-conv-del:hover { color: #f87171; }
.ai-conv-edit:hover { color: var(--accent); }
.ai-conv-empty { color: var(--text-muted); font-size: .8rem; text-align: center; padding: 1.5rem .5rem; }
.ai-sidebar-bottom { padding: .5rem .65rem .65rem; border-top: 1px solid var(--glass-border); display: flex; gap: .4rem; flex-wrap: wrap; }
.ai-sidebar-btn {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: .4rem;
  padding: .5rem .6rem; border-radius: 10px; background: var(--glass-inset);
  border: 1px solid var(--glass-inset-border); color: var(--text-muted);
  font-size: .78rem; cursor: pointer; transition: color .13s, background .13s;
}
.ai-sidebar-btn:hover { background: var(--glass-solid); color: var(--text-primary); }
.ai-sidebar-btn i { font-size: .85rem; color: var(--accent); }
/* ── Main area ── */
.ai-main { flex: 1; display: flex; flex-direction: column; min-width: 0; overflow: hidden; }
.ai-main-header {
  display: flex; align-items: center; gap: .6rem; padding: .65rem .9rem;
  border-bottom: 1px solid var(--glass-border); background: rgba(0,0,0,.18); flex-shrink: 0;
}
.ai-menu-btn {
  flex-shrink: 0; width: 34px; height: 34px; display: grid; place-items: center;
  border-radius: 9px; background: none; border: 1px solid var(--glass-border);
  color: var(--text-muted); cursor: pointer; transition: color .12s, background .12s;
}
.ai-menu-btn:hover { color: var(--text-primary); background: var(--glass-solid); }
.ai-provider-row { display: flex; align-items: center; gap: .6rem; flex: 1; min-width: 0; flex-wrap: wrap; }
.ai-prov-pills { display: flex; gap: .3rem; flex-shrink: 0; }
.ai-prov-pill {
  display: flex; align-items: center; gap: .35rem; padding: .3rem .7rem;
  border-radius: 20px; border: 1px solid var(--glass-border); background: none;
  color: var(--text-muted); font-size: .78rem; font-weight: 600; cursor: pointer;
  transition: all .13s;
}
.ai-prov-pill:hover, .ai-prov-pill.active {
  background: rgba(167,139,250,.16); border-color: var(--accent); color: var(--text-primary);
}
.ai-prov-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.ai-prov-dot.claude { background: #a78bfa; }
.ai-prov-dot.openai { background: #10a37f; }
.ai-prov-dot.gemini { background: #1a73e8; }
.ai-prov-dot.local { background: #f59e0b; }
.ai-model-sel {
  background: var(--glass-inset); border: 1px solid var(--glass-inset-border);
  color: var(--text-primary); border-radius: 9px; padding: .3rem .55rem;
  font-size: .78rem; min-width: 0; flex: 1; max-width: 220px;
}
/* Professional provider dropdown (Claude / GPT / Gemini / Local) */
.ai-prov-select-wrap {
  display: inline-flex; align-items: center; gap: .5rem; flex-shrink: 0;
  padding: .34rem .7rem .34rem .65rem;
  background: linear-gradient(160deg, rgba(255,255,255,.08), rgba(255,255,255,.02));
  border: 1px solid var(--glass-border);
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  border-radius: 10px; transition: border-color .15s, box-shadow .15s;
}
.ai-prov-select-wrap:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(167,139,250,.16); }
.ai-prov-select-wrap .ai-prov-dot { width: 9px; height: 9px; box-shadow: 0 0 8px currentColor; }
.ai-prov-dot.claude { color: #a78bfa; } .ai-prov-dot.openai { color: #10a37f; }
.ai-prov-dot.gemini { color: #1a73e8; } .ai-prov-dot.local  { color: #f59e0b; }
.ai-prov-sel {
  appearance: none; -webkit-appearance: none; background: transparent; border: none; outline: none;
  color: var(--text-primary); font-size: .84rem; font-weight: 700; cursor: pointer;
  padding-right: 1.1rem; letter-spacing: .01em;
  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='%23a78bfa' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right center;
}
.ai-prov-sel option:disabled { color: var(--text-muted); }
.ai-clear-btn { margin-left: auto; flex-shrink: 0; }
/* ── Messages ── */
.ai-messages {
  flex: 1; overflow-y: auto; padding: 1.2rem 1rem; display: flex; flex-direction: column; gap: .6rem;
  scroll-behavior: smooth;
}
.ai-welcome {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  flex: 1; text-align: center; gap: .75rem; padding: 2rem 1.5rem;
}
.ai-welcome-icon {
  width: 72px; height: 72px; border-radius: 22px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  font-size: 2.2rem; color: #fff; box-shadow: 0 10px 28px rgba(167,139,250,.35);
}
.ai-welcome h3 { font-size: 1.5rem; font-weight: 800; color: var(--text-primary); margin: 0; }
.ai-welcome p { font-size: .88rem; color: var(--text-muted); margin: 0; max-width: 360px; }
.ai-welcome-tips { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center; margin-top: .3rem; }
.ai-tip {
  display: flex; align-items: center; gap: .4rem; padding: .4rem .75rem;
  border-radius: 10px; background: var(--glass-inset); border: 1px solid var(--glass-inset-border);
  font-size: .78rem; color: var(--text-muted);
}
.ai-tip i { color: var(--accent); }
/* Welcome suggestion cards (click to prefill the composer) */
.ai-suggest-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem;
  width: 100%; max-width: 580px; margin-top: .35rem;
}
.ai-suggest {
  display: flex; align-items: flex-start; gap: .55rem; text-align: left;
  padding: .65rem .75rem; border-radius: 13px; cursor: pointer;
  background: var(--glass-inset); border: 1px solid var(--glass-inset-border);
  transition: transform .12s ease, border-color .12s, background .12s;
}
.ai-suggest:hover { transform: translateY(-2px); border-color: var(--accent); background: var(--glass-solid); }
.ai-suggest > i { color: var(--accent); font-size: 1.05rem; margin-top: .1rem; flex-shrink: 0; }
.ai-suggest span { display: flex; flex-direction: column; gap: .12rem; min-width: 0; font-size: .76rem; color: var(--text-muted); line-height: 1.35; }
.ai-suggest b { font-size: .83rem; font-weight: 700; color: var(--text-primary); }
/* ── Message bubble ── */
.ai-msg { display: flex; gap: .55rem; max-width: 100%; animation: aiFadeIn .2s ease; }
@keyframes aiFadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.ai-msg.user { flex-direction: row-reverse; align-self: flex-end; max-width: 85%; }
.ai-msg.assistant { align-self: flex-start; max-width: 90%; }
.ai-msg-avatar {
  flex-shrink: 0; width: 30px; height: 30px; border-radius: 9px; display: grid;
  place-items: center; font-size: .85rem; font-weight: 700;
}
.ai-msg.user .ai-msg-avatar { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; }
.ai-msg.assistant .ai-msg-avatar.claude { background: rgba(167,139,250,.2); color: #a78bfa; border: 1px solid rgba(167,139,250,.3); }
.ai-msg.assistant .ai-msg-avatar.openai { background: rgba(16,163,127,.2); color: #10a37f; border: 1px solid rgba(16,163,127,.3); }
.ai-msg.assistant .ai-msg-avatar.gemini { background: rgba(26,115,232,.2); color: #60a5fa; border: 1px solid rgba(26,115,232,.3); }
.ai-msg.assistant .ai-msg-avatar.local { background: rgba(245,158,11,.2); color: #fbbf24; border: 1px solid rgba(245,158,11,.3); }
.ai-msg-body { display: flex; flex-direction: column; gap: .25rem; min-width: 0; }
.ai-bubble {
  padding: .65rem .9rem; border-radius: 16px; font-size: .88rem; line-height: 1.6;
  word-break: break-word; max-width: 100%;
}
.ai-msg.user .ai-bubble {
  background: linear-gradient(135deg, rgba(167,139,250,.22), rgba(56,189,248,.16));
  border: 1px solid rgba(167,139,250,.3); color: var(--text-primary);
  border-bottom-right-radius: 5px;
}
.ai-msg.assistant .ai-bubble {
  background: var(--glass-inset); border: 1px solid var(--glass-inset-border);
  color: var(--text-primary); border-bottom-left-radius: 5px;
}
.ai-bubble.streaming::after { content: '▋'; animation: aiCursor .7s step-end infinite; color: var(--accent); }
@keyframes aiCursor { 50% { opacity: 0; } }
.ai-msg-time { font-size: .67rem; color: var(--text-muted); padding: 0 .2rem; }
/* Markdown output in AI bubbles */
.ai-bubble h1, .ai-bubble h2, .ai-bubble h3 { font-weight: 700; margin: .6em 0 .25em; color: var(--text-primary); }
.ai-bubble h1 { font-size: 1.1em; }
.ai-bubble h2 { font-size: 1em; }
.ai-bubble h3 { font-size: .93em; }
.ai-bubble p { margin: .4em 0; }
.ai-bubble p:first-child { margin-top: 0; }
.ai-bubble p:last-child { margin-bottom: 0; }
.ai-bubble code { font-family: ui-monospace, monospace; font-size: .85em; background: rgba(167,139,250,.15); border-radius: 4px; padding: .1em .35em; color: var(--accent-2); }
.ai-bubble pre { background: rgba(0,0,0,.45); border: 1px solid var(--glass-border); border-radius: 10px; padding: .75rem 1rem; overflow-x: auto; position: relative; margin: .5em 0; }
.ai-bubble pre code { background: none; padding: 0; color: #e2e8f0; font-size: .8rem; }
.ai-pre-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: .35rem; }
.ai-pre-lang { font-size: .7rem; font-weight: 700; text-transform: uppercase; color: var(--text-muted); }
.ai-pre-copy { font-size: .7rem; padding: .15rem .5rem; border-radius: 5px; background: rgba(255,255,255,.08); border: 1px solid var(--glass-border); color: var(--text-muted); cursor: pointer; }
.ai-pre-copy:hover { color: var(--text-primary); background: var(--glass-solid); }
.ai-bubble ul, .ai-bubble ol { padding-left: 1.4em; margin: .4em 0; }
.ai-bubble li { margin: .2em 0; }
.ai-bubble blockquote { border-left: 3px solid var(--accent); padding-left: .8em; margin: .4em 0; color: var(--text-muted); font-style: italic; }
.ai-bubble strong { color: var(--text-primary); font-weight: 700; }
.ai-bubble hr { border: none; border-top: 1px solid var(--glass-border); margin: .6em 0; }
.ai-bubble table { border-collapse: collapse; width: 100%; margin: .4em 0; font-size: .82em; }
.ai-bubble th, .ai-bubble td { padding: .35rem .6rem; border: 1px solid var(--glass-border); text-align: left; }
.ai-bubble th { background: rgba(167,139,250,.12); font-weight: 700; }
/* ── Error bubble ── */
.ai-err-bubble {
  padding: .55rem .8rem; border-radius: 12px; background: rgba(239,68,68,.12);
  border: 1px solid rgba(239,68,68,.3); color: #fca5a5; font-size: .83rem;
  display: flex; align-items: flex-start; gap: .5rem;
}
.ai-err-bubble i { flex-shrink: 0; margin-top: .1rem; }
/* ── Input area ── */
.ai-input-area {
  flex-shrink: 0; border-top: 1px solid var(--glass-border);
  background: rgba(0,0,0,.18); padding: .6rem .9rem .75rem;
  display: flex; flex-direction: column; gap: .5rem;
}
.ai-sys-row { display: flex; flex-direction: column; gap: .3rem; }
.ai-sys-toggle {
  align-self: flex-start; display: flex; align-items: center; gap: .35rem;
  padding: .25rem .6rem; border-radius: 8px; background: none;
  border: 1px solid var(--glass-border); color: var(--text-muted); font-size: .75rem;
  cursor: pointer; transition: color .12s, background .12s;
}
.ai-sys-toggle:hover, .ai-sys-toggle.active { color: var(--accent); background: rgba(167,139,250,.1); border-color: rgba(167,139,250,.3); }
.ai-sys-ta {
  width: 100%; padding: .5rem .7rem; border-radius: 10px;
  background: var(--glass-inset); border: 1px solid var(--glass-inset-border);
  color: var(--text-primary); font-size: .8rem; resize: none;
}
/* Unified composer card — textarea + send button share one rounded container */
.ai-input-wrap {
  display: flex; align-items: flex-end; gap: .4rem;
  background: var(--glass-inset); border: 1px solid var(--glass-inset-border);
  border-radius: 16px; padding: .3rem .3rem .3rem .7rem;
  transition: border-color .15s, box-shadow .15s;
}
.ai-input-wrap:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(167,139,250,.14); }
.ai-input {
  flex: 1; min-height: 38px; max-height: 200px; padding: .5rem .1rem;
  border: none; background: transparent; color: var(--text-primary);
  font-size: .9rem; line-height: 1.5; resize: none; scrollbar-width: thin;
}
.ai-input:focus { outline: none; border: none; box-shadow: none; }
.ai-send-btn {
  flex-shrink: 0; width: 38px; height: 38px; border-radius: 11px; align-self: flex-end;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border: none; color: #fff; font-size: 1rem; cursor: pointer;
  display: grid; place-items: center;
  transition: opacity .15s, transform .12s;
  box-shadow: 0 4px 14px rgba(167,139,250,.35);
}
.ai-send-btn:hover { opacity: .9; transform: translateY(-1px); }
.ai-send-btn:disabled { opacity: .4; pointer-events: none; }
/* ── White-label brand chip + neutral avatar ── */
.ai-brand-chip {
  display: inline-flex; align-items: center; gap: .4rem; flex-shrink: 0;
  padding: .34rem .7rem; border-radius: 10px; font-size: .82rem; font-weight: 700;
  letter-spacing: .01em; color: var(--text-primary);
  background: linear-gradient(160deg, rgba(167,139,250,.18), rgba(56,189,248,.10));
  border: 1px solid var(--glass-border);
}
.ai-brand-chip i { color: var(--accent); }
.ai-msg-avatar.ai-brand {
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff;
}
/* ── Composer tool buttons (attach / mic) ── */
.ai-tool-btn {
  flex-shrink: 0; width: 34px; height: 34px; align-self: flex-end; margin-bottom: 1px;
  display: grid; place-items: center; border-radius: 10px;
  background: transparent; border: none; color: var(--text-muted);
  font-size: 1.05rem; cursor: pointer; transition: color .12s, background .12s;
}
.ai-tool-btn:hover { color: var(--accent); background: var(--glass-inset); }
.ai-mic-btn.listening { color: #fff; background: #ef4444; animation: aiMicPulse 1.1s ease-in-out infinite; }
@keyframes aiMicPulse { 0%,100% { box-shadow: 0 0 0 0 rgba(239,68,68,.5); } 50% { box-shadow: 0 0 0 6px rgba(239,68,68,0); } }
.ai-input-wrap.dragover { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(167,139,250,.2); }
/* ── Staged attachment chips (above the composer) ── */
.ai-attach-row { display: flex; flex-wrap: wrap; gap: .4rem; padding: 0 .2rem .1rem; }
.ai-attach-chip {
  display: inline-flex; align-items: center; gap: .4rem; max-width: 220px;
  padding: .3rem .4rem .3rem .5rem; border-radius: 10px;
  background: var(--glass-inset); border: 1px solid var(--glass-inset-border); font-size: .76rem;
}
.ai-attach-chip img { width: 26px; height: 26px; border-radius: 6px; object-fit: cover; flex-shrink: 0; }
.ai-attach-chip i { color: var(--accent); }
.ai-attach-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text-primary); }
.ai-attach-x { flex-shrink: 0; background: none; border: none; color: var(--text-muted); cursor: pointer; padding: .1rem .2rem; border-radius: 5px; font-size: .7rem; }
.ai-attach-x:hover { color: #f87171; background: rgba(239,68,68,.12); }
/* ── Attachments shown inside a sent message ── */
.ai-msg-atts { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .35rem; }
.ai-msg.user .ai-msg-atts { justify-content: flex-end; }
.ai-att-thumb { max-width: 180px; max-height: 180px; border-radius: 10px; border: 1px solid var(--glass-border); object-fit: cover; }
.ai-att-file {
  display: inline-flex; align-items: center; gap: .35rem; padding: .3rem .55rem;
  border-radius: 9px; background: var(--glass-inset); border: 1px solid var(--glass-inset-border);
  font-size: .76rem; color: var(--text-primary);
}
.ai-att-file i { color: var(--accent); }
/* ── API Keys panel (inline in sidebar bottom or modal) ── */
.ai-keys-panel {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: rgba(12,8,30,.97); border-top: 1px solid var(--glass-border);
  border-right: 1px solid var(--glass-border);
  backdrop-filter: var(--glass-blur); padding: .9rem;
  display: flex; flex-direction: column; gap: .6rem; z-index: 5;
  border-radius: 0 0 0 18px;
  max-height: 70%; overflow-y: auto;
}
.ai-keys-title { font-weight: 700; font-size: .88rem; color: var(--text-primary); display: flex; justify-content: space-between; align-items: center; }
.ai-key-row { display: flex; flex-direction: column; gap: .3rem; }
.ai-key-label { font-size: .73rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .03em; display: flex; align-items: center; gap: .35rem; }
.ai-key-label .ai-prov-dot { width: 7px; height: 7px; }
.ai-key-input-row { display: flex; gap: .35rem; }
.ai-key-input {
  flex: 1; padding: .4rem .65rem; border-radius: 9px;
  background: var(--glass-inset); border: 1px solid var(--glass-inset-border);
  color: var(--text-primary); font-size: .8rem; font-family: ui-monospace, monospace;
}
.ai-key-save { font-size: .75rem; padding: .4rem .7rem; border-radius: 8px; white-space: nowrap; }
.ai-keys-note { font-size: .73rem; color: var(--text-muted); padding-top: .3rem; border-top: 1px solid var(--glass-border); }
/* ── Actions bar below message ── */
.ai-msg-actions { display: flex; gap: .25rem; opacity: 0; transition: opacity .12s; }
.ai-msg:hover .ai-msg-actions { opacity: 1; }
.ai-msg-act {
  font-size: .7rem; padding: .18rem .45rem; border-radius: 6px;
  background: var(--glass-inset); border: 1px solid var(--glass-inset-border);
  color: var(--text-muted); cursor: pointer; transition: color .12s, background .12s;
}
.ai-msg-act:hover { color: var(--text-primary); background: var(--glass-solid); }
/* ── Thinking / streaming indicator ── */
.ai-thinking { display: flex; gap: .3rem; align-items: center; padding: .5rem; }
.ai-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); animation: aiDot 1.2s ease-in-out infinite; }
.ai-dot:nth-child(2) { animation-delay: .2s; }
.ai-dot:nth-child(3) { animation-delay: .4s; }
@keyframes aiDot { 0%,60%,100% { transform: scale(.8); opacity: .5; } 30% { transform: scale(1.2); opacity: 1; } }
/* ── Desktop: immersive height + readable, centered message/input column ── */
@media (min-width: 701px) {
  .ai-studio { height: min(80vh, 880px); min-height: 600px; }
  .ai-sidebar { flex: 0 0 272px; width: 272px; }
  /* Centre the conversation to a comfortable measure on wide screens while the
     scrollbar stays at the panel edge (padding-based centering, no wrapper). */
  .ai-messages { padding-inline: max(1.5rem, calc((100% - 860px) / 2)); }
  .ai-input-area > * { width: 100%; max-width: 860px; margin-inline: auto; }
  .ai-msg.assistant { max-width: 100%; }
  .ai-msg.user { max-width: 78%; }
  .ai-bubble { font-size: .9rem; }
}
/* ── Mobile ── */
@media (max-width: 700px) {
  .ai-sidebar { position: absolute; top: 0; bottom: 0; left: 0; z-index: 10; width: 78vw !important; }
  .ai-sidebar.collapsed { width: 0 !important; }
  .ai-studio { position: relative; }
  .ai-prov-pill span.ai-prov-dot + * { display: none; }
  .ai-model-sel { max-width: 120px; }
  .ai-suggest-grid { grid-template-columns: 1fr; max-width: 100%; }
}

/* ════════════════ Labs & Services (studio-labs / studio-services) — lsx- ════════════════ */
.lsx-app { padding: .75rem 1.6rem 1.4rem; }   /* left/right breathing room */
/* Wider container for the Labs/Services grids on desktop (only these apps). */
.studio-tool-wrap-full:has(.lsx-app) { max-width: 1700px; }
@media (max-width: 760px) { .lsx-app { padding: .5rem .85rem 1rem; } }
.lsx-grid-wrap { padding: .25rem 0 1rem; }
.lsx-grid-lead { margin: 0 0 1.1rem; }
.lsx-grid-lead h3 { margin: 0 0 .25rem; font-size: 1.25rem; display: flex; align-items: center; gap: .5rem; }
.lsx-grid-lead p { margin: 0; max-width: 840px; font-size: .86rem; }
.lsx-sec { margin: 1.3rem 0 .7rem; font-size: .76rem; letter-spacing: .07em; text-transform: uppercase; opacity: .6; font-weight: 700; }
.lsx-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 1.1rem; }
/* Glass/blur card — NO coloured background; only the icon tile is coloured. */
.lsx-card { padding: 1.1rem 1.15rem 1rem; display: flex; flex-direction: column; gap: .85rem; border-radius: 16px; transition: transform .12s ease, box-shadow .12s ease; }
.lsx-card:hover { transform: translateY(-2px); box-shadow: 0 12px 34px rgba(0, 0, 0, .4); }
.lsx-card-top { display: flex; align-items: center; gap: .85rem; }
.lsx-card-ic { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; padding: 11px; flex: 0 0 auto; box-shadow: 0 4px 14px rgba(0, 0, 0, .28); }
.lsx-card-ic .lsx-logo, .lsx-dash-ic .lsx-logo { width: 100%; height: 100%; object-fit: contain; display: block; filter: brightness(0) invert(1); }
.lsx-card-h { min-width: 0; flex: 1 1 auto; }
.lsx-card-h h4 { margin: 0 0 .3rem; font-size: 1.05rem; display: flex; align-items: center; gap: .4rem; }
.lsx-info { opacity: .6; font-size: .82rem; cursor: help; }
.lsx-host { display: inline-flex; align-items: center; gap: .35rem; max-width: 100%; font-size: .77rem; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; padding: .22rem .55rem; border-radius: 8px; background: rgba(255, 255, 255, .06); border: 1px solid var(--glass-border, rgba(255,255,255,.1)); color: var(--text-secondary, #b9c2d0); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lsx-host i { opacity: .7; }
.lsx-card-badges { display: flex; gap: .4rem; flex-wrap: wrap; }
.lsx-badge { font-size: .64rem; font-weight: 700; letter-spacing: .05em; padding: .22rem .55rem; border-radius: 999px; text-transform: uppercase; border: 1px solid transparent; line-height: 1; }
.lsx-badge.free { background: rgba(34,197,94,.14); color: #4ade80; border-color: rgba(34,197,94,.4); }
.lsx-badge.premium { background: rgba(234,179,8,.14); color: #facc15; border-color: rgba(234,179,8,.4); }
.lsx-badge.beta { background: rgba(59,130,246,.14); color: #60a5fa; border-color: rgba(59,130,246,.4); }
.lsx-badge.public { background: rgba(234,179,8,.1); color: #fcd34d; border-color: rgba(234,179,8,.32); }
.lsx-badge.running { background: rgba(34,197,94,.16); color: #4ade80; border-color: rgba(34,197,94,.45); }
.lsx-badge.running::before { content: "●\00a0"; }
.lsx-badge.down { background: rgba(239,68,68,.14); color: #f87171; border-color: rgba(239,68,68,.4); }
.lsx-badge.down::before { content: "●\00a0"; }
.lsx-card-actions { display: flex; gap: .6rem; margin-top: auto; }
/* Frosted-glass buttons (no solid colour) — Code is the brighter primary, Dashboard subtler. */
.lsx-btn { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: .45rem; padding: .68rem .8rem; border-radius: 11px; font-weight: 600; font-size: .9rem; cursor: pointer; color: var(--text-primary, #e6edf3); background: rgba(255, 255, 255, .07); border: 1px solid var(--glass-border, rgba(255, 255, 255, .14)); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); transition: background .14s ease, border-color .14s ease, transform .1s ease; }
.lsx-btn:hover { background: rgba(255, 255, 255, .14); }
.lsx-btn:active { transform: translateY(1px); }
.lsx-code { background: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .22); }
.lsx-code:hover { background: rgba(255, 255, 255, .2); }
.lsx-code i, .lsx-dash i { opacity: .9; }
.lsx-loading { padding: 2.5rem; text-align: center; opacity: .7; }
/* dashboard */
.lsx-dash-top { display: flex; align-items: center; gap: .9rem; padding: 1rem 1.2rem; flex-wrap: wrap; }
.lsx-back { flex: 0 0 auto; }
.lsx-dash-ic { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; padding: 11px; flex: 0 0 auto; box-shadow: 0 4px 14px rgba(0,0,0,.28); }
.lsx-dash-h { flex: 1 1 240px; min-width: 0; }
.lsx-dash-h h3 { margin: 0; font-size: 1.2rem; }
.lsx-dash-h p { margin: .15rem 0 .4rem; font-size: .82rem; }
.lsx-dash-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.lsx-dash-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem; margin-top: 1.1rem; }
.lsx-dash-col { display: flex; flex-direction: column; gap: 1.1rem; min-width: 0; }
.lsx-panel { padding: 1.1rem 1.2rem; }
.lsx-panel-h { margin: 0 0 .85rem; font-size: .95rem; display: flex; align-items: center; gap: .45rem; }
.lsx-mask { font-family: ui-monospace, monospace; letter-spacing: .1em; opacity: .8; }
.lsx-root-row { display: flex; align-items: center; gap: .6rem; margin-top: .9rem; font-size: .85rem; }
.lsx-switch { position: relative; display: inline-block; width: 38px; height: 22px; flex: 0 0 auto; }
.lsx-switch input { opacity: 0; width: 0; height: 0; }
.lsx-switch span { position: absolute; inset: 0; background: rgba(255, 255, 255, .18); border-radius: 999px; transition: .2s; cursor: pointer; }
.lsx-switch span::before { content: ""; position: absolute; height: 16px; width: 16px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; }
.lsx-switch input:checked + span { background: #16a34a; }
.lsx-switch input:checked + span::before { transform: translateX(16px); }
.lsx-switch input:disabled + span { opacity: .45; cursor: not-allowed; }
.lsx-net-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem; }
@media (max-width: 760px) { .lsx-dash-grid, .lsx-net-grid { grid-template-columns: 1fr; } }
/* WireGuard & SSH page */
.stnet-peers { display: flex; flex-direction: column; gap: .4rem; margin: .2rem 0 .4rem; }
.stnet-peer { display: flex; align-items: center; justify-content: space-between; gap: .6rem; padding: .5rem .7rem; border-radius: 9px; background: rgba(255, 255, 255, .05); font-size: .84rem; }
.stnet-peer code { font-size: .78rem; opacity: .8; }
/* Service databases panel */
.lsx-dblist { display: flex; flex-wrap: wrap; gap: .4rem; margin: .2rem 0 .8rem; min-height: 1.4rem; }
.lsx-dbchip { display: inline-flex; align-items: center; gap: .35rem; padding: .25rem .6rem; border-radius: 8px; background: rgba(255, 255, 255, .06); border: 1px solid var(--glass-border, rgba(255, 255, 255, .12)); font-size: .8rem; font-family: ui-monospace, monospace; }
.lsx-dbchip i { opacity: .6; }
.lsx-dbnew { display: flex; gap: .5rem; flex-wrap: wrap; }
.lsx-dbnew .tool-input { flex: 1; min-width: 180px; font-family: ui-monospace, monospace; }
.lsx-dbnew .util-mini-btn { flex: 0 0 auto; }
