:root {
  --ink: #183735;
  --muted: #657572;
  --paper: #f7f3e9;
  --surface: #fffdf7;
  --surface-strong: #ffffff;
  --line: #dce3dc;
  --forest: #165b57;
  --forest-dark: #104642;
  --mint: #dceee7;
  --orange: #e8783f;
  --gold: #f5a623;
  --gold-soft: #fff0c7;
  --red: #bc3f47;
  --blue: #3d6fb4;
  --shadow: 0 16px 44px rgba(25, 55, 53, 0.11);
  --shadow-small: 0 7px 20px rgba(25, 55, 53, 0.09);
  --radius: 24px;
  --radius-small: 16px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  scroll-behavior: smooth;
  background: var(--paper);
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 12px 12px, rgba(22, 91, 87, 0.045) 1.5px, transparent 1.5px) 0 0 / 24px 24px,
    var(--paper);
  font-family: "Hiragino Sans", "Yu Gothic UI", "Yu Gothic", Meiryo, system-ui, sans-serif;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

button,
input,
select,
textarea {
  color: inherit;
  font: inherit;
}

button,
select,
input[type="checkbox"],
input[type="radio"] {
  cursor: pointer;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(61, 111, 180, 0.45);
  outline-offset: 3px;
}

a {
  color: inherit;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3 {
  line-height: 1.3;
  letter-spacing: 0.02em;
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 8px;
  left: 8px;
  padding: 10px 16px;
  border-radius: 10px;
  color: white;
  background: var(--forest-dark);
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(0);
}

.app-shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  z-index: 50;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 72px;
  padding: max(10px, env(safe-area-inset-top)) 16px 10px;
  border-bottom: 1px solid rgba(22, 91, 87, 0.1);
  background: rgba(247, 243, 233, 0.9);
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  text-decoration: none;
}

.brand-mark,
.setup-brand {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border: 2px solid rgba(255, 255, 255, 0.28);
  color: white;
  background: var(--forest);
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.12), var(--shadow-small);
  font-family: Georgia, serif;
  font-weight: 900;
  letter-spacing: -0.08em;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  font-size: 15px;
}

.brand-copy {
  display: grid;
  line-height: 1;
}

.brand-en {
  font-size: 17px;
  letter-spacing: 0.04em;
}

.brand-en b {
  color: var(--forest-dark);
}

.brand-en em {
  color: var(--orange);
  font-style: normal;
  font-weight: 900;
}

.brand-ja {
  margin-top: 5px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-button {
  display: grid;
  width: 42px;
  height: 42px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--forest-dark);
  background: var(--surface-strong);
  font-weight: 900;
}

.child-switcher {
  display: flex;
  align-items: center;
  min-width: 0;
  padding: 5px 8px 5px 5px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: var(--surface-strong);
  box-shadow: 0 4px 12px rgba(25, 55, 53, 0.05);
}

.child-switcher-avatar {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 50%;
  background: var(--gold-soft);
  font-size: 19px;
  overflow: hidden;
}

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

.child-switcher select {
  max-width: 92px;
  padding: 4px 22px 4px 7px;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 13px;
  font-weight: 800;
  text-overflow: ellipsis;
}

.main-content {
  width: min(100%, 980px);
  min-height: calc(100vh - 154px);
  margin: 0 auto;
  padding: 24px 16px calc(104px + var(--safe-bottom));
}

.bottom-nav {
  position: fixed;
  z-index: 60;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: minmax(60px, auto);
  padding: 6px 8px calc(6px + var(--safe-bottom));
  border-top: 1px solid rgba(22, 91, 87, 0.12);
  background: rgba(255, 253, 247, 0.96);
  box-shadow: 0 -12px 30px rgba(25, 55, 53, 0.07);
  backdrop-filter: blur(18px);
}

.bottom-nav a {
  display: grid;
  width: 100%;
  min-width: 0;
  min-height: 60px;
  padding: 7px 4px;
  place-items: center;
  align-content: center;
  justify-self: stretch;
  align-self: stretch;
  border-radius: 15px;
  color: var(--muted);
  text-decoration: none;
  touch-action: manipulation;
  user-select: none;
}

.bottom-nav a > span {
  font-size: 21px;
  line-height: 1;
  filter: grayscale(0.7);
  pointer-events: none;
}

.bottom-nav small {
  margin-top: 5px;
  font-size: 10px;
  font-weight: 800;
  pointer-events: none;
}

.bottom-nav a.is-active {
  color: var(--forest-dark);
  background: var(--mint);
}

.bottom-nav a.is-active > span {
  filter: none;
}

.view-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.view-header h1 {
  margin-bottom: 0;
  font-size: clamp(25px, 7vw, 38px);
}

.view-header p:last-child {
  margin-bottom: 0;
}

.eyebrow {
  margin-bottom: 5px;
  color: var(--orange);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.muted {
  color: var(--muted);
}

.card {
  border: 1px solid rgba(22, 91, 87, 0.11);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-small);
}

.hero-card {
  position: relative;
  overflow: hidden;
  padding: 27px 24px 24px;
  color: #fffdf7;
  background: var(--forest);
  box-shadow: var(--shadow);
}

.hero-card::before,
.hero-card::after {
  position: absolute;
  content: "";
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 50%;
}

.hero-card::before {
  width: 210px;
  height: 210px;
  top: -118px;
  right: -45px;
}

.hero-card::after {
  width: 120px;
  height: 120px;
  right: 42px;
  bottom: -76px;
}

.hero-topline {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.hero-name {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-size: 15px;
  font-weight: 800;
}

.hero-name span:first-child {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  font-size: 22px;
  overflow: hidden;
}

.status-pill,
.type-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.14);
  font-size: 10px;
  font-weight: 900;
}

.point-balance {
  position: relative;
  z-index: 1;
  margin: 31px 0 22px;
}

.point-balance small {
  display: block;
  margin-bottom: 3px;
  color: rgba(255, 255, 255, 0.75);
  font-size: 12px;
  font-weight: 700;
}

.point-balance strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(58px, 17vw, 82px);
  line-height: 1;
  letter-spacing: -0.04em;
}

.point-balance b {
  margin-left: 8px;
  color: var(--gold-soft);
  font-size: 16px;
  letter-spacing: 0.08em;
}

.target-box {
  position: relative;
  z-index: 1;
  padding: 14px 15px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.1);
}

.target-copy {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  color: rgba(255, 255, 255, 0.87);
  font-size: 11px;
  font-weight: 800;
}

.progress {
  height: 9px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(0, 0, 0, 0.2);
}

.progress > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--gold);
  transition: width 0.4s ease;
}

.birthday-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  padding: 13px 15px;
  border: 1px solid #f0d78e;
  border-radius: 17px;
  background: var(--gold-soft);
  box-shadow: var(--shadow-small);
}

.birthday-banner span {
  font-size: 28px;
}

.birthday-banner p {
  margin: 0;
  font-size: 12px;
}

.birthday-banner b {
  display: block;
  color: #744d05;
}

.section-block {
  margin-top: 30px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.section-heading h2 {
  margin-bottom: 0;
  font-size: 20px;
}

.section-heading a,
.text-button {
  padding: 0;
  border: 0;
  color: var(--forest);
  background: none;
  font-size: 12px;
  font-weight: 900;
  text-decoration: none;
}

.quest-grid {
  display: grid;
  gap: 12px;
}

.quest-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
  min-width: 0;
  padding: 15px;
}

.quest-icon,
.history-icon,
.adult-action-icon {
  display: grid;
  place-items: center;
  border-radius: 17px;
  background: var(--mint);
}

.quest-icon {
  width: 50px;
  height: 50px;
  font-size: 25px;
}

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

.quest-copy h3 {
  overflow: hidden;
  margin: 0 0 3px;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quest-copy p {
  overflow: hidden;
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.point-tag {
  display: inline-grid;
  min-width: 54px;
  min-height: 40px;
  padding: 5px 9px;
  place-items: center;
  border: 1px solid #f1d179;
  border-radius: 13px;
  color: #7b5304;
  background: var(--gold-soft);
  font-family: Georgia, serif;
  font-size: 16px;
  font-weight: 900;
}

button.quest-card {
  width: 100%;
  text-align: left;
}

button.quest-card:hover {
  border-color: rgba(22, 91, 87, 0.35);
  transform: translateY(-1px);
}

.quest-card.is-pending,
button.quest-card.is-pending:disabled {
  cursor: default;
  border-color: #efd487;
  background: #fffbeb;
  opacity: 1;
}

.point-tag.pending {
  min-width: 60px;
  color: #75520d;
  font-family: inherit;
  font-size: 10px;
}

.pending-count {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  min-height: 28px;
  padding: 5px 10px;
  border-radius: 99px;
  color: #76500a;
  background: var(--gold-soft);
  font-size: 10px;
  font-weight: 900;
}

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

.request-card,
.approval-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 14px;
}

.request-icon {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 14px;
  background: var(--gold-soft);
  font-size: 21px;
}

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

.request-copy b,
.request-copy small,
.request-child {
  display: block;
}

.request-copy b {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.request-copy small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
}

.request-child {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 2px;
  color: var(--orange);
  font-size: 9px;
  font-weight: 900;
}

.request-child-avatar {
  display: inline-grid;
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  overflow: hidden;
}

.request-status {
  padding: 5px 8px;
  border-radius: 99px;
  font-size: 9px;
  font-weight: 900;
  white-space: nowrap;
}

.request-status.pending {
  color: #76500a;
  background: var(--gold-soft);
}

.request-status.approved {
  color: var(--forest-dark);
  background: var(--mint);
}

.request-status.declined {
  color: var(--red);
  background: #fceced;
}

.empty-state {
  padding: 32px 22px;
  text-align: center;
}

.empty-state > span {
  display: block;
  margin-bottom: 12px;
  font-size: 42px;
}

.empty-state h2,
.empty-state h3 {
  margin-bottom: 7px;
}

.empty-state p {
  max-width: 420px;
  margin-right: auto;
  margin-bottom: 18px;
  margin-left: auto;
  color: var(--muted);
  font-size: 13px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 46px;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: 15px;
  font-size: 13px;
  font-weight: 900;
  line-height: 1.25;
  text-decoration: none;
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.button-primary {
  color: white;
  background: var(--forest);
  box-shadow: 0 8px 18px rgba(22, 91, 87, 0.2);
}

.button-primary:hover:not(:disabled) {
  background: var(--forest-dark);
}

.button-secondary {
  border-color: var(--line);
  color: var(--forest-dark);
  background: var(--surface-strong);
}

.button-danger {
  color: white;
  background: var(--red);
}

.button-ghost {
  border-color: rgba(22, 91, 87, 0.2);
  color: var(--forest);
  background: var(--mint);
}

.button-text {
  color: var(--forest);
  background: transparent;
}

.button-large {
  width: 100%;
  min-height: 58px;
  border-radius: 18px;
  font-size: 16px;
}

.quick-actions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 14px;
}

.quick-actions .button {
  min-height: 54px;
}

.history-list {
  overflow: hidden;
}

.history-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 15px;
  border-bottom: 1px solid var(--line);
}

.history-item:last-child {
  border-bottom: 0;
}

.history-icon {
  width: 43px;
  height: 43px;
  font-size: 20px;
}

.history-icon.exchange {
  background: #e5ebf7;
}

.history-icon.correction {
  background: #f5e3e4;
}

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

.history-copy h3 {
  overflow: hidden;
  margin: 0 0 2px;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
}

.history-amount {
  text-align: right;
}

.history-amount strong {
  display: block;
  color: var(--forest);
  font-family: Georgia, serif;
  font-size: 17px;
}

.history-amount strong.negative {
  color: var(--red);
}

.history-amount small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
}

.history-actions {
  grid-column: 2 / -1;
  display: flex;
  justify-content: flex-end;
}

.history-date {
  margin: 21px 0 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.adult-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 20px;
  padding: 18px;
  color: white;
  background: var(--forest-dark);
}

.adult-hero p,
.adult-hero h1 {
  margin-bottom: 0;
}

.adult-hero .eyebrow {
  color: #fbd881;
}

.adult-status {
  flex: 0 0 auto;
  padding: 7px 10px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.13);
  font-size: 10px;
  font-weight: 900;
}

.adult-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 11px;
}

.adult-requests {
  margin-bottom: 24px;
}

.approval-card {
  border-left: 4px solid var(--gold);
}

.approval-actions {
  display: flex;
  gap: 6px;
}

.mini-button.approve {
  border-color: var(--forest);
  color: white;
  background: var(--forest);
}

.mini-button.decline {
  border-color: #e4b9bc;
  color: var(--red);
  background: #fff6f6;
}

.empty-request {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 17px;
}

.empty-request > span {
  font-size: 26px;
}

.empty-request p,
.empty-request b,
.empty-request small {
  display: block;
  margin: 0;
}

.empty-request b {
  font-size: 12px;
}

.empty-request small {
  color: var(--muted);
  font-size: 10px;
}

.adult-action {
  min-height: 130px;
  padding: 16px;
  border: 1px solid rgba(22, 91, 87, 0.12);
  border-radius: 20px;
  color: var(--ink);
  background: var(--surface);
  box-shadow: var(--shadow-small);
  text-align: left;
}

.adult-action-icon {
  width: 43px;
  height: 43px;
  margin-bottom: 13px;
  font-size: 21px;
}

.adult-action b,
.adult-action small {
  display: block;
}

.adult-action b {
  font-size: 13px;
}

.adult-action small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

.adult-info {
  display: grid;
  gap: 10px;
  margin-top: 22px;
}

.info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 14px 16px;
}

.info-row span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.info-row b {
  font-size: 12px;
  text-align: right;
}

.setup-page {
  width: min(100%, 780px);
  margin: 0 auto;
  padding: 38px 18px 60px;
}

.setup-hero {
  padding: 20px 8px 34px;
  text-align: center;
}

.setup-brand {
  width: 78px;
  height: 78px;
  margin: 0 auto 20px;
  border-radius: 24px;
  font-size: 26px;
}

.setup-hero h1 {
  margin-bottom: 13px;
  font-size: clamp(32px, 10vw, 52px);
}

.setup-hero > p:last-child {
  max-width: 520px;
  margin: 0 auto;
  color: var(--muted);
  font-size: 13px;
}

.setup-form {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.form-step {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  gap: 15px;
  padding: 25px 20px 20px;
  border: 1px solid rgba(22, 91, 87, 0.12);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-small);
  min-width: 0;
}

.form-step h2 {
  margin-bottom: 0;
  font-size: 21px;
}

.step-number {
  position: absolute;
  top: -10px;
  left: 20px;
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 50%;
  color: white;
  background: var(--orange);
  box-shadow: 0 5px 12px rgba(232, 120, 63, 0.25);
  font-size: 11px;
  font-weight: 900;
}

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

.field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.field > span {
  color: var(--ink);
  font-size: 11px;
  font-weight: 900;
}

.field > span b {
  color: var(--red);
  font-size: 9px;
}

.field > span small {
  color: var(--muted);
  font-size: 9px;
}

.field input,
.field select,
.field textarea,
.modal-body input,
.modal-body select,
.modal-body textarea {
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid #cfd9d1;
  border-radius: 13px;
  outline: 0;
  background: white;
  font-size: 14px;
}

.field textarea,
.modal-body textarea {
  min-height: 88px;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.modal-body input:focus,
.modal-body select:focus,
.modal-body textarea:focus {
  border-color: var(--forest);
  box-shadow: 0 0 0 3px rgba(22, 91, 87, 0.12);
}

.pin-input {
  font-size: 22px !important;
  font-weight: 900;
  letter-spacing: 0.25em;
  text-align: center;
}

.field-help {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.rate-editor {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: end;
  gap: 9px;
}

.rate-equals {
  padding-bottom: 12px;
  color: var(--orange);
  font-size: 21px;
  font-weight: 900;
}

.toggle-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 2px;
}

.toggle-row > span:first-child {
  flex: 1;
}

.toggle-row b,
.toggle-row small {
  display: block;
}

.toggle-row b {
  font-size: 12px;
}

.toggle-row small {
  color: var(--muted);
  font-size: 10px;
}

.toggle-row input {
  position: absolute;
  opacity: 0;
}

.toggle {
  position: relative;
  flex: 0 0 auto;
  width: 48px;
  height: 28px;
  border-radius: 99px;
  background: #cbd3ce;
  transition: 0.2s ease;
}

.toggle::after {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.18);
  content: "";
  transition: 0.2s ease;
}

.toggle-row input:checked + .toggle {
  background: var(--forest);
}

.toggle-row input:checked + .toggle::after {
  transform: translateX(20px);
}

.avatar-picker {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(52px, 1fr));
  gap: 9px;
  max-height: 244px;
  padding: 4px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.avatar-picker label {
  position: relative;
}

.avatar-picker input {
  position: absolute;
  opacity: 0;
}

.avatar-picker span {
  display: grid;
  width: 100%;
  aspect-ratio: 1;
  place-items: center;
  border: 2px solid transparent;
  border-radius: 16px;
  background: var(--mint);
  font-size: 25px;
  overflow: hidden;
  cursor: pointer;
}

.avatar-picker span .sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.avatar-picker input:checked + span {
  border-color: var(--forest);
  background: var(--gold-soft);
  box-shadow: 0 0 0 3px rgba(22, 91, 87, 0.1);
}

.avatar-picker input:focus-visible + span {
  outline: 3px solid rgba(22, 91, 87, 0.35);
  outline-offset: 2px;
}

.avatar-picker-modal {
  max-height: 196px;
}

.sample-quest-list {
  display: grid;
  gap: 9px;
}

.sample-quest {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: white;
}

.sample-quest input {
  width: 20px;
  height: 20px;
  accent-color: var(--forest);
}

.sample-quest-icon {
  font-size: 23px;
}

.sample-quest b,
.sample-quest small {
  display: block;
}

.sample-quest b {
  font-size: 12px;
}

.sample-quest small {
  color: var(--muted);
  font-size: 9px;
}

.sample-quest strong {
  color: #7b5304;
  font-family: Georgia, serif;
  font-size: 14px;
}

.form-error {
  padding: 12px 15px;
  border: 1px solid #e5b7ba;
  border-radius: 13px;
  color: #8f2930;
  background: #fceced;
  font-size: 12px;
  font-weight: 800;
}

.modal {
  width: min(calc(100% - 24px), 560px);
  max-height: min(88vh, 760px);
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 25px;
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 24px 80px rgba(12, 38, 36, 0.28);
}

.modal::backdrop {
  background: rgba(13, 37, 35, 0.63);
  backdrop-filter: blur(5px);
}

.modal-frame {
  display: flex;
  max-height: min(88vh, 760px);
  flex-direction: column;
  margin: 0;
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 15px;
  padding: 21px 21px 15px;
  border-bottom: 1px solid var(--line);
}

.modal-header h2 {
  margin: 0;
  font-size: 21px;
}

.modal-close {
  flex: 0 0 auto;
  font-size: 24px;
}

.modal-body {
  display: grid;
  gap: 15px;
  padding: 20px;
  overflow-y: auto;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  padding: 14px 20px calc(14px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: #fbfaf4;
}

.modal-actions .button {
  flex: 1;
}

.modal-note {
  padding: 12px 14px;
  border-radius: 14px;
  color: var(--muted);
  background: var(--mint);
  font-size: 11px;
}

.modal-note.warning {
  color: #7e5304;
  background: var(--gold-soft);
}

.modal-note.danger {
  color: #8f2930;
  background: #fceced;
}

.modal-stat {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 9px;
}

.modal-stat > div {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: white;
}

.modal-stat small,
.modal-stat strong {
  display: block;
}

.modal-stat small {
  color: var(--muted);
  font-size: 9px;
}

.modal-stat strong {
  margin-top: 2px;
  font-family: Georgia, serif;
  font-size: 20px;
}

.manage-list {
  display: grid;
  gap: 9px;
}

.manage-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: white;
}

.manage-row.is-inactive {
  opacity: 0.55;
}

.manage-row > span:first-child {
  font-size: 22px;
}

.manage-row > .manage-avatar {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 12px;
  background: var(--mint);
  overflow: hidden;
}

.manage-row b,
.manage-row small {
  display: block;
}

.manage-row b {
  font-size: 12px;
}

.manage-row small {
  color: var(--muted);
  font-size: 9px;
}

.manage-actions {
  display: flex;
  gap: 5px;
}

.mini-button {
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--forest);
  background: white;
  font-size: 10px;
  font-weight: 900;
}

.toast {
  position: fixed;
  z-index: 200;
  right: 16px;
  bottom: calc(86px + var(--safe-bottom));
  left: 16px;
  max-width: 430px;
  margin: 0 auto;
  padding: 13px 17px;
  border-radius: 15px;
  color: white;
  background: var(--forest-dark);
  box-shadow: 0 12px 30px rgba(12, 38, 36, 0.24);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
  transform: translateY(140%);
  opacity: 0;
  transition: 0.25s ease;
}

.toast.is-visible {
  transform: translateY(0);
  opacity: 1;
}

.toast.is-error {
  background: var(--red);
}

.noscript {
  max-width: 600px;
  margin: 40px auto;
  padding: 20px;
  border-radius: 18px;
  background: white;
  text-align: center;
}

@media (min-width: 700px) {
  .topbar {
    padding-right: 28px;
    padding-left: 28px;
  }

  .brand-mark {
    width: 48px;
    height: 48px;
  }

  .brand-en {
    font-size: 20px;
  }

  .child-switcher select {
    max-width: 160px;
  }

  .main-content {
    padding: 34px 28px 116px;
  }

  .bottom-nav {
    right: auto;
    bottom: 18px;
    left: 50%;
    width: min(980px, calc(100% - 48px));
    margin: 0 auto;
    padding: 8px;
    border: 1px solid rgba(22, 91, 87, 0.12);
    border-radius: 23px;
    box-shadow: 0 15px 45px rgba(25, 55, 53, 0.16);
    transform: translateX(-50%);
  }

  .hero-card {
    padding: 34px;
  }

  .home-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    align-items: start;
    gap: 24px;
  }

  .home-layout .section-block {
    margin-top: 0;
  }

  .quest-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .adult-grid {
    grid-template-columns: repeat(4, 1fr);
  }

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

  .setup-page {
    padding-top: 56px;
  }

  .form-step {
    padding: 30px;
  }

  .modal-actions .button {
    flex: 0 1 auto;
    min-width: 130px;
  }
}

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