:root {
  color-scheme: light;
  --ink: #1f2523;
  --muted: #5d6762;
  --line: #d6ddd7;
  --paper: #fbfcf8;
  --surface: #ffffff;
  --leaf: #3f6f46;
  --leaf-dark: #244d30;
  --sky: #dceaf0;
  --soft: #eef3ec;
  --notice: #f7edd5;
  --notice-ink: #6b4a16;
  --check: #e7f0f7;
  --check-ink: #284b63;
  --work: #e9f3df;
  --work-ink: #31551f;
  --uncertain: #f9e4dc;
  --uncertain-ink: #743b24;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", "Yu Gothic UI", sans-serif;
  line-height: 1.7;
}

img {
  display: block;
  max-width: 100%;
}

.site-header,
.site-footer,
.intro-section,
.section-band {
  padding-inline: clamp(18px, 4vw, 56px);
}

.site-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  padding-block: 24px 18px;
  border-bottom: 1px solid var(--line);
}

h1,
h2,
h3,
p {
  letter-spacing: 0;
}

.site-header h1,
.intro-section h2,
.section-heading h2,
.day-header h2,
.station-panel h2 {
  margin: 0;
  line-height: 1.15;
}

.site-header h1 {
  font-size: clamp(2rem, 4vw, 3.35rem);
}

.header-note,
.eyebrow,
.source-boundary,
.photo-date,
.photo-note,
.plant-focus,
.site-footer,
.empty-note,
.day-title {
  color: var(--muted);
}

.eyebrow {
  margin: 0 0 8px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.intro-section {
  padding-block: clamp(22px, 3vw, 34px);
}

.intro-section h2,
.section-heading h2 {
  font-size: clamp(1.45rem, 2.4vw, 2rem);
}

.intro-section p {
  max-width: 68rem;
  font-size: 1.02rem;
}

.section-band {
  padding-block: 28px 38px;
}

.records-section {
  background: linear-gradient(#f6faf3, var(--paper) 220px);
}

.muted-band {
  background: var(--soft);
}

.section-heading {
  margin-bottom: 20px;
}

.day-records {
  display: grid;
  gap: 18px;
}

.day-record {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  overflow: hidden;
}

.day-header {
  display: grid;
  grid-template-columns: minmax(0, 0.7fr) minmax(280px, 1fr);
  gap: 18px;
  padding: 22px;
  background: #f7faf5;
  border-bottom: 1px solid var(--line);
}

.day-header h2 {
  font-size: clamp(1.75rem, 3.4vw, 2.55rem);
}

.day-title {
  margin: 8px 0 0;
  font-weight: 700;
}

.day-meta {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  gap: 8px 12px;
  margin: 0;
}

.day-meta dt {
  color: var(--leaf-dark);
  font-weight: 700;
}

.day-meta dd {
  margin: 0;
}

.record-section {
  padding: 20px 22px;
  border-bottom: 1px solid var(--line);
}

.record-section:last-child {
  border-bottom: 0;
}

.record-section h3,
.plant-row h3 {
  margin: 0;
  line-height: 1.25;
}

.record-section h3 {
  font-size: 1.05rem;
  color: var(--leaf-dark);
}

.latest-digest {
  margin-top: 26px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.latest-digest h3,
.digest-block h4,
.plant-card h3,
.photo-group h4 {
  margin: 0;
  line-height: 1.25;
}

.digest-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.digest-block {
  min-width: 0;
  padding: 14px;
  border: 1px solid rgba(31, 37, 35, 0.08);
  border-radius: 8px;
  background: #fbfdf9;
}

.digest-block h4 {
  color: var(--leaf-dark);
  font-size: 0.95rem;
}

.plant-overview {
  background: #f1f6ed;
  border-block: 1px solid var(--line);
}

.plant-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.plant-link,
.chip {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 26px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
}

.plant-link {
  padding: 7px 11px;
  border: 1px solid rgba(36, 77, 48, 0.22);
  color: var(--leaf-dark);
  background: #fff;
}

.plant-history-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.plant-card {
  min-width: 0;
  padding: 16px;
  border: 1px solid rgba(31, 37, 35, 0.1);
  border-radius: 8px;
  background: #fff;
}

.ongoing-topics {
  background: #f8f5ee;
  border-bottom: 1px solid var(--line);
}

.topic-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.topic-card {
  min-width: 0;
  padding: 16px;
  border: 1px solid rgba(31, 37, 35, 0.1);
  border-radius: 8px;
  background: #fff;
}

.topic-title {
  color: var(--leaf-dark);
  font-size: 1.08rem;
  font-weight: 800;
  line-height: 1.3;
}

.plant-card-date,
.plant-card-note,
.photo-description {
  color: var(--muted);
}

.plant-card-date {
  margin: 6px 0 0;
  font-size: 0.86rem;
}

.plant-card-note {
  margin: 10px 0 0;
  font-size: 0.92rem;
}

.plant-card-photos {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.plant-card-photos .photo-tile figcaption {
  display: none;
}

.priority-section {
  background: var(--notice);
  color: var(--notice-ink);
}

.priority-section h3 {
  color: var(--notice-ink);
}

.weather-section {
  background: #f5f8fb;
}

.weather-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin: 12px 0 0;
}

.section-title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.weather-item {
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid rgba(31, 37, 35, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.58);
}

.weather-grid dt {
  color: var(--leaf-dark);
  font-size: 0.82rem;
  font-weight: 700;
}

.weather-grid dd {
  margin: 2px 0 0;
  font-size: 0.92rem;
  line-height: 1.55;
}

.weather-note {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

ul,
ol {
  margin: 8px 0 0;
  padding-left: 1.15em;
}

li + li {
  margin-top: 6px;
}

.empty-note {
  margin: 8px 0 0;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 12px;
}

.photo-tile {
  margin: 0;
  overflow: hidden;
  border-radius: 8px;
  background: #fff;
  border: 1px solid rgba(31, 37, 35, 0.08);
}

.photo-open-button {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  cursor: zoom-in;
}

.photo-open-button:focus-visible {
  outline: 3px solid rgba(63, 111, 70, 0.55);
  outline-offset: -3px;
}

.photo-tile img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.temporary-photo img {
  aspect-ratio: 4 / 3;
}

.photo-tile figcaption {
  display: grid;
  gap: 5px;
  padding: 10px 12px 12px;
}

.photo-date,
.photo-note,
.photo-description {
  font-size: 0.78rem;
}

.chip {
  padding: 5px 9px;
  border: 1px solid rgba(31, 37, 35, 0.08);
  color: var(--leaf-dark);
  background: #eef6e8;
}

.chip-uncertain {
  color: var(--uncertain-ink);
  background: var(--uncertain);
}

.chip-check {
  color: var(--check-ink);
  background: var(--check);
}

.chip-work {
  color: var(--work-ink);
  background: var(--work);
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.photo-group {
  padding-top: 16px;
}

.photo-group + .photo-group {
  margin-top: 18px;
  border-top: 1px solid var(--line);
}

.more-photos {
  margin-top: 12px;
}

.more-photos summary,
.collapsed-day-summary {
  cursor: pointer;
}

.more-photos summary {
  color: var(--leaf-dark);
  font-weight: 700;
}

.record-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.fact-block {
  min-width: 0;
  padding: 14px 16px;
  border: 1px solid rgba(31, 37, 35, 0.08);
  border-radius: 8px;
  background: #fbfdf9;
}

.fact-block h3 {
  font-size: 0.95rem;
}

.fact-uncertain {
  background: #fff8f5;
}

.fact-check {
  background: #f7fbfd;
}

.fact-work {
  background: #f7fbf2;
}

.day-collapsible {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  overflow: hidden;
}

.collapsed-day-summary {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 15px 18px;
  list-style: none;
  background: #f7faf5;
}

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

.collapsed-day-summary::after {
  content: "開く";
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.day-collapsible[open] .collapsed-day-summary::after {
  content: "閉じる";
}

.collapsed-date {
  color: var(--leaf-dark);
  font-weight: 800;
}

.collapsed-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.day-collapsible .day-record {
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
}

.lightbox-open {
  overflow: hidden;
}

.photo-lightbox {
  width: min(94vw, 1120px);
  max-height: 92vh;
  padding: 0;
  border: 0;
  border-radius: 8px;
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 24px 80px rgba(12, 18, 16, 0.32);
  overflow: hidden;
}

.photo-lightbox::backdrop {
  background: rgba(18, 24, 22, 0.7);
}

.photo-lightbox[open],
.photo-lightbox.is-open {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.photo-lightbox-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.photo-lightbox-header h2 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.3;
}

.photo-lightbox-close {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(31, 37, 35, 0.14);
  border-radius: 999px;
  color: var(--ink);
  background: #fff;
  cursor: pointer;
  font-size: 1.4rem;
  line-height: 1;
}

.photo-lightbox-image {
  width: 100%;
  max-height: calc(92vh - 132px);
  background: #111614;
  object-fit: contain;
}

.photo-lightbox-caption {
  padding: 12px 16px 16px;
  border-top: 1px solid var(--line);
  background: #fbfdf9;
}

.photo-lightbox-caption p {
  margin: 0;
}

.photo-lightbox-description {
  margin-top: 4px;
}

.photo-lightbox-meta,
.photo-lightbox-description {
  color: var(--muted);
  font-size: 0.9rem;
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  justify-content: space-between;
  padding-block: 22px 28px;
  border-top: 1px solid var(--line);
  font-size: 0.9rem;
}

.site-footer p {
  margin: 0;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92em;
}

@media (max-width: 980px) {
  .day-header {
    grid-template-columns: 1fr;
  }

  .digest-grid,
  .plant-history-grid,
  .topic-grid,
  .photo-grid,
  .weather-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .collapsed-day-summary {
    grid-template-columns: 1fr;
  }

  .collapsed-tags {
    justify-content: flex-start;
  }
}

@media (max-width: 640px) {
  .site-header {
    align-items: start;
    flex-direction: column;
  }

  .digest-grid,
  .plant-history-grid,
  .topic-grid,
  .photo-grid,
  .record-grid,
  .weather-grid {
    grid-template-columns: 1fr;
  }

  .day-meta {
    grid-template-columns: 1fr;
    gap: 2px;
  }

}
