:root {
  color-scheme: light;
  --page: #f6f6f9;
  --ink: #22232b;
  --muted: #555666;
  --green: #6043b5;
  --edge: #dedee6;
  --accent: #6043b5;
  --soft: #eeecf6;
}
.header-inner, main, .footer-inner { max-width: 1160px; }
.header-inner { height: 68px; }
.brand { color: var(--ink); font-size: 1.25rem; letter-spacing: -.04em; }
.brand > span { width: 32px; height: 32px; border-radius: 9px; background: var(--accent); }
.brand .icon { width: 24px; height: 24px; }
nav a, nav button { color: var(--muted); }
nav .lang { border: 0; }
nav a:hover, nav button:hover, #close:hover { background: var(--soft); }
main { padding-top: 0; }
.hero {
  display: grid;
  grid-template-columns: minmax(0,1fr);
  place-items: center;
  text-align: center;
  min-height: clamp(355px, 49vh, 490px);
  background: transparent;
  border-radius: 0;
  box-shadow: none;
}
.hero-copy, .journey { width: min(100%, 46rem); padding: 3.75rem 1rem; margin: 0 auto; }
.hero h1, html[lang=en] .hero h1 {
  max-width: 100%;
  margin: 0 auto 1rem;
  color: var(--ink);
  font-size: clamp(2rem, 4.3vw, 3.55rem);
  line-height: 1.2;
  text-wrap: balance;
}
.hero p { max-width: 60ch; margin: 0 auto; color: var(--muted); font-size: 1.06rem; line-height: 1.65; }
.hero-copy { container-type: inline-size; }
.hero .intro-note { max-width: none; }
html[lang=ja] .hero h1, html[lang=ja] .journey h2, html[lang=ja] .hero p { word-break: auto-phrase; }
.actions { justify-content: center; margin-top: 1.75rem; gap: .7rem; }
.hero .primary {
  display: inline-flex;
  justify-content: center;
  width: min(100%, 23rem);
  min-height: 4.75rem;
  padding: 1rem 1.5rem;
  gap: .75rem;
  border-radius: .75rem;
  background: var(--accent);
  box-shadow: none;
  color: #fff;
  font-size: clamp(1.25rem, 2vw, 1.5rem);
  line-height: 1.3;
}
.hero .primary:hover { background: #49308f; }
.primary:focus-visible { outline: 3px solid #f5d46c; outline-offset: -3px; }
.actions .primary { margin-inline: calc((100% - min(100%, 23rem)) / 2); }
.duration, .duration + small, .metric > div, .metric .icon, .endpoint > .icon { color: var(--muted); }
.endpoint select, .duration select { color: var(--ink); background-color: #e6e5ed; }
#endpoint-settings { justify-content: center; }
.journey-label { display: block; color: var(--muted); font-size: .92rem; font-weight: 650; margin-bottom: .8rem; }
.journey h2 { font-size: clamp(1.6rem, 3.5vw, 2.5rem); line-height: 1.25; text-wrap: balance; }
.journey h2 + p { margin-top: .85rem; }
.journey .verdict {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .6rem;
  font-size: clamp(2rem, 5vw, 3.5rem);
  color: var(--verdict-ink);
}
#result[data-status=clear] { --verdict-ink: #156048; --mark-bg: #d9eee4; }
#result[data-status=issue] { --verdict-ink: #962f28; --mark-bg: #f9dfd9; }
#result[data-status=unknown] { --verdict-ink: #505567; --mark-bg: #e4e5eb; }
.verdict-mark {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 1.3em;
  height: 1.3em;
  border-radius: 50%;
  background: var(--mark-bg);
  font: 750 .85em/1 system-ui, sans-serif;
}
.hero .explanation { color: var(--ink); }
.hero .coverage, .journey .feedback { margin-top: .55rem; font-size: .875rem; }
.progress-card { max-width: 31rem; margin: 1.5rem auto 0; }
.progress-meta { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.hero #live-detail, .hero #elapsed { font-size: .9rem; color: var(--muted); }
#stage-bar {
  display: block;
  appearance: none;
  width: 100%;
  height: .65rem;
  border: none;
  border-radius: 1rem;
  margin: .75rem 0;
  overflow: hidden;
  background: #dedce7;
  color: var(--accent);
}
#stage-bar::-webkit-progress-bar { background: #dedce7; }
#stage-bar::-webkit-progress-value { background: var(--accent); }
#stage-bar::-moz-progress-bar { background: var(--accent); }
#stage-bar:indeterminate { background: linear-gradient(90deg,#dedce7 25%,#795bca 50%,#dedce7 75%) 0 0 / 200% 100%; animation: checking 1.8s ease-in-out infinite alternate; }
#stage-bar:indeterminate::-webkit-progress-bar { background: transparent; }
@keyframes checking { to { background-position: 100% 0; } }
@media (prefers-reduced-motion: reduce) { #stage-bar:indeterminate { animation: none; } }
.next-action { margin: 1.7rem auto 0; }
.next-action h3 { font-size: 1rem; }
.journey .next-action p { margin: .25rem auto .85rem; font-size: .98rem; }
.journey .next-action .primary { max-width: 100%; min-height: 3.5rem; font-size: 1.1rem; }
#result[data-status=clear] .primary { background: #e8e3f5; color: #493582; }
#result[data-status=clear] .primary:hover { background: #dfd7ef; }
#result[data-status=clear] .primary:focus-visible { outline-color: var(--accent); }
#stop, .journey .buttons button, #setup-error button {
  min-height: 44px;
  padding: .45rem .65rem;
  background: transparent;
  color: #514075;
  text-decoration: underline;
  text-underline-offset: .22em;
}
#stop, .journey .buttons { margin-top: .7rem; }
.journey .buttons { justify-content: center; }
.journey .feedback:empty { display: none; }
#stop:hover, .journey .buttons button:hover, #setup-error button:hover { background: var(--soft); }
.section-heading h2, .guide h2, .platforms h2 { font-size: 1.25rem; }
main > section + section { margin-top: 2rem; }
.monitor-box, .tool-card, .guide, .table-wrap, .platforms details, .measure-details > summary { background: #fff; box-shadow: none; border-radius: .75rem; }
.tool-card:hover { background: #f0edf8; box-shadow: none; transform: none; }
.tool-icon, .tool-icon.nat, .tool-icon.stability { background: var(--soft); color: var(--accent); }
.tool-icon.loss { color: #336758; background: #e9f2ed; }
.guide h2 .icon { color: var(--accent); }
.measure-details { margin: 0 0 1.5rem; }
.measure-details > summary, .comparison > summary { padding: 1rem 1.25rem; }
.measure-details[open] .monitor-box { margin-top: .4rem; }
#breakdown { margin-top: 1rem; }
#breakdown table, .comparison table { width: 100%; text-align: left; border-collapse: collapse; margin: .5rem 0; }
#breakdown td, #breakdown th, .comparison th, .comparison td { padding: .55rem .7rem; vertical-align: top; }
#breakdown tr:nth-child(odd), .comparison thead, .comparison tbody tr:nth-child(even) { background: #f4f3f8; }
#breakdown p, details p, .footer-inner { color: var(--muted); }
#breakdown p { margin: .5rem 0; }
.table-wrap { overflow-x: auto; }
.comparison { background: white; border-radius: .75rem; }
.comparison > p { padding: .5rem 1rem 1rem; font-size: .875rem; }
.platforms h2 { margin-bottom: .6rem; }
.platforms > div { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: .6rem; align-items: start; }
.platforms details { margin: 0; padding: .25rem .85rem; }
.platforms details p { padding-bottom: .75rem; }
footer { background: #fff; }
#dialog-body article { background: var(--page); }
@media (max-width: 600px) {
  .header-inner { height: 58px; }
  .hero { min-height: 330px; }
  .hero-copy, .journey { padding: 2.5rem 0; }
  .hero p { font-size: 1rem; }
  html[lang=ja] .hero .intro-note { font-size: min(1rem, 4.3cqi); }
  .hero .primary { width: 100%; min-height: 4.25rem; padding-inline: 1rem; }
  .actions .primary { margin-inline: 0; }
  .journey .buttons { gap: 0 .2rem; }
  .platforms > div { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .comparison th, .comparison td { font-size: .84rem; padding: .5rem; }
}
@media (max-width: 360px) {
  .header-inner { padding-inline: 10px; }
  .header-inner .brand { font-size: 1.1rem; }
}
