:root {
  --paper: #F3F1EC; --page: #FBF8F1; --card: #FFFFFF; --ink: #1C1F23; --muted: #4A5058; --faint: #6A6354;
  --line: #DDD7CB; --line2: #C9C3B6; --teal: #1F5E63; --teal-bg: #E3EEEE; --teal-line: #B9D3D4;
  --gold: #7A4F00; --gold-bg: #FBF3E4; --gold-line: #E5CFA6; --sketch: #ECE8DF; --sketch-line: #A9A190;
  --danger: #8A2B1F; --danger-bg: #F8E9E6; --text-size: 18px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--paper); color: var(--ink); font-family: Inter, system-ui, sans-serif; }
button { font: 500 14px Inter, sans-serif; min-height: 44px; border-radius: 10px; padding: 10px 14px; cursor: pointer; border: 1px solid var(--line2); background: var(--paper); color: var(--ink); }
button:disabled { opacity: 0.5; cursor: default; }
button.primary { background: var(--teal); color: #fff; border-color: var(--teal); font-weight: 600; }
button.soft { background: var(--teal-bg); color: var(--teal); border-color: var(--teal-line); }
button.gold { background: var(--gold-bg); color: var(--gold); border-color: var(--gold-line); }
button.link { background: transparent; border: 0; color: var(--teal); padding: 10px 4px; }
button:focus-visible, textarea:focus-visible, input:focus-visible { outline: 3px solid #E5CFA6; outline-offset: 2px; }
textarea, input, select { font: 16px Inter, sans-serif; color: var(--ink); background: #FBFAF7; border: 1px solid var(--line2); border-radius: 10px; padding: 12px; width: 100%; }
textarea.story { font-family: Literata, Georgia, serif; line-height: 1.5; }
label { font-size: 14px; font-weight: 600; }
.wrap { max-width: 1320px; margin: 0 auto; padding: 20px 16px 48px; display: flex; flex-direction: column; gap: 18px; }
.top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; }
.brand { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.brand b { font: 600 24px Literata, Georgia, serif; }
.muted { color: var(--muted); font-size: 14px; }
.pill { font-size: 13px; color: var(--muted); background: #E7E3DA; border-radius: 999px; padding: 8px 14px; }
.cols { display: flex; flex-direction: row-reverse; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.main { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.side { flex: 1 1 320px; min-width: 0; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.placebar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 8px; }
.placebar h1 { margin: 0; font: 600 22px Literata, Georgia, serif; }
.sketch { aspect-ratio: 16 / 6; border: 2px dashed var(--sketch-line); border-radius: 14px; background: var(--sketch); display: flex; align-items: flex-end; padding: 14px; color: #5A5446; font: 600 12px Inter, sans-serif; letter-spacing: 0.06em; text-transform: uppercase; overflow: hidden; }
.picture { width: 100%; aspect-ratio: 16 / 6; object-fit: cover; border-radius: 14px; display: block; }
.thread { background: var(--card); border: 1px solid var(--line); border-radius: 14px; display: flex; flex-direction: column; overflow: hidden; }
.thread-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 20px; border-bottom: 1px solid #ECE8DF; flex-wrap: wrap; }
.eyebrow { font-size: 13px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.scroll { height: min(62vh, 620px); overflow-y: auto; display: flex; flex-direction: column-reverse; padding: 20px 24px; }
.beats { display: flex; flex-direction: column; gap: 22px; }
.beat .time { font: italic 14px Literata, Georgia, serif; color: var(--faint); }
.beat p { margin: 6px 0 0; font: var(--text-size)/1.65 Literata, Georgia, serif; white-space: pre-line; }
.you { border-left: 3px solid var(--teal); background: #F1F6F6; border-radius: 0 10px 10px 0; padding: 12px 16px; }
.you .who { font: 600 13px Inter, sans-serif; color: var(--teal); }
.you p { margin: 4px 0 0; font: calc(var(--text-size) - 1px)/1.55 Literata, Georgia, serif; white-space: pre-line; }
.working { font: italic 16px Literata, Georgia, serif; color: var(--faint); }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.between { justify-content: space-between; }
.suggest button { flex: 1 1 240px; text-align: left; font-size: 15px; background: var(--card); padding: 12px 16px; border-radius: 12px; }
.tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.tabs button { border-radius: 999px; }
.tabs button[aria-selected="true"] { background: var(--teal); color: #fff; border-color: var(--teal); }
.person { display: flex; gap: 12px; align-items: center; }
.face { width: 56px; height: 56px; flex: none; border: 2px dashed var(--sketch-line); border-radius: 999px; background: var(--sketch); object-fit: cover; }
img.face { border: 0; }
.small { font-size: 13px; color: var(--muted); }
.clock { border: 1px solid var(--line); border-radius: 10px; padding: 12px; display: flex; flex-direction: column; gap: 4px; }
.clock .when { font-size: 13px; color: var(--gold); font-weight: 600; }
.think { background: #1F2A2E; color: #F1F4F4; border-radius: 14px; padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.think textarea { background: #2A373C; color: #F1F4F4; border-color: #5E6D72; }
.think .reply { font: 16px/1.6 Literata, Georgia, serif; background: #2A373C; border-radius: 10px; padding: 14px; white-space: pre-line; }
.think ul { margin: 4px 0 0; padding-left: 20px; }
.think button { background: transparent; color: #F1F4F4; border-color: #5E6D72; }
.think button.light { background: #F1F4F4; color: #1F2A2E; }
.banner { border-radius: 12px; padding: 12px 16px; font-size: 15px; }
.banner.error { background: var(--danger-bg); color: var(--danger); border: 1px solid #E6C3BC; }
.banner.info { background: var(--gold-bg); color: var(--gold); border: 1px solid var(--gold-line); }
.center { min-height: 80vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.login { width: min(420px, 100%); }
.book { position: fixed; inset: 0; background: #2B2621; color: #F3F1EC; overflow: auto; padding: 20px 16px; display: flex; flex-direction: column; align-items: center; gap: 16px; z-index: 10; }
.spread { width: 100%; max-width: 1200px; display: flex; min-height: 70vh; border-radius: 12px; box-shadow: 0 24px 60px rgba(0,0,0,0.45); perspective: 2400px; }
.page { flex: 1 1 0; min-width: 0; background: var(--page); color: var(--ink); padding: 40px 44px 30px; display: flex; flex-direction: column; gap: 14px; }
.page.left { border-radius: 10px 0 0 10px; background: linear-gradient(to left, rgba(60,45,20,0.10), rgba(60,45,20,0) 7%), var(--page); }
.page.right { border-radius: 0 10px 10px 0; background: linear-gradient(to right, rgba(60,45,20,0.12), rgba(60,45,20,0) 7%), var(--page); transform-origin: left center; }
.page.turn { transition: transform 600ms ease-in-out; transform: rotateY(-100deg); }
.page .num { margin-top: auto; font: 13px Literata, Georgia, serif; color: #8A8270; }
.book .bar { width: 100%; max-width: 1200px; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; }
.book button { background: #F3F1EC; border: 0; }
.book button.dark { background: transparent; color: #F3F1EC; border: 1px solid #6E6456; }
@media (max-width: 760px) { .spread { flex-direction: column; } .page.left, .page.right { border-radius: 10px; } .page.left { display: none; } .scroll { height: 58vh; } }
@media (prefers-reduced-motion: reduce) { .page.turn { transition: none; transform: none; } }
