/* Reset, typography, layout primitives. Logical properties only (inline/block), never left/right. */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 96px; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--world); color: var(--text); font: var(--fw-body) var(--fs-body)/var(--lh-body) var(--font-body); -webkit-font-smoothing: antialiased; overflow-x: clip; }
h1, h2, h3 { font-family: var(--font-display); margin: 0; text-wrap: balance; }
p { margin: 0; }
img { max-width: 100%; }
bdi { unicode-bidi: isolate; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.t-wrap { max-width: var(--w-content); margin-inline: auto; padding-inline: var(--gutter); }
[dir="rtl"] .t-flip { transform: scaleX(-1); }
.t-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ==========================================================================
   Template-only chrome (tpl-*): never ported
   ========================================================================== */
.tpl-wrap { max-width: var(--w-content); margin: 0 auto; padding-inline: var(--gutter); }
.tpl-hero { padding-block: var(--s-8) var(--s-6); display: grid; gap: var(--s-4); }
.tpl-eyebrow { font: 600 var(--fs-small) var(--font-body); color: var(--wine); letter-spacing: var(--tracking-label); text-transform: uppercase; display: inline-flex; align-items: center; gap: var(--s-3); }
.tpl-eyebrow::before { content: ""; width: 28px; height: 8px; border-radius: 99px; background: var(--red); }
.tpl-hero h1 { font-size: var(--fs-display); font-weight: 800; line-height: var(--lh-tight); letter-spacing: var(--tracking-display); }
.tpl-hero h1 em { font-style: normal; color: var(--red); }
.tpl-hero p { font-size: var(--fs-lead); color: var(--text-soft); max-width: 52ch; }
.tpl-index { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-top: var(--s-3); }
.tpl-index a, .tpl-pages a { min-height: 40px; display: inline-flex; align-items: center; gap: var(--s-2); padding-inline: var(--s-4); border-radius: 99px; background: var(--surface); border: 1px solid var(--line); color: var(--text); text-decoration: none; font-size: var(--fs-small); }
.tpl-index a b { font: 800 var(--fs-micro) var(--font-display); color: var(--wine); }
.tpl-index a:hover, .tpl-pages a:hover { border-color: var(--wine); }
.tpl-sec { padding-block: var(--s-8); border-top: 1px solid var(--line); }
.tpl-grid { display: grid; grid-template-columns: minmax(0, 260px) minmax(0, 1fr); gap: clamp(var(--s-6), 4vw, var(--s-8)); align-items: start; }
.tpl-side { position: sticky; top: 104px; display: grid; gap: var(--s-3); }
.tpl-no { width: 40px; height: 40px; border-radius: 99px; background: var(--ink); color: var(--paper); display: grid; place-items: center; font: 800 var(--fs-small) var(--font-display); }
.tpl-side h2 { font-size: var(--fs-h2); font-weight: 800; line-height: var(--lh-heading); }
.tpl-side p { color: var(--text-soft); font-size: var(--fs-small); }
.tpl-main { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-5); }
@media (max-width: 899px) { .tpl-grid { grid-template-columns: 1fr; } .tpl-side { position: static; } }
.tpl-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); padding: clamp(var(--s-4), 3vw, var(--s-6)); min-width: 0; }
.tpl-card.is-soft { background: var(--panel); border-color: transparent; }
.tpl-card.tpl-flush { padding: 0; overflow: hidden; }
.tpl-flush .t-foot { margin-top: var(--s-7); }
.tpl-pad { padding: var(--s-5) var(--s-5) 0; }
.tpl-label { display: block; font: 700 var(--fs-micro) var(--font-body); color: var(--text-soft); letter-spacing: var(--tracking-label); text-transform: uppercase; margin-bottom: var(--s-4); }
.tpl-form > .tpl-label, .tpl-center > .tpl-label { margin: 0; justify-self: start; }
.tpl-states { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: var(--s-5) var(--s-4); align-items: end; }
.tpl-state { display: grid; gap: var(--s-2); justify-items: start; min-width: 0; }
.tpl-state small { font: 600 var(--fs-micro) var(--font-body); color: var(--text-soft); }
.tpl-row { display: flex; flex-wrap: wrap; gap: var(--s-3); align-items: center; }
.tpl-gap { margin-bottom: var(--s-5); }
.tpl-stamps { gap: var(--s-5); padding-block: var(--s-3); }
.tpl-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: var(--s-5); }
.tpl-fields > div { display: grid; gap: var(--s-2); }
.tpl-tag { font: 600 var(--fs-micro) var(--font-body); color: var(--wine); background: var(--panel); padding: 2px var(--s-2); border-radius: 99px; justify-self: start; }
.tpl-two { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: var(--s-5); }
.tpl-form { display: grid; gap: var(--s-4); align-content: start; }
.tpl-center { display: grid; justify-items: center; gap: var(--s-4); align-content: start; }
.tpl-note { font-size: var(--fs-small); color: var(--text-soft); margin-top: var(--s-3); }
.tpl-caption { text-align: center; font-size: var(--fs-small); color: var(--text-soft); margin-top: var(--s-3); }
.tpl-desk { border-radius: var(--r-xl); background: var(--world); border: 1px solid var(--line); padding-block: var(--s-4); display: grid; gap: var(--s-4); overflow: hidden; }
.tpl-desk .t-hdr { position: relative; top: 0; }
/* device mock for the phone frame demos */
.tpl-devices { display: flex; flex-wrap: wrap; gap: var(--s-6); justify-content: center; align-items: flex-start; }
.tpl-device { width: min(360px, 100%); height: 740px; border-radius: 44px; border: 10px solid var(--ink); background: var(--world); position: relative; overflow: hidden; box-shadow: var(--shadow-3); isolation: isolate; }
.tpl-device .t-appbar { position: absolute; display: grid; }
.tpl-device .t-scrim, .tpl-device .t-sheet { position: absolute; }
.tpl-device .t-sheet-host { position: static; }
.tpl-device .t-hdr { position: absolute; top: var(--s-3); margin: 0; inset-inline: 0; padding-inline: var(--s-3); }
.tpl-device .t-hdr-in { height: 56px; }
.tpl-device .t-hdr .t-hdr-tel span, .tpl-device .t-hdr .t-hdr-reg { display: none; }
.tpl-screen { position: absolute; inset: 0; overflow: auto; padding: 88px var(--s-4) 120px; display: grid; gap: var(--s-3); align-content: start; scrollbar-width: none; }
.tpl-screen .ph-line { height: 12px; border-radius: 99px; background: var(--line); }
.tpl-screen .ph-hero { font: 800 30px/1.35 var(--font-display); }
.tpl-screen .ph-hero em { font-style: normal; color: var(--red); }
.tpl-screen .ph-box { height: 240px; border-radius: var(--r-paper); background: var(--surface); box-shadow: var(--shadow-paper); }
/* pages index */
.tpl-doc-main { max-width: var(--w-content); margin: 0 auto; padding: var(--s-8) var(--gutter) 120px; display: grid; gap: var(--s-6); }
.tpl-doc-main h1 { font-size: var(--fs-h1); font-weight: 800; }
.tpl-doc-main h2 { font-size: var(--fs-h3); }
.tpl-pages { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-top: var(--s-3); }
.tpl-pages a.is-todo { opacity: .5; pointer-events: none; }
.tpl-pages small { color: var(--text-soft); }
/* review bar */
.tpl-bar { position: fixed; inset-block-end: 12px; left: 50%; transform: translateX(-50%); display: flex; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; white-space: nowrap; justify-content: center; gap: 6px; max-width: calc(100% - 24px); padding: 6px 10px; background: #222; border-radius: 999px; font: 13px/1.4 system-ui, sans-serif; z-index: 999; opacity: .92; }
.tpl-bar a { color: #fff; text-decoration: none; padding: 2px 8px; }
.tpl-bar a.is-state { background: #444; border-radius: 999px; }
@media (max-width: 899px) { .tpl-bar { inset-block-end: auto; inset-block-start: 84px; opacity: .8; } }
/* placeholder band for a section that is not built yet */
.tpl-ph { min-height: 320px; display: grid; place-content: center; justify-items: center; gap: var(--s-2); text-align: center; border: 2px dashed var(--line); border-radius: var(--r-lg); color: var(--text-soft); padding: var(--s-6); }
.tpl-ph h1, .tpl-ph h2 { font-size: var(--fs-h3); color: var(--text); }
.tpl-ph-no { font: 800 var(--fs-small) var(--font-display); color: var(--wine); }
