/* A phone chat, in ONHUR's own gold on a quiet ground. Light by default, dark when the device is. */
:root {
  --ground: #eef0f3;
  --panel: #ffffff;
  --ink: #16181c;
  --muted: #626875;
  --line: #dfe2e8;
  --gold: #8f6410;
  --gold-ink: #ffffff;
  --mine: #1d2733;
  --mine-ink: #f4f1e8;
  --theirs: #f3efe4;
  --note: #f8ead2;
  --note-ink: #6d4300;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ground: #0b0c0e;
    --panel: #14161a;
    --ink: #ece9e2;
    --muted: #9ca2ad;
    --line: #2a2d34;
    --gold: #d9b45c;
    --gold-ink: #17130a;
    --mine: #d9b45c;
    --mine-ink: #17130a;
    --theirs: #22252b;
    --note: #2b2110;
    --note-ink: #e3ab4e;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--ground); color: var(--ink);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", "Noto Sans Arabic", Tahoma, sans-serif;
  display: flex; justify-content: center;
}
.phone {
  width: 100%; max-width: 460px; height: 100%;
  background: var(--panel); display: flex; flex-direction: column;
  border-inline: 1px solid var(--line);
}
.top {
  display: flex; align-items: center; gap: 12px;
  padding: calc(12px + env(safe-area-inset-top, 0px)) 16px 12px;
  border-bottom: 1px solid var(--line);
}
.avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--gold); color: var(--gold-ink);
  display: grid; place-items: center;
  font-family: Georgia, "Times New Roman", serif; font-size: 20px; letter-spacing: 0.02em;
}
.name { font-weight: 600; letter-spacing: 0.14em; }
.sub { font-size: 13px; color: var(--muted); }
.demo-note { background: var(--note); color: var(--note-ink); font-size: 13px; padding: 7px 16px; text-align: center; }

.gate { padding: 14px 16px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.gate[hidden] { display: none; }
.gate-row { display: flex; gap: 8px; }
.gate input { flex: 1; min-width: 0; font: inherit; color: var(--ink); background: var(--ground); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; }
.gate button { font: inherit; border: 0; border-radius: 10px; padding: 8px 16px; background: var(--gold); color: var(--gold-ink); cursor: pointer; }
.gate-note { margin: 0; color: var(--muted); }

.thread { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.bubble {
  max-width: 82%; padding: 9px 13px; border-radius: 16px;
  white-space: pre-wrap; overflow-wrap: anywhere; unicode-bidi: plaintext;
}
.bubble.them { align-self: flex-start; background: var(--theirs); border-bottom-left-radius: 5px; }
.bubble.me { align-self: flex-end; background: var(--mine); color: var(--mine-ink); border-bottom-right-radius: 5px; }
.bubble.typing { color: var(--muted); font-style: italic; }
.chip { align-self: flex-start; font-size: 12.5px; color: var(--gold); border: 1px solid var(--gold); border-radius: 999px; padding: 2px 10px; }
.problem { align-self: center; font-size: 13px; color: var(--muted); }

.starters { display: flex; gap: 8px; padding: 0 16px 10px; flex-wrap: wrap; }
.starters[hidden] { display: none; }
.starters button {
  font: inherit; font-size: 14px; color: var(--ink);
  background: transparent; border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; cursor: pointer;
}
.starters button:hover { border-color: var(--gold); }

.composer {
  display: flex; align-items: flex-end; gap: 8px;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--line);
}
.composer textarea {
  flex: 1; resize: none; max-height: 120px;
  font: inherit; color: var(--ink); background: var(--ground);
  border: 1px solid var(--line); border-radius: 20px; padding: 9px 14px;
}
.composer button {
  width: 42px; height: 42px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--gold); color: var(--gold-ink); display: grid; place-items: center; flex: none;
}
.composer button:disabled { opacity: 0.45; cursor: default; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
@media (prefers-reduced-motion: no-preference) { .thread { scroll-behavior: smooth; } }
.composer[hidden] { display: none; }
