:root {
  --bg: #07060f;
  --bg-2: #0d0b1d;
  --surface: rgba(255, 255, 255, 0.045);
  --surface-2: rgba(255, 255, 255, 0.07);
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #eceaf6;
  --muted: #a29fbf;
  --faint: #6f6b8f;
  --gold: #e8c27a;
  --gold-2: #f3dca8;
  --violet: #9b8cff;
  --violet-deep: #3b2d86;
  --wa: #25d366;
  --danger: #ff8a8a;
  --radius: 18px;
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.6 var(--font-body);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
#landing { overflow-y: auto; height: 100dvh; }
button, input, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.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;
}
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* ---------- Background ---------- */
#sky { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; }
.nebula {
  position: fixed; inset: -20%; z-index: 0; pointer-events: none;
  background:
    radial-gradient(40% 35% at 20% 15%, rgba(91, 64, 200, 0.22), transparent 70%),
    radial-gradient(35% 30% at 85% 80%, rgba(232, 194, 122, 0.10), transparent 70%),
    radial-gradient(50% 40% at 70% 20%, rgba(40, 120, 160, 0.10), transparent 70%);
  animation: drift 40s ease-in-out infinite alternate;
}
@keyframes drift { to { transform: translate3d(3%, -2%, 0) scale(1.05); } }

.view { position: relative; z-index: 1; }

/* ---------- Landing ---------- */
.landing {
  min-height: 100dvh; overflow-y: auto;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 24px 16px calc(24px + env(safe-area-inset-bottom));
  transition: opacity .5s ease, transform .5s ease;
}
.landing.leaving { opacity: 0; transform: translateY(-12px) scale(.98); }
.landing-inner { width: 100%; max-width: 420px; text-align: center; margin: auto 0; }

.orb {
  width: 72px; height: 72px; margin: 0 auto 28px; border-radius: 50%; position: relative;
  background: radial-gradient(circle at 35% 30%, #fff6de 0%, var(--gold) 28%, #8a5cff 70%, #2b1d68 100%);
  box-shadow: 0 0 60px rgba(155, 140, 255, .45), 0 0 120px rgba(232, 194, 122, .18);
  animation: float 6s ease-in-out infinite;
}
.orb span {
  position: absolute; inset: -12px; border-radius: 50%;
  border: 1px solid rgba(232, 194, 122, .35);
  border-top-color: transparent; border-left-color: transparent;
  animation: spin 14s linear infinite;
}
@keyframes float { 50% { transform: translateY(-6px); } }
@keyframes spin { to { transform: rotate(360deg); } }

h1 {
  font: 600 clamp(40px, 11vw, 60px)/1.05 var(--font-display);
  letter-spacing: -0.02em; margin: 0 0 14px;
}
h1 .grad {
  background: linear-gradient(180deg, #fff 0%, var(--gold-2) 120%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
h1 .emoji { font-size: .7em; vertical-align: .08em; }
.subtitle { color: var(--muted); font-size: 18px; margin: 0 auto 36px; max-width: 30ch; }

.dob-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 22px;
  padding: 20px; text-align: left;
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, .35);
}
.dob-card label, .sheet label:not(.consent) {
  display: block; font-size: 13px; font-weight: 500; color: var(--muted);
  letter-spacing: .02em; margin: 0 0 8px;
}
input[type="date"], input[type="tel"], input[type="time"], input[type="text"] {
  width: 100%; height: 54px; padding: 0 16px; border-radius: 14px;
  background: rgba(0, 0, 0, .35); border: 1px solid var(--border-strong);
  font-size: 17px; outline: none; transition: border-color .2s, box-shadow .2s;
}
input[type="date"]:focus, input[type="tel"]:focus, input[type="time"]:focus, input[type="text"]:focus {
  border-color: rgba(232, 194, 122, .6); box-shadow: 0 0 0 4px rgba(232, 194, 122, .12);
}
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator { filter: invert(.8); cursor: pointer; }
/* iOS Safari gives native date/time inputs an intrinsic width that ignores
   width:100%, so they overflow the card; drop the native look to fix it. */
input[type="date"], input[type="time"] {
  -webkit-appearance: none; appearance: none; display: block; min-width: 0; max-width: 100%;
}
input[type="date"]::-webkit-date-and-time-value,
input[type="time"]::-webkit-date-and-time-value { text-align: left; min-height: 1.2em; }
input::placeholder { color: var(--faint); }

.field { margin-top: 14px; }
.opt { font-weight: 400; color: var(--faint); margin-left: 4px; }
.hint { color: var(--faint); font-size: 12.5px; margin: 10px 2px 0; line-height: 1.45; }
.place-field { position: relative; }
.place-list {
  position: absolute; z-index: 5; left: 0; right: 0; top: calc(100% + 6px);
  margin: 0; padding: 6px; list-style: none; border-radius: 14px;
  background: #151230; border: 1px solid var(--border-strong);
  box-shadow: 0 18px 50px rgba(0, 0, 0, .55); max-height: 264px; overflow-y: auto;
}
.place-list li {
  padding: 9px 12px; border-radius: 10px; cursor: pointer; font-size: 15px; line-height: 1.3;
}
.place-list li small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.place-list li[aria-selected="true"], .place-list li:hover { background: var(--surface-2); }
.place-list .empty { color: var(--muted); cursor: default; }
.place-list .empty:hover { background: none; }
.credit { display: inline-block; margin-top: 6px; }
.credit a { color: inherit; }

.btn-primary {
  width: 100%; height: 54px; margin-top: 14px; border: 0; border-radius: 14px; cursor: pointer;
  font-weight: 600; font-size: 17px; color: #1a1330;
  background: linear-gradient(135deg, var(--gold-2), var(--gold) 55%, #d49a4a);
  box-shadow: 0 8px 30px rgba(232, 194, 122, .25);
  transition: transform .15s ease, box-shadow .2s ease, opacity .2s;
  position: relative; overflow: hidden;
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 12px 36px rgba(232, 194, 122, .35); }
.btn-primary:active { transform: translateY(0); }
.btn-primary[disabled] { cursor: progress; }
.btn-primary.loading::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(100deg, transparent 20%, rgba(255, 255, 255, .45) 50%, transparent 80%);
  animation: shimmer 1.4s infinite;
}
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

.form-error { color: var(--danger); font-size: 14px; margin: 10px 2px 0; }
.reassure { color: var(--faint); font-size: 13px; margin-top: 18px; letter-spacing: .02em; }
.landing-foot { color: var(--faint); font-size: 12px; text-align: center; max-width: 36ch; margin-top: 24px; }

/* ---------- Chat ---------- */
.chat {
  height: 100dvh; display: flex; flex-direction: column;
  animation: rise .6s cubic-bezier(.2, .8, .2, 1);
}
@keyframes rise { from { opacity: 0; transform: translateY(16px); } }

.chat-head {
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  background: linear-gradient(180deg, rgba(7, 6, 15, .92), rgba(7, 6, 15, .6));
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.head-row { display: flex; align-items: center; gap: 10px; max-width: 760px; margin: 0 auto; }
.brand { font: 600 19px var(--font-display); letter-spacing: -.01em; flex: 1; }
.dev-pill {
  font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase;
  color: var(--gold); border: 1px solid rgba(232, 194, 122, .4); padding: 3px 8px; border-radius: 99px;
}
.icon-btn {
  width: 36px; height: 36px; display: grid; place-items: center; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--border); color: var(--muted); cursor: pointer;
  transition: color .2s, background .2s;
}
.icon-btn:hover { color: var(--text); background: var(--surface-2); }

.profile-chips {
  display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none;
  max-width: 760px; margin: 10px auto 0; padding-bottom: 2px;
}
.profile-chips::-webkit-scrollbar { display: none; }
.pchip {
  flex: none; font-size: 12.5px; color: var(--muted); white-space: nowrap;
  padding: 5px 10px; border-radius: 99px; background: var(--surface); border: 1px solid var(--border);
}
.pchip b { color: var(--text); font-weight: 600; }

.messages {
  flex: 1; overflow-y: auto; overscroll-behavior: contain;
  padding: 20px 16px 24px; scroll-behavior: smooth;
}
.msg { max-width: 760px; margin: 0 auto 22px; animation: fadein .35s ease; }
@keyframes fadein { from { opacity: 0; transform: translateY(6px); } }

.msg.user { display: flex; justify-content: flex-end; }
.msg.user .bubble {
  max-width: 85%; padding: 10px 16px; border-radius: 20px 20px 6px 20px;
  background: linear-gradient(135deg, rgba(155, 140, 255, .28), rgba(91, 64, 200, .28));
  border: 1px solid rgba(155, 140, 255, .3); white-space: pre-wrap; overflow-wrap: anywhere;
}

.msg.assistant { display: grid; grid-template-columns: 30px 1fr; gap: 12px; }
.avatar {
  width: 30px; height: 30px; border-radius: 50%; margin-top: 2px;
  background: radial-gradient(circle at 35% 30%, #fff6de, var(--gold) 35%, #7b55f0 80%);
  box-shadow: 0 0 18px rgba(155, 140, 255, .4);
}
.content { min-width: 0; overflow-wrap: anywhere; }
.content > :first-child { margin-top: 0; }
.content > :last-child { margin-bottom: 0; }
.content p { margin: 0 0 12px; }
.content h1, .content h2, .content h3, .content h4 {
  font: 600 18px/1.35 var(--font-display); color: var(--gold-2); margin: 20px 0 6px;
}
.content h1 { font-size: 21px; }
.content ul, .content ol { margin: 0 0 12px; padding-left: 22px; }
.content li { margin: 4px 0; }
.content li::marker { color: var(--gold); }
.content strong { color: #fff; font-weight: 600; }
.content em { color: #d9d4f5; }
.content blockquote {
  margin: 0 0 14px; padding: 10px 14px; border-left: 3px solid var(--gold);
  background: var(--surface); border-radius: 0 12px 12px 0; color: var(--muted); font-size: 14.5px;
}
.content code { font-size: 13px; background: var(--surface-2); padding: 1px 6px; border-radius: 6px; }
.content hr { border: 0; border-top: 1px solid var(--border); margin: 18px 0; }

.typing { display: inline-flex; gap: 5px; padding: 10px 0; }
.typing i {
  width: 7px; height: 7px; border-radius: 50%; background: var(--gold); opacity: .3;
  animation: blink 1.2s infinite ease-in-out;
}
.typing i:nth-child(2) { animation-delay: .15s; }
.typing i:nth-child(3) { animation-delay: .3s; }
.typing-label { color: var(--muted); font-size: 14px; margin-left: 10px; font-style: italic; }
@keyframes blink { 40% { opacity: 1; transform: translateY(-2px); } }
.cursor::after {
  content: ""; display: inline-block; width: 8px; height: 1em; margin-left: 2px;
  vertical-align: -2px; background: var(--gold); border-radius: 2px; animation: caret 1s steps(2) infinite;
}
@keyframes caret { 50% { opacity: 0; } }

/* WhatsApp CTA card */
.wa-card {
  max-width: 760px; margin: 4px auto 26px; padding: 18px; border-radius: var(--radius);
  position: relative; background: linear-gradient(160deg, rgba(37, 211, 102, .10), rgba(155, 140, 255, .08));
  border: 1px solid rgba(37, 211, 102, .28); animation: fadein .5s ease;
}
.wa-card h3 { font: 600 19px/1.3 var(--font-display); margin: 0 0 4px; }
.wa-card p { margin: 0 0 14px; color: var(--muted); font-size: 15px; }
.btn-wa {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 48px; padding: 0 18px; border-radius: 14px; border: 0; cursor: pointer;
  font-weight: 600; color: #04210f; background: var(--wa);
  box-shadow: 0 8px 24px rgba(37, 211, 102, .22); transition: transform .15s, opacity .2s;
}
.btn-wa:hover:not([disabled]) { transform: translateY(-1px); }
.btn-wa[disabled] { opacity: .45; cursor: not-allowed; box-shadow: none; }
.wa-card .btn-wa { width: 100%; }

/* Dock */
.dock {
  border-top: 1px solid var(--border);
  background: linear-gradient(0deg, rgba(7, 6, 15, .95), rgba(7, 6, 15, .75));
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  padding: 10px 0 calc(10px + env(safe-area-inset-bottom));
}
.dock-inner { max-width: 760px; margin: 0 auto; }

.composer {
  display: flex; align-items: flex-end; gap: 8px; margin: 0 16px;
  padding: 6px 6px 6px 16px; border-radius: 22px;
  background: rgba(0, 0, 0, .35); border: 1px solid var(--border-strong);
  transition: border-color .2s, box-shadow .2s;
}
.composer:focus-within { border-color: rgba(232, 194, 122, .5); box-shadow: 0 0 0 4px rgba(232, 194, 122, .08); }
.composer textarea {
  flex: 1; resize: none; border: 0; outline: none; background: transparent;
  font-size: 16px; line-height: 1.5; padding: 8px 0; max-height: 140px;
}
.composer textarea::placeholder { color: var(--faint); }
.send-btn {
  width: 40px; height: 40px; flex: none; border-radius: 50%; border: 0; cursor: pointer;
  display: grid; place-items: center; color: #1a1330;
  background: linear-gradient(135deg, var(--gold-2), var(--gold)); transition: opacity .2s, transform .15s;
}
.send-btn[disabled] { opacity: .3; cursor: default; }

/* ---------- Sheet ---------- */
.sheet-backdrop {
  position: fixed; inset: 0; z-index: 10; display: flex; align-items: flex-end; justify-content: center;
  background: rgba(3, 2, 10, .6); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  animation: fade .25s ease;
}
@keyframes fade { from { opacity: 0; } }
.sheet {
  width: 100%; max-width: 480px; position: relative;
  max-height: 92dvh; overflow-y: auto;
  padding: 26px 20px calc(22px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, #151230, #0d0b1d); border: 1px solid var(--border-strong);
  border-bottom: 0; border-radius: 26px 26px 0 0; box-shadow: 0 -20px 60px rgba(0, 0, 0, .5);
  animation: slideup .35s cubic-bezier(.2, .8, .2, 1);
}
@keyframes slideup { from { transform: translateY(100%); } }
.sheet h2 { font: 600 22px/1.25 var(--font-display); margin: 0 40px 6px 0; }
.sheet-sub { color: var(--muted); margin: 0 0 20px; font-size: 15px; }
.sheet-close { position: absolute; top: 18px; right: 18px; }
.consent {
  display: flex; gap: 12px; align-items: flex-start; margin: 16px 0 4px; cursor: pointer;
  font-size: 14px; color: var(--text); line-height: 1.45;
}
.consent input { width: 20px; height: 20px; margin: 1px 0 0; flex: none; accent-color: var(--wa); }
.sheet .btn-wa { width: 100%; margin-top: 16px; }
.fine { color: var(--faint); font-size: 12px; text-align: center; margin: 12px 0 0; }
.wa-done { text-align: center; padding: 8px 0 4px; }
.wa-done-icon {
  width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 50%; display: grid; place-items: center;
  font-size: 26px; color: #04210f; background: var(--wa);
}
.wa-done.mock .wa-done-icon { background: var(--gold); color: #1a1330; }
.wa-done h2 { margin: 0 0 8px; }
.wa-done p { color: var(--muted); margin: 0 0 20px; font-size: 15px; }
.btn-ghost {
  height: 46px; padding: 0 18px; border-radius: 14px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--border-strong);
}

@media (min-width: 640px) {
  .sheet-backdrop { align-items: center; }
  .sheet { border-radius: 26px; border-bottom: 1px solid var(--border-strong); }
  .messages { padding-top: 28px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .messages { scroll-behavior: auto; }
}

/* ---------- 📜 Sources & 🔍 retrieval trace ---------- */
.sources, .trace {
  margin: 10px 0 0; border: 1px solid var(--border); border-radius: 14px;
  background: var(--surface); font-size: 14px;
}
.sources summary, .trace summary {
  cursor: pointer; padding: 8px 12px; color: var(--muted); list-style: none; user-select: none;
}
.sources summary::-webkit-details-marker, .trace summary::-webkit-details-marker { display: none; }
.sources[open] summary, .trace[open] summary { border-bottom: 1px solid var(--border); color: var(--gold-2); }
.sources ul { margin: 0; padding: 4px 12px 10px; list-style: none; }
.sources li { padding: 8px 0; border-bottom: 1px dashed var(--border); }
.sources li:last-child { border-bottom: 0; }
.sources li b { color: var(--gold-2); font-weight: 600; }
.sources .src-title { color: var(--faint); font-size: 12.5px; }
.sources li p { margin: 6px 0 0; color: var(--muted); font-family: var(--font-display); font-style: italic; line-height: 1.5; }
.sources .src-note { margin: 8px 12px 0; color: var(--faint); font-size: 12px; }

.msg.assistant .sources, .msg.assistant .trace { grid-column: 2; min-width: 0; }
.msg.assistant .trace { border-style: dashed; font-size: 12.5px; }
.trace > *:not(summary) { margin-left: 12px; margin-right: 12px; }
.trace h4 { margin: 12px 12px 4px; font: 600 12px var(--font-body); color: var(--gold); text-transform: uppercase; letter-spacing: .06em; }
.trace ul { padding-left: 16px; margin-top: 0; }
.trace code { font-size: 11.5px; background: var(--surface-2); padding: 1px 5px; border-radius: 5px; }
.trace table { border-collapse: collapse; width: calc(100% - 24px); margin-bottom: 12px; display: block; overflow-x: auto; }
.trace th, .trace td { padding: 3px 8px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
.trace tr.kept td { color: var(--gold-2); }

/* ---------- 💞 kundli matching ---------- */
.role { border: 0; margin: 0 0 14px; padding: 0; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.role legend { font-size: 13px; font-weight: 500; color: var(--muted); padding: 0; margin-bottom: 8px; width: 100%; }
.role label {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer; margin: 0;
  padding: 8px 14px; border-radius: 99px; border: 1px solid var(--border-strong); background: var(--surface);
  font-size: 15px; color: var(--text);
}
.role input { accent-color: var(--gold); margin: 0; }
.role label:has(input:checked) { border-color: rgba(232, 194, 122, .6); background: rgba(232, 194, 122, .1); }

.scorecard {
  margin: 0 0 14px; padding: 16px; border-radius: var(--radius);
  background: linear-gradient(160deg, rgba(232, 194, 122, .10), rgba(155, 140, 255, .08));
  border: 1px solid rgba(232, 194, 122, .3);
}
.sc-head { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.sc-total { display: flex; align-items: baseline; gap: 4px; font-family: var(--font-display); }
.sc-total b { font-size: 44px; line-height: 1; color: var(--gold-2); font-weight: 600; }
.sc-total span { color: var(--muted); font-size: 16px; }
.sc-verdict { font-weight: 600; }
.sc-verdict::first-letter { text-transform: uppercase; }
.sc-sub { color: var(--muted); font-size: 13px; }
.sc-meter { position: relative; height: 8px; border-radius: 99px; background: var(--surface-2); margin-bottom: 14px; }
.sc-meter i { position: absolute; inset: 0 auto 0 0; border-radius: 99px; background: linear-gradient(90deg, var(--gold), var(--gold-2)); }
.sc-meter em { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--text); opacity: .6; }
.sc-kootas { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 6px; }
.sc-kootas li { display: grid; grid-template-columns: 104px 1fr 44px; align-items: center; gap: 10px; font-size: 14px; }
.sc-kootas b { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.sc-bar { height: 6px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.sc-bar i { display: block; height: 100%; background: var(--violet); border-radius: 99px; }
.sc-line { margin: 6px 0 0; font-size: 14px; }
.sc-dosha { display: inline-block; padding: 2px 8px; border-radius: 99px; background: rgba(255, 138, 138, .12); color: #ffb3b3; font-size: 13px; margin-right: 4px; }
.sc-moons { margin: 8px 0 0; color: var(--muted); font-size: 13px; }
.sc-note { margin: 6px 0 0; color: var(--faint); font-size: 12px; }

/* ---------- sidebar (drawer on phones, fixed on wide screens) ---------- */
.menu-btn { display: none; }
body.in-chat .menu-btn { display: grid; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 20; width: min(84vw, 300px);
  display: flex; flex-direction: column;
  background: linear-gradient(180deg, #110e26, #0b0918); border-right: 1px solid var(--border);
  transform: translateX(-102%); transition: transform .28s cubic-bezier(.2, .8, .2, 1);
  padding-top: env(safe-area-inset-top);
}
body:not(.in-chat) .sidebar { display: none; }
.sidebar.open { transform: none; box-shadow: 20px 0 60px rgba(0, 0, 0, .5); }
.sb-backdrop { position: fixed; inset: 0; z-index: 19; background: rgba(3, 2, 10, .55); backdrop-filter: blur(3px); }
.sb-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 14px 8px 18px; }
.sb-head .brand { flex: none; }
.sb-scroll { flex: 1; overflow-y: auto; padding: 4px 10px 12px; }
.sb-label {
  margin: 18px 8px 6px; font: 600 11px var(--font-body); letter-spacing: .08em;
  text-transform: uppercase; color: var(--faint);
}
.sb-item {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  padding: 9px 10px; border: 0; border-radius: 10px; background: none; cursor: pointer;
  font-size: 14.5px; color: var(--text); transition: background .15s;
}
.sb-item:hover:not([disabled]) { background: var(--surface-2); }
.sb-item[disabled] { opacity: .45; cursor: default; }
.sb-emoji { width: 20px; text-align: center; flex: none; }
.sb-new { border: 1px solid var(--border-strong); margin-top: 4px; font-weight: 600; }
.sb-danger { color: #ffb3b3; }
.sb-note { margin: 6px 10px; font-size: 12px; color: var(--faint); }
.sb-recent { list-style: none; margin: 0; padding: 0; }
.sb-recent li { display: flex; align-items: stretch; border-radius: 10px; }
.sb-recent li:hover, .sb-recent li.current { background: var(--surface-2); }
.sb-chat {
  flex: 1; min-width: 0; text-align: left; border: 0; background: none; cursor: pointer;
  padding: 8px 4px 8px 10px; color: var(--text);
}
.sb-chat-title { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-chat-when { display: block; font-size: 11.5px; color: var(--faint); }
.sb-delete {
  flex: none; width: 32px; border: 0; background: none; color: var(--faint); cursor: pointer;
  font-size: 18px; border-radius: 8px; opacity: 0; transition: opacity .15s;
}
.sb-recent li:hover .sb-delete, .sb-recent li.current .sb-delete, .sb-delete:focus-visible { opacity: 1; }
.sb-delete:hover { color: #ffb3b3; }
@media (hover: none) { .sb-delete { opacity: .7; } }
.sb-foot { border-top: 1px solid var(--border); padding: 8px 10px calc(10px + env(safe-area-inset-bottom)); }
.msg.welcome .content { color: var(--muted); }

@media (min-width: 900px) {
  /* Wide screens: the sidebar is simply always there, like a desktop chat app. */
  .sidebar { transform: none; box-shadow: none; width: 280px; }
  body.in-chat .menu-btn, .sb-close, .sb-backdrop { display: none !important; }
  body.in-chat .chat { margin-left: 280px; }
  body.in-chat .chat-head .brand { visibility: hidden; } /* the sidebar already shows it */
}

/* ---------- logo: the Ganesha mark beside the name ---------- */
.logo-title { display: flex; align-items: center; justify-content: center; gap: .28em; }
.logo-mark {
  width: 1.05em; height: 1.05em; flex: none;
  filter: drop-shadow(0 0 14px rgba(232, 194, 122, .35));
}
.brand { display: inline-flex; align-items: center; gap: 8px; }
.brand-mark { width: 26px; height: 26px; flex: none; }
