/* Cowok base stylesheet.
 *
 * Written against theme variables only - no literal colours, radii or fonts -
 * so the Theme Builder restyles the whole product by writing rows.
 *
 * Mobile-first, and deliberately defensive about small Android screens, which
 * is where the spec asks for particular attention:
 *   - every flex/grid child gets `min-width: 0`, because the default `auto`
 *     makes a long unbreakable string (a USDT address, an email) push the whole
 *     page wider and cause horizontal scroll
 *   - long identifiers use `overflow-wrap: anywhere` for the same reason
 *   - interactive targets are at least 44px tall
 *   - nothing sets a fixed width; max-widths only
 */

/* Dark is the default; light is the html[data-theme="light"] override the
 * profile toggle flips (palette emitted by theme.py's compile_css). */
:root { color-scheme: dark; }
html[data-theme="light"] { color-scheme: light; }

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* Mobile browsers paint a translucent blue/grey rectangle over whatever
   * was tapped. The site already has its own press feedback (the :active
   * scale on buttons and nav tabs), so the system highlight just fights it.
   * Focus rings for keyboard users are untouched - this only affects taps. */
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0;
  font-family: var(--t-font-body);
  font-size: var(--fs-md);
  font-weight: var(--t-body-weight);
  line-height: var(--t-line-height);
  letter-spacing: var(--t-letter-spacing);
  color: var(--c-text);
  background: var(--c-background);
  /* Room for the fixed mobile nav so the last element is never unreachable. */
  padding-bottom: env(safe-area-inset-bottom);
}

body.has-mobile-nav {
  padding-bottom: calc(72px + env(safe-area-inset-bottom));
}

h1, h2, h3, h4, h5, h6 {
  margin: 0 0 0.5em;
  font-family: var(--t-font-heading);
  font-weight: var(--t-heading-weight);
  line-height: var(--t-heading-line-height);
  letter-spacing: var(--t-heading-letter-spacing, -0.02em);
  /* Long words in owner-authored headings must not widen the page. */
  overflow-wrap: break-word;
}

h1 { font-size: var(--fs-2xl); }
h2 { font-size: var(--fs-xl); }
h3 { font-size: var(--fs-lg); }
h4, h5, h6 { font-size: var(--fs-md); }

@media (min-width: 768px) {
  h1 { font-size: var(--fs-3xl); }
  h2 { font-size: var(--fs-2xl); }
  h3 { font-size: var(--fs-xl); }
}

p { margin: 0 0 1em; overflow-wrap: break-word; }
p:last-child { margin-bottom: 0; }

a { color: var(--c-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

img, svg, video, canvas {
  max-width: 100%;
  height: auto;
  display: block;
}

hr {
  border: 0;
  border-top: 1px solid var(--c-border);
  margin: 24px 0;
}

:focus-visible {
  outline: 2px solid var(--c-primary);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------------------------------------------------------------- layout */

.shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh; /* dvh keeps the footer off the Android URL bar */
}

.shell > main { flex: 1 1 auto; min-width: 0; }

/* Auth screens carry no dashboard chrome, so centre them vertically on tall
 * viewports while still scrolling normally when the keyboard is open. */
.auth-page .shell > main { display: flex; align-items: center; }

.wrap {
  width: 100%;
  max-width: var(--l-max-width);
  margin: 0 auto;
  padding: 0 var(--l-gutter);
}

.wrap--narrow { max-width: 560px; }
.wrap--mid { max-width: 820px; }

.stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.stack--sm { gap: 8px; }
.stack--xs { gap: 4px; }
.stack--lg { gap: 28px; }

.row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.row > * { min-width: 0; }
.row--between { justify-content: space-between; }
.row--end { justify-content: flex-end; }
.row--top { align-items: flex-start; }
.spacer { flex: 1 1 auto; }

.grid {
  display: grid;
  gap: 14px;
  /* auto-fit with a minmax floor of 0 avoids the classic overflow where a
   * min-content track wider than the screen forces horizontal scroll. */
  grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
}

.grid--2 { grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); }
.grid--wide { grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); }

/* Dashboard widgets. A 140px floor keeps two cards per row on a 360px phone
 * instead of one tall column, without ever exceeding the viewport. */
.grid--metrics {
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(min(140px, 100%), 1fr));
}

/* Explicit top/bottom only (never a shorthand) so .section can never
 * clobber horizontal padding on an element it's combined with, regardless
 * of CSS source order - e.g. class="wrap section" must keep .wrap's
 * --l-gutter padding-left/right untouched. */
.section { padding-top: 28px; padding-bottom: 28px; }
@media (min-width: 768px) {
  .section { padding-top: var(--l-section-spacing); padding-bottom: var(--l-section-spacing); }
}

/* ---------------------------------------------------------------- header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--c-surface) 70%, transparent);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  backdrop-filter: blur(20px) saturate(160%);
  border-bottom: 1px solid color-mix(in srgb, var(--c-border) 70%, transparent);
}

@supports not (backdrop-filter: blur(1px)) {
  .site-header { background: var(--c-surface); }
}

.site-header__inner {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 54px;
  min-width: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: var(--fs-lg);
  color: var(--c-text);
  min-width: 0;
}

.brand:hover { text-decoration: none; }
.brand__mark { width: 32px; height: 32px; border-radius: var(--r-sm); flex: 0 0 auto; }
.brand__mark { display: inline-flex; align-items: center; justify-content: center; }
.brand__owl {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: var(--r-sm);
  background-image: url("brand/cowok-256.webp");
  background-position: center;
  background-size: contain;
  background-repeat: no-repeat;
}
html[data-theme="light"] .brand__owl { background-image: url("brand/cowok-light-256.webp"); }
.brand__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.nav-main { display: none; gap: 4px; }
@media (min-width: 900px) { .nav-main { display: flex; } }

.nav-main a {
  padding: 10px 12px;
  border-radius: var(--r-button);
  color: var(--c-text-muted);
  font-size: var(--fs-sm);
  white-space: nowrap;
}

.nav-main a:hover { background: var(--c-surface-variant); color: var(--c-text); text-decoration: none; }

/* Avatar / profile button, top-right. */
.avatar {
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  border-radius: var(--r-pill);
  border: 1px solid var(--c-border);
  background: var(--c-primary-container);
  color: var(--c-primary-hover);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: var(--fs-sm);
  cursor: pointer;
  padding: 0;
  overflow: hidden;
}

.avatar:hover { background: var(--c-primary); color: var(--c-on-primary); }

/* Non-interactive, larger variant used as a profile picture stand-in. */
.avatar--lg {
  width: 56px;
  height: 56px;
  font-size: var(--fs-lg);
  cursor: default;
}
.avatar--lg:hover { background: var(--c-primary-container); color: var(--c-primary-hover); }

/* ------------------------------------------------------------- dropdown */

.menu { position: relative; }

.menu__panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 220px;
  max-width: min(280px, calc(100vw - 24px));
  /* Fully opaque: whatever scrolls under the menu must never bleed through
   * the text. The border, top highlight and springy pop keep it feeling like
   * a physical floating pane rather than a flat dropdown. */
  background: var(--c-surface);
  border: 1px solid color-mix(in srgb, var(--c-border) 80%, transparent);
  border-radius: 20px;
  box-shadow: var(--sh-lg);
  padding: 8px;
  z-index: 50;
  transform-origin: top right;
  animation: menu-pop 480ms cubic-bezier(0.32, 0.72, 0.2, 1.08);
}

@keyframes menu-pop {
  from { opacity: 0; transform: scale(0.88) translateY(-8px); }
  to { opacity: 1; transform: none; }
}

.menu__panel[hidden] { display: none; }

.menu__header {
  padding: 10px 12px;
  border-bottom: 1px solid var(--c-border);
  margin-bottom: 6px;
}

.menu__name { font-weight: 600; }
.menu__email { font-size: var(--fs-sm); color: var(--c-text-muted); overflow-wrap: anywhere; }

.menu__item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  min-height: 44px;
  border-radius: var(--r-sm);
  color: var(--c-text);
  font-size: var(--fs-sm);
  background: none;
  border: 0;
  width: 100%;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
}

.menu__item:hover { background: var(--c-surface-variant); text-decoration: none; }
.menu__item--danger { color: var(--c-error); }

/* ------------------------------------------------------------ mobile nav */
/* A floating glass pill rather than a full-width bar: inset from the screen
 * edges, heavily rounded, frosted over whatever scrolls beneath it. Blur is
 * limited to this, the header, the menu, the modal and the toasts - blurring
 * dozens of cards is what makes "glassmorphism" jank on cheap Androids. */
.nav-mobile {
  position: fixed;
  bottom: calc(10px + env(safe-area-inset-bottom));
  left: 12px;
  right: 12px;
  z-index: 45;
  display: flex;
  background: color-mix(in srgb, var(--c-surface) 62%, transparent);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid color-mix(in srgb, var(--c-border) 75%, transparent);
  border-radius: 24px;
  box-shadow: var(--sh-lg);
  overflow: hidden;
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .nav-mobile { background: var(--c-surface); }
}

@media (min-width: 900px) { .nav-mobile { display: none; } }

/* The sliding highlight behind the active tab. Injected and positioned by
 * cowok.js; it animates from the previously-active tab (sessionStorage) so
 * switching sections in the bottom nav visibly slides, like an iOS tab bar
 * indicator. */
.nav-mobile__thumb {
  position: absolute;
  top: 7px;
  bottom: 7px;
  /* The horizontal position is fully JS-controlled (left edge = tab's left
   * + 6px, width = tab width - 12px) so the highlight sits inset inside each
   * tab and never overflows; this must stay 0 or it drifts right again. */
  left: 0;
  border-radius: 14px;
  background: color-mix(in srgb, var(--c-primary) 16%, transparent);

  transition: transform 520ms cubic-bezier(0.32, 0.72, 0.2, 1);
  pointer-events: none;
}

.nav-mobile a {
  position: relative;
  z-index: 1;
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 7px 2px;
  min-height: 56px;
  border-radius: 14px;
  color: var(--c-text-muted);
  font-size: 11px;
  text-align: center;
  transition: color var(--e-transition), transform 120ms ease;
}

.nav-mobile a:active { transform: scale(0.92); }
.nav-mobile a:hover { text-decoration: none; }
.nav-mobile a.is-active { color: var(--c-primary); }
.nav-mobile .icon { font-size: 22px; }
.nav-mobile__label {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ----------------------------------------------------------------- cards */
/* Translucent rather than solid so the background glow shows through - the
 * glass look without backdrop-filter's per-frame cost on every card. */
.card {
  /* Flat, like the light theme: a solid surface, one crisp border, one soft
   * shadow to lift it off the page. No translucency, sheen or glass edges -
   * neat and calm, the way an iOS app groups content. (The bottom nav keeps
   * its glass - that one surface is deliberately special.) */
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-card);
  padding: 15px;
  box-shadow: 0 12px 30px rgba(4, 10, 24, 0.16);
  min-width: 0;
}

.card--flat { box-shadow: none; }
.card--pad-lg { padding: 20px; }
.card__title { font-size: var(--fs-lg); margin-bottom: 4px; }
.card__sub { color: var(--c-text-muted); font-size: var(--fs-sm); }

/* Metric widget */
.metric { display: flex; flex-direction: column; gap: 5px; }

.metric__head {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--c-text-muted);
  font-size: var(--fs-sm);
  min-width: 0;
}

.metric__label { overflow-wrap: break-word; }
.metric__sub { color: var(--c-text-muted); font-size: var(--fs-sm); overflow-wrap: break-word; }

.metric__value {
  font-size: var(--fs-xl);
  font-weight: 700;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.metric__icon {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  border-radius: var(--r-sm);
  background: var(--c-primary-container);
  color: var(--c-primary-hover);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Total Balance is the financial headline, so it spans the full metric row
 * instead of leaving one narrow card stranded beside empty grid space. */
.metric--total {
  grid-column: 1 / -1;
  position: relative;
  overflow: hidden;
  padding: 16px;
  border-radius: var(--r-card);
  border-color: color-mix(in srgb, var(--c-primary) 38%, var(--c-border));
  background: var(--c-surface);
  box-shadow: 0 12px 30px rgba(4, 10, 24, 0.16);
}
.metric--total .metric__icon {
  width: 34px;
  height: 34px;
  background: color-mix(in srgb, var(--c-primary) 18%, transparent);
}
.metric--total .metric__label {
  color: var(--c-text);
  font-size: var(--fs-md);
}
.metric--total .metric__value {
  font-size: clamp(1.5rem, 5vw, 2rem);
  color: var(--c-primary);
}

/* ------------------------------------------------- home highlight carousel */

.home-carousel {
  display: grid;
  gap: 10px;
}
.home-carousel__viewport {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: min(100%, 520px);
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  padding: 2px;
  border-radius: 30px;
}
.home-carousel__viewport::-webkit-scrollbar { display: none; }
.home-carousel__viewport:focus-visible {
  outline: 2px solid var(--c-primary);
  outline-offset: 3px;
}
.promo-card {
  scroll-snap-align: center;
  display: grid;
  align-content: start;
  gap: 14px;
  min-height: 212px;
  padding: 18px;
  border: 1px solid var(--c-border);
  border-radius: 30px;
  background: var(--c-surface);
  box-shadow: 0 12px 30px rgba(4, 10, 24, 0.16);
}
.promo-card__icon {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  background: var(--c-primary-container);
  color: var(--c-primary-hover);
}
.promo-card__title {
  margin: 0;
  font-size: var(--fs-lg);
  line-height: 1.2;
}
.promo-card__body {
  margin: 0;
  color: var(--c-text-muted);
  font-size: var(--fs-md);
  line-height: 1.45;
}
.promo-card .btn { justify-self: start; }
.home-carousel__controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}
.home-carousel__arrow {
  width: 34px;
  height: 34px;
  color: var(--c-text);
  background: var(--c-surface);
  border: 1px solid var(--c-border);
}
.home-carousel__dots {
  display: flex;
  align-items: center;
  gap: 7px;
}
.home-carousel__dot {
  width: 7px;
  height: 7px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: color-mix(in srgb, var(--c-text-muted) 48%, transparent);
}
.home-carousel__dot.is-active {
  width: 20px;
  border-radius: 999px;
  background: var(--c-primary);
}

/* --------------------------------------------------------------- buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: var(--r-button);
  /* Plain and flat: a solid fill, no gradient, no glow, no inner sheen.
   * The tint variants below only swap colour; nothing on a button is
   * translucent. (2026-09-03, per review: buttons stopped being glass.) */
  background: var(--c-primary);
  color: var(--c-on-primary);
  font-family: inherit;
  font-size: var(--fs-md);
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  text-align: center;
  transition: background var(--e-transition), transform 120ms ease;
  /* Long owner-authored labels wrap instead of widening the layout. */
  max-width: 100%;
  overflow-wrap: break-word;
}

.btn:hover {
  background: var(--c-primary-hover);
  text-decoration: none;
}
.btn:focus-visible { box-shadow: var(--sh-focus); }
/* The iOS press: everything you tap shrinks a touch and springs back. */
.btn:active { transform: scale(0.97); }

.btn[disabled],
.btn.is-disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* Variant buttons only swap colour; every fill is solid, every edge plain. */
.btn--secondary {
  background: var(--c-surface-variant);
  color: var(--c-text);
  border-color: var(--c-border);
}
.btn--secondary:hover { background: var(--c-surface-variant); }
.btn--active {
  background: var(--c-primary-container);
  color: var(--c-primary-hover);
  border-color: var(--c-primary);
  box-shadow: var(--sh-focus);
}

.btn--ghost { background: transparent; color: var(--c-primary); box-shadow: none; }
.btn--ghost:hover { background: var(--c-primary-container); }

/* An explicit name for the default look, so a template can select a variant
 * dynamically (`btn--{{ 'primary' if ... }}`) without a special case. */
.btn--primary { background: var(--c-primary);
  color: var(--c-on-primary); border-color: transparent; }

/* Dark mode hovers go lighter, light mode hovers darker. */
.btn--danger { background: var(--c-error); }
.btn--danger:hover { background: color-mix(in srgb, var(--c-error) 82%, white); }
html[data-theme="light"] .btn--danger:hover { background: color-mix(in srgb, var(--c-error) 85%, black); }

.btn--success { background: var(--c-success); }
.btn--success:hover { background: color-mix(in srgb, var(--c-success) 82%, white); }
html[data-theme="light"] .btn--success:hover { background: color-mix(in srgb, var(--c-success) 85%, black); }

.btn--lg { min-height: 50px; padding: 13px 24px; font-size: var(--fs-lg); }
.btn--sm { min-height: 38px; padding: 8px 14px; font-size: var(--fs-sm); }
.btn--block { width: 100%; }
.btn--pill { border-radius: var(--r-pill); }

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  padding: 0;
  border: 1px solid var(--c-border);
  border-radius: var(--r-sm);
  background: var(--c-surface);
  color: var(--c-text-muted);
  cursor: pointer;
}

.btn-icon:hover { background: var(--c-surface-variant); color: var(--c-text); }
.btn-icon:active { transform: scale(0.92); }

.avatar:active { transform: scale(0.94); }
.avatar { transition: background var(--e-transition), color var(--e-transition), transform 120ms ease; }

/* ----------------------------------------------------------------- forms */

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }

.field__label { font-size: var(--fs-sm); font-weight: 600; }
.field__hint { font-size: var(--fs-sm); color: var(--c-text-muted); }
.field__error { font-size: var(--fs-sm); color: var(--c-error); font-weight: 500; }
.field__req { color: var(--c-error); }

.input,
.select,
.textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  /* 1.5px rather than the usual 1px: hairline inputs disappear against a
   * dark surface; the extra half pixel reads as a crisp edge (keevy-style). */
  border: 1.5px solid var(--c-border);
  border-radius: var(--r-input);
  /* Solid fill like the light theme's inputs - a slightly raised surface
   * tone inside flat cards, with the crisp 1.5px border doing the work. */
  background: var(--c-surface-variant);
  color: var(--c-text);
  font-family: inherit;
  /* 16px minimum, or mobile Safari and some Android browsers zoom on focus and
   * leave the page horizontally scrolled. */
  font-size: max(var(--fs-md), 16px);
  line-height: 1.4;
  transition: border-color var(--e-transition), box-shadow var(--e-transition);
}

.textarea { min-height: 110px; resize: vertical; }

.select {
  appearance: none;
  padding-right: 40px;
  background-image: linear-gradient(45deg, transparent 49%, var(--c-text-muted) 50%),
                    linear-gradient(-45deg, transparent 49%, var(--c-text-muted) 50%);
  background-size: 6px 6px, 6px 6px;
  background-position: right 18px center, right 12px center;
  background-repeat: no-repeat;
}

.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: var(--c-primary);
  box-shadow: var(--sh-focus);
}

.input[aria-invalid="true"],
.textarea[aria-invalid="true"],
.select[aria-invalid="true"] { border-color: var(--c-error); }

.input:disabled, .select:disabled, .textarea:disabled {
  background: var(--c-surface-variant);
  color: var(--c-text-muted);
  cursor: not-allowed;
}

/* Password field with a show/hide toggle inside it. */
.input-wrap { position: relative; display: flex; align-items: center; min-width: 0; }
.input-wrap .input { padding-right: 52px; }

.input-wrap__toggle {
  position: absolute;
  right: 4px;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: none;
  color: var(--c-text-muted);
  cursor: pointer;
  border-radius: var(--r-sm);
  padding: 0;
}

.input-wrap__toggle:hover { color: var(--c-text); background: var(--c-surface-variant); }

/* Money field with a fixed $ prefix inside it, e.g. owner settings amounts. */
.input-prefix { position: relative; display: flex; align-items: center; min-width: 0; }
.input-prefix .input { padding-left: 30px; }
.input-prefix__symbol {
  position: absolute;
  left: 14px;
  color: var(--c-text-muted);
  font-size: max(var(--fs-md), 16px);
  pointer-events: none;
}

/* Checkbox and radio rows: the whole row is the target, not just the box. */
.choice {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 11px 12px;
  min-height: 44px;
  border: 1px solid var(--c-border);
  border-radius: var(--r-input);
  background: var(--c-surface-variant);
  cursor: pointer;
  font-size: var(--fs-sm);
  min-width: 0;
}

.choice:hover { background: var(--c-surface-variant); }
.choice__text { min-width: 0; overflow-wrap: break-word; }

/* Custom checkboxes everywhere (keevy-style): a rounded box with the brand
 * gradient fill and a springy drawn-in check. The native control keeps its
 * keyboard and form semantics - only the painting is replaced. */
input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  margin: 0;
  display: grid;
  place-content: center;
  border: 1.5px solid var(--c-border);
  border-radius: 7px;
  background: var(--c-surface-variant);
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, transform 120ms ease;
}
input[type="checkbox"]::before {
  content: "";
  width: 11px;
  height: 6px;
  border-left: 2.2px solid var(--c-on-primary);
  border-bottom: 2.2px solid var(--c-on-primary);
  margin-top: -2px;
  transform: rotate(-45deg) scale(0);
  transition: transform 200ms cubic-bezier(0.34, 1.56, 0.64, 1);
}
input[type="checkbox"]:checked {
  background-image: linear-gradient(110deg, var(--c-primary), var(--c-accent));
  border-color: transparent;
}
input[type="checkbox"]:checked::before { transform: rotate(-45deg) scale(1); }
input[type="checkbox"]:active { transform: scale(0.9); }
input[type="checkbox"]:focus-visible { outline: none; box-shadow: var(--sh-focus); }
/* The wizard's agreement row is a bigger, tap-first target. */
.choice input[type="checkbox"] { width: 22px; height: 22px; border-radius: 8px; }
.choice.is-selected { border-color: var(--c-primary); background: var(--c-primary-container); }
.choice--plain { border: 0; background: none; padding: 4px 0; }
.choice--plain:hover { background: none; }

/* --------------------------------------------------------------- badges */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  font-size: var(--fs-sm);
  font-weight: 600;
  background: var(--c-surface-variant);
  color: var(--c-text-muted);
  white-space: nowrap;
}

/* Badge text mixes toward white in dark mode and black in light, so the label
 * stays readable on its translucent tint either way. */
.badge--pending { background: color-mix(in srgb, var(--c-warning) 18%, transparent); color: color-mix(in srgb, var(--c-warning) 72%, white); }
.badge--approved { background: color-mix(in srgb, var(--c-success) 18%, transparent); color: color-mix(in srgb, var(--c-success) 72%, white); }
.badge--rejected { background: color-mix(in srgb, var(--c-error) 18%, transparent); color: color-mix(in srgb, var(--c-error) 72%, white); }
.badge--info { background: var(--c-primary-container); color: var(--c-primary-hover); }

html[data-theme="light"] .badge--pending { color: color-mix(in srgb, var(--c-warning) 80%, black); }
html[data-theme="light"] .badge--approved { color: color-mix(in srgb, var(--c-success) 80%, black); }
html[data-theme="light"] .badge--rejected { color: color-mix(in srgb, var(--c-error) 80%, black); }

/* --------------------------------------------------------------- notices */

.notice {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--r-md);
  border: 1px solid var(--c-border);
  background: var(--c-surface-variant);
  font-size: var(--fs-sm);
  min-width: 0;
}

.notice__body { min-width: 0; overflow-wrap: break-word; }
.notice__title { font-weight: 700; margin-bottom: 2px; }
.notice .icon { flex: 0 0 auto; }

.notice--info { background: var(--c-primary-container); border-color: color-mix(in srgb, var(--c-primary) 35%, transparent); }
.notice--success { background: color-mix(in srgb, var(--c-success) 12%, transparent); border-color: color-mix(in srgb, var(--c-success) 35%, transparent); }
.notice--warning { background: color-mix(in srgb, var(--c-warning) 14%, transparent); border-color: color-mix(in srgb, var(--c-warning) 40%, transparent); }
.notice--error { background: color-mix(in srgb, var(--c-error) 10%, transparent); border-color: color-mix(in srgb, var(--c-error) 35%, transparent); }

/* Signed-out confirmation: a calm Apple-style card, not a loud green flash. */
.notice--logout {
  align-items: center;
  gap: 14px;
  padding: 16px;
  border-radius: 30px;
  background: var(--c-surface);
  border-color: color-mix(in srgb, var(--c-primary) 28%, var(--c-border));
  box-shadow: 0 12px 30px rgba(4, 10, 24, 0.16);
}
.notice--logout .icon {
  width: 38px;
  height: 38px;
  border-radius: 16px;
  background: var(--c-primary-container);
  color: var(--c-primary-hover);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.notice--logout .notice__body {
  color: var(--c-text);
  font-weight: 650;
}

/* Security warning gets its own treatment: it must never look like chrome. */
.notice--security {
  background: color-mix(in srgb, var(--c-warning) 12%, transparent);
  border-color: color-mix(in srgb, var(--c-warning) 45%, transparent);
  border-left-width: 4px;
}

/* Flash messages */
.flashes { display: flex; flex-direction: column; gap: 10px; margin: 16px 0 0; }

/* ---------------------------------------------------------------- tables */

/* Wrapped in .table-scroll so a wide table scrolls *itself* rather than the
 * document. Scrolling the document sideways is the single most common small
 * screen defect. */
.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  background: var(--c-surface);
}

.table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.table th, .table td { padding: 12px 14px; text-align: left; vertical-align: top; }
.table th { font-weight: 700; color: var(--c-text-muted); white-space: nowrap; background: var(--c-surface-variant); }
.table tbody tr + tr td { border-top: 1px solid var(--c-border); }
.table td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* --------------------------------------------------------------- copyable */

.copyable {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--c-border);
  border-radius: var(--r-input);
  background: var(--c-surface-variant);
  min-width: 0;
}

.copyable__value {
  flex: 1 1 auto;
  min-width: 0;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: var(--fs-sm);
  /* USDT addresses and referral links are long and unbreakable. */
  overflow-wrap: anywhere;
}

/* ---------------------------------------------------------------- modals */

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(15, 23, 42, 0.5);
}

.modal[hidden] { display: none; }

.modal__panel {
  width: 100%;
  max-width: 480px;
  /* dvh, and a scrollable body, so a tall modal is never cut off on a short
   * Android viewport with the keyboard open. */
  max-height: calc(100dvh - 32px);
  display: flex;
  flex-direction: column;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: 24px;
  box-shadow: var(--sh-lg);
  overflow: hidden;
  animation: modal-in 220ms cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .modal__panel { background: var(--c-surface); }
}

.modal__head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 18px 18px 12px;
}

.modal__title { font-size: var(--fs-lg); margin: 0; }
.modal__body { padding: 0 18px; overflow-y: auto; flex: 1 1 auto; }
.modal__foot {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 16px 18px;
  border-top: 1px solid var(--c-border);
}
.modal__foot .btn { flex: 1 1 140px; }

.onboarding-modal__panel {
  max-width: 380px;
  border-radius: 30px;
}
.onboarding-modal__head {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  align-items: center;
  padding: 18px 18px 10px;
}
.onboarding-modal__icon {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 20px;
  background: var(--c-primary-container);
  color: var(--c-primary-hover);
}
.onboarding-modal__title {
  margin: 0;
  font-size: var(--fs-md);
}
.onboarding-modal__body { padding: 0 16px; }
.onboarding-steps {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.onboarding-steps li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 7px;
  align-items: start;
  align-content: start;
  padding: 10px;
  border: 1px solid var(--c-border);
  border-radius: 20px;
  background: var(--c-surface-variant);
  font-size: 0.75rem;
  line-height: 1.25;
}
.onboarding-step__icon {
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 11px;
  background: var(--c-primary-container);
  color: var(--c-primary-hover);
}
}
.onboarding-modal__foot { padding: 14px 16px 16px; }

body.is-locked { overflow: hidden; }

/* ---------------------------------------------------------------- toasts */

.toasts {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(84px + env(safe-area-inset-bottom));
  z-index: 120;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

@media (min-width: 900px) {
  .toasts { left: auto; right: 20px; bottom: 20px; max-width: 360px; }
}

.toast {
  padding: 12px 16px;
  border-radius: var(--r-md);
  /* Solid: a toast should read as one confident block, not a blurred
   * glimpse of what is behind it. */
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  color: var(--c-text);
  font-size: var(--fs-sm);
  box-shadow: var(--sh-lg);
  pointer-events: auto;
  overflow-wrap: break-word;
}

.toast--success { background: var(--c-success); }
.toast--error { background: var(--c-error); }

/* ------------------------------------------------------------ empty state */

.empty {
  text-align: center;
  padding: 26px 18px;
  color: var(--c-text-muted);
}

.empty__art { width: 96px; height: 96px; margin: 0 auto 14px; opacity: 0.9; }

.empty__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  margin-bottom: 12px;
  border-radius: var(--r-pill);
  background: var(--c-surface-variant);
  color: var(--c-text-muted);
}

.empty__title { color: var(--c-text); font-size: var(--fs-lg); margin-bottom: 6px; }

/* ---------------------------------------------------------------- footer */

.site-footer {
  border-top: 1px solid var(--c-border);
  background: var(--c-surface);
  padding: 24px 0;
  margin-top: 32px;
  font-size: var(--fs-sm);
  color: var(--c-text-muted);
}

.site-footer a { color: var(--c-text-muted); }
.site-footer__links { display: flex; flex-wrap: wrap; gap: 8px 18px; }

/* --------------------------------------------------------------- helpers */

.muted { color: var(--c-text-muted); }
.small { font-size: var(--fs-sm); }
.tiny { font-size: var(--fs-xs); }
.strong { font-weight: 700; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.break { overflow-wrap: anywhere; }
.money { font-variant-numeric: tabular-nums; }
.hide { display: none !important; }

@media (max-width: 899px) { .desktop-only { display: none !important; } }
@media (min-width: 900px) { .mobile-only { display: none !important; } }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  line-height: 1;
}

.icon svg { width: 1.25em; height: 1.25em; display: block; }

/* --------------------------------------------------------- loading bar */
/* The browser-style progress line at the very top. Driven by classes on
 * <html>, NOT an element: theme-boot.js sets html.is-navigating on the
 * INCOMING page before first paint (an element-based bar died with the page
 * you were leaving, so the user never saw the line complete - it now starts
 * on the page you arrive on). cowok.js adds .is-page-done at DOMContentLoaded
 * to run it to 100% and fade it, and link clicks set .is-navigating on the
 * current page too so there is motion during the unload gap. */
html.is-navigating::after {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 200;
  pointer-events: none;
  transform-origin: 0 50%;
  background: linear-gradient(90deg, var(--c-primary), var(--c-accent));
  box-shadow: 0 1px 10px color-mix(in srgb, var(--c-primary) 55%, transparent);
  animation: pageload-creep 4s cubic-bezier(0.1, 0.7, 0.3, 1) forwards;
}

html.is-navigating.is-page-done::after {
  animation: pageload-done 600ms ease forwards;
}

@keyframes pageload-creep {
  from { transform: scaleX(0.02); opacity: 1; }
  12% { transform: scaleX(0.3); }
  to { transform: scaleX(0.72); opacity: 1; }
}

@keyframes pageload-done {
  from { transform: scaleX(0.72); opacity: 1; }
  45% { transform: scaleX(1); opacity: 1; }
  to { transform: scaleX(1); opacity: 0; }
}

/* ---------------------------------------------------- view transitions */
/* Cross-document View Transitions: supported browsers animate the whole
 * page change (a smooth cross-fade) on every in-site navigation, like an
 * app changing screens. Header and bottom nav opt in as shared elements, so
 * they hold still while the content swaps - only Chrome/Edge currently;
 * other browsers fall through to the entry animation below. */
@view-transition { navigation: auto; }

.site-header { view-transition-name: site-header; }
.nav-mobile { view-transition-name: mobile-nav; }

/* A touch slower than the browser default (250ms) so screen changes read as
 * gentle rather than abrupt. Applies to both cross-document navigations and
 * the soft (in-place) section swaps driven by cowok.js. */
::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 420ms;
}

/* Entry animation for browsers without View Transitions. */
@supports not (view-transition-name: none) {
  .shell > main { animation: page-in 420ms cubic-bezier(0.2, 0, 0, 1); }
}

/* Soft (in-place) section swaps fade the incoming content in; cowok.js adds
 * .main-swap to the swapped-in <main>. Deliberately NOT a View Transition:
 * the bottom-nav highlight slides live while the content swaps, and a
 * transition snapshot would freeze it mid-slide. */
.main-swap { animation: page-in 420ms cubic-bezier(0.2, 0, 0, 1); }

@keyframes page-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

/* ------------------------------------------------------ theme toggle */
/* Segmented Dark/Light control in the profile, iOS-style: a sliding thumb
 * moves between the two halves; the buttons themselves stay flat. */
.theme-toggle {
  position: relative;
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  padding: 4px;
  border-radius: var(--r-pill);
  background: var(--c-surface-variant);
  border: 1px solid var(--c-border);
}

.theme-toggle__thumb {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 4px;
  width: calc(50% - 4px);
  border-radius: var(--r-pill);
  background: var(--c-primary);
  box-shadow: 0 2px 8px color-mix(in srgb, var(--c-primary) 45%, transparent);
  transition: transform 460ms cubic-bezier(0.32, 0.72, 0.2, 1.1);
}

/* The thumb follows the mode attribute, so the slide is pure CSS. */
html[data-theme="light"] .theme-toggle__thumb { transform: translateX(100%); }

.theme-toggle__btn {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 38px;
  padding: 7px 16px;
  border: 0;
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--c-text);
  font-family: inherit;
  font-size: var(--fs-sm);
  font-weight: 600;
  cursor: pointer;
  transition: color var(--e-transition);
}

.theme-toggle__btn:hover { color: var(--c-text); }
.theme-toggle__btn.is-active { color: var(--c-on-primary); }

/* ------------------------------------------------------------ wizard */
/* Sized for a 360px phone first. Every touch target clears 44px, and nothing
   here relies on a fixed width, so the whole flow reflows rather than scrolls
   sideways. */

.card--pad-sm { padding: 12px 14px; }
/* Same white-toward/black-toward split as the badges above. */
.badge--success { background: color-mix(in srgb, var(--c-success) 18%, transparent); color: color-mix(in srgb, var(--c-success) 72%, white); }
.badge--warning { background: color-mix(in srgb, var(--c-warning) 18%, transparent); color: color-mix(in srgb, var(--c-warning) 72%, white); }
html[data-theme="light"] .badge--success { color: color-mix(in srgb, var(--c-success) 80%, black); }
html[data-theme="light"] .badge--warning { color: color-mix(in srgb, var(--c-warning) 80%, black); }
.h3 { font-size: var(--fs-lg); font-weight: 650; }
.pre-wrap { white-space: pre-wrap; overflow-wrap: anywhere; font-family: inherit; margin: 8px 0 0; }

/* Screen-reader-only, but still focusable and still a real form control - the
   file input is hidden this way rather than with display:none so keyboard users
   can reach it through its label. */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.progress {
  position: relative;
  height: 8px;
  border-radius: var(--r-pill);
  background: var(--c-surface-variant);
  overflow: hidden;
}

.progress--slim { height: 5px; }

.progress__bar {
  display: block;
  height: 100%;
  min-width: 6px;
  border-radius: inherit;
  background: var(--c-primary);
  transition: width 240ms ease;
}

.steps-dots {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
}

.steps-dots__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--c-border);
}

.steps-dots__dot.is-done { background: color-mix(in srgb, var(--c-primary) 45%, transparent); }
.steps-dots__dot.is-current {
  background: var(--c-primary);
  width: 20px;
  border-radius: var(--r-pill);
}

.wizard-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

/* The primary action grows to fill the row, so on a phone it is a full-width
   button and on a wide screen it sits beside Back. */
.wizard-nav .btn--lg { flex: 1 1 180px; }
.wizard-nav form { flex: 1 1 180px; display: flex; }
.wizard-nav form .btn { width: 100%; }

.prose { color: var(--c-text); line-height: 1.65; }
.prose p { margin: 0 0 10px; }
.prose p:last-child { margin-bottom: 0; }
.prose ul, .prose ol { margin: 0 0 10px; padding-left: 22px; }
.prose li { margin-bottom: 4px; }

.media-img,
.shot-preview {
  display: block;
  width: 100%;
  height: auto;
  max-height: 60vh;
  object-fit: contain;
  border-radius: var(--r-md);
  border: 1px solid var(--c-border);
  background: var(--c-surface-variant);
}

/* -------------------------------------------------------------- upload */

.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 26px 16px;
  text-align: center;
  cursor: pointer;
  border: 2px dashed var(--c-border);
  border-radius: var(--r-md);
  background: var(--c-surface-variant);
  transition: border-color 160ms ease, background 160ms ease;
}

.dropzone:hover,
.dropzone:focus-within,
.dropzone.is-dragging { border-color: var(--c-primary); background: var(--c-primary-container); }

.dropzone__icon { color: var(--c-primary); }
.dropzone__icon svg { width: 30px; height: 30px; }
.dropzone__text { font-weight: 600; overflow-wrap: anywhere; }
.dropzone__hint { display: block; }

.upload-status { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }

/* -------------------------------------------------- live calculations */

.age-readout:empty,
.earnings-readout:empty { display: none; }

.age-readout__line,
.earnings-readout__line {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 12px 14px;
  border-radius: var(--r-md);
  font-weight: 600;
  overflow-wrap: anywhere;
}

.age-readout__line { background: var(--c-surface-variant); color: var(--c-text); }
.age-readout__line.is-ok { background: color-mix(in srgb, var(--c-success) 12%, transparent); }
.age-readout__line.is-bad { background: color-mix(in srgb, var(--c-warning) 14%, transparent); }
.age-readout__line.is-ok svg { color: var(--c-success); }
.age-readout__line.is-bad svg { color: var(--c-warning); }

.earnings-readout__line {
  background: var(--c-primary-container);
  color: var(--c-primary-hover);
  font-size: var(--fs-lg);
}

/* --------------------------------------------------------- branch cards */

.choice-cards {
  display: grid;
  gap: 12px;
  /* One column on a phone, two once there is room, without a media query. */
  grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr));
}

.choice-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  width: 100%;
  min-height: 44px;
  padding: 18px;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: var(--c-text);
  background: var(--c-surface);
  border: 2px solid var(--c-border);
  border-radius: var(--r-md);
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.choice-card:hover { border-color: var(--c-primary); background: var(--c-primary-container); }
.choice-card:active { transform: scale(0.99); }
.choice-card__icon { color: var(--c-primary); }
.choice-card__title { font-weight: 650; font-size: var(--fs-lg); overflow-wrap: anywhere; }
.choice-card__hint { display: block; }

.rate-list { list-style: none; margin: 12px 0 0; padding: 0; }
.rate-list__row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-top: 1px solid var(--c-border);
  font-size: var(--fs-sm);
}
.rate-list__row:first-child { border-top: 0; }

/* -------------------------------------------------------------- summary */
/* Label/value pairs rather than a table: on a narrow screen a table either
   scrolls sideways or clips, and neither is acceptable here. */

.summary { margin: 0; display: flex; flex-direction: column; }

.summary__row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 4px 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--c-border);
}

.summary__row:last-child { border-bottom: 0; }
.summary__row dt { color: var(--c-text-muted); font-size: var(--fs-sm); }
.summary__value { margin: 0; font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.summary__value--strong { color: var(--c-primary-hover); font-size: var(--fs-lg); }

/* ----------------------------------------------------------- completion */

.done-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 68px;
  height: 68px;
  margin: 0 auto;
  border-radius: 50%;
  color: var(--c-success);
  background: color-mix(in srgb, var(--c-success) 14%, transparent);
}

.btn--whatsapp { background: #25d366; color: #06331a; }
.btn--whatsapp:hover { background: #1eb95a; color: #06331a; }

/* --------------------------------------------------------- builder grid */

/* The Visual Builder's page-list / tree / inspector layout. Stacked as a
 * single column by default - the fixed 240px+300px side columns this used
 * to have (via an inline style overriding .grid) totalled over 540px and
 * forced horizontal scroll on any phone screen. Three columns only from
 * 900px up, matching the same breakpoint already used for nav-main/nav-mobile
 * elsewhere in this file, so the builder switches to desktop layout at the
 * same point the rest of the chrome does. */
.builder-grid {
  display: grid;
  gap: 20px;
  align-items: start;
  grid-template-columns: 1fr;
}

@media (min-width: 900px) {
  .builder-grid { grid-template-columns: 240px 1fr 300px; }
}


/* ==========================================================================
   keevy-style components (2026-09-02 restyle)
   =========================================================================*/

/* The landing hero: a dark cinematic panel like keevy's - a deep blue-black
 * gradient with a radial brand glow bleeding from the top centre, sitting
 * on the page like a lit stage. Deliberately fixed-colour (not theme vars)
 * so it looks identical in light and dark mode, the way keevy's dark hero
 * sits on a light marketing page. Rounded bottom corners lift it off the
 * section below. */
.hero--panel {
  position: relative;
  /* .section already pads; the panel goes edge-to-edge and adds its own
   * stage-like inner breathing room on top. */
  margin: 0 calc(-1 * var(--l-gutter, 20px));
  padding-top: calc(var(--l-section-spacing, 72px) * 0.75);
  padding-bottom: calc(var(--l-section-spacing, 72px) * 0.75);
  background:
    radial-gradient(120% 90% at 50% 0%,
      color-mix(in srgb, var(--c-primary) 22%, transparent), transparent 55%),
    linear-gradient(170deg, #16223E 0%, #101A30 42%, #0B1220 100%);
  border-radius: 0 0 var(--r-xl) var(--r-xl);
  color: #E7EEF9;
  overflow: hidden;
}
.hero--panel .muted, .hero--panel p { color: var(--c-text-muted); }
.hero--panel h1 {
  font-size: clamp(2.5rem, 10vw, 3.8rem);
  line-height: 1.04;
  margin-bottom: 0.35em;
}
/* The italic serif accent word inside the hero headline - keevy's signature. */
.hero--panel h1 em, .hero-em {
  font-style: italic;
  color: var(--c-accent);
}
.hero--panel .card {
  background: #1B2A4A;
  border-color: color-mix(in srgb, #FFFFFF 14%, transparent);
  color: #E7EEF9;
}
.hero--panel .muted, .hero--panel .tiny { color: #A9BAD6 !important; }

/* Rise-in reveals: sections arrive from translateY(22px) + blur(8px) the
 * way keevy's do, staggered by --reveal-delay. Opt-in via the `reveal`
 * class; the observer lives in cowok.js and honours reduced motion. */
@media (prefers-reduced-motion: no-preference) {
  .reveal {
    opacity: 0;
    transform: translateY(22px);
    filter: blur(8px);
  }
  .reveal.is-revealed {
    opacity: 1;
    transform: none;
    filter: none;
    transition:
      opacity 700ms cubic-bezier(0.16, 1, 0.3, 1) var(--reveal-delay, 0ms),
      transform 700ms cubic-bezier(0.16, 1, 0.3, 1) var(--reveal-delay, 0ms),
      filter 700ms cubic-bezier(0.16, 1, 0.3, 1) var(--reveal-delay, 0ms);
  }
}

/* Inline links inside help text and step bodies (the owner's
 * [label](https://url) syntax - see web.linkify). */
.text-link {
  color: var(--c-accent);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--c-accent) 45%, transparent);
  text-underline-offset: 3px;
  transition: text-decoration-color 160ms ease;
}
.text-link:hover { text-decoration-color: var(--c-accent); }
html[data-theme="light"] .text-link { color: var(--c-primary); }

/* Suspended rentals: warning tones, distinct from pending/approved/rejected. */
.badge--suspended {
  background: color-mix(in srgb, var(--c-warning) 18%, transparent);
  color: color-mix(in srgb, var(--c-warning) 72%, white);
}
html[data-theme="light"] .badge--suspended { color: color-mix(in srgb, var(--c-warning) 80%, black); }

/* The wizard Exit control: a real pill button with a border, not a bare
 * tiny text link - it is the only way out of a long flow, so it should look
 * tappable without shouting. */
.wizard__exit {
  min-height: 36px;
  padding: 6px 14px;
  color: var(--c-text-muted);
  border: 1.5px solid var(--c-border);
  border-radius: 999px;
  background: var(--c-surface-variant);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-sm);
  text-decoration: none;
  transition: background 160ms ease, color 160ms ease, transform 120ms ease;
}
.wizard__exit:hover { color: var(--c-text); background: var(--c-surface-variant); text-decoration: none; }
.wizard__exit:active { transform: scale(0.95); }

/* ==========================================================================
   Custom select dropdown (keevy-style)
   --------------------------------------------------------------------------
   The wizard's months dropdown (and every .select) gets a real styled
   dropdown: a pill-ish field matching the inputs, and a floating glass panel
   of options with a springy pop-in - instead of the unstyled native popup.
   The native <select> stays in the DOM (visually hidden but still submitted
   and still screen-reader addressable); the enhancer in cowok.js builds the
   button + panel around it and keeps them in sync.
   =========================================================================*/
.selectx { position: relative; width: 100%; }
.selectx__native {
  position: absolute;
  inset: 0;
  width: 100%;
  opacity: 0;
  pointer-events: none;
}
.selectx__btn {
  width: 100%;
  min-height: 44px;
  padding: 10px 40px 10px 14px;
  border: 1.5px solid var(--c-border);
  border-radius: var(--r-input);
  /* Solid fill like the light theme's inputs - a slightly raised surface
   * tone inside flat cards, with the crisp 1.5px border doing the work. */
  background: var(--c-surface-variant);
  color: var(--c-text);
  font-family: inherit;
  font-size: max(var(--fs-md), 16px);
  line-height: 1.4;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  transition: border-color var(--e-transition), box-shadow var(--e-transition);
}
.selectx__btn:focus-visible { outline: none; border-color: var(--c-primary); box-shadow: var(--sh-focus); }
.selectx__btn[aria-expanded="true"] { border-color: var(--c-primary); }
.selectx__chev { transition: transform 240ms cubic-bezier(0.32, 0.72, 0.2, 1); flex: none; }
.selectx__btn[aria-expanded="true"] .selectx__chev { transform: rotate(180deg); }
.selectx__panel {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 60;
  max-height: min(52vh, 320px);
  overflow-y: auto;
  padding: 6px;
  background: var(--c-surface);
  border: 1px solid color-mix(in srgb, var(--c-border) 90%, transparent);
  border-radius: var(--r-md);
  box-shadow: var(--sh-lg);
  transform-origin: 50% 0;
  animation: menu-pop 260ms cubic-bezier(0.32, 0.72, 0.2, 1.04);
}
.selectx__opt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 11px 12px;
  border-radius: calc(var(--r-md) - 6px);
  font-size: max(var(--fs-md), 16px);
  color: var(--c-text);
  cursor: pointer;
}
.selectx__opt:hover, .selectx__opt.is-active { background: color-mix(in srgb, var(--c-primary) 12%, transparent); }
.selectx__opt[aria-selected="true"] { color: var(--c-primary); font-weight: 600; }
.selectx__opt .icon { color: var(--c-primary); }

/* Toast progress: a thin shrinking bar along the bottom edge of each toast,
 * keevy-style, so the auto-dismiss is visible. */
.toast { position: relative; overflow: hidden; }
.toast::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 3px;
  transform-origin: 0 50%;
  background: color-mix(in srgb, currentColor 55%, transparent);
  animation: toast-shrink var(--toast-life, 3800ms) linear forwards;
}
@keyframes toast-shrink { from { transform: scaleX(1); } to { transform: scaleX(0); } }
@media (prefers-reduced-motion: reduce) {
  .toast::after { animation: none; opacity: 0.4; }
}


/* ==========================================================================
   Customer service FAB (2026-09-03)
   --------------------------------------------------------------------------
   A WhatsApp pill floating bottom-left on signed-in user pages, above the
   bottom nav. Flat and solid - the one bit of WhatsApp green on the site,
   so it reads instantly as "chat with a human".
   =========================================================================*/
/* Customer service: a plain circle beside the profile avatar. All the
 * circle/colour styling comes from the shared .avatar rules - only the
 * icon size lives here. */
.support-btn .icon { font-size: 1.3rem; }
.support-btn:hover { background: var(--c-primary); color: var(--c-on-primary); }

/* Profile customer-service card: compact on phones, calm and scannable. */
.support-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
}
.support-card__head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
}
.support-card__copy { min-width: 0; }
.support-card__title {
  color: var(--c-text);
  font-size: 0.9375rem;
  font-weight: 650;
  line-height: 1.25;
}
.support-card__body {
  margin: 3px 0 0;
  color: var(--c-text-muted);
  font-size: 0.8125rem;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.support-card__btn {
  min-height: 40px;
  padding: 8px 12px;
  font-size: 0.875rem;
}

/* Profile payout method buttons: compact, clear, and modal-driven. */
.payout-methods {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
}
.payout-methods__hint {
  margin: 0;
  color: var(--c-text-muted);
  font-size: 0.8125rem;
  line-height: 1.4;
}
.payout-methods__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
}
.payout-methods__btn {
  align-items: flex-start;
  justify-content: flex-start;
  gap: 10px;
  min-height: 56px;
  padding: 10px 12px;
  text-align: left;
}
.payout-methods__btn span {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.payout-methods__btn strong {
  color: var(--c-text);
  font-size: 0.875rem;
  line-height: 1.2;
}
.payout-methods__btn small {
  color: var(--c-text-muted);
  font-size: 0.6875rem;
  line-height: 1.2;
}

.payout-history {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
}
.payout-history__head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
}
.payout-history__hint {
  margin: 3px 0 0;
  color: var(--c-text-muted);
  font-size: 0.8125rem;
  line-height: 1.4;
}


/* ==========================================================================
   Owner panel navigation (2026-09-03 restyle)
   --------------------------------------------------------------------------
   A wrapping pill bar that scrolls away with the page. Keeping it static
   avoids the tall tab card pinning itself over the panel content on phones.
   =========================================================================*/
.owner-nav {
  position: static;
  z-index: auto;
  margin: 0 calc(-1 * var(--l-gutter, 20px));
  padding: 10px var(--l-gutter, 20px) 10px;
  background: color-mix(in srgb, var(--c-background) 92%, transparent);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid color-mix(in srgb, var(--c-border) 60%, transparent);
}
.owner-nav__track {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  overflow-x: visible;
  padding-bottom: 0;
}
.owner-nav__chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: 0 1 auto;
  min-height: 40px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--c-border);
  background: var(--c-surface);
  color: var(--c-text-muted);
  font-size: var(--fs-sm);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: color 140ms ease, background 140ms ease, border-color 140ms ease,
    transform 120ms ease;
}
.owner-nav__chip .icon { color: currentColor; }
.owner-nav__chip:hover { color: var(--c-text); text-decoration: none; }
.owner-nav__chip:active { transform: scale(0.96); }
.owner-nav__chip.is-active {
  background: var(--c-surface-variant);
  border-color: color-mix(in srgb, var(--c-primary) 55%, transparent);
  color: var(--c-primary);
}
.owner-nav__chip--alt { border-style: dashed; }

/* ==========================================================================
   Landing page (compact mobile redesign)
   =========================================================================*/
.landing {
  background: var(--c-background);
  color: var(--c-text);
  overflow-x: clip;
}
body.landing-page .site-header__inner {
  min-height: 48px;
  gap: 8px;
}
body.landing-page .brand {
  gap: 8px;
  font-size: 0.9375rem;
}
body.landing-page .brand__mark {
  width: 28px;
  height: 28px;
}
body.landing-page .site-header .btn {
  min-height: 36px;
  padding: 7px 11px;
  font-size: 0.75rem;
}
body.landing-page .site-footer {
  padding: 14px 0;
  margin-top: 18px;
  font-size: 0.75rem;
}
body.landing-page .site-footer__links {
  gap: 5px 14px;
}
.landing-hero {
  padding: 16px 0 10px;
  scroll-margin-top: 64px;
}
.landing-hero__panel {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 14px;
  border-radius: var(--r-card);
  background-color: var(--c-surface);
  background-image: url("landing/landing-bg.webp");
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  color: #F7FAFF;
  overflow: hidden;
}
.landing-hero__panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(7, 16, 39, 0.68);
}
.landing-hero__panel::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.10);
}
.landing-hero__panel > * { position: relative; z-index: 1; }
.landing-hero__panel .landing-hero__body { color: rgba(247, 250, 255, 0.82); }
.landing-hero__panel .landing-btn { border-color: rgba(255, 255, 255, 0.16); }
html[data-theme="light"] .landing-hero__panel {
  background-color: #F5F8FE;
  background-image: url("landing/landing-bg-light.webp");
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  color: #152238;
}
html[data-theme="light"] .landing-hero__panel::before {
  background: rgba(245, 248, 254, 0.70);
}
html[data-theme="light"] .landing-hero__panel .landing-hero__body {
  color: rgba(21, 34, 56, 0.76);
}
html[data-theme="light"] .landing-hero__panel::after {
  box-shadow: inset 0 0 0 1px rgba(21, 34, 56, 0.08);
}
.landing-hero__inner {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 680px;
}
.landing-hero__title {
  margin: 0;
  font-size: clamp(1.35rem, 5.8vw, 1.9rem);
  line-height: 1.12;
  letter-spacing: -0.01em;
  text-wrap: balance;
}
.landing-hero__title span {
  color: var(--c-primary);
  font-style: normal;
}
@media (max-width: 359px) {
  .landing-hero__title {
    font-size: 1.125rem;
    line-height: 1.1;
  }
  .landing-hero__body { font-size: 0.8125rem; }
}
.landing-hero__body {
  max-width: 36ch;
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.45;
  color: var(--c-text-muted);
}
.landing-hero__actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(142px, 1fr));
  gap: 8px;
}
.landing-btn {
  min-height: 40px;
  padding: 8px 12px;
  font-size: 0.875rem;
}
.landing-requirements {
  padding-top: 10px;
  border-top: 1px solid var(--c-border);
}
.landing-requirements__title {
  margin-bottom: 5px;
  color: var(--c-text-muted);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}
.landing-requirements__list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 12px;
  color: var(--c-text-muted);
  font-size: 0.75rem;
}
.landing-requirements__list span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}
.landing-requirements__list .icon svg {
  width: 15px;
  height: 15px;
}

.landing-compact-wrap {
  padding: 2px 0 10px;
}
.landing-notice {
  gap: 8px;
  padding: 10px 11px;
  font-size: 0.75rem;
}
.landing-notice .notice__title { font-size: 0.8125rem; }

.landing-section {
  padding: 18px 0;
  border-top: 1px solid color-mix(in srgb, var(--c-border) 80%, transparent);
  scroll-margin-top: 64px;
}
.landing-section__intro {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 10px;
}
.landing-section__title {
  margin: 0;
  font-size: 1.125rem;
  line-height: 1.2;
}
.landing-section__body {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--c-text-muted);
}
.landing-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}
.landing-card {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 11px;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}
.landing-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--c-primary) 48%, var(--c-border));
}
.landing-card__title {
  margin: 0;
  color: var(--c-text);
  font-size: 0.9375rem;
  font-weight: 650;
  line-height: 1.25;
}
.landing-card__body {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--c-text-muted);
}
.landing-card .metric__icon {
  width: 26px;
  height: 26px;
}
.landing-card .metric__icon .icon svg {
  width: 15px;
  height: 15px;
}
.landing-card--feature {
  max-width: 620px;
}
.landing-card--cta {
  align-items: center;
  text-align: center;
}
.landing-referral__reward {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.landing-referral__reward .badge {
  padding: 3px 8px;
  font-size: 0.75rem;
}
.landing .table { font-size: 0.8125rem; }
.landing .table th,
.landing .table td { padding: 8px 10px; }
.landing-footnote {
  margin: 7px 0 0;
  font-size: 0.6875rem;
  line-height: 1.4;
  color: var(--c-text-muted);
}

.landing-faq {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.landing-faq__item { padding: 10px 11px; }
.landing-faq__item summary {
  display: block;
  min-height: 32px;
  padding: 3px 0;
  color: var(--c-text);
  font-size: 0.8125rem;
  font-weight: 650;
  line-height: 1.35;
  cursor: pointer;
  list-style: none;
}
.landing-faq__item summary::-webkit-details-marker { display: none; }
.landing-faq__item summary > span {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
.landing-faq__question {
  min-width: 0;
  overflow-wrap: anywhere;
}
.landing-faq__item .icon {
  transition: transform 180ms ease;
}
.landing-faq__item .icon svg {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
}
.landing-faq__item[open] summary .icon {
  transform: rotate(180deg);
}
.landing-faq__answer {
  margin: 6px 0 0;
  font-size: 0.75rem;
  line-height: 1.45;
  color: var(--c-text-muted);
}

@media (min-width: 640px) {
  .landing-hero { padding-top: 28px; }
  .landing-hero__inner { gap: 13px; }
  .landing-hero__body { font-size: 0.9375rem; }
  .landing-section { padding: 30px 0; }
  .landing-section__title { font-size: 1.35rem; }
  .landing-section__body { font-size: 0.875rem; }
  .landing-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
  }
  .landing-card {
    padding: 13px;
    gap: 7px;
  }
  .landing-card__title { font-size: 1rem; }
  .landing-card__body { font-size: 0.875rem; }
}

@media (prefers-reduced-motion: no-preference) {
  .landing-hero__panel > * {
    animation: landing-enter 420ms cubic-bezier(0.16, 1, 0.3, 1) backwards;
  }
  .landing-hero__panel > *:nth-child(1) { animation-delay: 20ms; }
  .landing-hero__panel > *:nth-child(2) { animation-delay: 90ms; }
  .landing-hero__panel > *:nth-child(3) { animation-delay: 150ms; }
  .reveal.is-revealed .landing-card,
  .reveal.is-revealed .landing-faq__item {
    animation: landing-enter 420ms cubic-bezier(0.16, 1, 0.3, 1) backwards;
  }
  .reveal.is-revealed .landing-card:nth-child(1),
  .reveal.is-revealed .landing-faq__item:nth-child(1) { animation-delay: 40ms; }
  .reveal.is-revealed .landing-card:nth-child(2),
  .reveal.is-revealed .landing-faq__item:nth-child(2) { animation-delay: 100ms; }
  .reveal.is-revealed .landing-card:nth-child(3),
  .reveal.is-revealed .landing-faq__item:nth-child(3) { animation-delay: 160ms; }
  .reveal.is-revealed .landing-card:nth-child(4),
  .reveal.is-revealed .landing-faq__item:nth-child(4) { animation-delay: 220ms; }
  .reveal.is-revealed .landing-card:nth-child(5),
  .reveal.is-revealed .landing-faq__item:nth-child(5) { animation-delay: 280ms; }
  .reveal.is-revealed .landing-card:nth-child(6),
  .reveal.is-revealed .landing-faq__item:nth-child(6) { animation-delay: 340ms; }
}
@keyframes landing-enter {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.995);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .landing.reveal {
    transform: translateY(10px);
    filter: none;
  }
  .landing.reveal.is-revealed {
    transition:
      opacity 420ms cubic-bezier(0.16, 1, 0.3, 1) var(--reveal-delay, 0ms),
      transform 420ms cubic-bezier(0.16, 1, 0.3, 1) var(--reveal-delay, 0ms);
  }
}

/* ==========================================================================
   Global mobile tightening (all pages)
   =========================================================================*/
@media (max-width: 639px) {
  :root {
    --l-gutter: 14px;
  }

  body {
    font-size: 0.9375rem;
  }

  h1 { font-size: 1.5rem; }
  h2 { font-size: 1.25rem; }
  h3 { font-size: 1.0625rem; }
  h4, h5, h6 { font-size: 0.9375rem; }

  .wrap {
    padding-left: var(--l-gutter);
    padding-right: var(--l-gutter);
  }

  .section {
    padding-top: 18px;
    padding-bottom: 18px;
  }

  .stack { gap: 12px; }
  .stack--sm { gap: 6px; }
  .stack--lg { gap: 16px; }
  .row { gap: 10px; }
  .grid { gap: 10px; }

  .card {
    padding: 12px;
    border-radius: var(--r-card);
  }
  .metric--total {
    padding: 16px;
    border-radius: var(--r-card);
  }
  .promo-card {
    padding: 18px;
    border-radius: 30px;
  }
  .card--pad-lg { padding: 14px; }
  .card__title { font-size: 0.9375rem; }

  .btn {
    min-height: 40px;
    padding: 8px 14px;
    font-size: 0.875rem;
  }
  .btn--lg {
    min-height: 44px;
    padding: 10px 18px;
    font-size: 0.9375rem;
  }
  .btn--sm {
    min-height: 36px;
    padding: 7px 12px;
    font-size: 0.8125rem;
  }

  .notice {
    gap: 8px;
    padding: 10px 12px;
    font-size: 0.8125rem;
  }
  .notice__title { font-size: 0.875rem; }

  .field { gap: 5px; }
  .field__label,
  .field__hint,
  .field__error { font-size: 0.75rem; }
  .input,
  .select,
  .textarea {
    min-height: 42px;
    padding: 9px 12px;
    font-size: max(0.9375rem, 16px);
  }

  .table { font-size: 0.8125rem; }
  .table th,
  .table td { padding: 9px 11px; }

  .site-header__inner {
    min-height: 48px;
    gap: 8px;
  }
  .brand {
    gap: 8px;
    font-size: 0.9375rem;
  }
  .brand__mark {
    width: 28px;
    height: 28px;
  }
  .site-header .btn {
    min-height: 36px;
    padding: 7px 11px;
    font-size: 0.75rem;
  }

  .site-footer {
    padding: 14px 0;
    margin-top: 16px;
    font-size: 0.75rem;
  }
  .site-footer__links { gap: 5px 14px; }

  .empty {
    padding: 18px 14px;
  }
  .empty__icon {
    width: 48px;
    height: 48px;
    margin-bottom: 10px;
  }
  .empty__title { font-size: 0.9375rem; }

  .modal__panel { padding: 16px; }
  .modal__title { font-size: 1rem; }

  .menu__panel {
    min-width: 200px;
    max-width: min(260px, calc(100vw - 20px));
    padding: 6px;
    border-radius: 16px;
  }
  .menu__header {
    padding: 8px 10px;
    margin-bottom: 4px;
  }
  .menu__item {
    gap: 8px;
    padding: 9px 10px;
    min-height: 40px;
    font-size: 0.8125rem;
  }

  .nav-mobile {
    left: 10px;
    right: 10px;
    bottom: calc(8px + env(safe-area-inset-bottom));
    border-radius: 20px;
  }
  .nav-mobile__thumb {
    top: 5px;
    bottom: 5px;
    border-radius: 12px;
  }
  .nav-mobile a {
    gap: 1px;
    padding: 5px 2px;
    min-height: 50px;
    font-size: 10px;
  }
  .nav-mobile .icon { font-size: 20px; }
}