:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans TC", sans-serif;
  color: #171717;
  background: #f3f4f6;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  --page-bg: #f3f4f6;
  --surface: #ffffff;
  --surface-muted: #f9fafb;
  --text: #171717;
  --text-muted: #62666d;
  --text-soft: #858a92;
  --line: #d1d5db;
  --line-dark: #171717;
  --line-soft: #e5e7eb;
  --success: #285c3c;
  --danger: #9e2929;
  --content-width: 1040px;
}

* { box-sizing: border-box; border-radius: 0; }
html { min-width: 320px; scroll-behavior: smooth; }
body { min-width: 320px; min-height: 100vh; margin: 0; background: var(--page-bg); color: var(--text); font-size: 14px; line-height: 1.55; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .42; }
button:focus-visible, a:focus-visible, textarea:focus-visible, input:focus-visible, .dropzone:focus-visible, summary:focus-visible { outline: 2px solid #171717; outline-offset: 3px; }
button, textarea, input, a { -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
.skip-link { position: fixed; z-index: 20; top: 8px; left: 8px; padding: 10px 14px; transform: translateY(-160%); border: 1px solid var(--line-dark); background: var(--surface); color: var(--text); text-decoration: none; }
.skip-link:focus { transform: translateY(0); }
.app-shell { width: min(100% - 40px, var(--content-width)); margin: 0 auto; }
.topbar { display: flex; min-height: 82px; align-items: center; justify-content: space-between; gap: 24px; border-bottom: 1px solid var(--line-dark); }
.brand { display: inline-flex; align-items: center; gap: 12px; min-width: 0; color: inherit; text-decoration: none; }
.brand-mark { display: grid; width: 42px; height: 42px; flex: 0 0 auto; grid-template-columns: 1fr 1fr; align-items: center; justify-items: center; border: 1px solid var(--line-dark); background: var(--text); color: #fff; font-size: 12px; font-weight: 800; letter-spacing: -.08em; }
.brand-mark span + span { margin-left: -2px; }
.brand-copy { display: flex; flex-direction: column; gap: 1px; }
.brand-name { font-size: 22px; font-weight: 800; letter-spacing: -.055em; line-height: 1.1; }
.brand-subtitle { color: var(--text-muted); font-size: 9px; font-weight: 700; letter-spacing: .11em; }
.topbar-tools, .system-status { display: flex; align-items: center; }
.topbar-tools { justify-content: flex-end; gap: 18px; }
.system-status { gap: 8px; color: var(--text-muted); font-size: 12px; white-space: nowrap; }
.status-square { width: 8px; height: 8px; flex: 0 0 auto; border: 1px solid currentColor; background: #d1d5db; }
.eyebrow { margin: 0 0 8px; color: var(--text-muted); font-size: 10px; font-weight: 800; letter-spacing: .14em; line-height: 1.4; }
h1, h2, h3, p { overflow-wrap: anywhere; }
h1, h2, h3 { margin-top: 0; color: var(--text); }
h1 { margin-bottom: 12px; font-size: clamp(30px, 4.1vw, 46px); font-weight: 760; letter-spacing: -.055em; line-height: 1.13; }
h2 { margin-bottom: 10px; font-size: clamp(22px, 3vw, 29px); font-weight: 760; letter-spacing: -.045em; line-height: 1.2; }
.intro-text { max-width: 690px; margin: 0; color: var(--text-muted); font-size: 14px; }
.button { display: inline-flex; min-height: 43px; align-items: center; justify-content: center; gap: 8px; padding: 10px 14px; border: 1px solid var(--line-dark); text-align: center; font-size: 12px; font-weight: 750; line-height: 1.3; text-decoration: none; transition: background-color 120ms ease, color 120ms ease, border-color 120ms ease; }
.button--primary { background: var(--text); color: #fff; }
.button--primary:hover:not(:disabled) { background: #373737; }
.button--secondary { background: #fff; color: var(--text); }
.button--secondary:hover:not(:disabled) { background: #eceef0; }
.button--compact { min-height: 32px; flex: 0 0 auto; padding: 6px 9px; font-size: 10px; }
.button--full { width: 100%; }
.home-main { padding: clamp(38px, 8vh, 90px) 0 56px; }
.home-copy { max-width: 740px; margin: 0 auto 32px; text-align: center; }
.home-copy h1 { margin-bottom: 14px; }
.home-copy .intro-text { margin: 0 auto; }
.role-choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; max-width: 860px; margin: 0 auto; }
.role-choice { display: flex; min-height: 300px; flex-direction: column; align-items: flex-start; padding: 25px; border: 1px solid var(--line-dark); background: var(--surface); color: inherit; text-decoration: none; transition: background-color 120ms ease; }
.role-choice:hover { background: #f9fafb; }
.role-number { color: var(--text-muted); font-size: 10px; font-weight: 800; letter-spacing: .12em; }
.role-icon { display: grid; width: 52px; height: 52px; min-width: 52px; min-height: 52px; flex: 0 0 52px; overflow: hidden; place-items: center; margin: 26px 0 18px; border: 1px solid var(--line-dark); background: #f3f4f6; }
.role-icon svg { display: block; width: 28px !important; height: 28px !important; max-width: 100%; max-height: 100%; flex: 0 0 28px; }
.role-title { margin-bottom: 7px; font-size: 25px; font-weight: 780; letter-spacing: -.04em; }
.role-description { color: var(--text-muted); font-size: 12px; }
.role-action { display: flex; width: 100%; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 20px; font-size: 12px; font-weight: 800; }
.role-action span { font-size: 20px; }
.home-note { display: flex; max-width: 860px; gap: 10px; align-items: flex-start; margin: 24px auto 0; padding-top: 14px; border-top: 1px solid var(--line); }
.home-note p { margin: 0; color: var(--text-muted); font-size: 11px; }
.note-square { width: 8px; height: 8px; flex: 0 0 auto; margin-top: 6px; border: 1px solid var(--line-dark); }
.app-shell--flow { --content-width: 820px; }
.flow-main { padding: 22px 0 54px; }
.back-link { display: inline-block; margin-bottom: 24px; color: var(--text-muted); font-size: 11px; text-decoration: none; }
.back-link:hover { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
.flow-heading { margin-bottom: 21px; }
.flow-heading h1 { margin-bottom: 8px; font-size: clamp(30px, 4vw, 39px); }
.step-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; margin-bottom: 18px; border: 1px solid var(--line); background: #fff; }
.step-strip.step-strip--three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.step-chip { display: flex; min-width: 0; align-items: center; gap: 6px; padding: 10px 11px; color: var(--text-soft); font-size: 10px; white-space: nowrap; }
.step-chip + .step-chip { border-left: 1px solid var(--line); }
.step-chip b { display: inline-grid; width: 19px; height: 19px; flex: 0 0 auto; place-items: center; border: 1px solid var(--line); font-size: 10px; }
.step-chip.is-active { background: #171717; color: #fff; }
.step-chip.is-active b { border-color: #fff; }
.step-chip.is-complete { color: var(--success); }
.workflow-card { padding: clamp(18px, 4vw, 30px); border: 1px solid var(--line-dark); background: #fff; }
.workflow-card--narrow { max-width: 640px; margin: 0 auto; }
.screen-kicker { margin-bottom: 10px; color: var(--text-muted); font-size: 10px; font-weight: 800; letter-spacing: .14em; }
.screen-help { margin: 0 0 20px; color: var(--text-muted); font-size: 12px; line-height: 1.7; }
.dropzone { display: flex; min-height: 175px; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 20px; border: 1px dashed #9ca3af; background: var(--surface-muted); text-align: center; cursor: pointer; transition: background-color 120ms ease, border-color 120ms ease; }
.dropzone:hover, .dropzone.is-dragover { border-color: var(--line-dark); background: #eef0f2; }
.dropzone-symbol { display: grid; width: 36px; height: 36px; place-items: center; margin-bottom: 2px; border: 1px solid var(--line); background: #fff; }
.dropzone-symbol svg { display: block; width: 24px !important; height: 24px !important; max-width: 100%; max-height: 100%; flex: 0 0 24px; }
.dropzone-title { font-size: 13px; font-weight: 750; }
.dropzone-description { color: var(--text-muted); font-size: 11px; }
.dropzone-button { margin-top: 7px; pointer-events: none; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); clip-path: inset(50%); white-space: nowrap; }
.file-summary { display: flex; justify-content: space-between; gap: 12px; padding: 11px 0 8px; color: var(--text-muted); font-size: 11px; }
.file-summary strong { color: var(--text); font-variant-numeric: tabular-nums; }
.file-list { display: flex; min-height: 44px; flex-direction: column; gap: 0; margin: 0; padding: 0; border: 1px solid var(--line-soft); list-style: none; }
.file-list li { display: flex; min-width: 0; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; font-size: 11px; }
.file-list li + li { border-top: 1px solid var(--line-soft); }
.file-list .empty-list-item { min-height: 44px; color: var(--text-soft); }
.file-row-main { display: flex; min-width: 0; flex: 1; flex-wrap: wrap; align-items: center; gap: 5px 12px; }
.file-name { min-width: 0; overflow-wrap: anywhere; }
.file-size { flex: 0 0 auto; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.file-remove { border: 0; background: transparent; color: var(--text-muted); font-size: 10px; text-decoration: underline; text-underline-offset: 2px; }
.file-remove:hover { color: var(--danger); }
.screen-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.screen-actions > .button { min-width: 132px; }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 18px 0 8px; }
.field-label { display: block; margin: 16px 0 6px; font-size: 11px; font-weight: 750; }
.field-help, .storage-status { margin: 8px 0 0; color: var(--text-muted); font-size: 11px; line-height: 1.65; }
.code-field { display: block; width: 100%; min-height: 85px; resize: vertical; padding: 10px 11px; border: 1px solid var(--line); background: #fcfcfc; color: var(--text); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 10px; line-height: 1.55; overflow-wrap: anywhere; }
.code-field[readonly] { background: #f3f4f6; color: #41454b; }
.code-field::placeholder { color: #9297a0; font-family: inherit; }
.primary-action-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px; }
.primary-action-grid .button { width: 100%; }
.section-divider { margin: 20px 0 12px; border-top: 1px solid var(--line); }
.action-stack { margin-bottom: 13px; }
.qr-panel { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 16px; border: 1px solid var(--line); background: #f9fafb; }
.qr-frame { display: grid; width: 100%; min-height: 240px; place-items: center; overflow: hidden; }
.qr-canvas { display: block; width: min(100%, 560px); height: auto; image-rendering: pixelated; border: 1px solid #fff; background: #fff; }
.qr-pager { display: flex; width: 100%; align-items: center; justify-content: center; gap: 10px; }
.qr-count { min-width: 86px; color: var(--text-muted); font-size: 11px; font-variant-numeric: tabular-nums; text-align: center; }
.qr-caption { margin: 10px 0 0; color: var(--text-muted); font-size: 11px; text-align: center; }
.manual-code { margin-top: 18px; padding-top: 13px; border-top: 1px solid var(--line); }
.manual-code summary { cursor: pointer; color: var(--text-muted); font-size: 11px; }
.manual-code[open] summary { margin-bottom: 10px; color: var(--text); }
.file-download { color: var(--text); font-weight: 750; text-decoration: underline; text-underline-offset: 2px; }
.camera-frame { position: relative; display: grid; min-height: 260px; place-items: center; overflow: hidden; border: 1px solid var(--line-dark); background: #171717; }
.camera-frame video { display: block; width: 100%; max-height: 55vh; min-height: 260px; object-fit: contain; background: #171717; }
.camera-overlay { position: absolute; inset: 15% 18%; border: 1px solid rgba(255,255,255,.8); pointer-events: none; }
.scan-status { min-height: 20px; margin: 10px 0 0; color: var(--text-muted); font-size: 11px; line-height: 1.6; }
.state-symbol { display: grid; width: 50px; height: 50px; place-items: center; margin: 12px 0 20px; border: 1px solid var(--line-dark); background: #f3f4f6; font-size: 25px; }
.state-symbol--success { border-color: var(--success); color: var(--success); }
.indeterminate-track { height: 5px; margin: 18px 0 12px; overflow: hidden; border: 1px solid var(--line); background: #eceef0; }
.indeterminate-track span { display: block; width: 35%; height: 100%; background: var(--text); animation: track-move 1.5s ease-in-out infinite alternate; }
@keyframes track-move { from { transform: translateX(0); } to { transform: translateX(185%); } }
.progress-value { font-size: 12px; font-variant-numeric: tabular-nums; }
.progress-track { height: 8px; overflow: hidden; border: 1px solid var(--line); background: #eceef0; }
.progress-fill { display: block; width: 0; height: 100%; background: var(--text); transition: width 120ms linear; }
.progress-caption { min-height: 18px; margin: 0; color: var(--text-muted); font-size: 10px; }
.transfer-summary { display: grid; grid-template-columns: 1fr auto; gap: 9px 18px; margin: 20px 0; padding: 16px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); color: var(--text-muted); font-size: 11px; }
.transfer-summary strong { color: var(--text); font-variant-numeric: tabular-nums; }
.received-list { margin-top: 15px; }
.footer { display: flex; min-height: 54px; align-items: center; justify-content: space-between; gap: 16px; border-top: 1px solid var(--line-dark); color: var(--text-muted); font-size: 10px; }
.footer span:first-child { color: var(--text); font-size: 12px; font-weight: 800; letter-spacing: -.03em; }
.footer span:nth-child(2) { letter-spacing: .08em; text-align: center; }
@media (max-width: 680px) {
  .app-shell { width: min(100% - 24px, var(--content-width)); }
  .topbar { min-height: 70px; gap: 12px; }
  .brand-mark { width: 36px; height: 36px; }
  .brand-name { font-size: 20px; }
  .brand-subtitle { max-width: 140px; font-size: 8px; letter-spacing: .06em; }
  .topbar-tools { gap: 8px; }
  .system-status { max-width: 100px; gap: 6px; font-size: 10px; white-space: normal; }
  #install-button { max-width: 100px; padding: 6px 8px; font-size: 10px; }
  .home-main { padding: 42px 0 34px; }
  .home-copy { margin-bottom: 24px; text-align: left; }
  .home-copy h1 { font-size: clamp(30px, 8vw, 39px); }
  .home-copy .intro-text { font-size: 12px; }
  .role-choices { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .role-choice { min-height: 230px; padding: 20px; }
  .role-icon { margin: 18px 0 13px; }
  .role-title { font-size: 22px; }
  .flow-main { padding-top: 16px; }
  .back-link { margin-bottom: 18px; }
  .flow-heading { margin-bottom: 17px; }
  .flow-heading h1 { font-size: 32px; }
  .step-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .step-strip.step-strip--three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .step-strip.step-strip--three .step-chip:nth-child(3) { border-left: 1px solid var(--line); }
  .step-strip.step-strip--three .step-chip:nth-child(n+3) { border-top: 0; }
  .step-chip { padding: 9px 10px; }
  .step-chip:nth-child(odd) { border-left: 0; }
  .step-chip:nth-child(n+3) { border-top: 1px solid var(--line); }
  .step-chip:nth-child(2) { border-left: 1px solid var(--line); }
  .workflow-card { padding: 18px 15px; }
  .primary-action-grid { grid-template-columns: minmax(0, 1fr); }
  .screen-actions { align-items: stretch; flex-direction: column-reverse; }
  .screen-actions > .button { width: 100%; }
  .qr-panel { padding: 10px; }
  .qr-frame { min-height: 200px; }
  .qr-pager { gap: 6px; }
  .qr-pager .button { padding: 6px; }
  .qr-count { min-width: 64px; font-size: 10px; }
  .camera-frame, .camera-frame video { min-height: 220px; }
  .footer { flex-wrap: wrap; justify-content: flex-start; gap: 8px 14px; padding: 12px 0; }
  .footer span:nth-child(2) { text-align: left; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
