/* Client app styles. Components and values come from the approved mockup (design/prototype/app.css, v21+);
   only what the product uses is carried over. Mobile first; layout switches use container queries:
   container "root" is the whole screen, container "app" is the client column (design/element-map.md). */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--fs-m);
  line-height: var(--lh);
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
}
h1, h2, h3, p { margin: 0; }
h1 { font-size: var(--fs-xl); line-height: 1.25; font-weight: 700; }
h2 { font-size: var(--fs-l); line-height: 1.3; font-weight: 700; }
h3 { font-size: var(--fs-m); line-height: 1.35; font-weight: 600; }
a { color: var(--accent-text); text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--r-s); }
[tabindex="-1"]:focus:not(:focus-visible) { outline: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--text-2); }
.small { font-size: var(--fs-s); }
.xs { font-size: var(--fs-xs); }
.nowrap { white-space: nowrap; }
.center { text-align: center; }
.stack > * + * { margin-top: var(--s4); }
.stack-s > * + * { margin-top: var(--s2); }
.list > *, .stack > * { min-width: 0; }
.row { display: flex; gap: var(--s3); align-items: center; flex-wrap: wrap; }
.row-between { display: flex; gap: var(--s2) var(--s3); align-items: center; justify-content: space-between; flex-wrap: wrap; }
.grow { flex: 1 1 auto; min-width: 0; }

/* ---------- layout ---------- */
.root { container-type: inline-size; container-name: root; min-height: 100vh; min-height: 100dvh; }
.app { min-width: 0; container-type: inline-size; container-name: app; }
.client-shell { background: var(--surface); min-height: 100vh; min-height: 100dvh; }
.boot { display: grid; place-items: center; min-height: 60vh; }
@container app (min-width: 900px) {
  .client-shell { max-width: 62rem; min-height: 0; margin: var(--s8) auto var(--s12); border-radius: var(--r-l); box-shadow: var(--shadow); overflow: hidden; }
  .client-shell .app-head { padding: var(--s4) var(--s8); }
  .client-body { padding: var(--s8) var(--s8) var(--s10); min-height: 32rem; }
  .client-body > :not(.wide-ok) { max-width: 42rem; }
  .client-body h1 { font-size: var(--fs-xxl); }
  .svc-grid { grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); align-items: stretch; }
  .pick { display: grid; grid-template-columns: minmax(0, 24rem) minmax(0, 1fr); gap: var(--s8); align-items: start; }
  .pick-days .days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); overflow: visible; scroll-snap-type: none; }
  .pick-days .day-pad { display: block; }
  .pick-times h2 { margin-top: 0; }
}
.pick-times h2 { margin-top: var(--s4); }

/* ---------- app chrome ---------- */
.app-head {
  display: flex; align-items: center; gap: var(--s2) var(--s3);
  min-height: 4rem; padding: var(--s3) var(--s4);
  background: var(--surface); border-bottom: 1px solid var(--line);
}
.icon-btn {
  display: inline-grid; place-items: center; flex: none;
  width: var(--tap-min); height: var(--tap-min); border: 0; border-radius: var(--r-full);
  background: transparent; color: var(--text); cursor: pointer;
}
.icon-btn:hover { background: var(--surface-2); }
.icon-btn svg { width: 1.5rem; height: 1.5rem; }
.avatar {
  display: grid; place-items: center; flex: none; overflow: hidden;
  width: 2.75rem; height: 2.75rem; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent-text); font-weight: 700;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.head-title { font-weight: 700; line-height: 1.25; overflow-wrap: anywhere; }
.head-sub { font-size: var(--fs-xs); color: var(--text-2); overflow-wrap: anywhere; }
.head-link {
  display: grid; justify-items: center; gap: 2px; flex: none;
  min-width: var(--tap-min); min-height: var(--tap-min); padding: var(--s1) var(--s2);
  border: 0; border-radius: var(--r-m); background: transparent; color: var(--accent-text);
  font-size: var(--fs-xs); font-weight: 700; white-space: nowrap; cursor: pointer;
}
.head-link:hover { background: var(--surface-2); }
.app-body { padding: var(--s5) var(--s4) var(--s8); background: var(--surface); min-height: 60vh; }
.steps { font-size: var(--fs-s); color: var(--text-2); font-weight: 600; }

/* ---------- controls ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  min-height: var(--tap); padding: var(--s2) var(--s5);
  border-radius: var(--r-m); border: 2px solid transparent;
  font-weight: 700; cursor: pointer; text-decoration: none; text-align: center;
}
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { filter: brightness(1.06); }
.btn-secondary { background: var(--surface); color: var(--accent-text); border-color: var(--accent); }
.btn-ghost { background: transparent; color: var(--accent-text); padding: var(--s2) var(--s3); }
.btn-danger { background: var(--surface); color: var(--err); border-color: var(--err); }
.btn-block { width: 100%; }
.btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; filter: none; }
.btn[aria-busy="true"] { cursor: progress; }
.actions { display: grid; gap: var(--s3); margin-top: var(--s6); }
.actions-sticky { position: sticky; bottom: 0; z-index: 5; background: var(--surface); padding: var(--s3) 0 var(--s4); margin-bottom: calc(-1 * var(--s4)); box-shadow: 0 -8px 12px -10px rgba(15, 23, 42, .25); }

.field { display: block; }
.field-label { display: block; font-weight: 600; margin-bottom: var(--s2); }
.input, .select, .textarea {
  width: 100%; min-height: var(--tap); padding: var(--s3) var(--s4);
  font-size: var(--fs-m); background: var(--surface); color: var(--text);
  border: 1.5px solid var(--field-line); border-radius: var(--r-m);
}
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field-error .input { border-color: var(--err); }
.error-text { color: var(--err); font-size: var(--fs-s); font-weight: 600; margin-top: var(--s1); }
.input-code { letter-spacing: .4em; font-size: var(--fs-l); }

.check {
  display: flex; gap: var(--s3); align-items: flex-start; cursor: pointer;
  padding: var(--s3); border-radius: var(--r-m); border: 1.5px solid var(--line);
}
.check input { width: 1.5rem; height: 1.5rem; margin: .125rem 0 0; flex: none; accent-color: var(--accent); }
.check.required { border-color: var(--field-line); }

.choice {
  display: flex; align-items: center; gap: var(--s3); width: 100%;
  min-height: var(--tap); padding: var(--s4); text-align: left; overflow-wrap: anywhere;
  background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--r-m);
  cursor: pointer; color: var(--text);
}
.choice > * { min-width: 0; }
.choice:hover { border-color: var(--field-line); }
.choice[aria-pressed="true"], .choice[aria-checked="true"] { border-color: var(--accent); background: var(--accent-soft); }
.choice[aria-disabled="true"] { cursor: not-allowed; background: var(--surface-2); }
.choice[aria-disabled="true"] .chev, .choice[aria-disabled="true"] .ch-logo { opacity: .5; }
.choice .chev { margin-left: auto; color: var(--text-2); flex: none; }
.choice > .badge { white-space: nowrap; flex-shrink: 0; }
.choice[role="radio"]::before {
  content: ""; flex: none; width: 1.375rem; height: 1.375rem; border-radius: 50%;
  border: 2px solid var(--field-line); background: var(--surface);
}
.choice[role="radio"][aria-checked="true"]::before { border-color: var(--accent); box-shadow: inset 0 0 0 4px var(--surface); background: var(--accent); }
.list { display: grid; gap: var(--s3); }

.seg { display: flex; gap: var(--s2); flex-wrap: wrap; }
.seg button {
  min-height: var(--tap-min); padding: 0 var(--s4);
  border: 1.5px solid var(--field-line); border-radius: var(--r-full);
  background: var(--surface); cursor: pointer; font-weight: 600; color: var(--text);
}
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.seg button[aria-pressed="true"]::before { content: "✓ "; }

/* ---------- content blocks ---------- */
.card { background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--r-l); padding: var(--s4); overflow-wrap: anywhere; }
.card-tap { width: 100%; text-align: left; cursor: pointer; display: block; color: inherit; font: inherit; }
.card-tap:hover { border-color: var(--field-line); }
.svc-grid > .card { display: flex; flex-direction: column; }
.svc-grid > .card > .meta { margin-top: auto; padding-top: var(--s2); }
.kv { display: grid; grid-template-columns: minmax(0, max-content) minmax(0, 1fr); gap: var(--s2) var(--s4); margin: 0; }
.kv dt { color: var(--text-2); min-width: 0; }
.kv dd { margin: 0; font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.meta { display: flex; flex-wrap: wrap; gap: var(--s1) var(--s3); color: var(--text-2); font-size: var(--fs-s); }
.price { font-weight: 700; white-space: nowrap; }
.divider { border: 0; border-top: 1px solid var(--line); margin: var(--s5) 0; }
.page-desc { color: var(--text-2); }

.badge {
  display: inline-flex; align-items: center; gap: var(--s1);
  padding: .125rem var(--s2); border-radius: var(--r-full);
  font-size: var(--fs-xs); font-weight: 700; line-height: 1.5;
}
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-err { background: var(--err-soft); color: var(--err); }
.badge-info { background: var(--accent-soft); color: var(--accent-text); }
.badge-muted { background: var(--surface-2); color: var(--text-2); border: 1px solid var(--line); }

.note { padding: var(--s3) var(--s4); border-radius: var(--r-m); background: var(--surface-2); border: 1px solid var(--line); font-size: var(--fs-s); }
.note-warn { background: var(--warn-soft); border-color: transparent; color: var(--text); }
.note-err { background: var(--err-soft); border-color: transparent; color: var(--text); }
.note-ok { background: var(--ok-soft); border-color: transparent; color: var(--text); }
.done-ico { color: var(--ok); text-align: center; }
.steps-list { padding-left: var(--s5); }

/* calendar and slots (1.03) */
.days { display: flex; gap: var(--s2); overflow-x: auto; padding-bottom: var(--s2); scroll-snap-type: x mandatory; }
.day {
  flex: 0 0 4.25rem; min-height: 4.5rem; scroll-snap-align: start;
  display: grid; place-items: center; gap: 0; padding: var(--s2) 0;
  border: 1.5px solid var(--line); border-radius: var(--r-m); background: var(--surface); cursor: pointer; color: var(--text);
}
.day .dw { font-size: var(--fs-xs); color: var(--text-2); }
.day .dn { font-size: var(--fs-l); font-weight: 700; line-height: 1.2; }
.day .dm { font-size: var(--fs-xs); color: var(--text-2); }
.day[disabled] { cursor: not-allowed; background: var(--surface-2); }
.day[disabled] .dn { color: var(--text-2); font-weight: 400; text-decoration: line-through; }
.day[aria-pressed="true"] { border-color: var(--accent); background: var(--accent); color: var(--on-accent); }
.day[aria-pressed="true"] .dw, .day[aria-pressed="true"] .dm { color: var(--on-accent); }
.day-pad { display: none; }
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 5.5rem), 1fr)); gap: var(--s2); }
.slot {
  min-height: var(--tap); border: 1.5px solid var(--field-line); border-radius: var(--r-m);
  background: var(--surface); font-weight: 700; cursor: pointer; color: var(--text);
}
.slot:hover { border-color: var(--accent); }
.slot[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.part-title { font-size: var(--fs-s); color: var(--text-2); font-weight: 600; margin: var(--s4) 0 var(--s2); }

/* channel logos in phone and reminder choices */
.ch-logo { width: 2.75rem; height: 2.75rem; border-radius: var(--r-m); display: grid; place-items: center; color: #fff; font-weight: 800; font-size: var(--fs-s); flex: none; }
.ch-tg { background: #1F7FBF; } .ch-max { background: #5B3FD6; } .ch-vk { background: #0A63D6; } .ch-web { background: #475569; }

/* sheets (consent text) */
.sheet-backdrop { position: fixed; inset: 0; z-index: 60; background: rgba(2, 6, 23, .55); display: flex; align-items: flex-end; justify-content: center; }
.sheet {
  width: 100%; max-width: 35rem; max-height: 92%; overflow: auto;
  background: var(--surface); border-radius: var(--r-l) var(--r-l) 0 0; padding: var(--s5) var(--s4) var(--s8);
}
@container root (min-width: 640px) { .sheet-backdrop { align-items: center; } .sheet { border-radius: var(--r-l); } }
.sheet-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s3); margin-bottom: var(--s4); }
.sheet-text { white-space: pre-wrap; }

.spinner { width: 2rem; height: 2rem; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--accent); animation: spin 1s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

.toast-region { position: fixed; left: 50%; bottom: 5rem; transform: translateX(-50%); z-index: 70; width: min(32rem, calc(100% - 2rem)); display: grid; gap: var(--s2); pointer-events: none; }
.toast { background: var(--text); color: var(--surface); padding: var(--s3) var(--s4); border-radius: var(--r-m); box-shadow: var(--shadow); font-weight: 600; }

/* very large system font (WCAG 1.4.4, 1.4.10): nothing may push the screen wider than the phone */
.app-body { overflow-wrap: anywhere; }
.app-body * { min-width: 0; }
@container root (max-width: 20rem) {
  .app-head { flex-wrap: wrap; }
  .head-link { white-space: normal; }
  .nowrap { white-space: normal; }
}

/* ---------- special service labels, places of classes (§18.38, 1.29) ---------- */
.svc-tags { display: flex; flex-wrap: wrap; gap: var(--s1) var(--s2); margin-bottom: var(--s2); }
.badge-key { font-weight: 800; font-size: var(--fs-s); }
.seat-list { gap: var(--s2); }
.choice.seat { min-height: var(--tap); gap: var(--s3); }
.choice.seat .seat-t { font-size: var(--fs-l); min-width: 3.5rem; }
.choice.seat[aria-disabled="true"] { opacity: .6; }
.slot .slot-sub { display: block; font-size: var(--fs-xs); font-weight: 600; opacity: .8; }
.section-title { font-size: var(--fs-s); font-weight: 700; color: var(--text-2); text-transform: uppercase; letter-spacing: .04em; margin: var(--s6) 0 var(--s3); }
.pkg-meter { display: grid; gap: var(--s1); padding: var(--s4); border-radius: var(--r-m); background: var(--ok-soft); border: 1.5px solid var(--ok); }
.pkg-meter b { font-size: var(--fs-l); }
.field-help { display: block; font-size: var(--fs-s); color: var(--text-2); margin-top: var(--s1); }

/* ---------- cabinet (2.xx) ---------- */
.cab { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; background: var(--surface); }
.cab > .cab-nav { order: 3; }
.cab > .app-body { order: 2; flex: 1 1 auto; }
.cab-nav {
  position: sticky; bottom: 0; z-index: 20;
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
  background: var(--surface); border-top: 1px solid var(--line);
}
.cab-nav button {
  display: grid; justify-items: center; gap: 2px;
  min-height: 3.5rem; padding: var(--s2) 0; border: 0; background: transparent;
  color: var(--text-2); font-size: var(--fs-xs); font-weight: 600; cursor: pointer;
}
.cab-nav button svg { width: 1.5rem; height: 1.5rem; }
.cab-nav button[aria-current="page"] { color: var(--accent-text); }
.cab-nav button[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
.nav-ico { position: relative; display: inline-grid; place-items: center; }
.nav-count { position: absolute; top: -.45rem; right: -.8rem; min-width: 1.25rem; height: 1.25rem; padding: 0 .3rem; border-radius: var(--r-full); background: #B91C1C; color: #fff; font-size: .75rem; font-weight: 800; line-height: 1.25rem; text-align: center; }
@container app (max-width: 18rem) {
  .cab-nav { position: static; grid-template-columns: 1fr; gap: var(--s1); padding: var(--s2); }
  .cab-nav button { grid-auto-flow: column; justify-content: start; gap: var(--s2); padding: var(--s2); font-size: var(--fs-s); }
}
/* cabinet on a computer: side menu (board 2.01) */
@container app (min-width: 900px) {
  .cab { display: grid; grid-template-columns: 15rem minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .cab .app-head { grid-column: 1 / -1; padding: var(--s4) var(--s8); }
  .cab .cab-nav { grid-row: 2; grid-column: 1; position: sticky; top: var(--demo-top-h, 0px); align-self: start; display: flex; flex-direction: column; border-top: 0; border-right: 1px solid var(--line); padding: var(--s3); gap: var(--s1); }
  .cab .cab-nav button { grid-auto-flow: column; justify-content: start; gap: var(--s3); padding: var(--s3); border-radius: var(--r-m); font-size: var(--fs-m); min-height: var(--tap); }
  .cab .cab-nav button[aria-current="page"] { background: var(--accent-soft); }
  .cab .app-body { grid-row: 2; grid-column: 2; padding: var(--s8); min-height: 0; }
  .cab .app-body > * { max-width: 56rem; }
}
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 9rem), 1fr)); gap: var(--s3); }
.stat { padding: var(--s3) var(--s4); border-radius: var(--r-m); background: var(--surface-2); border: 1px solid var(--line); }
.stat.err { background: var(--err-soft); }
.stat .n { font-size: var(--fs-xl); font-weight: 800; line-height: 1.2; }
.stat .l { font-size: var(--fs-s); color: var(--text-2); }
.feed { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s3); }
.feed li { display: grid; grid-template-columns: auto 1fr; gap: var(--s3); align-items: start; }
.feed .ico { width: 2rem; height: 2rem; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); font-size: var(--fs-s); }
.feed .ico.err { background: var(--err-soft); color: var(--err); font-weight: 800; }
.feed time { display: block; font-size: var(--fs-xs); color: var(--text-2); }
.channel-row { display: grid; grid-template-columns: auto 1fr; gap: var(--s3); align-items: center; }
.timeline { display: grid; gap: var(--s2); }
.tl-row { display: grid; grid-template-columns: minmax(0, max-content) minmax(0, 1fr); gap: var(--s3); align-items: stretch; }
.tl-time { font-size: var(--fs-s); color: var(--text-2); padding-top: var(--s2); min-width: 3rem; }
.tl-free { border: 1.5px dashed var(--line); border-radius: var(--r-m); padding: var(--s2) var(--s3); color: var(--text-2); font-size: var(--fs-s); }
.tl-free-btn { display: flex; justify-content: space-between; gap: var(--s2); flex-wrap: wrap; width: 100%; text-align: left; background: transparent; cursor: pointer; font: inherit; font-size: var(--fs-s); min-height: var(--tap-min); align-items: center; }
.tl-free-btn .tl-add { color: var(--accent-text); font-weight: 700; }
.tl-free-btn:hover { border-color: var(--accent); }
.tl-book { border-radius: var(--r-m); padding: var(--s2) var(--s3); background: var(--accent-soft); border: 0; border-left: 4px solid var(--accent); color: var(--text); }
.tl-class { border-left-color: var(--ok); background: var(--ok-soft); width: 100%; text-align: left; }
.tl-closed { border-radius: var(--r-m); padding: var(--s2) var(--s3); background: var(--surface-2); color: var(--text-2); font-size: var(--fs-s); }
.week { display: grid; grid-template-columns: 3.5rem repeat(7, minmax(0, 1fr)); gap: 2px; font-size: var(--fs-xs); }
.week > div, .week > button { min-height: 2.25rem; padding: 2px 4px; border-radius: 4px; }
.week .wh { font-weight: 700; text-align: center; color: var(--text-2); }
.week .wt { color: var(--text-2); }
.week .wo { background: var(--surface-2); }
.week .wb { background: var(--accent-soft); border-left: 3px solid var(--accent); color: var(--text); font-weight: 600; overflow: hidden; }
.week .wx { background: repeating-linear-gradient(45deg, var(--surface-2), var(--surface-2) 4px, transparent 4px, transparent 8px); }
.week > button.wo { border: 0; cursor: pointer; color: var(--accent-text); font: inherit; font-weight: 700; }
.week > button.wo:hover { outline: 2px solid var(--accent); }
.week > button.wo span { opacity: 0; }
.week > button.wo:hover span, .week > button.wo:focus-visible span { opacity: 1; }
.week .wc { border: 0; border-left: 3px solid var(--ok); background: var(--ok-soft); cursor: pointer; font: inherit; font-size: var(--fs-xs); font-weight: 700; color: var(--text); text-align: left; }
.week-only { display: none; }
@container app (min-width: 900px) { .week-only { display: block; } .week.week-only { display: grid; } }
/* §18.44: hours and minutes side by side */
.tp-field { min-width: 0; }
.tpair { display: flex; align-items: center; gap: var(--s1); }
.tpair .select { flex: 1 1 0; min-width: 0; padding-inline: var(--s2); }
.tp-sep { font-weight: 800; }
.tp-row { align-items: flex-end; }
.tp-row > .tp-field { flex: 1 1 11rem; }
.card-sub { padding: var(--s3); border-radius: var(--r-m); border: 1.5px solid var(--accent); background: var(--surface); }
.choice > .small:last-child { white-space: nowrap; flex-shrink: 0; }

/* ---------- C3: switch, series, payments, packages, messages (mockup app.css) ---------- */
.switch-row { display: flex; align-items: center; gap: var(--s3); justify-content: space-between; }
.switch { position: relative; width: 3.25rem; height: 2rem; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.switch span { position: absolute; inset: 0; border-radius: var(--r-full); background: var(--field-line); transition: background .15s; pointer-events: none; }
.switch span::after { content: ""; position: absolute; top: .25rem; left: .25rem; width: 1.5rem; height: 1.5rem; border-radius: 50%; background: #fff; transition: transform .15s; }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(1.25rem); }
.switch input:focus-visible + span { box-shadow: var(--focus); }
.series-list { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--s1); }
.series-list li { display: flex; justify-content: space-between; gap: var(--s2); flex-wrap: wrap; padding: var(--s1) 0; border-bottom: 1px solid var(--line); font-size: var(--fs-s); }
.series-list li.bad > span:first-child { text-decoration: line-through; color: var(--text-2); }
.pay-card .pay-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s1) var(--s3); }
.pay-card .pay-row > .small { flex: 0 0 100%; }
.pkg-dots { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: var(--s2); }
.pkg-dots i { width: 1.25rem; height: 1.25rem; border-radius: 50%; background: var(--ok); }
.pkg-dots i.used { background: transparent; border: 2px solid var(--text-2); }
.thread { display: flex; flex-direction: column; gap: var(--s2); }
.bubble { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-l) var(--r-l) var(--r-l) 4px; padding: var(--s3) var(--s4); max-width: 85%; white-space: pre-wrap; overflow-wrap: anywhere; }
.bubble.me { align-self: flex-end; border-radius: var(--r-l) var(--r-l) 4px var(--r-l); background: var(--accent-soft); border-color: transparent; }
.textarea { min-height: 7rem; resize: vertical; }
.file-pick { position: absolute; width: 1px; height: 1px; opacity: 0; }
.sheet-text { white-space: pre-wrap; }
.series-card { display: grid; gap: var(--s2); }
.proof-big { max-width: 14rem; margin: 0 auto; border-radius: var(--r-m); overflow: hidden; box-shadow: var(--shadow); }
.proof-img { display: block; width: 100%; height: auto; }
.menu { display: grid; gap: var(--s2); }
.menu .choice { min-height: 3.5rem; }
.menu .choice small { display: block; color: var(--text-2); font-size: var(--fs-xs); }
.seg-s button { font-size: var(--fs-s); padding: var(--s1) var(--s2); }
.series-line { font-size: var(--fs-s); line-height: 1.7; }

/* C6: text editor with inserts, channels, the client page preview, legal checklists (from the mockup) */
.editor { min-height: 7rem; padding: var(--s3) var(--s4); border: 1.5px solid var(--field-line); border-radius: var(--r-m); background: var(--surface); line-height: 1.9; white-space: pre-wrap; }
.editor:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.ph-chip { display: inline-block; padding: 0 var(--s2); margin: 0 1px; border-radius: var(--r-s); background: var(--accent-soft); color: var(--accent-text); font-weight: 700; font-size: .95em; line-height: 1.5; user-select: all; }
.chips { display: flex; gap: var(--s2); flex-wrap: wrap; }
.chips button { min-height: var(--tap-min); padding: 0 var(--s3); border-radius: var(--r-full); border: 1.5px dashed var(--accent); background: var(--surface); color: var(--accent-text); font-weight: 700; cursor: pointer; }
.qr { width: 9rem; height: 9rem; background: #fff; padding: .5rem; border-radius: var(--r-s); border: 1px solid var(--line); flex: none; }
.qr svg { width: 100%; height: 100%; display: block; }
.qr-only-wide { display: none; }
@container root (min-width: 1024px) { .qr-only-wide { display: flex; } }
.link-box { display: flex; gap: var(--s2); align-items: center; padding: var(--s3); border-radius: var(--r-m); background: var(--surface-2); border: 1px solid var(--line); word-break: break-all; font-weight: 600; }
.page-edit { display: grid; gap: var(--s5); }
.pv-frame { border: 1px solid var(--line); border-radius: var(--r-l); overflow: hidden; box-shadow: var(--shadow); pointer-events: none; }
.pv-frame .app-body { min-height: 0; padding: var(--s4); }
@container app (min-width: 900px) {
  .page-edit { grid-template-columns: minmax(0, 1fr) minmax(0, 22rem); align-items: start; }
  .page-edit > .page-preview { order: 2; position: sticky; top: 9rem; }
}
.legal p { margin: 0 0 var(--s2); }
.check-list { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--s2); }
.doc-text { white-space: pre-wrap; }

.chat { background: var(--chat-bg); border-radius: var(--r-l); padding: var(--s4); display: flex; flex-direction: column; }
.chat-head { display: flex; align-items: center; gap: var(--s2); font-size: var(--fs-s); font-weight: 700; margin-bottom: var(--s3); }
.chat-head .avatar { width: 2rem; height: 2rem; font-size: var(--fs-xs); }
.chat .bubble { max-width: 90%; }
.chat .bubble + .bubble-btn { margin-top: var(--s2); }
.bubble-btn { display: block; max-width: 90%; text-align: center; padding: var(--s2); border-radius: var(--r-m); background: var(--bubble); color: var(--accent-text); font-weight: 700; font-size: var(--fs-s); border: 0; width: 100%; }

/* C8: demo layer (from the mockup): demo bar, sandbox tabs, expiry bar, hints, next-step cards, entry, cookie banner */
.demo-bar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between; gap: var(--s3); flex-wrap: wrap;
  min-height: 3.5rem; padding: var(--s2) var(--s4);
  background: var(--bk-bar); color: var(--bk-bar-text);
}
.demo-bar .tag { display: inline-flex; align-items: center; gap: var(--s2); font-size: var(--fs-s); font-weight: 600; }
.demo-bar .dot { width: .625rem; height: .625rem; border-radius: 50%; background: var(--bk-cta); flex: none; }
.btn-bk {
  min-height: var(--tap-min); padding: 0 var(--s4);
  border: 0; border-radius: var(--r-full);
  background: var(--bk-cta); color: var(--bk-cta-text);
  font-weight: 700; font-size: var(--fs-s); cursor: pointer; text-align: center;
}
.btn-bk:hover { filter: brightness(1.05); }
.demo-bar .btn-bk:focus-visible { box-shadow: 0 0 0 3px var(--bk-bar), 0 0 0 5px var(--bk-cta); }
.hide-s { display: none; }
@container root (min-width: 420px) { .hide-s { display: inline; } }

.expiry-bar { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s3); align-items: center; justify-content: space-between; padding: var(--s3) var(--s4); background: var(--warn-soft); color: var(--text); font-size: var(--fs-s); }

.tabs {
  position: sticky; top: 3.5rem; z-index: 25;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 9rem), 1fr)); gap: var(--s2);
  padding: var(--s2) var(--s3); background: var(--bk-bar);
}
.tabs button {
  min-width: 0; overflow-wrap: anywhere;
  display: grid; justify-items: center; align-content: center; gap: 2px;
  min-height: 3.75rem; padding: var(--s1) var(--s2); border: 2px solid transparent; border-radius: var(--r-m);
  background: rgba(255,255,255,.08); color: var(--bk-bar-text); cursor: pointer; text-align: center;
}
.tabs button:hover { background: rgba(255,255,255,.16); }
.tabs button[aria-selected="true"] { background: var(--surface); color: var(--text); border-color: var(--bk-cta); }
.tabs .tab-t { font-size: var(--fs-m); font-weight: 800; }
.tabs .tab-s { display: none; font-size: var(--fs-xs); opacity: .85; }
@container root (min-width: 600px) { .tabs .tab-s { display: block; } }
.tabs .tab-t { white-space: nowrap; }
@container root (max-width: 20rem) { .tabs .tab-t { white-space: normal; } }
.tab-count { display: inline-grid; place-items: center; min-width: 1.4rem; height: 1.4rem; padding: 0 .35rem; margin-left: var(--s2); border-radius: var(--r-full); background: #B91C1C; color: #fff; font-size: var(--fs-xs); font-weight: 800; vertical-align: 2px; }
@container root (min-width: 900px) {
  .tabs { grid-template-columns: minmax(0, 20rem) minmax(0, 20rem); justify-content: center; padding: var(--s3) var(--s6); }
  .tabs button { min-height: 4rem; }
}
.new-dot { display: inline-block; width: .625rem; height: .625rem; margin-left: var(--s2); border-radius: 50%; background: var(--err); vertical-align: middle; }

/* ---------- layout ---------- */
.page { max-width: 35rem; margin: 0 auto; padding: var(--s5) var(--s4) var(--s12); }
.pane { min-width: 0; container-type: inline-size; container-name: app; }
.pane[hidden] { display: none; }
.pane-label { display: none; }
.pane-body { background: var(--surface); }
/* §18.45: one side at a time on any width; each side in its own full layout */
.sandbox { background: var(--bg); }
.pane-client .client-shell { background: var(--surface); }
@container app (min-width: 900px) {
  .pane-client .client-shell { max-width: 62rem; margin: var(--s8) auto var(--s12); border-radius: var(--r-l); box-shadow: var(--shadow); overflow: hidden; }
  .pane-client .app-head { padding: var(--s4) var(--s8); }
  .pane-client .client-body { padding: var(--s8) var(--s8) var(--s10); min-height: 32rem; }
  .pane-client .client-body > :not(.wide-ok) { max-width: 42rem; }
  .pane-client .client-body h1 { font-size: var(--fs-xxl); }
  .svc-grid { grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); align-items: stretch; }
  .pick { display: grid; grid-template-columns: minmax(0, 24rem) minmax(0, 1fr); gap: var(--s8); align-items: start; }
  .pick-days .days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); overflow: visible; scroll-snap-type: none; }
  .pick-times h2 { margin-top: 0; }
  .pane-cab .cab-standalone { min-height: calc(100vh - 8rem); }
  .pane-cab .cab-standalone .cab-nav { top: 8.5rem; }
  .pane-cab .cab-standalone .app-body { padding: var(--s8) var(--s10); }
  .pane-cab .cab-standalone .app-body > * { max-width: 56rem; }
}
.hint {
  display: flex; gap: var(--s3); align-items: flex-start;
  padding: var(--s3) var(--s4); border-radius: var(--r-m);
  background: var(--bk-hint); color: var(--bk-hint-text);
  border-left: 4px solid var(--bk-hint-line); font-size: var(--fs-s);
}
.hint .hint-ico { flex: none; font-weight: 800; }
.next { padding: var(--s4); border-radius: var(--r-l); background: var(--bk-hint); color: var(--bk-hint-text); border: 2px solid var(--bk-hint-line); }
.next h3 { margin-bottom: var(--s1); }
.next .actions { margin-top: var(--s3); }
.next .choice { color: var(--text); }
.placeholder { border-bottom: 2px dashed var(--warn); background: var(--warn-soft); padding: 0 .2em; border-radius: 4px; }
.hero-note { padding: var(--s4); border-radius: var(--r-l); background: var(--surface); border: 1.5px solid var(--line); }
.demo-entry h1 { font-size: var(--fs-xxl); }
.cookie { position: sticky; bottom: 0; z-index: 40; margin: var(--s4); padding: var(--s4); border-radius: var(--r-m); background: var(--surface); box-shadow: 0 12px 28px -8px rgba(30,41,90,.25), 0 2px 6px rgba(15,23,42,.08); display: grid; gap: var(--s3); font-size: var(--fs-s); }
#layer > .cookie { position: fixed; left: 0; right: 0; bottom: 0; margin: var(--s3); max-width: 44rem; margin-inline: auto; z-index: 50; }
@media (max-width: 47rem) { #layer > .cookie { margin: var(--s2); } }
.next-strong { border-width: 2px; }
.next-strong h3 { font-size: var(--fs-l); }
#demo-cookie > .cookie { position: fixed; left: 0; right: 0; bottom: 0; margin: var(--s3); max-width: 44rem; margin-inline: auto; z-index: 50; }
@media (max-width: 47rem) { #demo-cookie > .cookie { margin: var(--s2); } }
/* the demo layer lives in its own wrapper above #app: the wrapper sticks, the side menu of the cabinet goes below it */
#demo-top { position: sticky; top: 0; z-index: 30; }
#demo-top .demo-bar, #demo-top .tabs { position: static; }
/* C9: 0.11 iPhone pictures (from the mockup) */
.ios-steps { list-style: none; counter-reset: ios; padding: 0; display: grid; gap: var(--s4); }
.ios-steps > li { counter-increment: ios; display: grid; gap: var(--s2); }
.ios-steps > li > p::before { content: counter(ios) ". "; font-weight: 800; color: var(--accent-text); }
.ios-pic { display: block; width: 100%; max-width: 20rem; height: auto; }
details.card > summary { cursor: pointer; min-height: var(--tap-min); display: flex; align-items: center; }
