/* Приложение пассажира. Только токены из /shared/tokens.css. */
html, body { min-height: 100%; }
body { background: var(--bg); overscroll-behavior-y: none; }
body.no-scroll { overflow: hidden; }

.p-app {
  max-width: 560px; margin: 0 auto; min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column; background: var(--bg);
  padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right);
}
.p-main { flex: 1; display: flex; flex-direction: column; }

/* ---------- шапка ---------- */
.p-top {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: var(--s1);
  min-height: calc(var(--tap) + var(--s3)); padding: env(safe-area-inset-top) var(--s2) 0 var(--s3);
  background: var(--surface); border-bottom: 1px solid var(--line);
}
.p-brand { display: flex; align-items: center; gap: var(--s2); font-weight: 750; font-size: var(--t-lg); letter-spacing: -.01em; }
.p-logo {
  width: 32px; height: 32px; border-radius: var(--r-md); display: grid; place-items: center;
  background: var(--accent); color: var(--accent-ink);
}
.p-top-title { font-size: var(--t-lg); font-weight: 700; padding-left: var(--s1); }
.p-route-order .p-top { position: relative; }

.p-offline {
  display: flex; align-items: center; gap: var(--s2); padding: var(--s2) var(--s3);
  background: var(--warn-soft); color: var(--warn); font-size: var(--t-sm); font-weight: 600;
  border-bottom: 1px solid var(--line);
}
.p-offline span { flex: 1; }
.p-offline .btn { color: var(--text); }

/* ---------- карта ---------- */
.p-map-wrap { position: relative; }
.p-map { position: relative; isolation: isolate; z-index: 0; background: var(--surface-3); }
.p-map-canvas { position: absolute; inset: 0; background: var(--surface-3); }
.p-map-home { height: clamp(200px, 32vh, 300px); }
.p-map-order { height: clamp(220px, 38vh, 340px); }
.p-map-fallback {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--s2);
  color: var(--text-3); font-size: var(--t-sm);
}
.p-map .leaflet-container { font: inherit; background: var(--surface-3); }
.p-map .leaflet-control-attribution {
  font-size: 10px; background: var(--surface); color: var(--text-2);
  border-radius: 0 0 0 var(--r-sm);
}
.p-map .leaflet-control-attribution a { color: var(--text-2); }
:root[data-theme="dark"] .p-map .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(.85) contrast(.9); }

.p-mk { border-radius: 50%; border: 3px solid var(--surface); box-shadow: var(--shadow-2); display: grid; place-items: center; }
.p-mk-from { background: var(--text); }
.p-mk-to { background: var(--accent); }
.p-mk-stop { background: var(--surface); border-color: var(--text-2); }
.p-mk span { font-size: 11px; font-weight: 800; color: var(--text); line-height: 1; }
.p-mk-car {
  border-radius: 50%; background: var(--text); color: var(--accent); display: grid; place-items: center;
  border: 3px solid var(--accent); box-shadow: var(--shadow-2); transition: transform var(--t-base);
}

.p-float { box-shadow: var(--shadow-2); border-color: var(--line); }
.p-locate { position: absolute; right: var(--s3); bottom: calc(var(--s5) + var(--s3)); z-index: 5; border-radius: var(--r-pill); padding: 0 var(--s4); }

/* ---------- панель под картой ---------- */
.p-panel {
  position: relative; z-index: 5; flex: 1;
  margin-top: calc(-1 * var(--s5)); padding: var(--s5) var(--s4) var(--s6);
  background: var(--surface); border-radius: var(--r-xl) var(--r-xl) 0 0;
  box-shadow: 0 -1px 0 var(--line);
}
.p-h1 { font-size: var(--t-2xl); font-weight: 760; letter-spacing: -.02em; line-height: 1.15; margin-bottom: var(--s4); }
.p-h2 { font-size: var(--t-lg); font-weight: 700; margin: var(--s6) 0 var(--s3); }
.p-note { font-size: var(--t-xs); color: var(--text-3); margin-top: var(--s4); line-height: 1.5; }
.p-center { text-align: center; }
.p-mt { margin-top: var(--s4); }

.p-active-banner {
  width: 100%; display: flex; align-items: center; gap: var(--s3); min-height: 56px; margin-bottom: var(--s4);
  padding: var(--s2) var(--s3) var(--s2) var(--s4); border: 1px solid var(--accent); border-radius: var(--r-lg);
  background: var(--accent-soft); color: var(--text); text-align: left; cursor: pointer;
  transition: background var(--t-fast);
}
.p-active-banner:hover { background: color-mix(in srgb, var(--accent-soft) 70%, var(--accent)); }
.p-active-banner > span:nth-child(2) { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.p-active-banner small { color: var(--text-2); font-size: var(--t-sm); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-pulse { width: 10px; height: 10px; border-radius: 50%; background: var(--accent-deep); animation: pulse 1.4s ease-out infinite; flex: 0 0 auto; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 80%, transparent); } 100% { box-shadow: 0 0 0 12px transparent; } }

/* ---------- адреса ---------- */
.p-addrs { border: 1px solid var(--line-strong); border-radius: var(--r-lg); background: var(--surface); }
.p-addrs > * + *, .p-addrs > div + .p-addr { border-top: 1px solid var(--line); }
.p-addr { position: relative; }
.p-addr-row { display: flex; align-items: center; gap: var(--s1); padding: 0 var(--s1) 0 var(--s4); min-height: 60px; }
.p-addr.is-error .p-addr-row { box-shadow: inset 3px 0 0 var(--danger); }
.p-addrs:has(.is-error) { border-color: var(--danger); }
.p-addrs > :first-child .p-addr-row, .p-addrs > .p-addr:first-child .p-addr-row { border-radius: var(--r-lg) var(--r-lg) 0 0; }
.p-dot { width: 10px; height: 10px; border-radius: 50%; flex: 0 0 auto; display: inline-block; }
.p-dot-from { background: var(--text); }
.p-dot-to { background: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.p-dot-stop { background: var(--surface); border: 2px solid var(--text-3); }
.p-addr-body { flex: 1; min-width: 0; display: flex; flex-direction: column; padding: var(--s2) 0 var(--s2) var(--s3); cursor: text; }
.p-addr-label { font-size: var(--t-xs); font-weight: 650; color: var(--text-3); text-transform: uppercase; letter-spacing: .04em; line-height: 1.2; }
.p-addr-input {
  width: 100%; border: 0; background: transparent; padding: 2px 0; min-height: 28px;
  font-size: var(--t-lg); font-weight: 600; color: var(--text);
}
.p-addr-input::placeholder { color: var(--text-3); font-weight: 500; }
.p-addr-input:focus { outline: none; }
.p-addr-row:focus-within { box-shadow: inset 3px 0 0 var(--focus); }
.p-addr-error { padding: 0 var(--s4) var(--s3) calc(var(--s4) + 22px); }
.p-entr {
  width: 76px; min-height: 36px; padding: 0 var(--s2); border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  background: var(--surface-2); font-size: var(--t-sm); text-align: center;
  transition: border-color var(--t-fast);
}
.p-entr:hover { border-color: var(--text-3); }
.p-entr:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 22%, transparent); }
.p-addr-map { color: var(--text-2); }

.p-suggest {
  position: absolute; left: var(--s2); right: var(--s2); top: calc(100% - var(--s1)); z-index: 40;
  list-style: none; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
  box-shadow: var(--shadow-2); max-height: 300px; overflow: auto; padding: var(--s1) 0;
}
.p-suggest-item {
  display: flex; align-items: flex-start; gap: var(--s3); padding: var(--s3) var(--s4); min-height: var(--tap);
  cursor: pointer; color: var(--text-2);
}
.p-suggest-item span { display: flex; flex-direction: column; min-width: 0; }
.p-suggest-item b { font-weight: 600; color: var(--text); }
.p-suggest-item small { font-size: var(--t-xs); color: var(--text-3); }
.p-suggest-item:hover, .p-suggest-item.is-hi { background: var(--surface-2); }
.p-suggest-note { padding: var(--s3) var(--s4); font-size: var(--t-sm); color: var(--text-3); }

.p-addr-tools { display: flex; margin-top: var(--s2); }
.p-add-stop { min-height: var(--tap); color: var(--text-2); padding-left: var(--s2); }

/* ---------- чипы ---------- */
.p-chips { display: flex; gap: var(--s2); overflow-x: auto; margin-top: var(--s3); padding-bottom: 2px; scrollbar-width: none; }
.p-chips::-webkit-scrollbar { display: none; }
.p-chips-wrap { flex-wrap: wrap; overflow: visible; }
.p-chips .chip { min-height: var(--tap); flex: 0 0 auto; padding: 0 var(--s4); }
.chip:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.chip:active:not(:disabled) { transform: translateY(1px); }
.p-chip-ghost { border-style: dashed; color: var(--text-2); }
.p-chip-price { color: var(--text-3); font-weight: 600; }
.chip[aria-pressed="true"] .p-chip-price, .chip[aria-checked="true"] .p-chip-price { color: inherit; opacity: .75; }
.p-group { margin-top: var(--s4); }
.p-group-name { font-size: var(--t-sm); font-weight: 650; color: var(--text-2); }
.p-group .p-chips { margin-top: var(--s2); }

/* ---------- тарифы ---------- */
.p-tariffs { display: flex; flex-direction: column; gap: var(--s2); }
.p-tariff {
  display: flex; align-items: center; gap: var(--s3); width: 100%; min-height: 64px; padding: var(--s3);
  border: 2px solid var(--line); border-radius: var(--r-lg); background: var(--surface); text-align: left; cursor: pointer;
  transition: border-color var(--t-fast), background var(--t-fast);
}
.p-tariff:hover { border-color: var(--line-strong); }
.p-tariff:active { background: var(--surface-2); }
.p-tariff[aria-checked="true"] { border-color: var(--text); background: var(--surface-2); }
.p-tariff-ic {
  width: 44px; height: 44px; border-radius: var(--r-md); display: grid; place-items: center; flex: 0 0 auto;
  background: var(--surface-3); color: var(--text);
}
.p-tariff[aria-checked="true"] .p-tariff-ic { background: var(--accent); color: var(--accent-ink); }
.p-tariff-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.p-tariff-main b { font-size: var(--t-lg); font-weight: 700; }
.p-tariff-main small { color: var(--text-3); font-size: var(--t-sm); }
.p-tariff-price { display: flex; flex-direction: column; align-items: flex-end; text-align: right; flex: 0 0 auto; max-width: 42%; }
.p-tariff-price b { font-size: var(--t-lg); font-weight: 760; white-space: nowrap; }
.p-tariff-price small { color: var(--text-3); font-size: var(--t-xs); line-height: 1.3; }
.p-tariff.is-loading .p-tariff-price b { opacity: .45; }

.p-inline-row {
  display: flex; align-items: center; gap: var(--s3); margin-top: var(--s2); padding: var(--s3) var(--s3) var(--s3) var(--s4);
  border-radius: var(--r-lg); background: var(--surface-2);
}
.p-inline-row > span { flex: 1; display: flex; flex-direction: column; }
.p-inline-row small { color: var(--text-3); font-size: var(--t-xs); }
.p-inline-error {
  display: flex; align-items: center; gap: var(--s2); margin-top: var(--s3); padding: var(--s2) var(--s2) var(--s2) var(--s3);
  border-radius: var(--r-md); background: var(--danger-soft); color: var(--danger); font-size: var(--t-sm);
}
.p-inline-error span { flex: 1; }
.p-inline-error .btn { color: var(--text); }

.p-lines { margin-top: var(--s3); display: flex; flex-direction: column; gap: var(--s1); font-size: var(--t-sm); }
.p-lines > div { display: flex; justify-content: space-between; gap: var(--s3); color: var(--text-2); }
.p-lines dd { color: var(--text); font-weight: 600; }

/* ---------- счётчик и переключатель ---------- */
.p-stepper { display: inline-flex; align-items: center; gap: var(--s2); }
.p-stepper output { min-width: 44px; text-align: center; font-weight: 700; font-size: var(--t-lg); }
.p-stepper .btn { border-radius: var(--r-pill); }

.p-seg { display: flex; padding: var(--s1); background: var(--surface-3); border-radius: var(--r-md); gap: var(--s1); }
.p-seg button {
  flex: 1; min-height: 40px; border: 0; border-radius: var(--r-sm); background: transparent; font-weight: 650; color: var(--text-2); cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast);
}
.p-seg button:hover { color: var(--text); }
.p-seg button[aria-checked="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-1); }

/* ---------- строки деталей ---------- */
.p-rows { border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.p-row {
  display: flex; align-items: center; gap: var(--s3); width: 100%; min-height: 56px; padding: var(--s2) var(--s3) var(--s2) var(--s4);
  background: var(--surface); border: 0; text-align: left; cursor: pointer; color: var(--text-2);
  transition: background var(--t-fast);
}
.p-row + .p-row { border-top: 1px solid var(--line); }
button.p-row:hover { background: var(--surface-2); }
button.p-row:active { background: var(--surface-3); }
.p-row:focus-visible { outline-offset: -2px; }
.p-row-static { cursor: default; }
.p-row-k { color: var(--text); font-weight: 600; flex: 0 0 auto; }
.p-row-v { flex: 1; min-width: 0; text-align: right; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-row-v.is-empty { color: var(--text-3); }
.p-row-static .p-stepper { margin-left: auto; }

/* ---------- нижняя кнопка ---------- */
.p-foot {
  position: sticky; bottom: 0; z-index: 20;
  padding: var(--s3) var(--s4) calc(var(--s3) + env(safe-area-inset-bottom));
  background: var(--surface); border-top: 1px solid var(--line);
}
.p-foot-note { font-size: var(--t-xs); color: var(--text-2); text-align: center; margin-bottom: var(--s2); }
.p-cta { font-weight: 760; }

/* ---------- шторки ---------- */
.p-sheet { padding-top: var(--s2); }
.p-sheet-grab { width: 40px; height: 4px; border-radius: var(--r-pill); background: var(--line-strong); margin: 0 auto var(--s2); }
.p-sheet:focus { outline: none; }
.p-sheet-head { display: flex; align-items: center; gap: var(--s2); margin-bottom: var(--s3); }
.p-sheet-head h2 { flex: 1; font-size: var(--t-xl); font-weight: 720; }
.p-sheet-head .btn { margin-right: calc(-1 * var(--s2)); }
.p-sheet-text { color: var(--text-2); }
.p-sheet-foot { margin-top: var(--s5); }
.input-lg { min-height: 52px; font-size: var(--t-lg); }
.p-code { letter-spacing: .5em; text-align: center; font-weight: 700; font-size: var(--t-xl); }
.p-link { border: 0; background: none; color: var(--info); font-weight: 600; cursor: pointer; padding: var(--s1); min-height: var(--tap); }
.p-link:hover { text-decoration: underline; }
.p-login-help { margin-top: var(--s3); }
.sheet-backdrop { padding-top: env(safe-area-inset-top); }

.p-radios { display: flex; flex-direction: column; gap: var(--s2); margin-top: var(--s3); }
.p-radio {
  display: flex; align-items: center; gap: var(--s3); min-height: 52px; padding: 0 var(--s4); text-align: left;
  border: 1px solid var(--line-strong); border-radius: var(--r-md); background: var(--surface); cursor: pointer; font-weight: 600;
  transition: border-color var(--t-fast), background var(--t-fast);
}
.p-radio:hover { background: var(--surface-2); }
.p-radio[aria-checked="true"] { border-color: var(--text); background: var(--surface-2); }
.p-radio-mark { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line-strong); flex: 0 0 auto; display: grid; place-items: center; }
.p-radio[aria-checked="true"] .p-radio-mark { border-color: var(--text); }
.p-radio[aria-checked="true"] .p-radio-mark::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--text); }
.p-radios[aria-invalid="true"] .p-radio { border-color: var(--danger); }

/* ---------- выбор точки на карте ---------- */
.p-picker { position: fixed; inset: 0; z-index: 950; display: flex; flex-direction: column; background: var(--surface); }
.p-picker-top {
  position: absolute; z-index: 10; left: 0; right: 0; top: 0; display: flex; align-items: center; gap: var(--s3);
  padding: calc(env(safe-area-inset-top) + var(--s3)) var(--s3) var(--s3);
}
.p-picker-title { padding: var(--s2) var(--s4); border-radius: var(--r-pill); background: var(--surface); box-shadow: var(--shadow-2); font-weight: 700; }
.p-picker-map { position: relative; flex: 1; }
.p-picker-map .p-map { position: absolute; inset: 0; }
.p-picker-pin { position: absolute; left: 50%; top: 50%; z-index: 8; pointer-events: none; transform: translate(-50%, -100%); }
.p-picker-pin span {
  display: block; width: 28px; height: 28px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg);
  background: var(--accent); border: 3px solid var(--text); box-shadow: var(--shadow-2);
}
.p-picker-pin::after {
  content: ""; position: absolute; left: 50%; bottom: -6px; width: 8px; height: 4px; transform: translateX(-50%);
  border-radius: 50%; background: color-mix(in srgb, var(--text) 40%, transparent);
}
.p-picker-locate { position: absolute; right: var(--s3); bottom: var(--s5); z-index: 8; border-radius: 50%; }
.p-picker-card {
  position: relative; z-index: 10; margin-top: calc(-1 * var(--s4)); padding: var(--s5) var(--s4) calc(var(--s4) + env(safe-area-inset-bottom));
  background: var(--surface); border-radius: var(--r-xl) var(--r-xl) 0 0; box-shadow: var(--shadow-2);
}
.p-picker-addr { display: flex; align-items: center; gap: var(--s3); min-height: 32px; font-size: var(--t-lg); font-weight: 650; }
.p-picker-addr span:not(.skeleton) { flex: 1; }
.p-picker-card .p-note { margin: var(--s2) 0 var(--s4); }

/* ---------- экран заказа ---------- */
.p-page { flex: 1; display: flex; flex-direction: column; }
.p-status { display: flex; gap: var(--s4); align-items: flex-start; }
.p-status-ic {
  width: 56px; height: 56px; border-radius: var(--r-lg); display: grid; place-items: center; flex: 0 0 auto;
  background: var(--surface-3); color: var(--text);
}
.p-tone-accent .p-status-ic { background: var(--accent); color: var(--accent-ink); }
.p-tone-ok .p-status-ic, .p-final-ic.p-tone-ok { background: var(--ok-soft); color: var(--ok); }
.p-tone-info .p-status-ic { background: var(--info-soft); color: var(--info); }
.p-tone-warn .p-status-ic { background: var(--accent-soft); color: var(--accent-deep); }
.p-final-ic.p-tone-danger { background: var(--danger-soft); color: var(--danger); }
.p-status-ic.is-pulse { animation: pulse-ring 1.6s ease-out infinite; }
@keyframes pulse-ring { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 70%, transparent); } 100% { box-shadow: 0 0 0 18px transparent; } }
.p-status-title { font-size: var(--t-3xl); font-weight: 780; letter-spacing: -.025em; line-height: 1.05; }
.p-status-text { color: var(--text-2); margin-top: var(--s2); font-size: var(--t-md); }

.p-wait { margin-top: var(--s4); padding: var(--s3) var(--s4); border-radius: var(--r-lg); background: var(--ok-soft); }
.p-wait.is-paid { background: var(--warn-soft); }
.p-wait-top { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s3); font-weight: 650; }
.p-wait-top b { font-size: var(--t-xl); }
.p-wait small { display: block; margin-top: var(--s1); color: var(--text-2); font-size: var(--t-xs); }
.p-wait-bar { height: 6px; border-radius: var(--r-pill); background: color-mix(in srgb, var(--ok) 20%, transparent); margin-top: var(--s2); overflow: hidden; }
.p-wait-bar span { display: block; height: 100%; background: var(--ok); transition: width 1s linear; }

.p-car { margin-top: var(--s4); padding: var(--s4); border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--surface-2); }
.p-car-top { display: flex; align-items: center; gap: var(--s3); margin-bottom: var(--s3); }
.p-car-name { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.p-car-name b { font-size: var(--t-lg); font-weight: 700; }
.p-car-name small { color: var(--text-2); }
.p-plate {
  display: inline-flex; align-items: stretch; border: 2px solid var(--text); border-radius: var(--r-sm); overflow: hidden;
  background: var(--surface); color: var(--text); font-weight: 800; font-size: var(--t-lg); letter-spacing: .04em; line-height: 1;
  white-space: nowrap; flex: 0 0 auto;
}
.p-plate b { padding: var(--s2) var(--s2); }
.p-plate small { padding: var(--s2) var(--s1); border-left: 2px solid var(--text); font-size: var(--t-sm); display: grid; place-items: center; }

.p-card { padding: var(--s4); margin-top: var(--s4); }
.p-route { list-style: none; display: flex; flex-direction: column; gap: var(--s3); position: relative; }
.p-route li { display: flex; gap: var(--s3); align-items: flex-start; }
.p-route li .p-dot { margin-top: 7px; }
.p-route li > span:last-child { display: flex; flex-direction: column; font-weight: 600; }
.p-route small { font-size: var(--t-xs); color: var(--text-3); font-weight: 600; }
.p-card-foot { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--s3); margin-top: var(--s4); padding-top: var(--s3); border-top: 1px solid var(--line); }
.p-card-foot > span { display: flex; flex-direction: column; color: var(--text-2); }
.p-card-foot small { font-size: var(--t-xs); color: var(--text-3); }
.p-card-foot b { font-size: var(--t-lg); }
.p-order-actions { display: flex; flex-direction: column; gap: var(--s2); margin-top: var(--s5); }

/* ---------- итог и отмена ---------- */
.p-final { padding: var(--s7) var(--s4) calc(var(--s6) + env(safe-area-inset-bottom)); align-items: stretch; }
.p-final-ic { width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto var(--s4); }
.p-final-title { text-align: center; font-size: var(--t-3xl); font-weight: 780; letter-spacing: -.025em; line-height: 1.1; }
.p-final-sub { text-align: center; color: var(--text-2); margin-top: var(--s2); }
.p-final-actions { display: flex; flex-direction: column; gap: var(--s2); margin-top: var(--s5); }
.p-total { text-align: center; }
.p-total > small { color: var(--text-2); font-weight: 600; }
.p-total > b { display: block; font-size: var(--t-3xl); font-weight: 800; letter-spacing: -.02em; margin-top: var(--s1); }
.p-total .p-lines { text-align: left; border-top: 1px solid var(--line); padding-top: var(--s3); }
.p-rate { text-align: center; }
.p-rate-q { font-weight: 700; font-size: var(--t-lg); margin-bottom: var(--s2); }
.p-rate .field { text-align: left; }

.p-stars { display: flex; justify-content: center; gap: var(--s1); }
.p-star {
  width: 52px; height: 52px; display: grid; place-items: center; border: 0; background: transparent; border-radius: var(--r-md);
  color: var(--line-strong); cursor: pointer; transition: color var(--t-fast), transform var(--t-fast), background var(--t-fast);
}
.p-star:hover:not(:disabled) { background: var(--surface-2); }
.p-star:active:not(:disabled) { transform: scale(.92); }
.p-star.is-on { color: var(--accent); }
.p-star.is-on svg { fill: currentColor; }
.p-stars-sm { display: inline-flex; gap: 1px; color: var(--line-strong); }
.p-stars-sm .is-on { color: var(--accent); }
.p-stars-sm .is-on svg { fill: currentColor; }

/* ---------- списки: история, адреса, профиль ---------- */
.p-list { padding: var(--s4) var(--s4) calc(var(--s6) + env(safe-area-inset-bottom)); gap: var(--s3); }
.p-hcard { overflow: hidden; }
.p-hcard-sk { padding: var(--s4); display: flex; flex-direction: column; gap: var(--s2); }
.p-hcard-main {
  display: flex; flex-direction: column; gap: var(--s2); width: 100%; padding: var(--s4); border: 0; background: transparent; text-align: left; cursor: pointer;
  transition: background var(--t-fast);
}
.p-hcard-main:hover { background: var(--surface-2); }
.p-hcard-main:active { background: var(--surface-3); }
.p-hcard-main:focus-visible { outline-offset: -2px; }
.p-hcard-top { display: flex; justify-content: space-between; align-items: center; gap: var(--s2); font-size: var(--t-sm); }
.p-hcard-route { display: flex; flex-direction: column; gap: var(--s1); font-weight: 600; }
.p-hcard-route > span { display: flex; align-items: center; gap: var(--s2); min-width: 0; }
.p-hcard-bottom { display: flex; align-items: center; gap: var(--s2); font-size: var(--t-sm); }
.p-hcard-bottom b { font-size: var(--t-md); }
.p-hcard-actions { display: flex; justify-content: flex-end; gap: var(--s1); padding: var(--s1) var(--s2); border-top: 1px solid var(--line); }
.p-hcard-actions .btn { min-height: 40px; }

.p-alist { overflow: hidden; }
.p-arow {
  display: flex; align-items: center; gap: var(--s3); width: 100%; min-height: 64px; padding: var(--s2) var(--s2) var(--s2) var(--s4);
  border: 0; background: var(--surface); text-align: left; color: var(--text-3); text-decoration: none; cursor: pointer;
  transition: background var(--t-fast);
}
div.p-arow { cursor: default; }
.p-arow + .p-arow { border-top: 1px solid var(--line); }
button.p-arow:hover, a.p-arow:hover { background: var(--surface-2); }
button.p-arow:active, a.p-arow:active { background: var(--surface-3); }
.p-arow:focus-visible { outline-offset: -2px; }
.p-arow-ic { width: 40px; height: 40px; border-radius: var(--r-md); background: var(--surface-3); color: var(--text); display: grid; place-items: center; flex: 0 0 auto; }
.p-arow-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.p-arow-main b { color: var(--text); font-weight: 650; }
.p-arow-main small { color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-danger-ghost { color: var(--danger); }
.p-danger-ghost:hover:not(:disabled) { background: var(--danger-soft); color: var(--danger); }
.btn-danger svg { color: inherit; }

.p-empty { padding: var(--s8) var(--s4); }
.p-empty-title { font-size: var(--t-lg); font-weight: 700; color: var(--text); margin-bottom: var(--s1); }

/* ---------- ошибка запуска и скелетоны ---------- */
.p-fatal { margin: auto; padding: var(--s6) var(--s4); text-align: center; max-width: 380px; display: flex; flex-direction: column; gap: var(--s3); align-items: center; }
.p-fatal .icon-wrap { width: 64px; height: 64px; border-radius: 50%; background: var(--warn-soft); color: var(--warn); display: grid; place-items: center; }
.p-fatal h1 { font-size: var(--t-2xl); font-weight: 760; }
.p-fatal p { color: var(--text-2); margin-bottom: var(--s3); }

.p-sk-brand { width: 180px; height: 24px; }
.p-sk-map { height: clamp(200px, 32vh, 300px); border-radius: 0; }
.p-sk-title { height: 30px; width: 60%; margin-bottom: var(--s4); }
.p-sk-line { display: block; height: 14px; margin: var(--s2) 0; }
.p-sk-block { height: 120px; border-radius: var(--r-lg); margin: var(--s3) 0; }
.p-sk-price { display: inline-block; width: 72px; height: 20px; }

.toast-wrap { bottom: calc(var(--s5) + env(safe-area-inset-bottom)); }
.p-route-home .toast-wrap { bottom: calc(var(--s8) * 2 + env(safe-area-inset-bottom)); }

a.btn { text-decoration: none; }
.btn svg { flex: 0 0 auto; }

@media (min-width: 561px) {
  .p-app { border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
}
.p-home { flex: 1; display: flex; flex-direction: column; }
/* подсказка и ошибка внутри <label class="field"> не должны наследовать стиль подписи */
.field > .field-hint { font-weight: 500; color: var(--text-3); }
.field > .field-error { font-weight: 600; color: var(--danger); }
/* тёмная тема: белый текст на светлых --ok/--danger даёт 1.9:1 и 2.5:1 — берём тёмный фон как цвет текста (9.6:1 и 7.1:1) */
:root[data-theme="dark"] .btn-danger, :root[data-theme="dark"] .toast-ok, :root[data-theme="dark"] .toast-error { color: var(--bg); }
/* --text-3 на --bg = 4.22:1, для мелкого текста на сером фоне берём --text-2 */
.p-empty, .p-list > .p-note { color: var(--text-2); }
