:root {
  color-scheme: light;
  --ink: #121212;
  --muted: #666;
  --line: #d9d9d9;
  --paper: #fff;
  --canvas: #f3f3f1;
  --accent: #c8102e;
  --success: #147a4b;
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
}

code,
pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 28px clamp(20px, 5vw, 72px);
  color: white;
  background: var(--ink);
}

.eyebrow {
  margin: 0 0 6px;
  color: #bbb;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0;
  font-size: clamp(24px, 4vw, 42px);
  letter-spacing: -0.03em;
}

h2 {
  margin-bottom: 18px;
  font-size: 20px;
}

h3 {
  margin-bottom: 8px;
  font-size: 15px;
}

.test-label {
  flex: 0 0 auto;
  padding: 8px 10px;
  border: 1px solid #777;
  border-radius: 999px;
  color: #ddd;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
}

main {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 42px 0 64px;
}

.intro {
  max-width: 820px;
  margin-bottom: 28px;
  font-size: 17px;
  line-height: 1.8;
}

.intro code,
.explanation code {
  padding: 2px 5px;
  border-radius: 4px;
  background: #e7e7e3;
  font-size: 0.9em;
}

.note {
  color: var(--muted);
  font-size: 14px;
}

.panel {
  margin-top: 20px;
  padding: clamp(20px, 4vw, 32px);
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.status-badge {
  flex: 0 0 auto;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.status-badge.is-loading {
  color: #6a5500;
  background: #fff0ac;
}

.status-badge.is-ready {
  color: #fff;
  background: var(--success);
}

.status-badge.is-error {
  color: #fff;
  background: var(--accent);
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin: 0 0 24px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--line);
}

.status-grid > div {
  min-width: 0;
  padding: 14px;
  background: white;
}

dt {
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 14px;
}

.code-output {
  min-height: 120px;
  margin: 0;
  padding: 16px;
  overflow-x: auto;
  border-radius: 6px;
  color: #eee;
  background: #1c1c1c;
  font-size: 13px;
  line-height: 1.6;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 18px;
  margin-top: 18px;
}

button,
.actions a {
  border: 0;
  color: white;
  background: var(--ink);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

button {
  padding: 11px 16px;
  border-radius: 5px;
}

.actions a {
  color: var(--ink);
  background: transparent;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.ad-note {
  color: var(--muted);
  font-size: 12px;
}

.ad-slot {
  display: grid;
  min-height: 250px;
  place-items: center;
  overflow: hidden;
  border: 1px dashed #aaa;
  color: var(--muted);
  background: #fafafa;
  font-size: 13px;
  text-align: center;
}

.sp-ad-test {
  display: none;
}

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

.change-grid article {
  padding-left: 16px;
  border-left: 3px solid var(--accent);
}

.change-grid p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

footer {
  padding: 24px;
  color: #888;
  background: var(--ink);
  font-size: 12px;
  text-align: center;
}

footer p {
  margin: 0;
}

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

  .status-grid,
  .change-grid {
    grid-template-columns: 1fr;
  }

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

  .ad-slot {
    min-height: 180px;
  }
}

@media (max-width: 1159px) {
  .pc-ad-test {
    display: none;
  }

  .sp-ad-test {
    display: block;
  }
}
