/* Client self-service pages: /book/, /q/, /guide/, /manage/. Load after /assets/brand.css.
   Mobile first (380px). Every tap target is at least 48px. No fixed bottom bars, so the on-screen keyboard never covers a button. */
html { scroll-padding-top: 132px; }
body { overflow-x: hidden; }
.flow { max-width: 600px; margin: 0 auto; padding: 0 var(--gutter) 64px; }
.flow-top { position: sticky; top: 0; z-index: 10; background: var(--linen); border-bottom: 1px solid var(--line); }
.flow-top-in { max-width: 600px; margin: 0 auto; padding: 8px var(--gutter) 8px; }
.flow-brand { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 32px; }
.flow-brand a.logo { display: inline-flex; align-items: center; min-height: 32px; font: 500 20px var(--font-display); color: var(--ink); text-decoration: none; }
.flow-brand a.logo img { height: 20px; width: auto; }
.flow-brand .help { font-size: 14px; color: var(--ink-soft); display: inline-flex; align-items: center; min-height: 32px; }

/* step indicator */
.steps { list-style: none; display: flex; gap: 4px; margin: 6px 0 0; padding: 0; }
.steps li { flex: 1; min-width: 0; text-align: center; font-size: 11.5px; font-weight: 600; color: var(--ink-soft); line-height: 1.2; }
.steps li::before { content: ''; display: block; height: 5px; border-radius: 99px; background: var(--line); margin-bottom: 4px; }
.steps li.done::before { background: var(--sage); }
.steps li.on { color: var(--ink); }
.steps li.on::before { background: var(--clay); }
.steps li span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* always-visible price summary */
.summary { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-top: 6px; padding-top: 6px; border-top: 1px dashed var(--line); font-size: 14px; line-height: 1.3; }
.summary .what { min-width: 0; color: var(--ink-soft); }
.summary .what b { color: var(--ink); font-weight: 600; }
.summary .price { flex: none; text-align: right; font-weight: 700; white-space: nowrap; }
.summary .price small { display: block; font-weight: 500; color: var(--ink-soft); font-size: 12px; }

.flow h1 { font-size: 30px; margin: 22px 0 8px; }
.flow h2 { font-size: 23px; margin: 26px 0 10px; }
.flow h3 { font-size: 18px; margin: 18px 0 6px; }
.flow p { margin: 0 0 12px; }
.lede { font-size: 18px; color: var(--ink-soft); }
.stack { display: grid; gap: 12px; }
.actions { display: grid; gap: 10px; margin-top: 22px; }
.linkbtn { background: none; border: 0; padding: 0 4px; min-height: var(--tap); color: var(--clay-dark); font: 600 16px var(--font-body); text-decoration: underline; cursor: pointer; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.row2 > * { min-width: 0; }
[hidden] { display: none !important; }

/* radio / checkbox cards */
.pick { display: flex; gap: 12px; align-items: flex-start; margin: 0; padding: 14px; min-height: 56px; background: var(--paper); border: 1.5px solid var(--line); border-radius: var(--radius); cursor: pointer; font-weight: 400; font-size: 16px; }
.pick input { flex: none; margin: 2px 0 0; }
.pick .body { min-width: 0; flex: 1; }
.pick .title { display: flex; justify-content: space-between; gap: 10px; font-weight: 700; font-size: 17px; }
.pick .title .amt { white-space: nowrap; }
.pick .sub { display: block; color: var(--ink-soft); font-size: 15px; margin-top: 2px; }
.pick.on { border-color: var(--clay); box-shadow: 0 0 0 2px color-mix(in srgb, var(--clay) 25%, transparent); }
.pick ul { margin: 8px 0 0; padding-left: 18px; color: var(--ink-soft); font-size: 15px; }
.pick.inset { margin-top: 8px; background: color-mix(in srgb, var(--butter) 45%, var(--paper)); border-style: dashed; }
.check { display: flex; gap: 12px; align-items: flex-start; min-height: var(--tap); padding: 12px 0; margin: 0; font-weight: 400; font-size: 16px; cursor: pointer; }
.check input { flex: none; margin-top: 2px; }

/* calendar */
.cal { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 0 8px; }
details.fold .cal { margin: 0 -16px; border-left: 0; border-right: 0; border-radius: 0; }
.cal-head { display: flex; align-items: center; justify-content: space-between; padding: 0 10px 6px; }
.cal-head strong { font: 500 19px var(--font-display); }
.cal-nav { width: 48px; height: 48px; border-radius: 50%; border: 1.5px solid var(--line); background: #fff; font-size: 20px; color: var(--ink); cursor: pointer; }
.cal-nav[disabled] { opacity: .35; cursor: default; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 0; }
.cal-dow { text-align: center; font-size: 12px; font-weight: 700; color: var(--ink-soft); padding: 4px 0; }
.cal-day { position: relative; min-height: 50px; border: 2px solid transparent; background-clip: padding-box; border-radius: 13px; background-color: transparent; color: var(--ink-soft); font: 500 16px var(--font-body); opacity: .45; padding: 0; }
.cal-day.open { background-color: color-mix(in srgb, var(--sage) 26%, var(--paper)); color: var(--ink); font-weight: 700; opacity: 1; cursor: pointer; }
.cal-day.open.sat::after { content: ''; position: absolute; left: 50%; bottom: 6px; width: 5px; height: 5px; margin-left: -2.5px; border-radius: 50%; background: var(--clay); }
.cal-day.sel { background-color: var(--clay); color: #fff; }
.cal-day.sel.sat::after { background: #fff; }
.cal-key { display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 8px 12px 0; font-size: 13px; color: var(--ink-soft); }
.cal-key i { display: inline-block; width: 12px; height: 12px; border-radius: 4px; background: color-mix(in srgb, var(--sage) 26%, var(--paper)); vertical-align: -1px; margin-right: 5px; }
.cal-key i.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--clay); vertical-align: 2px; }
.times { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.time { min-height: 60px; border-radius: var(--radius); border: 1.5px solid var(--line); background: var(--paper); font: 700 18px var(--font-body); color: var(--ink); cursor: pointer; }
.time small { display: block; font-weight: 500; font-size: 13px; color: var(--ink-soft); }
.time.sel { background: var(--clay); border-color: var(--clay); color: #fff; }
.time.sel small { color: #fff; }

/* messages */
.note { background: color-mix(in srgb, var(--butter) 50%, var(--paper)); border: 1px solid var(--butter); border-radius: var(--radius-sm); padding: 12px 14px; font-size: 15.5px; }
.note.ok { background: color-mix(in srgb, var(--sage) 22%, var(--paper)); border-color: color-mix(in srgb, var(--sage) 50%, var(--paper)); }
.err { background: color-mix(in srgb, var(--danger) 10%, var(--paper)); border: 1px solid color-mix(in srgb, var(--danger) 40%, var(--paper)); color: var(--danger); border-radius: var(--radius-sm); padding: 12px 14px; font-size: 15.5px; font-weight: 600; }
.bad { border-color: var(--danger) !important; }
.fine { font-size: 13.5px; color: var(--ink-soft); line-height: 1.5; }
.hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* children rows */
.kid { display: grid; grid-template-columns: 1fr 104px 48px; gap: 8px; align-items: end; margin-bottom: 8px; }
.kid label { margin-top: 0; font-size: 13px; }
.kid .rm { width: 48px; height: 48px; border-radius: var(--radius-sm); border: 1.5px solid var(--line); background: #fff; font-size: 22px; line-height: 1; color: var(--ink-soft); cursor: pointer; }

/* legal documents */
.legal { max-height: 46vh; min-height: 180px; overflow-y: auto; -webkit-overflow-scrolling: touch; background: #fff; border: 1.5px solid var(--line); border-radius: var(--radius-sm); padding: 14px 14px 4px; font-size: 15px; line-height: 1.5; }
.legal:focus { outline: 3px solid color-mix(in srgb, var(--clay) 35%, transparent); }
.legal h2.legal-title { font-size: 20px; margin: 0 0 2px; }
.legal h3 { font: 700 15px var(--font-body); margin: 14px 0 4px; letter-spacing: 0; }
.legal ul { margin: 0 0 8px; padding-left: 18px; }
.legal li { margin-bottom: 5px; }
.legal .legal-version { color: var(--ink-soft); font-size: 13px; margin: 0 0 8px; }
.legal-draft { background: var(--butter); border-radius: 6px; padding: 8px 10px; font-size: 14px; margin: 0 0 12px; }
.scroll-hint { font-size: 13px; color: var(--ink-soft); margin: 6px 0 0; }

/* signature */
.sig { position: relative; background: #fff; border: 1.5px dashed var(--ink-soft); border-radius: var(--radius-sm); height: 170px; touch-action: none; overflow: hidden; }
.sig canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: crosshair; }
.sig .line { position: absolute; left: 16px; right: 16px; bottom: 42px; border-bottom: 1.5px solid var(--line); pointer-events: none; }
.sig .ph { position: absolute; left: 0; right: 0; top: 50%; margin-top: -30px; text-align: center; color: var(--ink-soft); font-size: 15px; pointer-events: none; }
.sig-row { display: flex; justify-content: space-between; align-items: center; }

/* key/value lists */
.kv { margin: 0; display: grid; grid-template-columns: fit-content(62%) 1fr; gap: 6px 14px; font-size: 16px; }
.kv dt { color: var(--ink-soft); }
.kv dd { margin: 0; text-align: right; font-weight: 600; overflow-wrap: break-word; }
.kv .total dt, .kv .total dd { border-top: 1px solid var(--line); padding-top: 8px; font-size: 18px; color: var(--ink); font-weight: 700; }
.copy { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.copy:last-child { border-bottom: 0; }
.copy span { min-width: 0; overflow-wrap: anywhere; }
.copy small { display: block; color: var(--ink-soft); font-size: 13px; }
.copy b { font-size: 17px; }
.copy button { flex: none; min-width: 72px; min-height: 48px; border-radius: 999px; border: 1.5px solid var(--line); background: #fff; font: 600 14px var(--font-body); cursor: pointer; }
.code { font: 700 24px var(--font-body); letter-spacing: .08em; }
.next { counter-reset: n; list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.next li { counter-increment: n; position: relative; padding-left: 44px; min-height: 32px; }
.next li::before { content: counter(n); position: absolute; left: 0; top: 0; width: 32px; height: 32px; border-radius: 50%; background: var(--butter); font-weight: 700; display: flex; align-items: center; justify-content: center; }
.spin { display: inline-block; width: 18px; height: 18px; border: 2.5px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin { animation-duration: 2s; } }
.loading { padding: 40px 0; text-align: center; color: var(--ink-soft); }
details.fold { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 0 16px; }
details.fold summary { min-height: 56px; display: flex; align-items: center; justify-content: space-between; font-weight: 700; cursor: pointer; list-style: none; }
details.fold summary::-webkit-details-marker { display: none; }
details.fold summary::after { content: '+'; font-size: 24px; font-weight: 400; color: var(--clay-dark); }
details.fold[open] summary::after { content: '\2212'; }
details.fold > :last-child { margin-bottom: 16px; }

@media (min-width: 560px) { .flow h1 { font-size: 36px; } .steps li { font-size: 13px; } }
@media print {
  .flow-top, .no-print, .actions { display: none !important; }
  body { background: #fff; font-size: 12pt; }
  .flow { max-width: none; padding: 0; }
  .card { box-shadow: none; break-inside: avoid; }
  a { color: inherit; text-decoration: none; }
  .legal { max-height: none; overflow: visible; border: 0; padding: 0; }
}
