:root {
  --sky: #bee3f8;
  --sun: #ffe08a;
  --berry: #8aa2ff;
  --grass: #9be7a0;
  --peanut: #c9a074;
  --ink: #1f2937;
  --card: #ffffff;
  --muted: #94a3b8;
  --radius: 16px;
  --btnRadius: 9999px;
  --shadow: 0 10px 20px rgba(0, 0, 0, 0.08);
  font-size: 18px;
}
* {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
}
body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial,
    "Apple Color Emoji", "Segoe UI Emoji";
  color: var(--ink);
  background: linear-gradient(180deg, var(--sky), #eaf6ff 40%, #fff);
  background-attachment: fixed;
}
.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 24px;
}
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.title {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: 0.5px;
}
.badge {
  font-size: 0.8rem;
  background: var(--berry);
  color: #fff;
  padding: 0.25rem 0.5rem;
  border-radius: 9999px;
}
.nav {
  margin: 12px 0 24px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.nav a {
  text-decoration: none;
  padding: 0.5rem 0.8rem;
  background: #fff;
  border-radius: 9999px;
  box-shadow: var(--shadow);
  color: var(--ink);
}
.hero {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 20px;
  align-items: center;
}
@media (max-width: 800px) {
  .hero {
    grid-template-columns: 1fr;
  }
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}
.buttons {
  display: grid;
  gap: 12px;
}
.buttons a,
.btn {
  display: inline-block;
  text-decoration: none;
  text-align: center;
  padding: 16px 20px;
  border-radius: var(--btnRadius);
  background: var(--sun);
  color: #222;
  font-weight: 700;
  box-shadow: var(--shadow);
  border: none;
  cursor: pointer;
}
.btn-secondary {
  background: var(--grass);
}
.btn-berry {
  background: var(--berry);
  color: #fff;
}
.btn-danger {
  background: #ef4444;
  color: #fff;
}
.btn-muted {
  background: #e5e7eb;
  color: #111;
}
.footer {
  margin-top: 28px;
  font-size: 0.9rem;
  color: #334155;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.footer button.linklike {
  background: none;
  border: none;
  padding: 0;
  color: #2563eb;
  cursor: pointer;
  text-decoration: underline;
}

.mascot-wrap {
  position: relative;
}
.mascot {
  width: 100%;
  max-width: 260px;
  margin-inline: auto;
  display: block;
  animation: floaty 4s ease-in-out infinite;
}
@keyframes floaty {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

.list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}
.item {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  background: #fff;
  padding: 12px;
  border-radius: 12px;
  box-shadow: var(--shadow);
}
.item .meta {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.badge-pill {
  padding: 0.2rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.8rem;
  background: #f1f5f9;
}
.badge-green {
  background: #dcfce7;
}
.badge-yellow {
  background: #fef9c3;
}
.badge-red {
  background: #fee2e2;
}
.actions {
  display: flex;
  gap: 8px;
}

.progress {
  width: 100%;
  height: 16px;
  background: #e2e8f0;
  border-radius: 9999px;
  overflow: hidden;
  position: relative;
}
.progress .bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--berry), var(--sun));
  transition: width 0.4s ease;
}

textarea {
  width: 100%;
  min-height: 120px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid #cbd5e1;
  font: inherit;
}
input[type="datetime-local"],
input[type="text"],
select {
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  font: inherit;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 50;
}
.modal {
  background: #fff;
  padding: 20px;
  border-radius: 16px;
  max-width: 420px;
  width: 100%;
  box-shadow: var(--shadow);
}
.modal-backdrop.show {
  display: flex;
}
.modal h3 {
  margin: 0 0 10px;
  font-size: 1.25rem;
}
.modal .row {
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 8px 0;
}
.small {
  font-size: 0.85rem;
  color: #475569;
}
.mt-12 {
  margin-top: 12px;
}
.mt-20 {
  margin-top: 20px;
}
.mt-30 {
  margin-top: 30px;
}
.mt-40 {
  margin-top: 40px;
}

.center {
  text-align: center;
}
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

/* tick marks under progress bar */
#doseMarks {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 0;
}
#doseMarks div {
  position: relative;
}
#doseMarks div::before {
  content: "";
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  height: 8px;
  background: #64748b;
  border-radius: 2px;
}

/* in-bar tick marks for perfect alignment */
.progress {
  position: relative;
}
.progress .ticks {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.progress .ticks span {
  position: absolute;
  top: 2px;
  bottom: 2px;
  width: 2px;
  background: #cbd5e1;
  border-radius: 2px;
}

/* label row aligned with tick positions */
.mark-labels {
  position: relative;
  height: 20px;
  margin-top: 6px;
}
.mark-labels span {
  position: absolute;
  transform: translateX(-50%);
  font-size: 0.85rem;
  color: #475569;
  white-space: nowrap;
}

/* fix label positioning */
.mark-labels {
  position: relative;
  height: 20px;
  margin-top: 6px;
}
.mark-labels span {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  font-size: 0.85rem;
  color: #475569;
  white-space: nowrap;
}
.mark-labels span.start {
  transform: none;
  left: 0 !important;
  text-align: left;
}
.mark-labels span.end {
  transform: translateX(-100%);
  text-align: right;
}

/* progress scale alignment */
.progress-wrap {
  position: relative;
}
.progress {
  position: relative;
  height: 16px;
  border-radius: 9999px;
  overflow: hidden;
}
.progress .bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--berry), var(--sun));
  transition: width 0.4s ease;
}
.progress .ticks {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.progress .ticks span {
  position: absolute;
  top: 2px;
  bottom: 2px;
  width: 2px;
  background: #cbd5e1;
  border-radius: 2px;
}

/* labels share the same wrapper width */
.marks {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  margin-top: 6px;
  height: 20px;
}
.marks span {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  font-size: 0.85rem;
  color: #475569;
  white-space: nowrap;
}
.marks span.start {
  transform: none;
  left: 0 !important;
  text-align: left;
}
.marks span.end {
  transform: translateX(-100%);
  text-align: right;
}
