/* Color tokens. Light by default; dark when the system asks for it (unless the user chose light)
   or when the user chose dark (public/theme.js sets data-theme on <html>).
   The brand is Argentine celeste, a few shades deeper than the icon's (#2b7fc4) so white text on it
   stays readable (WCAG AA). Chart series 2 is amber so it never looks like series 1 (the brand). */
:root {
  --bg: #f4f4f6;
  --card: #ffffff;
  --text: #1b1b1f;
  --muted: #5d5d66;
  --line: #e2e2e8;
  --brand: #1667a8;
  --brand-ink: #ffffff;
  --brand-soft: #e7f1fa;
  --ok: #0f7a40;
  --ok-bg: #e3f5ea;
  --warn: #85500a;
  --warn-bg: #fff2d3;
  --err: #b4231a;
  --err-bg: #fde8e6;
  --info: #1d5fb8;
  --info-bg: #e6f0fd;
  --chip: #ececf1;
  --prime: #6a3bee;
  --toast: #26262b;
  --toast-ok: #0f7a40;
  --toast-err: #b4231a;
  --focus: color-mix(in srgb, var(--brand) 55%, transparent);
  --bar: #ffffff;
  --radius: 16px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(20, 20, 30, .05), 0 4px 14px rgba(20, 20, 30, .05);
  --header-h: 56px;
  --nav-h: 66px;
  --series-1: #1667a8; --series-2: #d97706; --series-3: #9ca3af; --series-4: #7c3aed;
  /* market verdicts */
  --v-top: #047857; --v-good: #1d4ed8; --v-par: #57606f; --v-regular: #9a5700; --v-fake: #b4231a;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #101013; --card: #1a1a1f; --text: #f1f1f5; --muted: #b0b0ba; --line: #2d2d34; --brand-soft: #132a3d;
    --brand: #6cb4ee; --brand-ink: #06121f;
    --chip: #2a2a31; --ok-bg: #12301f; --warn-bg: #3a2e10; --err-bg: #3a1714; --info-bg: #14283f;
    --ok: #4cd08a; --warn: #f0c060; --err: #ff8478; --info: #7db4ff;
    --prime: #a78bfa; --toast: #33333a; --bar: #1a1a1f;
    --series-1: #6cb4ee; --series-2: #f59e0b; --series-3: #6b7280; --series-4: #a78bfa;
    --v-top: #34d399; --v-good: #7aa7ff; --v-par: #a7b0bf; --v-regular: #fbbf24; --v-fake: #ff8478;
    --shadow: none; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #101013; --card: #1a1a1f; --text: #f1f1f5; --muted: #b0b0ba; --line: #2d2d34; --brand-soft: #132a3d;
  --brand: #6cb4ee; --brand-ink: #06121f;
  --chip: #2a2a31; --ok-bg: #12301f; --warn-bg: #3a2e10; --err-bg: #3a1714; --info-bg: #14283f;
  --ok: #4cd08a; --warn: #f0c060; --err: #ff8478; --info: #7db4ff;
  --prime: #a78bfa; --toast: #33333a; --bar: #1a1a1f;
  --series-1: #6cb4ee; --series-2: #f59e0b; --series-3: #6b7280; --series-4: #a78bfa;
  --v-top: #34d399; --v-good: #7aa7ff; --v-par: #a7b0bf; --v-regular: #fbbf24; --v-fake: #ff8478;
  --shadow: none; color-scheme: dark;
}

/* Text size: the user's own choice (Settings); everything is in rem, so it all grows together. */
html { font-size: 100%; }
html[data-text="large"] { font-size: 112.5%; }
html[data-text="xlarge"] { font-size: 125%; }

* { box-sizing: border-box; }
/* Author display rules (flex, grid) must not override the hidden attribute. */
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--text);
  font: 1rem/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); }
h2 { font-size: 1.55rem; line-height: 1.2; margin: .3rem 0 .4rem; letter-spacing: -.01em; }
h3 { font-size: 1.15rem; line-height: 1.3; margin: 0 0 .6rem; display: flex; align-items: center; gap: .45rem; flex-wrap: wrap; }
h4 { margin: 1rem 0 .4rem; font-size: 1rem; }
hr { border: 0; border-top: 1px solid var(--line); margin: .8rem 0; }
pre { white-space: pre-wrap; font: inherit; margin: .3rem 0; }
p { margin: .4rem 0; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.strong { font-weight: 600; }
.ok-text { color: var(--ok); }
.grow { flex: 1; min-width: 0; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.page { max-width: 760px; margin: 0 auto; }
.lead { font-size: 1.05rem; color: var(--muted); margin: 0 0 1rem; }

/* ---- icons ---- */
.icon { display: inline-flex; width: 1.25em; height: 1.25em; flex: 0 0 auto; vertical-align: -.25em; }
.icon svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.icon.fill svg { fill: currentColor; stroke: none; }
.icon.bold svg { stroke-width: 2.8; }
.icon.lg { width: 1.6em; height: 1.6em; }

/* ---- shell ---- */
header.top {
  position: sticky; top: 0; z-index: 20; background: var(--card); border-bottom: 1px solid var(--line);
  padding: calc(.5rem + env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left));
}
.top-row { display: flex; align-items: center; gap: .5rem; min-height: 44px; max-width: 1100px; margin: 0 auto; }
.brand { display: inline-flex; align-items: center; gap: .45rem; font-weight: 800; color: var(--text); text-decoration: none; font-size: 1.15rem; letter-spacing: -.01em; }
.brand-mark { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: var(--brand); color: var(--brand-ink); }
.brand-mark .icon { width: 18px; height: 18px; }
.brand-mark.app { background: none; border-radius: 0; width: 34px; height: 34px; }
.brand-mark.app img { width: 100%; height: 100%; display: block; }
.top-actions { display: flex; align-items: center; gap: .35rem; margin-left: auto; flex: 0 0 auto; }
.top-row .pills { flex: 0 1 auto; }
@media (max-width: 799px) { .desk-only { display: none !important; } }
@media (max-width: 560px) { .top-row.has-pills .brand-name { display: none; } }
.who { color: var(--muted); font-size: .9rem; text-decoration: none; white-space: nowrap; max-width: 160px; overflow: hidden; text-overflow: ellipsis; }
.who:hover { color: var(--text); }
header.top .banner { margin: .4rem 0; }
.pills { display: flex; gap: .4rem; flex-wrap: nowrap; min-width: 0; overflow: hidden; }
.addr-bar {
  display: flex; align-items: center; gap: .55rem; width: 100%; max-width: 1100px; margin: .1rem auto .5rem; text-align: left;
  border: 1px solid var(--line); background: var(--bg); color: var(--text); border-radius: var(--radius-sm);
  padding: .45rem .75rem; cursor: pointer; font: inherit; min-height: 44px;
}
.addr-bar:hover { border-color: var(--muted); }
.addr-bar .icon { color: var(--brand); }
.addr-text { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.25; }
.addr-cap { font-size: .75rem; color: var(--muted); }
.addr-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.addr-by { color: var(--muted); white-space: nowrap; font-size: .8rem; font-weight: 400; }
.addr-change { color: var(--brand); font-weight: 600; font-size: .9rem; white-space: nowrap; }
.addr-bar.empty { border-color: var(--warn); background: var(--warn-bg); color: var(--warn); }
.addr-bar.empty .icon, .addr-bar.empty .addr-change { color: var(--warn); }

/* Navigation: tabs under the header on a wide screen, a bar at the bottom of a phone. */
nav.nav { display: flex; gap: .15rem; max-width: 1100px; margin: 0 auto; padding: 0 0 .35rem; overflow-x: auto; scrollbar-width: none; }
.nav-item {
  position: relative; display: inline-flex; align-items: center; gap: .4rem; padding: .5rem .85rem; border-radius: 999px;
  color: var(--muted); text-decoration: none; font-weight: 600; white-space: nowrap; min-height: 44px;
}
.nav-item:hover { color: var(--text); background: var(--chip); }
.nav-item.active { background: var(--brand); color: var(--brand-ink); }
.nav-item .icon { width: 1.2em; height: 1.2em; }
.nav-badge {
  display: inline-grid; place-items: center; min-width: 1.35rem; height: 1.35rem; padding: 0 .35rem; border-radius: 999px;
  background: var(--brand); color: var(--brand-ink); font-size: .75rem; font-weight: 700; line-height: 1;
}
.nav-item.active .nav-badge { background: var(--brand-ink); color: var(--brand); }
@media (max-width: 799px) {
  nav.nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; margin: 0; max-width: none; overflow: visible; gap: 0;
    background: var(--card); border-top: 1px solid var(--line);
    padding: .25rem max(6px, env(safe-area-inset-right)) calc(.25rem + env(safe-area-inset-bottom)) max(6px, env(safe-area-inset-left));
    box-shadow: 0 -4px 18px rgba(20, 20, 30, .06);
  }
  .nav-item { flex: 1 1 0; flex-direction: column; justify-content: center; gap: .1rem; padding: .35rem .2rem; border-radius: 12px; font-size: .74rem; min-height: 54px; background: none; }
  .nav-item:hover { background: none; }
  .nav-item .icon { width: 1.6rem; height: 1.6rem; }
  .nav-item.active { background: none; color: var(--brand); }
  .nav-item.active .icon { background: var(--brand-soft); border-radius: 10px; padding: 3px; width: 2.4rem; height: 1.8rem; }
  .nav-item .nav-badge { position: absolute; top: 2px; left: calc(50% + .45rem); }
  .nav-item.active .nav-badge { background: var(--brand); color: var(--brand-ink); }
  .who { display: none; }
}
@media (min-width: 800px) {
  .nav-item .nav-label { display: inline; }
}
main { max-width: 1100px; margin: 0 auto; padding: 16px max(16px, env(safe-area-inset-right)) calc(150px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); }
main:focus { outline: none; }
@media (min-width: 800px) { main { padding-bottom: 80px; } }
.confirm-list { display: grid; grid-template-columns: auto 1fr; gap: .5rem 1rem; margin: 0; }
.confirm-list dt { color: var(--muted); }
.confirm-list dd { margin: 0; overflow-wrap: anywhere; }

/* Status pills in the header */
.lease-pill, .balance-pill {
  display: inline-flex; align-items: center; gap: .3rem; border-radius: 999px; padding: .3rem .7rem; font-weight: 600; font-size: .85rem;
  text-decoration: none; white-space: nowrap; min-height: 34px;
}
.lease-pill { background: var(--ok-bg); color: var(--ok); max-width: 210px; overflow: hidden; text-overflow: ellipsis; }
.lease-pill.ending { background: var(--warn-bg); color: var(--warn); }
.balance-pill { background: var(--chip); color: var(--text); }
.icon-btn { border: 0; background: var(--chip); color: var(--text); width: 40px; height: 40px; border-radius: 50%; cursor: pointer; display: inline-grid; place-items: center; text-decoration: none; padding: 0; }
.icon-btn:hover { background: color-mix(in srgb, var(--chip) 80%, var(--text) 20%); }
.icon-btn .icon { width: 1.3rem; height: 1.3rem; }

/* A slim strip under the header: the rental is about to end / no connection. */
.strip { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; padding: .55rem max(16px, env(safe-area-inset-left)); font-size: .92rem; font-weight: 500; }
.strip.warn { background: var(--warn-bg); color: var(--warn); }
.strip.error { background: var(--err-bg); color: var(--err); }
.strip .btn { margin-left: auto; }
.strip-inner { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; max-width: 1100px; margin: 0 auto; width: 100%; }

/* ---- building blocks ---- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; box-shadow: var(--shadow); }
.card.narrow { max-width: 420px; margin: 4vh auto; padding: 22px; }
.card.selected { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand) inset, var(--shadow); }
.card.soft { background: var(--brand-soft); border-color: color-mix(in srgb, var(--brand) 25%, var(--line)); box-shadow: none; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: .6rem; flex-wrap: wrap; }
.section-head h2, .section-head h3 { margin-bottom: .4rem; }
.list { display: flex; flex-direction: column; gap: 10px; }
.row { display: flex; align-items: center; gap: .7rem; text-decoration: none; color: inherit; flex-wrap: wrap; }
.list .row.card { margin: 0; }
.card > .list > .row + .row { border-top: 1px solid var(--line); padding-top: .7rem; }
.row-actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.title { font-weight: 600; }
.tag { background: var(--chip); border-radius: 6px; padding: 0 .4rem; font-size: .8rem; font-weight: 500; }
.chev { color: var(--muted); font-size: 1.4rem; display: inline-flex; }
.back { display: inline-flex; align-items: center; gap: .2rem; margin-bottom: .5rem; text-decoration: none; font-weight: 600; min-height: 36px; }
.page-title { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; justify-content: space-between; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-height: 44px;
  border: 1px solid var(--line); background: var(--card); color: var(--text); border-radius: var(--radius-sm);
  padding: .55rem 1rem; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; text-align: center;
}
.btn:hover { border-color: var(--muted); }
.btn.primary:hover { filter: brightness(1.07); border-color: var(--brand); }
.btn:active { transform: translateY(1px); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn.danger { color: var(--err); }
.btn.primary.danger { background: var(--err); border-color: var(--err); color: #fff; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--brand); padding-left: .4rem; padding-right: .4rem; }
.btn.ghost:hover { background: var(--brand-soft); border-color: transparent; }
.btn.small { min-height: 38px; padding: .3rem .8rem; font-size: .9rem; }
.btn.big { width: 100%; min-height: 54px; padding: .8rem; font-size: 1.1rem; margin-top: .8rem; border-radius: 14px; }
.btn:disabled, .btn.disabled { opacity: .45; cursor: not-allowed; pointer-events: none; }
.btn.more { display: flex; margin: 1rem auto; }
.btn.loading { position: relative; color: transparent !important; pointer-events: none; }
.btn.loading::after { content: ""; position: absolute; width: 1.1em; height: 1.1em; border: 2.5px solid color-mix(in srgb, var(--brand-ink) 40%, transparent); border-top-color: var(--brand-ink); border-radius: 50%; animation: spin .7s linear infinite; }
.btn:not(.primary).loading::after { border-color: var(--line); border-top-color: var(--brand); }

input, select, textarea {
  font: inherit; font-size: max(16px, 1rem); color: var(--text); background: var(--card); border: 1px solid color-mix(in srgb, var(--line) 70%, var(--muted) 30%); border-radius: var(--radius-sm);
  padding: .65rem .8rem; width: 100%; min-width: 0; min-height: 46px;
}
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .85; }
input[type="checkbox"], input[type="radio"] { width: 1.3rem; height: 1.3rem; min-height: 0; padding: 0; accent-color: var(--brand); flex: 0 0 auto; }
input:focus, select:focus, textarea:focus { outline: 3px solid color-mix(in srgb, var(--brand) 35%, transparent); border-color: var(--brand); }
.field { display: flex; flex-direction: column; gap: .3rem; margin-bottom: .8rem; }
.field-label { font-size: .92rem; font-weight: 600; }
.hint { font-size: .85rem; color: var(--muted); }
.check { display: flex; align-items: center; gap: .55rem; margin: .3rem 0; cursor: pointer; min-height: 40px; }
.form-error { color: var(--err); min-height: 1.2em; margin: .3rem 0; font-weight: 500; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.control-row { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; margin-bottom: .6rem; }
.control-row > input[type="search"] { flex: 2 1 200px; }
.control-row > select { flex: 1 1 180px; width: auto; }
.control-row .cc { width: 80px; flex: 0 0 auto; }
.control-row > input:not(.cc) { flex: 1 1 160px; }
.rel { position: relative; }
.pw { position: relative; }
.pw input { padding-right: 3.2rem; }
.pw .icon-btn { position: absolute; right: 4px; top: 3px; width: 40px; height: 40px; background: none; }

.chips { display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; margin-bottom: .6rem; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; padding-bottom: .3rem; scrollbar-width: thin; -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 32px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 32px), transparent); }
.chips.sticky { position: sticky; top: var(--header-h); background: var(--bg); z-index: 5; padding: .4rem 0; }
.chips-label { font-size: .875rem; color: var(--muted); white-space: nowrap; }
.chip {
  border: 1px solid transparent; background: var(--chip); color: var(--text); border-radius: 999px; min-height: 40px;
  padding: .4rem .95rem; font: inherit; font-size: .95rem; cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; gap: .35rem;
}
.chip:hover { border-color: var(--muted); }
.chip.active { background: var(--brand); color: var(--brand-ink); }

.badge { display: inline-block; font-size: .78rem; font-weight: 600; border-radius: 6px; padding: .08rem .5rem; background: var(--chip); margin-left: .3rem; vertical-align: middle; }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.phase-on_the_way, .badge.phase-arrived { background: var(--brand); color: var(--brand-ink); }
.badge.phase-delivered { background: var(--ok-bg); color: var(--ok); }
.badge.phase-canceled { background: var(--err-bg); color: var(--err); }
.banner { display: flex; gap: .6rem; align-items: flex-start; border-radius: var(--radius-sm); padding: .7rem .9rem; margin: .6rem 0; font-size: .95rem; }
.banner > .icon { margin-top: .15rem; }
.banner.warn { background: var(--warn-bg); color: var(--warn); }
.banner.error { background: var(--err-bg); color: var(--err); }
.banner.ok { background: var(--ok-bg); color: var(--ok); }
.banner.info { background: var(--info-bg); color: var(--info); }
.banner .banner-body { flex: 1; min-width: 0; }
.banner .banner-body > * { margin: 0 0 .3rem; }
.banner .banner-body > *:last-child { margin-bottom: 0; }
.banner a { color: inherit; font-weight: 600; }
.banner-actions { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .5rem; }
.error-box { background: var(--err-bg); color: var(--err); border-radius: var(--radius-sm); padding: 1rem; display: flex; gap: .8rem; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.loading { display: flex; align-items: center; gap: .6rem; color: var(--muted); padding: 1.2rem 0; }
.spin { width: 18px; height: 18px; border: 2px solid var(--line); border-top-color: var(--brand); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Skeletons: grey blocks where the page will be, so waiting feels shorter. */
.skeleton-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; margin-top: .4rem; }
.skeleton-card { height: 170px; border-radius: var(--radius); background: linear-gradient(100deg, var(--chip) 30%, color-mix(in srgb, var(--chip) 60%, var(--card)) 50%, var(--chip) 70%); background-size: 300% 100%; animation: shimmer 1.4s linear infinite; }
.skeleton-card.line { height: 54px; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }

/* Disclosure: a section that stays closed until the user wants it ("Дополнительно"). */
.disclosure { border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); margin-bottom: 12px; overflow: hidden; }
.disclosure.flat { border: 0; border-top: 1px solid var(--line); border-radius: 0; background: none; margin: .6rem 0 0; }
.disclosure > summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: .6rem; padding: .8rem 1rem; min-height: 50px; font-weight: 600;
}
.disclosure.flat > summary { padding: .7rem 0; }
.disclosure > summary::-webkit-details-marker { display: none; }
.disclosure > summary .sum-title { flex: 1; min-width: 0; }
.disclosure > summary .sum-sub { display: block; font-size: .85rem; font-weight: 400; color: var(--muted); }
.disclosure > summary .chev-ico { transition: transform .15s; color: var(--muted); }
.disclosure[open] > summary .chev-ico { transform: rotate(180deg); }
.disclosure > summary:hover { background: color-mix(in srgb, var(--chip) 50%, transparent); }
.disclosure-body { padding: 0 1rem 1rem; }
.disclosure.flat .disclosure-body { padding: 0 0 .5rem; }
details summary { cursor: pointer; }

/* A hint the user can dismiss ("Понятно"). */
.tip { display: flex; flex-wrap: wrap; gap: .4rem .7rem; align-items: flex-start; background: var(--info-bg); color: var(--text); border-radius: var(--radius-sm); padding: .8rem .9rem; margin-bottom: 12px; border: 1px solid color-mix(in srgb, var(--info) 25%, transparent); }
.tip > .icon { color: var(--info); margin-top: .1rem; }
.tip-body { flex: 1 1 14rem; min-width: 0; font-size: .95rem; }
.tip .btn { flex: 0 0 auto; margin-left: auto; }

/* An empty page: what is missing and what to do about it. */
.empty { text-align: center; padding: 2rem 1rem; display: flex; flex-direction: column; align-items: center; gap: .4rem; }
.empty-art { font-size: 3rem; line-height: 1; margin-bottom: .3rem; }
.empty h3 { justify-content: center; margin: 0; }
.empty p { color: var(--muted); max-width: 34ch; margin: 0 0 .6rem; }

/* Numbered steps: "how it works", what to do next. */
.guide { counter-reset: guide; list-style: none; padding: 0; margin: .5rem 0 0; display: flex; flex-direction: column; gap: .7rem; }
.guide > li { counter-increment: guide; display: flex; gap: .75rem; align-items: flex-start; }
.guide > li::before {
  content: counter(guide); flex: 0 0 auto; width: 1.9rem; height: 1.9rem; border-radius: 50%; display: grid; place-items: center;
  background: var(--brand-soft); color: var(--brand); font-weight: 800;
}
.card.soft .guide > li::before { background: var(--card); }
.guide .guide-text { flex: 1; min-width: 0; padding-top: .15rem; }
.guide .guide-text b { display: block; }
.todo { list-style: none; padding: 0; margin: .6rem 0 0; display: flex; flex-direction: column; gap: .4rem; }
.todo > li { display: flex; align-items: center; gap: .7rem; padding: .6rem .7rem; border-radius: var(--radius-sm); background: var(--bg); flex-wrap: wrap; }
.todo .todo-mark { flex: 0 0 auto; width: 1.7rem; height: 1.7rem; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--line); color: var(--muted); font-weight: 700; font-size: .85rem; }
.todo li.done .todo-mark { background: var(--ok); border-color: var(--ok); color: #fff; }
.todo li.done .todo-mark .icon { width: 1rem; height: 1rem; }
.todo li.next { background: var(--brand-soft); outline: 2px solid color-mix(in srgb, var(--brand) 35%, transparent); }
.todo li.next .todo-mark { border-color: var(--brand); color: var(--brand); }
.todo .todo-text { flex: 1; min-width: 0; }
.todo .todo-text .small { display: block; }

.progress { height: 8px; border-radius: 999px; background: var(--chip); overflow: hidden; margin: .4rem 0; }
.progress > i { display: block; height: 100%; background: var(--ok); border-radius: 999px; transition: width .4s; }
.progress.warn > i { background: var(--warn); }

.avatar { display: inline-grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); font-weight: 800; font-size: 1.3rem; flex: 0 0 auto; }

/* The "Ещё" menu: big rows with an icon, a title and what is behind it. */
.menu-list { display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-bottom: 14px; box-shadow: var(--shadow); }
.menu-item { display: flex; align-items: center; gap: .9rem; padding: .85rem 1rem; text-decoration: none; color: var(--text); background: none; border: 0; border-top: 1px solid var(--line); font: inherit; text-align: left; cursor: pointer; width: 100%; min-height: 62px; }
.menu-item:first-child { border-top: 0; }
.menu-item:hover { background: color-mix(in srgb, var(--chip) 50%, transparent); }
.menu-ico { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--brand-soft); color: var(--brand); flex: 0 0 auto; }
.menu-ico .icon { width: 1.35rem; height: 1.35rem; }
.menu-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.menu-text b { font-weight: 600; }
.menu-text span { font-size: .85rem; color: var(--muted); }
.menu-item .chev { font-size: 1rem; }
.menu-heading { font-size: .8rem; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); font-weight: 700; margin: 1.2rem .3rem .4rem; }

/* ---- catalog ---- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.count { margin: .2rem 0 .6rem; }
.store-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; text-decoration: none; color: inherit; display: flex; flex-direction: column; box-shadow: var(--shadow); transition: transform .12s, border-color .12s; }
.store-card:hover { border-color: var(--brand); transform: translateY(-1px); }
.store-card.closed { opacity: .65; }
.store-img { position: relative; aspect-ratio: 16 / 7; background: var(--chip); }
.store-img .bg { width: 100%; height: 100%; object-fit: cover; display: block; }
.store-img .logo { position: absolute; left: 12px; bottom: -20px; width: 50px; height: 50px; border-radius: 13px; border: 2px solid var(--card); background: var(--card); object-fit: cover; }
.closed-label { position: absolute; right: 8px; top: 8px; background: rgba(0, 0, 0, .72); color: #fff; font-size: .78rem; padding: .15rem .55rem; border-radius: 8px; }
.free-label { position: absolute; left: 8px; top: 8px; background: var(--ok); color: #fff; font-size: .78rem; font-weight: 700; padding: .15rem .55rem; border-radius: 8px; }
.store-info { padding: 26px 14px 14px; display: flex; flex-direction: column; gap: .3rem; }
.store-meta { display: flex; flex-wrap: wrap; gap: .25rem .8rem; color: var(--muted); font-size: .88rem; }
.store-meta .free { color: var(--ok); font-weight: 600; }
.img-ph { background: var(--chip); }
.promos { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .25rem; }
.promo { border: 0; background: color-mix(in srgb, var(--brand) 12%, transparent); color: var(--brand); font: inherit; font-size: .8rem; font-weight: 700; border-radius: 8px; padding: .2rem .55rem; cursor: pointer; }
.promo.prime { background: color-mix(in srgb, var(--prime) 15%, transparent); color: var(--prime); }
.promo.static { cursor: default; }
.promo-detail .conditions { background: var(--bg); border-radius: var(--radius-sm); padding: .6rem .8rem; margin: .6rem 0; }
.promo.matched { box-shadow: inset 0 0 0 1.5px currentColor; }
.deal-hit { color: var(--ok); font-weight: 600; }
.verticals { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: 8px; margin-bottom: 12px; }
.vertical {
  display: flex; align-items: center; gap: .6rem; padding: .7rem .85rem; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--card);
  color: var(--text); font: inherit; font-weight: 600; cursor: pointer; min-height: 54px; text-align: left; min-width: 0; overflow-wrap: anywhere;
}
.vertical:hover { border-color: var(--muted); }
.vertical.active { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); }
.vertical .v-emoji { font-size: 1.4rem; line-height: 1; }
.search-hero { display: flex; gap: .5rem; margin-bottom: .8rem; }
.search-hero input { flex: 1; min-height: 52px; border-radius: 14px; font-size: 1.05rem; }
.search-hero .btn { min-height: 52px; border-radius: 14px; }
.recent { margin-bottom: .6rem; }

/* ---- advanced discount filter ---- */
.deal-panel h3 { margin: 0; }
.deal-panel .control-row { margin: .5rem 0 .3rem; }
label.inline { display: inline-flex; align-items: center; gap: .3rem; white-space: nowrap; font-size: .95rem; }
.cc.wide { width: 110px; }
.deal-group { margin-top: .6rem; }
.deal-group .chips { margin: .25rem 0 0; }
.deal-group .chip { white-space: normal; text-align: left; }

/* ---- store / products ---- */
.store-head { display: flex; gap: 14px; align-items: flex-start; }
.store-head h2 { margin-top: 0; }
.logo { width: 28px; height: 28px; border-radius: 8px; object-fit: cover; }
.logo.big { width: 68px; height: 68px; border-radius: 16px; }
.products { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 12px; margin-bottom: 1.4rem; }
.product { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; display: flex; gap: 12px; }
.product.unavailable { opacity: .6; }
.product.clickable { cursor: pointer; }
.product.clickable:hover { border-color: var(--brand); }
/* The product on its own: a large picture over the details. */
.product-detail { display: flex; flex-direction: column; gap: 12px; }
.product-detail > a { display: block; }
.product-big { display: block; width: 100%; max-height: min(60vh, 520px); object-fit: contain; border-radius: var(--radius); background: var(--chip); aspect-ratio: 1 / 1; }
.product-desc { white-space: pre-line; margin: .3rem 0; }
.product-img { width: 92px; height: 92px; border-radius: var(--radius-sm); object-fit: cover; flex: 0 0 auto; background: var(--chip); }
.product-info { display: flex; flex-direction: column; gap: .25rem; min-width: 0; flex: 1; }
.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.price { font-weight: 700; display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; font-size: 1.05rem; }
.price s { font-weight: 400; }
.add-row { display: flex; gap: .5rem; align-items: center; margin-top: .4rem; flex-wrap: wrap; }
/* Rappi's numbers while a change is on its way: kept in place (no jump), dimmed. */
.stale { opacity: .45; transition: opacity .15s; }
/* A button with two states in one box: the wider label sets the width, so a change never moves the row. */
.swap { display: inline-grid; }
.swap > * { grid-area: 1 / 1; text-align: center; }
.swap-b { visibility: hidden; font-weight: 800; }
.btn.done .swap-a { visibility: hidden; }
.btn.done .swap-b { visibility: visible; }
.qty { width: 64px; padding: .3rem .4rem; }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--card); }
.stepper button { border: 0; background: var(--chip); color: var(--text); width: 40px; height: 40px; font-size: 1.3rem; line-height: 1; cursor: pointer; display: inline-grid; place-items: center; padding: 0; }
.stepper button:hover { background: color-mix(in srgb, var(--chip) 75%, var(--text) 25%); }
.stepper button:disabled { opacity: .35; cursor: not-allowed; }
.stepper output { min-width: 2.2rem; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.add-error { color: var(--err); font-size: .875rem; }
.add-error:empty { display: none; }
.fab { position: fixed; right: max(16px, env(safe-area-inset-right)); bottom: calc(18px + env(safe-area-inset-bottom)); background: var(--brand); color: var(--brand-ink); padding: .75rem 1.1rem; border-radius: 999px; text-decoration: none; font-weight: 700; box-shadow: 0 4px 14px rgba(0, 0, 0, .2); z-index: 15; }
/* The cart bar: what is in the cart, one tap away (over the bottom menu on a phone). */
.cart-bar {
  position: fixed; z-index: 25; left: max(12px, env(safe-area-inset-left)); right: max(12px, env(safe-area-inset-right));
  bottom: calc(var(--nav-h) + 10px + env(safe-area-inset-bottom)); max-width: 640px; margin: 0 auto;
  display: flex; align-items: center; gap: .7rem; padding: .75rem 1rem; border-radius: 16px; text-decoration: none;
  background: var(--brand); color: var(--brand-ink); font-weight: 700; box-shadow: 0 8px 24px rgba(0, 0, 0, .25);
}
.cart-bar .grow { display: flex; flex-direction: column; line-height: 1.2; }
.cart-bar small { font-weight: 500; opacity: .9; font-size: .8rem; }
@media (min-width: 800px) { .cart-bar { bottom: 18px; left: auto; right: max(24px, env(safe-area-inset-right)); width: 380px; } }
.toolbar .control-row:last-child, .toolbar .chips:last-child { margin-bottom: 0; }
.toolbar .control-row > select.scope { flex: 0 1 240px; }
.pct-custom { display: inline-flex; align-items: center; gap: .25rem; font-size: .92rem; white-space: nowrap; padding: 0 .3rem; border-radius: 999px; }
.pct-custom .cc { width: 70px; padding: .3rem .4rem; min-height: 38px; }
.pct-custom.active { background: var(--brand); color: var(--brand-ink); }
.market-row { border-top: 1px solid var(--line); padding-top: .6rem; margin-top: .4rem; }
.market-row .chips { margin-bottom: 0; }
.more-row { display: flex; gap: .5rem; justify-content: center; flex-wrap: wrap; }
.more-row .btn.more { margin: 1rem 0 .3rem; }
.more-status { text-align: center; min-height: 1.2em; margin-bottom: 1rem; }
.sub-more { display: inline-flex; align-items: center; gap: .4rem; font-weight: 400; }
/* Global search: the box on the catalog page, store titles and the store under a product. */
.global-search { margin-bottom: .8rem; }
.global-search > input[type="search"] { flex: 1 1 240px; }
.store-title { display: inline-flex; align-items: center; gap: .45rem; }
.store-line { display: block; color: var(--muted); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.store-line:hover { text-decoration: underline; }
.deal-line { display: flex; flex-wrap: wrap; align-items: center; gap: .2rem; color: var(--muted); }
.badge.deal { margin-left: 0; background: var(--warn-bg); color: var(--warn); }
.unit { font-variant-numeric: tabular-nums; }
.mkt { align-self: flex-start; border: 1px solid var(--line); background: var(--card); color: var(--muted); font: inherit; font-size: .8rem; font-weight: 600; border-radius: 8px; padding: .2rem .55rem; cursor: pointer; min-height: 30px; }
.mkt:disabled { opacity: .6; cursor: progress; }
.mkt.top, .chip.v-top:not(.active) { color: var(--v-top); }
.mkt.good, .chip.v-good:not(.active) { color: var(--v-good); }
.mkt.par, .chip.v-par:not(.active) { color: var(--v-par); }
.mkt.regular, .chip.v-regular:not(.active) { color: var(--v-regular); }
.mkt.fake, .chip.v-fake:not(.active) { color: var(--v-fake); }
.mkt.top, .mkt.good, .mkt.par, .mkt.regular, .mkt.fake { border-color: currentColor; }
.market-detail .verdict { font-weight: 700; font-size: 1.1rem; margin-bottom: .5rem; }
.verdict.top { color: var(--v-top); } .verdict.good { color: var(--v-good); } .verdict.par { color: var(--v-par); }
.verdict.regular { color: var(--v-regular); } .verdict.fake { color: var(--v-fake); } .verdict.unknown { color: var(--muted); }
.market-detail .prices { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; background: var(--bg); border-radius: var(--radius-sm); padding: .7rem .9rem; }
.p-val { font-size: 1.3rem; font-weight: 800; font-variant-numeric: tabular-nums; }
table.offers { width: 100%; border-collapse: collapse; margin: .4rem 0; font-size: .92rem; }
table.offers td { padding: .4rem .2rem; border-bottom: 1px solid var(--line); vertical-align: top; overflow-wrap: anywhere; }
table.offers td.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; font-weight: 600; }
table.offers tr.best td { background: color-mix(in srgb, var(--ok) 10%, transparent); }
.cond { color: var(--warn); font-weight: 400; white-space: normal; }
table.offers td.num .cond { white-space: nowrap; overflow-wrap: normal; }
.toppings { border: 1px solid var(--line); border-radius: var(--radius-sm); margin: 0 0 .8rem; padding: .5rem .9rem; }
.toppings legend { font-weight: 600; padding: 0 .3rem; }
.opt { display: flex; align-items: center; gap: .55rem; padding: .45rem 0; cursor: pointer; flex-wrap: wrap; min-height: 44px; }
.pm-icon { width: 28px; height: 28px; object-fit: contain; }

/* ---- cart / checkout ---- */
.lines { display: flex; flex-direction: column; gap: 4px; margin: .6rem 0; }
.line { display: flex; gap: 12px; align-items: center; padding: .6rem 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.line:last-child { border-bottom: 0; }
.line.bad { background: var(--err-bg); border-radius: var(--radius-sm); padding: .6rem; }
.thumb { width: 56px; height: 56px; border-radius: 12px; object-fit: cover; background: var(--chip); }
.line-end { display: flex; flex-direction: column; align-items: flex-end; gap: .35rem; }
.qty-box { display: flex; gap: .4rem; align-items: center; }
.totals { display: flex; flex-direction: column; align-items: flex-end; gap: .1rem; margin: .4rem 0 .8rem; }
.summary { width: 100%; border-collapse: collapse; margin: .4rem 0; }
.summary td { padding: .35rem 0; border-bottom: 1px dashed var(--line); }
.summary td:last-child { text-align: right; }
.summary tr.strong td { font-weight: 700; }
.summary td:last-child { white-space: nowrap; padding-left: .8rem; font-variant-numeric: tabular-nums; }
.summary tr.kind-discount td { color: var(--ok); font-weight: 600; }
.summary tr.kind-fee td:last-child { color: var(--err); font-weight: 600; }
.summary tr.kind-subtotal td { color: var(--muted); font-size: .9em; }
.summary tr.kind-saved td { color: var(--ok); font-weight: 700; border-bottom: 0; padding-top: .5rem; }
.summary tr.kind-saved td:first-child::before { content: "💚 "; }
.summary tr.kind-total td { font-weight: 800; font-size: 1.25em; border-top: 2px solid var(--text); border-bottom: 0; padding-top: .6rem; }
.options { display: flex; flex-direction: column; }
.step-card > h3 { gap: .6rem; }
.step-num { display: inline-grid; place-items: center; width: 1.8rem; height: 1.8rem; border-radius: 50%; background: var(--brand); color: var(--brand-ink); font-size: .95rem; font-weight: 800; flex: 0 0 auto; }
.choice { display: flex; align-items: center; gap: .7rem; padding: .7rem .8rem; border: 1px solid var(--line); border-radius: var(--radius-sm); cursor: pointer; min-height: 56px; margin-bottom: .45rem; background: var(--card); }
.choice:hover { border-color: var(--muted); }
.choice.on { border-color: var(--brand); background: var(--brand-soft); }
.choice.off { opacity: .55; cursor: not-allowed; }
.choice .grow { display: flex; flex-direction: column; line-height: 1.3; }
.sticky-action { position: sticky; bottom: calc(var(--nav-h) + 8px + env(safe-area-inset-bottom)); z-index: 10; background: var(--bg); padding: .6rem 0 .2rem; margin-top: .4rem; }
@media (min-width: 800px) { .sticky-action { bottom: 0; } }
.sticky-action .btn.big { margin-top: 0; }

/* ---- orders ---- */
.code-big { background: var(--brand); color: var(--brand-ink); border-radius: var(--radius); padding: 1.1rem; text-align: center; margin-bottom: 12px; }
.code-big .muted { color: color-mix(in srgb, var(--brand-ink) 85%, transparent); }
.code-big .code { font-size: 2.8rem; font-weight: 800; letter-spacing: .35rem; font-variant-numeric: tabular-nums; }
.code-big .btn { margin-top: .4rem; background: color-mix(in srgb, var(--brand-ink) 18%, transparent); border-color: transparent; color: var(--brand-ink); }
.code-inline { font-weight: 700; color: var(--brand); }
.steps { display: flex; list-style: none; padding: 0; margin: 0 0 .8rem; gap: 5px; flex-wrap: wrap; }
.steps { flex-wrap: nowrap; }
.steps li { flex: 1 1 0; min-width: 0; text-align: center; font-size: .72rem; padding-top: .5rem; border-top: 5px solid var(--line); color: var(--muted); border-radius: 3px; overflow-wrap: anywhere; }
.steps li.done { border-color: var(--brand); color: var(--text); font-weight: 600; }
.history { padding-left: 1.1rem; margin: 0; }
.status-hero { display: flex; gap: .9rem; align-items: center; }
.status-ico { display: grid; place-items: center; width: 58px; height: 58px; border-radius: 18px; background: var(--brand-soft); font-size: 1.9rem; flex: 0 0 auto; }
.status-hero h2 { margin: 0; font-size: 1.3rem; }
.order-row { display: flex; gap: .8rem; align-items: center; text-decoration: none; color: inherit; }
.order-row:hover { border-color: var(--brand); }
.order-ico { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; background: var(--chip); font-size: 1.4rem; flex: 0 0 auto; }
.order-items { list-style: none; padding: 0; margin: 0 0 .5rem; display: flex; flex-direction: column; }
.order-items li { display: flex; gap: .8rem; justify-content: space-between; padding: .5rem 0; border-bottom: 1px solid var(--line); }
.order-items li:last-child { border-bottom: 0; }
.success-card { text-align: center; padding: 1.4rem 1rem; }
.success-card .empty-art { font-size: 3.2rem; }

/* ---- address ---- */
/* z-index 0 keeps Leaflet's panes and controls (z-index 400-1000) inside the map, under the sticky header. */
.map { position: relative; z-index: 0; isolation: isolate; height: 240px; border-radius: var(--radius-sm); margin-bottom: .6rem; background: var(--chip); }
.map:empty { display: none; }
.suggest { position: absolute; left: 0; right: 0; top: 100%; z-index: 1000; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: 0 6px 20px rgba(0, 0, 0, .12); max-height: 260px; overflow-y: auto; }
.suggest:empty { display: none; }
.suggest-item { display: block; width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--line); padding: .7rem .8rem; font: inherit; color: var(--text); cursor: pointer; min-height: 48px; }
.suggest-item:hover { background: var(--bg); }

/* ---- admin ---- */
.perm-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: .1rem .8rem; }
.table-wrap { overflow-x: auto; }
.audit { border-collapse: collapse; width: 100%; font-size: .85rem; margin-top: .6rem; }
.audit th, .audit td { text-align: left; padding: .3rem .4rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.audit td.small { max-width: 320px; word-break: break-word; }
.audit tr.bad td { color: var(--err); }
.qr svg { width: 220px; height: 220px; background: #fff; border-radius: 8px; }
.secret { display: block; margin: .5rem 0; font-size: 1rem; letter-spacing: .05rem; }

/* ---- modal & toasts ---- */
.modal-back { position: fixed; inset: 0; background: rgba(0, 0, 0, .5); z-index: 100; display: flex; align-items: flex-end; justify-content: center; animation: fade .15s; }
.modal { background: var(--card); width: 100%; max-width: 480px; max-height: 92vh; display: flex; flex-direction: column; border-radius: 20px 20px 0 0; animation: rise .2s; }
.modal.wide { max-width: 660px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.1rem .4rem; gap: .6rem; }
.modal-head h3 { margin: 0; font-size: 1.2rem; }
.modal-body { padding: .4rem 1.1rem 1.1rem; overflow-y: auto; }
.modal-foot { display: flex; gap: .5rem; justify-content: flex-end; flex-wrap: wrap; padding: .8rem 1.1rem calc(.8rem + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
.modal-foot .btn { flex: 1 1 auto; }
body.modal-open { overflow: hidden; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { transform: translateY(24px); opacity: .4; } }
@media (min-width: 700px) {
  .modal-back { align-items: center; }
  .modal { border-radius: 20px; }
  .modal-foot .btn { flex: 0 0 auto; }
}
.toasts { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--nav-h) + 22px + env(safe-area-inset-bottom)); z-index: 200; display: flex; flex-direction: column; gap: 8px; width: min(94vw, 480px); pointer-events: none; }
@media (min-width: 800px) { .toasts { bottom: 24px; } }
.toast { display: flex; gap: .6rem; align-items: flex-start; background: var(--toast); color: #fff; border-radius: 14px; padding: .8rem 1rem; box-shadow: 0 6px 22px rgba(0, 0, 0, .3); transition: opacity .3s; pointer-events: auto; cursor: pointer; animation: rise .2s; }
.toast .icon { margin-top: .1rem; }
.toast.ok { background: var(--toast-ok); }
.toast.error { background: var(--toast-err); }
.toast.hide { opacity: 0; }

@media (max-width: 520px) {
  .two { grid-template-columns: 1fr; }
  .product-img { width: 80px; height: 80px; }
  h2 { font-size: 1.4rem; }
}

/* ---- order chat ---- */
.chat-list { max-height: 320px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; padding: 4px 0 8px; }
.msg { align-self: flex-start; max-width: 80%; background: var(--chip); border-radius: 14px 14px 14px 4px; padding: .5rem .75rem; word-wrap: break-word; }
.msg.mine { align-self: flex-end; background: var(--brand); color: var(--brand-ink); border-radius: 14px 14px 4px 14px; }
.msg-name { font-size: .78rem; font-weight: 700; margin-bottom: .1rem; }
.msg-time { font-size: .72rem; opacity: .7; margin-top: .15rem; text-align: right; }
.chat-form { display: flex; gap: .4rem; }
.chat-form input { flex: 1; }
.chat-quick { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: .5rem; }
/* The title and the translation switch share one row of a fixed height. */
.chat-head { display: flex; align-items: center; justify-content: space-between; gap: .6rem; min-height: 40px; }
.chat-head h3 { margin: 0; }
.chat-translate { margin: 0; font-size: .9rem; white-space: nowrap; }
/* «Перевод · показать оригинал» and the like, under the words of a message. */
.msg-note { display: block; font-size: .75rem; opacity: .75; margin-top: .2rem; }
button.msg-note { background: none; border: 0; padding: 0; color: inherit; font-family: inherit; text-decoration: underline; cursor: pointer; text-align: inherit; min-height: 24px; }
.msg-orig { margin-top: .2rem; padding-left: .5rem; border-left: 2px solid currentColor; opacity: .85; font-style: italic; }
/* The courier's photo: on the order page and next to the courier's messages. */
.courier-row { display: flex; align-items: center; gap: .7rem; margin: .6rem 0; }
.courier-face { display: inline-grid; place-items: center; border-radius: 50%; overflow: hidden; background: var(--chip); color: var(--muted); flex: 0 0 auto; }
.courier-face img { width: 100%; height: 100%; object-fit: cover; display: block; }
.courier-face.big { width: 56px; height: 56px; }
.courier-face.mini { width: 22px; height: 22px; }
.courier-face.mini .icon { width: 14px; height: 14px; }
.msg-name { display: flex; align-items: center; gap: .35rem; }
.msg.system .msg-name { justify-content: center; }
.msg.system.rappi-card { border-style: solid; border-color: var(--warn); color: var(--text); }

/* ---- order map ---- */
.order-map { height: 280px; }
.map-pin { background: none; border: 0; }
.map-pin span { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--card); box-shadow: 0 1px 6px rgba(0, 0, 0, .35); font-size: 20px; }
.pin-courier span { background: var(--brand); border: 2px solid #fff; color: var(--brand-ink); }
.pin-courier svg { width: 22px; height: 22px; display: block; }
/* The courier's map pin, small, in the legend under the map. */
.legend-pin { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; vertical-align: -5px; background: var(--brand); color: var(--brand-ink); }
.legend-pin svg { width: 13px; height: 13px; }
.msg.system { align-self: center; max-width: 92%; background: transparent; border: 1px dashed var(--line); color: var(--muted); font-size: .85rem; text-align: center; }
.msg-img { max-width: 220px; max-height: 220px; border-radius: 8px; display: block; }
.msg audio { max-width: 240px; }

.account-switch { width: auto; max-width: 170px; padding: .3rem .5rem; min-height: 38px; font-weight: 600; }

/* ---- rentals ---- */
.bonuses ul { margin: .2rem 0 .5rem; padding-left: 1.2rem; }
.bonuses h4 { margin: .6rem 0 .3rem; }
.cond-row { display: flex; gap: .4rem; flex-wrap: wrap; align-items: flex-end; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .5rem; margin-bottom: .4rem; }
.cond-row .field { flex: 1 1 120px; margin: 0; }
.lease-hero { border-color: color-mix(in srgb, var(--ok) 40%, var(--line)); }
.lease-hero .lease-timer { display: flex; align-items: baseline; gap: .5rem; flex-wrap: wrap; }
.lease-hero .lease-timer b { font-size: 1.7rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.lease-hero.ending { border-color: var(--warn); }
.offer { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; background: var(--card); display: flex; flex-direction: column; gap: .4rem; }
.offer.out { opacity: .85; }
.offer-head { display: flex; gap: .5rem; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; }
.offer-name { font-size: 1.15rem; font-weight: 700; }
.offer-price { font-weight: 700; }
.offers-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.active-order { display: flex; align-items: center; gap: .8rem; text-decoration: none; color: inherit; }

/* ---- balance, top-ups, invitations, saved addresses ---- */
.balance-big { font-size: 1.9rem; font-weight: 800; line-height: 1.1; }
.balance-row { display: flex; gap: 1.4rem; flex-wrap: wrap; align-items: baseline; margin: .3rem 0 .6rem; }
.delta-plus { color: var(--ok); font-weight: 600; }
.delta-minus { color: var(--err); font-weight: 600; }
.invite-link { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; margin: .4rem 0; }
.invite-link input { flex: 1 1 260px; font-family: ui-monospace, monospace; font-size: .9rem; }
.place-row { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; margin: .4rem 0; }
.place-row select { flex: 1 1 200px; width: auto; }
.pay-methods { display: flex; flex-direction: column; gap: .5rem; margin-bottom: .6rem; }
.preset-row { display: flex; gap: .5rem; flex-wrap: wrap; margin: .3rem 0 .6rem; }
.preset-row .btn { flex: 1 1 70px; }
.free-telegram { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; justify-content: space-between; }

/* ---- settings (language, theme, text size) ---- */
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; flex-wrap: wrap; }
.seg button { border: 0; background: var(--card); color: var(--text); font: inherit; padding: .6rem 1rem; cursor: pointer; min-height: 44px; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button.active { background: var(--brand); color: var(--brand-ink); font-weight: 600; }
.lang-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: .4rem; }
.lang-list .chip { text-align: left; border-radius: var(--radius-sm); padding: .6rem .8rem; white-space: normal; }
.lang-list .chip:first-child { grid-column: 1 / -1; }
.settings h4:first-child { margin-top: 0; }
.settings h4 { margin-top: 1.1rem; }
.login-tools { display: flex; justify-content: center; margin-top: .6rem; }
.size-pick { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; }
.size-pick button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .1rem; border: 1px solid var(--line); background: var(--card); color: var(--text); border-radius: var(--radius-sm); padding: .5rem; cursor: pointer; font: inherit; min-height: 68px; }
.size-pick button.active { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.size-a { line-height: 1.1; font-weight: 700; }
.preset-row .btn { flex: 1 1 60px; padding-left: .4rem; padding-right: .4rem; white-space: nowrap; }
.preset-row .btn.primary { box-shadow: none; }

/* ---- referral link ---- */
.ref-card { border-color: color-mix(in srgb, var(--brand) 35%, var(--line)); }
.ref-card .invite-link input { font-size: .95rem; }
.ref-stats { display: flex; gap: 1.2rem; flex-wrap: wrap; margin: .2rem 0 .4rem; }
.ref-stats b { font-size: 1.2rem; }

/* ---- sign-in and sign-up ---- */
.welcome { text-align: center; margin-bottom: 1rem; }
.welcome .brand-mark { width: 56px; height: 56px; border-radius: 16px; margin-bottom: .6rem; }
.welcome .brand-mark .icon { width: 32px; height: 32px; }
.welcome .brand-mark.app { width: 72px; height: 72px; margin-bottom: .3rem; }
.welcome h2 { margin: 0 0 .3rem; font-size: 1.6rem; }
.perks { list-style: none; padding: 0; margin: .8rem 0 1rem; display: flex; flex-direction: column; gap: .5rem; }
.perks li { display: flex; gap: .6rem; align-items: flex-start; }
.perks .icon { color: var(--ok); margin-top: .15rem; }
.pw-rules { display: flex; gap: .4rem; align-items: center; font-size: .85rem; color: var(--muted); }
.pw-rules.ok { color: var(--ok); }
.pw-dot { width: 1em; height: 1em; border-radius: 50%; border: 2px solid currentColor; display: inline-block; flex: 0 0 auto; }
/* "Не помню пароль" and the code from Telegram */
.btn.ghost.forgot { display: flex; margin: .6rem auto 0; }
.hint.center { display: block; text-align: center; margin: .8rem 0 .2rem; }
.row-actions.center { justify-content: center; margin-top: .6rem; }
.login-for { text-align: center; margin: -.4rem 0 .6rem; }
.signup-offer { display: flex; gap: .6rem; align-items: center; justify-content: center; flex-wrap: wrap; margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--line); }
p.center { text-align: center; }
.code-input { font-size: 1.6rem; letter-spacing: .35em; text-align: center; font-variant-numeric: tabular-nums; }
.code-input::placeholder { color: var(--muted); opacity: .45; }

/* ---- maps in the dark theme: dim the light tiles ---- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .leaflet-tile-pane { filter: brightness(.75) contrast(1.1) saturate(.8); }
}
:root[data-theme="dark"] .leaflet-tile-pane { filter: brightness(.75) contrast(1.1) saturate(.8); }
.leaflet-container { background: var(--chip); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ---- statistics (owner) ---- */
.stats-head { display: flex; flex-wrap: wrap; gap: .4rem 1rem; align-items: center; margin-bottom: .6rem; }
.stats-head .chips { margin: 0; }
.stats-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin-bottom: 12px; }
.stats-tile { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; display: flex; flex-direction: column; gap: .15rem; box-shadow: var(--shadow); min-width: 0; }
.stats-tile-label { font-size: .8rem; color: var(--muted); }
.stats-tile strong { font-size: 1.35rem; font-variant-numeric: tabular-nums; }
.stats-tile-delta { font-size: .75rem; color: var(--muted); min-height: 1em; }
.stats-tile-delta.good { color: var(--ok); }
.stats-tile-delta.bad { color: var(--err); }
.spark { width: 100%; height: 24px; margin-top: .2rem; }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.stats-grid .stats-card { margin: 0; min-width: 0; }
.stats-card.wide { grid-column: 1 / -1; }
.stats-card h3 { margin-bottom: .2rem; }
.chart { width: 100%; height: 170px; display: block; margin-top: .4rem; }
.chart .axis { stroke: var(--line); }
.chart .tick { fill: var(--muted); font-size: 11px; }
.chart-empty { color: var(--muted); font-size: .85rem; padding: 1rem 0; }
.legend { display: flex; flex-wrap: wrap; gap: .3rem .9rem; font-size: .8rem; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: .3rem; vertical-align: -1px; }
.barlist { display: flex; flex-direction: column; gap: 6px; margin-top: .4rem; }
.barlist-row { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto 2.6em; gap: .5rem; align-items: center; font-size: .85rem; }
.barlist-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.barlist-track { background: var(--chip); border-radius: 4px; height: 8px; overflow: hidden; }
.barlist-track i { display: block; height: 100%; background: var(--series-1); border-radius: 4px; }
.barlist-value { font-variant-numeric: tabular-nums; font-weight: 600; text-align: right; }
.barlist-share { color: var(--muted); font-size: .75rem; text-align: right; }
.cols { display: flex; align-items: flex-end; gap: 3px; height: 120px; margin-top: .6rem; }
.col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; min-width: 0; }
.col i { display: block; width: 100%; background: var(--series-1); border-radius: 3px 3px 0 0; }
.col span { font-size: .65rem; color: var(--muted); height: 1.2em; }
.stats-facts { display: grid; grid-template-columns: 1fr auto; gap: .35rem .8rem; margin: .4rem 0 0; font-size: .9rem; }
.stats-facts dt { color: var(--muted); }
.stats-facts dd { margin: 0; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.stats-people th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
.stats-people tr.flagged td { background: color-mix(in srgb, var(--warn-bg) 60%, transparent); }
@media (max-width: 520px) {
  .stats-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats-grid { grid-template-columns: minmax(0, 1fr); }
}

/* ---- adding Rappi accounts ---- */
textarea.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: max(16px, .85rem); }
.add-accounts > .chips { margin-bottom: .8rem; }
.help-steps { margin: .4rem 0; padding-left: 1.2rem; }
.help-steps li { margin: .2rem 0; }
.modal-actions { margin-top: .8rem; }
.import-rows { display: flex; flex-direction: column; gap: 6px; margin: .6rem 0; }
.import-row { display: flex; gap: .6rem; align-items: flex-start; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .5rem .6rem; }
.import-row.bad { border-color: color-mix(in srgb, var(--err) 45%, var(--line)); }
.import-row.done { border-color: color-mix(in srgb, var(--ok) 45%, var(--line)); background: color-mix(in srgb, var(--ok-bg) 50%, transparent); }
.import-row input { margin-bottom: .25rem; }
.import-no { color: var(--muted); font-variant-numeric: tabular-nums; min-width: 1.4em; padding-top: .55rem; }

/* Discounts Rappi gives on a few units only ("-30% Máx. 1 Ud."). */
.limit-line { color: var(--warn); font-weight: 600; }
.line .offers { margin-top: 2px; }
.line .offers.limited { color: var(--warn); }

/* "Искать ограниченные предложения": a button of its own colour and what it found. */
.scan-btn { background: var(--warn-bg); color: var(--warn); border-color: var(--warn); font-weight: 700; }
.scan-btn:hover { filter: brightness(.97); }
.scan-results { display: grid; gap: 8px; margin-top: 8px; }
.scan-hit { display: block; padding: 10px; border: 1px solid var(--warn); border-radius: var(--radius-sm); background: var(--warn-bg); color: inherit; text-decoration: none; }
.scan-hit .title { display: flex; align-items: center; gap: 8px; font-weight: 700; margin-bottom: 4px; }
.scan-logo { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; }

/* ---- the support console (people who answer), on the model of SaveGram's ---- */
@media (min-width: 800px) { .phone-only { display: none !important; } }
.menu-badge { flex: 0 0 auto; margin-left: .3rem; }
.desk { display: flex; flex-direction: column; height: calc(100dvh - var(--header-h) - 104px); min-height: 460px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.desk-header { display: flex; align-items: center; gap: 8px 18px; padding: 10px 16px; min-height: 58px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.desk-header strong { font-size: 1rem; letter-spacing: -.01em; }
.desk-filters { display: flex; gap: 4px; margin-right: auto; flex-wrap: wrap; }
.desk-filters button { border: 0; background: none; color: var(--muted); font: inherit; font-size: .82rem; padding: 7px 10px; border-radius: 8px; cursor: pointer; min-height: 34px; }
.desk-filters button:hover { background: var(--bg); color: var(--text); }
.desk-filters button.chosen { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.desk-counts { display: flex; gap: 6px; font-size: .75rem; color: var(--muted); }
.desk-counts > span { border: 1px solid var(--line); border-radius: 6px; padding: 4px 8px; font-variant-numeric: tabular-nums; }
.desk-counts > .desk-badge { background: var(--brand); border-color: transparent; color: var(--brand-ink); font-weight: 700; }
.desk-error { margin: 10px 16px 0; color: var(--err); background: var(--err-bg); border-radius: 8px; padding: .4rem .7rem; font-size: .88rem; }
.desk-body { flex: 1; display: grid; grid-template-columns: 340px minmax(0, 1fr); min-height: 0; }
.desk-list { border-right: 1px solid var(--line); overflow-y: auto; }
.desk-row { display: flex; flex-direction: column; gap: 7px; width: 100%; text-align: left; padding: 14px 16px; border: 0; border-bottom: 1px solid var(--line); background: none; color: var(--text); font: inherit; cursor: pointer; }
.desk-row:hover { background: var(--bg); }
.desk-row.chosen { background: var(--brand-soft); }
.desk-row.unread strong::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--brand); margin-right: 7px; vertical-align: middle; }
.desk-row-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.desk-row-top strong { font-size: .9rem; overflow-wrap: anywhere; }
.desk-tags { display: flex; gap: 5px; flex-wrap: wrap; }
.desk-tag { font-size: .68rem; border: 1px solid var(--line); border-radius: 5px; padding: 2px 6px; color: var(--muted); }
.desk-tag.open { border-color: transparent; background: var(--brand-soft); color: var(--brand); }
.desk-tag.pending { border-color: transparent; background: var(--ok-bg); color: var(--ok); }
.desk-tag.closed { border-color: transparent; background: var(--bg); }
.desk-preview { font-size: .78rem; line-height: 1.5; max-height: 2.4rem; overflow: hidden; overflow-wrap: anywhere; color: var(--muted); }
.desk-thread { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.desk-thread-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.desk-thread-head h2 { margin: 0 0 4px; font-size: 1.05rem; overflow-wrap: anywhere; }
.desk-thread-head p { margin: 0; }
.desk-thread-head .btn { white-space: nowrap; }
.desk-facts { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .25rem .8rem; margin: 0; padding: 10px 20px; border-bottom: 1px solid var(--line); font-size: .8rem; }
.desk-facts:empty { display: none; }
.desk-facts dt { color: var(--muted); }
.desk-facts dd { margin: 0; overflow-wrap: anywhere; }
.desk-messages { flex: 1; overflow-y: auto; padding: 18px 20px; display: flex; flex-direction: column; gap: 12px; background: var(--bg); }
.desk-msg { max-width: 620px; align-self: flex-start; border: 1px solid var(--line); border-radius: 12px; padding: 11px 14px; background: var(--card); }
.desk-msg.support { align-self: flex-end; background: var(--brand-soft); border-color: transparent; }
.desk-msg p { margin: 0; font-size: .9rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.desk-stamp { display: block; font-size: .68rem; margin-top: 6px; color: var(--muted); }
.desk-shot { display: block; max-width: min(320px, 100%); max-height: 320px; border-radius: 9px; margin-top: 8px; border: 1px solid var(--line); }
.desk-reply { border-top: 1px solid var(--line); padding: 12px 20px; display: flex; gap: 12px; align-items: flex-end; }
.desk-reply-box { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.desk-reply textarea { width: 100%; resize: vertical; min-height: 70px; line-height: 1.5; }
.desk-templates { display: flex; gap: 6px; flex-wrap: wrap; }
.desk-templates .btn { min-height: 30px; font-size: .8rem; font-weight: 500; }
.desk-reply .btn { white-space: nowrap; }
.desk-blank { padding: 40px 20px; font-size: .9rem; color: var(--muted); margin: 0; }
@media (max-width: 799px) {
  .desk { height: auto; }
  .desk-body { grid-template-columns: minmax(0, 1fr); }
  .desk-list { border-right: 0; border-bottom: 1px solid var(--line); max-height: 45vh; }
  .desk-messages { padding: 14px; min-height: 240px; }
  .desk-thread-head, .desk-facts { padding-left: 14px; padding-right: 14px; }
  .desk-reply { padding: 12px 14px; flex-direction: column; align-items: stretch; }
}

/* ---- support for users: situations, requests and their stages, letters ---- */
.sp-hero { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .8rem 1rem; align-items: start; border: 1px solid color-mix(in srgb, var(--brand) 22%, var(--line)); border-radius: var(--radius); padding: 18px; margin-bottom: 14px; background: linear-gradient(135deg, var(--brand-soft), var(--card) 70%); }
.sp-hero-ico { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 16px; background: var(--brand); color: var(--brand-ink); }
.sp-hero-ico .icon { width: 30px; height: 30px; }
.sp-hero h2 { margin: 0 0 .2rem; }
.sp-hero p { margin: .2rem 0; }
.sp-hero .btn.big { grid-column: 1 / -1; margin-top: .2rem; }
.sp-note { display: flex; gap: .4rem; align-items: center; color: var(--muted); font-size: .9rem; }
.sp-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.sp-row { display: flex; gap: .8rem; align-items: center; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); text-decoration: none; color: inherit; box-shadow: var(--shadow); }
.sp-row:hover { border-color: var(--brand); }
.sp-row-ico { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: var(--chip); font-size: 1.35rem; flex: 0 0 auto; }
.sp-row-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.35; gap: .1rem; }
.sp-row-about { font-weight: 400; color: var(--muted); }
.sp-row-preview { color: var(--muted); font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sp-row.unread { border-color: color-mix(in srgb, var(--brand) 45%, var(--line)); }
.sp-row.unread .sp-row-preview { color: var(--text); font-weight: 600; }
.sp-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--brand); margin-right: .4rem; vertical-align: 1px; }
.sp-pill { flex: 0 0 auto; border-radius: 999px; padding: .2rem .65rem; font-size: .78rem; font-weight: 700; white-space: nowrap; }
.sp-pill.sent { background: var(--chip); color: var(--muted); }
.sp-pill.read { background: var(--info-bg); color: var(--info); }
.sp-pill.answered { background: var(--brand); color: var(--brand-ink); }
.sp-pill.closed { background: var(--ok-bg); color: var(--ok); }
.sp-foot { margin-top: 1rem; }
.sp-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.sp-tile { display: flex; flex-direction: column; gap: .2rem; align-items: flex-start; text-align: left; padding: 12px; border: 1.5px solid var(--line); border-radius: var(--radius-sm); background: var(--card); color: var(--text); font: inherit; cursor: pointer; min-height: 108px; }
.sp-tile:hover { border-color: var(--muted); }
.sp-tile.on { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 1px var(--brand) inset; }
.sp-tile-emoji { font-size: 1.6rem; line-height: 1.1; }
.sp-tile b { font-size: 1rem; }
.sp-tile-hint { font-size: .82rem; color: var(--muted); line-height: 1.3; }
/* The delivery is not ours: its tile looks set apart, and says who it belongs to. */
.sp-tile.elsewhere { border-style: dashed; background: var(--bg); }
.sp-tile.elsewhere.on { border-color: var(--warn); background: var(--warn-bg); box-shadow: none; }
.sp-tile-tag { margin-top: auto; font-size: .72rem; font-weight: 700; color: var(--warn); background: var(--warn-bg); border-radius: 999px; padding: .1rem .5rem; }
.sp-elsewhere { border-color: var(--warn); }
.sp-elsewhere h3 { color: var(--warn); }
.sp-scope h3 { margin-bottom: .3rem; }
.sp-scope.compact { box-shadow: none; }
.sp-scope-list { list-style: none; padding: 0; margin: .3rem 0; display: flex; flex-direction: column; gap: .35rem; }
.sp-scope-list li { display: flex; gap: .55rem; align-items: flex-start; }
.sp-scope-mark { flex: 0 0 auto; width: 1.4rem; text-align: center; font-weight: 800; }
.sp-scope-list li.yes .sp-scope-mark { color: var(--ok); }
.sp-scope-list li.no { color: var(--muted); margin-top: .2rem; padding-top: .45rem; border-top: 1px solid var(--line); }
.sp-scope-list li.no b { color: var(--text); }
.sp-scope-list li.no .sp-scope-mark { color: var(--err); }
.sp-choice-emoji { font-size: 1.3rem; flex: 0 0 auto; }
.step-card textarea { margin-bottom: .6rem; resize: vertical; line-height: 1.5; }
.sp-seen { margin: .2rem 0 .4rem; padding-left: 1.2rem; font-size: .92rem; }
.sp-seen li { margin: .15rem 0; overflow-wrap: anywhere; }
.sp-picker { display: flex; flex-direction: column; align-items: flex-start; gap: .5rem; margin-bottom: .6rem; }
.sp-shots { display: flex; gap: 8px; flex-wrap: wrap; }
.sp-shots:empty { display: none; }
.sp-thumb { position: relative; width: 84px; height: 84px; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: var(--chip); padding: 0; flex: 0 0 auto; }
button.sp-thumb { cursor: zoom-in; }
.sp-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sp-thumb.loading::after { content: ""; position: absolute; inset: 0; margin: auto; width: 22px; height: 22px; border: 2.5px solid var(--line); border-top-color: var(--brand); border-radius: 50%; animation: spin .7s linear infinite; }
.sp-thumb-x { position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .6); color: #fff; display: grid; place-items: center; cursor: pointer; padding: 0; }
.sp-thumb-x .icon { width: 15px; height: 15px; }
.sp-full { display: block; max-width: 100%; max-height: 75vh; margin: 0 auto; border-radius: 10px; }
.sp-head-top { display: flex; gap: .8rem; align-items: center; }
.sp-head h2 { margin: 0; font-size: 1.3rem; }
.sp-subject { display: flex; gap: .5rem; align-items: center; background: var(--chip); border-radius: 10px; padding: .45rem .7rem; font-size: .9rem; margin: .7rem 0 .2rem; overflow-wrap: anywhere; }
.sp-track { list-style: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); padding: 0; margin: .9rem 0 0; }
.sp-track li { position: relative; text-align: center; font-size: .78rem; color: var(--muted); padding: 24px 2px 0; overflow-wrap: anywhere; }
.sp-track li::before { content: ""; position: absolute; top: 4px; left: 50%; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%; background: var(--card); border: 2px solid var(--line); box-sizing: border-box; z-index: 1; }
.sp-track li::after { content: ""; position: absolute; top: 10px; right: 50%; width: 100%; height: 2px; background: var(--line); }
.sp-track li:first-child::after { display: none; }
.sp-track li.done { color: var(--text); font-weight: 600; }
.sp-track li.done::before { background: var(--ok); border-color: var(--ok); }
.sp-track li.done::after { background: var(--ok); }
.sp-track li.now::before { background: var(--brand); border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.sp-track time { display: block; font-weight: 400; color: var(--muted); font-size: .7rem; }
.sp-letters { display: flex; flex-direction: column; gap: 10px; margin: 12px 0; }
.sp-letter { border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); padding: 12px 14px; box-shadow: var(--shadow); }
.sp-letter.team { border-left: 4px solid var(--brand); }
.sp-letter header { display: flex; justify-content: space-between; gap: .6rem; font-size: .82rem; color: var(--muted); margin-bottom: .35rem; flex-wrap: wrap; }
.sp-from { display: inline-flex; gap: .35rem; align-items: center; font-weight: 700; color: var(--text); }
.sp-letter.team .sp-from { color: var(--brand); }
.sp-letter p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.sp-letter .sp-shots { margin-top: .6rem; }
.sp-ask h3 { margin-bottom: .2rem; }
.sp-composer textarea { resize: vertical; line-height: 1.5; margin-bottom: .6rem; }
.sp-composer-row { display: flex; gap: .6rem; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; }
.sp-composer-row .sp-picker { margin-bottom: 0; }
.sp-order-help { display: flex; gap: .8rem; align-items: center; flex-wrap: wrap; }
.sp-order-help-ico { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--brand-soft); color: var(--brand); flex: 0 0 auto; }
@media (max-width: 520px) {
  .sp-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sp-tile { min-height: 96px; }
  .sp-row { align-items: flex-start; }
  .sp-pill { font-size: .72rem; }
}

/* ---- "Скидка 7000 от 12000": where Rappi gives the deal (views/dealwatch.js) ---- */
.deal-store { display: flex; gap: .8rem; align-items: flex-start; }
.deal-logo { width: 48px; height: 48px; border-radius: 12px; object-fit: cover; flex: 0 0 auto; background: var(--chip); }
.deal-store .title a { color: inherit; text-decoration: none; }
.deal-store .title a:hover { text-decoration: underline; }
.deal-counts { display: flex; gap: 1.6rem; flex-wrap: wrap; margin-bottom: .4rem; }
.deal-counts > div { display: flex; flex-direction: column; }
.deal-counts b { font-size: 1.6rem; line-height: 1.1; }
.deal-depts { margin: .35rem 0 .2rem; }
.deal-depts .chip { min-height: 32px; padding: .2rem .7rem; font-size: .85rem; text-decoration: none; }
table.deal-places { width: 100%; border-collapse: collapse; font-size: .92rem; }
table.deal-places th { text-align: left; font-weight: 600; color: var(--muted); padding: .3rem .25rem; }
table.deal-places td { padding: .4rem .25rem; border-top: 1px solid var(--line); vertical-align: top; }

/* ---- "Где скидка рядом": the showcase (views/nearby.js) and its links ---- */
.deal-store.link { color: inherit; text-decoration: none; align-items: center; }
.deal-store.link:hover { border-color: var(--brand); }
.deal-store .chev { color: var(--muted); flex: 0 0 auto; }
.offer-nearby { display: flex; align-items: center; gap: .4rem; margin: .5rem 0 .2rem; padding: .55rem .7rem; border-radius: 12px; background: var(--brand-soft); color: var(--text); text-decoration: none; font-size: .92rem; }
.offer-nearby span { flex: 1 1 auto; }
.offer-nearby .icon:first-child { color: var(--brand); }

/* ---- before an account is rented: the first page, the browser's cart, the checkout steps ---- */
.start-point .title { overflow-wrap: anywhere; }
.start-point > .icon { color: var(--brand); }
.start-shop { width: 100%; justify-content: center; margin: .2rem 0 1rem; }
.todo .todo-body { margin-top: .6rem; }
.todo .todo-body .form { margin: 0; }
.todo > li.todo-extra { background: none; padding: 0 .7rem .2rem 3.1rem; display: block; }
button.choice-row { width: 100%; text-align: left; font: inherit; cursor: pointer; }
button.choice-row > .icon { color: var(--brand); }
.todo > li:has(.todo-body) { align-items: flex-start; }
.deal-panel .ruler { height: 0; }
.deal-group .chip.more-chip { background: transparent; border-color: var(--line); color: var(--muted); white-space: nowrap; }
.toolbar > .chips > .pct-custom { background: var(--chip); min-height: 40px; padding: 0 .35rem 0 .95rem; font-size: .95rem; }
.toolbar > .chips > .pct-custom.active { background: var(--brand); color: var(--brand-ink); }
.toolbar > .chips > .pct-custom .cc { width: 58px; min-height: 30px; padding: .15rem .4rem; }

/* ---- the admin sections (views/admin*.js) ---- */
.admin-head { margin-bottom: .2rem; }
.admin-nav { display: flex; gap: .3rem; flex-wrap: wrap; margin: 0 0 12px; padding: 4px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.admin-nav-item { flex: 1 1 auto; text-align: center; padding: .45rem .8rem; border-radius: var(--radius-sm); color: var(--muted); text-decoration: none; font-weight: 600; font-size: .92rem; white-space: nowrap; }
.admin-nav-item:hover { background: var(--chip); color: var(--text); }
.admin-nav-item.active { background: var(--brand); color: var(--brand-ink); }
.back-link { display: inline-flex; align-items: center; gap: .2rem; margin: 0 0 .6rem; color: var(--brand); text-decoration: none; font-weight: 600; font-size: .92rem; }
.back-link svg { width: 18px; height: 18px; }
.plain-link { color: inherit; text-decoration: underline; text-decoration-color: color-mix(in srgb, currentColor 35%, transparent); text-underline-offset: 2px; }
.plain-link:hover { color: var(--brand); }
.chip-count { margin-left: .35rem; font-size: .78rem; opacity: .75; font-variant-numeric: tabular-nums; }
.admin-tabs { margin-bottom: .8rem; }
.period { display: flex; align-items: center; gap: .35rem; flex: 1 1 260px; }
.period input { flex: 1 1 120px; min-width: 0; }
.control-row .chips { margin-bottom: 0; }
.admin-tiles .admin-tile { text-decoration: none; color: inherit; }
.admin-tiles .admin-tile:hover { border-color: var(--brand); }
.admin-tile.warn strong { color: var(--warn); }
.admin-user { margin: 0; }
.admin-user .chev { margin-left: auto; }
.admin-account { align-items: flex-start; margin: 0; }
.admin-profile { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: .4rem 1.6rem; align-items: start; }
.admin-facts { grid-template-columns: minmax(110px, max-content) minmax(0, 1fr); align-content: start; }
.admin-facts dd { text-align: left; font-weight: 500; overflow-wrap: anywhere; }
.admin-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: .25rem .7rem; font-size: .9rem; padding: .45rem 0; border-bottom: 1px solid var(--line); }
.admin-line:last-child { border-bottom: 0; }
.admin-line.now { background: color-mix(in srgb, var(--brand-soft) 60%, transparent); border-radius: var(--radius-sm); padding-left: .5rem; padding-right: .5rem; }
.admin-line.bad { color: var(--err); }
.admin-line-when { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.list.admin-lines { gap: 0; }
a.admin-line { color: inherit; text-decoration: none; }
a.admin-line:hover { background: color-mix(in srgb, var(--chip) 50%, transparent); }
.admin-item { border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--card); }
.admin-item > summary { display: flex; align-items: center; gap: .6rem; padding: .6rem .75rem; list-style: none; }
.admin-item > summary::-webkit-details-marker { display: none; }
.admin-item > summary .title { font-weight: 600; }
.admin-item-sub { display: block; margin-top: .1rem; }
.admin-item > summary .chev-ico { color: var(--muted); transition: transform .15s; flex: none; }
.admin-item[open] > summary .chev-ico { transform: rotate(180deg); }
.admin-item-body { padding: 0 .75rem .75rem; display: flex; flex-direction: column; gap: .6rem; }
.order-items { margin-top: 0; }
.audit td.num, .audit th.num { text-align: right; }
.nowrap { white-space: nowrap; }
.audit-log .audit-row { cursor: pointer; }
.audit-log .audit-row:hover td { background: color-mix(in srgb, var(--chip) 50%, transparent); }
.audit-log .audit-params { max-width: 360px; overflow-wrap: anywhere; color: var(--muted); }
.audit-detail td { background: color-mix(in srgb, var(--chip) 35%, transparent); }
.audit-json { display: block; white-space: pre-wrap; font-size: .8rem; overflow-wrap: anywhere; }
.admin-results.stale { pointer-events: none; }
