:root {
      color-scheme: dark;
      font-family: var(--font-family-system);
      background: var(--background-primary);
      color: var(--text-primary);

      /* Legacy aliases kept to preserve the current one-file Mini App CSS. */
      --bg: #01030a;
      --glass: rgba(8, 14, 31, 0.66);
      --glass-strong: rgba(12, 20, 42, 0.84);
      --glass-soft: rgba(9, 16, 34, 0.58);
      --line: rgba(213, 232, 255, 0.28);
      --line-strong: rgba(225, 240, 255, 0.48);
      --text: #f8fbff;
      --muted: rgba(236, 243, 255, 0.78);
      --soft: rgba(236, 243, 255, 0.64);
      --accent: #7cc7ff;
      --accent-2: #b79cff;
      --success: #8ff6d0;
      --danger: #ff9aa8;
      --shadow: 0 18px 46px rgba(0, 0, 0, 0.42);
      --blur: blur(18px) saturate(130%);

      /* Backgrounds */
      --background-primary: var(--bg);
      --background-secondary: #030816;
      --background-deep: #020610;
      --background-overlay: rgba(1, 3, 10, 0.72);

      /* Surfaces */
      --surface-primary: var(--glass);
      --surface-secondary: var(--glass-soft);
      --surface-tertiary: rgba(7, 13, 28, 0.64);
      --surface-elevated: var(--glass-strong);
      --surface-glass: rgba(5, 14, 35, 0.76);
      --surface-hover: rgba(255, 255, 255, 0.13);
      --surface-active: rgba(37, 93, 135, 0.68);

      /* Text */
      --text-primary: var(--text);
      --text-secondary: var(--muted);
      --text-tertiary: var(--soft);
      --text-disabled: rgba(236, 243, 255, 0.45);
      --text-on-accent: #061426;

      /* Accents */
      --accent-primary: var(--accent);
      --accent-primary-hover: #bceaff;
      --accent-primary-active: #72c7ff;
      --accent-secondary: var(--accent-2);
      --accent-soft: rgba(155, 220, 255, 0.16);

      /* Status */
      --status-success: var(--success);
      --status-success-soft: rgba(143, 246, 208, 0.36);
      --status-warning: #ffd166;
      --status-warning-soft: rgba(255, 209, 102, 0.22);
      --status-danger: var(--danger);
      --status-danger-soft: rgba(255, 154, 168, 0.34);
      --status-info: #8fd3ff;
      --status-info-soft: rgba(143, 211, 255, 0.31);

      /* Borders */
      --border-subtle: rgba(225, 240, 255, 0.18);
      --border-default: var(--line);
      --border-strong: var(--line-strong);
      --border-focus: rgba(155, 220, 255, 0.9);

      /* Spacing */
      --space-1: 4px;
      --space-2: 8px;
      --space-3: 12px;
      --space-4: 16px;
      --space-5: 20px;
      --space-6: 24px;
      --space-7: 28px;
      --space-8: 32px;
      --space-10: 40px;
      --space-12: 48px;

      /* Radii */
      --radius-xs: 8px;
      --radius-sm: 12px;
      --radius-md: 16px;
      --radius-lg: 18px;
      --radius-xl: 22px;
      --radius-2xl: 24px;
      --radius-pill: 999px;
      --radius-round: 50%;

      /* Element sizes */
      --control-height-sm: 36px;
      --control-height-md: 44px;
      --control-height-lg: 52px;
      --touch-target-min: 44px;
      --bottom-nav-height: 82px;
      --topbar-height: 66px;

      /* Typography */
      --font-family-system: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", Inter, Arial, sans-serif;
      --font-size-display: 34px;
      --font-size-h1: 28px;
      --font-size-h2: 24px;
      --font-size-h3: 20px;
      --font-size-body: 16px;
      --font-size-body-sm: 14px;
      --font-size-caption: 12px;
      --line-height-tight: 1.12;
      --line-height-normal: 1.45;
      --line-height-relaxed: 1.65;
      --font-weight-regular: 400;
      --font-weight-medium: 500;
      --font-weight-semibold: 650;
      --font-weight-bold: 800;

      /* Shadows */
      --shadow-sm: 0 10px 22px rgba(0, 0, 0, 0.44);
      --shadow-md: 0 18px 48px rgba(0, 0, 0, 0.42);
      --shadow-lg: var(--shadow);
      --shadow-inset: inset 0 1px 0 var(--glass-highlight);
      --shadow-focus: 0 0 0 3px rgba(155, 220, 255, 0.18);

      /* Glass */
      --glass-blur-sm: blur(12px);
      --glass-blur-md: blur(16px);
      --glass-blur-lg: blur(18px);
      --glass-saturation: saturate(130%);
      --glass-border: rgba(225, 240, 255, 0.26);
      --glass-highlight: rgba(255, 255, 255, 0.12);

      /* Motion */
      --duration-fast: 120ms;
      --duration-normal: 220ms;
      --duration-slow: 360ms;
      --easing-standard: cubic-bezier(0.2, 0, 0, 1);
      --easing-emphasized: cubic-bezier(0.2, 0, 0, 1.2);
      --easing-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    }

    * {
      box-sizing: border-box;
    }

    html {
      width: 100%;
      min-height: 100%;
      overflow-x: hidden;
      background: var(--background-primary);
      touch-action: pan-x pan-y;
    }

    body {
      margin: 0;
      width: 100%;
      max-width: 100%;
      min-height: 100vh;
      overflow-x: hidden;
      overscroll-behavior-x: none;
      background-color: var(--background-primary);
      background-image:
        linear-gradient(180deg, rgba(1, 6, 18, 0.02), rgba(1, 3, 10, 0.24)),
        url("autoschools-bg.jpg?v=20260711-5"),
        radial-gradient(circle at 50% 45%, rgba(23, 92, 190, 0.24), transparent 28rem);
      background-position:
        center,
        center center,
        center;
      background-size:
        cover,
        cover,
        cover;
      background-repeat: no-repeat;
      background-attachment: fixed;
      color: var(--text-primary);
      isolation: isolate;
    }

    html.ai-view-root,
    body.ai-view {
      height: 100%;
      overflow: hidden;
      overscroll-behavior: none;
    }

    body.ai-view .app {
      display: flex;
      flex-direction: column;
      height: var(--app-viewport-height, 100dvh);
      min-height: 0;
      padding-bottom: calc(10px + env(safe-area-inset-bottom));
      overflow: hidden;
    }

    body.ai-view.keyboard-open .app {
      padding-bottom: max(6px, env(safe-area-inset-bottom));
    }

    body.ai-view .bottom-nav {
      display: none;
    }

    body::before,
    body::after {
      content: "";
      position: fixed;
      inset: 0;
      pointer-events: none;
    }

    body::before {
      z-index: 0;
      background-color: var(--background-primary);
      background-image:
        linear-gradient(180deg, rgba(1, 6, 18, 0.02), rgba(1, 3, 10, 0.24)),
        url("autoschools-bg.jpg?v=20260711-5"),
        radial-gradient(circle at 50% 45%, rgba(23, 92, 190, 0.24), transparent 28rem);
      background-position:
        center,
        center center,
        center;
      background-size:
        cover,
        cover,
        cover;
      background-repeat: no-repeat;
      opacity: 1;
      animation: none;
      transform: translateZ(0);
      will-change: transform;
    }

    body::after {
      z-index: 0;
      background:
        radial-gradient(circle at 50% 24%, rgba(76, 154, 255, 0.08), transparent 20rem),
        linear-gradient(180deg, rgba(2, 8, 23, 0.02), rgba(2, 8, 23, 0.48));
      opacity: 1;
      filter: none;
    }

    @keyframes driftStars {
      from { transform: translate3d(0, 0, 0); }
      to { transform: translate3d(-70px, 90px, 0); }
    }

    @keyframes viewIn {
      from {
        opacity: 0;
        transform: translateY(14px) scale(0.985);
        filter: blur(8px);
      }
      to {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
      }
    }

    button,
    input,
    select,
    textarea {
      font: inherit;
      min-width: 0;
      max-width: 100%;
    }

    button {
      border: 0;
      cursor: pointer;
      -webkit-tap-highlight-color: transparent;
    }

    :focus {
      outline: none;
    }

    :focus-visible {
      outline: 2px solid var(--border-focus);
      outline-offset: 3px;
      box-shadow: var(--shadow-focus);
    }

    .nav:focus-visible,
    .app-icon:focus-visible,
    .filter:focus-visible,
    .slot:focus-visible {
      border-radius: var(--radius-lg);
    }

    button:disabled {
      cursor: not-allowed;
      opacity: 0.45;
    }

    [hidden] {
      display: none !important;
    }

    .app {
      width: min(100%, 540px);
      max-width: 100%;
      min-height: 100vh;
      margin: 0 auto;
      padding: calc(var(--space-3) + 2px + env(safe-area-inset-top)) calc(var(--space-3) + 2px) calc(var(--bottom-nav-height) + 42px + env(safe-area-inset-bottom));
      overflow-x: hidden;
      position: relative;
      z-index: 1;
    }

    img,
    svg,
    video,
    canvas {
      max-width: 100%;
    }

    .topbar {
      position: sticky;
      top: 0;
      z-index: 7;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      margin: -2px -2px 16px;
      padding: 10px;
      min-width: 0;
      max-width: 100%;
      overflow: visible;
      border: 1px solid var(--glass-border);
      border-radius: var(--radius-2xl);
      background:
        linear-gradient(180deg, rgba(22, 55, 118, 0.78), rgba(4, 10, 28, 0.82)),
        rgba(5, 14, 35, 0.76);
      box-shadow: 0 14px 44px rgba(0, 0, 0, 0.46);
      backdrop-filter: var(--glass-blur-lg) var(--glass-saturation);
      -webkit-backdrop-filter: var(--glass-blur-lg) var(--glass-saturation);
    }

    .back-button {
      position: relative;
      flex: 0 0 auto;
      width: var(--touch-target-min);
      height: var(--control-height-md);
      border: 1px solid rgba(225, 240, 255, 0.2);
      border-radius: var(--radius-round);
      display: inline-flex;
      align-items: center;
      justify-content: center;
      color: var(--text-primary);
      background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.03)),
        rgba(10, 13, 22, 0.72);
      box-shadow:
        0 12px 28px rgba(0, 0, 0, 0.42),
        inset 0 1px 0 var(--glass-highlight);
      backdrop-filter: var(--glass-blur-md) var(--glass-saturation);
      -webkit-backdrop-filter: var(--glass-blur-md) var(--glass-saturation);
      transform-origin: center;
    }

    .back-button:active,
    .back-button.is-pressing {
      transform: translateY(1px) scale(0.96);
      background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.06)),
        rgba(18, 22, 34, 0.8);
    }

    .back-button svg {
      width: 25px;
      height: 25px;
      fill: none;
      stroke: currentColor;
      stroke-width: 2.6;
      stroke-linecap: round;
      stroke-linejoin: round;
      transform: translateX(-1px);
    }

    .back-row {
      display: flex;
      align-items: center;
      justify-content: flex-start;
      margin: -4px 0 12px;
      min-height: var(--control-height-md);
    }

    .brand {
      min-width: 0;
      padding-left: 6px;
    }

    .brand-with-logo {
      display: flex;
      align-items: center;
      gap: 10px;
      padding-left: 2px;
      flex: 1 1 auto;
      overflow: hidden;
    }

    .brand-copy {
      min-width: 0;
      overflow: hidden;
    }

    .brand-copy .eyebrow {
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .brand-copy h1 {
      max-width: 100%;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      overflow-wrap: normal;
      font-size: clamp(20px, 4.7vw, 23px);
    }

    .topbar-logo {
      width: 46px;
      height: 46px;
      flex: 0 0 auto;
      border-radius: var(--radius-round);
      object-fit: cover;
      padding: 0;
      background: #030816;
      border: 1px solid rgba(220, 236, 255, 0.32);
      filter: brightness(1.1) saturate(1.06) contrast(1.06);
      box-shadow:
        0 10px 22px rgba(0, 0, 0, 0.44),
        inset 0 1px 0 var(--glass-highlight);
    }

    .top-actions {
      display: flex;
      align-items: center;
      gap: 7px;
      flex: 0 0 auto;
    }

    .language-switcher {
      position: relative;
      flex: 0 0 auto;
    }

    .language-trigger {
      min-width: 46px;
      padding: 0 10px;
      font-weight: 700;
      letter-spacing: 0;
      gap: 4px;
    }

    .language-trigger::after {
      content: "";
      width: 0;
      height: 0;
      border-left: 4px solid transparent;
      border-right: 4px solid transparent;
      border-top: 5px solid currentColor;
      opacity: 0.72;
    }

    .language-menu {
      position: absolute;
      top: calc(100% + 8px);
      right: 0;
      z-index: 32;
      display: none;
      min-width: 118px;
      padding: 8px;
      border: 1px solid var(--border-subtle);
      border-radius: var(--radius-lg);
      background:
        linear-gradient(180deg, rgba(42, 63, 116, 0.92), rgba(8, 12, 26, 0.94)),
        rgba(10, 16, 32, 0.92);
      box-shadow: 0 18px 42px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.16);
      backdrop-filter: var(--glass-blur-lg) saturate(170%);
      -webkit-backdrop-filter: var(--glass-blur-lg) saturate(170%);
    }

    .language-menu.open {
      display: grid;
      gap: 6px;
      animation: menuPop 160ms ease both;
    }

    @keyframes menuPop {
      from {
        opacity: 0;
        transform: translateY(-4px) scale(0.97);
      }
      to {
        opacity: 1;
        transform: translateY(0) scale(1);
      }
    }

    .language-option {
      border: 0;
      border-radius: 12px;
      padding: 9px 10px;
      background: rgba(255, 255, 255, 0.05);
      color: rgba(246, 250, 255, 0.86);
      font: inherit;
      font-weight: 650;
      text-align: left;
    }

    .language-option.active {
      color: #fff;
      background: linear-gradient(135deg, rgba(114, 199, 255, 0.42), rgba(109, 103, 255, 0.38));
      box-shadow: inset 0 0 0 1px rgba(195, 232, 255, 0.28);
    }

    .icon-button {
      position: relative;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 38px;
      height: 38px;
      border: 1px solid rgba(225, 240, 255, 0.22);
      border-radius: 14px;
      background: rgba(7, 13, 28, 0.42);
      color: var(--text-primary);
      box-shadow: inset 0 1px 0 var(--glass-highlight);
      backdrop-filter: var(--glass-blur-sm) var(--glass-saturation);
      -webkit-backdrop-filter: var(--glass-blur-sm) var(--glass-saturation);
    }

    .icon-button.active,
    .icon-button:active,
    .icon-button.is-pressing {
      background: rgba(255, 255, 255, 0.13);
      transform: translateY(1px) scale(0.98);
    }

    .icon-button svg,
    .nav svg {
      width: 20px;
      height: 20px;
      fill: none;
      stroke: currentColor;
      stroke-width: 2;
      stroke-linecap: round;
      stroke-linejoin: round;
    }
