/* Catherine's Corner web app — same design language as the concept site */
:root{
  --paper:#FAF4EA; --page:#FFFFFF; --ink:#2C2722; --muted:#80766a; --soft:#6f655a;
  --accent:#34557A; --accent-2:#446A92; --warm:#D08A4E; --warm-soft:#F3D9B8;
  --highlight:#FCE6BE; --line:#E9DFCE; --shadow:rgba(44,39,34,.18); --good:#5B7B5A;
  --bad:#A85B4B;
}
*{box-sizing:border-box; margin:0; padding:0}
html,body{height:100%}
body{
  font-family:'Inter',system-ui,sans-serif; color:var(--ink); background:var(--paper);
  -webkit-font-smoothing:antialiased; line-height:1.55;
  background-image:radial-gradient(1200px 500px at 50% -8%, #F4ECDD 0, var(--paper) 60%);
}
button{font:inherit; cursor:pointer}
input,select,textarea{font:inherit}
.serif{font-family:'Newsreader',serif}

#app{max-width:760px; margin:0 auto; min-height:100%; display:flex; flex-direction:column; padding:0 16px 90px}
/* notched iPhones, added to the home screen: keep content out of the
   status bar / home-indicator areas (viewport-fit=cover exposes them) */
@supports (padding: env(safe-area-inset-top)){
  #app{padding:env(safe-area-inset-top) calc(16px + env(safe-area-inset-right)) calc(90px + env(safe-area-inset-bottom)) calc(16px + env(safe-area-inset-left))}
}

/* top bar */
.topbar{display:flex; align-items:center; justify-content:space-between; padding:16px 2px 10px; gap:8px 10px; flex-wrap:wrap}
.mark{font-family:'Newsreader',serif; font-size:20px; font-weight:600; letter-spacing:.2px; white-space:nowrap}
.mode-pill{margin-left:auto; white-space:nowrap}
.mark b{color:var(--accent)}
.mode-pill{font-size:12px; color:var(--muted); border:1px solid var(--line); padding:5px 12px; border-radius:999px; background:#fff; display:flex; gap:6px; align-items:center}
@media (max-width:520px){
  .mark{font-size:18px}
  .mode-pill{font-size:11px; padding:4px 10px}
}
.mode-pill button{border:none; background:none; color:var(--accent); font-weight:600; font-size:12px; padding:0}

h1.screen-title{font-family:'Newsreader',serif; font-weight:600; font-size:28px; line-height:1.15; margin:14px 0 4px}
p.screen-sub{color:var(--soft); font-size:14.5px; margin-bottom:18px; max-width:52ch}
.kicker{font-size:11px; letter-spacing:.16em; text-transform:uppercase; color:var(--warm); font-weight:600}

/* buttons */
.btn{display:inline-flex; align-items:center; justify-content:center; gap:8px; border-radius:12px; padding:11px 18px;
  border:1px solid var(--line); background:#fff; color:var(--ink); font-weight:500; font-size:14.5px;
  transition:transform .06s ease; text-decoration:none}
.btn:active{transform:scale(.98)}
.btn.primary{background:var(--accent); border-color:var(--accent); color:#fff}
.btn.warm{background:var(--warm); border-color:var(--warm); color:#fff}
.btn.ghost{background:transparent}
.btn.danger{color:var(--bad); border-color:#e3cfc4}
.btn.big{font-size:16.5px; padding:14px 24px; border-radius:14px}
.btn:disabled{opacity:.45; cursor:default}
.btn-row{display:flex; gap:10px; flex-wrap:wrap; margin-top:16px; align-items:center}

/* cards + grids */
.card{background:#fff; border:1px solid var(--line); border-radius:18px; padding:20px; box-shadow:0 14px 34px -26px var(--shadow)}
.stack{display:flex; flex-direction:column; gap:12px}
.grid{display:grid; grid-template-columns:repeat(auto-fill,minmax(150px,1fr)); gap:14px}

/* shelf */
.shelf-head{display:flex; align-items:baseline; justify-content:space-between; margin:6px 0 14px}
.shelf-head h1{font-family:'Newsreader',serif; font-weight:600; font-size:30px}
.gate-link{border:none; background:none; color:var(--muted); font-size:12.5px; text-decoration:underline; text-underline-offset:3px}
.tile{position:relative; border:1px solid var(--line); border-radius:16px; background:#fff; overflow:hidden;
  display:flex; flex-direction:column; text-align:left; padding:0; box-shadow:0 12px 26px -20px var(--shadow)}
.tile .cover{aspect-ratio:3/4; width:100%; object-fit:cover; display:block; background:var(--warm-soft)}
.tile .cover.ph{display:grid; place-items:center; font-family:'Newsreader',serif; font-size:17px; padding:12px; text-align:center; color:#7a5326; line-height:1.25}
.tile .meta{padding:9px 11px 11px}
.tile .t{font-family:'Newsreader',serif; font-size:15px; font-weight:600; line-height:1.2}
.tile .by{font-size:11.5px; color:var(--muted); margin-top:3px; display:flex; align-items:center; gap:5px}
.badge-new{position:absolute; top:8px; left:8px; background:var(--warm); color:#fff; font-size:10.5px; font-weight:600;
  padding:3px 9px; border-radius:999px; box-shadow:0 4px 10px -4px var(--shadow)}
.tile-crayon{position:absolute; top:8px; right:8px; width:32px; height:32px; border-radius:50%; display:grid; place-items:center;
  font-size:16px; background:rgba(255,255,255,.94); border:1px solid var(--line); box-shadow:0 4px 10px -4px var(--shadow); cursor:pointer}
.tile.story .cover.ph{background:#2e3a4d; color:#f3e6cd; font-size:30px}

/* what's new: badge + walkthrough carousel */
.newpill{border:1px solid #e7c79c; background:var(--highlight); color:#7a5326; font-size:12px; font-weight:600;
  padding:5px 12px; border-radius:999px; margin-left:10px; cursor:pointer; white-space:nowrap}
.carousel{display:flex; gap:12px; overflow-x:auto; scroll-snap-type:x mandatory; padding:4px 2px 12px; -webkit-overflow-scrolling:touch}
.slide{flex:0 0 min(86%, 420px); scroll-snap-align:center; display:flex; flex-direction:column; gap:8px; position:relative}
.slide-art{font-size:44px; text-align:center; padding:18px 0 6px; line-height:1.2}
.slide-art .arrows{font-size:20px; color:var(--muted); vertical-align:middle}
.slide-sub{font-size:11px; letter-spacing:.12em; text-transform:uppercase; color:var(--warm); text-align:center; font-weight:600}
.slide-title{font-size:19px; font-weight:600; text-align:center; margin:2px 0}
.slide-text{font-size:13.5px; color:var(--soft); line-height:1.5}
.slide-v{position:absolute; top:12px; right:12px}
.capart{font-family:'Newsreader',serif; font-size:24px; color:var(--soft)}
.capart .hl{color:var(--ink); background:var(--highlight); border-radius:4px; padding:0 4px}
.pillart{display:inline-block; border:1px solid var(--line); border-radius:999px; padding:6px 16px; font-size:15px;
  background:#fff; color:var(--soft); vertical-align:middle}
.pillart.on{background:var(--accent); border-color:var(--accent); color:#fff}
.pgart{display:inline-block; width:44px; height:58px; background:#fff; border:2px solid var(--line);
  border-radius:4px 10px 10px 4px; margin:0 1px; vertical-align:middle}
.pgart:first-of-type{border-radius:10px 4px 4px 10px}

/* nearby sync */
.code-box{width:100%; font-family:ui-monospace, SFMono-Regular, monospace; font-size:11px; border:1px solid var(--line);
  border-radius:11px; padding:10px; margin-top:10px; word-break:break-all; resize:none; background:var(--paper)}

/* corner pills — siblings' shelves side by side */
.corner-pills{display:flex; gap:8px; flex-wrap:wrap; margin:-4px 0 14px}
.corner-pill{border:1px solid var(--line); background:#fff; color:var(--soft); font-size:13px; font-weight:500;
  padding:6px 14px; border-radius:999px}
.corner-pill.on{background:var(--accent); border-color:var(--accent); color:#fff}

/* avatars */
.av{width:34px; height:34px; border-radius:50%; display:inline-grid; place-items:center; color:#fff;
  font-family:'Newsreader',serif; font-size:15px; flex:none; border:2px solid #fff; box-shadow:0 2px 6px -2px var(--shadow)}
.av.sm{width:22px; height:22px; font-size:10.5px; border-width:1.5px}
.av-row{display:flex}
.av-row .av{margin-left:-8px}
.av-row .av:first-child{margin-left:0}

/* pick lists (voice picker, reader picker) */
.pick{display:flex; align-items:center; gap:13px; width:100%; text-align:left; background:#fff;
  border:1px solid var(--line); border-radius:14px; padding:13px 15px}
.pick:hover{border-color:var(--accent-2)}
.pick .av{width:42px; height:42px; font-size:18px}
.pick .nm{font-family:'Newsreader',serif; font-size:17px; font-weight:600}
.pick .rel{font-size:12.5px; color:var(--muted)}
.pick .spacer{flex:1}
.pick .chev{color:var(--muted)}

/* player */
.player{display:flex; flex-direction:column; gap:0; background:#fff; border:1px solid var(--line); border-radius:20px; overflow:hidden;
  box-shadow:0 24px 50px -34px var(--shadow)}
.p-top{display:flex; align-items:center; justify-content:space-between; padding:12px 16px; border-bottom:1px solid var(--line); gap:10px}
.p-title{font-family:'Newsreader',serif; font-size:16px; font-weight:600; line-height:1.15}
.p-by{font-size:11.5px; color:var(--muted)}
.p-stage{position:relative; background:var(--paper); min-height:300px; display:grid; place-items:center}
.p-stage img{max-width:100%; max-height:56vh; display:block; margin:0 auto}
.p-stage .noart{padding:44px 24px; text-align:center; color:#7a5326}
.p-stage .noart .big{font-size:52px}
.p-stage .noart .cap{font-family:'Newsreader',serif; font-size:19px; margin-top:10px}
.p-tag{position:absolute; top:10px; left:12px; font-size:10.5px; color:#7a5326; background:rgba(251,241,226,.94);
  border:1px solid #e7c79c; padding:2px 9px; border-radius:999px}
.p-count{position:absolute; bottom:10px; right:12px; font-size:11px; color:var(--muted); background:rgba(255,255,255,.9);
  border:1px solid var(--line); padding:2px 9px; border-radius:999px}
.p-cap{padding:12px 18px 10px; text-align:center; font-family:'Newsreader',serif; font-size:17.5px; line-height:1.6;
  color:var(--soft); background:#fff; border-top:1px solid var(--line)}
.p-cap span{border-radius:4px; padding:0 2px; transition:background .2s, color .2s}
.p-cap span.on{color:var(--ink); background:var(--highlight)}
.p-bar{display:flex; align-items:center; gap:12px; padding:12px 16px; border-top:1px solid var(--line)}
.p-play{width:46px; height:46px; border-radius:50%; background:var(--accent); border:none; color:#fff; font-size:17px; display:grid; place-items:center; flex:none}
.p-track{flex:1; height:7px; border-radius:999px; background:#e7ddca; position:relative; cursor:pointer; touch-action:none}
.p-track::before{content:''; position:absolute; left:0; right:0; top:-13px; bottom:-13px} /* finger-sized hit area */
.p-track i{position:absolute; left:0; top:0; height:100%; width:0%; border-radius:999px; background:var(--warm); pointer-events:none}
.p-track i::after{content:''; position:absolute; right:-9px; top:50%; width:18px; height:18px; transform:translateY(-50%);
  border-radius:50%; background:#fff; border:2.5px solid var(--warm); box-shadow:0 2px 6px -1px var(--shadow)}
.p-time{font-size:11.5px; color:var(--muted); font-variant-numeric:tabular-nums; flex:none}
.p-nudge{width:36px; height:36px; border-radius:50%; border:1px solid var(--line); background:#fff; color:var(--soft);
  font-size:11.5px; flex:none; padding:0; font-variant-numeric:tabular-nums}

/* two-page spreads: the stage is wide, so give it room — and in landscape
   (where spreads belong) let the whole player breathe */
.p-stage.spread img{max-height:52vh}
.rotate-hint{position:absolute; bottom:10px; left:12px; font-size:11px; color:#7a5326; background:rgba(251,241,226,.94);
  border:1px solid #e7c79c; padding:3px 10px; border-radius:999px}
@media (orientation:landscape){
  #app.wide{max-width:1160px}
  .p-stage img{max-height:70vh}
  .p-stage.spread img{max-height:72vh}
  .rotate-hint{display:none}
}

/* calm end */
.calm{padding:46px 20px; text-align:center}
.calm .moon{font-size:44px}
.calm h2{font-family:'Newsreader',serif; font-size:24px; font-weight:600; margin-top:12px}
.calm p{color:var(--soft); font-size:14px; margin-top:6px}

/* record flow */
.stepper{display:flex; gap:6px; font-size:11.5px; margin:14px 0 6px; flex-wrap:wrap}
.stepper span, .stepper button{padding:5px 11px; border-radius:999px; border:1px solid var(--line); background:#fff; color:var(--muted); font-size:inherit}
.stepper .now{background:var(--accent); border-color:var(--accent); color:#fff}
.stepper .done{background:#E7F0E8; border-color:#bcd3bc; color:#3f5f3f}
.stepper button.done{cursor:pointer; text-decoration:underline; text-underline-offset:2px}
.stepper button.done:hover{border-color:#3f5f3f}

.rec-hero{background:#fff; border:1px solid var(--line); border-radius:20px; padding:34px 22px; text-align:center;
  box-shadow:0 20px 44px -32px var(--shadow)}
.rec-dot{width:15px; height:15px; border-radius:50%; background:#c6bba8; display:inline-block; vertical-align:-2px; margin-right:9px}
.rec-dot.live{background:#C24B3A; animation:pulse 1.4s ease infinite}
@keyframes pulse{0%,100%{opacity:1}50%{opacity:.35}}
.rec-time{font-family:'Newsreader',serif; font-size:44px; font-weight:600; font-variant-numeric:tabular-nums; margin:8px 0 2px}
.rec-note{font-size:13px; color:var(--muted); max-width:40ch; margin:8px auto 0}

/* pass 2 */
.seg{display:inline-flex; border:1px solid var(--line); border-radius:999px; overflow:hidden; background:#fff; margin:8px 0 2px}
.seg button{border:none; background:none; font-size:12.5px; color:var(--soft); padding:7px 14px}
.seg button.on{background:var(--accent); color:#fff}
.pagestrip{display:flex; gap:10px; overflow-x:auto; padding:6px 2px 10px}
.pagestrip .pg{position:relative; flex:none; width:92px; border:2px solid var(--line); border-radius:10px; overflow:hidden; background:#fff}
.pagestrip .pg img{width:100%; aspect-ratio:3/4; object-fit:cover; display:block}
.pagestrip.spread .pg{width:150px}
.pagestrip.spread .pg img{aspect-ratio:3/2}
.pagestrip .pg.current{border-color:var(--warm)}
.pagestrip .pg .k{position:absolute; top:4px; left:4px; background:rgba(255,255,255,.92); border:1px solid var(--line);
  border-radius:999px; font-size:10px; padding:1px 7px}
.pagestrip .pg img{cursor:pointer}
.pagestrip .pg .stamp{position:absolute; bottom:4px; left:4px; right:4px; width:auto; height:auto; text-align:center;
  background:rgba(52,85,122,.92); color:#fff; border:none; white-space:nowrap;
  border-radius:999px; font-size:10px; padding:1px 4px; font-variant-numeric:tabular-nums; cursor:pointer}
.pagestrip .addpg{flex:none; width:92px; aspect-ratio:3/4; border:2px dashed var(--line); border-radius:10px; background:none;
  color:var(--muted); font-size:12px; line-height:1.3}
.skiplist{display:flex; flex-direction:column; gap:6px; margin-top:8px}
.skiplist .sk{display:flex; align-items:center; gap:10px; font-size:12.5px; color:var(--soft); background:#fff;
  border:1px solid var(--line); border-radius:10px; padding:7px 11px; font-variant-numeric:tabular-nums}
.skiplist .sk button{border:none; background:none; color:var(--bad); font-size:12px; margin-left:auto}

/* forms */
.field{display:flex; flex-direction:column; gap:6px; margin-bottom:14px}
.field label{font-size:12.5px; font-weight:600; color:var(--soft)}
.field input[type=text], .field input[type=password], .field input[type=number], .field select, .field textarea{
  border:1px solid var(--line); border-radius:11px; padding:11px 13px; background:#fff; font-size:15px; width:100%}
.field input:focus, .field select:focus{outline:2px solid var(--accent-2); outline-offset:1px; border-color:var(--accent-2)}
.hint{font-size:12px; color:var(--muted)}
.filebtn{position:relative; overflow:hidden; display:inline-flex}
.filebtn input[type=file]{position:absolute; inset:0; opacity:0; cursor:pointer}

/* pin pad */
.pinwrap{max-width:340px; margin:30px auto; text-align:center}
.pin-dots{display:flex; gap:12px; justify-content:center; margin:18px 0 22px}
.pin-dots i{width:14px; height:14px; border-radius:50%; border:2px solid var(--accent); background:transparent}
.pin-dots i.on{background:var(--accent)}
.pinpad{display:grid; grid-template-columns:repeat(3,1fr); gap:10px}
.pinpad button{aspect-ratio:1.6; border-radius:12px; border:1px solid var(--line); background:#fff;
  font-family:'Newsreader',serif; font-size:21px}
.pin-err{color:var(--bad); font-size:13px; min-height:18px; margin-top:10px}

/* adult home */
.home-grid{display:grid; grid-template-columns:1fr 1fr; gap:12px; margin-top:12px}
.home-card{background:#fff; border:1px solid var(--line); border-radius:16px; padding:18px 16px; text-align:left;
  display:flex; flex-direction:column; gap:5px; box-shadow:0 12px 26px -22px var(--shadow)}
.home-card .ic{font-size:23px}
.home-card .t{font-family:'Newsreader',serif; font-weight:600; font-size:16.5px}
.home-card .d{font-size:12.5px; color:var(--muted); line-height:1.4}
.home-card:hover{border-color:var(--accent-2)}

/* lists in adult mode */
.rowitem{display:flex; align-items:center; gap:12px; background:#fff; border:1px solid var(--line); border-radius:14px; padding:12px 14px; flex-wrap:wrap}
.rowitem .grow{flex:1; min-width:0}
.rowitem .t{font-weight:600; font-size:14.5px; font-family:'Newsreader',serif}
.rowitem .d{font-size:12px; color:var(--muted); overflow-wrap:anywhere}
.rowitem img.thumb{width:44px; height:58px; object-fit:cover; border-radius:7px; border:1px solid var(--line)}
.chip{font-size:11px; padding:3px 9px; border-radius:999px; border:1px solid var(--line); background:var(--paper); color:var(--soft)}
.chip.open{background:var(--highlight); border-color:#e7c79c; color:#7a5326}

/* stacked rows (requests, readings): info on top, actions beneath —
   phone-width cards can't fit a run of buttons beside the text */
.rowitem.stacked{flex-direction:column; align-items:stretch}
.rowhead{display:flex; align-items:center; gap:12px; min-width:0}
.rowbtns{margin-top:10px}
.rowbtns .btn{padding:8px 13px; font-size:13px}

.back{border:none; background:none; color:var(--muted); font-size:13px; padding:0; margin:14px 0 0; text-decoration:underline; text-underline-offset:3px}
.linklike{border:none; background:none; color:var(--warm); font-size:inherit; font-weight:600; letter-spacing:inherit;
  text-transform:inherit; padding:0; text-decoration:underline; text-underline-offset:3px}

/* cover studio */
.studio-wrap{display:flex; flex-direction:column; gap:14px; align-items:center}
.studio-canvas{width:100%; max-width:340px; aspect-ratio:3/4; border:2px solid var(--line); border-radius:16px;
  background:#fff; touch-action:none; box-shadow:0 18px 40px -30px var(--shadow); cursor:crosshair; display:block}
.studio-tools{display:flex; flex-direction:column; gap:10px; width:100%; max-width:340px}
.tool-row{display:flex; gap:8px; flex-wrap:wrap; align-items:center; justify-content:center}
.swatch{width:34px; height:34px; border-radius:50%; border:3px solid #fff; box-shadow:0 0 0 1.5px var(--line); cursor:pointer; padding:0}
.swatch.sel{box-shadow:0 0 0 3px var(--accent)}
.stamp{width:40px; height:40px; border-radius:12px; border:1.5px solid var(--line); background:#fff; font-size:21px; padding:0}
.stamp.sel{border-color:var(--accent); box-shadow:0 0 0 2px var(--accent)}
.brushsize{width:40px; height:40px; border-radius:12px; border:1.5px solid var(--line); background:#fff; display:grid; place-items:center; padding:0}
.brushsize.sel{border-color:var(--accent); box-shadow:0 0 0 2px var(--accent)}
.brushsize i{border-radius:50%; background:var(--ink); display:block}
.bgdot{width:28px; height:28px; border-radius:8px; border:1.5px solid var(--line); cursor:pointer; padding:0}

/* the "packed and ready" hand-off sheet — sits above everything but the toast */
.handoff{position:fixed; inset:0; z-index:55; background:rgba(43,36,26,.42); display:flex; align-items:flex-end; justify-content:center;
  padding:18px; padding-bottom:calc(18px + env(safe-area-inset-bottom, 0px))}
.handoff .card{width:100%; max-width:430px}

.toast{position:fixed; left:50%; bottom:calc(26px + env(safe-area-inset-bottom, 0px)); transform:translateX(-50%); background:var(--ink); color:#fff;
  padding:10px 18px; border-radius:999px; font-size:13.5px; box-shadow:0 14px 30px -12px var(--shadow); z-index:60;
  opacity:0; transition:opacity .25s; pointer-events:none; max-width:88vw; text-align:center}
.toast.show{opacity:1}

.empty{padding:40px 18px; text-align:center; color:var(--muted); font-size:14px; border:1.5px dashed var(--line); border-radius:16px}
.empty .big{font-size:34px; margin-bottom:8px}

footer.appfoot{margin-top:auto; padding:26px 0 12px; text-align:center; color:var(--muted); font-size:11.5px}
.foot-ver{border:none; background:none; color:var(--muted); font-size:inherit; padding:0;
  text-decoration:underline; text-underline-offset:3px; cursor:pointer}

@media (max-width:520px){
  .home-grid{grid-template-columns:1fr}
  h1.screen-title{font-size:24px}
}
