/* Sidebar-only overrides: the main content keeps its fixed rail allowance. */
#app-sidebar .sidebar-sport-item::before { display: none; content: none; }
#app-sidebar .sidebar-context-icon:has(img)::before { opacity: 0; }
#app-sidebar .sidebar-competition .sidebar-context-icon::before { content: none; display: none; }
#app-sidebar .sidebar-competition .sidebar-context-icon[hidden] { display: none; }
#app-sidebar .sidebar-competition .sidebar-context-icon img { filter: none; opacity: 1; background: transparent; }
#app-sidebar .sidebar-competition-no-logo .sidebar-context-label { display: block; opacity: 1; visibility: visible; transform: none; }
#app-sidebar .sidebar-services,
body.sidebar-peeking #app-sidebar .sidebar-services,
body.sidebar-open #app-sidebar .sidebar-services {
  grid-template-columns: minmax(0, 1fr);
  grid-auto-flow: row;
  gap: 3px;
  margin-top: 12px;
  padding: 0;
}

#app-sidebar .service-nav-button {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  height: 38px;
  min-height: 38px;
  padding: 0 5px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  text-align: left;
  overflow: hidden;
  transform: none;
}

#app-sidebar .service-nav-button:is(:hover, :active, [aria-pressed='true']) {
  border: 0;
  background: transparent;
  box-shadow: none;
  transform: none;
}

/* Replace the animated border with a small local selection signal. */
#app-sidebar .service-nav-button::after {
  content: none;
  display: none;
  animation: none;
  background: none;
  box-shadow: none;
}

#app-sidebar .service-nav-button::before {
  content: '';
  position: absolute;
  left: 0;
  top: calc(50% - 7px);
  width: 2px;
  height: 14px;
  border-radius: 9px;
  background: var(--accent, #e31332);
  box-shadow: 0 0 7px color-mix(in srgb, var(--accent, #e31332) 35%, transparent);
  opacity: 0;
  transition: opacity .18s ease;
}

#app-sidebar .service-nav-button[aria-pressed='true']::before { opacity: 1; }
#app-sidebar .service-nav-button:hover::before { opacity: .45; }
#app-sidebar .service-nav-button[aria-pressed='true']:hover::before { opacity: 1; }
#app-sidebar .service-logo { flex: 0 0 44px; width: 44px; height: 20px; overflow: hidden; white-space: nowrap; filter: none; }
#app-sidebar .service-nav-button:is(:hover, [aria-pressed='true']) .service-logo { filter: none; }
#app-sidebar .service-nav-button .sidebar-context-label { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: var(--text-muted, #a9abb1); font-size: 11px; font-weight: 500; }
#app-sidebar .service-nav-button[aria-pressed='true'] .sidebar-context-label { color: var(--text, #f2efe8); }
#app-sidebar .service-nav-button:focus-visible { outline: 1px solid var(--text, #f2efe8); outline-offset: -3px; border-radius: 7px; }
#app-sidebar #sidebar-toggle::before { left: calc(50% - 4px); top: calc(50% - 4px); }

@media (min-width: 721px) {
  #app-sidebar,
  body.sidebar-collapsed #app-sidebar {
    width: 60px;
    padding-right: 0;
    overflow-x: clip;
    overflow-y: auto;
    scrollbar-width: none;
    transition: width .3s cubic-bezier(.2, .7, .2, 1), padding-right .3s cubic-bezier(.2, .7, .2, 1), background-color .3s ease;
  }
  #app-sidebar::-webkit-scrollbar { display: none; }
  body.sidebar-peeking #app-sidebar { width: 224px; padding-right: 12px; background: var(--canvas); }
  #app-sidebar .sidebar-action,
  body.sidebar-collapsed #app-sidebar .sidebar-action,
  #app-sidebar .sidebar-family,
  #app-sidebar .sidebar-sport-item {
    width: 204px;
    justify-content: flex-start;
    overflow: hidden;
  }
  #app-sidebar .sidebar-label,
  body.sidebar-collapsed #app-sidebar .sidebar-label,
  #app-sidebar .sidebar-context-label {
    display: block;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    opacity: 0;
    visibility: hidden;
    transform: translateX(-6px);
    pointer-events: none;
    transition: opacity .16s ease, transform .24s cubic-bezier(.2, .7, .2, 1), visibility 0s linear .2s;
  }
  body.sidebar-peeking #app-sidebar .sidebar-label,
  body.sidebar-peeking.sidebar-collapsed #app-sidebar .sidebar-label,
  body.sidebar-peeking #app-sidebar .sidebar-context-label {
    display: block;
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
    transition: opacity .22s ease .035s, transform .28s cubic-bezier(.2, .7, .2, 1), visibility 0s;
  }
}

@media (min-width: 721px) and (max-height: 700px) {
  #app-sidebar #sidebar-toggle { width: 34px; height: 34px; min-height: 34px; margin-bottom: 6px; }
  #app-sidebar .sidebar-navigation { gap: 2px; margin-bottom: 6px; }
  #app-sidebar .sidebar-action,
  body.sidebar-collapsed #app-sidebar .sidebar-action { min-height: 34px; padding-top: 7px; padding-bottom: 7px; }
  #app-sidebar .sidebar-services { gap: 2px; margin-top: 8px; }
  #app-sidebar .service-nav-button { height: 30px; min-height: 30px; }
  #app-sidebar .sidebar-family,
  #app-sidebar .sidebar-sport-item { min-height: 31px; padding-top: 5px; padding-bottom: 5px; }
}

@media (max-width: 720px) {
  #app-sidebar,
  body.sidebar-collapsed #app-sidebar {
    opacity: 0;
    transform: translateX(-100%);
    transition: transform .24s cubic-bezier(.2, .7, .2, 1), opacity .2s ease;
  }
  body.sidebar-open #app-sidebar,
  body.sidebar-open.sidebar-collapsed #app-sidebar,
  body.sidebar-closing #app-sidebar,
  body.sidebar-closing.sidebar-collapsed #app-sidebar {
    display: block;
    z-index: 50;
    top: var(--header-height);
    bottom: 0;
    left: 0;
    width: min(280px, calc(100vw - 56px));
    padding: 18px 20px 28px;
    overflow: auto;
    background: var(--sidebar-surface);
    box-shadow: 20px 0 60px rgb(0 0 0 / .25);
  }
  body.sidebar-open #app-sidebar { opacity: 1; transform: translateX(0); }
  body.sidebar-closing #app-sidebar { pointer-events: none; }
  #app-sidebar .service-nav-button { width: 100%; height: 44px; min-height: 44px; }
  #app-sidebar .sidebar-services { gap: 2px; }
  #app-sidebar .sidebar-label,
  #app-sidebar .sidebar-context-label { transition: opacity .18s ease, transform .24s ease; }
  body.sidebar-closing #app-sidebar .sidebar-label,
  body.sidebar-closing #app-sidebar .sidebar-context-label { display: block; opacity: 0; transform: translateX(-6px); }
  @starting-style {
    body.sidebar-open #app-sidebar { opacity: 0; transform: translateX(-100%); }
  }
}

@media (prefers-reduced-motion: reduce) {
  #app-sidebar,
  #app-sidebar *,
  #app-sidebar *::before,
  #app-sidebar *::after { animation: none !important; transition: none !important; }
}

/* Room actions use a centered modal, independent of the sidebar's transforms. */
#sync-dialog { position: fixed; inset: 0; width: min(420px, calc(100vw - 32px)); max-width: none; max-height: calc(100dvh - 32px); margin: auto; padding: 0; overflow: auto; border: 1px solid var(--line, #ffffff1c); border-radius: 22px; background: var(--surface, #17191e); color: var(--text, #f2efe8); box-shadow: 0 24px 90px #0009, 0 0 44px #e3133212; }
#sync-dialog::backdrop { background: #0506099c; backdrop-filter: blur(7px); }
#sync-dialog[open] { animation: sync-dialog-enter .28s cubic-bezier(.16, 1, .3, 1) both; }
#sync-dialog[open]::backdrop { animation: sync-backdrop-enter .22s ease both; }
#sync-dialog .sync-controls { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); align-items: stretch; gap: 20px; width: 100%; margin: 0; padding: 30px; border: 0; border-radius: inherit; background: linear-gradient(135deg, #e3133209, transparent 65%); box-shadow: none; }
#sync-dialog .sync-heading { display: grid; gap: 9px; padding-right: 32px; }
#sync-dialog .sync-heading h2 { margin: 0; color: var(--text); font-size: 21px; font-weight: 650; }
#sync-dialog .section-kicker { margin-bottom: 8px; color: var(--accent-bright, #f02a3b); font-size: 9px; letter-spacing: .16em; }
#sync-dialog .sync-status { color: var(--text-muted); }
#sync-dialog .field { min-width: 0; }
#sync-dialog #room-code { width: 100%; min-height: 46px; }
#sync-dialog .room-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
#sync-dialog .room-actions button { width: 100%; min-height: 46px; padding: 12px; font-size: 12px; }
#sync-dialog .sync-options { display: grid; gap: 15px; margin: 0; }
#sync-dialog .sync-help { color: var(--text-muted); font-size: 12px; line-height: 1.65; }
#sync-close { position: absolute; z-index: 2; top: 12px; right: 12px; display: grid; place-items: center; width: 44px; height: 44px; min-width: 44px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--text-muted); box-shadow: none; transform: none; transition: color .18s, background .18s, box-shadow .18s; }
#sync-close::before, #sync-close::after { content: ''; position: absolute; width: 15px; height: 1.5px; border-radius: 2px; background: currentColor; transform: rotate(45deg); pointer-events: none; }
#sync-close::after { transform: rotate(-45deg); }
#sync-close:hover { background: #e3133212; color: var(--text); box-shadow: 0 0 20px #e3133224; transform: none; }
#sync-close:focus-visible { outline: 2px solid var(--accent-bright, #f02a3b); outline-offset: -3px; }
body.sync-visible { overflow: hidden; }
@keyframes sync-dialog-enter { from { opacity: 0; transform: translateY(14px) scale(.96); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes sync-backdrop-enter { from { opacity: 0; } to { opacity: 1; } }
@media (max-width: 420px) { #sync-dialog .sync-controls { padding: 27px 22px 24px; } }
@media (prefers-reduced-motion: reduce) { #sync-dialog[open], #sync-dialog[open]::backdrop { animation: none; } #sync-close { transition: none; } }
