/* Asto Chat on the web: goasto.com/chat/app/ (lib/astoapp/chat_web.py).
   Made to be read by anyone: an older person at home, someone at a work PC. Big type (20 px and up, three sizes), dark ink
   on warm paper for the conversation, every control a labelled button at least 52 px tall, Enter sends.
   The sign-in is goasto.com's own stage (black, Geist, the one teal); the chat sits under an Abyss bar with the teal A.
   The site's font and brand files are its own (/assets/fonts, /brand); this sheet is the page's alone. */

@font-face {
  font-family: 'Geist';
  src: url('/assets/fonts/Geist-Variable.woff2') format('woff2-variations'),
       url('/assets/fonts/Geist-Variable.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --stage: #000;
  --white: #fff;
  --white-2: rgba(255,255,255,.72);
  --hairline-d: rgba(255,255,255,.14);
  --teal: #4FC3B8;
  --teal-hover: #66CFC5;
  --teal-active: #3DB3A8;
  --teal-deep: #0F6F6A;
  --abyss: #0B2726;
  --abyss-2: #123634;
  --ink: #101B1A;
  --ink-2: #3E4C4A;
  --paper: #F6F5F1;
  --card: #fff;
  --line: #D9D6CC;
  --bad-d: #FFB4A8;
  --bad: #9B2C1E;
  --bad-bg: #FDECE9;
  --font: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --ease: cubic-bezier(.16,1,.3,1);
  --fs: 20px;            /* the conversation's text; the Text size buttons set 20 / 24 / 28 */
}
html[data-size="2"] { --fs: 24px; }
html[data-size="3"] { --fs: 28px; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; height: 100%; }
body {
  margin: 0; min-height: 100%;
  font-family: var(--font); font-size: 18px; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  background: var(--stage); color: var(--white);
}
body.in-chat { background: var(--paper); color: var(--ink); }
a { color: inherit; }
img, svg { display: block; }
h1, h2, p, ol, ul { margin: 0; }
ol, ul { padding: 0; list-style: none; }
button, input, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.vh { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
:focus-visible { outline: 3px solid var(--teal); outline-offset: 3px; border-radius: 6px; }
.in-chat :focus-visible { outline-color: var(--teal-deep); }
h1:focus, main:focus { outline: none; }
.skip { position: absolute; left: -9999px; top: 12px; z-index: 20; }
.skip:focus-visible { left: 12px; padding: 12px 16px; background: var(--teal); color: var(--ink); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 56px; padding: 0 28px; border: 0; border-radius: 999px; cursor: pointer;
  font-size: 19px; font-weight: 600; letter-spacing: -.005em; text-decoration: none; white-space: nowrap;
  transition: background-color .18s ease, transform .18s var(--ease), box-shadow .18s ease;
}
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .55; cursor: default; }
.btn-teal { background: var(--teal); color: var(--ink); }
.btn-teal:hover { background: var(--teal-hover); }
.btn-teal:active { background: var(--teal-active); }
.btn-wide { width: 100%; margin-top: 22px; }
.btn-ghost { background: transparent; color: var(--white); box-shadow: inset 0 0 0 2px rgba(255,255,255,.4); min-height: 52px;
  padding: 0 22px; font-size: 18px; }
.btn-ghost:hover { box-shadow: inset 0 0 0 2px var(--white); }
.btn-quiet { background: var(--card); color: var(--ink); box-shadow: inset 0 0 0 2px var(--line); min-height: 52px; font-size: 18px; }
.btn-quiet:hover { box-shadow: inset 0 0 0 2px var(--ink-2); }
.text-btn { background: none; border: 0; padding: 10px 2px; cursor: pointer; font-size: 18px; color: var(--white);
  text-decoration: underline; text-decoration-color: rgba(255,255,255,.4); text-underline-offset: 5px; }
.text-btn:hover { text-decoration-color: var(--teal); }

/* ---------- sign in: goasto.com's stage ---------- */
.gate { min-height: 100vh; display: flex; flex-direction: column; position: relative; overflow: hidden; }
.gate::before {          /* one soft teal light, low behind the card */
  content: ''; position: absolute; pointer-events: none; width: 1100px; height: 1100px; left: 50%; top: 38%;
  transform: translateX(-50%);
  background: radial-gradient(closest-side, rgba(79,195,184,.16), rgba(79,195,184,0) 72%);
}
.gate-top { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 20px;
  max-width: 1240px; width: 100%; margin: 0 auto; padding: 28px 40px; }
.brand img { height: 34px; width: auto; }
.gate-link { font-size: 18px; color: var(--white-2); text-underline-offset: 5px; text-decoration-color: rgba(255,255,255,.3); }
.gate-link:hover { color: var(--white); text-decoration-color: var(--teal); }
.gate-main { position: relative; z-index: 1; flex: 1; display: flex; align-items: center; justify-content: center;
  padding: 24px 24px 96px; }
.gate-card { width: 100%; max-width: 560px; }
.pwordmark { width: 200px; height: auto; margin-bottom: 40px; opacity: .92; }
.gate h1 { font-size: clamp(40px, 6.4vw, 64px); line-height: 1.02; letter-spacing: -.035em; font-weight: 600; }
.accent { color: var(--teal); }
.gate .lead { margin-top: 22px; font-size: 21px; line-height: 1.5; color: var(--white-2); }
.gate .lead strong { color: var(--white); font-weight: 600; word-break: break-all; }
.gate form { margin-top: 36px; }
.field-label { display: block; font-size: 19px; font-weight: 500; margin-bottom: 10px; }
.field {
  display: block; width: 100%; min-height: 64px; padding: 14px 20px; border-radius: 16px;
  font-size: 22px; background: rgba(255,255,255,.06); border: 2px solid rgba(255,255,255,.34); color: var(--white);
  transition: border-color .18s ease, background-color .18s ease;
}
.field:hover { border-color: rgba(255,255,255,.6); }
.field:focus { outline: none; border-color: var(--teal); background: rgba(79,195,184,.08); }
.field-code { font-size: 34px; letter-spacing: .32em; font-variant-numeric: tabular-nums; padding-left: 24px; }
.notice { margin-top: 14px; font-size: 18px; line-height: 1.45; }
.gate .notice { color: var(--bad-d); }
.gate .notice.ok { color: var(--teal); }
.row-links { display: flex; flex-wrap: wrap; gap: 8px 28px; margin-top: 20px; }
.fine { margin-top: 30px; padding-top: 22px; border-top: 1px solid var(--hairline-d); font-size: 17px; color: var(--white-2); }
.fine a { color: var(--white); text-underline-offset: 4px; text-decoration-color: var(--teal); }

/* ---------- the chat ---------- */
.chat { display: flex; flex-direction: column; height: 100vh; height: 100dvh; }
.bar { background: var(--abyss); color: var(--white); flex: none; }
.bar-in { max-width: 980px; margin: 0 auto; padding: 14px 24px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.who { display: flex; align-items: center; gap: 14px; min-width: 0; }
.mark { width: 30px; height: auto; flex: none; }
.who-text { min-width: 0; }
.who-name { font-size: 24px; font-weight: 600; letter-spacing: -.02em; line-height: 1.15; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who-sub { font-size: 15px; color: var(--white-2); }
.bar-tools { display: flex; align-items: center; gap: 14px; flex: none; }
.sizes { display: flex; background: var(--abyss-2); border-radius: 999px; padding: 4px; }
.size { width: 46px; height: 44px; border: 0; border-radius: 999px; background: transparent; color: var(--white-2); cursor: pointer;
  font-weight: 600; font-size: 17px; line-height: 1; }
.size-2 { font-size: 21px; }
.size-3 { font-size: 25px; }
.size:hover { color: var(--white); }
.size[aria-pressed="true"] { background: var(--teal); color: var(--ink); }

.log { flex: 1; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.log-in { max-width: 980px; margin: 0 auto; padding: 24px 24px 12px; }
.older { display: flex; justify-content: center; margin-bottom: 12px; }
.empty { text-align: center; color: var(--ink-2); font-size: var(--fs); padding: 18vh 12px 0; max-width: 30ch; margin: 0 auto; }
.day { display: flex; justify-content: center; margin: 22px 0 14px; }
.day span { font-size: 16px; font-weight: 600; color: var(--ink-2); background: #EAE7DE; padding: 6px 16px; border-radius: 999px; }
.m { display: flex; flex-direction: column; align-items: flex-start; margin-top: 18px; }
.m + .m.same { margin-top: 8px; }
.m.me { align-items: flex-end; }
.m-who { font-size: 16px; font-weight: 600; color: var(--teal-deep); margin: 0 0 6px 4px; }
.bubble {
  max-width: min(78ch, 88%); padding: 14px 20px; border-radius: 22px 22px 22px 8px;
  background: var(--card); color: var(--ink); box-shadow: 0 0 0 1px var(--line), 0 1px 2px rgba(16,27,26,.05);
  font-size: var(--fs); line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere;
}
.me .bubble { background: var(--abyss); color: var(--white); box-shadow: none; border-radius: 22px 22px 8px 22px; }
.bubble a { color: var(--teal-deep); text-underline-offset: 3px; }
.me .bubble a { color: var(--teal); }
.file { display: flex; width: fit-content; max-width: 100%; align-items: center; gap: 8px; margin-top: 8px; padding: 6px 12px; border-radius: 10px;
  font-size: calc(var(--fs) * .8); background: rgba(16,27,26,.06); }
.me .file { background: rgba(255,255,255,.12); }
.m-time { font-size: 15px; color: var(--ink-2); margin: 6px 6px 0; }
.m.pending .bubble { opacity: .7; }
.writing { display: flex; align-items: center; gap: 12px; margin: 18px 0 6px 4px; font-size: 18px; color: var(--ink-2); }
.dots { display: inline-flex; gap: 6px; padding: 14px 18px; background: var(--card); border-radius: 22px 22px 22px 8px; box-shadow: 0 0 0 1px var(--line); }
.dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--teal-deep); animation: blink 1.2s infinite ease-in-out; }
.dots i:nth-child(2) { animation-delay: .18s; }
.dots i:nth-child(3) { animation-delay: .36s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; transform: none; } 40% { opacity: 1; transform: translateY(-3px); } }

.compose { flex: none; background: var(--card); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.compose-in { max-width: 980px; margin: 0 auto; padding: 14px 24px 12px; }
.compose .notice { margin: 0 0 12px; padding: 12px 16px; border-radius: 12px; }
.compose .notice.bad { background: var(--bad-bg); color: var(--bad); }
.compose-row { display: flex; align-items: flex-end; gap: 12px; }
.msg {
  flex: 1; min-height: 60px; max-height: 40vh; resize: none; overflow-y: auto; line-height: 1.4;
  font-size: var(--fs); padding: 14px 18px; border-radius: 18px;
  background: var(--paper); color: var(--ink); border: 2px solid var(--line);
}
.msg::placeholder { color: #6B7775; }
.msg:hover { border-color: #B9B4A6; }
.msg:focus { outline: none; border-color: var(--teal-deep); background: var(--card); }
.btn-send { min-height: 60px; padding: 0 32px; font-size: 20px; }
.btn-attach { min-height: 60px; padding: 0 20px; background: var(--paper); color: var(--ink); box-shadow: inset 0 0 0 2px var(--line);
  border-radius: 18px; font-size: 18px; }
.btn-attach:hover { box-shadow: inset 0 0 0 2px var(--ink-2); }
.btn-attach.focus { outline: 3px solid var(--teal-deep); outline-offset: 3px; }
.hint { margin-top: 8px; font-size: 15px; color: var(--ink-2); }
.picked { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.picked li { display: flex; align-items: center; gap: 10px; padding: 6px 6px 6px 8px; border-radius: 14px; background: var(--paper);
  box-shadow: inset 0 0 0 1px var(--line); font-size: 17px; max-width: 100%; }
.picked img { width: 44px; height: 44px; object-fit: cover; border-radius: 8px; }
.picked .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 22ch; }
.picked button { min-height: 44px; padding: 0 14px; border: 0; border-radius: 10px; background: var(--card); cursor: pointer;
  box-shadow: inset 0 0 0 1px var(--line); font-size: 16px; }

/* ---------- smaller screens: phone and narrow windows ---------- */
@media (max-width: 720px) {
  .gate-top { padding: 20px 22px; }
  .gate-main { align-items: flex-start; padding: 28px 22px 64px; }
  .pwordmark { width: 170px; margin-bottom: 30px; }
  .bar-in { padding: 10px 14px; gap: 10px; }
  .mark { width: 24px; }
  .who-name { font-size: 20px; }
  .who-sub { display: none; }
  .size { width: 40px; height: 42px; }
  .btn-ghost { padding: 0 14px; font-size: 16px; min-height: 46px; }
  .log-in { padding: 14px 14px 8px; }
  .bubble { max-width: 92%; padding: 12px 16px; }
  .compose-in { padding: 10px 12px 10px; }
  .compose-row { gap: 8px; }
  .btn-attach { padding: 0 12px; gap: 6px; font-size: 16px; }
  .btn-send { padding: 0 18px; font-size: 18px; }
  .msg { font-size: min(var(--fs), 22px); padding: 14px 14px; }
  .hint { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
@media (forced-colors: active) {
  .bubble, .btn, .field, .msg { border: 2px solid CanvasText; }
}
