:root {
  color-scheme: light;
  --brand: #ee3c23;
  --brand-start: #fc6753;
  --brand-end: #ff3f36;
  --brand-soft: #ffeae8;
  --text-primary: #333333;
  --text-secondary: #666666;
  --text-tertiary: #999999;
  --text-disabled: #c4c4c4;
  --surface-page: #f5f4f5;
  --surface-card: #ffffff;
  --surface-control: #f8f8f8;
  --surface-image: #f9f9f9;
  --divider: #eeeeee;
  --warning-bg: #fffce8;
  --warning-text: #e0823f;
  --success: #179839;
  --link: #258cf2;
  --danger-bg: #fff2f0;
  --danger-text: #ee3c23;
  --overlay: rgba(0, 0, 0, 0.45);
  --font-10: 10px;
  --font-12: 12px;
  --font-14: 14px;
  --font-16: 16px;
  --font-18: 18px;
  --font-20: 20px;
  --line-10: 14px;
  --line-12: 17px;
  --line-14: 20px;
  --line-16: 22px;
  --line-18: 24px;
  --line-20: 28px;
  --radius-xs: 2px;
  --radius-s: 4px;
  --radius-m: 8px;
  --radius-l: 12px;
  --radius-pill: 24px;
  --page-padding: 16px;
  --content-width: 1180px;
  --font-ui: "PingFang SC", "SF Pro Text", -apple-system,
    BlinkMacSystemFont, "Segoe UI", Roboto, "Microsoft YaHei", sans-serif;
  --font-number: "DIN Alternate", "Arial Narrow", var(--font-ui);
}

html[data-text-scale="large"] {
  --font-10: 15px;
  --font-12: 18px;
  --font-14: 21px;
  --font-16: 24px;
  --font-18: 27px;
  --font-20: 30px;
  --line-10: 21px;
  --line-12: 26px;
  --line-14: 30px;
  --line-16: 33px;
  --line-18: 36px;
  --line-20: 42px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 16px;
}

body {
  margin: 0;
  background: var(--surface-page);
  color: var(--text-secondary);
  font-family: var(--font-ui);
  font-size: var(--font-14);
  line-height: var(--line-14);
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

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

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

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

p,
h1,
h2,
h3,
h4,
dl,
dd,
ol,
ul,
figure {
  margin: 0;
}

button:focus-visible,
a:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 2px;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 8px;
  left: 16px;
  min-height: 44px;
  padding: 12px 16px;
  border-radius: var(--radius-m);
  background: var(--text-primary);
  color: #ffffff;
  transform: translateY(-160%);
  transition: transform 180ms ease-out;
}

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

.reading-progress {
  position: fixed;
  z-index: 999;
  inset: 0 0 auto;
  height: 2px;
  background: transparent;
}

.reading-progress span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--brand);
}

.hero {
  background: var(--surface-page);
  color: var(--text-primary);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(var(--content-width), calc(100% - 32px));
  min-height: 44px;
  margin-inline: auto;
  border-bottom: 1px solid var(--divider);
  background: var(--surface-card);
}

.hero::before {
  position: absolute;
  z-index: -1;
  inset: 0 0 auto;
  height: 44px;
  background: var(--surface-card);
  content: "";
}

.brand,
.topbar-actions,
.icon-button {
  display: flex;
  align-items: center;
}

.brand {
  min-height: 44px;
  gap: 12px;
  color: var(--text-primary);
  font-size: var(--font-14);
  font-weight: 600;
}

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

.topbar-actions {
  gap: 4px;
}

.icon-button {
  justify-content: center;
  min-width: 56px;
  min-height: 44px;
  padding: 0 12px;
  border: 0;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: var(--font-14);
  font-weight: 500;
  transition: color 180ms ease-out, background 180ms ease-out;
}

.icon-button:hover,
.icon-button:focus-visible,
.icon-button[aria-pressed="true"] {
  background: var(--brand-soft);
  color: var(--brand);
}

.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.82fr);
  gap: 16px;
  align-items: stretch;
  width: min(var(--content-width), calc(100% - 32px));
  margin-inline: auto;
  padding: 24px 0 32px;
}

.hero-copy,
.hero-card {
  min-width: 0;
}

.hero-copy {
  padding: 24px 0;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  color: var(--brand);
  font-size: var(--font-12);
  line-height: var(--line-12);
  font-weight: 600;
}

.eyebrow span {
  width: 20px;
  height: 2px;
  border-radius: var(--radius-xs);
  background: var(--brand);
}

.hero h1 {
  color: var(--text-primary);
  font-size: var(--font-20);
  line-height: var(--line-20);
  font-weight: 700;
}

.hero h1 em {
  color: inherit;
  font-style: normal;
}

.hero-lead {
  max-width: 680px;
  margin-top: 12px;
  color: var(--text-secondary);
  font-size: var(--font-14);
  line-height: var(--line-14);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.primary-action,
.secondary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 24px;
  border-radius: var(--radius-pill);
  font-size: var(--font-16);
  line-height: var(--line-16);
  font-weight: 500;
  transition: opacity 180ms ease-out, transform 180ms ease-out;
}

.primary-action {
  background: linear-gradient(90deg, var(--brand-start), var(--brand-end));
  color: #ffffff;
}

.secondary-action {
  border: 1px solid var(--brand);
  background: var(--surface-card);
  color: var(--brand);
}

.primary-action:hover,
.secondary-action:hover {
  opacity: 0.9;
}

.primary-action:active,
.secondary-action:active {
  transform: scale(0.98);
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  max-width: 620px;
  margin-top: 24px;
  border-top: 1px solid var(--divider);
  border-bottom: 1px solid var(--divider);
  background: var(--surface-card);
}

.hero-stats div {
  padding: 12px 16px;
}

.hero-stats div + div {
  border-left: 1px solid var(--divider);
}

.hero-stats dt {
  color: var(--text-primary);
  font-size: var(--font-16);
  line-height: var(--line-16);
  font-weight: 600;
}

.hero-stats dd {
  margin-top: 4px;
  color: var(--text-tertiary);
  font-size: var(--font-12);
  line-height: var(--line-12);
}

.hero-card {
  align-self: center;
  padding: 20px;
  border: 1px solid var(--divider);
  border-radius: var(--radius-m);
  background: var(--surface-card);
}

.hero-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-primary);
  font-size: var(--font-16);
  line-height: var(--line-16);
  font-weight: 600;
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
}

.hero-card-date {
  margin-left: auto;
  color: var(--text-tertiary);
  font-size: var(--font-12);
  line-height: var(--line-12);
  font-weight: 400;
}

.route-preview {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 20px minmax(0, 1fr) 20px minmax(0, 1fr);
  align-items: center;
  margin-top: 20px;
}

.route-preview > i {
  height: 1px;
  background: var(--divider);
}

.route-node {
  display: flex;
  min-height: 72px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px;
  border: 1px solid var(--divider);
  border-radius: var(--radius-m);
  background: var(--surface-control);
  color: var(--text-secondary);
  text-align: center;
}

.route-node b {
  color: var(--text-tertiary);
  font-family: var(--font-number);
  font-size: var(--font-12);
  line-height: var(--line-12);
}

.route-node span {
  font-size: var(--font-14);
  line-height: var(--line-14);
  font-weight: 600;
}

.route-node.done,
.route-node.active {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand);
}

.route-node.done b,
.route-node.active b {
  color: var(--brand);
}

.hero-card-note {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--divider);
  color: var(--text-tertiary);
  font-size: var(--font-12);
  line-height: var(--line-12);
}

.layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 16px;
  width: min(var(--content-width), calc(100% - 32px));
  margin: 0 auto 40px;
}

.side-nav {
  position: sticky;
  top: 16px;
  align-self: start;
  overflow: hidden;
  border: 1px solid var(--divider);
  border-radius: var(--radius-m);
  background: var(--surface-card);
}

.side-nav-toggle {
  display: none;
}

.side-nav-list {
  display: flex;
  flex-direction: column;
  padding: 8px 0;
}

.side-nav-list a {
  display: grid;
  grid-template-columns: 28px 1fr;
  align-items: center;
  min-height: 44px;
  padding: 8px 16px;
  color: var(--text-secondary);
  font-size: var(--font-14);
  line-height: var(--line-14);
  transition: background 180ms ease-out, color 180ms ease-out;
}

.side-nav-list a span {
  color: var(--text-tertiary);
  font-family: var(--font-number);
  font-size: var(--font-12);
  line-height: var(--line-12);
}

.side-nav-list a:hover,
.side-nav-list a.active {
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 600;
}

.side-nav-list a.active span {
  color: var(--brand);
}

.side-help {
  margin: 0 12px 12px;
  padding: 12px;
  border-radius: var(--radius-s);
  background: var(--warning-bg);
}

.side-help b {
  color: var(--warning-text);
  font-size: var(--font-14);
  line-height: var(--line-14);
}

.side-help p {
  margin-top: 4px;
  color: var(--text-secondary);
  font-size: var(--font-12);
  line-height: var(--line-12);
}

main {
  min-width: 0;
}

.section {
  margin-bottom: 12px;
  padding: 24px;
  border-radius: var(--radius-m);
  background: var(--surface-card);
}

.section-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--divider);
}

.section-no {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 28px;
  padding: 0 8px;
  border-radius: var(--radius-pill);
  background: var(--brand);
  color: #ffffff;
  font-family: var(--font-number);
  font-size: var(--font-14);
  line-height: var(--line-14);
  font-weight: 700;
}

.section-heading > div > p {
  color: var(--text-tertiary);
  font-size: var(--font-10);
  line-height: var(--line-10);
}

.section-heading h2 {
  margin-top: 2px;
  color: var(--text-primary);
  font-size: var(--font-20);
  line-height: var(--line-20);
  font-weight: 700;
}

.callout {
  display: block;
  margin: 16px 0;
  padding: 12px 16px;
  border-left: 3px solid var(--text-tertiary);
  border-radius: var(--radius-s);
  background: var(--surface-control);
}

.callout-icon {
  display: none;
}

.callout b {
  color: var(--text-primary);
  font-size: var(--font-14);
  line-height: var(--line-14);
  font-weight: 600;
}

.callout p {
  margin-top: 4px;
  color: var(--text-secondary);
  font-size: var(--font-14);
  line-height: var(--line-14);
}

.callout.warning {
  border-left-color: var(--warning-text);
  background: var(--warning-bg);
}

.callout.warning b {
  color: var(--warning-text);
}

.callout.info {
  border-left-color: var(--link);
  background: #f1f7fe;
}

.callout.danger {
  border-left-color: var(--brand);
  background: var(--danger-bg);
}

.callout.danger b {
  color: var(--danger-text);
}

.callout.small {
  margin: 12px 0 0;
}

.workflow {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  overflow: hidden;
  padding: 0;
  border: 1px solid var(--divider);
  border-radius: var(--radius-m);
  list-style: none;
}

.workflow li {
  display: flex;
  min-width: 0;
  gap: 8px;
  padding: 16px 12px;
  background: var(--surface-card);
}

.workflow li + li {
  border-left: 1px solid var(--divider);
}

.workflow li > span,
.number-steps li > span,
.logic-grid article > span,
.instruction-no {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand);
  font-family: var(--font-number);
  font-size: var(--font-12);
  line-height: var(--line-12);
  font-weight: 700;
}

.workflow b,
.number-steps b {
  color: var(--text-primary);
  font-size: var(--font-14);
  line-height: var(--line-14);
  font-weight: 600;
}

.workflow p,
.number-steps p {
  margin-top: 4px;
  color: var(--text-tertiary);
  font-size: var(--font-12);
  line-height: var(--line-12);
}

.branch-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.branch-card {
  padding: 16px;
  border: 1px solid var(--divider);
  border-radius: var(--radius-m);
  background: var(--surface-card);
}

.branch-card > span,
.branch-section-head > span,
.dual-code-title > span,
.logic-title > span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: var(--brand-soft);
  color: var(--brand);
  font-size: var(--font-12);
  line-height: var(--line-12);
  font-weight: 600;
}

.branch-card h3 {
  margin-top: 8px;
  color: var(--text-primary);
  font-size: var(--font-16);
  line-height: var(--line-16);
  font-weight: 600;
}

.branch-card p {
  margin-top: 4px;
  color: var(--text-secondary);
  font-size: var(--font-14);
  line-height: var(--line-14);
}

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

.info-card,
.instruction-card {
  padding: 16px;
  border: 1px solid var(--divider);
  border-radius: var(--radius-m);
  background: var(--surface-card);
}

.info-card.tint {
  background: var(--surface-control);
}

.info-card.danger-tint {
  background: var(--danger-bg);
}

.info-card h3,
.instruction-card h3,
.action-cards h3,
.offline-map h3 {
  color: var(--text-primary);
  font-size: var(--font-16);
  line-height: var(--line-16);
  font-weight: 600;
}

.check-list,
.cross-list {
  display: grid;
  gap: 8px;
  padding: 0;
  list-style: none;
}

.info-card h3 + .check-list,
.info-card h3 + .cross-list {
  margin-top: 12px;
}

.check-list li,
.cross-list li {
  position: relative;
  padding-left: 16px;
  color: var(--text-secondary);
  font-size: var(--font-14);
  line-height: var(--line-14);
}

.check-list li::before,
.cross-list li::before {
  position: absolute;
  top: 8px;
  left: 0;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
  content: "";
}

.cross-list li::before {
  background: var(--brand);
}

.check-list.compact {
  margin-top: 16px;
}

.color-key,
.field-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.color-key > div {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.dot {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  margin-top: 6px;
  border-radius: 50%;
}

.dot.red { background: var(--brand); }
.dot.blue { background: var(--link); }
.dot.orange { background: var(--warning-text); }
.dot.gray { background: var(--text-tertiary); }

.color-key dd,
.field-list dd {
  color: var(--text-secondary);
  font-size: var(--font-14);
  line-height: var(--line-14);
}

.color-key b {
  color: var(--text-primary);
  font-weight: 600;
}

.shot-grid {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

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

.shot-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--divider);
  border-radius: var(--radius-m);
  background: var(--surface-card);
}

.shot-button {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: var(--surface-image);
  cursor: zoom-in;
}

.phone-shot {
  position: relative;
  display: block;
  overflow: hidden;
  background: var(--surface-image);
}

.phone-shot img {
  width: 100%;
  height: auto;
  object-fit: contain;
}

.phone-shot.crop-top {
  max-height: 420px;
}

.shot-card figcaption {
  display: grid;
  gap: 4px;
  padding: 12px;
  border-top: 1px solid var(--divider);
}

.shot-card figcaption b {
  color: var(--text-primary);
  font-size: var(--font-14);
  line-height: var(--line-14);
  font-weight: 600;
}

.shot-card figcaption span {
  color: var(--text-tertiary);
  font-size: var(--font-12);
  line-height: var(--line-12);
}

.pin {
  position: absolute;
  z-index: 2;
  left: var(--x);
  top: var(--y);
  width: 0;
  height: 0;
  pointer-events: none;
}

.pin i {
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 3px solid var(--brand);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.8);
  color: var(--brand);
  font-family: var(--font-number);
  font-size: var(--font-12);
  line-height: var(--line-12);
  font-style: normal;
  font-weight: 700;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.92), 0 1px 4px rgba(0, 0, 0, 0.18);
  transform: translate(-50%, -50%);
}

.pin b {
  position: absolute;
  top: 0;
  left: 24px;
  max-width: 132px;
  padding: 4px 8px;
  border-radius: var(--radius-s);
  background: rgba(51, 51, 51, 0.88);
  color: #ffffff;
  font-size: var(--font-10);
  line-height: var(--line-10);
  font-weight: 500;
  white-space: nowrap;
  transform: translateY(-50%);
}

.pin.align-right b {
  right: 24px;
  left: auto;
}

.instruction-card {
  display: flex;
  flex-direction: column;
}

.instruction-card h3 {
  margin-top: 12px;
}

.instruction-card > p {
  margin-top: 8px;
  color: var(--text-secondary);
}

.instruction-card ul {
  display: grid;
  gap: 8px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.instruction-card li {
  padding: 8px 0;
  border-bottom: 1px solid var(--divider);
  color: var(--text-primary);
}

.choice-preview {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.choice-preview > span {
  display: grid;
  gap: 2px;
  padding: 12px;
  border: 1px solid var(--divider);
  border-radius: var(--radius-m);
  background: var(--surface-card);
}

.choice-preview > span.primary {
  border-color: var(--brand);
  background: var(--brand-soft);
}

.choice-preview b {
  color: var(--text-primary);
  font-size: var(--font-14);
}

.choice-preview .primary b {
  color: var(--brand);
}

.choice-preview small,
.choice-warning {
  color: var(--text-tertiary);
  font-size: var(--font-12);
  line-height: var(--line-12);
}

.choice-warning {
  margin-top: auto !important;
  padding-top: 12px;
}

.table-wrap {
  overflow-x: auto;
  margin-top: 16px;
  border: 1px solid var(--divider);
  border-radius: var(--radius-m);
  background: var(--surface-card);
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
}

th,
td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--divider);
  text-align: left;
  vertical-align: top;
  font-size: var(--font-14);
  line-height: var(--line-14);
}

th {
  background: var(--surface-control);
  color: var(--text-primary);
  font-weight: 600;
}

td {
  color: var(--text-secondary);
}

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

td strong {
  color: var(--brand);
  font-weight: 600;
}

.status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: var(--surface-control);
  color: var(--text-secondary);
  font-size: var(--font-12);
  line-height: var(--line-12);
}

.status.success {
  background: #ecf8ef;
  color: var(--success);
}

.number-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin-top: 16px;
  padding: 0;
  border: 1px solid var(--divider);
  border-radius: var(--radius-m);
  list-style: none;
}

.number-steps li {
  display: flex;
  gap: 8px;
  padding: 16px;
}

.number-steps li + li {
  border-left: 1px solid var(--divider);
}

.split-feature {
  display: grid;
  grid-template-columns: minmax(300px, 0.9fr) minmax(0, 1.1fr);
  gap: 12px;
}

.content-stack {
  display: grid;
  align-content: start;
  gap: 12px;
}

.content-stack .callout {
  margin: 0;
}

.field-list > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--divider);
}

.field-list > div:last-child {
  border-bottom: 0;
}

.field-list dt {
  color: var(--text-primary);
  font-weight: 600;
}

.logic-flow {
  margin-top: 16px;
  padding: 16px;
  border-radius: var(--radius-m);
  background: var(--surface-control);
}

.logic-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.logic-title b {
  color: var(--text-primary);
  font-size: var(--font-16);
  line-height: var(--line-16);
  font-weight: 600;
}

.logic-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  margin-top: 12px;
  border: 1px solid var(--divider);
  border-radius: var(--radius-m);
  background: var(--divider);
}

.logic-grid article {
  padding: 16px;
  background: var(--surface-card);
}

.logic-grid article > b {
  display: block;
  margin-top: 8px;
  color: var(--text-primary);
  font-size: var(--font-14);
  line-height: var(--line-14);
  font-weight: 600;
}

.logic-grid article > p {
  margin-top: 4px;
  color: var(--text-secondary);
  font-size: var(--font-12);
  line-height: var(--line-12);
}

.action-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.action-cards > article {
  padding: 16px;
  border: 1px solid var(--divider);
  border-left: 3px solid var(--text-tertiary);
  border-radius: var(--radius-m);
}

.action-cards > article:has(.orange) { border-left-color: var(--warning-text); }
.action-cards > article:has(.blue) { border-left-color: var(--link); }
.action-cards > article:has(.red) { border-left-color: var(--brand); }

.action-icon {
  display: none;
}

.action-cards p {
  margin-top: 8px;
  color: var(--text-secondary);
}

.action-cards small {
  display: block;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--divider);
  color: var(--text-tertiary);
  font-size: var(--font-12);
  line-height: var(--line-12);
}

.branch-section {
  padding: 20px 0;
  border-top: 1px solid var(--divider);
}

.branch-section:first-of-type {
  padding-top: 0;
  border-top: 0;
}

.branch-section:last-child {
  padding-bottom: 0;
}

.branch-section-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.branch-section-head h3 {
  color: var(--text-primary);
  font-size: var(--font-18);
  line-height: var(--line-18);
  font-weight: 600;
}

.branch-section-head p {
  margin-top: 4px;
  color: var(--text-secondary);
}

.branch-rules {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  margin-top: 12px;
  border: 1px solid var(--divider);
  border-radius: var(--radius-m);
  background: var(--divider);
}

.branch-rules > div {
  padding: 16px;
  background: var(--surface-card);
}

.branch-rules b,
.warehouse-action-flow h4,
.dual-code li b {
  color: var(--text-primary);
  font-size: var(--font-14);
  line-height: var(--line-14);
  font-weight: 600;
}

.branch-rules p,
.warehouse-action-flow p,
.dual-code li p {
  margin-top: 4px;
  color: var(--text-secondary);
  font-size: var(--font-14);
  line-height: var(--line-14);
}

.warehouse-action-flow {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.warehouse-action-flow > article {
  padding: 16px;
  border: 1px solid var(--divider);
  border-radius: var(--radius-m);
  background: var(--surface-card);
}

.warehouse-action-flow > article.danger {
  border-color: #ffd0cb;
  background: var(--danger-bg);
}

.warehouse-action-flow > i {
  display: none;
}

.warehouse-action-flow article > span,
.offline-map article > span {
  color: var(--text-tertiary);
  font-size: var(--font-12);
  line-height: var(--line-12);
  font-style: normal;
}

.warehouse-action-flow h4 {
  margin-top: 4px;
}

.warehouse-action-flow article > div {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 12px;
}

.warehouse-action-flow article > div b {
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: var(--surface-control);
  color: var(--text-secondary);
  font-size: var(--font-12);
  line-height: var(--line-12);
  font-weight: 500;
}

.dual-code {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid var(--divider);
  border-radius: var(--radius-m);
}

.dual-code-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dual-code-title h4 {
  color: var(--text-primary);
  font-size: var(--font-16);
  line-height: var(--line-16);
  font-weight: 600;
}

.dual-code ol {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  margin-top: 12px;
  padding: 0;
  border: 1px solid var(--divider);
  border-radius: var(--radius-m);
  background: var(--divider);
  list-style: none;
  counter-reset: dual-step;
}

.dual-code li {
  position: relative;
  padding: 16px;
  background: var(--surface-card);
  counter-increment: dual-step;
}

.dual-code li::before {
  display: block;
  margin-bottom: 8px;
  color: var(--brand);
  font-family: var(--font-number);
  font-size: var(--font-12);
  line-height: var(--line-12);
  font-weight: 700;
  content: counter(dual-step, decimal-leading-zero);
}

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

.offline-map article {
  padding: 16px;
  border: 1px solid var(--divider);
  border-radius: var(--radius-m);
}

.offline-map h3 {
  margin-top: 4px;
}

.offline-map p {
  margin-top: 8px;
}

.sync-arrow {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 16px;
  border-radius: var(--radius-s);
  background: #ecf8ef;
  color: var(--success);
}

.sync-arrow span,
.sync-arrow b {
  font-size: var(--font-14);
  line-height: var(--line-14);
}

.error-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  margin-top: 16px;
  border: 1px solid var(--divider);
  border-radius: var(--radius-m);
  background: var(--divider);
}

.error-grid article {
  padding: 16px;
  background: var(--surface-card);
}

.error-grid b {
  color: var(--text-primary);
  font-size: var(--font-14);
  line-height: var(--line-14);
  font-weight: 600;
}

.error-grid p {
  margin-top: 4px;
  color: var(--text-secondary);
}

.faq-list {
  border-top: 1px solid var(--divider);
}

.faq-list details {
  border-bottom: 1px solid var(--divider);
}

.faq-list summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 56px;
  padding: 12px 0;
  color: var(--text-primary);
  cursor: pointer;
  font-size: var(--font-16);
  line-height: var(--line-16);
  font-weight: 600;
  list-style: none;
}

.faq-list summary > b {
  min-width: 0;
  overflow-wrap: anywhere;
  font-weight: 600;
}

.faq-list summary::-webkit-details-marker {
  display: none;
}

.faq-list summary span {
  display: inline-flex;
  flex: 0 0 44px;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  color: var(--brand);
  font-size: var(--font-20);
  font-weight: 400;
  transition: transform 180ms ease-out;
}

.faq-list details[open] summary span {
  transform: rotate(45deg);
}

.faq-list details p {
  max-width: 820px;
  padding: 0 44px 16px 0;
  color: var(--text-secondary);
}

.warehouse-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid var(--divider);
  border-radius: var(--radius-m);
  background: var(--divider);
  gap: 1px;
}

.warehouse-card {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  align-items: center;
  min-height: 56px;
  padding: 8px 12px;
  background: var(--surface-card);
}

.warehouse-card > span {
  color: var(--brand);
  font-family: var(--font-number);
  font-size: var(--font-16);
  line-height: var(--line-16);
  font-weight: 700;
}

.warehouse-card > b {
  min-width: 0;
  color: var(--text-primary);
  font-size: var(--font-14);
  line-height: var(--line-14);
  font-weight: 500;
  word-break: break-word;
}

.warehouse-card > em {
  margin-left: 4px;
  padding: 1px 4px;
  border-radius: var(--radius-xs);
  background: var(--surface-control);
  color: var(--text-tertiary);
  font-size: var(--font-10);
  line-height: var(--line-10);
  font-style: normal;
}

.warehouse-card.retired {
  background: var(--surface-control);
}

.warehouse-card.retired > span,
.warehouse-card.retired > b {
  color: var(--text-tertiary);
}

footer {
  display: flex;
  align-items: center;
  gap: 24px;
  width: min(var(--content-width), calc(100% - 32px));
  min-height: 72px;
  margin-inline: auto;
  padding: 16px 0 calc(16px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--divider);
  color: var(--text-tertiary);
  font-size: var(--font-12);
  line-height: var(--line-12);
}

footer > div {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-primary);
}

footer img {
  width: auto;
  height: 24px;
}

footer a {
  margin-left: auto;
  min-height: 44px;
  padding: 12px 0;
  color: var(--brand);
  font-size: var(--font-14);
  line-height: var(--line-14);
  font-weight: 500;
}

.lightbox {
  width: min(920px, calc(100% - 32px));
  max-height: calc(100vh - 32px);
  padding: 0;
  border: 0;
  border-radius: var(--radius-l);
  background: var(--surface-card);
}

.lightbox::backdrop {
  background: var(--overlay);
}

.lightbox-close {
  position: sticky;
  z-index: 2;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-left: auto;
  border: 0;
  background: var(--surface-card);
  color: var(--text-primary);
  cursor: pointer;
  font-size: var(--font-20);
}

.lightbox-content {
  padding: 0 16px 16px;
}

.lightbox-image-wrap {
  position: relative;
  width: fit-content;
  margin-inline: auto;
}

.lightbox-image-wrap img {
  width: auto;
  max-width: 100%;
  object-fit: contain;
}

.lightbox-pins {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.lightbox-content p {
  margin-top: 12px;
  color: var(--text-secondary);
  text-align: center;
}

@media (max-width: 1040px) {
  .hero-inner {
    grid-template-columns: minmax(0, 1fr) minmax(340px, 0.8fr);
  }

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

  .side-nav {
    position: sticky;
    z-index: 20;
    top: 0;
  }

  .side-nav-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-height: 44px;
    padding: 8px 16px;
    border: 0;
    background: var(--surface-card);
    color: var(--text-primary);
    cursor: pointer;
    font-size: var(--font-16);
    line-height: var(--line-16);
    font-weight: 600;
  }

  .side-nav-list,
  .side-help {
    display: none;
  }

  .side-nav.open .side-nav-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: 58vh;
    overflow-y: auto;
    border-top: 1px solid var(--divider);
  }

  .side-nav.open .side-help {
    display: block;
  }

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

@media (max-width: 820px) {
  .hero-inner {
    grid-template-columns: 1fr;
  }

  .hero-copy {
    padding-bottom: 0;
  }

  .workflow,
  .number-steps {
    grid-template-columns: 1fr;
  }

  .workflow li + li,
  .number-steps li + li {
    border-top: 1px solid var(--divider);
    border-left: 0;
  }

  .branch-grid,
  .logic-grid,
  .action-cards,
  .branch-rules,
  .dual-code ol,
  .offline-map,
  .error-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

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

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

@media (max-width: 600px) {
  .topbar,
  .hero-inner,
  .layout,
  footer {
    width: calc(100% - 32px);
  }

  .topbar {
    min-height: 44px;
  }

  .brand {
    gap: 8px;
  }

  .brand img {
    height: 20px;
  }

  .brand > span {
    display: none;
  }

  .topbar-actions {
    margin-left: auto;
  }

  .icon-button {
    min-width: 52px;
    padding-inline: 8px;
  }

  .hero-inner {
    padding: 16px 0 24px;
  }

  .hero-copy {
    padding: 16px 0 0;
  }

  .hero-actions {
    display: grid;
    grid-template-columns: 1fr;
    margin-top: 20px;
  }

  .primary-action,
  .secondary-action {
    width: 100%;
  }

  .hero-stats {
    grid-template-columns: 1fr;
  }

  .hero-stats div + div {
    border-top: 1px solid var(--divider);
    border-left: 0;
  }

  .hero-card {
    padding: 16px;
  }

  .route-preview {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .route-preview > i {
    display: none;
  }

  .route-node {
    min-height: 56px;
  }

  .layout {
    gap: 12px;
    margin-bottom: 24px;
  }

  .side-nav.open .side-nav-list {
    grid-template-columns: 1fr;
  }

  .section {
    padding: 16px;
  }

  .section-heading {
    align-items: flex-start;
    margin-bottom: 16px;
    padding-bottom: 12px;
  }

  .section-no {
    min-width: 36px;
  }

  .branch-grid,
  .two-col,
  .shot-grid.two,
  .shot-grid.three,
  .logic-grid,
  .action-cards,
  .branch-rules,
  .warehouse-action-flow,
  .dual-code ol,
  .offline-map,
  .error-grid,
  .warehouse-grid {
    grid-template-columns: 1fr;
  }

  .branch-section-head,
  .dual-code-title {
    flex-direction: column;
    gap: 8px;
  }

  .field-list > div {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .pin b {
    display: none;
  }

  .phone-shot {
    max-height: none;
  }

  .faq-list summary {
    gap: 8px;
  }

  .faq-list details p {
    padding-right: 0;
  }

  footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  footer > div {
    align-items: flex-start;
  }

  footer img {
    height: 20px;
  }

  footer a {
    margin-left: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

@media print {
  body {
    background: #ffffff;
  }

  .reading-progress,
  .topbar-actions,
  .side-nav,
  .hero-actions,
  .lightbox,
  footer a {
    display: none !important;
  }

  .hero-inner,
  .layout,
  footer,
  .topbar {
    width: 100%;
  }

  .hero-inner {
    display: block;
    padding-bottom: 16px;
  }

  .hero-card {
    margin-top: 16px;
  }

  .layout {
    display: block;
  }

  .section {
    break-inside: avoid;
    border: 1px solid var(--divider);
  }

  .shot-button {
    cursor: default;
  }
}
