:root {
  color-scheme: light;
  --ink: #1f2a37;
  --paper: #f4f7fb;
  --panel: #ffffff;
  --accent: #20639b;
  --accent-2: #3caea3;
  --ok: #2f855a;
  --warn: #b7791f;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at 10% 10%, #d6e6f2 0, transparent 45%),
    radial-gradient(circle at 85% 90%, #d2f0ea 0, transparent 40%),
    var(--paper);
  display: grid;
  place-items: center;
  padding: 1rem;
}

.app {
  width: min(100%, 520px);
}

.panel {
  background: var(--panel);
  border: 1px solid #dbe5ef;
  border-radius: 22px;
  padding: 1.4rem;
  box-shadow: 0 20px 40px rgba(23, 43, 77, 0.08);
  animation: rise 350ms ease-out;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #58748f;
  font-size: 0.75rem;
}

h1 {
  margin: 0.35rem 0 0.5rem;
}

.summary {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
}

.inline-reminder {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  background: #fff5e8;
  border: 1px solid #f2c995;
  border-radius: 14px;
  padding: 0.75rem;
  margin-bottom: 0.85rem;
}

.inline-reminder-text {
  margin: 0;
  font-weight: 600;
  color: #8c5a00;
}

.inline-capture {
  border: 0;
  border-radius: 10px;
  background: #c2410c;
  color: #fff;
  font-weight: 700;
  padding: 0.55rem 0.75rem;
  cursor: pointer;
  white-space: nowrap;
}

.meter {
  height: 12px;
  border-radius: 999px;
  background: #ebf0f7;
  margin-top: 0.9rem;
  overflow: hidden;
}

.meter-fill {
  height: 100%;
  width: 0;
  transition: width 300ms ease;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.muted {
  margin-top: 0.5rem;
  color: #5f7082;
}

.primary {
  margin-top: 1.15rem;
  width: 100%;
  border: 0;
  border-radius: 14px;
  padding: 0.9rem 1rem;
  background: linear-gradient(120deg, var(--accent), #3b82c4);
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
}

.secondary {
  margin-top: 0.55rem;
  width: 100%;
  border: 1px solid #c9d8e9;
  border-radius: 14px;
  padding: 0.78rem 1rem;
  background: #f6f9fd;
  color: #325a80;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
}

.primary[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
}

.status {
  min-height: 1.3rem;
  margin-top: 0.8rem;
  font-weight: 600;
}

.days-panel {
  margin-top: 0.65rem;
  border: 1px solid #dbe7f3;
  border-radius: 12px;
  padding: 0.75rem;
  background: #f8fbff;
}

.days-panel-title {
  margin: 0;
  font-size: 0.92rem;
  color: #355c81;
  font-weight: 700;
}

.days-panel-count {
  margin: 0.3rem 0 0;
  color: #26425f;
  font-weight: 600;
}

.calendar {
  margin-top: 0.6rem;
}

.calendar-weekdays,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.3rem;
}

.calendar-weekdays span {
  text-align: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: #6a7f93;
}

.calendar-grid {
  margin-top: 0.35rem;
}

.calendar-cell {
  min-height: 2rem;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: 0.82rem;
  border: 1px solid #e3ecf5;
  background: #fff;
  color: #48617a;
}

.calendar-cell-empty {
  border-color: transparent;
  background: transparent;
}

.calendar-cell-marked {
  background: #dff5e7;
  border-color: #9dd4af;
  color: #1f6d46;
  font-weight: 700;
}

.calendar-cell-today {
  box-shadow: inset 0 0 0 2px #3b82c4;
}

.days-list {
  margin: 0.5rem 0 0;
  padding-left: 1rem;
}

.days-list li {
  margin: 0.22rem 0;
  color: #3f5870;
}

.post-capture-banner {
  margin-top: 0.7rem;
  padding: 0.75rem;
  border: 1px solid #b6dfc1;
  background: #edf9f0;
  border-radius: 12px;
}

.post-capture-text {
  margin: 0;
  color: #1f6d46;
  font-weight: 600;
}

.post-capture-actions {
  margin-top: 0.55rem;
  display: flex;
  gap: 0.5rem;
}

.post-capture-close,
.post-capture-dismiss {
  border: 0;
  border-radius: 10px;
  padding: 0.5rem 0.7rem;
  font-weight: 700;
  cursor: pointer;
}

.post-capture-close {
  background: #1f6d46;
  color: #fff;
}

.post-capture-dismiss {
  background: #d8eee0;
  color: #1f6d46;
}

.note {
  margin-top: 1rem;
  font-size: 0.88rem;
  color: #637487;
}

.update-banner {
  margin-top: 0.7rem;
  padding: 0.75rem;
  border: 1px solid #e0c97a;
  background: #fefae8;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.update-banner-text {
  margin: 0;
  color: #7a5c00;
  font-weight: 600;
  font-size: 0.93rem;
}

.update-btn {
  border: 0;
  border-radius: 10px;
  padding: 0.45rem 0.8rem;
  background: #7a5c00;
  color: #fff;
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  white-space: nowrap;
}

.clear-cache-link {
  background: none;
  border: none;
  padding: 0;
  color: #637487;
  font-size: 0.88rem;
  text-decoration: underline;
  cursor: pointer;
}

.clear-cache-link:hover {
  color: #16324f;
}

.notif-banner {
  margin-top: 0.7rem;
  padding: 0.75rem;
  border: 1px solid #b8d4f5;
  background: #edf4fd;
  border-radius: 12px;
}

.notif-banner-text {
  margin: 0;
  color: #174a7e;
  font-weight: 600;
  font-size: 0.93rem;
}

.notif-banner-actions {
  margin-top: 0.55rem;
  display: flex;
  gap: 0.5rem;
}

.notif-enable,
.notif-dismiss {
  border: 0;
  border-radius: 10px;
  padding: 0.5rem 0.7rem;
  font-weight: 700;
  cursor: pointer;
  font-size: 0.9rem;
}

.notif-enable {
  background: #174a7e;
  color: #fff;
}

.notif-dismiss {
  background: #d6e7fb;
  color: #174a7e;
}

.status-ok {
  color: var(--ok);
}

.status-warn {
  color: var(--warn);
}

@media (max-width: 480px) {
  .inline-reminder {
    flex-direction: column;
    align-items: stretch;
  }

  .post-capture-actions {
    flex-direction: column;
  }

  .panel {
    border-radius: 18px;
    padding: 1rem;
  }
}
