/* ================================================================ fonts (Vesper, self-hosted) */
@font-face { font-family: generalSans; src: url("../assets/fonts/GeneralSans-Light.woff2") format("woff2"); font-weight: 300; font-style: normal; font-display: swap; }
@font-face { font-family: generalSans; src: url("../assets/fonts/GeneralSans-Regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: generalSans; src: url("../assets/fonts/GeneralSans-Medium.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: Mulish; font-style: normal; font-weight: 200 900; font-display: swap; src: url("../assets/fonts/mulish-latin-ext.woff2") format("woff2");
  unicode-range: U+100-2BA, U+2BD-2C5, U+2C7-2CC, U+2CE-2D7, U+2DD-2FF, U+304, U+308, U+329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: Mulish; font-style: normal; font-weight: 200 900; font-display: swap; src: url("../assets/fonts/mulish-latin.woff2") format("woff2");
  unicode-range: U+??, U+131, U+152-153, U+2BB-2BC, U+2C6, U+2DA, U+2DC, U+304, U+308, U+329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: Onest; font-style: normal; font-weight: 100 900; font-display: swap; src: url("../assets/fonts/onest-latin-ext.woff2") format("woff2");
  unicode-range: U+100-2BA, U+2BD-2C5, U+2C7-2CC, U+2CE-2D7, U+2DD-2FF, U+304, U+308, U+329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: Onest; font-style: normal; font-weight: 100 900; font-display: swap; src: url("../assets/fonts/onest-latin.woff2") format("woff2");
  unicode-range: U+??, U+131, U+152-153, U+2BB-2BC, U+2C6, U+2DA, U+2DC, U+304, U+308, U+329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* ================================================================ tokens */
:root {
  /* brand + accent */
  --signal: #6cf3a3; --signal-deep: #4bd888;
  --mint: #52ffa5; --violet: #582eff; --cyan: #6bfdff; --periwinkle: #8b98fe; --atmo: #c9a8ff;
  /* surfaces + text */
  --scene: #000; --void: #170a2b; --chalk: #fdfdfd; --paper: #fff; --ink: #000;
  --muted: rgba(255,255,255,.7);
  /* borders */
  --hairline: rgba(255,255,255,.1); --rule: rgba(255,255,255,.2); --ghost-line: rgba(255,255,255,.5);
  /* type */
  --font-general: generalSans, ui-sans-serif, system-ui, sans-serif;
  --font-tag: Mulish, ui-sans-serif, system-ui, sans-serif;
  --font-sans: Onest, ui-sans-serif, system-ui, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  /* motion */
  --ease-quint: cubic-bezier(.22, 1, .36, 1);
  --ease-spring: cubic-bezier(.3, 1.3, .5, 1);
  --ease-loader: cubic-bezier(.6, .05, .2, 1);
  /* layout (the DS is vw-based; clamped here so a chat stays readable on any screen) */
  --head-top: clamp(.75rem, .694vw, 1rem);
  --head-h: clamp(3.5rem, 3.542vw, 4.25rem);
  --head-w: min(95vw, clamp(48rem, 62vw, 72rem));          /* wide enough for the 5 links + the button */
  --side-w: 18rem;
  --fs-text: clamp(1rem, .95vw, 1.2rem);
  --fs-nav: clamp(.9375rem, 1.111vw, 1.25rem);
  --fs-tag: clamp(.75rem, .95vw, 1rem);
  --tile: clamp(2.75rem, 3.2vw, 3.5rem);
  --col: 52rem;
}
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; overflow: hidden; background: var(--scene); color: var(--chalk); font: 400 var(--fs-text)/1.5 var(--font-general); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
button, input, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
img { display: block; }
::selection { background: var(--signal); color: #000; }
:focus-visible { outline: 2px solid var(--signal); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* thin scrollbars on the glass */
* { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.22) transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,.2); }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.35); }

/* ================================================================ type roles */
.tag  { font: 400 var(--fs-tag)/1.2 var(--font-tag); text-transform: uppercase; }
.meta { font: 400 calc(var(--fs-tag) * .88)/1.2 var(--font-tag); text-transform: uppercase; color: rgba(253,253,253,.4); letter-spacing: .02em; }
.counter { font: 400 var(--fs-tag)/1 var(--font-general); font-variant-numeric: tabular-nums; color: rgba(253,253,253,.8); }
.counter i { font-style: normal; color: rgba(253,253,253,.35); }

/* ================================================================ background: particle orb + haze */
#orb { position: fixed; inset: 0; width: 100%; height: 100%; display: block; z-index: 0; pointer-events: none; opacity: 1; transition: opacity 1.4s var(--ease-quint); }
body.talking #orb { opacity: .3; }
body.busy #orb { opacity: .55; }

/* ================================================================ glass surfaces */
.glass { border: 1px solid var(--hairline); background: rgba(0,0,0,.8); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.glass-sheet { border: 1px solid var(--hairline); background: rgba(0,0,0,.9); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }

/* ================================================================ buttons */
.ghost { display: inline-flex; align-items: center; justify-content: center; gap: .62em; border: 1px solid var(--ghost-line); background: rgba(255,255,255,0); color: var(--chalk);
  padding: .6em 1.1em; font: 400 var(--fs-nav)/1.2 var(--font-general); white-space: nowrap;
  transition: border-color .3s, background-color .3s, color .3s, transform .35s var(--ease-spring); }
.ghost::after { content: ''; display: block; width: clamp(2px, .139vw, 3px); aspect-ratio: 1; background: currentColor; flex-shrink: 0; }
.ghost.no-dot::after { display: none; }
.ghost:hover { border-color: #fff; background: rgba(255,255,255,.12); }
.ghost:active { background: rgba(255,255,255,.22); transform: scale(.98); }
.ghost.signal { color: var(--signal); }
.ghost.signal:hover { border-color: var(--signal); background: rgba(108,243,163,.12); }
.ghost.signal:active { background: rgba(108,243,163,.22); }
.ghost.sm { font-size: calc(var(--fs-tag) * 1.05); padding: .45em .85em; }

.pbtn { border-radius: .5rem; padding: .5rem 1rem; font: 500 .875rem/1 var(--font-sans); background: var(--chalk); color: #000; transition: opacity .25s, transform .35s var(--ease-spring); }
.pbtn:hover { opacity: .85; } .pbtn:active { opacity: .72; transform: scale(.97); }
.pbtn.second { background: transparent; color: var(--chalk); border: 1px solid rgba(253,253,253,.25); }
.pbtn.second:hover { opacity: 1; border-color: rgba(253,253,253,.5); }
.tlink { font: 500 .875rem/1 var(--font-sans); text-decoration: underline; text-underline-offset: 2px; padding: .5rem; transition: opacity .25s; }
.tlink:hover { opacity: .65; } .tlink:active { opacity: .5; }

/* ================================================================ header */
#head { position: fixed; z-index: 50; top: var(--head-top); left: 50%; width: var(--head-w); height: var(--head-h); transform: translateX(-50%); }
#head .in { display: flex; height: 100%; align-items: center; justify-content: space-between; gap: 1rem; padding: .5rem .5rem .5rem clamp(1rem, .833vw + .4rem, 1.4rem); }
#head .logo { display: block; height: clamp(1.5rem, 1.806vw, 2.1rem); aspect-ratio: 84.3779 / 26; flex-shrink: 0; transition: opacity .3s; }
#head .logo:hover { opacity: .6; } #head .logo:active { opacity: .45; }
#head .logo img { width: 100%; height: 100%; }
#head nav.main { display: flex; align-items: center; gap: clamp(1.25rem, 2.222vw, 2.5rem); font: 400 var(--fs-nav)/1.2 var(--font-general); white-space: nowrap; }
.navlink { color: var(--chalk); transition: color .3s; padding: .25rem 0; }
.navlink:hover { color: var(--signal); } .navlink:active, .navlink[aria-pressed="true"] { color: var(--signal-deep); }
#head .ghost { align-self: stretch; }
#burger { display: none; position: relative; width: 2.5rem; height: 2.5rem; flex-shrink: 0; align-items: center; justify-content: center; }
#burger .bar { position: absolute; display: block; width: 1.25rem; height: 1px; background: #fff; transition: transform .35s var(--ease-spring); }
#burger .bar:first-child { top: calc(50% - 5px); } #burger .bar:last-child { top: calc(50% + 5px); }
#burger[aria-expanded="true"] .bar:first-child { transform: translateY(5px) rotate(45deg); }
#burger[aria-expanded="true"] .bar:last-child { transform: translateY(-5px) rotate(-45deg); }
#mnav { position: absolute; top: calc(100% + .5rem); left: 0; right: 0; display: flex; flex-direction: column; padding: 1.25rem; transition: opacity .35s, transform .35s var(--ease-spring), visibility .35s; }
#mnav[hidden] { display: flex !important; opacity: 0; transform: translateY(-12px); pointer-events: none; visibility: hidden; }
#mnav a, #mnav button.navlink { padding: .75rem 0; font: 400 1rem/1.2 var(--font-general); text-align: left; }
#mnav .ghost { margin-top: .75rem; padding: .75rem 1.1rem; font-size: 1rem; }

/* ================================================================ sidebar (history) */
#side { position: fixed; z-index: 40; left: var(--head-top); top: calc(var(--head-top) + var(--head-h) + .75rem); bottom: var(--head-top); width: var(--side-w);
  display: flex; flex-direction: column; transform: translateX(calc(-100% - 2rem)); opacity: 0; visibility: hidden; transition: transform .6s var(--ease-quint), opacity .4s, visibility .6s; }
body.side-open #side { transform: none; opacity: 1; visibility: visible; }
#side header { display: flex; align-items: baseline; justify-content: space-between; padding: 1.1rem 1.1rem .8rem; border-bottom: 1px solid var(--hairline); }
#side header .tag { color: var(--chalk); }
#side ul { list-style: none; margin: 0; padding: .5rem 1.1rem; overflow: auto; flex: 1; display: flex; flex-direction: column; gap: 2px; }
#side li { display: flex; align-items: center; gap: .5rem; }
.conv { flex: 1; min-width: 0; display: flex; gap: .9em; align-items: baseline; padding: .62em 0; text-align: left; color: rgba(253,253,253,.62); transition: color .3s; font: 400 calc(var(--fs-tag) * .95)/1.2 var(--font-tag); text-transform: uppercase; }
.conv b { font-weight: 400; color: rgba(253,253,253,.35); flex-shrink: 0; transition: color .3s; }
.conv span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv:hover { color: var(--signal); }
.conv.current { color: var(--chalk); } .conv.current b { color: var(--signal); }
.del { width: 1.5rem; height: 1.5rem; display: grid; place-items: center; color: rgba(253,253,253,.5); opacity: 0; transition: opacity .25s, color .25s; flex-shrink: 0; }
li:hover .del, .del:focus-visible { opacity: 1; } .del:hover { color: var(--chalk); }
@media (hover: none) { .del { opacity: .7; } }
#side .empty { padding: 1rem 0; color: rgba(253,253,253,.4); }
#side footer { display: flex; flex-direction: column; align-items: flex-start; gap: .45rem; padding: .8rem 1.1rem; border-top: 1px solid var(--hairline); min-width: 0; }
#side footer .srow { display: flex; align-items: center; gap: .6rem; }
#side footer .who { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: rgba(253,253,253,.62); text-transform: none; }
.dot { width: clamp(3px, .208vw, 4px); aspect-ratio: 1; background: rgba(253,253,253,.35); flex-shrink: 0; transition: background .4s; }
.dot.on { background: var(--signal); box-shadow: 0 0 8px var(--signal); } .dot.off { background: #ff6b6b; }
#scrim { position: fixed; inset: 0; z-index: 35; background: rgba(0,0,0,.4); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); opacity: 0; pointer-events: none; transition: opacity .4s; }

/* ================================================================ chat layout */
#app { position: fixed; inset: 0; z-index: 10; display: flex; flex-direction: column; padding-top: calc(var(--head-top) + var(--head-h) + .5rem); transition: padding-left .7s var(--ease-quint); }
#messages { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; scroll-behavior: smooth;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 1.75rem, #000 calc(100% - 1.25rem), transparent 100%);
          mask-image: linear-gradient(to bottom, transparent 0, #000 1.75rem, #000 calc(100% - 1.25rem), transparent 100%); }
#thread { width: min(calc(100% - 2.5rem), var(--col)); margin: 0 auto; padding: 1.75rem 0 2.5rem; display: flex; flex-direction: column; gap: clamp(1.75rem, 2.2vw, 2.5rem); perspective: 1400px; }
#thread:empty { display: none; }
.composer-wrap { width: min(calc(100% - 2.5rem), var(--col)); margin: 0 auto; padding: .5rem 0 max(.75rem, env(safe-area-inset-bottom)); }

/* hero (empty state) */
#hero { min-height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: clamp(1.1rem, 1.7vw, 2rem); padding: 1.5rem 1.25rem 2.5rem; }
#hero[hidden] { display: none; }
#hero h1 { margin: 0; max-width: 13ch; font: 300 clamp(2.375rem, 5.556vw, 6.5rem)/.9 var(--font-general); letter-spacing: 0; }
#hero .tagline { margin: 0; max-width: 34rem; font: 400 clamp(.8125rem, 1.111vw, 1.15rem)/1.3 var(--font-tag); text-transform: uppercase; color: rgba(253,253,253,.85); }
.lw { display: inline-block; white-space: nowrap; }
/* text keeps a soft dark halo so it reads over the brightest part of the orb (same trick as the catalog) */
#hero h1, #hero .tagline { text-shadow: 0 0 2px rgba(0,0,0,.85), 0 1px 14px rgba(0,0,0,.9), 0 0 32px rgba(0,0,0,.6); }
#hero .tagline { color: #fff; }
/* a dark veil behind the title block calms the orb exactly where the text sits */
#hero::before { content: ''; position: absolute; left: 50%; top: 50%; width: min(70vw, 56rem); height: min(60vh, 34rem); transform: translate(-50%, -52%); z-index: -1; pointer-events: none;
  background: radial-gradient(closest-side, rgba(0,0,0,.55), rgba(0,0,0,.25) 60%, transparent); }
#hero { position: relative; isolation: isolate; }

/* messages */
.msg { display: flex; flex-direction: column; gap: .6rem; min-width: 0; transform-origin: bottom; }
.msg .who { display: flex; align-items: baseline; gap: .9em; color: rgba(253,253,253,.62); }
.msg .who b { font-weight: 400; color: var(--signal); }
.msg .who time { margin-left: auto; }
.msg.user { align-items: flex-end; } .msg.user .who { justify-content: flex-end; } .msg.user .who time { margin-left: 0; order: -1; margin-right: .5em; }
.bubble.paper { max-width: min(100%, 40rem); background: var(--paper); color: var(--ink); border: 1px solid var(--hairline); padding: 1rem 1.25rem; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.45; }
.bubble.glass { padding: clamp(1rem, 1.4vw, 1.6rem) clamp(1.1rem, 1.667vw, 1.9rem); animation: surf .9s var(--ease-quint) both; }
@keyframes surf { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.actions { display: flex; gap: .6rem; flex-wrap: wrap; opacity: 0; transition: opacity .4s; }
.msg:hover .actions, .msg:focus-within .actions, .msg.last .actions { opacity: 1; }
@media (hover: none) { .actions { opacity: 1; } }

/* markdown inside the glass bubble */
.md { line-height: 1.55; overflow-wrap: anywhere; }
.md > :first-child { margin-top: 0; } .md > :last-child { margin-bottom: 0; }
.md p { margin: 0 0 .9em; }
.md h3, .md h4 { margin: 1.3em 0 .5em; font-weight: 500; line-height: 1.2; } .md h3 { font-size: 1.25em; } .md h4 { font-size: 1.08em; }
.md ul, .md ol { margin: 0 0 .9em; padding-left: 1.3em; } .md li { margin: .3em 0; padding-left: .2em; } .md li::marker { color: var(--signal); }
.md a { color: var(--signal); text-decoration: underline; text-underline-offset: 3px; transition: color .3s; } .md a:hover { color: var(--chalk); }
.md strong { font-weight: 500; }
.md blockquote { margin: 0 0 .9em; padding-left: clamp(.7rem, 1.111vw, 1.2rem); border-left: 1px solid rgba(255,255,255,.8); color: var(--muted); }
.md hr { border: 0; border-top: 1px solid var(--rule); margin: 1.4em 0; }
.md code { font: .86em/1.4 var(--font-mono); background: rgba(255,255,255,.08); border: 1px solid var(--hairline); padding: .08em .38em; }
.md .code { margin: 0 0 1em; border: 1px solid var(--hairline); background: rgba(0,0,0,.55); }
.md .code header { display: flex; align-items: center; justify-content: space-between; padding: .45rem .5rem .45rem .9rem; border-bottom: 1px solid var(--hairline); }
.md .code pre { margin: 0; padding: .9rem; overflow-x: auto; }
.md .code pre code { display: block; background: none; border: 0; padding: 0; font-size: .84em; line-height: 1.6; white-space: pre; }
.md .tbl { overflow-x: auto; margin: 0 0 1em; } .md table { border-collapse: collapse; width: 100%; font-size: .94em; }
.md th { font: 400 .8em/1.2 var(--font-tag); text-transform: uppercase; text-align: left; color: rgba(253,253,253,.62); }
.md th, .md td { padding: .6em .8em .6em 0; border-bottom: 1px solid var(--hairline); vertical-align: top; }

/* thinking */
.think { display: flex; align-items: center; gap: .9rem; padding: .35rem 0; }
.think svg { width: 1.4rem; height: 1.4rem; color: var(--signal); animation: spin 2.4s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.think .meta { color: rgba(253,253,253,.62); }

/* error panel (Void panel + panel buttons) */
.panel { max-width: 36rem; border-radius: .75rem; border: 1px solid rgba(253,253,253,.1); background: rgba(23,10,43,.95); box-shadow: 0 25px 50px -12px rgba(0,0,0,.6);
  -webkit-backdrop-filter: blur(24px); backdrop-filter: blur(24px); padding: 1.1rem 1.25rem; font-family: var(--font-sans); animation: surf .9s var(--ease-quint) both; }
.panel h2 { margin: 0 0 .35rem; font: 500 1rem/1.35 var(--font-sans); }
.panel p { margin: 0; font: 400 .875rem/1.625 var(--font-sans); color: rgba(253,253,253,.7); overflow-wrap: anywhere; }
.panel small { display: block; margin-top: .4rem; font: 400 .75rem/1.625 var(--font-sans); color: rgba(253,253,253,.6); }
.panel .row { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin-top: .9rem; }

/* composer = contact bar + solid CTA with tile */
#composer { display: flex; align-items: flex-end; gap: .75rem; border: 1px solid var(--rule); background: rgba(0,0,0,.8); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  padding: .5rem .5rem .5rem clamp(1rem, 1.667vw, 1.75rem); transition: border-color .3s; }
#composer:focus-within { border-color: rgba(255,255,255,.45); }
#input { flex: 1; min-width: 0; resize: none; border: 0; outline: none; background: transparent; color: #fff; padding: calc((var(--tile) - 1.5em) / 2) 0; line-height: 1.5; max-height: 11rem; font-size: var(--fs-text); }
#input::placeholder { color: rgba(255,255,255,.6); }
#input:focus-visible { outline: none; }
#send { display: flex; align-items: stretch; gap: clamp(2px, .278vw, 4px); flex-shrink: 0; height: var(--tile); border-radius: 0; }
#send:focus-visible { outline: 2px solid var(--signal); outline-offset: 2px; }
#send .lbl { display: flex; align-items: center; justify-content: center; min-width: clamp(5rem, 6.5vw, 8rem); padding: 0 clamp(1.1rem, 2vw, 2.4rem); background: var(--chalk); color: #000; font: 500 var(--fs-nav)/1.2 var(--font-general);
  transition: background-color .25s, transform .35s var(--ease-spring); }
#send:hover .lbl { background: var(--signal); } #send:active .lbl { background: var(--signal-deep); transform: scale(.98); }
#send .tile { width: var(--tile); height: var(--tile); object-fit: contain; transition: transform .35s var(--ease-spring); }
#send:hover .tile { transform: rotate(45deg); }
body.busy #send .tile { animation: spin 1.1s linear infinite; }
#send[disabled] { opacity: .45; cursor: not-allowed; } #send[disabled]:hover .lbl { background: var(--chalk); } #send[disabled]:hover .tile { transform: none; }
.hint { display: flex; justify-content: space-between; gap: 1rem; margin: .65rem .25rem 0; flex-wrap: wrap; }

/* dialog (cookie-dialog treatment) */
dialog { border: 1px solid rgba(253,253,253,.1); border-radius: .75rem; background: var(--void); color: var(--chalk); padding: 1.4rem; width: min(26rem, calc(100% - 2.5rem)); box-shadow: 0 25px 50px -12px rgba(0,0,0,.7); font-family: var(--font-sans); }
dialog::backdrop { background: rgba(0,0,0,.4); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
dialog[open] { animation: surf .5s var(--ease-quint) both; }
dialog h2 { margin: 0 0 .5rem; font: 500 1.25rem/1.2 var(--font-sans); }
dialog p { margin: 0; font: 400 .875rem/1.625 var(--font-sans); color: rgba(253,253,253,.7); }
dialog .row { display: flex; gap: .5rem; justify-content: flex-end; margin-top: 1.25rem; }

/* login / sign-up card: glass field bar over the live stage */
#auth { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; overflow: auto; perspective: 1400px;
  padding: calc(var(--head-top) + var(--head-h) + 1.5rem) 1.25rem 1.5rem; }
#auth[hidden] { display: none; }
.auth-card { width: min(26rem, 100%); padding: clamp(1.4rem, 2.2vw, 2.2rem); display: flex; flex-direction: column; gap: 1.1rem; border-color: var(--rule); transform-origin: bottom; animation: card 1200ms var(--ease-quint) both; }
.auth-card .tag { margin: 0; color: rgba(253,253,253,.62); }
.auth-card h2 { margin: 0; font: 300 clamp(2.2rem, 3.6vw, 3.4rem)/.95 var(--font-general); }
.auth-sub { margin: -.4rem 0 .2rem; color: var(--muted); font-size: .95em; }
.field { display: flex; flex-direction: column; gap: .3rem; }
.field input { background: transparent; border: 0; border-bottom: 1px solid var(--rule); color: #fff; padding: .45rem 0 .6rem; font: 400 1rem/1.2 var(--font-general); outline: none; border-radius: 0; transition: border-color .3s; }
.field input::placeholder { color: rgba(255,255,255,.45); }
.field input:focus { border-bottom-color: var(--signal); }
.field input:-webkit-autofill { -webkit-text-fill-color: #fff; transition: background-color 99999s; }
.auth-msg { margin: 0; min-height: 1.3em; font: 400 .875rem/1.4 var(--font-sans); color: #ff8a8a; }
.auth-card .ghost { width: 100%; padding: .85em 1.1em; }
.auth-card .ghost[disabled] { opacity: .5; cursor: wait; }
.auth-switch { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .6rem; color: var(--muted); font-size: .9em; }
.auth-switch .tlink { padding: .25rem 0; color: var(--signal); }
#auth[data-mode="login"] .only-reg { display: none; }
body.auth-on #side, body.auth-on #head nav.main, body.auth-on #head .cta, body.auth-on #burger, body.auth-on .composer-wrap, body.auth-on #messages, body.auth-on #scrim { display: none; }
body.auth-on #app { padding-left: 0; }

/* memory panel: dialog + category rows (cookie-preferences treatment) */
#mem-dlg { width: min(34rem, calc(100% - 2.5rem)); }
.mem-list { list-style: none; margin: 1rem 0 0; padding: 0; max-height: 50vh; overflow: auto; display: flex; flex-direction: column; gap: .5rem; }
.mem-item { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; border: 1px solid rgba(253,253,253,.1); border-radius: 10px; padding: .8rem 1rem; font: 400 .875rem/1.5 var(--font-sans); }
.mem-empty { font: 400 .875rem/1.625 var(--font-sans); color: rgba(253,253,253,.6); padding: .25rem 0; }
.del.on { opacity: 1; }
#mem-dlg .row button[hidden] { display: none; }

/* ================================================================ loader (star-fall cover) */
#loader { position: fixed; inset: 0; z-index: 60; background: #000; transition: opacity .9s var(--ease-loader), transform .9s var(--ease-loader); }
#loader.out { opacity: 0; transform: scale(1.06); pointer-events: none; }
#starfall { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
#loader .foot { position: absolute; left: 0; right: 0; bottom: 0; padding: 0 clamp(1.25rem, 2.222vw, 2.5rem) clamp(1.25rem, 2.222vw, 2.5rem); }
#loader .row { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 1rem; }
#loader .track { position: relative; height: 1px; width: 100%; overflow: hidden; background: rgba(253,253,253,.12); }
#loader .fill { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--chalk); }

/* ================================================================ reveals (LETTER / WORD / UNIT / CARD) */
.l, .w, .unit { opacity: 0; }
body.ready .l  { animation: letter 1000ms var(--ease-quint) both; animation-delay: calc(var(--i, 0) * 26ms + var(--d, 0ms)); }
body.ready .w  { animation: word 1200ms var(--ease-quint) both; animation-delay: calc(var(--i, 0) * var(--step, 42ms)); }
body.ready .unit { animation: unit 1000ms var(--ease-quint) both; animation-delay: var(--d, 0ms); }
.md.done .w, .md.done .unit { animation: none; opacity: 1; }
.md .w { display: inline-block; }
.card-in { animation: card 1200ms var(--ease-quint) both; }
@keyframes letter { from { opacity: 0; filter: blur(12px); } to { opacity: 1; filter: blur(0); } }
@keyframes word   { from { opacity: 0; transform: translateY(16px); filter: blur(8px); } to { opacity: 1; transform: none; filter: blur(0); } }
@keyframes unit   { from { opacity: 0; transform: translateY(20px); filter: blur(10px); } to { opacity: 1; transform: none; filter: blur(0); } }
@keyframes card   { from { opacity: 0; transform: scale(.94) rotateX(12deg); filter: blur(14px); } to { opacity: 1; transform: none; filter: blur(0); } }

/* ================================================================ responsive */
@media (min-width: 1024px) { body.side-open #app { padding-left: calc(var(--side-w) + var(--head-top) * 2); } }
@media (max-width: 1023.98px) {
  :root { --head-top: 1rem; --head-h: 3.5rem; --head-w: calc(100% - 3rem); --side-w: auto; }
  #head nav.main, #head .cta { display: none; }
  #burger { display: flex; }
  #side { left: 1.5rem; right: 1.5rem; top: calc(var(--head-top) + var(--head-h) + .5rem); bottom: 1rem; z-index: 55; transform: translateY(-12px); }
  body.side-open #side { transform: none; }
  body.side-open #scrim { opacity: 1; pointer-events: auto; }
}
@media (max-width: 639.98px) {
  :root { --head-top: .75rem; --head-w: calc(100% - 2.5rem); }
  #side { left: 1.25rem; right: 1.25rem; }
  #send .lbl { min-width: 0; padding: 0 1rem; }
  .composer-wrap, #thread { width: calc(100% - 2rem); }
  .hint .meta:first-child { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-delay: 0ms !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}

/* ================================================================ account panel + consent checkbox */
.check { display: flex; align-items: flex-start; gap: .65rem; color: var(--muted); font-size: .9em; line-height: 1.4; cursor: pointer; }
.check input { appearance: none; -webkit-appearance: none; width: 1.1rem; height: 1.1rem; margin: .1rem 0 0; flex-shrink: 0; border: 1px solid var(--ghost-line); background: transparent; display: grid; place-content: center; cursor: pointer; transition: border-color .3s, background-color .3s; }
.check input::before { content: ''; width: .55rem; height: .55rem; background: var(--signal); transform: scale(0); transition: transform .3s var(--ease-spring); }
.check input:checked { border-color: var(--signal); }
.check input:checked::before { transform: scale(1); }
.check a { color: var(--signal); text-decoration: underline; text-underline-offset: 3px; }
#acc-dlg { width: min(30rem, calc(100% - 2.5rem)); max-height: calc(100% - 2.5rem); overflow: auto; }
.acc-email { margin: -.2rem 0 1rem; font-size: .875rem; color: rgba(253,253,253,.6); overflow-wrap: anywhere; }
.acc-sec { margin: 0 0 1.25rem; padding: 1rem 0 0; border-top: 1px solid rgba(253,253,253,.1); display: flex; flex-direction: column; align-items: flex-start; gap: .75rem; }
.acc-sec h3 { margin: 0; font: 500 .95rem/1.2 var(--font-sans); }
.acc-sec p { margin: 0; }
.acc-sec .field { width: 100%; font-family: var(--font-sans); }
.acc-sec .field > span { font-size: .75rem; color: rgba(253,253,253,.6); }
.acc-sec .field input { font-family: var(--font-sans); font-size: .9rem; }
.acc-sec .row { margin-top: 0; justify-content: flex-start; align-items: center; }
#acc-dlg a.pbtn { display: inline-block; text-decoration: none; padding: .55rem 1rem; }
.pbtn.danger { background: #ff8a8a; color: #000; }
#acc-del-form { width: 100%; display: flex; flex-direction: column; gap: .75rem; align-items: flex-start; }
#acc-del-form[hidden] { display: none; }
.acc-msg { min-height: 1.3em; margin: 0 0 .5rem; font: 400 .875rem/1.4 var(--font-sans); color: #ff8a8a; }
.acc-msg.ok { color: var(--signal); }
@media (max-width: 1023.98px) { #mnav { max-height: calc(100vh - 6rem); overflow: auto; } }

/* show/hide password */
.pw { position: relative; display: block; width: 100%; }
.pw input { width: 100%; padding-right: 2.6rem !important; }
.eye { position: absolute; right: 0; top: 50%; transform: translateY(-50%); width: 2.25rem; height: 2.25rem; display: grid; place-items: center; color: rgba(253,253,253,.55); transition: color .25s; }
.eye:hover { color: var(--chalk); }
.eye svg { grid-area: 1 / 1; }
.eye .i-off { display: none; }
.pw.on .eye .i-on { display: none; }
.pw.on .eye .i-off { display: block; }
.pw.on .eye { color: var(--signal); }

/* daily message counter */
#hint-uso { color: rgba(253,253,253,.62); }
#hint-uso.low { color: #ffc27a; }
#hint-uso.zero { color: #ff8a8a; }
.acc-uso { margin: -.6rem 0 1rem; font-size: .875rem; color: var(--signal); }
.acc-uso.zero { color: #ff8a8a; }

/* voice dictation button (sits between the text field and the send button) */
.mic { flex-shrink: 0; width: var(--tile); height: var(--tile); display: grid; place-items: center; color: rgba(253,253,253,.7); border: 1px solid var(--rule);
  transition: color .3s, border-color .3s, background-color .3s, transform .35s var(--ease-spring); }
.mic[hidden] { display: none; }
.mic:hover { color: var(--chalk); border-color: #fff; background: rgba(255,255,255,.08); }
.mic:active { transform: scale(.96); }
.mic.on { color: var(--signal); border-color: var(--signal); background: rgba(108,243,163,.12); animation: ouvindo 1.4s ease-in-out infinite; }
@keyframes ouvindo { 0%, 100% { box-shadow: 0 0 0 0 rgba(108,243,163,.45); } 50% { box-shadow: 0 0 0 .5rem rgba(108,243,163,0); } }
