:root {
  --bg: #0f1115;
  --card: #1a1d24;
  --card-hover: #20242d;
  --accent: #4ade80;
  --accent-dim: #166534;
  --text: #e8eaed;
  --muted: #9aa0aa;
  --danger: #f87171;
  --radius: 14px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  padding: 24px 16px 60px;
}

main {
  width: 100%;
  max-width: 480px;
}

header {
  text-align: center;
  margin-bottom: 24px;
}

h1 {
  font-size: 1.9rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.date {
  color: var(--muted);
  margin-top: 4px;
  font-size: 0.95rem;
  text-transform: capitalize;
}

/* Progress bar */
.progress {
  position: relative;
  background: var(--card);
  border-radius: var(--radius);
  height: 38px;
  margin-bottom: 22px;
  overflow: hidden;
}

.progress-bar {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, var(--accent-dim), var(--accent));
  transition: width 0.35s ease;
}

.progress-label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 600;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* Medication list */
.med-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
}

.med {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--card);
  border-radius: var(--radius);
  padding: 14px 16px;
  transition: background 0.2s ease, opacity 0.2s ease;
}

.med:hover { background: var(--card-hover); }

.med.taken { opacity: 0.62; }
.med.taken .med-name { text-decoration: line-through; }

.toggle-form, .delete-form { display: flex; }

.check {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 2px solid var(--muted);
  background: transparent;
  color: #0f1115;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.18s ease;
}

.med.taken .check {
  background: var(--accent);
  border-color: var(--accent);
}

.check:hover { border-color: var(--accent); }

.med-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.med-name {
  font-weight: 600;
  font-size: 1.05rem;
  word-break: break-word;
}

.med-dose, .med-time {
  font-size: 0.82rem;
  color: var(--muted);
}

.med-time { color: var(--accent); }

.delete {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  border-radius: 6px;
  transition: color 0.18s ease;
}

.delete:hover { color: var(--danger); }

.empty {
  text-align: center;
  color: var(--muted);
  padding: 28px 0;
  background: var(--card);
  border-radius: var(--radius);
}

/* Add form */
.add-form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  background: var(--card);
  padding: 14px;
  border-radius: var(--radius);
}

.add-form input {
  flex: 1;
  min-width: 140px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid #2a2e38;
  background: var(--bg);
  color: var(--text);
  font-size: 0.95rem;
}

.add-form input:focus {
  outline: none;
  border-color: var(--accent);
}

.add-form button {
  padding: 12px 22px;
  border: none;
  border-radius: 10px;
  background: var(--accent);
  color: #0f1115;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: filter 0.18s ease;
  width: 100%;
}

.add-form button:hover { filter: brightness(1.08); }
