/* PWA партнёров MoveValencia — mobile-first, светлая / фирменная тёмная / системная тема. */
@font-face{font-family:'Inter';font-style:normal;font-weight:400 800;font-display:swap;src:url('/fonts/inter-var-cyrillic.woff2') format('woff2');unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}
@font-face{font-family:'Inter';font-style:normal;font-weight:400 800;font-display:swap;src:url('/fonts/inter-var-latin.woff2') format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}

:root {
  --ink: #1D1D1F; --soft: #6E6E73; --line: #E5E5E7; --bg: #FFFFFF; --bg2: #F5F5F7; --card: #FFFFFF;
  --accent: #F26C1D; --accent-h: #B94A0C; --accent-bg: #FFF1E8; --ok: #1F9D55; --ok-bg: #E7F6EE; --err: #D93025; --err-bg: #FDECEA;
  --warn: #B26A00; --warn-bg: #FFF6E0; --info: #1F5FBF; --info-bg: #EAF1FC;
  --accent-hover: #FF8B42; --on-accent: #261206; --on-ok: #092415; --on-err: #FFFFFF; --on-warn: #FFFFFF;
  --active: #AD3D08; --active-bg: #FFF1E8; --active-line: #E8B79F;
  --page-background: var(--bg2); --toast-bg: #261633; --toast-ink: #F5EDF8;
  --r: 14px; --tap: 48px; --shadow: 0 1px 2px rgba(0,0,0,.04), 0 2px 10px rgba(0,0,0,.04);
  --sat: env(safe-area-inset-top, 0px); --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px); --sar: env(safe-area-inset-right, 0px);
  --tabbar-h: 64px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --ink: #F5EDF8; --soft: #C3B2D6; --line: #49364F; --bg: #160A22; --bg2: #1C0C2C; --card: #261633;
  --accent-h: #FFAD79; --accent-bg: #382235; --ok: #73D9A1; --ok-bg: #18362C; --err: #FF929E; --err-bg: #402033;
  --warn: #F4CA80; --warn-bg: #3B3027; --info: #A9C7FF; --info-bg: #252C48;
  --on-ok: #0D2116; --on-err: #2D1017; --on-warn: #2B1C08;
  --active: #FF8CC4; --active-bg: #39203F; --active-line: #714465;
  --page-background: radial-gradient(ellipse at 80% 0%, #F26C1D0C, transparent 52%), radial-gradient(ellipse at 0% 30%, #FF2E9208, transparent 60%), #1C0C2C;
  --toast-bg: #34233F; --shadow: 0 8px 24px #0B041718;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--page-background); color: var(--ink);
  font: 16px/1.45 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
  min-height: 100vh; min-height: 100dvh;
}
body.modal-open { overflow: hidden; }
a { color: var(--accent-h); }
a:hover { color: var(--accent-h); }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; }
p { margin: 0 0 8px; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 60%, transparent); outline-offset: 2px; }
[hidden] { display: none !important; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--soft); }
.small { font-size: 13px; }
.center { text-align: center; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 14px; }
.pre { white-space: pre-wrap; word-break: break-word; }

/* ---------- оболочка ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 8px;
  min-height: calc(56px + var(--sat)); padding: var(--sat) calc(12px + var(--sar)) 0 calc(12px + var(--sal));
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 17px; white-space: nowrap; }
.brand b { color: var(--accent); font-weight: 800; }
.brand-mark { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: var(--accent); color: var(--on-accent); }
.top-title { flex: 1; font-size: 17px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: center; }
.top-actions { display: flex; gap: 4px; align-items: center; }
.icon-btn {
  display: inline-grid; place-items: center; min-width: var(--tap); height: var(--tap); padding: 0; border: 0; border-radius: 12px;
  background: transparent; color: var(--ink); cursor: pointer;
}
.icon-btn:hover { background: var(--bg2); }
.icon-btn:active { transform: scale(.96); }

#view {
  max-width: 720px; margin: 0 auto;
  padding: 14px calc(14px + var(--sar)) calc(var(--tabbar-h) + var(--sab) + 28px) calc(14px + var(--sal));
}
body.public #view { padding-bottom: calc(28px + var(--sab)); }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; justify-content: center;
  padding: 0 var(--sar) var(--sab) var(--sal);
  background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px);
  border-top: 1px solid var(--line);
}
.tabbar:empty { display: none; }
.tab {
  flex: 1; max-width: 140px; min-height: var(--tabbar-h); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--soft); text-decoration: none; font-size: 11.5px; font-weight: 600;
}
.tab { transition: color .15s, background .15s; }
.tab.on, .tab:hover { color: var(--active); background: var(--active-bg); }
.tab.on { box-shadow: inset 0 3px var(--active); }
.tab-ic { position: relative; display: grid; place-items: center; }
.tab-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; padding: 0 2px; }
.badge-dot {
  position: absolute; top: -6px; left: 15px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px;
  background: var(--err); color: var(--on-err); font-size: 11px; font-weight: 800; line-height: 19px; text-align: center; border: 2px solid var(--bg);
}

/* ---------- кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: var(--tap); padding: 10px 18px;
  border: 1.5px solid transparent; border-radius: 12px; background: var(--bg2); color: var(--ink);
  font-weight: 700; font-size: 16px; text-decoration: none; cursor: pointer; user-select: none; text-align: center; line-height: 1.2;
  transition: background .15s, border-color .15s, transform .05s;
}
.btn:active { transform: scale(.98); }
.btn:disabled, .btn.disabled { opacity: .45; cursor: not-allowed; transform: none; pointer-events: none; }
.btn.primary { background: var(--accent); color: var(--on-accent); }
.btn.primary:hover { background: var(--accent-hover); color: var(--on-accent); }
.btn.ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn.ghost:hover { border-color: var(--soft); color: var(--ink); }
.btn.success { background: var(--ok); color: var(--on-ok); }
.btn.danger { background: var(--err); color: var(--on-err); }
.btn.danger-ghost { background: transparent; border-color: color-mix(in srgb, var(--err) 45%, transparent); color: var(--err); }
.btn.warn-btn { background: var(--warn-bg); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 35%, transparent); }
.btn.wa { background: #25D366; color: #0b3d1e; }
.btn.wa:hover { color: #0b3d1e; filter: brightness(.95); }
.btn.link { background: none; border: 0; color: var(--accent-h); padding: 8px 4px; min-height: 44px; font-weight: 600; }
.btn.small { min-height: 44px; padding: 8px 14px; font-size: 15px; }
.btn.block { display: flex; width: 100%; }
.btn.xl { min-height: 60px; font-size: 18px; border-radius: 14px; flex: 1; }
.btn.grow { flex: 1; }
.btn.loading { position: relative; color: transparent !important; }
.btn.loading::after {
  content: ""; position: absolute; width: 20px; height: 20px; border-radius: 50%;
  border: 2.5px solid currentColor; border-color: #fff #fff transparent transparent; animation: spin .7s linear infinite;
}
.btn.ghost.loading::after, .btn.link.loading::after, .btn.danger-ghost.loading::after { border-color: var(--accent) var(--accent) transparent transparent; }
.btn.primary.loading::after { border-color: var(--on-accent) var(--on-accent) transparent transparent; }
.btn.success.loading::after { border-color: var(--on-ok) var(--on-ok) transparent transparent; }
.btn.danger.loading::after { border-color: var(--on-err) var(--on-err) transparent transparent; }
@keyframes spin { to { transform: rotate(360deg); } }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.btn-row.end { justify-content: flex-end; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.row-end { display: flex; justify-content: flex-end; min-height: 8px; }

/* сегментированный переключатель */
.seg { display: flex; gap: 4px; padding: 4px; background: var(--bg2); border-radius: 12px; border: 1px solid var(--line); }
.seg:has(.seg-btn:nth-child(4)) { flex-wrap: wrap; }
.seg:has(.seg-btn:nth-child(4)) .seg-btn { flex: 1 1 40%; font-size: 14px; }
.seg-btn {
  flex: 1; min-height: 42px; padding: 6px 12px; border: 0; border-radius: 9px; background: transparent; color: var(--soft);
  font-weight: 700; font-size: 15px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap;
}
.seg-btn.on { background: var(--active-bg); color: var(--active); box-shadow: inset 0 0 0 1px var(--active-line); }
.seg-btn .count { background: var(--accent); color: var(--on-accent); border-radius: 10px; font-size: 12px; min-width: 20px; height: 20px; line-height: 20px; padding: 0 6px; }
.lang-seg { padding: 3px; flex-wrap: wrap; }
.lang-seg .seg-btn { min-height: 40px; min-width: 44px; padding: 4px 8px; font-size: 13px; flex: 1 1 40%; }
.tabs-seg { margin-bottom: 14px; position: sticky; top: calc(64px + var(--sat)); z-index: 5; background: color-mix(in srgb, var(--bg2) 94%, transparent); backdrop-filter: blur(10px); }

/* ---------- карточки ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; margin-bottom: 12px; box-shadow: var(--shadow); }
.card-title { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--soft); font-weight: 700; margin-bottom: 12px; }
.sub-title { font-size: 15px; margin: 18px 0 8px; }
.kv { display: grid; grid-template-columns: minmax(110px, 40%) 1fr; gap: 8px 12px; margin: 0 0 8px; }
.kv dt { color: var(--soft); font-size: 14px; }
.kv dd { margin: 0; font-weight: 600; word-break: break-word; }
.empty { text-align: center; color: var(--soft); padding: 48px 16px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.empty svg { opacity: .5; }
.stamp { text-align: center; color: var(--soft); font-size: 12px; margin-top: 6px; }
.skeleton { height: 110px; border-radius: var(--r); margin-bottom: 12px; background: linear-gradient(90deg, var(--card) 25%, var(--bg2) 50%, var(--card) 75%); background-size: 200% 100%; animation: sk 1.2s infinite; border: 1px solid var(--line); }
.skeleton.tall { height: 200px; }
.skeleton.small { height: 48px; }
@keyframes sk { to { background-position: -200% 0; } }

.status { display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 700; white-space: nowrap; background: var(--bg2); color: var(--soft); }
.st-offered { background: var(--accent); color: var(--on-accent); }
.st-quoted { background: var(--navy, #16294C); color: #fff; }
.warn-plate { background: rgba(242,108,29,.12); border: 1px solid rgba(242,108,29,.45); color: var(--ink, inherit); border-radius: 12px; padding: 10px 12px; font-size: 14px; margin: 12px 0 10px; }
.st-accepted { background: var(--info-bg); color: var(--info); }
.st-enroute { background: var(--warn-bg); color: var(--warn); }
.st-done { background: var(--ok-bg); color: var(--ok); }
.st-declined, .st-cancelled { background: var(--err-bg); color: var(--err); }
.us-active { background: var(--ok-bg); color: var(--ok); }
.us-invited { background: var(--warn-bg); color: var(--warn); }
.inv-issued { background: var(--info-bg); color: var(--info); }
.inv-void { background: var(--err-bg); color: var(--err); }
.ref { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; color: var(--soft); font-weight: 600; }

/* ---------- список заказов ---------- */
.order-card { display: block; color: var(--ink); text-decoration: none; position: relative; overflow: hidden; padding-top: 14px; }
.order-card:hover { color: var(--ink); border-color: var(--soft); }
.order-card:active { transform: scale(.995); }
.order-card.oc-offered { border: 2px solid var(--accent); }
.oc-flag { display: flex; align-items: center; gap: 6px; margin: -14px -16px 12px; padding: 8px 16px; background: var(--accent); color: var(--on-accent); font-weight: 800; font-size: 14px; text-transform: uppercase; letter-spacing: .04em; }
.oc-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; }
.oc-when { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.oc-day { font-size: 18px; font-weight: 800; }
.oc-day::first-letter, .head-day::first-letter { text-transform: uppercase; }
.oc-time { font-size: 26px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.oc-service { color: var(--soft); font-weight: 600; margin: 2px 0 8px; }
.oc-route { display: flex; gap: 8px; align-items: center; font-weight: 600; min-width: 0; }
.oc-route span:not(.arrow) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1 1 auto; }
.oc-route .arrow { color: var(--accent); flex: none; font-weight: 800; }
.oc-bottom { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.oc-bottom:empty { display: none; }
.oc-price { font-weight: 800; font-size: 17px; }
.oc-drivers { display: inline-flex; gap: 6px; align-items: center; color: var(--soft); font-size: 14px; }
.oc-drivers.warn { color: var(--warn); font-weight: 700; }

/* ---------- экран заказа ---------- */
.head-card .head-day { font-size: 20px; font-weight: 800; margin-top: 4px; }
.head-card .head-time { font-size: 44px; font-weight: 800; letter-spacing: -.03em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.head-service { font-size: 17px; font-weight: 600; margin-top: 6px; }
.hint { margin-top: 12px; padding: 12px 14px; border-radius: 12px; background: var(--info-bg); color: var(--info); font-weight: 600; font-size: 15px; }
.hint-offered { background: var(--accent-bg); color: var(--accent-h); }
.hint-done { background: var(--ok-bg); color: var(--ok); }
.hint-cancelled, .hint-declined { background: var(--err-bg); color: var(--err); }
.offer-actions { display: flex; gap: 10px; margin-bottom: 12px; position: sticky; bottom: calc(var(--tabbar-h) + var(--sab) + 8px); z-index: 4; }
.offer-actions .btn.ghost { background: var(--card); }
.offer-actions.wrap { flex-wrap: wrap; }
.offer-actions.wrap > .btn.primary { flex-basis: 100%; }
.offer-actions.wrap > .btn.ghost { flex: 1 1 0; }

.map { height: 220px; border-radius: 12px; overflow: hidden; margin: 0 0 10px; background: var(--bg2); z-index: 0; }
.route-meta { display: flex; align-items: center; gap: 8px; font-weight: 700; margin-bottom: 6px; }
.pin { display: grid !important; place-items: center; width: 34px; height: 34px; border-radius: 50%; color: #fff; font-weight: 800; font-size: 15px; border: 2px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.35); }
.pin-a { background: var(--accent); }
.pin-b { background: #16294C; }
.leaflet-marker-icon.pin { line-height: 30px; text-align: center; }
.point { padding: 12px 0; border-top: 1px solid var(--line); }
.point-head { display: flex; gap: 10px; align-items: flex-start; }
.pin-inline { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; color: #fff; font-weight: 800; font-size: 14px; }
.pin-a { color: var(--on-accent); }
.point-label { font-size: 13px; color: var(--soft); font-weight: 600; }
.point-addr { font-weight: 600; word-break: break-word; }
.nav-links { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.nav-btn { min-height: 48px; padding: 8px 6px; font-size: 14px; background: var(--bg2); border-color: var(--line); color: var(--ink); }
.nav-btn:hover { color: var(--ink); border-color: var(--soft); }
.nav-links .nav-btn:only-child { grid-column: 1 / -1; }
.point-head .edit-addr { margin-left: auto; flex: none; min-height: 36px; padding: 6px 10px; font-size: 14px; }
/* правка адреса в модалке */
.addr-form .map { height: 260px; margin-top: 10px; }
.addr-line { display: flex; gap: 8px; }
.addr-line .inp { flex: 1; min-width: 0; }
.addr-line .btn { flex: none; padding: 0 12px; }
.addr-status { font-size: 13px; margin-top: 6px; color: var(--soft); }
.addr-status.ok { color: var(--ok); font-weight: 600; }
.addr-status.bad { color: var(--warn, #b45309); }
.georesults { display: grid; gap: 6px; margin-top: 8px; }
.georesults button { text-align: left; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg2); color: var(--ink); font: inherit; font-size: 14px; line-height: 1.3; }
.georesults .g-tag { display: inline-block; margin-left: 6px; font-size: 12px; font-weight: 600; color: var(--soft); }
.georesults .g-tag.ok { color: var(--ok); }

.price-big { font-size: 28px; font-weight: 800; margin-bottom: 8px; }
.price-big .muted { font-size: 16px; font-weight: 600; }
.lock-plate { display: flex; gap: 10px; align-items: center; padding: 14px; border-radius: 12px; background: var(--bg2); color: var(--soft); font-weight: 600; }
.client-name { font-size: 19px; font-weight: 700; }
.plain { list-style: none; margin: 0; padding: 0; }
.driver-li { display: flex; justify-content: space-between; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); font-weight: 600; }
.driver-li:first-child { border-top: 0; }

.check { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; font-size: 15px; }
.check input { flex: none; width: 24px; height: 24px; accent-color: var(--accent); margin: 1px 0 0; }
.check.big { min-height: 52px; align-items: center; padding: 6px 2px; border-top: 1px solid var(--line); font-weight: 600; font-size: 16px; }
.check.big:first-child { border-top: 0; }
.check-list { margin-bottom: 12px; }

/* фотоотчёт — шаги */
.work-card > .btn.xl { width: 100%; margin-bottom: 14px; }
.step { display: flex; gap: 12px; padding: 14px 0; border-top: 1px solid var(--line); }
.step:first-of-type { border-top: 0; }
.step-mark { flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--line); color: var(--soft); font-weight: 800; font-size: 14px; }
.step.done .step-mark { background: var(--ok); border-color: var(--ok); color: var(--on-ok); }
.step-main { flex: 1; min-width: 0; }
.step-title { font-weight: 700; font-size: 16px; margin: 4px 0 2px; }
.step-sub { color: var(--soft); font-size: 14px; margin-bottom: 6px; }
.step-main > .btn, .step-main .btn-row { margin-top: 8px; }
.step.done .step-title { color: var(--ok); }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: 8px; margin: 8px 0; }
.thumb { padding: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; aspect-ratio: 1; background: var(--bg2); cursor: pointer; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb.contain { background: #fff; aspect-ratio: 16 / 9; grid-column: span 2; }
.thumb.contain img { object-fit: contain; }
.picker { margin-top: 8px; }
.add-photo { width: 100%; border-style: dashed; min-height: 54px; cursor: pointer; }
.upload-progress { margin-top: 10px; }
.upload-progress .bar { height: 8px; border-radius: 4px; background: var(--bg2); overflow: hidden; margin-bottom: 6px; }
.upload-progress .bar span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }
.upload-progress .ptext { font-size: 14px; color: var(--soft); font-weight: 600; }
.remarks { background: var(--warn-bg); color: var(--warn); padding: 10px 12px; border-radius: 10px; }
.damage-box { border-top: 1px solid var(--line); padding-top: 14px; margin-top: 4px; }
.damage-box .btn { width: 100%; }
.complete-box { border-top: 1px solid var(--line); padding-top: 16px; margin-top: 14px; }
.complete-box .btn { width: 100%; }
.missing { color: var(--err); font-weight: 600; font-size: 14px; margin-top: 10px; }

.timeline { list-style: none; padding: 0; margin: 0; }
.ev { padding: 10px 0 10px 16px; border-left: 2px solid var(--line); position: relative; }
.ev::before { content: ""; position: absolute; left: -6px; top: 16px; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.ev-head { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.ev-kind { font-weight: 700; }
.ev-time, .ev-actor { color: var(--soft); font-size: 13.5px; }
.ev-note { white-space: pre-wrap; margin-top: 4px; font-size: 15px; }
.changes { margin: 6px 0 0; padding-left: 18px; font-size: 14.5px; }
.ch-f { color: var(--soft); }
.ch-was { text-decoration: line-through; color: var(--soft); }

/* ---------- формы ---------- */
.form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-size: 14px; font-weight: 600; color: var(--soft); }
.field-hint { font-size: 13px; color: var(--soft); }
.inp {
  width: 100%; min-height: var(--tap); padding: 11px 14px; border: 1.5px solid var(--line); border-radius: 12px;
  background: var(--card); color: var(--ink); font-size: 16px; outline: none; transition: border-color .15s;
}
.inp:focus { border-color: var(--accent); }
textarea.inp { resize: vertical; min-height: 80px; }
select.inp { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--soft) 50%), linear-gradient(135deg, var(--soft) 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 36px; }
.code-inp { font-size: 30px; letter-spacing: .4em; text-align: center; font-weight: 800; font-variant-numeric: tabular-nums; }
.form-err { color: var(--err); font-weight: 600; font-size: 14.5px; margin: 0; }
.dev-code { font-size: 12px; color: var(--soft); margin: -6px 0 0; }
.inline { display: flex; gap: 8px; align-items: center; }
.inline .inp { flex: 1; min-width: 0; }
.inline-form { margin-top: 8px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-check { position: relative; display: inline-flex; }
.chip-check input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.chip-check span { display: inline-flex; align-items: center; min-height: 42px; padding: 8px 14px; border-radius: 999px; border: 1.5px solid var(--line); font-size: 14.5px; font-weight: 600; }
.chip-check input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.chip-check input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--accent) 60%, transparent); }

/* тумблер */
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 52px; padding: 6px 0; border-top: 1px solid var(--line); cursor: pointer; }
.card > .switch-row:first-child, .card-title + .switch-row { border-top: 0; }
.sw-title { font-weight: 600; }
.sw { position: relative; flex: none; width: 56px; height: 34px; }
.sw-input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.sw-track { position: absolute; inset: 0; border-radius: 17px; background: var(--line); transition: background .2s; }
.sw-knob { position: absolute; top: 3px; left: 3px; width: 28px; height: 28px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .2s; }
.sw-input:checked + .sw-track { background: var(--ok); }
.sw-input:checked + .sw-track .sw-knob { transform: translateX(22px); }
.sw-input:focus-visible + .sw-track { outline: 3px solid color-mix(in srgb, var(--accent) 60%, transparent); outline-offset: 2px; }
.sw-input:disabled + .sw-track { opacity: .6; }

/* ---------- экраны входа ---------- */
.auth-wrap { max-width: 440px; margin: 4vh auto 0; }
.auth-card { padding: 24px 20px; }
.auth-title { font-size: 24px; font-weight: 800; margin-bottom: 6px; }
.auth-lead { color: var(--soft); margin-bottom: 18px; }
.auth-links { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.auth-links a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; text-decoration: none; }
.auth-links a.strong { font-weight: 800; }
.big-ok { width: 64px; height: 64px; border-radius: 50%; background: var(--ok); color: var(--on-ok); display: grid; place-items: center; font-size: 34px; font-weight: 800; margin-bottom: 14px; }
.small-link { display: block; margin: 12px auto 0; color: var(--soft); }

/* ---------- уведомления ---------- */
.notif { display: block; width: 100%; text-align: left; cursor: pointer; color: var(--ink); position: relative; }
.notif.unread { border-left: 4px solid var(--accent); background: var(--accent-bg); }
.notif.unread .notif-title { font-weight: 800; }
.notif-head { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.notif-title { font-weight: 600; }
.notif-time { color: var(--soft); font-size: 13px; white-space: nowrap; }
.notif-body { color: var(--soft); font-size: 14.5px; white-space: pre-wrap; margin-top: 4px; }

/* ---------- команда ---------- */
.user-list { margin-top: 12px; }
.uc-top { display: flex; justify-content: space-between; gap: 8px; align-items: center; margin-bottom: 4px; }
.uc-name { font-weight: 700; font-size: 17px; }
.uc-phone { margin-top: 6px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.uc-phone a { font-weight: 600; }
.pv { font-size: 12.5px; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.pv.ok { background: var(--ok-bg); color: var(--ok); }
.pv.no { background: var(--warn-bg); color: var(--warn); }
#view > .btn.block { margin-bottom: 12px; }

/* ---------- финансы ---------- */
.balance { text-align: center; padding: 24px 16px; }
.balance.owe { background: var(--accent-bg); border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.balance.credit { background: var(--ok-bg); border-color: color-mix(in srgb, var(--ok) 40%, transparent); }
.bal-label { font-weight: 700; font-size: 17px; }
.bal-amount { font-size: 42px; font-weight: 800; letter-spacing: -.02em; margin-top: 4px; font-variant-numeric: tabular-nums; }
.balance.owe .bal-amount { color: var(--accent-h); }
.balance.credit .bal-amount, .balance.zero .bal-amount { color: var(--ok); }
.payto { margin-top: 14px; padding-top: 12px; border-top: 1px solid color-mix(in srgb, var(--accent) 25%, transparent); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat { background: var(--bg2); border-radius: 12px; padding: 12px 8px; text-align: center; }
.stat-v { font-weight: 800; font-size: 17px; font-variant-numeric: tabular-nums; word-break: break-word; }
.stat-l { color: var(--soft); font-size: 12.5px; margin-top: 2px; }
.ledger { list-style: none; margin: 0; padding: 0; }
.lg-link { display: block; color: inherit; text-decoration: none; }
.lg-link:hover { color: inherit; background: var(--bg2); }
.lg-row { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); min-height: 52px; }
.ledger > :first-child .lg-row, .ledger > .lg-row:first-child { border-top: 0; }
.lg-kind { font-weight: 600; }
.lg-amt { font-weight: 800; white-space: nowrap; font-variant-numeric: tabular-nums; }
.lg-amt.plus { color: var(--accent-h); }
.lg-amt.minus { color: var(--ok); }
.inv-row { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); color: var(--ink); text-decoration: none; min-height: 56px; }
.plain > li:first-child .inv-row { border-top: 0; }
.inv-row:hover { color: var(--ink); }
.inv-num { font-weight: 700; }
.inv-right { text-align: right; font-weight: 700; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }

/* ---------- настройки / push ---------- */
.push-status { font-size: 14.5px; font-weight: 600; margin-bottom: 10px; }
.push-status.ok { color: var(--ok); }
.push-status.warn { color: var(--warn); }
#view > .btn.danger-ghost { margin-top: 8px; margin-bottom: 12px; }
#partner-theme-hint { margin: 10px 0 0; font-size: 14px; }
.theme-picker { min-width: 0; margin: 0; padding: 0; border: 0; }
.theme-picker legend { padding: 0; margin-bottom: 10px; }
.theme-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.theme-option { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 54px; padding: 12px 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg2); color: var(--soft); font-size: 14px; font-weight: 600; text-align: center; cursor: pointer; }
.theme-option input { flex: none; width: 18px; height: 18px; margin: 0; accent-color: var(--active); cursor: pointer; }
.theme-option:hover { border-color: var(--active-line); color: var(--ink); }
.theme-option:has(input:checked) { background: var(--active-bg); color: var(--active); border-color: var(--active); }
.theme-option:has(input:focus-visible) { outline: 3px solid var(--active); outline-offset: 3px; }
@media (max-width: 480px) { .theme-option { flex-direction: column; gap: 7px; padding: 10px 5px; } }

/* ---------- модальные окна ---------- */
.modal-back {
  position: fixed; inset: 0; z-index: 100; background: #0B0417B3; display: flex; align-items: flex-end; justify-content: center;
  animation: fade .15s;
}
.modal {
  width: 100%; max-width: 520px; max-height: 92vh; max-height: 92dvh; overflow: auto; background: var(--card); color: var(--ink);
  border-radius: 20px 20px 0 0; padding: 6px 18px calc(18px + var(--sab)); animation: up .2s ease-out;
}
.modal.wide { max-width: 680px; }
@media (min-width: 640px) {
  .modal-back { align-items: center; padding: 20px; }
  .modal { border-radius: 20px; padding-bottom: 18px; }
}
.modal-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; position: sticky; top: -6px; background: var(--card); padding: 8px 0; z-index: 1; }
.modal-head h2 { font-size: 19px; font-weight: 800; }
.modal-body { padding: 4px 0 8px; }
.modal-text { font-size: 16px; }
.modal-actions { display: flex; gap: 10px; margin-top: 12px; }
.modal-actions .btn { flex: 1; }
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(30px); opacity: .5; } }
.viewer img { width: 100%; max-height: 65vh; object-fit: contain; border-radius: 10px; background: #000; display: block; margin-bottom: 8px; }

/* подпись */
.sig-tools { display: flex; justify-content: flex-end; }
.sig-wrap { position: relative; border: 2px dashed var(--line); border-radius: 12px; background: #fff; overflow: hidden; touch-action: none; }
.sig-canvas { display: block; touch-action: none; cursor: crosshair; }
.sig-hint { position: absolute; left: 16px; right: 16px; bottom: 34px; border-top: 1.5px solid #C7C7CC; padding-top: 4px; color: #8E8E93; font-size: 13px; pointer-events: none; }
.sig-wrap.inked .sig-hint { color: transparent; }

/* ---------- тост ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + var(--sab) + 16px); z-index: 200; transform: translate(-50%, 20px);
  max-width: min(92vw, 520px); padding: 12px 18px; border-radius: 12px; background: var(--toast-bg); color: var(--toast-ink); font-weight: 600; font-size: 15px;
  box-shadow: 0 6px 24px rgba(0,0,0,.25); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; text-align: center;
}
body.public .toast { bottom: calc(var(--sab) + 20px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.ok { background: var(--ok); color: var(--on-ok); }
.toast.err { background: var(--err); color: var(--on-err); }
.toast.warn { background: var(--warn); color: var(--on-warn); }

/* заставка до загрузки модулей */
.splash { min-height: 70vh; display: grid; place-items: center; color: var(--soft); }

/* Leaflet: подписи и кнопки под тему */
.leaflet-container { font: 12px/1.4 Inter, sans-serif; }
.leaflet-control-zoom a { width: 36px !important; height: 36px !important; line-height: 36px !important; }

/* ---------- широкие экраны ---------- */
@media (min-width: 900px) {
  #view { padding-top: 22px; }
  .tabbar { top: calc(56px + var(--sat)); bottom: auto; left: 0; right: auto; width: 96px; flex-direction: column; justify-content: flex-start; padding-top: 12px; border-top: 0; border-right: 1px solid var(--line); height: calc(100vh - 56px); }
  .tab { max-width: none; flex: none; min-height: 72px; }
  .tab.on { box-shadow: inset 3px 0 var(--active); }
  body:not(.public) #view { padding-left: calc(96px + 24px); padding-right: 24px; max-width: calc(720px + 96px + 48px); padding-bottom: 40px; }
  .toast { bottom: 24px; }
  .offer-actions { bottom: 12px; }
  .tabs-seg { top: calc(64px + var(--sat)); }
}

/* настройки: строка «значение + кнопка» */
.inline .btn { flex: none; white-space: nowrap; }
.inline > span { white-space: nowrap; }
.card > .form + .field, .card > .field + .kv { margin-top: 14px; }
.kv dd .inline { justify-content: space-between; flex-wrap: wrap; }

/* ---------- документы ---------- */
.docs-block { border: 1.5px dashed color-mix(in srgb, var(--accent) 45%, transparent); background: var(--accent-bg); border-radius: var(--r); padding: 14px; }
.docs-block-title { display: flex; gap: 8px; align-items: center; font-weight: 800; margin-bottom: 4px; }
.docs-block .add-doc { background: var(--card); }
.add-doc { min-height: 54px; cursor: pointer; margin-top: 8px; }
.doc-note { margin: 10px 0 0; font-weight: 600; color: var(--ok); font-size: 14.5px; }
.doc-list { display: flex; flex-direction: column; gap: 8px; }
.doc-list:empty { display: none; }
.docs-block .doc-list { margin-top: 10px; }
#view > .doc-list { margin: 12px 0; }
.doc-card { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); }
.doc-ic { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: var(--bg2); color: var(--accent); }
.doc-main { flex: 1; min-width: 0; }
.doc-title { font-weight: 700; word-break: break-word; }
.doc-sub { word-break: break-word; margin-top: 2px; }
.doc-state { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 6px; font-size: 14px; font-weight: 600; }
.doc-state.busy { color: var(--soft); }
.doc-state.ok { color: var(--ok); }
.doc-state.warn { color: var(--warn); }
.doc-state.err { color: var(--err); }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2.5px solid var(--line); border-top-color: var(--accent); animation: spin .7s linear infinite; flex: none; }
.doc-item .doc-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 6px; }
.doc-summary { margin: 0 0 6px; }
.exp-ok { background: var(--ok-bg); color: var(--ok); }
.exp-soon { background: var(--warn-bg); color: var(--warn); }
.exp-bad { background: var(--err-bg); color: var(--err); }
.lead-note { margin-bottom: 12px; }
.field.from-doc .inp { border-color: var(--ok); background: color-mix(in srgb, var(--ok-bg) 70%, var(--card)); }
.doc-tag { display: inline-block; margin-left: 8px; padding: 1px 8px; border-radius: 999px; background: var(--ok-bg); color: var(--ok); font-size: 12px; font-weight: 700; }
.link-card { display: flex; align-items: center; gap: 12px; min-height: 60px; color: var(--ink); text-decoration: none; font-weight: 700; }
.link-card:hover { color: var(--ink); border-color: var(--soft); }
.link-ic { color: var(--accent); display: grid; place-items: center; }
.link-text { flex: 1; }
.chev { font-size: 26px; color: var(--soft); line-height: 1; }

/* ---------- мобильная адаптация ---------- */
#view { overflow-x: clip; }
img, canvas, svg { max-width: 100%; }
.kv dd, .point-addr, .notif-body, .ev-note, .changes { overflow-wrap: anywhere; }
@media (max-width: 639px) {
  /* модалки — шиты снизу во всю ширину, высокие — на весь экран */
  .modal { max-height: 100vh; max-height: 100dvh; }
  .modal.wide { height: 100vh; height: 100dvh; max-height: none; border-radius: 0; padding-top: calc(6px + var(--sat)); display: flex; flex-direction: column; }
  .modal.wide .modal-body { flex: 1; }
  .modal-actions { position: sticky; bottom: 0; background: var(--card); padding: 10px 0 4px; margin-top: 4px; }
}
@media (max-width: 380px) {
  #view { padding-left: calc(10px + var(--sal)); padding-right: calc(10px + var(--sar)); }
  .card { padding: 14px 12px; }
  .brand { font-size: 15px; gap: 6px; }
  .brand-mark { width: 28px; height: 28px; }
  .lang-seg .seg-btn { min-width: 44px; padding: 4px 6px; }
  .tab { font-size: 10.5px; }
  .head-card .head-time { font-size: 40px; }
  .bal-amount { font-size: 36px; }
  .stats { gap: 6px; }
  .stat-v { font-size: 15px; }
  .kv { grid-template-columns: minmax(96px, 38%) 1fr; }
  .nav-btn { font-size: 13px; gap: 4px; padding: 8px 4px; }
  .btn.xl { font-size: 17px; }
  .auth-card { padding: 20px 14px; }
}
@media (min-width: 640px) and (max-width: 899px) {
  #view { padding-left: calc(20px + var(--sal)); padding-right: calc(20px + var(--sar)); }
}
/* тач-цели ≥44px: сегменты и телефонные ссылки */
.seg-btn { min-height: 44px; }
.lang-seg .seg-btn { min-height: 44px; }
.driver-li a, .uc-phone a, .client-card a[href^="mailto"], .card p > a[href^="mailto"] { display: inline-flex; align-items: center; min-height: 44px; }
.driver-li { align-items: center; padding: 4px 0; }
/* источник фото: камера / галерея */
.src-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.src-btns .add-photo { width: auto; margin: 0; }
.src-btns.disabled { opacity: .45; pointer-events: none; }
.doc-card { position: relative; }
.doc-x { flex: none; margin: -8px -8px 0 0; color: var(--soft); }

/* проверка компании */
.verify-card.v-verified { border-color: color-mix(in srgb, var(--ok) 45%, transparent); }
.verify-card.v-attention { border-color: color-mix(in srgb, var(--warn) 55%, transparent); }
.v-status { display: flex; gap: 10px; align-items: center; font-size: 17px; font-weight: 800; padding: 12px 14px; border-radius: 12px; background: var(--bg2); }
.v-verified .v-status { background: var(--ok-bg); color: var(--ok); }
.v-attention .v-status { background: var(--warn-bg); color: var(--warn); }
.v-ic { font-size: 22px; line-height: 1; }
.v-sub { margin: 14px 0 4px; font-size: 14px; font-weight: 700; color: var(--soft); }
.ck-list { list-style: none; margin: 0; padding: 0; }
.ck { display: flex; gap: 12px; align-items: center; min-height: 56px; padding: 8px 0; border-top: 1px solid var(--line); }
.ck:first-child { border-top: 0; }
.ck-mark { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; font-weight: 800; color: #fff; }
.ck-ok .ck-mark { background: var(--ok); color: var(--on-ok); }
.ck-missing .ck-mark { background: var(--err); color: var(--on-err); }
.ck-fail .ck-mark { background: var(--warn); color: var(--on-warn); }
.ck-main { flex: 1; min-width: 0; }
.ck-title { font-weight: 700; }
.ck-sub { font-size: 13.5px; color: var(--soft); overflow-wrap: anywhere; }
.ck-missing .ck-sub { color: var(--err); }
.ck-fail .ck-sub { color: var(--warn); }
.ck .btn { flex: none; }
.badge-inline { min-width: 24px; height: 24px; padding: 0 7px; border-radius: 12px; background: var(--err); color: var(--on-err); font-size: 13px; font-weight: 800; display: inline-grid; place-items: center; }

/* сканер документов: две кнопки */
.scan-btns { display: flex; flex-direction: column; gap: 8px; margin: 8px 0 12px; }
.scan-main { min-height: 58px; font-size: 17px; box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 30%, transparent); }
.docs-block .scan-btns { margin-bottom: 0; }
.docs-block .scan-btns .btn.ghost { background: var(--card); }

/* экран подписи клиента — на весь экран, крупные элементы, язык клиента */
.sign-screen { position: fixed; inset: 0; z-index: 60; background: var(--bg); overflow-y: auto; -webkit-overflow-scrolling: touch; display: flex; flex-direction: column; }
.sign-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: calc(10px + var(--sat)) 16px 10px; border-bottom: 1px solid var(--line); background: var(--card); position: sticky; top: 0; z-index: 1; }
.sign-head h1 { font-size: 20px; font-weight: 800; margin: 0; }
.sign-langs { display: flex; gap: 4px; flex-wrap: wrap; }
.sign-langs button { min-height: 36px; padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); color: var(--soft); font: inherit; font-size: 13px; font-weight: 700; }
.sign-langs button.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.sign-body { padding: 14px 16px calc(120px + var(--sab)); display: flex; flex-direction: column; gap: 14px; max-width: 720px; width: 100%; margin: 0 auto; }
.sign-summary { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 16px; }
.sign-summary dt { color: var(--soft); font-weight: 600; }
.sign-summary dd { margin: 0; font-weight: 700; overflow-wrap: anywhere; }
.sign-q { font-size: 19px; font-weight: 800; margin: 4px 0 8px; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile { min-height: 64px; border: 2px solid var(--line); border-radius: 14px; background: var(--card); color: var(--ink); font: inherit; font-size: 18px; font-weight: 700; padding: 10px 12px; display: flex; align-items: center; justify-content: center; gap: 8px; text-align: center; }
.tile.on { border-color: var(--accent); background: var(--accent-bg); color: var(--accent-h); }
.tile.on.bad { border-color: var(--warn); background: var(--warn-bg); color: var(--warn); }
.sign-field .inp { font-size: 18px; min-height: 54px; }
.sign-wrap { position: relative; border: 2px dashed var(--line); border-radius: 14px; background: #fff; overflow: hidden; touch-action: none; }
.sign-wrap .sig-canvas { width: 100%; }
.sign-wrap .sig-hint { font-size: 15px; bottom: 40px; }
.sign-legal { font-size: 13px; color: var(--soft); line-height: 1.4; }
.sign-foot { position: fixed; left: 0; right: 0; bottom: 0; z-index: 61; padding: 10px 16px calc(10px + var(--sab)); background: var(--card); border-top: 1px solid var(--line); display: flex; gap: 10px; }
.sign-foot .btn { flex: 1; min-height: 60px; font-size: 18px; border-radius: 14px; }
.sign-foot .btn.ghost { flex: 0 0 auto; padding: 0 18px; }
body.sign-open { overflow: hidden; }
.ok-text { color: var(--ok); font-weight: 700; display: flex; align-items: center; gap: 4px; }
.warn-text { color: var(--warn); font-weight: 700; display: flex; align-items: center; gap: 4px; }

/* чат с MoveValencia */
.chat-box { display: flex; flex-direction: column; min-height: 40vh; padding-bottom: 8px; }
.chat-list { display: flex; flex-direction: column; gap: 8px; padding-bottom: 8px; }
.msg { max-width: 86%; padding: 10px 12px; border-radius: 14px; font-size: 15.5px; line-height: 1.35; overflow-wrap: anywhere; white-space: pre-wrap; }
.msg.in { align-self: flex-start; background: var(--card); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.msg.out { align-self: flex-end; background: var(--accent-bg); border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line)); border-bottom-right-radius: 4px; }
.msg-ref { display: inline-block; font-size: 12.5px; font-weight: 700; color: var(--accent-h); margin-bottom: 4px; }
.msg-meta { font-size: 12px; color: var(--soft); margin-top: 4px; text-align: right; }
/* чат с клиентом: перевод + оригинал по запросу, вложения, состояние 24-часового окна */
.msg-orig-btn { background: none; border: 0; padding: 2px 0; margin-top: 4px; font: inherit; font-size: 12.5px; color: var(--accent-h); cursor: pointer; text-decoration: underline; }
.msg-orig { font-size: 13.5px; color: var(--soft); margin-top: 4px; padding-top: 4px; border-top: 1px dashed var(--line); white-space: pre-wrap; }
.msg-img { display: block; max-width: 100%; border-radius: 10px; margin-bottom: 6px; }
.msg-pics { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.msg-pics a { flex: 1 1 45%; max-width: 100%; }
.msg-pics .msg-img { margin: 0; width: 100%; max-height: 360px; object-fit: cover; }
.msg-file { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 13.5px; margin-bottom: 6px; }
.msg-queued { color: var(--accent-h); }
.msg-failed { color: var(--err); }
.chat-window { margin-bottom: 8px; }
.chat-window-ok { font-size: 13px; color: var(--soft); text-align: center; padding: 4px 0; }
.chat-hint { text-align: center; margin: 0 0 10px; }
.chat-inp:disabled, .chat-send:disabled { opacity: .5; }
/* строка ввода закреплена над нижней панелью (sticky не работал: контейнер не прокручивается — плашка висела посреди экрана) */
/* строка ввода — липкая внизу колонки контента (2026-09-24: раньше fixed по центру окна и на десктопе с боковым меню
   уезжала относительно чата); на телефоне растянута до краёв экрана отрицательными полями */
.chat-bar { position: sticky; bottom: calc(var(--tabbar-h) + var(--sab)); display: flex; gap: 8px; align-items: flex-end; margin: 0 calc(-14px - var(--sar)) 0 calc(-14px - var(--sal)); padding: 8px calc(14px + var(--sar)) 8px calc(14px + var(--sal)); background: var(--bg); border-top: 1px solid var(--line); z-index: 4; }
@media (min-width: 900px) { .chat-bar { margin: 0; padding-left: 0; padding-right: 0; bottom: 0; border-top: 0; } }
.chat-inp { flex: 1; min-height: 46px; max-height: 120px; resize: none; }
.chat-send { flex: none; width: 52px; min-height: 46px; padding: 0; }
.switch-row.dim { opacity: .45; pointer-events: none; }

/* подсказка «@» в чате */
.chat-bar { flex-wrap: wrap; }
.at-pop { flex-basis: 100%; max-height: 40vh; overflow-y: auto; background: var(--card); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 6px; box-shadow: 0 8px 24px rgba(0,0,0,.18); }
.at-item { display: block; width: 100%; text-align: left; padding: 10px 12px; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--ink); font: inherit; font-size: 14.5px; }
.at-item:last-child { border-bottom: 0; }
.at-empty { padding: 10px 12px; color: var(--soft); font-size: 14px; }
.msg-tag { font-weight: 700; color: var(--accent-h); text-decoration: none; }

/* машины компании (vehicles.js) */
.vehicle-row { display: flex; gap: 12px; align-items: center; }
.vehicle-thumb { width: 72px; height: 54px; object-fit: cover; border-radius: 10px; flex: none; background: var(--card); display: flex; align-items: center; justify-content: center; }
.vehicle-main { min-width: 0; }
.vehicle-title { font-weight: 700; }
.vehicle-photo { width: 100%; max-height: 240px; object-fit: cover; border-radius: 12px; margin-bottom: 10px; display: flex; align-items: center; justify-content: center; min-height: 120px; background: rgba(127,127,127,.08); }
.row-actions { display: flex; gap: 8px; margin-top: 10px; }
.card-sub { margin: 14px 0 6px; font-size: 15px; }

/* перевод по кнопке в чате с клиентом (2026-09-22) */
.chat-trbar { flex-basis: 100%; display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12.5px; color: var(--soft); }
.chat-trbar[hidden] { display: none; }
.chat-lang { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-tr-btn { flex: none; min-height: 32px; padding: 4px 12px; font-size: 13px; }
.chat-src { flex-basis: 100%; background: var(--card); border: 1px dashed var(--line); border-radius: 10px; padding: 6px 10px; font-size: 13px; }
.chat-src[hidden] { display: none; }
.chat-src-text { white-space: pre-wrap; max-height: 72px; overflow-y: auto; }

/* плашка «Подключите Telegram» над заказами (2026-09-22) */
.tg-plate { display: flex; align-items: center; gap: 10px; padding: 10px 12px; margin-bottom: 12px; border-radius: 12px; background: var(--card); border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line)); font-size: 14px; }
.tg-plate > span { flex: 1; }
.tg-plate .btn { flex: none; }

/* сообщения клиента на экране заказа (водителю, решение заказчика 2026-09-23) */
.client-msgs { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.client-msgs .cmsg { padding: 8px 12px; border-radius: 12px; background: var(--card2, rgba(127,127,127,.12)); max-width: 92%; }
.client-msgs .cmsg.in { align-self: flex-start; }
.client-msgs .cmsg.out { align-self: flex-end; opacity: .8; }

/* режим просмотра для админа: красная полоса 34px сверху — сдвигаем закреплённые элементы (решение заказчика 2026-09-23) */
@media (min-width: 900px) {
  body.viewas .tabbar { top: calc(90px + var(--sat)); height: calc(100vh - 90px); }
  body.viewas .tabs-seg { top: calc(98px + var(--sat)); }
}
