/* QRBs interface. Mobile first; tokens in tokens.css. Own identity: logo gradient accents, glass command bar,
   floating dock with the QR button in the centre, rounded cards. */

*, *::before, *::after { box-sizing: border-box; }
/* nothing may scroll the page sideways (carousels scroll inside themselves). clip, unlike hidden, keeps position: sticky working */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; overflow-x: hidden; overflow-x: clip; overscroll-behavior-x: none; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'cv11', 'ss01';
  overflow-x: hidden; overflow-x: clip; overscroll-behavior-x: none;
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
body::before {
  content: ''; position: fixed; inset: -20vh 0 auto; height: 70vh; z-index: -1; pointer-events: none;
  background: radial-gradient(560px 300px at 85% 0%, rgba(155, 77, 255, 0.10), transparent 70%), radial-gradient(620px 320px at 5% 10%, rgba(47, 91, 255, 0.09), transparent 70%);
}
img, svg, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
/* iOS zooms into a focused field with text under 16px (and the zoomed page then sways sideways) */
input, select, textarea { font-size: max(16px, 1em); }
button { cursor: pointer; background: none; border: 0; padding: 0; }
h1, h2, h3, h4, p { margin: 0; }
ul, ol { margin: 0; padding: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 6px; }
::selection { background: color-mix(in srgb, var(--brand) 25%, transparent); }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- typography ---------- */
.h1 { font-size: clamp(32px, 6vw, 60px); line-height: 1.04; font-weight: 850; letter-spacing: -0.04em; }
.h2 { font-size: clamp(24px, 4vw, 36px); line-height: 1.12; font-weight: 800; letter-spacing: -0.03em; }
.h3 { font-size: 20px; line-height: 1.25; font-weight: 750; letter-spacing: -0.02em; }
.h4 { font-size: 16px; font-weight: 700; letter-spacing: -0.01em; }
.lead { font-size: 17px; color: var(--muted); line-height: 1.6; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.bold { font-weight: 700; }
.center { text-align: center; }
.mono { font-variant-numeric: tabular-nums; }
.gradient-text { background: var(--gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--brand-text); }
.pre { white-space: pre-wrap; word-break: break-word; }
.clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.clamp-4 { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }

/* ---------- layout helpers ---------- */
.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 640px; margin: 0 auto; }
.stack { display: flex; flex-direction: column; gap: var(--gap, 12px); }
.row { display: flex; align-items: center; gap: var(--gap, 10px); min-width: 0; }
.row.wrap { flex-wrap: wrap; }
.spread { justify-content: space-between; }
.grow { flex: 1 1 auto; min-width: 0; }
@media (max-width: 480px) { .hide-sm { display: none !important; } }
.grid-2 { display: grid; gap: 16px; grid-template-columns: 1fr; }
.grid-3 { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 720px) { .grid-2 { grid-template-columns: 1fr 1fr; } .grid-3 { grid-template-columns: repeat(3, 1fr); } }
.divider { height: 1px; background: var(--line); border: 0; margin: 0; }
.mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; } .mt-32 { margin-top: 32px; }

/* ---------- buttons ---------- */
.btn {
  --b-bg: var(--surface-2); --b-fg: var(--text); --b-bd: transparent;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px; border-radius: 14px;
  background: var(--b-bg); color: var(--b-fg); border: 1px solid var(--b-bd);
  font-weight: 650; font-size: 14.5px; letter-spacing: -0.005em; white-space: nowrap;
  transition: transform 120ms var(--ease), opacity var(--dur);
  -webkit-tap-highlight-color: transparent; user-select: none;
}
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-lg svg { width: 20px; height: 20px; }
.btn:active { transform: scale(0.97); }
.btn[disabled], .btn.loading { opacity: 0.55; pointer-events: none; }
.btn.loading::after { content: ''; width: 15px; height: 15px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin 700ms linear infinite; }
.btn-primary { --b-bg: var(--text); --b-fg: var(--bg); }
:root[data-theme='dark'] .btn-primary { --b-bg: #eef0ff; --b-fg: #0d1030; }
.btn-brand { --b-bg: var(--brand); --b-fg: #fff; box-shadow: 0 8px 20px color-mix(in srgb, var(--brand) 30%, transparent); }
.btn-gradient { --b-bg: var(--brand); --b-fg: #fff; background: var(--gradient); box-shadow: var(--glow); }
.btn-gradient:hover { filter: brightness(1.06) saturate(1.05); }
.btn-ghost { --b-bg: transparent; --b-bd: var(--line-strong); }
.btn-ghost:hover { --b-bg: var(--surface-2); filter: none; }
.btn-plain { --b-bg: transparent; padding: 0 10px; }
.btn-plain:hover { --b-bg: var(--surface-2); filter: none; }
.btn-danger { --b-bg: var(--danger-soft); --b-fg: var(--danger); }
.btn-success { --b-bg: var(--success-soft); --b-fg: var(--success); }
.btn-soft { --b-bg: var(--brand-soft); --b-fg: var(--brand-text); }
.btn-sm { min-height: 34px; padding: 0 13px; font-size: 13.5px; border-radius: 10px; }
.btn-lg { min-height: 52px; padding: 0 26px; font-size: 16px; border-radius: 15px; }
.btn-block { width: 100%; }
.icon-btn {
  position: relative; display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px;
  color: var(--text); transition: transform 120ms var(--ease); -webkit-tap-highlight-color: transparent;
}
.icon-btn:active { transform: scale(0.94); }
.icon-btn svg { width: 24px; height: 24px; }
.link { color: var(--brand-text); font-weight: 600; }
.link:hover { text-decoration: underline; }

/* ---------- badges / chips / dots ---------- */
.badge-count {
  position: absolute; top: 3px; right: 2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: var(--pill);
  background: var(--like); color: #fff; font-size: 11px; font-weight: 750; line-height: 18px; text-align: center;
  border: 2px solid var(--bg); animation: pop 360ms var(--spring);
}
.chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 11px; border-radius: var(--pill); background: var(--surface-2); color: var(--text-2); font-size: 12.5px; font-weight: 650; }
.chip svg { width: 14px; height: 14px; flex: none; }
.chip-brand { background: var(--brand-soft); color: var(--brand-text); }
.chip-success { background: var(--success-soft); color: var(--success); }
.chip-danger { background: var(--danger-soft); color: var(--danger); }
.chip-warning { background: var(--warning-soft); color: var(--warning); }
.live-badge {
  display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 13px 0 11px; border-radius: var(--pill);
  background: var(--brand-soft); color: var(--brand-text); font-size: 12.5px; font-weight: 750; letter-spacing: 0.01em;
}
.live-dot { position: relative; width: 8px; height: 8px; border-radius: 50%; background: var(--success); flex: none; }
.live-dot::after { content: ''; position: absolute; inset: -4px; border-radius: 50%; background: var(--success); opacity: 0.35; animation: ping 1.6s var(--ease-out) infinite; }
.verified { width: 16px; height: 16px; color: var(--brand); flex: none; }

/* ---------- form controls ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.label { font-size: 13px; font-weight: 650; color: var(--text-2); }
.hint { font-size: 12.5px; color: var(--muted); }
.error-text { font-size: 12.5px; color: var(--danger); font-weight: 600; min-height: 0; }
.input, .select, .textarea {
  width: 100%; min-height: 48px; padding: 12px 14px; border-radius: 14px;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--text); outline: none;
  transition: border-color var(--dur), background-color var(--dur), box-shadow var(--dur);
}
.input::placeholder, .textarea::placeholder { color: var(--faint); }
.input:focus, .select:focus, .textarea:focus { background: var(--surface); border-color: var(--brand); box-shadow: var(--ring-brand); }
.field.has-error .input, .field.has-error .select, .field.has-error .textarea { border-color: var(--danger); background: var(--danger-soft); }
.textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
.select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 19px) 50%, calc(100% - 14px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 38px; }
.input-wrap { position: relative; }
.input-wrap .input { padding-right: 46px; }
.input-wrap .icon-btn { position: absolute; right: 3px; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; }
.input-prefix { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.input-wrap.prefixed .input { padding-left: 32px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--text-2); cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--brand); flex: none; }
.switch { position: relative; width: 46px; height: 28px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: var(--pill); background: var(--line-strong); }
.switch span::before { content: ''; position: absolute; inset: 0; border-radius: inherit; background: var(--brand); opacity: 0; transition: opacity var(--dur) var(--ease); }
.switch input:checked + span::before { opacity: 1; }
.switch span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: transform var(--dur) var(--spring); }
.switch input:checked + span::after { transform: translateX(18px); }
.switch input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.segmented { display: inline-flex; padding: 3px; gap: 2px; border-radius: 13px; background: var(--surface-2); }
.segmented > button, .segmented > a { display: inline-flex; align-items: center; justify-content: center; min-height: 34px; padding: 0 14px; border-radius: 10px; font-weight: 650; font-size: 13.5px; color: var(--muted); transition: background-color var(--dur), color var(--dur); }
.segmented > [aria-pressed='true'], .segmented > [aria-current='page'] { background: var(--surface); color: var(--brand-text); box-shadow: var(--shadow-xs); }
.pw-meter { height: 4px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.pw-meter i { display: block; height: 100%; width: 0; background: var(--danger); transition: width var(--dur), background-color var(--dur); }

/* ---------- cards / lists ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-xs); }
.card-pad { padding: 20px; }
@media (min-width: 720px) { .card-pad { padding: 24px; } }
.card-soft { background: var(--bg-soft); border-radius: var(--radius-lg); }
.list { display: flex; flex-direction: column; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--radius-sm); min-width: 0; transition: background-color var(--dur); }
a.list-item:hover, button.list-item:hover { background: var(--surface-2); }
button.list-item { width: 100%; text-align: left; }
.list-item .meta { flex: 1; min-width: 0; }
.list-item .title { font-weight: 650; font-size: 14.5px; }
.list-item .sub { font-size: 13px; color: var(--muted); }
.unread-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--brand); flex: none; }
.settings-group { border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); overflow: hidden; }
.settings-row { display: flex; align-items: center; gap: 14px; padding: 14px 16px; min-height: 56px; }
.settings-row + .settings-row { border-top: 1px solid var(--line); }
.settings-row .meta { flex: 1; min-width: 0; }

/* ---------- avatar / plate ---------- */
.avatar {
  --s: 40px; width: var(--s); height: var(--s); border-radius: 50%; flex: none; overflow: hidden; position: relative;
  background: var(--gradient); color: #fff; display: grid; place-items: center; font-weight: 750; font-size: calc(var(--s) * 0.4); letter-spacing: -0.02em;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.ring { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5.5px var(--qr-indigo); }
.avatar-anon { background: var(--surface-3); color: var(--muted); }
.avatar-anon svg { width: 55%; height: 55%; }
.plate {
  display: inline-flex; align-items: stretch; height: 30px; border-radius: 7px; overflow: hidden; flex: none;
  background: var(--plate-bg); color: var(--plate-ink); border: 1.5px solid #0b0d12; font-weight: 800; letter-spacing: 0.06em; font-size: 14px;
  font-variant-numeric: tabular-nums; box-shadow: var(--shadow-xs);
}
.plate .band { display: grid; place-items: center; width: 22px; background: var(--plate-band); color: #fff; font-size: 8px; letter-spacing: 0; font-weight: 800; }
.plate .num { display: grid; place-items: center; padding: 0 10px; white-space: nowrap; }
.plate.lg { height: 46px; font-size: 22px; border-width: 2px; border-radius: 10px; }
.plate.lg .band { width: 32px; font-size: 11px; }
.plate.lg .num { padding: 0 16px; }
.plate.sm { height: 24px; font-size: 12px; border-radius: 6px; }
.plate.sm .band { width: 18px; font-size: 7px; }
.plate.sm .num { padding: 0 7px; }

/* ---------- app shell: command bar (top) + floating dock (phones) ---------- */
.app { min-height: 100vh; min-height: 100dvh; }
.brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 850; font-size: 21px; letter-spacing: -0.045em; color: var(--text); }
.brand img { width: 30px; height: 30px; filter: drop-shadow(0 4px 10px rgba(79, 77, 255, 0.35)); }
.brand.lg { font-size: 26px; } .brand.lg img { width: 38px; height: 38px; }
.cmdbar {
  position: sticky; top: 0; z-index: 40; padding-top: var(--safe-top);
  background: var(--glass); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--line);
}
.cmdbar::after { content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; background: var(--gradient); opacity: 0.35; }
.cmdbar-in { max-width: var(--content-w); margin: 0 auto; height: var(--topbar-h); padding: 0 12px 0 16px; display: flex; align-items: center; gap: 12px; }
.cmd-nav { display: none; }
.cmd-actions { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.cmd-create { display: none; }
.me-btn { display: inline-flex; align-items: center; gap: 2px; padding: 3px 6px 3px 3px; border-radius: var(--pill); border: 1px solid var(--line); background: var(--surface); transition: border-color var(--dur), box-shadow var(--dur); }
.me-btn:hover { border-color: var(--line-strong); box-shadow: var(--shadow-xs); }
.me-btn .me-chev svg { width: 16px; height: 16px; color: var(--muted); }
.me-btn .avatar { --s: 32px; }
@media (max-width: 767px) { .me-btn .me-chev { display: none; } .me-btn { padding: 2px; } .me-btn .avatar { --s: 30px; } }
@media (min-width: 768px) {
  .only-phone { display: none !important; }
  .cmdbar-in { padding: 0 20px; gap: 18px; height: 68px; }
  .cmd-nav {
    display: flex; align-items: center; gap: 4px; margin: 0 auto; padding: 5px; border-radius: var(--pill);
    background: var(--surface-2); border: 1px solid var(--line);
  }
  .cmd-item { position: relative; display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border-radius: var(--pill); color: var(--muted); font-weight: 650; font-size: 14px; transition: color var(--dur), background-color var(--dur), box-shadow var(--dur); }
  .cmd-item:hover { color: var(--text); background: var(--surface); }
  .cmd-ic { position: relative; display: grid; place-items: center; }
  .cmd-ic svg { width: 21px; height: 21px; }
  .cmd-item .badge-count { top: -7px; right: -9px; }
  .cmd-item[aria-current='page'] { color: #fff; background: var(--gradient); box-shadow: var(--glow); }
  .cmd-item[aria-current='page'] .badge-count { border-color: transparent; background: #fff; color: var(--brand-text); }
  .cmd-label { display: none; }
  .cmd-actions { margin-left: 0; gap: 10px; }
  .cmd-create { display: inline-flex; }
  .cmd-create span { display: none; }
  :root { --topbar-h: 68px; }
}
@media (min-width: 1100px) { .cmd-label, .cmd-create span { display: inline; } }

.dock {
  position: fixed; left: 12px; right: 12px; bottom: calc(10px + var(--safe-bottom)); z-index: 40; height: 62px;
  display: grid; grid-template-columns: repeat(5, 1fr); align-items: center; padding: 0 6px; border-radius: 22px;
  background: var(--glass); backdrop-filter: saturate(180%) blur(22px); -webkit-backdrop-filter: saturate(180%) blur(22px);
  border: 1px solid var(--line); box-shadow: var(--shadow);
}
.dock a { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; height: 100%; color: var(--muted); font-size: 10.5px; font-weight: 650; -webkit-tap-highlight-color: transparent; }
.dock a > svg { width: 23px; height: 23px; transition: transform 160ms var(--spring); }
.dock a:active > svg { transform: scale(0.86); }
.dock a[aria-current='page'] { color: var(--brand-text); }
.dock-ind { position: absolute; top: 4px; left: 0; width: 22px; height: 3px; border-radius: 3px; background: var(--gradient); opacity: 0; pointer-events: none; }
.dock-ind.ready { transition: transform 280ms var(--ease-out), opacity 180ms var(--ease); }
.dock-ind.on { opacity: 1; }
.dock a .badge-count { top: 5px; right: calc(50% - 22px); }
.dock .avatar { --s: 24px; }
.dock a[aria-current='page'] .avatar { box-shadow: 0 0 0 2px var(--bg), 0 0 0 3.5px var(--brand); }
.dock-fab { display: grid; place-items: center; width: 54px; height: 54px; margin-top: -26px; border-radius: 18px; background: var(--gradient); color: #fff; box-shadow: var(--glow), 0 0 0 5px var(--bg); transition: transform 160ms var(--spring); }
.dock-fab svg { width: 26px; height: 26px; }
.dock-qr:active .dock-fab { transform: scale(0.92); }
.dock-qr[aria-current='page'] .dock-fab { transform: rotate(-6deg); }
.main { padding-bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 20px); min-width: 0; }
.page { width: 100%; max-width: 680px; margin: 0 auto; padding: 18px 16px 0; }
.page-wide { max-width: 980px; }
.page-full { max-width: var(--content-w); }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; min-height: 40px; }
.page-head h1 { position: relative; }
.back-btn { margin-left: -8px; }
@media (min-width: 768px) {
  .dock { display: none; }
  .main { padding-bottom: 56px; }
  .page { padding: 32px 24px 0; }
}

/* chat screen on phones: the conversation takes the whole screen */
@media (max-width: 767px) {
  .app.chat-mode .cmdbar, .app.chat-mode .dock { display: none; }
  .app.chat-mode .main { padding-bottom: 0; }
  /* the conversation is a fixed screen of the visible height: only the message list scrolls, the page never jumps,
     the field stays above the keyboard */
  .app.chat-mode .chat { position: fixed; z-index: 20; left: 0; right: 0; top: var(--vv-top, 0px); height: 100vh; height: var(--vv-h, 100dvh); min-height: 0; background: var(--bg); }
  .app.chat-mode .chat-body { min-height: 0; overscroll-behavior: contain; }
  .app.chat-mode .chat-head { position: relative; top: 0; padding-top: calc(10px + var(--safe-top)); }
  .app.chat-mode .chat-foot { position: relative; bottom: 0; padding-bottom: calc(10px + var(--safe-bottom)); }
}

/* ---------- public shell (landing, legal, auth) ---------- */
.site-header { position: sticky; top: 0; z-index: 40; padding-top: var(--safe-top); background: var(--glass); backdrop-filter: saturate(180%) blur(18px); -webkit-backdrop-filter: saturate(180%) blur(18px); border-bottom: 1px solid var(--line); }
.site-header::after { content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; background: var(--gradient); opacity: 0.35; }
.site-header .container { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 12px; }
.site-nav { display: none; gap: 26px; }
.site-nav a { color: var(--muted); font-weight: 600; font-size: 14.5px; transition: color var(--dur); }
.site-nav a:hover, .site-nav a[aria-current='page'] { color: var(--text); }
@media (min-width: 900px) { .site-nav { display: flex; } }
.header-actions { display: flex; align-items: center; gap: 6px; }
.header-actions .btn-ghost { display: none; }
@media (min-width: 560px) { .header-actions .btn-ghost { display: inline-flex; } }
@media (max-width: 559px) {
  .site-header .brand span { display: none; }
  .site-header .lang-switch button { min-width: 32px; padding: 0 6px; }
  .header-actions { gap: 4px; }
}
#main:empty, .site > main { min-height: calc(100vh - 64px); min-height: calc(100dvh - 64px); }
.site-footer { border-top: 1px solid var(--line); margin-top: 64px; padding: 40px 0 calc(28px + var(--safe-bottom)); color: var(--muted); font-size: 14px; }
.footer-grid { display: grid; gap: 28px; grid-template-columns: 1fr; }
@media (min-width: 720px) { .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; } }
.footer-links { display: flex; flex-direction: column; gap: 10px; }
.footer-links a:hover { color: var(--text); }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--line); font-size: 13px; }
.lang-switch { display: inline-flex; gap: 2px; padding: 3px; border-radius: 11px; background: var(--surface-2); }
.lang-switch button { height: 30px; min-width: 38px; padding: 0 8px; border-radius: 8px; font-size: 12.5px; font-weight: 750; color: var(--muted); transition: background-color var(--dur), color var(--dur); }
.lang-switch button[aria-pressed='true'] { background: var(--surface); color: var(--brand-text); box-shadow: var(--shadow-xs); }

/* landing */
.hero { position: relative; overflow: hidden; padding: 48px 0 56px; }
.hero::before { content: ''; position: absolute; inset: -40% -20% auto; height: 120%; background: radial-gradient(600px 300px at 80% 20%, rgba(91, 77, 255, 0.18), transparent 70%), radial-gradient(500px 280px at 10% 40%, rgba(47, 91, 255, 0.14), transparent 70%); pointer-events: none; }
.hero-grid { position: relative; display: grid; gap: 40px; align-items: center; }
@media (min-width: 960px) { .hero { padding: 88px 0 96px; } .hero-grid { grid-template-columns: 1.08fr 0.92fr; gap: 56px; } }
.hero .lead { max-width: 540px; margin-top: 18px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.trust-row { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 28px; color: var(--muted); font-size: 13.5px; font-weight: 600; }
.trust-row svg { width: 18px; height: 18px; color: var(--success); }
.phone-mock {
  position: relative; width: min(330px, 86vw); margin: 0 auto; aspect-ratio: 9 / 18.5; border-radius: 46px; padding: 12px;
  background: linear-gradient(160deg, #1d1d24, #0b0b0f); box-shadow: var(--shadow-lg), inset 0 0 0 1.5px rgba(255, 255, 255, 0.08);
}
.phone-screen { position: relative; height: 100%; border-radius: 36px; overflow: hidden; background: var(--bg); display: flex; flex-direction: column; }
.phone-notch { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); width: 92px; height: 26px; border-radius: 20px; background: #0b0b0f; z-index: 2; }
.mock-scan { padding: 50px 18px 18px; display: flex; flex-direction: column; gap: 12px; height: 100%; }
.mock-msg { padding: 11px 13px; border-radius: 14px; background: var(--surface-2); font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.mock-msg.sel { background: var(--brand); color: #fff; box-shadow: 0 8px 20px color-mix(in srgb, var(--brand) 35%, transparent); }
/* the two small cards sit under the phone, in the page's flow: they never cover its text or buttons */
.float-card { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: 16px; background: var(--elevated); border: 1px solid var(--line); box-shadow: var(--shadow); font-size: 13px; font-weight: 650; animation: float 6s var(--ease) infinite; }
.float-card.b { animation-delay: -3s; }
.section { padding: 64px 0; }
@media (min-width: 960px) { .section { padding: 96px 0; } }
.section-head { max-width: 640px; margin: 0 auto 40px; text-align: center; }
.section-head .lead { margin-top: 12px; }
.feature { padding: 26px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--line); transition: transform var(--dur) var(--ease), box-shadow var(--dur); }
.feature:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.feature-icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; background: var(--brand-soft); color: var(--brand-text); margin-bottom: 18px; }
.feature-icon svg { width: 24px; height: 24px; }
.feature p { color: var(--muted); margin-top: 8px; font-size: 14.5px; }
.cta-band { border-radius: var(--radius-xl); padding: 40px 28px; background: var(--gradient); color: #fff; text-align: center; position: relative; overflow: hidden; }
.cta-band .lead { color: rgba(255, 255, 255, 0.85); margin: 12px auto 24px; max-width: 520px; }
.cta-band .btn { --b-bg: #fff; --b-fg: #0b0d12; }
.faq details { border-bottom: 1px solid var(--line); padding: 18px 0; }
.faq summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 16px; font-weight: 700; font-size: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; font-size: 22px; line-height: 1; color: var(--muted); transition: transform var(--dur); }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { color: var(--muted); margin-top: 10px; }

/* auth */
.auth-wrap { min-height: calc(100vh - 64px); min-height: calc(100dvh - 64px); display: grid; place-items: center; padding: 32px 16px 48px; }
.auth-card { width: 100%; max-width: 420px; }
.auth-card .card { padding: 28px 22px; }
@media (min-width: 560px) { .auth-card .card { padding: 36px 34px; } }
.auth-title { text-align: center; margin: 14px 0 6px; }
.auth-alt { text-align: center; margin-top: 18px; font-size: 14.5px; color: var(--muted); }
.notice { display: flex; gap: 12px; padding: 14px 16px; border-radius: var(--radius); background: var(--brand-soft); color: var(--text-2); font-size: 14px; border: 1px solid color-mix(in srgb, var(--brand) 14%, transparent); }
.notice svg { width: 20px; height: 20px; color: var(--brand-text); flex: none; margin-top: 1px; }
.notice.success { background: var(--success-soft); } .notice.success svg { color: var(--success); }
.notice.danger { background: var(--danger-soft); } .notice.danger svg { color: var(--danger); }
.notice.warning { background: var(--warning-soft); } .notice.warning svg { color: var(--warning); }

/* ---------- feed / posts ---------- */
.post { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 14px 0 16px; margin-bottom: 14px; box-shadow: var(--shadow-xs); animation: rise 360ms var(--ease-out) both; }
@media (min-width: 768px) { .post { padding: 16px 0 18px; margin-bottom: 18px; } }
.post-head { display: flex; align-items: center; gap: 10px; padding: 0 14px 12px; }
.post-head .who { flex: 1; min-width: 0; line-height: 1.25; }
.post-head .who a:first-child { font-weight: 700; font-size: 14.5px; }
.post-head .when { color: var(--muted); font-size: 12.5px; }
.post-media { position: relative; background: var(--surface-2); overflow: hidden; user-select: none; }
.post-media { margin: 0 12px; border-radius: var(--radius); }
@media (min-width: 768px) { .post-media { margin: 0 14px; } }
.post-media img { width: 100%; max-height: 720px; object-fit: cover; aspect-ratio: auto; }
.heart-burst { position: absolute; left: 50%; top: 50%; width: 96px; height: 96px; margin: -48px 0 0 -48px; color: #fff; filter: drop-shadow(0 6px 18px rgba(0, 0, 0, 0.35)); opacity: 0; pointer-events: none; }
.heart-burst.go { animation: burst 820ms var(--spring) both; }
.post-actions { display: flex; align-items: center; gap: 2px; padding: 8px 8px 0; }
.post-actions .icon-btn svg { width: 26px; height: 26px; }
.post-actions .liked { color: var(--like); }
.post-actions .just-liked svg { animation: pop 280ms var(--spring); }
.post-body { padding: 4px 14px 0; font-size: 14.5px; }
.post-body .likes { font-weight: 700; margin-bottom: 4px; display: block; }
.post-body .text { white-space: pre-wrap; word-break: break-word; }
.post-body .text a { font-weight: 700; margin-right: 6px; }
.post-tag { display: inline-flex; align-items: center; gap: 8px; margin: 10px 14px 0; padding: 6px 10px 6px 6px; border-radius: 12px; background: var(--gradient-soft); font-size: 13px; font-weight: 650; color: var(--text-2); }
.post-foot { padding: 6px 14px 0; font-size: 13.5px; color: var(--muted); }
.post-foot button { color: var(--muted); }
.grid-posts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 14px; }
@media (min-width: 640px) { .grid-posts { grid-template-columns: repeat(3, 1fr); gap: 12px; } }
.tile { position: relative; aspect-ratio: 4 / 5; overflow: hidden; background: var(--surface-2); border-radius: var(--radius); border: 1px solid var(--line); }
.tile img { width: 100%; height: 100%; object-fit: cover; transition: transform 500ms var(--ease); }
.tile:hover img { transform: scale(1.04); }
.tile .tile-text { position: absolute; inset: 0; padding: 10px; display: flex; align-items: center; justify-content: center; text-align: center; font-size: 12.5px; font-weight: 650; color: var(--text-2); background: var(--bg-soft); }
.tile .tile-stats { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 16px; color: #fff; font-weight: 750; background: rgba(0, 0, 0, 0.35); opacity: 0; transition: opacity var(--dur); }
.tile:hover .tile-stats { opacity: 1; }
.tile-stats span { display: inline-flex; align-items: center; gap: 5px; }
.tile-stats svg { width: 18px; height: 18px; }

/* stories-like suggestions row */
.suggest-row { display: flex; gap: 12px; overflow-x: auto; padding: 4px 0 12px; scroll-snap-type: x mandatory; scrollbar-width: none; }
.suggest-row::-webkit-scrollbar { display: none; }
.suggest { flex: none; width: 148px; scroll-snap-align: start; padding: 16px 12px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.suggest .avatar { --s: 64px; }
.suggest .name { font-weight: 700; font-size: 13.5px; max-width: 100%; }

/* comments */
.comment { display: flex; gap: 10px; padding: 10px 0; align-items: flex-start; }
.comment .avatar { --s: 34px; }
.comment .bubble { flex: 1; min-width: 0; font-size: 14px; }
.comment .bubble b { font-weight: 700; margin-right: 6px; }
.comment-form { position: sticky; bottom: calc(var(--tabbar-h) + var(--safe-bottom)); display: flex; gap: 8px; align-items: flex-end; padding: 10px 0; background: var(--bg); border-top: 1px solid var(--line); }
@media (min-width: 768px) { .comment-form { bottom: 0; } }
.comment-form .textarea { min-height: 44px; max-height: 140px; padding: 11px 14px; resize: none; }

/* ---------- profile ---------- */
.profile-head { display: grid; grid-template-columns: auto 1fr; gap: 18px; align-items: center; padding: 6px 0 18px; }
.profile-head .avatar { --s: 86px; }
@media (min-width: 768px) { .profile-head { gap: 32px; padding: 12px 0 24px; } .profile-head .avatar { --s: 124px; } }
.profile-name { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.profile-name h1 { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; }
.stats { display: flex; gap: 22px; margin: 14px 0 12px; }
.stats a, .stats div { display: flex; flex-direction: column; font-size: 13px; color: var(--muted); line-height: 1.25; }
.stats b { font-size: 17px; color: var(--text); font-weight: 750; }
@media (min-width: 768px) { .stats a, .stats div { flex-direction: row; gap: 5px; font-size: 15px; align-items: baseline; } .stats b { font-size: 15px; } }
.profile-bio { font-size: 14.5px; white-space: pre-wrap; word-break: break-word; }
.profile-actions { display: flex; gap: 8px; margin: 14px 0 6px; flex-wrap: wrap; }
.profile-actions .btn { flex: 1 1 auto; min-width: 110px; }
@media (min-width: 768px) { .profile-actions .btn { flex: 0 0 auto; } }
.tabs { display: flex; gap: 4px; padding: 4px; margin-top: 12px; border-radius: var(--pill); background: var(--surface-2); border: 1px solid var(--line); }
.tabs button, .tabs a { flex: 1; display: flex; align-items: center; justify-content: center; gap: 7px; height: 40px; border-radius: var(--pill); color: var(--muted); font-size: 13.5px; font-weight: 700; transition: color var(--dur), background-color var(--dur); }
.tabs [aria-selected='true'] { color: var(--text); background: var(--surface); box-shadow: var(--shadow-xs); }
.tabs svg { width: 16px; height: 16px; }
.vehicle-strip { display: flex; gap: 12px; overflow-x: auto; padding: 4px 0 14px; scrollbar-width: none; }
.vehicle-strip::-webkit-scrollbar { display: none; }
.vehicle-pill { flex: none; display: flex; align-items: center; gap: 10px; padding: 8px 14px 8px 8px; border-radius: var(--pill); border: 1px solid var(--line); background: var(--surface); }
.vehicle-pill .thumb { width: 38px; height: 38px; border-radius: 50%; overflow: hidden; background: var(--surface-2); display: grid; place-items: center; color: var(--muted); flex: none; }
.vehicle-pill .thumb img { width: 100%; height: 100%; object-fit: cover; }
.vehicle-pill .thumb svg { width: 20px; height: 20px; }
.vehicle-pill .t { font-size: 13px; font-weight: 700; line-height: 1.2; }
.vehicle-pill .s { font-size: 12px; color: var(--muted); }
.lock-box { padding: 40px 20px; margin-top: 14px; text-align: center; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--line); }
.lock-box svg { width: 60px; height: 60px; margin: 0 auto 12px; padding: 14px; border-radius: 18px; background: var(--gradient-soft); color: var(--brand-text); }

/* ---------- garage ---------- */
.vehicle-card { overflow: hidden; display: flex; flex-direction: column; }
.vehicle-cover { position: relative; aspect-ratio: 16 / 9; background: linear-gradient(135deg, var(--surface-2), var(--surface-3)); display: grid; place-items: center; color: var(--faint); overflow: hidden; }
.vehicle-cover img { width: 100%; height: 100%; object-fit: cover; }
.vehicle-cover > svg { width: 64px; height: 64px; }
.vehicle-cover .plate { position: absolute; left: 14px; bottom: 14px; }
.vehicle-cover .cover-btn { position: absolute; right: 10px; top: 10px; background: color-mix(in srgb, var(--bg) 78%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.vehicle-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 14px; }
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.kpi { padding: 10px 12px; border-radius: var(--radius-sm); background: var(--bg-soft); }
.kpi b { display: block; font-size: 18px; font-weight: 800; letter-spacing: -0.02em; }
.kpi span { font-size: 12px; color: var(--muted); }
/* owner's vehicle card: small sticker picture (no readable code) + order status */
.sticker-mini { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--line); }
.sticker-thumb { position: relative; flex: none; width: 76px; aspect-ratio: 1; border-radius: var(--radius-sm); overflow: hidden; box-shadow: var(--shadow-sm); background: #fff; }
.sticker-thumb svg { display: block; width: 100%; height: 100%; }
.sticker-thumb.locked svg { filter: grayscale(1); opacity: .45; }
.sticker-thumb .lock { position: absolute; inset: 0; display: grid; place-items: center; color: #3b4150; }
.sticker-thumb .lock svg { width: 26px; height: 26px; filter: none; opacity: 1; }

/* ---------- inbox / chat ---------- */
.inbox-layout { display: grid; grid-template-columns: 1fr; min-height: calc(100vh - var(--topbar-h)); }
/* a grid column grows to its widest content unless its children may shrink: on a 360 px phone the chat header pushed the
   whole chat (and its composer) past the screen edge */
.inbox-layout > * { min-width: 0; }
@media (min-width: 900px) {
  .inbox-layout { grid-template-columns: 360px 1fr; max-width: var(--content-w); margin: 0 auto; height: calc(100vh - var(--topbar-h) - var(--safe-top)); height: calc(100dvh - var(--topbar-h) - var(--safe-top)); border-left: 1px solid var(--line); border-right: 1px solid var(--line); background: var(--surface); }
}
.inbox-list { border-right: 1px solid var(--line); overflow-y: auto; }
.inbox-list .head { padding: 18px 16px 10px; display: flex; align-items: center; justify-content: space-between; }
.conv { display: flex; align-items: center; gap: 12px; padding: 10px 16px; transition: background-color var(--dur); }
.conv { margin: 0 8px; border-radius: var(--radius); }
.conv:hover, .conv[aria-current='true'] { background: var(--surface-2); }
.conv[aria-current='true'] { box-shadow: inset 3px 0 0 var(--brand); }
.conv .avatar { --s: 54px; }
.conv .meta { flex: 1; min-width: 0; }
.conv .name { font-size: 14.5px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.conv .preview { font-size: 13.5px; color: var(--muted); }
.conv.unread .name, .conv.unread .preview { font-weight: 750; color: var(--text); }
.chat { display: flex; flex-direction: column; min-height: calc(100vh - var(--topbar-h) - var(--tabbar-h)); min-height: calc(100dvh - var(--topbar-h) - var(--tabbar-h) - var(--safe-bottom)); }
@media (min-width: 768px) { .chat { min-height: 0; height: calc(100vh - var(--topbar-h) - var(--safe-top)); height: calc(100dvh - var(--topbar-h) - var(--safe-top)); } }
.chat-head { position: sticky; top: calc(var(--topbar-h) + var(--safe-top)); z-index: 5; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
@media (min-width: 768px) { .chat-head { top: 0; padding: 14px 18px; } }
.chat-head .avatar { --s: 40px; }
.chat-body { flex: 1; padding: 16px 12px; display: flex; flex-direction: column; gap: 3px; overflow-y: auto; }
@media (min-width: 768px) { .chat-body { padding: 20px 22px; } }
.msg { max-width: min(78%, 520px); padding: 9px 14px; border-radius: 20px; font-size: 14.5px; line-height: 1.45; word-break: break-word; white-space: pre-wrap; }
/* a new message arrives: theirs rise softly, mine fly out of the send button */
.msg.msg-new { animation: msgin 260ms var(--ease-out) both; }
.msg.me.msg-new { transform-origin: 100% 100%; animation: msgsend 360ms var(--spring, cubic-bezier(0.34, 1.56, 0.64, 1)) both; }
@keyframes msgsend { from { opacity: 0; transform: translate(14px, 18px) scale(0.6); } 60% { opacity: 1; } to { opacity: 1; transform: none; } }
.composer button[type=submit].sent svg { animation: sendfly 420ms var(--ease-out); }
@keyframes sendfly { 0% { transform: none; } 45% { transform: translate(10px, -10px) scale(0.7); opacity: 0; } 46% { transform: translate(-8px, 8px) scale(0.7); opacity: 0; } 100% { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .msg.msg-new, .msg.me.msg-new, .composer button[type=submit].sent svg { animation: none; } }
.msg.them { align-self: flex-start; background: var(--surface-2); border-bottom-left-radius: 6px; }
.msg.me { align-self: flex-end; background: var(--gradient); color: #fff; border-bottom-right-radius: 6px; }
.msg.template { font-weight: 650; }
.msg.template::before { content: attr(data-icon); margin-right: 6px; }
.msg-time { font-size: 11.5px; color: var(--faint); margin: 2px 6px 8px; }
.msg-time.me { align-self: flex-end; }
.msg-time.them { align-self: flex-start; }
.day-sep { align-self: center; margin: 14px 0 8px; font-size: 12px; color: var(--muted); font-weight: 650; }
.chat-foot { position: sticky; bottom: calc(var(--tabbar-h) + var(--safe-bottom)); padding: 10px 12px; background: var(--bg); border-top: 1px solid var(--line); }
@media (min-width: 768px) { .chat-foot { bottom: 0; padding: 14px 18px; } }
.composer { display: flex; align-items: flex-end; gap: 8px; padding: 5px 5px 5px 16px; border-radius: 24px; border: 1px solid var(--line-strong); background: var(--surface); }
.composer textarea { flex: 1; min-height: 38px; max-height: 140px; padding: 8px 0; border: 0; outline: 0; resize: none; background: transparent; line-height: 1.4; }
.composer .btn { border-radius: 19px; min-height: 38px; }
.quick-replies { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 10px; scrollbar-width: none; }
.quick-replies::-webkit-scrollbar { display: none; }
.quick-replies button { flex: none; height: 34px; padding: 0 14px; border-radius: var(--pill); border: 1px solid var(--line-strong); font-size: 13px; font-weight: 650; background: var(--surface); transition: background-color var(--dur), transform 120ms; }
.quick-replies button:hover { background: var(--surface-2); }
.quick-replies button:active { transform: scale(0.95); }
.seen { align-self: flex-end; font-size: 11.5px; color: var(--muted); margin: 0 6px 6px; display: inline-flex; gap: 4px; align-items: center; }
.seen svg { width: 15px; height: 15px; color: var(--brand); }
.inbox-empty { display: none; }
@media (max-width: 899px) { .inbox-list[data-hide-mobile] { display: none; } .inbox-list { border-right: 0; } }
@media (min-width: 900px) { [data-back-mobile] { display: none; } .inbox-layout .chat { height: 100%; min-height: 0; } .inbox-layout [data-pane] { min-width: 0; overflow: hidden; } }
@media (min-width: 900px) { .inbox-empty { display: grid; place-items: center; text-align: center; padding: 40px; } }

/* ---------- scan page ---------- */
.scan-page { min-height: 100vh; min-height: 100dvh; background: var(--bg-soft); padding: calc(16px + var(--safe-top)) 16px calc(32px + var(--safe-bottom)); }
.scan-shell { max-width: 480px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }
.scan-top { display: flex; align-items: center; justify-content: space-between; }
.scan-hero { overflow: hidden; }
.scan-hero .vehicle-cover { aspect-ratio: 16 / 10; }
.scan-hero .info { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 12px; }
.privacy-pill { display: inline-flex; align-items: center; gap: 8px; padding: 9px 12px; border-radius: 12px; background: var(--success-soft); color: var(--success); font-size: 13px; font-weight: 650; }
.privacy-pill svg { width: 18px; height: 18px; flex: none; }
.templates { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tpl { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 14px; min-height: 92px; border-radius: var(--radius); background: var(--surface); border: 1.5px solid var(--line); text-align: left; font-size: 13.5px; font-weight: 650; line-height: 1.3; transition: border-color var(--dur), transform 140ms var(--spring), background-color var(--dur); }
.tpl .ic { font-size: 22px; line-height: 1; }
.tpl:hover { border-color: var(--line-strong); }
.tpl:active { transform: scale(0.97); }
.tpl[aria-pressed='true'] { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-text); }
.tpl.custom { grid-column: 1 / -1; min-height: 0; flex-direction: row; align-items: center; }
.success-anim { width: 72px; height: 72px; margin: 6px auto 4px; border-radius: 50%; background: var(--success-soft); color: var(--success); display: grid; place-items: center; animation: pop 520ms var(--spring); }
.success-anim svg { width: 38px; height: 38px; }
.success-anim path { stroke-dasharray: 30; stroke-dashoffset: 30; animation: draw 520ms 200ms var(--ease-out) forwards; }

/* ---------- notifications ---------- */
.notif { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: var(--radius-sm); transition: background-color var(--dur); }
.notif:hover { background: var(--surface-2); }
.notif.new { background: color-mix(in srgb, var(--brand) 6%, transparent); }
.notif .avatar { --s: 44px; }
.notif .txt { flex: 1; min-width: 0; font-size: 14px; line-height: 1.4; }
.notif .txt b { font-weight: 700; }
.notif .when { color: var(--muted); font-size: 12.5px; }
.notif > svg { width: 20px; height: 20px; color: var(--muted); flex: none; }
.notif .thumb { width: 44px; height: 44px; border-radius: 8px; overflow: hidden; flex: none; background: var(--surface-2); }
.notif .thumb img { width: 100%; height: 100%; object-fit: cover; }
.notif-ic { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.notif-ic svg { width: 22px; height: 22px; }
.notif-ic.scan { background: var(--brand-soft); color: var(--brand-text); }
.notif-ic.order { background: var(--success-soft); color: var(--success); }
.section-label { font-size: 15px; font-weight: 750; margin: 18px 0 6px; }

/* ---------- compose ---------- */
.dropzone { position: relative; display: grid; place-items: center; aspect-ratio: 4 / 3; border-radius: var(--radius-lg); border: 2px dashed var(--line-strong); background: var(--bg-soft); color: var(--muted); text-align: center; padding: 20px; cursor: pointer; overflow: hidden; transition: border-color var(--dur), background-color var(--dur); }
.dropzone:hover, .dropzone.drag { border-color: var(--brand); background: var(--brand-soft); }
.dropzone svg { width: 46px; height: 46px; margin: 0 auto 10px; }
.dropzone img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.dropzone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.char-count { font-size: 12px; color: var(--faint); text-align: right; }

/* ---------- empty / skeleton / spinner ---------- */
.empty { padding: 56px 20px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.empty-ic { width: 76px; height: 76px; border-radius: 24px; display: grid; place-items: center; background: var(--gradient-soft); color: var(--brand-text); margin-bottom: 6px; }
.empty-ic svg { width: 36px; height: 36px; }
.empty p { color: var(--muted); max-width: 360px; }
.skel { position: relative; overflow: hidden; background: var(--surface-2); border-radius: 10px; }
.skel::after { content: ''; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--surface) 60%, transparent), transparent); animation: shimmer 1.3s infinite; }
.skel-line { height: 12px; border-radius: 6px; }
.skel-circle { border-radius: 50%; }
.spinner { width: 26px; height: 26px; border-radius: 50%; border: 2.5px solid var(--line-strong); border-top-color: var(--brand); animation: spin 700ms linear infinite; margin: 24px auto; }
.load-more { display: flex; justify-content: center; padding: 18px 0; }

/* ---------- toast / modal / sheet ---------- */
.toasts { position: fixed; left: 50%; top: calc(12px + var(--safe-top)); transform: translateX(-50%); z-index: 1000; display: flex; flex-direction: column; gap: 8px; width: min(420px, calc(100vw - 24px)); pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; background: var(--elevated); color: var(--text); border: 1px solid var(--line); box-shadow: var(--shadow-lg); font-size: 14px; font-weight: 600; animation: toastin 260ms var(--spring) both; }
.toast.out { animation: toastout 220ms var(--ease) forwards; }
/* in-app message banner (the app is open) */
.msg-banner { position: fixed; left: 50%; top: calc(10px + var(--safe-top)); transform: translateX(-50%); z-index: 1001; width: min(440px, calc(100vw - 20px)); display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 18px; background: var(--elevated); color: var(--text); border: 1px solid var(--line); box-shadow: var(--shadow-lg); text-decoration: none; animation: bannerin 380ms var(--spring) both; touch-action: pan-x; }
.msg-banner.out { animation: bannerout 220ms var(--ease) forwards; }
.msg-banner .avatar { flex: none; }
.msg-banner .mb-body { min-width: 0; display: flex; flex-direction: column; }
.msg-banner .mb-name { font-size: 14px; }
.msg-banner .mb-text { font-size: 13.5px; color: var(--text-2, var(--muted)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@keyframes bannerin { from { opacity: 0; transform: translate(-50%, -18px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes bannerout { to { opacity: 0; transform: translate(-50%, -16px); } }
/* install / notifications offer: a small card above the dock, never blocks the page */
.offer-card { position: fixed; left: 12px; right: 12px; bottom: calc(84px + var(--safe-bottom)); z-index: 45; max-width: 420px; margin: 0 auto; display: flex; flex-direction: column; gap: 12px; padding: 14px 14px 14px 16px; border-radius: 20px; background: var(--elevated); color: var(--text); border: 1px solid var(--line); box-shadow: var(--shadow-lg); animation: toastin 260ms var(--spring) both; }
.offer-card.out { animation: toastout 220ms var(--ease) forwards; }
.offer-card b { padding-right: 30px; }
.offer-logo { flex: none; border-radius: 12px; }
.offer-x { position: absolute; top: 6px; right: 6px; }
.offer-steps { display: flex; gap: 6px; align-items: flex-start; color: var(--text); }
.offer-steps svg { width: 16px; height: 16px; flex: none; margin-top: 2px; }
.offer-actions { justify-content: flex-end; }
@media (min-width: 768px) { .offer-card { left: auto; right: 24px; bottom: 24px; margin: 0; width: 380px; } }
.toast .ic { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; flex: none; background: var(--surface-2); }
.toast .ic svg { width: 18px; height: 18px; }
.toast.success .ic { background: var(--success-soft); color: var(--success); }
.toast.error .ic { background: var(--danger-soft); color: var(--danger); }
.toast.live .ic { background: var(--gradient); color: #fff; }
.toast .t-body { flex: 1; min-width: 0; }
.toast .t-title { font-size: 11.5px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--brand-text); display: flex; align-items: center; gap: 6px; }
.modal-root { position: fixed; inset: 0; z-index: 900; display: flex; align-items: flex-end; justify-content: center; }
@media (min-width: 640px) { .modal-root { align-items: center; padding: 24px; } }
.modal-backdrop { position: absolute; inset: 0; background: var(--overlay); animation: fade 200ms var(--ease) both; }
.modal { position: relative; width: 100%; max-width: 480px; max-height: 92vh; max-height: 92dvh; overflow-y: auto; background: var(--elevated); border-radius: 24px 24px 0 0; padding: 10px 20px calc(22px + var(--safe-bottom)); box-shadow: var(--shadow-lg); animation: sheetin 280ms var(--ease-out) both; }
@media (min-width: 640px) { .modal { border-radius: 24px; padding: 24px; animation: dialogin 280ms var(--ease-out) both; } }
.modal.wide { max-width: 640px; }
.modal-root.closing .modal { animation: sheetout 220ms var(--ease) forwards; }
.modal-root.closing .modal-backdrop { animation: fadeout 220ms var(--ease) forwards; }
.grabber { width: 40px; height: 5px; border-radius: 3px; background: var(--line-strong); margin: 0 auto 14px; }
@media (min-width: 640px) { .grabber { display: none; } }
.modal-title { font-size: 18px; font-weight: 750; letter-spacing: -0.02em; margin-bottom: 6px; }
.modal-text { color: var(--muted); font-size: 14.5px; }
.modal-actions { display: flex; flex-direction: column-reverse; gap: 8px; margin-top: 20px; }
@media (min-width: 640px) { .modal-actions { flex-direction: row; justify-content: flex-end; } }
.sheet-list { display: flex; flex-direction: column; margin: 0 -8px; }
.sheet-list button, .sheet-list a { display: flex; align-items: center; gap: 14px; min-height: 52px; padding: 0 14px; border-radius: 14px; font-weight: 600; font-size: 15px; text-align: left; width: 100%; }
.sheet-list button:hover, .sheet-list a:hover { background: var(--surface-2); }
.sheet-list svg { width: 22px; height: 22px; }
.sheet-list .danger { color: var(--danger); }

/* ---------- legal / content ---------- */
.doc-hero { padding: 48px 0 28px; border-bottom: 1px solid var(--line); background: radial-gradient(700px 240px at 50% -20%, rgba(91, 77, 255, 0.12), transparent 70%); }
.doc-hero .lead { margin-top: 12px; max-width: 640px; }
.doc-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.doc { display: grid; gap: 40px; padding-top: 36px; }
@media (min-width: 960px) { .doc { grid-template-columns: 260px 1fr; gap: 64px; } }
.toc { display: none; }
@media (min-width: 960px) { .toc { display: block; position: sticky; top: 96px; align-self: start; max-height: calc(100vh - 120px); overflow-y: auto; } }
.toc-title { font-size: 12px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin-bottom: 12px; }
.toc a { display: flex; gap: 10px; padding: 7px 10px; border-radius: 10px; font-size: 14px; color: var(--muted); font-weight: 550; transition: background-color var(--dur), color var(--dur); }
.toc a span { color: var(--muted); font-variant-numeric: tabular-nums; min-width: 18px; }
.toc a:hover, .toc a.active { background: var(--surface-2); color: var(--text); }
.doc-body { max-width: 760px; }
.doc-section { padding-bottom: 32px; margin-bottom: 32px; border-bottom: 1px solid var(--line); scroll-margin-top: 90px; }
.doc-section:last-child { border-bottom: 0; }
.doc-section h2 { display: flex; gap: 14px; align-items: baseline; font-size: 22px; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 16px; }
.doc-section h2 .n { color: var(--brand-text); font-variant-numeric: tabular-nums; font-size: 15px; font-weight: 800; padding: 3px 9px; border-radius: 8px; background: var(--brand-soft); }
.clause { display: grid; grid-template-columns: 44px 1fr; gap: 6px; margin-top: 12px; color: var(--text-2); font-size: 15px; line-height: 1.7; }
.clause .n { font-weight: 750; color: var(--text); font-variant-numeric: tabular-nums; }
.doc-callout { margin-top: 16px; padding: 16px 18px; border-radius: var(--radius); background: var(--bg-soft); border-left: 3px solid var(--brand); font-size: 14.5px; color: var(--text-2); }
.about-hero { text-align: center; padding: 56px 0 40px; }
.about-logo { width: 96px; height: 96px; margin: 0 auto 22px; border-radius: 28px; box-shadow: 0 20px 50px rgba(91, 77, 255, 0.35); animation: float 6s var(--ease) infinite; }
.values { display: grid; gap: 16px; }
@media (min-width: 760px) { .values { grid-template-columns: repeat(3, 1fr); } }
.stat-band { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 760px) { .stat-band { grid-template-columns: repeat(4, 1fr); } }
.stat-band div { padding: 22px; border-radius: var(--radius-lg); background: var(--bg-soft); }
.stat-band b { display: block; font-size: 28px; font-weight: 850; letter-spacing: -0.03em; }
.stat-band span { color: var(--muted); font-size: 13.5px; }

/* 404 */
.nf { min-height: 70vh; display: grid; place-items: center; text-align: center; padding: 40px 20px; }
.nf .code { font-size: clamp(90px, 22vw, 180px); font-weight: 900; line-height: 0.9; letter-spacing: -0.06em; }

/* ---------- admin ---------- */
.admin { display: grid; grid-template-columns: 1fr; min-height: 100vh; min-height: 100dvh; background: var(--bg-soft); }
@media (min-width: 960px) { .admin { grid-template-columns: 240px 1fr; } }
.admin-side { display: flex; align-items: center; gap: 4px; overflow-x: auto; padding: calc(10px + var(--safe-top)) 12px 10px; background: var(--bg); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30; scrollbar-width: none; }
.admin-side::-webkit-scrollbar { display: none; }
.admin-side .brand { margin-right: 10px; flex: none; }
.admin-side .brand small { font-size: 11px; font-weight: 800; letter-spacing: 0.08em; padding: 3px 7px; border-radius: 6px; background: var(--text); color: var(--bg); }
.admin-side a.nav-a, .admin-side button.nav-a { flex: none; display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 12px; border-radius: 11px; font-weight: 600; font-size: 14px; color: var(--muted); }
.admin-side .nav-a svg { width: 20px; height: 20px; }
.admin-side .nav-a:hover { background: var(--surface-2); color: var(--text); }
.admin-side .nav-a[aria-current='page'] { background: var(--gradient); color: #fff; box-shadow: var(--glow); }
.admin-side .nav-a .badge-count { position: static; border: 0; }
@media (min-width: 960px) {
  .admin-side { flex-direction: column; align-items: stretch; height: 100vh; height: 100dvh; padding: 22px 14px; border-bottom: 0; border-right: 1px solid var(--line); overflow: visible; }
  .admin-side .brand { margin: 0 6px 22px; }
  .admin-side .spacer { flex: 1; }
}
.admin-main { padding: 20px 16px 48px; min-width: 0; }
@media (min-width: 960px) { .admin-main { padding: 32px 36px 56px; } }
.admin-title { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.kpi-grid { display: grid; gap: 12px; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 900px) { .kpi-grid { grid-template-columns: repeat(4, 1fr); } }
.kpi-card { padding: 18px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--line); }
.kpi-card .k { font-size: 12.5px; color: var(--muted); font-weight: 650; }
.kpi-card .v { font-size: 28px; font-weight: 850; letter-spacing: -0.03em; margin-top: 6px; }
.chart { width: 100%; height: 160px; }
.chart .bar { fill: var(--qr-indigo); opacity: 0.85; transition: opacity var(--dur); }
.chart .bar:hover { opacity: 1; }
.chart text { fill: var(--muted); font-size: 10px; }
.chart line { stroke: var(--line); }
.table-wrap { overflow-x: auto; border-radius: var(--radius-lg); border: 1px solid var(--line); background: var(--surface); }
.table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 720px; }
.table th { text-align: left; font-size: 12px; font-weight: 750; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); padding: 12px 14px; border-bottom: 1px solid var(--line); background: var(--bg-soft); white-space: nowrap; }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background-color var(--dur); }
.table tbody tr:hover { background: var(--bg-soft); }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 16px; }
.toolbar .input, .toolbar .select { width: auto; min-width: 160px; flex: 1 1 200px; min-height: 42px; background: var(--surface); border-color: var(--line); }
.pager { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.report-card { padding: 18px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 12px; }
.snapshot { padding: 12px 14px; border-radius: var(--radius-sm); background: var(--bg-soft); font-size: 14px; white-space: pre-wrap; word-break: break-word; }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 8px 14px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; word-break: break-word; }

/* dev mail */
.mail-frame { width: 100%; max-height: 640px; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; color: #0b0d12; }

/* ---------- live field checks (✓ / ✕) ---------- */
.field-status { display: none; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; }
.field-status:not(:empty) { display: inline-flex; }
.field-status svg { width: 16px; height: 16px; flex: none; }
.field-status.ok { color: var(--success); }
.field-status.bad { color: var(--danger); }
.field-status .checking { color: var(--muted); font-weight: 500; }
.field.is-valid .input { border-color: color-mix(in srgb, var(--success) 55%, transparent); }
.field.is-invalid .input { border-color: var(--danger); background: var(--danger-soft); }
.u-suggest { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.u-suggest .chip { cursor: pointer; height: 30px; transition: transform 120ms var(--spring); }
.u-suggest .chip:active { transform: scale(0.95); }
.pw-strength { display: flex; align-items: center; gap: 10px; }
.pw-strength .pw-meter { flex: 1; }
.pw-label { font-size: 12px; font-weight: 700; min-width: 0; }
.pw-label[data-level='1'] { color: var(--danger); }
.pw-label[data-level='2'] { color: var(--warning); }
.pw-label[data-level='3'] { color: var(--success); }

/* ---------- e-mail code ---------- */
.verify-mail { display: flex; gap: 12px; align-items: center; padding: 14px 16px; border-radius: var(--radius); background: var(--gradient-soft); font-size: 14px; color: var(--text-2); word-break: break-word; }
.verify-mail svg { width: 26px; height: 26px; color: var(--brand-text); flex: none; }
.code-boxes { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.code-box {
  width: 100%; min-width: 0; height: 58px; border-radius: 14px; border: 1.5px solid var(--line-strong); background: var(--surface-2);
  text-align: center; font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--text); outline: none;
  transition: border-color var(--dur), box-shadow var(--dur), background-color var(--dur);
}
.code-box:focus { border-color: var(--brand); background: var(--surface); box-shadow: var(--ring-brand); }
.shake .code-boxes { animation: shake 380ms var(--ease); }
.shake .code-box { border-color: var(--danger); }

/* ---------- vehicle form ---------- */
.kind-switch { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.kind-opt input { position: absolute; opacity: 0; pointer-events: none; }
.kind-opt span {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; height: 78px; border-radius: var(--radius);
  border: 1.5px solid var(--line); background: var(--surface); font-size: 13px; font-weight: 700; color: var(--muted); cursor: pointer;
  transition: border-color var(--dur), color var(--dur), background-color var(--dur), transform 140ms var(--spring);
}
.kind-opt span svg { width: 28px; height: 28px; }
.kind-opt:active span { transform: scale(0.97); }
.kind-opt input:checked + span { border-color: transparent; color: #fff; background: var(--gradient); box-shadow: var(--glow); }
.kind-opt input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.plate-input .input { padding-left: 52px; font-weight: 800; letter-spacing: 0.08em; font-variant-numeric: tabular-nums; text-transform: uppercase; }
.plate-flag { position: absolute; left: 8px; top: 50%; transform: translateY(-50%); width: 34px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--plate-band); color: #fff; font-size: 11px; font-weight: 800; pointer-events: none; }
.picker-box { position: relative; }
.picker .input { padding-right: 40px; }
.picker-caret { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; transition: transform var(--dur); }
.picker-caret svg { width: 18px; height: 18px; }
.picker.open .picker-caret { transform: translateY(-50%) rotate(180deg); }
.picker.disabled { opacity: 0.55; }
.picker.chosen .input { font-weight: 650; }
.picker-list {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 20; max-height: 280px; overflow-y: auto; padding: 6px;
  border-radius: var(--radius); background: var(--elevated); border: 1px solid var(--line); box-shadow: var(--shadow-lg);
}
.picker-group { padding: 8px 10px 4px; font-size: 11px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--brand-text); }
.picker-opt { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px; border-radius: 10px; font-size: 14.5px; cursor: pointer; }
.picker-opt:hover, .picker-opt[data-active] { background: var(--surface-2); }
.picker-opt[aria-selected='true'] { color: var(--brand-text); font-weight: 700; }
.picker-opt svg { width: 16px; height: 16px; }
.picker-empty { padding: 12px; font-size: 13.5px; color: var(--muted); }
.missing-link { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; margin-top: -6px; }
.missing-link svg { width: 16px; height: 16px; }
.color-field { border: 0; padding: 0; margin: 0; min-width: 0; }
.color-field legend { padding: 0; margin-bottom: 8px; }
.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch { position: relative; cursor: pointer; }
.swatch input { position: absolute; opacity: 0; pointer-events: none; }
.swatch .color-dot { transition: transform 140ms var(--spring), box-shadow var(--dur); }
.swatch:hover .color-dot { transform: scale(1.08); }
.swatch input:checked + .color-dot { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--brand); transform: scale(1.06); }
.swatch input:focus-visible + .color-dot { outline: 2px solid var(--brand); outline-offset: 4px; }
.color-dot { display: inline-block; width: var(--s, 12px); height: var(--s, 12px); flex: none; border-radius: 50%; background: var(--c); box-shadow: inset 0 0 0 1px rgba(13, 16, 48, 0.18); }
.color-dot.multi { background: conic-gradient(#e5383b, #f5c518, #1f9d55, #2f5bff, #7c4dff, #e5383b); }

/* ---------- scan page extras ---------- */
.owner-line { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--surface-2); font-size: 14px; }
.owner-line > svg { width: 20px; height: 20px; color: var(--brand-text); flex: none; }
.cta-ic { width: 52px; height: 52px; margin: 0 auto; border-radius: 16px; display: grid; place-items: center; background: var(--gradient); color: #fff; box-shadow: var(--glow); }
.cta-ic svg { width: 26px; height: 26px; }

/* ---------- message requests ---------- */
.tab-count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; margin-left: 6px; border-radius: var(--pill); background: var(--gradient); color: #fff; font-size: 11px; font-weight: 800; }
.request-bar { display: flex; flex-direction: column; gap: 12px; padding: 14px; border-radius: var(--radius); background: var(--gradient-soft); border: 1px solid var(--line); }
.request-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.request-actions .btn { padding: 0 10px; }
@media (max-width: 420px) { .request-actions { grid-template-columns: 1fr; } }
.request-bar .link { display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; }
.request-bar .link svg { width: 16px; height: 16px; }
.notif-ic.ok { background: var(--success-soft); color: var(--success); }
.notif-ic:not(.scan):not(.order):not(.ok) { background: var(--surface-2); color: var(--muted); }

@keyframes shake { 0%, 100% { transform: none; } 20% { transform: translateX(-6px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(4px); } }

/* ---------- first paint (before the app draws) ---------- */
.boot { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; }
.boot img { border-radius: 16px; animation: bootpulse 1.4s var(--ease) infinite; }
@keyframes bootpulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(0.94); opacity: 0.75; } }

/* ---------- landing ---------- */
.hero-badge { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px 7px 10px; border-radius: var(--pill); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-xs); font-size: 13.5px; font-weight: 700; color: var(--text-2); }
.hero-badge svg { width: 18px; height: 18px; color: var(--brand-text); }
.hero-title { margin-top: 20px; }
.hero-visual { display: flex; flex-wrap: wrap; justify-content: center; gap: 28px 12px; }
.hero-visual .phone-mock { flex: none; }
.hero-visual::before { content: ''; order: 1; flex: 0 0 100%; height: 0; margin-top: -28px; }
.hero-visual .float-card { order: 2; max-width: 100%; }
.trust-row { list-style: none; padding: 0; }
.trust-row li { display: inline-flex; align-items: center; gap: 7px; }
.mock-msg svg { width: 17px; height: 17px; flex: none; opacity: 0.9; }
.band-soft { background: var(--bg-soft); }
.how { list-style: none; padding: 0; display: grid; gap: 16px; }
@media (min-width: 900px) { .how { grid-template-columns: repeat(3, 1fr); gap: 20px; } }
.how-step { position: relative; padding: 28px 24px 26px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-xs); }
.how-step p { color: var(--muted); font-size: 14.5px; margin-top: 8px; }
.how-num { position: absolute; top: 20px; right: 22px; font-size: 44px; font-weight: 850; line-height: 1; letter-spacing: -0.04em; color: var(--surface-3); }
.how-ic { display: grid; place-items: center; width: 50px; height: 50px; border-radius: 15px; background: var(--gradient); color: #fff; margin-bottom: 18px; box-shadow: var(--glow); }
.how-ic svg { width: 24px; height: 24px; }
.split { display: grid; gap: 40px; align-items: center; }
@media (min-width: 960px) { .split { grid-template-columns: 1fr 1fr; gap: 64px; } .split.reverse > :first-child { order: 2; } }
.split .lead { margin-top: 14px; max-width: 540px; }
.points { list-style: none; padding: 0; display: grid; gap: 14px; }
@media (min-width: 560px) { .points { grid-template-columns: 1fr 1fr; } }
.point { display: flex; gap: 12px; align-items: flex-start; }
.point > span:last-child { display: flex; flex-direction: column; gap: 2px; font-size: 14px; color: var(--muted); }
.point b { color: var(--text); font-size: 15px; }
.point-ic { display: grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: 12px; background: var(--brand-soft); color: var(--brand-text); }
.point-ic svg { width: 20px; height: 20px; }
.community-visual { max-width: 380px; margin: 0 auto; width: 100%; display: flex; flex-direction: column; gap: 28px; }
.mock-post { padding: 14px; display: flex; flex-direction: column; gap: 12px; box-shadow: var(--shadow); transform: rotate(-1.5deg); }
.mock-post-img { aspect-ratio: 4 / 3; border-radius: var(--radius); background: var(--gradient); display: grid; place-items: center; color: rgba(255, 255, 255, 0.85); }
.mock-post-img svg { width: 72px; height: 72px; }
.mock-post .row svg { width: 22px; height: 22px; }
/* under the post, in the page's flow: it never covers the post's text */
.mock-chip { align-self: flex-end; max-width: 100%; display: flex; align-items: center; gap: 12px; padding: 12px 16px; box-shadow: var(--shadow); animation: float 6s var(--ease) infinite; }
.mock-chip > svg { width: 22px; height: 22px; color: var(--brand-text); }
.mock-chip span { display: flex; flex-direction: column; font-size: 14px; }
.privacy-visual { position: relative; max-width: 400px; width: 100%; margin: 0 auto; padding-top: 34px; }
.shield-ring { position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; background: var(--success); color: #fff; box-shadow: 0 12px 30px color-mix(in srgb, var(--success) 40%, transparent); z-index: 1; }
.shield-ring svg { width: 34px; height: 34px; }
.privacy-card { padding: 50px 20px 18px; display: flex; flex-direction: column; gap: 10px; box-shadow: var(--shadow); }
.pv-row { display: flex; align-items: center; gap: 10px; padding: 11px 13px; border-radius: var(--radius-sm); font-size: 14px; font-weight: 650; }
.pv-row svg { width: 18px; height: 18px; flex: none; }
.pv-row.ok { background: var(--success-soft); color: var(--success); }
.pv-row.no { background: var(--surface-2); color: var(--muted); text-decoration: line-through; text-decoration-thickness: 1.5px; }
.pv-row.no svg { color: var(--danger); }
.price-panel { display: grid; gap: 28px; align-items: center; padding: 32px 24px; border-radius: var(--radius-xl); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); position: relative; overflow: hidden; }
.price-panel::before { content: ''; position: absolute; inset: 0 0 auto; height: 5px; background: var(--gradient); }
.price-panel > .btn { justify-self: start; }
@media (min-width: 960px) { .price-panel { grid-template-columns: 1fr 1.25fr; padding: 44px; } .price-panel > .btn { grid-column: 1 / -1; justify-self: center; } }
.price-cards { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 560px) { .price-cards { grid-template-columns: repeat(3, 1fr); } }
.price-item { display: flex; flex-direction: column; gap: 4px; padding: 18px; border-radius: var(--radius); background: var(--bg-soft); min-width: 0; }
.price-item .k { font-size: 13px; font-weight: 700; color: var(--muted); }
.price-item b { font-size: 28px; font-weight: 850; letter-spacing: -0.03em; line-height: 1.15; }

/* ---------- sticker activation ---------- */
.page-narrow { max-width: 520px; }
.activate { padding-top: 22px; padding-bottom: 32px; }
.stepper { list-style: none; padding: 0; margin: 0 0 16px; display: flex; gap: 8px; }
.stepper li { flex: 1; display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; color: var(--muted); min-width: 0; }
.stepper li > span { display: grid; place-items: center; width: 26px; height: 26px; flex: none; border-radius: 50%; background: var(--surface-2); font-size: 12.5px; }
.stepper li > span svg { width: 15px; height: 15px; }
.stepper li.now { color: var(--text); }
.stepper li.now > span { background: var(--gradient); color: #fff; }
.stepper li.done > span { background: var(--success); color: #fff; }
.stepper li + li::before { content: ''; flex: 0 1 24px; height: 2px; border-radius: 2px; background: var(--line); margin-right: 2px; }
.act-card { text-align: center; display: flex; flex-direction: column; align-items: stretch; }
.act-card > .muted { margin-top: 8px; }
.act-ic { width: 64px; height: 64px; margin: 4px auto 18px; border-radius: 20px; display: grid; place-items: center; background: var(--gradient); color: #fff; box-shadow: var(--glow); }
.act-ic svg { width: 30px; height: 30px; }
.act-ic.warn { background: var(--warning-soft); color: var(--warning); box-shadow: none; }
.act-ic.ok { background: var(--success-soft); color: var(--success); box-shadow: none; }
.code-chip { align-self: center; margin-top: 14px; padding: 7px 12px; border-radius: 10px; background: var(--surface-2); font: 700 14px/1.2 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: 0.08em; }
.code-input { text-transform: uppercase; letter-spacing: 0.12em; font-weight: 700; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.act-list { text-align: left; margin: 18px 0 0; padding-left: 22px; display: flex; flex-direction: column; gap: 8px; font-size: 14.5px; color: var(--text-2); }
.act-card form { text-align: left; }
.pick-vehicle { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--radius); border: 1.5px solid var(--line); background: var(--surface); cursor: pointer; transition: border-color var(--dur), background-color var(--dur); }
.pick-vehicle:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.pick-vehicle input { accent-color: var(--brand); width: 18px; height: 18px; flex: none; }
.pv-ic { display: grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: 12px; background: var(--surface-2); color: var(--brand-text); }
.pv-ic svg { width: 22px; height: 22px; }
.pv-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.pv-text b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.act-done .row { justify-content: center; margin-top: 14px; flex-wrap: wrap; }

/* ---------- first steps (onboarding) ---------- */
.onboarding { padding: 18px 18px 8px; margin-bottom: 18px; background: linear-gradient(var(--surface), var(--surface)) padding-box, var(--gradient) border-box; border: 1.5px solid transparent; }
.ob-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.ob-bar { height: 6px; border-radius: 6px; background: var(--surface-2); margin: 12px 0 6px; overflow: hidden; }
.ob-bar i { display: block; height: 100%; border-radius: 6px; background: var(--gradient); transition: width 400ms var(--ease-out); }
.ob-steps { list-style: none; padding: 0; margin: 0; }
.ob-step { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.ob-step:first-child { border-top: 0; }
.ob-mark { display: grid; place-items: center; width: 36px; height: 36px; flex: none; border-radius: 50%; background: var(--brand-soft); color: var(--brand-text); }
.ob-mark svg { width: 18px; height: 18px; }
.ob-step.done .ob-mark { background: var(--success); color: #fff; }
.ob-step.done .ob-text { opacity: 0.7; }
.ob-text { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: 13.5px; color: var(--muted); }
.ob-text b { color: var(--text); font-size: 14.5px; }
.ob-step .btn { flex: none; }

/* ---------- garage / orders ---------- */
.order-cta { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 18px; }
.order-cta-ic { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; background: var(--gradient); color: #fff; flex: none; }
.order-cta-ic svg { width: 24px; height: 24px; }
.order-cta .grow { min-width: 200px; }
@media (max-width: 559px) { .order-cta .btn { width: 100%; } }
.price-strip { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.price-strip > div { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--surface-2); }
.price-strip b { font-size: 17px; }
.price-strip span { font-size: 12.5px; color: var(--muted); }
.progress { display: flex; gap: 8px; }
.progress-step { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.progress-step > span { height: 4px; border-radius: 4px; background: var(--surface-3); }
.progress-step.on > span { background: var(--gradient); }
.progress-step b { color: var(--muted); font-weight: 650; }
.progress-step.on b { color: var(--text); }
.device-ic { display: grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: 12px; background: var(--surface-2); color: var(--text-2); }
.device-ic svg { width: 21px; height: 21px; }
.btn-danger-soft { --b-bg: var(--danger-soft); --b-fg: var(--danger); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: 0.02em; }

/* ---------- motion ---------- */
.fade-in { animation: rise 420ms var(--ease-out) both; }
.view-enter { animation: viewin 280ms var(--ease-out) both; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { to { transform: translateX(100%); } }
@keyframes pop { 0% { transform: scale(0.6); } 60% { transform: scale(1.15); } 100% { transform: scale(1); } }
@keyframes ping { 0% { transform: scale(0.6); opacity: 0.45; } 100% { transform: scale(2.2); opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes viewin { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes msgin { from { opacity: 0; transform: translateY(6px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes burst { 0% { opacity: 0; transform: scale(0.3); } 15% { opacity: 0.95; transform: scale(1.15); } 30% { transform: scale(0.95); } 45% { transform: scale(1); opacity: 0.95; } 80% { opacity: 0.95; } 100% { opacity: 0; transform: scale(1.1) translateY(-20px); } }
@keyframes toastin { from { opacity: 0; transform: translateY(-14px) scale(0.96); } to { opacity: 1; transform: none; } }
@keyframes toastout { to { opacity: 0; transform: translateY(-10px) scale(0.97); } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeout { to { opacity: 0; } }
@keyframes sheetin { from { transform: translateY(100%); } to { transform: none; } }
@keyframes sheetout { to { transform: translateY(100%); } }
@keyframes dialogin { from { opacity: 0; transform: translateY(12px) scale(0.97); } to { opacity: 1; transform: none; } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@media (min-width: 640px) { .modal-root.closing .modal { animation: fadeout 180ms var(--ease) forwards; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-delay: 0ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; transition-delay: 0ms !important; scroll-behavior: auto !important; }
}

/* ---------- v2.4: order form with map, tracker, print jobs ---------- */
.map-box { position: relative; height: 300px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: var(--surface-2); z-index: 0; }
@media (max-width: 559px) { .map-box { height: 260px; } }
.map-box .leaflet-container { font: inherit; background: var(--surface-2); }
.map-error { display: flex; gap: 10px; align-items: center; justify-content: center; height: 100%; padding: 16px; color: var(--muted); font-size: 14px; text-align: center; }
.map-pin span { position: absolute; left: 3px; top: 0; width: 28px; height: 28px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: var(--gradient); box-shadow: 0 6px 16px rgba(47, 91, 255, .35); border: 2px solid #fff; }
.map-pin span::after { content: ''; position: absolute; inset: 8px; border-radius: 50%; background: #fff; }
.map-pin.base span { background: #0d1030; box-shadow: 0 4px 10px rgba(0, 0, 0, .3); }
.slot-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.slot-chip { position: relative; cursor: pointer; }
.slot-chip input { position: absolute; opacity: 0; pointer-events: none; }
.slot-chip span { display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); font-weight: 650; font-size: 14px; transition: background-color var(--dur), border-color var(--dur), color var(--dur); }
.slot-chip input:checked + span { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-text); }
.slot-chip input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.price-box { display: flex; flex-direction: column; gap: 2px; }
.price-box.idle, .price-box.agree { flex-direction: row; gap: 8px; align-items: flex-start; font-size: 13px; color: var(--muted); }
.price-box.idle svg, .price-box.agree svg { width: 18px; height: 18px; flex: none; color: var(--brand-text); }
.price-box .price-v { font-size: 20px; letter-spacing: -0.02em; }
.price-box.free .price-v { color: var(--success); }
.cta-pair { display: grid; grid-template-columns: 1fr; gap: 14px; margin-top: 18px; }
.cta-pair .order-cta { margin-top: 0; }
@media (min-width: 900px) { .cta-pair { grid-template-columns: 1fr 1fr; } }
.order-cta-ic.alt { background: #0d1030; }
.or-line { display: flex; align-items: center; gap: 12px; margin: 16px 0 0; color: var(--muted); font-size: 13px; }
.or-line::before, .or-line::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.scanner { position: relative; aspect-ratio: 1; max-height: 60vh; margin: 0 auto; border-radius: var(--radius-lg); overflow: hidden; background: #000; }
.scanner video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scanner-frame { position: absolute; inset: 18%; border-radius: 18px; box-shadow: 0 0 0 999px rgba(0, 0, 0, .35); border: 3px solid rgba(255, 255, 255, .9); }
.scanner-msg { position: absolute; left: 12px; right: 12px; bottom: 12px; display: flex; gap: 8px; align-items: center; padding: 10px 12px; border-radius: 12px; background: rgba(13, 16, 48, .85); color: #fff; font-size: 13px; }
.scanner-msg svg { width: 18px; height: 18px; flex: none; }

/* tracker */
.tracker-kpis { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); margin-bottom: 16px; }
.kpi-card.warn { border-color: color-mix(in srgb, var(--warning) 50%, transparent); background: var(--warning-soft); }
.tracker-filters .segmented { flex-wrap: wrap; }
.segmented > label { position: relative; cursor: pointer; }
.segmented > label input { position: absolute; opacity: 0; pointer-events: none; }
.segmented > label span { display: inline-flex; align-items: center; min-height: 34px; padding: 0 14px; border-radius: 10px; font-weight: 650; font-size: 13.5px; color: var(--muted); }
.segmented > label input:checked + span { background: var(--surface); color: var(--brand-text); box-shadow: var(--shadow-xs); }
.segmented > label input:focus-visible + span { outline: 2px solid var(--brand); }
.date-field { display: flex; flex-direction: column; gap: 2px; flex: 0 1 160px; }
.date-field .input { min-width: 0; flex: none; }
.table.tracker { min-width: 1500px; font-size: 13.5px; }
.table.tracker td, .table.tracker th { padding: 10px 12px; }
.table.tracker tbody tr { cursor: pointer; }
.table.tracker tbody tr:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
.table.tracker tr.stale td { background: color-mix(in srgb, var(--warning) 12%, transparent); }
.table.tracker tr.stale td:first-child { box-shadow: inset 3px 0 0 var(--warning); }
.table.tracker tr.cancelled td { color: var(--muted); }
.tracker-wrap { max-height: 70vh; overflow: auto; }
.tracker-wrap thead th { position: sticky; top: 0; z-index: 1; }
.th-sort { display: inline-flex; gap: 4px; align-items: center; font: inherit; color: inherit; text-transform: inherit; letter-spacing: inherit; }
.th-sort.on { color: var(--brand-text); }
@media (max-width: 719px) {
  .tracker-wrap { max-height: none; border: 0; background: none; }
  .table.tracker, .table.tracker tbody, .table.tracker tr, .table.tracker td { display: block; min-width: 0; width: 100%; }
  .table.tracker thead { display: none; }
  .table.tracker tr { margin-bottom: 12px; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
  .table.tracker tr.stale { border-color: var(--warning); }
  .table.tracker td { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border: 0; text-align: right; }
  .table.tracker td::before { content: attr(data-label); color: var(--muted); font-size: 12px; font-weight: 650; text-align: left; flex: none; }
  .table.tracker td > * { min-width: 0; }
}

/* settings preview, print jobs */
.preview-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.preview-grid .kpi-card { padding: 12px 14px; }
.preview-grid .kpi-card .v { font-size: 22px; }
.job-bar { height: 10px; border-radius: 10px; background: var(--surface-3); overflow: hidden; }
.job-bar span { display: block; height: 100%; background: var(--gradient); transition: width .3s; }
.job-files { list-style: none; padding: 0; margin: 0; max-height: 180px; overflow: auto; display: flex; flex-direction: column; gap: 4px; }
.job-files li { display: flex; gap: 6px; align-items: center; color: var(--muted); word-break: break-all; }
.job-files svg { width: 14px; height: 14px; flex: none; color: var(--success); }
.table.batches { min-width: 980px; }
.sticker-thumb { aspect-ratio: 66 / 90; }
fieldset.field { border: 0; padding: 0; margin: 0; min-width: 0; }
fieldset.field > legend { padding: 0; margin-bottom: 8px; }
.table td.nowrap, .table .nowrap { white-space: nowrap; }
@media (max-width: 719px) {
  .table.tracker tr.stale { background: var(--warning-soft); }
  .table.tracker tr.stale td { background: none; box-shadow: none; }
}

/* tracker as a spreadsheet: sticky header row and first column, column filters, resizable columns */
.sheet-wrap { max-height: calc(100vh - 260px); max-height: calc(100dvh - 260px); overflow: auto; }
.table.sheet { table-layout: fixed; width: max-content; min-width: 100%; }
.table.sheet th, .table.sheet td { overflow: hidden; text-overflow: ellipsis; }
.table.sheet thead th { position: sticky; top: 0; z-index: 2; padding: 0; }
.table.sheet th:first-child, .table.sheet td:first-child { position: sticky; left: 0; z-index: 1; background: var(--surface); box-shadow: inset -1px 0 0 var(--line); }
.table.sheet thead th:first-child { z-index: 3; background: var(--bg-soft); }
.table.sheet tbody tr:hover td:first-child { background: var(--bg-soft); }
.th-in { position: relative; display: flex; align-items: center; gap: 2px; padding: 10px 14px 10px 12px; }
.th-sort { flex: 1; min-width: 0; justify-content: flex-start; overflow: hidden; text-overflow: ellipsis; }
.th-dir { font-size: 10px; }
.th-filter { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 7px; color: var(--muted); flex: none; }
.th-filter svg { width: 14px; height: 14px; }
.th-filter:hover, th.filtered .th-filter { background: var(--brand-soft); color: var(--brand-text); }
th.sorted .th-sort, th.filtered .th-sort { color: var(--brand-text); }
.th-resize { position: absolute; top: 0; right: 0; bottom: 0; width: 8px; cursor: col-resize; touch-action: none; }
.th-resize:hover { background: color-mix(in srgb, var(--brand) 25%, transparent); }
.q-count { font-weight: 800; margin-left: 4px; opacity: .75; }
.tracker-chips:empty { display: none; }
.tracker-chips svg { width: 12px; height: 12px; }
.sheet-more { padding: 8px; }
.sheet-more:empty { padding: 0; }
.filter-pop { position: absolute; z-index: 60; padding: 12px; box-shadow: var(--shadow-lg, 0 18px 48px rgba(13, 16, 48, .18)); }
.filter-list { max-height: 260px; overflow: auto; margin-top: 4px; }
.filter-item { display: flex; align-items: center; gap: 10px; padding: 7px 4px; border-radius: 8px; cursor: pointer; font-size: 14px; }
.filter-item:hover { background: var(--bg-soft); }
.filter-item span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.filter-item b { font-size: 12px; color: var(--muted); font-weight: 650; }
.filter-item.all { border-bottom: 1px solid var(--line); border-radius: 0; margin-top: 6px; font-weight: 650; }
.filter-item[hidden] { display: none; }
@media (max-width: 719px) {
  .sheet-wrap { max-height: none; overflow: visible; }
  .table.sheet { table-layout: auto; width: 100%; }
  .table.sheet colgroup { display: none; }
  .table.sheet th:first-child, .table.sheet td:first-child { position: static; box-shadow: none; background: none; }
  .table.sheet td { overflow: visible; white-space: normal; }
}
.col-filters { display: none; }
@media (max-width: 719px) {
  .col-filters { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 10px; margin-bottom: 4px; scrollbar-width: none; }
  .col-filters .chip { flex: none; display: inline-flex; gap: 4px; align-items: center; }
  .col-filters svg { width: 12px; height: 12px; }
}

/* ---------- settings v3: grouped list (phone), menu + pane (computer), search, rows that never squeeze text ---------- */
.settings-shell { display: block; }
.set-search { margin-bottom: 16px; }
.set-group + .set-group { margin-top: 20px; }
.set-group-title { font-size: 12px; font-weight: 750; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin: 0 4px 8px; }
.set-list { border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); overflow: hidden; }
.set-row { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 56px; padding: 10px 14px; text-align: left; color: var(--text); background: none; border: 0; -webkit-tap-highlight-color: transparent; transition: background-color var(--dur); }
.set-row + .set-row { border-top: 1px solid var(--line); }
.set-row:hover, .set-row.active { background: var(--surface-2); }
.set-row.active { box-shadow: inset 3px 0 0 var(--brand); }
.set-row.static { cursor: default; }
.set-row.static:hover { background: none; }
.set-row.danger, .set-row.danger .set-ic { color: var(--danger); }
.set-ic { width: 36px; height: 36px; flex: none; display: grid; place-items: center; border-radius: 11px; background: var(--surface-2); color: var(--brand-text); }
.set-ic svg { width: 19px; height: 19px; }
.set-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.set-text b { font-size: 15px; font-weight: 650; }
.set-sum { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.set-go { color: var(--faint); flex: none; }
.set-go svg { width: 18px; height: 18px; }
.set-check { color: var(--brand-text); flex: none; }
.set-check svg { width: 20px; height: 20px; }
.set-head { justify-content: flex-start; }
.set-sub-title { font-size: 13px; font-weight: 750; color: var(--muted); margin: 22px 4px 8px; }
.set-pane-title { margin-bottom: 14px; }
.set-items { border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.set-pane .set-items { background: var(--surface-2); border-color: transparent; }
.set-item { display: flex; align-items: center; gap: 14px; padding: 14px 16px; min-height: 56px; scroll-margin: 90px; border-radius: inherit; }
.set-item + .set-item { border-top: 1px solid var(--line); border-radius: 0; }
.set-item-text { flex: 1 1 220px; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.set-item-ctl { flex: none; display: flex; align-items: center; }
/* a narrow screen: the control goes under the text instead of squeezing it to one word per line */
@media (max-width: 520px) {
  .set-item { flex-wrap: wrap; }
  .set-item-ctl:has(.btn) { flex-basis: 100%; }
}
.set-vehicle .vehicle-ic { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 11px; background: var(--surface); }
.pick-btn { gap: 6px; }
.pick-btn svg { width: 16px; height: 16px; }
.flash { animation: flash 1.8s var(--ease); }
@keyframes flash { 0%, 60% { background: color-mix(in srgb, var(--brand) 16%, transparent); box-shadow: 0 0 0 2px var(--brand); } 100% { background: transparent; box-shadow: none; } }
.save-bar { display: flex; justify-content: flex-start; }
@media (max-width: 767px) {
  .save-bar { position: sticky; bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 4px); z-index: 5; margin: 0 -16px; padding: 12px 16px; background: var(--glass); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-top: 1px solid var(--line); }
  .save-bar .btn { width: 100%; }
}
.ok-text, .bad-text { display: inline-flex; align-items: center; gap: 4px; font-weight: 650; }
.ok-text { color: var(--success); }
.bad-text { color: var(--danger); }
.ok-text svg, .bad-text svg { width: 14px; height: 14px; }
.check-list { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.check-list li { display: flex; gap: 10px; align-items: flex-start; }
.check-list svg { width: 18px; height: 18px; color: var(--danger); flex: none; margin-top: 3px; }
.sheet-list .sheet-text { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.sheet-list .has-sub { min-height: 64px; padding-top: 10px; padding-bottom: 10px; }
.sheet-list .sheet-sub { font-size: 13px; font-weight: 500; color: var(--muted); }
.sheet-list .sheet-check { color: var(--brand-text); }
@media (min-width: 1024px) {
  .settings-shell { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 24px; align-items: start; }
  .set-menu { position: sticky; top: calc(var(--topbar-h) + 16px); max-height: calc(100vh - var(--topbar-h) - 32px); overflow: auto; padding-bottom: 16px; scrollbar-width: thin; }
  .set-menu .set-row { min-height: 48px; }
}
/* tap feedback and touch targets */
.btn:active, .set-row:active, .chip:active { transform: scale(0.97); }
.icon-btn, .set-row { min-height: 44px; min-width: 44px; }
/* small buttons and switches keep their look; an invisible frame makes the touch area at least 44 px */
.btn-sm { position: relative; }
.btn-sm::after { content: ''; position: absolute; inset: -6px -2px; }
.switch input { inset: -8px -4px; }
.set-item.set-vehicle { flex-wrap: nowrap; }
.set-vehicle .set-item-text { flex: 1 1 auto; }

/* ---------- messages v2 ---------- */
/* our own long-press menus instead of the browser's link menu */
.conv, .msg { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
.conv-flags { display: inline-flex; gap: 4px; color: var(--faint); flex: none; }
.conv-flags svg { width: 15px; height: 15px; }
.msg-wrap { display: flex; flex-direction: column; max-width: min(78%, 520px); }
.msg-wrap.me { align-self: flex-end; align-items: flex-end; }
.msg-wrap.them { align-self: flex-start; align-items: flex-start; }
.msg-wrap .msg { max-width: 100%; cursor: pointer; }
.msg.deleted { background: transparent !important; color: var(--muted) !important; border: 1px dashed var(--line-strong); font-style: italic; }
.msg-quote { display: flex; flex-direction: column; gap: 1px; margin: -2px -6px 6px; padding: 6px 10px; border-radius: 12px; font-size: 12.5px; background: color-mix(in srgb, currentColor 10%, transparent); border-left: 3px solid currentColor; max-width: 100%; }
.msg-quote b { font-size: 11.5px; opacity: 0.85; }
.msg-edited { display: inline-block; margin-left: 6px; font-size: 11px; opacity: 0.7; }
.msg-reacts { display: inline-flex; align-items: center; gap: 4px; margin-top: -6px; padding: 2px 7px; border-radius: 999px; background: var(--elevated); border: 1px solid var(--line); box-shadow: var(--shadow-xs); position: relative; z-index: 1; min-height: 26px; }
.msg-reacts span { display: inline-flex; align-items: center; gap: 2px; }
.msg-reacts b { font-size: 11.5px; color: var(--muted); }
.react-bar { display: flex; justify-content: space-between; gap: 4px; padding: 6px; margin: 0 -4px 10px; border-radius: 999px; background: var(--surface-2); }
.react-bar button { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; transition: transform 120ms var(--spring), background-color var(--dur); }
.react-bar button:active { transform: scale(1.25); }
.react-bar button:hover { background: var(--surface); }
.react-bar .react-more svg { width: 22px; height: 22px; color: var(--muted); }
.react-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 4px; }
.react-grid button { height: 44px; border-radius: 12px; font-size: 26px; display: grid; place-items: center; }
.react-grid.stickers button { height: 56px; }
.react-grid button:hover { background: var(--surface-2); }
.react-who { width: 40px; display: grid; place-items: center; }
.qrbs-sticker { display: inline-block; vertical-align: middle; }
.emoji { line-height: 1; }
.compose-ctx { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 12px; margin-bottom: 8px; border-radius: 14px; background: var(--surface-2); border-left: 3px solid var(--brand); }
.compose-ctx .ctx-ic svg { width: 18px; height: 18px; color: var(--brand-text); }
.compose-ctx .ctx-text { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: 13px; }
.compose-ctx .ctx-text b { font-size: 12px; color: var(--brand-text); }
.request-wait { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 10px 12px; border-radius: 14px; background: var(--surface-2); }
.request-wait .small { display: inline-flex; align-items: center; gap: 6px; }
.request-wait svg { width: 16px; height: 16px; }
.typing { color: var(--brand-text); font-weight: 650; }
.typing::after { content: '…'; display: inline-block; animation: typingdots 1.2s steps(3, end) infinite; width: 1.2em; overflow: hidden; vertical-align: bottom; }
@keyframes typingdots { from { width: 0; } to { width: 1.2em; } }
.chat-skel { display: flex; flex-direction: column; gap: 10px; padding: 4px 0 12px; }
.msg-skel { height: 38px; border-radius: 20px; }
.msg-skel.me { align-self: flex-end; }
.avatar-btn { border-radius: 50%; }

/* full-screen photo viewer */
.viewer { position: fixed; inset: 0; z-index: 2000; background: rgba(5, 6, 16, calc(0.94 * var(--fade, 1))); display: grid; place-items: center; touch-action: none; animation: fade 180ms var(--ease) both; }
.viewer.out { animation: fadeout 180ms var(--ease) forwards; }
.viewer-stage { width: 100%; height: 100%; display: grid; place-items: center; overflow: hidden; }
.viewer img { max-width: min(92vw, 1080px); max-height: 86vh; border-radius: 16px; object-fit: contain; transition: transform 60ms linear; user-select: none; -webkit-user-drag: none; }
.viewer-x { position: absolute; top: calc(12px + var(--safe-top)); right: 12px; z-index: 1; color: #fff; background: rgba(255, 255, 255, 0.12); border-radius: 50%; }

/* ---------- posts v2: carousel, blur placeholder, owner menu bits ---------- */
.post-media .track { display: flex; width: 100%; height: 100%; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain; }
.post-media .track::-webkit-scrollbar { display: none; }
.post-media .slide { flex: 0 0 100%; margin: 0; scroll-snap-align: center; background: var(--surface-2) center / cover no-repeat; }
.post-media .slide img { width: 100%; height: 100%; max-height: none; object-fit: cover; }
.slide-count { position: absolute; top: 10px; right: 10px; padding: 3px 9px; border-radius: 999px; background: rgba(0, 0, 0, 0.55); color: #fff; font-size: 12px; font-weight: 700; }
.post-media .dots { position: absolute; left: 0; right: 0; bottom: 10px; display: flex; justify-content: center; gap: 5px; pointer-events: none; }
.post-media .dots span { width: 6px; height: 6px; border-radius: 50%; background: rgba(255, 255, 255, 0.5); transition: background-color var(--dur), transform var(--dur); }
.post-media .dots span.on { background: #fff; transform: scale(1.2); }
.post-head .edited, .post-head .loc { color: var(--muted); }
.pin-badge svg { width: 14px; height: 14px; color: var(--brand-text); vertical-align: -2px; }
.tag-link { color: var(--brand-text); font-weight: 600; }
.tile { background-size: cover; background-position: center; }
.tile-multi, .tile-pin { position: absolute; top: 8px; right: 8px; color: #fff; filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.5)); }
.tile-pin { right: auto; left: 8px; }
.tile-multi svg, .tile-pin svg { width: 18px; height: 18px; }
.pending-post { padding: 12px 14px; }
.pending-row { display: flex; align-items: center; gap: 12px; }
.pending-row img, .pending-ic { width: 52px; height: 52px; border-radius: 12px; object-fit: cover; flex: none; display: grid; place-items: center; background: var(--surface-2); }
.progress { height: 6px; border-radius: 999px; background: var(--surface-2); overflow: hidden; margin-top: 8px; }
.progress span { display: block; height: 100%; background: var(--gradient); transition: width 200ms var(--ease); }
.ptr { position: fixed; left: 50%; top: calc(var(--topbar-h, 60px) + 6px); z-index: 50; width: 34px; height: 34px; border-radius: 50%; background: var(--elevated); border: 3px solid var(--line); border-top-color: var(--brand); transform: translate(-50%, -60px); transition: transform 160ms var(--ease), opacity 160ms; pointer-events: none; box-shadow: var(--shadow); opacity: 0; }
.ptr.pulling, .ptr.spin { opacity: 1; }
.ptr.ready { border-color: var(--brand); }
.ptr.spin { animation: ptrspin 0.8s linear infinite; }
@keyframes ptrspin { from { transform: translate(-50%, 20px) rotate(0deg); } to { transform: translate(-50%, 20px) rotate(360deg); } }

/* comments: replies, likes, pinned */
.comment.pinned .bubble { padding: 8px 10px; border-radius: 12px; background: var(--brand-soft); }
.pin-line { display: flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 700; color: var(--brand-text); margin-bottom: 2px; }
.pin-line svg { width: 13px; height: 13px; }
.replies { margin-left: 44px; border-left: 2px solid var(--line); padding-left: 10px; }
.comment.reply { padding: 6px 0; }
.c-meta { display: flex; align-items: center; gap: 12px; margin-top: 4px; flex-wrap: wrap; }
.c-act { font-weight: 700; color: var(--muted); min-height: 32px; }
.c-side { display: flex; flex-direction: column; align-items: center; }
.c-like svg { width: 16px; height: 16px; }
.c-like.liked { color: var(--like); }
.reply-to { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 10px; margin-top: 10px; border-radius: 12px; background: var(--surface-2); }

/* profile & explore */
.mutuals { display: flex; align-items: center; gap: 10px; margin-top: 12px; padding: 6px 0; min-height: 44px; max-width: 100%; color: var(--text); font-size: 14px; line-height: 1.35; text-align: left; }
.mutuals b { font-weight: 700; }
.mutuals:hover .mutuals-text { text-decoration: underline; }
.mutuals-stack { display: inline-flex; flex: none; }
.mutuals-stack .avatar { box-shadow: 0 0 0 2px var(--bg); }
.mutuals-stack .avatar + .avatar { margin-left: -9px; }
.mutuals-text { min-width: 0; overflow-wrap: anywhere; }
.chips-row { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 12px; scrollbar-width: none; }
.chips-row::-webkit-scrollbar { display: none; }
.chips-row .chip { height: 36px; padding: 0 14px; flex: none; white-space: nowrap; }
.chip.on { background: var(--text); color: var(--bg); }
.chips-row .chip svg { width: 15px; height: 15px; }
.recent .list-item { padding: 4px 0; }
.recent-q { display: flex; align-items: center; gap: 10px; min-height: 44px; text-align: left; color: var(--text-2); min-width: 0; }
.recent-q svg { width: 16px; height: 16px; color: var(--faint); flex: none; }
.thumb-sq { width: 44px; height: 44px; border-radius: 12px; overflow: hidden; display: grid; place-items: center; background: var(--surface-2); flex: none; }
.thumb-sq img { width: 100%; height: 100%; object-fit: cover; }
.tag-ic, .tag-hero { font-weight: 800; font-size: 20px; color: var(--brand-text); }
.tag-hero { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: var(--brand-soft); font-size: 30px; flex: none; }
.notif-group { margin-top: 14px; }
.notif.new { position: relative; }
.notif.new::after { content: ''; position: absolute; right: 6px; top: 50%; width: 8px; height: 8px; margin-top: -4px; border-radius: 50%; background: var(--brand); }

/* ---------- the post editor (full screen on phones) ---------- */
@media (max-width: 767px) {
  .app.editor-mode .cmdbar, .app.editor-mode .dock { display: none; }
  .app.editor-mode .main { padding-bottom: 0; }
}
.editor { max-width: 760px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.ed-head { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 8px; padding: calc(8px + var(--safe-top)) 10px 8px; background: var(--glass); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); border-bottom: 1px solid var(--line); }
@media (min-width: 768px) { .ed-head { top: var(--topbar-h); } }
.ed-body { padding: 16px; padding-bottom: calc(24px + var(--safe-bottom)); }
.pick-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pick-item, .pick-add { position: relative; aspect-ratio: 1; border-radius: 14px; overflow: hidden; background: var(--surface-2); touch-action: manipulation; }
.pick-item img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.pick-item.lifted { transform: scale(1.06); box-shadow: var(--shadow-lg); z-index: 2; }
.pick-n { position: absolute; left: 6px; top: 6px; min-width: 22px; height: 22px; border-radius: 11px; display: grid; place-items: center; background: var(--gradient); color: #fff; font-size: 12px; font-weight: 800; }
.pick-x { position: absolute; right: 4px; top: 4px; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: rgba(0, 0, 0, 0.55); color: #fff; }
.pick-x svg { width: 16px; height: 16px; }
.pick-add { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; border: 2px dashed var(--line-strong); color: var(--muted); font-size: 12.5px; font-weight: 650; cursor: pointer; text-align: center; padding: 6px; }
.pick-add svg { width: 26px; height: 26px; }
.ed-stage { position: relative; display: grid; place-items: center; background: #05060f; min-height: 46vh; padding: 10px; touch-action: none; user-select: none; }
.ed-stage canvas { max-width: 100%; max-height: 58vh; border-radius: 6px; }
.ed-hint { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); padding: 4px 10px; border-radius: 999px; background: rgba(0, 0, 0, 0.55); color: #fff; font-size: 12px; pointer-events: none; white-space: nowrap; max-width: calc(100% - 20px); overflow: hidden; text-overflow: ellipsis; }
.ed-hint:empty { display: none; }
.ed-tools { padding: 12px 16px calc(16px + var(--safe-bottom)); display: flex; flex-direction: column; gap: 10px; }
.ed-tabs { display: flex; }
.ed-tabs > button { flex: 1; }
.ed-panel { display: flex; flex-direction: column; gap: 10px; min-height: 120px; }
.ed-panel .chip { height: 36px; padding: 0 14px; }
.ed-slider { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 650; color: var(--text-2); }
.ed-slider input { width: 100%; accent-color: var(--brand); height: 28px; }
.ed-filters { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: none; }
.ed-filters button { flex: none; display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 12px; font-weight: 650; color: var(--muted); }
.ed-filters canvas { width: 72px; height: 72px; border-radius: 12px; border: 2px solid transparent; }
.ed-filters .on { color: var(--brand-text); }
.ed-filters .on canvas { border-color: var(--brand); }
.ed-strip { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0; scrollbar-width: none; }
.ed-strip > * { flex: none; width: 56px; height: 56px; border-radius: 10px; overflow: hidden; border: 2px solid transparent; }
.ed-strip .on { border-color: var(--brand); }
.ed-strip img { width: 100%; height: 100%; object-fit: cover; }
.ed-alts summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; }
.alt-thumb { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; flex: none; }
.spinner.sm { width: 16px; height: 16px; border-width: 2px; }
.mb-16 { margin-bottom: 16px; }

/* admin: print sets and the packing check */
.batch-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-left: 6px; vertical-align: middle; }
.pack-box { max-width: 560px; }
.pack-steps { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pack-step { display: flex; flex-direction: column; gap: 4px; padding: 12px; border-radius: 14px; background: var(--surface-2); color: var(--muted); font-weight: 650; font-size: 14px; border: 2px solid transparent; }
.pack-step b { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--line); color: var(--text); }
.pack-step.on { border-color: var(--brand); color: var(--text); }
.pack-step.on b { background: var(--gradient); color: #fff; }
.pack-step.done b { background: var(--success); color: #fff; }
.pack-result { display: flex; align-items: center; gap: 12px; padding: 16px; border-radius: 16px; font-size: 16px; }
.pack-result svg { width: 30px; height: 30px; flex: none; }
.pack-result.ok { background: var(--success-soft); color: var(--success); }
.pack-result.bad { background: var(--danger-soft); color: var(--danger); }

/* ---------- videos and "Sürüşlər" (stage 2) ---------- */
.post-media.is-video { background: #05060f; }
.post-media video.pv { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #05060f; }
.vid-sound, .vid-open { position: absolute; z-index: 2; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: rgba(0, 0, 0, 0.5); color: #fff; }
.vid-sound { right: 10px; bottom: 10px; }
.vid-open { right: 10px; top: 10px; }
.vid-sound svg, .vid-open svg { width: 18px; height: 18px; }
.vid-play { position: absolute; z-index: 2; left: 50%; top: 50%; width: 64px; height: 64px; margin: -32px 0 0 -32px; border-radius: 50%; display: grid; place-items: center; background: rgba(0, 0, 0, 0.5); color: #fff; }
.vid-play svg { width: 30px; height: 30px; }
.vid-time { position: absolute; left: 10px; bottom: 12px; z-index: 2; padding: 2px 8px; border-radius: 999px; background: rgba(0, 0, 0, 0.5); color: #fff; font-size: 12px; font-weight: 700; pointer-events: none; }
.reply-to { display: inline-flex; align-items: center; gap: 6px; margin: 0 12px 8px; padding: 4px 10px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-text); font-size: 12.5px; font-weight: 700; max-width: calc(100% - 24px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reply-to svg { width: 15px; height: 15px; flex: none; }
.vid-stage video { max-width: 100%; max-height: 58vh; border-radius: 6px; background: #000; }
.vid-cover { width: 72px; height: auto; max-height: 128px; border-radius: 8px; background: #000; flex: none; object-fit: contain; }
.pick-video .pick-n { display: inline-flex; gap: 2px; padding: 0 7px; }
.pick-video .pick-n svg { width: 12px; height: 12px; }

.reels { --reel-h: calc(100dvh - var(--topbar-h) - 24px); max-width: 460px; margin: 12px auto 0; position: relative; }
.reels-head { display: flex; align-items: center; gap: 8px; padding: 0 4px 8px; }
.reels-track { height: var(--reel-h); overflow-y: auto; scroll-snap-type: y mandatory; overscroll-behavior: contain; border-radius: var(--radius-lg, 20px); background: #05060f; scrollbar-width: none; }
.reels-track::-webkit-scrollbar { display: none; }
.reels-track > .empty { color: #fff; padding-top: 20vh; }
.reel { position: relative; height: var(--reel-h); scroll-snap-align: start; scroll-snap-stop: always; overflow: hidden; color: #fff; }
.reel-skel { display: grid; place-items: center; }
.reel-media { position: absolute; inset: 0; }
.reel-media video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #05060f; }
.reel-media .vid-sound { top: 12px; right: 12px; bottom: auto; }
.reel::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 45%; background: linear-gradient(transparent, rgba(0, 0, 0, 0.65)); pointer-events: none; }
.reel-info { position: absolute; left: 14px; right: 74px; bottom: calc(16px + var(--safe-bottom)); z-index: 3; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.reel-info a, .reel-info .reel-text { color: #fff; }
.reel-info .reply-to { margin: 0; background: rgba(255, 255, 255, 0.18); color: #fff; align-self: flex-start; }
.reel-info .post-tag { margin: 0; align-self: flex-start; }
.reel-text { margin: 0; font-size: 14px; line-height: 1.4; word-break: break-word; }
.reel-rail { position: absolute; right: 8px; bottom: calc(16px + var(--safe-bottom)); z-index: 3; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.reel-act { display: flex; flex-direction: column; align-items: center; }
.reel-rail .icon-btn { color: #fff; width: 48px; height: 48px; filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.45)); }
.reel-rail .icon-btn svg { width: 28px; height: 28px; }
.reel-rail .icon-btn.liked { color: #ff3b6b; }
.reel-count { min-height: 16px; font-size: 12.5px; font-weight: 750; color: #fff; text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5); background: none; }
.clamp-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
@media (max-width: 767px) {
  .app.reels-mode .cmdbar, .app.reels-mode .dock { display: none; }
  .app.reels-mode .main { padding-bottom: 0; }
  .reels { --reel-h: 100dvh; margin: 0; max-width: none; }
  .reels-head { position: absolute; z-index: 5; left: 0; right: 0; top: 0; padding: calc(8px + var(--safe-top)) 8px 8px; color: #fff; background: linear-gradient(rgba(0, 0, 0, 0.45), transparent); }
  .reels-head .icon-btn { color: #fff; }
  .reels-track { border-radius: 0; }
  .reel-media .vid-sound { top: calc(60px + var(--safe-top)); }
}
.explore-reels { display: flex; align-items: center; gap: 12px; margin: 14px 0 4px; padding: 12px 14px; border-radius: var(--radius); background: var(--gradient); color: #fff; }
.explore-reels .muted { color: rgba(255, 255, 255, 0.85); }
.explore-reels > svg { width: 26px; height: 26px; flex: none; }

/* ---------- "Anlar" (moments) and "Seçilmişlər" (stage 2) ---------- */
.rings-box { margin: 0 -4px 14px; }
.rings { display: flex; gap: 12px; overflow-x: auto; padding: 4px; scrollbar-width: none; }
.rings::-webkit-scrollbar { display: none; }
.ring-item { flex: none; width: 72px; display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 11.5px; color: var(--text-2); min-width: 0; }
.ring-item > span:last-child { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mring { position: relative; width: var(--s); height: var(--s); border-radius: 50%; padding: 3px; background: var(--gradient); display: grid; place-items: center; flex: none; }
.mring > .avatar { border: 3px solid var(--bg); box-sizing: content-box; }
.mring.seen { background: var(--line-strong); }
.mring.close { background: #22c55e; }
.mring-plus { position: absolute; right: 0; bottom: 0; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--brand); color: #fff; border: 2px solid var(--bg); }
.mring-plus svg { width: 14px; height: 14px; }
button.avatar-ring { border-radius: 50%; }

.mviewer { position: fixed; inset: 0; z-index: 200; background: #000; display: grid; place-items: center; touch-action: none; user-select: none; -webkit-user-select: none; }
.mv-stage { position: relative; width: 100%; height: 100%; max-width: calc(100dvh * 9 / 16); background: #0b0d1f center / cover no-repeat; overflow: hidden; display: grid; place-items: center; color: #fff; }
@media (min-width: 768px) { .mv-stage { height: calc(100dvh - 40px); border-radius: 16px; } }
.mv-media { position: absolute; inset: 0; display: grid; place-items: center; backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px); }
.mv-media img, .mv-media video { width: 100%; height: 100%; object-fit: contain; }
.mv-layer { position: absolute; inset: 0; pointer-events: none; }
/* above the back / next tap areas, so a poll and a mention can be tapped */
.mviewer .mv-layer { z-index: 3; }
.mv-layer .mo-poll, .mv-layer .mo-mention { pointer-events: auto; }
.mv-bars { position: absolute; z-index: 4; left: 8px; right: 8px; top: calc(8px + var(--safe-top)); display: flex; gap: 4px; }
.mv-bars span { flex: 1; height: 3px; border-radius: 2px; background: rgba(255, 255, 255, 0.35); overflow: hidden; }
.mv-bars i { display: block; height: 100%; background: #fff; }
.mv-head { position: absolute; z-index: 4; left: 0; right: 0; top: calc(16px + var(--safe-top)); display: flex; align-items: center; gap: 8px; padding: 4px 6px 4px 12px; }
.mv-head a, .mv-head .icon-btn { color: #fff; }
.mv-when { font-size: 12.5px; opacity: 0.8; flex: none; white-space: nowrap; }
/* a long name is cut with "…": the time never lies on it */
.mv-head > a { min-width: 0; flex: 0 1 auto; }
.mv-head > a > b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mv-head > a > .avatar, .mv-head .icon-btn, .mv-close-badge { flex: none; }
.mv-close-badge { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: #22c55e; }
.mv-close-badge svg { width: 12px; height: 12px; }
.mv-tap { position: absolute; z-index: 2; top: 0; bottom: 0; background: none; }
.mv-tap.left { left: 0; width: 32%; }
.mv-tap.right { right: 0; width: 68%; }
.mv-foot { position: absolute; z-index: 4; left: 0; right: 0; bottom: 0; padding: 10px 12px calc(12px + var(--safe-bottom)); display: flex; flex-direction: column; gap: 8px; background: linear-gradient(transparent, rgba(0, 0, 0, 0.55)); }
.mv-quick { display: flex; justify-content: space-around; }
.mv-quick button { font-size: 26px; width: 44px; height: 44px; }
.mv-reply { display: flex; gap: 8px; align-items: center; }
.mv-reply .input { flex: 1; background: rgba(255, 255, 255, 0.12); border-color: rgba(255, 255, 255, 0.45); color: #fff; border-radius: 999px; }
.mv-reply .input::placeholder { color: rgba(255, 255, 255, 0.75); }
.mv-reply .icon-btn, .mv-views { color: #fff; }
.mv-views { display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; min-height: 44px; font-weight: 700; }
.mv-views svg { width: 20px; height: 20px; }
/* the QRBs verified badge next to a name */
.vbadge { display: inline-flex; vertical-align: -0.15em; margin-left: 4px; width: 1.05em; height: 1.05em; flex: none; }
.vbadge svg { width: 100%; height: 100%; }
.notice > svg[viewBox] { width: 22px; height: 22px; flex: none; }
.badge-preview .tiny { display: inline-flex; align-items: center; }
.badge-previews { display: flex; gap: 12px; flex-wrap: wrap; }
.badge-preview { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px; border: 1px solid var(--line); border-radius: 16px; min-width: 120px; cursor: pointer; }
.badge-preview svg { width: 44px; height: 44px; }
.badge-preview:has(input:checked) { border-color: var(--brand, #2f5bff); box-shadow: 0 0 0 3px rgba(47, 91, 255, 0.15); }
.mv-likes { display: inline-flex; align-items: center; gap: 4px; margin-left: 10px; color: #ff3b6b; }
.mv-likes svg { width: 18px; height: 18px; }
.mv-heart, .mv-heart:hover, .mv-heart:focus-visible { color: #fff; background: transparent; transition: transform 160ms var(--ease-out); }
.mv-heart.on, .mv-heart.on:hover { color: #ff3b6b; background: transparent; }
.mv-heart.pop { animation: heartpop 420ms var(--spring); }
@keyframes heartpop { 0% { transform: scale(1); } 35% { transform: scale(1.45); } 100% { transform: scale(1); } }
.viewer-heart { color: #ff3b6b; display: inline-flex; margin-left: 8px; }
.viewer-heart svg { width: 18px; height: 18px; }
@media (prefers-reduced-motion: reduce) { .mv-heart.pop { animation: none; } }

/* the things placed on a moment (shared by the viewer and the editor) */
.mo { position: absolute; transform: translate(-50%, -50%) scale(var(--sc, 1)) rotate(var(--rot, 0deg)); transform-origin: center; white-space: pre-wrap; text-align: center; max-width: 80%; }
.mo-text { color: var(--c, #fff); font-weight: 800; font-size: 22px; line-height: 1.2; text-shadow: 0 1px 6px rgba(0, 0, 0, 0.45); word-break: break-word; }
.mo-text.bg { background: var(--c); color: #fff; padding: 4px 10px; border-radius: 10px; text-shadow: none; }
.mo-text.bg[style*='#ffffff'] { color: #111; }
.mo-sticker { font-size: 56px; line-height: 1; }
.mo-mention, .mo-vehicle { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 12px; background: rgba(255, 255, 255, 0.92); color: #111 !important; font-weight: 800; font-size: 15px; white-space: nowrap; }
.mo-vehicle svg { width: 18px; height: 18px; color: var(--brand); }
.mo-poll { width: 220px; padding: 12px; border-radius: 16px; background: rgba(255, 255, 255, 0.95); color: #111; display: flex; flex-direction: column; gap: 8px; white-space: normal; }
.mo-poll b { font-size: 15px; }
.mo-opt { position: relative; display: flex; align-items: center; justify-content: space-between; min-height: 40px; padding: 0 12px; border-radius: 10px; background: #eef0f7; color: #111; font-weight: 750; overflow: hidden; text-align: left; }
.mo-opt.on { outline: 2px solid var(--brand); }
.mo-bar { position: absolute; left: 0; top: 0; bottom: 0; background: rgba(47, 91, 255, 0.22); }
.mo-opt-t, .mo-pct { position: relative; }

/* the moment editor */
.mstage-wrap { background: #05060f; display: grid; place-items: center; padding: 8px; }
.mstage { position: relative; height: min(62vh, 640px); aspect-ratio: 9 / 16; max-width: 100%; border-radius: 14px; overflow: hidden; background: #0b0d1f; touch-action: none; }
.mstage > img, .mstage > video { width: 100%; height: 100%; object-fit: contain; }
.mstage .mv-layer { pointer-events: auto; }
.mstage .mo { cursor: grab; }
.mstage .mo.sel { outline: 2px dashed #fff; outline-offset: 4px; }
.mtools { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.mtools button { display: flex; flex-direction: column; align-items: center; gap: 4px; min-height: 56px; padding: 6px 2px; border-radius: 12px; background: var(--surface-2); font-size: 11.5px; font-weight: 700; color: var(--text-2); }
.mtools button:disabled { opacity: 0.45; }
.mtools svg { width: 22px; height: 22px; }
.sticker-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 10px; }
.sticker-grid button { display: grid; place-items: center; min-height: 56px; border-radius: 12px; background: var(--surface-2); }
.emoji-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 4px; margin-top: 12px; max-height: 40vh; overflow-y: auto; }
.emoji-grid button { font-size: 26px; min-height: 44px; }
.color-pick input { position: absolute; opacity: 0; }
.color-pick span { display: block; width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--line-strong); }
.color-pick input:checked + span { outline: 3px solid var(--brand); outline-offset: 2px; }

/* "Seçilmişlər" on a profile */
.highlights { display: flex; gap: 14px; overflow-x: auto; padding: 4px 2px 10px; scrollbar-width: none; }
.highlights::-webkit-scrollbar { display: none; }
.hl-item { flex: none; width: 70px; display: flex; flex-direction: column; align-items: center; gap: 5px; font-size: 12px; font-weight: 650; color: var(--text-2); }
.hl-item > span:last-child { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hl-cover { width: 62px; height: 62px; border-radius: 50%; padding: 3px; border: 1.5px solid var(--line-strong); display: grid; place-items: center; overflow: hidden; background: var(--surface-2); }
.hl-cover img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.hl-cover svg { width: 24px; height: 24px; color: var(--muted); }
.msg-ref { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; font-size: 12px; opacity: 0.85; }
.msg-ref img { width: 44px; height: 78px; object-fit: cover; border-radius: 8px; }
.pick-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; max-height: 50vh; overflow-y: auto; }
.pick-list label { position: relative; aspect-ratio: 9 / 16; border-radius: 10px; overflow: hidden; background: var(--surface-2); }
.pick-list img { width: 100%; height: 100%; object-fit: cover; }
.pick-list input { position: absolute; right: 6px; top: 6px; width: 20px; height: 20px; }

.avatar-btn.has-moments { padding: 3px; border-radius: 50%; background: var(--gradient); }
.avatar-btn.has-moments.moments-seen { background: var(--line-strong); }
.avatar-btn.has-moments.moments-close { background: #22c55e; }
.avatar-btn.has-moments > .avatar { border: 3px solid var(--bg); }

/* ---------- chats, stage 2: media, voice, shares, groups, "active" ---------- */
.conv-av { position: relative; flex: none; display: inline-flex; }
.online-dot { position: absolute; right: 1px; bottom: 1px; width: 14px; height: 14px; border-radius: 50%; background: #22c55e; border: 2.5px solid var(--bg); }
.avatar-group { display: inline-grid; place-items: center; background: var(--brand-soft); color: var(--brand-text); }
.avatar-group svg { width: 55%; height: 55%; }
.avatar-group img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.group-title { display: block; max-width: 100%; text-align: left; background: none; color: inherit; font: inherit; font-weight: 750; }
.group-line { align-self: center; margin: 8px auto; padding: 4px 12px; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: 12px; text-align: center; max-width: 90%; }
.msg-who { display: inline-flex; align-items: center; gap: 6px; margin: 8px 0 2px 4px; font-size: 12px; font-weight: 700; color: var(--muted); }
.msg.rich { padding: 4px; display: flex; flex-direction: column; gap: 4px; }
.msg.rich .msg-text { padding: 2px 8px 4px; }
.msg-photo { display: block; width: min(260px, 62vw); border-radius: 14px; overflow: hidden; background: var(--surface-2); padding: 0; }
.msg-photo img { width: 100%; height: 100%; object-fit: cover; }
.msg-video { display: block; width: min(260px, 62vw); max-height: 360px; border-radius: 14px; background: #000; }
.msg-share { display: flex; align-items: center; gap: 10px; min-width: min(240px, 60vw); max-width: 280px; padding: 8px; border-radius: 12px; background: rgba(127, 127, 160, 0.14); color: inherit; text-align: left; }
.msg-share img { width: 52px; height: 52px; border-radius: 10px; object-fit: cover; flex: none; }
.msg-share .grow { display: flex; flex-direction: column; gap: 2px; min-width: 0; font-size: 13px; }
.msg-share .grow > span:not(.plate) { opacity: 0.8; overflow: hidden; text-overflow: ellipsis; }
.msg-share.gone { opacity: 0.7; font-size: 13px; }
.msg-share > svg { width: 18px; height: 18px; flex: none; }
.clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.voice { --p: 0%; display: flex; align-items: center; gap: 8px; min-width: min(240px, 62vw); padding: 4px 6px; }
.voice-play { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, 0.22); color: inherit; flex: none; }
.msg.them .voice-play { background: var(--brand); color: #fff; }
.voice-play svg { width: 16px; height: 16px; }
.voice-wave { flex: 1; height: 28px; display: flex; align-items: center; gap: 2px; }
.voice-wave i { flex: 1; min-width: 2px; border-radius: 2px; background: currentColor; opacity: 0.35; }
.voice-wave i.on { opacity: 1; }
.voice-time { font-size: 12px; font-variant-numeric: tabular-nums; min-width: 34px; }
.voice-speed { min-width: 36px; height: 26px; border-radius: 999px; background: rgba(127, 127, 160, 0.2); color: inherit; font-size: 12px; font-weight: 800; }
.composer-attach, .composer-mic { flex: none; }
.composer-mic { transition: transform 180ms var(--ease-out), background 180ms; }
.composer-mic.on { color: #fff; background: #ff3b6b; border-radius: 50%; transform: scale(1.25); box-shadow: 0 0 0 0 rgba(255, 59, 107, 0.45); animation: micpulse 1.2s infinite; }
@keyframes micpulse { 0% { box-shadow: 0 0 0 0 rgba(255, 59, 107, 0.45); } 100% { box-shadow: 0 0 0 14px rgba(255, 59, 107, 0); } }
.voice-rec { transition: transform 120ms linear, background 160ms; animation: msgin 200ms var(--ease-out) both; }
.composer:has(textarea:not(:placeholder-shown)) .composer-mic { display: none; }
.composer:has(textarea:placeholder-shown) button[type=submit] { display: none; }
.voice-rec { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; padding: 8px 12px; border-radius: 12px; background: var(--surface-2); font-variant-numeric: tabular-nums; }
.voice-rec.cancel { background: rgba(255, 59, 107, 0.15); color: #ff3b6b; }
.voice-rec.uploading .rec-dot { background: var(--brand); animation: none; }
.rec-dot { width: 10px; height: 10px; border-radius: 50%; background: #ff3b6b; animation: recblink 1s infinite; }
@keyframes recblink { 50% { opacity: 0.25; } }
.pick-people { max-height: 46vh; overflow-y: auto; }
.pick-people .list-item { cursor: pointer; }
.pick-people input { width: 20px; height: 20px; flex: none; }
.group-photo { position: relative; width: 88px; height: 88px; margin: 0 auto; border-radius: 50%; display: grid; place-items: center; overflow: hidden; background: var(--brand-soft); color: var(--brand-text); }
.group-photo.can { cursor: pointer; }
.group-photo img { width: 100%; height: 100%; object-fit: cover; }
.group-photo > svg { width: 40px; height: 40px; }
.group-photo-edit { position: absolute; left: 0; right: 0; bottom: 0; height: 28px; display: grid; place-items: center; background: rgba(0, 0, 0, 0.45); color: #fff; }
.group-photo-edit svg { width: 16px; height: 16px; }

/* held comments, two-step sign-in, sign-in history (stage 2) */
.comment.held .bubble { opacity: 0.7; border: 1px dashed var(--line-strong); }
.held-mark { display: inline-flex; align-items: center; gap: 4px; color: var(--warn, #b7791f); }
.held-mark svg { width: 13px; height: 13px; }
.twostep-qr { display: grid; place-items: center; padding: 12px; background: #fff; border-radius: 16px; width: max-content; margin: 0 auto; }
.twostep-qr svg, .twostep-qr canvas, .twostep-qr img { width: 200px; height: 200px; }
.secret-text { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: 1px; word-break: break-all; text-align: center; padding: 10px; border-radius: 12px; background: var(--surface-2); user-select: all; }
.recovery-codes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.recovery-codes span { padding: 8px; border-radius: 10px; background: var(--surface-2); text-align: center; }
.login-row .sub.bad { color: var(--danger, #e5484d); }

/* ---------- community: clubs, meet-ups, nearby, statistics (stage 2) ---------- */
.community-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0 4px; }
.community-row .chip svg { width: 16px; height: 16px; }
.hub-card { display: flex; align-items: center; gap: 14px; padding: 16px; color: inherit; }
.hub-ic { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-text); flex: none; }
.hub-ic svg { width: 24px; height: 24px; }
.club-head { display: flex; align-items: center; gap: 16px; margin-top: 8px; }
.club-head .group-photo { margin: 0; flex: none; }
.event-row .meta .sub + .sub { margin-top: 2px; }
.event-date { width: 52px; height: 56px; border-radius: 14px; display: flex; flex-direction: column; align-items: center; justify-content: center; background: var(--brand-soft); color: var(--brand-text); flex: none; line-height: 1.1; }
.event-date b { font-size: 20px; }
.event-date span { font-size: 11px; text-transform: uppercase; font-weight: 700; }
.event-date.big { width: 64px; height: 70px; }
.event-hero { display: flex; align-items: center; gap: 14px; margin-top: 8px; }
.post-club { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; color: var(--brand-text); }
.post-club svg { width: 13px; height: 13px; }

/* "Call me" request from a scan page (owner's chat) */
.msg.callme { display: grid; gap: 8px; min-width: 220px; }
.callme-head { display: inline-flex; align-items: center; gap: 8px; }
.callme-head svg { width: 18px; height: 18px; color: var(--brand, #2f5bff); }
.callme-num { font-size: 1.15rem; font-weight: 750; letter-spacing: .02em; font-variant-numeric: tabular-nums; }
.msg.callme .btn { justify-self: start; }

/* Avatars and navigation: a long press selects no text and opens no system menu (image save, link preview) */
.avatar, .avatar-btn, .mring, .ring-item, .cmdbar, .cmdbar a, .cmdbar button, .dock, .dock a, .dock button, .nav-a, .tabs, .tabs a {
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
}
/* a link around an avatar (its own rule: an older browser without :has() keeps the rule above) */
a:has(> .avatar) { -webkit-touch-callout: none; }
.avatar img, .mring img, .cmdbar img, .dock img { -webkit-user-drag: none; -webkit-touch-callout: none; pointer-events: none; }

/* ---------- photo / video preview before sending (chat) ---------- */
html.medit-open { overflow: hidden; }
.medit { position: fixed; inset: 0; z-index: 1200; display: flex; flex-direction: column; background: #0b0d1a; color: #fff; padding: var(--safe-top) 0 var(--safe-bottom); }
.medit-head { display: flex; align-items: center; gap: 8px; padding: 8px 12px; }
.medit-head .icon-btn { color: #fff; }
.medit-stage { flex: 1; min-height: 0; display: grid; place-items: center; padding: 8px 12px; overflow: hidden; }
.medit-canvas, .medit-video { max-width: 100%; max-height: 100%; border-radius: 14px; touch-action: none; cursor: grab; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.14); }
.medit-video { touch-action: auto; cursor: default; background: #000; }
.medit-tools { display: flex; flex-direction: column; gap: 10px; padding: 10px 16px 4px; }
.medit-row { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; }
.medit .chip { background: rgba(255, 255, 255, 0.1); color: #fff; border: 1px solid transparent; min-height: 36px; padding: 0 14px; }
.medit .chip[aria-pressed='true'] { background: var(--gradient); }
.medit .btn-ghost { color: #fff; border-color: rgba(255, 255, 255, 0.22); }
.medit .muted { color: rgba(255, 255, 255, 0.6); }
.medit-zoom { display: inline-flex; align-items: center; gap: 6px; flex: 1; min-width: 140px; max-width: 260px; }
.medit-zoom svg { width: 18px; height: 18px; flex: none; }
.medit-zoom input { width: 100%; accent-color: #9b4dff; }
.medit-trim { display: grid; gap: 8px; }
.medit-trim label { display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; align-items: center; font-size: 13.5px; }
.medit-trim input { grid-column: 1 / -1; width: 100%; accent-color: #9b4dff; }
.medit-foot { display: flex; justify-content: space-between; gap: 12px; padding: 10px 16px 14px; }
.medit-foot .btn { flex: 1; max-width: 220px; }

/* sign-in page: accounts waiting on this device */
.saved-accounts { margin-bottom: 16px; }
.saved-account { width: 100%; text-align: left; border: 1px solid var(--line); border-radius: 14px; margin-bottom: 8px; }

/* the admin's top bar on phones keeps its own height on a short page */
@media (max-width: 959px) { .admin { grid-template-rows: auto 1fr; } }

/* ---------- Motion: QRBs's soft layer. 150-300 ms, transform and opacity only, nothing waits for it ---------- */
/* page changes (core/router.js): the content changes softly, the bars stay still */
.vt-on .view { view-transition-name: qrbs-view; }
.vt-on .cmdbar { view-transition-name: qrbs-bar; }
.vt-on .dock { view-transition-name: qrbs-dock; }
::view-transition { pointer-events: none; }
::view-transition-old(root), ::view-transition-new(root) { animation: none; }
::view-transition-group(qrbs-bar), ::view-transition-group(qrbs-dock) { animation: none; }
::view-transition-old(qrbs-bar), ::view-transition-old(qrbs-dock) { display: none; }
::view-transition-new(qrbs-bar), ::view-transition-new(qrbs-dock) { animation: none; opacity: 1; }
::view-transition-group(qrbs-view) { animation-duration: 220ms; animation-timing-function: var(--ease-out); }
::view-transition-old(qrbs-view) { animation: vtout 150ms var(--ease) both; }
::view-transition-new(qrbs-view) { animation: vtin 220ms var(--ease-out) both; }
[data-vt='next']::view-transition-old(qrbs-view) { animation-name: vtout-left; }
[data-vt='next']::view-transition-new(qrbs-view) { animation-name: vtin-right; }
[data-vt='prev']::view-transition-old(qrbs-view) { animation-name: vtout-right; }
[data-vt='prev']::view-transition-new(qrbs-view) { animation-name: vtin-left; }
@keyframes vtout { to { opacity: 0; } }
@keyframes vtin { from { opacity: 0; transform: translateY(6px); } }
@keyframes vtout-left { to { opacity: 0; transform: translateX(-20px); } }
@keyframes vtout-right { to { opacity: 0; transform: translateX(20px); } }
@keyframes vtin-right { from { opacity: 0; transform: translateX(24px); } }
@keyframes vtin-left { from { opacity: 0; transform: translateX(-24px); } }
/* the same for browsers without the API */
.view-enter { animation-duration: 220ms; }
.view-enter.slide-next { animation-name: vtin-right; }
.view-enter.slide-prev { animation-name: vtin-left; }

/* one after another: posts and list items as they arrive */
.rise-in { animation: risein 240ms var(--ease-out) both; animation-delay: calc(var(--i, 0) * 30ms); }
@keyframes risein { from { opacity: 0; transform: translateY(8px); } }

/* press and hover: a light glow through opacity, a press through transform */
.btn { position: relative; }
.btn::before, .icon-btn::before { content: ''; position: absolute; inset: 0; border-radius: inherit; opacity: 0; pointer-events: none; transition: opacity 180ms var(--ease); }
.btn::before { background: color-mix(in srgb, currentColor 10%, transparent); }
.icon-btn { isolation: isolate; }
.icon-btn::before { z-index: -1; background: var(--surface-2); }
@media (hover: hover) {
  .btn:hover::before, .icon-btn:hover::before { opacity: 1; }
  a.card, button.card, a.list-item, button.list-item { transition: transform 180ms var(--ease-out); }
  a.card:hover, button.card:hover { transform: translateY(-2px); }
}
a.card, button.card, a.list-item, button.list-item, .nav-a, .tabs a, .tabs button, .segmented > a, .segmented > button { -webkit-tap-highlight-color: transparent; transition: transform 120ms var(--ease); }
a.card:active, button.card:active, a.list-item:active, button.list-item:active, .nav-a:active, .tabs a:active, .tabs button:active, .segmented > a:active, .segmented > button:active { transform: scale(0.97); }

/* windows that open from a field */
.picker-list, .filter-pop { animation: popin 170ms var(--ease-out) both; transform-origin: top center; }
@keyframes popin { from { opacity: 0; transform: translateY(-4px) scale(0.98); } }

/* forms: errors open softly; checkboxes and radio buttons fill and tick (a switch moves its knob above) */
.error-text:not(:empty), [data-form-error]:not([hidden]) { animation: errin 180ms var(--ease-out) both; }
@keyframes errin { from { opacity: 0; transform: translateY(-3px); } }
.check input, .filter-item input, label.row > input[type='checkbox'], label.row > input[type='radio'] {
  -webkit-appearance: none; appearance: none; position: relative; flex: none; width: 20px; height: 20px; margin: 1px 0 0; border: 1.5px solid var(--line-strong); border-radius: 6px; background: var(--surface); cursor: pointer; transition: transform 120ms var(--ease);
}
label.row > input[type='radio'] { border-radius: 50%; }
.check input::before, .filter-item input::before, label.row > input[type='checkbox']::before, label.row > input[type='radio']::before { content: ''; position: absolute; inset: -1.5px; border-radius: inherit; background: var(--brand); opacity: 0; transition: opacity 160ms var(--ease); }
.check input::after, .filter-item input::after, label.row > input[type='checkbox']::after { content: ''; position: absolute; left: 5.5px; top: 1.5px; width: 6px; height: 11px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg) scale(0.4); opacity: 0; transition: transform 200ms var(--spring), opacity 120ms var(--ease); }
label.row > input[type='radio']::after { content: ''; position: absolute; left: 4.5px; top: 4.5px; width: 8px; height: 8px; border-radius: 50%; background: #fff; transform: scale(0.4); opacity: 0; transition: transform 200ms var(--spring), opacity 120ms var(--ease); }
.check input:checked::before, .filter-item input:checked::before, label.row > input:checked::before { opacity: 1; }
.check input:checked::after, .filter-item input:checked::after, label.row > input[type='checkbox']:checked::after { opacity: 1; transform: rotate(45deg) scale(1); }
label.row > input[type='radio']:checked::after { opacity: 1; transform: scale(1); }
.check input:active, .filter-item input:active, label.row > input:active { transform: scale(0.92); }
.check input:focus-visible, .filter-item input:focus-visible, label.row > input:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
  .btn:active, .icon-btn:active, .set-row:active, .chip:active, a.card:active, button.card:active, a.list-item:active, button.list-item:active, .nav-a:active { transform: none; }
}
