:root {
  /* ==========================================================================
     INSTITUTIONAL LIGHT THEME (SWISS BANKING & ENTERPRISE FINTECH TERMINAL)
     ========================================================================== */
  --bg-canvas: #f8fafc;          /* Pure alabaster canvas (slate-50) */
  --bg-surface: #ffffff;         /* Crisp pure white cards and panels */
  --bg-surface-alt: #f1f5f9;     /* Slate-100: headers, secondary cards */
  --bg-surface-hover: #f8fafc;   /* Slate-50 hover */
  
  --border-subtle: #e2e8f0;      /* Slate-200: Elegant hairline borders */
  --border-strong: #cbd5e1;      /* Slate-300: Strong structural borders */
  --border-accent: #2563eb;      /* Electric cobalt accent */
  --border-gold: #f59e0b;        /* Sovereign amber/gold accent */

  --text-main: #0f172a;          /* Slate-900: High-contrast primary text */
  --text-secondary: #1e293b;     /* Slate-700: Section headers and readable copy */
  --text-muted: #334155;         /* Slate-500: Subtitles, column headers */
  --text-dim: #475569;           /* Slate-400: Micro tags, timestamps */

  /* Sovereign Institutional Accents */
  --brand-navy: #0a2540;         /* Sovereign deep navy */
  --brand-cobalt: #2563eb;       /* Institutional electric cobalt */
  --brand-cobalt-light: #eff6ff; /* Soft blue tint */
  --accent-cyan: #0369a1;        /* Sky-600 */
  --accent-blue: #1d4ed8;        /* Cobalt blue */
  --accent-emerald: #03644a;     /* Emerald-600: Clearing & Solvency */
  --accent-emerald-light: #ecfdf5;
  --accent-amber: #92400e;       /* Amber-600: Collateral & Yield */
  --accent-amber-light: #fffbeb;
  --accent-rose: #b91c1c;        /* Red-600: Danger / Circuit Breaker */
  --accent-rose-light: #fef2f2;
  --accent-purple: #4f46e5;      /* Indigo-600: Senior Notes & UCC */
  --accent-purple-light: #eef2ff;

  --shadow-xs: 0 1px 2px 0 rgba(15, 23, 42, 0.05);
  --shadow-sm: 0 1px 3px 0 rgba(15, 23, 42, 0.08), 0 1px 2px -1px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.08), 0 2px 4px -2px rgba(15, 23, 42, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.04);
  --shadow-xl: 0 20px 25px -5px rgba(15, 23, 42, 0.09), 0 8px 10px -6px rgba(15, 23, 42, 0.04);

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-canvas);
  color: var(--text-main);
  font-family: var(--font-sans);
  line-height: 1.5;
  height: 100vh;
  overflow: hidden;
  display: flex;
}

/* App Container */
#app {
  display: flex;
  width: 100vw;
  height: 100vh;
}

/* Sidebar Navigation */
.sidebar {
  width: 280px;
  min-width: 280px;
  background: var(--bg-surface);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  z-index: 10;
  box-shadow: var(--shadow-sm);
}

.brand-header {
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border-subtle);
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.brand-title {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.8px;
  color: var(--brand-navy);
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-badge {
  background: #0f172a;
  color: #ffffff;
  font-size: 9px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.brand-subtitle {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 5px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.nav-links {
  list-style: none;
  padding: 14px 10px;
  flex: 1;
  overflow-y: auto;
}

.nav-item {
  margin-bottom: 3px;
}

.nav-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 13px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.16s ease;
  text-align: left;
}

.nav-btn:hover {
  background: var(--bg-surface-alt);
  color: var(--brand-navy);
}

.nav-btn.active {
  background: var(--brand-cobalt-light);
  border-color: rgba(37, 99, 235, 0.3);
  color: var(--brand-cobalt);
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(37, 99, 235, 0.08);
}

.nav-icon {
  font-size: 16px;
  display: inline-flex;
  width: 20px;
  justify-content: center;
}

.sidebar-footer {
  padding: 14px 18px;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-surface-alt);
}

.system-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--accent-emerald);
  box-shadow: 0 0 6px var(--accent-emerald);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { opacity: 0.6; }
  50% { opacity: 1; }
  100% { opacity: 0.6; }
}

/* Main Content Area */
.main-viewport {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg-canvas);
}

.topbar {
  height: 64px;
  border-bottom: 1px solid var(--border-subtle);
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-surface);
  box-shadow: var(--shadow-xs);
  z-index: 5;
}

.page-headline {
  font-size: 17px;
  font-weight: 800;
  color: var(--brand-navy);
  display: flex;
  align-items: center;
  gap: 12px;
  letter-spacing: -0.2px;
}

.tag-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 12px;
  background: var(--brand-cobalt-light);
  color: var(--brand-cobalt);
  border: 1px solid rgba(37, 99, 235, 0.2);
}

.topbar-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

/* Buttons */
.btn {
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid transparent;
  font-family: var(--font-sans);
}

.btn-primary {
  background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 100%);
  color: #ffffff;
  box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #1e40af 0%, #1d4ed8 100%);
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.3);
}

.btn-secondary {
  background: var(--bg-surface);
  border-color: var(--border-strong);
  color: var(--text-main);
  box-shadow: var(--shadow-xs);
}

.btn-secondary:hover {
  background: var(--bg-surface-alt);
  border-color: #94a3b8;
  color: var(--brand-navy);
}

.btn-danger {
  background: var(--accent-rose-light);
  border-color: #fecaca;
  color: var(--accent-rose);
  font-weight: 700;
}

.btn-danger:hover {
  background: #fee2e2;
  border-color: #f87171;
}

.content-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px 28px;
}

/* Modules View Switching */
.view-panel {
  display: none;
  animation: fadeIn 0.2s ease forwards;
}

.view-panel.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Common Grid & Cards */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

@media (max-width: 1024px) {
  .grid-2, .grid-3, .grid-4 {
    grid-template-columns: 1fr;
  }
}

.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 20px;
  position: relative;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}

.card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
}

.card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--brand-navy);
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: -0.2px;
}

/* Stat Widgets */
.stat-widget {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 16px 20px;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s;
}

.stat-widget:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}

.stat-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
  font-weight: 700;
}

.stat-val {
  font-size: 24px;
  font-weight: 800;
  color: var(--brand-navy);
  margin-top: 4px;
  font-family: var(--font-mono);
}

.stat-sub {
  font-size: 11px;
  color: var(--accent-emerald);
  margin-top: 3px;
  font-weight: 600;
}

/* Code Display & Terminal */
pre.code-block {
  background: #0f172a;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: #f8fafc;
  overflow-x: auto;
  line-height: 1.6;
}

.code-keyword { color: #f43f5e; font-weight: 600; }
.code-func { color: #38bdf8; }
.code-type { color: #818cf8; }
.code-comment { color: #94a3b8; font-style: italic; }
.code-string { color: #34d399; }

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.badge-emerald { 
  background: var(--accent-emerald-light); 
  color: #065f46; 
  border: 1px solid #a7f3d0; 
}
.badge-amber { 
  background: var(--accent-amber-light); 
  color: #92400e; 
  border: 1px solid #fde68a; 
}
.badge-cyan { 
  background: var(--brand-cobalt-light); 
  color: #1e40af; 
  border: 1px solid #bfdbfe; 
}
.badge-red { 
  background: var(--accent-rose-light); 
  color: #991b1b; 
  border: 1px solid #fecaca; 
}
.badge-purple { 
  background: var(--accent-purple-light); 
  color: #3730a3; 
  border: 1px solid #c7d2fe; 
}

/* Table Styling */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  box-shadow: var(--shadow-xs);
}

table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  background: var(--bg-surface);
}

table.data-table th {
  text-align: left;
  padding: 10px 14px;
  background: var(--bg-surface-alt);
  color: var(--text-secondary);
  font-weight: 700;
  border-bottom: 1px solid var(--border-subtle);
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.4px;
}

table.data-table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-main);
  background: var(--bg-surface);
}

table.data-table tr:last-child td {
  border-bottom: none;
}

table.data-table tr:hover td {
  background: #f8fafc;
}

/* Forms & Inputs */
.form-group {
  margin-bottom: 14px;
}

.form-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 6px;
}

.form-input, .form-select {
  width: 100%;
  padding: 8px 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  color: var(--text-main);
  font-size: 13px;
  outline: none;
  transition: all 0.18s;
  box-shadow: var(--shadow-xs);
  font-family: var(--font-sans);
}

.form-input:focus, .form-select:focus {
  border-color: var(--brand-cobalt);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* Range Slider */
input[type="range"] {
  accent-color: var(--brand-cobalt);
  cursor: pointer;
}

/* Notifications Toast */
#toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--brand-navy);
  border: 1px solid #1e293b;
  padding: 12px 20px;
  border-radius: 8px;
  box-shadow: var(--shadow-xl);
  font-size: 13px;
  color: #ffffff;
  z-index: 9999;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 500;
}

#toast.show {
  transform: translateY(0);
  opacity: 1;
}

/* ==========================================================================
   INSTITUTIONAL GLASS & 3D ELEVATIONS (LIGHT THEME)
   ========================================================================== */
.liquid-glass-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
  transition: all 0.25s ease;
}

.liquid-glass-panel:hover {
  box-shadow: var(--shadow-lg);
  border-color: var(--border-strong);
}

.perspective-vault-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.vault-card-3d {
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 18px;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: var(--shadow-sm);
  position: relative;
}

.vault-card-3d:hover {
  transform: translateY(-3px);
  border-color: #94a3b8;
  box-shadow: var(--shadow-lg);
}

.vault-card-gold {
  border-top: 3px solid var(--accent-amber);
}

.vault-card-gold:hover {
  border-color: var(--accent-amber);
  box-shadow: 0 10px 20px -3px rgba(217, 119, 6, 0.12);
}

.vault-card-cyan {
  border-top: 3px solid var(--brand-cobalt);
}

.vault-card-cyan:hover {
  border-color: var(--brand-cobalt);
  box-shadow: 0 10px 20px -3px rgba(37, 99, 235, 0.12);
}

.vault-card-emerald {
  border-top: 3px solid var(--accent-emerald);
}

.vault-card-emerald:hover {
  border-color: var(--accent-emerald);
  box-shadow: 0 10px 20px -3px rgba(5, 150, 105, 0.12);
}

.vault-card-purple {
  border-top: 3px solid var(--accent-purple);
}

.vault-card-purple:hover {
  border-color: var(--accent-purple);
  box-shadow: 0 10px 20px -3px rgba(79, 70, 229, 0.12);
}

.sub-account-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  background: var(--bg-surface-alt);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

/* Institutional Terminal Console */
.terminal-window {
  background: #0f172a;
  border: 1px solid #1e293b;
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.terminal-header {
  background: #1e293b;
  padding: 8px 14px;
  border-bottom: 1px solid #334155;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.terminal-body {
  padding: 16px;
  color: #38bdf8;
  max-height: 240px;
  overflow-y: auto;
  line-height: 1.6;
  background: #0f172a;
}

.glow-pill-emerald {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent-emerald-light);
  border: 1px solid #a7f3d0;
  color: #065f46;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
}

.glow-pill-cyan {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--brand-cobalt-light);
  border: 1px solid #bfdbfe;
  color: #1e40af;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
}

/* Our Stablecoins & Live Proof */
.uk-stat { background: var(--bg-surface-alt); border: 1px solid var(--border-subtle); border-radius: 8px; padding: 12px 14px; }
.uk-stat-v { font-size: 22px; font-weight: 800; color: var(--brand-navy); font-family: var(--font-mono); }
.uk-stat-l { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
.uk-p { font-size: 13.5px; color: var(--text-secondary); line-height: 1.6; margin-bottom: 12px; }
.uk-dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; font-size: 12.5px; margin: 0; }
.uk-dl dt { color: var(--text-muted); font-weight: 600; }
.uk-dl dd { margin: 0; font-size: 11.5px; font-family: var(--font-mono); word-break: break-all; color: var(--text-main); }
#view-quantum a { color: var(--accent-blue); font-weight: 600; font-size: 13px; }
#view-quantum a.btn-primary { color: #ffffff; }
.uk-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.uk-table th { text-align: left; padding: 8px 10px; color: var(--text-secondary); border-bottom: 2px solid var(--border-strong); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.uk-table td { padding: 8px 10px; border-bottom: 1px solid var(--border-subtle); color: var(--text-main); }
.uk-ok { color: var(--accent-emerald); font-weight: 700; }
.uk-bad { color: var(--accent-rose); font-weight: 700; }
@media (max-width: 700px) { .uk-dl { grid-template-columns: 1fr; } }

/* ==========================================================================
   LIQUID GLASS — Lab shell (tokens + behaviour come from /assets/glass.css + glass.js)
   ========================================================================== */
:root{ --bg-canvas: transparent; --bg-surface-alt: rgba(222,232,245,.62); --border-subtle: rgba(120,140,170,.28); --border-strong: rgba(100,125,165,.42); }
body{ background: transparent; }
.main-viewport{ background: transparent; }
.sidebar{ background: rgba(255,255,255,.6); border-right: 1px solid var(--lg-edge);
  -webkit-backdrop-filter: blur(22px) saturate(170%); backdrop-filter: blur(22px) saturate(170%); box-shadow: 12px 0 40px -24px rgba(20,50,110,.35); }
.topbar{ background: rgba(255,255,255,.58); border-bottom: 1px solid var(--lg-edge);
  -webkit-backdrop-filter: blur(20px) saturate(170%); backdrop-filter: blur(20px) saturate(170%); box-shadow: 0 10px 30px -20px rgba(20,50,110,.4); }
.page-headline{ font-weight: 800; letter-spacing: -.02em; }
.nav-btn{ border-radius: 14px; transition: transform .2s, background .2s, box-shadow .2s; }
.nav-btn:hover{ transform: translateX(3px); background: rgba(255,255,255,.7); }
.nav-btn.active{ background: linear-gradient(180deg,rgba(255,255,255,.95),rgba(225,238,255,.8)); border-color: var(--lg-edge); box-shadow: var(--lg-shadow); }
.nav-icon{ filter: drop-shadow(0 4px 6px rgba(29,95,208,.25)); }
.card, .stat-widget, .table-wrap, .uk-stat{ background: var(--lg-panel); border: 1px solid var(--lg-edge); border-radius: var(--lg-radius);
  -webkit-backdrop-filter: blur(var(--lg-blur)) saturate(170%); backdrop-filter: blur(var(--lg-blur)) saturate(170%); box-shadow: var(--lg-shadow); }
.card{ padding: 22px; transition: transform .35s cubic-bezier(.2,.8,.2,1), box-shadow .35s; }
.card:hover, .stat-widget:hover{ border-color: var(--lg-edge); box-shadow: var(--lg-shadow-hover); }
.uk-stat{ border-radius: 14px; }
.card-header{ border-bottom-color: var(--lg-line); }
.card-title{ font-weight: 800; letter-spacing: -.01em; }
.stat-val, .uk-stat-v{ background: linear-gradient(180deg,#0b1b33,#1d5fd0); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.badge{ border-radius: 999px; padding: 4px 10px; box-shadow: 0 1px 0 rgba(255,255,255,.8) inset; }
.btn{ border-radius: 999px; transition: transform .2s, filter .2s, box-shadow .2s; }
.btn:hover{ transform: translateY(-2px); }
.btn-primary{ border: 1px solid rgba(255,255,255,.55); background: linear-gradient(180deg,#4f93f5 0%,#1d5fd0 55%,#184fb3 100%); text-shadow: 0 1px 1px rgba(10,40,110,.35);
  box-shadow: 0 1px 0 rgba(255,255,255,.55) inset, 0 -2px 6px rgba(10,40,110,.35) inset, 0 10px 22px -8px rgba(29,95,208,.6); }
.btn-primary:hover{ background: linear-gradient(180deg,#5a9cf8 0%,#2467d8 55%,#1b55bd 100%); }
.btn-secondary{ background: rgba(255,255,255,.7); border: 1px solid var(--lg-edge); box-shadow: var(--lg-shadow); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.form-input, .form-select{ background: rgba(255,255,255,.8); border-radius: 12px; box-shadow: 0 2px 6px rgba(20,40,80,.06) inset; }
table.data-table th, .uk-table th{ background: rgba(220,232,248,.6); }
pre.code-block, .terminal-window{ border-radius: 14px; box-shadow: 0 1px 0 rgba(255,255,255,.08) inset, 0 24px 44px -18px rgba(8,20,45,.6); }
.view-panel.active{ animation: lg-view-in .45s cubic-bezier(.2,.8,.2,1); }
@keyframes lg-view-in{ from{ opacity: 0; transform: translateY(14px) scale(.99); } to{ opacity: 1; transform: none; } }
#view-quantum > .card:first-child{ border-left: 0 !important; background: linear-gradient(135deg,rgba(255,255,255,.8),rgba(215,232,255,.6)); }
@media (prefers-reduced-motion: reduce){ .view-panel.active{ animation: none; } .btn:hover, .nav-btn:hover{ transform: none; } }

/* ---------- Phone / tablet layout: sidebar becomes a swipeable tab strip ---------- */
@media (max-width: 900px) {
  html, body { height: auto; overflow: auto; }
  body { display: block; overflow-x: hidden; }
  #app { flex-direction: column; width: 100%; height: auto; min-height: 100vh; }
  .sidebar { width: 100%; min-width: 0; position: sticky; top: 0; z-index: 20; border-right: 0; border-bottom: 1px solid var(--lg-edge); box-shadow: 0 10px 30px -20px rgba(20,50,110,.45); }
  .brand-header { padding: 10px 14px; }
  .brand-subtitle, .sidebar-footer { display: none; }
  .nav-links { display: flex; gap: 6px; overflow-x: auto; overflow-y: hidden; padding: 8px 10px 10px; flex: none; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .nav-links::-webkit-scrollbar { display: none; }
  .nav-item { margin: 0; flex: 0 0 auto; }
  .nav-btn { width: auto; white-space: nowrap; padding: 8px 12px; font-size: 13px; }
  .nav-btn:hover { transform: none; }
  .main-viewport { overflow: visible; min-width: 0; }
  .topbar { height: auto; padding: 10px 14px; flex-wrap: wrap; gap: 8px; }
  .page-headline { font-size: 16px; flex-wrap: wrap; }
  .topbar-actions { flex-wrap: wrap; gap: 8px; }
  .topbar-actions > span { display: none; }
  .content-body { overflow: visible; padding: 14px 12px 90px; }
  .card { padding: 16px; }
  .card-header { flex-wrap: wrap; gap: 8px; }
  .view-panel [style*="display: flex"] { flex-wrap: wrap; }
  .view-panel [style*="max-width: 850px"], .view-panel [style*="max-width: 760px"] { max-width: 100% !important; }
  pre.code-block, .terminal-body { font-size: 11px; }
  #pilot-banner { font-size: 11.5px !important; padding: 7px 10px !important; gap: 8px !important; }
}
.grid-2 > *, .grid-3 > *, .grid-4 > *, .card { min-width: 0; }
pre.code-block { max-width: 100%; }
@media (max-width: 900px) { .view-panel { max-width: 100%; overflow-x: clip; } .view-panel select, .view-panel input { max-width: 100%; } }
@media (max-width: 900px) { #view-contracts [style*="min-width: 260px"] { width: 100% !important; min-width: 0 !important; } #contract-details-view { flex: 1 1 100% !important; min-width: 0; } }
