:root {
  --red: #B0E0E6;
  --red2: #B0E0E6;
  --ui-scale: 1;
}

body {
  background: radial-gradient(circle at 72% -20%, #24464b66, transparent 38%), var(--bg);
}

.brand-mark {
  color: #071013;
  box-shadow: 10px 0 0 #28484c;
}

.nav-item.active {
  background: linear-gradient(90deg, #17272a, #15191d);
}

.topbar {
  justify-content: flex-end;
  min-height: 48px;
}

.header-actions > select,
.header-actions > .primary {
  height: 44px;
  font-size: .74rem;
  font-weight: 700;
  line-height: 1;
}

.header-actions > select { padding: 0 34px 0 12px; }
#crew-filter { min-width: 190px; }
#app-scale { min-width: 150px; }

.header-actions > .primary {
  min-width: 142px;
  padding: 0 14px;
  white-space: nowrap;
}

@media (min-width: 751px) {
  .app-shell { min-height: calc(100vh / var(--ui-scale)); }
  .sidebar { height: calc(100vh / var(--ui-scale)); min-height: calc(100vh / var(--ui-scale)); }
}

.primary {
  color: #071013;
  box-shadow: 0 8px 22px #b0e0e62e;
}

.primary:hover {
  background: #c7f4f8;
}

.metric.feature {
  background: linear-gradient(125deg, #142326, #12161b);
}

.speed-ring {
  border-color: #243c40;
  border-top-color: var(--red);
}

.activity:first-child .place {
  color: #071013;
}

.bar-fill {
  background: linear-gradient(90deg, var(--red), #d2f5f8);
}

.entity-card .card-top > div {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 7px;
}

.entity-card .card-top small {
  display: block;
  margin-top: 0;
}

.tag {
  border-color: #42666b;
}

.choice-field {
  margin: 0;
  padding: 0;
  border: 0;
}

.choice-field legend {
  margin-bottom: 8px;
  color: #8f99a2;
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .1em;
}

.choice-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.choice {
  position: relative;
  display: block !important;
  cursor: pointer;
}

.choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.choice span {
  display: flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  border: 1px solid #303840;
  border-radius: 3px;
  color: #aab3ba;
  background: #0c0f12;
  font-size: .78rem;
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0;
  transition: .16s ease;
}

.choice input:checked + span {
  border-color: var(--red);
  color: #071013;
  background: var(--red);
  box-shadow: 0 0 0 1px #b0e0e633;
}

.choice input:focus-visible + span {
  outline: 2px solid var(--red);
  outline-offset: 2px;
}

.choice-field > small {
  display: block;
  margin-top: 7px;
  color: #68727c;
  font-size: .68rem;
}

.distance-row {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 8px;
}

.track-form-actions,
.crew-form-actions,
.card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.track-form-actions .primary {
  flex: 1;
}

.crew-form-actions .primary {
  flex: 1;
}

.entity-form-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.entity-form-actions .primary {
  flex: 1;
}

.edit-button {
  border: 1px solid #354148;
  border-radius: 3px;
  padding: 6px 10px;
  color: var(--red);
  background: transparent;
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  cursor: pointer;
}

.edit-button:hover {
  border-color: var(--red);
  background: #b0e0e610;
}

#race-type-display[readonly] {
  color: var(--red);
  background: #12191d;
  cursor: not-allowed;
}

.crew-card.expanded {
  grid-column: 1 / -1;
}

.racer-card.expanded { grid-column: 1 / -1; }
.racer-car-panel { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.racer-car-head { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin-bottom: 14px; }
.racer-car-head h4 { margin: 0; font: 700 1.35rem var(--display); text-transform: uppercase; }
.racer-car-head label { display: grid; min-width: min(320px, 100%); gap: 6px; color: #8f99a2; font-size: .68rem; letter-spacing: .09em; text-transform: uppercase; }
.racer-car-head select { padding: 9px 11px; }
.racer-car-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.racer-car-stats > div { min-height: 88px; display: flex; flex-direction: column; justify-content: center; padding: 14px; border: 1px solid #293238; background: #0a0e11; }
.racer-car-stats strong { font: 800 1.55rem var(--display); }
.racer-car-stats small { margin: 5px 0 0; color: var(--muted); font-size: .64rem; letter-spacing: .08em; text-transform: uppercase; }
.racer-car-context { display: flex; justify-content: space-between; gap: 12px; margin-top: 9px; color: var(--muted); font-size: .7rem; }
.car-library-card { min-height: 104px; }
.car-library-card[hidden] { display: none; }
.car-reference { display: flex; align-items: center; gap: 10px; margin-top: auto; padding-top: 14px; color: var(--muted); font-size: .7rem; }

.garage-search-bar { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin: -10px 0 18px 316px; padding: 14px 16px; border: 1px solid var(--line); background: #0e1216; }
.garage-search-controls { display: grid; grid-template-columns: minmax(240px, 2fr) minmax(130px, 1fr) minmax(150px, 1fr); gap: 10px; flex: 1; }
.garage-search-bar label { display: grid; width: 100%; gap: 7px; color: #8f99a2; font-size: .68rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; }
.garage-search-bar input, .garage-search-bar select { padding: 10px 12px; }
#garage-search-results { flex: none; color: var(--red); font: 700 .8rem var(--display); letter-spacing: .06em; text-transform: uppercase; }
#app-scale { width: auto; min-width: 150px; }

.crew-roster-toggle {
  border: 1px solid var(--red);
  border-radius: 3px;
  padding: 6px 11px;
  color: #071013;
  background: var(--red);
  font-size: .7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
  cursor: pointer;
}

.crew-roster-toggle:hover {
  filter: brightness(1.08);
}

.crew-roster {
  display: grid;
  gap: 8px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.crew-roster-head,
.crew-member {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(145px, 190px);
  align-items: center;
  gap: 16px;
}

.crew-roster-head {
  padding: 0 12px 5px;
  color: #71808b;
  font-size: .63rem;
  letter-spacing: .13em;
}

.crew-roster-head span {
  text-align: left;
}

.crew-member {
  min-height: 58px;
  padding: 10px 12px;
  border: 1px solid #252e34;
  background: #0b0f12;
}

.crew-member > div {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.crew-member strong {
  font-family: var(--display);
  font-size: 1.05rem;
  text-transform: uppercase;
}

.crew-member small {
  color: var(--red);
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .08em;
}

.crew-member select {
  width: 100%;
  min-height: 38px;
  padding: 7px 10px;
  border-color: #354148;
  color: #eef4f6;
  background: #10161a;
  font-weight: 700;
}

@media (max-width: 620px) {
  .crew-roster-head,
  .crew-member {
    grid-template-columns: 1fr;
  }

  .crew-roster-head span {
    display: none;
  }

  .crew-member > div {
    margin-bottom: 3px;
  }

  .racer-car-head { align-items: stretch; flex-direction: column; }
  .racer-car-head label { min-width: 0; }
  .racer-car-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .racer-car-context { flex-direction: column; }
}

@media (max-width: 1050px) {
  .garage-search-bar { margin-left: 0; }
}

@media (max-width: 750px) {
  #app-scale { display: block; min-width: 112px; padding-inline: 8px; }
}

@media (max-width: 520px) {
  .garage-search-bar { align-items: stretch; flex-direction: column; }
  .garage-search-controls { grid-template-columns: 1fr; }
  #garage-search-results { align-self: flex-end; }
}

#tracks .section-intro h2,
#cars .section-intro h2 {
  display: flex;
  align-items: center;
  gap: 12px;
}

.library-count {
  display: inline-flex;
  min-width: 34px;
  height: 28px;
  align-items: center;
  justify-content: center;
  padding: 0 9px;
  border: 1px solid var(--red);
  border-radius: 999px;
  color: #071013;
  background: var(--red);
  font-family: Arial, sans-serif;
  font-size: .78rem;
  font-weight: 900;
  line-height: 1;
}

#battles .section-intro h2,
#points .section-intro h2 {
  display: flex;
  align-items: center;
  gap: 12px;
}

.battle-layout,
.battle-list {
  display: grid;
  gap: 18px;
}

.battle-form {
  background:
    linear-gradient(115deg, color-mix(in srgb, var(--red) 9%, transparent), transparent 42%),
    #0e1216;
}

.battle-form h3,
.round-form h3 {
  margin: 0;
  font: 700 1.75rem var(--display);
  text-transform: uppercase;
}

.battle-form-header { cursor: pointer; margin: -10px; padding: 10px; transition: background .18s ease; }
.battle-form-header:hover { background: color-mix(in srgb, var(--red) 6%, transparent); }
.battle-form-header:focus-visible { outline: 2px solid var(--red); outline-offset: -2px; }
.battle-form-body[hidden] { display: none; }
.battle-form.collapsed .battle-form-header { margin-bottom: -10px; }

.form-title-row,
.battle-card-head,
.round-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.form-title-row {
  margin-bottom: 20px;
}

.battle-format-badge {
  min-width: 52px;
  padding: 7px 10px;
  border: 1px solid var(--red);
  color: #071013;
  background: var(--red);
  font: 800 .9rem var(--display);
  text-align: center;
}

#battle-submit {
  padding: 8px 13px;
  font-size: .76rem;
}

.lineup-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 58px minmax(0, 1fr);
  align-items: stretch;
  gap: 14px;
  margin-top: 24px;
}

.lineup-grid fieldset {
  min-width: 0;
  margin: 0;
  padding: 16px;
  border: 1px solid var(--line);
  background: #0a0e11;
}

.lineup-grid legend {
  padding: 0 8px;
  color: var(--red);
  font: 700 .8rem var(--display);
  letter-spacing: .08em;
  text-transform: uppercase;
}

.versus-mark {
  display: grid;
  place-items: center;
  color: var(--red);
  font: 800 1.7rem var(--display);
}

.driver-picker {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.driver-choice {
  position: relative;
  min-width: 0;
  cursor: pointer;
}

.driver-choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.driver-choice span {
  display: flex;
  min-height: 54px;
  flex-direction: column;
  justify-content: center;
  padding: 9px 12px;
  border: 1px solid #293238;
  background: #11171b;
  transition: .18s ease;
}

.driver-choice input:checked + span {
  border-color: var(--red);
  color: #071013;
  background: var(--red);
}

.driver-choice b { font-size: .85rem; }
.driver-choice small { color: #7c8992; font-size: .67rem; }
.driver-choice input:checked + span small { color: #203038; }
.compact-empty { grid-column: 1 / -1; padding: 18px 10px; }

.battle-bans-editor {
  min-width: 0;
  margin: 0 0 20px;
  padding: 16px;
  border: 1px solid var(--line);
  background: #0a0e11;
}

.battle-bans-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 12px;
}

.battle-bans-head h4 {
  margin: 0;
  font: 700 1.2rem var(--display);
  text-transform: uppercase;
}

.battle-bans-head h4 span { display: inline-grid; min-width: 25px; height: 25px; place-items: center; margin-left: 6px; border-radius: 999px; color: #071013; background: var(--red); font: 800 .72rem Arial, sans-serif; vertical-align: middle; }
.banned-cars-current { display: flex; flex-wrap: wrap; gap: 7px; }
.banned-cars-current > span { display: grid; padding: 7px 10px; border: 1px solid var(--red); background: color-mix(in srgb, var(--red) 8%, #0b0f12); }
.banned-cars-current b { font-size: .76rem; }
.banned-cars-current small { color: var(--muted); font-size: .62rem; }
.banned-cars-current p { margin: 0; color: var(--muted); font-size: .78rem; }
.ban-car-picker-panel { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.ban-car-picker-panel[hidden] { display: none; }

.banned-cars-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 420px) auto;
  align-items: center;
  gap: 12px;
}

[data-banned-count] {
  color: var(--muted);
  font-size: .75rem;
  font-weight: 700;
}

.banned-car-picker {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
  max-height: 260px;
  overflow: auto;
  padding-right: 4px;
}

.banned-car-choice { position: relative; min-width: 0; cursor: pointer; }
.banned-car-choice[hidden] { display: none; }
.banned-car-choice input { position: absolute; opacity: 0; pointer-events: none; }
.banned-car-choice span { display: grid; min-height: 50px; align-content: center; padding: 8px 10px; border: 1px solid #283138; background: #11171b; transition: .16s ease; }
.banned-car-choice b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .78rem; }
.banned-car-choice small { color: #77848c; font-size: .62rem; }
.banned-car-choice input:checked + span { border-color: var(--red); color: #071013; background: var(--red); }
.banned-car-choice input:checked + span small { color: #25343a; }
.battle-bans-actions { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 14px; }
.battle-bans-actions small { color: var(--muted); }
.battle-bans-actions > div { display: flex; gap: 8px; }
.view-hidden { display: none !important; }

.battle-card {
  border: 1px solid var(--line);
  background: linear-gradient(145deg, #12171c, #0c1013);
}

.battle-card-head { padding: 20px; cursor: pointer; transition: background .18s ease, border-color .18s ease; }
.battle-card-head:hover { background: color-mix(in srgb, var(--red) 6%, transparent); }
.battle-card-head:focus-visible { outline: 2px solid var(--red); outline-offset: -2px; }
.battle-card.expanded .battle-card-head { background: color-mix(in srgb, var(--red) 4%, transparent); }
.battle-card-head button { cursor: pointer; }
.battle-card-head h3 { margin: 0 0 4px; font: 700 1.45rem var(--display); text-transform: uppercase; }
.battle-card-head > div:first-child { flex: 1; min-width: 210px; }
.battle-card-head > div:first-child > small { color: var(--muted); }

.battle-score {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 20px;
  border-inline: 1px solid var(--line);
}

.battle-score div { display: flex; align-items: baseline; gap: 10px; }
.battle-score span { color: var(--muted); font: 700 .78rem var(--display); }
.battle-score strong { font: 800 2.4rem/1 var(--display); }
.battle-score > b { color: #56616a; }

.battle-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.battle-status { color: var(--red); font: 700 .72rem var(--display); letter-spacing: .08em; }
.battle-detail { padding: 0 20px 20px; border-top: 1px solid var(--line); }

.lineup-summary {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 18px;
  align-items: start;
  padding: 20px 0;
}

.lineup-summary > div:first-child,
.lineup-summary > div:last-child { display: flex; flex-wrap: wrap; gap: 6px; }
.lineup-summary > div:last-child { justify-content: flex-end; }
.lineup-summary > div > small { width: 100%; color: var(--muted); text-transform: uppercase; }
.lineup-summary > div:last-child > small { text-align: right; }
.lineup-summary span { padding: 5px 8px; border: 1px solid #2b353c; background: #0b0f12; font-size: .74rem; }
.series-score { text-align: center; }
.series-score strong { display: block; margin-top: 5px; font: 800 2rem var(--display); }

.battle-rounds { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(320px, .75fr); gap: 16px; align-items: start; }
.round-card { margin-top: 10px; border: 1px solid #293138; background: #0a0e11; }
.round-head { padding: 12px 14px; border-bottom: 1px solid #222a30; }
.round-head > div:first-child { display: grid; }
.round-head small { color: var(--muted); margin-top: 3px; }
.round-score { display: flex; gap: 9px; align-items: center; color: var(--red); }

.finish-order { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.finish-order > div { display: grid; grid-template-columns: 30px 1fr auto auto; gap: 8px; align-items: center; padding: 9px 12px; border-bottom: 1px solid #1d2429; }
.finish-position { color: var(--red); font: 800 1rem var(--display); }
.finish-order strong { display: flex; min-width: 0; align-items: center; gap: 8px; }
.finish-car { overflow: hidden; max-width: 150px; padding: 2px 6px; border: 1px solid #334149; color: var(--muted); font: 600 .62rem var(--font-body); text-overflow: ellipsis; white-space: nowrap; }
.finish-order small { color: var(--muted); }
.finish-order b { color: var(--red); }

.round-form { display: grid; gap: 14px; position: sticky; top: 20px; }
.round-form > label { display: grid; gap: 7px; color: #8f99a2; font-size: .7rem; text-transform: uppercase; letter-spacing: .1em; }
.position-entry-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(130px, 200px) 58px; gap: 10px; padding-left: 38px; color: #71808b; font-size: .65rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.position-entry-head span:last-child { text-align: center; }
.position-entry { display: grid; gap: 6px; max-height: 410px; overflow: auto; padding-right: 3px; }
.position-row { display: grid; grid-template-columns: 28px minmax(0, 1fr) minmax(130px, 200px) 58px; gap: 10px; align-items: center; min-height: 56px; padding: 7px 9px; border: 1px solid transparent; background: #0a0e11; cursor: grab; transition: border-color .15s ease, background .15s ease, opacity .15s ease; }
.position-row:hover { border-color: #35434b; background: #0e1418; }
.position-row.dragging { opacity: .48; border-color: var(--red); background: color-mix(in srgb, var(--red) 12%, #0a0e11); cursor: grabbing; }
.drag-handle { color: #65737c; font-size: 1.25rem; letter-spacing: -5px; transform: rotate(90deg); user-select: none; }
.position-driver { display: grid; min-width: 0; }
.position-driver b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.position-driver small { color: var(--red); font-size: .65rem; }
.position-row select { min-width: 0; padding: 8px 28px 8px 9px; font-size: .72rem; }
.fixed-position { display: grid; min-width: 52px; min-height: 38px; place-items: center; border: 1px solid #344149; color: #071013; background: var(--red); font: 800 1rem var(--display); }

.points-form { align-self: start; }
.field-label { display: block; margin-bottom: 9px; color: #8f99a2; font-size: .7rem; text-transform: uppercase; letter-spacing: .1em; }
.points-position-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.points-position-grid label { gap: 4px; }
.points-position-grid label span { color: var(--red); font: 700 .7rem var(--display); }
.points-position-grid input { padding: 9px 6px; text-align: center; }
.form-help { color: var(--muted); line-height: 1.5; }
.point-card { min-height: 150px; }
.points-strip { display: grid; grid-template-columns: repeat(8, minmax(38px, 1fr)); gap: 4px; margin-top: auto; padding-top: 18px; }
.points-strip span { display: grid; place-items: center; padding: 6px 3px; background: #090d10; border-top: 2px solid #263138; }
.points-strip small { margin: 0; color: var(--muted); }
.points-strip b { font: 700 .9rem var(--display); }

dialog.leaderboard-dialog {
  width: min(900px, calc(100vw - 32px));
  max-width: 900px;
  padding: 0;
}

.leaderboard-dialog-head,
.leaderboard-dialog-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 22px;
}

.leaderboard-dialog-head { border-bottom: 1px solid var(--line); }
.leaderboard-dialog-head h3 { margin: 0; }
.leaderboard-dialog-foot { justify-content: flex-end; border-top: 1px solid var(--line); }
#racer-leaderboard-content { max-height: min(62vh, 620px); padding: 10px 18px; overflow: auto; }
.leaderboard-points { color: var(--red); font: 800 1.2rem var(--display); }

@media (max-width: 1100px) {
  .battle-card-head { align-items: flex-start; flex-wrap: wrap; }
  .battle-score { order: 3; width: 100%; justify-content: center; border: 1px solid var(--line); }
  .battle-rounds { grid-template-columns: 1fr; }
  .round-form { position: static; }
}

@media (max-width: 750px) {
  .sidebar nav { overflow-x: auto; justify-content: flex-start; }
  .nav-item { min-width: 72px; }
  .lineup-grid { grid-template-columns: 1fr; }
  .versus-mark { min-height: 34px; }
  .driver-picker { grid-template-columns: 1fr; }
  .banned-car-picker { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lineup-summary { grid-template-columns: 1fr; }
  .lineup-summary > div:last-child { justify-content: flex-start; }
  .lineup-summary > div:last-child > small { text-align: left; }
  .series-score { text-align: left; }
  .finish-order { grid-template-columns: 1fr; }
  .points-strip { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 520px) {
  .battle-card-head { padding: 16px; }
  .battle-detail { padding: 0 14px 14px; }
  .battle-actions { justify-content: flex-start; }
  .battle-bans-head { align-items: stretch; flex-direction: column; }
  .banned-cars-toolbar { grid-template-columns: 1fr; }
  .banned-car-picker { grid-template-columns: 1fr; }
  .battle-bans-actions { align-items: stretch; flex-direction: column; }
  .points-position-grid { grid-template-columns: repeat(2, 1fr); }
}
.cloud-login{position:fixed;inset:0;z-index:9999;display:grid;place-items:center;padding:24px;background:rgba(3,7,9,.88);backdrop-filter:blur(18px)}
.cloud-login-card{width:min(460px,100%);padding:42px;border:1px solid #29363b;background:linear-gradient(145deg,#11191d,#090d0f);box-shadow:0 28px 90px rgba(0,0,0,.55);text-align:center}
.cloud-login-card .brand-mark{display:inline-grid;margin-bottom:22px}
.cloud-login-card h2{margin:4px 0 12px;font-family:'Barlow Condensed',sans-serif;font-size:2.6rem;text-transform:uppercase}
.cloud-login-card p:not(.eyebrow){margin:0 auto 28px;max-width:360px;color:#92a4ad;line-height:1.6}
.cloud-login-card .primary{display:inline-flex;align-items:center;justify-content:center;min-height:46px;padding:0 24px;text-decoration:none}
.permission-readonly form,.permission-readonly .edit-button,.permission-readonly .icon-button,.permission-readonly [data-save-bans],.permission-readonly [data-cancel-bans],.permission-readonly [data-toggle-ban-picker],.permission-readonly [data-edit-round],.permission-readonly [data-delete-round]{display:none!important}
.account-access-layout{display:grid;grid-template-columns:minmax(320px,.8fr) minmax(520px,1.2fr);gap:18px;align-items:start}.account-list,.role-permissions{display:grid;gap:10px;margin-top:16px}
.account-row,.role-card{display:flex;align-items:center;justify-content:space-between;gap:18px;padding:14px;border:1px solid #29363b;background:rgba(5,10,13,.48)}.account-row div{display:grid;gap:4px}.account-row small,.role-card p{color:#92a4ad}.account-row select{min-width:130px}
.account-row>div{min-width:0;flex:1}.account-row>label{display:grid;gap:6px;color:#8fa5af;font-size:11px;letter-spacing:.08em;text-transform:uppercase}.account-row>label select{min-width:220px}.first-profile-setup{max-width:880px;margin:0 auto}.first-profile-setup .crew-card-heading p:last-child{max-width:650px;color:#9dafb8;line-height:1.55;margin-top:8px}
@media(max-width:760px){.account-row{align-items:stretch;flex-direction:column}.account-row>label select,.account-row>select{width:100%}}
.application-actions{display:flex!important;gap:8px!important}.application-actions button{min-width:74px}.crew-applications{margin-top:0}.crew-profile-actions button[disabled]{opacity:.58;cursor:default}
@media(max-width:760px){.application-actions{grid-column:2/-1;flex-wrap:wrap}.application-actions button{flex:1}}
.role-card{display:grid;align-items:stretch}.role-card>div:first-child{display:flex;align-items:center;justify-content:space-between;gap:12px}.role-card .primary{padding:8px 12px;min-height:34px}
.permission-grid{display:grid!important;grid-template-columns:minmax(150px,1fr) 52px 52px;gap:8px 14px;align-items:center}.permission-grid>b,.permission-grid>span{text-transform:uppercase;font-size:11px;letter-spacing:.12em;color:#b0e0e6}.permission-grid input{justify-self:center;width:18px;height:18px}
@media(max-width:1000px){.account-access-layout{grid-template-columns:1fr}}

/* CUH metallic intelligence theme */
:root{--cuh-blue:#82dcff;--cuh-cyan:#b0e0e6;--cuh-panel:rgba(6,16,24,.78);--cuh-line:rgba(130,220,255,.34)}
body{background:#02070b;color:#eef7fb}
body::before{content:"";position:fixed;inset:0;z-index:-2;pointer-events:none;background:#02070b}
.app-shell{position:relative;background:transparent}.app-shell::before{content:"";position:fixed;z-index:-1;top:0;right:0;bottom:0;left:240px;pointer-events:none;background:linear-gradient(90deg,rgba(2,7,11,.86),rgba(2,8,13,.54) 50%,rgba(2,7,11,.78)),linear-gradient(180deg,rgba(1,5,8,.25),rgba(1,5,8,.72)),url('cuh-background.jpg') center/contain no-repeat}
.sidebar{border-right:1px solid rgba(130,220,255,.24);background:linear-gradient(180deg,rgba(3,10,16,.97),rgba(3,10,16,.9));box-shadow:12px 0 45px rgba(0,0,0,.3)}
.brand{align-items:center;flex-direction:column;padding:22px 14px 28px;text-align:center;border-bottom:1px solid rgba(130,220,255,.18)}
.brand-emblem{display:block;width:126px;height:146px;background:url('cuh-logo.jpg') center/contain no-repeat;filter:drop-shadow(0 0 12px rgba(60,174,255,.42))}
.brand>div{display:grid;gap:2px}.brand strong{font:800 1.2rem 'Barlow Condensed',sans-serif;letter-spacing:.42em;margin-left:.42em}.brand small{color:#b8c6ce;font-size:.52rem;letter-spacing:.2em}
.nav-item{position:relative;border-left:3px solid transparent;color:#afbdc7;font-weight:600}.nav-item:hover{color:#e7f8ff;background:rgba(130,220,255,.06)}.nav-item.active{border-left-color:var(--cuh-blue);color:#e9faff;background:linear-gradient(90deg,rgba(104,205,255,.22),rgba(104,205,255,.05));box-shadow:inset 0 0 22px rgba(71,180,238,.1)}
.nav-item span{color:#76caed}.side-foot{border-top:1px solid rgba(130,220,255,.18);background:rgba(2,8,12,.55)}
main{background:transparent}.topbar{background:linear-gradient(180deg,rgba(3,11,17,.94),rgba(3,11,17,.52));border-bottom:1px solid rgba(130,220,255,.12);backdrop-filter:blur(8px)}
.view{padding-top:24px}.overview-hero{display:flex;align-items:end;justify-content:space-between;gap:24px;margin:0 0 24px}.overview-hero h1{margin:2px 0 8px;font:800 clamp(3rem,5vw,5.4rem)/.85 'Barlow Condensed',sans-serif;letter-spacing:.015em;text-transform:uppercase;color:#f5f8fa;text-shadow:0 3px 0 #74838c,0 8px 18px rgba(0,0,0,.75)}.overview-hero>div>span{display:block;width:140px;height:3px;background:linear-gradient(90deg,var(--cuh-blue),transparent);box-shadow:0 0 10px rgba(130,220,255,.8)}.overview-hero>p{color:#b7c7cf;font-size:.64rem;letter-spacing:.55em;white-space:nowrap}.eyebrow{color:#82dcff!important;letter-spacing:.22em}
.panel,.metric,.entity-card,.battle-card,.garage-search-bar{border:1px solid var(--cuh-line)!important;background:linear-gradient(135deg,rgba(10,24,34,.86),rgba(3,11,17,.74))!important;box-shadow:inset 0 1px rgba(255,255,255,.035),0 14px 34px rgba(0,0,0,.22);backdrop-filter:blur(9px)}
.metric{min-height:128px;border-radius:3px}.metric>span,.metric div>span{color:#b8c6ce;letter-spacing:.08em}.metric strong{color:#f3f8fb;text-shadow:0 0 18px rgba(130,220,255,.18)}.metric.feature{background:linear-gradient(135deg,rgba(11,28,39,.92),rgba(4,13,20,.74))!important}.speed-ring{border-color:#69cef7!important;box-shadow:0 0 20px rgba(73,189,244,.14)}
.panel-head{border-bottom:1px solid rgba(130,220,255,.2)}.panel-head h2,.section-intro h2,.panel h3{color:#f0f6f9;text-shadow:0 2px 0 rgba(77,94,104,.65);letter-spacing:.04em}.dashboard-grid{gap:16px}.dashboard-grid:first-of-type{grid-template-columns:minmax(0,1.55fr) minmax(320px,.78fr)}
table th{color:#a8c4d2;border-bottom-color:rgba(130,220,255,.24)}table td{border-bottom-color:rgba(130,220,255,.1)}tbody tr:hover{background:rgba(130,220,255,.055)}
button.primary,.fixed-position,.battle-format-badge{border-color:#a9edff!important;background:linear-gradient(180deg,#c4f1fa,#8fd9e8)!important;color:#061016!important;box-shadow:0 0 22px rgba(130,220,255,.23);font-weight:800}button.primary:hover{filter:brightness(1.08);box-shadow:0 0 30px rgba(130,220,255,.36)}
input,select,textarea{border-color:rgba(130,220,255,.24)!important;background:rgba(3,10,15,.8)!important;color:#eef8fc!important}input:focus,select:focus,textarea:focus{border-color:#82dcff!important;box-shadow:0 0 0 2px rgba(130,220,255,.09)}
.library-count{background:#b0e0e6!important;color:#061016!important}.status-dot{background:#48efb1!important;box-shadow:0 0 12px #48efb1}.cloud-login{background:rgba(1,5,8,.82)}.cloud-login-card{border-color:var(--cuh-line);background:linear-gradient(145deg,rgba(10,24,34,.96),rgba(3,10,15,.96));box-shadow:0 0 65px rgba(70,178,230,.14)}
.discord-activity .overview-hero h1{font-size:clamp(2.6rem,5vw,4.8rem)}
@media(max-width:900px){.overview-hero{align-items:start;flex-direction:column}.overview-hero>p{white-space:normal}.dashboard-grid:first-of-type{grid-template-columns:1fr}}
.svg-sprite{position:absolute;width:0;height:0;overflow:hidden}.nav-item svg,.top-cloud svg,.race-footer svg,.metric-icon{fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.nav-item{display:grid!important;grid-template-columns:22px 25px 1fr;align-items:center;gap:9px;text-align:left}.nav-item>span{font-size:.52rem!important}.nav-item svg{width:22px;height:22px;color:#83dafa}.nav-item.active svg{filter:drop-shadow(0 0 6px rgba(130,220,255,.7))}
.topbar{justify-content:space-between!important}.top-cloud{display:flex;align-items:center;gap:9px;margin-right:auto;color:#85dcfa;font:700 .65rem 'Inter',sans-serif;letter-spacing:.13em;text-transform:uppercase}.top-cloud svg{width:22px;height:22px}.top-cloud b,.live-feed b,.race-footer b{width:8px;height:8px;border-radius:50%;background:#48efb1;box-shadow:0 0 10px #48efb1}
.metric{display:flex!important;align-items:center;gap:18px}.metric>div:not(.speed-ring){display:grid;min-width:0}.metric-icon{flex:0 0 48px;width:48px;height:48px;color:#8bdfff;filter:drop-shadow(0 0 8px rgba(130,220,255,.32))}.metric:not(.feature) strong{line-height:1.05}.metric.feature .metric-icon{flex-basis:44px;width:44px;height:44px}.metric.feature .speed-ring{margin-left:auto}
.live-feed{display:flex;align-items:center;gap:8px;color:#b5c9d3;font-size:.68rem}.live-feed b{display:block;width:7px;height:7px}
.race-footer{position:fixed;z-index:50;right:0;bottom:0;left:var(--sidebar-width,220px);display:flex;align-items:center;justify-content:space-between;gap:24px;min-height:42px;padding:0 28px;border-top:1px solid rgba(130,220,255,.22);background:rgba(2,8,12,.91);backdrop-filter:blur(10px);color:#aebec7;font-size:.56rem;letter-spacing:.26em}.race-footer span{display:flex;align-items:center;gap:8px}.race-footer svg{width:19px;height:19px;color:#82dcff}.race-footer strong{color:#d0d9de;font-weight:500;letter-spacing:.4em}main{padding-bottom:42px}
.activity-list>div{position:relative;padding-left:48px!important}.activity-list>div::before{content:"";position:absolute;left:17px;top:50%;width:21px;height:21px;transform:translateY(-50%);background:center/contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2382dcff' stroke-width='1.8'%3E%3Ccircle cx='12' cy='13' r='8'/%3E%3Cpath d='M12 9v5l3 2M9 2h6'/%3E%3C/svg%3E");filter:drop-shadow(0 0 5px rgba(130,220,255,.45))}
@media(max-width:750px){.top-cloud{display:none}.race-footer{display:none}main{padding-bottom:0}.nav-item{display:flex!important}.nav-item svg{width:20px;height:20px}.nav-item>span{display:none!important}.brand-emblem{width:56px;height:62px;background-size:155px auto}}
@media(max-width:750px){.app-shell::before{left:0;bottom:68px;background-size:contain;background-position:center top}}
.battle-crew-filter{display:flex;align-items:end;justify-content:space-between;gap:20px;margin-bottom:16px;padding:16px 20px}.battle-crew-filter label{display:grid;gap:7px;min-width:300px;color:#9eb1bc;font-size:.68rem;letter-spacing:.1em;text-transform:uppercase}.battle-crew-filter small{color:var(--muted)}

/* Full-screen CUH presentation */
.app-shell::before{inset:0;background:linear-gradient(90deg,rgba(1,6,10,.72),rgba(2,8,13,.38) 46%,rgba(1,6,10,.66)),linear-gradient(180deg,rgba(1,5,8,.1),rgba(1,5,8,.5)),url('cuh-dashboard-bg.png') center center/cover no-repeat}
.sidebar{padding:14px 0 12px;background:linear-gradient(180deg,rgba(2,9,15,.9),rgba(2,9,15,.82));backdrop-filter:blur(12px)}
.brand{margin:0 0 10px;padding:0 8px 12px;border-bottom:1px solid rgba(130,220,255,.2)}
.brand-emblem{width:min(190px,100%);height:270px;background-image:url('cuh-background.jpg');background-position:center;background-size:contain;background-repeat:no-repeat;filter:drop-shadow(0 0 15px rgba(60,174,255,.48))}
.brand>div{display:none}
.sidebar nav{padding:0 10px}
.side-foot{margin-inline:10px}
@media(max-width:750px){.app-shell::before{inset:0 0 68px;background-position:center;background-size:cover}.sidebar{padding:8px}.brand{display:none}.sidebar nav{padding:0}}

/* Discord Activity: keep one clean scrolling surface and avoid fixed UI collisions. */
html.discord-activity{height:100%;overflow:hidden}
html.discord-activity body{height:100%;overflow-x:hidden;overflow-y:auto;overscroll-behavior:contain}
html.discord-activity .app-shell{height:auto;min-height:100%}
html.discord-activity .sidebar{height:100vh;min-height:100vh;max-height:100vh;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin}
html.discord-activity .sidebar nav{padding-bottom:18px}
html.discord-activity .side-foot,html.discord-activity .race-footer{display:none}
html.discord-activity main{min-width:0;padding-bottom:72px;overflow:visible}
html.discord-activity #toast{bottom:18px}

/* Shared web + Activity footer cleanup. Cloud state remains in the top bar. */
.race-footer,.side-foot{display:none!important}
.sidebar nav{min-height:0;overflow-x:hidden;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin}
main{padding-bottom:72px}

/* Keep the concept artwork visibly above the page base, underneath the UI. */
.app-shell{isolation:isolate}
.app-shell::before{z-index:0;background:linear-gradient(90deg,rgba(1,6,10,.5),rgba(2,8,13,.18) 46%,rgba(1,6,10,.44)),linear-gradient(180deg,rgba(1,5,8,.04),rgba(1,5,8,.3)),url('cuh-dashboard-bg.png') center center/cover no-repeat!important}
.sidebar{z-index:2}
main{position:relative;z-index:1}
.cloud-login{background:rgba(1,5,8,.58);backdrop-filter:blur(8px)}

/* Exact supplied sidebar emblem with the separate concept-art wordmark. */
.brand{gap:4px;padding-bottom:17px}
.brand-emblem{width:min(184px,100%);height:184px;background-image:url('cuh-sidebar-logo.jpg');background-position:center;background-size:contain;background-repeat:no-repeat}
.brand>div{display:grid;gap:5px;text-align:center}
.brand strong{font:700 1.3rem 'Inter',sans-serif;letter-spacing:.55em;margin-left:.55em;color:#f3f7fa}
.brand small{margin:0;color:#b8c6ce;font-size:.5rem;letter-spacing:.25em}

/* Floating header controls — no full-width background strip. */
.topbar{background:transparent!important;border:0!important;box-shadow:none!important;backdrop-filter:none!important}
.overview-hero .eyebrow,.section-intro>.eyebrow{font-size:.86rem;line-height:1.2;letter-spacing:.24em}

/* Centred overview metrics. */
.metric-grid .metric{justify-content:center;text-align:center}
.metric-grid .metric:not(.feature){flex-direction:column}
.metric-grid .metric>div:not(.speed-ring){justify-items:center;text-align:center}
.metric-grid{grid-template-columns:repeat(5,minmax(0,1fr))}
.metric-grid .metric.feature{display:grid!important;grid-template-columns:52px minmax(0,1fr);align-items:center}
.metric-grid .metric.feature .metric-icon{margin:0 auto}
.metric-grid .speed-ring{margin:0 auto}
.metric-grid .speed-ring{display:flex;align-items:center;justify-content:center;text-align:center;transform:none}
.metric-grid .speed-ring>*{width:100%;margin-inline:auto;text-align:center;transform:none}

/* Race Activity uses only the stopwatch icon, without numbered boxes. */
.activity-list .activity{grid-template-columns:minmax(0,1fr) auto;padding-left:38px!important}
.activity-list .activity::before{left:7px}
.activity-list .activity>.place{display:none}

/* Time Trial history and ownership controls. */
.time-trial-history{display:grid;grid-template-columns:1fr 1fr;gap:16px;margin-top:18px}
.time-trial-filter-head{align-items:end}.time-trial-filter-head label{display:grid;min-width:230px;gap:6px;color:#9eb1bc;font-size:.65rem;letter-spacing:.1em;text-transform:uppercase}
.time-trial-list{display:grid}.time-trial-row{display:grid;grid-template-columns:minmax(180px,1.4fr) minmax(90px,.65fr) minmax(90px,.65fr) 85px auto;gap:14px;align-items:center;padding:14px 4px;border-bottom:1px solid rgba(130,220,255,.13)}
.time-trial-row:last-child{border-bottom:0}.time-trial-primary{display:grid;gap:4px}.time-trial-primary strong{font-size:.82rem}.time-trial-primary span,.time-trial-times small,.time-trial-date small,.time-trial-owner{color:var(--muted);font-size:.65rem}.time-trial-times,.time-trial-date{display:grid;gap:3px}.time-trial-times b,.time-trial-date b{font:700 .95rem var(--display)}.time-trial-actions{display:flex;align-items:center;gap:5px}.time-trial-owner{text-align:right}
@media(max-width:1100px){.time-trial-history{grid-template-columns:1fr}.time-trial-row{grid-template-columns:minmax(160px,1fr) repeat(3,90px) auto}}
@media(max-width:700px){.metric-grid .metric.feature{grid-template-columns:42px minmax(0,1fr)}.metric-grid .speed-ring{display:none}.time-trial-row{grid-template-columns:1fr 1fr}.time-trial-primary{grid-column:1/-1}.time-trial-actions,.time-trial-owner{justify-self:end}.time-trial-filter-head{align-items:stretch;flex-direction:column}.time-trial-filter-head label{width:100%;min-width:0}}

/* Cross-discipline overview specialists. */
.specialists-panel{margin-bottom:16px}.specialists-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}.specialist-card{display:grid;grid-template-columns:52px minmax(0,1fr);gap:15px;align-items:center;padding:17px 18px;border:1px solid rgba(130,220,255,.2);background:rgba(3,12,18,.55)}.specialist-card svg{width:43px;height:43px;fill:none;stroke:#82dcff;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;filter:drop-shadow(0 0 8px rgba(130,220,255,.3))}.specialist-card>div{display:grid;gap:3px}.specialist-card span{color:#9fb5c0;font-size:.64rem;font-weight:700;letter-spacing:.12em;text-transform:uppercase}.specialist-card strong{font:700 1.4rem var(--display);text-transform:uppercase}.specialist-card small{color:var(--muted);font-size:.67rem}
@media(max-width:1250px){.metric-grid{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:800px){.metric-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.specialists-grid{grid-template-columns:1fr}}

/* Crew social profiles. */
.crew-library-layout{margin-bottom:20px}.crew-form-actions{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:8px;width:100%;padding-top:2px}.crew-form-actions button{width:100%;min-width:0;min-height:52px;padding:10px 8px;white-space:nowrap;font-size:.72rem}.crew-form-actions:has(#cancel-crew-edit[hidden]) #crew-submit{grid-column:1/-1}.crew-design-fields{display:grid;gap:14px;padding-top:17px;border-top:1px solid rgba(130,220,255,.16)}.crew-design-fields>.eyebrow{margin:0}.crew-design-fields>small{color:#71848e;font-size:.62rem;line-height:1.5;text-transform:none;letter-spacing:0}.crew-image-field{display:grid;gap:7px;padding:11px;border:1px solid rgba(130,220,255,.14);background:rgba(2,9,14,.32)}.crew-design-fields input[type="file"]{padding:8px;font-size:.65rem}.crew-design-fields input[type="file"]:disabled{opacity:.4;cursor:not-allowed}.crew-design-fields input[type="color"]{height:46px;padding:5px;cursor:pointer}.default-image-option{display:flex!important;align-items:center;gap:8px;color:#9fdcf2!important;font-size:.62rem!important;letter-spacing:.04em!important;text-transform:none!important;cursor:pointer}.default-image-option input{width:auto!important;margin:0;accent-color:var(--cuh-blue)}.crew-card{cursor:default}.crew-card.selected{border-color:#82dcff!important;box-shadow:inset 0 0 28px rgba(130,220,255,.1),0 0 22px rgba(130,220,255,.12)}.crew-card-bio{margin:18px 0 8px;color:#9cadb7;font-size:.73rem;line-height:1.55}
.crew-profile{scroll-margin-top:24px}.crew-profile[hidden]{display:none}.crew-profile-hero,.crew-social-card{border:1px solid var(--cuh-line);background:linear-gradient(135deg,rgba(10,24,34,.91),rgba(3,11,17,.82));box-shadow:0 18px 46px rgba(0,0,0,.28);backdrop-filter:blur(10px)}.crew-profile-cover{height:180px;background:linear-gradient(90deg,rgba(2,9,14,.38),rgba(2,9,14,.05),rgba(2,9,14,.58)),url('cuh-dashboard-bg.png') center 43%/cover no-repeat;border-bottom:1px solid rgba(130,220,255,.22)}.crew-profile-main{display:grid;grid-template-columns:150px minmax(0,1fr) auto;align-items:end;gap:22px;padding:0 28px 24px}.crew-profile-main>img{width:150px;height:150px;margin-top:-72px;border:1px solid rgba(130,220,255,.55);background:#02080d;object-fit:contain;box-shadow:0 0 30px rgba(92,198,250,.2)}.crew-profile-identity{padding-top:18px}.crew-profile-identity h2{display:inline-block;margin:0 12px 5px 0;font:800 clamp(2.2rem,4vw,4.2rem)/.85 var(--display);letter-spacing:.03em;text-transform:uppercase;text-shadow:0 3px 0 #63727a}.crew-profile-identity>p:last-child{margin:9px 0 0;color:#b6c5cd;font-size:.78rem;letter-spacing:.09em}.crew-profile-actions{display:flex;gap:9px;align-self:center}.crew-profile-stats{display:grid;grid-template-columns:repeat(4,1fr);border-top:1px solid rgba(130,220,255,.16)}.crew-profile-stats span{display:grid;justify-items:center;gap:4px;padding:18px;border-right:1px solid rgba(130,220,255,.13)}.crew-profile-stats span:last-child{border:0}.crew-profile-stats strong{font:800 1.8rem var(--display);color:#f4f9fb}.crew-profile-stats small{color:#8fa4af;font-size:.59rem;letter-spacing:.13em;text-transform:uppercase}
.crew-profile-grid{display:grid;grid-template-columns:minmax(260px,.82fr) minmax(480px,1.55fr);gap:16px;margin-top:16px}.crew-profile-column{display:grid;align-content:start;gap:16px}.crew-social-card{padding:22px}.crew-social-card h3{margin:0 0 20px;font:800 1.55rem var(--display);letter-spacing:.06em;text-transform:uppercase}.crew-social-card dl{display:grid;gap:0;margin:0}.crew-social-card dl>div{display:grid;grid-template-columns:120px 1fr;gap:14px;padding:12px 0;border-bottom:1px solid rgba(130,220,255,.12)}.crew-social-card dt{color:#8195a0;font-size:.64rem;letter-spacing:.1em;text-transform:uppercase}.crew-social-card dd{margin:0;color:#e8f1f5;font-size:.76rem}.crew-role-key{display:flex;gap:7px;margin-top:18px}.crew-role-key span{padding:5px 9px;border:1px solid rgba(130,220,255,.24);color:#9bdff8;font-size:.59rem;letter-spacing:.1em;text-transform:uppercase}.crew-record-grid{display:grid;grid-template-columns:1fr 1fr;gap:9px}.crew-record-grid>div{display:grid;justify-items:center;gap:5px;padding:18px 10px;border:1px solid rgba(130,220,255,.15);background:rgba(3,11,17,.42)}.crew-record-grid strong{font:800 1.7rem var(--display)}.crew-record-grid small{color:#8ca0aa;font-size:.57rem;letter-spacing:.1em;text-transform:uppercase}.crew-card-heading{display:flex;align-items:end;justify-content:space-between;margin-bottom:16px}.crew-card-heading h3{margin-bottom:0}.crew-card-heading>span{color:#8fa5b0;font-size:.62rem;letter-spacing:.1em;text-transform:uppercase}.profile-roster{display:grid}.profile-roster-row{display:grid;grid-template-columns:42px minmax(0,1fr) 120px;gap:13px;align-items:center;padding:12px 0;border-bottom:1px solid rgba(130,220,255,.12)}.profile-roster-row:last-child{border:0}.roster-avatar{width:38px;height:38px;display:grid;place-items:center;border:1px solid rgba(130,220,255,.34);background:rgba(130,220,255,.08);color:#9ce3ff;font:800 1rem var(--display)}.profile-roster-row>div:nth-child(2){display:grid;gap:4px}.profile-roster-row strong{font-size:.8rem}.profile-roster-row small{color:#7f939e;font-size:.62rem}.profile-roster-row select{padding:8px 9px;font-size:.69rem}.crew-top-cars{display:grid}.crew-top-cars>div{display:grid;grid-template-columns:44px minmax(0,1fr) auto;gap:12px;align-items:center;padding:13px 0;border-bottom:1px solid rgba(130,220,255,.12)}.crew-top-cars>div:last-child{border:0}.crew-top-cars b{color:#82dcff;font:800 1.1rem var(--display)}.crew-top-cars span{display:grid;gap:3px}.crew-top-cars strong{font-size:.79rem}.crew-top-cars small{color:#80949e;font-size:.61rem}.crew-top-cars em{color:#a9dff1;font:normal 700 .69rem var(--display);text-transform:uppercase}
.permission-readonly .crew-profile-actions .edit-button,.permission-readonly .profile-roster-row select{display:none!important}
.admin-only-hidden,.crew-form-restricted{display:none!important}.profile-roster-row{grid-template-columns:42px minmax(0,1fr) 100px 124px}.roster-role{color:#9edff6;font-size:.65rem;font-weight:800;letter-spacing:.08em;text-transform:uppercase}.crew-editor-toggle{display:flex!important;align-items:center;justify-content:flex-start;gap:7px;color:#a8bac3!important;font-size:.61rem!important;letter-spacing:.04em!important;text-transform:none!important;cursor:pointer}.crew-editor-toggle input{width:auto!important;margin:0;accent-color:var(--cuh-blue)}.crew-editor-toggle span{white-space:nowrap}
@media(max-width:1050px){.crew-profile-grid{grid-template-columns:1fr}.crew-profile-main{grid-template-columns:120px 1fr}.crew-profile-main>img{width:120px;height:120px}.crew-profile-actions{grid-column:1/-1;justify-self:end}.crew-profile-cover{height:145px}}
@media(max-width:650px){.crew-profile-main{grid-template-columns:88px 1fr;padding:0 16px 18px;gap:14px}.crew-profile-main>img{width:88px;height:88px;margin-top:-40px}.crew-profile-identity h2{font-size:2rem}.crew-profile-actions{justify-self:stretch}.crew-profile-actions button{flex:1}.crew-profile-stats{grid-template-columns:1fr 1fr}.crew-profile-stats span:nth-child(2){border-right:0}.crew-profile-stats span:nth-child(-n+2){border-bottom:1px solid rgba(130,220,255,.13)}.profile-roster-row{grid-template-columns:38px 1fr}.profile-roster-row select,.profile-roster-row .roster-role,.profile-roster-row .crew-editor-toggle{grid-column:2}.crew-social-card{padding:17px}}

/* A locally selected crew preset skins the entire interface. */
html.crew-design-active .panel,html.crew-design-active .metric,html.crew-design-active .entity-card,html.crew-design-active .battle-card,html.crew-design-active .garage-search-bar,html.crew-design-active .crew-profile-hero,html.crew-design-active .crew-social-card,html.crew-design-active .specialist-card,html.crew-design-active .time-trial-row{border-color:var(--crew-primary)!important}
html.crew-design-active input,html.crew-design-active select,html.crew-design-active textarea{border-color:color-mix(in srgb,var(--crew-primary) 55%,transparent)!important}
html.crew-design-active .crew-card.selected{border-color:var(--crew-primary)!important;box-shadow:inset 0 0 28px color-mix(in srgb,var(--crew-primary) 14%,transparent),0 0 22px color-mix(in srgb,var(--crew-primary) 18%,transparent)}

/* Collapsible crew editor. */
.crew-form-header{display:flex;align-items:center;justify-content:space-between;gap:12px;cursor:pointer}.crew-form-header h3{margin:0}.crew-form-header .eyebrow{margin-bottom:3px}.crew-form-toggle-mark{width:30px;height:30px;display:grid;place-items:center;border:1px solid rgba(130,220,255,.3);color:#9de5ff;font:700 1.2rem var(--display)}.crew-form-body{display:grid;gap:16px}.crew-form-body[hidden]{display:none}.compact-form.collapsed{gap:0}.compact-form.collapsed .crew-form-header{min-height:42px}

/* Personal racing profile. */
.sidebar-street-art{position:relative;z-index:0;flex:0 0 165px;width:100%;margin:-2px 0 0;pointer-events:none;background:url('my-profile-street-art.png') center 44%/cover no-repeat;opacity:.78;mix-blend-mode:screen;-webkit-mask-image:radial-gradient(ellipse 68% 64% at 50% 47%,#000 22%,rgba(0,0,0,.82) 39%,rgba(0,0,0,.35) 58%,transparent 78%);mask-image:radial-gradient(ellipse 68% 64% at 50% 47%,#000 22%,rgba(0,0,0,.82) 39%,rgba(0,0,0,.35) 58%,transparent 78%);filter:drop-shadow(0 0 14px rgba(49,162,220,.14))}.sidebar nav{position:relative;z-index:1;flex:1 1 auto}.sidebar-street-art::after{display:none}
.profile-page-title{margin-bottom:22px}.profile-page-title h1{font-size:clamp(3rem,5vw,5.4rem)}.my-profile-hero,.my-profile-editor{border:1px solid var(--cuh-line);background:linear-gradient(135deg,rgba(10,24,34,.91),rgba(3,11,17,.82));box-shadow:0 18px 46px rgba(0,0,0,.28);backdrop-filter:blur(10px)}.my-profile-banner{height:220px;background-position:center;background-size:cover;border-bottom:1px solid rgba(130,220,255,.24)}.my-profile-main{display:grid;grid-template-columns:164px minmax(0,1fr) auto;gap:23px;align-items:end;padding:0 28px 24px}.my-profile-main>img{width:164px;height:164px;margin-top:-78px;object-fit:cover;border:1px solid var(--cuh-line);background:#030b11;box-shadow:0 0 30px rgba(92,198,250,.24)}.my-profile-identity{padding-top:18px}.my-profile-identity h2{margin:0 0 5px;font:800 clamp(2.5rem,4vw,4.7rem)/.85 var(--display);letter-spacing:.035em;text-transform:uppercase;text-shadow:0 3px 0 #62727b}.my-profile-identity>div{display:flex;align-items:center;gap:9px}.profile-crew-tag{color:#82dcff;font:800 1.1rem var(--display);letter-spacing:.08em}.profile-role{padding:4px 9px;border:1px solid var(--cuh-line);border-radius:12px;color:#d9f4ff;font-size:.6rem;font-weight:800;letter-spacing:.12em;text-transform:uppercase}.my-profile-identity p{margin:10px 0 0;color:#c2cdd3;font-size:.8rem}.my-profile-actions{display:flex;gap:9px;align-self:center}.my-profile-stats{display:grid;grid-template-columns:repeat(4,1fr);border-top:1px solid rgba(130,220,255,.16)}.my-profile-stats span{display:grid;justify-items:center;gap:4px;padding:19px;border-right:1px solid rgba(130,220,255,.14)}.my-profile-stats span:last-child{border:0}.my-profile-stats strong{font:800 2rem var(--display)}.my-profile-stats small{color:#8fa4af;font-size:.58rem;letter-spacing:.13em;text-transform:uppercase}.my-profile-editor{margin-top:16px}.my-profile-editor h3{margin:0;font:800 1.5rem var(--display);text-transform:uppercase}.my-profile-grid{display:grid;grid-template-columns:minmax(250px,.65fr) minmax(540px,1.7fr);gap:16px;margin-top:16px}.my-profile-side,.my-profile-primary{display:grid;align-content:start;gap:16px}.profile-battle-record{display:grid}.profile-battle-record>div{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:17px 0;border-bottom:1px solid rgba(130,220,255,.13)}.profile-battle-record>div:last-child{border:0}.profile-battle-record span{color:#9ddff7;font-size:.66rem;letter-spacing:.08em;text-transform:uppercase}.profile-battle-record strong{font:800 1.2rem var(--display);text-transform:uppercase}.profile-street-art{height:250px;border:1px solid var(--cuh-line);background:url('my-profile-street-art.png') center/cover no-repeat;box-shadow:0 14px 34px rgba(0,0,0,.3)}.favoured-track-list{display:grid}.favoured-track-list>div:not(.empty){display:flex;align-items:center;justify-content:space-between;gap:18px;padding:13px 4px;border-bottom:1px solid rgba(130,220,255,.13)}.favoured-track-list>div:last-child{border:0}.favoured-track-list span{display:grid;gap:3px}.favoured-track-list strong{font-size:.78rem}.favoured-track-list small{color:#7f939e;font-size:.61rem}.favoured-track-list b{color:#bcecff;font:800 1rem var(--display)}.profile-favorite-cars{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}.profile-favorite-cars article{position:relative;min-height:150px;display:grid;place-items:center;align-content:center;gap:7px;padding:20px;border:1px solid rgba(130,220,255,.22);background:radial-gradient(circle at 50% 20%,rgba(75,175,228,.15),transparent 55%),rgba(2,9,14,.5);overflow:hidden;text-align:center}.profile-favorite-cars article>span{position:absolute;top:10px;left:12px;color:#75d4f7;font:800 .72rem var(--display)}.profile-favorite-cars svg{width:70px;height:48px;fill:none;stroke:#8de3ff;stroke-width:1.4;filter:drop-shadow(0 0 9px rgba(130,220,255,.4))}.profile-favorite-cars strong{font:800 1rem var(--display);text-transform:uppercase}.profile-favorite-cars small{color:#7f949f;font-size:.57rem;letter-spacing:.09em}.profile-favorite-cars>.empty{grid-column:1/-1}.profile-selection-editor{display:grid;gap:24px}.profile-selector-block{display:grid;gap:14px}.profile-selector-block h3{margin-bottom:4px}.profile-selector-block>div>small{color:#7e929c;font-size:.65rem}.profile-car-picker{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;max-height:360px;overflow:auto;padding-right:4px}.profile-car-picker>div{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:8px;padding:10px;border:1px solid rgba(130,220,255,.14);background:rgba(2,9,14,.38)}.profile-car-picker label,.profile-track-picker label{display:flex!important;align-items:center;gap:8px;color:#d9e5ea!important;font-size:.67rem!important;letter-spacing:0!important;text-transform:none!important}.profile-car-picker label:first-child{display:grid!important;grid-template-columns:auto 1fr}.profile-car-picker label small{grid-column:2;color:#738791;font-size:.55rem}.profile-car-picker input,.profile-track-picker input{width:auto!important;margin:0;accent-color:var(--cuh-blue)}.favorite-choice{color:#8edfff!important;white-space:nowrap}.favorite-choice input:disabled+*{opacity:.4}.profile-track-picker{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;max-height:300px;overflow:auto}.profile-track-picker label{padding:9px;border:1px solid rgba(130,220,255,.13);background:rgba(2,9,14,.34)}
@media(max-width:1120px){.my-profile-grid{grid-template-columns:1fr}.my-profile-main{grid-template-columns:130px minmax(0,1fr)}.my-profile-main>img{width:130px;height:130px}.my-profile-actions{grid-column:1/-1;justify-self:end}.sidebar-street-art{display:none}}
@media(max-width:700px){.my-profile-banner{height:145px}.my-profile-main{grid-template-columns:88px 1fr;padding:0 16px 18px;gap:13px}.my-profile-main>img{width:88px;height:88px;margin-top:-40px}.my-profile-identity h2{font-size:2rem}.my-profile-actions{justify-self:stretch}.my-profile-actions button{flex:1}.my-profile-stats{grid-template-columns:1fr 1fr}.my-profile-stats span:nth-child(2){border-right:0}.profile-favorite-cars,.profile-car-picker,.profile-track-picker{grid-template-columns:1fr}.profile-street-art{height:190px}}
.my-profile-editor label{display:grid;gap:7px;color:#8fa4af;font-size:.66rem;letter-spacing:.09em;text-transform:uppercase}
.profile-about-card dl>div{min-height:40px;display:grid;grid-template-columns:134px minmax(0,1fr);align-items:center}.profile-about-card dt,.profile-about-card dd{display:flex;align-items:center;min-height:40px;margin:0}.profile-about-card dt{line-height:1.1}.profile-about-card dd{justify-content:flex-start}

/* Profile car and track selectors mirror the Crew Vs Crew banned-car picker. */
.profile-ban-style-block{display:grid;gap:13px}.profile-ban-style-block+.profile-ban-style-block{padding-top:22px;border-top:1px solid rgba(130,220,255,.18)}.profile-ban-style-block .battle-bans-head h4{margin:2px 0 0;font:800 1.35rem var(--display);letter-spacing:.05em;text-transform:uppercase}.profile-ban-style-block .battle-bans-head h4 span{display:inline-grid;place-items:center;min-width:24px;height:24px;margin-left:6px;border-radius:50%;background:var(--cuh-cyan);color:#071014;font-size:.72rem}.profile-selection-limit{padding:6px 9px;border:1px solid rgba(130,220,255,.22);color:#9ddff7;font-size:.6rem;letter-spacing:.08em;text-transform:uppercase}.profile-picker-panel{margin-top:0}.profile-picker-panel .banned-car-picker{max-height:390px}.profile-car-choice{display:grid;gap:5px;min-width:0}.profile-car-choice>label:first-child{position:relative;min-width:0;cursor:pointer}.profile-car-choice>label:first-child input{position:absolute;opacity:0;pointer-events:none}.profile-car-choice>label:first-child>span{display:grid;min-height:50px;align-content:center;padding:8px 10px;border:1px solid #283138;background:#11171b;transition:.16s ease}.profile-car-choice>label:first-child input:checked+span{border-color:var(--cuh-blue);color:#071013;background:var(--cuh-cyan)}.profile-car-choice>label:first-child input:checked+span small{color:#25343a}.profile-favourite-toggle{position:relative;display:block!important;cursor:pointer}.profile-favourite-toggle input{position:absolute;opacity:0;pointer-events:none}.profile-favourite-toggle>span{display:block!important;min-height:0!important;padding:6px 8px!important;border:1px solid rgba(130,220,255,.16)!important;background:rgba(3,11,17,.7)!important;color:#80939d;text-align:center;font-size:.6rem;font-weight:800;letter-spacing:.07em;text-transform:uppercase}.profile-favourite-toggle input:checked+span{border-color:#f1cb59!important;color:#f8d66e!important;background:rgba(132,101,20,.15)!important}.profile-favourite-toggle input:disabled+span{opacity:.35;cursor:not-allowed}.profile-track-choice input:checked+span{border-color:var(--cuh-blue)!important;background:var(--cuh-cyan)!important;color:#071013!important}.profile-track-choice input:checked+span small{color:#25343a!important}

/* Mobile Safari, Android Chrome and Discord mobile Activity layout. */
.mobile-menu-button{display:none}
@media(max-width:750px){
html{width:100%;min-height:100%;overflow-x:hidden;-webkit-text-size-adjust:100%}
body{width:100%;min-width:0;min-height:100dvh;overflow-x:hidden;padding:env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left)}
body.mobile-nav-open{overflow:hidden}body.mobile-nav-open::after{content:"";position:fixed;z-index:89;inset:0;background:rgba(0,5,8,.72);backdrop-filter:none;-webkit-backdrop-filter:none}
.app-shell{display:block;width:100%;min-height:100dvh;isolation:auto!important}
.mobile-menu-button{position:fixed;z-index:101;top:calc(12px + env(safe-area-inset-top));left:calc(12px + env(safe-area-inset-left));display:grid;width:44px;height:44px;place-content:center;gap:5px;padding:0;border:1px solid rgba(130,220,255,.45);border-radius:3px;background:rgba(2,10,16,.94);box-shadow:0 8px 25px rgba(0,0,0,.35)}
.mobile-menu-button span{display:block;width:20px;height:2px;background:#8de3ff;transition:transform .2s,opacity .2s}.mobile-nav-open .mobile-menu-button span:nth-child(1){transform:translateY(7px) rotate(45deg)}.mobile-nav-open .mobile-menu-button span:nth-child(2){opacity:0}.mobile-nav-open .mobile-menu-button span:nth-child(3){transform:translateY(-7px) rotate(-45deg)}
.sidebar{position:fixed!important;z-index:100!important;inset:0 auto 0 0!important;width:min(84vw,320px)!important;height:100dvh!important;min-height:0!important;max-height:none!important;padding:68px 10px calc(16px + env(safe-area-inset-bottom))!important;border:0!important;border-right:1px solid rgba(130,220,255,.35)!important;transform:translateX(-105%);transition:transform .24s ease;overflow:hidden!important;background:#02090f!important;box-shadow:20px 0 60px rgba(0,0,0,.6);backdrop-filter:none!important;-webkit-backdrop-filter:none!important;filter:none!important}
.mobile-nav-open .sidebar{transform:translateX(0)}.sidebar .brand,.sidebar .side-foot,.sidebar-street-art{display:none!important}
.sidebar nav{display:grid!important;grid-template-columns:1fr!important;align-content:start;gap:3px!important;width:100%;height:100%;padding:0 4px 12px!important;overflow-x:hidden!important;overflow-y:auto!important;-webkit-overflow-scrolling:touch}
.sidebar .nav-item{display:grid!important;grid-template-columns:24px 28px minmax(0,1fr);align-items:center;width:100%;min-width:0!important;min-height:48px;padding:10px 12px!important;gap:10px!important;font-size:.84rem!important;text-align:left!important;white-space:normal}.sidebar .nav-item>span{display:block!important;font-size:.58rem!important}.sidebar .nav-item svg{width:22px!important;height:22px!important}.sidebar .nav-item.active{box-shadow:inset 3px 0 var(--cuh-blue)!important}
main{width:100%;min-width:0;padding:74px 12px calc(26px + env(safe-area-inset-bottom))!important;overflow:visible!important}.topbar{display:flex!important;align-items:stretch!important;justify-content:flex-end;margin:0 0 18px!important;min-height:44px}.header-actions{display:grid!important;grid-template-columns:minmax(0,1fr) auto;width:calc(100% - 54px);gap:7px}.header-actions #crew-filter{display:block!important;min-width:0!important}.header-actions #app-scale{display:none!important}.header-actions .primary{width:auto!important;padding:10px 12px;white-space:nowrap}
.section-intro,.overview-hero{margin-top:0!important}.overview-hero h1,.section-intro h2,.profile-page-title h1{font-size:clamp(2.45rem,13vw,4rem)!important;overflow-wrap:anywhere}.overview-hero>p{display:none}.metric-grid{grid-template-columns:1fr!important}.metric{min-height:118px!important}
.dashboard-grid,.dashboard-grid.lower,.split,.crew-library-layout,.battle-layout,.my-profile-grid,.crew-profile-grid{grid-template-columns:minmax(0,1fr)!important}.panel,.crew-social-card,.battle-form,.my-profile-editor{min-width:0;padding:16px!important}.form-grid,.entity-grid{grid-template-columns:1fr!important}.form-actions{align-items:stretch;flex-direction:column-reverse}.form-actions>*{width:100%}.panel-head{align-items:stretch;flex-direction:column}.panel-head select{width:100%;min-width:0}
.table-wrap{width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}table{min-width:620px}dialog{width:calc(100% - 24px);max-width:none;max-height:calc(100dvh - 24px);overflow:auto}.cloud-login{padding:12px}.cloud-login-card{max-height:calc(100dvh - 24px);padding:26px 18px;overflow:auto}input,select,textarea{font-size:16px!important}button,.nav-item{touch-action:manipulation}
.my-profile-main,.crew-profile-main{grid-template-columns:76px minmax(0,1fr)!important;padding:0 14px 16px!important;gap:12px!important}.my-profile-main>img,.crew-profile-main>img{width:76px!important;height:76px!important;margin-top:-34px!important}.my-profile-actions,.crew-profile-actions{grid-column:1/-1;display:grid!important;grid-template-columns:1fr 1fr;width:100%;justify-self:stretch!important}.my-profile-identity h2,.crew-profile-identity h2{font-size:1.8rem!important;overflow-wrap:anywhere}.profile-about-card dl>div{grid-template-columns:112px minmax(0,1fr)}.activity{grid-template-columns:28px minmax(0,1fr) auto;gap:8px}.activity time{font-size:.65rem}
}
@media(max-width:390px){main{padding-inline:9px!important}.header-actions{grid-template-columns:1fr;width:calc(100% - 54px)}.header-actions .primary{width:100%!important}.my-profile-stats,.crew-profile-stats{grid-template-columns:1fr 1fr!important}.my-profile-actions,.crew-profile-actions{grid-template-columns:1fr}.profile-about-card dl>div{grid-template-columns:98px minmax(0,1fr)}}
@media(max-width:750px) and (orientation:landscape){main{padding-top:62px!important}.sidebar{width:min(58vw,320px)!important}.sidebar .nav-item{min-height:42px}}
@media(max-width:750px){html.discord-activity .mobile-menu-button{top:calc(62px + env(safe-area-inset-top))}html.discord-activity .sidebar{padding-top:calc(118px + env(safe-area-inset-top))!important}html.discord-activity main{padding-top:calc(118px + env(safe-area-inset-top))!important}}

/* Social chat */
.social-intro{margin-bottom:18px}.social-shell{display:grid;grid-template-rows:auto minmax(320px,1fr) auto auto auto;height:min(760px,calc(100dvh - 190px));min-height:540px;border:1px solid var(--cuh-line);background:linear-gradient(135deg,rgba(7,20,29,.94),rgba(2,9,14,.92));box-shadow:0 22px 55px rgba(0,0,0,.35);overflow:hidden}.social-head{display:flex;align-items:center;justify-content:space-between;padding:14px 18px;border-bottom:1px solid rgba(130,220,255,.17);background:rgba(3,12,18,.86)}.social-head>div{display:grid;grid-template-columns:auto 1fr;align-items:center;column-gap:10px}.social-head .status-dot{grid-row:1/3}.social-head strong{font:800 1.05rem var(--display);letter-spacing:.06em;text-transform:uppercase}.social-head small{color:#718792;font-size:.58rem;letter-spacing:.12em;text-transform:uppercase}.social-head button{padding:8px 12px}.social-messages{display:flex;flex-direction:column;gap:12px;padding:20px;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin;background:radial-gradient(circle at 50% 0,rgba(49,145,190,.08),transparent 45%)}.social-row{display:flex;align-items:flex-end;gap:9px;max-width:min(76%,720px)}.social-row.own{align-self:flex-end;flex-direction:row}.social-row.other{align-self:flex-start}.social-row>img{width:34px;height:34px;flex:0 0 34px;border:1px solid rgba(130,220,255,.4);border-radius:50%;object-fit:cover;background:#071018}.social-message{position:relative;min-width:140px;padding:10px 12px 8px;border:1px solid rgba(130,220,255,.18);background:#0b1820;box-shadow:0 8px 22px rgba(0,0,0,.2)}.social-row.own .social-message{border-color:color-mix(in srgb,var(--cuh-blue) 48%,transparent);background:linear-gradient(135deg,rgba(29,113,145,.48),rgba(10,43,57,.88))}.social-meta{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:5px}.social-meta strong{color:#9ee8ff;font-size:.68rem}.social-meta time{color:#71838c;font-size:.52rem;white-space:nowrap}.social-message p{margin:0;color:#e5edf1;font-size:.79rem;line-height:1.5;overflow-wrap:anywhere}.social-message>button{float:right;margin:5px -3px -3px 10px;padding:3px;border:0;background:none;color:#7fcde8;font-size:.55rem;cursor:pointer}.social-mention{color:#82dcff;font-weight:800}.social-quoted{display:grid;gap:2px;margin:0 0 8px;padding:7px 9px;border-left:3px solid var(--cuh-blue);background:rgba(0,0,0,.2)}.social-quoted b{color:#9cdff7;font-size:.58rem}.social-quoted span{max-width:430px;overflow:hidden;color:#91a2aa;font-size:.6rem;text-overflow:ellipsis;white-space:nowrap}.social-reply-preview{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:9px 16px;border-top:1px solid rgba(130,220,255,.16);background:#07131a}.social-reply-preview>div{display:grid;gap:2px;min-width:0}.social-reply-preview small{color:#82dcff;font-weight:800}.social-reply-preview span{overflow:hidden;color:#91a4ad;font-size:.68rem;text-overflow:ellipsis;white-space:nowrap}.social-reply-preview button{border:0;background:none;color:#aebbc1;font-size:1.3rem;cursor:pointer}.social-mentions{display:flex;gap:6px;padding:8px 14px;border-top:1px solid rgba(130,220,255,.12);overflow-x:auto;background:#061017}.social-mentions button{display:flex;align-items:center;gap:7px;flex:0 0 auto;padding:6px 10px;border:1px solid rgba(130,220,255,.2);background:#0c1920;color:#dceaf0;cursor:pointer}.social-mentions img{width:25px;height:25px;border-radius:50%;object-fit:cover}.social-compose{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:10px;padding:12px 14px;border-top:1px solid rgba(130,220,255,.17);background:rgba(3,11,17,.95)}.social-compose textarea{min-height:48px;max-height:120px;resize:vertical}.social-compose button{min-width:92px}
@media(max-width:750px){.social-intro{display:none}.social-shell{height:calc(100dvh - 106px - env(safe-area-inset-top) - env(safe-area-inset-bottom));min-height:420px}.social-messages{padding:14px 10px}.social-row{max-width:92%;gap:6px}.social-row>img{width:29px;height:29px;flex-basis:29px}.social-message{min-width:110px}.social-meta{gap:8px}.social-meta time{font-size:.48rem}.social-compose{grid-template-columns:1fr;padding:9px}.social-compose textarea{min-height:44px}.social-compose button{width:100%}html.discord-activity .social-shell{height:calc(100dvh - 150px - env(safe-area-inset-top) - env(safe-area-inset-bottom))}}

/* Docked live chat sits beside the sidebar instead of occupying a page. */
.chat-dock{position:fixed;z-index:80;left:252px;bottom:14px;display:grid;justify-items:start;gap:8px;pointer-events:none}.chat-launchers{display:flex;gap:7px;pointer-events:auto}.chat-launchers button{display:flex;align-items:center;gap:8px;min-width:132px;height:42px;padding:0 14px;border:1px solid rgba(130,220,255,.38);background:rgba(3,13,20,.96);color:#ccebf5;font-size:.68rem;font-weight:800;letter-spacing:.05em;box-shadow:0 10px 30px rgba(0,0,0,.42);cursor:pointer}.chat-launchers button:hover,.chat-launchers button.active{border-color:var(--cuh-blue);background:linear-gradient(135deg,rgba(31,108,139,.95),rgba(7,31,43,.98));color:#fff}.chat-launchers svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.7}.chat-popover{width:min(440px,calc(100vw - 270px));height:min(590px,calc(100dvh - 86px));min-height:390px;pointer-events:auto}.chat-popover[hidden]{display:none!important}.chat-close{min-width:36px;padding:7px 11px!important;font-size:1.15rem!important}.chat-popover .social-messages{min-height:0}
@media(max-width:750px){.chat-dock{z-index:88;left:0;right:0;bottom:0;padding:0 8px calc(8px + env(safe-area-inset-bottom));justify-items:stretch}.chat-launchers{display:grid;grid-template-columns:1fr 1fr}.chat-launchers button{justify-content:center;min-width:0}.chat-popover{width:100%;height:calc(100dvh - 70px - env(safe-area-inset-top) - env(safe-area-inset-bottom));min-height:0;grid-template-rows:auto minmax(0,1fr) auto auto auto}.chat-popover .social-mentions{display:grid;grid-template-columns:1fr;gap:5px;max-height:min(210px,32dvh);padding:8px;overflow-x:hidden;overflow-y:auto}.chat-popover .social-mentions[hidden]{display:none}.chat-popover .social-mentions button{width:100%;min-width:0;justify-content:flex-start;text-align:left}.chat-popover .social-mentions button span{display:block;min-width:0;overflow:visible;white-space:normal;overflow-wrap:anywhere}.mobile-nav-open .chat-dock{display:none}html.discord-activity .chat-dock{bottom:0}html.discord-activity .chat-popover{height:calc(100dvh - 70px - env(safe-area-inset-top) - env(safe-area-inset-bottom))}}

/* Role previews retain the full Admin page geometry when restricted forms disappear. */
.split:has(>.admin-only-hidden),.crew-library-layout:has(>.crew-form-restricted){grid-template-columns:minmax(0,1fr)!important}.split:has(>.admin-only-hidden)>.entity-grid,.crew-library-layout:has(>.crew-form-restricted)>.entity-grid{grid-column:1/-1;width:100%}
.permission-readonly .split,.permission-readonly .battle-layout{grid-template-columns:minmax(0,1fr)!important}.permission-readonly .split>.entity-grid,.permission-readonly .split>.event-list,.permission-readonly .split>.points-list,.permission-readonly .battle-layout>.battle-list{grid-column:1/-1;width:100%;min-width:0}.permission-readonly .entity-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
.nav-item[hidden]{display:none!important}
.chat-launchers button b{display:grid;place-items:center;min-width:19px;height:19px;margin-left:auto;padding:0 5px;border-radius:10px;background:#6cdcff;color:#031019;font-size:.58rem}.chat-launchers button b.mention{background:#ffbf45}.social-meta strong:before{content:"";display:inline-block;width:7px;height:7px;margin-right:6px;border-radius:50%;background:#ef5151;box-shadow:0 0 8px rgba(239,81,81,.75)}.social-meta strong.online:before{background:#50efaf;box-shadow:0 0 8px #50efaf}
.chat-launchers button b[hidden]{display:none!important}
.crew-announcement{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:9px 13px;border-bottom:1px solid rgba(130,220,255,.18);background:linear-gradient(90deg,rgba(44,139,177,.22),rgba(4,17,24,.95))}.crew-announcement>div{display:grid;gap:2px;min-width:0}.crew-announcement b{color:#82dcff;font-size:.55rem;letter-spacing:.16em}.crew-announcement span{overflow:hidden;color:#dceaf0;font-size:.68rem;text-overflow:ellipsis;white-space:nowrap}.crew-announcement button{flex:0 0 auto;border:1px solid rgba(130,220,255,.25);background:#0b1b24;color:#aeeaff;padding:6px 8px;font-size:.58rem;cursor:pointer}
.events-layout{grid-template-columns:330px minmax(0,1fr)}.event-list{display:grid;gap:10px}.event-card{display:grid;grid-template-columns:72px minmax(0,1fr) auto;align-items:start;gap:18px}.event-card h3{margin:1px 0 5px;font:800 1.5rem var(--display);text-transform:uppercase}.event-card p:not(.eyebrow){margin:9px 0;color:#8ea1ab;font-size:.73rem;line-height:1.5}.event-date{display:grid;place-items:center;align-content:center;aspect-ratio:1;border:1px solid var(--cuh-line);background:rgba(7,24,33,.72)}.event-date strong{font:800 2rem/1 var(--display)}.event-date span{color:#82dcff;font-size:.58rem;letter-spacing:.15em}.event-actions{display:grid;gap:7px;min-width:110px}.event-attendees{display:flex;align-items:center;gap:5px;flex-wrap:wrap}.event-attendees span{padding:3px 6px;border:1px solid rgba(130,220,255,.18);color:#b8d9e5;font-size:.55rem}.event-attendees b{color:#718995;font-size:.58rem}.event-reminder{border-color:#82dcff;box-shadow:inset 0 0 28px rgba(76,196,239,.08)}
.achievement-section{margin-top:14px}.achievement-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}.achievement-card{display:grid;grid-template-columns:35px 1fr;gap:9px;padding:12px;border:1px solid rgba(130,220,255,.13);opacity:.58}.achievement-card.unlocked{border-color:rgba(130,220,255,.5);background:rgba(30,103,133,.14);opacity:1}.achievement-card>b{color:#82dcff;font-size:1.35rem}.achievement-card>div{display:grid;gap:4px}.achievement-card strong{font-size:.72rem;text-transform:uppercase}.achievement-card small,.achievement-card em{color:#7f929d;font-size:.55rem;font-style:normal}.achievement-card div>span{height:3px;background:#18262d}.achievement-card i{display:block;height:100%;background:#82dcff}
.audit-panel{margin-top:14px}.audit-list{display:grid;max-height:430px;overflow:auto}.audit-list article{display:grid;grid-template-columns:155px 170px minmax(0,1fr);gap:12px;padding:10px 4px;border-bottom:1px solid rgba(130,220,255,.12);font-size:.68rem}.audit-list article span{color:#718894}.audit-list article p{margin:0;color:#aebdc4}
.idle-video-overlay{position:fixed;z-index:500;inset:0;display:grid;place-items:center;overflow:hidden;background:transparent}.idle-video-overlay[hidden]{display:none}.idle-video-overlay video{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;opacity:.75}.idle-video-overlay span{position:absolute;bottom:calc(24px + env(safe-area-inset-bottom));left:50%;transform:translateX(-50%);padding:10px 16px;border:1px solid rgba(130,220,255,.5);background:rgba(2,9,14,.78);color:#d8f5ff;font-size:.65rem;letter-spacing:.12em;text-transform:uppercase;white-space:nowrap}
@media(max-width:750px){.events-layout{grid-template-columns:1fr}.event-card{grid-template-columns:58px minmax(0,1fr)}.event-actions{grid-column:1/-1;grid-template-columns:1fr auto auto}.achievement-grid{grid-template-columns:1fr}.audit-list article{grid-template-columns:1fr;gap:3px}.crew-announcement span{white-space:normal}.idle-video-overlay span{max-width:calc(100vw - 24px);white-space:normal;text-align:center}}

/* Six explicit rows: heading, compact announcement, messages, reply, mentions, composer. */
.chat-popover{grid-template-rows:auto auto minmax(0,1fr) auto auto auto}.crew-announcement{min-height:58px;max-height:72px;overflow:hidden}
.crew-announcement[hidden]{display:none!important}
@media(max-width:750px){.chat-popover{grid-template-rows:auto auto minmax(0,1fr) auto auto auto}}

/* Compact desktop navigation; mobile retains larger touch targets. */
@media(min-width:751px){.sidebar nav{align-content:start;grid-auto-rows:min-content;gap:2px;padding-inline:9px}.sidebar .nav-item{height:48px;min-height:48px;padding:10px 9px;grid-template-columns:22px 25px minmax(0,1fr);gap:9px;font-size:inherit;line-height:normal}.sidebar .nav-item svg{width:22px;height:22px}.sidebar .nav-item>span{font-size:.52rem!important}.sidebar-street-art{flex-basis:142px}}

/* Admin-only role perspective preview. */
.admin-perspective{display:flex;align-items:center;gap:6px;padding:4px 6px;border:1px solid rgba(130,220,255,.28);background:rgba(2,11,17,.88);box-shadow:inset 0 0 20px rgba(77,183,232,.05)}
.admin-perspective[hidden]{display:none!important}.admin-perspective>span{padding-inline:4px;color:#8edfff;font-size:.57rem;font-weight:800;letter-spacing:.12em;text-transform:uppercase;white-space:nowrap}.admin-perspective select{width:auto;min-width:112px;padding:7px 26px 7px 9px;font-size:.64rem}#admin-view-crew{min-width:138px}
@media(max-width:750px){.admin-perspective{grid-column:1/-1;width:100%}.admin-perspective>span{font-size:.54rem}.admin-perspective select{min-width:0!important;flex:1;padding-block:8px}}

/* Live racers */
.nav-item:has(.nav-live-count){position:relative;padding-right:42px!important}.nav-live-count{position:absolute;right:11px;top:50%;display:grid;place-items:center;min-width:20px;height:20px;margin:0;padding:0 6px;border-radius:10px;background:#ef3f4f;color:#fff;font-size:.55rem;line-height:1;transform:translateY(-50%);box-shadow:0 0 10px rgba(239,63,79,.46)}.nav-live-count[hidden]{display:none}.live-racer-status:empty{display:none}.live-racer-status{margin:0 0 12px;padding:10px 13px;border:1px solid rgba(255,191,69,.32);background:rgba(94,61,10,.22);color:#ffc96a;font-size:.68rem}.live-racer-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}.live-racer-card{display:grid;grid-template-rows:auto 1fr auto;border:1px solid var(--cuh-line);background:linear-gradient(145deg,rgba(7,22,31,.96),rgba(2,9,14,.95));box-shadow:0 18px 40px rgba(0,0,0,.3);overflow:hidden}.live-racer-thumb{position:relative;aspect-ratio:16/9;background-position:center;background-size:cover}.live-racer-thumb:after{content:"";position:absolute;inset:0;background:linear-gradient(0deg,rgba(2,9,14,.82),transparent 60%)}.live-racer-thumb span,.live-racer-thumb b{position:absolute;z-index:1;top:12px;padding:5px 8px;font-size:.56rem;letter-spacing:.1em;text-transform:uppercase}.live-racer-thumb span{left:12px;background:rgba(2,9,14,.84);color:#aeeaff}.live-racer-thumb b{right:12px;background:#e83749;color:#fff;box-shadow:0 0 16px rgba(232,55,73,.65)}.live-racer-info{display:grid;grid-template-columns:46px minmax(0,1fr);gap:11px;padding:14px}.live-racer-info img{width:46px;height:46px;border:1px solid var(--cuh-line);border-radius:50%;object-fit:cover}.live-racer-info h3{margin:0;font:800 1.15rem var(--display);text-transform:uppercase}.live-racer-info strong{color:#85dcfa;font-size:.62rem}.live-racer-info p{margin:8px 0 3px;color:#dbe7eb;font-size:.72rem}.live-racer-info small{color:#758b96;font-size:.58rem}.live-racer-card>button{margin:0 14px 14px}.live-racer-empty{grid-column:1/-1}.live-stream-dialog{width:min(1180px,calc(100vw - 36px));max-width:none;padding:0;border:1px solid var(--cuh-line);background:#02090e;color:#eaf7fb}.live-stream-dialog::backdrop{background:rgba(0,5,9,.88)}.live-stream-head{display:flex;align-items:center;justify-content:space-between;padding:14px 17px;border-bottom:1px solid var(--cuh-line)}.live-stream-head h3{margin:2px 0 0;font:800 1.3rem var(--display);text-transform:uppercase}.live-stream-frame{aspect-ratio:16/9;min-height:300px;background:#000}.live-stream-frame iframe{display:block;width:100%;height:100%;border:0}.live-stream-external{display:block;width:max-content;margin:12px 16px 16px;text-decoration:none}.battle-live-racers{display:flex;align-items:center;gap:5px;flex-wrap:wrap}.battle-live-racers button{padding:5px 7px;border:1px solid rgba(239,63,79,.58);background:rgba(111,15,29,.32);color:#ff9caa;font-size:.54rem;cursor:pointer}.battle-live-racers button:before{content:"";display:inline-block;width:6px;height:6px;margin-right:5px;border-radius:50%;background:#ef3f4f;box-shadow:0 0 8px #ef3f4f}
@media(max-width:1050px){.live-racer-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(max-width:750px){.live-racer-grid{grid-template-columns:1fr}.live-stream-dialog{width:calc(100vw - 16px)}.live-stream-frame{min-height:220px}.live-racer-info{padding:12px}}
.racer-search-bar{display:flex;align-items:end;justify-content:space-between;gap:14px;margin:0 0 14px;padding:12px 14px;border:1px solid var(--cuh-line);background:rgba(4,16,23,.88)}.racer-search-bar label{display:grid;gap:6px;width:min(520px,100%)}.racer-search-bar label span{color:#8edfff;font-size:.58rem;font-weight:800;letter-spacing:.12em;text-transform:uppercase}.racer-search-bar strong{padding-bottom:11px;color:#849aa5;font-size:.65rem;white-space:nowrap}@media(max-width:750px){.racer-search-bar{align-items:stretch;flex-direction:column}.racer-search-bar strong{padding:0}}

/* Match the Live Racers count to the active-user status and keep it compact. */
.nav-item:has(.nav-live-count){padding-right:38px!important}
.nav-live-count{min-width:16px;height:16px;padding:0 4px;border-radius:8px;background:#48efb1;color:#061016;font-size:.48rem;box-shadow:0 0 10px rgba(72,239,177,.52)}

/* A regular fixed overlay is more reliable than native modal dialogs inside Discord Activities. */
.stream-open{overflow:hidden}
.live-stream-overlay{position:fixed;z-index:10000;inset:0;display:grid;place-items:center;padding:18px;background:rgba(0,5,9,.88);backdrop-filter:blur(8px)}
.live-stream-overlay[hidden]{display:none}
.live-stream-overlay>.live-stream-dialog{width:min(1180px,calc(100vw - 36px));max-height:calc(100dvh - 36px);overflow:auto;border:1px solid var(--cuh-line);background:#02090e;box-shadow:0 28px 90px rgba(0,0,0,.72)}
@media(max-width:750px){.live-stream-overlay{padding:8px}.live-stream-overlay>.live-stream-dialog{width:calc(100vw - 16px);max-height:calc(100dvh - 16px)}}
.discord-stream-fallback{position:relative;display:grid;min-height:420px;place-items:center;background-position:center;background-size:cover;isolation:isolate}
.discord-stream-fallback:before{content:"";position:absolute;z-index:-1;inset:0;background:linear-gradient(180deg,rgba(1,7,11,.48),rgba(1,7,11,.94));backdrop-filter:blur(3px)}
.discord-stream-fallback>div{display:grid;width:min(540px,calc(100% - 36px));gap:12px;padding:28px;border:1px solid rgba(130,220,255,.32);background:rgba(3,13,19,.9);text-align:center;box-shadow:0 20px 60px rgba(0,0,0,.52)}
.discord-stream-fallback b{font:800 clamp(1.6rem,4vw,3rem) var(--display);text-transform:uppercase}.discord-stream-fallback span{color:#a8bbc4;font-size:.78rem;line-height:1.5}.discord-stream-fallback button{justify-self:center;margin-top:6px}
@media(max-width:750px){.discord-stream-fallback{min-height:300px}}

/* Centred confirmation prompt matching the Race Hub interface. */
#confirm-dialog{width:min(430px,calc(100vw - 28px));max-width:430px;margin:auto;padding:0;border:1px solid var(--cuh-line);background:linear-gradient(145deg,rgba(7,22,31,.99),rgba(2,9,14,.99));color:#eaf7fb;box-shadow:0 28px 90px rgba(0,0,0,.78),0 0 28px rgba(130,220,255,.08)}
#confirm-dialog::backdrop{background:rgba(0,5,9,.78);backdrop-filter:blur(8px)}
#confirm-dialog form{padding:28px}
#confirm-dialog .eyebrow{color:#82dcff;font-size:.68rem;letter-spacing:.2em}
#confirm-dialog h3{margin:5px 0 10px;font:800 1.65rem var(--display);letter-spacing:.03em;text-transform:uppercase}
#confirm-dialog #confirm-copy{margin:0;color:#98adb7;font-size:.78rem;line-height:1.6}
#confirm-dialog form>div{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:24px}
#confirm-dialog button{min-height:44px;border-radius:0;text-transform:uppercase;letter-spacing:.06em}
#confirm-dialog .danger{border:1px solid #ff6270;background:linear-gradient(135deg,#a32131,#dc3749);box-shadow:0 8px 24px rgba(220,55,73,.22)}
#confirm-dialog .ghost{border:1px solid rgba(130,220,255,.2);background:rgba(12,29,39,.78);color:#bfd0d7}

/* Crew announcements open in a centred, system-styled viewer/editor. */
.crew-announcement[data-open-announcement]{cursor:pointer}
#announcement-dialog{width:min(560px,calc(100vw - 28px));max-width:560px;margin:auto;padding:0;border:1px solid var(--cuh-line);background:linear-gradient(145deg,rgba(7,22,31,.99),rgba(2,9,14,.99));color:#eaf7fb;box-shadow:0 28px 90px rgba(0,0,0,.78),0 0 34px rgba(130,220,255,.09)}
#announcement-dialog::backdrop{background:rgba(0,5,9,.78);backdrop-filter:blur(8px)}
#announcement-dialog form{padding:28px}
#announcement-dialog .eyebrow{color:#82dcff;font-size:.68rem;letter-spacing:.2em}
#announcement-dialog h3{margin:5px 0 18px;font:800 1.75rem var(--display);letter-spacing:.03em;text-transform:uppercase}
#announcement-dialog textarea{min-height:130px;resize:vertical;border:1px solid rgba(130,220,255,.28);border-radius:0;background:rgba(1,9,14,.72);color:#dceaf0;line-height:1.6}
#announcement-dialog textarea[readonly]{cursor:default}
#announcement-dialog form>div{display:flex;justify-content:flex-end;gap:10px;margin-top:18px}
#announcement-dialog button{min-height:44px;border-radius:0;text-transform:uppercase;letter-spacing:.05em}
