:root {
  --ink: #14171c;
  --steel: #5b6472;
  --ground: #eef0f2;
  --surface: #ffffff;
  --line: #dfe2e7;
  --accent: #ff5a1f;

  --good: #16a34a;   --good-bg: #e4f6ea;
  --warn: #d97706;   --warn-bg: #fdf1de;
  --critical: #dc2626; --critical-bg: #fbe6e6;
  --info: #2563eb;   --info-bg: #e5edfd;
  --neutral: #9aa1ac; --neutral-bg: #eef0f2;

  --page-bg: #f6f5f2;
  --page-ink: #1c1f26;
  --page-sub: #6a6f78;

  --ui-scale: 1;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--page-bg);
  color: var(--page-ink);
  font-family: "IBM Plex Sans", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.page { max-width: 900px; margin: 0 auto; padding: 40px 20px 60px; display: flex; flex-direction: column; align-items: center; }
.page-head { max-width: 420px; margin-bottom: 24px; text-align: center; }
.ph-title { font-family: "Barlow Semi Condensed", sans-serif; font-weight: 700; font-size: 22px; }
.ph-title span { font-weight: 400; color: var(--page-sub); font-size: 15px; }
.ph-sub { font-size: 12px; color: var(--page-sub); margin-top: 6px; line-height: 1.5; }

/* ---------- device ---------- */
.device {
  width: 342px; height: 728px;
  border-radius: 44px; background: #0d0f13; padding: 12px;
  box-shadow: 0 30px 60px -20px rgba(0,0,0,0.35), 0 0 0 1px rgba(0,0,0,0.08);
}
.screen {
  position: relative; width: 100%; height: 100%;
  border-radius: 34px; overflow: hidden; background: var(--surface);
  display: flex; flex-direction: column;
  font-family: "IBM Plex Sans", system-ui, sans-serif; color: var(--ink);
}
.notch {
  position: absolute; top: 8px; left: 50%; transform: translateX(-50%);
  width: 90px; height: 22px; background: #0d0f13; border-radius: 14px; z-index: 6;
}
.statusbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 22px 0; font-family: "IBM Plex Mono", monospace; font-size: 12px; font-weight: 500;
  color: var(--ink); flex: 0 0 auto;
}

/* ---------- app bar ---------- */
.ab-row { display: flex; justify-content: space-between; align-items: flex-start; padding: 12px 16px 9px; flex: 0 0 auto; }
.ab-row h2 { font-family: "Barlow Semi Condensed", sans-serif; font-weight: 700; font-size: 21px; margin: 0; }
.ab-row .sub { margin-top: 3px; font-size: 11.5px; color: var(--steel); }
.ab-row .sub b { color: var(--critical); font-weight: 600; }
.icon-btn {
  width: 32px; height: 32px; border-radius: 10px; background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 18px; font-weight: 500;
  flex: 0 0 auto; box-shadow: 0 4px 10px -3px rgba(255,90,31,0.5); cursor: pointer; border: none;
}
.icon-btn.ghost { background: var(--ground); color: var(--steel); box-shadow: none; }
.icon-btn.sm { width: 24px; height: 24px; font-size: 13px; border-radius: 8px; margin-left: auto; }

/* ---------- search + chips ---------- */
.searchwrap { padding: 0 16px 9px; flex: 0 0 auto; }
.search { display: flex; align-items: center; gap: 8px; background: var(--ground); border: 1px solid var(--line); border-radius: 10px; padding: 8px 11px; }
.search svg { flex: 0 0 auto; color: var(--steel); }
.search input {
  border: none; background: transparent; outline: none; font-size: 12.5px; color: var(--ink);
  font-family: inherit; width: 100%;
}
.search input::placeholder { color: var(--steel); }

.chips { display: flex; gap: 6px; padding: 0 16px 10px; flex: 0 0 auto; overflow-x: auto; scrollbar-width: none; }
/* Заявки из Telegram-бота — плашка над списком аренд */
.tg-apps-banner { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 16px 10px; padding: 10px 12px; border-radius: 12px; background: var(--info-bg); color: var(--info); font-size: 12.5px; font-weight: 700; cursor: pointer; flex: 0 0 auto; }
.tg-apps-banner:active { opacity: .8; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto; font-size: 11.5px; font-weight: 500; padding: 6px 11px; border-radius: 999px;
  background: var(--ground); color: var(--steel); border: 1px solid var(--line); white-space: nowrap;
  cursor: pointer; user-select: none;
}
.chip.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.chip b { font-weight: 600; }

/* ---------- lists / rows ---------- */
.listwrap { position: relative; flex: 1 1 auto; min-height: 0; }
.list { height: 100%; overflow-y: auto; background: var(--surface); border-top: 1px solid var(--line); }
.list-divider { padding: 8px 16px 6px; font-size: 9.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--steel); background: var(--ground); }
.empty-hint { padding: 30px 20px; text-align: center; font-size: 12px; color: var(--steel); line-height: 1.6; }

.row { display: flex; align-items: center; gap: 10px; padding: 8px 14px 8px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.row:active { background: var(--ground); }
.row::before { content: ""; width: 3px; align-self: stretch; border-radius: 3px; background: var(--stripe, var(--neutral)); flex: 0 0 auto; }
.thumb {
  flex: 0 0 auto; width: 32px; height: 32px; border-radius: 9px; background: var(--neutral-bg); color: var(--steel);
  display: flex; align-items: center; justify-content: center;
  font-family: "Barlow Semi Condensed", sans-serif; font-weight: 700; font-size: 12px;
}
.row-photo { flex: 0 0 auto; width: 38px; height: 38px; border-radius: 9px; background: var(--neutral-bg); color: var(--steel); overflow: hidden; display: flex; align-items: center; justify-content: center; }
.row-photo img { width: 100%; height: 100%; object-fit: contain; }
.row-text { flex: 1 1 auto; min-width: 0; }
.row-text .l1 { font-size: 12.5px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-text .l1 .flag-tag { margin-left: 5px; vertical-align: middle; }
.row-text .l2 { font-family: "IBM Plex Mono", monospace; font-size: 10px; color: var(--steel); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-text .l3 { font-size: 10px; color: var(--accent); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-right { flex: 0 0 auto; display: flex; align-items: center; gap: 6px; }
.to-dot { width: 7px; height: 7px; border-radius: 50%; flex: 0 0 auto; }
.to-dot.warn { background: var(--warn); }
.to-dot.critical { background: var(--critical); }
.to-dot.info { background: var(--info); }
.flag-tag { font-size: 9.5px; font-weight: 600; padding: 2px 6px; border-radius: 5px; white-space: nowrap; flex: 0 0 auto; }
.flag-tag.warn { background: var(--warn-bg); color: var(--warn); }
.flag-tag.critical { background: var(--critical-bg); color: var(--critical); }
.row-count { font-size: 10.5px; color: var(--steel); white-space: nowrap; }
.chev { color: #c7cbd1; flex: 0 0 auto; }
.row .end-btn {
  font-size: 9.5px; font-weight: 600; color: var(--ink); background: var(--ground);
  border: 1px solid var(--line); border-radius: 7px; padding: 4px 8px; white-space: nowrap; cursor: pointer;
}
.pay-badge { font-size: 9.5px; font-weight: 600; padding: 2px 7px; border-radius: 999px; white-space: nowrap; flex: 0 0 auto; }
.pay-badge.good { background: var(--good-bg); color: var(--good); }
.pay-badge.warn { background: var(--warn-bg); color: var(--warn); }
.pay-badge.critical { background: var(--critical-bg); color: var(--critical); }

/* ---------- mini rows (вложенные списки в детальных экранах) ---------- */
.mini-list { display: flex; flex-direction: column; flex-shrink: 0; background: var(--ground); border-radius: 10px; overflow: hidden; }
.mini-row { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-bottom: 1px solid var(--line); cursor: pointer; }
.mini-row:last-child { border-bottom: none; }
.mini-row:active { background: var(--surface); }
.section-title { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; color: var(--steel); margin-top: 4px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.mini-btn {
  display: inline-flex; align-items: center; gap: 4px; font-size: 10px; font-weight: 600; color: var(--steel);
  background: var(--ground); border: 1px solid var(--line); border-radius: 7px; padding: 4px 8px; cursor: pointer;
}
.mini-btn.add { color: var(--accent); border-color: transparent; background: none; padding: 0; text-transform: none; letter-spacing: normal; }

/* ---------- tabbar ---------- */
.tabbar { flex: 0 0 auto; display: flex; padding: 8px 8px 14px; background: var(--surface); border-top: 1px solid var(--line); }
.tab { flex: 1 1 0; display: flex; flex-direction: column; align-items: center; gap: 3px; color: var(--steel); font-size: 10px; font-weight: 500; background: none; border: none; cursor: pointer; font-family: inherit; }
.tab.active { color: var(--accent); }
.tab svg { display: block; }
.tab-ico-wrap { position: relative; display: inline-flex; }
.tab-badge {
  position: absolute; top: -5px; right: -8px; min-width: 14px; height: 14px; padding: 0 3px; border-radius: 999px;
  background: var(--critical); color: #fff; font-size: 8.5px; font-weight: 700; line-height: 14px; text-align: center;
}
.tab-badge.static { position: static; margin-left: 4px; }

/* ---------- bike / client / rental detail (общая шапка) ---------- */
.detail-header { display: flex; align-items: flex-start; gap: 10px; padding: 12px 16px 8px; flex: 0 0 auto; }
.back-btn { font-size: 22px; line-height: 1; color: var(--ink); width: 22px; flex: 0 0 auto; background: none; border: none; cursor: pointer; padding: 0; }
.dh-title { flex: 1 1 auto; min-width: 0; }
.dh-name { font-family: "Barlow Semi Condensed", sans-serif; font-weight: 700; font-size: 16px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dh-name .flag-tag { margin-left: 6px; vertical-align: middle; }
.dh-meta { font-family: "IBM Plex Mono", monospace; font-size: 10px; color: var(--steel); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.status-select {
  flex: 0 0 auto; font-size: 10.5px; font-weight: 600; padding: 4px 22px 4px 9px; border-radius: 999px;
  border: none; appearance: none; -webkit-appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='9' height='9' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='m6 9 6 6 6-6' stroke='%235b6472' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 7px center; background-size: 9px;
}
.status-select.free { background-color: var(--good-bg); color: var(--good); }
.status-select.reserved { background-color: var(--info-bg); color: var(--info); }
.status-select.rented { background-color: #ffe9de; color: var(--accent); }
.status-select.repair { background-color: var(--warn-bg); color: var(--warn); }
.status-select.retired { background-color: var(--neutral-bg); color: var(--steel); }

.detail-scroll { flex: 1 1 auto; overflow-y: auto; padding: 0 16px 16px; display: flex; flex-direction: column; gap: 12px; }
.photo-block { width: 100%; height: 110px; border-radius: 12px; background: var(--neutral-bg); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--steel); flex: 0 0 auto; cursor: pointer; overflow: hidden; }
.photo-block.filled { padding: 0; position: relative; height: auto; background: none; }
.photo-block.filled img { width: 100%; height: auto; max-height: 260px; object-fit: contain; display: block; }
.photo-edit-btn { position: absolute; top: 7px; right: 7px; width: 26px; height: 26px; border-radius: 50%; border: none; background: rgba(10,12,16,0.6); color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.photo-hint { font-size: 10px; color: var(--steel); }

/* карусель фото байка (листается свайпом, стрелками по бокам; счётчик «2 / 4» и точки) */
.bk-car { position: relative; width: 100%; flex: 0 0 auto; border-radius: 12px; overflow: hidden; background: var(--neutral-bg); }
.bk-car-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.bk-car-track::-webkit-scrollbar { display: none; }
.bk-car-slide { flex: 0 0 100%; scroll-snap-align: center; height: 260px; display: flex; align-items: center; justify-content: center; }
.bk-car-slide img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; cursor: zoom-in; }
.bk-car-arrow { position: absolute; top: 50%; transform: translateY(-50%); width: 30px; height: 30px; border-radius: 50%; border: none; background: rgba(10,12,16,0.55); color: #fff; font-size: 18px; line-height: 30px; padding: 0; cursor: pointer; }
.bk-car-arrow.left { left: 8px; }
.bk-car-arrow.right { right: 8px; }
.bk-car-arrow.hidden { display: none; }
.bk-car-count { position: absolute; top: 8px; left: 8px; font-size: 10px; font-weight: 600; color: #fff; background: rgba(10,12,16,0.55); border-radius: 999px; padding: 2px 8px; }
.bk-car-dots { position: absolute; bottom: 7px; left: 0; right: 0; display: flex; justify-content: center; gap: 5px; pointer-events: none; }
.bk-car-dot { width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,0.55); box-shadow: 0 0 2px rgba(0,0,0,0.4); }
.bk-car-dot.on { background: #fff; }
/* окно «Фото байка»: плитки с обложкой, удалением и порядком */
.bp-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.bp-tile { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--neutral-bg); }
.bp-tile img { width: 100%; height: 100%; object-fit: cover; display: block; cursor: zoom-in; }
.bp-tile .mp-del { width: 22px; height: 22px; line-height: 22px; font-size: 10px; top: 4px; right: 4px; }
.bp-tile .mp-move { width: 22px; height: 22px; line-height: 22px; font-size: 13px; bottom: 4px; }
.bp-tile .mp-move.left { left: 4px; }
.bp-tile .mp-move.right { right: 4px; }
.bp-cover, .bp-mk-cover { position: absolute; top: 4px; left: 4px; font-size: 8.5px; font-weight: 600; border-radius: 999px; padding: 2px 6px; border: none; font-family: inherit; }
.bp-cover { background: var(--accent); color: #fff; }
.bp-mk-cover { background: rgba(10,12,16,0.6); color: #fff; cursor: pointer; }
/* полноэкранный просмотр фото байка лентой */
.lightbox.gallery { padding: 0; }
.lb-track { display: flex; width: 100%; height: 100%; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.lb-track::-webkit-scrollbar { display: none; }
.lb-slide { flex: 0 0 100%; height: 100%; scroll-snap-align: center; display: flex; align-items: center; justify-content: center; padding: 20px; box-sizing: border-box; }
.lb-slide img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 8px; }
.lb-arrow { position: absolute; top: 50%; transform: translateY(-50%); width: 38px; height: 38px; border-radius: 50%; border: none; background: rgba(255,255,255,0.15); color: #fff; font-size: 22px; cursor: pointer; }
.lb-arrow.left { left: 10px; }
.lb-arrow.right { right: 10px; }
.lb-count { position: absolute; top: 14px; left: 50%; transform: translateX(-50%); color: #fff; font-size: 12px; font-weight: 600; background: rgba(255,255,255,0.15); border-radius: 999px; padding: 3px 10px; }
.lb-close { position: absolute; top: 10px; right: 10px; width: 32px; height: 32px; border-radius: 50%; border: none; background: rgba(255,255,255,0.15); color: #fff; font-size: 14px; cursor: pointer; }
/* переходы между карточками */
button.link-btn { font-family: inherit; cursor: pointer; }
.info-item.tappable { cursor: pointer; box-shadow: inset 0 0 0 1px var(--line); }
.info-item.tappable:active { background: var(--surface); }
.row-text .l3 .l3-link { cursor: pointer; text-decoration: underline; text-decoration-color: rgba(0,0,0,0.15); text-underline-offset: 2px; }
.row-count.active { color: var(--accent); font-weight: 600; }
.active-rental-card { background: var(--ground); border-radius: 10px; padding: 9px; display: flex; flex-direction: column; gap: 8px; box-shadow: inset 0 0 0 1px var(--line); }
.arc-head { display: flex; align-items: center; gap: 8px; }
.active-rental-card .link-btn { background: var(--surface); }

.info-grid, .stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.info-item { background: var(--ground); border-radius: 10px; padding: 7px 9px; display: flex; flex-direction: column; gap: 2px; }
.info-item .k { font-size: 9px; color: var(--steel); text-transform: uppercase; letter-spacing: 0.03em; }
.info-item .v { font-family: "IBM Plex Mono", monospace; font-size: 12.5px; font-weight: 500; color: var(--ink); display: flex; align-items: center; gap: 4px; }
.info-item .d { font-size: 9px; color: var(--steel); }

.to-row { display: flex; gap: 6px; flex-wrap: wrap; }
.to-pill { padding: 5px 9px; border-radius: 8px; font-size: 9.5px; font-weight: 600; white-space: nowrap; }
.to-pill.warn { background: var(--warn-bg); color: var(--warn); }
.to-pill.critical { background: var(--critical-bg); color: var(--critical); }
.to-pill.ok { background: var(--neutral-bg); color: var(--steel); }

.action-row { display: flex; gap: 8px; }
.action-btn { flex: 1; text-align: center; padding: 9px; border-radius: 10px; font-size: 12px; font-weight: 600; cursor: pointer; border: none; font-family: inherit; }
.action-btn.primary { background: var(--accent); color: #fff; }
.action-btn.outline { background: var(--surface); border: 1px solid var(--line); color: var(--ink); }

.hist-tabs { display: flex; gap: 14px; border-bottom: 1px solid var(--line); margin-top: 2px; }
.ht { padding: 7px 1px; font-size: 11px; font-weight: 600; color: var(--steel); border-bottom: 2px solid transparent; cursor: pointer; background: none; border-top: none; border-left: none; border-right: none; font-family: inherit; }
.ht.active { color: var(--ink); border-bottom-color: var(--accent); }
.hist-list { display: flex; flex-direction: column; }
.hist-row { display: flex; align-items: center; gap: 7px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.hist-row:last-child { border-bottom: none; }
.hd { font-family: "IBM Plex Mono", monospace; font-size: 10px; color: var(--steel); width: 56px; flex: 0 0 auto; }
.hv { font-family: "IBM Plex Mono", monospace; font-size: 10.5px; font-weight: 500; color: var(--ink); flex: 0 0 auto; white-space: nowrap; }
.hn { font-size: 10px; color: var(--steel); flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* разбивка итоговой суммы аренды */
.calc-list { display: flex; flex-direction: column; background: var(--ground); border-radius: 10px; overflow: hidden; }
.calc-row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 7px 10px; border-bottom: 1px solid var(--line); font-size: 11px; }
.calc-row:last-child { border-bottom: none; }
.calc-row .cl { color: var(--steel); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.calc-row .cv { font-family: "IBM Plex Mono", monospace; font-weight: 500; color: var(--ink); flex: 0 0 auto; }
.calc-row.total { background: var(--surface); font-weight: 700; }
.calc-row.total .cl, .calc-row.total .cv { color: var(--ink); font-weight: 700; }

/* ---------- клиент: контакты, документы, флаги ---------- */
.link-row { display: flex; flex-wrap: wrap; gap: 8px; }
.link-btn {
  flex: 1; text-align: center; padding: 9px; border-radius: 10px; font-size: 11.5px; font-weight: 600;
  background: var(--ground); border: 1px solid var(--line); color: var(--ink); text-decoration: none;
  display: flex; align-items: center; justify-content: center; gap: 5px;
}
.link-row:has(.nick) .link-btn { flex: 1 1 auto; white-space: nowrap; }  /* несколько ников: длинный уходит на новую строку, а не ломается посередине */
.doc-list, .flag-list { display: flex; flex-direction: column; gap: 7px; }
.doc-card, .flag-card {
  display: flex; align-items: center; gap: 9px; padding: 8px 9px; background: var(--ground); border-radius: 10px;
}
.flag-card.resolved { opacity: 0.55; }
.photo-thumb { width: 34px; height: 34px; border-radius: 8px; background: var(--neutral-bg); flex: 0 0 auto; overflow: hidden; display: flex; align-items: center; justify-content: center; color: var(--steel); }
.photo-thumb img { width: 100%; height: 100%; object-fit: contain; }

/* ---------- аренды: депозит / комплектность / уведомления ---------- */
.equip-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; background: var(--ground); border-radius: 10px; padding: 8px 10px; font-size: 11px; }
.equip-row .k { color: var(--steel); font-weight: 600; flex: 0 0 auto; }
.equip-row .v { color: var(--ink); text-align: right; }
.warn-banner {
  display: flex; align-items: center; gap: 7px; padding: 8px 10px; border-radius: 10px; font-size: 11px; font-weight: 600;
}
.warn-banner.warn { background: var(--warn-bg); color: var(--warn); }
.warn-banner.critical { background: var(--critical-bg); color: var(--critical); }
.notif-list { display: flex; flex-direction: column; gap: 6px; }
.notif-item { display: flex; align-items: center; gap: 8px; padding: 8px 10px; background: var(--ground); border-radius: 10px; cursor: pointer; }
.notif-item .to-dot { align-self: flex-start; margin-top: 4px; }
.notif-item .l1 { white-space: normal; overflow: visible; line-height: 1.35; }
.notif-item.read { opacity: 0.5; }
.notif-item .to-dot.info { background: var(--info); }

/* ---------- профиль: дашборд, настройки ---------- */
.profile-body { padding: 14px 16px; display: flex; flex-direction: column; gap: 14px; flex: 1 1 auto; overflow-y: auto; }
.profile-card { display: flex; align-items: center; gap: 12px; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.profile-avatar { width: 44px; height: 44px; border-radius: 50%; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; font-family: "Barlow Semi Condensed", sans-serif; font-weight: 700; font-size: 17px; flex: 0 0 auto; }
.profile-card .name { font-size: 14px; font-weight: 600; color: var(--ink); }
.profile-card .role { font-size: 11.5px; color: var(--steel); margin-top: 1px; }
.dash-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.dash-tile { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px; display: flex; flex-direction: column; gap: 4px; }
.dt-k { font-size: 10px; color: var(--steel); font-weight: 600; display: flex; align-items: center; gap: 4px; }
.dt-v { font-family: "IBM Plex Mono", monospace; font-size: 15px; font-weight: 600; color: var(--ink); }
.menu-list { flex-shrink: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.menu-row { position: relative; display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-bottom: 1px solid var(--line); font-size: 12.5px; font-weight: 500; color: var(--ink); cursor: pointer; }
.menu-row:last-child { border-bottom: none; }
.menu-row svg { flex: 0 0 auto; color: var(--steel); }
.menu-row .txt { flex: 1 1 auto; }
.menu-row .note { font-size: 10px; color: var(--steel); font-weight: 400; margin-top: 1px; }
.menu-row.disabled { color: var(--steel); cursor: default; }
.menu-row.disabled svg { color: var(--line); }
.menu-row.danger { color: var(--critical); }
.menu-row.danger svg { color: var(--critical); }
.menu-row .chev { margin-left: auto; }

.settings-row { display: flex; align-items: center; gap: 6px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.settings-input { background: var(--ground); border: 1px solid transparent; border-radius: 8px; padding: 6px 7px; font-size: 11px; font-family: inherit; color: var(--ink); width: 64px; flex: 0 0 auto; }
.settings-input.wide { width: auto; flex: 1 1 auto; }
.settings-input:focus { border-color: var(--accent); outline: none; }
.field-row { display: flex; gap: 8px; align-items: center; }
.field-row input { flex: 1 1 auto; background: var(--ground); border: 1px solid transparent; border-radius: 9px; padding: 8px 10px; font-size: 12px; font-family: inherit; }
.date-clear-btn { flex: 0 0 auto; width: 30px; height: 30px; border-radius: 9px; border: none; background: var(--ground); color: var(--steel); font-size: 12px; cursor: pointer; }
.reason-text { flex: 1 1 auto; font-size: 12px; color: var(--ink); }

/* ---------- sheet / modal ---------- */
.sheet-area { position: relative; flex: 1 1 auto; min-height: 0; }
.backdrop { position: absolute; inset: 0; background: rgba(10,12,16,0.44); }
.confirm-overlay { position: absolute; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; padding: 20px; }
.confirm-box { position: relative; z-index: 1; background: var(--surface); border-radius: 16px; padding: 18px; width: min(300px, 100%); display: flex; flex-direction: column; gap: 14px; box-shadow: 0 12px 30px -8px rgba(0,0,0,0.35); }
.confirm-msg { font-size: 13px; color: var(--ink); line-height: 1.45; white-space: pre-line; }
.confirm-box input[type="text"] { background: var(--ground); border: 1px solid transparent; border-radius: 9px; padding: 8px 10px; font-size: 12.5px; font-family: inherit; color: var(--ink); }
.confirm-actions { display: flex; gap: 8px; }
.confirm-actions .action-btn { flex: 1 1 auto; margin: 0; }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; background: var(--surface);
  border-radius: 20px 20px 0 0; padding: 14px 16px 16px; box-shadow: 0 -10px 26px rgba(0,0,0,0.16);
  display: flex; flex-direction: column; gap: 11px; max-height: 88%; overflow-y: auto;
}
.sheet-grab { width: 34px; height: 4px; border-radius: 3px; background: var(--line); align-self: center; margin-bottom: 2px; }
.sheet-head { display: flex; justify-content: space-between; align-items: center; }
.sheet-head h3 { font-family: "Barlow Semi Condensed", sans-serif; font-weight: 700; font-size: 15px; margin: 0; }
.sheet-close { width: 22px; height: 22px; border-radius: 50%; background: var(--ground); display: flex; align-items: center; justify-content: center; color: var(--steel); font-size: 13px; flex: 0 0 auto; cursor: pointer; border: none; }

.value-display { font-family: "IBM Plex Mono", monospace; font-size: 28px; font-weight: 500; text-align: center; padding: 10px; color: var(--ink); background: var(--ground); border-radius: 12px; border: none; width: 100%; outline: none; }
.value-display::placeholder { color: var(--steel); opacity: 0.6; }
.hint-row { display: flex; justify-content: space-between; font-size: 10px; color: var(--steel); padding: 0 2px; }
.err-row { font-size: 10.5px; color: var(--critical); padding: 0 2px; display: none; }
.err-row.show { display: block; }
.override-row { display: none; align-items: center; gap: 6px; font-size: 10.5px; color: var(--steel); padding: 0 2px; }
.override-row.show { display: flex; }

.field { display: flex; flex-direction: column; gap: 4px; }
.field label { font-size: 10px; color: var(--steel); font-weight: 500; }
.field input[type="text"], .field input[type="email"], .field input[type="password"], .field input[type="number"], .field input[type="tel"], .field input[type="date"], .field textarea, .field select {
  background: var(--ground); border: 1px solid transparent; border-radius: 9px; padding: 8px 10px;
  font-size: 12px; color: var(--ink); font-family: inherit; outline: none; width: 100%;
}
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--accent); }
.field textarea { resize: none; min-height: 44px; }

.type-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.type-chip { padding: 6px 10px; border-radius: 999px; font-size: 10.5px; font-weight: 500; background: var(--ground); color: var(--steel); cursor: pointer; user-select: none; }
.type-chip.sel { background: var(--accent); color: #fff; }

.dropzone { border: 1.5px dashed var(--line); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; align-items: center; gap: 5px; color: var(--steel); font-size: 10.5px; text-align: center; cursor: pointer; position: relative; }
.dropzone input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dropzone.filled { border-style: solid; border-color: var(--line); flex-direction: row; align-items: center; justify-content: flex-start; gap: 9px; padding: 7px 9px; }
.dz-name { font-size: 11px; color: var(--ink); font-weight: 500; }

/* мульти-фото дропзона + сетки фото аренды */
.multi-dz { display: flex; flex-direction: column; gap: 7px; }
.mp-strip { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.mp-thumb { position: relative; width: 46px; height: 46px; border-radius: 8px; overflow: hidden; background: var(--neutral-bg); flex: 0 0 auto; }
.mp-thumb img { width: 100%; height: 100%; object-fit: contain; display: block; cursor: zoom-in; }
.mp-del { position: absolute; top: 1px; right: 1px; width: 15px; height: 15px; border-radius: 50%; border: none; background: rgba(10,12,16,0.6); color: #fff; font-size: 8px; line-height: 15px; padding: 0; cursor: pointer; }
.mp-move { position: absolute; bottom: 1px; width: 15px; height: 15px; border-radius: 50%; border: none; background: rgba(10,12,16,0.6); color: #fff; font-size: 9px; line-height: 15px; padding: 0; cursor: pointer; }
.mp-move.left { left: 1px; }
.mp-move.right { right: 1px; }
.mp-add { border: 1.5px dashed var(--line); border-radius: 12px; padding: 10px; display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--steel); font-size: 10.5px; text-align: center; cursor: pointer; position: relative; }
.mp-add input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.mp-add-btn { font-size: 10px; font-weight: 600; color: var(--accent); background: none; border: 1px dashed var(--line); border-radius: 8px; padding: 6px 9px; cursor: pointer; flex: 0 0 auto; font-family: inherit; }
.rp-block { display: flex; flex-direction: column; gap: 5px; }
.rp-label { font-size: 10px; color: var(--steel); font-weight: 600; }
.lightbox { position: absolute; inset: 0; background: rgba(6,8,12,0.9); display: flex; align-items: center; justify-content: center; z-index: 20; padding: 20px; }
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 8px; }
.hist-row.editable { cursor: pointer; }
.hist-row.editable:active { background: var(--ground); }
.photo-link { cursor: pointer; padding: 2px 1px; }

/* редактор позиций работ ТО */
#svc-items { display: flex; flex-direction: column; gap: 6px; }
.svc-item-row { display: flex; flex-wrap: wrap; gap: 5px; padding: 7px; background: var(--ground); border-radius: 9px; align-items: center; }
.svc-item-row select, .svc-item-row input { background: var(--surface); border: 1px solid var(--line); border-radius: 7px; padding: 6px 8px; font-size: 11px; font-family: inherit; color: var(--ink); outline: none; }
.svc-item-row select:focus, .svc-item-row input:focus { border-color: var(--accent); }
.svc-item-row .svc-it-type { flex: 1 1 100%; }
.svc-item-row .svc-it-name { flex: 1 1 58%; min-width: 0; }
.svc-item-row .svc-it-cost { flex: 1 1 28%; min-width: 62px; }
.svc-item-row .svc-it-nextkm { flex: 1 1 100%; }
.svc-item-row .mini-btn { flex: 0 0 auto; align-self: center; padding: 5px 8px; }

.dbg-box { font-size: 10px; color: var(--steel); background: var(--ground); border-radius: 9px; padding: 8px 10px; }
.dbg-box summary { cursor: pointer; font-weight: 600; }
.dbg-box pre { margin: 6px 0 0; white-space: pre-wrap; word-break: break-word; font-family: "IBM Plex Mono", monospace; font-size: 9.5px; max-height: 180px; overflow: auto; }

.checkbox-row { display: flex; align-items: center; gap: 7px; font-size: 11px; color: var(--steel); }
.checkbox-row input { width: 14px; height: 14px; }

.sheet-save { background: var(--accent); color: #fff; text-align: center; padding: 11px; border-radius: 11px; font-weight: 600; font-size: 12.5px; cursor: pointer; border: none; font-family: inherit; }
.sheet-save:disabled { opacity: 0.45; cursor: not-allowed; }
.sheet-save.secondary { background: var(--ink); }

.toast {
  position: absolute; left: 12px; right: 12px; bottom: 14px; background: #1c1f26; color: #fff;
  border-radius: 12px; padding: 9px 11px; display: flex; align-items: center; gap: 8px;
  font-size: 10.5px; font-weight: 500; box-shadow: 0 8px 20px rgba(0,0,0,0.28); z-index: 8;
  animation: toast-in 0.2s ease-out;
}
.toast svg { flex: 0 0 auto; color: var(--good); }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* Защита от известного flex-бага: внутри прокручиваемых flex-колонок (.profile-body/.detail-scroll/.sheet)
   дочерний блок с overflow:hidden получает вычисляемую min-height:auto = 0 и браузер может схлопнуть
   его почти до нуля при нехватке места, вместо того чтобы просто прокрутить контейнер. Явный
   flex-shrink:0 на всех прямых детях этих контейнеров гарантирует, что секции сохраняют свой
   естественный размер, а скроллится сам контейнер. flex-grow:0 гасит другой баг: .action-btn
   задаёт flex:1 для рядов кнопок (.action-row), но одиночная .action-btn (напр. «Удалить байк»)
   без такого ряда-обёртки иначе растягивается на всё свободное место колонки по высоте. */
.profile-body > *, .detail-scroll > *, .sheet > * { flex-shrink: 0; flex-grow: 0; }

/* ---------- плашка синхронизации с сервером (updateSyncBadge в app.js) ---------- */
.sync-badge {
  position: fixed; top: calc(8px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); z-index: 60;
  max-width: calc(100% - 24px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border: none; border-radius: 999px; padding: 6px 13px;
  font: 600 11.5px/1.3 "IBM Plex Sans", system-ui, sans-serif; text-align: center;
  box-shadow: 0 6px 18px -6px rgba(0,0,0,0.45); cursor: pointer;
}
.sync-badge[hidden] { display: none; }
.sync-badge.bad { background: var(--critical); color: #fff; }
.sync-badge.off { background: #3a3f48; color: #fff; cursor: default; }
.sync-badge.ok { background: var(--good); color: #fff; cursor: default; }

/* ---------- вход / регистрация ---------- */
.auth-wrap { flex: 1 1 auto; overflow-y: auto; padding: 28px 20px 20px; display: flex; flex-direction: column; gap: 10px; align-items: stretch; }
.auth-logo { align-self: center; width: 64px; height: 64px; border-radius: 18px; background: var(--ground); color: var(--accent); display: flex; align-items: center; justify-content: center; margin-bottom: 6px; }
.auth-title { text-align: center; font-family: "Barlow Semi Condensed", sans-serif; font-weight: 700; font-size: 19px; }
.auth-sub { text-align: center; font-size: 11.5px; color: var(--steel); margin-bottom: 6px; }
.auth-switch { text-align: center; font-size: 11.5px; color: var(--steel); margin-top: 6px; }
.auth-switch span { color: var(--accent); font-weight: 600; cursor: pointer; }

/* ---------- админка ---------- */
.action-btn.danger { color: var(--critical); border-color: var(--critical-bg); background: var(--critical-bg); }
.warn-banner.info { background: var(--info-bg); color: var(--info); }
.doc-card select.settings-input { width: auto; min-width: 92px; }
.doc-card { flex-wrap: wrap; }

/* ---------- права ролей ---------- */
.perm-list { display: flex; flex-direction: column; gap: 8px; }
.perm-row { border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; }
.perm-name { font-size: 12.5px; font-weight: 600; margin-bottom: 6px; }
.perm-actions { display: flex; flex-wrap: wrap; gap: 8px 12px; }
.perm-box { display: flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--steel); cursor: pointer; }
.perm-box input { margin: 0; }

/* ---------- реальное приложение (не мокап-презентация) ----------
   По умолчанию приложение занимает весь экран: ни рамки «телефона», ни
   презентационной шапки, ни фейкового «9:41». Так на телефоне, планшете и
   в установленном PWA. Учитываем безопасные зоны (челка / жест-бар). */
body { background: #0d0f13; }
.page { padding: 0; max-width: none; display: block; }
.page-head { display: none; }
.device {
  width: 100%; height: 100vh; height: 100dvh;
  border-radius: 0; padding: 0; box-shadow: none; background: #0d0f13;
}
.screen { border-radius: 0; padding-bottom: env(safe-area-inset-bottom); }
.notch, .statusbar { display: none; }

/* ---------- ПК / планшет / любой экран шире телефона ----------
   Приложение занимает ВЕСЬ экран (без центрированной колонки и рамки).
   Навигация сверху, списки — сеткой карточек на всю ширину, формы —
   центрированным диалогом вместо «шторки снизу». */
@media (min-width: 641px) {
  .device { width: 100%; height: 100vh; height: 100dvh; margin: 0; padding: 0; box-shadow: none; }
  /* на больших диагоналях фиксированные px-размеры интерфейса иначе выглядят мелко и
     вынуждают вручную масштабировать страницу (Ctrl/Cmd +) — вместо этого сам .screen
     отрисовывается с CSS zoom (--ui-scale, растёт по брейкпоинтам ниже). zoom не меняет
     собственный внешний размер элемента (width/height остаются как есть, 100% — экран
     по-прежнему точно заполняет .device), он масштабирует только то, что внутри
     (шрифты, отступы, иконки) — делить width/height на коэффициент заранее НЕ нужно,
     это только оставляет пустое поле сбоку (проверено вживую через playwright). */
  .screen {
    padding-bottom: 0;
    zoom: var(--ui-scale);
  }

  /* таб-бар → горизонтальная панель сверху */
  .tabbar {
    order: -1;
    border-top: none; border-bottom: 1px solid var(--line);
    padding: 6px 14px; gap: 4px;
  }
  .tab {
    flex: 0 0 auto; flex-direction: row; gap: 8px;
    font-size: 13px; padding: 9px 14px; border-radius: 9px;
  }
  .tab.active { background: var(--ground); }
  .tab .tab-ico-wrap svg { width: 17px; height: 17px; }

  .ab-row { padding: 18px clamp(16px, 3vw, 40px) 12px; }
  .chips { padding-left: clamp(16px, 3vw, 40px); padding-right: clamp(16px, 3vw, 40px); }

  /* списки → сетка карточек на всю ширину экрана */
  .list {
    display: grid; align-content: start;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 10px 14px; padding: 16px clamp(16px, 3vw, 40px); border-top: none;
  }
  .list-divider { grid-column: 1 / -1; }
  .row {
    border: 1px solid var(--line); border-radius: 12px;
    padding: 12px 14px; background: var(--surface);
    transition: box-shadow .12s, border-color .12s;
  }
  .row:hover { border-color: var(--steel); box-shadow: 0 4px 14px -6px rgba(0,0,0,0.18); }

  /* детальные экраны, профиль, вход — читаемая ширина по центру */
  .detail-header { max-width: 900px; margin: 0 auto; width: 100%; padding: 14px 16px; }
  .detail-scroll, .profile-body { padding-left: 0; padding-right: 0; align-items: center; }
  .detail-scroll > *, .profile-body > * { width: 100%; max-width: 860px; }
  .auth-wrap { align-items: center; padding-top: 8vh; }
  .auth-wrap > *:not(.auth-logo) { width: 100%; max-width: 400px; }

  /* форма → центрированный диалог */
  .sheet-area { display: flex; align-items: center; justify-content: center; padding: 24px; }
  .sheet {
    position: relative; z-index: 1; left: auto; right: auto; bottom: auto;
    width: min(640px, 100%); max-height: 88vh;
    border-radius: 16px; box-shadow: 0 24px 70px -20px rgba(0,0,0,0.45);
  }
  .sheet-grab { display: none; }
}

/* очень широкие мониторы — больше колонок в списках */
@media (min-width: 1500px) {
  .list { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }
}

/* --- масштаб интерфейса под диагональ экрана (см. --ui-scale / .screen выше) ---
   641–1279px (планшет, маленький ноут) — без изменений, шаг 1 уже подобран.
   Дальше шрифты/отступы/иконки увеличиваются вместе, чтобы не приходилось
   вручную зумить страницу на большом мониторе. */
@media (min-width: 1280px) { :root { --ui-scale: 1.15; } }
@media (min-width: 1680px) { :root { --ui-scale: 1.3; } }
@media (min-width: 2160px) { :root { --ui-scale: 1.5; } }

/* ==================== Тема «Гараж» (концепт A, ~/Desktop/Bikes/Дизайны/a-garage.html) ====================
   Графит + один кислотный акцент для действий, светящиеся статусы, моноширинные цифры как на одометре.
   Только переопределения поверх базовых стилей выше: токены цветов, шрифты, карточки списков. */
:root {
  color-scheme: dark;
  --ink: #eef0f2;
  --steel: #8b939c;
  --ground: #1a1d21;
  --surface: #121417;
  --line: #2c3137;
  --accent: #e4ff1a;
  --accent-ink: #141600;
  --panel-2: #22262b;
  --line-2: #3a4048;
  --dim: #5c636b;

  --good: #2be38a;     --good-bg: rgba(43,227,138,.12);
  --warn: #ff8a1a;     --warn-bg: rgba(255,138,26,.13);
  --critical: #ff3d4a; --critical-bg: rgba(255,61,74,.13);
  --info: #38bdf8;     --info-bg: rgba(56,189,248,.12);
  --neutral: #5c636b;  --neutral-bg: #22262b;

  --g-head: "Oswald", "Arial Narrow", sans-serif;
  --g-mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
  --g-sans: "Manrope", system-ui, -apple-system, sans-serif;
}
body, .device { background: #0b0c0e; }
body, .screen, .tab, .action-btn, .sheet-save, .link-btn, .mp-add-btn, .ht,
.field input[type="text"], .field input[type="email"], .field input[type="password"], .field input[type="number"], .field input[type="tel"], .field input[type="date"], .field textarea, .field select,
.settings-input, .field-row input, .search input, .confirm-box input[type="text"], .svc-item-row select, .svc-item-row input { font-family: var(--g-sans); }

/* заголовки - узкий Oswald капсом */
.ab-row h2, .dh-name, .sheet-head h3, .auth-title, .ph-title {
  font-family: var(--g-head); text-transform: uppercase; letter-spacing: .02em; font-weight: 600;
}
.ab-row h2 { font-size: 24px; line-height: 1; }
.dh-name { font-size: 18px; }
.sheet-head h3 { font-size: 17px; }
.thumb, .profile-avatar { font-family: var(--g-mono); font-weight: 800; }

/* цифры, даты, номера - моноширинный «одометр» */
.row-text .l2, .dh-meta, .info-item .v, .hd, .hv, .calc-row .cv, .dt-v, .value-display, .dbg-box pre, .tab-badge, .pay-badge, .row-count {
  font-family: var(--g-mono); font-variant-numeric: tabular-nums;
}
.dt-v { font-weight: 800; font-size: 17px; }
.info-item .v { font-weight: 700; }
/* подписи секций - мелкий моно капсом с разрядкой */
.section-title, .info-item .k, .list-divider, .dt-k, .rp-label, .field label {
  font-family: var(--g-mono); letter-spacing: .12em; text-transform: uppercase; font-weight: 700;
}
.section-title, .list-divider { font-size: 10.5px; }
.info-item .k, .field label, .dt-k, .rp-label { font-size: 9.5px; color: var(--dim); }

/* текст на кислотном акценте - тёмный, не белый */
.icon-btn, .action-btn.primary, .sheet-save, .type-chip.sel, .profile-avatar, .bp-cover {
  color: var(--accent-ink);
}
.icon-btn { box-shadow: 0 0 14px -2px rgba(228,255,26,.45); border-radius: 12px; }
.icon-btn.ghost { background: var(--ground); color: var(--ink); border: 1px solid var(--line); box-shadow: none; }
.sheet-save { font-family: var(--g-mono); font-weight: 800; text-transform: uppercase; letter-spacing: .04em; border-radius: 13px; padding: 13px; }
.sheet-save.secondary { background: var(--panel-2); color: var(--ink); border: 1px solid var(--line-2); }
.action-btn.primary { font-weight: 800; }
.action-btn.outline { background: transparent; border-color: var(--line-2); }
.action-btn.danger { border: 1px solid rgba(255,61,74,.4); }

/* чипы фильтров */
.chip { border-radius: 9px; background: var(--ground); border-color: var(--line); color: var(--steel); font-weight: 600; }
.chip.active { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.type-chip { background: var(--ground); border: 1px solid var(--line); border-radius: 9px; }
.type-chip.sel { border-color: var(--accent); }

/* поиск и поля ввода */
.search { background: var(--ground); border-color: var(--line); border-radius: 12px; }
.field input[type="text"], .field input[type="email"], .field input[type="password"], .field input[type="number"], .field input[type="tel"], .field input[type="date"], .field textarea, .field select,
.settings-input, .field-row input, .confirm-box input[type="text"] { background: var(--ground); border: 1px solid var(--line); border-radius: 11px; }
.field input:focus, .field textarea:focus, .field select:focus, .settings-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(228,255,26,.12); }
.value-display { background: var(--ground); border: 1px solid var(--line); font-weight: 800; }
.svc-item-row { background: var(--ground); }
.svc-item-row select, .svc-item-row input { background: var(--surface); }

/* списки: строки - отдельные панели с цветной полосой статуса и светящейся точкой */
.list { background: var(--surface); border-top: none; }
.row:active { background: var(--panel-2); }
.chev { color: var(--dim); }
.to-dot { box-shadow: 0 0 8px currentColor; }
.to-dot.warn { color: var(--warn); }
.to-dot.critical { color: var(--critical); }
.to-dot.info { color: var(--info); }
.pay-badge, .flag-tag { border-radius: 6px; letter-spacing: .04em; text-transform: uppercase; font-size: 9px; font-weight: 700; border: 1px solid currentColor; }
.thumb, .row-photo, .photo-thumb { background: var(--panel-2); border: 1px solid var(--line); }
.list-divider { background: transparent; color: var(--dim); }
.row .end-btn { background: var(--panel-2); border-color: var(--line-2); color: var(--ink); }

/* карточки и блоки детальных экранов */
.info-item, .mini-list, .calc-list, .equip-row, .doc-card, .flag-card, .notif-item, .active-rental-card, .link-btn, .dbg-box {
  background: var(--ground); border: 1px solid var(--line); border-radius: 12px;
}
.active-rental-card { box-shadow: none; border-left: 3px solid var(--info); }
.active-rental-card .link-btn { background: var(--panel-2); }
.info-item.tappable { box-shadow: none; border-color: var(--line-2); }
.calc-row.total { background: var(--panel-2); }
.calc-row.total .cv { color: var(--accent); }
.calc-row, .mini-row, .hist-row, .settings-row, .menu-row { border-color: var(--line); }
.mini-row:active, .info-item.tappable:active { background: var(--panel-2); }
.profile-card, .dash-tile, .menu-list { background: var(--ground); border-color: var(--line); }
.dash-tile { position: relative; overflow: hidden; }
.dash-tile::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--accent); opacity: .55; }
.photo-block, .bk-car, .bp-tile, .mp-thumb { background: var(--ground); }
.dropzone, .mp-add, .mp-add-btn { border-color: var(--line-2); }
.hist-tabs { border-color: var(--line); }
.ht.active { color: var(--accent); }
.status-select { font-family: var(--g-mono); letter-spacing: .06em; text-transform: uppercase; font-size: 9.5px; border: 1px solid currentColor; }
.status-select.rented { background-color: rgba(228,255,26,.1); color: var(--accent); }
.to-pill { border: 1px solid currentColor; font-family: var(--g-mono); }
.warn-banner { border: 1px solid currentColor; }
.tg-apps-banner {
  background: repeating-linear-gradient(-45deg, #1d2010 0 10px, #191c0d 10px 20px);
  border: 1px solid var(--accent); color: var(--accent);
}

/* шторки, диалоги, тосты */
.sheet { background: var(--surface); border-top: 1px solid var(--line-2); box-shadow: 0 -16px 40px rgba(0,0,0,.6); }
.sheet-grab { background: var(--line-2); }
.sheet-close { background: var(--ground); border: 1px solid var(--line); color: var(--ink); }
.backdrop { background: rgba(0,0,0,.62); }
.confirm-box { background: var(--ground); border: 1px solid var(--line-2); }
.toast { background: var(--panel-2); border: 1px solid var(--line-2); color: var(--ink); }
.auth-logo { background: var(--ground); border: 1px solid var(--line); }

/* таб-бар */
.tabbar { background: #0e1013; border-color: var(--line); }
.tab { color: var(--dim); font-weight: 600; }
.tab.active { color: var(--accent); }

/* телефон: строки списка - отдельные панели с зазором */
@media (max-width: 640px) {
  .list { display: flex; flex-direction: column; gap: 6px; padding: 2px 14px 14px; }
  .row { flex: 0 0 auto; background: var(--ground); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; padding: 9px 10px 9px 0; }
  .tab.active .tab-ico-wrap { background: rgba(228,255,26,.12); border-radius: 10px; padding: 4px 11px; margin: -4px 0; }
}
/* ПК: карточки сетки - панели, активная вкладка - подсветка акцентом */
@media (min-width: 641px) {
  .row { background: var(--ground); border-color: var(--line); overflow: hidden; }
  .row:hover { border-color: var(--line-2); box-shadow: 0 6px 18px -8px rgba(0,0,0,.7); }
  .tab.active { background: rgba(228,255,26,.1); }
}
/* ---- таблички госномеров (вьетнамская мото-табличка в две строки) ---- */
.plate {
  flex: 0 0 auto; width: 60px; height: 42px; background: #f2f0e6; color: #111; border-radius: 5px; border: 2px solid #111;
  box-shadow: 0 0 0 1px #4a4a4a, inset 0 0 0 1px #c9c6b8; display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-family: var(--g-mono); font-weight: 800; line-height: 1; letter-spacing: -.02em; white-space: nowrap; overflow: hidden;
}
.plate .p1 { font-size: 11.5px; }
.plate .p2 { font-size: 12.5px; margin-top: 3px; }
.plate.sm { width: 48px; height: 34px; }
.plate.sm .p1 { font-size: 9.5px; } .plate.sm .p2 { font-size: 10.5px; margin-top: 2px; }
.plate.xl { width: 128px; height: 86px; border-width: 3px; border-radius: 9px; }
.plate.xl .p1 { font-size: 25px; } .plate.xl .p2 { font-size: 27px; margin-top: 6px; }
/* длинный номер: ужимаем шрифт ступенями, чтобы влез целиком */
.plate.fit1 .p1, .plate.fit1 .p2 { font-size: 10.5px; }
.plate.fit2 .p1, .plate.fit2 .p2 { font-size: 9px; letter-spacing: -.04em; }
.plate.fit3 .p1, .plate.fit3 .p2 { font-size: 7.5px; letter-spacing: -.05em; }
.plate.sm.fit1 .p1, .plate.sm.fit1 .p2 { font-size: 8.5px; }
.plate.sm.fit2 .p1, .plate.sm.fit2 .p2 { font-size: 7.5px; }
.plate.sm.fit3 .p1, .plate.sm.fit3 .p2 { font-size: 6.5px; }
.plate.xl.fit1 .p1, .plate.xl.fit1 .p2 { font-size: 22px; }
.plate.xl.fit2 .p1, .plate.xl.fit2 .p2 { font-size: 18px; }
.plate.xl.fit3 .p1, .plate.xl.fit3 .p2 { font-size: 14px; }
.plate.none { background: var(--panel-2); color: var(--dim); border-color: var(--line-2); box-shadow: none; }
.plate.none .p1, .plate.none .p2 { font-size: 9px; font-weight: 700; }
.plate.xl.none .p1, .plate.xl.none .p2 { font-size: 15px; }
.row > .plate { margin-left: 2px; }
.arc-head .plate { margin-right: 2px; }

/* ---- плитки-счётчики над списком байков (тап = фильтр) ---- */
.gauges { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; padding: 0 16px 10px; flex: 0 0 auto; }
.gauge { background: var(--ground); border: 1px solid var(--line); border-radius: 12px; padding: 8px 8px 7px; position: relative; overflow: hidden; cursor: pointer; }
.gauge::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--c); }
.gauge .n { font: 800 22px/1 var(--g-mono); color: var(--c); }
.gauge .l { font-size: 10px; color: var(--steel); margin-top: 4px; font-weight: 600; line-height: 1.1; }
.gauge.on { background: linear-gradient(180deg, color-mix(in srgb, var(--c) 18%, var(--ground)), var(--ground)); border-color: color-mix(in srgb, var(--c) 55%, var(--line)); }

/* ---- карточка байка: шапка с табличкой, спидометр, ближайшее ТО ---- */
.g-hero { background: var(--ground); border: 1px solid var(--line); border-radius: 16px; padding: 12px; display: flex; gap: 12px; align-items: center; }
.g-hero .meta { flex: 1; min-width: 0; }
.g-hero .model { font-family: var(--g-head); font-size: 20px; text-transform: uppercase; line-height: 1.05; font-weight: 600; }
.g-hero .kv { font: 500 11px var(--g-mono); color: var(--steel); margin-top: 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.g-hero .pill { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--c); color: var(--c); border-radius: 999px; padding: 3px 9px 3px 7px; font: 700 10px var(--g-mono); letter-spacing: .08em; text-transform: uppercase; margin-top: 8px; background: color-mix(in srgb, var(--c) 10%, transparent); }
.g-hero .pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--c); box-shadow: 0 0 8px var(--c); }
.g-dash { display: grid; grid-template-columns: 150px 1fr; gap: 8px; }
.g-odo { background: radial-gradient(circle at 50% 60%, #1f2328, #15171a 70%); border: 1px solid var(--line); border-radius: 16px; padding: 8px 6px 9px; text-align: center; position: relative; }
.g-odo svg { width: 136px; height: 86px; display: block; margin: 0 auto; }
.g-odo .val { font: 800 21px/1 var(--g-mono); margin-top: -22px; letter-spacing: -.02em; }
.g-odo .unit { font: 600 9.5px var(--g-mono); color: var(--steel); letter-spacing: .06em; margin-top: 4px; text-transform: uppercase; }
.g-odo .at { font: 500 9px var(--g-mono); color: var(--dim); margin-top: 2px; }
.g-odo .ttl { position: absolute; top: 8px; left: 10px; font: 700 9px var(--g-mono); color: var(--dim); letter-spacing: .14em; }
.g-next { display: flex; flex-direction: column; gap: 6px; }
.nx { background: var(--ground); border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; flex: 1; display: flex; flex-direction: column; justify-content: center; }
.nx .k { font: 700 9px var(--g-mono); letter-spacing: .1em; color: var(--dim); text-transform: uppercase; }
.nx .v { font: 800 17px/1.1 var(--g-mono); margin-top: 3px; color: var(--c, var(--ink)); }
.nx .v small { font-size: 11px; color: var(--steel); font-weight: 500; }
.info-grid.one { grid-template-columns: 1fr; }

/* автозаполнение браузера не перекрашивает поля в светлый */
input:-webkit-autofill, input:-webkit-autofill:hover, input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--ink); -webkit-box-shadow: 0 0 0 1000px var(--ground) inset; caret-color: var(--ink);
}
@media (min-width: 641px) { .gauges { padding-left: clamp(16px, 3vw, 40px); padding-right: clamp(16px, 3vw, 40px); } }

/* логотип Anzur Systems: экран входа/загрузки и карточка «О приложении» */
.auth-brand { align-self: center; width: min(250px, 72%); height: auto; margin: 4px 0 2px; }
.profile-avatar.brand { background: #0b0e17; border: 1px solid var(--line); }
.profile-avatar.brand img { width: 36px; height: auto; display: block; }

/* «Приложение переехало» на старом адресе ilubike1.pages.dev (скрипт в index.html) */
.moved-overlay { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(8, 10, 14, .84); backdrop-filter: blur(6px); }
.moved-box { width: min(340px, 100%); background: var(--surface); border: 1px solid var(--line-2); border-radius: 18px; padding: 22px 20px; display: flex; flex-direction: column; gap: 10px; color: var(--ink); text-align: center; }
.moved-box img { width: 56px; height: auto; align-self: center; }
.moved-box b { font: 700 19px var(--g-head); }
.moved-box p { margin: 0; font-size: 14px; line-height: 1.45; opacity: .85; }
.moved-url { font: 600 15px var(--g-mono); color: var(--accent); word-break: break-all; }
.moved-btn { margin-top: 6px; background: var(--accent); color: var(--accent-ink); font-weight: 800; text-decoration: none; border-radius: 12px; padding: 13px; }
