/* =================================================================
   Umom · AI Gateway — "Umom Arcade" maximalist theme
   Display: Unbounded · Body: Manrope · Mono: JetBrains Mono
   ================================================================= */

:root {
  /* Surfaces */
  --void:      #07060d;
  --void-2:    #0b0916;
  --panel:     rgba(255, 255, 255, 0.035);
  --panel-2:   rgba(255, 255, 255, 0.06);
  --panel-3:   rgba(255, 255, 255, 0.09);
  --stroke:    rgba(255, 255, 255, 0.10);
  --stroke-2:  rgba(255, 255, 255, 0.16);

  /* Ink */
  --text:      #f6f3ff;
  --muted:     #9d98bb;
  --faint:     #6b6688;

  /* Umom accents */
  --lime:      #c6ff3a;
  --cyan:      #2ee6ff;
  --magenta:   #ff2e9a;
  --violet:    #8b5cff;
  --grad:      linear-gradient(110deg, var(--lime), var(--cyan) 45%, var(--magenta));
  --grad-soft: linear-gradient(110deg, rgba(198,255,58,.18), rgba(46,230,255,.18) 50%, rgba(255,46,154,.18));

  /* Geometry */
  --r-sm: 10px;
  --r:    16px;
  --r-lg: 22px;
  --r-xl: 30px;

  --sidebar-w: 290px;
  --maxw: 880px;

  --shadow:   0 24px 60px -20px rgba(0,0,0,.7);
  --glow-lime:    0 0 0 1px rgba(198,255,58,.5), 0 10px 40px -8px rgba(198,255,58,.45);
  --glow-magenta: 0 0 0 1px rgba(255,46,154,.5), 0 10px 40px -8px rgba(255,46,154,.45);

  --ease: cubic-bezier(.22, 1, .36, 1);
  color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

/* Ensure the [hidden] attribute always wins over display:flex/grid class rules */
[hidden] { display: none !important; }

html, body { height: 100%; }

body {
  font-family: "Manrope", system-ui, sans-serif;
  background: var(--void);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow: hidden;
  letter-spacing: -0.01em;
}

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

button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; }

/* =================================================================
   ATMOSPHERE
   ================================================================= */
.bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; background: var(--void); }

.bg__grid {
  position: absolute; inset: -2px;
  background-image:
    linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(ellipse 90% 80% at 50% 30%, #000 30%, transparent 75%);
}

.bg__aurora { position: absolute; inset: 0; filter: blur(70px) saturate(1.3); }
.blob { position: absolute; width: 46vw; height: 46vw; border-radius: 50%; opacity: .55; mix-blend-mode: screen; }
.blob--lime    { background: radial-gradient(circle, var(--lime),    transparent 62%); top: -12%; left: -8%;  animation: drift1 19s var(--ease) infinite; }
.blob--cyan    { background: radial-gradient(circle, var(--cyan),    transparent 62%); top: 18%;  right: -12%; animation: drift2 23s var(--ease) infinite; }
.blob--magenta { background: radial-gradient(circle, var(--magenta), transparent 62%); bottom: -18%; left: 22%; animation: drift3 27s var(--ease) infinite; }
.blob--violet  { background: radial-gradient(circle, var(--violet),  transparent 64%); bottom: 4%;  right: 26%; opacity: .4; animation: drift1 31s var(--ease) infinite reverse; }

@keyframes drift1 { 50% { transform: translate(8vw, 6vh) scale(1.12); } }
@keyframes drift2 { 50% { transform: translate(-7vw, 5vh) scale(1.08); } }
@keyframes drift3 { 50% { transform: translate(5vw, -7vh) scale(1.15); } }

.bg__grain {
  position: absolute; inset: 0; opacity: .055; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.bg__vignette { position: absolute; inset: 0; background: radial-gradient(ellipse 80% 70% at 50% 50%, transparent 55%, rgba(0,0,0,.55)); }

/* =================================================================
   APP SHELL
   ================================================================= */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  height: 100vh;
  height: 100dvh;
}

/* =================================================================
   SIDEBAR
   ================================================================= */
.sidebar {
  display: flex; flex-direction: column;
  gap: 14px;
  padding: 18px 14px;
  border-right: 1px solid var(--stroke);
  background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.01));
  backdrop-filter: blur(14px);
  min-height: 0;
}

.brand { display: flex; align-items: center; gap: 11px; padding: 4px 6px 6px; }
.brand__mark { display: grid; place-items: center; filter: drop-shadow(0 0 12px rgba(46,230,255,.35)); animation: spinmark 14s linear infinite; }
@keyframes spinmark { to { transform: rotate(360deg); } }
.brand__word {
  font-family: "Unbounded", sans-serif; font-weight: 800; font-size: 22px;
  letter-spacing: .02em;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.sidebar__collapse { margin-left: auto; color: var(--muted); display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; transition: .2s; }
.sidebar__collapse:hover { color: var(--text); background: var(--panel-2); }

/* New chat */
.newchat {
  position: relative; display: flex; align-items: center; gap: 10px;
  padding: 13px 14px; border-radius: var(--r);
  font-weight: 700; color: #07060d;
  background: var(--grad); background-size: 180% 180%;
  box-shadow: 0 10px 30px -10px rgba(46,230,255,.55);
  transition: transform .2s var(--ease), box-shadow .2s, background-position .6s;
  overflow: hidden;
}
.newchat:hover { transform: translateY(-2px); background-position: 100% 0; box-shadow: 0 16px 40px -10px rgba(255,46,154,.6); }
.newchat:active { transform: translateY(0); }
.newchat kbd {
  margin-left: auto; font-family: "JetBrains Mono", monospace; font-size: 11px;
  background: rgba(7,6,13,.22); padding: 2px 7px; border-radius: 7px; font-weight: 700;
}

/* Search */
.search {
  display: flex; align-items: center; gap: 9px;
  padding: 10px 12px; border-radius: var(--r-sm);
  background: var(--panel); border: 1px solid var(--stroke); color: var(--muted);
  transition: .2s;
}
.search:focus-within { border-color: var(--stroke-2); background: var(--panel-2); }
.search input { flex: 1; background: none; border: none; outline: none; color: var(--text); font-size: 14px; }
.search input::placeholder { color: var(--faint); }

/* History */
.history { flex: 1; overflow-y: auto; min-height: 0; margin: 2px -4px; padding: 0 4px; display: flex; flex-direction: column; gap: 3px; }
.history::-webkit-scrollbar { width: 8px; }
.history::-webkit-scrollbar-thumb { background: var(--panel-3); border-radius: 8px; border: 2px solid transparent; background-clip: padding-box; }
.history::-webkit-scrollbar-thumb:hover { background: var(--stroke-2); background-clip: padding-box; }

.history__group { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); padding: 14px 10px 6px; }

.histitem {
  display: flex; align-items: center; gap: 10px;
  width: 100%; text-align: left;
  padding: 9px 11px; border-radius: var(--r-sm);
  color: var(--muted); font-size: 13.5px; font-weight: 500;
  border: 1px solid transparent;
  transition: .16s var(--ease);
  position: relative;
}
.histitem:hover { background: var(--panel-2); color: var(--text); }
.histitem.is-active { background: var(--panel-2); color: var(--text); border-color: var(--stroke); }
.histitem.is-active::before { content: ""; position: absolute; left: 0; top: 18%; bottom: 18%; width: 3px; border-radius: 3px; background: var(--grad); }
.histitem__dot { width: 7px; height: 7px; border-radius: 50%; flex: none; opacity: .8; }
.histitem__t { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Sidebar footer */
.sidebar__foot { display: flex; flex-direction: column; gap: 10px; }

.balance {
  padding: 13px 14px; border-radius: var(--r);
  background: var(--panel-2); border: 1px solid var(--stroke);
  position: relative; overflow: hidden;
}
.balance::after { content: ""; position: absolute; inset: 0; background: var(--grad-soft); opacity: .5; pointer-events: none; }
.balance__top { display: flex; align-items: center; justify-content: space-between; position: relative; }
.balance__label { font-size: 12px; color: var(--muted); font-weight: 600; }
.balance__topup { font-size: 12px; font-weight: 800; color: var(--lime); transition: .15s; }
.balance__topup:hover { filter: brightness(1.2); text-shadow: 0 0 12px rgba(198,255,58,.5); }
.balance__amount { font-family: "Unbounded", sans-serif; font-size: 21px; font-weight: 700; margin: 6px 0 9px; position: relative; }
.balance__amount span { font-family: "Manrope"; font-size: 12px; color: var(--muted); font-weight: 600; }
.balance__bar { height: 6px; border-radius: 6px; background: rgba(255,255,255,.08); overflow: hidden; position: relative; }
.balance__bar i { display: block; height: 100%; border-radius: 6px; background: var(--grad); transition: width .5s var(--ease); }

.user {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 10px; border-radius: var(--r);
  border: 1px solid var(--stroke); background: var(--panel);
  transition: .18s;
}
.user:hover { background: var(--panel-2); border-color: var(--stroke-2); }
.user__avatar {
  width: 34px; height: 34px; border-radius: 10px; flex: none;
  display: grid; place-items: center; font-weight: 800; font-size: 13px; color: #07060d;
  background: var(--grad); font-family: "JetBrains Mono", monospace;
}
.user__meta { display: flex; flex-direction: column; line-height: 1.25; text-align: left; flex: 1; min-width: 0; }
.user__meta b { font-size: 13.5px; }
.user__meta small { font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user svg { color: var(--faint); }

/* =================================================================
   MAIN
   ================================================================= */
.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; position: relative; }

/* Top bar */
.topbar {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--stroke);
  background: linear-gradient(180deg, rgba(11,9,22,.6), rgba(11,9,22,.2));
  backdrop-filter: blur(16px);
  position: relative; z-index: 40;
}
.topbar__spacer { flex: 1; }
.topbar__menu { display: none; }

.iconbtn { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; color: var(--muted); border: 1px solid transparent; transition: .18s; }
.iconbtn:hover { color: var(--text); background: var(--panel-2); border-color: var(--stroke); }

/* Model picker */
.modelpicker { position: relative; }
.modelpicker__btn {
  display: flex; align-items: center; gap: 11px;
  padding: 7px 13px 7px 8px; border-radius: 13px;
  background: var(--panel-2); border: 1px solid var(--stroke);
  transition: .18s var(--ease);
}
.modelpicker__btn:hover { border-color: var(--stroke-2); background: var(--panel-3); transform: translateY(-1px); }
.modelpicker__btn[aria-expanded="true"] { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(46,230,255,.14); }
.modelpicker__glyph, .chip__glyph, .msg__glyph {
  width: 30px; height: 30px; border-radius: 9px; flex: none;
  display: grid; place-items: center; font-weight: 800; font-size: 14px; color: #07060d;
  font-family: "Unbounded", sans-serif;
  background: var(--grad);
}
.modelpicker__name { display: flex; flex-direction: column; line-height: 1.2; text-align: left; }
.modelpicker__name b { font-size: 14px; font-weight: 700; }
.modelpicker__name small { font-size: 11px; color: var(--muted); }
.modelpicker__chev { color: var(--muted); transition: transform .25s var(--ease); }
.modelpicker__btn[aria-expanded="true"] .modelpicker__chev { transform: rotate(180deg); }

/* Model menu */
.modelmenu {
  position: absolute; top: calc(100% + 10px); left: 0;
  width: 380px; max-height: 70vh; overflow: hidden;
  border-radius: var(--r-lg);
  background: rgba(13,11,24,.92); backdrop-filter: blur(24px);
  border: 1px solid var(--stroke-2);
  box-shadow: var(--shadow);
  display: flex; flex-direction: column;
  transform-origin: top left;
  animation: pop .26s var(--ease);
  z-index: 60;
}
@keyframes pop { from { opacity: 0; transform: scale(.96) translateY(-6px); } }
.modelmenu__head { display: flex; align-items: baseline; justify-content: space-between; padding: 15px 18px 10px; font-weight: 800; font-size: 13px; letter-spacing: .04em; text-transform: uppercase; }
.modelmenu__hint { font-size: 10px; color: var(--faint); font-weight: 600; }
.modelmenu__list { overflow-y: auto; padding: 4px 8px 8px; display: flex; flex-direction: column; gap: 2px; }
.modelmenu__list::-webkit-scrollbar { width: 8px; }
.modelmenu__list::-webkit-scrollbar-thumb { background: var(--panel-3); border-radius: 8px; }
.modelmenu__foot { padding: 10px 18px; border-top: 1px solid var(--stroke); font-size: 11px; color: var(--faint); }

.modelopt {
  display: flex; align-items: center; gap: 12px;
  width: 100%; text-align: left; padding: 10px 12px; border-radius: 13px;
  border: 1px solid transparent; transition: .14s;
}
.modelopt:hover { background: var(--panel-2); }
.modelopt.is-active { background: var(--panel-2); border-color: var(--stroke-2); }
.modelopt__glyph { width: 32px; height: 32px; border-radius: 9px; flex: none; display: grid; place-items: center; font-weight: 800; color: #07060d; font-family: "Unbounded"; font-size: 14px; }
.modelopt__main { flex: 1; min-width: 0; }
.modelopt__name { font-weight: 700; font-size: 14px; display: flex; align-items: center; gap: 7px; }
.modelopt__name small { font-weight: 500; color: var(--muted); font-size: 12px; }
.modelopt__tag { font-size: 9.5px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; padding: 2px 6px; border-radius: 6px; }
.tag-flagship { background: rgba(198,255,58,.16); color: var(--lime); }
.tag-fast     { background: rgba(46,230,255,.16); color: var(--cyan); }
.tag-cheap    { background: rgba(139,92,255,.18); color: #b39cff; }
.tag-new      { background: rgba(255,46,154,.16); color: var(--magenta); }
.modelopt__price { font-family: "JetBrains Mono", monospace; font-size: 13px; font-weight: 500; color: var(--text); }
.modelopt__price small { color: var(--faint); font-size: 10px; }
.modelopt__check { color: var(--lime); opacity: 0; }
.modelopt.is-active .modelopt__check { opacity: 1; }

/* Pill */
.pill {
  display: flex; align-items: center; gap: 7px;
  padding: 8px 13px; border-radius: 999px;
  background: var(--panel-2); border: 1px solid var(--stroke);
  font-size: 13px; color: var(--muted); font-weight: 600;
}
.pill b { color: var(--text); font-family: "JetBrains Mono", monospace; }
.pill__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 10px var(--lime); animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .4; } }
.pill.is-low .pill__dot { background: var(--magenta); box-shadow: 0 0 10px var(--magenta); }

/* Language toggle */
.langtoggle { display: flex; padding: 3px; gap: 2px; border-radius: 999px; background: var(--panel); border: 1px solid var(--stroke); position: relative; }
.langtoggle button { padding: 6px 12px; border-radius: 999px; font-size: 12px; font-weight: 800; color: var(--muted); letter-spacing: .03em; transition: color .2s; position: relative; z-index: 2; }
.langtoggle button.is-active { color: #07060d; }
.langtoggle__thumb { position: absolute; top: 3px; bottom: 3px; border-radius: 999px; background: var(--grad); transition: .3s var(--ease); z-index: 1; }

/* =================================================================
   STAGE
   ================================================================= */
.stage { flex: 1; overflow-y: auto; min-height: 0; scroll-behavior: smooth; }
.stage::-webkit-scrollbar { width: 10px; }
.stage::-webkit-scrollbar-thumb { background: var(--panel-3); border-radius: 10px; border: 3px solid transparent; background-clip: padding-box; }

/* HERO / empty state */
.hero { max-width: var(--maxw); margin: 0 auto; padding: clamp(28px, 7vh, 80px) 24px 40px; }
.hero__badge {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 7px 14px; border-radius: 999px; margin-bottom: 26px;
  background: var(--panel-2); border: 1px solid var(--stroke);
  font-size: 12.5px; font-weight: 600; color: var(--muted);
  animation: rise .6s var(--ease) both;
}
.hero__pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 12px var(--cyan); animation: pulse 2s ease-in-out infinite; }

.hero__title {
  font-family: "Unbounded", sans-serif; font-weight: 800;
  font-size: clamp(38px, 6.2vw, 72px); line-height: .98; letter-spacing: -.02em;
  margin-bottom: 22px;
}
.hero__title span { display: block; animation: rise .7s var(--ease) both; }
.hero__title span:nth-child(1) { animation-delay: .05s; }
.hero__title span:nth-child(2) { animation-delay: .14s; }
.hero__title .grad { background: var(--grad); background-size: 200% auto; -webkit-background-clip: text; background-clip: text; color: transparent; animation: rise .7s var(--ease) both, shimmer 6s linear infinite; }
@keyframes shimmer { to { background-position: 200% center; } }

.hero__sub { max-width: 580px; color: var(--muted); font-size: clamp(15px, 1.7vw, 18px); line-height: 1.6; margin-bottom: 40px; animation: rise .7s var(--ease) .22s both; }

@keyframes rise { from { opacity: 0; transform: translateY(18px); } }

/* Suggestion cards */
.suggest { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.scard {
  text-align: left; padding: 18px; border-radius: var(--r-lg);
  background: var(--panel); border: 1px solid var(--stroke);
  display: flex; flex-direction: column; gap: 10px;
  transition: .22s var(--ease); position: relative; overflow: hidden;
  animation: rise .6s var(--ease) both;
}
.scard:nth-child(1) { animation-delay: .30s; }
.scard:nth-child(2) { animation-delay: .37s; }
.scard:nth-child(3) { animation-delay: .44s; }
.scard:nth-child(4) { animation-delay: .51s; }
.scard::before { content: ""; position: absolute; inset: 0; opacity: 0; background: var(--grad-soft); transition: opacity .25s; }
.scard:hover { transform: translateY(-3px); border-color: var(--stroke-2); box-shadow: var(--shadow); }
.scard:hover::before { opacity: 1; }
.scard__icon { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; font-size: 19px; background: var(--panel-3); border: 1px solid var(--stroke); position: relative; }
.scard__t { font-weight: 700; font-size: 15px; position: relative; }
.scard__d { font-size: 13px; color: var(--muted); line-height: 1.5; position: relative; }

/* =================================================================
   THREAD / MESSAGES
   ================================================================= */
.thread { max-width: var(--maxw); margin: 0 auto; padding: 30px 24px 24px; display: flex; flex-direction: column; gap: 26px; }

.msg { display: flex; gap: 14px; animation: rise .4s var(--ease) both; }
.msg__glyph { align-self: flex-start; }
.msg--user .msg__glyph { background: var(--panel-3); color: var(--text); border: 1px solid var(--stroke); font-family: "JetBrains Mono"; font-size: 12px; }
.msg__body { flex: 1; min-width: 0; padding-top: 3px; }
.msg__who { font-size: 12px; font-weight: 800; letter-spacing: .03em; color: var(--muted); margin-bottom: 6px; display: flex; align-items: center; gap: 8px; }
.msg__who small { font-weight: 600; color: var(--faint); letter-spacing: 0; }
.msg__text { font-size: 15.5px; line-height: 1.72; color: #e9e6f7; }
.msg__text p { margin-bottom: 12px; }
.msg__text p:last-child { margin-bottom: 0; }
.msg__text strong { color: #fff; font-weight: 700; }
.msg__text code { font-family: "JetBrains Mono", monospace; font-size: .88em; background: var(--panel-3); padding: 2px 6px; border-radius: 6px; color: var(--lime); }
.msg__text ul { margin: 4px 0 12px; padding-left: 4px; list-style: none; display: flex; flex-direction: column; gap: 7px; }
.msg__text li { position: relative; padding-left: 20px; }
.msg__text li::before { content: ""; position: absolute; left: 2px; top: 9px; width: 7px; height: 7px; border-radius: 2px; background: var(--grad); }
.msg--user .msg__text { color: var(--text); }

/* tiny action row under assistant msgs */
.msg__acts { display: flex; gap: 4px; margin-top: 12px; opacity: 0; transition: opacity .2s; }
.msg:hover .msg__acts { opacity: 1; }
.msg__act { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; color: var(--faint); transition: .15s; }
.msg__act:hover { color: var(--text); background: var(--panel-2); }

/* typing dots */
.typing { display: inline-flex; gap: 5px; padding: 4px 0; }
.typing span { width: 8px; height: 8px; border-radius: 50%; background: var(--grad); animation: bounce 1.2s ease-in-out infinite; }
.typing span:nth-child(2) { animation-delay: .15s; }
.typing span:nth-child(3) { animation-delay: .3s; }
@keyframes bounce { 0%, 60%, 100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-7px); opacity: 1; } }

.caret::after { content: "▍"; color: var(--cyan); animation: blink 1s steps(2) infinite; margin-left: 1px; }
@keyframes blink { 50% { opacity: 0; } }

/* =================================================================
   COMPOSER
   ================================================================= */
.composer { padding: 12px 24px 18px; max-width: calc(var(--maxw) + 48px); width: 100%; margin: 0 auto; }
.composer__card {
  border-radius: var(--r-xl);
  background: rgba(13,11,24,.72); backdrop-filter: blur(20px);
  border: 1px solid var(--stroke-2);
  padding: 14px 14px 12px;
  box-shadow: var(--shadow);
  transition: border-color .2s, box-shadow .2s;
}
.composer__card:focus-within { border-color: rgba(46,230,255,.5); box-shadow: 0 0 0 4px rgba(46,230,255,.10), var(--shadow); }
.composer textarea {
  width: 100%; border: none; outline: none; background: none; resize: none;
  font-size: 16px; line-height: 1.55; color: var(--text); max-height: 200px; padding: 4px 6px;
}
.composer textarea::placeholder { color: var(--faint); }

.composer__bar { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.composer__tools { display: flex; gap: 7px; flex: 1; min-width: 0; }
.composer__right { display: flex; align-items: center; gap: 12px; }

.chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 12px; border-radius: 11px;
  background: var(--panel); border: 1px solid var(--stroke);
  color: var(--muted); font-size: 13px; font-weight: 600; transition: .16s;
}
.chip:hover { color: var(--text); background: var(--panel-2); border-color: var(--stroke-2); }
.chip--ghost { background: transparent; }
.chip__glyph { width: 20px; height: 20px; border-radius: 6px; font-size: 11px; }

.cost { font-size: 12.5px; color: var(--muted); font-weight: 600; white-space: nowrap; }
.cost b { color: var(--lime); font-family: "JetBrains Mono", monospace; }

.send {
  width: 44px; height: 44px; border-radius: 14px; flex: none;
  display: grid; place-items: center; color: #07060d;
  background: var(--grad); background-size: 160% 160%;
  box-shadow: 0 8px 24px -8px rgba(46,230,255,.6);
  transition: transform .18s var(--ease), box-shadow .2s, background-position .5s, filter .2s;
}
.send:hover { transform: translateY(-2px) scale(1.04); background-position: 100% 0; box-shadow: 0 14px 34px -8px rgba(255,46,154,.7); }
.send:active { transform: scale(.96); }
.send:disabled { filter: grayscale(.7) brightness(.6); cursor: not-allowed; transform: none; box-shadow: none; }

.composer__legal { text-align: center; font-size: 11.5px; color: var(--faint); margin-top: 11px; }

/* =================================================================
   TOAST
   ================================================================= */
.toast {
  position: fixed; bottom: 28px; left: 50%; transform: translate(-50%, 30px);
  padding: 12px 20px; border-radius: 14px;
  background: rgba(13,11,24,.95); backdrop-filter: blur(20px);
  border: 1px solid var(--stroke-2); box-shadow: var(--shadow);
  font-size: 13.5px; font-weight: 600; color: var(--text);
  opacity: 0; pointer-events: none; transition: .3s var(--ease); z-index: 100;
  display: flex; align-items: center; gap: 9px;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 10px var(--lime); }

/* =================================================================
   RESPONSIVE
   ================================================================= */
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; inset: 0 auto 0 0; width: min(86vw, 320px); z-index: 80;
    transform: translateX(-102%); transition: transform .3s var(--ease);
    box-shadow: var(--shadow);
  }
  .sidebar.open { transform: none; }
  .topbar__menu { display: grid; }
  .modelmenu { width: min(92vw, 380px); }
  .scrim { position: fixed; inset: 0; background: rgba(0,0,0,.5); backdrop-filter: blur(2px); z-index: 70; opacity: 0; pointer-events: none; transition: .3s; }
  .scrim.show { opacity: 1; pointer-events: auto; }
}

@media (max-width: 560px) {
  .suggest { grid-template-columns: 1fr; }
  .pill, .modelpicker__name small { display: none; }
  .composer__tools .chip span { display: none; }
  .topbar { padding: 10px 12px; }
  .hero { padding-top: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* =================================================================
   REGISTRATION POPUP — shown only on a gated action
   ================================================================= */
.gate {
  position: fixed; inset: 0; z-index: 95;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  background: radial-gradient(ellipse 80% 70% at 50% 30%, rgba(13,11,24,.72), rgba(7,6,13,.93));
  backdrop-filter: blur(18px) saturate(1.1);
  animation: gatefade .4s var(--ease);
}
@keyframes gatefade { from { opacity: 0; } }

.gate__panel {
  width: 100%; max-width: 440px;
  padding: 30px 30px 26px; border-radius: var(--r-xl);
  background: rgba(13,11,24,.86); backdrop-filter: blur(26px);
  border: 1px solid var(--stroke-2);
  box-shadow: var(--shadow), 0 0 90px -30px rgba(46,230,255,.5);
  position: relative; overflow: hidden;
  animation: gatepop .5s var(--ease) both;
}
.gate__panel::before { content: ""; position: absolute; inset: 0; background: var(--grad-soft); opacity: .32; pointer-events: none; }
@keyframes gatepop { from { opacity: 0; transform: translateY(22px) scale(.97); } }

.gate__close { position: absolute; top: 14px; right: 14px; z-index: 2; width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; color: var(--muted); transition: .16s; }
.gate__close:hover { color: var(--text); background: var(--panel-2); }

.gate__brand { display: flex; align-items: center; gap: 11px; margin-bottom: 22px; position: relative; }
.gate__brand .brand__word { font-size: 24px; }

.gate__step { display: flex; flex-direction: column; position: relative; }

.gate__badge {
  display: inline-flex; align-items: center; gap: 8px; align-self: flex-start;
  padding: 6px 12px; border-radius: 999px; margin-bottom: 18px;
  background: var(--panel-2); border: 1px solid var(--stroke);
  font-size: 12px; font-weight: 600; color: var(--muted);
}
.gate__title {
  font-family: "Unbounded", sans-serif; font-weight: 800;
  font-size: clamp(26px, 4.4vw, 33px); line-height: 1.05; letter-spacing: -.02em;
  margin-bottom: 12px;
}
.gate__title .grad { background: var(--grad); background-size: 200% auto; -webkit-background-clip: text; background-clip: text; color: transparent; }
.gate__sub { color: var(--muted); font-size: 14.5px; line-height: 1.6; margin-bottom: 22px; }
.gate__email { color: var(--text); font-weight: 700; font-family: "JetBrains Mono", monospace; font-size: .92em; word-break: break-all; }

.gate__field { display: flex; flex-direction: column; gap: 8px; }
.gate__lbl { font-size: 12px; font-weight: 700; letter-spacing: .03em; color: var(--muted); }
.gate__inputwrap {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 15px; border-radius: var(--r);
  background: var(--panel); border: 1px solid var(--stroke); transition: .18s var(--ease);
}
.gate__inputwrap svg { color: var(--faint); flex: none; }
.gate__inputwrap:focus-within { border-color: rgba(46,230,255,.55); background: var(--panel-2); box-shadow: 0 0 0 4px rgba(46,230,255,.1); }
.gate__inputwrap:focus-within svg { color: var(--cyan); }
.gate__inputwrap input { flex: 1; background: none; border: none; outline: none; color: var(--text); font-size: 15px; }
.gate__inputwrap input::placeholder { color: var(--faint); }
.gate__field.shake { animation: shake .4s var(--ease); }
@keyframes shake { 10%,90% { transform: translateX(-1px); } 20%,80% { transform: translateX(2px); } 30%,50%,70% { transform: translateX(-5px); } 40%,60% { transform: translateX(5px); } }

.gate__err { color: var(--magenta); font-size: 12.5px; font-weight: 600; margin: 10px 2px 0; }

.gate__cta {
  position: relative; display: flex; align-items: center; justify-content: center; gap: 10px;
  margin-top: 18px; padding: 14px 16px; border-radius: var(--r);
  font-weight: 800; font-size: 15px; color: #07060d;
  background: var(--grad); background-size: 180% 180%;
  box-shadow: 0 12px 34px -10px rgba(46,230,255,.55);
  transition: transform .2s var(--ease), box-shadow .2s, background-position .6s, filter .2s;
}
.gate__cta:hover { transform: translateY(-2px); background-position: 100% 0; box-shadow: 0 18px 44px -10px rgba(255,46,154,.6); }
.gate__cta:active { transform: translateY(0); }
.gate__cta:disabled { cursor: default; }
.gate__cta.is-loading { filter: saturate(.85) brightness(.95); }
.gate__cta.is-loading .gate__cta-label { opacity: .85; }
.gate__spin { display: none; width: 17px; height: 17px; border-radius: 50%; border: 2.4px solid rgba(7,6,13,.35); border-top-color: #07060d; animation: spin .7s linear infinite; }
.gate__cta.is-loading .gate__spin { display: block; }
@keyframes spin { to { transform: rotate(360deg); } }

.gate__terms { text-align: center; font-size: 11.5px; color: var(--faint); margin-top: 14px; line-height: 1.5; }

.gate__note {
  display: flex; align-items: flex-start; gap: 9px;
  margin-top: 20px; padding: 11px 13px; border-radius: var(--r-sm);
  background: var(--panel); border: 1px solid var(--stroke);
  font-size: 12px; color: var(--muted); line-height: 1.5;
}
.gate__note svg { color: var(--cyan); flex: none; margin-top: 1px; }

/* success step */
.gate__check {
  width: 64px; height: 64px; border-radius: 50%; margin: 2px 0 20px;
  display: grid; place-items: center; align-self: flex-start;
  background: var(--grad-soft); border: 1px solid var(--stroke-2);
  box-shadow: 0 0 40px -8px rgba(198,255,58,.5);
}
.gate__check svg { width: 34px; height: 34px; }
.gate__check path { stroke: var(--lime); stroke-width: 2.6; fill: none; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 30; stroke-dashoffset: 30; animation: draw .5s var(--ease) .15s forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }

.gate__link { align-self: center; margin-top: 14px; color: var(--muted); font-size: 13px; font-weight: 600; transition: .15s; }
.gate__link:hover { color: var(--text); text-shadow: 0 0 12px rgba(46,230,255,.4); }

@media (max-width: 480px) {
  .gate__panel { padding: 24px 20px 22px; }
}
