:root {
      --bg: #09090b;
      --surface: #18181b;
      --surface2: #27272a;
      --surface3: #3f3f46;
      --border: #27272a;
      --border2: #3f3f46;
      --text: #fafafa;
      --text-muted: #a1a1aa;
      --text-subtle: #71717a;
      --accent: #6366f1;
      --accent-hover: #4f46e5;
      --score0: #22c55e;
      --score1: #eab308;
      --score2: #f97316;
      --score3: #ef4444;
      --score-text0: #166534;
      --score-text1: #713f12;
      --score-text2: #7c2d12;
      --score-text3: #7f1d1d;
      --score-bg0: #dcfce7;
      --score-bg1: #fef9c3;
      --score-bg2: #ffedd5;
      --score-bg3: #fee2e2;
      --radius: 12px;
      --radius-sm: 8px;
    }

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

    body {
      font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', sans-serif;
      background: var(--bg);
      color: var(--text);
      min-height: 100dvh;
      -webkit-tap-highlight-color: transparent;
    }

    /* Header */
    .header {
      position: sticky;
      top: 0;
      z-index: 100;
      background: rgba(9,9,11,0.9);
      backdrop-filter: blur(12px);
      -webkit-backdrop-filter: blur(12px);
      border-bottom: 1px solid var(--border);
      padding: 14px 16px 12px;
    }

    .header-top {
      display: flex;
      align-items: center;
      gap: 10px;
      margin-bottom: 12px;
    }

    .logo {
      width: 34px;
      height: 34px;
      background: linear-gradient(135deg, var(--accent), #8b5cf6);
      border-radius: 9px;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 17px;
      flex-shrink: 0;
    }

    .header-titles h1 {
      font-size: 16px;
      font-weight: 700;
      letter-spacing: -0.3px;
      line-height: 1.2;
    }

    .header-titles p {
      font-size: 11px;
      color: var(--text-muted);
      margin-top: 1px;
    }

    /* Search */
    .search-wrap {
      position: relative;
    }

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

    .search-input {
      width: 100%;
      background: var(--surface2);
      border: 1px solid var(--border2);
      border-radius: var(--radius-sm);
      color: var(--text);
      font-size: 15px;
      padding: 9px 36px 9px 34px;
      outline: none;
      transition: border-color 0.15s;
      -webkit-appearance: none;
    }

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

    .search-clear {
      position: absolute;
      right: 10px;
      top: 50%;
      transform: translateY(-50%);
      background: var(--surface3);
      border: none;
      color: var(--text-muted);
      font-size: 13px;
      cursor: pointer;
      width: 20px;
      height: 20px;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
    }

    /* Filters bar */
    .filters-bar {
      display: flex;
      gap: 8px;
      padding: 10px 16px;
      overflow-x: auto;
      scrollbar-width: none;
      border-bottom: 1px solid var(--border);
      background: var(--bg);
    }
    .filters-bar::-webkit-scrollbar { display: none; }

    /* Score pills filter */
    .score-pills {
      display: flex;
      gap: 6px;
      flex-shrink: 0;
    }

    .score-pill-btn {
      display: flex;
      align-items: center;
      gap: 5px;
      padding: 5px 10px;
      border-radius: 99px;
      border: 1.5px solid transparent;
      font-size: 12px;
      font-weight: 600;
      cursor: pointer;
      white-space: nowrap;
      transition: all 0.15s;
      background: var(--surface2);
      color: var(--text-muted);
    }

    .score-pill-btn.active-0 { background: var(--score-bg0); color: var(--score-text0); border-color: var(--score0); }
    .score-pill-btn.active-1 { background: var(--score-bg1); color: var(--score-text1); border-color: var(--score1); }
    .score-pill-btn.active-2 { background: var(--score-bg2); color: var(--score-text2); border-color: var(--score2); }
    .score-pill-btn.active-3 { background: var(--score-bg3); color: var(--score-text3); border-color: var(--score3); }

    .dot {
      width: 7px;
      height: 7px;
      border-radius: 50%;
    }
    .dot-0 { background: var(--score0); }
    .dot-1 { background: var(--score1); }
    .dot-2 { background: var(--score2); }
    .dot-3 { background: var(--score3); }

    /* Category filter */
    .cat-filter-wrap {
      display: flex;
      gap: 6px;
      padding: 8px 16px;
      overflow-x: auto;
      scrollbar-width: none;
      background: var(--bg);
    }
    .cat-filter-wrap::-webkit-scrollbar { display: none; }

    .cat-chip {
      padding: 5px 12px;
      border-radius: 99px;
      border: 1.5px solid var(--border2);
      font-size: 12px;
      font-weight: 500;
      cursor: pointer;
      white-space: nowrap;
      background: transparent;
      color: var(--text-muted);
      transition: all 0.15s;
      flex-shrink: 0;
    }

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

    /* Results count */
    .results-info {
      padding: 8px 16px 4px;
      font-size: 12px;
      color: var(--text-subtle);
    }

    /* List */
    .list {
      padding: 4px 16px 80px;
    }

    .food-item {
      display: flex;
      align-items: center;
      gap: 12px;
      padding: 12px 14px;
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: var(--radius);
      margin-bottom: 8px;
      transition: border-color 0.15s;
      cursor: pointer;
    }

    .food-item:active { opacity: 0.8; }

    .score-badge {
      flex-shrink: 0;
      width: 36px;
      height: 36px;
      border-radius: 9px;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 17px;
      font-weight: 800;
    }
    .badge-0 { background: var(--score-bg0); color: var(--score-text0); }
    .badge-1 { background: var(--score-bg1); color: var(--score-text1); }
    .badge-2 { background: var(--score-bg2); color: var(--score-text2); }
    .badge-3 { background: var(--score-bg3); color: var(--score-text3); }

    .food-info { flex: 1; min-width: 0; }

    .food-name {
      font-size: 14px;
      font-weight: 600;
      color: var(--text);
      line-height: 1.3;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .food-meta {
      display: flex;
      align-items: center;
      gap: 6px;
      margin-top: 3px;
      flex-wrap: wrap;
    }

    .food-cat {
      font-size: 11px;
      color: var(--text-subtle);
    }

    .flag-chip {
      font-size: 10px;
      font-weight: 700;
      padding: 1px 6px;
      border-radius: 4px;
      letter-spacing: 0.3px;
    }
    .flag-H { background: #fee2e2; color: #991b1b; }
    .flag-H\! { background: #fce7f3; color: #9d174d; }
    .flag-A { background: #dbeafe; color: #1e40af; }
    .flag-L { background: #fef3c7; color: #92400e; }
    .flag-B { background: #ede9fe; color: #5b21b6; }

    .chevron {
      color: var(--text-subtle);
      font-size: 14px;
      flex-shrink: 0;
    }

    /* Empty */
    .empty {
      text-align: center;
      padding: 48px 24px;
      color: var(--text-muted);
    }
    .empty-icon { font-size: 40px; margin-bottom: 12px; }
    .empty h3 { font-size: 15px; font-weight: 600; margin-bottom: 6px; }
    .empty p { font-size: 13px; color: var(--text-subtle); }

    /* Modal */
    .modal-overlay {
      position: fixed;
      inset: 0;
      background: rgba(0,0,0,0.7);
      z-index: 200;
      display: flex;
      align-items: flex-end;
    }

    .modal {
      background: var(--surface);
      border-radius: var(--radius) var(--radius) 0 0;
      padding: 0;
      width: 100%;
      max-height: 85dvh;
      overflow-y: auto;
    }

    .modal-handle {
      width: 36px;
      height: 4px;
      background: var(--surface3);
      border-radius: 2px;
      margin: 12px auto 0;
    }

    .modal-header {
      display: flex;
      align-items: flex-start;
      gap: 14px;
      padding: 20px 20px 16px;
    }

    .modal-score {
      flex-shrink: 0;
      width: 50px;
      height: 50px;
      border-radius: 13px;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 24px;
      font-weight: 800;
    }

    .modal-title-area { flex: 1; }
    .modal-name { font-size: 18px; font-weight: 700; line-height: 1.2; }
    .modal-cat { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

    .modal-body { padding: 0 20px 32px; }

    .info-row {
      display: flex;
      align-items: flex-start;
      gap: 12px;
      padding: 14px 0;
      border-bottom: 1px solid var(--border);
    }
    .info-row:last-child { border-bottom: none; }

    .info-label {
      font-size: 12px;
      color: var(--text-subtle);
      font-weight: 500;
      min-width: 100px;
      padding-top: 1px;
    }

    .info-value { font-size: 14px; color: var(--text); flex: 1; line-height: 1.4; }

    .score-description {
      display: flex;
      align-items: center;
      gap: 10px;
    }

    .flags-row { display: flex; gap: 6px; flex-wrap: wrap; }

    .flag-detail {
      display: flex;
      align-items: center;
      gap: 6px;
      padding: 6px 10px;
      border-radius: var(--radius-sm);
      font-size: 12px;
    }
    .flag-detail .flag-chip { font-size: 11px; }

    .legend-section {
      margin-top: 0;
      padding: 16px 20px 0;
    }
    .legend-title {
      font-size: 11px;
      font-weight: 600;
      color: var(--text-subtle);
      text-transform: uppercase;
      letter-spacing: 0.5px;
      margin-bottom: 10px;
    }
    .legend-grid {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 8px;
    }
    .legend-item {
      display: flex;
      align-items: center;
      gap: 8px;
      padding: 10px 12px;
      background: var(--surface2);
      border-radius: var(--radius-sm);
    }
    .legend-badge {
      width: 28px;
      height: 28px;
      border-radius: 7px;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 13px;
      font-weight: 800;
      flex-shrink: 0;
    }
    .legend-text { font-size: 11px; color: var(--text-muted); line-height: 1.3; }

    /* Transitions */
    .fade-enter-active, .fade-leave-active { transition: opacity 0.2s; }
    .fade-enter-from, .fade-leave-to { opacity: 0; }
    .slide-enter-active { transition: transform 0.25s ease; }
    .slide-leave-active { transition: transform 0.2s ease; }
    .slide-enter-from, .slide-leave-to { transform: translateY(100%); }
