:root {
  --page: #eef1f5;
  --paper: #ffffff;
  --paper-soft: #f7f8fa;
  --ink: #191b24;
  --text: #444958;
  --muted: #717887;
  --faint: #9aa1ae;
  --line: #dfe3e9;
  --line-strong: #cbd1da;
  --brand-core: #6864e3;
  --brand-deep: #5956e9;
  --brand-soft: #efeffd;
  --screen-brand-light: #a9a6ff;
  --screen-brand-glow: #8e87f4;
  --screen-brand-soft: #cbc9ff;
  --amber: #ffbf5a;
  --green: #58d998;
  --red: #ff7182;
  --screen: #060b21;
  --screen-panel: #101a35;
  --screen-line: #26375b;
  --shadow: 0 14px 40px rgba(35, 40, 56, 0.09);
  --font-ui: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  --font-numeric: "DIN Alternate", "SF Pro Display", "Helvetica Neue", sans-serif;
  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --control-height: 36px;
  --control-radius: 6px;
  --card-radius: 8px;
  --motion-fast: 160ms;
  --motion-normal: 240ms;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--page);
  font-family: var(--font-ui);
  letter-spacing: 0;
}

button,
input,
select {
  font: inherit;
  letter-spacing: 0;
}

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

button:focus-visible,
a:focus-visible,
select:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(104, 100, 227, 0.28);
  outline-offset: 2px;
}

a {
  color: inherit;
  text-decoration: none;
}

.doc-shell {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  min-height: 100vh;
}

.doc-rail {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 100vh;
  padding: 20px 16px;
  overflow-y: auto;
  border-right: 1px solid var(--line);
  background: #fafbfc;
}

.rail-brand {
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 11px;
  align-items: center;
  padding: 0 8px 19px;
  border-bottom: 1px solid var(--line);
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  color: #fff;
  border-radius: 7px;
  background: var(--brand-core);
  font-size: 17px;
  font-weight: 800;
}

.rail-brand strong,
.rail-brand small {
  display: block;
}

.edition-switch {
  margin: 14px 8px 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}

.edition-switch > span {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 700;
}

.edition-switch .segmented { display: grid; grid-template-columns: repeat(2, 1fr); gap: 3px; }
.edition-switch button { min-height: 28px; border: 0; border-radius: 4px; color: var(--muted); background: #f4f5f8; font-size: 10px; font-weight: 700; cursor: pointer; }
.edition-switch button.is-active { color: #fff; background: var(--brand-core); }

body[data-edition="launch"] [data-full-only] { display: none !important; }

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

.rail-brand small {
  margin-top: 4px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9px;
}

.section-nav {
  display: grid;
  gap: 2px;
  margin-top: 16px;
}

.section-nav a {
  min-height: 37px;
  padding: 0 9px;
  display: flex;
  align-items: center;
  gap: 11px;
  border-left: 3px solid transparent;
  color: #59606f;
  font-size: 12px;
  transition: color 160ms ease, background 160ms ease, border-color 160ms ease;
}

.section-nav a span {
  color: #9aa1ae;
  font-family: var(--font-mono);
  font-size: 9px;
}

.section-nav a:hover {
  color: var(--ink);
  background: #f1f3f6;
}

.section-nav a.is-active {
  color: var(--brand-core);
  border-left-color: var(--brand-core);
  background: var(--brand-soft);
  font-weight: 700;
}

.section-nav a.is-active span {
  color: var(--brand-core);
}

.rail-facts {
  margin-top: 22px;
  padding: 14px 10px;
  display: grid;
  gap: 10px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
}

.rail-facts span {
  display: flex;
  align-items: center;
  gap: 8px;
}

.rail-facts svg {
  width: 13px;
  height: 13px;
  color: var(--brand-core);
}

.doc-frame {
  min-width: 0;
}

.doc-header {
  position: sticky;
  top: 0;
  z-index: 15;
  height: 64px;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(14px);
}

.doc-header strong,
.doc-header span {
  display: block;
}

.doc-header strong {
  font-size: 14px;
}

.doc-header > div:first-child span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
}

.header-status {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 10px;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #26b779;
  box-shadow: 0 0 0 4px rgba(38, 183, 121, 0.12);
}

.icon-button,
.primary-play {
  width: 36px;
  height: 36px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  color: #3e4351;
  background: #fff;
  cursor: pointer;
  transition: transform 140ms ease, border-color 140ms ease, color 140ms ease;
}

.icon-button:hover {
  color: var(--brand-core);
  border-color: #aaa6ee;
}

.icon-button:active,
.primary-play:active {
  transform: scale(0.95);
}

.icon-button svg,
.primary-play svg {
  width: 16px;
  height: 16px;
}

.primary-play {
  width: 44px;
  height: 44px;
  color: #fff;
  border-color: #1b1e27;
  border-radius: 50%;
  background: #1b1e27;
}

main {
  min-width: 0;
}

.doc-section {
  padding: 58px clamp(24px, 3.4vw, 54px) 64px;
  scroll-margin-top: 64px;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}

.doc-section:nth-child(even) {
  background: var(--paper-soft);
}

.section-kicker {
  color: var(--brand-core);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
}

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

.section-heading h2 {
  margin: 8px 0 8px;
  font-size: 28px;
  line-height: 1.25;
}

.section-heading p {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.75;
}

.overview-section {
  padding-top: 48px;
}

.overview-grid {
  margin-top: 14px;
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(300px, 0.6fr);
  gap: 26px;
}

.overview-copy {
  padding: 36px 0 12px;
}

.scope-label {
  margin: 0 0 12px;
  color: var(--brand-core);
  font-size: 12px;
  font-weight: 700;
}

.overview-copy h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(36px, 4.2vw, 62px);
  line-height: 1.08;
  font-weight: 780;
}

.overview-lead {
  max-width: 760px;
  margin: 22px 0 0;
  color: var(--text);
  font-size: 17px;
  line-height: 1.8;
}

.principle-strip {
  margin-top: 34px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.principle-strip div {
  min-height: 100px;
  padding: 18px 14px;
  display: grid;
  grid-template-columns: 22px 1fr;
  align-content: center;
  gap: 7px 9px;
  border-right: 1px solid var(--line);
}

.principle-strip div:last-child {
  border-right: 0;
}

.principle-strip svg {
  width: 18px;
  height: 18px;
  color: var(--brand-core);
}

.principle-strip b {
  font-size: 15px;
}

.principle-strip span {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 10px;
}

.boundary-panel {
  align-self: stretch;
  padding: 22px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #f8f9fb;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 700;
}

.boundary-panel dl {
  margin: 18px 0 0;
}

.boundary-panel dl div {
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.boundary-panel dt {
  color: var(--brand-core);
  font-size: 10px;
  font-weight: 700;
}

.boundary-panel dd {
  margin: 6px 0 0;
  color: var(--text);
  font-size: 12px;
  line-height: 1.7;
}

.maturity-tag {
  min-height: 23px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  border: 1px solid transparent;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 700;
  white-space: nowrap;
}

.maturity-tag.confirmed {
  color: #117456;
  border-color: #b7e5d3;
  background: #ebf8f3;
}

.maturity-tag.proposed {
  color: #514bc8;
  border-color: #cfccf6;
  background: #f0effd;
}

.maturity-tag.pending {
  color: #98600d;
  border-color: #efd4a6;
  background: #fff7e9;
}

.maturity-legend {
  margin-top: 28px;
  padding: 14px 0;
  display: grid;
  grid-template-columns: auto 1fr auto 1fr auto 1fr;
  align-items: center;
  gap: 8px 12px;
  border-top: 1px solid var(--line);
}

.maturity-legend p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
}

.demo-badge,
.atlas-count {
  color: #9a5d0a;
  font-size: 10px;
  font-weight: 700;
}

.demo-badge {
  padding: 7px 9px;
  border: 1px solid #edcf9d;
  border-radius: 5px;
  background: #fff7e9;
}

.workbench-toolbar {
  padding: 14px;
  display: grid;
  grid-template-columns: minmax(220px, 0.85fr) minmax(170px, 1fr) minmax(170px, 1fr) auto 110px 100px;
  gap: 10px;
  border: 1px solid var(--line-strong);
  border-bottom: 0;
  background: #f5f6f8;
}

.workbench-toolbar label,
.segmented {
  min-width: 0;
}

.workbench-toolbar label:first-child {
  min-width: 210px;
}

.workbench-toolbar label > span,
.segmented > span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
}

.workbench-toolbar select {
  width: 100%;
  height: 36px;
  padding: 0 28px 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  color: var(--ink);
  background: #fff;
}

.segmented div {
  display: flex;
}

.segmented button {
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  color: var(--muted);
  background: #fff;
  cursor: pointer;
}

.segmented button:first-of-type {
  border-radius: 5px 0 0 5px;
}

.segmented button:last-child {
  margin-left: -1px;
  border-radius: 0 5px 5px 0;
}

.segmented button.is-active {
  z-index: 1;
  color: var(--brand-core);
  border-color: var(--brand-core);
  background: var(--brand-soft);
  font-weight: 700;
}

.workbench-stage {
  min-height: 540px;
  display: grid;
  grid-template-columns: minmax(320px, 0.78fr) minmax(420px, 1.3fr) 248px;
  align-items: stretch;
  border: 1px solid var(--line-strong);
  background: #eef1f5;
}

.robot-context {
  position: relative;
  min-height: 510px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-right: 1px solid var(--line);
  background-image:
    linear-gradient(rgba(122, 130, 146, 0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(122, 130, 146, 0.1) 1px, transparent 1px);
  background-size: 24px 24px;
}

.robot-figure {
  position: relative;
  width: min(38vh, 350px);
  min-width: 300px;
  margin: 0;
}

.robot-crop {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  filter: drop-shadow(0 20px 18px rgba(32, 37, 51, 0.14));
}

.robot-crop > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
}

.robot-crop.is-device-image-loading > img {
  opacity: 0.35;
}

.robot-crop.is-device-image-error > img {
  visibility: hidden;
}

.robot-crop.is-device-image-error::before {
  content: "设备正视图暂未加载";
  position: absolute;
  inset: 20%;
  display: grid;
  place-items: center;
  color: var(--muted);
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  font-size: 11px;
}

.robot-screen-slot {
  position: absolute;
  top: 27.6%;
  left: 37%;
  width: 25%;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  border: 1px solid #000;
  border-radius: 4%;
  background: var(--screen);
  box-shadow: 0 0 0 3px #000;
}

.robot-crop[data-device-model="v1"] .robot-screen-slot {
  border-radius: 16% / 22%;
  clip-path: inset(0 round 16% / 22%);
}

.terminal-screen-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 480px;
  height: 320px;
  transform-origin: top left;
}

.robot-figure figcaption {
  min-height: 24px;
  margin-top: -8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: var(--muted);
  font-size: 9px;
}

.robot-figure figcaption i {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--brand-core);
}

.speech-bubble {
  position: absolute;
  z-index: 5;
  width: 190px;
  padding: 13px 14px;
  border: 1px solid #c8c5f4;
  border-radius: 7px;
  background: #f2f1ff;
  box-shadow: var(--shadow);
}

.speech-bubble::before {
  content: "";
  position: absolute;
  top: 44px;
  width: 12px;
  height: 12px;
  background: inherit;
  transform: rotate(45deg);
}

.user-bubble {
  top: 318px;
  right: 16px;
  border-color: #cfd4de;
  background: #fff;
}

.user-bubble::before {
  left: -7px;
  border-bottom: 1px solid #cfd4de;
  border-left: 1px solid #cfd4de;
}

.fubao-bubble {
  top: 318px;
  left: 16px;
}

.fubao-bubble::before {
  right: -7px;
  border-top: 1px solid #c8c5f4;
  border-right: 1px solid #c8c5f4;
}

.speech-bubble span {
  color: #5f5a9b;
  font-size: 9px;
  font-weight: 700;
}

.speech-bubble span b {
  margin-right: 4px;
  padding: 2px 4px;
  color: #fff;
  border-radius: 3px;
  background: var(--brand-core);
}

.speech-bubble p {
  margin: 8px 0 0;
  color: #292c38;
  font-size: 11px;
  line-height: 1.65;
}

.speech-bubble small {
  margin-top: 9px;
  display: block;
  color: var(--brand-core);
  font-size: 8px;
}

.screen-inspection,
.scenario-explainer {
  background: #fff;
}

.screen-inspection {
  padding: 18px 16px;
  border-right: 1px solid var(--line);
}

.inspection-head {
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.inspection-head strong,
.inspection-head span {
  display: block;
}

.inspection-head strong {
  font-size: 11px;
}

.inspection-head div span {
  margin-top: 4px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 8px;
}

.screen-inspector {
  width: 420px;
  height: 280px;
  overflow: hidden;
  border: 1px solid #27304a;
  border-radius: 7px;
  background: var(--screen);
  box-shadow: 0 10px 28px rgba(6, 11, 33, 0.2);
}

.screen-inspector > .terminal-ui,
.screen-inspector > .home-atlas-ui {
  transform: scale(var(--inspector-scale, 1));
  transform-origin: top left;
}

.device-baseline-strip {
  margin-bottom: 24px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border: 1px solid var(--line-strong);
  background: #fff;
}

.device-baseline-strip article {
  min-width: 0;
  padding: 16px 18px;
}

.device-baseline-strip article + article {
  border-left: 1px solid var(--line);
}

.device-baseline-strip span {
  display: block;
  color: var(--brand-deep);
  font-size: 9px;
  font-weight: 800;
}

.device-baseline-strip strong {
  margin-top: 5px;
  display: block;
  font-size: 14px;
}

.device-baseline-strip p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.6;
}

.screen-meta {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.home-demo-sandbox {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: #f8f8fd;
}

.home-demo-heading { display: flex; align-items: center; gap: 8px; }
.home-demo-heading > span { color: var(--brand-core); font-family: var(--font-mono); font-size: 8px; font-weight: 700; }
.home-demo-heading > b { font-size: 12px; }
.home-demo-heading > em { margin-left: auto; padding: 3px 6px; border-radius: 4px; color: #397b60; background: #e7f8ef; font-size: 8px; font-style: normal; font-weight: 700; }
.home-demo-sandbox > p { margin: 7px 0 10px; color: var(--muted); font-size: 9px; line-height: 1.5; }
.home-demo-controls { display: flex; flex-wrap: wrap; gap: 6px; }
.home-demo-controls button { min-height: 28px; padding: 0 8px; border: 1px solid #c9c6f1; border-radius: 4px; color: #5652c9; background: #fff; font-size: 9px; font-weight: 700; cursor: pointer; }
.home-demo-controls button:first-child { color: #fff; border-color: var(--brand-core); background: var(--brand-core); }
.home-demo-path { margin-top: 10px; padding-top: 9px; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 7px; align-items: center; border-top: 1px solid var(--line); }
.home-demo-path span { color: var(--muted); font-size: 8px; }
.home-demo-path code { min-width: 0; overflow: hidden; color: var(--brand-deep); font-family: var(--font-mono); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.home-demo-path small { color: #397b60; font-size: 8px; white-space: nowrap; }

.screen-meta span {
  min-width: 0;
  padding: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--muted);
  font-size: 8px;
}

.screen-meta svg {
  width: 12px;
  height: 12px;
  color: var(--brand-core);
  flex: none;
}

.screen-meta b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.scenario-explainer {
  padding: 20px;
}

.explainer-kicker {
  color: var(--brand-core);
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 700;
}

.scenario-explainer h3 {
  margin: 10px 0;
  font-size: 19px;
}

.scenario-explainer > p {
  min-height: 66px;
  margin: 0;
  color: var(--text);
  font-size: 11px;
  line-height: 1.7;
}

.scenario-explainer dl {
  margin: 18px 0;
  border-top: 1px solid var(--line);
}

.scenario-explainer dl div {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.scenario-explainer dt {
  color: var(--muted);
  font-size: 8px;
}

.scenario-explainer dd {
  margin: 5px 0 0;
  overflow-wrap: anywhere;
  font-family: var(--font-mono);
  font-size: 9px;
  line-height: 1.5;
}

.text-button {
  min-height: 36px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid var(--brand-core);
  border-radius: 5px;
  color: var(--brand-core);
  background: #fff;
  cursor: pointer;
  font-size: 10px;
  font-weight: 700;
}

.text-button svg {
  width: 14px;
  height: 14px;
}

.timeline-panel {
  padding: 14px 16px;
  border: 1px solid var(--line-strong);
  border-top: 0;
  background: #fff;
}

.timeline-track {
  position: relative;
  min-height: 42px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.timeline-track::before {
  content: "";
  position: absolute;
  top: 8px;
  left: 6px;
  right: 6px;
  height: 2px;
  background: var(--line-strong);
}

.timeline-step {
  position: relative;
  z-index: 1;
  min-width: 68px;
  display: grid;
  justify-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 8px;
}

.timeline-step i {
  width: 16px;
  height: 16px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: #bcc2cb;
  box-shadow: 0 0 0 1px #aeb5c0;
}

.timeline-step.is-complete i,
.timeline-step.is-active i {
  background: var(--brand-core);
  box-shadow: 0 0 0 1px var(--brand-core);
}

.timeline-step.is-active {
  color: var(--brand-core);
  font-weight: 700;
}

.playback-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
}

.playback-row > span {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9px;
}

.playback-row > button {
  justify-self: end;
}

.playback-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.foundation-layout {
  display: grid;
  grid-template-columns: minmax(420px, 0.9fr) minmax(0, 1.1fr);
  gap: 28px;
  align-items: center;
}

.screen-anatomy {
  position: relative;
  min-height: 380px;
  padding: 42px 28px 46px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  background: #eef1f5;
}

.anatomy-screen {
  position: relative;
  width: min(480px, 100%);
  height: auto;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  box-sizing: border-box;
  border: 2px solid #2d385b;
  border-radius: 0;
  color: #eaf1ff;
  background: var(--screen);
  box-shadow: 0 14px 30px rgba(6, 11, 33, 0.2);
}

.anatomy-screen::before {
  content: "";
  position: absolute;
  top: 8.75%;
  right: 0;
  bottom: 0;
  left: 0;
  border: 1px dashed rgba(142, 135, 244, 0.45);
  pointer-events: none;
}

.safe-label {
  position: absolute;
  top: -26px;
  left: 0;
  color: #606878;
  font-family: var(--font-mono);
  font-size: 9px;
}

.anatomy-status-bar {
  position: relative;
  z-index: 1;
  height: 8.75%;
  padding: 0 2.5%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #f3f5ff;
  border-bottom: 1px solid #202a47;
  background: #0a132d;
  font-size: clamp(7px, 1.9cqw, 9px);
}

.anatomy-status-bar span {
  color: #cbd2e8;
  font-family: var(--font-mono);
  font-size: clamp(6px, 1.7cqw, 8px);
}

.anatomy-content-viewport {
  position: relative;
  z-index: 1;
  height: 91.25%;
  padding: 3.75% 5%;
  box-sizing: border-box;
  display: grid;
  grid-template-rows: 14.7% 1fr 21.9% 11%;
  gap: 2.7%;
}

.anatomy-title,
.anatomy-primary,
.anatomy-support,
.anatomy-footer {
  z-index: 1;
  padding: 1.7% 2.3%;
  border: 1px solid #26375b;
  background: #101a35;
  font-size: clamp(7px, 2.1cqw, 10px);
}

.anatomy-primary {
  display: grid;
  place-items: center;
  color: var(--screen-brand-light);
  font-size: clamp(15px, 4.6cqw, 22px);
  font-weight: 800;
}

.anatomy-footer {
  color: #94a2bd;
  font-size: clamp(6px, 1.7cqw, 8px);
}

.ruler {
  position: absolute;
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 8px;
}

.ruler.horizontal {
  left: 28px;
  right: 28px;
  bottom: 22px;
  padding-top: 7px;
  border-top: 1px solid #aeb5c0;
}

.ruler.vertical {
  top: 42px;
  bottom: 46px;
  left: 22px;
  flex-direction: column;
  padding-right: 7px;
  border-right: 1px solid #aeb5c0;
}

.token-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.token-grid article {
  position: relative;
  min-height: 126px;
  padding: 17px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.token-grid article span,
.token-grid article strong {
  display: block;
}

.token-grid article span {
  color: var(--muted);
  font-size: 9px;
}

.token-grid article strong {
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
}

.token-grid article p {
  max-width: 150px;
  margin: 12px 0 0;
  color: var(--text);
  font-size: 10px;
  line-height: 1.55;
}

.token-grid article em {
  position: absolute;
  right: 11px;
  bottom: 10px;
  color: #9a5d0a;
  font-size: 8px;
  font-style: normal;
}

.swatch {
  position: absolute;
  top: 17px;
  right: 17px;
  width: 22px;
  height: 22px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 4px;
}

.screen-bg { background: var(--screen); }
.brand-core { background: var(--brand-core); }
.brand-deep { background: var(--brand-deep); }
.brand-light { background: var(--screen-brand-light); }
.brand-glow { background: var(--screen-brand-glow); }
.amber { background: var(--amber); }
.green { background: var(--green); }
.red { background: var(--red); }

.rule-grid {
  margin-top: 26px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.rule-grid article {
  min-height: 150px;
  padding: 18px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.rule-grid small {
  color: var(--brand-core);
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 700;
}

.rule-grid h3 {
  margin: 9px 0;
  font-size: 14px;
  line-height: 1.45;
}

.rule-grid p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.7;
}

.compact-rules article {
  min-height: 128px;
}

.state-flow {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  border: 1px solid var(--line);
  background: #fff;
}

.state-node {
  position: relative;
  min-height: 150px;
  padding: 17px 13px;
  border-right: 1px solid var(--line);
}

.state-node:last-child {
  border-right: 0;
}

.state-node::after {
  content: "";
  position: absolute;
  top: 34px;
  right: -5px;
  z-index: 2;
  width: 9px;
  height: 9px;
  border-top: 2px solid var(--brand-core);
  border-right: 2px solid var(--brand-core);
  background: #fff;
  transform: rotate(45deg);
}

.state-node:last-child::after {
  display: none;
}

.state-node span {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  color: var(--brand-core);
  border: 1px solid #c9c6f1;
  border-radius: 5px;
  background: var(--brand-soft);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
}

.state-node b {
  display: block;
  margin-top: 15px;
  font-size: 12px;
}

.state-node p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.6;
}

.registry-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}

.registry-summary article {
  min-width: 0;
  padding: 18px;
  border-right: 1px solid var(--line);
}

.registry-summary article:last-child {
  border-right: 0;
}

.registry-summary small,
.qr-cloud-rule small {
  color: var(--brand-core);
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 700;
}

.registry-summary strong {
  display: block;
  margin-top: 8px;
  font-size: 27px;
  line-height: 1;
}

.registry-summary p,
.qr-cloud-rule p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.55;
}

.registry-runtime-flow {
  margin-top: 14px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f8f8fd;
}

.registry-runtime-flow > div {
  min-width: 180px;
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 2px 10px;
  align-items: center;
}

.registry-runtime-flow > div svg {
  width: 22px;
  color: var(--brand-core);
  grid-row: 1 / span 2;
}

.registry-runtime-flow > div b {
  font-size: 12px;
}

.registry-runtime-flow > div span {
  color: var(--muted);
  font-size: 9px;
  line-height: 1.45;
}

.registry-runtime-flow > svg {
  width: 18px;
  color: var(--line-strong);
}

.qr-cloud-rule {
  margin-top: 14px;
  padding: 17px 20px;
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 14px;
  align-items: start;
  border-left: 3px solid var(--brand-core);
  background: var(--brand-soft);
}

.qr-cloud-rule > svg {
  width: 30px;
  color: var(--brand-deep);
}

.qr-cloud-rule h3 {
  margin: 4px 0 0;
  font-size: 14px;
}

.registry-downloads {
  margin-top: 14px;
  display: flex;
  gap: 8px;
}

.registry-toolbar {
  position: sticky;
  top: 64px;
  z-index: 10;
  margin-top: 22px;
  padding: 12px 0;
  display: flex;
  align-items: end;
  gap: 14px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(12px);
}

.registry-filter {
  display: grid;
  gap: 4px;
}

.registry-filter span {
  color: var(--muted);
  font-size: 8px;
}

.registry-filter select {
  min-height: 34px;
  padding: 0 28px 0 9px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: #fff;
  font-size: 9px;
}

.registry-toolbar .search-field {
  margin-left: auto;
}

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

.template-registry-card {
  min-width: 0;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}

.template-registry-card > header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.template-registry-card > header code {
  color: var(--brand-core);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
}

.template-registry-card > header h3 {
  margin: 5px 0 0;
  font-size: 15px;
}

.template-registry-card > header > span {
  padding: 4px 7px;
  border-radius: 4px;
  color: var(--muted);
  background: #f0f2f5;
  font-size: 8px;
  white-space: nowrap;
}

.template-render-types {
  margin-top: 9px;
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.template-render-types span {
  padding: 3px 6px;
  border: 1px solid #d7d5f5;
  border-radius: 3px;
  color: var(--brand-deep);
  font-size: 7px;
}

.template-registry-columns {
  margin-top: 13px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.template-registry-columns > section {
  min-width: 0;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.template-registry-columns > section > b {
  display: block;
  margin-bottom: 7px;
  font-size: 9px;
}

.template-param-list > div,
.template-slot-list > div {
  min-width: 0;
  padding: 6px 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 4px 6px;
  align-items: center;
  border-bottom: 1px solid #eef0f4;
}

.template-param-list code,
.template-slot-list code {
  min-width: 0;
  overflow: hidden;
  color: #383c48;
  font-family: var(--font-mono);
  font-size: 7px;
  text-overflow: ellipsis;
}

.template-param-list span,
.template-slot-list span {
  color: var(--muted);
  font-size: 7px;
}

.template-param-list b {
  color: var(--muted);
  font-size: 7px;
}

.template-param-list b.is-required {
  color: #b54e5d;
}

.template-param-list small,
.template-slot-list small {
  grid-column: 1 / -1;
  color: #858b98;
  font-size: 7px;
  line-height: 1.4;
}

.template-empty-params {
  margin: 0;
  color: var(--muted);
  font-size: 8px;
}

.screen-registry-table {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}

.screen-registry-head,
.screen-registry-row {
  min-width: 920px;
  display: grid;
  grid-template-columns: 110px 1fr 190px 120px minmax(260px, 1.5fr);
  gap: 12px;
  align-items: center;
}

.screen-registry-head {
  min-height: 36px;
  padding: 0 13px;
  color: var(--muted);
  background: #f5f6f8;
  font-size: 8px;
  font-weight: 700;
}

.screen-registry-row {
  min-height: 50px;
  padding: 7px 13px;
  border-top: 1px solid var(--line);
}

.screen-registry-row code {
  min-width: 0;
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: 7px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.screen-registry-row > span:nth-child(2) {
  display: grid;
  gap: 3px;
}

.screen-registry-row b {
  font-size: 9px;
}

.screen-registry-row small {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 7px;
}

.registry-type {
  width: fit-content;
  padding: 4px 6px;
  border-radius: 3px;
  color: #545969;
  background: #eef0f4;
  font-size: 7px;
}

.registry-type code {
  display: block;
  margin-top: 3px;
  color: currentColor;
  font-family: var(--font-mono);
  font-size: 6px;
  white-space: nowrap;
}

.registry-type.asset_gif {
  color: #5847b6;
  background: #eeecff;
}

.registry-type.lvgl_static {
  color: #24684d;
  background: #e8f7f0;
}

.pattern-registry-meta {
  margin-top: 10px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 5px;
  align-items: center;
}

.pattern-registry-meta code,
.pattern-registry-meta span {
  min-width: 0;
  overflow: hidden;
  padding: 4px 5px;
  border-radius: 3px;
  background: #eeecff;
  color: #554fbd;
  font-family: var(--font-mono);
  font-size: 6px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pattern-registry-meta span {
  background: #eef0f4;
  color: #636a77;
}

.expression-asset-ids {
  display: flex;
  align-items: center;
  gap: 6px;
}

.expression-asset-ids span {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 7px;
}

.atlas-toolbar {
  position: sticky;
  top: 64px;
  z-index: 10;
  padding: 12px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
}

.atlas-scope-note {
  margin-bottom: 12px;
  padding: 12px 14px;
  display: flex;
  align-items: baseline;
  gap: 12px;
  border-left: 3px solid var(--brand-core);
  background: #f6f5fe;
}

.atlas-scope-note b {
  flex: 0 0 auto;
  color: #514bc8;
  font-size: 10px;
}

.atlas-scope-note p {
  min-height: 0;
  margin: 0;
  color: #5f6573;
  font-size: 9px;
  line-height: 1.6;
}

.atlas-scope-note code {
  color: #514bc8;
  font-family: var(--font-mono);
}

.filter-tabs {
  display: flex;
  align-items: center;
  gap: 5px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.filter-tabs button {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--muted);
  background: #fff;
  cursor: pointer;
  font-size: 9px;
  white-space: nowrap;
}

.filter-tabs button.is-active {
  color: var(--brand-core);
  border-color: var(--brand-core);
  background: var(--brand-soft);
  font-weight: 700;
}

.search-field {
  width: 220px;
  height: 34px;
  padding: 0 9px;
  display: flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: #fff;
  flex: none;
}

.search-field svg {
  width: 14px;
  color: var(--muted);
}

.search-field input {
  min-width: 0;
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 10px;
}

.screen-atlas-grid {
  margin-top: 22px;
  display: grid;
  grid-template-columns: repeat(4, minmax(210px, 1fr));
  gap: 12px;
}

.pattern-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  transition: border-color 160ms ease, transform 160ms ease;
}

.pattern-card:hover {
  border-color: #aaa6ee;
  transform: translateY(-2px);
}

.pattern-preview {
  position: relative;
  width: 100%;
  min-height: 150px;
  overflow: hidden;
  background: #e9edf2;
}

.pattern-preview-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 480px;
  height: 320px;
  transform-origin: top left;
}

.pattern-card-body {
  padding: 13px;
}

.pattern-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.pattern-card-head span {
  display: block;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 7px;
}

.pattern-card-flags {
  display: grid;
  justify-items: end;
  gap: 5px;
}

.pattern-card-head .release-tag {
  min-height: 22px;
  padding: 0 7px;
  display: inline-flex;
  align-items: center;
  border: 1px solid transparent;
  border-radius: 4px;
  font-family: var(--font-sans);
  font-size: 8px;
  font-weight: 700;
  white-space: nowrap;
}

.pattern-card-head .release-tag.is-p0 {
  color: #514bc8;
  border-color: #cfccf6;
  background: #f0effd;
}

.pattern-card-head .release-tag.is-reserved {
  color: #69707e;
  border-color: #dfe2e8;
  background: #f4f5f7;
}

.pattern-card h3 {
  margin: 4px 0 0;
  font-size: 13px;
}

.pattern-card p {
  min-height: 34px;
  margin: 9px 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.55;
}

.pattern-delivery-meta {
  min-height: 44px;
  margin: 0 0 9px;
  padding: 8px 9px;
  display: grid;
  gap: 3px;
  border-left: 3px solid #c9c5fa;
  background: #f7f6ff;
}

.pattern-delivery-meta b {
  color: #514bc8;
  font-size: 8px;
}

.pattern-delivery-meta span {
  color: #666d7b;
  font-size: 8px;
  line-height: 1.45;
}

.pattern-delivery-meta.is-reserved {
  border-left-color: #d9dce3;
  background: #f6f7f9;
}

.pattern-delivery-meta.is-reserved b {
  color: #69707e;
}

.pattern-card-meta {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.pattern-card-meta code {
  padding: 3px 5px;
  border-radius: 3px;
  color: #59606e;
  background: #f0f2f5;
  font-family: var(--font-mono);
  font-size: 7px;
}

.pattern-card-actions {
  margin-top: 11px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 7px;
}

.pattern-card-actions button,
.pattern-download {
  width: 100%;
  min-height: 32px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  color: var(--brand-core);
  background: #fff;
  cursor: pointer;
  font-size: 9px;
  font-weight: 700;
}

.pattern-download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  text-decoration: none;
}

.pattern-download svg {
  width: 13px;
  height: 13px;
}

.pattern-local-page {
  width: 100%;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  color: #5f6572;
  background: #f6f7f9;
  font-size: 9px;
  font-weight: 700;
}

.pattern-local-page svg,
.pattern-home-relation svg {
  width: 13px;
  height: 13px;
}

.pattern-home-relation {
  min-height: 28px;
  padding: 0 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  border-left: 3px solid var(--brand-core);
  color: #5551c8;
  background: #f2f1ff;
  font-size: 8px;
  font-weight: 700;
}

.home-atlas-ui {
  position: relative;
  overflow: hidden;
  color: #f8f9ff;
  background: #09132e;
  font-family: var(--font-sans);
}

.home-atlas-ui * {
  box-sizing: border-box;
}

.terminal-status-bar {
  height: 28px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: #0a132d;
  font-size: 12px;
}

.terminal-status-bar span {
  display: flex;
  align-items: center;
  gap: 8px;
}

.terminal-status-bar > span { gap: 9px; }
.terminal-status-icon { display: block; color: #e8eafd; overflow: visible; }
.terminal-status-wifi { width: 24px; height: 21px; }
.terminal-status-volume { width: 29px; height: 22px; }
.terminal-status-icon path { fill: none; stroke-width: 2; stroke-linecap: round; }
.home-status-muted { stroke: #424c6b; }
.home-status-active { stroke: currentColor; }
.home-status-core, .home-status-speaker { fill: currentColor; stroke: currentColor; stroke-width: 1.4; stroke-linejoin: round; }
.terminal-status-battery { position: relative; width: 29px; height: 13px; padding: 2px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; border: 1.5px solid #e8eafd; border-radius: 3px; }
.terminal-status-battery::after { content: ""; position: absolute; top: 2px; right: -4px; width: 2px; height: 5px; border-radius: 0 2px 2px 0; background: #e8eafd; }
.terminal-status-battery i { min-width: 0; border-radius: 1px; background: #414b68; }
.terminal-status-battery i.is-on { background: #e8eafd; }
.terminal-status-battery.is-low { border-color: #ffbd50; }.terminal-status-battery.is-low::after,.terminal-status-battery.is-low i.is-on { background: #ffbd50; }
.terminal-status-battery.is-critical { border-color: #ff7182; }.terminal-status-battery.is-critical::after,.terminal-status-battery.is-critical i.is-on { background: #ff7182; }
.terminal-status-battery.is-charging { border-color: #70dab0; }.terminal-status-battery.is-charging::after,.terminal-status-battery.is-charging i.is-on { background: #70dab0; }
.terminal-status-battery svg { position: absolute; right: 8px; top: 1px; width: 10px; height: 10px; fill: #0a132d; }
.terminal-status-wifi .home-status-active { display: none; }
.terminal-status-wifi.level-1 path:nth-of-type(6),
.terminal-status-wifi.level-2 path:nth-of-type(4),
.terminal-status-wifi.level-2 path:nth-of-type(6),
.terminal-status-wifi.level-3 .home-status-active { display: inline; }
.terminal-status-wifi.level-0 .home-status-core { fill: #ff7182; stroke: #ff7182; }
.terminal-status-volume .home-status-active { display: none; }
.terminal-status-volume.level-1 path:nth-of-type(2),
.terminal-status-volume.level-2 path:nth-of-type(2),
.terminal-status-volume.level-2 path:nth-of-type(3),
.terminal-status-volume.level-3 path:nth-of-type(2),
.terminal-status-volume.level-3 path:nth-of-type(3),
.terminal-status-volume.level-3 path:nth-of-type(4),
.terminal-status-volume.level-4 path:nth-of-type(2),
.terminal-status-volume.level-4 path:nth-of-type(3),
.terminal-status-volume.level-4 path:nth-of-type(4) { display: inline; }
.terminal-status-volume.is-muted { color: #ff7182; }
.terminal-status-mute-mark { stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; }

.terminal-system-shell { width: 100%; height: 100%; overflow: hidden; }
.terminal-content-viewport { position: relative; width: 480px; height: 292px; overflow: hidden; }
.home-atlas-page-content { height: 100%; overflow: hidden; }
.home-atlas-page-header + .home-atlas-page-content { height: calc(100% - 40px); }

.home-atlas-clock {
  height: 58px;
  padding: 1px 18px 0;
  display: grid;
  grid-template-columns: 116px 148px 1fr;
  align-items: center;
  border-bottom: 1px solid rgba(167, 176, 223, 0.16);
  background: #111e48;
}

.home-atlas-clock > strong {
  font-size: 39px;
  line-height: 1;
}

.home-atlas-clock > span {
  padding-left: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-left: 1px solid rgba(184, 190, 231, 0.32);
  font-size: 14px;
  font-weight: 700;
}

.home-atlas-clock small {
  display: inline;
  color: #bdc5e5;
  font-size: 10px;
  font-weight: 500;
}

.home-atlas-clock > em {
  display: flex;
  flex-direction: column;
  gap: 2px;
  justify-items: end;
  font-size: 13px;
  font-style: normal;
  font-weight: 700;
  text-align: right;
}

.home-atlas-grid {
  height: 234px;
  padding: 8px 12px 10px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 8px;
}

.home-atlas-entry {
  position: relative;
  overflow: hidden;
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  color: #fff;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.19), 0 5px 10px rgba(0, 0, 0, 0.19);
}

button.home-atlas-entry,
button.home-atlas-setting-entry,
.home-atlas-tabs button {
  padding: 0;
  appearance: none;
  font: inherit;
  text-align: inherit;
  cursor: pointer;
}

/* Interactive settings cards keep the same icon/text slots as atlas previews. */
button.home-atlas-setting-entry { padding: 11px 10px 9px 74px; }

button.home-atlas-entry:focus-visible,
button.home-atlas-setting-entry:focus-visible,
.home-atlas-tabs button:focus-visible { outline: 2px solid #fff; outline-offset: -3px; }
button.home-atlas-setting-entry:disabled { cursor: not-allowed; opacity: 0.74; }

.home-atlas-entry::after {
  content: "";
  position: absolute;
  right: -18px;
  bottom: -26px;
  width: 112px;
  height: 112px;
  opacity: 0.13;
  background: var(--home-entry-image) center / contain no-repeat;
  transform: rotate(-9deg);
}

.home-atlas-entry.entry-fubao { --home-entry-image: url("./home-icons/fubao-logo.png"); background: linear-gradient(145deg, #50489d, #2f2b68); }
.home-atlas-entry.entry-traffic { --home-entry-image: url("./home-icons/icon-traffic.png"); background: linear-gradient(145deg, #9f4d2c, #69311d); }
.home-atlas-entry.entry-miniapp { --home-entry-image: url("./home-icons/icon-miniapp.png"); background: linear-gradient(145deg, #266d81, #184758); }
.home-atlas-entry.entry-settings { --home-entry-image: url("./home-icons/icon-settings.png"); background: linear-gradient(145deg, #365a78, #23344f); }

.home-atlas-entry img {
  position: absolute;
  z-index: 2;
  left: 10px;
  bottom: 9px;
  width: 72px;
  height: 72px;
  object-fit: contain;
  filter: drop-shadow(0 4px 5px rgba(0, 0, 0, 0.28));
}
.home-atlas-entry img.fubao-entry { width: 64px; height: 84px; left: 13px; bottom: -1px; }

.home-atlas-entry span { position: absolute; z-index: 3; left: 91px; top: 31px; right: 8px; min-width: 0; }
.home-atlas-entry b { display: block; font-size: 19px; line-height: 1.12; }
.home-atlas-entry small { display: block; margin-top: 8px; color: rgba(255, 255, 255, 0.78); font-size: 11px; white-space: nowrap; }

.home-atlas-page-header {
  height: 40px;
  padding: 0 12px;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) minmax(0, 188px);
  align-items: center;
  border-bottom: 1px solid rgba(167, 176, 223, 0.18);
  background: #0c1737;
}

.home-atlas-back {
  width: 28px;
  height: 28px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 0;
  color: #f3f5ff;
  background: transparent;
  cursor: pointer;
}
.home-atlas-back:focus-visible { outline: 2px solid #fff; outline-offset: -2px; }
.home-atlas-back:active { transform: translateX(-1px); }
.home-atlas-page-header svg { width: 18px; height: 18px; }
.home-atlas-page-header strong { font-size: 17px; }
.home-atlas-page-header > span { min-width: 0; overflow: hidden; display: flex; align-items: center; justify-content: end; gap: 5px; color: #b9c4e9; font-size: 10px; white-space: nowrap; text-overflow: ellipsis; }
.home-atlas-page-header em { overflow: hidden; color: #dfe5ff; font-style: normal; text-overflow: ellipsis; }
.system-summary-dot { width: 6px; height: 6px; border-radius: 50%; flex: 0 0 auto; background: #ff7182; }
.system-summary-dot.is-online { background: #70dab0; }.system-summary-dot.is-connecting { background: #ffbd50; animation: terminal-pulse 1.1s ease-in-out infinite; }.system-summary-dot.is-offline { background: #ff7182; }

/* QR pages retain the shared terminal renderer; the system header only adds local navigation. */
.terminal-ui.home-qr-shell .home-qr-template { height: 100%; padding: 18px 24px; display: flex; }
.terminal-ui.home-qr-shell .terminal-qrcode-main { min-height: 0; align-content: center; }

.home-atlas-settings {
  height: 252px;
  padding: 10px 12px 12px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 10px;
}

.home-atlas-setting-entry {
  position: relative;
  min-width: 0;
  overflow: hidden;
  padding: 11px 10px 9px 74px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border: 1px solid rgba(159, 166, 215, 0.22);
  border-radius: 8px;
  color: #fff;
  background: var(--setting-bg);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.19), 0 5px 10px rgba(0, 0, 0, 0.19);
}

.home-atlas-setting-entry img { position: absolute; left: 10px; top: 13px; width: 56px; height: 56px; object-fit: contain; filter: drop-shadow(0 3px 5px rgba(0, 0, 0, 0.26)); }
.home-atlas-setting-entry .home-atlas-volume-asset { position: absolute; left: 12px; top: 15px; width: 52px; height: 52px; display: grid; place-items: center; border: 1px solid rgba(255, 255, 255, 0.46); border-radius: 14px; color: #fff; background: #9a71a0; box-shadow: inset 0 2px 5px rgba(255, 255, 255, 0.36), inset 0 -7px 12px rgba(77, 31, 79, 0.3), 0 4px 8px rgba(0, 0, 0, 0.25); }
.home-atlas-setting-entry .home-atlas-volume-asset svg { width: 37px; height: 29px; }
.home-atlas-setting-entry.setting-network { --setting-bg: #233f5b; }
.home-atlas-setting-entry.setting-binding { --setting-bg: #3c3478; }
.home-atlas-setting-entry.setting-volume { --setting-bg: #6c3d67; }
.home-atlas-setting-entry.setting-radar { --setting-bg: #31594e; }

.home-atlas-setting-entry > span:last-child { display: block; min-width: 0; }
.home-atlas-setting-entry b { display: block; font-size: 16px; line-height: 1.15; }
.home-atlas-setting-entry small { display: block; margin-top: 5px; color: rgba(255, 255, 255, 0.72); font-size: 10px; white-space: nowrap; }

.home-atlas-network {
  height: 252px;
  padding: 10px 12px 12px;
  display: grid;
  grid-template-columns: 218px 1fr;
  gap: 10px;
}

.home-atlas-network section {
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(159, 166, 215, 0.2);
  border-radius: 6px;
  background: #101d3e;
}

.home-atlas-network section:first-child { display: grid; gap: 9px; }
.home-atlas-network label {
  height: 52px;
  padding: 7px 9px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  border: 1px solid rgba(159, 166, 215, 0.26);
  border-radius: 5px;
  color: #9fa9cb;
  font-size: 9px;
}
.home-atlas-network label strong { grid-column: 1; color: #fff; font-size: 12px; }
.home-atlas-network label svg { grid-column: 2; grid-row: 1 / 3; width: 16px; }
.home-atlas-network button {
  height: 38px;
  border: 0;
  border-radius: 5px;
  color: #fff;
  background: var(--brand-core);
  font-size: 12px;
  font-weight: 700;
}
.home-atlas-network h4 { margin: 0 0 8px; font-size: 12px; }
.home-atlas-network section:last-child > div {
  min-height: 54px;
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  border-top: 1px solid rgba(159, 166, 215, 0.16);
}
.home-atlas-network section:last-child svg { width: 16px; }
.home-atlas-network section:last-child span { display: grid; gap: 3px; }
.home-atlas-network section:last-child b { font-size: 10px; }
.home-atlas-network section:last-child small { color: #8fcfb8; font-size: 8px; }
.home-atlas-network .wifi-selection { display: grid; width: 20px; height: 20px; place-items: center; color: #7e8aae; }
.home-atlas-network .wifi-selection svg { width: 15px; height: 15px; }
.home-atlas-network .saved-wifi-row.is-connected .wifi-selection { color: #70dab0; }
.saved-wifi-actions { display: flex; gap: 5px; justify-content: end; }
.home-atlas-network .saved-wifi-actions .wifi-action-icon { width: 24px; height: 24px; padding: 0; display: grid; place-items: center; border: 1px solid rgba(169, 166, 255, 0.45); border-radius: 4px; color: #dcdcff; background: #1a2650; }
.home-atlas-network .saved-wifi-actions .wifi-action-icon svg { width: 13px; height: 13px; }
.home-atlas-network .saved-wifi-actions .wifi-action-icon:hover { border-color: #a9a6ff; color: #fff; background: #26336a; }
.home-atlas-network .saved-wifi-actions .wifi-action-icon:focus-visible { outline: 2px solid #fff; outline-offset: 1px; }
.home-atlas-network .saved-wifi-actions .wifi-action-icon.is-danger { border-color: rgba(255, 113, 130, 0.48); color: #ff9ba6; }
.home-atlas-network .saved-wifi-row.is-connected small { color: #70dab0; }

.home-atlas-volume {
  height: 252px;
  padding: 20px 26px 14px;
  display: grid;
  grid-template-columns: 88px 1fr;
  grid-template-rows: 152px auto;
  gap: 14px 22px;
}
.home-atlas-volume > button {
  border: 1px solid rgba(169, 166, 255, 0.5);
  border-radius: 8px;
  color: #d9d8ff;
  background: #171c4a;
}
.home-atlas-volume > button svg { width: 34px; height: 34px; }
.home-atlas-volume > button span { display: block; margin-top: 8px; font-size: 11px; }
.home-atlas-volume section { align-self: center; }
.home-atlas-volume section span { color: #b7bfdc; font-size: 11px; }
.home-atlas-slider { position: relative; height: 12px; margin-top: 0; border-radius: 6px; background: #263255; }
.home-atlas-slider i { position: absolute; inset: 0 auto 0 0; border-radius: inherit; background: #7772ed; }
.home-atlas-slider b { position: absolute; top: 50%; width: 26px; height: 26px; border: 4px solid #fff; border-radius: 50%; background: #6864e3; transform: translate(-50%, -50%); }
.home-atlas-volume-steps { margin-top: 10px; display: flex; justify-content: space-between; }
.home-atlas-volume p { grid-column: 1 / -1; margin: 0; color: #9da8cb; font-size: 10px; text-align: center; }

.home-atlas-radar {
  height: 252px;
  padding: 14px 22px;
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 18px;
}
.home-atlas-radar-visual {
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 10px;
  border-radius: 8px;
  color: #a9a6ff;
  background: radial-gradient(circle, rgba(104, 100, 227, 0.3), rgba(15, 27, 61, 0.8) 62%);
}
.home-atlas-radar-visual svg { width: 70px; height: 70px; }
.home-atlas-radar-visual span { font-size: 12px; font-weight: 700; }
.home-atlas-radar section { display: grid; align-content: center; }
.home-atlas-radar section div { min-height: 46px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid rgba(159, 166, 215, 0.18); }
.home-atlas-radar section span { color: #aeb7d5; font-size: 11px; }
.home-atlas-radar section b { color: #70dab0; font-size: 12px; }
.home-atlas-radar p { grid-column: 1 / -1; margin: 0; display: flex; align-items: center; gap: 7px; color: #9da8cb; font-size: 9px; }
.home-atlas-radar p svg { width: 15px; }

.home-atlas-traffic {
  height: 252px;
  padding: 10px 14px 12px;
  display: grid;
  grid-template-columns: 132px 1fr;
  grid-template-rows: 30px 1fr 48px;
  gap: 8px 10px;
}
.home-atlas-tabs { grid-column: 1 / -1; display: flex; gap: 6px; }
.home-atlas-tabs > * { min-width: 54px; display: grid; place-items: center; border: 0; border-radius: 4px; color: #aab4d6; background: #111e41; font-size: 9px; }
.home-atlas-tabs .is-active { color: #fff; background: #6864e3; }
.home-atlas-metrics { display: grid; gap: 6px; }
.home-atlas-metrics div { padding: 7px 9px; display: grid; grid-template-columns: 1fr auto; align-items: center; border: 1px solid rgba(159, 166, 215, 0.18); border-radius: 5px; background: #101d3e; }
.home-atlas-metrics span { color: #aeb7d5; font-size: 9px; }
.home-atlas-metrics strong { font-size: 20px; }
.home-atlas-traffic section { padding: 8px 10px; border: 1px solid rgba(159, 166, 215, 0.18); border-radius: 5px; background: #101d3e; }
.home-atlas-bars { height: 98px; display: flex; align-items: end; gap: 6px; border-bottom: 1px solid #394567; }
.home-atlas-bars.is-week { gap: 10px; }
.home-atlas-bars.is-month { gap: 2px; }
.home-atlas-bars.is-month i { min-width: 3px; }
.home-atlas-bars i { flex: 1; min-height: 8px; border-radius: 2px 2px 0 0; background: #8580f2; }
.home-atlas-traffic section small { display: block; margin-top: 7px; color: #8f9abd; font-size: 8px; }
.home-atlas-events { grid-column: 1 / -1; display: flex; gap: 8px; }
.home-atlas-events span { flex: 1; padding: 0 10px; display: flex; align-items: center; border-radius: 5px; color: #cbd1e8; background: #101d3e; font-size: 9px; }

.home-atlas-ui.is-unavailable {
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 10px;
  color: #a9a6ff;
}
.home-atlas-ui.is-unavailable svg { width: 54px; height: 54px; }
.home-atlas-ui.is-unavailable strong { font-size: 22px; }
.home-atlas-ui.is-unavailable p { margin: 0; color: #9da8cb; font-size: 12px; }

.empty-state {
  padding: 60px 0;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
}

.expression-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(120px, 1fr));
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.expression-item {
  min-height: 250px;
  padding: 14px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.expression-preview {
  height: 104px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: var(--screen);
}

.expression-item h3 {
  margin: 12px 0 2px;
  font-size: 12px;
}

.expression-item code {
  color: var(--brand-core);
  font-family: var(--font-mono);
  font-size: 7px;
}

.expression-item dl {
  margin: 11px 0 0;
}

.expression-item dl div {
  margin-top: 7px;
}

.expression-item dt {
  color: var(--muted);
  font-size: 7px;
}

.expression-item dd {
  margin: 2px 0 0;
  color: var(--text);
  font-size: 8px;
  line-height: 1.45;
}

.expression-downloads {
  margin-top: 12px;
  display: grid;
  gap: 6px;
}

.expression-downloads a,
.expression-downloads span {
  min-height: 30px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  color: var(--brand-core);
  background: #fff;
  font-size: 8px;
  font-weight: 700;
  text-decoration: none;
}

.expression-downloads svg {
  width: 12px;
  height: 12px;
}

.pattern-download:hover,
.expression-downloads a:hover {
  border-color: #aaa6ee;
  background: #f7f6ff;
}

.pattern-download:focus-visible,
.expression-downloads a:focus-visible {
  outline: 2px solid var(--brand-core);
  outline-offset: 2px;
}

.voice-machine-section {
  margin-bottom: 26px;
}

.voice-machine-section .component-subheading {
  margin-top: 0;
}

.voice-machine-intro {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.65;
}

.voice-state-machine {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--card-radius);
  background: #f7f8fb;
}

.voice-machine-board {
  width: 1420px;
  padding: 24px;
  color: var(--ink);
  background:
    linear-gradient(#e8eaf2 1px, transparent 1px),
    linear-gradient(90deg, #e8eaf2 1px, transparent 1px),
    #f7f8fb;
  background-size: 24px 24px;
}

.voice-machine-title-row {
  display: flex;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid #d9dce7;
}

.voice-machine-title-row span,
.voice-machine-branch-grid header span {
  color: var(--brand-deep);
  font-family: var(--font-mono);
  font-size: 8px;
}

.voice-machine-title-row strong {
  display: block;
  margin-top: 5px;
  font-size: 18px;
}

.voice-machine-title-row p,
.voice-machine-branch-grid header p {
  margin: 0;
  color: var(--muted);
  font-size: 9px;
}

.voice-machine-main,
.voice-machine-branch,
.voice-machine-error-origin {
  display: flex;
  align-items: center;
}

.voice-machine-node {
  flex: 0 0 160px;
  width: 160px;
  min-width: 160px;
  max-width: 160px;
  overflow: hidden;
  border: 1px solid #cfd4e4;
  border-radius: 7px;
  background: #fff;
  box-shadow: 0 8px 24px rgb(23 30 60 / 8%);
}

.voice-machine-screen {
  position: relative;
  width: 180px;
  height: 120px;
  overflow: hidden;
  background: var(--screen-bg);
}

.voice-machine-canvas {
  width: 480px;
  height: 320px;
  transform: scale(0.375);
  transform-origin: top left;
}

.voice-machine-copy {
  min-height: 58px;
  padding: 10px 11px;
}

.voice-machine-copy b {
  display: block;
  font-size: 11px;
}

.voice-machine-copy code {
  display: block;
  margin-top: 6px;
  color: var(--brand-deep);
  font-family: var(--font-mono);
  font-size: 7px;
  line-height: 1.4;
}

.voice-machine-connector {
  flex: 0 0 86px;
  display: grid;
  justify-items: center;
  gap: 6px;
  color: var(--brand-core);
}

.voice-machine-connector code {
  max-width: 82px;
  color: #595f73;
  font-family: var(--font-mono);
  font-size: 7px;
  line-height: 1.35;
  text-align: center;
}

.voice-machine-connector svg {
  width: 25px;
  height: 25px;
}

.voice-machine-branch-grid {
  display: grid;
  grid-template-columns: 520px 1fr;
  gap: 24px;
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid #d9dce7;
}

.voice-machine-branch-grid > section {
  min-height: 256px;
  padding: 18px;
  border: 1px solid #d4d8e6;
  border-radius: 7px;
  background: rgb(255 255 255 / 82%);
}

.voice-machine-branch-grid header b {
  display: block;
  margin: 5px 0;
  font-size: 13px;
}

.voice-machine-branch,
.voice-machine-error-origin,
.voice-machine-error-row {
  margin-top: 15px;
}

.voice-machine-error-list {
  display: grid;
  gap: 12px;
}

.voice-machine-error-row {
  display: flex;
  align-items: center;
}

.voice-machine-error-row .voice-machine-node {
  flex-basis: 132px;
  width: 132px;
  min-width: 132px;
  max-width: 132px;
}

.voice-machine-error-row .voice-machine-screen {
  width: 132px;
  height: 88px;
}

.voice-machine-error-row .voice-machine-canvas {
  transform: scale(0.275);
}

.voice-machine-error-row .voice-machine-copy {
  min-height: 48px;
  padding: 8px 9px;
}

.voice-machine-error-row .voice-machine-connector {
  flex-basis: 66px;
}

.voice-machine-error-row > strong {
  flex: 0 0 118px;
  color: var(--text);
  font-size: 9px;
  line-height: 1.45;
  text-align: center;
}

.voice-machine-error-origin > code,
.voice-machine-error-origin > strong {
  flex: 0 0 150px;
  color: var(--text);
  font-size: 9px;
  line-height: 1.45;
  text-align: center;
}

.voice-machine-error-origin > code {
  font-family: var(--font-mono);
}

.voice-machine-next-turn {
  flex: 0 0 150px;
  color: var(--text);
  font-size: 9px;
  line-height: 1.45;
  text-align: center;
}

.voice-machine-board > footer {
  margin-top: 18px;
  padding-top: 12px;
  border-top: 1px solid #d9dce7;
  color: var(--muted);
  font-size: 9px;
}

.voice-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(360px, 0.8fr);
  gap: 24px;
}

.voice-rules {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.voice-rules article {
  min-height: 145px;
  padding: 17px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.voice-rules b {
  font-size: 12px;
}

.voice-rules p {
  margin: 8px 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.65;
}

.voice-rules code {
  color: var(--brand-core);
  font-family: var(--font-mono);
  font-size: 8px;
}

.earcon-table {
  border: 1px solid var(--line);
  background: #fff;
}

.earcon-table > div {
  min-height: 56px;
  padding: 10px 12px;
  display: grid;
  grid-template-columns: 72px 1fr 100px;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  font-size: 9px;
}

.earcon-table > div:last-child {
  border-bottom: 0;
}

.earcon-table .table-head {
  min-height: 38px;
  color: var(--muted);
  background: #f4f5f7;
  font-size: 8px;
  font-weight: 700;
}

.earcon-table em {
  color: var(--muted);
  font-style: normal;
}

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

.p0-scene-row {
  display: grid;
  grid-template-columns: 56px minmax(190px, 0.8fr) minmax(270px, 1.3fr) minmax(260px, 1fr);
  align-items: stretch;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  border-left: 1px solid var(--line);
  background: #fff;
}

.p0-scene-row > div {
  padding: 17px;
  border-right: 1px solid var(--line);
}

.p0-scene-row > div:last-child {
  border-right: 0;
}

.p0-order {
  display: grid;
  place-items: center;
  color: var(--brand-core);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 800;
}

.p0-title h3 {
  margin: 0 0 7px;
  font-size: 14px;
}

.p0-title p,
.p0-flow p {
  margin: 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.6;
}

.p0-steps {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.p0-steps span {
  padding: 5px 7px;
  border-radius: 4px;
  color: #4c5260;
  background: #f0f2f5;
  font-size: 8px;
}

.p0-steps i {
  width: 9px;
  color: var(--brand-core);
}

.p0-handoff b {
  display: block;
  margin-bottom: 8px;
  color: var(--brand-core);
  font-size: 9px;
}

.p0-handoff span {
  color: var(--text);
  font-size: 9px;
  line-height: 1.6;
}

.permission-split {
  display: grid;
  grid-template-columns: 1fr 1fr 0.8fr;
  border: 1px solid var(--line);
  background: #fff;
}

.permission-split > div {
  min-height: 260px;
  padding: 22px;
  border-right: 1px solid var(--line);
}

.permission-split > div:last-child {
  border-right: 0;
}

.permission-split > div > span {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 9px;
  font-weight: 700;
}

.permission-split svg {
  width: 15px;
  height: 15px;
}

.permission-allow > span { color: #157958; }
.permission-deny > span { color: #b23a49; }

.permission-split h3 {
  margin: 16px 0;
  font-size: 16px;
}

.permission-split ul {
  margin: 0;
  padding-left: 17px;
  color: var(--text);
  font-size: 10px;
  line-height: 2;
}

.permission-route {
  display: grid;
  align-content: center;
  text-align: center;
  background: #f6f5fe;
}

.permission-route > svg {
  width: 34px;
  height: 34px;
  margin: 0 auto;
  color: var(--brand-core);
}

.permission-route p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.7;
}

.pattern-strip {
  margin-top: 18px;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(190px, 1fr);
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 6px;
}

.strip-item {
  min-height: 110px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.strip-item span {
  color: var(--brand-core);
  font-family: var(--font-mono);
  font-size: 7px;
}

.strip-item b {
  display: block;
  margin-top: 7px;
  font-size: 11px;
}

.strip-item p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.55;
}

.lifecycle-principle-band {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: var(--card-radius);
  background: #fff;
}

.lifecycle-principle-band > div {
  min-height: 132px;
  padding: 18px;
  border-right: 1px solid var(--line);
}

.lifecycle-principle-band > div:last-child { border-right: 0; }

.lifecycle-principle-band small,
.lifecycle-lane header span,
.lifecycle-flow-node > span,
.device-transaction-list span {
  color: var(--brand-core);
  font-family: var(--font-mono);
  font-size: 8px;
}

.lifecycle-principle-band strong {
  display: block;
  margin-top: 11px;
  color: var(--ink);
  font-size: 14px;
}

.lifecycle-principle-band p,
.lifecycle-lane header p,
.lifecycle-flow-node p,
.device-transaction-list p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.6;
}

.device-state-flow {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.lifecycle-lane {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--card-radius);
  background: #fff;
}

.lifecycle-lane header {
  min-height: 68px;
  border-bottom: 1px solid var(--line);
}

.lifecycle-lane header b {
  display: block;
  margin-top: 5px;
  font-size: 14px;
}

.lifecycle-lane header p { margin-top: 5px; }

.lifecycle-lane-track {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 610px;
  padding-top: 18px;
}

.lifecycle-lane {
  overflow-x: auto;
}

.lifecycle-flow-node {
  flex: 0 0 158px;
  min-height: 126px;
  padding: 13px;
  border: 1px solid #dadfee;
  border-radius: 6px;
  background: #fafbfe;
}

.lifecycle-flow-node.is-virtual {
  border-style: dashed;
  background: #fff;
}

.lifecycle-flow-node b {
  display: block;
  margin-top: 11px;
  color: var(--ink);
  font-size: 12px;
}

.lifecycle-flow-node code,
.lifecycle-return code {
  display: inline-block;
  margin-top: 10px;
  color: #4f4baf;
  font-family: var(--font-mono);
  font-size: 7px;
}

.lifecycle-arrow {
  flex: 0 0 72px;
  display: grid;
  justify-items: center;
  gap: 5px;
  color: var(--brand-core);
}

.lifecycle-arrow code {
  max-width: 72px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 7px;
  text-align: center;
}

.lifecycle-arrow svg {
  width: 22px;
  height: 22px;
}

.lifecycle-return {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  min-width: 610px;
  margin-top: 15px;
  padding-top: 12px;
  border-top: 1px dashed var(--line-strong);
}

.lifecycle-return code { margin: 0; }

.connectivity-branches {
  display: grid;
  grid-template-columns: repeat(3, 158px);
  gap: 10px;
  min-width: 494px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed var(--line-strong);
}

.lifecycle-subheading {
  margin-top: 28px;
}

.device-transaction-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: var(--card-radius);
  background: #fff;
}

.device-transaction-list article {
  min-height: 116px;
  padding: 15px;
  border-right: 1px solid var(--line);
}

.device-transaction-list article:last-child { border-right: 0; }

.device-transaction-list b {
  display: block;
  margin-top: 9px;
  font-size: 11px;
}

.contract-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
}

.contract-tabs button {
  height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  color: var(--muted);
  background: #fff;
  cursor: pointer;
  font-size: 9px;
}

.contract-tabs button.is-active {
  color: var(--brand-core);
  border-color: var(--brand-core);
  background: var(--brand-soft);
  font-weight: 700;
}

.contract-table {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.contract-cell {
  min-height: 96px;
  padding: 14px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.contract-cell code {
  color: var(--brand-core);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
}

.contract-cell p {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.6;
}

.contract-example {
  margin-top: 20px;
  overflow: hidden;
  border: 1px solid #242c42;
  border-radius: 7px;
  background: #111724;
}

.contract-example > div {
  min-height: 44px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #d8deec;
  border-bottom: 1px solid #293146;
  font-size: 9px;
}

.contract-example .icon-button {
  color: #d8deec;
  border-color: #3a435b;
  background: #1b2334;
}

.contract-example pre,
.tech-drawer pre {
  margin: 0;
  overflow: auto;
  color: #b9f0d6;
  font-family: var(--font-mono);
  font-size: 9px;
  line-height: 1.7;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.contract-example pre {
  min-height: 280px;
  padding: 18px;
}

.contract-principles {
  margin-top: 20px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.contract-principles article {
  min-height: 126px;
  padding: 16px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.contract-principles b {
  font-size: 11px;
}

.contract-principles p {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.65;
}

.acceptance-columns {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.acceptance-columns > div {
  min-height: 230px;
  padding: 20px;
  display: grid;
  align-content: start;
  gap: 13px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.acceptance-columns h3 {
  margin: 0 0 5px;
  font-size: 14px;
}

.acceptance-columns label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: var(--text);
  font-size: 10px;
  line-height: 1.5;
}

.acceptance-columns input {
  margin: 1px 0 0;
  accent-color: var(--brand-core);
}

.vendor-pending-list {
  margin-top: 22px;
  border-top: 1px solid var(--line);
}

.vendor-pending-list > div {
  min-height: 68px;
  display: grid;
  grid-template-columns: 54px 1fr;
  align-items: center;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  border-left: 1px solid var(--line);
  background: #fff;
}

.vendor-pending-list span {
  color: #9b620e;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  text-align: center;
}

.vendor-pending-list p {
  margin: 0;
  padding: 15px;
  color: var(--muted);
  border-left: 1px solid var(--line);
  font-size: 10px;
  line-height: 1.6;
}

.vendor-pending-list b {
  margin-right: 8px;
  color: var(--ink);
}

/* Device-aware logical terminal renderer */
.terminal-ui {
  position: relative;
  width: 480px;
  height: 320px;
  overflow: hidden;
  color: #f5f9ff;
  background: var(--screen);
  font-family: var(--font-ui);
  letter-spacing: 0;
}

/* Device profiles stay independent: v1 reflows to 3:2; v2 keeps its existing 16:9 calibration. */
.terminal-ui.device-v1 {
  --screen-title-size: 32px;
  --screen-value-lg: 43px;
  --screen-value-md: 37px;
  --screen-value-sm: 29px;
  --screen-body-size: 21px;
  --screen-label-size: 16px;
  --screen-caption-size: 13px;
  --screen-space-1: 5px;
  --screen-space-2: 11px;
  --screen-space-3: 16px;
  --screen-space-4: 21px;
  --screen-space-5: 27px;
  --voice-title-size: 32px;
  --voice-body-size: var(--screen-body-size);
  --voice-support-size: var(--screen-label-size);
  --voice-face-width: 291px;
  --voice-face-height: 168px;
  --voice-eye-width: 51px;
  --voice-eye-height: 85px;
  --voice-mouth-width: 72px;
  --voice-mouth-height: 35px;
  --voice-wave-height: 104px;
  --voice-wave-width: 12px;
  --voice-status-size: 117px;
  --voice-task-time-size: 17px;
  --voice-task-text-size: 19px;
  --voice-task-height: 59px;
  --compact-face-width: 165px;
  --compact-face-height: 88px;
  --compact-eye-width: 35px;
  --compact-eye-height: 59px;
  --compact-mouth-width: 49px;
  --compact-mouth-height: 24px;
  --notice-icon-size: 85px;
  --notice-height: 176px;
  --qr-size: 155px;
}

.terminal-ui.device-v2 {
  --screen-title-size: 30px;
  --screen-value-lg: 39px;
  --screen-value-md: 34px;
  --screen-value-sm: 27px;
  --screen-body-size: 20px;
  --screen-label-size: 15px;
  --screen-caption-size: 12px;
  --screen-space-1: 5px;
  --screen-space-2: 10px;
  --screen-space-3: 15px;
  --screen-space-4: 20px;
  --screen-space-5: 25px;
  --voice-title-size: 30px;
  --voice-body-size: var(--screen-body-size);
  --voice-support-size: var(--screen-label-size);
  --voice-face-width: 268px;
  --voice-face-height: 155px;
  --voice-eye-width: 47px;
  --voice-eye-height: 79px;
  --voice-mouth-width: 66px;
  --voice-mouth-height: 32px;
  --voice-wave-height: 96px;
  --voice-wave-width: 11px;
  --voice-status-size: 108px;
  --voice-task-time-size: 16px;
  --voice-task-text-size: 17px;
  --voice-task-height: 54px;
  --compact-face-width: 153px;
  --compact-face-height: 81px;
  --compact-eye-width: 32px;
  --compact-eye-height: 54px;
  --compact-mouth-width: 46px;
  --compact-mouth-height: 22px;
  --notice-icon-size: 79px;
  --notice-height: 162px;
  --qr-size: 143px;
}

.terminal-ui.device-v1 .terminal-layout {
  padding: 21px 24px;
}

.terminal-ui.device-v1 .terminal-content-viewport .terminal-layout {
  position: absolute;
  inset: 0;
  height: 292px;
}

.terminal-ui.device-v2 .terminal-layout {
  inset: 12px 44px 12px 43px;
  padding: 15px 17px;
}

.terminal-ui .terminal-title {
  margin-top: 0;
  font-size: var(--voice-title-size);
  line-height: 1.25;
}

.terminal-ui .terminal-face {
  width: var(--voice-face-width);
  height: var(--voice-face-height);
}

.terminal-ui .terminal-eye {
  top: 8px;
  width: var(--voice-eye-width);
  height: var(--voice-eye-height);
}

.terminal-ui .terminal-eye.left { left: 32px; }
.terminal-ui .terminal-eye.right { right: 32px; }

.terminal-ui.device-v1 .terminal-eye {
  top: 11px;
}

.terminal-ui.device-v1 .terminal-eye.left { left: 43px; }
.terminal-ui.device-v1 .terminal-eye.right { right: 43px; }

.terminal-ui.device-v1 .terminal-mouth { bottom: 11px; }

.terminal-ui .terminal-mouth {
  bottom: 8px;
  width: var(--voice-mouth-width);
  height: var(--voice-mouth-height);
}

.terminal-ui .expression-speaking .terminal-mouth {
  width: var(--voice-mouth-height);
  height: var(--voice-mouth-height);
  border-width: 6px;
}

.terminal-ui .face-caption {
  margin-top: 4px;
  font-size: var(--voice-support-size);
}

.terminal-ui .screen-wave {
  height: var(--voice-wave-height);
  gap: var(--voice-wave-width);
}

.terminal-ui .screen-wave i {
  width: var(--voice-wave-width);
  height: 38%;
}

.terminal-ui .screen-wave i:nth-child(2),
.terminal-ui .screen-wave i:nth-child(6) { height: 66%; }
.terminal-ui .screen-wave i:nth-child(3),
.terminal-ui .screen-wave i:nth-child(5) { height: 92%; }
.terminal-ui .screen-wave i:nth-child(4) { height: 54%; }

.terminal-ui .status-symbol {
  width: var(--voice-status-size);
  height: var(--voice-status-size);
  font-size: calc(var(--voice-title-size) + 6px);
}

.terminal-ui .terminal-status-main strong {
  margin-top: 8px;
  font-size: var(--voice-title-size);
}

.terminal-ui .terminal-status-main p {
  margin-top: 5px;
  font-size: var(--voice-body-size);
}

.terminal-ui .terminal-task-list {
  gap: 5px;
}

.terminal-ui .terminal-task-row {
  min-height: var(--voice-task-height);
  grid-template-columns: 56px 1fr 10px;
  gap: 6px;
}

.terminal-ui.device-v2 .terminal-task-row {
  grid-template-columns: 69px 1fr 12px;
}

.terminal-ui.device-v1 .terminal-task-row {
  grid-template-columns: 75px 1fr 13px;
  gap: 8px;
}

.terminal-ui .terminal-task-row time {
  font-size: var(--voice-task-time-size);
}

.terminal-ui .terminal-task-row span {
  font-size: var(--voice-task-text-size);
}

.terminal-ui::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  box-shadow: inset 0 0 34px rgba(5, 13, 38, 0.65);
}

.terminal-v2-status-note { position: absolute; z-index: 4; top: 7px; right: 10px; padding: 3px 5px; border: 1px solid rgba(255, 189, 80, 0.55); border-radius: 3px; color: #ffcf7c; background: rgba(8, 13, 35, 0.84); font-size: 8px; }

.terminal-ui.expression-reminding::before,
.terminal-ui.expression-warning::before,
.terminal-ui.expression-weak_network::before,
.terminal-ui.expression-success::before,
.terminal-ui.expression-sorry::before {
  content: "";
  position: absolute;
  z-index: 2;
  top: 0;
  right: 0;
  left: 0;
  height: 4px;
  pointer-events: none;
}

.terminal-ui.expression-reminding::before,
.terminal-ui.expression-warning::before,
.terminal-ui.expression-weak_network::before {
  background: var(--amber);
}

.terminal-ui.expression-success::before {
  background: var(--green);
}

.terminal-ui.expression-sorry::before {
  background: var(--red);
}

.terminal-ui.priority-important { box-shadow: inset 0 4px 0 var(--amber); }
.terminal-ui.priority-urgent { box-shadow: inset 0 4px 0 var(--red); }

.terminal-layout {
  position: absolute;
  inset: 0;
  z-index: 1;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
}

.terminal-title {
  margin-top: 6px;
  overflow: hidden;
  color: #f6f9ff;
  font-size: 20px;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.terminal-main {
  min-height: 0;
  flex: 1;
  display: grid;
  align-items: center;
}

.terminal-status-main,
.terminal-error-main,
.terminal-text-main,
.terminal-dialogue-main {
  align-content: center;
  justify-items: center;
  text-align: center;
}

.status-symbol {
  position: relative;
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  color: var(--screen-brand-light);
  border: 2px solid rgba(142, 135, 244, 0.6);
  border-radius: 50%;
  font-size: 25px;
  font-weight: 800;
  box-shadow: 0 0 22px rgba(142, 135, 244, 0.16);
}

.status-symbol::after {
  content: "";
  position: absolute;
  inset: -8px;
  border: 1px solid rgba(142, 135, 244, 0.22);
  border-radius: 50%;
  animation: terminal-pulse 1.2s ease-in-out infinite;
}

.terminal-status-main strong,
.terminal-error-main strong,
.terminal-text-main strong,
.terminal-dialogue-main strong {
  display: block;
  margin-top: 13px;
  font-size: 17px;
  line-height: 1.35;
}

.terminal-status-main p,
.terminal-error-main p,
.terminal-text-main p,
.terminal-dialogue-main p {
  max-width: 260px;
  margin: 8px 0 0;
  color: #aab5ca;
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-line;
}

.terminal-error-main .status-symbol {
  color: var(--red);
  border-color: rgba(255, 113, 130, 0.65);
  box-shadow: 0 0 22px rgba(255, 113, 130, 0.14);
}

.terminal-error-main .status-symbol::after {
  border-color: rgba(255, 113, 130, 0.22);
}

.terminal-dialogue-main {
  padding: 0 10px;
}

.dialogue-quote {
  width: 100%;
  padding: 14px;
  border-left: 3px solid var(--screen-brand-light);
  border-radius: 4px;
  text-align: left;
  background: #111b37;
}

.dialogue-quote span {
  color: #8997b2;
  font-size: 9px;
}

.dialogue-quote strong {
  margin-top: 7px;
  font-size: 15px;
}

.terminal-task-list {
  align-content: center;
  gap: 7px;
}

.terminal-task-row {
  min-height: 40px;
  padding: 0 10px;
  display: grid;
  grid-template-columns: 48px 1fr 12px;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--screen-line);
  border-radius: 5px;
  background: var(--screen-panel);
}

.terminal-task-row time {
  color: var(--screen-brand-light);
  font-size: 10px;
  font-weight: 800;
}

.terminal-task-row span {
  overflow: hidden;
  font-size: 11px;
  font-weight: 650;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.terminal-task-row i {
  width: 7px;
  height: 7px;
  border: 2px solid #6b7da2;
  border-radius: 50%;
}

.terminal-data-grid {
  align-content: center;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.terminal-metric {
  min-height: 78px;
  padding: 9px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid var(--screen-line);
  border-radius: 5px;
  background: var(--screen-panel);
}

.terminal-metric span {
  color: #96a4bf;
  font-size: 8px;
}

.terminal-metric strong {
  color: var(--screen-brand-light);
  font-size: 20px;
}

.terminal-metric em {
  color: var(--green);
  font-size: 8px;
  font-style: normal;
}

.terminal-notice-main {
  align-content: center;
}

.notice-block {
  padding: 17px;
  display: grid;
  grid-template-columns: 56px 1fr;
  align-items: center;
  gap: 14px;
  border: 1px solid #5d4825;
  border-radius: 6px;
  background: #251c0d;
}

.notice-icon {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  color: var(--amber);
  border: 2px solid var(--amber);
  border-radius: 50%;
  font-size: 23px;
  font-weight: 800;
}

.notice-copy strong {
  display: block;
  font-size: 16px;
}

.notice-copy p {
  margin: 7px 0 0;
  color: #d5c5a9;
  font-size: 11px;
  line-height: 1.45;
  white-space: pre-line;
}

.terminal-qrcode-main {
  grid-template-columns: 116px 1fr;
  gap: 16px;
}

.terminal-qr {
  width: 108px;
  height: 108px;
  padding: 7px;
  border-radius: 4px;
  background: #fff;
}

.terminal-qr canvas,
.terminal-qr img {
  width: 94px !important;
  height: 94px !important;
  display: block;
}

.terminal-qr-copy strong {
  display: block;
  font-size: 17px;
}

.terminal-qr-copy p {
  margin: 9px 0 0;
  color: #aab5ca;
  font-size: 11px;
  line-height: 1.5;
}

.terminal-expression-main {
  align-content: center;
  justify-items: center;
}

.terminal-face {
  position: relative;
  width: 170px;
  height: 92px;
  color: var(--screen-brand-light);
}

.terminal-eye {
  position: absolute;
  top: 10px;
  width: 25px;
  height: 40px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 20px currentColor;
  animation: terminal-blink 4.2s ease-in-out infinite;
}

.terminal-eye.left { left: 32px; }
.terminal-eye.right { right: 32px; }

.terminal-mouth {
  position: absolute;
  left: 50%;
  bottom: 9px;
  width: 34px;
  height: 16px;
  transform: translateX(-50%);
  filter: drop-shadow(0 0 5px currentColor);
}

.terminal-mouth svg {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
}

.terminal-mouth path {
  fill: none;
  stroke: currentColor;
  stroke-width: 7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.expression-wink .terminal-eye.right {
  top: 24px;
  height: 0;
  border-bottom: 7px solid currentColor;
  border-radius: 0;
  background: transparent;
  transform: rotate(-35deg);
}

.expression-happy .terminal-eye {
  top: 24px;
  height: 16px;
  border-radius: 24px 24px 0 0;
  background: transparent;
  border-top: 7px solid currentColor;
  box-shadow: none;
}

.expression-questioning .terminal-eye.right {
  top: 18px;
  height: 27px;
}

.expression-sorry .terminal-eye {
  transform: rotate(15deg);
}

.expression-sorry .terminal-eye.right {
  transform: rotate(-15deg);
}

.expression-sorry .terminal-mouth,
.expression-warning .terminal-mouth {
  bottom: 0;
}

.expression-sorry .terminal-mouth svg,
.expression-warning .terminal-mouth svg {
  transform: rotate(180deg);
}

.expression-speaking .terminal-mouth {
  width: 24px;
  height: 24px;
  border: 5px solid currentColor;
  border-radius: 50%;
  animation: terminal-talk 360ms ease-in-out infinite alternate;
}

.expression-speaking .terminal-mouth svg {
  display: none;
}

.expression-thinking .terminal-face::after {
  content: "•••";
  position: absolute;
  right: -34px;
  top: 4px;
  font-size: 18px;
  letter-spacing: 4px;
  animation: terminal-dots 900ms ease-in-out infinite;
}

.expression-weak_network .terminal-face {
  opacity: 0.58;
}

.expression-updating .terminal-eye {
  top: 26px;
  height: 0;
  border-bottom: 6px solid currentColor;
  border-radius: 0;
  background: transparent;
}

.face-caption {
  margin-top: 8px;
  color: #8f9db8;
  font-size: 10px;
}

.screen-wave {
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

.screen-wave i {
  width: 6px;
  height: 22px;
  border-radius: 4px;
  background: var(--screen-brand-light);
  box-shadow: 0 0 10px rgba(142, 135, 244, 0.5);
  animation: terminal-wave 600ms ease-in-out infinite alternate;
}

.screen-wave i:nth-child(2),
.screen-wave i:nth-child(6) { height: 38px; animation-delay: 80ms; }
.screen-wave i:nth-child(3),
.screen-wave i:nth-child(5) { height: 54px; animation-delay: 160ms; }
.screen-wave i:nth-child(4) { height: 30px; animation-delay: 240ms; }

/* Readability rules for the complete screen atlas. */
.terminal-ui.screen-text .terminal-face {
  width: var(--compact-face-width);
  height: var(--compact-face-height);
}

.terminal-ui.screen-text .terminal-eye {
  top: 5px;
  width: var(--compact-eye-width);
  height: var(--compact-eye-height);
}

.terminal-ui.screen-text .terminal-eye.left { left: 20px; }
.terminal-ui.screen-text .terminal-eye.right { right: 20px; }

.terminal-ui.device-v1.screen-text .terminal-eye.left { left: 27px; }
.terminal-ui.device-v1.screen-text .terminal-eye.right { right: 27px; }

.terminal-ui.screen-text .terminal-mouth {
  bottom: 4px;
  width: var(--compact-mouth-width);
  height: var(--compact-mouth-height);
}

.terminal-ui .terminal-error-main strong,
.terminal-ui .terminal-text-main strong,
.terminal-ui .terminal-dialogue-main strong {
  margin-top: 8px;
  font-size: var(--voice-title-size);
  line-height: 1.2;
}

.terminal-ui .terminal-error-main p,
.terminal-ui .terminal-text-main p,
.terminal-ui .terminal-dialogue-main p {
  max-width: 100%;
  margin-top: 6px;
  font-size: var(--voice-body-size);
  line-height: 1.35;
}

.terminal-ui .dialogue-quote {
  min-height: 122px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.terminal-ui.device-v2 .dialogue-quote {
  min-height: 150px;
  padding: 22px;
}

.terminal-ui.device-v1 .dialogue-quote {
  min-height: 163px;
  padding: 24px;
}

.terminal-ui .dialogue-quote span {
  font-size: var(--voice-support-size);
}

.terminal-ui .dialogue-quote strong {
  font-size: var(--voice-body-size);
}

.terminal-ui .task-count-1 .terminal-task-row {
  min-height: 116px;
  grid-template-columns: 64px 1fr 12px;
  padding: 14px 16px;
}

.terminal-ui.device-v2 .task-count-1 .terminal-task-row {
  min-height: 143px;
  grid-template-columns: 79px 1fr 15px;
  padding: 17px 20px;
}

.terminal-ui .task-count-1 .terminal-task-row time {
  font-size: 18px;
}

.terminal-ui.device-v2 .task-count-1 .terminal-task-row time {
  font-size: 22px;
}

.terminal-ui .task-count-1 .terminal-task-row span {
  display: -webkit-box;
  overflow: hidden;
  font-size: 22px;
  line-height: 1.25;
  white-space: normal;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.terminal-ui.device-v2 .task-count-1 .terminal-task-row span {
  font-size: 27px;
}

.terminal-ui .task-count-2 {
  gap: 8px;
}

.terminal-ui .task-count-2 .terminal-task-row {
  min-height: 64px;
}

.terminal-ui.device-v2 .task-count-2 .terminal-task-row {
  min-height: 79px;
}

.terminal-ui.device-v1 .task-count-2 .terminal-task-row {
  min-height: 85px;
}

.terminal-ui .terminal-data-grid {
  gap: 8px;
}

.terminal-ui .metric-count-1 {
  grid-template-columns: 1fr;
}

.terminal-ui .metric-count-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.terminal-ui .terminal-metric {
  min-height: 104px;
  padding: 14px;
}

.terminal-ui.device-v2 .terminal-metric {
  min-height: 128px;
  padding: 17px;
}

.terminal-ui.device-v1 .terminal-metric {
  min-height: 144px;
  padding: 19px;
}

.terminal-ui .terminal-metric span,
.terminal-ui .terminal-metric em {
  font-size: var(--voice-support-size);
}

.terminal-ui .terminal-metric strong {
  font-size: 28px;
  line-height: 1.1;
}

.terminal-ui.device-v2 .terminal-metric strong {
  font-size: 34px;
}

.terminal-ui.device-v1 .terminal-metric strong {
  font-size: 37px;
}

.terminal-ui .notice-block {
  min-height: var(--notice-height);
  padding: 18px;
  grid-template-columns: var(--notice-icon-size) 1fr;
  gap: 16px;
}

.terminal-ui .notice-icon {
  width: var(--notice-icon-size);
  height: var(--notice-icon-size);
  font-size: var(--voice-title-size);
}

.terminal-ui .notice-copy strong {
  font-size: var(--voice-title-size);
  line-height: 1.15;
}

.terminal-ui .notice-copy p {
  margin-top: 8px;
  font-size: var(--voice-body-size);
  line-height: 1.35;
}

.terminal-ui .terminal-qrcode-main {
  grid-template-columns: var(--qr-size) minmax(0, 1fr);
  gap: var(--screen-space-3);
}

.terminal-ui .terminal-qr {
  width: var(--qr-size);
  height: var(--qr-size);
}

.terminal-ui .terminal-qr canvas,
.terminal-ui .terminal-qr img {
  width: calc(var(--qr-size) - 14px) !important;
  height: calc(var(--qr-size) - 14px) !important;
}

.terminal-ui .terminal-qr-copy strong {
  font-size: var(--voice-title-size);
  line-height: 1.15;
}

.terminal-ui .terminal-qr-copy p {
  margin-top: 8px;
  font-size: var(--voice-body-size);
  line-height: 1.35;
}

/* Precision Operations terminal component system. */
.terminal-ui .terminal-title {
  min-height: calc(var(--screen-title-size) * 1.35);
  font-size: var(--screen-title-size);
  line-height: 1.3;
}

.terminal-ui .terminal-status-main > strong,
.terminal-ui .terminal-error-main > strong,
.terminal-ui .terminal-text-main > strong,
.terminal-ui .notice-copy strong {
  line-height: 1.3;
}

.terminal-ui .terminal-main strong,
.terminal-ui .terminal-main p,
.terminal-ui .terminal-main span,
.terminal-ui .terminal-main time,
.terminal-ui .terminal-main em {
  overflow-wrap: normal;
  word-break: keep-all;
}

.terminal-ui .terminal-data-grid {
  gap: var(--screen-space-2);
}

.terminal-ui .terminal-metric {
  min-width: 0;
  min-height: 108px;
  padding: var(--screen-space-3);
  border-radius: 6px;
}

.terminal-ui.device-v2 .terminal-metric {
  min-height: 133px;
  padding: var(--screen-space-3);
}

.terminal-ui .terminal-metric span,
.terminal-ui .terminal-metric em {
  overflow: hidden;
  font-size: var(--screen-label-size);
  line-height: 1.25;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.terminal-ui .terminal-metric strong {
  min-width: 0;
  overflow: visible;
  font-family: var(--font-numeric);
  font-size: var(--screen-value-lg);
  font-variant-numeric: tabular-nums;
  font-weight: 760;
  line-height: 1.05;
  white-space: nowrap;
}

.terminal-ui .metric-count-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.terminal-ui .metric-count-2 .terminal-metric strong {
  font-size: var(--screen-value-md);
}

.terminal-ui .metric-count-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.terminal-ui .metric-count-3 .terminal-metric {
  padding: var(--screen-space-2);
}

.terminal-ui .metric-count-3 .terminal-metric strong {
  font-size: var(--screen-value-sm);
}

.terminal-ranking {
  align-content: center;
  gap: var(--screen-space-2);
}

.terminal-rank-row {
  min-height: 40px;
  padding: 0 var(--screen-space-3);
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--screen-space-2);
  border-bottom: 1px solid var(--screen-line);
}

.device-v2 .terminal-rank-row {
  min-height: 49px;
  grid-template-columns: 42px minmax(0, 1fr) auto;
}

.device-v1 .terminal-rank-row {
  min-height: 53px;
  grid-template-columns: 45px minmax(0, 1fr) auto;
}

.terminal-rank-row:first-child {
  border-top: 1px solid var(--screen-line);
}

.terminal-rank-row strong {
  color: var(--screen-brand-light);
  font-family: var(--font-numeric);
  font-size: var(--screen-value-sm);
  line-height: 1;
}

.terminal-rank-row span {
  min-width: 0;
  overflow: hidden;
  font-size: var(--screen-body-size);
  font-weight: 700;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.terminal-rank-row em {
  color: #aab5ca;
  font-family: var(--font-numeric);
  font-size: var(--screen-label-size);
  font-style: normal;
  white-space: nowrap;
}

.terminal-insight,
.terminal-progress {
  align-content: center;
  justify-items: start;
  padding: 0 var(--screen-space-2);
  text-align: left;
}

.terminal-insight > span,
.progress-copy span {
  color: #9aa8c3;
  font-size: var(--screen-label-size);
  line-height: 1.25;
}

.terminal-insight > strong,
.progress-copy strong {
  margin-top: var(--screen-space-2);
  color: var(--screen-brand-light);
  font-family: var(--font-numeric);
  font-size: var(--screen-value-lg);
  font-variant-numeric: tabular-nums;
  line-height: 1.05;
  white-space: nowrap;
}

.terminal-insight > p,
.terminal-progress > p {
  max-width: 100%;
  margin: var(--screen-space-3) 0 0;
  color: #d2d9e7;
  font-size: var(--screen-body-size);
  line-height: 1.35;
}

.terminal-insight.tone-positive > strong {
  color: var(--green);
}

.terminal-insight.tone-warning > strong {
  color: var(--amber);
}

.progress-copy {
  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--screen-space-3);
}

.progress-copy strong {
  margin-top: 0;
}

.progress-track {
  width: 100%;
  height: 12px;
  margin-top: var(--screen-space-4);
  overflow: hidden;
  border: 1px solid var(--screen-line);
  border-radius: 3px;
  background: #0c142b;
}

.device-v2 .progress-track {
  height: 15px;
}

.device-v1 .progress-track {
  height: 16px;
}

.progress-track i {
  height: 100%;
  display: block;
  background: var(--brand-core);
  box-shadow: 0 0 12px rgba(142, 135, 244, 0.42);
}

.terminal-ui .task-count-1 .terminal-task-row {
  min-height: 112px;
  padding: var(--screen-space-4);
  grid-template-columns: 46px minmax(0, 1fr);
  gap: var(--screen-space-3);
}

.terminal-ui.device-v2 .task-count-1 .terminal-task-row {
  min-height: 138px;
  padding: var(--screen-space-4);
  grid-template-columns: 57px minmax(0, 1fr);
}

.terminal-ui.device-v1 .task-count-1 .terminal-task-row {
  min-height: 149px;
  padding: var(--screen-space-4);
  grid-template-columns: 61px minmax(0, 1fr);
}

.terminal-ui .task-count-1 .terminal-task-row time {
  font-family: var(--font-numeric);
  font-size: var(--screen-body-size);
}

.terminal-ui .task-count-1 .terminal-task-row span {
  display: -webkit-box;
  overflow: hidden;
  font-size: 20px;
  font-weight: 720;
  line-height: 1.3;
  white-space: normal;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.terminal-ui.device-v2 .task-count-1 .terminal-task-row span {
  font-size: 24px;
}

.terminal-ui.device-v1 .task-count-1 .terminal-task-row span {
  font-size: 27px;
}

.terminal-ui .task-count-1 .terminal-task-row span {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.terminal-ui .task-count-2 .terminal-task-row,
.terminal-ui .task-count-3 .terminal-task-row {
  padding: 0 var(--screen-space-2);
}

.terminal-ui .task-count-2 .terminal-task-row span,
.terminal-ui .task-count-3 .terminal-task-row span {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.terminal-ui .notice-block {
  min-height: 156px;
  padding: var(--screen-space-4);
  gap: var(--screen-space-4);
}

.terminal-ui.device-v2 .notice-block {
  min-height: 192px;
  padding: var(--screen-space-4);
}

.terminal-ui.device-v1 .notice-block {
  min-height: 208px;
}

.terminal-ui .notice-copy strong {
  font-size: var(--screen-title-size);
  line-height: 1.3;
}

.terminal-ui .notice-copy p {
  margin-top: var(--screen-space-2);
  font-size: var(--screen-body-size);
  line-height: 1.35;
}

.terminal-ui .dialogue-quote strong {
  font-size: var(--screen-body-size);
  line-height: 1.35;
}

.terminal-ui .terminal-qr-copy strong {
  font-size: var(--screen-title-size);
  line-height: 1.32;
}

.terminal-ui .terminal-qr-copy p {
  font-size: var(--screen-body-size);
  line-height: 1.35;
}

.terminal-ui .terminal-qr-copy {
  min-width: 0;
}

.terminal-ui .terminal-qr-copy strong,
.terminal-ui .terminal-qr-copy p {
  display: -webkit-box;
  overflow: hidden;
  overflow-wrap: anywhere;
  word-break: break-all;
  white-space: normal;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.terminal-ui.device-v1 .terminal-qrcode-main.copy-long .terminal-qr-copy strong {
  font-size: 27px;
}

.terminal-ui.device-v1 .terminal-qrcode-main.copy-xlong .terminal-qr-copy strong {
  font-size: 24px;
}

.terminal-ui.device-v2 .terminal-qrcode-main.copy-long .terminal-qr-copy strong {
  font-size: 25px;
}

.terminal-ui.device-v2 .terminal-qrcode-main.copy-xlong .terminal-qr-copy strong {
  font-size: 23px;
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(20, 22, 29, 0.28);
  backdrop-filter: blur(2px);
}

.tech-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 65;
  width: min(480px, 92vw);
  padding: 20px;
  overflow-y: auto;
  color: #edf1f8;
  background: #111724;
  box-shadow: -20px 0 50px rgba(17, 23, 36, 0.24);
  transform: translateX(102%);
  transition: transform 220ms ease;
}

.tech-drawer.is-open {
  transform: translateX(0);
}

.tech-drawer header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.tech-drawer header span {
  color: #8d9bb5;
  font-family: var(--font-mono);
  font-size: 8px;
}

.tech-drawer h2 {
  margin: 7px 0 0;
  font-size: 20px;
}

.tech-drawer .icon-button {
  color: #e7ecf5;
  border-color: #3b465c;
  background: #1a2232;
}

.tech-drawer section {
  margin-top: 22px;
  padding-top: 17px;
  border-top: 1px solid #2b354a;
}

.drawer-label {
  display: block;
  margin-bottom: 8px;
  color: #8d9bb5;
  font-size: 8px;
  font-weight: 700;
}

.tech-drawer section > strong {
  color: var(--screen-brand-light);
  font-family: var(--font-mono);
  font-size: 11px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 80;
  min-width: 180px;
  padding: 10px 14px;
  color: #fff;
  border-radius: 5px;
  background: #252a36;
  box-shadow: var(--shadow);
  text-align: center;
  font-size: 10px;
  opacity: 0;
  transform: translate(-50%, 10px);
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

@keyframes terminal-blink {
  0%, 43%, 47%, 100% { transform: scaleY(1); }
  45% { transform: scaleY(0.08); }
}

@keyframes terminal-talk {
  to { transform: translateX(-50%) scaleY(0.55); }
}

@keyframes terminal-pulse {
  50% { opacity: 0.25; transform: scale(1.1); }
}

@keyframes terminal-wave {
  to { height: 12px; }
}

@keyframes terminal-dots {
  50% { opacity: 0.35; transform: translateY(-3px); }
}

.design-read-band {
  min-height: 142px;
  padding: 24px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 28px;
  color: #f6f7ff;
  border-radius: var(--card-radius);
  background: #111526;
}

.design-read-band small,
.component-subheading small {
  color: var(--screen-brand-light);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
}

.design-read-band strong {
  margin-top: 8px;
  display: block;
  font-size: 26px;
}

.design-read-band p {
  max-width: 720px;
  margin: 9px 0 0;
  color: #aeb6ca;
  font-size: 12px;
  line-height: 1.7;
}

.design-read-band dl {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(3, 100px);
  border: 1px solid #30374d;
  border-radius: 6px;
}

.design-read-band dl div {
  min-height: 74px;
  padding: 13px;
  border-right: 1px solid #30374d;
}

.design-read-band dl div:last-child {
  border-right: 0;
}

.design-read-band dt {
  color: #8e98b0;
  font-size: 9px;
}

.design-read-band dd {
  margin: 8px 0 0;
  color: var(--screen-brand-light);
  font-family: var(--font-numeric);
  font-size: 19px;
  font-weight: 750;
}

.component-subheading {
  margin: 36px 0 14px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.component-subheading h3 {
  margin: 6px 0 0;
  font-size: 18px;
}

.component-subheading p {
  max-width: 620px;
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.6;
  text-align: right;
}

.token-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--card-radius);
  background: #fff;
}

.token-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  font-size: 10px;
}

.token-table th,
.token-table td {
  padding: 13px 15px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.token-table th:last-child,
.token-table td:last-child {
  border-right: 0;
}

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

.token-table th {
  color: #555d6e;
  background: #f4f5f8;
  font-size: 9px;
}

.token-table td {
  color: var(--text);
}

.token-table code {
  color: var(--brand-deep);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
}

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

.terminal-component-grid article {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--card-radius);
  background: #fff;
}

.terminal-component-grid article > code {
  color: var(--brand-deep);
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 700;
}

.terminal-component-grid article h3 {
  margin: 12px 0 0;
  font-size: 13px;
}

.terminal-component-grid article p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.6;
}

.component-mini {
  position: relative;
  width: min(100%, 172px);
  height: auto;
  aspect-ratio: 3 / 2;
  margin: 11px auto 0;
  overflow: hidden;
  color: #f6f8ff;
  border: 1px solid #202b4c;
  border-radius: 5px;
  background: var(--screen);
}

.mini-canvas::before {
  content: "480 × 320";
  position: absolute;
  inset: 13px;
  display: grid;
  place-items: center;
  color: #8e99b2;
  border: 1px dashed #526080;
  font-family: var(--font-mono);
  font-size: 9px;
}

.mini-face i {
  position: absolute;
  top: 20px;
  width: 16px;
  height: 28px;
  border-radius: 50%;
  background: var(--screen-brand-light);
  box-shadow: 0 0 10px rgba(142, 135, 244, 0.7);
}

.mini-face i:first-child { left: 30%; }
.mini-face i:nth-child(2) { right: 30%; }
.mini-face b {
  position: absolute;
  bottom: 17px;
  left: 50%;
  width: 30px;
  height: 13px;
  border-bottom: 4px solid var(--screen-brand-light);
  border-radius: 50%;
  transform: translateX(-50%);
}

.mini-metrics {
  padding: 12px 8px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
}

.mini-metrics i {
  display: grid;
  place-items: center;
  color: var(--screen-brand-light);
  border: 1px solid #26375b;
  border-radius: 3px;
  font-family: var(--font-numeric);
  font-size: 11px;
  font-style: normal;
  font-weight: 750;
}

.mini-ranking {
  padding: 11px 14px;
  display: grid;
  grid-template-columns: 24px 1fr;
  align-content: center;
  gap: 8px;
}

.mini-ranking i {
  color: var(--screen-brand-light);
  font-family: var(--font-numeric);
  font-style: normal;
  font-weight: 800;
}

.mini-ranking b {
  font-size: 11px;
}

.mini-insight,
.mini-progress,
.mini-confirm,
.mini-error {
  padding: 14px;
  display: grid;
  align-content: center;
}

.mini-insight strong,
.mini-progress strong {
  color: var(--screen-brand-light);
  font-family: var(--font-numeric);
  font-size: 24px;
}

.mini-insight span,
.mini-confirm span {
  margin-top: 5px;
  color: #aeb7cb;
  font-size: 9px;
}

.mini-task,
.mini-list,
.mini-notice,
.mini-qr {
  padding: 12px;
  display: grid;
  align-items: center;
  gap: 8px;
}

.mini-task {
  grid-template-columns: 25px 1fr;
}

.mini-task i,
.mini-list span {
  color: var(--screen-brand-light);
  font-family: var(--font-numeric);
  font-size: 9px;
  font-style: normal;
}

.mini-task strong,
.mini-list b {
  font-size: 11px;
  line-height: 1.35;
}

.mini-list {
  grid-template-columns: 34px 1fr;
  align-content: center;
  border-top: 3px solid var(--brand-core);
}

.mini-notice {
  grid-template-columns: 40px 1fr;
}

.mini-notice i,
.mini-error i {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  color: var(--amber);
  border: 2px solid currentColor;
  border-radius: 50%;
  font-style: normal;
}

.mini-notice strong,
.mini-qr strong,
.mini-confirm strong,
.mini-error strong {
  font-size: 11px;
}

.mini-progress > i {
  height: 8px;
  margin-top: 10px;
  overflow: hidden;
  border-radius: 2px;
  background: #17223f;
}

.mini-progress > i b {
  width: 68%;
  height: 100%;
  display: block;
  background: var(--brand-core);
}

.mini-qr {
  grid-template-columns: 48px 1fr;
}

.mini-qr i {
  width: 44px;
  height: 44px;
  background: repeating-conic-gradient(#111 0 25%, #fff 0 50%) 50% / 8px 8px;
}

.mini-confirm {
  border-left: 4px solid var(--screen-brand-light);
}

.mini-confirm strong {
  margin-top: 8px;
}

.mini-error {
  grid-template-columns: 44px 1fr;
  gap: 8px;
}

.mini-error i {
  color: var(--red);
}

.composition-rule-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.composition-rule-grid article {
  min-height: 116px;
  padding: 17px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.composition-rule-grid b {
  font-size: 12px;
}

.composition-rule-grid p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.6;
}

.control-showcase {
  padding: 16px;
  display: flex;
  align-items: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  border: 1px solid var(--line);
  border-radius: var(--card-radius);
  background: #fff;
}

.spec-button {
  min-height: var(--control-height);
  padding: 0 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid var(--line-strong);
  border-radius: var(--control-radius);
  cursor: pointer;
  font-size: 10px;
  font-weight: 700;
  transition: color var(--motion-fast), border-color var(--motion-fast), background var(--motion-fast), transform var(--motion-fast);
}

.spec-button svg {
  width: 14px;
  height: 14px;
}

.spec-button.primary {
  color: #fff;
  border-color: var(--brand-deep);
  background: var(--brand-deep);
}

.spec-button.secondary {
  color: var(--brand-deep);
  border-color: #c9c6f7;
  background: var(--brand-soft);
}

.spec-button.quiet {
  color: var(--text);
  background: #fff;
}

.spec-button:hover,
.spec-segmented button:hover {
  border-color: var(--brand-core);
}

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

.spec-button.is-disabled {
  color: #858b98;
  border-color: var(--line);
  background: #f1f3f6;
  cursor: not-allowed;
}

.spec-button.is-disabled:hover {
  border-color: var(--line);
}

.pattern-download.is-disabled,
.expression-downloads.is-deprecated span {
  color: #858b98;
  border-color: var(--line);
  background: #f1f3f6;
  cursor: not-allowed;
}

.spec-segmented,
.atlas-device-switch {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line-strong);
  border-radius: var(--control-radius);
  background: #fff;
}

.spec-segmented button,
.atlas-device-switch button {
  min-height: 34px;
  padding: 0 10px;
  border: 0;
  border-right: 1px solid var(--line);
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-size: 9px;
}

.spec-segmented button:last-child,
.atlas-device-switch button:last-child {
  border-right: 0;
}

.spec-segmented button.is-active,
.atlas-device-switch button.is-active {
  color: var(--brand-deep);
  background: var(--brand-soft);
  font-weight: 750;
}

.spec-select {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
}

.spec-select select {
  min-width: 170px;
  height: var(--control-height);
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--control-radius);
  color: var(--ink);
  background: #fff;
  font-size: 10px;
}

.atlas-toolbar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) 220px;
}

.atlas-device-switch {
  flex: none;
}

.atlas-device-switch > span {
  padding: 0 9px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
}

.home-system-section {
  --home-screen: #071026;
  --home-line: rgba(185, 194, 224, 0.18);
  --home-text: #f7f8ff;
  --home-muted: #a9b2cf;
}

.home-boundary-banner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(220px, auto);
  align-items: center;
  gap: 14px;
  margin: 24px 0;
  padding: 16px;
  border: 1px solid #d7dbea;
  background: #f7f8fc;
}

.home-boundary-banner > div {
  display: flex;
  align-items: center;
  gap: 12px;
}

.home-boundary-banner > div > svg { width: 24px; color: var(--brand-deep); }
.home-boundary-banner span { display: grid; gap: 4px; }
.home-boundary-banner b { font-size: 14px; }
.home-boundary-banner small { color: var(--muted); line-height: 1.45; }
.home-boundary-banner > strong { color: #b4233b; font-size: 12px; text-align: right; }

.home-spec-layout {
  display: grid;
  grid-template-columns: minmax(520px, 1.18fr) minmax(280px, 0.82fr);
  gap: 24px;
  align-items: stretch;
}

.home-spec-preview {
  margin: 0;
  padding: 24px;
  min-width: 0;
  overflow-x: auto;
  border: 1px solid #d8dde9;
  background: #f4f6fa;
}

.home-spec-render-stage {
  width: 480px;
  height: 320px;
  overflow: hidden;
  background: var(--home-screen);
  box-shadow: 0 18px 38px rgba(17, 24, 45, 0.22);
}

.home-spec-render-stage > .home-atlas-ui { width: 480px !important; height: 320px !important; }

.home-spec-preview figcaption { width: 480px; margin-top: 34px; display: flex; align-items: baseline; gap: 10px; }
.home-spec-preview figcaption span { padding: 3px 7px; color: #fff; background: var(--brand-deep); font-size: 10px; }
.home-spec-preview figcaption b { font-size: 12px; }
.home-spec-preview figcaption small { margin-left: auto; color: var(--muted); font-size: 10px; }

.home-anatomy-panel {
  padding: 24px;
  border: 1px solid #d8dde9;
  background: #fff;
}
.home-anatomy-panel header small { color: var(--brand-deep); font: 700 10px/1 ui-monospace, monospace; }
.home-anatomy-panel header h3 { margin: 8px 0 0; font-size: 22px; }
.home-anatomy-panel ol { margin: 24px 0; padding: 0; display: grid; gap: 0; list-style: none; counter-reset: anatomy; }
.home-anatomy-panel li { counter-increment: anatomy; display: grid; grid-template-columns: 28px 120px 1fr; gap: 10px; padding: 14px 0; border-top: 1px solid #e3e6ef; }
.home-anatomy-panel li::before { content: counter(anatomy, decimal-leading-zero); color: var(--brand-deep); font: 700 11px/1.5 ui-monospace, monospace; }
.home-anatomy-panel li b { font-size: 13px; }
.home-anatomy-panel li span { color: var(--muted); font-size: 12px; line-height: 1.55; }
.home-screen-ids { display: grid; gap: 8px; padding: 14px; background: #f1f0ff; }
.home-screen-ids span { font-size: 12px; }

.home-route-map { display: grid; grid-template-columns: 180px auto 1fr; gap: 18px; align-items: center; }
.home-route-map > svg { color: var(--brand-deep); }
.home-route-map article { min-width: 0; padding: 14px; border: 1px solid #d8dde9; background: #fff; }
.home-route-map article b, .home-route-map article small, .home-route-map article span { display: block; }
.home-route-map article b { margin: 8px 0 4px; font-size: 14px; }
.home-route-map article small { color: var(--muted); font-size: 11px; }
.home-route-map .route-root { border-left: 4px solid var(--brand-core); }
.route-branches { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.route-branches article > svg { width: 22px; color: var(--brand-deep); }
.route-branches article span { min-height: 32px; font-size: 10px; line-height: 1.45; }

.home-secondary-grid { margin-top: 24px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.home-secondary-grid > article { min-width: 0; min-height: 198px; padding: 18px; border: 1px solid #d8dde9; border-top: 4px solid var(--brand-core); background: #fff; }
.home-secondary-grid header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.home-secondary-grid > article > svg { width: 28px; height: 28px; margin-top: 24px; color: var(--brand-deep); }
.home-secondary-grid h3 { margin: 10px 0 7px; font-size: 17px; }
.home-secondary-grid p { min-height: 48px; margin: 0 0 12px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.home-secondary-grid > article > small { color: var(--brand-deep); }

.home-component-table { border: 1px solid #d8dde9; background: #fff; overflow-x: auto; }
.home-component-table > div { min-width: 850px; display: grid; grid-template-columns: 190px minmax(300px, 1fr) 210px 160px; }
.home-component-table > div > * { padding: 12px 14px; border-right: 1px solid #e4e7ef; border-bottom: 1px solid #e4e7ef; font-size: 12px; line-height: 1.45; }
.home-component-table > div > *:last-child { border-right: 0; }
.home-component-head { background: #f1f0ff; font-weight: 700; }

.home-status-mode-map {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--card-radius);
  background: #fff;
}

.home-status-mode-map > div {
  min-width: 0;
  padding: 14px;
  border-right: 1px solid var(--line);
}

.home-status-mode-map > div:last-of-type { border-right: 0; }
.home-status-mode-map code { display: block; color: var(--brand-deep); font-family: var(--font-mono); font-size: 9px; font-weight: 700; }
.home-status-mode-map b, .home-status-mode-map span { display: block; }
.home-status-mode-map b { margin-top: 7px; color: var(--text); font-size: 12px; }
.home-status-mode-map span, .home-status-mode-map p { margin: 6px 0 0; color: var(--muted); font-size: 9px; line-height: 1.55; }
.home-status-mode-map p { grid-column: 1 / -1; margin: 0; padding: 10px 14px; border-top: 1px solid var(--line); background: #f4f4ff; }
.home-status-mode-map p code { display: inline; font-size: inherit; }

.home-rules-grid { margin-top: 20px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.home-rules-grid article { padding: 16px; border: 1px solid #d8dde9; background: #fff; }
.home-rules-grid article b { display: block; margin: 16px 0 7px; font-size: 14px; }
.home-rules-grid article p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.55; }

.template-profile-unavailable {
  min-height: 136px;
  padding: 18px;
  display: grid;
  align-content: center;
  gap: 8px;
  color: #755200;
  background: #fff7df;
  border: 1px solid #f0d58a;
}
.template-profile-unavailable b { font-size: 14px; }
.template-profile-unavailable span { font-size: 12px; line-height: 1.55; }

@media (max-width: 1220px) {
  .home-boundary-banner { grid-template-columns: 1fr; }
  .home-boundary-banner > svg { display: none; }
  .home-boundary-banner > strong { text-align: left; }
  .home-spec-layout { grid-template-columns: 1fr; }
  .home-anatomy-panel { min-height: 0; }
  .home-secondary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-route-map { grid-template-columns: 150px auto minmax(0, 1fr); }
  .route-branches { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-rules-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-status-mode-map { grid-template-columns: 1fr; }
  .home-status-mode-map > div { border-right: 0; border-bottom: 1px solid var(--line); }
  .home-status-mode-map > div:last-of-type { border-bottom: 0; }
}

@media (max-width: 640px) {
  .home-spec-preview { padding: 24px 12px; }
  .home-spec-preview figcaption { align-items: flex-start; flex-direction: column; }
  .home-spec-preview figcaption small { margin-left: 0; }
  .home-anatomy-panel { padding: 18px; }
  .home-anatomy-panel li { grid-template-columns: 24px 1fr; }
  .home-anatomy-panel li span { grid-column: 2; }
  .home-route-map { grid-template-columns: 1fr; }
  .home-route-map > svg { transform: rotate(90deg); justify-self: center; }
  .route-branches, .home-secondary-grid, .home-rules-grid { grid-template-columns: 1fr; }
  .home-secondary-grid > article { min-height: 0; }
}

@media (max-width: 1500px) {
  .workbench-stage {
    grid-template-columns: minmax(300px, 0.78fr) minmax(390px, 1.3fr) 230px;
  }

  .speech-bubble {
    width: 170px;
  }

  .screen-atlas-grid {
    grid-template-columns: repeat(3, minmax(210px, 1fr));
  }

  .expression-grid {
    grid-template-columns: repeat(5, minmax(120px, 1fr));
  }

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

  .device-state-flow {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1220px) {
  .doc-shell {
    grid-template-columns: 220px minmax(0, 1fr);
  }

  .workbench-toolbar { grid-template-columns: repeat(3, minmax(150px, 1fr)); }

  .workbench-stage {
    grid-template-columns: minmax(390px, 1fr) 342px;
  }

  .scenario-explainer {
    display: none;
  }

  .screen-atlas-grid {
    grid-template-columns: repeat(2, minmax(220px, 1fr));
  }

  .expression-grid {
    grid-template-columns: repeat(4, minmax(120px, 1fr));
  }

  .state-flow {
    overflow-x: auto;
    grid-template-columns: repeat(7, minmax(150px, 1fr));
  }

  .p0-scene-row {
    grid-template-columns: 48px minmax(170px, 0.7fr) minmax(260px, 1.3fr);
  }

  .p0-handoff {
    grid-column: 2 / -1;
    border-top: 1px solid var(--line);
  }

  .design-read-band {
    grid-template-columns: 1fr;
  }

  .design-read-band dl {
    justify-self: start;
  }

  .terminal-component-grid,
  .composition-rule-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .atlas-toolbar {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .device-state-flow {
    grid-template-columns: 1fr;
  }

  .search-field {
    grid-column: 1 / -1;
    width: 100%;
  }
}

@media (max-width: 960px) {
  .doc-shell {
    display: block;
  }

  .doc-rail {
    display: none;
  }

  .doc-header {
    padding-inline: 18px;
  }

  .overview-grid,
  .foundation-layout,
  .voice-layout {
    grid-template-columns: 1fr;
  }

  .screen-anatomy {
    min-height: 0;
    padding: 28px;
  }

  .screen-anatomy .ruler,
  .screen-anatomy .safe-label {
    display: none;
  }

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

  .segmented {
    grid-column: 1 / -1;
  }

  .workbench-stage {
    grid-template-columns: 1fr;
  }

  .robot-context {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .screen-inspection {
    display: grid;
    justify-items: center;
    border-right: 0;
  }

  .inspection-head,
  .screen-meta {
    width: 320px;
  }

  .rule-grid,
  .contract-principles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .permission-split {
    grid-template-columns: 1fr 1fr;
  }

  .permission-route {
    grid-column: 1 / -1;
    min-height: 190px !important;
    border-top: 1px solid var(--line);
  }

  .acceptance-columns {
    grid-template-columns: 1fr;
  }

  .component-subheading {
    display: block;
  }

  .component-subheading p {
    margin-top: 8px;
    text-align: left;
  }
}

@media (max-width: 640px) {
  .doc-header {
    height: 58px;
  }

  .doc-header > div:first-child span,
  .header-status > span:not(.status-dot) {
    display: none;
  }

  .doc-section {
    padding: 40px 16px 46px;
    scroll-margin-top: 58px;
  }

  .section-heading {
    display: block;
  }

  .section-heading > .maturity-tag,
  .section-heading > .demo-badge,
  .section-heading > .atlas-count {
    margin-top: 14px;
  }

  .section-heading h2 {
    font-size: 24px;
  }

  .overview-copy h1 {
    font-size: 38px;
  }

  .overview-lead {
    font-size: 14px;
  }

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

  .principle-strip div:nth-child(2) {
    border-right: 0;
  }

  .principle-strip div:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .maturity-legend {
    grid-template-columns: auto 1fr;
  }

  .workbench-toolbar {
    grid-template-columns: 1fr;
  }

  .segmented {
    grid-column: auto;
  }

  .device-baseline-strip {
    grid-template-columns: 1fr;
  }

  .device-baseline-strip article + article {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .robot-context {
    min-height: 480px;
  }

  .robot-figure {
    min-width: 350px;
    width: 350px;
  }

  .speech-bubble {
    width: 150px;
  }

  .user-bubble {
    top: 292px;
    right: 8px;
  }

  .fubao-bubble {
    top: 292px;
    left: 8px;
  }

  .screen-inspection {
    padding-inline: 0;
    overflow: hidden;
  }

  .screen-inspector,
  .inspection-head,
  .screen-meta {
    width: 320px;
  }

  .timeline-step {
    min-width: 48px;
    font-size: 7px;
  }

  .screen-anatomy {
    min-height: 320px;
    padding: 28px 0;
    overflow: hidden;
  }

  .ruler {
    display: none;
  }

  .token-grid,
  .rule-grid,
  .voice-rules,
  .contract-principles {
    grid-template-columns: 1fr;
  }

  .atlas-toolbar {
    top: 58px;
    display: grid;
    grid-template-columns: 1fr;
  }

  .atlas-device-switch {
    width: 100%;
  }

  .atlas-device-switch button {
    flex: 1;
    min-height: 44px;
  }

  .design-read-band {
    padding: 18px;
  }

  .design-read-band dl {
    width: 100%;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .design-read-band dl div {
    min-width: 0;
    padding: 10px;
  }

  .terminal-component-grid,
  .composition-rule-grid {
    grid-template-columns: 1fr;
  }

  .control-showcase > .spec-button,
  .control-showcase > .spec-segmented,
  .control-showcase > .spec-select {
    width: 100%;
  }

  .spec-button,
  .spec-segmented button,
  .spec-select select {
    min-height: 44px;
  }

  .search-field {
    width: 100%;
  }

  .screen-atlas-grid {
    grid-template-columns: 1fr;
  }

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

  .earcon-table > div {
    grid-template-columns: 64px 1fr;
  }

  .earcon-table > div > :last-child {
    grid-column: 2;
  }

  .p0-scene-row {
    grid-template-columns: 44px 1fr;
  }

  .p0-flow,
  .p0-handoff {
    grid-column: 1 / -1;
    border-top: 1px solid var(--line);
  }

  .permission-split {
    grid-template-columns: 1fr;
  }

  .permission-split > div {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .permission-route {
    grid-column: auto;
  }

  .lifecycle-principle-band,
  .device-transaction-list {
    grid-template-columns: 1fr;
  }

  .lifecycle-principle-band > div,
  .device-transaction-list article {
    min-height: 0;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .lifecycle-principle-band > div:last-child,
  .device-transaction-list article:last-child {
    border-bottom: 0;
  }

  .voice-machine-section .component-subheading .spec-button {
    width: 100%;
    margin-top: 12px;
  }

  .contract-table {
    grid-template-columns: 1fr;
  }

  .registry-summary,
  .template-registry-grid,
  .template-registry-columns {
    grid-template-columns: 1fr;
  }

  .registry-summary article {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .registry-summary article:last-child {
    border-bottom: 0;
  }

  .registry-runtime-flow {
    align-items: stretch;
    flex-direction: column;
  }

  .registry-runtime-flow > svg {
    align-self: center;
    transform: rotate(90deg);
  }

  .registry-toolbar {
    top: 58px;
    display: grid;
    grid-template-columns: 1fr;
  }

  .registry-toolbar .search-field {
    margin-left: 0;
  }

  .registry-filter,
  .registry-filter select {
    width: 100%;
  }

  .registry-downloads {
    flex-direction: column;
  }
}

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