/* ==========================================================================
   Soundscape Studio - Circadian Design Tokens & Glassmorphic PWA Scaffolding
   Advenire Software Standards (Aligned with Somatic Strings & Dwellscapes)
   ========================================================================== */

:root {
  color-scheme: dark;
  /* Twilight Ember (Default ~590nm / 2200K) */
  --bg: #07090e;
  --card-bg: rgba(18, 23, 34, 0.45);
  --card-active: rgba(28, 36, 52, 0.72);
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --accent: #f59e0b;
  --accent-dim: rgba(245, 158, 11, 0.16);
  --border: rgba(255, 255, 255, 0.08);
  --border-active: rgba(245, 158, 11, 0.55);
}

/* Somatic Strings & Circadian Suite Themes */
body[data-theme="monolith"] {
  --bg: #06090e;
  --card-bg: rgba(14, 22, 33, 0.50);
  --card-active: rgba(18, 28, 44, 0.75);
  --accent: #06b6d4;
  --accent-dim: rgba(6, 182, 212, 0.16);
  --border-active: rgba(6, 182, 212, 0.55);
}

body[data-theme="crimson"] {
  --bg: #080204;
  --card-bg: rgba(28, 10, 14, 0.50);
  --card-active: rgba(38, 14, 20, 0.75);
  --accent: #ef4444;
  --accent-dim: rgba(239, 68, 68, 0.16);
  --border-active: rgba(239, 68, 68, 0.55);
}

body[data-theme="jade"] {
  --bg: #040a06;
  --card-bg: rgba(8, 24, 16, 0.50);
  --card-active: rgba(12, 34, 22, 0.75);
  --accent: #10b981;
  --accent-dim: rgba(16, 185, 129, 0.16);
  --border-active: rgba(16, 185, 129, 0.55);
}

body[data-theme="honey"] {
  --bg: #080703;
  --card-bg: rgba(24, 19, 7, 0.50);
  --card-active: rgba(36, 28, 8, 0.75);
  --accent: #F5B041;
  --accent-dim: rgba(245, 176, 65, 0.16);
  --border-active: rgba(245, 176, 65, 0.55);
}

body[data-theme="wine"] {
  --bg: #050002;
  --card-bg: rgba(22, 3, 10, 0.50);
  --card-active: rgba(36, 5, 15, 0.75);
  --accent: #B3002D;
  --accent-dim: rgba(179, 0, 45, 0.16);
  --border-active: rgba(179, 0, 45, 0.55);
}

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

html {
  overflow-x: hidden;
  max-width: 100vw;
  width: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  padding: calc(env(safe-area-inset-top, 0px) + 20px) 20px calc(115px + env(safe-area-inset-bottom, 16px));
  max-width: 1260px;
  width: 100%;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  position: relative;
  overflow-x: hidden;
  transition: background-color 0.45s ease, color 0.45s ease;
  -webkit-font-smoothing: antialiased;
}

.hidden {
  display: none !important;
}

/* Fullscreen Ambient Canvas */
#visual-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  pointer-events: none;
  z-index: 0;
  opacity: 0.90;
  transition: opacity 0.5s ease;
}

/* Auto-Dismiss Toast Notification Pill */
.toast-msg {
  position: fixed;
  top: max(24px, calc(env(safe-area-inset-top) + 12px));
  left: 50%;
  transform: translateX(-50%) translateY(-60px);
  background: rgba(14, 20, 32, 0.94);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-active);
  color: var(--text);
  padding: 10px 22px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.3px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.75), 0 0 20px var(--accent-dim);
  z-index: 10000;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease, visibility 0.3s ease;
  white-space: nowrap;
  max-width: 92vw;
  overflow: hidden;
  text-overflow: ellipsis;
}
.toast-msg.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  visibility: visible;
}

/* Header & Brand Group */
header {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
  gap: 16px;
  transition: opacity 0.4s ease, border-color 0.4s ease;
}

/* Row 1: Brand Title on Left, Install App & Fullscreen Right-Aligned on Same Row */
.header-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  gap: 12px;
  flex-wrap: wrap;
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1 1 auto;
}

.brand-group > div {
  min-width: 0;
  flex: 1;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  object-fit: cover;
  box-shadow: 0 0 16px var(--accent-dim);
  border: 1px solid rgba(255, 255, 255, 0.14);
  cursor: default;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
  touch-action: none;
  flex-shrink: 0;
}


.brand-title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.patent-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid var(--border-active);
  white-space: nowrap;
  max-width: 100%;
  text-overflow: ellipsis;
  overflow: hidden;
  cursor: help;
  user-select: none;
}

.dock-patent-notice {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.2px;
  white-space: nowrap;
  cursor: help;
}

.brand-title {
  font-size: 19px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 800;
  line-height: 1.2;
}

.subtitle {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.3;
  word-break: break-word;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

/* Inverted Pyramid Controls: Row 1 (3 Visual Pills) over Row 2 (2 Preset/Share Pills) */
.header-controls {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.header-controls-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  width: 100%;
}

/* Selector Pills */
.selector-pill-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(18, 23, 34, 0.65);
  border: 1px solid var(--border-active);
  padding: 6px 13px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  max-width: 100%;
}

.selector-label {
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}

.selector-pill-wrap select {
  background: transparent;
  border: none;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  outline: none;
  cursor: pointer;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

/* Explicit dark background on <option> for Windows Chrome/Edge/Firefox contrast */
.selector-pill-wrap select option {
  background-color: #0f131c;
  color: #f1f5f9;
}

/* Header Action Pill Buttons (Theater, Install App, Fullscreen) */
.btn-theater-toggle,
.glass-pill-btn {
  background: var(--accent-dim);
  border: 1px solid var(--border-active);
  color: var(--accent);
  padding: 6px 14px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  transition: all 0.2s ease;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  touch-action: manipulation;
}
.btn-theater-toggle:hover,
.glass-pill-btn:hover {
  background: var(--accent);
  color: #07090e;
}

.pill-btn-icon {
  width: 14px;
  height: 14px;
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
  stroke: currentColor;
}

.desktop-only-btn {
  display: inline-flex;
}

/* Centered Live Dashboard Status Pill Below Header */
.dashboard-pill-bar {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 18px;
  transition: opacity 0.45s ease, transform 0.45s ease;
}

.top-settings-pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 6px 18px;
  border-radius: 999px;
  background: rgba(14, 19, 29, 0.76);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-active);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.38);
  font-size: 11.5px;
  color: var(--text);
  user-select: none;
  white-space: nowrap;
  max-width: 95vw;
  overflow-x: auto;
  scrollbar-width: none;
}
.top-settings-pill::-webkit-scrollbar {
  display: none;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  flex-shrink: 0;
}

.pill-primary-text {
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.3px;
}

.pill-divider {
  color: var(--text-muted);
  font-size: 9px;
  opacity: 0.7;
}

.pill-secondary-text {
  font-weight: 600;
  color: var(--accent);
}

/* Collapsible Studio Grid & Nav */
.studio-controls-layer {
  position: relative;
  z-index: 2;
  transition: opacity 0.45s ease, transform 0.45s ease;
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* When Theater Mode is ON: lock vertical scroll on tall viewports so iOS status-bar blur never triggers */
@media (min-height: 520px) {
  html:has(body.theater-active),
  body.theater-active {
    overflow: hidden;
    height: 100dvh;
    overscroll-behavior: none;
  }
}

/* When Theater Mode is ON: fade out both dashboard pill and studio cards */
body.theater-active .dashboard-pill-bar,
body.theater-active .studio-controls-layer {
  opacity: 0;
  transform: translateY(24px);
  pointer-events: none;
  height: 0;
  overflow: hidden;
  margin: 0;
  padding: 0;
}

/* Theater Mode Idle Ghost Dim (Matches Somatic Strings 0.18 opacity after 5.5s inactivity; change 0.18 to 0 for complete fade) */
body.theater-active.idle-dim header,
body.theater-active.idle-dim .dock {
  opacity: 0.18;
}

/* Category Nav */
.category-nav {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 16px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.category-nav::-webkit-scrollbar {
  display: none;
}

.cat-btn {
  background: rgba(18, 23, 34, 0.86);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 8px 16px;
  border-radius: 99px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
  touch-action: manipulation;
}
.cat-btn.active {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--accent);
}

/* Ultra-Sheer Glass Sound Cards Grid */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}
.card {
  background: rgba(14, 19, 29, 0.88);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: border-color 0.25s ease, background-color 0.25s ease, box-shadow 0.25s ease;
}
.card.playing {
  border-color: var(--border-active);
  background: var(--card-active);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45), 0 0 20px var(--accent-dim);
}
.card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}
.card-title { font-size: 16px; font-weight: 700; }
.card-sub { font-size: 12px; color: var(--text-muted); margin-top: 3px; line-height: 1.4; }

.play-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent-dim);
  border: 1px solid var(--border-active);
  color: var(--accent);
  font-size: 14px;
  display: grid;
  place-items: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.15s ease;
  touch-action: manipulation;
}
.play-btn:hover { transform: scale(1.05); }
.card.playing .play-btn { background: var(--accent); color: #07090e; font-weight: 900; }

/* Variants Selector */
.variants-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.variant-pill {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 5px 11px;
  border-radius: 8px;
  font-size: 11.5px;
  cursor: pointer;
  transition: all 0.15s ease;
  touch-action: manipulation;
}
.variant-pill:hover,
.variant-pill.active {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--accent);
}
.variant-pill.locked-variant {
  opacity: 0.85;
}

/* Sliders */
.slider-row {
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--text-muted);
}
input[type=range] {
  width: 100%;
  accent-color: var(--accent);
  height: 6px;
  padding: 8px 0;
  margin-top: 2px;
  cursor: pointer;
  touch-action: pan-y;
  background: transparent;
}
input[type=range]::-webkit-slider-runnable-track {
  height: 5px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.16);
}
input[type=range]::-webkit-slider-thumb {
  margin-top: -5px;
}
input[type=range]::-moz-range-track {
  height: 5px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.16);
}
input[type=range]::-moz-range-progress {
  height: 5px;
  border-radius: 99px;
  background: var(--accent);
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .card {
    background: rgba(14, 19, 29, 0.92);
  }
  .card.playing {
    background: rgba(22, 30, 44, 0.96);
  }
}

/* Fixed Bottom Master Dock (3-Column Grid so Privacy | Advenire Software -> is True Center) */
.dock {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(11, 14, 20, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--border-active);
  padding: 12px 24px calc(12px + env(safe-area-inset-bottom, 0px));
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 100;
  transition: all 0.35s ease;
}

body.theater-active .dock {
  bottom: max(20px, calc(14px + env(safe-area-inset-bottom, 0px)));
  left: 50%;
  right: auto;
  transform: translateX(-50%);
  border-radius: 999px;
  border: 1px solid var(--border-active);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.75), 0 0 24px var(--accent-dim);
  padding: 10px 20px;
  width: auto;
  max-width: 94vw;
}

.dock-inner {
  max-width: 1260px;
  margin: 0 auto;
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 14px;
}

body.theater-active .dock-inner {
  display: flex;
  width: auto;
  flex-wrap: nowrap;
  gap: 12px;
}

/* Left Zone: Desktop Keyboard Shortcuts */
.dock-left {
  display: flex;
  align-items: center;
  justify-self: start;
}

/* Center Zone: Centered Privacy | Advenire Software -> Links */
.dock-center {
  display: flex;
  align-items: center;
  justify-content: center;
  justify-self: center;
}

/* Hide Left & Center Zones in Theater Mode */
body.theater-active .dock-left,
body.theater-active .dock-center {
  display: none !important;
}

.footer-shortcuts {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.shortcut-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--text-muted);
}

.shortcut-item kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 5px;
  padding: 2px 6px;
  line-height: 1.2;
}

.dock-links {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 11.5px;
  color: var(--text-muted);
}

.dock-links a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 700;
  font-size: 11.5px;
  white-space: nowrap;
}
.dock-links a:hover {
  text-decoration: underline;
}

.dock-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  justify-self: end;
}

body.theater-active .dock-actions {
  flex-wrap: nowrap;
  gap: 12px;
  justify-self: center;
}

.master-vol-group {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.master-vol-group input[type=range] {
  width: 100px;
  margin-top: 0;
}

.btn-return-studio {
  display: none;
  background: var(--accent);
  border: none;
  color: #07090e;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  touch-action: manipulation;
}
body.theater-active .btn-return-studio {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.btn-stop-all {
  background: rgba(239, 68, 68, 0.16);
  border: 1px solid rgba(239, 68, 68, 0.45);
  color: #fca5a5;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 12px;
  cursor: pointer;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.2s ease;
  touch-action: manipulation;
}
.btn-stop-all:hover {
  background: rgba(239, 68, 68, 0.28);
}

/* Cross-Platform PWA Install Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  height: 100dvh;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.modal-overlay.show {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.modal-card {
  background: #0d131f;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 20px;
  max-width: 440px;
  width: 100%;
  padding: 26px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.9);
  color: #fff;
  display: flex;
  flex-direction: column;
}

.modal-card h3 {
  font-size: 18px;
  margin-bottom: 8px;
  color: #fff;
  font-weight: 800;
}

.modal-card p {
  font-size: 12.5px;
  color: #94a3b8;
  line-height: 1.5;
  margin-bottom: 14px;
}

.install-steps-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 8px 0 18px 0;
  text-align: left;
}

.install-step-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 12px;
  line-height: 1.4;
  color: #f1f5f9;
}

.install-step-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent);
  color: #07090e;
  font-weight: 800;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.btn-got-it {
  background: var(--accent);
  color: #07090e;
  border: none;
  border-radius: 999px;
  padding: 10px 20px;
  font-size: 12.5px;
  font-weight: 800;
  cursor: pointer;
  width: 100%;
}

/* Mobile & Tablet Responsive Rules */
@media (max-width: 900px) {
  .dock-left {
    display: none !important;
  }
  .dock-inner {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 8px;
  }
  .dock-center,
  .dock-actions {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 768px) {
  .desktop-only-btn {
    display: none !important;
  }

  .header-top-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .brand-group {
    width: 100%;
  }

  .top-actions {
    width: 100%;
    margin-left: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 8px;
  }

  .header-controls,
  .header-controls-row {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .btn-theater-toggle,
  #btn-mix-studio {
    width: 100%;
    justify-content: center;
  }

  .selector-pill-wrap {
    width: 100%;
    justify-content: space-between;
  }

  .selector-pill-wrap select {
    font-size: 16px;
    flex: 1;
    text-align: right;
  }

  body.theater-active .dock {
    padding: 9px 14px;
    width: auto;
    max-width: 95vw;
  }

  body.theater-active .dock-inner {
    flex-direction: row;
  }

  body.theater-active .dock-actions {
    width: auto;
    gap: 8px;
  }

  body.theater-active .master-vol-group input[type=range] {
    width: 72px;
  }

  body.theater-active .btn-return-studio,
  body.theater-active .btn-stop-all {
    padding: 7px 12px;
    font-size: 11.5px;
  }

  body {
    padding-bottom: calc(135px + env(safe-area-inset-bottom, 16px));
  }
}

/* ==========================================================================
   v23.26 - Studio Signature Protocols Bar, One-Tap Launch Card & Mix Studio
   ========================================================================== */

.pill-preview-timer {
  font-weight: 800;
  color: #38bdf8;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  background: rgba(56, 189, 248, 0.14);
  border: 1px solid rgba(56, 189, 248, 0.42);
  padding: 2px 9px;
  border-radius: 999px;
}

.pill-preview-timer.fading {
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.16);
  border-color: rgba(245, 158, 11, 0.55);
}

/* Signature Protocols Quick-Launch Bar */
.protocols-quick-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 12px;
  margin-bottom: 4px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.protocols-quick-bar::-webkit-scrollbar {
  display: none;
}

.protocol-bar-label {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}

.protocol-pill-btn {
  background: rgba(18, 23, 34, 0.68);
  border: 1px solid var(--border-active);
  color: var(--text);
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: transform 0.2s ease, border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
  touch-action: manipulation;
  flex-shrink: 0;
}
.protocol-pill-btn:hover {
  transform: translateY(-1px);
  border-color: var(--accent);
  box-shadow: 0 4px 16px var(--accent-dim);
}
.protocol-pill-btn.active {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 0 18px var(--accent-dim);
}

.protocol-pill-tag {
  font-size: 9.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--accent);
}

/* One-Tap Deep-Link Launch Card */
.preset-launch-card {
  max-width: 480px;
  text-align: center;
  align-items: center;
  border: 1px solid var(--border-active);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.92), 0 0 36px var(--accent-dim);
}

.preset-launch-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--accent-dim);
  border: 1px solid var(--border-active);
  color: var(--accent);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: 999px;
  margin-bottom: 12px;
}

.preset-launch-env {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--accent);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.10);
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 12px;
}

.preset-launch-stems {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin-bottom: 18px;
  width: 100%;
}

.preset-stem-chip {
  font-size: 11px;
  font-weight: 600;
  color: #e2e8f0;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 4px 10px;
  border-radius: 8px;
}
.preset-stem-chip.premium {
  border-color: var(--border-active);
  color: var(--accent);
}

.preset-launch-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.preset-launch-primary-btn {
  padding: 13px 20px;
  font-size: 13.5px;
  letter-spacing: 0.3px;
  box-shadow: 0 6px 22px var(--accent-dim);
}

.preset-launch-secondary-row {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  width: 100%;
}
.preset-launch-secondary-row .glass-pill-btn {
  flex: 1;
  justify-content: center;
}

.preset-launch-ghost-btn {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.14);
  color: #cbd5e1;
}

/* Mix Studio Modal (Save, Share, Safe 2-Step Delete) */
.mix-studio-card {
  max-width: 500px;
  max-height: 88dvh;
  overflow-y: auto;
}

.mix-studio-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.10);
  margin-bottom: 16px;
}

.mix-studio-section {
  padding-bottom: 16px;
  margin-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.mix-studio-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  font-weight: 700;
  color: #e2e8f0;
  margin-bottom: 6px;
}

.mix-char-counter {
  font-size: 11px;
  font-weight: 600;
  color: #94a3b8;
  font-family: ui-monospace, monospace;
}

.mix-studio-input {
  width: 100%;
  padding: 11px 14px;
  background: #070a12;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  color: #fff;
  font-size: 16px; /* Prevents iOS Safari zoom on input focus */
  outline: none;
  margin-bottom: 10px;
}
.mix-studio-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 12px var(--accent-dim);
}

.mix-current-summary {
  font-size: 11.5px;
  color: #94a3b8;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 8px 12px;
  margin-bottom: 12px;
  line-height: 1.45;
}

.mix-studio-btn-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.saved-mixes-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 230px;
  overflow-y: auto;
}

.saved-mix-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 12px;
  padding: 10px 12px;
  flex-wrap: wrap;
}

.saved-mix-info {
  min-width: 0;
  flex: 1;
}

.saved-mix-title {
  font-size: 13px;
  font-weight: 700;
  color: #f8fafc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.saved-mix-meta {
  font-size: 11px;
  color: #94a3b8;
  margin-top: 2px;
}

.saved-mix-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.btn-mix-item-act {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #e2e8f0;
  font-size: 11px;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn-mix-item-act:hover {
  background: var(--accent);
  color: #07090e;
  border-color: var(--accent);
}

.btn-mix-delete-step1 {
  background: rgba(239, 68, 68, 0.10);
  border: 1px solid rgba(239, 68, 68, 0.30);
  color: #fca5a5;
  font-size: 11px;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 8px;
  cursor: pointer;
}
.btn-mix-delete-step1:hover {
  background: rgba(239, 68, 68, 0.22);
}

.btn-mix-delete-confirm {
  background: #ef4444;
  border: 1px solid #f87171;
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
  padding: 5px 11px;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.45);
}

.btn-mix-delete-cancel {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #cbd5e1;
  font-size: 11px;
  font-weight: 700;
  padding: 5px 9px;
  border-radius: 8px;
  cursor: pointer;
}

/* ==========================================================================
   v23.36 - HARDWARE UNLOCK START GATE & 1-TAP STUDIO SIGNATURE LAUNCH PILLS
   ========================================================================== */
#start-gate {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  background: radial-gradient(circle at 50% 44%, rgba(16, 23, 38, 0.96) 0%, #05070c 78%);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  z-index: 9800;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  cursor: pointer;
  transition: opacity 0.55s ease, visibility 0.55s ease;
  touch-action: manipulation;
  overflow-y: auto;
}

#start-gate.dismissed {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.gate-logo-box {
  width: 68px;
  height: 68px;
  border-radius: 18px;
  background: var(--accent-dim);
  border: 1px solid var(--border-active);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
  box-shadow: 0 0 36px var(--accent-dim);
}

.gate-studio-kicker {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 2.2px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 6px;
}

.gate-title {
  font-size: 27px;
  font-weight: 800;
  letter-spacing: 2.2px;
  text-transform: uppercase;
  color: #ffffff;
  margin-bottom: 8px;
  text-shadow: 0 0 24px var(--accent-dim);
}

.gate-desc {
  font-size: 13px;
  color: var(--text-muted);
  max-width: 460px;
  line-height: 1.55;
  margin-bottom: 20px;
}

.gate-enter-btn {
  background: var(--accent) !important;
  color: #07090e !important;
  border: none !important;
  border-radius: 999px !important;
  font-weight: 800 !important;
  padding: 13px 34px !important;
  font-size: 13.5px !important;
  letter-spacing: 0.5px !important;
  cursor: pointer;
  box-shadow: 0 0 28px var(--accent-dim), 0 8px 24px rgba(0, 0, 0, 0.75) !important;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.gate-enter-btn:hover {
  transform: translateY(-1.5px);
}

.gate-signature-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
  max-width: 540px;
  width: 100%;
}

.gate-signature-prompt {
  font-size: 11.5px;
  font-weight: 700;
  color: #cbd5e1;
  letter-spacing: 0.3px;
}

.gate-signature-pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  width: 100%;
}

.gate-signature-pill {
  background: rgba(18, 24, 38, 0.85);
  border: 1px solid var(--border-active);
  color: var(--text);
  padding: 8px 15px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.2px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.22s ease;
  touch-action: manipulation;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.6);
  font-family: inherit;
}

.gate-signature-pill:hover {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1.5px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.75), 0 0 14px var(--accent-dim);
}

/* Mix Studio: Paste / Import Shared Link Row (Standalone PWA Deep-Link Bridge) */
.mix-import-row {
  display: flex;
  align-items: stretch;
  gap: 8px;
  width: 100%;
}

.mix-import-input {
  flex: 1 1 auto;
  min-width: 0;
  margin-bottom: 0 !important;
}

.mix-import-btn {
  flex-shrink: 0;
  padding: 0 16px;
  border-radius: 12px;
  justify-content: center;
  font-weight: 800;
}

@media (max-width: 480px) {
  .mix-import-row {
    flex-direction: column;
  }
  .mix-import-btn {
    padding: 10px 16px;
    width: 100%;
  }
}
/* ==========================================================================
   v23.57 — Mobile Dock Overflow Fix, Studio Resource Strip
            & Standalone Home-Screen PWA Navigation Safeguard
   ========================================================================== */

/* Hide external SEO/Tool navigation links inside Standalone Installed Home Screen PWA
   so installed users never get trapped in a chromeless window without a back button,
   while keeping 100% of links visible in the raw HTML DOM for Google, Bing & LLMs */
@media (display-mode: standalone) {
  .web-seo-only {
    display: none !important;
  }
}

.dock-patent-short {
  display: none;
}

/* Fix iPhone / Narrow Viewport .dock-links Horizontal Clipping */
.dock-links {
  flex-wrap: wrap;
  row-gap: 4px;
  column-gap: 7px;
  text-align: center;
  max-width: 100%;
}

@media (max-width: 640px) {
  .dock {
    padding: 10px 14px calc(10px + env(safe-area-inset-bottom, 0px));
  }
  .dock-patent-full {
    display: none;
  }
  .dock-patent-short {
    display: inline;
  }
  .dock-links,
  .dock-links a,
  .dock-patent-notice {
    font-size: 10.5px;
  }
}

/* In-Studio Bottom Resource & Comparison Strip (Below #cards-grid) */
.studio-resources-strip {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.studio-resource-card {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 16px 18px;
  border-radius: 16px;
  background: rgba(14, 19, 29, 0.78);
  border: 1px solid var(--border);
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.22s ease, transform 0.22s ease, box-shadow 0.22s ease;
}

.studio-resource-card:hover {
  border-color: var(--border-active);
  transform: translateY(-1.5px);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.45), 0 0 18px var(--accent-dim);
}

.studio-resource-kicker {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.9px;
  text-transform: uppercase;
  color: var(--accent);
}

.studio-resource-title {
  font-size: 13.5px;
  font-weight: 700;
  color: #f8fafc;
  line-height: 1.35;
}

.studio-resource-sub {
  font-size: 11.5px;
  color: var(--text-muted);
  line-height: 1.45;
}

@media (max-width: 768px) {
  .studio-resources-strip {
    grid-template-columns: 1fr;
  }
}
