:root {
  color-scheme: dark;
  --bg: #071019;
  --panel: rgba(16, 27, 40, 0.94);
  --panel-strong: #101b28;
  --text: #eef7fb;
  --muted: #9eb0c2;
  --line: rgba(255, 255, 255, 0.12);
  --accent: #52e0c4;
  --accent-strong: #21bfa3;
  --danger: #ff8b8b;
  --warn: #ffd37a;
  --ok: #8fffcf;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html { min-height: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(82,224,196,0.18), transparent 32rem),
    radial-gradient(circle at bottom right, rgba(75,120,255,0.14), transparent 34rem),
    var(--bg);
  color: var(--text);
}
.arah-shell {
  width: min(1040px, calc(100% - 32px));
  margin: 0 auto;
  padding: 42px 0 56px;
  display: grid;
  justify-items: center;
}
.arah-hero {
  width: min(760px, 100%);
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 18px;
  margin-bottom: 22px;
}
.arah-brand-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}
.arah-brand-row > div:last-child { text-align: left; }
.arah-mark-img {
  width: 72px;
  height: 72px;
  object-fit: contain;
  filter: drop-shadow(0 18px 34px rgba(0,0,0,.45));
  flex: 0 0 auto;
}
.arah-hero-logo {
  width: min(260px, 58vw);
  height: auto;
  object-fit: contain;
  margin: -8px auto -10px;
  filter: drop-shadow(0 24px 54px rgba(0,0,0,.5));
}
.eyebrow {
  margin: 0 0 4px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.78rem;
  font-weight: 800;
}
h1, h2, h3 { margin: 0; line-height: 1.08; }
h1 { font-size: clamp(2.35rem, 6vw, 4.7rem); }
h2 { font-size: clamp(1.35rem, 2.4vw, 2rem); }
h3 { font-size: 1.15rem; }
.hero-copy {
  max-width: 760px;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.65;
  margin: 0;
}
.panel {
  width: min(100%, 760px);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: var(--shadow);
  padding: clamp(20px, 3vw, 34px);
  backdrop-filter: blur(18px);
}
.auth-panel { max-width: 600px; }
.chat-panel { width: min(100%, 1040px); display: grid; gap: 18px; }
.muted { color: var(--muted); margin: 7px 0 0; line-height: 1.5; }
.hint { color: var(--muted); font-size: .85rem; font-weight: 600; }
.auth-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255,255,255,0.035);
  margin-bottom: 22px;
}
.tab {
  background: transparent;
  color: var(--muted);
  border: 1px solid transparent;
  border-radius: 13px;
  padding: 10px 12px;
}
.tab.active {
  background: rgba(82,224,196,0.16);
  color: var(--text);
  border-color: rgba(82,224,196,0.24);
}
.stacked-form { display: grid; gap: 14px; margin-top: 22px; }
.stacked-form.compact { margin-top: 14px; gap: 12px; }
label { display: grid; gap: 8px; color: #cfdbe6; font-weight: 700; }
input, textarea, select {
  width: 100%;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.06);
  color: var(--text);
  border-radius: 16px;
  padding: 13px 14px;
  font: inherit;
  outline: none;
}
.password-wrap {
  position: relative;
  display: block;
}
.password-wrap input { padding-right: 78px; }
.password-toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  padding: 7px 10px;
  min-width: 56px;
  border-radius: 11px;
  background: rgba(255,255,255,0.08);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: .8rem;
}
textarea { min-height: 58px; resize: vertical; }
input:focus, textarea:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(82,224,196,0.12); }
button {
  border: 0;
  border-radius: 16px;
  padding: 13px 18px;
  background: var(--accent);
  color: #041018;
  font-weight: 900;
  cursor: pointer;
}
button.secondary { background: rgba(255,255,255,0.08); color: var(--text); border: 1px solid var(--line); }
button:disabled { opacity: .55; cursor: not-allowed; }
.hidden { display: none !important; }
.inline-message { margin-top: 16px; color: var(--warn); min-height: 1.4em; line-height: 1.45; }
.status-pill {
  display: inline-flex;
  width: fit-content;
  border-radius: 999px;
  border: 1px solid var(--line);
  padding: 9px 13px;
  font-size: .9rem;
  font-weight: 800;
}
.status-muted { color: var(--muted); background: rgba(255,255,255,0.04); }
.status-ok { color: var(--ok); background: rgba(143,255,207,0.08); }
.status-warn { color: var(--warn); background: rgba(255,211,122,0.08); }
.chat-topbar {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: start;
}
.topbar-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.tier-card, .account-panel {
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.045);
  border-radius: 20px;
  padding: 14px 16px;
  color: var(--muted);
}
.account-panel { color: var(--text); }
.thread-card { font-size: .94rem; }
.thread-card.thread-warn { color: var(--warn); border-color: rgba(255,211,122,.34); background: rgba(255,211,122,.08); }
.messages {
  display: grid;
  gap: 12px;
  min-height: 360px;
  max-height: 58vh;
  overflow: auto;
  padding: 4px;
}
.msg {
  max-width: min(760px, 92%);
  padding: 14px 16px;
  border-radius: 18px;
  line-height: 1.55;
  white-space: pre-wrap;
}
.msg.user { justify-self: end; background: rgba(82,224,196,0.18); border: 1px solid rgba(82,224,196,0.25); }
.msg.assistant { justify-self: start; background: rgba(255,255,255,0.065); border: 1px solid var(--line); }
.msg.system { justify-self: center; color: var(--warn); background: rgba(255,211,122,0.08); border: 1px solid rgba(255,211,122,0.2); }
.composer { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: end; }
.privacy-note { margin: 0; color: var(--muted); font-size: .92rem; line-height: 1.5; }
@media (max-width: 760px) {
  .arah-brand-row > div:last-child { text-align: center; }
  .arah-brand-row { display: grid; justify-items: center; }
  .arah-shell { width: min(100% - 22px, 1120px); padding-top: 24px; }
  .arah-brand-row { align-items: center; }
  .auth-tabs { grid-template-columns: 1fr; }
  .chat-topbar { display: grid; }
  .topbar-actions, .composer { grid-template-columns: 1fr; display: grid; }
  .msg { max-width: 100%; }
}
