/* ==========================================================================
   Alice for iPhone — Actual App Interface (wip/app.html)
   - Portrait = Chat ONLY (no eyes/face)
   - Landscape (Desk Dock) = Pure Full-Screen Eyes ONLY (no chat, no subtitles)
   - Top-left "Character" popover selector (Aether, Nori, Suki, Dusk)
   - Zero stretching (object-fit: contain preserves native 460:220 eye ratio)
   ========================================================================== */

:root {
  --bg-studio: #06070a;
  --bg-phone: #000000;
  --ios-surface: rgba(20, 24, 34, 0.88);
  --ios-surface-solid: #121621;
  --ios-border: rgba(255, 255, 255, 0.11);
  --ios-border-strong: rgba(255, 255, 255, 0.2);
  --ios-text: #f6f8fd;
  --ios-text-2: #a5b2c9;
  --ios-text-3: #6c7992;
  --ios-teal: #00a8ff;
  --ios-cyan: #38e8ff;
  --ios-amber: #ffae2b;
  --ios-rose: #ff5c7c;
  --font-ui: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", system-ui, sans-serif;
  --font-display: "Space Grotesk", "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "SF Pro Display", sans-serif;
  --font-digital: "Chakra Petch", "Space Grotesk", -apple-system, BlinkMacSystemFont, sans-serif;
  --target-size: 28px;
}

@media (pointer: coarse) {
  :root {
    --target-size: 44px;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg-studio);
  color: var(--ios-text);
  font-family: var(--font-ui);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overflow-wrap: break-word;
  min-block-size: 100dvh;
}

h1, h2, h3 {
  text-wrap: balance;
}

p, li {
  text-wrap: pretty;
}

:where(button, input:not([type="checkbox"], [type="radio"]), select, textarea, a) {
  font: inherit;
  color: inherit;
}

:where(button, [role="button"], nav a) {
  min-block-size: var(--target-size);
  min-inline-size: var(--target-size);
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--ios-teal);
  outline-offset: 2px;
}

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

/* ==========================================================================
   DESKTOP STUDIO CHROME (Hidden on Real iPhone / ?standalone=1)
   ========================================================================== */
.studio-bar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(8, 9, 14, 0.88);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 10px 20px;
}

.studio-bar-inner {
  max-width: 1320px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.studio-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-inline-size: 0;
}

.studio-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #9bfcf0, #1ebaa9);
  box-shadow: 0 0 14px rgba(76, 230, 212, 0.65);
  flex-shrink: 0;
}

.studio-eyebrow {
  margin: 0;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ios-text-3);
}

.studio-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 660;
}

.studio-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.studio-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 560;
  text-decoration: none;
  color: var(--ios-text-2);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.09);
  transition: background 0.16s ease, color 0.16s ease, border-color 0.16s ease;
}

.studio-pill:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--ios-text);
}

.studio-pill.is-active {
  background: linear-gradient(180deg, rgba(76, 230, 212, 0.22), rgba(26, 183, 168, 0.18));
  border-color: rgba(76, 230, 212, 0.5);
  color: #b5fff6;
}

/* Desktop Simulator Rotation & Test Bar */
.simulator-controls {
  max-width: 1320px;
  margin: 14px auto 0;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.sim-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.sim-segmented {
  display: inline-flex;
  padding: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.09);
}

.sim-seg-btn {
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 580;
  color: var(--ios-text-2);
  transition: background 0.15s ease, color 0.15s ease;
}

.sim-seg-btn.is-active {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

.sim-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 580;
  background: rgba(76, 230, 212, 0.12);
  border: 1px solid rgba(76, 230, 212, 0.35);
  color: #9bfcf0;
  transition: background 0.15s ease;
}

.sim-action-btn:hover {
  background: rgba(76, 230, 212, 0.22);
}

.sim-action-btn.is-subtle {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
  color: var(--ios-text-2);
}

.sim-action-btn.is-subtle:hover {
  color: var(--ios-text);
  background: rgba(255, 255, 255, 0.11);
}

/* ==========================================================================
   DESKTOP WORKSPACE LAYOUT: iPHONE STAGE + SPEC SIDEBAR
   ========================================================================== */
.preview-workspace {
  max-width: 1320px;
  margin: 18px auto 36px;
  padding: 0 20px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 24px;
  align-items: start;
}

body.sim-landscape .preview-workspace {
  grid-template-columns: 1fr;
}

@media (max-width: 1020px) {
  .preview-workspace {
    grid-template-columns: 1fr;
  }
}

.device-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px 30px;
  border-radius: 28px;
  background:
    radial-gradient(62% 48% at 50% 42%, rgba(52, 198, 218, 0.08), transparent 72%),
    linear-gradient(180deg, rgba(16, 18, 26, 0.9), rgba(9, 10, 15, 0.96));
  border: 1px solid rgba(255, 255, 255, 0.07);
  min-block-size: 860px;
  position: relative;
}

body.sim-landscape .device-stage {
  min-block-size: 590px;
  padding: 32px 18px 36px;
}

/* ==========================================================================
   REALISTIC iPHONE 16 PRO HARDWARE SHELL
   ========================================================================== */
.iphone-assembly {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.iphone-bezel {
  position: relative;
  width: 393px;
  height: 816px;
  max-width: 100%;
  padding: 12px;
  border-radius: 56px;
  background: linear-gradient(145deg, #3c404b 0%, #191b22 24%, #0f1015 76%, #333742 100%);
  box-shadow:
    inset 0 1px 1.5px rgba(255, 255, 255, 0.22),
    inset 0 -1px 2px rgba(0, 0, 0, 0.8),
    0 34px 90px rgba(0, 0, 0, 0.85),
    0 0 0 1px rgba(255, 255, 255, 0.09);
  transition: width 0.34s cubic-bezier(0.22, 1, 0.36, 1), height 0.34s cubic-bezier(0.22, 1, 0.36, 1), border-radius 0.34s ease;
}

body.sim-landscape .iphone-bezel {
  width: min(852px, calc(100vw - 64px));
  height: 416px;
  border-radius: 52px;
}

.iphone-screen {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 44px;
  background: var(--bg-phone);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  isolation: isolate;
}

body.sim-landscape .iphone-screen {
  border-radius: 40px;
}

/* Simulated iOS Status Bar & Dynamic Island */
.ios-status-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 25;
  height: 50px;
  padding: 13px 26px 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  color: rgba(255, 255, 255, 0.92);
  pointer-events: none;
}

body.sim-landscape .ios-status-bar {
  display: none;
}

.ios-dynamic-island {
  position: absolute;
  top: 11px;
  left: 50%;
  transform: translateX(-50%);
  width: 116px;
  height: 32px;
  border-radius: 999px;
  background: #000000;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.07);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 11px;
  z-index: 26;
  pointer-events: none;
}

.island-mic-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ff9f0a;
  box-shadow: 0 0 8px rgba(255, 159, 10, 0.85);
  opacity: 0;
  transform: scale(0.5);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.iphone-screen.is-mic-live .island-mic-dot {
  opacity: 1;
  transform: scale(1);
}

body.sim-landscape .ios-dynamic-island {
  top: 50%;
  left: 11px;
  transform: translateY(-50%);
  width: 28px;
  height: 106px;
  padding: 10px 0 0;
  flex-direction: column;
  justify-content: flex-start;
}

.ios-status-icons {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
}

.ios-home-indicator {
  position: absolute;
  bottom: 7px;
  left: 50%;
  transform: translateX(-50%);
  width: 126px;
  height: 4.5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.34);
  z-index: 25;
  pointer-events: none;
}

/* Swivel Desk Dock Stand (visible in Landscape Dock mode) */
.sim-dock-stand {
  display: none;
  flex-direction: column;
  align-items: center;
  margin-top: -4px;
}

body.sim-landscape .sim-dock-stand {
  display: flex;
}

.sim-dock-neck {
  width: 34px;
  height: 24px;
  background: linear-gradient(90deg, #1b1d22 0%, #5c6270 32%, #1d2026 68%, #3c404a 100%);
  border-radius: 0 0 6px 6px;
}

.sim-dock-dome {
  width: 170px;
  height: 70px;
  margin-top: -4px;
  border-radius: 85px 85px 22px 22px / 64px 64px 16px 16px;
  background: radial-gradient(120% 90% at 36% 24%, #454954 0%, #24272f 42%, #121419 85%, #0c0d10 100%);
  box-shadow: inset 0 2px 3px rgba(255, 255, 255, 0.14), 0 14px 30px rgba(0, 0, 0, 0.78);
}

.sim-dock-base {
  width: 156px;
  height: 15px;
  margin-top: -3px;
  border-radius: 0 0 14px 14px;
  background: linear-gradient(180deg, #101216 0%, #1c1f27 100%);
}

/* ==========================================================================
   ACTUAL iPHONE APP ROOT
   - Portrait (.is-portrait-chat): Full-height Chat ONLY (NO eyes!)
   - Landscape (.is-landscape-eyes): Full-screen Pure Eyes ONLY (NO chat, NO subtitles!)
   ========================================================================== */
.app-root {
  position: relative;
  flex: 1;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: #000000;
  color: var(--ios-text);
  overflow: hidden;
  padding-top: max(50px, env(safe-area-inset-top, 0px));
  padding-bottom: max(14px, env(safe-area-inset-bottom, 0px));
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
}

/* Top App Bar (Top-left: "Character" | Center: "Alice" in Chat | Top-right: Settings) */
.app-topbar {
  position: relative;
  z-index: 18;
  flex-shrink: 0;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 8px 16px 10px;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.app-topbar > :first-child {
  justify-self: start;
}

.app-topbar .topbar-right {
  justify-self: end;
}

.char-trigger-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 13px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ios-text);
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.13);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  transition: background 0.16s ease, border-color 0.16s ease;
}

.char-trigger-pill:hover {
  background: rgba(255, 255, 255, 0.16);
}

.char-trigger-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 8px rgba(76, 230, 212, 0.45);
}

.char-trigger-caret {
  font-size: 0.68rem;
  opacity: 0.68;
}

.app-chat-title {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 660;
  letter-spacing: -0.01em;
  color: rgba(255, 255, 255, 0.94);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 7px;
}

.web-mode-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ios-text);
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease, transform 0.1s ease;
}

.web-mode-pill:hover {
  background: rgba(46, 230, 214, 0.18);
  border-color: rgba(46, 230, 214, 0.42);
}

.web-mode-pill[hidden] {
  display: none;
}

.ios-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.13);
  color: var(--ios-text);
  font-size: 0.95rem;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: background 0.16s ease, border-color 0.16s ease, transform 0.1s ease;
}

.ios-icon-btn:hover {
  background: rgba(255, 255, 255, 0.16);
}

.ios-icon-btn:active {
  transform: scale(0.94);
}

.ios-icon-btn.is-live-mic {
  background: rgba(76, 230, 212, 0.16);
  border-color: rgba(76, 230, 212, 0.55);
  color: var(--ios-teal);
}

/* ==========================================================================
   CHARACTER POPOVER PICKER (Anchored to top-left "Character" button)
   Per modern-web-guidance: viewport-aware-dropdowns
   ========================================================================== */
.char-popover {
  padding: 8px;
  border-radius: 18px;
  background: rgba(22, 24, 34, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  color: var(--ios-text);
  min-inline-size: 210px;
}

@supports (position-area: block-end) {
  .char-popover {
    inset: auto;
    margin: 6px 0 0 0;
    position-area: block-end span-inline-end;
    position-try-fallbacks: flip-block, flip-inline, flip-block flip-inline;
  }
}

@supports not (position-area: block-end) {
  .char-popover {
    position: fixed;
    inset: auto 0 18px 0;
    width: min(320px, calc(100vw - 24px));
    margin: 0 auto;
  }
}

.char-popover:is(:popover-open, .\:popover-open) {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.char-pop-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border-radius: 12px;
  width: 100%;
  text-align: left;
  transition: background 0.14s ease;
}

.char-pop-item:hover {
  background: rgba(255, 255, 255, 0.08);
}

.char-pop-item.is-active {
  background: rgba(76, 230, 212, 0.14);
}

.char-pop-name {
  display: block;
  font-size: 0.84rem;
  font-weight: 620;
}

.char-pop-sub {
  display: block;
  font-size: 0.7rem;
  color: var(--ios-text-2);
}

.char-pop-check {
  margin-inline-start: auto;
  color: var(--ios-teal);
  font-weight: 700;
  font-size: 0.88rem;
  opacity: 0;
}

.char-pop-item.is-active .char-pop-check {
  opacity: 1;
}

/* ==========================================================================
   PORTRAIT MODE: PURE CHAT ONLY (NO EYES VISIBLE!)
   ========================================================================== */
.app-body {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.app-root.is-portrait-chat .eyes-stage {
  display: none;
}

.app-root.is-portrait-chat .chat-pane {
  display: flex;
}

/* ==========================================================================
   LANDSCAPE MODE: PURE FULL-SCREEN EYES ONLY (ZERO CHAT, ZERO SUBTITLES, ZERO CONTROLS WHILE TALKING!)
   ========================================================================== */
.app-root.is-landscape-eyes {
  padding: 0;
}

.app-root.is-landscape-eyes .chat-pane,
.app-root.is-landscape-eyes .app-chat-title,
.app-root.is-landscape-eyes .topbar-right {
  display: none;
}

.app-root.is-landscape-eyes .eyes-stage {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000000;
  transition: background 0.45s ease;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  padding: 6px 14px;
}

/* CRITICAL: Never stretch eyes! Preserve exact native 460:220 aspect ratio via object-fit: contain */
.app-eye-canvas {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}

/* Auto-Hiding Top-Left "Character" Pill in Landscape (Hidden immediately whenever talking/speaking to Alice!) */
.app-root.is-landscape-eyes .app-topbar {
  position: absolute;
  top: max(14px, env(safe-area-inset-top, 0px));
  left: max(48px, env(safe-area-inset-left, 0px));
  right: auto;
  z-index: 18;
  padding: 0;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px);
}

body.is-standalone .app-root.is-landscape-eyes .app-topbar {
  left: max(16px, env(safe-area-inset-left, 0px));
}

.app-root.is-landscape-eyes.hud-visible:not(.is-conversing) .app-topbar {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

/* Guarantee ZERO UI chrome while speaking/listening/thinking in Landscape */
.app-root.is-landscape-eyes.is-conversing .app-topbar {
  opacity: 0 !important;
  pointer-events: none !important;
  transform: translateY(-6px);
}

/* ==========================================================================
   FULL-WIDTH CARTOONISH ANIMATED TIMER (Landscape Screen Takeover + Portrait Banner)
   ========================================================================== */
.landscape-timer-stage {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 9;
  width: 100%;
  height: 100%;
  background: #02060b;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.app-root.is-landscape-eyes.has-active-timer .landscape-timer-stage {
  display: block;
}

.app-root.is-landscape-eyes.has-active-timer .eyes-stage {
  opacity: 0;
  pointer-events: none;
}

.timer-canvas-full {
  width: 100%;
  height: 100%;
  display: block;
}

.timer-quick-hud {
  position: absolute;
  bottom: max(18px, env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(14, 17, 26, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 12;
}

.landscape-timer-stage.timer-hud-visible .timer-quick-hud {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.timer-hud-btn {
  padding: 6px 13px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 620;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.11);
}

.timer-hud-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.timer-hud-btn.is-danger {
  color: #ff9eb0;
  background: rgba(255, 72, 114, 0.18);
}

/* Portrait Full-Width Cartoon Timer Banner inside Chat Pane */
.portrait-timer-banner {
  display: none;
  position: relative;
  width: 100%;
  height: 92px;
  flex-shrink: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: #02060b;
  overflow: hidden;
  cursor: pointer;
}

.app-root.is-portrait-chat.has-active-timer .portrait-timer-banner {
  display: block;
}

.timer-canvas-compact {
  width: 100%;
  height: 100%;
  display: block;
}

.portrait-timer-close {
  position: absolute;
  top: 6px;
  right: 8px;
  width: 26px;
  height: 26px;
  min-block-size: 26px;
  min-inline-size: 26px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.72rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
}

/* ==========================================================================
   CHAT PANE (FULL-HEIGHT iOS CHAT IN PORTRAIT MODE)
   ========================================================================== */
.chat-pane {
  flex: 1;
  min-height: 0;
  min-inline-size: 0;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #0d0f16 0%, #090a0f 100%);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

/* Slim Live Voice / Wake Strip */
.ios-voice-strip {
  padding: 7px 14px 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  gap: 5px;
  background: rgba(255, 255, 255, 0.02);
}

.ios-voice-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.ios-heard-text {
  font-size: 0.72rem;
  color: var(--ios-text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-inline-size: 0;
  flex: 1;
}

.ios-heard-text.is-active {
  color: var(--ios-teal);
  font-weight: 560;
}

.ios-meter-mini {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  height: 14px;
  flex-shrink: 0;
}

.ios-meter-bar {
  width: 2.5px;
  height: 4px;
  border-radius: 999px;
  background: var(--ios-teal);
  opacity: 0.35;
  transition: height 0.06s linear, opacity 0.08s linear;
}

.ios-timer-tag {
  font-size: 0.68rem;
  font-variant-numeric: tabular-nums;
  color: var(--ios-text-3);
  flex-shrink: 0;
}

.ios-countdown-track {
  height: 2.5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  overflow: hidden;
}

.ios-countdown-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--ios-teal), var(--ios-amber));
  transition: width 0.08s linear;
}

/* Messages Scroll Container */
.ios-messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scroll-padding-bottom: calc(4.5rem + env(safe-area-inset-bottom, 0px));
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

.ios-empty-state {
  margin: auto 0;
  text-align: center;
  padding: 18px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.ios-empty-state p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--ios-text-2);
  line-height: 1.5;
  max-width: 295px;
}

.ios-starters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 7px;
}

.ios-starter-chip {
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 0.76rem;
  color: #cdeff2;
  background: rgba(76, 230, 212, 0.09);
  border: 1px solid rgba(76, 230, 212, 0.24);
  transition: background 0.15s ease;
}

.ios-starter-chip:hover {
  background: rgba(76, 230, 212, 0.18);
}

.ios-msg {
  display: flex;
  flex-direction: column;
  max-width: 84%;
  gap: 4px;
}

.ios-msg.is-user {
  align-self: flex-end;
  align-items: flex-end;
}

.ios-msg.is-alice {
  align-self: flex-start;
  align-items: flex-start;
}

.ios-bubble {
  padding: 9px 13px;
  border-radius: 17px;
  font-size: 14px;
  font-weight: 420;
  line-height: 1.42;
  letter-spacing: -0.005em;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

.ios-msg.is-user .ios-bubble {
  background: linear-gradient(135deg, #24c2ff 0%, #0082f0 100%);
  color: #ffffff;
  font-size: 14px;
  font-weight: 500;
  border-bottom-right-radius: 5px;
  box-shadow: 0 4px 16px rgba(0, 140, 255, 0.22);
}

.ios-msg.is-alice .ios-bubble {
  background: rgba(255, 255, 255, 0.085);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--ios-text);
  font-size: 14px;
  font-weight: 420;
  border-bottom-left-radius: 5px;
}

.ios-msg-meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.68rem;
  color: var(--ios-text-3);
  padding: 0 4px;
}

.ios-replay-btn {
  font-size: 0.68rem;
  color: var(--ios-teal);
  padding: 2px 7px;
  min-block-size: 24px;
  min-inline-size: 24px;
  border-radius: 999px;
  background: rgba(76, 230, 212, 0.09);
}

.ios-replay-btn:hover {
  background: rgba(76, 230, 212, 0.2);
}

/* iOS Bottom Composer Bar */
.ios-composer {
  flex-shrink: 0;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 10px 14px max(12px, var(--safe-bottom, env(safe-area-inset-bottom, 0px)));
  background: rgba(10, 11, 16, 0.98);
  border-top: 1px solid rgba(255, 255, 255, 0.09);
}

body.keyboard-open .ios-composer {
  padding-bottom: 10px;
}

.ios-input-wrap {
  flex: 1;
  min-inline-size: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 24px;
  padding: 6px 6px 6px 16px;
}

.ios-input-wrap:focus-within {
  border-color: rgba(255, 255, 255, 0.16);
  outline: none;
  box-shadow: none;
}

/* Native 16px font size prevents iOS WKWebView/Safari auto-zoom on focus! */
.ios-chat-input {
  field-sizing: content;
  height: auto;
  width: 100%;
  min-block-size: 24px;
  max-block-size: 108px;
  padding: 4px 2px;
  border: none;
  background: transparent;
  color: var(--ios-text);
  font-size: 16px;
  line-height: 1.35;
  resize: none;
  outline: none !important;
  box-shadow: none !important;
  -webkit-appearance: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
}

.ios-chat-input:focus,
.ios-chat-input:focus-visible {
  outline: none !important;
  box-shadow: none !important;
  border: none !important;
}

.ios-chat-input::placeholder {
  color: var(--ios-text-3);
}

.ios-composer-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.ios-composer-mic-btn {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: rgba(255, 255, 255, 0.9);
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.2s ease, transform 0.12s ease;
}

.ios-composer-mic-btn:active {
  transform: scale(0.92);
}

.ios-composer-mic-btn.is-listening {
  background: linear-gradient(180deg, #3be8f5, #149fb8);
  border-color: rgba(164, 255, 252, 0.85);
  color: #03191c;
  box-shadow: 0 0 18px rgba(59, 232, 245, 0.65);
}

.ios-composer-mic-btn.is-thinking {
  background: linear-gradient(180deg, #9b92ff, #6558f5);
  border-color: rgba(210, 206, 255, 0.8);
  color: #ffffff;
  box-shadow: 0 0 16px rgba(138, 128, 255, 0.55);
}

.ios-send-btn {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  min-block-size: 34px;
  min-inline-size: 34px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #38e8ff, #0088ff);
  color: #021426;
  font-weight: 800;
  font-size: 1rem;
  transition: opacity 0.15s ease, transform 0.12s ease;
}

.ios-send-btn:active {
  transform: scale(0.92);
}

.ios-send-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.ios-send-btn.is-stop-mode {
  background: linear-gradient(180deg, #ff5f6d, #e12d4b);
  color: #ffffff;
  box-shadow: 0 0 18px rgba(255, 76, 104, 0.55);
  opacity: 1 !important;
  cursor: pointer !important;
}

.stop-square {
  display: block;
  width: 11px;
  height: 11px;
  border-radius: 2.5px;
  background: #ffffff;
}

/* Native Continue with Google OAuth 2.0 Button */
.google-oauth-btn {
  width: 100%;
  min-height: 48px;
  padding: 12px 18px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  background: #ffffff;
  color: #111318;
  font-size: 15px;
  font-weight: 620;
  letter-spacing: -0.01em;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.32);
  transition: transform 0.12s ease, opacity 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.google-oauth-btn:active {
  transform: scale(0.98);
  opacity: 0.9;
}

.google-oauth-btn:disabled {
  opacity: 0.55;
}

.google-g-icon {
  flex-shrink: 0;
}

.oauth-help-copy {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.48;
  color: var(--ios-text-2);
}

.oauth-help-copy code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11.5px;
  padding: 1px 5px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.09);
  color: #9bfcf0;
}

/* Custom Companion Name Quick-Pick Chips */
.name-preset-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.name-preset-btn {
  padding: 8px 14px;
  min-block-size: 36px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 560;
  color: var(--ios-text);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
  transition: background 0.14s ease, border-color 0.14s ease, color 0.14s ease, transform 0.1s ease;
  -webkit-tap-highlight-color: transparent;
}

.name-preset-btn:active {
  transform: scale(0.95);
}

.name-preset-btn.is-active {
  background: rgba(76, 230, 212, 0.18);
  border-color: rgba(76, 230, 212, 0.58);
  color: #9bfcf0;
}

/* 6-Voice Interactive Apple HIG Picker Rows + Animated Equalizer */
.voice-card-row {
  width: 100%;
  text-align: left;
  -webkit-tap-highlight-color: transparent;
}

.voice-avatar {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.25);
}

.voice-title-line {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.voice-tag-pill {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.78);
  background: rgba(255, 255, 255, 0.09);
  letter-spacing: 0.01em;
}

.voice-card-row.is-active .voice-tag-pill {
  color: #9bfcf0;
  background: rgba(76, 230, 212, 0.15);
}

.voice-right-meta {
  margin-inline-start: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.voice-play-indicator {
  display: inline-flex;
  align-items: flex-end;
  gap: 2.5px;
  height: 14px;
  padding: 0 4px;
}

.voice-play-indicator .eq-bar {
  width: 2.5px;
  height: 5px;
  border-radius: 2px;
  background: var(--ios-teal);
  opacity: 0.9;
}

.voice-card-row.is-previewing .voice-play-indicator .eq-bar:nth-child(1) {
  animation: voiceEq 0.55s ease-in-out infinite alternate;
}
.voice-card-row.is-previewing .voice-play-indicator .eq-bar:nth-child(2) {
  animation: voiceEq 0.42s ease-in-out 0.14s infinite alternate;
}
.voice-card-row.is-previewing .voice-play-indicator .eq-bar:nth-child(3) {
  animation: voiceEq 0.62s ease-in-out 0.08s infinite alternate;
}

.voice-loading-dot {
  font-size: 12px;
  font-weight: 560;
  color: var(--ios-teal);
}

@keyframes voiceEq {
  from { height: 4px; }
  to   { height: 14px; }
}

/* ==========================================================================
   FULL-SCREEN APPLE HIG iOS SETTINGS (<dialog closedby="any">)
   - Opens 100% Full Screen edge-to-edge on pure OLED black (#000000)
   - Apple HIG Inset Grouped Lists + Smooth Drill-Down Push Subpages
   ========================================================================== */
dialog.ios-sheet {
  position: fixed;
  inset: 0;
  margin: 0;
  width: 100vw;
  height: 100dvh;
  max-width: 100vw;
  max-height: 100dvh;
  padding: 0;
  border: none;
  border-radius: 0;
  background: #000000;
  color: var(--ios-text);
  box-shadow: none;
  overflow: hidden;
  overscroll-behavior: contain;
}

dialog.ios-sheet[open] {
  display: flex;
  flex-direction: column;
}

dialog.ios-sheet::backdrop {
  background: #000000;
}

/* Native iOS Navigation Header */
.sheet-nav {
  flex-shrink: 0;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  padding: calc(var(--safe-top, env(safe-area-inset-top, 14px)) + 6px) 16px 12px;
  background: rgba(10, 11, 16, 0.94);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  border-bottom: 0.5px solid rgba(255, 255, 255, 0.11);
  z-index: 10;
}

.sheet-nav-left {
  justify-self: start;
}

.sheet-nav-right {
  justify-self: end;
}

.sheet-nav-title {
  margin: 0;
  font-size: 16px;
  font-weight: 660;
  letter-spacing: -0.015em;
  color: #ffffff;
  text-align: center;
}

.sheet-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 4px 6px 4px 0;
  font-size: 15px;
  font-weight: 520;
  color: var(--ios-teal);
  -webkit-tap-highlight-color: transparent;
}

.sheet-back-btn[hidden] {
  display: none !important;
}

.sheet-back-chev {
  font-size: 24px;
  line-height: 1;
  margin-top: -2px;
  font-weight: 400;
}

.sheet-close-btn {
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 620;
  color: var(--ios-teal);
  background: transparent;
  -webkit-tap-highlight-color: transparent;
}

.sheet-close-btn:active {
  opacity: 0.6;
}

/* Scrollable Page Viewport */
.sheet-pages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 18px 16px calc(var(--safe-bottom, env(safe-area-inset-bottom, 20px)) + 28px);
}

.settings-page {
  max-width: 560px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.settings-page[hidden] {
  display: none !important;
}

.settings-page.is-entering-push {
  animation: iosPushIn 0.24s cubic-bezier(0.22, 1, 0.36, 1);
}

.settings-page.is-entering-pop {
  animation: iosPopIn 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes iosPushIn {
  from { opacity: 0; transform: translateX(26px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes iosPopIn {
  from { opacity: 0; transform: translateX(-20px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* Apple HIG Inset Grouped Lists */
.hig-group {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.hig-group[hidden] {
  display: none !important;
}

.hig-group-label {
  margin: 0;
  padding: 0 14px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.055em;
  color: rgba(235, 235, 245, 0.52);
}

.hig-list {
  background: #14161f;
  border-radius: 14px;
  border: 0.5px solid rgba(255, 255, 255, 0.09);
  overflow: hidden;
}

.hig-padded {
  padding: 12px 14px;
}

.hig-row {
  width: 100%;
  min-height: 50px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: transparent;
  color: var(--ios-text);
  text-align: left;
  position: relative;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.12s ease;
}

.hig-row[hidden] {
  display: none !important;
}

.hig-row + .hig-row::before,
.hig-row + .hig-field-row::before,
.hig-field-row + .hig-field-row::before {
  content: "";
  position: absolute;
  top: 0;
  left: 54px;
  right: 0;
  height: 0.5px;
  background: rgba(255, 255, 255, 0.09);
}

.hig-field-row + .hig-field-row::before,
.hig-row + .hig-field-row::before {
  left: 14px;
}

.hig-row.is-nav:active,
.sheet-char-btn:active {
  background: rgba(255, 255, 255, 0.06);
}

.hig-icon {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
  color: #ffffff;
}

.hig-icon.is-teal    { background: linear-gradient(145deg, #2be4d2, #10948a); color: #031a18; }
.hig-icon.is-indigo  { background: linear-gradient(145deg, #7c6bff, #4e3fd9); }
.hig-icon.is-amber   { background: linear-gradient(145deg, #ffca3a, #e08e12); color: #1c1200; }
.hig-icon.is-green   { background: linear-gradient(145deg, #34d862, #1d9e42); }
.hig-icon.is-rose    { background: linear-gradient(145deg, #ff5e7e, #d9264e); }
.hig-icon.is-emerald { background: linear-gradient(145deg, #19c37d, #0f8a57); }
.hig-icon.is-blue    { background: linear-gradient(145deg, #3ba4ff, #1769d9); }
.hig-icon.is-purple  { background: linear-gradient(145deg, #b87aff, #7842e6); }

.hig-row-title {
  font-size: 15px;
  font-weight: 460;
  color: #f6f7fb;
  flex: 1;
  min-width: 0;
}

.hig-row-stack {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.hig-row-stack .hig-row-title {
  flex: none;
}

.hig-row-sub {
  font-size: 12.5px;
  line-height: 1.35;
  color: rgba(235, 235, 245, 0.56);
}

.hig-row-value {
  font-size: 14px;
  color: rgba(235, 235, 245, 0.52);
  max-width: 148px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: right;
  flex-shrink: 0;
}

.hig-row-value.is-connected {
  color: #5ee887;
  font-weight: 540;
}

.hig-chev {
  font-size: 20px;
  line-height: 1;
  color: rgba(235, 235, 245, 0.34);
  margin-left: -4px;
  flex-shrink: 0;
}

.hig-check {
  font-size: 16px;
  font-weight: 700;
  color: var(--ios-teal);
  opacity: 0;
  flex-shrink: 0;
}

/* ==========================================================================
   FULL-SCREEN LIVE CHARACTER STUDIO
   - Live interactive 60fps Hero Preview Stage + Swipeable Expression Strip
   - 2x2 Visual Choice Cards with live animated eye previews on pure OLED black
   - Zero layout shift on selection (constant 2px border + non-color check cue)
   ========================================================================== */
.settings-page.is-character-studio {
  max-width: 560px;
  gap: 16px;
}

.char-studio-layout {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.char-studio-hero-col {
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.char-hero-card {
  position: relative;
  border-radius: 22px;
  background: #0d1018;
  border: 1px solid rgba(255, 255, 255, 0.11);
  overflow: hidden;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.55),
              0 0 0 1px color-mix(in srgb, var(--char-accent, #4ce6d4) 18%, transparent);
  transition: box-shadow 0.25s ease;
}

.char-hero-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 440 / 210;
  background: #000000;
  overflow: hidden;
  cursor: pointer;
  touch-action: pan-y;
}

.char-hero-stage::after {
  content: "";
  position: absolute;
  inset: auto 12% 0 12%;
  height: 1px;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--char-accent, #4ce6d4) 48%, transparent), transparent);
  pointer-events: none;
}

.char-hero-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.char-hero-meta {
  padding: 8px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: linear-gradient(180deg, rgba(16, 20, 30, 0.96), rgba(11, 13, 20, 0.98));
}

.char-hero-name {
  margin: 0;
  font-size: 16.5px;
  font-weight: 680;
  letter-spacing: -0.018em;
  color: #ffffff;
  text-align: center;
  flex: 1;
}

.char-step-btn {
  width: 34px;
  height: 34px;
  min-block-size: 34px;
  min-inline-size: 34px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  line-height: 1;
  color: rgba(255, 255, 255, 0.78);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.11);
  transition: background 0.14s ease, scale 0.12s ease-out, color 0.14s ease;
  -webkit-tap-highlight-color: transparent;
}

.char-step-btn:active {
  scale: 0.92;
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
}

/* Swipeable Expression Preview Strip */
.char-mood-strip {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 2px 1px;
}

.char-mood-strip::-webkit-scrollbar {
  display: none;
}

.char-mood-chip {
  flex: 0 0 auto;
  scroll-snap-align: start;
  min-block-size: 34px;
  min-inline-size: auto;
  padding: 6px 13px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 580;
  color: rgba(235, 235, 245, 0.72);
  background: #141722;
  border: 1px solid rgba(255, 255, 255, 0.1);
  white-space: nowrap;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, scale 0.14s ease-out;
  -webkit-tap-highlight-color: transparent;
}

.char-mood-chip:active {
  scale: 0.95;
}

.char-mood-chip.is-active {
  color: #ffffff;
  background: rgba(76, 230, 212, 0.18);
  border-color: rgba(76, 230, 212, 0.52);
}

/* 2x2 Live Visual Choice Cards */
.char-picker-fieldset {
  border: none;
  padding: 0;
  margin: 0;
  min-inline-size: 0;
}

.char-picker-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.char-choice-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px 8px 10px;
  border-radius: 18px;
  background: #141722;
  border: 2px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
  transition: border-color 0.18s ease, box-shadow 0.2s ease, background 0.18s ease, scale 0.14s ease-out;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
}

.char-choice-card:active {
  scale: 0.97;
}

.char-choice-card:has(> :focus-visible) {
  outline: 2px solid #ffffff;
  outline-offset: 2px;
}

.char-choice-card:has(> :checked),
.char-choice-card.is-active {
  background: linear-gradient(180deg, color-mix(in srgb, var(--char-accent, #4ce6d4) 10%, #161a26), #131621);
  border-color: var(--char-accent, #4ce6d4);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45),
              0 0 18px color-mix(in srgb, var(--char-accent, #4ce6d4) 24%, transparent);
}

.char-card-stage {
  width: 100%;
  aspect-ratio: 440 / 210;
  border-radius: 12px;
  background: #000000;
  overflow: hidden;
  border: 0.5px solid rgba(255, 255, 255, 0.08);
}

.char-card-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.char-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 1px 4px 0;
}

.char-card-name {
  font-size: 14.5px;
  font-weight: 650;
  letter-spacing: -0.015em;
  color: #ffffff;
  line-height: 1.2;
}

.char-card-check {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  color: transparent;
  background: transparent;
  border: 1.5px solid rgba(255, 255, 255, 0.22);
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.char-choice-card:has(> :checked) .char-card-check,
.char-choice-card.is-active .char-card-check {
  background: var(--char-accent, #4ce6d4);
  border-color: var(--char-accent, #4ce6d4);
  color: #041618;
}

/* Landscape / Wide Split Studio Layout (Sticky Left Hero + Scrollable 13-Eye Grid) */
@media (min-width: 660px) {
  .settings-page.is-character-studio {
    max-width: 860px;
  }

  .char-studio-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
    gap: 18px;
    align-items: start;
  }

  .char-studio-hero-col {
    position: sticky;
    top: 4px;
  }

  .char-studio-grid-col .hig-group-label {
    padding-left: 4px;
  }
}

@media (min-width: 660px) and (max-height: 460px) {
  .sheet-pages:has(.settings-page.is-character-studio:not([hidden])) {
    padding-top: 10px;
    padding-bottom: 14px;
  }

  .char-hero-meta {
    padding: 6px 8px;
  }

  .char-choice-card {
    padding: 6px 6px 8px;
    gap: 6px;
  }
}

/* Inset Form Fields & Actions */
.hig-field-row {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 10px 14px 12px;
}

.hig-field-label {
  font-size: 12px;
  font-weight: 560;
  color: rgba(235, 235, 245, 0.56);
}

.hig-input {
  width: 100%;
  padding: 6px 0 2px;
  border: none;
  background: transparent;
  color: #ffffff;
  font-size: 16px;
  line-height: 1.35;
  outline: none !important;
  box-shadow: none !important;
  -webkit-appearance: none;
}

.hig-input:focus,
.hig-input:focus-visible {
  outline: none !important;
  box-shadow: none !important;
}

.hig-input::placeholder {
  color: rgba(235, 235, 245, 0.32);
}

.hig-action-stack {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-top: 6px;
}

.hig-btn-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.hig-btn-row[hidden] {
  display: none !important;
}

.chatgpt-btn.is-danger-soft {
  background: rgba(255, 92, 124, 0.14);
  border: 1px solid rgba(255, 92, 124, 0.36);
  color: #ff9cb0;
}

.hig-footnote {
  margin: 4px 14px 0;
  font-size: 12.5px;
  line-height: 1.45;
  color: rgba(235, 235, 245, 0.48);
}

.hig-footnote strong {
  color: rgba(235, 235, 245, 0.78);
  font-weight: 580;
}

.hig-destructive-row {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  font-size: 15px;
  font-weight: 560;
  color: #ff6983;
  text-align: center;
  background: transparent;
}

.hig-destructive-row:active {
  background: rgba(255, 92, 124, 0.12);
}

.chatgpt-profile-box.is-standalone-box {
  margin: 4px 0 2px;
}

.mac-picker-inner {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.gmail-msg-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 14px;
  border-bottom: 0.5px solid rgba(255, 255, 255, 0.08);
}

.gmail-msg-row:last-child {
  border-bottom: none;
}

.gmail-msg-from {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  font-weight: 600;
  color: #ffffff;
}

.gmail-unread-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ios-teal);
  flex-shrink: 0;
}

.gmail-msg-subj {
  font-size: 13px;
  color: rgba(235, 235, 245, 0.66);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sheet-row-sub {
  display: block;
  font-size: 12.5px;
  color: var(--ios-text-2);
  margin-top: 2px;
}

.ios-switch {
  appearance: none;
  -webkit-appearance: none;
  width: 46px;
  height: 28px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  position: relative;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.18s ease;
}

.ios-switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.35);
  transition: transform 0.18s ease;
}

.ios-switch:checked {
  background: #30d158;
}

.ios-switch:checked::after {
  transform: translateX(18px);
}

.sheet-segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 4px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.sheet-seg-btn {
  padding: 7px 6px;
  border-radius: 9px;
  font-size: 0.76rem;
  font-weight: 560;
  color: var(--ios-text-2);
}

.sheet-seg-btn.is-active {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

/* ChatGPT Data & Memory Import Card inside Settings */
.chatgpt-card {
  display: flex;
  flex-direction: column;
}

.chatgpt-head-row {
  align-items: center;
}

.chatgpt-status-pill {
  flex-shrink: 0;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 650;
  letter-spacing: 0.01em;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--ios-text-2);
}

.chatgpt-status-pill.is-importing {
  background: rgba(138, 128, 255, 0.18);
  border-color: rgba(158, 148, 255, 0.45);
  color: #d6d1ff;
}

.chatgpt-status-pill.is-synced {
  background: rgba(48, 209, 88, 0.16);
  border-color: rgba(48, 209, 88, 0.45);
  color: #86f5a3;
}

.chatgpt-status-pill.is-error {
  background: rgba(255, 92, 124, 0.16);
  border-color: rgba(255, 92, 124, 0.45);
  color: #ff9cb0;
}

.chatgpt-profile-box {
  margin: 0 13px 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(76, 230, 212, 0.08);
  border: 1px solid rgba(76, 230, 212, 0.26);
}

.chatgpt-profile-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.68rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #8bf7ea;
  margin-bottom: 5px;
}

.chatgpt-profile-text {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.45;
  color: rgba(246, 247, 251, 0.9);
}

.chatgpt-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 11px 13px 13px;
}

.chatgpt-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 40px;
  padding: 9px 13px;
  border-radius: 12px;
  font-size: 0.82rem;
  font-weight: 620;
  transition: transform 0.12s ease, opacity 0.15s ease, background 0.16s ease;
  -webkit-tap-highlight-color: transparent;
}

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

.chatgpt-btn:disabled {
  opacity: 0.52;
  pointer-events: none;
}

.chatgpt-btn.is-primary {
  background: linear-gradient(180deg, #52efe0, #1ebaa9);
  color: #031c1a;
}

.chatgpt-btn.is-secondary {
  background: rgba(76, 230, 212, 0.13);
  border: 1px solid rgba(76, 230, 212, 0.36);
  color: #a9fff5;
}

.chatgpt-btn.is-file {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--ios-text);
}

.chatgpt-step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  font-size: 0.72rem;
  font-weight: 760;
  background: rgba(0, 0, 0, 0.22);
  color: inherit;
  flex-shrink: 0;
}

.chatgpt-btn.is-secondary .chatgpt-step {
  background: rgba(76, 230, 212, 0.22);
  color: #d6fff9;
}

.chatgpt-manual-details {
  margin-top: 2px;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  padding: 8px 10px;
}

.chatgpt-manual-details summary {
  font-size: 0.76rem;
  font-weight: 560;
  color: var(--ios-text-2);
  cursor: pointer;
  user-select: none;
}

.chatgpt-manual-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.chatgpt-textarea {
  width: 100%;
  padding: 10px 11px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.42);
  border: 1px solid rgba(255, 255, 255, 0.13);
  color: var(--ios-text);
  font-size: 16px;
  line-height: 1.4;
  resize: vertical;
  outline: none;
  box-shadow: none;
  -webkit-appearance: none;
}

.chatgpt-textarea:focus,
.chatgpt-textarea:focus-visible {
  outline: none;
  box-shadow: none;
  border-color: rgba(255, 255, 255, 0.24);
}

.chatgpt-note {
  margin: 2px 0 0;
  font-size: 0.7rem;
  line-height: 1.42;
  color: var(--ios-text-3);
}

.chatgpt-note strong {
  color: var(--ios-text-2);
  font-weight: 600;
}

.memory-sub-hint {
  margin-top: -4px;
  margin-bottom: 2px;
}

.sheet-memory-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.sheet-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px 5px 11px;
  border-radius: 999px;
  font-size: 0.74rem;
  line-height: 1.25;
  background: rgba(255, 174, 43, 0.12);
  border: 1px solid rgba(255, 174, 43, 0.32);
  color: #ffd588;
  max-width: 100%;
}

.sheet-chip.is-profile {
  background: rgba(76, 230, 212, 0.12);
  border-color: rgba(76, 230, 212, 0.36);
  color: #a9fff5;
}

.sheet-chip-label {
  overflow-wrap: anywhere;
}

.sheet-chip-del {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  min-block-size: 18px;
  min-inline-size: 18px;
  border-radius: 50%;
  font-size: 0.76rem;
  line-height: 1;
  color: inherit;
  opacity: 0.68;
  background: rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.sheet-chip-del:hover,
.sheet-chip-del:active {
  opacity: 1;
  background: rgba(255, 92, 124, 0.28);
  color: #ffffff;
}

.sheet-danger-btn {
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #ff8a9e;
  background: rgba(255, 92, 124, 0.1);
  border: 1px solid rgba(255, 92, 124, 0.28);
  align-self: flex-start;
}

.sheet-range {
  width: 118px;
  accent-color: var(--ios-teal);
}

.sheet-voice-select {
  max-width: 185px;
  padding: 6px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: var(--ios-text);
  font-size: 0.78rem;
  font-weight: 560;
}

/* ==========================================================================
   DESKTOP SPEC & EMOTION TEST SIDEBAR (Hidden on Mobile / Standalone)
   ========================================================================== */
.spec-sidebar {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

body.sim-landscape .spec-sidebar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.spec-card {
  background: rgba(18, 20, 29, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 20px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.spec-card h2 {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 660;
}

.spec-card p,
.spec-card li {
  margin: 0;
  font-size: 0.8rem;
  color: var(--ios-text-2);
  line-height: 1.46;
}

.spec-list {
  margin: 0;
  padding-left: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.spec-badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.spec-badge {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.09);
  color: var(--ios-text-2);
}

.spec-badge.is-locked {
  background: rgba(76, 230, 212, 0.11);
  border-color: rgba(76, 230, 212, 0.34);
  color: #a6fff4;
}

.emo-test-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.emo-test-btn {
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 0.74rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--ios-text-2);
}

.emo-test-btn:hover {
  background: rgba(255, 255, 255, 0.13);
  color: #ffffff;
}

.app-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 60;
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(18, 22, 32, 0.94);
  border: 1px solid rgba(76, 230, 212, 0.45);
  color: #e9fffc;
  font-size: 0.82rem;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.65);
}

/* ==========================================================================
   TRUE STANDALONE / REAL iPHONE MODE (Edge-to-Edge, No Desktop Frame!)
   ========================================================================== */
body.is-standalone .studio-bar,
body.is-standalone .simulator-controls,
body.is-standalone .spec-sidebar,
body.is-standalone .ios-status-bar,
body.is-standalone .ios-dynamic-island,
body.is-standalone .ios-home-indicator,
body.is-standalone .sim-dock-stand {
  display: none !important;
}

html:has(body.is-standalone),
body.is-standalone {
  height: 100%;
  width: 100%;
  overflow: hidden;
  position: fixed;
  inset: 0;
  touch-action: manipulation;
}

body.is-standalone .preview-workspace,
body.is-standalone .device-stage,
body.is-standalone .iphone-assembly,
body.is-standalone .iphone-bezel,
body.is-standalone .iphone-screen {
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 0;
  box-shadow: none;
  background: #000000;
  width: 100%;
  height: 100%;
  max-width: none;
  min-block-size: 100%;
  display: block;
}

body.is-standalone .app-root.is-portrait-chat {
  height: 100%;
  padding-top: calc(var(--safe-top, env(safe-area-inset-top, 54px)) + 4px);
  padding-bottom: 0;
}

@media (max-width: 520px), (max-height: 460px) and (pointer: coarse) {
  .studio-bar,
  .simulator-controls,
  .spec-sidebar,
  .ios-status-bar,
  .ios-dynamic-island,
  .ios-home-indicator,
  .sim-dock-stand {
    display: none;
  }

  .preview-workspace,
  .device-stage,
  .iphone-assembly,
  .iphone-bezel,
  .iphone-screen {
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 0;
    box-shadow: none;
    background: #000000;
    width: 100%;
    height: 100dvh;
    min-block-size: 100dvh;
    display: block;
  }

  .app-root.is-portrait-chat {
    height: 100dvh;
    padding-top: max(12px, env(safe-area-inset-top, 0px));
  }
}

/* ==========================================================================
   OLED STREAM-DECK MAC LAUNCHPAD PANEL ("Alice, bring up my panel")
   Works beautifully in BOTH Landscape Desk Stand (4x3) and Portrait (3x4)!
   ========================================================================== */
.mac-panel-overlay {
  position: absolute;
  inset: 0;
  z-index: 42;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px
           max(18px, env(safe-area-inset-right, 18px))
           max(16px, var(--safe-bottom, env(safe-area-inset-bottom, 16px)))
           max(18px, env(safe-area-inset-left, 18px));
  background: radial-gradient(ellipse 80% 70% at 50% 0%, rgba(30, 52, 74, 0.42), rgba(4, 5, 10, 0.97) 68%),
              #030408;
  backdrop-filter: blur(26px);
  -webkit-backdrop-filter: blur(26px);
  animation: macPanelIn 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.mac-panel-overlay[hidden] {
  display: none !important;
}

.app-root.is-landscape-eyes .mac-panel-overlay {
  padding: 12px max(24px, env(safe-area-inset-right, 24px)) 14px max(24px, env(safe-area-inset-left, 24px));
  gap: 10px;
}

@keyframes macPanelIn {
  from { opacity: 0; transform: scale(0.96); }
  to   { opacity: 1; transform: scale(1); }
}

.mac-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
  min-height: 40px;
}

.mac-panel-title-wrap {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  flex: 1;
}

.mac-panel-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
  background: #3bf0df;
  box-shadow: 0 0 12px rgba(59, 240, 223, 0.85);
}

.mac-panel-title {
  font-size: 1rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.015em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mac-panel-close-btn {
  flex-shrink: 0;
  width: auto;
  min-inline-size: 74px;
  min-block-size: 36px;
  padding: 8px 18px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.1;
  letter-spacing: -0.01em;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.13);
  border: 1px solid rgba(255, 255, 255, 0.18);
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.12s ease, background 0.14s ease;
}

.mac-panel-close-btn:active {
  transform: scale(0.94);
  background: rgba(255, 255, 255, 0.2);
}

.mac-panel-grid {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  align-content: start;
  align-content: safe center;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 4px 0 8px;
}

.app-root.is-landscape-eyes .mac-panel-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
}

.app-root.is-landscape-eyes .mac-app-tile {
  min-height: 68px;
  padding: 10px 10px;
}

.app-root.is-landscape-eyes .mac-app-tile.is-mode-icon {
  padding: 8px;
}

.app-root.is-landscape-eyes .mac-tile-real-icon {
  width: 42px;
  height: 42px;
}

.app-root.is-landscape-eyes .mac-tile-real-icon.is-sm {
  width: 30px;
  height: 30px;
}

.mac-app-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 14px 10px;
  min-height: 78px;
  border-radius: 18px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.095), rgba(255, 255, 255, 0.035));
  border: 1px solid rgba(255, 255, 255, 0.13);
  color: #ffffff;
  text-align: center;
  overflow: hidden;
  transition: transform 0.14s ease, background 0.16s ease, border-color 0.16s ease, box-shadow 0.2s ease;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  touch-action: manipulation;
}

.mac-app-tile::before {
  content: "";
  position: absolute;
  inset: -42% auto auto 50%;
  width: 96px;
  height: 96px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: var(--tile-accent, #3bf0df);
  opacity: 0.2;
  filter: blur(22px);
  pointer-events: none;
}

.mac-app-tile:active,
.mac-app-tile.is-launching {
  transform: scale(0.93);
  border-color: var(--tile-accent, #3bf0df);
  box-shadow: 0 0 22px color-mix(in srgb, var(--tile-accent, #3bf0df) 45%, transparent);
}

.mac-app-tile.is-holding {
  transform: scale(0.91);
  border-color: rgba(76, 230, 212, 0.72);
  box-shadow: 0 0 0 2px rgba(76, 230, 212, 0.26), 0 0 22px rgba(76, 230, 212, 0.3);
}

.mac-app-tile.is-mode-name {
  padding: 16px 12px;
}

.mac-app-tile.is-mode-icon {
  padding: 10px;
}

.mac-app-tile.is-mode-both {
  padding: 10px 8px;
  gap: 5px;
}

.mac-app-name {
  position: relative;
  z-index: 1;
  font-size: 14.5px;
  font-weight: 650;
  line-height: 1.2;
  letter-spacing: -0.015em;
  color: #ffffff;
  max-width: 100%;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  word-break: break-word;
}

.mac-app-name.is-sm {
  font-size: 12px;
  font-weight: 600;
  -webkit-line-clamp: 1;
}

.mac-tile-real-icon {
  position: relative;
  z-index: 1;
  width: 46px;
  height: 46px;
  object-fit: contain;
  border-radius: 11px;
  pointer-events: none;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.4));
}

.mac-tile-real-icon.is-sm {
  width: 34px;
  height: 34px;
  border-radius: 8px;
}

.mac-tile-monogram {
  position: relative;
  z-index: 1;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  font-weight: 740;
  letter-spacing: -0.02em;
  color: #ffffff;
  background: linear-gradient(145deg, color-mix(in srgb, var(--tile-accent, #3bf0df) 72%, #1d2230), color-mix(in srgb, var(--tile-accent, #3bf0df) 35%, #0c0e15));
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.36);
}

.mac-tile-monogram.is-sm {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  font-size: 13.5px;
}

/* ==========================================================================
   TAP-AND-HOLD MAC TILE CUSTOMIZER MODAL (OLED Apple HIG)
   ========================================================================== */
.mac-tile-edit-backdrop {
  position: absolute;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  animation: macEditFadeIn 0.18s ease-out;
}

.mac-tile-edit-backdrop[hidden] {
  display: none !important;
}

@keyframes macEditFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.mac-tile-edit-card {
  width: 100%;
  max-width: 360px;
  max-height: calc(100% - 8px);
  overflow-y: auto;
  border-radius: 22px;
  background: #12151f;
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.75);
  display: flex;
  flex-direction: column;
}

.app-root.is-landscape-eyes .mac-tile-edit-card {
  max-width: 520px;
}

.mac-tile-edit-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 0.5px solid rgba(255, 255, 255, 0.1);
}

.mac-tile-edit-title {
  margin: 0;
  font-size: 15px;
  font-weight: 660;
  color: #ffffff;
  letter-spacing: -0.015em;
}

.mac-edit-nav-btn {
  min-block-size: 34px;
  min-inline-size: 56px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 14.5px;
  font-weight: 540;
  color: rgba(255, 255, 255, 0.76);
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}

.mac-edit-nav-btn.is-primary {
  font-weight: 680;
  color: var(--ios-teal);
}

.mac-edit-nav-btn:active {
  opacity: 0.6;
}

.mac-tile-edit-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.app-root.is-landscape-eyes .mac-tile-edit-body {
  flex-direction: row;
  align-items: center;
  padding: 14px 16px;
  gap: 16px;
}

.mac-tile-preview-col {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.mac-app-tile.is-preview {
  width: 122px;
  height: 92px;
  min-height: 92px;
  pointer-events: none;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
}

.mac-tile-fields-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.mac-tile-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.mac-tile-field.is-dimmed {
  opacity: 0.45;
}

.mac-tile-field-label {
  font-size: 11.5px;
  font-weight: 620;
  text-transform: uppercase;
  letter-spacing: 0.055em;
  color: rgba(235, 235, 245, 0.56);
}

.mac-mode-seg {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.09);
}

.mac-mode-btn {
  min-block-size: 34px;
  min-inline-size: 0;
  padding: 6px 6px;
  border-radius: 9px;
  font-size: 12.5px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.68);
  white-space: nowrap;
  transition: background 0.14s ease, color 0.14s ease;
  -webkit-tap-highlight-color: transparent;
}

.mac-mode-btn.is-active {
  background: rgba(76, 230, 212, 0.22);
  color: #a6fff4;
  box-shadow: inset 0 0 0 1px rgba(76, 230, 212, 0.45);
}

.mac-tile-name-input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.48);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #ffffff;
  font-size: 16px;
  line-height: 1.3;
  outline: none;
  box-shadow: none;
  -webkit-appearance: none;
}

.mac-tile-name-input:focus,
.mac-tile-name-input:focus-visible {
  outline: none;
  box-shadow: none;
  border-color: rgba(76, 230, 212, 0.55);
}

.mac-tile-edit-foot {
  display: flex;
  justify-content: flex-end;
}

.mac-tile-reset-btn {
  min-block-size: 30px;
  min-inline-size: auto;
  padding: 4px 8px;
  font-size: 12.5px;
  font-weight: 560;
  color: rgba(255, 255, 255, 0.54);
  -webkit-tap-highlight-color: transparent;
}

.mac-tile-reset-btn:active {
  color: #ffffff;
}

.sheet-pill-btn {
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 620;
  color: #031c1a;
  background: linear-gradient(180deg, #52efe0, #1ebaa9);
  flex-shrink: 0;
}

.sheet-pill-btn.is-ghost {
  padding: 7px 11px;
  color: var(--ios-text);
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.sheet-pill-btn.is-sm {
  padding: 8px 13px;
  font-size: 0.78rem;
}

.mac-head-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.mac-pinned-block,
.mac-picker-block {
  padding: 10px 13px 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mac-sub-label {
  font-size: 0.68rem;
  font-weight: 640;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ios-text-3);
}

.mac-pinned-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.mac-pin-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 7px 4px 10px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 560;
  color: #e9fffc;
  background: rgba(76, 230, 212, 0.12);
  border: 1px solid rgba(76, 230, 212, 0.32);
}

.mac-pin-del {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  min-block-size: 18px;
  min-inline-size: 18px;
  border-radius: 50%;
  font-size: 0.75rem;
  line-height: 1;
  color: #a9fff5;
  background: rgba(255, 255, 255, 0.08);
}

.mac-pin-del:active,
.mac-pin-del:hover {
  background: rgba(255, 92, 124, 0.3);
  color: #ffffff;
}

.mac-search-input {
  width: 100%;
  padding: 9px 12px;
  border-radius: 11px;
  background: rgba(0, 0, 0, 0.42);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--ios-text);
  font-size: 16px;
  line-height: 1.3;
  outline: none;
  box-shadow: none;
  -webkit-appearance: none;
}

.mac-search-input:focus,
.mac-search-input:focus-visible {
  outline: none;
  box-shadow: none;
  border-color: rgba(255, 255, 255, 0.24);
}

.mac-catalog-list {
  max-height: 42dvh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding-right: 2px;
}

.mac-catalog-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 9px;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.mac-catalog-row.is-pinned {
  background: rgba(76, 230, 212, 0.08);
  border-color: rgba(76, 230, 212, 0.28);
}

.mac-cat-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.mac-cat-icon {
  font-size: 1.05rem;
  flex-shrink: 0;
}

.mac-cat-name {
  font-size: 0.8rem;
  font-weight: 580;
  color: var(--ios-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mac-cat-toggle {
  flex-shrink: 0;
  padding: 5px 11px;
  min-block-size: 28px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 640;
  color: #a9fff5;
  background: rgba(76, 230, 212, 0.14);
  border: 1px solid rgba(76, 230, 212, 0.34);
}

.mac-cat-toggle.is-added {
  color: #86f5a3;
  background: rgba(48, 209, 88, 0.16);
  border-color: rgba(48, 209, 88, 0.42);
}

.mac-custom-add-row {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 2px;
}

.mac-custom-add-row .mac-search-input {
  flex: 1;
  min-width: 0;
}

/* ==========================================================================
   OLED SCREEN-BORDER LISTENING / THINKING AURA (Apple Intelligence Style)
   Subtle, unmistakable luminous perimeter glow — zero buttons or text clutter
   ========================================================================== */
.screen-edge-aura {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 48;
  border-radius: inherit;
  opacity: 0;
  --mic-glow: 0;
  transition: opacity 0.48s cubic-bezier(0.22, 1, 0.36, 1),
              box-shadow 0.14s ease-out;
  will-change: opacity, box-shadow;
}

body.is-standalone .screen-edge-aura {
  position: fixed;
  inset: 0;
  border-radius: 0;
}

.screen-edge-aura::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: 2.5px solid transparent;
  opacity: 0;
  transition: opacity 0.42s ease, border-color 0.42s ease;
}

.screen-edge-aura.is-listening {
  opacity: 1;
  box-shadow:
    inset 0 0 calc(26px + var(--mic-glow) * 34px) rgba(46, 232, 245, calc(0.46 + var(--mic-glow) * 0.34)),
    inset 0 0 calc(8px + var(--mic-glow) * 10px) rgba(146, 255, 252, calc(0.55 + var(--mic-glow) * 0.35)),
    inset 0 0 calc(56px + var(--mic-glow) * 44px) rgba(26, 174, 238, calc(0.22 + var(--mic-glow) * 0.22));
  animation: aliceEdgeBreathe 2.6s ease-in-out infinite;
}

.screen-edge-aura.is-listening::after {
  opacity: calc(0.68 + var(--mic-glow) * 0.32);
  border-color: rgba(132, 252, 255, 0.72);
}

.screen-edge-aura.is-thinking {
  opacity: 0.88;
  box-shadow:
    inset 0 0 28px rgba(138, 128, 255, 0.42),
    inset 0 0 8px rgba(196, 190, 255, 0.48),
    inset 0 0 54px rgba(84, 96, 248, 0.22);
  animation: aliceEdgeThink 1.8s ease-in-out infinite;
}

.screen-edge-aura.is-thinking::after {
  opacity: 0.56;
  border-color: rgba(178, 174, 255, 0.6);
}

@keyframes aliceEdgeBreathe {
  0%, 100% {
    filter: brightness(0.92);
  }
  50% {
    filter: brightness(1.16);
  }
}

@keyframes aliceEdgeThink {
  0%, 100% {
    filter: brightness(0.88);
  }
  50% {
    filter: brightness(1.2);
  }
}

@media (prefers-reduced-motion: reduce) {
  .screen-edge-aura.is-listening,
  .screen-edge-aura.is-thinking {
    animation: none;
  }
  ::view-transition-group(*),
  ::view-transition-old(*),
  ::view-transition-new(*) {
    animation: none !important;
  }
}

/* ==========================================================================
   macOS NATIVE ELECTRON DESKTOP CHROME (100% hidden on iPhone & Web!)
   ========================================================================== */
.mac-desktop-bar {
  display: none;
}

body.is-desktop-mac .mac-desktop-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 36px;
  z-index: 95;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px 0 80px;
  -webkit-app-region: drag;
  background: linear-gradient(180deg, rgba(6, 8, 13, 0.92), rgba(6, 8, 13, 0.0));
  transition: opacity 0.22s ease;
}

body.is-desktop-mac .app-root.is-landscape-eyes .mac-desktop-bar {
  opacity: 0;
}

body.is-desktop-mac .app-root.is-landscape-eyes .mac-desktop-bar:hover,
body.is-desktop-mac.is-hover-top .app-root.is-landscape-eyes .mac-desktop-bar {
  opacity: 1;
}

body.is-desktop-mac .app-root.is-portrait-chat {
  padding-top: 38px !important;
}

body.is-desktop-mac dialog.ios-sheet .sheet-nav {
  padding-top: 38px;
  -webkit-app-region: drag;
}

body.is-desktop-mac dialog.ios-sheet .sheet-nav button {
  -webkit-app-region: no-drag;
}

body.is-desktop-mac .app-root.is-landscape-eyes .mac-panel-overlay {
  padding-top: 40px;
}

.mac-desktop-drag {
  flex: 1;
  height: 100%;
  -webkit-app-region: drag;
}

.mac-desktop-actions {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  -webkit-app-region: no-drag;
}

.mac-desktop-seg {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.mac-desk-btn {
  min-block-size: 22px;
  min-inline-size: auto;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.1;
  color: rgba(255, 255, 255, 0.72);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  transition: background 0.14s ease, color 0.14s ease, border-color 0.14s ease;
}

.mac-desktop-seg .mac-desk-btn {
  background: transparent;
  border-color: transparent;
}

.mac-desk-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.14);
}

.mac-desk-btn.is-active {
  color: #a6fff4;
  background: rgba(76, 230, 212, 0.2);
  border-color: rgba(76, 230, 212, 0.45);
}

body.is-desktop-mac .app-root.is-portrait-chat #macDeskSettingsBtn,
body.is-desktop-mac .app-root.is-portrait-chat #macDeskCharBtn {
  display: none;
}

.mac-voice-pill {
  display: none;
}

body.is-desktop-mac .mac-voice-pill:not([hidden]) {
  position: fixed;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  z-index: 64;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-block-size: 28px;
  min-inline-size: auto;
  padding: 5px 13px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: #e9fffc;
  background: rgba(12, 16, 24, 0.86);
  border: 1px solid rgba(76, 230, 212, 0.45);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  pointer-events: auto;
}

body.is-desktop-mac .mac-voice-pill.is-thinking {
  color: #e5e3ff;
  border-color: rgba(154, 146, 255, 0.5);
}

body.is-desktop-mac .mac-voice-pill.is-warn {
  color: #ffe3b8;
  border-color: rgba(255, 184, 77, 0.62);
  cursor: pointer;
}

.mac-voice-pill-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4ce6d4;
  box-shadow: 0 0 8px rgba(76, 230, 212, 0.9);
}

.mac-voice-pill.is-thinking .mac-voice-pill-dot {
  background: #9f96ff;
  box-shadow: 0 0 8px rgba(159, 150, 255, 0.9);
}

.mac-voice-pill.is-warn .mac-voice-pill-dot {
  background: #ffb84d;
  box-shadow: 0 0 8px rgba(255, 184, 77, 0.9);
}

@media (max-width: 390px) {
  #macDeskPanelBtn,
  #macDeskCharBtn {
    display: none;
  }
}

/* ==========================================================================
   BEAUTIFUL FULL-SCREEN OLED CLOCK & 5-DAY VISUAL FORECAST OVERLAYS
   - Apple StandBy horological dial + crisp tabular numerals (Clock)
   - Apple Weather atmospheric backdrop + SVG art + 5-day temp bars (Forecast)
   - Compact inline OLED cards for Portrait Chat Mode
   ========================================================================== */
.visual-stage-overlay[hidden] {
  display: none !important;
}

.visual-stage-overlay {
  position: absolute;
  inset: 0;
  z-index: 38;
  background: #000000;
  overflow: hidden;
  opacity: 0;
  transform: scale(0.985);
  transition: opacity 0.34s cubic-bezier(0.22, 1, 0.36, 1), transform 0.38s cubic-bezier(0.22, 1, 0.36, 1);
  user-select: none;
  -webkit-user-select: none;
}

.visual-stage-overlay.is-visible {
  opacity: 1;
  transform: scale(1);
}

.app-root.is-portrait-chat .visual-stage-overlay {
  display: none !important;
}

.vs-close-pill {
  position: absolute;
  top: max(14px, var(--safe-top, 0px));
  right: 18px;
  z-index: 4;
  min-block-size: 30px;
  min-inline-size: auto;
  padding: 5px 14px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: rgba(240, 245, 255, 0.86);
  background: rgba(255, 255, 255, 0.11);
  border: 1px solid rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition: background 0.15s ease, transform 0.12s ease;
}

.vs-close-pill:active {
  transform: scale(0.95);
  background: rgba(255, 255, 255, 0.2);
}

.vs-close-pill.is-inline {
  position: static;
  align-self: flex-start;
  flex-shrink: 0;
}

/* ---- 1. FULL-SCREEN OLED STANDBY CLOCK ---- */
.is-clock-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px 44px;
  background:
    radial-gradient(ellipse 68% 85% at 28% 50%, rgba(76, 230, 212, 0.16), transparent 72%),
    radial-gradient(ellipse 60% 80% at 78% 45%, rgba(255, 132, 82, 0.14), transparent 75%),
    #000000;
}

.is-clock-stage[data-tod="morning"] {
  background:
    radial-gradient(ellipse 70% 88% at 30% 45%, rgba(255, 186, 92, 0.22), transparent 74%),
    radial-gradient(ellipse 58% 80% at 78% 55%, rgba(255, 118, 86, 0.14), transparent 75%),
    #000000;
}

.is-clock-stage[data-tod="day"] {
  background:
    radial-gradient(ellipse 70% 88% at 28% 48%, rgba(76, 230, 212, 0.20), transparent 74%),
    radial-gradient(ellipse 60% 80% at 80% 45%, rgba(86, 172, 255, 0.15), transparent 75%),
    #000000;
}

.is-clock-stage[data-tod="sunset"] {
  background:
    radial-gradient(ellipse 70% 88% at 30% 48%, rgba(255, 122, 92, 0.24), transparent 74%),
    radial-gradient(ellipse 60% 80% at 78% 50%, rgba(168, 102, 255, 0.18), transparent 75%),
    #000000;
}

.is-clock-stage[data-tod="night"] {
  background:
    radial-gradient(ellipse 70% 88% at 28% 50%, rgba(102, 134, 255, 0.22), transparent 74%),
    radial-gradient(ellipse 60% 80% at 78% 48%, rgba(62, 198, 224, 0.12), transparent 75%),
    #000000;
}

.cv-layout {
  width: 100%;
  max-width: 740px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(24px, 5vw, 56px);
}

.cv-dial-wrap {
  flex: 0 0 auto;
  width: clamp(168px, 31vh, 240px);
  height: clamp(168px, 31vh, 240px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.cv-dial-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.cv-readout {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
}

.cv-loc-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 13px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.13);
  font-size: 12.5px;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(236, 242, 255, 0.86);
}

.cv-live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4ce6d4;
  box-shadow: 0 0 10px rgba(76, 230, 212, 0.9);
  flex-shrink: 0;
}

.cv-time-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  line-height: 0.94;
}

.cv-time-main {
  font-family: -apple-system, "SF Pro Rounded", "SF Pro Display", system-ui, sans-serif;
  font-size: clamp(72px, 14vw, 126px);
  font-weight: 700;
  letter-spacing: -0.045em;
  font-variant-numeric: tabular-nums;
  color: #ffffff;
  text-shadow: 0 10px 36px rgba(0, 0, 0, 0.55);
}

.cv-time-side {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
}

.cv-time-ampm {
  font-size: clamp(20px, 3vw, 28px);
  font-weight: 700;
  letter-spacing: 0.02em;
  color: rgba(255, 255, 255, 0.86);
}

.cv-time-sec {
  font-size: clamp(18px, 2.5vw, 24px);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: rgba(186, 204, 236, 0.62);
}

.cv-date-text {
  font-size: clamp(16px, 2.4vw, 22px);
  font-weight: 500;
  letter-spacing: -0.015em;
  color: rgba(215, 226, 248, 0.78);
}

/* ---- 2. FULL-SCREEN OLED 5-DAY FORECAST BOARD ---- */
.is-forecast-stage {
  display: flex;
  align-items: stretch;
  justify-content: center;
  background: #050810;
}

.fv-bg-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.fv-content {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 820px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  padding: max(18px, var(--safe-top, 14px)) 28px max(18px, var(--safe-bottom, 14px));
}

.fv-top-row {
  display: flex;
  align-items: center;
  gap: 18px;
}

.fv-hero-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.fv-hero-icon {
  width: 78px;
  height: 78px;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.45));
}

.fv-hero-temp {
  font-family: -apple-system, "SF Pro Rounded", "SF Pro Display", system-ui, sans-serif;
  font-size: clamp(58px, 9.5vw, 84px);
  font-weight: 700;
  line-height: 0.92;
  letter-spacing: -0.045em;
  font-variant-numeric: tabular-nums;
  color: #ffffff;
}

.fv-hero-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.fv-loc-row {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}

.fv-location {
  font-size: clamp(18px, 2.6vw, 24px);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fv-day-badge {
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 680;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #a6fff4;
  background: rgba(76, 230, 212, 0.16);
  border: 1px solid rgba(76, 230, 212, 0.36);
}

.fv-cond-row {
  display: flex;
  align-items: baseline;
  gap: 14px;
  flex-wrap: wrap;
}

.fv-condition {
  font-size: 15px;
  font-weight: 600;
  color: rgba(235, 242, 255, 0.92);
}

.fv-hilo {
  font-size: 13.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: rgba(196, 210, 238, 0.78);
}

.fv-stats-row {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.fv-stat-pill {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: rgba(234, 242, 255, 0.88);
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.fv-days-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.fv-day-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 10px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.075);
  border: 1px solid rgba(255, 255, 255, 0.11);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.fv-day-card.is-highlighted {
  background: rgba(76, 230, 212, 0.15);
  border-color: rgba(76, 230, 212, 0.52);
  box-shadow: 0 8px 26px rgba(76, 230, 212, 0.16);
}

.fv-day-name {
  font-size: 13px;
  font-weight: 680;
  letter-spacing: -0.01em;
  color: rgba(242, 246, 255, 0.94);
}

.fv-day-icon {
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fv-day-pop {
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  min-height: 12px;
  color: #66d2ff;
  font-variant-numeric: tabular-nums;
}

.fv-day-range {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
}

.fv-day-lo,
.fv-day-hi {
  font-size: 12px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.fv-day-lo {
  color: rgba(180, 200, 232, 0.72);
}

.fv-day-hi {
  color: #ffffff;
}

.fv-bar-track {
  position: relative;
  flex: 1;
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  overflow: hidden;
}

.fv-bar-fill {
  position: absolute;
  top: 0;
  bottom: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #56ccf2, #ffd166 55%, #ff7b54);
}

/* ---- 3. PORTRAIT CHAT INLINE OLED CLOCK & FORECAST CARDS ---- */
.inline-visual-card {
  width: min(100%, 340px);
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  background: linear-gradient(155deg, rgba(24, 30, 44, 0.92), rgba(11, 14, 22, 0.96));
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.42);
  overflow: hidden;
}

.inline-visual-card.is-clock {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
}

.inline-clock-dial {
  width: 72px;
  height: 72px;
  flex-shrink: 0;
  display: block;
}

.inline-clock-info {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.inline-clock-loc {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 680;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(196, 214, 242, 0.78);
}

.inline-clock-time {
  display: flex;
  align-items: baseline;
  gap: 4px;
  font-variant-numeric: tabular-nums;
  line-height: 1.05;
}

.ic-hm {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.04em;
  color: #ffffff;
}

.ic-sec {
  font-size: 15px;
  font-weight: 600;
  color: rgba(186, 204, 236, 0.62);
}

.ic-ampm {
  font-size: 14px;
  font-weight: 700;
  color: #4ce6d4;
  margin-left: 2px;
}

.inline-clock-date {
  font-size: 13px;
  font-weight: 500;
  color: rgba(214, 226, 248, 0.76);
}

.inline-visual-card.is-forecast {
  padding: 14px 15px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.inline-fc-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.inline-fc-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.inline-fc-loc {
  font-size: 12.5px;
  font-weight: 680;
  color: rgba(210, 224, 248, 0.86);
}

.inline-fc-loc span {
  color: #4ce6d4;
}

.inline-fc-temp-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.inline-fc-temp {
  font-size: 40px;
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 0.95;
  color: #ffffff;
  font-variant-numeric: tabular-nums;
}

.inline-fc-cond-col {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.inline-fc-cond {
  font-size: 13.5px;
  font-weight: 650;
  color: #ffffff;
}

.inline-fc-stats {
  font-size: 11.5px;
  font-weight: 550;
  color: rgba(190, 206, 234, 0.78);
}

.inline-fc-icon {
  flex-shrink: 0;
}

.inline-fc-days {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.09);
}

.inline-fc-row {
  display: grid;
  grid-template-columns: 48px 28px 30px 28px 1fr 28px;
  align-items: center;
  gap: 6px;
  padding: 4px 6px;
  border-radius: 10px;
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}

.inline-fc-row.is-highlighted {
  background: rgba(76, 230, 212, 0.14);
}

.ifc-day {
  font-weight: 650;
  color: #eef4ff;
}

.ifc-ico {
  display: flex;
  align-items: center;
  justify-content: center;
}

.ifc-pop {
  font-size: 11px;
  font-weight: 700;
  color: #66d2ff;
  text-align: right;
}

.ifc-lo {
  color: rgba(184, 202, 232, 0.72);
  text-align: right;
  font-weight: 600;
}

.ifc-hi {
  color: #ffffff;
  font-weight: 680;
}

/* ==========================================================================
   PLAY TOGETHER — OLED GAMES ARCADE OVERLAY (Landscape & Portrait)
   ========================================================================== */
.games-overlay-stage[hidden] {
  display: none !important;
}

.games-overlay-stage {
  position: absolute;
  inset: 0;
  z-index: 44;
  display: flex;
  flex-direction: column;
  background: #000000;
  padding: max(12px, var(--safe-top, 10px)) 20px max(12px, var(--safe-bottom, 10px));
  gap: 10px;
  opacity: 0;
  transform: scale(0.985);
  transition: opacity 0.26s ease, transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
  overflow: hidden;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
}

.games-overlay-stage.is-visible {
  opacity: 1;
  transform: scale(1);
}

body.is-desktop-mac .games-overlay-stage {
  padding-top: 42px;
}

.gm-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-shrink: 0;
}

.gm-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.gm-nav-btn {
  min-block-size: 30px;
  min-inline-size: auto;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 650;
  color: #4ce6d4;
  background: rgba(76, 230, 212, 0.12);
  border: 1px solid rgba(76, 230, 212, 0.28);
}

.gm-nav-btn[hidden] {
  display: none !important;
}

.gm-title {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #ffffff;
}

.gm-shell {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 224px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
}

.app-root.is-portrait-chat .gm-shell {
  grid-template-columns: 1fr;
  grid-template-rows: auto minmax(0, 1fr);
  align-content: start;
}

.gm-companion-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.app-root.is-portrait-chat .gm-companion-col {
  flex-direction: row;
  justify-content: center;
  gap: 12px;
}

/* Pure unbounded character eyes floating directly on #000000 black (ZERO box, ZERO border, ZERO shadow!) */
.gm-mini-eyes-box {
  width: 224px;
  aspect-ratio: 440 / 210;
  border-radius: 0;
  background: transparent;
  border: none;
  overflow: visible;
  box-shadow: none;
  flex-shrink: 0;
}

.app-root.is-portrait-chat .gm-mini-eyes-box {
  width: 132px;
}

.gm-mini-eyes-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.gm-alice-quip {
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.35;
  text-align: center;
  color: rgba(210, 224, 246, 0.68);
  padding: 2px 6px;
  border: none;
  background: transparent;
  max-width: 210px;
}

.gm-alice-quip:empty,
.gm-alice-quip[hidden] {
  display: none !important;
}

.gm-stage-body {
  height: 100%;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
}

/* Hub Grid */
.gm-hub-grid {
  width: 100%;
  max-width: 540px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.gm-hub-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
  padding: 15px 16px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
  text-align: left;
  transition: transform 0.12s ease, border-color 0.15s ease, background 0.15s ease;
}

.gm-hub-card:active,
.gm-hub-card:hover {
  border-color: color-mix(in srgb, var(--gm-accent, #4ce6d4) 65%, transparent);
  background: color-mix(in srgb, var(--gm-accent, #4ce6d4) 13%, rgba(255, 255, 255, 0.05));
}

.gm-hub-card:active {
  transform: scale(0.97);
}

.gm-hub-icon {
  font-size: 22px;
  font-weight: 700;
  color: var(--gm-accent, #4ce6d4);
  line-height: 1.1;
}

.gm-hub-name {
  font-size: 15.5px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.015em;
}

.gm-hub-sub {
  font-size: 12px;
  color: rgba(196, 210, 236, 0.74);
  line-height: 1.28;
}

/* Tic-Tac-Toe */
.gm-ttt-layout {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
}

.gm-ttt-board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
  width: clamp(210px, 56vh, 264px);
  height: clamp(210px, 56vh, 264px);
}

.gm-ttt-cell {
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.08);
  border: 1.5px solid rgba(255, 255, 255, 0.13);
  font-size: 36px;
  font-weight: 800;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.12s ease, background 0.15s ease, border-color 0.15s ease;
}

.gm-ttt-cell:not(:disabled):active {
  transform: scale(0.94);
  background: rgba(255, 255, 255, 0.15);
}

.gm-ttt-cell.is-x {
  color: #4ce6d4;
  text-shadow: 0 0 16px rgba(76, 230, 212, 0.55);
}

.gm-ttt-cell.is-o {
  color: #ffd43b;
  text-shadow: 0 0 16px rgba(255, 212, 59, 0.5);
}

.gm-ttt-cell.is-win {
  background: rgba(76, 230, 212, 0.22);
  border-color: rgba(76, 230, 212, 0.75);
}

.gm-side-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 148px;
}

.gm-score-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.11);
}

.gm-score-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
}

.gm-sc-lbl {
  color: rgba(202, 214, 238, 0.8);
  font-weight: 600;
}

.gm-sc-val {
  font-size: 16px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  color: #ffffff;
}

.gm-sc-val.is-x { color: #4ce6d4; }
.gm-sc-val.is-o { color: #ffd43b; }

.gm-action-btn {
  padding: 10px 16px;
  border-radius: 14px;
  font-size: 13.5px;
  font-weight: 680;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.11);
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.gm-action-btn.is-primary {
  color: #061314;
  background: #4ce6d4;
  border-color: #4ce6d4;
}

/* Rock Paper Scissors */
.gm-rps-layout {
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.gm-rps-arena {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
}

.gm-rps-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 108px;
  padding: 10px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.gm-rps-who {
  font-size: 11.5px;
  font-weight: 680;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(196, 212, 240, 0.75);
}

.gm-rps-emoji {
  font-size: 40px;
  line-height: 1.1;
}

.gm-rps-vs {
  font-size: 15px;
  font-weight: 800;
  color: rgba(255, 212, 59, 0.85);
  letter-spacing: 0.06em;
}

.gm-rps-banner {
  font-size: 14.5px;
  font-weight: 680;
  color: #ffffff;
  text-align: center;
}

.gm-rps-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.gm-rps-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  border-radius: 16px;
  font-size: 14px;
  font-weight: 680;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  transition: transform 0.12s ease, background 0.14s ease;
}

.gm-rps-btn:active {
  transform: scale(0.95);
  background: rgba(76, 230, 212, 0.22);
}

.gm-score-inline {
  font-size: 12.5px;
  font-weight: 600;
  color: rgba(196, 210, 236, 0.74);
  font-variant-numeric: tabular-nums;
}

/* Memory Glow (Simon Says) */
.gm-mem-layout {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
}

.gm-mem-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  width: clamp(200px, 54vh, 248px);
  height: clamp(200px, 54vh, 248px);
}

.gm-mem-pad {
  border-radius: 22px;
  border: 2px solid rgba(255, 255, 255, 0.16);
  opacity: 0.42;
  transition: opacity 0.12s ease, transform 0.12s ease, box-shadow 0.12s ease;
}

.gm-mem-pad.is-c0 { background: #22d3ee; }
.gm-mem-pad.is-c1 { background: #fbbf24; }
.gm-mem-pad.is-c2 { background: #fb7185; }
.gm-mem-pad.is-c3 { background: #a78bfa; }

.gm-mem-pad.is-lit,
.gm-mem-pad:active {
  opacity: 1;
  transform: scale(0.97);
  box-shadow: 0 0 28px currentColor;
}

.gm-mem-meta {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.11);
}

.gm-mem-status {
  font-size: 13.5px;
  font-weight: 680;
  color: #ffffff;
}

.gm-mem-best {
  font-size: 12px;
  font-weight: 600;
  color: #4ce6d4;
}

/* Quick Trivia */
.gm-triv-layout {
  width: 100%;
  max-width: 520px;
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.gm-triv-top {
  display: flex;
  align-items: center;
  gap: 8px;
}

.gm-triv-badge {
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  color: #e6f2ff;
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.gm-triv-badge.is-streak {
  color: #ffd43b;
  border-color: rgba(255, 212, 59, 0.35);
}

.gm-triv-q {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.32;
  color: #ffffff;
}

.gm-triv-opts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.gm-triv-opt {
  padding: 11px 13px;
  border-radius: 14px;
  font-size: 13.5px;
  font-weight: 650;
  color: #eef4ff;
  text-align: left;
  background: rgba(255, 255, 255, 0.08);
  border: 1.5px solid rgba(255, 255, 255, 0.14);
  transition: background 0.14s ease, border-color 0.14s ease;
}

.gm-triv-opt.is-right {
  background: rgba(52, 211, 153, 0.24);
  border-color: #34d399;
  color: #ffffff;
}

.gm-triv-opt.is-wrong {
  background: rgba(251, 113, 133, 0.24);
  border-color: #fb7185;
}

/* 9-Game Compact OLED Hub */
.gm-stage-body {
  align-items: safe center;
}

.gm-hub-grid.is-9 {
  max-width: 640px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.gm-hub-grid.is-9 .gm-hub-card {
  padding: 10px 12px;
  border-radius: 16px;
  gap: 3px;
}

.gm-hub-grid.is-9 .gm-hub-icon {
  font-size: 17px;
}

.gm-hub-grid.is-9 .gm-hub-name {
  font-size: 13.5px;
}

.gm-hub-grid.is-9 .gm-hub-sub {
  font-size: 11px;
  line-height: 1.22;
}

.app-root.is-portrait-chat .gm-hub-grid.is-9 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

/* Connect Four (7×6 OLED Disc Grid) */
.gm-c4-layout {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

.gm-c4-board {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 5px;
  padding: 8px;
  border-radius: 18px;
  background: rgba(30, 58, 138, 0.26);
  border: 1.5px solid rgba(96, 165, 250, 0.28);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
}

.gm-c4-slot {
  width: clamp(32px, 8.6vh, 42px);
  height: clamp(32px, 8.6vh, 42px);
  padding: 3px;
  border-radius: 50%;
  background: transparent;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.app-root.is-portrait-chat .gm-c4-slot {
  width: clamp(36px, 10.5vw, 46px);
  height: clamp(36px, 10.5vw, 46px);
}

.gm-c4-disc {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: rgba(4, 6, 12, 0.86);
  border: 1.5px solid rgba(255, 255, 255, 0.08);
  transition: transform 0.16s cubic-bezier(0.22, 1, 0.36, 1), background 0.16s ease, box-shadow 0.16s ease;
}

.gm-c4-slot.is-p1 .gm-c4-disc {
  background: radial-gradient(circle at 32% 30%, #a5fff5, #4ce6d4 58%, #159c8e);
  border-color: rgba(165, 255, 245, 0.85);
  box-shadow: 0 0 14px rgba(76, 230, 212, 0.55);
}

.gm-c4-slot.is-p2 .gm-c4-disc {
  background: radial-gradient(circle at 32% 30%, #fff3a1, #ffd43b 58%, #d97706);
  border-color: rgba(255, 243, 161, 0.85);
  box-shadow: 0 0 14px rgba(255, 212, 59, 0.5);
}

.gm-c4-slot.is-win .gm-c4-disc {
  box-shadow: 0 0 0 2.5px #ffffff, 0 0 22px rgba(255, 255, 255, 0.85);
  transform: scale(1.06);
}

/* Card Match (4×3 OLED Flip Cards) */
.gm-match-layout {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
}

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

.gm-match-card {
  width: clamp(56px, 15.5vh, 72px);
  height: clamp(56px, 15.5vh, 72px);
  border-radius: 16px;
  background: linear-gradient(155deg, rgba(96, 165, 250, 0.18), rgba(167, 139, 250, 0.14));
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  color: rgba(200, 220, 255, 0.58);
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.14s ease, background 0.16s ease, border-color 0.16s ease;
}

.app-root.is-portrait-chat .gm-match-card {
  width: clamp(64px, 18vw, 78px);
  height: clamp(64px, 18vw, 78px);
}

.gm-match-card:active {
  transform: scale(0.94);
}

.gm-match-card.is-open {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(96, 165, 250, 0.65);
  font-size: 29px;
}

.gm-match-card.is-matched {
  background: rgba(76, 230, 212, 0.18);
  border-color: rgba(76, 230, 212, 0.72);
  box-shadow: 0 0 16px rgba(76, 230, 212, 0.25);
}

/* Reaction Duel (Millisecond Reflex Arena) */
.gm-reflex-layout {
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.gm-reflex-pad {
  width: 100%;
  min-height: clamp(160px, 44vh, 210px);
  padding: 20px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.08);
  border: 2px solid rgba(76, 230, 212, 0.36);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  transition: background 0.1s ease, border-color 0.1s ease, transform 0.08s ease;
}

.gm-reflex-pad:active {
  transform: scale(0.985);
}

.gm-reflex-main {
  font-size: clamp(28px, 5vw, 40px);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #ffffff;
  font-variant-numeric: tabular-nums;
}

.gm-reflex-sub {
  font-size: 13px;
  font-weight: 600;
  color: rgba(224, 234, 255, 0.84);
}

.gm-reflex-pad.is-wait {
  background: rgba(239, 68, 68, 0.2);
  border-color: #ef4444;
}

.gm-reflex-pad.is-go {
  background: #22c55e;
  border-color: #86efac;
  box-shadow: 0 0 40px rgba(34, 197, 94, 0.55);
}

.gm-reflex-pad.is-go .gm-reflex-main,
.gm-reflex-pad.is-go .gm-reflex-sub {
  color: #031a0c;
}

.gm-reflex-pad.is-early {
  background: rgba(245, 158, 11, 0.22);
  border-color: #f59e0b;
}

.gm-reflex-pad.is-won {
  background: rgba(52, 211, 153, 0.2);
  border-color: #34d399;
}

.gm-reflex-pad.is-lost {
  background: rgba(167, 139, 250, 0.2);
  border-color: #a78bfa;
}

/* Higher or Lower (Secret 1–100 Keypad) */
.gm-hl-layout {
  width: 100%;
  max-width: 540px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
}

.gm-hl-info {
  flex: 1 1 210px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
  text-align: center;
}

.gm-hl-range {
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 650;
  color: rgba(214, 228, 252, 0.88);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.13);
  font-variant-numeric: tabular-nums;
}

.gm-hl-range strong {
  color: #38bdf8;
}

.gm-hl-clue {
  font-size: 14px;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.3;
  min-height: 36px;
  display: flex;
  align-items: center;
}

.gm-hl-display {
  width: 124px;
  height: 58px;
  border-radius: 16px;
  background: rgba(56, 189, 248, 0.12);
  border: 1.5px solid rgba(56, 189, 248, 0.45);
  font-size: 32px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gm-hl-pad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  width: 210px;
  flex-shrink: 0;
}

.gm-hl-key {
  height: 46px;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.15);
  font-size: 17px;
  font-weight: 750;
  color: #ffffff;
  font-variant-numeric: tabular-nums;
  transition: transform 0.1s ease, background 0.12s ease;
}

.gm-hl-key:active {
  transform: scale(0.94);
  background: rgba(255, 255, 255, 0.18);
}

.gm-hl-key.is-go {
  background: #4ce6d4;
  border-color: #4ce6d4;
  color: #061314;
  font-size: 14.5px;
}

/* Word Scramble (Glowing Letter Tiles) */
.gm-scr-layout {
  width: 100%;
  max-width: 500px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 11px;
}

.gm-scr-answer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.gm-scr-slot {
  width: 44px;
  height: 48px;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.06);
  border: 1.5px dashed rgba(255, 255, 255, 0.24);
  font-size: 22px;
  font-weight: 800;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.gm-scr-slot.is-filled {
  border-style: solid;
  border-color: rgba(244, 114, 182, 0.72);
  background: rgba(244, 114, 182, 0.16);
}

.gm-scr-slot.is-right {
  border-color: #34d399;
  background: rgba(52, 211, 153, 0.26);
}

.gm-scr-slot.is-wrong {
  border-color: #fb7185;
  background: rgba(251, 113, 133, 0.26);
}

.gm-scr-hint {
  font-size: 13px;
  font-weight: 600;
  color: rgba(214, 226, 250, 0.82);
  text-align: center;
}

.gm-scr-tiles {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.gm-scr-tile {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.11);
  border: 1.5px solid rgba(255, 255, 255, 0.2);
  font-size: 20px;
  font-weight: 800;
  color: #ffffff;
  transition: transform 0.12s ease, opacity 0.15s ease, background 0.15s ease;
}

.gm-scr-tile:not(:disabled):active {
  transform: scale(0.92);
  background: rgba(244, 114, 182, 0.25);
}

.gm-scr-tile.is-used {
  opacity: 0.24;
  transform: scale(0.92);
}

.gm-scr-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.gm-scr-actions .gm-action-btn {
  padding: 8px 14px;
  font-size: 13px;
}


/* ==========================================================================
   MULTI-DESIGN BEDSIDE NIGHT MODE (#1 Split-Flap | #4 Braun | #7 Chrono Halo)
   + 6 SWIPEABLE COLOR & DIM MODES (Anker Blue, Warm Amber, Care Emerald,
     Midnight Violet, Red-Shift, Ultra-Dim)
   ========================================================================== */
.night-mode-overlay {
  position: absolute;
  inset: 0;
  z-index: 42;
  background: #000000;
  opacity: 0;
  transition: opacity 0.36s ease;
  user-select: none;
  -webkit-user-select: none;
}

.night-mode-overlay.is-open {
  opacity: 1;
}

/* Portrait (Vertical) ALWAYS returns cleanly to Chat — Night Mode ONLY displays in Horizontal Landscape! */
.app-root.is-portrait-chat .night-mode-overlay {
  display: none !important;
  pointer-events: none !important;
}

/* Fleeting Landscape Bot-Swipe Pill (Milo / Mika / Aether...) */
.eyes-stage {
  touch-action: none;
}

.stage-swipe-pill {
  position: absolute;
  top: max(14px, env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%) translateY(-4px);
  z-index: 30;
  padding: 5px 14px;
  border-radius: 999px;
  font-family: var(--font-display);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(240, 248, 255, 0.94);
  background: rgba(14, 20, 32, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.stage-swipe-pill.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.night-stage {
  --night-accent: #ff9f43;
  --night-accent-hi: #ffd166;
  --night-num: #f4f7fc;
  --night-sub: rgba(238, 244, 255, 0.78);
  --night-muted: rgba(214, 226, 246, 0.54);
  --night-card-top: #1b1f29;
  --night-card-mid: #12151d;
  --night-card-bot: #151923;
  --night-border: rgba(255, 255, 255, 0.09);
  --night-glow: rgba(255, 209, 102, 0.34);

  position: relative;
  width: 100%;
  height: 100%;
  background: #000000;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: max(12px, env(safe-area-inset-top)) max(22px, env(safe-area-inset-right)) max(14px, env(safe-area-inset-bottom)) max(22px, env(safe-area-inset-left));
  color: var(--night-num);
  font-family: var(--font-ui);
  touch-action: none;
  transition: filter 0.35s ease;
}

/* 6 Swipe-Up/Down Night Color & Brightness Modes (Warm Amber/Yellow is default!) */
.night-stage[data-dim="cozy"] {
  --night-accent: #ff9f43;
  --night-accent-hi: #ffd166;
  --night-num: #f4f7fc;
  --night-sub: rgba(238, 244, 255, 0.78);
  --night-muted: rgba(214, 226, 246, 0.54);
  --night-card-top: #1b1f29;
  --night-card-mid: #12151d;
  --night-card-bot: #151923;
  --night-border: rgba(255, 255, 255, 0.09);
  --night-glow: rgba(255, 209, 102, 0.34);
}

.night-stage[data-dim="anker"] {
  --night-accent: #00a8ff;
  --night-accent-hi: #38e8ff;
  --night-num: #f4f9ff;
  --night-sub: rgba(214, 234, 255, 0.78);
  --night-muted: rgba(164, 204, 244, 0.50);
  --night-card-top: #101b2c;
  --night-card-mid: #09111d;
  --night-card-bot: #0d1626;
  --night-border: rgba(56, 232, 255, 0.22);
  --night-glow: rgba(0, 168, 255, 0.42);
}

.night-stage[data-dim="emerald"] {
  --night-accent: #22c55e;
  --night-accent-hi: #4ade80;
  --night-num: #f1fbf5;
  --night-sub: rgba(206, 242, 220, 0.76);
  --night-muted: rgba(154, 212, 180, 0.48);
  --night-card-top: #0f1d18;
  --night-card-mid: #091310;
  --night-card-bot: #0c1814;
  --night-border: rgba(74, 222, 128, 0.20);
  --night-glow: rgba(34, 197, 94, 0.34);
}

.night-stage[data-dim="aurora"] {
  --night-accent: #a78bfa;
  --night-accent-hi: #c4b5fd;
  --night-num: #f5f3ff;
  --night-sub: rgba(224, 216, 252, 0.76);
  --night-muted: rgba(188, 176, 232, 0.48);
  --night-card-top: #181428;
  --night-card-mid: #0f0d1b;
  --night-card-bot: #141123;
  --night-border: rgba(196, 181, 253, 0.20);
  --night-glow: rgba(167, 139, 250, 0.36);
}

.night-stage[data-dim="red"] {
  --night-accent: #e04848;
  --night-accent-hi: #f25c5c;
  --night-num: #e04848;
  --night-sub: rgba(226, 86, 86, 0.74);
  --night-muted: rgba(210, 74, 74, 0.46);
  --night-card-top: #170809;
  --night-card-mid: #0f0405;
  --night-card-bot: #130607;
  --night-border: rgba(220, 62, 62, 0.24);
  --night-glow: rgba(217, 60, 60, 0.32);
}

.night-stage[data-dim="dim"] {
  --night-accent: #b89452;
  --night-accent-hi: #c8a66a;
  --night-num: rgba(218, 224, 234, 0.72);
  --night-sub: rgba(188, 196, 212, 0.48);
  --night-muted: rgba(164, 174, 192, 0.34);
  --night-card-top: #111319;
  --night-card-mid: #0a0c10;
  --night-card-bot: #0e1016;
  --night-border: rgba(255, 255, 255, 0.06);
  --night-glow: rgba(184, 148, 82, 0.18);
  filter: brightness(0.62);
}

.night-top-bar {
  position: absolute;
  top: max(10px, env(safe-area-inset-top));
  left: max(20px, env(safe-area-inset-left));
  right: max(20px, env(safe-area-inset-right));
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 5;
}

.night-top-bar.is-minimal {
  justify-content: flex-end;
}

.night-swipe-toast {
  position: absolute;
  left: 50%;
  top: 2px;
  transform: translateX(-50%) translateY(-4px);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--night-accent-hi);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--night-border);
  padding: 4px 13px;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
}
.night-swipe-toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Ephemeral bottom-center 3-dot design pager (ONLY briefly appears during left/right swipe!) */
.night-pager-dots {
  position: absolute;
  bottom: max(12px, env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease;
  z-index: 6;
}
.night-pager-dots.is-visible {
  opacity: 1;
}
.night-pager-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.24);
  transition: width 0.22s ease, background 0.22s ease;
}
.night-pager-dot.is-active {
  width: 18px;
  background: var(--night-accent-hi);
  box-shadow: 0 0 10px var(--night-glow);
}

.night-design-pane {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  width: 100%;
  animation: nightPaneIn 0.26s cubic-bezier(0.22, 1, 0.36, 1);
}
.night-design-pane[hidden] {
  display: none !important;
}
@keyframes nightPaneIn {
  from { opacity: 0; transform: translateY(4px) scale(0.985); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.night-weather-clean {
  display: inline-flex;
  align-items: baseline;
  justify-content: center;
  gap: 10px;
  padding: 6px 8px;
  border: none;
  background: transparent;
  color: var(--night-muted);
  font-size: clamp(13px, 2vw, 15px);
  font-weight: 500;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: opacity 0.18s ease;
}
.night-weather-clean:active {
  opacity: 0.55;
}
.nwc-date {
  color: var(--night-sub);
  font-weight: 600;
}
.nwc-sep {
  opacity: 0.32;
}
.nwc-temp {
  color: var(--night-accent-hi);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.nwc-cond {
  color: var(--night-muted);
  font-weight: 500;
}

.night-stop-btn,
.landscape-stop-btn {
  position: absolute;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(14px, env(safe-area-inset-bottom));
  z-index: 36;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 15px;
  border-radius: 999px;
  border: 1px solid rgba(255, 110, 110, 0.34);
  background: rgba(24, 14, 18, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: rgba(255, 214, 214, 0.94);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55);
  transition: transform 0.12s ease, background 0.18s ease;
}
.night-stop-btn:active,
.landscape-stop-btn:active {
  transform: scale(0.94);
  background: rgba(220, 62, 62, 0.32);
}
.night-stop-btn[hidden],
.landscape-stop-btn[hidden] {
  display: none !important;
}
.night-stop-sq {
  width: 9px;
  height: 9px;
  border-radius: 2px;
  background: #ff5e6c;
  box-shadow: 0 0 8px rgba(255, 94, 108, 0.65);
}

.night-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.night-chip-btn {
  border: 1px solid var(--night-border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--night-sub);
  font-size: 11px;
  font-weight: 600;
  padding: 5px 11px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.16s ease, transform 0.12s ease;
}

.night-chip-btn:active {
  transform: scale(0.95);
}

.night-wake-btn {
  color: var(--night-accent-hi);
  border-color: var(--night-border);
}

.night-main-grid {
  width: 100%;
  max-width: 780px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(16px, 3vw, 36px);
}

.night-clock-col {
  flex: 1.25;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 0;
}

/* ---- DESIGN 01: REFINED SPLIT-FLAP 24H ---- */
.flip-clock-row {
  display: flex;
  align-items: center;
  gap: clamp(8px, 1.5vw, 14px);
  cursor: pointer;
  perspective: 900px;
}

.flip-card {
  position: relative;
  width: clamp(104px, 20vw, 168px);
  height: clamp(114px, 38vh, 174px);
  border-radius: 20px;
  background: linear-gradient(180deg, var(--night-card-top) 0%, var(--night-card-mid) 50%, #070a10 50.5%, var(--night-card-bot) 100%);
  border: 1px solid var(--night-border);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.72), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: border-color 0.28s ease, background 0.28s ease;
}

.flip-ampm {
  position: absolute;
  top: 10px;
  left: 12px;
  font-family: var(--font-display);
  font-size: clamp(10px, 1.8vw, 12px);
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--night-accent-hi);
  z-index: 4;
}

.flip-val,
.flip-flap-top {
  font-family: var(--font-display);
  font-size: clamp(58px, 12vw, 104px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  color: var(--night-num);
}

.flip-flap-top {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, var(--night-card-top) 0%, var(--night-card-mid) 100%);
  clip-path: inset(0 0 50% 0);
  transform-origin: center 50%;
  backface-visibility: hidden;
  pointer-events: none;
  z-index: 2;
  opacity: 0;
}

.flip-card.is-flipping .flip-flap-top {
  opacity: 1;
  animation: flipFlapDrop 0.42s cubic-bezier(0.36, 0.02, 0.25, 1) forwards;
}

@keyframes flipFlapDrop {
  0%   { transform: rotateX(0deg); filter: brightness(1.06); }
  55%  { transform: rotateX(-95deg); filter: brightness(0.65); }
  100% { transform: rotateX(-178deg); opacity: 0; }
}

.flip-seam {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 2.5px;
  margin-top: -1.25px;
  background: rgba(0, 0, 0, 0.78);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.05);
  z-index: 3;
  pointer-events: none;
}

.flip-colon {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.flip-colon span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--night-accent-hi);
  box-shadow: 0 0 10px var(--night-glow);
  animation: nightColonPulse 2s ease-in-out infinite;
}

@keyframes nightColonPulse {
  0%, 100% { opacity: 0.9; transform: scale(1); }
  50% { opacity: 0.24; transform: scale(0.84); }
}

/* ---- DESIGN 04: BRAUN / DIETER RAMS PRECISION NIGHT ---- */
.braun-panel {
  width: min(100%, 386px);
  padding: clamp(18px, 3.2vw, 26px) clamp(20px, 3.4vw, 28px);
  border-radius: 22px;
  background: linear-gradient(180deg, var(--night-card-top) 0%, var(--night-card-mid) 100%);
  border: 1px solid var(--night-border);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.72), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.braun-time-row {
  display: flex;
  align-items: baseline;
  justify-content: flex-start;
  gap: 6px;
  cursor: pointer;
  font-family: var(--font-digital);
  font-variant-numeric: tabular-nums;
}

.braun-hh,
.braun-mm {
  font-size: clamp(58px, 11.5vw, 96px);
  font-weight: 700;
  line-height: 0.96;
  letter-spacing: 0.02em;
  color: var(--night-num);
}

.braun-colon {
  font-size: clamp(54px, 10.5vw, 88px);
  font-weight: 700;
  line-height: 0.92;
  color: var(--night-accent-hi);
  text-shadow: 0 0 16px var(--night-glow);
  animation: nightColonPulse 2s ease-in-out infinite;
}

.braun-tag {
  margin-left: auto;
  align-self: flex-start;
  margin-top: 8px;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--night-accent-hi);
  opacity: 0.85;
}

.braun-seconds-rail {
  display: grid;
  grid-template-columns: repeat(30, 1fr);
  gap: 4px;
  width: 100%;
  padding: 2px 0;
}

.braun-tick {
  height: 4px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.09);
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

.braun-tick.is-lit {
  background: var(--night-accent-hi);
  box-shadow: 0 0 8px var(--night-glow);
}

.braun-meta-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 2px 0 0;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: clamp(12.5px, 1.9vw, 14px);
}

.braun-date {
  color: var(--night-sub);
  font-weight: 600;
  letter-spacing: 0.02em;
}

.braun-weather-right {
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
}

.braun-temp {
  color: var(--night-accent-hi);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.braun-cond {
  color: var(--night-muted);
  font-weight: 500;
}

/* ---- DESIGN 07: CHRONOGRAPH HALO RING (Large Spacious Circle — Zero Digit Collision!) ---- */
.chrono-halo-wrap {
  position: relative;
  width: clamp(260px, 78vh, 344px);
  height: clamp(260px, 78vh, 344px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.chrono-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.chrono-track {
  fill: none;
  stroke: rgba(255, 255, 255, 0.08);
  stroke-width: 4;
}

.chrono-progress {
  fill: none;
  stroke: var(--night-accent-hi);
  stroke-width: 4.5;
  stroke-linecap: round;
  transform: rotate(-90deg);
  transform-origin: 160px 160px;
  filter: drop-shadow(0 0 10px var(--night-glow));
}

.chrono-dot {
  fill: var(--night-accent-hi);
  filter: drop-shadow(0 0 10px var(--night-accent-hi));
}

.chrono-inner {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 5px;
  padding: 0 32px;
}

.chrono-time {
  font-family: var(--font-digital);
  font-size: clamp(42px, 11vh, 60px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
  color: var(--night-num);
  cursor: pointer;
}

.chrono-ampm {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--night-accent-hi);
  opacity: 0.85;
}

.chrono-meta {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  margin-top: 8px;
  padding: 2px 6px;
  border: none;
  background: transparent;
  color: var(--night-sub);
  font-size: clamp(12px, 1.8vw, 14px);
  font-weight: 600;
  cursor: pointer;
}

.chrono-temp {
  color: var(--night-accent-hi);
  font-weight: 700;
}

.night-buddy-col {
  flex: 0.9;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.night-buddy-canvas {
  width: clamp(160px, 34vw, 250px);
  height: auto;
  aspect-ratio: 240 / 200;
  touch-action: none;
  cursor: pointer;
}

.night-whisper-pill {
  position: absolute;
  bottom: 4px;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--night-border);
  color: var(--night-accent-hi);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.24s ease, transform 0.24s ease;
  pointer-events: none;
}

.night-whisper-pill.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================================================
   4-STEP ACCOUNT CREATION & COMPANION ONBOARDING WIZARD
   ========================================================================== */
.onb-overlay {
  position: fixed;
  inset: 0;
  z-index: 950;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.onb-overlay[hidden] {
  display: none;
}

.onb-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(4, 7, 14, 0.82);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.onb-modal {
  width: 100%;
  max-width: 470px;
  max-height: 92vh;
  overflow-y: auto;
  border-radius: 26px;
  background: linear-gradient(180deg, #141925 0%, #0d111a 100%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.72);
  padding: 20px 22px 22px;
  color: #f3f7ff;
}

.onb-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.onb-steps {
  display: flex;
  align-items: center;
  gap: 6px;
}

.onb-dot {
  width: 24px;
  height: 5px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.14);
  transition: background 0.2s ease, width 0.2s ease;
}

.onb-dot.is-active {
  width: 34px;
  background: #4ce6d4;
}

.onb-dot.is-done {
  background: rgba(76, 230, 212, 0.52);
}

.onb-close-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.75);
  font-size: 13px;
  cursor: pointer;
}

.onb-error {
  margin-bottom: 12px;
  padding: 9px 12px;
  border-radius: 12px;
  background: rgba(239, 68, 68, 0.16);
  border: 1px solid rgba(239, 68, 68, 0.42);
  color: #fecaca;
  font-size: 12px;
  font-weight: 600;
}

.onb-eyebrow {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: #4ce6d4;
  margin-bottom: 4px;
}

.onb-title {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.onb-sub {
  margin: 6px 0 16px;
  font-size: 13px;
  color: rgba(210, 222, 245, 0.72);
  line-height: 1.45;
}

.onb-mode-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 4px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
  margin-bottom: 14px;
}

.onb-mode-tab {
  border: none;
  background: transparent;
  color: rgba(215, 226, 248, 0.68);
  font-size: 13px;
  font-weight: 700;
  padding: 8px 10px;
  border-radius: 10px;
  cursor: pointer;
}

.onb-mode-tab.is-active {
  background: rgba(76, 230, 212, 0.18);
  color: #9bfcf0;
}

.onb-fields {
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.onb-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  color: rgba(215, 226, 248, 0.8);
}

.onb-field input {
  width: 100%;
  padding: 11px 13px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.13);
  color: #ffffff;
  font-size: 14px;
  outline: none;
}

.onb-field input:focus {
  border-color: #4ce6d4;
}

.onb-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.onb-chip {
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(226, 235, 250, 0.86);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.onb-chip.is-on {
  background: rgba(76, 230, 212, 0.22);
  border-color: #4ce6d4;
  color: #b7fff6;
}

.onb-vibe-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 12px;
}

.onb-vibe-card {
  display: flex;
  flex-direction: column;
  gap: 3px;
  text-align: left;
  padding: 9px 10px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  background: rgba(255, 255, 255, 0.04);
  color: #f3f7ff;
  cursor: pointer;
}

.onb-vibe-card strong {
  font-size: 11.5px;
}

.onb-vibe-card span {
  font-size: 10.5px;
  color: rgba(205, 218, 240, 0.65);
  line-height: 1.3;
}

.onb-vibe-card.is-on {
  border-color: #4ce6d4;
  background: rgba(76, 230, 212, 0.15);
}

.onb-preview-box {
  width: 100%;
  aspect-ratio: 440 / 210;
  background: #000000;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  overflow: hidden;
  margin: 10px 0 12px;
}

.onb-preview-box canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.onb-section-lbl {
  font-size: 11px;
  font-weight: 700;
  color: rgba(205, 218, 240, 0.72);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 10px 0 6px;
}

.onb-char-row,
.onb-tint-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.onb-char-pill,
.onb-tint-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  color: #eef5ff;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.onb-char-pill.is-on,
.onb-tint-pill.is-on {
  border-color: #4ce6d4;
  background: rgba(76, 230, 212, 0.20);
}

.onb-swatch,
.onb-tint-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  display: inline-block;
}

.onb-name-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin: 14px 0 14px;
}

.onb-name-hero input {
  width: 100%;
  text-align: center;
  font-size: 26px;
  font-weight: 800;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.07);
  border: 1.5px solid rgba(76, 230, 212, 0.45);
  color: #ffffff;
  outline: none;
}

.onb-wake-preview {
  font-size: 13px;
  color: rgba(210, 224, 245, 0.78);
}

.onb-wake-preview strong {
  color: #4ce6d4;
}

.onb-quick-names {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.onb-qname {
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  background: rgba(255, 255, 255, 0.06);
  color: #eef5ff;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.onb-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.onb-btn-ghost {
  padding: 10px 16px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: transparent;
  color: rgba(226, 236, 252, 0.85);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.onb-btn-primary {
  flex: 1;
  padding: 11px 18px;
  border-radius: 12px;
  border: none;
  background: linear-gradient(135deg, #4ce6d4, #2bb8d6);
  color: #03191d;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}

.account-status-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.account-status-title {
  font-size: 14px;
  font-weight: 700;
  color: #f3f7ff;
}

.account-status-sub {
  font-size: 12px;
  color: rgba(205, 218, 240, 0.72);
  line-height: 1.4;
}
