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

html, body {
  margin: 0;
  padding: 0;
  background: #F4F1EA;
  color: #1A1A1A;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-text-size-adjust: 100%;
}

.app {
  max-width: 430px;
  margin: 0 auto;
  padding: max(16px, env(safe-area-inset-top)) 16px max(28px, env(safe-area-inset-bottom));
}

.site-header {
  text-align: center;
  margin-bottom: 18px;
}

.site-logo {
  display: block;
  max-width: 160px;
  max-height: 80px;
  width: auto;
  height: auto;
  margin: 0 auto 12px;
  object-fit: contain;
}

.site-header h1 {
  margin: 0 0 6px;
  font-size: 22px;
  color: #1B365D;
}

.subtitle {
  margin: 0;
  font-size: 14px;
  line-height: 1.4;
  color: #2E6B4F;
}

.card {
  background: #fff;
  border: 1px solid #D6D1C7;
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 14px;
}

.card h2 {
  margin: 0 0 10px;
  font-size: 17px;
  color: #1B365D;
}

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

.card-head h2 {
  margin: 0;
}

.hint {
  margin: 0 0 12px;
  font-size: 13px;
  line-height: 1.4;
  color: #5a5a5a;
}

.hint.status {
  margin-top: 10px;
  margin-bottom: 0;
  min-height: 1.2em;
}

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

.field.grow {
  flex: 1;
  margin-bottom: 0;
}

.label {
  font-size: 14px;
  font-weight: 600;
  color: #1B365D;
}

input[type="text"],
select {
  width: 100%;
  min-height: 44px;
  font-size: 16px;
  padding: 10px 12px;
  border: 1px solid #D6D1C7;
  border-radius: 10px;
  background: #fff;
  color: #1A1A1A;
}

.tier-row {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  margin-bottom: 12px;
}

.tier-badge {
  margin: 6px 0 0;
  display: inline-block;
  min-width: 72px;
  padding: 8px 12px;
  border-radius: 999px;
  background: #1B365D;
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  text-align: center;
}

.children-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.child-card {
  border: 1px solid #E8E3DA;
  border-radius: 12px;
  padding: 12px;
  background: #FBF9F5;
}

.child-top {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
}

.child-top input {
  flex: 1;
  min-height: 44px;
  font-size: 16px;
  padding: 10px 12px;
  border: 1px solid #D6D1C7;
  border-radius: 10px;
  background: #fff;
}

.btn-remove {
  min-height: 44px;
  min-width: 44px;
  border: none;
  background: transparent;
  color: #b42318;
  font-size: 20px;
  cursor: pointer;
  border-radius: 10px;
}

.day-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.day-chip {
  min-height: 40px;
  min-width: 48px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid #D6D1C7;
  background: #fff;
  color: #1B365D;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.day-chip[aria-pressed="true"] {
  background: #1B365D;
  border-color: #1B365D;
  color: #fff;
}

.table-wrap {
  overflow-x: auto;
  margin-bottom: 10px;
}

.totals-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.totals-table th,
.totals-table td {
  text-align: left;
  padding: 8px 6px;
  border-bottom: 1px solid #E8E3DA;
}

.totals-table th {
  color: #1B365D;
  font-weight: 600;
}

.totals-table tfoot td {
  font-weight: 700;
  border-bottom: none;
  padding-top: 12px;
  color: #1B365D;
}

.deposit-note {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 600;
  color: #2E6B4F;
}

.actions-block {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 8px 0 18px;
}

.btn-primary,
.btn-quiet {
  min-height: 48px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-primary {
  border: none;
  background: #1B365D;
  color: #fff;
  width: 100%;
}

.btn-quiet {
  border: 1px solid #D6D1C7;
  background: transparent;
  color: #1B365D;
  padding: 0 16px;
}

.btn-quiet.small {
  min-height: 36px;
  font-size: 13px;
  padding: 0 12px;
  white-space: nowrap;
}

.btn-quiet.call {
  width: 100%;
  background: #fff;
}

.site-footer {
  text-align: center;
  padding-top: 8px;
  border-top: 1px solid #D6D1C7;
}

.site-footer p {
  margin: 0 0 4px;
  font-size: 12px;
  color: #5a5a5a;
}

.site-footer strong {
  color: #1B365D;
}

.site-footer a {
  color: #1B365D;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.actions-block .btn-quiet {
  text-align: center;
}
