/* Jitso Studio — Modern Creator Toolchain Site Styles
   Palettes mirror the desktop app's ⚙ Settings ▸ 🎨 Appearance themes.
   Includes modern responsive layout, interactive widgets, and auth portal. */

/* ---------- Palettes ---------- */

:root,
[data-palette="mocha"] {
  --base:    #1e1e2e;
  --mantle:  #181825;
  --crust:   #11111b;
  --surface: #313244;
  --surface-hover: #45475a;
  --line:    #45475a;
  --text:    #cdd6f4;
  --subtext: #a6adc8;
  --dim:     #6c7086;
  --blue:    #89b4fa;
  --mauve:   #cba6f7;
  --pink:    #f5c2e7;
  --green:   #a6e3a1;
  --peach:   #fab387;
  --red:     #f38ba8;
  --yellow:  #f9e2af;
  --cyan:    #94e2d5;
  --glow:    rgba(137, 180, 250, 0.25);
  --shadow:  0 24px 60px -20px rgba(0, 0, 0, 0.75);
}

[data-palette="tokyo"] {
  --base: #1a1b26; --mantle: #16161e; --crust: #0f0f14; --surface: #292e42; --surface-hover: #3b4261;
  --line: #3b4261; --text: #c0caf5; --subtext: #9aa5ce; --dim: #565f89;
  --blue: #7aa2f7; --mauve: #bb9af7; --pink: #ff9e64; --green: #9ece6a; --peach: #e0af68;
  --red: #f7768e; --yellow: #e0af68; --cyan: #7dcfff; --glow: rgba(122, 162, 247, 0.25);
}

[data-palette="onedark"] {
  --base: #282c34; --mantle: #21252b; --crust: #1b1e24; --surface: #3e4451; --surface-hover: #4b5263;
  --line: #4b5263; --text: #c8ced9; --subtext: #949cab; --dim: #5c6370;
  --blue: #61afef; --mauve: #c678dd; --pink: #e06c75; --green: #98c379; --peach: #d19a66;
  --red: #e06c75; --yellow: #e5c07b; --cyan: #56b6c2; --glow: rgba(97, 175, 239, 0.25);
}

[data-palette="dracula"] {
  --base: #282a36; --mantle: #21222c; --crust: #191a21; --surface: #44475a; --surface-hover: #6272a4;
  --line: #565a71; --text: #f8f8f2; --subtext: #a9adc8; --dim: #6272a4;
  --blue: #8be9fd; --mauve: #bd93f9; --pink: #ff79c6; --green: #50fa7b; --peach: #ffb86c;
  --red: #ff5555; --yellow: #f1fa8c; --cyan: #8be9fd; --glow: rgba(189, 147, 249, 0.25);
}

[data-palette="nord"] {
  --base: #2e3440; --mantle: #2a2f3a; --crust: #242933; --surface: #3b4252; --surface-hover: #434c5e;
  --line: #4c566a; --text: #eceff4; --subtext: #b9c0cc; --dim: #4c566a;
  --blue: #88c0d0; --mauve: #b48ead; --pink: #d08770; --green: #a3be8c; --peach: #ebcb8b;
  --red: #bf616a; --yellow: #ebcb8b; --cyan: #8fbcbb; --glow: rgba(136, 192, 208, 0.25);
}

[data-palette="gruvbox"] {
  --base: #282828; --mantle: #1f1f1f; --crust: #181818; --surface: #3c3836; --surface-hover: #504945;
  --line: #504945; --text: #ebdbb2; --subtext: #bdae93; --dim: #7c6f64;
  --blue: #83a598; --mauve: #d3869b; --pink: #fe8019; --green: #b8bb26; --peach: #fabd2f;
  --red: #fb4934; --yellow: #fabd2f; --cyan: #8ec07c; --glow: rgba(131, 165, 152, 0.25);
}

[data-palette="solarized"] {
  --base: #002b36; --mantle: #00252e; --crust: #001f27; --surface: #073642; --surface-hover: #0e4b5c;
  --line: #16515e; --text: #eee8d5; --subtext: #93a1a1; --dim: #586e75;
  --blue: #268bd2; --mauve: #6c71c4; --pink: #d33682; --green: #859900; --peach: #b58900;
  --red: #dc322f; --yellow: #b58900; --cyan: #2aa198; --glow: rgba(38, 139, 210, 0.25);
}

[data-palette="synthwave"] {
  --base: #262335; --mantle: #1e1b2b; --crust: #171423; --surface: #34294f; --surface-hover: #483b6e;
  --line: #4b3a70; --text: #f4eefc; --subtext: #b9a7d6; --dim: #67568c;
  --blue: #36f9f6; --mauve: #ff7edb; --pink: #fede5d; --green: #72f1b8; --peach: #ff8b39;
  --red: #fe4450; --yellow: #fede5d; --cyan: #36f9f6; --glow: rgba(255, 126, 219, 0.3);
}

[data-palette="carbon"] {
  --base: #161616; --mantle: #101010; --crust: #0a0a0a; --surface: #262626; --surface-hover: #333333;
  --line: #393939; --text: #f4f4f4; --subtext: #a8a8a8; --dim: #6f6f6f;
  --blue: #78a9ff; --mauve: #be95ff; --pink: #ff7eb6; --green: #42be65; --peach: #ff832b;
  --red: #fa4d56; --yellow: #f1c21b; --cyan: #08bdba; --glow: rgba(120, 169, 255, 0.25);
}

[data-palette="latte"] {
  --base: #eff1f5; --mantle: #e6e9ef; --crust: #dce0e8; --surface: #ccd0da; --surface-hover: #bcc0cc;
  --line: #bcc0cc; --text: #4c4f69; --subtext: #6c6f85; --dim: #8c8fa1;
  --blue: #1e66f5; --mauve: #8839ef; --pink: #ea76cb; --green: #40a02b; --peach: #fe640b;
  --red: #d20f39; --yellow: #df8e1d; --cyan: #04a5e5; --glow: rgba(30, 102, 245, 0.2);
  --shadow: 0 24px 60px -24px rgba(76, 79, 105, 0.25);
}

/* ---------- Base & Reset ---------- */

* { box-sizing: border-box; }

img {
  max-width: 100%;
  height: auto;
}

html, body {
  scrollbar-width: thin;
  scrollbar-color: var(--surface-hover) var(--mantle);
}

/* ---------- Theme-Aware Custom Scrollbar ---------- */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--mantle);
}

::-webkit-scrollbar-thumb {
  background: var(--surface-hover);
  border-radius: 5px;
  border: 2px solid var(--mantle);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--line);
}

::-webkit-scrollbar-corner {
  background: var(--mantle);
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 85px;
}

body {
  margin: 0;
  background: var(--base);
  color: var(--text);
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, "Inter", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background 0.3s ease, color 0.3s ease;
  overflow-x: hidden;
}

a { color: var(--blue); text-decoration: none; transition: color 0.2s ease; }
a:hover { color: var(--mauve); text-decoration: none; }

/* ---------- Accessible Skip Navigation Link (WCAG 2.1 SC 2.4.1) ---------- */
.skip-link {
  position: fixed;
  top: -100px;
  left: 1.5rem;
  z-index: 100000;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.4rem;
  background: var(--base);
  color: var(--blue);
  border: 2px solid var(--blue);
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.75), 0 0 16px var(--glow);
  transition: top 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.skip-link:focus,
.skip-link:focus-visible {
  top: 1.25rem;
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}

/* ---------- Global High-Visibility Keyboard Focus Indicators (WCAG 2.1 SC 2.4.7) ---------- */
:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible,
[role="button"]:focus-visible,
[role="tab"]:focus-visible,
.btn:focus-visible,
.hero-vtab:focus-visible,
.framing-mode-btn:focus-visible,
.machine-tab-btn:focus-visible,
.auth-tab-btn:focus-visible,
.judge-inspect-tab:focus-visible,
.game-tag-pill:focus-visible,
.shortcuts-pill:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}

main:focus,
main:focus-visible,
[tabindex="-1"]:focus,
[tabindex="-1"]:focus-visible {
  outline: none;
}

h1, h2, h3, h4, h5 {
  line-height: 1.2;
  margin: 0;
  letter-spacing: -0.025em;
  color: var(--text);
  font-weight: 700;
}

p { margin: 0 0 1rem; }
p:last-child { margin-bottom: 0; }

.wrap {
  width: 100%;
  max-width: 1240px;
  margin-inline: auto;
  padding-inline: 1.5rem;
}

/* ---------- Typography & Utility ---------- */

.grad {
  background: linear-gradient(135deg, var(--blue) 0%, var(--mauve) 50%, var(--pink) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mauve);
  margin-bottom: 0.75rem;
}

.section-head {
  text-align: center;
  max-width: 800px;
  margin: 0 auto 3.5rem;
}

.section-head h2 {
  font-size: clamp(2rem, 3.8vw, 2.75rem);
  margin-bottom: 1rem;
}

.section-head p {
  color: var(--subtext);
  font-size: 1.15rem;
}

/* ---------- Buttons & Badges ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.4rem;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  border: 1px solid transparent;
  text-decoration: none !important;
}

.btn-primary {
  background: linear-gradient(135deg, var(--blue), var(--mauve));
  color: #11111b;
  font-weight: 700;
  box-shadow: 0 4px 18px var(--glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px var(--glow);
  filter: brightness(1.08);
}

.btn-ghost {
  background: var(--surface);
  color: var(--text);
  border-color: var(--line);
}

.btn-ghost:hover {
  background: var(--surface-hover);
  color: var(--text);
  border-color: var(--mauve);
  transform: translateY(-1px);
}

.btn-sm {
  padding: 0.45rem 0.9rem;
  font-size: 0.85rem;
  border-radius: 8px;
}

.btn-icon {
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 8px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line);
}

.badge.primary { background: rgba(137, 180, 250, 0.15); color: var(--blue); border-color: rgba(137, 180, 250, 0.3); }
.badge.success { background: rgba(166, 227, 161, 0.15); color: var(--green); border-color: rgba(166, 227, 161, 0.3); }
.badge.warn    { background: rgba(249, 226, 175, 0.15); color: var(--yellow); border-color: rgba(249, 226, 175, 0.3); }
.badge.error, .badge.danger { background: rgba(243, 139, 168, 0.15); color: var(--red); border-color: rgba(243, 139, 168, 0.3); }
.badge.purple { background: rgba(203, 166, 247, 0.15); color: var(--mauve); border-color: rgba(203, 166, 247, 0.3); }
.badge.info { background: rgba(137, 220, 235, 0.15); color: var(--sky); border-color: rgba(137, 220, 235, 0.3); }

/* ---------- Navigation Header ---------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(17, 17, 27, 0.82);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
  transition: all 0.2s ease;
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text) !important;
}

.brand img {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  box-shadow: 0 0 12px var(--glow);
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.brand-sub {
  font-size: 0.75rem;
  color: var(--subtext);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.75rem;
}

.nav-links a {
  position: relative;
  color: var(--subtext);
  font-size: 0.92rem;
  font-weight: 500;
  padding: 0.35rem 0.1rem;
  transition: color 0.2s ease;
}

.nav-links a:hover {
  color: var(--text);
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--blue), var(--mauve));
  border-radius: 2px;
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease, box-shadow 0.25s ease;
  opacity: 0;
}

.nav-links a:hover::after {
  transform: scaleX(0.5);
  opacity: 0.5;
}

.nav-links a.active {
  color: var(--blue);
  font-weight: 600;
}

.nav-links a.active::after {
  transform: scaleX(1);
  opacity: 1;
  box-shadow: 0 0 10px var(--glow);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

/* Nav Toggle Button */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  padding: 0;
  color: var(--text);
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.nav-toggle:hover {
  background: var(--surface-hover);
  border-color: var(--blue);
}

.nav-toggle-bar {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease, background 0.2s ease;
}

.nav-toggle.open .nav-toggle-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle.open .nav-toggle-bar:nth-child(2) {
  opacity: 0;
}

.nav-toggle.open .nav-toggle-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ---------- Mobile Drawer Navigation ---------- */
body.drawer-open {
  overflow: hidden;
}

.mobile-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 16, 0.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 998;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mobile-drawer-overlay.open {
  opacity: 1;
  visibility: visible;
}

.mobile-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 320px;
  max-width: 85vw;
  height: 100vh;
  height: 100dvh;
  background: var(--mantle);
  border-left: 1px solid var(--line);
  box-shadow: -10px 0 40px rgba(0, 0, 0, 0.6);
  z-index: 999;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 1.25rem 1.5rem 2rem;
}

.mobile-drawer.open {
  transform: translateX(0);
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 1.25rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--line);
}

.drawer-close {
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--subtext);
  width: 36px;
  height: 36px;
  border-radius: 8px;
  font-size: 1.4rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.drawer-close:hover {
  background: var(--surface-hover);
  color: var(--text);
  border-color: var(--red);
}

/* Mobile Drawer Authentication Controls */
.drawer-auth-area {
  padding-bottom: 1.25rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}

.drawer-auth-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}

.drawer-auth-btn {
  justify-content: center;
  min-height: 44px; /* Touch-friendly target size */
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0.5rem 0.75rem;
  white-space: nowrap;
}

.drawer-user-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  transition: all 0.2s ease;
}

.drawer-user-card:hover {
  border-color: var(--blue);
  background: var(--surface-hover);
}

.drawer-user-pill {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex: 1;
  cursor: pointer;
  min-height: 44px; /* Touch-friendly target */
  min-width: 0;
}

.drawer-user-details {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.drawer-user-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.drawer-logout-btn {
  padding: 0.4rem 0.75rem;
  font-size: 0.8rem;
  color: var(--subtext);
  min-height: 38px;
  flex-shrink: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.drawer-logout-btn:hover {
  color: var(--red);
  border-color: var(--red);
  background: rgba(243, 139, 168, 0.1);
}

.drawer-links {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  flex: 1;
}

.drawer-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-radius: 10px;
  color: var(--text) !important;
  font-weight: 600;
  font-size: 0.98rem;
  transition: all 0.2s ease;
  background: transparent;
  border: 1px solid transparent;
}

.drawer-link:hover {
  background: var(--surface);
  border-color: var(--line);
  color: var(--blue) !important;
  transform: translateX(4px);
}

.drawer-link.active {
  background: var(--surface);
  border-color: rgba(137, 180, 250, 0.4);
  color: var(--blue) !important;
  box-shadow: 0 0 12px var(--glow);
}

.drawer-icon {
  font-size: 1.1rem;
  width: 24px;
  text-align: center;
  flex-shrink: 0;
}

.drawer-actions {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* User Pill in Navbar */
.user-pill {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.85rem;
  border-radius: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  cursor: pointer;
  transition: all 0.2s ease;
}

.user-pill:hover {
  border-color: var(--blue);
  background: var(--surface-hover);
}

.user-avatar-tiny {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), var(--mauve));
  color: #11111b;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
}

/* ---------- Hero Section ---------- */

.hero {
  padding: 5.5rem 0 3.5rem;
  position: relative;
  overflow: hidden;
}

.hero-glow {
  position: absolute;
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  width: 700px;
  height: 450px;
  background: radial-gradient(circle, var(--glow) 0%, transparent 70%);
  filter: blur(60px);
  pointer-events: none;
  z-index: 0;
}

.hero-centered {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 960px;
  margin: 0 auto;
}

.hero-tagline {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.35rem 1rem;
  border-radius: 999px;
  background: var(--mantle);
  border: 1px solid var(--line);
  font-size: 0.88rem;
  color: var(--subtext);
  margin-bottom: 1.75rem;
}

.hero-tagline .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}

.hero h1 {
  font-size: clamp(2.5rem, 5.5vw, 4.2rem);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 1.4rem;
}

.hero-lede {
  font-size: clamp(1.1rem, 2vw, 1.3rem);
  color: var(--subtext);
  max-width: 780px;
  margin: 0 auto 2.2rem;
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.hero-fine {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.75rem;
  color: var(--dim);
  font-size: 0.88rem;
  flex-wrap: wrap;
  margin-bottom: 3.5rem;
}

.hero-visual-card {
  background: var(--mantle);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 0.5rem;
  box-shadow: var(--shadow);
  position: relative;
}

.hero-visual-tabs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.5rem 0.75rem;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
}

.hero-vtab {
  background: transparent;
  border: none;
  color: var(--subtext);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.hero-vtab.active {
  background: var(--surface);
  color: var(--blue);
}

.hero-visual-frame {
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  overflow: hidden;
  background: #000;
  line-height: 0;
}

.hero-visual-frame img {
  width: 100%;
  height: auto;
  display: block;
}

/* ---------- Stat Strip ---------- */

.strip {
  background: var(--mantle);
  border-block: 1px solid var(--line);
  padding: 2.2rem 0;
}

.strip-inner {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 1.5rem;
  text-align: center;
}

.strip-item b {
  display: block;
  font-size: 2.4rem;
  font-weight: 800;
  line-height: 1;
  color: var(--blue);
  margin-bottom: 0.35rem;
}

.strip-item span {
  font-size: 0.88rem;
  color: var(--subtext);
}

/* ---------- Pipeline / Workflow ---------- */

.pipeline-section {
  padding: 5rem 0;
}

.pipeline-image-card {
  aspect-ratio: 16 / 9;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  margin-top: 2rem;
  background: var(--mantle);
}

.pipeline-image-card picture,
.pipeline-image-card img {
  width: 100%;
  height: auto;
  display: block;
}

.pipe-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-top: 2.5rem;
}

.pipe-card {
  background: var(--mantle);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.5rem;
  transition: all 0.25s ease;
}

.pipe-card:hover {
  transform: translateY(-3px);
  border-color: var(--mauve);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.pipe-step-badge {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--blue);
  margin-bottom: 0.5rem;
}

.pipe-card h4 {
  font-size: 1.15rem;
  margin-bottom: 0.5rem;
}

.pipe-card p {
  font-size: 0.9rem;
  color: var(--subtext);
}

/* ---------- Six Studios Section ---------- */

.studios-section {
  padding: 5.5rem 0;
  background: var(--mantle);
  border-block: 1px solid var(--line);
}

.studio-showcase {
  display: flex;
  flex-direction: column;
  gap: 4.5rem;
}

.studio-row {
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: 3rem;
  align-items: center;
}

.studio-row.flip {
  grid-template-columns: 1.25fr 1fr;
}

.studio-row.flip .studio-copy {
  order: 2;
}

.studio-row.flip .studio-media {
  order: 1;
}

.studio-copy .tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.75rem;
  border-radius: 8px;
  background: var(--surface);
  color: var(--blue);
  font-size: 0.82rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.studio-copy h3 {
  font-size: clamp(1.6rem, 2.5vw, 2.2rem);
  margin-bottom: 1rem;
}

.studio-copy p {
  color: var(--subtext);
  font-size: 1.05rem;
  margin-bottom: 1.4rem;
}

.checks {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.checks li {
  position: relative;
  padding-left: 1.75rem;
  font-size: 0.95rem;
  color: var(--text);
}

.checks li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--green);
  font-weight: 800;
}

.shot-frame {
  aspect-ratio: 16 / 9;
  background: var(--crust);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.shot-frame img {
  width: 100%;
  height: auto;
  display: block;
}

.shot-frame figcaption {
  padding: 0.85rem 1.2rem;
  background: var(--mantle);
  border-top: 1px solid var(--line);
  font-size: 0.88rem;
  color: var(--subtext);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

/* ---------- Hardware & AI Machine Studio Subsection ---------- */

.machine-studio-section {
  margin-top: 5.5rem;
  padding-top: 4.5rem;
  border-top: 1px solid var(--line);
}

.machine-studio-header {
  text-align: center;
  max-width: 840px;
  margin: 0 auto 3rem;
}

.machine-studio-header h3 {
  font-size: clamp(1.8rem, 3.2vw, 2.5rem);
  margin-bottom: 0.85rem;
}

.machine-studio-header p {
  color: var(--subtext);
  font-size: 1.1rem;
  line-height: 1.6;
}

.machine-studio-card {
  background: var(--crust);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.75rem;
  box-shadow: var(--shadow);
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.machine-studio-card:hover {
  border-color: rgba(137, 180, 250, 0.4);
}

.machine-studio-tabs {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-bottom: 1px solid var(--line);
  padding-bottom: 1.25rem;
  margin-bottom: 2rem;
  overflow-x: auto;
  scrollbar-width: none;
}

.machine-studio-tabs::-webkit-scrollbar {
  display: none;
}

.machine-tab-btn {
  background: var(--mantle);
  border: 1px solid var(--line);
  color: var(--subtext);
  padding: 0.75rem 1.35rem;
  border-radius: 10px;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
  font-family: inherit;
}

.machine-tab-btn .tab-icon {
  font-size: 1.15rem;
}

.machine-tab-btn:hover {
  background: var(--surface);
  color: var(--text);
  border-color: var(--mauve);
  transform: translateY(-1px);
}

.machine-tab-btn.active {
  background: linear-gradient(135deg, rgba(137, 180, 250, 0.18), rgba(203, 166, 247, 0.18));
  border-color: var(--blue);
  color: var(--blue);
  box-shadow: 0 0 18px var(--glow);
}

.machine-studio-body {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 2.75rem;
  align-items: center;
}

.machine-media-col {
  width: 100%;
}

.machine-shot-frame {
  background: #000;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.55);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.machine-shot-frame:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.65);
}

.machine-shot-frame img {
  width: 100%;
  height: auto;
  display: block;
  transition: opacity 0.25s ease;
}

.machine-shot-frame figcaption {
  padding: 0.9rem 1.25rem;
  background: var(--mantle);
  border-top: 1px solid var(--line);
  font-size: 0.88rem;
  color: var(--subtext);
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  text-align: left;
}

.machine-shot-frame figcaption b {
  color: var(--text);
  font-size: 0.95rem;
}

.machine-content-col {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.machine-detail-pane {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  animation: machineFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.machine-detail-pane h4 {
  font-size: 1.5rem;
  margin-bottom: 0.2rem;
  color: var(--text);
}

.machine-detail-pane p {
  color: var(--subtext);
  font-size: 1rem;
  line-height: 1.6;
}

.machine-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 1.25rem;
}

@keyframes machineFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- AI Multi-Judge Section ---------- */

.ai-section {
  padding: 5.5rem 0;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3.5rem;
}

.card {
  background: var(--mantle);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.75rem;
  transition: all 0.25s ease;
}

.card:hover {
  border-color: var(--blue);
  transform: translateY(-2px);
}

.card-icon {
  font-size: 1.8rem;
  margin-bottom: 1rem;
  display: inline-block;
}

.card h3 {
  font-size: 1.25rem;
  margin-bottom: 0.6rem;
}

.card p {
  color: var(--subtext);
  font-size: 0.95rem;
}

/* AI Interactive Simulator */
.ai-sim-box {
  background: var(--crust);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 2rem;
  margin-top: 3rem;
}

.ai-sim-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.ai-sim-meters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.sim-meter {
  background: var(--mantle);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1rem;
}

.sim-meter-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.sim-bar {
  height: 8px;
  border-radius: 4px;
  background: var(--surface);
  overflow: hidden;
}

.sim-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.5s ease;
}

.gate-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1rem;
}

.gate-tag {
  padding: 0.4rem 0.8rem;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 0.82rem;
}

.gate-tag b { color: var(--blue); }

/* ---------- Multistream Section ---------- */

.stream-section {
  padding: 5.5rem 0;
  background: var(--mantle);
  border-block: 1px solid var(--line);
}

.dest-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 0.85rem;
  margin: 2.5rem 0;
}

.dest-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  transition: all 0.2s ease;
}

.dest-card.api {
  border-color: rgba(137, 180, 250, 0.4);
  background: rgba(137, 180, 250, 0.08);
}

.dest-card b {
  font-size: 0.95rem;
  color: var(--text);
}

.dest-card span {
  font-size: 0.75rem;
  color: var(--dim);
  margin-top: 0.2rem;
}

/* ---------- Themes & Palettes ---------- */

.themes-section {
  padding: 5.5rem 0;
}

.palette-selector-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.85rem;
  margin-top: 2rem;
}

.palette-btn {
  background: var(--mantle);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  cursor: pointer;
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 600;
  transition: all 0.2s ease;
}

.palette-btn:hover {
  border-color: var(--blue);
  background: var(--surface);
}

.palette-btn[aria-pressed="true"] {
  border-color: var(--blue);
  background: var(--surface);
  box-shadow: 0 0 12px var(--glow);
}

.chips-row {
  display: flex;
  gap: 4px;
}

.chips-row i {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: block;
}

/* ---------- Pricing & Community Section ---------- */

.pricing-section {
  padding: 5.5rem 0;
  background: var(--mantle);
  border-block: 1px solid var(--line);
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2rem;
  max-width: 900px;
  margin: 0 auto;
}

.pricing-card {
  background: var(--crust);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 2.5rem 2rem;
  position: relative;
  display: flex;
  flex-direction: column;
}

.pricing-card.highlight {
  border-color: var(--mauve);
  box-shadow: 0 8px 32px var(--glow);
}

.pricing-card.highlight::before {
  content: "RECOMMENDED FOR CREATORS";
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, var(--blue), var(--mauve));
  color: #11111b;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.2rem 0.8rem;
  border-radius: 999px;
  letter-spacing: 0.05em;
}

.pricing-price {
  font-size: 3rem;
  font-weight: 800;
  color: var(--text);
  margin: 1.2rem 0 0.5rem;
}

.pricing-price small {
  font-size: 1rem;
  font-weight: 500;
  color: var(--subtext);
}

/* ---------- FAQ Accordion ---------- */

.faq-section {
  padding: 5.5rem 0;
}

.faq-list {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.faq-item {
  background: var(--mantle);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}

.faq-item summary {
  padding: 1.25rem 1.5rem;
  font-weight: 600;
  font-size: 1.05rem;
  cursor: pointer;
  user-select: none;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  font-size: 1.4rem;
  color: var(--blue);
  transition: transform 0.2s ease;
}

.faq-item[open] summary::after {
  content: "−";
}

.faq-item p {
  padding: 0 1.5rem 1.25rem;
  color: var(--subtext);
  font-size: 0.96rem;
}

/* ---------- CTA Section ---------- */

.cta-section {
  padding: 6rem 0;
  text-align: center;
  background: radial-gradient(circle at center, var(--mantle) 0%, var(--base) 100%);
}

.cta-card {
  max-width: 850px;
  margin: 0 auto;
  padding: 3.5rem 2rem;
  background: var(--mantle);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow);
}

.cta-card h2 {
  font-size: clamp(2rem, 3.5vw, 2.75rem);
  margin-bottom: 1.2rem;
}

.cta-card p {
  color: var(--subtext);
  font-size: 1.15rem;
  max-width: 650px;
  margin: 0 auto 2rem;
}

/* ---------- Footer ---------- */

footer {
  background: var(--crust);
  border-top: 1px solid var(--line);
  padding: 4rem 0 2rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 3.5rem;
}

.footer-col h5 {
  font-size: 0.88rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--dim);
  margin-bottom: 1.2rem;
}

.footer-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.footer-col a {
  color: var(--subtext);
  font-size: 0.9rem;
}

.footer-col a:hover {
  color: var(--blue);
}

.footer-bottom {
  padding-top: 2rem;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--dim);
  flex-wrap: wrap;
  gap: 1rem;
}

/* ---------- Auth Modal & Portal Styles ---------- */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s ease;
}

.modal-backdrop.open {
  opacity: 1;
  visibility: visible;
}

.modal-card {
  background: var(--mantle);
  border: 1px solid var(--line);
  border-radius: 18px;
  width: 100%;
  max-width: 580px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.8);
  transform: translateY(20px) scale(0.97);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.modal-backdrop.open .modal-card {
  transform: translateY(0) scale(1);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--line);
}

.modal-header h3 {
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--subtext);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
  padding: 0.2rem;
  border-radius: 6px;
}

.modal-close:hover {
  color: var(--text);
  background: var(--surface);
}

.auth-tabs {
  display: flex;
  border-bottom: 1px solid var(--line);
}

.auth-tab-btn {
  flex: 1;
  padding: 0.9rem;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--subtext);
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.auth-tab-btn.active {
  color: var(--blue);
  border-bottom-color: var(--blue);
  background: rgba(137, 180, 250, 0.05);
}

.modal-body {
  padding: 1.75rem 1.5rem;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: var(--text);
}

.form-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  background: var(--crust);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 0.95rem;
  font-family: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-input:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--glow);
}

.form-input:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}

/* Password Visibility Toggle */
.password-field-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.password-field-wrapper .form-input {
  padding-right: 2.75rem;
}

.password-toggle-btn {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0.35rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--subtext);
  border-radius: 6px;
  transition: color 0.2s ease, background-color 0.2s ease;
  z-index: 2;
}

.password-toggle-btn:hover {
  color: var(--text);
  background: var(--surface-hover);
}

.password-toggle-btn:focus-visible {
  outline: 2px solid var(--blue);
}

.password-toggle-btn svg {
  width: 1.15rem;
  height: 1.15rem;
  display: block;
  pointer-events: none;
}

/* Password Strength Meter */
.password-strength-container {
  margin-top: 0.55rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.strength-meter-bar {
  width: 100%;
  height: 6px;
  background: var(--crust);
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}

.strength-meter-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.3s ease, box-shadow 0.3s ease;
  background-color: var(--surface);
}

.strength-meter-fill.strength-none {
  width: 0%;
  background-color: transparent;
  box-shadow: none;
}

.strength-meter-fill.strength-very-weak {
  background-color: var(--red);
  box-shadow: 0 0 8px rgba(243, 139, 168, 0.5);
}

.strength-meter-fill.strength-weak {
  background-color: var(--peach);
  box-shadow: 0 0 8px rgba(250, 179, 135, 0.5);
}

.strength-meter-fill.strength-fair {
  background-color: var(--yellow);
  box-shadow: 0 0 8px rgba(249, 226, 175, 0.5);
}

.strength-meter-fill.strength-strong {
  background-color: var(--blue);
  box-shadow: 0 0 8px rgba(137, 180, 250, 0.5);
}

.strength-meter-fill.strength-very-strong {
  background-color: var(--green);
  box-shadow: 0 0 8px rgba(166, 227, 161, 0.5);
}

.strength-meter-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  color: var(--subtext);
}

.strength-meter-text strong {
  font-weight: 700;
  letter-spacing: 0.02em;
}

.strength-meter-text.strength-none strong { color: var(--subtext); }
.strength-meter-text.strength-very-weak strong { color: var(--red); }
.strength-meter-text.strength-weak strong { color: var(--peach); }
.strength-meter-text.strength-fair strong { color: var(--yellow); }
.strength-meter-text.strength-strong strong { color: var(--blue); }
.strength-meter-text.strength-very-strong strong { color: var(--green); }

.strength-meter-entropy {
  font-family: Consolas, monospace;
  font-size: 0.74rem;
  color: var(--dim);
}

.auth-alert {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.88rem;
  margin-bottom: 1.25rem;
  display: none;
}

.auth-alert.error {
  display: block;
  background: rgba(243, 139, 168, 0.15);
  border: 1px solid rgba(243, 139, 168, 0.35);
  color: var(--red);
}

.auth-alert.success {
  display: block;
  background: rgba(166, 227, 161, 0.15);
  border: 1px solid rgba(166, 227, 161, 0.35);
  color: var(--green);
}

/* ---------- Account Lockout Banner (HTTP 423) ---------- */
.auth-lockout-banner {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 0.9rem 1.1rem;
  border-radius: 10px;
  background: rgba(243, 139, 168, 0.12);
  border: 1px solid rgba(243, 139, 168, 0.4);
  box-shadow: 0 4px 16px rgba(243, 139, 168, 0.08);
  margin-bottom: 1.25rem;
  color: var(--text);
  font-size: 0.9rem;
  line-height: 1.45;
  box-sizing: border-box;
}

.auth-lockout-banner .lockout-icon {
  font-size: 1.35rem;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 1px;
}

.auth-lockout-banner .lockout-content {
  flex: 1;
  min-width: 0;
}

.auth-lockout-banner .lockout-title {
  display: block;
  font-weight: 700;
  color: var(--red);
  font-size: 0.95rem;
  margin-bottom: 0.2rem;
}

.auth-lockout-banner .lockout-countdown {
  font-weight: 600;
  color: var(--peach);
  font-size: 0.92rem;
  margin-bottom: 0.25rem;
  letter-spacing: 0.01em;
}

.auth-lockout-banner .lockout-timer {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-weight: 700;
  color: var(--peach);
  background: rgba(250, 179, 135, 0.15);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  border: 1px solid rgba(250, 179, 135, 0.3);
  display: inline-block;
}

.auth-lockout-banner .lockout-subtext {
  font-size: 0.82rem;
  color: var(--subtext);
  margin: 0;
  line-height: 1.35;
}

.auth-lockout-banner.lockout-expired {
  background: rgba(166, 227, 161, 0.12);
  border-color: rgba(166, 227, 161, 0.4);
}

.auth-lockout-banner.lockout-expired .lockout-title {
  color: var(--green);
}

.auth-lockout-banner.lockout-expired .lockout-countdown {
  color: var(--green);
}

.form-input:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  background: var(--mantle);
  border-color: var(--line);
}

.btn:disabled,
button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* ---------- Toast Notification Component ---------- */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 100000;
  display: flex;
  flex-direction: column-reverse;
  gap: 0.65rem;
  pointer-events: none;
  max-width: 380px;
  width: calc(100vw - 3rem);
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.8rem 1rem;
  background: var(--mantle);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  font-size: 0.88rem;
  line-height: 1.4;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transform: translateX(120%);
  opacity: 0;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
}

.toast.toast-visible {
  transform: translateX(0);
  opacity: 1;
}

.toast.toast-hiding {
  transform: translateX(120%);
  opacity: 0;
}

.toast-icon {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
}

.toast-message {
  flex: 1;
  word-break: break-word;
}

.toast-close {
  flex-shrink: 0;
  background: transparent;
  border: none;
  color: var(--subtext);
  cursor: pointer;
  padding: 0.2rem;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  line-height: 1;
  transition: color 0.15s ease;
}

.toast-close:hover {
  color: var(--text);
}

.toast-info {
  border-left: 4px solid var(--blue);
}

.toast-info .toast-icon {
  color: var(--blue);
}

.toast-success {
  border-left: 4px solid var(--green);
}

.toast-success .toast-icon {
  color: var(--green);
}

.toast-warning {
  border-left: 4px solid var(--yellow);
}

.toast-warning .toast-icon {
  color: var(--yellow);
}

.toast-error {
  border-left: 4px solid var(--red);
}

.toast-error .toast-icon {
  color: var(--red);
}

.auth-forgot-trigger {
  background: transparent;
  border: none;
  color: var(--blue);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  transition: color 0.2s ease, text-decoration 0.2s ease;
}

.auth-forgot-trigger:hover {
  color: var(--mauve);
  text-decoration: underline;
}

.auth-link-btn {
  background: transparent;
  border: none;
  color: var(--subtext);
  font-size: 0.84rem;
  font-weight: 500;
  cursor: pointer;
  padding: 0.25rem 0;
  transition: color 0.2s ease;
}

.auth-link-btn:hover {
  color: var(--blue);
  text-decoration: underline;
}

.auth-sub-header {
  margin-bottom: 1.25rem;
}

.auth-sub-header h4 {
  font-size: 1.05rem;
  margin-bottom: 0.35rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.auth-sub-header p {
  font-size: 0.85rem;
  color: var(--subtext);
  margin: 0;
  line-height: 1.45;
}

/* User Account Dashboard View */
.account-view {
  display: none;
}

.account-view.active {
  display: block;
}

.user-profile-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--line);
}

.user-avatar-large {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), var(--mauve));
  color: #11111b;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 800;
}

.user-meta h4 {
  font-size: 1.15rem;
  margin-bottom: 0.2rem;
}

.user-meta p {
  color: var(--subtext);
  font-size: 0.85rem;
  margin: 0;
}

/* Account Navigation Tabs */
.account-tabs {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 1.25rem;
  background: var(--crust);
  padding: 0.35rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  flex-wrap: wrap;
}

.account-tab-btn {
  flex: 1 1 auto;
  min-width: fit-content;
  white-space: nowrap;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.6rem 0.75rem;
  background: transparent;
  border: none;
  border-radius: 7px;
  color: var(--subtext);
  font-weight: 600;
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.account-tab-btn:hover {
  color: var(--text);
  background: var(--surface);
}

.account-tab-btn.active {
  color: var(--text);
  background: var(--surface-hover);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.account-tab-panel {
  animation: tabFadeIn 0.2s ease-out;
}

@keyframes tabFadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.btn-danger {
  background: var(--red);
  color: #11111b;
  font-weight: 700;
  border: none;
  border-radius: 8px;
  padding: 0.75rem 1.25rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
}

.btn-danger:hover {
  opacity: 0.92;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(243, 139, 168, 0.4);
}

.btn-danger:active {
  transform: translateY(0);
}

.btn-danger:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.danger-zone-container {
  border-color: rgba(243, 139, 168, 0.35);
  background: rgba(243, 139, 168, 0.04);
}

.danger-zone-warning {
  background: rgba(243, 139, 168, 0.1);
  border: 1px solid rgba(243, 139, 168, 0.3);
  border-radius: 8px;
  padding: 0.85rem 1rem;
  margin-bottom: 1.25rem;
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--text);
}

.account-section-form {
  background: var(--crust);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.25rem;
  margin: 1.25rem 0;
}

.studio-tokens-section {
  background: var(--crust);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.25rem;
  margin: 1.25rem 0;
}

.tokens-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.35rem;
}

.tokens-section-header h5 {
  font-size: 0.95rem;
  color: var(--blue);
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0;
}

.tokens-section-desc {
  font-size: 0.8rem;
  color: var(--subtext);
  margin-bottom: 0.9rem;
  line-height: 1.4;
}

/* Sticky Network Status Notification Banner */
.network-status-banner {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 10000;
  padding: 0.65rem 1.25rem;
  font-size: 0.88rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  text-align: center;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  transition: opacity 0.35s ease, transform 0.35s ease, background-color 0.3s ease;
}

.network-status-banner[hidden] {
  display: none !important;
}

.network-status-banner.is-offline {
  background: rgba(243, 139, 168, 0.18);
  border-bottom: 1px solid var(--red);
  color: var(--text);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.network-status-banner.is-online {
  background: rgba(166, 227, 161, 0.18);
  border-bottom: 1px solid var(--green);
  color: var(--text);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.network-status-banner.fade-out {
  opacity: 0;
  transform: translateY(-100%);
  pointer-events: none;
}

.network-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.65rem;
  border-radius: 9999px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.network-status-badge.badge-offline {
  background: var(--red);
  color: #11111b;
}

.network-status-badge.badge-online {
  background: var(--green);
  color: #11111b;
}

.network-status-text {
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 500;
}

/* New Token Alert Banner */
.new-token-alert {
  background: rgba(166, 227, 161, 0.08);
  border: 1px solid rgba(166, 227, 161, 0.35);
  border-radius: 10px;
  padding: 0.85rem 1rem;
  margin-bottom: 1rem;
  animation: tokenFadeIn 0.25s ease-out;
}

@keyframes tokenFadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.new-token-banner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
}

.new-token-title {
  color: var(--green);
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.new-token-subtitle {
  color: var(--peach);
  font-size: 0.74rem;
  margin-top: 0.15rem;
}

.btn-token-dismiss {
  background: transparent;
  border: none;
  color: var(--subtext);
  font-size: 1.25rem;
  cursor: pointer;
  line-height: 1;
  padding: 0 0.25rem;
  border-radius: 4px;
}

.btn-token-dismiss:hover {
  color: var(--text);
  background: var(--surface);
}

/* Accessible visually hidden utility */
.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;
}

/* Create Token Form */
.create-token-form {
  margin-bottom: 0.85rem;
}

.token-input-group {
  display: flex;
  gap: 0.5rem;
}

.token-name-input {
  flex: 1;
  padding: 0.55rem 0.85rem;
  font-size: 0.85rem;
}

/* Tokens Table & Empty State */
.tokens-table-container {
  background: var(--mantle);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.tokens-table-responsive {
  max-height: 220px;
  overflow-y: auto;
  overflow-x: auto;
}

.tokens-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  text-align: left;
}

.tokens-table th {
  background: var(--surface);
  color: var(--subtext);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 2;
}

.tokens-table td {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid rgba(69, 71, 90, 0.4);
  vertical-align: middle;
}

.tokens-table tr:last-child td {
  border-bottom: none;
}

.tokens-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.token-name-cell {
  color: var(--text);
  font-weight: 600;
  max-width: 130px;
}

.token-name-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.token-code-pill {
  font-family: Consolas, monospace;
  font-size: 0.76rem;
  background: var(--crust);
  padding: 0.2rem 0.45rem;
  border-radius: 4px;
  border: 1px solid var(--line);
  color: var(--green);
  white-space: nowrap;
}

.token-date-text {
  color: var(--subtext);
  font-size: 0.74rem;
  white-space: nowrap;
}

.btn-revoke {
  color: var(--red) !important;
  border-color: rgba(243, 139, 168, 0.3) !important;
  background: rgba(243, 139, 168, 0.05) !important;
  padding: 0.25rem 0.6rem !important;
  font-size: 0.75rem !important;
  line-height: 1.2 !important;
  border-radius: 6px !important;
}

.btn-revoke:hover {
  background: rgba(243, 139, 168, 0.2) !important;
  border-color: var(--red) !important;
  color: #fff !important;
  transform: none !important;
}

.tokens-empty-state {
  padding: 1.75rem 1rem;
  text-align: center;
}

.key-display {
  display: flex;
  gap: 0.5rem;
}

.key-code {
  flex: 1;
  background: var(--mantle);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
  font-family: Consolas, monospace;
  font-size: 0.85rem;
  color: var(--green);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.backup-codes-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.4rem;
}

@media (max-width: 480px) {
  .backup-codes-grid {
    grid-template-columns: 1fr;
  }
}

.backup-code-item {
  background: var(--surface);
  padding: 0.45rem 0.6rem;
  border-radius: 5px;
  font-family: Consolas, monospace;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--green);
  text-align: center;
  border: 1px solid var(--line);
  letter-spacing: 1px;
  user-select: all;
  transition: border-color 0.2s, background-color 0.2s;
}

.backup-code-item:hover {
  border-color: var(--blue);
  background: var(--surface-hover);
}

/* ---------- Floating Back-to-Top Button ---------- */
.btn-back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--mantle);
  border: 1px solid var(--line);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 990;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(16px) scale(0.9);
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.3s cubic-bezier(0.16, 1, 0.3, 1),
              visibility 0.3s ease,
              background-color 0.2s ease,
              border-color 0.2s ease,
              color 0.2s ease,
              box-shadow 0.2s ease;
}

.btn-back-to-top.visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.btn-back-to-top:hover {
  background: var(--surface);
  border-color: var(--blue);
  color: var(--blue);
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45), 0 0 12px var(--glow);
}

.btn-back-to-top:active {
  transform: translateY(0) scale(0.96);
}

.btn-back-to-top:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}

.btn-back-to-top svg {
  width: 22px;
  height: 22px;
  display: block;
  pointer-events: none;
  transition: transform 0.2s ease;
}

.btn-back-to-top:hover svg {
  transform: translateY(-2px);
}

/* ---------- Scroll Reveal ---------- */

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.in {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Gate Tag Button & Directory CTA ---------- */
.gate-tag-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(137, 180, 250, 0.12);
  border: 1px solid var(--blue);
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.82rem;
  padding: 0.4rem 0.8rem;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.gate-tag-btn:hover,
.gate-tag-btn:focus-visible {
  background: var(--blue);
  color: var(--crust);
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.gate-tag-btn:hover b,
.gate-tag-btn:focus-visible b {
  color: var(--crust);
}

.gate-tag-arrow {
  transition: transform 0.2s ease;
  font-weight: bold;
}

.gate-tag-btn:hover .gate-tag-arrow {
  transform: translateX(3px);
}

.gate-directory-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px dashed var(--line);
}

.gate-directory-note {
  font-size: 0.85rem;
  color: var(--subtext);
}

/* ---------- Game HUD Detector Modal & Directory Styles ---------- */
.modal-card-lg {
  max-width: 960px;
  width: 95%;
}

.game-hud-modal-card {
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.game-hud-modal-title-wrap h3 {
  font-size: 1.25rem;
  margin-bottom: 0.2rem;
}

.modal-subtitle {
  font-size: 0.84rem;
  color: var(--subtext);
  margin: 0;
}

.game-hud-filter-bar {
  padding: 1rem 1.5rem;
  background: var(--crust);
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.game-hud-search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.game-hud-search-icon {
  position: absolute;
  left: 1rem;
  font-size: 0.95rem;
  opacity: 0.7;
  pointer-events: none;
}

.game-hud-search-input {
  padding-left: 2.6rem;
  padding-right: 2.4rem;
  height: 42px;
  font-size: 0.92rem;
  background: var(--mantle);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  width: 100%;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.game-hud-search-input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(137, 180, 250, 0.15);
  outline: none;
}

.game-hud-search-input:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}

.game-hud-clear-btn {
  position: absolute;
  right: 0.75rem;
  background: transparent;
  border: none;
  color: var(--subtext);
  font-size: 1.25rem;
  cursor: pointer;
  line-height: 1;
  padding: 0.25rem;
  border-radius: 4px;
}

.game-hud-clear-btn:hover {
  color: var(--text);
}

.game-hud-tag-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.game-tag-pill {
  padding: 0.35rem 0.8rem;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--subtext);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.game-tag-pill:hover {
  color: var(--text);
  background: var(--surface-hover, rgba(255, 255, 255, 0.08));
  border-color: var(--subtext);
}

.game-tag-pill.active {
  background: var(--blue);
  color: var(--crust);
  border-color: var(--blue);
  box-shadow: 0 2px 8px rgba(137, 180, 250, 0.3);
}

.game-hud-stats-bar {
  padding: 0.6rem 1.5rem;
  background: var(--mantle);
  border-bottom: 1px solid var(--line);
  font-size: 0.82rem;
  color: var(--subtext);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.game-hud-live-badge {
  color: var(--green);
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.2px;
}

.game-hud-body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 1.25rem 1.5rem 1.75rem;
  background: var(--base, var(--mantle));
  min-height: 320px;
  max-height: calc(90vh - 240px);
}

.game-hud-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 1rem;
}

.game-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.game-card:hover {
  transform: translateY(-2px);
  border-color: var(--blue);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.game-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
}

.game-card-title {
  font-size: 0.96rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}

.game-card-genre {
  font-size: 0.7rem;
  padding: 0.18rem 0.5rem;
  border-radius: 6px;
  background: var(--crust);
  color: var(--mauve);
  border: 1px solid var(--line);
  font-weight: 600;
  white-space: nowrap;
}

.game-card-detectors {
  font-size: 0.8rem;
  color: var(--subtext);
  line-height: 1.45;
  margin: 0;
}

.game-card-detectors strong {
  color: var(--text);
  font-weight: 600;
}

.game-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: auto;
  padding-top: 0.6rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.game-badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.18rem 0.5rem;
  border-radius: 6px;
  white-space: nowrap;
}

.game-badge.tag-killfeed {
  background: rgba(243, 139, 168, 0.14);
  color: var(--red);
  border: 1px solid rgba(243, 139, 168, 0.3);
}

.game-badge.tag-health {
  background: rgba(166, 227, 161, 0.14);
  color: var(--green);
  border: 1px solid rgba(166, 227, 161, 0.3);
}

.game-badge.tag-loot {
  background: rgba(249, 226, 175, 0.14);
  color: var(--yellow);
  border: 1px solid rgba(249, 226, 175, 0.3);
}

.game-badge.tag-victory {
  background: rgba(137, 180, 250, 0.14);
  color: var(--blue);
  border: 1px solid rgba(137, 180, 250, 0.3);
}

.game-hud-empty {
  text-align: center;
  padding: 3.5rem 1.5rem;
  color: var(--subtext);
}

.game-hud-empty-icon {
  font-size: 2.8rem;
  margin-bottom: 0.75rem;
  opacity: 0.8;
}

.game-hud-empty h4 {
  font-size: 1.15rem;
  color: var(--text);
  margin-bottom: 0.4rem;
}

.game-hud-empty p {
  font-size: 0.88rem;
  max-width: 420px;
  margin: 0 auto;
}

/* ---------- Game Highlight Judges & Custom Rule Builder Styles ---------- */
.judge-inspect-modal-card {
  max-width: 920px;
  width: 95%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.judge-create-modal-card {
  max-width: 880px;
  width: 95%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.judge-inspect-header-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.judge-inspect-title-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.judge-status-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.18rem 0.55rem;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.judge-status-badge.system,
.judge-badge.tag-system {
  background: rgba(137, 180, 250, 0.15);
  color: var(--blue);
  border: 1px solid rgba(137, 180, 250, 0.3);
}

.judge-status-badge.custom,
.judge-badge.tag-custom {
  background: rgba(203, 166, 247, 0.15);
  color: var(--mauve);
  border: 1px solid rgba(203, 166, 247, 0.3);
}

.judge-status-badge.public,
.judge-badge.tag-public {
  background: rgba(166, 227, 161, 0.15);
  color: var(--green);
  border: 1px solid rgba(166, 227, 161, 0.3);
}

.judge-status-badge.private,
.judge-badge.tag-private {
  background: rgba(249, 226, 175, 0.15);
  color: var(--yellow);
  border: 1px solid rgba(249, 226, 175, 0.3);
}

.judge-badge.tag-pve {
  background: rgba(148, 226, 213, 0.15);
  color: var(--cyan);
  border: 1px solid rgba(148, 226, 213, 0.3);
}

.judge-inspect-tabs {
  display: flex;
  gap: 0.5rem;
  border-bottom: 1px solid var(--line);
  padding: 0 1.5rem;
  background: var(--crust);
  overflow-x: auto;
}

.judge-inspect-tab {
  padding: 0.75rem 1rem;
  border: none;
  background: transparent;
  color: var(--subtext);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s ease;
  white-space: nowrap;
  font-family: inherit;
}

.judge-inspect-tab:hover {
  color: var(--text);
}

.judge-inspect-tab.active {
  color: var(--blue);
  border-bottom-color: var(--blue);
}

.judge-inspect-panel {
  padding: 1.25rem 1.5rem 1.5rem;
}

.judge-weights-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.weight-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.weight-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.weight-name {
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.weight-pill {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.18rem 0.5rem;
  border-radius: 6px;
}

.weight-pill.score-high {
  background: rgba(166, 227, 161, 0.18);
  color: var(--green);
  border: 1px solid rgba(166, 227, 161, 0.35);
}

.weight-pill.score-med {
  background: rgba(203, 166, 247, 0.18);
  color: var(--mauve);
  border: 1px solid rgba(203, 166, 247, 0.35);
}

.weight-pill.score-fun {
  background: rgba(250, 179, 135, 0.18);
  color: var(--peach);
  border: 1px solid rgba(250, 179, 135, 0.35);
}

.weight-pill.score-low {
  background: rgba(243, 139, 168, 0.18);
  color: var(--red);
  border: 1px solid rgba(243, 139, 168, 0.35);
}

.weight-desc {
  font-size: 0.82rem;
  color: var(--subtext);
  line-height: 1.5;
  margin: 0;
  white-space: pre-wrap;
}

.criteria-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.criteria-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.85rem 1rem;
}

.criteria-label {
  font-weight: 700;
  font-size: 0.82rem;
  color: var(--text);
  margin-bottom: 0.35rem;
}

.criteria-val {
  font-size: 0.82rem;
  color: var(--subtext);
  line-height: 1.5;
  white-space: pre-wrap;
}

.prompts-wrap {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.prompt-box {
  background: var(--crust);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.prompt-box-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 1rem;
  background: var(--mantle);
  border-bottom: 1px solid var(--line);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
}

.prompt-pre {
  padding: 1rem;
  margin: 0;
  font-size: 0.78rem;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  color: var(--subtext);
  max-height: 260px;
  overflow-y: auto;
  white-space: pre-wrap;
  line-height: 1.45;
}

.sharing-details-card {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.sharing-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
  background: var(--surface);
  padding: 1rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  font-size: 0.84rem;
}

.sharing-actions-box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1.25rem;
}

.sharing-actions-box h4 {
  font-size: 0.98rem;
  margin-top: 0;
  margin-bottom: 0.4rem;
  color: var(--text);
}

.sharing-btn-group {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.game-card-actions {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
  padding-top: 0.6rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.btn-xs {
  padding: 0.25rem 0.55rem;
  font-size: 0.72rem;
  border-radius: 6px;
  font-weight: 600;
}

.form-section-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--line);
}

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
  .nav-links { display: none; }
  .nav-toggle { display: flex; }
  .studio-row, .studio-row.flip {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .studio-row.flip .studio-copy { order: 1; }
  .studio-row.flip .studio-media { order: 2; }
  .machine-studio-body {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 2rem; }
}

@media (max-width: 600px) {
  .brand-sub { display: none; }
  #nav-auth-area .btn { padding: 0.35rem 0.65rem; font-size: 0.8rem; }
  .footer-grid { grid-template-columns: 1fr; }
  .strip-inner { grid-template-columns: 1fr 1fr; }
  .hero-actions { flex-direction: column; width: 100%; }
  .hero-actions .btn { width: 100%; }
  .machine-studio-card { padding: 1.25rem 1rem; }
  .machine-tab-btn { padding: 0.6rem 0.95rem; font-size: 0.84rem; }
  .btn-back-to-top {
    bottom: 1.25rem;
    right: 1.25rem;
    width: 40px;
    height: 40px;
  }
  .btn-back-to-top svg {
    width: 18px;
    height: 18px;
  }
  .modal-card-lg { width: 100%; max-height: 94vh; border-radius: 14px; }
  .game-hud-grid { grid-template-columns: 1fr; }
  .game-hud-filter-bar { padding: 0.85rem 1rem; }
  .game-hud-body { padding: 1rem; }
  .shortcuts-grid { grid-template-columns: 1fr; }
  .shortcuts-controls { padding: 0.85rem 1rem; }
  .shortcuts-modal-body { padding: 1rem; }
}

/* ==========================================================================
   Keyboard Shortcuts Cheatsheet Modal Styles (#shortcuts-modal)
   ========================================================================== */

.shortcuts-modal-card {
  max-width: 960px;
  width: 95%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.shortcuts-header-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.shortcuts-controls {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--line);
  background: var(--crust);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.shortcuts-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.shortcuts-search-icon {
  position: absolute;
  left: 0.9rem;
  pointer-events: none;
  font-size: 0.9rem;
  opacity: 0.7;
}

.shortcuts-search-input {
  padding-left: 2.5rem !important;
  padding-right: 2.2rem !important;
  width: 100%;
  font-size: 0.9rem;
}

.shortcuts-search-clear {
  position: absolute;
  right: 0.6rem;
  background: transparent;
  border: none;
  color: var(--subtext);
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0.2rem 0.4rem;
  line-height: 1;
  border-radius: 4px;
}

.shortcuts-search-clear:hover {
  color: var(--text);
  background: var(--surface-hover);
}

.shortcuts-filter-pills {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
  scrollbar-width: thin;
}

.shortcuts-pill {
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  background: var(--surface);
  color: var(--subtext);
  border: 1px solid var(--line);
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.2s ease;
}

.shortcuts-pill:hover {
  color: var(--text);
  background: var(--surface-hover);
  border-color: var(--subtext);
}

.shortcuts-pill.active {
  color: #fff;
  background: var(--blue);
  border-color: var(--blue);
}

.shortcuts-count-badge {
  font-size: 0.7rem;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.15);
  font-weight: 700;
}

.shortcuts-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
  max-height: calc(85vh - 200px);
}

.shortcuts-empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--subtext);
}

.shortcuts-empty-icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
  opacity: 0.8;
}

.shortcuts-empty-state h4 {
  font-size: 1.15rem;
  color: var(--text);
  margin-bottom: 0.4rem;
}

.shortcuts-empty-state p {
  font-size: 0.88rem;
  max-width: 400px;
  margin: 0 auto 1.25rem auto;
}

.shortcuts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 1.25rem;
}

.shortcuts-studio-card {
  background: var(--crust);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.shortcuts-studio-card:hover {
  border-color: rgba(137, 180, 250, 0.4);
}

.shortcuts-studio-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1rem;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.shortcuts-studio-header h4 {
  margin: 0;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text);
}

.shortcuts-list {
  display: flex;
  flex-direction: column;
}

.shortcut-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  gap: 1rem;
  transition: background 0.15s ease;
}

.shortcut-item:last-child {
  border-bottom: none;
}

.shortcut-item:hover {
  background: rgba(255, 255, 255, 0.03);
}

.shortcut-label {
  font-size: 0.86rem;
  color: var(--text);
  font-weight: 500;
}

.shortcut-keys {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  color: var(--subtext);
  font-size: 0.78rem;
  flex-shrink: 0;
}

kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  padding: 0.22rem 0.5rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1;
  color: var(--text);
  background: var(--mantle);
  border: 1px solid var(--line);
  border-bottom: 2px solid var(--subtext);
  border-radius: 6px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
  user-select: none;
}

.shortcuts-modal-footer {
  padding: 0.85rem 1.5rem;
  border-top: 1px solid var(--line);
  background: var(--crust);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.shortcuts-hint {
  font-size: 0.82rem;
  color: var(--subtext);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.kbd-hint-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.1rem 0.4rem;
  font-size: 0.72rem;
  font-weight: 700;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 4px;
  margin-left: 0.35rem;
  color: var(--subtext);
  vertical-align: middle;
}

/* ==========================================================================
   Interactive VOD Storage & Bitrate Estimator
   ========================================================================== */

.vod-estimator-wrap {
  margin-top: 3.5rem;
  width: 100%;
}

.vod-estimator-card {
  background: linear-gradient(145deg, rgba(20, 25, 40, 0.9), rgba(10, 14, 25, 0.95));
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 2.5rem;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(16px);
  position: relative;
  overflow: hidden;
}

.vod-estimator-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, #6366f1, #a855f7, #ec4899, transparent);
}

.vod-estimator-header {
  margin-bottom: 2rem;
}

.vod-header-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #a855f7;
  background: rgba(168, 85, 247, 0.12);
  border: 1px solid rgba(168, 85, 247, 0.3);
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  margin-bottom: 0.75rem;
}

.vod-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #a855f7;
  box-shadow: 0 0 10px #a855f7;
}

.vod-estimator-header h3 {
  font-size: 1.65rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: #f8fafc;
}

.vod-estimator-header p {
  color: #94a3b8;
  font-size: 0.95rem;
  max-width: 700px;
  margin: 0;
}

.vod-grid-layout {
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: 2.5rem;
  align-items: stretch;
}

.vod-inputs-panel {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  padding: 1.75rem;
}

.vod-control-item label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  color: #cbd5e1;
  margin-bottom: 0.45rem;
}

.vod-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.45rem;
}

.vod-duration-badge {
  font-size: 0.85rem;
  font-weight: 700;
  color: #67e8f9;
  background: rgba(6, 182, 212, 0.15);
  border: 1px solid rgba(6, 182, 212, 0.3);
  padding: 0.2rem 0.65rem;
  border-radius: 6px;
}

.vod-select {
  width: 100%;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  padding: 0.65rem 0.95rem;
  color: #f1f5f9;
  font-size: 0.9rem;
  font-weight: 500;
  outline: none;
  transition: all 0.2s ease;
  cursor: pointer;
}

.vod-select:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
}

.vod-select:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}

.vod-control-item input[type="range"] {
  width: 100%;
  accent-color: #6366f1;
  cursor: pointer;
}

.vod-slider-ticks {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: #64748b;
  margin-top: 0.35rem;
}

.vod-metrics-panel {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  justify-content: space-between;
}

.vod-metrics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.vod-metric-card {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 14px;
  padding: 1.25rem;
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.vod-metric-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.15);
}

.vod-metric-card.highlight-card {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(168, 85, 247, 0.12));
  border-color: rgba(168, 85, 247, 0.35);
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.1);
}

.metric-icon {
  font-size: 1.5rem;
  line-height: 1;
}

.metric-title {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94a3b8;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.metric-val {
  font-size: 1.45rem;
  font-weight: 800;
  color: #f8fafc;
  line-height: 1.2;
}

.highlight-card .metric-val {
  color: #38bdf8;
}

.metric-sub {
  font-size: 0.78rem;
  color: #64748b;
  margin-top: 0.25rem;
}

.vod-capacity-bars {
  background: rgba(15, 23, 42, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  padding: 1.25rem 1.5rem;
}

.capacity-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  font-weight: 600;
  color: #e2e8f0;
  margin-bottom: 1rem;
}

.capacity-note {
  font-size: 0.78rem;
  color: #64748b;
  font-weight: 400;
}

.capacity-row {
  margin-bottom: 0.85rem;
}

.capacity-row:last-child {
  margin-bottom: 0;
}

.cap-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  margin-bottom: 0.3rem;
}

.cap-name {
  color: #94a3b8;
}

.cap-percent {
  color: #cbd5e1;
  font-weight: 600;
}

.cap-track {
  height: 8px;
  background: rgba(255, 255, 255, 0.07);
  border-radius: 999px;
  overflow: hidden;
}

.cap-fill {
  height: 100%;
  background: linear-gradient(90deg, #38bdf8, #818cf8);
  border-radius: 999px;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================================================
   Interactive AV Desync Latency Calibration Tool
   ========================================================================== */

.av-sync-container {
  margin: 2.5rem 0 3.5rem;
  width: 100%;
}

.av-sync-card {
  background: radial-gradient(circle at top right, rgba(0, 240, 255, 0.05), transparent 50%), rgba(14, 18, 30, 0.95);
  border: 1px solid rgba(0, 240, 255, 0.25);
  border-radius: 20px;
  padding: 2.25rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), 0 0 30px rgba(0, 240, 255, 0.05);
  backdrop-filter: blur(16px);
  position: relative;
  overflow: hidden;
}

.av-sync-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.5rem;
  margin-bottom: 1.75rem;
}

.av-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #00f0ff;
  background: rgba(0, 240, 255, 0.1);
  border: 1px solid rgba(0, 240, 255, 0.3);
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  margin-bottom: 0.6rem;
}

.av-pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #00f0ff;
  box-shadow: 0 0 10px #00f0ff;
  animation: av-pulse 1.6s infinite ease-in-out;
}

@keyframes av-pulse {
  0%, 100% { opacity: 0.4; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.2); }
}

.av-sync-title-group h4 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #f8fafc;
  margin-bottom: 0.4rem;
}

.av-sync-title-group p {
  color: #94a3b8;
  font-size: 0.92rem;
  margin: 0;
  max-width: 680px;
}

.status-pill {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  white-space: nowrap;
}

.status-ready {
  background: rgba(148, 163, 184, 0.15);
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.3);
}

.status-active {
  background: rgba(16, 185, 129, 0.18);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.4);
  box-shadow: 0 0 14px rgba(52, 211, 153, 0.25);
}

/* AV Visual Calibration Canvas / Track */
.av-canvas-wrapper {
  margin-bottom: 1.75rem;
}

.av-track {
  height: 90px;
  background: #090d16;
  border: 1px solid rgba(0, 240, 255, 0.2);
  border-radius: 14px;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 4px 20px rgba(0, 0, 0, 0.7);
}

.av-center-marker {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  background: rgba(0, 240, 255, 0.8);
  box-shadow: 0 0 12px #00f0ff;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  pointer-events: none;
  z-index: 2;
}

.av-marker-label {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #00f0ff;
  background: rgba(15, 23, 42, 0.9);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  border: 1px solid rgba(0, 240, 255, 0.4);
  margin-bottom: 6px;
  white-space: nowrap;
}

.av-indicator-ball {
  position: absolute;
  top: calc(50% - 15px);
  left: 50%;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: radial-gradient(circle, #ffffff 10%, #00f0ff 60%, #6366f1 100%);
  box-shadow: 0 0 25px #00f0ff, 0 0 10px rgba(255, 255, 255, 0.8);
  transform: translateX(-50%);
  z-index: 3;
  pointer-events: none;
  will-change: transform;
}

.av-flash-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 240, 255, 0.35);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.08s ease-out;
  z-index: 1;
}

.av-flash-overlay.flashing {
  opacity: 1;
  transition: none;
}

.av-scale-ticks {
  display: flex;
  justify-content: space-between;
  padding: 0.45rem 1rem 0;
  font-size: 0.75rem;
  color: #64748b;
  font-family: monospace;
}

.tick-center {
  color: #00f0ff;
  font-weight: 700;
}

/* AV Controls Grid */
.av-controls-grid {
  display: grid;
  grid-template-columns: 1.1fr 1.5fr 1fr 1fr;
  gap: 1.25rem;
  align-items: flex-end;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.av-control-group label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: #cbd5e1;
  margin-bottom: 0.45rem;
}

.av-offset-val {
  color: #38bdf8;
  font-weight: 800;
}

.av-start-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  font-weight: 700;
}

.av-slider-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.av-slider-row input[type="range"] {
  flex: 1;
  accent-color: #00f0ff;
  cursor: pointer;
}

.av-step-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #e2e8f0;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.35rem 0.5rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.av-step-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.av-reset-btn {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}

.av-reset-btn:hover {
  background: rgba(239, 68, 68, 0.25);
  color: #fff;
}

.av-select {
  width: 100%;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  padding: 0.6rem 0.75rem;
  color: #f1f5f9;
  font-size: 0.85rem;
  outline: none;
  cursor: pointer;
}

.av-volume-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.av-volume-row input[type="range"] {
  flex: 1;
  accent-color: #38bdf8;
  cursor: pointer;
}

.av-mute-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  font-size: 1rem;
  padding: 0.4rem 0.65rem;
  cursor: pointer;
  transition: background 0.15s ease;
}

.av-mute-btn:hover {
  background: rgba(255, 255, 255, 0.18);
}

/* AV Calibration Footer Banner */
.av-result-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  background: linear-gradient(90deg, rgba(0, 240, 255, 0.08), rgba(99, 102, 241, 0.08));
  border: 1px solid rgba(0, 240, 255, 0.2);
  border-radius: 12px;
  padding: 1rem 1.5rem;
}

.av-result-details {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.av-result-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: #cbd5e1;
}

.av-result-number {
  font-size: 1.4rem;
  font-weight: 800;
  color: #00f0ff;
  font-family: monospace;
}

.av-result-hint {
  font-size: 0.82rem;
  color: #94a3b8;
}

.av-copy-btn {
  padding: 0.55rem 1.15rem;
  font-size: 0.88rem;
  font-weight: 700;
  white-space: nowrap;
}

/* ===================== MULTISTREAM BITRATE & BANDWIDTH CALCULATOR ===================== */
.multistream-calc-card {
  margin-top: 3.5rem;
  background: linear-gradient(145deg, rgba(20, 25, 40, 0.95), rgba(10, 14, 25, 0.98));
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 2.5rem;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(16px);
  position: relative;
  overflow: hidden;
}

.multistream-calc-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--blue), var(--mauve), var(--cyan), transparent);
}

.multistream-calc-header {
  margin-bottom: 2rem;
}

.multistream-header-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--blue);
  background: rgba(137, 180, 250, 0.12);
  border: 1px solid rgba(137, 180, 250, 0.3);
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  margin-bottom: 0.75rem;
}

.calc-pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 10px var(--blue);
  animation: calcDotPulse 2s infinite ease-in-out;
}

@keyframes calcDotPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.7; }
}

.multistream-calc-header h3 {
  font-size: 1.65rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.multistream-calc-header p {
  color: var(--subtext);
  font-size: 0.95rem;
  max-width: 750px;
  margin: 0;
  line-height: 1.5;
}

.multistream-calc-layout {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 2.5rem;
  align-items: start;
}

.multistream-controls-col {
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  padding: 1.75rem;
}

.calc-section-label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.85rem;
}

.calc-section-label small,
.multistream-subtext-note {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--dim);
}

.dest-selector-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.dest-toggle-card {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.85rem;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
}

.dest-toggle-card:hover {
  background: var(--surface-hover);
  border-color: rgba(137, 180, 250, 0.4);
  transform: translateY(-1px);
}

.dest-toggle-card.active {
  background: rgba(137, 180, 250, 0.07);
  border-color: var(--blue);
  box-shadow: 0 4px 14px rgba(137, 180, 250, 0.12);
}

.dest-toggle-card input[type="checkbox"] {
  accent-color: var(--blue);
  width: 17px;
  height: 17px;
  cursor: pointer;
  margin-top: 2px;
}

.dest-toggle-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.dest-toggle-top {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.dest-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
}

.dest-res-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  width: fit-content;
}

.badge-youtube {
  background: rgba(243, 139, 168, 0.15);
  color: var(--red);
  border: 1px solid rgba(243, 139, 168, 0.3);
}

.badge-twitch {
  background: rgba(203, 166, 247, 0.15);
  color: var(--mauve);
  border: 1px solid rgba(203, 166, 247, 0.3);
}

.badge-kick {
  background: rgba(166, 227, 161, 0.15);
  color: var(--green);
  border: 1px solid rgba(166, 227, 161, 0.3);
}

.badge-tiktok {
  background: rgba(148, 226, 213, 0.15);
  color: var(--cyan);
  border: 1px solid rgba(148, 226, 213, 0.3);
}

.dest-toggle-sub {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
  margin-top: 0.15rem;
}

.dest-calc-label {
  color: var(--dim);
}

.dest-bitrate-display {
  color: var(--blue);
  font-family: monospace;
}

.calc-options-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.calc-field-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.calc-field-group label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--subtext);
}

.calc-select {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.65rem 0.85rem;
  color: var(--text);
  font-size: 0.85rem;
  outline: none;
  cursor: pointer;
  transition: border-color 0.2s;
}

.calc-select:focus {
  border-color: var(--blue);
}

.calc-label-split {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.calc-isp-current-val {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--blue);
  background: rgba(137, 180, 250, 0.12);
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  border: 1px solid rgba(137, 180, 250, 0.25);
}

.calc-isp-container {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.calc-slider {
  width: 100%;
  accent-color: var(--blue);
  cursor: pointer;
  margin: 0.4rem 0;
}

.calc-slider-legend {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--dim);
}

.calc-preset-buttons {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.4rem;
  margin-top: 0.6rem;
}

.calc-preset-btn {
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--subtext);
  border-radius: 8px;
  padding: 0.45rem 0.25rem;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}

.calc-preset-btn:hover {
  background: var(--surface-hover);
  color: var(--text);
  border-color: var(--dim);
}

.calc-preset-btn.active {
  background: rgba(137, 180, 250, 0.15);
  border-color: var(--blue);
  color: var(--blue);
}

/* Metrics & Warning Column (Right) */
.multistream-metrics-col {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.multistream-warning-banner {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  border-radius: 14px;
  padding: 1.15rem 1.35rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.multistream-warning-banner.warning-safe {
  background: rgba(166, 227, 161, 0.08);
  border: 1px solid rgba(166, 227, 161, 0.35);
}

.multistream-warning-banner.warning-caution {
  background: rgba(249, 226, 175, 0.08);
  border: 1px solid rgba(249, 226, 175, 0.35);
}

.multistream-warning-banner.warning-danger {
  background: rgba(243, 139, 168, 0.12);
  border: 1px solid rgba(243, 139, 168, 0.5);
  box-shadow: 0 0 24px rgba(243, 139, 168, 0.16);
}

.multistream-warning-banner.warning-idle {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
}

.warning-banner-icon {
  font-size: 1.5rem;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 2px;
}

.warning-banner-text {
  flex: 1;
}

.warning-banner-title {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 0.3rem;
}

.warning-safe .warning-banner-title { color: var(--green); }
.warning-caution .warning-banner-title { color: var(--yellow); }
.warning-danger .warning-banner-title { color: var(--red); }
.warning-idle .warning-banner-title { color: var(--text); }

.warning-banner-desc {
  font-size: 0.85rem;
  color: var(--subtext);
  line-height: 1.45;
}

.calc-metrics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.calc-metric-box {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  padding: 1.15rem;
  display: flex;
  flex-direction: column;
  transition: all 0.2s;
}

.calc-metric-box.highlight-box {
  background: linear-gradient(135deg, rgba(137, 180, 250, 0.1), rgba(203, 166, 247, 0.06));
  border-color: rgba(137, 180, 250, 0.35);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.calc-metric-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.metric-ico {
  font-size: 1.1rem;
}

.metric-lbl {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--dim);
}

.highlight-box .metric-lbl {
  color: var(--blue);
}

.metric-main-number {
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--text);
  font-family: monospace;
  letter-spacing: -0.02em;
}

.metric-main-number small {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--subtext);
}

.highlight-box .metric-main-number {
  color: var(--blue);
}

.metric-footer-note {
  font-size: 0.75rem;
  color: var(--dim);
  margin-top: 0.35rem;
}

/* Headroom Meter */
.calc-meter-wrapper {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  padding: 1.15rem;
}

.calc-meter-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.65rem;
}

.meter-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text);
}

.meter-status-pill {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.meter-status-safe {
  background: rgba(166, 227, 161, 0.15);
  color: var(--green);
  border: 1px solid rgba(166, 227, 161, 0.3);
}

.meter-status-caution {
  background: rgba(249, 226, 175, 0.15);
  color: var(--yellow);
  border: 1px solid rgba(249, 226, 175, 0.3);
}

.meter-status-danger {
  background: rgba(243, 139, 168, 0.18);
  color: var(--red);
  border: 1px solid rgba(243, 139, 168, 0.4);
}

.meter-status-idle {
  background: rgba(255, 255, 255, 0.06);
  color: var(--dim);
  border: 1px solid var(--line);
}

.calc-meter-track {
  height: 12px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  position: relative;
  overflow: hidden;
}

.calc-meter-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), background 0.3s;
}

.calc-meter-fill.fill-safe {
  background: linear-gradient(90deg, #38bdf8, #34d399);
}

.calc-meter-fill.fill-caution {
  background: linear-gradient(90deg, #34d399, #fbbf24);
}

.calc-meter-fill.fill-danger {
  background: linear-gradient(90deg, #f97316, #ef4444);
}

.calc-meter-fill.fill-idle {
  background: var(--surface-hover);
}

.meter-safe-marker,
.meter-danger-marker {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  z-index: 2;
  pointer-events: none;
}

.meter-safe-marker {
  background: rgba(52, 211, 153, 0.7);
}

.meter-danger-marker {
  background: rgba(239, 68, 68, 0.8);
}

.calc-meter-sublabels {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  color: var(--dim);
  margin-top: 0.4rem;
}

/* Feed Breakdown List */
.calc-feed-breakdown {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  padding: 1.15rem;
}

.feed-breakdown-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.65rem;
}

.feed-breakdown-items {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.breakdown-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 0.45rem 0.85rem;
  border-radius: 8px;
}

.breakdown-dest {
  font-weight: 700;
  color: var(--text);
}

.breakdown-res {
  color: var(--dim);
  font-size: 0.75rem;
}

.breakdown-rate {
  font-family: monospace;
  font-weight: 700;
  color: var(--blue);
}

.breakdown-rate small {
  color: var(--dim);
  font-weight: normal;
}

.breakdown-empty {
  font-size: 0.82rem;
  color: var(--dim);
  font-style: italic;
  padding: 0.5rem 0;
}

/* Responsive adjustments for mobile/tablets */
@media (max-width: 900px) {
  .vod-grid-layout {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  .av-controls-grid {
    grid-template-columns: 1fr 1fr;
  }
  .multistream-calc-layout {
    grid-template-columns: 1fr;
    gap: 1.75rem;
  }
}

@media (max-width: 600px) {
  .vod-metrics-grid {
    grid-template-columns: 1fr;
  }
  .av-controls-grid {
    grid-template-columns: 1fr;
  }
  .av-result-banner {
    flex-direction: column;
    align-items: flex-start;
  }
  .av-copy-btn {
    width: 100%;
  }
  .dest-selector-grid,
  .calc-options-row,
  .calc-metrics-grid,
  .calc-preset-buttons {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   Interactive 16:9 to 9:16 Shorts Auto-Framing Simulator Widget
   ========================================================================== */

.shorts-framing-container {
  margin: 3rem 0 3.5rem;
  width: 100%;
}

.shorts-framing-card {
  background: radial-gradient(circle at top right, rgba(137, 180, 250, 0.07), transparent 50%), rgba(24, 24, 37, 0.95);
  border: 1px solid rgba(137, 180, 250, 0.25);
  border-radius: 20px;
  padding: 2.25rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), 0 0 30px rgba(137, 180, 250, 0.06);
  backdrop-filter: blur(16px);
  position: relative;
  overflow: hidden;
}

.shorts-framing-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.5rem;
  margin-bottom: 1.75rem;
}

.framing-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--blue);
  background: rgba(137, 180, 250, 0.12);
  border: 1px solid rgba(137, 180, 250, 0.3);
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  margin-bottom: 0.6rem;
}

.framing-pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 10px var(--blue);
  animation: framing-pulse 1.6s infinite ease-in-out;
}

@keyframes framing-pulse {
  0%, 100% { transform: scale(0.9); opacity: 0.8; }
  50% { transform: scale(1.3); opacity: 1; }
}

.shorts-framing-title-group h4 {
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 0.4rem;
  letter-spacing: -0.02em;
}

.shorts-framing-title-group p {
  color: var(--subtext);
  font-size: 0.92rem;
  max-width: 820px;
  line-height: 1.5;
  margin: 0;
}

/* Mode Buttons */
.framing-modes-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.framing-mode-btn {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 1.1rem;
  text-align: left;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  position: relative;
  color: var(--text);
}

.framing-mode-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(137, 180, 250, 0.4);
  transform: translateY(-2px);
}

.framing-mode-btn.active {
  background: linear-gradient(135deg, rgba(137, 180, 250, 0.15), rgba(203, 166, 247, 0.08));
  border-color: var(--blue);
  box-shadow: 0 6px 20px rgba(137, 180, 250, 0.2), inset 0 0 0 1px var(--blue);
}

.mode-btn-icon {
  font-size: 1.35rem;
}

.mode-btn-content {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.mode-btn-title {
  font-weight: 700;
  font-size: 0.96rem;
  color: var(--text);
  line-height: 1.3;
}

.framing-mode-btn.active .mode-btn-title {
  color: var(--blue);
}

.mode-btn-desc {
  font-size: 0.78rem;
  color: var(--subtext);
  line-height: 1.35;
}

.mode-badge-waste {
  color: var(--red);
  background: rgba(243, 139, 168, 0.15);
  border: 1px solid rgba(243, 139, 168, 0.35);
  font-size: 0.7rem;
  font-weight: 700;
  border-radius: 999px;
  padding: 0.15rem 0.55rem;
  align-self: flex-start;
}

.mode-badge-popular {
  color: var(--green);
  background: rgba(166, 227, 161, 0.15);
  border: 1px solid rgba(166, 227, 161, 0.35);
  font-size: 0.7rem;
  font-weight: 700;
  border-radius: 999px;
  padding: 0.15rem 0.55rem;
  align-self: flex-start;
}

.mode-badge-smart {
  color: var(--mauve);
  background: rgba(203, 166, 247, 0.15);
  border: 1px solid rgba(203, 166, 247, 0.35);
  font-size: 0.7rem;
  font-weight: 700;
  border-radius: 999px;
  padding: 0.15rem 0.55rem;
  align-self: flex-start;
}

.mode-badge-fill {
  color: #00f0ff;
  background: rgba(0, 240, 255, 0.15);
  border: 1px solid rgba(0, 240, 255, 0.35);
  font-size: 0.7rem;
  font-weight: 700;
  border-radius: 999px;
  padding: 0.15rem 0.55rem;
  align-self: flex-start;
}

/* Dual-Canvas Visual Container */
.framing-dual-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 1.75rem;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  padding: 1.75rem;
}

.framing-canvas-col {
  display: flex;
  flex-direction: column;
}

.framing-source-col {
  flex: 1.5;
  min-width: 0;
}

.framing-output-col {
  flex: 1;
  max-width: 360px;
  min-width: 270px;
  align-items: center;
}

.framing-canvas-header {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.canvas-header-left {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.canvas-tag {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text);
}

.canvas-tag.tag-shorts {
  color: var(--blue);
}

.canvas-res-pill {
  font-size: 0.72rem;
  font-family: monospace;
  color: var(--subtext);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
}

.live-rec-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ef4444;
  box-shadow: 0 0 8px #ef4444;
  display: inline-block;
  animation: rec-blink 1s infinite alternate;
}

@keyframes rec-blink {
  from { opacity: 0.3; }
  to { opacity: 1; }
}

.live-rec-text {
  font-size: 0.75rem;
  color: var(--dim);
}

.shorts-mode-badge {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--blue);
  background: rgba(137, 180, 250, 0.12);
  border: 1px solid rgba(137, 180, 250, 0.3);
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
}

/* Master Source Viewport (16:9) */
.framing-source-viewport {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  background: #0b0e14;
}

.framing-source-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Guides Overlay */
.framing-guide-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.guide-box {
  position: absolute;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.guide-label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.7rem;
  font-weight: 700;
  font-family: monospace;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  white-space: nowrap;
}

.guide-pulse {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 6px currentColor;
}

/* Raw Guide */
.guide-raw {
  inset: 0;
  border: 2px dashed rgba(243, 139, 168, 0.85);
  background: rgba(243, 139, 168, 0.05);
}
.guide-raw .guide-label {
  background: rgba(243, 139, 168, 0.85);
  color: #11111b;
  position: absolute;
  top: 8px;
  left: 8px;
}

/* Blurred Guide */
.guide-blurred {
  inset: 0;
  border: 2px solid rgba(137, 180, 250, 0.85);
  background: rgba(137, 180, 250, 0.08);
}
.guide-blurred .guide-label {
  background: rgba(137, 180, 250, 0.9);
  color: #11111b;
  position: absolute;
  top: 8px;
  left: 8px;
}

/* Split Guides */
.guide-facecam {
  top: 3%;
  right: 2%;
  width: 23%;
  height: 26%;
  border: 2px solid #00f0ff;
  background: rgba(0, 240, 255, 0.16);
  border-radius: 6px;
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.4);
}
.guide-facecam .guide-label {
  background: #00f0ff;
  color: #0b0e14;
  position: absolute;
  bottom: -22px;
  right: 0;
}

.guide-gameplay {
  bottom: 4%;
  left: 28%;
  width: 54%;
  height: 62%;
  border: 2px solid #cba6f7;
  background: rgba(203, 166, 247, 0.14);
  border-radius: 6px;
  box-shadow: 0 0 15px rgba(203, 166, 247, 0.35);
}
.guide-gameplay .guide-label {
  background: #cba6f7;
  color: #0b0e14;
  position: absolute;
  top: -22px;
  left: 0;
}

/* Crop Guide */
.guide-crop {
  top: 0;
  bottom: 0;
  width: 31.64%;
  left: calc((100% - 31.64%) * (var(--crop-pan-num, 50) / 100));
  border: 2px solid #a6e3a1;
  background: rgba(166, 227, 161, 0.14);
  box-shadow: 0 0 20px rgba(166, 227, 161, 0.45);
  transition: left 0.18s ease-out;
}
.guide-crop-header {
  position: absolute;
  top: 8px;
  left: 6px;
  right: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.guide-crop .guide-label {
  background: #a6e3a1;
  color: #0b0e14;
}
.guide-crop-coords {
  background: rgba(0, 0, 0, 0.7);
  color: #a6e3a1;
  border: 1px solid #a6e3a1;
  font-size: 0.68rem;
  font-family: monospace;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
}
.guide-crop-crosshair {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(166, 227, 161, 0.8);
  border-radius: 50%;
  pointer-events: none;
}
.guide-crop-crosshair::before,
.guide-crop-crosshair::after {
  content: "";
  position: absolute;
  background: rgba(166, 227, 161, 0.8);
}
.guide-crop-crosshair::before {
  top: 9px;
  left: -4px;
  right: -4px;
  height: 1px;
}
.guide-crop-crosshair::after {
  left: 9px;
  top: -4px;
  bottom: -4px;
  width: 1px;
}

/* Canvas Overlays */
.canvas-bottom-overlay {
  position: absolute;
  bottom: 8px;
  left: 10px;
  right: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: none;
}

.canvas-timecode {
  font-family: monospace;
  font-size: 0.72rem;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.canvas-audio-meter {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 16px;
  background: rgba(0, 0, 0, 0.65);
  padding: 3px 5px;
  border-radius: 4px;
}

.audio-bar-ch {
  width: 3px;
  background: #a6e3a1;
  border-radius: 1px;
  animation: audio-meter-bounce 0.6s infinite alternate ease-in-out;
}
.audio-bar-ch:nth-child(2) { animation-delay: 0.15s; background: #89b4fa; }
.audio-bar-ch:nth-child(3) { animation-delay: 0.3s; background: #cba6f7; }
.audio-bar-ch:nth-child(4) { animation-delay: 0.45s; background: #f9e2af; }

@keyframes audio-meter-bounce {
  from { transform: scaleY(0.4); }
  to { transform: scaleY(1); }
}

.framing-canvas-footer {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.75rem;
  padding: 0 0.2rem;
}

.canvas-meta-item {
  font-size: 0.75rem;
  color: var(--dim);
}

.canvas-meta-item .meta-val {
  color: var(--text);
  font-weight: 600;
  margin-left: 0.25rem;
}

/* Flow Arrow Indicator */
.framing-flow-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0 0.5rem;
}

.flow-line {
  width: 2px;
  height: 40px;
  background: linear-gradient(180deg, transparent, rgba(137, 180, 250, 0.4), transparent);
}

.flow-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--blue);
  background: rgba(137, 180, 250, 0.1);
  border: 1px solid rgba(137, 180, 250, 0.3);
  border-radius: 999px;
  padding: 0.45rem 0.8rem;
  text-align: center;
  gap: 0.2rem;
  box-shadow: 0 0 15px rgba(137, 180, 250, 0.15);
}

.flow-arrow {
  font-size: 1.15rem;
  color: var(--blue);
  line-height: 1;
}

/* Phone Device Mockup (9:16) */
.shorts-phone-frame {
  width: 250px;
  aspect-ratio: 9 / 16;
  background: #000;
  border-radius: 36px;
  padding: 10px;
  border: 4px solid #313244;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.1), 0 0 35px rgba(137, 180, 250, 0.12);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.phone-notch {
  position: absolute;
  top: 13px;
  left: 50%;
  transform: translateX(-50%);
  width: 76px;
  height: 16px;
  background: #000;
  border-radius: 999px;
  z-index: 15;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.phone-speaker {
  width: 28px;
  height: 3px;
  background: #313244;
  border-radius: 2px;
}

.phone-cam-dot {
  width: 6px;
  height: 6px;
  background: #11111b;
  border-radius: 50%;
  border: 1px solid #45475a;
}

.shorts-display-canvas {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 26px;
  overflow: hidden;
  background: #000;
}

/* Layer 1: Backfill */
.shorts-backfill-layer {
  position: absolute;
  inset: 0;
  overflow: hidden;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 1;
}

.backfill-bg-img {
  position: absolute;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(var(--blur-radius, 20px)) brightness(0.6) saturate(1.3);
  transform: scale(2.2);
}

.backfill-vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, transparent 35%, rgba(0, 0, 0, 0.7) 100%);
}

/* Layer 2: Main Video Layer */
.shorts-video-layer {
  position: absolute;
  inset: 0;
  z-index: 2;
  transition: all 0.25s ease;
  overflow: hidden;
}

.shorts-main-img {
  width: 100%;
  height: 100%;
  display: block;
}

/* Layer 3: Split Stack Layer */
.shorts-split-layer {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: none;
  flex-direction: column;
}

.split-section {
  position: relative;
  overflow: hidden;
  background: #0b0e14;
}

.split-facecam-section {
  height: var(--split-cam-h, 38%);
  border-bottom: 2px solid rgba(0, 240, 255, 0.4);
}

.split-viewport {
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
}

.split-img-facecam {
  position: absolute;
  width: 380%;
  max-width: none;
  height: auto;
  top: 0;
  right: 0;
  transform: translate(3%, -2%);
}

.split-cam-pill {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(0, 240, 255, 0.85);
  color: #0b0e14;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  z-index: 3;
}

.split-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #0b0e14;
}

.split-divider-bar {
  height: 24px;
  background: #11111b;
  border-top: 1px solid rgba(0, 240, 255, 0.3);
  border-bottom: 1px solid rgba(203, 166, 247, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 3;
}

.split-divider-badge {
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  background: linear-gradient(90deg, #00f0ff, #cba6f7);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.split-gameplay-section {
  height: calc(100% - var(--split-cam-h, 38%) - 24px);
}

.split-img-gameplay {
  position: absolute;
  width: 180%;
  max-width: none;
  height: auto;
  top: 50%;
  left: 50%;
  transform: translate(-48%, -42%);
}

.split-action-pill {
  position: absolute;
  bottom: 8px;
  left: 8px;
  background: rgba(203, 166, 247, 0.85);
  color: #0b0e14;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  z-index: 3;
}

/* Layer 4: Social UI Overlay */
.shorts-ui-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 6;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1.5rem 0.75rem 0.85rem;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9);
  color: #fff;
}

.shorts-ui-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.shorts-sound-tag {
  font-size: 0.62rem;
  font-weight: 600;
  background: rgba(0, 0, 0, 0.5);
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  backdrop-filter: blur(4px);
}

.shorts-hd-tag {
  font-size: 0.62rem;
  font-weight: 800;
  background: rgba(137, 180, 250, 0.85);
  color: #11111b;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
}

.shorts-ui-sidebar {
  align-self: flex-end;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
  margin-right: 0.1rem;
}

.shorts-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
}

.action-ico {
  font-size: 1.1rem;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.6));
}

.action-cnt {
  font-size: 0.62rem;
  font-weight: 700;
}

.shorts-ui-bottom {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.shorts-creator-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.shorts-avatar {
  font-size: 0.85rem;
}

.shorts-handle {
  font-size: 0.72rem;
  font-weight: 700;
}

.shorts-sub-pill {
  font-size: 0.58rem;
  font-weight: 800;
  background: #ff0000;
  color: #fff;
  padding: 0.15rem 0.4rem;
  border-radius: 999px;
  text-transform: uppercase;
}

.shorts-caption {
  font-size: 0.65rem;
  margin: 0;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.9);
}

/* ==========================================================================
   CSS TRANSFORMS & MODE-SPECIFIC STYLES
   ========================================================================== */

/* 1. Raw Mode */
#framing-dual-container[data-mode="raw"] #guide-raw-box { opacity: 1; }
#framing-dual-container[data-mode="raw"] #shorts-backfill-layer { opacity: 0; }
#framing-dual-container[data-mode="raw"] #shorts-video-layer {
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  aspect-ratio: 16 / 9;
  transform: translateY(-50%);
  display: block;
}
#framing-dual-container[data-mode="raw"] #shorts-main-img {
  object-fit: contain;
}
#framing-dual-container[data-mode="raw"] #shorts-split-layer { display: none; }

/* 2. Blurred Mode */
#framing-dual-container[data-mode="blurred"] #guide-blurred-box { opacity: 1; }
#framing-dual-container[data-mode="blurred"] #shorts-backfill-layer { opacity: 1; }
#framing-dual-container[data-mode="blurred"] #shorts-video-layer {
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  aspect-ratio: 16 / 9;
  transform: translateY(-50%);
  display: block;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.8), 0 0 2px rgba(255, 255, 255, 0.25);
}
#framing-dual-container[data-mode="blurred"] #shorts-main-img {
  object-fit: contain;
}
#framing-dual-container[data-mode="blurred"] #shorts-split-layer { display: none; }

/* 3. Split Mode */
#framing-dual-container[data-mode="split"] #guide-facecam-box,
#framing-dual-container[data-mode="split"] #guide-gameplay-box { opacity: 1; }
#framing-dual-container[data-mode="split"] #shorts-backfill-layer { opacity: 0; }
#framing-dual-container[data-mode="split"] #shorts-video-layer { display: none; }
#framing-dual-container[data-mode="split"] #shorts-split-layer { display: flex; }

/* 4. Center Dynamic Crop Mode */
#framing-dual-container[data-mode="crop"] #guide-crop-box { opacity: 1; }
#framing-dual-container[data-mode="crop"] #shorts-backfill-layer { opacity: 0; }
#framing-dual-container[data-mode="crop"] #shorts-split-layer { display: none; }
#framing-dual-container[data-mode="crop"] #shorts-video-layer {
  position: absolute;
  inset: 0;
  display: block;
}
#framing-dual-container[data-mode="crop"] #shorts-main-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--crop-pan, 50%) 50%;
  transition: object-position 0.18s ease-out;
}

/* Sub-toolbar Controls */
.framing-toolbar {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  padding: 1.15rem;
  margin-bottom: 1.5rem;
}

.toolbar-subpanel {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.toolbar-subpanel[hidden] {
  display: none !important;
}

.toolbar-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
}

.toolbar-group label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text);
}

.toolbar-pan-row,
.split-preset-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.pan-preset-btn.active,
.blur-preset-btn.active,
.split-ratio-btn.active,
.cam-zone-btn.active {
  background: var(--blue) !important;
  color: #11111b !important;
  font-weight: 700;
}

.framing-toggle-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  color: var(--text);
  cursor: pointer;
}

.raw-warning-callout {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  background: rgba(243, 139, 168, 0.1);
  border: 1px solid rgba(243, 139, 168, 0.3);
  border-radius: 10px;
  padding: 0.85rem 1.15rem;
  width: 100%;
}

.raw-callout-icon {
  font-size: 1.4rem;
}

.raw-callout-text {
  font-size: 0.85rem;
  color: var(--text);
  line-height: 1.4;
}

/* Metrics Grid */
.framing-metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.framing-metric-box {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 1.1rem;
  display: flex;
  flex-direction: column;
  transition: all 0.2s ease;
}

.metric-top {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.4rem;
}

.metric-top .metric-icon {
  font-size: 1rem;
}

.metric-top .metric-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--dim);
}

.metric-value {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text);
  font-family: monospace;
}

.metric-sub {
  font-size: 0.74rem;
  color: var(--dim);
  margin-top: 0.25rem;
}

/* Footer Explanation & Actions */
.framing-footer-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 1.25rem;
  flex-wrap: wrap;
}

.framing-explanation {
  font-size: 0.85rem;
  color: var(--subtext);
  line-height: 1.5;
  flex: 1;
  min-width: 260px;
}

.framing-actions {
  display: flex;
  gap: 0.75rem;
}

/* Responsive Rules */
@media (max-width: 960px) {
  .framing-modes-bar {
    grid-template-columns: 1fr 1fr;
  }
  .framing-dual-container {
    flex-direction: column;
  }
  .framing-flow-indicator {
    transform: rotate(90deg);
    margin: 1rem 0;
  }
  .framing-metrics-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 600px) {
  .framing-modes-bar {
    grid-template-columns: 1fr;
  }
  .framing-metrics-grid {
    grid-template-columns: 1fr;
  }
  .toolbar-subpanel {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ==========================================================================
   Live API Server Status and Latency Indicator Badge (#api-status-badge)
   ========================================================================== */

#api-status-badge,
.api-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.28rem 0.65rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  user-select: none;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text);
  transition: all 0.25s ease;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

#api-status-badge:hover,
.api-status-badge:hover {
  border-color: var(--blue);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Online State */
#api-status-badge.online,
.api-status-badge.online {
  background: rgba(166, 227, 161, 0.12);
  border-color: rgba(166, 227, 161, 0.35);
  color: var(--green);
}

#api-status-badge.online:hover,
.api-status-badge.online:hover {
  background: rgba(166, 227, 161, 0.18);
  border-color: var(--green);
  box-shadow: 0 0 12px rgba(166, 227, 161, 0.25);
}

/* Offline State */
#api-status-badge.offline,
.api-status-badge.offline {
  background: rgba(243, 139, 168, 0.12);
  border-color: rgba(243, 139, 168, 0.35);
  color: var(--red);
}

#api-status-badge.offline:hover,
.api-status-badge.offline:hover {
  background: rgba(243, 139, 168, 0.18);
  border-color: var(--red);
  box-shadow: 0 0 12px rgba(243, 139, 168, 0.25);
}

/* Glowing Pulse Dot */
#api-status-badge .api-status-dot,
.api-status-badge .api-status-dot,
#api-status-badge .pulse-dot,
.api-status-badge .pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
  animation: apiStatusDotPulse 1.8s infinite ease-in-out;
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

#api-status-badge.offline .api-status-dot,
.api-status-badge.offline .api-status-dot,
#api-status-badge.offline .pulse-dot,
.api-status-badge.offline .pulse-dot {
  background: var(--red);
  box-shadow: 0 0 8px var(--red);
  animation: apiStatusDotPulseOffline 2.4s infinite ease-in-out;
}

@keyframes apiStatusDotPulse {
  0%, 100% {
    transform: scale(0.9);
    opacity: 0.7;
    box-shadow: 0 0 4px var(--green);
  }
  50% {
    transform: scale(1.25);
    opacity: 1;
    box-shadow: 0 0 10px var(--green), 0 0 16px rgba(166, 227, 161, 0.5);
  }
}

@keyframes apiStatusDotPulseOffline {
  0%, 100% {
    transform: scale(0.95);
    opacity: 0.6;
    box-shadow: 0 0 4px var(--red);
  }
  50% {
    transform: scale(1.15);
    opacity: 1;
    box-shadow: 0 0 8px var(--red), 0 0 14px rgba(243, 139, 168, 0.4);
  }
}

#api-status-badge .api-status-text,
.api-status-badge .api-status-text {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}

@media (max-width: 900px) {
  .nav #api-status-badge {
    padding: 0.22rem 0.5rem;
    font-size: 0.7rem;
  }
}

@media (max-width: 600px) {
  .nav #api-status-badge {
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .nav #api-status-badge .api-status-text {
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

/* ---------- Reduced Motion (WCAG 2.1 Success Criterion 2.3.3) ---------- */

@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;
  }
}

/* ==========================================================================
   Print Stylesheet - Responsive High-Contrast Monochrome Rules
   ========================================================================== */

@media print {
  /* Page Setup & Margin Configuration */
  @page {
    margin: 1.5cm;
    size: auto;
  }

  /* Reset all backgrounds to pure white and text to high-contrast black */
  *,
  *::before,
  *::after {
    background: #fff !important;
    background-color: #fff !important;
    color: #000 !important;
    box-shadow: none !important;
    text-shadow: none !important;
    filter: none !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  html,
  body {
    background: #fff !important;
    background-color: #fff !important;
    color: #000 !important;
    font-size: 11pt !important;
    line-height: 1.5 !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  /* Hide decorative glows, ambient backgrounds, and interactive navigation/controls */
  .nav,
  .modal-backdrop,
  .btn-back-to-top,
  .hero-glow,
  .mobile-drawer,
  .mobile-drawer-overlay,
  .drawer-backdrop,
  .modal,
  .hero-actions,
  .nav-actions,
  .nav-toggle,
  .drawer-close,
  .toast-container,
  .toast,
  .api-status-badge,
  .btn,
  button,
  .hero-visual-tabs,
  .tab-buttons,
  .controls-panel,
  .av-controls-grid,
  .vod-inputs-panel,
  .interactive-hint,
  .skip-link,
  .hero-fine,
  .network-status-banner {
    display: none !important;
  }

  /* Headings: high-contrast black with page-break-after protection */
  h1,
  h2,
  h3,
  h4,
  h5,
  h6 {
    color: #000 !important;
    page-break-after: avoid;
    break-after: avoid;
    font-weight: 700 !important;
  }

  /* Clean section pagination */
  section,
  article,
  header,
  footer {
    page-break-inside: auto;
    break-inside: auto;
    padding: 1.5rem 0 !important;
  }

  /* Ensure page breaks do not cut through feature cards, tables, shortcuts, and items */
  .card,
  .feature-card,
  .studio-card,
  .price-card,
  .tier-card,
  .pipeline-step,
  .pipeline-card,
  .spec-card,
  .shortcut-card,
  .judge-card,
  .faq-item,
  .faq-question,
  .comparison-table,
  .comparison-wrap,
  .vod-estimator-card,
  .vod-metric-box,
  .table-wrap,
  table,
  tr,
  td,
  th,
  blockquote,
  pre,
  code,
  ul,
  ol,
  li {
    page-break-inside: avoid;
    break-inside: avoid;
  }

  /* High-contrast monochrome borders for cards, boxes, and containers */
  .card,
  .feature-card,
  .studio-card,
  .price-card,
  .tier-card,
  .pipeline-step,
  .pipeline-card,
  .spec-card,
  .shortcut-card,
  .judge-card,
  .vod-estimator-card,
  .vod-metric-box,
  .faq-item {
    border: 1px solid #000 !important;
    border-radius: 4px !important;
    padding: 1rem !important;
    margin-bottom: 1rem !important;
  }

  /* High-contrast table formatting */
  table {
    border-collapse: collapse !important;
    width: 100% !important;
    border: 1px solid #000 !important;
    margin: 1rem 0 !important;
  }

  th,
  td {
    border: 1px solid #000 !important;
    padding: 8px 12px !important;
    text-align: left !important;
    color: #000 !important;
    font-size: 10pt !important;
  }

  th {
    font-weight: 700 !important;
    border-bottom: 2px solid #000 !important;
  }

  /* Expand collapsible accordion and FAQ content for full print visibility */
  .faq-answer,
  .accordion-content,
  details[open] summary ~ * {
    display: block !important;
    max-height: none !important;
    opacity: 1 !important;
    visibility: visible !important;
    color: #000 !important;
  }

  /* High-contrast monochrome links with underlines */
  a,
  a:visited {
    color: #000 !important;
    text-decoration: underline !important;
  }

  /* Images and SVGs: keep responsive, avoid page breaks */
  img,
  svg {
    max-width: 100% !important;
    height: auto !important;
    page-break-inside: avoid;
    break-inside: avoid;
  }
}

/* ==========================================================================
   Download Package Architecture Selector & SHA-256 Checksum Hub Styles
   ========================================================================== */
.download-hub-card {
  background: linear-gradient(145deg, rgba(30, 30, 46, 0.95), rgba(24, 24, 37, 0.98));
  border: 1px solid rgba(137, 180, 250, 0.25);
  border-radius: 18px;
  padding: 2rem 2.25rem;
  margin: 2rem 0 3rem;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35), 0 0 30px rgba(137, 180, 250, 0.08);
  position: relative;
  overflow: hidden;
}

.download-hub-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 15%;
  right: 15%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--blue), var(--lavender), transparent);
  opacity: 0.8;
}

.download-hub-header {
  margin-bottom: 1.75rem;
}

.download-hub-badge-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.badge-release {
  background: rgba(166, 227, 161, 0.15);
  color: var(--green);
  border: 1px solid rgba(166, 227, 161, 0.3);
  font-weight: 600;
}

.badge-subtle {
  background: rgba(186, 194, 222, 0.1);
  color: var(--subtext0);
  border: 1px solid rgba(186, 194, 222, 0.2);
}

.badge-verified {
  background: rgba(137, 180, 250, 0.15);
  color: var(--blue);
  border: 1px solid rgba(137, 180, 250, 0.3);
}

.download-hub-header h3 {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.35rem;
  letter-spacing: -0.01em;
}

.download-hub-sub {
  color: var(--subtext0);
  font-size: 0.95rem;
  margin: 0;
  max-width: 650px;
}

.download-selector-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.75rem;
  align-items: end;
}

@media (max-width: 900px) {
  .download-selector-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }
}

.download-control-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.download-field-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--subtext0);
}

.download-select-wrapper {
  position: relative;
  width: 100%;
}

.download-package-select {
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  background: var(--surface0);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 0.85rem 2.5rem 0.85rem 1rem;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.download-package-select:hover {
  border-color: var(--blue);
}

.download-package-select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(137, 180, 250, 0.25);
  outline: none;
}

.download-package-select:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}

.select-chevron {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--subtext0);
  font-size: 0.85rem;
}

.badge-filesize {
  background: rgba(137, 180, 250, 0.15);
  color: var(--blue);
  border: 1px solid rgba(137, 180, 250, 0.35);
  font-weight: 700;
  font-size: 0.78rem;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  letter-spacing: 0.02em;
}

.download-package-specs {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 0.25rem;
}

.spec-tag {
  font-size: 0.78rem;
  color: var(--subtext0);
  background: rgba(24, 24, 37, 0.5);
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
  border: 1px solid var(--surface1);
}

.download-buttons-group {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.btn-download-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.95rem 1.4rem;
  background: linear-gradient(135deg, var(--blue), #7287fd);
  color: #11111b !important;
  font-weight: 700;
  border-radius: 12px;
  text-decoration: none !important;
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
  box-shadow: 0 8px 24px rgba(137, 180, 250, 0.3);
  border: none;
}

.btn-download-main:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(137, 180, 250, 0.45);
  filter: brightness(1.06);
}

.btn-download-icon {
  font-size: 1.35rem;
  line-height: 1;
}

.btn-download-text-wrap {
  display: flex;
  flex-direction: column;
  text-align: left;
  flex: 1;
}

.btn-download-title {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.25;
}

.btn-download-sub {
  font-size: 0.75rem;
  opacity: 0.85;
  font-weight: 500;
}

.badge-download-size {
  background: rgba(17, 17, 27, 0.25);
  color: #11111b;
  font-weight: 700;
  font-size: 0.82rem;
  padding: 0.25rem 0.65rem;
  border-radius: 8px;
  white-space: nowrap;
}

.download-aux-actions {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  flex-wrap: wrap;
}

.btn-checksum-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--surface0);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.55rem 0.95rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-checksum-toggle:hover,
.btn-checksum-toggle[aria-expanded="true"] {
  border-color: var(--blue);
  background: var(--surface1);
  color: var(--blue);
}

.btn-checksum-toggle .toggle-arrow {
  display: inline-block;
  transition: transform 0.2s ease;
  font-size: 0.8rem;
}

.btn-checksum-toggle[aria-expanded="true"] .toggle-arrow {
  transform: rotate(180deg);
}

.btn-open-checksum-modal {
  font-size: 0.85rem;
  color: var(--subtext0);
}

.btn-open-checksum-modal:hover {
  color: var(--blue);
}

/* Inline Checksum Panel Drawer */
.checksum-inline-panel {
  margin-top: 1.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  animation: fadeInDown 0.25s ease-out forwards;
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.checksum-panel-card {
  background: var(--crust);
  border: 1px solid var(--surface0);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.checksum-panel-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--surface0);
}

.checksum-panel-meta {
  font-size: 0.88rem;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.meta-label {
  color: var(--subtext0);
}

.checksum-row {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.checksum-row-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.checksum-field-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--lavender);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.copy-status-indicator,
.copy-feedback-badge {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--green);
  background: rgba(166, 227, 161, 0.15);
  padding: 0.15rem 0.5rem;
  border-radius: 5px;
  animation: fadeIn 0.2s ease;
}

.checksum-field-wrap {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.checksum-hash-input {
  font-family: var(--font-mono, monospace);
  font-size: 0.88rem;
  background: var(--mantle);
  border: 1px solid var(--line);
  color: var(--peach);
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  flex: 1;
  letter-spacing: 0.03em;
}

.powershell-wrap {
  align-items: stretch;
}

.powershell-terminal-box {
  background: #0f101a;
  border: 1px solid rgba(137, 180, 250, 0.2);
  border-radius: 8px;
  display: flex;
  align-items: center;
  padding: 0.65rem 0.85rem;
  flex: 1;
  gap: 0.5rem;
  overflow: hidden;
}

.ps-prompt {
  color: var(--lavender);
  font-family: var(--font-mono, monospace);
  font-weight: 700;
  font-size: 0.85rem;
  user-select: none;
}

.powershell-input {
  background: transparent;
  border: none;
  outline: none;
  font-family: var(--font-mono, monospace);
  font-size: 0.85rem;
  color: var(--text);
  width: 100%;
}

.powershell-cmd-code {
  font-family: var(--font-mono, monospace);
  font-size: 0.85rem;
  color: var(--text);
  background: transparent;
  padding: 0;
  display: inline-block;
  word-break: break-all;
}

.checksum-instruction-text {
  font-size: 0.82rem;
  color: var(--subtext0);
  margin: 0;
}

.checksum-explainer,
.checksum-verify-hint {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  font-size: 0.8rem;
  color: var(--subtext0);
  background: rgba(137, 180, 250, 0.05);
  border-left: 3px solid var(--blue);
  padding: 0.5rem 0.75rem;
  border-radius: 0 6px 6px 0;
  margin-top: 0.35rem;
  line-height: 1.45;
}

/* Checksum Modal Styles */
.checksum-modal-card {
  max-width: 860px;
  width: 95%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.checksum-header-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.checksum-modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.checksum-active-section {
  background: var(--crust);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.25rem 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.checksum-active-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.active-badge-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.checksum-active-header h4 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  margin: 0.15rem 0;
}

.modal-package-meta {
  font-size: 0.82rem;
  color: var(--subtext0);
}

.checksum-active-hash-box {
  background: var(--mantle);
  border: 1px solid var(--surface0);
  border-radius: 8px;
  padding: 0.85rem 1rem;
}

.hash-box-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.4rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--lavender);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.hash-display-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.package-hash-code {
  font-family: var(--font-mono, monospace);
  font-size: 0.88rem;
  color: var(--peach);
  word-break: break-all;
  user-select: all;
  background: rgba(0, 0, 0, 0.2);
  padding: 0.35rem 0.55rem;
  border-radius: 6px;
}

.checksum-active-instructions h5,
.checksum-tester-section h5,
.checksum-all-packages-section h5 {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.checksum-steps-list {
  margin: 0 0 0.75rem 1.25rem;
  padding: 0;
  font-size: 0.85rem;
  color: var(--subtext0);
  line-height: 1.5;
}

.powershell-code-row {
  display: flex;
  gap: 0.6rem;
  align-items: stretch;
  margin-bottom: 0.6rem;
}

.powershell-oneliner-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  background: #0f101a;
  border: 1px solid rgba(137, 180, 250, 0.15);
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  margin-top: 0.4rem;
}

.powershell-oneliner-row .powershell-cmd-code {
  flex: 1;
  font-size: 0.8rem;
  color: var(--green);
}

/* Tester section */
.checksum-tester-section {
  background: var(--crust);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.25rem 1.4rem;
}

.tester-header p,
.all-packages-header p {
  font-size: 0.84rem;
  color: var(--subtext0);
  margin: 0 0 0.75rem;
}

.tester-input-row {
  position: relative;
  display: flex;
  align-items: center;
}

.checksum-input {
  width: 100%;
  font-family: var(--font-mono, monospace);
  font-size: 0.85rem;
  padding: 0.7rem 2.2rem 0.7rem 0.85rem;
}

.checksum-result-badge {
  margin-top: 0.65rem;
  padding: 0.65rem 0.9rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  animation: fadeIn 0.2s ease;
}

.checksum-result-badge.match {
  background: rgba(166, 227, 161, 0.15);
  color: var(--green);
  border: 1px solid rgba(166, 227, 161, 0.35);
}

.checksum-result-badge.mismatch {
  background: rgba(243, 139, 168, 0.15);
  color: var(--red);
  border: 1px solid rgba(243, 139, 168, 0.35);
}

.checksum-result-badge.partial {
  background: rgba(249, 226, 175, 0.15);
  color: var(--yellow);
  border: 1px solid rgba(249, 226, 175, 0.35);
}

/* All Packages Table */
.checksum-all-packages-section {
  background: var(--crust);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.25rem 1.4rem;
}

.checksum-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.checksum-table th {
  text-align: left;
  padding: 0.65rem 0.75rem;
  color: var(--lavender);
  font-weight: 600;
  border-bottom: 1px solid var(--line);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.checksum-table td {
  padding: 0.75rem 0.75rem;
  border-bottom: 1px solid var(--surface0);
  vertical-align: middle;
}

.pkg-row.active {
  background: rgba(137, 180, 250, 0.08);
}

.pkg-subfilename {
  font-size: 0.75rem;
  color: var(--subtext0);
  font-family: var(--font-mono, monospace);
  margin-top: 0.2rem;
}

.table-hash-code {
  font-family: var(--font-mono, monospace);
  font-size: 0.75rem;
  color: var(--peach);
  background: var(--mantle);
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  max-width: 200px;
  display: inline-block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.checksum-modal-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  background: var(--mantle);
  border-top: 1px solid var(--line);
}

.checksum-footer-hint {
  font-size: 0.8rem;
  color: var(--subtext0);
}

/* ==========================================================================
   Interactive YouTube & TikTok Local AI Title & Hook Generator Widget
   ========================================================================== */

.ai-hook-generator-container {
  margin: 3.5rem 0 3.5rem;
  width: 100%;
  position: relative;
}

.ai-anchor-target {
  position: absolute;
  top: -90px;
  left: 0;
  visibility: hidden;
  pointer-events: none;
}

.ai-hook-card {
  background: radial-gradient(circle at top right, rgba(203, 166, 247, 0.08), transparent 45%),
              radial-gradient(circle at bottom left, rgba(137, 180, 250, 0.06), transparent 50%),
              rgba(24, 24, 37, 0.96);
  border: 1px solid rgba(203, 166, 247, 0.25);
  border-radius: 20px;
  padding: 2.25rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), 0 0 30px rgba(203, 166, 247, 0.05);
  backdrop-filter: blur(16px);
  position: relative;
  overflow: hidden;
}

.ai-hook-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.5rem;
  margin-bottom: 1.75rem;
  flex-wrap: wrap;
}

.ai-hook-badges {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.6rem;
}

.ai-hook-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--mauve);
  background: rgba(203, 166, 247, 0.12);
  border: 1px solid rgba(203, 166, 247, 0.3);
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
}

.ai-hook-pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--mauve);
  box-shadow: 0 0 10px var(--mauve);
  animation: ai-pulse 1.6s infinite ease-in-out;
}

@keyframes ai-pulse {
  0%, 100% { transform: scale(0.9); opacity: 0.8; }
  50% { transform: scale(1.3); opacity: 1; }
}

.ai-hook-sub-badge {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--subtext);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
}

.ai-hook-title-group h4 {
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 0.4rem;
  letter-spacing: -0.02em;
}

.ai-hook-title-group p {
  color: var(--subtext);
  font-size: 0.94rem;
  max-width: 860px;
  line-height: 1.5;
  margin: 0;
}

.ai-hook-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  background: rgba(166, 227, 161, 0.1);
  border: 1px solid rgba(166, 227, 161, 0.3);
  color: var(--green);
  white-space: nowrap;
}

.ai-hook-status-pill .pill-dot.live {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
}

/* Controls Panel */
.ai-hook-controls-panel {
  background: rgba(17, 17, 27, 0.7);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.4rem;
  margin-bottom: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.ai-control-group {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.ai-control-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--text);
}

.ai-control-label small {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--subtext0);
}

.ai-pill-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.6rem;
}

.ai-event-grid {
  grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
}

.ai-pill-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0.85rem;
  border-radius: 10px;
  background: var(--surface0);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  text-align: left;
  user-select: none;
}

.ai-pill-btn:hover {
  background: var(--surface1);
  border-color: rgba(203, 166, 247, 0.4);
  transform: translateY(-1px);
}

.ai-pill-btn.active {
  background: rgba(203, 166, 247, 0.16);
  border-color: var(--mauve);
  color: #fff;
  box-shadow: 0 0 14px rgba(203, 166, 247, 0.22);
}

.ai-pill-btn .pill-icon {
  font-size: 1.1rem;
  line-height: 1;
  flex-shrink: 0;
}

.ai-pill-btn .pill-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Engine Settings Bar */
.ai-engine-settings-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.ai-setting-item {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--subtext);
}

.ai-hook-select {
  background: var(--surface0);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 500;
  border-radius: 8px;
  padding: 0.35rem 0.65rem;
  outline: none;
  cursor: pointer;
  transition: border-color 0.2s;
}

.ai-hook-select:focus {
  border-color: var(--mauve);
}

.ai-platform-toggles {
  display: inline-flex;
  background: var(--surface0);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 2px;
  gap: 2px;
}

.ai-platform-btn {
  background: transparent;
  border: none;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--subtext);
  padding: 0.32rem 0.65rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.ai-platform-btn:hover {
  color: var(--text);
}

.ai-platform-btn.active {
  background: var(--mauve);
  color: #11111b;
  font-weight: 700;
}

.ai-action-buttons {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* Telemetry Strip */
.ai-telemetry-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.85rem;
  background: rgba(30, 30, 46, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 0.6rem 1rem;
  margin-bottom: 1.5rem;
  font-size: 0.8rem;
  font-family: monospace;
}

.telemetry-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.telemetry-item .telemetry-label {
  color: var(--subtext0);
}

.telemetry-item strong {
  color: var(--text);
}

.telemetry-dot.live {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 6px var(--green);
}

.telemetry-dot.streaming {
  background: var(--peach) !important;
  box-shadow: 0 0 8px var(--peach) !important;
  animation: ai-pulse 0.7s infinite alternate !important;
}

/* Output Display Grid */
.ai-hook-output-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  align-items: start;
}

@media (max-width: 960px) {
  .ai-hook-output-grid {
    grid-template-columns: 1fr;
  }
}

.ai-output-col {
  display: flex;
  flex-direction: column;
}

.ai-output-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.85rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.section-title-with-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.section-title-with-badge h5 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}

.ai-section-badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: rgba(137, 180, 250, 0.12);
  color: var(--blue);
  border: 1px solid rgba(137, 180, 250, 0.25);
}

.ai-section-badge.success {
  background: rgba(166, 227, 161, 0.12);
  color: var(--green);
  border-color: rgba(166, 227, 161, 0.25);
}

.ai-section-hint {
  font-size: 0.75rem;
  color: var(--subtext0);
}

/* Title Cards */
.ai-title-card {
  background: rgba(30, 30, 46, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 1.1rem;
  margin-bottom: 0.85rem;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
  position: relative;
}

.ai-title-card:hover {
  border-color: rgba(203, 166, 247, 0.35);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.ai-title-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.6rem;
}

.title-badge {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
}

.badge-high-stakes {
  background: rgba(243, 139, 168, 0.15);
  color: var(--red);
  border: 1px solid rgba(243, 139, 168, 0.3);
}

.badge-curiosity {
  background: rgba(250, 179, 135, 0.15);
  color: var(--peach);
  border: 1px solid rgba(250, 179, 135, 0.3);
}

.badge-seo {
  background: rgba(137, 180, 250, 0.15);
  color: var(--blue);
  border: 1px solid rgba(137, 180, 250, 0.3);
}

.ctr-badge {
  font-size: 0.74rem;
  font-weight: 800;
  font-family: monospace;
  color: var(--green);
  background: rgba(166, 227, 161, 0.12);
  border: 1px solid rgba(166, 227, 161, 0.3);
  padding: 0.18rem 0.5rem;
  border-radius: 999px;
}

.title-display {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.4;
  margin-bottom: 0.65rem;
  min-height: 2.8rem;
  word-break: break-word;
  cursor: pointer;
}

.ai-title-card-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 0.5rem;
  font-size: 0.75rem;
  color: var(--subtext0);
}

/* Hooks Container */
.ai-hooks-container {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.ai-hook-row {
  background: rgba(30, 30, 46, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 0.85rem 1rem;
}

.hook-row-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.4rem;
}

.hook-type-label {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--subtext);
}

.hook-display {
  font-size: 0.92rem;
  color: var(--text);
  line-height: 1.45;
  font-weight: 500;
  min-height: 2.2rem;
  word-break: break-word;
}

.visual-overlay-style {
  background: rgba(0, 0, 0, 0.4);
  border-left: 3px solid var(--yellow);
  padding: 0.4rem 0.65rem;
  border-radius: 4px;
  font-weight: 800;
  color: #f9e2af;
  font-family: monospace;
  font-size: 0.88rem;
}

/* Hashtags */
.ai-hashtags-box {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  background: rgba(30, 30, 46, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 0.85rem;
  min-height: 3.5rem;
}

.ai-hashtag-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.76rem;
  font-weight: 600;
  padding: 0.25rem 0.55rem;
  border-radius: 6px;
  background: rgba(137, 180, 250, 0.1);
  border: 1px solid rgba(137, 180, 250, 0.25);
  color: var(--blue);
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
}

.ai-hashtag-pill:hover {
  background: rgba(137, 180, 250, 0.2);
  transform: translateY(-1px);
}

.hashtag-rank {
  font-size: 0.65rem;
  font-weight: 800;
  background: var(--blue);
  color: #11111b;
  border-radius: 3px;
  padding: 1px 3px;
}

/* Description & Timestamps */
.ai-description-code-box {
  background: rgba(17, 17, 27, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 0.85rem 1rem;
  font-family: monospace;
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--subtext);
  white-space: pre-wrap;
  margin: 0;
  min-height: 6.5rem;
  max-height: 13rem;
  overflow-y: auto;
}

/* Streaming Animation & Cursor */
.streaming-caret {
  display: inline-block;
  width: 0.5em;
  height: 1.05em;
  vertical-align: -0.15em;
  background: var(--mauve);
  margin-left: 2px;
  animation: streaming-blink 0.65s infinite steps(2, start);
  border-radius: 1px;
}

@keyframes streaming-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* Footer note */
.ai-hook-footer-note {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-top: 1.5rem;
  padding: 0.85rem 1.15rem;
  background: rgba(137, 180, 250, 0.06);
  border: 1px solid rgba(137, 180, 250, 0.2);
  border-radius: 10px;
  font-size: 0.82rem;
  color: var(--subtext);
}

.footer-note-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
}

/* ==========================================================================
   Interactive Stream Deck & Keybind Macro Controller Simulator
   ========================================================================== */

.stream-deck-container {
  margin: 3.5rem 0 3.5rem;
  width: 100%;
  position: relative;
}

.deck-anchor-target {
  position: absolute;
  top: -90px;
  left: 0;
  visibility: hidden;
  pointer-events: none;
}

.stream-deck-card {
  background: radial-gradient(circle at top right, rgba(137, 180, 250, 0.08), transparent 45%),
              radial-gradient(circle at bottom left, rgba(203, 166, 247, 0.06), transparent 50%),
              rgba(24, 24, 37, 0.96);
  border: 1px solid rgba(137, 180, 250, 0.25);
  border-radius: 20px;
  padding: 2.25rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), 0 0 30px rgba(137, 180, 250, 0.05);
  backdrop-filter: blur(16px);
  position: relative;
  overflow: hidden;
}

.stream-deck-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.5rem;
  margin-bottom: 1.75rem;
  flex-wrap: wrap;
}

.deck-badges {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.6rem;
}

.deck-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--blue);
  background: rgba(137, 180, 250, 0.12);
  border: 1px solid rgba(137, 180, 250, 0.3);
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
}

.deck-pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 10px var(--blue);
  animation: deck-pulse 1.6s infinite ease-in-out;
}

@keyframes deck-pulse {
  0%, 100% { transform: scale(0.9); opacity: 0.8; }
  50% { transform: scale(1.3); opacity: 1; }
}

.deck-sub-badge {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--subtext);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
}

.stream-deck-title-group h4 {
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 0.4rem;
  letter-spacing: -0.02em;
}

.stream-deck-title-group p {
  color: var(--subtext);
  font-size: 0.94rem;
  max-width: 860px;
  line-height: 1.5;
  margin: 0;
}

.deck-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(166, 227, 161, 0.12);
  border: 1px solid rgba(166, 227, 161, 0.3);
  color: var(--green);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  white-space: nowrap;
}

.deck-status-led {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
}

.deck-status-led.live-led {
  animation: deck-pulse 1.4s infinite ease-in-out;
}

/* Controls Bar */
.deck-controls-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1.15rem;
  background: rgba(17, 17, 27, 0.75);
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-bottom: 1.75rem;
  flex-wrap: wrap;
}

.deck-profiles-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.deck-bar-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--subtext);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-right: 0.25rem;
}

.deck-profile-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(49, 50, 68, 0.4);
  border: 1px solid var(--line);
  color: var(--subtext);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.35rem 0.75rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.deck-profile-btn:hover {
  background: rgba(137, 180, 250, 0.12);
  color: var(--text);
  border-color: rgba(137, 180, 250, 0.35);
}

.deck-profile-btn.active {
  background: rgba(137, 180, 250, 0.2);
  color: var(--blue);
  border-color: var(--blue);
  box-shadow: 0 0 12px rgba(137, 180, 250, 0.25);
}

.deck-tools-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.deck-sound-toggle-btn,
.deck-hints-toggle-btn {
  font-size: 0.8rem;
  padding: 0.35rem 0.65rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(49, 50, 68, 0.4);
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.2s ease;
}

.deck-sound-toggle-btn:hover,
.deck-hints-toggle-btn:hover {
  background: rgba(49, 50, 68, 0.8);
  border-color: var(--blue);
}

.deck-sound-toggle-btn.muted {
  color: var(--subtext);
  opacity: 0.75;
}

.deck-brightness-group {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(49, 50, 68, 0.4);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.3rem 0.65rem;
  font-size: 0.78rem;
  color: var(--subtext);
}

.deck-brightness-range {
  width: 70px;
  accent-color: var(--yellow);
  cursor: pointer;
}

.brightness-val {
  min-width: 30px;
  font-size: 0.75rem;
  font-family: monospace;
  color: var(--text);
}

/* Workspace Grid: Left Device + Right Inspector */
.deck-workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 2rem;
  align-items: stretch;
  margin-bottom: 2rem;
}

/* Hardware Device Chassis */
.deck-hardware-col {
  display: flex;
  flex-direction: column;
}

.stream-deck-chassis {
  --deck-lcd-glow: 1;
  --deck-lcd-brightness: 1;
  background: linear-gradient(175deg, #1e1e2e 0%, #11111b 100%);
  border: 2px solid #313244;
  border-radius: 24px;
  padding: 1.4rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.06), inset 0 2px 4px rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  transition: filter 0.2s ease;
}

.deck-chassis-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.1rem;
  padding: 0 0.4rem;
}

.deck-brand-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--subtext);
  text-transform: uppercase;
}

.brand-logo-gem {
  color: var(--blue);
  font-size: 0.9rem;
}

.brand-name {
  color: var(--text);
}

.deck-model {
  font-size: 0.65rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  color: var(--dim);
}

.deck-hw-status {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.7rem;
  color: var(--dim);
  font-family: monospace;
}

.hw-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 6px var(--green);
}

/* 3x5 Key Grid */
.stream-deck-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.1rem;
}

/* Individual 3D Pushable Deck Key */
.deck-key {
  --glow-color: rgba(137, 180, 250, 0.4);
  position: relative;
  aspect-ratio: 1 / 1;
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
  border-radius: 14px;
  outline: none;
  user-select: none;
  transition: transform 0.08s cubic-bezier(0.4, 0, 0.2, 1), filter 0.15s ease;
  touch-action: manipulation;
}

.deck-key .key-bezel {
  width: 100%;
  height: 100%;
  background: linear-gradient(145deg, #2e3044 0%, #151622 100%);
  border-radius: 14px;
  padding: 4px;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.65),
              inset 0 1px 1px rgba(255, 255, 255, 0.15),
              inset 0 -2px 5px rgba(0, 0, 0, 0.7);
  display: flex;
  transition: box-shadow 0.08s ease, transform 0.08s ease;
}

.deck-key .key-lcd {
  width: 100%;
  height: 100%;
  background: #11111b;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 0.4rem 0.25rem;
  box-shadow: inset 0 0 12px rgba(0, 0, 0, 0.85);
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.07);
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

/* Glass Reflection Sheen */
.deck-key .key-lcd::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 45%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0) 100%);
  border-radius: 9px 9px 0 0;
  pointer-events: none;
}

/* Tactile Pressed & Hover States */
.deck-key:hover .key-bezel {
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.75),
              0 0 15px var(--glow-color),
              inset 0 1px 1px rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

.deck-key:hover .key-lcd {
  border-color: var(--glow-color);
}

.deck-key:active,
.deck-key.is-pressed {
  transform: translateY(3px) scale(0.96);
  filter: brightness(1.2);
}

.deck-key:active .key-bezel,
.deck-key.is-pressed .key-bezel {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.8),
              inset 0 2px 6px rgba(0, 0, 0, 0.9);
  transform: translateY(0);
}

.deck-key:active .key-lcd,
.deck-key.is-pressed .key-lcd {
  box-shadow: inset 0 0 20px var(--glow-color),
              0 0 10px var(--glow-color);
}

/* Hotkey Overlay */
.key-hotkey {
  font-size: 0.55rem;
  font-family: monospace;
  font-weight: 700;
  color: var(--dim);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  align-self: flex-start;
  padding: 0 0.15rem;
  line-height: 1;
  transition: opacity 0.2s ease;
}

.stream-deck-grid.hide-hotkeys .key-hotkey {
  opacity: 0;
}

/* Center Key Icon */
.key-icon {
  font-size: 1.45rem;
  line-height: 1;
  margin: 0.15rem 0;
  transition: transform 0.1s ease;
}

.deck-key:active .key-icon,
.deck-key.is-pressed .key-icon {
  transform: scale(0.9);
}

/* Key Title */
.key-title {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text);
  text-align: center;
  line-height: 1.15;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  max-width: 100%;
}

/* Key Status Badge */
.key-badge {
  font-size: 0.52rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.12rem 0.35rem;
  border-radius: 4px;
  line-height: 1;
  white-space: nowrap;
}

/* Key Categories & Badge Variants */
.deck-key-stream { --glow-color: rgba(243, 139, 168, 0.4); }
.deck-key-stream.is-live { --glow-color: rgba(243, 139, 168, 0.9); }
.deck-key-stream.is-live .key-lcd {
  background: radial-gradient(circle at center, rgba(243, 139, 168, 0.25) 0%, #11111b 80%);
  border-color: var(--red);
}
.badge-stream {
  background: rgba(243, 139, 168, 0.15);
  color: var(--red);
  border: 1px solid rgba(243, 139, 168, 0.3);
}
.deck-key-stream.is-live .badge-stream {
  background: var(--red);
  color: #11111b;
  font-weight: 900;
  animation: deck-pulse 1.2s infinite ease-in-out;
}

.deck-key-facecam,
.deck-key-gameplay,
.deck-key-brb,
.deck-key-dual { --glow-color: rgba(137, 180, 250, 0.4); }
.badge-scene {
  background: rgba(137, 180, 250, 0.15);
  color: var(--blue);
  border: 1px solid rgba(137, 180, 250, 0.3);
}
.badge-live {
  background: rgba(166, 227, 161, 0.2);
  color: var(--green);
  border: 1px solid rgba(166, 227, 161, 0.4);
}
.deck-key.active-scene .key-lcd {
  border-color: var(--blue);
  box-shadow: inset 0 0 10px rgba(137, 180, 250, 0.3);
}

.deck-key-mute-discord,
.deck-key-mute-mic { --glow-color: rgba(166, 227, 161, 0.4); }
.badge-audio {
  background: rgba(166, 227, 161, 0.15);
  color: var(--green);
  border: 1px solid rgba(166, 227, 161, 0.3);
}
.deck-key.is-muted {
  --glow-color: rgba(243, 139, 168, 0.7);
}
.deck-key.is-muted .key-lcd {
  background: radial-gradient(circle at center, rgba(243, 139, 168, 0.2) 0%, #11111b 80%);
  border-color: var(--red);
}
.deck-key.is-muted .badge-audio {
  background: var(--red);
  color: #11111b;
  border-color: var(--red);
}

.deck-key-noise-filter { --glow-color: rgba(148, 226, 213, 0.4); }
.badge-ai {
  background: rgba(148, 226, 213, 0.15);
  color: var(--cyan);
  border: 1px solid rgba(148, 226, 213, 0.3);
}

.deck-key-soundboard { --glow-color: rgba(249, 226, 175, 0.4); }
.badge-sfx {
  background: rgba(249, 226, 175, 0.15);
  color: var(--yellow);
  border: 1px solid rgba(249, 226, 175, 0.3);
}

.deck-key-voice-fx { --glow-color: rgba(245, 194, 231, 0.4); }
.badge-dsp {
  background: rgba(245, 194, 231, 0.15);
  color: var(--pink);
  border: 1px solid rgba(245, 194, 231, 0.3);
}

.deck-key-marker { --glow-color: rgba(203, 166, 247, 0.5); }
.badge-marker {
  background: rgba(203, 166, 247, 0.15);
  color: var(--mauve);
  border: 1px solid rgba(203, 166, 247, 0.3);
}
.deck-key-marker.is-flashing .key-lcd {
  background: radial-gradient(circle at center, rgba(203, 166, 247, 0.5) 0%, #11111b 80%);
  border-color: var(--mauve);
  animation: marker-flash 0.8s ease-out;
}
@keyframes marker-flash {
  0% { filter: brightness(1.8); }
  100% { filter: brightness(1); }
}

.deck-key-replay { --glow-color: rgba(250, 179, 135, 0.5); }
.badge-replay {
  background: rgba(250, 179, 135, 0.15);
  color: var(--peach);
  border: 1px solid rgba(250, 179, 135, 0.3);
}

.deck-key-split,
.deck-key-shorts,
.deck-key-export { --glow-color: rgba(148, 226, 213, 0.4); }
.badge-nle {
  background: rgba(148, 226, 213, 0.15);
  color: var(--cyan);
  border: 1px solid rgba(148, 226, 213, 0.3);
}

/* Chassis Bottom Base */
.deck-chassis-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 0.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 0.75rem;
}

.chassis-foot {
  width: 28px;
  height: 6px;
  background: #252636;
  border-radius: 3px;
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.8);
}

.chassis-stand-tilt {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--dim);
  text-transform: uppercase;
}

/* Right Column: REST API Inspector Console */
.deck-inspector-col {
  display: flex;
  flex-direction: column;
}

.deck-inspector-card {
  background: #11111b;
  border: 1px solid #313244;
  border-radius: 16px;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.inspector-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.85rem 1.15rem;
  background: rgba(24, 24, 37, 0.9);
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
  gap: 0.75rem;
}

.inspector-header-meta {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: monospace;
  font-size: 0.82rem;
  flex-wrap: wrap;
}

.http-method-badge {
  background: rgba(166, 227, 161, 0.2);
  color: var(--green);
  border: 1px solid rgba(166, 227, 161, 0.4);
  font-weight: 800;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
}

.http-endpoint {
  color: var(--text);
  font-weight: 700;
}

.http-status-badge {
  background: rgba(137, 180, 250, 0.15);
  color: var(--blue);
  border: 1px solid rgba(137, 180, 250, 0.3);
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
}

.http-latency {
  color: var(--subtext);
  font-size: 0.75rem;
}

.inspector-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.inspector-actions .btn-xs {
  font-size: 0.75rem;
  padding: 0.25rem 0.55rem;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: rgba(49, 50, 68, 0.5);
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s ease;
}

.inspector-actions .btn-xs:hover {
  background: rgba(137, 180, 250, 0.15);
  border-color: var(--blue);
}

/* Tabs Navigation */
.inspector-tabs-nav {
  display: flex;
  background: rgba(17, 17, 27, 0.95);
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
}

.inspector-tab {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--subtext);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.65rem 1rem;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.inspector-tab:hover {
  color: var(--text);
}

.inspector-tab.active {
  color: var(--blue);
  border-bottom-color: var(--blue);
  background: rgba(137, 180, 250, 0.05);
}

/* Inspector Body */
.inspector-body {
  padding: 1rem 1.15rem;
  flex: 1;
  min-height: 240px;
  max-height: 320px;
  overflow-y: auto;
  background: #11111b;
}

.inspector-pane {
  display: none;
  height: 100%;
}

.inspector-pane.active {
  display: block;
}

.inspector-code-block {
  margin: 0;
  font-family: "JetBrains Mono", Consolas, "Courier New", monospace;
  font-size: 0.8rem;
  line-height: 1.5;
  color: #cdd6f4;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Inspector Footer & Event Log */
.inspector-footer {
  background: rgba(24, 24, 37, 0.8);
  border-top: 1px solid var(--line);
  padding: 0.85rem 1.15rem;
}

.macro-info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  margin-bottom: 0.65rem;
}

.macro-info-title {
  color: var(--text);
  font-weight: 700;
}

.macro-info-latency {
  color: var(--dim);
  font-family: monospace;
}

.macro-activity-log {
  background: #11111b;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 0.65rem;
}

.log-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--dim);
  margin-bottom: 0.4rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.log-clear-btn {
  background: transparent;
  border: none;
  color: var(--dim);
  font-size: 0.68rem;
  cursor: pointer;
  padding: 0;
}

.log-clear-btn:hover {
  color: var(--subtext);
}

.log-list {
  list-style: none;
  padding: 0;
  margin: 0;
  max-height: 90px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.log-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: monospace;
  font-size: 0.72rem;
  line-height: 1.2;
}

.log-time {
  color: var(--dim);
  font-size: 0.68rem;
}

.log-badge-marker {
  background: rgba(203, 166, 247, 0.15);
  color: var(--mauve);
  padding: 0.1rem 0.3rem;
  border-radius: 3px;
  font-size: 0.62rem;
  font-weight: 700;
}

.log-badge-stream {
  background: rgba(243, 139, 168, 0.15);
  color: var(--red);
  padding: 0.1rem 0.3rem;
  border-radius: 3px;
  font-size: 0.62rem;
  font-weight: 700;
}

.log-badge-scene {
  background: rgba(137, 180, 250, 0.15);
  color: var(--blue);
  padding: 0.1rem 0.3rem;
  border-radius: 3px;
  font-size: 0.62rem;
  font-weight: 700;
}

.log-badge-audio {
  background: rgba(166, 227, 161, 0.15);
  color: var(--green);
  padding: 0.1rem 0.3rem;
  border-radius: 3px;
  font-size: 0.62rem;
  font-weight: 700;
}

.log-badge-replay {
  background: rgba(250, 179, 135, 0.15);
  color: var(--peach);
  padding: 0.1rem 0.3rem;
  border-radius: 3px;
  font-size: 0.62rem;
  font-weight: 700;
}

.log-badge-nle {
  background: rgba(148, 226, 213, 0.15);
  color: var(--cyan);
  padding: 0.1rem 0.3rem;
  border-radius: 3px;
  font-size: 0.62rem;
  font-weight: 700;
}

.log-msg {
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.log-status {
  color: var(--green);
  font-size: 0.68rem;
  font-weight: 700;
}

/* Bottom Telemetry Grid */
.deck-telemetry-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-top: 1.5rem;
}

.deck-metric-box {
  background: rgba(17, 17, 27, 0.65);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1rem 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.deck-metric-head {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.78rem;
  color: var(--subtext);
  font-weight: 600;
}

.deck-metric-value {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.01em;
}

.deck-metric-sub {
  font-size: 0.75rem;
  color: var(--dim);
}

/* Responsive Breakpoints for Stream Deck Widget */
@media (max-width: 1024px) {
  .deck-workspace-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .deck-telemetry-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 680px) {
  .stream-deck-card {
    padding: 1.5rem 1rem;
  }

  .stream-deck-grid {
    gap: 0.5rem;
  }

  .deck-key .key-lcd {
    padding: 0.3rem 0.15rem;
  }

  .key-icon {
    font-size: 1.2rem;
  }

  .key-title {
    font-size: 0.58rem;
  }

  .key-badge {
    font-size: 0.48rem;
    padding: 0.1rem 0.2rem;
  }

  .deck-telemetry-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .stream-deck-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ==========================================================================
   Windows High Contrast Mode & Forced Colors Support
   WCAG 2.1 Success Criteria 1.4.11 (Non-text Contrast) & 2.4.7 (Focus Visible)
   ========================================================================== */

@media (forced-colors: active) {
  /* Ensure Canvas and CanvasText system semantics on base containers */
  :root,
  html,
  body {
    background-color: Canvas !important;
    color: CanvasText !important;
  }

  /* Explicit outlines on structural containers, cards, tables, and dialogs */
  .card,
  .feature-card,
  .studio-card,
  .price-card,
  .tier-card,
  .pipeline-step,
  .pipeline-card,
  .pipeline-image-card,
  .spec-card,
  .shortcut-card,
  .judge-card,
  .vod-estimator-card,
  .vod-metric-box,
  .vod-metric-card,
  .faq-item,
  .modal-card,
  .modal-card-lg,
  .judge-inspect-modal-card,
  .judge-create-modal-card,
  .game-hud-modal-card,
  .shortcuts-modal-card,
  .shortcuts-studio-card,
  kbd,
  .weight-card,
  .criteria-item,
  .prompt-box,
  .sharing-actions-box,
  .sharing-meta-grid,
  .sharing-details-card,
  .hero-visual-card,
  .machine-studio-card,
  .pipe-card,
  .pricing-card,
  .dest-card,
  .av-sync-card,
  .shorts-framing-card,
  .framing-mode-btn,
  .shorts-phone-frame,
  .framing-metric-box,
  .stream-deck-card,
  .stream-deck-chassis,
  .deck-key,
  .deck-inspector-card,
  .deck-metric-box,
  .drawer-user-card,
  .toast,
  .table-wrap,
  table,
  th,
  td,
  blockquote,
  pre,
  code,
  .nav,
  .mobile-drawer,
  .auth-lockout-banner,
  .new-token-alert {
    border: 1px solid CanvasText !important;
    outline: 1px solid CanvasText !important;
  }

  /* Explicit outlines and system color semantics for badges, pills, and tags */
  .badge,
  .framing-badge,
  .judge-badge,
  .judge-status-badge,
  .network-status-badge,
  .game-tag-pill,
  .weight-pill,
  .status-pill,
  .user-pill,
  .drawer-user-pill,
  .token-code-pill,
  .pipe-step-badge,
  .vod-duration-badge,
  .vod-header-badge,
  .game-badge,
  .tag,
  .gate-tag,
  .backup-code-item,
  .api-status-badge,
  .game-hud-live-badge,
  .deck-badge,
  .deck-status-pill,
  .key-badge,
  .http-method-badge,
  .http-status-badge {
    forced-color-adjust: none;
    border: 1px solid CanvasText !important;
    outline: 1px solid CanvasText !important;
    color: CanvasText !important;
    background-color: Canvas !important;
  }

  /* Interactive buttons and control elements with Button semantics and explicit outline */
  .btn,
  button,
  input[type="button"],
  input[type="submit"],
  input[type="reset"],
  .hero-vtab,
  .judge-inspect-tab,
  .tab-buttons button,
  .account-tab-btn,
  .auth-tab-btn,
  .machine-tab-btn,
  .palette-btn,
  .btn-back-to-top,
  .modal-close,
  .drawer-close,
  .password-toggle-btn,
  .av-start-btn,
  .av-reset-btn,
  .av-mute-btn,
  .av-copy-btn,
  .av-step-btn,
  .gate-tag-btn,
  .nav-toggle,
  .deck-profile-btn,
  .deck-sound-toggle-btn,
  .deck-hints-toggle-btn,
  .inspector-tab {
    forced-color-adjust: none;
    background-color: ButtonFace !important;
    color: ButtonText !important;
    border: 1px solid ButtonBorder !important;
    outline: 1px solid CanvasText !important;
  }

  /* Form inputs, textareas, and selects with Field semantics and explicit outline */
  input[type="text"],
  input[type="password"],
  input[type="email"],
  input[type="search"],
  input[type="number"],
  input[type="url"],
  input[type="tel"],
  input:not([type]),
  textarea,
  select,
  .form-input,
  .av-select,
  .vod-select,
  .token-name-input,
  .game-hud-search-input {
    forced-color-adjust: none;
    background-color: Field !important;
    color: FieldText !important;
    border: 1px solid CanvasText !important;
    outline: 1px solid CanvasText !important;
  }

  /* Placeholder text contrast */
  input::placeholder,
  textarea::placeholder,
  .form-input::placeholder {
    color: GrayText !important;
    opacity: 1 !important;
  }

  /* Checkbox, Radio, and Range inputs */
  input[type="checkbox"],
  input[type="radio"] {
    forced-color-adjust: auto;
    border: 1px solid CanvasText !important;
    outline: 1px solid CanvasText !important;
    accent-color: Highlight;
  }

  input[type="range"] {
    accent-color: Highlight;
    outline: 1px solid CanvasText !important;
  }

  /* Links with proper system color semantics and visible underlines */
  a,
  a:link {
    color: LinkText !important;
    text-decoration: underline !important;
  }

  a:visited {
    color: VisitedText !important;
  }

  a:hover,
  a:active {
    color: ActiveText !important;
  }

  /* Interactive hover, active, and selected states with Highlight semantics */
  .btn:hover,
  button:hover,
  input[type="button"]:hover,
  input[type="submit"]:hover,
  input[type="reset"]:hover,
  .btn:active,
  button:active,
  input[type="button"]:active,
  input[type="submit"]:active,
  input[type="reset"]:active,
  .btn.active,
  .hero-vtab.active,
  .hero-vtab[aria-selected="true"],
  .judge-inspect-tab.active,
  .judge-inspect-tab[aria-selected="true"],
  .account-tab-btn.active,
  .account-tab-btn[aria-selected="true"],
  .auth-tab-btn.active,
  .machine-tab-btn.active,
  .machine-tab-btn[aria-selected="true"],
  .game-tag-pill.active,
  .shortcuts-pill.active {
    background-color: Highlight !important;
    color: HighlightText !important;
    border-color: Highlight !important;
    outline: 2px solid Highlight !important;
  }

  /* Visible keyboard focus indicators */
  a:focus,
  a:focus-visible,
  button:focus,
  button:focus-visible,
  .btn:focus,
  .btn:focus-visible,
  .form-input:focus,
  .form-input:focus-visible,
  input:focus,
  input:focus-visible,
  textarea:focus,
  textarea:focus-visible,
  select:focus,
  select:focus-visible,
  .hero-vtab:focus-visible,
  .judge-inspect-tab:focus-visible,
  .game-tag-pill:focus-visible,
  .ai-pill-btn:focus-visible,
  .ai-platform-btn:focus-visible,
  .ai-hashtag-pill:focus-visible,
  .skip-link:focus {
    border-color: Highlight !important;
    outline: 2px solid Highlight !important;
    outline-offset: 2px !important;
  }

  /* Disabled element semantics using GrayText */
  button:disabled,
  .btn:disabled,
  .btn.disabled,
  input:disabled,
  select:disabled,
  textarea:disabled,
  .form-input:disabled,
  [aria-disabled="true"] {
    color: GrayText !important;
    border-color: GrayText !important;
    outline: 1px solid GrayText !important;
    background-color: Canvas !important;
    cursor: not-allowed !important;
    opacity: 1 !important;
  }

  /* Selection highlight semantics */
  ::selection {
    background-color: Highlight !important;
    color: HighlightText !important;
  }

  /* Preserved colors via forced-color-adjust: none for status indicators, swatches, and explicit overrides */
  .palette-btn,
  .network-status-badge,
  .badge-online,
  .badge-offline,
  .api-status-badge,
  .game-hud-live-badge,
  .ai-hook-status-pill,
  .ai-hook-badge,
  .deck-status-pill,
  .deck-badge,
  .forced-color-adjust-none,
  [data-forced-color-adjust="none"] {
    forced-color-adjust: none;
    outline: 1px solid CanvasText !important;
  }
}

/* =====================================================================
   Multi-page layout: feature pages, Features menu, home feature grid.
   (Generated pages come from src/build_site.py)
   ===================================================================== */

/* ---------- Features dropdown in the top bar ---------- */
.nav-links { gap: 1.4rem; }

.nav-dd { position: relative; }

.nav-dd-btn {
  background: none;
  border: 0;
  padding: 0.35rem 0.1rem;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--subtext);
  cursor: pointer;
  transition: color 0.2s ease;
}

.nav-dd-btn:hover,
.nav-dd:focus-within .nav-dd-btn { color: var(--text); }

.nav-dd-btn.active { color: var(--blue); font-weight: 600; }

.nav-dd-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: -1.25rem;
  margin-top: 0.6rem;
  min-width: 480px;
  padding: 1.1rem 1.25rem;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  background: var(--mantle);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  z-index: 120;
}

/* invisible bridge so the menu does not close while the pointer crosses the gap */
.nav-dd-menu::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: -0.7rem; height: 0.7rem;
}

.nav-dd:hover .nav-dd-menu,
.nav-dd:focus-within .nav-dd-menu { display: grid; }

.nav-dd-col { display: flex; flex-direction: column; gap: 0.15rem; }

.nav-dd-col h6 {
  margin: 0 0 0.4rem;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dim);
}

.nav-links .nav-dd-menu a {
  padding: 0.5rem 0.6rem;
  border-radius: 8px;
  font-size: 0.92rem;
  color: var(--text);
  white-space: nowrap;
}

.nav-links .nav-dd-menu a::after { display: none; }

.nav-links .nav-dd-menu a:hover,
.nav-links .nav-dd-menu a.active { background: var(--surface); color: var(--blue); }

.drawer-group {
  margin: 0.9rem 0 0.15rem;
  padding: 0 1rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dim);
}

@media (max-width: 1100px) {
  .nav-links { display: none; }
  .nav-toggle { display: flex; }
}

/* ---------- Breadcrumbs ---------- */
.crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--dim);
  margin-bottom: 1.25rem;
}
.crumbs a { color: var(--subtext); }
.crumbs a:hover { color: var(--blue); }
.crumb-sep { color: var(--dim); }
.crumb-wrap { padding-top: 2rem; }

/* ---------- Feature page hero ---------- */
.page-hero {
  position: relative;
  overflow: hidden;
  padding: 3rem 0 2rem;
}
.page-hero .wrap { position: relative; z-index: 1; }
.page-hero-copy { max-width: 820px; }

.page-hero .tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.75rem;
  border-radius: 8px;
  background: var(--surface);
  color: var(--blue);
  font-size: 0.82rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.page-hero h1 {
  font-size: clamp(2rem, 4.4vw, 3.2rem);
  font-weight: 800;
  line-height: 1.12;
  margin-bottom: 1rem;
}

.page-lede {
  font-size: 1.15rem;
  color: var(--subtext);
  max-width: 720px;
  margin-bottom: 1.75rem;
}

.page-actions { justify-content: flex-start; margin-bottom: 1.5rem; }

.chip-row { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.chip-row span {
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  background: var(--mantle);
  border: 1px solid var(--line);
  font-size: 0.85rem;
  color: var(--subtext);
}

.demo-note {
  margin: 0 auto 1.5rem;
  padding: 0.85rem 1.1rem;
  border: 1px solid rgba(249, 226, 175, 0.4);
  background: rgba(249, 226, 175, 0.08);
  border-radius: 12px;
  color: var(--text);
  font-size: 0.95rem;
}
.demo-note b { color: var(--yellow); }

/* ---------- Screenshot ---------- */
.page-shot { padding: 0.5rem 0 3rem; }
.page-shot .shot-frame { max-width: 1100px; margin: 0 auto; }
.shot-frame.shot-natural { aspect-ratio: auto; }
.shot-frame.shot-natural img { max-height: 760px; object-fit: contain; background: var(--crust); }

/* ---------- Sections ---------- */
.page-section { padding: 4rem 0; }
.page-section.alt {
  background: var(--mantle);
  border-block: 1px solid var(--line);
}
.page-section .section-head { margin-bottom: 2.5rem; }
.wrap.narrow { max-width: 860px; }

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}
.feature-grid.two { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }

.note-card {
  background: var(--mantle);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.75rem;
}
.note-card h3 { font-size: 1.2rem; margin-bottom: 1rem; }

/* ---------- Linked feature cards (home page and Keep exploring) ---------- */
.fcard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}
.fcard-grid-4 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.fcard-grid-3 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }

.fcard {
  display: flex;
  flex-direction: column;
  background: var(--base);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  color: var(--text);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.fcard:hover {
  transform: translateY(-3px);
  border-color: var(--blue);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
}

.fcard-thumb {
  display: block;
  aspect-ratio: 16 / 9;
  background: var(--crust);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}
.fcard-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top left;
  display: block;
}
.fcard-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  background: linear-gradient(135deg, var(--surface), var(--mantle));
}

.fcard-body { display: flex; flex-direction: column; gap: 0.4rem; padding: 1.1rem 1.25rem 1.3rem; flex: 1; }
.fcard-body b { font-size: 1.08rem; }
.fcard-body span { color: var(--subtext); font-size: 0.92rem; }
.fcard-body em { margin-top: auto; padding-top: 0.5rem; font-style: normal; font-weight: 600; font-size: 0.88rem; color: var(--blue); }

.sub-head { margin-top: 4.5rem; margin-bottom: 2rem; }

/* pipeline cards on the home page are links now */
a.pipe-link { display: block; color: inherit; }
a.pipe-link .more { display: inline-block; margin-top: 0.75rem; font-style: normal; font-weight: 600; font-size: 0.85rem; color: var(--blue); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; }
.spec-table { width: 100%; border-collapse: collapse; font-size: 0.93rem; min-width: 640px; }
.spec-table th, .spec-table td { text-align: left; padding: 0.85rem 1.1rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.spec-table th { background: var(--mantle); color: var(--subtext); font-size: 0.78rem; letter-spacing: 0.06em; text-transform: uppercase; }
.spec-table tr:last-child td { border-bottom: 0; }
.spec-table td { color: var(--subtext); }
.spec-table td b { color: var(--text); }

/* ---------- Footer with five columns ---------- */
.footer-grid-5 { grid-template-columns: 1.7fr 1fr 1fr 1fr 1fr; gap: 2rem; }
@media (max-width: 900px) { .footer-grid.footer-grid-5 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .footer-grid.footer-grid-5 { grid-template-columns: 1fr; } }

@media (max-width: 600px) {
  .page-hero { padding-top: 2rem; }
  .page-section { padding: 3rem 0; }
  .fcard-grid, .feature-grid, .feature-grid.two { grid-template-columns: 1fr; }
}

/* Judge review workflow: pending / rejected badges and the admin queue */
.judge-status-badge.pending,
.judge-badge.tag-pending {
  background: rgba(137, 220, 235, 0.15);
  color: var(--cyan);
  border: 1px solid rgba(137, 220, 235, 0.3);
}

.judge-status-badge.rejected,
.judge-badge.tag-rejected {
  background: rgba(243, 139, 168, 0.15);
  color: var(--red);
  border: 1px solid rgba(243, 139, 168, 0.3);
}

.judge-review-panel {
  margin: 0 0 1.25rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.judge-review-panel h4 {
  margin: 0 0 0.25rem;
}

.judge-review-hint {
  margin: 0 0 0.75rem;
  color: var(--subtext);
  font-size: 0.82rem;
}

.judge-review-item {
  display: grid;
  grid-template-columns: 1fr minmax(160px, 260px) auto;
  gap: 0.6rem;
  align-items: center;
  padding: 0.55rem 0;
  border-top: 1px solid var(--line);
}

.judge-review-info span {
  color: var(--subtext);
  font-size: 0.82rem;
}

.judge-review-actions {
  display: flex;
  gap: 0.4rem;
}

@media (max-width: 720px) {
  .judge-review-item {
    grid-template-columns: 1fr;
  }
}
