:root {
  --bg: #FBF7F0; --ink: #2A2620; --muted: #7A6F62; --line: #E8DFD2; --card: #FFFFFF; --soft: #F3EDE3;
  --accent: #C79A3B; --ok: #3F7D4E;
  --serif: Georgia, "Times New Roman", "Noto Serif", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
}
:root[data-theme="dark"] { --bg: #14161A; --ink: #F3EDE3; --muted: #A79D90; --line: #2C2F36; --card: #1D2026; --soft: #22252C; }
:root[data-theme="pastel"] { --bg: #F6F1F8; --ink: #3A3340; --muted: #857A8E; --line: #E6DDEC; --card: #FFFFFF; --soft: #EFE7F3; }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--ink); font-family: var(--sans); font-size: 17px; line-height: 1.5; }
body { padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
#app { max-width: 480px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; padding: 20px 22px 28px; }

h1, h2, .serif { font-family: var(--serif); font-weight: 400; letter-spacing: -0.01em; }
h1 { font-size: 28px; line-height: 1.25; margin: 0 0 10px; }
h2 { font-size: 22px; line-height: 1.3; margin: 0 0 8px; }
p { margin: 0 0 12px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.tiny { font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.center { text-align: center; }
.grow { flex: 1; }
.stack > * + * { margin-top: 14px; }
.fade { animation: fade .35s ease both; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.word { font-family: var(--serif); font-weight: 700; font-size: clamp(44px, 12vw, 72px); line-height: 1; letter-spacing: -0.02em;
  background: linear-gradient(90deg,#7A1E3A 0%,#C2410C 18%,#C79A3B 36%,#3F7D4E 54%,#2C6E8A 72%,#4B3F8F 88%,#5A2A6E 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent; }
.tag { font-family: var(--serif); font-size: 19px; line-height: 1.45; max-width: 30ch; margin: 18px auto 0; }
.tag em { font-style: normal; color: var(--muted); display: block; margin-top: 6px; }

.btn { display: block; width: 100%; padding: 15px 18px; border-radius: 14px; border: 1px solid var(--ink); background: var(--ink); color: var(--bg);
  font: inherit; font-size: 17px; cursor: pointer; text-align: center; }
.btn:disabled { opacity: .35; cursor: default; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.link { background: none; border: none; color: var(--muted); padding: 10px; font-size: 15px; }
.row { display: flex; gap: 10px; }
.row > .btn { width: auto; flex: 1; }

.input, textarea.input { width: 100%; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--card); color: var(--ink);
  font: inherit; font-size: 18px; outline: none; }
textarea.input { min-height: 120px; resize: none; line-height: 1.45; font-family: var(--serif); }
.input:focus { border-color: var(--muted); }

.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip { padding: 11px 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--ink); font: inherit; font-size: 16px; cursor: pointer; }
.chip.on { border-color: var(--ink); background: var(--ink); color: var(--bg); }

.swatches { display: flex; gap: 12px; flex-wrap: wrap; }
.swatch { width: 44px; height: 44px; border-radius: 50%; border: 3px solid transparent; cursor: pointer; }
.swatch.on { border-color: var(--ink); }
.palette { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); cursor: pointer; }
.palette.on { border-color: var(--ink); }
.palette .dots { display: flex; gap: 4px; }
.palette .dots i { width: 18px; height: 18px; border-radius: 50%; display: block; border: 1px solid rgba(0,0,0,.08); }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 18px; }
.photo { width: 120px; height: 120px; border-radius: 50%; object-fit: cover; background: var(--soft); display: block; margin: 0 auto; }
.photo.placeholder { display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 13px; text-align: center; padding: 10px; }

.progress { display: flex; gap: 4px; margin-bottom: 18px; }
.progress i { flex: 1; height: 3px; border-radius: 3px; background: var(--line); }
.progress i.done { background: var(--ink); }
.area { display: inline-block; font-size: 12px; letter-spacing: .16em; text-transform: uppercase; padding: 4px 10px; border-radius: 999px; color: #fff; margin-bottom: 14px; }
.q { font-family: var(--serif); font-size: 26px; line-height: 1.3; margin: 0 0 6px; }
.star { color: var(--accent); }
.mic { width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--line); background: var(--card); font-size: 20px; cursor: pointer; flex: none; }
.mic.live { border-color: #B5485D; box-shadow: 0 0 0 4px rgba(181,72,93,.15); }

.board { border-radius: 22px; padding: 22px 20px; color: var(--ink); background: var(--card); border: 1px solid var(--line); position: relative; overflow: hidden; }
.board .band { position: absolute; left: 0; right: 0; top: 0; height: 8px; }
.board .who { display: flex; align-items: center; gap: 14px; margin: 6px 0 16px; }
.board .who img, .board .who .ph { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; background: var(--soft); flex: none; }
.board .name { font-family: var(--serif); font-size: 24px; }
.line { padding: 12px 0; border-top: 1px solid var(--line); }
.line .lbl { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; margin-bottom: 3px; }
.line .txt { font-family: var(--serif); font-size: 18px; line-height: 1.4; }
.footer { margin-top: 18px; }
.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 999px; font-size: 14px; opacity: 0; transition: opacity .25s; pointer-events: none; }
.toast.show { opacity: 1; }

.chat { display: flex; flex-direction: column; gap: 12px; padding: 8px 0; }
.msg { max-width: 88%; padding: 12px 14px; border-radius: 18px; line-height: 1.45; }
.msg.user { align-self: flex-end; background: var(--ink); color: var(--bg); border-bottom-right-radius: 6px; }
.msg.assistant { align-self: flex-start; background: var(--card); border: 1px solid var(--line); border-bottom-left-radius: 6px; font-family: var(--serif); font-size: 18px; }
.msg.assistant .tiny { font-family: var(--sans); }
