:root {
  color-scheme: light;
  --bg: #f6f7f4;
  --ink: #17201c;
  --muted: #647067;
  --panel: #ffffff;
  --line: #dfe5df;
  --green: #06c755;
  --green-dark: #048a3c;
  --coral: #e96b4c;
  --shadow: 0 12px 36px rgba(23, 32, 28, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

.shell {
  width: min(760px, 100%);
  margin: 0 auto;
  padding: 20px 16px 40px;
}

.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 0 14px;
}

.topbar-title {
  min-width: 0;
}

.topbar-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-shrink: 0;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 13px;
}

h1,
h2,
p {
  margin: 0;
}

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

h2 {
  font-size: 18px;
  margin-bottom: 16px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 18px;
  margin-top: 14px;
}

.hidden {
  display: none !important;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  background: #eaf7ef;
  color: var(--green-dark);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

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

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

label {
  display: grid;
  gap: 7px;
  min-width: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

input,
select {
  display: block;
  width: 100%;
  inline-size: 100%;
  min-width: 0;
  min-inline-size: 0;
  max-width: 100%;
  max-inline-size: 100%;
  height: 44px;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 0 12px;
  font: inherit;
  line-height: 1.2;
}

select {
  appearance: auto;
  -webkit-appearance: menulist;
}

input[type="month"],
input[type="time"] {
  appearance: none;
  -webkit-appearance: none;
  line-height: 44px;
  text-align: center;
}

input[type="month"]::-webkit-date-and-time-value,
input[type="time"]::-webkit-date-and-time-value {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-width: 0;
  height: 44px;
  min-height: 44px;
  margin: 0;
  line-height: 44px;
  text-align: center;
}

button {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  background: var(--green);
  color: #fff;
  padding: 0 16px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border-radius: 8px;
  background: var(--green);
  color: #fff;
  padding: 0 16px;
  font: inherit;
  font-weight: 800;
  text-decoration: none;
}

.button-link.secondary {
  background: #edf2ed;
  color: var(--ink);
}

.topbar-icon-link {
  display: inline-grid;
  place-items: center;
  width: 44px;
  min-width: 44px;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  text-decoration: none;
  box-shadow: 0 8px 22px rgba(23, 32, 28, 0.08);
}

.topbar-icon-link:hover {
  border-color: #c8d1c9;
}

.topbar-icon-link svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

button.secondary {
  background: #edf2ed;
  color: var(--ink);
}

button.danger {
  background: #fff1ed;
  color: var(--coral);
  border: 1px solid #f4c6b9;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

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

.child-row {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr 0.8fr 0.8fr 44px;
  gap: 8px;
  align-items: end;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  min-width: 44px;
  width: 44px;
  padding: 0;
  background: #fff1ed;
  color: var(--coral);
  border: 1px solid #f4c6b9;
}

.billing-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

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

.legal-link {
  display: flex;
  align-items: center;
  min-height: 48px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
}

.legal-link:hover,
.legal-link:focus-visible {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(6, 199, 85, 0.12);
}

.legal-document .topbar {
  align-items: flex-start;
}

.legal-document article {
  display: grid;
  gap: 22px;
}

.legal-document article > section {
  display: grid;
  gap: 8px;
}

.legal-document h2,
.legal-document h3 {
  margin: 0;
}

.legal-document h3 {
  font-size: 16px;
}

.legal-document p,
.legal-document li {
  line-height: 1.75;
}

.legal-document ol,
.legal-document ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 1.4em;
}

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

.legal-back-link {
  color: var(--green-dark);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.legal-back-link:hover,
.legal-back-link:focus-visible {
  text-decoration: underline;
}

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

.guardian-item {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.guardian-avatar {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border-radius: 50%;
  background: #eaf7ef;
  color: var(--green-dark);
  font-weight: 900;
  overflow: hidden;
}

.guardian-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

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

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

.invite-url {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
  color: var(--muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.invite-link-item {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.invite-link-number {
  color: var(--green-dark);
  font-weight: 800;
  flex: 0 0 auto;
}

.invite-link-item a {
  font-weight: 700;
}

.referral-code-card {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.referral-code-value {
  font-size: 28px;
  line-height: 1.1;
  letter-spacing: 0;
}

.referral-code-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.referral-code-form input {
  text-transform: uppercase;
  font-weight: 800;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}

.panel-heading h2 {
  margin-bottom: 0;
}

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

.schedule-list-item {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  width: 100%;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.schedule-list-item:hover,
.schedule-list-item:focus-visible {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(6, 199, 85, 0.12);
}

.schedule-list-media {
  display: grid;
  place-items: center;
  width: 112px;
  aspect-ratio: 4 / 3;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.schedule-list-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.schedule-list-media[data-zoom-auth-src],
.review-image-frame[data-zoom-auth-src] {
  cursor: zoom-in;
}

.review-image-frame[data-zoom-auth-src]:focus-visible {
  outline: 3px solid rgba(6, 199, 85, 0.28);
  outline-offset: 3px;
}

.schedule-list-body {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.schedule-status {
  justify-self: start;
  min-height: 26px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #eaf7ef;
  color: var(--green-dark);
  font-size: 12px;
  font-weight: 800;
}

.schedule-file-link {
  width: 100%;
  min-height: 100%;
  text-align: center;
}

.schedule-file-frame {
  display: grid;
  place-items: center;
  min-height: 220px;
  padding: 18px;
}

.review-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(240px, 0.9fr);
  gap: 16px;
  align-items: start;
}

.review-image-frame {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
  overflow: hidden;
}

.review-image-frame img {
  display: block;
  width: 100%;
  max-height: 70vh;
  object-fit: contain;
  background: #fff;
}

.image-zoom-open {
  overflow: hidden;
}

.image-zoom-dialog {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 28px;
  background: rgba(23, 32, 28, 0.86);
}

.image-zoom-dialog img {
  display: block;
  width: auto;
  max-width: min(100%, 1040px);
  max-height: calc(100vh - 80px);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.32);
  object-fit: contain;
}

.image-zoom-close {
  position: fixed;
  top: 14px;
  right: 14px;
  display: inline-grid;
  place-items: center;
  width: 44px;
  min-width: 44px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-size: 24px;
  line-height: 1;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.24);
}

.review-actions {
  display: grid;
  gap: 14px;
}

.child-choice-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  border: 0;
}

.child-choice-list legend {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.period-choice-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  border: 0;
}

.period-choice-list legend {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

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

.child-choice {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
  color: var(--ink);
  font-size: 15px;
}

.child-choice input {
  width: 18px;
  height: 18px;
  min-height: 18px;
  padding: 0;
}

.strong {
  font-weight: 800;
}

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

.toast {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 18px;
  max-width: 520px;
  margin: 0 auto;
  padding: 12px 14px;
  border-radius: 8px;
  background: #17201c;
  color: #fff;
  text-align: center;
  box-shadow: var(--shadow);
}

@media (max-width: 640px) {
  .grid-form,
  .referral-code-form,
  .legal-link-list,
  .period-grid,
  .child-row,
  .schedule-list-item,
  .review-layout,
  .panel-heading,
  .billing-row {
    grid-template-columns: 1fr;
  }

  .billing-row {
    display: grid;
  }

  .icon-button {
    width: 100%;
  }

  .schedule-list-media {
    width: 100%;
  }

  .image-zoom-dialog {
    padding: 64px 12px 18px;
  }

  .image-zoom-dialog img {
    max-height: calc(100vh - 96px);
  }
}
