/* Sakura colors sampled from the reference palette. */
:root {
  color-scheme: light;
  --sakura:#ffae9d;
  --ivory:#faf2ea;
  --rosewood:#b39188;
  --clay:#ccaea4;
  --ink:#392e2c;
  --paper:#fff;
  --surface:#fff;
  --muted:#68534d;
  --accent:#7c4238;
  --strong:#654039;
  --wash:#fff0eb;
  --line:#e6d3cb;
  --control-line:#b39188;
  --button:var(--sakura);
  --on-button:var(--ink);
  --shadow:0 10px 28px #392e2c12;
  font-family:system-ui,sans-serif;
}
::selection { background:var(--sakura); color:var(--ink); }
* { box-sizing:border-box; }
body { margin:0; background:var(--paper); color:var(--ink); line-height:1.55; }
a { color:var(--accent); text-underline-offset:.19em; }
button,input,select,textarea { font:inherit; }
button { cursor:pointer; }
button,a,input,textarea,select,summary { -webkit-tap-highlight-color:transparent; }
:focus-visible { outline:3px solid var(--accent); outline-offset:3px; }
h1,h2,.brand { font-family:"Palatino Linotype","Book Antiqua",Palatino,Georgia,serif; font-weight:500; line-height:1.09; margin:0; }
h1 { font-size:clamp(2.2rem,6vw,4rem); letter-spacing:-.026em; }
h2 { font-size:1.65rem; margin-bottom:.85rem; }
p { margin:.65rem 0 1.15rem; }
small,.muted { color:var(--muted); }
small { display:block; font-size:.85rem; }
.shell { max-width:1180px; margin:auto; padding:0 clamp(16px,4vw,42px); }
main.shell { padding-top:32px; padding-bottom:48px; }
.skip { position:absolute; transform:translateY(-140%); background:var(--surface); padding:.6rem; z-index:5; }
.skip:focus { transform:none; }
.top { background:var(--surface); border-bottom:1px solid var(--line); }
.top-inner { min-height:68px; display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:.4rem 1rem; padding-block:.5rem; }
.brand { display:inline-flex; align-items:center; gap:.55rem; font-size:1.38rem; text-decoration:none; color:var(--ink); white-space:nowrap; }
.top nav { display:flex; gap:0 .85rem; align-items:center; flex-wrap:wrap; }
.top nav a,.quiet { font-size:.88rem; color:var(--muted); min-height:44px; display:inline-flex; align-items:center; }
.top nav a { text-decoration:none; }
.quiet { padding:0; background:none; border:0; }
.top nav a:hover,.quiet:hover { color:var(--accent); text-decoration:underline; }
.surface { background:var(--surface); border:1px solid var(--line); border-radius:14px; }
.hero,.welcome { position:relative; isolation:isolate; overflow:hidden; border:1px solid var(--line); background:var(--ivory); border-radius:16px; padding:clamp(24px,5vw,60px); }
.hero p:not(.eyebrow),.welcome p { max-width:34rem; color:var(--muted); }
.eyebrow { color:var(--strong); margin:0 0 .55rem; font-size:.84rem; font-weight:700; letter-spacing:.045em; }
.primary,.secondary { display:inline-flex; justify-content:center; align-items:center; text-align:center; gap:.3rem; min-height:44px; padding:.56rem .95rem; border-radius:10px; font-weight:650; text-decoration:none; }
.primary { color:var(--on-button); background:var(--button); border:1px solid transparent; }
.primary:hover { background:#ff9986; }
.secondary { color:var(--accent); background:var(--surface); border:1px solid var(--line); }
.secondary:hover { background:var(--wash); }
.dashboard { display:grid; gap:2rem; margin-top:2rem; align-items:start; }
.segmented { display:flex; flex-wrap:wrap; gap:.2rem; margin-bottom:1rem; }
.segmented a { display:inline-flex; align-items:center; min-height:44px; border-radius:9px; color:var(--muted); text-decoration:none; padding:.5rem .7rem; font-size:.88rem; }
.segmented a[aria-current] { background:var(--wash); color:var(--strong); font-weight:700; }
.list { overflow:hidden; }
.entry,.member { display:flex; align-items:center; gap:.75rem; justify-content:space-between; }
.entry { padding:.82rem 1rem; min-height:54px; color:var(--ink); text-decoration:none; }
.entry:hover { background:var(--wash); }
.entry:focus-visible { outline-offset:-4px; }
.entry+.entry,.member+.member { border-top:1px solid var(--line); }
.tag { border-radius:30px; background:var(--wash); padding:.18rem .65rem; font-size:.78rem; color:var(--strong); flex-shrink:0; }
.plus { color:var(--accent); font-size:1.25rem; }
.empty { padding:1.3rem; color:var(--muted); }
.guide,.back { display:inline-flex; align-items:center; min-height:44px; }
.login-layout { display:grid; gap:1rem; min-height:calc(100svh - 70px); align-content:center; }
.login-panel,.sharing { padding:clamp(18px,3vw,32px); }
.stack,.form-group,.sheet-form { display:grid; gap:1rem; }
.stack > p { margin:0; }
label { display:grid; gap:.28rem; font-weight:600; }
input:not([type=checkbox]):not([type=hidden]),textarea,select { width:100%; padding:.55rem .65rem; min-height:44px; border:1px solid var(--control-line); border-radius:8px; color:var(--ink); background:var(--paper); caret-color:var(--accent); }
textarea { resize:vertical; }
input[type=checkbox] { width:19px; height:19px; accent-color:var(--accent); margin:0; flex:none; }
.sheet-title { display:flex; gap:1rem; justify-content:space-between; align-items:end; flex-wrap:wrap; margin:.3rem 0 1.45rem; }
.editor { display:grid; align-items:start; gap:1.25rem; }
.preview,.section { padding:1rem; }
summary { font-weight:700; cursor:pointer; padding:.58rem 0; }
.preview a { display:inline-flex; align-items:center; min-height:44px; }
.preview-pages { max-height:63vh; overflow:auto; }
.preview-pages img { display:block; width:100%; height:auto; }
.preview-pages img + img { margin-top:.6rem; }
.form-group { border-top:1px solid var(--line); margin-top:.45rem; padding-top:.6rem; }
.field-row:empty { display:none; }
.compound { background:var(--ivory); padding:.7rem; border-radius:10px; display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:.7rem; }
.compound .check,.compound .field-detail:first-of-type,.compound .answer { grid-column:1/-1; }
.compound:has(> .check input[type="checkbox"]:not(:checked)) > label:not(.check) { display:none; }
.check { display:flex; align-items:center; min-height:44px; gap:.65rem; }
.answer { margin:0; }
.answer span { display:block; white-space:pre-wrap; overflow-wrap:anywhere; }
.save-bar { position:sticky; bottom:0; z-index:2; display:flex; align-items:center; justify-content:space-between; gap:.65rem; padding:.65rem; background:var(--surface); border:1px solid var(--line); border-radius:12px; box-shadow:var(--shadow); }
.save-bar span { color:var(--muted); font-size:.87rem; }
.sharing { margin-top:1.6rem; }
.dashboard .sharing { margin:0; }
.member { padding:.7rem 0; overflow-wrap:anywhere; }
.share-form { display:flex; gap:.75rem; flex-wrap:wrap; align-items:end; margin-top:1rem; }
.invitation { display:grid; gap:.6rem; margin-top:1.25rem; }
.narrow { max-width:660px; }
.narrow h1 { margin-bottom:1rem; }
.notice,.error { border:1px solid var(--line); background:var(--wash); padding:.8rem; border-radius:9px; }
.error,.errorlist { color:var(--strong); }
.helptext { display:block; color:var(--muted); margin-top:.3rem; font-size:.85rem; }
@media(min-width:761px) {
  .login-layout { grid-template-columns:1.15fr 1fr; }
  .dashboard { grid-template-columns:1.15fr .85fr; }
  .editor { grid-template-columns:minmax(0,1.15fr) minmax(0,.85fr); }
  .editor.reading { grid-template-columns:minmax(0,760px); }
  .preview { grid-column:2; grid-row:1; position:sticky; top:1rem; }
  .sheet-form { grid-column:1; grid-row:1; }
}
.pdf-page { position:relative; background:white; outline:1px solid var(--line); outline-offset:-1px; }
.pdf-page + .pdf-page { margin-top:.6rem; }
.pdf-page svg { position:absolute; inset:0; width:100%; height:100%; pointer-events:none; font-family:"DejaVu Sans", sans-serif; }
.preview-annex { padding:1rem; }
.preview-annex p { white-space:pre-wrap; overflow-wrap:anywhere; }
.preview-error { color:var(--strong); }
@media(min-width:900px) {
  main.shell:has(.preview) { max-width:1520px; }
  .editor:has(.preview) { grid-template-columns:minmax(0,.85fr) minmax(0,1.45fr); }
  .preview-pages { max-height:calc(100dvh - 135px); }
}

.pdf-field-target {
  position:absolute;
  padding:0;
  border:1px solid #7c42386b;
  border-radius:3px;
  background:transparent;
}
.pdf-field-target:hover,.pdf-field-target:focus-visible {
  background:#ffae9d50;
  border-color:var(--accent);
}
.pdf-field-target:focus-visible { outline-offset:1px; }
.pdf-inline-editor:not([hidden]) {
  display:grid;
  gap:.45rem;
  padding:.65rem;
  margin-bottom:.6rem;
  background:var(--wash);
  border-radius:9px;
}
.pdf-inline-editor button { justify-self:start; }
.preview:has(.pdf-inline-editor:not([hidden])) .preview-pages { max-height:52vh; }

.editor [hidden] { display:none !important; }
.save-bar { flex-wrap:wrap; }
.page-actions { display:flex; gap:.55rem; flex-wrap:wrap; align-items:center; }
.pdf-page + .pdf-page { margin-top:0; }

.cover-copy { position:relative; z-index:1; }
.hero { display:grid; align-items:center; overflow-wrap:anywhere; }
.welcome { display:grid; align-content:start; min-height:240px; }
.hero h1,.welcome h1 { text-wrap:balance; }
.hero p:not(.eyebrow),.welcome p { color:var(--ink); }
.login-panel { align-self:center; }
.login-panel .primary { justify-self:start; min-width:9rem; }
.section summary,.preview summary { color:var(--strong); }
.preview { background:var(--ivory); }
.preview-pages { scrollbar-color:var(--rosewood) var(--ivory); }
.preview-hint { color:var(--muted); }
.tag { background:var(--ivory); }
.segmented a[aria-current] { box-shadow:inset 0 -2px var(--rosewood); }
.entry:hover { background:var(--ivory); }
.notice { background:var(--ivory); }
.sakura-bloom {
  --bloom:var(--sakura);
  --bloom-center:var(--strong);
  display:block;
  position:relative;
  width:var(--size, 10rem);
  aspect-ratio:1;
}
.sakura-bloom i { position:absolute; inset:0; transform:rotate(var(--turn, 0deg)); }
.sakura-bloom i:nth-child(2) { --turn:72deg; }
.sakura-bloom i:nth-child(3) { --turn:144deg; }
.sakura-bloom i:nth-child(4) { --turn:216deg; }
.sakura-bloom i:nth-child(5) { --turn:288deg; }
.sakura-bloom i::before {
  content:"";
  position:absolute;
  inset:4% 31% 46%;
  background:var(--bloom);
  border-radius:48% 48% 52% 52% / 38% 38% 66% 66%;
  clip-path:polygon(0 0, 37% 0, 50% 12%, 63% 0, 100% 0, 100% 100%, 0 100%);
}
.sakura-bloom::after {
  content:"";
  position:absolute;
  inset:45%;
  border-radius:50%;
  background:var(--bloom-center);
}
.brand-bloom { --size:1.8rem; flex:none; }
.sakura-garden {
  position:absolute;
  pointer-events:none;
  right:0;
  bottom:0;
  width:50%;
  height:100%;
  opacity:.25;
}
.sakura-garden .sakura-bloom,.fallen-petal { position:absolute; }
.bloom-main { --size:clamp(7rem,17vw,15rem); right:8%; top:14%; transform:rotate(-16deg); }
.bloom-small { --size:clamp(2.6rem,6vw,5rem); --bloom:var(--rosewood); right:68%; bottom:20%; transform:rotate(19deg); }
.bloom-pale { --size:clamp(3rem,8vw,7rem); --bloom:var(--clay); right:-8%; bottom:-12%; transform:rotate(24deg); }
.fallen-petal { width:1.15rem; height:1.6rem; border-radius:65% 35% 62% 38%; background:var(--sakura); }
.petal-first { right:65%; top:20%; transform:rotate(33deg); }
.petal-second { right:38%; bottom:8%; transform:rotate(67deg); }
@media(min-width:761px) {
  .hero { min-height:280px; }
  .hero .cover-copy { max-width:63%; }
  .welcome { min-height:420px; }
  .sakura-garden { opacity:1; }
  .welcome .sakura-garden { width:76%; height:55%; }
  .welcome .bloom-main { right:17%; top:0; }
}
