:root {
  color-scheme: light;
  --ink: #203149;
  --muted: #526377;
  --line: #d6dee7;
  --accent: #176a64;
  --wash: #edf5f2;
  --paper: #fbfcfa;
}
* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
body {
  margin: 0;
  font:
    16px/1.75 system-ui,
    -apple-system,
    "Noto Sans JP",
    sans-serif;
  color: var(--ink);
  background: var(--paper);
}
a {
  color: var(--accent);
  text-underline-offset: 4px;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
.button {
  min-height: 44px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  padding: 9px 16px;
  background: var(--accent);
  color: white;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}
button.secondary {
  background: white;
  color: var(--ink);
  border-color: #9babb9;
}
button:disabled {
  cursor: wait;
  background: #e1e8e6;
  color: #53645f;
  border-color: #aab9b4;
}
:focus-visible {
  outline: 3px solid #9d6500;
  outline-offset: 4px;
}
.skip {
  position: absolute;
  left: 12px;
  top: -80px;
  z-index: 5;
  background: white;
  padding: 8px;
}
.skip:focus {
  top: 8px;
}
.lab-header {
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px max(5vw, 18px);
  background: white;
}
.brand {
  color: var(--ink);
  text-decoration: none;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.lab-header nav,
.row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}
main {
  max-width: 1180px;
  padding: 44px 24px 72px;
  margin: auto;
}
.eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--accent);
  margin: 0 0 12px;
}
h1 {
  font-size: clamp(28px, 4.2vw, 48px);
  line-height: 1.35;
  letter-spacing: -0.025em;
  margin: 0 0 20px;
}
h2 {
  font-size: 21px;
  line-height: 1.5;
  margin: 0 0 16px;
}
h3 {
  font-size: 17px;
}
p {
  margin: 0 0 16px;
}
.lead {
  max-width: 750px;
  font-size: 18px;
  color: var(--muted);
}
.hero {
  padding-bottom: 28px;
}
.label,
.tag {
  font-size: 12px;
  letter-spacing: 0.04em;
}
.tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 4px;
  background: var(--wash);
  color: var(--accent);
}
.notice {
  background: var(--wash);
  border-left: 3px solid var(--accent);
  padding: 15px 20px;
  margin: 20px 0 28px;
}
.workspace {
  display: grid;
  grid-template-columns: minmax(280px, 0.85fr) minmax(0, 1.25fr);
  gap: 24px;
  align-items: start;
}
.panel {
  background: white;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 26px;
  margin-bottom: 24px;
  min-width: 0;
}
.stack {
  display: grid;
  gap: 18px;
}
.stack p {
  margin: 0;
}
label {
  display: grid;
  gap: 7px;
  font-size: 14px;
  font-weight: 600;
}
input,
select,
textarea {
  width: 100%;
  min-width: 0;
  padding: 9px 12px;
  background: #fff;
  border: 1px solid #9babb9;
  border-radius: 6px;
  color: var(--ink);
}
input[type="range"] {
  padding: 0;
  accent-color: var(--accent);
}
textarea {
  resize: vertical;
  min-height: 84px;
}
input[type="number"] {
  max-width: 180px;
}
.small,
small {
  font-size: 13px;
  color: var(--muted);
  font-weight: 400;
}
.mono,
code,
pre {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
}
code {
  overflow-wrap: anywhere;
}
.facts {
  display: grid;
  gap: 16px;
  margin: 0;
}
.facts div {
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}
.facts dt {
  font-size: 12px;
  color: var(--muted);
}
.facts dd {
  margin: 4px 0 0;
  overflow-wrap: anywhere;
}
#status {
  min-height: 52px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 24px;
  background: white;
}
#status[data-error="true"] {
  border-color: #ab4d35;
  color: #873722;
}
.history {
  padding: 0;
  list-style: none;
  max-height: 350px;
  overflow: auto;
  margin-bottom: 0;
}
.history li {
  padding: 14px 0;
  border-top: 1px solid var(--line);
}
.history code {
  font-size: 12px;
}
details {
  margin-top: 20px;
}
summary {
  cursor: pointer;
  font-weight: 600;
  min-height: 44px;
  padding: 10px 0;
}
details p,
details ul {
  margin-top: 12px;
}
.consult {
  padding: 25px 0;
}
.consult p {
  max-width: 760px;
}
footer {
  border-top: 1px solid var(--line);
  padding: 24px;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
}
.quantum {
  --accent: #4c478c;
  --wash: #f0eff8;
}
.circuit {
  display: grid;
  gap: 10px;
  padding: 20px 0;
  overflow: auto;
}
.wire {
  display: flex;
  gap: 7px;
  align-items: center;
  min-width: max-content;
}
.wire-label {
  width: 28px;
  font:
    13px ui-monospace,
    monospace;
}
.gate {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 46px;
  height: 36px;
  padding: 0 5px;
  border: 1px solid #bbc0d5;
  border-radius: 5px;
  font:
    12px ui-monospace,
    monospace;
}
.gate.active {
  background: var(--accent);
  color: white;
}
.gate.inactive {
  background: #f4f5f8;
  color: #617086;
}
.stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 15px 0;
}
.stat {
  padding: 16px;
  border-radius: 8px;
  background: var(--wash);
}
.stat span {
  display: block;
  font-size: 12px;
  color: var(--muted);
}
.stat output {
  font-size: 25px;
  line-height: 1.6;
}
.table-wrap {
  overflow: auto;
}
table {
  border-collapse: collapse;
  width: 100%;
  font-size: 13px;
}
th,
td {
  text-align: right;
  padding: 10px 7px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
th:first-child,
td:first-child {
  text-align: left;
}
th {
  font-weight: 600;
  color: var(--muted);
}
meter {
  display: block;
  width: 100%;
  height: 12px;
  min-width: 65px;
  accent-color: var(--accent);
}
pre {
  font-size: 12px;
  background: #f4f6f8;
  border: 1px solid var(--line);
  padding: 18px;
  border-radius: 8px;
  overflow: auto;
  line-height: 1.7;
}
@media (max-width: 700px) {
  main {
    padding: 28px 16px 40px;
  }
  .workspace {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .panel {
    padding: 20px;
  }
  .lab-header {
    padding: 15px 16px;
    flex-wrap: wrap;
  }
  .lab-header nav {
    font-size: 13px;
  }
  h1 {
    font-size: 30px;
  }
  .lead {
    font-size: 16px;
  }
  .stats {
    gap: 10px;
  }
  .stat {
    padding: 12px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation: none !important;
    transition: none !important;
  }
}
