/* Shanyrak v8 — app layer. Loaded AFTER css/shanyrak.css (the untouched handoff drop-in).
   Only what the real app needs on top of the handoff: states, skeletons, a destructive button,
   sheet/list details that the prototype hard-coded inline, and page-specific bits shared by 2+ pages. */

/* ── destructive (confirm sheets only) ── */
.btn--danger{color:var(--error);border-color:rgba(126,46,29,.35);background:var(--page)}
.btn--danger:hover{border-color:var(--error);color:var(--error)}

/* ── sheets: rows rendered as <button class="sheet-item"> ── */
.sheet-item{cursor:pointer;font:inherit;font-size:18px}
.sheet-item>span:not(.sheet-ico):not(.ring):not(.chev){flex:1;min-width:0}
.sheet-item .ring{flex:none}
.sheet-body{display:block}
/* review r1: the page behind an open sheet stays put (book-ui.js lockPage/unlockPage); the sheet's own scroll never
   chains to the page */
html.sheet-lock{overflow:hidden}
html.sheet-lock body{position:fixed;left:0;right:0;width:100%;padding-right:var(--sheet-sb,0px)}
.sheet{overscroll-behavior:contain}

/* ── loading (README §6 States): skeleton in the shape of the content, visible only after 300 ms ── */
.skel-wait{animation:skelShow 1ms linear 300ms both}
@keyframes skelShow{from{visibility:hidden;opacity:0}to{visibility:visible;opacity:1}}
.skel{display:flex;flex-direction:column;gap:14px;padding:6px 0}
.skel-line{height:18px;border-radius:9px;background:linear-gradient(90deg,var(--sand) 0,#F4ECDC 40%,var(--sand) 80%) 0 0/200% 100%;animation:skelShine 1.6s linear infinite}
.skel-block{border-radius:var(--r-xl);background:linear-gradient(90deg,var(--sand) 0,#F4ECDC 40%,var(--sand) 80%) 0 0/200% 100%;animation:skelShine 1.6s linear infinite}
.skel-ring{border-radius:50%;border:8px solid var(--sand);flex:none}
@keyframes skelShine{to{background-position:-200% 0}}

/* review r1: page titles filled after the data keep their line from the first paint (no vertical jump either) */
.hm-kicker:empty::before,.hm-hello:empty::before,.me10-h1:empty::before,.tr-h:empty::before,.tr-sub:empty::before,.fm10-h1:empty::before,.fm10-sub:empty::before{content:"\a0"}

/* ── error / empty / offline: what happened · what is safe · one way out ── */
.state-card{display:flex;flex-direction:column;align-items:flex-start;gap:12px;padding:22px 20px;border-radius:var(--r-lg);background:var(--page);border:1px solid var(--line)}
.state-card .state-ico{width:48px;height:48px;border-radius:50%;display:grid;place-items:center;background:var(--ochre-soft);color:var(--ochre-ink)}
.state-card--center{align-items:center;text-align:center}
.offline-bar{position:sticky;top:calc(var(--appbar) + 8px + env(safe-area-inset-top));z-index:9;display:flex;align-items:center;gap:10px;margin:10px auto;padding:10px 16px;border-radius:16px;width:max-content;max-width:calc(100% - 32px);background:var(--ochre-soft);color:var(--ochre-ink);border:1px solid rgba(156,107,31,.3);font-weight:700;font-size:15px;line-height:1.3;box-shadow:var(--sh-card)}
body:not(.has-tabbar) .offline-bar{top:calc(8px + env(safe-area-inset-top))}
@media (min-width:1000px){body.has-side .offline-bar{top:8px}}
.page-record .offline-bar{position:static;width:auto;max-width:none;box-shadow:none;margin:0 0 14px}

/* ── misc shared ── */
.link-strong{font-weight:700;min-height:44px;display:inline-flex;align-items:center;text-decoration:none}
.chev{color:var(--ink-4);flex:none}
.row-btn{width:100%;background:none;border:0;border-bottom:1px solid rgba(36,27,18,.08);text-align:left;font:inherit;cursor:pointer}
.row-btn:last-child{border-bottom:0}
.muted{color:var(--ink-3)}
.center{text-align:center}
.mt-0{margin-top:0}
.pending-pill{display:inline-flex;align-items:center;gap:8px;min-height:36px;padding:4px 14px;border-radius:999px;background:var(--ochre-soft);color:var(--ochre-ink);font-weight:700;font-size:15px;text-decoration:none}
.pending-pill .dot{animation:blink 1.6s steps(2) infinite}
.fact-grid{display:grid;gap:10px}
.photo-img img{width:100%;height:100%;object-fit:cover;display:block;border-radius:2px}
.cam video{width:100%;height:100%;object-fit:cover;transform:scaleX(-1)}
.cam .cam-hint{display:flex;flex-direction:column;align-items:center;gap:10px;padding:20px;text-align:center}
.lang-switch{display:inline-grid;grid-auto-flow:column;gap:4px;background:var(--sand);border-radius:14px;padding:4px}
.lang-switch button{min-width:56px;min-height:48px;border:0;border-radius:10px;background:none;font-weight:700;color:var(--ink-2)}
.lang-switch [aria-pressed="true"]{background:var(--page);color:var(--ink);box-shadow:0 1px 3px rgba(36,27,18,.15)}
.visually-hidden{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
/* grid items default to min-width:auto, so a horizontally scrolling child (the whose-book strip) would widen the column */
.cols>*,.stack>*{min-width:0}
/* desktop: the whose-book strip sits in a grid column, so it must not bleed into the gap */
@media (min-width:960px){.who-strip{margin:0;padding:4px 2px 10px}}

/* player that couldn't load its voice: ochre, never red (README §6 States) */
.player.is-error{border-color:rgba(156,107,31,.4)}
.player.is-error .player-btn{background:var(--ochre-soft);color:var(--ochre)}
.player.is-error .player-label{color:var(--ink)}

/* README §9 «no text below 16 px except captions (15), tab labels and print micro text (13)»: a few handoff
   components were drawn at 13–14 px — lifted to the caption size here, the drop-in file stays untouched */
.who-flag,.pill,.tnode-sub,.tnode .you,.news-when{font-size:15px}
.cover-toc button{min-height:48px}
.tnode .you{height:auto;min-height:22px;top:-12px}
/* tap targets (§9: controls ≥ 48, inline text links ≥ 44 high) */
.appbar-end .btn--quiet{min-width:48px}
.row .row-main .cap a{display:inline-flex;align-items:center;min-height:48px}
/* inline name links in headings and relation lines: a 44 px hit area without moving the text */
.hero-rel a,.h3>a{padding-block:12px}
/* the handoff's .hero-in padding shorthand wipes .wrap's side gutter (also in the handoff) — restore it */
.wrap.hero-in{padding-inline:var(--page-x)}

/* ── taste pass (2026-09-29): the paper feels like paper, every tap answers, the shelf settles once ── */
/* paper grain: a static tile on the desk only (cards/pages stay clean), no fixed layer, no repaint on scroll */
body:not(.rd):not(.page-print):not(.wl){background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .33 0 0 0 0 .24 0 0 0 0 .14 0 0 0 .09 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E")}
html{-webkit-tap-highlight-color:rgba(43,40,35,.08)}
/* tactile rows: lists and question rows answer a press, not only buttons */
a.row,.row-btn,.bk-q,.bk-toc-row,.bk-acc-head{transition:background-color var(--d-fast,150ms) var(--ease-press,ease)}
a.row:active,.row-btn:active,.bk-q:active,.bk-toc-row:active,.bk-acc-head:active{background:rgba(43,40,35,.06)}
.chip,.hm-chip{transition:transform var(--d-fast,150ms) var(--ease-press,ease)}
.chip:active,.hm-chip:active{transform:scale(.97)}
/* first Дом visit of a session: the books settle onto the shelf, left to right */
@media (prefers-reduced-motion:no-preference){
  .hm-shelf.arrive .hm-book{animation:shelfIn 420ms var(--ease-out,ease) both;animation-delay:calc(min(var(--n,0),11) * 45ms)}
}
/* review r1: held until the splash is gone and the shelf is on screen (index.html armArrive) */
.hm-shelf.arrive.hold .hm-book{animation-play-state:paused}
@keyframes shelfIn{from{opacity:0;transform:translateY(14px)}to{opacity:1;transform:none}}
@media (prefers-reduced-motion:reduce){.chip:active,.hm-chip:active{transform:none}}

/* ── demo guest («Посмотреть пример», v11): one calm line under the top bar — felt, not an alert ── */
.demo-bar{background:var(--sand);border-bottom:1px solid var(--line);color:var(--ink-2)}
.demo-bar-in{display:flex;flex-wrap:wrap;align-items:center;column-gap:16px;padding-block:2px}
.demo-bar-t{margin:0;flex:1 1 240px;padding-block:10px 0;font-size:15px;line-height:1.35}
.demo-bar-go{min-height:48px;margin-left:-4px;padding:0 4px;border:0;border-radius:10px;background:none;font:inherit;font-size:16px;font-weight:700;color:var(--ink);text-decoration:underline;text-underline-offset:4px;text-decoration-thickness:1px;cursor:pointer}
.demo-bar-go:active{background:rgba(43,40,35,.06)}
@media (min-width:640px){.demo-bar-t{padding-block:0}}
/* review r3: phones reserve the brand bar's height until mountChrome draws it (it's inserted after auth) — no jump */
@media (max-width:999px){body.has-tabbar:not(.chrome-on)::before{content:"";display:block;height:calc(var(--appbar) + 1px + env(safe-area-inset-top))}}
