:root {
  --bg: #fbf5ec;
  --surface: #fffdfa;
  --surface-2: #fff8ef;
  --ink: #45362c;
  --muted: #9a8576;
  --line: #f0e1d1;
  --orange: #ef8b42;
  --orange-dark: #d96c2d;
  --coral: #f5b07e;
  --yellow: #ffd975;
  --green: #9fca9d;
  --green-dark: #548166;
  --blue: #a7cddd;
  --pink: #f3b8af;
  --shadow: 0 10px 32px rgba(135,91,50,.09);
  --radius: 22px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: radial-gradient(circle at 0 0,#fffaf2 0,#fbf5ec 42%,#f8efe4 100%);
  color: var(--ink);
  font-family: "Hiragino Maru Gothic ProN","Yu Gothic",system-ui,sans-serif;
  line-height: 1.65;
  font-size: 15px;
}

a {
  color: inherit;
  text-decoration: none;
}

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

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
  padding-bottom: 84px;
}

.topbar {
  height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 max(22px,calc((100vw - 1180px)/2));
  border-bottom: 1px solid rgba(224,204,181,.7);
  background: rgba(255,253,250,.8);
  backdrop-filter: blur(16px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--orange-dark);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 14px;
  background: #ffe3c9;
  color: var(--orange-dark);
  font-size: 24px;
  line-height: 1;
}

.brand b {
  display: block;
  font-size: 16px;
  letter-spacing: .04em;
}

.brand small {
  display: block;
  font-size: 10px;
  color: var(--muted);
  letter-spacing: .08em;
}

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

.icon-button {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--line);
  color: var(--muted);
  font-weight: 800;
  background: #fff;
}

.profile-chip {
  display: flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fffaf4;
  padding: 6px 11px 6px 7px;
  color: var(--ink);
  font-size: 13px;
}

.profile-chip span:first-child {
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  background: #ffe7cd;
}

.profile-chip i {
  font-style: normal;
  color: var(--muted);
  font-size: 12px;
}

.page-wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 34px 26px;
}

.eyebrow {
  color: var(--orange-dark);
  font-weight: 900;
  letter-spacing: .16em;
  font-size: 10px;
  line-height: 1.3;
}

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

.lead {
  color: #806b5b;
  font-size: 17px;
  line-height: 1.9;
}

.page-heading,
.section-heading,
.panel-title,
.library-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.page-heading h1,
.page-heading h2,
.section-heading h2,
.panel-title h2 {
  margin: 4px 0 3px;
  letter-spacing: .01em;
}

.page-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.page-heading h1 {
  font-size: 32px;
  color: var(--ink);
}

h1 {
  font-size: 32px;
  line-height: 1.35;
}

h2 {
  font-size: 22px;
  line-height: 1.4;
}

h3 {
  font-size: 16px;
  line-height: 1.45;
  margin: 0;
}

.button {
  border: 0;
  border-radius: 13px;
  padding: 11px 17px;
  font-weight: 900;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
  transition: .2s ease;
  min-height: 42px;
}

.button:hover {
  transform: translateY(-1px);
}

.button-primary {
  background: var(--orange);
  color: #fff;
  box-shadow: 0 6px 14px rgba(239,139,66,.23);
}

.button-primary:hover {
  background: var(--orange-dark);
}

.button-soft {
  background: #fff0df;
  color: var(--orange-dark);
}

.button-ghost {
  background: #fff;
  color: var(--muted);
  border: 1px solid var(--line);
}

.button-light {
  background: #fffaf1;
  color: var(--orange-dark);
}

.button-large {
  min-height: 52px;
  padding: 14px 20px;
  font-size: 14px;
}

.full {
  width: 100%;
}

.text-link {
  color: var(--orange-dark);
  font-size: 12px;
  font-weight: 900;
}

.soft-badge,
.status-pill,
.category-label,
.frequency-label,
.point-label,
.kind-label {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
}

.soft-badge {
  padding: 5px 10px;
  color: var(--green-dark);
  background: #edf6eb;
}

.category-label {
  color: #ad7650;
  background: #fff3e7;
  padding: 3px 9px;
}

.frequency-label {
  color: #6f8f9a;
  background: #eef7fa;
  padding: 3px 9px;
}

.point-label {
  color: var(--orange-dark);
  background: #fff4e4;
  padding: 3px 9px;
}

.status-pill {
  padding: 4px 9px;
}

.status-pill.pending {
  background: #fff1c8;
  color: #a47819;
}

.status-pill.approved {
  background: #eaf6e8;
  color: #5b9060;
}

.status-pill.rejected {
  background: #fff0ec;
  color: #c06f62;
}

.toast-stack {
  position: fixed;
  right: 20px;
  top: 88px;
  z-index: 40;
  display: grid;
  gap: 8px;
  max-width: min(380px,calc(100vw - 40px));
}

.toast {
  padding: 12px 16px;
  border: 1px solid #f2d49d;
  border-radius: 15px;
  background: #fff8e3;
  color: #80601d;
  box-shadow: var(--shadow);
  font-size: 13px;
  font-weight: 800;
  animation: toast-in .35s ease;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.hero-banner {
  display: grid;
  grid-template-columns: 1fr 1.05fr;
  align-items: center;
  min-height: 340px;
  padding: 38px 46px;
  border-radius: 28px;
  background: linear-gradient(115deg,#fff0dc,#fff8ef 58%,#eef5e7);
  overflow: hidden;
  position: relative;
  box-shadow: var(--shadow);
}

.hero-banner:after {
  content: "";
  position: absolute;
  width: 230px;
  height: 230px;
  border-radius: 50%;
  background: rgba(255,214,139,.18);
  right: -70px;
  top: -95px;
}

.hero-banner h1 {
  margin: 10px 0 10px;
  font-size: 36px;
}

.hero-banner h1 em,
.setup-copy h1 em {
  font-style: normal;
  color: var(--orange-dark);
}

.hero-banner p {
  max-width: 380px;
  color: #806b5b;
  line-height: 1.9;
}

.hero-banner img {
  width: 100%;
  max-height: 310px;
  object-fit: contain;
  position: relative;
  z-index: 1;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(3,1fr);
  gap: 16px;
  margin-bottom: 28px;
}

.metric-card {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 19px 21px;
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow);
  background: #fff;
}

.metric-orange {
  background: #fff4e6;
}

.metric-green {
  background: #f0f7ec;
}

.metric-blue {
  background: #eff7fa;
}

.metric-icon {
  display: grid;
  place-items: center;
  width: 45px;
  height: 45px;
  border-radius: 15px;
  background: #fff;
  color: var(--orange-dark);
  font-size: 22px;
  font-weight: 900;
}

.metric-green .metric-icon {
  color: var(--green-dark);
}

.metric-blue .metric-icon {
  color: #5c93a6;
}

.metric-card small,
.point-wallet small,
.wallet-banner small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.metric-card strong {
  display: block;
  font-size: 26px;
  line-height: 1.2;
}

.metric-card strong i,
.point-wallet strong i,
.wallet-banner strong i,
.detail-points i,
.report-row strong i,
.reward-content strong i {
  font-style: normal;
  font-size: 12px;
  margin-left: 2px;
}

.metric-note {
  display: block;
  color: #aa9383;
  font-size: 10px;
  margin-top: 2px;
}

.content-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 18px;
}

.panel-card {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: #fffdf9;
  box-shadow: var(--shadow);
}

.panel-title {
  margin-bottom: 17px;
}

.panel-title h2 {
  font-size: 19px;
}

.balance-row {
  display: grid;
  grid-template-columns: 39px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid #f4e9dd;
  position: relative;
}

.balance-row:last-child {
  border-bottom: 0;
}

.avatar {
  display: grid;
  place-items: center;
  width: 39px;
  height: 39px;
  border-radius: 50%;
  background: #ffe9d1;
  font-size: 20px;
}

.avatar-sm {
  width: 34px;
  height: 34px;
  font-size: 17px;
}

.balance-name {
  font-weight: 900;
  font-size: 13px;
}

.balance-name small {
  display: block;
  font-weight: 500;
  color: var(--muted);
  font-size: 10px;
}

.balance-points {
  font-weight: 900;
  color: var(--orange-dark);
  font-size: 16px;
}

.balance-points i {
  font-size: 10px;
  font-style: normal;
  margin-left: 2px;
}

.mini-bar {
  position: absolute;
  left: 49px;
  right: 56px;
  bottom: 4px;
  height: 3px;
  border-radius: 99px;
  background: #f2e8dc;
}

.mini-bar i {
  display: block;
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg,#fac288,var(--orange));
}

.approval-mini {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 13px 0;
  border-bottom: 1px solid #f4e9dd;
}

.approval-mini:last-child {
  border-bottom: 0;
}

.approval-mini div:nth-child(2) {
  flex: 1;
}

.approval-mini b,
.approval-mini small {
  display: block;
}

.approval-mini b {
  font-size: 13px;
}

.approval-mini small {
  font-size: 11px;
  color: var(--muted);
}

.task-icon {
  display: grid;
  place-items: center;
  width: 39px;
  height: 39px;
  border-radius: 14px;
  background: #fff0dc;
  font-size: 20px;
  flex: 0 0 auto;
}

.task-icon.big {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  font-size: 28px;
}

.round-arrow {
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  border-radius: 50%;
  background: #fff0df;
  color: var(--orange-dark);
  font-weight: 900;
}

.empty-illustration {
  text-align: center;
  padding: 26px;
  color: var(--green-dark);
  font-size: 33px;
}

.empty-illustration p {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.7;
}

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

.quick-card {
  display: grid;
  grid-template-columns: 44px 1fr;
  align-items: center;
  column-gap: 12px;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 4px 16px rgba(135,91,50,.06);
}

.quick-card span {
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: #fff0df;
  color: var(--orange-dark);
  font-size: 22px;
  font-weight: 900;
}

.quick-card b {
  font-size: 13px;
}

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

.child-welcome {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}

.child-welcome h1 {
  font-size: 28px;
  margin: 8px 0 3px;
}

.child-welcome h1 span {
  font-size: 25px;
}

.child-welcome p {
  color: var(--muted);
  margin: 0;
}

.point-wallet,
.wallet-banner {
  display: flex;
  align-items: center;
  gap: 12px;
}

.point-wallet {
  padding: 14px 20px;
  border-radius: 19px;
  background: #fff5db;
  border: 1px solid #f5dfa9;
}

.point-wallet>span,
.wallet-icon {
  display: grid;
  place-items: center;
  width: 47px;
  height: 47px;
  border-radius: 16px;
  background: #ffcf59;
  color: #fff;
  font-size: 25px;
}

.point-wallet strong,
.wallet-banner strong {
  display: block;
  color: #ac7921;
  font-size: 25px;
  line-height: 1.15;
}

.progress-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 24px 28px;
  border-radius: 22px;
  background: linear-gradient(100deg,#8fbd95,#bfd9ad);
  color: #fff;
  margin-bottom: 29px;
  box-shadow: var(--shadow);
}

.progress-card .eyebrow {
  color: #eef9df;
}

.progress-card h2 {
  margin: 6px 0 3px;
  font-size: 21px;
}

.progress-card p {
  margin: 0;
  font-size: 12px;
  color: #eff9ec;
}

.child-task-list {
  display: grid;
  gap: 14px;
}

.child-task-card {
  display: flex;
  gap: 16px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 21px;
  background: #fff;
  box-shadow: 0 5px 18px rgba(135,91,50,.06);
}

.child-task-card.status-pending {
  background: #fffaf0;
  border-color: #f3d58d;
}

.child-task-main {
  flex: 1;
}

.task-labels {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.child-task-main h3 {
  font-size: 17px;
  margin: 8px 0 3px;
}

.child-task-main p {
  font-size: 12px;
  color: var(--muted);
  margin: 0 0 13px;
}

.complete-button {
  width: 100%;
  margin-top: 15px;
}

.reject-note {
  display: block;
  color: #c06f62;
  font-size: 11px;
  margin-top: 5px;
}

.count-label,
.big-count {
  color: var(--orange-dark);
  font-weight: 900;
}

.big-count {
  font-size: 38px;
  line-height: 1;
}

.big-count small {
  font-size: 13px;
  margin-left: 3px;
}

.child-tip,
.admin-note,
.report-callout,
.guide-note {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 15px 18px;
  border-radius: 17px;
  background: #fff7e7;
  color: #886b3c;
  margin-top: 20px;
}

.child-tip span,
.admin-note>span,
.report-callout>span {
  font-size: 20px;
}

.child-tip p,
.admin-note p,
.report-callout p,
.guide-note p {
  margin: 0;
  font-size: 12px;
  line-height: 1.8;
}

.filter-bar {
  display: flex;
  gap: 9px;
  align-items: center;
  margin-bottom: 19px;
  flex-wrap: wrap;
}

.filter-bar form {
  display: flex;
}

.search-form {
  flex: 1;
  min-width: 180px;
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
  padding: 0 12px;
  color: var(--muted);
}

.search-form input {
  border: 0;
  outline: 0;
  width: 100%;
  padding: 10px;
  background: transparent;
}

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

.admin-task-card {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 17px 18px;
  border: 1px solid var(--line);
  border-radius: 19px;
  background: #fff;
}

.admin-task-card.has-pending {
  border-color: #f1d28d;
  background: #fffaf1;
}

.admin-task-body {
  flex: 1;
  min-width: 0;
}

.admin-task-body h3 {
  font-size: 15px;
  margin: 7px 0 3px;
}

.admin-task-body p {
  font-size: 11px;
  color: var(--muted);
  margin: 0 0 7px;
}

.task-meta {
  display: flex;
  gap: 12px;
  align-items: center;
  color: var(--muted);
  font-size: 11px;
}

.task-meta b {
  color: var(--ink);
}

.admin-task-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.admin-task-actions .button {
  min-height: 36px;
  padding: 7px 10px;
  font-size: 11px;
}

.icon-action {
  border: 0;
  background: #fff1e4;
  color: var(--orange-dark);
  width: 32px;
  height: 32px;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 900;
}

.icon-action.danger {
  background: #fff2ef;
  color: #ca756d;
}

.admin-task-actions form {
  display: inline;
}

.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(71,48,35,.3);
  padding: 22px;
  align-items: center;
  justify-content: center;
}

.modal-backdrop.open {
  display: flex;
}

.modal-card {
  position: relative;
  width: min(560px,100%);
  max-height: calc(100vh - 44px);
  overflow: auto;
  padding: 30px;
  border: 1px solid #f1dfcc;
  border-radius: 24px;
  background: #fffdf9;
  box-shadow: 0 20px 60px rgba(71,48,35,.2);
}

.small-modal {
  width: min(430px,100%);
}

.modal-close {
  position: absolute;
  right: 16px;
  top: 13px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 25px;
}

.stack-form {
  display: grid;
  gap: 14px;
}

.stack-form label {
  display: grid;
  gap: 6px;
  color: #765f50;
  font-weight: 800;
  font-size: 12px;
}

.stack-form input,
.stack-form select,
.stack-form textarea,
.member-add-form input,
.member-add-form select,
.settings-inline input,
.thanks-form input,
.thanks-form select,
.month-picker input,
.assignment-row select {
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
  padding: 10px 11px;
  color: var(--ink);
  outline-color: var(--coral);
}

textarea {
  resize: vertical;
}

.label-note {
  color: var(--muted);
  font-weight: 500;
  margin-left: 4px;
}

.form-two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.pin-input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  margin-top: 7px;
}

.profile-option {
  margin: 10px 0;
}

.profile-option>button {
  display: flex;
  align-items: center;
  width: 100%;
  gap: 10px;
  border: 1px solid var(--line);
  background: #fff;
  padding: 9px;
  border-radius: 13px;
  text-align: left;
  color: var(--ink);
}

.profile-option>button span:nth-child(2) {
  flex: 1;
}

.profile-option small {
  display: block;
  color: var(--muted);
  font-size: 10px;
}

.arrow {
  font-size: 22px;
  color: var(--muted);
}

.library-section {
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
}

.library-header h2 {
  margin: 5px 0 0;
  font-size: 19px;
}

.library-grid {
  display: grid;
  grid-template-columns: repeat(3,1fr);
  gap: 9px;
}

.library-item {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 57px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  font-size: 12px;
}

.library-item span {
  font-size: 20px;
}

.library-item b {
  font-size: 11px;
  line-height: 1.45;
}

.added-mark {
  margin-left: auto;
  font-size: 9px;
  color: var(--green-dark);
  white-space: nowrap;
}

.assignment-panel {
  margin-top: 24px;
}

.assignment-list {
  display: grid;
}

.assignment-row {
  display: grid;
  grid-template-columns: 32px 1fr 150px auto;
  align-items: center;
  gap: 9px;
  padding: 11px 0;
  border-bottom: 1px solid #f4e9dd;
}

.assignment-row:last-child {
  border-bottom: 0;
}

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

.assignment-row .button {
  min-height: 34px;
  padding: 6px 10px;
  font-size: 11px;
}

.wallet-banner {
  justify-content: flex-start;
  gap: 14px;
  padding: 18px 22px;
  border-radius: 20px;
  background: #fff5da;
  border: 1px solid #f5dfa9;
  margin-bottom: 28px;
}

.wallet-banner>div:nth-child(2) {
  margin-right: auto;
}

.wallet-banner strong {
  font-size: 29px;
}

.section-block {
  margin: 27px 0;
}

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

.owned-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 16px;
}

.reward-emoji {
  font-size: 28px;
}

.owned-card>div {
  flex: 1;
}

.owned-card b,
.owned-card small {
  display: block;
}

.owned-card b {
  font-size: 13px;
}

.owned-card small {
  font-size: 10px;
  color: var(--muted);
  margin-top: 3px;
}

.reward-grid {
  display: grid;
  grid-template-columns: repeat(3,1fr);
  gap: 14px;
}

.reward-card {
  position: relative;
  display: flex;
  gap: 12px;
  padding: 20px 17px;
  border: 1px solid var(--line);
  border-radius: 19px;
  background: #fff;
  box-shadow: 0 5px 18px rgba(135,91,50,.05);
}

.reward-content {
  flex: 1;
}

.reward-content h3 {
  font-size: 14px;
  margin: 1px 0 5px;
}

.reward-content>strong {
  color: var(--orange-dark);
  font-size: 22px;
}

.reward-content form {
  display: flex;
  gap: 7px;
  align-items: center;
  margin-top: 12px;
}

.reward-content select {
  min-width: 0;
  max-width: 120px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 9px;
}

.reward-content .button {
  min-height: 35px;
  padding: 7px 10px;
  font-size: 11px;
}

.reward-delete {
  position: absolute;
  right: 8px;
  top: 8px;
}

.thanks-card {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  padding: 22px;
  border: 1px solid #f2d5cf;
  border-radius: 20px;
  background: #fff3f0;
}

.thanks-card>div {
  display: flex;
  gap: 12px;
  align-items: center;
}

.thanks-card h2 {
  margin: 4px 0;
  font-size: 19px;
}

.thanks-card p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

.thanks-form {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.thanks-form input[name=note] {
  width: 190px;
}

.thanks-form input[type=number] {
  width: 66px;
}

.thanks-form select {
  max-width: 130px;
}

.report-summary {
  display: grid;
  grid-template-columns: repeat(3,1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.report-summary>div {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: #fff;
}

.report-summary span,
.report-summary strong {
  display: block;
}

.report-summary span {
  color: var(--muted);
  font-size: 11px;
}

.report-summary strong {
  font-size: 22px;
  margin-top: 3px;
}

.summary-word {
  color: var(--green-dark);
}

.month-picker {
  display: flex;
  gap: 8px;
}

.month-picker input {
  padding: 10px;
}

.report-panel {
  max-width: 860px;
}

.report-row {
  display: grid;
  grid-template-columns: 39px 130px 1fr 58px;
  align-items: center;
  gap: 12px;
  padding: 15px 0;
  border-bottom: 1px solid #f4e9dd;
}

.report-row:last-child {
  border-bottom: 0;
}

.report-name b,
.report-name small {
  display: block;
}

.report-name b {
  font-size: 13px;
}

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

.report-bar {
  height: 10px;
  border-radius: 99px;
  background: #f5ece3;
  overflow: hidden;
}

.report-bar i {
  display: block;
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg,#f7c26c,var(--orange));
}

.report-row strong {
  color: var(--orange-dark);
  font-size: 18px;
  text-align: right;
}

.report-callout {
  max-width: 860px;
  background: #eef7ec;
  color: #587b61;
}

.timeline {
  max-width: 840px;
  padding: 8px 0 20px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 14px;
  position: relative;
  padding-bottom: 18px;
}

.timeline-item:not(:last-child):after {
  content: "";
  position: absolute;
  left: 15px;
  top: 31px;
  bottom: 0;
  width: 2px;
  background: #f0e2d6;
}

.timeline-dot {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  border-radius: 50%;
  background: #fff0dc;
  color: var(--orange-dark);
  font-weight: 900;
}

.timeline-dot.pink {
  background: #fff0ef;
  color: #c8736a;
}

.timeline-dot.blue {
  background: #edf7fa;
  color: #5f96a7;
}

.timeline-content {
  position: relative;
  padding: 4px 15px 14px;
  border-bottom: 1px solid #f2e7dc;
}

.timeline-meta {
  display: flex;
  gap: 10px;
  align-items: center;
  color: var(--muted);
  font-size: 10px;
}

.kind-label {
  padding: 3px 7px;
  background: #fff4e7;
  color: #a37555;
}

.timeline-content p {
  margin: 7px 0 0;
  font-size: 13px;
}

.timeline-points {
  position: absolute;
  right: 15px;
  top: 34px;
  color: var(--orange-dark);
  font-size: 13px;
}

.timeline-points.negative {
  color: #b78383;
}

.back-link {
  margin-bottom: 14px;
  color: var(--orange-dark);
  font-size: 12px;
  font-weight: 900;
}

.detail-card {
  position: relative;
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: 25px;
  background: #fff;
  box-shadow: var(--shadow);
  max-width: 720px;
  margin-bottom: 15px;
}

.detail-card h1 {
  font-size: 29px;
  margin: 8px 0;
}

.detail-points {
  position: absolute;
  right: 30px;
  top: 30px;
  color: var(--orange-dark);
  font-size: 28px;
  font-weight: 900;
}

.detail-description {
  color: var(--muted);
  font-size: 13px;
  min-height: 32px;
}

.detail-info {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 6px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: 12px;
}

.detail-info span {
  color: var(--muted);
}

.setup-layout {
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 50px;
  align-items: center;
  min-height: calc(100vh - 160px);
}

.setup-copy h1 {
  font-size: 45px;
  margin: 10px 0;
}

.setup-illustration {
  display: block;
  width: 100%;
  max-width: 360px;
  margin: 18px auto 0;
}

.form-card {
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: #fffdf9;
  box-shadow: var(--shadow);
}

.form-card h2 {
  margin: 12px 0 5px;
}

.step-pill {
  display: inline-block;
  padding: 4px 9px;
  border-radius: 999px;
  color: var(--orange-dark);
  background: #fff0df;
  font-size: 10px;
  font-weight: 900;
}

.form-footnote {
  color: var(--muted);
  font-size: 10px;
  margin: 14px 0 0;
}

.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 17px;
}

.settings-inline {
  display: flex;
  gap: 8px;
}

.settings-inline input {
  flex: 1;
}

.members-panel {
  max-width: 850px;
}

.member-setting-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 0;
  border-bottom: 1px solid #f4e9dd;
}

.member-setting-row>div {
  flex: 1;
}

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

.member-setting-row b {
  font-size: 13px;
}

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

.member-balance {
  color: var(--orange-dark);
  font-size: 12px;
  font-weight: 900;
}

.add-member-box {
  margin-top: 21px;
  padding-top: 20px;
  border-top: 1px dashed var(--coral);
}

.add-member-box h3 {
  margin-bottom: 10px;
}

.member-add-form {
  display: grid;
  grid-template-columns: 1fr 130px 150px auto;
  gap: 8px;
}

.member-add-form input,
.member-add-form select {
  min-width: 0;
}

.guide-steps {
  display: grid;
  grid-template-columns: repeat(4,1fr);
  gap: 14px;
}

.guide-steps article {
  position: relative;
  padding: 22px 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #fff;
}

.guide-steps article>span {
  color: #eabf83;
  font-weight: 900;
  font-size: 12px;
}

.guide-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin: 17px 0 11px;
  border-radius: 17px;
  background: #fff0df;
  font-size: 28px;
}

.guide-steps h2 {
  font-size: 16px;
  margin: 0 0 6px;
}

.guide-steps p {
  font-size: 12px;
  color: var(--muted);
  margin: 0;
}

.bottom-nav {
  position: fixed;
  z-index: 30;
  bottom: 0;
  left: 0;
  right: 0;
  height: 74px;
  display: flex;
  justify-content: center;
  gap: 4px;
  padding: 7px max(10px,calc((100vw - 650px)/2));
  background: rgba(255,253,250,.94);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

.bottom-nav a {
  display: grid;
  place-items: center;
  gap: 0;
  min-width: 72px;
  padding: 4px 10px;
  border-radius: 13px;
  color: #b39e8c;
}

.bottom-nav a.active {
  color: var(--orange-dark);
  background: #fff0df;
}

.bottom-nav span {
  font-size: 20px;
  line-height: 1.2;
}

.bottom-nav small {
  font-size: 9px;
  font-weight: 900;
}

@media(max-width:850px) {
  .page-wrap {
    padding: 25px 18px;
  }
  .hero-banner {
    padding: 28px 28px;
    grid-template-columns: 1fr .9fr;
  }
  .hero-banner h1 {
    font-size: 30px;
  }
  .content-grid {
    grid-template-columns: 1fr;
  }
  .setup-layout {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .setup-copy {
    text-align: center;
  }
  .setup-copy h1 {
    font-size: 37px;
  }
  .setup-illustration {
    max-width: 320px;
  }
  .form-card {
    max-width: 560px;
    margin: 0 auto;
    width: 100%;
  }
  .guide-steps {
    grid-template-columns: repeat(2,1fr);
  }
  .member-add-form {
    grid-template-columns: 1fr 1fr;
  }
  .member-add-form input:first-child {
    grid-column: span 2;
  }
  .reward-grid {
    grid-template-columns: repeat(2,1fr);
  }
}

@media(max-width:600px) {
  body {
    font-size: 14px;
  }
  .app-shell {
    padding-bottom: 80px;
  }
  .topbar {
    height: 64px;
    padding: 0 13px;
  }
  .brand-mark {
    width: 34px;
    height: 34px;
  }
  .brand b {
    font-size: 14px;
  }
  .brand small {
    font-size: 9px;
  }
  .page-wrap {
    padding: 20px 13px;
  }
  .page-heading {
    align-items: flex-start;
    margin-bottom: 17px;
  }
  .page-heading h1 {
    font-size: 26px;
  }
  .page-heading p {
    font-size: 11px;
  }
  .page-heading>.button {
    padding: 9px 11px;
    font-size: 11px;
  }
  .hero-banner {
    display: flex;
    flex-direction: column;
    padding: 24px 20px;
    min-height: 0;
    align-items: flex-start;
  }
  .hero-banner h1 {
    font-size: 29px;
  }
  .hero-banner img {
    width: 100%;
    height: 185px;
    object-fit: contain;
    object-position: center bottom;
    margin-top: 8px;
  }
  .metric-grid {
    grid-template-columns: 1fr;
    gap: 9px;
    margin-bottom: 19px;
  }
  .metric-card {
    padding: 14px;
  }
  .metric-card strong {
    font-size: 22px;
  }
  .section-heading {
    margin-bottom: 12px;
  }
  .section-heading h2 {
    font-size: 19px;
  }
  .quick-actions {
    grid-template-columns: 1fr;
    gap: 9px;
  }
  .quick-card {
    grid-template-columns: 39px 1fr;
  }
  .admin-hero+.section-heading {
    margin-top: 23px;
  }
  .child-welcome {
    display: block;
  }
  .child-welcome h1 {
    font-size: 24px;
  }
  .point-wallet {
    margin-top: 16px;
    display: inline-flex;
  }
  .progress-card {
    display: block;
    padding: 19px 20px;
  }
  .progress-card .button {
    margin-top: 14px;
    width: 100%;
  }
  .child-task-card {
    padding: 15px;
    gap: 11px;
  }
  .task-icon.big {
    width: 45px;
    height: 45px;
    font-size: 22px;
    border-radius: 14px;
  }
  .child-task-main h3 {
    font-size: 15px;
  }
  .filter-bar {
    align-items: stretch;
  }
  .filter-bar .search-form {
    width: 100%;
    flex-basis: 100%;
  }
  .filter-bar>form:nth-child(2) {
    flex: 1;
  }
  .filter-bar select,
  .filter-bar .button {
    width: 100%;
    min-width: 0;
  }
  .admin-task-card {
    align-items: flex-start;
    padding: 14px;
    gap: 10px;
  }
  .admin-task-card>.task-icon {
    width: 34px;
    height: 34px;
    font-size: 17px;
  }
  .admin-task-body h3 {
    font-size: 13px;
  }
  .admin-task-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .admin-task-actions .button {
    font-size: 10px;
  }
  .admin-task-actions form {
    display: block;
  }
  .library-grid {
    grid-template-columns: 1fr 1fr;
  }
  .library-item {
    min-height: 60px;
    padding: 8px;
  }
  .library-item b {
    font-size: 10px;
  }
  .library-header {
    align-items: flex-end;
  }
  .library-header h2 {
    font-size: 17px;
  }
  .assignment-row {
    grid-template-columns: 28px 1fr auto;
  }
  .assignment-row select {
    grid-column: 2;
    grid-row: 2;
  }
  .assignment-row .button {
    grid-column: 3;
    grid-row: 2;
  }
  .owned-grid,
  .reward-grid,
  .settings-grid,
  .report-summary {
    grid-template-columns: 1fr;
  }
  .reward-card {
    padding: 16px;
  }
  .reward-content form {
    flex-wrap: wrap;
  }
  .thanks-card {
    display: block;
  }
  .thanks-form {
    justify-content: flex-start;
    margin-top: 15px;
  }
  .thanks-form input[name=note] {
    width: 100%;
  }
  .report-row {
    grid-template-columns: 34px 105px 1fr 44px;
    gap: 8px;
  }
  .report-name b {
    font-size: 11px;
  }
  .month-picker input {
    width: 130px;
  }
  .timeline-points {
    position: static;
    display: block;
    margin-top: 3px;
  }
  .detail-card {
    padding: 25px 21px;
  }
  .detail-points {
    right: 20px;
    top: 23px;
    font-size: 23px;
  }
  .detail-card h1 {
    font-size: 24px;
    padding-right: 75px;
  }
  .setup-layout {
    min-height: 0;
  }
  .setup-copy {
    text-align: left;
  }
  .setup-copy h1 {
    font-size: 34px;
  }
  .setup-illustration {
    max-width: 260px;
    margin-top: 8px;
  }
  .setup-illustration img,
  .rotating-illustration img {
    max-height: 180px;
  }
  .form-card {
    padding: 24px 18px;
  }
  .modal-card {
    padding: 25px 18px;
  }
  .form-two {
    grid-template-columns: 1fr;
  }
  .bottom-nav {
    height: 68px;
  }
  .bottom-nav a {
    min-width: 0;
    flex: 1;
    padding: 4px 5px;
  }
  .bottom-nav span {
    font-size: 18px;
  }
  .toast-stack {
    right: 11px;
    top: 75px;
    max-width: calc(100vw - 22px);
  }
}

/* ---- 二人向け基本版：追加スタイル（現行デザイン踏襲） ---- */
.done-form {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.done-form .done-label {
  font-size: 11px;
  font-weight: 900;
  color: var(--muted);
}

.done-form select {
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
  padding: 9px 10px;
  color: var(--ink);
  outline-color: var(--coral);
  font-size: 13px;
}

.done-form.compact {
  margin-top: 0;
}

.done-form.detail-done {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fffaf2;
}

.done-form.detail-done .button-large {
  flex: 1;
  min-width: 160px;
}

.howto-preview {
  white-space: pre-line;
  color: var(--muted);
  font-size: 12px;
  margin: 2px 0 0;
  max-height: 3.4em;
  overflow: hidden;
}

.howto-card {
  margin-top: 15px;
}

.howto-body {
  white-space: pre-line;
  line-height: 1.9;
  color: #5f5044;
  font-size: 14px;
}

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

.library-item.tall {
  flex-direction: column;
  align-items: stretch;
  gap: 7px;
  min-height: 0;
}

.library-item-head {
  display: flex;
  align-items: center;
  gap: 9px;
}

.library-item-head span {
  font-size: 20px;
}

.library-item-head b {
  font-size: 12px;
}

.library-howto {
  white-space: pre-line;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.7;
}

.wallet-banner-grid {
  display: grid;
  grid-template-columns: repeat(2,1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.wallet-banner-grid .wallet-banner {
  margin-bottom: 0;
}

.rename-form {
  display: flex;
  gap: 8px;
  align-items: center;
  flex: 1;
}

.rename-form input {
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
  padding: 9px 10px;
  color: var(--ink);
  outline-color: var(--coral);
}

.empty-state {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  padding: 18px;
  line-height: 1.8;
}

.empty-state.large-empty {
  padding: 40px 20px;
}

.empty-state.large-empty>div {
  font-size: 40px;
  margin-bottom: 8px;
}

.empty-state.large-empty h3 {
  margin: 6px 0 4px;
  color: var(--ink);
}

.empty-state a,
.howto-preview a {
  color: var(--orange-dark);
  font-weight: 800;
}

.child-task-main h3 a,
.admin-task-body h3 a {
  color: inherit;
}

@media(max-width:600px) {
  .library-grid.wide,
  .wallet-banner-grid {
    grid-template-columns: 1fr;
  }
  .done-form {
    width: 100%;
  }
  .done-form select {
    flex: 1;
  }
}

/* ================================================================
フィードバック反映：文字を大きく／右の隙間を解消／使用中の明示
（末尾に追記して既存値を上書き）
================================================================ */
/* 1) 文字サイズ全体を底上げ */
body {
  font-size: 16px;
  line-height: 1.75;
}

.muted {
  font-size: 14px;
}

.lead {
  font-size: 18px;
}

.eyebrow {
  font-size: 11px;
}

.metric-note {
  font-size: 11px;
}

.metric-card small,
.point-wallet small,
.wallet-banner small {
  font-size: 12px;
}

.bottom-nav small {
  font-size: 11px;
}

.bottom-nav span {
  font-size: 21px;
}

.category-label,
.frequency-label,
.point-label,
.status-pill,
.soft-badge,
.kind-label {
  font-size: 12px;
}

.task-meta {
  font-size: 12px;
}

.admin-task-body h3 {
  font-size: 16px;
}

.admin-task-body p,
.child-task-main p {
  font-size: 13px;
}

.howto-preview {
  font-size: 13px;
}

.library-item-head b {
  font-size: 13px;
}

.library-howto {
  font-size: 11px;
}

.timeline-content p {
  font-size: 14px;
}

.detail-info {
  font-size: 13px;
}

.reward-content h3 {
  font-size: 15px;
}

.owned-card b {
  font-size: 14px;
}

.quick-card b {
  font-size: 14px;
}

.quick-card small {
  font-size: 11px;
}

.done-form .done-label {
  font-size: 12px;
}

.done-form select,
.etiquette-form select {
  font-size: 14px;
}

.stack-form label,
.stack-label {
  font-size: 13px;
}

/* 2) 右に隙間ができるブロックを幅いっぱいに（項目数に合わせて自動調整） */
.metric-grid {
  grid-template-columns: repeat(auto-fit,minmax(230px,1fr));
}

.quick-actions {
  grid-template-columns: repeat(auto-fit,minmax(220px,1fr));
}

.reward-grid {
  grid-template-columns: repeat(auto-fit,minmax(210px,1fr));
}

.owned-grid {
  grid-template-columns: repeat(auto-fit,minmax(240px,1fr));
}

.report-summary {
  grid-template-columns: repeat(auto-fit,minmax(180px,1fr));
}

.wallet-banner-grid {
  grid-template-columns: repeat(auto-fit,minmax(240px,1fr));
}

.library-grid.wide {
  grid-template-columns: repeat(auto-fit,minmax(260px,1fr));
}

.settings-grid {
  grid-template-columns: repeat(auto-fit,minmax(280px,1fr));
}

/* 3) 使用中の人チップを見やすく強調 */
.topbar-actions .profile-chip {
  background: #fff0df;
  border-color: #f3d6ad;
  color: var(--orange-dark);
  font-weight: 900;
  font-size: 13px;
}

.topbar-actions .profile-chip span:first-child {
  background: #ffd9b0;
}

.profile-option button small {
  color: var(--orange-dark);
  font-weight: 900;
}

@media(max-width:600px) {
  body {
    font-size: 15px;
  }
  .metric-grid,
  .quick-actions,
  .reward-grid,
  .owned-grid,
  .wallet-banner-grid,
  .report-summary,
  .library-grid.wide,
  .settings-grid {
    grid-template-columns: 1fr;
  }
  .topbar-actions .profile-chip {
    font-size: 12px;
  }
}

/* ================================================================
   新規登録／ログイン画面のレイアウト調整
   （form-two の入力欄をラベル高さに関わらず下端で揃えてガタつき解消）
   ================================================================ */
.form-two {
  align-items: end;
}

.setup-form .stack-form {
  gap: 16px;
}

.setup-form .stack-form label {
  align-content: start;
}

/* ================================================================
   v4: アカウント/家族分離・登録レイアウト修正・招待/参加UI
   ================================================================ */

/* 入力欄がカードからはみ出すのを防ぐ（box-sizing と min-width を明示） */
.stack-form input,
.stack-form select,
.stack-form textarea {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.stack-form,
.setup-form .stack-form {
  min-width: 0;
}

.form-card,
.setup-form {
  overflow: hidden;
}

/* 家族グループ選択（作成 / 参加） */
.choice-stack {
  display: grid;
  gap: 12px;
  margin: 16px 0 6px;
}

.choice-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fffdf9;
  color: var(--ink);
  text-decoration: none;
  transition: border-color .15s, transform .15s, box-shadow .15s;
}

.choice-card:hover {
  border-color: var(--coral);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.choice-icon {
  font-size: 30px;
  flex: 0 0 auto;
}

.choice-body {
  display: grid;
  gap: 3px;
  flex: 1 1 auto;
}

.choice-body b {
  font-size: 16px;
}

.choice-body small {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.choice-arrow {
  color: var(--orange-dark);
  font-weight: 900;
  font-size: 20px;
  flex: 0 0 auto;
}

/* 招待用の合言葉・QR */
.invite-code-box {
  display: grid;
  gap: 6px;
  padding: 16px;
  border: 1px dashed var(--coral);
  border-radius: 14px;
  background: #fff6ec;
  margin: 6px 0 12px;
}

.invite-code-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.invite-code {
  font-size: 26px;
  font-weight: 900;
  letter-spacing: 2px;
  color: var(--orange-dark);
  word-break: break-all;
}

.qr-panel {
  text-align: center;
}

.invite-qr {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 200px;
  margin: 6px auto 12px;
}

.invite-qr img {
  display: block;
  margin: 0 auto;
}

.qr-scan-box {
  margin-top: 14px;
  display: grid;
  gap: 10px;
}

#qr-reader {
  width: 100%;
  max-width: 320px;
  margin: 0 auto;
}

.qr-note {
  font-size: 13px;
  text-align: center;
}

/* --- v6 追加: 認証画面の調整・画像ローテーション・区切り線 --- */
.rotating-illustration img {
  transition: opacity 0.35s ease;
  width: 100%;
  height: auto;
  max-height: 300px;
  object-fit: contain;
  display: block;
  margin: 0 auto;
}
.form-divider {
  display: flex;
  align-items: center;
  text-align: center;
  color: #b7a894;
  font-size: 13px;
  margin: 18px 0 14px;
}
.form-divider::before,
.form-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #ecdfce;
}
.form-divider span {
  padding: 0 12px;
}

/* --- 家族グループ削除・メンバー削除（追加） --- */
.button-danger {
  background: #d64545;
  color: #fff;
  border: none;
}

.button-danger:hover {
  background: #b83636;
}

.danger-zone {
  border: 1px solid #f0c9c9;
  background: #fdf6f6;
}

.danger-zone .eyebrow {
  color: #d64545;
}

.danger-zone h2 {
  color: #b83636;
}

.member-remove-form {
  margin: 0;
  flex: 0 0 auto;
}

/* ========================================================================
   PWA / スマートフォン最適化（共通レイアウトに集約：画面ごとに重複記述しない）
   - iPhone Safari のノッチ／ホームインジケーターに対応（safe-area）
   - 横スクロールを発生させない／320px でも崩れない
   - ボタン・リンク・入力欄を指で押しやすい大きさに
   ======================================================================== */

/* 横スクロール防止：ページ全体で水平方向のはみ出しを抑止 */
html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

/* 画像・メディアがコンテナ幅を超えない */
img,
svg,
video {
  max-width: 100%;
  height: auto;
}

/* 長い単語・URL の折り返し */
.card,
.page-wrap,
p,
h1, h2, h3 {
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* safe-area：上部バーとメイン領域の余白をノッチ分だけ確保 */
.topbar {
  padding-top: env(safe-area-inset-top, 0px);
  padding-left: max(22px, env(safe-area-inset-left, 0px));
  padding-right: max(22px, env(safe-area-inset-right, 0px));
  height: calc(74px + env(safe-area-inset-top, 0px));
}

/* 下部ナビ：ホームインジケーター分の余白を確保し、指で押しやすく */
.bottom-nav {
  padding-bottom: calc(7px + env(safe-area-inset-bottom, 0px));
  height: calc(74px + env(safe-area-inset-bottom, 0px));
  padding-left: max(10px, env(safe-area-inset-left, 0px));
  padding-right: max(10px, env(safe-area-inset-right, 0px));
}

/* 下部ナビの各項目を最小タップ領域（実質48px以上）に */
.bottom-nav a {
  min-height: 52px;
  align-content: center;
}

/* 下部ナビがある画面では、コンテンツが隠れないよう下に余白 */
.app-shell {
  padding-bottom: calc(90px + env(safe-area-inset-bottom, 0px));
}

/* スマホ（〜600px）向けの押しやすさ・可読性の底上げ */
@media (max-width: 600px) {
  body {
    font-size: 16px;               /* 小さすぎない基準サイズ */
    -webkit-text-size-adjust: 100%;/* Safari の自動拡大を無効化 */
  }

  /* タップ対象を最低44pxに（Appleのガイドライン） */
  .button,
  .icon-button,
  .profile-chip,
  .bottom-nav a {
    min-height: 44px;
  }

  /* 入力欄は16px以上（iOSで自動ズームさせない） */
  input,
  select,
  textarea {
    font-size: 16px;
    min-height: 44px;
  }

  /* ボタンは押しやすいパディングに */
  .button {
    padding-top: 12px;
    padding-bottom: 12px;
  }

  /* 「詳細」「消去」など操作の押し間違い防止：間隔を確保 */
  .admin-task-actions,
  .assignment-row,
  .reward-content .button {
    gap: 10px;
  }
}

/* 幅320pxでも崩れないための最終保険 */
@media (max-width: 360px) {
  .topbar {
    padding-left: 14px;
    padding-right: 14px;
  }
  .page-wrap {
    padding-left: 12px;
    padding-right: 12px;
  }
  .card {
    padding-left: 14px;
    padding-right: 14px;
  }
}

/* standalone（ホーム画面から起動）時の微調整：文字選択の抑制で誤操作を防ぐ */
@media (display-mode: standalone) {
  .topbar,
  .bottom-nav {
    -webkit-user-select: none;
    user-select: none;
  }
}

/* iOS Safari 自動ズーム防止：全フォーム入力欄を16px以上に統一
   （個別指定の小さいフォントより後ろ・同等の詳細度で上書き） */
input,
select,
textarea,
.search-form input,
.stack-form input,
.stack-form select,
.stack-form textarea,
.member-add-form input,
.member-add-form select,
.settings-inline input,
.thanks-form input,
.thanks-form input[name=note],
.thanks-form input[type=number],
.thanks-form select,
.month-picker input,
.assignment-row select,
.reward-content select,
.done-form select,
.etiquette-form select,
.rename-form input,
.pin-input {
  font-size: 16px;
}

/* ============================================================
   家族モード：モード選択・承認まわり（追加）
   ============================================================ */
.mode-select {
  display: grid;
  gap: 10px;
}

.mode-select-label {
  font-weight: 700;
  font-size: 15px;
  color: var(--ink);
}

.mode-option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fffdf9;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
}

.mode-option:hover {
  border-color: var(--coral);
}

.mode-option input {
  margin-top: 4px;
  flex: 0 0 auto;
  width: auto;
  min-width: 0;
}

.mode-option input:checked ~ .mode-body b {
  color: var(--coral);
}

.mode-option:has(input:checked) {
  border-color: var(--coral);
  box-shadow: var(--shadow);
  background: #fff7ef;
}

.mode-body {
  display: grid;
  gap: 3px;
}

.mode-body b {
  font-size: 15px;
}

.mode-body small {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.mode-icon {
  font-size: 18px;
}

/* 承認待ちの行・パネル */
.pending-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.pending-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.pending-panel {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff7ef;
  padding: 16px 18px;
  display: grid;
  gap: 10px;
}

.pending-panel p {
  margin: 0;
  color: var(--muted);
}

.role-note {
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #fff7ef;
  font-size: 13px;
  line-height: 1.5;
}

/* 下部ナビの承認バッジ */
.nav-badge-wrap {
  position: relative;
  display: inline-block;
}

.nav-badge {
  position: absolute;
  top: -6px;
  right: -12px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--coral);
  color: #fff;
  font-size: 10px;
  font-style: normal;
  line-height: 16px;
  text-align: center;
}

/* ============================================================
   改善対応（末尾追記・すべて新規セレクタ／既存は上書きのみ）
   ============================================================ */

/* 1) 下部ナビを項目数が多くても必ず横一列に収める */
.bottom-nav {
  flex-wrap: nowrap;
  gap: 2px;
  overflow: hidden;
}
.bottom-nav a {
  flex: 1 1 0;
  min-width: 0;
  padding-left: 2px;
  padding-right: 2px;
}
.bottom-nav a small {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 2) 定番リストの手順を3行までにたたむ＋トグル */
.library-howto.collapsed {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.howto-toggle {
  margin-top: 6px;
  border: 0;
  background: transparent;
  color: var(--orange-dark);
  font-size: 11px;
  font-weight: 900;
  padding: 2px 0;
}

/* 3) 全画面メモ編集オーバーレイ */
.memo-fullscreen {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 80;
  background: #fffdf9;
  flex-direction: column;
  padding: calc(12px + env(safe-area-inset-top, 0px)) 14px calc(14px + env(safe-area-inset-bottom, 0px));
}
.memo-fullscreen.open {
  display: flex;
}
.memo-fullscreen-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.memo-fullscreen-title {
  font-weight: 900;
  color: var(--ink);
  font-size: 15px;
}
.memo-fullscreen-input {
  flex: 1;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  padding: 14px;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.9;
  outline-color: var(--coral);
  resize: none;
}
