.basic-form { margin-top: 22px; }
.basic-form .btn.primary { justify-self: start; }
#metadata-output { max-height: 320px; }

.oz-hub-hero {
  padding-bottom: 32px;
}

.oz-hub-grid {
  padding: 6px 0 28px;
}

.oz-hub-card {
  display: grid;
  align-content: start;
  gap: 12px;
}

.oz-hub-card .btn {
  justify-self: start;
  margin-top: 8px;
}

.oz-feature-grid {
  align-items: stretch;
}

.oz-feature-card {
  display: grid;
  gap: 10px;
  align-content: start;
  min-width: 0;
}

.oz-feature-card h3,
.oz-feature-card p {
  margin: 0;
}

.oz-tier-grid {
  align-items: stretch;
}

.oz-tier-card {
  display: grid;
  gap: 12px;
  align-content: start;
  min-width: 0;
}

.oz-tier-card h3,
.oz-tier-card ul {
  margin: 0;
}

.oz-hub-compat {
  margin-bottom: 70px;
}

.wizard-shell {
  padding-bottom: 72px;
}

.wizard-page-hero {
  padding-top: 68px;
  padding-bottom: 20px;
}

.wizard-page-hero h1 {
  line-height: 1.04;
  letter-spacing: -0.02em;
}

html[lang="zh-CN"] .wizard-page-hero h1 {
  line-height: 1.14;
  letter-spacing: 0;
}

.wizard-breadcrumb {
  display: inline-flex;
  width: max-content;
  margin-bottom: 20px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
}

.wizard-panel {
  display: grid;
  gap: 24px;
}

.wizard-progress {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(104px, 1fr));
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: wizard-step;
}

.wizard-progress li {
  position: relative;
  counter-increment: wizard-step;
  min-width: 0;
  padding: 12px 12px 12px 38px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.035);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.wizard-progress li::before {
  content: counter(wizard-step);
  position: absolute;
  left: 11px;
  top: 50%;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  color: var(--muted);
  border: 1px solid var(--line);
  transform: translateY(-50%);
  font-size: 11px;
}

.wizard-progress li.complete {
  color: var(--text);
  border-color: rgba(114, 240, 179, 0.28);
  background: rgba(114, 240, 179, 0.055);
}

.wizard-progress li.complete::before {
  content: "\2713";
  color: var(--success);
  border-color: rgba(114, 240, 179, 0.4);
}

.wizard-progress li.active {
  color: var(--text);
  border-color: rgba(110, 231, 249, 0.48);
  background: rgba(110, 231, 249, 0.08);
}

.wizard-progress li.active::before {
  color: #061019;
  border-color: transparent;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
}

.wizard-step {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.wizard-step[hidden] {
  display: none;
}

.wizard-step > h2,
.wizard-step > p {
  max-width: 820px;
}

#encrypt-post-actions[hidden],
#protected-metadata-details[hidden],
#text-output-options[hidden] {
  display: none !important;
}

.wizard-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.wizard-actions .btn {
  min-width: 118px;
}

.wizard-actions [data-wizard-reset] {
  color: var(--muted);
  border-color: rgba(255, 255, 255, 0.1);
}

.ack-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 16px;
  border: 1px solid rgba(110, 231, 249, 0.28);
  border-radius: 16px;
  background: rgba(110, 231, 249, 0.06);
  cursor: pointer;
}

.ack-card input {
  margin-top: 4px;
  accent-color: var(--brand);
}

.ack-card strong,
.ack-card small {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.ack-card small {
  margin-top: 5px;
  color: var(--muted);
  line-height: 1.55;
}

.embedded-compat {
  margin-top: 0;
}

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

.scenario-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.035);
  cursor: pointer;
}

.scenario-card:has(input:checked) {
  border-color: rgba(110, 231, 249, 0.46);
  background: rgba(110, 231, 249, 0.08);
}

.scenario-card input {
  margin-top: 3px;
  accent-color: var(--brand);
}

.scenario-card strong,
.scenario-card small {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.scenario-card small {
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.5;
}

.protection-strategy-panel {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.035);
}

.notice-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.notice-list .notice {
  margin: 0;
}

.notice-list strong {
  display: block;
  margin-bottom: 5px;
}

.notice-list p,
.field-help {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.factor-note.success {
  color: var(--success);
}

.factor-note.warning {
  color: var(--warning);
}

.factor-note.error {
  color: var(--danger);
}

.main-protection-panel,
.config-template-panel,
.qr-import-panel,
.qr-output {
  display: grid;
  gap: 14px;
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.035);
}

.config-template-panel .inline-actions,
.qr-import-panel .inline-actions,
#encrypt-post-actions {
  margin-top: 0;
}

.qr-output {
  margin-top: 16px;
}

.qr-code-box {
  display: grid;
  place-items: center;
  min-height: 180px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.94);
  overflow: auto;
}

.qr-code-box svg,
.qr-code-box img,
.qr-code-box canvas {
  display: block;
  max-width: min(100%, 320px);
  height: auto;
}

.qr-camera-video {
  width: 100%;
  max-height: 360px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.32);
}

.protection-strategy-panel h3 {
  margin-top: 8px;
}

.protection-strategy-panel p {
  margin: 0;
}

.advanced-strategy-details .strategy-grid {
  padding: 0 14px 14px;
}

.advanced-strategy-fields {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
}

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

.strategy-card.disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.strategy-card.disabled input {
  cursor: not-allowed;
}

.text-block-input textarea,
#plain-text,
#text-preview,
#metadata-output,
.result-box,
.review-item strong,
.metadata-item strong,
.file-list-item strong,
.file-chip span {
  overflow-wrap: anywhere;
  word-break: break-word;
}

#ozc-text-block {
  min-height: 170px;
  white-space: pre-wrap;
}

.text-block-output textarea {
  min-height: 220px;
  max-height: 420px;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.55;
}

.smart-preview-box {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.smart-preview {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.smart-preview img,
.smart-preview video {
  display: block;
  max-width: 100%;
  max-height: 420px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.22);
}

.smart-preview audio {
  width: 100%;
  max-width: 100%;
}

.preview-text {
  max-height: 420px;
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.preview-fallback {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.035);
}

.preview-fallback p {
  margin: 0;
}

.file-list-preview {
  grid-column: 1 / -1;
  min-width: 0;
}

.file-list-preview .smart-preview {
  margin-top: 6px;
}

.file-list-preview .smart-preview img,
.file-list-preview .smart-preview video {
  max-height: 260px;
}

.file-list-preview .preview-text {
  max-height: 220px;
  font-size: 12px;
}

.review-panel,
.metadata-viewer {
  display: grid;
  gap: 14px;
}

.review-panel {
  padding: 16px;
  border: 1px solid rgba(110, 231, 249, 0.22);
  border-radius: 18px;
  background: rgba(110, 231, 249, 0.045);
}

.review-head h4 {
  margin: 0 0 6px;
  font-size: 18px;
}

.review-head p {
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
}

.review-grid,
.metadata-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

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

.review-item,
.metadata-item {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255,255,255,0.035);
}

.review-item.wide,
.metadata-item.wide {
  grid-column: 1 / -1;
}

.review-item span,
.metadata-item span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 12px;
}

.review-item strong,
.metadata-item strong {
  display: block;
  min-width: 0;
  font-size: 14px;
  line-height: 1.45;
  word-break: break-word;
}

.factor-pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.mini-pill,
.muted-value {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 12px;
  line-height: 1.25;
}

.mini-pill {
  color: var(--brand);
  border: 1px solid rgba(110, 231, 249, 0.26);
  background: rgba(110, 231, 249, 0.08);
}

.muted-value {
  color: var(--muted);
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.04);
}

.compact-warning {
  margin: 0;
}

.text-output-options {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.text-block-input textarea {
  min-height: 126px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
}

.metadata-item.protected strong {
  color: var(--muted);
  font-weight: 700;
}

.raw-metadata {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255,255,255,0.035);
  overflow: hidden;
}

.raw-metadata summary {
  cursor: pointer;
  padding: 13px 15px;
  color: var(--text);
  font-weight: 750;
}

.raw-metadata pre {
  margin: 0;
  border-width: 1px 0 0;
  border-radius: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.friendly-details {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255,255,255,0.03);
  overflow: hidden;
}

.friendly-details summary {
  cursor: pointer;
  padding: 13px 15px;
  color: var(--text);
  font-weight: 750;
}

.friendly-details .metadata-grid {
  padding: 0 14px 14px;
}

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

.decrypt-step-stack {
  display: grid;
  gap: 16px;
}

.tight-actions {
  margin-top: 4px;
}

.validation-card strong {
  display: block;
  margin-bottom: 8px;
  color: #fecdd3;
}

.validation-card ul {
  margin: 0;
  padding-left: 20px;
  line-height: 1.7;
}

.flow-overview {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 22px 0 4px;
}

.flow-card,
.flow-section {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.035);
}

.flow-card {
  display: grid;
  gap: 8px;
  align-content: start;
  min-height: 150px;
  padding: 15px;
}

.flow-card span,
.step-heading span {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  color: #061019;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  font-weight: 900;
}

.flow-card strong {
  display: block;
  min-height: 42px;
}

.flow-card p,
.step-heading p {
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
}

.flow-section {
  display: grid;
  gap: 16px;
  padding: 18px;
}

.step-heading {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.step-heading h3 {
  margin: 0 0 5px;
  font-size: 20px;
}

.gesture-confirm-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.gesture-confirm-grid .gesture-canvas {
  max-width: 100%;
}

#unlock-fields {
  margin-top: 16px;
}

@media (max-width: 1020px) {
  .scenario-grid,
  .notice-list,
  .strategy-grid {
    grid-template-columns: 1fr;
  }

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

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

@media (max-width: 860px) {
  .wizard-shell {
    width: min(100% - 28px, 1180px);
    padding-bottom: 48px;
  }

  .wizard-panel {
    gap: 18px;
    padding: 16px;
  }

  .wizard-page-hero {
    padding-top: 82px;
  }

  .wizard-progress {
    display: flex;
    overflow-x: auto;
    padding-bottom: 4px;
    scroll-snap-type: x proximity;
  }

  .wizard-progress li {
    flex: 0 0 142px;
    scroll-snap-align: start;
  }

  .wizard-actions {
    position: sticky;
    bottom: 0;
    z-index: 5;
    display: grid;
    grid-template-columns: 1fr 1fr;
    padding: 12px 0 0;
    background: rgba(7, 16, 24, 0.92);
    backdrop-filter: blur(12px);
  }

  .wizard-actions .btn {
    width: 100%;
    min-width: 0;
  }

  #encrypt-post-actions,
  .wizard-step .inline-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .wizard-actions [data-wizard-next] {
    grid-column: 1 / -1;
    order: -1;
  }

  .oz-hub-card .btn {
    justify-self: stretch;
  }

  .flow-overview,
  .gesture-confirm-grid,
  .review-grid,
  .metadata-grid,
  .metadata-grid.secondary {
    grid-template-columns: 1fr;
  }

  .tool-panel {
    padding: 18px;
  }

  .basic-form {
    gap: 14px;
    margin-top: 18px;
  }

  .flow-section {
    gap: 14px;
    padding: 14px;
  }

  .flow-card {
    min-height: 0;
    padding: 13px;
  }

  .flow-card strong {
    min-height: 0;
  }

  .step-heading {
    grid-template-columns: 1fr;
  }

  .review-panel {
    padding: 14px;
  }

  .review-item.wide,
  .metadata-item.wide {
    grid-column: auto;
  }

  #metadata-output {
    max-height: 260px;
    font-size: 12px;
    padding: 14px;
  }
}
