:root {
  color-scheme: dark;
  --ink: #f6efe8;
  --muted: #d9c3b6;
  --bg: #12080c;
  --panel: #1c1015;
  --her: #f3e4d4;
  --her-ink: #2a1612;
  --me: #7c2f45;
  --line: rgba(243, 228, 212, 0.16);
  --gold: #e7c7a2;
  font-family: "Noto Sans Devanagari", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body {
  min-height: 100%;
  background:
    radial-gradient(900px 420px at 50% -10%, #4a2433 0%, transparent 60%),
    var(--bg);
  color: var(--ink);
}

.phone {
  width: min(480px, 100%);
  height: 100dvh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  background: var(--panel);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.hero {
  position: relative;
  height: 34dvh;
  min-height: 210px;
  overflow: hidden;
  flex: none;
}
.hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 18%;
}
.hero-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(18, 8, 12, 0.05) 20%, rgba(18, 8, 12, 0.88) 100%);
}
.hero-copy {
  position: absolute;
  left: 20px;
  right: 16px;
  bottom: 16px;
}
.hero-actions {
  position: absolute;
  top: 14px;
  right: 14px;
  display: flex;
  gap: 8px;
}
.eyebrow {
  margin: 0 0 2px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 11px;
  color: var(--gold);
}
.dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 6px;
  border-radius: 50%;
  background: #8dce86;
  box-shadow: 0 0 0 4px rgba(141, 206, 134, 0.15);
}
h1 {
  margin: 0;
  font-family: "Cormorant Garamond", serif;
  font-size: 46px;
  font-weight: 500;
  line-height: 0.9;
}
.meta { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.hero-actions button {
  border: 1px solid var(--line);
  background: rgba(18, 8, 12, 0.45);
  color: var(--ink);
  border-radius: 999px;
  padding: 8px 12px;
  font: inherit;
  font-size: 13px;
}

.log {
  flex: 1;
  overflow-y: auto;
  padding: 18px 16px 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.bubble {
  max-width: 84%;
  padding: 10px 13px;
  border-radius: 18px;
  line-height: 1.45;
  font-size: 15.5px;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.bubble.assistant {
  align-self: flex-start;
  background: var(--her);
  color: var(--her-ink);
  border-bottom-left-radius: 6px;
}
.bubble.user {
  align-self: flex-end;
  background: var(--me);
  color: white;
  border-bottom-right-radius: 6px;
}
.bubble.typing { opacity: 0.7; }

.composer {
  padding: 8px 12px calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: #160b10;
}
.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
}
.chips:empty { display: none; }
.chips button, .row button, .hero-actions button { cursor: pointer; }
.chips button {
  flex: none;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--gold);
  border-radius: 999px;
  padding: 7px 11px;
  font: inherit;
  font-size: 13px;
}
.row { display: flex; gap: 8px; }
.composer input {
  flex: 1;
  border: 1px solid var(--line);
  background: #24141b;
  color: var(--ink);
  border-radius: 999px;
  padding: 13px 16px;
  font: inherit;
  font-size: 16px;
}
.composer input:focus { outline: 1px solid var(--gold); }
#send {
  border: 0;
  background: var(--gold);
  color: #2a1612;
  border-radius: 999px;
  padding: 0 16px;
  font: inherit;
  font-weight: 600;
}
#send:disabled { opacity: 0.5; }
.error {
  color: #ffb4b4;
  font-size: 13px;
  padding: 0 6px 6px;
  margin: 0;
}
html, body { overflow-x: hidden; }
body:not(.is-chat) {
  overflow-y: auto;
  background: #160c10;
}
body:not(.is-chat) .hero { display: none !important; }
body:not(.is-chat) .phone {
  width: min(430px, 100%);
  height: auto;
  min-height: 100dvh;
  background: #160c10;
}

.login {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: max(16px, env(safe-area-inset-top)) 16px max(20px, env(safe-area-inset-bottom));
}
.login form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.login-photo {
  display: block;
  width: 100%;
  height: clamp(168px, 34dvh, 280px);
  object-fit: cover;
  object-position: center 16%;
  border-radius: 22px;
  background: #2a171d;
}
.login-name {
  margin: 4px 0 0;
  text-align: center;
  font-family: "Cormorant Garamond", serif;
  font-size: 40px;
  font-weight: 500;
  line-height: 1;
}
.login-line {
  margin: -4px 0 4px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}
.modes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.modes button {
  min-height: 44px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 15px;
}
.modes button.is-on {
  background: var(--her);
  border-color: var(--her);
  color: var(--her-ink);
  font-weight: 600;
}
.field span {
  display: block;
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 13px;
}
.field input {
  width: 100%;
  min-height: 48px;
  border-radius: 12px;
  border: 1px solid rgba(231, 199, 162, 0.28);
  background: #24141b;
  color: var(--ink);
  padding: 12px 14px;
  font: inherit;
  font-size: 16px;
}
.field input::placeholder { color: rgba(217, 195, 182, 0.45); }
.field input:focus {
  outline: none;
  border-color: var(--gold);
}
.login-error {
  margin: 0;
  color: #ffd0d0;
  font-size: 14px;
  line-height: 1.4;
}
.login-go {
  min-height: 50px;
  margin-top: 4px;
  border: 0;
  border-radius: 12px;
  background: var(--her);
  color: var(--her-ink);
  font: inherit;
  font-size: 16px;
  font-weight: 600;
}
.login-go:disabled { opacity: 0.55; }
.legal {
  margin: 0;
  text-align: center;
  color: rgba(217, 195, 182, 0.75);
  font-size: 13px;
}
.modes button, .login-go { cursor: pointer; }

@media (max-width: 359px) {
  .login { padding-left: 12px; padding-right: 12px; }
  .login-name { font-size: 34px; }
  .login-photo { height: 150px; }
}
.memory {
  margin: 0;
  padding: 8px 16px 0;
  color: var(--gold);
  font-size: 13px;
}
