:root {
  --bg-deep: #010a04;
  --glass-bg: rgba(2, 18, 9, 0.80);
  --glass-card: rgba(3, 22, 11, 0.84);
  --neon: #00ff88;
  --neon-bright: #3dffaa;
  --neon-dim: rgba(0, 255, 136, 0.26);
  --gold: #ffd470;
  --text-main: #eafff2;
  --text-sub: #88d8ad;
  --danger: #ff4d6a;
  --warn: #ffb84d;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg-deep);
  color: var(--text-main);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Inter', sans-serif;
  font-size: 15px;
}

.hidden { display: none !important; }
.mt-8 { margin-top: 8px; }
.full-w { width: 100%; }
.row-gap-6 { display: flex; align-items: center; gap: 6px; }

/* Background Sanctum + Matrix Rain */
#sanctum-bg-layer {
  position: fixed;
  inset: 0;
  z-index: 0;
  background-size: cover;
  background-position: center 22%;
  filter: brightness(0.72) contrast(1.08) saturate(1.15);
  pointer-events: none;
}

#rain-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  opacity: 0.24;
  mix-blend-mode: screen;
  pointer-events: none;
}

.screen-vignette {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: radial-gradient(circle at 50% 24%, rgba(0, 255, 136, 0.08) 0%, rgba(1, 10, 4, 0.72) 85%);
}

/* Boot & Lock Screen */
.boot-screen {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 28px;
  text-align: center;
  background: radial-gradient(circle at center, rgba(3, 28, 14, 0.94), rgba(1, 8, 4, 0.98));
  backdrop-filter: blur(12px);
}

.boot-portal {
  position: relative;
  width: 104px;
  height: 104px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
}

.boot-ring {
  position: absolute;
  border-radius: 50%;
  border: 2px solid var(--neon);
  box-shadow: 0 0 18px rgba(0, 255, 136, 0.45);
}
.boot-ring-outer { inset: 0; border-style: dashed; animation: spinSlow 9s linear infinite; }
.boot-ring-inner { inset: 14px; border-color: var(--gold); animation: spinSlow 5s linear infinite reverse; }
.boot-glyph { font-size: 34px; filter: drop-shadow(0 0 12px var(--neon)); }

.boot-title {
  font-family: 'Consolas', monospace;
  font-size: 24px;
  letter-spacing: 4px;
  color: var(--neon-bright);
  text-shadow: 0 0 14px rgba(0, 255, 136, 0.55);
  margin-bottom: 10px;
}

.boot-sub {
  color: var(--text-sub);
  font-size: 14px;
  max-width: 310px;
  line-height: 1.45;
  margin-bottom: 18px;
}

@keyframes spinSlow { to { transform: rotate(360deg); } }

/* App Shell Layout */
.app-shell {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  padding-top: calc(max(var(--safe-top), var(--tg-safe-area-inset-top, 0px)) + var(--tg-content-safe-area-inset-top, 0px));
}

/* Top HUD Bar */
.hud-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 10px;
  background: linear-gradient(180deg, rgba(1, 20, 10, 0.94), rgba(1, 14, 7, 0.80));
  border-bottom: 1px solid var(--neon-dim);
  backdrop-filter: blur(10px);
  flex-shrink: 0;
  overflow: hidden;
}

.hud-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
}

.hud-brand-text {
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--neon);
  box-shadow: 0 0 10px var(--neon);
  flex-shrink: 0;
}
.status-dot.busy { background: var(--gold); box-shadow: 0 0 12px var(--gold); animation: pulseDot 1s infinite alternate; }
@keyframes pulseDot { from { opacity: 0.45; } to { opacity: 1; } }

.hud-title {
  font-family: 'Consolas', monospace;
  font-weight: 700;
  font-size: 13.5px;
  letter-spacing: 1.2px;
  color: #e4ffee;
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  overflow: hidden;
}

.role-badge {
  font-size: 9.5px;
  padding: 1px 5px;
  border-radius: 99px;
  border: 1px solid rgba(255, 212, 112, 0.55);
  color: var(--gold);
  background: rgba(255, 212, 112, 0.12);
  letter-spacing: 0.6px;
  flex-shrink: 0;
}

.hud-subtitle {
  font-size: 11px;
  color: var(--text-sub);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
  width: 100%;
}

.hud-top-actions {
  display: flex;
  align-items: center;
  gap: 5px;
  flex: 0 0 auto;
}

.top-chip {
  padding: 5px 8px !important;
  font-size: 11.5px !important;
}

/* Atena 3D / Portrait Stage */
.atena-stage {
  position: relative;
  width: 100%;
  height: 215px;
  flex-shrink: 0;
  overflow: hidden;
  border-bottom: 1px solid rgba(0, 255, 136, 0.22);
  background: radial-gradient(circle at 50% 54%, rgba(0, 255, 136, 0.16) 0%, rgba(1, 12, 6, 0.42) 78%);
  transition: height 0.28s cubic-bezier(0.22, 1, 0.36, 1);
  touch-action: none;
}

.atena-stage.compact { height: 82px; }

/* Minimalist Full-Screen Mode (Chat pulled down & hidden) */
body.chat-minimized .atena-stage {
  flex: 1 1 auto;
  height: auto !important;
  border-bottom: none;
}
body.chat-minimized .tab-viewport {
  display: none !important;
}

.minimal-dock {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 12;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  border-radius: 99px;
  background: rgba(1, 18, 9, 0.78);
  border: 1px solid rgba(0, 255, 136, 0.42);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.55), 0 0 16px rgba(0, 255, 136, 0.18);
  backdrop-filter: blur(12px);
}

.minimal-pill-btn {
  padding: 8px 16px;
  border-radius: 99px;
  border: 1px solid rgba(0, 255, 136, 0.38);
  background: rgba(0, 255, 136, 0.14);
  color: var(--text-main);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.minimal-mic-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--gold);
  background: rgba(255, 212, 112, 0.16);
  color: var(--text-main);
  font-size: 17px;
  cursor: pointer;
}
.minimal-mic-btn.recording {
  background: rgba(255, 77, 106, 0.35);
  border-color: var(--danger);
  box-shadow: 0 0 16px rgba(255, 77, 106, 0.75);
  animation: pulseDot 0.6s infinite alternate;
}

.webgl-container {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 3;
}

.portrait-fallback {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  transition: opacity 0.35s ease;
}
.portrait-fallback.faded { opacity: 0; }

.portrait-halo {
  width: 138px;
  height: 138px;
  border-radius: 50%;
  padding: 3px;
  background: conic-gradient(from 0deg, var(--neon), var(--gold), var(--neon));
  box-shadow: 0 0 24px rgba(0, 255, 136, 0.38);
  transition: transform 0.18s ease, box-shadow 0.18s ease, width 0.25s ease, height 0.25s ease;
}
.atena-stage.compact .portrait-halo { width: 62px; height: 62px; }
body.chat-minimized .portrait-halo { width: 220px; height: 220px; }
.portrait-halo.speaking {
  transform: scale(1.05);
  box-shadow: 0 0 32px rgba(0, 255, 170, 0.85), 0 0 14px var(--gold);
}

.portrait-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 14%;
  border-radius: 50%;
  background: #03150b;
}

.glb-cache-badge {
  position: absolute;
  right: 8px;
  bottom: 6px;
  z-index: 5;
  font-size: 10.5px;
  padding: 2px 8px;
  border-radius: 99px;
  background: rgba(0, 18, 9, 0.82);
  border: 1px solid var(--neon-dim);
  color: var(--text-sub);
}

/* Active Job Queue Banner */
.job-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: rgba(255, 212, 112, 0.13);
  border-bottom: 1px solid rgba(255, 212, 112, 0.42);
  color: var(--gold);
  font-size: 12.5px;
  flex-shrink: 0;
}

.job-spinner {
  width: 13px;
  height: 13px;
  border: 2px solid rgba(255, 212, 112, 0.3);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spinSlow 0.8s linear infinite;
  flex-shrink: 0;
}

/* Main Tab Viewport */
.tab-viewport {
  flex: 1;
  min-height: 0;
  position: relative;
  overflow: hidden;
}

.tab-panel {
  display: none;
  width: 100%;
  height: 100%;
  overflow-y: auto;
  padding: 10px 10px 16px;
  -webkit-overflow-scrolling: touch;
}
.tab-panel.active { display: block; }

#panel-chat.active {
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
}

/* Chat Tab */
.chat-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 5px 8px;
  background: rgba(1, 16, 8, 0.80);
  border-bottom: 1px solid rgba(0, 255, 136, 0.16);
  flex-shrink: 0;
  overflow: hidden;
}
.chat-room-info {
  display: flex;
  align-items: center;
  gap: 5px;
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
}
.chat-quick-btns {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
}
.scope-select {
  max-width: 158px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 4px 6px !important;
  font-size: 11.5px !important;
}
.bar-chip {
  padding: 4px 7px !important;
  font-size: 11.5px !important;
}
.icon-chip {
  padding: 4px 6px !important;
  min-width: 28px;
  text-align: center;
}

.sync-pill {
  font-size: 11px;
  padding: 3px 7px;
  border-radius: 99px;
  background: rgba(0, 255, 136, 0.12);
  border: 1px solid rgba(0, 255, 136, 0.35);
  color: var(--neon-bright);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  -webkit-overflow-scrolling: touch;
}

.msg-bubble {
  max-width: 87%;
  padding: 10px 13px;
  border-radius: 14px;
  font-size: 14.5px;
  line-height: 1.46;
  word-wrap: break-word;
  backdrop-filter: blur(8px);
}

.msg-user {
  align-self: flex-end;
  background: linear-gradient(135deg, rgba(0, 110, 58, 0.88), rgba(0, 74, 40, 0.92));
  border: 1px solid rgba(0, 255, 136, 0.48);
  border-bottom-right-radius: 4px;
  color: #f2fff7;
}

.msg-assistant {
  align-self: flex-start;
  background: rgba(3, 22, 12, 0.90);
  border: 1px solid rgba(0, 255, 136, 0.28);
  border-bottom-left-radius: 4px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
}

.msg-sender {
  font-size: 10.5px;
  font-family: 'Consolas', monospace;
  letter-spacing: 0.8px;
  color: var(--gold);
  margin-bottom: 4px;
}

.msg-inline-img {
  width: 100%;
  max-width: 260px;
  border-radius: 10px;
  margin-top: 8px;
  border: 1px solid var(--neon-dim);
  cursor: pointer;
  display: block;
}

.attach-drawer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 10px;
  background: rgba(0, 38, 19, 0.92);
  border-top: 1px solid var(--neon-dim);
  font-size: 12.5px;
}
.attach-info { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1; }
.attach-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--gold); }

.chat-composer {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  padding: 8px 9px;
  background: rgba(1, 18, 9, 0.95);
  border-top: 1px solid var(--neon-dim);
  flex-shrink: 0;
}

.composer-icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--neon-dim);
  background: rgba(0, 255, 136, 0.09);
  color: var(--text-main);
  font-size: 17px;
  flex-shrink: 0;
  cursor: pointer;
}
.mic-btn.recording {
  background: rgba(255, 77, 106, 0.28);
  border-color: var(--danger);
  box-shadow: 0 0 14px rgba(255, 77, 106, 0.65);
  animation: pulseDot 0.6s infinite alternate;
}

.chat-textarea {
  flex: 1;
  min-height: 38px;
  max-height: 110px;
  padding: 8px 11px;
  border-radius: 11px;
  border: 1px solid rgba(0, 255, 136, 0.32);
  background: rgba(0, 10, 5, 0.85);
  color: var(--text-main);
  font-size: 16px; /* Prevents iOS WebView auto-zoom */
  font-family: inherit;
  resize: none;
  outline: none;
}
.chat-textarea:focus, .cyber-textarea:focus, .cyber-input:focus {
  border-color: var(--neon);
  box-shadow: 0 0 10px rgba(0, 255, 136, 0.22);
}

.composer-send-btn {
  width: 40px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--neon);
  background: linear-gradient(135deg, #00d46a, #008f47);
  color: #001509;
  font-size: 17px;
  font-weight: 800;
  flex-shrink: 0;
  cursor: pointer;
}

/* Cards, Buttons & Inputs */
.cyber-card {
  background: var(--glass-card);
  border: 1px solid var(--neon-dim);
  border-radius: 13px;
  padding: 12px;
  margin-bottom: 11px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35), inset 0 0 14px rgba(0, 255, 136, 0.03);
  backdrop-filter: blur(10px);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.card-title {
  font-family: 'Consolas', monospace;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--neon-bright);
  letter-spacing: 0.6px;
}

.chip-btn {
  padding: 5px 10px;
  border-radius: 8px;
  border: 1px solid var(--neon-dim);
  background: rgba(0, 255, 136, 0.08);
  color: var(--text-main);
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
}
.chip-btn.active {
  background: rgba(0, 255, 136, 0.22);
  border-color: var(--neon);
  color: var(--neon-bright);
}
.file-label { display: inline-flex; align-items: center; }

.cyber-btn {
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid rgba(0, 255, 136, 0.35);
  background: rgba(0, 255, 136, 0.10);
  color: var(--text-main);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
}
.cyber-btn:active { transform: scale(0.97); }
.cyber-btn.primary {
  background: linear-gradient(135deg, rgba(0, 220, 115, 0.92), rgba(0, 145, 76, 0.95));
  border-color: var(--neon-bright);
  color: #01190b;
  font-weight: 700;
}
.cyber-btn.warn { border-color: rgba(255, 184, 77, 0.55); color: var(--warn); }
.cyber-btn.danger { border-color: rgba(255, 77, 106, 0.55); color: #ff8da1; }

.icon-btn {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid var(--neon-dim);
  background: rgba(0, 255, 136, 0.1);
  color: var(--text-main);
  cursor: pointer;
}
.icon-btn.danger { border-color: rgba(255, 77, 106, 0.5); color: #ff8da1; }

.cyber-textarea, .cyber-input, .cyber-select {
  width: 100%;
  padding: 9px 11px;
  border-radius: 10px;
  border: 1px solid rgba(0, 255, 136, 0.30);
  background: rgba(0, 10, 5, 0.85);
  color: var(--text-main);
  font-size: 16px;
  font-family: inherit;
  outline: none;
}
.cyber-select.compact { width: auto; padding: 4px 8px; font-size: 12px; }
.num-in { max-width: 92px; }

.selector-group { margin-top: 9px; }
.selector-label { display: block; font-size: 11.5px; color: var(--text-sub); margin-bottom: 5px; }
.selector-row-2col { display: grid; grid-template-columns: 1.25fr 0.85fr; gap: 8px; }
.selector-row-action { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-top: 10px; }

.pill-row { display: flex; flex-wrap: wrap; gap: 5px; }
.pill-row.scrollable { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 6px; margin-bottom: 8px; }

.pill-opt {
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid rgba(0, 255, 136, 0.24);
  background: rgba(0, 25, 12, 0.72);
  color: var(--text-sub);
  font-size: 12.5px;
  cursor: pointer;
  white-space: nowrap;
}
.pill-opt.active {
  background: rgba(0, 255, 136, 0.24);
  border-color: var(--neon);
  color: #ffffff;
  font-weight: 600;
}

/* Gallery Grid */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.gal-card {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(0, 255, 136, 0.25);
  background: #021208;
  aspect-ratio: 3 / 4;
  cursor: pointer;
}
.gal-card img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gal-meta {
  position: absolute;
  inset: auto 0 0 0;
  padding: 5px 7px;
  background: linear-gradient(transparent, rgba(0, 8, 4, 0.92));
  font-size: 11px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* PC Gauges & Grids */
.gauges-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 7px;
}
.gauge-box {
  background: rgba(0, 14, 7, 0.82);
  border: 1px solid rgba(0, 255, 136, 0.24);
  border-radius: 10px;
  padding: 8px 4px;
  text-align: center;
}
.g-lbl { font-size: 10.5px; color: var(--text-sub); font-family: 'Consolas', monospace; }
.g-val { font-size: 16px; font-weight: 700; color: var(--neon-bright); margin-top: 2px; }
.g-sub { font-size: 10.5px; color: var(--gold); }

.disks-bar { margin-top: 8px; font-size: 12px; color: var(--text-sub); display: flex; flex-direction: column; gap: 4px; }

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

.screen-result { margin-top: 10px; }
.screen-preview-img {
  width: 100%;
  border-radius: 9px;
  border: 1px solid var(--neon-dim);
  margin-bottom: 8px;
  cursor: pointer;
}

/* Hub & Admin Lists */
.inline-form { display: flex; gap: 7px; align-items: center; }
.stack-list { display: flex; flex-direction: column; gap: 7px; }

.list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 10px;
  border-radius: 9px;
  background: rgba(0, 14, 7, 0.78);
  border: 1px solid rgba(0, 255, 136, 0.18);
  font-size: 13.5px;
}
.item-sub { font-size: 11px; color: var(--text-sub); margin-top: 2px; }

.user-admin-card {
  padding: 10px;
  border-radius: 10px;
  background: rgba(0, 15, 8, 0.85);
  border: 1px solid rgba(0, 255, 136, 0.24);
}
.user-admin-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.perm-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}
.perm-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px;
  border-radius: 8px;
  background: rgba(0, 28, 14, 0.65);
  border: 1px solid rgba(0, 255, 136, 0.20);
  font-size: 11.5px;
  cursor: pointer;
}
.perm-toggle.on { border-color: var(--neon); color: #ffffff; background: rgba(0, 255, 136, 0.18); }

.hint-text { font-size: 12.5px; color: var(--text-sub); line-height: 1.4; }
.mono-note { font-family: 'Consolas', monospace; font-size: 11.5px; color: var(--gold); word-break: break-all; }
.invite-box { margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--neon-dim); }
.expenses-summary { font-size: 13.5px; color: var(--gold); line-height: 1.45; }

/* Markdown formatting */
.markdown-body { font-size: 14px; line-height: 1.5; word-break: break-word; }
.markdown-body.compact-text { font-size: 13px; max-height: 170px; overflow-y: auto; }
.markdown-body .md-h {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--neon-bright);
  margin: 6px 0 3px;
}
.markdown-body .md-li {
  padding-left: 12px;
  position: relative;
  margin: 2px 0;
}
.markdown-body .md-li::before {
  content: '•';
  position: absolute;
  left: 1px;
  color: var(--neon);
}
.markdown-body pre {
  background: rgba(0, 8, 4, 0.92);
  border: 1px solid var(--neon-dim);
  padding: 8px;
  border-radius: 8px;
  overflow-x: auto;
  font-family: 'Consolas', monospace;
  font-size: 12.5px;
  margin: 6px 0;
}
.markdown-body code {
  font-family: 'Consolas', monospace;
  background: rgba(0, 255, 136, 0.12);
  padding: 1px 4px;
  border-radius: 4px;
  word-break: break-all;
}

/* iOS Standalone Install Modal */
.ios-modal {
  position: fixed;
  inset: 0;
  z-index: 115;
  background: rgba(0, 8, 4, 0.86);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}
.ios-modal-card {
  width: 100%;
  max-width: 360px;
  background: rgba(2, 22, 11, 0.97);
  border: 1px solid var(--neon);
  border-radius: 16px;
  padding: 15px;
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.7), 0 0 22px rgba(0, 255, 136, 0.22);
}
.ios-steps {
  margin: 10px 0 4px 18px;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--text-main);
}
.ios-steps li { margin-bottom: 5px; }

/* Bottom Navigation */
.bottom-nav {
  display: flex;
  align-items: stretch;
  justify-content: space-around;
  padding-bottom: var(--safe-bottom);
  background: rgba(1, 16, 8, 0.96);
  border-top: 1px solid rgba(0, 255, 136, 0.30);
  flex-shrink: 0;
}

.nav-item {
  flex: 1;
  padding: 7px 4px;
  background: none;
  border: none;
  color: var(--text-sub);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  cursor: pointer;
}
.nav-item.active {
  color: var(--neon-bright);
  text-shadow: 0 0 10px rgba(0, 255, 136, 0.6);
}
.nav-ico { font-size: 18px; }
.nav-lbl { font-size: 11px; font-weight: 600; }

/* Fullscreen Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 6, 3, 0.96);
  display: flex;
  flex-direction: column;
  padding: calc(10px + var(--safe-top)) 12px calc(12px + var(--safe-bottom));
}
.lightbox-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.lb-title { font-size: 13px; color: var(--text-sub); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 82%; }
.lightbox-media-wrap {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lb-img, .lb-video { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 10px; }
.lightbox-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  justify-content: center;
  margin-top: 10px;
}

/* Toast */
.toast {
  position: fixed;
  bottom: calc(68px + var(--safe-bottom));
  left: 50%;
  transform: translateX(-50%);
  z-index: 120;
  padding: 8px 15px;
  border-radius: 99px;
  background: rgba(1, 26, 13, 0.96);
  border: 1px solid var(--neon);
  color: #ffffff;
  font-size: 13px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.55);
  max-width: 90vw;
  text-align: center;
}
