.control-bindings{display:grid;gap:0;margin-top:16px}.control-binding-row{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 0;border-bottom:1px solid #3c5560}.control-binding-row>span{font-size:12px;color:#c1d4dd}.control-binding-keys{display:flex;align-items:center;justify-content:flex-end;gap:6px;min-width:145px}.control-key{padding:8px 10px;min-width:55px;min-height:36px;border:1px solid #506b77;color:#dce9ec;background:#1a303b;font:600 11px Manrope,sans-serif;cursor:pointer}.control-key:hover,.control-key:focus-visible{border-color:#e8bc73;color:#ffd595}.control-key.is-capturing{background:#e5b25c;color:#17252d;border-color:#ffc969;animation:control-pulse 1s ease-in-out infinite alternate}.control-key-remove{border:0;background:none;color:#a6bec9;cursor:pointer;width:22px;height:30px;font-size:17px}.control-capture-status{font-size:12px;line-height:1.6;color:#f0c484;min-height:20px;margin-top:12px}.control-swap{margin:8px 0 15px;min-height:35px;font-size:11px}.microphone-actions{display:flex;flex-wrap:wrap;gap:8px;margin:12px 0}.microphone-actions button{font-size:11px;min-height:34px;padding:8px 10px}.microphone-meter{height:9px;background:#152733;border:1px solid #48616c;overflow:hidden;margin:16px 0 8px}.microphone-meter>i{display:block;width:0;height:100%;background:linear-gradient(90deg,#7eb7a2,#b6d59c 70%,#f0c46e);transition:width 80ms linear}.voice-peer-settings{display:grid;gap:14px;margin-top:20px}.voice-peer-setting{display:grid;grid-template-columns:minmax(0,1fr) 45px 78px;align-items:center;gap:8px 12px;padding-bottom:14px;border-bottom:1px solid #3e5863}.voice-peer-setting>strong{font-size:12px;overflow-wrap:anywhere}.voice-peer-setting>output{font-size:11px;color:#9eb8c6;text-align:right}.voice-peer-setting>input{grid-column:1/3;grid-row:2}.voice-peer-setting>button{grid-column:3;grid-row:1/3;min-height:35px;font-size:10px;padding:8px}.voice-peer-setting>button[aria-pressed=true]{border-color:#e9bb6c;background:#6c4a252f;color:#ffd089}.microphone-settings .field-hint{line-height:1.7}.gamepad-state{color:#c4d6db!important;overflow-wrap:anywhere}.gamepad-settings .range-label{margin-top:17px}.gamepad-settings .field-hint{line-height:1.75}.settings-dialog .setting-select select{min-width:0;max-width:70%}.settings-dialog .setting-select{gap:14px}@keyframes control-pulse{to{box-shadow:0 0 15px #e6ba663f}}@media(prefers-reduced-motion:reduce){.control-key.is-capturing{animation:none}.microphone-meter>i{transition:none}}@media(max-width:520px){.control-binding-row>span{font-size:11px;max-width:42%}.control-binding-keys{min-width:134px;gap:5px}.control-key{min-width:46px;padding:8px 6px;font-size:10px}.settings-dialog .setting-select{display:grid;grid-template-columns:minmax(0,1fr)}.settings-dialog .setting-select select{max-width:100%;width:100%}.control-settings .setting-section-title{flex-wrap:wrap;gap:8px}.control-settings .setting-section-title h3{flex:1}.voice-peer-setting{grid-template-columns:minmax(0,1fr) 35px 70px;gap:8px}}

.music-playlist{display:grid;gap:8px;margin:12px 0 16px}
.music-playlist .setting-select{margin:0}
.music-playlist [data-custom-music]:not([hidden]){display:grid;gap:9px}
.music-playlist [hidden]{display:none}
.music-playlist .field-hint{margin:0;font-size:12px;line-height:1.55}
.music-playlist .music-library-status:empty{display:none}
.music-playlist-actions{display:flex;flex-wrap:wrap;gap:8px}
.music-playlist .secondary{min-height:40px;padding:8px 13px;font-size:13px;border-radius:4px}
.music-track-library{min-width:0;border:1px solid #465d69;border-radius:4px;padding:0 10px}
.music-track-library summary{padding:9px 0;cursor:pointer;font-size:13px;color:#c5d6dd}
.music-track-library ol{max-height:180px;overflow:auto;list-style:none;padding:0;margin:0}
.music-track-library li{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:5px 0;border-top:1px solid #344d59;color:#d9e7ea;font-size:13px}
.music-track-library li>span{min-width:0;overflow-wrap:anywhere}
.music-track-library button{flex:none;padding:5px 3px;min-height:34px}


/* The menu frame and its navigation stay in view when the form scrolls. */
.garage-sheet {
  --sheet-base: #141f24;
  --sheet-deck: #1b2b32;
  --sheet-field: #111f27;
  --sheet-edge: #3a515a;
  --sheet-text: #e9f0ee;
  --sheet-muted: #a9bcc3;
  box-shadow: 0 24px 80px #060a0db8;
}
.garage-sheet > .sheet-heading {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 44px;
  align-items: center;
  gap: 12px;
  padding: 11px 20px;
  min-height: 0;
  background: #22343b;
  border-bottom: 1px solid var(--sheet-edge);
  flex: none;
}
.garage-sheet .sheet-heading h2 { font: 600 clamp(23px, 3.4vw, 33px)/1.14 Oswald, Impact, sans-serif; color: var(--sheet-text); letter-spacing: 0; margin: 0; }
.garage-sheet .sheet-heading .icon-button { min-width: 42px; min-height: 42px; }
.garage-sheet .sheet-heading form { margin: 0; }
.sheet-sign { width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid #866f48; border-radius: 6px; background: #a473321a; color: var(--amber-bright); }
.sheet-sign .icon { width: 21px; height: 21px; flex-basis: auto; }
.settings-dialog[open] {
  display: flex;
  flex-direction: column;
  width: min(882px, calc(100vw - 24px));
  max-width: none;
  max-height: calc(100dvh - 24px);
  overflow: hidden;
  padding: 0;
  background: var(--sheet-base);
  border: 1px solid var(--sheet-edge);
}
.settings-layout { flex: 1 1 auto; min-height: 0; display: grid; grid-template-rows: auto minmax(0, 1fr); }
.settings-sections {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 3px;
  padding: 4px 8px 0;
  border-bottom: 1px solid var(--sheet-edge);
  background: #111b20;
}
.settings-tab {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 47px;
  min-width: 0;
  padding: 6px 5px;
  border: 1px solid transparent;
  border-bottom-width: 2px;
  border-top-left-radius: 4px;
  border-top-right-radius: 4px;
  background: transparent;
  color: #b6c8cf;
  font-size: 13px;
  font-weight: 750;
}
.settings-tab .icon { width: 18px; height: 18px; flex: 0 0 18px; }
.settings-tab:hover { background: #26363e; color: var(--white); }
.settings-tab[aria-selected="true"] { border-bottom-color: var(--amber); background: #f3ae4214; color: var(--amber-bright); }
.settings-tab:focus-visible { outline-offset: -3px; }
.settings-dialog .settings-body {
  padding: clamp(12px, 3vw, 22px);
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  background: var(--sheet-base);
}
.settings-pane { min-width: 0; }
.settings-pane:not([hidden]) { display: grid; gap: 10px; align-content: start; }
.settings-dialog .settings-pane section + section { margin: 0; }
.settings-dialog .settings-body .settings-block {
  display: grid;
  gap: 13px;
  min-width: 0;
  background: var(--sheet-deck);
  border: 1px solid var(--sheet-edge);
  border-radius: 6px;
  padding: clamp(12px, 2.5vw, 19px);
}
.settings-block-title, .settings-block .setting-section-title h3 {
  color: var(--sheet-text);
  font: 550 22px/1.15 Oswald, Impact, sans-serif;
}
.settings-block .setting-section-title { margin: 0; min-height: 24px; }
.settings-block .setting-section-title .text-button { color: #f1c47f; padding: 4px 9px; font-size: 11.5px; }
.settings-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 14px 18px;
}
.settings-fields > .settings-wide { grid-column: 1 / -1; }
.settings-field { min-width: 0; }
.settings-pane .setting-select {
  display: grid;
  align-content: start;
  grid-template-columns: minmax(0, 1fr);
  gap: 6px;
  margin: 0;
  color: var(--sheet-text);
  font-size: 13px;
  font-weight: 650;
}
.settings-pane .setting-select select {
  max-width: none;
  width: 100%;
  min-width: 0;
  min-height: 43px;
  font-size: 13px;
  border-radius: 4px;
  border-color: #536e79;
  background: var(--sheet-field);
  color: var(--sheet-text);
  padding: 8px 9px;
  text-overflow: ellipsis;
}
.settings-pane .setting-select:has(input[type="checkbox"]) {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 44px;
  padding: 0 8px 0 0;
}
.settings-pane .setting-select input[type="checkbox"] { width: 19px; height: 19px; flex: 0 0 19px; accent-color: var(--amber); margin: 0; }
.settings-pane .field-hint { color: var(--sheet-muted); font: 500 12px/1.45 Manrope,Arial,sans-serif; margin: 0; }
.settings-pane .settings-field > .field-hint { margin-top: 6px; }
.settings-pane :is([data-graphics-auto-status],.control-capture-status):empty { display: none; }
.settings-range { min-width: 0; display: grid; gap: 3px; align-content: center; }
.settings-pane .range-label { margin: 0; color: var(--sheet-text); font-size: 13px; font-weight: 650; }
.settings-pane .range-label output { font-size: 12px; color: #efc386; }
.settings-pane .settings-range .range { margin: 0; height: 26px; }
.settings-pane .music-playlist { margin: 0; }
.settings-pane .music-playlist select { max-width: none; }
.settings-pane .music-playlist-actions .secondary { min-height: 44px; }
.settings-disclosure, .settings-pane .resource-cache {
  background: #19272e;
  border: 1px solid var(--sheet-edge);
  border-radius: 6px;
  padding: 0 13px;
  margin: 0;
  min-width: 0;
}
.settings-disclosure summary, .settings-pane .resource-cache > summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  min-height: 46px;
  color: #d3e2e4;
  font-size: 13px;
  font-weight: 750;
  cursor: pointer;
  list-style: none;
}
.settings-disclosure summary::-webkit-details-marker, .settings-pane .resource-cache summary::-webkit-details-marker { display: none; }
.settings-disclosure summary::after, .settings-pane .resource-cache > summary::after {
  content: "";
  flex: none;
  width: 8px;
  height: 8px;
  margin-inline-end: 4px;
  border: 0 solid #b7c8cb;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) translateY(-2px);
}
.settings-disclosure[open] summary::after, .settings-pane .resource-cache[open] > summary::after { transform: rotate(225deg); }
.settings-disclosure[open] > summary, .settings-pane .resource-cache[open] > summary { border-bottom: 1px solid var(--sheet-edge); }
.settings-disclosure .graphics-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 18px;
  padding: 13px 0;
}
.settings-disclosure .graphics-options > :is(.settings-range,.field-hint) { grid-column: 1 / -1; }
.settings-disclosure > p, .settings-pane .resource-cache > :is(.field-hint,.cache-actions) { margin: 10px 0; }
.settings-pane .resource-cache .cache-actions { display: flex; flex-wrap: wrap; }
.settings-pane .microphone-check { padding: 10px 0 0; border-top: 1px solid var(--sheet-edge); }
.settings-pane .microphone-check .microphone-actions { margin: 0 0 8px; }
.settings-pane .microphone-check .microphone-meter { margin: 6px 0 8px; }
.settings-pane .voice-listening .voice-peer-settings:empty { display: none; }
.settings-pane .voice-peer-settings > * { min-width: 0; }
.settings-pane .voice-peer-setting strong { overflow-wrap: anywhere; }
.settings-devices { display: grid; gap: 12px; }
.settings-device-choices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; padding: 4px; border: 1px solid var(--sheet-edge); background: #0f191e; border-radius: 6px; }
.settings-device-choices button {
  min-height: 42px;
  min-width: 0;
  padding: 6px 4px;
  color: #b9c9ce;
  font: 700 12px/1.2 Manrope,Arial,sans-serif;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 4px;
}
.settings-device-choices button:hover { color: var(--white); background: #21323a; }
.settings-device-choices button[aria-pressed="true"] { border-color: #8c744b; color: #ffd190; background: #403624; }
.settings-device-panels[data-active-device="keyboard"] > :not(.control-settings),
.settings-device-panels[data-active-device="touch"] > :not(.touch-settings),
.settings-device-panels[data-active-device="gamepad"] > :not(.gamepad-settings) { display: none; }
.settings-pane .control-settings { container: settings-keys / inline-size; }
.settings-pane .control-bindings { margin-top: 0; }
@container settings-keys (min-width: 555px) {
  .settings-pane .control-bindings { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 22px; }
  .settings-pane .control-binding-row:nth-last-child(-n + 2) { border-bottom-color: transparent; }
}
.settings-pane .control-binding-row { padding: 5px 0; }
.settings-pane .control-binding-row:last-child { border-bottom: 0; }
.settings-pane .control-binding-keys {
  display: grid;
  grid-template-columns: repeat(2, minmax(55px, 72px)) 25px;
  min-width: 0;
  flex: 0 0 auto;
}
.settings-pane .control-key, .settings-pane .control-key-remove { min-height: 40px; }
.settings-pane .control-key { min-width: 0; padding-inline: 5px; line-height: 1.15; }
.settings-pane .control-key-remove { width: 25px; }
.control-edit-feedback { position: sticky; top: -1px; z-index: 1; background: var(--sheet-deck); }
.control-edit-feedback:has(.control-capture-status:empty):not(:has(.control-swap:not([hidden]))) { display: none; }
.settings-pane .control-edit-feedback .control-capture-status { margin: 4px 0; }
.settings-pane .control-edit-feedback .control-swap { margin-bottom: 4px; }

.settings-dialog > .dialog-footer {
  flex: none;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  padding: 8px clamp(12px, 3vw, 22px);
  background: #19282f;
  border-top: 1px solid var(--sheet-edge);
}
.settings-dialog > .dialog-footer .hot { width: auto; min-width: 107px; min-height: 43px; padding: 7px 12px; }
.settings-dialog > .dialog-footer > p { font-size: 11px; color: var(--sheet-muted); }
.settings-dialog > .dialog-footer > p[data-save-state="error"] { color: var(--red); }
@media (min-width: 720px), (min-width: 560px) and (orientation: landscape) {
  .settings-layout { grid-template-columns: minmax(136px, 21%) minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); }
  .settings-sections {
    grid-template-columns: minmax(0, 1fr);
    grid-auto-rows: min-content;
    align-content: start;
    gap: 4px;
    padding: 12px 8px;
    border-bottom: 0;
    border-right: 1px solid var(--sheet-edge);
  }
  .settings-tab { min-height: 46px; gap: 9px; justify-content: flex-start; padding-inline: 9px; border-width: 1px; border-inline-start-width: 3px; border-radius: 4px; }
  .settings-tab[aria-selected="true"] { border-color: #7a673d66; border-inline-start-color: var(--amber); }
}
@media (max-width: 559px) and (orientation: portrait), (max-width: 540px) {
  .settings-dialog[open] { width: calc(100vw - 16px); }
  .settings-tab { flex-direction: column; min-height: 51px; gap: 3px; font-size: 11px; }
  .settings-fields, .settings-disclosure .graphics-options { grid-template-columns: minmax(0, 1fr); gap: 12px; }
}
@media (max-height: 510px) and (orientation: landscape) {
  .settings-dialog[open] { max-height: calc(100dvh - 12px); }
  .garage-sheet > .sheet-heading { grid-template-columns: 36px minmax(0, 1fr) 42px; padding: 4px 13px; gap: 8px; }
  .garage-sheet .sheet-sign { width: 36px; height: 36px; }
  .garage-sheet .sheet-heading h2 { font-size: 23px; }
  .garage-sheet .sheet-heading .icon-button { width: 42px; height: 42px; min-height: 42px; }
  .settings-sections { padding-block-start: 7px; }
  .settings-tab { min-height: 43px; }
  .settings-dialog .settings-body { padding: 10px 12px; }
  .settings-dialog > .dialog-footer { padding-block: 4px; }
}


/* Driver identity, garage progress and account controls share the menu frame. */
.profile-dialog[open] {
  display: flex;
  flex-direction: column;
  width: min(788px, calc(100vw - 24px));
  max-width: none;
  max-height: calc(100dvh - 24px);
  overflow: hidden;
  padding: 0;
  background: var(--sheet-base);
  border: 1px solid var(--sheet-edge);
  color: var(--sheet-text);
}
.profile-dialog .profile-summary {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 12px clamp(14px, 3vw, 22px);
  margin: 0;
  background: #1a2a31;
  flex: none;
}
.profile-dialog .profile-avatar {
  height: 46px;
  width: 46px;
  border-radius: 6px;
  background: #13222a;
  border: 1px solid #6c6045;
  color: #f0c182;
  font: 550 27px/1 Oswald, Impact, sans-serif;
}
.profile-dialog .profile-avatar .icon { width: 22px; height: 22px; }
.profile-dialog .profile-display { font: 600 clamp(19px, 3vw, 26px)/1.2 Manrope,Arial,sans-serif; }
.profile-dialog .profile-account-state { font-size: 12px; color: var(--sheet-muted); margin-top: 2px; overflow-wrap: anywhere; }
.profile-dialog .profile-summary .profile-emblem { display: flex; align-items: center; gap: 6px; margin: 4px 0 0; font-size: 11px; }
.profile-dialog .profile-summary .profile-emblem .journey-emblem { width: 20px; height: 20px; }
.profile-dialog .profile-account-shortcut { min-height: 42px; padding: 5px 13px; white-space: nowrap; color: #ffcd8b; }
.profile-navigation {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 0 10px;
  border-bottom: 1px solid var(--sheet-edge);
  background: #111b20;
  flex: none;
}
.profile-navigation [role="tab"] {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 45px;
  min-width: 0;
  padding: 5px;
  color: #b6c8cf;
  border: none;
  border-bottom: 2px solid transparent;
  background: transparent;
  font-size: 13px;
  font-weight: 750;
}
.profile-navigation [role="tab"] .icon { width: 17px; height: 17px; flex: 0 0 17px; }
.profile-navigation [role="tab"]:hover { background: #22343b; color: var(--sheet-text); }
.profile-navigation [aria-selected="true"] { border-color: var(--amber); color: var(--amber-bright); background: #f3ae4214; }
.profile-navigation [role="tab"]:focus-visible { outline-offset: -3px; }

.profile-layout { flex: 1 1 auto; min-height: 0; display: grid; grid-template-rows: auto minmax(0, 1fr); }
.profile-dialog .profile-body {  padding: clamp(12px, 3vw, 22px);
  min-height: 0;
  min-width: 0;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  flex: 1 1 auto;
}
.profile-pane:not([hidden]) { display: grid; align-content: start; gap: 12px; min-width: 0; }
.profile-panel {
  background: var(--sheet-deck);
  border: 1px solid var(--sheet-edge);
  border-radius: 6px;
  padding: clamp(13px, 2.5vw, 18px);
  min-width: 0;
}
.profile-dialog .profile-panel h3 {
  color: var(--sheet-text);
  font: 550 22px/1.15 Oswald, Impact, sans-serif;
}
.profile-dialog .profile-pane .profile-numbers {
  margin: 0;
  padding: 11px 0;
  border: 1px solid var(--sheet-edge);
  border-radius: 6px;
  background: var(--sheet-deck);
}
.profile-dialog .profile-numbers > div { min-width: 0; padding: 2px 12px; border-left-color: var(--sheet-edge); }
.profile-dialog .profile-numbers > div:first-child { padding-left: 12px; }
.profile-dialog .profile-pane .profile-numbers strong { font-size: clamp(25px, 4vw, 34px); overflow-wrap: anywhere; }
.profile-dialog .profile-pane .profile-numbers span { color: var(--sheet-muted); font-size: 11px; margin-top: 4px; letter-spacing: 0; }
.profile-dialog .career-progress {
  grid-template-columns: minmax(0, 1fr) minmax(0, 44%);
  gap: 9px 16px;
  align-items: center;
  min-height: 0;
  padding: 14px 17px 11px;
  margin: 0;
  border: 1px solid #496571;
  border-radius: 6px;
  background: radial-gradient(ellipse at 83% 37%, #36555c 0, transparent 62%), #1a2c35;
}
.profile-dialog .career-progress:not(:has(img)) { grid-template-columns: minmax(0, 1fr); }
.profile-dialog .career-progress img { width: 100%; height: auto; max-height: 112px; grid-area: 1 / 2; mix-blend-mode: normal; filter: drop-shadow(0 10px 8px #08161d9c); }
.profile-dialog .career-progress-copy { grid-area: 1 / 1; min-width: 0; }
.profile-dialog .career-progress-copy strong { font-size: clamp(25px, 4vw, 37px); line-height: 1.12; color: var(--sheet-text); margin-top: 3px; overflow-wrap: anywhere; }
.profile-dialog .career-progress-label { color: #d3b280; font-size: 12px; font-weight: 700; }
.profile-dialog .career-progress-copy > span { font-size: 12px; color: var(--sheet-muted); margin: 5px 0; }
.profile-dialog .career-progress .career-track { height: 6px; margin-top: 8px; background: #102127; }
.profile-dialog .career-unlocked { color: var(--sheet-muted); font-size: 11px; padding-top: 8px; margin: 0; }
.profile-dialog .career-ladder {
  margin: 0;
  padding: 0 14px;
  background: var(--sheet-deck);
  border: 1px solid var(--sheet-edge);
  border-radius: 6px;
}
.profile-dialog .career-ladder > summary,
.profile-dialog .profile-panel > summary { min-height: 44px; padding: 11px 0; font: 750 13px/1.4 Manrope,Arial,sans-serif; color: var(--sheet-text); cursor: pointer; }
.profile-dialog .career-ladder[open] { padding-bottom: 12px; }
.profile-overview-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.profile-dialog .profile-overview-actions .secondary { width: 100%; min-height: 44px; margin: 0; padding: 8px 10px; text-align: center; justify-content: center; font-size: 12px; white-space: normal; }

.profile-dialog .profile-auth-note { margin: 5px 0 12px; font-size: 12px; color: var(--sheet-muted); }
.profile-auth-modes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  width: min(100%, 350px);
  margin-bottom: 13px;
  padding: 4px;
  border: 1px solid var(--sheet-edge);
  border-radius: 6px;
  background: #101b20;
}
.profile-auth-modes button {
  min-height: 39px;
  min-width: 0;
  padding: 6px 5px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 4px;
  color: var(--sheet-muted);
  font-size: 12px;
  font-weight: 750;
}
.profile-auth-modes button:hover:not(:disabled) { background: #27363d; color: var(--sheet-text); }
.profile-auth-modes button[aria-pressed="true"] { border-color: #8d744d; background: #423725; color: #ffd190; }
.profile-dialog .profile-form { gap: 12px 15px; }
.profile-dialog :is(.profile-form > label:not(.profile-transfer), .profile-contact label, .recovery-renew form label) {
  display: grid;
  gap: 5px;
  min-width: 0;
  font-size: 13px;
  font-weight: 650;
  color: var(--sheet-text);
}
.profile-dialog input:not([type="checkbox"]) {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  border: 1px solid #516d79;
  border-radius: 4px;
  background: var(--sheet-field);
  color: var(--sheet-text);
  font-size: 14px;
  font-weight: 550;
  padding: 8px 11px;
}
.profile-dialog input:not([type="checkbox"]):focus { border-color: var(--amber); box-shadow: 0 0 0 2px #f3ae4222; }
.profile-dialog .profile-transfer { cursor: pointer; color: var(--sheet-muted); gap: 8px; min-height: 34px; font-size: 12px; }
.profile-transfer input { accent-color: var(--amber); width: 17px; height: 17px; margin: 0; }
.profile-form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 13px; grid-column: 1 / -1; }
.profile-dialog .profile-form-actions .hot { width: auto; min-height: 44px; padding: 7px 16px; font-size: 13px; }
.profile-dialog .profile-form-actions .text-button { color: #d3e2e4; margin: 0; padding: 6px 2px; min-height: 44px; font-size: 12px; }

.profile-session-line { display: flex; justify-content: space-between; align-items: end; gap: 12px; margin-top: 10px; }
.profile-session-line dl { margin: 0; min-width: 0; }
.profile-session-line dt { font-size: 12px; color: var(--sheet-muted); }
.profile-session-line dd { margin: 2px 0 0; color: var(--sheet-text); font-size: 16px; font-weight: 800; overflow-wrap: anywhere; }
.profile-session-line .profile-logout { color: #ffbfad; }
.profile-session-note { color: var(--sheet-muted); font-size: 12px; margin-top: 8px; }
.profile-dialog .profile-contact {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 8px 12px;
  margin-top: 10px;
}
.profile-dialog .profile-contact p { grid-column: 1 / -1; color: var(--sheet-muted); font-size: 12px; line-height: 1.45; }
.profile-dialog :is(.profile-panel, .profile-session-line) .secondary { min-height: 44px; padding: 7px 12px; font-size: 12px; }
.profile-dialog .profile-panel .profile-recover { white-space: normal; }
.profile-dialog .profile-panel.profile-recovery { margin: 0; background: #2e2a20; border-color: #937345; }
.profile-dialog .profile-recovery p, .profile-dialog .profile-panel > p { font-size: 12px; }
.profile-dialog details.profile-panel { padding-block: 0; margin: 0; }
.profile-dialog details.profile-panel[open] { padding-bottom: 14px; }
.profile-dialog details.profile-panel > form { display: flex; align-items: end; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.profile-dialog details.profile-panel > form :is(label,input) { flex: 1 1 190px; min-width: 0; }
.profile-dialog .profile-status { flex: none; margin: 0; border-top: 1px solid var(--sheet-edge); background: #17252c; padding: 8px 14px; font-size: 12px; color: #cfe7d4; }
.profile-dialog .profile-status.error { color: #ffb79f; }

.profile-dialog .profile-history { margin: 0; }
.profile-dialog .profile-section-heading { align-items: baseline; margin-bottom: 7px; }
.profile-dialog .profile-section-heading > span { color: var(--sheet-muted); font-size: 11px; text-align: right; }
:is(.profile-dialog, .visitor-dialog) .history-list li {
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px 13px;
  align-items: center;
}
:is(.profile-dialog, .visitor-dialog) .history-list li:last-child { border-bottom: none; }
:is(.profile-dialog, .visitor-dialog) .history-list li strong { font-size: 13px; color: var(--sheet-text); overflow-wrap: anywhere; }
:is(.profile-dialog, .visitor-dialog) .history-list li small, :is(.profile-dialog, .visitor-dialog) .history-list time { font-size: 11px; color: var(--sheet-muted); }
:is(.profile-dialog, .visitor-dialog) .history-list li .history-damage { color: var(--amber-bright); white-space: nowrap; }
:is(.profile-dialog, .visitor-dialog) .history-list li.history-empty { display: block; padding: 14px; color: var(--sheet-muted); background: #132229; border: 1px dashed var(--sheet-edge); border-radius: 5px; font-size: 13px; }
.profile-dialog .profile-mode-records:empty { display: none; }

@media (max-width: 570px) {
}
@media (max-width: 480px) {
  .profile-dialog .profile-summary { padding-block: 9px; }
  .profile-dialog .profile-pane { gap: 9px; }
  .profile-dialog .profile-panel { padding: 11px 12px; }
  .profile-dialog .profile-auth-note { margin: 4px 0 8px; line-height: 1.4; }
  .profile-auth-modes { margin-bottom: 9px; }
  .profile-dialog .profile-form { row-gap: 8px; }
  .profile-dialog .profile-contact { grid-template-columns: minmax(0, 1fr); margin-top: 7px; row-gap: 6px; }
  .profile-dialog .profile-contact p { grid-row: 2; }
  .profile-dialog .profile-contact .secondary { justify-self: start; grid-row: 3; }
}
@media (max-width: 385px) {
  :is(.profile-dialog, .visitor-dialog) .history-list .history-car { width: 49px; height: auto; }
}
@media (max-width: 480px) and (max-height: 620px) {
  .profile-dialog:has(#profile-pane-account:not([hidden])) > .sheet-heading {
    grid-template-columns:32px minmax(0,1fr) auto;
    gap:7px;
    padding:6px 10px;
  }
  .profile-dialog:has(#profile-pane-account:not([hidden])) .sheet-heading h2 { font-size:21px }
  .profile-dialog:has(#profile-pane-account:not([hidden])) .sheet-sign { width:32px;height:32px }
  .profile-dialog:has(#profile-pane-account:not([hidden])) .profile-summary { padding:5px 12px }
  .profile-dialog:has(#profile-pane-account:not([hidden])) .profile-avatar { display:none }
  .profile-dialog:has(#profile-pane-account:not([hidden])) .profile-identity { display:flex;flex-wrap:wrap;align-items:baseline;gap:1px 7px }
  .profile-dialog:has(#profile-pane-account:not([hidden])) .profile-display { font-size:14px }
  .profile-dialog:has(#profile-pane-account:not([hidden])) :is(.profile-account-state,.profile-emblem) { margin:0;font-size:11px }
  .profile-dialog:has(#profile-pane-account:not([hidden])) .profile-body { padding:8px }
  .profile-dialog .profile-auth { padding:9px }
  .profile-dialog .profile-auth h3 { font-size:20px }
  .profile-dialog .profile-auth-modes { margin-bottom:6px;padding:3px }
  .profile-dialog .profile-auth .profile-form { row-gap:6px }
  .profile-dialog .profile-auth .profile-form > label:not(.profile-transfer) { gap:3px }
  .profile-dialog .profile-transfer { min-height:28px }
  .profile-dialog .profile-form-actions { gap:4px 10px }
}
@media (pointer:coarse) {
  .profile-dialog input:not([type="checkbox"]) { font-size:16px }
}
@media (max-height: 510px) and (orientation: landscape) {
  .profile-dialog[open] { max-height: calc(100dvh - 12px); }
  .profile-dialog .profile-summary { padding-block: 5px; }
  .profile-dialog .profile-display { font-size: 19px; }
  .profile-dialog .profile-avatar { width: 37px; height: 37px; font-size: 21px; }
  .profile-navigation [role="tab"] { min-height: 42px; }
  .profile-dialog .profile-body { padding: 10px 13px; }
  .profile-dialog .profile-panel { padding: 11px 13px; }
  .profile-dialog .profile-auth-note { margin: 4px 0 8px; }
}
@media (min-width: 560px) and (max-height: 510px) and (orientation: landscape) {
  .profile-layout { grid-template-columns: minmax(110px, 18%) minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); }
  .profile-navigation {
    grid-template-columns: minmax(0, 1fr);
    grid-auto-rows: min-content;
    align-content: start;
    gap: 4px;
    padding: 8px;
    border-bottom: 0;
    border-right: 1px solid var(--sheet-edge);
  }
  .profile-navigation [role="tab"] {
    justify-content: flex-start;
    padding-inline: 8px;
    border: 1px solid transparent;
    border-inline-start-width: 3px;
    border-radius: 4px;
  }
  .profile-navigation [aria-selected="true"] { border-color: #7a673d66; border-inline-start-color: var(--amber); }
  .profile-dialog .profile-auth:not([hidden]) {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(210px, 46%);
    align-items: center;
    gap: 5px 12px;
  }
  .profile-auth .profile-auth-modes { grid-area: 1 / 2; width: 100%; margin: 0; padding: 3px; }
  .profile-auth .profile-auth-note, .profile-auth .profile-form { grid-column: 1 / -1; }
  .profile-auth:has(.recovery-field:not([hidden])) h3 { grid-column: 1 / -1; }
  .profile-dialog .profile-auth .profile-form { gap: 7px 10px; }
  .profile-dialog .profile-form:has(.profile-transfer:not([hidden])) > .profile-transfer { grid-column: 1; align-self: center; }
  .profile-dialog .profile-form:has(.profile-transfer:not([hidden])) .profile-form-actions { grid-column: 2; gap: 4px 8px; }
  .profile-dialog .profile-form-actions .hot { padding-inline: 10px; }
  .profile-dialog .profile-form-actions .text-button { font-size: 11px; }
}
@media (max-height: 365px) and (orientation: landscape) {
  .profile-dialog .profile-summary .profile-identity { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 8px; }
  .profile-dialog .profile-summary .profile-account-state { margin: 0; }
  .profile-dialog .profile-summary .profile-avatar { width: 32px; height: 32px; }
  .profile-dialog .profile-body { padding-block: 6px; }
  .profile-dialog .profile-auth { padding-block: 7px; }
  .profile-dialog .profile-auth .profile-form { row-gap: 5px; }
  .profile-dialog .profile-auth .profile-form > label:not(.profile-transfer) { row-gap: 3px; }
  .profile-dialog .profile-auth:has(.profile-auth-modes:not([hidden])) > .profile-auth-note {
    grid-area: 2 / 1;
    margin: 0;
    font-size: 11px;
    line-height: 1.35;
  }
  .profile-dialog .profile-auth-modes { grid-area: 1 / 2 / 3; }
  .profile-dialog .profile-auth-modes button { font-size: 11px; }
}
@media (pointer: coarse) {
  .profile-auth-modes button, .profile-dialog .profile-account-shortcut { min-height: 44px; }
  .settings-device-choices button, .settings-pane .control-key, .settings-pane .control-key-remove { min-height: 44px; }
  .settings-pane .settings-range .range { height: 32px; }
}

/* Travel controls take their own row above the rendered frame. */
#match-surface {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  height: 100dvh;
  background: #090e10;
}
#match-surface:fullscreen { height: 100%; }
#match-surface #screen { height: auto; min-width: 0; min-height: 0; }
#match-surface .touch-toolbar { display: none; }
#match-surface #play-status:empty { display: none; }
.dash-audio {
  --dash-button: 36px;
  display: grid;
  grid-template-columns: minmax(0, 350px) minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px 12px;
  padding: max(4px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) 4px max(12px, env(safe-area-inset-left));
  border-bottom: 1px solid #3a4b51;
  background: #131e22;
}
.dash-audio > * { min-width: 0; }
.match-tools { display: flex; gap: 4px; justify-self: end; }
.match-tools .icon-button,
.music-transport .track-skip {
  display: grid;
  place-items: center;
  width: var(--dash-button, 40px);
  height: var(--dash-button, 40px);
  min-height: 0;
  min-width: 0;
  padding: 0;
  border: 1px solid #42535a;
  border-radius: 4px;
  background: #1d2b31;
  color: #d7e4e6;
}
.match-tools .icon-button:hover,
.music-transport .track-skip:hover:not(:disabled) { border-color: var(--amber); color: var(--amber-bright); }
.match-tools .icon-button[aria-pressed="true"] { color: var(--red); }
.match-tools .icon { width: 16px; height: 16px; }

.music-transport {
  display: flex;
  align-items: flex-start;
  gap: 4px;
  min-width: 0;
}
.music-transport .track-skip { flex: 0 0 auto; }
.music-transport .track-skip:disabled { opacity: .46; }
.track-skip .icon { width: 16px; height: 16px; }
.track-next .icon { transform: scaleX(-1); }
.track-now {
  min-height: var(--dash-button, 40px);
  min-width: 0;
  flex: 0 1 auto;
  inline-size: max-content;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: center;
  gap: 1px;
  padding: 3px 6px;
  border-radius: 4px;
  color: var(--white);
  background: transparent;
  text-align: left;
  line-height: 1.18;
}
.track-now:hover:not(:disabled) { background: #26363d; }
.track-now > span, .track-now > small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.track-now > span { font-size: 12px; font-weight: 800; }
.track-now > small { font-size: 10px; color: #afc1c8; }
.track-now[aria-expanded="true"] > :is(span, small) { white-space: normal; overflow-wrap: anywhere; }
#room-music-slot:empty, #result-music-slot:empty, .dash-voice-slot:empty { display: none; }
.result-board > #result-music-slot { max-width: 360px; width: 100%; }
#room-music-slot .music-transport { max-width: 350px; }
.room-audio {
  display: grid;
  grid-template-columns: minmax(0, 330px) minmax(0, 1fr);
  gap: 7px 16px;
  padding: 8px 10px;
  margin-bottom: 12px;
  border: 1px solid #3a4b51;
  background: #131e22;
}
.room-audio:not(:has(.music-transport, .voice-panel:not([hidden]))) { display: none; }
.room-audio > * { min-width: 0; }
.solo-music-settings .music-transport { max-width: 350px; margin-top: 12px; }
.solo-audio { grid-template-columns: minmax(0, 350px) minmax(0, 1fr); }

.voice-panel {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px 10px;
  min-width: 0;
  padding: 7px 9px;
  border: 1px solid #46616a;
  border-radius: 5px;
  background: #17272e;
}
.voice-panel.transmitting { border-color: #58967c; }
.voice-destination, .voice-controls { display: flex; align-items: center; gap: 4px; min-width: 0; }
.voice-controls { flex-wrap: wrap; }
.voice-destination .voice-scope { color: #b7cbd0; font-size: 11px; text-transform: none; letter-spacing: 0; white-space: nowrap; }
.voice-destination .voice-channel {
  min-width: 0;
  max-width: 125px;
  min-height: var(--dash-button, 40px);
  padding: 3px 4px;
  border-color: #536871;
  border-radius: 4px;
  font-size: 11px;
}
.voice-controls > button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 4px;
  min-height: var(--dash-button, 40px);
  min-width: var(--dash-button, 40px);
  padding: 3px 7px;
  border: 1px solid #50636a;
  border-radius: 4px;
  background: #22343b;
  color: #d3e2e4;
  font: 750 11px/1.2 Manrope,Arial,sans-serif;
  white-space: nowrap;
}
.voice-controls > button:hover:not(:disabled) { border-color: var(--amber); }
.voice-controls > button:disabled { opacity: .58; }
.voice-controls > button .icon { width: 16px; height: 16px; }
.voice-controls button[data-state="on"] { color: #b6e2ce; }
.voice-controls button[data-state="live"], .voice-talk[aria-pressed="true"] { color: #ddffef; border-color: #8fe3b6; background: #21483d; }
.voice-controls button[data-state="off"] { color: #b0bec3; }
.voice-controls button:is([data-state="pending"],[data-state="testing"]) { color: var(--amber-bright); }
.voice-controls button[data-state="error"], .voice-meta .voice-error { color: #ffb19b; }
.voice-controls .voice-slash { display: none; }
.voice-controls [data-state="off"] .voice-slash, .voice-controls [data-state="error"] .voice-slash { display: inline; }
.voice-controls [data-state="off"] .voice-waves, .voice-controls [data-state="error"] .voice-waves { display: none; }
.voice-talk { touch-action: none; user-select: none; -webkit-user-select: none; }
.voice-meta { flex: 1 1 98px; min-width: 0; }
.voice-meta .voice-hint { display: block; color: #c0d0d5; font-size: 11px; line-height: 1.25; overflow-wrap: anywhere; }
.voice-meta .voice-hint[data-kind="notice"] { color: #f0c894; }
.voice-meta .voice-hint.voice-error { color: #ffb19b; }
.voice-meta .voice-speakers:not(:empty) { display: flex; margin-top: 2px; gap: 3px; flex-wrap: wrap; }
.voice-meta .voice-speaker { font-size: 10px; }
.voice-in-dash.voice-panel {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  gap: 4px 7px;
  border: 0;
  padding: 0;
  background: transparent;
}
.voice-in-dash .voice-controls { flex-wrap: nowrap; }
.voice-in-dash .voice-speakers:not(:empty) { flex-wrap: nowrap; overflow: hidden; }
.voice-in-dash .voice-speaker { display: inline-block; flex: 0 1 auto; min-width: 0; max-width: 16ch; padding: 0 4px; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.voice-in-dash .voice-hint { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.voice-in-dash .voice-meta:has(.voice-speakers:not(:empty)) .voice-hint { -webkit-line-clamp: 1; }
#room-voice-slot:not(:has(.voice-panel:not([hidden]))) { display: none; }
#room-voice-slot .voice-panel { padding: 0; background: transparent; border: 0; }
#room-voice-slot .voice-controls > button { min-height: 44px; }

@media (pointer: coarse) {
  .dash-audio { --dash-button: 44px; }
  .settings-pane .microphone-actions button { min-height: 44px; }
  .voice-controls > button, .voice-destination .voice-channel { min-height: var(--dash-button, 44px); }
  .voice-controls > button { min-width: var(--dash-button, 44px); }
  .music-transport .track-skip, .track-now { --dash-button: 44px; }
}
@media (max-width: 1060px) {
  .dash-audio { grid-template-columns: minmax(140px, 1fr) minmax(0, 1.18fr) auto; gap: 4px 8px; }
  .solo-audio { grid-template-columns: minmax(140px, 1fr) minmax(0, 1.18fr); }
  .voice-in-dash .voice-controls button > span { display: none; }
}
@media (max-width: 700px) {
  .room-audio { grid-template-columns: minmax(0, 1fr); }
  #room-music-slot .music-transport { max-width: none; }
  #room-voice-slot .voice-controls > button > span { display: none; }
  .dash-audio { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "music tools" "voice voice"; }
  .dash-audio > :is(.music-transport, #play-music-slot) { grid-area: music; }
  .dash-audio > .dash-voice-slot { grid-area: voice; }
  .dash-audio > .match-tools { grid-area: tools; }
  .match-tools #quit { display: none; }
  .solo-audio { grid-template-areas: "music" "voice"; grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 700px) and (min-width: 370px) {
  :is(#room-voice-slot, .voice-in-dash) .voice-controls .voice-talk > span { display: inline; }
}
@media (prefers-reduced-motion: reduce) {
  .settings-tab, .dash-audio button, .voice-controls button { transition: none; }
}
