:root {
  color-scheme: light;
  --bg: #ffffff;
  --bg-elevated: #f7f8f4;
  --panel: #ffffff;
  --panel-2: #f3f5f0;
  --line: #c9c9b9;
  --line-soft: #e2e4dc;
  --text: #23291d;
  --muted: #5d6853;
  --teal: #008872;
  --teal-deep: #017a6a;
  --blue: #2c7cdc;
  --orange: #f0a35b;
  --red: #ed746a;
  --white: #ffffff;
  --shadow: 0 18px 55px rgba(30, 38, 29, 0.12);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 1180px;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", sans-serif;
  color: var(--text);
  background:
    linear-gradient(rgba(0, 136, 114, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 136, 114, 0.03) 1px, transparent 1px),
    var(--bg);
  background-size: 42px 42px;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 12px;
  left: 12px;
  transform: translateY(-160%);
  padding: 10px 14px;
  border-radius: 6px;
  color: #07131b;
  background: var(--teal);
}

.skip-link:focus {
  transform: translateY(0);
}

.icon {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: 0 0 auto;
}

.eyebrow {
  display: block;
  color: var(--teal);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 13px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: transparent;
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 160ms ease, background-color 160ms ease, transform 160ms ease;
}

.button:hover {
  border-color: #7f7f6f;
  background: #f4f6f1;
}

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

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

.button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}

.button.primary {
  border-color: var(--teal);
  background: var(--teal);
  color: #ffffff;
}

.button.primary:hover {
  background: #00a48b;
}

.button.secondary {
  border-color: var(--blue);
  color: var(--teal);
}

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

.button.ghost:hover {
  border-color: var(--line);
  color: var(--text);
}

.button.large {
  min-height: 50px;
  padding: 0 22px;
}

.button.full {
  width: 100%;
}

.icon-button {
  width: 42px;
  padding: 0;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 99px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.badge.accent {
  border-color: rgba(0, 136, 114, 0.42);
  color: var(--teal);
  background: rgba(0, 136, 114, 0.08);
}

.badge.neutral {
  color: var(--muted);
}

.boot-view {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 40px;
  text-align: center;
  background: #ffffff;
}

.boot-mark {
  display: grid;
  place-items: center;
  width: 68px;
  height: 68px;
  margin-bottom: 24px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--teal);
  background: var(--panel);
}

.boot-mark .icon {
  width: 34px;
  height: 34px;
}

.boot-view h1 {
  margin: 12px 0 8px;
  font-size: 30px;
}

.boot-view p {
  margin: 0;
  color: var(--muted);
}

.boot-progress {
  width: 210px;
  height: 3px;
  margin-top: 26px;
  overflow: hidden;
  border-radius: 99px;
  background: #e2e4dc;
}

.boot-progress i {
  display: block;
  width: 45%;
  height: 100%;
  background: var(--teal);
  animation: boot-slide 1.1s ease-in-out infinite alternate;
}

@keyframes boot-slide {
  from {
    transform: translateX(-30%);
  }

  to {
    transform: translateX(145%);
  }
}

form label {
  display: block;
  margin: 17px 0 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f7f8f4;
  color: var(--text);
  padding: 10px 12px;
}

textarea {
  min-height: 92px;
  resize: vertical;
  line-height: 1.65;
}

.inline-message {
  margin-top: 16px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--muted);
  background: #f7f8f4;
  font-size: 13px;
  line-height: 1.65;
}

.inline-message.error {
  border-color: rgba(237, 116, 106, 0.45);
  color: #ffb6b0;
  background: rgba(237, 116, 106, 0.06);
}

.inline-message.success {
  border-color: rgba(69, 208, 190, 0.45);
  color: var(--teal);
  background: #eef7f5;
}

.app-view {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 66px;
  padding: 0 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(16px);
}

.brand-button {
  display: flex;
  align-items: center;
  gap: 12px;
  width: max-content;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.brand-button .icon {
  width: 28px;
  height: 28px;
  color: var(--teal);
}

.brand-button span {
  display: flex;
  flex-direction: column;
}

.brand-button strong {
  font-size: 14px;
}

.brand-button small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.topbar-center {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 12px;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 0 4px rgba(69, 208, 190, 0.1);
}

.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 36px;
  margin-left: 4px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
}

.user-chip .icon {
  width: 16px;
  height: 16px;
}

#mainContent {
  padding: 0 28px 46px;
}

.home-view {
  max-width: 1500px;
  margin: 0 auto;
  padding-top: 34px;
}

.home-hero {
  display: grid;
  grid-template-columns: minmax(500px, 0.85fr) minmax(580px, 1.15fr);
  align-items: center;
  gap: 32px;
  min-height: calc(100vh - 150px);
}

.home-copy {
  padding: 24px 0 44px;
}

.home-copy h1 {
  max-width: 850px;
  margin: 18px 0 24px;
  font-size: 48px;
  line-height: 1.18;
  letter-spacing: 0;
}

.home-copy > p {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.8;
}

.home-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 30px;
}

.home-metrics {
  display: flex;
  gap: 30px;
  margin-top: 32px;
  color: var(--muted);
  font-size: 12px;
}

.home-metrics strong {
  margin-right: 4px;
  color: var(--text);
  font-size: 20px;
}

.home-visual {
  position: relative;
  align-self: stretch;
  min-height: 520px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
}

.aircraft-map {
  position: absolute;
  inset: 18px 18px 55px;
}

.aircraft-photo {
  display: block;
  width: 100%;
  height: 100%;
  min-width: 0;
}

.callout path {
  fill: none;
  stroke: #008f7c;
  stroke-width: 1.7;
  stroke-dasharray: 4 4;
}

.callout circle {
  fill: #e5f6f2;
  stroke: #008f7c;
  stroke-width: 2.5;
}

.callout text {
  fill: #00695c;
  font-size: 17px;
  font-weight: 700;
}

.photo-frame {
  fill: #ffffff;
  stroke: #00917e;
  stroke-width: 2;
}

.home-visual-caption {
  position: absolute;
  right: 18px;
  bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-left: 14px;
  border-left: 2px solid var(--orange);
  text-align: right;
}

.home-visual-caption span {
  color: var(--muted);
  font-size: 11px;
}

.home-visual-caption strong {
  color: var(--orange);
  font-size: 10px;
  letter-spacing: 0.12em;
}

.basic-view {
  max-width: 1880px;
  margin: 0 auto;
  padding-top: 24px;
}

.basic-topline {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.basic-topline > :last-child {
  justify-self: end;
}

.basic-title {
  text-align: center;
}

.basic-title h1 {
  margin: 6px 0 5px;
  font-size: 30px;
}

.basic-title p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.basic-lab-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 300px;
  gap: 14px;
  margin-top: 16px;
}

.basic-column {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.basic-panel,
.basic-controls {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  overflow: hidden;
}

.basic-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 43px;
  padding: 0 13px;
  border-bottom: 1px solid var(--line);
  background: #102530;
  color: var(--muted);
  font-size: 11px;
}

.basic-panel-head div {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.basic-panel-head strong {
  color: var(--text);
  font-size: 13px;
}

.basic-panel-head div span {
  color: #718b97;
  font-size: 10px;
}

.basic-panel canvas {
  display: block;
  width: 100%;
  height: auto;
  background: #0b1a22;
}

.basic-readout {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 16px;
  min-height: 38px;
  padding: 9px 13px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.basic-readout b {
  color: var(--teal);
}

.basic-controls {
  padding: 18px;
}

.basic-control-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line-soft);
}

.basic-control-heading h2 {
  margin: 7px 0 0;
  font-size: 20px;
}

.basic-control-group {
  margin-top: 14px;
}

.basic-control-group label {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

.basic-control-group output {
  color: var(--teal);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.basic-control-group input[type="range"] {
  min-height: 24px;
  padding: 0;
}

.basic-control-group select {
  margin-top: 7px;
  min-height: 38px;
}

.basic-button-grid {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.basic-button-grid.two {
  grid-template-columns: 1fr 1fr;
}

.basic-button-grid .button,
.basic-controls > .button {
  min-height: 36px;
  padding: 0 9px;
  font-size: 11px;
}

.basic-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 13px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line-soft);
  color: var(--muted);
  font-size: 10px;
}

.basic-legend strong {
  width: 100%;
  color: var(--text);
  font-size: 11px;
}

.basic-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.basic-legend i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.legend-hole {
  background: #ed746a;
}

.legend-delam {
  background: #f0a35b;
  border-radius: 2px !important;
}

.legend-inclusion {
  background: #d9ad63;
}

.legend-wrinkle {
  background: transparent;
  border-top: 2px solid #ed746a;
  border-radius: 0 !important;
}

.basic-steps-dialog {
  width: min(920px, calc(100vw - 40px));
  max-height: calc(100vh - 40px);
  overflow: auto;
}

.basic-steps-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 24px;
  padding: 10px 24px 26px;
}

.basic-step-group {
  padding: 14px 0;
  border-bottom: 1px solid var(--line-soft);
}

.basic-step-group h3 {
  margin: 0 0 8px;
  color: var(--teal);
  font-size: 14px;
}

.basic-step-item {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 9px;
  padding: 5px 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.basic-step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--teal);
  font-size: 10px;
}

.dashboard-view {
  max-width: 1500px;
  margin: 0 auto;
  padding-top: 50px;
}

.dashboard-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 30px;
  padding-bottom: 26px;
  border-bottom: 1px solid var(--line);
}

.dashboard-heading h1 {
  margin: 12px 0 9px;
  font-size: 42px;
  letter-spacing: 0;
}

.dashboard-heading p {
  max-width: 800px;
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 28px;
  margin-top: 30px;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 17px;
}

.section-heading h2 {
  margin: 7px 0 0;
  font-size: 22px;
}

.section-heading.compact {
  margin-bottom: 12px;
}

.zone-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--line);
}

.zone-item {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 13px;
  min-height: 146px;
  padding: 22px;
  background: var(--panel);
}

.zone-index {
  color: var(--teal);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.zone-item h3 {
  margin: 0 0 8px;
  font-size: 19px;
}

.zone-item p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.zone-method {
  grid-column: 2;
  align-self: end;
  color: #c5d3d8;
  font-size: 12px;
}

.history-section {
  margin-top: 32px;
}

.history-list {
  border-top: 1px solid var(--line);
}

.history-item {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 24px;
  align-items: center;
  padding: 15px 4px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--muted);
  font-size: 13px;
}

.history-item strong {
  color: var(--text);
}

.dashboard-side {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.progress-summary,
.info-panel,
.step-card,
.ai-panel {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
}

.progress-summary h2 {
  margin: 8px 0 24px;
}

.progress-ring {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 156px;
  height: 156px;
  margin: 0 auto 24px;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, var(--panel) 54%, transparent 55%),
    conic-gradient(var(--teal) var(--progress, 0%), #203b46 0);
}

.progress-ring strong {
  font-size: 34px;
}

.progress-ring span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 0;
  border-top: 1px solid var(--line-soft);
  color: var(--muted);
  font-size: 13px;
}

.summary-row strong {
  color: var(--text);
  font-weight: 600;
  text-align: right;
}

.metric-bar {
  margin-top: 15px;
}

.metric-bar span {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
}

.metric-bar b {
  color: var(--text);
  font-size: 16px;
}

.metric-bar div {
  height: 5px;
  margin-top: 10px;
  overflow: hidden;
  border-radius: 99px;
  background: #203b46;
}

.metric-bar i {
  display: block;
  height: 100%;
  background: var(--teal);
}

.metric-bar:last-of-type i {
  background: var(--orange);
}

.metric-bar i.value-60 {
  width: 60%;
}

.metric-bar i.value-40 {
  width: 40%;
}

.admin-view {
  margin-top: 32px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.admin-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  overflow: hidden;
  margin-bottom: 22px;
  border: 1px solid var(--line);
  background: var(--line);
}

.admin-summary div {
  padding: 18px;
  background: var(--panel-2);
}

.admin-summary span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.admin-summary strong {
  display: block;
  margin-top: 7px;
  font-size: 26px;
}

.data-table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.data-table th,
.data-table td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
  white-space: nowrap;
}

.data-table th {
  color: var(--muted);
  background: #0e202a;
}

.simulator-view {
  height: auto;
  min-height: 760px;
}

.sim-topline {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 66px;
  border-bottom: 1px solid var(--line);
}

.sim-title {
  text-align: center;
}

.sim-title strong {
  display: block;
  margin-top: 4px;
  font-size: 17px;
}

.sim-progress {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
}

.linear-progress {
  width: 170px;
  height: 5px;
  overflow: hidden;
  border-radius: 99px;
  background: #203b46;
}

.linear-progress i {
  display: block;
  width: 3%;
  height: 100%;
  background: var(--teal);
  transition: width 240ms ease;
}

.sim-grid {
  display: grid;
  grid-template-columns: minmax(660px, 1fr) 370px;
  align-items: start;
  min-height: calc(100vh - 132px);
}

.task-rail {
  overflow: hidden;
  border-right: 1px solid var(--line);
  background: #fafafa;
}

.rail-heading {
  padding: 20px 18px 12px;
}

.rail-heading h2 {
  margin: 7px 0 0;
  font-size: 20px;
}

.step-list {
  height: calc(100% - 82px);
  overflow-y: auto;
  padding: 4px 10px 20px;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}

.step-list-item {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 9px;
  align-items: start;
  width: 100%;
  min-height: 50px;
  padding: 10px 8px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  text-align: left;
  cursor: default;
}

.step-list-item.current {
  border-color: rgba(69, 208, 190, 0.45);
  background: rgba(69, 208, 190, 0.08);
  color: var(--text);
}

.step-list-item.done {
  color: #b9c8ce;
}

.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border: 1px solid var(--line);
  border-radius: 50%;
  font-size: 10px;
  font-weight: 700;
}

.step-list-item.current .step-number {
  border-color: var(--teal);
  color: var(--teal);
}

.step-list-item.done .step-number {
  border-color: rgba(69, 208, 190, 0.5);
  background: rgba(69, 208, 190, 0.14);
  color: var(--teal);
}

.step-list-item strong {
  display: block;
  color: inherit;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.45;
}

.step-list-item small {
  display: block;
  margin-top: 4px;
  color: #78919d;
  font-size: 10px;
}

.visual-workbench {
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 66px;
  height: calc(100vh - 132px);
  min-height: 680px;
  min-width: 0;
  padding: 16px 18px;
  overflow: hidden;
}

.workbench-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 42px;
}

.module-selector {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.module-selector-label {
  flex: 0 0 auto;
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
}

.segmented {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f3f5f0;
}

.segmented button {
  min-width: 64px;
  height: 32px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
}

.segmented button.active {
  background: var(--teal);
  color: #ffffff;
  font-weight: 700;
}

.workbench-state {
  display: flex;
  gap: 16px;
  color: var(--muted);
  font-size: 11px;
}

.canvas-shell {
  position: relative;
  flex: 1;
  min-height: 410px;
  margin-top: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
}

#simCanvas {
  display: block;
  width: 100%;
  height: 100%;
}

.canvas-shell.drag-enabled #simCanvas {
  cursor: crosshair;
}

.canvas-hint {
  position: absolute;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--muted);
  font-size: 11px;
  pointer-events: none;
}

.signal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  height: 210px;
  margin-top: 12px;
}

.signal-panel {
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
}

.signal-heading {
  display: flex;
  justify-content: space-between;
  color: var(--teal);
  font-size: 11px;
  font-weight: 700;
}

.signal-heading b {
  color: var(--muted);
}

.signal-panel canvas {
  display: block;
  width: 100%;
  height: 170px;
}

.control-rail {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  padding: 16px;
  border-left: 1px solid var(--line-soft);
  background: #f5f7f3;
}

.step-card {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: visible;
}

.step-meta,
.ai-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.step-meta > span:last-child {
  color: var(--muted);
  font-size: 11px;
}

.step-card h2,
.ai-panel h2 {
  margin: 14px 0 9px;
  font-size: 22px;
  line-height: 1.35;
}

.step-card > p {
  min-height: 44px;
  margin: 0 0 17px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

#stepForm {
  min-height: 0;
  overflow: visible;
}

.step-actions {
  flex: 0 0 auto;
  padding-top: 8px;
}

.step-actions:empty {
  display: none;
}

.step-actions .control-group {
  margin-bottom: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--line-soft);
}

.step-actions .inline-message {
  margin-top: 8px;
}

.step-nav-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  flex: 0 0 auto;
  margin-top: 8px;
}

.step-nav-row .button {
  min-height: 34px;
  padding: 0 10px;
  font-size: 11px;
}

.restart-step-button {
  flex: 0 0 auto;
  min-height: 34px;
  margin-top: 8px;
  font-size: 11px;
}

.control-group {
  margin-bottom: 14px;
}

.control-group label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 7px;
  color: var(--muted);
  font-size: 12px;
}

.control-group output {
  color: var(--text);
  font-weight: 700;
}

.control-group input[type="range"] {
  min-height: 28px;
  padding: 0;
  accent-color: var(--teal);
}

.control-group > .button.full {
  margin-top: 8px;
}

.control-group > .inline-message {
  margin-top: 8px;
}

.scan-controls {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
}

.coverage-readout {
  min-width: 80px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--teal);
  text-align: center;
  font-size: 14px;
  font-weight: 700;
}

.scan-controls .button {
  grid-column: 1 / -1;
}

.scan-drag-hint {
  line-height: 1.45;
}

.ai-panel {
  flex: 0 0 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.agent-guide {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  margin-top: 0;
}

.agent-avatar {
  display: block;
  width: 58px;
  height: 58px;
}

.agent-speech {
  position: relative;
  padding: 10px 12px;
  border: 1px solid #9bcfc7;
  border-radius: 8px;
  background: #eff9f6;
}

.agent-speech::before {
  position: absolute;
  top: 20px;
  left: -6px;
  width: 10px;
  height: 10px;
  border-bottom: 1px solid #9bcfc7;
  border-left: 1px solid #9bcfc7;
  background: #eff9f6;
  content: "";
  transform: rotate(45deg);
}

.agent-speech strong {
  display: block;
  margin-bottom: 3px;
  color: var(--teal);
  font-size: 10px;
}

.agent-speech p {
  margin: 0;
  color: var(--text);
  font-size: 11px;
  line-height: 1.55;
}

.ai-conversation {
  flex: 1;
  min-height: 110px;
  max-height: 210px;
  margin: 6px 0 10px;
  overflow-y: auto;
}

.ai-message {
  margin: 8px 0;
  padding: 10px 12px;
  border-left: 2px solid var(--teal);
  background: #eef7f5;
  color: var(--text);
  font-size: 12px;
  line-height: 1.65;
}

.ai-message.user {
  border-left-color: var(--blue);
  background: #eef4fb;
}

.ai-message p {
  margin: 0;
}

.ai-citations {
  margin-top: 7px;
  color: #7f9ba6;
  font-size: 10px;
}

.ai-adopt {
  margin-top: 7px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--teal);
  font-size: 10px;
  cursor: pointer;
}

.ai-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ai-suggestions button {
  min-height: 26px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: transparent;
  color: var(--muted);
  font-size: 10px;
  cursor: pointer;
}

.ai-input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  gap: 6px;
  margin-top: 10px;
}

.ai-input-row input {
  min-height: 38px;
}

.ai-input-row .button {
  min-height: 38px;
}

.dialog {
  width: min(640px, calc(100vw - 32px));
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  color: var(--text);
  box-shadow: var(--shadow);
}

.dialog::backdrop {
  background: rgba(2, 8, 12, 0.78);
  backdrop-filter: blur(6px);
}

.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 22px;
  border-bottom: 1px solid var(--line);
}

.dialog-head h2 {
  margin: 7px 0 0;
}

.dialog-body {
  padding: 22px;
  color: var(--muted);
  line-height: 1.8;
}

.dialog-list {
  margin: 8px 0 0;
  padding-left: 18px;
  color: var(--warn, #f0a35b);
}

.guide-video {
  display: block;
  width: 100%;
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #06131a;
}

.completion-dialog {
  width: min(760px, calc(100vw - 32px));
}

.completion-body {
  padding: 32px;
  text-align: center;
}

.completion-body h2 {
  margin: 10px 0 8px;
  font-size: 32px;
}

.completion-score strong {
  font-size: 58px;
}

.completion-score span {
  color: var(--muted);
}

.radar-wrap {
  display: flex;
  justify-content: center;
}

#radarCanvas {
  width: 360px;
  height: 300px;
}

.dialog-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 16px;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 50;
  max-width: 420px;
  padding: 13px 16px;
  border: 1px solid rgba(69, 208, 190, 0.45);
  border-radius: 7px;
  background: #0d242d;
  color: var(--text);
  box-shadow: var(--shadow);
  font-size: 13px;
}

.toast.error {
  border-color: rgba(237, 116, 106, 0.55);
}

.completion-note {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  text-align: left;
}

.password-form {
  margin: 0;
}

.password-form .dialog-body > label {
  margin-top: 14px;
}

.password-form .dialog-body > .button {
  margin-top: 20px;
}

@media (max-width: 1320px) {
  html {
    min-width: 1180px;
  }

  .sim-grid {
    grid-template-columns: minmax(620px, 1fr) 350px;
  }

}

@media (max-height: 840px) {
  .canvas-shell {
    min-height: 340px;
  }

  .signal-grid {
    height: 180px;
  }

  .signal-panel canvas {
    height: 140px;
  }
}


.range-input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 92px;
  align-items: center;
  gap: 8px;
}

.range-input-row input[type='range'] {
  min-height: 28px;
  padding: 0;
  accent-color: var(--teal);
}

.range-number {
  min-height: 38px;
  text-align: center;
  font-variant-numeric: tabular-nums;
  color: var(--teal);
}

