:root {
  --bg-main: #d8edf8;
  --bg-secondary: #eef7fd;
  --surface: #ffffff;
  --text: #121518;
  --muted: #4f5c66;
  --line: #d6e0e6;
  --safe: #127a3f;
  --caution: #b36c00;
  --danger: #b50000;
  --accent: #d10304;
  --usage-track: #d5dde4;
  --usage-fill: #34a9e6;
}

* {
  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 55%),
    radial-gradient(920px 360px at 90% -16%, #d5ecfa 0%, transparent 52%),
    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: 1078px;
}

.panel {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 26px;
  box-shadow:
    0 10px 24px rgba(16, 42, 65, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(1.8px);
}

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

h1 {
  font-size: clamp(1.9rem, 1.95vw, 2.8rem);
  letter-spacing: 0.01em;
}

h2 {
  font-size: clamp(1.45rem, 1.8vw, 2rem);
}

.hero-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  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.68;
  font-size: 14px;
}

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

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

label {
  font-weight: 700;
  font-size: 0.98rem;
}

input[type="url"] {
  width: 100%;
  border: 1px solid #c3d0db;
  border-radius: 14px;
  background: #d9e5f2;
  padding: 14px 16px;
  font-size: 1rem;
  color: #1b2630;
}

input[type="url"]:focus {
  outline: 2px solid #97c8e6;
  border-color: #87b7d8;
}

.check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 3px;
  font-weight: 500;
}

.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: var(--accent);
  color: #fff;
  font-size: 1.12rem;
  font-weight: 700;
  padding: 13px 18px;
  cursor: pointer;
  transition: transform 120ms ease, filter 120ms ease;
}

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

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

button#submit-button {
  max-width: 540px;
  margin: 10px auto;
  width: 100%;
}

.hint {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.98rem;
  text-align: center;
}

.message {
  margin-top: 12px;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 1rem;
  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;
}

.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: 14px;
  box-shadow: none;
}

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

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

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

#crawl-guide .group-card p:last-child {
  margin-bottom: 0;
}

#crawl-guide .group-card ul {
  margin: 0;
  padding-left: 1.2em;
}

#crawl-guide .group-card li + li {
  margin-top: 8px;
}

#crawl-guide .group-card a {
  color: #0d7fba;
  text-decoration: underline;
}

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

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

.metric {
  border: 1px solid #d9e1e7;
  border-radius: 12px;
  background: #fbfdff;
  padding: 12px;
}

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

.metric p {
  margin: 8px 0 0;
  font-size: clamp(1.2rem, 1.55vw, 1.95rem);
  font-weight: 700;
}

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

.usage-meter {
  width: 100%;
  height: 12px;
  background: var(--usage-track);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 8px;
}

.usage-meter-fill {
  display: block;
  width: 0%;
  height: 100%;
  background: var(--usage-fill);
  border-radius: 999px;
  transition: width 700ms cubic-bezier(0.17, 0.84, 0.35, 1);
}

.usage-text {
  display: block;
  font-weight: 700;
}

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

table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
}

th,
td {
  border-bottom: 1px solid #e7edf2;
  padding: 10px 12px;
  text-align: left;
  font-size: 0.93rem;
  vertical-align: top;
  white-space: nowrap;
}

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

td.url-cell {
  min-width: 380px;
  max-width: 580px;
  white-space: normal;
  word-break: break-all;
}

tbody tr:last-child td {
  border-bottom: 0;
}

.result-safe {
  color: var(--safe);
  font-weight: 700;
}

.result-caution {
  color: var(--caution);
  font-weight: 700;
}

.result-danger {
  color: var(--danger);
  font-weight: 700;
}

.result-error {
  color: #7f1b1b;
  font-weight: 700;
}

.csv-form {
  margin-top: 14px;
}

@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: 1fr;
  }

  table {
    min-width: 860px;
  }

  th,
  td {
    font-size: 0.86rem;
    padding: 9px 10px;
  }

}

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

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