:root {
  --blue-950: #071d61;
  --blue-900: #0a2a86;
  --blue-800: #103fae;
  --blue-700: #1552d4;
  --blue-600: #2c6be5;
  --blue-100: #dceaff;
  --blue-50: #eff6ff;
  --sky: #d9efff;
  --green: #2dbb70;
  --green-dark: #13884c;
  --green-soft: #e0f8ea;
  --red: #dd3345;
  --red-soft: #fff0f2;
  --ink: #12203b;
  --muted: #68758d;
  --line: #dce6f5;
  --white: #ffffff;
  --shadow: 0 22px 60px rgba(28, 74, 153, 0.13);
  --shadow-soft: 0 10px 30px rgba(31, 70, 137, 0.09);
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 18px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    radial-gradient(circle at 15% 8%, rgba(255,255,255,.88) 0, rgba(255,255,255,0) 28%),
    linear-gradient(145deg, #d9f1ff 0%, #eaf4ff 47%, #dfe9ff 100%);
  line-height: 1.5;
  min-height: 100vh;
  padding-bottom: 96px;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.google-sans-app {
  font-family: "Google Sans", "Google Sans Text", "Noto Sans Thai", "Leelawadee UI", Tahoma, system-ui, sans-serif;
  font-optical-sizing: auto;
  font-weight: 400;
  font-style: normal;
  font-variation-settings: "GRAD" 0;
}

button, input { font: inherit; }
button { cursor: pointer; }

.page-glow {
  position: fixed;
  z-index: -1;
  border-radius: 999px;
  filter: blur(10px);
  pointer-events: none;
}

.page-glow--one {
  width: 26rem;
  height: 26rem;
  top: 24rem;
  left: -14rem;
  background: rgba(53, 118, 255, .12);
}

.page-glow--two {
  width: 28rem;
  height: 28rem;
  right: -16rem;
  top: 50rem;
  background: rgba(45, 187, 112, .10);
}

.hero {
  padding: 36px 20px 92px;
  color: white;
  background:
    radial-gradient(circle at 90% 20%, rgba(63, 119, 255, .8), transparent 34%),
    linear-gradient(145deg, #06174f 0%, #092b8c 57%, #1558d8 100%);
  border-radius: 0 0 42px 42px;
  box-shadow: 0 20px 46px rgba(11, 45, 129, .26);
}

.hero__brand,
.hero__content,
.app-shell,
.planner-shell {
  width: min(100%, 1100px);
  margin-inline: auto;
}

.hero__brand { display: flex; align-items: center; gap: 12px; }

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  color: var(--blue-800);
  background: white;
  border-radius: 14px;
  box-shadow: 0 8px 20px rgba(0,0,0,.18);
  font-size: 1.25rem;
}

.eyebrow, .section-kicker {
  margin: 0;
  color: var(--blue-700);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.hero .eyebrow { color: #bcd2ff; }

.hero__content {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-top: 38px;
}

h1, h2, p { overflow-wrap: break-word; }

h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(2rem, 7vw, 4.15rem);
  line-height: 1.08;
  letter-spacing: -.04em;
}

h1 strong { color: #52dc83; white-space: nowrap; }
h1 span { display: block; color: #bed2ff; font-weight: 500; font-size: .42em; letter-spacing: .01em; margin-top: 8px; }
.hero__content > div > p { margin: 18px 0 0; color: #dce8ff; font-size: clamp(1rem, 3vw, 1.28rem); }
.hero-disclaimer { max-width: 650px; display: flex; align-items: flex-start; gap: 9px; margin-top: 18px; padding: 10px 12px; color: #ffe2e6; border: 1px solid rgba(255, 190, 200, .34); border-radius: 13px; background: rgba(91, 8, 31, .22); }
.hero-disclaimer > i { flex: 0 0 auto; margin-top: 2px; color: #ff9aaa; font-size: .85rem; }
.hero-disclaimer p { margin: 0; color: inherit; font-size: .7rem; line-height: 1.55; }
.hero-disclaimer strong { color: white; }

.ratio-badge {
  flex: 0 0 134px;
  width: 134px;
  height: 134px;
  display: grid;
  place-content: center;
  text-align: center;
  border: 2px solid rgba(255,255,255,.8);
  border-radius: 50%;
  background: rgba(5, 23, 80, .45);
  box-shadow: inset 0 0 0 8px rgba(255,255,255,.04), 0 16px 30px rgba(0,0,0,.16);
}

.ratio-badge span, .ratio-badge small { font-size: .72rem; color: #cbdcff; }
.ratio-badge strong { font-size: 1.8rem; line-height: 1.1; color: #52dc83; }

.app-shell,
.planner-shell {
  position: relative;
  margin-top: -54px;
  padding: 0 16px 54px;
}

.planner-card { width: min(100%, 760px); margin-inline: auto; }
.section-icon--planner { background: linear-gradient(145deg, var(--green), var(--green-dark)); box-shadow: 0 9px 20px rgba(19, 136, 76, .22); }
.planner-input-grid { display: grid; gap: 14px; margin: 22px 0; }
.planner-calculate-button { width: 100%; }
.planner-results { margin-top: 22px; padding-top: 22px; border-top: 1px solid var(--line); animation: reveal .35s ease both; }

.wallet-recommendation {
  padding: 22px;
  color: white;
  border-radius: 24px;
  background:
    radial-gradient(circle at 95% 0, rgba(82, 220, 131, .28), transparent 35%),
    linear-gradient(145deg, #071d61, #1044b9);
  box-shadow: 0 16px 34px rgba(10, 42, 134, .2);
}
.wallet-recommendation span, .wallet-recommendation strong, .wallet-recommendation small { display: block; }
.wallet-recommendation span { color: #cbdcff; font-size: .82rem; }
.wallet-recommendation strong { margin: 4px 0; color: #55df89; font-size: clamp(2.1rem, 10vw, 3.3rem); line-height: 1.15; }
.wallet-recommendation small { color: #dce8ff; font-size: .75rem; }

.planner-result-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 24px 0 14px; }
.limit-badge { flex: 0 0 auto; padding: 7px 10px; color: var(--green-dark); border-radius: 999px; background: var(--green-soft); font-size: .72rem; font-weight: 800; }
.planner-stats { display: grid; gap: 9px; margin: 0; }
.planner-stats div { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 13px 14px; border: 1px solid #e0e9f6; border-radius: 15px; background: #f8fbff; }
.planner-stats dt { color: var(--muted); font-size: .78rem; }
.planner-stats dd { margin: 0; color: var(--blue-900); font-size: .9rem; font-weight: 800; text-align: right; }
.planner-stats div:nth-child(2) dd { color: var(--green-dark); }
.next-baht-warning { display: flex; align-items: flex-start; gap: 10px; margin-top: 14px; padding: 13px 14px; color: #7a4c1e; border: 1px solid #f3d5a9; border-radius: 15px; background: #fff8eb; }
.next-baht-warning i { flex: 0 0 auto; margin-top: 2px; color: #d98722; }
.next-baht-warning p { margin: 0; font-size: .77rem; line-height: 1.6; }

.card {
  padding: 24px;
  margin-bottom: 20px;
  border: 1px solid rgba(255,255,255,.85);
  border-radius: var(--radius-xl);
  background: rgba(255,255,255,.94);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.section-heading, .section-topline { display: flex; align-items: center; }
.section-heading { gap: 13px; }
.section-topline { justify-content: space-between; gap: 14px; }

.section-icon {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  color: white;
  font-size: 1.25rem;
  font-weight: 900;
  border-radius: 15px;
  background: linear-gradient(145deg, var(--blue-600), var(--blue-900));
  box-shadow: 0 9px 20px rgba(26, 82, 204, .24);
}

.section-icon--people { font-size: 1.05rem; }

h2 { margin: 2px 0 0; color: var(--blue-950); font-size: clamp(1.25rem, 4vw, 1.7rem); line-height: 1.25; }

.bill-entry { margin: 28px 0 22px; }
.bill-entry > label, .field label { display: block; margin-bottom: 8px; font-size: .88rem; font-weight: 700; color: #43516a; }

.money-input {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-md);
  background: #f8fbff;
  transition: .2s ease;
}

.money-input:focus-within {
  border-color: var(--blue-600);
  background: white;
  box-shadow: 0 0 0 4px rgba(44, 107, 229, .11);
}

.money-input span { color: var(--blue-700); font-weight: 900; }
.money-input small { color: var(--muted); font-weight: 700; }
.money-input input { width: 100%; min-width: 0; border: 0; outline: 0; color: var(--blue-950); background: transparent; font-weight: 800; }
.money-input--large { padding: 9px 16px; }
.money-input--large span { font-size: 1.65rem; }
.money-input--large input { font-size: 2.35rem; }

input[type="number"] { appearance: textfield; }
input::-webkit-inner-spin-button { appearance: none; }

.field-hint { margin: 9px 2px 0; color: var(--muted); font-size: .78rem; }

.action-row { display: grid; grid-template-columns: 1fr; gap: 10px; }

.button {
  min-height: 54px;
  padding: 13px 18px;
  border-radius: 999px;
  font-weight: 800;
  border: 1.5px solid transparent;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}

.button:hover { transform: translateY(-2px); }
.button:active { transform: translateY(0); }
.button--primary { color: white; background: linear-gradient(100deg, var(--blue-900), var(--blue-600)); box-shadow: 0 12px 24px rgba(21, 82, 212, .25); }
.button--outline { color: var(--blue-800); border-color: #bed2f3; background: white; }

.error-message {
  margin: -5px 0 18px;
  padding: 13px 15px;
  color: #a7182a;
  border: 1px solid #ffc7ce;
  border-radius: 14px;
  background: var(--red-soft);
  font-size: .86rem;
  font-weight: 700;
}

.count-pill {
  flex: 0 0 auto;
  padding: 7px 12px;
  color: var(--blue-800);
  border-radius: 999px;
  background: var(--blue-50);
  font-weight: 800;
  font-size: .82rem;
}

.section-intro { margin: 18px 0; padding: 13px 15px; color: #52617a; border-left: 3px solid var(--green); border-radius: 0 14px 14px 0; background: #f3fbf7; font-size: .86rem; }
.people-list { display: grid; gap: 13px; }

.person-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(145deg, #fff, #f7faff);
  box-shadow: var(--shadow-soft);
}

.person-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.person-identity { display: flex; align-items: center; gap: 11px; }
.avatar { width: 42px; height: 42px; display: grid; place-items: center; color: white; border: 3px solid white; border-radius: 50%; background: linear-gradient(145deg, #3f7bf1, #183f9f); box-shadow: 0 5px 14px rgba(28, 72, 172, .24); font-size: 1.2rem; }
.person-identity strong { display: block; color: var(--blue-950); }
.person-identity small { color: var(--muted); font-size: .73rem; }

.remove-button {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  color: var(--red);
  border: 1px solid #ffc8cf;
  border-radius: 13px;
  background: var(--red-soft);
  font-size: 1.15rem;
}

.person-fields { display: grid; gap: 12px; }
.field--name { grid-column: 1 / -1; }
.text-input {
  min-height: 50px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 13px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-md);
  background: #f8fbff;
  transition: .2s ease;
}
.text-input:focus-within { border-color: var(--blue-600); background: white; box-shadow: 0 0 0 4px rgba(44, 107, 229, .11); }
.text-input i { flex: 0 0 auto; color: var(--blue-600); }
.text-input input { width: 100%; min-width: 0; padding: 0; color: var(--blue-950); border: 0; outline: 0; background: transparent; font-size: 1rem; font-weight: 700; }
.money-input--field { padding: 11px 13px; }
.money-input--field input { font-size: 1.05rem; }

.spending-preview { display: flex; justify-content: space-between; gap: 12px; padding-top: 14px; margin-top: 15px; border-top: 1px dashed #ccd9ec; color: var(--muted); font-size: .82rem; }
.spending-preview strong { color: var(--blue-800); font-size: 1rem; }

.add-person-button {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 15px;
  padding: 14px;
  color: var(--blue-800);
  border: 1.5px dashed #91afe5;
  border-radius: var(--radius-md);
  background: var(--blue-50);
}

.add-person-button > i { font-size: 1.35rem; }
.add-person-button strong, .add-person-button small { display: block; text-align: left; }
.add-person-button small { color: var(--muted); font-size: .7rem; }

.results { animation: reveal .45s ease both; }
@keyframes reveal { from { opacity: 0; transform: translateY(14px); } }

.summary-card {
  color: white;
  border-color: rgba(255,255,255,.15);
  background:
    radial-gradient(circle at 95% 0, rgba(55, 112, 255, .7), transparent 36%),
    linear-gradient(145deg, #06184f, #0b2e92 62%, #164fc4);
}

.summary-card h2 { color: white; }
.section-kicker--light { color: #afc9ff; }
.summary-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; }

.discount-ring {
  flex: 0 0 104px;
  height: 104px;
  display: grid;
  place-content: center;
  text-align: center;
  border: 2px solid rgba(255,255,255,.83);
  border-left-color: rgba(255,255,255,.18);
  border-radius: 50%;
  background: rgba(3, 15, 57, .34);
}

.discount-ring strong { font-size: 1.28rem; line-height: 1.1; }
.discount-ring span { color: #bcd0f7; font-size: .66rem; }
.summary-main { display: grid; gap: 10px; margin-top: 24px; }

.summary-highlight { padding: 18px; border-radius: 20px; background: rgba(255,255,255,.1); }
.summary-highlight span, .summary-highlight strong { display: block; }
.summary-highlight span { color: #c7d8fa; font-size: .78rem; }
.summary-highlight strong { margin-top: 4px; font-size: clamp(1.65rem, 8vw, 2.45rem); line-height: 1.2; }
.summary-highlight--green strong { color: #55df89; }
.summary-highlight--blue strong { color: white; }

.summary-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 12px 0 0; }
.summary-meta div { padding: 12px 14px; border-radius: 16px; background: rgba(255,255,255,.08); }
.summary-meta dt { color: #adbee0; font-size: .7rem; }
.summary-meta dd { margin: 2px 0 0; font-weight: 800; }

.result-overview > .card:last-child { margin-bottom: 20px; }

.merchant-card {
  position: relative;
  overflow: hidden;
  border: 1px solid #b9d7ff;
  background: linear-gradient(145deg, rgba(255,255,255,.98), #edf5ff);
}

.merchant-card::after {
  content: "";
  position: absolute;
  right: -55px;
  bottom: -65px;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: rgba(45, 187, 112, .09);
  pointer-events: none;
}

.merchant-card__header { display: flex; align-items: center; gap: 13px; }
.qr-icon { flex: 0 0 44px; width: 44px; height: 44px; display: grid; place-items: center; color: white; border-radius: 14px; background: linear-gradient(145deg, var(--green), var(--green-dark)); box-shadow: 0 9px 20px rgba(19, 136, 76, .2); font-size: 1.45rem; }
.merchant-instruction { margin: 20px 0 14px; color: #34435e; font-size: 1rem; }
.merchant-instruction strong { color: var(--blue-900); font-size: 1.08em; white-space: nowrap; }
.merchant-instruction strong:last-child { color: var(--green-dark); }
.qr-sequence { position: relative; z-index: 1; display: grid; gap: 8px; }
.qr-step { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 13px; border: 1px solid #d9e7f7; border-radius: 14px; background: rgba(255,255,255,.82); }
.qr-step span { min-width: 0; overflow: hidden; color: var(--muted); font-size: .78rem; text-overflow: ellipsis; white-space: nowrap; }
.qr-step strong { color: var(--blue-900); }
.merchant-note { position: relative; z-index: 1; margin: 12px 0 0; color: var(--muted); font-size: .72rem; }

.breakdown-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 32px 5px 15px; }
.breakdown-heading > span { color: var(--muted); font-size: .75rem; }
.breakdown-list { display: grid; gap: 14px; }

.breakdown-card {
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.9);
  border-radius: var(--radius-lg);
  background: rgba(255,255,255,.94);
  box-shadow: var(--shadow-soft);
}

.breakdown-card__header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; color: white; background: linear-gradient(100deg, var(--blue-900), var(--blue-600)); }
.breakdown-card__header > div { display: flex; align-items: center; gap: 10px; }
.breakdown-card__header .avatar { width: 36px; height: 36px; font-size: 1rem; box-shadow: none; background: rgba(255,255,255,.18); }
.breakdown-card__header span { font-size: .74rem; color: #d3e1ff; }
.breakdown-card__header strong { display: block; }
.breakdown-name { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.breakdown-spend { text-align: right; }
.breakdown-spend strong { font-size: 1.1rem; }

.breakdown-card__body { padding: 17px; }
.money-breakdown { display: grid; gap: 9px; margin: 0; }
.money-breakdown div { display: flex; justify-content: space-between; gap: 12px; padding-bottom: 9px; border-bottom: 1px solid #edf1f8; }
.money-breakdown dt { color: var(--muted); font-size: .8rem; }
.money-breakdown dd { margin: 0; color: var(--ink); font-weight: 800; font-size: .84rem; text-align: right; }
.money-breakdown .is-green dd { color: var(--green-dark); }
.money-breakdown .is-blue dd { color: var(--blue-700); }

.rights-comparison { margin-top: 14px; overflow: hidden; border: 1px solid #dce8f7; border-radius: 15px; background: #f7faff; }
.rights-row { display: grid; grid-template-columns: 88px 1fr; align-items: center; gap: 10px; padding: 12px; }
.rights-row + .rights-row { border-top: 1px solid #dce8f7; }
.rights-label { color: #43516a; font-size: .75rem; font-weight: 800; }
.rights-flow { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 7px; }
.rights-flow span { min-width: 0; }
.rights-flow small, .rights-flow strong { display: block; }
.rights-flow small { color: var(--muted); font-size: .62rem; }
.rights-flow strong { color: var(--blue-900); font-size: .76rem; white-space: nowrap; }
.rights-flow span:last-child strong { color: var(--green-dark); }
.rights-flow b { color: var(--blue-600); font-size: 1rem; }

.floating-info-button {
  flex: 0 0 58px;
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  color: white;
  border: 2px solid rgba(255,255,255,.9);
  border-radius: 50%;
  background: linear-gradient(145deg, var(--blue-600), var(--blue-900));
  box-shadow: 0 12px 28px rgba(10, 42, 134, .34);
  font-size: 1.35rem;
  transition: transform .18s ease, box-shadow .18s ease;
}

.floating-info-button:hover { transform: translateY(-2px); box-shadow: 0 16px 32px rgba(10, 42, 134, .4); }
.floating-info-button:active { transform: translateY(0); }

.floating-control-bar {
  position: fixed;
  z-index: 20;
  left: 50%;
  bottom: max(16px, env(safe-area-inset-bottom));
  width: min(calc(100% - 24px), 430px);
  display: flex;
  align-items: center;
  gap: 8px;
  transform: translateX(-50%);
}

.floating-mode-switch {
  flex: 1 1 auto;
  min-width: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  padding: 5px;
  border: 1px solid rgba(255,255,255,.9);
  border-radius: 999px;
  background: rgba(255,255,255,.94);
  box-shadow: 0 14px 36px rgba(6, 34, 108, .27);
  backdrop-filter: blur(16px);
}
.mode-switch-button { min-height: 48px; display: flex; align-items: center; justify-content: center; gap: 7px; padding: 9px 12px; color: var(--muted); border: 0; border-radius: 999px; background: transparent; font-size: .78rem; font-weight: 800; transition: .2s ease; }
.mode-switch-button i { font-size: 1rem; }
.mode-switch-button.is-active { color: white; background: linear-gradient(100deg, var(--blue-900), var(--blue-600)); box-shadow: 0 7px 16px rgba(21, 82, 212, .22); }

.explanation-dialog {
  width: min(calc(100% - 28px), 540px);
  max-height: min(720px, calc(100dvh - 36px));
  padding: 24px;
  color: var(--ink);
  border: 1px solid rgba(255,255,255,.9);
  border-radius: 28px;
  background: rgba(255,255,255,.98);
  box-shadow: 0 30px 80px rgba(5, 27, 89, .3);
  overflow: auto;
}

.explanation-dialog[open] { animation: dialog-reveal .2s ease both; }
.explanation-dialog::backdrop { background: rgba(5, 20, 62, .62); backdrop-filter: blur(5px); }
@keyframes dialog-reveal { from { opacity: 0; transform: translateY(12px) scale(.98); } }

.dialog-header { display: grid; grid-template-columns: 44px 1fr 40px; align-items: center; gap: 12px; }
.dialog-icon { width: 44px; height: 44px; display: grid; place-items: center; color: white; border-radius: 14px; background: linear-gradient(145deg, var(--blue-600), var(--blue-900)); font-size: 1.15rem; }
.dialog-close-button { width: 40px; height: 40px; display: grid; place-items: center; color: var(--red); border: 1px solid #ffc8cf; border-radius: 13px; background: var(--red-soft); }
.explanation-dialog ol { margin: 22px 0 0; padding: 0; list-style: none; counter-reset: steps; }
.explanation-dialog li { position: relative; counter-increment: steps; padding: 0 0 16px 38px; color: #4f5d75; font-size: .9rem; }
.explanation-dialog li:last-child { padding-bottom: 0; }
.explanation-dialog li::before { content: counter(steps); position: absolute; top: -2px; left: 0; width: 26px; height: 26px; display: grid; place-items: center; color: var(--blue-800); border-radius: 8px; background: var(--blue-100); font-size: .72rem; font-weight: 900; }

:focus-visible { outline: 3px solid rgba(44, 107, 229, .4); outline-offset: 3px; }
[hidden] { display: none !important; }

@media (min-width: 600px) {
  .hero { padding-inline: 32px; }
  .app-shell, .planner-shell { padding-inline: 28px; }
  .card { padding: 30px; }
  .action-row { grid-template-columns: minmax(200px, 1fr) 150px; }
  .person-fields { grid-template-columns: 1fr 1fr; }
  .summary-main { grid-template-columns: 1fr 1fr; }
  .qr-sequence { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .planner-input-grid, .planner-stats { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 599px) {
  .hero {
    padding: 26px 16px 76px;
    border-radius: 0 0 34px 34px;
  }

  .hero__brand { gap: 10px; }
  .brand-mark { width: 38px; height: 38px; border-radius: 12px; }
  .hero__content { margin-top: 30px; gap: 14px; }
  .hero__content > div { min-width: 0; }
  .hero__content > div > p { margin-top: 14px; font-size: .95rem; }

  h1 {
    font-size: clamp(1.85rem, 9.5vw, 2.65rem);
    line-height: 1.08;
  }

  .app-shell,
  .planner-shell {
    margin-top: -44px;
    padding: 0 12px 40px;
  }

  .card {
    padding: 21px;
    margin-bottom: 16px;
    border-radius: 27px;
  }

  .section-icon {
    flex-basis: 42px;
    width: 42px;
    height: 42px;
    border-radius: 14px;
  }

  .bill-entry { margin: 24px 0 20px; }
  .money-input--large { min-height: 74px; }
  .button { min-height: 56px; }
  .person-card { padding: 16px; border-radius: 21px; }
  .person-fields { gap: 14px; }
  .money-input--field { min-height: 54px; }
  .add-person-button { min-height: 62px; }
  .summary-card { padding: 22px; }
  .merchant-card { padding: 21px; }
  .summary-highlight { padding: 16px; }
  .breakdown-card__header { padding: 15px 16px; }
  .breakdown-card__body { padding: 16px; }
  body { padding-bottom: max(96px, calc(env(safe-area-inset-bottom) + 84px)); }
}

@media (min-width: 880px) {
  .hero { padding-top: 44px; padding-bottom: 112px; border-radius: 0 0 62px 62px; }
  .app-shell { display: grid; grid-template-columns: minmax(0, .88fr) minmax(0, 1.12fr); align-items: start; gap: 22px; margin-top: -66px; }
  .planner-shell { margin-top: -66px; }
  .app-shell > * { margin-bottom: 0; }
  .bill-card { position: sticky; top: 18px; }
  .people-section { grid-column: 2; }
  .results { grid-column: 1 / -1; display: grid; grid-template-columns: .88fr 1.12fr; gap: 22px; align-items: start; }
  .result-overview { position: sticky; top: 18px; }
  .breakdown-heading { margin-top: 5px; }
  .breakdown-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 440px) {
  .hero__content { align-items: center; }
  .ratio-badge { flex-basis: 100px; width: 100px; height: 100px; }
  .ratio-badge strong { font-size: 1.35rem; }
  .ratio-badge span, .ratio-badge small { font-size: .6rem; }
  .card { border-radius: 26px; }
  .section-topline { align-items: flex-start; }
  .rights-row { grid-template-columns: 78px 1fr; padding-inline: 10px; }
}

@media (max-width: 350px) {
  .hero__content { align-items: flex-start; }
  .ratio-badge { flex-basis: 84px; width: 84px; height: 84px; }
  .ratio-badge strong { font-size: 1.15rem; }
  .ratio-badge span, .ratio-badge small { font-size: .53rem; }
  .card { padding: 18px; }
  .section-heading { gap: 10px; }
  .count-pill { padding-inline: 9px; }
  .summary-header { gap: 10px; }
  .discount-ring { flex-basis: 88px; height: 88px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}
