/* ============================================================================
 * Harizma Design System — atoms.css
 * THE single source of truth for the component atoms (.hz-btn / .hz-card /
 * .hz-input / .hz-pill). Defined ONCE here; every page links this file DIRECTLY
 * (right after tokens.css, so the deploy's ?v= cache-bust reaches it), then adds
 * its register/layer on top:
 *
 *   • the product app-family (tokens.css defaults + primitives.css) → PRODUCT register
 *   • the marketing pages    (marketing.css re-points the tokens)    → MARKETING register
 *
 * The atoms read ONLY the component-register tokens from tokens.css
 * (--hz-btn-*, --hz-card-*, --hz-input-*, --hz-pill-*) plus the semantic brand
 * tokens. A surface shifts "register" (restrained ⇄ expressive, product ⇄ marketing)
 * by re-pointing those tokens — never by re-declaring an atom. That is the
 * "one system, two intensities" seam: structure is shared, intensity is a
 * token. Expects tokens.css (contract) and base.css/.hz-root or a page shim
 * for the :focus-visible ring. Zero raw values below.
 * ========================================================================== */

/* ===========================================================================
 * Button
 * ========================================================================= */
.hz-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--hz-btn-gap, var(--hz-space-2));
  min-height: var(--hz-btn-min-h, var(--hz-tap-min));
  min-width: var(--hz-btn-min-w, auto);
  padding: var(--hz-btn-pad-y) var(--hz-btn-pad-x);
  font-family: var(--hz-font-body);
  font-size: var(--hz-btn-font-size);
  font-weight: var(--hz-btn-weight);
  line-height: 1;
  letter-spacing: var(--hz-btn-tracking);
  white-space: nowrap;
  color: var(--hz-text);
  background: transparent;
  border: var(--hz-btn-border-width) solid transparent;
  border-radius: var(--hz-btn-radius);
  text-decoration: none;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;      /* kill 300ms tap delay on mobile */
  transition:
    transform var(--hz-dur-fast) var(--hz-btn-ease),
    background var(--hz-dur-fast) var(--hz-ease),
    box-shadow var(--hz-dur-fast) var(--hz-ease),
    filter    var(--hz-dur-fast) var(--hz-ease),
    border-color var(--hz-dur-fast) var(--hz-ease);
}
.hz-btn:active { transform: var(--hz-btn-active-transform, translateY(1px) scale(.99)); }
.hz-btn:disabled,
.hz-btn[aria-disabled="true"] { opacity: var(--hz-btn-disabled-opacity, .5); pointer-events: none; }

.hz-btn--primary {
  color: var(--hz-text-onbrand);
  background: var(--hz-brand-gradient);
  border-color: transparent;
  /* Inset top sheen over the brand shadow gives the gradient a lit, tactile face
   * (same app-icon language as the section-head tile). */
  box-shadow: inset 0 1px 0 rgba(255,255,255,.22), var(--hz-btn-primary-shadow);
}
.hz-btn--secondary {
  color: var(--hz-btn-secondary-fg, var(--hz-text));
  background: var(--hz-btn-secondary-bg, var(--hz-surface-raised));
  border: 1px solid var(--hz-btn-secondary-border, var(--hz-border-strong));   /* explicit 1px so the visible border is register-independent */
}
.hz-btn--ghost {
  background: var(--hz-btn-ghost-bg);
  border: 1px solid var(--hz-btn-ghost-border);
  color: var(--hz-btn-ghost-fg);
}
.hz-btn--danger {
  color: var(--hz-text-onbrand);
  background: var(--hz-danger);
  border-color: transparent;
}
/* Soft/tinted danger — a low-emphasis destructive action (danger-colored text on
   a translucent danger wash), as opposed to the solid --danger above. Register-
   driven via --hz-btn-danger-soft-* so it carries no skin value here. */
.hz-btn--danger-soft {
  color: var(--hz-btn-danger-soft-fg, var(--hz-danger));
  background: var(--hz-btn-danger-soft-bg);
  border: 1px solid var(--hz-btn-danger-soft-border);
}

/* Hover — gated behind a real pointer so touchscreens never get a stuck
   hover state after a tap (WCAG-friendly, cross-platform correct). Every button
   gets a gentle 1px lift by default (a register can opt out by setting
   --hz-btn-hover-transform); primary also deepens its brand shadow. */
@media (hover: hover) and (pointer: fine) {
  .hz-btn:hover           { transform: var(--hz-btn-hover-transform, translateY(-1px)); }
  .hz-btn--primary:hover  { filter: brightness(1.05); box-shadow: inset 0 1px 0 rgba(255,255,255,.30), var(--hz-shadow-brand); }
  .hz-btn--secondary:hover { background: var(--hz-surface-hover); border-color: var(--hz-border-strong); }
  .hz-btn--ghost:hover    { background: var(--hz-btn-ghost-hover-bg); border-color: var(--hz-btn-ghost-hover-border); color: var(--hz-btn-ghost-hover-fg); }
  .hz-btn--danger:hover   { filter: brightness(1.05); box-shadow: var(--hz-shadow-md); }
  .hz-btn--danger-soft:hover { background: var(--hz-btn-danger-soft-hover-bg); }
}

.hz-btn--sm    { min-height: 36px; padding: 0 var(--hz-space-3); font-size: var(--hz-text-sm); }
.hz-btn--lg    { min-height: var(--hz-btn-lg-min-h); padding: var(--hz-btn-lg-pad-y) var(--hz-btn-lg-pad-x); font-size: var(--hz-btn-lg-font-size); }
.hz-btn--block { display: flex; width: 100%; }
.hz-btn--icon  { padding: 0; width: var(--hz-tap-min); min-width: var(--hz-tap-min); }

/* ===========================================================================
 * Card
 * ========================================================================= */
.hz-card {
  background: var(--hz-card-bg);
  border: 1px solid var(--hz-card-border);
  border-radius: var(--hz-card-radius);
  padding: var(--hz-card-pad);
  box-shadow: var(--hz-card-shadow);
  transition:
    transform var(--hz-dur-fast) var(--hz-ease),
    box-shadow var(--hz-dur-fast) var(--hz-ease),
    border-color var(--hz-dur-fast) var(--hz-ease);
}
.hz-card--raised { background: var(--hz-card-raised-bg); box-shadow: var(--hz-card-raised-shadow); }
/* --flat is declared AFTER --raised so `--raised --flat` composes to "the raised
 * surface, no elevation shadow" (flat wins the box-shadow). That combination is
 * exactly the agent card: a raised card that rests flat and lifts on hover. */
.hz-card--flat   { box-shadow: none; }
/* --interactive opts a card into affordance: a hover lift + elevation and a
 * crisper border, plus a small press. Use on cards that are themselves a control
 * (agent card, tappable list card); static container cards leave it off. */
.hz-card--interactive { cursor: pointer; }
@media (hover: hover) and (pointer: fine) {
  .hz-card--interactive:hover { transform: translateY(-2px); box-shadow: var(--hz-shadow-lg); border-color: var(--hz-border-strong); }
}
.hz-card--interactive:active { transform: translateY(0); box-shadow: var(--hz-shadow-sm); }

/* Shape scale — an explicit, register-independent radius step for card families
 * whose corner is part of the design, not the register default. Anchored to the
 * real product surfaces: sm = compact panels, md = small content, lg = the agent
 * / content card (the shared workhorse), xl = full-screen overlay cards. Picking
 * a step is a layout decision, so these reference the radius scale directly. */
.hz-card--sm { border-radius: var(--hz-radius-12); }
.hz-card--md { border-radius: var(--hz-radius-16); }
.hz-card--lg { border-radius: var(--hz-radius-18); }
.hz-card--xl { border-radius: var(--hz-radius-22); }

/* ===========================================================================
 * Shelf — the horizontal row of cards you flick through sideways.
 *
 * A shelf is a scroll container, so it CLIPS: at its padding box for overflow,
 * and at its border box again if it carries a mask (the usual "more to the
 * right" fade). Its cards are elevated — a .hz-card--raised paints a shadow
 * well outside its own box — and a shelf that reserves no room for that does
 * not merely soften it: it cuts every card's shadow off at the same line, top
 * and bottom and both ends. The row then reads as one hard-edged grey plate
 * with square corners sitting behind the cards, which is the opposite of the
 * floating the shadow was there to suggest.
 *
 * So the bleed has to be PADDING on the shelf — nothing outside the padding
 * box survives either clip. All three declarations below are load-bearing:
 *
 *   padding               the bleed itself, the only room inside the clip.
 *   margin-inline         pulls the now-wider box back onto the gutter the
 *                         cards were already on, so nothing moves. It needs
 *                         the nearest clipping ancestor to have at least this
 *                         much padding of its own, or that ancestor clips the
 *                         bleed straight back off.
 *   scroll-padding-inline moves the SNAPPORT along with the padding. Without
 *                         it, `scroll-snap-align: start` measures from the
 *                         padding edge, decides the first card is mis-aligned
 *                         by exactly the left bleed, and scrolls it under —
 *                         so adding the padding would shift the whole row.
 *
 * Defaults are the md elevation, which is what .hz-card--raised carries. A
 * shelf whose cards sit on a different step — or lift on hover, which moves
 * the shadow up — overrides --hz-shelf-bleed-* with the matching register.
 * Gap, item width, snap and any fade mask stay with the consumer: they are
 * design choices, and the bleed protects the shadow whichever way they go.
 * ========================================================================= */
.hz-shelf {
  display: flex;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding:
    var(--hz-shelf-bleed-top,    var(--hz-shadow-md-bleed-top))
    var(--hz-shelf-bleed-x,      var(--hz-shadow-md-bleed-x))
    var(--hz-shelf-bleed-bottom, var(--hz-shadow-md-bleed-bottom));
  margin-inline: calc(-1 * var(--hz-shelf-bleed-x, var(--hz-shadow-md-bleed-x)));
  scroll-padding-inline: var(--hz-shelf-bleed-x, var(--hz-shadow-md-bleed-x));
}
.hz-shelf::-webkit-scrollbar { display: none; }

/* ── Shelf arrows — the mouse's swipe ─────────────────────────────────────
 *
 * A shelf is reachable three ways, and they do not overlap. Touch swipes.
 * A keyboard tabs: every card is a control, so the browser scrolls each one
 * into view (and the shelf's scroll-padding lands it clear of the bleed). A
 * mouse has neither — dragging a scrollbar that is deliberately hidden is not
 * an affordance, and tabbing through a row you only meant to glance along is
 * worse. These two buttons are that third way and nothing else, which is why
 * they are gated to a fine pointer: on touch they would be two permanent
 * obstructions over the first and last card, competing with the swipe.
 *
 * Placement. The frame is the shelf's MARGIN box, so its edges are the gutter
 * the page is aligned to, not the bled edge — an arrow pinned to the frame
 * sits exactly on the column the section head and the list below it use. It
 * overlays the row rather than standing outside it, because a capped, centred
 * measure leaves no reliable outside to stand in at 1024px. Vertically it
 * centres on the CARDS, not on the shelf box: the bleed is 13px above and 25px
 * below, so centring on the box would sit the arrow 6px low. `top`/`bottom`
 * set to the bleed with `margin-block: auto` centres it in the band the cards
 * actually occupy, whatever the bleed is.
 *
 * The frame only becomes navigable once the row overflows (JS adds the class
 * and hides the buttons outright otherwise): two dead controls beside three
 * cards read as breakage, not as "that is all of them".
 * ========================================================================= */
.hz-shelf-frame { position: relative; }

.hz-shelf-arrow {
  position: absolute;
  z-index: 2;
  top:    var(--hz-shelf-bleed-top,    var(--hz-shadow-md-bleed-top));
  bottom: var(--hz-shelf-bleed-bottom, var(--hz-shadow-md-bleed-bottom));
  margin-block: auto;                 /* centre in the band the cards occupy */
  width:  var(--hz-shelf-arrow-size, 40px);
  height: var(--hz-shelf-arrow-size, 40px);
  display: none;                      /* opened up by the pointer query below */
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid var(--hz-shelf-arrow-border, var(--hz-border));
  border-radius: 50%;
  background: var(--hz-shelf-arrow-bg, var(--hz-surface-raised));
  color: var(--hz-text);
  box-shadow: var(--hz-shadow-md);
  cursor: pointer;
  transition:
    opacity      var(--hz-dur-fast) var(--hz-ease),
    transform    var(--hz-dur-fast) var(--hz-ease),
    background   var(--hz-dur-fast) var(--hz-ease),
    border-color var(--hz-dur-fast) var(--hz-ease);
}
.hz-shelf-arrow--prev { inset-inline-start: 0; }
.hz-shelf-arrow--next { inset-inline-end:   0; }
.hz-shelf-arrow svg {
  width: 18px; height: 18px;
  fill: none; stroke: currentColor;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
/* The end of the row: the arrow fades out entirely rather than sitting there
   dimmed. Two reasons, both of them visible on the first build that dimmed it:
   a 35%-opacity control over a white card is not read as "unavailable", it is
   read as a smudge — and because it still takes the pointer, it puts a dead
   40px hole over the corner of a card that IS clickable. Fading out also means
   the only arrow ever painted over a card is one that can move the row, and by
   then that card is a half-scrolled peek rather than something being read.
   `disabled` stays for the accessibility tree and the tab order; the opacity
   is purely what the eye gets. */
.hz-shelf-arrow:disabled {
  opacity: 0;
  pointer-events: none;
}
@media (hover: hover) and (pointer: fine) {
  .hz-shelf-frame--navigable .hz-shelf-arrow { display: flex; }
  .hz-shelf-arrow:not(:disabled):hover {
    background: var(--hz-surface-hover, var(--hz-surface-raised));
    border-color: var(--hz-border-strong);
    transform: scale(1.06);
  }
  .hz-shelf-arrow:not(:disabled):active { transform: scale(.96); }
}
@media (prefers-reduced-motion: reduce) {
  .hz-shelf-arrow { transition: none; }
  .hz-shelf-arrow:not(:disabled):hover,
  .hz-shelf-arrow:not(:disabled):active { transform: none; }
}

/* ===========================================================================
 * Stat group — a row of figures read as ONE instrument.
 *
 * A few counters that belong together (lessons 11/35 · practice 6/24 · badges
 * 2/8 · 290 points) are one reading, not four cards. Drawn as four separate
 * tiles inside a card, each with its own border and radius, they read as a
 * box of boxes: four outlines, four corners, and the eye counts frames
 * instead of numbers. The group draws one frame and splits it with hairlines.
 *
 * The hairlines are the GAP, not borders. The group is painted in the
 * divider colour and each cell in the surface colour on top of it, so a 1px
 * gap shows through as a rule between neighbours. That is what lets the same
 * rule serve every column count and every fold — four across, 2×2, three
 * across — without a single `:nth-child` border exception, and without a
 * doubled line where two cell borders would meet.
 *
 *   .hz-stat-group          the frame (columns are the consumer's: it sets
 *                           grid-template-columns, and folds them)
 *   .hz-stat                one cell
 *   .hz-stat-value          the figure — tabular, so a changing count never
 *                           reflows the row
 *   .hz-stat-total          an optional "/35" after it, a step quieter
 *   .hz-stat-label          the caption — --hz-text-meta, the AA ink for
 *                           tiny text (--hz-text-muted is under AA here).
 *                           No text-transform: whether a caption is set in
 *                           caps is the copy's decision, so it lives in the
 *                           string, not in the atom
 *
 * The cell is the RAISED surface, so the group lifts off a card (--surface)
 * in both themes — the hairline frame is what keeps it visible on light,
 * where a fill alone separates from white by barely 1:1.
 * ========================================================================= */
.hz-stat-group {
  display: grid;
  grid-template-columns: repeat(var(--hz-stat-cols, 3), minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border-radius: var(--hz-radius-14);
  border: 1px solid var(--hz-border-strong);
  background: var(--hz-border-strong);
}
.hz-stat {
  min-width: 0;
  padding: var(--hz-space-3) var(--hz-space-2);
  background: var(--hz-surface-raised);
  text-align: center;
}
.hz-stat-value {
  display: block;
  /* 17px is literal: the type scale has 16 (--hz-text-md, max) and a fluid
     17–20 (--hz-text-lg), and a figure that grows with the viewport would
     change the row's height between a laptop and a monitor. */
  font-size: 17px; font-weight: 800; letter-spacing: -.03em; line-height: 1.2;
  color: var(--hz-text);
  font-variant-numeric: tabular-nums;
}
.hz-stat-total { font-size: var(--hz-text-xs); font-weight: 700; letter-spacing: 0; color: var(--hz-text-meta); }
.hz-stat-label {
  display: block;
  margin-top: 2px;
  overflow-wrap: break-word;
  font-size: var(--hz-text-2xs); font-weight: 700; letter-spacing: .04em; line-height: 1.3;
  color: var(--hz-text-meta);
}

/* ===========================================================================
 * Medal — an award, framed: the one object an earned badge is shown in.
 *
 * Born in the AI Course (its badge shelf, the test result, the «module
 * complete» dialog) and shared from here, so a badge on a person's public
 * profile is the SAME medal the learner won — not a look-alike. Drawn by
 * HzMedal (public/js/utils/medal.js), which also owns the face's safe
 * picture-or-emoji fallback.
 *
 *   .hz-medal                 the frame: a rounded square the art FILLS (the
 *                             shipped pictures are full-bleed squares, so it is
 *                             treated like an app icon — never a circle)
 *     .hz-medal-pic           the art's box (the unearned states filter it)
 *       .hz-medal-face        picture + the emoji waiting behind it
 *     .hz-medal-seal          the corner coin: a check (earned) or a padlock
 *   states   --got (default look of an award) · --now · --locked · --soft
 *   sizes    --xs 44 · (68) · --sm 52 · --lg 96
 *
 * COLOUR MEANS EARNED: only --got is drawn in colour; every unearned preview is
 * greyscale. The state is told by the coin's SHAPE as well as its colour, and
 * spoken by the caller's label — the art is decorative.
 *
 * One hook: --hz-medal-ground, the colour of what the medal stands on. The
 * bezel's inner hairline and the coin's ring are cut in it, so the gold ring
 * always reads as set off the art. Default --hz-surface (a card); a consumer on
 * another ground sets it once instead of re-declaring the shadows.
 * ========================================================================= */
.hz-medal {
  position: relative;
  box-sizing: border-box;
  flex: none;
  width: 68px; height: 68px;
  border-radius: var(--hz-radius-20);
  display: grid; place-items: center;
  font-size: 36px; line-height: 1;
  background: var(--hz-surface-hover);
}
/* Earned — a gold ring set off the art by a hairline of the ground, the way a
   medal sits in its bezel, and a warm glow under it. All box-shadows, so the
   art is never shrunk to make room for its own border. */
.hz-medal--got {
  background: var(--hz-warning-soft);
  box-shadow: 0 0 0 2px var(--hz-medal-ground, var(--hz-surface)), 0 0 0 4px var(--hz-warning),
    0 8px 18px -6px var(--hz-warning-border);
}
/* The next one to win: greyscale at full strength, ringed in the accent. */
.hz-medal--now {
  background: var(--hz-brand-soft);
  box-shadow: 0 0 0 2px var(--hz-medal-ground, var(--hz-surface)), 0 0 0 4px var(--hz-brand);
}
/* Further out: greyscale and faded behind a quiet hairline. */
.hz-medal--locked {
  background: var(--hz-surface-hover);
  box-shadow: 0 0 0 1px var(--hz-border-strong);
}
/* Not earned this time (a failed paper): the frame in neutral ink holding a
   stand-in glyph — an unearned badge never shows what it looks like. */
.hz-medal--soft {
  background: var(--hz-surface-raised);
  box-shadow: 0 0 0 3px var(--hz-medal-ground, var(--hz-surface)), 0 0 0 5px var(--hz-border-strong);
}
.hz-medal-pic {
  width: 100%; height: 100%;
  display: grid; place-items: center;
  border-radius: inherit;
}
.hz-medal--now .hz-medal-pic,
.hz-medal--locked .hz-medal-pic { filter: grayscale(1); }
.hz-medal--locked .hz-medal-pic { opacity: .55; }
/* `contain`, not `cover`: a badge is a drawing with its own edges, and cropping
   one to fill a square cuts the emblem. The rounding is stated, not inherited —
   the picture's parent is the `display: contents` face below. */
.hz-medal-img {
  width: 100%; height: 100%; object-fit: contain; display: block;
  border-radius: var(--hz-radius-20);
}
/* The picture and the emoji waiting behind it. `display: contents`, so the
   picture stands exactly where a bare emoji stood — in a medal, a flex tile or
   a sentence. The emoji gets NO display rule: app.css makes [hidden] win, and
   that keeps it out of sight until the picture fails. */
.hz-medal-face { display: contents; }
.hz-medal-seal {
  position: absolute; inset-inline-end: -6px; bottom: -6px;
  box-sizing: border-box;
  width: 24px; height: 24px; border-radius: var(--hz-radius-full);
  display: grid; place-items: center;
  background: var(--hz-warning);
  border: 2px solid var(--hz-medal-ground, var(--hz-surface));
}
.hz-medal-seal svg {
  width: 13px; height: 13px;
  fill: none; stroke: var(--hz-medal-seal-ink);
  stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round;
}
.hz-medal-seal--lock { background: var(--hz-brand-ink); }
.hz-medal-seal--lock svg { width: 12px; height: 12px; stroke: var(--hz-text-onbrand); stroke-width: 2.6; }
.hz-medal--locked .hz-medal-seal--lock { background: var(--hz-surface-raised); box-shadow: inset 0 0 0 1px var(--hz-border-strong); }
.hz-medal--locked .hz-medal-seal--lock svg { stroke: var(--hz-text-meta); }

/* Sizes: the frame scales whole — corner rounding keeps its proportion
   (20px on 68), the bezel and the coin grow and shrink with it. */
.hz-medal--lg {
  width: 96px; height: 96px;
  border-radius: var(--hz-radius-28);
  font-size: 52px;
}
.hz-medal--lg .hz-medal-img { border-radius: var(--hz-radius-28); }
.hz-medal--lg.hz-medal--got {
  box-shadow: 0 0 0 3px var(--hz-medal-ground, var(--hz-surface)), 0 0 0 6px var(--hz-warning),
    0 14px 28px -8px var(--hz-warning-border);
}
.hz-medal--lg .hz-medal-seal { width: 32px; height: 32px; inset-inline-end: -8px; bottom: -8px; border-width: 3px; }
.hz-medal--lg .hz-medal-seal svg { width: 16px; height: 16px; }
.hz-medal--sm {
  width: 52px; height: 52px;
  border-radius: var(--hz-radius-16);
  font-size: 28px;
}
.hz-medal--sm .hz-medal-img { border-radius: var(--hz-radius-16); }
.hz-medal--sm .hz-medal-seal { width: 20px; height: 20px; inset-inline-end: -5px; bottom: -5px; }
.hz-medal--sm .hz-medal-seal svg { width: 11px; height: 11px; }
/* The row size — a strip of awards beside other content (a profile). */
.hz-medal--xs {
  width: 44px; height: 44px;
  border-radius: var(--hz-radius-14);
  font-size: 24px;
}
.hz-medal--xs .hz-medal-img { border-radius: var(--hz-radius-14); }
.hz-medal--xs .hz-medal-seal { width: 18px; height: 18px; inset-inline-end: -5px; bottom: -5px; }
.hz-medal--xs .hz-medal-seal svg { width: 10px; height: 10px; stroke-width: 3.4; }

/* ===========================================================================
 * AI Passport — the certificate the AI Course ends in, as one card
 * (utils/pass-card.js HzPassCard.html; Android feature/course PassportCard).
 *
 * The same card everywhere it appears: the learner's certificate and the
 * sample on the course's page (course-addon.js), and the passport's public
 * page — the link a learner shares (course/passport-page.js). So it is drawn
 * on design tokens only, and reads the same on any page that loads tokens.css
 * and atoms.css.
 *
 *   .hz-pass             the card     · --issued  amber: earned
 *   .hz-pass-head        the Harizma lockup and an optional tag («Sample»)
 *   .hz-pass-k / -n      what it is · the course's name
 *   .hz-pass-lvl         the overall score as a ring, the level over its name
 *   .hz-pass-dims        one row per area: name, bar, score
 *   .hz-pass-foot        issued by, and its number — on a perforation
 *
 * Amber is the design system's reward hue (the medals' gold): an issued card
 * wears it on its frame, its kicker and its level; a preview is the same card
 * on a plain hairline until it is earned. The level sits ABOVE its caption,
 * never beside it — on one baseline «Уровень 2» broke over two lines on every
 * phone.
 * ========================================================================= */
.hz-pass {
  position: relative; overflow: hidden; box-sizing: border-box;
  padding: 20px 22px 18px; border-radius: var(--hz-radius-24);
  background: var(--hz-surface-raised); border: 1px solid var(--hz-border-strong); color: var(--hz-text);
  box-shadow: var(--hz-card-raised-shadow);
}
.hz-pass--issued {
  border-color: var(--hz-warning-border);
  background-image: linear-gradient(165deg, var(--hz-warning-soft), transparent 60%);
}
.hz-pass-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.hz-pass-brand { display: inline-flex; align-items: center; gap: 8px; min-width: 0; color: var(--hz-text); }
.hz-pass-mark { display: block; width: 28px; height: 28px; border-radius: var(--hz-radius-8); }
.hz-pass-word { height: 13px; }
/* «Sample» — pinned to the corner, so the card can never pass for a real one. */
.hz-pass-tag {
  flex: 0 0 auto; padding: 4px 10px; border-radius: var(--hz-radius-pill);
  font-size: 11.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; line-height: 1.2;
  color: var(--hz-warning-ink); background: var(--hz-warning-soft); border: 1px solid var(--hz-warning-border);
}
.hz-pass-k {
  margin: 22px 0 0; font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase;
  line-height: 1.3; color: var(--hz-text-meta);
}
.hz-pass--issued .hz-pass-k { color: var(--hz-warning-ink); }
.hz-pass-n { margin: 6px 0 0; font-size: 20px; font-weight: 800; letter-spacing: -.02em; line-height: 1.25; overflow-wrap: break-word; }
.hz-pass-lvl {
  margin-top: 18px; display: flex; align-items: center; gap: 16px;
  padding: 14px 16px; border-radius: var(--hz-radius-16);
  background: var(--hz-surface); border: 1px solid var(--hz-border);
  container-type: inline-size;
}
/* The overall score: the mean of the areas below, as a ring — a number, no unit. */
.hz-pass-ring { position: relative; flex: 0 0 auto; width: 60px; height: 60px; display: grid; place-items: center; }
.hz-pass-ring svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.hz-pass-ring circle { fill: none; stroke-width: 3.4; }
.hz-pass-ring-t { stroke: var(--hz-surface-hover); }
.hz-pass-ring-v { stroke: var(--hz-warning); stroke-linecap: round; }
.hz-pass-ring b { position: relative; font-size: 18px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; color: var(--hz-text); }
.hz-pass-lv { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
/* The level is one word and a number («Level 3», «Մակարդակ 3»). Beside the
   ring on a 320px phone it has ~140px: a long word (Armenian, ~150px at 24px)
   steps the type down with the card instead of breaking mid-word. Full size
   from a ~280px card up. */
.hz-pass-lv b { font-size: 24px; font-size: clamp(19px, 8.5cqi, 24px); font-weight: 800; letter-spacing: -.03em; line-height: 1.15; color: var(--hz-text); }
.hz-pass--issued .hz-pass-lv b { color: var(--hz-warning-ink); }
.hz-pass-lv span { font-size: 14px; font-weight: 600; line-height: 1.35; color: var(--hz-text-meta); }
.hz-pass-dims { margin-top: 18px; display: grid; gap: 12px; }
.hz-pass-dim { display: grid; grid-template-columns: minmax(84px, 124px) minmax(0, 1fr) 30px; align-items: center; gap: 12px; }
.hz-pass-dim-n { font-size: 13.5px; font-weight: 600; line-height: 1.3; color: var(--hz-text-meta); overflow-wrap: break-word; }
.hz-pass-dim-t { height: 8px; border-radius: var(--hz-radius-pill); background: var(--hz-surface-hover); overflow: hidden; }
.hz-pass-dim-t i { display: block; height: 100%; border-radius: inherit; background: var(--hz-warning); transition: width .8s ease; }
.hz-pass-dim-v { text-align: end; font-size: 13.5px; font-weight: 700; color: var(--hz-text); font-variant-numeric: tabular-nums; }
/* The document's edge: issued by, and its number — on a perforation. The two
   share a line where they fit; the number drops under it where they do not. */
.hz-pass-foot {
  margin-top: 20px; padding-top: 14px; border-top: 1px dashed var(--hz-border-strong);
  display: flex; align-items: center; justify-content: space-between; gap: 8px 12px; flex-wrap: wrap;
  font-size: 12.5px; line-height: 1.35; color: var(--hz-text-meta);
}
.hz-pass-by { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; min-width: 0; }
.hz-pass-seal {
  flex: none; width: 16px; height: 16px; color: var(--hz-warning-ink);
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.hz-pass-no { font-family: var(--hz-font-mono, ui-monospace, monospace); font-size: 12px; letter-spacing: .06em; }
@media (prefers-reduced-motion: reduce) {
  .hz-pass-dim-t i { transition: none; }
}

/* ===========================================================================
 * Callout — a boxed note inside a page: a goal, a notice, a heads-up.
 *
 *   <div class="hz-callout hz-callout--brand">
 *     <span class="hz-callout-i"><svg …/></span>
 *     <div class="hz-callout-b"><b>Lead-in.</b> The note itself.</div>
 *   </div>
 *
 * A soft tint of the tone with a hairline of the same tone, the icon in the
 * tone's INK, and ALL the text — lead-in included — in the normal text colour.
 *
 * The colour lives in the icon and the frame, never in the words. An -ink
 * token is tuned to clear AA on a plain surface, and the tint under a callout
 * darkens that ground just enough to sink it: the warning ink measured 4.46:1
 * on its own tint in light, the brand ink 4.33:1 on the canvas. An icon needs
 * 3:1, which every ink clears on its tint in both themes; text needs 4.5:1,
 * which only --hz-text does everywhere. The lead-in is set apart by weight.
 *
 * Tones: --brand (a goal, a tip), --success, --warning (a preview, a caveat),
 * --danger. The neutral default is a raised surface with a plain hairline.
 * Sits on --hz-surface: every tint in the system is calibrated against it.
 * ========================================================================= */
.hz-callout {
  --hz-callout-bg:     var(--hz-surface-raised);
  --hz-callout-border: var(--hz-border-strong);
  --hz-callout-ink:    var(--hz-text-meta);
  display: flex;
  align-items: flex-start;
  gap: var(--hz-space-3);
  padding: var(--hz-space-3) var(--hz-space-4);
  border-radius: var(--hz-radius-14);
  background: var(--hz-callout-bg);
  border: 1px solid var(--hz-callout-border);
  color: var(--hz-text);
  font-size: var(--hz-text-base);
  line-height: 1.55;
}
.hz-callout--brand   { --hz-callout-bg: var(--hz-brand-soft);   --hz-callout-border: var(--hz-brand-border); --hz-callout-ink: var(--hz-brand-ink); }
.hz-callout--success { --hz-callout-bg: var(--hz-success-soft); --hz-callout-border: var(--hz-success-border); --hz-callout-ink: var(--hz-success-ink); }
.hz-callout--warning { --hz-callout-bg: var(--hz-warning-soft); --hz-callout-border: var(--hz-warning-border); --hz-callout-ink: var(--hz-warning-ink); }
.hz-callout--danger  { --hz-callout-bg: var(--hz-danger-soft);  --hz-callout-border: var(--hz-danger-border);  --hz-callout-ink: var(--hz-danger-ink); }
.hz-callout-i {
  flex: none;
  display: grid; place-items: center;
  width: 20px; height: 1.55em;             /* one line tall: the icon sits on the first line */
  color: var(--hz-callout-ink);
}
.hz-callout-i svg {
  width: 18px; height: 18px;
  fill: none; stroke: currentColor;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.hz-callout-b { flex: 1; min-width: 0; overflow-wrap: break-word; }
.hz-callout-b > b:first-child { font-weight: 700; }

/* ===========================================================================
 * Banner — a persistent full-bleed strip under a panel header: a state the
 * person should keep in view (low balance), with ONE action that resolves it.
 *
 *   <div class="hz-banner hz-banner--warning" role="status">
 *     <span class="hz-ico-chip hz-ico-chip--stars"><svg aria-hidden="true" …/></span>
 *     <div class="hz-banner-b">
 *       <b class="hz-banner-t">Only 8 stars left</b>
 *       <span class="hz-banner-s">Top up or get Plus to keep going</span>
 *     </div>
 *     <button class="hz-plus-btn hz-plus-btn--sm">Add stars</button>
 *   </div>
 *
 * The callout's sibling, with the same colour contract: the tone lives in the
 * tint and the hairline, the words stay in --hz-text (title) and the AA meta
 * ink (subtitle). Unlike a callout it bleeds edge to edge, so the tint is laid
 * over an opaque --hz-surface — a strip in a column must not show the chat
 * wallpaper through it. The text wraps rather than truncates: a cut message
 * is a hidden message. Tones: --brand, --warning, --danger.
 * ========================================================================= */
.hz-banner {
  --hz-banner-bg:     var(--hz-surface-raised);
  --hz-banner-border: var(--hz-border-strong);
  display: flex;
  align-items: center;
  gap: var(--hz-space-3);
  padding-block: var(--hz-space-2); padding-inline: var(--hz-space-4) var(--hz-space-3);
  background: linear-gradient(var(--hz-banner-bg), var(--hz-banner-bg)), var(--hz-surface);
  border-bottom: 1px solid var(--hz-banner-border);
  color: var(--hz-text);
  flex-shrink: 0;
}
.hz-banner--brand   { --hz-banner-bg: var(--hz-brand-soft);   --hz-banner-border: var(--hz-brand-border); }
.hz-banner--warning { --hz-banner-bg: var(--hz-warning-soft); --hz-banner-border: var(--hz-warning-border); }
.hz-banner--danger  { --hz-banner-bg: var(--hz-danger-soft);  --hz-banner-border: var(--hz-danger-border); }
.hz-banner-b {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; gap: var(--hz-space-px);
  overflow-wrap: break-word;
}
.hz-banner-t {
  font-size: var(--hz-text-sm); font-weight: var(--hz-weight-semibold);
  line-height: 1.3;
}
.hz-banner-s {
  font-size: var(--hz-text-xs); color: var(--hz-text-meta);
  line-height: 1.35;
}
@media (forced-colors: active) {
  .hz-banner { background: Canvas; border-bottom-color: CanvasText; }
}

/* ===========================================================================
 * Section head — the shared "tile header": a glyph tile + title + subtitle,
 * with an optional right-aligned meta ("N agents · all online"). One component
 * for the marketing pack sections and the app store category sections, so a
 * category header reads the same on landing and in the store. Structure +
 * sizing are shared; only the two register-varying text colours fork (marketing
 * runs navy-muted, the product register runs the standard semantic tokens).
 * The bright gradient category BANNER is deliberately NOT this — it stays a
 * store-local featured accent (e.g. "Trending"), so regular categories are calm.
 *
 * Treatment: a 54px app-icon tile (radius-16) whose drop-shadow is tinted per
 * instance via --hz-sechead-glow, over a crisp inset highlight + ring; a hairline
 * divider anchors the header (--flat drops it); the meta renders as a live-status
 * chip with a glowing presence dot (--static drops the dot for a plain count).
 * ========================================================================= */
.hz-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--hz-space-4);
  margin-bottom: var(--hz-space-5);
  padding-bottom: var(--hz-space-4);
  border-bottom: 1px solid var(--hz-border);
  flex-wrap: wrap;
}
/* --flat drops the divider (last section in a group, or a tight stack). */
.hz-section-head--flat { padding-bottom: 0; border-bottom: 0; }
.hz-section-head-title { display: flex; align-items: center; gap: var(--hz-space-4); min-width: 0; text-align: start; }
.hz-section-head-tile {
  width: 54px; height: 54px;
  border-radius: var(--hz-radius-16);
  display: grid; place-items: center;
  font-size: 26px; line-height: 1; flex-shrink: 0;
  /* Glow tints the drop-shadow in the tile's own hue (set --hz-sechead-glow per
   * instance); the two inset layers give it a crisp app-icon highlight + ring. */
  box-shadow:
    0 10px 22px var(--hz-sechead-glow, rgba(0,0,0,.38)),
    inset 0 1px 0 rgba(255,255,255,.32),
    inset 0 0 0 1px rgba(255,255,255,.12);
}
.hz-section-head-name { font-family: var(--hz-font-display); font-size: 1.5rem; font-weight: 700; letter-spacing: -.03em; line-height: 1.1; }
.hz-section-head-desc { font-size: .9rem;  color: var(--hz-sechead-desc-color, var(--hz-text-muted));  margin-top: 4px; line-height: 1.45; max-width: 52ch; text-wrap: pretty; }
/* Meta is a calm raised pill carrying the count/status text — no status dot
   (the text already reads "… · all online"; the pill is the whole treatment). */
.hz-section-head-meta {
  display: inline-flex; align-items: center; gap: var(--hz-space-2);
  align-self: flex-start;
  padding: 6px 13px;
  border-radius: var(--hz-radius-pill);
  border: 1px solid var(--hz-border);
  background: var(--hz-surface-raised);
  font-family: var(--hz-font-mono); font-size: .72rem;
  color: var(--hz-sechead-meta-color, var(--hz-text-muted));
  white-space: nowrap; flex-shrink: 0;
}

/* ===========================================================================
 * Input / field
 * ========================================================================= */
.hz-input {
  width: 100%;
  min-height: var(--hz-input-min-h, var(--hz-tap-min));
  padding: var(--hz-input-pad, 0 var(--hz-space-4));
  font-family: var(--hz-font-body);
  font-size: var(--hz-input-font-size);   /* >=16px on mobile → no iOS zoom-on-focus */
  color: var(--hz-input-color);
  background: var(--hz-input-bg);
  border: var(--hz-input-border-width, 1.5px) solid var(--hz-input-border);
  border-radius: var(--hz-input-radius);
  -webkit-appearance: none;               /* kill iOS Safari inset shadow */
  appearance: none;
  transition: border-color var(--hz-dur-fast) var(--hz-ease),
              box-shadow  var(--hz-dur-fast) var(--hz-ease);
}
.hz-input::placeholder { color: var(--hz-input-placeholder); opacity: 1; }
/* Hover feedback (pointer only) — a subtly stronger border so the field reads as
 * editable before focus, without competing with the focus ring. */
@media (hover: hover) and (pointer: fine) {
  .hz-input:hover:not(:focus) { border-color: var(--hz-border-strong); }
}
.hz-input:focus {
  outline: none;
  border-color: var(--hz-input-focus-border);
  box-shadow: var(--hz-input-focus-shadow);
}

/* ===========================================================================
 * Textarea — the multi-line half of the field.
 *
 * The system carried .hz-input and nothing for prose, so every surface with a
 * long-text box (the course editor, the operator notes) re-declared the field
 * surface next to a `resize` and a min-height. It shares the input register
 * outright — same background, border, radius, focus ring — and adds only what
 * a single-line control cannot express: block padding, a line height meant for
 * reading, and a vertical-only resize (horizontal resizing breaks any layout
 * it sits in). --mono is the code/Markdown variant.
 * ========================================================================= */
.hz-textarea {
  display: block;
  width: 100%;
  padding: var(--hz-textarea-pad, var(--hz-space-3) var(--hz-space-4));
  font-family: var(--hz-font-body);
  font-size: var(--hz-input-font-size);
  line-height: var(--hz-leading-normal);
  color: var(--hz-input-color);
  background: var(--hz-input-bg);
  border: var(--hz-input-border-width, 1.5px) solid var(--hz-input-border);
  border-radius: var(--hz-input-radius);
  -webkit-appearance: none;
  appearance: none;
  resize: vertical;
  transition: border-color var(--hz-dur-fast) var(--hz-ease),
              box-shadow  var(--hz-dur-fast) var(--hz-ease);
}
.hz-textarea::placeholder { color: var(--hz-input-placeholder); opacity: 1; }
@media (hover: hover) and (pointer: fine) {
  .hz-textarea:hover:not(:focus) { border-color: var(--hz-border-strong); }
}
.hz-textarea:focus {
  outline: none;
  border-color: var(--hz-input-focus-border);
  box-shadow: var(--hz-input-focus-shadow);
}
.hz-textarea--mono { font-family: var(--hz-font-mono); line-height: var(--hz-leading-relaxed); }

/* ===========================================================================
 * Select — a native <select> wearing the input surface.
 *
 * The design system had every field EXCEPT this one, so each surface that
 * needed a dropdown re-styled the native control itself (the operator panels
 * had two). It is deliberately a WRAPPER plus the plain .hz-input: a <select>
 * cannot render ::after, so the chevron has to belong to something around it,
 * and the native control keeps its own accessible popup on every platform.
 *
 *   <span class="hz-select"><select class="hz-input">…</select></span>
 *
 * It introduces no register of its own — it is the input register plus a
 * chevron — so re-pointing --hz-input-* moves the select with it.
 * ========================================================================= */
.hz-select { position: relative; display: inline-flex; align-items: center; min-width: 0; }
.hz-select--block { display: flex; width: 100%; }
.hz-select > select {
  width: 100%;
  /* Room for the chevron, which is painted by the wrapper on top of the field. */
  padding-inline-end: calc(var(--hz-space-4) + var(--hz-space-3));
  cursor: pointer;
  text-overflow: ellipsis;
}
/* Drawn, not an image: an SVG data URI cannot read a theme token, so a chevron
 * shipped as a background-image is a colour that never flips. */
.hz-select::after {
  content: "";
  position: absolute;
  inset-inline-end: var(--hz-space-4);
  width: 7px; height: 7px;
  margin-top: -3px;
  border-right: 1.5px solid var(--hz-text-muted);   /* physical: right+bottom rotated 45deg IS the ▾ shape, in any direction */
  border-bottom: 1.5px solid var(--hz-text-muted);
  transform: rotate(45deg);
  pointer-events: none;
}

/* ===========================================================================
 * Pill / badge
 * ========================================================================= */
.hz-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--hz-space-1);
  padding: var(--hz-pill-pad);
  font-family: var(--hz-font-body);
  font-size: var(--hz-pill-font-size);
  font-weight: var(--hz-pill-weight);
  line-height: 1.4;
  letter-spacing: var(--hz-pill-tracking);
  border-radius: var(--hz-pill-radius);
  color: var(--hz-pill-color);
  background: var(--hz-pill-bg);
  border: 1px solid var(--hz-pill-border);
}
/* The compact size: a tag INSIDE a card (the Catalog card's type chip and
   badge), never a control of its own. Same ink and fill as the size it
   modifies; only the geometry is smaller. */
.hz-pill--xs { padding: var(--hz-pill-xs-pad); font-size: var(--hz-pill-xs-font-size); line-height: 1.5; }
.hz-pill--brand { color: var(--hz-pill-brand-color); background: var(--hz-pill-brand-bg); border-color: var(--hz-pill-brand-border); }
.hz-pill--p2p   { color: var(--hz-pill-p2p-color);   background: var(--hz-p2p-soft);   border-color: var(--hz-p2p-border); }
.hz-pill--green { color: var(--hz-pill-p2p-color);   background: var(--hz-p2p-soft);   border-color: var(--hz-p2p-border); }
.hz-pill--agent { color: var(--hz-pill-agent-color); background: var(--hz-pill-agent-bg); border-color: var(--hz-pill-agent-border); }
.hz-pill--group { color: var(--hz-pill-group-color); background: var(--hz-group-soft); border-color: var(--hz-group-border); }

/* ===========================================================================
 * Plus — the subscription's own look, one family for every place that sells
 * it (the Plans sheet, the Balance sheet's plan rows, the course offer), so
 * they read as the same product as the header "Plus" pill.
 *
 * Calm by rule: ONE solid accent (--hz-plus-fill / -ink / -soft), flat
 * surfaces, no gradients, glows, sheen or sparkles. The paid moment should
 * read as trustworthy, not as a promo.
 *
 *   <div class="hz-plus-card">…</div>          the Plus surface (a flat wash)
 *   <div class="hz-plus-tile">…</div>          a quiet cell ON that surface
 *   <span class="hz-plus-badge">Harizma Plus</span>   (--sm: smaller)
 *   <button class="hz-plus-btn">
 *     <span class="hz-plus-btn-label">Get Plus — <span class="hz-plus-keep">$19.99/mo</span></span>
 *   </button>
 *   <span class="hz-ico-chip hz-ico-chip--stars"><svg …/></span>
 *   <span class="hz-plus-figure">89</span>     a display number in the Plus ink
 *   <div class="hz-reassure"><span class="hz-reassure--ok"><svg…/>Cancel anytime</span>…</div>
 *
 * Colour is tokens only (--hz-plus-*, tokens.css). The button's fill is
 * ≥ 4.5:1 under its white label. The label is ONE inline child: the button
 * is a flex box, and loose text beside a span would become two flex items
 * side by side; .hz-plus-keep holds a phrase (a price) together so a narrow
 * phone wraps before it, never inside it. Forced colours fall back to
 * system colours.
 *
 * Icon chips: the Stars hue (amber, the currency) and one accent for every
 * other kind. The chip is a graphic beside words that say the same thing,
 * so its icon is aria-hidden by the caller.
 * ========================================================================= */
.hz-plus-card {
  position: relative;
  background: var(--hz-plus-surface);
  border: 1.5px solid var(--hz-plus-border);
  border-radius: var(--hz-radius-20);
}
.hz-plus-tile {
  background: var(--hz-plus-tile);
  border: 1px solid var(--hz-plus-tile-border);
  border-radius: var(--hz-radius-14);
  box-shadow: var(--hz-plus-tile-shadow);
}

.hz-plus-badge {
  display: inline-flex; align-items: center;
  padding: 3px var(--hz-space-2);
  border-radius: var(--hz-radius-pill);
  background: var(--hz-plus-soft); color: var(--hz-plus-ink);
  font-size: var(--hz-text-xs); font-weight: var(--hz-weight-bold);
  line-height: 1.25; white-space: nowrap;
}
/* --sm is a TAG on a small card (the plan's "Most popular"): a step smaller,
   so it stays narrower than the card it labels. */
.hz-plus-badge--sm { padding: 2px var(--hz-space-2); font-size: var(--hz-text-2xs); }

.hz-plus-btn {
  position: relative;
  display: flex; align-items: center; justify-content: center; gap: var(--hz-space-2);
  width: 100%; min-height: var(--hz-tap-min);
  padding: var(--hz-space-4); border: none; border-radius: var(--hz-radius-16);
  background: var(--hz-plus-fill); color: var(--hz-text-onbrand);
  font-family: inherit; font-size: var(--hz-text-md); font-weight: var(--hz-weight-bold);
  text-align: center; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition:
    filter    var(--hz-dur-fast) var(--hz-ease),
    transform var(--hz-dur-fast) var(--hz-ease);
}
.hz-plus-btn:hover  { filter: brightness(1.08); }
.hz-plus-btn:active { transform: scale(.98); }
.hz-plus-btn:focus-visible { outline: 2px solid var(--hz-brand-2); outline-offset: 3px; }
.hz-plus-btn:disabled { opacity: .55; cursor: not-allowed; filter: none; transform: none; }
.hz-plus-btn-label { display: block; min-width: 0; line-height: 1.3; }
.hz-plus-keep { white-space: nowrap; }
/* --sm: the inline action of a strip (a banner) — sized to its label, not to
   the card; still a full tap target. */
.hz-plus-btn--sm {
  flex-shrink: 0;
  width: auto;
  padding: var(--hz-space-2) var(--hz-space-4);
  border-radius: var(--hz-radius-pill);
  font-size: var(--hz-text-sm);
  white-space: nowrap;
}

.hz-ico-chip {
  --hz-ico: var(--hz-plus-hue-text);
  flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  width: var(--hz-space-7); height: var(--hz-space-7);
  border-radius: var(--hz-radius-8);
  color: var(--hz-ico);
  background: color-mix(in srgb, var(--hz-ico) var(--hz-plus-chip-mix), transparent);
}
.hz-ico-chip svg { width: var(--hz-space-4); height: var(--hz-space-4); }
.hz-ico-chip--stars { --hz-ico: var(--hz-plus-hue-stars); }
.hz-ico-chip--energy { --hz-ico: var(--hz-plus-hue-stars); }   /* the credit in Telegram (plus-ui.js currencyKind) */
.hz-ico-chip--text  { --hz-ico: var(--hz-plus-hue-text); }
.hz-ico-chip--image { --hz-ico: var(--hz-plus-hue-image); }
.hz-ico-chip--video { --hz-ico: var(--hz-plus-hue-video); }
.hz-ico-chip--sound { --hz-ico: var(--hz-plus-hue-sound); }
.hz-ico-chip--voice { --hz-ico: var(--hz-plus-hue-voice); }
.hz-ico-chip--life  { --hz-ico: var(--hz-plus-hue-life); }

/* A display figure in the Plus ink (solid text, never a gradient). */
.hz-plus-figure {
  font-weight: var(--hz-weight-extrabold);
  letter-spacing: var(--hz-tracking-tight);
  font-variant-numeric: tabular-nums;
  color: var(--hz-plus-ink);
}

/* Why a sheet opened: one line at its top that names the moment the person
   came from ("Running low in your chat with Claude"), so the offer under it
   reads as the answer to it. The credit glyph (★, ⚡ in Telegram) on the
   Stars hue; the words carry the meaning, the glyph is aria-hidden.
   Markup: HzPlusUi.contextHtml(text). */
.hz-plus-ctx {
  display: flex; align-items: flex-start; gap: var(--hz-space-2);
  margin: 0; padding: var(--hz-space-2) var(--hz-space-3);
  border-radius: var(--hz-radius-12);
  background: var(--hz-surface-hover);
  background: color-mix(in srgb, var(--hz-plus-hue-stars) 14%, transparent);
  color: var(--hz-text); font-size: var(--hz-text-sm); line-height: 1.4;
  text-wrap: pretty;
}
.hz-plus-ctx svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 1px; color: var(--hz-plus-hue-stars); }
@media (forced-colors: active) { .hz-plus-ctx { border: 1px solid CanvasText; } }

/* Reassurance under a purchase button: short facts that lower the risk of
   tapping it ("Cancel anytime", "Secure payment via Stripe"). Each item is
   one unit; the row wraps between items, centred. --ok marks the
   item's icon as a positive check, in the success ink. */
.hz-reassure {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: var(--hz-space-1) var(--hz-space-3);
  margin-top: var(--hz-space-3);
  font-size: var(--hz-text-xs); line-height: 1.4;
  color: var(--hz-text-muted);
}
/* An item is kept whole by the row, not by nowrap: a flex line breaks at an
   item's full (max-content) width, so the row always wraps BETWEEN items
   first. Only an item wider than the whole row on its own (a 280px fold
   screen) then wraps inside itself instead of overflowing the card. */
.hz-reassure > span { display: inline-flex; align-items: center; gap: var(--hz-space-1); max-width: 100%; }
.hz-reassure svg { width: var(--hz-space-3); height: var(--hz-space-3); flex-shrink: 0; }
.hz-reassure .hz-reassure--ok svg { color: var(--hz-success-ink); }

/* ---------------------------------------------------------------------------
 * Plan cards — choosing one subscription out of a few (Start · Plus · Ultra).
 * A real radio group: the caller gives the group role="radiogroup" and an
 * accessible name, each card is a button with role="radio" + aria-checked and
 * a roving tabindex (arrow keys move and select). Markup: HzPlusUi.planOptionHtml.
 *
 *   <div class="hz-plan-group" role="radiogroup" aria-label="Plans">
 *     <button type="button" class="hz-plan" role="radio" aria-checked="true" tabindex="0">
 *       <span class="hz-plan-radio" aria-hidden="true"></span>
 *       <span class="hz-plan-body">
 *         <span class="hz-plan-head"><span class="hz-plan-name">Plus</span>
 *           <span class="hz-plus-badge hz-plus-badge--sm">…Most popular</span></span>
 *         <span class="hz-plan-detail">2,000 Stars a month</span>
 *         <span class="hz-plan-hint">≈ 660 replies or 100 images</span>
 *       </span>
 *       <span class="hz-plan-price">$19.99<span class="hz-plan-per">/mo</span></span>
 *     </button>
 *   </div>
 *
 * The chosen card wears the Plus surface and a stronger edge
 * (--hz-plus-selected), and its radio fills with the solid Plus fill and a
 * white check: the choice is told by shape as well as colour. Tags: the featured
 * plan uses the Plus badge (--sm) — the app's one highlight; .hz-plan-tag is
 * the quiet one (a partner's "−30%" --value, "Current" --current). Everything is one tap target ≥ 44px;
 * the text wraps, the price never splits.
 * ------------------------------------------------------------------------- */
.hz-plan-group { display: flex; flex-direction: column; gap: var(--hz-space-2); container-type: inline-size; }
.hz-plan {
  position: relative;
  display: flex; align-items: center; gap: var(--hz-space-3);
  width: 100%; min-height: var(--hz-tap-min);
  padding: var(--hz-space-3) var(--hz-space-4);
  border: 1.5px solid var(--hz-plus-tile-border); border-radius: var(--hz-radius-16);
  background: var(--hz-plus-tile); box-shadow: var(--hz-plus-tile-shadow);
  color: var(--hz-text); font-family: inherit; text-align: start; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition:
    border-color var(--hz-dur-fast) var(--hz-ease),
    box-shadow   var(--hz-dur-fast) var(--hz-ease);
}
.hz-plan:hover { border-color: var(--hz-plus-border); }
.hz-plan:focus-visible { outline: 2px solid var(--hz-brand-2); outline-offset: 2px; }
.hz-plan[aria-checked="true"] {
  background: var(--hz-plus-surface);
  border-color: var(--hz-plus-selected);
  box-shadow: inset 0 0 0 1px var(--hz-plus-selected);
}
.hz-plan[aria-disabled="true"] { cursor: not-allowed; opacity: .6; }
.hz-option-radio,
.hz-plan-radio {
  flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid var(--hz-text-muted);
}
.hz-plan[aria-checked="true"] .hz-plan-radio { border-color: transparent; background: var(--hz-plus-fill); }
.hz-option[aria-checked="true"] .hz-option-radio::after,
.hz-plan[aria-checked="true"] .hz-plan-radio::after {
  content: ""; width: 10px; height: 5px; margin-top: -2px;
  border: solid var(--hz-text-onbrand); border-width: 0 0 2px 2px;
  transform: rotate(-45deg);
}
.hz-plan-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.hz-plan-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--hz-space-1) var(--hz-space-2); }
.hz-plan-name { font-size: var(--hz-text-md); font-weight: var(--hz-weight-extrabold); line-height: 1.25; }
.hz-plan-detail { font-size: var(--hz-text-sm); font-weight: var(--hz-weight-semibold); line-height: 1.35; }
.hz-plan-hint { font-size: var(--hz-text-xs); color: var(--hz-text-meta); line-height: 1.35; }
/* The price is a narrow column: the amount, its period under it — so the
   plan's own text keeps the card's width (no "2 000 звёздочек в / месяц"). */
.hz-plan-price {
  flex-shrink: 0; align-self: flex-start;
  display: flex; flex-direction: column; align-items: flex-end; text-align: end;
  font-size: var(--hz-text-md); font-weight: var(--hz-weight-extrabold);
  font-variant-numeric: tabular-nums; line-height: 1.25; white-space: nowrap;
}
.hz-plan-per { display: block; font-size: var(--hz-text-xs); font-weight: var(--hz-weight-medium); line-height: 1.2; color: var(--hz-text-meta); }
/* The full price a first-period offer replaces, struck through above it. */
.hz-plan-was { font-size: var(--hz-text-xs); font-weight: var(--hz-weight-medium); color: var(--hz-text-meta); text-decoration: line-through; }
.hz-plan-tag {
  display: inline-flex; align-items: center;
  padding: 2px var(--hz-space-2); border-radius: var(--hz-radius-pill);
  border: 1px solid var(--hz-plus-tile-border);
  font-size: var(--hz-text-2xs); font-weight: var(--hz-weight-bold); line-height: 1.3;
  color: var(--hz-text-muted); white-space: nowrap;
}
.hz-plan-tag--value { color: var(--hz-success-ink); border-color: currentColor; }
.hz-plan-tag--current { color: var(--hz-text); }
/* A very narrow group (a 280px fold cover screen): the price leaves its
   column and sits under the text, aligned with it, so the words keep the
   card's width instead of wrapping word by word. */
@container (max-width: 320px) {
  .hz-plan { flex-wrap: wrap; row-gap: var(--hz-space-1); }
  .hz-plan-price {
    order: 3; flex-basis: 100%; padding-inline-start: calc(22px + var(--hz-space-3));
    flex-direction: row; align-items: baseline; gap: var(--hz-space-1); text-align: start;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hz-plus-btn { transition: none; }
  .hz-plus-btn:active { transform: none; }
  .hz-plan { transition: none; }
}

/* ===========================================================================
 * Plans page — .hz-tariffs (the plan columns), .hz-tariff-inc, .hz-tariff-notes
 *
 * ONE look for the plans wherever they are shown: the public /pricing page
 * (pricing/render.js) and the app's Plans page (subscription-addon.js), both
 * built by HzPlusUi.tariffsHtml / tariffIncludesHtml / tariffNotesHtml.
 *
 *   <div class="hz-tariffs">                         the container the columns lay out by
 *     <ul class="hz-tariffs__list" data-count="3">
 *       <li class="hz-tariff hz-tariff--featured">   --featured (the one recommended) · --current (theirs)
 *         <article class="hz-tariff__in">
 *           __head (__name + the Plus badge or a .hz-plan-tag) · __pitch · __price (__was __amount __per)
 *           __cta (the action; __note under it) · __facts (__stars · __caption · __est)
 *
 * Stacked on a narrow page; side by side once the CONTAINER is 760px wide
 * (a container query — the app's page and the public page give the columns
 * different widths at the same window size), each column's rows lined up
 * with its neighbours' (subgrid). Colour is the Plus family's (--hz-plus-*):
 * the featured plan wears the Plus surface and edge, the person's own plan a
 * stronger edge, never colour alone (its tag says so). Tokens only.
 * ========================================================================= */
.hz-tariffs { container: hz-tariffs / inline-size; min-width: 0; }
.hz-tariffs__list {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--hz-space-3);
}
.hz-tariff {
  display: grid; min-width: 0;
  background: var(--hz-plus-tile);
  border: 1px solid var(--hz-plus-tile-border);
  border-radius: var(--hz-radius-24);
  box-shadow: var(--hz-plus-tile-shadow);
}
.hz-tariff--featured {
  background: var(--hz-plus-surface);
  border: 1.5px solid var(--hz-plus-border);
  box-shadow: var(--hz-shadow-md);
}
.hz-tariff--current { border-color: var(--hz-plus-selected); box-shadow: inset 0 0 0 1px var(--hz-plus-selected); }
.hz-tariff__in {
  display: flex; flex-direction: column; gap: var(--hz-space-3); min-width: 0;
  padding: var(--hz-space-5);
}
.hz-tariff__head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: var(--hz-space-2); min-width: 0; }
.hz-tariff__name {
  margin: 0; font-family: var(--hz-font-display); font-size: var(--hz-text-xl);
  font-weight: var(--hz-weight-extrabold); letter-spacing: var(--hz-tracking-snug); line-height: 1.2;
  color: var(--hz-text); overflow-wrap: anywhere;
}
.hz-tariff__pitch { margin: calc(-1 * var(--hz-space-2)) 0 0; font-size: var(--hz-text-base); line-height: 1.45; color: var(--hz-text-meta); text-wrap: pretty; }
.hz-tariff__pitch:empty { display: none; }
.hz-tariff__price { margin: 0; display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 var(--hz-space-1); color: var(--hz-text); }
.hz-tariff__amount {
  font-family: var(--hz-font-display); font-size: var(--hz-text-2xl); font-weight: var(--hz-weight-extrabold);
  letter-spacing: var(--hz-tracking-tight); line-height: 1.1; font-variant-numeric: tabular-nums; white-space: nowrap;
}
.hz-tariff__per { font-size: var(--hz-text-md); font-weight: var(--hz-weight-semibold); color: var(--hz-text-meta); white-space: nowrap; }
.hz-tariff__was { flex-basis: 100%; font-size: var(--hz-text-sm); font-weight: var(--hz-weight-medium); color: var(--hz-text-meta); text-decoration: line-through; }
.hz-tariff__sr {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}
.hz-tariff__cta { display: grid; gap: var(--hz-space-2); align-content: start; min-width: 0; }
.hz-tariff__cta:empty { display: none; }   /* a column shown without an action (a summary) */
.hz-tariff__cta .hz-btn { width: 100%; white-space: normal; text-align: center; line-height: 1.2; }
/* The column's action: a pill — the Plus fill for the one the page leads
   with, a quiet raised one for the rest; "Your plan" is a state, not a
   button (aria-disabled), drawn calm rather than faded. */
.hz-tariff__btn { border-radius: var(--hz-radius-pill); min-height: var(--hz-space-12); font-size: var(--hz-text-md); font-weight: var(--hz-weight-bold); }
.hz-tariff__btn--primary { background: var(--hz-plus-fill); color: var(--hz-text-onbrand); border-color: transparent; }
.hz-tariff__btn--quiet { background: var(--hz-surface-raised); color: var(--hz-text); border: 1px solid var(--hz-border-strong); }
.hz-tariff__btn:focus-visible { outline: 2px solid var(--hz-brand-2); outline-offset: 2px; }
.hz-tariff__btn[aria-disabled="true"] { opacity: 1; background: transparent; color: var(--hz-text-meta); border: 1px solid var(--hz-border); box-shadow: none; }
/* A state in place of the action — "✓ Your plan", "Start from Nov 3": a calm
   pill in the Plus tint, the same height as a button so the rows still line
   up; never a faded button that reads as broken. */
.hz-tariff__state {
  margin: 0; min-height: var(--hz-space-12);
  display: flex; align-items: center; justify-content: center; gap: var(--hz-space-2);
  padding: var(--hz-space-2) var(--hz-space-4); border-radius: var(--hz-radius-pill);
  background: var(--hz-plus-soft); color: var(--hz-plus-ink);
  font-size: var(--hz-text-md); font-weight: var(--hz-weight-bold); line-height: 1.2; text-align: center;
}
.hz-tariff__state svg { width: 18px; height: 18px; flex-shrink: 0; }
.hz-tariff__state--quiet { background: transparent; color: var(--hz-text-meta); border: 1px dashed var(--hz-border-strong); }
@media (hover: hover) and (pointer: fine) {
  .hz-tariff__btn--primary:hover { filter: brightness(1.08); }
  .hz-tariff__btn--quiet:hover { background: var(--hz-surface-hover); }
}
.hz-tariff__note { margin: 0; font-size: var(--hz-text-xs); line-height: 1.4; color: var(--hz-text-meta); text-align: center; text-wrap: pretty; }
.hz-tariff__facts {
  display: flex; flex-direction: column; gap: var(--hz-space-3); min-width: 0;
  padding-top: var(--hz-space-4); border-top: 1px solid var(--hz-border);
}
.hz-tariff__stars { margin: 0; display: flex; align-items: center; gap: var(--hz-space-3); font-size: var(--hz-text-base); line-height: 1.35; color: var(--hz-text); }
.hz-tariff__stars strong { font-weight: var(--hz-weight-bold); }
.hz-tariff__caption { margin: 0; font-size: var(--hz-text-xs); font-weight: var(--hz-weight-semibold); line-height: 1.35; color: var(--hz-text-meta); }
.hz-tariff__est { list-style: none; margin: calc(-1 * var(--hz-space-1)) 0 0; padding: 0; display: grid; gap: var(--hz-space-2); }
.hz-tariff__est li { display: flex; align-items: center; gap: var(--hz-space-3); min-width: 0; font-size: var(--hz-text-sm); line-height: 1.35; color: var(--hz-text-muted); }
.hz-tariff__est li > span { min-width: 0; }
.hz-tariff__est strong { color: var(--hz-text); font-weight: var(--hz-weight-bold); font-variant-numeric: tabular-nums; }
/* A stacked list on a tablet-wide page is no wider than a phone's. */
@container hz-tariffs (min-width: 560px) {
  .hz-tariffs__list { max-width: 560px; margin-inline: auto; gap: var(--hz-space-4); }
}
@container hz-tariffs (min-width: 760px) {
  .hz-tariffs__list { max-width: none; grid-template-columns: repeat(var(--hz-tariff-cols, 3), minmax(0, 1fr)); align-items: stretch; }
  .hz-tariffs__list[data-count="1"] { --hz-tariff-cols: 1; max-width: 420px; }
  .hz-tariffs__list[data-count="2"] { --hz-tariff-cols: 2; max-width: 760px; }
  .hz-tariffs__list[data-count="4"] { --hz-tariff-cols: 4; }
  /* The rows line up across the columns — name, pitch, price, action, facts —
     whatever each one's length (subgrid; without it each column is its own). */
  @supports (grid-template-rows: subgrid) {
    .hz-tariff { grid-row: span 5; grid-template-rows: subgrid; }
    .hz-tariff__in { display: grid; grid-row: span 5; grid-template-rows: subgrid; row-gap: var(--hz-space-3); }
    .hz-tariff__pitch:empty { display: block; }
  }
}
@container hz-tariffs (min-width: 1000px) {
  .hz-tariffs__list { gap: var(--hz-space-5); }
  .hz-tariff__in { padding: var(--hz-space-6); }
}

/* Every plan gives you access to — one row per promise, two columns when wide. */
.hz-tariff-inc { container-type: inline-size; display: grid; gap: var(--hz-space-4); min-width: 0; }
.hz-tariff-inc__title {
  margin: 0; font-family: var(--hz-font-display); font-size: var(--hz-text-lg);
  font-weight: var(--hz-weight-extrabold); letter-spacing: var(--hz-tracking-snug); line-height: 1.25; color: var(--hz-text);
}
.hz-tariff-inc__list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--hz-space-2); }
.hz-tariff-inc__list li {
  display: flex; align-items: center; gap: var(--hz-space-3); min-width: 0;
  padding: var(--hz-space-3) var(--hz-space-4);
  border-radius: var(--hz-radius-18);
  background: var(--hz-plus-tile); border: 1px solid var(--hz-plus-tile-border);
  font-size: var(--hz-text-base); line-height: 1.45; color: var(--hz-text-muted);
}
.hz-tariff-inc__list li > span { min-width: 0; }
.hz-tariff-inc__list strong { color: var(--hz-text); font-weight: var(--hz-weight-bold); }
@container (min-width: 600px) {
  .hz-tariff-inc__list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--hz-space-3); }
}

/* The notes under the plans: small print, one per line, no list marks (the
   estimates' footnote carries its own «*»). The surface aligns them. */
.hz-tariff-notes { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--hz-space-1); font-size: var(--hz-text-sm); line-height: 1.5; color: var(--hz-text-meta); }
.hz-tariff-notes li { text-wrap: pretty; }

@media (forced-colors: active) {
  .hz-tariff, .hz-tariff-inc__list li { border: 1px solid CanvasText; }
  .hz-tariff--featured, .hz-tariff--current { border: 3px solid Highlight; }
}

/* ===========================================================================
 * Plans page — the page around the plan columns: .hz-plans
 *
 * ONE page for the public /pricing (pricing/render.js) and the app's Plans
 * page (subscription-addon.js), built by HzPlusUi.plansPageHtml in a fixed
 * order: head (title, lead) · [the subscriber's bar] · the columns and their
 * notes · «Every plan gives you access to» · more: Star packs, the AI course,
 * questions. Laid out by the width the page gives it (a container), so the
 * app's page and the public page match at every size. Tokens only.
 *
 *   <div class="hz-plans"><div class="hz-plans__in">
 *     <header class="hz-plans__head"> __title · __lead
 *     … .hz-tariffs · .hz-tariff-notes · .hz-tariff-inc
 *     <div class="hz-plans__more"> .hz-packs · .hz-band · .hz-faq
 * ========================================================================= */
.hz-plans { container: hz-plans / inline-size; min-width: 0; color: var(--hz-text); }
.hz-plans__in { display: grid; gap: var(--hz-space-10); min-width: 0; }
.hz-plans__more { display: grid; gap: var(--hz-space-12); min-width: 0; }
.hz-plans__more:empty { display: none; }
.hz-plans__head { display: grid; gap: var(--hz-space-3); justify-items: center; text-align: center; min-width: 0; }
.hz-plans__head--start { justify-items: start; text-align: start; }
.hz-plans__title {
  margin: 0; font-family: var(--hz-font-display); font-weight: var(--hz-weight-extrabold);
  font-size: var(--hz-text-3xl); line-height: 1.1; letter-spacing: var(--hz-tracking-tight);
  color: var(--hz-text); text-wrap: balance;
}
.hz-plans__head--start .hz-plans__title { font-size: var(--hz-text-2xl); }
.hz-plans__lead { margin: 0; max-width: 56ch; font-size: var(--hz-text-md); line-height: 1.5; color: var(--hz-text-meta); text-wrap: pretty; }
.hz-plans__head > .hz-plus-ctx { margin: 0; }
/* A section's heading and the line under it (packs, questions). */
.hz-plans__h2 {
  margin: 0; font-family: var(--hz-font-display); font-weight: var(--hz-weight-extrabold);
  font-size: var(--hz-text-2xl); line-height: 1.15; letter-spacing: var(--hz-tracking-tight);
  color: var(--hz-text); text-wrap: balance;
}
.hz-plans__sub { margin: 0; max-width: 60ch; font-size: var(--hz-text-base); line-height: 1.55; color: var(--hz-text-meta); text-wrap: pretty; }
.hz-plans .hz-tariff-notes { justify-self: center; max-width: 72ch; text-align: center; }
@container hz-plans (min-width: 600px) {
  .hz-plans__in { gap: var(--hz-space-12); }
  .hz-plans__more { gap: var(--hz-space-16); }
}

/* Star packs — the refill: a row of packs and ONE button to buy (never badged). */
.hz-packs { display: grid; gap: var(--hz-space-4); min-width: 0; }
.hz-packs__head { display: grid; gap: var(--hz-space-2); }
.hz-packs__list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--hz-space-3); }
.hz-packs__item {
  display: grid; justify-items: start; gap: var(--hz-space-2); min-width: 0;
  padding: var(--hz-space-4); border-radius: var(--hz-radius-18);
  background: var(--hz-surface-fill); border: 1px solid var(--hz-border);
}
.hz-packs__stars { font-size: var(--hz-text-md); font-weight: var(--hz-weight-bold); line-height: 1.3; font-variant-numeric: tabular-nums; color: var(--hz-text); }
.hz-packs__price { font-size: var(--hz-text-base); color: var(--hz-text-meta); font-variant-numeric: tabular-nums; }
.hz-packs .hz-tariff__btn { justify-self: start; width: auto; padding-inline: var(--hz-space-6); }
@container hz-plans (min-width: 600px) {
  .hz-packs__list { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* A band: one product beside the plans (the AI course) — its words, its
   facts, its price and its one button; the price sits beside the words on a
   wide page, under them on a narrow one. */
.hz-band {
  display: grid; gap: var(--hz-space-4); align-items: center; min-width: 0;
  padding: var(--hz-space-5); border-radius: var(--hz-radius-24);
  background: var(--hz-surface-fill); border: 1px solid var(--hz-border);
}
.hz-band__txt { display: grid; gap: var(--hz-space-2); min-width: 0; }
.hz-band__title {
  margin: 0; font-family: var(--hz-font-display); font-weight: var(--hz-weight-extrabold);
  font-size: var(--hz-text-lg); line-height: 1.25; letter-spacing: var(--hz-tracking-snug); color: var(--hz-text); text-wrap: balance;
}
.hz-band__text { margin: 0; font-size: var(--hz-text-base); line-height: 1.5; color: var(--hz-text-meta); text-wrap: pretty; }
.hz-band__facts { margin: 0; font-size: var(--hz-text-sm); font-weight: var(--hz-weight-semibold); color: var(--hz-text); }
.hz-band__bonus { margin: var(--hz-space-1) 0 0; display: inline-flex; align-items: center; gap: var(--hz-space-2); font-size: var(--hz-text-base); font-weight: var(--hz-weight-semibold); color: var(--hz-text); }
.hz-band__side { display: grid; gap: var(--hz-space-3); justify-items: start; }
.hz-band__price { margin: 0; display: grid; gap: 2px; }
.hz-band__amount {
  font-family: var(--hz-font-display); font-size: var(--hz-text-2xl); font-weight: var(--hz-weight-extrabold);
  letter-spacing: var(--hz-tracking-tight); line-height: 1.1; font-variant-numeric: tabular-nums; color: var(--hz-text);
}
.hz-band__access { font-size: var(--hz-text-sm); color: var(--hz-text-meta); }
.hz-band .hz-tariff__btn { width: auto; padding-inline: var(--hz-space-6); }
@container hz-plans (min-width: 600px) {
  .hz-band { grid-template-columns: minmax(0, 1fr) auto; column-gap: var(--hz-space-8); padding: var(--hz-space-7); }
  .hz-band__side { justify-items: end; text-align: end; }
}

/* Questions — native <details>: works without script, keyboard and screen
   readers for free; one line between each. */
.hz-faq { display: grid; gap: var(--hz-space-4); min-width: 0; }
.hz-faq__list { display: grid; border-top: 1px solid var(--hz-border); }
.hz-faq__item { border-bottom: 1px solid var(--hz-border); }
.hz-faq__q {
  display: flex; align-items: center; justify-content: space-between; gap: var(--hz-space-4);
  min-height: calc(var(--hz-space-12) + var(--hz-space-2)); padding: var(--hz-space-3) 0;
  font-size: var(--hz-text-md); font-weight: var(--hz-weight-bold); line-height: 1.35; color: var(--hz-text);
  cursor: pointer; list-style: none;
}
.hz-faq__q::-webkit-details-marker { display: none; }
.hz-faq__q:focus-visible { outline: 2px solid var(--hz-brand-2); outline-offset: 2px; border-radius: var(--hz-radius-8); }
.hz-faq__chev {
  width: 20px; height: 20px; flex: none;
  fill: none; stroke: var(--hz-text-meta); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.hz-faq__item[open] .hz-faq__chev { transform: rotate(180deg); }
@media (prefers-reduced-motion: no-preference) { .hz-faq__chev { transition: transform var(--hz-dur-fast) var(--hz-ease); } }
.hz-faq__a { margin: 0; padding: 0 0 var(--hz-space-5); max-width: 70ch; font-size: var(--hz-text-base); line-height: 1.6; color: var(--hz-text-meta); text-wrap: pretty; }
@container hz-plans (min-width: 600px) {
  .hz-faq > .hz-plans__h2 { text-align: center; }
  .hz-faq__list { max-width: 760px; width: 100%; margin-inline: auto; }
}

@media (forced-colors: active) {
  .hz-packs__item, .hz-band { border: 1px solid CanvasText; }
}

/* ===========================================================================
 * Back to top — a long page's way up.
 *
 * A raised round control (the icon button atom's tap box at the comfortable
 * 48px, the card register's surface and hairline, the md shadow) a page shows
 * once it has scrolled a few screens AND the person is on the way up (NN/g),
 * and hides again on the way down or near the top — never over the first
 * screen. The page positions it (bottom-end, above its tab bar); the atom owns
 * its look and its one motion, a short rise-in, which reduced motion removes.
 * ========================================================================= */
.hz-totop {
  width: var(--hz-space-12);
  min-width: var(--hz-space-12);
  height: var(--hz-space-12);
  border-radius: var(--hz-radius-pill);
  background: var(--hz-card-raised-bg);
  border: 1px solid var(--hz-card-border);
  color: var(--hz-brand-ink);
  box-shadow: var(--hz-shadow-md);
  animation: hz-totop-in var(--hz-dur-fast) var(--hz-ease) both;
}
.hz-totop[hidden] { display: none; }
@keyframes hz-totop-in { from { opacity: 0; transform: translateY(var(--hz-space-2)); } to { opacity: 1; transform: none; } }
@media (hover: hover) and (pointer: fine) {
  .hz-totop:hover { border-color: var(--hz-brand-border); background: var(--hz-surface-hover); }
}
@media (prefers-reduced-motion: reduce) {
  .hz-totop { animation: none; }
}
@media (forced-colors: active) {
  .hz-plus-btn   { background: ButtonFace; color: ButtonText; border: 1px solid ButtonText; }
  .hz-plus-badge { background: Canvas; color: CanvasText; border: 1px solid CanvasText; }
  .hz-plus-card  { background: Canvas; border-color: CanvasText; }
  .hz-plus-figure { background: none; color: CanvasText; }
  .hz-plan { background: Canvas; border-color: CanvasText; box-shadow: none; }
  .hz-plan[aria-checked="true"] { border-color: Highlight; box-shadow: inset 0 0 0 2px Highlight; }
  .hz-plan[aria-checked="true"] .hz-plan-radio { background: Highlight; }
  .hz-plan[aria-checked="true"] .hz-plan-radio::after { border-color: HighlightText; }
}

/* ===========================================================================
 * Option cards — one choice, or one action, out of a short list on a sheet
 * (the composer's "Who answers" and "+" sheets: attach-menu.js on a phone).
 * The plan cards' anatomy without the Plus register: a raised card per row on
 * the sheet surface, an icon tile or an avatar, a label and a line on what it
 * is for, and — in a single-choice list — the radio mark the plan cards use
 * (the ring and the check are one rule for both families; the brand fills it
 * here, the Plus fill there). The current choice is told by shape as well as
 * colour: the brand edge and the filled mark, on the same opaque card (no tint
 * — the hint keeps AA on it).
 *
 *   <div class="hz-option-group" role="menu" aria-label="Who answers">
 *     <button type="button" class="hz-option" role="menuitemradio" aria-checked="true">
 *       <span class="hz-option-ico hz-option-ico--avatar" aria-hidden="true">…</span>
 *       <span class="hz-option-body">
 *         <span class="hz-option-label">Harizma</span>
 *         <span class="hz-option-hint">Routes each task to the best model</span>
 *       </span>
 *       <span class="hz-option-radio" aria-hidden="true"></span>
 *     </button>
 *   </div>
 *
 * An action list (the "+" sheet) is the same markup with role="menuitem" and
 * no radio. The whole card is one tap target (≥ 44px); the label keeps one
 * line, the hint may take two. Android: HzOption (core/designsystem).
 * ========================================================================= */
.hz-option-group { display: flex; flex-direction: column; gap: var(--hz-space-2); }
.hz-option {
  display: flex; align-items: center; gap: var(--hz-space-3);
  width: 100%; min-height: var(--hz-tap-min); box-sizing: border-box;
  padding: var(--hz-space-3) var(--hz-space-4);
  border: 1px solid var(--hz-option-border); border-radius: var(--hz-option-radius);
  background: var(--hz-option-bg);
  color: var(--hz-text); font-family: inherit; text-align: start; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition:
    background-color var(--hz-dur-fast) var(--hz-ease),
    border-color     var(--hz-dur-fast) var(--hz-ease),
    transform        var(--hz-dur-fast) var(--hz-ease);
}
@media (hover: hover) and (pointer: fine) {
  .hz-option:hover { background: var(--hz-option-bg-pressed); }
}
.hz-option:active { background: var(--hz-option-bg-pressed); transform: scale(.985); }
/* Inset: a sheet's list is a scroll container, which would clip a ring drawn outside the card. */
.hz-option:focus-visible { outline: 2px solid var(--hz-focus-ring); outline-offset: -2px; }
.hz-option[aria-checked="true"] {
  border-color: var(--hz-option-selected-edge);
  box-shadow: inset 0 0 0 1px var(--hz-option-selected-edge);
}
.hz-option-ico {
  flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: var(--hz-radius-12);
  background: var(--hz-option-tile-bg); color: var(--hz-text);
}
.hz-option-ico svg { width: 22px; height: 22px; }
/* An avatar in the tile's place: the slot is the frame, the caller's tile fills it. */
.hz-option-ico--avatar { background: transparent; border-radius: var(--hz-radius-avatar); overflow: hidden; }
.hz-option-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.hz-option-label {
  font-size: var(--hz-text-md); font-weight: var(--hz-weight-bold); line-height: 1.25;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.hz-option-hint {
  font-size: var(--hz-text-sm); color: var(--hz-text-meta); line-height: 1.35;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2;
  overflow: hidden; overflow-wrap: anywhere;
}
.hz-option[aria-checked="true"] .hz-option-radio { border-color: transparent; background: var(--hz-option-selected-edge); }
@media (prefers-reduced-motion: reduce) {
  .hz-option { transition: none; }
  .hz-option:active { transform: none; }
}
@media (forced-colors: active) {
  .hz-option { background: Canvas; border-color: CanvasText; box-shadow: none; }
  .hz-option[aria-checked="true"] { border-color: Highlight; box-shadow: inset 0 0 0 2px Highlight; }
  .hz-option[aria-checked="true"] .hz-option-radio { background: Highlight; }
  .hz-option[aria-checked="true"] .hz-option-radio::after { border-color: HighlightText; }
}

/* ===========================================================================
 * Learning atoms — the parts a lesson, a quiz, a poll or a wizard is built
 * from, so the next feature that asks a question or walks steps composes
 * them instead of drawing its own. First consumer: the language tutors'
 * lesson card (public/js/fmt.js _tutorCard, public/css/tutor.css; Android
 * HzChoice / HzKicker / HzStepDots). Documented on /design-system → Learning.
 *
 *   .hz-option--correct / --wrong   a verdict on an .hz-option: the right
 *                                   choice in the success tone, a wrong pick in
 *                                   the danger tone, told by a mark as well as
 *                                   colour (.hz-option-mark: ✓ / ✗)
 *   .hz-kicker                      a small-caps label naming a kind or a step
 *                                   ("QUIZ", "STEP 2"); tones --brand,
 *                                   --success, --accent-2/3/4 (the spectrum)
 *   .hz-steps                       progress dots: .hz-steps-dot is-current /
 *                                   is-done / is-miss, and .hz-steps-count
 *                                   ("2 / 6") for people who count
 *   .hz-btn--icon[aria-pressed=true] a toggled icon button (a clip playing)
 *
 * Feedback after an answer is the .hz-callout atom in --success / --danger.
 * ========================================================================= */
.hz-option--correct,
.hz-option--correct:disabled {
  border-color: var(--hz-success-border);
  background: var(--hz-success-soft);
  color: var(--hz-success-ink);
  opacity: 1;
}
.hz-option--wrong,
.hz-option--wrong:disabled {
  border-color: var(--hz-danger-border);
  background: var(--hz-danger-soft);
  color: var(--hz-danger-ink);
  opacity: 1;
}
.hz-option--correct .hz-option-label,
.hz-option--wrong .hz-option-label { color: inherit; }
.hz-option:disabled { cursor: default; }
.hz-option:disabled:not(.hz-option--correct):not(.hz-option--wrong) { opacity: var(--hz-btn-disabled-opacity); }
.hz-option-mark {
  flex: none;
  min-width: 24px;
  text-align: center;
  font-weight: var(--hz-weight-bold);
  font-size: var(--hz-text-md);
}
/* A multi-line option (a sentence to choose) wraps instead of clipping. */
.hz-option--wrap .hz-option-label { white-space: normal; overflow: visible; text-overflow: clip; }

.hz-kicker {
  font-size: var(--hz-text-2xs);
  font-weight: var(--hz-weight-semibold);
  /* Small caps need air between letters — the eyebrow tracking, not a display
     heading's negative one (which fused two-word kickers); 0 for Arabic / Hindi. */
  letter-spacing: var(--hz-panel-head-eyebrow-tracking);
  text-transform: uppercase;
  color: var(--hz-text-meta);
}
.hz-kicker--brand    { color: var(--hz-brand-ink); }
.hz-kicker--success  { color: var(--hz-success-ink); }
.hz-kicker--accent-2 { color: var(--hz-spectrum-2-ink); }
.hz-kicker--accent-3 { color: var(--hz-spectrum-3-ink); }
.hz-kicker--accent-4 { color: var(--hz-spectrum-4-ink); }

.hz-steps { display: flex; align-items: center; gap: var(--hz-space-1); }
.hz-steps-dot {
  width: var(--hz-space-2);
  height: var(--hz-space-2);
  border-radius: var(--hz-radius-full);
  background: var(--hz-border-strong);
  transition: transform var(--hz-dur-fast) var(--hz-ease), background-color var(--hz-dur-fast) var(--hz-ease);
}
.hz-steps-dot.is-current { background: var(--hz-brand); transform: scale(1.35); }
.hz-steps-dot.is-done { background: var(--hz-success); }
.hz-steps-dot.is-done.is-miss { background: var(--hz-danger); }
.hz-steps-count {
  margin-inline-start: var(--hz-space-2);
  font-size: var(--hz-text-xs);
  font-weight: var(--hz-weight-semibold);
  color: var(--hz-text-meta);
  font-variant-numeric: tabular-nums;
  /* "2 / 6" is one number pair: in a right-to-left screen the bidi algorithm
     would otherwise swap the two numbers around the slash. */
  direction: ltr; unicode-bidi: isolate;
}

.hz-btn--icon[aria-pressed="true"] { color: var(--hz-brand); border-color: var(--hz-brand-border); }

@media (prefers-reduced-motion: reduce) {
  .hz-steps-dot { transition: none; }
}
@media (forced-colors: active) {
  .hz-option--correct { border-color: Highlight; box-shadow: inset 0 0 0 2px Highlight; }
  .hz-option--wrong { border-color: LinkText; box-shadow: inset 0 0 0 2px LinkText; }
  .hz-steps-dot.is-current { background: Highlight; }
  .hz-steps-dot.is-done { background: CanvasText; }
}

/* ===========================================================================
 * Progress atoms — how far along, and how often: the ring and the week.
 * Built for the person's growth (the growth story in the stories row:
 * public/js/stories/view.js, stories.css; Android HzRing / HzDayStrip)
 * and for any screen that shows a level, a quota or a rhythm.
 *
 *   .hz-ring            a circular meter: the SVG draws a track and a value
 *                       arc; --hz-ring-pct (0–100) is the only input, set on
 *                       the element (style="--hz-ring-pct: 30"). The circle
 *                       uses pathLength="100", so the dash IS the percentage.
 *                       .hz-ring-label sits in the middle (a level, a count).
 *                       sizes --sm 44 · (64) · --lg 96. Decorative: the caller
 *                       says the number in words beside it.
 *   .hz-days            a week of activity: one .hz-day per day, Monday first,
 *                       .hz-day-dot filled when is-active, ringed when
 *                       is-today; .hz-day-label the weekday's letter(s) from
 *                       Intl, never a hard-coded alphabet.
 * ========================================================================= */
.hz-ring {
  --hz-ring-pct: 0;
  --hz-ring-size: 64px;
  --hz-ring-stroke: 4;
  position: relative;
  flex: none;
  width: var(--hz-ring-size); height: var(--hz-ring-size);
  display: grid; place-items: center;
}
.hz-ring svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.hz-ring circle { fill: none; stroke-width: var(--hz-ring-stroke); }
.hz-ring-track { stroke: var(--hz-surface-hover); }
.hz-ring-value {
  stroke: var(--hz-brand);
  stroke-linecap: round;
  stroke-dasharray: var(--hz-ring-pct) 100;
  transition: stroke-dasharray var(--hz-dur-slow) var(--hz-ease);
}
.hz-ring--success .hz-ring-value { stroke: var(--hz-success); }
.hz-ring--warning .hz-ring-value { stroke: var(--hz-warning); }
.hz-ring-label {
  position: relative;
  font-weight: 800; letter-spacing: -.03em; line-height: 1;
  font-size: calc(var(--hz-ring-size) * .34);
  font-variant-numeric: tabular-nums;
  color: var(--hz-text);
}
.hz-ring--sm { --hz-ring-size: 44px; --hz-ring-stroke: 5; }
.hz-ring--lg { --hz-ring-size: 96px; --hz-ring-stroke: 3.5; }

.hz-days { display: flex; justify-content: space-between; gap: var(--hz-space-1); }
.hz-day {
  flex: 1 1 0; min-width: 0;
  display: grid; justify-items: center; gap: var(--hz-space-1);
}
.hz-day-dot {
  box-sizing: border-box;
  width: 28px; height: 28px;
  border-radius: var(--hz-radius-full);
  background: var(--hz-surface-hover);
  border: 2px solid transparent;
  display: grid; place-items: center;
  color: var(--hz-text-onbrand);
  font-size: var(--hz-text-xs); font-weight: 800;
  transition: background-color var(--hz-dur-fast) var(--hz-ease);
}
.hz-day.is-active .hz-day-dot { background: var(--hz-brand); }
.hz-day.is-today .hz-day-dot { border-color: var(--hz-brand); }
.hz-day-label {
  font-size: var(--hz-text-2xs); font-weight: 700; letter-spacing: .04em;
  color: var(--hz-text-meta);
  text-transform: uppercase;
}
.hz-day.is-today .hz-day-label { color: var(--hz-text); }

@media (prefers-reduced-motion: reduce) {
  .hz-ring-value, .hz-day-dot { transition: none; }
}
@media (forced-colors: active) {
  .hz-ring-value { stroke: Highlight; }
  .hz-ring-track { stroke: CanvasText; }
  .hz-day.is-active .hz-day-dot { background: Highlight; }
  .hz-day.is-today .hz-day-dot { border-color: CanvasText; }
}

/* =========================================================================
 * RATING — a place in a table, and a switch
 * -------------------------------------------------------------------------
 * Built for the Rating screen (public/js/addons/growth-addon.js, growth.css;
 * Android HzRankRow / HzSettingsSwitchRow) and for any list that ranks people.
 *
 *   .hz-rank-list       the table: an <ol> of .hz-rank-item, no bullets
 *   .hz-rank            one row — a <button> when it opens something, a <div>
 *                       when it does not: .hz-rank-place (the number; the
 *                       first three wear a medal — add .hz-rank--top),
 *                       .hz-rank-av (the person's picture, round; size
 *                       --hz-rank-av), .hz-rank-who (.hz-rank-name over
 *                       .hz-rank-sub, each one line, ellipsised) and
 *                       .hz-rank-score at the row's end, tabular figures.
 *                       .is-me marks the reader's own row (the brand's soft
 *                       ground). A figure is one left-to-right run.
 *   .hz-switch          an on/off control: a <button role="switch"> whose
 *                       aria-checked IS the state — the style follows the
 *                       attribute, never a class. 44px tall to the finger;
 *                       name it with aria-labelledby.
 * ========================================================================= */
.hz-rank-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.hz-rank-item { min-width: 0; }
.hz-rank {
  --hz-rank-av: 40px;
  box-sizing: border-box;
  width: 100%; min-height: 56px;
  display: grid; grid-template-columns: 32px var(--hz-rank-av) minmax(0, 1fr) auto; align-items: center; gap: var(--hz-space-3);
  padding: var(--hz-space-2);
  border: 0; border-radius: var(--hz-radius-lg);
  background: transparent; color: var(--hz-text);
  font: inherit; text-align: start;
}
button.hz-rank { cursor: pointer; transition: background-color var(--hz-dur-fast) var(--hz-ease); }
button.hz-rank:hover { background: var(--hz-surface-hover); }
button.hz-rank:focus-visible { outline: 2px solid var(--hz-brand); outline-offset: -2px; }
.hz-rank.is-me { background: var(--hz-pill-brand-bg); }
.hz-rank-place {
  text-align: center;
  font-size: var(--hz-text-sm); font-weight: 800; font-variant-numeric: tabular-nums;
  color: var(--hz-text-meta);
  direction: ltr; unicode-bidi: isolate;
}
.hz-rank--top .hz-rank-place { font-size: var(--hz-text-xl); line-height: 1; }
.hz-rank-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.hz-rank-av { width: var(--hz-rank-av); height: var(--hz-rank-av); flex: none; overflow: hidden; }
.hz-rank-who { min-width: 0; display: grid; gap: 2px; }
.hz-rank-name { min-width: 0; display: flex; align-items: center; gap: var(--hz-space-2); }
.hz-rank-name-t {
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: var(--hz-text-sm); font-weight: var(--hz-weight-semibold); color: var(--hz-text);
}
.hz-rank-you { flex: none; }
.hz-rank-sub {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: var(--hz-text-xs); color: var(--hz-text-meta);
}
.hz-rank-score {
  font-size: var(--hz-text-md); font-weight: 800; font-variant-numeric: tabular-nums;
  color: var(--hz-text);
  direction: ltr; unicode-bidi: isolate;
}

.hz-switch {
  box-sizing: content-box;
  position: relative; flex: none;
  width: 44px; height: 26px;
  /* the finger's 44px, without growing the track */
  padding: 0; margin-block: 9px;
  border: 0; border-radius: var(--hz-radius-full);
  /* Off must still read as a control against the card: the quiet ink, not a hairline's tint. */
  background: var(--hz-text-subtle);
  cursor: pointer;
  transition: background-color var(--hz-dur-fast) var(--hz-ease);
}
.hz-switch::before { content: ''; position: absolute; inset: -9px 0; }
.hz-switch::after {
  content: ''; position: absolute; top: 3px; inset-inline-start: 3px;
  width: 20px; height: 20px; border-radius: var(--hz-radius-full);
  background: var(--hz-text-onbrand);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .3);
  transition: transform var(--hz-dur-fast) var(--hz-ease);
}
.hz-switch[aria-checked="true"] { background: var(--hz-brand); }
.hz-switch[aria-checked="true"]::after { transform: translateX(calc(18px * var(--hz-inline-dir, 1))); }
.hz-switch:focus-visible { outline: 2px solid var(--hz-brand); outline-offset: 2px; }
.hz-switch:disabled { opacity: .6; cursor: default; }

@media (prefers-reduced-motion: reduce) {
  button.hz-rank, .hz-switch, .hz-switch::after { transition: none; }
}
@media (forced-colors: active) {
  .hz-rank.is-me { outline: 2px solid Highlight; outline-offset: -2px; }
  .hz-switch { background: CanvasText; }
  .hz-switch[aria-checked="true"] { background: Highlight; }
}

/* ===========================================================================
 * Empty state — a screen with nothing in it yet (the chat list of a new
 * account), or an answer that found nothing (a username nobody has). The
 * Harizma mark centred over a soft spectrum halo, a title that says what is
 * (or what to do), and a body line that says what next. Optional parts:
 *
 *   • .hz-empty-subject — WHAT the state is about, when it is about one thing
 *     the reader named (a username, a file): its own line above the title, so
 *     the thing is never spliced into a translated sentence and a long name
 *     never breaks the answer around it.
 *   • .hz-empty-action — ONE action, only when the way forward is not already
 *     on screen (Invite friends, Try again). Where the surface has its own
 *     control — the composer under the chat list — there is no button: a
 *     second copy of it only repeats it.
 *
 *   <div class="hz-empty">
 *     <span class="hz-empty-mark" aria-hidden="true" data-hz-logo>
 *       <img src="/icons/favicon.svg" alt="" draggable="false">
 *     </span>
 *     <p class="hz-empty-subject"><bdi dir="ltr">@anna</bdi></p>     optional
 *     <p class="hz-empty-title">No one has this username</p>
 *     <p class="hz-empty-body">Check the spelling, or invite them.</p>
 *     <button class="hz-btn hz-btn--primary hz-empty-action">…</button>   optional
 *   </div>
 *
 * It fills and centres in whatever room its parent gives it (a flex column
 * parent: `flex: 1`), so it sits in the middle of the free space, not under
 * the head. The mark is decorative (the title says it all) and carries
 * data-hz-logo, so a partner-only white-label hides it. Register:
 * --hz-empty-*. Android: HzEmptyState (core/designsystem).
 * ========================================================================= */
.hz-empty {
  flex: 1 0 auto;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: var(--hz-empty-gap);
  padding: var(--hz-empty-pad);
  text-align: center;
  animation: hz-empty-in var(--hz-dur-slow) var(--hz-ease-out) both;
}
.hz-empty-mark {
  position: relative;
  display: block;
  width: var(--hz-empty-mark); height: var(--hz-empty-mark);
  margin-bottom: calc(var(--hz-empty-mark-gap) - var(--hz-empty-gap));
}
.hz-empty-mark::before {
  content: '';
  position: absolute; inset: calc(var(--hz-empty-mark) / -2);
  border-radius: var(--hz-radius-full);
  background: var(--hz-empty-halo);
  pointer-events: none;
}
.hz-empty-mark img { position: relative; display: block; width: 100%; height: 100%; }
/* Balanced lines: a title that takes two lines splits evenly, never leaving one word alone. */
.hz-empty-subject, .hz-empty-title, .hz-empty-body { margin: 0; max-width: var(--hz-empty-measure); overflow-wrap: anywhere; text-wrap: balance; }
.hz-empty-title {
  color: var(--hz-text);
  font-size: var(--hz-text-lg);
  font-weight: var(--hz-weight-semibold);
  line-height: var(--hz-leading-snug);
  letter-spacing: var(--hz-role-title-tracking);
}
.hz-empty-body {
  color: var(--hz-text-muted);
  font-size: var(--hz-role-body-size);
  line-height: var(--hz-role-body-leading);
}
/* The thing the state is about: the body's size and ink, set apart by weight.
   The title stays the loudest line — the answer, not the name. */
.hz-empty-subject {
  color: var(--hz-text-muted);
  font-size: var(--hz-role-body-size);
  font-weight: var(--hz-weight-semibold);
  line-height: var(--hz-role-body-leading);
}
/* The one action sits apart from the words, as on Android (HzEmptyState). */
.hz-empty-action { margin-top: calc(var(--hz-space-4) - var(--hz-empty-gap)); }
@keyframes hz-empty-in {
  from { opacity: 0; transform: translateY(var(--hz-space-2)); }
  to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .hz-empty { animation: none; }
}
@media (forced-colors: active) {
  .hz-empty-mark::before { display: none; }
}

/* ===========================================================================
 * Seats — the places a person fills by inviting friends (the invite sheet,
 * public/js/addons/invite-addon.js; member-referral/). One seat per friend:
 * a face once they joined, a dashed "+N" while it is still open. The empty
 * seats ARE the goal — what each one is worth is written inside it — so the
 * sheet needs no rule to explain progress.
 *
 *   <div class="hz-seats">
 *     <ul class="hz-seats-row" aria-label="…">
 *       <li class="hz-seat hz-seat--done" aria-label="Max: started chatting">
 *         <div class="hz-seat-face av-person has-img"><img …/></div>
 *         <span class="hz-seat-b" aria-hidden="true"><svg …/></span>
 *       </li>
 *       <li class="hz-seat hz-seat--wait" aria-label="…">…</li>
 *       <li class="hz-seat hz-seat--empty" aria-label="Empty seat: 10★">+10</li>
 *       <li class="hz-seat hz-seat--more" aria-label="More friends: 6">+6</li>
 *     </ul>
 *     <p class="hz-seats-l" role="status">Invite 5 friends, get 50★</p>
 *   </div>
 *
 * States: --done (started: success check) · --wait (joined, not started yet:
 * a quiet clock, the face dimmed) · --empty (open) · --more (more friends than
 * seats). .is-new pops a seat that just filled. The face is the app's ONE
 * person avatar (AvatarStore.personMarkup — photo, else the Harizma mark).
 * Colour: the invite register (--hz-invite-*, the Stars hue) + success.
 * Hook: --hz-seat-ground — the surface the seat sits on (the badge's ring).
 * ========================================================================= */
.hz-seats {
  display: flex; flex-direction: column; align-items: center;
  gap: var(--hz-space-2);
  width: 100%;
}
.hz-seats-row {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: var(--hz-space-2);
  margin: 0; padding: 0; list-style: none;
}
.hz-seat {
  position: relative;
  flex: none;
  width: var(--hz-tap-min); height: var(--hz-tap-min);
  border-radius: var(--hz-radius-full);
  display: grid; place-items: center;
  font-size: var(--hz-text-xs); font-weight: var(--hz-weight-bold);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.hz-seat-face {
  width: 100%; height: 100%;
  border-radius: inherit;
  overflow: hidden;
}
.hz-seat-face img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* "+10" is a number with its sign: it reads left to right in every language. */
.hz-seat--empty, .hz-seat--more { direction: ltr; unicode-bidi: isolate; }
.hz-seat--empty {
  border: 1.5px dashed var(--hz-invite-border);
  background: var(--hz-invite-tint);
  color: var(--hz-invite-ink);
}
.hz-seat--more {
  border: 1.5px solid var(--hz-invite-border);
  background: var(--hz-invite-soft);
  color: var(--hz-invite-ink);
}
.hz-seat--wait .hz-seat-face { opacity: .72; }
.hz-seat-b {
  position: absolute; inset-inline-end: -3px; bottom: -3px;
  width: 18px; height: 18px;
  border-radius: var(--hz-radius-full);
  display: grid; place-items: center;
  box-shadow: 0 0 0 2px var(--hz-seat-ground, var(--hz-surface));
}
.hz-seat-b svg {
  width: 11px; height: 11px;
  fill: none; stroke: currentColor; stroke-width: 3;
  stroke-linecap: round; stroke-linejoin: round;
}
.hz-seat--done .hz-seat-b { background: var(--hz-success); color: var(--hz-text-onbrand); }
.hz-seat--wait .hz-seat-b {
  background: var(--hz-surface-raised); color: var(--hz-text-muted);
  box-shadow: 0 0 0 2px var(--hz-seat-ground, var(--hz-surface)), inset 0 0 0 1px var(--hz-border-strong);
}
.hz-seat--wait .hz-seat-b svg { stroke-width: 2.4; }
.hz-seat.is-new { animation: hz-seat-in var(--hz-dur-slow) var(--hz-ease-spring) both; }
@keyframes hz-seat-in { from { transform: scale(.6); } to { transform: scale(1); } }
.hz-seats-l {
  margin: 0;
  text-align: center; text-wrap: pretty;
  font-size: var(--hz-text-sm); line-height: 1.4;
  color: var(--hz-text-muted);
}
.hz-seats-l b { color: var(--hz-text); font-weight: var(--hz-weight-bold); }
.hz-seats-l .hz-seats-ok { color: var(--hz-success-ink); font-weight: var(--hz-weight-bold); }

/* ===========================================================================
 * Link copy — a link and its Copy as one control: the invite sheet's link
 * under "Invite friends", the share sheet's link above Share (the apps draw
 * the same: android LinkCopyField). The address in mono, then Copy. Confirms
 * in place — the row turns success-tinted, "Copy" reads "Copied" in the text
 * ink beside a success check (the caller swaps the word and its icon and
 * announces it) — so no toast covers the sheet.
 *
 *   <button type="button" class="hz-link-copy" aria-label="Copy your invite link">
 *     <span class="hz-link-copy-v">harizma.ai/i/anna</span>
 *     <span class="hz-link-copy-a"><svg …/> Copy</span>
 *   </button>
 *
 * State: .is-copied. The address takes the row and is LTR in every language;
 * it never wraps (it ellipsises); the action keeps its width at the end.
 * ========================================================================= */
.hz-link-copy {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--hz-space-2);
  width: 100%; min-height: var(--hz-tap-comfort);
  padding: 0 var(--hz-space-3);
  border: 1px solid var(--hz-border);
  border-radius: var(--hz-radius-12);
  background: transparent;
  color: var(--hz-text-muted);
  font: inherit; font-size: var(--hz-text-sm);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition:
    background-color var(--hz-dur-fast) var(--hz-ease),
    border-color     var(--hz-dur-fast) var(--hz-ease);
}
.hz-link-copy-v {
  flex: 1; min-width: 0; text-align: start;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  direction: ltr; unicode-bidi: isolate;
  font-family: var(--hz-font-mono); font-size: var(--hz-text-xs);
  color: var(--hz-text);
}
/* An RTL row still starts with the address: it sits at the row's start (the right). */
[dir="rtl"] .hz-link-copy-v { text-align: right; }
.hz-link-copy-a {
  flex: none;
  display: inline-flex; align-items: center; gap: var(--hz-space-1);
  color: var(--hz-brand-ink); font-weight: var(--hz-weight-semibold);
}
.hz-link-copy-a svg {
  width: 14px; height: 14px;
  fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
}
@media (hover: hover) and (pointer: fine) {
  .hz-link-copy:hover { background: var(--hz-surface-hover); border-color: var(--hz-border-strong); }
}
.hz-link-copy.is-copied { background: var(--hz-success-soft); border-color: var(--hz-success-border); }
.hz-link-copy.is-copied .hz-link-copy-a { color: var(--hz-text); }
.hz-link-copy.is-copied .hz-link-copy-a svg { color: var(--hz-success-ink); }

@media (prefers-reduced-motion: reduce) {
  .hz-seat.is-new { animation: none; }
  .hz-link-copy { transition: none; }
}
@media (forced-colors: active) {
  .hz-seat--empty, .hz-seat--more { border-color: CanvasText; background: Canvas; color: CanvasText; }
  .hz-seat-b { background: Canvas; color: CanvasText; border: 1px solid CanvasText; }
  .hz-link-copy { border-color: ButtonText; }
  .hz-link-copy.is-copied { border-color: Highlight; }
}

/* ===========================================================================
 * Harizma wordmark — the brand lettering, one shared atom.
 * Rendered as a masked SVG so it is pixel-identical on every surface
 * (marketing header/footer, app top nav, sidebar, home composer) and in
 * every theme. Colour follows `currentColor`; scale it with `font-size`
 * (height is 1em) or by setting an explicit `height`.
 * Asset: /img/harizma-wordmark.svg — viewBox 1372 × 272 (ratio ≈ 5.044).
 * ========================================================================= */
.hz-wordmark {
  display: inline-block;
  height: 1em;
  aspect-ratio: 1372 / 272;
  background-color: currentColor;
  -webkit-mask: url(/img/harizma-wordmark.svg) left center / contain no-repeat;
          mask: url(/img/harizma-wordmark.svg) left center / contain no-repeat;
  flex-shrink: 0;
}

/* ===========================================================================
 * Co-brand lockup — a partner white-label's mark beside, or instead of, the
 * Harizma logo. partners/whitelabel-shell.js writes it into every logo slot
 * (the inert <span data-hz-wl-mark hidden> the markup carries); the mode is
 * <html data-wl-logo>:
 *   cobrand  Harizma mark + wordmark, "×", partner mark
 *   partner  the partner mark alone, in the platform mark's place: the Harizma
 *            parts of a slot carry [data-hz-logo] and are hidden
 * Plain pages never contain it. Sized by the --hz-cobrand-* tokens.
 *
 * Spacing: every slot is a flex row whose gap already separates the wordmark
 * from the lockup. The lockup takes that SAME gap between "×" and the mark
 * (column-gap: inherit) and adds no margin of its own, so the space on each
 * side of the "×" is equal in every slot, whatever that slot's gap is.
 * ========================================================================= */
.hz-cobrand {
  display: inline-flex;
  align-items: center;
  column-gap: inherit;
  flex-shrink: 0;
  vertical-align: middle;
}
.hz-cobrand__x {
  color: var(--hz-cobrand-x-color);
  font-weight: var(--hz-cobrand-x-weight);
  line-height: 1;
}
.hz-cobrand__mark {
  display: block;
  height: var(--hz-cobrand-mark-h);
  width: auto;
  max-width: var(--hz-cobrand-mark-max-w);
  object-fit: contain;
}
html[data-wl-logo="partner"] [data-hz-logo] { display: none; }
html[data-wl-logo="partner"] .hz-cobrand__x { display: none; }
html[data-wl-logo="partner"] .hz-cobrand__mark {
  height: var(--hz-cobrand-solo-h);
  max-width: var(--hz-cobrand-solo-max-w);
}

/* ===========================================================================
 * Reduced motion (WCAG 2.3.3). The atom carries its own a11y safety so it
 * holds even on pages that don't load base.css / .hz-root (e.g. the standalone
 * profile + share pages). Marketing pages also neutralize via marketing.css;
 * this is the single-source guarantee for every consumer.
 * ========================================================================= */
@media (prefers-reduced-motion: reduce) {
  .hz-btn, .hz-card, .hz-input, .hz-textarea, .hz-pill { transition: none; }
}

/* ===========================================================================
 * Reading direction + connected scripts: Arabic, Devanagari (docs/i18n.md §2 rule 7)
 *
 * Layout itself is logical everywhere (margin-inline-*, inset-inline-*,
 * text-align: start …), so it mirrors on its own under <html dir="rtl">. What
 * is left lives here, once, for every page that loads the atoms:
 * ========================================================================= */

/* 1 · Arabic and Hindi text take no tracking and no case transform. Tracking
 *     pulls the joined letters of a cursive script apart, and breaks
 *     Devanagari's headline and conjuncts; uppercase does nothing to either
 *     script but leaves the Latin words around it shouting. The tracking
 *     TOKENS already go to 0 under :root:lang(ar) / :root:lang(hi)
 *     (tokens.css); this catches the literal letter-spacing values component
 *     rules still carry. !important is the point: it must beat every
 *     component rule, whatever its specificity or load order, and only ever
 *     on Arabic or Hindi text. */
:lang(ar),
:lang(ar)::before,
:lang(ar)::after,
:lang(ar)::placeholder,
:lang(hi),
:lang(hi)::before,
:lang(hi)::after,
:lang(hi)::placeholder {
  letter-spacing: normal !important;
  text-transform: none !important;
}

/* 2 · Code is left-to-right in every language. Block code reads and aligns
 *     LTR; inline code is isolated so its punctuation cannot reorder the
 *     Arabic sentence around it. */
pre, code, kbd, samp { direction: ltr; unicode-bidi: isolate; }
pre { text-align: left; }

/* 3 · Addresses and numbers typed into a form are LTR strings even on an RTL
 *     page; they still sit at the start (right) edge of the field. */
[dir="rtl"] input:is([type="email"], [type="tel"], [type="url"]) {
  direction: ltr;
  text-align: right;
}

/* 4 · Icons that POINT along the reading direction mirror: back / forward
 *     chevrons, "go" arrows, prev / next. The shapes are matched by their
 *     geometry, so every copy of the shared line icons is covered wherever its
 *     markup lives (app shell, addons, settings rows) without a class on each
 *     one. view-box flips about the icon's own centre (12,12 in a 24 grid).
 *     Never mirrored: logos, play, checkmarks, clocks, search, the up-arrow
 *     send button. Text arrows ‹ › « » mirror by themselves (Unicode
 *     Bidi_Mirrored); → ← do not, so CSS-drawn ones are handled where drawn. */
[dir="rtl"] :is(
  polyline[points="9 18 15 12 9 6"],
  polyline[points="15 18 9 12 15 6"],
  polyline[points="9 6 15 12 9 18"],
  polyline[points="12 5 19 12 12 19"],
  path[d="M9 18l6-6-6-6"],
  path[d="M15 18l-6-6 6-6"],
  path[d="M5 12h14M13 6l6 6-6 6"],
  path[d="M3 8h9M8.5 4.5 12 8l-3.5 3.5"],
  path[d="M14 11.5L18.5 16L14 20.5"]
) {
  transform: scaleX(-1);
  transform-box: view-box;
  transform-origin: 50% 50%;
}

/* ── Direction arrows in copy ───────────────────────────────────────────────
   A "→" that follows a label ("Start free →") points the way the line reads,
   so it lives OUTSIDE the translated text in its own span and turns round in a
   right-to-left page. Used by the marketing chrome, landing, packs. */
.hz-arrow { display: inline-block; }
[dir="rtl"] .hz-arrow { transform: scaleX(-1); }
