:root {
  color-scheme: light;
  --bg: #f4f7f8;
  --surface: #ffffff;
  --ink: #1a2428;
  --muted: #66757b;
  --line: #d7e0e4;
  --accent: #0d5c7d;
  --accent-dark: #084861;
  --accent-soft: #d7edf5;
  --warn: #c26a1d;
  --warn-soft: #fbedd8;
  --danger: #b24e3f;
  --danger-soft: #f8e3df;
  --ok: #1a8b63;
  --ok-soft: #d8f1e7;
  --shadow: 0 16px 34px rgba(26, 44, 50, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(13, 92, 125, 0.09), transparent 26%),
    linear-gradient(180deg, #fbfdfd 0%, var(--bg) 100%);
  color: var(--ink);
  font-family: "Avenir Next", "Hiragino Sans", "Yu Gothic", sans-serif;
  line-height: 1.5;
}

button,
input,
a {
  font: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  background: rgba(251, 253, 253, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

.eyebrow {
  margin: 0 0 3px;
  color: var(--accent-dark);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 1.42rem;
  line-height: 1.15;
}

main {
  width: min(860px, 100%);
  margin: 0 auto;
  padding: 16px 14px 38px;
}

.hero-panel,
.calendar-panel,
.schedule-panel,
.shopping-panel,
.quality-panel,
.log-panel {
  margin-bottom: 14px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
}

.hero-panel {
  display: grid;
  gap: 14px;
  background:
    linear-gradient(135deg, rgba(13, 92, 125, 0.08), rgba(215, 237, 245, 0.6)),
    var(--surface);
}

.hero-panel h2 {
  margin-bottom: 6px;
  font-size: 1.55rem;
}

.hero-panel p {
  margin-bottom: 0;
  color: var(--muted);
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.badge,
.pill {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: 0.8rem;
  font-weight: 900;
}

.badge.warning {
  background: var(--warn-soft);
  color: var(--warn);
}

.small-button {
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  font-weight: 900;
}

.small-button.danger {
  color: var(--danger);
}

.section-heading,
.calendar-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.section-heading h2 {
  margin-bottom: 0;
  font-size: 1.2rem;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin-top: 12px;
}

.day-name,
.calendar-day {
  min-height: 72px;
  padding: 8px;
  border-radius: 8px;
  background: #fbfcfb;
  border: 1px solid var(--line);
}

.day-name {
  min-height: 42px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
}

.calendar-day.other {
  opacity: 0.45;
}

.calendar-day.today {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.calendar-day strong {
  display: block;
  font-size: 0.85rem;
}

.day-count {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.day-count.warn {
  color: var(--warn);
}

.due-list,
.schedule-list,
.shopping-grid,
.quality-grid,
.log-form,
.log-history {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.due-card,
.schedule-card,
.log-card {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.due-card.warn,
.schedule-card.warn {
  border-color: #efcc9b;
  background: #fff8ec;
}

.schedule-top,
.log-top {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 8px;
}

.schedule-meta,
.log-meta {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
}

.schedule-card label,
.shopping-grid label,
.quality-grid label,
.log-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.schedule-card input,
.shopping-grid input,
.quality-grid input,
.log-form input {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
  color: var(--ink);
}

.shopping-grid,
.quality-grid {
  grid-template-columns: 1fr 1fr;
}

.shopping-links {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}

.link-card {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-weight: 900;
  text-decoration: none;
}

.helper-text {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.quality-alert {
  margin-top: 12px;
  padding: 12px;
  border-radius: 8px;
  font-weight: 900;
}

.quality-alert.ok {
  background: var(--ok-soft);
  color: var(--ok);
}

.quality-alert.warn {
  background: var(--warn-soft);
  color: var(--warn);
}

.quality-alert.danger {
  background: var(--danger-soft);
  color: var(--danger);
}

.log-form {
  grid-template-columns: 1fr 1fr;
}

.log-form .wide {
  grid-column: 1 / -1;
}

.photo-input input {
  padding: 8px 0;
  border: none;
  background: transparent;
}

.photo-preview-shell {
  display: grid;
  place-items: center;
  min-height: 160px;
  margin-top: 12px;
  padding: 10px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.photo-preview-shell img {
  width: 100%;
  max-height: 340px;
  object-fit: contain;
  border-radius: 8px;
}

.log-card img {
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  border-radius: 8px;
}

.empty {
  margin-bottom: 0;
  padding: 18px 0;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 680px) {
  .calendar-grid {
    gap: 4px;
  }

  .day-name,
  .calendar-day {
    min-height: 64px;
    padding: 6px;
  }

  .shopping-grid,
  .quality-grid,
  .shopping-links,
  .log-form {
    grid-template-columns: 1fr;
  }
}
