.key-sender { --bg: var(--cf-canvas); --surface: var(--cf-surface); --surface-muted: var(--cf-surface-muted); --ink: var(--cf-ink); --muted: var(--cf-ink-soft); --line: var(--cf-line); --green: var(--cf-accent); --green-dark: var(--cf-accent-hover); --error: var(--cf-terra); --amber: var(--cf-amber); --on-amber: var(--cf-on-amber); --focus: var(--cf-focus); --on-accent: var(--cf-on-accent); --display: var(--cf-font-display); width: 100%; max-width: 560px; margin: 0 auto; padding: 48px 0 64px; }
.key-sender-beta { margin: 24px 16px 0; color: var(--cf-ink-soft); font-size: 15px; line-height: 1.55; text-align: center; }
.key-sender-beta .text-link { min-height: 0; display: inline; font-weight: 600; color: var(--cf-accent); }
@media (min-width: 461px) and (max-height: 820px) { .key-sender { padding: 16px 0 40px; } }
@media (max-width: 460px) { .key-sender { padding: 20px 0 40px; } }
/* The transfer window itself. The standalone page (styles.css) and the site build at customsflow.app/key
   both load this file; it reads its colours from --bg/--ink/… so each host maps them to its own palette.
   Every rule stays under .window or a class of its own, so the site's styles and these never collide. */
/* :where() keeps these at element weight, so .primary, .window-status and the rest still win over them. */
:where(.window, .window *, .window *::before, .window *::after) { box-sizing: border-box; }
.window [hidden] { display: none !important; }
:where(.window) :where(button, input) { font: inherit; }
:where(.window) button { cursor: pointer; }
:where(.window) button:disabled { cursor: not-allowed; opacity: .48; }
:where(.window) :focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
:where(.window) :where(h1, h2, p) { margin-top: 0; }

.window { min-height: 716px; display: flex; flex-direction: column; padding: 26px 24px 22px; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: 0 28px 45px -20px #17372d40; text-align: center; }
.window h1 { margin-bottom: 8px; font: 400 32px/1.12 var(--display); letter-spacing: -.025em; text-wrap: balance; }
.sub { margin-bottom: 18px; color: var(--muted); font-size: 14px; line-height: 1.45; }

/* 324px is the tallest state, the QR display, measured on the rendered page at
   1280px: empty 126, file chosen 68, error 100, showing 324. Holding the stage
   there stops the window resizing as it moves between states. */
.stage { flex: 1; display: flex; flex-direction: column; justify-content: center; min-height: 324px; }

.drop { position: relative; display: grid; place-items: center; align-content: center; gap: 10px; min-height: 200px; padding: 18px; border: 1.5px dashed var(--line); border-radius: 14px; color: var(--muted); font-size: 14px; line-height: 1.45; cursor: pointer; }
.drop small { display: block; font-size: 12px; }
/* Hidden from the eye, not from the keyboard or a screen reader: the browser's
   own file button is labelled in the browser's locale, ours is always Ukrainian. */
.drop-input { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.drop-button { padding: 9px 14px; color: var(--ink); background: var(--surface-muted); border: 1px solid var(--line); border-radius: 10px; font-size: 13px; font-weight: 700; }
.drop:focus-within .drop-button { outline: 2px solid var(--focus); outline-offset: 2px; }

.file-row { display: flex; align-items: center; gap: 9px; padding: 11px 13px; background: var(--surface-muted); border: 1px solid var(--line); border-radius: 12px; text-align: left; font-size: 14px; }
.file-row.failed { border-color: var(--error); }
.file-mark { color: var(--green); font-weight: 750; }
.file-row.failed .file-mark { color: var(--error); }
.file-name { flex: 1; color: var(--ink); overflow-wrap: anywhere; }
.link { padding: 0; color: var(--green); background: none; border: 0; font-size: 13px; font-weight: 700; }

.quiet { margin-top: 12px; text-align: left; }
.quiet summary { color: var(--green); cursor: pointer; font-size: 13px; font-weight: 700; }
.quiet p, .quiet code { display: block; margin: 8px 0 0; color: var(--muted); font-size: 12.5px; line-height: 1.45; overflow-wrap: anywhere; }
.cert-label { display: block; margin: 10px 0 8px; font-size: 13px; font-weight: 700; }
.cert-label small { color: var(--muted); font-weight: 500; }
.file-field input { display: block; width: 100%; margin-bottom: 8px; color: var(--muted); }

.display { display: grid; justify-items: center; }
.qr { width: min(100%, 300px); background: #fff; border-radius: 10px; padding: 10px; }
.qr svg { display: block; width: 100%; height: auto; }
.frame-status { margin: 10px 0 0; color: var(--muted); font-size: 12px; }

.actions { margin-top: 18px; }
.primary, .secondary { width: 100%; min-height: 46px; padding: 0 17px; border-radius: 12px; font-weight: 720; }
.primary { color: var(--on-accent); background: var(--green); border: 1px solid var(--green); }
/* As the app's PrimaryButton: a muted fill, not a faded green. */
.primary:disabled { opacity: 1; color: var(--muted); background: var(--surface-muted); border-color: var(--surface-muted); }
.primary:hover:not(:disabled) { background: var(--green-dark); border-color: var(--green-dark); }
.secondary { color: var(--ink); background: transparent; border: 1px solid var(--line); }

.nudge { justify-self: stretch; margin-top: 14px; padding: 12px; background: color-mix(in srgb, var(--amber) 22%, transparent); border: 1px solid color-mix(in srgb, var(--amber) 55%, transparent); border-radius: 12px; }
.nudge p { margin: 0; color: var(--on-amber); font-size: 13px; line-height: 1.45; }
.speed-options { display: flex; justify-content: center; gap: 8px; margin-top: 10px; }
.speed-options label { display: inline-flex; align-items: center; gap: 5px; padding: 7px 11px; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 99px; font-size: 13px; cursor: pointer; }
.speed-options input { margin: 0; accent-color: var(--green); }

.window-status { margin: 16px 0 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.error { margin: 12px 0 0; color: var(--error); font-size: 13.5px; line-height: 1.45; text-align: left; }
.assurance { margin: 14px 0 0; padding-top: 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12.5px; line-height: 1.45; }

@media (max-width: 460px) {
  .window h1 { font-size: 27px; }
  .window { min-height: 0; padding: 20px 17px 18px; border-radius: 16px; }
  .stage { min-height: 0; }
  .qr { width: min(74vw, 300px); }
}

/* Reserve the measured QR + delayed rescue height; avoid moving the window
   between states. Compact spacing preserves the full 300px QR on short screens. */
@media (min-width: 461px) and (max-height: 820px) {
  .window h1 { font-size: 27px; }
  .window { min-height: 678px; padding: 18px; }
  .sub { margin-bottom: 12px; }
  .actions { margin-top: 12px; }
  .window-status { margin-top: 10px; }
  .assurance { margin-top: 10px; padding-top: 10px; }
}
