/* ---- Foundation (UI redesign, spec v1.2 §2) ------------------------------- */
:root {
    --ui-teal: #014D67;
    --header-teal: #004F6E;   /* = the logo blob colour, so the blob blends into the bar */
    --header-black: #010101;
    --coral: #C84432;
    --ink: #0B3A4A;
    --ink-muted: #2E4C57;
    --ink-subtle: #4B6470;
    --ground: #EEF5F5;
    --surface: #FFFFFF;
    --soft-yellow: #F2EBD9;
    --chip: #E2EEF1;
    --border: #C9DCE0;
    --bubble-a: #E9F3F4;
    --bubble-b: #FDF0ED;
    --focus-ring: #7FC4D3;
    --shadow-card: 0 2px 10px rgba(1, 77, 103, 0.08);
    --font-heading: 'Nunito', 'Prompt', sans-serif;
    --font-body: 'Nunito', 'IBM Plex Sans Thai', 'Noto Sans Thai', sans-serif;
}
body { font-family: var(--font-body); background-color: var(--ground); color: var(--ink); }
h1, h2, h3, h4 { font-family: var(--font-heading); }

/* Focus ring on every interactive element (spec §2). !important beats the
   legacy focus:outline-none utilities still on older markup. */
:focus-visible { outline: 3px solid var(--focus-ring) !important; outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

/* ---- Header (spec §4.1) -----------------------------------------------------
   Desktop: band 16px, bar 72px, logo 109px tall, top -6px (relative to the bar),
   left 20px. <=640px: band 10px, bar 56px, logo 84px, top -4px, left 12px.
   The tagline (67.0-72.4% of the logo height) ends on the bar's bottom edge:
   -6 + 0.724*109 = 72.9; -4 + 0.724*84 = 56.8. The blob bulges below the bar;
   content after the header leaves room for it (hero top padding). */
.site-header { position: relative; z-index: 40; }
.site-header .hdr-band { height: 16px; background: var(--header-black); }
.site-header .hdr-bar { height: 72px; background: var(--header-teal); }
.site-header .hdr-inner { position: relative; height: 100%; max-width: 1200px; margin: 0 auto; padding: 0 24px 0 160px;
             display: flex; align-items: center; gap: 24px; }
.site-header .hdr-logo { position: absolute; left: 20px; top: -6px; height: 109px; display: block; z-index: 2; border-radius: 12px; }
.site-header .hdr-logo img { height: 100%; width: auto; display: block; }
.site-header .hdr-nav { display: flex; gap: 24px; }
.site-header .hdr-nav a, .site-header .hdr-nav-mobile a { color: #fff; font-weight: 600; font-size: 15px; text-decoration: none;
             min-height: 44px; display: inline-flex; align-items: center; }
.site-header .hdr-nav a:hover { text-decoration: underline; text-underline-offset: 4px; }
.site-header .hdr-nav-mobile { display: none; }
.site-header .hdr-menu-btn { display: none; }
.site-header .hdr-controls { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.site-header .hdr-pill, .site-header .hdr-signin { min-height: 44px; min-width: 44px; padding: 0 14px; border-radius: 9999px; color: #fff;
             font-weight: 600; font-size: 14px; background: rgba(255, 255, 255, 0.12); border: 0; cursor: pointer; white-space: nowrap; }
.site-header .hdr-pill:hover, .site-header .hdr-signin:hover { background: rgba(255, 255, 255, 0.2); }
.site-header .hdr-signin { background: transparent; border: 1.5px solid rgba(255, 255, 255, 0.55); }
.site-header .hdr-lang { display: inline-flex; padding: 3px; border-radius: 9999px; border: 1.5px solid rgba(255, 255, 255, 0.35); }
.site-header .hdr-lang-btn { min-height: 44px; min-width: 44px; padding: 0 10px; border-radius: 9999px; border: 0; background: transparent;
             color: #fff; font-weight: 700; font-size: 13px; cursor: pointer; }
.site-header .hdr-lang-btn[aria-pressed="true"] { background: rgba(255, 255, 255, 0.25); }
.site-header .hdr-account-btn:hover { background: rgba(255, 255, 255, 0.15); }
.site-header .hdr-caret { color: rgba(255, 255, 255, 0.8); }

@media (max-width: 640px) {
    .site-header .hdr-band { height: 10px; }
    .site-header .hdr-bar { height: 56px; }
    .site-header .hdr-inner { padding: 0 12px 0 110px; }
    .site-header .hdr-logo { left: 12px; top: -4px; height: 84px; }
    .site-header .hdr-nav { display: none; }
    .site-header .hdr-menu-btn { display: inline-flex; align-items: center; justify-content: center; margin-left: auto;
             width: 44px; height: 44px; border-radius: 12px; border: 0; background: rgba(255, 255, 255, 0.12); color: #fff; cursor: pointer; }
    /* the same controls, as a panel under the bar */
    .site-header .hdr-controls { display: none; position: absolute; top: calc(100% + 8px); right: 12px; left: 12px; z-index: 60;
             flex-direction: column; align-items: stretch; gap: 10px; padding: 14px; border-radius: 20px;
             background: var(--surface); box-shadow: 0 8px 28px rgba(1, 77, 103, 0.18); }
    .site-header .hdr-controls.is-open { display: flex; }
    .site-header .hdr-nav-mobile { display: flex; flex-direction: column; border-bottom: 1px solid var(--chip); padding-bottom: 6px; }
    .site-header .hdr-nav-mobile a { color: var(--ui-teal); }
    .site-header .hdr-pill, .site-header .hdr-signin { color: var(--ink); background: var(--chip); text-align: left; }
    .site-header .hdr-signin { border-color: var(--border); background: var(--surface); }
    .site-header .hdr-lang { align-self: flex-start; border-color: var(--border); }
    .site-header .hdr-lang-btn { color: var(--ink); }
    .site-header .hdr-lang-btn[aria-pressed="true"] { background: var(--chip); }
    .site-header .hdr-caret { color: var(--ink-subtle); }
    .site-header #user-profile-menu { align-self: stretch; }
    /* inside the panel the account card flows inline instead of floating */
    .site-header #user-dropdown-card { position: static; width: 100%; margin-top: 8px; box-shadow: none; border-color: var(--chip); }
}

/* ---- Buttons, group 2 (search and recovery, spec §2 "Buttons") ------------------
   Solid coral while no group-1 button (go to a shop / experience) is on the page;
   coral outline once any gift or XP card is rendered (body.has-cards, set in app.js). */
button.btn-g2 { min-height: 48px; padding: 0 28px; border-radius: 9999px; border: 1.5px solid var(--coral);
          background: var(--coral); color: #fff; font-weight: 600; font-size: 15px; cursor: pointer;
          display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
button.btn-g2:hover { background: #A93727; border-color: #A93727; }
button.btn-g2:disabled { opacity: 0.7; cursor: progress; }
body.has-cards button.btn-g2 { background: #fff; color: var(--coral); }
body.has-cards button.btn-g2:hover { background: var(--bubble-b); }

/* ---- Landing (spec §4.2) ----------------------------------------------------- */
.landing { padding: 56px 24px 40px; }                  /* top: room for the logo bulge (31px) */
.landing-inner { max-width: 1200px; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 0.8fr);
          gap: 40px; align-items: center; }
.nowrap { white-space: nowrap; }
.landing-title { color: var(--ui-teal); font-weight: 700; font-size: 40px; line-height: 1.2; margin-bottom: 12px; }
.landing-sub { color: var(--ink-muted); font-size: 17px; line-height: 1.6; margin-bottom: 24px; max-width: 620px; }
.landing-art { display: flex; justify-content: center; }
.landing-art img { width: 100%; max-width: 440px; height: auto; }
.landing-card { display: none; }

.search-card { background: var(--surface); border-radius: 20px; box-shadow: var(--shadow-card); padding: 20px;
          display: flex; flex-direction: column; }
.search-label { font-weight: 700; color: var(--ink); font-size: 15px; margin-bottom: 8px; }
.search-input { width: 100%; min-height: 96px; resize: vertical; border: 1.5px solid var(--border); border-radius: 14px;
          padding: 12px 14px; font-size: 16px; line-height: 1.5; color: var(--ink); background: #fff; }
.search-input::placeholder { color: var(--ink-subtle); opacity: 0.8; }
.chip-label { font-size: 12px; font-weight: 700; color: var(--ink-subtle); margin: 16px 0 8px; }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
button.chip { min-height: 44px; padding: 0 16px; border-radius: 9999px; border: 0; background: var(--chip); color: var(--ink);
          font-weight: 600; font-size: 14px; cursor: pointer; white-space: nowrap; }
button.chip:hover { background: #D3E5EA; }
button.chip[aria-pressed="true"] { background: var(--ui-teal); color: #fff; }
.search-submit { margin-top: 20px; align-self: flex-start; }

/* ---- How it works (spec §4.2) -------------------------------------------------- */
.how { padding: 48px 24px; scroll-margin-top: 16px; }
.how-inner { max-width: 1200px; margin: 0 auto; }
.how-title { color: var(--ui-teal); font-weight: 700; font-size: 28px; margin-bottom: 6px; }
.how-sub { color: var(--ink-muted); margin-bottom: 24px; }
.how-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.how-card { background: var(--soft-yellow); border-radius: 22px; padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.how-card img { width: 64px; height: 64px; border-radius: 9999px; background: #fff; }
.how-card h3 { color: var(--ink); font-weight: 700; font-size: 17px; margin-bottom: 4px; }
.how-card p { color: var(--ink-muted); font-size: 14px; line-height: 1.6; }

/* ---- Partner shops (spec §4.2) ------------------------------------------------- */
.partners { padding: 32px 24px 40px; }
.partners-inner { max-width: 1200px; margin: 0 auto; }
.partners-title { color: var(--ink); font-weight: 700; font-size: 17px; margin-bottom: 12px; }
.partner-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.partner-chips li { border: 1.5px solid var(--border); border-radius: 9999px; padding: 8px 16px; background: #fff;
          color: var(--ink); font-weight: 600; font-size: 14px; }
.partners-note { margin-top: 14px; font-size: 12px; color: var(--ink-subtle); max-width: 720px; }

@media (max-width: 960px) {
    .how-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
    .landing { padding: 40px 16px 24px; }               /* bulge 24px at this size */
    .landing-inner { grid-template-columns: minmax(0, 1fr); }
    .landing-title { font-size: 28px; }
    .landing-sub { font-size: 15px; margin-bottom: 18px; }
    .landing-art { display: none; }
    .landing-card { display: flex; align-items: center; gap: 12px; margin-top: 16px; background: var(--soft-yellow);
          border-radius: 20px; padding: 16px; }
    .landing-card p { flex: 1; color: var(--ink); font-weight: 600; font-size: 15px; line-height: 1.5; }
    .landing-card img { width: 120px; height: auto; flex-shrink: 0; }
    .search-card { padding: 16px; }
    .search-submit { align-self: stretch; }
    .how { padding: 36px 16px; }
    .how-title { font-size: 22px; }
    .how-grid { grid-template-columns: minmax(0, 1fr); }
    .how-card { flex-direction: row; align-items: flex-start; }
    .how-card img { width: 56px; height: 56px; flex-shrink: 0; }
    .partners { padding: 24px 16px 32px; }
}

/* ---- Gift results (spec §4.4) ------------------------------------------------- */
/* Both result sections: the spec container (max 1200px, 24px sides; 16px on phones),
   the same grid and gap, so gift and experience images are the same size at every width. */
.results-wrap { max-width: 1200px; margin: 0 auto; padding-left: 24px; padding-right: 24px; }
.results { padding-top: 8px; padding-bottom: 32px; }
.xp-section { padding-top: 24px; }
.results-sub { color: var(--ink-muted); margin: -8px 0 16px; }
.xp-more { display: flex; justify-content: center; margin-top: 20px; }
button.btn-g3 { min-height: 44px; padding: 0 24px; border-radius: 9999px; border: 1.5px solid var(--ui-teal);
          background: #fff; color: var(--ui-teal); font-weight: 600; font-size: 15px; cursor: pointer; }
button.btn-g3:hover { background: var(--bubble-a); }
.results-title { color: var(--ui-teal); font-weight: 700; font-size: 26px; margin-bottom: 16px; }
/* 3 equal columns on desktop, 2 on tablet, 1 on phones; 1-2 cards keep their column width
   (owner decision 2026-10-07, replaces auto-fill minmax(220px, 1fr)). */
.gift-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }   /* gap = XP grid (gap-6) */
/* Button group 1 (spec §2), gift "Go to store" and XP "View details" alike (step 7b, F3):
   solid coral, ~15px, weight 600, fully rounded, at least 44px tall (F2). */
a.btn-g1 { min-height: 44px; padding: 0 20px; border-radius: 9999px; background: var(--coral); color: #fff;
          font-weight: 600; font-size: 15px; line-height: 1.2; display: inline-flex; align-items: center;
          justify-content: center; white-space: nowrap; text-decoration: none; transition: background-color .15s; }
a.btn-g1:hover { background: #A93727; }

/* Gift card shell = the experience card's (Tailwind classes in app.js, step 4c). */
.gift-card { animation: fade-up 380ms ease-out both; }
/* image band: same box as the XP photo (square on desktop / 2-column, 200px on phones),
   light band colour, product centred with 12px padding and never cropped */
.gift-band { background: #F1F6F7; }
.gift-band img { width: 100%; height: 100%; object-fit: contain; padding: 12px; display: block; }
.gift-band img.is-placeholder { object-fit: cover; padding: 0; }
.shop-badge { align-self: flex-start; border: 1.5px solid var(--border); border-radius: 9999px; padding: 2px 10px;
          font-size: 12px; font-weight: 700; color: var(--ink-muted); background: #fff; }
.gift-price { font-family: 'Nunito', sans-serif; }
.gift-bubble { display: flex; align-items: flex-end; gap: 8px; }
.gift-bubble img, .presenter-line img { flex-shrink: 0; border-radius: 9999px; background: var(--bubble-a); }
.bubble-a { position: relative; background: var(--bubble-a); color: var(--ink); border-radius: 16px 16px 16px 4px;
          padding: 10px 12px; font-size: 14px; line-height: 1.55; flex: 1; min-width: 0; }
.stale-line { margin-top: 12px; font-size: 12px; color: var(--ink-subtle); }
.presenter-line { display: flex; align-items: flex-end; gap: 10px; margin-top: 20px; max-width: 560px; }
button.btn-g2.few-cta { margin: 12px 0 0 54px; }

/* skeletons: white and static (no shimmer, spec §2 motion) */
.gift-card.is-skeleton { animation: none; }
.is-skeleton .gift-band { background: var(--chip); }
.sk { display: block; background: var(--chip); border-radius: 8px; height: 14px; }
.sk-badge { width: 64px; height: 20px; border-radius: 9999px; }
.sk-line { width: 100%; } .sk-line.short { width: 60%; }
.sk-bubble { height: 52px; border-radius: 16px; margin-top: 4px; }
.sk-btn { height: 40px; width: 104px; border-radius: 16px; }
.sk-price { height: 24px; width: 72px; }

/* ---- Ending states (spec §4.6) ------------------------------------------------
   Soft-yellow cards with a fixed character. Buttons = group 2: solid coral while no
   gift card is on the page, coral outline once one is (body.has-gift-cards). */
.state-card { grid-column: 1 / -1; display: flex; align-items: center; gap: 24px; background: var(--soft-yellow);
          border-radius: 20px; padding: 24px 28px; animation: fade-up 380ms ease-out both; }
.state-char { height: 180px; width: auto; flex-shrink: 0; }
.state-title { color: var(--ink); font-weight: 700; font-size: 22px; line-height: 1.35; margin-bottom: 6px; }
.state-body { color: var(--ink-muted); font-size: 16px; line-height: 1.6; }
.state-hints { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
button.state-chip { background: #fff; border: 1.5px solid var(--border); border-radius: 9999px; padding: 0 14px; min-height: 44px;
          font-size: 14px; font-weight: 600; color: var(--ink); cursor: pointer; }
button.state-chip:hover { background: var(--bubble-a); }
button.btn-state { margin-top: 16px; min-height: 44px; padding: 0 24px; border-radius: 9999px; border: 1.5px solid var(--coral);
          background: var(--coral); color: #fff; font-weight: 600; font-size: 15px; cursor: pointer; }
button.btn-state:hover { background: #A93727; border-color: #A93727; }
body.has-gift-cards button.btn-state { background: #fff; color: var(--coral); }
body.has-gift-cards button.btn-state:hover { background: var(--bubble-b); }
.xp-timeout-box { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; background: var(--soft-yellow);
          border-radius: 20px; padding: 14px 18px; }
/* round head-only avatar, same size and style as the How-it-works avatars */
.xp-timeout-box img { width: 64px; height: 64px; border-radius: 9999px; background: #fff; flex-shrink: 0; }
.xp-timeout-box p { flex: 1; min-width: 180px; color: var(--ink); font-size: 15px; line-height: 1.5; }
.xp-timeout-box button.btn-state { margin-top: 0; }
@media (max-width: 640px) {
    .state-card { flex-direction: column; text-align: center; padding: 20px 18px; gap: 12px; }
    .state-char { height: 150px; }
    .state-title { font-size: 19px; }
    .state-body { font-size: 15px; }
    .state-hints { justify-content: center; }
    .xp-timeout-box button.btn-state { width: 100%; }
    .xp-timeout-box img { width: 56px; height: 56px; }
}

/* ---- Searching state (spec §4.3 Phase 1) --------------------------------------- */
.searching { display: flex; align-items: center; gap: 16px; margin-top: 20px; }
.searching-art { display: flex; align-items: flex-end; gap: 4px; flex-shrink: 0; }
.searching-art img { height: 120px; width: auto; }
.searching-art .searching-cat { height: 72px; }
.searching-line { color: var(--ink); font-weight: 600; font-size: 16px; line-height: 1.5; }
body.has-searched .landing-card { display: none !important; }
@media (max-width: 640px) {
    .searching { gap: 12px; }
    .searching-art img { height: 96px; }
    .searching-art .searching-cat { height: 58px; }
    .searching-line { font-size: 15px; }
}

@media (max-width: 960px) { .gift-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

#gift-more:empty { display: none; }   /* no space when there's no button / end line */
.sk-bubble { display: flex; align-items: center; padding-left: 14px; }
.typing-dots { display: inline-flex; gap: 5px; }
.typing-dots i { width: 7px; height: 7px; border-radius: 9999px; background: var(--ink-subtle); opacity: .35; animation: dot-pulse 1.2s infinite ease-in-out; }
.typing-dots i:nth-child(2) { animation-delay: .2s; } .typing-dots i:nth-child(3) { animation-delay: .4s; }
@keyframes dot-pulse { 0%, 80%, 100% { opacity: .35; } 40% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .typing-dots i { animation: none; opacity: .6; } }

@keyframes fade-up { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

@media (max-width: 640px) {
    .results-title { font-size: 22px; }
    .results-wrap { padding-left: 16px; padding-right: 16px; }
    .gift-grid { grid-template-columns: minmax(0, 1fr); }
    /* phone cards (step 4b): image band on top, full width, 200px tall (gift and XP alike) */
    .gift-card .gift-band { aspect-ratio: auto; height: 200px; }
    .xp-card .xp-photo { aspect-ratio: auto; height: 200px; }
    button.btn-g2.few-cta { margin-left: 54px; }
}

/* Legal pages (/privacy, /terms): header without controls; the two nav links stay visible on phones. */
.site-header--legal .hdr-inner { padding-right: 24px; }
@media (max-width: 640px) {
    .site-header.site-header--legal .hdr-nav { display: flex; gap: 14px; margin-left: auto; }
    .site-header.site-header--legal .hdr-nav a { font-size: 14px; }
    .site-header--legal .hdr-inner { padding-right: 12px; }
}

/* ---- Footer (spec §4.7): plain and quiet ------------------------------------ */
.site-footer { background: var(--ground); border-top: 1px solid var(--border); padding: 28px 0 36px; }
.ftr-inner { max-width: 1200px; margin: 0 auto; padding: 0 24px; display: flex; flex-direction: column; gap: 10px;
             font-size: 13px; color: var(--ink-subtle); }
.ftr-disclaimer { color: var(--ink-muted); display: flex; flex-direction: column; gap: 4px; max-width: 900px; line-height: 1.6; }
.ftr-disclaimer-title { font-weight: 700; color: var(--ink); }
.ftr-links { display: flex; flex-wrap: wrap; gap: 4px 20px; }
.ftr-links a { color: var(--ui-teal); text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; }
.ftr-links a:hover { text-decoration: underline; }
[hidden] { display: none !important; }   /* e.g. the hidden "อ่านต่อ" link on the guide page */
@media (max-width: 640px) { .ftr-inner { padding: 0 16px; } }
/* ---------------------------------------------------------------------------- */



        /* Card shadows per §7 */
        /* F1: the spec's card shadow (§2); a slightly deeper one on hover */
        .card-rest { box-shadow: var(--shadow-card); }
        .card-hover:hover { box-shadow: 0 4px 14px rgba(1, 77, 103, 0.14); }

        /* §5 Thai typesetting: looser line-height than Latin at every level; never letter-spaced.
           (element+attr selector out-specifies Tailwind's leading-* classes, no !important needed) */
        html[lang="th"] h1 { line-height: 1.28; }
        html[lang="th"] h2 { line-height: 1.34; }
        html[lang="th"] h3 { line-height: 1.45; }
        html[lang="th"] p,
        html[lang="th"] li,
        html[lang="th"] label,
        html[lang="th"] .reasoning-note { line-height: 1.85; }
        html[lang="th"] { letter-spacing: normal; }

        /* §5 amended 2026-09 (legibility, real-user-testing finding): the reasoning note
           body text now uses the standard UI sans at Body scale (16/26), same as the rest
           of the site, for both EN and TH -- not Caveat. The card (coral-soft background +
           mint border) is what carries the personal/handwritten feel, not the font. Thai
           still gets the site-wide +2px line-height bump via the html[lang="th"] rule above. */
        .reasoning-note { font-family: 'Inter', 'Noto Sans Thai', system-ui, sans-serif; font-size: 16px; line-height: 26px; }

        /* FIX: Autofill background color & box bleed */
        input:-webkit-autofill,
        input:-webkit-autofill:hover,
        input:-webkit-autofill:focus,
        input:-webkit-autofill:active {
            -webkit-box-shadow: 0 0 0 1000px #ffffff inset !important;
            -webkit-text-fill-color: #1F2937 !important;
            transition: background-color 5000s ease-in-out 0s;
        }
        /* hero search input is the left half of a 16px-radius form */
        #gift-prompt:-webkit-autofill { border-radius: 16px 0 0 16px !important; }

        /* horizontally-scrollable pill rows — no wrap on 375px, no visible scrollbar */
        .no-scrollbar { -webkit-overflow-scrolling: touch; scrollbar-width: none; }
        .no-scrollbar::-webkit-scrollbar { display: none; }

/* ---- Guide pages (/guides/…): article column on the page ground ---------------
   Images are transparent PNG art (WebP), shown straight on --ground: no card. */
.guide { max-width: 760px; margin: 0 auto; padding: 44px 16px 56px; }
.guide-crumbs { font-size: 14px; color: var(--ink-subtle); margin-bottom: 14px; }
.guide-crumbs a { color: var(--ui-teal); text-decoration: none; }
.guide-crumbs a:hover { text-decoration: underline; }
.guide-title { font-size: clamp(26px, 5vw, 36px); line-height: 1.3; font-weight: 800; color: var(--ink); margin: 0 0 18px; }
.guide h2 { font-size: clamp(21px, 3.6vw, 26px); line-height: 1.35; font-weight: 800; color: var(--ui-teal); margin: 44px 0 14px; }
.guide h3 { font-size: 19px; line-height: 1.4; font-weight: 700; color: var(--ink); margin: 28px 0 10px; }
.guide h4 { font-size: 17px; line-height: 1.45; font-weight: 700; color: var(--ui-teal); margin: 22px 0 8px; }
.guide p, .guide li, .guide td, .guide th { font-size: 17px; line-height: 1.8; color: var(--ink-muted); }
.guide p { margin: 0 0 14px; }
.guide strong { color: var(--ink); font-weight: 600; }
.guide-img { display: block; width: 100%; height: auto; margin: 22px 0; }
.guide-summary { background: var(--surface); border-left: 4px solid var(--ui-teal); border-radius: 14px; padding: 16px 20px 4px;
                 box-shadow: var(--shadow-card); margin: 8px 0 6px; }
.guide-list { list-style: disc; padding-left: 22px; margin: 0 0 16px; }
.guide-list li { margin-bottom: 6px; }
.guide-terms { list-style: none; padding: 0; margin: 0 0 16px; }
.guide-terms li { padding: 8px 0; border-bottom: 1px solid var(--border); }
.guide-terms li strong { display: inline-block; min-width: 3.2em; margin-right: 6px; color: var(--ui-teal); }
.guide-lead { font-weight: 600; color: var(--ink) !important; }
.guide-note, .guide-byline { font-size: 14px !important; color: var(--ink-subtle) !important; }
.guide-closing { font-weight: 600; color: var(--ink) !important; margin-top: 24px !important; }
.guide-cta { margin: 28px 0 20px !important; text-align: center; }
.guide-cta a.btn-g1 { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 28px;
                      font-weight: 600; font-size: 16px; text-decoration: none; }
/* "ให้ Givtogo ช่วยหา": small teal link, opens the home page with the box prefilled */
a.guide-ask { display: inline-block; margin-top: 4px; font-size: 14px; font-weight: 600; color: var(--ui-teal);
              text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; }
a.guide-ask::after { content: " →"; }
a.guide-ask:hover { color: var(--coral); }
.guide-person { margin-top: 8px; }
.guide-faq h3 { margin-top: 22px; }

/* Budget table: a real table; on phones each row becomes a stacked block. */
.guide-table { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--surface); border-radius: 14px;
               overflow: hidden; box-shadow: var(--shadow-card); margin: 8px 0 20px; }
.guide-table thead th { background: var(--ui-teal); color: #fff; font-weight: 600; text-align: left; padding: 12px 14px; font-size: 16px; }
.guide-table tbody th, .guide-table tbody td { padding: 12px 14px; vertical-align: top; text-align: left; border-top: 1px solid var(--border); }
.guide-table tbody th { font-weight: 700; color: var(--ink); white-space: nowrap; }
.guide-table td a.guide-ask { display: block; width: max-content; }
@media (max-width: 640px) {
    .guide-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
    .guide-table, .guide-table tbody, .guide-table tr, .guide-table th, .guide-table td { display: block; width: 100%; }
    .guide-table tbody tr { border-top: 1px solid var(--border); padding: 12px 16px; }
    .guide-table tbody tr:first-child { border-top: 0; }
    .guide-table tbody th, .guide-table tbody td { border: 0; padding: 2px 0; }
    .guide-table tbody th { font-size: 18px; color: var(--ui-teal); }
    .guide-table tbody td::before { content: attr(data-label); display: block; font-size: 13px; font-weight: 600; color: var(--ink-subtle); margin-top: 6px; }
}

/* ---- About page (spec §4.8) ------------------------------------------------------
   One language at a time: html[data-lang] (set before first paint from givtogo_lang). */
html[data-lang="en"] .l-th, html:not([data-lang="en"]) .l-en { display: none !important; }
.site-header--about .hdr-lang { margin-left: auto; }
@media (max-width: 640px) {
    /* No menu panel on this page: keep the TH / EN buttons on the bar, white on teal. */
    .site-header.site-header--about .hdr-nav { display: none; }
    .site-header--about .hdr-lang { align-self: auto; border-color: rgba(255, 255, 255, 0.35); }
    .site-header--about .hdr-lang-btn { color: #fff; }
    .site-header--about .hdr-lang-btn[aria-pressed="true"] { background: rgba(255, 255, 255, 0.25); }
}
.about { max-width: 960px; margin: 0 auto; padding: 48px 16px 56px; display: flex; flex-direction: column; gap: 20px; }
.about-hero { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 28px; align-items: center; margin-bottom: 8px; }
.about-duo { width: 200px; height: auto; }
.about-title { font-size: clamp(30px, 5vw, 40px); font-weight: 800; color: var(--ui-teal); line-height: 1.25; margin-bottom: 8px; }
.about-lead { font-size: 19px; font-weight: 700; color: var(--ink); line-height: 1.5; }
.about-card { background: var(--surface); border-radius: 22px; box-shadow: var(--shadow-card); padding: 24px 28px; }
.about-card h2, .about-h2 { font-size: clamp(21px, 3.4vw, 26px); font-weight: 800; color: var(--ui-teal); line-height: 1.35; margin-bottom: 12px; }
.about-card p, .about-intro, .about-closing { font-size: 17px; line-height: 1.8; color: var(--ink-muted); }
.about-card p + p { margin-top: 12px; }
.about-section { margin-top: 12px; }
.about-intro { margin-bottom: 16px; }
.about-promise { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; list-style: none; padding: 0; }
.about-promise .about-card { padding: 24px 22px 20px; box-shadow: inset 0 4px 0 var(--coral), var(--shadow-card); }
.about-promise h3 { font-size: 18px; font-weight: 800; color: var(--ink); line-height: 1.4; margin-bottom: 8px; }
.about-promise p { font-size: 15px; line-height: 1.7; }
.about-steps { grid-template-columns: repeat(3, minmax(0, 1fr)); list-style: none; padding: 0; }
.about-closing { margin-top: 20px; }
.about-tagline { margin-top: 6px; font-family: var(--font-heading); font-size: 20px; font-weight: 800; color: var(--coral); }
@media (max-width: 960px) {
    .about-promise, .about-steps { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
    .about { padding-top: 36px; }
    .about-hero { grid-template-columns: 112px minmax(0, 1fr); gap: 16px; }
    .about-duo { width: 112px; }
    .about-lead { font-size: 17px; }
    .about-card { padding: 20px; }
    .about-steps { grid-template-columns: minmax(0, 1fr); }
}

/* ---- Guide pages, additions for guide 2 and the /guides index (2026-10-13) ---------- */
.guide-img--framed { border-radius: 14px; }                       /* rectangular JPEG art */
.guide-img--portrait { max-width: 440px; margin-left: auto; margin-right: auto; }   /* tall transparent PNG */
.guide-blocks { display: flex; flex-direction: column; gap: 12px; margin: 8px 0 18px; }
.guide-block { background: var(--surface); border-left: 4px solid var(--ui-teal); border-radius: 14px; padding: 14px 18px 2px; box-shadow: var(--shadow-card); }
.guide-steps { list-style: decimal; padding-left: 26px; margin: 4px 0 16px; }
.guide-steps li { font-size: 17px; line-height: 1.8; color: var(--ink-muted); margin-bottom: 8px; padding-left: 4px; }
.guide-steps li::marker { color: var(--ui-teal); font-weight: 800; }
.guide-readmore { margin-top: 28px !important; }
.guide-table--plain tbody th { white-space: normal; min-width: 9em; }
/* /guides index: one card per guide, newest first */
.guide-index { max-width: 960px; margin: 0 auto; padding: 44px 16px 56px; }
.guide-index-title { font-size: clamp(26px, 5vw, 36px); line-height: 1.3; font-weight: 800; color: var(--ink); margin: 0 0 20px; }
.guide-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; list-style: none; padding: 0; margin: 0; }
.guide-card { background: var(--surface); border-radius: 22px; box-shadow: var(--shadow-card); overflow: hidden; }
.guide-card a { display: flex; flex-direction: column; height: 100%; color: inherit; text-decoration: none; }
.guide-card img { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: contain; background: var(--ground); display: block; }   /* whole hero, no crop (heroes differ in shape) */
.guide-card-body { padding: 16px 20px 20px; }
.guide-card h2 { font-size: 19px; font-weight: 800; line-height: 1.4; color: var(--ink); margin: 0 0 6px; }
.guide-card p { font-size: 15px; line-height: 1.7; color: var(--ink-muted); margin: 0; }
.guide-card a:hover h2 { color: var(--ui-teal); text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 640px) { .guide-cards { grid-template-columns: minmax(0, 1fr); } }
/* guide 3: keep the price column ("300–1,000 บาท") on one line on wider screens */
@media (min-width: 641px) { .guide-table--price td:nth-child(2) { white-space: nowrap; } }
/* guide 4 (2026-10-16): a small tip box, and a warm centred closing block */
.guide-tip { background: var(--surface); border-left: 4px solid var(--coral); border-radius: 14px; padding: 14px 18px 4px;
             box-shadow: var(--shadow-card); margin: 18px 0 8px; }
.guide-tip p { font-size: 16px; margin-bottom: 8px; }
.guide .guide-tip-title { font-weight: 700; color: var(--coral); margin-bottom: 6px; }
.guide-outro { text-align: center; background: var(--surface); border-radius: 22px; box-shadow: var(--shadow-card);
               padding: 24px 20px 16px; margin: 22px 0 8px; }
.guide .guide-outro-quote { font-size: 19px; font-weight: 700; color: var(--ink); line-height: 1.6; margin-bottom: 12px; }
.guide .guide-outro-line { font-size: 18px; font-weight: 600; color: var(--ui-teal); margin: 0 0 4px; }

/* ---- Phase 2 step 2a (ADR-0027): picks grid, badge, tag, conversation panel ------------
   Desktop: results left, conversation right (white panel, max 420px). Narrow: the
   conversation stacks above the results (it comes first in the DOM). Phones: once the
   cards arrive the panel folds into the summary bar. Grid: 4 / 3 / 2 columns. */
.results-wrap.results-wide { max-width: 1360px; }
.results-layout { display: flex; flex-direction: row-reverse; align-items: flex-start; gap: 24px; }
.results-main { flex: 1 1 0; min-width: 0; }
.convo { flex: 0 0 360px; max-width: 420px; background: var(--surface); border-radius: 20px; box-shadow: var(--shadow-card);
         padding: 16px 16px 12px; position: sticky; top: 16px;
         max-height: calc(100vh - 32px); overflow-y: auto; }   /* stays in view beside gifts and experiences */
.convo-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.convo-title { color: var(--ui-teal); font-weight: 700; font-size: 17px; line-height: 1.4; }
.convo-cat { height: 56px; width: auto; flex-shrink: 0; margin-top: -6px; }
.convo-stages { display: flex; gap: 6px; margin: 10px 0 12px; overflow: hidden; }
.convo-stage { white-space: nowrap; font-size: 12px; font-weight: 700; border-radius: 9999px; padding: 3px 10px;
               background: var(--chip); color: var(--ink-subtle); }
.convo-stage.is-active { background: var(--bubble-a); color: var(--ui-teal); box-shadow: inset 0 0 0 1.5px var(--ui-teal); }
.convo-stage.is-done { background: var(--ui-teal); color: #fff; }
.convo-msgs { display: flex; flex-direction: column; gap: 10px; }
.convo-msg { display: flex; align-items: flex-end; gap: 8px; }
.convo-msg.is-new { animation: fade-up 260ms ease-out both; }
.convo-msg img { width: 44px; height: 44px; border-radius: 9999px; background: var(--bubble-a); flex-shrink: 0; }
.convo-b { flex-direction: row-reverse; }
.convo-b img { background: var(--bubble-b); }
.convo-body { display: flex; flex-direction: column; gap: 6px; min-width: 0; max-width: calc(100% - 52px); }
.convo-b .convo-body { align-items: flex-end; }
.bubble-b { background: var(--bubble-b); color: var(--ink); border-radius: 16px 16px 4px 16px; padding: 10px 12px;
            font-size: 14px; line-height: 1.55; }
.convo .bubble-a { flex: 0 1 auto; }
.convo-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.convo-b .convo-chips { justify-content: flex-end; }
.convo-chip { background: var(--chip); color: var(--ink); border-radius: 9999px; padding: 3px 10px; font-size: 12px; font-weight: 600; }
.convo-typing { padding: 6px 0 2px 52px; }
.convo.is-gentle .convo-stage.is-done { background: var(--ink-subtle); }
.convo-summary { display: none; }

.gift-grid.pick-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.pick-card .gift-band { aspect-ratio: 1 / 1; }
.pick-body { padding: 14px; }
.pick-title { font-size: 15px; line-height: 1.4; }
.pick-tag { margin-top: 4px; color: var(--ink-muted); font-size: 13px; line-height: 1.4; }
.pick-foot { display: flex; flex-direction: column; align-items: stretch; gap: 8px; margin-top: 12px; }
.pick-foot a.btn-g1 { width: 100%; }
.pick-badge { position: absolute; top: 10px; left: 10px; background: var(--coral); color: #fff; font-weight: 700;
              font-size: 12px; line-height: 1; padding: 6px 10px; border-radius: 9999px; box-shadow: 0 1px 4px rgba(0,0,0,.15); }

@media (max-width: 1100px) {
    .results-layout { flex-direction: column; align-items: stretch; }
    .convo { flex: 0 0 auto; max-width: none; position: static; max-height: none; overflow: visible; }
    .gift-grid.pick-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
    .gift-grid.pick-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
    .pick-card .gift-band { height: auto; }
    .pick-body { padding: 10px; }
    .pick-title { font-size: 14px; }
    .pick-tag { font-size: 12px; }
    .pick-badge { top: 6px; left: 6px; font-size: 11px; padding: 5px 8px; }
    .pick-card .shop-badge { font-size: 11px; padding: 1px 8px; }
    .pick-foot .gift-price { font-size: 17px; }
    .pick-foot a.btn-g1 { padding: 0 10px; font-size: 14px; }
    .convo.is-folded { display: none; }
    .convo-summary:not([hidden]) { display: flex; align-items: center; gap: 10px; min-height: 48px; background: var(--surface);
                                    border-radius: 16px; box-shadow: var(--shadow-card); padding: 6px 12px; margin-bottom: 16px; }
    .convo-sum-avatars { display: flex; flex-shrink: 0; }
    .convo-sum-avatars img { width: 32px; height: 32px; border-radius: 9999px; border: 2px solid #fff; background: var(--bubble-a); }
    .convo-sum-avatars img + img { margin-left: -10px; }
    .convo-sum-text { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink);
                      font-size: 14px; font-weight: 600; }
    .convo-sum-toggle { flex-shrink: 0; min-height: 44px; background: none; border: 0; color: var(--ui-teal); font-weight: 700;
                        font-size: 14px; cursor: pointer; }
}

/* ---- Guide product cards (publish brief, 21 Oct 2026; frontend/guide-products.js) ---------------
   Before the API answers (or if it can't be reached): a plain "label →" link. After: a card. */
.guide-product { margin: 6px 0 22px; }
a.guide-product-fallback { font-weight: 600; color: var(--ui-teal); text-decoration: none; }
a.guide-product-fallback:hover { color: var(--coral); text-decoration: underline; }
a.guide-product-card { display: flex; align-items: center; gap: 14px; background: var(--surface); border: 1px solid var(--border);
                       border-radius: 14px; padding: 12px 14px; text-decoration: none; color: var(--ink); box-shadow: var(--shadow-card);
                       transition: box-shadow .15s; }
a.guide-product-card:hover { box-shadow: 0 4px 16px rgba(1, 77, 103, 0.14); }
a.guide-product-card img { width: 96px; height: 96px; object-fit: contain; background: #F1F6F7; border-radius: 10px; flex-shrink: 0; }
.gpc-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.gpc-shop { align-self: flex-start; border: 1.5px solid var(--border); border-radius: 9999px; padding: 0 8px; font-size: 12px;
            font-weight: 700; color: var(--ink-muted); }
.gpc-title { font-weight: 600; font-size: 15px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
             overflow: hidden; }
.gpc-price { font-family: 'Nunito', sans-serif; font-weight: 800; font-size: 18px; color: var(--coral); }
.gpc-date { font-size: 12px; color: var(--ink-subtle); }
.gpc-btn { flex-shrink: 0; background: var(--coral); color: #fff; font-weight: 600; font-size: 14px; border-radius: 9999px;
           padding: 10px 16px; white-space: nowrap; }
@media (max-width: 640px) {
    a.guide-product-card { flex-wrap: wrap; }
    a.guide-product-card img { width: 80px; height: 80px; }
    .gpc-btn { flex-basis: 100%; text-align: center; }
}
.guide-quote { border-left: 4px solid var(--coral); background: var(--surface); border-radius: 0 14px 14px 0; padding: 12px 18px;
               margin: 10px 0 18px; font-style: italic; }
.guide-quote p { margin: 0 !important; }

/* Home page "คู่มือเลือกของขวัญ" section (publish brief, 21 Oct 2026): the /guides cards, 4 across on desktop. */
.home-guides .how-title a { color: inherit; text-decoration: none; }
.home-guides .how-title a:hover { text-decoration: underline; text-underline-offset: 4px; }
.home-guide-cards { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 16px; }
.guide-card h3 { font-size: 17px; font-weight: 800; line-height: 1.4; color: var(--ink); margin: 0 0 6px; }
.guide-card a:hover h3 { color: var(--ui-teal); text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 1100px) { .home-guide-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .home-guide-cards { grid-template-columns: minmax(0, 1fr); } }

/* Experience cards in the results column (owner, 23 Oct 2026): the gift card's grid cell and square
   image (pick-card), photo cropped to fill; description 2 lines. */
.pick-card.xp-card .xp-photo { aspect-ratio: 1 / 1; height: auto; }
.xp-summary { font-size: 13px; line-height: 1.5; margin-top: 2px; }
@media (max-width: 640px) { .xp-summary { font-size: 12px; } }

/* Floating LINE button (56px, 24px from the bottom): room under the page so the last row of cards and the
   footer scroll clear of it, on every screen size (owner, 23 Oct 2026): 24 + 56 + 16px gap. */
body:has(.line-fab) { padding-bottom: calc(24px + 56px + 16px); }
