:root {
  color-scheme: light;
  --bg: #f4f7f6;
  --surface: #ffffff;
  --ink: #15231f;
  --muted: #5d6d67;
  --line: #dbe5e1;
  --brand: #176b4d;
  --brand-dark: #0e4935;
  --accent: #dff4ea;
  --error: #9d2f2f;
  --warning: #8a5b00;
  --shadow: 0 14px 40px rgba(22, 61, 47, 0.09);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans JP", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top right, rgba(55, 154, 111, 0.13), transparent 32rem),
    var(--bg);
}

button, a { font: inherit; }

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

.hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--brand);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1 { margin: 0; font-size: clamp(2rem, 6vw, 3.7rem); line-height: 1.08; }
.lead { margin: 10px 0 0; color: var(--muted); font-size: 1.05rem; }

.badge {
  flex: 0 0 auto;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  box-shadow: var(--shadow);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
}
.badge-dev { color: #245fa6; background: #eaf3ff; border-color: #bfd6f2; }
.badge-staging { color: #7a4e00; background: #fff3d7; border-color: #ead198; }
.badge-demo { color: #753d86; background: #f7eafa; border-color: #dfc4e6; }
.badge-production { color: #0f6848; background: #e1f4eb; border-color: #b5dfcc; }
.badge-neutral { color: var(--muted); }

.notice {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 22px;
  padding: 16px 18px;
  border: 1px solid #bcdcca;
  border-radius: 16px;
  background: var(--accent);
  line-height: 1.65;
}
.notice strong { color: var(--brand-dark); white-space: nowrap; }

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

.card, .result {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.card { padding: 22px; }
.card h2, .result h2 { margin: 0 0 16px; font-size: 1.04rem; }
dl { margin: 0; }
dl div { padding: 12px 0; border-top: 1px solid var(--line); }
dl div:first-child { padding-top: 0; border-top: 0; }
dt { margin-bottom: 5px; color: var(--muted); font-size: 0.78rem; font-weight: 700; }
dd { margin: 0; overflow-wrap: anywhere; font-size: 0.92rem; font-weight: 700; }

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 22px 0;
}

button, .secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border-radius: 12px;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}
button {
  border: 1px solid var(--brand);
  color: #fff;
  background: var(--brand);
}
button:disabled { cursor: wait; opacity: 0.65; }
.secondary { border: 1px solid var(--line); color: var(--ink); background: var(--surface); }

.result { padding: 22px; }
.result[data-status="success"] { border-color: #a8d7c1; }
.result[data-status="error"] { border-color: #e0b4b4; }
.result[data-status="error"] #resultMessage { color: var(--error); }
.result[data-status="loading"] #resultMessage { color: var(--warning); }
#resultMessage { margin: 0; line-height: 1.7; }
pre {
  margin: 18px 0 0;
  padding: 16px;
  max-height: 360px;
  overflow: auto;
  border-radius: 12px;
  color: #dcece5;
  background: #14231e;
  font-size: 0.78rem;
  line-height: 1.55;
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 24px;
  padding: 0 4px;
  color: var(--muted);
  font-size: 0.78rem;
}

@media (max-width: 820px) {
  .shell { width: min(100% - 24px, 680px); padding-top: 28px; }
  .hero { align-items: flex-start; }
  .grid { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  .hero { display: grid; }
  .badge { justify-self: start; }
  .notice { display: grid; }
  .actions > * { width: 100%; }
  footer { display: grid; }
}
