/* Dark preview tokens from Design/preview.css. Form 1 and Table 3 keep their own component rules. */
:root {
  color-scheme: dark;
  --page: #10141c;
  --ink: #edf2fa;
  --muted: #a0adc0;
  --line: #2a3341;
  --accent: #00ff88;
  --accent-hover: #62ffa8;
  --accent-on: #082012;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}
[hidden] { display: none !important; }
body, body.show-account { display: flex; flex-direction: column; min-height: 100vh; min-height: 100svh; margin: 0; color: var(--ink); }
body { background: var(--page); }
a { color: inherit; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.join-shell { display: flex; flex: 1 0 auto; flex-direction: column; width: min(680px, calc(100% - 40px)); margin-inline: auto; }
.join-shell a { text-decoration: none; }
.join-heading { margin: 34px 0 20px; }
.join-heading h1 { margin: 0 0 7px; font-size: 26px; line-height: 1.2; }
.join-shell.form-1 { --user-accent: var(--accent); }
.show-account .join-shell { width: min(920px, calc(100% - 40px)); justify-content: center; padding-block: clamp(22px, 4svh, 44px); }
.show-account .join-heading { margin: 0 0 16px; }
.show-account .join-heading h1 { font-size: 20px; }
.show-account .join-content { width: 100%; }
#account-panel { margin: 0; }
.join-footer {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 4px 10px;
  padding: 12px 16px max(14px, env(safe-area-inset-bottom));
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
  text-align: center;
}
.join-footer a { color: inherit; text-underline-offset: 2px; }
.join-footer a:hover { color: var(--ink); }
.auth-scan .verify-qr { margin-top: 8px; }
.auth-scan-dialog {
  width: min(420px, calc(100vw - 32px));
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  margin: auto;
  padding: 20px;
  overflow: auto;
  border: 1px solid #343e4c;
  border-radius: 16px;
  background: #191f29;
  color: #f5f7fb;
  box-shadow: 0 24px 80px rgb(0 0 0 / .45);
}
.auth-scan-dialog::backdrop { background: rgb(3 9 6 / .68); backdrop-filter: blur(7px); }
.auth-scan-dialog [hidden] { display: none !important; }
.auth-scan-dialog__header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.auth-scan-dialog__header h2 { margin: 0; font-size: 17px; line-height: 1.35; }
.auth-scan-dialog__close {
  display: grid; flex: 0 0 44px; width: 44px; height: 44px; place-items: center;
  border: 1px solid #343e4c; border-radius: 10px; background: transparent; color: #eaf1f7;
  font: inherit; font-size: 24px; line-height: 1; cursor: pointer;
}
.auth-scan-dialog__close:hover { background: rgb(255 255 255 / .08); }
.auth-scan-dialog__close:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.auth-scan-dialog .auth-scan { margin: 0; }
.auth-scan-dialog .verify-qr { width: min(220px, 100%); height: auto; margin: 16px auto 12px; }
.auth-scan-dialog .auth-step { margin: 8px 0; text-align: center; }
.auth-scan-dialog__qr-pending { display: grid; justify-items: center; gap: 9px; margin: 16px auto 12px; }
.auth-scan-dialog__qr-shape { width: min(220px, 100%); aspect-ratio: 1; overflow: hidden; border-radius: 12px; background: #fff; }
.auth-scan-dialog__qr-shape svg { display: block; width: 100%; height: 100%; filter: blur(5px); opacity: .48; transform: scale(1.04); }
.auth-scan-dialog__qr-status { margin: 0; color: #a8b1be; font-size: 13px; line-height: 1.5; text-align: center; }
.auth-scan-dialog__code { display: flex; align-items: center; justify-content: center; gap: 11px; margin: 14px auto 2px; padding: 10px 15px; border: 1px solid rgb(0 255 136 / .3); border-radius: 11px; background: rgb(0 255 136 / .08); }
.auth-scan-dialog__code span { color: #a8b1be; font-size: 12px; }
.auth-scan-dialog__code strong { color: #00ff88; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 22px; font-weight: 750; letter-spacing: .12em; }
.auth-scan-dialog .secondary-action { display: flex; width: fit-content; margin: 14px auto 0; }
.auth-scan-dialog__status { margin: 12px 0 0; color: #a8b1be; font-size: 13px; line-height: 1.55; text-align: center; }
.auth-scan-dialog__status[data-error="true"] { color: #fca5a5; }
.pending-code { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin: 10px 0; }
.pending-code code { padding: 7px 9px; border-radius: 8px; background: var(--user-field); overflow-wrap: anywhere; }
#pending-code-block p, #pending-code-help { color: var(--muted); font-size: 13px; line-height: 1.6; }
.join-shell .table-3 { --free-accent: var(--accent); }
.join-shell .table-3 .product-status--low-stock { color: var(--accent-on); }
.join-content { min-width: 0; }
.join-message { margin: 0 0 12px; font-size: 13px; color: var(--muted); line-height: 1.5; }
.join-message[data-error="true"] { color: #fca5a5; }
.field-action { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.field-note { margin: 0; color: var(--user-muted); font-size: 11px; line-height: 1.6; overflow-wrap: anywhere; }
.table-count { width: min(100%, 132px); }
.location-picker { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 8px; padding: 10px; border: 1px solid var(--line); border-radius: 9px; }
.location-picker p, .location-results { grid-column: 1 / -1; }
.location-results .select-option + .select-option { border-top: 1px solid var(--line); }
.attachment { display: flex; align-items: center; gap: 10px; min-width: 0; }
.attachment__icon, .attachment__button { display: inline-flex; align-items: center; justify-content: center; flex: none; border: 1px solid var(--line); border-radius: 10px; }
.attachment__icon { width: 42px; height: 42px; background: var(--user-field); color: var(--user-muted); }
.attachment svg { width: 17px; height: 17px; }
.attachment__details { flex: 1; min-width: 0; font-size: 13px; line-height: 1.4; }
.attachment__button { position: relative; gap: 5px; min-height: 44px; padding: 6px 10px; font-size: 12px; font-weight: 570; }
.attachment__button:hover { background: var(--user-field); }
.attachment__button input { position: absolute; inset: 0; width: 100%; opacity: 0; cursor: pointer; }
.attachment__button:focus-within { outline: 2px solid var(--user-accent); outline-offset: 2px; }
.confirmation { display: flex; align-items: flex-start; gap: 8px; font-size: 12px; line-height: 1.6; }
.confirmation input { margin-top: 3px; accent-color: var(--user-accent); }
.verify-qr { display: block; max-width: 100%; height: auto; margin-bottom: 12px; border-radius: 9px; background: #fff; }
.user-form__footer a, .secondary-action {
  display: inline-flex; align-items: center; justify-content: center; min-height: 34px; padding: 7px 11px;
  border: 1px solid var(--user-line); border-radius: 8px; background: transparent; color: var(--user-ink);
  font-size: 11px; font-weight: 570; text-decoration: none; cursor: pointer;
}
.join-shell .user-form__footer .form-submit { color: var(--accent-on); }
.join-shell .user-form__footer .form-submit:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
#application-form .user-form__header p { font-size: 12px; }
.form-section .onboarding-section__title {
  display: flex; align-items: center; gap: 8px; margin: 0 0 12px; color: var(--user-muted);
  font-size: 12px; font-weight: 620; line-height: 1.4;
}
.onboarding-section__title::after { height: 1px; flex: 1 1 auto; background: var(--user-line); content: ""; }
.onboarding-section__number { color: var(--user-ink); font-weight: 680; white-space: nowrap; }
.onboarding-section__meta { color: var(--user-muted); font-size: 10px; font-weight: 500; white-space: nowrap; }
.onboarding-section + .onboarding-section { margin-top: 24px; }
.onboarding-store-fields { row-gap: 11px; }
.onboarding-location-group { gap: 8px; }
.onboarding-location-card {
  display: flex; align-items: center; min-width: 0; gap: 10px; padding: 10px;
  border: 1px solid var(--user-line); border-radius: 11px; background: var(--user-field);
}
.onboarding-location-card__icon {
  display: grid; width: 36px; height: 36px; flex: 0 0 auto; place-items: center;
  border: 1px solid var(--user-line); border-radius: 9px; background: var(--user-card); color: var(--user-muted);
}
.onboarding-location-card__icon svg { width: 17px; height: 17px; }
.onboarding-location-card__copy { display: grid; flex: 1; min-width: 0; gap: 3px; }
.onboarding-location-card__copy strong { font-size: 12px; font-weight: 620; }
.onboarding-location-card__copy span { color: var(--user-muted); font-size: 10px; line-height: 1.4; }
.onboarding-location-card .secondary-action { flex: 0 0 auto; min-height: 36px; white-space: nowrap; }
.onboarding-table-field { grid-column: 1 / -1; }
.onboarding-materials { display: grid; gap: 10px; }
.onboarding-material-card { min-width: 0; padding: 12px; border: 1px solid var(--user-line); border-radius: 12px; background: color-mix(in srgb, var(--user-ink) 2%, var(--user-card)); }
.onboarding-license-card { border-color: color-mix(in srgb, var(--user-accent) 28%, var(--user-line)); background: linear-gradient(135deg, color-mix(in srgb, var(--user-accent) 6%, var(--user-card)), var(--user-card) 65%); }
.onboarding-license-card .attachment__icon { border-color: color-mix(in srgb, var(--user-accent) 26%, var(--user-line)); color: var(--user-accent); }
.onboarding-license-card .attachment__button { border-color: color-mix(in srgb, var(--user-accent) 32%, var(--user-line)); color: var(--user-ink); }
.onboarding-recognition { display: grid; gap: 10px; background: color-mix(in srgb, var(--user-ink) 1%, var(--user-page)); }
.onboarding-recognition__header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.onboarding-recognition__header h4 { margin: 0; font-size: 12px; font-weight: 620; }
.onboarding-recognition__header span { color: var(--user-muted); font-size: 10px; white-space: nowrap; }
.onboarding-storefront-card { margin-top: 6px; }
.onboarding-confirmation { margin-top: 14px; }
.onboarding-section__count {
  flex: 0 0 auto;
  padding: 3px 8px;
  border: 1px solid rgb(255 143 134 / .28);
  border-radius: 999px;
  background: rgb(255 143 134 / .08);
  color: #ff9b93;
  font-size: 10px;
  font-weight: 560;
  line-height: 1.3;
}
.field-validation {
  display: block;
  margin-top: 5px;
  color: #ff9b93;
  font-size: 11px;
  font-weight: 520;
  line-height: 1.45;
}
.is-invalid .user-control,
.is-invalid .user-control:focus-within,
.is-invalid.attachment,
.is-invalid .onboarding-material-card,
.is-invalid.onboarding-confirmation {
  border-color: rgb(255 143 134 / .55);
}
.validation-guided { animation: onboarding-validation-guide 1s ease-out 1; }
@keyframes onboarding-validation-guide {
  0% { box-shadow: 0 0 0 0 rgb(255 143 134 / 0); }
  32% { box-shadow: 0 0 0 3px rgb(255 143 134 / .2), 0 0 18px rgb(255 143 134 / .09); }
  100% { box-shadow: 0 0 0 0 rgb(255 143 134 / 0); }
}
#closed-panel { padding-bottom: 16px; }
#applications-panel { margin-block: 20px 36px; }
#application-rows td .product-name { max-width: 270px; }
#application-rows .edit-product { width: auto; min-width: 44px; min-height: 34px; padding-inline: 6px; transform: none; font-size: 11px; }
@media (max-width: 660px) {
  .join-shell { width: calc(100% - 28px); }
  .join-heading { margin: 22px 0 16px; }
  .show-account .join-shell { width: calc(100% - 28px); padding-block: 12px; }
  .show-account .join-heading { margin: 0 0 12px; }
  .show-account .join-content { margin-bottom: 0; }
  .join-content { margin-bottom: 16px; }
  .join-footer { padding: 8px 14px max(10px, env(safe-area-inset-bottom)); }
  .user-control { min-height: 44px; }
  .user-control input, .user-field textarea { font-size: 16px; }
  .user-form__footer button, .user-form__footer a, .secondary-action { min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) {
  .validation-guided { animation: none; }
}
