/* Little Days — hand-written CSS, no framework, no build step.
   Palette: warm paper, deep eucalyptus green, soft terracotta. */

:root {
  --bg: #fbf6ef;
  --bg-deep: #f3ebe0;
  --surface: #ffffff;
  --surface-soft: #f7f0e6;
  --ink: #221f1b;
  --ink-2: #4d4740;
  --muted: #6a625a;
  --line: #e7dccd;
  --line-strong: #d8cbb8;
  --brand: #2f5c4c;
  --brand-dark: #24483c;
  --brand-soft: #e3ede7;
  --accent: #9e4527;
  --accent-soft: #f7e6de;
  --ok: #1e5a38;
  --ok-soft: #e1f0e7;
  --warn: #7a4f08;
  --warn-soft: #fbefd5;
  --danger: #9b3427;
  --danger-soft: #fae7e3;
  --focus: #1f6fb2;
  --radius: 16px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(34, 31, 27, 0.05), 0 10px 26px -18px rgba(34, 31, 27, 0.35);
  --tab-h: 62px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg-deep);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}

h1, h2, h3, h4, p, ul, ol, figure {
  margin: 0;
}

ul, ol {
  padding: 0;
  list-style: none;
}

a {
  color: var(--brand);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

button {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 6px;
}

.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;
}

/* ---------- shell ---------- */

#root {
  max-width: 620px;
  margin: 0 auto;
  min-height: 100dvh;
  background: var(--bg);
  display: flex;
  flex-direction: column;
}

@media (min-width: 700px) {
  body {
    background:
      radial-gradient(1200px 600px at 50% -10%, #f7efe3 0%, var(--bg-deep) 60%);
  }
  #root {
    box-shadow: 0 0 0 1px rgba(34, 31, 27, 0.06), 0 24px 60px -40px rgba(34, 31, 27, 0.5);
  }
}

.boot {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: center;
  min-height: 60dvh;
  color: var(--muted);
}

.spinner {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--line-strong);
  border-top-color: var(--brand);
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .spinner { animation-duration: 3s; }
  * { scroll-behavior: auto !important; }
}

.noscript {
  padding: 24px;
  text-align: center;
}

/* ---------- top bar ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(251, 246, 239, 0.94);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
}

.topbar.scrolled {
  border-bottom-color: var(--line);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  padding-top: max(12px, env(safe-area-inset-top));
}

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

.brand-mark {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border-radius: 10px;
  background: var(--brand);
  display: grid;
  place-items: center;
}

.brand-service {
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 46vw;
}

.brand-sub {
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 46vw;
}

.avatar-btn {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--brand);
  font-weight: 700;
  font-size: 15px;
  display: grid;
  place-items: center;
  text-decoration: none;
  cursor: pointer;
}

/* ---------- page ---------- */

.page {
  padding: 4px 16px calc(var(--tab-h) + 40px + env(safe-area-inset-bottom));
  flex: 1;
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0 14px;
}

.page-title {
  font-size: 27px;
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-weight: 700;
}

.page-sub {
  color: var(--muted);
  font-size: 15px;
  margin-top: 2px;
}

.page-head .btn {
  flex: 0 0 auto;
}

/* ---------- tab bar ---------- */

.tabbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 30;
  display: flex;
  justify-content: center;
  background: rgba(251, 246, 239, 0.94);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}

.tabbar-inner {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  width: 100%;
  max-width: 620px;
}

.tab {
  appearance: none;
  border: 0;
  background: none;
  padding: 7px 2px 8px;
  min-height: var(--tab-h);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  text-decoration: none;
}

.tab svg {
  width: 23px;
  height: 23px;
  stroke-width: 1.7;
}

.tab[aria-current="page"] {
  color: var(--brand);
}

.tab[aria-current="page"] svg {
  stroke-width: 2.1;
}

/* ---------- cards & lists ---------- */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  margin-bottom: 14px;
}

.card-tight {
  padding: 4px 16px;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.card-title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--muted);
}

.section-title {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 22px 4px 8px;
}

.list {
  display: flex;
  flex-direction: column;
}

.list > li + li {
  border-top: 1px solid var(--line);
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.stack-sm {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

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

@media (max-width: 379px) {
  .grid-2 {
    grid-template-columns: 1fr;
  }
}

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

/* ---------- children / attendance rows ---------- */

.kid {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 6px 10px 0;
  min-height: 74px;
}

.kid-open {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
  background: none;
  border: 0;
  padding: 6px 4px;
  border-radius: 12px;
  text-align: left;
  cursor: pointer;
}

.kid-text {
  min-width: 0;
  display: block;
}

.kid-name {
  display: block;
  font-weight: 650;
  font-size: 17px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kid-meta {
  display: block;
  font-size: 14px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kid-meta strong {
  color: var(--ink-2);
  font-weight: 600;
}

.avatar {
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand-dark);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 17px;
  overflow: hidden;
  border: 1px solid rgba(47, 92, 76, 0.12);
}

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

.avatar-lg {
  width: 68px;
  height: 68px;
  font-size: 24px;
}

.avatar-sm {
  width: 36px;
  height: 36px;
  font-size: 14px;
}

.kid-action {
  flex: 0 0 auto;
  min-width: 104px;
  min-height: 50px;
  padding: 0 14px;
  border-radius: 13px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  color: var(--brand);
}

.kid-action[data-state="in"] {
  background: var(--ok-soft);
  border-color: #bdd9c9;
  color: var(--ok);
}

.kid-action[data-state="out"] {
  background: var(--surface-soft);
  border-color: var(--line-strong);
  color: var(--ink-2);
}

.kid-action:active {
  transform: scale(0.985);
}

.group-label {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  padding: 14px 4px 4px;
}

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 50px;
  padding: 0 18px;
  border-radius: 14px;
  border: 1px solid transparent;
  background: var(--brand);
  color: #fff;
  font-size: 16px;
  font-weight: 650;
  text-decoration: none;
  cursor: pointer;
  text-align: center;
}

.btn:active {
  transform: scale(0.99);
}

.btn-block {
  display: flex;
  width: 100%;
}

.btn-secondary {
  background: var(--surface);
  border-color: var(--line-strong);
  color: var(--ink);
}

.btn-soft {
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.btn-accent {
  background: var(--accent);
}

.btn-danger {
  background: var(--surface);
  border-color: #e3c3bc;
  color: var(--danger);
}

.btn-sm {
  min-height: 42px;
  padding: 0 14px;
  font-size: 15px;
  border-radius: 12px;
}

.btn:disabled {
  opacity: 0.55;
  cursor: default;
}

.link-btn {
  background: none;
  border: 0;
  padding: 8px 0;
  color: var(--brand);
  font-size: 15px;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

/* ---------- forms ---------- */

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.field > label,
.field-label {
  font-size: 14px;
  font-weight: 650;
  color: var(--ink-2);
}

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

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="password"],
input[type="date"],
input[type="number"],
textarea,
select {
  width: 100%;
  min-height: 52px;
  padding: 13px 14px;
  font: inherit;
  font-size: 17px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  appearance: none;
}

textarea {
  min-height: 110px;
  line-height: 1.45;
  resize: vertical;
}

select {
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 20px) 24px, calc(100% - 14px) 24px;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 40px;
}

input[type="date"] {
  min-height: 52px;
}

input::placeholder,
textarea::placeholder {
  color: #8d857b;
}

.check-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.check {
  position: relative;
}

.check input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}

.check span {
  display: grid;
  place-items: center;
  min-width: 46px;
  height: 46px;
  padding: 0 10px;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  font-size: 15px;
  font-weight: 650;
  color: var(--ink-2);
}

.check input:checked + span {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.check input:focus-visible + span {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

/* ---------- pills ---------- */

.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.01em;
  background: var(--surface-soft);
  color: var(--ink-2);
  white-space: nowrap;
}

.pill-ok {
  background: var(--ok-soft);
  color: var(--ok);
}

.pill-warn {
  background: var(--warn-soft);
  color: var(--warn);
}

.pill-danger {
  background: var(--danger-soft);
  color: var(--danger);
}

.pill-brand {
  background: var(--brand-soft);
  color: var(--brand-dark);
}

/* ---------- misc ---------- */

.empty {
  text-align: center;
  padding: 34px 18px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
}

.empty h2 {
  font-size: 19px;
  margin-bottom: 6px;
}

.empty p {
  color: var(--muted);
  font-size: 15px;
  margin-bottom: 16px;
}

.empty .btn {
  margin: 0 auto;
}

.notice {
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 14.5px;
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.notice-warn {
  background: var(--warn-soft);
  color: var(--warn);
}

.notice-danger {
  background: var(--danger-soft);
  color: var(--danger);
}

.med-note {
  border-left: 3px solid var(--danger);
  background: var(--danger-soft);
  border-radius: 10px;
  padding: 10px 12px;
  color: var(--danger);
  font-size: 15px;
}

.kv {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 9px 0;
  border-top: 1px solid var(--line);
  font-size: 15px;
}

.kv:first-child {
  border-top: 0;
}

.kv dt {
  color: var(--muted);
  flex: 0 0 auto;
}

.kv dd {
  margin: 0;
  text-align: right;
  font-weight: 550;
  min-width: 0;
}

.money {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.money-lg {
  font-size: 26px;
  letter-spacing: -0.01em;
}

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

.small {
  font-size: 14px;
}

.center {
  text-align: center;
}

.pad-x {
  padding-left: 16px;
  padding-right: 16px;
}

/* ---------- segmented control ---------- */

.segmented {
  display: inline-flex;
  padding: 3px;
  background: var(--surface-soft);
  border-radius: 12px;
  border: 1px solid var(--line);
  gap: 2px;
}

.segmented button {
  border: 0;
  background: none;
  padding: 8px 14px;
  border-radius: 9px;
  font-size: 14.5px;
  font-weight: 650;
  color: var(--muted);
  cursor: pointer;
  min-height: 38px;
}

.segmented button[aria-pressed="true"] {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(34, 31, 27, 0.12);
}

/* ---------- sheet ---------- */

.sheet-root {
  position: fixed;
  inset: 0;
  z-index: 60;
}

.sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(34, 31, 27, 0.4);
  animation: fade 0.16s ease-out;
}

.sheet-panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  max-width: 620px;
  margin: 0 auto;
  background: var(--bg);
  border-radius: 22px 22px 0 0;
  padding: 8px 16px calc(20px + env(safe-area-inset-bottom));
  max-height: 88dvh;
  overflow-y: auto;
  animation: rise 0.2s cubic-bezier(0.2, 0.8, 0.3, 1);
  box-shadow: 0 -10px 40px -20px rgba(34, 31, 27, 0.5);
}

.sheet-grip {
  width: 40px;
  height: 5px;
  border-radius: 999px;
  background: var(--line-strong);
  margin: 6px auto 12px;
}

.sheet-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 4px;
}

.sheet-sub {
  color: var(--muted);
  font-size: 14.5px;
  margin-bottom: 14px;
}

@keyframes fade {
  from { opacity: 0; }
}

@keyframes rise {
  from { transform: translateY(18px); opacity: 0.6; }
}

@media (prefers-reduced-motion: reduce) {
  .sheet-backdrop, .sheet-panel {
    animation: none;
  }
}

.choice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 56px;
  padding: 10px 14px;
  margin-bottom: 8px;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  cursor: pointer;
  font-size: 16px;
}

.choice[aria-pressed="true"] {
  border-color: var(--brand);
  box-shadow: inset 0 0 0 1px var(--brand);
}

.choice-name {
  font-weight: 650;
}

.choice-meta {
  font-size: 13.5px;
  color: var(--muted);
}

/* ---------- toast ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tab-h) + 16px + env(safe-area-inset-bottom));
  transform: translate(-50%, 20px);
  width: min(560px, calc(100vw - 24px));
  background: #26231f;
  color: #fff;
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 15px;
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: space-between;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
  z-index: 70;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
  pointer-events: auto;
}

.toast button {
  background: none;
  border: 0;
  color: #f6d9a8;
  font-weight: 700;
  font-size: 15px;
  white-space: nowrap;
  cursor: pointer;
  padding: 6px 2px;
}

/* ---------- auth ---------- */

.auth {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 24px 18px calc(28px + env(safe-area-inset-bottom));
  gap: 18px;
}

.auth-hero {
  padding: 18px 0 4px;
}

.auth-mark {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: var(--brand);
  display: grid;
  place-items: center;
  margin-bottom: 16px;
}

.auth-title {
  font-size: 30px;
  line-height: 1.12;
  letter-spacing: -0.025em;
  font-weight: 700;
}

.auth-lede {
  color: var(--ink-2);
  font-size: 16px;
  margin-top: 8px;
  max-width: 34ch;
}

.auth-form {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 18px;
  box-shadow: var(--shadow);
}

.auth-switch {
  text-align: center;
  font-size: 15px;
  color: var(--muted);
  padding-top: 4px;
}

.auth-foot {
  margin-top: auto;
  font-size: 12.5px;
  color: var(--muted);
  text-align: center;
  line-height: 1.5;
}

.form-error {
  background: var(--danger-soft);
  color: var(--danger);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14.5px;
  margin-bottom: 12px;
}

.form-error:empty {
  display: none;
}

/* ---------- printable documents ---------- */

.doc {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 20px;
  margin-bottom: 16px;
  color: #1a1a1a;
}

.doc-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 2px solid #1a1a1a;
  padding-bottom: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.doc-service {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.doc-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #555;
  font-weight: 700;
}

.doc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  margin: 6px 0 12px;
}

.doc-table th,
.doc-table td {
  text-align: left;
  padding: 8px 6px;
  border-bottom: 1px solid #ddd6cc;
  vertical-align: top;
}

.doc-table th {
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #555;
  border-bottom: 1px solid #8c8579;
}

.doc-table td.num,
.doc-table th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.doc-total {
  display: flex;
  justify-content: space-between;
  font-size: 19px;
  font-weight: 700;
  border-top: 2px solid #1a1a1a;
  padding-top: 10px;
  margin-top: 6px;
}

.doc-foot {
  margin-top: 18px;
  font-size: 12.5px;
  color: #555;
  border-top: 1px solid #ddd6cc;
  padding-top: 10px;
  line-height: 1.5;
}

.doc h2 {
  font-size: 16px;
  margin: 20px 0 6px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.doc h2:first-of-type {
  margin-top: 0;
}

.doc p {
  margin-bottom: 8px;
}

.doc ul.plain {
  list-style: disc;
  padding-left: 20px;
  margin-bottom: 8px;
}

.doc ul.plain li {
  margin-bottom: 4px;
}

.print-toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

/* ---------- print ---------- */

@media print {
  :root {
    --bg: #fff;
  }

  body {
    background: #fff;
  }

  #root {
    max-width: none;
    box-shadow: none;
  }

  .topbar,
  .tabbar,
  .toast,
  .sheet-root,
  .no-print,
  .print-toolbar,
  .page-head .btn {
    display: none !important;
  }

  .page {
    padding: 0;
  }

  .card,
  .doc {
    border: 0;
    box-shadow: none;
    padding: 0;
  }

  .card {
    margin-bottom: 18px;
  }

  .doc {
    break-inside: avoid;
  }

  .doc-section {
    break-inside: avoid;
  }

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

  @page {
    margin: 14mm;
  }
}

/* ---------- wider screens ---------- */

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

  .topbar-inner {
    padding-left: 22px;
    padding-right: 22px;
  }

  .page-title {
    font-size: 30px;
  }

  .brand-service,
  .brand-sub {
    max-width: 320px;
  }
}

/* ---------- 320px safety ---------- */

@media (max-width: 359px) {
  body {
    font-size: 16px;
  }

  .page {
    padding-left: 12px;
    padding-right: 12px;
  }

  .topbar-inner {
    padding-left: 12px;
    padding-right: 12px;
  }

  .kid-action {
    min-width: 88px;
    padding: 0 10px;
    font-size: 14px;
  }

  .kid-name {
    font-size: 16px;
  }

  .page-title {
    font-size: 24px;
  }

  .doc {
    padding: 16px 13px;
  }

  .doc-table {
    font-size: 12.5px;
  }
}

/* ---------- component styles used by the screens ---------- */

.field > span {
  font-size: 14px;
  font-weight: 650;
  color: var(--ink-2);
}

.hint {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.45;
}

.fieldset {
  border: 0;
  padding: 0;
  margin: 0 0 14px;
}

.fieldset legend {
  font-size: 14px;
  font-weight: 650;
  color: var(--ink-2);
  padding: 0;
  margin-bottom: 8px;
}

.field-inline {
  display: inline-flex;
  margin: 0;
  width: auto;
}

.dayline {
  font-size: 14.5px;
  color: var(--muted);
  padding: 0 4px 10px;
  margin-top: -8px;
}

.daybar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0 14px;
}

.daybar-flush {
  padding-bottom: 12px;
}

.icon-btn {
  width: 44px;
  height: 44px;
  min-width: 44px;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink-2);
  font-size: 22px;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.daybar-label {
  flex: 1;
  text-align: center;
  font-weight: 650;
  font-size: 15px;
}

.daybar-today {
  font-size: 14px;
  white-space: nowrap;
}

.notbooked {
  margin-bottom: 14px;
}

.notbooked > summary {
  list-style: none;
  cursor: pointer;
  padding: 12px 4px;
  font-size: 15px;
  font-weight: 650;
  color: var(--brand);
}

.notbooked > summary::-webkit-details-marker {
  display: none;
}

.notbooked > summary::after {
  content: " +";
}

.notbooked[open] > summary::after {
  content: " –";
}

.reg-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 11px 0;
  font-size: 15px;
}

.reg-times {
  color: var(--ink-2);
  text-align: right;
}

.photo-row {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 16px;
}

.photo-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

.photo-pick {
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.person {
  border-top: 1px solid var(--line);
  padding-top: 14px;
  margin-top: 14px;
}

.person:first-child {
  border-top: 0;
  padding-top: 0;
  margin-top: 0;
}

.person-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.person-badge {
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}

.person .field:last-child {
  margin-bottom: 4px;
}

.sub-head {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-2);
  margin: 16px 0 6px;
}

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

.hero-card {
  display: flex;
  gap: 14px;
  align-items: center;
}

.hero-name {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.contact-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 11px 0;
}

.contact-name {
  font-size: 15.5px;
  font-weight: 600;
}

.contact-actions {
  display: flex;
  gap: 6px;
  flex: 0 0 auto;
}

.share-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.update-body {
  font-size: 16px;
  white-space: pre-wrap;
}

.chip-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.chip {
  border: 1px solid var(--line-strong);
  background: var(--surface);
  border-radius: 999px;
  padding: 8px 14px;
  min-height: 40px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-2);
  cursor: pointer;
}

.invoice-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  width: 100%;
  border: 0;
  background: none;
  padding: 12px 0;
  text-align: left;
  cursor: pointer;
}

.invoice-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex: 0 0 auto;
}

.summary-card {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.summary-right {
  text-align: right;
}

.doc-ref {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.doc-meta {
  text-align: right;
}

.doc-bill {
  margin-bottom: 14px;
}

.paid-stamp {
  display: inline-block;
  margin-top: 6px;
  border: 2px solid #1f6b40;
  color: #1f6b40;
  border-radius: 6px;
  padding: 1px 8px;
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 0.08em;
}

.foot-note {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
  padding: 12px 4px 0;
}

.row-link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 56px;
  padding: 10px 0;
  border: 0;
  border-top: 1px solid var(--line);
  background: none;
  text-align: left;
  text-decoration: none;
  color: var(--ink);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}

.row-link:first-child {
  border-top: 0;
}

.kid-action-link {
  display: grid;
  place-items: center;
  text-decoration: none;
  min-width: 76px;
}

.empty-inline {
  padding: 26px 16px;
  margin-bottom: 14px;
}

.archived-note {
  margin: 8px 4px;
}

.person-note {
  margin-bottom: 10px;
}

.top-gap {
  margin-top: 8px;
}

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

.compliance-child {
  border-top: 1px solid #ddd6cc;
  padding-top: 12px;
  margin-top: 14px;
}

.compliance-child h2 {
  margin-top: 0;
}

body.sheet-open {
  overflow: hidden;
}

