/* ============================================================
   JATAV RETHINK AI — M1 Design System + Shell
   Nothing-inspired: black, one red, glass, dots, thin lines.
   Har cheez thodi si zinda rahe — koi static surface nahi.
   ============================================================ */

/* ---------- 1. TOKENS ---------- */
:root {
  --bg: #0a0a0a;
  --bg-2: #101010;
  --bg-3: #161616;
  --ink: #f4f4f4;
  --ink-dim: #9a9a9a;
  --ink-mute: #5c5c5c;
  --red: #e63946;
  --red-deep: #b4232e;
  --red-soft: rgba(230, 57, 70, 0.16);
  --red-glow: rgba(230, 57, 70, 0.45);
  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.14);
  --line-3: rgba(255, 255, 255, 0.22);
  --glass: rgba(14, 14, 14, 0.58);
  --glass-2: rgba(22, 22, 22, 0.72);
  --inner-glow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
  --shadow-lg: 0 24px 80px rgba(0, 0, 0, 0.55);
  --font-dot: "Doto", "DotGothic16", ui-monospace, monospace;
  --font-ui: "Outfit", "Noto Sans Devanagari", system-ui, sans-serif;
  --header-h: 64px;
  --ticker-h: 32px;
  --chat-w: 420px;
  --radius: 18px;
  --radius-sm: 10px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  font-weight: 400;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

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

img {
  max-width: 100%;
}

::selection {
  background: var(--red);
  color: #fff;
}

/* Focus ring — thin, red, professional */
:focus-visible {
  outline: 1px solid var(--red);
  outline-offset: 3px;
}

/* ---------- 2. APP SHELL ---------- */
.app {
  position: relative;
  height: 100dvh;
  display: grid;
  grid-template-rows: var(--header-h) 1fr var(--ticker-h);
  isolation: isolate;
}

/* Fine dot-grid — Nothing ka signature texture */
.app::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: radial-gradient(rgba(255, 255, 255, 0.055) 0.7px, transparent 0.8px);
  background-size: 18px 18px;
  mask-image: radial-gradient(ellipse at 50% 30%, #000 20%, transparent 75%);
  animation: gridDrift 48s linear infinite;
}

@keyframes gridDrift {
  from { background-position: 0 0; }
  to { background-position: 18px 18px; }
}

/* Soft red ambient bloom, bahut dheere saans leta hai */
.ambient {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 50% 30% at 12% 0%, rgba(230, 57, 70, 0.10), transparent 60%),
    radial-gradient(ellipse 40% 28% at 88% 100%, rgba(230, 57, 70, 0.07), transparent 60%),
    radial-gradient(ellipse 30% 20% at 70% 18%, rgba(255, 255, 255, 0.03), transparent 70%);
  animation: ambientBreathe 10s ease-in-out infinite;
}

@keyframes ambientBreathe {
  0%, 100% { opacity: 0.85; }
  50% { opacity: 1; }
}

/* Film grain overlay */
.grain {
  position: fixed;
  inset: 0;
  z-index: 70;
  pointer-events: none;
  opacity: 0.055;
  background: url("../assets/grain.png") repeat;
  mix-blend-mode: overlay;
  animation: grainShift 0.8s steps(4) infinite;
}

@keyframes grainShift {
  0% { transform: translate(0, 0); }
  25% { transform: translate(-1%, 1%); }
  50% { transform: translate(1%, -1%); }
  75% { transform: translate(-1%, -1%); }
  100% { transform: translate(0, 0); }
}

/* ---------- 3. BOOT SPLASH ---------- */
.boot {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background: #050505;
  transition: opacity 0.7s var(--ease), visibility 0.7s;
}

.boot.is-done {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.boot-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
}

.boot-box {
  background: var(--red);
  color: #fff;
  font-family: var(--font-dot);
  font-weight: 700;
  font-size: 28px;
  letter-spacing: 0.22em;
  padding: 10px 16px 8px 18px;
  animation: bootPop 0.7s var(--ease-out) both;
}

.boot-rest {
  font-family: var(--font-dot);
  font-size: 22px;
  letter-spacing: 0.38em;
  color: #fff;
  animation: bootFade 0.8s 0.25s var(--ease) both;
}

.boot-line {
  width: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--red), transparent);
  animation: bootLine 1.1s 0.35s var(--ease) forwards;
}

.boot-sub {
  font-family: var(--font-dot);
  font-size: 10px;
  letter-spacing: 0.42em;
  color: var(--ink-mute);
  text-transform: uppercase;
  animation: bootFade 0.8s 0.55s var(--ease) both;
}

@keyframes bootPop {
  from { transform: scale(0.86) translateY(8px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}

@keyframes bootFade {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes bootLine {
  to { width: 240px; }
}

/* ---------- 4. HEADER ---------- */
.header {
  position: relative;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(10, 10, 10, 0.86), rgba(10, 10, 10, 0.55));
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
}

.header::after {
  /* dheere travel karti hui red hairline */
  content: "";
  position: absolute;
  left: -20%;
  bottom: -1px;
  width: 18%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--red), transparent);
  animation: headerSweep 7.5s linear infinite;
}

@keyframes headerSweep {
  to { left: 110%; }
}

.wordmark {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
  min-width: 0;
}

.wm-box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--red);
  color: #fff;
  font-family: var(--font-dot);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.18em;
  padding: 6px 9px 5px 11px;
  line-height: 1;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06), 0 8px 24px rgba(230, 57, 70, 0.28);
  animation: boxGlow 3.6s ease-in-out infinite;
}

@keyframes boxGlow {
  0%, 100% { box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06), 0 8px 24px rgba(230, 57, 70, 0.22); }
  50% { box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1), 0 8px 28px rgba(230, 57, 70, 0.42); }
}

.wm-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.wm-rethink {
  font-family: var(--font-dot);
  font-size: 15px;
  letter-spacing: 0.28em;
  font-weight: 500;
  line-height: 1;
}

.wm-ai {
  font-family: var(--font-dot);
  font-size: 9px;
  letter-spacing: 0.46em;
  color: var(--ink-dim);
  line-height: 1;
}

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

/* LIVE badge */
.live {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 30px;
  padding: 0 10px 0 9px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 0 0 var(--red-glow);
  animation: livePulse 1.6s ease-out infinite;
}

@keyframes livePulse {
  0% { box-shadow: 0 0 0 0 var(--red-glow); }
  70% { box-shadow: 0 0 0 8px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

.live-label {
  font-family: var(--font-dot);
  font-size: 10px;
  letter-spacing: 0.28em;
  color: var(--ink);
}

/* Icon / pill buttons */
.icon-btn,
.pill-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 34px;
  border: 1px solid var(--line-2);
  background: rgba(255, 255, 255, 0.03);
  color: var(--ink);
  transition: border-color 0.25s var(--ease), background 0.25s var(--ease), transform 0.25s var(--ease);
}

.icon-btn {
  position: relative;
  width: 34px;
  border-radius: 50%;
}

.key-dot {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ink-mute);
  box-shadow: 0 0 0 2px #0a0a0a;
}

.key-dot.is-on {
  background: #7dcea0;
}

.key-dot.is-off {
  background: var(--red);
  animation: livePulse 1.8s ease-out infinite;
}

.pill-btn {
  padding: 0 12px;
  border-radius: 999px;
  font-size: 12px;
  letter-spacing: 0.04em;
}

.icon-btn:hover,
.pill-btn:hover {
  border-color: var(--line-3);
  background: rgba(255, 255, 255, 0.06);
  transform: translateY(-1px);
}

.icon-btn svg,
.pill-btn svg {
  display: block;
}

.model-wrap {
  position: relative;
}

.model-btn .bolt {
  color: var(--red);
}

.model-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 240px;
  max-height: min(62vh, 420px);
  overflow-y: auto;
  padding: 8px;
  border-radius: 14px;
  background: #121212;
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.72);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  opacity: 1;
  display: none;
  z-index: 90;
}

.model-menu.is-open {
  display: block;
  animation: riseIn 0.28s var(--ease);
}

@keyframes riseIn {
  from { opacity: 0; transform: translateY(6px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.model-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 9px;
  font-size: 13px;
  color: #d8d8d8;
  text-align: left;
  background: #121212;
}

.model-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--ink);
}

.model-item.is-active {
  color: var(--ink);
  background: var(--red-soft);
}

.model-item small {
  font-family: var(--font-dot);
  font-size: 9px;
  letter-spacing: 0.14em;
  color: var(--ink-mute);
}

/* ---------- 5. WORKSPACE — full-bleed scene + bottom drawer ---------- */
.workspace {
  position: relative;
  z-index: 5;
  display: block;
  min-height: 0;
  padding: 10px 10px 8px;
}

/* ---------- 6. SCENE STAGE (placeholder — M6 replace karega) ---------- */
.scene {
  position: absolute;
  inset: 10px 10px 8px;
  min-height: 0;
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #07080c;
  box-shadow: var(--inner-glow), 0 0 0 1px rgba(0, 0, 0, 0.4);
}

.scene-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.scene-tag {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(8, 8, 8, 0.45);
  backdrop-filter: blur(10px);
  font-family: var(--font-dot);
  font-size: 9px;
  letter-spacing: 0.28em;
  color: var(--ink-dim);
}

.scene-tag i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--red);
  display: inline-block;
  animation: livePulse 1.8s ease-out infinite;
}

/* SVG scene animations */
.cloud {
  animation: cloudDrift 42s linear infinite;
}

.cloud-b {
  animation-duration: 58s;
  animation-direction: reverse;
}

@keyframes cloudDrift {
  from { transform: translateX(-8%); }
  to { transform: translateX(12%); }
}

.smoke {
  animation: smokeUp 4.2s ease-in infinite;
  transform-box: fill-box;
  transform-origin: center bottom;
}

.smoke:nth-child(2) { animation-delay: 1.2s; }
.smoke:nth-child(3) { animation-delay: 2.4s; }

@keyframes smokeUp {
  0% { opacity: 0.15; transform: translateY(0) scale(0.7); }
  60% { opacity: 0.35; }
  100% { opacity: 0; transform: translateY(-28px) scale(1.35); }
}

.grass {
  transform-box: fill-box;
  transform-origin: bottom center;
  animation: sway 3.4s ease-in-out infinite;
}

.grass:nth-child(odd) { animation-duration: 2.8s; }

@keyframes sway {
  0%, 100% { transform: rotate(-4deg); }
  50% { transform: rotate(5deg); }
}

.water-shimmer {
  animation: shimmer 5s linear infinite;
}

@keyframes shimmer {
  from { transform: translateX(-20px); }
  to { transform: translateX(20px); }
}

.fish {
  animation: swim 9s ease-in-out infinite;
}

.fish-b { animation-duration: 12s; animation-delay: -3s; }
.fish-c { animation-duration: 8s; animation-delay: -5s; }

@keyframes swim {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(46px, -4px); }
}

.bird {
  animation: fly 18s linear infinite;
}

.bird-b { animation-duration: 24s; animation-delay: -8s; }

@keyframes fly {
  0% { transform: translate(-10%, 0); }
  100% { transform: translate(110%, -8%); }
}

/* Brand + banner stacked — banner kabhi letters dhakega nahi */
.scene-titles {
  position: absolute;
  top: 10px;
  left: 12px;
  right: 12px;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  pointer-events: none;
}

.scene-sign {
  position: relative;
  top: auto;
  left: auto;
  z-index: 3;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 5px;
  pointer-events: none;
  animation: floatSign 6s ease-in-out infinite;
}

.scene-sign span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: clamp(22px, 4.6vw, 42px);
  height: clamp(30px, 6.2vw, 52px);
  padding: 0 3px;
  background: linear-gradient(180deg, #f4f4f4 0%, #cfcfcf 100%);
  color: #161616;
  font-family: var(--font-dot);
  font-size: clamp(16px, 3.6vw, 30px);
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1;
  border: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow:
    0 6px 14px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.scene-sign .sign-gap {
  width: clamp(8px, 1.6vw, 16px);
  height: 1px;
  background: transparent;
}

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

/* Credit banner — brand ke neeche latka, alag column */
.scene-banner {
  position: relative;
  top: auto;
  right: auto;
  z-index: 4;
  width: min(320px, 92%);
  pointer-events: none;
}

.banner-swing {
  transform-origin: top center;
  animation: swing 4.6s ease-in-out infinite;
}

.banner-ropes {
  display: block;
  height: 18px;
  margin: 0 22px;
  border-left: 2px solid #6a6a6a;
  border-right: 2px solid #6a6a6a;
}

.banner-board {
  padding: 10px 14px 11px;
  background: #141414;
  border: 2px solid var(--red);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  text-align: center;
}

.banner-board small {
  display: block;
  font-family: var(--font-ui);
  font-size: clamp(10px, 1.7vw, 13px);
  letter-spacing: 0.04em;
  color: #d6d6d6;
  font-weight: 300;
}

.banner-board strong {
  display: block;
  margin-top: 3px;
  font-family: var(--font-ui);
  font-size: clamp(13px, 2.2vw, 16px);
  letter-spacing: 0.14em;
  font-weight: 600;
  color: #fff;
}

@keyframes swing {
  0%, 100% { transform: rotate(-2.2deg); }
  50% { transform: rotate(2.4deg); }
}

@media (max-width: 920px) {
  .scene-titles {
    top: 8px;
    gap: 8px;
  }

  .scene-sign {
    gap: 3px;
  }
}

@media (max-width: 560px) {
  .scene-sign {
    gap: 2px;
  }

  .scene-sign span {
    min-width: 16px;
    height: 24px;
    font-size: 13px;
  }

  .scene-banner {
    width: min(260px, 94%);
  }
}

/* ---------- 7. GLASS CHAT DRAWER ---------- */
.chat {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 8px;
  top: auto;
  z-index: 8;
  height: min(50vh, 560px);
  min-height: 0;
  display: flex;
  flex-direction: column;
  border-radius: 22px 22px 18px 18px;
  background: var(--glass);
  border: 1px solid var(--line-2);
  box-shadow: var(--inner-glow), 0 0 40px rgba(255, 255, 255, 0.015), var(--shadow-lg);
  backdrop-filter: blur(26px) saturate(150%);
  -webkit-backdrop-filter: blur(26px) saturate(150%);
  overflow: hidden;
  transition: height 0.42s var(--ease), top 0.42s var(--ease), border-radius 0.42s var(--ease);
}

/* 3-step: full → half → hidden */
.chat.is-full {
  top: 8px;
  height: auto;
  border-radius: 18px;
}

.chat.is-half {
  top: auto;
  height: min(50vh, 560px);
}

.chat.is-hidden {
  top: auto;
  height: 26px;
  border-radius: 16px 16px 10px 10px;
}

.chat.is-hidden .messages,
.chat.is-hidden .chips,
.chat.is-hidden .chat-head,
.chat.is-hidden .composer,
.chat.is-hidden .attach-tray,
.chat.is-hidden .live-panel,
.chat.is-hidden .side-back {
  display: none;
}

.drawer-handle {
  flex: 0 0 auto;
  height: 28px;
  display: grid;
  place-items: center;
  cursor: pointer;
  touch-action: none;
}

.chat.is-hidden .drawer-handle {
  height: 26px;
}

.drawer-grip {
  width: 42px;
  height: 4px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.22);
  transition: background 0.25s, width 0.25s;
}

.drawer-handle:hover .drawer-grip {
  background: var(--red);
  width: 56px;
}

.chat::before {
  /* top inner highlight */
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.28), transparent);
  pointer-events: none;
}

.chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--line);
}

.chat-kicker {
  font-family: var(--font-dot);
  font-size: 10px;
  letter-spacing: 0.32em;
  color: var(--ink-dim);
}

.mode-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 11px;
  color: var(--ink-dim);
  background: rgba(255, 255, 255, 0.03);
}

.mode-chip b {
  font-weight: 500;
  color: var(--ink);
}

.messages {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 14px 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scroll-behavior: smooth;
}

.msg {
  max-width: 86%;
  padding: 10px 14px 12px;
  font-size: 15px;
  line-height: 1.7;
  word-break: break-word;
}

.msg-user {
  align-self: flex-end;
  margin-left: auto;
  background: #2c2c30;
  color: #f4f4f4;
  border-radius: 18px 18px 4px 18px;
}

.msg-user .md p { margin: 0; }

.msg-ai {
  align-self: flex-start;
  margin-right: auto;
  max-width: 94%;
  padding: 2px 4px 8px;
  background: transparent;
}

.msg-sys {
  align-self: center;
  font-size: 12px;
  color: var(--ink-dim);
}

.msg-meta { display: none; }

.msg-ai .md {
  font-size: 15.5px;
  line-height: 1.78;
  letter-spacing: 0.01em;
}

.msg-ai .md p {
  margin: 0 0 1.05em;
}

.msg-ai .md p:last-child {
  margin-bottom: 0;
}

.msg-ai .md h3,
.msg-ai .md h4,
.msg-ai .md h5 {
  margin: 1.2em 0 0.45em;
  font-weight: 650;
  line-height: 1.35;
  color: #fff;
}

.msg-ai .md h3 { font-size: 1.14em; }
.msg-ai .md h4 { font-size: 1.06em; }
.msg-ai .md h5 { font-size: 1.02em; }

.msg-ai .md ul,
.msg-ai .md ol {
  margin: 0.15em 0 1.05em;
  padding-left: 1.25em;
}

.msg-ai .md li {
  margin: 0.32em 0;
}

.msg-ai .md blockquote {
  margin: 0.4em 0 1em;
  padding: 0.2em 0 0.2em 0.9em;
  border-left: 2px solid var(--red);
  color: #d8d8d8;
}

.md-table-wrap {
  margin: 0.4em 0 1.1em;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.msg-ai .md table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.msg-ai .md th,
.msg-ai .md td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.msg-ai .md th {
  color: #fff;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.04);
}

.msg.is-streaming::after {
  content: "▍";
  color: var(--red);
  animation: livePulse 0.9s ease-out infinite;
}

.live-panel { display: none; }

.empty {
  margin: auto;
  text-align: center;
  max-width: 280px;
}

.empty-mark {
  width: 54px;
  height: 54px;
  margin: 0 auto 16px;
  display: grid;
  place-items: center;
  background: var(--red);
  color: #fff;
  font-family: var(--font-dot);
  font-size: 18px;
  letter-spacing: 0.08em;
  box-shadow: 0 10px 30px rgba(230, 57, 70, 0.35);
  animation: boxGlow 3.6s ease-in-out infinite;
}

.empty h2 {
  margin: 0 0 8px;
  font-family: var(--font-dot);
  font-weight: 500;
  font-size: 18px;
  letter-spacing: 0.16em;
}

.empty p {
  margin: 0;
  color: var(--ink-dim);
  font-size: 13.5px;
  line-height: 1.55;
  font-weight: 300;
}

.empty-hi {
  display: block;
  margin-top: 8px;
  font-family: "Noto Sans Devanagari", var(--font-ui);
  font-size: 13px;
  color: var(--ink-mute);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 16px 12px;
}

.chip {
  height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--ink-dim);
  font-size: 12px;
  transition: border-color 0.25s, color 0.25s, background 0.25s, transform 0.25s var(--ease);
}

.chip:hover {
  color: var(--ink);
  border-color: var(--line-3);
  background: rgba(255, 255, 255, 0.06);
  transform: translateY(-1px);
}

.chips {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  padding: 0 12px 10px;
  overflow-x: auto;
  scrollbar-width: none;
}

.chips::-webkit-scrollbar { display: none; }

.chip {
  flex: 0 0 auto;
  height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--ink-dim);
  font-size: 12px;
}

.md {
  font-size: 14px;
  line-height: 1.6;
}

.md p { margin: 0 0 0.95em; }
.md em { font-style: italic; }
.md strong { font-weight: 650; }
.md u { text-decoration: underline; }
.md p:last-child { margin-bottom: 0; }
.md ul, .md ol { margin: 0.2em 0 0.7em; padding-left: 1.2em; }
.md code {
  font-family: ui-monospace, monospace;
  font-size: 0.86em;
  background: rgba(255, 255, 255, 0.06);
  padding: 0.1em 0.35em;
  border-radius: 4px;
}
.md pre {
  margin: 0.4em 0 0.8em;
  padding: 10px 12px;
  border-radius: 10px;
  background: #0b0b0b;
  border: 1px solid var(--line);
  overflow: auto;
}
.md pre code { background: none; padding: 0; }
.md a { color: #f0a0a6; }

.ph-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 6px 0 8px;
}

.ph-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 11px 8px;
  background: rgba(255, 255, 255, 0.03);
}

.ph-card header {
  font-family: var(--font-dot);
  font-size: 9px;
  letter-spacing: 0.22em;
  color: var(--ink-mute);
  margin-bottom: 6px;
}

.ph-a { border-color: rgba(255, 255, 255, 0.12); }
.ph-b { border-color: rgba(255, 255, 255, 0.12); }
.ph-c {
  margin-top: 2px;
  border-color: rgba(230, 57, 70, 0.45);
  background: var(--red-soft);
}
.ph-fix {
  margin-bottom: 8px;
  border-color: rgba(240, 193, 75, 0.45);
  background: rgba(240, 193, 75, 0.08);
}
.ph-fix header { color: #f0c14b; }
.ph-c header { color: var(--red); }

.ph-body p { margin: 0 0 0.5em; }
.ph-body p:last-child { margin: 0; }

.copy-btn { display: none; }

.msg-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-top: 10px;
  padding-top: 2px;
}

.act-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  color: var(--ink-mute);
  display: grid;
  place-items: center;
  transition: color 0.2s, background 0.2s, transform 0.2s;
}

.act-btn:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.06);
}

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

.act-btn.is-on {
  color: var(--red);
  background: var(--red-soft);
}

.act-btn.is-done {
  color: #8fdf9a;
}

.act-btn svg {
  display: block;
}

.msg.is-streaming .msg-actions {
  display: none;
}

.typing {
  display: flex;
  gap: 5px;
  padding: 6px 2px 2px;
}

.typing i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--red);
  animation: typeDot 1s ease-in-out infinite;
}
.typing i:nth-child(2) { animation-delay: 0.15s; }
.typing i:nth-child(3) { animation-delay: 0.3s; }

@keyframes typeDot {
  0%, 80%, 100% { opacity: 0.25; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-3px); }
}

@media (max-width: 560px) {
  .ph-grid { grid-template-columns: 1fr; }
}

/* Composer */
.composer {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 10px 12px;
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.18));
}

.composer-model {
  position: relative;
  flex: 0 0 auto;
}

.model-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 36px;
  padding: 0 10px 0 8px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink);
  font-size: 12.5px;
  max-width: 132px;
}

.model-chip .bolt { color: var(--red); }

.model-chip .model-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 78px;
}

.model-chip:hover {
  border-color: var(--line-3);
  background: rgba(255, 255, 255, 0.07);
}

.composer .model-menu {
  top: auto;
  bottom: calc(100% + 8px);
  left: 0;
  right: auto;
  z-index: 90;
  background: #121212;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.hub-trigger {
  position: relative;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #111;
  border: 1px solid var(--line-2);
  color: #fff;
  flex: 0 0 auto;
  box-shadow: var(--inner-glow), 0 8px 20px rgba(0, 0, 0, 0.35);
  transition: transform 0.35s var(--ease), background 0.25s, border-color 0.25s;
}

.hub-trigger span,
.hub-trigger span::after {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 14px;
  height: 1.5px;
  background: #fff;
  border-radius: 2px;
  transform: translate(-50%, -50%);
  transition: transform 0.35s var(--ease), background 0.25s;
}

.hub-trigger span::after {
  content: "";
  transform: translate(-50%, -50%) rotate(90deg);
}

.hub-trigger:hover {
  border-color: var(--red);
  background: #161616;
}

.hub-trigger.is-open {
  background: var(--red);
  border-color: var(--red);
  transform: rotate(45deg);
}

.field {
  flex: 1;
  min-width: 0;
  height: 42px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--ink);
  outline: none;
  transition: border-color 0.25s;
}

.field::placeholder {
  color: var(--ink-mute);
  font-weight: 300;
}

.field:focus {
  border-color: var(--line-3);
}

.send-btn,
.mic-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--line-2);
  background: rgba(255, 255, 255, 0.03);
  color: var(--ink);
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  transition: transform 0.25s var(--ease), background 0.25s, border-color 0.25s;
}

.send-btn {
  position: relative;
  z-index: 6;
  width: 48px;
  height: 48px;
  background: var(--red);
  border-color: var(--red);
  color: #fff;
  box-shadow: 0 8px 20px rgba(230, 57, 70, 0.32);
}

.send-btn:hover,
.mic-btn:hover {
  transform: translateY(-1px);
}

.mic-btn.is-listening {
  border-color: var(--red);
  color: var(--red);
  box-shadow: 0 0 0 6px var(--red-soft);
  animation: livePulse 1.4s ease-out infinite;
}

/* ---------- 8. FEATURE HUB ---------- */
.hub {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(4, 4, 4, 0.55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s var(--ease), visibility 0.3s;
}

.hub.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.hub-panel {
  width: min(560px, 100%);
  padding: 22px 22px 18px;
  border-radius: 24px;
  background: var(--glass-2);
  border: 1px solid var(--line-2);
  box-shadow: var(--inner-glow), var(--shadow-lg);
  transform: translateY(14px) scale(0.97);
  transition: transform 0.4s var(--ease);
}

.hub.is-open .hub-panel {
  transform: none;
}

.hub-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 16px;
}

.hub-top h3 {
  margin: 0;
  font-family: var(--font-dot);
  font-size: 14px;
  letter-spacing: 0.34em;
  font-weight: 500;
}

.hub-top span {
  font-size: 11px;
  color: var(--ink-mute);
  letter-spacing: 0.12em;
}

.hub-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.hub-item {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.025);
  color: var(--ink);
  transition: transform 0.3s var(--ease), border-color 0.25s, background 0.25s, box-shadow 0.3s;
  opacity: 0;
  transform: translateY(10px);
}

.hub.is-open .hub-item {
  opacity: 1;
  transform: none;
}

.hub.is-open .hub-item:nth-child(1) { transition-delay: 0.04s; }
.hub.is-open .hub-item:nth-child(2) { transition-delay: 0.08s; }
.hub.is-open .hub-item:nth-child(3) { transition-delay: 0.12s; }
.hub.is-open .hub-item:nth-child(4) { transition-delay: 0.16s; }
.hub.is-open .hub-item:nth-child(5) { transition-delay: 0.20s; }
.hub.is-open .hub-item:nth-child(6) { transition-delay: 0.24s; }
.hub.is-open .hub-item:nth-child(7) { transition-delay: 0.28s; }
.hub.is-open .hub-item:nth-child(8) { transition-delay: 0.32s; }

.hub-item:hover {
  border-color: rgba(230, 57, 70, 0.55);
  background: var(--red-soft);
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(230, 57, 70, 0.12);
}

.hub-ico {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--line-2);
  background: #0d0d0d;
}

.hub-item strong {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
}

.hub-item em {
  font-style: normal;
  font-size: 10px;
  color: var(--ink-mute);
  font-family: "Noto Sans Devanagari", var(--font-ui);
}

/* ---------- 9. SETTINGS MODAL ---------- */
.modal-back {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(4, 4, 4, 0.62);
  backdrop-filter: blur(12px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s var(--ease), visibility 0.3s;
}

.modal-back.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.modal {
  width: min(480px, 100%);
  border-radius: 22px;
  border: 1px solid var(--line-2);
  background: var(--glass-2);
  box-shadow: var(--inner-glow), var(--shadow-lg);
  padding: 22px;
  transform: translateY(12px);
  transition: transform 0.35s var(--ease);
}

.modal-back.is-open .modal {
  transform: none;
}

.modal h3 {
  margin: 0 0 4px;
  font-family: var(--font-dot);
  letter-spacing: 0.28em;
  font-size: 14px;
  font-weight: 500;
}

.modal .hint {
  margin: 0 0 14px;
  color: var(--ink-mute);
  font-size: 12.5px;
  line-height: 1.5;
}

.free-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 16px;
  font-size: 13px;
  color: var(--ink);
}

.free-row input {
  width: 16px;
  height: 16px;
  accent-color: var(--red);
}

.field-block {
  margin-bottom: 12px;
}

.field-block label {
  display: block;
  margin-bottom: 6px;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-dim);
}

.field-block input {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.35);
  outline: none;
}

.field-block input:focus {
  border-color: var(--line-3);
}

.key-row {
  display: flex;
  gap: 8px;
}

.key-row input {
  flex: 1;
}

.key-toggle {
  height: 42px;
  padding: 0 12px;
  flex: 0 0 auto;
}

.key-help {
  display: inline-block;
  margin-top: 7px;
  font-size: 12px;
  color: var(--ink-dim);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
}

.key-help:hover {
  color: var(--ink);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}

.btn-ghost,
.btn-red {
  height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  font-size: 13px;
}

.btn-ghost {
  border: 1px solid var(--line-2);
  color: var(--ink-dim);
}

.btn-red {
  background: var(--red);
  color: #fff;
}

.save-note {
  margin-top: 10px;
  min-height: 16px;
  font-size: 12px;
  color: #8fdf9a;
}

/* ---------- 10. FOOTER TICKER ---------- */
.ticker {
  position: relative;
  z-index: 20;
  display: flex;
  align-items: center;
  overflow: hidden;
  border-top: 1px solid var(--line);
  background: #070707;
}

.ticker-track {
  display: flex;
  width: max-content;
  animation: marquee 38s linear infinite;
  will-change: transform;
}

.ticker-track:hover {
  animation-play-state: paused;
}

@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

.ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 18px;
  padding: 0 18px;
  white-space: nowrap;
  font-family: var(--font-dot);
  font-size: 11px;
  letter-spacing: 0.28em;
  color: var(--ink-dim);
}

.ticker-item .star {
  color: var(--red);
}

.ticker-dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--red);
  opacity: 0.85;
}

/* ---------- 11. RESPONSIVE ---------- */
@media (max-width: 920px) {
  .workspace {
    padding: 8px 8px 6px;
  }

  .scene {
    inset: 8px 8px 6px;
  }

  .chat {
    left: 8px;
    right: 8px;
    bottom: 6px;
    height: min(48vh, 520px);
  }

  .wm-text { display: none; }

  .hub-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .hub-item {
    aspect-ratio: auto;
    min-height: 88px;
    flex-direction: row;
    justify-content: flex-start;
    padding: 0 14px;
  }

  .live-label { display: none; }
}

@media (max-width: 560px) {
  :root { --header-h: 56px; --ticker-h: 28px; }

  .header { padding: 0 10px; gap: 8px; }
  .pill-btn .model-name { max-width: 72px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .empty h2 { font-size: 15px; }
  .ticker-item { letter-spacing: 0.18em; font-size: 10px; }
}

/* ---------- 12. REDUCED MOTION ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
icker-item {
  display: inline-flex;
  align-items: center;
  gap: 18px;
  padding: 0 18px;
  white-space: nowrap;
  font-family: var(--font-dot);
  font-size: 11px;
  letter-spacing: 0.28em;
  color: var(--ink-dim);
}

.ticker-item .star {
  color: var(--red);
}

.ticker-dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--red);
  opacity: 0.85;
}

/* ---------- 11. RESPONSIVE ---------- */
@media (max-width: 920px) {
  .workspace {
    padding: 8px 8px 6px;
  }

  .scene {
    inset: 8px 8px 6px;
  }

  .chat {
    left: 8px;
    right: 8px;
    bottom: 6px;
    height: min(48vh, 520px);
  }

  .wm-text { display: none; }

  .hub-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .hub-item {
    aspect-ratio: auto;
    min-height: 88px;
    flex-direction: row;
    justify-content: flex-start;
    padding: 0 14px;
  }

  .live-label { display: none; }
}

@media (max-width: 560px) {
  :root { --header-h: 56px; --ticker-h: 28px; }

  .header { padding: 0 10px; gap: 8px; }
  .pill-btn .model-name { max-width: 72px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .empty h2 { font-size: 15px; }
  .ticker-item { letter-spacing: 0.18em; font-size: 10px; }
}

/* ---------- 12. REDUCED MOTION ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------- 13. CLAUDE-LIKE WORKSPACE CHROME ---------- */
.chat-head {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 8px 6px !important;
  position: relative;
  z-index: 9;
}

.head-left,
.head-right {
  display: flex;
  align-items: center;
  gap: 2px;
  min-width: 0;
}

.head-left { flex: 1; }

.chat-title {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 46vw;
  outline: none;
  border-radius: 6px;
  padding: 2px 6px;
}

.chat-title.is-edit {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line-2);
}

.head-mode { display: none !important; }

.head-ico {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  color: #f4f4f4;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  background: rgba(255, 255, 255, 0.04);
}

.head-ico:hover,
.head-ico[aria-expanded="true"] {
  background: rgba(255, 255, 255, 0.1);
}

.more-wrap { position: relative; }

.more-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: 220px;
  padding: 6px;
  border-radius: 14px;
  background: #161616;
  border: 1px solid var(--line-2);
  box-shadow: var(--shadow-lg);
  z-index: 24;
}

.more-menu[hidden] { display: none !important; }

.more-head {
  padding: 8px 10px 10px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--ink-dim);
}

.more-menu button {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 10px;
  border-radius: 9px;
  font-size: 13.5px;
  color: var(--ink);
  text-align: left;
}

.more-menu button:hover { background: rgba(255, 255, 255, 0.05); }
.more-menu button i { font-style: normal; color: var(--ink-mute); }
.more-menu .is-danger,
.more-menu .is-danger i { color: #f0a0a6; }

.side-back {
  position: absolute;
  inset: 28px 0 0 0;
  z-index: 14;
  background: rgba(4, 4, 4, 0.5);
  display: flex;
}

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

.side-panel {
  width: min(280px, 84%);
  height: 100%;
  background: #101010;
  border-right: 1px solid var(--line);
  padding: 14px 10px 18px;
  overflow: auto;
}

.side-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px 14px;
  font-family: var(--font-dot);
  letter-spacing: 0.18em;
  font-size: 12px;
}

.side-link {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 10px;
  font-size: 14px;
  color: var(--ink);
  text-align: left;
}

.side-link:hover { background: rgba(255, 255, 255, 0.05); }
.side-link svg { color: var(--ink-dim); }

.side-label {
  margin: 16px 10px 6px;
  font-family: var(--font-dot);
  font-size: 10px;
  letter-spacing: 0.22em;
  color: var(--ink-mute);
}

.recent-list { display: flex; flex-direction: column; gap: 2px; }

.recent-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  text-align: left;
  color: var(--ink-dim);
  font-size: 13px;
}

.recent-item:hover,
.recent-item.is-on { background: rgba(255, 255, 255, 0.07); color: var(--ink); }

.recent-item .starlet { color: var(--red); }
.recent-item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- 14. FOUNDER STUDIO + USER STYLE ---------- */
.area {
  width: 100%;
  min-height: 72px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.35);
  color: var(--ink);
  resize: vertical;
  outline: none;
}

.area:focus { border-color: var(--line-3); }

.field-hint {
  display: block;
  margin-top: 6px;
  font-size: 11.5px;
  color: var(--ink-mute);
  line-height: 1.4;
}

.founder-open {
  width: 100%;
  height: 42px;
  margin: 4px 0 8px;
  border-radius: 12px;
  border: 1px solid rgba(230, 57, 70, 0.45);
  background: var(--red-soft);
  color: #fff;
  letter-spacing: 0.08em;
  font-size: 12.5px;
  text-transform: uppercase;
}

.founder-open:hover { background: rgba(230, 57, 70, 0.28); }

.founder-modal { width: min(520px, 100%); }

.train-log {
  max-height: 220px;
  overflow: auto;
  margin: 0 0 12px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.25);
}

.train-empty {
  padding: 16px 8px;
  color: var(--ink-mute);
  font-size: 13px;
  text-align: center;
}

.train-item {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 8px;
  border-radius: 8px;
  margin-bottom: 6px;
  background: rgba(255, 255, 255, 0.03);
  font-size: 13.5px;
  line-height: 1.45;
}

.train-item button {
  flex: 0 0 auto;
  color: var(--ink-mute);
  font-size: 11px;
  padding: 2px 6px;
}

.train-form {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 56px;
  transform: translateX(-50%);
  z-index: 80;
  padding: 8px 14px;
  border-radius: 999px;
  background: #161616;
  border: 1px solid var(--line-2);
  font-size: 12.5px;
  color: var(--ink);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s;
}

.toast.is-on { opacity: 1; }

/* ---------- 15. M4 VOICE DOCK ---------- */
.voice-dock {
  padding: 8px 12px 4px;
  border-top: 1px solid var(--line);
}

.voice-dock[hidden] { display: none !important; }

.wave {
  display: block;
  width: 100%;
  height: 44px;
}

.voice-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  font-size: 12px;
  color: var(--ink-dim);
}

.voice-pip {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--red);
  animation: livePulse 1.4s ease-out infinite;
}

.hangup-btn {
  margin-left: auto;
  height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(230, 57, 70, 0.45);
  color: #f0a0a6;
  font-size: 11.5px;
}

.hangup-btn:hover { background: var(--red-soft); }

body[data-mode="call"] .hangup-btn { display: inline-flex; align-items: center; }
body:not([data-mode="call"]) .hangup-btn { display: none; }

.chat.is-hidden .voice-dock { display: none !important; }

.act-btn.is-speak { color: var(--red); }

/* ---------- 16. ACTIVE MODE FLAG (under + and ⋮) ---------- */
.head-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex: 0 0 auto;
}

.head-tools {
  display: flex;
  align-items: center;
  gap: 2px;
}

.mode-flag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 22px;
  padding: 0 8px 0 7px;
  border-radius: 999px;
  border: 1px solid rgba(230, 57, 70, 0.4);
  background: var(--red-soft);
  color: #fff;
  font-size: 10.5px;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.mode-flag i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 0 0 var(--red-glow);
  animation: livePulse 1.6s ease-out infinite;
}

.mode-flag b {
  font-weight: 500;
}

.head-mode { display: none !important; }

/* ---------- 17. M5 IMAGE / FILMSTRIP ---------- */
.gen-one, .filmstrip {
  margin: 0.4em 0 1em;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #0b0b0b;
}

.gen-img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 420px;
  object-fit: cover;
  background: #111;
}

.gen-fig { margin: 0; }

.filmstrip {
  position: relative;
  min-height: 180px;
}

.filmstrip .gen-fig {
  display: none;
}

.filmstrip .gen-fig.is-on {
  display: block;
}

.filmstrip::after { display: none; }

.gen-badges {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 6;
  display: flex;
  gap: 6px;
  pointer-events: none;
}
.gen-one, .clip-stage { position: relative; }
.gen-badges em,
.gen-badges b {
  font-family: var(--font-dot);
  font-size: 9px;
  letter-spacing: 0.22em;
  color: #fff;
  background: rgba(230, 57, 70, 0.78);
  padding: 3px 8px;
  border-radius: 999px;
  font-style: normal;
  font-weight: 500;
}
.gen-badges b {
  background: rgba(10, 10, 10, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.18);
}
.gen-wait b {
  font-family: var(--font-dot);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 13px;
}
.gen-wait span {
  font-family: var(--font-dot);
  letter-spacing: 0.2em;
  text-transform: uppercase;
}
.dl-ico {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--line-2);
  background: rgba(10, 10, 10, 0.78);
  color: #fff;
  display: grid;
  place-items: center;
}
.dl-ico:hover {
  border-color: var(--red);
  background: var(--red-soft);
}
.dl-all { display: none !important; }

.gen-fig {
  position: relative;
  min-height: 220px;
  background: #111;
}

.gen-img {
  min-height: 180px;
  background: #111;
}

.gen-wait {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #111;
  color: #f4f4f4;
  text-align: center;
  padding: 16px;
}

.gen-fig.is-ok .gen-wait { display: none; }

.gen-wait i {
  width: 22px;
  height: 22px;
  border: 2px solid rgba(255, 255, 255, 0.16);
  border-top-color: var(--red);
  border-radius: 50%;
  animation: spinWait 0.75s linear infinite;
}

@keyframes spinWait {
  to { transform: rotate(360deg); }
}

.gen-wait b {
  font-size: 13.5px;
  font-weight: 550;
}

.gen-wait span {
  font-size: 11.5px;
  color: var(--ink-dim);
}

.gen-fig.is-err .gen-wait i { display: none; }

.retry-btn,
.dl-btn,
.dl-all {
  height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: rgba(10, 10, 10, 0.78);
  color: #fff;
  font-size: 12px;
}

.retry-btn { margin-top: 6px; }

.dl-btn { display: none !important; }

.dl-btn:hover,
.dl-all:hover,
.retry-btn:hover {
  border-color: var(--red);
  background: var(--red-soft);
}

.gen-toolbar {
  display: flex;
  justify-content: flex-end;
  margin: -4px 0 10px;
}

.net-banner {
  margin: 0 10px 8px;
  padding: 9px 12px;
  border-radius: 12px;
  border: 1px solid rgba(230, 57, 70, 0.45);
  background: var(--red-soft);
  color: #fff;
  font-size: 12.5px;
  line-height: 1.45;
}

.net-banner.is-loud {
  padding: 12px 14px;
  font-size: 13.5px;
  background: #e63946;
  border-color: #ff7a84;
}

.net-banner[hidden] { display: none !important; }

.net-banner em {
  font-style: normal;
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.45);
}

.chat.is-hidden .net-banner { display: none !important; }

/* ---------- 18. WEBSITE LANDING ---------- */
body.site {
  overflow: auto;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.site-head { flex: 0 0 auto; }

.site-main {
  position: relative;
  z-index: 5;
  flex: 1;
  padding: 28px 18px 40px;
  max-width: 880px;
  margin: 0 auto;
  width: 100%;
}

.site-hero {
  text-align: center;
  padding: 36px 8px 28px;
}

.site-hero h1 {
  margin: 18px 0 8px;
  font-family: var(--font-dot);
  font-weight: 500;
  letter-spacing: 0.34em;
  font-size: clamp(22px, 6vw, 36px);
}

.site-lead {
  margin: 0;
  font-size: 16px;
  letter-spacing: 0.08em;
  color: var(--ink);
}

.site-hi {
  margin: 8px 0 22px;
  color: var(--ink-dim);
  font-size: 14px;
}

.site-cta {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.site-go {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 42px;
  padding: 0 22px;
  text-decoration: none;
  border-radius: 999px;
}

.site-cta .btn-ghost {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.site-by {
  margin: 22px 0 0;
  color: var(--ink-mute);
  font-size: 13px;
}

.site-feats h2 {
  margin: 10px 0 14px;
  font-family: var(--font-dot);
  font-size: 13px;
  letter-spacing: 0.32em;
  font-weight: 500;
  text-align: center;
}

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

.site-grid article {
  padding: 14px 14px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
}

.site-grid b {
  display: block;
  margin-bottom: 6px;
  font-weight: 550;
}

.site-grid span {
  color: var(--ink-dim);
  font-size: 13px;
  line-height: 1.45;
}

.header-cluster .pill-btn {
  text-decoration: none;
  height: 30px;
  padding: 0 12px;
  font-size: 12px;
}

@media (max-width: 560px) {
  .site-grid { grid-template-columns: 1fr; }
}

/* ---------- 20. ATTACH FILES ---------- */
.attach-btn {
  position: relative;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--line-2);
  background: rgba(255, 255, 255, 0.03);
  color: var(--ink);
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  cursor: pointer;
}

.send-wide {
  display: block;
  width: calc(100% - 20px);
  margin: 0 10px 8px;
  height: 44px;
  border-radius: 12px;
  background: #e63946;
  color: #fff;
  font-size: 15px;
  letter-spacing: 0.04em;
  border: 0;
  z-index: 8;
  position: relative;
}
.chat.is-hidden .send-wide { display: none; }

.attach-btn:hover {
  border-color: var(--red);
  color: #fff;
}

.attach-tray {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 10px 8px;
}

.attach-tray[hidden] { display: none !important; }

.att-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 8px 0 4px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: rgba(255, 255, 255, 0.05);
  color: var(--ink);
  font-size: 11.5px;
  max-width: 46%;
}

.att-chip img,
.att-chip b {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--red-soft);
  display: grid;
  place-items: center;
  font-size: 10px;
}

.att-chip span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.att-chip i {
  font-style: normal;
  color: var(--ink-mute);
}

.up-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.up-fig {
  margin: 0;
  width: 72px;
  height: 72px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
}

.up-fig img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.up-chip {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  font-size: 11.5px;
}

@media (max-width: 560px) {
  .attach-btn {
    width: 40px;
    height: 40px;
  }
}

/* ---------- 19. MOBILE POLISH ---------- */
@media (max-width: 560px) {
  :root {
    --header-h: 52px;
    --ticker-h: 26px;
  }

  html, body {
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  }

  .header {
    padding: 0 10px;
    gap: 8px;
  }

  .wm-box {
    font-size: 13px;
    padding: 5px 8px 4px 9px;
  }

  .workspace {
    padding: 6px 6px 4px;
  }

  .scene {
    inset: 6px 6px 4px;
    border-radius: 16px;
  }

  .scene-sign {
    gap: 2px;
  }

  .scene-sign span {
    min-width: 14px;
    height: 22px;
    font-size: 11px;
    padding: 0 2px;
  }

  .chat {
    left: 6px;
    right: 6px;
    bottom: 4px;
    border-radius: 18px 18px 14px 14px;
  }

  .chat.is-half {
    height: min(58dvh, 560px);
  }

  .chat-title {
    max-width: 38vw;
    font-size: 13px;
  }

  .head-ico {
    width: 34px;
    height: 34px;
  }

  .mode-flag {
    height: 20px;
    font-size: 10px;
    padding: 0 7px 0 6px;
  }

  .messages {
    padding: 10px 10px 14px;
    gap: 10px;
  }

  .msg {
    max-width: 92%;
    font-size: 14.5px;
  }

  .msg-ai .md {
    font-size: 14.5px;
  }

  .chips {
    padding: 0 10px 8px;
    gap: 6px;
  }

  .chip {
    height: 26px;
    padding: 0 10px;
    font-size: 11.5px;
  }

  .composer {
    gap: 5px;
    padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
  }

  .hub-trigger,
  .send-btn,
  .mic-btn {
    width: 40px;
    height: 40px;
  }

  .model-chip {
    height: 40px;
    padding: 0 8px;
    max-width: 52px;
  }

  .model-chip .model-name,
  .model-chip svg {
    display: none;
  }

  .field {
    height: 40px;
    padding: 0 12px;
    font-size: 16px; /* iOS zoom band */
  }

  .modal-back {
    padding: 12px;
    align-items: flex-end;
  }

  .modal {
    width: 100%;
    max-height: 88dvh;
    overflow: auto;
    border-radius: 18px 18px 14px 14px;
    padding: 18px 16px 16px;
  }

  .hub {
    padding: 12px;
    align-items: end;
  }

  .hub-panel {
    width: 100%;
    padding: 16px 14px 14px;
  }

  .hub-item {
    min-height: 72px;
  }

  .ticker-item {
    letter-spacing: 0.14em;
    font-size: 10px;
  }
}


/* ----- sticky modal close + home gate + attach ----- */
.modal {
  display: flex;
  flex-direction: column;
  max-height: min(88dvh, 720px);
  overflow: hidden;
}
.modal-scroll {
  overflow: auto;
  flex: 1;
  min-height: 0;
  padding-bottom: 8px;
}
.modal-actions.is-sticky {
  position: sticky;
  bottom: 0;
  margin-top: 8px;
  padding-top: 10px;
  background: var(--glass-2);
  z-index: 2;
}

.attach-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--line-2);
  background: rgba(255,255,255,0.03);
  color: var(--ink);
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}
.attach-btn:hover { border-color: var(--red); }
.attach-pop {
  display: flex;
  gap: 8px;
  padding: 0 10px 8px;
}
.attach-pop[hidden] { display: none !important; }
.attach-pop button {
  height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: #161616;
  color: #fff;
  font-size: 13px;
}
.attach-tray {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 10px 8px;
}
.attach-tray[hidden] { display: none !important; }
.att-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 8px 0 4px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: rgba(255,255,255,0.05);
  color: var(--ink);
  font-size: 11.5px;
  max-width: 48%;
}
.att-chip img, .att-chip b {
  width: 20px; height: 20px; border-radius: 50%;
  object-fit: cover; background: var(--red-soft);
  display: grid; place-items: center; font-size: 10px;
}
.att-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.up-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.up-fig { margin: 0; width: 72px; height: 72px; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); }
.up-fig img { width: 100%; height: 100%; object-fit: cover; }
.up-chip { display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: 999px; background: rgba(255,255,255,0.08); font-size: 11.5px; }

.home-gate {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: end center;
  padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
  background: rgba(4,4,4,0.72);
  backdrop-filter: blur(14px);
}
.home-gate[hidden] { display: none !important; }
.home-card {
  width: min(420px, 100%);
  padding: 22px 18px 16px;
  border-radius: 22px;
  border: 1px solid var(--line-2);
  background: #121212;
  box-shadow: var(--shadow-lg);
}
.home-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.home-brand strong { font-family: var(--font-dot); letter-spacing: 0.22em; }
.home-lead { margin: 0 0 14px; color: var(--ink-dim); font-size: 14px; }
.home-tabs { display: flex; gap: 6px; margin-bottom: 14px; }
.home-tab {
  flex: 1;
  height: 34px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--ink-dim);
  font-size: 12.5px;
}
.home-tab.is-on { background: var(--red); border-color: var(--red); color: #fff; }
.home-form { display: none; gap: 7px; }
.home-form.is-on { display: grid; }
.home-form[hidden] { display: none !important; }
.home-card { max-height: min(88dvh, 640px); overflow: auto; }
.home-form label { font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-mute); }
.home-form input {
  height: 42px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #0b0b0b;
}
.home-go { margin-top: 8px; height: 42px; border-radius: 999px; }
.live-open {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(230, 57, 70, 0.45);
  background: var(--red-soft);
  color: #fff;
  text-decoration: none;
  font-size: 11px;
  letter-spacing: 0.08em;
}
.live-open.home-live {
  display: flex;
  width: 100%;
  height: 42px;
  margin-top: 10px;
  font-size: 13px;
}
.home-skip {
  display: block;
  width: 100%;
  margin-top: 12px;
  height: 40px;
  color: var(--ink-dim);
  font-size: 13px;
}
.home-note { margin: 6px 0 0; font-size: 12px; color: var(--ink-mute); line-height: 1.4; }

@media (max-width: 560px) {
  .attach-btn { width: 40px; height: 40px; }
}

.dl-btn { display: none !important; }
.att-spin {
  width: 12px; height: 12px;
  border: 2px solid rgba(255,255,255,.2);
  border-top-color: var(--red);
  border-radius: 50%;
  animation: spinWait .7s linear infinite;
  flex: 0 0 auto;
}
.att-ok { font-style: normal; color: #8fdf9a; font-size: 13px; flex: 0 0 auto; }

.workspace { position: relative; }
.live-stage[hidden] { display: none !important; }
.live-stage {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  background: rgba(8,8,8,.78);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .35s ease;
}
.live-stage.is-open {
  opacity: 1;
  pointer-events: auto;
}
body.live-on .scene { opacity: .15; }
body.live-on .chat { opacity: .2; pointer-events: none; }
.live-x {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.18);
  color: #fff;
  font-size: 24px;
  z-index: 2;
}
.live-orb {
  position: relative;
  width: 180px;
  height: 180px;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.live-orb b {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, #ff8a90, #e63946 52%, #7a121c 100%);
  box-shadow: 0 0 48px rgba(230,57,70,.5);
}
.live-orb i {
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  border: 1.5px solid rgba(230,57,70,.4);
  animation: orbRing 2.4s ease-out infinite;
}
.live-orb i:nth-child(2) { animation-delay: .55s; }
.live-orb i:nth-child(3) { animation-delay: 1.1s; }
.live-orb[data-mode="listen"] b { animation: orbPulse 1.1s ease-in-out infinite; }
.live-orb[data-mode="speak"] b { animation: orbSpeak .65s ease-in-out infinite; }
.live-orb[data-mode="idle"] i { animation-play-state: paused; opacity: .35; }
@keyframes orbRing {
  from { transform: scale(.5); opacity: .75; }
  to { transform: scale(1.2); opacity: 0; }
}
@keyframes orbPulse {
  0%,100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}
@keyframes orbSpeak {
  0%,100% { transform: scale(1); box-shadow: 0 0 28px rgba(230,57,70,.4); }
  50% { transform: scale(1.14); box-shadow: 0 0 64px rgba(230,57,70,.75); }
}
.live-cap {
  position: absolute;
  bottom: 16%;
  left: 0; right: 0;
  text-align: center;
  margin: 0;
  color: #cfcfcf;
  letter-spacing: .06em;
  font-size: 14px;
}

.clip-box { margin: 0.4em 0 1em; }
.clip-stage {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #0b0b0b;
  min-height: 180px;
}
.clip-vid,
.clip-canvas {
  display: block;
  width: 100%;
  max-height: 420px;
  background: #000;
}
.clip-canvas { height: auto; aspect-ratio: 16 / 9; }
.clip-box.is-ready .clip-strip,
.clip-box.is-ready .clip-wait { display: none !important; }
.clip-box .clip-wait {
  position: absolute;
  inset: 0;
  z-index: 3;
}

.chips, #chips { display: none !important; }

.clip-vid:not([src]), .clip-vid[src=''] { display: none !important; }
.clip-box.is-ready .clip-canvas { display: block; }
