@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 400 700; font-display: swap; src: url('./fonts/jetbrains-mono-cyrillic.woff2?v=1') format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 400 700; font-display: swap; src: url('./fonts/jetbrains-mono-latin-ext.woff2?v=1') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 400 700; font-display: swap; src: url('./fonts/jetbrains-mono-latin.woff2?v=1') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Onest'; font-style: normal; font-weight: 400 800; font-display: swap; src: url('./fonts/onest-cyrillic.woff2?v=1') format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Onest'; font-style: normal; font-weight: 400 800; font-display: swap; src: url('./fonts/onest-latin-ext.woff2?v=1') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Onest'; font-style: normal; font-weight: 400 800; font-display: swap; src: url('./fonts/onest-latin.woff2?v=1') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Unbounded'; font-style: normal; font-weight: 500 800; font-display: swap; src: url('./fonts/unbounded-cyrillic.woff2?v=1') format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Unbounded'; font-style: normal; font-weight: 500 800; font-display: swap; src: url('./fonts/unbounded-latin-ext.woff2?v=1') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Unbounded'; font-style: normal; font-weight: 500 800; font-display: swap; src: url('./fonts/unbounded-latin.woff2?v=1') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
/* GERDA: two themes. Light (default, owner's mockup): yellow hero, bold Unbounded, black cards. Black: the same layout on #0e0e0e with one yellow accent. Switched in the header, remembered per device. */
:root {
  --bg: #ffffff;
  --surface: #f5f5f3;
  --surface-2: #ebebe8;
  --line: #ebebe7;
  --line-strong: #d6d6d0;
  --text: #141414;
  --text-2: #3b3b3b;
  --muted: #77776f;
  --accent: #ffd84d;
  --accent-press: #f2c40f;
  --on-accent: #141414;
  --ink: #141414;
  --ink-2: #262626;
  --on-ink: #ffffff;
  --ink-muted: #9d9d97;
  --btn: #141414;
  --btn-text: #ffffff;
  --go-bg: #141414;
  --go-fg: #ffd84d;
  --sel-bg: #141414;
  --sel-fg: #ffffff;
  --progress: #141414;
  --hero: #ffd84d;
  --hero-text: #141414;
  --hero-muted: rgba(20, 20, 20, .66);
  --hero-line: rgba(20, 20, 20, .16);
  --success: #1c7f45;
  --danger: #cf3a1c;
  --warn: #bf6400;
  --info: #2b59d1;
  --focus: #141414;
  --font: "Onest", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-display: "Unbounded", "Onest", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --font-num: var(--font-display);
  --num-weight: 800;
  --r-lg: 20px;
  --r: 16px;
  --r-sm: 12px;
  --tabbar-h: 62px;
  --safe-top: max(8px, env(safe-area-inset-top), var(--tg-content-safe-area-inset-top, 0px));
  --safe-bottom: max(8px, env(safe-area-inset-bottom), var(--tg-content-safe-area-inset-bottom, 0px));
  color-scheme: light;
}
[data-theme="dark"] {
  --bg: #0e0e0e;
  --surface: #171717;
  --surface-2: #222222;
  --line: #242424;
  --line-strong: #363636;
  --text: #efefef;
  --text-2: #cdcdcd;
  --muted: #8a8a8a;
  --ink: #171717;
  --ink-2: #222222;
  --on-ink: #efefef;
  --ink-muted: #8a8a8a;
  --btn: #ffd84d;
  --btn-text: #0e0e0e;
  --go-bg: #ffd84d;
  --go-fg: #0e0e0e;
  --sel-bg: #ffd84d;
  --sel-fg: #0e0e0e;
  --progress: #ffd84d;
  --hero: transparent;
  --hero-text: #efefef;
  --hero-muted: #8a8a8a;
  --hero-line: #2a2a2a;
  --success: #4fd385;
  --danger: #ff6d4d;
  --warn: #ffb224;
  --info: #7ea3ff;
  --focus: #ffd84d;
  --num-weight: 500;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); -webkit-text-size-adjust: 100%; }
body { margin: 0; min-width: 320px; color: var(--text); background: var(--bg); font: 15px/1.5 var(--font); font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
h1, h2, h3 { margin: 0; font-family: var(--font-display); font-weight: 800; line-height: 1.12; letter-spacing: -.01em; }
p { margin: 0; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; text-align: inherit; }
button:disabled { opacity: .45; cursor: default; }
button, summary { touch-action: manipulation; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
img { display: block; max-width: 100%; }
.icon { width: 20px; height: 20px; flex-shrink: 0; display: inline-block; vertical-align: middle; }
.symbol { font-size: 20px; line-height: 1; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mono, .stage-count, .step-index { font-family: var(--font-mono); }

/* ---------------------------------------------------------------- shell */
.app-shell { max-width: 640px; margin: 0 auto; padding: var(--safe-top) 16px 24px; min-height: 100svh; display: flex; flex-direction: column; }
body.has-tabbar .app-shell { padding-bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 24px); }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0 16px; }
body[data-view="hub"] .topbar { display: none; }
.logo { font-family: var(--font-display); font-weight: 800; font-size: 21px; letter-spacing: -.02em; line-height: 1; color: var(--text); }
.topbar-side, .hero-side { display: flex; align-items: center; gap: 8px; }
.rate-chip { padding: 7px 11px; border-radius: 999px; border: 1px solid var(--line-strong); font-size: 12px; font-weight: 600; line-height: 1; white-space: nowrap; }
.rate-chip[hidden] { display: none; }
.user-avatar { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--ink); color: var(--accent); font-size: 13px; font-weight: 700; }
[data-theme="dark"] .user-avatar { background: var(--surface-2); }
.main { flex: 1; min-width: 0; }
.page, .home-view, .wizard-view, .result-view { animation: page-in .24s ease-out both; }

.tabbar { position: fixed; z-index: 20; left: 50%; bottom: 0; transform: translateX(-50%); width: 100%; max-width: 640px; display: flex; overflow: hidden; padding: 4px 6px calc(4px + var(--safe-bottom)); background: var(--bg); border-top: 1px solid var(--line); }
.tabbar[hidden] { display: none; }
.tab-button { position: relative; flex: 1; display: grid; justify-items: center; gap: 2px; min-height: 54px; padding: 8px 2px 4px; color: var(--muted); }
.tab-button.active { color: var(--text); }
.tab-icon { position: relative; display: grid; place-items: center; height: 24px; }
.tab-icon .icon { width: 23px; height: 23px; }
.tab-label { font-size: 13px; font-weight: 500; line-height: 1.1; }
.tab-badge { position: absolute; top: -5px; left: 14px; min-width: 17px; height: 17px; padding: 0 4px; display: grid; place-items: center; border-radius: 99px; background: var(--text); color: var(--bg); font: 600 10px/1 var(--font-mono); }
.tab-badge.alert { background: var(--danger); color: #fff; }

/* ---------------------------------------------------------------- shared pieces */
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 12px 18px; border-radius: 14px; font-size: 15px; font-weight: 700; line-height: 1.2; text-align: center; transition: transform .1s, background-color .15s, opacity .15s; }
.button:active:not(:disabled) { transform: scale(.98); }
.button .icon { width: 18px; height: 18px; }
.button-primary { flex: 1; background: var(--btn); color: var(--btn-text); }
.button-secondary { background: var(--surface); color: var(--text); }
.button-ghost { background: transparent; border: 1.5px solid var(--line-strong); color: var(--text); }
.button-ghost.danger { color: var(--danger); }
.button.danger-fill { background: var(--danger); color: #fff; }
.button.small { flex: none; min-height: 38px; padding: 8px 12px; border-radius: 11px; font-size: 13px; }
.button.small .icon { width: 16px; height: 16px; }
.text-button, .text-link { display: inline-flex; align-items: center; gap: 6px; color: var(--text); font-size: 13px; font-weight: 700; padding: 4px 0; text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 4px; text-decoration-color: var(--accent); }
.text-button .icon, .text-link .icon { width: 15px; height: 15px; }
.inline-link { color: var(--text); font-weight: 700; text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.icon-button { display: inline-grid; place-items: center; min-width: 34px; height: 34px; padding: 0 9px; border-radius: 10px; background: var(--bg); color: var(--text-2); font-size: 12px; font-weight: 600; }
.icon-button .icon { width: 16px; height: 16px; }
.icon-button.danger { color: var(--danger); }
.back-link { display: inline-flex; align-items: center; gap: 6px; margin: 0 0 12px; padding: 6px 0; color: var(--muted); font-size: 14px; font-weight: 600; }
.back-link .icon { width: 18px; height: 18px; }
.eyebrow { color: var(--muted); font-size: 13px; font-weight: 500; }
.section-kicker { color: var(--muted); font: 500 11px/1.4 var(--font-mono); letter-spacing: .06em; text-transform: uppercase; }
.section-title, .section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 28px 0 12px; }
.section-title h2, .section-heading h2 { font-size: 18px; }
.section-hint { color: var(--muted); font-size: 12px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 4px 0 20px; }
.page-head h1 { margin-top: 6px; font-size: 26px; }
.page-head p { margin-top: 8px; color: var(--muted); font-size: 14px; }
.page-head-icon { display: none; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.status-pill { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; font-weight: 600; white-space: nowrap; }
.status-pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status-new { color: var(--info); }
.status-warehouse { color: var(--warn); }
.status-purchased, .status-china_transit, .status-shipping { color: var(--success); }
.status-completed { color: var(--muted); }
.status-cancelled { color: var(--danger); }
.platform-tag { display: inline-flex; align-self: flex-start; justify-self: start; padding: 2px 7px; border-radius: 6px; background: var(--accent); color: var(--on-accent); font-size: 11px; font-weight: 700; }
.image-empty { display: grid; place-items: center; background: var(--surface-2); color: var(--muted); }
.image-empty .icon { width: 40%; height: 40%; max-width: 26px; max-height: 26px; opacity: .6; }
.count-badge { display: inline-grid; place-items: center; min-width: 24px; height: 24px; padding: 0 7px; border-radius: 99px; background: var(--text); color: var(--bg); font: 600 12px/1 var(--font-mono); }
.chevron { width: 18px; height: 18px; color: var(--muted); }
.empty-state { padding: 34px 22px; text-align: center; border-radius: var(--r-lg); background: var(--surface); }
.empty-state.compact { padding: 26px 18px; }
.empty-icon { display: inline-grid; place-items: center; width: 54px; height: 54px; border-radius: 16px; background: var(--accent); color: var(--on-accent); }
.empty-icon .icon { width: 26px; height: 26px; }
.empty-state h2 { margin: 16px 0 6px; font-size: 19px; }
.empty-state p { max-width: 330px; margin: 0 auto 18px; color: var(--muted); font-size: 14px; }
.empty-state.compact p { margin-bottom: 0; }
.empty-inline { padding: 22px; border: 1.5px dashed var(--line-strong); border-radius: var(--r); color: var(--muted); font-size: 14px; text-align: center; }
.list-caption { margin: 22px 2px 10px; color: var(--muted); font: 500 11px/1.4 var(--font-mono); letter-spacing: .06em; text-transform: uppercase; }
.list-caption:first-child { margin-top: 2px; }
.skeleton, .skeleton-line { background: linear-gradient(100deg, var(--surface-2) 30%, var(--line-strong) 50%, var(--surface-2) 70%); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; }
.skeleton-line { display: block; height: 12px; border-radius: 6px; margin: 6px 0; }
.skeleton-line.short { width: 55%; }

/* ---------------------------------------------------------------- hub */
.hero { margin: calc(-1 * var(--safe-top)) -16px 0; padding: calc(var(--safe-top) + 14px) 16px 58px; background: var(--hero); color: var(--hero-text); }
.hero .logo { color: var(--hero-text); }
.hero .rate-chip { border-color: var(--hero-line); }
.hero-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.hero-title { margin-top: 30px; font-size: 36px; line-height: 1.04; letter-spacing: -.02em; }
.hero-title em { font-style: normal; }
.hero-text { margin-top: 12px; max-width: 290px; color: var(--hero-text); font-size: 16px; line-height: 1.4; }
.link-field { position: relative; display: flex; align-items: center; gap: 8px; height: 68px; margin-top: -34px; padding: 0 7px 0 20px; border-radius: 20px; background: var(--bg); border: 1px solid var(--line-strong); box-shadow: 0 6px 20px rgba(20, 20, 20, .06); }
.link-field input { flex: 1; min-width: 0; height: 100%; border: 0; outline: none; background: transparent; font-size: 16px; }
.link-field input::placeholder { color: var(--muted); }
.link-field:focus-within { border-color: var(--text); }
.link-go { display: grid; place-items: center; width: 54px; height: 54px; flex: 0 0 54px; border-radius: 15px; background: var(--go-bg); color: var(--go-fg); }
.link-go .icon { width: 24px; height: 24px; }
.link-error { margin: 8px 4px 0; color: var(--danger); font-size: 13px; font-weight: 600; }
.link-error:empty { display: none; }
[data-theme="dark"] .hero-title em { color: var(--accent); }
[data-theme="dark"] .hero-text { color: var(--text-2); }
[data-theme="dark"] .link-field { background: var(--surface); border-color: var(--line-strong); box-shadow: none; }
[data-theme="dark"] .link-field:focus-within { border-color: var(--accent); }
.theme-toggle { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line-strong); color: var(--text); }
.hero .theme-toggle { border-color: var(--hero-line); color: var(--hero-text); }
.theme-toggle .icon { width: 18px; height: 18px; }
.row-link { display: flex; align-items: center; gap: 12px; width: 100%; margin-top: 10px; padding: 14px 14px 14px 16px; border-radius: var(--r); background: var(--surface); text-align: left; }
.row-link-copy { display: grid; flex: 1; gap: 1px; min-width: 0; }
.row-link-copy strong { font-size: 15px; font-weight: 700; }
.row-link-copy small { color: var(--muted); font-size: 13px; }
.row-link.draft { background: transparent; border: 1.5px dashed var(--line-strong); }
.stat-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 20px; }
.stat { display: grid; align-content: start; padding: 16px 16px 15px; border-radius: 18px; background: var(--surface); text-align: left; }
.stat b { font-family: var(--font-num); font-weight: var(--num-weight); font-size: 30px; line-height: 1.1; letter-spacing: -.02em; white-space: nowrap; }
.stat span { margin-top: 6px; color: var(--muted); font-size: 15px; line-height: 1.3; }
.focus-list { display: grid; gap: 10px; margin-top: 12px; }
.focus-list:empty { display: none; }
.focus-card { display: flex; align-items: center; gap: 16px; width: 100%; padding: 16px; border-radius: 22px; background: var(--ink); color: var(--on-ink); text-align: left; }
[data-theme="dark"] .focus-card { border: 1px solid var(--line); }
.focus-photo { width: 66px; height: 66px; flex: 0 0 66px; border-radius: 14px; object-fit: cover; background: #2a2a2a; }
.focus-photo.image-empty { color: #8a8a8a; }
.focus-body { display: grid; flex: 1; gap: 3px; min-width: 0; }
.focus-status { font-size: 15px; font-weight: 500; }
.focus-card .status-warehouse { color: var(--accent); }
.focus-card .status-completed { color: var(--ink-muted); }
.focus-body strong { font-size: 17px; font-weight: 600; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.focus-cta { flex: none; padding: 12px 15px; border-radius: 12px; background: var(--accent); color: var(--on-accent); font-size: 15px; font-weight: 700; }
.focus-card .chevron { color: var(--ink-muted); }
.pill-row { display: flex; gap: 12px; margin-top: 14px; }
.pill { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px; padding: 10px; border-radius: 16px; background: var(--surface); font-size: 16px; font-weight: 500; }
.pill .icon { width: 18px; height: 18px; }
.steps-list { margin: 0; padding: 0; list-style: none; }
.steps-list li { display: flex; gap: 14px; padding: 14px 2px; border-top: 1px solid var(--line); }
.steps-list li:last-child { border-bottom: 1px solid var(--line); }
.step-index { width: 22px; flex: none; padding-top: 1px; color: var(--muted); font-size: 13px; }
.steps-list strong { display: block; font-size: 15px; font-weight: 700; }
.steps-list small { display: block; margin-top: 2px; color: var(--muted); font-size: 13px; line-height: 1.45; }
.step-index { width: 22px; flex: none; padding-top: 1px; color: var(--muted); font-size: 13px; }

/* ---------------------------------------------------------------- forms */
.field-block { display: block; min-width: 0; margin: 0; }
.field-label { display: block; margin-bottom: 7px; color: var(--text); font-size: 13px; font-weight: 600; }
.field-label small { color: var(--muted); font-weight: 400; }
.field-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.text-input { display: block; width: 100%; min-height: 52px; padding: 13px 14px; border: 1.5px solid transparent; border-radius: 14px; background: var(--surface); color: var(--text); font-size: 16px; line-height: 1.4; outline: none; transition: border-color .15s; -webkit-appearance: none; appearance: none; }
textarea.text-input { resize: vertical; min-height: 84px; }
.link-input { min-height: 68px; font-size: 15px; word-break: break-all; }
select.text-input { padding-right: 40px; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%; background-size: 5px 5px; background-repeat: no-repeat; cursor: pointer; }
.text-input:focus { border-color: var(--focus); }
.text-input::placeholder { color: var(--muted); }
.text-input[aria-invalid="true"], .number-field input[aria-invalid="true"] { border-color: var(--danger); }
.field-hint { display: block; margin-top: 6px; color: var(--muted); font-size: 12px; line-height: 1.45; }
.field-hint:empty { display: none; }
.field-hint strong { color: var(--text); }
.hint-ok, .hint-warn { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; }
.hint-ok { color: var(--success); }
.hint-ok .icon { width: 14px; height: 14px; }
.hint-warn { color: var(--danger); }
.field-error { color: var(--danger); font-size: 13px; font-weight: 600; }
.field-error:empty { display: none; }
.field-note { display: flex; align-items: flex-start; gap: 8px; margin-top: 14px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.field-note .icon { width: 16px; height: 16px; flex: 0 0 16px; margin-top: 2px; }
.number-field { position: relative; display: block; }
.number-field input { width: 100%; height: 66px; padding: 0 54px 0 16px; border: 1.5px solid transparent; border-radius: 16px; background: var(--surface); color: var(--text); outline: none; font-family: var(--font-num); font-weight: var(--num-weight); font-size: 26px; letter-spacing: -.02em; }
.number-field input:focus { border-color: var(--focus); }
.number-field input::placeholder { color: var(--muted); opacity: .6; }
.number-unit { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 16px; font-weight: 600; }
.number-field.compact input { height: 52px; padding-right: 38px; border-radius: 14px; font-size: 19px; }
.number-field.compact .number-unit { right: 14px; font-size: 14px; }
.stepper { display: flex; height: 52px; overflow: hidden; border-radius: 14px; background: var(--surface); }
.stepper button { width: 46px; flex: 0 0 46px; font-size: 22px; text-align: center; color: var(--text); }
.stepper input { width: 100%; min-width: 0; border: 0; background: none; outline: none; text-align: center; font: var(--num-weight) 19px/1 var(--font-num); }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 7px 13px; border-radius: 999px; background: var(--surface); color: var(--text); font-size: 13px; font-weight: 600; transition: background .15s, color .15s; }
.chip.selected { background: var(--sel-bg); color: var(--sel-fg); }
.chip .icon { width: 15px; height: 15px; }
.chip.danger { color: var(--danger); }
.chip-count { display: inline-grid; place-items: center; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 99px; background: var(--bg); color: var(--text); font: 600 11px/1 var(--font-mono); }
.chip.urgent .chip-count { background: var(--danger); color: #fff; }
.check-row { display: flex; align-items: center; gap: 10px; font-size: 14px; cursor: pointer; }
.check-row input { width: 20px; height: 20px; flex: 0 0 20px; margin: 0; accent-color: var(--text); }
[data-theme="dark"] .check-row input { accent-color: var(--accent); }
.prefix-field { position: relative; display: block; }
.prefix-field > span { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 16px; font-weight: 600; }
.prefix-field .text-input { padding-left: 30px; }
.search-field { position: relative; margin-bottom: 12px; }
.search-field > .icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search-field .text-input { padding-left: 42px; }

/* ---------------------------------------------------------------- wizards */
.wizard-view { width: 100%; }
.wizard-head { margin: 0 0 18px; }
.wizard-card { padding: 0; background: transparent; }
.wizard-card .wizard-head { margin-bottom: 20px; }
.step-caption { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; color: var(--muted); font-size: 13px; font-weight: 500; }
.progress-row { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.progress-track { flex: 1; height: 4px; overflow: hidden; border-radius: 99px; background: var(--surface-2); }
.progress-bar { height: 100%; border-radius: inherit; background: var(--progress); transition: width .35s ease; }
.progress-label { color: var(--muted); font: 500 12px/1 var(--font-mono); white-space: nowrap; }
.wizard-title { font-size: 26px; outline: none; }
.wizard-help { margin-top: 8px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.wizard-actions { display: flex; gap: 8px; margin-top: 22px; }
.wizard-actions:empty { display: none; }
.order-form { display: grid; gap: 16px; }
.order-form .wizard-actions { margin-top: 4px; }
.price-preview { margin-top: -6px; color: var(--text-2); font-size: 13px; font-weight: 500; }
.price-preview:empty { display: none; }
.option-grid { display: grid; grid-template-columns: 1fr; gap: 8px; }
.option-card { display: flex; align-items: center; gap: 12px; min-height: 70px; padding: 12px 14px; border-radius: var(--r); background: var(--surface); border: 1.5px solid transparent; text-align: left; transition: border-color .15s; }
.option-card.selected { border-color: var(--focus); }
.option-icon { display: grid; place-items: center; width: 40px; height: 40px; flex: 0 0 40px; border-radius: 12px; background: var(--bg); color: var(--text); }
.option-copy { display: grid; gap: 2px; flex: 1; min-width: 0; }
.option-copy strong { font-size: 15px; font-weight: 700; line-height: 1.3; }
.option-copy small { color: var(--muted); font-size: 13px; line-height: 1.35; }
.option-chevron { color: var(--muted); }
.option-chevron .icon { width: 17px; height: 17px; }
.quick-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.quick-button { padding: 8px 12px; border-radius: 999px; background: var(--surface); font-size: 13px; font-weight: 600; }
.quick-button.selected { background: var(--sel-bg); color: var(--sel-fg); }
.calculator-rates { display: flex; gap: 8px; margin-bottom: 18px; overflow-x: auto; scrollbar-width: none; }
.calculator-rates::-webkit-scrollbar { display: none; }
.calculator-rate, .calculator-commission { flex: 0 0 auto; display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 14px; background: var(--surface); }
.calculator-rate-icon { display: none; }
.calculator-rate small, .calculator-commission small { display: block; color: var(--muted); font: 500 10px/1.4 var(--font-mono); letter-spacing: .06em; }
.calculator-rate strong, .calculator-commission strong { display: block; font-size: 14px; }
.calculator-commission { display: block; }
.calculator-commission > span { display: block; color: var(--muted); font-size: 11px; }
.side-panel { margin-top: 18px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.side-panel summary, .result-details summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 0; font-size: 14px; font-weight: 700; cursor: pointer; list-style: none; }
summary::-webkit-details-marker { display: none; }
.side-panel summary span { color: var(--muted); font-size: 13px; font-weight: 400; }
.side-panel[open] summary span { visibility: hidden; }
.summary-list { display: grid; gap: 8px; padding-bottom: 12px; }
.summary-item { display: flex; justify-content: space-between; gap: 14px; font-size: 13px; }
.summary-item small { color: var(--muted); font-size: 13px; }
.summary-item strong { text-align: right; }
.side-tip { padding-bottom: 14px; color: var(--muted); font-size: 12px; }
.item-list { display: grid; gap: 8px; }
.item-line { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 14px; background: var(--surface); }
.item-line-icon { font-size: 20px; }
.item-line-copy { display: grid; gap: 2px; flex: 1; min-width: 0; }
.item-line-copy strong { font-size: 14px; }
.item-line-copy small { color: var(--muted); font-size: 12px; }
.item-remove { display: grid; place-items: center; width: 34px; height: 34px; flex-shrink: 0; border-radius: 10px; background: var(--bg); color: var(--danger); font-size: 20px; }
.item-manager-actions, .dobro-actions { display: flex; gap: 8px; margin-top: 16px; }
.dobro-review { display: grid; gap: 12px; }
.dobro-entry-list { display: grid; gap: 8px; }
.dobro-item { padding: 14px; border-radius: var(--r); background: var(--surface); }
.dobro-item-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.dobro-item-head strong { font-size: 14px; }
.dobro-item-head .item-remove { margin-left: auto; width: 30px; height: 30px; }
.dobro-item-index { color: var(--muted); font: 500 12px/1 var(--font-mono); }
.dobro-saved-values { display: flex; flex-wrap: wrap; gap: 6px; }
.dobro-saved-values span { padding: 5px 9px; border-radius: 8px; background: var(--bg); color: var(--text-2); font-size: 12px; font-weight: 500; }
.dobro-line-total { display: flex; justify-content: space-between; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 12px; }
.dobro-line-total span { color: var(--muted); }
.dobro-empty { padding: 22px; border: 1.5px dashed var(--line-strong); border-radius: 14px; color: var(--muted); font-size: 14px; text-align: center; }
.dobro-preview, .estimate-card { padding: 16px; border-radius: var(--r-lg); background: var(--ink); color: var(--on-ink); }
[data-theme="dark"] .dobro-preview, [data-theme="dark"] .estimate-card { border: 1px solid var(--line); }
.dobro-preview-head { display: flex; align-items: center; gap: 9px; padding-bottom: 12px; border-bottom: 1px solid var(--ink-2); }
.dobro-preview-head strong, .dobro-preview-head small { display: block; }
.dobro-preview-head strong { font-size: 14px; }
.dobro-preview-head small { color: var(--ink-muted); font-size: 12px; }
.preview-pulse { width: 8px; height: 8px; flex: 0 0 8px; border-radius: 50%; background: var(--accent); animation: pulse 2.4s ease-in-out infinite; }
.dobro-preview-grid { display: grid; gap: 8px; padding: 12px 0; }
.dobro-preview-grid div, .estimate-row { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; }
.dobro-preview-grid span, .estimate-row span { color: var(--ink-muted); }
.dobro-preview-grid strong, .estimate-row strong { font-weight: 600; }
.estimate-row + .estimate-row { margin-top: 8px; }
.dobro-estimate-total, .estimate-total { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding-top: 12px; border-top: 1px solid var(--ink-2); }
.estimate-total { margin-top: 12px; }
.dobro-estimate-total span, .estimate-total span { font-size: 14px; font-weight: 600; }
.dobro-estimate-total strong, .estimate-total strong { color: var(--accent); font-family: var(--font-num); font-weight: var(--num-weight); font-size: 24px; letter-spacing: -.02em; }
.dobro-preview > p, .estimate-card > p { margin-top: 10px; color: var(--ink-muted); font-size: 12px; line-height: 1.5; }

/* ---------------------------------------------------------------- Goofish listing */
.listing { display: grid; gap: 12px; margin-top: -4px; padding: 12px; border-radius: var(--r-lg); background: var(--surface); animation: page-in .25s ease-out both; }
.listing-gallery { display: flex; gap: 6px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.listing-gallery::-webkit-scrollbar { display: none; }
.listing-shot { display: block; flex: 0 0 auto; width: 122px; height: 122px; overflow: hidden; border-radius: 12px; background: var(--surface-2); scroll-snap-align: start; }
.listing-gallery .listing-shot:first-child { width: 170px; height: 170px; }
.listing-shot img, .listing-shot .image-empty { width: 100%; height: 100%; object-fit: cover; }
.listing.loading { grid-template-columns: 92px minmax(0, 1fr); align-items: center; }
.listing.loading .listing-shot, .listing.loading .listing-gallery .listing-shot:first-child { width: 92px; height: 92px; }
/* Swipeable photos in the listing card; a tap opens the full-screen viewer. */
.gallery { position: relative; overflow: hidden; border-radius: 14px; background: var(--surface-2); }
.gallery-track { display: flex; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.gallery-track::-webkit-scrollbar { display: none; }
.gallery-slide { display: block; flex: 0 0 100%; aspect-ratio: 1 / 1; max-height: 420px; overflow: hidden; scroll-snap-align: center; scroll-snap-stop: always; background: var(--surface-2); cursor: zoom-in; }
.gallery-slide img, .gallery > .gallery-slide.image-empty { width: 100%; height: 100%; object-fit: cover; }
.gallery > .gallery-slide.image-empty { display: grid; place-items: center; cursor: default; }
.gallery-count { position: absolute; top: 10px; right: 10px; padding: 4px 9px; border-radius: 99px; background: rgba(0, 0, 0, .55); color: #fff; font: 600 12px/1.2 var(--font-mono); pointer-events: none; }
.gallery-dots { position: absolute; left: 0; right: 0; bottom: 10px; display: flex; justify-content: center; gap: 5px; pointer-events: none; }
.gallery-dots i { width: 6px; height: 6px; border-radius: 50%; background: rgba(255, 255, 255, .55); box-shadow: 0 0 0 1px rgba(0, 0, 0, .12); transition: width .2s, background-color .2s; }
.gallery-dots i.on { width: 16px; border-radius: 3px; background: #fff; }
.lightbox { position: fixed; z-index: 100; inset: 0; background: #000; animation: page-in .18s ease-out both; }
.lightbox-track { display: flex; height: 100%; overflow-x: auto; overscroll-behavior: contain; scroll-snap-type: x mandatory; scrollbar-width: none; }
.lightbox-track::-webkit-scrollbar { display: none; }
.lightbox-slide { display: grid; place-items: center; flex: 0 0 100%; height: 100%; scroll-snap-align: center; scroll-snap-stop: always; }
.lightbox-slide img { max-width: 100%; max-height: 100%; object-fit: contain; }
.lightbox-bar { position: absolute; top: 0; left: 0; right: 0; display: flex; align-items: center; justify-content: space-between; padding: calc(var(--safe-top) + 6px) 14px 10px; background: linear-gradient(rgba(0, 0, 0, .55), transparent); color: #fff; }
.lightbox-count { font: 600 14px/1 var(--font-mono); }
.lightbox-close { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: rgba(255, 255, 255, .16); color: #fff; }
.lightbox-close .icon { width: 22px; height: 22px; }
body.lightbox-open { overflow: hidden; }
.review-comment { margin-top: 22px; }
.listing-body { display: grid; gap: 4px; min-width: 0; }
.listing-source { display: inline-flex; align-items: center; gap: 5px; color: var(--success); font-size: 12px; font-weight: 600; }
.listing-source .icon { width: 15px; height: 15px; }
.listing.loading .listing-source { color: var(--text-2); }
.listing-title { font-size: 17px; font-weight: 700; line-height: 1.3; }
.listing-zh { color: var(--muted); font-size: 12px; line-height: 1.4; }
.listing-price { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin-top: 4px; }
.listing-price b { font-family: var(--font-num); font-weight: var(--num-weight); font-size: 26px; letter-spacing: -.02em; }
.listing-price span { color: var(--muted); font-size: 13px; }
.listing-warn { display: flex; gap: 8px; padding: 10px 12px; border-radius: 12px; background: var(--bg); color: var(--danger); font-size: 13px; font-weight: 600; line-height: 1.4; }
.listing-warn .icon { width: 18px; height: 18px; flex: 0 0 18px; }
.listing-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.listing-tags span { padding: 4px 9px; border-radius: 8px; background: var(--bg); color: var(--text-2); font-size: 12px; }
.listing-desc summary { font-size: 13px; font-weight: 700; cursor: pointer; list-style: none; padding: 4px 0; text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 1.5px; text-underline-offset: 4px; }
.listing-desc p { margin-top: 4px; color: var(--text-2); font-size: 13px; line-height: 1.55; white-space: pre-wrap; }
.listing-wait { color: var(--muted); font-size: 12px; line-height: 1.45; }
.listing.failed { display: flex; align-items: flex-start; gap: 8px; color: var(--text-2); font-size: 13px; line-height: 1.45; }
.listing.failed > .icon { width: 18px; height: 18px; flex: 0 0 18px; color: var(--warn); }
.listing.failed > span { flex: 1; }
.listing.failed .text-link { flex: none; padding: 0; }

/* ---------------------------------------------------------------- cart and review */
.order-cart { display: grid; gap: 10px; }
.cart-list { display: grid; gap: 8px; }
.cart-item { display: flex; gap: 12px; padding: 10px; border-radius: var(--r); background: var(--surface); }
.item-photo { width: 76px; height: 76px; flex: 0 0 76px; border-radius: 12px; object-fit: cover; background: var(--surface-2); }
.cart-body { display: grid; align-content: start; gap: 3px; flex: 1; min-width: 0; }
.cart-title { font-size: 14px; font-weight: 600; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cart-meta { display: flex; align-items: center; gap: 6px; min-width: 0; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cart-warn { display: inline-flex; align-items: center; gap: 4px; color: var(--danger); font-size: 12px; font-weight: 600; }
.cart-warn .icon { width: 14px; height: 14px; }
.cart-price { display: flex; align-items: baseline; gap: 8px; margin-top: 2px; }
.cart-price b { font-family: var(--font-num); font-weight: var(--num-weight); font-size: 16px; }
.cart-price small { color: var(--muted); font-size: 12px; }
.cart-actions { display: grid; align-content: start; gap: 6px; }
.add-more { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px; border-radius: 14px; border: 1.5px dashed var(--line-strong); font-size: 14px; font-weight: 600; }
.add-more .icon { width: 18px; height: 18px; }
.mini-items { display: grid; gap: 8px; }
.mini-item { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 14px; background: var(--surface); font-size: 13px; }
.mini-item .item-photo { width: 46px; height: 46px; flex-basis: 46px; border-radius: 10px; }
.mini-item-title { display: grid; flex: 1; min-width: 0; font-weight: 600; overflow-wrap: anywhere; }
.mini-item-title small { color: var(--muted); font-size: 12px; font-weight: 400; }
.mini-item strong { white-space: nowrap; font-size: 13px; font-weight: 600; }
.block-title-row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.block-title { margin: 26px 0 10px; font-size: 16px; }
.block-title-row .text-link { padding: 0; }

/* ---------------------------------------------------------------- results and order card */
.result-view, .order-view, .orders-view, .admin-view { width: 100%; }
.result-card { padding: 0; background: transparent; }
.result-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.result-check { display: grid; place-items: center; width: 46px; height: 46px; flex-shrink: 0; border-radius: 14px; background: var(--accent); color: var(--on-accent); animation: pop .35s ease-out .05s both; }
.result-title { margin-top: 4px; font-size: 22px; }
.success-hero { display: grid; justify-items: start; gap: 4px; margin: 4px 0 18px; }
.success-hero .result-check { width: 56px; height: 56px; border-radius: 16px; margin-bottom: 10px; }
.success-hero .result-check .icon { width: 28px; height: 28px; }
.success-hero .result-title { font-size: 30px; }
.success-photos { display: flex; gap: 6px; margin-top: 12px; }
.success-photo { width: 62px; height: 62px; border-radius: 12px; object-fit: cover; }
.total-block { padding: 18px; border-radius: var(--r-lg); background: var(--ink); color: var(--on-ink); }
[data-theme="dark"] .total-block { border: 1px solid var(--line); }
.total-block > span { color: var(--ink-muted); font-size: 13px; }
.total-value { margin: 6px 0 4px; color: var(--accent); font-family: var(--font-num); font-weight: var(--num-weight); font-size: clamp(32px, 9vw, 42px); line-height: 1.05; letter-spacing: -.03em; overflow-wrap: anywhere; }
.total-value small { font-size: .55em; }
.total-block p { color: var(--ink-muted); font-size: 13px; }
.breakdown { margin-top: 10px; }
.result-row { display: flex; justify-content: space-between; gap: 16px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.result-row:last-child { border-bottom: 0; }
.result-row span { color: var(--muted); }
.result-row strong { text-align: right; font-weight: 600; overflow-wrap: anywhere; }
.result-row.full { display: grid; gap: 4px; }
.result-row.full strong { text-align: left; }
.budget-summary { margin-top: 12px; padding: 4px 14px; border-radius: 14px; background: var(--surface); }
.separate-costs { margin-top: 12px; padding: 12px 14px 4px; border-radius: 14px; background: var(--surface); }
.separate-heading { color: var(--muted); font: 500 11px/1.4 var(--font-mono); letter-spacing: .04em; }
.result-alert { display: flex; align-items: flex-start; gap: 8px; margin: 14px 0; color: var(--text-2); font-size: 13px; line-height: 1.5; }
.result-alert .icon { width: 16px; height: 16px; flex: 0 0 16px; margin-top: 2px; }
.result-details { margin-top: 14px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.summary-chevron { width: 18px; height: 18px; color: var(--muted); transition: transform .2s; }
.result-details[open] .summary-chevron { transform: rotate(90deg); }
.result-details pre { margin: 0 0 14px; color: var(--text-2); font: 12px/1.7 var(--font-mono); white-space: pre-wrap; overflow-wrap: anywhere; }
.send-status { margin: 12px 0; color: var(--muted); font-size: 13px; }
.send-status:empty { display: none; }
.result-actions { display: grid; gap: 8px; margin-top: 18px; }
.result-actions:empty { display: none; }
.result-new { width: 100%; justify-content: center; margin-top: 12px; }
.result-order { width: 100%; margin-top: 10px; }
.next-steps { display: grid; margin: 18px 0 0; padding: 0; list-style: none; counter-reset: step; }
.next-steps li { counter-increment: step; display: grid; grid-template-columns: 30px 1fr; padding: 12px 0; border-top: 1px solid var(--line); }
.next-steps li::before { content: "0" counter(step); grid-row: span 2; color: var(--muted); font: 500 13px/1.5 var(--font-mono); }
.next-steps strong { font-size: 15px; }
.next-steps span { color: var(--muted); font-size: 13px; }
.order-hero { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.order-hero-photos { display: grid; flex: 0 0 76px; width: 76px; height: 76px; gap: 2px; overflow: hidden; border-radius: 16px; background: var(--surface-2); }
.order-hero-photos.count-2 { grid-template-columns: 1fr 1fr; }
.order-hero-photos.count-3, .order-hero-photos.count-4 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
.order-hero-photos.count-3 img:first-child { grid-row: span 2; }
.order-hero-photos img { width: 100%; height: 100%; object-fit: cover; }
.order-hero-icon { display: grid; place-items: center; width: 64px; height: 64px; flex: 0 0 64px; border-radius: 18px; background: var(--accent); color: var(--on-accent); }
.order-hero-icon.status-cancelled { background: var(--surface); color: var(--danger); }
.order-hero-copy { display: grid; justify-items: start; gap: 3px; min-width: 0; }
.status-text { margin-bottom: 16px; color: var(--text-2); font-size: 14px; line-height: 1.5; }
.stage-bar { margin: 0 0 18px; }
.stage-segments { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 4px; }
.stage-segments span { height: 6px; border-radius: 3px; background: var(--surface-2); }
.stage-segments .done { background: var(--text); }
.stage-segments .current { background: var(--accent); }
[data-theme="dark"] .stage-segments .done { background: var(--text-2); }
.stage-caption { display: flex; align-items: baseline; gap: 10px; margin-top: 10px; font-size: 14px; }
.stage-count { color: var(--muted); font-size: 12px; }
.stage-caption strong { font-weight: 700; }
.stage-caption span:last-child:not(.stage-count) { margin-left: auto; color: var(--muted); font-size: 13px; }
.stage-cancelled { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; padding: 12px 14px; border-radius: 14px; background: var(--surface); color: var(--danger); font-size: 14px; font-weight: 600; }
.pay-card { display: grid; gap: 10px; margin-bottom: 16px; padding: 18px; border-radius: var(--r-lg); background: var(--ink); color: var(--on-ink); }
[data-theme="dark"] .pay-card { border: 1px solid var(--line); }
.pay-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 14px; font-weight: 600; }
.pay-head > span { display: inline-flex; align-items: center; gap: 7px; }
.pay-head .icon { width: 18px; height: 18px; color: var(--accent); }
.pay-head small { color: var(--ink-muted); font-size: 12px; text-align: right; }
.pay-text { font-size: 15px; line-height: 1.5; }
.pay-hint { color: var(--ink-muted); font-size: 12px; line-height: 1.5; }
.pay-card .button-primary { width: 100%; background: var(--accent); color: var(--on-accent); }
.manager-note { display: flex; gap: 10px; margin-bottom: 16px; padding: 13px 14px; border-radius: var(--r); background: var(--surface); }
.manager-note > .icon { width: 18px; height: 18px; flex: 0 0 18px; margin-top: 2px; }
.manager-note small { color: var(--muted); font: 500 11px/1.4 var(--font-mono); letter-spacing: .04em; }
.manager-note p { margin-top: 2px; font-size: 14px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.track-card { display: grid; gap: 10px; margin-bottom: 16px; padding: 12px; border-radius: var(--r); background: var(--surface); }
.track-card .track-row { margin: 0; padding: 0; background: none; }
.track-carrier { margin-top: -6px; color: var(--muted); font-size: 12px; }
.track-card > .button { width: 100%; background: var(--bg); }
.track-result:empty { display: none; }
.track-state { display: flex; align-items: center; gap: 7px; font-size: 14px; font-weight: 600; }
.track-state .icon { width: 18px; height: 18px; flex: 0 0 18px; }
.track-state.done { color: var(--success); }
.track-state.muted { color: var(--muted); font-weight: 500; line-height: 1.45; }
.track-timeline { margin-top: 10px; }
.track-timeline li { color: var(--line-strong); }
.track-timeline li:first-child { color: var(--accent); }
.track-timeline strong { color: var(--text); font-weight: 500; line-height: 1.4; overflow-wrap: anywhere; }
.track-actions { display: flex; flex-wrap: wrap; gap: 16px; }
.track-row { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; padding: 10px 12px; border-radius: 14px; background: var(--surface); font-size: 14px; }
.track-row > span { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }
.track-row strong { margin-left: auto; font-family: var(--font-mono); font-weight: 500; overflow-wrap: anywhere; }
.order-items { display: grid; gap: 8px; }
.detail-item { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 8px 12px; padding: 10px; border-radius: var(--r); background: var(--surface); }
.detail-photo { width: 72px; height: 72px; overflow: hidden; border-radius: 12px; background: var(--surface-2); }
.detail-photo img, .detail-photo.image-empty { width: 100%; height: 100%; object-fit: cover; }
.detail-item-main { display: grid; align-content: start; gap: 3px; min-width: 0; }
.detail-item-main strong { font-size: 14px; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.detail-item-main small { color: var(--muted); font-size: 12px; }
.detail-price { display: flex; align-items: baseline; gap: 8px; margin-top: 2px; }
.detail-price b { font-family: var(--font-num); font-weight: var(--num-weight); font-size: 15px; }
.detail-price small { color: var(--muted); font-size: 12px; }
.detail-item-actions { display: flex; flex-wrap: wrap; gap: 16px; grid-column: 1 / -1; padding-top: 8px; border-top: 1px solid var(--line); }
.detail-item-actions .text-link { padding: 2px 0; font-size: 12px; }
.source-block { display: grid; gap: 4px; grid-column: 1 / -1; padding: 10px 12px; border-radius: 12px; background: var(--bg); color: var(--text-2); font-size: 12px; line-height: 1.45; }
.source-block > span:first-child { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.source-block .icon { width: 14px; height: 14px; }
.source-block b { font-weight: 700; }
.source-block em { color: var(--warn); font-style: normal; font-weight: 600; }
.source-warn { display: inline-flex; align-items: center; gap: 5px; color: var(--danger); font-weight: 600; }
.source-zh { display: flex; align-items: center; gap: 6px; color: var(--muted); }
.source-zh .icon-button { min-width: 28px; height: 28px; padding: 0 6px; background: var(--surface); }
.source-specs { color: var(--muted); }
.history { margin-top: 18px; }
.timeline { display: grid; margin: 4px 0 10px; padding: 0; list-style: none; }
.timeline li { position: relative; display: flex; gap: 12px; padding-bottom: 14px; }
.timeline li::before { content: ""; position: absolute; left: 4px; top: 14px; bottom: 0; width: 1.5px; background: var(--line-strong); }
.timeline li:last-child::before { display: none; }
.timeline-dot { width: 10px; height: 10px; flex: 0 0 10px; margin-top: 5px; border-radius: 50%; background: currentColor; }
.timeline li:first-child .timeline-dot { box-shadow: 0 0 0 4px color-mix(in srgb, currentColor 22%, transparent); }
.timeline-photo { display: block; width: 148px; height: 148px; margin-top: 8px; overflow: hidden; border-radius: 12px; background: var(--surface-2); cursor: zoom-in; }
.timeline-photo img { width: 100%; height: 100%; object-fit: cover; }
.timeline-photo.failed { display: inline-flex; align-items: center; gap: 6px; width: auto; height: auto; padding: 8px 10px; color: var(--muted); font-size: 12px; cursor: default; }
.timeline-photo.failed .icon { width: 16px; height: 16px; }
.timeline strong { display: block; font-size: 14px; }
.timeline small { color: var(--muted); font-size: 12px; }
.timeline p { margin-top: 3px; color: var(--text-2); font-size: 13px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }

/* ---------------------------------------------------------------- order lists */
.order-list { display: grid; gap: 8px; }
.order-card { display: flex; gap: 12px; width: 100%; padding: 10px; border-radius: 18px; background: var(--surface); border: 1.5px solid transparent; text-align: left; transition: transform .1s; }
.order-card:active { transform: scale(.99); }
.order-card.attention { border-color: var(--warn); }
.order-card-photo { width: 80px; height: 80px; flex: 0 0 80px; border-radius: 12px; object-fit: cover; background: var(--surface-2); }
.order-card-body { display: grid; align-content: start; gap: 4px; flex: 1; min-width: 0; }
.order-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.order-card-top strong { color: var(--muted); font: 500 12px/1.4 var(--font-mono); }
.order-card-title { display: flex; align-items: baseline; gap: 6px; min-width: 0; font-size: 15px; font-weight: 600; line-height: 1.3; }
.order-card-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.order-card-title small { flex: none; color: var(--muted); font-weight: 400; white-space: nowrap; }
.order-card-client { display: flex; align-items: center; gap: 5px; color: var(--text-2); font-size: 12px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.order-card-client .icon { width: 14px; height: 14px; }
.order-card-bottom { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 12px; }
.order-card-bottom > span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.order-card-bottom strong { color: var(--text); font-family: var(--font-num); font-weight: var(--num-weight); font-size: 15px; white-space: nowrap; }
.mini-progress { display: block; height: 4px; margin-top: 2px; overflow: hidden; border-radius: 9px; background: var(--surface-2); }
.mini-progress span { display: block; height: 100%; border-radius: inherit; background: var(--progress); }
.mini-progress.cancelled span { background: var(--line-strong); }

/* ---------------------------------------------------------------- admin */
.info-card { display: grid; padding: 2px 14px; border-radius: var(--r); background: var(--surface); }
.info-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
[data-theme="light"] .info-row { border-bottom-color: var(--surface-2); }
.info-row:last-child { border-bottom: 0; }
.info-row > span { display: inline-flex; align-items: center; gap: 7px; flex-shrink: 0; color: var(--muted); }
.info-row > span .icon { width: 16px; height: 16px; }
.info-row > strong { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 4px 8px; min-width: 0; text-align: right; font-weight: 600; overflow-wrap: anywhere; }
.info-row > strong small { flex-basis: 100%; color: var(--muted); font-size: 12px; font-weight: 400; }
.info-comment { display: flex; gap: 8px; padding: 11px 0; border-top: 1px solid var(--line); font-size: 14px; }
.info-comment .icon { width: 16px; height: 16px; flex: 0 0 16px; margin-top: 2px; }
.info-comment p { white-space: pre-wrap; overflow-wrap: anywhere; }
.admin-form { display: grid; gap: 14px; margin-top: 24px; padding: 16px; border-radius: var(--r-lg); background: var(--surface); scroll-margin-top: 12px; }
.admin-form .block-title { margin: 0; }
.admin-form .text-input, .admin-form .number-field input, .admin-form .chip { background: var(--bg); }
.admin-form .chip.selected { background: var(--sel-bg); color: var(--sel-fg); }
.quick-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.field-block[hidden] { display: none; }
.admin-form .wizard-actions { margin-top: 0; }

/* ---------------------------------------------------------------- calculator home */
.conditions-bar { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 6px; }
.rate-card { display: grid; min-width: 0; padding: 12px 14px; border-radius: var(--r); background: var(--surface); }
.rate-symbol { display: none !important; }
.rate-card > div { display: grid; min-width: 0; }
.rate-label { color: var(--muted); font: 500 10px/1.4 var(--font-mono); letter-spacing: .06em; }
.rate-card strong { margin-top: 2px; font-family: var(--font-num); font-weight: var(--num-weight); font-size: 17px; }
.rate-card small { margin-top: 2px; color: var(--muted); font-size: 11px; line-height: 1.35; }
.tariff-grid { display: grid; grid-template-columns: 1fr; gap: 8px; }
.tariff-card { display: flex; flex-direction: column; min-height: 0; padding: 16px; border-radius: var(--r-lg); background: var(--surface); text-align: left; transition: transform .1s; }
.tariff-card:active { transform: scale(.99); }
.tariff-top { display: flex; align-items: center; gap: 10px; }
.tariff-icon { display: none; }
.tariff-tag { color: var(--muted); font: 500 10px/1.4 var(--font-mono); letter-spacing: .06em; }
.tariff-number { margin-left: auto; color: var(--muted); font: 500 12px/1 var(--font-mono); }
.tariff-card h3 { margin: 10px 0 6px; font-size: 19px; }
.tariff-card p { color: var(--muted); font-size: 13px; line-height: 1.5; }
.tariff-bottom { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--surface-2); }
[data-theme="dark"] .tariff-bottom { border-top-color: var(--line); }
.tariff-bottom > span:first-child { display: grid; }
.tariff-bottom strong { font-size: 13px; }
.tariff-bottom small { color: var(--muted); font-size: 11px; }
.tariff-arrow { display: grid; place-items: center; width: 36px; height: 36px; flex: 0 0 36px; border-radius: 50%; background: var(--btn); color: var(--btn-text); }
.tariff-arrow .icon { width: 17px; height: 17px; }
.home-note { display: flex; align-items: center; gap: 6px; margin-top: 16px; color: var(--muted); font-size: 12px; }
.home-note .icon { width: 15px; height: 15px; }

/* ---------------------------------------------------------------- states */
.loader-card, .error-view { max-width: 420px; margin: 48px auto; padding: 28px 22px; border-radius: var(--r-lg); background: var(--surface); text-align: center; }
.loader-logo { display: grid; place-items: center; width: 50px; height: 50px; margin: 0 auto 20px; border-radius: 14px; background: var(--accent); color: var(--on-accent); font: 800 26px/1 var(--font-display); }
.loader-line { height: 3px; overflow: hidden; border-radius: 9px; background: var(--surface-2); }
.loader-line span { display: block; width: 45%; height: 100%; background: var(--progress); animation: loading 1s ease-in-out infinite alternate; }
.loader-card p, .error-view p { margin-top: 14px; color: var(--muted); font-size: 14px; }
.error-icon { display: inline-grid; place-items: center; width: 54px; height: 54px; border-radius: 16px; background: var(--accent); color: var(--on-accent); font-size: 26px; }
.error-icon .icon { width: 26px; height: 26px; }
.error-view h1 { margin: 16px 0 0; font-size: 21px; }
.error-view .button { width: 100%; margin-top: 18px; }
.toast { position: fixed; z-index: 30; left: 50%; bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 14px); max-width: calc(100% - 32px); padding: 12px 16px; border-radius: 14px; background: var(--text); color: var(--bg); font-size: 14px; font-weight: 600; opacity: 0; pointer-events: none; transform: translate(-50%, 10px); transition: opacity .18s, transform .18s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------------------------------------------------------------- motion */
@keyframes page-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: scale(.8); } to { opacity: 1; transform: none; } }
@keyframes pulse { 0%, 100% { opacity: .5; } 50% { opacity: 1; } }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@keyframes loading { from { transform: translateX(-100%); } to { transform: translateX(220%); } }
.motion-paused *, .motion-paused *::before, .motion-paused *::after { animation-play-state: paused !important; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

/* ---------------------------------------------------------------- narrow screens */
@media (max-width: 600px) {
  .page-head { flex-direction: column; align-items: flex-start; }
  #order-contact-form .field-pair { grid-template-columns: 1fr; gap: 16px; }
  .item-manager-actions, .dobro-actions { flex-direction: column; }
  .decision-actions .button-secondary { flex: auto; }
  .info-row { flex-direction: column; gap: 3px; }
  .info-row > strong { justify-content: flex-start; text-align: left; }
}
@media (max-width: 380px) {
  .app-shell { padding-left: 12px; padding-right: 12px; }
  .hero { margin-left: -12px; margin-right: -12px; padding-left: 12px; padding-right: 12px; }
  .hero-title { font-size: 31px; }
  .stat b { font-size: 25px; }
  .stat { padding: 14px; }
  .stat span { font-size: 14px; }
  .focus-card { gap: 12px; padding: 12px; }
  .focus-photo { width: 56px; height: 56px; flex-basis: 56px; }
  .focus-cta { padding: 10px 12px; font-size: 14px; }
  .topbar .rate-chip { display: none; }
  .order-card-photo { width: 68px; height: 68px; flex-basis: 68px; }
}
/* Grid text columns must shrink, or one long title pushes the card past the screen edge. */
.order-card-body, .focus-body, .cart-body, .detail-item-main, .listing-body, .row-link-copy, .option-copy, .item-line-copy, .order-hero-copy, .mini-item-title { grid-template-columns: minmax(0, 1fr); }

/* ---------------------------------------------------------------- status picker (admin) */
.status-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.status-choice { position: relative; display: flex; align-items: center; gap: 8px; min-height: 46px; padding: 9px 11px; border-radius: 12px; background: var(--bg); border: 1.5px solid transparent; text-align: left; transition: background-color .15s, border-color .15s; }
.status-choice-copy { flex: 1; min-width: 0; display: grid; gap: 4px; justify-items: start; }
.status-choice-title { font-size: 13px; font-weight: 600; line-height: 1.25; overflow-wrap: break-word; hyphens: auto; }
.status-choice small { padding: 2px 6px; border-radius: 6px; background: var(--surface-2); color: var(--muted); font-size: 10px; font-weight: 600; line-height: 1.3; }
.status-choice.selected { border-color: var(--text); }
.status-choice.selected .status-choice-title { font-weight: 700; }
.status-dot { width: 10px; height: 10px; flex: 0 0 10px; border-radius: 50%; background: currentColor; }
.status-hint { margin-top: 8px; color: var(--muted); font-size: 13px; line-height: 1.45; }
.status-hint:empty { display: none; }

/* ---------------------------------------------------------------- admin settings */
.stat-row.stat-row-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0 0 16px; }
.stat-row-3 .stat b { font-size: 24px; }
.stat-row-3 .stat span { font-size: 13px; }
.settings-card { display: grid; gap: 14px; margin-top: 12px; padding: 16px; border-radius: var(--r-lg); background: var(--surface); }
.settings-card .block-title { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 17px; }
.settings-card .block-title .icon { width: 20px; height: 20px; }
.settings-card .text-input, .settings-card .number-field input, .settings-card .button-secondary { background: var(--bg); }
.settings-card .field-error:empty { display: none; }
.settings-help { color: var(--muted); font-size: 13px; line-height: 1.45; }
.field-trio { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.field-trio .number-field input { padding-right: 30px; }
.admin-people { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.admin-people li { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; background: var(--bg); }
.admin-person { display: grid; flex: 1; min-width: 0; }
.admin-person strong { overflow: hidden; font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }
.admin-person small { color: var(--muted); font: 500 12px/1.4 var(--font-mono); }
.tag { flex: none; padding: 3px 8px; border-radius: 7px; background: var(--surface-2); color: var(--muted); font-size: 11px; font-weight: 700; }
.admin-add { display: flex; gap: 8px; }
.admin-add .text-input { flex: 1; min-width: 0; }
.admin-add .button { flex: none; min-height: 50px; }
@media (max-width: 380px) {
  .field-trio { grid-template-columns: 1fr 1fr; }
  .stat-row-3 .stat b { font-size: 20px; }
}

/* ---------------------------------------------------------------- admin queue: tiles, chips, quick payment, clients */
.board { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.board-tile { display: grid; gap: 2px; padding: 12px 14px 13px; border-radius: 18px; background: var(--surface); border: 2px solid transparent; text-align: left; transition: border-color .15s, background-color .15s; }
.board-top { display: flex; align-items: center; justify-content: space-between; color: var(--muted); }
.board-top .icon { width: 20px; height: 20px; }
.board-top b { color: var(--text); font-family: var(--font-num); font-weight: var(--num-weight); font-size: 26px; line-height: 1.1; }
.board-label { margin-top: 4px; font-size: 14px; font-weight: 700; line-height: 1.25; }
.board-tile small { color: var(--muted); font-size: 12px; }
.board-tile.urgent { background: var(--accent); }
.board-tile.urgent .board-top, .board-tile.urgent small { color: rgba(20, 20, 20, .66); }
.board-tile.urgent .board-top b, .board-tile.urgent .board-label { color: #141414; }
.board-tile.selected { border-color: var(--text); }
.filter-chips { margin: 10px 0 14px; }
.filter-chips .chip.selected .chip-count { background: var(--sel-fg); color: var(--sel-bg); }
.filter-banner { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; padding: 10px 10px 10px 14px; border-radius: 14px; background: var(--surface); font-size: 14px; }
.filter-banner > span { flex: 1; min-width: 0; }
.filter-banner > .icon { width: 18px; height: 18px; color: var(--muted); }
.admin-row { display: grid; gap: 0; }
.admin-row .order-card { position: relative; z-index: 1; }
.client-list { display: grid; gap: 8px; }
.client-card { display: grid; gap: 12px; padding: 14px; border-radius: 18px; background: var(--surface); }
.client-head { display: flex; align-items: center; gap: 12px; }
.client-head .user-avatar { width: 42px; height: 42px; font-size: 16px; }
.client-main { display: grid; flex: 1; gap: 1px; min-width: 0; }
.client-main strong { display: flex; align-items: center; gap: 6px; overflow: hidden; font-size: 16px; text-overflow: ellipsis; white-space: nowrap; }
.client-main small { color: var(--muted); font-size: 13px; }
.client-main small:first-of-type { font-family: var(--font-mono); font-size: 12px; }
.client-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.client-actions .button { background: var(--bg); }
.client-message { display: grid; gap: 8px; }
.client-message .text-input { background: var(--bg); }
.client-message .field-error:empty { display: none; }
.client-message[hidden] { display: none; }
.gallery-nav { display: none; }
@media (hover: hover) and (pointer: fine) {
  .gallery-nav { position: absolute; z-index: 2; top: 50%; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: rgba(0, 0, 0, .55); color: #fff; transform: translateY(-50%); opacity: .85; transition: opacity .15s; }
  .gallery-nav:hover { opacity: 1; }
  .gallery-nav .icon { width: 20px; height: 20px; }
  .gallery-nav.prev { left: 10px; }
  .gallery-nav.next { right: 10px; }
  .lightbox .gallery-nav { width: 48px; height: 48px; background: rgba(255, 255, 255, .16); }
  .lightbox .gallery-nav.prev { left: 16px; }
  .lightbox .gallery-nav.next { right: 16px; }
}
.broadcast-form { display: grid; gap: 12px; }
.broadcast-form[hidden], .settings-card [hidden] { display: none; }
.broadcast-actions { display: flex; gap: 8px; }
.broadcast-actions .button-secondary { flex: none; }
