:root {
  color-scheme: light;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

body {
  margin: 0;
  background: #f6f7fb;
  color: #131624;
}

main {
  max-width: 840px;
  margin: 0 auto;
  padding: 24px;
}

.panel {
  background: #fff;
  border-radius: 12px;
  padding: 18px;
  box-shadow: 0 6px 20px rgba(19, 22, 36, 0.08);
}

form {
  display: grid;
  gap: 12px;
}

input, button, textarea, select {
  font: inherit;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #d4d9e8;
}

button {
  cursor: pointer;
  background: #304fff;
  color: #fff;
  border: none;
}

.badges {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.badge {
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  background: #ecf0ff;
  color: #304fff;
}

.badge.warn {
  background: #fff0d9;
  color: #9c5a00;
}

.badge.good {
  background: #ddf9e5;
  color: #0a6b2f;
}

.nav {
  margin-bottom: 16px;
  display: flex;
  gap: 10px;
}

.nav a {
  color: #304fff;
  text-decoration: none;
}

.small {
  color: #667;
  font-size: 14px;
}

.error {
  color: #a10026;
  margin-top: 6px;
}

textarea {
  min-height: 84px;
  resize: vertical;
}

label {
  display: grid;
  gap: 6px;
}

.nav-buttons {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.stepper {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 10px 0 14px;
}

.stepper-progress {
  height: 8px;
  border-radius: 999px;
  background: #e7ebf8;
  overflow: hidden;
}

.stepper-progress-value {
  height: 100%;
  background: linear-gradient(90deg, #304fff, #6e85ff);
}

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

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

.step-chip {
  border-radius: 999px;
  background: #edf1ff;
  color: #304fff;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 700;
}

.step-chip.active {
  background: #304fff;
  color: #fff;
}

.today-step-actions {
  position: sticky;
  bottom: 0;
  background: #ffffffee;
  backdrop-filter: blur(4px);
  border-top: 1px solid #dce2f3;
  margin: 18px -18px -18px;
  padding: 12px 18px;
  z-index: 5;
}

.today-step-actions .nav-buttons {
  margin: 0;
}

.today-step-actions button {
  min-height: 44px;
}

.entry-card {
  margin-bottom: 12px;
  display: grid;
  gap: 10px;
}

.entry-card-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.1;
}

.chip-date {
  background: #ecf0ff;
  color: #2135b0;
}

.chip-status {
  background: #f0f3ff;
  color: #304fff;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
}

.calendar-card {
  text-decoration: none;
  color: inherit;
  display: grid;
  gap: 8px;
}

.calendar-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.collapsible {
  border: 1px solid #e1e6f5;
  border-radius: 10px;
  margin-top: 8px;
}

.collapsible summary {
  cursor: pointer;
  list-style: none;
  padding: 12px 14px;
  font-weight: 600;
}

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

.collapsible-content {
  padding: 0 14px 12px;
  display: grid;
  gap: 8px;
}

.account-mobile-sections {
  display: grid;
  gap: 10px;
}

.save-toast {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 14px;
  background: #1f2b56;
  color: #fff;
  padding: 10px 14px;
  border-radius: 10px;
  box-shadow: 0 10px 26px rgba(14, 18, 40, 0.28);
  max-width: min(92vw, 600px);
  z-index: 40;
  font-size: 14px;
}

@media (max-width: 768px) {
  main {
    padding: 14px;
  }

  .panel {
    border-radius: 10px;
    padding: 14px;
  }

  input, button, textarea, select {
    min-height: 46px;
    padding: 10px 12px;
  }

  .nav {
    flex-wrap: wrap;
    gap: 8px 14px;
  }

  .today-step-actions {
    margin: 14px -14px -14px;
    padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
  }

  .today-step-actions .nav-buttons {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .today-step-actions button {
    width: 100%;
  }

  .entry-card {
    gap: 12px;
  }

  .chip {
    font-size: 14px;
    padding: 8px 14px;
  }

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

  .calendar-card .chip {
    font-size: 14px;
    padding: 8px 12px;
  }

  .account-mobile-sections .collapsible {
    margin-top: 0;
  }
}
