/* Simple Uploader: design tokens first, then layout, then components. */

:root {
  color-scheme: light dark;
  --bg: #f3f5fa;
  --surface: #ffffff;
  --surface-muted: #f6f7fb;
  --border: #e3e7ef;
  --border-strong: #cdd4e2;
  --control-border: #848ea1;
  --text: #0f172a;
  --text-muted: #5d6879;
  --text-faint: #626c7e;
  --primary: #4b50c8;
  --primary-hover: #3d41ad;
  --on-primary: #ffffff;
  --primary-soft: #eeeffa;
  --primary-ahead: #c3c5ef;
  --success: #146c34;
  --success-soft: #e5f6eb;
  --on-success: #ffffff;
  --danger: #c62828;
  --danger-hover: #a91f1f;
  --danger-soft: #fdecec;
  --on-danger: #ffffff;
  --warning: #965a00;
  --warning-soft: #fff3d9;
  --info: #0b5b84;
  --info-soft: #e6f3fa;
  --radius-lg: 16px;
  --radius: 12px;
  --radius-sm: 10px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --fast: 120ms;
  --base: 200ms;
  --rise: 8px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a0f1d;
    --surface: #111728;
    --surface-muted: #0d1322;
    --border: #222a3f;
    --border-strong: #323c56;
    --control-border: #5b6683;
    --text: #e8ebf3;
    --text-muted: #a3adc2;
    --text-faint: #77829b;
    --primary: #9b9de8;
    --primary-hover: #b2b3f0;
    --on-primary: #0a0f1d;
    --primary-soft: #1e2045;
    --primary-ahead: #3c3f86;
    --success: #62c486;
    --success-soft: #10291a;
    --on-success: #0a0f1d;
    --danger: #f87171;
    --danger-hover: #fca5a5;
    --danger-soft: #2e1416;
    --on-danger: #0a0f1d;
    --warning: #fbbf24;
    --warning-soft: #2c230f;
    --info: #7dd3fc;
    --info-soft: #0e2533;
  }
}

/* Base */

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
  accent-color: var(--primary);
  caret-color: var(--primary);
  scrollbar-color: var(--border-strong) var(--bg);
}

::selection {
  color: var(--text);
  background: var(--primary-ahead);
}

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  background: var(--bg);
}

h1,
h2,
p {
  margin: 0;
}

a {
  color: var(--primary);
  text-underline-offset: 3px;
}

button,
input,
select {
  color: inherit;
  font: inherit;
}

.icon {
  flex: none;
  width: 1.15em;
  height: 1.15em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

[tabindex="-1"]:focus {
  outline: none;
}

.mono {
  font-family: var(--mono);
  font-size: 0.88em;
}

.muted {
  color: var(--text-muted);
}

.hint {
  color: var(--text-muted);
  font-size: 0.85rem;
  text-wrap: pretty;
}

.center {
  text-align: center;
  text-wrap: balance;
}

.select-all {
  user-select: all;
}

/* Layout */

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 960px;
  margin: 0 auto;
  padding: 12px 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  color: var(--on-primary);
  font-size: 1.05rem;
  background: var(--primary);
}

.lang {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
}

.lang-link {
  padding: 5px 12px;
  border-radius: 999px;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
}

.lang-link[aria-current="true"] {
  color: var(--primary);
  background: var(--primary-soft);
}

.shell {
  display: grid;
  flex: 1;
  align-content: start;
  gap: 20px;
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  padding: 40px 20px 24px;
}

.hero {
  display: grid;
  justify-items: center;
  gap: 10px;
  text-align: center;
}

.hero h1 {
  font-size: clamp(1.65rem, 4vw, 2.15rem);
  font-weight: 650;
  letter-spacing: -0.015em;
  line-height: 1.25;
}

.hero h1,
.lead {
  text-wrap: balance;
}

.lead {
  max-width: 34rem;
  color: var(--text-muted);
}


.footer {
  display: grid;
  gap: 4px;
  max-width: 640px;
  margin: 0 auto;
  padding: 8px 20px 36px;
  color: var(--text-faint);
  font-size: 0.82rem;
  text-align: center;
}

.footer p {
  text-wrap: balance;
}

.footer .icon {
  margin-right: 6px;
  vertical-align: -0.18em;
}

.footer p > span + span {
  margin-left: 6px;
}

/* Card */

.card {
  display: grid;
  gap: 18px;
  padding: 26px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

/* Drop zone, selected items and archive contents */

.dropzone {
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 34px 20px 30px;
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius);
  text-align: center;
  background: var(--surface-muted);
  cursor: pointer;
  transition: border-color var(--fast) var(--ease-out), background-color var(--fast) var(--ease-out);
}

.dropzone:hover,
.dropzone.is-dragover {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.dropzone-icon {
  margin-bottom: 6px;
  color: var(--primary);
  font-size: 1.75rem;
  line-height: 1;
}

.dropzone-title {
  font-size: 1.05rem;
  font-weight: 600;
}

.dropzone-sub {
  color: var(--text-muted);
}

.dropzone-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: 8px 0 6px;
}

.dropzone-hint {
  margin-top: 4px;
  color: var(--text-faint);
  font-size: 0.8rem;
}

.selection,
.archive {
  display: grid;
  gap: 10px;
}

.selection {
  border-radius: var(--radius);
}

.selection.is-dragover {
  outline: 2px dashed var(--primary);
  outline-offset: 6px;
}

/* Long lists scroll inside the card instead of stretching the page. */
.item-list {
  display: grid;
  gap: 6px;
  max-height: min(24rem, 55vh);
  margin: 0;
  padding: 0;
  overflow-y: auto;
  list-style: none;
}

.item {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 8px 10px;
  border-radius: var(--radius);
  background: var(--surface-muted);
}

.item .file-icon {
  width: 36px;
  height: 36px;
  font-size: 1.1rem;
}

/* Rows and cards hold one icon per kind and show the matching one. */
[data-kind="file"] > .file-icon > .icon:not(.icon-file),
[data-kind="folder"] > .file-icon > .icon:not(.icon-folder),
[data-kind="archive"] > .file-icon > .icon:not(.icon-archive) {
  display: none;
}

.icon-btn {
  display: grid;
  flex: none;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 1.05rem;
  background: transparent;
  cursor: pointer;
  transition: color var(--fast) var(--ease-out), background-color var(--fast) var(--ease-out);
}

.icon-btn:hover:not(:disabled) {
  color: var(--danger);
  background: var(--danger-soft);
}

.icon-btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
}

.icon-btn:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.item-more {
  color: var(--text-muted);
  font-size: 0.85rem;
  text-align: center;
}

/* An archive's contents belong to the card above them: an outlined list, lighter than it. */
.archive .item-list {
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.archive .item {
  border-radius: 0;
  background: none;
}

.archive .item + .item {
  border-top: 1px solid var(--border);
}

.archive .item .file-icon {
  background: var(--surface-muted);
}

.selection-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 12px;
}

.selection-summary {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
}

.selection-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  margin-left: auto;
}

.file-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: var(--surface-muted);
}

.file-icon {
  display: grid;
  flex: none;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  color: var(--primary);
  font-size: 1.25rem;
  background: var(--surface);
}

.file-meta {
  display: grid;
  flex: 1;
  min-width: 0;
}

.file-name {
  overflow: hidden;
  font-weight: 600;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.file-size {
  color: var(--text-muted);
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
}

/* Fields */

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.field {
  display: grid;
  gap: 8px;
}

.field-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  font-weight: 600;
}

.field-label .icon {
  color: var(--text-muted);
}

.input,
.select {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  border: 1px solid var(--control-border);
  border-radius: var(--radius-sm);
  color: var(--text);
  background: var(--surface);
  transition: border-color var(--fast) var(--ease-out);
}

.input:focus,
.select:focus {
  border-color: var(--primary);
  outline: 1px solid var(--primary);
}

.input[readonly] {
  background: var(--surface-muted);
}

.input:disabled,
.select:disabled {
  opacity: 0.6;
}

.select-wrap {
  position: relative;
}

.select {
  padding-right: 40px;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

.select-wrap::after {
  position: absolute;
  top: 50%;
  right: 17px;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--text-muted);
  border-bottom: 2px solid var(--text-muted);
  content: "";
  pointer-events: none;
  transform: translateY(-70%) rotate(45deg);
}

.input-wrap {
  position: relative;
  flex: 1;
}

.input-wrap .input {
  padding-right: 50px;
}

.input-action {
  position: absolute;
  top: 50%;
  right: 5px;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 8px;
  color: var(--text-muted);
  background: transparent;
  cursor: pointer;
  transform: translateY(-50%);
}

.input-action:hover {
  color: var(--text);
  background: var(--surface-muted);
}

.input-action[aria-pressed="true"] {
  color: var(--primary);
}

.input-action:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
}

.input-row {
  display: flex;
  gap: 10px;
}

.toggle-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.switch {
  position: relative;
  flex: none;
  width: 46px;
  height: 28px;
  margin-top: 1px;
}

.switch input {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
  opacity: 0;
}

.switch-track {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: var(--control-border);
  transition: background-color var(--base) var(--ease-out);
}

.switch-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  transition: transform var(--base) var(--ease-out);
}

.switch input:checked + .switch-track {
  background: var(--primary);
}

.switch input:checked + .switch-track .switch-thumb {
  transform: translateX(18px);
}

.switch input:focus-visible + .switch-track {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.toggle-text {
  display: grid;
  gap: 2px;
}

.toggle-title {
  font-weight: 600;
  cursor: pointer;
}

.toggle-desc {
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-weight: 600;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--fast) var(--ease-out), border-color var(--fast) var(--ease-out), color var(--fast) var(--ease-out), transform 60ms;
}

.btn:active:not(:disabled) {
  transform: translateY(1px);
}

.btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.btn-primary {
  color: var(--on-primary);
  background: var(--primary);
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-hover);
}

.btn-secondary {
  border-color: var(--border-strong);
  color: var(--text);
  background: var(--surface);
}

.btn-secondary:hover:not(:disabled) {
  border-color: var(--primary);
  color: var(--primary);
}

.btn-ghost {
  color: var(--text-muted);
  background: transparent;
}

.btn-ghost:hover:not(:disabled) {
  color: var(--text);
  background: var(--surface-muted);
}

.btn-danger {
  color: var(--on-danger);
  background: var(--danger);
}

.btn-danger:hover:not(:disabled) {
  background: var(--danger-hover);
}

.btn-lg {
  height: 52px;
  border-radius: var(--radius);
  font-size: 1.05rem;
}

.btn-sm {
  height: 34px;
  padding: 0 12px;
  font-size: 0.85rem;
}

.btn-block {
  width: 100%;
}

.btn.is-copied,
.btn.is-copied:hover {
  border-color: var(--success);
  color: var(--on-success);
  background: var(--success);
}

/* Alerts and chips */

.alert {
  padding: 12px 14px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
}

.alert-success {
  color: var(--success);
  background: var(--success-soft);
}

.alert-danger {
  color: var(--danger);
  background: var(--danger-soft);
}

.alert-warning {
  color: var(--warning);
  background: var(--warning-soft);
}

.alert-info {
  color: var(--info);
  background: var(--info-soft);
}

.alert-secondary {
  border-color: var(--border);
  color: var(--text-muted);
  background: var(--surface-muted);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Result, delete and message cards */

.result-head,
.danger-head {
  display: flex;
  align-items: center;
  gap: 14px;
}

.result-head h2,
.danger-head h1 {
  font-size: 1.25rem;
  line-height: 1.35;
}

.result-icon,
.danger-icon,
.message-icon {
  display: grid;
  flex: none;
  place-items: center;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  font-size: 1.5rem;
}

.result-icon {
  color: var(--success);
  background: var(--success-soft);
}

.danger-icon {
  color: var(--danger);
  background: var(--danger-soft);
}

.message-icon {
  color: var(--warning);
  background: var(--warning-soft);
}

.copy-row {
  display: flex;
  gap: 10px;
}

.copy-row .input {
  flex: 1;
  min-width: 0;
}

.more {
  border-top: 1px solid var(--border);
}

.more > summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 13px 0;
  color: var(--text-muted);
  font-weight: 600;
  list-style: none;
  cursor: pointer;
}

.more > summary::-webkit-details-marker {
  display: none;
}

.more > summary::after {
  width: 8px;
  height: 8px;
  margin-left: auto;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  content: "";
  transform: rotate(45deg);
  transition: transform var(--base) var(--ease-out);
}

.more[open] > summary::after {
  transform: rotate(-135deg);
}

.more-body {
  display: grid;
  gap: 8px;
  padding-bottom: 4px;
}

.message {
  justify-items: center;
  text-align: center;
}

.message h1 {
  font-size: 1.35rem;
}

/* Progress panel: steps, label + percentage, two-layer bar, details */

.progress-panel {
  display: grid;
  gap: 10px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.steps {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin: 0;
  padding: 0;
  color: var(--text-faint);
  font-size: 0.85rem;
  list-style: none;
}

.steps li {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.step-dot {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border: 2px solid var(--border-strong);
  border-radius: 50%;
  font-size: 0.68rem;
  line-height: 1;
  transition: border-color var(--base) var(--ease-out), background-color var(--base) var(--ease-out);
}

.steps li[data-state="active"] {
  color: var(--text);
  font-weight: 600;
}

.steps li[data-state="active"] .step-dot {
  border-color: var(--primary);
  background: radial-gradient(circle, var(--primary) 0 38%, transparent 44%);
}

.steps li[data-state="done"] {
  color: var(--success);
}

.steps li[data-state="done"] .step-dot {
  border-color: var(--success);
  background: var(--success);
}

.steps li[data-state="done"] .step-dot::after {
  width: 4px;
  height: 8px;
  margin-top: -2px;
  border-right: 2px solid var(--on-success);
  border-bottom: 2px solid var(--on-success);
  content: "";
  transform: rotate(45deg);
}

.steps li[data-state="failed"] {
  color: var(--danger);
  font-weight: 600;
}

.steps li[data-state="failed"] .step-dot {
  border-color: var(--danger);
  background: var(--danger);
}

.steps li[data-state="failed"] .step-dot::after {
  width: 2px;
  height: 9px;
  content: "";
  background:
    linear-gradient(var(--on-danger), var(--on-danger)) top / 2px 5px no-repeat,
    linear-gradient(var(--on-danger), var(--on-danger)) bottom / 2px 2px no-repeat;
}

.progress-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-top: 4px;
  font-weight: 600;
}

.progress-percent {
  font-size: 1.7rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.meter {
  position: relative;
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--border);
}

.meter-ahead,
.meter-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  border-radius: 999px;
  transition: width var(--base) var(--ease-out);
}

.meter-ahead,
.legend-ahead::before {
  background:
    repeating-linear-gradient(-45deg, transparent 0 3px, color-mix(in srgb, var(--primary) 35%, transparent) 3px 5px),
    var(--primary-ahead);
}

.meter-fill {
  background: var(--primary);
}

.meter.is-failed .meter-fill {
  background: var(--danger);
}

.meter.is-failed .meter-ahead {
  visibility: hidden;
}

/* Steps without a measurable fraction (Argon2id, proof-of-work). */
.meter.indeterminate .meter-ahead {
  width: 0;
}

.meter.indeterminate .meter-fill {
  width: 35%;
  transition: none;
  animation: meter-sweep 1.1s ease-in-out infinite;
}

@keyframes meter-sweep {
  from {
    transform: translateX(-100%);
  }

  to {
    transform: translateX(290%);
  }
}

/* The legend explains the two layers; it means nothing while the bar sweeps. */
.meter.indeterminate ~ .progress-foot .legend,
.meter.is-failed ~ .progress-foot .legend {
  visibility: hidden;
}

.progress-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 16px;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
}

.legend {
  display: flex;
  gap: 14px;
}

.legend span::before {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 6px;
  border-radius: 3px;
  content: "";
  vertical-align: -1px;
}

.legend-done::before {
  background: var(--primary);
}

/* Small screens */

@media (max-width: 540px) {
  .shell {
    padding-top: 24px;
  }

  .card {
    padding: 18px;
    border-radius: 16px;
  }

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

  .copy-row,
  .input-row {
    flex-direction: column;
  }

  /* In a column, flex: 1 would collapse the field's height. */
  .copy-row .input {
    flex: none;
  }

  /* Phones cannot drag and drop: the pickers are the way in, stacked at one width. */
  .dropzone-actions {
    display: grid;
    grid-template-columns: minmax(0, 16rem);
    justify-content: center;
    width: 100%;
  }

  .selection-actions {
    justify-content: space-between;
    width: 100%;
    margin-left: 0;
  }

  .selection-actions .btn {
    padding: 0 8px;
  }

  .selection-actions .icon {
    display: none;
  }
}

/* Motion: one authored moment (the result arriving), the rest is state feedback.
   Every animation starts from the final, visible state's values via `both`, so
   content is never left hidden if an animation does not run. */

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(var(--rise));
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
}

@keyframes draw {
  from {
    stroke-dashoffset: 21;
  }
}

@keyframes pop {
  from {
    transform: scale(0.6);
  }
}

/* The file is ready: the card settles in, then the check draws itself. */
#result:not([hidden]) {
  animation: rise-in 420ms var(--ease-out) both;
}

#result:not([hidden]) .result-icon {
  animation: pop 420ms var(--ease-out) 120ms both;
}

#result:not([hidden]) .result-icon path {
  stroke-dasharray: 21;
  animation: draw 380ms var(--ease-out) 220ms both;
}

/* Revealed fields and fresh status messages arrive instead of popping in. */
#password-fields:not([hidden]),
#password-form:not([hidden]),
#file-card:not([hidden]),
#selection:not([hidden]),
#archive:not([hidden]),
#progress-panel:not([hidden]) {
  animation: rise-in var(--base) var(--ease-out) both;
  --rise: 4px;
}

.alert:not([hidden]) {
  animation: fade-in var(--base) var(--ease-out) both;
}

/* Reduced motion keeps colour and opacity feedback but drops movement. */
@media (prefers-reduced-motion: reduce) {
  :root {
    --rise: 0px;
  }

  #password-fields:not([hidden]),
  #password-form:not([hidden]),
  #file-card:not([hidden]),
  #selection:not([hidden]),
  #archive:not([hidden]),
  #progress-panel:not([hidden]) {
    --rise: 0px;
  }

  .icon-btn {
    transition: none;
  }

  #result:not([hidden]) .result-icon,
  #result:not([hidden]) .result-icon path {
    animation: none;
  }

  .switch-thumb,
  .more > summary::after {
    transition: none;
  }

  .btn:active:not(:disabled) {
    transform: none;
  }

  .meter.indeterminate .meter-fill {
    width: 100%;
    opacity: 0.45;
    animation: none;
  }
}
