* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, sans-serif;
  background: #f1f5f9;
  color: #0f172a;
  line-height: 1.5;
  padding-bottom: 5.5rem;
}

a {
  color: #1e40af;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.app-header {
  background: #1e3a5f;
  color: #fff;
  padding: 1rem 1rem 0.75rem;
}

.app-header h1 {
  margin: 0;
  font-size: 1.35rem;
}

.subtitle {
  margin: 0.25rem 0 0;
  opacity: 0.85;
  font-size: 0.9rem;
}

.main-nav {
  display: flex;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background: #fff;
  border-top: 1px solid #cbd5e1;
  box-shadow: 0 -2px 8px rgba(15, 23, 42, 0.08);
}

.main-nav a {
  flex: 1;
  padding: 0.65rem 0.25rem;
  color: #475569;
  font-weight: 600;
  font-size: 0.85rem;
  text-align: center;
  text-decoration: none;
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.main-nav a.active {
  color: #1e40af;
  background: #eff6ff;
}

.period-label {
  display: grid;
  gap: 0.2rem;
  font-size: 0.875rem;
  flex: 1;
  min-width: 200px;
}

.hint {
  color: #64748b;
  font-size: 0.85rem;
}

.app-main {
  max-width: 720px;
  margin: 0 auto;
  padding: 1rem 1rem 1.5rem;
}

.panel {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 1.1rem;
  margin-bottom: 1rem;
}

.panel-head,
.panel-head-inline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}

.panel h2,
.panel h3 {
  margin: 0 0 0.75rem;
}

.panel-head h2 {
  margin: 0;
}

.panel-head-inline {
  margin-bottom: 0.75rem;
}

.cards,
.mini-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.65rem;
  margin-bottom: 0.75rem;
}

.cards-compact {
  margin-top: 0.75rem;
}

.card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 0.75rem;
}

.card.highlight {
  border-color: #93c5fd;
  background: #eff6ff;
}

.card.highlight-total {
  border-color: #86efac;
  background: #f0fdf4;
}

.card.highlight-pending {
  border-color: #fcd34d;
  background: #fffbeb;
}

.header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
}

.alert-link {
  color: #fff;
  font-size: 1.35rem;
  text-decoration: none;
  position: relative;
  padding: 0.25rem;
}

.notification-badge {
  position: absolute;
  top: -0.15rem;
  right: -0.35rem;
  background: #dc2626;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  min-width: 1.1rem;
  height: 1.1rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.2rem;
}

.session-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.75rem;
  font-size: 0.95rem;
}

.panel-login {
  max-width: 420px;
  margin: 0 auto;
}

.login-links {
  margin-top: 1rem;
  text-align: center;
}

input[type="password"] {
  padding: 0.55rem 0.65rem;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  min-height: 44px;
  width: 100%;
  font: inherit;
}

.member-picker-label {
  font-weight: 700;
}

.identity-note {
  margin: 0.5rem 0 0;
  font-size: 0.78rem;
  opacity: 0.85;
}

.alert-amount {
  margin: 0 0 0.35rem;
  font-size: 1.5rem;
  font-weight: 800;
  color: #1e3a5f;
}

.alert-time {
  margin: 0 0 0.85rem;
  color: #64748b;
  font-size: 0.8rem;
}

.who-paid-list {
  display: grid;
  gap: 0.65rem;
}

.who-paid-row {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 0.85rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  font-size: 1rem;
}

.who-paid-row strong {
  color: #1e3a5f;
}

.member-picker select {
  min-height: 44px;
}

.panel-attention {
  border-color: #fcd34d;
  background: #fffbeb;
}

.panel-fyi {
  border-color: #cbd5e1;
  background: #f8fafc;
}

.alert-card-fyi {
  border-color: #e2e8f0;
  background: #fff;
}

.fyi-badge {
  margin: 0 0 0.5rem;
  font-weight: 600;
}

.alert-list {
  display: grid;
  gap: 0.85rem;
}

.alert-card {
  background: #fff;
  border: 1px solid #fde68a;
  border-radius: 12px;
  padding: 1rem;
}

.alert-message {
  margin: 0 0 0.35rem;
  font-size: 1rem;
  font-weight: 600;
}

.alert-meta {
  margin: 0 0 0.85rem;
  color: #64748b;
  font-size: 0.9rem;
}

.alert-actions {
  display: grid;
  gap: 0.65rem;
}

.status-badge {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-top: 0.35rem;
}

.status-badge.confirmed {
  color: #15803d;
}

.status-badge.pending {
  color: #a16207;
}

.status-badge.attention {
  color: #c2410c;
}

.tx-card-link-area {
  color: inherit;
  text-decoration: none;
  display: block;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin: 1rem 0;
}

.detail-grid .label {
  display: block;
  font-size: 0.8rem;
  color: #64748b;
}

.detail-status {
  margin: 0.75rem 0 1rem;
}

.ack-list {
  margin: 0;
  padding-left: 1.1rem;
  display: grid;
  gap: 0.65rem;
}

.card .label {
  font-size: 0.8rem;
  color: #64748b;
}

.card .value {
  font-size: 1.15rem;
  font-weight: 700;
  word-break: break-word;
}

.hero-amount {
  font-size: 2.25rem;
  font-weight: 800;
  color: #1e3a5f;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.hero-caption {
  margin: 0.25rem 0 0;
  color: #64748b;
  font-size: 0.95rem;
}

.amount-lg {
  font-size: 1.05rem;
  font-weight: 700;
  color: #1e3a5f;
}

.home-add-btn {
  display: block;
  text-align: center;
  margin-bottom: 1rem;
  text-decoration: none;
}

.home-add-btn:hover {
  text-decoration: none;
}

.fab-add {
  position: fixed;
  right: 1rem;
  bottom: 4.25rem;
  z-index: 60;
  background: #15803d;
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 0.6rem 0.85rem;
  border-radius: 999px;
  box-shadow: 0 2px 10px rgba(21, 128, 61, 0.3);
  text-decoration: none;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
}

.fab-add:hover {
  text-decoration: none;
  background: #166534;
}

.fab-add[hidden] {
  display: none;
}

.more-links {
  display: grid;
  gap: 0.5rem;
}

.more-link {
  display: block;
  padding: 1rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  color: #0f172a;
  font-weight: 600;
  text-decoration: none;
}

.more-link:hover {
  border-color: #93c5fd;
  text-decoration: none;
}

.btn-primary,
.btn-secondary,
.btn-small,
button[type="submit"] {
  font: inherit;
  cursor: pointer;
  border-radius: 8px;
  border: none;
  padding: 0.55rem 0.9rem;
  min-height: 44px;
}

.btn-primary,
button[type="submit"].btn-primary {
  background: #1e40af;
  color: #fff;
}

.btn-secondary {
  background: #e2e8f0;
  color: #0f172a;
  display: inline-flex;
  align-items: center;
}

.btn-danger {
  background: #b91c1c;
  color: #fff;
  font-weight: 600;
}

.btn-large {
  width: 100%;
  font-size: 1.05rem;
  font-weight: 700;
  padding: 0.85rem 1rem;
}

.btn-small {
  min-height: 36px;
  padding: 0.35rem 0.65rem;
  font-size: 0.85rem;
  background: #e2e8f0;
  color: #0f172a;
}

.btn-small.danger,
button.danger {
  background: #b91c1c;
  color: #fff;
}

.form-stack,
.filter-grid {
  display: grid;
  gap: 0.75rem;
}

label {
  display: grid;
  gap: 0.25rem;
  font-size: 0.9rem;
}

input,
select,
button {
  font: inherit;
}

input,
select {
  padding: 0.55rem 0.65rem;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  min-height: 44px;
  width: 100%;
}

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

th,
td {
  border-bottom: 1px solid #e2e8f0;
  padding: 0.55rem;
  text-align: left;
  vertical-align: top;
}

th {
  background: #f8fafc;
  white-space: nowrap;
}

.actions {
  white-space: nowrap;
}

.member-grid {
  display: grid;
  gap: 0.75rem;
}

.member-card {
  display: block;
  padding: 1rem;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
  color: inherit;
  text-decoration: none;
}

.member-card:hover {
  border-color: #93c5fd;
  text-decoration: none;
}

.member-card h3 {
  margin: 0 0 0.75rem;
}

.member-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}

.member-stats span {
  display: block;
  font-size: 0.75rem;
  color: #64748b;
}

.stat-block {
  margin-bottom: 1rem;
}

.stat-block h4 {
  margin: 0 0 0.5rem;
}

.tx-list {
  display: grid;
  gap: 0.65rem;
}

.tx-card {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 0.75rem;
  background: #f8fafc;
}

.tx-card-head {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.tx-card-body .muted {
  color: #64748b;
  font-size: 0.85rem;
}

.row-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.65rem;
}

.mobile-only {
  display: block;
}

.desktop-only {
  display: none;
}

.message {
  font-size: 0.9rem;
}

.message.error {
  color: #b91c1c;
}

.message.success {
  color: #15803d;
}

.panel-primary {
  border-color: #93c5fd;
  background: linear-gradient(180deg, #fff 0%, #f8fbff 100%);
}

.section-label {
  margin: 1rem 0 0.5rem;
  font-size: 0.95rem;
  color: #334155;
}

.empty-state {
  text-align: center;
  padding: 2rem 1rem;
  background: #fff;
  border: 1px dashed #cbd5e1;
  border-radius: 12px;
}

.empty-state h3 {
  margin: 0 0 0.5rem;
}

.empty-state p {
  color: #64748b;
  margin: 0 0 1rem;
}

.edit-summary {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 0.75rem;
  font-size: 0.9rem;
  color: #334155;
}

.backup-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

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

.loading {
  text-align: center;
  color: #64748b;
  padding: 2rem 1rem;
}

.toast {
  position: fixed;
  bottom: 5.5rem;
  left: 50%;
  transform: translateX(-50%);
  background: #0f172a;
  color: #fff;
  padding: 0.75rem 1rem;
  border-radius: 999px;
  z-index: 100;
  max-width: calc(100% - 2rem);
  text-align: center;
}

.toast-error {
  background: #b91c1c;
}

dialog {
  border: none;
  border-radius: 12px;
  padding: 0;
  width: min(480px, calc(100% - 2rem));
}

dialog form {
  padding: 1rem;
  display: grid;
  gap: 0.75rem;
}

.dialog-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
}

@media (min-width: 768px) {
  body {
    padding-bottom: 2rem;
  }

  .main-nav {
    position: static;
    max-width: 720px;
    margin: 0 auto;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: none;
    margin-bottom: 0.5rem;
  }

  .main-nav a {
    padding: 0.85rem 1rem;
    font-size: 0.95rem;
    border-right: 1px solid #e2e8f0;
  }

  .main-nav a:last-child {
    border-right: none;
  }

  .fab-add {
    bottom: 1.25rem;
    font-size: 0.9rem;
    padding: 0.65rem 1rem;
  }

  .toast {
    bottom: 1.5rem;
  }

  .hero-amount {
    font-size: 2.75rem;
  }

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

  .filter-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .mobile-only {
    display: none;
  }

  .desktop-only {
    display: block;
  }
}

@media (min-width: 1024px) {
  .member-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.panel-home h2 {
  margin-bottom: 1rem;
}

.person-card-list {
  display: grid;
  gap: 0.75rem;
}

.person-card {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  gap: 0.5rem 0.75rem;
  padding: 1.1rem 1rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  color: inherit;
  text-decoration: none;
  min-height: 88px;
  align-items: center;
}

.person-card:hover,
.person-card:focus-visible {
  border-color: #93c5fd;
  background: #eff6ff;
  text-decoration: none;
}

.person-card-name {
  grid-column: 1;
  margin: 0;
  font-size: 1.25rem;
  color: #1e3a5f;
}

.person-card-stats {
  grid-column: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.person-stat-label {
  display: block;
  font-size: 0.8rem;
  color: #64748b;
  margin-bottom: 0.15rem;
}

.person-stat strong {
  font-size: 1.15rem;
  color: #0f172a;
}

.person-card-arrow {
  grid-column: 2;
  grid-row: 1 / span 2;
  font-size: 1.75rem;
  color: #94a3b8;
  align-self: center;
}

.drill-list {
  display: grid;
  gap: 0.65rem;
}

.drill-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 0.75rem;
  padding: 0.95rem 1rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  color: inherit;
  text-decoration: none;
  min-height: 56px;
  font-size: 1rem;
}

.drill-row:hover,
.drill-row:focus-visible {
  border-color: #93c5fd;
  background: #eff6ff;
  text-decoration: none;
}

.drill-row-inline {
  grid-template-columns: 1fr auto;
}

.drill-name {
  font-weight: 600;
}

.drill-amount {
  font-weight: 700;
  color: #1e3a5f;
  font-size: 1.05rem;
}

.drill-arrow {
  color: #94a3b8;
  font-size: 1.35rem;
  line-height: 1;
}

.period-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin: 1rem 0 0.75rem;
}

.period-tab {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 0.5rem;
  min-height: 48px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #fff;
  color: #334155;
  font-weight: 600;
  font-size: 0.9rem;
  text-align: center;
  text-decoration: none;
}

.period-tab.active {
  background: #1e40af;
  border-color: #1e40af;
  color: #fff;
}

.period-tab:hover:not(.active) {
  border-color: #93c5fd;
  text-decoration: none;
}

.period-totals-block + .period-totals-block {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid #e2e8f0;
}

.pending-note {
  margin: 0.35rem 0 0;
}

.panel-muted {
  background: #f8fafc;
}

.payment-drill-list {
  display: grid;
  gap: 0.65rem;
}

.payment-drill-card {
  display: grid;
  gap: 0.25rem;
  padding: 0.95rem 1rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  color: inherit;
  text-decoration: none;
}

.payment-drill-card:hover {
  border-color: #93c5fd;
  text-decoration: none;
}

.payment-drill-date {
  font-weight: 600;
  color: #334155;
}

.payment-drill-amount {
  font-size: 1.25rem;
  font-weight: 800;
  color: #1e3a5f;
}

.payment-drill-meta {
  color: #64748b;
  font-size: 0.9rem;
  text-transform: capitalize;
}

/* Sprint 8 — personal home dashboard */
.home-greeting {
  margin: 0 0 0.85rem;
  font-size: 1.15rem;
  font-weight: 600;
  color: #1e3a5f;
}

.panel-my-money {
  border-color: #bfdbfe;
  background: #f8fbff;
}

.my-money-title {
  margin: 0 0 0.75rem;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #64748b;
}

.my-money-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.my-money-stat {
  display: grid;
  gap: 0.25rem;
}

.my-money-label {
  font-size: 0.85rem;
  color: #64748b;
}

.my-money-value {
  font-size: 1.35rem;
  color: #1e3a5f;
}

.home-caught-up {
  margin: 0 0 1rem;
  padding: 0.65rem 0.85rem;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  color: #166534;
  font-size: 0.9rem;
  text-align: center;
}

.panel-home-section h2 {
  font-size: 1rem;
  margin-bottom: 0.65rem;
}

.home-action-list,
.home-payment-list,
.home-update-list {
  display: grid;
  gap: 0.75rem;
}

.home-action-card {
  background: #fff;
  border: 1px solid #fde68a;
  border-radius: 10px;
  padding: 0.85rem;
}

.home-action-message {
  margin: 0 0 0.35rem;
  font-weight: 600;
  font-size: 0.95rem;
}

.home-action-amount {
  margin: 0 0 0.2rem;
  font-size: 1.35rem;
  font-weight: 800;
  color: #1e3a5f;
}

.home-action-date {
  margin: 0 0 0.75rem;
  color: #64748b;
  font-size: 0.85rem;
}

.home-payment-row,
.home-update-row {
  display: block;
  padding: 0.75rem 0.85rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  color: inherit;
  text-decoration: none;
}

.home-payment-row:hover,
.home-update-row:hover {
  border-color: #93c5fd;
  text-decoration: none;
}

.home-payment-main {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
}

.home-payment-route {
  font-weight: 600;
  font-size: 0.95rem;
}

.home-payment-amount {
  font-weight: 700;
  color: #1e3a5f;
  white-space: nowrap;
}

.home-payment-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.home-payment-date {
  font-size: 0.8rem;
  color: #64748b;
}

.home-status {
  font-size: 0.8rem;
  font-weight: 600;
}

.home-status-ok {
  color: #15803d;
}

.home-status-pending {
  color: #a16207;
}

.home-status-attention {
  color: #c2410c;
}

.home-fyi-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: #64748b;
}

.view-family-wrap {
  margin: 0.5rem 0 0;
  text-align: center;
}

.view-family-link {
  display: inline-block;
  padding: 0.65rem 1rem;
  font-weight: 600;
  color: #1e40af;
}

.payment-manage-actions {
  display: grid;
  gap: 0.65rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #e2e8f0;
}

.delete-summary {
  margin: 0.75rem 0;
}

.delete-summary-line {
  margin: 0 0 0.35rem;
  font-weight: 600;
}

.delete-summary-amount {
  margin: 0 0 0.2rem;
  font-size: 1.35rem;
  font-weight: 800;
  color: #1e3a5f;
}

.delete-summary-date {
  margin: 0;
  color: #64748b;
  font-size: 0.9rem;
}

.panel-dads-money {
  display: block;
  position: relative;
  border-color: #93c5fd;
  background: linear-gradient(180deg, #eff6ff 0%, #fff 100%);
  color: inherit;
  text-decoration: none;
  margin-bottom: 1rem;
}

.panel-dads-money:hover {
  border-color: #3b82f6;
  text-decoration: none;
}

.dads-money-title {
  margin: 0 0 0.35rem;
  font-size: 1rem;
  font-weight: 800;
  color: #1e3a5f;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.dads-money-subtitle {
  margin: 0 0 0.25rem;
  color: #64748b;
  font-size: 0.9rem;
}

.dads-money-hero {
  margin: 0 0 0.85rem;
  font-size: 1.75rem;
  font-weight: 800;
  color: #1e3a5f;
}

.dads-money-periods {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}

.dads-money-period {
  background: #fff;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  padding: 0.55rem 0.65rem;
}

.dads-money-period-label {
  display: block;
  font-size: 0.75rem;
  color: #64748b;
  margin-bottom: 0.15rem;
}

.dads-money-period strong {
  font-size: 0.95rem;
  color: #0f172a;
}

.dads-money-pending {
  margin: 0.75rem 0 0;
}

.dads-money-arrow {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.5rem;
  color: #94a3b8;
}

.my-money-link {
  color: #1e40af;
  text-decoration: none;
  font-size: 1.35rem;
}

.my-money-link:hover {
  text-decoration: underline;
}

.panel-dads-money-detail {
  border-color: #93c5fd;
}

/* Sprint 9 — final UI polish */

.app-main {
  max-width: 480px;
  padding: 1.25rem 1rem 1.75rem;
}

.main-nav a {
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.5rem 0.15rem;
  font-size: 0.72rem;
  line-height: 1.2;
}

.nav-icon {
  font-size: 1.1rem;
  line-height: 1;
}

.section-heading {
  margin: 0 0 1rem;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #64748b;
}

.home-section {
  margin-bottom: 1.25rem;
}

.home-section .section-heading {
  margin-bottom: 0.75rem;
}

.my-money-cards {
  display: grid;
  gap: 0.85rem;
}

.my-money-card {
  display: grid;
  gap: 0.35rem;
  padding: 1.15rem 1.2rem;
  background: #fff;
  border: 2px solid #e2e8f0;
  border-radius: 16px;
  color: inherit;
  text-decoration: none;
  min-height: 120px;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.1s;
}

.my-money-card:hover,
.my-money-card:focus-visible {
  border-color: #3b82f6;
  box-shadow: 0 4px 14px rgba(30, 64, 175, 0.12);
  text-decoration: none;
}

.my-money-card:active {
  transform: scale(0.99);
}

.my-money-card-received {
  border-color: #bfdbfe;
  background: linear-gradient(180deg, #f8fbff 0%, #fff 100%);
}

.my-money-card-paid {
  border-color: #e2e8f0;
  background: #fff;
}

.my-money-card-label {
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #64748b;
}

.my-money-card-amount {
  font-size: 1.75rem;
  font-weight: 800;
  color: #1e3a5f;
  line-height: 1.1;
}

.my-money-card-cta {
  font-size: 0.95rem;
  font-weight: 600;
  color: #1e40af;
  margin-top: 0.25rem;
}

.dads-money-card {
  display: block;
  padding: 1.25rem 1.2rem;
  margin-bottom: 1.25rem;
  background: linear-gradient(180deg, #eff6ff 0%, #fff 100%);
  border: 2px solid #93c5fd;
  border-radius: 16px;
  color: inherit;
  text-decoration: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.dads-money-card:hover,
.dads-money-card:focus-visible {
  border-color: #3b82f6;
  box-shadow: 0 4px 14px rgba(30, 64, 175, 0.15);
  text-decoration: none;
}

.dads-money-cta {
  display: block;
  margin-top: 0.85rem;
  font-weight: 600;
  color: #1e40af;
  font-size: 0.95rem;
}

.panel-spacious {
  padding: 1.25rem;
  margin-bottom: 1rem;
}

.panel-secondary {
  opacity: 0.95;
}

.page-head {
  margin-bottom: 1rem;
}

.back-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.35rem 0;
  font-weight: 600;
  color: #1e40af;
  text-decoration: none;
}

.back-link:hover {
  text-decoration: underline;
}

.page-title {
  margin: 0.15rem 0 0;
  font-size: 1.35rem;
  font-weight: 800;
  color: #1e3a5f;
  line-height: 1.25;
}

.segmented-control {
  display: flex;
  background: #e2e8f0;
  border-radius: 12px;
  padding: 4px;
  gap: 4px;
  margin: 0 0 1rem;
}

.segmented-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.5rem 0.35rem;
  border-radius: 9px;
  background: transparent;
  border: none;
  color: #475569;
  font-weight: 700;
  font-size: 0.82rem;
  text-align: center;
  text-decoration: none;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}

.segmented-tab.active {
  background: #fff;
  color: #1e40af;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.12);
}

.segmented-tab:hover:not(.active) {
  color: #1e40af;
  text-decoration: none;
}

.drill-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.1rem;
  min-height: 56px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  color: inherit;
  text-decoration: none;
  transition: border-color 0.15s, background 0.15s;
}

.drill-row:hover,
.drill-row:focus-visible {
  border-color: #93c5fd;
  background: #f8fbff;
  text-decoration: none;
}

.drill-amount {
  font-weight: 700;
  color: #1e40af;
  white-space: nowrap;
}

.empty-inline {
  margin: 0;
  padding: 1.25rem;
  text-align: center;
  color: #64748b;
  background: #f8fafc;
  border-radius: 12px;
}

.btn-confirm {
  background: #15803d;
  color: #fff;
  font-weight: 700;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  min-height: 52px;
  padding: 0.85rem 1rem;
  font: inherit;
  transition: background 0.15s, transform 0.1s;
}

.btn-confirm:hover {
  background: #166534;
}

.btn-confirm:active {
  transform: scale(0.98);
}

.btn-confirm:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-outline {
  background: #fff;
  border: 2px solid #cbd5e1;
}

.btn-outline:hover {
  border-color: #94a3b8;
  background: #f8fafc;
}

.btn-primary,
.btn-secondary,
.btn-danger,
.btn-confirm {
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}

.btn-primary:active,
.btn-secondary:active,
.btn-danger:active {
  transform: scale(0.98);
}

.payment-actions {
  display: grid;
  gap: 0.75rem;
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid #e2e8f0;
}

.payment-facts {
  margin: 0;
  display: grid;
  gap: 1rem;
}

.payment-fact {
  margin: 0;
}

.payment-fact dt {
  margin: 0 0 0.2rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #64748b;
}

.payment-fact dd {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: #0f172a;
}

.payment-fact-amount dd {
  font-size: 1.75rem;
  color: #1e3a5f;
}

.payment-note {
  margin: 1rem 0 0;
  padding-top: 1rem;
  border-top: 1px solid #e2e8f0;
}

.input-prefix-wrap {
  display: flex;
  align-items: center;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}

.input-prefix-wrap:focus-within {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

.input-prefix {
  padding: 0 0.75rem;
  color: #64748b;
  font-weight: 700;
  background: #f8fafc;
  align-self: stretch;
  display: flex;
  align-items: center;
  border-right: 1px solid #e2e8f0;
}

.input-prefix-wrap input {
  border: none;
  border-radius: 0;
  min-height: 48px;
}

.input-prefix-wrap input:focus-visible {
  outline: none;
}

.loading {
  text-align: center;
  padding: 2rem;
  color: #64748b;
}

@media (min-width: 768px) {
  .app-main {
    max-width: 520px;
    padding: 1.5rem 1.25rem 2rem;
  }

  .my-money-cards {
    grid-template-columns: 1fr 1fr;
  }
}
