/* higherMark macOS App — Apple HIG + Liquid Glass Design System */
:root {
  --bg: #f8f7f4;
  --bg2: #f0efe9;
  --panel: #ffffff;
  --panel2: #f5f4f0;
  --border: rgba(0,0,0,.09);
  --border2: rgba(0,0,0,.05);
  --text: #0b0b0c;
  --text2: #4a4a4a;
  --muted: #686862;
  --faint: #94948c;
  --glass: rgba(255,255,255,.66);
  --glass-strong: rgba(255,255,255,.82);
  --glass-highlight: rgba(255,255,255,.9);
  --ambient:
    radial-gradient(1100px 620px at 85% -10%, rgba(245,216,0,.14), transparent 60%),
    radial-gradient(950px 700px at -12% 108%, rgba(0,201,230,.12), transparent 60%),
    radial-gradient(700px 500px at 110% 75%, rgba(0,196,122,.07), transparent 60%);
  --cyan: #00C9E6;
  --cyan-dim: rgba(0,201,230,.12);
  --cyan-border: rgba(0,201,230,.35);
  --yellow: #F5D800;
  --yellow-dim: rgba(245,216,0,.12);
  --yellow-border: rgba(245,216,0,.40);
  --good: #00C47A;
  --bad: #E53935;
  --warn-border: rgba(255,145,0,.3);
  --shadow: 0 2px 16px rgba(0,0,0,.08), 0 1px 3px rgba(0,0,0,.05);
  --shadow-lg: 0 8px 40px rgba(0,0,0,.12), 0 2px 8px rgba(0,0,0,.06);
  --radius: 14px;
  --radius-sm: 9px;
  --radius-lg: 20px;
  --mono: ui-monospace, "SF Mono", "Menlo", monospace;
  --display: -apple-system, "SF Pro Display", system-ui, sans-serif;
  --ease: cubic-bezier(.4,0,.2,1);
  --sheen: linear-gradient(160deg, rgba(255,255,255,.7) 0%, rgba(255,255,255,.0) 50%);
  --sidebar-w: 268px;
  --sidebar-collapsed: 52px;
}

[data-theme="dark"] {
  --bg: #030304;
  --bg2: #0a0a0d;
  --panel: #14141a;
  --panel2: #0e0e13;
  --border: rgba(255,255,255,.08);
  --border2: rgba(255,255,255,.04);
  --text: #f0f0ec;
  --text2: #b8b8b4;
  --muted: #9c9c96;
  --faint: #66665f;
  --glass: rgba(22,22,30,.58);
  --glass-strong: rgba(22,22,30,.82);
  --glass-highlight: rgba(255,255,255,.10);
  --ambient:
    radial-gradient(1100px 620px at 85% -10%, rgba(255,230,0,.08), transparent 60%),
    radial-gradient(950px 700px at -12% 108%, rgba(0,229,255,.07), transparent 60%),
    radial-gradient(700px 500px at 110% 75%, rgba(0,196,122,.05), transparent 60%);
  --cyan: #00E5FF;
  --cyan-dim: rgba(0,229,255,.10);
  --cyan-border: rgba(0,229,255,.30);
  --yellow: #FFE600;
  --yellow-dim: rgba(255,230,0,.10);
  --yellow-border: rgba(255,230,0,.35);
  --shadow: 0 2px 20px rgba(0,0,0,.5);
  --shadow-lg: 0 12px 50px rgba(0,0,0,.7);
  --sheen: linear-gradient(160deg, rgba(255,255,255,.06) 0%, rgba(255,255,255,.0) 50%);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; overflow: hidden; }
body {
  background-color: var(--bg);
  background-image: var(--ambient);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--display);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  user-select: none;
  -webkit-user-select: none;
}
a { color: inherit; text-decoration: none; }
/* Always allow typing in form controls regardless of body user-select */
input, textarea, select {
  outline: none;
  user-select: text !important;
  -webkit-user-select: text !important;
}
button { cursor: pointer; border: none; background: none; font: inherit; pointer-events: auto; }
/* WKWebView / Tauri: drag regions eat clicks. Force every control to stay clickable. */
button, a, input, textarea, select, .btn, .snav-btn, .switch, .model-pill,
.titlebar-logo, .credits-chip, .sats-chip, .titlebar-ln, .titlebar-version, .ver-i, .theme-swatch, .new-chat-btn, .sidebar-action-btn,
.send-btn, .action-btn, .popout-btn, .sidebar-logo-wrap, .sidebar-caret,
.history-chat-item, .topup-option, .paywall-option, .mono-addr, .identity-box,
.theme-toggles, .update-pill, .color-slider-wrap, .titlebar-brand, .titlebar-right,
.hmw, .hmw-overlay.open, [onclick] {
  pointer-events: auto;
  -webkit-app-region: no-drag;
  app-region: no-drag;
}
::selection { background: var(--yellow); color: #000; }

/* ── Root layout ───────────────────────────────────────────────────────────── */
#app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}
.app-body {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  padding: 0 12px 12px;
  gap: 10px;
}

/* ── Chat Sidebar ─────────────────────────────────────────────────────────── */
.chat-sidebar {
  width: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  background: var(--glass-strong);
  -webkit-backdrop-filter: blur(32px) saturate(1.8);
  backdrop-filter: blur(32px) saturate(1.8);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  flex-shrink: 0;
  overflow: hidden;
  transition: width .3s var(--ease);
  position: relative;
  z-index: 10;
  box-shadow: var(--shadow), inset 0 1px 0 var(--glass-highlight);
}
.chat-sidebar {
  transition: width .32s cubic-bezier(.4,0,.2,1);
}
.chat-sidebar.collapsed { width: var(--sidebar-collapsed); }
.chat-sidebar.collapsed .sidebar-brand-text,
.chat-sidebar.collapsed .new-chat-btn span,
.chat-sidebar.collapsed .sidebar-actions-row,
.chat-sidebar.collapsed .history-section,
.chat-sidebar.collapsed .history-divider,
.chat-sidebar.collapsed .snav-btn span { display: none; }
.chat-sidebar.collapsed .sidebar-top { justify-content: center; padding: 14px 0; }
.chat-sidebar.collapsed .snav-btn { justify-content: center; padding: 10px; }
.chat-sidebar.collapsed .new-chat-btn { padding: 8px; justify-content: center; margin: 0 8px; }

.sidebar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 14px 12px;
  border-bottom: 1px solid var(--border2);
  flex-shrink: 0;
}
.sidebar-logo-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: opacity .18s;
}
.sidebar-logo-wrap:hover { opacity: .8; }
.sidebar-hm-logo { color: var(--text); flex-shrink: 0; transition: transform .32s cubic-bezier(.4,0,.2,1); }
.sidebar-brand-text {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--text);
  white-space: nowrap;
  transition: opacity .25s, max-width .32s cubic-bezier(.4,0,.2,1);
  max-width: 160px;
  overflow: hidden;
}

/* Sidebar collapse caret — appears as sidebar closes */
.sidebar-caret {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity .28s var(--ease), transform .28s var(--ease);
  pointer-events: none;
}
.sidebar-caret svg {
  width: 10px; height: 10px;
  stroke: var(--cyan);
  fill: none;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 4px var(--cyan));
  animation: caretGlow 2.4s ease infinite;
}
@keyframes caretGlow {
  0%,100% { filter: drop-shadow(0 0 3px var(--cyan)); opacity: 1; }
  50%      { filter: drop-shadow(0 0 8px var(--cyan)); opacity: .7; }
}
.chat-sidebar.collapsed .sidebar-caret {
  opacity: 1;
  transform: translateX(0);
  pointer-events: all;
  cursor: pointer;
}
.chat-sidebar.collapsed .sidebar-caret svg { transform: rotate(180deg); }

/* Collapsed state hides text and expands caret area */
.chat-sidebar.collapsed .sidebar-brand-text { max-width: 0; opacity: 0; }
.chat-sidebar.collapsed .sidebar-logo-wrap { gap: 0; }
.chat-sidebar.collapsed .sidebar-hm-logo { transform: scale(.9); }

/* Hamburger button hidden — now use logo as toggle */
.hamburger-btn { display: none; }

.sidebar-new-chat { padding: 10px 10px 6px; flex-shrink: 0; }
.new-chat-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: var(--yellow-dim);
  border: 1px solid var(--yellow-border);
  color: color-mix(in srgb, var(--yellow) 80%, #000);
  font-size: 12.5px;
  font-weight: 600;
  transition: background .18s, border-color .18s;
}
.new-chat-btn:hover { background: var(--yellow); color: #0a0a00; }
.new-chat-btn svg { color: currentColor; stroke: currentColor; flex-shrink: 0; }

.sidebar-actions-row {
  display: flex;
  gap: 6px;
  padding: 4px 10px 8px;
  flex-shrink: 0;
}
.sidebar-action-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 5px 8px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .06em;
  transition: border-color .18s, color .18s, background .18s;
}
.sidebar-action-btn:hover { border-color: var(--cyan-border); color: var(--cyan); background: var(--cyan-dim); }

.history-section { flex: 1; display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.history-section-label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--faint);
  padding: 8px 14px 4px;
  flex-shrink: 0;
}
.history-section-label svg { stroke: var(--faint); }
.history-list { flex: 1; overflow-y: auto; padding: 2px 8px 8px; }
.history-list::-webkit-scrollbar { width: 3px; }
.history-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }
.history-empty {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--faint);
  padding: 12px 6px;
  line-height: 1.5;
}
.history-chat-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background .15s;
  margin-bottom: 2px;
}
.history-chat-item:hover { background: var(--panel2); }
.history-chat-item.active { background: var(--cyan-dim); }
.history-model-badge {
  width: 20px; height: 20px;
  border-radius: 5px;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px;
  flex-shrink: 0;
  background: var(--panel2);
  border: 1px solid var(--border);
}
.history-chat-title {
  flex: 1;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.history-chat-time { font-family: var(--mono); font-size: 9px; color: var(--faint); flex-shrink: 0; }

.history-divider {
  height: 1px;
  background: var(--border2);
  margin: 2px 12px;
  flex-shrink: 0;
}

.sidebar-nav-bottom {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 8px 20px;
  border-top: 1px solid var(--border2);
  flex-shrink: 0;
}
.snav-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 8px;
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .04em;
  transition: background .15s, color .15s;
}
.snav-btn:hover { background: var(--panel2); color: var(--text); }
.snav-btn.active { background: var(--yellow-dim); color: var(--yellow); border: 1px solid var(--yellow-border); }
.snav-btn svg { stroke: currentColor; flex-shrink: 0; }

/* ── Main content wrapper ──────────────────────────────────────────────────── */
.main-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--glass);
  -webkit-backdrop-filter: blur(28px) saturate(1.7);
  backdrop-filter: blur(28px) saturate(1.7);
  box-shadow: var(--shadow), inset 0 1px 0 var(--glass-highlight);
}

/* ── Title bar ─────────────────────────────────────────────────────────────── */
.titlebar {
  min-height: 76px;
  height: auto;
  display: flex;
  align-items: center;
  padding: 10px 20px 10px 12px;
  border-bottom: none;
  flex-shrink: 0;
  position: relative;
  background: transparent;
  gap: 12px;
  overflow: visible;
}
.titlebar-drag {
  position: absolute;
  top: 0;
  left: 86px;
  right: 220px;
  height: 54px;
  z-index: 0;
}
.traffic-spacer {
  width: 86px;
  height: 100%;
  flex-shrink: 0;
  position: relative;
  z-index: 2;
}
.titlebar-center {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  justify-content: center;
  position: relative;
  z-index: 2;
}
.titlebar-logo {
  display: flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  color: var(--text);
  position: relative;
  z-index: 3;
  padding: 4px 8px 4px 4px;
  border-radius: 12px;
  background: var(--glass);
  border: 1px solid var(--border);
  box-shadow: inset 0 1px 0 var(--glass-highlight), 0 2px 10px rgba(0,0,0,.18);
}
.titlebar-logo:hover { border-color: var(--yellow-border); }
.titlebar-title {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .06em;
  color: var(--muted);
  text-transform: uppercase;
}
.titlebar-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  position: relative;
  z-index: 5;
  padding-right: 8px;
  margin-left: auto;
}
.titlebar-drag { display: none !important; }
html.tauri .titlebar-center {
  display: block;
  min-height: 44px;
  -webkit-app-region: drag;
  app-region: drag;
  pointer-events: auto;
  z-index: 1;
}
html.tauri .titlebar-brand,
html.tauri .titlebar-right,
html.tauri .titlebar-logo,
html.tauri .titlebar-version,
html.tauri .titlebar-ln,
html.tauri .theme-toggles,
html.tauri .theme-swatch,
html.tauri button,
html.tauri a,
html.tauri input,
html.tauri textarea,
html.tauri select {
  -webkit-app-region: no-drag !important;
  app-region: no-drag !important;
  pointer-events: auto !important;
}

.alpha-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 20px;
  border: 1px solid var(--cyan-border);
  background: var(--cyan-dim);
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--cyan);
}
.alpha-pill .dot { width: 5px; height: 5px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 6px var(--cyan); animation: pulse 2s ease infinite; }
@keyframes pulse { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:.4;transform:scale(.6)} }

.credits-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  border: 1px solid var(--yellow-border);
  background: var(--yellow-dim);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .06em;
  color: color-mix(in srgb, var(--yellow) 80%, #000);
  cursor: pointer;
  transition: background .18s;
}
.credits-chip:hover { background: var(--yellow); color: #0a0a00; }

.theme-btn {
  width: 30px; height: 30px;
  border-radius: 9px;
  background: var(--panel2);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  transition: border-color .18s;
}
.theme-btn:hover { border-color: var(--yellow-border); }
.theme-btn svg { width: 14px; height: 14px; stroke: var(--muted); fill: none; stroke-width: 1.7; }

.update-pill {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--mono); font-size: 9.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  padding: 3px 9px; border-radius: 99px; cursor: pointer;
  background: color-mix(in srgb, var(--good) 14%, transparent);
  color: var(--good);
  border: 1px solid color-mix(in srgb, var(--good) 30%, transparent);
  animation: updatePulse 3s ease infinite;
}
@keyframes updatePulse { 0%,100%{ opacity:1 } 50%{ opacity:.7 } }

/* ── Tabs ──────────────────────────────────────────────────────────────────── */
.tabs-wrap {
  flex: 1;
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
}
.tab-content {
  flex: 1;
  display: none;
  flex-direction: column;
  overflow: hidden;
}
.tab-content.active { display: flex; }
.main-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 22px 24px 100px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.main-scroll::-webkit-scrollbar { width: 5px; }
.main-scroll::-webkit-scrollbar-track { background: transparent; }
.main-scroll::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }

/* ── AI Tab layout ─────────────────────────────────────────────────────────── */
.ai-layout {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 16px 20px 60px;
  overflow-y: auto;
}
.ai-layout::-webkit-scrollbar { width: 5px; }
.ai-layout::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }

/* ── Cerebras Hero Card ───────────────────────────────────────────────────── */
.cerebras-hero-card {
  flex-shrink: 0;
  height: 72vh;
  min-height: 440px;
  max-height: 680px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(24px) saturate(1.7);
  backdrop-filter: blur(24px) saturate(1.7);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: var(--shadow), inset 0 1px 0 var(--glass-highlight);
  position: relative;
  overflow: hidden;
}
.cerebras-hero-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--sheen);
  pointer-events: none;
  border-radius: inherit;
}
.hero-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-shrink: 0;
}
.hero-left { display: flex; flex-direction: column; gap: 3px; }
.hero-title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}
.hero-sub { font-family: var(--mono); font-size: 10.5px; color: var(--muted); }
.hero-right { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.model-row { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.model-pill {
  padding: 4px 10px;
  border-radius: 99px;
  border: 1px solid var(--border);
  background: var(--panel2);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: border-color .18s, background .18s, color .18s;
  white-space: nowrap;
}
.model-pill:hover { border-color: var(--cyan-border); color: var(--cyan); background: var(--cyan-dim); }
.model-pill.selected { border-color: var(--yellow-border); background: var(--yellow-dim); color: color-mix(in srgb, var(--yellow) 80%, #000); }

/* ── Chat area ─────────────────────────────────────────────────────────────── */
.chat-area {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  background: var(--bg2);
  border-radius: var(--radius);
  min-height: 0;
}
.chat-area::-webkit-scrollbar { width: 4px; }
.chat-area::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }
.chat-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 20px; }
.chat-empty-icon { opacity: .5; color: var(--muted); }
.chat-empty-title { font-size: 16px; font-weight: 700; color: var(--text2); }
.chat-empty-sub { font-family: var(--mono); font-size: 11px; color: var(--muted); text-align: center; max-width: 300px; line-height: 1.65; }
.chat-bubble {
  max-width: 84%;
  padding: 11px 15px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.6;
  word-break: break-word;
}
.chat-user { background: var(--cyan); color: #001218; align-self: flex-end; font-weight: 600; border-radius: 16px 16px 4px 16px; }
.chat-assistant { background: var(--panel); border: 1px solid var(--border); color: var(--text2); align-self: flex-start; border-radius: 16px 16px 16px 4px; }
.chat-cursor::after { content: "▋"; animation: blink .6s step-start infinite; }
@keyframes blink { 50% { opacity: 0; } }

.chat-input-wrap { flex: 1; min-width: 0; }
.chat-input-row {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  padding: 10px 12px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  flex-shrink: 0;
}
.chat-input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 14px;
  resize: none;
  max-height: 100px;
  font-family: var(--display);
  line-height: 1.5;
}
.chat-input::placeholder { color: var(--faint); }
.send-btn {
  width: 36px; height: 36px;
  border-radius: 9px;
  background: var(--cyan);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: opacity .18s, transform .15s;
}
.send-btn:disabled { opacity: .35; cursor: not-allowed; }
.send-btn:not(:disabled):hover { opacity: .88; transform: translateY(-1px); }

/* ── PCC info card ─────────────────────────────────────────────────────────── */
.pcc-info-card {
  background: var(--glass);
  -webkit-backdrop-filter: blur(20px) saturate(1.5);
  backdrop-filter: blur(20px) saturate(1.5);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow);
  flex-shrink: 0;
}
.pcc-toggle-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border2);
}
.pcc-left { flex: 1; }
.pcc-title-row { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; flex-wrap: wrap; }
.pcc-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}
.pcc-desc { font-family: var(--mono); font-size: 10.5px; color: var(--muted); line-height: 1.5; }
.pcc-toggle-side { flex-shrink: 0; padding-top: 2px; }
.pcc-info-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.pcc-info-item { }
.pcc-info-label { font-family: var(--mono); font-size: 9px; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); margin-bottom: 4px; }
.pcc-info-text { font-family: var(--mono); font-size: 10.5px; color: var(--muted); line-height: 1.6; }

/* ── Speed comparison card ────────────────────────────────────────────────── */
.speed-card {
  background: var(--glass);
  -webkit-backdrop-filter: blur(20px) saturate(1.5);
  backdrop-filter: blur(20px) saturate(1.5);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow);
  flex-shrink: 0;
}
.speed-card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 16px; }
.speed-table { display: flex; flex-direction: column; gap: 8px; }
.speed-row { display: flex; align-items: center; gap: 10px; }
.speed-name { font-family: var(--mono); font-size: 10px; color: var(--muted); width: 180px; flex-shrink: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.speed-bar-wrap { flex: 1; height: 5px; background: var(--border); border-radius: 3px; overflow: hidden; }
.speed-bar { height: 100%; border-radius: 3px; transition: width .6s var(--ease); }
.speed-val { font-family: var(--mono); font-size: 10px; color: var(--muted); width: 80px; text-align: right; flex-shrink: 0; }

/* ── LLM Council ──────────────────────────────────────────────────────────── */
.council-section {
  background: var(--glass);
  -webkit-backdrop-filter: blur(20px) saturate(1.5);
  backdrop-filter: blur(20px) saturate(1.5);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow);
  flex-shrink: 0;
}
.council-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 14px; }
.council-input-row { display: flex; gap: 10px; align-items: flex-end; margin-bottom: 14px; }
.council-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; min-height: 320px; }
@media (max-width: 700px) { .council-grid { grid-template-columns: 1fr; } }
.council-panel {
  display: flex;
  flex-direction: column;
  background: var(--panel2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color .18s;
}
.council-panel.active-model { border-color: var(--cyan-border); }
.council-panel.disabled-model { opacity: .5; }
.council-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.council-model-info { display: flex; align-items: center; gap: 7px; }
.council-model-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.council-model-name { font-size: 13px; font-weight: 700; color: var(--text); }
.council-via { font-family: var(--mono); font-size: 9.5px; color: var(--faint); }
.council-toggle { position: relative; width: 32px; height: 18px; cursor: pointer; }
.council-toggle input { opacity: 0; width: 0; height: 0; }
.council-toggle-knob {
  position: absolute; inset: 0;
  background: var(--border);
  border-radius: 99px;
  transition: background .2s;
}
.council-toggle-knob::before {
  content: "";
  position: absolute;
  top: 2px; left: 2px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--muted);
  transition: transform .2s, background .2s;
  box-shadow: 0 1px 3px rgba(0,0,0,.25);
}
.council-toggle input:checked + .council-toggle-knob { background: var(--cyan); }
.council-toggle input:checked + .council-toggle-knob::before { transform: translateX(14px); background: #fff; }
.council-chat-area {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--text2);
  line-height: 1.6;
}
.council-chat-area::-webkit-scrollbar { width: 3px; }
.council-chat-area::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }
.council-empty { color: var(--faint); font-family: var(--mono); font-size: 11px; padding: 12px; text-align: center; }
.council-user-msg { align-self: flex-end; background: var(--cyan-dim); border: 1px solid var(--cyan-border); border-radius: 10px 10px 2px 10px; padding: 7px 10px; max-width: 90%; font-size: 11px; }
.council-ai-msg { align-self: flex-start; background: var(--panel); border: 1px solid var(--border); border-radius: 10px 10px 10px 2px; padding: 7px 10px; max-width: 90%; font-size: 11px; white-space: pre-wrap; }
.council-thinking { color: var(--faint); font-style: italic; padding: 8px; }

/* ── Liquid Glass card ─────────────────────────────────────────────────────── */
.card {
  background: var(--glass);
  -webkit-backdrop-filter: blur(24px) saturate(1.7);
  backdrop-filter: blur(24px) saturate(1.7);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  position: relative;
  overflow: visible;
  box-shadow: var(--shadow), inset 0 1px 0 var(--glass-highlight);
}
.card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--sheen);
  pointer-events: none;
  border-radius: inherit;
  overflow: hidden;
}
.card-sm { border-radius: var(--radius); padding: 20px 24px; }
.card-accent-cyan { border-color: var(--cyan-border); background: linear-gradient(160deg, color-mix(in srgb, var(--cyan) 6%, var(--panel)), var(--panel)); }
.card-accent-yellow { border-color: var(--yellow-border); background: linear-gradient(160deg, color-mix(in srgb, var(--yellow) 6%, var(--panel)), var(--panel)); }

/* ── Section labels ─────────────────────────────────────────────────────────── */
.section-label { font-family: var(--mono); font-size: 10.5px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); margin-bottom: 16px; }

/* ── Balance display ────────────────────────────────────────────────────────── */
.balance-hero { font-family: var(--mono); font-size: 42px; font-weight: 700; letter-spacing: -.02em; line-height: 1; color: var(--yellow); }
.balance-unit { font-family: var(--mono); font-size: 16px; color: var(--muted); margin-left: 6px; }
.balance-sub { font-family: var(--mono); font-size: 12px; color: var(--muted); margin-top: 6px; }

/* ── Buttons ────────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 10px 20px; border-radius: var(--radius);
  font-size: 13px; font-weight: 600;
  transition: opacity .18s var(--ease), transform .18s var(--ease);
  position: relative; overflow: hidden;
}
.btn::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(255,255,255,.18), transparent 50%); pointer-events: none; }
.btn:hover { opacity: .88; transform: translateY(-1px); }
.btn:active { transform: translateY(0); opacity: .78; }
.btn-yellow { background: var(--yellow); color: #0a0a00; }
.btn-cyan { background: var(--cyan); color: #00080a; }
.btn-ghost { background: transparent; border: 1px solid var(--border); color: var(--text2); }
.btn-ghost:hover { border-color: var(--cyan-border); color: var(--cyan); }
.btn-ghost::after { display: none; }
.btn-danger { background: var(--bad); color: #fff; }
.btn-sm { padding: 7px 14px; font-size: 12px; border-radius: var(--radius-sm); }
.btn-full { width: 100%; }
.btn svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; flex-shrink: 0; }

/* ── Chips ──────────────────────────────────────────────────────────────────── */
.chip {
  display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px;
  border-radius: 99px; font-family: var(--mono); font-size: 10px; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase;
}
.chip-cyan { background: var(--cyan-dim); color: var(--cyan); border: 1px solid var(--cyan-border); }
.chip-yellow { background: var(--yellow-dim); color: color-mix(in srgb, var(--yellow) 80%, #000); border: 1px solid var(--yellow-border); }
.chip-green { background: rgba(0,196,122,.12); color: var(--good); border: 1px solid rgba(0,196,122,.3); }
.chip-muted { background: var(--panel2); color: var(--muted); border: 1px solid var(--border); }
.chip .live-dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; animation: pulse 2s ease infinite; }

/* ── Input ──────────────────────────────────────────────────────────────────── */
.input-group { display: flex; flex-direction: column; gap: 6px; }
.input-label { font-family: var(--mono); font-size: 10.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.input {
  background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 10px 14px; font-size: 13px; color: var(--text); font-family: var(--mono);
  width: 100%; transition: border-color .18s;
}
.input:focus { border-color: var(--cyan-border); }
.input::placeholder { color: var(--faint); }
.input-row { display: flex; gap: 10px; align-items: flex-end; }

/* ── Toggle ─────────────────────────────────────────────────────────────────── */
.toggle-row { display: flex; align-items: center; justify-content: space-between; padding: 16px 0; border-bottom: 1px solid var(--border2); gap: 16px; }
.toggle-row:last-child { border-bottom: none; }
.toggle-info { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 0; }
.toggle-title { font-size: 14px; font-weight: 600; color: var(--text); }
.toggle-desc { font-family: var(--mono); font-size: 11.5px; color: var(--muted); line-height: 1.6; white-space: normal; }
.switch { width: 44px; height: 25px; border-radius: 13px; background: var(--panel2); border: 1px solid var(--border); position: relative; cursor: pointer; transition: background .25s, border-color .25s; flex-shrink: 0; pointer-events: auto !important; }
.switch.on { background: var(--cyan); border-color: var(--cyan); }
.switch.yellow.on { background: var(--yellow); border-color: var(--yellow); }
.switch::after, .switch .knob {
  content: "";
  position: absolute; top: 3px; left: 3px; width: 17px; height: 17px;
  border-radius: 50%; background: var(--muted);
  transition: transform .25s var(--ease), background .25s;
  box-shadow: 0 1px 4px rgba(0,0,0,.25);
}
.switch.on::after, .switch.on .knob { transform: translateX(19px); background: #fff; }
.switch-lg { width: 68px; height: 38px; border-radius: 20px; }
.switch-lg::after { width: 30px; height: 30px; top: 3px; left: 3px; }
.switch-lg.on::after { transform: translateX(30px); }

.advanced-hero { padding: 22px 24px 20px !important; }
.advanced-hero-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.advanced-hero-title { font-size: 26px; font-weight: 800; letter-spacing: -.03em; }
.advanced-hero-ver { font-family: var(--mono); font-size: 12px; color: var(--yellow); font-weight: 700; margin-top: 4px; letter-spacing: .04em; }

/* ── Row list ───────────────────────────────────────────────────────────────── */
.row-list { display: flex; flex-direction: column; }
.row-item { display: flex; align-items: flex-start; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--border2); }
.row-item:last-child { border-bottom: none; }
.row-icon { width: 38px; height: 38px; border-radius: 10px; background: var(--panel2); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 17px; margin-top: 1px; }
.row-body { flex: 1; min-width: 0; }
.row-title { font-size: 14px; font-weight: 600; color: var(--text); line-height: 1.4; }
.row-sub { font-family: var(--mono); font-size: 11.5px; color: var(--muted); margin-top: 3px; line-height: 1.65; white-space: normal; }
.row-right { font-family: var(--mono); font-size: 13px; font-weight: 700; text-align: right; flex-shrink: 0; }
.row-right.green { color: var(--good); }
.row-right.yellow { color: var(--yellow); }
.row-right.muted { color: var(--muted); }

/* ── Action grid ────────────────────────────────────────────────────────────── */
.action-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 10px; }
.action-btn { background: var(--panel2); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 10px; display: flex; flex-direction: column; align-items: center; gap: 8px; cursor: pointer; transition: border-color .18s, background .18s; }
.action-btn:hover { border-color: var(--cyan-border); background: var(--cyan-dim); }
.action-btn svg { width: 22px; height: 22px; stroke: var(--cyan); fill: none; stroke-width: 1.7; stroke-linecap: round; }
.action-btn span { font-family: var(--mono); font-size: 10.5px; color: var(--text2); text-align: center; }

/* ── Status strip ───────────────────────────────────────────────────────────── */
.status-strip { display: flex; align-items: flex-start; gap: 8px; padding: 9px 14px; border-radius: var(--radius-sm); font-family: var(--mono); font-size: 11px; font-weight: 600; letter-spacing: .04em; line-height: 1.5; }
.status-strip.good { background: rgba(0,196,122,.1); color: var(--good); border: 1px solid rgba(0,196,122,.25); }
.status-strip.bad { background: rgba(229,57,53,.1); color: var(--bad); border: 1px solid rgba(229,57,53,.25); }
.status-strip.info { background: var(--cyan-dim); color: var(--cyan); border: 1px solid var(--cyan-border); }
.status-strip.warn { background: var(--yellow-dim); color: color-mix(in srgb, var(--yellow) 80%, #000); border: 1px solid var(--yellow-border); }

/* ── QR ─────────────────────────────────────────────────────────────────────── */
.qr-wrapper { display: flex; justify-content: center; padding: 20px; background: #ffffff; border-radius: var(--radius); margin: 16px 0; }

/* ── Identity ───────────────────────────────────────────────────────────────── */
.identity-box { background: var(--bg2); border-radius: var(--radius); padding: 14px 16px; font-family: var(--mono); font-size: 11.5px; word-break: break-all; line-height: 1.75; color: var(--cyan); border: 1px solid var(--border); }
.identity-label { font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-bottom: 7px; }
.mono-addr { font-family: var(--mono); font-size: 11.5px; color: var(--cyan); word-break: break-all; background: var(--bg2); padding: 12px 14px; border-radius: var(--radius-sm); border: 1px solid var(--border); line-height: 1.75; }

/* ── Spinner ─────────────────────────────────────────────────────────────────── */
.spinner { width: 18px; height: 18px; border: 2px solid var(--border); border-top-color: var(--cyan); border-radius: 50%; animation: spin .6s linear infinite; flex-shrink: 0; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Sheet ──────────────────────────────────────────────────────────────────── */
.sheet-overlay { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.55); display: none; align-items: flex-end; justify-content: center; }
.sheet-overlay.open { display: flex; }
.sheet {
  background: var(--glass-strong);
  -webkit-backdrop-filter: blur(32px) saturate(1.7);
  backdrop-filter: blur(32px) saturate(1.7);
  border-radius: 24px 24px 0 0;
  border-top: 1px solid var(--border);
  width: 100%; max-width: 820px;
  padding: 24px 28px 40px;
  box-shadow: var(--shadow-lg);
  max-height: 88vh;
  overflow-y: auto;
  display: flex; flex-direction: column; gap: 20px;
}
.sheet::-webkit-scrollbar { width: 5px; }
.sheet::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }
.sheet-handle { width: 40px; height: 4px; background: var(--border); border-radius: 99px; margin: 0 auto -4px; }
.sheet-title { font-size: 18px; font-weight: 700; letter-spacing: -.01em; }

/* ── Toast ──────────────────────────────────────────────────────────────────── */
#toasts { position: fixed; bottom: 20px; right: 20px; z-index: 100; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast { background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 12px 16px; display: flex; align-items: center; gap: 12px; box-shadow: var(--shadow-lg); min-width: 260px; animation: slideIn .3s var(--ease); pointer-events: all; }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: none; opacity: 1; } }
.toast.success .toast-icon { color: var(--good); }
.toast.error .toast-icon { color: var(--bad); }
.toast.info .toast-icon { color: var(--cyan); }
.toast-icon { font-size: 18px; flex-shrink: 0; }
.toast-body .toast-title { font-size: 13px; font-weight: 700; color: var(--text); }
.toast-body .toast-sub { font-family: var(--mono); font-size: 11px; color: var(--muted); margin-top: 1px; }

/* ── Pool ───────────────────────────────────────────────────────────────────── */
.pool-meter { width: 100%; height: 6px; border-radius: 4px; background: var(--border); overflow: hidden; }
.pool-meter-fill { height: 100%; border-radius: 4px; background: var(--cyan); transition: width .5s var(--ease); }
.pool-stats-row { display: flex; gap: 10px; margin-top: 12px; }
.pool-stat { flex: 1; background: var(--bg2); border: 1px solid var(--border2); border-radius: var(--radius-sm); padding: 10px 12px; text-align: center; }
.pool-stat-val { font-family: var(--mono); font-size: 14px; font-weight: 700; color: var(--cyan); }
.pool-stat-label { font-family: var(--mono); font-size: 9px; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); margin-top: 3px; }
.pool-speed-table { display: flex; flex-direction: column; gap: 8px; }
.pool-npub { cursor: pointer; transition: opacity .18s; }
.pool-npub:hover { opacity: .7; }

/* ── Top-up options ─────────────────────────────────────────────────────────── */
.topup-options { display: flex; gap: 8px; margin-bottom: 14px; }
.topup-option {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 12px 8px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--panel2);
  cursor: pointer;
  transition: border-color .18s, background .18s;
}
.topup-option:hover { border-color: var(--cyan-border); background: var(--cyan-dim); }
.topup-option-active { border-color: var(--cyan-border); background: var(--cyan-dim); }
.topup-icon { font-size: 18px; margin-bottom: 2px; }
.topup-name { font-size: 12px; font-weight: 700; color: var(--text); }
.topup-sub { font-family: var(--mono); font-size: 9.5px; color: var(--muted); }
.topup-panel { padding-top: 8px; }

/* ── Paywall options ────────────────────────────────────────────────────────── */
.paywall-option {
  flex: 1;
  text-align: center;
  padding: 16px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--panel2);
  cursor: pointer;
  transition: border-color .18s, background .18s;
}
.paywall-option:hover, .paywall-option-active { border-color: var(--yellow-border); background: var(--yellow-dim); }
.po-price { font-family: var(--mono); font-size: 26px; font-weight: 800; color: var(--yellow); line-height: 1; }
.po-label { font-family: var(--mono); font-size: 10px; color: var(--muted); letter-spacing: .06em; }
.po-credits { font-family: var(--mono); font-size: 11px; font-weight: 700; color: var(--text); margin-top: 6px; }

/* ── Access tiers ───────────────────────────────────────────────────────────── */
.tier-stack { display: flex; flex-direction: column; gap: 0; }
.access-tier { padding: 16px 0; border-bottom: 1px solid var(--border2); }
.access-tier:last-child { border-bottom: none; padding-bottom: 4px; }
.tier-header { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.tier-title { font-size: 14px; font-weight: 600; color: var(--text); flex: 1; }
.tier-sub { font-family: var(--mono); font-size: 10px; color: var(--muted); width: 100%; margin-top: -6px; }
.tier-badge { font-family: var(--mono); font-size: 9px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; padding: 3px 9px; border-radius: 99px; flex-shrink: 0; }
.tier-badge.green { background: rgba(0,196,122,.14); color: var(--good); border: 1px solid rgba(0,196,122,.30); }
.tier-badge.cyan { background: var(--cyan-dim); color: var(--cyan); border: 1px solid var(--cyan-border); }
.tier-badge.yellow { background: var(--yellow-dim); color: color-mix(in srgb,var(--yellow) 85%,#000); border: 1px solid var(--yellow-border); }
.tier-badge.faint { background: var(--bg2); color: var(--faint); border: 1px solid var(--border); }
.tier-features { display: flex; flex-direction: column; gap: 5px; }
.feat-row { display: flex; align-items: flex-start; gap: 10px; font-family: var(--mono); font-size: 12px; color: var(--text2); line-height: 1.6; padding: 2px 0; }
.feat-row .feat-icon { width: 20px; height: 20px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; border-radius: 5px; font-size: 12px; margin-top: 1px; }
.feat-row.active .feat-icon { background: rgba(0,196,122,.14); }
.feat-row.active { color: var(--text); }
.feat-row.pending .feat-icon { background: var(--cyan-dim); }
.feat-row.locked-feat .feat-icon { background: var(--yellow-dim); }
.feat-row.locked-feat { color: var(--muted); }
.feat-row.soon-feat { color: var(--faint); }
.feat-row.soon-feat .feat-icon { background: var(--bg2); }
.tier-unlock { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border2); }
.tier-unlock-label { font-family: var(--mono); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.tier-connected { display: flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 11px; color: var(--good); margin-top: 12px; }
.tier-connected::before { content: "✓"; font-weight: 700; }
.otp-step { display: none; }
.otp-step.active { display: block; }

/* ── Usage stats ────────────────────────────────────────────────────────────── */
.usage-stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 14px; }
.usage-stat { background: var(--bg2); border: 1px solid var(--border2); border-radius: var(--radius-sm); padding: 12px; text-align: center; }
.usage-stat-val { font-family: var(--mono); font-size: 18px; font-weight: 700; color: var(--cyan); line-height: 1; margin-bottom: 4px; }
.usage-stat-label { font-family: var(--mono); font-size: 9px; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); }

/* ── Cash App demo ──────────────────────────────────────────────────────────── */
.cashapp-demo { display: flex; gap: 14px; align-items: flex-start; flex-wrap: wrap; }
.cashapp-demo-icon { flex-shrink: 0; }
.cashapp-demo-text { flex: 1; min-width: 180px; }

/* ── Pricing pills (login gate) ─────────────────────────────────────────────── */
.pricing-pills { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.pricing-pill { flex: 1; min-width: 80px; background: var(--panel2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 8px; text-align: center; }
.pricing-pill.pp-yellow { border-color: var(--yellow-border); background: var(--yellow-dim); }
.pricing-pill.pp-cyan { border-color: var(--cyan-border); background: var(--cyan-dim); }
.pp-label { font-family: var(--mono); font-size: 9px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 3px; }
.pp-val { font-family: var(--mono); font-size: 11px; font-weight: 700; color: var(--text); }

/* ── Coming soon ────────────────────────────────────────────────────────────── */
.coming-soon { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 99px; background: var(--yellow-dim); color: color-mix(in srgb, var(--yellow) 80%, #000); border: 1px solid var(--yellow-border); font-family: var(--mono); font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }

/* ── Login gate ─────────────────────────────────────────────────────────────── */
.login-gate {
  position: fixed; inset: 0; z-index: 300;
  display: none;
  align-items: center; justify-content: center;
  background: var(--bg);
  padding: 32px 24px;
  overflow-y: auto;
}
.login-gate.open { display: flex; }
.login-card {
  width: 100%; max-width: 460px;
  background: var(--panel); border: 1px solid var(--border); border-radius: 22px;
  padding: 36px 32px 32px;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
  display: flex; flex-direction: column; gap: 0;
}
.login-logo { width: 58px; height: 58px; border-radius: 16px; background: var(--yellow); color: #0a0a00; display: flex; align-items: center; justify-content: center; margin: 0 auto 18px; box-shadow: 0 4px 14px var(--yellow-border); }
.login-title { text-align: center; font-size: 22px; font-weight: 800; letter-spacing: -.02em; margin-bottom: 8px; }
.login-sub { font-family: var(--mono); font-size: 11.5px; color: var(--muted); line-height: 1.75; text-align: center; margin-bottom: 22px; }
.login-fine { font-family: var(--mono); font-size: 10px; color: var(--faint); line-height: 1.65; text-align: center; margin-top: 18px; }
.gate-step { display: none; }
.gate-step.active { display: flex; flex-direction: column; gap: 12px; }
.gate-check { display: flex; gap: 10px; align-items: flex-start; font-family: var(--mono); font-size: 11px; color: var(--muted); line-height: 1.65; cursor: pointer; }
.gate-check input { margin-top: 3px; accent-color: var(--yellow); flex-shrink: 0; }

/* ── Web mode overrides ─────────────────────────────────────────────────────── */
html.web body { user-select: text; -webkit-user-select: text; }
html.web #app { height: 100dvh; }
html.web .titlebar { padding-left: 16px; }
html.web .traffic-spacer,
html.tauri .traffic-spacer { display: none; }
html.web .sidebar-top { }
html.embed #login-gate,
html.embed #welcome-overlay { display: none !important; }
html.embed #embed-popout-btn { display: inline-flex !important; }
html.web .tab-content { max-width: 900px; margin: 0 auto; }

/* Pool speed table (Pool tab) */
.pool-speed-table { display: flex; flex-direction: column; gap: 8px; }

#welcome-overlay,
#welcome-overlay.open {
  display: none !important;
  pointer-events: none !important;
}
.welcome-sheet {
  pointer-events: auto !important;
}
.welcome-sheet .btn {
  pointer-events: auto !important;
  min-height: 44px;
  cursor: pointer;
}
.welcome-sheet {
  width: 100%;
  max-width: 440px;
  border-radius: 24px;
  padding: 28px 24px 24px;
  background: var(--panel);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  text-align: center;
}
.welcome-sheet .hm-logo-img { margin: 0 auto 12px; }
.welcome-sheet #welcome-title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -.03em;
  margin-bottom: 10px;
}
.welcome-card {
  width: 100%; max-width: 500px;
  background: var(--glass-strong);
  -webkit-backdrop-filter: blur(32px) saturate(1.8);
  backdrop-filter: blur(32px) saturate(1.8);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 36px 32px 32px;
  box-shadow: var(--shadow-lg), inset 0 1px 0 var(--glass-highlight);
  display: flex; flex-direction: column; gap: 20px;
}

/* ── Floating popout panel ───────────────────────────────────────────────────── */
.popout-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: 8px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted); font-family: var(--mono); font-size: 10px; font-weight: 600;
  letter-spacing: .06em; text-transform: uppercase;
  transition: border-color .15s, color .15s, background .15s;
  cursor: pointer;
}
.popout-btn:hover { border-color: var(--cyan-border); color: var(--cyan); background: var(--cyan-dim); }
.popout-btn svg { width: 10px; height: 10px; stroke: currentColor; fill: none; stroke-width: 2; }

/* Floating window */
.float-win {
  position: fixed;
  z-index: 100;
  background: var(--glass-strong);
  -webkit-backdrop-filter: blur(40px) saturate(2);
  backdrop-filter: blur(40px) saturate(2);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: 0 20px 60px rgba(0,0,0,.28), 0 4px 16px rgba(0,0,0,.14), inset 0 1px 0 var(--glass-highlight);
  display: flex; flex-direction: column;
  overflow: hidden;
  min-width: 360px; min-height: 300px;
  animation: floatIn .28s cubic-bezier(.34,1.56,.64,1);
  resize: both;
}
@keyframes floatIn {
  from { opacity: 0; transform: scale(.92) translateY(10px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.float-win-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px;
  background: rgba(255,255,255,.06);
  border-bottom: 1px solid var(--border2);
  cursor: grab;
  flex-shrink: 0;
  user-select: none; -webkit-user-select: none;
}
.float-win-bar:active { cursor: grabbing; }
.float-win-title {
  display: flex; align-items: center; gap: 7px;
  font-family: var(--mono); font-size: 11px; font-weight: 700;
  color: var(--text); letter-spacing: .04em;
}
.float-win-controls { display: flex; gap: 6px; align-items: center; }
.float-win-btn {
  width: 22px; height: 22px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: none; cursor: pointer;
  font-size: 10px; transition: opacity .15s;
}
.float-win-btn:hover { opacity: .8; }
.fwb-close { background: #FF5F57; color: #6e0000; }
.fwb-dock  { background: #FFBD2E; color: #6b4200; }
.fwb-max   { background: #28C840; color: #003a10; }
.float-win-body {
  flex: 1; display: flex; flex-direction: column;
  overflow: hidden; min-height: 0;
}

/* Dim main content when a panel is floating */
.has-float .ai-layout > *:not(.float-source) { opacity: .35; transition: opacity .3s; pointer-events: none; }
.float-source { opacity: 1 !important; pointer-events: none !important; }

/* Popout container wrapper */
.popout-wrapper { position: relative; }
.popout-wrapper .card-header-row {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px;
}

/* ── AI layout spacing fixes ─────────────────────────────────────────────────── */
.ai-layout { gap: 20px; padding: 22px 26px 100px; }
.cerebras-hero-card { padding: 22px 24px 20px; gap: 14px; }
.hero-header { margin-bottom: 8px; }
.pcc-info-card { padding: 22px 24px; }
.pcc-info-row { grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 4px; }
.pcc-info-text { font-size: 12px; line-height: 1.7; }
.speed-card { padding: 22px 24px; }
.council-section { padding: 22px 24px; }
.chat-bubble { padding: 13px 17px; }
.pcc-desc { font-size: 12px; line-height: 1.65; }
.hero-sub { font-size: 11.5px; line-height: 1.6; }
.council-chat-area { padding: 12px 14px; }

/* ── Readability: bump remaining micro text ──────────────────────────────────── */
.status-strip { font-family: var(--mono); font-size: 12px; line-height: 1.65; }
.input-label { font-size: 11px !important; }

/* ── Popout dock animation ────────────────────────────────────────────────────── */
.float-placeholder {
  transition: opacity .22s var(--ease);
  cursor: pointer !important;
}
.float-placeholder:hover { border-color: var(--cyan-border) !important; color: var(--cyan) !important; }
.popout-btn.is-floating {
  border-color: var(--cyan-border);
  color: var(--cyan);
  background: var(--cyan-dim);
}
@keyframes dockIn {
  from { opacity: 0; transform: scale(.94) translateY(8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.dock-animate { animation: dockIn .26s cubic-bezier(.34,1.3,.64,1); }

/* ── Default: Apple iPhone 18 Pro Burgundy (#4D1821) glossy ───────────────── */
/* Color slider: 0 burgundy (default) · 1 light · 2 dark */
[data-theme="burgundy"] {
  --bg: #12080B;
  --bg2: #1A0A0E;
  --panel: #2A1218;
  --panel2: #1F0E13;
  --border: rgba(255, 214, 196, 0.14);
  --border2: rgba(255, 214, 196, 0.07);
  --text: #F7EDE8;
  --text2: #D4B8B0;
  --muted: #A07A78;
  --faint: #6E4A4A;
  --glass: rgba(77, 24, 33, 0.58);
  --glass-strong: rgba(18, 8, 11, 0.84);
  --glass-highlight: rgba(255, 220, 200, 0.16);
  --ambient:
    radial-gradient(1100px 620px at 85% -10%, rgba(139, 41, 48, .38), transparent 60%),
    radial-gradient(950px 700px at -12% 108%, rgba(77, 24, 33, .55), transparent 60%),
    radial-gradient(700px 500px at 110% 75%, rgba(232, 201, 160, .08), transparent 60%);
  --cyan: #E8A0A8;
  --cyan-dim: rgba(232, 160, 168, .14);
  --cyan-border: rgba(232, 160, 168, .38);
  --yellow: #E8C9A0;
  --yellow-dim: rgba(232, 201, 160, .14);
  --yellow-border: rgba(232, 201, 160, .40);
  --good: #7DCFB6;
  --bad: #E57373;
  --shadow: 0 2px 20px rgba(8, 0, 2, .55);
  --shadow-lg: 0 12px 50px rgba(8, 0, 2, .75);
  --sheen: linear-gradient(160deg, rgba(255,255,255,.18) 0%, rgba(255,255,255,0) 46%);
  --burgundy: #4D1821;
  --burgundy-gloss: #6B2230;
}

html[data-theme="burgundy"] body {
  background-color: #12080B;
  background-image:
    linear-gradient(180deg, rgba(255,255,255,.07) 0%, rgba(255,255,255,0) 28%),
    var(--ambient);
}
html[data-theme="burgundy"] .chat-sidebar,
html[data-theme="burgundy"] .titlebar,
html[data-theme="burgundy"] .card,
html[data-theme="burgundy"] .cerebras-hero-card,
html[data-theme="burgundy"] .login-card {
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.16),
    inset 0 -1px 0 rgba(0,0,0,.35),
    var(--shadow);
}

.hm-logo-img {
  display: block;
  border-radius: 7px;
  object-fit: cover;
  box-shadow: 0 2px 10px rgba(77,24,33,.4), inset 0 1px 0 rgba(255,255,255,.28);
  flex-shrink: 0;
}

/* Top-right 3-stop color slider */
.color-slider-wrap {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 3px;
  min-width: 118px;
}
.color-slider-wrap input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 118px;
  height: 18px;
  border-radius: 99px;
  background:
    linear-gradient(90deg, #4D1821 0%, #4D1821 33%, #f8f7f4 33%, #f8f7f4 66%, #030304 66%, #030304 100%);
  border: 1px solid var(--border);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.22), 0 1px 4px rgba(0,0,0,.25);
  outline: none;
  cursor: pointer;
}
.color-slider-wrap input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #fff, #E8C9A0 55%, #4D1821);
  border: 1px solid rgba(255,255,255,.55);
  box-shadow: 0 1px 4px rgba(0,0,0,.45);
  cursor: grab;
}
.color-slider-stops {
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--faint);
  padding: 0 2px;
}
.color-slider-stops .on { color: var(--yellow); font-weight: 700; }

.version-slider-wrap { display: flex; flex-direction: column; gap: 8px; }
.version-slider-wrap input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 22px;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--panel2) 0%, var(--panel2) 50%, var(--yellow-dim) 50%, var(--yellow-dim) 100%);
  border: 1px solid var(--border);
  outline: none;
  cursor: pointer;
}
.version-slider-wrap input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--yellow);
  border: 1px solid rgba(0,0,0,.2);
  box-shadow: 0 1px 4px rgba(0,0,0,.3);
}
.version-stops {
  display: flex; justify-content: space-between;
  font-family: var(--mono); font-size: 11px; font-weight: 700;
}
.version-stops .on { color: var(--yellow); }

.test-mode-banner {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 7px 16px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .02em;
  background: color-mix(in srgb, var(--yellow) 14%, transparent);
  color: var(--yellow);
  border-bottom: 1px solid var(--yellow-border);
  flex-shrink: 0;
}
html[data-release="0.1.3"] .test-mode-banner { display: flex; }
html[data-release="0.1.4"] .test-mode-banner { display: none; }

.works-badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--mono); font-size: 9px; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase;
  padding: 2px 8px; border-radius: 99px;
  background: color-mix(in srgb, var(--good) 14%, transparent);
  color: var(--good);
  border: 1px solid color-mix(in srgb, var(--good) 30%, transparent);
}
.wont-badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--mono); font-size: 9px; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase;
  padding: 2px 8px; border-radius: 99px;
  background: color-mix(in srgb, var(--bad) 14%, transparent);
  color: var(--bad);
  border: 1px solid color-mix(in srgb, var(--bad) 30%, transparent);
}

/* 0.1.3 test mode: blur features that are not live yet */
html[data-release="0.1.3"] .v104-feature {
  filter: blur(6px);
  pointer-events: none;
  user-select: none;
  position: relative;
}
html[data-release="0.1.3"] .v104-feature::after {
  content: attr(data-blocked);
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 12px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--yellow);
  text-shadow: 0 1px 8px #000;
  filter: none;
  pointer-events: none;
  z-index: 2;
}
html[data-release="0.1.4"] .v104-feature { filter: none; pointer-events: auto; }
html[data-release="0.1.4"] .v104-feature::after { display: none; }

/* Advanced Mode OFF (default): blur everything that is not Lightning or Profile. */
html[data-advanced="off"] .advanced-only { display: none !important; }
html[data-advanced="on"] .advanced-only.snav-btn { display: flex; }
html[data-advanced="off"] #tab-ai,
html[data-advanced="off"] .snav-btn:not(.snav-lightning):not(.snav-profile),
html[data-advanced="off"] .demo-wallets-note {
  filter: blur(6px);
  pointer-events: none !important;
  user-select: none;
}
html[data-advanced="off"] #tab-wallet,
html[data-advanced="off"] #tab-profile,
html[data-advanced="off"] .snav-lightning,
html[data-advanced="off"] .snav-profile,
html[data-advanced="off"] .titlebar-ln,
html[data-advanced="off"] .sats-chip,
html[data-advanced="off"] .theme-toggles,
html[data-advanced="off"] .theme-swatch,
html[data-advanced="off"] #advanced-toggle,
html[data-advanced="off"] #release-slider,
html[data-advanced="off"] .titlebar-logo,
html[data-advanced="off"] .titlebar-version,
html[data-advanced="off"] .titlebar-brand,
html[data-advanced="off"] .hmw-overlay,
html[data-advanced="off"] .hmw,
html[data-advanced="off"] .hmw-tab-hero,
html[data-advanced="off"] .chat-sidebar,
html[data-advanced="off"] .sidebar-nav-bottom {
  filter: none !important;
  pointer-events: auto !important;
}
html[data-advanced="off"] .sidebar-nav-bottom .snav-btn:not(.snav-lightning):not(.snav-profile) {
  filter: blur(6px);
  pointer-events: none !important;
}
html[data-advanced="on"] .advanced-warn { display: block; }
html[data-advanced="off"] .advanced-warn { display: none; }

.theme-toggles {
  display: flex;
  align-items: center;
  gap: 6px;
  position: relative;
  z-index: 4;
}
.theme-swatch {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.35);
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.4), 0 1px 4px rgba(0,0,0,.35);
}
.theme-swatch.on {
  outline: 2px solid var(--yellow);
  outline-offset: 2px;
}
.swatch-burgundy { background: radial-gradient(circle at 30% 28%, #8B3A44, #4D1821 70%); }
.swatch-light { background: radial-gradient(circle at 30% 28%, #fff, #e8e4dc 70%); }
.swatch-dark { background: radial-gradient(circle at 30% 28%, #444, #111 70%); }
.theme-toggles-lg { gap: 10px; }
.theme-toggles-lg .theme-swatch { width: 28px; height: 28px; }

.welcome-copy {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--text2);
  line-height: 1.7;
  text-align: center;
}
.backup-callout {
  background: var(--yellow-dim);
  border: 1px solid var(--yellow-border);
  border-radius: 16px;
  padding: 16px 18px;
}
.backup-callout-title {
  font-weight: 800;
  font-size: 15px;
  margin-bottom: 6px;
}
.backup-callout p {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  line-height: 1.65;
}
.advanced-disclaimer {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--text);
  line-height: 1.75;
  background: var(--panel2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
}
.advanced-disclaimer-sub {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  line-height: 1.65;
  margin-top: 10px;
}
.version-slider-lg input[type="range"] { height: 28px; }
.inference-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--muted);
  padding: 0 4px 6px;
}

.company-key-card {
  border: 1px solid var(--yellow-border) !important;
  background:
    linear-gradient(160deg, rgba(255,255,255,.08), transparent 42%),
    color-mix(in srgb, var(--yellow) 8%, var(--panel)) !important;
}
.company-key-card .input-label {
  font-size: 12px !important;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--yellow);
}
.difficulty-meter {
  height: 6px; border-radius: 99px; background: var(--border);
  overflow: hidden; margin-top: 8px;
}
.difficulty-meter > span {
  display: block; height: 100%;
  background: linear-gradient(90deg, var(--burgundy-gloss, #6B2230), var(--yellow));
  width: 0%; transition: width .4s var(--ease);
}

/* ── Titlebar: version beside wordmark, sats beside color icons ─────────────── */
.titlebar-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
  z-index: 4;
  flex-shrink: 0;
}
.titlebar-version {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--glass);
  box-shadow: inset 0 1px 0 var(--glass-highlight);
  cursor: pointer;
}
.titlebar-ver-num {
  font-family: "Courier New", Courier, ui-monospace, monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--muted);
}
.ver-i {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--display);
  font-size: 10px;
  font-weight: 800;
  font-style: italic;
  color: var(--bg);
  background: var(--yellow);
  border: 1px solid color-mix(in srgb, var(--yellow) 40%, #000);
  line-height: 1;
}
.titlebar-version:hover { border-color: var(--yellow-border); }
.version-pop {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: min(320px, 72vw);
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--glass-strong);
  -webkit-backdrop-filter: blur(24px) saturate(1.6);
  backdrop-filter: blur(24px) saturate(1.6);
  box-shadow: var(--shadow-lg), inset 0 1px 0 var(--glass-highlight);
  z-index: 40;
}
.version-pop-title {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -.02em;
  margin-bottom: 6px;
}
.version-pop p {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.65;
}
.titlebar-ln {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  padding: 6px 16px 6px 6px;
  border-radius: 16px;
  border: 1px solid var(--yellow-border);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--yellow) 28%, transparent), var(--yellow-dim));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 6px 20px color-mix(in srgb, var(--yellow) 22%, transparent);
  color: var(--text);
  cursor: pointer;
  flex-shrink: 0;
}
.titlebar-ln img {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  object-fit: cover;
}
.titlebar-ln-copy { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.15; }
.titlebar-ln-kicker {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--yellow);
}
.titlebar-ln-sats {
  font-family: "Courier New", Courier, ui-monospace, monospace;
  font-size: 16px;
  font-weight: 700;
}
.titlebar-ln:hover { border-color: var(--yellow); }
.sats-chip { display: none !important; }

/* Lightning nav — large rectangle that reads as the wallet entry */
.snav-lightning {
  padding: 14px 12px;
  margin: 2px 0 10px;
  min-height: 58px;
  border-radius: 16px;
  border: 1px solid var(--yellow-border);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--yellow) 16%, transparent), var(--yellow-dim));
  color: var(--text);
  font-size: 12.5px;
  box-shadow: inset 0 1px 0 var(--glass-highlight), 0 6px 18px rgba(0,0,0,.18);
}
.snav-lightning:hover { border-color: var(--yellow); color: var(--text); }
.snav-lightning.active {
  background: var(--yellow-dim);
  color: var(--yellow);
}
.snav-ln-logo {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  object-fit: cover;
  box-shadow: 0 2px 10px rgba(0,0,0,.35);
  flex-shrink: 0;
}
.chat-sidebar.collapsed .snav-lightning { padding: 10px; min-height: 44px; }

/* Wallet tab hero — large pop-out rectangle */
.hmw-tab-hero {
  position: relative;
  overflow: hidden;
  border-radius: 22px;
  padding: 22px 22px 20px;
  border: 1px solid color-mix(in srgb, var(--yellow) 35%, var(--border));
  background:
    linear-gradient(180deg, rgba(255,255,255,.14), rgba(255,255,255,0) 38%),
    var(--panel);
  box-shadow: inset 0 1px 0 var(--glass-highlight), var(--shadow-lg);
  cursor: pointer;
}
.hmw-tab-hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.hmw-tab-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}
.hmw-tab-logo {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  object-fit: cover;
  box-shadow: 0 8px 24px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.3);
}
.hmw-tab-kicker {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--yellow);
}
.hmw-tab-title {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -.04em;
  margin-top: 2px;
}
.hmw-tab-sub {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
  line-height: 1.55;
}
.demo-wallets-note {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  line-height: 1.7;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px dashed var(--border);
  background: var(--panel2);
}

/* ── hm-wallet overlay — large glossy rectangle ─────────────────────────────── */
.hmw-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 48px 20px 28px;
  background: rgba(8, 0, 2, .82);
  pointer-events: none;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}
html.tauri .hmw-overlay { padding-top: 76px; }
.hmw-overlay.open {
  display: flex;
  pointer-events: auto;
}
.hmw {
  position: relative;
  width: min(720px, calc(100vw - 40px));
  max-height: calc(100dvh - 96px);
  min-height: 0;
  margin: 0 auto auto;
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 22px;
  border: 1px solid color-mix(in srgb, var(--yellow) 28%, var(--border));
  background:
    linear-gradient(180deg, rgba(255,255,255,.16) 0%, rgba(255,255,255,.03) 28%, transparent 52%),
    var(--glass-strong);
  -webkit-backdrop-filter: blur(40px) saturate(1.8);
  backdrop-filter: blur(40px) saturate(1.8);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.4),
    inset 0 -1px 0 rgba(0,0,0,.25),
    0 40px 80px rgba(0,0,0,.45);
}
.hmw-sheen {
  pointer-events: none;
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, rgba(255,255,255,.22) 0%, transparent 36%, transparent 62%, rgba(255,255,255,.06) 100%);
  mix-blend-mode: screen;
  opacity: .55;
}
.hmw-head, .hmw-body { position: relative; z-index: 1; }
.hmw-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 22px 14px;
  border-bottom: 1px solid var(--border2);
  flex-shrink: 0;
  overflow: visible;
  min-height: 88px;
}
.hmw-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}
.hmw-logo {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  object-fit: cover;
  display: block;
  flex-shrink: 0;
  box-shadow: 0 8px 20px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.35);
}
.hmw-kicker {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--yellow);
}
.hmw h2 {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -.04em;
  margin: 2px 0 0;
}
.hmw-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.hmw-close {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--panel2);
  color: var(--text);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
}
.hmw-close:hover { border-color: var(--yellow-border); }
.hmw-body {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  padding: 16px 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.hmw-balance {
  text-align: left;
  padding: 8px 4px 4px;
}
.hmw-bal-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
}
.hmw-bal-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-top: 4px;
}
.hmw-bal {
  font-family: "Courier New", Courier, ui-monospace, monospace;
  font-size: clamp(36px, 6vw, 64px);
  font-weight: 700;
  letter-spacing: -.03em;
  color: var(--yellow);
  line-height: 1;
}
.hmw-bal-unit {
  font-family: "Courier New", Courier, ui-monospace, monospace;
  font-size: 18px;
  color: var(--muted);
}
.hmw-bal-sub {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  margin-top: 8px;
  line-height: 1.55;
}
.hmw-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.hmw-grid {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 14px;
  min-height: 0;
  flex: 1;
}
@media (max-width: 820px) {
  .hmw { max-height: calc(100dvh - 48px); border-radius: 20px; }
  .hmw-grid { grid-template-columns: 1fr; }
  .sats-chip { font-size: 13px; padding: 5px 10px; }
}
.hmw-panel {
  border-radius: 16px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--panel) 70%, transparent);
  padding: 14px 16px;
  min-height: 0;
}
.hmw-panel h3 {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 12px;
}
.hmw-bar {
  margin-bottom: 10px;
}
.hmw-bar-top {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  margin-bottom: 4px;
}
.hmw-bar-top span:last-child {
  font-family: "Courier New", Courier, ui-monospace, monospace;
  color: var(--faint);
}
.hmw-bar-track {
  height: 6px;
  border-radius: 99px;
  background: var(--border);
  overflow: hidden;
}
.hmw-bar-fill {
  height: 100%;
  border-radius: 99px;
  background: var(--yellow);
}
.hmw-note {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text2);
  line-height: 1.7;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--panel2);
}
.hmw-activity {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 280px;
  overflow: auto;
}
.hmw-tx {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border2);
}
.hmw-tx-amt {
  font-family: "Courier New", Courier, ui-monospace, monospace;
  font-weight: 700;
}
.hmw-forms {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 820px) { .hmw-forms { grid-template-columns: 1fr; } }

html.hmw-standalone .chat-sidebar,
html.hmw-standalone .test-mode-banner,
html.hmw-standalone .tabs-wrap,
html.hmw-standalone .titlebar-center,
html.hmw-standalone #embed-popout-btn {
  display: none !important;
}
html.hmw-standalone .hmw-overlay {
  padding: 0;
  background: transparent;
  backdrop-filter: none;
}
html.hmw-standalone .hmw {
  width: 100%;
  height: 100%;
  border-radius: 0;
  max-height: none;
}
html.hmw-standalone .hmw-close { display: none; }
html.hmw-standalone .app-body { border: 0; }
html.hmw-standalone #app { height: 100%; }

html[data-advanced="off"] .test-mode-banner { display: flex; }
html[data-advanced="on"] .test-mode-banner { display: none; }
html[data-release="0.1.5"] .test-mode-banner { display: flex; }
html[data-advanced="on"][data-release="0.1.5"] .test-mode-banner { display: none; }

html.tauri #welcome-overlay,
html.tauri #welcome-overlay.open,
html.tauri #login-gate {
  display: none !important;
  pointer-events: none !important;
}
html.tauri[data-advanced="on"] .v104-feature,
html.tauri[data-advanced="on"] .council-section,
html.tauri[data-advanced="on"] .pcc-info-card,
html.tauri[data-advanced="on"] #tab-ai,
html.tauri[data-advanced="on"] .snav-btn {
  filter: none !important;
  pointer-events: auto !important;
}
html.tauri .has-float .ai-layout > *,
html.tauri .float-source {
  pointer-events: auto !important;
}
html.tauri button,
html.tauri a,
html.tauri input,
html.tauri textarea,
html.tauri select,
html.tauri .btn,
html.tauri .snav-lightning,
html.tauri .snav-profile,
html.tauri .switch,
html.tauri .theme-swatch,
html.tauri .titlebar-ln,
html.tauri .titlebar-logo,
html.tauri .titlebar-version,
html.tauri .hmw,
html.tauri .hmw-overlay.open {
  pointer-events: auto !important;
  cursor: pointer;
  -webkit-app-region: no-drag !important;
}
