﻿/* ═══════════════════════════════════════════
       DESIGN TOKENS & CSS VARIABLES
    ═══════════════════════════════════════════ */
    :root {
      --bg:          #0f0e17;
      --bg-surface:  #1a1927;
      --bg-elevated: #221f32;
      --bg-card:     #2a2740;
      --border:      rgba(255,255,255,0.08);
      --border-active: rgba(255,255,255,0.18);

      --text-primary:   #fffffe;
      --text-secondary: rgba(255,255,255,0.55);
      --text-muted:     rgba(255,255,255,0.30);

      --accent:       #ff8906;
      --accent-dim:   rgba(255,137,6,0.15);
      --accent-glow:  rgba(255,137,6,0.3);
      --red:          #e53170;
      --red-dim:      rgba(229,49,112,0.15);
      --green:        #3dd68c;
      --green-dim:    rgba(61,214,140,0.12);
      --blue:         #7b8cde;
      --blue-dim:     rgba(123,140,222,0.12);
      --purple:       #c77dff;
      --purple-dim:   rgba(199,125,255,0.12);
      --gold:         #f6c90e;
      --gold-dim:     rgba(246,201,14,0.12);
      --rose:         #ff6b9d;
      --rose-dim:     rgba(255,107,157,0.12);

      --radius-sm:  8px;
      --radius-md:  14px;
      --radius-lg:  20px;
      --radius-xl:  28px;

      --shadow-sm:  0 2px 8px rgba(0,0,0,0.3);
      --shadow-md:  0 8px 32px rgba(0,0,0,0.4);
      --shadow-lg:  0 16px 48px rgba(0,0,0,0.5);

      --transition: 200ms cubic-bezier(0.4, 0, 0.2, 1);
      --spring:     300ms cubic-bezier(0.34, 1.56, 0.64, 1);

      --font-display: 'DM Serif Display', 'Noto Serif SC', Georgia, serif;
      --font-body:    'DM Sans', 'Noto Serif SC', system-ui, sans-serif;
      --font-serif:   'Noto Serif SC', 'DM Serif Display', serif;

      --safe-top:    env(safe-area-inset-top, 0px);
      --safe-bottom: env(safe-area-inset-bottom, 0px);
    }

    /* ═══════════════════════════════════════════
       RESET & BASE
    ═══════════════════════════════════════════ */
    *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

    html {
      background: var(--bg);
      color: var(--text-primary);
      font-family: var(--font-body);
      font-size: 16px;
      -webkit-font-smoothing: antialiased;
      -moz-osx-font-smoothing: grayscale;
      height: 100%;
      overflow: hidden;
    }

    body {
      height: 100%;
      overflow: hidden;
      background: var(--bg);
    }

    #app {
      height: 100vh;
      height: 100dvh;
      display: flex;
      flex-direction: column;
      overflow: hidden;
      position: relative;
    }

    /* ═══════════════════════════════════════════
       AMBIENT BACKGROUND
    ═══════════════════════════════════════════ */
    .ambient-bg {
      position: fixed;
      inset: 0;
      pointer-events: none;
      z-index: 0;
      overflow: hidden;
    }

    .ambient-orb {
      position: absolute;
      border-radius: 50%;
      filter: blur(80px);
      opacity: 0.12;
      animation: orb-drift 20s ease-in-out infinite alternate;
    }

    .ambient-orb:nth-child(1) {
      width: 500px; height: 500px;
      background: var(--accent);
      top: -100px; right: -100px;
      animation-duration: 18s;
    }

    .ambient-orb:nth-child(2) {
      width: 400px; height: 400px;
      background: var(--purple);
      bottom: -50px; left: -100px;
      animation-duration: 24s;
      animation-delay: -8s;
    }

    .ambient-orb:nth-child(3) {
      width: 300px; height: 300px;
      background: var(--blue);
      top: 40%; left: 40%;
      opacity: 0.07;
      animation-duration: 30s;
      animation-delay: -15s;
    }

    @keyframes orb-drift {
      0%   { transform: translate(0, 0) scale(1); }
      50%  { transform: translate(30px, -20px) scale(1.05); }
      100% { transform: translate(-20px, 30px) scale(0.95); }
    }

    /* ═══════════════════════════════════════════
       LAYOUT SHELLS
    ═══════════════════════════════════════════ */
    .screen {
      position: absolute;
      inset: 0;
      display: flex;
      flex-direction: column;
      z-index: 1;
      transition: opacity var(--transition), transform var(--transition);
    }

    .screen.hidden { opacity: 0; pointer-events: none; transform: translateY(8px); }
    .is-hidden { display: none !important; }
    .is-gone { display: none !important; }

    /* ═══════════════════════════════════════════
       AUTH SCREEN
    ═══════════════════════════════════════════ */
    #auth-screen {
      justify-content: center;
      align-items: center;
      padding: 24px;
      padding-top: calc(var(--safe-top) + 24px);
    }

    .auth-container {
      width: 100%;
      max-width: 380px;
    }

    .auth-hero {
      text-align: center;
      margin-bottom: 40px;
    }

    .auth-logo {
      font-family: var(--font-display);
      font-size: 42px;
      line-height: 1;
      color: var(--text-primary);
      letter-spacing: -1px;
      display: block;
    }

    .auth-logo-sub {
      font-family: var(--font-body);
      font-size: 13px;
      color: var(--text-secondary);
      margin-top: 6px;
      letter-spacing: 0.08em;
      text-transform: uppercase;
      display: block;
    }

    .auth-card {
      background: var(--bg-surface);
      border: 1px solid var(--border);
      border-radius: var(--radius-xl);
      padding: 28px 24px;
      backdrop-filter: blur(20px);
    }

    .auth-tabs {
      display: flex;
      background: var(--bg);
      border-radius: var(--radius-md);
      padding: 3px;
      margin-bottom: 24px;
      gap: 2px;
    }

    .auth-tab {
      flex: 1;
      padding: 8px;
      text-align: center;
      font-size: 14px;
      font-weight: 500;
      border-radius: calc(var(--radius-md) - 2px);
      cursor: pointer;
      color: var(--text-secondary);
      transition: all var(--transition);
      border: none;
      background: none;
      font-family: var(--font-body);
    }

    .auth-tab.active {
      background: var(--bg-card);
      color: var(--text-primary);
      box-shadow: var(--shadow-sm);
    }

    .form-group {
      margin-bottom: 16px;
    }

    .form-label {
      display: block;
      font-size: 12px;
      font-weight: 500;
      color: var(--text-secondary);
      margin-bottom: 6px;
      letter-spacing: 0.04em;
      text-transform: uppercase;
    }

    .form-input {
      width: 100%;
      background: var(--bg-elevated);
      border: 1px solid var(--border);
      border-radius: var(--radius-md);
      padding: 12px 14px;
      font-size: 15px;
      color: var(--text-primary);
      font-family: var(--font-body);
      transition: border-color var(--transition), box-shadow var(--transition);
      outline: none;
      -webkit-appearance: none;
    }

    .form-input:focus {
      border-color: var(--accent);
      box-shadow: 0 0 0 3px var(--accent-dim);
    }

    .form-input.field-error {
      border-color: var(--red);
    }

    .form-input::placeholder { color: var(--text-muted); }

    .custom-emoji-input {
      margin-top: 8px;
      width: 120px;
    }

    .btn-primary {
      width: 100%;
      padding: 13px;
      background: var(--accent);
      color: #0f0e17;
      border: none;
      border-radius: var(--radius-md);
      font-size: 15px;
      font-weight: 600;
      font-family: var(--font-body);
      cursor: pointer;
      transition: all var(--transition);
      margin-top: 8px;
      letter-spacing: 0.01em;
    }

    .btn-primary:hover { background: #ffaa40; transform: translateY(-1px); box-shadow: 0 4px 20px var(--accent-glow); }
    .btn-primary:active { transform: translateY(0); }
    .btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

    .auth-error {
      margin-top: 12px;
      padding: 10px 12px;
      background: var(--red-dim);
      border: 1px solid rgba(229,49,112,0.25);
      border-radius: var(--radius-sm);
      font-size: 13px;
      color: var(--red);
      display: none;
    }

    .auth-error.is-visible { display: block; }

    .auth-success {
      margin-top: 12px;
      padding: 10px 12px;
      background: var(--green-dim);
      border: 1px solid rgba(61,214,140,0.25);
      border-radius: var(--radius-sm);
      font-size: 13px;
      color: var(--green);
      display: none;
    }

    .auth-success.is-visible { display: block; }

    .turnstile-widget {
      margin-top: 16px;
      min-height: 65px;
    }

    /* ═══════════════════════════════════════════
       MAIN APP SCREEN
    ═══════════════════════════════════════════ */
    #main-screen {
      display: flex;
      flex-direction: column;
      overflow: hidden;
    }

    /* Header */
    .app-header {
      padding: calc(var(--safe-top) + 14px) 20px 12px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      flex-shrink: 0;
      position: relative;
      z-index: 10;
    }

    .header-brand {
      font-family: var(--font-display);
      font-size: 22px;
      letter-spacing: -0.5px;
      color: var(--text-primary);
      line-height: 1;
    }

    .header-actions {
      display: flex;
      align-items: center;
      gap: 8px;
    }

    .icon-btn {
      width: 38px;
      height: 38px;
      border-radius: var(--radius-md);
      background: var(--bg-surface);
      border: 1px solid var(--border);
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      transition: all var(--transition);
      color: var(--text-secondary);
      font-size: 16px;
      flex-shrink: 0;
    }

    .icon-btn:hover { background: var(--bg-card); border-color: var(--border-active); color: var(--text-primary); }
    .icon-btn:active { transform: scale(0.95); }
    .icon-btn-sm { width: 38px; height: 38px; }

    .icon-btn.accent {
      background: var(--accent);
      border-color: var(--accent);
      color: #0f0e17;
    }

    .icon-btn.accent:hover { background: #ffaa40; border-color: #ffaa40; }

    /* Filter / Search bar */
    .filter-bar {
      padding: 0 20px 12px;
      display: flex;
      gap: 8px;
      flex-shrink: 0;
    }

    .search-box {
      flex: 1;
      position: relative;
    }

    .search-input {
      width: 100%;
      background: var(--bg-surface);
      border: 1px solid var(--border);
      border-radius: var(--radius-lg);
      padding: 9px 14px 9px 36px;
      font-size: 14px;
      color: var(--text-primary);
      font-family: var(--font-body);
      outline: none;
      transition: border-color var(--transition);
      -webkit-appearance: none;
    }

    .search-input:focus { border-color: var(--accent); }
    .search-input::placeholder { color: var(--text-muted); }

    .search-icon {
      position: absolute;
      left: 12px;
      top: 50%;
      transform: translateY(-50%);
      color: var(--text-muted);
      font-size: 14px;
      pointer-events: none;
    }

    .filter-chip-scroll {
      padding: 0 20px 14px;
      display: flex;
      gap: 8px;
      overflow-x: auto;
      flex-shrink: 0;
      scrollbar-width: none;
    }

    .filter-chip-scroll::-webkit-scrollbar { display: none; }

    .chip {
      flex-shrink: 0;
      padding: 6px 14px;
      border-radius: 999px;
      font-size: 13px;
      font-weight: 500;
      cursor: pointer;
      transition: all var(--transition);
      border: 1px solid var(--border);
      background: var(--bg-surface);
      color: var(--text-secondary);
      white-space: nowrap;
      font-family: var(--font-body);
    }

    .chip:hover { background: var(--bg-elevated); color: var(--text-primary); }

    .chip.active {
      background: var(--accent-dim);
      border-color: var(--accent);
      color: var(--accent);
    }

    /* Card list */
    .cards-container {
      flex: 1;
      overflow-y: auto;
      padding: 0 16px calc(var(--safe-bottom) + 80px);
      scrollbar-width: none;
    }

    .cards-container::-webkit-scrollbar { display: none; }

    .cards-grid {
      display: flex;
      flex-direction: column;
      gap: 12px;
    }

    /* Event Card */
    .event-card {
      background: var(--bg-surface);
      border: 1px solid var(--border);
      border-radius: var(--radius-lg);
      padding: 18px 20px;
      display: flex;
      align-items: center;
      gap: 16px;
      cursor: pointer;
      transition: all var(--transition);
      position: relative;
      overflow: hidden;
    }

    .event-card::before {
      content: '';
      position: absolute;
      left: 0; top: 0; bottom: 0;
      width: 3px;
      border-radius: 0 2px 2px 0;
      transition: all var(--transition);
    }

    .event-card:hover {
      background: var(--bg-elevated);
      border-color: var(--border-active);
      transform: translateY(-1px);
      box-shadow: var(--shadow-md);
    }

    .event-card:active { transform: scale(0.99); }

    /* Color variants */
    .event-card[data-color="orange"]::before { background: var(--accent); }
    .event-card[data-color="red"]::before { background: var(--red); }
    .event-card[data-color="green"]::before { background: var(--green); }
    .event-card[data-color="blue"]::before { background: var(--blue); }
    .event-card[data-color="purple"]::before { background: var(--purple); }
    .event-card[data-color="gold"]::before { background: var(--gold); }
    .event-card[data-color="rose"]::before { background: var(--rose); }

    .card-icon-wrap {
      width: 48px;
      height: 48px;
      border-radius: var(--radius-md);
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 22px;
      flex-shrink: 0;
    }

    .event-card[data-color="orange"] .card-icon-wrap { background: var(--accent-dim); }
    .event-card[data-color="red"] .card-icon-wrap { background: var(--red-dim); }
    .event-card[data-color="green"] .card-icon-wrap { background: var(--green-dim); }
    .event-card[data-color="blue"] .card-icon-wrap { background: var(--blue-dim); }
    .event-card[data-color="purple"] .card-icon-wrap { background: var(--purple-dim); }
    .event-card[data-color="gold"] .card-icon-wrap { background: var(--gold-dim); }
    .event-card[data-color="rose"] .card-icon-wrap { background: var(--rose-dim); }

    .card-body {
      flex: 1;
      min-width: 0;
    }

    .card-title {
      font-size: 16px;
      font-weight: 500;
      color: var(--text-primary);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      margin-bottom: 4px;
      font-family: var(--font-serif);
    }

    .card-meta {
      font-size: 12px;
      color: var(--text-muted);
      display: flex;
      align-items: center;
      gap: 6px;
    }

    .card-date-str {
      color: var(--text-secondary);
      font-size: 12px;
    }

    .card-right {
      text-align: right;
      flex-shrink: 0;
    }

    .card-count {
      font-family: var(--font-display);
      font-size: 28px;
      line-height: 1;
      font-weight: 400;
    }

    .card-unit {
      font-size: 11px;
      color: var(--text-muted);
      margin-top: 3px;
      display: block;
      letter-spacing: 0.04em;
    }

    .count-future { color: var(--accent); }
    .count-past   { color: var(--blue); }
    .count-today  { color: var(--green); }

    /* Empty state */
    .empty-state {
      text-align: center;
      padding: 80px 24px 40px;
      display: none;
    }

    .empty-state.visible { display: block; }

    .empty-icon { font-size: 52px; margin-bottom: 16px; opacity: 0.6; }

    .empty-title {
      font-family: var(--font-display);
      font-size: 22px;
      color: var(--text-primary);
      margin-bottom: 8px;
    }

    .empty-desc { font-size: 14px; color: var(--text-secondary); line-height: 1.5; }

    /* FAB */
    .fab {
      position: fixed;
      right: 20px;
      bottom: calc(var(--safe-bottom) + 24px);
      width: 56px;
      height: 56px;
      border-radius: 50%;
      background: var(--accent);
      color: #0f0e17;
      border: none;
      font-size: 24px;
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      box-shadow: 0 4px 24px var(--accent-glow);
      transition: all var(--spring);
      z-index: 100;
    }

    .fab:hover { transform: scale(1.08) translateY(-2px); box-shadow: 0 8px 32px var(--accent-glow); }
    .fab:active { transform: scale(0.95); }

    /* ═══════════════════════════════════════════
       MODAL / BOTTOM SHEET
    ═══════════════════════════════════════════ */
    .modal-overlay {
      position: fixed;
      inset: 0;
      background: rgba(0,0,0,0.6);
      backdrop-filter: blur(8px);
      z-index: 200;
      display: flex;
      align-items: flex-end;
      justify-content: center;
      opacity: 0;
      pointer-events: none;
      transition: opacity var(--transition);
    }

    .modal-overlay.open { opacity: 1; pointer-events: all; }

    .modal-sheet {
      width: 100%;
      max-width: 480px;
      background: var(--bg-surface);
      border-radius: var(--radius-xl) var(--radius-xl) 0 0;
      padding: 0 0 calc(var(--safe-bottom) + 24px);
      transform: translateY(100%);
      transition: transform var(--spring);
      max-height: 94dvh;
      overflow-y: auto;
      scrollbar-width: none;
    }

    .modal-sheet::-webkit-scrollbar { display: none; }
    .modal-overlay.open .modal-sheet { transform: translateY(0); }

    .sheet-handle {
      width: 40px;
      height: 4px;
      background: var(--border-active);
      border-radius: 2px;
      margin: 14px auto 0;
    }

    .sheet-header {
      padding: 20px 24px 16px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      border-bottom: 1px solid var(--border);
    }

    .sheet-title {
      font-family: var(--font-display);
      font-size: 20px;
      color: var(--text-primary);
    }

    .sheet-close {
      width: 32px;
      height: 32px;
      border-radius: 50%;
      background: var(--bg-elevated);
      border: none;
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      color: var(--text-secondary);
      font-size: 16px;
      transition: all var(--transition);
    }

    .sheet-close:hover { background: var(--bg-card); color: var(--text-primary); }

    .sheet-body {
      padding: 20px 24px;
    }

    /* Form inside sheet */
    .sheet-body .form-group { margin-bottom: 18px; }
    .sheet-body .form-input { background: var(--bg-elevated); }

    .color-picker {
      display: flex;
      gap: 10px;
      flex-wrap: wrap;
    }

    .color-dot {
      width: 32px;
      height: 32px;
      border-radius: 50%;
      cursor: pointer;
      border: 2px solid transparent;
      transition: all var(--transition);
      display: flex;
      align-items: center;
      justify-content: center;
    }

    .color-dot.selected { border-color: white; transform: scale(1.1); }
    .color-dot.selected::after { content: '✓'; font-size: 13px; color: white; font-weight: 600; }

    .color-dot[data-color="orange"] { background: var(--accent); }
    .color-dot[data-color="red"]    { background: var(--red); }
    .color-dot[data-color="green"]  { background: var(--green); }
    .color-dot[data-color="blue"]   { background: var(--blue); }
    .color-dot[data-color="purple"] { background: var(--purple); }
    .color-dot[data-color="gold"]   { background: var(--gold); }
    .color-dot[data-color="rose"]   { background: var(--rose); }

    .emoji-picker-row {
      display: flex;
      gap: 8px;
      flex-wrap: wrap;
      margin-top: 4px;
    }

    .emoji-btn {
      width: 40px;
      height: 40px;
      border-radius: var(--radius-sm);
      background: var(--bg-elevated);
      border: 1px solid var(--border);
      font-size: 20px;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      transition: all var(--transition);
    }

    .emoji-btn.selected { border-color: var(--accent); background: var(--accent-dim); }
    .emoji-btn:hover { background: var(--bg-card); }

    .toggle-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 4px 0;
    }

    .toggle-label { font-size: 14px; color: var(--text-secondary); }

    .toggle {
      width: 44px;
      height: 26px;
      border-radius: 13px;
      background: var(--bg-card);
      border: none;
      cursor: pointer;
      position: relative;
      transition: all var(--transition);
    }

    .toggle.on { background: var(--accent); }

    .toggle::after {
      content: '';
      position: absolute;
      top: 3px;
      left: 3px;
      width: 20px;
      height: 20px;
      border-radius: 50%;
      background: var(--text-primary);
      transition: transform var(--transition);
      box-shadow: 0 1px 4px rgba(0,0,0,0.4);
    }

    .toggle.on::after { transform: translateX(18px); }

    .btn-row {
      display: flex;
      gap: 10px;
      margin-top: 24px;
    }

    .btn-secondary {
      flex: 1;
      padding: 12px;
      background: var(--bg-elevated);
      border: 1px solid var(--border);
      border-radius: var(--radius-md);
      font-size: 14px;
      font-weight: 500;
      color: var(--text-secondary);
      font-family: var(--font-body);
      cursor: pointer;
      transition: all var(--transition);
    }

    .btn-secondary:hover { background: var(--bg-card); color: var(--text-primary); }

    .btn-danger {
      flex: 1;
      padding: 12px;
      background: var(--red-dim);
      border: 1px solid rgba(229,49,112,0.25);
      border-radius: var(--radius-md);
      font-size: 14px;
      font-weight: 500;
      color: var(--red);
      font-family: var(--font-body);
      cursor: pointer;
      transition: all var(--transition);
    }

    .btn-danger:hover { background: rgba(229,49,112,0.25); }

    .btn-primary.flex-1 { flex: 1; width: auto; margin-top: 0; }

    /* ═══════════════════════════════════════════
       DETAIL OVERLAY
    ═══════════════════════════════════════════ */
    .detail-overlay {
      position: fixed;
      inset: 0;
      z-index: 300;
      display: flex;
      flex-direction: column;
      background: var(--bg);
      transform: translateX(100%);
      transition: transform var(--spring);
    }

    .detail-overlay.open { transform: translateX(0); }

    .detail-header {
      padding: calc(var(--safe-top) + 14px) 20px 16px;
      display: flex;
      align-items: center;
      gap: 12px;
      flex-shrink: 0;
      border-bottom: 1px solid var(--border);
    }

    .detail-back {
      width: 38px;
      height: 38px;
      border-radius: var(--radius-md);
      background: var(--bg-surface);
      border: 1px solid var(--border);
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      font-size: 18px;
      color: var(--text-secondary);
      flex-shrink: 0;
      transition: all var(--transition);
    }

    .detail-back:hover { background: var(--bg-card); color: var(--text-primary); }

    .detail-title {
      flex: 1;
      font-family: var(--font-serif);
      font-size: 18px;
      color: var(--text-primary);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .detail-body {
      flex: 1;
      overflow-y: auto;
      padding: 32px 24px;
      display: flex;
      flex-direction: column;
      align-items: center;
    }

    .detail-hero {
      text-align: center;
      margin-bottom: 40px;
    }

    .detail-emoji { font-size: 64px; margin-bottom: 16px; display: block; }

    .detail-big-count {
      font-family: var(--font-display);
      font-size: 80px;
      line-height: 1;
      letter-spacing: -4px;
      margin-bottom: 8px;
    }

    .detail-unit {
      font-size: 16px;
      color: var(--text-secondary);
      letter-spacing: 0.1em;
      text-transform: uppercase;
    }

    .detail-date-label {
      font-size: 14px;
      color: var(--text-muted);
      margin-top: 12px;
    }

    .detail-date-muted {
      margin-top: 6px;
      color: var(--text-muted);
    }

    .detail-note {
      margin-top: 10px;
      color: var(--text-secondary);
      font-style: italic;
    }

    .detail-stats-grid {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 12px;
      width: 100%;
      max-width: 360px;
      margin-bottom: 24px;
    }

    .stat-card {
      background: var(--bg-surface);
      border: 1px solid var(--border);
      border-radius: var(--radius-lg);
      padding: 16px;
      text-align: center;
    }

    .annual-stat-card {
      width: 100%;
      max-width: 360px;
      padding: 16px 20px;
      display: flex;
      align-items: center;
      justify-content: space-between;
    }

    .annual-stat-label {
      font-size: 14px;
      color: var(--text-secondary);
    }

    .annual-stat-value {
      font-size: 14px;
      color: var(--accent);
    }

    .stat-value {
      font-family: var(--font-display);
      font-size: 26px;
      color: var(--text-primary);
      display: block;
    }

    .stat-label {
      font-size: 11px;
      color: var(--text-muted);
      margin-top: 4px;
      text-transform: uppercase;
      letter-spacing: 0.06em;
    }

    /* ═══════════════════════════════════════════
       MENU / SETTINGS SHEET
    ═══════════════════════════════════════════ */
    .menu-item {
      display: flex;
      align-items: center;
      gap: 14px;
      padding: 14px 0;
      cursor: pointer;
      border-bottom: 1px solid var(--border);
      transition: opacity var(--transition);
    }

    .menu-item:last-child { border-bottom: none; }
    .menu-item:hover { opacity: 0.7; }

    .menu-icon {
      width: 38px;
      height: 38px;
      border-radius: var(--radius-md);
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 18px;
      flex-shrink: 0;
    }

    .menu-icon-green { background: var(--green-dim); }
    .menu-icon-blue { background: var(--blue-dim); }
    .menu-icon-red { background: var(--red-dim); }
    .text-danger { color: var(--red); }

    .menu-label {
      flex: 1;
      font-size: 15px;
      color: var(--text-primary);
    }

    .menu-sub {
      font-size: 12px;
      color: var(--text-muted);
      margin-top: 2px;
    }

    .menu-arrow { color: var(--text-muted); font-size: 14px; }

    .user-info-bar {
      background: var(--bg-elevated);
      border-radius: var(--radius-lg);
      padding: 14px 16px;
      display: flex;
      align-items: center;
      gap: 12px;
      margin-bottom: 20px;
    }

    .user-avatar {
      width: 40px; height: 40px;
      border-radius: 50%;
      background: var(--accent-dim);
      border: 1px solid var(--accent);
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 18px;
      flex-shrink: 0;
    }

    .user-email {
      font-size: 14px;
      color: var(--text-primary);
      font-weight: 500;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .user-plan {
      font-size: 11px;
      color: var(--text-muted);
      margin-top: 2px;
    }

    /* ═══════════════════════════════════════════
       TOAST NOTIFICATION
    ═══════════════════════════════════════════ */
    .toast {
      position: fixed;
      bottom: calc(var(--safe-bottom) + 90px);
      left: 50%;
      transform: translateX(-50%) translateY(20px);
      background: var(--bg-card);
      border: 1px solid var(--border-active);
      border-radius: var(--radius-lg);
      padding: 12px 20px;
      font-size: 14px;
      color: var(--text-primary);
      z-index: 9999;
      pointer-events: none;
      opacity: 0;
      transition: all var(--transition);
      white-space: nowrap;
      box-shadow: var(--shadow-md);
      backdrop-filter: blur(20px);
    }

    .toast.show {
      opacity: 1;
      transform: translateX(-50%) translateY(0);
    }

    .toast.success { border-color: var(--green); background: var(--bg-card); }
    .toast.error   { border-color: var(--red); }

    /* ═══════════════════════════════════════════
       LOADING SPINNER
    ═══════════════════════════════════════════ */
    .spinner {
      width: 20px;
      height: 20px;
      border: 2px solid rgba(255,255,255,0.2);
      border-top-color: currentColor;
      border-radius: 50%;
      animation: spin 0.7s linear infinite;
      display: inline-block;
      vertical-align: middle;
    }

    @keyframes spin { to { transform: rotate(360deg); } }

    .loading-screen {
      position: fixed;
      inset: 0;
      background: var(--bg);
      display: flex;
      align-items: center;
      justify-content: center;
      z-index: 9000;
      flex-direction: column;
      gap: 16px;
      transition: opacity 0.4s;
    }

    .loading-screen.fade-out { opacity: 0; pointer-events: none; }

    .loading-logo {
      font-family: var(--font-display);
      font-size: 36px;
      color: var(--text-primary);
      letter-spacing: -1px;
    }

    .loading-spinner-big {
      width: 36px; height: 36px;
      border: 3px solid rgba(255,137,6,0.2);
      border-top-color: var(--accent);
      border-radius: 50%;
      animation: spin 0.8s linear infinite;
    }

    /* ═══════════════════════════════════════════
       SECTION HEADER (date group dividers)
    ═══════════════════════════════════════════ */
    .section-label {
      font-size: 11px;
      font-weight: 600;
      color: var(--text-muted);
      text-transform: uppercase;
      letter-spacing: 0.1em;
      padding: 16px 4px 8px;
    }

    .section-label:first-child { padding-top: 8px; }

    /* ═══════════════════════════════════════════
       LANGUAGE SWITCHER
    ═══════════════════════════════════════════ */
    .lang-btn {
      font-size: 12px;
      font-weight: 600;
      letter-spacing: 0.05em;
    }

    /* ═══════════════════════════════════════════
       COUNT BADGE (record count)
    ═══════════════════════════════════════════ */
    .count-badge {
      font-size: 11px;
      color: var(--text-muted);
      padding: 0 20px 4px;
      text-align: right;
    }

    /* ═══════════════════════════════════════════
       ANIMATIONS
    ═══════════════════════════════════════════ */
    @keyframes card-in {
      from { opacity: 0; transform: translateY(12px); }
      to   { opacity: 1; transform: translateY(0); }
    }

    .card-animate {
      animation: card-in 0.25s ease-out both;
    }

    /* ═══════════════════════════════════════════
       RESPONSIVE / LARGE SCREEN
    ═══════════════════════════════════════════ */
    @media (min-width: 480px) {
      .modal-overlay { align-items: center; padding: 24px; }
      .modal-sheet {
        border-radius: var(--radius-xl);
        max-height: 88dvh;
      }
      .fab { right: calc(50% - 220px); }
    }

    /* Scrollbar for desktop */
    @media (pointer: fine) {
      .cards-container { scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
    }
