/* ===== Midnight AI - CSS Part 1: Root theme vars, splash, sidebar, thinking panel, main topbar ===== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

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

:root {
  --bg: #ffffff;
  --surface: #f7f7f7;
  --surface2: #efefef;
  --border: #e4e4e4;
  --border2: #d3d3d3;
  --text: #131313;
  --text-dim: #5c5c5c;
  --text-muted: #9a9a9a;
  --white: #ffffff;
  --accent: #131313;
  --accent-fg: #ffffff;
  --accent-hover: #2c2c2c;
  --danger: #e5484d;
  --sidebar-w: 272px;
  --radius-lg: 18px;
}
:root[data-theme="neutral-dark"] {
  --bg: #121212; --surface: #1c1c1e; --surface2: #262629;
  --border: #2e2e31; --border2: #3a3a3d;
  --text: #f2f2f2; --text-dim: #b8b8bc; --text-muted: #7d7d82;
  --white: #1c1c1e; --accent: #e8e8e8; --accent-fg: #121212; --accent-hover: #d0d0d0;
}
:root[data-theme="blue-dark"] {
  --bg: #0e131c; --surface: #161d2b; --surface2: #1f2837;
  --border: #2b3548; --border2: #3a455c;
  --text: #eef1f7; --text-dim: #b1bacb; --text-muted: #717d92;
  --white: #161d2b; --accent: #2563eb; --accent-fg: #ffffff; --accent-hover: #1d4ed8;
}
:root[data-theme="purple-dark"] {
  --bg: #150f1f; --surface: #1e1729; --surface2: #281f37;
  --border: #382c4a; --border2: #483a5c;
  --text: #f3edfa; --text-dim: #bdb0cd; --text-muted: #7c6f8d;
  --white: #1e1729; --accent: #7c3aed; --accent-fg: #ffffff; --accent-hover: #6d28d9;
}

html, body { width: 100%; height: 100%; margin: 0; padding: 0; overflow: hidden; font-family: 'Inter', sans-serif; background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; }
#app { display: flex; width: 100%; height: 100%; position: relative; }

/* ---------- LED RING GLOW (input chat utama, mengikuti tema aktif) ---------- */
.input-glow-wrap {
  position: relative;
  border-radius: 22px;
  padding: 2px;
}
.input-glow-wrap::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 24px;
  background: conic-gradient(from var(--glow-angle, 0deg),
      transparent 0deg,
      var(--led-c1, #6a5cf7) 40deg,
      var(--led-c2, #7248f5) 80deg,
      var(--led-c3, #a78bf5) 110deg,
      var(--led-c4, #f5789a) 150deg,
      var(--led-c5, #f5b84a) 190deg,
      var(--led-c4, #f5789a) 230deg,
      var(--led-c3, #a78bf5) 260deg,
      var(--led-c2, #7248f5) 300deg,
      var(--led-c1, #6a5cf7) 335deg,
      transparent 355deg,
      transparent 360deg);
  animation: ledSpin 3.2s linear infinite;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  padding: 2px;
  opacity: .95;
  pointer-events: none;
}
.input-glow-wrap::after {
  content: '';
  position: absolute;
  inset: -5px;
  border-radius: 27px;
  background: conic-gradient(from var(--glow-angle, 0deg),
      transparent 0deg,
      var(--led-c1, #6a5cf7) 40deg,
      var(--led-c2, #7248f5) 110deg,
      var(--led-c4, #f5789a) 150deg,
      var(--led-c5, #f5b84a) 190deg,
      var(--led-c2, #7248f5) 260deg,
      var(--led-c1, #6a5cf7) 335deg,
      transparent 355deg,
      transparent 360deg);
  animation: ledSpin 3.2s linear infinite;
  filter: blur(10px);
  z-index: -1;
  opacity: .6;
  pointer-events: none;
}
@property --glow-angle {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}
@keyframes ledSpin {
  from { --glow-angle: 0deg; }
  to { --glow-angle: 360deg; }
}
/* Palet LED per tema — tetap warna-warni tapi selaras dengan nuansa tema masing-masing */
:root { --led-c1:#6a5cf7; --led-c2:#a78bf5; --led-c3:#f5789a; --led-c4:#f5b84a; --led-c5:#5cd6c0; }
:root[data-theme="neutral-dark"] { --led-c1:#8b8bf7; --led-c2:#b98bf5; --led-c3:#f57ab0; --led-c4:#f5c15c; --led-c5:#5cd6c0; }
:root[data-theme="blue-dark"] { --led-c1:#3d72f6; --led-c2:#6a5cf7; --led-c3:#7248f5; --led-c4:#a78bf5; --led-c5:#5cc8f5; }
:root[data-theme="purple-dark"] { --led-c1:#7c3aed; --led-c2:#a78bf5; --led-c3:#e879c7; --led-c4:#f5b84a; --led-c5:#5cd6c0; }

/* ---------- SPLASH SCREEN ---------- */
#splash-screen {
  position: fixed; inset: 0; z-index: 999; background: var(--bg);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px;
  transition: opacity .45s ease, visibility .45s ease;
}
#splash-screen.hide { opacity: 0; visibility: hidden; pointer-events: none; }
.splash-mark { width: 64px; height: 64px; border-radius: 18px; background: var(--accent) url('https://hostgambar.vercel.app/image/AgACAgUAAyEGAATk_963AAICHGqIbusgQc2prKeZaCX5MTq33FoSAAL7FGsb-5lIVM7d8EEPsfd3AQADAgADeQADPQQ') center/cover; animation: splashPulse 1.1s ease-in-out infinite; }
@keyframes splashPulse { 0%,100% { transform: scale(1); opacity: 1; } 50% { transform: scale(.9); opacity: .7; } }
.splash-name { font-size: 17px; font-weight: 800; letter-spacing: -0.02em; }
.splash-dots { display: flex; gap: 5px; }
.splash-dots span { width: 6px; height: 6px; border-radius: 50%; background: var(--text-muted); animation: splashDot 1.1s ease-in-out infinite; }
.splash-dots span:nth-child(2) { animation-delay: .15s; }
.splash-dots span:nth-child(3) { animation-delay: .3s; }
@keyframes splashDot { 0%,80%,100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
.splash-credit { position: absolute; bottom: 22px; font-size: 11px; font-weight: 700; letter-spacing: .08em; color: var(--text-muted); }

/* ---------- SIDEBAR ---------- */
#sidebar {
  width: var(--sidebar-w); max-width: 82vw; background: var(--white);
  display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0; bottom: 0; z-index: 50;
  transform: translateX(0);
  transition: transform .28s cubic-bezier(.4,0,.2,1), background .2s;
  border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
  box-shadow: 1px 0 0 var(--border);
}
#sidebar.collapsed { transform: translateX(-102%); }

#sidebar-header { padding: 20px 18px 14px; display: flex; flex-direction: column; gap: 14px; border-bottom: 1px solid var(--border); }
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark { width: 30px; height: 30px; border-radius: 9px; background: var(--accent) url('https://hostgambar.vercel.app/image/AgACAgUAAyEGAATk_963AAICHGqIbusgQc2prKeZaCX5MTq33FoSAAL7FGsb-5lIVM7d8EEPsfd3AQADAgADeQADPQQ') center/cover; flex-shrink: 0; }
.brand-name { font-size: 20px; font-weight: 800; letter-spacing: -0.03em; }

.new-chat-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; background: var(--accent); color: var(--accent-fg); border: none;
  border-radius: 12px; padding: 10px 0; font-family: inherit; font-size: 13.5px; font-weight: 600;
  cursor: pointer; transition: background .15s, transform .1s;
}
.new-chat-btn:hover { background: var(--accent-hover); }
.new-chat-btn:active { transform: scale(.97); }

/* ---------- TOMBOL MULTIMIND (sidebar) — beda gaya, amber, biar menonjol dari Multi/Private Chat ---------- */
.mm-launch-btn {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  width: 100%; padding: 9px 0; font-family: inherit; font-size: 12.5px; font-weight: 700;
  letter-spacing: .01em; cursor: pointer; border-radius: 12px;
  background: rgba(245,158,11,.08); border: 1px solid rgba(245,158,11,.28); color: #d99a1f;
  transition: background .15s, transform .1s, border-color .15s;
}
:root[data-theme] .mm-launch-btn { color: #f59e0b; }
.mm-launch-btn:hover { background: rgba(245,158,11,.16); border-color: rgba(245,158,11,.5); }
.mm-launch-btn:active { transform: scale(.97); }
.mm-launch-btn svg { flex-shrink: 0; }
.mm-launch-badge {
  font-size: 9px; font-weight: 800; letter-spacing: .04em; padding: 2px 7px; border-radius: 999px;
  background: rgba(245,158,11,.18); border: 1px solid rgba(245,158,11,.4); color: #f59e0b;
}

#hist-list { flex: 1; overflow-y: auto; padding: 10px 10px 6px; }
#hist-list::-webkit-scrollbar { width: 6px; }
#hist-list::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 4px; }
.hist-empty { padding: 30px 10px; text-align: center; color: var(--text-muted); font-size: 12.5px; }

.hist-item {
  display: flex; align-items: center; gap: 8px; padding: 9px 10px; border-radius: 10px;
  cursor: pointer; margin-bottom: 2px; position: relative; transition: background .12s;
}
.hist-item:hover { background: var(--surface); }
.hist-item.active { background: var(--surface2); }
.hist-item .hi-title { flex: 1; min-width: 0; font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); }
.hist-item .hi-actions { display: none; align-items: center; gap: 2px; flex-shrink: 0; }
.hist-item:hover .hi-actions { display: flex; }
.hi-actions button { width: 24px; height: 24px; border: none; background: transparent; color: var(--text-muted); border-radius: 6px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.hi-actions button:hover { background: var(--border); color: var(--text); }
.hi-actions button.danger:hover { background: color-mix(in srgb, var(--danger) 18%, transparent); color: var(--danger); }

#sidebar-footer { border-top: 1px solid var(--border); padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.theme-row { display: flex; align-items: center; gap: 8px; padding: 0 2px; }
.theme-swatch { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--border2); cursor: pointer; flex-shrink: 0; transition: transform .12s, border-color .12s; }
.theme-swatch:hover { transform: scale(1.12); }
.theme-swatch.active { border-color: var(--accent); }
.theme-swatch.sw-light { background: linear-gradient(135deg, #fff 50%, #111 50%); }
.theme-swatch.sw-neutral-dark { background: #1c1c1e; }
.theme-swatch.sw-blue-dark { background: #2563eb; }
.theme-swatch.sw-purple-dark { background: #7c3aed; }

.user-row { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 12px; cursor: pointer; transition: background .12s; }
.user-row:hover { background: var(--surface); }
.user-avatar { width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), var(--accent-hover)); border: 1px solid var(--border2); flex-shrink: 0; display: flex; align-items: center; justify-content: center; color: var(--accent-fg); font-family: 'JetBrains Mono', monospace; font-size: 12px; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; }
.user-meta { flex: 1; min-width: 0; }
.user-name { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-sub { font-size: 11px; color: var(--text-muted); }

/* ---------- OWNER MODE (nama & avatar elegan, emas premium) ---------- */
.user-row.owner-mode .user-avatar {
  background: linear-gradient(135deg, #fff8e1, #ecd074 35%, #b8860b 70%, #6b4e0a 100%);
  color: #3a2a04;
  position: relative;
  /* Border avatar berlapis: cincin emas solid + halo lembut di luarnya, bukan cuma outline tipis. */
  border: 2px solid #d4af37;
  box-shadow: 0 0 0 3px rgba(212,175,55,.22), 0 0 16px rgba(212,175,55,.4), inset 0 0 6px rgba(255,255,255,.35);
}
.user-row.owner-mode .user-name { display: flex; align-items: center; gap: 7px; }
.owner-name-elegant {
  background: linear-gradient(100deg, #8a6a12 0%, #d4af37 25%, #fff3c4 50%, #d4af37 75%, #8a6a12 100%);
  background-size: 250% auto;
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  animation: ownerShimmer 4s linear infinite;
  font-weight: 800; letter-spacing: .015em;
  text-shadow: 0 0 18px rgba(212,175,55,.25);
}
.owner-badge {
  display: inline-flex; align-items: center; gap: 3px; font-size: 8.5px; font-weight: 700;
  letter-spacing: .1em; padding: 2.5px 7px 2.5px 6px; border-radius: 999px;
  background: rgba(212,175,55,.1);
  color: #a67c1e; border: 1px solid rgba(212,175,55,.5); flex-shrink: 0;
  text-transform: uppercase;
}
.owner-badge svg { flex-shrink: 0; filter: drop-shadow(0 0 2px rgba(184,134,11,.5)); width: 9px; height: 9px; }
@keyframes ownerShimmer {
  0% { background-position: 250% 0; }
  100% { background-position: -20% 0; }
}
.owner-sub-gold {
  color: #a67c1e !important; font-weight: 600;
  letter-spacing: .02em;
}

/* ---------- ADMIN MODE (nama & avatar elegan, perak/silver premium) ---------- */
.user-row.admin-mode .user-avatar {
  background: linear-gradient(135deg, #f4f7fb, #c9d3de 35%, #8b97a6 70%, #566070 100%);
  color: #2a323c;
  position: relative;
  /* Border avatar berlapis: cincin perak solid + halo lembut, konsisten dengan gaya frame milik Owner. */
  border: 2px solid #a9b4c0;
  box-shadow: 0 0 0 3px rgba(148,163,184,.2), 0 0 16px rgba(148,163,184,.35), inset 0 0 6px rgba(255,255,255,.35);
}
.user-row.admin-mode .user-name { display: flex; align-items: center; gap: 7px; }
.admin-name-elegant {
  background: linear-gradient(100deg, #4c5866 0%, #8b97a6 25%, #eef2f6 50%, #8b97a6 75%, #4c5866 100%);
  background-size: 250% auto;
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  animation: ownerShimmer 4s linear infinite;
  font-weight: 800; letter-spacing: .015em;
  text-shadow: 0 0 18px rgba(148,163,184,.25);
}
.admin-badge {
  display: inline-flex; align-items: center; gap: 3px; font-size: 8.5px; font-weight: 700;
  letter-spacing: .1em; padding: 2.5px 7px 2.5px 6px; border-radius: 999px;
  background: rgba(139,151,166,.12);
  color: #5c6675; border: 1px solid rgba(139,151,166,.5); flex-shrink: 0;
  text-transform: uppercase;
}
.admin-badge svg { flex-shrink: 0; filter: drop-shadow(0 0 2px rgba(90,101,114,.5)); width: 9px; height: 9px; }
.admin-sub-silver {
  color: #5c6675 !important; font-weight: 600;
  letter-spacing: .02em;
}

/* ---------- MUSIC TOGGLE SWITCH ---------- */
.music-switch {
  position: relative; flex-shrink: 0; width: 40px; height: 22px; border-radius: 999px;
  background: var(--border2); border: none; cursor: pointer; transition: background .2s; padding: 0;
  margin-left: auto;
}
.music-switch::before {
  content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .2s;
}
.music-switch.on { background: var(--accent); }
.music-switch.on::before { transform: translateX(18px); }
.song-item { padding-left: 34px; font-size: 13px; }
.song-play-ic { width: 20px; height: 20px; border-radius: 50%; background: var(--surface3, var(--border2)); display: flex; align-items: center; justify-content: center; color: var(--text-dim); flex-shrink: 0; }
.song-item.playing .song-play-ic { background: var(--accent); color: var(--accent-fg); }
#songsChevron { transition: transform .2s; }
#songsChevron.open { transform: rotate(90deg); }

/* ---------- THINKING LABEL (di samping nama model) ---------- */
.think-label-badge {
  display: inline-flex; align-items: center; gap: 4px; margin-left: 6px; padding: 3px 8px 3px 6px;
  border-radius: 999px; font-size: 10.5px; font-weight: 700; letter-spacing: .01em;
  background: linear-gradient(120deg, rgba(124,92,247,.16), rgba(167,139,245,.16));
  border: 1px solid rgba(124,92,247,.38); color: #7c5cf7;
  cursor: pointer; transition: background .15s, transform .1s, border-color .15s;
  position: relative; flex-shrink: 0;
}
.think-label-badge:hover { background: linear-gradient(120deg, rgba(124,92,247,.26), rgba(167,139,245,.26)); border-color: rgba(124,92,247,.6); }
.think-label-badge:active { transform: scale(.94); }
.think-label-badge svg { width: 11px; height: 11px; flex-shrink: 0; animation: thinkBadgePulse 2.4s ease-in-out infinite; }
@keyframes thinkBadgePulse { 0%,100% { opacity: 1; } 50% { opacity: .55; } }
:root[data-theme="blue-dark"] .think-label-badge { color: #6a8dfa; border-color: rgba(106,141,250,.4); background: linear-gradient(120deg, rgba(106,141,250,.16), rgba(124,92,247,.16)); }
:root[data-theme="purple-dark"] .think-label-badge { color: #b98bf5; border-color: rgba(185,139,245,.4); background: linear-gradient(120deg, rgba(185,139,245,.16), rgba(124,92,247,.16)); }

/* Varian badge "Thinking Lite" — dipakai model gratis, warna lebih netral/cepat kesannya */
.think-label-badge.lite { background: linear-gradient(120deg, rgba(245,184,74,.16), rgba(245,120,154,.12)); border-color: rgba(245,184,74,.4); color: #b8860b; }
.think-label-badge.lite svg { animation: none; }
.think-label-badge.lite::after { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .0; }
:root[data-theme="neutral-dark"] .think-label-badge.lite,
:root[data-theme="blue-dark"] .think-label-badge.lite,
:root[data-theme="purple-dark"] .think-label-badge.lite { color: #f5c15c; }

/* Varian badge saat mode thinking dimatikan pengguna — tetap ada & bisa diklik, tapi terlihat redup/nonaktif */
.think-label-badge.is-off { background: var(--surface2); border-color: var(--border2); color: var(--text-muted); }
.think-label-badge.is-off svg { animation: none; opacity: .6; }

/* Varian badge "Upaya" (biasa/tinggi) — beda warna (amber/oranye) dari badge Thinking (ungu) biar gampang dibedakan */
.effort-label-badge { background: linear-gradient(120deg, rgba(124,92,247,.16), rgba(167,139,245,.14)); border-color: rgba(124,92,247,.4); color: #7c3aed; }
.effort-label-badge:hover { background: linear-gradient(120deg, rgba(124,92,247,.26), rgba(167,139,245,.24)); border-color: rgba(124,92,247,.6); }
.effort-label-badge svg { animation: none; }
.effort-label-badge.effort-high { background: linear-gradient(120deg, rgba(124,92,247,.18), rgba(245,120,154,.14)); border-color: rgba(124,92,247,.45); color: #7c3aed; }
.effort-label-badge.effort-medium { background: linear-gradient(120deg, rgba(124,92,247,.22), rgba(167,139,245,.18)); border-color: rgba(124,92,247,.5); color: #6d28d9; }
:root[data-theme="neutral-dark"] .effort-label-badge,
:root[data-theme="blue-dark"] .effort-label-badge,
:root[data-theme="purple-dark"] .effort-label-badge { color: #b98bf5; }
:root[data-theme="neutral-dark"] .effort-label-badge.effort-high,
:root[data-theme="blue-dark"] .effort-label-badge.effort-high,
:root[data-theme="purple-dark"] .effort-label-badge.effort-high { color: #b98bf5; }
:root[data-theme="neutral-dark"] .effort-label-badge.effort-medium,
:root[data-theme="blue-dark"] .effort-label-badge.effort-medium,
:root[data-theme="purple-dark"] .effort-label-badge.effort-medium { color: #c4a6f7; }

/* ---------- THINKING PANEL (muncul di TENGAH layar, bisa di-drag bebas dengan tangan/mouse) ---------- */
#thinkFloatScrim {
  position: fixed; inset: 0; z-index: 88; background: transparent;
  opacity: 0; pointer-events: none;
}
#thinkFloatScrim.show { pointer-events: auto; }
.think-float-tab {
  position: fixed; z-index: 90; left: 50%; top: 50%;
  --drag-x: 0px; --drag-y: 0px;
  width: 340px; max-width: calc(100vw - 32px); max-height: 66vh;
  background: var(--white); border: 1px solid var(--border); border-radius: 18px;
  box-shadow: 0 24px 60px -12px rgba(0,0,0,.38), 0 0 0 1px rgba(124,92,247,.1);
  display: flex; flex-direction: column; overflow: hidden;
  transform: translate(calc(-50% + var(--drag-x)), calc(-50% + var(--drag-y))) scale(.94); opacity: 0; pointer-events: none;
  transition: transform .28s cubic-bezier(.34,1.4,.4,1), opacity .22s ease, box-shadow .2s ease;
  touch-action: none;
}
.think-float-tab.show { transform: translate(calc(-50% + var(--drag-x)), calc(-50% + var(--drag-y))) scale(1); opacity: 1; pointer-events: auto; }
.think-float-tab.dragging { transition: box-shadow .2s ease; box-shadow: 0 30px 70px -10px rgba(0,0,0,.48), 0 0 0 1px rgba(124,92,247,.18); cursor: grabbing; }
.think-float-hdr {
  display: flex; align-items: center; gap: 8px; padding: 11px 12px; flex-shrink: 0;
  border-bottom: 1px solid var(--border); background: var(--surface);
  cursor: grab; user-select: none;
}
.think-float-hdr:active { cursor: grabbing; }
.think-float-hdr .tf-drag-dots { display: flex; flex-direction: column; gap: 3px; margin-right: 2px; flex-shrink: 0; opacity: .5; }
.think-float-hdr .tf-drag-dots span { width: 3px; height: 3px; border-radius: 50%; background: var(--text-muted); }
.think-float-hdr svg.tf-icon { width: 14px; height: 14px; color: #7c5cf7; flex-shrink: 0; }
.think-float-hdr .tf-title { font-size: 12.5px; font-weight: 700; color: var(--text); }
.think-float-hdr .tf-title.streaming { animation: thinkBadgePulse 1.1s ease-in-out infinite; }
.think-float-hdr .tf-close { margin-left: auto; width: 24px; height: 24px; border-radius: 7px; border: none; background: transparent; color: var(--text-muted); display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; }
.think-float-hdr .tf-close:hover { background: var(--surface2); color: var(--text); }
.think-float-body { padding: 13px 15px; overflow-y: auto; font-size: 12.5px; line-height: 1.7; color: var(--text-dim); white-space: pre-wrap; }
.think-float-body::-webkit-scrollbar { width: 6px; }
.think-float-body::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }
.think-float-body .tf-cursor { display: inline-block; width: 2px; height: 12px; background: #7c5cf7; margin-left: 1px; vertical-align: -1px; animation: tfCursorBlink .85s steps(1) infinite; }
@keyframes tfCursorBlink { 0%,49% { opacity: 1; } 50%,100% { opacity: 0; } }

/* ---------- DUAL THINKING: dua tab bersebelahan, bisa diklik & digeser (drag) posisinya ---------- */
.think-float-tab.dual { width: 380px; }
.think-float-tab.triple { width: 420px; }
.tf-dual-tabs { display: flex; gap: 4px; padding: 8px 10px 0; flex-shrink: 0; background: var(--surface); border-bottom: 1px solid var(--border); position: relative; }
.tf-dual-tab {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 7px 8px; border-radius: 10px 10px 0 0; font-size: 11.5px; font-weight: 700;
  color: var(--text-muted); background: transparent; border: none; cursor: pointer;
  transition: background .18s ease, color .18s ease; position: relative; touch-action: pan-y;
}
.tf-dual-tab .tf-dual-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--text-muted); flex-shrink: 0; transition: background .2s ease; }
.tf-dual-tab.active { color: #7c5cf7; background: var(--white); }
.tf-dual-tab.active .tf-dual-dot { background: #7c5cf7; box-shadow: 0 0 0 3px rgba(124,92,247,.18); }
.tf-dual-tab.active.streaming .tf-dual-dot { animation: wscDotPulse 1s ease-in-out infinite; }
.tf-dual-tab:not(.active):hover { color: var(--text-dim); }
/* Indikator SATU per grup tab (bukan satu per tab lagi) — posisinya digeser dengan transform biar
   benar-benar "meluncur" mulus ke tab yang baru dipencet, bukan loncat opacity di tempat. Lebar &
   posisi (left, width) diatur lewat JS setiap kali pindah slot / saat panel pertama dibuka. */
.tf-dual-indicator-track { position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; pointer-events: none; }
.tf-dual-indicator-track .tf-dual-indicator-thumb {
  position: absolute; bottom: 0; height: 2px; background: linear-gradient(90deg,#7c5cf7,#a78bf5);
  border-radius: 2px; opacity: 0;
  transition: transform .32s cubic-bezier(.34,1.15,.4,1), width .32s cubic-bezier(.34,1.15,.4,1), opacity .18s ease;
}
.tf-dual-indicator-track.show .tf-dual-indicator-thumb { opacity: 1; }

/* Konten panel thinking (teks Tahap 1/2/3 atau Sudut Pandang 1/2) fade halus saat berpindah tab —
   bukan loncat seketika. Class "switching" ditambahkan sesaat sebelum teks diganti (opacity turun +
   geser tipis ke bawah), lalu dilepas begitu teks baru mulai dirender (fade masuk balik). */
.think-float-body { transition: opacity .16s ease, transform .16s ease; }
.think-float-body.switching { opacity: 0; transform: translateY(3px); }

/* ---------- Efek reveal elegan khusus untuk bubble jawaban yang muncul setelah Dual/Triple Thinking
   selesai (dipakai bareng jeda diam 1 detik di JS sebelum class ini ditempel ke bubble). ---------- */
@keyframes thinkRevealPop {
  0% { opacity: 0; transform: translateY(10px) scale(.965); filter: blur(3px); }
  55% { opacity: 1; filter: blur(0); }
  100% { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}
.msg-bubble.think-reveal-pop { animation: thinkRevealPop .48s cubic-bezier(.2,.8,.3,1.15); }
.msg-row.ai.think-reveal-row .msg-avatar {
  animation: thinkRevealPop .48s cubic-bezier(.2,.8,.3,1.15);
}

/* Chip kecil di dalam bubble jawaban AI, untuk membuka kembali tab thinking pesan itu */
.think-reopen-chip {
  display: inline-flex; align-items: center; gap: 5px; margin-bottom: 8px; padding: 5px 10px;
  border-radius: 999px; font-size: 11.5px; font-weight: 600; color: var(--text-dim);
  background: var(--surface); border: 1px solid var(--border); cursor: pointer;
  transition: background .15s, color .15s;
}
.think-reopen-chip:hover { background: var(--surface2); color: var(--text); }
.think-reopen-chip svg { width: 12px; height: 12px; color: #7c5cf7; flex-shrink: 0; }
.think-reopen-chip.dual svg { color: #f5789a; }

/* ---------- POPOVER PILIHAN MODE THINKING (muncul saat badge "Thinking" diklik) ---------- */
.think-mode-pop {
  position: absolute; z-index: 70; bottom: 34px; left: 0;
  min-width: 220px; background: var(--white); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: 0 12px 30px -6px rgba(0,0,0,.3); padding: 6px; display: none; flex-direction: column; gap: 2px;
}
.think-mode-pop.open { display: flex; }
.think-mode-pop .tmp-label { font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--text-muted); padding: 6px 8px 4px; }
.think-mode-opt {
  display: flex; align-items: center; gap: 9px; width: 100%; text-align: left; border: none; background: transparent;
  color: var(--text); font-size: 12.5px; font-weight: 600; padding: 9px 9px; border-radius: 9px; cursor: pointer; font-family: inherit;
  transition: background .12s;
}
.think-mode-opt:hover { background: var(--surface); }
.think-mode-opt.active { background: var(--surface2); }
.think-mode-opt .tmo-ic { width: 26px; height: 26px; border-radius: 8px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; background: rgba(124,92,247,.12); color: #7c5cf7; }
.think-mode-opt.dual .tmo-ic { background: linear-gradient(135deg, rgba(124,92,247,.18), rgba(245,120,154,.18)); color: #f5789a; }
.think-mode-opt.triple .tmo-ic { background: linear-gradient(135deg, rgba(124,92,247,.18), rgba(245,184,74,.22)); color: #d99a1f; }
.think-mode-opt .tmo-txt { flex: 1; min-width: 0; }
.think-mode-opt .tmo-txt .tmo-title { display: flex; align-items: center; gap: 6px; }
.think-mode-opt .tmo-txt .tmo-sub { font-size: 10.5px; font-weight: 500; color: var(--text-muted); margin-top: 1px; }
.tmo-new-tag {
  font-size: 8.5px; font-weight: 800; letter-spacing: .04em; color: #fff; padding: 1.5px 6px 2px; border-radius: 20px;
  background: linear-gradient(120deg, #f5789a, #7c5cf7); flex-shrink: 0;
  animation: tmoNewGlow 1.8s ease-in-out infinite;
}
@keyframes tmoNewGlow { 0%,100% { filter: brightness(1); } 50% { filter: brightness(1.35); } }
.think-mode-opt .tmo-check { width: 15px; height: 15px; flex-shrink: 0; color: #7c5cf7; opacity: 0; }
.think-mode-opt.active .tmo-check { opacity: 1; }

#sidebar-scrim { position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 40; opacity: 0; pointer-events: none; transition: opacity .25s; }
#sidebar-scrim.show { opacity: 1; pointer-events: auto; }

/* ---------- MAIN ---------- */
#main { flex: 1; display: flex; flex-direction: column; height: 100%; margin-left: var(--sidebar-w); transition: margin .28s cubic-bezier(.4,0,.2,1); min-width: 0; }
#main.full { margin-left: 0; }

#topbar { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.icon-btn { width: 36px; height: 36px; border-radius: 10px; border: none; background: transparent; color: var(--text-dim); display: flex; align-items: center; justify-content: center; cursor: pointer; transition: background .12s; flex-shrink: 0; }
.icon-btn:hover { background: var(--surface); color: var(--text); }
#topbar-title { flex: 1; min-width: 0; font-size: 14.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#topbar-actions { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }

/* ---------- TOMBOL CALL (topbar) ---------- */
.call-btn-wrap { position: relative; display: inline-flex; align-items: center; flex-shrink: 0; }
#callBtn {
  width: 36px; height: 36px; border-radius: 10px; border: none;
  background: transparent; color: var(--text-dim);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background .12s, color .15s;
  position: relative; z-index: 1;
}
#callBtn:hover { background: var(--surface); color: var(--text); }
#callBtn svg { transition: transform .2s cubic-bezier(.34,1.56,.64,1); pointer-events: none; }
#callBtn:hover svg { transform: scale(1.15) rotate(-8deg); }
.call-new-badge {
  position: absolute; top: -5px; right: -8px;
  font-size: 7px; font-weight: 800; letter-spacing: .06em;
  color: #fff; padding: 2px 5px; border-radius: 999px; line-height: 1.3;
  background: linear-gradient(120deg, #6a5cf7, #f5789a);
  box-shadow: 0 1px 8px rgba(106,92,247,.55);
  pointer-events: none; white-space: nowrap; z-index: 2;
  animation: callBadgePulse 2.4s ease-in-out infinite;
}
@keyframes callBadgePulse {
  0%,100%{box-shadow:0 1px 8px rgba(106,92,247,.55);}
  50%{box-shadow:0 1px 14px rgba(245,120,154,.8),0 0 0 3px rgba(106,92,247,.15);}
}

/* ---------- LABEL "PROGRAMMER SPACE" (topbar, elegan di sebelah tombol call) ---------- */
.prog-space-btn {
  display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0;
  height: 32px; padding: 0 12px 0 10px; border-radius: 999px;
  border: 1px solid rgba(124,92,247,.28);
  background: linear-gradient(120deg, rgba(124,92,247,.1), rgba(92,214,192,.08));
  color: var(--text-dim);
  font-size: 12px; font-weight: 700; letter-spacing: .01em;
  cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s, transform .15s;
}
.prog-space-btn svg { flex-shrink: 0; opacity: .85; transition: transform .25s cubic-bezier(.34,1.56,.64,1); }
.prog-space-btn:hover {
  color: var(--text);
  border-color: rgba(124,92,247,.5);
  background: linear-gradient(120deg, rgba(124,92,247,.18), rgba(92,214,192,.14));
  transform: translateY(-1px);
}
.prog-space-btn:hover svg { transform: scale(1.12); }
.prog-space-btn:active { transform: translateY(0) scale(.97); }
@media (max-width: 560px) {
  .prog-space-btn span { display: none; }
  .prog-space-btn { padding: 0 9px; width: 32px; justify-content: center; }
}

/* ========== PROGRAMMER SPACE (chatbot kedua, khusus model coding) ========== */
#progSpacePage {
  position: fixed !important; inset: 0 !important;
  z-index: 210; margin: 0 !important; padding: 0 !important;
  max-width: none !important; max-height: none !important;
  display: flex; flex-direction: column;
  background: radial-gradient(ellipse at 22% 15%, rgba(92,214,192,.16) 0%, transparent 50%),
              radial-gradient(ellipse at 82% 85%, rgba(124,92,247,.18) 0%, transparent 48%),
              radial-gradient(ellipse at 55% 50%, rgba(12,14,20,1) 0%, #060709 100%);
  color: #f2f2f4; overflow: hidden;
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity .34s cubic-bezier(.4,0,.2,1), visibility .38s;
}
/* ---------- LABEL & TOGGLE "PER DETAIL PROMPT" DI ATAS PROGRAMMER SPACE ---------- */
.ps-detail-prompt-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px 16px; background: rgba(255,255,255,.03); border-bottom: 1px solid rgba(255,255,255,.06);
  flex-shrink: 0; font-size: 12px;
}
.ps-dp-info { display: flex; align-items: center; gap: 7px; color: rgba(255,255,255,.75); font-weight: 600; }
.ps-dp-info svg { color: #5cd6c0; flex-shrink: 0; }
.ps-dp-switch {
  position: relative; width: 36px; height: 20px; border-radius: 999px;
  background: rgba(255,255,255,.2); border: none; cursor: pointer; transition: background .2s; padding: 0; flex-shrink: 0;
}
.ps-dp-switch::before {
  content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .2s;
}
.ps-dp-switch.on { background: #5cd6c0; }
.ps-dp-switch.on::before { transform: translateX(16px); }
#progSpacePage.active { opacity: 1; visibility: visible; pointer-events: auto; }
#progSpacePage.closing {
  opacity: 0;
  transition: opacity .28s cubic-bezier(.4,0,1,1), visibility .3s;
}
#psTopBar {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 14px 16px; flex-shrink: 0;
  border-bottom: 1px solid rgba(255,255,255,.08);
  position: relative;
}
/* --- Tombol garis-tiga (hamburger) — sejajar di kiri topbar, sebelum brand, jadi tidak pernah
   bertumpukan dengan dropdown model/badge/tombol lain yang berkumpul di sisi kanan --- */
.ps-menu-btn {
  width: 34px; height: 34px; border-radius: 10px; border: 1px solid rgba(255,255,255,.1);
  background: rgba(255,255,255,.04); color: rgba(255,255,255,.8);
  display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0;
  transition: background .15s, color .15s;
}
.ps-menu-btn:hover { background: rgba(255,255,255,.1); color: #fff; }
.ps-brand { display: flex; align-items: center; gap: 9px; min-width: 0; }
.ps-brand-ic {
  width: 32px; height: 32px; border-radius: 9px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, rgba(92,214,192,.24), rgba(124,92,247,.24));
  border: 1px solid rgba(255,255,255,.1);
  color: #7ee8d2;
}
.ps-brand-txt { display: flex; flex-direction: column; min-width: 0; }
.ps-brand-title { font-size: 14px; font-weight: 800; letter-spacing: -.01em; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ps-brand-sub { font-size: 11px; color: rgba(255,255,255,.42); }
@media (max-width: 420px) {
  .ps-brand-sub { display: none; } /* topbar padat di layar sempit: sembunyikan subjudul, jaga tombol tetap lega & elegan */
  .ps-model-btn span.ps-model-name { max-width: 88px; }
}
.ps-close-btn {
  width: 34px; height: 34px; border-radius: 10px; border: 1px solid rgba(255,255,255,.1);
  background: rgba(255,255,255,.04); color: rgba(255,255,255,.7);
  display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0;
  transition: background .15s, color .15s;
}
.ps-close-btn:hover { background: rgba(255,255,255,.1); color: #fff; }

/* --- Pemilih model (dropdown) --- */
.ps-model-wrap { position: relative; flex-shrink: 1; min-width: 0; }
.ps-model-btn {
  display: flex; align-items: center; gap: 6px; max-width: 100%;
  height: 34px; padding: 0 12px; border-radius: 999px;
  border: 1px solid rgba(255,255,255,.12); background: rgba(255,255,255,.05);
  color: #fff; font-size: 12.5px; font-weight: 700; cursor: pointer; white-space: nowrap;
}
.ps-model-btn span.ps-model-name { overflow: hidden; text-overflow: ellipsis; max-width: 150px; }
.ps-model-btn:hover { background: rgba(255,255,255,.09); }
.ps-model-menu {
  position: absolute; top: calc(100% + 8px); left: 0; z-index: 20;
  width: 230px; max-height: 320px; overflow-y: auto;
  background: #121319; border: 1px solid rgba(255,255,255,.1); border-radius: 14px;
  padding: 6px; box-shadow: 0 18px 48px rgba(0,0,0,.5);
  opacity: 0; visibility: hidden; transform: translateY(-6px) scale(.98);
  transition: opacity .16s, transform .16s, visibility .16s;
}
.ps-model-menu.open { opacity: 1; visibility: visible; transform: translateY(0) scale(1); }
.ps-model-menu::-webkit-scrollbar { width: 5px; }
.ps-model-menu::-webkit-scrollbar-thumb { background: rgba(255,255,255,.14); border-radius: 4px; }
.ps-model-opt {
  width: 100%; text-align: left; padding: 9px 10px; border-radius: 9px; border: none;
  background: transparent; color: rgba(255,255,255,.78); font-size: 13px; font-weight: 600;
  cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.ps-model-opt:hover { background: rgba(255,255,255,.07); color: #fff; }
.ps-model-opt.sel { background: rgba(92,214,192,.14); color: #7ee8d2; }
.ps-model-opt .ps-check { opacity: 0; }
.ps-model-opt.sel .ps-check { opacity: 1; }

/* --- Badge kecil "sisa waktu langganan" di topbar (ringkas, tidak mengganggu) --- */
.ps-sub-badge {
  display: none; align-items: center; gap: 4px; flex-shrink: 0;
  height: 26px; padding: 0 9px; border-radius: 999px;
  border: 1px solid rgba(126,232,210,.28); background: rgba(126,232,210,.08);
  color: #7ee8d2; font-size: 10.5px; font-weight: 800; font-family: "SFMono-Regular", Consolas, monospace;
  letter-spacing: .01em; white-space: nowrap;
}
.ps-sub-badge.show { display: flex; }
.ps-sub-badge.warn { border-color: rgba(255,139,139,.4); background: rgba(255,139,139,.1); color: #ff8b8b; }

/* --- Tombol "Kode Aktivasi" (hanya tampil untuk Owner yang sudah login) --- */
.ps-actv-btn {
  width: 34px; height: 34px; border-radius: 10px; border: 1px solid rgba(126,232,210,.28);
  background: rgba(126,232,210,.1); color: #7ee8d2;
  display: none; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0;
  transition: background .15s, color .15s;
}
.ps-actv-btn.show { display: flex; }
.ps-actv-btn:hover { background: rgba(126,232,210,.2); }

/* --- Modal panel kode aktivasi (khusus Owner) --- */
#psActvModal {
  position: fixed; inset: 0; z-index: 900;
  display: flex; align-items: center; justify-content: center;
  background: rgba(6,7,10,.72); backdrop-filter: blur(6px);
  opacity: 0; visibility: hidden; transition: opacity .2s, visibility .2s;
  padding: 18px;
}
#psActvModal.show { opacity: 1; visibility: visible; }
.ps-actv-card {
  width: 100%; max-width: 400px; max-height: 86vh; overflow-y: auto;
  background: #14151b; border: 1px solid rgba(255,255,255,.1); border-radius: 20px;
  padding: 20px; box-shadow: 0 24px 60px rgba(0,0,0,.55);
  transform: translateY(10px) scale(.98); transition: transform .22s;
}
#psActvModal.show .ps-actv-card { transform: translateY(0) scale(1); }
.ps-actv-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.ps-actv-title { font-size: 15.5px; font-weight: 800; color: #fff; letter-spacing: -.01em; }
.ps-actv-close {
  width: 30px; height: 30px; border-radius: 9px; border: 1px solid rgba(255,255,255,.1);
  background: rgba(255,255,255,.04); color: rgba(255,255,255,.7);
  display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0;
}
.ps-actv-close:hover { background: rgba(255,255,255,.1); color: #fff; }
.ps-actv-sub { font-size: 12px; color: rgba(255,255,255,.45); margin: 4px 0 16px; line-height: 1.5; }
.ps-actv-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 16px;
}
.ps-actv-dur {
  padding: 12px 8px; border-radius: 12px; border: 1px solid rgba(255,255,255,.1);
  background: rgba(255,255,255,.03); color: #fff; font-size: 13px; font-weight: 700;
  cursor: pointer; text-align: center; transition: background .15s, border-color .15s, transform .1s;
}
.ps-actv-dur:hover { background: rgba(126,232,210,.1); border-color: rgba(126,232,210,.3); }
.ps-actv-dur:active { transform: scale(.97); }
.ps-actv-dur.wide { grid-column: 1 / -1; }
.ps-actv-dur.permanent { background: linear-gradient(135deg, rgba(124,92,247,.18), rgba(92,214,192,.18)); border-color: rgba(124,92,247,.35); }
.ps-actv-result {
  display: none; border: 1px solid rgba(126,232,210,.3); background: rgba(126,232,210,.07);
  border-radius: 14px; padding: 14px; margin-bottom: 14px;
}
.ps-actv-result.show { display: block; }
.ps-actv-result-label { font-size: 10.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: rgba(126,232,210,.75); margin-bottom: 6px; }
.ps-actv-code {
  font-family: "SFMono-Regular", Consolas, monospace; font-size: 19px; font-weight: 800;
  color: #7ee8d2; letter-spacing: .04em; word-break: break-all; margin-bottom: 8px;
}
.ps-actv-meta { font-size: 11.5px; color: rgba(255,255,255,.5); margin-bottom: 10px; }
.ps-actv-copy {
  width: 100%; padding: 9px; border-radius: 10px; border: 1px solid rgba(126,232,210,.35);
  background: rgba(126,232,210,.14); color: #7ee8d2; font-size: 12.5px; font-weight: 700; cursor: pointer;
}
.ps-actv-copy:hover { background: rgba(126,232,210,.22); }
.ps-actv-history-label { font-size: 10.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: rgba(255,255,255,.35); margin: 4px 0 8px; }
.ps-actv-history { max-height: 160px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }
.ps-actv-hitem {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px 10px; border-radius: 10px; background: rgba(255,255,255,.03); border: 1px solid rgba(255,255,255,.06);
}
.ps-actv-hitem-code { font-family: monospace; font-size: 12px; color: rgba(255,255,255,.85); font-weight: 700; }
.ps-actv-hitem-meta { font-size: 10px; color: rgba(255,255,255,.4); }
.ps-actv-hitem-status { font-size: 9.5px; font-weight: 800; padding: 2px 7px; border-radius: 999px; text-transform: uppercase; letter-spacing: .03em; flex-shrink: 0; }
.ps-actv-hitem-status.active { background: rgba(92,214,192,.16); color: #7ee8d2; }
.ps-actv-hitem-status.expired { background: rgba(255,255,255,.08); color: rgba(255,255,255,.4); }
.ps-actv-empty { font-size: 12px; color: rgba(255,255,255,.35); text-align: center; padding: 14px 0; }

/* --- Gerbang kode aktivasi untuk pengguna (bukan Owner) --- */
#psGateModal {
  position: fixed; inset: 0; z-index: 950;
  display: flex; align-items: center; justify-content: center;
  background: rgba(6,7,10,.85); backdrop-filter: blur(8px);
  opacity: 0; visibility: hidden; transition: opacity .2s, visibility .2s;
  padding: 18px;
}
#psGateModal.show { opacity: 1; visibility: visible; }
.ps-gate-card {
  width: 100%; max-width: 360px; background: #14151b; border: 1px solid rgba(255,255,255,.1);
  border-radius: 20px; padding: 24px 20px; text-align: center;
  box-shadow: 0 24px 60px rgba(0,0,0,.55);
  transform: translateY(10px) scale(.98); transition: transform .22s;
}
#psGateModal.show .ps-gate-card { transform: translateY(0) scale(1); }
.ps-gate-ic {
  width: 46px; height: 46px; border-radius: 13px; margin: 0 auto 14px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, rgba(92,214,192,.24), rgba(124,92,247,.24));
  border: 1px solid rgba(255,255,255,.1); color: #7ee8d2;
}
.ps-gate-title { font-size: 15.5px; font-weight: 800; color: #fff; margin-bottom: 6px; }
.ps-gate-sub { font-size: 12px; color: rgba(255,255,255,.45); line-height: 1.5; margin-bottom: 16px; }
.ps-gate-input {
  width: 100%; padding: 11px 14px; border-radius: 12px; border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.04); color: #fff; font-size: 14px; font-weight: 700; text-align: center;
  letter-spacing: .06em; margin-bottom: 10px; font-family: monospace;
}
.ps-gate-input::placeholder { color: rgba(255,255,255,.3); font-family: inherit; font-weight: 500; letter-spacing: normal; }
.ps-gate-input:focus { outline: none; border-color: rgba(126,232,210,.4); }
.ps-gate-submit {
  width: 100%; padding: 11px; border-radius: 12px; border: none;
  background: linear-gradient(135deg, #5cd6c0, #7c5cf7); color: #08110f; font-size: 13.5px; font-weight: 800;
  cursor: pointer; margin-bottom: 10px;
}
.ps-gate-submit:hover { filter: brightness(1.06); }
.ps-gate-err { font-size: 11.5px; color: #ff8b8b; min-height: 15px; margin-bottom: 4px; }
.ps-gate-cancel { background: transparent; border: none; color: rgba(255,255,255,.4); font-size: 12px; cursor: pointer; padding: 6px; }
.ps-gate-cancel:hover { color: rgba(255,255,255,.7); }

