@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;600;700&family=Inter:wght@300;400;500;600;700&display=swap');

  :root {
    --pine: #1A1A1A;
    --pine-light: #333333;
    --cream: #FAFAFA;
    --warm-white: #FFFFFF;
    --sand: #F0F0F0;
    --sand-dark: #D9D9D9;
    --text: #1A1A1A;
    --text-muted: #6B6B6B;
    --accent: #E63946;
    --accent-light: #FF5A65;
    --success: #2C6E49;
    --border: #E5E5E5;
    --shadow: 0 2px 16px rgba(0,0,0,0.06);
    --shadow-hover: 0 8px 32px rgba(0,0,0,0.12);
  }

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

  body {
    font-family: 'Inter', sans-serif;
    background: var(--cream);
    color: var(--text);
    min-height: 100vh;
  }

  header {
    background: var(--warm-white);
    padding: 12px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 3px solid var(--accent);
    box-shadow: var(--shadow);
  }
  .logo {
    display: flex;
    align-items: center;
    gap: 12px;
  }
  .logo img {
    height: 48px;
    width: auto;
    display: block;
  }
  .logo-text {
    font-family: 'Playfair Display', serif;
    color: var(--text);
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.2;
  }
  .logo-text span { color: var(--accent); }
  .logo-sub {
    font-size: 0.62rem;
    color: var(--text-muted);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-weight: 500;
  }
  .header-tag {
    font-size: 0.72rem;
    color: var(--text-muted);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-weight: 600;
  }

  /* PROGRESS BAR */
  .progress-wrap {
    background: white;
    padding: 14px 32px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 16px;
  }
  .progress-bar {
    flex: 1;
    height: 6px;
    background: var(--sand);
    border-radius: 3px;
    overflow: hidden;
  }
  .progress-fill {
    height: 100%;
    background: var(--pine);
    border-radius: 3px;
    transition: width 0.4s ease;
  }
  .progress-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
    font-weight: 500;
  }

  /* SCREEN CONTAINER */
  .screen {
    display: none;
    min-height: calc(100vh - 110px);
  }
  .screen.active { display: flex; flex-direction: column; }

  /* QUIZ SCREEN */
  .quiz-wrap {
    max-width: 680px;
    margin: 0 auto;
    padding: 48px 24px;
    width: 100%;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  .q-eyebrow {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 12px;
  }
  .q-title {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    color: var(--pine);
    line-height: 1.2;
    margin-bottom: 8px;
  }
  .q-sub {
    font-size: 0.88rem;
    color: var(--text-muted);
    margin-bottom: 36px;
    line-height: 1.6;
  }

  .options-grid {
    display: grid;
    gap: 14px;
  }
  .options-grid.cols-2 { grid-template-columns: 1fr 1fr; }
  .options-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }

  .option-btn {
    background: white;
    border: 2px solid var(--border);
    border-radius: 14px;
    padding: 20px 18px;
    cursor: pointer;
    transition: all 0.18s;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 6px;
    box-shadow: var(--shadow);
  }
  .option-btn:hover {
    border-color: var(--pine);
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
  }
  .option-btn.selected {
    border-color: var(--pine);
    background: #F0F5F0;
    box-shadow: 0 0 0 1px var(--pine);
  }
  .option-icon { font-size: 2rem; line-height: 1; }
  .option-label {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
  }
  .option-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.4;
  }

  .q-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 36px;
    gap: 12px;
  }
  .btn-back-q {
    padding: 12px 24px;
    background: transparent;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s;
  }
  .btn-back-q:hover { border-color: var(--pine); color: var(--pine); }
  .btn-next-q {
    padding: 14px 36px;
    background: var(--pine);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
    margin-left: auto;
  }
  .btn-next-q:hover { background: var(--pine-light); }
  .btn-next-q:disabled { opacity: 0.35; cursor: not-allowed; }

  /* RESULT SCREEN */
  .result-wrap {
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 24px;
    width: 100%;
  }

  .result-header {
    text-align: center;
    margin-bottom: 40px;
  }
  .result-tag {
    display: inline-block;
    background: #E8F5E9;
    color: var(--success);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 5px 14px;
    border-radius: 20px;
    margin-bottom: 14px;
  }
  .result-title {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    color: var(--pine);
    margin-bottom: 8px;
  }
  .result-sub {
    font-size: 0.88rem;
    color: var(--text-muted);
    max-width: 500px;
    margin: 0 auto;
    line-height: 1.6;
  }

  .result-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
    margin-bottom: 28px;
  }

  .result-card {
    background: white;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: var(--shadow);
    border: 2px solid transparent;
    position: relative;
  }
  .result-card.recommended {
    border-color: var(--pine);
  }
  .recommended-badge {
    position: absolute;
    top: 10px; left: 10px;
    background: var(--pine);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 3px 10px;
    border-radius: 10px;
    z-index: 1;
  }
  .result-card img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    display: block;
    background: var(--sand);
  }
  .result-card-img-ph {
    width: 100%;
    height: 160px;
    background: linear-gradient(135deg, var(--sand), var(--sand-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
  }
  .result-card-body { padding: 14px; }
  .result-card-category {
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 5px;
  }
  .result-card-name {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
    line-height: 1.3;
  }
  .result-card-detail {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-bottom: 10px;
    line-height: 1.4;
  }
  .result-card-price {
    font-size: 1rem;
    font-weight: 800;
    color: var(--accent);
  }
  .result-card-cash {
    font-size: 0.72rem;
    color: var(--success);
    font-weight: 600;
    margin-top: 2px;
  }

  /* SWAP BUTTON */
  .swap-btn {
    width: 100%;
    margin-top: 10px;
    padding: 8px;
    background: var(--sand);
    border: none;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s;
  }
  .swap-btn:hover { background: var(--sand-dark); color: var(--text); }

  /* TOTAL BOX */
  .total-box {
    background: white;
    border-radius: 14px;
    padding: 20px 24px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
  }
  .total-box-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
  }
  .total-box-label { font-size: 0.85rem; color: var(--text-muted); }
  .total-box-amount { font-size: 1.1rem; font-weight: 700; color: var(--text); }
  .total-cash-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #EAF4ED;
    border-radius: 8px;
    padding: 10px 14px;
    margin-top: 4px;
  }
  .total-cash-label { font-size: 0.8rem; color: var(--success); font-weight: 600; }
  .total-cash-amount { font-size: 1.2rem; font-weight: 800; color: var(--success); }

  .result-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
  }
  .btn-whatsapp {
    flex: 1;
    min-width: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px;
    background: #25D366;
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s;
  }
  .btn-whatsapp:hover { background: #1EB855; }
  .btn-restart {
    padding: 16px 28px;
    background: transparent;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s;
  }
  .btn-restart:hover { border-color: var(--pine); color: var(--pine); }

  /* SWAP MODAL */
  .modal-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 200;
    align-items: center;
    justify-content: center;
    padding: 20px;
  }
  .modal-overlay.open { display: flex; }
  .modal {
    background: white;
    border-radius: 16px;
    padding: 28px;
    max-width: 560px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  }
  .modal-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.2rem;
    color: var(--pine);
    margin-bottom: 20px;
  }
  .modal-option {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px;
    border-radius: 10px;
    cursor: pointer;
    border: 2px solid var(--border);
    margin-bottom: 10px;
    transition: all 0.15s;
    background: white;
    width: 100%;
    text-align: left;
  }
  .modal-option:hover { border-color: var(--pine); background: #F0F5F0; }
  .modal-option.current { border-color: var(--pine); background: #F0F5F0; }
  .modal-option img, .modal-opt-ph {
    width: 56px; height: 56px;
    object-fit: cover;
    border-radius: 8px;
    background: var(--sand);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
  }
  .modal-opt-info { flex: 1; }
  .modal-opt-name { font-size: 0.82rem; font-weight: 600; margin-bottom: 2px; }
  .modal-opt-detail { font-size: 0.72rem; color: var(--text-muted); }
  .modal-opt-price { font-size: 0.9rem; font-weight: 700; color: var(--accent); flex-shrink: 0; }
  .modal-close-btn {
    width: 100%;
    padding: 12px;
    background: var(--sand);
    border: none;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 8px;
    color: var(--text);
  }

  /* REASON TAG */
  .reason-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: var(--sand);
    border-radius: 6px;
    padding: 3px 10px;
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 8px;
  }

  @media (max-width: 700px) {
    .result-grid { grid-template-columns: 1fr; }
    .options-grid.cols-2 { grid-template-columns: 1fr 1fr; }
    .options-grid.cols-3 { grid-template-columns: 1fr 1fr; }
    .q-title { font-size: 1.5rem; }
  }
  @media (max-width: 400px) {
    .options-grid.cols-2, .options-grid.cols-3 { grid-template-columns: 1fr; }
  }

  /* WHY BLOCK */
  .why-block {
    background: linear-gradient(135deg, #F0F5F1 0%, #E8F0EA 100%);
    border: 1.5px solid #C8DCC9;
    border-radius: 14px;
    padding: 22px 24px;
    margin-bottom: 24px;
    display: flex;
    gap: 18px;
    align-items: flex-start;
  }
  .why-icon { font-size: 2.4rem; flex-shrink: 0; margin-top: 2px; }
  .why-content { flex: 1; }
  .why-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.05rem;
    color: var(--pine);
    margin-bottom: 8px;
    font-weight: 600;
  }
  .why-text {
    font-size: 0.88rem;
    color: var(--text);
    line-height: 1.7;
    margin-bottom: 12px;
  }
  .why-tags { display: flex; flex-wrap: wrap; gap: 7px; }
  .why-tag {
    background: white;
    border: 1px solid #C8DCC9;
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--pine);
  }


  /* RECEIPT MODAL */
  .receipt-modal {
    background: transparent;
    max-width: 420px;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0;
    max-height: 92vh;
    overflow-y: auto;
  }
  .receipt {
    background: white;
    border-radius: 4px;
    padding: 28px 24px;
    font-family: 'Inter', monospace;
    box-shadow: 0 8px 40px rgba(0,0,0,0.25);
    position: relative;
  }
  /* torn edge top */
  .receipt::before {
    content: '';
    position: absolute;
    top: -10px; left: 0; right: 0;
    height: 10px;
    background: radial-gradient(circle at 10px -1px, transparent 8px, white 8px) repeat-x;
    background-size: 20px 10px;
  }
  /* torn edge bottom */
  .receipt::after {
    content: '';
    position: absolute;
    bottom: -10px; left: 0; right: 0;
    height: 10px;
    background: radial-gradient(circle at 10px 11px, transparent 8px, white 8px) repeat-x;
    background-size: 20px 10px;
  }
  .receipt-header { text-align: center; margin-bottom: 4px; }
  .receipt-logo {
    font-family: 'Playfair Display', serif;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--pine);
    letter-spacing: 0.02em;
  }
  .receipt-logo span { color: var(--accent); }
  .receipt-sub { font-size: 0.72rem; color: var(--text-muted); margin-top: 3px; }

  .receipt-divider {
    border: none;
    border-top: 1.5px solid var(--border);
    margin: 14px 0;
  }
  .receipt-divider.dashed { border-top-style: dashed; }

  .receipt-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  .receipt-label {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    color: var(--text-muted);
    text-transform: uppercase;
  }
  .receipt-date { font-size: 0.82rem; font-weight: 600; color: var(--text); margin-top: 2px; }
  .receipt-stamp {
    font-size: 0.6rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    color: var(--pine);
    border: 2px solid var(--pine);
    border-radius: 4px;
    padding: 3px 8px;
    opacity: 0.6;
    transform: rotate(-8deg);
    display: inline-block;
  }

  .receipt-profile {
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.8;
  }
  .receipt-profile-row { display: flex; gap: 8px; }
  .receipt-profile-key { font-weight: 600; color: var(--text); min-width: 80px; }

  .receipt-product-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--sand);
  }
  .receipt-product-row:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
  .receipt-product-cat {
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 2px;
  }
  .receipt-product-name { font-size: 0.8rem; font-weight: 600; color: var(--text); line-height: 1.3; }
  .receipt-product-price { font-size: 0.88rem; font-weight: 700; color: var(--text); white-space: nowrap; }

  .receipt-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
  }
  .receipt-total-label { font-size: 0.8rem; color: var(--text-muted); }
  .receipt-total-amount { font-size: 0.95rem; font-weight: 700; color: var(--text); }
  .receipt-total-highlight {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--pine);
    border-radius: 8px;
    padding: 10px 14px;
    margin-top: 6px;
  }
  .receipt-total-hl-label { font-size: 0.78rem; color: rgba(255,255,255,0.85); font-weight: 500; }
  .receipt-total-hl-amount { font-size: 1.1rem; font-weight: 800; color: white; }

  .receipt-footer {
    text-align: center;
    font-size: 0.68rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin-top: 4px;
  }

  .receipt-actions {
    background: var(--cream);
    border-radius: 0 0 14px 14px;
    padding: 18px 20px;
    margin-top: 4px;
  }
  .receipt-hint {
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
  }