:root {
  /* Sokol Time Attack visual theme — SBK Mini App layout, Time Attack colors */
  --bg: #050505;
  --card: rgba(14, 14, 16, 0.94);
  --card-2: rgba(22, 22, 25, 0.92);
  --line: rgba(255, 255, 255, 0.14);
  --line-strong: rgba(229, 9, 20, 0.58);
  --text: #ffffff;
  --muted: #c8c8c8;
  --muted-2: #8b8b8b;
  --cyan: #ff1a1a;   /* legacy accent alias from SBK theme */
  --blue: #e50914;   /* legacy accent alias from SBK theme */
  --accent: #e50914;
  --accent-2: #ff1a1a;
  --green: #49da8a;
  --red: #ff5c6b;
  --yellow: #ffd76a;
  --shadow: 0 16px 44px rgba(0,0,0,.42);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }

body {
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 100% 0%, rgba(229,9,20,.22), transparent 30%),
    radial-gradient(circle at 0% 100%, rgba(255,255,255,.06), transparent 32%),
    linear-gradient(180deg, #070707 0%, #111113 48%, #050505 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(120deg, transparent 0 58%, rgba(229,9,20,.04) 58% 60%, transparent 60%),
    repeating-linear-gradient(135deg, rgba(255,255,255,.02) 0 1px, transparent 1px 34px);
}

.app-shell {
  width: min(560px, 100%);
  margin: 0 auto;
  padding: 12px 14px 90px;
  position: relative;
}

.topbar {
  min-height: 54px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  margin-bottom: 10px;
}

.brand { display: flex; justify-content: center; align-items: center; }
.brand-logo { max-width: 220px; max-height: 64px; filter: drop-shadow(0 0 18px rgba(229,9,20,.22)); }
.brand-fallback { display: none; font-size: 24px; font-weight: 900; letter-spacing: .04em; }

.hero {
  position: relative;
  overflow: hidden;
  border-radius: 28px;
  border: 1px solid rgba(229,9,20,.22);
  background:
    linear-gradient(180deg, rgba(4,15,32,.35), rgba(4,15,32,.70)),
    url("./assets/hero-timeattack-bg-wide.jpg") center/cover no-repeat,
    linear-gradient(135deg, #151517, #050505);
  box-shadow: var(--shadow);
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(5,5,5,.10) 0%, rgba(5,5,5,.55) 75%, rgba(5,5,5,.8) 100%),
    radial-gradient(circle at 80% 25%, rgba(229,9,20,.20), transparent 32%);
}
.hero::after {
  content: "";
  position: absolute;
  right: -42px;
  bottom: -46px;
  width: 250px;
  height: 150px;
  background: url("./assets/track-map-white.png") center/contain no-repeat;
  opacity: .20;
  filter: drop-shadow(0 0 18px rgba(229,9,20,.18));
}
.hero-inner { position: relative; z-index: 2; padding: 28px 26px 30px; }
.hero-chip {
  display: inline-block;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(229,9,20,.35);
  background: rgba(20,20,22,.72);
  color: var(--cyan);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .09em;
  font-style: italic;
}
h1 {
  margin: 18px 0 10px;
  font-size: clamp(38px, 10vw, 60px);
  line-height: .98;
  font-weight: 900;
  letter-spacing: -.045em;
  font-style: italic;
  text-shadow: 0 8px 24px rgba(0,0,0,.35);
}
.hero-accent {
  background: linear-gradient(90deg, #ffffff 0%, #ffe3e3 32%, #ff1a1a 70%, #e50914 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
#heroSubtitle {
  max-width: 380px;
  margin: 0;
  color: #eeeeee;
  font-size: 18px;
  line-height: 1.35;
}

.toast {
  /* Плашка "прилипает" к верху экрана и видна при любой прокрутке.
     Раньше она была обычным элементом вверху страницы — оператор, пролистав
     вниз к кнопкам отметок, её не видел. Теперь position:fixed держит её
     на экране всегда (надёжнее, чем программный скролл в Telegram WebView). */
  position: fixed;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  width: min(540px, calc(100% - 24px));
  margin: 0;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(255, 215, 106, .42);
  background: rgba(20, 18, 6, .96);
  color: #fff4c5;
  box-shadow: 0 10px 32px rgba(0,0,0,.5);
}
.toast.ok { border-color: rgba(73,218,138,.45); background: rgba(8,30,18,.96); color: #d8ffe8; }
.toast.bad { border-color: rgba(255,92,107,.45); background: rgba(34,8,12,.96); color: #ffd8dd; }
.toast.hidden { display: none; }

.screen { display: none; animation: fadeUp .18s ease-out; }
.screen.active { display: block; }
@keyframes fadeUp { from {opacity:0; transform: translateY(6px);} to {opacity:1; transform: translateY(0);} }

.tile-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 16px; }
.tile {
  position: relative;
  min-height: 150px;
  padding: 18px 16px;
  border-radius: 24px;
  border: 1px solid var(--line);
  background:
    linear-gradient(160deg, rgba(22,22,25,.92), rgba(14,14,16,.96)),
    radial-gradient(circle at 0 0, rgba(255,26,26,.08), transparent 38%);
  box-shadow: var(--shadow), inset 0 0 18px rgba(229,9,20,.06);
  cursor: pointer;
}
.tile::after { content: "›"; position: absolute; right: 16px; top: 50%; transform: translateY(-50%); color: var(--cyan); font-size: 38px; line-height: 1; }
.tile-icon {
  width: 52px; height: 52px;
  display: grid; place-items: center;
  border-radius: 18px;
  background: rgba(229,9,20,.20);
  border: 1px solid rgba(229,9,20,.25);
  font-size: 24px;
  margin-bottom: 14px;
}
.tile-title { font-size: 17px; font-weight: 800; line-height: 1.12; padding-right: 20px; }
.tile-sub { margin-top: 8px; color: var(--muted); font-size: 14px; line-height: 1.25; padding-right: 20px; }

.card {
  margin-top: 16px;
  padding: 18px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background:
    linear-gradient(160deg, rgba(22,22,25,.92), rgba(14,14,16,.96)),
    radial-gradient(circle at 0 0, rgba(255,26,26,.06), transparent 38%);
  box-shadow: var(--shadow);
}
h2 { margin: 0 0 14px; font-size: 24px; line-height: 1.1; }
h3 { margin: 0 0 8px; font-size: 18px; line-height: 1.2; }
p { color: var(--muted); line-height: 1.45; }

label { display: block; margin: 13px 0 6px; color: var(--muted); font-size: 13px; }
input, select, textarea {
  width: 100%;
  padding: 15px 14px;
  border-radius: 15px;
  border: 1px solid rgba(229,9,20,.22);
  background: rgba(255,255,255,.06);
  color: white;
  font-size: 16px;
  outline: none;
}
textarea { resize: vertical; min-height: 90px; font-family: inherit; line-height: 1.35; }
select option { color: #f2f2f2; background: #151518; }

button.action {
  width: 100%;
  margin-top: 12px;
  padding: 15px 14px;
  border: 1px solid rgba(229,9,20,.30);
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(229,9,20,.55), rgba(255,26,26,.16));
  color: white;
  font-size: 15px;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
}
button.action:active, .tile:active, .floating-back:active { transform: scale(.99); }
button.action.danger { border-color: rgba(255,92,107,.45); background: rgba(255,92,107,.12); }
button.action.ok { border-color: rgba(73,218,138,.45); background: rgba(73,218,138,.12); }
button.action.small { padding: 11px 12px; font-size: 13px; }

.item {
  margin-top: 12px;
  padding: 15px;
  border-radius: 18px;
  border: 1px solid rgba(229,9,20,.18);
  background: rgba(255,255,255,.035);
}
.item b { display: block; font-size: 16px; margin-bottom: 4px; }
.meta { color: var(--muted); font-size: 14px; line-height: 1.4; }
.status-ok { color: var(--green); font-weight: 800; }
.status-bad { color: var(--red); font-weight: 800; }
.status-warn { color: var(--yellow); font-weight: 800; }
.empty {
  padding: 20px;
  border-radius: 18px;
  border: 1px dashed rgba(229,9,20,.22);
  color: var(--muted);
  text-align: center;
}
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.controls { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }

.floating-back {
  position: fixed;
  right: max(16px, calc((100vw - 560px) / 2 + 16px));
  bottom: 18px;
  z-index: 20;
  width: auto;
  min-width: 112px;
  padding: 14px 18px;
  border-radius: 999px;
  border: 1px solid rgba(229,9,20,.52);
  background: rgba(0, 34, 78, .92);
  color: white;
  font-size: 15px;
  font-weight: 900;
  box-shadow: 0 10px 35px rgba(0,0,0,.42), 0 0 26px rgba(229,9,20,.18);
}
.floating-back.hidden { display: none; }

.footer { margin-top: 20px; text-align: center; color: var(--muted-2); font-size: 13px; }

@media (max-width: 430px) {
  .brand-logo { max-width: 170px; }
  .hero-inner { padding: 24px 20px 26px; }
  .tile-grid { gap: 12px; }
  .tile { min-height: 138px; padding: 16px 14px; }
  .tile-title { font-size: 15px; }
  .tile-sub { font-size: 13px; }
  .controls { grid-template-columns: 1fr; }
}


.staff-row {
  cursor: pointer;
}
.staff-row:active {
  transform: scale(.99);
}

.class-help{margin:12px 0;padding:12px;border:1px solid rgba(229,9,20,.25);border-radius:14px;background:rgba(229,9,20,.06)}
.class-help summary{cursor:pointer;font-weight:800;color:#ffb3b3}.class-desc{margin:12px 0;padding:10px;border-radius:12px;background:rgba(255,255,255,.04)}.class-desc span{color:#9f9f9f;font-size:13px}.class-desc p{margin:6px 0 0;color:#eeeeee;font-size:13px;line-height:1.35}input[type="file"]{width:100%;padding:14px;border-radius:14px;border:1px solid rgba(229,9,20,.25);background:rgba(255,255,255,.06);color:#fff}


/* v43 profile confirmation UX */
.profile-view-card h2{margin-bottom:14px}
.profile-status{
  margin:12px 0 18px;
  padding:14px 16px;
  border-radius:16px;
  border:1px solid rgba(229,9,20,.28);
  background:rgba(229,9,20,.07);
}
.profile-status b{display:block;font-size:17px;margin-bottom:4px;color:#fff}
.profile-status p{margin:0;color:#d0d0d0;line-height:1.35;font-size:14px}
.profile-status.ok{border-color:rgba(73,218,138,.45);background:rgba(73,218,138,.10)}
.profile-status.ok b{color:#d8ffe8}
.profile-status.wait{border-color:rgba(255,196,87,.45);background:rgba(255,196,87,.09)}
.profile-status.wait b{color:#ffe8b8}
.profile-status.bad{border-color:rgba(255,92,107,.45);background:rgba(255,92,107,.09)}
.profile-status.bad b{color:#ffd8dd}
.profile-summary{display:grid;gap:8px;margin:18px 0 20px}
.profile-row{
  display:grid;
  grid-template-columns: 42% 1fr;
  gap:10px;
  align-items:start;
  padding:11px 12px;
  border-radius:13px;
  background:rgba(255,255,255,.045);
  border:1px solid rgba(255,255,255,.055);
}
.profile-row span{color:#9d9d9d;font-size:13px;line-height:1.25}
.profile-row b{color:#fff;font-size:15px;line-height:1.25;font-weight:800}
.action.secondary{background:rgba(255,255,255,.06);border:1px solid rgba(229,9,20,.22)}
@media(max-width:560px){.profile-row{grid-template-columns:1fr}.profile-row span{font-size:12px}.profile-row b{font-size:15px}}

.moto-photo,.participant-photo{
  width:100%;
  max-height:260px;
  object-fit:cover;
  border-radius:18px;
  border:1px solid rgba(229,9,20,.35);
  margin:10px 0 14px;
  display:block;
}
.participant-thumb{
  width:72px;
  height:54px;
  object-fit:cover;
  border-radius:12px;
  border:1px solid rgba(229,9,20,.35);
  float:right;
  margin-left:10px;
}
.participant-card{
  cursor:pointer;
}
.action.secondary{
  background:rgba(229,9,20,.10);
  border:1px solid rgba(229,9,20,.35);
}

.best-time-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  padding:12px 14px;
  margin:9px 0;
  border-radius:14px;
  background:rgba(18,18,20,.55);
  border:1px solid rgba(229,9,20,.25);
}
.best-time-row strong{
  white-space:nowrap;
  font-size:18px;
}

.consent-box{
  display:flex;
  align-items:flex-start;
  gap:10px;
  padding:14px;
  margin:14px 0;
  border-radius:16px;
  background:rgba(229,9,20,.08);
  border:1px solid rgba(229,9,20,.28);
  color:#f0f0f0;
  line-height:1.35;
}
.consent-box input{
  width:20px;
  height:20px;
  margin-top:2px;
  accent-color:#ff1a1a;
  flex:0 0 auto;
}
.cup-info-card .cup-info-block h3{margin-top:18px;}
.cup-contact-grid,.cup-classes-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(210px,1fr));
  gap:12px;
  margin:14px 0;
}
.cup-contact-card,.cup-classes-grid>div{
  padding:14px;
  border-radius:16px;
  background:rgba(18,18,20,.55);
  border:1px solid rgba(229,9,20,.25);
}
.cup-classes-grid span{display:block;color:#b5b5b5;margin-top:6px;}
.cup-steps{padding-left:22px;color:#f0f0f0;}

.branch-badge{
  display:inline-flex;
  align-items:center;
  width:fit-content;
  max-width:100%;
  margin:8px 0 12px;
  padding:10px 14px;
  border-radius:999px;
  border:1px solid rgba(255,26,26,.45);
  background:linear-gradient(135deg,rgba(229,9,20,.25),rgba(229,9,20,.12));
  color:#ffffff;
  font-weight:900;
  letter-spacing:.01em;
}

.clickable-card{
  cursor:pointer;
  transition:transform .12s ease, border-color .12s ease, background .12s ease;
}
.clickable-card:hover{
  transform:translateY(-1px);
  border-color:rgba(255,26,26,.65);
  background:rgba(28,28,31,.72);
}
.tap-hint{
  margin-top:8px;
  color:#ff3b3b !important;
  font-weight:800;
}
.admin-edit-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(210px,1fr));
  gap:12px;
  margin:14px 0;
}
.admin-rider-detail .status-line{
  margin:12px 0;
  font-weight:900;
}
.admin-moto-editor{
  margin-top:12px;
}
.mini-item{
  padding:12px;
}

/* Аватар профиля */
.profile-avatar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  padding: 20px;
  background: rgba(22,22,25,.92);
  border-radius: 16px;
  border: 1px solid rgba(229,9,20,.28);
}

.avatar-image {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--cyan);
  box-shadow: 0 4px 16px rgba(229,9,20,0.4);
}

.avatar-placeholder {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: rgba(14,14,16,.96);
  border: 2px dashed rgba(229,9,20,.35);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  opacity: 0.6;
}

.avatar-hint {
  font-size: 13px;
  color: var(--muted);
  margin: 0;
  text-align: center;
}

.avatar-badge {
  padding: 6px 12px;
  border-radius: 16px;
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 8px;
}

.avatar-badge.pending {
  background: rgba(255, 215, 106, 0.15);
  color: var(--yellow);
  border: 1px solid rgba(255, 215, 106, 0.4);
}

.avatar-badge.rejected {
  background: rgba(255, 92, 107, 0.15);
  color: var(--red);
  border: 1px solid rgba(255, 92, 107, 0.4);
}

/* Placeholder для фото мотоцикла */
.moto-photo-placeholder {
  width: 100%;
  height: 180px;
  background: rgba(14,14,16,.96);
  border: 2px dashed rgba(229,9,20,.25);
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 8px;
  opacity: 0.6;
  margin: 10px 0 14px;
}

.moto-photo-placeholder-icon {
  font-size: 48px;
}

.moto-photo-placeholder-text {
  font-size: 13px;
  color: var(--muted);
}

/* Best Lap аватары */
.bestlap-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.bestlap-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(229,9,20,.45);
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(229,9,20,0.25);
}

.bestlap-content {
  flex: 1;
  min-width: 0;
}

/* v76: единый аватар-кружок с логотипом SBK (заглушка, когда нет фото) */
.avatar-logo{
  display:flex;align-items:center;justify-content:center;
  background:radial-gradient(circle at 50% 40%, rgba(0,140,255,.30), rgba(14,14,16,.96));
  border:2px solid rgba(229,9,20,.45);
  overflow:hidden;
}
.avatar-logo img{
  width:64%;height:64%;object-fit:contain;
  filter:drop-shadow(0 0 6px rgba(229,9,20,.35));
}
/* размеры кружка наследуются от .avatar-image / .bestlap-avatar / .avatar-placeholder,
   но logo-вариант делаем сплошным кружком (не пунктир) */
.avatar-placeholder.avatar-logo{border-style:solid;opacity:1}
.bestlap-avatar.avatar-logo{padding:0}


/* --- Time Attack polish layer: same SBK component language, red/graphite branding --- */
body::before {
  background:
    linear-gradient(120deg, transparent 0 58%, rgba(229,9,20,.045) 58% 60%, transparent 60%),
    repeating-linear-gradient(135deg, rgba(255,255,255,.018) 0 1px, transparent 1px 34px);
}
.brand-logo { filter: drop-shadow(0 0 16px rgba(229,9,20,.28)); }
.brand-fallback { letter-spacing: -.02em; font-style: italic; text-transform: uppercase; }
.hero {
  border-color: rgba(229,9,20,.26);
  background:
    linear-gradient(180deg, rgba(10,10,10,.30), rgba(8,8,9,.72)),
    url("./assets/hero-timeattack-bg-wide.jpg") center/cover no-repeat,
    radial-gradient(circle at 75% 16%, rgba(229,9,20,.24), transparent 34%),
    linear-gradient(135deg, #171719, #050505);
}
.hero::before {
  background:
    linear-gradient(180deg, rgba(5,5,5,.08) 0%, rgba(5,5,5,.55) 75%, rgba(5,5,5,.86) 100%),
    radial-gradient(circle at 80% 25%, rgba(229,9,20,.22), transparent 32%),
    repeating-linear-gradient(90deg, rgba(255,255,255,.025) 0 1px, transparent 1px 48px);
}
.hero-chip,
.branch-badge {
  text-transform: uppercase;
  letter-spacing: .09em;
}
.tile,
.card {
  background:
    linear-gradient(160deg, rgba(24,24,27,.92), rgba(12,12,14,.96)),
    radial-gradient(circle at 0 0, rgba(229,9,20,.075), transparent 38%);
}
.tile-icon {
  background: rgba(229,9,20,.16);
  border-color: rgba(229,9,20,.28);
  color: var(--accent-2);
}
button.action {
  background: linear-gradient(135deg, rgba(229,9,20,.72), rgba(255,26,26,.18));
  border-color: rgba(229,9,20,.36);
}
button.action.secondary {
  background: rgba(255,255,255,.06);
  border-color: rgba(229,9,20,.28);
}
button.action.ok { background: rgba(73,218,138,.12); }
button.action.danger { background: rgba(255,92,107,.12); }
.item,
.best-time-row,
.cup-contact-card,
.cup-classes-grid>div {
  background: rgba(255,255,255,.04);
}
.best-time-row strong { color: var(--accent-2); }
.moto-photo,
.participant-photo,
.participant-thumb,
.bestlap-avatar {
  border-color: rgba(229,9,20,.34);
}
.avatar-logo {
  background: radial-gradient(circle at 50% 40%, rgba(229,9,20,.26), rgba(14,14,16,.96));
  border-color: rgba(229,9,20,.34);
}
.avatar-logo img { filter: drop-shadow(0 0 6px rgba(229,9,20,.42)); }


/* Time Attack site assets */
.avatar-logo img { object-fit: contain; padding: 5px; }
.brand-logo { object-fit: contain; }

/* Разделы: под-плитки Этапы / Track Day */
.subtiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.subtile {
  display: flex; align-items: center; gap: 8px; cursor: pointer;
  padding: 12px 14px; border-radius: 14px; font-weight: 700; font-size: 14px;
  background: rgba(255,255,255,.04); border: 1px solid var(--line);
  transition: transform .08s ease, border-color .15s ease, background .15s ease;
}
.subtile:active { transform: scale(.98); }
.subtile.active { border-color: var(--accent); background: rgba(229,9,20,.14); }
.subtile-ic { font-size: 18px; line-height: 1; }

/* Список участников */
.part-box { margin-top: 12px; }
.part-head { margin-bottom: 8px; }
.part-class {
  margin: 16px 0 2px; padding: 8px 4px 6px;
  border-bottom: 2px solid var(--accent-2);
  font-size: 15px; letter-spacing: .3px;
}
.part-class:first-of-type { margin-top: 8px; }
.part-row {
  display: flex; align-items: center; gap: 12px; padding: 10px 4px;
  border-bottom: 1px solid var(--line);
}
.part-row:last-child { border-bottom: 0; }
.part-num {
  min-width: 42px; text-align: center; font-weight: 800; color: var(--accent-2);
  background: rgba(229,9,20,.12); border-radius: 10px; padding: 6px 4px; font-size: 14px;
}
.part-name { display: flex; flex-direction: column; gap: 2px; }
.info-list { display: flex; flex-direction: column; gap: 8px; margin: 6px 0 4px; line-height: 1.35; }
.info-list b { color: var(--accent-2); margin-right: 4px; }
.doc-list { margin: 8px 0 2px; padding-left: 20px; display: flex; flex-direction: column; gap: 7px; line-height: 1.35; }
.doc-list li { list-style: disc; }
.doc-list li::marker { color: var(--accent-2); }
.warn-card { border-color: var(--line-strong); background: rgba(229,9,20,.07); }
.contact-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.contact-row:last-child { border-bottom: 0; }
.tel-link { color: var(--accent-2); font-weight: 700; text-decoration: none; white-space: nowrap; }
.doc-card { background: rgba(255,255,255,.04); border: 1px solid var(--line); border-radius: 14px; padding: 14px; margin-bottom: 12px; }
.doc-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-weight: 700; }
.doc-card input[type="file"] { margin: 10px 0; font-size: 14px; }
.doc-card .action.small { margin-top: 2px; }
/* Фото: аватар и авто */
.avatar-wrap { width: 120px; height: 120px; border-radius: 16px; overflow: hidden; border: 1px solid var(--line); background: rgba(255,255,255,.04); display: flex; align-items: center; justify-content: center; margin: 4px 0 10px; }
.avatar-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar-empty { color: var(--muted); font-size: 13px; }
.car-photos { display: flex; flex-wrap: wrap; gap: 10px; margin: 8px 0; }
.car-photo { width: 130px; }
.car-photo img { width: 130px; height: 90px; object-fit: cover; border-radius: 12px; border: 1px solid var(--line); background: rgba(255,255,255,.04); display: block; }
.car-photo span { display: block; font-size: 12px; margin: 3px 0; }
.moder-img { width: 100%; max-width: 320px; border-radius: 12px; border: 1px solid var(--line); margin: 8px 0; display: block; background: rgba(255,255,255,.04); }
/* Карточка пилота (оверлей) */
.part-row { position: relative; }
.part-arrow { margin-left: auto; color: var(--accent-2); font-size: 22px; line-height: 1; }
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,.82); backdrop-filter: blur(2px); z-index: 50; overflow-y: auto; padding: 18px 14px 40px; }
.overlay.hidden { display: none; }
.overlay-inner { max-width: 560px; margin: 0 auto; }
.overlay-close { position: sticky; top: 0; float: right; background: rgba(255,255,255,.08); color: #fff; border: 1px solid var(--line); width: 38px; height: 38px; border-radius: 50%; font-size: 18px; cursor: pointer; }
.pc-head { text-align: center; }
.pc-avatar { width: 140px; height: 140px; margin: 4px auto 12px; border-radius: 18px; overflow: hidden; border: 1px solid var(--line-strong); background: rgba(255,255,255,.04); display: flex; align-items: center; justify-content: center; }
.pc-car { padding: 10px 0; border-bottom: 1px solid var(--line); }
.pc-car:last-child { border-bottom: 0; }
.pc-car-photos { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.pc-car-img { width: 100%; max-width: 240px; height: 150px; object-fit: cover; border-radius: 12px; border: 1px solid var(--line); background: rgba(255,255,255,.04); }

/* ---------- Браузерный вход (PWA этап 2) ---------- */
.authgate{ position:fixed; inset:0; z-index:1000; background:var(--bg,#050505);
  display:flex; align-items:center; justify-content:center; padding:24px; overflow:auto; }
/* КРИТИЧНО: без этого правила гейт (непрозрачная плёнка на весь экран) никогда
   не скрывается — в Telegram это давало вечный чёрный экран, в браузере «выкидывало»
   на экран входа после успешного логина. !important — чтобы не проиграть по
   порядку правил ещё раз. */
.authgate.hidden{ display:none !important; }
.authbox{ width:100%; max-width:340px; text-align:center; }
.authbox .auth-logo{ width:180px; max-width:70%; height:auto; margin:0 auto 22px; display:block; }
.authbox h2{ margin:0 0 8px; }
.authbox .gbtn-wrap{ display:flex; justify-content:center; margin:22px 0 4px; min-height:44px; }
.authbar{ display:flex; gap:8px; justify-content:center; flex-wrap:wrap;
  padding:8px 12px; margin:0; }
.authbar.hidden{ display:none; }

/* Установка приложения на экране входа */
.auth-install{ margin-top:22px; }
.auth-divider{ display:flex; align-items:center; gap:10px; color:var(--muted,#8a8a8a);
  font-size:12px; text-transform:uppercase; letter-spacing:.08em; margin:6px 0 14px; }
.auth-divider::before, .auth-divider::after{ content:""; flex:1; height:1px; background:var(--line,#26262b); }
.linklike{ background:none; border:0; color:var(--accent,#e5091e); font-size:13px;
  cursor:pointer; padding:10px 0 2px; text-decoration:underline; }
.install-help{ text-align:left; margin-top:10px; }
.install-help.hidden{ display:none; }
.help-block{ background:rgba(255,255,255,.04); border:1px solid var(--line,#26262b);
  border-radius:12px; padding:12px 14px; margin:8px 0; font-size:13px; line-height:1.45; color:#cfcfcf; }
.auth-input{ width:100%; padding:12px 14px; border-radius:12px; margin:8px 0;
  background:rgba(255,255,255,.05); border:1px solid var(--line,#26262b);
  color:#fff; font-size:15px; box-sizing:border-box; }
