:root {
    --sage: #7A9E7E;
    --sage-light: #B8D4BB;
    --sage-dark: #4A6B4E;
    --cream: #FAF7F2;
    --warm: #F5EFE6;
    --sand: #E8D9C4;
    --text: #2C2C2C;
    --text-light: #6B6B6B;
    --accent: #C9856A;
    --accent-light: #F0D5CB;
    --white: #FFFFFF;
    --border: rgba(122,158,126,0.2);
    --shadow: 0 4px 24px rgba(74,107,78,0.10);
  }

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

  body {
    font-family: 'Assistant', sans-serif;
    background: var(--cream);
    color: var(--text);
    line-height: 1.7;
    font-size: 15px;
    letter-spacing: -0.005em;
  }

  /* HERO */
  .hero {
    background: linear-gradient(135deg, var(--sage-dark) 0%, var(--sage) 50%, var(--sage-light) 100%);
    color: white;
    padding: 56px 24px 48px;
    text-align: center;
    position: relative;
    overflow: hidden;
  }
  .hero::before {
    content: '';
    position: absolute; inset: 0;
    pointer-events: none;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Ccircle cx='30' cy='30' r='20'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  }
  .hero-emoji { font-size: 52px; display: block; margin-bottom: 12px; }
  .hero h1 {
    font-family: 'Frank Ruhl Libre', serif;
    font-size: clamp(28px, 5vw, 42px);
    font-weight: 700;
    margin-bottom: 8px;
    position: relative;
    letter-spacing: -0.01em;
  }
  .hero p {
    font-size: 15px;
    opacity: 0.85;
    max-width: 500px;
    margin: 0 auto;
    position: relative;
  }

  /* CONTAINER */
  .container { max-width: 760px; margin: 0 auto; padding: 0 16px; }

  /* SECTION HEADER */
  .section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 40px 0 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--sage-light);
  }
  .section-icon {
    width: 40px; height: 40px;
    background: var(--sage);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(122,158,126,0.3);
  }
  .section-header h2 {
    font-family: 'Assistant', sans-serif;
    font-size: 24px;
    font-weight: 800;
    color: var(--sage-dark);
    letter-spacing: -0.015em;
  }

  /* ALERT BOXES */
  .alert {
    border-radius: 12px;
    padding: 16px 20px;
    margin: 20px 0;
    border-right: 4px solid;
    font-size: 14px;
  }
  .alert-add { background: #EFF6F0; border-color: var(--sage); }
  .alert-add strong { color: var(--sage-dark); }
  .alert-note { background: #FEF9F0; border-color: #E8AA45; }
  .alert-note strong { color: #B8860B; }
  .alert-remove { background: #FEF2EF; border-color: var(--accent); }
  .alert-remove strong { color: #A0522D; }

  /* PRODUCT CARD */
  .product-card {
    background: var(--white);
    border-radius: 16px;
    padding: 22px 24px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    transition: transform 0.2s, box-shadow 0.2s;
  }
  .product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(74,107,78,0.14);
  }

  .card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 14px;
    gap: 12px;
  }
  .card-title-block { flex: 1; }
  .product-category {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--sage);
    margin-bottom: 4px;
  }
  .product-name {
    font-size: 17px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.3;
  }
  .product-sub {
    font-size: 13px;
    color: var(--text-light);
    margin-top: 2px;
  }

  /* RATING BADGE */
  .safety-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: var(--sage);
    color: white;
    border-radius: 10px;
    padding: 8px 12px;
    font-size: 11px;
    font-weight: 700;
    text-align: center;
    min-width: 56px;
    flex-shrink: 0;
  }
  .safety-badge .score { font-size: 22px; line-height: 1; }

  /* CERTS */
  .certs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 14px;
  }
  .cert {
    background: var(--sage-light);
    color: var(--sage-dark);
    font-size: 11px;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: 20px;
    white-space: nowrap;
  }
  .cert.red { background: #FDECEA; color: #C0392B; }
  .cert.gold { background: #FEF3E2; color: #B8860B; }
  .cert.blue { background: #EBF4FF; color: #1A5276; }

  /* DETAIL GRID */
  .detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 14px;
  }
  .detail-item {
    background: var(--warm);
    border-radius: 8px;
    padding: 9px 12px;
  }
  .detail-label {
    font-size: 11px;
    color: var(--text-light);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
  }
  .detail-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
  }

  /* REASON */
  .why-best {
    background: linear-gradient(135deg, #EFF6F0, #F5F9F5);
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 13.5px;
    color: var(--sage-dark);
    border-right: 3px solid var(--sage);
  }
  .why-best strong { font-weight: 700; }

  /* WARNING */
  .warning {
    background: #FEF9F0;
    border-radius: 8px;
    padding: 9px 12px;
    font-size: 12.5px;
    color: #8B6914;
    margin-top: 10px;
    display: flex;
    align-items: flex-start;
    gap: 6px;
  }

  /* ALTERNATIVE */
  .alt-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed var(--border);
    font-size: 13px;
    color: var(--text-light);
  }
  .alt-label {
    font-size: 11px;
    font-weight: 700;
    background: var(--sand);
    color: var(--text);
    padding: 2px 8px;
    border-radius: 10px;
    white-space: nowrap;
  }

  /* ADDED ITEMS BOX */
  .added-box {
    background: var(--white);
    border-radius: 16px;
    padding: 20px 24px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
  }
  .added-box h3 {
    font-size: 15px;
    font-weight: 700;
    color: var(--sage-dark);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
  }
  .added-items { display: flex; flex-direction: column; gap: 8px; }
  .added-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13.5px;
  }
  .added-item .dot {
    width: 8px; height: 8px;
    background: var(--sage);
    border-radius: 50%;
    flex-shrink: 0;
  }

  /* AGENT SECTION */
  .agent-section {
    background: linear-gradient(135deg, #1A2F1C 0%, #2D4A30 100%);
    color: white;
    border-radius: 20px;
    padding: 28px 24px;
    margin: 32px 0;
  }
  .agent-section h2 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 6px;
    display: flex; align-items: center; gap: 10px;
  }
  .agent-section p {
    font-size: 13.5px;
    opacity: 0.8;
    margin-bottom: 20px;
  }
  .agent-limitation {
    background: rgba(255,255,255,0.08);
    border-radius: 12px;
    padding: 16px;
    font-size: 13px;
    line-height: 1.7;
  }
  .agent-limitation h3 { font-size: 14px; margin-bottom: 8px; opacity: 0.9; }
  .agent-limitation ul { padding-right: 18px; }
  .agent-limitation li { margin-bottom: 6px; opacity: 0.75; }
  .agent-code {
    background: rgba(0,0,0,0.35);
    border-radius: 8px;
    padding: 12px 14px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    margin-top: 12px;
    overflow-x: auto;
    line-height: 1.6;
    color: #A8D5AC;
  }
  .agent-workflow {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 16px 0;
  }
  .workflow-step {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: rgba(255,255,255,0.07);
    border-radius: 10px;
    padding: 12px 14px;
  }
  .step-num {
    background: var(--sage);
    color: white;
    width: 26px; height: 26px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700;
    font-size: 12px;
    flex-shrink: 0;
  }
  .step-text { font-size: 13px; line-height: 1.5; }
  .step-text strong { display: block; margin-bottom: 2px; }

  /* FOOTER */
  .footer {
    text-align: center;
    padding: 32px 16px 48px;
    color: var(--text-light);
    font-size: 13px;
  }
  .footer-heart { font-size: 24px; display: block; margin-bottom: 8px; }

  /* DIVIDER */
  .divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--sage-light), transparent);
    margin: 32px 0;
  }

  /* ===== SIDE MENU (replaces tabs) ===== */
  .menu-toggle {
    position: fixed;
    top: 14px;
    right: 14px;
    z-index: 1001;
    background: rgba(255,255,255,0.96);
    backdrop-filter: blur(8px);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 9px 14px;
    cursor: pointer;
    box-shadow: 0 2px 12px rgba(0,0,0,0.12);
    font-size: 18px;
    font-family: inherit;
    color: var(--sage-dark);
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 700;
    transition: transform 0.2s, box-shadow 0.2s;
  }
  .menu-toggle:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  }
  .menu-toggle .menu-toggle-label {
    font-size: 13px;
  }

  .side-menu-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 1002;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s;
  }
  .side-menu-backdrop.open {
    opacity: 1;
    pointer-events: auto;
  }

  .side-menu {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 300px;
    max-width: 88vw;
    background: var(--white);
    z-index: 1003;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    box-shadow: -8px 0 32px rgba(0,0,0,0.15);
    display: flex;
    flex-direction: column;
  }
  .side-menu.open { transform: translateX(0); }

  .side-menu-header {
    padding: 22px 22px 18px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, var(--sage-dark) 0%, var(--sage) 100%);
    color: white;
  }
  .side-menu-header h2 {
    font-family: 'Assistant', sans-serif;
    font-size: 19px;
    font-weight: 800;
    margin: 0;
    letter-spacing: -0.01em;
  }
  .side-menu-close {
    background: rgba(255,255,255,0.15);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
  }
  .side-menu-close:hover { background: rgba(255,255,255,0.25); }

  .menu-section { padding: 6px 0; }
  .menu-section:not(:first-of-type) { border-top: 1px solid var(--border); }
  .menu-section-title {
    padding: 14px 22px 6px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--text-light);
    font-weight: 700;
  }
  .menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 22px;
    width: 100%;
    background: transparent;
    border: none;
    border-right: 3px solid transparent;
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    text-align: right;
    transition: background 0.15s, border-color 0.15s;
  }
  .menu-item:hover { background: var(--warm); }
  .menu-item.active {
    background: linear-gradient(to left, var(--sage-light), transparent);
    color: var(--sage-dark);
    font-weight: 700;
    border-right-color: var(--sage);
  }
  .menu-item .menu-emoji {
    font-size: 18px;
    width: 22px;
    text-align: center;
    flex-shrink: 0;
  }
  .menu-item .menu-label { flex: 1; }
  .menu-item .menu-count {
    background: var(--sage);
    color: white;
    border-radius: 10px;
    padding: 2px 9px;
    font-size: 11px;
    font-weight: 700;
    min-width: 22px;
    text-align: center;
  }
  .menu-item.active .menu-count { background: var(--sage-dark); }

  .tab-panel { display: none; }
  .tab-panel.active { display: block; }

  /* extra top padding on hero so the floating menu button doesn't overlap text */
  .hero { padding-top: 70px; }
  @media (min-width: 600px) { .hero { padding-top: 56px; } }

  /* ===== CHECKLIST TAB ===== */
  .checklist-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 10px;
    margin: 24px 0 20px;
  }
  .stat-card {
    background: var(--white);
    border-radius: 12px;
    padding: 14px 16px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
  }
  .stat-label {
    font-size: 11px;
    color: var(--text-light);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
  }
  .stat-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--sage-dark);
  }
  .stat-value.green { color: var(--sage); }
  .stat-value.amber { color: var(--accent); }

  .progress-track {
    height: 8px;
    background: var(--warm);
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 20px;
  }
  .progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--sage), var(--sage-light));
    border-radius: 6px;
    transition: width 0.4s ease;
  }

  .cat-group {
    margin-bottom: 18px;
  }
  .cat-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    font-weight: 700;
    color: var(--sage-dark);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    padding: 0 0 8px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 8px;
  }
  .cat-count {
    background: var(--sage-light);
    color: var(--sage-dark);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
  }

  .checklist-row {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 12px;
    margin-bottom: 6px;
    cursor: pointer;
    transition: all 0.15s;
  }
  .checklist-row:hover {
    border-color: var(--sage);
    transform: translateX(-2px);
  }
  .checklist-row.checked {
    background: #EFF6F0;
    opacity: 0.7;
  }
  .checklist-row input[type=checkbox] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--sage);
    flex-shrink: 0;
  }
  .row-content { flex: 1; min-width: 0; }
  .row-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    line-height: 1.3;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
  }
  .row-name.done {
    text-decoration: line-through;
    color: var(--text-light);
  }
  .row-detail {
    font-size: 12px;
    color: var(--text-light);
    margin-top: 2px;
  }
  .row-cost {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-light);
    white-space: nowrap;
    padding: 3px 10px;
    border-radius: 10px;
  }
  .row-cost.set {
    color: var(--sage-dark);
    background: var(--sage-light);
  }
  .row-cost.empty { color: var(--text-light); }
  .edit-link {
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: transparent;
    cursor: pointer;
    color: var(--text-light);
    font-weight: 600;
  }
  .edit-link:hover {
    background: var(--warm);
    color: var(--sage-dark);
  }

  /* ADD ITEM FORM */
  .add-form {
    background: var(--white);
    border-radius: 16px;
    padding: 20px 24px;
    margin: 24px 0;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
  }
  .add-form h3 {
    font-size: 15px;
    font-weight: 700;
    color: var(--sage-dark);
    margin-bottom: 14px;
  }
  .form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 10px;
  }
  .form-grid.three { grid-template-columns: 1fr 1fr 1fr; }
  .form-field { display: flex; flex-direction: column; gap: 4px; }
  .form-field label {
    font-size: 12px;
    color: var(--text-light);
    font-weight: 600;
  }
  .form-field input,
  .form-field select {
    font-family: inherit;
    font-size: 13px;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--warm);
    color: var(--text);
  }
  .form-field input:focus,
  .form-field select:focus {
    outline: none;
    border-color: var(--sage);
    background: var(--white);
  }
  .btn {
    padding: 9px 18px;
    border-radius: 8px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid var(--border);
    background: var(--white);
    color: var(--text);
  }
  .btn:hover { background: var(--warm); }
  .btn.primary {
    background: var(--sage);
    color: white;
    border-color: var(--sage);
  }
  .btn.primary:hover { background: var(--sage-dark); }
  .btn.danger { color: #A0522D; }
  .btn-row {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 8px;
  }

  /* MODAL */
  .modal-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(44,44,44,0.5);
    z-index: 200;
    align-items: center;
    justify-content: center;
    padding: 20px;
  }
  .modal-backdrop.open { display: flex; }
  .modal {
    background: var(--white);
    border-radius: 16px;
    padding: 22px;
    width: 100%;
    max-width: 440px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 12px 48px rgba(0,0,0,0.24);
  }
  .modal h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--sage-dark);
    margin-bottom: 16px;
  }

  /* EXPORT BUTTONS */
  .actions-bar {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 20px;
  }
  .mini-btn {
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 20px;
    background: var(--white);
    border: 1px solid var(--border);
    cursor: pointer;
    color: var(--sage-dark);
  }
  .mini-btn:hover {
    background: var(--sage);
    color: white;
    border-color: var(--sage);
  }

  /* BUDGET SUMMARY */
  .budget-section {
    background: var(--white);
    border-radius: 16px;
    padding: 20px 24px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
  }
  .budget-cat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px dashed var(--border);
    font-size: 14px;
  }
  .budget-cat-row:last-child { border-bottom: none; }
  .budget-cat-name { color: var(--text); font-weight: 500; }
  .budget-cat-amount { color: var(--sage-dark); font-weight: 700; }
  .budget-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 0 0;
    margin-top: 8px;
    border-top: 2px solid var(--sage);
    font-size: 16px;
    font-weight: 700;
    color: var(--sage-dark);
  }

  /* ===== ISRAEL TAB ===== */
  .il-intro {
    background: linear-gradient(135deg, #EFF6F0, #F5F9F5);
    border-radius: 16px;
    padding: 18px 22px;
    margin: 24px 0;
    border-right: 4px solid var(--sage);
  }
  .il-intro h3 {
    color: var(--sage-dark);
    font-size: 16px;
    margin-bottom: 8px;
  }
  .il-intro p {
    font-size: 13.5px;
    color: var(--text);
    line-height: 1.7;
  }

  .il-card {
    background: var(--white);
    border-radius: 16px;
    padding: 18px 22px;
    margin-bottom: 14px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
  }
  .il-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
  }
  .il-cat {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--sage);
    margin-bottom: 3px;
  }
  .il-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 2px;
  }
  .il-sub {
    font-size: 12px;
    color: var(--text-light);
  }
  .il-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
  }
  .il-badge {
    background: var(--sage-light);
    color: var(--sage-dark);
    font-size: 11px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
  }
  .il-badge.gold { background: #FEF3E2; color: #B8860B; }
  .il-badge.blue { background: #EBF4FF; color: #1A5276; }
  .il-badge.red { background: #FDECEA; color: #C0392B; }

  .il-comparison {
    background: var(--warm);
    border-radius: 10px;
    padding: 12px 14px;
    margin: 10px 0;
    font-size: 13px;
  }
  .il-comparison-title {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
  }
  .il-option-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 7px 0;
    border-bottom: 1px dashed var(--border);
    font-size: 13px;
  }
  .il-option-row:last-child { border-bottom: none; }
  .il-option-row.winner {
    background: linear-gradient(90deg, rgba(122,158,126,0.12), transparent);
    padding: 8px 10px;
    border-radius: 8px;
    border-bottom: none;
  }
  .il-option-name {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
  }
  .il-option-price {
    font-weight: 700;
    color: var(--sage-dark);
    white-space: nowrap;
  }
  .il-option-price.strike {
    color: var(--text-light);
    text-decoration: line-through;
    font-weight: 500;
  }

  .il-verdict {
    background: linear-gradient(135deg, #EFF6F0, #F5F9F5);
    border-radius: 10px;
    padding: 12px 14px;
    border-right: 3px solid var(--sage);
    font-size: 13.5px;
    color: var(--sage-dark);
    margin-top: 10px;
  }
  .il-verdict strong { font-weight: 700; }

  .il-warning {
    background: #FEF2EF;
    border-right: 3px solid var(--accent);
    border-radius: 10px;
    padding: 10px 12px;
    margin: 10px 0;
    font-size: 12.5px;
    color: #A0522D;
  }

  .il-vfm-section {
    background: linear-gradient(135deg, #1A2F1C 0%, #2D4A30 100%);
    color: white;
    border-radius: 16px;
    padding: 22px;
    margin: 24px 0;
  }
  .il-vfm-section h3 {
    font-size: 17px;
    margin-bottom: 12px;
  }
  .il-vfm-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 14px;
  }
  .il-vfm-card {
    background: rgba(255,255,255,0.08);
    border-radius: 10px;
    padding: 12px;
  }
  .il-vfm-card-title {
    font-size: 11px;
    font-weight: 700;
    opacity: 0.7;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
  }
  .il-vfm-card-value {
    font-size: 14px;
    font-weight: 600;
    color: #A8D5AC;
  }

  .total-compare {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin: 16px 0;
  }
  .total-compare-box {
    background: var(--white);
    border-radius: 12px;
    padding: 16px;
    border: 1px solid var(--border);
    text-align: center;
  }
  .total-compare-box.recommended {
    background: linear-gradient(135deg, #EFF6F0, #F5F9F5);
    border-color: var(--sage);
  }
  .total-compare-label {
    font-size: 12px;
    color: var(--text-light);
    font-weight: 600;
    margin-bottom: 6px;
  }
  .total-compare-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--sage-dark);
  }
  .total-compare-note {
    font-size: 11px;
    color: var(--text-light);
    margin-top: 4px;
  }

  /* ===== CRITERIA TAB ===== */
  .criteria-intro {
    background: linear-gradient(135deg, #EFF6F0, #F5F9F5);
    border-radius: 16px;
    padding: 18px 22px;
    margin: 24px 0;
    border-right: 4px solid var(--sage);
    font-size: 13.5px;
    line-height: 1.7;
  }
  .criteria-intro h3 { color: var(--sage-dark); font-size: 16px; margin-bottom: 8px; }

  .criterion-card {
    background: var(--white);
    border-radius: 14px;
    padding: 16px 18px;
    margin-bottom: 12px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    display: flex;
    align-items: flex-start;
    gap: 14px;
  }
  .criterion-card.disabled {
    opacity: 0.5;
    background: var(--warm);
  }
  .criterion-handle {
    font-size: 22px;
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    background: var(--sage-light);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .criterion-body { flex: 1; min-width: 0; }
  .criterion-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
  }
  .criterion-desc {
    font-size: 13px;
    color: var(--text-light);
    line-height: 1.5;
  }
  .criterion-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
    flex-direction: column;
  }
  .criterion-toggle {
    width: 42px;
    height: 24px;
    background: var(--border);
    border-radius: 12px;
    position: relative;
    cursor: pointer;
    transition: background 0.2s;
    border: none;
    flex-shrink: 0;
  }
  .criterion-toggle::after {
    content: '';
    position: absolute;
    top: 2px;
    right: 2px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: right 0.2s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  }
  .criterion-toggle.on {
    background: var(--sage);
  }
  .criterion-toggle.on::after {
    right: 20px;
  }
  .criterion-priority {
    display: flex;
    gap: 3px;
    margin-top: 6px;
  }
  .priority-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--border);
    cursor: pointer;
  }
  .priority-dot.active { background: var(--sage); }
  .crit-edit-btn {
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 4px 10px;
    font-size: 11px;
    cursor: pointer;
    color: var(--text-light);
    margin-top: 6px;
    font-family: inherit;
  }
  .crit-edit-btn:hover { background: var(--warm); color: var(--sage-dark); }

  /* ===== GROUP SECTIONS ===== */
  .group-tab-bar {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding: 4px 0 12px;
    margin-bottom: 8px;
    border-bottom: 1px solid var(--border);
  }
  .group-pill {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 7px 14px;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-light);
    cursor: pointer;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.15s;
  }
  .group-pill:hover { color: var(--sage-dark); border-color: var(--sage-light); }
  .group-pill.active {
    background: var(--sage);
    color: white;
    border-color: var(--sage);
  }
  .group-pill .pill-count {
    background: rgba(255,255,255,0.25);
    padding: 1px 7px;
    border-radius: 10px;
    font-size: 10px;
  }
  .group-pill:not(.active) .pill-count {
    background: var(--sage-light);
    color: var(--sage-dark);
  }

  .group-section {
    margin-bottom: 24px;
  }
  .group-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(90deg, var(--sage), var(--sage-light));
    color: white;
    padding: 12px 16px;
    border-radius: 12px;
    margin-bottom: 12px;
  }
  .group-section-title {
    font-size: 15px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
  }
  .group-section-stats {
    font-size: 12px;
    opacity: 0.9;
  }

  /* ===== BULK ADD FORM ===== */
  .bulk-row {
    display: grid;
    grid-template-columns: 2fr 1.5fr 1.5fr 1fr auto;
    gap: 8px;
    background: var(--warm);
    border-radius: 10px;
    padding: 10px;
    margin-bottom: 8px;
    align-items: center;
  }
  .bulk-row input,
  .bulk-row select {
    font-family: inherit;
    font-size: 13px;
    padding: 7px 10px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--white);
    width: 100%;
  }
  .bulk-row .remove-row {
    background: var(--accent-light);
    color: #A0522D;
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    cursor: pointer;
    font-size: 14px;
    flex-shrink: 0;
    font-weight: 700;
  }
  .bulk-row .remove-row:hover { background: var(--accent); color: white; }
  .add-row-btn {
    width: 100%;
    background: transparent;
    border: 1.5px dashed var(--sage);
    color: var(--sage-dark);
    padding: 10px;
    border-radius: 10px;
    cursor: pointer;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    margin-top: 8px;
  }
  .add-row-btn:hover { background: var(--warm); }

  .find-product-btn {
    background: linear-gradient(135deg, var(--sage), var(--sage-dark));
    color: white;
    border: none;
    border-radius: 8px;
    padding: 6px 12px;
    cursor: pointer;
    font-family: inherit;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
  }
  .find-product-btn:hover { opacity: 0.9; }
  .product-suggestion {
    background: linear-gradient(135deg, #EFF6F0, #F5F9F5);
    border-right: 3px solid var(--sage);
    border-radius: 8px;
    padding: 10px 12px;
    margin-top: 6px;
    font-size: 12px;
    color: var(--sage-dark);
  }
  .product-suggestion strong { color: var(--text); }
  .product-suggestion .links {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 6px;
  }
  .product-suggestion a {
    color: var(--sage-dark);
    text-decoration: underline;
    font-size: 11px;
  }

  /* SEARCH SETTINGS */
  .search-mode-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 10px;
  }
  .search-mode-info {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
  }
  .search-mode-info .mode-icon {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: var(--sage-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
  }
  .search-mode-info .mode-icon.online { background: linear-gradient(135deg,var(--sage),var(--sage-dark)); color:white }
  .search-mode-info .mode-icon.offline { background: var(--sand); }
  .mode-label { font-weight: 700; color: var(--text); }
  .mode-sub { font-size: 11px; color: var(--text-light); }
  .settings-btn {
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 7px 14px;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    color: var(--sage-dark);
  }
  .settings-btn:hover { background: var(--warm); }

  /* Buy-links modal */
  .buy-modal-header {
    background: var(--warm);
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 14px;
  }
  .buy-modal-item-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 2px;
  }
  .buy-modal-product {
    font-size: 12px;
    color: var(--text-light);
  }
  .buy-modal-search-q {
    font-size: 11px;
    color: var(--sage-dark);
    margin-top: 4px;
    font-style: italic;
  }

  /* Variant picker (when product has multiple options separated by /) */
  .buy-variant-bar {
    background: linear-gradient(135deg, #EFF6F0, #F5F9F5);
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 14px;
    border-right: 3px solid var(--sage);
  }
  .buy-variant-label {
    font-size: 12px;
    color: var(--sage-dark);
    font-weight: 600;
    margin-bottom: 8px;
  }
  .buy-variant-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }
  .buy-variant-pill {
    background: var(--white);
    border: 1.5px solid var(--border);
    border-radius: 18px;
    padding: 6px 12px;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    color: var(--text);
    transition: all 0.15s;
  }
  .buy-variant-pill:hover {
    border-color: var(--sage);
    background: var(--warm);
  }
  .buy-variant-pill.active {
    background: var(--sage);
    border-color: var(--sage-dark);
    color: white;
  }
  .buy-section-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--sage-dark);
    margin: 14px 0 8px;
    padding-bottom: 4px;
    border-bottom: 1px solid var(--border);
  }
  .buy-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    margin-bottom: 6px;
    text-decoration: none;
    color: var(--text);
    transition: all 0.15s;
    background: var(--white);
  }
  .buy-link:hover {
    border-color: var(--sage);
    background: var(--warm);
    transform: translateX(-2px);
  }
  .buy-link .buy-icon {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: var(--warm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
  }
  .buy-link .buy-text { flex: 1; }
  .buy-link .buy-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
  }
  .buy-link .buy-desc {
    font-size: 11px;
    color: var(--text-light);
  }
  .buy-link .buy-arrow {
    color: var(--sage);
    font-size: 14px;
    flex-shrink: 0;
  }

  /* Necessity badges: 1=must, 2=desired, 3=nice-to-have, 4=indulgence */
  .necessity-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    white-space: nowrap;
    vertical-align: middle;
    line-height: 1.5;
  }
  .necessity-badge.n1 { background: #FDECEA; color: #C0392B; border: 1px solid #F5BAB2; }
  .necessity-badge.n2 { background: #FEF3E2; color: #B8860B; border: 1px solid #F0DBA8; }
  .necessity-badge.n3 { background: #EBF4FF; color: #1A5276; border: 1px solid #BDD9F0; }
  .necessity-badge.n4 { background: #F3E9F7; color: #6B3A8E; border: 1px solid #D9C2E5; }

  /* Necessity selector in edit modal */
  .necessity-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
    margin-top: 6px;
  }
  .necessity-option {
    background: var(--white);
    border: 2px solid var(--border);
    border-radius: 10px;
    padding: 8px 10px;
    cursor: pointer;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    color: var(--text);
    transition: all 0.15s;
    text-align: center;
  }
  .necessity-option:hover { border-color: var(--sage-light); }
  .necessity-option.selected.n1 { background: #FDECEA; border-color: #C0392B; color: #C0392B; }
  .necessity-option.selected.n2 { background: #FEF3E2; border-color: #B8860B; color: #B8860B; }
  .necessity-option.selected.n3 { background: #EBF4FF; border-color: #1A5276; color: #1A5276; }
  .necessity-option.selected.n4 { background: #F3E9F7; border-color: #6B3A8E; color: #6B3A8E; }

  /* Status selector in edit modal */
  .status-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    margin-top: 6px;
  }
  .status-option {
    background: var(--white);
    border: 2px solid var(--border);
    border-radius: 10px;
    padding: 10px 8px;
    cursor: pointer;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    color: var(--text);
    transition: all 0.15s;
    text-align: center;
  }
  .status-option:hover { border-color: var(--sage-light); }
  .status-option.selected[data-s="pending"]  { background: #FEF9F0; border-color: #B8860B; color: #B8860B; }
  .status-option.selected[data-s="reserved"] { background: #FEF3E2; border-color: #C9856A; color: #A0522D; }
  .status-option.selected[data-s="done"]     { background: #EFF6F0; border-color: var(--sage-dark); color: var(--sage-dark); }

  /* Necessity filter row above the items list */
  .necessity-filter-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin: 10px 0 14px;
    padding: 10px 12px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 12px;
  }
  .necessity-filter-row .nf-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-light);
    margin-left: 4px;
  }
  .nf-pill {
    background: transparent;
    border: 1.5px solid var(--border);
    border-radius: 18px;
    padding: 5px 12px;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    color: var(--text-light);
    transition: all 0.15s;
    display: inline-flex;
    align-items: center;
    gap: 4px;
  }
  .nf-pill:hover { color: var(--text); }
  .nf-pill .nf-count {
    background: var(--warm);
    border-radius: 10px;
    padding: 1px 7px;
    font-size: 11px;
    font-weight: 700;
  }
  .nf-pill.active.n1 { background: #FDECEA; border-color: #C0392B; color: #C0392B; }
  .nf-pill.active.n2 { background: #FEF3E2; border-color: #B8860B; color: #B8860B; }
  .nf-pill.active.n3 { background: #EBF4FF; border-color: #1A5276; color: #1A5276; }
  .nf-pill.active.n4 { background: #F3E9F7; border-color: #6B3A8E; color: #6B3A8E; }
  .nf-pill.active .nf-count { background: rgba(255,255,255,0.6); }
  .nf-clear {
    background: transparent;
    border: none;
    color: var(--text-light);
    font-size: 12px;
    cursor: pointer;
    text-decoration: underline;
    font-family: inherit;
    margin-right: auto;
  }
  .nf-clear:hover { color: var(--accent); }

  /* Reserved status indicator */
  .reserved-btn {
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 5px 10px;
    font-family: inherit;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    color: var(--text-light);
    white-space: nowrap;
    transition: all 0.15s;
    margin-left: 4px;
  }
  .reserved-btn:hover { background: var(--warm); color: var(--text); }
  .reserved-btn.active {
    background: #FEF3E2;
    border-color: #B8860B;
    color: #B8860B;
  }
  .reserved-btn.active:hover { background: #FCE9C8; }

  /* Row visual when reserved */
  .checklist-row.reserved {
    background: linear-gradient(to right, rgba(254,243,226,0.6), transparent 80%);
    border-right: 3px solid #B8860B;
  }

  /* Stat card colors for reserved */
  .stat-value.gold { color: #B8860B; }
  .stat-value.muted { color: var(--text-light); }

  /* Buy button on each checklist row */
  .buy-link-btn {
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 5px 10px;
    font-family: inherit;
    font-size: 12px;
    cursor: pointer;
    color: var(--sage-dark);
    white-space: nowrap;
    transition: all 0.15s;
    margin-left: 6px;
  }
  .buy-link-btn:hover {
    background: var(--sage);
    color: white;
    border-color: var(--sage);
  }

  /* Search mode segmented selector */
  .search-mode-segmented {
    display: inline-flex;
    background: var(--warm);
    border-radius: 10px;
    padding: 3px;
    gap: 2px;
    border: 1px solid var(--border);
  }
  .search-mode-seg-btn {
    background: transparent;
    border: none;
    border-radius: 8px;
    padding: 7px 12px;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    color: var(--text-light);
    transition: all 0.15s;
    white-space: nowrap;
  }
  .search-mode-seg-btn:hover { color: var(--text); }
  .search-mode-seg-btn.active {
    background: var(--white);
    color: var(--sage-dark);
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  }

  .search-loader {
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid var(--sage-light);
    border-top-color: var(--sage);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-right: 6px;
    vertical-align: middle;
  }
  @keyframes spin { to { transform: rotate(360deg); } }

  .api-help {
    background: #FEF9F0;
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 12px;
    line-height: 1.6;
    color: #8B6914;
    margin: 10px 0;
  }
  .api-help a { color: #8B6914; text-decoration: underline; }
  .api-help ol { padding-right: 18px; margin-top: 6px; }
  .api-help ol li { margin-bottom: 4px; }

  /* ===== FIREBASE / SYNC ===== */
  #login-overlay {
    position: fixed;
    inset: 0;
    background: linear-gradient(135deg, var(--sage-dark) 0%, var(--sage) 100%);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
  }
  #login-overlay.hidden { display: none; }
  .login-box {
    background: white;
    border-radius: 20px;
    padding: 32px 28px;
    max-width: 380px;
    width: 100%;
    box-shadow: 0 16px 48px rgba(0,0,0,0.3);
    text-align: center;
  }
  .login-box h2 {
    font-family: 'Assistant', sans-serif;
    font-weight: 800;
    color: var(--sage-dark);
    font-size: 26px;
    margin-bottom: 6px;
    letter-spacing: -0.015em;
  }
  .login-box p {
    color: var(--text-light);
    font-size: 13px;
    margin-bottom: 20px;
  }
  .login-box input {
    width: 100%;
    padding: 12px 16px;
    border-radius: 10px;
    border: 1.5px solid var(--border);
    font-family: inherit;
    font-size: 14px;
    background: var(--warm);
    margin-bottom: 12px;
    text-align: center;
  }
  .login-box input:focus {
    outline: none;
    border-color: var(--sage);
    background: white;
  }
  .login-box button {
    width: 100%;
    padding: 12px;
    border-radius: 10px;
    border: none;
    background: var(--sage);
    color: white;
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
  }
  .login-box button:hover { background: var(--sage-dark); }
  .login-box .login-error {
    color: #C0392B;
    font-size: 12px;
    margin-top: 8px;
    min-height: 16px;
  }
  .login-emoji { font-size: 42px; margin-bottom: 8px; }
  .login-status {
    margin-top: 12px;
    font-size: 11px;
    color: var(--text-light);
  }

  /* SYNC STATUS BAR */
  #sync-bar {
    position: fixed;
    bottom: 12px;
    left: 12px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 12px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    z-index: 50;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: opacity 0.3s;
  }
  #sync-bar .sync-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--sage);
  }
  #sync-bar.syncing .sync-dot { background: #E8AA45; animation: pulse 1s infinite; }
  #sync-bar.error .sync-dot { background: #C0392B; }
  #sync-bar.local .sync-dot { background: var(--text-light); }
  @keyframes pulse {
    0%,100% { opacity: 1; }
    50% { opacity: 0.4; }
  }
  #sync-bar .logout-link {
    color: var(--text-light);
    cursor: pointer;
    text-decoration: underline;
    font-size: 11px;
    margin-right: 6px;
    background: none;
    border: none;
    font-family: inherit;
    padding: 0;
  }

  /* SETUP MODAL */
  #firebase-setup-modal {
    z-index: 10000; /* must be above login-overlay (9999) */
  }
  #firebase-setup-modal .modal {
    max-width: 520px;
  }
  .firebase-step {
    background: var(--warm);
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 8px;
    font-size: 12px;
    line-height: 1.6;
  }
  .firebase-step strong {
    color: var(--sage-dark);
    display: block;
    margin-bottom: 4px;
  }
  .firebase-step code {
    background: white;
    padding: 1px 5px;
    border-radius: 4px;
    font-size: 11px;
    color: var(--accent);
  }

  @media (max-width: 600px) {
    .bulk-row {
      grid-template-columns: 1fr 1fr auto;
      grid-auto-flow: dense;
    }
    .bulk-row > input:first-child { grid-column: 1 / -1; }
  }

  @media (max-width: 480px) {
    .detail-grid { grid-template-columns: 1fr; }
    .card-header { flex-direction: column; }
    .safety-badge { flex-direction: row; gap: 6px; width: 100%; justify-content: center; }
  }

  /* ===== PERSONAL BAR ===== */
  .personal-bar {
    background: rgba(255,255,255,0.13);
    border: 1px solid rgba(255,255,255,0.25);
    border-radius: 14px;
    padding: 10px 18px;
    margin: 16px auto 0;
    max-width: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    flex-wrap: wrap;
    font-size: 13px;
    color: white;
  }
  .pi-item { display: flex; align-items: center; gap: 5px; }
  .pi-label { opacity: 0.72; font-size: 12px; }
  .pi-value { font-weight: 700; }
  .pi-weeks {
    background: rgba(255,255,255,0.2);
    border-radius: 20px;
    padding: 1px 8px;
    font-size: 11px;
    font-weight: 700;
  }
  .pi-weeks.urgent { background: rgba(220,53,69,0.7); }
  .pi-weeks.soon { background: rgba(232,170,69,0.7); }
  .edit-personal-btn {
    background: rgba(255,255,255,0.18);
    border: 1px solid rgba(255,255,255,0.35);
    color: white;
    border-radius: 8px;
    padding: 5px 13px;
    font-size: 11px;
    cursor: pointer;
    font-family: inherit;
    font-weight: 700;
    transition: background 0.15s;
  }
  .edit-personal-btn:hover { background: rgba(255,255,255,0.28); }
  .add-personal-btn {
    background: rgba(255,255,255,0.18);
    border: 1.5px dashed rgba(255,255,255,0.5);
    color: white;
    border-radius: 10px;
    padding: 8px 20px;
    font-size: 13px;
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    margin-top: 14px;
    display: inline-block;
    transition: background 0.15s;
  }
  .add-personal-btn:hover { background: rgba(255,255,255,0.26); }

  /* ===== BUY-BEFORE BADGE ===== */
  .buy-before-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    white-space: nowrap;
    margin-top: 3px;
  }
  .buy-before-badge.urgent { background: #FDECEA; color: #C0392B; }
  .buy-before-badge.soon   { background: #FEF3E2; color: #B8860B; }
  .buy-before-badge.ok     { background: #EFF6F0; color: var(--sage-dark); }
  .buy-before-badge.after  { background: var(--warm); color: var(--text-light); }

  /* ===== PERSONAL TAB ===== */
  .personal-tab-hero {
    background: linear-gradient(135deg, var(--sage-dark) 0%, var(--sage) 60%, var(--sage-light) 100%);
    border-radius: 20px;
    padding: 28px 28px 24px;
    margin: 24px 0 20px;
    color: white;
    text-align: center;
  }
  .personal-tab-hero h2 {
    font-family: 'Assistant', sans-serif;
    font-weight: 800;
    font-size: 24px;
    margin-bottom: 6px;
    letter-spacing: -0.015em;
  }
  .personal-tab-hero p { font-size: 13px; opacity: 0.85; }
  .personal-display-card {
    background: var(--white);
    border-radius: 16px;
    padding: 22px 24px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    margin-bottom: 16px;
  }
  .personal-display-card h3 {
    font-size: 14px;
    font-weight: 700;
    color: var(--sage-dark);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
  }
  .personal-form-field {
    margin-bottom: 14px;
  }
  .personal-form-field label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
  }
  .personal-form-field input {
    width: 100%;
    font-family: inherit;
    font-size: 15px;
    padding: 11px 14px;
    border-radius: 10px;
    border: 1.5px solid var(--border);
    background: var(--warm);
    color: var(--text);
    transition: border-color 0.15s, background 0.15s;
  }
  .personal-form-field input:focus {
    outline: none;
    border-color: var(--sage);
    background: var(--white);
  }
  .due-date-preview {
    background: linear-gradient(135deg, #EFF6F0, #F5F9F5);
    border-radius: 12px;
    padding: 14px 18px;
    margin-top: 14px;
    border-right: 3px solid var(--sage);
    font-size: 13.5px;
    color: var(--sage-dark);
    display: none;
  }
  .due-date-preview .due-weeks {
    font-size: 26px;
    font-weight: 900;
    color: var(--sage-dark);
    display: block;
    margin-bottom: 2px;
  }
  .personal-save-btn {
    width: 100%;
    padding: 13px;
    background: var(--sage);
    color: white;
    border: none;
    border-radius: 12px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s;
    margin-top: 4px;
  }
  .personal-save-btn:hover { background: var(--sage-dark); }
  .personal-saved-msg {
    text-align: center;
    color: var(--sage-dark);
    font-size: 13px;
    font-weight: 600;
    margin-top: 10px;
    min-height: 20px;
    opacity: 0;
    transition: opacity 0.3s;
  }
  .personal-saved-msg.show { opacity: 1; }

  /* ===== PERSONAL MODAL ===== */
  #personal-modal { z-index: 10000; }

  /* ===== GENDER SELECTOR ===== */
  .gender-options {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 6px;
  }
  .gender-option {
    flex: 1;
    min-width: 90px;
    background: var(--warm);
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 12px 10px;
    text-align: center;
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    transition: all 0.2s;
  }
  .gender-option:hover { border-color: var(--sage-light); }
  .gender-option.selected {
    background: var(--sage);
    border-color: var(--sage-dark);
    color: white;
  }
  .gender-option .emoji { display: block; font-size: 22px; margin-bottom: 3px; }

  /* ===== TASKS TAB ===== */
  .tasks-add-row {
    display: flex;
    gap: 8px;
    margin-bottom: 14px;
  }
  .tasks-add-row input {
    flex: 1;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--white);
    font-family: inherit;
    font-size: 14px;
  }
  .tasks-add-row input:focus { outline: none; border-color: var(--sage); }
  .tasks-add-btn {
    background: var(--sage);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 0 18px;
    cursor: pointer;
    font-family: inherit;
    font-weight: 700;
    font-size: 14px;
    white-space: nowrap;
    transition: background 0.15s;
  }
  .tasks-add-btn:hover { background: var(--sage-dark); }

  .quick-add-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 18px;
  }
  .quick-add-bar .label {
    width: 100%;
    font-size: 12px;
    color: var(--text-light);
    margin-bottom: 2px;
  }
  .quick-add-chip {
    background: var(--warm);
    color: var(--sage-dark);
    border: 1px dashed var(--sage-light);
    border-radius: 18px;
    padding: 5px 12px;
    font-size: 12px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s;
  }
  .quick-add-chip:hover {
    background: var(--sage-light);
    border-style: solid;
  }

  .task-card {
    background: var(--white);
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 8px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 10px;
    transition: opacity 0.2s;
  }
  .task-card.done { opacity: 0.55; }
  .task-card .task-check {
    width: 22px;
    height: 22px;
    border: 2px solid var(--sage);
    border-radius: 6px;
    cursor: pointer;
    flex-shrink: 0;
    background: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: white;
    transition: all 0.15s;
  }
  .task-card.done .task-check {
    background: var(--sage);
  }
  .task-card .task-text {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
  }
  .task-card.done .task-text {
    text-decoration: line-through;
    color: var(--text-light);
  }
  .task-card .task-del {
    background: none;
    border: none;
    color: var(--text-light);
    font-size: 18px;
    cursor: pointer;
    padding: 0 4px;
    opacity: 0.5;
    transition: opacity 0.15s;
  }
  .task-card .task-del:hover { opacity: 1; color: var(--accent); }

  .empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-light);
  }
  .empty-state .emoji { font-size: 48px; margin-bottom: 10px; display: block; }
  .empty-state p { font-size: 14px; }

  /* ===== NAMES TAB ===== */
  .names-add-row {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 8px;
    margin-bottom: 12px;
  }
  .names-add-row input, .names-add-row select {
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--white);
    font-family: inherit;
    font-size: 14px;
  }
  .names-add-row select { padding: 12px 8px; }
  .names-add-row input:focus, .names-add-row select:focus { outline: none; border-color: var(--sage); }
  .names-note-input {
    width: 100%;
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--white);
    font-family: inherit;
    font-size: 13px;
    margin-bottom: 14px;
  }
  .names-note-input:focus { outline: none; border-color: var(--sage); }

  .names-filter-bar {
    display: flex;
    gap: 6px;
    margin-bottom: 14px;
    flex-wrap: wrap;
  }
  .names-filter-pill {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 20px;
    padding: 5px 14px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s;
  }
  .names-filter-pill.active {
    background: var(--sage);
    color: white;
    border-color: var(--sage);
  }

  .name-card {
    background: var(--white);
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 8px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 10px;
  }
  .name-card .name-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
  }
  .name-card.boy .name-icon { background: #D8E9F5; }
  .name-card.girl .name-icon { background: #F8DCE3; }
  .name-card.neutral .name-icon { background: var(--warm); }
  .name-card .name-text { flex: 1; }
  .name-card .name-main {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 2px;
  }
  .name-card .name-note {
    font-size: 12px;
    color: var(--text-light);
  }
  .name-card .name-fav {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 20px;
    padding: 0 4px;
    transition: transform 0.15s;
  }
  .name-card .name-fav:hover { transform: scale(1.2); }
  .name-card.fav { border-color: #E8AA45; box-shadow: 0 4px 16px rgba(232,170,69,0.15); }
  .name-card .name-del {
    background: none;
    border: none;
    color: var(--text-light);
    font-size: 18px;
    cursor: pointer;
    padding: 0 4px;
    opacity: 0.5;
    transition: opacity 0.15s;
  }
  .name-card .name-del:hover { opacity: 1; color: var(--accent); }

  /* ===== SETTINGS TAB ===== */
  .settings-section {
    background: var(--white);
    border-radius: 16px;
    padding: 20px 22px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
  }
  .settings-section h3 {
    font-size: 15px;
    font-weight: 700;
    color: var(--sage-dark);
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
  }
  .settings-section .desc {
    font-size: 13px;
    color: var(--text-light);
    margin-bottom: 14px;
  }
  .theme-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
  }
  .theme-card {
    border: 2px solid var(--border);
    border-radius: 14px;
    padding: 14px 12px;
    cursor: pointer;
    background: var(--white);
    transition: all 0.2s;
    text-align: center;
  }
  .theme-card:hover { transform: translateY(-2px); }
  .theme-card.active {
    border-color: var(--sage-dark);
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  }
  .theme-card .theme-preview {
    height: 36px;
    border-radius: 8px;
    margin-bottom: 8px;
    display: flex;
    overflow: hidden;
  }
  .theme-card .theme-preview span { flex: 1; }
  .theme-card .theme-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
  }
  .theme-card .theme-desc {
    font-size: 11px;
    color: var(--text-light);
    margin-top: 2px;
  }
  .theme-card.active .theme-name::before {
    content: '✓ ';
    color: var(--sage);
  }

  /* personal bar tweaks: add styling to existing element by id */
  #personal-bar {
    position: relative;
    z-index: 2;
    background: rgba(255,255,255,0.13);
    border: 1px solid rgba(255,255,255,0.25);
    border-radius: 14px;
    padding: 10px 18px;
    margin: 16px auto 0;
    max-width: 600px;
    align-items: center;
    justify-content: center;
    gap: 14px;
    flex-wrap: wrap;
    font-size: 13px;
    color: white;
  }