/* /web2 Drivers tab — transcribed from ui/publicusers/PublicUsersScreen.kt,
   PublicUserRacesScreen.kt, PublicUserCategoryRacesScreen.kt,
   ui/profile/TrackBreakdownScreen.kt and ui/profile/SuspensionsScreen.kt. */

.drv-page { display: block; }

/* rank-tier accent (Components.kt rankTierColor: first letter b/s/g/p) */
.drv-acc-b { --acc: var(--rank-bronze); }
.drv-acc-s { --acc: var(--rank-silver); }
.drv-acc-g { --acc: var(--rank-gold); }
.drv-acc-p { --acc: var(--rank-platinum); }
.drv-acc-x { --acc: #8A93A6; }

/* ------------------------------------------------- DriversTopBar */
.drv-topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 2px; margin-bottom: 16px;
}
.drv-topbar-titles { display: grid; gap: 2px; }
.drv-topbar-titles h1 { margin: 0; }
.drv-search-btn {
  width: 44px; height: 44px; flex: none; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface1); border: 1px solid var(--outline);
  color: var(--text-high);
}

.drv-count { margin-bottom: 12px; }

/* ------------------------------------------------- DistributionSection */
.drv-dist { display: grid; gap: 10px; margin-bottom: 18px; }
@media (min-width: 820px) { .drv-dist { grid-template-columns: 1fr 1fr; gap: 12px; } }
.drv-dist-card {
  border-radius: 16px; background: var(--surface1); border: 1px solid var(--outline);
  padding: 14px; display: grid; gap: 12px;
}
.drv-dist-title { margin: 0; font-weight: 900; }
.drv-dist-row { display: flex; align-items: center; gap: 10px; }
.drv-dist-rank { width: 82px; flex: none; color: var(--acc); }
.drv-dist-bar {
  position: relative; flex: 1; height: 28px; border-radius: 7px;
  background: var(--surface3); overflow: hidden;
}
.drv-dist-fill { position: absolute; inset: 0 auto 0 0; border-radius: 7px; background: var(--acc); }
.drv-dist-val {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  color: var(--text-high); font-weight: 900;
}

.drv-section-header { margin: 0 0 8px; }

/* ------------------------------------------------- PublicUserCard */
.drv-user-list { display: grid; gap: 10px; }
.drv-user-card {
  display: flex; align-items: center; gap: 12px;
  border-radius: 14px; background: var(--surface1); padding: 12px;
  border: 1px solid color-mix(in srgb, var(--acc) 35%, transparent);
}
.drv-user-card.is-external { border-color: color-mix(in srgb, var(--amber) 50%, transparent); }
.drv-user-index {
  width: 34px; height: 34px; flex: none; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--acc) 16%, transparent);
  color: var(--acc); font-weight: 900;
}
.drv-user-main { flex: 1; min-width: 0; display: grid; gap: 6px; }
.drv-user-name-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.drv-flag {
  height: 16px; width: 21.3px; flex: none; border-radius: 4px;
  border: 1px solid var(--outline); object-fit: cover;
}
.drv-user-name {
  color: var(--text-high); font-weight: 700; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.drv-user-badge { height: 24px; width: auto; flex: none; }
.drv-user-team { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drv-badges { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.drv-user-chevron { flex: none; color: var(--text-low); }

/* two-tone official DR/SR badge (Components.kt RankBadge) */
.drv-rank-badge {
  display: inline-flex; align-items: center; overflow: hidden;
  border-radius: 3.5px; border: 1.5px solid var(--acc);
  font-size: 11px; line-height: 16px; font-weight: 900;
}
.drv-rank-badge .lab { background: #F3F4F8; color: var(--acc); padding: 3px 6px; }
.drv-rank-badge .val { background: var(--acc); color: #F3F4F8; padding: 3px 6px; white-space: nowrap; }

/* "External data" source pill (PublicUsersScreen.kt SourcePill) */
.drv-pill-ext {
  display: inline-flex; align-items: center; border-radius: 6px; padding: 3px 7px;
  background: color-mix(in srgb, var(--amber) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--amber) 42%, transparent);
  color: var(--amber); font-weight: 700; white-space: nowrap;
}

/* stat badges (PublicUsersScreen.kt StatBadge) */
.drv-stat {
  display: inline-flex; align-items: center; gap: 5px;
  border-radius: 6px; padding: 3px 7px;
  background: color-mix(in srgb, var(--c) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--c) 34%, transparent);
  font-size: 11px; line-height: 16px; white-space: nowrap;
}
.drv-stat .lab { color: var(--c); font-weight: 700; }
.drv-stat .val { color: var(--text-high); font-weight: 900; }
.drv-stat-races { --c: var(--text-med); }
.drv-stat-wins { --c: #E6C04A; }
.drv-stat-podiums { --c: var(--amber); }
.drv-stat-poles { --c: #6FE3F0; }
.drv-stat-flaps { --c: #C792EA; }

/* ------------------------------------------------- SearchSheet (SSR modal) */
.drv-sheet { display: none; }
.drv-sheet:target, .drv-sheet.is-open { display: block; }
.drv-sheet-scrim { position: fixed; inset: 0; z-index: 90; background: rgba(0, 0, 0, 0.55); }
.drv-sheet-panel {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); z-index: 91;
  width: 100%; max-width: 760px; max-height: 86dvh; overflow-y: auto;
  background: var(--surface1); border-radius: 28px 28px 0 0;
  padding: 8px 16px calc(24px + env(safe-area-inset-bottom));
}
.drv-sheet-handle {
  width: 32px; height: 4px; border-radius: 2px; background: var(--outline);
  margin: 8px auto 16px;
}
.drv-sheet-title { margin: 0 0 12px; font-weight: 900; }
.drv-search-form {
  display: flex; align-items: center; gap: 10px; margin-bottom: 12px;
  background: var(--surface2); border: 1px solid var(--outline); border-radius: 4px;
  padding: 0 14px; height: 56px;
}
.drv-search-form:focus-within { border-color: var(--amber); }
.drv-search-form-ic { flex: none; color: var(--text-med); }
.drv-search-form input {
  flex: 1; min-width: 0; height: 100%; background: transparent; border: none; outline: none;
  color: var(--text-high); caret-color: var(--amber);
  font-family: inherit; font-size: 16px;
}
.drv-search-form input::placeholder { color: var(--text-low); }
.drv-sheet-empty {
  height: 180px; display: flex; align-items: center; justify-content: center;
  text-align: center;
}
.drv-results-count { margin-bottom: 10px; }

/* ------------------------------------------------- back rows / sub-screens */
.drv-backrow { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.drv-backrow-title { margin: 0; min-width: 0; font-weight: 700; }
.drv-backrow-title h1 { margin: 0; font-weight: 700; }
.drv-iconbtn {
  width: 44px; height: 44px; flex: none; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; color: var(--text-high);
}
.drv-circle-btn {
  width: 38px; height: 38px; flex: none; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(11, 12, 15, 0.55); border: 1px solid var(--outline);
  color: var(--text-high);
}
.drv-back-icon { width: 22px; height: 22px; transform: rotate(180deg); }

/* external data notice (PublicUsersScreen.kt ExternalDataNotice) */
.drv-ext-notice {
  border-radius: 12px; padding: 10px 12px; margin-bottom: 12px;
  background: color-mix(in srgb, var(--amber) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--amber) 35%, transparent);
  display: grid; gap: 3px;
}
.drv-ext-notice-title { color: var(--amber); font-weight: 900; }

/* races lists */
.drv-race-list { display: grid; gap: 8px; }
.drv-race-list > * { min-width: 0; }
.drv-list-empty { padding: 24px 16px; text-align: center; }
.drv-error-text { color: var(--amber); }

/* pager (SSR stand-in for the app's infinite scroll) */
.drv-pager { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.drv-pager a {
  flex: 1; text-align: center; padding: 12px 0; border-radius: 12px;
  background: var(--surface1); border: 1px solid var(--outline);
  color: var(--amber);
}
.drv-pager-page { flex: none; }

/* ------------------------------------------------- EmptyState (Components.kt) */
.drv-empty {
  padding: 48px 32px; display: flex; flex-direction: column;
  align-items: center; text-align: center; gap: 8px;
}
.drv-empty-ic {
  width: 84px; height: 84px; border-radius: 50%; margin-bottom: 14px;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface2);
  border: 1px solid color-mix(in srgb, var(--acc, var(--amber)) 30%, transparent);
  color: var(--acc, var(--amber));
  box-shadow: 0 0 0 16px color-mix(in srgb, var(--acc, var(--amber)) 6%, transparent);
}
.drv-empty-ic .icon { width: 38px; height: 38px; }
.drv-empty-error { --acc: var(--class-hyper); }
.drv-empty-title { font-weight: 700; }

/* ------------------------------------------------- TrackBreakdownView */
.drv-track-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
@media (max-width: 379px) { .drv-track-grid { grid-template-columns: 1fr; } }
.drv-track-card {
  display: block; overflow: hidden; border-radius: 14px;
  background: var(--surface1); border: 1px solid var(--outline);
}
.drv-track-preview { position: relative; display: block; height: 96px; background: var(--surface2); }
.drv-tp-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.drv-tp-shade { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.35); }
.drv-tp-map { position: absolute; inset: 10px; width: calc(100% - 20px); height: calc(100% - 20px); object-fit: contain; }
.drv-tp-logo { position: absolute; top: 8px; left: 8px; height: 24px; width: auto; max-width: 45%; object-fit: contain; }
.drv-tp-flag { position: absolute; top: 8px; right: 8px; width: 22px; height: 22px; border-radius: 50%; }
.drv-track-body { display: grid; gap: 8px; padding: 12px; }
.drv-track-name {
  color: var(--text-high); font-weight: 700; min-height: 40px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.drv-track-dist { color: var(--dist-accent); font-weight: 700; }
.drv-track-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.drv-meta-chip {
  display: inline-flex; align-items: center; border-radius: 7px; padding: 4px 9px;
  background: var(--surface2); color: var(--text-med); white-space: nowrap;
}

/* ------------------------------------------------- SuspensionsScreen */
.drv-susp-list { display: grid; gap: 12px; }
.drv-susp-card {
  --acc: var(--flag-gray);
  border-radius: 14px; background: var(--surface1); padding: 16px;
  border: 1px solid color-mix(in srgb, var(--acc) 40%, transparent);
  display: grid; gap: 10px;
}
.drv-susp-card.is-active { --acc: var(--class-hyper); }
.drv-susp-head { display: flex; align-items: center; gap: 8px; }
.drv-susp-status {
  display: inline-flex; align-items: center; border-radius: 6px; padding: 3px 8px;
  background: var(--acc); color: #fff; font-weight: 700; white-space: nowrap;
}
.drv-susp-perm { color: var(--class-hyper); }
.drv-date-rows { display: grid; gap: 4px; }
.drv-date-row { display: flex; align-items: center; gap: 8px; }
.drv-date-label { color: var(--text-low); font-weight: 700; }
.drv-date-chip { background: var(--surface3); border-radius: 4px; padding: 0 6px; }
.drv-susp-empty {
  min-height: 55vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center; gap: 8px;
}
.drv-susp-ok {
  font-size: 36px; line-height: 44px; font-weight: 900; color: var(--skill-beginner);
}
.drv-susp-empty-title { font-weight: 700; }
