:root {
  color-scheme: light;
  --canvas: #fbfaf7;
  --paper: #ffffff;
  --ink: #17202a;
  --muted: #69727b;
  --line: #d7dde2;
  --blue: #2c6bed;
  --blue-soft: #eaf1ff;
  --yellow: #f6c945;
  --shadow: 4px 4px 0 #17202a;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: var(--canvas); color: var(--ink); }
button, textarea { font: inherit; }
button { cursor: pointer; }
.shell { width: min(100%, 760px); min-height: 100svh; margin: 0 auto; padding: 24px; }
.login-view { display: grid; align-content: center; min-height: calc(100svh - 48px); max-width: 560px; margin: auto; }
.brand-mark { display: grid; place-items: center; width: 56px; height: 56px; margin-bottom: 28px; background: var(--yellow); border: 2px solid var(--ink); box-shadow: var(--shadow); font-size: 30px; }
.eyebrow { margin: 0 0 8px; color: var(--blue); font-size: 11px; font-weight: 800; letter-spacing: .12em; }
h1 { margin: 0; font-size: clamp(2rem, 8vw, 4.25rem); line-height: .98; letter-spacing: 0; }
.intro { max-width: 440px; margin: 22px 0 28px; color: var(--muted); font-size: 17px; line-height: 1.55; }
.login-panel { padding: 22px; background: var(--paper); border: 2px solid var(--ink); box-shadow: var(--shadow); }
.panel-label { margin-bottom: 18px; font-weight: 800; }
.telegram-login { min-height: 44px; display: flex; align-items: center; }
.status-text { min-height: 20px; margin: 14px 0 0; color: #a33e28; font-size: 13px; }
.privacy-note, .composer-hint { color: var(--muted); font-size: 12px; line-height: 1.45; }
.chat-view { display: grid; grid-template-rows: auto auto 1fr auto auto; min-height: calc(100svh - 48px); }
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 8px 0 22px; border-bottom: 2px solid var(--ink); }
.identity { display: flex; align-items: center; gap: 12px; }
.identity h1 { font-size: 18px; }
.avatar { display: grid; place-items: center; width: 42px; height: 42px; background: var(--yellow); border: 2px solid var(--ink); font-weight: 900; }
.icon-button, .send-button { border: 2px solid var(--ink); background: var(--paper); color: var(--ink); box-shadow: 3px 3px 0 var(--ink); }
.icon-button { width: 40px; height: 40px; font-size: 19px; }
.icon-button:active, .send-button:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.connection-banner { margin: 16px 0 0; padding: 10px 12px; border: 1px solid #d88b76; background: #fff0eb; color: #8e321e; font-size: 13px; }
.messages { display: flex; flex-direction: column; gap: 12px; overflow-y: auto; padding: 24px 0; }
.empty-state { align-self: center; max-width: 330px; margin: auto; color: var(--muted); text-align: center; line-height: 1.5; }
.message { max-width: min(86%, 560px); padding: 13px 15px; border: 1.5px solid var(--ink); white-space: pre-wrap; line-height: 1.5; }
.message.user { align-self: flex-end; background: var(--blue); color: #fff; border-color: var(--blue); }
.message.airia { align-self: flex-start; background: var(--paper); box-shadow: 3px 3px 0 var(--line); }
.message.pending { opacity: .6; }
.composer { display: flex; align-items: flex-end; gap: 10px; padding-top: 12px; border-top: 2px solid var(--ink); }
textarea { width: 100%; min-height: 48px; max-height: 160px; resize: none; padding: 13px 14px; border: 2px solid var(--ink); background: var(--paper); color: var(--ink); outline: none; }
textarea:focus { border-color: var(--blue); }
.send-button { flex: 0 0 48px; width: 48px; height: 48px; background: var(--yellow); font-size: 24px; font-weight: 900; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
@media (max-width: 520px) { .shell { padding: 16px; } .login-view { min-height: calc(100svh - 32px); } .chat-view { min-height: calc(100svh - 32px); } h1 { font-size: 2.65rem; } .intro { font-size: 15px; } }
