: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;
    }

    .notify-dot {
      position: absolute;
      top: 6px;
      right: 6px;
      width: 9px;
      height: 9px;
      border-radius: var(--radius-round);
      background: #ff453a;
      box-shadow: 0 0 0 2px rgba(5, 14, 35, 0.9);
    }

    .eyebrow {
      margin: 0 0 4px;
      color: var(--soft);
      font-size: 12px;
      line-height: 1.2;
      letter-spacing: 0.2px;
    }

    h1,
    h2,
    h3,
    p {
      margin: 0;
    }

    h1 {
      font-size: 22px;
      line-height: 1.04;
      letter-spacing: 0;
      overflow-wrap: anywhere;
    }

    h2 {
      font-size: 22px;
      line-height: 1.12;
      letter-spacing: 0;
      overflow-wrap: anywhere;
    }

    h3 {
      font-size: 16px;
      line-height: 1.25;
      letter-spacing: 0;
      overflow-wrap: anywhere;
    }

    .muted {
      color: var(--muted);
    }

    .clamp {
      display: -webkit-box;
      overflow: hidden;
      -webkit-box-orient: vertical;
      -webkit-line-clamp: 3;
    }

    .soft {
      color: var(--soft);
    }

    .lead {
      max-width: 31rem;
      color: rgba(248, 251, 255, 0.84);
      line-height: 1.48;
      overflow-wrap: anywhere;
    }

    .status-chip,
    .pill {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      min-height: 34px;
      border: 1px solid rgba(225, 240, 255, 0.3);
      border-radius: var(--radius-pill);
      padding: 7px 11px;
      background: rgba(8, 16, 35, 0.84);
      color: rgba(248, 251, 255, 0.86);
      font-size: 12px;
      line-height: 1;
      max-width: 100%;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
    }

    .status-chip {
      flex: 0 1 auto;
      max-width: 48%;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .status-chip.good,
    .pill.good {
      border-color: rgba(143, 246, 208, 0.38);
      background: rgba(36, 122, 101, 0.42);
      color: #d9fff2;
    }

    .glass {
      border: 1px solid var(--line);
      border-radius: 30px;
      background:
        linear-gradient(145deg, rgba(35, 52, 88, 0.68), rgba(6, 12, 28, 0.72)),
        var(--glass);
      box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.2);
      backdrop-filter: var(--glass-blur-lg) var(--glass-saturation);
      -webkit-backdrop-filter: var(--glass-blur-lg) var(--glass-saturation);
    }

    .hero {
      position: relative;
      display: grid;
      gap: 16px;
      margin-bottom: 18px;
      padding: 20px;
      overflow: hidden;
    }

    .hero::before {
      content: "";
      position: absolute;
      inset: 0;
      z-index: 0;
      border-radius: inherit;
      background:
        linear-gradient(90deg, rgba(6, 13, 32, 0.94) 0%, rgba(6, 13, 32, 0.66) 48%, rgba(6, 13, 32, 0.2) 100%),
        radial-gradient(circle at 74% 34%, rgba(155, 220, 255, 0.2), transparent 14rem),
        url("autoschools-hero.jpg?v=20260711-4") center center / contain no-repeat;
      filter: saturate(1.16) contrast(1.06);
      opacity: 0.66;
      transform: none;
      animation: none;
      pointer-events: none;
    }

    .hero::after {
      content: "";
      position: absolute;
      inset: 0;
      z-index: 1;
      border-radius: inherit;
      background:
        linear-gradient(160deg, rgba(255, 255, 255, 0.16), transparent 34%),
        radial-gradient(circle at 18% 8%, rgba(255, 255, 255, 0.11), transparent 11rem),
        linear-gradient(180deg, transparent, rgba(2, 6, 16, 0.42));
      pointer-events: none;
    }

    .hero > * {
      position: relative;
      z-index: 2;
    }

    .home-hero {
      min-height: clamp(176px, calc((100vw - 40px) * 0.38), 208px);
      height: auto;
      align-content: center;
      gap: 10px;
      margin-bottom: 18px;
      padding: 16px 15px 14px;
      border-color: rgba(225, 240, 255, 0.11);
      border-top-color: rgba(255, 255, 255, 0.07);
      box-shadow: 0 14px 34px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.08);
      isolation: isolate;
    }

    .home-hero::before {
      inset: 0;
      border-radius: inherit;
      background:
        linear-gradient(90deg, rgba(6, 13, 32, 0.88) 0%, rgba(6, 13, 32, 0.56) 58%, rgba(6, 13, 32, 0.2) 100%),
        radial-gradient(circle at 74% 34%, rgba(155, 220, 255, 0.12), transparent 12rem),
        url("autoschools-hero.jpg?v=20260712-1") center center / cover no-repeat;
      opacity: 0.72;
      transform: none;
      transition: none;
      will-change: auto;
    }

    .home-hero h2 {
      max-width: 18rem;
      font-size: clamp(19px, 5.1vw, 23px);
      font-weight: var(--font-weight-semibold);
      line-height: 1.1;
      letter-spacing: -0.018em;
    }

    .home-hero::after {
      background:
        radial-gradient(circle at 18% 8%, rgba(255, 255, 255, 0.06), transparent 8rem),
        linear-gradient(180deg, transparent 0%, transparent 34%, rgba(2, 6, 16, 0.22));
    }

    .home-hero .lead {
      display: none;
    }

    .home-hero .stats {
      grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
      gap: 7px;
      max-width: 100%;
    }

    .home-hero .stat {
      border-radius: 18px;
      padding: 9px 11px;
      background: rgba(5, 12, 28, 0.54);
      border-color: rgba(225, 240, 255, 0.16);
      box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
    }

    .home-hero .stat[hidden] {
      display: none;
    }

    .home-hero .stat strong {
      font-size: 24px;
      font-weight: var(--font-weight-semibold);
      letter-spacing: -0.025em;
    }

    .home-hero .button {
      min-height: 42px;
    }

    @keyframes logoParallax {
      from { transform: perspective(800px) rotateX(4deg) rotateY(-7deg) scale(1.07) translate3d(0, 0, 0); }
      to { transform: perspective(800px) rotateX(2deg) rotateY(-2deg) scale(1.12) translate3d(-10px, 10px, 0); }
    }

    .hero-row,
    .card-top,
    .section-head,
    .slot-head,
    .profile-row {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 12px;
      min-width: 0;
    }

    .hero-corner {
      display: flex;
      align-items: center;
      justify-content: flex-end;
      gap: 8px;
      flex: 0 0 auto;
    }

    .hero-avatar,
    .hero-avatar-fallback {
      width: var(--touch-target-min);
      height: var(--control-height-md);
      border-radius: var(--radius-md);
      border: 1px solid rgba(202, 233, 255, 0.34);
      box-shadow:
        0 12px 28px rgba(0, 0, 0, 0.34),
        inset 0 1px 0 var(--glass-highlight);
    }

    .hero-avatar {
      object-fit: cover;
      background: rgba(7, 13, 28, 0.64);
    }

    .hero-avatar-fallback {
      display: grid;
      place-items: center;
      background:
        radial-gradient(circle at 34% 22%, rgba(161, 218, 255, 0.32), transparent 44%),
        linear-gradient(145deg, rgba(27, 51, 91, 0.92), rgba(5, 10, 22, 0.92));
      color: #f7fbff;
      font-weight: 900;
      font-size: 18px;
      line-height: 1;
    }

    .hero-school-logo {
      width: 48px;
      height: 48px;
      border-radius: var(--radius-md);
      object-fit: cover;
      background: rgba(5, 10, 22, 0.72);
      border: 1px solid rgba(202, 233, 255, 0.34);
      box-shadow:
        0 12px 28px rgba(0, 0, 0, 0.34),
        inset 0 1px 0 var(--glass-highlight);
    }

    .school-logo-preview {
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 9px 10px;
      border-radius: var(--radius-lg);
      border: 1px solid rgba(202, 233, 255, 0.18);
      background: rgba(4, 9, 21, 0.44);
      color: var(--muted);
      font-size: 13px;
    }

    .school-logo-preview img {
      width: 46px;
      height: 46px;
      border-radius: 15px;
      object-fit: cover;
      border: 1px solid rgba(202, 233, 255, 0.28);
    }

    .hero-row > *,
    .card-top > *,
    .section-head > *,
    .slot-head > *,
    .profile-row > * {
      min-width: 0;
    }

    .stats {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 10px;
    }

    .stat {
      min-width: 0;
      border: 1px solid rgba(225, 240, 255, 0.24);
      border-radius: var(--radius-2xl);
      padding: 13px 12px;
      background: rgba(5, 12, 28, 0.76);
      box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14);
    }

    .stat strong {
      display: block;
      margin-bottom: 4px;
      font-size: 22px;
      line-height: 1;
    }

    .stat span {
      color: var(--soft);
      font-size: 12px;
    }

    .toolbar {
      display: grid;
      grid-template-columns: 1fr auto;
      gap: 10px;
      margin: 0 0 14px;
    }

    .search {
      width: 100%;
      min-height: 48px;
      border: 1px solid rgba(225, 240, 255, 0.28);
      border-radius: var(--radius-pill);
      outline: 0;
      padding: 0 17px;
      background: rgba(4, 10, 24, 0.82);
      color: var(--text);
      box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16);
      backdrop-filter: var(--glass-blur-lg) var(--glass-saturation);
      -webkit-backdrop-filter: var(--glass-blur-lg) var(--glass-saturation);
    }

    .search::placeholder {
      color: rgba(236, 243, 255, 0.62);
    }

    .search:focus {
      border-color: rgba(143, 211, 255, 0.58);
      background: rgba(8, 18, 38, 0.92);
    }

    .button {
      min-width: 0;
      max-width: 100%;
      min-height: 48px;
      border-radius: var(--radius-pill);
      padding: 0 18px;
      background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(229, 238, 248, 0.9)),
        #eef5fb;
      color: var(--text-on-accent);
      font-weight: 700;
      white-space: normal;
      overflow-wrap: anywhere;
      box-shadow: 0 10px 24px rgba(30, 64, 112, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.88);
    }

    .button.secondary,
    .filter {
      border: 1px solid rgba(225, 240, 255, 0.34);
      background: rgba(8, 16, 35, 0.86);
      color: rgba(248, 251, 255, 0.94);
      font-weight: 700;
      box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15);
      backdrop-filter: var(--glass-blur-lg) var(--glass-saturation);
      -webkit-backdrop-filter: var(--glass-blur-lg) var(--glass-saturation);
    }

    .button.danger {
      background: rgba(122, 39, 54, 0.72);
      color: #ffe3e7;
    }

    .filters {
      display: flex;
      align-items: center;
      gap: 8px;
      overflow-x: auto;
      max-width: 100%;
      margin: 0 0 14px;
      padding: 0 0 2px;
      scrollbar-width: none;
    }

    .filters::-webkit-scrollbar {
      display: none;
    }

    .filter {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      max-width: 100%;
      min-height: 38px;
      border-radius: var(--radius-pill);
      padding: 0 14px;
      color: rgba(248, 251, 255, 0.78);
      line-height: 1;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .filter.active {
      border-color: rgba(143, 211, 255, 0.48);
      background: rgba(37, 93, 135, 0.68);
      color: #eef9ff;
    }

    .section {
      display: none;
      min-width: 0;
      max-width: 100%;
    }

    .section.active {
      display: block;
      animation: viewIn 0.34s ease both;
    }

    .section-head {
      align-items: center;
      margin: 15px 0 9px;
    }

    .list,
    .details,
    .stack {
      display: grid;
      gap: 11px;
    }

    .card,
    .slot-day,
    .empty,
    .notice {
      width: 100%;
      max-width: 100%;
      min-width: 0;
      overflow: hidden;
      border: 1px solid var(--glass-border);
      border-radius: var(--radius-2xl);
      padding: 12px;
      background:
        linear-gradient(145deg, rgba(31, 44, 70, 0.76), rgba(5, 10, 24, 0.8)),
        var(--glass-soft);
      color: var(--text);
      text-align: left;
      box-shadow: 0 18px 48px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.16);
      backdrop-filter: var(--glass-blur-lg) var(--glass-saturation);
      -webkit-backdrop-filter: var(--glass-blur-lg) var(--glass-saturation);
    }

    .card:active,
    .button:active,
    .slot:active,
    .filter:active,
    .nav:active,
    button.is-pressing,
    .app-icon.is-pressing {
      transform: translateY(1px) scale(0.992);
    }

    button.is-pressing:not(.app-icon) {
      box-shadow: 0 0 0 2px rgba(142, 211, 255, 0.24), inset 0 1px 0 var(--glass-highlight);
    }

    .card-top {
      margin-bottom: 9px;
    }

    .meta {
      display: flex;
      flex-wrap: wrap;
      gap: 7px;
      margin-top: 11px;
      min-width: 0;
    }

    .meta span {
      max-width: 100%;
      border-radius: var(--radius-pill);
      padding: 6px 9px;
      background: rgba(7, 16, 35, 0.8);
      color: rgba(236, 243, 255, 0.75);
      font-size: 12px;
      line-height: 1;
      overflow-wrap: anywhere;
    }

    .card-insights {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 8px;
      margin-top: 11px;
    }

    .card-insight {
      min-width: 0;
      border: 1px solid rgba(225, 240, 255, 0.12);
      border-radius: 16px;
      padding: 9px 10px;
      background: rgba(5, 12, 28, 0.46);
    }

    .card-insight strong {
      display: block;
      color: rgba(248, 251, 255, 0.94);
      font-size: 15px;
      font-weight: var(--font-weight-semibold);
      line-height: 1.05;
    }

    .card-insight span {
      display: block;
      margin-top: 3px;
      color: var(--text-tertiary);
      font-size: 11px;
      font-weight: var(--font-weight-regular);
      line-height: 1.2;
    }

    .slot-day {
      padding: 13px;
    }

    .slot-head {
      align-items: center;
      margin-bottom: 11px;
    }

    .slot-grid {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 9px;
      min-width: 0;
    }

    .slot {
      min-width: 0;
      min-height: 46px;
      border: 1px solid rgba(143, 211, 255, 0.31);
      border-radius: var(--radius-pill);
      background:
        linear-gradient(135deg, rgba(143, 211, 255, 0.22), rgba(183, 156, 255, 0.14)),
        rgba(8, 18, 39, 0.84);
      color: #f4fbff;
      font-weight: 800;
      overflow-wrap: anywhere;
      box-shadow: inset 0 1px 0 var(--glass-highlight);
    }

    .slot.occupied {
      border-color: rgba(255, 154, 168, 0.34);
      background: rgba(115, 35, 50, 0.72);
      color: #ffe7eb;
    }

    .slot.template-on {
      border-color: rgba(143, 246, 208, 0.36);
      background: rgba(29, 119, 94, 0.6);
      color: #e8fff6;
    }

    .slot.selected {
      border-color: rgba(255, 255, 255, 0.72);
      background: transparent;
      box-shadow: 0 0 0 3px rgba(155, 220, 255, 0.12);
    }

    .empty,
    .notice {
      color: rgba(236, 243, 255, 0.8);
      line-height: 1.45;
    }

    .notice strong {
      color: var(--text);
    }

    .profile-row {
      align-items: center;
    }

    .compact-list {
      display: grid;
      gap: 8px;
      margin-top: 10px;
      min-width: 0;
    }

    .mini-row {
      display: grid;
      grid-template-columns: minmax(0, 1fr) auto;
      gap: 10px;
      align-items: center;
      min-width: 0;
      max-width: 100%;
      border-radius: var(--radius-xl);
      padding: 11px 12px;
      border: 1px solid var(--border-subtle);
      background: rgba(5, 12, 27, 0.76);
    }

    .mini-row strong,
    .mini-row span,
    .mini-row p {
      min-width: 0;
      overflow-wrap: anywhere;
    }

    .form-grid {
      display: grid;
      gap: 8px;
      margin-top: 10px;
    }

    .field,
    .select {
      width: 100%;
      min-height: 46px;
      border: 1px solid rgba(225, 240, 255, 0.3);
      border-radius: var(--radius-xl);
      outline: 0;
      padding: 0 14px;
      background: rgba(3, 9, 22, 0.86);
      color: var(--text);
      box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14);
    }

    .field:focus,
    .select:focus {
      border-color: rgba(155, 220, 255, 0.66);
      background: rgba(8, 18, 38, 0.95);
    }

    .field::placeholder {
      color: rgba(236, 243, 255, 0.6);
    }

    textarea.field {
      min-height: 92px;
      padding-top: 12px;
      padding-bottom: 12px;
      line-height: 1.35;
      resize: vertical;
    }

    body.ai-view #app-back-row {
      display: none;
    }

    #view-ai.active {
      display: flex;
      flex: 1 1 auto;
      flex-direction: column;
      min-height: 0;
      overflow: hidden;
      animation: none;
    }

    #view-ai .section-head {
      flex: 0 0 auto;
      flex-wrap: nowrap;
      margin: 3px 0 10px;
    }

    .ai-title-group {
      display: flex;
      align-items: center;
      gap: 10px;
      min-width: 0;
    }

    .ai-back-button {
      width: 38px;
      height: 38px;
      border: 1px solid rgba(225, 240, 255, 0.22);
      border-radius: var(--radius-round);
      display: grid;
      place-items: center;
      flex: 0 0 auto;
      color: var(--text);
      background: rgba(7, 14, 30, 0.8);
    }

    .ai-back-button svg {
      width: 22px;
      height: 22px;
      fill: none;
      stroke: currentColor;
      stroke-width: 2.5;
      stroke-linecap: round;
      stroke-linejoin: round;
    }

    .ai-chat-shell {
      display: flex;
      flex: 1 1 auto;
      flex-direction: column;
      gap: 9px;
      min-height: 0;
      overflow: hidden;
    }

    .ai-chat-intro {
      flex: 0 0 auto;
      padding: 10px 12px;
      border: 1px solid rgba(155, 220, 255, 0.22);
      border-radius: 17px;
      background: linear-gradient(135deg, rgba(42, 95, 155, 0.35), rgba(91, 65, 151, 0.24));
      color: var(--text-secondary);
      font-size: 13px;
      line-height: 1.35;
    }

    .ai-chat-shell.has-messages .ai-chat-intro {
      display: none;
    }

    .ai-messages {
      display: flex;
      flex: 1 1 auto;
      flex-direction: column;
      gap: 10px;
      min-height: 0;
      max-height: none;
      overflow-y: auto;
      overscroll-behavior: contain;
      padding: 5px 3px 10px;
      scroll-behavior: smooth;
      scrollbar-width: thin;
      scrollbar-color: rgba(155, 220, 255, 0.45) transparent;
      -webkit-overflow-scrolling: touch;
    }

    .ai-message {
      align-self: flex-start;
      width: fit-content;
      max-width: min(90%, 430px);
      padding: 10px 13px 12px;
      border-radius: 18px 18px 18px 5px;
      background: rgba(10, 20, 41, 0.95);
      border: 1px solid rgba(155, 220, 255, 0.19);
      color: var(--text);
      font-size: 15px;
      line-height: 1.5;
      overflow-wrap: anywhere;
      box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
    }

    .ai-message-role {
      margin-bottom: 5px;
      color: var(--accent);
      font-size: 11px;
      font-weight: 800;
      letter-spacing: 0.05em;
      text-transform: uppercase;
    }

    .ai-message-content strong {
      color: #ffffff;
      font-weight: 800;
    }

    .ai-message.user {
      align-self: flex-end;
      border-radius: 18px 18px 5px 18px;
      background: linear-gradient(135deg, rgba(34, 113, 172, 0.96), rgba(91, 72, 177, 0.92));
      border-color: rgba(210, 235, 255, 0.28);
    }

    .ai-message.user .ai-message-role {
      color: rgba(255, 255, 255, 0.72);
    }

    .ai-message.pending {
      opacity: 0.68;
    }

    .ai-empty {
      margin: auto;
      max-width: 300px;
      text-align: center;
      color: rgba(236, 243, 255, 0.7);
      line-height: 1.5;
    }

    .ai-composer {
      position: relative;
      flex: 0 0 auto;
      display: grid;
      grid-template-columns: minmax(0, 1fr) auto;
      align-items: end;
      gap: 8px;
      padding: 8px;
      border: 1px solid rgba(225, 240, 255, 0.24);
      border-radius: 23px;
      background: rgba(4, 10, 24, 0.97);
      box-shadow: 0 16px 36px rgba(0, 0, 0, 0.38);
      backdrop-filter: blur(18px);
      -webkit-backdrop-filter: blur(18px);
    }

    .ai-composer .field {
      min-height: 46px;
      max-height: 112px;
      padding: 12px 14px;
      border-radius: 17px;
      line-height: 1.35;
      resize: none;
    }

    .ai-send {
      width: 48px;
      min-width: 48px;
      height: 48px;
      padding: 0;
      border-radius: var(--radius-md);
      display: grid;
      place-items: center;
      font-size: 19px;
    }

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

    .location-hint {
      border: 1px solid rgba(155, 220, 255, 0.22);
      border-radius: 20px;
      padding: 10px 12px;
      background: rgba(5, 12, 27, 0.72);
      color: rgba(236, 243, 255, 0.76);
      font-size: 13px;
      line-height: 1.35;
    }

    .action-row {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      justify-content: flex-end;
      margin-top: 10px;
      min-width: 0;
      max-width: 100%;
    }

    .action-row.stack {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      width: min(100%, 290px);
    }

    .action-row.stack .wide {
      grid-column: 1 / -1;
    }

    .button-grid {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 8px;
      margin-top: 10px;
    }

    .button-grid .wide {
      grid-column: 1 / -1;
    }

    .mini-row > .button-grid {
      min-width: min(250px, 46vw);
      margin-top: 0;
    }

    .app-menu-panel {
      border: 1px solid rgba(255, 255, 255, 0.14);
      background:
        linear-gradient(180deg, rgba(33, 45, 74, 0.82), rgba(8, 12, 24, 0.9)),
        rgba(18, 18, 22, 0.9);
      box-shadow: 0 24px 70px rgba(0, 0, 0, 0.62), inset 0 1px 0 rgba(255, 255, 255, 0.16);
      backdrop-filter: blur(30px) saturate(170%);
      -webkit-backdrop-filter: blur(30px) saturate(170%);
    }

    .app-grid {
      display: grid;
      grid-template-columns: repeat(4, minmax(0, 1fr));
      gap: 18px 10px;
      margin: 14px 0 24px;
      min-width: 0;
    }

    .app-icon {
      display: grid;
      justify-items: center;
      align-content: start;
      gap: 7px;
      min-width: 0;
      color: var(--text);
      background: transparent;
      text-align: center;
      animation: appIconIn 0.34s ease both;
      outline: none;
      box-shadow: none;
      -webkit-tap-highlight-color: transparent;
    }

    .app-icon:focus:not(:focus-visible) {
      outline: none;
      box-shadow: none;
    }

    .app-icon:active .app-icon-tile {
      transform: translateY(2px) scale(0.94);
      filter: brightness(1.12);
    }

    .app-icon.is-pressing .app-icon-tile {
      box-shadow:
        0 18px 34px rgba(0, 0, 0, 0.42),
        0 0 0 2px rgba(142, 211, 255, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.2),
        inset 0 -14px 28px rgba(29, 90, 178, 0.18);
    }

    .app-icon-tile {
      position: relative;
      display: grid;
      place-items: center;
      width: var(--icon-size, 72px);
      height: var(--icon-size, 72px);
      border-radius: 22px;
      background:
        radial-gradient(circle at 28% 18%, rgba(120, 196, 255, 0.14), transparent 42%),
        linear-gradient(145deg, rgba(20, 27, 43, 0.92), rgba(3, 8, 20, 0.9));
      border: 1px solid rgba(180, 220, 255, 0.15);
      box-shadow:
        0 12px 24px rgba(0, 0, 0, 0.32),
        inset 0 1px 0 rgba(255, 255, 255, 0.14);
      font-size: 30px;
      transition: transform 0.18s ease, filter 0.18s ease;
    }

    .app-icon > span:last-child {
      display: block;
      width: 100%;
      max-width: min(100%, 108px);
      min-height: 14px;
      color: rgba(248, 251, 255, 0.82);
      font-size: clamp(10.5px, 2.8vw, 11.5px);
      font-weight: 560;
      line-height: 1.12;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      overflow-wrap: normal;
      text-shadow: 0 1px 6px rgba(0, 0, 0, 0.46);
    }

    .app-badge {
      position: absolute;
      top: -6px;
      right: -6px;
      min-width: 22px;
      height: 22px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      box-sizing: border-box;
      padding: 0 6px;
      border-radius: var(--radius-pill);
      background: #ff453a;
      border: 0;
      color: white;
      font-size: 12px;
      font-weight: 900;
      line-height: 1;
      font-variant-numeric: tabular-nums;
      text-rendering: geometricPrecision;
      text-shadow: none;
      box-shadow: none;
      transform: translateZ(0);
    }

    .app-badge-count {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 100%;
      height: 100%;
      max-width: none;
      color: #fff;
      font-size: inherit;
      font-weight: inherit;
      line-height: 1;
      text-shadow: none;
      transform: translateY(0.5px);
    }

    @keyframes appIconIn {
      from { opacity: 0; transform: translateY(8px) scale(0.94); }
      to { opacity: 1; transform: translateY(0) scale(1); }
    }

    body.no-motion *,
    body.no-motion *::before,
    body.no-motion *::after {
      animation: none !important;
      transition-duration: 0.01ms !important;
      scroll-behavior: auto !important;
    }

    body.no-motion .home-hero::before {
      transform: none;
    }

    body.no-emboss::after {
      background: linear-gradient(180deg, rgba(2, 8, 23, 0.12), rgba(2, 8, 23, 0.76));
      opacity: 1;
      filter: none;
    }

    .widget-grid {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 10px;
      margin-bottom: 12px;
    }

    .widget-card {
      min-width: 0;
      border-radius: var(--radius-2xl);
      padding: 14px;
      color: var(--text);
      text-align: left;
    }

    .widget-card strong {
      display: block;
      font-size: 22px;
      line-height: 1;
      margin-top: 8px;
    }

    .widget-card span {
      color: var(--soft);
      font-size: 12px;
    }

    .app-menu {
      position: fixed;
      inset: 0;
      z-index: 30;
      display: none;
      padding: calc(20px + env(safe-area-inset-top)) 14px calc(24px + env(safe-area-inset-bottom));
      background: rgba(0, 0, 0, 0.24);
      backdrop-filter: blur(12px);
      -webkit-backdrop-filter: blur(12px);
    }

    .app-menu.open {
      display: block;
      animation: viewIn 0.24s ease both;
    }

    .app-menu-panel {
      width: min(100%, 540px);
      max-height: calc(100vh - 44px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
      margin: 0 auto;
      overflow-y: auto;
      border-radius: 28px;
      padding: 18px;
    }

    .menu-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      margin-bottom: 16px;
    }

    .menu-list {
      display: grid;
      gap: 0;
      margin-top: 14px;
      border-top: 1px solid rgba(255, 255, 255, 0.12);
    }

    .menu-row {
      display: grid;
      grid-template-columns: 28px minmax(0, 1fr) auto;
      gap: 10px;
      align-items: center;
      min-height: 48px;
      border-bottom: 1px solid rgba(255, 255, 255, 0.1);
      background: transparent;
      color: var(--text);
      text-align: left;
    }

    .menu-row small {
      color: var(--soft);
    }

    .app-detail-hero {
      display: grid;
      gap: 12px;
      margin-bottom: 18px;
      padding: 16px;
    }

    .app-detail-hero h2 {
      max-width: 18rem;
      font-size: clamp(22px, 6vw, 27px);
      font-weight: var(--font-weight-semibold);
      line-height: 1.08;
      letter-spacing: -0.02em;
    }

    .app-detail-hero .muted {
      max-width: 28rem;
      font-size: 15px;
      line-height: 1.4;
      color: var(--text-tertiary);
    }

    .app-detail-actions,
    .path-grid {
      display: grid;
      gap: 10px;
    }

    .path-card {
      width: 100%;
      min-height: 86px;
      border: 1px solid rgba(225, 240, 255, 0.18);
      border-radius: var(--radius-2xl);
      padding: 14px;
      background: rgba(5, 12, 28, 0.58);
      color: var(--text-primary);
      text-align: left;
      box-shadow: var(--shadow-inset);
    }

    .path-card strong {
      display: block;
      margin-bottom: 4px;
      font-size: 16px;
    }

    .path-card span {
      color: var(--text-tertiary);
      font-size: 13px;
      line-height: 1.35;
    }

    .market-toolbar-compact {
      margin-bottom: 18px;
    }

    .market-toolbar-compact .search {
      min-height: 44px;
    }

    .map-card {
      overflow: hidden;
      padding: 0;
    }

    .map-info {
      padding: 16px;
    }

    .map-frame {
      display: block;
      width: 100%;
      height: min(58vh, 360px);
      border: 0;
      background: rgba(4, 9, 20, 0.88);
    }

    .map-actions {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 8px;
      padding: 0 16px 16px;
    }

    details.disclosure {
      margin-top: 10px;
      border: 1px solid var(--border-subtle);
      border-radius: 20px;
      padding: 9px 10px;
      background: rgba(5, 12, 27, 0.64);
    }

    details.disclosure summary {
      cursor: pointer;
      list-style: none;
      font-weight: 850;
    }

    details.disclosure summary::-webkit-details-marker {
      display: none;
    }

    .action-row > * {
      min-width: 0;
      max-width: 100%;
    }

    .tiny-button {
      min-height: 34px;
      border-radius: var(--radius-pill);
      padding: 0 11px;
      border: 1px solid rgba(225, 240, 255, 0.34);
      background: rgba(8, 16, 35, 0.9);
      color: var(--text);
      font-weight: 800;
      white-space: normal;
      overflow-wrap: anywhere;
      backdrop-filter: var(--glass-blur-lg) var(--glass-saturation);
      -webkit-backdrop-filter: var(--glass-blur-lg) var(--glass-saturation);
    }

    .tiny-button.danger {
      border-color: rgba(255, 154, 168, 0.46);
      background: rgba(95, 20, 35, 0.34);
      color: #ffecef;
    }

    .segmented {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 6px;
      padding: 5px;
      min-width: 0;
      max-width: 100%;
      border: 1px solid rgba(225, 240, 255, 0.24);
      border-radius: var(--radius-pill);
      background: rgba(4, 10, 23, 0.78);
      backdrop-filter: var(--glass-blur-lg) var(--glass-saturation);
      -webkit-backdrop-filter: var(--glass-blur-lg) var(--glass-saturation);
    }

    .segment {
      min-width: 0;
      min-height: 36px;
      border-radius: var(--radius-pill);
      background: transparent;
      color: var(--muted);
      font-weight: 800;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .segment.active {
      background: rgba(45, 94, 134, 0.58);
      color: var(--text);
      box-shadow: inset 0 1px 0 var(--glass-highlight);
    }

    .bottom-nav {
      position: fixed;
      right: 0;
      bottom: 0;
      left: 0;
      z-index: 10;
      padding: 15px 14px calc(16px + env(safe-area-inset-bottom));
      background: transparent;
      pointer-events: none;
      transition: opacity 0.16s ease, transform 0.16s ease, visibility 0s linear 0s;
    }

    /* iOS Telegram moves fixed elements above the software keyboard. Keep the
       navigation out of the typing area and restore it after editing. */
    body.keyboard-open .bottom-nav {
      opacity: 0;
      visibility: hidden;
      transform: translateY(calc(100% + env(safe-area-inset-bottom) + 24px));
      transition: opacity 0.16s ease, transform 0.16s ease, visibility 0s linear 0.16s;
    }

    .bottom-nav::before {
      display: none;
    }

    .nav-inner {
      position: relative;
      display: grid;
      grid-template-columns: repeat(5, 1fr);
      gap: 6px;
      width: min(100%, 540px);
      margin: 0 auto;
      padding: 8px;
      border: 1px solid rgba(236, 243, 255, 0.48);
      border-radius: 32px;
      background: transparent;
      box-shadow: inset 0 0 0 1px rgba(7, 13, 28, 0.18);
      backdrop-filter: none;
      -webkit-backdrop-filter: none;
      pointer-events: auto;
      overflow: hidden;
    }

    .nav-inner::before {
      display: none;
    }

    .nav-indicator {
      position: absolute;
      top: 8px;
      left: 8px;
      z-index: 1;
      width: calc((100% - 40px) / 5);
      height: calc(100% - 16px);
      border: 1px solid rgba(225, 240, 255, 0.28);
      border-radius: 25px;
      background: transparent;
      box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
      backdrop-filter: none;
      -webkit-backdrop-filter: none;
      pointer-events: none;
      transform: translate3d(0, 0, 0);
      transition:
        transform var(--duration-slow) var(--easing-spring),
        width var(--duration-normal) var(--easing-standard),
        height var(--duration-normal) var(--easing-standard);
    }

    .nav {
      position: relative;
      z-index: 2;
      min-width: 0;
      min-height: 61px;
      border-radius: 25px;
      background: transparent;
      color: rgba(236, 243, 255, 0.74);
      display: inline-flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 5px;
      font-size: 13px;
      font-weight: 800;
      line-height: 1;
      letter-spacing: 0;
      text-shadow: none;
    }

    .nav-icon {
      width: 24px;
      height: 24px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.72));
    }

    .nav-icon svg {
      width: 24px;
      height: 24px;
      stroke: currentColor;
      stroke-width: 2.35;
      fill: none;
      stroke-linecap: round;
      stroke-linejoin: round;
    }

    .nav-label {
      max-width: 100%;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .nav.active {
      color: var(--text-primary);
      text-shadow: none;
    }

    .toast {
      position: fixed;
      right: 16px;
      bottom: calc(94px + env(safe-area-inset-bottom));
      left: 16px;
      z-index: 20;
      max-width: 508px;
      margin: 0 auto;
      border: 1px solid rgba(143, 211, 255, 0.32);
      border-radius: 26px;
      padding: 14px 16px;
      background: rgba(11, 18, 37, 0.78);
      color: var(--text);
      box-shadow: var(--shadow);
      opacity: 0;
      transform: translateY(12px) scale(0.98);
      pointer-events: none;
      transition: opacity 0.2s ease, transform 0.2s ease;
      backdrop-filter: var(--glass-blur-lg) var(--glass-saturation);
      -webkit-backdrop-filter: var(--glass-blur-lg) var(--glass-saturation);
    }

    .toast.show {
      opacity: 1;
      transform: translateY(0) scale(1);
    }

    /* Component system layer: aliases preserve existing markup while documenting the canonical classes. */
    .c-card,
    .card,
    .slot-day,
    .empty,
    .notice {
      --component-card-padding: 12px;
      --component-card-radius: var(--radius-2xl);
      --component-card-border: var(--glass-border);
      --component-card-background: linear-gradient(145deg, rgba(31, 44, 70, 0.76), rgba(5, 10, 24, 0.8)), var(--glass-soft);
      --component-card-shadow: var(--shadow-md), var(--shadow-inset);
    }

    .c-card {
      width: 100%;
      max-width: 100%;
      min-width: 0;
      overflow: hidden;
      border: 1px solid var(--component-card-border);
      border-radius: var(--component-card-radius);
      padding: var(--component-card-padding);
      background: var(--component-card-background);
      color: var(--text-primary);
      text-align: left;
      box-shadow: var(--component-card-shadow);
    }

    .c-card--glass,
    .glass {
      --component-card-radius: 30px;
      --component-card-border: var(--border-default);
      --component-card-background: linear-gradient(145deg, rgba(35, 52, 88, 0.68), rgba(6, 12, 28, 0.72)), var(--surface-primary);
      --component-card-shadow: var(--shadow-lg), var(--shadow-inset);
      backdrop-filter: var(--glass-blur-lg) var(--glass-saturation);
      -webkit-backdrop-filter: var(--glass-blur-lg) var(--glass-saturation);
    }

    .c-card--elevated {
      --component-card-background: var(--surface-elevated);
      --component-card-shadow: var(--shadow-lg), var(--shadow-inset);
    }

    .c-card--interactive,
    .card[data-instructor],
    .card[data-school] {
      cursor: pointer;
      transition: transform var(--duration-fast) var(--easing-standard), border-color var(--duration-normal) var(--easing-standard), background var(--duration-normal) var(--easing-standard);
    }

    .c-stat-card,
    .stat {
      --component-card-padding: 13px 12px;
      --component-card-radius: var(--radius-2xl);
      --component-card-border: rgba(225, 240, 255, 0.24);
      --component-card-background: rgba(5, 12, 28, 0.76);
      --component-card-shadow: var(--shadow-inset);
    }

    .c-button,
    .button,
    .tiny-button,
    .filter,
    .language-option,
    .segment,
    .nav,
    .menu-row {
      --component-button-height: var(--control-height-lg);
      --component-button-radius: var(--radius-pill);
      --component-button-padding-x: 18px;
      --component-button-transition: transform var(--duration-fast) var(--easing-standard), background var(--duration-normal) var(--easing-standard), border-color var(--duration-normal) var(--easing-standard), box-shadow var(--duration-normal) var(--easing-standard), opacity var(--duration-fast) var(--easing-standard);
      min-width: 0;
      transition: var(--component-button-transition);
    }

    .c-button {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      min-height: var(--component-button-height);
      border-radius: var(--component-button-radius);
      padding: 0 var(--component-button-padding-x);
      background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(229, 238, 248, 0.9)), #eef5fb;
      color: var(--text-on-accent);
      font-weight: var(--font-weight-semibold);
      text-align: center;
      overflow-wrap: anywhere;
      box-shadow: 0 10px 24px rgba(30, 64, 112, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.88);
    }

    .c-button--secondary,
    .button.secondary,
    .filter,
    .tiny-button,
    .segment,
    .menu-row {
      border: 1px solid rgba(225, 240, 255, 0.34);
      background: rgba(8, 16, 35, 0.86);
      color: rgba(248, 251, 255, 0.94);
      font-weight: var(--font-weight-bold);
      box-shadow: var(--shadow-inset);
    }

    .c-button--ghost {
      border: 1px solid transparent;
      background: transparent;
      color: var(--text-secondary);
      box-shadow: none;
    }

    .c-button--danger,
    .button.danger,
    .tiny-button.danger {
      background: rgba(122, 39, 54, 0.72);
      color: #ffe3e7;
    }

    .c-button--success {
      border-color: rgba(143, 246, 208, 0.36);
      background: rgba(29, 119, 94, 0.6);
      color: #e8fff6;
    }

    .c-button--sm,
    .tiny-button,
    .filter {
      --component-button-height: var(--control-height-sm);
      --component-button-padding-x: 14px;
    }

    .c-button--lg {
      --component-button-height: var(--control-height-lg);
      --component-button-padding-x: 20px;
    }

    .c-icon-button,
    .icon-button,
    .back-button,
    .ai-back-button {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      min-width: var(--touch-target-min);
      min-height: var(--touch-target-min);
      transition: var(--component-button-transition, transform var(--duration-fast) var(--easing-standard), background var(--duration-normal) var(--easing-standard), border-color var(--duration-normal) var(--easing-standard), box-shadow var(--duration-normal) var(--easing-standard));
    }

    .c-field,
    .field,
    .select,
    .search,
    textarea {
      --component-field-border: rgba(225, 240, 255, 0.3);
      --component-field-radius: var(--radius-xl);
      --component-field-background: rgba(3, 9, 22, 0.86);
      --component-field-placeholder: rgba(236, 243, 255, 0.6);
      transition: border-color var(--duration-normal) var(--easing-standard), background var(--duration-normal) var(--easing-standard), box-shadow var(--duration-normal) var(--easing-standard);
    }

    .c-field {
      width: 100%;
      min-height: 46px;
      border: 1px solid var(--component-field-border);
      border-radius: var(--component-field-radius);
      padding: 0 14px;
      background: var(--component-field-background);
      color: var(--text-primary);
      box-shadow: var(--shadow-inset);
    }

    .c-field::placeholder {
      color: var(--component-field-placeholder);
    }

    .c-field:focus,
    .field:focus,
    .select:focus,
    .search:focus {
      border-color: var(--border-focus);
      box-shadow: var(--shadow-focus), var(--shadow-inset);
    }

    .c-field[aria-invalid="true"],
    .field[aria-invalid="true"] {
      border-color: rgba(255, 154, 168, 0.62);
      background: rgba(62, 17, 29, 0.48);
    }

    .c-badge,
    .c-status-badge,
    .status-chip,
    .pill,
    .meta span {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      border-radius: var(--radius-pill);
      font-size: var(--font-size-caption);
      line-height: 1;
      max-width: 100%;
    }

    .c-status-badge--success,
    .status-chip.good,
    .pill.good {
      border-color: rgba(143, 246, 208, 0.38);
      background: rgba(36, 122, 101, 0.42);
      color: #d9fff2;
    }

    .c-section-header,
    .section-head,
    .card-top,
    .slot-head,
    .profile-row {
      display: flex;
      justify-content: space-between;
      gap: var(--space-3);
      min-width: 0;
    }

    .c-empty-state,
    .empty,
    .notice {
      color: var(--text-secondary);
      line-height: var(--line-height-normal);
    }

    .c-toast,
    .toast {
      transition: opacity var(--duration-normal) var(--easing-standard), transform var(--duration-normal) var(--easing-standard), border-color var(--duration-normal) var(--easing-standard);
    }

    .c-modal,
    .c-bottom-sheet {
      border: 1px solid var(--glass-border);
      background: var(--surface-elevated);
      color: var(--text-primary);
      box-shadow: var(--shadow-lg), var(--shadow-inset);
      backdrop-filter: var(--glass-blur-lg) var(--glass-saturation);
      -webkit-backdrop-filter: var(--glass-blur-lg) var(--glass-saturation);
    }

    .c-modal {
      border-radius: var(--radius-2xl);
    }

    .c-bottom-sheet {
      border-radius: var(--radius-2xl) var(--radius-2xl) 0 0;
      padding-bottom: env(safe-area-inset-bottom);
    }

    .c-progress {
      width: 100%;
      height: 8px;
      overflow: hidden;
      border-radius: var(--radius-pill);
      background: var(--surface-secondary);
    }

    .c-progress__bar {
      height: 100%;
      border-radius: inherit;
      background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    }

    .c-avatar,
    .hero-avatar,
    .hero-avatar-fallback,
    .topbar-logo {
      border-radius: var(--radius-round);
      object-fit: cover;
    }

    .c-skeleton {
      min-height: 1em;
      border-radius: var(--radius-md);
      background: linear-gradient(90deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.06));
      background-size: 220% 100%;
      animation: skeletonLoading 1.2s var(--easing-standard) infinite;
    }

    @keyframes skeletonLoading {
      from { background-position: 100% 0; }
      to { background-position: -120% 0; }
    }


    @media (max-width: 370px) {
      .slot-grid,
      .stats,
      .coordinate-grid,
      .button-grid {
        grid-template-columns: 1fr;
      }

      .home-hero .stats {
        grid-template-columns: repeat(3, minmax(0, 1fr));
      }

      .app-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
      }

      .toolbar {
        grid-template-columns: 1fr;
      }
    }

    @media (max-width: 430px) {
      .hero-row,
      .card-top,
      .section-head,
      .slot-head,
      .profile-row {
        flex-wrap: wrap;
      }

      .mini-row {
        grid-template-columns: 1fr;
      }

      .top-actions {
        gap: 5px;
      }

      .brand-with-logo {
        gap: 8px;
      }

      .topbar-logo {
        width: var(--touch-target-min);
        height: var(--control-height-md);
      }

      .icon-button {
        width: 34px;
        height: 34px;
        border-radius: 12px;
      }

      .app-grid {
        gap: 12px 7px;
      }

      .app-icon-tile {
        --icon-size: 70px;
        border-radius: 21px;
      }

      .widget-grid {
        grid-template-columns: 1fr;
      }

      .mini-row > .action-row {
        justify-content: flex-start;
      }

      .mini-row > .button-grid {
        min-width: 0;
        width: 100%;
      }

      .action-row {
        justify-content: stretch;
      }

      .action-row .button,
      .action-row .tiny-button {
        flex: 1 1 min(180px, 100%);
      }

      .bottom-nav {
        padding-right: 10px;
        padding-left: 10px;
      }

      .nav-inner {
        gap: 4px;
        padding: 7px;
      }

      .nav {
        min-height: 58px;
        font-size: 12px;
      }

      .nav-icon,
      .nav-icon svg {
        width: 23px;
        height: 23px;
      }

    }
    @media (prefers-reduced-motion: reduce) {
      *,
      *::before,
      *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
      }
    }
