@font-face {
  font-family: "LINE Seed Sans TH";
  src: url("assets/fonts/LINESeedSansTH_A_Th.ttf") format("truetype");
  font-style: normal;
  font-weight: 200;
  font-display: swap;
}

@font-face {
  font-family: "LINE Seed Sans TH";
  src: url("assets/fonts/LINESeedSansTH_A_Rg.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "LINE Seed Sans TH";
  src: url("assets/fonts/LINESeedSansTH_A_Bd.ttf") format("truetype");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: "LINE Seed Sans TH";
  src: url("assets/fonts/LINESeedSansTH_A_XBd.ttf") format("truetype");
  font-style: normal;
  font-weight: 800;
  font-display: swap;
}

@font-face {
  font-family: "LINE Seed Sans TH";
  src: url("assets/fonts/LINESeedSansTH_A_He.ttf") format("truetype");
  font-style: normal;
  font-weight: 900;
  font-display: swap;
}

:root {
  color-scheme: light;
  --ink: #17312b;
  --muted: #66736f;
  --deep: #123c34;
  --teal: #1d6d5f;
  --mint: #d9eee5;
  --lime: #d9ef9b;
  --cream: #f5f1e8;
  --paper: #fffdf7;
  --coral: #ed7e62;
  --gold: #dfa938;
  --danger: #a13d32;
  --border: rgba(23, 49, 43, 0.12);
  --shadow: 0 20px 50px rgba(18, 60, 52, 0.12);
  --radius-xl: 30px;
  --radius-lg: 22px;
  --radius-md: 16px;
  font-family: "LINE Seed Sans TH", "Leelawadee UI", Tahoma, system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--cream); color: var(--ink); min-width: 320px; overflow-x: hidden; overflow-x: clip; font-weight: 400; font-synthesis: none; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid var(--coral); outline-offset: 3px; }
.skip-link { position: fixed; left: 12px; top: -60px; background: var(--ink); color: white; padding: 10px 14px; z-index: 100; border-radius: 10px; }
.skip-link:focus { top: 12px; }

.app-shell { min-height: 100svh; }
.side-rail { display: none; }
main { max-width: 780px; margin: 0 auto; padding: 0 18px 112px; }
.mobile-header { min-height: 82px; display: flex; align-items: center; justify-content: space-between; }
.brand { color: var(--ink); display: inline-flex; align-items: center; gap: 11px; text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 14px; background: var(--deep); color: var(--lime); font-weight: 900; letter-spacing: -0.04em; box-shadow: 0 8px 20px rgba(18,60,52,.2); }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 1rem; letter-spacing: -0.02em; }
.brand small { color: var(--muted); font-size: .72rem; margin-top: 1px; }
.icon-button { border: 1px solid var(--border); background: rgba(255,255,255,.55); width: 40px; height: 40px; border-radius: 50%; cursor: pointer; font-weight: 800; }

.view { display: none; animation: rise .35s ease both; }
.view.is-visible { display: block; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.eyebrow { margin: 0 0 5px; font-size: .75rem; font-weight: 900; letter-spacing: .09em; text-transform: uppercase; color: var(--teal); }
h1, h2, h3, p { text-wrap: pretty; }
h1 { margin: 0; font-size: clamp(1.8rem, 8vw, 3rem); line-height: 1.05; letter-spacing: -.045em; }
h2 { margin: 0; font-size: 1.18rem; letter-spacing: -.025em; }

.hero-card { position: relative; overflow: hidden; background: var(--deep); color: white; border-radius: var(--radius-xl); padding: 24px; box-shadow: var(--shadow); }
.hero-card::after { content: ""; position: absolute; width: 190px; height: 190px; border-radius: 50%; right: -72px; top: -76px; border: 36px solid rgba(217,239,155,.13); }
.hero-topline { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.hero-card .eyebrow { color: var(--lime); }
.privacy-pill { color: var(--lime); background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.16); padding: 7px 10px; border-radius: 999px; font-size: .72rem; font-weight: 800; white-space: nowrap; }
.hero-card h1 { margin-top: 21px; font-size: clamp(2.5rem, 12vw, 4.5rem); }
.hero-caption { max-width: 520px; font-size: .78rem; line-height: 1.55; color: rgba(255,255,255,.7); margin: 8px 0 22px; }
.primary-button, .secondary-button, .danger-button { min-height: 48px; border-radius: 14px; border: 0; padding: 0 18px; font-weight: 900; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; transition: transform .16s ease, box-shadow .16s ease, background .16s ease; }
.primary-button { background: var(--lime); color: var(--deep); box-shadow: 0 8px 18px rgba(9,38,32,.18); }
.primary-button:hover, .secondary-button:hover, .danger-button:hover { transform: translateY(-1px); }
.primary-button:disabled { opacity: .42; cursor: not-allowed; transform: none; }
.hero-action { position: relative; z-index: 1; width: 100%; }
.secondary-button { background: white; color: var(--ink); border: 1px solid var(--border); }
.danger-button { background: #f7dfdb; color: var(--danger); }
.text-button { border: 0; padding: 5px 0; background: transparent; color: var(--teal); font-weight: 900; cursor: pointer; white-space: nowrap; }
.compact { min-height: 42px; padding-inline: 14px; }
.full-width { width: 100%; margin-top: 22px; }

.notice-card { display: grid; grid-template-columns: auto 1fr; gap: 10px 12px; align-items: center; margin: 18px 0 28px; padding: 16px; background: #fff7e3; border: 1px solid rgba(223,169,56,.26); border-radius: var(--radius-md); }
.notice-icon { grid-row: 1 / span 2; align-self: start; display: grid; place-items: center; width: 29px; height: 29px; border-radius: 9px; background: var(--gold); color: white; font-weight: 900; }
.notice-card strong { font-size: .88rem; }
.notice-card p { color: #77633b; font-size: .76rem; line-height: 1.5; margin: 2px 0 0; }
.notice-card .text-button { grid-column: 2; justify-self: start; font-size: .8rem; }

.section-heading, .page-header { display: flex; justify-content: space-between; align-items: end; gap: 15px; margin: 28px 2px 14px; }
.goal-spotlight { background: var(--paper); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 18px; display: grid; grid-template-columns: 74px 1fr; gap: 16px; align-items: center; }
.goal-visual { min-height: 104px; border-radius: 18px; background: var(--mint); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; }
.goal-icon { font-size: 1.8rem; color: var(--teal); }
.goal-level { font-size: .7rem; font-weight: 900; color: var(--teal); }
.amount-row, .goal-meta { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.amount-row strong { font-size: 1.35rem; }
.amount-row span, .goal-meta { color: var(--muted); font-size: .7rem; }
.progress-track { height: 10px; margin: 13px 0 8px; background: #e3e8e3; border-radius: 999px; overflow: hidden; }
.progress-track > span { display: block; width: 0; height: 100%; background: var(--teal); border-radius: inherit; transition: width .5s ease; }

.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.stat-card { background: rgba(255,255,255,.62); border: 1px solid var(--border); padding: 15px; border-radius: var(--radius-md); display: flex; align-items: center; gap: 11px; }
.stat-symbol { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; font-size: 1.25rem; font-weight: 900; }
.flame { background: #fce3d7; color: var(--coral); }
.star { background: #f9edc9; color: #b57b0c; }
.stat-card > div > strong, .stat-card > div > span { display: block; }
.stat-card strong { font-size: .94rem; }
.stat-card div > span { color: var(--muted); font-size: .67rem; margin-top: 2px; }

.mission-list { display: grid; gap: 10px; }
.mission-card { display: grid; grid-template-columns: auto 1fr auto; gap: 13px; align-items: center; background: var(--paper); border: 1px solid var(--border); padding: 15px; border-radius: var(--radius-md); }
.mission-badge { width: 42px; height: 42px; border-radius: 14px; background: var(--mint); color: var(--teal); display: grid; place-items: center; font-weight: 900; }
.mission-card.is-complete .mission-badge { color: var(--deep); background: var(--lime); }
.mission-copy strong, .mission-copy span { display: block; }
.mission-card .mission-copy > span { color: var(--muted); font-size: .73rem; margin-top: 3px; line-height: 1.35; }
.mission-points { color: var(--teal); font-size: .72rem; font-weight: 900; white-space: nowrap; }
.mission-card.is-complete .mission-points { color: var(--deep); }

.transaction-list { display: grid; gap: 9px; }
.transaction-item { background: rgba(255,255,255,.64); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 14px; display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; }
.transaction-mark { width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; background: var(--mint); color: var(--teal); font-weight: 900; }
.transaction-copy strong, .transaction-copy span { display: block; }
.transaction-copy span { color: var(--muted); font-size: .72rem; margin-top: 3px; }
.transaction-amount { text-align: right; }
.transaction-amount strong { display: block; color: var(--teal); }
.transaction-delete { border: 0; background: transparent; color: var(--muted); padding: 5px 0 0 12px; font-size: .7rem; cursor: pointer; }
.empty-state { text-align: center; background: rgba(255,255,255,.45); border: 1px dashed rgba(23,49,43,.2); padding: 28px 18px; border-radius: var(--radius-lg); color: var(--muted); }
.empty-state span { display: block; font-size: 1.8rem; color: var(--teal); margin-bottom: 6px; }
.empty-state p { margin: 0; font-size: .8rem; line-height: 1.5; }

.page-header { align-items: center; margin-top: 16px; }
.page-intro { color: var(--muted); line-height: 1.6; font-size: .82rem; margin: 0 0 18px; }
.goal-grid { display: grid; gap: 12px; }
.goal-card { background: var(--paper); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 19px; }
.goal-card.is-active { border-color: var(--teal); box-shadow: inset 0 0 0 1px var(--teal); }
.goal-card-top { display: flex; align-items: center; gap: 12px; }
.goal-card-icon { width: 46px; height: 46px; flex: 0 0 auto; border-radius: 15px; display: grid; place-items: center; background: var(--mint); color: var(--teal); font-size: 1.35rem; }
.goal-card-title { flex: 1; }
.goal-card-title strong, .goal-card-title span { display: block; }
.goal-card-title span { font-size: .72rem; color: var(--muted); margin-top: 2px; }
.active-tag { padding: 5px 8px; background: var(--lime); border-radius: 999px; font-size: .63rem; font-weight: 900; }
.goal-card .progress-track { margin-top: 17px; }
.goal-card-actions { display: flex; gap: 16px; margin-top: 14px; }
.goal-card-actions button { font-size: .75rem; }
.goal-card-actions .delete-goal { color: var(--danger); }

.history-summary { background: var(--deep); color: white; border-radius: var(--radius-lg); padding: 18px; display: grid; grid-template-columns: 1.4fr .6fr; gap: 14px; }
.history-summary div { min-width: 0; }
.history-summary div + div { padding-left: 14px; border-left: 1px solid rgba(255,255,255,.18); }
.history-summary span, .history-summary strong { display: block; }
.history-summary span { color: rgba(255,255,255,.65); font-size: .7rem; }
.history-summary strong { font-size: 1.4rem; margin-top: 5px; }
.filter-row { margin: 18px 0 12px; }
.filter-row label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
input, select { width: 100%; min-height: 48px; border: 1px solid var(--border); background: white; border-radius: 13px; padding: 0 14px; color: var(--ink); }
input::placeholder { color: #9ca7a3; }
.history-list { padding-bottom: 18px; }

.info-grid { display: grid; gap: 12px; }
.info-card { position: relative; overflow: hidden; background: var(--paper); padding: 20px; border: 1px solid var(--border); border-radius: var(--radius-lg); }
.info-card.emphasized { background: var(--deep); color: white; }
.info-number { font-size: .72rem; font-weight: 900; color: var(--coral); }
.info-card h2 { margin-top: 12px; }
.info-card p { color: var(--muted); font-size: .8rem; line-height: 1.65; margin: 8px 0 0; }
.info-card.emphasized p { color: rgba(255,255,255,.7); }
.data-tools { margin-top: 14px; background: #e8e2d6; border-radius: var(--radius-lg); padding: 20px; }
.data-tools > p { color: var(--muted); font-size: .8rem; line-height: 1.6; }
.button-stack { display: grid; gap: 9px; margin-top: 16px; }

.bottom-nav { position: fixed; z-index: 20; left: 10px; right: 10px; bottom: max(10px, env(safe-area-inset-bottom)); height: 72px; display: grid; grid-template-columns: 1fr 1fr 60px 1fr 1fr; align-items: center; max-width: 660px; margin: auto; padding: 7px 8px; background: rgba(255,253,247,.94); backdrop-filter: blur(14px); border: 1px solid rgba(23,49,43,.14); border-radius: 24px; box-shadow: 0 15px 35px rgba(18,60,52,.18); }
.nav-item { border: 0; background: transparent; cursor: pointer; color: var(--muted); font-weight: 800; }
.bottom-nav .nav-item { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 5px 2px; font-size: .62rem; }
.bottom-nav .nav-item > span:first-child { font-size: 1.2rem; line-height: 1; }
.nav-item.is-active { color: var(--teal); }
.nav-center { justify-self: center; width: 56px; height: 56px; margin-top: -31px; border: 5px solid var(--cream); background: var(--coral); color: white; border-radius: 20px; font-size: 1.8rem; font-weight: 600; cursor: pointer; box-shadow: 0 10px 20px rgba(237,126,98,.3); }

dialog { color: var(--ink); }
dialog::backdrop { background: rgba(10,30,26,.58); backdrop-filter: blur(3px); }
.sheet { width: 100%; max-width: 620px; max-height: 92svh; padding: 0; margin: auto auto 0; border: 0; background: transparent; overflow: visible; }
.sheet[open] { animation: sheetUp .24s ease both; }
@keyframes sheetUp { from { transform: translateY(35px); opacity: 0; } }
.sheet-card { max-height: 92svh; overflow-y: auto; background: var(--cream); border-radius: 28px 28px 0 0; padding: 10px 20px calc(24px + env(safe-area-inset-bottom)); box-shadow: var(--shadow); }
.sheet-handle { width: 42px; height: 5px; background: rgba(23,49,43,.18); border-radius: 999px; margin: 0 auto 14px; }
.sheet-header { display: flex; justify-content: space-between; align-items: start; gap: 12px; margin-bottom: 20px; }
.sheet-header .icon-button { font-size: 1.4rem; font-weight: 500; }
.deposit-step { display: none; }
.deposit-step.is-active { display: block; }
.field-label { display: block; font-size: .76rem; font-weight: 900; margin: 15px 0 7px; }
.money-input { position: relative; }
.money-input span { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); font-weight: 900; color: var(--teal); font-size: 1.4rem; }
.money-input input { height: 70px; padding-left: 45px; font-size: 2rem; font-weight: 900; }
.money-input.small input { height: 54px; font-size: 1.15rem; }
.money-input.small span { font-size: 1rem; }
.amount-presets { display: grid; grid-template-columns: repeat(4,1fr); gap: 7px; margin-top: 9px; }
.amount-presets button { border: 1px solid var(--border); background: rgba(255,255,255,.7); border-radius: 11px; min-height: 38px; color: var(--teal); font-weight: 900; cursor: pointer; }
.qr-panel { text-align: center; background: white; border-radius: var(--radius-lg); padding: 15px; border: 1px solid var(--border); }
.qr-panel img { display: block; width: min(100%, 310px); height: auto; max-height: 46svh; object-fit: contain; margin: 12px auto; border-radius: 10px; }
.qr-amount span, .qr-amount strong { display: block; }
.qr-amount span { font-size: .72rem; color: var(--muted); }
.qr-amount strong { font-size: 1.65rem; margin-top: 2px; }
.qr-panel p { color: var(--muted); font-size: .76rem; line-height: 1.55; }
.qr-download { min-height: 42px; font-size: .78rem; width: 100%; }
.bank-note { display: grid; gap: 3px; margin: 12px 0; padding: 12px; border-left: 4px solid var(--gold); background: #fff7e3; font-size: .73rem; line-height: 1.5; }
.bank-note span { color: #77633b; }
.split-buttons { display: grid; grid-template-columns: 1fr 1.35fr; gap: 9px; margin-top: 16px; }
.confirm-illustration { margin: 8px auto 14px; width: 70px; height: 70px; border-radius: 24px; background: var(--mint); color: var(--teal); display: grid; place-items: center; font-size: 2rem; font-weight: 900; }
.deposit-step[data-step="3"] h3 { text-align: center; margin: 0 0 15px; }
.confirm-details { margin: 0; background: white; padding: 8px 14px; border-radius: var(--radius-md); border: 1px solid var(--border); }
.confirm-details div { display: flex; justify-content: space-between; gap: 20px; padding: 10px 0; }
.confirm-details div + div { border-top: 1px solid var(--border); }
.confirm-details dt { color: var(--muted); }
.confirm-details dd { margin: 0; font-weight: 900; text-align: right; }
.confirm-checkbox { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: start; margin-top: 15px; padding: 13px; background: #fff7e3; border-radius: 13px; font-size: .75rem; line-height: 1.55; cursor: pointer; }
.confirm-checkbox input { width: 20px; min-height: 20px; margin: 1px 0 0; accent-color: var(--teal); }
.goal-dialog .sheet-card { padding-bottom: 28px; }

.confirm-dialog { max-width: 390px; width: calc(100% - 32px); border: 0; border-radius: var(--radius-lg); padding: 0; }
.confirm-dialog form { text-align: center; padding: 24px; }
.confirm-dialog h2 { margin-top: 12px; }
.confirm-dialog p { color: var(--muted); font-size: .82rem; line-height: 1.6; }
.warning-mark { display: grid; place-items: center; width: 52px; height: 52px; margin: 0 auto; background: #f7dfdb; color: var(--danger); font-weight: 900; border-radius: 17px; font-size: 1.4rem; }
.toast { position: fixed; z-index: 90; left: 50%; bottom: 102px; transform: translate(-50%, 18px); min-width: min(340px,calc(100% - 32px)); padding: 12px 16px; border-radius: 14px; background: var(--ink); color: white; text-align: center; font-size: .8rem; box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: .25s ease; }
.toast.is-visible { opacity: 1; transform: translate(-50%,0); }

@media (min-width: 760px) {
  .goal-grid, .info-grid { grid-template-columns: 1fr 1fr; }
  .mission-list { grid-template-columns: 1fr 1fr; }
  .sheet { margin: auto; }
  .sheet-card { border-radius: 28px; padding-bottom: 24px; }
}

@media (min-width: 1040px) {
  .app-shell { display: grid; grid-template-columns: 260px 1fr; }
  .side-rail { position: sticky; top: 0; height: 100svh; display: flex; flex-direction: column; padding: 30px 22px; background: var(--paper); border-right: 1px solid var(--border); }
  .desktop-nav { display: grid; gap: 7px; margin-top: 48px; }
  .desktop-nav .nav-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 13px; text-align: left; }
  .desktop-nav .nav-item.is-active { background: var(--mint); }
  .desktop-nav .nav-item span:first-child { font-size: 1.25rem; }
  .rail-note { margin-top: auto; display: grid; grid-template-columns: auto 1fr; gap: 8px; padding: 14px; border-radius: 14px; background: var(--cream); }
  .rail-note p { margin: 0; color: var(--muted); font-size: .7rem; line-height: 1.5; }
  .rail-note strong { color: var(--ink); }
  .status-dot { width: 9px; height: 9px; margin-top: 4px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 0 4px var(--mint); }
  main { width: 100%; max-width: 980px; padding: 42px 42px 60px; }
  .mobile-header, .bottom-nav { display: none; }
  .hero-card { padding: 32px; }
  .hero-action { width: auto; }
  .goal-spotlight { grid-template-columns: 100px 1fr; padding: 22px; }
  .goal-visual { min-height: 120px; }
  .toast { bottom: 30px; }
}

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

/* SaveQuest Neo Bank theme — visual layer inspired by modern mobile banking */
:root {
  --ink: #10264a;
  --muted: #6f7f9d;
  --deep: #124ec3;
  --teal: #1268f4;
  --mint: #e7f1ff;
  --lime: #ffffff;
  --cream: #eef5ff;
  --paper: #ffffff;
  --coral: #ff7b6b;
  --gold: #ffb943;
  --danger: #d24e59;
  --border: rgba(39, 103, 218, .12);
  --shadow: 0 18px 44px rgba(24, 78, 171, .14);
  --shadow-soft: 0 10px 30px rgba(34, 92, 190, .09);
}

body {
  min-height: 100svh;
  background:
    radial-gradient(circle at 4% 7%, rgba(112, 184, 255, .36) 0, transparent 26%),
    radial-gradient(circle at 96% 14%, rgba(65, 129, 240, .26) 0, transparent 30%),
    linear-gradient(180deg, #1765e9 0 360px, #edf5ff 360px, #f8fbff 100%);
  background-attachment: fixed;
}

body::before,
body::after {
  content: "";
  position: fixed;
  z-index: -1;
  pointer-events: none;
  border: 1px solid rgba(255,255,255,.12);
  transform: rotate(34deg);
}

body::before { width: 320px; height: 320px; top: -210px; left: -120px; }
body::after { width: 410px; height: 410px; top: -240px; right: -180px; }

.app-shell { position: relative; }
main { max-width: 820px; padding-inline: 16px; }

.mobile-header {
  min-height: 94px;
  padding: 11px 2px 8px;
  color: white;
}

.mobile-header .brand { color: white; }
.mobile-header .brand-mark {
  width: 46px;
  height: 46px;
  color: white;
  background: linear-gradient(145deg, rgba(255,255,255,.28), rgba(255,255,255,.12));
  border: 1px solid rgba(255,255,255,.26);
  box-shadow: 0 12px 26px rgba(4, 42, 119, .2);
  backdrop-filter: blur(12px);
}
.mobile-header .brand strong { font-size: 1.06rem; }
.mobile-header .brand small.greeting { color: rgba(255,255,255,.72); font-size: .68rem; margin: 0 0 1px; }
.header-actions { display: flex; align-items: center; gap: 8px; }
.live-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 0 10px;
  border-radius: 999px;
  color: rgba(255,255,255,.88);
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.16);
  font-size: .67rem;
  font-weight: 800;
  backdrop-filter: blur(12px);
}
.live-chip i { width: 7px; height: 7px; border-radius: 50%; background: #72f0b4; box-shadow: 0 0 0 4px rgba(114,240,180,.13); animation: statusPulse 2.6s ease-in-out infinite; }
.mobile-header .icon-button {
  color: white;
  background: rgba(255,255,255,.12);
  border-color: rgba(255,255,255,.17);
  backdrop-filter: blur(12px);
}

.hero-card {
  min-height: 278px;
  isolation: isolate;
  overflow: hidden;
  padding: 23px 21px 19px;
  color: white;
  background: linear-gradient(145deg, #1a73ff 0%, #1460ea 48%, #0c4cc6 100%);
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 30px;
  box-shadow: 0 24px 55px rgba(5, 52, 139, .30), inset 0 1px 0 rgba(255,255,255,.20);
  animation: bankCardIn .68s cubic-bezier(.2,.9,.25,1.12) both;
}
.hero-card::before {
  content: "";
  position: absolute;
  z-index: -1;
  width: 260px;
  height: 260px;
  right: -105px;
  top: -112px;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 34%, rgba(255,255,255,.20), rgba(255,255,255,.02) 64%);
  border: 1px solid rgba(255,255,255,.12);
  animation: orbital 8s ease-in-out infinite;
}
.hero-card::after {
  width: 175px;
  height: 175px;
  right: -64px;
  top: -54px;
  border: 28px solid rgba(255,255,255,.06);
}
.float-orb { position: absolute; z-index: -1; border-radius: 50%; pointer-events: none; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.14); box-shadow: inset 0 0 20px rgba(255,255,255,.10); }
.orb-one { width: 24px; height: 24px; left: 12%; top: 43%; animation: floatOrb 5.2s ease-in-out infinite; }
.orb-two { width: 12px; height: 12px; right: 36%; top: 19%; animation: floatOrb 4.2s .7s ease-in-out infinite reverse; }
.orb-three { width: 52px; height: 52px; left: -18px; bottom: 15px; animation: floatOrb 7s 1.2s ease-in-out infinite; }
.hero-card .eyebrow { color: rgba(255,255,255,.72); }
.hero-card h1 { position: relative; z-index: 1; margin-top: 18px; font-size: clamp(2.55rem, 12vw, 4.5rem); letter-spacing: -.055em; text-shadow: 0 6px 20px rgba(3,39,107,.22); }
.privacy-pill {
  color: white;
  background: rgba(255,255,255,.13);
  border-color: rgba(255,255,255,.18);
  backdrop-filter: blur(10px);
}
.privacy-pill > span { display: inline-block; margin-right: 3px; opacity: .8; }
.hero-caption { max-width: 560px; color: rgba(255,255,255,.72); margin-bottom: 18px; }
.hero-actions { position: relative; z-index: 2; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.quick-action {
  min-width: 0;
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 8px;
  color: white;
  background: rgba(255,255,255,.13);
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 15px;
  font-size: .74rem;
  font-weight: 900;
  cursor: pointer;
  backdrop-filter: blur(12px);
  transition: transform .18s cubic-bezier(.2,.9,.25,1.2), background .18s ease, box-shadow .18s ease;
}
.quick-action:hover { background: rgba(255,255,255,.20); transform: translateY(-2px); box-shadow: 0 10px 20px rgba(4,40,110,.15); }
.quick-action:active { transform: translateY(1px) scale(.96); }
.quick-action-primary { color: #1158d5; background: white; border-color: white; box-shadow: 0 10px 24px rgba(3,44,117,.18); }
.quick-action-primary:hover { background: #f5f9ff; }
.quick-action-icon { display: grid; place-items: center; width: 25px; height: 25px; flex: 0 0 auto; border-radius: 9px; background: rgba(255,255,255,.15); font-size: 1rem; line-height: 1; }
.quick-action-primary .quick-action-icon { color: white; background: #1768ed; }

.notice-card {
  position: relative;
  z-index: 3;
  margin: 12px 4px 27px;
  padding: 14px 15px;
  background: rgba(255,255,255,.92);
  border: 1px solid rgba(255,255,255,.72);
  border-radius: 19px;
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(16px);
}
.notice-icon { color: #1768ed; background: #e8f2ff; }
.notice-card p { color: var(--muted); }

.section-heading { margin-top: 25px; }
.section-heading .eyebrow, .page-header .eyebrow { color: #3679dc; }
.text-button { color: #1768ed; }

.goal-spotlight {
  position: relative;
  overflow: hidden;
  padding: 17px;
  background: linear-gradient(132deg, rgba(255,255,255,.99), rgba(240,247,255,.97));
  border: 1px solid rgba(55,118,219,.10);
  border-radius: 23px;
  box-shadow: var(--shadow-soft);
}
.goal-spotlight::after {
  content: "";
  position: absolute;
  width: 120px;
  height: 120px;
  right: -72px;
  bottom: -74px;
  border: 20px solid rgba(38,111,230,.05);
  border-radius: 50%;
}
.goal-visual {
  position: relative;
  z-index: 1;
  color: white;
  background: linear-gradient(145deg, #2c82ff, #145bdc);
  box-shadow: 0 12px 25px rgba(18,94,219,.22);
  animation: cardFloat 5.8s ease-in-out infinite;
}
.goal-icon, .goal-level { color: white; }
.progress-track { height: 9px; background: #e6eef9; }
.progress-track > span { background: linear-gradient(90deg, #1664e8, #54a0ff); box-shadow: 0 0 10px rgba(24,103,239,.22); transition: width .65s cubic-bezier(.2,.9,.25,1.05); }

.stat-grid { gap: 10px; }
.stat-card {
  min-width: 0;
  background: rgba(255,255,255,.92);
  border-color: rgba(45,110,216,.09);
  box-shadow: 0 10px 28px rgba(23,75,164,.08);
  transition: transform .2s ease, box-shadow .2s ease;
}
.stat-card:hover { transform: translateY(-3px); box-shadow: 0 15px 32px rgba(23,75,164,.12); }
.stat-symbol { color: #1768ed; background: #e8f2ff; }
.flame { color: #ff685d; background: #fff0ee; }
.star { color: #d99000; background: #fff7de; }

.mission-list { grid-auto-flow: column; grid-auto-columns: minmax(244px, 82%); overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding: 2px 1px 10px; }
.mission-list::-webkit-scrollbar { display: none; }
.mission-card {
  scroll-snap-align: start;
  min-height: 80px;
  background: rgba(255,255,255,.95);
  border-color: rgba(45,110,216,.09);
  border-radius: 20px;
  box-shadow: 0 10px 27px rgba(23,75,164,.08);
  transition: transform .2s cubic-bezier(.2,.9,.25,1.2), box-shadow .2s ease;
}
.mission-card:hover { transform: translateY(-3px) scale(1.01); box-shadow: 0 16px 34px rgba(23,75,164,.13); }
.mission-badge { color: #1768ed; background: #e8f2ff; border-radius: 14px; }
.mission-card.is-complete .mission-badge { color: white; background: linear-gradient(145deg,#31c389,#1fab75); animation: successPop .55s cubic-bezier(.2,.9,.25,1.15) both; }
.mission-points { color: #1768ed; }

.transaction-item {
  background: rgba(255,255,255,.95);
  border-color: rgba(45,110,216,.08);
  border-radius: 19px;
  box-shadow: 0 8px 24px rgba(23,75,164,.065);
  transition: transform .18s ease, box-shadow .18s ease;
}
.transaction-item:hover { transform: translateX(3px); box-shadow: 0 12px 28px rgba(23,75,164,.10); }
.transaction-mark { color: white; background: linear-gradient(145deg, #3489ff, #1766e8); box-shadow: 0 8px 18px rgba(25,101,227,.20); }
.transaction-amount strong { color: #15966a; }
.empty-state { background: rgba(255,255,255,.66); border-color: rgba(37,104,213,.20); }
.empty-state span { color: #1768ed; }

.primary-button {
  color: white;
  background: linear-gradient(135deg, #2d82ff, #155fe1);
  box-shadow: 0 10px 24px rgba(20,93,220,.22);
}
.primary-button:hover { box-shadow: 0 14px 28px rgba(20,93,220,.28); }
.secondary-button { border-color: rgba(31,101,214,.14); color: #1759c3; background: #f8fbff; }
.danger-button { background: #fff0f1; color: #c94553; }
.primary-button:active, .secondary-button:active, .danger-button:active, .text-button:active, .nav-item:active, .icon-button:active { transform: scale(.96); }

#view-goals,
#view-history,
#view-safety {
  margin-top: 5px;
  padding: 20px 16px 28px;
  background: rgba(247,251,255,.96);
  border: 1px solid rgba(255,255,255,.68);
  border-radius: 28px;
  box-shadow: 0 24px 54px rgba(3,52,139,.16);
  backdrop-filter: blur(16px);
}
.page-header { margin-top: 0; }
.page-header h1 { font-size: clamp(1.75rem, 7vw, 2.5rem); }
.goal-card, .info-card {
  background: white;
  border-color: rgba(39,103,218,.10);
  box-shadow: var(--shadow-soft);
}
.goal-card { transition: transform .2s ease, box-shadow .2s ease; }
.goal-card:hover { transform: translateY(-3px); box-shadow: 0 16px 34px rgba(24,78,171,.13); }
.goal-card.is-active { border-color: #2b79ee; box-shadow: 0 0 0 1px #2b79ee, 0 14px 34px rgba(24,78,171,.13); }
.goal-card-icon { color: white; background: linear-gradient(145deg,#368bff,#1764e7); }
.active-tag { color: #1457c8; background: #e4efff; }
.history-summary { background: linear-gradient(135deg, #1b73f8, #114fc6); box-shadow: 0 16px 34px rgba(12,79,195,.22); }
.filter-row input { background: white; box-shadow: 0 8px 22px rgba(22,76,165,.07); }
.info-card.emphasized { background: linear-gradient(145deg,#1f76f4,#124ebe); }
.data-tools { background: linear-gradient(145deg,#e5f0ff,#f3f8ff); border: 1px solid rgba(39,103,218,.10); }

.bottom-nav {
  height: 72px;
  padding: 7px 8px;
  background: rgba(255,255,255,.91);
  border-color: rgba(36,102,208,.13);
  box-shadow: 0 18px 42px rgba(12,61,142,.20);
  backdrop-filter: blur(22px) saturate(150%);
}
.bottom-nav .nav-item { min-height: 48px; border-radius: 16px; transition: color .18s ease, background .18s ease, transform .18s ease; }
.bottom-nav .nav-item.is-active { color: #1665e8; background: #e6f0ff; }
.bottom-nav .nav-item > span:first-child { transition: transform .22s cubic-bezier(.2,.9,.25,1.2); }
.bottom-nav .nav-item.is-active > span:first-child { transform: translateY(-2px) scale(1.12); }
.nav-center {
  width: 58px;
  height: 58px;
  color: white;
  background: linear-gradient(145deg,#378dff,#135ee0);
  border-color: #eef5ff;
  border-radius: 20px;
  box-shadow: 0 12px 28px rgba(19,95,224,.34);
  animation: softPulse 3.2s ease-in-out infinite;
  transition: transform .18s cubic-bezier(.2,.9,.25,1.2);
}
.nav-center:active { transform: translateY(2px) scale(.92); }

dialog::backdrop { background: rgba(7,37,92,.66); backdrop-filter: blur(6px); }
.sheet-card {
  background: linear-gradient(180deg,#ffffff,#f5f9ff);
  box-shadow: 0 -20px 60px rgba(5,43,109,.24);
}
.sheet[open] { animation: sheetSpring .42s cubic-bezier(.2,.9,.25,1.12) both; }
.sheet-handle { background: #d8e1f0; }
.sheet-header .eyebrow { color: #2874e6; }
input, select { border-color: rgba(39,103,218,.16); background: #fbfdff; }
input:focus, select:focus { border-color: #2f7dec; box-shadow: 0 0 0 4px rgba(47,125,236,.11); }
.money-input span { color: #1768ed; }
.money-input input { color: #11284d; background: white; border-color: rgba(31,101,214,.13); box-shadow: 0 9px 24px rgba(18,75,166,.08); }
.amount-presets button { color: #1763db; background: #edf4ff; border-color: transparent; transition: transform .16s ease, color .16s ease, background .16s ease; }
.amount-presets button:hover { color: white; background: #2374ec; transform: translateY(-2px); }
.amount-presets button.is-selected { color: white; background: #1768ed; box-shadow: 0 8px 18px rgba(23,104,237,.22); }
.amount-presets button:active { transform: scale(.94); }
input[type="number"] { appearance: textfield; -moz-appearance: textfield; }
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button { margin: 0; appearance: none; -webkit-appearance: none; }
.qr-panel { border-color: rgba(39,103,218,.10); box-shadow: 0 14px 34px rgba(18,75,166,.10); }
.bank-note { border-left-color: #3b82f6; background: #eaf3ff; }
.bank-note span { color: #5d7091; }
.confirm-illustration { color: white; background: linear-gradient(145deg,#31c389,#1fab75); box-shadow: 0 12px 28px rgba(31,171,117,.22); animation: successPop .56s cubic-bezier(.2,.9,.25,1.18) both; }
.confirm-checkbox { background: #eaf3ff; }
.confirm-checkbox input { accent-color: #1768ed; }
.toast { color: white; background: #123a7a; box-shadow: 0 16px 38px rgba(6,44,111,.28); }

.just-saved #total-saved { display: inline-block; animation: balanceBounce .7s cubic-bezier(.2,.9,.25,1.18) both; }
.just-saved .hero-card { animation: heroGlow .8s ease both; }
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible { outline-color: #8ac0ff; }

@keyframes bankCardIn {
  0% { opacity: 0; transform: translateY(18px) scale(.97); }
  70% { transform: translateY(-3px) scale(1.008); }
  100% { opacity: 1; transform: none; }
}
@keyframes sheetSpring {
  0% { opacity: 0; transform: translateY(45px) scale(.98); }
  72% { transform: translateY(-4px) scale(1.004); }
  100% { opacity: 1; transform: none; }
}
@keyframes floatOrb {
  0%,100% { transform: translate3d(0,0,0) rotate(0); }
  50% { transform: translate3d(3px,-10px,0) rotate(7deg); }
}
@keyframes orbital {
  0%,100% { transform: translate3d(0,0,0) scale(1); }
  50% { transform: translate3d(-9px,8px,0) scale(1.05); }
}
@keyframes cardFloat {
  0%,100% { transform: translateY(0) rotate(0); }
  50% { transform: translateY(-6px) rotate(1deg); }
}
@keyframes statusPulse {
  0%,100% { box-shadow: 0 0 0 3px rgba(114,240,180,.12); }
  50% { box-shadow: 0 0 0 7px rgba(114,240,180,0); }
}
@keyframes softPulse {
  0%,100% { box-shadow: 0 12px 28px rgba(19,95,224,.30); }
  50% { box-shadow: 0 15px 34px rgba(19,95,224,.42); }
}
@keyframes successPop {
  0% { opacity: 0; transform: scale(.65); }
  70% { transform: scale(1.1); }
  100% { opacity: 1; transform: scale(1); }
}
@keyframes balanceBounce {
  0% { transform: scale(.88); }
  48% { transform: scale(1.09); }
  75% { transform: scale(.98); }
  100% { transform: scale(1); }
}
@keyframes heroGlow {
  0%,100% { box-shadow: 0 24px 55px rgba(5,52,139,.30), inset 0 1px 0 rgba(255,255,255,.20); }
  48% { box-shadow: 0 26px 65px rgba(57,143,255,.48), inset 0 1px 0 rgba(255,255,255,.34); }
}

@media (min-width: 760px) {
  body { background: linear-gradient(145deg,#0e54c9 0%,#2f8cff 42%,#edf5ff 42%); }
  .hero-card { min-height: 294px; padding: 28px; }
  .hero-actions { max-width: 520px; }
  .mission-list { grid-auto-flow: row; grid-template-columns: 1fr 1fr; overflow: visible; }
  #view-goals, #view-history, #view-safety { padding: 28px; }
}

@media (min-width: 1040px) {
  body { background: #edf5ff; }
  .app-shell { grid-template-columns: 268px 1fr; }
  .side-rail { color: white; background: linear-gradient(180deg,#155fdd,#0f46ae); border-right: 0; box-shadow: 12px 0 40px rgba(9,61,150,.13); }
  .side-rail .brand { color: white; }
  .side-rail .brand-mark { color: #1459d1; background: white; }
  .side-rail .brand small { color: rgba(255,255,255,.65); }
  .desktop-nav .nav-item { color: rgba(255,255,255,.68); }
  .desktop-nav .nav-item:hover { color: white; background: rgba(255,255,255,.10); }
  .desktop-nav .nav-item.is-active { color: #1457cb; background: white; box-shadow: 0 12px 28px rgba(4,45,116,.18); }
  .rail-note { background: rgba(255,255,255,.11); border: 1px solid rgba(255,255,255,.14); }
  .rail-note p, .rail-note strong { color: rgba(255,255,255,.82); }
  .status-dot { background: #72f0b4; box-shadow: 0 0 0 4px rgba(114,240,180,.13); }
  main { max-width: 1020px; padding: 38px 42px 60px; }
  main::before { content: "SaveQuest Dashboard"; display: block; margin: 0 0 18px; color: #163c78; font-weight: 900; font-size: 1.05rem; letter-spacing: -.02em; }
  .hero-card { padding: 34px; }
  #view-goals, #view-history, #view-safety { margin-top: 0; }
}

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

/* Refine the visual hierarchy: simple banking surfaces and intentional type weights. */
:root {
  --ink: #162b4d;
  --muted: #78869d;
  --deep: #155bd1;
  --teal: #1768e8;
  --mint: #edf4ff;
  --cream: #f4f7fb;
  --paper: #fff;
  --border: #e8edf4;
  --shadow: 0 10px 28px rgba(24, 57, 103, .08);
  --shadow-soft: 0 6px 20px rgba(24, 57, 103, .06);
  --radius-xl: 26px;
  --radius-lg: 22px;
  --radius-md: 18px;
}

body {
  color: var(--ink);
  background:
    linear-gradient(180deg, #2168d8 0, #2168d8 320px, #f3f6fb 320px, #f7f9fc 100%);
  line-height: 1.5;
}
body::before,
body::after,
.float-orb { display: none; }

main { max-width: 760px; }
.mobile-header { min-height: 84px; }
.mobile-header .brand-mark { width: 42px; height: 42px; border-radius: 14px; }
.mobile-header .brand strong { font-size: 1rem; font-weight: 700; letter-spacing: -.015em; }
.mobile-header .brand small.greeting { font-size: .72rem; font-weight: 400; }
.live-chip { font-weight: 400; }

.hero-card {
  min-height: 0;
  padding: 23px 22px 18px;
  background: linear-gradient(145deg, #3486f5, #236cde 66%, #1c5cc8);
  border: 0;
  border-radius: 26px;
  box-shadow: 0 14px 32px rgba(21, 75, 158, .18);
  animation: bankCardIn .35s ease-out both;
}
.hero-card::before,
.hero-card::after { display: none; }
.hero-topline { align-items: center; }
.eyebrow,
.hero-card .eyebrow,
.section-heading .eyebrow,
.page-header .eyebrow,
.sheet-header .eyebrow {
  margin-bottom: 5px;
  color: #6680a5;
  font-size: .73rem;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
}
.hero-card .eyebrow { color: rgba(255,255,255,.78); }
.privacy-pill { font-weight: 400; padding: 6px 10px; }
.hero-card h1 {
  margin-top: 16px;
  font-size: clamp(2.45rem, 11vw, 3.8rem);
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: -.035em;
  text-shadow: none;
}
.hero-caption { margin: 7px 0 18px; font-size: .76rem; font-weight: 400; line-height: 1.5; }

.hero-actions { gap: 8px; }
.quick-action {
  min-height: 48px;
  gap: 7px;
  border-radius: 999px;
  font-size: .76rem;
  font-weight: 700;
  backdrop-filter: none;
  transition: transform .16s ease, background-color .16s ease;
}
.quick-action:hover { box-shadow: none; transform: translateY(-1px); }
.quick-action-primary { box-shadow: none; }
.quick-action-icon { width: 23px; height: 23px; border-radius: 50%; font-weight: 400; }

.notice-card {
  margin: 12px 2px 24px;
  padding: 13px 14px;
  border-color: #edf0f5;
  border-radius: 18px;
  box-shadow: 0 5px 16px rgba(24,57,103,.045);
  backdrop-filter: none;
}
.notice-card strong { font-size: .84rem; font-weight: 700; }
.notice-card p { font-size: .74rem; font-weight: 400; }
.notice-card .text-button { font-weight: 700; }

.section-heading { align-items: center; margin: 24px 2px 12px; }
.section-heading h2,
.page-header h1,
.page-header h2,
.data-tools h2 { font-weight: 700; letter-spacing: -.02em; }
.section-heading .text-button,
.text-button { font-size: .78rem; font-weight: 700; }
.goal-spotlight {
  padding: 15px;
  grid-template-columns: 68px minmax(0, 1fr);
  gap: 13px;
  background: white;
  border: 1px solid #e9eef5;
  border-radius: 21px;
  box-shadow: 0 7px 20px rgba(25,59,109,.06);
}
.goal-visual {
  min-height: 88px;
  border-radius: 17px;
  background: #eaf2ff;
  box-shadow: none;
  animation: none;
}
.goal-icon { color: #2671e4; font-size: 1.45rem; }
.goal-level { color: #4777b8; font-size: .68rem; font-weight: 400; }
.amount-row strong { font-size: 1.2rem; font-weight: 700; }
.amount-row > span { font-size: .72rem; font-weight: 400; }
.goal-meta { font-size: .68rem; font-weight: 400; }
.goal-spotlight::after { display: none; }
.progress-track { height: 7px; margin: 11px 0 7px; }
.progress-track > span { background: #3281ed; box-shadow: none; }

.stat-grid { gap: 9px; }
.stat-card {
  padding: 12px;
  gap: 9px;
  border-radius: 18px;
  box-shadow: 0 5px 16px rgba(25,59,109,.045);
}
.stat-card:hover { transform: none; box-shadow: 0 5px 16px rgba(25,59,109,.045); }
.stat-symbol { width: 34px; height: 34px; border-radius: 50%; font-size: 1.05rem; }
.stat-card strong { font-size: .84rem; font-weight: 700; }
.stat-card div > span { font-size: .66rem; font-weight: 400; }

.mission-list { grid-auto-columns: minmax(232px, 78%); }
.mission-card {
  min-height: 72px;
  padding: 12px;
  gap: 10px;
  border-radius: 18px;
  box-shadow: 0 5px 16px rgba(25,59,109,.045);
}
.mission-card:hover { transform: none; box-shadow: 0 5px 16px rgba(25,59,109,.045); }
.mission-badge { width: 38px; height: 38px; border-radius: 50%; font-weight: 700; }
.mission-copy strong { font-size: .82rem; font-weight: 700; }
.mission-card .mission-copy > span { font-size: .70rem; font-weight: 400; }
.mission-points { font-size: .68rem; font-weight: 400; }

.transaction-item {
  padding: 12px;
  border-radius: 18px;
  box-shadow: 0 4px 14px rgba(25,59,109,.045);
}
.transaction-item:hover { transform: none; box-shadow: 0 4px 14px rgba(25,59,109,.045); }
.transaction-mark { width: 38px; height: 38px; border-radius: 50%; box-shadow: none; }
.transaction-copy strong { font-size: .82rem; font-weight: 700; }
.transaction-copy span { font-size: .68rem; font-weight: 400; }
.transaction-amount strong { font-size: .82rem; font-weight: 700; }

.primary-button,
.secondary-button,
.danger-button {
  min-height: 46px;
  border-radius: 999px;
  font-size: .82rem;
  font-weight: 700;
  box-shadow: none;
}
.primary-button { background: #3181ee; }
.primary-button:hover { background: #2673df; box-shadow: none; }
.secondary-button { border-radius: 14px; font-weight: 400; }
.danger-button { border-radius: 14px; font-weight: 700; }
.compact { min-height: 40px; padding-inline: 15px; }

#view-goals,
#view-history,
#view-safety {
  margin-top: 2px;
  padding: 19px 15px 26px;
  background: rgba(255,255,255,.97);
  border: 1px solid rgba(231,237,246,.92);
  border-radius: 24px;
  box-shadow: 0 10px 28px rgba(19,56,116,.10);
  backdrop-filter: none;
}
.page-header { align-items: center; margin-bottom: 14px; }
.page-header h1 { font-size: clamp(1.65rem, 7vw, 2.25rem); line-height: 1.2; }
.page-intro { margin-bottom: 15px; font-size: .78rem; font-weight: 400; color: #77869c; }
.goal-grid { gap: 11px; }
.goal-card {
  padding: 15px;
  border-color: #e9eef5;
  border-radius: 20px;
  box-shadow: 0 5px 16px rgba(25,59,109,.045);
  transition: border-color .16s ease, box-shadow .16s ease;
}
.goal-card:hover { transform: none; box-shadow: 0 5px 16px rgba(25,59,109,.045); }
.goal-card.is-active { border-color: #b7d2fa; box-shadow: 0 0 0 1px #b7d2fa; }
.goal-card-top { gap: 11px; }
.goal-card-icon { width: 42px; height: 42px; border-radius: 15px; color: #2471df; background: #eaf2ff; font-size: 1.15rem; }
.goal-card-title strong { font-size: .88rem; font-weight: 700; }
.goal-card-title span { font-size: .7rem; font-weight: 400; }
.active-tag { padding: 5px 8px; border-radius: 999px; font-size: .62rem; font-weight: 400; }
.goal-card .progress-track { margin: 14px 0 7px; }
.goal-card .goal-meta { font-size: .68rem; }
.goal-card-actions { margin-top: 11px; }
.goal-card-actions button { min-height: 34px; font-size: .72rem; font-weight: 400; }

.history-summary { border-radius: 20px; box-shadow: none; }
.history-summary span { font-size: .69rem; font-weight: 400; }
.history-summary strong { font-size: 1.24rem; font-weight: 700; }
.info-grid { gap: 11px; }
.info-card { border-radius: 20px; box-shadow: 0 5px 16px rgba(25,59,109,.045); }
.info-card h2 { font-size: 1rem; font-weight: 700; }
.info-card p { font-size: .76rem; font-weight: 400; }
.info-card.emphasized { background: #2469d6; }
.data-tools { border-radius: 20px; }

.bottom-nav {
  height: 68px;
  border-radius: 22px;
  box-shadow: 0 10px 26px rgba(16,51,109,.13);
}
.bottom-nav .nav-item { font-weight: 400; }
.bottom-nav .nav-item.is-active { background: #edf4ff; }
.nav-center {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  box-shadow: 0 8px 18px rgba(19,95,224,.22);
  animation: none;
}

.sheet-card { background: #fff; box-shadow: 0 -12px 32px rgba(5,43,109,.16); }
.sheet[open] { animation: sheetSpring .3s cubic-bezier(.2,.8,.2,1) both; }
.sheet-header h2 { font-weight: 700; }
.field-label { font-size: .76rem; font-weight: 700; }
.money-input input { font-size: 1.8rem; font-weight: 700; }
.amount-presets button { font-weight: 400; }
.bank-note { border-radius: 12px; }
.confirm-details dd { font-weight: 700; }
.confirm-checkbox { border-radius: 14px; font-weight: 400; }
.confirm-checkbox strong { font-weight: 700; }

@media (min-width: 760px) {
  body { background: linear-gradient(145deg,#1b65d5 0%,#337fe2 34%,#f3f6fb 34%,#f7f9fc 100%); }
  .hero-card { min-height: 0; padding: 28px; }
}

@media (min-width: 1040px) {
  body { background: #f1f5fa; }
  .side-rail { background: #155bd1; }
  .side-rail .brand-mark { border-radius: 14px; }
  .desktop-nav .nav-item.is-active { box-shadow: none; }
  main::before { font-weight: 700; }
}

@media (prefers-reduced-motion: reduce) {
  body *, body *::before, body *::after { animation: none !important; transition-duration: .01ms !important; }
}

/* Keep secondary screens flat, like native banking app pages. */
#view-goals,
#view-history,
#view-safety {
  margin: 0;
  padding: 19px 16px 26px;
  background: #fff;
  border: 1px solid rgba(232,237,244,.8);
  border-radius: 24px;
  box-shadow: 0 8px 24px rgba(19,56,116,.08);
}
.page-header h1 { font-weight: 400; letter-spacing: -.025em; }
.page-intro { max-width: 46rem; }
.goal-card {
  border-color: #e9edf3;
  box-shadow: 0 4px 14px rgba(26,54,94,.04);
}
.goal-card.is-active {
  border-color: #d7e6fc;
  box-shadow: 0 4px 14px rgba(26,54,94,.04);
}
.goal-card-icon { background: #edf4ff; }
.active-tag { color: #286bd0; background: #edf4ff; }
.page-header .primary-button { font-weight: 700; }
.goal-card-title strong,
.section-heading h2,
.mission-copy strong,
.transaction-copy strong { font-weight: 700; }

@media (min-width: 760px) {
  #view-goals, #view-history, #view-safety { padding: 25px 22px 32px; }
}

.hero-actions { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.quick-action { gap: 4px; padding-inline: 4px; font-size: .68rem; }
.quick-action-icon { width: 20px; height: 20px; }
.transaction-item.is-withdrawal .transaction-mark { color: #a34e5d; background: #fff0f2; }
.transaction-item.is-withdrawal .transaction-amount strong { color: #a34e5d; }
.withdraw-balance {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 2px 0 18px;
  padding: 14px 16px;
  border: 1px solid #e9eef6;
  border-radius: 16px;
  background: #f7f9fc;
  color: var(--muted);
  font-size: .78rem;
}
.withdraw-balance strong { color: var(--ink); font-size: 1.12rem; font-weight: 700; }
#withdraw-dialog .confirm-checkbox { margin: 16px 0; }
#save-withdraw:disabled { opacity: .52; cursor: not-allowed; }

@media (max-width: 359px) {
  .quick-action { gap: 2px; font-size: .62rem; }
  .quick-action-icon { width: 18px; height: 18px; }
}

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

/* Keep icon badges centered; scope text rules to the copy, not every span in a card. */
.stat-symbol,
.mission-badge { display: grid; place-items: center; flex: 0 0 auto; line-height: 1; }
.stat-card > div { min-width: 0; }
.stat-card strong,
.mission-points,
.mission-badge,
.amount-row strong,
.goal-meta,
.history-summary strong,
.transaction-amount strong,
.money-input input {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}
.mission-list {
  grid-auto-flow: row;
  grid-auto-columns: auto;
  grid-template-columns: minmax(0, 1fr);
  overflow: visible;
  scroll-snap-type: none;
  padding: 0;
}
.mission-card {
  grid-template-columns: 40px minmax(0, 1fr) 78px;
  min-width: 0;
  gap: 12px;
}
.mission-copy { min-width: 0; }
.mission-copy strong,
.mission-copy > span { overflow-wrap: anywhere; }
.mission-points {
  min-width: 78px;
  text-align: right;
  justify-self: end;
  white-space: nowrap;
  font-size: .72rem;
}
.stat-card strong { font-variant-numeric: tabular-nums; }
.goal-spotlight.is-empty .progress-track { display: none; }
.goal-spotlight.is-empty .goal-meta { justify-content: flex-start; margin-top: 10px; }
.goal-spotlight.is-empty .amount-row strong { font-size: 1rem; color: var(--muted); }

@media (min-width: 760px) {
  .mission-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* History tools: compact monthly report and transaction maintenance. */
.history-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.history-actions .compact { min-height: 42px; padding-inline: 13px; }
.monthly-report { margin: 14px 0 18px; padding: 18px; border: 1px solid #e6edf7; border-radius: 22px; background: #fff; box-shadow: 0 8px 24px rgba(26,54,94,.045); }
.monthly-report-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.monthly-report-heading h2 { margin: 0; font-size: 1.12rem; font-weight: 700; }
.monthly-report-heading .eyebrow { margin: 0 0 3px; }
.month-picker-label { display: grid; gap: 4px; color: var(--muted); font-size: .68rem; }
.month-picker-label input { min-height: 40px; width: 145px; padding: 7px 9px; border: 1px solid #e2e9f2; border-radius: 12px; background: #f8faff; color: var(--ink); font: inherit; font-size: .78rem; }
.monthly-metrics { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 9px; margin: 16px 0; }
.monthly-metrics article { min-width: 0; padding: 12px 11px; border-radius: 15px; background: #f5f8fd; }
.monthly-metrics span, .monthly-metrics strong { display: block; }
.monthly-metrics span { color: var(--muted); font-size: .68rem; }
.monthly-metrics strong { margin-top: 5px; color: var(--ink); font-size: clamp(.82rem, 3.2vw, 1rem); font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.monthly-metrics strong.is-negative { color: #a34e5d; }
.monthly-target { padding-top: 14px; border-top: 1px solid #edf1f6; }
.monthly-target-top { display: flex; align-items: center; gap: 9px; }
.monthly-target-top > div { min-width: 0; flex: 1; }
.monthly-target-top > div strong, .monthly-target-top > div span { display: block; }
.monthly-target-top > div strong { font-size: .82rem; font-weight: 700; }
.monthly-target-top > div span { margin-top: 2px; color: var(--muted); font-size: .67rem; }
.monthly-target-top label { display: grid; gap: 3px; color: var(--muted); font-size: .62rem; }
.monthly-target-top input { width: 86px; min-height: 38px; padding: 6px 8px; border: 1px solid #e2e9f2; border-radius: 11px; background: #f8faff; color: var(--ink); font: inherit; font-size: .78rem; }
.monthly-target-top .compact { min-height: 38px; padding-inline: 10px; white-space: nowrap; }
.monthly-target .progress-track { margin-top: 13px; }
.monthly-target > p { margin: 7px 0 0; color: var(--muted); font-size: .68rem; }
.transaction-actions { display: flex; justify-content: flex-end; gap: 10px; }
.transaction-edit, .transaction-delete { border: 0; background: transparent; padding: 5px 0 0; color: #286bd0; font: inherit; font-size: .7rem; cursor: pointer; }
.transaction-delete { color: var(--muted); }
.transaction-edit:focus-visible, .transaction-delete:focus-visible { outline: 2px solid #286bd0; outline-offset: 3px; border-radius: 3px; }
.backup-overdue { border-color: #f0d8bc; background: linear-gradient(120deg,#fff6e8,#fffaf2); }
.backup-overdue .notice-icon { background: #fff0d8; color: #9b6418; }
.edit-transaction-note { margin: 0 0 12px; padding: 11px 12px; border-radius: 13px; background: #f1f6ff; color: var(--muted); font-size: .72rem; line-height: 1.55; }
#edit-transaction-dialog .field-label { margin-top: 12px; }

@media (max-width: 440px) {
  .page-header:has(.history-actions) { align-items: flex-start; flex-direction: column; }
  .history-actions { width: 100%; justify-content: flex-start; }
  .monthly-report { padding: 14px; border-radius: 18px; }
  .monthly-report-heading { align-items: flex-end; }
  .monthly-metrics { gap: 6px; }
  .monthly-metrics article { padding: 10px 8px; }
  .monthly-metrics span { font-size: .62rem; }
  .monthly-target-top { flex-wrap: wrap; }
  .monthly-target-top > div { flex-basis: 100%; }
}
