:root {
  color-scheme: light;
  --bg: #fff8ed;
  --surface: #ffffff;
  --surface-strong: #fff1d8;
  --text: #24190f;
  --muted: #7c6a58;
  --line: #f0dfc8;
  --primary: #f58220;
  --primary-dark: #d96000;
  --green: #2f9d69;
  --blue: #536dfe;
  --red: #f16b6b;
  --shadow: 0 18px 45px rgba(107, 74, 34, 0.12);
  font-family:
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    "Noto Sans KR",
    "Apple SD Gothic Neo",
    sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: linear-gradient(180deg, #fff6e7 0%, #fffaf2 100%);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(245, 130, 32, 0.18), transparent 34rem),
    var(--bg);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

[data-open-detail],
[data-open-child],
.checklist-item,
.checklist-item .checklist-copy,
.checklist-item .checklist-copy *,
.mission-add-details summary {
  cursor: pointer;
}

.checklist-item:has(input:disabled) {
  cursor: default;
}

button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(245, 130, 32, 0.28);
  outline-offset: 2px;
}

#app {
  min-height: 100vh;
}

.login-screen,
.app-shell {
  width: min(100%, 480px);
  min-height: 100vh;
  margin: 0 auto;
  background: rgba(255, 250, 242, 0.92);
}

.login-screen {
  padding: max(20px, env(safe-area-inset-top)) 18px 28px;
}

.parent-entry-screen {
  display: grid;
  align-content: start;
  gap: 16px;
}

.brand-card,
.bank-hero,
.home-balance-card,
.home-growth-card,
.home-mission-card,
.permission-card,
.notice-card,
.mission-composer,
.custom-mission-card,
.expense-card,
.card-section,
.stat-card,
.child-card,
.timeline-card,
.growth-card,
.growth-stage-card,
.forest-card,
.mission-card,
.empty-card {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.brand-card {
  display: flex;
  gap: 16px;
  align-items: center;
  padding: 22px;
  margin-bottom: 24px;
  background: linear-gradient(135deg, #fff 0%, #fff0d3 100%);
}

.brand-mark {
  display: grid;
  flex: 0 0 58px;
  width: 58px;
  height: 58px;
  place-items: center;
  border-radius: 20px;
  color: #fff;
  font-size: 28px;
  font-weight: 900;
  background: var(--primary);
}

.brand-card h1,
.top-bar h1,
.screen-heading h2,
.mission-composer h2,
.card-section h2 {
  margin: 0;
}

.brand-card h1 {
  font-size: clamp(24px, 7vw, 34px);
  line-height: 1.15;
  word-break: keep-all;
}

.brand-card p,
.permission-card p,
.notice-card p,
.screen-heading p,
.child-card p,
.forest-card p,
.growth-card p,
.timeline-card p,
.mission-card p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.login-group {
  margin-top: 22px;
}

.login-group h2 {
  margin: 0 0 12px;
  font-size: 18px;
}

.role-list {
  display: grid;
  gap: 10px;
}

.role-card {
  display: grid;
  gap: 7px;
  width: 100%;
  min-height: 96px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 22px;
  color: inherit;
  text-align: left;
  background: var(--surface);
  box-shadow: 0 8px 26px rgba(107, 74, 34, 0.08);
}

.role-card strong {
  font-size: 18px;
}

.role-card small {
  color: var(--muted);
  line-height: 1.4;
}

.invite-login-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.parent-code-card {
  padding: 22px;
  background: linear-gradient(180deg, #fff 0%, #fff6e7 100%);
}

.quick-link-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.quick-link-card h2 {
  margin: 0;
  font-size: 22px;
}

.quick-link-card p {
  margin: 6px 0 14px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 800;
  line-height: 1.45;
  word-break: keep-all;
}

.quick-link-list {
  display: grid;
  gap: 10px;
}

.quick-link-button {
  display: flex;
  min-height: 66px;
  align-items: center;
  justify-content: center;
  border-radius: 18px;
  color: #fff;
  font-size: 20px;
  font-weight: 950;
  text-decoration: none;
}

.quick-link-button.parent {
  background: var(--primary);
}

.quick-link-button.director {
  background: var(--blue);
}

.quick-link-button.teacher {
  background: var(--green);
}

.quick-link-copy-button {
  min-height: 54px;
  border: 1px solid #cfd7ff;
  border-radius: 18px;
  color: #263b9f;
  font-size: 16px;
  font-weight: 950;
  background: #eef2ff;
}

.quick-link-helper {
  margin: 12px 0 0 !important;
  color: var(--muted);
  font-size: 14px !important;
  font-weight: 900;
  line-height: 1.5;
}

.parent-code-card h2 {
  margin: 0;
  font-size: 28px;
  line-height: 1.2;
}

.parent-code-card input {
  min-height: 62px;
  border: 2px solid #ffd39a;
  border-radius: 18px;
  font-size: 20px;
  font-weight: 900;
  text-transform: uppercase;
}

.parent-start-button {
  min-height: 64px;
  font-size: 19px;
}

.home-add-button {
  min-height: 50px;
  border: 1px solid #ffd39a;
  border-radius: 18px;
  padding: 0 14px;
  color: var(--primary-dark);
  font-size: 15px;
  font-weight: 900;
  background: #fff7e8;
}

.admin-login-details {
  border: 1px dashed var(--line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.6);
}

.admin-login-details summary {
  padding: 16px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
}

.admin-login-details > .invite-login-card,
.admin-login-details > .login-group {
  margin: 0 12px 12px;
}

.invite-login-card p,
.invite-login-card small {
  color: var(--muted);
  line-height: 1.5;
  word-break: keep-all;
}

.login-error {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  color: #b42318;
  font-size: 14px;
  font-weight: 900;
  line-height: 1.45;
  background: #fff1f1;
}

.invite-login-card form {
  display: grid;
  gap: 12px;
  margin: 14px 0 10px;
}

.account-login-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.account-login-actions .ghost-button {
  width: 100%;
}

.invite-login-card label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.role-badge,
.mini-badge,
.status-pill,
.tag-row span {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.role-badge {
  padding: 7px 10px;
  color: #8f4c00;
  background: #fff0cf;
}

.app-shell {
  position: relative;
  padding: max(16px, env(safe-area-inset-top)) 16px calc(92px + env(safe-area-inset-bottom));
}

.top-bar {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0 12px;
  background: linear-gradient(180deg, rgba(255, 250, 242, 0.98) 72%, rgba(255, 250, 242, 0));
}

.top-bar h1 {
  font-size: 22px;
}

.ghost-button,
.text-button,
.small-button,
.primary-button,
.home-balance-card,
.home-money-grid button,
.home-mission-card,
.mission-checklist-entry {
  min-height: 44px;
  border: 0;
  border-radius: 999px;
  font-weight: 800;
}

.ghost-button {
  padding: 0 14px;
  color: var(--primary-dark);
  background: #fff1d8;
}

.text-button {
  min-height: auto;
  padding: 6px 0;
  color: var(--primary-dark);
  background: transparent;
}

.danger-text {
  color: var(--red);
}

.primary-button {
  width: 100%;
  padding: 0 18px;
  color: #fff;
  background: var(--primary);
}

.primary-button.parent-start-button {
  min-height: 64px;
  font-size: 19px;
}

.small-button {
  min-height: 36px;
  padding: 0 12px;
  color: #fff;
  background: var(--green);
}

.permission-card {
  margin: 8px 0 14px;
  padding: 20px;
  color: #fff;
  background: linear-gradient(135deg, #f58220 0%, #f2ad37 100%);
}

.permission-card.teacher {
  background: linear-gradient(135deg, #2f9d69 0%, #62c184 100%);
}

.permission-card.parent {
  background: linear-gradient(135deg, #536dfe 0%, #8d9cff 100%);
}

.permission-card .role-badge {
  color: #fff;
  background: rgba(255, 255, 255, 0.22);
}

.permission-card h2 {
  margin: 12px 0 0;
  font-size: 22px;
}

.permission-card p {
  color: rgba(255, 255, 255, 0.88);
}

.toast {
  position: sticky;
  top: 78px;
  z-index: 4;
  margin-bottom: 12px;
  padding: 12px 14px;
  border-radius: 18px;
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  background: rgba(36, 25, 15, 0.9);
  box-shadow: var(--shadow);
}

.screen-content {
  display: grid;
  gap: 16px;
}

.home-dashboard {
  display: grid;
  gap: 12px;
}

.home-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.home-title-actions {
  display: grid;
  justify-items: end;
  gap: 8px;
}

.home-title-row h2 {
  margin: 0;
  font-size: 24px;
}

.home-balance-card {
  width: 100%;
  border-radius: 24px;
  padding: 24px 22px;
  color: #fff;
  text-align: left;
  background:
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.32), transparent 11rem),
    linear-gradient(135deg, #f58220 0%, #f3ad31 100%);
}

.teacher-child-inline {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: 0 10px 28px rgba(107, 74, 34, 0.08);
}

.teacher-child-inline form {
  display: grid;
  gap: 10px;
}

.teacher-child-inline label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.teacher-child-inline-list {
  display: grid;
  gap: 10px;
}

.teacher-child-inline-list .empty-card {
  box-shadow: none;
}

.home-balance-card span,
.home-money-grid span,
.home-card-heading span {
  display: block;
  font-size: 13px;
  font-weight: 800;
}

.home-balance-card span {
  color: rgba(255, 255, 255, 0.82);
}

.home-balance-card strong {
  display: block;
  margin-top: 8px;
  font-size: clamp(40px, 12vw, 58px);
  font-weight: 950;
  line-height: 1;
  letter-spacing: -0.05em;
}

.home-money-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.home-money-grid button {
  width: 100%;
  min-height: 86px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 22px;
  color: inherit;
  text-align: left;
  background: var(--surface);
  box-shadow: 0 10px 28px rgba(107, 74, 34, 0.08);
}

.home-money-grid span,
.home-card-heading span {
  color: var(--muted);
}

.home-money-grid strong {
  display: block;
  margin-top: 8px;
  font-size: 22px;
  font-weight: 950;
}

.home-money-grid .deposit {
  color: var(--green);
}

.home-money-grid .expense {
  color: var(--red);
}

.home-growth-card,
.home-mission-card {
  display: grid;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 24px;
  gap: 12px;
  padding: 18px;
  color: inherit;
  text-align: left;
  box-shadow: 0 10px 28px rgba(107, 74, 34, 0.08);
}

.home-growth-card.flat,
.home-mission-card.flat {
  box-shadow: none;
}

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

.home-card-heading strong {
  display: block;
  margin-top: 5px;
  font-size: 20px;
}

.home-card-heading small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.home-growth-list,
.home-mission-list {
  display: grid;
  gap: 8px;
}

.home-growth-row,
.home-mission-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border-radius: 18px;
  background: #fffaf2;
}

.home-growth-row {
  width: 100%;
  border: 0;
  color: inherit;
  text-align: left;
}

.home-growth-row div,
.home-mission-row div {
  display: grid;
  gap: 4px;
}

.home-growth-row strong,
.home-mission-row strong {
  font-size: 15px;
}

.home-growth-row span,
.home-mission-row span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.home-growth-row p {
  margin: 0;
  color: var(--primary-dark);
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.home-mission-row.done {
  background: #f4fbf6;
}

.home-chevron {
  display: inline-flex;
  flex: 0 0 auto;
  min-height: 32px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0 10px;
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 900;
  background: #fff0cf;
}

.detail-screen {
  display: grid;
  gap: 14px;
}

.detail-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.detail-header h2 {
  margin: 0;
  font-size: 22px;
}

.child-detail-hero,
.checklist-hero,
.director-card,
.mission-editor-card,
.mission-checklist-entry {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: 0 10px 28px rgba(107, 74, 34, 0.08);
}

.child-detail-hero {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 18px;
}

.director-card {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.mission-editor-card {
  display: grid;
  gap: 14px;
  padding: 18px;
  background: #f4fbf6;
}

.director-card form,
.mission-editor-card form {
  display: grid;
  gap: 12px;
}

.director-card label,
.mission-editor-card label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.invite-code-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fffaf2;
}

.invite-code-row strong {
  display: block;
  font-size: 16px;
  letter-spacing: 0.02em;
}

.invite-code-row p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.invite-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.classroom-row,
.child-management-row {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fffaf2;
}

.classroom-edit-form,
.class-child-edit-form,
.teacher-child-edit-form {
  display: grid;
  gap: 10px;
}

.classroom-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
}

.icon-button.child-manage {
  color: #fff;
  background: var(--blue);
}

.child-management-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.child-management-meta span {
  margin-right: auto;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.child-class-name {
  margin-left: 6px;
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 900;
}

.avatar.big {
  flex-basis: 62px;
  width: 62px;
  height: 62px;
  border-radius: 24px;
  font-size: 26px;
}

.child-detail-hero h3 {
  margin: 0;
  font-size: 24px;
}

.child-detail-hero p {
  margin: 6px 0 0;
  color: var(--muted);
  font-weight: 800;
}

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

.detail-summary-grid article {
  min-height: 82px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
}

.detail-summary-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.detail-summary-grid strong {
  display: block;
  margin-top: 8px;
  font-size: 15px;
  font-weight: 950;
}

.card-section.compact {
  padding: 16px;
  box-shadow: 0 10px 28px rgba(107, 74, 34, 0.08);
}

.checklist-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 20px;
  color: #fff;
  background: linear-gradient(135deg, var(--green), #7bcf86);
}

.checklist-hero .eyebrow,
.checklist-hero p,
.checklist-hero .filter-label {
  color: rgba(255, 255, 255, 0.84);
}

.checklist-hero h3 {
  margin: 0;
  font-size: 32px;
}

.filter-label.light select {
  border-color: rgba(255, 255, 255, 0.44);
  background: rgba(255, 255, 255, 0.94);
}

.checklist-money-summary {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 8px;
}

.checklist-money-summary article {
  min-height: 104px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: 0 10px 28px rgba(107, 74, 34, 0.08);
}

.checklist-money-summary article:first-child {
  color: #fff;
  background: linear-gradient(135deg, #f58220 0%, #f3ad31 100%);
}

.checklist-money-summary span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.checklist-money-summary article:first-child span {
  color: rgba(255, 255, 255, 0.82);
}

.checklist-money-summary strong {
  display: block;
  margin-top: 10px;
  color: var(--green);
  font-size: clamp(20px, 6vw, 30px);
  font-weight: 950;
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.checklist-money-summary article:first-child strong {
  color: #fff;
  font-size: clamp(26px, 8vw, 40px);
}

.checklist-groups {
  display: grid;
  gap: 12px;
}

.checklist-card {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: 0 10px 28px rgba(107, 74, 34, 0.08);
}

.checklist-child-heading {
  display: flex;
  align-items: center;
  gap: 12px;
}

.checklist-child-heading strong {
  display: block;
  font-size: 18px;
}

.checklist-child-heading span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.checklist-items {
  display: grid;
  gap: 9px;
}

.extra-mission-section {
  display: grid;
  gap: 10px;
  margin-top: 4px;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
}

.compact-heading {
  margin-bottom: 0;
  align-items: center;
}

.compact-heading h3 {
  margin: 2px 0 0;
  font-size: 16px;
}

.checklist-item {
  position: relative;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  gap: 13px;
  align-items: center;
  min-height: 68px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fffaf2;
}

.checklist-item.done {
  border-color: #ccefd8;
  background: #f4fbf6;
}

.checklist-item.editable {
  border-color: #ccefd8;
}

.checklist-checkbox {
  width: 38px;
  height: 38px;
  min-height: 38px;
  margin: 0;
  cursor: pointer;
  accent-color: var(--green);
}

.checklist-copy {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.checklist-copy strong {
  font-size: 18px;
  letter-spacing: -0.02em;
}

.checklist-copy strong .mission-source {
  display: inline-flex;
  margin-left: 6px;
  padding: 5px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
  vertical-align: middle;
}

.mission-source.standard {
  color: #8a5a14;
  background: #fff2cf;
}

.mission-source.teacher {
  color: #0f6b46;
  background: #dff7e8;
}

.mission-source.parent {
  color: #3852c5;
  background: #eef2ff;
}

.checklist-copy small {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--green);
  font-size: 13px;
  font-weight: 950;
}

.mission-row-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.icon-button {
  min-height: 34px;
  border: 0;
  border-radius: 999px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
  cursor: pointer;
}

.icon-button.edit {
  color: #0f6b46;
  background: #dff7e8;
}

.icon-button.delete {
  color: #fff;
  background: var(--red);
}

.mission-checklist-entry {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 20px;
  color: inherit;
  text-align: left;
}

.mission-checklist-entry span:not(.home-chevron) {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.mission-checklist-entry strong {
  display: block;
  margin-top: 6px;
  font-size: 22px;
}

.mission-checklist-entry p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.stat-card {
  min-height: 98px;
  padding: 16px;
  box-shadow: 0 10px 28px rgba(107, 74, 34, 0.08);
}

.stat-card span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.stat-card strong {
  display: block;
  margin-top: 9px;
  font-size: 21px;
}

.notice-card,
.mission-composer,
.custom-mission-card,
.expense-card,
.card-section {
  padding: 18px;
}

.notice-card {
  background: var(--surface-strong);
}

.notice-card.secure {
  background: #eef2ff;
}

.bank-hero {
  display: grid;
  gap: 16px;
  padding: 22px;
  color: #fff;
  background:
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.24), transparent 12rem),
    linear-gradient(135deg, #f58220 0%, #f3ad31 100%);
}

.bank-hero .eyebrow,
.bank-hero .filter-label {
  color: rgba(255, 255, 255, 0.82);
}

.bank-hero-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.bank-hero-top span {
  display: block;
  margin-top: 8px;
  color: rgba(255, 255, 255, 0.84);
  font-weight: 800;
}

.bank-hero-top strong {
  display: block;
  margin-top: 4px;
  font-size: clamp(38px, 11vw, 54px);
  font-weight: 950;
  line-height: 1;
  letter-spacing: -0.05em;
}

.bank-hero select {
  border-color: rgba(255, 255, 255, 0.44);
  color: var(--text);
  background: rgba(255, 255, 255, 0.94);
}

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

.bank-summary-grid article {
  min-height: 82px;
  padding: 13px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.18);
}

.bank-summary-grid span {
  display: block;
  color: rgba(255, 255, 255, 0.78);
  font-size: 12px;
  font-weight: 800;
}

.bank-summary-grid strong {
  display: block;
  margin-top: 8px;
  font-size: 16px;
  font-weight: 950;
  word-break: keep-all;
}

.bank-summary-grid .deposit {
  color: #eaffe9;
}

.bank-summary-grid .expense {
  color: #fff0f0;
}

.section-heading,
.screen-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.section-heading {
  margin-bottom: 12px;
}

.screen-heading {
  padding: 4px 0;
}

.screen-heading.stacked {
  display: block;
}

.screen-heading h2 {
  font-size: 24px;
}

.child-list,
.card-section,
.forest-grid {
  display: grid;
  gap: 12px;
}

.child-card {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 14px;
  box-shadow: none;
}

.avatar {
  display: grid;
  flex: 0 0 48px;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 18px;
  color: #fff;
  font-size: 20px;
  font-weight: 900;
  background: linear-gradient(135deg, var(--primary), #ffd15c);
}

.child-main {
  min-width: 0;
  flex: 1;
}

.child-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.child-title span {
  color: var(--muted);
  font-size: 13px;
}

.progress-bar {
  overflow: hidden;
  height: 8px;
  margin-top: 10px;
  border-radius: 999px;
  background: #f4e4cf;
}

.progress-bar.large {
  height: 12px;
}

.progress-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), #9ad95f);
}

.filter-label {
  display: grid;
  gap: 6px;
  min-width: 128px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

select,
input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 0 12px;
  color: var(--text);
  background: var(--surface);
}

.timeline-card,
.mission-card,
.growth-card {
  padding: 16px;
  box-shadow: none;
}

.timeline-card,
.mission-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.timeline-card small {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  line-height: 1.45;
}

.amount,
.seed {
  color: var(--green);
  font-weight: 900;
  white-space: nowrap;
}

.amount.expense {
  color: var(--red);
}

.transaction-card.expense {
  background: #fff8f8;
}

.forest-card {
  padding: 18px;
  text-align: center;
  box-shadow: none;
}

.tree-icon {
  font-size: 42px;
  line-height: 1;
  margin-bottom: 10px;
}

.growth-meta,
.growth-stage-top,
.mission-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.growth-meta {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.growth-card h3 {
  margin: 10px 0 0;
}

.growth-stage-list {
  display: grid;
  gap: 12px;
}

.growth-stage-card {
  display: grid;
  gap: 16px;
  padding: 18px;
  box-shadow: var(--shadow);
}

.growth-celebration {
  padding: 12px 14px;
  border-radius: 18px;
  color: #8f4c00;
  font-size: 14px;
  font-weight: 900;
  line-height: 1.45;
  background: linear-gradient(135deg, #fff7d6, #ffe4a8);
  animation: celebration-pop 1.15s ease-in-out;
}

@keyframes celebration-pop {
  0% {
    transform: scale(0.96);
    opacity: 0.65;
  }

  55% {
    transform: scale(1.02);
    opacity: 1;
  }

  100% {
    transform: scale(1);
  }
}

.growth-stage-top {
  align-items: flex-start;
}

.growth-stage-top h3 {
  margin: 0;
  font-size: 22px;
}

.growth-stage-top p {
  margin: 7px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.stage-count {
  display: inline-flex;
  flex: 0 0 auto;
  min-width: 54px;
  min-height: 54px;
  align-items: center;
  justify-content: center;
  border-radius: 20px;
  color: #fff;
  font-weight: 900;
  background: linear-gradient(135deg, var(--green), #9ad95f);
}

.stage-list {
  display: grid;
  gap: 10px;
}

.stage-row {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fffaf2;
}

.stage-row.achieved {
  border-color: #ccefd8;
  background: #f4fbf6;
}

.stage-marker {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 999px;
  color: var(--muted);
  font-weight: 900;
  background: #f1e2cf;
}

.stage-row.achieved .stage-marker {
  color: #fff;
  background: var(--green);
}

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

.stage-copy p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.stage-button {
  min-height: 38px;
  padding: 0 10px;
  border: 0;
  border-radius: 999px;
  color: #8a5a14;
  font-size: 12px;
  font-weight: 900;
  background: #fff2cf;
  white-space: nowrap;
}

.stage-row.achieved .stage-button {
  color: #197146;
  background: #dff7e8;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 14px 0 10px;
}

.tag-row span {
  padding: 7px 9px;
  color: var(--blue);
  background: #eef2ff;
}

.mission-composer form {
  display: grid;
  gap: 12px;
}

.mission-composer label,
.custom-mission-card label,
.expense-card label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.custom-mission-card form,
.expense-card form {
  display: grid;
  gap: 12px;
}

.mission-add-details {
  display: grid;
  gap: 12px;
}

.mission-add-details summary {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: #fff;
  font-size: 16px;
  font-weight: 950;
  list-style: none;
  background: var(--primary);
  cursor: pointer;
}

.mission-add-details summary::-webkit-details-marker {
  display: none;
}

.mission-add-details[open] summary {
  margin-bottom: 12px;
}

.mission-target-box,
.mission-repeat-box {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fffaf2;
}

.mission-target-box legend,
.mission-repeat-box legend {
  padding: 0 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.target-child-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.target-check {
  color: var(--text) !important;
  font-size: 14px !important;
}

.mission-editor-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.danger-button {
  min-height: 44px;
  border: 0;
  border-radius: 999px;
  padding: 0 18px;
  color: #fff;
  font-weight: 900;
  background: var(--red);
}

.expense-card {
  background: #fff8f8;
}

.expense-button {
  background: var(--red);
}

.helper-text {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.form-row {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(92px, 0.7fr);
  gap: 10px;
}

.check-label {
  display: flex !important;
  flex-direction: row;
  align-items: center;
  gap: 9px !important;
}

.check-label input {
  width: 20px;
  min-height: 20px;
  accent-color: var(--primary);
}

.mission-card.done {
  background: #f4fbf6;
}

.mission-title {
  align-items: flex-start;
}

.mission-title span {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 5px 8px;
  color: var(--primary-dark);
  font-size: 11px;
  font-weight: 900;
  background: #fff0cf;
}

.mission-actions {
  display: grid;
  justify-items: end;
  gap: 8px;
}

.status-pill {
  padding: 7px 9px;
  color: #8a5a14;
  background: #fff2cf;
}

.status-pill.success,
.mission-card.done .status-pill {
  color: #197146;
  background: #dff7e8;
}

.mini-badge {
  padding: 7px 9px;
  color: var(--muted);
  background: #f6ead9;
}

.empty-card {
  padding: 22px;
  color: var(--muted);
  text-align: center;
  box-shadow: none;
}

.bottom-nav {
  position: fixed;
  right: 50%;
  bottom: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  width: min(100%, 480px);
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 -12px 34px rgba(107, 74, 34, 0.12);
  transform: translateX(50%);
  backdrop-filter: blur(18px);
}

.bottom-nav button {
  display: grid;
  min-height: 58px;
  place-items: center;
  border: 0;
  border-radius: 18px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  background: transparent;
}

.bottom-nav button span {
  display: block;
  font-size: 20px;
}

.bottom-nav button.active {
  color: var(--primary-dark);
  background: #fff0cf;
}

@media (min-width: 720px) {
  body {
    padding: 24px 0;
  }

  .login-screen,
  .app-shell {
    min-height: calc(100vh - 48px);
    border: 1px solid var(--line);
    border-radius: 34px;
    box-shadow: 0 30px 80px rgba(107, 74, 34, 0.18);
  }

  .bottom-nav {
    bottom: 24px;
    border: 1px solid var(--line);
    border-radius: 28px;
  }
}

@media (max-width: 420px) {
  .login-screen {
    padding: max(16px, env(safe-area-inset-top)) 14px 24px;
  }

  .brand-card {
    gap: 12px;
    padding: 18px;
    margin-bottom: 18px;
  }

  .brand-mark {
    flex-basis: 48px;
    width: 48px;
    height: 48px;
    border-radius: 16px;
    font-size: 24px;
  }

  .brand-card h1 {
    font-size: 26px;
  }

  .brand-card p:not(.eyebrow),
  .invite-login-card p,
  .invite-login-card small,
  .role-card small {
    font-size: 14px;
  }

  .parent-code-card {
    padding: 20px;
  }

  .parent-code-card h2 {
    font-size: 26px;
  }

  .parent-code-card input {
    font-size: 19px;
  }

  .login-group {
    margin-top: 16px;
  }

  .invite-login-card,
  .role-card {
    border-radius: 20px;
  }
}

@media (max-width: 360px) {
  .app-shell {
    padding-inline: 12px;
  }

  .stats-grid,
  .home-money-grid,
  .detail-summary-grid,
  .checklist-money-summary,
  .target-child-grid,
  .bank-summary-grid,
  .form-row {
    grid-template-columns: 1fr;
  }

  .home-title-row,
  .home-title-actions,
  .home-card-heading,
  .home-growth-row,
  .home-mission-row,
  .checklist-item,
  .checklist-hero,
  .mission-checklist-entry,
  .bank-hero-top,
  .timeline-card,
  .mission-card,
  .screen-heading,
  .growth-stage-top {
    flex-direction: column;
    align-items: stretch;
  }

  .mission-actions {
    justify-items: stretch;
  }

  .stage-row {
    grid-template-columns: 30px minmax(0, 1fr);
  }

  .stage-button {
    grid-column: 1 / -1;
  }

  .mission-row-actions {
    grid-column: 2 / -1;
    justify-content: flex-start;
  }
}
