:root {
  color-scheme: light;
  --ink: #172033;
  --muted: #667085;
  --line: #e4e7ec;
  --soft: #f7f9fc;
  --primary: #1769e0;
  --primary-dark: #0f54bb;
  --primary-soft: #eef5ff;
  --success: #168354;
  --success-soft: #eaf8f1;
  --danger: #c43d4b;
  --danger-soft: #fff1f2;
  --orange: #ea7a17;
  --orange-soft: #fff5e9;
  --shadow: 0 18px 45px rgb(30 55 90 / 8%);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: #f6f8fb;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 0%, rgb(23 105 224 / 7%), transparent 30rem),
    radial-gradient(circle at 90% 8%, rgb(234 122 23 / 6%), transparent 24rem),
    #f6f8fb;
  font-family:
    Inter, "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo,
    sans-serif;
  line-height: 1.65;
}

button,
input {
  font: inherit;
}

button {
  min-height: 46px;
}

button:not(:disabled) {
  cursor: pointer;
}

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

.hero {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 32px;
}

.brand-mark {
  display: grid;
  flex: 0 0 54px;
  width: 54px;
  height: 54px;
  place-items: center;
  color: #fff;
  border-radius: 15px;
  background: linear-gradient(145deg, #3c8cff, #155cc9);
  box-shadow: 0 12px 24px rgb(23 105 224 / 25%);
  font-size: 25px;
  font-weight: 800;
}

.title-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.eyebrow,
.step-label {
  margin: 0 0 5px;
  color: var(--primary);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.free-badge,
.privacy-badge,
.status-chip,
.result-badge {
  flex: 0 0 auto;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 750;
}

.free-badge {
  margin-bottom: 5px;
  background: var(--orange-soft);
  color: #a94e05;
}

.privacy-badge,
.status-chip {
  background: var(--primary-soft);
  color: var(--primary-dark);
}

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

h1 {
  margin-bottom: 8px;
  font-size: clamp(1.85rem, 5vw, 2.7rem);
  line-height: 1.25;
  letter-spacing: -0.035em;
}

h2 {
  margin-bottom: 0;
  font-size: 1.25rem;
  line-height: 1.4;
}

.lead {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1rem;
}

.panel {
  margin-bottom: 22px;
  padding: 30px;
  border: 1px solid rgb(228 231 236 / 90%);
  border-radius: 20px;
  background: rgb(255 255 255 / 96%);
  box-shadow: var(--shadow);
}

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

label {
  display: inline-block;
  margin-bottom: 8px;
  font-size: 0.9rem;
  font-weight: 700;
}

.input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
}

input {
  width: 100%;
  height: 50px;
  padding: 0 16px;
  border: 1px solid #cfd5df;
  border-radius: 11px;
  outline: none;
  background: #fff;
  color: var(--ink);
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease;
}

input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgb(23 105 224 / 12%);
}

input:disabled {
  background: var(--soft);
  color: var(--muted);
}

.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 11px;
  font-weight: 750;
  transition:
    transform 120ms ease,
    background-color 160ms ease,
    border-color 160ms ease;
}

.primary-button {
  border: 1px solid var(--primary);
  background: var(--primary);
  color: #fff;
  box-shadow: 0 8px 18px rgb(23 105 224 / 20%);
}

.primary-button:hover {
  border-color: var(--primary-dark);
  background: var(--primary-dark);
}

.secondary-button {
  border: 1px solid #cfd5df;
  background: #fff;
  color: #344054;
}

.secondary-button:hover {
  border-color: #98a2b3;
  background: var(--soft);
}

.primary-button:active,
.secondary-button:active {
  transform: translateY(1px);
}

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

.secondary-button.danger {
  border-color: #fac6cc;
  color: var(--danger);
}

.secondary-button.danger:hover {
  background: var(--danger-soft);
}

.field-help {
  margin: 11px 0 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.alert {
  margin-top: 18px;
  padding: 13px 15px;
  border: 1px solid #fac6cc;
  border-radius: 10px;
  background: var(--danger-soft);
  color: #9b2633;
  font-size: 0.9rem;
  font-weight: 650;
}

.progress-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e9eef6;
}

.progress-bar {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #1668df, #64a7ff);
  transition: width 400ms ease;
}

.progress-message {
  min-height: 26px;
  margin: 13px 0 20px;
  color: #344054;
  font-size: 0.9rem;
  font-weight: 650;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 0 0 22px;
}

.stat-card {
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--soft);
}

.stat-card.accent {
  border-color: #cce0ff;
  background: var(--primary-soft);
}

.stat-card dt {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 650;
}

.stat-card dd {
  margin: 0;
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.035em;
}

.stat-card small {
  margin-left: 4px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
}

.step-label.success {
  color: var(--success);
}

.result-badge {
  background: var(--success-soft);
  color: var(--success);
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin: 0 0 24px;
  padding: 18px 0;
  border-block: 1px solid var(--line);
}

.summary-grid div {
  padding: 0 18px;
  border-right: 1px solid var(--line);
}

.summary-grid div:first-child {
  padding-left: 0;
}

.summary-grid div:last-child {
  border-right: 0;
}

.summary-grid dt {
  color: var(--muted);
  font-size: 0.75rem;
}

.summary-grid dd {
  margin: 2px 0 0;
  font-size: 1.06rem;
  font-weight: 800;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 22px;
}

.table-wrap {
  max-height: 520px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
}

table {
  width: 100%;
  min-width: 670px;
  border-collapse: collapse;
  font-size: 0.86rem;
}

th,
td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

th {
  position: sticky;
  top: 0;
  background: var(--soft);
  color: #475467;
  font-size: 0.74rem;
  letter-spacing: 0.02em;
}

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

td a {
  color: var(--primary-dark);
  text-decoration: none;
}

td a:hover {
  text-decoration: underline;
}

.notice,
.architecture-note {
  padding: 20px 22px;
  border: 1px solid #dde4ef;
  border-radius: 14px;
  background: rgb(255 255 255 / 70%);
  color: #475467;
  font-size: 0.82rem;
}

.notice {
  margin-bottom: 16px;
}

.notice strong,
.architecture-note h2 {
  color: #344054;
}

.notice p,
.architecture-note p {
  margin: 3px 0 0;
}

.architecture-note h2 {
  margin-bottom: 4px;
  font-size: 0.96rem;
}

footer {
  padding: 0 20px 32px;
  color: #8a94a5;
  text-align: center;
  font-size: 0.75rem;
}

footer p {
  margin: 0;
}

[hidden] {
  display: none !important;
}

@media (max-width: 720px) {
  .page-shell {
    width: min(100% - 22px, 980px);
    padding-top: 38px;
  }

  .hero {
    gap: 14px;
  }

  .brand-mark {
    flex-basis: 44px;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    font-size: 20px;
  }

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

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

  .stats-grid,
  .summary-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .summary-grid {
    gap: 16px 0;
  }

  .summary-grid div:nth-child(2) {
    border-right: 0;
  }

  .summary-grid div:nth-child(3) {
    padding-left: 0;
  }

  .action-row > * {
    flex: 1 1 100%;
  }
}

@media (max-width: 480px) {
  .hero {
    display: block;
  }

  .brand-mark {
    margin-bottom: 14px;
  }

  .title-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
  }

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

  .privacy-badge {
    display: none;
  }

  .stats-grid {
    gap: 8px;
  }

  .stat-card {
    padding: 13px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
