:root {
  color-scheme: light;
  --bg: #f4f0e8;
  --panel: #fffdf8;
  --ink: #1f2620;
  --muted: #5b665f;
  --line: #d7cec0;
  --accent: #2f6c5a;
  --accent-soft: #dcece7;
  --warn: #8f5b00;
  --warn-soft: #fff1cc;
  --error: #9e2f2f;
  --error-soft: #fbe0de;
  --neutral: #5b665f;
  --neutral-soft: #ece8df;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Hiragino Sans", "Yu Gothic", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top, rgba(47, 108, 90, 0.14), transparent 32%),
    linear-gradient(180deg, #fbf7ef 0%, var(--bg) 100%);
}

code,
pre {
  font-family: "SFMono-Regular", "Menlo", monospace;
}

.page {
  width: min(1080px, calc(100% - 32px));
  margin: 0 auto;
  padding: 40px 0 64px;
}

.hero {
  margin-bottom: 20px;
}

h1,
h2 {
  margin: 0;
  font-weight: 700;
}

h1 {
  font-size: clamp(2rem, 4vw, 3.5rem);
  line-height: 1.05;
}

h2 {
  font-size: 1.1rem;
}

.lede,
.subtle {
  color: var(--muted);
}

.lede {
  max-width: 68ch;
  margin: 12px 0 0;
  line-height: 1.6;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--panel);
  box-shadow: 0 12px 40px rgba(35, 40, 36, 0.06);
}

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

.panel {
  padding: 20px;
}

.status-panel {
  margin-bottom: 20px;
}

.status-panel[data-state="ready"] {
  border-color: #cfe0d7;
}

.status-panel[data-state="delayed"],
.status-panel[data-state="out_of_hours"] {
  border-color: var(--line);
  background: #faf6ee;
}

.status-panel[data-state="stalled"] {
  border-color: #e2c4a9;
  background: #fdf4ec;
}

.status-panel[data-state="json_fetch_failed"] {
  border-color: #e5b9b6;
  background: #fff5f4;
}

.status-panel[data-state="image_fetch_failed"] {
  border-color: #ecd6a7;
  background: #fff9ed;
}

.status-panel[data-state="loading"] {
  border-color: #cfe0d7;
  background: #f5fbf8;
}

.state-message {
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.panel-heading {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  margin-bottom: 16px;
}

.subtle {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.5;
  word-break: break-all;
}

.fields {
  display: grid;
  gap: 14px;
  margin: 16px 0 0;
}

.fields div {
  padding-bottom: 12px;
  border-bottom: 1px solid #ece4d8;
}

.fields div:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

dt {
  color: var(--muted);
  font-size: 0.9rem;
}

dd {
  margin: 6px 0 0;
  font-size: 1.15rem;
  font-weight: 700;
}

.image-frame {
  margin: 0;
}

.image-frame img {
  display: block;
  width: min(100%, 280px);
  height: auto;
  border-radius: 14px;
  border: 1px solid #ddd1bf;
  background: #f6efe4;
}

.image-frame figcaption {
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.92rem;
}

pre {
  margin: 0;
  padding: 16px;
  border-radius: 14px;
  background: #f1ece2;
  overflow-x: auto;
  line-height: 1.5;
}

.disclaimer {
  margin-top: 28px;
  padding: 20px 4px 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.76rem;
}

.disclaimer h2 {
  margin-bottom: 8px;
  font-size: 0.82rem;
}

.disclaimer p {
  margin: 0 0 6px;
  line-height: 1.55;
}

.disclaimer a,
.legal-panel a {
  color: var(--accent);
  text-decoration: none;
}

.disclaimer a:hover,
.legal-panel a:hover {
  text-decoration: underline;
}

.legal-panel {
  margin-top: 8px;
}

.legal-stack {
  display: grid;
  gap: 12px;
  color: var(--muted);
  line-height: 1.8;
}

.legal-stack p {
  margin: 0;
}

@media (max-width: 800px) {
  .page {
    width: min(100% - 20px, 1080px);
    padding-top: 20px;
  }

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

  .panel-heading {
    flex-direction: column;
    align-items: flex-start;
  }
}
