:root {
  font-family: ui-serif, "Noto Serif SC", "Songti SC", serif;
  color: #f4eee7;
  background: #0e1118;
  font-synthesis: none;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 15% 0%, rgba(114, 81, 147, .24), transparent 36rem),
    linear-gradient(180deg, #141824, #090c12);
}
button, input, textarea { font: inherit; }
button { touch-action: manipulation; }
.shell {
  width: min(46rem, 100%);
  margin: 0 auto;
  padding: max(1.25rem, env(safe-area-inset-top)) 1rem max(2rem, env(safe-area-inset-bottom));
}
header, .toolbar, .tabs {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
}
h1 { margin: .15rem 0 1rem; font-size: clamp(1.55rem, 7vw, 2.35rem); }
h2 { margin-top: 0; }
.eyebrow { margin: 0; color: #bca7d6; font: 600 .72rem/1.2 ui-sans-serif, system-ui; letter-spacing: .18em; }
.panel {
  margin: 1rem 0;
  padding: 1rem;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 1rem;
  background: rgba(24, 28, 40, .82);
  box-shadow: 0 1rem 4rem rgba(0,0,0,.22);
  backdrop-filter: blur(12px);
}
.login label, .reason { display: grid; gap: .45rem; color: #cbc5d2; }
input, textarea {
  width: 100%;
  padding: .8rem;
  color: #fff;
  border: 1px solid #464153;
  border-radius: .7rem;
  background: #10131b;
}
button {
  min-height: 2.75rem;
  padding: .7rem 1rem;
  color: #16131b;
  border: 0;
  border-radius: .75rem;
  background: #d8c1ef;
  font-weight: 700;
}
button:disabled { opacity: .45; }
.ghost { color: #dfd8e7; border: 1px solid #494354; background: transparent; }
.login button { width: 100%; margin-top: .85rem; }
.tabs { justify-content: stretch; }
.tab { flex: 1; color: #bdb5c7; background: #191d27; }
.tab.active { color: #17121c; background: #d8c1ef; }
.toolbar { margin: .85rem .2rem 0; color: #aaa3b3; font: .85rem/1.3 ui-sans-serif, system-ui; }
.toolbar .ghost { min-height: 2.25rem; padding: .4rem .7rem; }
.story { min-height: 19rem; display: flex; flex-direction: column; justify-content: center; }
.speaker { min-height: 1.25rem; margin: 0 0 .75rem; color: #cbb6e4; font-weight: 700; }
.story-text { white-space: pre-wrap; font-size: 1.08rem; line-height: 1.95; }
.choices { display: grid; gap: .65rem; margin-top: 1.2rem; }
.choices button { text-align: left; }
.reason { margin-top: 1rem; font: .82rem/1.4 ui-sans-serif, system-ui; }
#continue { margin-top: 1.1rem; }
.notice, .error { min-height: 1.25rem; color: #f3b6b6; font: .88rem/1.45 ui-sans-serif, system-ui; }
.notice.ok { color: #afd8c4; }
summary { cursor: pointer; font-weight: 700; }
.records { display: grid; gap: .75rem; margin-top: 1rem; }
.record { padding: .75rem; border-left: 2px solid #6f607e; background: rgba(0,0,0,.15); }
.record small { color: #9f98a8; font-family: ui-sans-serif, system-ui; }
.record p { margin: .35rem 0 0; white-space: pre-wrap; line-height: 1.65; }
#journal-editor { display: grid; gap: .7rem; margin-top: 1rem; }
.hidden { display: none !important; }
@media (min-width: 44rem) { .shell { padding-inline: 1.5rem; } .panel { padding: 1.35rem; } }
