/* Homeprint styles — ported from prototype/index.html, plus app-only additions at the bottom. */

:root{
  --bg:#ECE7DE; --surface:#FBF9F5; --card:#FFFFFF; --hair:#E6DFD3;
  --ink:#1E1C19; --soft:#655E54; --faint:#8C8478;
  --accent:#7D6A55; --accent-soft:#EFE8DE; --on-accent:#FFFFFF;
  --ok:#4F6B4A; --warn:#9A5B2E;
  --serif:'Cormorant Garamond', Georgia, serif;
  --sans:'Inter', system-ui, -apple-system, sans-serif;
  --r:18px; --deep:#1E1C19;
  --grid:linear-gradient(rgba(255,255,255,.07) 1px,transparent 1px) 0 0/22px 22px, linear-gradient(90deg,rgba(255,255,255,.07) 1px,transparent 1px) 0 0/22px 22px;
}
body[data-palette="sage"]{--accent:#5E6F58; --accent-soft:#E7ECE3;}
body[data-palette="indigo"]{--accent:#34507A; --accent-soft:#E3E9F2; --deep:#1D2B42; --bg:#E4E7EC; --surface:#FAFAF8; --hair:#DEE2E8;}
*{box-sizing:border-box}
html,body{margin:0}
body{background:var(--bg); color:var(--ink); font-family:var(--sans); font-size:15px; line-height:1.55; -webkit-font-smoothing:antialiased;}
button{font:inherit; color:inherit; cursor:pointer}
input,textarea,select{font:inherit; color:var(--ink)}
.shell{max-width:460px; margin:0 auto; min-height:100vh; background:var(--surface); position:relative; box-shadow:0 0 0 1px rgba(30,28,25,.04), 0 30px 80px rgba(30,28,25,.08); display:flex; flex-direction:column;}
.main{flex:1 1 auto; padding-bottom:110px}

/* type */
.serif{font-family:var(--serif); font-weight:600; letter-spacing:-.005em}
h1.serif{font-size:38px; line-height:1.02; margin:0}
h2.serif{font-size:27px; line-height:1.1; margin:0}
h3.serif{font-size:21px; line-height:1.15; margin:0}
.eyebrow{font-size:11px; letter-spacing:.16em; text-transform:uppercase; color:var(--faint); margin:0 0 8px}
.muted{color:var(--soft)}
.small{font-size:13px}
.pad{padding:0 22px}

/* buttons */
.btn{display:inline-flex; align-items:center; justify-content:center; gap:8px; min-height:50px; padding:0 22px; border-radius:999px; border:1px solid var(--deep); background:var(--deep); color:#F7F3EC; font-weight:500; font-size:15px; width:100%}
.btn.ghost{background:transparent; color:var(--ink); border-color:var(--hair)}
.btn.accent{background:var(--accent); border-color:var(--accent); color:var(--on-accent)}
.btn.sm{min-height:40px; font-size:13.5px; width:auto; padding:0 16px}
.link{background:none; border:0; padding:8px 0; color:var(--soft); text-decoration:underline; text-underline-offset:3px; font-size:14px}
.iconbtn{width:44px; height:44px; border-radius:50%; border:1px solid var(--hair); background:var(--card); display:inline-flex; align-items:center; justify-content:center; position:relative}
.iconbtn .dot{position:absolute; top:9px; right:10px; width:8px; height:8px; border-radius:50%; background:var(--warn); box-shadow:0 0 0 2px var(--card)}

/* landing */
.landing{min-height:100vh; display:flex; flex-direction:column; justify-content:space-between; padding:48px 28px 40px; background:var(--grid),var(--deep); color:#F2F4F8}
.wordmark{font-family:var(--serif); font-weight:600; font-size:22px; letter-spacing:.02em}
.landing h1{font-size:50px; line-height:.98; margin:0 0 16px; color:#fff}
.landing p.lead{margin:0; max-width:330px; color:#C9D2E0}
.landing .plan{width:100%; max-width:300px; height:auto; margin:34px 0 30px; display:block}
.landing .btn{background:#F2F4F8; color:var(--deep); border-color:#F2F4F8}
.landing .btn.ghost{background:transparent; color:#F2F4F8; border-color:rgba(255,255,255,.35)}
.landing .fine{color:#9FB0C8}
.wrenmark{display:inline-flex; width:28px; height:28px; flex:0 0 auto}
.brand{display:flex; align-items:center; gap:10px}
/* onboarding */
.ob-top{display:flex; align-items:center; justify-content:space-between; padding:18px 18px 0}
.progress{display:flex; gap:6px}
.progress i{width:22px; height:3px; border-radius:3px; background:var(--hair); display:block}
.progress i.on{background:var(--ink)}
.ob-body{padding:34px 24px 24px}
.ob-body h2{margin-bottom:8px}
.ob-foot{padding:0 24px 34px; display:flex; flex-direction:column; gap:10px; align-items:center}
.choice{display:flex; gap:14px; align-items:flex-start; width:100%; text-align:left; background:var(--card); border:1px solid var(--hair); border-radius:var(--r); padding:18px; margin-bottom:10px; transition:border-color .15s}
.choice.on{border-color:var(--ink); box-shadow:0 0 0 1px var(--ink) inset}
.choice .ic{width:40px; height:40px; border-radius:12px; background:var(--accent-soft); color:var(--accent); display:flex; align-items:center; justify-content:center; flex:0 0 auto}
.choice b{display:block; font-weight:600; font-size:15.5px}
.choice span{font-size:13.5px; color:var(--soft)}
.tiles{display:grid; grid-template-columns:1fr 1fr; gap:10px}
.tile{background:var(--card); border:1px solid var(--hair); border-radius:16px; padding:16px 14px; text-align:left; min-height:84px; display:flex; flex-direction:column; justify-content:space-between; gap:10px}
.tile.on{border-color:var(--ink); box-shadow:0 0 0 1px var(--ink) inset}
.tile span{font-size:14px; font-weight:500}
.field{display:block; margin-bottom:16px}
.field span{display:block; font-size:12.5px; color:var(--soft); margin-bottom:6px}
.field input,.field textarea,.field select{width:100%; border:1px solid var(--hair); background:var(--card); border-radius:14px; padding:14px; font-size:16px; outline:none}
.field textarea{min-height:110px; resize:vertical; line-height:1.5}
.field input:focus,.field textarea:focus,.field select:focus{border-color:var(--ink)}
.row{display:flex; gap:10px; align-items:center}
.chips{display:flex; flex-wrap:wrap; gap:8px}
.chip{display:inline-flex; align-items:center; gap:6px; border:1px solid var(--hair); background:var(--card); border-radius:999px; padding:7px 13px; font-size:13.5px; min-height:36px}
.chip.on{background:var(--deep); color:#F7F3EC; border-color:var(--deep)}
.chip.static{cursor:default}
.toggle-row{display:flex; justify-content:space-between; align-items:center; padding:14px 0; border-bottom:1px solid var(--hair)}
.toggle-row:last-child{border-bottom:0}
.switch{width:48px; height:28px; border-radius:20px; background:var(--hair); border:0; position:relative; flex:0 0 auto; padding:0}
.switch:after{content:""; position:absolute; top:3px; left:3px; width:22px; height:22px; border-radius:50%; background:#fff; transition:left .18s; box-shadow:0 1px 3px rgba(0,0,0,.18)}
.switch.on{background:var(--deep)}
.switch.on:after{left:23px}
.swatches{display:flex; gap:12px}
.swatch{flex:1; border:1px solid var(--hair); border-radius:16px; padding:12px; background:var(--card); text-align:left}
.swatch.on{border-color:var(--ink); box-shadow:0 0 0 1px var(--ink) inset}
.swatch i{display:block; height:34px; border-radius:10px; margin-bottom:8px}
.sample{border-left:0; background:var(--accent-soft); border-radius:14px; padding:14px 16px; font-family:var(--serif); font-size:19px; line-height:1.3; margin-top:10px}

/* generating */
.gen{min-height:80vh; display:flex; flex-direction:column; justify-content:center; padding:0 32px}
.gen li{list-style:none; padding:10px 0; color:var(--faint); display:flex; gap:12px; align-items:center; transition:color .4s}
.gen li.done{color:var(--ink)}
.gen li i{width:18px; height:18px; border-radius:50%; border:1px solid currentColor; display:inline-flex; align-items:center; justify-content:center; font-style:normal; font-size:11px}
.gen ul{padding:0; margin:26px 0 0}

/* app header */
.apphead{padding:22px 22px 6px; display:flex; justify-content:space-between; align-items:flex-start; gap:12px}
.apphead .switcher{background:none; border:0; padding:0; text-align:left}
.apphead .switcher .serif{display:flex; align-items:center; gap:6px}
.card{background:var(--card); border:1px solid var(--hair); border-radius:var(--r); padding:18px}
.stack>*+*{margin-top:12px}
.section{margin:26px 22px 0}
.section-h{display:flex; justify-content:space-between; align-items:baseline; margin-bottom:12px}
.section-h h3{font-family:var(--serif); font-size:21px; font-weight:600; margin:0}

.finish{background:var(--grid),var(--deep); color:#F3EEE6; border-radius:var(--r); padding:18px 18px 8px}
.finish .bar{height:4px; border-radius:4px; background:#3B3731; margin:10px 0 12px; overflow:hidden}
.finish .bar i{display:block; height:100%; background:#E9DFCF; border-radius:4px}
.finish button{display:flex; width:100%; justify-content:space-between; align-items:center; background:none; border:0; border-top:1px solid #3B3731; color:#F3EEE6; padding:12px 0; font-size:14px; text-align:left; min-height:44px}

.srow{display:flex; width:100%; gap:12px; align-items:center; background:var(--card); border:0; border-bottom:1px solid var(--hair); padding:14px 16px; text-align:left; min-height:56px}
.srow:last-child{border-bottom:0}
.srow .t{font-weight:500; font-size:14.5px; display:flex; align-items:center; gap:7px}
.srow .who{display:flex; flex-wrap:wrap; gap:4px; margin-top:5px}
.tag{font-size:11px; padding:2px 8px; border-radius:999px; background:var(--accent-soft); color:var(--ink); white-space:nowrap}
.tag.warn{background:#F6E9DD; color:var(--warn)}
.tag.ok{background:#E5ECE2; color:var(--ok)}
.group{border:1px solid var(--hair); border-radius:var(--r); overflow:hidden; background:var(--card)}
.glabel{font-size:11px; letter-spacing:.14em; text-transform:uppercase; color:var(--faint); margin:20px 2px 8px}

.person{display:flex; gap:12px; align-items:center; padding:13px 16px; border-bottom:1px solid var(--hair); background:var(--card)}
.person:last-child{border-bottom:0}
.av{width:40px; height:40px; border-radius:50%; background:var(--accent-soft); color:var(--ink); display:flex; align-items:center; justify-content:center; font-family:var(--serif); font-weight:600; font-size:18px; flex:0 0 auto}
.person .info{flex:1 1 auto; min-width:0}
.person .n{font-weight:500}
.person .m{font-size:12.5px; color:var(--soft)}
.person .acts{display:flex; gap:6px}
.mini{border:1px solid var(--hair); background:var(--surface); border-radius:999px; font-size:12.5px; padding:0 12px; min-height:34px}

.feed{padding:0; margin:0}
.feed li{list-style:none; display:flex; gap:12px; padding:12px 0; border-bottom:1px solid var(--hair); font-size:14px}
.feed li:last-child{border-bottom:0}
.feed .time{color:var(--faint); font-size:12px; white-space:nowrap; margin-left:auto}

/* tab bar */
.tabbar{position:fixed; bottom:0; left:50%; transform:translateX(-50%); width:100%; max-width:460px; background:rgba(251,249,245,.92); backdrop-filter:blur(16px); -webkit-backdrop-filter:blur(16px); border-top:1px solid var(--hair); display:flex; padding:8px 8px calc(10px + env(safe-area-inset-bottom)); z-index:20}
.tabbar button{flex:1; background:none; border:0; display:flex; flex-direction:column; align-items:center; gap:3px; font-size:11.5px; color:var(--faint); padding:6px 0; min-height:52px}
.tabbar button.on{color:var(--ink)}

/* guest views */
.ghero{padding:26px 22px 4px}
.ghero h1{font-size:40px}
.welcome{font-family:var(--serif); font-size:20px; line-height:1.35; color:var(--ink); margin:14px 0 0}
.staycard{margin:22px 22px 0; background:var(--grid),var(--deep); color:#F3EEE6; border-radius:var(--r); padding:20px}
.staycard .k{font-size:11px; letter-spacing:.14em; text-transform:uppercase; color:#B9B0A2}
.staycard .v{font-family:var(--serif); font-size:24px; margin-top:4px}
.staycard .code{display:flex; gap:8px; margin-top:14px}
.staycard .code b{width:44px; height:52px; border-radius:12px; background:#2E2A25; display:flex; align-items:center; justify-content:center; font-size:22px; font-weight:500; letter-spacing:0}
.staycard .live{display:inline-flex; align-items:center; gap:7px; font-size:12.5px; color:#D9E3D3; margin-top:14px}
.staycard .live:before{content:""; width:7px; height:7px; border-radius:50%; background:#9DB792; box-shadow:0 0 0 4px rgba(157,183,146,.2)}
.check{display:flex; width:100%; gap:14px; align-items:center; text-align:left; background:var(--card); border:0; border-bottom:1px solid var(--hair); padding:14px 16px; min-height:56px}
.check:last-child{border-bottom:0}
.check .box{width:26px; height:26px; border-radius:50%; border:1.5px solid var(--hair); display:flex; align-items:center; justify-content:center; flex:0 0 auto; transition:all .15s}
.check.done .box{background:var(--accent); border-color:var(--accent); color:#fff}
.check.done .lab{color:var(--faint); text-decoration:line-through}
.check .sub{font-size:12px; color:var(--faint)}
.acc{border-bottom:1px solid var(--hair); background:var(--card)}
.acc:last-child{border-bottom:0}
.acc>button{display:flex; width:100%; justify-content:space-between; align-items:center; background:none; border:0; padding:15px 16px; text-align:left; font-weight:500; min-height:54px}
.acc .body{padding:0 16px 16px; color:var(--ink); font-size:14.5px; white-space:pre-line}
.acc .plus{transition:transform .2s; color:var(--soft)}
.acc.open .plus{transform:rotate(45deg)}
.ask{display:flex; gap:8px; margin-top:4px}
.ask input{flex:1; border:1px solid var(--hair); border-radius:999px; padding:0 18px; min-height:48px; background:var(--card); font-size:15px; outline:none}
.ask input:focus{border-color:var(--ink)}
.ask button{width:48px; height:48px; border-radius:50%; border:0; background:var(--deep); color:#fff; display:flex; align-items:center; justify-content:center; flex:0 0 auto}
.answer{margin-top:12px; background:var(--accent-soft); border-radius:16px; padding:14px 16px; font-size:14.5px}
.answer .src{font-size:11.5px; color:var(--soft); margin-top:6px}
.note{font-size:12.5px; color:var(--soft); background:var(--accent-soft); border-radius:12px; padding:10px 12px}

/* modal + toast */
.scrim{position:fixed; inset:0; background:rgba(30,28,25,.38); z-index:50; display:flex; align-items:flex-end; justify-content:center; animation:fade .18s}
.sheet{background:var(--surface); width:100%; max-width:460px; max-height:92vh; overflow-y:auto; border-radius:26px 26px 0 0; padding:10px 22px calc(26px + env(safe-area-inset-bottom)); animation:up .22s ease}
.sheet .grab{width:40px; height:4px; border-radius:4px; background:var(--hair); margin:0 auto 18px}
.sheet h2{margin-bottom:6px}
.sheet .actions{display:flex; gap:10px; margin-top:20px}
.draft{background:var(--card); border:1px solid var(--hair); border-radius:var(--r); padding:18px; margin-top:16px}
.draft .k{font-size:11px; letter-spacing:.14em; text-transform:uppercase; color:var(--faint); margin:14px 0 8px}
.draft .k:first-child{margin-top:0}
.spark{display:inline-flex; align-items:center; gap:6px; font-size:12px; color:var(--accent); font-weight:500}
.toast{position:fixed; top:16px; left:50%; transform:translateX(-50%); z-index:60; background:var(--deep); color:#F3EEE6; padding:12px 16px; border-radius:16px; font-size:13.5px; box-shadow:0 12px 30px rgba(0,0,0,.2); max-width:420px; width:calc(100% - 32px); display:flex; gap:10px; align-items:flex-start; animation:drop .25s ease}
.toast small{display:block; color:#B9B0A2; font-size:11px; letter-spacing:.12em; text-transform:uppercase; margin-bottom:2px}

/* intro story */
.intro{position:fixed; inset:0; z-index:80; background:var(--grid),#1D2B42; color:#F2F4F8; display:flex; flex-direction:column; align-items:center; justify-content:center; text-align:center; padding:40px 32px; transition:opacity .9s ease}
.intro.out{opacity:0; pointer-events:none}
.intro .mark{opacity:0; animation:rise .9s ease .1s forwards}
.intro p{font-family:var(--serif); font-size:25px; line-height:1.3; max-width:360px; margin:0 0 16px; opacity:0; animation:rise 1s ease forwards}
.intro p.l1{animation-delay:.9s}.intro p.l2{animation-delay:2.4s}.intro p.l3{animation-delay:3.9s}
.intro p.l4{animation-delay:5.8s; color:#9DBBE6; font-style:italic; margin-top:10px}
.intro .skip{position:absolute; top:calc(18px + env(safe-area-inset-top)); right:18px; background:none; border:1px solid rgba(255,255,255,.3); color:#C9D2E0; border-radius:999px; padding:0 16px; min-height:40px; font-size:13px}
.intro .cont{margin-top:26px; opacity:0; animation:rise .8s ease 6.6s forwards; background:#F2F4F8; color:#1D2B42; border:0; border-radius:999px; min-height:48px; padding:0 26px; font-weight:500}
@keyframes rise{from{opacity:0; transform:translateY(10px)} to{opacity:1; transform:none}}
@media (prefers-reduced-motion: reduce){ .intro .mark,.intro p,.intro .cont{animation:none; opacity:1} }
.storylink{background:none; border:0; color:#9FB0C8; text-decoration:underline; text-underline-offset:3px; font-size:13px; padding:6px 0}

@keyframes fade{from{opacity:0}}
@keyframes up{from{transform:translateY(40px); opacity:.4}}
@keyframes drop{from{transform:translate(-50%,-12px); opacity:0}}
.fadein{animation:fade .3s}
@media (min-width:520px){ body{padding:0} .shell{margin:24px auto; min-height:calc(100vh - 48px); border-radius:28px; overflow:hidden} .protobar{border-radius:0} }

/* ---------- app additions ---------- */
.previewbar{position:sticky; top:0; z-index:30; background:var(--deep); color:#F3EEE6; padding:10px 14px 12px}
.previewbar .lbl{font-size:10.5px; letter-spacing:.14em; text-transform:uppercase; color:#B9B0A2; margin-bottom:8px; display:flex; justify-content:space-between; align-items:center}
.previewbar .lbl button{background:none; border:0; color:#B9B0A2; font-size:10.5px; letter-spacing:.14em; text-transform:uppercase; padding:0; min-height:28px}
.viewas{display:flex; gap:6px; overflow-x:auto; scrollbar-width:none; padding-bottom:2px}
.viewas::-webkit-scrollbar{display:none}
.viewas button{flex:0 0 auto; border:1px solid rgba(255,255,255,.22); background:transparent; color:#E9E3D9; padding:7px 12px; border-radius:999px; font-size:13px; min-height:36px}
.viewas button.on{background:#F3EEE6; color:var(--ink); border-color:#F3EEE6}
.landing .field span{color:#9FB0C8}
.landing .field input{background:rgba(255,255,255,.06); border-color:rgba(255,255,255,.25); color:#fff}
.landing .field input:focus{border-color:#F2F4F8}
.landing .field input.code{font-size:28px; letter-spacing:.4em; text-align:center; font-weight:600; padding-left:.4em}
.landing .link{color:#9FB0C8}
.err{background:#F6E9DD; color:var(--warn); border-radius:12px; padding:10px 14px; font-size:14px; margin:0 0 14px}
.landing .info{background:rgba(255,255,255,.08); color:#DDE4EE; border-radius:12px; padding:10px 14px; font-size:14px; margin:0 0 14px}
.btn:disabled{opacity:.55; cursor:default}
.soon{font-size:10.5px; letter-spacing:.08em; text-transform:uppercase; padding:2px 8px; border-radius:999px; background:var(--accent-soft); color:var(--soft); margin-left:6px; vertical-align:middle}
.choice:disabled{opacity:.6; cursor:default}
.locked{display:flex; gap:8px; align-items:center; color:var(--soft)}
.row2{display:flex; gap:10px} .row2>*{flex:1; min-width:0}
.field input[type="datetime-local"]{min-height:50px}
.center{min-height:70vh; display:flex; flex-direction:column; justify-content:center; padding:0 28px}
.spin{width:28px; height:28px; border-radius:50%; border:2px solid var(--hair); border-top-color:var(--ink); animation:sp .8s linear infinite; margin:30vh auto}
@keyframes sp{to{transform:rotate(360deg)}}
a.btn{text-decoration:none}
