/* Trip Wrap-up page CSS (tasteskill): only what sits inside a visual and the kit lacks, one --p-h per card
   group, the app-frame recipe, and the Thai line heights. Shared by index.html (th) and en/index.html (en). */

/* Thai script stacks vowels and tone marks above and below the line: the kit's Latin leadings (1.02 to 1.16)
   clip them, so Thai headings get the room they need */
:lang(th) :is(h1, h2, h3, .t-card, .footer__lede) { line-height: 1.32; letter-spacing: -0.005em; }
:lang(th) .hero h1 { line-height: 1.24; }
:lang(th) .mo-lt__type { line-height: 1.5; letter-spacing: -0.01em; }
:lang(th) body { line-height: 1.7; }

/* one --p-h per card group */
#split .panel { --p-h: 336px; }
@media (max-width: 639px) { #split .panel { --p-h: 140px; } #split .stage { --fade-h: 40px; } #split .section-head > p { display: none; } }
@media (min-width: 1024px) and (max-width: 1279px) { #split .panel { --p-h: 200px; } }
/* a tablet stacks the four cards: each screen's two cards share its height, as the kit does from 1024 */
@media (min-width: 640px) and (max-width: 1023px) {
  #split > .wrap > .grid:last-child, #split .group > .grid:last-child { align-self: stretch; flex: 1 1 auto; min-height: 0; grid-auto-rows: 1fr; }
  #split .panel { --p-h: 180px; }
}

/* the statement (liquid-type): the headline across the wrap, three plain facts under it */
#summary .section-head { max-width: none; }
#summary .mo-lt__type { max-width: none; font-size: clamp(52px, 9.5vw, 140px); font-family: var(--font-display); font-weight: var(--display-weight); }
@media (min-width: 640px) and (max-width: 1023px) { #summary .mo-lt__type { font-size: 16vw; } }
@media (max-width: 639px) { #summary .mo-lt__type { font-size: clamp(44px, 14vw, 84px); } }
.nb { white-space: nowrap; }
#summary .sum-facts h3 { font: 500 var(--t-lead)/1.4 var(--font-text); letter-spacing: 0; margin-bottom: var(--s-2); }
:lang(th) #summary .sum-facts h3 { line-height: 1.5; }

/* the photo pair: two frames at one ratio */
#trip .frame--photo { --ratio: 70%; }
@media (max-width: 1023px) { #trip .frame--photo { --ratio: 42%; } }
@media (max-width: 639px) { #trip .frame--photo { --ratio: 60%; } }

/* the login options in the FAQ: real marks in chips */
.faq .ic-chip-row { margin-top: var(--s-2); }
.faq .ic-chip--lg > .ic { --ic-s: 24px; }
@media (min-width: 1024px) and (max-width: 1279px), (max-width: 639px) { .faq > .faq__more { display: none; } }

/* app-frame (sections-library.md): one window across the wrap, two panes */
.app.ui { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); margin-top: var(--s-7); background: var(--u-bg); border: 1px solid var(--u-border); border-radius: var(--u-r); box-shadow: var(--u-shadow); }
.app > .app__pane { position: relative; min-width: 0; min-height: 0; overflow: hidden; }
.app > .app__pane + .app__pane { border-left: 1px solid var(--u-line); }
.app > .app__pane > .ui-panel { width: 100%; border: 0; border-radius: 0; box-shadow: none; }
.app > .app__pane::after { content: ""; position: absolute; inset: auto 0 0 0; height: 64px; background: linear-gradient(transparent, var(--u-bg)); pointer-events: none; }
@media (min-width: 1024px) and (max-width: 1279px) { .app.ui { grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); } }
@media (max-width: 1023px) {
  .app.ui { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .app > .app__pane--list { max-height: 252px; }
  .app > .app__pane--list::after { display: none; }
  .app > .app__pane + .app__pane { border-left: 0; border-top: 1px solid var(--u-line); }
}
@media (max-width: 639px) {
  .app.ui { grid-template-rows: minmax(0, 1fr); }
  .app > .app__pane--list { display: none; }
  .app > .app__pane + .app__pane { border-top: 0; }
}

/* ---------------------------------------------------------------- the app's own screens, as live HTML (.wp) */
.wp { --fx-bg: #ffffff; --fx-surface: #fff8f6; --fx-ink: #14233a; --fx-muted: #5a6b82; --fx-accent: #ff4f5e; --fx-accent-ink: #ffffff;
  --ui-font: var(--font-text); --ui-radius: 14px; --wp-coral-text: #c8323f; }
.wp-av { flex: none; width: 28px; height: 28px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 12px; font-weight: 500; line-height: 1; color: #fff; background: var(--av, #0b7a70); }
.wp-av--sm { width: 22px; height: 22px; font-size: 11px; }
.av-ma { --av: #0b7a70; } .av-bee { --av: #1b76b5; } .av-lee { --av: #2d6fa3; }
.av-first { --av: #f5b13d; } .av-ton { --av: #ff4f5e; }
.wp-amt { margin-left: auto; font-variant-numeric: tabular-nums; white-space: nowrap; }
.wp-muted { color: var(--u-muted); }
.wp-bar { display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 16px; border-bottom: 1px solid var(--u-line); white-space: nowrap; }
.wp-bar b { font-weight: 500; font-size: 14px; }
.wp-bar .sp { flex: 1; }
.wp-row { display: flex; align-items: center; gap: 10px; min-height: 40px; }
.wp-row + .wp-row, .wp-diff + .wp-row { border-top: 1px solid var(--u-line); }
.wp-row--head { min-height: 46px; font-weight: 500; }
.wp-row--head .wp-amt { font-size: 15px; }
.wp-card { background: var(--u-bg); border: 1px solid var(--u-line); border-radius: 12px; padding: 2px 12px; }
.wp-label { display: block; font-size: 12px; color: var(--u-muted); margin-bottom: 6px; }

/* 1. the trip summary: who sends what to whom (the hero's window) */
.wp-win { background: var(--u-bg); border: 1px solid var(--u-border); border-radius: var(--u-r); box-shadow: var(--u-shadow); overflow: hidden; }
.wp-sum { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; align-items: start; padding: 12px 16px 28px; background: var(--u-surface); }
.wp-diff { margin: 0 0 10px 38px; padding: 8px 10px; border-radius: 8px; background: var(--u-fill); display: grid; gap: 2px; font-size: 12px; line-height: 18px; color: var(--u-text-2); }
.wp-diff > span { display: flex; justify-content: space-between; gap: 12px; font-variant-numeric: tabular-nums; }
.wp-diff > .is-net { color: var(--u-ink); font-weight: 500; }
.wp-diff > .is-net > b { font-weight: 500; color: var(--wp-coral-text); }
@media (max-width: 639px) { .wp-sum { grid-template-columns: minmax(0, 1fr); padding: 10px 10px 24px; } .wp-win .wp-bar { height: 40px; padding: 0 12px; } }

/* 2. the bill form: the receipt total and what it already includes (the app-frame) */
.wp-pane { display: grid; align-content: start; }
.wp-form { display: grid; gap: 16px; padding: 16px; align-content: start; }
.wp-field { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 12px; border: 1px solid var(--u-line-2); border-radius: 10px; }
.wp-total { min-height: 64px; font-size: 28px; line-height: 1; font-weight: 500; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.wp-total > span { color: var(--u-muted); font-weight: 400; }
.wp-group { border: 1px solid var(--u-line); border-radius: 12px; padding: 4px 12px; background: var(--u-surface); }
.wp-group > .wp-row { min-height: 44px; }
.wp-sw { margin-left: auto; flex: none; width: 36px; height: 22px; border-radius: 99px; background: var(--u-fill-3); position: relative; }
.wp-sw::before { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgb(0 0 0 / .25); }
.wp-sw.is-on { background: var(--u-accent); }
.wp-sw.is-on::before { left: 16px; }
.wp-break { display: grid; }
.wp-break > .wp-row { min-height: 38px; }
.wp-break > .wp-row:last-child { font-weight: 500; }
.wp-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.wp-chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px 0 5px; border-radius: 99px; border: 1px solid var(--u-line-2); background: var(--u-bg); white-space: nowrap; }
.wp-chip--add { padding-left: 10px; color: var(--u-muted); border-style: dashed; }
.wp-seg { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: 12px; background: var(--u-fill-2); }
.wp-seg > span { flex: 1 0 auto; text-align: center; padding: 4px 10px; border-radius: 8px; white-space: nowrap; }
.wp-seg > .is-on { background: var(--u-bg); font-weight: 500; box-shadow: 0 1px 2px rgb(20 35 58 / .14); }
.wp-btn { display: flex; align-items: center; justify-content: center; height: 44px; border-radius: 12px; background: var(--u-ink); color: #fff; font-weight: 500; font-size: 14px; }

/* 3. the calculator on an amount field */
.wp-calc { border-radius: 16px; overflow: hidden; border: 1px solid var(--u-border); box-shadow: var(--u-shadow); background: var(--u-bg); }
.wp-calc__field { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 12px 16px; }
.wp-calc__field > b { font-size: 24px; line-height: 32px; font-weight: 500; font-variant-numeric: tabular-nums; }
.wp-keys { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; padding: 12px; background: #1c1c1e; }
.wp-keys > span { display: grid; place-items: center; height: 64px; border-radius: 12px; background: #3a3a3c; color: #fff; font-size: 18px; line-height: 1; font-weight: 500; }
.wp-keys > .is-fn { background: #636366; }
.wp-keys > .is-op { background: #ff9f0a; }

/* 4. by item: who shares each dish, the price per person, the totals on navy */
.wp-items { container-type: inline-size; }
.wp-items__in { display: grid; gap: 12px; }
@container (min-width: 440px) { .wp-items__in { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); align-items: start; } }
.wp-list { background: var(--u-bg); border: 1px solid var(--u-border); border-radius: 14px; box-shadow: var(--u-shadow); padding: 2px 14px; }
.wp-item > .wp-sw { margin-left: 0; justify-self: end; }
.wp-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; padding: 10px 0; }
.wp-item + .wp-item { border-top: 1px solid var(--u-line); }
.wp-item > b { font-weight: 500; }
.wp-item > .wp-amt { font-weight: 500; }
.wp-item__who { display: flex; align-items: center; gap: 4px; }
.wp-item__each { text-align: right; color: var(--u-muted); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.wp-navy { background: #14233a; color: #fff8f6; border-radius: 14px; padding: 6px 14px 8px; box-shadow: var(--u-shadow-sm); }
.wp-navy .wp-row { min-height: 36px; border-top-color: rgb(255 255 255 / .12); }
.wp-navy .wp-row--head { min-height: 40px; }
.wp-navy .wp-muted { color: #b9c3d2; }

/* 5. chip in: one person puts in an amount, the rest is split by everyone */
.wp-chip-in { background: var(--u-bg); border: 1px solid var(--u-border); border-radius: 14px; box-shadow: var(--u-shadow); padding: 2px 14px 6px; }
.wp-tag { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 99px; background: var(--u-tint); color: var(--wp-coral-text); font-size: 12px; font-weight: 500; white-space: nowrap; }

/* 6. people you split with before, and undo after a delete */
.wp-people { display: grid; gap: 12px; }
.wp-people__box { background: var(--u-bg); border: 1px solid var(--u-border); border-radius: 14px; box-shadow: var(--u-shadow); padding: 14px; display: grid; gap: 14px; }
.wp-toast { display: flex; align-items: center; gap: 12px; height: 44px; padding: 0 14px; border-radius: 12px; background: #14233a; color: #fff8f6; box-shadow: var(--u-shadow-sm); }
.wp-toast > b { margin-left: auto; font-weight: 500; color: #ff8a94; }

/* a phone shows the FAQ's answers without the side line, so the section stays one screen */
@media (max-width: 639px) { #faq .span-5 > p { display: none; } }

/* the hero's line in the ink: the client's grey reads 5.2:1, under the 7:1 asked of text people read */
.hero--centred .hero__lead { color: var(--ink); }
/* the name set wide: IBM Plex's tall ascenders need the line the kit's 0.86 does not leave */
.close__word { line-height: 1.16; }
/* Founder review: the wordmark ran into the footer links on wide, short screens.
   Size it by height as well as width so it always fits its row. */
.close__word { font-size: clamp(48px, min(8vw, 13svh), 128px); }
@media (max-width: 639px) { .close__word { font-size: clamp(44px, 15vw, 72px); } }
@media (max-width: 639px) { .hero--centred .pill > .muted { display: none; } }
.wp-ico { flex: none; color: var(--u-muted); }
/* at 320 the bar holds the name and the menu button; the main action is in the hero and the menu's sheet */
@media (max-width: 359px) { .nav:not(.is-open) .nav__actions { display: none; } }
/* a phone drops the bar's right-hand label, so the title keeps its room */
@media (max-width: 639px) { .wp-bar > .sp ~ span { display: none; } }
/* two-up at 1024 the panel is short: the list alone, so the navy totals never sit half in the fade */
@media (min-width: 1024px) and (max-width: 1279px) { .wp-navy { display: none; } }
/* a tablet gives the answers a little more room, so the gap to the close matches the page's others */
@media (min-width: 640px) and (max-width: 1023px) { .faq > .faq__item { padding-block: var(--s-6); } .faq > .faq__item:first-child { padding-top: 0; } }
/* the language switch in the legal row: one row on the left line; a phone sets the two on the footer's two columns */
.footer__lang { display: flex; gap: var(--s-4); }
@media (max-width: 639px) { .footer__lang { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 var(--s-3); } }

/* The app's logo mark in the nav, in place of the kit's initial tile. */
.nav__mark { width: 32px; height: 32px; flex: none; margin-inline-end: 8px; border-radius: 9px; }
/* "Trip Wrap-up" is longer than the old name: on a phone the English bar button uses its short label */
.cta-short { display: none; }
@media (max-width: 419px) { .cta-long { display: none; } .cta-short { display: inline; } }

/* Theme consistency with the app (theme/colors.ts, components/ui/Button.tsx):
   primary  = coral #FF4F5E, white label, hover #E84552
   ghost    = primarySoft #FFE8EA, coral label (the app's usual partner to the primary)
   both     = 44px tall, 14px corners, IBM Plex Sans Thai SemiBold */
.btn { border-radius: 14px; font-weight: 600; }
.btn--primary, .ground-brand .btn--primary { background: #ff4f5e; color: #ffffff; }
.btn--primary:hover, .ground-brand .btn--primary:hover { background: #e84552; }
html:is([data-buttons="pill"], [data-buttons="tonal"]) .btn--secondary,
.btn--secondary { background: #ffe8ea; color: #ff4f5e; border-color: transparent; }
html:is([data-buttons="pill"], [data-buttons="tonal"]) .btn--secondary:hover,
.btn--secondary:hover { background: #ffd9dd; color: #e84552; border-color: transparent; }
