/* ☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆ */
/* ☆ Author: ☆ MelodyHSong ☆                             */
/* ☆ Language: CSS3                                       */
/* ☆ File Name: css/styles.css                            */
/* ☆ Date: 2026-11-30                                     */
/* ☆                                                      */
/* ☆ Description: Mobile-first Limina Found-Footage Dark  */
/* ☆              & Fluorescent Light theme stylesheet    */
/* ☆              with desktop browser warning gate,      */
/* ☆              viewfinder accents, mobile nav shell,   */
/* ☆              cards, forms, modals, toasts & code UI. */
/* ☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆ */

/* ==========================================================================
   ☆ 1. Design Tokens & Limina Color Palette
   Sampled directly from Limina's camcorder + isometric Backrooms emblem:
   - Slate Chassis: #121519 / #1c2026 / #252a32
   - Wallpaper Yellow: #eed038 / #f7df5e
   - Doorway Amber: #f0790e / #ffae33
   - Camcorder REC Red: #e6392e
   - Phosphor Lime: #a3e635
   - Viewfinder Silver: #cdd2d8
   ========================================================================== */
:root {
  /* Limina Tape Dark Palette (Default) */
  --bg-color: #121519;
  --bg-subtle: #0c0e12;
  --card-bg: #1c2026;
  --surface-bg: #252a32;
  --surface-hover: #313742;
  --header-bg: rgba(18, 21, 25, 0.88);
  --overlay-bg: rgba(8, 10, 13, 0.78);

  --border-color: #363c46;
  --border-subtle: rgba(205, 210, 216, 0.08);
  --bracket-color: rgba(205, 210, 216, 0.58);

  --text-main: #d8dce2;
  --text-heading: #f5f2dc;
  --text-muted: #939aa4;

  /* Backrooms Wallpaper Yellow (Primary Brand Accent) */
  --accent: #eed038;
  --accent-hover: #f7df5e;
  --accent-soft: rgba(238, 208, 56, 0.14);
  --accent-border: rgba(238, 208, 56, 0.4);
  --accent-contrast: #121519;

  /* Glowing Doorway Amber-Orange (Secondary Warm Highlight) */
  --gold: #ff9f2e;
  --gold-deep: #f0790e;
  --gold-soft: rgba(240, 121, 14, 0.16);
  --gold-border: rgba(255, 174, 51, 0.42);

  /* Camcorder REC Red */
  --rec: #e6392e;
  --rec-soft: rgba(230, 57, 46, 0.16);
  --rec-border: rgba(230, 57, 46, 0.45);

  /* Phosphor / Limina Lime (Success & Saved State) */
  --success: #a3e635;
  --success-btn: #527e12;
  --success-btn-hover: #629616;
  --success-soft: rgba(163, 230, 53, 0.14);
  --success-border: rgba(163, 230, 53, 0.38);

  --warning: #ffae33;
  --warning-soft: rgba(255, 174, 51, 0.16);

  --danger: #e6392e;
  --danger-soft: rgba(230, 57, 46, 0.16);

  --code-inline: #ffae33;
  --code-block: #f4e27c;

  /* Subtle Architectural Grid & Scanline Tokens */
  --tile-grid: rgba(205, 210, 216, 0.045);
  --scanline-tint: rgba(0, 0, 0, 0.16);

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

  /* Layout & Spacing */
  --topbar-height: 58px;
  --bottomnav-height: 64px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-pill: 999px;
  --shadow-card: 0 4px 18px rgba(0, 0, 0, 0.42);
  --shadow-float: 0 14px 36px rgba(0, 0, 0, 0.62);

  /* Motion */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --transition-fast: 0.18s ease;
  --transition-med: 0.28s var(--ease-out);

  color-scheme: dark;
}

/* Fluorescent Daylight Theme Override */
[data-theme="light"] {
  --bg-color: #f3efe2;
  --bg-subtle: #e7e1ce;
  --card-bg: #fcfaf1;
  --surface-bg: #ede7d5;
  --surface-hover: #e2dac3;
  --header-bg: rgba(243, 239, 226, 0.9);
  --overlay-bg: rgba(18, 21, 25, 0.56);

  --border-color: #cfc7b0;
  --border-subtle: rgba(28, 32, 38, 0.08);
  --bracket-color: rgba(94, 100, 108, 0.6);

  --text-main: #2a2e35;
  --text-heading: #171a20;
  --text-muted: #5d626b;

  /* Deep Ochre for AA text contrast on warm fluorescent surfaces */
  --accent: #9a7000;
  --accent-hover: #7c5900;
  --accent-soft: rgba(238, 208, 56, 0.24);
  --accent-border: rgba(154, 112, 0, 0.36);
  --accent-contrast: #121519;

  --gold: #c25700;
  --gold-deep: #a54800;
  --gold-soft: rgba(240, 121, 14, 0.12);
  --gold-border: rgba(194, 87, 0, 0.34);

  --rec: #cc2b21;
  --rec-soft: rgba(204, 43, 33, 0.11);
  --rec-border: rgba(204, 43, 33, 0.34);

  --success: #3e6b0a;
  --success-btn: #46780c;
  --success-btn-hover: #3a640a;
  --success-soft: rgba(62, 107, 10, 0.12);
  --success-border: rgba(62, 107, 10, 0.32);

  --warning: #b45309;
  --warning-soft: rgba(180, 83, 9, 0.12);

  --danger: #cc2b21;
  --danger-soft: rgba(204, 43, 33, 0.11);

  --code-inline: #b54d00;
  --code-block: #6e5000;

  --tile-grid: rgba(94, 100, 108, 0.075);
  --scanline-tint: rgba(28, 32, 38, 0.03);

  --shadow-card: 0 2px 10px rgba(28, 32, 38, 0.08);
  --shadow-float: 0 12px 28px rgba(28, 32, 38, 0.18);

  color-scheme: light;
}

/* ==========================================================================
   ☆ 2. Base Reset & Accessibility Utilities
   ========================================================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  width: 100%;
  max-width: 100%;
  font-family: var(--font-sans);
  background-color: var(--bg-color);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100dvh;
  overflow-x: hidden;
  transition: background-color var(--transition-fast), color var(--transition-fast);
}

/* Prevent body scroll when drawer, modal, or desktop gate is active */
body.is-locked {
  overflow: hidden;
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: -100px;
  left: 1rem;
  z-index: 9999;
  background: #eed038;
  color: #121519;
  font-weight: 700;
  padding: 0.6rem 1rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: top var(--transition-fast);
}

.skip-link:focus {
  top: 0.75rem;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ==========================================================================
   ☆ 2.5 Limina Signature Motifs (Viewfinder Brackets & REC Indicator)
   ========================================================================== */
.viewfinder-frame {
  position: relative;
}

/* Four crisp L-shaped camcorder reticle brackets inspired by logo.png */
.viewfinder-frame::after {
  content: "";
  position: absolute;
  inset: 10px;
  pointer-events: none;
  background:
    /* Top-left */
    linear-gradient(var(--bracket-color), var(--bracket-color)) top left / 14px 2px no-repeat,
    linear-gradient(var(--bracket-color), var(--bracket-color)) top left / 2px 14px no-repeat,
    /* Top-right */
    linear-gradient(var(--bracket-color), var(--bracket-color)) top right / 14px 2px no-repeat,
    linear-gradient(var(--bracket-color), var(--bracket-color)) top right / 2px 14px no-repeat,
    /* Bottom-left */
    linear-gradient(var(--bracket-color), var(--bracket-color)) bottom left / 14px 2px no-repeat,
    linear-gradient(var(--bracket-color), var(--bracket-color)) bottom left / 2px 14px no-repeat,
    /* Bottom-right */
    linear-gradient(var(--bracket-color), var(--bracket-color)) bottom right / 14px 2px no-repeat,
    linear-gradient(var(--bracket-color), var(--bracket-color)) bottom right / 2px 14px no-repeat;
  opacity: 0.75;
}

/* Camcorder ● REC pill */
.rec-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.2rem 0.62rem;
  border-radius: var(--radius-pill);
  background: var(--rec-soft);
  border: 1px solid var(--rec-border);
  color: var(--rec);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1;
}

.rec-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--rec);
  box-shadow: 0 0 8px var(--rec);
  animation: rec-blink 1.4s ease-in-out infinite;
}

@keyframes rec-blink {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.35; transform: scale(0.85); }
}

/* ==========================================================================
   ☆ 3. Desktop Browser Warning Gate
   ========================================================================== */
.desktop-gate {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background-color: var(--bg-color);
  background-image:
    /* Warm doorway amber spill & Backrooms fluorescent yellow ambient glow */
    radial-gradient(circle at 22% 18%, rgba(238, 208, 56, 0.14), transparent 44%),
    radial-gradient(circle at 80% 82%, rgba(240, 121, 14, 0.15), transparent 44%),
    /* Subtle floor-tile grid matching the isometric tile floor */
    linear-gradient(to right, var(--tile-grid) 1px, transparent 1px),
    linear-gradient(to bottom, var(--tile-grid) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 34px 34px, 34px 34px;
  overflow-y: auto;
}

.desktop-gate__card {
  width: 100%;
  max-width: 480px;
  background:
    repeating-linear-gradient(
      to bottom,
      transparent 0,
      transparent 3px,
      var(--scanline-tint) 3px,
      var(--scanline-tint) 4px
    ),
    var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2.35rem 2rem 2.1rem;
  text-align: center;
  box-shadow: var(--shadow-float);
  position: relative;
}

.desktop-gate__card::before {
  content: "";
  position: absolute;
  inset: -1px 18% auto 18%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), var(--gold-deep), transparent);
  border-radius: var(--radius-pill);
}

.desktop-gate__hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding: 0 0.25rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.desktop-gate__icon-wrap {
  width: 92px;
  height: 92px;
  margin: 0 auto 1.15rem;
  border-radius: 22px;
  background: var(--bg-subtle);
  border: 1px solid var(--accent-border);
  box-shadow: 0 0 28px rgba(240, 121, 14, 0.16), inset 0 0 0 1px rgba(238, 208, 56, 0.1);
  display: grid;
  place-items: center;
  padding: 6px;
  overflow: hidden;
  animation: limina-float 4s ease-in-out infinite;
}

.desktop-gate__icon-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 16px;
  display: block;
}

.desktop-gate__icon-wrap svg {
  width: 46px;
  height: 46px;
}

@keyframes limina-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

.desktop-gate__badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0.72rem;
  border-radius: var(--radius-pill);
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 0.9rem;
}

.desktop-gate__title {
  color: var(--text-heading);
  font-size: 1.5rem;
  line-height: 1.3;
  margin-bottom: 0.7rem;
}

.desktop-gate__desc {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 1.2rem;
}

.desktop-gate__diagnostics {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1.2rem;
}

.desktop-gate__pill {
  font-family: var(--font-mono);
  font-size: 0.77rem;
  background: var(--surface-bg);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.3rem 0.65rem;
}

.desktop-gate__hint {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-left: 3px solid var(--gold);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  font-size: 0.86rem;
  color: var(--text-muted);
  text-align: left;
  margin-bottom: 1.35rem;
}

.desktop-gate__hint strong {
  color: var(--text-heading);
}

.desktop-gate__actions {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.desktop-gate__footer {
  margin-top: 1.35rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
  font-size: 0.79rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
}

/* Optional Dev Preview Banner & Simulated Mobile Frame on Desktop */
.dev-preview-bar {
  position: sticky;
  top: 0;
  z-index: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.5rem 1rem;
  background: var(--gold-soft);
  border-bottom: 1px solid var(--gold-border);
  color: var(--gold);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.dev-preview-bar button {
  background: var(--card-bg);
  color: var(--text-heading);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.28rem 0.65rem;
  font-size: 0.75rem;
  font-family: var(--font-sans);
  font-weight: 600;
  cursor: pointer;
}

.dev-preview-bar button:hover {
  border-color: var(--accent);
  color: var(--accent);
}

body.is-desktop-preview {
  background-image:
    linear-gradient(to right, var(--tile-grid) 1px, transparent 1px),
    linear-gradient(to bottom, var(--tile-grid) 1px, transparent 1px);
  background-size: 28px 28px;
}

body.is-desktop-preview .app-shell {
  max-width: 430px;
  min-height: 100dvh;
  margin: 0 auto;
  border-left: 1px solid var(--border-color);
  border-right: 1px solid var(--border-color);
  background-color: var(--bg-color);
  box-shadow: var(--shadow-float);
  position: relative;
}

body.is-desktop-preview .bottom-nav {
  max-width: 430px;
  left: 50%;
  transform: translateX(-50%);
  border-left: 1px solid var(--border-color);
  border-right: 1px solid var(--border-color);
}

/* ==========================================================================
   ☆ 4. Mobile App Shell (Top Bar, Main Container, Bottom Tab Bar)
   ========================================================================== */
.app-shell {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
}

.app-topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: calc(var(--topbar-height) + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) 0.85rem 0;
  background: var(--header-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
}

.app-topbar__brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
  text-decoration: none;
  color: var(--text-heading);
}

.app-topbar__logo {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--border-color);
}

.app-topbar__title {
  font-family: var(--font-mono);
  font-size: 1.02rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-topbar__actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-main);
  cursor: pointer;
  transition: background-color var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
}

.icon-btn:hover,
.icon-btn:active {
  background: var(--surface-bg);
  border-color: var(--border-color);
  color: var(--accent);
}

.icon-btn svg {
  width: 22px;
  height: 22px;
}

/* Main Content Area */
.app-main {
  flex: 1;
  padding: 1rem 1rem calc(var(--bottomnav-height) + env(safe-area-inset-bottom) + 1.5rem);
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.app-section {
  scroll-margin-top: calc(var(--topbar-height) + 1rem);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Bottom Tab Navigation Bar */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--header-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--border-color);
  padding-bottom: env(safe-area-inset-bottom);
}

.bottom-nav__list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  max-width: 600px;
  margin: 0 auto;
  height: var(--bottomnav-height);
}

.bottom-nav__link {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.22rem;
  height: 100%;
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 500;
  transition: color var(--transition-fast);
}

.bottom-nav__link svg {
  width: 21px;
  height: 21px;
  transition: transform var(--transition-fast);
}

.bottom-nav__link.is-active {
  color: var(--accent);
  font-weight: 700;
}

.bottom-nav__link.is-active::before {
  content: "";
  position: absolute;
  top: 0;
  width: 34px;
  height: 2.5px;
  border-radius: 0 0 4px 4px;
  background: linear-gradient(90deg, var(--accent), var(--gold));
}

.bottom-nav__link:active svg {
  transform: scale(0.92);
}

/* ==========================================================================
   ☆ 5. Slide-Over Navigation Drawer
   ========================================================================== */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: var(--overlay-bg);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-med);
}

.drawer-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.nav-drawer {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 310;
  width: min(82vw, 310px);
  background: var(--card-bg);
  border-right: 1px solid var(--border-color);
  box-shadow: var(--shadow-float);
  display: flex;
  flex-direction: column;
  padding: calc(env(safe-area-inset-top) + 1rem) 1rem calc(env(safe-area-inset-bottom) + 1rem);
  transform: translateX(-105%);
  transition: transform var(--transition-med);
}

.nav-drawer.is-open {
  transform: translateX(0);
}

.nav-drawer__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 0.85rem;
  margin-bottom: 0.85rem;
  border-bottom: 1px solid var(--border-color);
}

.nav-drawer__brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.nav-drawer__title {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.96rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  line-height: 1.15;
}

.nav-drawer__sub {
  display: block;
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.2;
}

.nav-drawer__links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1;
}

.nav-drawer__links a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0.85rem;
  border-radius: var(--radius-md);
  color: var(--text-main);
  text-decoration: none;
  font-weight: 500;
  min-height: 44px;
  transition: background-color var(--transition-fast), color var(--transition-fast);
}

.nav-drawer__links a svg {
  width: 19px;
  height: 19px;
  flex-shrink: 0;
  opacity: 0.85;
}

.nav-drawer__links a:hover,
.nav-drawer__links a.is-active {
  background: var(--accent-soft);
  color: var(--accent);
  border-left: 2px solid var(--accent);
}

.nav-drawer__footer {
  padding-top: 0.85rem;
  border-top: 1px solid var(--border-color);
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ==========================================================================
   ☆ 6. Cards, Typography, Badges & Reusable Components
   ========================================================================== */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  box-shadow: var(--shadow-card);
}

.card--hero {
  padding: 1.5rem 1.35rem;
  background:
    radial-gradient(circle at 92% 12%, rgba(240, 121, 14, 0.2), transparent 52%),
    radial-gradient(circle at 10% 90%, rgba(238, 208, 56, 0.12), transparent 50%),
    repeating-linear-gradient(
      to bottom,
      transparent 0,
      transparent 3px,
      var(--scanline-tint) 3px,
      var(--scanline-tint) 4px
    ),
    var(--card-bg);
  border-color: var(--accent-border);
}

.hero-hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

h1, h2, h3 {
  color: var(--text-heading);
  line-height: 1.3;
}

h1 {
  font-size: 1.45rem;
  color: var(--accent);
  margin-bottom: 0.45rem;
}

h2 {
  font-size: 1.18rem;
  margin-bottom: 0.5rem;
}

h3 {
  font-size: 1rem;
  margin-bottom: 0.35rem;
}

p {
  margin-bottom: 0.75rem;
}

p:last-child {
  margin-bottom: 0;
}

.text-muted {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.tag-badge {
  display: inline-block;
  background: var(--surface-bg);
  color: var(--accent);
  font-size: 0.75rem;
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
  padding: 0.18rem 0.56rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  margin-bottom: 0.55rem;
}

.hero-hud .tag-badge {
  margin-bottom: 0;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-pill);
  font-size: 0.76rem;
  font-weight: 600;
}

.status-badge--accent {
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid var(--accent-border);
}

.status-badge--success {
  background: var(--success-soft);
  color: var(--success);
  border: 1px solid var(--success-border);
}

.status-badge--gold {
  background: var(--gold-soft);
  color: var(--gold);
  border: 1px solid var(--gold-border);
}

.status-badge--rec {
  background: var(--rec-soft);
  color: var(--rec);
  border: 1px solid var(--rec-border);
}

/* Quick Stat Grid */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

.stat-tile {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.95rem 1rem;
  position: relative;
  overflow: hidden;
}

.stat-tile::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent-border), transparent);
}

.stat-tile__label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.stat-tile__value {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-heading);
}

/* Action Buttons (44px+ Mobile Tap Targets) */
.btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 0.85rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 44px;
  padding: 0.6rem 1.05rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--surface-bg);
  color: var(--text-heading);
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background-color var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast), transform 0.1s ease;
}

.btn:hover {
  background: var(--surface-hover);
  border-color: var(--accent);
}

.btn:active {
  transform: scale(0.98);
}

/* Iconic Backrooms Yellow Primary Button with high-contrast dark ink in both themes */
.btn--primary {
  background: #eed038;
  color: #121519;
  border-color: #d4b520;
  font-weight: 700;
}

.btn--primary:hover {
  background: #f7df5e;
  border-color: #eed038;
  box-shadow: 0 0 16px rgba(238, 208, 56, 0.24);
}

[data-theme="light"] .btn--primary {
  background: #e8c725;
  color: #121519;
  border-color: #bfa114;
}

[data-theme="light"] .btn--primary:hover {
  background: #f2d43e;
  border-color: #9a7000;
}

.btn--success {
  background: var(--success-btn);
  color: #ffffff;
  border-color: rgba(245, 242, 220, 0.14);
}

.btn--success:hover {
  background: var(--success-btn-hover);
  border-color: transparent;
}

.btn--rec {
  background: var(--rec);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.16);
  font-weight: 700;
}

.btn--rec:hover {
  background: #f0473c;
  border-color: transparent;
  box-shadow: 0 0 16px rgba(230, 57, 46, 0.3);
}

.btn--ghost {
  background: transparent;
  color: var(--text-muted);
}

.btn--ghost:hover {
  color: var(--text-heading);
  background: var(--surface-bg);
}

.btn--block {
  width: 100%;
}

/* ==========================================================================
   ☆ 7. Code Blocks & Copy-to-Clipboard
   ========================================================================== */
code {
  font-family: var(--font-mono);
  background: var(--surface-bg);
  color: var(--code-inline);
  padding: 0.12rem 0.38rem;
  border-radius: 4px;
  font-size: 0.86em;
}

.code-block {
  position: relative;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  margin: 0.75rem 0;
  overflow: hidden;
}

.code-block__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.45rem 0.75rem;
  background: var(--surface-bg);
  border-bottom: 1px solid var(--border-color);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 32px;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  border: 1px solid var(--border-color);
  background: var(--card-bg);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color var(--transition-fast), color var(--transition-fast);
}

.copy-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.copy-btn.is-copied {
  border-color: var(--success);
  color: var(--success);
}

.code-block pre {
  padding: 0.85rem;
  overflow-x: auto;
  font-size: 0.84rem;
  line-height: 1.5;
}

.code-block pre code {
  background: none;
  color: var(--code-block);
  padding: 0;
}

/* ==========================================================================
   ☆ 8. Touch-Friendly Forms & Lists
   ========================================================================== */
.form-stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-group label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-heading);
}

/* 16px font-size avoids automatic zoom on iOS Safari focus */
.form-control {
  width: 100%;
  min-height: 44px;
  padding: 0.65rem 0.8rem;
  font-size: 1rem;
  font-family: inherit;
  color: var(--text-main);
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-control:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

textarea.form-control {
  resize: vertical;
  min-height: 92px;
}

.helper-text {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.feature-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-top: 0.5rem;
}

.feature-list li {
  position: relative;
  display: block;
  padding-left: 1.15rem;
  font-size: 0.92rem;
  line-height: 1.62;
  color: var(--text-main);
  overflow-wrap: break-word;
}

.feature-list li strong {
  color: var(--text-heading);
}

.feature-list li::before {
  content: "▸";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--gold);
  font-weight: 700;
}

/* ==========================================================================
   ☆ 9. Modal Dialog & Toast Notifications
   ========================================================================== */
.modal {
  position: fixed;
  inset: 0;
  margin: auto;
  width: min(92vw, 420px);
  max-height: 85dvh;
  padding: 0;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  background: var(--card-bg);
  color: var(--text-main);
  box-shadow: var(--shadow-float);
  overflow: hidden;
}

.modal::backdrop {
  background: var(--overlay-bg);
  backdrop-filter: blur(4px);
}

.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
}

.modal__body {
  padding: 1.25rem;
  overflow-y: auto;
}

.modal__footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
  padding: 0.85rem 1.25rem;
  border-top: 1px solid var(--border-color);
  background: var(--bg-subtle);
}

/* Toast Container (floating above bottom tab bar & desktop gate) */
.toast-region {
  position: fixed;
  left: 50%;
  bottom: calc(var(--bottomnav-height) + env(safe-area-inset-bottom) + 0.85rem);
  transform: translateX(-50%);
  z-index: 1200;
  width: min(92vw, 390px);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.78rem 1rem;
  border-radius: var(--radius-md);
  background: var(--card-bg);
  color: var(--text-heading);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--accent);
  box-shadow: var(--shadow-float);
  font-size: 0.88rem;
  animation: toast-in 0.24s var(--ease-out) forwards;
}

.toast--success { border-left-color: var(--success); }
.toast--warning { border-left-color: var(--warning); }
.toast--danger  { border-left-color: var(--danger); }

.toast__text {
  flex: 1;
  min-width: 0;
}

.toast__action {
  flex-shrink: 0;
  min-height: 32px;
  padding: 0.24rem 0.7rem;
  border-radius: var(--radius-sm);
  border: 1px solid #d4b520;
  background: #eed038;
  color: #121519;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 700;
  cursor: pointer;
}

.toast.is-leaving {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==========================================================================
   ☆ 9.5 Developer Passcode Lock & Protected Panels
   ========================================================================== */
.dev-lock-card {
  text-align: center;
  padding: 1.75rem 1.35rem;
  background:
    radial-gradient(circle at 50% 0%, rgba(230, 57, 46, 0.12), transparent 55%),
    var(--card-bg);
  border-color: var(--border-color);
}

.dev-lock-card__icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 0.9rem;
  border-radius: 14px;
  background: var(--surface-bg);
  border: 1px solid var(--accent-border);
  color: var(--accent);
  display: grid;
  place-items: center;
}

.dev-lock-card__icon svg {
  width: 26px;
  height: 26px;
}

.dev-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 0.75rem;
}

.dev-drawer-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-bottom: 0.65rem;
}

.dev-drawer-btn__left {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.dev-drawer-btn svg {
  width: 17px;
  height: 17px;
}

.dev-state-chip {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.14rem 0.48rem;
  border-radius: var(--radius-pill);
  background: var(--rec-soft);
  color: var(--rec);
  border: 1px solid var(--rec-border);
}

.dev-state-chip.is-unlocked {
  background: var(--success-soft);
  color: var(--success);
  border-color: var(--success-border);
}

.passcode-field {
  position: relative;
  display: flex;
  align-items: center;
}

.passcode-field .form-control {
  padding-right: 3.1rem;
  font-family: var(--font-mono);
  letter-spacing: 0.08em;
}

.passcode-toggle {
  position: absolute;
  right: 4px;
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: color var(--transition-fast), background-color var(--transition-fast);
}

.passcode-toggle:hover {
  color: var(--accent);
  background: var(--surface-bg);
}

.passcode-toggle svg {
  width: 18px;
  height: 18px;
}

.passcode-error {
  margin-top: 0.55rem;
  padding: 0.5rem 0.7rem;
  border-radius: var(--radius-sm);
  background: var(--danger-soft);
  border: 1px solid var(--rec-border);
  color: var(--danger);
  font-family: var(--font-mono);
  font-size: 0.78rem;
}

.modal.is-shaking {
  animation: passcode-shake 0.34s ease;
}

@keyframes passcode-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-7px); }
  40% { transform: translateX(7px); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(5px); }
}

.dev-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  padding: 0.75rem 0.85rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  margin-bottom: 0.75rem;
}

.dev-toggle-row__info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.dev-toggle-row__title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-heading);
}

.dev-toggle-row__desc {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.dev-suite-stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* ==========================================================================
   ☆ 9.75 Limina Camera Studio (Full-Bleed Mobile Layout), FX Lab & Tapes
   ========================================================================== */
.app-shell {
  overflow-x: clip;
}

.app-main--studio {
  padding-top: 0.75rem;
  gap: 0.9rem;
}

/* Full-bleed edge-to-edge camera layout when on the Camera tab */
body.tab-camera .app-main--studio {
  padding: 0 0 calc(var(--bottomnav-height) + env(safe-area-inset-bottom));
  gap: 0;
}

body.tab-camera .app-view--camera {
  display: none;
}

.app-view {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

/* Live WebGL Viewfinder Stage */
.camera-stage {
  position: relative;
  width: 100%;
  height: calc(100dvh - var(--topbar-height) - env(safe-area-inset-top) - var(--bottomnav-height) - env(safe-area-inset-bottom));
  min-height: 440px;
  overflow: hidden;
  background: #07090c;
  user-select: none;
  -webkit-user-select: none;
}

body.is-desktop-preview .camera-stage {
  height: calc(100dvh - var(--topbar-height) - var(--bottomnav-height) - 38px);
}

/* Compact sticky live preview when tuning shaders in FX Lab */
.camera-stage.is-compact {
  position: sticky;
  top: calc(var(--topbar-height) + env(safe-area-inset-top) + 0.5rem);
  z-index: 40;
  height: clamp(180px, 26dvh, 230px);
  min-height: 175px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-float);
}

.camera-stage.is-compact .camera-rail,
.camera-stage.is-compact .camera-bottom-overlay {
  display: none;
}

#glcanvas {
  width: 100% !important;
  height: 100% !important;
  max-width: 100%;
  object-fit: cover;
  display: block;
  background: #07090c;
}

/* Shutter flash animation */
.camera-flash {
  position: absolute;
  inset: 0;
  background: #fffbe6;
  opacity: 0;
  pointer-events: none;
  z-index: 10;
}

.camera-flash.is-flashing {
  animation: shutter-flash 0.26s ease-out forwards;
}

@keyframes shutter-flash {
  0% { opacity: 0.85; }
  100% { opacity: 0; }
}

/* Camcorder Viewfinder HUD Overlay */
.viewfinder-hud {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 0.4rem;
  padding: 0.9rem 1rem;
}

.viewfinder-hud.is-minimal::after,
.viewfinder-hud.is-minimal .hud-chip,
.viewfinder-hud.is-minimal .viewfinder-hud__meta {
  opacity: 0;
}

.viewfinder-hud__top,
.viewfinder-hud__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  transition: opacity var(--transition-fast);
}

.camera-stage.is-compact .viewfinder-hud {
  justify-content: space-between;
}

.hud-chip {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #f5f2dc;
  background: rgba(12, 14, 18, 0.72);
  border: 1px solid rgba(238, 208, 56, 0.38);
  padding: 0.24rem 0.58rem;
  border-radius: var(--radius-sm);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.hud-rec-pill {
  background: rgba(12, 14, 18, 0.78);
  border-color: rgba(205, 210, 216, 0.35);
  color: #cdd2d8;
}

.hud-rec-pill .rec-dot {
  background: #7c828b;
  box-shadow: none;
  animation: none;
}

.hud-rec-pill.is-live {
  background: rgba(230, 57, 46, 0.3);
  border-color: rgba(230, 57, 46, 0.85);
  color: #ffdad6;
}

.hud-rec-pill.is-live .rec-dot {
  background: var(--rec);
  box-shadow: 0 0 10px var(--rec);
  animation: rec-blink 1.05s ease-in-out infinite;
}

.hud-stamp {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  color: rgba(245, 242, 220, 0.82);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9);
}

/* Right Floating Action Rail */
.camera-rail {
  position: absolute;
  top: 4.5rem;
  right: 0.75rem;
  z-index: 7;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
}

.rail-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.22rem;
  border: none;
  background: transparent;
  color: #f5f2dc;
  cursor: pointer;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

.rail-btn__circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(12, 14, 18, 0.62);
  border: 1px solid rgba(245, 242, 220, 0.22);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
  transition: transform 0.12s ease, border-color var(--transition-fast), background-color var(--transition-fast);
}

.rail-btn__circle svg {
  width: 20px;
  height: 20px;
}

.rail-btn:active .rail-btn__circle {
  transform: scale(0.92);
}

.rail-btn.is-off .rail-btn__circle {
  color: var(--text-muted);
  border-color: rgba(205, 210, 216, 0.15);
  background: rgba(12, 14, 18, 0.48);
}

.rail-btn__label {
  font-family: var(--font-mono);
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.95);
}

/* Bottom Floating Overlay Stack */
.camera-bottom-overlay {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 7;
  padding: 2.25rem 0.9rem 0.95rem;
  background: linear-gradient(
    to top,
    rgba(8, 10, 13, 0.92) 0%,
    rgba(8, 10, 13, 0.66) 58%,
    rgba(8, 10, 13, 0) 100%
  );
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
}

.camera-bar-bottom,
.camera-shutter-dock {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

/* Translucent Camera Zoom Slider (unobtrusive when idle, crisp when active) */
.zoom-pill {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: min(230px, 72%);
  padding: 0.28rem 0.65rem 0.28rem 0.45rem;
  border-radius: var(--radius-pill);
  background: rgba(12, 14, 18, 0.58);
  border: 1px solid rgba(245, 242, 220, 0.22);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0.36;
  transition: opacity 0.24s ease, border-color var(--transition-fast), background-color var(--transition-fast);
}

.zoom-pill:hover,
.zoom-pill:focus-within,
.zoom-pill.is-active {
  opacity: 0.96;
  background: rgba(12, 14, 18, 0.82);
  border-color: var(--accent-border);
}

.zoom-pill__readout {
  flex-shrink: 0;
  min-width: 44px;
  min-height: 28px;
  padding: 0.12rem 0.42rem;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(245, 242, 220, 0.2);
  background: rgba(255, 255, 255, 0.08);
  color: #f5f2dc;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  transition: background-color var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
}

.zoom-pill__readout.is-zoomed {
  background: rgba(238, 208, 56, 0.22);
  border-color: var(--accent-border);
  color: #eed038;
}

.zoom-pill__slider {
  flex: 1;
  min-width: 0;
  height: 28px;
  accent-color: #eed038;
  cursor: pointer;
  touch-action: pan-x;
}

/* Horizontal Quick Filter Strip */
.filter-strip {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.45rem;
  overflow-x: auto;
  padding: 0.1rem 0.1rem 0.2rem;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.filter-strip::-webkit-scrollbar {
  display: none;
}

.filter-chip {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 0.34rem 0.82rem;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(245, 242, 220, 0.24);
  background: rgba(18, 21, 25, 0.68);
  color: #f5f2dc;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  cursor: pointer;
  transition: background-color var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
}

.filter-chip.is-active {
  background: #eed038;
  color: #121519;
  border-color: #eed038;
  font-weight: 800;
}

/* Photo / Video Mode Tabs */
.capture-mode-bar {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.18rem;
  border-radius: var(--radius-pill);
  background: rgba(12, 14, 18, 0.68);
  border: 1px solid rgba(245, 242, 220, 0.16);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.mode-tab {
  min-height: 30px;
  padding: 0.22rem 0.85rem;
  border: none;
  border-radius: var(--radius-pill);
  background: transparent;
  color: rgba(245, 242, 220, 0.72);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color var(--transition-fast), color var(--transition-fast);
}

.mode-tab.is-active {
  background: rgba(238, 208, 56, 0.22);
  color: #eed038;
}

.mode-tab[data-capture-mode="video"].is-active {
  background: rgba(230, 57, 46, 0.28);
  color: #ff9a92;
}

.shutter-hint {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.04em;
  color: rgba(245, 242, 220, 0.74);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9);
  margin-top: -0.2rem;
}

/* 3-Slot Centered Shutter Row */
.shutter-row {
  width: 100%;
  max-width: 340px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  justify-items: center;
  gap: 0.75rem;
  padding-top: 0.15rem;
}

.shutter-side-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.28rem;
  border: none;
  background: transparent;
  color: #f5f2dc;
  cursor: pointer;
  padding: 0.2rem 0.4rem;
}

.shutter-side-btn__box {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: rgba(18, 21, 25, 0.74);
  border: 1.5px solid rgba(245, 242, 220, 0.3);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  overflow: hidden;
  transition: transform 0.14s ease, border-color var(--transition-fast);
}

.shutter-side-btn__box svg {
  width: 22px;
  height: 22px;
}

.shutter-side-btn:active .shutter-side-btn__box {
  transform: scale(0.92);
}

.shutter-side-btn__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.shutter-side-btn__thumb.is-pop {
  border-color: #eed038;
  animation: thumb-pop 0.36s var(--ease-out);
}

@keyframes thumb-pop {
  0% { transform: scale(0.75); }
  60% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

.shutter-side-btn__label {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9);
}

/* Tactile Tap-for-Photo / Hold-for-Video Shutter Button */
.shutter-btn {
  position: relative;
  width: 82px;
  height: 82px;
  border-radius: 50%;
  border: none;
  background: transparent;
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
  touch-action: none;
  -webkit-touch-callout: none;
  user-select: none;
  -webkit-user-select: none;
  transition: transform 0.14s ease;
}

.shutter-btn:active,
.shutter-btn.is-holding {
  transform: scale(1.06);
}

.shutter-btn__ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
  pointer-events: none;
}

.shutter-btn__track {
  fill: rgba(12, 14, 18, 0.45);
  stroke: rgba(245, 242, 220, 0.88);
  stroke-width: 4;
  transition: stroke var(--transition-fast);
}

.shutter-btn__progress {
  fill: none;
  stroke: var(--rec);
  stroke-width: 4.5;
  stroke-linecap: round;
  stroke-dasharray: 239;
  stroke-dashoffset: 239;
  transition: stroke-dashoffset 0.12s ease;
}

/* Smooth radial hold-to-record progress fill (matches 360ms hold threshold) */
.shutter-btn.is-holding .shutter-btn__progress {
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 0.36s linear;
}

.shutter-btn__core {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: #f5f2dc;
  box-shadow: 0 0 16px rgba(238, 208, 56, 0.25);
  transition:
    background-color 0.18s ease,
    border-radius 0.2s var(--ease-out),
    width 0.2s var(--ease-out),
    height 0.2s var(--ease-out),
    transform 0.12s ease;
}

.shutter-btn.is-photo-mode:active .shutter-btn__core {
  transform: scale(0.88);
  background: #eed038;
}

.shutter-btn.is-holding .shutter-btn__core {
  background: var(--rec);
  transform: scale(0.84);
}

.shutter-btn.is-video-mode .shutter-btn__core {
  background: var(--rec);
  box-shadow: 0 0 16px rgba(230, 57, 46, 0.45);
}

.shutter-btn.is-recording .shutter-btn__track {
  stroke: rgba(230, 57, 46, 0.45);
}

.shutter-btn.is-recording .shutter-btn__progress {
  stroke-dashoffset: 0;
  transition: none;
}

.shutter-btn.is-recording .shutter-btn__core {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: var(--rec);
  box-shadow: 0 0 18px rgba(230, 57, 46, 0.65);
}

/* Camera Standby / Permission Overlay */
.camera-overlay {
  position: absolute;
  inset: 0;
  z-index: 9;
  display: grid;
  place-items: center;
  padding: 1.25rem;
  background:
    radial-gradient(circle at 50% 25%, rgba(238, 208, 56, 0.12), transparent 55%),
    rgba(12, 14, 18, 0.92);
  text-align: center;
}

.camera-overlay__box {
  max-width: 320px;
}

.camera-overlay__box h2 {
  font-size: 1.12rem;
  margin-bottom: 0.45rem;
}

/* FX Lab Controls & Sliders */
.fx-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.8rem;
}

.saved-badge {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-pill);
  background: var(--success-soft);
  color: var(--success);
  border: 1px solid var(--success-border);
  opacity: 0;
  transition: opacity 0.22s ease;
}

.saved-badge.show {
  opacity: 1;
}

.fx-preset-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.6rem;
}

.fx-preset-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.2rem;
  padding: 0.75rem 0.85rem;
  min-height: 62px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--surface-bg);
  color: var(--text-heading);
  text-align: left;
  cursor: pointer;
  transition: border-color var(--transition-fast), background-color var(--transition-fast), transform 0.1s ease;
}

.fx-preset-card:active {
  transform: scale(0.98);
}

.fx-preset-card__code {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.fx-preset-card__name {
  font-size: 0.88rem;
  font-weight: 700;
}

.fx-preset-card.is-active {
  background: var(--accent-soft);
  border-color: var(--accent);
}

.fx-preset-card.is-active .fx-preset-card__code {
  color: var(--accent);
}

.fx-controls-stack {
  display: flex;
  flex-direction: column;
  gap: 0.95rem;
  margin-top: 0.75rem;
}

.fx-slider-row {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.fx-slider-row__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-heading);
}

.fx-slider-row__val {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent);
  background: var(--surface-bg);
  padding: 0.1rem 0.45rem;
  border-radius: 4px;
  border: 1px solid var(--border-color);
}

.fx-slider {
  width: 100%;
  height: 30px;
  accent-color: #eed038;
  cursor: pointer;
}

/* Session Tapes Gallery */
.view-header-bar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.75rem;
}

.tapes-empty {
  text-align: center;
  padding: 2rem 1.35rem;
}

.tapes-list {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.tape-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.tape-card__media {
  background: #090b0e;
  max-height: 280px;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.tape-card__media video,
.tape-card__media img {
  width: 100%;
  max-height: 280px;
  object-fit: contain;
  display: block;
}

.tape-card__meta {
  padding: 0.9rem 1rem 1rem;
}

.tape-card__title {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-heading);
  word-break: break-all;
}

.tape-card__sub {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

/* Bottom Nav Badge */
.nav-icon-wrap {
  position: relative;
  display: inline-flex;
}

.nav-count-badge {
  position: absolute;
  top: -5px;
  right: -10px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: var(--radius-pill);
  background: var(--rec);
  color: #ffffff;
  font-family: var(--font-mono);
  font-size: 0.64rem;
  font-weight: 700;
  display: grid;
  place-items: center;
  line-height: 1;
}

/* ==========================================================================
   ☆ 9.85 About, User Guide Accordions & License Styles
   ========================================================================== */
.about-hero__brand {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin-bottom: 0.85rem;
}

.about-hero__logo {
  width: 68px;
  height: 68px;
  border-radius: 16px;
  border: 1px solid var(--accent-border);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
  flex-shrink: 0;
  object-fit: cover;
}

.about-hero__subtitle {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0;
}

.about-studio-pill {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.85rem;
  padding: 0.34rem 0.75rem;
  border-radius: var(--radius-pill);
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-main);
}

/* Developer Profile Card */
.dev-profile-card {
  background:
    radial-gradient(circle at 95% 15%, rgba(238, 208, 56, 0.12), transparent 50%),
    var(--card-bg);
}

.dev-profile__top {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.dev-profile__avatar-wrap {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 2px solid var(--accent-border);
  background: var(--surface-bg);
  overflow: hidden;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}

.dev-profile__avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.dev-profile__fallback {
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--accent);
}

.dev-profile__meta {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  min-width: 0;
}

.dev-profile__name {
  margin: 0;
  font-size: 1.12rem;
  color: var(--text-heading);
}

.dev-profile__handle {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent);
}

.dev-profile__role {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--gold);
  line-height: 1.4;
}

.dev-profile__bio {
  margin-top: 0.85rem;
  font-size: 0.92rem;
  line-height: 1.62;
  color: var(--text-main);
}

.doc-accordion-list {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  margin-top: 0.9rem;
}

.doc-accordion {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color var(--transition-fast);
}

.doc-accordion[open] {
  border-color: var(--accent-border);
}

.doc-accordion__summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: 48px;
  padding: 0.75rem 1rem;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-heading);
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}

.doc-accordion__summary::-webkit-details-marker {
  display: none;
}

.doc-accordion__summary::after {
  content: "+";
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--accent);
  flex-shrink: 0;
  transition: transform var(--transition-fast);
}

.doc-accordion[open] .doc-accordion__summary::after {
  content: "−";
}

.doc-accordion__body {
  padding: 0.9rem 1rem 1rem;
  border-top: 1px solid var(--border-color);
  font-size: 0.9rem;
  line-height: 1.65;
  color: var(--text-main);
  background: var(--card-bg);
}

.doc-accordion__body p {
  color: var(--text-main);
  line-height: 1.62;
}

.doc-accordion__body code {
  overflow-wrap: anywhere;
}

.license-summary {
  font-size: 0.9rem;
  line-height: 1.62;
  color: var(--text-main);
}

.license-pre {
  margin: 0;
  padding: 0.95rem 1rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  line-height: 1.64;
  color: var(--text-main);
  white-space: pre-wrap;
  overflow-wrap: break-word;
  word-break: break-word;
  overflow-x: auto;
}

/* Install as Web App Modal Steps */
.install-steps-box {
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
}

.install-steps-box.is-recommended {
  border-color: var(--accent-border);
  background: var(--accent-soft);
}

.install-steps-list {
  margin: 0.35rem 0 0 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--text-main);
}

.install-steps-list strong {
  color: var(--text-heading);
}

/* ==========================================================================
   ☆ 9.95 Seamless Mobile Landscape Orientation Support
   Adapts Camera to a widescreen right-hand shutter dock + left tool rail,
   and splits FX Lab into a side-by-side live preview + shader slider deck.
   ========================================================================== */
@media (orientation: landscape) and (max-height: 580px) {
  :root {
    --topbar-height: 44px;
    --bottomnav-height: 46px;
  }

  .app-topbar {
    padding: env(safe-area-inset-top) max(0.85rem, env(safe-area-inset-right)) 0 max(0.85rem, env(safe-area-inset-left));
  }

  .app-topbar .icon-btn {
    width: 38px;
    height: 38px;
  }

  .app-topbar__logo {
    width: 24px;
    height: 24px;
  }

  .app-topbar__title {
    font-size: 0.92rem;
  }

  /* Slim horizontal bottom nav bar in landscape */
  .bottom-nav {
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
  }

  .bottom-nav__list {
    max-width: 100%;
  }

  .bottom-nav__link {
    flex-direction: row;
    gap: 0.42rem;
    font-size: 0.74rem;
  }

  .bottom-nav__link svg {
    width: 18px;
    height: 18px;
  }

  /* Expand shell cleanly across widescreen mobile viewports */
  body.tab-camera:not(.is-desktop-preview) .app-shell {
    max-width: 100%;
  }

  body:not(.tab-camera):not(.is-desktop-preview) .app-shell {
    max-width: 860px;
  }

  body:not(.tab-camera) .app-main--studio {
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
  }

  /* Full-bleed landscape Camera stage (never overflows short landscape heights) */
  body.tab-camera .camera-stage {
    min-height: 0;
    height: calc(100dvh - var(--topbar-height) - env(safe-area-inset-top) - var(--bottomnav-height) - env(safe-area-inset-bottom));
  }

  /* Safe-area HUD padding clear of notch & right shutter dock */
  body.tab-camera .viewfinder-hud {
    padding:
      0.55rem
      calc(max(0.85rem, env(safe-area-inset-right)) + 114px)
      0.55rem
      max(0.85rem, env(safe-area-inset-left));
  }

  body.tab-camera .viewfinder-hud::after {
    inset: 8px calc(max(0.5rem, env(safe-area-inset-right)) + 108px) 8px max(0.5rem, env(safe-area-inset-left));
  }

  /* Left-edge vertical quick tool rail (Flip / HUD / Mic) */
  .camera-rail {
    top: 52%;
    right: auto;
    left: max(0.7rem, env(safe-area-inset-left));
    transform: translateY(-50%);
    gap: 0.45rem;
  }

  .rail-btn__circle {
    width: 38px;
    height: 38px;
  }

  .rail-btn__circle svg {
    width: 18px;
    height: 18px;
  }

  .rail-btn__label {
    font-size: 0.58rem;
  }

  /* Decouple bottom overlay into bottom-center strip + right-edge shutter dock */
  .camera-bottom-overlay {
    inset: 0;
    padding: 0;
    background: none;
    pointer-events: none;
  }

  .camera-bar-bottom {
    position: absolute;
    left: calc(max(0.7rem, env(safe-area-inset-left)) + 52px);
    right: calc(max(0.75rem, env(safe-area-inset-right)) + 114px);
    bottom: 0;
    width: auto;
    padding: 0.9rem 0.5rem 0.45rem;
    gap: 0.35rem;
    background: linear-gradient(
      to top,
      rgba(8, 10, 13, 0.78) 0%,
      rgba(8, 10, 13, 0) 100%
    );
    pointer-events: auto;
  }

  .zoom-pill {
    width: min(210px, 90%);
    padding: 0.18rem 0.55rem 0.18rem 0.38rem;
  }

  .zoom-pill__slider {
    height: 24px;
  }

  .filter-strip {
    justify-content: center;
    padding: 0 0.1rem;
  }

  .filter-chip {
    min-height: 30px;
    padding: 0.24rem 0.7rem;
    font-size: 0.68rem;
  }

  /* Pro right-edge vertical shutter dock */
  .camera-shutter-dock {
    position: absolute;
    top: 0;
    bottom: 0;
    right: 0;
    width: auto;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.45rem max(0.7rem, env(safe-area-inset-right)) 0.45rem 1rem;
    background: linear-gradient(
      to left,
      rgba(8, 10, 13, 0.9) 0%,
      rgba(8, 10, 13, 0.58) 72%,
      rgba(8, 10, 13, 0) 100%
    );
    pointer-events: auto;
  }

  .capture-mode-bar {
    gap: 0.12rem;
    padding: 0.14rem;
  }

  .mode-tab {
    min-height: 24px;
    padding: 0.14rem 0.52rem;
    font-size: 0.62rem;
  }

  .shutter-hint {
    display: none;
  }

  .shutter-row {
    width: auto;
    max-width: none;
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    gap: 0.4rem;
    padding-top: 0;
  }

  .shutter-btn {
    width: 66px;
    height: 66px;
  }

  .shutter-btn__core {
    width: 46px;
    height: 46px;
  }

  .shutter-btn.is-recording .shutter-btn__core {
    width: 22px;
    height: 22px;
  }

  .shutter-side-btn {
    padding: 0.05rem;
    gap: 0.12rem;
  }

  .shutter-side-btn__box {
    width: 40px;
    height: 40px;
    border-radius: 11px;
  }

  .shutter-side-btn__box svg {
    width: 18px;
    height: 18px;
  }

  .shutter-side-btn__label {
    font-size: 0.58rem;
  }

  /* Side-by-side FX Lab in landscape (live camera left, sliders right) */
  body.tab-fx .app-main--studio {
    display: grid;
    grid-template-columns: minmax(220px, 44%) 1fr;
    align-items: start;
    gap: 0.9rem;
  }

  body.tab-fx .camera-stage.is-compact {
    top: calc(var(--topbar-height) + env(safe-area-inset-top) + 0.55rem);
    height: calc(100dvh - var(--topbar-height) - env(safe-area-inset-top) - var(--bottomnav-height) - env(safe-area-inset-bottom) - 1.35rem);
    min-height: 190px;
  }

  /* Widescreen 2-column Tapes gallery */
  .tapes-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.85rem;
  }
}

/* ==========================================================================
   ☆ 10. Footer & Reduced Motion
   ========================================================================== */
.app-footer {
  text-align: center;
  padding: 1rem 0.5rem 0.25rem;
  color: var(--text-muted);
  font-size: 0.82rem;
  border-top: 1px solid var(--border-color);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
