    @font-face {
      font-family: 'Manrope';
      src: url('/assets/fonts/plus-jakarta-sans/plus-jakarta-sans-cyrillic-ext.woff2') format('woff2');
      font-style: normal;
      font-weight: 400 800;
      font-display: optional;
    }

    @font-face {
      font-family: 'JetBrains Mono';
      src:
        local('SF Mono'),
        local('Menlo'),
        local('Consolas'),
        local('Liberation Mono');
      font-style: normal;
      font-weight: 400 700;
      font-display: optional;
    }

    *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

    :root {
      /* ── Backgrounds ── */
      --bg:       #0C0C10;
      --card:     #131318;
      --card-hi:  #1A1A22;

      /* ── Borders ── */
      --border:    rgba(255, 255, 255, 0.07);
      --border-hi: rgba(255, 255, 255, 0.12);

      /* ── Accent — blue, UI states only ── */
      --accent:      #38BDF8;
      --accent-dim:  rgba(56, 189, 248, 0.12);
      --accent-glow: rgba(56, 189, 248, 0.28);

      /* ── Green — money & income only ── */
      --green:     #4ADE80;
      --green-dim: rgba(74, 222, 128, 0.12);
      --holiday:   #f472b6;
      --holiday-dim: rgba(244, 114, 182, 0.14);

      /* ── Typography ── */
      --text:  #EEF2F8;
      --sub:   #8892A4;
      --muted: #3A4254;

      /* ── Radii ── */
      --r-card:  24px;
      --r-inner: 10px;
      --r-pill:  999px;

      /* ── Spacing ── */
      --h-pad: 16px;
      --gap:    8px;
      --c-pad: 20px;

      /* ── Backward-compat aliases ── */
      --text-muted:    var(--sub);
      --danger:        #f43f5e;
      --warn:          #f59e0b;
      --success:       var(--green);
      --radius:        var(--r-card);
      --radius-sm:     var(--r-inner);
      --accent-hover:  #7dd3fc;
      --bg-input:      rgba(26, 26, 34, 0.8);

      /* ── Z-layers ── */
      --layer-bg:      0;
      --layer-surface: 10;
      --layer-content: 20;
      --layer-floating: 120;
      --layer-overlay: 130;
      --layer-scrim:   140;

      /* ── Safe areas (updated by safe-area.js) ── */
      --safe-top:    env(safe-area-inset-top, 0px);
      --safe-right:  env(safe-area-inset-right, 0px);
      --safe-bottom: env(safe-area-inset-bottom, 0px);
      --safe-left:   env(safe-area-inset-left, 0px);

      /* ── Layout ── */
      --bottom-nav-height:      80px;
      --bottom-nav-safe-bottom: 0px;
      --bottom-nav-offset:      calc(14px + var(--bottom-nav-safe-bottom));
      --bottom-safe-fill-height: calc(14px + var(--bottom-nav-safe-bottom));
      --app-shell-bottom-reserve: var(--bottom-nav-height);
      --page-padding-x:    var(--h-pad);
      --page-padding-top:  calc(16px + var(--safe-top));
      --page-padding-bottom: 20px;
      --select-gap: 10px;
      --app-viewport-height: 100dvh;
      --keyboard-focus-scroll-bottom: 160px;
    }

    input[type="number"] { -moz-appearance: textfield; }
    input[type="number"]::-webkit-outer-spin-button,
    input[type="number"]::-webkit-inner-spin-button {
      -webkit-appearance: none;
      margin: 0;
    }

    html, body {
      height: 100%;
      min-height: var(--app-viewport-height);
      background: var(--bg);
      color: var(--text);
      font-family: 'Manrope', sans-serif;
      font-size: 15px;
      line-height: 1.5;
      overflow: hidden;
      scroll-padding-bottom: 24px;
      color-scheme: dark;
    }

    html {
      height: 100%;
      min-height: 100dvh;
      background-color: var(--bg);
    }

    /* Subtle ambient glow top-right */
    body::before {
      content: '';
      position: fixed;
      top: -100px;
      right: -40px;
      width: 300px;
      height: 220px;
      background: radial-gradient(ellipse, rgba(56, 189, 248, 0.07) 0%, transparent 70%);
      pointer-events: none;
      z-index: var(--layer-bg);
    }

    body::after {
      content: none;
    }

    /* ── Hide scrollbars (keep scroll behavior) ── */
    *,
    *::before,
    *::after {
      scrollbar-width: none;
      -ms-overflow-style: none;
    }

    *::-webkit-scrollbar {
      display: none;
    }

    /* Explicitly keep scrolling containers scrollable without visible bars */
    .app-content,
    .auth-gate,
    .bottom-sheet,
    .docs-pdf-scroll,
    .shift-detail-body {
      -ms-overflow-style: none;
      scrollbar-width: none;
    }

    .app-content::-webkit-scrollbar,
    .auth-gate::-webkit-scrollbar,
    .bottom-sheet::-webkit-scrollbar,
    .docs-pdf-scroll::-webkit-scrollbar,
    .shift-detail-body::-webkit-scrollbar {
      display: none;
    }

    /* Startup must never block on font loading. */
    html.fonts-ready #authGate,
    html.fonts-ready #appShell {
      transition: opacity 0.12s ease;
    }


    .is-standalone-pwa,
    .is-standalone-pwa body {
      height: 100vh;
      min-height: 100vh;
      overscroll-behavior-x: none;
    }

    body {
      position: relative;
      overflow: hidden;
    }

    body.is-keyboard-open {
      --app-shell-bottom-reserve: 0px;
    }

    .app {
      width: min(480px, 100%);
      max-width: 480px;
      margin: 0 auto;
      padding: var(--page-padding-top) var(--page-padding-x) 0 var(--page-padding-x);
      min-height: var(--app-viewport-height);
      height: var(--app-viewport-height);
      display: flex;
      flex-direction: column;
      position: relative;
      z-index: var(--layer-content);
      min-width: 0;
      overflow: hidden;
    }

    .is-standalone-pwa .app,
    .is-standalone-pwa .auth-gate {
      height: 100vh;
      min-height: 100vh;
    }

    @supports (height: 100lvh) {
      .is-standalone-pwa,
      .is-standalone-pwa body,
      .is-standalone-pwa .app,
      .is-standalone-pwa .auth-gate {
        height: 100lvh;
        min-height: 100lvh;
      }
    }

    /* ── Utility classes ── */
    .hidden { display: none !important; }

    .card {
      background: var(--card);
      border: 1px solid var(--border);
      border-radius: var(--r-card);
      padding: var(--c-pad);
    }

    .mono {
      font-family: 'JetBrains Mono', monospace;
    }

    .money {
      font-family: 'JetBrains Mono', monospace;
      color: var(--green);
      font-weight: 700;
    }

    .section-label {
      font-size: 10px;
      font-weight: 800;
      letter-spacing: 0.12em;
      text-transform: uppercase;
      color: var(--muted);
    }

    .chip {
      display: inline-flex;
      align-items: center;
      gap: 4px;
      padding: 3px 10px;
      border-radius: var(--r-pill);
      font-size: 10px;
      font-weight: 700;
    }
    .chip-green {
      background: var(--green-dim);
      border: 1px solid rgba(74, 222, 128, 0.2);
      color: var(--green);
    }
    .chip-accent {
      background: var(--accent-dim);
      border: 1px solid rgba(56, 189, 248, 0.2);
      color: var(--accent);
    }

    .divider {
      height: 1px;
      background: var(--border);
    }

    /* ── Auth Gate ── */
    .auth-gate {
      min-height: var(--app-viewport-height);
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 24px 18px;
      background: var(--bg);
      position: relative;
      z-index: var(--layer-content);
      min-width: 0;
      overflow-x: hidden;
      overflow-y: auto;
      -webkit-overflow-scrolling: touch;
    }

    .auth-card {
      width: 100%;
      max-width: 392px;
      background: var(--card);
      border: 1px solid var(--border-hi);
      border-radius: var(--r-card);
      padding: 30px 24px;
      box-shadow: 0 36px 90px rgba(0, 0, 0, 0.56);
      position: relative;
      overflow: visible;
      isolation: isolate;
      z-index: var(--layer-surface);
    }

    .auth-card[data-auth-mode="local"] {
      border-color: rgba(56, 189, 248, 0.2);
    }

    .auth-card[data-auth-state="error"] {
      border-color: rgba(244, 63, 94, 0.3);
    }

    .auth-title {
      font-size: 26px;
      line-height: 1.2;
      letter-spacing: -0.04em;
      font-weight: 800;
      margin-bottom: 10px;
      color: var(--text);
    }

    .auth-kicker {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      width: fit-content;
      padding: 6px 10px;
      border-radius: var(--r-pill);
      margin-bottom: 14px;
      border: 1px solid var(--border);
      background: rgba(255, 255, 255, 0.04);
      color: var(--sub);
      font-size: 11px;
      font-weight: 700;
      letter-spacing: 0.11em;
      text-transform: uppercase;
    }

    .auth-kicker::before {
      content: '';
      width: 7px;
      height: 7px;
      border-radius: var(--r-pill);
      background: var(--green);
      box-shadow: 0 0 0 4px var(--green-dim);
    }

    .auth-card[data-auth-mode="local"] .auth-kicker::before {
      background: var(--accent);
      box-shadow: 0 0 0 4px var(--accent-dim);
    }

    .auth-banner {
      display: flex;
      align-items: flex-start;
      gap: 12px;
      margin: 14px 0 16px;
      padding: 14px;
      border-radius: var(--r-inner);
      border: 1px solid var(--border);
      background: var(--card-hi);
      color: var(--text);
    }

    .auth-banner.hidden { display: none; }

    .auth-banner-icon {
      flex: 0 0 auto;
      width: 30px;
      height: 30px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      border-radius: var(--r-inner);
      background: var(--accent-dim);
      color: var(--accent);
      font-size: 16px;
      font-weight: 800;
    }

    .auth-banner.is-local .auth-banner-icon {
      background: var(--accent-dim);
      color: var(--accent);
    }

    .auth-banner.is-error .auth-banner-icon {
      background: rgba(244, 63, 94, 0.12);
      color: var(--danger);
    }

    .auth-banner-title {
      font-size: 14px;
      font-weight: 700;
      line-height: 1.35;
      color: var(--text);
      margin-bottom: 3px;
    }

    .auth-banner-text {
      font-size: 13px;
      line-height: 1.5;
      color: var(--sub);
    }

    .auth-actions {
      display: grid;
      gap: 10px;
      margin-top: 6px;
    }

    .auth-primary {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      min-height: 46px;
      padding: 0 16px;
      border-radius: var(--r-inner);
      text-decoration: none;
      cursor: pointer;
      border: none;
      background: var(--accent);
      color: #000e1a;
      font-family: 'Manrope', sans-serif;
      font-size: 14px;
      font-weight: 800;
      letter-spacing: -0.01em;
      box-shadow: 0 4px 20px var(--accent-glow);
      transition: transform 0.18s ease, box-shadow 0.18s ease;
    }

    .auth-primary:hover {
      transform: translateY(-1px);
      box-shadow: 0 8px 28px var(--accent-glow);
    }

    .auth-primary:active { transform: translateY(0); }

    .auth-primary-hint {
      font-size: 12px;
      line-height: 1.5;
      color: var(--sub);
    }

    .auth-widget-shell {
      margin-top: 14px;
      padding: 14px;
      border-radius: var(--r-inner);
      background: var(--card-hi);
      border: 1px solid var(--border);
    }

    .auth-widget-shell.hidden { display: none; }

    .auth-text {
      font-size: 14px;
      line-height: 1.6;
      color: var(--sub);
      margin-bottom: 0;
    }

    .auth-note {
      font-size: 12px;
      line-height: 1.5;
      color: var(--sub);
      margin: 10px 0 0;
      min-height: 18px;
    }

    .auth-status {
      font-size: 13px;
      line-height: 1.5;
      color: var(--green);
      margin: 0 0 8px;
      min-height: 22px;
    }

    .auth-status:empty {
      display: none;
      min-height: 0;
      margin-bottom: 0;
    }

    .auth-widget {
      min-height: 48px;
      margin: 0;
      display: flex;
      justify-content: center;
    }

    .auth-widget > * {
      width: 100%;
      max-width: 100%;
    }

    .auth-error {
      font-size: 13px;
      line-height: 1.5;
      color: var(--danger);
      margin-top: 10px;
      min-height: 18px;
      display: none;
    }

    .auth-card[data-auth-state="error"] .auth-error { display: block; }

    .auth-retry {
      display: none;
      margin-top: 10px;
      font-size: 13px;
      line-height: 1.2;
      color: var(--accent);
      background: transparent;
      border: none;
      padding: 0;
      cursor: pointer;
      text-align: left;
      -webkit-tap-highlight-color: transparent;
    }

    .auth-retry.visible { display: inline-block; }

    /* ── Offline banner ── */
    .offline-banner {
      background: var(--card);
      border: 1px solid var(--border);
      border-radius: var(--r-inner);
      padding: 12px 14px;
      margin-bottom: 12px;
      display: flex;
      flex-direction: column;
      gap: 4px;
    }

    .offline-banner.hidden { display: none; }

    .offline-banner-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
    }

    .offline-banner-title {
      font-size: 13px;
      font-weight: 700;
      color: var(--text);
    }

    .offline-banner-status {
      font-size: 11px;
      color: var(--sub);
    }

    .offline-banner-text {
      font-size: 12px;
      color: var(--sub);
      line-height: 1.45;
    }

    /* ── Usage stats footer ── */
    .usage-stats-note {
      font-size: 11px;
      color: var(--muted);
      text-align: center;
      padding: 12px 0 4px;
    }

    /* ── Install prompt card ── */
    .install-prompt-card {
      background: var(--card);
      border: 1px solid var(--border);
      border-radius: var(--r-card);
      padding: var(--c-pad);
      margin-top: 16px;
      margin-bottom: 16px;
    }

    .install-prompt-card.hidden { display: none; }

    .install-prompt-title {
      font-size: 16px;
      font-weight: 700;
      color: var(--text);
      margin-bottom: 6px;
    }

    .install-prompt-text {
      font-size: 13px;
      color: var(--sub);
      line-height: 1.5;
      margin-bottom: 16px;
    }

    .install-prompt-actions {
      display: grid;
      justify-items: center;
      gap: 8px;
      width: 100%;
      margin-top: 2px;
    }

    .install-prompt-actions .btn-secondary {
      min-width: 216px;
      justify-self: center;
    }

    .install-dismiss-btn {
      padding: 0;
      justify-self: center;
    }

    /* ── Secondary / link buttons ── */
    .btn-secondary {
      height: 40px;
      padding: 0 16px;
      border-radius: var(--r-inner);
      background: var(--accent-dim);
      border: 1px solid rgba(56, 189, 248, 0.2);
      color: var(--accent);
      font-family: 'Manrope', sans-serif;
      font-size: 13px;
      font-weight: 700;
      cursor: pointer;
      transition: background 0.15s;
      -webkit-tap-highlight-color: transparent;
    }

    .btn-secondary:active { background: rgba(56, 189, 248, 0.2); }

    .btn-link {
      background: transparent;
      border: none;
      color: var(--sub);
      font-family: 'Manrope', sans-serif;
      font-size: 13px;
      font-weight: 600;
      cursor: pointer;
      padding: 6px 0;
      -webkit-tap-highlight-color: transparent;
    }

    .btn-link:hover { color: var(--text); }

    .btn-danger {
      width: 100%;
      height: 48px;
      border-radius: var(--r-inner);
      background: rgba(244, 63, 94, 0.12);
      color: var(--danger);
      font-family: 'Manrope', sans-serif;
      font-size: 15px;
      font-weight: 700;
      border: 1px solid rgba(244, 63, 94, 0.28);
      cursor: pointer;
      transition: background 0.15s, border-color 0.15s, color 0.15s;
      -webkit-tap-highlight-color: transparent;
    }

    .btn-danger:active {
      background: rgba(244, 63, 94, 0.2);
      border-color: rgba(244, 63, 94, 0.46);
      color: #fecdd3;
    }

    /* ── Confirm sheet ── */
    .btn-confirm-cancel,
    .btn-confirm-delete {
      height: 48px;
      border-radius: var(--r-inner);
      font-family: 'Manrope', sans-serif;
      font-size: 15px;
      font-weight: 700;
      cursor: pointer;
      border: none;
      -webkit-tap-highlight-color: transparent;
    }

    .btn-confirm-cancel {
      background: rgba(255, 255, 255, 0.04);
      color: var(--sub);
      border: 1px solid var(--border);
    }

    .btn-confirm-delete {
      background: rgba(244, 63, 94, 0.12);
      color: var(--danger);
      border: 1px solid rgba(244, 63, 94, 0.2);
    }

    /* ── Icon glass button (e.g. salary settings) ── */
    .icon-glass-btn {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 34px;
      height: 34px;
      border-radius: var(--r-inner);
      background: var(--card-hi);
      border: 1px solid var(--border);
      color: var(--sub);
      cursor: pointer;
      flex-shrink: 0;
      transition: color 0.15s, background 0.15s;
      -webkit-tap-highlight-color: transparent;
    }

    .icon-glass-btn svg {
      width: 16px;
      height: 16px;
      stroke: currentColor;
      fill: none;
      stroke-width: 1.5;
      stroke-linecap: round;
      stroke-linejoin: round;
    }

    .icon-glass-btn:active {
      background: var(--accent-dim);
      color: var(--accent);
    }
