:root {
  --bg: #f3f5f8;
  --surface: #fff;
  --surface-soft: #f8fafc;
  --line: #e2e7ee;
  --line-strong: #d4dce7;
  --text: #1f2a3a;
  --muted: #718097;
  --muted-2: #98a4b5;
  --brand: #2468e8;
  --brand-dark: #1757ca;
  --brand-soft: #edf4ff;
  --success: #138a62;
  --success-soft: #e9f8f1;
  --warning: #a86413;
  --warning-soft: #fff5e6;
  --danger: #bd4354;
  --danger-soft: #fff0f2;
  --shadow: 0 8px 24px rgba(31, 42, 58, 0.055);
  --radius: 12px;
  --sans: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
}
button,
input,
select {
  font: inherit;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}
.shell {
  min-height: 100vh;
}
.topbar {
  height: 58px;
  padding: 0 max(24px, calc((100vw - 1160px) / 2));
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 700;
  color: #263448;
  letter-spacing: 0;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
}
.brand-mark svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}
.topbar-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}
.secure-dot,
.state-dot,
.status-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
}
.topbar-divider {
  height: 14px;
  width: 1px;
  background: var(--line);
  margin: 0 3px;
}
.page {
  max-width: 1160px;
  margin: 0 auto;
  padding: 42px 24px 24px;
}
.intro-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 26px;
}
.eyebrow {
  margin: 0 0 7px;
  color: var(--brand);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0;
}
.intro-row h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.2;
  letter-spacing: 0;
  font-weight: 730;
}
.lead {
  margin: 9px 0 0;
  max-width: 620px;
  color: var(--muted);
  font-size: 14px;
}
.service-state {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 8px;
  padding: 6px 10px;
  border-radius: 7px;
  color: var(--success);
  background: var(--success-soft);
  font-size: 12px;
  white-space: nowrap;
}
.notice {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 12px 14px;
  margin-bottom: 18px;
  border: 1px solid #dce7f8;
  border-radius: 10px;
  background: #f7faff;
  color: #5c6e87;
}
.notice svg {
  width: 17px;
  height: 17px;
  flex: none;
  margin-top: 2px;
  fill: none;
  stroke: var(--brand);
  stroke-width: 1.7;
  stroke-linecap: round;
}
.notice strong {
  display: block;
  margin-bottom: 2px;
  color: #314d77;
  font-size: 13px;
}
.notice span {
  font-size: 13px;
}
.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(300px, 1fr);
  gap: 18px;
  align-items: start;
}
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.form-panel {
  padding: 23px 24px 24px;
}
.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 23px;
}
.panel-heading.compact {
  margin-bottom: 18px;
}
.panel-heading h2 {
  margin: 0;
  font-size: 16px;
  line-height: 1.35;
  font-weight: 700;
}
.panel-heading p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}
.step-label {
  color: var(--muted-2);
  font-size: 11px;
  letter-spacing: 0;
}
.field-label {
  display: block;
  margin: 0 0 7px;
  font-size: 13px;
  font-weight: 650;
  color: #344258;
}
.input-wrap,
.select-wrap {
  position: relative;
}
.input-wrap svg {
  position: absolute;
  left: 12px;
  top: 50%;
  width: 16px;
  height: 16px;
  transform: translateY(-50%);
  fill: none;
  stroke: #8190a5;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}
.input-wrap input,
.select-wrap select {
  width: 100%;
  height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  outline: 0;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}
.input-wrap input {
  padding: 0 12px 0 37px;
}
.input-wrap input::placeholder {
  color: #a4afbd;
}
.input-wrap input:focus,
.select-wrap select:focus {
  border-color: #7fa8ed;
  box-shadow: 0 0 0 3px rgba(36, 104, 232, 0.12);
}
.field-hint {
  margin: 6px 0 0;
  color: var(--muted-2);
  font-size: 12px;
}
.field-error {
  min-height: 0;
  color: var(--danger);
  font-size: 12px;
}
.field-error:not(:empty) {
  margin-top: 6px;
}
.field-group-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 19px;
}
.select-wrap select {
  appearance: none;
  padding: 0 36px 0 12px;
}
.select-wrap > svg {
  position: absolute;
  right: 12px;
  top: 50%;
  width: 15px;
  height: 15px;
  transform: translateY(-50%);
  fill: none;
  stroke: #718097;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}
.section-rule {
  height: 1px;
  background: var(--line);
  margin: 22px 0 19px;
}
.qr-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}
.qr-heading .field-label {
  margin-bottom: 2px;
}
.qr-status {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}
.qr-status.ready {
  color: var(--success);
}
.qr-status.ready .status-dot {
  background: var(--success);
}
.qr-drop {
  position: relative;
  min-height: 178px;
  margin-top: 12px;
  border: 1px dashed #b8c4d4;
  border-radius: 10px;
  background: var(--surface-soft);
  display: grid;
  place-items: center;
  overflow: hidden;
  transition:
    border-color 0.15s,
    background 0.15s;
}
.qr-drop.dragover {
  border-color: var(--brand);
  background: var(--brand-soft);
}
.qr-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--muted);
}
.qr-empty strong {
  margin-top: 7px;
  color: #415066;
  font-size: 13px;
}
.qr-empty > span:last-child {
  font-size: 12px;
  color: var(--muted-2);
}
.qr-icon {
  display: grid;
  place-items: center;
  width: 43px;
  height: 43px;
  border-radius: 11px;
  background: #eaf1fc;
  color: var(--brand);
}
.qr-icon svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linejoin: round;
}
.qr-preview {
  display: none;
  max-width: 100%;
  max-height: 178px;
  object-fit: contain;
}
.qr-drop.has-preview .qr-empty {
  display: none;
}
.qr-drop.has-preview .qr-preview {
  display: block;
}
.remove-image {
  display: none;
  position: absolute;
  top: 9px;
  right: 9px;
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: #697b92;
  place-items: center;
}
.remove-image svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}
.qr-drop.has-preview .remove-image {
  display: grid;
}
.qr-drop input {
  display: none;
}
.qr-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.button {
  min-height: 36px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-weight: 600;
  font-size: 13px;
  transition:
    background 0.15s,
    border-color 0.15s,
    color 0.15s,
    transform 0.15s;
}
.button:active {
  transform: translateY(1px);
}
.button svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.button.primary {
  background: var(--brand);
  color: #fff;
}
.button.primary:hover:not(:disabled) {
  background: var(--brand-dark);
}
.button.secondary {
  background: #fff;
  color: #52647c;
  border-color: var(--line-strong);
}
.button.secondary:hover:not(:disabled) {
  border-color: #aab8cb;
  background: #f8fafc;
}
.button.small {
  min-height: 32px;
  padding: 0 10px;
  font-size: 12px;
}
.text-button {
  color: var(--brand);
  background: transparent;
  padding-left: 8px;
  padding-right: 8px;
}
.qr-privacy {
  margin-left: auto;
  color: var(--muted-2);
  font-size: 11px;
}
.camera-panel {
  display: none;
  position: relative;
  margin-top: 10px;
  height: 220px;
  border-radius: 10px;
  overflow: hidden;
  background: #172232;
  color: #fff;
  text-align: center;
}
.camera-panel.active {
  display: block;
}
.camera-panel video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.scan-frame {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 145px;
  height: 145px;
  transform: translate(-50%, -55%);
  border: 2px solid rgba(255, 255, 255, 0.85);
  border-radius: 8px;
  box-shadow: 0 0 0 999px rgba(8, 14, 24, 0.35);
}
.camera-panel p {
  position: absolute;
  bottom: 8px;
  left: 0;
  right: 0;
  margin: 0;
  color: #d9e2ef;
  font-size: 12px;
}
.submit-button {
  width: 100%;
  height: 43px;
  margin-top: 20px;
}
.side-column {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.status-panel,
.history-panel {
  padding: 20px;
}
.status-chip {
  padding: 4px 8px;
  border-radius: 6px;
  background: #f0f2f6;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
  white-space: nowrap;
}
.status-chip.processing {
  background: var(--warning-soft);
  color: var(--warning);
}
.status-chip.success {
  background: var(--success-soft);
  color: var(--success);
}
.status-chip.error {
  background: var(--danger-soft);
  color: var(--danger);
}
.status-main {
  padding: 10px 0 15px;
  text-align: center;
}
.status-icon {
  display: grid;
  place-items: center;
  width: 43px;
  height: 43px;
  margin: 0 auto 11px;
  border-radius: 50%;
  background: #f0f2f6;
  color: #8794a6;
}
.status-icon svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.status-icon.processing {
  background: var(--warning-soft);
  color: var(--warning);
}
.status-icon.success {
  background: var(--success-soft);
  color: var(--success);
}
.status-icon.error {
  background: var(--danger-soft);
  color: var(--danger);
}
.status-main strong {
  display: block;
  font-size: 14px;
}
.status-main p {
  max-width: 255px;
  margin: 5px auto 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}
.progress-track {
  height: 3px;
  overflow: hidden;
  border-radius: 3px;
  background: #e9edf3;
}
.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--brand);
  transition: none;
}
.progress-track.active span {
  width: 60%;
  animation: progress 1.5s ease-in-out infinite;
}
@keyframes progress {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(180%);
  }
}
.status-actions {
  display: flex;
  justify-content: center;
  gap: 5px;
  min-height: 32px;
  margin-top: 12px;
}
.history-list {
  display: flex;
  flex-direction: column;
}
.history-empty {
  min-height: 88px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 9px;
  color: var(--muted-2);
  font-size: 12px;
}
.empty-line {
  width: 42px;
  height: 7px;
  border-radius: 4px;
  background: #edf0f4;
}
.history-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  padding: 11px 0;
  border-top: 1px solid var(--line);
}
.history-account {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #3a4b62;
  font-size: 12px;
  font-weight: 650;
}
.history-meta {
  margin-top: 3px;
  color: var(--muted-2);
  font-size: 11px;
}
.history-status {
  align-self: start;
  padding: 3px 6px;
  border-radius: 5px;
  background: #f0f2f6;
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
}
.history-status.success {
  background: var(--success-soft);
  color: var(--success);
}
.history-status.error {
  background: var(--danger-soft);
  color: var(--danger);
}
.history-status.processing {
  background: var(--warning-soft);
  color: var(--warning);
}
.icon-button {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: #718097;
}
.icon-button:hover {
  background: #f7f9fb;
}
.icon-button svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.page-footer {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 17px;
  padding: 0 2px;
  color: #98a4b5;
  font-size: 11px;
}
.footer-link {
  border: 0;
  padding: 0;
  background: transparent;
  color: #718097;
  font-size: 11px;
}
.footer-link:hover {
  color: var(--brand);
}
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 10;
  max-width: min(90vw, 420px);
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 28px rgba(31, 42, 58, 0.14);
  color: #415066;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 10px);
  transition:
    opacity 0.16s,
    transform 0.16s;
}
.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}
.dialog {
  width: min(420px, calc(100vw - 30px));
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 18px 60px rgba(31, 42, 58, 0.2);
  color: var(--text);
}
.dialog::backdrop {
  background: rgba(31, 42, 58, 0.24);
}
.dialog-icon {
  display: grid;
  place-items: center;
  width: 39px;
  height: 39px;
  margin-bottom: 12px;
  border-radius: 10px;
  background: var(--brand-soft);
  color: var(--brand);
}
.dialog-icon svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.dialog h2 {
  margin: 0;
  font-size: 18px;
}
.dialog p {
  margin: 7px 0 20px;
  color: var(--muted);
  font-size: 13px;
}
.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.dialog:not([open]) {
  display: none;
}
@media (max-width: 760px) {
  .topbar {
    padding: 0 16px;
  }
  .topbar-meta
    span:not(.secure-dot):not(.state-dot):not(.topbar-divider):last-child {
    display: none;
  }
  .page {
    padding: 27px 14px 18px;
  }
  .intro-row {
    margin-bottom: 20px;
  }
  .intro-row h1 {
    font-size: 22px;
  }
  .lead {
    max-width: 480px;
    font-size: 13px;
  }
  .service-state {
    margin-top: 2px;
  }
  .workspace-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .form-panel {
    padding: 18px 16px 19px;
  }
  .panel-heading {
    margin-bottom: 20px;
  }
  .status-panel,
  .history-panel {
    padding: 17px 16px;
  }
  .side-column {
    gap: 14px;
  }
  .qr-drop {
    min-height: 164px;
  }
  .qr-privacy {
    width: 100%;
    margin-left: 0;
  }
  .page-footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
:root {
  letter-spacing: 0;
}
button,
input {
  letter-spacing: 0;
}
[hidden] {
  display: none !important;
}
.field-group {
  min-width: 0;
}
.select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-height: 40px;
  padding: 8px 12px;
  text-align: left;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font-size: 13px;
}
.select-trigger svg {
  flex: none;
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
}
.select-trigger span {
  min-width: 0;
  overflow-wrap: anywhere;
}
.select-trigger.is-placeholder span {
  color: var(--muted);
}
.select-menu {
  position: absolute;
  z-index: 5;
  left: 0;
  right: 0;
  top: calc(100% + 5px);
  padding: 4px;
  max-height: 278px;
  overflow: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 9px;
  box-shadow: 0 6px 20px rgba(31, 42, 58, 0.12);
  animation: menu-enter 0.16s ease-out;
}
.select-menu.leaving {
  animation: menu-exit 0.16s ease-in forwards;
}
@keyframes menu-exit {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(-4px);
  }
}
.select-menu button {
  display: block;
  width: 100%;
  padding: 9px 10px;
  text-align: left;
  color: #45536a;
  background: none;
  border: 0;
  border-radius: 6px;
  font-size: 13px;
}
.select-menu button:hover,
.select-menu button:focus-visible {
  background: #f2f5fa;
}
.select-menu button[aria-selected="true"] {
  background: var(--brand-soft);
  color: var(--brand);
}
@keyframes menu-enter {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
button:focus-visible {
  outline: 2px solid #6c99e7;
  outline-offset: 3px;
}
.qr-empty {
  width: 100%;
  min-height: 178px;
  border: 0;
  background: none;
  padding: 12px;
}
.qr-drop.has-preview {
  background: #fff;
}
.qr-drop.has-preview .qr-preview {
  height: 172px;
  max-width: 100%;
  max-height: 172px;
  margin: 3px;
  object-fit: contain;
}
.qr-actions .button {
  min-height: 36px;
}
.qr-status .status-dot {
  background: #a8b2bf;
}
.qr-status.ready .status-dot {
  background: var(--success);
}
.input-wrap svg {
  display: block;
}
.history-item {
  width: 100%;
  text-align: left;
  background: none;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
}
.history-item:hover {
  background: #f8fafc;
}
.history-info {
  min-width: 0;
}
.history-empty svg {
  width: 23px;
  height: 23px;
  color: #b9c4d2;
}
.status-icon svg {
  width: 22px;
  height: 22px;
}
.progress-track span {
  transition: none;
}
.progress-track.active span {
  width: 60%;
}
.data-note {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin: 21px 2px 0;
  color: #8290a4;
  font-size: 12px;
}
.data-note > svg {
  width: 16px;
  height: 16px;
  flex: none;
  margin-top: 2px;
}
.data-note strong {
  color: #647389;
  font-weight: 600;
}
.data-note p {
  margin: 3px 0 0;
  line-height: 1.7;
  max-width: 840px;
}
.button.danger {
  background: var(--danger);
  color: #fff;
}
.detail-dialog {
  width: min(480px, calc(100vw - 28px));
  max-height: 85vh;
  overflow: auto;
}
.detail-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.detail-fields {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr);
  gap: 10px 12px;
  margin: 20px 0;
}
.detail-fields dt {
  color: var(--muted);
  font-size: 12px;
}
.detail-fields dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 13px;
}
#detail-response {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: 240px;
  overflow: auto;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  font-size: 12px;
  color: #52647e;
}
.offline {
  color: var(--danger);
  background: var(--danger-soft);
}
.offline .state-dot {
  background: var(--danger);
}
.button.text-button {
  min-height: 32px;
}
@media (max-width: 760px) {
  .data-note {
    margin-top: 15px;
  }
  .input-wrap input {
    font-size: 16px;
  }
  .qr-empty {
    min-height: 126px;
  }
  .qr-drop.has-preview .qr-preview {
    height: 126px;
    max-height: 126px;
  }
  .qr-actions .button {
    position: relative;
    margin-block: 4px;
  }
  .qr-actions .button::after {
    content: "";
    position: absolute;
    inset: -4px 0;
  }
  .icon-button {
    width: 44px;
    height: 44px;
    border: 0;
    background: transparent;
  }
  .select-trigger {
    min-height: 44px;
  }
  .select-menu button {
    min-height: 44px;
  }
  .remove-image {
    width: 44px;
    height: 44px;
  }
  .qr-heading {
    flex-wrap: wrap;
  }
  .panel-heading h2 {
    font-size: 15px;
  }
  .topbar {
    height: 54px;
  }
  .page-footer {
    flex-direction: row;
    align-items: center;
  }
  .footer-link {
    min-height: 44px;
    padding-inline: 3px;
  }
  .dialog .button {
    min-height: 44px;
  }
  .notice span {
    font-size: 12px;
  }
  .service-state {
    font-size: 11px;
    padding: 5px 7px;
  }
  .intro-row {
    position: relative;
    display: block;
    margin-bottom: 16px;
  }
  .intro-row > div:first-child {
    min-width: 0;
  }
  .service-state {
    position: absolute;
    top: 0;
    right: 0;
    margin: 0;
  }
  .page {
    padding-top: 22px;
  }
  .eyebrow {
    padding-right: 112px;
  }
  .notice {
    padding: 10px 11px;
    margin-bottom: 14px;
  }
  .notice strong {
    display: inline;
    margin-right: 8px;
  }
  .form-panel {
    padding: 16px 14px;
  }
  .form-panel .panel-heading {
    margin-bottom: 16px;
  }
  .form-panel .panel-heading p {
    display: none;
  }
  .field-hint {
    line-height: 1.6;
  }
  .field-group-row {
    margin-top: 14px;
  }
  .section-rule {
    margin: 16px 0;
  }
  .qr-heading {
    position: relative;
    display: block;
  }
  .qr-heading .field-label {
    padding-right: 78px;
  }
  .qr-status {
    position: absolute;
    top: 0;
    right: 0;
  }
  .qr-drop {
    min-height: 126px;
    margin-top: 10px;
  }
  .qr-empty strong {
    margin-top: 1px;
  }
  .qr-icon {
    width: 32px;
    height: 32px;
    background: transparent;
  }
  .qr-icon svg {
    width: 24px;
    height: 24px;
  }
  .qr-privacy {
    display: none;
  }
  .qr-actions {
    margin-top: 6px;
  }
  .submit-button {
    margin-top: 12px;
    height: 40px;
  }
  .status-main {
    padding: 5px 0 12px;
  }
  .status-panel .panel-heading.compact {
    margin-bottom: 12px;
  }
}
@media (max-width: 380px) {
  .intro-row {
    display: block;
  }
  .service-state {
    margin: 0;
  }
  .field-group-row {
    gap: 8px;
  }
  .page-footer {
    flex-wrap: wrap;
  }
  .qr-actions {
    gap: 8px;
  }
}
.status-actions:not(:has(button:not([hidden]))) {
  display: none;
}
@media (prefers-reduced-motion: reduce) {
  .select-menu {
    animation: none;
  }
  .progress-track.active span {
    animation: none;
    transform: none;
    width: 100%;
  }
}
@media (prefers-reduced-transparency: reduce) {
  .dialog::backdrop {
    background: #d7dce4;
  }
}

/* Centered step flow */
[hidden] {
  display: none !important;
}
.wizard-shell {
  min-height: 100vh;
}
.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.history-toggle {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #60728b;
  background: #fff;
}
.history-toggle:hover {
  color: var(--brand);
  border-color: #a9bee4;
  background: var(--brand-soft);
}
.history-toggle svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.wizard-page {
  min-height: calc(100vh - 58px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 34px 16px 46px;
}
.wizard-card {
  width: min(100%, 560px);
  padding: 30px 34px 28px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 14px 38px rgba(31, 42, 58, 0.075);
}
.wizard-head {
  text-align: center;
}
.wizard-head .eyebrow {
  margin: 0 0 8px;
}
.wizard-head h1 {
  margin: 0;
  font-size: 24px;
  line-height: 1.3;
  font-weight: 720;
}
.stepper {
  display: flex;
  align-items: center;
  justify-content: center;
  width: min(100%, 270px);
  margin: 22px auto 30px;
}
.step-node {
  position: relative;
  padding: 0;
  display: grid;
  place-items: center;
  flex: none;
  width: 27px;
  height: 27px;
  border: 1px solid #cfd8e5;
  border-radius: 50%;
  color: #8a98aa;
  background: #fff;
  font-size: 12px;
  font-weight: 700;
  transition:
    color 0.16s,
    background 0.16s,
    border-color 0.16s;
}
.step-node::after {
  content: "";
  position: absolute;
  inset: -9px;
}
.step-node:disabled {
  opacity: 1;
}
.step-node.is-current {
  border-color: var(--brand);
  color: #fff;
  background: var(--brand);
}
.step-node.is-done {
  border-color: #8bb2f2;
  color: var(--brand);
  background: var(--brand-soft);
}
.step-line {
  flex: 1;
  min-width: 18px;
  height: 1px;
  background: #dfe5ed;
}
.wizard-step {
  animation: wizard-enter 0.16s ease-out;
}
@keyframes wizard-enter {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.step-copy {
  margin-bottom: 22px;
  text-align: center;
}
.step-copy h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
}
.wizard-step .field-label {
  margin-bottom: 8px;
}
.wizard-step .input-wrap input {
  height: 44px;
  font-size: 14px;
}
.wizard-step .input-wrap svg {
  width: 17px;
  height: 17px;
}
.wizard-step .field-error {
  min-height: 18px;
}
.step-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 28px;
}
.step-actions .button {
  min-height: 38px;
}
.settings-row {
  margin-top: 0;
}
.settings-row .select-trigger {
  min-height: 44px;
}
.qr-heading {
  align-items: center;
  margin-bottom: 9px;
}
.qr-heading .field-label {
  margin: 0;
}
.qr-drop {
  min-height: 210px;
  margin-top: 0;
}
.qr-empty {
  min-height: 210px;
}
.qr-actions {
  margin-top: 10px;
}
.qr-actions .button {
  min-height: 36px;
}
.wizard-step .camera-panel {
  margin-top: 10px;
}
.result-step {
  min-height: 300px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.result-icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin: 7px auto 13px;
  border-radius: 50%;
  background: #f0f2f6;
  color: #8794a6;
}
.result-icon svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.result-icon.processing {
  color: var(--warning);
  background: var(--warning-soft);
}
.result-icon.success {
  color: var(--success);
  background: var(--success-soft);
}
.result-icon.error {
  color: var(--danger);
  background: var(--danger-soft);
}
.result-step .status-chip {
  margin-bottom: 13px;
}
.result-step h2 {
  margin: 0;
  font-size: 18px;
}
.result-step > p {
  max-width: 380px;
  min-height: 42px;
  margin: 7px 0 18px;
  color: var(--muted);
  font-size: 13px;
}
.result-step .progress-track {
  width: 100%;
}
.result-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 32px;
  margin-top: 15px;
}
.result-nav {
  width: 100%;
  justify-content: center;
  margin-top: auto;
  padding-top: 24px;
}
.result-nav .button {
  min-width: 130px;
}
.wizard-page > .service-state {
  position: static;
  inset: auto;
  margin: 0;
}
.history-dialog {
  width: min(460px, calc(100vw - 28px));
  max-height: min(650px, calc(100vh - 32px));
  overflow: auto;
}
.dialog-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.dialog-heading h2 {
  margin: 0;
  font-size: 18px;
}
.dialog-heading .eyebrow {
  margin: 0 0 4px;
}
.history-dialog .history-list {
  max-height: 430px;
  overflow: auto;
}
.history-dialog .history-empty {
  min-height: 160px;
}
.history-dialog .history-item {
  padding: 13px 3px;
  border-top: 1px solid var(--line);
}
.dialog-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.history-dialog .footer-link {
  min-height: 34px;
}
@media (max-width: 760px) {
  .topbar {
    height: 54px;
    padding: 0 14px;
  }
  .wizard-page {
    min-height: calc(100vh - 54px);
    padding: 20px 14px 34px;
    justify-content: center;
  }
  .wizard-card {
    padding: 23px 17px 20px;
    border-radius: 12px;
  }
  .wizard-head h1 {
    font-size: 21px;
  }
  .stepper {
    margin: 17px auto 24px;
  }
  .step-node {
    width: 25px;
    height: 25px;
  }
  .step-copy {
    margin-bottom: 18px;
  }
  .qr-drop,
  .qr-empty {
    min-height: 170px;
  }
  .qr-drop.has-preview .qr-preview {
    height: 166px;
    max-height: 166px;
  }
  .wizard-step .input-wrap input {
    height: 44px;
    font-size: 16px;
  }
  .step-actions {
    margin-top: 22px;
  }
  .step-actions .button {
    min-height: 42px;
  }
  .result-step {
    min-height: 280px;
  }
  .result-nav {
    padding-top: 18px;
  }
  .history-toggle {
    width: 40px;
    height: 40px;
  }
}
@media (max-width: 380px) {
  .wizard-page {
    padding-inline: 10px;
  }
  .wizard-card {
    padding-inline: 13px;
  }
  .field-group-row {
    gap: 8px;
  }
  .step-actions .button {
    padding-inline: 10px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .wizard-step,
  .step-node {
    animation: none;
    transition: none;
  }
}
