/* Tool-specific GFS adaptations. Everything visual comes from the original
   .la stylesheet in the theme (style.css); this file only carries the pieces
   the original app rendered with React state instead of static CSS. */
.awf-tool .tool-msg{font-weight:800;min-height:1.5em;margin:14px 0 0;color:var(--la-accent)}
.awf-tool .tool-msg.err{color:#ffab91}
.la[data-theme="frost"] .awf-tool .tool-msg.err{color:#b3261e}
.awf-tool .board-actions{justify-content:center;max-width:780px;margin:0 auto 6px}
/* Board title is an <h2> here (the page already has an <h1>); same styling
   as the original .board-head h1 rule. */
.la .board-head .board-title{font-family:var(--la-serif);font-size:clamp(1.9rem,5vw,3rem);margin:0;line-height:1.1}
.awf-tool .detail-wrap{max-width:780px;margin:18px auto 0}
.awf-tool .collect-card{max-width:780px;margin:18px auto 40px}
.awf-tool .btn.danger{background:#b3261e;color:#fff}
.awf-tool .btn.danger[data-confirm="1"]{background:#7a130d;animation:wiggle 1.2s infinite}
.awf-tool .detail-card{margin-bottom:18px}
.awf-tool .note-count{text-align:right;margin:4px 0 10px}
.la .awf-tool .door:not(.gift) .n{margin-top:0;margin-right:0}
/* The original doors carry a door illustration (.art) and offset the number
   onto it; this site uses no door illustrations, so numbers stay centred. */
/* On /code the code strip is moved above the maker form by the tool script;
   it keeps the original dashed .code-strip styling, just re-spaced. */
.awf-tool .code-strip-top{margin-top:0;margin-bottom:16px}
.awf-tool button{touch-action:manipulation}

/* ---- v5 (issue v5-input-overflow): pin the form controls' box model ----
   The original package CSS sizes text inputs width:100% + 14/16px padding +
   2px borders, which only stays inside the card under border-box. The v4
   universal-selector preflight did not hold for these inputs in real
   browsers (they alone protruded ~15px — the content-box signature), so the
   exact selectors are pinned here, in the last-loaded stylesheet, with
   !important so no cascade order or specificity contest can reopen it. */
.la .awf-tool input[type="text"],
.la .awf-tool textarea{box-sizing:border-box!important;max-width:100%}
.la .awf-tool .create-card>input[type="text"]{display:block;width:100%}
.la .awf-tool .code-row input[type="text"]{width:auto;min-width:0}
.la .awf-tool .create-card .btn{max-width:100%}
.la .awf-tool{min-width:0}

/* ---- v6 additions ---- */
/* Golden style: the original's .board-shell.golden rules target its door
   illustration (.art), which this site does not use — so the golden doors
   themselves are styled here: gold gradient faces, gold ring, soft glow. */
.awf-tool .board-shell.golden .door{background:linear-gradient(160deg,#f7d774,#eec95e 55%,#c9962b);color:#3d2d12;box-shadow:0 0 0 2px #f2c14e66,0 5px #00000038,0 0 14px rgba(242,193,78,.35)}
.awf-tool .board-shell.golden .door.empty{background:linear-gradient(160deg,#a37f2c,#8a671f 60%,#6e5218);color:#fbecc4;box-shadow:inset 0 0 0 2px #f2c14e59,0 0 10px rgba(242,193,78,.22)}
/* Envelope wraps on keepsake cards (the theme styles .note-card.wrap-*;
   the book uses .ks-note, so mirror the three wraps here). */
.awf-tool .ks-note.wrap-gold{background:linear-gradient(135deg,#fff7dc,#f7e0a1);box-shadow:0 0 0 3px #d9a83b,0 6px #0003}
.awf-tool .ks-note.wrap-sparkle{background:radial-gradient(circle at 15% 20%,rgba(255,255,255,.9) 0 2px,transparent 3px),radial-gradient(circle at 80% 30%,rgba(255,255,255,.9) 0 2px,transparent 3px),radial-gradient(circle at 60% 85%,rgba(255,255,255,.9) 0 1.5px,transparent 2.5px),linear-gradient(135deg,#e9efff,#fff)}
.awf-tool .ks-note.wrap-ribbon{background:linear-gradient(90deg,transparent 47%,rgba(200,16,46,.18) 47% 53%,transparent 53%),var(--la-door);box-shadow:0 0 0 3px #c8102e,0 6px #0003}
.awf-tool [data-my-remaining]{font-weight:800;margin:8px 0 0}
/* Keepsake printing: only the book prints. The theme's own print rules
   already restyle .ks-note for paper and hide the site header/footer; these
   hide the rest of the tool page around the book. */
@media print{
  .la .hero-art,.la .hero-art-m,.la .hero h1,.la .hero .lead,.la .block,.la .closing,
  .awf-tool [data-view="home"],.awf-tool [data-view="cal"],.awf-tool .tool-msg,
  .awf-tool [data-act="ks-back"]{display:none!important}
  .la .hero{display:block;padding:0}
  .la .wrap{max-width:none;padding:0}
}

/* ---- story preview modal (v13 story redesign follow-up) ----
   Colours come from the theme variables, so the preview follows whichever
   look the page is using (deep green + gold by default). The card scrolls
   internally and the picture is height-capped, so on a phone the whole
   9:16 card stays reachable without the page behind it moving. */
.awf-tool .story-modal{position:fixed;inset:0;z-index:80;background:rgba(8,12,9,.74);display:flex;align-items:center;justify-content:center;padding:14px}
.awf-tool .story-card{background:var(--la-panel);color:var(--la-text);border-radius:24px;box-shadow:0 24px 60px rgba(0,0,0,.55);padding:20px;width:min(430px,100%);max-height:94vh;overflow-y:auto;text-align:center}
.awf-tool .story-card h3{font-family:var(--la-serif);margin:0 0 12px}
.awf-tool .story-img{display:block;width:auto;height:auto;max-width:100%;max-height:62vh;margin:0 auto;border-radius:14px;box-shadow:0 10px 30px rgba(0,0,0,.45)}
.awf-tool .story-hint{margin:12px 0 0}
.awf-tool .story-actions{display:flex;gap:10px;justify-content:center;flex-wrap:wrap;margin-top:16px}
