:root {
  --bg-main: #deeffc;
  --bg-secondary: #f3f8fe;
  --surface: #ffffff;
  --text: #1a2230;
  --muted: #4f5c66;
  --line: #d7e1ec;
  --allow: #127a3f;
  --block: #b50000;
  --hold: #815f16;
  --accent: #d10304;
  --accent-soft: #ffe9e9;
  --panel-shadow: 0 16px 34px rgba(12, 38, 74, 0.09);
}

* {
  box-sizing: border-box;
  font-size: 14px;
  font-family:
    YakuHanJP,
    "Hiragino Sans",
    "ヒラギノ角ゴシック",
    "Hiragino Kaku Gothic Pro",
    "ヒラギノ角ゴ Pro W3",
    Meiryo,
    "メイリオ",
    "Yu Gothic Medium",
    "Yu Gothic",
    "Yu Gothic",
    YuGothic,
    Helvetica,
    Osaka,
    sans-serif;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(1000px 420px at 12% -10%, #edf8ff 0%, transparent 56%),
    radial-gradient(920px 360px at 90% -16%, #d4ebfb 0%, transparent 53%),
    linear-gradient(180deg, var(--bg-main) 0%, var(--bg-secondary) 64%, #f6fafd 100%);
}

.page {
  width: min(860px, calc(100% - 36px));
  margin: 24px auto 40px auto;
  display: grid;
  gap: 18px;
  max-width: 860px;
}

.panel {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.97), rgba(255, 255, 255, 0.93));
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 24px;
  box-shadow: var(--panel-shadow);
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.35;
}

h1 {
  font-size: clamp(1.75rem, 2vw, 2.1rem);
  margin: 7px 0 21px 0;
  color: #00056e;
}

h2 {
  font-size: clamp(1.4rem, 1.8vw, 1.9rem);
}

.hero-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: start;
}

.hero-copy {
  min-width: 0;
}

.hero-logo-wrap {
  width: clamp(220px, 14vw, 320px);
  justify-self: end;
}

.hero-logo-wrap a {
  display: block;
}

.hero-logo {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
}

.lead {
  margin: 10px 0 0;
  color: #303d47;
  line-height: 1.7;
}

.lead a {
  color: #0d7fba;
  text-decoration: underline;
}

.form {
  margin-top: 18px;
  display: grid;
  gap: 10px;
}

label {
  font-weight: 700;
}

input[type="url"] {
  width: 100%;
  border: 1px solid #bfd0df;
  border-radius: 14px;
  background: #edf4fb;
  padding: 14px 16px;
  font-size: 1rem;
  color: #1b2735;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

input[type="url"]:focus {
  outline: none;
  border-color: #80aeda;
  box-shadow: 0 0 0 3px rgba(96, 155, 213, 0.22);
}

.rate-limit-note {
  margin: 2px 0 0;
  border: 1px solid #ffb7b7;
  background: #fff2f2;
  border-radius: 10px;
  padding: 9px 12px;
  color: #8b1b1b;
  font-weight: 700;
}

button {
  border: 0;
  border-radius: 12px;
  background: linear-gradient(180deg, #e20606 0%, #c20102 100%);
  color: #fff;
  font-size: 1.06rem;
  font-weight: 700;
  padding: 13px 18px;
  cursor: pointer;
  width: min(540px, 100%);
  margin: 10px auto 0;
  box-shadow: 0 8px 16px rgba(184, 9, 9, 0.22);
  transition: transform 140ms ease, filter 140ms ease;
}

button:hover {
  filter: brightness(1.04);
  transform: translateY(-1px);
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.message {
  margin-top: 12px;
  border-radius: 10px;
  padding: 10px 12px;
  display: none;
}

.message.is-visible {
  display: block;
}

.message.is-error {
  background: #f7ebeb;
  border: 1px solid #e6b8b8;
  color: #8e1010;
}

.message.is-success {
  background: #ddf1e5;
  border: 1px solid #9dc9af;
  color: #0b5f34;
}

.target {
  margin: 10px 0 14px;
  color: #3e4b55;
  line-height: 1.8;
  word-break: break-all;
}

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

.metric {
  border: 1px solid #d5e0e9;
  border-radius: 12px;
  background: linear-gradient(180deg, #fbfdff 0%, #f7fbff 100%);
  padding: 12px;
}

.metric h3 {
  font-size: 0.93rem;
  color: #586670;
}

.metric p {
  margin: 8px 0 0;
  font-size: clamp(1.15rem, 1.45vw, 1.7rem);
  font-weight: 700;
}

.status-allow {
  color: var(--allow);
}

.status-block {
  color: var(--block);
}

.status-hold {
  color: var(--hold);
}

.source-grid {
  margin-top: 14px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.subpanel {
  border: 1px solid #d4e1ec;
  border-radius: 13px;
  background: #fff;
  padding: 12px;
}

.subpanel-meta {
  margin: 9px 0;
  color: #4a5862;
  line-height: 1.65;
  word-break: break-all;
}

.robots-note {
  margin: 0 0 8px;
  color: #4f5c66;
}

.scroll-box {
  margin: 0;
  border: 1px solid #d9e4ec;
  border-radius: 10px;
  background: #f7fbff;
  max-height: 240px;
  overflow: auto;
  padding: 10px;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.5;
}

.table-wrap {
  margin-top: 14px;
  border: 1px solid #d4e1ec;
  border-radius: 14px;
  background: #fff;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}

.result-table {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
}

.result-table th,
.result-table td {
  border-bottom: 1px solid #e7edf2;
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
}

.result-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f0f4f8;
}

.result-table td:nth-child(1),
.result-table td:nth-child(2) {
  white-space: nowrap;
}

.group-results {
  margin-top: 14px;
  display: grid;
  gap: 12px;
}

.group-card {
  border: 1px solid #d6e1eb;
  border-radius: 14px;
  background:
    linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
  padding: 12px;
  box-shadow: 0 8px 18px rgba(21, 44, 78, 0.06);
}

.group-card h3 {
  font-size: 1.4rem;
  margin: 15px 0;
  color: #0f1f3a;
}

#policy-guide .group-card p,
#policy-guide .group-card ol {
  line-height: 1.8;
  color: #2f3d49;
}

#policy-guide .group-card p {
  margin: 0 0 12px;
}

#policy-guide .group-card ol {
  margin: 0 0 12px 1.2em;
  padding: 0;
}

#policy-guide .group-card h4 {
  margin: 18px 0 10px;
  font-size: 1.05rem;
  color: #123255;
}

.group-actions {
  display: grid;
  gap: 8px;
}

.group-rule-button {
  width: auto;
  margin: 0;
  padding: 10px 14px;
  border-radius: 10px;
  background: linear-gradient(180deg, #ffffff 0%, #f6f9fc 100%);
  border: 1px solid #c9d8e7;
  color: #123255;
  box-shadow: none;
  font-size: 0.92rem;
  justify-self: start;
}

.group-rule-button:hover {
  filter: none;
  transform: none;
  background: linear-gradient(180deg, #ffffff 0%, #edf4fb 100%);
}

.group-rule-button:disabled {
  opacity: 0.65;
}

.group-rule-box {
  border: 1px dashed #b9cce0;
  border-radius: 10px;
  padding: 10px;
  background: #f8fcff;
}

.group-rule-note {
  margin: 0 0 8px;
  color: #3f546a;
}

.group-rule-text {
  width: 100%;
  min-height: 150px;
  border: 1px solid #c2d3e3;
  border-radius: 8px;
  background: #ffffff;
  color: #243246;
  padding: 9px 10px;
  font-family:
    ui-monospace,
    SFMono-Regular,
    Menlo,
    Monaco,
    Consolas,
    "Liberation Mono",
    "Courier New",
    monospace;
  line-height: 1.45;
  resize: vertical;
}

.group-card .table-wrap {
  margin-top: 10px;
}

.group-placeholder {
  margin: 0;
  color: var(--muted);
}

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.88rem;
  font-weight: 700;
}

.badge.is-allow {
  background: #e8f6ef;
  color: var(--allow);
}

.badge.is-block {
  background: #fbeaea;
  color: var(--block);
}

.badge.is-hold {
  background: #fff7e4;
  color: var(--hold);
}

@media (max-width: 980px) {
  .page {
    width: min(860px, calc(100% - 18px));
    margin: 14px auto 24px;
  }

  .panel {
    border-radius: 14px;
    padding: 16px;
  }

  .hero-head {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .hero-logo-wrap {
    justify-self: start;
    width: min(250px, 72%);
  }

  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .result-table {
    min-width: 740px;
  }

  .result-table th,
  .result-table td {
    padding: 9px 10px;
  }
}

@media (max-width: 482px) {
  .lead {
    font-size: 12px;
  }

  .hero-logo-wrap {
    display: none;
  }

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

  .scroll-box {
    max-height: 190px;
  }
}
