:root {
  --zeburai-navy: #031225;
  --zeburai-cyan: #12d9ff;
  --zeburai-white: #ffffff;
  --zeburai-graphite: #2b3440;
  --bg: #f5f8fc;
  --surface: #ffffff;
  --surface-strong: #eef4f9;
  --surface-tint: #f8fcff;
  --ink: #031225;
  --muted: #607083;
  --line: #d7e2ec;
  --line-strong: #aebdca;
  --accent: #1f8f68;
  --warning: #a05a00;
  --danger: #b3261e;
  --ok: #147b55;
  --focus: rgba(18, 217, 255, 0.32);
  --shadow: 0 20px 58px rgba(3, 18, 37, 0.1);
  --radius: 8px;
  --font-display: "Oxanium", "Inter", Arial, sans-serif;
  --font-ui: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  padding-top: 0;
  overflow-x: hidden;
  background: linear-gradient(180deg, #f8fbff 0%, var(--bg) 44%, #eef5fb 100%);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.48;
  text-rendering: geometricPrecision;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto;
  height: 5px;
  background: var(--zeburai-cyan);
  pointer-events: none;
  z-index: 20;
}

img,
svg {
  display: block;
  max-width: 100%;
}

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

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  line-height: 1.05;
  letter-spacing: 0;
}

p,
span,
strong,
legend,
label,
button,
li {
  overflow-wrap: anywhere;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

.noscript {
  width: min(100% - 32px, 760px);
  margin: 12vh auto;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.noscript img {
  width: 168px;
  margin-bottom: 28px;
}

.noscript h1 {
  margin-bottom: 10px;
  font-size: 2rem;
}

.app-shell {
  min-height: 100vh;
  min-height: 100svh;
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(276px, 304px) minmax(0, 1fr);
}

.app-shell.is-compact {
  grid-template-columns: 1fr;
}

.app-shell.is-compact .sidebar {
  display: none;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 24px 18px;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  background: var(--zeburai-navy);
  color: var(--surface);
  overflow: hidden;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand img {
  width: 148px;
  height: auto;
}

.brand.is-small img {
  width: 190px;
}

.storage-block,
.progress-block {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.meta-label,
.eyebrow,
.question-number,
.progress-text,
.completion-kicker {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  letter-spacing: 0;
  text-transform: uppercase;
}

.meta-label,
.progress-text {
  color: var(--muted);
}

.sidebar .meta-label,
.sidebar .progress-text {
  color: rgba(255, 255, 255, 0.62);
}

.eyebrow,
.question-number,
.completion-kicker {
  color: #087d96;
  font-weight: 700;
}

.storage-block {
  padding: 13px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.06);
}

.storage-block strong {
  font-size: 0.95rem;
}

.storage-block p {
  color: rgba(255, 255, 255, 0.58);
  font-size: 0.88rem;
}

.progress-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.progress-track {
  position: relative;
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
}

.progress-fill {
  position: relative;
  width: 0;
  height: 100%;
  border-radius: inherit;
  overflow: hidden;
  background: linear-gradient(90deg, var(--zeburai-cyan), #44e6b2);
  transition: width 360ms cubic-bezier(0.22, 1, 0.36, 1);
}

.progress-fill::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.52), transparent);
  transform: translateX(-100%);
  animation: progressSweep 1800ms ease-in-out infinite;
}

.section-list {
  display: grid;
  gap: 5px;
  margin: 0;
  padding: 2px 6px 2px 0;
  list-style: none;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.28) transparent;
  scroll-behavior: smooth;
}

.section-list::-webkit-scrollbar {
  width: 8px;
}

.section-list::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.28);
}

.section-step {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 42px;
  padding: 7px 9px;
  border-radius: var(--radius);
  color: rgba(255, 255, 255, 0.58);
  font-size: 0.88rem;
  transition: background 180ms ease, color 180ms ease, transform 180ms ease;
}

.section-step span:first-child {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.68);
  font-family: var(--font-mono);
  font-size: 0.74rem;
}

.section-step.is-active {
  background: rgba(18, 217, 255, 0.14);
  color: var(--surface);
  transform: translateX(2px);
}

.section-step.is-active span:first-child {
  border-color: var(--zeburai-cyan);
  background: var(--zeburai-cyan);
  color: var(--zeburai-navy);
}

.section-step.is-done span:first-child {
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.18);
  color: var(--surface);
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.58);
  font-size: 0.84rem;
}

.main {
  min-width: 0;
  padding: 28px;
}

.stage {
  width: min(100%, 1080px);
  min-width: 0;
  margin: 0 auto;
}

.form-topbar {
  position: sticky;
  top: 5px;
  z-index: 10;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-rows: auto 3px;
  align-items: center;
  column-gap: 12px;
  row-gap: 0;
  padding: 8px 16px 0;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 4px 18px rgba(3, 18, 37, 0.06);
  backdrop-filter: blur(12px);
  overflow: hidden;
  animation: fadeUpSoft 360ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.topbar-steps {
  display: flex;
  align-items: center;
  gap: 5px;
  margin: 0;
  padding: 0;
  list-style: none;
  flex: 0 0 auto;
  padding-bottom: 8px;
}

.topbar-step {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1.5px solid var(--line-strong);
  background: transparent;
  transition: background 200ms, border-color 200ms;
}

.topbar-step.is-done {
  background: var(--zeburai-cyan);
  border-color: var(--zeburai-cyan);
}

.topbar-step.is-active {
  background: var(--zeburai-navy);
  border-color: var(--zeburai-navy);
}

.topbar-section {
  min-width: 0;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-bottom: 8px;
}

.topbar-pct {
  flex: 0 0 auto;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  padding-bottom: 8px;
}

.topbar-pct small {
  font-size: 0.66rem;
  opacity: 0.8;
}

.topbar-track {
  grid-column: 1 / -1;
  height: 3px;
  background: var(--surface-strong);
  margin: 0 -16px;
}

.topbar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--zeburai-cyan), #44e6b2);
  transition: width 360ms cubic-bezier(0.22, 1, 0.36, 1);
}

.panel {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  animation: panelIn 420ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.panel-body {
  min-width: 0;
  padding: 44px;
}

.welcome {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(280px, 0.95fr);
  min-height: 620px;
}

.welcome-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 24px;
  padding: 44px;
}

.welcome-copy > *,
.welcome-side > * {
  animation: fadeUpSoft 520ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.welcome-copy > *:nth-child(2) { animation-delay: 45ms; }
.welcome-copy > *:nth-child(3) { animation-delay: 90ms; }
.welcome-copy > *:nth-child(4) { animation-delay: 135ms; }
.welcome-copy > *:nth-child(5) { animation-delay: 180ms; }
.welcome-copy > *:nth-child(6) { animation-delay: 225ms; }
.welcome-side > *:nth-child(2) { animation-delay: 80ms; }
.welcome-side > *:nth-child(3) { animation-delay: 140ms; }
.welcome-side > *:nth-child(4) { animation-delay: 200ms; }

.welcome-copy .brand {
  margin-bottom: 8px;
}

.welcome-copy .brand img {
  width: min(296px, 100%);
}

.welcome.has-intake .brand {
  margin-bottom: 0;
}

.welcome h1 {
  max-width: 12ch;
  margin-top: 12px;
  font-size: 4.4rem;
  font-weight: 700;
}

.welcome.has-intake .welcome-copy {
  justify-content: start;
  gap: 14px;
  padding-top: 28px;
  padding-bottom: 28px;
}

.welcome.has-intake h1 {
  max-width: 13ch;
  margin-top: 8px;
  font-size: 2.85rem;
}

.welcome.has-intake .lead {
  font-size: 1.04rem;
}

.welcome.has-intake .trust-note {
  font-size: 0.96rem;
  padding-left: 12px;
}

.lead {
  width: 100%;
  max-width: 64ch;
  color: var(--muted);
  font-size: 1.15rem;
}

.trust-note {
  width: 100%;
  max-width: 58ch;
  padding-left: 14px;
  border-left: 3px solid var(--zeburai-cyan);
  color: var(--zeburai-graphite);
}

.facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.company-intake {
  display: grid;
  gap: 14px;
  max-width: 680px;
  margin-top: 28px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-tint);
  animation: fadeUpSoft 360ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.welcome.has-intake .company-intake {
  gap: 9px;
  padding: 12px;
}

.company-intake .text-input {
  padding: 10px 12px;
}

.company-intake p:not(.meta-label) {
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.92rem;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.field {
  display: grid;
  gap: 7px;
}

.field span {
  color: var(--zeburai-graphite);
  font-size: 0.88rem;
  font-weight: 700;
}

.field em {
  color: var(--muted);
  font-size: 0.78rem;
  font-style: normal;
  font-weight: 500;
}

.pill {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.78rem;
}

.welcome-side {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
  padding: 44px;
  border-left: 1px solid var(--line);
  background: var(--zeburai-navy);
  color: var(--surface);
}

.welcome-side .meta-label,
.welcome-side .lead {
  color: rgba(255, 255, 255, 0.74);
}

.welcome-kaji {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.welcome-kaji img {
  width: 84px;
  margin: 2px 0 0 -7px;
}

.signal-list {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.signal-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 12px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
}

.signal-row span:first-child {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 999px;
  color: var(--zeburai-cyan);
  font-family: var(--font-mono);
  font-size: 0.76rem;
}

.signal-row strong {
  display: block;
  margin-bottom: 3px;
}

.signal-row p {
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.88rem;
}

.actions,
.nav-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.button {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 11px 16px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
  transition: background 160ms ease, border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease, color 160ms ease;
}

.button:hover {
  border-color: var(--ink);
  box-shadow: 0 8px 18px rgba(3, 18, 37, 0.09);
  transform: translateY(-1px);
}

.button:active {
  transform: translateY(1px);
}

.button.primary {
  border-color: var(--zeburai-navy);
  background: var(--zeburai-navy);
  color: var(--surface);
  box-shadow: 0 10px 26px rgba(3, 18, 37, 0.16);
}

.button.primary:hover {
  border-color: #062345;
  background: #062345;
  box-shadow: 0 13px 30px rgba(3, 18, 37, 0.2);
}

.button.primary::after {
  content: "";
  width: 20px;
  height: 2px;
  flex: 0 0 auto;
  background: var(--zeburai-cyan);
  transform: rotate(-26deg);
}

.button.ghost {
  border-color: transparent;
  background: transparent;
  color: var(--muted);
}

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

.button.small {
  min-height: 36px;
  padding: 8px 11px;
  font-size: 0.82rem;
}

.link-action {
  width: fit-content;
  min-height: 0;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  text-align: left;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.link-action:hover {
  color: var(--ink);
}

.danger-link {
  color: var(--danger);
}

.button:disabled {
  opacity: 0.54;
}

.screen-head {
  min-width: 0;
  display: grid;
  gap: 12px;
  max-width: 790px;
  margin-bottom: 34px;
}

.panel-body > .screen-head > *,
.panel-body > .company-intake,
.panel-body > .question-list,
.nav-bar {
  animation: fadeUpSoft 420ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.panel-body > .screen-head > *:nth-child(2) { animation-delay: 45ms; }
.panel-body > .screen-head > *:nth-child(3) { animation-delay: 85ms; }
.panel-body > .screen-head > *:nth-child(4) { animation-delay: 120ms; }
.panel-body > .question-list { animation-delay: 125ms; }
.nav-bar { animation-delay: 180ms; }

.screen-head h2 {
  font-size: 2.65rem;
}

.section-count {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  text-transform: uppercase;
}

.question-list {
  display: grid;
  gap: 18px;
}

.question {
  min-width: 0;
  margin: 0;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
  animation: questionIn 360ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.question:hover {
  border-color: #c1d4e2;
  box-shadow: 0 12px 28px rgba(3, 18, 37, 0.05);
}

.question.is-invalid {
  border-color: #e29a94;
  background: #fffafa;
  box-shadow: 0 0 0 3px rgba(179, 38, 30, 0.08);
  animation: questionIn 260ms ease both, invalidNudge 240ms ease both;
}

.question:nth-child(2) {
  animation-delay: 35ms;
}

.question:nth-child(3) {
  animation-delay: 70ms;
}

.question legend {
  float: left;
  width: 100%;
  margin-bottom: 15px;
  padding: 0;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 1.42rem;
  font-weight: 700;
  line-height: 1.2;
}

.question legend + * {
  clear: both;
}

.question-number {
  display: block;
  margin-bottom: 7px;
}

.hint {
  margin: -4px 0 14px;
  color: var(--muted);
  font-size: 0.92rem;
}

.options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.options.compact {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.option {
  position: relative;
  min-height: 58px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfdff;
  color: var(--ink);
  transition: border-color 140ms ease, background 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.option::after {
  content: "";
  position: absolute;
  top: 13px;
  right: 13px;
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: transparent;
  transform: scale(0.3);
  transition: transform 160ms ease, background 160ms ease;
}

.option:hover {
  border-color: var(--line-strong);
  box-shadow: 0 7px 18px rgba(3, 18, 37, 0.06);
  transform: translateY(-1px);
}

.option:has(input:checked) {
  border-color: #08a8c5;
  background: #e9fbff;
  box-shadow: inset 0 0 0 1px rgba(18, 217, 255, 0.25);
}

.option:has(input:checked)::after {
  background: var(--accent);
  transform: scale(1);
  animation: choicePulse 420ms ease both;
}

.option input {
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  flex: 0 0 auto;
  accent-color: var(--zeburai-navy);
}

.option span {
  font-size: 0.92rem;
}

.text-input {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfdff;
  color: var(--ink);
  padding: 14px 15px;
  outline: none;
  transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

textarea.text-input {
  min-height: 118px;
  resize: vertical;
}

.text-input:focus {
  border-color: #08a8c5;
  box-shadow: 0 0 0 3px var(--focus);
}

.error-box,
.notice-box,
.q-inline-error {
  min-height: 24px;
  margin-top: 14px;
  font-size: 0.92rem;
}

.error-box,
.q-inline-error {
  color: var(--danger);
}

.q-inline-error {
  margin-bottom: 0;
  font-weight: 700;
}

.error-box.is-status {
  color: var(--muted);
}

.notice-box {
  color: var(--ok);
}

.nav-bar {
  position: sticky;
  bottom: 0;
  z-index: 5;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 18px 44px;
  border-top: 1px solid var(--line);
  background: rgba(249, 251, 254, 0.94);
  backdrop-filter: blur(14px);
}

.nav-status {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

.completion {
  min-width: 0;
  display: grid;
  gap: 24px;
}

.completion-grid {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(280px, 1.1fr);
  gap: 18px;
}

.completion-panel {
  min-width: 0;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.completion-panel.dark {
  border-color: var(--zeburai-navy);
  background: var(--zeburai-navy);
  color: var(--surface);
  position: relative;
  overflow: hidden;
}

.completion-panel.dark::after {
  content: "";
  position: absolute;
  right: 24px;
  bottom: 24px;
  width: 74px;
  height: 4px;
  background: var(--zeburai-cyan);
  transform: rotate(-26deg);
  animation: processingSignal 1500ms ease-in-out infinite;
}

.completion-panel.dark p,
.completion-panel.dark .meta-label {
  color: rgba(255, 255, 255, 0.74);
}

.completion-panel h2 {
  margin-top: 10px;
  font-size: 2.4rem;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.metric {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfdff;
}

.completion-panel.dark .metric {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
}

.metric strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.55rem;
  line-height: 1;
}

.metric span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.82rem;
}

.completion-panel.dark .metric span {
  color: rgba(255, 255, 255, 0.68);
}

.completion-note {
  margin-top: 18px;
  padding: 14px;
  border: 1px solid #bfe6dc;
  border-radius: var(--radius);
  background: #effaf6;
  color: var(--ok);
  font-weight: 700;
}

.completion-email {
  display: grid;
  gap: 14px;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.completion-email h3 {
  margin-bottom: 6px;
  font-size: 1.25rem;
}

.completion-email p:not(.error-box) {
  color: var(--muted);
}

.completion-email-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.summary-list {
  display: grid;
  gap: 10px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.summary-list li {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.summary-list strong {
  color: var(--ink);
  text-align: right;
}

.diagnostics-shell {
  width: min(100% - 32px, 1240px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 24px 0 54px;
  display: grid;
  gap: 16px;
}

.diagnostics-shell.blocked {
  place-items: center;
}

.diagnostics-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, auto);
  gap: 20px;
  align-items: center;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background:
    linear-gradient(135deg, #071225, #0d2036),
    radial-gradient(circle at 100% 0%, rgba(18, 217, 255, 0.12), transparent 18rem);
  color: var(--surface);
  box-shadow: var(--shadow);
  animation: panelIn 420ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.diagnostics-hero img {
  width: 138px;
  margin-bottom: 16px;
}

.diagnostics-hero h1 {
  max-width: none;
  margin-top: 10px;
  font-size: clamp(2.05rem, 4vw, 3.45rem);
}

.diagnostics-hero .lead {
  max-width: 760px;
  margin-top: 12px;
  color: rgba(255, 255, 255, 0.74);
}

.diagnostics-hero .eyebrow,
.diagnostics-hero .meta-label {
  color: var(--zeburai-cyan);
}

.diagnostics-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  max-width: 520px;
}

.diagnostics-actions.inline {
  justify-content: flex-start;
  max-width: none;
}

.diagnostics-actions .button {
  white-space: nowrap;
}

.diagnostics-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(340px, 0.72fr);
  gap: 16px;
  align-items: start;
}

.diagnostics-tools {
  display: grid;
  gap: 16px;
  min-width: 0;
}

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

.diagnostics-output {
  grid-template-columns: minmax(0, 1fr);
}

.diagnostic-card {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 14px 34px rgba(3, 18, 37, 0.07);
  animation: fadeUpSoft 360ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.diagnostic-card.wide {
  padding: 0;
  overflow: hidden;
}

.diagnostic-card-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-tint);
}

.diagnostic-card h2 {
  margin-top: 4px;
  font-size: 1.3rem;
}

.diagnostic-card-title {
  margin-bottom: 14px;
}

.manual-card {
  display: grid;
  gap: 10px;
}

.diag-textarea {
  min-height: 150px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
}

.diagnostic-metrics {
  display: grid;
  gap: 10px;
  margin: 16px 0 0;
}

.diagnostic-metrics div {
  display: grid;
  grid-template-columns: minmax(110px, 0.7fr) minmax(0, 1fr);
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.diagnostic-metrics.compact {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0 12px;
  margin-top: 12px;
}

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

.diagnostic-metrics dt {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
}

.diagnostic-metrics dd {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 0.82rem;
}

.diagnostic-list {
  display: grid;
  gap: 10px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.diagnostic-list li {
  display: grid;
  gap: 3px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.92rem;
}

.diagnostic-list strong {
  color: var(--ink);
}

.diagnostic-status {
  padding: 7px 10px;
  border: 1px solid #a7d8c8;
  border-radius: 999px;
  background: #effaf6;
  color: var(--ok);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
}

.diagnostic-card pre {
  max-height: 180px;
  margin: 0;
  padding: 14px;
  overflow: auto;
  background: #07182b;
  color: #d8f7ff;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.55;
  white-space: pre-wrap;
}

.diagnostic-events {
  display: grid;
  gap: 14px;
  max-height: min(68vh, 760px);
  overflow: auto;
  padding: 16px;
}

.diagnostic-empty {
  padding: 8px 2px;
  color: var(--muted);
}

.diagnostic-event {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}

.diagnostic-event header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}

.diagnostic-event h3 {
  margin-top: 4px;
  font-size: 1.1rem;
}

.diagnostic-event-status {
  padding: 6px 9px;
  border-radius: 999px;
  background: var(--surface-strong);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 700;
}

.diagnostic-event-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(142px, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.diagnostic-event-actions .button {
  width: 100%;
}

@keyframes panelIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.992);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes fadeUpSoft {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes questionIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes choicePulse {
  0% {
    box-shadow: 0 0 0 0 rgba(31, 143, 104, 0.28);
  }
  100% {
    box-shadow: 0 0 0 10px transparent;
  }
}

@keyframes progressSweep {
  0%,
  32% {
    transform: translateX(-100%);
  }
  70%,
  100% {
    transform: translateX(100%);
  }
}

@keyframes invalidNudge {
  0%,
  100% {
    transform: translateX(0);
  }
  35% {
    transform: translateX(-3px);
  }
  70% {
    transform: translateX(3px);
  }
}

@keyframes processingSignal {
  0%,
  100% {
    opacity: 0.42;
    transform: translateX(-10px) rotate(-26deg);
  }
  50% {
    opacity: 1;
    transform: translateX(0) rotate(-26deg);
  }
}

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

@media (max-width: 1040px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    display: none;
  }

  .main {
    padding: 14px;
  }

  .mobile-summary {
    position: sticky;
    top: 5px;
    z-index: 10;
    display: grid;
    gap: 12px;
    margin-bottom: 14px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 12px 32px rgba(3, 18, 37, 0.08);
    backdrop-filter: blur(12px);
  }

  .welcome,
  .completion-grid,
  .diagnostics-hero,
  .diagnostics-workspace,
  .diagnostics-grid,
  .diagnostics-grid-two {
    grid-template-columns: 1fr;
  }

  .diagnostic-events {
    max-height: none;
  }

  .diagnostics-actions {
    justify-content: flex-start;
    max-width: none;
  }

  .welcome {
    min-height: 0;
  }

  .welcome-side {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .panel-body,
  .welcome-copy,
  .welcome-side {
    padding: 28px;
  }

  .nav-bar {
    padding: 16px 28px;
  }
}

@media (max-width: 760px) {
  body {
    font-size: 15px;
  }

  .welcome h1 {
    max-width: 11ch;
    font-size: 3rem;
  }

  .welcome.has-intake h1 {
    font-size: 2.65rem;
  }

  .screen-head h2,
  .completion-panel h2 {
    font-size: 2rem;
  }

  .lead {
    font-size: 1rem;
  }

  .options,
  .options.compact,
  .field-grid,
  .metric-grid,
  .diagnostic-metrics.compact {
    grid-template-columns: 1fr;
  }

  .question {
    padding: 18px;
  }

  .question legend {
    font-size: 1.22rem;
  }

  .nav-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .nav-actions,
  .actions {
    width: 100%;
  }

  .nav-actions .button,
  .actions .button,
  .diagnostics-actions .button {
    flex: 1 1 150px;
  }
}

@media (max-width: 460px) {
  .main {
    padding: 10px;
  }

  .panel-body,
  .welcome-copy,
  .welcome-side {
    padding: 22px;
  }

  .welcome h1 {
    font-size: 2.5rem;
  }

  .welcome.has-intake h1 {
    font-size: 2.35rem;
  }

  .brand img {
    width: 136px;
  }

  .brand.is-small img {
    width: 150px;
  }

  .button {
    width: 100%;
  }

  .diagnostics-shell {
    width: min(100% - 20px, 1320px);
    padding-top: 18px;
  }

  .diagnostics-hero,
  .diagnostic-card-head {
    align-items: stretch;
  }

  .diagnostic-card-head {
    flex-direction: column;
  }

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

/* Internal diagnostics gets its own operator-console layout so form styles do not leak into it. */
.diagnostics-console {
  width: min(100% - 40px, 1180px);
  gap: 18px;
  padding-top: 28px;
}

.diagnostics-console .diagnostics-hero {
  grid-template-columns: minmax(0, 1fr) auto;
  min-height: 0;
  padding: 24px;
  border-radius: 18px;
}

.diagnostics-console .diagnostics-hero img {
  width: 132px;
  margin-bottom: 18px;
}

.diagnostics-console .diagnostics-hero h1 {
  max-width: none;
  font-size: clamp(2.2rem, 4.2vw, 3.8rem);
}

.diagnostics-console .diagnostics-hero .lead {
  max-width: 760px;
}

.diagnostics-console .diagnostics-actions {
  align-items: center;
  justify-content: flex-end;
}

.diagnostics-console .button,
.diagnostics-console .diagnostics-actions .button {
  width: auto;
  min-width: 0;
  white-space: nowrap;
  overflow-wrap: normal;
  text-align: center;
}

.diagnostics-console .button.primary::after {
  flex: 0 0 auto;
}

.diagnostics-console p,
.diagnostics-console span,
.diagnostics-console strong,
.diagnostics-console button,
.diagnostics-console h2,
.diagnostics-console h3,
.diagnostics-console dt,
.diagnostics-console dd {
  overflow-wrap: normal;
  word-break: normal;
}

.diagnostics-console .diagnostics-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  gap: 18px;
  align-items: start;
}

.diagnostics-console .diagnostic-card {
  border-radius: 18px;
}

.diagnostics-console .diagnostic-events-card {
  display: flex !important;
  flex-direction: column !important;
  width: 100%;
  min-width: 0;
}

.diagnostics-console .diagnostic-card-head {
  display: flex !important;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 18px;
  width: 100%;
}

.diagnostics-console .diagnostic-card-head > div {
  flex: 1 1 auto;
  min-width: 0;
}

.diagnostics-console .diagnostic-card-head h2,
.diagnostics-console .diagnostic-card-title h2 {
  font-size: 1.35rem;
  line-height: 1.12;
}

.diagnostics-console .diagnostic-events {
  display: grid;
  grid-template-columns: minmax(0, 1fr) !important;
  align-items: stretch;
  gap: 12px;
  width: 100%;
  max-height: min(68vh, 720px);
  overflow: auto;
  padding: 16px;
}

.diagnostics-console .diagnostic-event {
  width: 100%;
  min-width: 0;
  padding: 16px;
  border-radius: 14px;
  background: #ffffff;
}

.diagnostics-console .diagnostic-event header {
  display: flex !important;
  gap: 12px;
  align-items: start;
  justify-content: space-between;
}

.diagnostics-console .diagnostic-event header > div {
  flex: 1 1 auto;
  min-width: 0;
}

.diagnostics-console .diagnostic-event h3 {
  font-size: 1rem;
}

.diagnostics-console .diagnostic-event-status,
.diagnostics-console .diagnostic-status {
  white-space: nowrap;
  overflow-wrap: normal;
}

.diagnostics-console .diagnostic-metrics.compact {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.diagnostics-console .diagnostic-metrics.compact div {
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-tint);
}

.diagnostics-console .diagnostic-metrics dd {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.diagnostics-console .diagnostic-event-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.diagnostics-console .diagnostic-event-actions .button {
  width: 100%;
  min-height: 34px;
  padding: 7px 8px;
  font-size: 0.78rem;
}

.diagnostics-console .diagnostics-tools {
  display: grid;
  gap: 18px;
}

.diagnostics-console .manual-card {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  padding: 18px;
}

.diagnostics-console .diagnostic-card-title {
  margin: 0;
}

.diagnostics-console .diag-textarea {
  width: 100%;
  min-height: 150px;
  resize: vertical;
  overflow-wrap: normal;
}

.diagnostics-console .manual-card pre {
  max-height: 170px;
  border-radius: 12px;
}

.diagnostics-console .diagnostics-actions.inline {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.diagnostics-console .diagnostics-actions.inline .button {
  width: 100%;
}

@media (max-width: 1100px) {
  .diagnostics-console .diagnostics-hero,
  .diagnostics-console .diagnostics-workspace {
    grid-template-columns: 1fr;
  }

  .diagnostics-console .diagnostics-actions {
    justify-content: flex-start;
  }

  .diagnostics-console .diagnostic-events {
    max-height: none;
  }
}

@media (max-width: 700px) {
  .diagnostics-console {
    width: min(100% - 20px, 1180px);
    padding-top: 16px;
  }

  .diagnostics-console .diagnostics-hero {
    padding: 18px;
  }

  .diagnostics-console .diagnostic-card-head,
  .diagnostics-console .diagnostic-event header,
  .diagnostics-console .diagnostic-metrics.compact,
  .diagnostics-console .diagnostic-event-actions,
  .diagnostics-console .diagnostics-actions.inline {
    grid-template-columns: 1fr;
  }

  .diagnostics-console .diagnostics-actions .button {
    flex: 1 1 160px;
  }
}
