/* Download page. Phone layout first; the two-panel desktop card from 760px. Colors from the design tokens. */
:root {
  color-scheme: light;
  --bg: #F5F4ED; --fg: #1F1E1D; --mu: #5F5E5A; --bd: #D3D1C7; --ln: #8A887F; --ac: #185FA5; --ac-h: #0C447C;
  --on: #FFFFFF; --cd: #FBFAF7; --pn: #EEECE3;
  --ok: #3B6D11; --okf: #27500A; --erf: #791F1F; --wnf: #633806; --inf: #0C447C;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #000000; --fg: #EDEDED; --mu: #9E9E9E; --bd: #262626; --ln: #6B6B6B; --ac: #85B7EB; --ac-h: #B5D4F4;
    --on: #000000; --cd: #0A0A0A; --pn: #141414;
    --ok: #97C459; --okf: #C0DD97; --erf: #F7C1C1; --wnf: #FAC775; --inf: #B5D4F4;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #000000; --fg: #EDEDED; --mu: #9E9E9E; --bd: #262626; --ln: #6B6B6B; --ac: #85B7EB; --ac-h: #B5D4F4;
  --on: #000000; --cd: #0A0A0A; --pn: #141414;
  --ok: #97C459; --okf: #C0DD97; --erf: #F7C1C1; --wnf: #FAC775; --inf: #B5D4F4;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
/* Hidden until the page's translations are applied (web/i18n-dom.ts), so it doesn't flash in English; shown after
   1.5 s whatever happens. */
html:not([data-i18n-ready]) body { visibility: hidden; animation: i18n-reveal 0s 1.5s forwards; }
@keyframes i18n-reveal { to { visibility: visible; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.5;
}
a { color: var(--ac); }
a:hover { color: var(--ac-h); }
h1, h2, p { margin: 0; }
code { font-family: var(--mono); font-size: 0.93em; direction: ltr; unicode-bidi: isolate; }
:focus-visible { outline: 2px solid var(--ac); outline-offset: 2px; }

/* Icons: tabler-style outline SVGs. */
.i { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.i16 { width: 16px; height: 16px; }
.i24 { width: 24px; height: 24px; }

/* Theme toggle icon: the sun shows in dark mode, the moon in light mode. */
.only-dark { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .only-dark { display: block; }
  :root:not([data-theme="light"]) .only-light { display: none; }
}
:root[data-theme="dark"] .only-dark { display: block; }
:root[data-theme="dark"] .only-light { display: none; }

.desk-only { display: none; }

/* ---------- Page frame (phone) ---------- */
.page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 8px 24px 40px;
  padding-bottom: max(40px, env(safe-area-inset-bottom));
}
.top { display: flex; align-items: center; justify-content: space-between; height: 56px; flex: none; }
.brand { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; }
.icon-btn {
  width: 44px; height: 44px; padding: 0; flex: none;
  display: flex; align-items: center; justify-content: center;
  color: var(--mu); background: transparent; border: 0; border-radius: 12px; cursor: pointer;
}
.icon-btn:hover { color: var(--fg); }
.theme-btn { margin-inline-end: -12px; }

.main { flex: 1; min-height: 0; display: flex; flex-direction: column; justify-content: flex-end; }
.card { display: flex; flex-direction: column; gap: 32px; width: 100%; max-width: 480px; margin: 0 auto; }

/* ---------- File panel ---------- */
.fh, .icon-box, .features { display: none; }
.page[data-file="locked"] .fh-locked,
.page[data-file="known"] .fh-known { display: block; }

.title { display: flex; align-items: center; gap: 8px; font-size: 17px; font-weight: 600; line-height: 1.5; }
.title.name { display: block; overflow-wrap: anywhere; }
.sub { margin-top: 2px; font-size: 13px; color: var(--mu); }
.sub-dl { display: none; }

.note {
  display: flex; gap: 10px; align-items: flex-start;
  margin-top: 14px; padding: 12px 14px; font-size: 14px;
  border: 1px solid var(--bd); border-radius: 12px;
}
.note .i { margin-top: 3px; color: var(--mu); }
.note-label { display: block; font-size: 12px; color: var(--mu); }
.note-text { white-space: pre-line; overflow-wrap: anywhere; }

/* ---------- Action panel ---------- */
.screen { display: flex; flex-direction: column; }
.muted { color: var(--mu); }
.small { font-size: 13px; }
.tabular { font-variant-numeric: tabular-nums; }
.lead { margin-top: 4px; font-size: 14px; }
.more { margin-top: 8px; }
.loading-text { font-size: 14px; }

.h2-lead { margin-bottom: 16px; }
h2 { font-size: 20px; font-weight: 600; line-height: 1.3; }
.label { font-size: 13px; color: var(--mu); }
.pw-wrap { position: relative; margin-top: 6px; }
.input {
  width: 100%; height: 48px; padding-block: 0; padding-inline: 14px 48px;
  font: inherit; font-size: 16px; color: var(--fg);
  background: transparent; border: 1px solid var(--ln); border-radius: 12px;
}
.input:disabled { opacity: 0.6; }
.eye-btn { position: absolute; top: 2px; inset-inline-end: 2px; border-radius: 10px; }
.eye-hide { display: none; }
.eye-btn[aria-pressed="true"] .eye-show { display: none; }
.eye-btn[aria-pressed="true"] .eye-hide { display: block; }
.err { min-height: 20px; margin: 6px 0 10px; font-size: 13px; color: var(--erf); }
.ready-note { margin: -6px 0 10px; }
#ready-err { margin: 6px 0 0; }
#ready-err:empty { display: none; }
.persist-note { margin: 2px 0 8px; text-align: center; }

.btn {
  width: 100%; height: 48px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-size: 15px; border-radius: 12px; cursor: pointer;
}
.btn.primary { font-weight: 600; color: var(--on); background: var(--ac); border: 0; }
.btn.primary:hover { background: var(--ac-h); }
.btn.primary:disabled { cursor: progress; opacity: 0.85; }
.btn.secondary { margin-top: 20px; color: var(--fg); background: transparent; border: 1px solid var(--bd); }
.btn.secondary:hover { border-color: var(--ln); }

.link-btn { align-self: center; margin-top: 8px; padding: 6px 10px; font: inherit; font-size: 13px; color: var(--ac); background: none; border: 0; cursor: pointer; text-decoration: underline; }
.checking { display: flex; flex-direction: column; margin-top: 12px; }

.foot { margin-top: 12px; font-size: 13px; color: var(--mu); text-align: center; }
.cli { margin-top: 4px; font-size: 13px; text-align: center; }
.cli summary { display: inline; list-style: none; color: var(--ac); text-decoration: underline; cursor: pointer; }
.cli summary::-webkit-details-marker { display: none; }
.cli summary:hover { color: var(--ac-h); }
.cli p { margin-top: 8px; padding: 12px 14px; text-align: start; color: var(--mu); border: 1px solid var(--bd); border-radius: 12px; }
.cli code { color: var(--fg); }

/* Progress */
.pct-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.pct { font-size: 44px; font-weight: 600; line-height: 1.1; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.bar { margin-top: 12px; height: 4px; border-radius: 2px; background: var(--bd); overflow: hidden; }
.bar > div { height: 100%; width: 0; background: var(--ac); transition: width .1s linear; }
.bar.indeterminate { margin-top: 0; }
.bar.indeterminate > div { width: 30%; animation: slide 1.2s ease-in-out infinite; }
@keyframes slide { from { transform: translateX(-100%); } to { transform: translateX(340%); } }
@keyframes slide-rtl { from { transform: translateX(100%); } to { transform: translateX(-340%); } }
[dir="rtl"] .bar.indeterminate > div { animation-name: slide-rtl; }
@media (prefers-reduced-motion: reduce) {
  .bar > div { transition: none; }
  .bar.indeterminate > div { animation: none; width: 100%; opacity: 0.5; }
}
.stats { display: flex; justify-content: space-between; gap: 12px; margin-top: 10px; font-size: 13px; color: var(--mu); font-variant-numeric: tabular-nums; }
#dl-chunks { margin-top: 2px; }
.notice { display: flex; gap: 8px; align-items: flex-start; margin-top: 20px; font-size: 13px; }
.notice .i { margin-top: 2px; }
.notice.warn { color: var(--wnf); }
.notice.info { color: var(--inf); }
.notice.muted { color: var(--mu); }

/* Staged mode (phase 4): Resume? and Saving to Downloads. */
.sub-save { display: none; }
.state-title.info-c { color: var(--inf); }
.state-title.info-c h2 { color: var(--fg); }
#rs-bar { margin-top: 14px; }
#rs-bar > div { transition: none; }
.rs-sweep { margin-top: 8px; }
.btn-row { display: flex; flex-direction: column; gap: 10px; margin-top: 20px; }
.btn-row .btn.secondary { margin-top: 0; }
.ok-bar > div { background: var(--ok); }
#s-saving .stats + p { margin-top: 2px; }

/* Result screens */
.state-title { display: flex; align-items: center; gap: 10px; }
.state-title.ok { color: var(--okf); }
.state-title.err-c { color: var(--erf); }
.state-title .warn-c { color: var(--wnf); }
.state-title h2 { color: inherit; }
.checks { list-style: none; padding: 0; margin: 16px 0 0; font-size: 13px; color: var(--mu); }
.checks li { display: flex; gap: 8px; align-items: center; padding: 4px 0; }
.checks .i { color: var(--okf); }
.checks .resumed .i { color: var(--inf); }
.sha { display: flex; align-items: center; gap: 4px; margin-top: 12px; padding-inline-start: 12px; border: 1px solid var(--bd); border-radius: 12px; }
.sha-label { font-size: 12px; color: var(--mu); flex: none; }
.sha code { flex: 1; min-width: 0; margin-inline-start: 6px; font-size: 13px; color: var(--fg); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.copied-icon { display: none; color: var(--okf); }
#copy-sha[data-copied] .copy-icon { display: none; }
#copy-sha[data-copied] .copied-icon { display: block; }

/* Home (the site's own address, no link): the product name, the brand greeting, and a field for a link. */
.home-title { font-size: 22px; line-height: 1.25; overflow-wrap: anywhere; }
.home-tagline { margin-top: 4px; font-size: 14px; }
.home-greeting { margin-top: 12px; font-size: 13px; color: var(--mu); overflow-wrap: anywhere; }
.home-label { margin-top: 24px; }
.link-input { margin-top: 6px; padding-inline-end: 14px; }
.home-elsewhere { margin: 12px 0 16px; }
/* The note replaces the (then empty) error line. */
#link-err:has(+ .home-elsewhere:not([hidden])) { display: none; }
.home-private + .cli { margin-top: 8px; }

/* Home, below the card: how it works, why it's safe, and under the hood (for the curious). */
.home-more { display: none; }
.page[data-screen="home"] .main { justify-content: flex-start; padding-top: 16px; }
.page[data-screen="home"] .home-more {
  display: flex; flex-direction: column; gap: 40px; width: 100%; max-width: 480px; margin: 48px auto 0;
}
.home-sec h2 { margin-bottom: 14px; }
.home-sec strong { display: block; font-size: 15px; font-weight: 600; color: var(--fg); }
.steps, .safe, .xp-legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.steps { counter-reset: step; }
.steps li {
  counter-increment: step; display: flex; gap: 14px; align-items: flex-start; padding: 16px;
  background: var(--cd); border: 1px solid var(--bd); border-radius: 16px;
}
.step-text, .safe-text { flex: 1; min-width: 0; font-size: 14px; color: var(--mu); }
.step-art {
  position: relative; flex: none; width: 48px; height: 48px; display: flex; align-items: center; justify-content: center;
  color: var(--fg); background: var(--pn); border: 1px solid var(--bd); border-radius: 14px;
}
/* The step's number, in the page's digits. */
.step-art::after {
  content: counter(step); position: absolute; top: -7px; inset-inline-end: -7px;
  min-width: 22px; height: 22px; padding: 0 6px; display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600; color: var(--on); background: var(--ac); border-radius: 11px;
}
:lang(ar) .step-art::after { content: counter(step, arabic-indic); }
:lang(bn) .step-art::after { content: counter(step, bengali); }
.safe { gap: 16px; }
.safe li { display: flex; gap: 12px; align-items: flex-start; }
.safe li > .i { margin-top: 2px; color: var(--okf); }

/* Under the hood: the link, the keys, the blocks. Colours from the file-type tints. */
.why {
  display: flex; gap: 10px; align-items: flex-start; margin-top: 18px; padding: 12px 14px; font-size: 13px; color: var(--mu);
  background: var(--pn); border-radius: 12px;
}
.why .i { margin-top: 2px; color: var(--ac); }
.why strong { display: inline; font-size: inherit; color: var(--fg); font-weight: 600; }
.xp { padding: 20px; background: var(--cd); border: 1px solid var(--bd); border-radius: 16px; }
.xp + .xp { margin-top: 12px; }
.xp h3 { margin: 0 0 14px; font-size: 15px; font-weight: 600; }
.lk {
  display: flex; flex-wrap: wrap; width: fit-content; max-width: 100%; margin: 0 0 16px; font-family: var(--mono); font-size: 13px;
  line-height: 1.3; border: 1px solid var(--bd); border-radius: 12px; overflow: hidden;
}
.lk > span { padding: 10px 12px; overflow-wrap: anywhere; }
.lk-host { color: var(--mu); background: var(--t-gray); }
.lk-id { color: var(--t-blue-f); background: var(--t-blue); }
.lk > .lk-dot { padding-inline: 2px; color: var(--mu); }
.lk-key { font-weight: 600; color: var(--t-green-f); background: var(--t-green); }
.xp-legend li { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--mu); }
.sw { flex: none; width: 14px; height: 14px; margin-top: 4px; border-radius: 4px; }
.sw-host { background: var(--t-gray); box-shadow: inset 0 0 0 2px var(--ln); }
.sw-id { background: var(--t-blue); box-shadow: inset 0 0 0 2px var(--t-blue-f); }
.sw-key { background: var(--t-green); box-shadow: inset 0 0 0 2px var(--t-green-f); }
.sw-pw { background: var(--t-amber); box-shadow: inset 0 0 0 2px var(--t-amber-f); }
.sw-meta { background: var(--t-purple); box-shadow: inset 0 0 0 2px var(--t-purple-f); }
.sw-nonce { background: transparent; box-shadow: inset 0 0 0 2px var(--ln); }
.sw-you { background: var(--cd); box-shadow: inset 0 0 0 2px var(--bd); }
.sw-ok { background: var(--ok); border-radius: 50%; }
/* The keys and blocks legends: below their figure, two columns on desktop. */
.xp-legend-pairs { margin-top: 18px; }
/* Cloud storage card: a sequence diagram. Lanes (browser, website, cloud storage) with dashed lifelines; numbered
   messages in time order, the number on the sender's lifeline, the head at the receiver. Logical properties, so the
   lanes mirror in right-to-left languages. Phones get the same steps as a list. */
.seq { display: none; }
.lane {
  justify-self: center; align-self: end; display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px;
  font-size: 13px; font-weight: 600; background: var(--pn); border: 1px solid var(--bd); border-radius: 12px;
}
.lane .i { color: var(--mu); }
.lane-you { border-color: var(--t-green-f); }
.fn-badge { padding: 1px 6px; font-size: 10px; font-weight: 600; color: var(--t-green-f); background: var(--t-green); border-radius: 6px; }
.life { grid-row: 2 / 6; justify-self: center; width: 0; border-inline-start: 1.5px dashed var(--bd); }
.life-you { grid-column: 1; }
.life-site { grid-column: 2; }
.life-cloud { grid-column: 3; }
.msg { position: relative; display: flex; flex-direction: column; align-items: center; align-self: center; color: var(--ln); }
.m1 { grid-row: 2; grid-column: 1 / 3; margin-inline: 25%; }
.m2 { grid-row: 3; grid-column: 1 / 3; margin-inline: 25%; }
.m3 { grid-row: 4; grid-column: 1 / 4; margin-inline: calc(100% / 6); }
.m4 { grid-row: 5; grid-column: 1 / 4; margin-inline: calc(100% / 6); color: var(--t-blue-f); }
.msg-l { margin-bottom: 6px; padding: 0 6px; font-size: 12px; color: var(--fg); background: var(--cd); }
.msg-line { position: relative; align-self: stretch; height: 2px; background: currentColor; }
.m4 .msg-line { height: 3px; }
/* Arrowheads: a triangle pointing to the receiver (inline end or start). */
.msg-line::after { content: ""; position: absolute; top: 50%; width: 0; height: 0; margin-top: -6px; border-block: 6px solid transparent; }
.to-end .msg-line::after { inset-inline-end: -2px; border-inline-start: 10px solid currentColor; }
.to-start .msg-line::after { inset-inline-start: -2px; border-inline-end: 10px solid currentColor; }
.msg-n {
  flex: none; width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600; color: var(--on); background: var(--ac); border-radius: 50%;
}
.msg-line .msg-n { position: absolute; top: -10px; }
.to-end .msg-line .msg-n { inset-inline-start: -11px; }
.to-start .msg-line .msg-n { inset-inline-end: -11px; }
.msg-tag {
  margin-top: 8px; padding: 1px 8px; font-size: 11px; font-weight: 600; color: var(--t-green-f); background: var(--t-green);
  border-radius: 6px;
}
.seq-list { list-style: none; display: grid; gap: 12px; margin: 0; padding: 0; }
.seq-list li { display: flex; gap: 10px; align-items: flex-start; }
.sl { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 0; }
.sl-way { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; font-size: 13px; font-weight: 600; }
.sl-way .i { color: var(--mu); }
.sl-arrow { color: var(--ln) !important; }
[dir="rtl"] .sl-arrow { transform: scaleX(-1); }
.sl-what { font-size: 12px; color: var(--mu); }
.sl .msg-tag { margin-top: 4px; }
.sl-text { margin-top: 4px; font-size: 14px; color: var(--mu); }
.seq-legend { list-style: none; display: none; gap: 10px; margin: 18px 0 0; padding: 0; font-size: 14px; color: var(--mu); }
.seq-legend li { display: flex; gap: 10px; align-items: flex-start; }
.seq-legend .msg-n { margin-top: 1px; }
@media (min-width: 760px) {
  .seq { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: auto repeat(4, 64px); }
  .seq-list { display: none; }
  .seq-legend { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 32px; }
}
/* The key diagram: secret key + password → file keys → name and note / contents (vertical on phones). */
.kd { display: flex; flex-direction: column; align-items: center; gap: 6px; margin: 0; }
.kd-col { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.kc {
  display: inline-flex; flex-direction: column; align-items: center; padding: 6px 14px; font-size: 13px; font-weight: 600;
  line-height: 1.3; border-radius: 12px; color: var(--fg); background: var(--pn); border: 1px solid var(--bd);
}
.kc small { font-size: 11px; font-weight: 400; opacity: 0.85; }
.kc-key { color: var(--t-green-f); background: var(--t-green); border-color: transparent; }
.kc-pw { color: var(--t-amber-f); background: var(--t-amber); border-color: transparent; }
.kc-file { color: var(--t-blue-f); background: var(--t-blue); border-color: transparent; }
.kd-plus { font-weight: 600; color: var(--mu); line-height: 1; }
.kd-arrow { flex: none; width: 20px; height: 20px; color: var(--ln); transform: rotate(90deg); }
.kd-fork { width: 26px; height: 26px; }
@media (min-width: 760px) {
  .kd { flex-direction: row; justify-content: flex-start; flex-wrap: wrap; gap: 12px; }
  .kd-arrow { transform: none; }
  [dir="rtl"] .kd-arrow { transform: scaleX(-1); }
}
/* The blocks: byte layout. Header, name section, numbered data blocks (sealed = tick), each with its nonce. */
.bt { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 6px; margin: 0; counter-reset: tile -1; }
.bt-run { display: grid; grid-template-columns: min-content; }
.bt-row { display: flex; align-items: flex-start; gap: 6px; }
.cell { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.cap { font-family: var(--mono); font-size: 10px; color: var(--mu); white-space: pre; }
.tile {
  position: relative; min-width: 40px; height: 40px; padding: 0 8px; display: flex; align-items: center; justify-content: center;
  font-size: 12px; color: var(--t-blue-f); background: var(--t-blue); border-radius: 8px;
}
.tile-head { color: var(--mu); background: var(--t-gray); }
.tile-meta { color: var(--t-purple-f); background: var(--t-purple); }
.tile-n { counter-increment: tile; font-weight: 600; }
.tile-n::before { content: counter(tile); }
.tile-gap { height: 40px; display: flex; align-items: center; padding: 0 2px; color: var(--mu); }
.seal {
  position: absolute; top: -5px; inset-inline-end: -5px; width: 15px; height: 15px; padding: 2px; stroke-width: 3;
  color: var(--on); background: var(--ok); border-radius: 50%;
}
.brace { height: 8px; margin: 8px 6px 0; border: 1.5px solid var(--ln); border-top: 0; border-radius: 0 0 6px 6px; }
.brace-label { margin-top: 4px; font-size: 12px; text-align: center; color: var(--mu); }
@media (max-width: 759.98px) {
  .bt-row .cell:nth-child(3) { display: none; }
}
@media (min-width: 760px) {
  .tile { min-width: 52px; height: 52px; font-size: 13px; }
  .tile-gap { height: 52px; }
  .bt, .bt-row { gap: 8px; }
  .cap { font-size: 11px; }
}
@media (min-width: 760px) {
  .xp { padding: 32px; border-radius: 20px; }
  .xp-legend { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
  .xp-legend-pairs { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 32px; }
  .lk { font-size: 17px; }
}
.home-elsewhere a { overflow-wrap: anywhere; }
.home-private { margin-top: 12px; text-align: center; }

/* Language picker (footer). Out of the way while a download runs: switching reloads the page. */
.lang-bar { display: flex; align-items: center; justify-content: center; gap: 4px; padding-top: 24px; color: var(--mu); flex: none; }
.lang-select {
  height: 36px; padding: 0 4px; font: inherit; font-size: 13px; color: var(--mu);
  background: transparent; border: 0; border-radius: 8px; cursor: pointer;
}
.lang-select:hover { color: var(--fg); }
/* Switching language reloads the page: not while a download runs, waits to resume, or is being saved. */
.page[data-screen="downloading"] .lang-bar,
.page[data-screen="resume"] .lang-bar,
.page[data-screen="saving"] .lang-bar { visibility: hidden; }

/* White label (src/server/brand.ts): the brand's logo, greeting (Locked and Ready only) and footer; its colours come
   from /brand.css. The server removes what a brand doesn't set, and the slots stay hidden without a brand. */
.brand-logo { height: 24px; width: auto; max-width: 160px; object-fit: contain; }
.brand-greeting { margin: 0 0 16px; font-size: 13px; color: var(--mu); overflow-wrap: anywhere; }
.page:not([data-screen="locked"]):not([data-screen="ready"]) .brand-greeting { display: none; }
.brand-foot { display: flex; flex-direction: column; align-items: center; gap: 2px; margin-top: 28px; font-size: 12px; color: var(--mu); text-align: center; overflow-wrap: anywhere; }
.brand-legal { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.brand-legal a { display: inline-flex; align-items: center; min-height: 24px; }
html[data-brand-cli="off"] .cli { display: none; }

/* Phone only: the file header shows only above the unlock, ready and download screens. */
@media (max-width: 759.98px) {
  .page[data-file="none"] .file,
  .page[data-file="generic"] .file,
  .page:not([data-screen="locked"]):not([data-screen="ready"]):not([data-screen="downloading"]):not([data-screen="resume"]):not([data-screen="saving"]) .file { display: none; }
  .page[data-screen="downloading"] .sub-ready,
  .page[data-screen="downloading"] .note,
  .page[data-screen="resume"] .sub-ready,
  .page[data-screen="resume"] .note,
  .page[data-screen="saving"] .sub-ready,
  .page[data-screen="saving"] .note { display: none; }
  .page[data-screen="downloading"] .sub-dl,
  .page[data-screen="resume"] .sub-dl,
  .page[data-screen="saving"] .sub-save { display: block; }
}

/* ---------- Desktop ---------- */
@media (min-width: 760px) {
  .desk-only { display: revert; }
  span.desk-only { display: inline; }
  .phone-only { display: none !important; }

  .page { padding: 0; }
  .top { width: 100%; max-width: 1040px; margin: 0 auto; padding: 0 24px; height: 64px; }
  .brand { font-size: 15px; }
  .brand .i { width: 20px; height: 20px; }
  .main { flex: 1; justify-content: center; align-items: center; padding: 32px 24px 64px; }
  .card {
    max-width: 960px; flex-direction: row; flex-wrap: wrap; gap: 0;
    background: var(--cd); border: 1px solid var(--bd); border-radius: 20px; overflow: hidden;
  }
  .file {
    flex: 1 1 340px; min-width: 0; padding: 40px;
    display: flex; flex-direction: column; justify-content: space-between; gap: 40px;
    background: var(--pn);
  }
  .action { flex: 1 1 420px; min-width: 0; padding: 40px; display: flex; flex-direction: column; justify-content: center; }
  .page[data-file="generic"] .fh-generic, .page[data-file="none"] .fh-generic { display: block; }

  .icon-box {
    width: 48px; height: 48px; display: flex; align-items: center; justify-content: center;
    border: 1px solid var(--bd); border-radius: 14px; color: var(--fg);
  }
  .title { margin-top: 20px; font-size: 24px; line-height: 1.25; }
  .sub { margin-top: 6px; font-size: 14px; }
  .sub-hint { margin-top: 16px; }
  .note { margin-top: 20px; padding: 14px 16px; background: var(--cd); }
  .features { display: flex; flex-direction: column; gap: 10px; list-style: none; margin: 0; padding: 0; font-size: 13px; color: var(--mu); }
  .features li { display: flex; gap: 10px; align-items: flex-start; }
  .features .i { margin-top: 2px; }

  .lead { margin-top: 6px; }
  #s-ready .lead { margin: 4px 0 20px; color: var(--mu); }
  .cli { margin-top: 16px; }
  .pct { font-size: 52px; }
  .bar { margin-top: 14px; height: 6px; border-radius: 3px; }
  .bar.indeterminate { margin-top: 0; height: 4px; }
  .btn.secondary { align-self: flex-start; width: auto; height: 44px; padding: 0 20px; }
  .btn-row { flex-direction: row; flex-wrap: wrap; }
  .btn-row .btn, .btn-row .btn.secondary { flex: 1 1 160px; width: auto; height: 48px; }
  .checks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 16px; }
  .lang-bar { padding: 0 24px 24px; }
  .brand-greeting { margin-bottom: 20px; font-size: 14px; }
  .home-title { font-size: 28px; }
  .home-tagline { margin-top: 6px; font-size: 15px; }
  .home-greeting { margin-top: 14px; font-size: 14px; }
  .home-label { margin-top: 32px; }
  .page[data-screen="home"] .main { justify-content: flex-start; padding-top: 48px; }
  .page[data-screen="home"] .home-more { max-width: 960px; gap: 56px; margin-top: 64px; }
  .home-sec h2 { margin-bottom: 18px; font-size: 22px; }
  .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
  .steps li { flex-direction: column; gap: 16px; padding: 24px; border-radius: 20px; }
  .safe { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
  .brand-foot { width: 100%; max-width: 960px; flex-direction: row; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px 24px; margin-top: 20px; font-size: 13px; text-align: center; }
  .brand-legal { gap: 16px; }
}

/* ---------- File type: icon, name, details line, preview (after unlocking; Locked keeps the plain lock) ---------- */
/* Tints per family (design: TypeIcons): light = ramp 50 on 600, dark = 900 on 200. */
:root {
  --t-amber: #FAEEDA; --t-amber-f: #854F0B; --t-purple: #EEEDFE; --t-purple-f: #534AB7; --t-pink: #FBEAF0; --t-pink-f: #993556;
  --t-teal: #E1F5EE; --t-teal-f: #0F6E56; --t-blue: #E6F1FB; --t-blue-f: #185FA5; --t-green: #EAF3DE; --t-green-f: #3B6D11;
  --t-coral: #FAECE7; --t-coral-f: #993C1D; --t-gray: #F1EFE8; --t-gray-f: #444441; --t-red: #FCEBEB; --t-red-f: #A32D2D;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --t-amber: #412402; --t-amber-f: #EF9F27; --t-purple: #26215C; --t-purple-f: #AFA9EC; --t-pink: #4B1528; --t-pink-f: #ED93B1;
    --t-teal: #04342C; --t-teal-f: #5DCAA5; --t-blue: #042C53; --t-blue-f: #85B7EB; --t-green: #173404; --t-green-f: #97C459;
    --t-coral: #4A1B0C; --t-coral-f: #F0997B; --t-gray: #2C2C2A; --t-gray-f: #B4B2A9; --t-red: #501313; --t-red-f: #F09595;
  }
}
:root[data-theme="dark"] {
  --t-amber: #412402; --t-amber-f: #EF9F27; --t-purple: #26215C; --t-purple-f: #AFA9EC; --t-pink: #4B1528; --t-pink-f: #ED93B1;
  --t-teal: #04342C; --t-teal-f: #5DCAA5; --t-blue: #042C53; --t-blue-f: #85B7EB; --t-green: #173404; --t-green-f: #97C459;
  --t-coral: #4A1B0C; --t-coral-f: #F0997B; --t-gray: #2C2C2A; --t-gray-f: #B4B2A9; --t-red: #501313; --t-red-f: #F09595;
}
[data-cat] { --tbg: var(--t-gray); --tfg: var(--t-gray-f); }
[data-cat="archive"], [data-cat="certificate"] { --tbg: var(--t-amber); --tfg: var(--t-amber-f); }
[data-cat="video"], [data-cat="subtitle"] { --tbg: var(--t-purple); --tfg: var(--t-purple-f); }
[data-cat="audio"] { --tbg: var(--t-pink); --tfg: var(--t-pink-f); }
[data-cat="image"] { --tbg: var(--t-teal); --tfg: var(--t-teal-f); }
[data-cat="document"], [data-cat="ebook"], [data-cat="email"] { --tbg: var(--t-blue); --tfg: var(--t-blue-f); }
[data-cat="spreadsheet"], [data-cat="data"] { --tbg: var(--t-green); --tfg: var(--t-green-f); }
[data-cat="presentation"] { --tbg: var(--t-coral); --tfg: var(--t-coral-f); }
[data-cat="executable"] { --tbg: var(--t-red); --tfg: var(--t-red-f); }
[data-cat="generic"] { --tbg: transparent; --tfg: var(--mu); }

.i14 { width: 14px; height: 14px; }
.known-head { display: flex; gap: 14px; align-items: center; }
.known-text { flex: 1; min-width: 0; }
.page[data-file="known"] .icon-box.type-box { display: flex; }
.icon-box.type-box {
  flex: none; width: 48px; height: 48px; align-items: center; justify-content: center;
  color: var(--tfg); background: var(--tbg); border: 1px solid transparent; border-radius: 14px;
}
.icon-box.type-box[data-cat="generic"], .type-mini[data-cat="generic"] { border-color: var(--bd); }
.sub-ready { display: flex; align-items: center; gap: 8px; }
.type-mini {
  display: none; flex: none; width: 22px; height: 22px; align-items: center; justify-content: center;
  color: var(--tfg); background: var(--tbg); border: 1px solid transparent; border-radius: 6px;
}
.type-mini svg { width: 14px; height: 14px; }
.sub-details { margin-top: 0; font-variant-numeric: tabular-nums; }

/* The preview (meta.thumb, decrypted on this device): replaces the big icon; a small one leads the size line. */
.thumb { display: none; margin: 0 0 16px; }
.fh-known[data-thumb] .thumb { display: block; }
.fh-known[data-thumb] .icon-box.type-box { display: none; }
.fh-known[data-thumb] .type-mini { display: flex; }
.fh-known[data-thumb] .sub-details { padding-inline-start: 30px; }
.thumb-frame {
  position: relative; height: 192px; display: flex; align-items: center; justify-content: center; overflow: hidden;
  background: var(--pn); border: 1px solid var(--bd); border-radius: 12px;
}
.thumb-frame img { display: block; width: auto; height: auto; max-width: 100%; max-height: 100%; }
.thumb-badge {
  position: absolute; inset-inline-end: 8px; bottom: 8px; padding: 1px 7px; font-size: 12px; font-weight: 600;
  color: #FFFFFF; background: rgba(0, 0, 0, 0.72); border-radius: 6px; font-variant-numeric: tabular-nums;
}
.thumb-cap { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 12px; color: var(--mu); }

@media (max-width: 759.98px) {
  /* Phone: the preview only on Ready; while downloading the header is the icon, the name and the size. */
  .page:not([data-screen="ready"]) .thumb { display: none; }
  .page:not([data-screen="ready"]) .fh-known[data-thumb] .icon-box.type-box { display: flex; }
  .page[data-screen="downloading"] .sub-details,
  .page[data-screen="resume"] .sub-details,
  .page[data-screen="saving"] .sub-details { display: none; }
}
@media (min-width: 760px) {
  .known-head { display: block; }
  .thumb { margin: 0; }
  .thumb-frame { height: 240px; }
  .type-mini { width: 24px; height: 24px; border-radius: 7px; }
  .type-mini svg { width: 15px; height: 15px; }
  .sub-details { margin-top: 2px; }
  .fh-known[data-thumb] .sub-details { padding-inline-start: 32px; }
}
