:root {
  --julia-shell-ink: #111111;
  --julia-shell-paper: #ffffff;
  --julia-shell-soft: #f1f1ee;
  --julia-shell-line: #d7d7d2;
  --julia-shell-muted: #6a6a64;
}

/* Shared JULIA mark. Keep the dimensions of each existing brand lockup, but
   replace the temporary letterform with the approved compact face symbol. */
.brand > span:first-child,
.brand-mark,
.workspace-brand > span:first-child,
.firm-brand > span:first-child,
.client-brand > span:first-child,
.auth-brand > span:first-child,
.states-header > a > span:first-child,
.julia-switcher-button > i,
.julia-switcher__brand > i {
  flex: 0 0 auto;
  border: 0 !important;
  border-radius: 0 !important;
  color: transparent !important;
  background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 36'%3E%3Crect x='7' y='11' width='14' height='14' rx='1' fill='%23000'/%3E%3Crect x='43' y='11' width='14' height='14' rx='1' fill='%23000'/%3E%3C/svg%3E") center / contain no-repeat !important;
  font-size: 0 !important;
  overflow: hidden;
}

/* White version wherever the lockup sits on a dark surface. */
.firm-brand > span:first-child,
.auth-brand > span:first-child,
.onboarding-aside .brand > span:first-child,
.julia-switcher-button > i {
  filter: invert(1);
}

.julia-switcher-button {
  position: fixed;
  z-index: 900;
  right: 1.25rem;
  bottom: 1.25rem;
  display: inline-flex;
  gap: .65rem;
  align-items: center;
  min-height: 3.1rem;
  padding: .65rem 1.1rem .65rem .7rem;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 999px;
  color: #fff;
  background: var(--julia-shell-ink);
  box-shadow: 0 14px 40px rgba(0,0,0,.2);
  font: 650 .875rem/1 -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  letter-spacing: .03em;
  cursor: pointer;
  transition: transform .25s ease, box-shadow .25s ease;
}

.julia-switcher-button:hover { transform: translateY(-2px); box-shadow: 0 18px 48px rgba(0,0,0,.25); }
.julia-switcher-button:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.julia-switcher-button i { display: grid; place-items: center; width: 1.8rem; height: 1.8rem; border: 1px solid rgba(255,255,255,.55); border-radius: 50%; font: 400 1rem/1 Georgia, serif; }

.julia-switcher {
  position: fixed;
  z-index: 1000;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 1rem;
  color: var(--julia-shell-ink);
  background: rgba(17,17,17,.52);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  opacity: 0;
  visibility: hidden;
  transition: opacity .3s ease, visibility .3s ease;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

body.julia-switcher-open { overflow: hidden; }
body.julia-switcher-open .julia-switcher { opacity: 1; visibility: visible; }

/* Keep the global route switcher away from primary actions in open drawers. */
body:has(.case-drawer:not([hidden])) .julia-switcher-button,
body:has(.event-drawer:not([hidden])) .julia-switcher-button,
body:has(.practice-drawer:not([hidden])) .julia-switcher-button,
body:has(.invite-drawer:not([hidden])) .julia-switcher-button,
body:has(.upload-panel:not([hidden])) .julia-switcher-button,
body:has(.assignment-panel:not([hidden])) .julia-switcher-button,
body:has(.reset-panel:not([hidden])) .julia-switcher-button {
  opacity: 0;
  pointer-events: none;
}
body.julia-shell-suspended .julia-switcher-button {
  opacity: 0;
  pointer-events: none;
}

.julia-switcher__panel {
  width: min(1120px, 100%);
  max-height: min(820px, calc(100svh - 2rem));
  overflow: auto;
  padding: clamp(1.25rem, 3vw, 2.5rem);
  border-radius: 2rem;
  background: var(--julia-shell-paper);
  box-shadow: 0 30px 100px rgba(0,0,0,.25);
  transform: translateY(18px) scale(.985);
  transition: transform .42s cubic-bezier(.2,.75,.2,1);
}

body.julia-switcher-open .julia-switcher__panel { transform: none; }

.julia-switcher__head { display: flex; justify-content: space-between; gap: 2rem; align-items: flex-start; padding-bottom: 1.5rem; border-bottom: 1px solid var(--julia-shell-ink); }
.julia-switcher__brand { display: flex; gap: .75rem; align-items: center; }
.julia-switcher__brand i { display: grid; place-items: center; width: 2.25rem; height: 2.25rem; border: 1px solid var(--julia-shell-ink); border-radius: 50%; font: 400 1.1rem/1 Georgia, serif; }
.julia-switcher__brand div { display: grid; gap: .15rem; }
.julia-switcher__brand strong { font-size: .9rem; letter-spacing: .09em; }
.julia-switcher__brand small { color: var(--julia-shell-muted); font-size: .72rem; }
.julia-switcher__close { display: grid; place-items: center; width: 2.75rem; height: 2.75rem; border: 1px solid var(--julia-shell-line); border-radius: 50%; background: #fff; font-size: 1.2rem; cursor: pointer; }

.julia-switcher__intro { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(250px, .75fr); gap: 2rem; align-items: end; padding: clamp(2rem, 5vw, 4.5rem) 0 2rem; }
.julia-switcher__intro h2 { max-width: 700px; margin: 0; font: 400 clamp(3.2rem, 7vw, 6.5rem)/.88 Georgia, "Times New Roman", serif; letter-spacing: -.06em; }
.julia-switcher__intro p { margin: 0; color: var(--julia-shell-muted); line-height: 1.55; }

.julia-switcher__paths { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.julia-switcher__group { padding: clamp(1.25rem, 2.5vw, 2rem); border: 1px solid var(--julia-shell-line); border-radius: 1.4rem; }
.julia-switcher__group--dark { color: #fff; background: var(--julia-shell-ink); border-color: var(--julia-shell-ink); }
.julia-switcher__label { display: flex; justify-content: space-between; gap: 1rem; margin-bottom: 2rem; color: var(--julia-shell-muted); font-size: .72rem; letter-spacing: .07em; text-transform: uppercase; }
.julia-switcher__group--dark .julia-switcher__label { color: #aaa; }
.julia-switcher__links { display: grid; }
.julia-switcher__links a { display: grid; grid-template-columns: 2rem minmax(0,1fr) auto auto; gap: .8rem; align-items: center; min-height: 4.5rem; padding: .8rem 0; border-top: 1px solid var(--julia-shell-line); color: inherit; text-decoration: none; }
.julia-switcher__group--dark .julia-switcher__links a { border-color: #393939; }
.julia-switcher__links a:hover strong { transform: translateX(4px); }
.julia-switcher__links a[aria-current="page"] { font-weight: 700; }
.julia-switcher__links a[aria-current="page"]::after { content: "Сейчас"; padding: .35rem .55rem; border-radius: 999px; color: #fff; background: var(--julia-shell-ink); font-size: .62rem; font-weight: 500; }
.julia-switcher__group--dark .julia-switcher__links a[aria-current="page"]::after { color: var(--julia-shell-ink); background: #fff; }
.julia-switcher__links em { color: var(--julia-shell-muted); font: 400 .7rem/1 Georgia, serif; }
.julia-switcher__group--dark .julia-switcher__links em { color: #999; }
.julia-switcher__links strong { font: 400 clamp(1.25rem, 2vw, 1.8rem)/1.05 Georgia, "Times New Roman", serif; transition: transform .2s ease; }
.julia-switcher__links small { color: var(--julia-shell-muted); font-size: .72rem; text-align: right; }
.julia-switcher__group--dark .julia-switcher__links small { color: #aaa; }

@media (max-width: 760px) {
  .julia-switcher { padding: .45rem; }
  .julia-switcher__panel { max-height: calc(100svh - .9rem); padding: 1.2rem; border-radius: 1.4rem; }
  .julia-switcher__intro { grid-template-columns: 1fr; gap: 1rem; padding: 2.5rem 0 1.5rem; }
  .julia-switcher__intro h2 { font-size: clamp(3.1rem, 15vw, 5rem); }
  .julia-switcher__paths { grid-template-columns: 1fr; }
  .julia-switcher__links a { grid-template-columns: 1.5rem 1fr; }
  .julia-switcher__links small, .julia-switcher__links a[aria-current="page"]::after { display: none; }
  .julia-switcher-button { right: .75rem; bottom: .75rem; }
}

@media (prefers-reduced-motion: reduce) {
  .julia-switcher, .julia-switcher__panel, .julia-switcher-button, .julia-switcher__links strong { transition-duration: .01ms !important; }
}
