:root {
  --ink: #14251f;
  --muted: #64736d;
  --paper: #f6faf7;
  --white: #ffffff;
  --mint: #b9f6d2;
  --mint-strong: #25a967;
  --mint-dark: #087343;
  --line: #dce8e1;
  --danger: #b42318;
  --display: "Chakra Petch", sans-serif;
  --body: "Noto Sans Thai", sans-serif;
  --radius: 18px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 15% 5%, rgba(185, 246, 210, .5), transparent 28rem),
    linear-gradient(180deg, #f8fcf9 0%, #eef7f1 65%, #f9fcfa 100%);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.6;
}
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
svg { width: 1.25rem; height: 1.25rem; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
[hidden] { display: none !important; }

.site-header { position: absolute; z-index: 20; top: 0; width: 100%; }
.nav-shell, .footer-shell, .content-section, .faq-section, .features-section, .use-cases-section { width: min(1120px, calc(100% - 2rem)); margin-inline: auto; }
.nav-shell { display: flex; align-items: center; justify-content: space-between; padding-block: 1.1rem; }
.nav-actions { display: flex; align-items: center; gap: .85rem; }
.nav-brand, .footer-brand {
  display: inline-flex; align-items: center; gap: .6rem; color: var(--ink);
  font: 700 1.2rem var(--display); text-decoration: none; letter-spacing: -.03em;
}
.brand-logo, .footer-logo {
  display: block;
  flex: 0 0 auto;
  object-fit: contain;
}
.brand-logo { width: 2.5rem; height: 2.5rem; }
.footer-logo { width: 1.75rem; height: 1.75rem; }
.nav-link { color: var(--ink); font-size: .9rem; font-weight: 600; text-decoration: none; }
.nav-link:hover { color: var(--mint-dark); }

.hero-section { position: relative; min-height: 100vh; overflow: hidden; padding: 7rem 1rem 5rem; }
.hero-atmosphere {
  position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(rgba(8, 115, 67, .045) 1px, transparent 1px), linear-gradient(90deg, rgba(8, 115, 67, .045) 1px, transparent 1px);
  background-size: 34px 34px; mask-image: linear-gradient(to bottom, #000 35%, transparent 90%);
}
.hero-copy { position: relative; width: min(760px, 100%); margin: 0 auto 2.6rem; text-align: center; animation: fade-down .65s ease-out both; }
.hero-brand { margin: 0 0 .65rem; color: var(--mint-dark); font: 700 clamp(1.65rem, 5vw, 2.5rem) var(--display); letter-spacing: -.04em; }
.hero-copy h1 { margin: 0; font: 700 clamp(1.85rem, 5.5vw, 3.6rem)/1.08 var(--display); letter-spacing: -.045em; max-width: 18ch; }
.hero-lead { max-width: 620px; margin: 1.3rem auto 0; color: var(--muted); font-size: clamp(1rem, 2vw, 1.18rem); }

.tool-surface {
  position: relative; width: min(820px, 100%); margin-inline: auto; padding: clamp(1.15rem, 4vw, 2.25rem);
  border: 1px solid rgba(20, 37, 31, .11); border-radius: 26px; background: rgba(255, 255, 255, .92);
  box-shadow: 0 24px 70px rgba(24, 72, 49, .11); backdrop-filter: blur(12px);
  animation: surface-up .75s .1s ease-out both;
}
.tool-header, .section-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.tool-header h2, .section-heading h2, .result-section h2 { margin: 0; font: 700 clamp(1.25rem, 3vw, 1.65rem) var(--display); }
.step-label, .section-kicker { margin: 0 0 .18rem; color: var(--mint-dark); font-size: .72rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; }
.privacy-note { display: inline-flex; align-items: center; gap: .35rem; color: var(--mint-dark); font-size: .78rem; font-weight: 600; }
.privacy-note svg { width: 1rem; }

.scan-status {
  margin-top: .95rem;
  min-height: 0;
}
.scan-progress {
  display: grid;
  gap: .45rem;
}
.scan-progress__track {
  position: relative;
  overflow: hidden;
  height: .42rem;
  border-radius: 999px;
  background: #ddf3e6;
}
.scan-progress__bar {
  position: absolute;
  inset: 0 auto 0 0;
  width: 38%;
  border-radius: inherit;
  background: linear-gradient(90deg, #7ee2ad 0%, #25a967 45%, #b9f6d2 100%);
  box-shadow: 0 0 12px rgba(37, 169, 103, .35);
  animation: scan-slide 1.15s ease-in-out infinite;
}
.scan-progress__label {
  margin: 0;
  color: var(--mint-dark);
  font-size: .78rem;
  font-weight: 600;
}
.scan-status__message {
  margin: 0;
  padding: .7rem .85rem;
  border-radius: 12px;
  color: var(--mint-dark);
  background: #eaf8ef;
  font-size: .82rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.scan-status__message.is-error {
  color: var(--danger);
  background: #fff0ee;
  border: 1px solid #f0cfc9;
}
.error-contact-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: .55rem;
  min-height: 2.35rem;
  padding: .45rem .85rem;
  border: 1px solid #d7c2be;
  border-radius: 10px;
  color: var(--danger);
  background: #fff;
  font-size: .8rem;
  font-weight: 700;
  text-decoration: none;
}
.error-contact-link:hover {
  border-color: #c9a9a3;
  background: #fff7f5;
}
.error-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .7rem;
  margin-top: 1.4rem;
}
.contact-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  align-items: center;
  margin-top: 1.6rem;
  padding: 1.2rem 1.25rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, .86);
}
.contact-card__label {
  margin: 0 0 .2rem;
  color: var(--mint-dark);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.contact-card__email {
  color: var(--ink);
  font: 700 1.2rem var(--display);
  text-decoration: none;
}
.contact-card__email:hover { color: var(--mint-dark); }
.contact-card__hint {
  margin: .45rem 0 0;
  font-size: .84rem;
}
.contact-card__cta { white-space: nowrap; }

.upload-zone {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: .9rem; margin-top: 1.05rem; padding: 1rem;
  border: 1.5px dashed #85b99e; border-radius: var(--radius); background: #f2fbf5; cursor: pointer;
  transition: border-color .2s, background .2s, transform .2s;
}
.upload-zone:hover, .upload-zone.is-dragging { border-color: var(--mint-strong); background: #e8f9ee; transform: translateY(-2px); }
.upload-icon { display: grid; width: 2.7rem; height: 2.7rem; place-items: center; border-radius: 12px; color: var(--mint-dark); background: var(--mint); }
.upload-zone strong, .upload-zone small { display: block; }
.upload-zone strong { font-size: .95rem; }
.upload-zone small { color: var(--muted); font-size: .72rem; }
.upload-action { color: var(--mint-dark); font-size: .8rem; font-weight: 700; }
.turnstile-wrap {
  display: flex;
  justify-content: center;
  margin-top: 1rem;
  min-height: 65px;
}
.spinner { width: 1rem; height: 1rem; border: 2px solid #a9dbc0; border-top-color: var(--mint-dark); border-radius: 50%; animation: spin .75s linear infinite; }
.manual-divider { display: flex; align-items: center; gap: .8rem; margin: 1.7rem 0; color: #89958f; font-size: .75rem; }
.manual-divider::before, .manual-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.btn-primary, .btn-secondary, .btn-link, .icon-button {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem; border: 0; cursor: pointer;
  transition: transform .18s, background .18s, opacity .18s;
}
.btn-primary { min-height: 3rem; padding: .7rem 1.1rem; border-radius: 12px; color: #fff; background: var(--ink); font-weight: 700; }
.btn-primary:hover:not(:disabled) { background: var(--mint-dark); transform: translateY(-1px); }
.btn-secondary { padding: .55rem .75rem; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); background: #fff; font-size: .82rem; font-weight: 700; }
.btn-secondary:hover { border-color: #a9c6b6; background: #f6faf7; }
.btn-link { min-height: 3rem; padding: .65rem .9rem; color: var(--mint-dark); background: transparent; font-weight: 700; }
button:disabled { cursor: not-allowed; opacity: .38; }
.icon-button { width: 2.5rem; height: 2.5rem; border-radius: 10px; color: #829088; background: transparent; }
.icon-button:hover { color: var(--danger); background: #fff2f0; }

.people-list { margin-top: 1rem; }
.drag-help {
  display: flex;
  align-items: center;
  gap: .4rem;
  margin: .7rem 0 0;
  color: var(--muted);
  font-size: .75rem;
}
.drag-help svg { width: 1rem; height: 1rem; }
.person-card {
  margin-top: 1rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fbfdfb;
  animation: row-in .25s ease-out both;
  transition: border-color .18s, background .18s, box-shadow .18s;
}
.person-card.is-drop-target {
  border-color: var(--mint-strong);
  background: #effbf3;
  box-shadow: 0 0 0 3px rgba(37, 169, 103, .12);
}
.owner-header {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: .6rem;
  padding-bottom: .8rem;
  border-bottom: 1px solid var(--line);
}
.item-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1.5fr) minmax(7rem, .65fr) minmax(7rem, .65fr) auto;
  align-items: end;
  gap: .55rem;
  padding-top: .75rem;
}
.item-row.is-dragging {
  opacity: .35;
}
.drag-handle {
  display: grid;
  width: 2rem;
  height: 2.75rem;
  place-items: center;
  padding: 0;
  border: 0;
  color: #809088;
  background: transparent;
  cursor: grab;
  touch-action: none;
}
.drag-handle:active { cursor: grabbing; }
.drag-handle svg { width: 1.1rem; height: 1.1rem; stroke-width: 3; }
.drag-ghost {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1000;
  width: min(22rem, 78vw);
  padding: .65rem .8rem;
  border: 1px solid var(--mint-strong);
  border-radius: 12px;
  color: var(--ink);
  background: #fff;
  box-shadow: 0 14px 36px rgba(20, 37, 31, .2);
  pointer-events: none;
  font-size: .82rem;
  font-weight: 700;
  will-change: transform;
}
.add-item {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  margin-top: .75rem;
  padding: .3rem 0;
  border: 0;
  color: var(--mint-dark);
  background: transparent;
  cursor: pointer;
  font-size: .78rem;
  font-weight: 700;
}
.add-item svg { width: 1rem; height: 1rem; }
.person-row { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr) auto; align-items: end; gap: .65rem; padding: .75rem 0; border-bottom: 1px solid var(--line); animation: row-in .25s ease-out both; }
label > span:first-child, .choice-group legend { display: block; margin-bottom: .3rem; color: #52615a; font-size: .76rem; font-weight: 600; }
.input-field { width: 100%; height: 2.75rem; padding: .58rem .75rem; border: 1px solid #ccdcd3; border-radius: 10px; outline: 0; color: var(--ink); background: #fff; transition: border-color .18s, box-shadow .18s; }
.input-field:focus { border-color: var(--mint-strong); box-shadow: 0 0 0 3px rgba(37, 169, 103, .13); }
.money-input { position: relative; display: block; }
.money-input .input-field { padding-right: 2rem; }
.money-input b { position: absolute; right: .75rem; top: 50%; color: #85948c; transform: translateY(-50%); }
.amount-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; margin-top: 1.35rem; }
.choice-group { display: flex; align-items: center; gap: .5rem; margin: 1.1rem 0 0; padding: 0; border: 0; }
.choice-group legend { float: left; width: 9rem; margin: 0 auto 0 0; }
.choice-group label { cursor: pointer; }
.choice-group input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.choice-group label span { display: block; margin: 0; padding: .45rem .7rem; border: 1px solid var(--line); border-radius: 9px; color: var(--muted); font-size: .75rem; font-weight: 600; transition: .18s; }
.choice-group input:checked + span { border-color: var(--mint-strong); color: var(--mint-dark); background: #e9f9ef; }
.account-field { display: block; margin-top: 1.25rem; }
.account-field small { color: #8a978f; font-weight: 400; }

.result-section { margin-top: 2rem; padding-top: 1.6rem; border-top: 2px solid var(--ink); }
.grand-total { font: 700 clamp(1.65rem, 5vw, 2.25rem) var(--display); }
.empty-result { margin-top: 1rem; padding: 1.2rem; border-radius: 12px; color: var(--muted); background: #f5f8f6; text-align: center; font-size: .85rem; }
.result-list { margin-top: 1rem; }
.result-item { display: grid; grid-template-columns: 1fr auto; gap: .3rem 1rem; padding: .8rem 0; border-bottom: 1px solid var(--line); }
.result-item strong { font-size: .92rem; }
.result-item b { font: 700 1rem var(--display); }
.result-item small { color: var(--muted); font-size: .72rem; }
.result-actions { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; margin-top: 1.2rem; }
.result-share-image { grid-column: 1 / -1; min-height: 3rem; }
.share-feedback { margin-top: .75rem; padding: .65rem .8rem; border-radius: 9px; color: var(--mint-dark); background: #eaf8ef; font-size: .78rem; overflow-wrap: anywhere; }
.share-feedback.is-error { color: var(--danger); background: #fff0ee; }
#share-contact-link { margin-top: .55rem; }

.content-section, .faq-section, .features-section, .use-cases-section { padding-block: clamp(4.5rem, 10vw, 8rem); }
.content-section h2, .faq-section h2, .features-section h2, .use-cases-section h2 { max-width: 760px; margin: .25rem 0 1rem; font: 700 clamp(2rem, 5vw, 3.8rem)/1.05 var(--display); letter-spacing: -.045em; }
.content-lead { max-width: 680px; color: var(--muted); font-size: 1.05rem; }
.formula { margin: 2.4rem 0; padding: 1.2rem 1.4rem; border-left: 4px solid var(--mint-strong); color: #0c663d; background: rgba(185, 246, 210, .34); font: 600 clamp(.95rem, 2vw, 1.15rem) var(--display); }
.how-list { margin: 0; padding: 0; list-style: none; }
.how-list li { display: grid; grid-template-columns: 3rem 1fr; gap: 1rem; max-width: 740px; padding: 1.25rem 0; border-bottom: 1px solid #cadad1; }
.how-list li > span { color: var(--mint-dark); font: 700 1rem var(--display); }
.how-list h3 { margin: 0; font: 700 1.15rem var(--display); }
.how-list p { margin: .25rem 0 0; color: var(--muted); }
.feature-list { margin: 2.2rem 0 0; padding: 0; list-style: none; display: grid; gap: 1.1rem; max-width: 820px; }
.feature-list li { display: grid; grid-template-columns: 2.75rem 1fr; gap: 1rem; padding: 1.15rem 0; border-bottom: 1px solid #cadad1; }
.feature-list__icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2.75rem; height: 2.75rem; border-radius: 12px;
  color: var(--mint-dark); background: rgba(185, 246, 210, .45);
}
.feature-list__icon svg { width: 1.35rem; height: 1.35rem; }
.feature-list h3 { margin: 0; font: 700 1.15rem var(--display); }
.feature-list p { margin: .3rem 0 0; color: var(--muted); }
.use-cases-section { padding-top: 1rem; padding-bottom: clamp(3rem, 7vw, 5rem); }
.use-cases-lead {
  max-width: 820px; margin: 0; padding: 1.15rem 1.35rem;
  border-left: 4px solid var(--mint-strong);
  color: var(--ink); background: rgba(185, 246, 210, .28);
  font: 600 clamp(1rem, 2.2vw, 1.25rem)/1.45 var(--display);
}
.faq-section { padding-top: 1rem; }
.faq-section details { max-width: 800px; border-bottom: 1px solid #cadad1; }
.faq-section summary { padding: 1.2rem 2rem 1.2rem 0; cursor: pointer; font-weight: 700; }
.faq-section details p { margin: -.4rem 0 1.2rem; color: var(--muted); }

.legal-page, .share-page { width: min(820px, calc(100% - 2rem)); min-height: 70vh; margin-inline: auto; padding: 8rem 0 5rem; }
.legal-page h1, .share-page h1 { margin: 0 0 1rem; font: 700 clamp(2.4rem, 6vw, 4.5rem)/1 var(--display); letter-spacing: -.05em; }
.legal-page h2 { margin-top: 2rem; font: 700 1.3rem var(--display); }
.legal-page p, .legal-page li { color: var(--muted); }
.share-summary { margin-top: 2rem; border-top: 2px solid var(--ink); }
.share-items { margin: 0 0 .8rem; padding: 0 0 .7rem 1rem; border-bottom: 1px solid var(--line); list-style: none; }
.share-items li { display: flex; justify-content: space-between; gap: 1rem; padding: .25rem 0; color: var(--muted); font-size: .78rem; }
.share-items li small { display: block; color: var(--mint-dark); }
.share-items li b { color: var(--ink); font-weight: 600; white-space: nowrap; }
.share-meta { color: var(--muted); }
.not-found { text-align: center; }

.lang-switch { display: inline-flex; align-items: center; gap: .4rem; }
.lang-switch__btn {
  display: inline-flex;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 50%;
  overflow: hidden;
  opacity: .55;
  transition: opacity .2s ease, border-color .2s ease, transform .2s ease;
}
.lang-switch__btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}
.lang-switch__btn.is-active {
  opacity: 1;
  border-color: var(--ink);
  transform: scale(1.05);
}
.lang-switch__btn:hover { opacity: 1; }

.upload-badge {
  margin: .55rem 0 0;
  color: var(--mint-dark);
  font-size: .78rem;
  font-weight: 600;
}
.upload-zone.is-disabled {
  opacity: .55;
  pointer-events: none;
}
.formula-principle {
  max-width: 42rem;
  margin: 0 0 .85rem;
  color: var(--ink);
  font-size: .95rem;
  font-weight: 600;
}

.promptpay-qr {
  margin: 1.75rem 0 1.5rem;
  padding: 1.1rem 0 0;
  border-top: 1px solid var(--line);
}
.promptpay-qr .section-heading { align-items: flex-start; }
.qr-amount { color: var(--mint-dark); font-size: 1rem; }
.qr-amount-chips {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin: 1rem 0;
}
.qr-chip {
  display: inline-flex;
  flex-direction: column;
  gap: .15rem;
  min-width: 7rem;
  padding: .55rem .75rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}
.qr-chip small { color: var(--muted); font-size: .75rem; }
.qr-chip.is-active {
  border-color: var(--mint-dark);
  background: #eaf8ef;
}
.qr-frame {
  display: grid;
  place-items: center;
  width: fit-content;
  max-width: 100%;
  margin: 1.25rem auto 0;
  padding: .45rem;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 14px 36px rgba(20, 37, 31, .08);
  cursor: pointer;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.qr-frame:hover {
  border-color: var(--mint-strong);
  box-shadow: 0 16px 40px rgba(20, 37, 31, .12);
  transform: translateY(-2px);
}
.qr-svg {
  display: grid;
  width: 232px;
  max-width: 70vw;
  aspect-ratio: 1;
  place-items: center;
  overflow: hidden;
}
.qr-svg svg {
  display: block;
  width: 100% !important;
  height: 100% !important;
}
.qr-svg[hidden] { display: none !important; }
.qr-download-hint {
  margin: .55rem 0 0;
  color: var(--muted);
  font-size: .72rem;
  text-align: center;
}

.share-page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .65rem;
  margin-top: 1rem;
}
.share-page-actions .btn-secondary { min-height: 3rem; }

.recent-links {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}
.recent-links h3 {
  margin: 0;
  font: 700 1rem var(--display);
}
.recent-links > div > p {
  margin: .2rem 0 .75rem;
  color: var(--muted);
  font-size: .75rem;
}
.recent-links__list {
  display: grid;
  gap: .5rem;
}
.recent-link {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: .75rem;
  padding: .65rem .75rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255,255,255,.72);
}
.recent-link a {
  overflow: hidden;
  color: var(--mint-dark);
  font-size: .78rem;
  font-weight: 600;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.recent-link a:hover { text-decoration: underline; }
.recent-link span {
  color: var(--muted);
  font-size: .72rem;
  white-space: nowrap;
}

.site-footer { padding: 2.5rem 0; border-top: 1px solid #cadad1; background: rgba(255,255,255,.45); }
.footer-shell { display: grid; grid-template-columns: 1fr auto; gap: 1rem; align-items: center; }
.footer-shell nav { display: flex; gap: 1rem; }
.footer-shell nav a { color: var(--muted); font-size: .78rem; text-decoration: none; }
.footer-shell p { grid-column: 1 / -1; margin: 0; color: #839088; font-size: .72rem; }
.footer-meta { letter-spacing: .01em; }

body.cookie-consent-open {
  overflow: hidden;
  touch-action: none;
}
.cookie-consent {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  align-items: end;
  justify-items: center;
  padding: 1rem 1rem calc(1rem + env(safe-area-inset-bottom, 0px));
  background:
    linear-gradient(180deg, rgba(246, 250, 247, .18) 0%, rgba(20, 37, 31, .22) 55%, rgba(20, 37, 31, .34) 100%);
  backdrop-filter: blur(1.5px);
}
.cookie-consent__panel {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: .85rem 1rem;
  align-items: center;
  width: min(720px, 100%);
  padding: 1.15rem 2.75rem 1.15rem 1.2rem;
  border: 1px solid #c7ddd1;
  border-radius: 18px;
  background: rgba(255, 255, 255, .97);
  box-shadow: 0 18px 48px rgba(20, 37, 31, .22);
  animation: cookie-up .28s ease;
}
.cookie-consent__icon {
  display: grid;
  width: 2.4rem;
  height: 2.4rem;
  place-items: center;
  border-radius: 12px;
  color: var(--mint-dark);
  background: #e8f8ef;
}
.cookie-consent__icon svg { width: 1.2rem; height: 1.2rem; }
.cookie-consent__copy { min-width: 0; padding-right: .4rem; }
.cookie-consent__copy h2 {
  margin: 0 0 .25rem;
  font: 700 1rem var(--display);
  letter-spacing: -.02em;
}
.cookie-consent__copy p {
  margin: 0;
  color: var(--muted);
  font-size: .82rem;
  line-height: 1.45;
}
.cookie-consent__copy a {
  color: var(--mint-dark);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.cookie-consent__accept {
  min-height: 2.7rem;
  padding: .55rem 1rem;
  border: 0;
  border-radius: 12px;
  color: #fff;
  background: var(--ink);
  font-size: .84rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.cookie-consent__accept:hover { background: var(--mint-dark); }
.cookie-consent__close {
  position: absolute;
  top: .55rem;
  right: .55rem;
  display: grid;
  width: 2rem;
  height: 2rem;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}
.cookie-consent__close svg { width: 1.05rem; height: 1.05rem; }
.cookie-consent__close:hover {
  color: var(--ink);
  border-color: var(--line);
  background: #f4faf6;
}

@keyframes fade-down { from { opacity: 0; transform: translateY(-14px); } to { opacity: 1; transform: none; } }
@keyframes surface-up { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }
@keyframes row-in { from { opacity: 0; transform: translateX(-8px); } to { opacity: 1; transform: none; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes cookie-up { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes scan-slide {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(320%); }
}

@media (max-width: 640px) {
  .hero-section { padding-inline: .75rem; }
  .tool-surface { border-radius: 20px; }
  .upload-zone { grid-template-columns: auto 1fr; }
  .upload-action { display: none; }
  .person-row { grid-template-columns: minmax(0, 1fr) 7rem auto; gap: .4rem; }
  .item-row { grid-template-columns: auto minmax(0, 1fr) minmax(0, 1fr) auto; gap: .25rem; }
  .item-row .drag-handle { grid-row: 1 / 3; align-self: center; }
  .item-row > label:nth-of-type(1) { grid-column: 2 / 4; }
  .item-row > label:nth-of-type(2) { grid-column: 2; }
  .item-row > label:nth-of-type(3) { grid-column: 3; }
  .item-row .remove-item { grid-column: 4; grid-row: 1; }
  .amount-grid { grid-template-columns: 1fr; }
  .choice-group { align-items: flex-start; flex-wrap: wrap; }
  .choice-group legend { width: 100%; margin-bottom: .2rem; }
  .result-actions { grid-template-columns: 1fr; }
  .footer-shell { grid-template-columns: 1fr; }
  .footer-shell nav { flex-wrap: wrap; }
  .cookie-consent {
    align-items: end;
    padding: .65rem .65rem calc(.65rem + env(safe-area-inset-bottom, 0px));
  }
  .cookie-consent__panel {
    grid-template-columns: 1fr;
    gap: .75rem;
    width: 100%;
    padding: 1rem 1rem .9rem;
    border-radius: 16px 16px 14px 14px;
  }
  .cookie-consent__icon { display: none; }
  .cookie-consent__copy { padding-right: 1.6rem; }
  .cookie-consent__accept { width: 100%; min-height: 2.9rem; }
  .contact-card {
    grid-template-columns: 1fr;
  }
  .contact-card__cta { width: 100%; }
  .error-actions .btn-primary,
  .error-actions .btn-secondary { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
