:root {
  color-scheme: dark;
  --ink: #080a0f;
  --ink-2: #0b0e15;
  --panel: #10141d;
  --panel-2: #151b26;
  --panel-3: #1b2230;
  --border: #232b38;
  --border-strong: #354052;
  --text: #f4efe4;
  --text-soft: #ded8cb;
  --muted: #9aa3b2;
  --muted-2: #6f7887;
  --gold: #e8b45a;
  --gold-bright: #f5d08a;
  --gold-deep: #b9852f;
  --gold-soft: rgba(232, 180, 90, 0.12);
  --mint: #5eead4;
  --mint-soft: rgba(94, 234, 212, 0.1);
  --red: #f87171;
  --green: #4ade80;
  --serif: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, Georgia, "Times New Roman", serif;
  --sans: "Inter", "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: "Cascadia Code", "JetBrains Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --radius: 16px;
  --sidebar: 286px;
}

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

[hidden] {
  display: none !important;
}

html {
  color-scheme: dark;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow: hidden;
  background: var(--ink);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

::selection {
  background: rgba(232, 180, 90, 0.32);
  color: #fff;
}

:focus-visible {
  outline: 2px solid var(--gold-bright);
  outline-offset: 3px;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.skip-link {
  position: fixed;
  top: -100px;
  left: 16px;
  z-index: 600;
  padding: 10px 14px;
  border: 1px solid var(--gold);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  font-size: 13px;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 16px;
}

/* ── Atmosphere ─────────────────────────────────────────────────────────── */

.ambient {
  position: fixed;
  z-index: -2;
  border-radius: 50%;
  filter: blur(110px);
  pointer-events: none;
}

.ambient-gold {
  top: -320px;
  right: -180px;
  width: 720px;
  height: 680px;
  background: radial-gradient(circle, rgba(232, 180, 90, 0.14), transparent 68%);
}

.ambient-mint {
  bottom: -340px;
  left: 10%;
  width: 620px;
  height: 600px;
  background: radial-gradient(circle, rgba(94, 234, 212, 0.07), transparent 70%);
}

.grid-overlay {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 72px 72px;
  -webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.8), transparent 76%);
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.8), transparent 76%);
}

/* ── Shell ──────────────────────────────────────────────────────────────── */

.chat-shell {
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
  width: 100%;
  height: 100vh;
  height: 100dvh;
}

.chat-sidebar {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-height: 0;
  padding: 26px 22px 22px;
  overflow-y: auto;
  border-right: 1px solid var(--border);
  background:
    linear-gradient(180deg, rgba(21, 27, 38, 0.55), rgba(8, 10, 15, 0.88)),
    rgba(8, 10, 15, 0.6);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: none;
}

.brand img {
  display: block;
  filter: drop-shadow(0 0 18px rgba(232, 180, 90, 0.16));
}

.brand-word {
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.brand-word em {
  color: var(--gold);
  font-style: italic;
}

.sidebar-back {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: fit-content;
  min-height: 32px;
  color: var(--muted);
  font-size: 12.5px;
  transition: color 0.2s ease;
}

.sidebar-back svg {
  width: 15px;
  height: 15px;
}

.sidebar-back:hover {
  color: var(--gold);
}

.sidebar-card {
  padding: 18px;
  border-color: rgba(232, 180, 90, 0.16);
  background:
    radial-gradient(circle at 100% 0%, rgba(232, 180, 90, 0.09), transparent 48%),
    linear-gradient(180deg, rgba(21, 27, 38, 0.86), rgba(13, 17, 25, 0.96));
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--gold);
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.17em;
  line-height: 1.2;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  width: 14px;
  height: 1px;
  flex: 0 0 auto;
  background: currentColor;
  opacity: 0.75;
}

.access-list {
  display: grid;
  gap: 13px;
  margin: 16px 0 0;
}

.access-list > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 11px;
  border-bottom: 1px solid rgba(35, 43, 56, 0.7);
}

.access-list > div:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.access-list dt {
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.access-list dd {
  margin: 0;
  overflow: hidden;
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 600;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.access-list dd.mono {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--mint);
  font-size: 11px;
  font-weight: 600;
}

.status-pill i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 0 4px rgba(94, 234, 212, 0.1);
}

.sidebar-foot {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.sidebar-lang {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(16, 20, 29, 0.7);
}

.lang-button {
  min-width: 30px;
  height: 25px;
  padding: 0 6px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  transition: color 0.2s ease, background 0.2s ease;
}

.lang-button:hover {
  color: var(--text);
}

.lang-button[aria-pressed="true"] {
  background: var(--gold-soft);
  color: var(--gold-bright);
}

.sidebar-hint {
  margin: 0;
  color: var(--muted-2);
  font-size: 10.5px;
  line-height: 1.6;
}

.sidebar-support {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 9px;
  color: var(--muted);
  font-size: 11.5px;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.sidebar-support:hover {
  border-color: rgba(232, 180, 90, 0.4);
  color: var(--gold-bright);
}

/* ── Main ───────────────────────────────────────────────────────────────── */

.chat-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  outline: none;
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex: none;
  min-height: 74px;
  padding: 14px clamp(20px, 3.4vw, 42px);
  border-bottom: 1px solid var(--border);
  background: rgba(8, 10, 15, 0.66);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}

.agent-id {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.agent-orb {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: none;
  border: 1px solid rgba(232, 180, 90, 0.42);
  border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, var(--gold-bright), var(--gold-deep) 64%, #5c3d10);
  box-shadow: 0 0 0 5px rgba(232, 180, 90, 0.06);
}

.agent-orb span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--ink);
}

.agent-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.agent-copy strong {
  color: var(--text);
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.agent-sub {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.04em;
}

.live-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 0 4px rgba(94, 234, 212, 0.1);
  animation: pulse 2.4s ease-in-out infinite;
}

.sub-sep {
  color: var(--border-strong);
}

.chat-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}

.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: rgba(16, 20, 29, 0.6);
  color: var(--muted);
  font-size: 11.5px;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.action-btn svg {
  width: 14px;
  height: 14px;
}

.action-btn:hover {
  border-color: rgba(232, 180, 90, 0.38);
  background: rgba(232, 180, 90, 0.06);
  color: var(--gold-bright);
}

/* ── Gate ───────────────────────────────────────────────────────────────── */

.chat-gate {
  display: grid;
  place-items: center;
  flex: 1;
  padding: 32px;
  overflow-y: auto;
}

.gate-card {
  width: min(460px, 100%);
  padding: 36px;
  border-color: rgba(232, 180, 90, 0.2);
  background:
    radial-gradient(circle at 90% 0%, rgba(232, 180, 90, 0.1), transparent 44%),
    var(--panel);
  text-align: center;
}

.gate-icon {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  margin: 0 auto 20px;
  border: 1px solid rgba(232, 180, 90, 0.3);
  border-radius: 14px;
  background: var(--gold-soft);
  color: var(--gold);
}

.gate-icon svg {
  width: 26px;
  height: 26px;
}

.gate-card .eyebrow {
  display: flex;
  justify-content: center;
}

.gate-card h1 {
  margin: 12px 0 10px;
  font-family: var(--serif);
  font-size: 32px;
  font-weight: 500;
  letter-spacing: -0.035em;
}

.gate-card p {
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.7;
}

.access-entry-form {
  margin: 0 0 14px;
  text-align: left;
}

.access-entry-field {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.access-entry-input {
  flex: 1;
  min-width: 0;
  height: 42px;
  padding: 0 13px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: rgba(8, 10, 15, 0.72);
  color: var(--text);
  font-family: var(--mono);
  font-size: 12.5px;
}

.access-entry-input:focus {
  outline: none;
  border-color: rgba(232, 180, 90, 0.55);
  box-shadow: 0 0 0 3px rgba(232, 180, 90, 0.12);
}

.access-entry-error {
  margin: 8px 2px 0 !important;
  color: #f87171 !important;
  font-size: 12.5px !important;
}

@media (max-width: 520px) {
  .access-entry-field {
    flex-direction: column;
  }
}

/* ── Buttons ────────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 650;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.btn-primary {
  background: var(--gold);
  color: #151008;
}

.btn-primary:hover {
  background: var(--gold-bright);
  transform: translateY(-1px);
}

/* ── App ────────────────────────────────────────────────────────────────── */

.chat-app {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
}

.chat-messages {
  flex: 1;
  min-height: 0;
  padding: 30px clamp(20px, 4vw, 54px) 18px;
  overflow-y: auto;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}

.chat-messages::-webkit-scrollbar {
  width: 10px;
}

.chat-messages::-webkit-scrollbar-thumb {
  border: 3px solid transparent;
  border-radius: 999px;
  background: var(--border-strong);
  background-clip: padding-box;
}

.message-list {
  display: block;
}

.chat-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  max-width: 660px;
  min-height: 100%;
  margin: 0 auto;
  padding: 20px 0 40px;
  text-align: center;
}

.empty-orb {
  position: relative;
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  margin-bottom: 24px;
  border: 1px solid rgba(232, 180, 90, 0.38);
  border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, var(--gold-bright), var(--gold-deep) 62%, #5c3d10);
  box-shadow:
    0 0 0 8px rgba(232, 180, 90, 0.05),
    0 0 60px -12px rgba(232, 180, 90, 0.4);
}

.empty-orb span {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--ink);
}

.chat-empty h1 {
  margin: 0 0 10px;
  font-family: var(--serif);
  font-size: clamp(32px, 4vw, 46px);
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 1.05;
}

.chat-empty > p {
  max-width: 470px;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.suggestions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  width: 100%;
  margin-top: 32px;
}

.suggestion {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 16px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: rgba(16, 20, 29, 0.6);
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.5;
  text-align: left;
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.suggestion:hover {
  border-color: rgba(232, 180, 90, 0.36);
  background: rgba(232, 180, 90, 0.05);
  color: var(--text-soft);
  transform: translateY(-1px);
}

.suggestion-arrow {
  flex: none;
  color: var(--gold);
  font-size: 13px;
}

/* ── Messages ───────────────────────────────────────────────────────────── */

.message {
  display: flex;
  flex-direction: column;
  gap: 7px;
  width: min(760px, 100%);
  margin: 0 auto 24px;
  animation: message-in 0.28s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.message-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.message-avatar {
  display: grid;
  place-items: center;
  width: 19px;
  height: 19px;
  border-radius: 5px;
  font-family: var(--serif);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
}

.message-assistant .message-avatar {
  background: var(--gold);
  color: var(--ink);
}

.message-user .message-avatar {
  border: 1px solid var(--border-strong);
  background: var(--panel-3);
  color: var(--text-soft);
}

.message-body {
  position: relative;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(16, 20, 29, 0.78);
  color: var(--text-soft);
  font-size: 14px;
  line-height: 1.72;
}

.message-user {
  align-items: flex-end;
}

.message-user .message-meta {
  justify-content: flex-end;
}

.message-user .message-body {
  max-width: 86%;
  border-color: rgba(232, 180, 90, 0.22);
  border-bottom-right-radius: 4px;
  background: linear-gradient(180deg, rgba(232, 180, 90, 0.14), rgba(232, 180, 90, 0.08));
  color: var(--text);
}

.message-assistant .message-body {
  border-bottom-left-radius: 4px;
  background:
    linear-gradient(180deg, rgba(21, 27, 38, 0.86), rgba(13, 17, 25, 0.94));
}

.message-text > *:first-child {
  margin-top: 0;
}

.message-text > *:last-child {
  margin-bottom: 0;
}

.message-text p {
  margin: 0 0 11px;
}

.message-text strong {
  color: var(--text);
  font-weight: 650;
}

.message-text em {
  color: var(--text-soft);
}

.message-text ul,
.message-text ol {
  margin: 0 0 12px;
  padding-left: 22px;
}

.message-text li {
  margin-bottom: 5px;
}

.message-text li:last-child {
  margin-bottom: 0;
}

.message-text code {
  padding: 2px 5px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: rgba(8, 10, 15, 0.7);
  color: var(--gold-bright);
  font-family: var(--mono);
  font-size: 0.88em;
}

.message-text pre {
  margin: 0 0 12px;
  padding: 13px 14px;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: rgba(8, 10, 15, 0.78);
}

.message-text pre code {
  padding: 0;
  border: 0;
  background: none;
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1.6;
  white-space: pre;
}

.message-text a {
  color: var(--gold);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.message-actions {
  display: flex;
  gap: 6px;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.message:hover .message-actions,
.message:focus-within .message-actions {
  opacity: 1;
}

.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 25px;
  padding: 0 7px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: transparent;
  color: var(--muted-2);
  font-size: 9.5px;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.copy-btn svg {
  width: 11px;
  height: 11px;
}

.copy-btn:hover {
  border-color: rgba(232, 180, 90, 0.35);
  color: var(--gold);
}

.message-error .message-body {
  border-color: rgba(248, 113, 113, 0.32);
  background: rgba(248, 113, 113, 0.07);
  color: #fecaca;
}

.message-note {
  margin: 8px 0 0;
  color: var(--muted-2);
  font-size: 10.5px;
  font-style: italic;
}

.typing-row {
  display: flex;
  align-items: center;
  gap: 9px;
  width: min(760px, 100%);
  margin: 0 auto 24px;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.typing-row .message-avatar {
  background: var(--gold);
  color: var(--ink);
}

.typing-dots {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(16, 20, 29, 0.7);
}

.typing-dots i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--gold);
  opacity: 0.5;
  animation: typing 1.3s ease-in-out infinite;
}

.typing-dots i:nth-child(2) { animation-delay: 0.16s; }
.typing-dots i:nth-child(3) { animation-delay: 0.32s; }

/* ── Composer ───────────────────────────────────────────────────────────── */

.composer-wrap {
  flex: none;
  padding: 0 clamp(20px, 4vw, 54px) 18px;
}

.chat-usage {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 18px;
  width: min(760px, 100%);
  margin: 0 auto 8px;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.03em;
}

.chat-usage strong {
  color: var(--muted);
  font-weight: 600;
}

.composer {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  width: min(760px, 100%);
  margin: 0 auto;
  padding: 9px 9px 9px 16px;
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  background: rgba(16, 20, 29, 0.92);
  box-shadow: 0 24px 60px -40px rgba(0, 0, 0, 0.95);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.composer:focus-within {
  border-color: rgba(232, 180, 90, 0.55);
  box-shadow:
    0 0 0 3px rgba(232, 180, 90, 0.08),
    0 24px 60px -40px rgba(0, 0, 0, 0.95);
}

.composer textarea {
  flex: 1;
  min-width: 0;
  max-height: 168px;
  padding: 7px 0;
  overflow-y: auto;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 14px;
  line-height: 1.55;
  resize: none;
  scrollbar-width: thin;
}

.composer textarea::placeholder {
  color: var(--muted-2);
}

.send-btn,
.stop-btn {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: none;
  border: 0;
  border-radius: 9px;
  transition: background 0.2s ease, transform 0.2s ease;
}

.send-btn {
  background: var(--gold);
  color: #151008;
}

.send-btn:hover {
  background: var(--gold-bright);
}

.send-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.send-btn svg {
  width: 17px;
  height: 17px;
}

.stop-btn {
  background: rgba(248, 113, 113, 0.12);
  color: var(--red);
}

.stop-btn:hover {
  background: rgba(248, 113, 113, 0.2);
}

.stop-btn span {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  background: currentColor;
}

.chat-disclaimer {
  width: min(760px, 100%);
  margin: 8px auto 0;
  color: var(--muted-2);
  font-size: 9.5px;
  line-height: 1.5;
  text-align: center;
}

/* ── Toast ──────────────────────────────────────────────────────────────── */

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  z-index: 700;
  max-width: min(420px, calc(100% - 32px));
  padding: 11px 16px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: rgba(21, 27, 38, 0.97);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  box-shadow: 0 18px 50px -20px #000;
  color: var(--text-soft);
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.toast.is-success {
  border-color: rgba(94, 234, 212, 0.4);
}

.toast.is-error {
  border-color: rgba(248, 113, 113, 0.4);
}

/* ── Motion ─────────────────────────────────────────────────────────────── */

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.86); }
}

@keyframes typing {
  0%, 60%, 100% { opacity: 0.35; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-3px); }
}

@keyframes message-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .chat-messages { scroll-behavior: auto; }
}

/* ── Responsive ─────────────────────────────────────────────────────────── */

@media (max-width: 900px) {
  body {
    overflow: auto;
  }

  .chat-shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
    height: 100vh;
    height: 100dvh;
  }

  .chat-sidebar {
    flex-direction: row;
    align-items: center;
    gap: 14px;
    padding: 12px 18px;
    overflow: visible;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .sidebar-card,
  .sidebar-hint,
  .sidebar-support,
  .sidebar-back span {
    display: none;
  }

  .sidebar-back {
    order: 3;
    min-height: 30px;
  }

  .sidebar-foot {
    order: 2;
    flex-direction: row;
    align-items: center;
    margin: 0 0 0 auto;
    padding: 0;
    border: 0;
  }

  .sidebar-lang > span {
    display: none;
  }

  .chat-header {
    min-height: 64px;
    padding: 12px 18px;
  }

  .chat-actions .action-btn span {
    display: none;
  }

  .chat-actions .action-btn {
    width: 36px;
    padding: 0;
    justify-content: center;
  }

  .chat-messages {
    padding: 22px 18px 14px;
  }

  .composer-wrap {
    padding: 0 18px 14px;
  }

  .suggestions {
    grid-template-columns: 1fr;
  }

  .message-user .message-body {
    max-width: 92%;
  }
}

@media (max-width: 560px) {
  .brand-word {
    font-size: 18px;
  }

  .chat-empty h1 {
    font-size: 30px;
  }

  .chat-empty > p {
    font-size: 13px;
  }

  .chat-usage {
    font-size: 8.5px;
  }

  .chat-disclaimer {
    display: none;
  }

  .message-body {
    padding: 13px 14px;
    font-size: 13.5px;
  }

  .gate-card {
    padding: 28px 22px;
  }
}
