:root {
  --sky-top: #7ec8e3;
  --sky-mid: #a8dff0;
  --sky-bottom: #dff6e8;
  --sun: #ffd56b;
  --ink: #243447;
  --ink-soft: #4a6074;
  --paper: rgba(255, 255, 255, 0.78);
  --paper-strong: #fffdf8;
  --coral: #ff7a6b;
  --coral-deep: #ef5d4d;
  --teal: #2a9d8f;
  --teal-deep: #1f7f74;
  --gold: #e9c46a;
  --peach: #f4a261;
  --mint: #8fd6b5;
  --shadow: 0 18px 40px rgba(36, 52, 71, 0.14);
  --radius: 28px;
  --font-display: "Arial Rounded MT Bold", "Trebuchet MS", system-ui, sans-serif;
  --font-body: "Trebuchet MS", "Segoe UI", system-ui, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: linear-gradient(180deg, var(--sky-top) 0%, var(--sky-mid) 42%, var(--sky-bottom) 100%);
  min-height: 100vh;
  overflow-x: hidden;
}

button,
input,
select {
  font: inherit;
}

.hidden {
  display: none !important;
}

/* Atmosphere */
.sky {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.sun {
  position: absolute;
  top: 4vh;
  right: 8vw;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff4b8 0%, var(--sun) 55%, #f0b84a 100%);
  box-shadow: 0 0 0 14px rgba(255, 213, 107, 0.22);
  animation: sun-pulse 5s ease-in-out infinite;
}

.cloud {
  position: absolute;
  background: rgba(255, 255, 255, 0.78);
  border-radius: 999px;
  filter: blur(0.2px);
}

.cloud::before,
.cloud::after {
  content: "";
  position: absolute;
  background: inherit;
  border-radius: 50%;
}

.cloud-a {
  width: 140px;
  height: 46px;
  top: 12vh;
  left: -40px;
  animation: drift 28s linear infinite;
}

.cloud-a::before {
  width: 58px;
  height: 58px;
  top: -28px;
  left: 22px;
}

.cloud-a::after {
  width: 72px;
  height: 72px;
  top: -36px;
  left: 58px;
}

.cloud-b {
  width: 180px;
  height: 52px;
  top: 22vh;
  left: 30vw;
  opacity: 0.85;
  animation: drift 36s linear infinite reverse;
}

.cloud-b::before {
  width: 70px;
  height: 70px;
  top: -34px;
  left: 28px;
}

.cloud-b::after {
  width: 86px;
  height: 86px;
  top: -42px;
  left: 74px;
}

.cloud-c {
  width: 120px;
  height: 40px;
  top: 8vh;
  right: 18vw;
  opacity: 0.7;
  animation: drift 32s linear infinite;
}

.cloud-c::before {
  width: 50px;
  height: 50px;
  top: -24px;
  left: 18px;
}

.cloud-c::after {
  width: 62px;
  height: 62px;
  top: -30px;
  left: 48px;
}

@keyframes drift {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(40vw);
  }
}

@keyframes sun-pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

#app {
  position: relative;
  z-index: 1;
  min-height: 100vh;
}

.screen {
  min-height: 100vh;
}

/* Welcome */
.welcome-screen {
  display: grid;
  place-items: center;
  padding: 32px 20px 48px;
}

.welcome-stage {
  width: min(560px, 100%);
  text-align: center;
  animation: rise-in 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(28px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.mascot {
  width: min(220px, 56vw);
  margin: 0 auto 10px;
  animation: bob 3.2s ease-in-out infinite;
}

.mascot-logo-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
}

.mascot-logo {
  width: 100%;
  max-width: 220px;
  height: auto;
  display: block;
  filter: drop-shadow(0 16px 22px rgba(20, 45, 74, 0.18));
}

@keyframes bob {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

.brand {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 8vw, 4.2rem);
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: 0.02em;
  color: var(--paper-strong);
  text-shadow: 0 4px 0 rgba(36, 52, 71, 0.12);
}

.welcome-screen h1 {
  margin: 14px 0 10px;
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 4vw, 1.85rem);
  font-weight: 700;
  color: var(--ink);
  line-height: 1.2;
}

.welcome-sub {
  margin: 0 auto 28px;
  max-width: 34ch;
  color: var(--ink-soft);
  font-size: 1.05rem;
  line-height: 1.45;
}

.welcome-form {
  display: grid;
  gap: 12px;
  padding: 22px;
  background: var(--paper);
  backdrop-filter: blur(10px);
  border: 2px solid rgba(255, 255, 255, 0.7);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-align: left;
}

.welcome-form label {
  font-weight: 800;
  color: var(--ink);
}

.welcome-form input {
  width: 100%;
  border: 3px solid #d7ebf4;
  border-radius: 16px;
  padding: 14px 16px;
  background: var(--paper-strong);
  color: var(--ink);
  outline: none;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.welcome-form input:focus {
  border-color: var(--teal);
  transform: translateY(-1px);
}

.welcome-form .field-error {
  margin: 0;
  min-height: 1.2em;
}

.returning-kids {
  margin-top: 22px;
  padding: 18px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.55);
  border: 2px solid rgba(255, 255, 255, 0.7);
  text-align: left;
}

.returning-label {
  margin: 0 0 10px;
  font-weight: 800;
  color: var(--ink);
}

.returning-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.returning-btn {
  border: 2px solid rgba(42, 157, 143, 0.25);
  border-radius: 14px;
  padding: 10px 14px;
  background: #fff;
  color: var(--teal-deep);
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}

.returning-btn:hover {
  transform: translateY(-1px);
  background: #eef8f4;
}

/* Buttons */
.btn {
  border: none;
  border-radius: 16px;
  padding: 13px 18px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.btn:active {
  transform: translateY(1px) scale(0.98);
}

.btn-primary {
  background: linear-gradient(180deg, #39b7a6 0%, var(--teal) 100%);
  color: white;
  box-shadow: 0 8px 0 var(--teal-deep);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 0 var(--teal-deep);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.55);
  color: var(--ink);
  border: 2px solid rgba(255, 255, 255, 0.8);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.85);
}

/* Dashboard */
.dashboard-screen {
  padding: 18px 18px 48px;
}

.topbar {
  width: min(980px, 100%);
  margin: 0 auto 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  animation: rise-in 0.5s ease both;
}

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

.brand-mark {
  width: 54px;
  height: 54px;
  flex: 0 0 54px;
  display: block;
  object-fit: contain;
  filter: drop-shadow(0 7px 12px rgba(20, 45, 74, 0.18));
}

.brand-name {
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--paper-strong);
  text-shadow: 0 2px 0 rgba(36, 52, 71, 0.12);
}

.dashboard {
  width: min(980px, 100%);
  margin: 0 auto;
  display: grid;
  gap: 18px;
}

.hero-panel {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 16px;
  padding: 28px;
  border-radius: calc(var(--radius) + 4px);
  background:
    radial-gradient(circle at 85% 20%, rgba(255, 213, 107, 0.45), transparent 28%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.88), rgba(255, 255, 255, 0.62));
  border: 2px solid rgba(255, 255, 255, 0.75);
  box-shadow: var(--shadow);
  animation: rise-in 0.6s 0.05s ease both;
}

.eyebrow {
  margin: 0 0 6px;
  font-weight: 800;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--teal-deep);
}

.hero-copy h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 2.8rem);
  line-height: 1;
}

.hero-sub {
  margin: 10px 0 0;
  color: var(--ink-soft);
  max-width: 36ch;
  line-height: 1.45;
}

.total-balance {
  align-self: stretch;
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 18px 20px;
  border-radius: 22px;
  background: linear-gradient(160deg, var(--teal) 0%, #248f83 100%);
  color: white;
  box-shadow: 0 10px 0 #1a6d64;
}

.total-label {
  font-weight: 700;
  opacity: 0.9;
}

.total-amount {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 6vw, 3rem);
  line-height: 1;
  font-weight: 800;
}

.member-since {
  font-size: 0.9rem;
  opacity: 0.88;
}

.legacy-meter-panel {
  display: grid;
  grid-template-columns: 1.55fr 0.8fr;
  gap: 18px;
  padding: 24px;
  border-radius: var(--radius);
  border: 2px solid rgba(255, 255, 255, 0.75);
  box-shadow: var(--shadow);
  background:
    linear-gradient(180deg, rgba(42, 157, 143, 0.12), transparent 45%),
    var(--paper-strong);
  animation: rise-in 0.65s 0.1s ease both;
}

.legacy-meter-main {
  min-width: 0;
}

.legacy-meter-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
}

.legacy-meter-head h3 {
  margin: 4px 0 0;
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 4vw, 2.2rem);
  line-height: 1;
}

.goal-status {
  margin: 0;
  padding: 8px 12px;
  border-radius: 14px;
  background: #e7f6f1;
  color: var(--teal-deep);
  font-weight: 800;
  white-space: nowrap;
}

.goal-status.goal-reached {
  background: #ffe9a8;
  color: #8b6914;
}

.goal-numbers {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.goal-stat {
  display: grid;
  gap: 2px;
  padding: 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(36, 52, 71, 0.06);
}

.goal-stat-label {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--ink-soft);
}

.goal-stat strong {
  font-family: var(--font-display);
  font-size: 1.35rem;
  line-height: 1.1;
}

.journey {
  margin-bottom: 14px;
}

.journey-track {
  position: relative;
  height: 18px;
  border-radius: 999px;
  background: #e7f3ef;
  margin: 10px 8px 8px;
}

.journey-fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--mint), var(--teal));
  transition: width 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

.journey-marker {
  position: absolute;
  top: 50%;
  left: 0%;
  width: 26px;
  height: 26px;
  margin-left: -13px;
  margin-top: -13px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff4b8, var(--gold) 60%, #d4a63a);
  border: 3px solid white;
  box-shadow: 0 4px 10px rgba(36, 52, 71, 0.18);
  transition: left 0.55s cubic-bezier(0.22, 1, 0.36, 1);
  z-index: 2;
}

.journey-tick {
  position: absolute;
  top: -22px;
  transform: translateX(-50%);
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--ink-soft);
}

.journey-ends {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--ink-soft);
}

.journey-ends span:last-child {
  max-width: 50%;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--teal-deep);
}

.goal-track {
  height: 12px;
  border-radius: 999px;
  background: #e7f3ef;
  overflow: hidden;
}

.goal-fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--mint), var(--teal));
  transition: width 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

.goal-detail {
  margin: 10px 0 0;
  color: var(--ink-soft);
  font-size: 0.98rem;
  font-weight: 700;
}

.legacy-meter-meter {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 10px;
}

.legacy-meter-jar {
  position: relative;
  width: 140px;
  height: 170px;
  border: 5px solid #7eb8aa;
  border-top: none;
  border-radius: 0 0 48px 48px;
  background: rgba(255, 255, 255, 0.55);
  overflow: hidden;
  box-shadow: inset 0 -10px 20px rgba(42, 157, 143, 0.08);
}

.legacy-meter-rim {
  position: absolute;
  top: 0;
  left: -8px;
  right: -8px;
  height: 14px;
  border-radius: 10px;
  background: #2a9d8f;
  z-index: 2;
}

.legacy-meter-fill {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 0%;
  background:
    radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.35), transparent 35%),
    linear-gradient(180deg, #9fe0c4 0%, var(--teal) 100%);
  transition: height 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

.legacy-meter-percent {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 1;
  font-family: var(--font-display);
  font-size: 2rem;
  color: var(--ink);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.7);
}

.legacy-meter-meter-label {
  margin: 0;
  font-weight: 800;
  color: var(--ink-soft);
}

.goals-section {
  padding: 22px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.8);
  border: 2px solid rgba(255, 255, 255, 0.75);
  box-shadow: var(--shadow);
  animation: rise-in 0.68s 0.12s ease both;
}

.goals-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 12px;
}

.goal-card {
  display: grid;
  gap: 10px;
  width: 100%;
  padding: 16px;
  text-align: left;
  border: 2px solid rgba(36, 52, 71, 0.08);
  border-radius: 20px;
  background: rgba(255, 253, 248, 0.95);
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.goal-card:hover {
  transform: translateY(-2px);
  border-color: rgba(42, 157, 143, 0.35);
}

.goal-card.is-active {
  border-color: var(--teal);
  background: #f3fbf8;
  box-shadow: 0 8px 0 rgba(42, 157, 143, 0.18);
}

.goal-card.is-reached {
  background: #fff8e4;
}

.goal-card-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}

.goal-card-name {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.25rem;
  line-height: 1.1;
}

.goal-card-meta {
  margin: 4px 0 0;
  color: var(--ink-soft);
  font-weight: 700;
  font-size: 0.92rem;
}

.goal-card-percent {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--teal-deep);
}

.goal-card-track {
  height: 12px;
  border-radius: 999px;
  background: #e7f3ef;
  overflow: hidden;
}

.goal-card-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--mint), var(--teal));
}

.goal-card-foot {
  margin: 0;
  color: var(--ink-soft);
  font-weight: 700;
  font-size: 0.92rem;
}

.math-challenge {
  display: grid;
  gap: 12px;
  margin-bottom: 4px;
}

.math-question {
  margin: 0;
  padding: 16px;
  text-align: center;
  font-family: var(--font-display);
  font-size: 2.2rem;
  line-height: 1;
  border-radius: 18px;
  background: #eef8f4;
  color: var(--teal-deep);
}

.section-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.55rem;
}

.actions {
  animation: rise-in 0.7s 0.15s ease both;
}

.action-grid {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.action-btn {
  display: grid;
  justify-items: start;
  gap: 4px;
  text-align: left;
  padding: 16px;
  border: 2px solid rgba(255, 255, 255, 0.8);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease;
  position: relative;
}

.action-btn:hover {
  transform: translateY(-3px);
  background: #fff;
}

.action-icon {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  margin-bottom: 6px;
  position: relative;
}

.action-icon::before,
.action-icon::after {
  content: "";
  position: absolute;
}

.withdraw-icon {
  background: #ffd0c8;
}

.withdraw-icon::before {
  left: 12px;
  right: 12px;
  top: 19px;
  height: 5px;
  background: var(--ink);
  border-radius: 3px;
}

.goal-icon {
  background: #d7e9ff;
}

.goal-icon::before {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--coral);
  top: 13px;
  left: 13px;
}

.goal-icon::after {
  width: 4px;
  height: 14px;
  background: var(--ink);
  top: 20px;
  left: 27px;
  transform: rotate(28deg);
  border-radius: 2px;
}

.action-label {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
}

.action-desc {
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.activity {
  padding: 22px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.8);
  border: 2px solid rgba(255, 255, 255, 0.75);
  box-shadow: var(--shadow);
  animation: rise-in 0.75s 0.2s ease both;
}

.activity-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}

.activity-sub {
  margin: 0;
  color: var(--ink-soft);
  font-weight: 700;
}

.transaction-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.transaction-item {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-radius: 18px;
  background: rgba(255, 253, 248, 0.9);
  border: 1px solid rgba(36, 52, 71, 0.06);
}

.txn-badge {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--ink);
}

.txn-badge.deposit {
  background: #ffe3a3;
}

.txn-badge.withdraw {
  background: #ffd0c8;
}

.txn-main {
  min-width: 0;
}

.txn-note {
  margin: 0;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.txn-meta {
  margin: 2px 0 0;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.txn-amount {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 800;
  white-space: nowrap;
}

.txn-amount.plus {
  color: var(--teal-deep);
}

.txn-amount.minus {
  color: var(--coral-deep);
}

.empty-state {
  margin: 8px 0 0;
  padding: 22px;
  text-align: center;
  color: var(--ink-soft);
  font-weight: 700;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.55);
}

/* Modal */
.modal {
  border: none;
  padding: 0;
  background: transparent;
  max-width: calc(100vw - 28px);
}

.modal::backdrop {
  background: rgba(36, 52, 71, 0.42);
  backdrop-filter: blur(3px);
}

.modal-card {
  width: min(420px, 100%);
  margin: auto;
  padding: 24px;
  border-radius: 26px;
  background: var(--paper-strong);
  border: 2px solid rgba(255, 255, 255, 0.85);
  box-shadow: var(--shadow);
  position: relative;
  animation: pop-in 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes pop-in {
  from {
    opacity: 0;
    transform: scale(0.94) translateY(10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 12px;
  background: #eef5f8;
  color: var(--ink);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

.modal-card h3 {
  margin: 0 28px 6px 0;
  font-family: var(--font-display);
  font-size: 1.7rem;
}

.modal-sub {
  margin: 0 0 18px;
  color: var(--ink-soft);
}

.modal-fields {
  display: grid;
  gap: 12px;
}

.field {
  display: grid;
  gap: 6px;
}

.field label {
  font-weight: 800;
}

.field input,
.field select {
  width: 100%;
  border: 3px solid #d7ebf4;
  border-radius: 14px;
  padding: 12px 14px;
  background: #fff;
  outline: none;
}

.field input:focus,
.field select:focus {
  border-color: var(--teal);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

.field-error {
  color: var(--coral-deep);
  font-weight: 700;
  font-size: 0.92rem;
  min-height: 1.2em;
}

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(120%);
  z-index: 40;
  padding: 12px 18px;
  border-radius: 999px;
  background: var(--ink);
  color: white;
  font-weight: 800;
  box-shadow: var(--shadow);
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
}

/* Pop balance animation */
.balance-pop {
  animation: balance-pop 0.45s ease;
}

@keyframes balance-pop {
  0% {
    transform: scale(1);
  }
  40% {
    transform: scale(1.08);
  }
  100% {
    transform: scale(1);
  }
}

@media (max-width: 840px) {
  .hero-panel,
  .legacy-meter-panel,
  .goals-list {
    grid-template-columns: 1fr;
  }

  .action-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 520px) {
  .dashboard-screen {
    padding: 14px 12px 40px;
  }

  .hero-panel,
  .legacy-meter-panel,
  .goals-section,
  .activity,
  .welcome-form {
    padding: 18px;
  }

  .goal-numbers {
    grid-template-columns: 1fr;
  }

  .action-grid {
    grid-template-columns: 1fr;
  }


  .transaction-item {
    grid-template-columns: 42px 1fr;
  }

  .txn-amount {
    grid-column: 2;
    justify-self: start;
  }

  .sun {
    width: 78px;
    height: 78px;
  }
}

/* --------------------------------------------------------------------------
   Buddy avatar + layout refresh
   Keeps the existing playful theme while making the welcome screen compact,
   responsive, and easy for children to scan.
   -------------------------------------------------------------------------- */

.welcome-screen {
  padding: clamp(18px, 3vw, 36px);
}

.welcome-stage {
  width: min(1080px, 100%);
  display: grid;
  grid-template-columns: minmax(280px, 0.82fr) minmax(520px, 1.18fr);
  align-items: center;
  gap: clamp(20px, 4vw, 48px);
  text-align: left;
}

.welcome-intro {
  position: relative;
  padding: clamp(8px, 2vw, 24px);
}

.welcome-intro::before,
.welcome-intro::after {
  content: "";
  position: absolute;
  z-index: -1;
  border-radius: 50%;
  filter: blur(1px);
}

.welcome-intro::before {
  width: 88px;
  height: 88px;
  top: 14%;
  right: 8%;
  background: rgba(255, 213, 107, 0.35);
}

.welcome-intro::after {
  width: 54px;
  height: 54px;
  left: 4%;
  bottom: 16%;
  background: rgba(255, 122, 107, 0.2);
}

.welcome-intro .mascot {
  width: clamp(126px, 15vw, 176px);
  margin: 0 0 8px;
}

.welcome-intro .brand {
  font-size: clamp(3rem, 6vw, 4.5rem);
}

.welcome-screen h1 {
  max-width: 13ch;
  margin: 18px 0 10px;
  font-size: clamp(1.65rem, 3.6vw, 2.45rem);
}

.welcome-sub {
  max-width: 35ch;
  margin: 0 0 20px;
  font-size: 1.08rem;
}

.welcome-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.welcome-badges span {
  padding: 7px 11px;
  border: 2px solid rgba(255, 255, 255, 0.68);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.52);
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 800;
  box-shadow: 0 4px 12px rgba(36, 52, 71, 0.06);
}

.welcome-card {
  padding: 12px;
  border: 2px solid rgba(255, 255, 255, 0.72);
  border-radius: 34px;
  background: rgba(255, 255, 255, 0.44);
  box-shadow: 0 24px 60px rgba(36, 52, 71, 0.16);
  backdrop-filter: blur(14px);
}

.welcome-form {
  gap: 11px;
  padding: clamp(18px, 3vw, 26px);
  border: 0;
  border-radius: 25px;
  background:
    radial-gradient(circle at 94% 5%, rgba(255, 213, 107, 0.2), transparent 26%),
    rgba(255, 253, 248, 0.96);
  box-shadow: none;
}

.form-heading {
  margin-bottom: 2px;
}

.form-heading .eyebrow {
  margin-bottom: 2px;
}

.form-heading h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.55rem, 3vw, 1.95rem);
  line-height: 1.05;
}

.welcome-form input {
  padding: 12px 15px;
  border-width: 2px;
}

.avatar-fieldset {
  min-width: 0;
  margin: 4px 0 0;
  padding: 0;
  border: 0;
}

.avatar-fieldset legend {
  margin-bottom: 8px;
  padding: 0;
  color: var(--ink);
  font-weight: 800;
}

.avatar-picker {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 9px;
}

.avatar-option {
  position: relative;
  min-width: 0;
  display: grid;
  justify-items: center;
  gap: 5px;
  padding: 7px 5px 8px;
  overflow: hidden;
  border: 2px solid rgba(36, 52, 71, 0.08);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.84);
  color: var(--ink-soft);
  cursor: pointer;
  user-select: none;
  transition:
    transform 0.16s ease,
    border-color 0.16s ease,
    box-shadow 0.16s ease,
    background 0.16s ease;
}

.avatar-option:nth-child(5n + 1) {
  background: #f1fbf6;
}

.avatar-option:nth-child(5n + 2) {
  background: #eef8ff;
}

.avatar-option:nth-child(5n + 3) {
  background: #fff8df;
}

.avatar-option:nth-child(5n + 4) {
  background: #fff0ed;
}

.avatar-option:nth-child(5n + 5) {
  background: #f2f7f4;
}

.avatar-option:hover {
  transform: translateY(-2px);
  border-color: rgba(42, 157, 143, 0.38);
  box-shadow: 0 8px 16px rgba(36, 52, 71, 0.1);
}

.avatar-option:focus-within {
  outline: 3px solid rgba(42, 157, 143, 0.28);
  outline-offset: 2px;
}

.avatar-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.avatar-option img {
  display: block;
  width: min(68px, 100%);
  aspect-ratio: 1;
  border-radius: 50%;
  object-fit: cover;
  box-shadow:
    0 0 0 3px rgba(255, 255, 255, 0.9),
    0 5px 12px rgba(36, 52, 71, 0.12);
  transition: transform 0.18s ease;
}

.avatar-option:hover img {
  transform: scale(1.04) rotate(-1deg);
}

.avatar-option span {
  max-width: 100%;
  overflow: hidden;
  color: inherit;
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.avatar-option.is-selected,
.avatar-option:has(input:checked) {
  border-color: var(--teal);
  background: #eaf8f3;
  color: var(--teal-deep);
  box-shadow: 0 6px 0 rgba(42, 157, 143, 0.18);
  transform: translateY(-2px);
}

.avatar-option.is-selected::after,
.avatar-option:has(input:checked)::after {
  content: "✓";
  position: absolute;
  top: 5px;
  right: 5px;
  width: 21px;
  height: 21px;
  display: grid;
  place-items: center;
  border: 2px solid white;
  border-radius: 50%;
  background: var(--teal);
  color: white;
  font-size: 0.72rem;
  font-weight: 900;
  box-shadow: 0 3px 8px rgba(36, 52, 71, 0.16);
}

.avatar-picker-modal {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: stretch;
  gap: clamp(10px, 1.8vw, 16px);
}

.avatar-picker-modal .avatar-option {
  flex: 1 1 96px;
  min-width: 82px;
  max-width: 116px;
  min-height: 118px;
  padding: 10px 8px 11px;
}

.avatar-picker-modal .avatar-option img {
  width: clamp(64px, 9vw, 84px);
}

/* The post-login buddy chooser expands with the viewport instead of
   squeezing ten choices into the standard banking-action dialog. */
.avatar-choice-modal {
  width: min(720px, calc(100vw - 24px));
  max-width: none;
  max-height: calc(100dvh - 24px);
}

.avatar-choice-modal .modal-card {
  width: 100%;
  max-height: calc(100dvh - 24px);
  display: flex;
  flex-direction: column;
  padding: clamp(20px, 3vw, 30px);
  overflow: hidden;
}

.avatar-choice-modal .modal-sub {
  margin-bottom: 12px;
}

.avatar-choice-modal .modal-fields {
  min-height: 0;
  max-height: calc(100dvh - 220px);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  padding: 5px 5px 12px;
  margin: -5px;
}

.avatar-choice-modal .modal-actions {
  position: relative;
  z-index: 1;
  margin: 14px -4px -4px;
  padding: 14px 4px 4px;
  border-top: 1px solid rgba(36, 52, 71, 0.1);
  background: var(--paper-strong);
}

.returning-kids {
  margin: 10px 6px 4px;
  padding: 14px;
  border-radius: 21px;
  background: rgba(255, 255, 255, 0.62);
}

.returning-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 8px;
}

.returning-btn {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 11px;
  text-align: left;
}

.returning-avatar {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  display: block;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 0 2px white;
}

/* Dashboard avatar treatment */
.profile-row {
  display: flex;
  align-items: center;
  gap: 15px;
}

.profile-avatar-btn {
  position: relative;
  flex: 0 0 auto;
  width: 84px;
  height: 84px;
  padding: 0;
  border: 4px solid white;
  border-radius: 50%;
  background: #eaf8f3;
  box-shadow:
    0 0 0 3px rgba(42, 157, 143, 0.24),
    0 10px 22px rgba(36, 52, 71, 0.16);
  cursor: pointer;
  overflow: visible;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.profile-avatar-btn::after {
  content: "✦";
  position: absolute;
  right: -4px;
  bottom: -3px;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 3px solid white;
  border-radius: 50%;
  background: var(--coral);
  color: white;
  font-size: 0.8rem;
  box-shadow: 0 4px 10px rgba(36, 52, 71, 0.17);
}

.profile-avatar-btn:hover {
  transform: translateY(-2px) rotate(-1deg);
  box-shadow:
    0 0 0 4px rgba(42, 157, 143, 0.24),
    0 13px 24px rgba(36, 52, 71, 0.18);
}

.profile-avatar-btn:focus-visible {
  outline: 4px solid rgba(42, 157, 143, 0.34);
  outline-offset: 4px;
}

.profile-avatar {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: inherit;
  object-fit: cover;
}

.hero-panel {
  grid-template-columns: minmax(0, 1.35fr) minmax(250px, 0.75fr);
}

.hero-copy {
  min-width: 0;
}

.hero-copy h2 {
  overflow-wrap: anywhere;
}

.total-balance {
  min-width: 0;
}

.btn:focus-visible,
.action-btn:focus-visible,
.goal-card:focus-visible,
.returning-btn:focus-visible,
.modal-close:focus-visible {
  outline: 4px solid rgba(42, 157, 143, 0.32);
  outline-offset: 3px;
}

@media (max-width: 920px) {
  .welcome-stage {
    grid-template-columns: 1fr;
    width: min(660px, 100%);
    gap: 12px;
  }

  .welcome-intro {
    display: grid;
    justify-items: center;
    padding: 0 14px 8px;
    text-align: center;
  }

  .welcome-intro .mascot {
    width: 118px;
    margin-bottom: 0;
  }

  .welcome-screen h1 {
    max-width: 20ch;
    margin-top: 10px;
  }

  .welcome-sub {
    margin-bottom: 14px;
  }

  .welcome-badges {
    justify-content: center;
  }
}

@media (max-width: 700px) {
  .avatar-picker {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }


  .hero-panel {
    grid-template-columns: 1fr;
  }

  .total-balance {
    min-height: 150px;
  }
}

@media (max-width: 480px) {
  .welcome-screen {
    padding: 14px 10px 28px;
  }

  .welcome-intro .mascot {
    width: 100px;
  }

  .welcome-intro .brand {
    font-size: clamp(2.65rem, 14vw, 3.5rem);
  }

  .welcome-screen h1 {
    font-size: 1.45rem;
  }

  .welcome-sub {
    font-size: 0.98rem;
  }

  .welcome-badges span {
    font-size: 0.74rem;
  }

  .welcome-card {
    padding: 7px;
    border-radius: 27px;
  }

  .welcome-form {
    padding: 17px 14px;
    border-radius: 21px;
  }

  .avatar-picker {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .avatar-choice-modal {
    width: calc(100vw - 12px);
    max-height: calc(100dvh - 12px);
  }

  .avatar-choice-modal .modal-card {
    max-height: calc(100dvh - 12px);
    padding: 18px 14px 14px;
    border-radius: 22px;
  }

  .avatar-picker-modal {
    gap: 8px;
  }

  .avatar-picker-modal .avatar-option {
    flex-basis: 88px;
    min-width: 78px;
    max-width: 106px;
    min-height: 106px;
    padding: 8px 5px 9px;
  }

  .avatar-option {
    border-radius: 16px;
  }

  .avatar-option img {
    width: min(62px, 100%);
  }

  .avatar-option span {
    font-size: 0.75rem;
  }

  .profile-avatar-btn {
    width: 68px;
    height: 68px;
  }

  .profile-row {
    gap: 12px;
  }

  .profile-avatar-btn::after {
    width: 24px;
    height: 24px;
  }

  .hero-copy h2 {
    font-size: clamp(1.75rem, 10vw, 2.3rem);
  }
}

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

/* Keep the status toast completely off-screen until it is needed. */
.toast {
  opacity: 0;
  visibility: hidden;
  transform: translateX(-50%) translateY(calc(100% + 56px));
}

.toast.show {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}


/* Parent admin page */
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.btn-parent,
.btn-parent-top {
  background: linear-gradient(180deg, #fff4bb 0%, var(--gold) 100%);
  color: #665017;
  border: 2px solid rgba(255, 255, 255, 0.82);
  box-shadow: 0 6px 0 #bd9235;
}

.btn-parent:hover,
.btn-parent-top:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 0 #bd9235;
}

.parent-entry {
  margin: 10px 12px 12px;
  padding: 13px 14px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(255, 244, 187, 0.86), rgba(255, 255, 255, 0.88));
  border: 2px dashed rgba(189, 146, 53, 0.48);
}

.parent-entry > span:first-child {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 14px;
  background: white;
  font-size: 1.2rem;
}

.parent-entry div {
  display: grid;
  gap: 2px;
}

.parent-entry strong {
  font-family: var(--font-display);
}

.parent-entry div span {
  color: var(--ink-soft);
  font-size: 0.83rem;
  line-height: 1.3;
}

.parent-entry .btn {
  padding: 10px 13px;
  border-radius: 13px;
  font-size: 0.88rem;
}

.admin-screen {
  min-height: 100vh;
  padding: 18px 18px 54px;
}

.admin-shell {
  width: min(1040px, 100%);
  margin: 0 auto;
  display: grid;
  gap: 18px;
}

.admin-hero {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 24px 28px;
  border-radius: 30px;
  background:
    radial-gradient(circle at 88% 20%, rgba(255, 213, 107, 0.48), transparent 27%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.91), rgba(255, 250, 225, 0.8));
  border: 2px solid rgba(255, 255, 255, 0.78);
  box-shadow: var(--shadow);
}

.admin-hero-icon {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  border-radius: 24px;
  background: linear-gradient(145deg, #fff7cf, var(--gold));
  box-shadow: inset 0 -7px 0 rgba(139, 105, 20, 0.15), 0 10px 22px rgba(139, 105, 20, 0.18);
  font-size: 2rem;
}

.admin-hero h1,
.admin-panel h2,
.admin-gate-card h2,
.admin-deposit-card h3,
.admin-summary-card h3 {
  font-family: var(--font-display);
}

.admin-hero h1 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1;
}

.admin-hero p:last-child {
  margin: 8px 0 0;
  color: var(--ink-soft);
}

.admin-gate-card {
  width: min(570px, 100%);
  margin: 20px auto 0;
  padding: 34px;
  text-align: center;
  border-radius: 30px;
  background: var(--paper-strong);
  border: 2px solid rgba(255, 255, 255, 0.86);
  box-shadow: 0 24px 55px rgba(36, 52, 71, 0.18);
}

.gate-badge {
  width: 70px;
  height: 70px;
  margin: -4px auto 15px;
  display: grid;
  place-items: center;
  border-radius: 23px;
  background: linear-gradient(145deg, #ffcf85, var(--peach));
  color: white;
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 900;
  box-shadow: inset 0 -7px 0 rgba(139, 77, 25, 0.15);
}

.admin-gate-card h2 {
  margin: 4px 0 8px;
  font-size: clamp(1.55rem, 4vw, 2.15rem);
}

.admin-help {
  margin: 0 auto 20px;
  max-width: 42ch;
  color: var(--ink-soft);
  line-height: 1.45;
}

.admin-gate-form {
  display: grid;
  gap: 14px;
  max-width: 340px;
  margin: 0 auto;
}

.admin-math-question {
  margin: 2px 0 0;
  padding: 20px 16px;
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(143, 214, 181, 0.3), rgba(126, 200, 227, 0.25));
  border: 2px dashed rgba(42, 157, 143, 0.48);
  font-family: var(--font-display);
  font-size: clamp(2.1rem, 8vw, 3.2rem);
  letter-spacing: 0.03em;
}

.admin-answer-field {
  text-align: left;
}

.admin-answer-field input {
  text-align: center;
  font-size: 1.35rem;
  font-weight: 800;
}

.admin-panel {
  display: grid;
  gap: 18px;
}

.admin-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 4px 4px 0;
}

.admin-panel-head h2 {
  margin: 0;
  font-size: clamp(1.65rem, 4vw, 2.25rem);
}

.admin-lock-btn {
  color: var(--ink);
}

.admin-kid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(235px, 1fr));
  gap: 12px;
}

.admin-kid-card {
  width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 13px;
  text-align: left;
  border: 3px solid transparent;
  border-radius: 23px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 10px 26px rgba(36, 52, 71, 0.1);
  color: var(--ink);
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.admin-kid-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 30px rgba(36, 52, 71, 0.15);
}

.admin-kid-card.is-selected {
  border-color: var(--teal);
  background: #f4fffb;
  box-shadow: 0 0 0 4px rgba(42, 157, 143, 0.13), 0 14px 30px rgba(36, 52, 71, 0.13);
}

.admin-kid-card img {
  width: 60px;
  height: 60px;
  object-fit: contain;
  border-radius: 18px;
  background: linear-gradient(145deg, #fff7cf, #dff6e8);
}

.admin-kid-card-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.admin-kid-card-copy strong {
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: var(--font-display);
  font-size: 1.08rem;
}

.admin-kid-card-copy small {
  color: var(--ink-soft);
}

.admin-kid-balance {
  font-family: var(--font-display);
  font-weight: 900;
  color: var(--teal-deep);
  white-space: nowrap;
}

.admin-empty-state {
  grid-column: 1 / -1;
  display: grid;
  gap: 4px;
  padding: 24px;
  text-align: center;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.78);
  border: 2px dashed rgba(74, 96, 116, 0.25);
}

.admin-empty-state span {
  color: var(--ink-soft);
}

.admin-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(300px, 0.95fr);
  gap: 18px;
  align-items: start;
}

.admin-deposit-card,
.admin-summary-card {
  padding: 24px;
  border-radius: 28px;
  background: var(--paper-strong);
  border: 2px solid rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow);
}

.admin-deposit-card {
  display: grid;
  gap: 15px;
}

.admin-card-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 2px;
}

.admin-card-heading h3 {
  margin: 0;
  font-size: 1.65rem;
}

.admin-card-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: linear-gradient(145deg, #b5ead4, var(--mint));
  color: #176a5e;
  font-size: 1.7rem;
  font-weight: 900;
}

.field-hint {
  margin: 7px 2px 0;
  color: var(--ink-soft);
  font-size: 0.82rem;
  line-height: 1.35;
}

.money-input-wrap {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  overflow: hidden;
  border: 2px solid rgba(74, 96, 116, 0.22);
  border-radius: 16px;
  background: white;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.money-input-wrap:focus-within {
  border-color: var(--teal);
  box-shadow: 0 0 0 4px rgba(42, 157, 143, 0.13);
}

.money-input-wrap > span {
  padding-left: 15px;
  color: var(--teal-deep);
  font-size: 1.25rem;
  font-weight: 900;
}

.money-input-wrap input {
  border: 0 !important;
  box-shadow: none !important;
  padding-left: 8px !important;
}

.quick-amounts {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: -5px;
}

.quick-amounts button {
  padding: 9px 8px;
  border: 2px solid rgba(42, 157, 143, 0.22);
  border-radius: 13px;
  background: #ecfaf5;
  color: var(--teal-deep);
  font-weight: 900;
  cursor: pointer;
}

.quick-amounts button:hover {
  background: #d8f3e9;
  border-color: var(--teal);
}

.admin-deposit-card button:disabled,
.admin-deposit-card input:disabled,
.admin-deposit-card select:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.admin-summary-card {
  position: sticky;
  top: 16px;
  display: grid;
  gap: 18px;
  background:
    radial-gradient(circle at 92% 8%, rgba(255, 213, 107, 0.4), transparent 25%),
    var(--paper-strong);
}

.admin-summary-profile {
  display: flex;
  align-items: center;
  gap: 14px;
}

.admin-summary-profile img {
  width: 74px;
  height: 74px;
  object-fit: contain;
  border-radius: 22px;
  background: linear-gradient(145deg, #fff7cf, #dff6e8);
}

.admin-summary-profile h3 {
  margin: 0 0 3px;
  font-size: 1.7rem;
}

.admin-summary-profile span {
  color: var(--ink-soft);
  font-size: 0.86rem;
}

.admin-summary-balance {
  display: grid;
  gap: 3px;
  padding: 18px;
  border-radius: 21px;
  background: linear-gradient(145deg, var(--teal), #238b80);
  color: white;
  box-shadow: 0 8px 0 #196a62;
}

.admin-summary-balance span {
  font-weight: 700;
  opacity: 0.9;
}

.admin-summary-balance strong {
  font-family: var(--font-display);
  font-size: 2.25rem;
  line-height: 1;
}

.admin-goal-mini-list {
  display: grid;
  gap: 13px;
}

.admin-goal-mini {
  display: grid;
  gap: 7px;
}

.admin-goal-mini > div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.88rem;
}

.admin-goal-mini > div:first-child span {
  color: var(--ink-soft);
  white-space: nowrap;
}

.admin-mini-track {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #e5eef1;
}

.admin-mini-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--mint), var(--teal));
}

.admin-no-goals,
.admin-summary-card > p {
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.45;
}

.summary-empty-icon {
  font-size: 2.5rem;
}

@media (max-width: 760px) {
  .parent-entry {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .parent-entry .btn {
    grid-column: 1 / -1;
    width: 100%;
  }

  .admin-workspace {
    grid-template-columns: 1fr;
  }

  .admin-summary-card {
    position: static;
    order: -1;
  }

  .admin-panel-head {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 520px) {
  .topbar-actions {
    gap: 7px;
  }

  .topbar-actions .btn {
    padding: 9px 10px;
    border-radius: 12px;
    font-size: 0.78rem;
  }

  .admin-screen {
    padding: 12px 10px 34px;
  }

  .admin-hero {
    padding: 19px;
    align-items: flex-start;
  }

  .admin-hero-icon {
    width: 56px;
    height: 56px;
    border-radius: 18px;
    font-size: 1.45rem;
  }

  .admin-hero h1 {
    font-size: 1.8rem;
  }

  .admin-gate-card,
  .admin-deposit-card,
  .admin-summary-card {
    padding: 19px 16px;
    border-radius: 23px;
  }

  .admin-kid-cards {
    grid-template-columns: 1fr;
  }

  .admin-kid-card {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .admin-kid-balance {
    grid-column: 2;
  }

  .quick-amounts {
    grid-template-columns: repeat(2, 1fr);
  }

  .admin-goal-mini > div:first-child {
    display: grid;
  }
}

/* v1.3 — account-first goals */
.account-overview {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(340px, 0.85fr);
  gap: 22px;
  align-items: center;
  padding: 24px;
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 8% 0%, rgba(233, 196, 106, 0.28), transparent 34%),
    rgba(255, 253, 248, 0.94);
  border: 2px solid rgba(255, 255, 255, 0.78);
  box-shadow: var(--shadow);
  animation: rise-in 0.65s 0.1s ease both;
}

.account-overview-copy h3 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: clamp(1.45rem, 3vw, 2rem);
}

.account-overview-copy p:last-child {
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.55;
}

.account-overview-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.account-stat {
  min-width: 0;
  display: grid;
  align-content: center;
  gap: 5px;
  min-height: 112px;
  padding: 14px;
  border-radius: 18px;
  background: #eef8f4;
  border: 1px solid rgba(42, 157, 143, 0.18);
  text-align: center;
}

.account-stat:first-child {
  background: #fff7de;
  border-color: rgba(233, 196, 106, 0.38);
}

.account-stat span {
  color: var(--ink-soft);
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1.25;
}

.account-stat strong {
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 3vw, 1.7rem);
  color: var(--teal-deep);
}

.goals-heading-row {
  align-items: flex-start;
}

.btn-small {
  min-height: 38px;
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 0.88rem;
}

#show-archived-goals span {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  min-height: 22px;
  margin-left: 5px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(36, 52, 71, 0.1);
}

.goal-card {
  position: relative;
  overflow: hidden;
  min-height: 168px;
}

.goal-card::after {
  content: "→";
  position: absolute;
  right: 14px;
  bottom: 12px;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(42, 157, 143, 0.12);
  color: var(--teal-deep);
  font-weight: 900;
}

.goal-card.is-reached::before {
  content: "Affordable";
  position: absolute;
  top: 0;
  right: 0;
  padding: 5px 11px;
  border-radius: 0 17px 0 14px;
  background: var(--gold);
  color: #5e4708;
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.goal-empty-state {
  grid-column: 1 / -1;
  display: grid;
  gap: 5px;
  text-align: center;
}

.goal-detail-panel {
  position: relative;
  margin-top: 16px;
  padding: 22px;
  border-radius: 24px;
  background:
    radial-gradient(circle at 100% 0%, rgba(255, 213, 107, 0.4), transparent 30%),
    linear-gradient(145deg, #f3fbf8, #ffffff);
  border: 2px solid rgba(42, 157, 143, 0.26);
  box-shadow: 0 12px 28px rgba(36, 52, 71, 0.1);
}

.goal-detail-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(36, 52, 71, 0.08);
  color: var(--ink);
  font-size: 1.35rem;
  cursor: pointer;
}

.goal-detail-heading {
  display: flex;
  gap: 14px;
  align-items: center;
  padding-right: 36px;
}

.goal-detail-icon {
  flex: 0 0 auto;
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: #fff4ca;
  font-size: 1.8rem;
}

.goal-detail-heading h4 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 4vw, 2rem);
}

.goal-detail-heading p:last-child {
  margin: 5px 0 0;
  color: var(--ink-soft);
  line-height: 1.45;
}

.goal-detail-numbers {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 20px 0 14px;
}

.goal-detail-numbers > div {
  display: grid;
  gap: 4px;
  padding: 13px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid rgba(36, 52, 71, 0.08);
}

.goal-detail-numbers span {
  color: var(--ink-soft);
  font-size: 0.82rem;
  font-weight: 800;
}

.goal-detail-numbers strong {
  font-family: var(--font-display);
  font-size: 1.28rem;
}

.selected-goal-track {
  height: 18px;
  overflow: hidden;
  border-radius: 999px;
  background: #dfeee9;
  box-shadow: inset 0 2px 4px rgba(36, 52, 71, 0.08);
}

.selected-goal-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--mint), var(--teal), #e9c46a);
  transition: width 0.45s ease;
}

.goal-detail-progress-copy {
  margin: 10px 0 0;
  color: var(--ink-soft);
  font-weight: 700;
  line-height: 1.45;
}

.goal-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.btn-secondary {
  border: 2px solid rgba(42, 157, 143, 0.35);
  background: #eef8f4;
  color: var(--teal-deep);
}

.btn-danger-quiet {
  border: 2px solid rgba(239, 93, 77, 0.22);
  background: #fff4f2;
  color: #b33d31;
}

.archived-goals-panel {
  margin-top: 16px;
  padding: 18px;
  border-radius: 22px;
  background: rgba(36, 52, 71, 0.055);
  border: 1px dashed rgba(36, 52, 71, 0.22);
}

.archived-goals-head h4 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.25rem;
}

.archived-goals-head p {
  margin: 4px 0 0;
  color: var(--ink-soft);
}

.archived-goals-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.archived-goal-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.84);
}

.archived-goal-item > div:first-child {
  display: grid;
  gap: 3px;
}

.archived-goal-item small {
  color: var(--ink-soft);
}

.archived-goal-badge {
  width: max-content;
  padding: 3px 8px;
  border-radius: 999px;
  background: #e8ecef;
  color: var(--ink-soft);
  font-size: 0.7rem;
  font-weight: 900;
  text-transform: uppercase;
}

.archived-goal-actions {
  display: flex;
  gap: 8px;
}

.purchase-confirm-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 20px;
  padding: 16px;
  border-radius: 18px;
  background: #eef8f4;
}

.purchase-confirm-card span {
  color: var(--ink-soft);
  font-weight: 700;
}

.purchase-confirm-card strong {
  text-align: right;
  font-family: var(--font-display);
}

.admin-account-display {
  padding: 13px 14px;
  border: 2px solid rgba(42, 157, 143, 0.2);
  border-radius: 14px;
  background: #eef8f4;
  color: var(--teal-deep);
  font-weight: 900;
}

.txn-badge.purchase {
  background: #fff0c5;
  color: #7b5a00;
}

@media (max-width: 820px) {
  .account-overview {
    grid-template-columns: 1fr;
  }

  .account-overview-stats {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 620px) {
  .account-overview,
  .goal-detail-panel {
    padding: 18px;
  }

  .account-overview-stats,
  .goal-detail-numbers {
    grid-template-columns: 1fr;
  }

  .account-stat {
    min-height: 78px;
    text-align: left;
    grid-template-columns: 1fr auto;
    align-items: center;
  }

  .goals-list {
    grid-template-columns: 1fr;
  }

  .goals-heading-row,
  .archived-goal-item {
    align-items: stretch;
    flex-direction: column;
  }

  .goal-detail-actions,
  .archived-goal-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .goal-detail-actions .btn,
  .archived-goal-actions .btn {
    width: 100%;
  }
}

/* v1.4 account login and PIN flow */
.account-access-card {
  align-self: center;
}

.account-flow-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem;
  margin-bottom: 1.35rem;
  padding: 0.35rem;
  border: 1px solid rgba(36, 83, 107, 0.13);
  border-radius: 1rem;
  background: rgba(236, 246, 248, 0.9);
}

.account-flow-tab {
  min-height: 2.85rem;
  border: 0;
  border-radius: 0.75rem;
  background: transparent;
  color: #47616e;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.account-flow-tab:hover {
  color: #174f62;
}

.account-flow-tab.is-active {
  background: #ffffff;
  color: #174f62;
  box-shadow: 0 7px 18px rgba(29, 78, 94, 0.12);
}

.account-flow-tab:active {
  transform: translateY(1px);
}

.account-flow-panel .form-heading p:last-child {
  margin: 0.45rem 0 0;
  color: #607986;
  line-height: 1.5;
}

.account-login-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  max-height: 23rem;
  overflow-y: auto;
  padding: 0.1rem 0.15rem 0.2rem;
}

.account-login-btn.returning-btn {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.75rem;
  min-height: 5rem;
  width: 100%;
  padding: 0.75rem;
  text-align: left;
  border: 1px solid rgba(35, 88, 108, 0.14);
  border-radius: 1rem;
  background: #fff;
  box-shadow: 0 7px 18px rgba(25, 70, 88, 0.07);
}

.account-login-btn.returning-btn:hover {
  border-color: rgba(42, 157, 143, 0.42);
  box-shadow: 0 10px 24px rgba(25, 70, 88, 0.12);
  transform: translateY(-2px);
}

.account-login-btn .returning-avatar {
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 50%;
  object-fit: cover;
  background: #eaf7f4;
  border: 2px solid #d6efea;
}

.returning-account-copy {
  display: grid;
  gap: 0.15rem;
  min-width: 0;
}

.returning-account-copy strong {
  overflow: hidden;
  color: #213f4d;
  font-size: 1rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.returning-account-copy small {
  color: #6a808a;
  font-size: 0.78rem;
  font-weight: 700;
}

.returning-arrow {
  color: #2a9d8f;
  font-size: 1.75rem;
  line-height: 1;
}

.login-empty {
  display: grid;
  justify-items: center;
  gap: 0.5rem;
  padding: 1.6rem 1rem;
  text-align: center;
  border: 1px dashed rgba(36, 83, 107, 0.24);
  border-radius: 1rem;
  background: rgba(246, 251, 252, 0.82);
}

.login-empty > span {
  font-size: 2.1rem;
}

.login-empty strong {
  color: #244654;
  font-size: 1.05rem;
}

.login-empty p {
  margin: 0 0 0.45rem;
  color: #657d88;
}

.pin-field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}

.pin-field-grid .field {
  margin: 0;
}

#kid-pin,
#kid-pin-confirm,
#account-pin,
#account-pin-confirm {
  letter-spacing: 0.55em;
  font-size: 1.18rem;
  font-weight: 800;
  text-align: center;
}

.pin-help {
  margin: -0.3rem 0 0.85rem;
  color: #687f89;
  font-size: 0.82rem;
  line-height: 1.45;
}

.logout-btn {
  min-width: 6.5rem;
}

.auth-card {
  max-width: 28rem;
}

.auth-profile {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 0.2rem 0 0.9rem;
}

.auth-profile img {
  width: 4.75rem;
  height: 4.75rem;
  flex: 0 0 auto;
  border: 4px solid #dff4ef;
  border-radius: 50%;
  background: #edf8f6;
  object-fit: cover;
  box-shadow: 0 7px 18px rgba(29, 89, 91, 0.14);
}

.auth-profile h3 {
  margin: 0.2rem 0 0;
}

.admin-pin-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(37, 83, 101, 0.12);
}

.admin-pin-tools > div {
  display: grid;
  gap: 0.2rem;
}

.admin-pin-tools strong {
  color: #234452;
}

.admin-pin-tools span {
  color: #6b818b;
  font-size: 0.82rem;
}

@media (max-width: 720px) {
  .account-login-list,
  .pin-field-grid {
    grid-template-columns: 1fr;
  }

  .account-login-list {
    max-height: none;
  }

  .account-login-btn.returning-btn {
    min-height: 4.7rem;
  }

  .admin-pin-tools {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-pin-tools .btn {
    width: 100%;
  }
}

@media (max-width: 430px) {
  .account-flow-tabs {
    margin-bottom: 1rem;
  }

  .account-flow-tab {
    min-height: 2.65rem;
    font-size: 0.9rem;
  }

  .auth-profile img {
    width: 4rem;
    height: 4rem;
  }
}


/* v1.5 parent account reset and deletion controls */
.btn-danger {
  border: 2px solid #b72f25;
  background: linear-gradient(145deg, #ef5d4d, #d94336);
  color: #fff;
  box-shadow: 0 6px 0 #a42f27;
}

.btn-danger:hover {
  transform: translateY(-1px);
  background: linear-gradient(145deg, #f36b5c, #dc493d);
}

.btn-danger:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 #a42f27;
}

.admin-account-tools {
  display: grid;
  gap: 0.85rem;
  margin-top: 0.15rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(37, 83, 101, 0.12);
}

.admin-account-tools-heading,
.admin-account-tools-heading > div {
  display: grid;
  gap: 0.2rem;
}

.admin-account-tools-heading strong { color: #234452; }
.admin-account-tools-heading span {
  color: #6b818b;
  font-size: 0.82rem;
  line-height: 1.4;
}

.admin-account-tool-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}

.admin-account-tool-actions .btn { width: 100%; }
.admin-account-confirm-card { max-width: 31rem; }

.account-danger-icon {
  display: grid;
  place-items: center;
  width: 4.4rem;
  height: 4.4rem;
  margin: 0 auto 0.8rem;
  border-radius: 1.4rem;
  background: #fff0dd;
  color: #a75b00;
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 900;
  box-shadow: inset 0 -6px 0 rgba(167, 91, 0, 0.12);
}

.account-danger-icon.is-delete {
  background: #fff0ed;
  color: #c53d31;
  box-shadow: inset 0 -6px 0 rgba(197, 61, 49, 0.12);
}

.admin-account-confirm-card > .eyebrow,
.admin-account-confirm-card > h3,
.admin-account-confirm-card > .modal-sub { text-align: center; }

.account-impact-list {
  margin: 0.8rem 0 1rem;
  padding: 1rem 1.1rem;
  border: 1px solid rgba(188, 65, 53, 0.18);
  border-radius: 1rem;
  background: #fff8f6;
  color: #4d555b;
  line-height: 1.5;
}
.account-impact-list p { margin: 0; }
.account-impact-list ul { margin: 0.55rem 0; padding-left: 1.25rem; }
.account-impact-warning { color: #b43d32; font-weight: 900; }

@media (max-width: 520px) {
  .admin-account-tool-actions { grid-template-columns: 1fr; }
  .admin-account-confirm-card .modal-actions { grid-template-columns: 1fr; }
  .admin-account-confirm-card .modal-actions .btn { width: 100%; }
}

/* Multi-family PHP application additions — v2.2 */
.family-signup-stage {
  align-items: start;
}

.family-auth-card {
  max-width: 650px;
}

.family-auth-form {
  gap: 16px;
}

.family-auth-form .field {
  min-width: 0;
}

.family-auth-form select,
.family-auth-form input {
  width: 100%;
  border: 2px solid rgba(45, 52, 54, 0.12);
  border-radius: 14px;
  padding: 13px 14px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

.family-auth-form select:focus,
.family-auth-form input:focus {
  border-color: var(--teal);
  outline: 3px solid rgba(42, 157, 143, 0.15);
}

.family-url-preview {
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(42, 157, 143, 0.09);
  color: #226f66;
  font-size: 0.86rem;
  overflow-wrap: anywhere;
}

.family-safety-note {
  grid-template-columns: auto 1fr;
}

.loading-card {
  max-width: 580px;
  margin: auto;
  text-align: center;
}

.loading-card h1 {
  margin: 8px 0 14px;
  font-size: clamp(1.9rem, 5vw, 3rem);
  color: var(--ink);
}

.loading-card p:not(.eyebrow) {
  margin: 0 0 20px;
  color: var(--ink-soft);
}

.admin-hero {
  position: relative;
}

.admin-hero-action {
  margin-left: auto;
  align-self: center;
  white-space: nowrap;
}

.family-summary-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.family-summary-pills span {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(42, 157, 143, 0.09);
  color: #32645f;
  font-size: 0.82rem;
}

.family-summary-pills strong {
  color: var(--teal-deep);
  font-size: 0.95rem;
}

#family-link-display a {
  color: var(--teal-deep);
  font-weight: 700;
  overflow-wrap: anywhere;
}

.admin-profile-tools,
.admin-pin-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 18px;
  padding: 15px 0 0;
  border-top: 1px solid rgba(45, 52, 54, 0.1);
}

.admin-profile-tools > div,
.admin-pin-tools > div {
  display: grid;
  gap: 3px;
}

.admin-profile-tools strong,
.admin-pin-tools strong {
  color: var(--ink);
}

.admin-profile-tools span,
.admin-pin-tools span {
  color: var(--ink-soft);
  font-size: 0.84rem;
}

.parent-tools-modal.avatar-choice-modal .modal-card {
  width: min(920px, calc(100vw - 32px));
}

.parent-tools-modal.avatar-choice-modal .modal-fields {
  overflow: auto;
}

#parent-modal-form {
  max-height: min(90vh, 820px);
}

#parent-modal-content {
  overflow-y: auto;
  padding-right: 3px;
}

#parent-modal-content .avatar-fieldset {
  margin-top: 2px;
}

.admin-empty-state .btn {
  margin-top: 8px;
}

@media (max-width: 760px) {
  .admin-hero-action {
    width: 100%;
    margin-left: 0;
  }

  .family-summary-pills {
    justify-content: flex-start;
  }

  .admin-profile-tools,
  .admin-pin-tools {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 520px) {
  .family-auth-card {
    padding: 18px;
  }

  .family-auth-form .pin-field-grid {
    grid-template-columns: 1fr;
  }

  .topbar-actions {
    gap: 6px;
  }

  .topbar-actions .btn {
    padding-inline: 10px;
    font-size: 0.8rem;
  }
}

/* Email verification flow */
.verification-inline-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 2px 0 0;
  padding: 13px 15px;
  border: 1px solid rgba(79, 119, 255, 0.18);
  border-radius: 15px;
  background: rgba(79, 119, 255, 0.07);
  color: #43506a;
  font-size: 0.88rem;
  line-height: 1.45;
}

.verification-inline-note span:first-child {
  flex: 0 0 auto;
  font-size: 1.15rem;
}

.verification-sent-panel {
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 28px 12px 12px;
  text-align: center;
}

.verification-sent-panel.hidden {
  display: none;
}

.verification-sent-panel h3,
.verification-sent-panel p {
  margin: 0;
}

.verification-sent-panel h3 {
  color: var(--ink);
  font-size: clamp(1.45rem, 3vw, 2rem);
}

.verification-sent-panel > p:not(.eyebrow):not(.field-hint):not(.field-error) {
  max-width: 480px;
  color: var(--ink-soft);
  line-height: 1.6;
}

.verification-sent-icon {
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  border-radius: 24px;
  background: linear-gradient(145deg, #e9f4ff, #f1edff);
  box-shadow: 0 12px 26px rgba(79, 99, 180, 0.14);
  font-size: 2.25rem;
}

.field-error.is-success-message {
  color: #267457;
}

.verification-page {
  min-height: 100vh;
  overflow-x: hidden;
  background: linear-gradient(180deg, #dff2ff 0%, #f6f2ff 52%, #fffaf2 100%);
}

.verification-wrap {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 28px 16px;
}

.verification-card {
  display: grid;
  justify-items: center;
  width: min(560px, 100%);
  padding: clamp(28px, 6vw, 48px);
  border: 1px solid rgba(55, 72, 120, 0.12);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 24px 60px rgba(60, 70, 120, 0.18);
  text-align: center;
}

.verification-card h1 {
  margin: 8px 0 10px;
  color: var(--ink);
  font-size: clamp(1.8rem, 5vw, 2.7rem);
  line-height: 1.15;
}

.verification-card > p:not(.brand):not(.verification-family):not(.field-hint) {
  max-width: 440px;
  margin: 0 0 24px;
  color: var(--ink-soft);
  font-size: 1.02rem;
  line-height: 1.65;
}

.verification-icon {
  display: grid;
  place-items: center;
  width: 84px;
  height: 84px;
  border-radius: 50%;
  color: #fff;
  font-size: 2.5rem;
  font-weight: 900;
  box-shadow: 0 14px 30px rgba(47, 158, 115, 0.26);
}

.verification-card.is-success .verification-icon {
  background: linear-gradient(145deg, #35b980, #23855e);
}

.verification-card.is-error .verification-icon {
  background: linear-gradient(145deg, #ef6b72, #c44252);
  box-shadow: 0 14px 30px rgba(196, 66, 82, 0.22);
}

.verification-family {
  margin: 0 0 12px;
  color: var(--teal-deep);
  font-weight: 800;
}

.verification-secondary-link {
  margin-top: 16px;
  color: var(--teal-deep);
  font-weight: 800;
  text-decoration: none;
}

.verification-secondary-link:hover,
.verification-secondary-link:focus-visible {
  text-decoration: underline;
}

.verification-card .field-hint {
  max-width: 430px;
  margin-top: 16px;
}

/* Registration form alignment refresh — v2.3.1 */
.family-auth-card {
  width: 100%;
  max-width: 720px;
}

.signup-form {
  gap: 14px;
}

.signup-section {
  min-width: 0;
  margin: 0;
  padding: 15px;
  border: 1px solid rgba(36, 83, 107, 0.12);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.68);
}

.signup-section legend {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 7px;
  color: #244654;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 800;
}

.signup-section legend span {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 9px;
  background: linear-gradient(145deg, #dff5ef, #ccece5);
  color: var(--teal-deep);
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 900;
  box-shadow: inset 0 -2px 0 rgba(42, 157, 143, 0.12);
}

.signup-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 14px 16px;
}

.signup-field {
  align-content: start;
  min-width: 0;
}

.signup-field-wide {
  grid-column: 1 / -1;
}

.signup-field label {
  min-height: 1.35em;
  color: #294956;
  line-height: 1.25;
}

.family-auth-form .signup-field input,
.family-auth-form .signup-field select {
  min-height: 52px;
  margin: 0;
  border-color: rgba(36, 83, 107, 0.16);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.family-auth-form .signup-field input:hover,
.family-auth-form .signup-field select:hover {
  border-color: rgba(42, 157, 143, 0.4);
}

.family-auth-form .signup-field input:focus,
.family-auth-form .signup-field select:focus {
  transform: translateY(-1px);
  box-shadow: 0 0 0 4px rgba(42, 157, 143, 0.12);
}

.family-auth-form .signup-field select {
  cursor: pointer;
}

.signup-field .field-hint {
  min-height: 2.5em;
  margin: 0;
  color: #687f89;
  font-size: 0.78rem;
  line-height: 1.35;
}

.email-match-status.is-success {
  color: #267457;
  font-weight: 800;
}

.email-match-status.is-error {
  color: var(--coral-deep);
  font-weight: 800;
}

.family-auth-form .signup-field input[aria-invalid="true"] {
  border-color: var(--coral);
  background: #fff9f7;
  box-shadow: 0 0 0 4px rgba(231, 111, 81, 0.1);
}

.signup-submit {
  width: 100%;
  min-height: 52px;
}

@media (max-width: 900px) {
  .family-signup-stage {
    grid-template-columns: minmax(240px, 0.72fr) minmax(500px, 1.28fr);
  }
}

@media (max-width: 760px) {
  .family-signup-stage {
    grid-template-columns: 1fr;
  }

  .family-auth-card {
    max-width: 680px;
    justify-self: center;
  }
}

@media (max-width: 620px) {
  .signup-form-grid {
    grid-template-columns: 1fr;
  }

  .signup-field-wide {
    grid-column: auto;
  }

  .signup-field .field-hint {
    min-height: 0;
  }
}

@media (max-width: 430px) {
  .family-auth-card {
    padding: 10px;
    border-radius: 26px;
  }

  .signup-section {
    padding: 13px 12px;
    border-radius: 16px;
  }

  .family-auth-form .signup-field input,
  .family-auth-form .signup-field select {
    min-height: 50px;
  }
}

/* Keep native inputs and selects exactly aligned in registration rows. */
.family-auth-form .signup-field input,
.family-auth-form .signup-field select {
  height: 52px;
}

@media (max-width: 430px) {
  .family-auth-form .signup-field input,
  .family-auth-form .signup-field select {
    height: 50px;
  }
}

/* Parent money controls and family deletion — v2.4.0 */
#family-link-display {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  max-width: none;
  margin: 7px 0 0;
}

#family-link-display a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 11px;
  border-radius: 999px;
  background: rgba(42, 157, 143, 0.11);
  color: var(--teal-deep);
  font-weight: 800;
  text-decoration: none;
}

#family-link-display a:hover {
  background: rgba(42, 157, 143, 0.18);
  text-decoration: underline;
}

.admin-money-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  padding: 5px;
  border-radius: 17px;
  background: rgba(36, 52, 71, 0.07);
}

.admin-money-tabs button {
  min-height: 42px;
  padding: 9px 12px;
  border: 0;
  border-radius: 13px;
  background: transparent;
  color: var(--ink-soft);
  font: inherit;
  font-weight: 850;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.admin-money-tabs button:hover {
  color: var(--ink);
}

.admin-money-tabs button.is-active {
  background: white;
  color: var(--teal-deep);
  box-shadow: 0 5px 15px rgba(36, 52, 71, 0.12);
}

.admin-money-tabs button:focus-visible {
  outline: 4px solid rgba(42, 157, 143, 0.28);
  outline-offset: 2px;
}

.btn-withdraw {
  background: linear-gradient(180deg, #ffb98d 0%, #f08a61 100%);
  color: white;
  border: 2px solid rgba(255, 255, 255, 0.82);
  box-shadow: 0 6px 0 #bb5d3e;
}

.btn-withdraw:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 0 #bb5d3e;
}

.btn-withdraw:active {
  transform: translateY(3px);
  box-shadow: 0 3px 0 #bb5d3e;
}

.btn-withdraw:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}


.parent-security-zone {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  padding: 22px 24px;
  margin-top: 22px;
  border: 2px solid rgba(42, 157, 143, 0.2);
  border-radius: 25px;
  background: linear-gradient(135deg, rgba(241, 250, 249, 0.96), rgba(255, 255, 255, 0.9));
  box-shadow: 0 12px 28px rgba(42, 86, 94, 0.08);
}

.parent-security-zone h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 3vw, 1.75rem);
}

.parent-security-zone p:last-child {
  margin: 8px 0 0;
  color: var(--ink-soft);
  line-height: 1.45;
}

.parent-security-email {
  font-weight: 700;
  color: var(--teal-deep);
}

.parent-security-zone .btn {
  flex: 0 0 auto;
}

.family-danger-zone {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  padding: 22px 24px;
  border: 2px solid rgba(190, 67, 67, 0.22);
  border-radius: 25px;
  background: linear-gradient(135deg, rgba(255, 244, 241, 0.94), rgba(255, 255, 255, 0.88));
  box-shadow: 0 12px 28px rgba(112, 40, 40, 0.08);
}

.family-danger-zone h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 3vw, 1.75rem);
}

.family-danger-zone p:last-child {
  max-width: 64ch;
  margin: 7px 0 0;
  color: var(--ink-soft);
  line-height: 1.45;
}

.family-danger-zone .btn {
  flex: 0 0 auto;
}

.delete-family-modal .modal-card {
  width: min(540px, calc(100vw - 24px));
}

.delete-family-modal .account-impact-list {
  margin-bottom: 14px;
}

.delete-family-modal .field + .field {
  margin-top: 12px;
}

@media (max-width: 680px) {
  .brand-mark {
    width: 48px;
    height: 48px;
    flex-basis: 48px;
  }

  .parent-security-zone,
  .family-danger-zone {
    align-items: stretch;
    flex-direction: column;
    padding: 20px;
  }

  .parent-security-zone .btn,
  .family-danger-zone .btn {
    width: 100%;
  }

  #family-link-display {
    align-items: flex-start;
    flex-direction: column;
  }
}


/* v2.5.0 — responsive parent child-profile editor dialog */
html:has(dialog[open]) {
  overflow: hidden;
}

.parent-tools-modal {
  width: min(480px, calc(100vw - 24px));
  max-width: none;
  max-height: calc(100dvh - 24px);
  margin: auto;
  overflow: visible;
}

.parent-tools-modal .modal-card {
  width: 100%;
  max-height: calc(100dvh - 24px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.parent-tools-modal .modal-fields {
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  padding: 2px 5px 8px 2px;
}

.parent-tools-modal .modal-actions {
  flex: 0 0 auto;
  margin: 14px -4px -4px;
  padding: 14px 4px 4px;
  border-top: 1px solid rgba(36, 52, 71, 0.1);
  background: var(--paper-strong);
}

.parent-tools-modal.parent-profile-modal {
  width: min(900px, calc(100vw - 24px));
}

.parent-tools-modal.parent-profile-modal .modal-card {
  padding: clamp(20px, 2.6vw, 30px);
}

.parent-tools-modal.parent-profile-modal .modal-sub {
  margin-bottom: 12px;
}

.parent-tools-modal.parent-profile-modal .avatar-fieldset {
  min-width: 0;
  margin: 4px 0 0;
  padding: 0;
  border: 0;
}

.parent-tools-modal.parent-profile-modal .avatar-fieldset legend {
  margin-bottom: 9px;
  padding: 0;
  color: var(--ink);
  font-weight: 800;
}

.parent-tools-modal.parent-profile-modal .avatar-picker-modal {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  align-items: stretch;
  justify-content: stretch;
  gap: clamp(9px, 1.4vw, 14px);
}

.parent-tools-modal.parent-profile-modal .avatar-picker-modal .avatar-option {
  min-width: 0;
  max-width: none;
  min-height: 116px;
  padding: 10px 7px 11px;
}

.parent-tools-modal.parent-profile-modal .avatar-picker-modal .avatar-option img {
  width: clamp(62px, 8vw, 82px);
}

@media (max-width: 640px) {
  .parent-tools-modal,
  .parent-tools-modal.parent-profile-modal {
    width: calc(100vw - 12px);
    max-height: calc(100dvh - 12px);
  }

  .parent-tools-modal .modal-card,
  .parent-tools-modal.parent-profile-modal .modal-card {
    max-height: calc(100dvh - 12px);
    padding: 18px 14px 14px;
    border-radius: 22px;
  }

  .parent-tools-modal .modal-card h3 {
    font-size: clamp(1.35rem, 7vw, 1.65rem);
  }

  .parent-tools-modal.parent-profile-modal .avatar-picker-modal {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .parent-tools-modal.parent-profile-modal .avatar-picker-modal .avatar-option {
    min-height: 104px;
    padding: 8px 5px 9px;
  }

  .parent-tools-modal.parent-profile-modal .avatar-picker-modal .avatar-option img {
    width: min(62px, 100%);
  }
}

@media (max-width: 390px) {
  .parent-tools-modal.parent-profile-modal .avatar-picker-modal {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .parent-tools-modal .modal-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .parent-tools-modal .modal-actions .btn {
    width: 100%;
    min-width: 0;
  }
}

.link-button{appearance:none;border:0;background:none;color:inherit;text-decoration:underline;font:inherit;font-weight:700;cursor:pointer;padding:.2rem .35rem}.link-button:hover{text-decoration:none}.link-button:focus-visible{outline:3px solid currentColor;outline-offset:2px;border-radius:.35rem}

/* --------------------------------------------------------------------------
   Tiny Bank child dashboard navigation + bank-card refresh (v2.8.0)
   -------------------------------------------------------------------------- */
html {
  scroll-behavior: smooth;
}

.nav-icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.dashboard-screen {
  --bank-green-950: #062f2c;
  --bank-green-900: #073d38;
  --bank-green-800: #0a5149;
  --bank-green-700: #0e695e;
  --bank-gold: #e1b84a;
  --bank-gold-deep: #b98822;
  --bank-cream: #fffaf0;
  --bank-lilac: #f2efff;
  min-height: 100dvh;
  padding: 0 18px 58px;
  background:
    radial-gradient(circle at 88% 8%, rgba(225, 184, 74, 0.15), transparent 23rem),
    radial-gradient(circle at 5% 32%, rgba(42, 157, 143, 0.10), transparent 24rem),
    linear-gradient(180deg, #fffdf8 0%, #faf8f4 100%);
}

.dashboard-screen .dashboard-anchor {
  scroll-margin-top: 116px;
}

.dashboard-screen .topbar {
  position: sticky;
  top: 12px;
  z-index: 30;
  width: min(1180px, 100%);
  min-height: 76px;
  margin: 0 auto 22px;
  padding: 9px 12px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  border: 1px solid rgba(6, 47, 44, 0.10);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 16px 38px rgba(24, 45, 43, 0.12);
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
}

.dashboard-screen .topbar-brand {
  min-width: max-content;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--bank-green-950);
  text-decoration: none;
}

.dashboard-screen .brand-mark {
  width: 56px;
  height: 56px;
  flex: 0 0 56px;
  object-fit: contain;
  filter: drop-shadow(0 6px 9px rgba(6, 47, 44, 0.18));
}

.dashboard-screen .brand-name {
  color: var(--bank-green-950);
  font-size: clamp(1.28rem, 2vw, 1.65rem);
  text-shadow: none;
  letter-spacing: -0.02em;
}

.child-nav-desktop {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(3px, 0.7vw, 9px);
}

.child-nav-link,
.mobile-nav-link {
  appearance: none;
  border: 0;
  font: inherit;
  text-decoration: none;
  cursor: pointer;
}

.child-nav-link {
  min-height: 46px;
  padding: 9px clamp(9px, 1.2vw, 15px);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: 14px;
  background: transparent;
  color: #27413e;
  font-weight: 800;
  white-space: nowrap;
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.child-nav-link svg,
.mobile-new-goal-btn svg,
.mobile-nav-link > svg,
.mobile-nav-plus svg {
  width: 21px;
  height: 21px;
  flex: 0 0 21px;
  fill: currentColor;
}

.child-nav-link:hover,
.child-nav-link:focus-visible {
  background: #eff8f5;
  color: var(--bank-green-800);
  transform: translateY(-1px);
}

.child-nav-link.is-active {
  background: linear-gradient(180deg, #0e695e, #073d38);
  color: #fff;
  box-shadow: 0 6px 14px rgba(7, 61, 56, 0.22);
}

.child-nav-new-goal {
  background: linear-gradient(180deg, #0e695e, #073d38);
  color: white;
  box-shadow: 0 6px 0 #052d29;
}

.child-nav-new-goal:hover,
.child-nav-new-goal:focus-visible {
  background: linear-gradient(180deg, #147d6f, #0a5149);
  color: white;
  box-shadow: 0 8px 0 #052d29;
}

.topbar-profile {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
}

.nav-profile-button {
  min-width: 0;
  min-height: 48px;
  padding: 4px 8px 4px 4px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid rgba(6, 47, 44, 0.10);
  border-radius: 999px;
  background: #fffaf0;
  color: var(--bank-green-950);
  font-weight: 800;
  cursor: pointer;
}

.nav-profile-button:hover,
.nav-profile-button:focus-visible {
  outline: 3px solid rgba(14, 105, 94, 0.18);
  outline-offset: 2px;
}

.dashboard-screen .profile-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 0 2px #fff, 0 3px 8px rgba(6, 47, 44, 0.18);
}

.dashboard-screen .topbar-actions {
  display: flex;
  align-items: center;
  gap: 5px;
}

.dashboard-screen .topbar-utility {
  min-height: 42px;
  padding: 8px 11px;
  border: 1px solid rgba(6, 47, 44, 0.11);
  background: #fff;
  color: var(--bank-green-950);
  box-shadow: none;
  font-size: 0.82rem;
}

.dashboard-screen .topbar-utility:hover {
  background: #f2f8f6;
}

.mobile-goal-bar,
.child-nav-mobile {
  display: none;
}

.dashboard-screen .dashboard {
  width: min(1180px, 100%);
  gap: 20px;
}

.dashboard-screen .hero-panel {
  position: relative;
  overflow: hidden;
  grid-template-columns: minmax(250px, 0.82fr) minmax(390px, 1.18fr);
  align-items: center;
  gap: clamp(22px, 4vw, 54px);
  padding: clamp(24px, 4vw, 44px);
  border: 1px solid rgba(6, 47, 44, 0.08);
  background:
    radial-gradient(circle at 13% 18%, rgba(225, 184, 74, 0.18), transparent 20rem),
    rgba(255, 255, 255, 0.92);
  box-shadow: 0 22px 55px rgba(24, 45, 43, 0.11);
}

.dashboard-screen .hero-panel::before {
  content: "";
  position: absolute;
  width: 220px;
  height: 220px;
  left: -90px;
  bottom: -120px;
  border-radius: 50%;
  background: rgba(42, 157, 143, 0.08);
  pointer-events: none;
}

.dashboard-screen .hero-copy {
  position: relative;
  z-index: 1;
}

.dashboard-screen .profile-row {
  align-items: center;
  gap: 17px;
}

.hero-profile-avatar {
  width: clamp(78px, 9vw, 112px);
  height: clamp(78px, 9vw, 112px);
  flex: 0 0 auto;
  border-radius: 50%;
  object-fit: cover;
  background: #eaf6f3;
  box-shadow: 0 0 0 5px white, 0 12px 28px rgba(6, 47, 44, 0.16);
}

.dashboard-screen .hero-copy h2 {
  color: var(--bank-green-950);
  font-size: clamp(2rem, 4vw, 3.15rem);
}

.dashboard-screen .hero-sub {
  max-width: 35ch;
  margin-top: 8px;
  color: #536762;
  font-size: 1rem;
}

.parent-managed-note {
  width: fit-content;
  max-width: 42ch;
  margin: 20px 0 0;
  padding: 9px 12px;
  border: 1px solid rgba(6, 47, 44, 0.09);
  border-radius: 14px;
  background: #f5faf8;
  color: #45605b;
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1.35;
}

.dashboard-screen .total-balance {
  position: relative;
  isolation: isolate;
  min-height: 246px;
  width: 100%;
  overflow: hidden;
  align-content: stretch;
  gap: 0;
  padding: clamp(21px, 3vw, 30px);
  border: 2px solid rgba(225, 184, 74, 0.92);
  border-radius: 27px;
  background:
    radial-gradient(circle at 12% 7%, rgba(255, 255, 255, 0.13), transparent 25%),
    linear-gradient(145deg, #0d6a61 0%, #074c46 43%, #042f2d 100%);
  color: white;
  box-shadow: 0 18px 36px rgba(4, 47, 45, 0.25), 0 7px 0 #b98822;
}

.dashboard-screen .total-balance::before,
.dashboard-screen .total-balance::after {
  content: "";
  position: absolute;
  z-index: -1;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.dashboard-screen .total-balance::before {
  width: 310px;
  height: 310px;
  right: -140px;
  bottom: -205px;
  box-shadow: 0 0 0 34px rgba(255, 255, 255, 0.025), 0 0 0 68px rgba(255, 255, 255, 0.018);
}

.dashboard-screen .total-balance::after {
  width: 170px;
  height: 170px;
  left: -105px;
  top: -115px;
  background: rgba(225, 184, 74, 0.05);
}

.bank-card-top,
.bank-card-middle,
.bank-card-footer {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.bank-card-top {
  align-items: flex-start;
}

.dashboard-screen .total-label {
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.contactless-mark {
  width: 42px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  transform: rotate(8deg);
}

.contactless-mark i {
  display: block;
  height: 28px;
  border-right: 3px solid white;
  border-radius: 50%;
  opacity: 0.94;
}

.contactless-mark i:nth-child(1) { width: 10px; height: 14px; }
.contactless-mark i:nth-child(2) { width: 10px; height: 22px; }
.contactless-mark i:nth-child(3) { width: 10px; height: 30px; }

.bank-card-middle {
  flex: 1;
  justify-content: flex-start;
  gap: 20px;
  padding: 18px 0 16px;
}

.bank-card-chip {
  width: 54px;
  height: 42px;
  flex: 0 0 54px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  overflow: hidden;
  border: 2px solid #f8d774;
  border-radius: 9px;
  background: linear-gradient(135deg, #f8df83, #c89425);
  box-shadow: inset 0 0 0 1px rgba(90, 54, 5, 0.22);
}

.bank-card-chip i {
  border: 1px solid rgba(101, 65, 7, 0.36);
}

.dashboard-screen .total-amount {
  font-size: clamp(2.55rem, 6vw, 4.25rem);
  letter-spacing: -0.035em;
  text-shadow: 0 3px 12px rgba(0, 0, 0, 0.2);
}

.bank-card-footer {
  align-items: flex-end;
}

.bank-card-footer > div {
  display: grid;
  gap: 4px;
}

.dashboard-screen .member-since {
  display: block;
  color: rgba(255, 255, 255, 0.92);
  font-size: 0.84rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.bank-card-client {
  color: #f4cf62;
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 2vw, 1.55rem);
  font-style: italic;
  letter-spacing: 0.03em;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.22);
}

.dashboard-screen .account-overview {
  padding: 18px 20px;
  display: grid;
  grid-template-columns: minmax(240px, 0.72fr) minmax(0, 1.28fr);
  gap: 22px;
  align-items: center;
  border: 1px solid rgba(6, 47, 44, 0.08);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 14px 34px rgba(24, 45, 43, 0.08);
}

.dashboard-screen .account-overview-copy h3 {
  color: var(--bank-green-950);
  font-size: 1.3rem;
}

.dashboard-screen .account-overview-copy p:last-child {
  font-size: 0.88rem;
}

.dashboard-screen .account-overview-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.dashboard-screen .account-stat {
  min-height: 88px;
  padding: 13px;
  display: flex;
  align-items: center;
  gap: 11px;
  border: 1px solid rgba(6, 47, 44, 0.08);
  border-radius: 17px;
  background: #fbfdfc;
}

.dashboard-screen .account-stat > span {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: #eaf6f3;
  font-size: 1.3rem;
}

.dashboard-screen .account-stat:nth-child(2) > span { background: #fff5d8; }
.dashboard-screen .account-stat:nth-child(3) > span { background: #f1ecff; }

.dashboard-screen .account-stat > div {
  display: grid;
  gap: 2px;
}

.dashboard-screen .account-stat strong {
  color: var(--bank-green-950);
  font-size: 1.3rem;
}

.dashboard-screen .account-stat small {
  color: #62746f;
  font-size: 0.78rem;
  font-weight: 800;
}

.dashboard-screen .goals-section,
.dashboard-screen .activity {
  border: 1px solid rgba(6, 47, 44, 0.08);
  background: rgba(255, 255, 255, 0.91);
  box-shadow: 0 17px 40px rgba(24, 45, 43, 0.09);
}

.dashboard-screen .goals-section {
  padding: clamp(19px, 3vw, 28px);
}

.dashboard-screen .goals-list {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.dashboard-screen .goal-card {
  min-height: 176px;
  padding: 17px;
  border: 1px solid rgba(6, 47, 44, 0.10);
  border-radius: 19px;
  background:
    radial-gradient(circle at 92% 8%, rgba(225, 184, 74, 0.14), transparent 6rem),
    #fffdfa;
  box-shadow: 0 8px 20px rgba(24, 45, 43, 0.06);
}

.dashboard-screen .goal-card:hover,
.dashboard-screen .goal-card:focus-visible {
  border-color: rgba(14, 105, 94, 0.46);
  box-shadow: 0 12px 24px rgba(24, 45, 43, 0.10);
}

.dashboard-screen .goal-card.is-active {
  border-color: var(--bank-green-700);
  background: #f1faf7;
  box-shadow: 0 7px 0 rgba(14, 105, 94, 0.20);
}

.dashboard-screen .goal-card-name,
.dashboard-screen .section-title {
  color: var(--bank-green-950);
}

.dashboard-screen .goal-card-percent {
  color: var(--bank-green-700);
}

.dashboard-screen .goal-card-fill,
.dashboard-screen .selected-goal-fill {
  background: linear-gradient(90deg, #e1b84a, #2a9d8f);
}

.dashboard-screen .activity {
  padding: clamp(19px, 3vw, 28px);
}

.dashboard-screen .transaction-item {
  border: 1px solid rgba(6, 47, 44, 0.08);
  background: #fffdfa;
}

.dashboard-screen .eyebrow {
  color: var(--bank-green-700);
}

.child-nav-mobile {
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

@media (max-width: 1080px) {
  .dashboard-screen .topbar {
    gap: 8px;
  }

  .dashboard-screen .brand-mark {
    width: 48px;
    height: 48px;
    flex-basis: 48px;
  }

  .dashboard-screen .brand-name {
    font-size: 1.3rem;
  }

  .child-nav-link {
    padding-inline: 9px;
    font-size: 0.84rem;
  }

  .dashboard-screen .topbar-utility {
    width: 40px;
    padding-inline: 0;
    overflow: hidden;
    font-size: 0;
  }

  .dashboard-screen .topbar-utility::before {
    display: block;
    font-size: 1rem;
    line-height: 1;
  }

  #change-pin-btn::before { content: "🔒"; }
  #logout-btn::before { content: "↪"; font-size: 1.25rem; }
}

@media (max-width: 900px) {
  .dashboard-screen .hero-panel {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .dashboard-screen .hero-copy {
    max-width: 680px;
  }

  .dashboard-screen .total-balance {
    width: min(620px, 100%);
    justify-self: center;
  }

  .dashboard-screen .account-overview {
    grid-template-columns: 1fr;
  }

  .dashboard-screen .account-overview-copy {
    display: none;
  }

  .dashboard-screen .goals-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .dashboard-screen {
    padding: 0 11px calc(104px + env(safe-area-inset-bottom, 0px));
  }

  .dashboard-screen .topbar {
    top: 7px;
    min-height: 64px;
    grid-template-columns: minmax(0, 1fr) auto;
    margin-bottom: 10px;
    padding: 7px 9px;
    border-radius: 19px;
  }

  .dashboard-screen .topbar-brand {
    min-width: 0;
  }

  .dashboard-screen .brand-mark {
    width: 43px;
    height: 43px;
    flex-basis: 43px;
  }

  .dashboard-screen .brand-name {
    overflow: hidden;
    font-size: 1.24rem;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .child-nav-desktop {
    display: none;
  }

  .topbar-profile {
    gap: 4px;
  }

  .nav-profile-button {
    min-height: 44px;
    padding: 2px;
    border: 0;
    background: transparent;
  }

  .nav-profile-button span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  .dashboard-screen .profile-avatar {
    width: 38px;
    height: 38px;
  }

  .dashboard-screen .topbar-actions {
    gap: 3px;
  }

  .dashboard-screen .topbar-utility {
    width: 36px;
    min-height: 36px;
    border-radius: 12px;
  }

  .mobile-goal-bar {
    position: sticky;
    top: 79px;
    z-index: 25;
    width: min(620px, 100%);
    margin: 0 auto 12px;
    display: block;
  }

  .mobile-new-goal-btn {
    width: 100%;
    min-height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 0;
    border-radius: 15px;
    background: linear-gradient(180deg, #0e695e, #073d38);
    color: white;
    box-shadow: 0 7px 14px rgba(7, 61, 56, 0.22);
    font-weight: 900;
    cursor: pointer;
  }

  .dashboard-screen .dashboard-anchor {
    scroll-margin-top: 140px;
  }

  .dashboard-screen .dashboard {
    gap: 14px;
  }

  .dashboard-screen .hero-panel {
    padding: 19px 16px 22px;
    gap: 18px;
    border-radius: 23px;
  }

  .hero-profile-avatar {
    width: 70px;
    height: 70px;
  }

  .dashboard-screen .hero-copy h2 {
    font-size: clamp(1.7rem, 8vw, 2.25rem);
  }

  .dashboard-screen .hero-sub {
    font-size: 0.9rem;
  }

  .parent-managed-note {
    margin-top: 14px;
    font-size: 0.78rem;
  }

  .dashboard-screen .total-balance {
    min-height: 190px;
    padding: 18px;
    border-radius: 22px;
    box-shadow: 0 13px 27px rgba(4, 47, 45, 0.23), 0 5px 0 #b98822;
  }

  .bank-card-middle {
    gap: 13px;
    padding: 13px 0 11px;
  }

  .bank-card-chip {
    width: 45px;
    height: 35px;
    flex-basis: 45px;
  }

  .dashboard-screen .total-amount {
    font-size: clamp(2.35rem, 11vw, 3.35rem);
  }

  .dashboard-screen .member-since {
    font-size: 0.7rem;
  }

  .bank-card-client {
    font-size: 1.1rem;
  }

  .dashboard-screen .account-overview {
    padding: 12px;
  }

  .dashboard-screen .account-overview-stats {
    gap: 7px;
  }

  .dashboard-screen .account-stat {
    min-height: 78px;
    padding: 9px 7px;
    justify-content: center;
    text-align: center;
  }

  .dashboard-screen .account-stat > span {
    display: none;
  }

  .dashboard-screen .account-stat strong {
    font-size: 1.05rem;
  }

  .dashboard-screen .account-stat small {
    font-size: 0.68rem;
  }

  .dashboard-screen .goals-section,
  .dashboard-screen .activity {
    padding: 17px 14px;
    border-radius: 22px;
  }

  .dashboard-screen .goals-list {
    grid-template-columns: 1fr;
  }

  .dashboard-screen .goal-card {
    min-height: 0;
    padding: 14px;
  }

  .dashboard-screen .goals-heading-row,
  .dashboard-screen .activity-head {
    gap: 9px;
  }

  .dashboard-screen .activity-sub {
    font-size: 0.78rem;
  }

  .child-nav-mobile {
    position: fixed;
    left: 50%;
    bottom: 8px;
    z-index: 40;
    width: min(540px, calc(100% - 16px));
    min-height: 72px;
    transform: translateX(-50%);
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    align-items: end;
    gap: 2px;
    padding: 7px 7px calc(7px + env(safe-area-inset-bottom, 0px));
    border: 1px solid rgba(6, 47, 44, 0.12);
    border-radius: 23px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 15px 38px rgba(24, 45, 43, 0.20);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
  }

  .mobile-nav-link {
    min-width: 0;
    min-height: 56px;
    padding: 6px 2px 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    gap: 3px;
    border-radius: 14px;
    background: transparent;
    color: #5c6c68;
    font-size: 0.64rem;
    font-weight: 900;
  }

  .mobile-nav-link.is-active {
    background: #eef8f5;
    color: var(--bank-green-700);
  }

  .mobile-nav-link > svg {
    width: 22px;
    height: 22px;
  }

  .mobile-nav-new-goal {
    justify-content: flex-end;
    color: var(--bank-green-900);
  }

  .mobile-nav-plus {
    width: 45px;
    height: 45px;
    margin-top: -22px;
    display: grid;
    place-items: center;
    border: 4px solid white;
    border-radius: 50%;
    background: linear-gradient(180deg, #0e695e, #073d38);
    color: white;
    box-shadow: 0 7px 15px rgba(7, 61, 56, 0.25);
  }

  .mobile-nav-plus svg {
    width: 23px;
    height: 23px;
  }
}

@media (max-width: 390px) {
  .dashboard-screen .brand-name {
    font-size: 1.05rem;
  }

  .dashboard-screen .topbar-utility {
    width: 32px;
  }

  .dashboard-screen .profile-avatar {
    width: 34px;
    height: 34px;
  }

  .dashboard-screen .profile-row {
    gap: 11px;
  }

  .hero-profile-avatar {
    width: 61px;
    height: 61px;
  }

  .dashboard-screen .total-balance {
    padding: 16px;
  }

  .dashboard-screen .total-label {
    font-size: 0.88rem;
  }

  .contactless-mark {
    transform: scale(0.86) rotate(8deg);
    transform-origin: right top;
  }

  .bank-card-middle {
    gap: 9px;
  }

  .bank-card-chip {
    width: 40px;
    height: 31px;
    flex-basis: 40px;
  }

  .dashboard-screen .total-amount {
    font-size: clamp(2.05rem, 11vw, 2.75rem);
  }
}

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

@media (min-width: 761px) and (max-width: 900px) {
  .dashboard-screen .topbar {
    gap: 6px;
    padding-inline: 8px;
  }

  .dashboard-screen .topbar-brand {
    gap: 6px;
  }

  .dashboard-screen .brand-name {
    font-size: 1.18rem;
  }

  .child-nav-desktop {
    gap: 2px;
  }

  .child-nav-link {
    padding-inline: 7px;
    gap: 5px;
    font-size: 0.78rem;
  }

  .child-nav-link svg {
    width: 19px;
    height: 19px;
    flex-basis: 19px;
  }

  .nav-profile-button {
    min-height: 42px;
    padding: 2px;
    border: 0;
    background: transparent;
  }

  .nav-profile-button span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  .dashboard-screen .profile-avatar {
    width: 36px;
    height: 36px;
  }

  .dashboard-screen .topbar-utility {
    width: 36px;
    min-height: 36px;
  }
}

/* v2.8.2 compact card sizing hotfix */
.dashboard-screen .hero-panel {
  align-items: start;
}

.dashboard-screen .total-balance {
  width: min(100%, 26rem);
  max-width: 100%;
  min-height: auto;
  aspect-ratio: 85.6 / 53.98;
  justify-self: start;
  display: grid;
  grid-template-rows: auto 1fr auto;
  align-content: stretch;
}

.dashboard-screen .total-amount {
  font-size: clamp(2.15rem, 4.4vw, 3.15rem);
  line-height: 0.96;
}

.bank-card-middle {
  padding: 10px 0 8px;
  align-items: center;
}

.bank-card-chip {
  width: clamp(46px, 10%, 56px);
  height: auto;
  aspect-ratio: 1.28 / 1;
  flex-basis: auto;
}

.bank-card-footer {
  align-items: end;
}

@media (max-width: 900px) {
  .dashboard-screen .total-balance {
    width: min(100%, 25rem);
    justify-self: center;
  }
}

@media (max-width: 760px) {
  .dashboard-screen .total-balance {
    width: min(100%, 22rem);
    padding: 16px;
    border-radius: 22px;
  }

  .dashboard-screen .total-amount {
    font-size: clamp(1.95rem, 9vw, 2.65rem);
  }
}

@media (max-width: 480px) {
  .dashboard-screen .total-balance {
    width: 100%;
    max-width: 21rem;
  }

  .dashboard-screen .total-label {
    font-size: 0.86rem;
  }

  .dashboard-screen .member-since,
  .bank-card-client {
    font-size: 0.88rem;
  }
}

/* v2.8.3 align compact card to the right on wide screens */
@media (min-width: 901px) {
  .dashboard-screen .total-balance {
    justify-self: end;
    margin-right: clamp(8px, 1.2vw, 16px);
  }
}

@media (max-width: 900px) {
  .dashboard-screen .total-balance {
    margin-right: 0;
  }
}

/* v2.8.4 smaller compact client card */
.dashboard-screen .total-balance {
  width: min(100%, 23.5rem);
}

.dashboard-screen .total-amount {
  font-size: clamp(2rem, 4vw, 2.85rem);
}

@media (max-width: 900px) {
  .dashboard-screen .total-balance {
    width: min(100%, 22rem);
  }
}

@media (max-width: 760px) {
  .dashboard-screen .total-balance {
    width: min(100%, 20.5rem);
  }

  .dashboard-screen .total-amount {
    font-size: clamp(1.85rem, 8.2vw, 2.4rem);
  }
}

@media (max-width: 480px) {
  .dashboard-screen .total-balance {
    width: min(100%, 19.5rem);
  }
}

/* v2.8.5 friendly account dropdown */
.topbar-profile {
  position: relative;
  z-index: 60;
}

.nav-profile-button {
  position: relative;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 5px 12px 5px 6px;
  border: 1px solid rgba(7, 61, 56, 0.12);
  border-radius: 999px;
  background: linear-gradient(180deg, #fffdf6 0%, #f7f3e7 100%);
  color: var(--bank-green-950, #073d38);
  box-shadow: 0 5px 14px rgba(7, 61, 56, 0.08);
  font-weight: 900;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.nav-profile-button:hover,
.nav-profile-button:focus-visible,
.nav-profile-button[aria-expanded="true"] {
  border-color: rgba(14, 105, 94, 0.35);
  box-shadow: 0 9px 20px rgba(7, 61, 56, 0.14);
  transform: translateY(-1px);
}

.nav-profile-button .profile-button-name,
.nav-profile-button .profile-menu-chevron {
  position: static;
  width: auto;
  height: auto;
  overflow: visible;
  clip: auto;
  white-space: nowrap;
}

.profile-button-name {
  max-width: 9rem;
  overflow: hidden !important;
  text-overflow: ellipsis;
}

.profile-menu-chevron {
  display: inline-block;
  color: #52706b;
  font-size: 1.2rem;
  line-height: 1;
  transform: translateY(-1px);
  transition: transform 0.18s ease;
}

.nav-profile-button[aria-expanded="true"] .profile-menu-chevron {
  transform: translateY(1px) rotate(180deg);
}

.profile-menu {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  width: min(330px, calc(100vw - 28px));
  padding: 10px;
  border: 1px solid rgba(7, 61, 56, 0.12);
  border-radius: 24px;
  background: rgba(255, 254, 249, 0.98);
  box-shadow: 0 24px 55px rgba(7, 48, 44, 0.22);
  backdrop-filter: blur(14px);
  transform-origin: top right;
  animation: profile-menu-pop 0.18s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.profile-menu::before {
  content: "";
  position: absolute;
  top: -8px;
  right: 28px;
  width: 16px;
  height: 16px;
  border-top: 1px solid rgba(7, 61, 56, 0.12);
  border-left: 1px solid rgba(7, 61, 56, 0.12);
  background: #fffef9;
  transform: rotate(45deg);
}

@keyframes profile-menu-pop {
  from { opacity: 0; transform: translateY(-8px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.profile-menu-header {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 11px 13px;
  border-bottom: 1px dashed rgba(7, 61, 56, 0.16);
}

.profile-menu-avatar {
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  border-radius: 50%;
  object-fit: cover;
  background: #eff8f3;
  box-shadow: 0 0 0 3px white, 0 6px 14px rgba(7, 61, 56, 0.14);
}

.profile-menu-header div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.profile-menu-kicker {
  color: #6b7d78;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.profile-menu-header strong {
  overflow: hidden;
  color: #073d38;
  font-size: 1.05rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-menu-list {
  display: grid;
  gap: 7px;
  padding-top: 9px;
}

.profile-menu-item {
  width: 100%;
  min-height: 66px;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  padding: 9px 11px;
  border: 1px solid transparent;
  border-radius: 17px;
  background: transparent;
  color: #173d3a;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.profile-menu-item:hover,
.profile-menu-item:focus-visible {
  border-color: rgba(14, 105, 94, 0.15);
  background: #eff8f4;
  outline: none;
  transform: translateX(2px);
}

.profile-menu-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  font-size: 1.2rem;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.05);
}

.profile-menu-icon-avatar { background: #e9f5ff; }
.profile-menu-icon-pin { background: #fff4cf; }
.profile-menu-icon-logout { background: #ffe9e5; }

.profile-menu-item > span:nth-child(2) {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.profile-menu-item strong {
  color: inherit;
  font-size: 0.95rem;
}

.profile-menu-item small {
  overflow: hidden;
  color: #647a76;
  font-size: 0.78rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-menu-arrow {
  color: #78908b;
  font-size: 1.45rem;
  line-height: 1;
}

.profile-menu-item-logout {
  color: #a33f32;
}

.profile-menu-item-logout:hover,
.profile-menu-item-logout:focus-visible {
  border-color: rgba(196, 75, 58, 0.15);
  background: #fff1ee;
}

.hero-welcome-copy {
  position: relative;
  z-index: 1;
}

.dashboard-screen .hero-copy {
  align-self: center;
}

@media (max-width: 900px) {
  .nav-profile-button {
    min-height: 44px;
    padding: 4px 10px 4px 5px;
  }

  .nav-profile-button .profile-button-name {
    display: inline-block;
    max-width: 6rem;
    font-size: 0.86rem;
  }

  .nav-profile-button .profile-menu-chevron {
    display: inline-block;
  }
}

@media (max-width: 760px) {
  .nav-profile-button {
    min-height: 44px;
    padding-right: 9px;
    border: 1px solid rgba(7, 61, 56, 0.1);
    background: #fffdf7;
  }

  .nav-profile-button .profile-button-name {
    max-width: 4.8rem;
    font-size: 0.82rem;
  }

  .profile-menu {
    position: fixed;
    top: 77px;
    right: 10px;
    width: min(320px, calc(100vw - 20px));
    max-height: calc(100dvh - 96px);
    overflow-y: auto;
  }

  .profile-menu::before {
    right: 24px;
  }
}

@media (max-width: 420px) {
  .nav-profile-button .profile-button-name {
    max-width: 3.8rem;
  }

  .profile-menu-item {
    min-height: 62px;
  }
}

/* Prevent legacy standalone utility-button icons from appearing inside menu rows. */
#profile-menu .profile-menu-item::before {
  content: none !important;
  display: none !important;
}

/* v2.8.6 top-navigation alignment refinement */
@media (min-width: 761px) {
  .dashboard-screen .topbar {
    column-gap: 8px;
  }

  .dashboard-screen .child-nav-desktop {
    justify-content: flex-end;
    padding-right: 2px;
    gap: clamp(3px, 0.55vw, 7px);
  }

  .dashboard-screen .topbar-profile {
    margin-left: 0;
  }
}

/* The profile button opens a menu, but its avatar and name are clear enough
   without an extra down-arrow glyph. */
.profile-menu-chevron {
  display: none !important;
}

/* v2.8.7 simplified child navigation and playful goal action */
.goal-dream-icon {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: linear-gradient(145deg, #ffe79a, #f2c84f);
  color: #0a594f;
  box-shadow: inset 0 -2px 0 rgba(117, 84, 11, 0.16), 0 3px 7px rgba(126, 94, 20, 0.16);
}

.goal-dream-icon svg {
  width: 19px;
  height: 19px;
  fill: currentColor;
  overflow: visible;
}

.child-nav-new-goal {
  border: 1.5px solid #e3c35d;
  background: linear-gradient(180deg, #fffef8 0%, #fff4cf 100%);
  color: #174a43;
  box-shadow: 0 4px 0 #d2ac3c, 0 8px 15px rgba(100, 76, 18, 0.12);
}

.child-nav-new-goal:hover,
.child-nav-new-goal:focus-visible {
  border-color: #d4ae3f;
  background: linear-gradient(180deg, #fffdf2 0%, #ffedb1 100%);
  color: #0a594f;
  box-shadow: 0 5px 0 #c79e2e, 0 10px 18px rgba(100, 76, 18, 0.16);
}

@media (max-width: 760px) {
  .mobile-new-goal-btn {
    border: 1.5px solid #e3c35d;
    background: linear-gradient(180deg, #fffef8 0%, #fff3c8 100%);
    color: #174a43;
    box-shadow: 0 4px 0 #d2ac3c, 0 9px 17px rgba(100, 76, 18, 0.13);
  }

  .mobile-new-goal-btn:hover,
  .mobile-new-goal-btn:focus-visible {
    background: linear-gradient(180deg, #fffdf2 0%, #ffebaa 100%);
    color: #0a594f;
  }

  .mobile-goal-dream-icon {
    width: 31px;
    height: 31px;
  }

  .child-nav-mobile {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .mobile-nav-dream {
    width: 45px;
    height: 45px;
    margin-top: -22px;
    display: grid;
    place-items: center;
    border: 4px solid white;
    border-radius: 16px;
    background: linear-gradient(145deg, #ffe79a, #f2c84f);
    color: #0a594f;
    box-shadow: 0 7px 15px rgba(126, 94, 20, 0.2);
    transform: rotate(-3deg);
  }

  .mobile-nav-dream svg {
    width: 25px;
    height: 25px;
    fill: currentColor;
    transform: rotate(3deg);
  }
}

/* Tiny Bank v2.9.0 parent password recovery */
.login-help-row {
  display: flex;
  justify-content: flex-end;
  margin-top: -4px;
}

.auth-help-link,
.password-recovery-back {
  border: 0;
  background: transparent;
  color: #0d6b61;
  font: inherit;
  font-weight: 850;
  cursor: pointer;
}

.auth-help-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 3px;
  border-radius: 10px;
}

.auth-help-link:hover,
.auth-help-link:focus-visible,
.password-recovery-back:hover,
.password-recovery-back:focus-visible {
  color: #064b45;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.password-recovery-panel {
  display: grid;
  gap: 16px;
  padding: 8px 2px 0;
}

.password-recovery-back {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 2px;
}

.password-recovery-icon {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  margin: 2px auto 14px;
  border-radius: 24px;
  background: linear-gradient(145deg, #fff4c9, #f0d77c);
  box-shadow: inset 0 -6px 0 rgba(127, 91, 16, 0.12), 0 12px 24px rgba(42, 72, 65, 0.1);
  font-size: 2.1rem;
}

.password-recovery-panel .form-heading,
.password-recovery-sent {
  text-align: center;
}

.password-recovery-panel .form-heading h3,
.password-recovery-sent h3 {
  margin: 4px 0 8px;
  color: #173b3c;
  font-size: clamp(1.55rem, 4vw, 2rem);
}

.password-recovery-panel .form-heading p:last-child,
.password-recovery-sent > p:not(.eyebrow):not(.field-hint) {
  margin: 0 auto;
  max-width: 42ch;
  color: #5d7475;
  line-height: 1.55;
}

.password-recovery-form {
  margin-top: 16px;
}

.password-recovery-privacy {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin: 0;
  padding: 12px 14px;
  border: 1px solid rgba(13, 107, 97, 0.12);
  border-radius: 14px;
  background: #f0f8f5;
  color: #48635f;
  font-size: 0.84rem;
  font-weight: 700;
  line-height: 1.45;
}

.password-recovery-sent {
  padding: 10px 2px 4px;
}

.password-recovery-sent .btn {
  margin-top: 20px;
}

.password-reset-page {
  background: linear-gradient(180deg, #83cce3 0%, #b8e2e8 45%, #e6f2e8 100%);
}

.password-reset-stage {
  width: min(540px, 100%);
}

.password-reset-card {
  max-width: 540px;
  padding: clamp(24px, 5vw, 38px);
  text-align: left;
}

.password-reset-brand {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 26px;
  color: #153b3c;
  text-decoration: none;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 900;
}

.password-reset-brand img {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.password-reset-card h1 {
  margin: 5px 0 10px;
  color: #173b3c;
  font-size: clamp(2rem, 6vw, 2.8rem);
  line-height: 1.05;
  text-align: center;
}

.password-reset-card > section > .eyebrow,
.password-reset-copy {
  text-align: center;
}

.password-reset-copy {
  margin: 0 auto 22px;
  max-width: 42ch;
  color: #5a7273;
  line-height: 1.55;
}

.password-reset-request-new {
  display: block;
  width: fit-content;
  margin: 18px auto 0;
  color: #0d6b61;
  font-weight: 800;
  text-underline-offset: 3px;
}

@media (max-width: 520px) {
  .login-help-row {
    justify-content: flex-start;
  }

  .auth-help-link,
  .password-recovery-back {
    min-height: 44px;
  }

  .password-reset-card {
    border-radius: 24px;
  }
}

/* Password reset page must opt out of the two-column welcome layout. */
.password-reset-stage {
  width: min(540px, calc(100vw - 32px));
  max-width: 540px;
  display: block;
  text-align: left;
}

.password-reset-card {
  width: 100%;
  max-width: none;
}

.password-reset-card .password-recovery-sent,
.password-reset-card .btn {
  width: 100%;
}

.password-reset-card .password-recovery-sent > p:not(.eyebrow) {
  margin-bottom: 24px;
}

.password-reset-card .password-recovery-sent .btn {
  display: block;
  box-sizing: border-box;
  margin-top: 0;
}

/* Tiny Bank v2.10.0 — parent automatic deposits */
.auto-deposit-section {
  margin-top: 1.25rem;
  padding: clamp(1rem, 2.5vw, 1.5rem);
  border: 1px solid rgba(91, 72, 151, 0.15);
  border-radius: 24px;
  background:
    radial-gradient(circle at 96% 10%, rgba(255, 220, 117, 0.24), transparent 28%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(250, 248, 255, 0.98));
  box-shadow: 0 14px 34px rgba(66, 52, 115, 0.08);
}

.auto-deposit-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.auto-deposit-section-head h2,
.auto-deposit-section-head p {
  margin-top: 0;
}

.auto-deposit-section-head h2 {
  margin-bottom: 0.35rem;
}

.auto-deposit-section-head > div > p:last-child {
  max-width: 660px;
  margin-bottom: 0;
  color: var(--muted, #625d72);
}

.auto-deposit-list {
  display: grid;
  gap: 0.8rem;
}

.auto-deposit-empty {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.9rem;
  min-height: 96px;
  padding: 1rem;
  border: 1px dashed rgba(91, 72, 151, 0.24);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
}

.auto-deposit-empty-icon,
.auto-deposit-card-icon {
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  border-radius: 16px;
  background: linear-gradient(145deg, #fff4bf, #ffe59a);
  box-shadow: inset 0 0 0 1px rgba(168, 118, 24, 0.12);
  font-size: 1.45rem;
}

.auto-deposit-empty strong,
.auto-deposit-empty p {
  display: block;
  margin: 0;
}

.auto-deposit-empty p {
  margin-top: 0.2rem;
  color: var(--muted, #625d72);
}

.auto-deposit-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.9rem;
  padding: 0.95rem;
  border: 1px solid rgba(75, 61, 125, 0.14);
  border-radius: 19px;
  background: rgba(255, 255, 255, 0.92);
  transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.auto-deposit-card:hover {
  transform: translateY(-1px);
  border-color: rgba(91, 72, 151, 0.25);
  box-shadow: 0 10px 24px rgba(66, 52, 115, 0.08);
}

.auto-deposit-card.is-paused {
  background: rgba(248, 247, 251, 0.94);
}

.auto-deposit-card.is-paused .auto-deposit-card-icon {
  background: linear-gradient(145deg, #efedf4, #ddd9e7);
}

.auto-deposit-card-main {
  min-width: 0;
}

.auto-deposit-card-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.auto-deposit-card-title strong {
  overflow-wrap: anywhere;
}

.auto-deposit-card-main p,
.auto-deposit-card-main small {
  margin: 0.25rem 0 0;
  color: var(--muted, #625d72);
}

.auto-deposit-card-main p b {
  color: var(--ink, #252038);
}

.auto-deposit-card-main small {
  display: block;
}

.auto-deposit-status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0.16rem 0.55rem;
  border-radius: 999px;
  background: #e5f7ee;
  color: #176c4d;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.auto-deposit-status.is-paused {
  background: #eeeaf4;
  color: #625a72;
}

.auto-deposit-card-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.auto-deposit-modal .modal-card {
  width: min(94vw, 590px);
}

.auto-deposit-date-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 0.75rem;
}

.auto-deposit-info {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.65rem;
  align-items: start;
  padding: 0.8rem 0.9rem;
  border-radius: 14px;
  background: #f1fbf6;
  color: #285b48;
  font-size: 0.9rem;
}

.auto-deposit-info span {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #d7f4e5;
  font-weight: 900;
}

.auto-deposit-info p {
  margin: 0;
}

@media (max-width: 760px) {
  .auto-deposit-section-head {
    align-items: stretch;
    flex-direction: column;
  }

  .auto-deposit-section-head .btn {
    width: 100%;
  }

  .auto-deposit-card {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .auto-deposit-card-actions {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .auto-deposit-card-actions .btn {
    width: 100%;
    min-height: 44px;
  }

  .auto-deposit-empty {
    grid-template-columns: auto 1fr;
  }

  .auto-deposit-empty .btn {
    grid-column: 1 / -1;
    width: 100%;
  }

  .auto-deposit-date-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 440px) {
  .auto-deposit-card {
    grid-template-columns: 1fr;
  }

  .auto-deposit-card-icon {
    width: 44px;
    height: 44px;
  }

  .auto-deposit-card-actions {
    grid-template-columns: 1fr;
  }
}

/* Keep parent dashboard grid items inside narrow screens. */
.admin-shell > * {
  min-width: 0;
  width: 100%;
}


/* v2.11.0 goal purchase approval workflow */
.goal-card.is-pending-approval {
  border-color: rgba(215, 173, 63, .72);
  box-shadow: 0 10px 24px rgba(146, 107, 26, .12);
}
.goal-card.is-pending-approval::before {
  content: none !important;
  display: none !important;
}
.goal-card.is-pending-approval .goal-card-percent {
  background: #fff4c9;
  color: #765714;
}
.purchase-request-hero,
.purchase-decision-icon {
  width: 64px;
  height: 64px;
  border-radius: 22px;
  display: grid;
  place-items: center;
  margin: 0 auto 12px;
  background: linear-gradient(145deg, #fff4c9, #f8d97b);
  font-size: 2rem;
  box-shadow: 0 10px 24px rgba(146, 107, 26, .16);
}
.purchase-request-modal .modal-card { max-width: 520px; text-align: center; }
.purchase-request-info {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  text-align: left;
  background: #f1f8f5;
  border: 1px solid #d5e9e1;
  border-radius: 16px;
  padding: 14px 16px;
  margin: 18px 0;
}
.purchase-request-info span { font-size: 1.35rem; }
.purchase-request-info p { margin: 0; line-height: 1.55; }
.purchase-request-section {
  margin-top: 26px;
  padding: clamp(18px, 3vw, 28px);
  border-radius: 24px;
  background: linear-gradient(145deg, rgba(255,255,255,.96), rgba(251,248,236,.96));
  border: 1px solid rgba(215, 173, 63, .34);
}
.purchase-request-section-head h2 { display: flex; align-items: center; gap: 10px; margin: 3px 0 8px; }
.purchase-request-section-head p { margin: 0; color: var(--muted); }
.request-count-pill {
  min-width: 30px;
  height: 30px;
  padding: 0 9px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  background: #0e695e;
  color: white;
  font-size: .85rem;
}
.purchase-request-list { display: grid; gap: 14px; margin-top: 18px; }
.purchase-request-empty {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 18px;
  border-radius: 18px;
  background: rgba(255,255,255,.72);
  border: 1px dashed rgba(14,105,94,.25);
}
.purchase-request-empty > span { width: 44px; height: 44px; border-radius: 15px; display: grid; place-items: center; background: #e8f5ef; color: #0e695e; font-weight: 900; }
.purchase-request-empty strong { display: block; }
.purchase-request-empty p { margin: 3px 0 0; color: var(--muted); }
.purchase-request-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 17px;
  border-radius: 20px;
  background: #fff;
  border: 1px solid rgba(14,105,94,.17);
  box-shadow: 0 8px 22px rgba(35,63,66,.06);
}
.purchase-request-card > img { border-radius: 18px; background: #edf7f3; }
.purchase-request-title { display: flex; gap: 10px; align-items: flex-start; }
.purchase-request-title > span { font-size: 1.45rem; }
.purchase-request-title strong { display: block; line-height: 1.35; }
.purchase-request-title small { display: block; margin-top: 3px; color: var(--muted); }
.purchase-request-money { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 9px; font-size: .9rem; color: var(--muted); }
.purchase-request-money b { color: var(--ink); }
.purchase-request-readiness { margin: 9px 0 0; font-size: .88rem; color: #356158; }
.purchase-request-readiness.is-warning { color: #9b4d2f; }
.purchase-request-card.is-short { border-color: rgba(194, 91, 55, .3); }
.purchase-request-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.purchase-decision-icon { color: #0e695e; font-size: 1.7rem; font-weight: 900; }
.purchase-decision-icon.is-decline { background: #fff0eb; color: #b14b32; }
.purchase-decision-impact { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 18px 0; }
.purchase-decision-impact > div { padding: 12px; border-radius: 14px; background: #f3f8f6; text-align: center; }
.purchase-decision-impact span { display: block; color: var(--muted); font-size: .78rem; }
.purchase-decision-impact strong { display: block; margin-top: 5px; }
.purchase-decision-impact > p { grid-column: 1 / -1; margin: 0; padding: 14px; border-radius: 14px; background: #fff6f2; color: #774638; }
.optional-label { font-size: .78rem; font-weight: 500; color: var(--muted); }
@media (max-width: 760px) {
  .purchase-request-card { grid-template-columns: auto minmax(0, 1fr); align-items: start; }
  .purchase-request-actions { grid-column: 1 / -1; justify-content: stretch; }
  .purchase-request-actions .btn { flex: 1; min-height: 44px; }
  .purchase-decision-impact { grid-template-columns: 1fr; }
}

/* v3.0.0 inherited in-progress feedback for protected actions */
button.is-busy,
.btn.is-busy {
  cursor: wait !important;
  pointer-events: none;
}

button.is-busy:not(.btn),
.btn.is-busy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
}

.button-busy-spinner {
  width: 1em;
  height: 1em;
  flex: 0 0 1em;
  display: inline-block;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: tiny-bank-button-spin 0.7s linear infinite;
}

.button-busy-label {
  white-space: nowrap;
}

@keyframes tiny-bank-button-spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .button-busy-spinner {
    animation-duration: 1.4s;
  }
}

/* Tiny Bank v3.0.0 child dashboard refresh */
.dashboard-v3 {
  display: grid;
  gap: 1rem;
  padding-bottom: 7rem;
}

.dashboard-home-panel {
  display: grid;
  gap: 1rem;
  align-items: stretch;
}

.hero-chip-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}

.hero-chip-button,
.account-stat-button {
  border: 1px solid rgba(15, 83, 74, 0.12);
  border-radius: 1.1rem;
  background: rgba(255,255,255,0.78);
  color: inherit;
  padding: 0.85rem 0.95rem;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.hero-chip-button:hover,
.hero-chip-button:focus-visible,
.account-stat-button:hover,
.account-stat-button:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(15, 83, 74, 0.25);
  box-shadow: 0 16px 28px rgba(10, 61, 52, 0.09);
}

.hero-chip-button strong,
.account-stat-button strong {
  display: block;
  font-size: 1.15rem;
  line-height: 1;
}

.hero-chip-button small,
.account-stat-button small {
  display: block;
  margin-top: 0.15rem;
  color: #546975;
}

.account-overview-compact .account-overview-stats {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.dashboard-preview-grid {
  display: grid;
  gap: 1rem;
}

.dashboard-panel {
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(16, 77, 70, 0.08);
  border-radius: 1.55rem;
  padding: 1rem;
  box-shadow: 0 16px 38px rgba(20, 48, 57, 0.08);
}

.dashboard-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.9rem;
}

.goals-preview-list {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(240px, 84%);
  gap: 0.85rem;
  overflow-x: auto;
  padding-bottom: 0.1rem;
  scroll-snap-type: x proximity;
}

.goals-preview-list .goal-card {
  min-height: 100%;
  scroll-snap-align: start;
}

.goal-card-preview {
  padding: 1rem;
}

.activity-preview-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}

.activity-preview-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.75rem;
  align-items: center;
  border: 1px solid rgba(16, 77, 70, 0.08);
  border-radius: 1rem;
  padding: 0.8rem 0.85rem;
  background: rgba(255,255,255,0.66);
}

.activity-preview-item .txn-main,
.activity-preview-item .txn-note,
.activity-preview-item .txn-meta {
  min-width: 0;
}

.activity-preview-item .txn-note {
  margin: 0;
}

.activity-preview-item .txn-meta {
  margin-top: 0.12rem;
}

.dashboard-sheet {
  width: min(100% - 1rem, 1120px);
  max-width: 1120px;
  border: none;
  padding: 0;
  background: transparent;
}

.dashboard-sheet::backdrop {
  background: rgba(9, 23, 30, 0.46);
  backdrop-filter: blur(4px);
}

.dashboard-sheet-card {
  width: min(100%, 1120px);
  max-height: min(86vh, 920px);
  overflow: auto;
  border-radius: 1.65rem;
  padding: 1rem;
}

.dashboard-sheet-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.goals-sheet-list {
  display: grid;
  gap: 0.9rem;
}

.goal-detail-sheet {
  max-width: 720px;
}

.activity-sheet-card {
  max-width: 840px;
}

.goals-sheet-card .archived-goals-panel {
  margin-top: 1rem;
}

.child-nav-link,
.mobile-nav-link {
  border: none;
  background: none;
}

body.dashboard-sheet-open {
  overflow: hidden;
}

@media (min-width: 700px) {
  .dashboard-home-panel {
    grid-template-columns: minmax(0, 1.05fr) minmax(340px, 0.95fr);
  }

  .dashboard-preview-grid {
    grid-template-columns: 1.1fr 0.9fr;
    align-items: start;
  }

  .goals-preview-list {
    grid-auto-flow: row;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-columns: unset;
    overflow: visible;
  }

  .goals-sheet-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-sheet-card {
    padding: 1.35rem;
  }
}

@media (min-width: 1024px) {
  .dashboard-v3 {
    gap: 1.25rem;
  }

  .dashboard-panel {
    padding: 1.15rem 1.2rem;
  }

  .goals-sheet-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 699px) {
  .dashboard-v3 {
    padding-bottom: 8rem;
  }

  .dashboard-sheet {
    width: calc(100% - 0.75rem);
  }

  .dashboard-sheet-card {
    max-height: min(88vh, 920px);
    border-radius: 1.35rem;
    padding: 0.95rem;
  }

  .dashboard-sheet-head,
  .dashboard-panel-head {
    flex-direction: column;
  }

  .goals-sheet-list {
    grid-template-columns: 1fr;
  }

  .account-overview-compact .account-overview-stats {
    grid-template-columns: 1fr;
  }
}

.dashboard-screen .total-balance {
  width: min(100%, 420px);
  aspect-ratio: 1.58 / 1;
  min-height: 0 !important;
  justify-self: end;
  align-self: start;
}

.dashboard-home-panel .total-balance {
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.dashboard-home-panel .bank-card-middle {
  min-height: 0;
  align-content: center;
}

@media (max-width: 699px) {
  .dashboard-screen .total-balance {
    width: 100%;
    max-width: 420px;
    justify-self: stretch;
  }
}

.child-nav-new-goal,
.mobile-new-goal-btn,
.mobile-nav-new-goal {
  background-image: linear-gradient(135deg, rgba(255,255,255,0.98), rgba(255,244,223,0.96)) !important;
  background-color: rgba(255,255,255,0.96) !important;
  color: #0f534a !important;
  border: 1px solid rgba(16,77,70,0.12) !important;
}

.dashboard-sheet .goals-list.goals-sheet-list {
  display: grid;
  gap: 0.9rem;
  grid-template-columns: 1fr;
}

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

@media (min-width: 1024px) {
  .dashboard-sheet .goals-list.goals-sheet-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.dashboard-screen,
.dashboard-v3,
.dashboard-panel,
.dashboard-preview-grid {
  max-width: 100%;
  overflow-x: clip;
}

.goals-preview-list {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.dashboard-screen .total-balance {
  box-sizing: border-box;
  margin: 0;
}

.dashboard-home-panel {
  grid-template-columns: 1fr !important;
}

@media (min-width: 700px) {
  .dashboard-home-panel {
    grid-template-columns: minmax(0, 1.05fr) minmax(340px, 0.95fr) !important;
  }
}

@media (max-width: 699px) {
  .dashboard-screen .total-balance {
    width: min(100%, calc(100vw - 2.25rem)) !important;
    max-width: calc(100vw - 2.25rem) !important;
    justify-self: start !important;
  }
}

/* Tiny Bank v3.0.1: clean, unfilled desktop navigation */
.child-nav-desktop .child-nav-link.is-active {
  background: transparent !important;
  color: var(--bank-green-800) !important;
  box-shadow: inset 0 -2px 0 rgba(14, 105, 94, 0.45) !important;
}

.child-nav-desktop .child-nav-new-goal,
.child-nav-desktop .child-nav-new-goal:hover,
.child-nav-desktop .child-nav-new-goal:focus-visible,
.child-nav-desktop .child-nav-new-goal.is-active {
  background: transparent !important;
  background-image: none !important;
  border-color: transparent !important;
  box-shadow: none !important;
  color: #27413e !important;
}

.child-nav-desktop .child-nav-new-goal:hover,
.child-nav-desktop .child-nav-new-goal:focus-visible {
  background: #eff8f5 !important;
  color: var(--bank-green-800) !important;
}

/* Tiny Bank v3.1.0 parent portal workspace */
.parent-portal-v4 {
  width: min(100% - 1.5rem, 1440px);
  max-width: 1440px;
  margin-inline: auto;
  padding-bottom: 4rem;
}

.admin-topbar {
  border: 1px solid rgba(14, 79, 71, 0.08);
  box-shadow: 0 14px 36px rgba(24, 51, 57, 0.08);
}

.parent-hero-v4 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  margin-top: 1rem;
  padding: 1.35rem 1.45rem;
  border: 1px solid rgba(14, 79, 71, 0.08);
  border-radius: 1.6rem;
  background:
    radial-gradient(circle at 92% 10%, rgba(242, 197, 77, 0.18), transparent 28%),
    linear-gradient(135deg, rgba(255,255,255,0.96), rgba(240,249,246,0.92));
  box-shadow: 0 18px 42px rgba(24, 51, 57, 0.08);
}

.parent-hero-copy-v4 h1 {
  margin: 0.15rem 0 0.35rem;
  font-size: clamp(1.75rem, 3vw, 2.7rem);
  line-height: 1.05;
}

.parent-hero-copy-v4 p:last-child {
  margin: 0;
  color: #526772;
}

.parent-hero-actions-v4 {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.parent-family-overview-v4 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.8rem;
  margin: 0.9rem 0;
}

.parent-metric-card {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.95rem 1rem;
  border: 1px solid rgba(14, 79, 71, 0.08);
  border-radius: 1.2rem;
  background: rgba(255,255,255,0.88);
  box-shadow: 0 12px 30px rgba(24, 51, 57, 0.06);
}

.parent-metric-icon {
  display: grid;
  place-items: center;
  width: 2.7rem;
  height: 2.7rem;
  flex: 0 0 2.7rem;
  border-radius: 0.9rem;
  background: #f3f8f6;
  font-size: 1.25rem;
}

.parent-metric-card strong,
.parent-metric-card small {
  display: block;
}

.parent-metric-card strong {
  font-size: clamp(1.15rem, 2vw, 1.55rem);
  line-height: 1.1;
}

.parent-metric-card small {
  margin-top: 0.16rem;
  color: #657680;
}

.parent-command-center-v4 {
  display: grid;
  grid-template-columns: 285px minmax(0, 1fr);
  min-height: 680px;
  overflow: hidden;
  border: 1px solid rgba(14, 79, 71, 0.1);
  border-radius: 1.65rem;
  background: rgba(255,255,255,0.9);
  box-shadow: 0 24px 56px rgba(24, 51, 57, 0.1);
}

.parent-child-sidebar-v4 {
  min-width: 0;
  padding: 1rem;
  border-right: 1px solid rgba(14, 79, 71, 0.08);
  background: linear-gradient(180deg, #f5faf8, #edf6f2);
}

.parent-child-sidebar-head-v4 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  margin-bottom: 0.8rem;
}

.parent-child-sidebar-head-v4 h2 {
  margin: 0.12rem 0 0;
  font-size: 1.15rem;
}

.parent-add-child-mini {
  display: grid;
  place-items: center;
  width: 2.55rem;
  height: 2.55rem;
  flex: 0 0 2.55rem;
  border: 1px solid rgba(14, 79, 71, 0.14);
  border-radius: 0.85rem;
  background: #fff;
  color: #0f534a;
  font-size: 1.35rem;
  cursor: pointer;
}

.parent-child-list-v4.admin-kid-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.65rem;
  margin: 0;
}

.parent-child-list-v4 .admin-kid-card {
  width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.72rem;
  align-items: center;
  position: relative;
  padding: 0.78rem;
  border: 1px solid transparent;
  border-radius: 1.05rem;
  background: rgba(255,255,255,0.72);
  text-align: left;
  box-shadow: none;
}

.parent-child-list-v4 .admin-kid-card img {
  grid-row: 1 / span 2;
  width: 3rem;
  height: 3rem;
}

.parent-child-list-v4 .admin-kid-card-copy {
  min-width: 0;
}

.parent-child-list-v4 .admin-kid-card-copy strong,
.parent-child-list-v4 .admin-kid-card-copy small,
.parent-child-list-v4 .admin-kid-balance {
  display: block;
}

.parent-child-list-v4 .admin-kid-card-copy strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.parent-child-list-v4 .admin-kid-balance {
  grid-column: 2;
  color: #0b6c60;
  font-size: 0.92rem;
}

.parent-child-list-v4 .admin-kid-card.is-selected {
  border-color: rgba(14, 105, 94, 0.22);
  background: #fff;
  box-shadow: 0 12px 26px rgba(18, 73, 66, 0.1);
}

.parent-child-list-v4 .admin-kid-card.is-selected::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  border-radius: 1rem 0 0 1rem;
  background: #0e695e;
}

.parent-workspace-v4 {
  min-width: 0;
  padding: 1rem;
  background: rgba(255,255,255,0.76);
}

.selected-child-header-v4 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1rem;
  border: 1px solid rgba(14, 79, 71, 0.08);
  border-radius: 1.2rem;
  background: linear-gradient(135deg, #fff, #f8fbfa);
}

.selected-child-identity-v4 {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 0.8rem;
}

.selected-child-identity-v4 img {
  width: 4rem;
  height: 4rem;
  border-radius: 50%;
  background: #eef6f2;
  box-shadow: inset 0 0 0 1px rgba(14, 79, 71, 0.08);
}

.selected-child-identity-v4 h2,
.selected-child-identity-v4 p {
  margin: 0;
}

.selected-child-identity-v4 h2 {
  margin-top: 0.12rem;
}

.selected-child-identity-v4 p:last-child {
  margin-top: 0.16rem;
  color: #657680;
}

.selected-child-stats-v4 {
  display: grid;
  grid-template-columns: repeat(3, minmax(100px, 1fr));
  gap: 0.55rem;
}

.selected-child-stats-v4 > div {
  padding: 0.62rem 0.78rem;
  border-radius: 0.9rem;
  background: #f2f7f5;
}

.selected-child-stats-v4 span,
.selected-child-stats-v4 strong {
  display: block;
}

.selected-child-stats-v4 span {
  color: #667983;
  font-size: 0.76rem;
}

.selected-child-stats-v4 strong {
  margin-top: 0.12rem;
  font-size: 1.05rem;
}

.parent-workspace-tabs-v4 {
  display: flex;
  gap: 0.25rem;
  margin: 0.8rem 0;
  padding: 0.28rem;
  overflow-x: auto;
  border: 1px solid rgba(14, 79, 71, 0.08);
  border-radius: 1rem;
  background: #f4f8f6;
}

.parent-workspace-tabs-v4 button {
  min-height: 2.7rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.42rem;
  flex: 1 0 auto;
  padding: 0.58rem 0.78rem;
  border: 0;
  border-radius: 0.75rem;
  background: transparent;
  color: #4f636c;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}

.parent-workspace-tabs-v4 button b {
  display: inline-grid;
  place-items: center;
  min-width: 1.35rem;
  height: 1.35rem;
  padding-inline: 0.25rem;
  border-radius: 999px;
  background: #e8f0ed;
  color: #0e695e;
  font-size: 0.72rem;
}

.parent-workspace-tabs-v4 button.is-active {
  background: #fff;
  color: #0a4f47;
  box-shadow: 0 8px 18px rgba(18, 73, 66, 0.08);
}

.parent-workspace-panel-v4 {
  min-width: 0;
}

.parent-overview-grid-v4 {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  gap: 0.8rem;
}

.parent-selected-summary-v4,
.parent-family-access-card-v4,
.parent-money-context-v4 {
  min-width: 0;
  border: 1px solid rgba(14, 79, 71, 0.08);
  border-radius: 1.2rem;
  background: #fff;
  box-shadow: 0 12px 28px rgba(24, 51, 57, 0.06);
}

.parent-selected-summary-v4 {
  padding: 1rem;
}

.parent-family-access-card-v4 {
  padding: 1rem;
}

.parent-card-title-v4 {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.parent-card-title-v4 > span {
  display: grid;
  place-items: center;
  width: 2.8rem;
  height: 2.8rem;
  border-radius: 0.85rem;
  background: #eef7f3;
}

.parent-card-title-v4 h3,
.parent-card-title-v4 p {
  margin: 0;
}

.parent-family-access-card-v4 > p {
  color: #5c6f78;
}

.parent-family-access-card-v4 .admin-help {
  word-break: break-word;
  padding: 0.7rem;
  border-radius: 0.8rem;
  background: #f5f8f7;
}

.parent-money-workspace-v4.admin-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.75fr);
  gap: 0.8rem;
  margin: 0;
}

.parent-money-context-v4 {
  padding: 1rem;
}

.parent-money-context-head-v4 {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.parent-money-context-head-v4 img {
  border-radius: 50%;
  background: #edf6f2;
}

.parent-money-context-head-v4 h3,
.parent-money-context-head-v4 p,
.parent-money-context-head-v4 strong {
  margin: 0;
}

.parent-money-context-head-v4 strong {
  display: block;
  margin-top: 0.15rem;
  color: #0e695e;
  font-size: 1.4rem;
}

.parent-money-context-note-v4 {
  display: flex;
  gap: 0.55rem;
  margin: 0.85rem 0;
  padding: 0.7rem;
  border-radius: 0.85rem;
  background: #f3f8f6;
}

.parent-money-context-note-v4 p {
  margin: 0;
  color: #5a6e77;
}

.parent-money-recent-v4 h4 {
  margin: 0 0 0.55rem;
}

.parent-money-recent-v4 > div {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 0.55rem 0;
  border-top: 1px solid rgba(14, 79, 71, 0.07);
}

.parent-money-recent-v4 .is-positive { color: #0b806f; }
.parent-money-recent-v4 .is-negative { color: #c14b46; }

.parent-workspace-panel-v4 .purchase-request-section,
.parent-workspace-panel-v4 .auto-deposit-section,
.parent-settings-grid-v4 > section {
  margin: 0;
  border-radius: 1.2rem;
}

.parent-settings-grid-v4 {
  display: grid;
  gap: 0.8rem;
}

@media (max-width: 1020px) {
  .parent-command-center-v4 {
    grid-template-columns: 1fr;
  }

  .parent-child-sidebar-v4 {
    border-right: 0;
    border-bottom: 1px solid rgba(14, 79, 71, 0.08);
  }

  .parent-child-list-v4.admin-kid-cards {
    grid-auto-flow: column;
    grid-auto-columns: minmax(220px, 270px);
    overflow-x: auto;
    padding-bottom: 0.2rem;
  }

  .parent-child-list-v4 .admin-kid-card {
    min-height: 5.3rem;
  }
}

@media (max-width: 760px) {
  .parent-portal-v4 {
    width: min(100% - 0.8rem, 1440px);
  }

  .parent-hero-v4 {
    align-items: flex-start;
    flex-direction: column;
    padding: 1rem;
  }

  .parent-hero-actions-v4 {
    width: 100%;
    justify-content: stretch;
  }

  .parent-hero-actions-v4 > * {
    flex: 1 1 auto;
  }

  .parent-family-overview-v4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .parent-workspace-v4,
  .parent-child-sidebar-v4 {
    padding: 0.75rem;
  }

  .selected-child-header-v4 {
    align-items: flex-start;
    flex-direction: column;
  }

  .selected-child-stats-v4 {
    width: 100%;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .parent-workspace-tabs-v4 {
    margin-inline: -0.1rem;
  }

  .parent-workspace-tabs-v4 button {
    flex: 0 0 auto;
    min-height: 3rem;
  }

  .parent-overview-grid-v4,
  .parent-money-workspace-v4.admin-workspace {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .parent-family-overview-v4 {
    gap: 0.55rem;
  }

  .parent-metric-card {
    padding: 0.75rem;
  }

  .parent-metric-icon {
    width: 2.35rem;
    height: 2.35rem;
    flex-basis: 2.35rem;
  }

  .selected-child-stats-v4 {
    gap: 0.35rem;
  }

  .selected-child-stats-v4 > div {
    padding: 0.55rem;
  }

  .selected-child-stats-v4 span {
    font-size: 0.68rem;
  }
}

/* v3.1.0 parent portal finishing refinements */
.admin-topbar {
  width: min(100% - 1.5rem, 1440px);
  margin: 0.65rem auto 0;
  border-radius: 1.25rem;
  background: rgba(255,255,255,0.94);
  color: #123c3a;
  backdrop-filter: blur(14px);
}

.admin-topbar .brand-name,
.admin-topbar .btn {
  color: #123c3a;
}

.admin-topbar .brand-mark {
  filter: none;
}

.parent-child-list-v4 .admin-kid-card {
  box-sizing: border-box;
  max-width: 100%;
}

@media (max-width: 1020px) {
  .parent-child-list-v4.admin-kid-cards {
    grid-template-columns: none !important;
    grid-auto-flow: column;
    grid-auto-columns: minmax(230px, 270px);
    width: 100%;
    max-width: 100%;
  }

  .parent-child-list-v4 .admin-kid-card {
    width: 100% !important;
    min-width: 0 !important;
  }
}

@media (max-width: 760px) {
  .admin-topbar {
    width: calc(100% - 0.8rem);
    min-height: 4.15rem;
    padding: 0.6rem 0.7rem;
  }

  .admin-topbar .topbar-brand {
    min-width: 0;
  }

  .admin-topbar .brand-name {
    font-size: 1.2rem;
    white-space: nowrap;
  }

  .admin-topbar #open-family-link {
    display: none;
  }

  .admin-topbar .topbar-actions {
    margin-left: auto;
  }

  .admin-topbar #parent-logout {
    min-height: 2.7rem;
    padding: 0.55rem 0.75rem;
  }

  .parent-child-list-v4.admin-kid-cards {
    grid-auto-columns: minmax(220px, 78vw);
  }

  .parent-hero-v4 {
    margin-top: 0.7rem;
  }
}

/* Tiny Bank v3.1.1 — unified parent portal header */
.parent-unified-header-v5 {
  width: min(100% - 1.5rem, 1440px);
  margin: 0.65rem auto 0;
  display: grid;
  grid-template-columns: auto minmax(280px, 1fr) auto;
  align-items: center;
  gap: 1.35rem;
  padding: 1rem 1.15rem;
  border: 1px solid rgba(14, 79, 71, 0.08);
  border-radius: 1.55rem;
  background:
    radial-gradient(circle at 88% 12%, rgba(242, 197, 77, 0.14), transparent 23%),
    linear-gradient(135deg, rgba(255,255,255,0.97), rgba(241,249,247,0.94));
  color: #123c3a;
  box-shadow: 0 16px 40px rgba(24, 51, 57, 0.09);
  backdrop-filter: blur(14px);
}

.parent-unified-brand-v5 {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
  padding-right: 1.25rem;
  border-right: 1px solid rgba(14, 79, 71, 0.1);
}

.parent-unified-brand-v5 .brand-mark {
  width: 2.85rem;
  height: 2.85rem;
  object-fit: contain;
  filter: none;
}

.parent-unified-brand-v5 .brand-name {
  color: #123c3a;
  font-size: 1.35rem;
  font-weight: 800;
  white-space: nowrap;
}

.parent-unified-copy-v5 {
  min-width: 0;
}

.parent-unified-copy-v5 .eyebrow {
  margin-bottom: 0.18rem;
}

.parent-unified-copy-v5 h1 {
  margin: 0;
  font-size: clamp(1.45rem, 2.4vw, 2.25rem);
  line-height: 1.04;
}

.parent-unified-copy-v5 p:last-child {
  margin: 0.28rem 0 0;
  color: #526772;
  max-width: 68ch;
}

.parent-unified-actions-v5 {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.parent-unified-actions-v5 .btn {
  min-height: 2.85rem;
  white-space: nowrap;
}

.parent-portal-v5 {
  padding-top: 0.25rem;
}

@media (max-width: 1040px) {
  .parent-unified-header-v5 {
    grid-template-columns: auto 1fr;
  }

  .parent-unified-actions-v5 {
    grid-column: 1 / -1;
    justify-content: flex-end;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(14, 79, 71, 0.08);
  }
}

@media (max-width: 760px) {
  .parent-unified-header-v5 {
    width: calc(100% - 0.8rem);
    grid-template-columns: 1fr auto;
    gap: 0.75rem;
    padding: 0.8rem;
    border-radius: 1.25rem;
  }

  .parent-unified-brand-v5 {
    padding-right: 0;
    border-right: 0;
  }

  .parent-unified-brand-v5 .brand-mark {
    width: 2.45rem;
    height: 2.45rem;
  }

  .parent-unified-brand-v5 .brand-name {
    font-size: 1.18rem;
  }

  .parent-unified-copy-v5 {
    grid-column: 1 / -1;
    padding-top: 0.65rem;
    border-top: 1px solid rgba(14, 79, 71, 0.08);
  }

  .parent-unified-copy-v5 h1 {
    font-size: clamp(1.45rem, 8vw, 2rem);
  }

  .parent-unified-actions-v5 {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.55rem;
    padding-top: 0.65rem;
  }

  .parent-unified-actions-v5 .btn {
    width: 100%;
    min-width: 0;
    padding-inline: 0.65rem;
  }

  .parent-unified-actions-v5 .parent-logout-v5 {
    position: absolute;
    top: 1.38rem;
    right: 1.15rem;
    width: auto;
    min-height: 2.45rem;
    padding: 0.45rem 0.7rem;
  }

  .parent-portal-v5 {
    padding-top: 0;
  }
}

@media (max-width: 430px) {
  .parent-unified-actions-v5 {
    grid-template-columns: 1fr;
  }

  .parent-unified-actions-v5 .parent-logout-v5 {
    position: absolute;
  }
}

.parent-unified-header-v5 {
  position: relative;
}

@media (max-width: 760px) {
  .parent-unified-actions-v5 .parent-logout-v5 {
    min-height: 2.75rem;
  }
}

/* Tiny Bank v3.1.2 — clearer family access controls */
.parent-family-access-card-v6 {
  display: grid;
  align-content: start;
  gap: 0.9rem;
}

.parent-family-access-card-v6 > p {
  margin: 0;
}

.family-access-current-v6 {
  display: grid;
  gap: 0.7rem;
  padding: 0.9rem;
  border: 1px solid rgba(15, 83, 74, 0.1);
  border-radius: 1rem;
  background: #f7faf9;
}

.family-access-current-head-v6 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  color: #425a64;
  font-size: 0.84rem;
  font-weight: 800;
}

.family-access-pin-badge-v6 {
  display: inline-flex;
  align-items: center;
  min-height: 1.75rem;
  padding: 0.28rem 0.58rem;
  border-radius: 999px;
  background: #e7f4ef;
  color: #0e695e;
  font-size: 0.72rem;
  line-height: 1.1;
  white-space: nowrap;
}

.family-link-preview-v6 {
  display: block;
  max-width: 100%;
  overflow: hidden;
  padding: 0.72rem 0.8rem;
  border: 1px solid rgba(31, 55, 69, 0.09);
  border-radius: 0.8rem;
  background: #fff;
  color: #334b58;
  font: 700 0.78rem/1.35 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.family-access-actions-v6 {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.65rem;
}

.family-access-actions-v6 .btn {
  min-height: 44px;
}

#copy-family-link.is-copied {
  border-color: rgba(14, 105, 94, 0.28);
  background: #e7f4ef;
  color: #0e695e;
}

.family-access-security-v6 {
  display: grid;
  gap: 0.75rem;
  padding-top: 0.95rem;
  border-top: 1px solid rgba(31, 55, 69, 0.1);
}

.family-access-security-copy-v6 {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.7rem;
  align-items: start;
}

.family-access-security-copy-v6 strong,
.family-access-security-copy-v6 p {
  margin: 0;
}

.family-access-security-copy-v6 p {
  margin-top: 0.18rem;
  color: #60737c;
  font-size: 0.84rem;
  line-height: 1.45;
}

.family-access-security-icon-v6 {
  display: grid;
  place-items: center;
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 0.8rem;
  background: #fff2e7;
}

.family-access-warning-v6 {
  margin: 0;
  color: #79574a !important;
  font-size: 0.78rem;
  line-height: 1.45;
}

.family-link-reset-card {
  max-width: 590px;
}

.family-link-reset-icon {
  display: grid;
  place-items: center;
  width: 3.25rem;
  height: 3.25rem;
  margin-bottom: 0.75rem;
  border-radius: 1rem;
  background: #fff2e7;
  font-size: 1.45rem;
}

.family-link-impact-list {
  margin-top: 1rem;
}

.family-link-confirm-check {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.7rem;
  align-items: start;
  margin-top: 1rem;
  padding: 0.85rem;
  border: 1px solid rgba(168, 80, 54, 0.16);
  border-radius: 0.9rem;
  background: #fff8f4;
  color: #4f3c36;
  font-weight: 750;
  cursor: pointer;
}

.family-link-confirm-check input {
  width: 1.15rem;
  height: 1.15rem;
  margin: 0.1rem 0 0;
  accent-color: #a85036;
}

@media (max-width: 620px) {
  .family-access-current-head-v6 {
    align-items: flex-start;
    flex-direction: column;
  }

  .family-access-actions-v6 {
    grid-template-columns: 1fr;
  }

  .family-access-actions-v6 .btn,
  .family-access-security-v6 > .btn {
    width: 100%;
  }
}


/* v3.1.4: lock goal changes while a purchase decision is pending */
.goal-detail-actions .btn:disabled {
  cursor: not-allowed;
  opacity: 0.52;
  transform: none;
  box-shadow: none;
  filter: grayscale(0.18);
}

.goal-pending-action-note {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  margin: 0.8rem 0 0;
  padding: 0.72rem 0.82rem;
  border: 1px solid rgba(180, 128, 22, 0.22);
  border-radius: 0.9rem;
  background: rgba(255, 247, 224, 0.82);
  color: #70531b;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.42;
}
