/* ──────────────────────────────────────────────────────────────
   Botty Shell — layout only (sidebar · topbar · main · palette).
   Widgets live in botty-components.css.
   ────────────────────────────────────────────────────────────── */

.botty-shell { display: flex; min-height: 100vh; background: var(--bg); color: var(--text); }

/* ── Sidebar ────────────────────────────────────────────────── */
.botty-sidebar {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: var(--nav-w);
  background: var(--surface);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
  padding: 18px 12px 14px; gap: 4px;
  z-index: 100; overflow-y: auto;
}
[data-theme="dark"] .botty-sidebar,
[data-theme="amber"] .botty-sidebar,
[data-theme="matrix"] .botty-sidebar { background: linear-gradient(180deg, var(--surface), var(--bg-deep)); }

.botty-brand {
  display: flex; align-items: center; gap: 12px;
  padding: 4px 8px 14px; margin-bottom: 6px;
  border-bottom: 1px solid var(--line-accent);
  text-decoration: none; color: inherit;
}
.botty-brand:hover { text-decoration: none; }
.botty-brand svg { flex-shrink: 0; display: block; filter: drop-shadow(0 2px 8px var(--brand-glow)); }
.botty-brand-text { line-height: 1.15; }
.botty-brand-name { font-size: 18px; font-weight: 800; letter-spacing: -0.01em; color: var(--text); }
.botty-brand-sub { font-family: var(--ff-mono); font-size: 10px; color: var(--text-subtle); letter-spacing: 0.03em; margin-top: 2px; }

/* Command palette trigger in sidebar */
.botty-cmd-trigger {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; margin: 2px 4px 8px;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--r-sm); color: var(--text-subtle);
  font-size: 12.5px; cursor: pointer; width: calc(100% - 8px);
  transition: all var(--t-fast);
}
.botty-cmd-trigger:hover { border-color: var(--brand-tint); color: var(--text-muted); }
.botty-cmd-trigger .kbd { margin-left: auto; font-family: var(--ff-mono); font-size: 10.5px; padding: 1px 6px; border: 1px solid var(--line-strong); border-radius: 5px; color: var(--text-subtle); }

.botty-navlist { display: flex; flex-direction: column; gap: 1px; margin-top: 2px; flex: 1; overflow-y: auto; min-height: 0; }

.botty-navsection { margin-top: 12px; }
.botty-navsection:first-child { margin-top: 0; }
.botty-navsection-label {
  font-size: 10px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--text-faint); padding: 4px 12px 5px;
}

.botty-navitem {
  position: relative; display: flex; align-items: center; gap: 11px;
  padding: 8px 12px; border-radius: var(--r-sm);
  text-decoration: none; color: var(--text-muted);
  font-size: 13.5px; font-weight: 500;
  transition: background var(--t-fast), color var(--t-fast);
}
.botty-navitem:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.botty-navitem.active { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.botty-navitem.active::before {
  content: ''; position: absolute; left: 0; top: 6px; bottom: 6px; width: 3px;
  background: linear-gradient(180deg, var(--brand), var(--profit)); border-radius: 0 3px 3px 0;
}
.botty-navitem svg { flex-shrink: 0; opacity: .85; }
.botty-navitem.active svg { opacity: 1; }
.botty-nav-pill {
  margin-left: auto; font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px;
  padding: 2px 6px; border-radius: 999px; background: var(--warn-bg); color: var(--warn); border: 1px solid transparent;
}

.botty-cloud-banner {
  background: linear-gradient(90deg, var(--warn-bg), transparent);
  border: 1px solid var(--warn-glow); border-radius: var(--r-md);
  padding: 12px 16px; margin: 0 0 8px; font-size: 13px; color: var(--text);
  display: flex; gap: 10px; align-items: flex-start;
}
.botty-cloud-banner .icon { flex-shrink: 0; font-size: 16px; }
.botty-cloud-banner strong { font-weight: 600; display: block; margin-bottom: 2px; }

.botty-sidefoot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; padding-top: 10px; }
.botty-theme-toggle {
  display: flex; align-items: center; gap: 8px; padding: 8px 12px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-sm);
  color: var(--text-muted); font: inherit; font-size: 12.5px; font-weight: 500;
  cursor: pointer; transition: all var(--t-fast);
}
.botty-theme-toggle:hover { color: var(--text); background: var(--surface-3); }

/* Language switcher — two flag chips (decoupled from the theme toggle so
   botty-theme.js's .theme-icon/.theme-text sync never clobbers it). */
.botty-langswitch { display: flex; gap: 6px; }
.botty-lang {
  display: flex; align-items: center; gap: 6px; padding: 6px 9px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-sm);
  color: var(--text-muted); font-size: 12px; font-weight: 600; text-decoration: none;
  transition: all var(--t-fast);
}
.botty-lang:hover { color: var(--text); background: var(--surface-3); }
.botty-lang.active { color: var(--brand); background: var(--brand-soft); border-color: var(--brand-tint); }
.botty-lang .flag {
  width: 18px; height: 12px; border-radius: 2px; display: block; flex: none;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .18);
}

/* ── Main area ──────────────────────────────────────────────── */
.botty-main { flex: 1; margin-left: var(--nav-w); min-width: 0; display: flex; flex-direction: column; }

.botty-topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 12px 32px; min-height: var(--topbar-h);
  background: var(--glass); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 50;
}
.botty-topbar-left { min-width: 0; }
.botty-breadcrumb { font-size: 12px; color: var(--text-subtle); letter-spacing: 0.02em; margin-bottom: 3px; }
.botty-breadcrumb a { color: var(--brand); text-decoration: none; }
.botty-breadcrumb a:hover { text-decoration: underline; }
.botty-pagetitle { font-size: 23px; font-weight: 700; letter-spacing: -0.02em; color: var(--text); line-height: 1.15; margin: 0; }
.botty-topbar-right { display: flex; align-items: center; gap: 8px; }

.botty-content { padding: 22px 32px 48px; display: flex; flex-direction: column; gap: 22px; }

/* Subnav strip (page-level tabs/filters under topbar) */
.botty-subnav { padding: 0 32px; background: var(--bg); border-bottom: 1px solid var(--line); position: sticky; top: var(--topbar-h); z-index: 40; }

/* ── Command palette ────────────────────────────────────────── */
.cmdk-scrim {
  position: fixed; inset: 0; background: rgba(3, 9, 16, 0.6); backdrop-filter: blur(3px);
  z-index: 9500; display: none; align-items: flex-start; justify-content: center;
}
.cmdk-scrim.open { display: flex; }
.cmdk {
  margin-top: 12vh; width: min(620px, 92vw); max-height: 64vh;
  background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: var(--r-lg); box-shadow: var(--shadow-lg);
  overflow: hidden; display: flex; flex-direction: column;
  animation: cmdkIn .18s var(--ease-out);
}
@keyframes cmdkIn { from { opacity: 0; transform: translateY(-8px) scale(.98); } to { opacity: 1; transform: none; } }
.cmdk-input { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.cmdk-input input { flex: 1; background: none; border: none; outline: none; font: inherit; font-size: 15.5px; color: var(--text); }
.cmdk-input .search-icon { color: var(--text-subtle); display: inline-flex; }
.cmdk-list { overflow-y: auto; padding: 6px; }
.cmdk-group-label { font-size: 10px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--text-faint); padding: 8px 12px 4px; }
.cmdk-item {
  display: flex; align-items: center; gap: 11px; padding: 9px 12px;
  border-radius: var(--r-sm); cursor: pointer; color: var(--text-muted); text-decoration: none;
}
.cmdk-item .ci-icon { color: var(--text-subtle); display: inline-flex; }
.cmdk-item .ci-sub { margin-left: auto; font-size: 11.5px; color: var(--text-faint); }
.cmdk-item.active, .cmdk-item:hover { background: var(--brand-soft); color: var(--text); }
.cmdk-item.active .ci-icon { color: var(--brand); }
.cmdk-empty { padding: 24px; text-align: center; color: var(--text-subtle); font-size: 13px; }

/* ── Mobile ─────────────────────────────────────────────────── */
@media (max-width: 900px) {
  :root { --nav-w: 0px; }
  .botty-shell { flex-direction: column; }
  .botty-sidebar {
    position: sticky; top: 0; bottom: auto; width: 100%; height: auto;
    flex-direction: row; align-items: center; padding: 9px 12px; overflow-x: auto;
    gap: 6px; border-right: 0; border-bottom: 1px solid var(--line);
  }
  .botty-brand { border-bottom: 0; padding: 0; margin: 0; }
  .botty-brand-sub { display: none; }
  .botty-cmd-trigger { display: none; }
  .botty-navsection { margin: 0; display: contents; }
  .botty-navsection-label { display: none; }
  .botty-navlist { flex-direction: row; gap: 2px; margin: 0; flex: none; overflow-y: visible; min-height: unset; }
  .botty-navitem { padding: 6px 9px; font-size: 12.5px; }
  .botty-navitem span.label { display: none; }
  .botty-navitem.active::before { display: none; }
  .botty-nav-pill { font-size: 0; margin-left: 4px; padding: 0; width: 6px; height: 6px; background: var(--warn-solid); border-radius: 50%; }
  .botty-sidefoot { flex-direction: row; margin-left: auto; gap: 8px; padding-top: 0; }
  .botty-uparrow-line { display: none; }
  .botty-theme-toggle .theme-text { display: none; }
  .botty-lang span { display: none; }
  .botty-main { margin-left: 0; }
  .botty-topbar { padding: 10px 16px; }
  .botty-content { padding: 16px; gap: 16px; }
  .botty-subnav { padding: 0 16px; top: 0; }
}
