:root {
  color-scheme: light;
  --ink: #181b19;
  --muted: #68706b;
  --faint: #929994;
  --line: #dfe3df;
  --surface: #ffffff;
  --canvas: #f4f5f2;
  --canvas-strong: #e8ebe7;
  --coral: #e7563f;
  --coral-dark: #bc3d2c;
  --coral-soft: #fae6e1;
  --teal: #24756e;
  --teal-soft: #dcefeb;
  --yellow: #e6b84b;
  --yellow-soft: #f8efd8;
  --danger: #b53d35;
  --success: #2f7a50;
  --shadow: 0 16px 44px rgba(31, 39, 34, 0.12);
  --header-height: 72px;
  --nav-height: 78px;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: #dfe3df;
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--ink);
  background: #dfe3df;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
}

button,
input,
textarea,
select {
  font: inherit;
  letter-spacing: 0;
}

button {
  color: inherit;
}

button,
label,
summary {
  -webkit-tap-highlight-color: transparent;
}

img {
  display: block;
  max-width: 100%;
}

.app-frame {
  position: relative;
  width: min(100%, 760px);
  min-height: 100svh;
  margin: 0 auto;
  overflow: hidden;
  background: var(--canvas);
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  min-height: calc(var(--header-height) + env(safe-area-inset-top));
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  padding: calc(10px + env(safe-area-inset-top)) 18px 10px;
  border-bottom: 1px solid rgba(24, 27, 25, 0.08);
  background: rgba(244, 245, 242, 0.96);
  backdrop-filter: blur(18px);
}

.app-header.hidden {
  display: none;
}

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

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  background: var(--coral);
  font-size: 20px;
  font-weight: 800;
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand-lockup div {
  min-width: 0;
}

.brand-lockup strong,
.brand-lockup span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-lockup strong {
  font-size: 17px;
  line-height: 1.1;
}

.brand-lockup div > span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}

.save-state {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
  padding-bottom: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.save-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
}

.save-state[data-state="saving"] .save-dot {
  background: var(--yellow);
  animation: pulse 900ms ease-in-out infinite alternate;
}

.save-state[data-state="error"] {
  color: var(--danger);
}

.save-state[data-state="error"] .save-dot {
  background: var(--danger);
}

.app-main {
  min-height: calc(100svh - var(--header-height));
  padding: 0 18px calc(var(--nav-height) + env(safe-area-inset-bottom) + 24px);
}

.bottom-nav {
  position: fixed;
  z-index: 40;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  width: min(100%, 760px);
  min-height: calc(var(--nav-height) + env(safe-area-inset-bottom));
  margin: 0 auto;
  grid-template-columns: repeat(4, 1fr);
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(24, 27, 25, 0.1);
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(20px);
}

.bottom-nav.hidden {
  display: none;
}

.bottom-nav button {
  display: grid;
  min-width: 0;
  height: 54px;
  place-items: center;
  align-content: center;
  gap: 4px;
  border: 0;
  border-radius: 7px;
  color: #737a75;
  background: transparent;
  cursor: pointer;
}

.bottom-nav button span:last-child {
  font-size: 10px;
  font-weight: 700;
}

.bottom-nav button.active {
  color: var(--coral-dark);
  background: var(--coral-soft);
}

.icon {
  display: inline-block;
  width: 21px;
  height: 21px;
  flex: 0 0 21px;
  background: currentColor;
  mask: var(--icon) center / contain no-repeat;
  -webkit-mask: var(--icon) center / contain no-repeat;
}

.icon.small {
  width: 17px;
  height: 17px;
  flex-basis: 17px;
}

.screen {
  animation: screen-in 230ms ease both;
}

.screen-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 0 18px;
}

.screen-head.compact {
  align-items: center;
  padding-bottom: 12px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--coral-dark);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

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

h1,
h2,
h3 {
  letter-spacing: 0;
}

.screen-title {
  margin-bottom: 5px;
  font-size: 31px;
  line-height: 1.03;
}

.screen-subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
}

.icon-button,
.plain-icon-button {
  display: inline-grid;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  cursor: pointer;
}

.plain-icon-button {
  border-color: transparent;
  background: transparent;
}

.primary-button,
.secondary-button,
.danger-button,
.text-button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 15px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 760;
  cursor: pointer;
}

.primary-button {
  border: 1px solid var(--coral);
  color: #fff;
  background: var(--coral);
}

.secondary-button {
  border: 1px solid var(--line);
  background: var(--surface);
}

.danger-button {
  border: 1px solid #e8c6c2;
  color: var(--danger);
  background: #fff7f6;
}

.text-button {
  min-height: 36px;
  padding: 0 8px;
  border: 0;
  color: var(--coral-dark);
  background: transparent;
}

.date-rail {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
  margin: 0 -4px 22px;
}

.date-chip {
  display: grid;
  min-width: 0;
  height: 64px;
  place-items: center;
  align-content: center;
  gap: 4px;
  padding: 0;
  border: 0;
  border-radius: 7px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}

.date-chip span {
  font-size: 10px;
  font-weight: 750;
  text-transform: uppercase;
}

.date-chip strong {
  font-size: 17px;
}

.date-chip.active {
  color: #fff;
  background: var(--ink);
}

.date-chip.today:not(.active) strong {
  color: var(--coral-dark);
}

.section-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 10px;
}

.section-label h2 {
  margin: 0;
  font-size: 17px;
}

.section-label span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.agenda-list {
  overflow: hidden;
  border-top: 1px solid var(--line);
}

.session-row {
  display: grid;
  width: 100%;
  min-height: 126px;
  grid-template-columns: 104px minmax(0, 1fr) 24px;
  gap: 14px;
  align-items: center;
  padding: 13px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  text-align: left;
  background: transparent;
  cursor: pointer;
}

.session-thumb {
  position: relative;
  width: 104px;
  height: 98px;
  overflow: hidden;
  border-radius: 7px;
  background: var(--canvas-strong);
}

.session-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.session-thumb .done-mark {
  position: absolute;
  right: 7px;
  bottom: 7px;
  display: grid;
  width: 25px;
  height: 25px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--success);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.22);
}

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

.session-time {
  display: block;
  margin-bottom: 5px;
  color: var(--coral-dark);
  font-size: 12px;
  font-weight: 800;
}

.session-copy strong {
  display: block;
  font-size: 18px;
  line-height: 1.14;
}

.session-copy > span:not(.session-time) {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.session-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  margin-top: 9px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

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

.empty-day {
  padding: 34px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.empty-day strong {
  display: block;
  margin-bottom: 7px;
  font-size: 18px;
}

.empty-day p {
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.day-note {
  margin-top: 24px;
}

.field,
.textarea-field {
  display: grid;
  gap: 7px;
}

.field > span,
.textarea-field > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.field input,
.field select,
.textarea-field textarea,
.search-field input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  outline: 0;
  color: var(--ink);
  background: var(--surface);
}

.field input,
.field select,
.search-field input {
  height: 46px;
  padding: 0 13px;
}

.textarea-field textarea {
  min-height: 94px;
  padding: 12px 13px;
  resize: vertical;
  line-height: 1.45;
}

.field input:focus,
.field select:focus,
.textarea-field textarea:focus,
.search-field input:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(36, 117, 110, 0.12);
}

.detail-screen {
  margin: 0 -18px;
  padding-bottom: 32px;
  background: var(--canvas);
}

.detail-topbar {
  position: sticky;
  top: 0;
  z-index: 35;
  display: grid;
  min-height: calc(58px + env(safe-area-inset-top));
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  align-items: end;
  gap: 7px;
  padding: calc(8px + env(safe-area-inset-top)) 12px 8px;
  border-bottom: 1px solid rgba(24, 27, 25, 0.08);
  background: rgba(244, 245, 242, 0.96);
  backdrop-filter: blur(18px);
}

.detail-topbar .plain-icon-button {
  width: 42px;
  height: 42px;
}

.detail-topbar-title {
  min-width: 0;
  padding-bottom: 4px;
  text-align: center;
}

.detail-topbar-title strong,
.detail-topbar-title span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-topbar-title strong {
  font-size: 14px;
}

.detail-topbar-title span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.session-hero {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--canvas-strong);
}

.session-hero img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  animation: image-reveal 450ms ease both;
}

.hero-status {
  position: absolute;
  right: 14px;
  bottom: 14px;
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  gap: 7px;
  padding: 0 11px;
  border-radius: 7px;
  color: #fff;
  background: rgba(24, 27, 25, 0.86);
  font-size: 11px;
  font-weight: 760;
  backdrop-filter: blur(8px);
}

.detail-intro {
  padding: 20px 18px 16px;
}

.detail-intro h1 {
  margin-bottom: 7px;
  font-size: 30px;
  line-height: 1.04;
}

.detail-intro p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
}

.detail-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-top: 13px;
  font-size: 12px;
  font-weight: 700;
}

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

.detail-metrics b {
  color: var(--ink);
}

.segment-control {
  position: sticky;
  top: calc(58px + env(safe-area-inset-top));
  z-index: 25;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 0 18px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(244, 245, 242, 0.97);
  backdrop-filter: blur(16px);
}

.segment-control button {
  position: relative;
  height: 48px;
  border: 0;
  color: var(--muted);
  background: transparent;
  font-size: 13px;
  font-weight: 760;
  cursor: pointer;
}

.segment-control button.active {
  color: var(--ink);
}

.segment-control button.active::after {
  position: absolute;
  right: 14px;
  bottom: -1px;
  left: 14px;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: var(--coral);
  content: "";
}

.detail-content {
  padding: 18px;
}

.plan-note {
  display: grid;
  gap: 7px;
  margin-bottom: 20px;
  padding: 13px 14px;
  border-left: 3px solid var(--teal);
  border-radius: 0 7px 7px 0;
  background: var(--teal-soft);
}

.plan-note strong {
  font-size: 12px;
}

.plan-note span {
  color: #335e59;
  font-size: 12px;
  line-height: 1.45;
}

.phase-list {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--line);
}

.phase-row {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr);
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.phase-image {
  width: 90px;
  height: 90px;
  overflow: hidden;
  border-radius: 7px;
  background: var(--canvas-strong);
}

.phase-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

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

.phase-time {
  color: var(--coral-dark);
  font-size: 11px;
  font-weight: 800;
}

.phase-copy h3 {
  margin: 4px 0 5px;
  font-size: 15px;
  line-height: 1.2;
}

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

.phase-levels {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
}

.level-tag {
  padding: 4px 6px;
  border-radius: 5px;
  color: #3d5e59;
  background: var(--teal-soft);
  font-size: 9px;
  font-weight: 750;
}

.attendance-toolbar,
.receipt-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 10px;
}

.attendance-toolbar strong,
.receipt-toolbar strong {
  font-size: 15px;
}

.attendance-toolbar span,
.receipt-toolbar span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

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

.person-row {
  display: grid;
  min-height: 68px;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 11px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.person-row.clickable {
  cursor: pointer;
}

.avatar {
  display: grid;
  width: 42px;
  height: 42px;
  overflow: hidden;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--avatar, var(--teal));
  font-size: 13px;
  font-weight: 800;
}

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

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

.person-copy strong,
.person-copy span {
  display: block;
}

.person-copy strong {
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.person-copy span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.3;
}

.check-control {
  position: relative;
  display: inline-grid;
  width: 32px;
  height: 32px;
  place-items: center;
}

.check-control input {
  position: absolute;
  z-index: 2;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.check-box {
  display: grid;
  width: 27px;
  height: 27px;
  place-items: center;
  border: 1.5px solid #bdc3bf;
  border-radius: 7px;
  color: transparent;
  background: var(--surface);
  transition: 150ms ease;
}

.check-box,
.check-box .icon {
  pointer-events: none;
}

.check-control input:checked + .check-box {
  border-color: var(--teal);
  color: #fff;
  background: var(--teal);
}

.receipt-person-row {
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: start;
  padding: 12px 0;
}

.receipt-preview {
  padding: 0;
  border: 0;
  cursor: pointer;
}

.receipt-copy {
  display: grid;
  gap: 2px;
}

.receipt-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin-top: 10px;
}

.receipt-action {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink);
  background: var(--surface);
  font-size: 11px;
  font-weight: 750;
  cursor: pointer;
}

.receipt-action.primary {
  border-color: var(--coral);
  color: #fff;
  background: var(--coral);
}

.receipt-add-action input {
  display: none;
}

.danger-action {
  color: var(--danger);
  border-color: rgba(177, 68, 68, 0.24);
  background: #fff7f6;
}

.amount-compact {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 7px;
}

.amount-compact span {
  margin: 0;
  font-size: 9px;
  font-weight: 750;
}

.amount-compact input {
  width: 72px;
  height: 30px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  outline: 0;
  background: var(--surface);
  font-size: 11px;
  font-weight: 700;
}

.receipt-viewer-open {
  overflow: hidden;
}

.receipt-viewer {
  position: fixed;
  z-index: 1000;
  inset: 0;
  display: grid;
  padding: max(12px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom));
  place-items: center;
  background: rgba(19, 22, 20, 0.78);
  backdrop-filter: blur(7px);
}

.receipt-viewer-panel {
  display: grid;
  width: min(100%, 520px);
  max-height: 100%;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
}

.receipt-viewer-panel header {
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px 8px 16px;
  border-bottom: 1px solid var(--line);
}

.receipt-viewer-panel header strong,
.receipt-viewer-panel header span {
  display: block;
}

.receipt-viewer-panel header strong {
  font-size: 14px;
}

.receipt-viewer-panel header span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.viewer-close {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--ink);
  background: var(--canvas);
  cursor: pointer;
}

.receipt-viewer-image {
  min-height: 0;
  overflow: auto;
  background: #252824;
}

.receipt-viewer-image img {
  display: block;
  width: 100%;
  height: auto;
  min-height: 100%;
  object-fit: contain;
}

.lesson-complete {
  position: sticky;
  bottom: 0;
  z-index: 20;
  padding: 12px 18px calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: rgba(244, 245, 242, 0.96);
  backdrop-filter: blur(16px);
}

.lesson-complete button {
  width: 100%;
  min-height: 48px;
}

.calendar-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 0 16px;
}

.calendar-toolbar h1 {
  margin: 0;
  font-size: 27px;
}

.calendar-arrows {
  display: flex;
  gap: 6px;
}

.calendar-weekdays,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.calendar-weekdays span {
  padding: 9px 0;
  color: var(--muted);
  text-align: center;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.calendar-grid {
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.calendar-day {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 68px;
  align-content: start;
  justify-items: center;
  gap: 7px;
  padding: 9px 2px;
  border: 0;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  cursor: pointer;
}

.calendar-day.outside {
  color: #b8bdb9;
  background: #f1f2ef;
}

.calendar-day.selected {
  box-shadow: inset 0 0 0 2px var(--coral);
}

.calendar-day.today strong {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--ink);
}

.calendar-day strong {
  font-size: 12px;
}

.calendar-dots {
  display: flex;
  gap: 3px;
  height: 7px;
}

.calendar-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--teal);
}

.calendar-dot.done {
  background: var(--coral);
}

.calendar-day small {
  color: var(--muted);
  font-size: 8px;
  font-weight: 750;
}

.search-field {
  position: relative;
  margin-bottom: 12px;
}

.search-field .icon {
  position: absolute;
  top: 14px;
  left: 13px;
  color: var(--muted);
}

.search-field input {
  padding-left: 42px;
}

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

.children-list .person-row {
  grid-template-columns: 46px minmax(0, 1fr) 24px;
}

.children-list .avatar {
  width: 46px;
  height: 46px;
}

.child-editor {
  padding: 0 0 calc(28px + env(safe-area-inset-bottom));
}

.editor-topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: grid;
  min-height: calc(58px + env(safe-area-inset-top));
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  align-items: end;
  gap: 8px;
  padding: calc(8px + env(safe-area-inset-top)) 12px 8px;
  border-bottom: 1px solid var(--line);
  background: rgba(244, 245, 242, 0.97);
  backdrop-filter: blur(16px);
}

.editor-topbar strong {
  padding-bottom: 12px;
  text-align: center;
  font-size: 14px;
}

.editor-form {
  display: grid;
  gap: 16px;
  padding: 24px 18px;
}

.editor-avatar {
  display: grid;
  justify-items: center;
  gap: 10px;
  margin-bottom: 4px;
}

.editor-avatar .avatar {
  width: 84px;
  height: 84px;
  font-size: 23px;
}

.photo-label {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  gap: 7px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  font-size: 11px;
  font-weight: 740;
  cursor: pointer;
}

.photo-label input {
  display: none;
}

.editor-actions {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 9px;
  padding-top: 6px;
}

.payment-total {
  padding: 20px 0 24px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.payment-month-nav {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) 46px;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  padding: 10px 0 14px;
  border-top: 1px solid var(--line);
}

.payment-month-nav > div {
  text-align: center;
}

.payment-month-nav span,
.payment-month-nav strong {
  display: block;
}

.payment-month-nav span {
  color: var(--muted);
  font-size: 10px;
}

.payment-month-nav strong {
  margin-top: 3px;
  font-size: 16px;
}

.payment-total span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.payment-total strong {
  display: block;
  margin-top: 5px;
  font-size: 42px;
  line-height: 1;
}

.payment-total small {
  display: block;
  margin-top: 9px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.payment-overall {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
}

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

.payment-overall strong {
  font-size: 16px;
}

.payment-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid var(--line);
}

.payment-split div {
  padding: 16px 0;
}

.payment-split div + div {
  padding-left: 16px;
  border-left: 1px solid var(--line);
}

.payment-split span,
.payment-split strong {
  display: block;
}

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

.payment-split strong {
  margin-top: 5px;
  font-size: 19px;
}

.payment-month-history {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  overflow-x: auto;
  scrollbar-width: none;
}

.payment-month-history::-webkit-scrollbar {
  display: none;
}

.payment-month-history button {
  min-width: 126px;
  min-height: 54px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  text-align: left;
  color: var(--ink);
  background: var(--surface);
  cursor: pointer;
}

.payment-month-history button.active {
  border-color: var(--coral);
  background: var(--coral-soft);
}

.payment-month-history span,
.payment-month-history strong {
  display: block;
  white-space: nowrap;
}

.payment-month-history span {
  color: var(--muted);
  font-size: 9px;
}

.payment-month-history strong {
  margin-top: 4px;
  font-size: 13px;
}

.payment-list {
  margin-top: 22px;
  border-top: 1px solid var(--line);
}

.payment-row {
  display: grid;
  min-height: 68px;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 11px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.payment-type {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 7px;
  color: var(--teal);
  background: var(--teal-soft);
}

.payment-type.receipt {
  color: var(--coral-dark);
  background: var(--coral-soft);
}

.payment-row-copy strong,
.payment-row-copy span {
  display: block;
}

.payment-row-copy strong {
  font-size: 13px;
}

.payment-row-copy span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
}

.payment-row-end {
  display: grid;
  justify-items: end;
  gap: 7px;
}

.payment-row-end > strong {
  font-size: 13px;
}

.payment-receipt-button {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0 8px;
  border: 1px solid rgba(219, 84, 65, 0.28);
  border-radius: 6px;
  color: var(--coral-dark);
  background: var(--coral-soft);
  font-size: 9px;
  font-weight: 780;
  white-space: nowrap;
  cursor: pointer;
}

.toast {
  position: fixed;
  z-index: 100;
  right: 20px;
  bottom: calc(var(--nav-height) + env(safe-area-inset-bottom) + 16px);
  left: 20px;
  width: min(calc(100% - 40px), 420px);
  margin: 0 auto;
  padding: 12px 14px;
  border-radius: 7px;
  color: #fff;
  background: rgba(24, 27, 25, 0.94);
  box-shadow: var(--shadow);
  font-size: 12px;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: 180ms ease;
}

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

.loading-screen {
  display: grid;
  min-height: calc(100svh - var(--header-height) - var(--nav-height));
  place-items: center;
  color: var(--muted);
  font-size: 13px;
}

@keyframes screen-in {
  from {
    opacity: 0;
    transform: translateY(7px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes image-reveal {
  from {
    opacity: 0;
    transform: scale(1.025);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes pulse {
  from {
    opacity: 0.45;
  }
  to {
    opacity: 1;
  }
}

@media (min-width: 761px) {
  .app-frame {
    box-shadow: var(--shadow);
  }
}

@media (max-width: 390px) {
  .app-main {
    padding-right: 14px;
    padding-left: 14px;
  }

  .detail-screen {
    margin-right: -14px;
    margin-left: -14px;
  }

  .app-header {
    padding-right: 14px;
    padding-left: 14px;
  }

  .save-state span:last-child {
    max-width: 72px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .screen-title {
    font-size: 28px;
  }

  .session-row {
    min-height: 116px;
    grid-template-columns: 92px minmax(0, 1fr) 20px;
    gap: 11px;
  }

  .session-thumb {
    width: 92px;
    height: 88px;
  }

  .session-copy strong {
    font-size: 16px;
  }

  .phase-row {
    grid-template-columns: 82px minmax(0, 1fr);
    gap: 11px;
  }

  .phase-image {
    width: 82px;
    height: 82px;
  }
}

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