/* =====================================================================
   Starter-Generator · Dark Industrial Theme
   v11 — акцент сменён с красного на медово-золотой (teal+gold, без вибрации)
   ===================================================================== */

:root {
  color-scheme: dark;

  /* Фон */
  --bg:          #16181c;   /* почти-чёрный с тёплым синим */
  --bg-mid:      #1e2126;   /* карточки первого уровня */
  --surface:     #252a31;   /* карточки второго уровня */
  --surface-hi:  #2e343d;   /* hover / focus поверхности */

  /* Текст */
  --ink:         #edeae3;   /* основной — тёплый белый */
  --ink-soft:    #b8b3a8;   /* вторичный */
  --muted:       #8b9199;   /* подписи, метки — поднят для читаемости мелкого текста */

  /* Разделители */
  --line:        #313840;   /* тонкие рамки */
  --line-hi:     #3d4550;   /* активные рамки */

  /* Бренд */
  --brand:       #21a196;   /* яркий циан-зелёный (стал светлее для тёмного фона) */
  --brand-dark:  #17cfc2;   /* акцент бренда для ссылок */
  --brand-deep:  #188177;   /* тёмный teal — фон под белый текст (таб/сегмент) */

  /* Акцент — медово-золотой */
  --accent:      #d99a2b;   /* золото: уходит с оси teal, не режет глаз */
  --accent-soft: rgba(217, 154, 43, 0.16);
  --on-accent:   #1c1407;   /* тёмный текст поверх золотой заливки */

  /* Утилиты */
  --warn:        #f0b429;
  --shadow:      0 16px 45px rgba(0, 0, 0, 0.45);
  --shadow-sm:   0 4px 14px rgba(0, 0, 0, 0.35);

  font-family: Inter, ui-sans-serif, system-ui, -apple-system,
               BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* ------------------------------------------------------------------ */
/*  Reset & base                                                        */
/* ------------------------------------------------------------------ */

* { box-sizing: border-box; }

html { scroll-behavior: smooth; touch-action: manipulation; }

body {
  margin: 0;
  min-height: 100vh;
  width: 100%;
  overflow-x: hidden;
  color: var(--ink);
  background:
    radial-gradient(ellipse 80% 40% at 50% -10%,
      rgba(33, 161, 150, 0.10) 0%, transparent 70%),
    var(--bg);
}

button, input, textarea { font: inherit; }
a { color: inherit; text-decoration: none; }

/* ------------------------------------------------------------------ */
/*  Layout                                                              */
/* ------------------------------------------------------------------ */

.app-shell {
  width: min(100%, 760px);
  margin: 0 auto;
  padding: 14px 14px 112px;
}

/* ------------------------------------------------------------------ */
/*  Hero                                                                */
/* ------------------------------------------------------------------ */

.hero {
  position: relative;
  min-height: 430px;
  overflow: hidden;
  border-radius: 12px;
  background: #0c0e11;
  color: #fff;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    rgba(12, 14, 17, 0.96) 0%,
    rgba(12, 14, 17, 0.74) 46%,
    rgba(12, 14, 17, 0.08) 100%
  );
}

.hero__content {
  position: relative;
  z-index: 1;
  width: min(470px, 100%);
  padding: 30px 22px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.hero h1,
.section h2 { margin: 0; letter-spacing: 0; }

.hero h1 {
  max-width: 11ch;
  font-size: clamp(38px, 13vw, 72px);
  line-height: 0.92;
}

.hero__lead {
  max-width: 410px;
  margin: 18px 0 0;
  color: rgba(255, 255, 255, 0.70);
  font-size: 16px;
  line-height: 1.5;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.hero__image {
  position: absolute;
  right: -8px; bottom: -8px;
  z-index: 0;
  width: min(58%, 410px);
  min-width: 250px;
}

/* ------------------------------------------------------------------ */
/*  Buttons                                                             */
/* ------------------------------------------------------------------ */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  border: 0;
  border-radius: 10px;
  padding: 0 18px;
  cursor: pointer;
  font-weight: 800;
  transition: transform 140ms ease, filter 140ms ease, background 140ms ease;
}

.button:active { transform: translateY(1px); }

.button--primary {
  background: var(--accent);
  color: var(--on-accent);
  box-shadow: 0 4px 16px rgba(217, 154, 43, 0.30);
}

.button--primary:hover { filter: brightness(1.10); }

.button--secondary {
  border: 1px solid var(--line-hi);
  background: var(--surface);
  color: var(--ink);
}

.button--secondary:hover { background: var(--surface-hi); }

.button--ghost {
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: #fff;
}

.button--wide { width: 100%; }

/* ------------------------------------------------------------------ */
/*  Status strip                                                        */
/* ------------------------------------------------------------------ */

.status-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  overflow: hidden;
  margin: 14px 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--line);
}

.status-strip div {
  min-width: 0;
  padding: 14px 12px;
  background: var(--bg-mid);
}

.status-strip strong,
.status-strip span { display: block; }

.status-strip strong { font-size: 15px; color: var(--ink); }

.status-strip span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}

/* ------------------------------------------------------------------ */
/*  Sections & panels                                                   */
/* ------------------------------------------------------------------ */

.section,
.tab-panel { padding: 22px 0 0; }

/* ------------------------------------------------------------------ */
/*  Bottom nav                                                          */
/* ------------------------------------------------------------------ */

.sub-tabs {
  position: fixed;
  right: max(10px, calc((100vw - 760px) / 2 + 10px));
  bottom: 10px;
  left: max(10px, calc((100vw - 760px) / 2 + 10px));
  z-index: 10;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 4px;
  margin: 0;
  padding: 6px;
  border: 1px solid var(--line-hi);
  border-radius: 12px;
  background: rgba(30, 33, 38, 0.92);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

/* hidden на fixed/grid элементах — браузер не перебивает display:grid */
.sub-tabs[hidden] { display: none !important; }
.app-shell[hidden] { display: none !important; }

/* СТО-меню: 4 кнопки */
#navSto { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* Меню «Запись/Контакты/Аккаунт»: 3 кнопки во всю ширину, крупнее */
#navShop { grid-template-columns: repeat(3, minmax(0, 1fr)); }
#navShop .sub-tab { min-height: 64px; font-size: 14px; }
#navShop .sub-tab > span:first-child { width: 30px; height: 30px; font-size: 15px; margin-bottom: 4px; }

.sub-tab {
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 54px;
  border: 0;
  border-radius: 8px;
  padding: 7px 4px 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.1;
  transition: color 160ms ease, background 160ms ease;
}

.sub-tab > span:last-child {            /* подпись под иконкой — обычный текст, не бейдж */
  background: none;
  width: auto;
  height: auto;
  border-radius: 0;
}
.sub-tab > span:first-child {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  margin-bottom: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--ink-soft);
  font-size: 11px;
  transition: background 160ms ease, color 160ms ease;
}

.sub-tab.is-active {
  background: var(--accent);
  color: var(--on-accent);
}

.sub-tab.is-active > span:first-child {
  background: rgba(0, 0, 0, 0.16);
  color: var(--on-accent);
}

/* ------------------------------------------------------------------ */
/*  Section heading                                                     */
/* ------------------------------------------------------------------ */

.section__heading { margin-bottom: 12px; }

.section h2 {
  font-size: 26px;
  line-height: 1.05;
  color: var(--ink);
}

/* ------------------------------------------------------------------ */
/*  Service grid                                                        */
/* ------------------------------------------------------------------ */

.service-grid { display: grid; gap: 10px; }

/* ------------------------------------------------------------------ */
/*  Part tabs (sub-nav по запчастям)                                    */
/* ------------------------------------------------------------------ */

.part-tabs {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 5px;
  margin-bottom: 10px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-mid);
}

.part-tab {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  padding: 0 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  font-weight: 900;
  transition: background 140ms ease, color 140ms ease;
}

.part-tab.is-active {
  background: var(--brand-deep);
  color: #fff;
}

/* ------------------------------------------------------------------ */
/*  Part panel                                                          */
/* ------------------------------------------------------------------ */

.part-panel { margin-bottom: 16px; }

.part-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.part-panel__head span { font-weight: 900; color: var(--ink); }

.part-panel__head a {
  color: var(--brand-dark);
  font-size: 13px;
  font-weight: 900;
}

/* ------------------------------------------------------------------ */
/*  Product grid                                                        */
/* ------------------------------------------------------------------ */

.product-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.product-card {
  display: grid;
  justify-items: center;
  gap: 6px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 8px;
  background: var(--bg-mid);
  text-align: center;
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.product-card:hover {
  border-color: var(--line-hi);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.product-card img {
  width: 72px;
  height: 72px;
  object-fit: contain;
  border-radius: 6px;
}

.product-card strong {
  overflow-wrap: anywhere;
  font-size: 13px;
  color: var(--ink);
}

.product-card span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.2;
}

/* ------------------------------------------------------------------ */
/*  Service card                                                        */
/* ------------------------------------------------------------------ */

.service-card {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 14px;
  width: 100%;
  min-height: 82px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  background: var(--bg-mid);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.service-card:hover {
  background: var(--surface);
  border-color: var(--line-hi);
}

.service-card.is-active {
  border-color: var(--brand);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(33, 161, 150, 0.18);
}

.service-card__icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 10px;
  background: rgba(33, 161, 150, 0.14);
  color: var(--brand);
  flex-shrink: 0;
}

.service-card__icon svg {
  width: 28px;
  height: 28px;
  fill: currentColor;
}

.service-card strong,
.service-card small { display: block; }

.service-card strong { font-size: 16px; color: var(--ink); }

.service-card small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

/* ------------------------------------------------------------------ */
/*  Узел-переключатель в форме заявки (сегмент)                          */
/* ------------------------------------------------------------------ */

.seg {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
}

.seg__opt {
  margin: 0;
  position: relative;
  cursor: pointer;
}

.seg__opt input {
  position: absolute;
  opacity: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}

.seg__opt span {
  display: grid;
  place-items: center;
  min-height: 42px;
  border-radius: 8px;
  padding: 0 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  text-align: center;
  transition: background 140ms ease, color 140ms ease;
}

.seg__opt input:checked + span {
  background: var(--brand-deep);
  color: #fff;
}

.seg__opt input:focus-visible + span {
  outline: 2px solid var(--brand-dark);
  outline-offset: 2px;
}

/* ------------------------------------------------------------------ */
/*  Инфо — три компактные колонки                                       */
/* ------------------------------------------------------------------ */

.info-cols {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.info-col {
  display: grid;
  justify-items: center;
  gap: 8px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 8px;
  background: var(--bg-mid);
  text-align: center;
}

.info-col__icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(33, 161, 150, 0.14);
  color: var(--brand);
}

.info-col__icon svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

.info-col strong {
  font-size: 14px;
  color: var(--ink);
}

.info-col small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.3;
}

/* ------------------------------------------------------------------ */
/*  Телефон + кнопка «Получить телефон из Telegram»                      */
/* ------------------------------------------------------------------ */

.phone-row {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}

.phone-row__field {
  flex: 1 1 auto;
  min-width: 0;
}

.tg-phone-btn {
  flex: 0 0 auto;
  width: 132px;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 6px 8px;
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.15;
  text-align: center;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease;
}

.tg-phone-btn:disabled {
  cursor: default;
  opacity: 0.6;
}

.tg-phone-btn.is-active {
  background: var(--brand-deep);
  color: #fff;
  border-color: var(--brand-deep);
}

@media (prefers-reduced-motion: no-preference) {
  .tg-phone-btn.is-active {
    animation: tgPulse 1.8s ease-in-out infinite;
  }
}

@keyframes tgPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(33, 161, 150, 0.0); }
  50%      { box-shadow: 0 0 0 5px rgba(33, 161, 150, 0.30); }
}

/* ------------------------------------------------------------------ */
/*  Forms                                                               */
/* ------------------------------------------------------------------ */

.booking-form,
.contact-list,
.account-form,
.repair-form,
.repair-list { display: grid; gap: 10px; }

.booking-form,
.account-form,
.repair-form {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  background: var(--bg-mid);
}

label span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--surface);
  color: var(--ink);
  outline: none;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

input::placeholder,
textarea::placeholder { color: var(--muted); }

textarea { resize: vertical; }

input:focus,
textarea:focus,
select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(33, 161, 150, 0.18);
}

select option {
  background: var(--surface);
  color: var(--ink);
}

.form-note {
  min-height: 20px;
  margin: 0;
  color: var(--brand-dark);
  font-size: 13px;
  line-height: 1.35;
}

/* ------------------------------------------------------------------ */
/*  Cards: contact, profile, account, info, repair, empty              */
/* ------------------------------------------------------------------ */

.contact-list a,
.contact-list__item,
.profile-summary,
.account-card,
.info-item,
.repair-item,
.empty-state {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px;
  background: var(--bg-mid);
}

.contact-list a:hover {
  border-color: var(--line-hi);
  background: var(--surface);
}

.account-card {
  grid-template-columns: 64px 1fr;
  align-items: center;
  margin-bottom: 10px;
}

.account-card strong,
.account-card span { display: block; overflow-wrap: anywhere; }

.account-card strong { color: var(--ink); }

.account-card span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

/* ── Блоки информации аккаунта (3 в ряд) ───────────────────────────── */
.acc-blocks {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.acc-block {
  display: grid;
  gap: 5px;
  align-content: start;
  min-width: 0;
  padding: 12px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg-mid);
}

.acc-block span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  line-height: 1.2;
}

.acc-block strong {
  font-size: 15px;
  color: var(--ink);
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.acc-block--wide { grid-column: 1 / -1; }

.account-avatar {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  overflow: hidden;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 26px;
  font-weight: 900;
}

.account-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}

.info-item span,
.repair-item span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.info-item strong,
.repair-item strong {
  overflow-wrap: anywhere;
  font-size: 15px;
  color: var(--ink);
}

.section__heading--compact { margin-top: 22px; }

.repair-form { margin-bottom: 10px; }

.repair-item p,
.empty-state {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.profile-summary { margin-bottom: 10px; }

.profile-summary strong {
  font-size: 18px;
  color: var(--ink);
}

.profile-summary span {
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.4;
}

.contact-list span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.contact-list strong {
  overflow-wrap: anywhere;
  font-size: 16px;
  color: var(--ink);
}

/* ------------------------------------------------------------------ */
/*  Субвкладки аккаунта                                                 */
/* ------------------------------------------------------------------ */

.account-subtabs {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.account-subtabs[hidden] { display: none !important; }

/* ------------------------------------------------------------------ */
/*  Tab banner                                                          */
/* ------------------------------------------------------------------ */

.tab-banner {
  margin: 14px 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg-mid);
  box-shadow: var(--shadow-sm);
}

.tab-banner:empty { display: none; }

.tab-banner img {
  display: block;
  width: 100%;
  height: auto;
}

.tab-banner iframe {
  display: block;
  width: 100%;
  height: 280px;
  border: 0;
}

/* ------------------------------------------------------------------ */
/*  Day detail (под календарём)                                         */
/* ------------------------------------------------------------------ */

.day-detail {
  margin-bottom: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-mid);
}

.day-detail[hidden] { display: none; }

.day-detail__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.day-detail__head strong {
  font-size: 15px;
  color: var(--ink);
}

.day-detail__clear {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 4px 12px;
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: background 140ms ease;
}

.day-detail__clear:hover { background: var(--surface-hi); }

.day-detail__group { margin-top: 10px; }

.day-detail__label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.day-detail__empty {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.day-item {
  display: grid;
  gap: 3px;
  margin-bottom: 6px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.day-item:last-child { margin-bottom: 0; }

.day-item__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.day-item__top strong {
  overflow-wrap: anywhere;
  font-size: 14px;
  color: var(--ink);
}

.day-item__who {
  color: var(--ink-soft);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.day-item__sub {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}

/* ------------------------------------------------------------------ */
/*  Badges                                                              */
/* ------------------------------------------------------------------ */

.badge {
  flex: 0 0 auto;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(33, 161, 150, 0.16);
  color: var(--brand-dark);
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
}

.badge--req {
  background: var(--accent-soft);
  color: var(--accent);
}

/* ================================================================== */
/*  RESPONSIVE                                                          */
/* ================================================================== */

@media (max-width: 560px) {
  .app-shell { padding: 10px 10px 106px; }

  .hero { min-height: 560px; }

  .hero::after {
    background: linear-gradient(
      180deg,
      rgba(12, 14, 17, 0.96) 0%,
      rgba(12, 14, 17, 0.76) 54%,
      rgba(12, 14, 17, 0.18) 100%
    );
  }

  .hero__content { padding: 24px 18px; }

  .hero h1 { max-width: 9ch; }

  .hero__image {
    right: 50%;
    bottom: -14px;
    width: 390px;
    max-width: 104%;
    transform: translateX(50%);
  }

  .status-strip { grid-template-columns: 1fr; }

  .sub-tabs { right: 8px; bottom: 8px; left: 8px; }

  .sub-tab {
    min-height: 50px;
    padding-right: 2px;
    padding-left: 2px;
    font-size: 10px;
  }

  .sub-tab > span:first-child { width: 20px; height: 20px; font-size: 10px; }

  .part-tab {
    padding: 0 4px;
    font-size: 11px;
    line-height: 1.1;
  }

  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .info-grid { grid-template-columns: 1fr; }

  .account-subtabs { gap: 4px; }

  .account-subtabs .part-tab {
    padding: 0 4px;
    font-size: 12px;
    line-height: 1.1;
  }
}

@media (min-width: 640px) {
  .service-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .account-form,
  .repair-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .booking-form label:nth-of-type(4),
  .booking-form .seg,
  .booking-form .button,
  .booking-form .form-note,
  .account-form .button,
  .account-form .form-note,
  .repair-form label:nth-of-type(4),
  .repair-form .button { grid-column: 1 / -1; }
}

/* ================================================================
   MODE SWITCHER — верхний переключатель Магазин / СТО
   ================================================================ */

.mode-switcher {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 4px;
  padding: 6px;
  margin: 10px 10px 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg-mid);
  position: sticky;
  top: 0;
  z-index: 9;
}

.mode-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.15;
  text-align: center;
  transition: background 140ms ease, color 140ms ease;
}

.mode-btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

.mode-btn.is-active {
  background: var(--accent);
  color: var(--on-accent);
}

/* ================================================================
   СТО — карточки, участники, рейтинг
   ================================================================ */

.sto-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  background: var(--bg-mid);
  margin-bottom: 10px;
}

.sto-card--mine {
  border-color: var(--brand);
  background: rgba(33, 161, 150, 0.06);
}

.sto-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.sto-card__row {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.sto-card__logo-col {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.sto-card__logo {
  flex: 0 0 auto;
  width: 120px;
  height: 120px;
  border-radius: 16px;
  overflow: hidden;
  background: var(--accent);
  display: grid;
  place-items: center;
}

.sto-card__logo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.sto-card__logo-fallback {
  color: var(--on-accent);
  font-size: 42px;
  font-weight: 900;
}

.sto-card__body {
  flex: 1 1 auto;
  min-width: 0;
}

.sto-card__phones {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  overflow-x: auto;
  scrollbar-width: none;
}

.sto-card__phones::-webkit-scrollbar {
  display: none;
}

.sto-card__phone {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
  color: var(--ink-soft);
  text-decoration: none;
  white-space: nowrap;
  flex: 0 0 auto;
}

.sto-card__phone:hover {
  background: var(--bg-mid);
  color: var(--brand);
}

.sto-card__head strong {
  font-size: 16px;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.sto-card__sub {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 6px;
}

.sto-card__meta {
  display: block;
  color: var(--ink-soft);
  font-size: 13px;
  margin-top: 4px;
}

.sto-join-row {
  display: flex;
  gap: 6px;
  margin-top: 10px;
}

.sto-join-row input {
  flex: 1;
}

.sto-ref-row {
  display: flex;
  gap: 6px;
}

.sto-ref-row input {
  flex: 1;
  font-size: 12px;
}

/* Список участников */
.sto-members-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.sto-member {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}

.sto-member__info strong {
  display: block;
  font-size: 14px;
  color: var(--ink);
}

.sto-member__info span {
  font-size: 12px;
  color: var(--muted);
}

/* ТОП */
.sto-top-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-mid);
  margin-bottom: 8px;
}

.sto-top-row--mine {
  border-color: var(--brand);
  background: rgba(33, 161, 150, 0.06);
}

.sto-top-rank {
  font-size: 18px;
  font-weight: 900;
  color: var(--accent);
  min-width: 32px;
  text-align: center;
}

.sto-top-info {
  flex: 1;
  min-width: 0;
}

.sto-top-info strong {
  display: block;
  font-size: 15px;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.sto-top-info span {
  font-size: 12px;
  color: var(--muted);
}

.sto-top-count {
  font-size: 14px;
  font-weight: 800;
  color: var(--ink-soft);
  white-space: nowrap;
}

/* Первые три места — золото/серебро/бронза */
.sto-top-row:nth-child(1) .sto-top-rank { color: #f0b429; }
.sto-top-row:nth-child(2) .sto-top-rank { color: #a8b2c1; }
.sto-top-row:nth-child(3) .sto-top-rank { color: #c07c4e; }


/* ── Аватары участников СТО ─────────────────────────────────────── */
.sto-member__avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.sto-member__avatar--letter {
  display: grid;
  place-items: center;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 16px;
  font-weight: 900;
}

/* ── Клиенты (вкладка) ──────────────────────────────────────────── */
.client-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-mid);
  margin-bottom: 8px;
}

.client-row__info {
  flex: 1;
  min-width: 0;
}

.client-row__info strong {
  display: block;
  font-size: 14px;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.client-row__meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.client-row__sto {
  font-size: 12px;
  color: var(--ink-soft);
}

.client-row__sto--none {
  color: var(--muted);
}

.client-row__clientstos {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  line-height: 1.35;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.client-row__date {
  flex-shrink: 0;
  font-size: 11px;
  color: var(--muted);
  text-align: right;
  white-space: nowrap;
}

/* ── Пагинация ──────────────────────────────────────────────────── */
.pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
  justify-content: center;
}

.pagination__btn {
  min-width: 64px;
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: background 140ms ease, color 140ms ease, border-color 140ms ease;
}

.pagination__btn:hover {
  border-color: var(--line-hi);
  background: var(--surface-hi);
}

.pagination__btn.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}

.sto-member {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ── Фото СТО ───────────────────────────────────────────────────── */
.sto-cover-photo {
  display: block;
  width: 300px;
  height: 300px;
  max-width: 100%;
  border-radius: 10px;
  object-fit: cover;
  margin: 0 auto 10px;
}

.sto-photo-upload {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 13px;
  color: var(--brand);
  padding: 6px 12px;
  border: 1px dashed var(--brand);
  border-radius: 8px;
  margin-bottom: 4px;
  transition: background 140ms;
}
.sto-photo-upload:hover { background: rgba(33,161,150,.08); }

/* ── Управление участниками ─────────────────────────────────────── */
.sto-member {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  flex-wrap: wrap;
}

.sto-member__actions {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.sto-role-select {
  height: 32px;
  padding: 0 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg-mid);
  color: var(--ink);
  font-size: 12px;
  cursor: pointer;
  max-width: 130px;
}

.sto-kick-btn {
  width: 30px;
  height: 30px;
  border: 1px solid var(--err, #e55);
  border-radius: 6px;
  background: transparent;
  color: var(--err, #e55);
  cursor: pointer;
  font-size: 14px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  transition: background 140ms;
}
.sto-kick-btn:hover { background: rgba(220,50,50,.1); }


/* ── Контакты СТО ───────────────────────────────────────────────── */
.sto-contacts-view {
  margin: 8px 0 4px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sto-contacts-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.sto-contact-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 13px;
  color: var(--ink);
  background: var(--surface);
  text-decoration: none;
  transition: background 140ms;
}
.sto-contact-item:hover { background: var(--bg-mid); }
.sto-contact-item--link { color: var(--brand); }

.sto-contacts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 8px;
}

.sto-edit-contacts-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ── Кликабельная карточка в списке ─────────────────────────────── */
.sto-card--clickable {
  cursor: pointer;
  transition: border-color 140ms, transform 120ms;
}
.sto-card--clickable:active { transform: scale(0.98); }
.sto-card--clickable:hover  { border-color: var(--brand); }

.sto-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 8px;
}

.sto-tag {
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink-soft);
}
.sto-tag--more { color: var(--muted); border-style: dashed; }
.sto-tag--lg   { font-size: 13px; padding: 4px 12px; }

/* ── Модалка СТО ─────────────────────────────────────────────────── */
.sto-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0,0,0,0.65);
  display: flex;
  align-items: flex-end;
  padding: 0;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.sto-modal-overlay[hidden] { display: none; }

.sto-modal {
  position: relative;
  width: 100%;
  max-height: 90dvh;
  background: var(--bg-mid);
  border-radius: 20px 20px 0 0;
  overflow-y: auto;
  padding: 20px 16px 32px;
  animation: slideUp 220ms cubic-bezier(.22,1,.36,1);
}

@keyframes slideUp {
  from { transform: translateY(60px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.sto-modal__close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  font-size: 14px;
  display: grid;
  place-items: center;
}

.sto-modal__photo {
  display: block;
  width: 300px;
  height: 300px;
  max-width: 100%;
  border-radius: 12px;
  object-fit: cover;
  margin: 0 auto 14px;
}

.sto-modal__header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.sto-modal__title {
  font-size: 20px;
  font-weight: 900;
  color: var(--ink);
  margin: 0;
}

.sto-modal__city {
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 8px;
}

.sto-modal__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  font-size: 13px;
  color: var(--ink-soft);
  margin-bottom: 10px;
}

.sto-modal__contacts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.sto-modal__desc {
  font-size: 14px;
  color: var(--ink-soft);
  margin: 0 0 14px;
  line-height: 1.5;
}

.sto-modal__services { margin-bottom: 14px; }

.sto-modal__section-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  margin: 0 0 8px;
}

.sto-modal__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.sto-modal__footer {
  margin-top: 16px;
}

/* ------------------------------------------------------------------ */
/*  STO switcher — переключатель между несколькими СТО на «Участниках» */
/* ------------------------------------------------------------------ */

.sto-switcher {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-mid);
  overflow-x: auto;
  scrollbar-width: none;
}
.sto-switcher::-webkit-scrollbar { display: none; }

.sto-switcher__item {
  flex: 0 0 auto;
  min-height: 38px;
  border: 0;
  border-radius: 8px;
  padding: 0 14px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 700;
  white-space: nowrap;
  transition: background 140ms ease, color 140ms ease;
}

.sto-switcher__item.is-active {
  background: var(--brand-deep);
  color: #fff;
}

