/* Signal orange, paper white and deep ink: solid semantic colors in both native themes.
   All visual effects are decorative CSS. No web fonts, remote assets or secret-derived content. */

:root {
  color-scheme: light;
  --bg: #faf9f6;
  --fg: #18202a;
  --muted: #535a63;
  --panel: #ffffff;
  --field: #ffffff;
  --subtle: #f1eee8;
  --border: #727780;
  --stroke: #d9d9d2;
  --accent: #a63c0a;
  --accent-hover: #872e06;
  --accent-fg: #ffffff;
  --focus: #005fcc;
  --ok: #246245;
  --error: #af203a;
  --warning: #874700;
  --noise-base: #e67838;
  --noise-grain: #c9561b;
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lead: 1.0625rem;
  --text-step: 1.3rem;
  --text-title: clamp(1.75rem, 1.35rem + 1.6vw, 2.5rem);
  --leading-body: 1.6;
  --leading-title: 1.15;
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4rem;
  --radius-control: 0.75rem;
  --radius-panel: 0;
  --radius-pill: 999px;
  --motion-fast: 120ms;
  --motion-standard: 220ms;
  --ease-out: cubic-bezier(0.2, 0.7, 0.2, 1);
  --content-width: 60rem;
  --shell-width: 76rem;
  --page-gutter: clamp(1rem, 4vw, 2rem);
  --panel-padding: clamp(1rem, 2vw, 1.5rem);
  --target-size: 2.75rem;
  font-family: var(--font-sans);
  font-size: 100%;
  line-height: var(--leading-body);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #111820;
  --fg: #f8f7f3;
  --muted: #c0c7ce;
  --panel: #19232d;
  --field: #111820;
  --subtle: #24313d;
  --border: #8795a3;
  --stroke: #354654;
  --accent: #ffad72;
  --accent-hover: #ffc396;
  --accent-fg: #24170f;
  --focus: #a9d1ff;
  --ok: #9cd8b4;
  --error: #ffb3be;
  --warning: #ffd18a;
  --noise-base: #ad491b;
  --noise-grain: #8a3713;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    color-scheme: dark;
    --bg: #111820;
    --fg: #f8f7f3;
    --muted: #c0c7ce;
    --panel: #19232d;
    --field: #111820;
    --subtle: #24313d;
    --border: #8795a3;
    --stroke: #354654;
    --accent: #ffad72;
    --accent-hover: #ffc396;
    --accent-fg: #24170f;
    --focus: #a9d1ff;
    --ok: #9cd8b4;
    --error: #ffb3be;
    --warning: #ffd18a;
    --noise-base: #ad491b;
    --noise-grain: #8a3713;
  }
}

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

/* State changes must stay immediate, including the end of the five-minute reveal. */
[hidden] {
  display: none !important;
}

body {
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  overflow-wrap: anywhere;
}

::selection {
  color: var(--accent-fg);
  background: var(--accent);
}

.header-inner,
.page,
.site-footer {
  width: 100%;
  margin-inline: auto;
  padding-inline: var(--page-gutter);
}

.site-header {
  padding-block: var(--space-3);
  background: var(--panel);
  border-bottom: 1px solid var(--stroke);
}

.header-inner {
  display: flex;
  align-items: center;
  max-width: var(--shell-width);
}

#theme-toggle {
  margin-left: auto;
  padding: var(--space-2);
}

#theme-toggle svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

#theme-toggle[aria-pressed="false"] .theme-sun,
#theme-toggle[aria-pressed="true"] .theme-moon {
  display: none;
}

/* A synchronous palette switch must not interpolate controls or native progress. */
.theme-switching *,
.theme-switching *::before,
.theme-switching *::after {
  transition: none !important;
}

.theme-switching progress::-webkit-progress-value {
  transition: none !important;
}

.theme-switching progress::-moz-progress-bar {
  transition: none !important;
}

/* TA-48: the brand link keeps a full 44 px touch target. */
.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: var(--target-size);
  color: var(--fg);
  border-radius: var(--radius-control);
  font-size: var(--text-step);
  font-weight: 750;
  letter-spacing: -0.035em;
  text-decoration: none;
}

.brand-mark {
  flex: none;
  width: 2rem;
  height: 2rem;
  color: var(--accent);
  fill: currentColor;
}

.page {
  max-width: var(--content-width);
  padding-block: var(--space-3);
}

.panel {
  padding: var(--panel-padding);
  background: var(--panel);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-panel);
}

h1 {
  margin: 0 0 var(--space-4);
  font-size: var(--text-title);
  font-weight: 750;
  line-height: var(--leading-title);
  letter-spacing: -0.04em;
  text-wrap: balance;
}

/* TA-50: later states still use one h1 and retain the established 1.3rem size. */
h1.step-title {
  font-size: var(--text-step);
  line-height: 1.35;
  letter-spacing: -0.02em;
}

.lead {
  margin-block: 0 var(--space-5);
  color: var(--muted);
  font-size: var(--text-lead);
}

.site-footer {
  max-width: var(--content-width);
  padding-bottom: var(--space-3);
  color: var(--muted);
  font-size: var(--text-sm);
}

/* Privacy copy uses the measured opaque page color. */
.footer-details {
  display: grid;
  gap: var(--space-2);
  padding-block: var(--space-2);
  background: var(--bg);
  border-top: 1px solid var(--stroke);
}

.footer-details p {
  margin: 0;
}

.footer-credit {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0 var(--space-2);
  width: fit-content;
  margin: 0 auto;
  padding-inline: var(--space-2);
  color: var(--fg);
  background: var(--bg);
  text-align: center;
}

.footer-credit a {
  display: inline-flex;
  align-items: center;
  min-height: var(--target-size);
  color: var(--accent);
}

.field-label {
  display: block;
  margin: var(--space-5) 0 var(--space-2);
  font-weight: 650;
}

textarea,
input[type="text"] {
  width: 100%;
  min-height: var(--target-size);
  padding: var(--space-3) var(--space-4);
  font: inherit;
  color: var(--fg);
  background: var(--field);
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
}

textarea {
  display: block;
  resize: vertical;
  font-family: var(--font-mono);
}

textarea[aria-invalid="true"] {
  border: 2px solid var(--error);
}

.choices {
  border: 0;
  margin: 0;
  padding: 0;
}

.choices .field-label {
  padding: 0;
}

.choice {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: var(--target-size);
  margin-right: var(--space-5);
  cursor: pointer;
}

/* 24 px even without the label; the label provides the 44 px touch target (TA-48). */
.choice input {
  width: 1.5rem;
  height: 1.5rem;
  margin: 0;
  accent-color: var(--accent);
}

.counter {
  margin: var(--space-2) 0 0;
  color: var(--muted);
  font-size: var(--text-sm);
  font-variant-numeric: tabular-nums;
}

.counter.over {
  color: var(--error);
  font-weight: 700;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin: var(--space-5) 0 0;
}

.button {
  --button-hover: var(--subtle);
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--target-size);
  min-width: var(--target-size);
  max-width: 100%;
  padding: var(--space-3) var(--space-5);
  font: inherit;
  font-weight: 650;
  line-height: 1.4;
  color: var(--fg);
  background: var(--field);
  border: 2px solid var(--border);
  border-radius: var(--radius-control);
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

/* Only this empty background plane fades. The host palette switches atomically on
   disable AND re-enable, including while hovered: opposite text polarities cannot blend. */
.button::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: var(--button-hover);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--motion-fast) var(--ease-out);
}

.button.primary {
  --button-hover: var(--accent-hover);
  background: var(--accent);
  color: var(--accent-fg);
  border-color: var(--accent);
}

@media (hover: hover) {
  .button:hover:not(:disabled):not([aria-disabled="true"])::before {
    opacity: 1;
  }
}

.button:active:not(:disabled):not([aria-disabled="true"])::before {
  opacity: 1;
}

/* Keep labels fully legible while waiting; opacity would undermine their contrast. */
.button:disabled,
.button[aria-disabled="true"] {
  color: var(--muted);
  background: var(--subtle);
  border-color: var(--border);
  box-shadow: none;
  cursor: progress;
}

.button:disabled::before,
.button[aria-disabled="true"]::before {
  display: none;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 4px;
}

h1:focus {
  outline: none;
}

h1:focus-visible {
  outline: 3px solid var(--focus);
}

.status {
  color: var(--ok);
  min-height: 1.5em;
  margin: var(--space-2) 0 0;
}

.error {
  color: var(--error);
  font-weight: 600;
  min-height: 1.5em;
  margin: var(--space-2) 0 0;
}

/* Empty status/alert paragraphs otherwise reserve 64 px after the action. Keep the nodes
   in the accessibility tree; a populated region regains its normal space immediately. */
.status:empty,
.error:empty {
  min-height: 0;
  margin: 0;
}

.notice {
  border-left: 3px solid var(--accent);
  padding-left: var(--space-4);
}

.countdown-value {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.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;
}

/* Create-only treatments: native controls, unchanged live regions and no secret-bearing effects. */
.create-view {
  min-width: 0;
}

.create-view textarea:focus {
  outline: 3px solid var(--focus);
  outline-offset: 4px;
}

.create-view .usage {
  display: grid;
  grid-template-columns: minmax(0, max-content) 5rem;
  justify-content: start;
  align-items: center;
  gap: var(--space-3);
  margin-top: var(--space-3);
}

.create-view .usage .counter {
  margin: 0;
}

.create-view .usage-meter {
  --usage-fill: var(--accent);
  appearance: none;
  width: 100%;
  height: 0.5rem;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--subtle);
  accent-color: var(--accent);
}

.create-view .usage-meter.over {
  --usage-fill: var(--error);
  accent-color: var(--error);
}

.create-view .usage-meter::-webkit-progress-bar {
  background: var(--subtle);
  border-radius: var(--radius-pill);
}

.create-view .usage-meter::-webkit-progress-value {
  background: var(--usage-fill);
  border-radius: var(--radius-pill);
}

.create-view .usage-meter::-moz-progress-bar {
  background: var(--usage-fill);
  border-radius: var(--radius-pill);
}

.create-view .choices {
  min-width: 0;
}

.create-view .ttl-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-2);
}

.create-view .choice {
  flex-direction: column;
  justify-content: center;
  margin: 0;
  padding: var(--space-3) var(--space-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  background: var(--field);
  font-size: var(--text-sm);
  font-weight: 650;
  text-align: center;
}

.create-view .choice:has(input:checked) {
  color: var(--accent);
  background: var(--subtle);
  border-color: var(--accent);
}

/* Same radios and keyboard behavior; draw their opaque fill instead of the dark UA grey. */
.create-view .choice input {
  appearance: none;
  flex: none;
  border: 2px solid var(--border);
  border-radius: 50%;
  background: var(--field);
}

.create-view .choice input:checked {
  border: 7px solid var(--accent);
}

.create-view .button.primary:not(:disabled):not([aria-disabled="true"]) {
  background: var(--accent);
}

.create-view #create-button {
  width: 100%;
}

.create-view #create-button[aria-disabled="true"] {
  border-style: dashed;
}

.create-view .status:not(:empty) {
  padding: var(--space-3) var(--space-4);
  border-left: 3px solid var(--ok);
  border-radius: var(--radius-control);
  background: var(--subtle);
}

.create-view .error:not(:empty) {
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--error);
  border-left-width: 4px;
  border-radius: var(--radius-control);
  background: var(--subtle);
}

.create-view .result-mark,
.reveal-view .reveal-mark,
.notice-view .notice-mark {
  display: block;
  width: 3rem;
  height: 3rem;
  margin-bottom: var(--space-4);
  border-radius: var(--radius-control);
}

.create-view .result-mark {
  border: 1px solid var(--ok);
  color: var(--ok);
  background: var(--subtle);
  fill: none;
  stroke: currentColor;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Allow native horizontal scrolling inside the one input; never duplicate its value. */
.create-view .link-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-3);
  min-width: 0;
}

.create-view #link {
  min-width: 0;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
}

.create-view .link-row .actions {
  margin: 0;
}

.create-view #copy-link {
  width: 100%;
  gap: var(--space-2);
}

.copy-mark {
  width: 1.25rem;
  height: 1.25rem;
  visibility: hidden;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#copy-link.copied .copy-mark {
  visibility: visible;
}

/* The result's secondary action aligns with Copy on narrow screens. */
.create-view a.button {
  width: 100%;
}

/* BL-06: «Mostrar QR» sits before «Crear otro enlace» and takes the same width. */
.create-view #qr-toggle {
  width: 100%;
}

.create-view .qr-frame {
  margin-top: var(--space-5);
}

/* Fixed colors on purpose: a reader needs dark modules on a light square in both themes, and
   forced colors must not repaint them (S7). The light square holds the 4-module quiet zone. */
.create-view .qr-code {
  display: block;
  width: min(100%, 16rem);
  height: auto;
  shape-rendering: crispEdges;
  forced-color-adjust: none;
}

.create-view .qr-light {
  fill: #ffffff;
}

.create-view .qr-dark {
  fill: #000000;
}

.create-view .notice {
  margin-top: var(--space-5);
  padding: var(--space-4);
  border-radius: var(--radius-control);
  background: var(--subtle);
}

.create-view #expiry {
  color: var(--muted);
  font-size: var(--text-sm);
}

/* Reveal-only surfaces: the single secret field and its parent never animate. */
.reveal-view {
  min-width: 0;
  padding-block: clamp(1.25rem, 3vw, 2rem);
}

.reveal-view .reveal-mark {
  color: var(--accent);
  background: var(--subtle);
  border: 1px solid var(--stroke);
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.reveal-view .ended-mark {
  color: var(--accent);
}

.reveal-view #reveal-time {
  margin: 0;
  padding: var(--space-4);
  background: var(--subtle);
  border-left: 3px solid var(--warning);
  border-radius: var(--radius-control);
}

.reveal-view #reveal-button {
  width: 100%;
  gap: var(--space-3);
}

.reveal-view .button.primary:not(:disabled):not([aria-disabled="true"]) {
  background: var(--accent);
}

.reveal-view #reveal-button[aria-disabled="true"] {
  color: var(--muted);
  border-color: var(--border);
  border-style: dashed;
}

.reveal-view .reveal-action-mark {
  flex: none;
  width: 1.25rem;
  height: 1.25rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.reveal-view .actions:has(#reveal-button[hidden]) {
  margin-top: 0;
}

/* Keep the wider page within the scratch helper's unchanged 672 px safety limit. */
.reveal-view .secret-frame,
.reveal-view .scratch-controls {
  width: min(100%, 672px);
}

.reveal-view .secret-frame {
  min-width: 0;
  position: relative;
}

/* Fixed rows reserve the controls' footprint after removal, including preference changes. */
.scratch-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: 3.2em var(--target-size);
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

#scratch-hint {
  grid-row: 1;
  margin: 0;
  font-size: var(--text-sm);
}

#scratch-show-all {
  grid-row: 2;
  justify-self: start;
}

#scratch-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: var(--radius-control);
  background: var(--accent);
  touch-action: none;
}

#scratch-layer.scratch-ready {
  background: transparent;
}

@media (prefers-reduced-motion: reduce), (forced-colors: active) {
  #scratch-layer {
    display: none;
  }
}

.reveal-view #secret-output {
  min-width: 0;
  max-width: 100%;
  min-height: 12rem;
  max-height: 28rem;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.reveal-view .reveal-timer {
  display: grid;
  gap: var(--space-2);
  margin-top: var(--space-4);
}

.reveal-view .countdown {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3);
  margin: 0;
  color: var(--muted);
  font-size: var(--text-sm);
}

.reveal-view .countdown-value {
  color: var(--accent);
  font-size: var(--text-step);
}

.reveal-view .countdown-meter {
  appearance: none;
  width: 100%;
  height: 0.5rem;
  overflow: hidden;
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--subtle);
  accent-color: var(--accent);
}

.reveal-view .countdown-meter::-webkit-progress-bar {
  background: var(--subtle);
  border-radius: var(--radius-pill);
}

.reveal-view .countdown-meter::-webkit-progress-value {
  background: var(--accent);
  border-radius: var(--radius-pill);
  transition: width 300ms linear, background-color 300ms linear;
}

.reveal-view .countdown-meter::-moz-progress-bar {
  background: var(--accent);
  border-radius: var(--radius-pill);
  transition: width 300ms linear, background-color 300ms linear;
}

/* The existing clock chooses this state; Firefox retains native one-second width steps. */
.reveal-view .countdown-meter.ending {
  accent-color: var(--error);
}

.reveal-view .countdown-meter.ending::-webkit-progress-value {
  background: var(--error);
}

.reveal-view .countdown-meter.ending::-moz-progress-bar {
  background: var(--error);
}

.reveal-view #copy-secret,
.reveal-view #hide-secret {
  flex: 1 1 auto;
}

.reveal-view .status:not(:empty) {
  padding: var(--space-3) var(--space-4);
  border-left: 3px solid var(--ok);
  border-radius: var(--radius-control);
  background: var(--subtle);
}

.reveal-view .error:not(:empty) {
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--error);
  border-left-width: 4px;
  border-radius: var(--radius-control);
  background: var(--subtle);
}

.reveal-view .notice {
  margin-block: var(--space-5) 0;
  padding: var(--space-4);
  border-radius: var(--radius-control);
  background: var(--subtle);
  font-size: var(--text-sm);
}

/* Static notices share one treatment, including the same 404 partial inside Revelar.
   The icon adds color, not information; recovery copy and the home link remain the guide. */
.notice-view {
  min-width: 0;
  padding-block: clamp(1.25rem, 3vw, 2rem);
}

.notice-view .notice-mark {
  color: var(--accent);
  background: var(--subtle);
  border: 1px solid var(--stroke);
  fill: none;
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.notice-view .notice-mark-teal {
  stroke: var(--accent);
}

.notice-view .notice-mark-warm {
  stroke: var(--accent);
}

.notice-view .lead {
  margin: 0;
}

.notice-view .notice-guidance {
  margin: var(--space-4) 0 0;
  padding: var(--space-3) var(--space-4);
  color: var(--fg);
  background: var(--subtle);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-control);
}

.notice-view .button.primary:not(:disabled):not([aria-disabled="true"]) {
  background: var(--accent);
}

#not-found .button {
  width: 100%;
}

@media (min-width: 40rem) {
  .scratch-controls {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: var(--target-size);
  }

  #scratch-show-all {
    grid-row: 1;
    grid-column: 2;
  }

  .footer-details {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-6);
  }

  .create-view .choice {
    flex-direction: row;
    padding: var(--space-4);
    font-size: var(--text-base);
  }

  .create-view .link-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .create-view a.button {
    width: auto;
  }

  .create-view #qr-toggle {
    width: auto;
  }

  #not-found .button {
    width: auto;
  }
}

#composer .lead {
  margin-bottom: var(--space-2);
}

#composer .field-label {
  margin-top: var(--space-2);
}

#secret-text {
  height: clamp(6rem, 16svh, 10rem);
}

#composer .actions {
  margin-top: var(--space-3);
}

/* Reading and tab order stay native: message, duration, action. No clipped page or fixed shell. */
@media (min-width: 64rem) {
  #composer {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr);
    column-gap: var(--space-5);
    align-items: start;
  }

  #composer > h1,
  #composer > .lead,
  #composer > .status,
  #composer > .error,
  #composer > noscript {
    grid-column: 1 / -1;
  }

  #composer > .field-label {
    grid-column: 1;
    grid-row: 3;
  }

  #composer > textarea {
    grid-column: 1;
    grid-row: 4;
  }

  #composer > .usage {
    grid-column: 1;
    grid-row: 5;
  }

  #composer > .choices {
    grid-column: 2;
    grid-row: 3 / 5;
  }

  #composer > .actions {
    grid-column: 2;
    grid-row: 5;
  }

  .create-view .choice {
    flex-direction: column;
    padding: var(--space-3) var(--space-1);
    font-size: var(--text-sm);
  }

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

  .reveal-view h1 {
    margin-bottom: var(--space-2);
  }

  .reveal-view .scratch-controls {
    margin-bottom: var(--space-2);
  }

  .reveal-view {
    padding-block: var(--space-4);
  }

  .reveal-view .field-label,
  .reveal-view .actions,
  .reveal-view .notice,
  .reveal-view .reveal-timer {
    margin-top: var(--space-2);
  }

  .reveal-view #secret-output {
    min-height: 6rem;
    height: clamp(6rem, 12svh, 9rem);
  }

  .reveal-view .notice {
    padding: var(--space-2) var(--space-3);
  }

  .reveal-view .button {
    padding-block: var(--space-2);
  }
}

/* Short feedback only: no entrance on the page or reveal field, no repeating decoration. */
@media (prefers-reduced-motion: no-preference) {
  .create-view#result:not([hidden]) {
    animation: result-in var(--motion-standard) var(--ease-out);
  }

  .create-view #copy-link.copied .copy-mark {
    animation: copied-in var(--motion-standard) var(--ease-out);
  }

  .brand-mark path:first-child {
    animation: fold-upper 400ms var(--ease-out);
  }

  .brand-mark path:last-child {
    animation: fold-lower 400ms var(--ease-out);
  }
}

@keyframes result-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes copied-in {
  from { clip-path: inset(0 100% 0 0); }
  to { clip-path: inset(0); }
}

@keyframes fold-upper {
  from { transform: translateY(-2px); }
  to { transform: translateY(0); }
}

@keyframes fold-lower {
  from { transform: translateY(2px); }
  to { transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }

  /* Native progress pseudos are not matched by the universal pseudo-element selector. */
  progress::-webkit-progress-value {
    animation: none !important;
    transition: none !important;
  }

  progress::-moz-progress-bar {
    animation: none !important;
    transition: none !important;
  }
}

@media (forced-colors: active) {
  .button::before {
    display: none;
  }

  .panel {
    border-color: CanvasText;
  }

  .brand-mark {
    color: CanvasText;
  }

  .footer-credit a {
    color: LinkText;
  }

  :focus-visible,
  .create-view textarea:focus {
    outline-color: Highlight;
  }

  .create-view .choice input {
    appearance: auto;
  }

  .create-view .choice input,
  .create-view .choice input:checked {
    border: revert;
    background: revert;
  }

  .create-view .choice:has(input:checked) {
    outline: 2px solid Highlight;
  }

  .create-view .usage-meter,
  .reveal-view .countdown-meter {
    appearance: none;
    forced-color-adjust: none;
    border: 1px solid CanvasText;
    background: Canvas;
  }

  .create-view .usage-meter::-webkit-progress-bar,
  .reveal-view .countdown-meter::-webkit-progress-bar {
    background: Canvas;
  }

  .create-view .usage-meter::-webkit-progress-value,
  .reveal-view .countdown-meter::-webkit-progress-value,
  .reveal-view .countdown-meter.ending::-webkit-progress-value {
    background: Highlight;
  }

  .create-view .usage-meter::-moz-progress-bar,
  .reveal-view .countdown-meter::-moz-progress-bar,
  .reveal-view .countdown-meter.ending::-moz-progress-bar {
    background: Highlight;
  }

  .reveal-view .reveal-mark {
    border-color: CanvasText;
  }

  .notice-view .notice-mark,
  .notice-view .notice-guidance {
    color: CanvasText;
    background: Canvas;
    border-color: CanvasText;
  }

  .notice-view .notice-mark-teal,
  .notice-view .notice-mark-warm {
    stroke: currentColor;
  }

  .notice-view .button.primary,
  .notice-view .button.primary:hover:not(:disabled):not([aria-disabled="true"]),
  .notice-view .button.primary:active {
    color: LinkText;
    background: Canvas;
    border-color: LinkText;
    box-shadow: none;
  }
}
