/* Neon design: page-specific rules for the download pages (shared design system: /static/site.css).
   Download: a "terminal" deck. Each panel has a title bar, the release number is a readout,
   the installer files are chamfered rows with the size and SHA-256 in mono, and How to
   install is a real sequence: 1, then 2a or 2b (an arrow, then a fork to the two choices).
   Licensing and License rules: a spec sheet for reading (chapter titles in a left column,
   the points as rows in the reading color). Set up the administrator, Choose your password
   and Connect to Nextcloud reuse the auth pages' secure-terminal card (.auth-stage,
   .auth-head, .auth-status from neon/auth.css) and add only what is theirs here.
   Every rule is scoped (.dl-*, .lic-*): all neon/*.css files load on every page. */

/* Visually hidden text (the "." after a step number stays for screen readers). */
.dl-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }

/* ---------- Download: the two terminal panels ---------- */
@media (min-width: 961px) {
  .grid.dl-deck { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 1.375rem; }
  /* Signed out or without a license there are no file rows: equal panels. */
  .grid.dl-deck:has(.dl-lock) { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}
.dl-term { display: flex; flex-direction: column; padding-top: 0; }
/* The hairline and the corner ticks stay above the title bar. */
.dl-term::before, .dl-term::after { z-index: 2; }
/* Title bar: three status lights, the title in mono, a fading rule. */
.card.dl-term > h3.dl-bar {
  display: flex; align-items: center; gap: 0.75rem; margin: 0 -1.375rem 1.375rem; padding: 0.8125rem 1.375rem 0.75rem 1.625rem;
  font: 500 0.74rem/1.4 var(--mono); letter-spacing: 0.2em; text-transform: uppercase; color: var(--cyan);
  background: linear-gradient(90deg, rgba(24, 224, 255, 0.1), rgba(255, 47, 180, 0.05) 70%, transparent), var(--deck-2);
  border-bottom: 1px solid var(--line);
}
.dl-bar::before {
  content: ""; flex: none; width: 2.5rem; height: 0.5rem;
  background:
    radial-gradient(circle, var(--cyan) 0.1875rem, transparent 0.2188rem) 0 50% / 0.5rem 0.5rem no-repeat,
    radial-gradient(circle, var(--periwinkle) 0.1875rem, transparent 0.2188rem) 1rem 50% / 0.5rem 0.5rem no-repeat,
    radial-gradient(circle, var(--magenta) 0.1875rem, transparent 0.2188rem) 2rem 50% / 0.5rem 0.5rem no-repeat;
  filter: drop-shadow(0 0 0.25rem rgba(24, 224, 255, 0.55));
}
.dl-bar::after { content: ""; flex: 1 1 auto; min-width: 1rem; height: 1px; background: linear-gradient(90deg, var(--line-strong), transparent); }
.band .card.dl-term > h3.dl-bar { background: linear-gradient(90deg, rgba(24, 224, 255, 0.1), transparent 70%), var(--deck-3); }

/* Release readout: the version as a big display number. */
.dl-readout { display: grid; gap: 0.25rem; margin: 0 0 0.625rem; }
.dl-readout::before { content: "Release"; content: "Release" / ""; font: 500 0.7rem/1.2 var(--mono); letter-spacing: 0.2em; text-transform: uppercase; color: var(--magenta); }
.dl-readout b {
  font: 700 clamp(2.4rem, 5.2vw, 3.4rem)/1 var(--display); letter-spacing: 0.03em; color: var(--cyan);
  font-variant-numeric: tabular-nums; text-shadow: 0 0 1.375rem rgba(24, 224, 255, 0.38), 0 0 2px rgba(24, 224, 255, 0.6);
}
.card.dl-term p.dl-rel { color: var(--read); }
.dl-rel b { font-family: var(--mono); font-weight: 500; color: var(--cyan-soft); }

/* Installer files: chamfered rows, the button, the name and size, the SHA-256. */
.dl-term .dl-list { gap: 0.75rem; margin: 1.125rem 0 1.125rem; }
.dl-term .dl-list li {
  --cut: 0.625rem; position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 0.75rem 1rem;
  padding: 0.875rem 1rem 0.875rem 1.125rem; background: rgba(5, 6, 12, 0.55); border: 1px solid var(--line);
  box-shadow: inset 2px 0 0 var(--cyan);
  clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut));
  transition: border-color 0.2s, background 0.2s;
}
.dl-term .dl-list li:hover { border-color: var(--line-strong); background: rgba(24, 224, 255, 0.035); }
.dl-term .dl-list .btn { justify-self: start; }
.dl-term .dl-list .btn:focus-visible { outline-offset: -0.3125rem; }
.dl-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 0.5rem; min-width: 0; font: 400 0.82rem/1.45 var(--mono); }
.dl-list .dl-meta { color: var(--faint); }
.dl-name { min-width: 0; color: var(--text); overflow-wrap: anywhere; }
.dl-sep { display: none; }
.dl-size { --cut: 0.3125rem; padding: 0 0.4375rem; color: var(--cyan); background: rgba(24, 224, 255, 0.08); border: 1px solid rgba(24, 224, 255, 0.32); white-space: nowrap;
  clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut)); }
/* The checksum wraps inside its own box, never the page. */
.dl-term .dl-list .sha {
  grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; margin: 0;
  padding: 0.5rem 0.75rem; font: 400 0.75rem/1.5 var(--mono); color: var(--dim); background: var(--field); border: 1px solid var(--line-soft);
}
.sha-k { font-size: 0.66rem; letter-spacing: 0.16em; color: var(--magenta); white-space: nowrap; }
.sha-v { min-width: 0; color: var(--cyan-soft); letter-spacing: 0; word-break: break-all; overflow-wrap: anywhere; user-select: all; }
.dl-term > .hint { margin-top: auto; padding-top: 0.25rem; }

/* Signed out, no license, or the installer being prepared: a status line. */
.card.dl-term p.dl-lock {
  position: relative; margin: 0 0 1.125rem; padding: 0.75rem 0.875rem 0.75rem 2.125rem; color: var(--read); font-size: 1rem;
  background: var(--field); border: 1px solid var(--line); box-shadow: inset 2px 0 0 var(--magenta);
}
.dl-lock::before { content: "›"; content: "›" / ""; position: absolute; left: 0.875rem; top: 0.6875rem; font: 600 1rem/1.5 var(--mono); color: var(--magenta); }
.card.dl-term p.dl-actions { display: flex; flex-wrap: wrap; gap: 0.625rem; margin-bottom: 0.75rem; }
.dl-actions .btn { min-width: 9.375rem; }

/* Requirements: a spec sheet. */
.dl-spec { margin: 0 0 1.125rem; border-top: 1px solid var(--line-soft); }
.dl-spec li { margin: 0; padding: 0.6875rem 0 0.6875rem 1.75rem; border-bottom: 1px solid var(--line-soft); color: var(--read); }
.dl-spec li::before { top: 0.6875rem; text-shadow: 0 0 0.5rem rgba(61, 242, 154, 0.5); }
.card.dl-term p { color: var(--read); }
.dl-path { padding: 1px 0.4375rem; font: 500 0.88em/1.4 var(--mono); color: var(--cyan-soft); background: rgba(24, 224, 255, 0.07); border: 1px solid var(--line-soft); white-space: nowrap; }
.card.dl-term p.dl-links { margin-top: auto; padding-top: 0.875rem; border-top: 1px solid var(--line-soft); font: 500 0.76rem/1.6 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); }

/* ---------- How to install: 1, then 2a or 2b ---------- */
.dl-how h2 { margin-bottom: 0.75rem; }
.dl-lede { max-width: 46rem; margin-bottom: 2.125rem; color: var(--read); font-size: 1.05rem; }
.dl-lede b { color: var(--text); }
.grid.dl-steps {
  gap: 0; align-items: stretch;
  grid-template-columns: minmax(0, 1fr) 2.5rem minmax(0, 1fr) 2.5rem minmax(0, 1fr);
  grid-template-areas: "s1 ar s2a or s2b";
}
.dl-s1 { grid-area: s1; }
.dl-s2a { grid-area: s2a; }
.dl-s2b { grid-area: s2b; }
.dl-arrow { grid-area: ar; }
.dl-or { grid-area: or; }
.dl-step { display: flex; flex-direction: column; }
.dl-t { min-width: 0; }
.dl-steps h3 { display: flex; align-items: center; gap: 0.75rem; margin: 0 0 1rem; font-size: 1.14rem; line-height: 1.25; }
.dl-n {
  --cut: 0.5rem; position: relative; flex: none; display: grid; place-items: center; min-width: 2.75rem; height: 2.75rem; padding: 0 0.5625rem;
  font: 700 1.12rem/1 var(--display); letter-spacing: 0.04em; color: var(--cyan); text-shadow: 0 0 0.75rem rgba(24, 224, 255, 0.55);
  background: linear-gradient(135deg, rgba(24, 224, 255, 0.2), rgba(255, 47, 180, 0.14)); box-shadow: inset 0 0 0 1px var(--line-hot);
  clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut));
}
.dl-rec { margin-left: 2px; font: 500 0.68rem/1.4 var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--ok); }
/* The recommended path gets the hot hairline. */
.dl-s2a::before { background: linear-gradient(135deg, var(--cyan), rgba(24, 224, 255, 0.14) 40%, rgba(24, 224, 255, 0.14) 60%, var(--magenta)); }
.dl-steps p, .dl-help ul { color: var(--read); }
.dl-steps p b, .dl-help li b { color: var(--text); }
.dl-steps .hint { color: var(--dim); }
/* Commands: one terminal line each, with a prompt that is not copied. */
.dl-help code.dl-cmd {
  position: relative; display: block; width: fit-content; max-width: 100%; margin: 0.375rem 0 2px; padding: 0.375rem 0.625rem 0.375rem 1.5rem;
  font-size: 0.82rem; line-height: 1.5; color: var(--cyan-soft); background: var(--field); border: 1px solid var(--line); box-shadow: inset 2px 0 0 var(--line-hot);
  word-break: break-all;
}
.dl-cmd::before { content: "›"; content: "›" / ""; position: absolute; left: 0.5625rem; top: 0.375rem; color: var(--magenta); user-select: none; }

/* The arrow (1 → 2) and the "or" between 2a and 2b, at the step numbers' height. */
.dl-arrow, .dl-or { position: relative; min-height: 2.75rem; }
.dl-arrow::before { content: ""; position: absolute; left: 0.375rem; right: 0.5rem; top: 2.8125rem; height: 2px;
  background: linear-gradient(90deg, var(--line-strong), var(--cyan)); box-shadow: 0 0 0.5rem rgba(24, 224, 255, 0.55); }
.dl-arrow::after { content: ""; position: absolute; right: 0.4375rem; top: 2.5625rem; width: 0.5625rem; height: 0.5625rem;
  border-top: 2px solid var(--cyan); border-right: 2px solid var(--cyan); transform: rotate(45deg); filter: drop-shadow(0 0 0.25rem var(--cyan)); }
.dl-or::before { content: ""; position: absolute; left: 0.25rem; right: 0.25rem; top: 2.875rem; border-top: 1px dashed var(--line-mag); }
.dl-or::after { content: "or"; content: "or" / ""; position: absolute; left: 50%; top: 2.1875rem; transform: translateX(-50%);
  padding: 2px 0.375rem; font: 500 0.66rem/1.4 var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--magenta);
  background: var(--deck); border: 1px solid var(--line-mag); }

/* Tablets and small laptops: 1 on top, a fork, then 2a or 2b side by side. */
@media (max-width: 1100px) {
  .grid.dl-steps { grid-template-columns: minmax(0, 1fr) 2.5rem minmax(0, 1fr); grid-template-areas: "s1 s1 s1" "ar ar ar" "s2a or s2b"; }
  .dl-s1 ul { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(13.75rem, 100%), 1fr)); gap: 0 1.5rem; }
  .dl-arrow { min-height: 2.875rem; }
  /* Down from step 1's number into 2a's, with a branch across and down into 2b's. */
  .dl-arrow::before { left: 2.6875rem; right: auto; top: 0; width: 2px; height: 100%; background: linear-gradient(var(--line-strong), var(--cyan)); }
  .dl-arrow::after { left: 2.6875rem; right: auto; top: 50%; bottom: 0; width: calc((100% - 2.5rem) / 2 + 2.625rem); height: auto;
    border: 2px solid var(--cyan); border-left: 0; border-bottom: 0; transform: none; filter: drop-shadow(0 0 0.1875rem rgba(24, 224, 255, 0.6)); opacity: 0.85; }
}
/* Phones: one column, 1 ↓ 2a, or, 2b. */
@media (max-width: 700px) {
  .grid.dl-steps { grid-template-columns: minmax(0, 1fr); grid-template-areas: "s1" "ar" "s2a" "or" "s2b"; }
  .dl-arrow { min-height: 2.375rem; }
  .dl-arrow::before { left: 2.6875rem; top: 0; width: 2px; height: calc(100% - 0.25rem); }
  .dl-arrow::after { left: 2.4375rem; right: auto; top: auto; bottom: 0.1875rem; width: 0.5rem; height: 0.5rem; border: 0;
    border-right: 2px solid var(--cyan); border-bottom: 2px solid var(--cyan); transform: rotate(45deg); }
  .dl-or { min-height: 2.875rem; }
  .dl-or::before { left: 2.6875rem; right: auto; top: 0; bottom: 0; border-top: 0; border-left: 1px dashed var(--line-mag); }
  .dl-or::after { left: 2.75rem; top: 50%; transform: translate(-50%, -50%); }
  .dl-steps h3 { font-size: 1.06rem; }
}
@media (max-width: 480px) {
  .dl-term .dl-list li { grid-template-columns: minmax(0, 1fr); padding: 0.75rem; }
  .dl-term .dl-list .btn { justify-self: stretch; }
  .card.dl-term > h3.dl-bar { padding-left: 1.375rem; letter-spacing: 0.16em; }
  .dl-actions .btn { flex: 1 1 100%; }
}

/* ---------- Licensing and License rules: a spec sheet for reading ---------- */
.lic-doc > p { max-width: 46rem; color: var(--read); font-size: 1.03rem; line-height: 1.7; }
.lic-doc > p a:not(.btn), .lic-doc .feat-list a { text-decoration: underline; text-decoration-color: rgba(24, 224, 255, 0.45); }
.lic-doc > h2 {
  margin: 3.5rem 0 1.125rem; padding-top: 1rem; font-size: clamp(1.3rem, 2.4vw, 1.6rem); overflow-wrap: anywhere;
  background: linear-gradient(90deg, var(--cyan), var(--magenta)) 0 0 / 3.5rem 2px no-repeat, linear-gradient(var(--line), var(--line)) 0 0 / 100% 1px no-repeat;
}
.lic-doc > h2:first-child { margin-top: 0; }
/* The chapter number ("1.") in the neon accent. */
.lic-numbered > h2::first-letter { color: var(--cyan); text-shadow: 0 0 0.875rem rgba(24, 224, 255, 0.45); }
/* The points: rows with a hairline, the title, then the text in the reading color. */
.lic-doc .feat-list { grid-template-columns: minmax(0, 1fr); gap: 0; max-width: 48.75rem; border-top: 1px solid var(--line-soft); }
.lic-doc .feat-list > div { clip-path: none; padding: 1.125rem 0.5rem 1.125rem 2.125rem; background: none; border: 0; border-bottom: 1px solid var(--line-soft); transition: background 0.2s; }
.lic-doc .feat-list > div:hover { background: linear-gradient(90deg, rgba(24, 224, 255, 0.045), transparent 80%); }
.lic-doc .feat-list > div::before {
  content: ""; content: "" / ""; left: 0.5rem; top: 1.6875rem; width: 0.5rem; height: 0.5rem; background: var(--cyan); transform: rotate(45deg);
  box-shadow: 0 0 0.5rem rgba(24, 224, 255, 0.7);
}
.lic-doc .lic-reasons > div::before { background: var(--magenta); box-shadow: 0 0 0.5rem rgba(255, 47, 180, 0.7); }
.lic-doc .feat-list b { margin-bottom: 0.3125rem; font-size: 1.1rem; }
.lic-doc .feat-list span { display: block; color: var(--read); font-size: 1rem; line-height: 1.7; }
/* Notes under a list: a quiet callout. */
.lic-doc > p.hint { margin-top: 1.125rem; padding: 0.625rem 0.875rem; font-size: 0.92rem; line-height: 1.6; color: var(--dim); border-left: 2px solid var(--line-strong); background: linear-gradient(90deg, rgba(24, 224, 255, 0.05), transparent 80%); }
.lic-doc > .feat-list + p.hint { margin-top: 0.875rem; }
.lic-doc > .cta-band { margin-top: 4rem; }

/* Wide screens: the chapter titles in a left column, the points beside them. */
@media (min-width: 961px) {
  .lic-doc { display: grid; grid-template-columns: minmax(0, 18.125rem) minmax(0, 1fr); column-gap: 3.5rem; align-items: start; }
  .lic-doc > * { grid-column: 2; min-width: 0; }
  .lic-doc > h2 { grid-column: 1; margin: 3.5rem 0 0; }
  /* The title column is about 18rem: titles at a size where the longest word fits whole
     ("Troubleshooting"), breaking only between words; specific enough to win over the
     theme's section headings. */
  .lic-doc > h2, html main section > .wrap.lic-doc > h2:not([class]) { font-size: 1.45rem; overflow-wrap: break-word; }
  .lic-doc > h2 + * { margin-top: 3.5rem; }
  .lic-doc > h2:first-child, .lic-doc > h2:first-child + * { margin-top: 0; }
  .lic-doc > h2 + p { padding-top: 0.875rem; }
  .lic-doc > .cta-band { grid-column: 1 / -1; }
}
@media (max-width: 600px) {
  .lic-doc > h2 { margin-top: 2.75rem; }
  .lic-doc .feat-list > div { padding: 1rem 0.25rem 1rem 1.75rem; }
  .lic-doc .feat-list > div::before { left: 0.25rem; top: 1.5625rem; }
  .lic-doc > p, .lic-doc .feat-list span { font-size: 0.98rem; }
}

/* ---------- Set up the administrator, Choose your password, Connect to Nextcloud ---------- */
/* The setup token is a code: mono. The path chip may move to the next line with its "(". */
.dl-setup > p .mono { white-space: normal; overflow-wrap: anywhere; }
.dl-setup input.dl-token { font-family: var(--mono); letter-spacing: 0.04em; }
/* The sign-in name is shown, not typed. */
.dl-welcome input[readonly] { color: var(--dim); background: transparent; border-style: dashed; cursor: default; }
.dl-welcome input[readonly]:focus { border-color: var(--line-hot); box-shadow: none; }
/* Connect to Nextcloud: two numbered steps on a rail, the button between them. */
.dl-seq { position: relative; margin: 0.375rem 0 1.125rem; }
.dl-seq::before { content: ""; position: absolute; left: 1.0625rem; top: 2.25rem; bottom: 2.25rem; width: 2px; background: linear-gradient(var(--cyan), var(--line-mag)); opacity: 0.6; }
.dl-seq p { margin: 0; color: var(--read); line-height: 1.6; }
.dl-seq-step { position: relative; display: grid; grid-template-columns: 2.25rem minmax(0, 1fr); gap: 0.875rem; align-items: start; }
.dl-seq-step .dl-n { min-width: 2.25rem; height: 2.25rem; padding: 0; font-size: 1rem; background: linear-gradient(135deg, rgba(24, 224, 255, 0.22), rgba(255, 47, 180, 0.16)), var(--deck); }
.dl-seq-step > span:last-child { padding-top: 0.375rem; }
.dl-seq-step b { color: var(--text); }
.dl-seq-act { padding: 0.875rem 0 1rem 3.125rem; }
.dl-seq-act .btn { white-space: normal; text-align: center; }
.dl-folder { padding: 0 0.375rem; font: 500 0.92em/1.5 var(--mono); color: var(--cyan-soft); background: rgba(24, 224, 255, 0.07); border: 1px solid var(--line-soft); overflow-wrap: anywhere; }
.dl-nc .dl-cancel { margin: 1rem 0 0; }
@media (max-width: 400px) {
  .dl-seq-act { padding-left: 0; }
  .dl-seq-act .btn { width: 100%; }
}

/* ---------- Motion and print ---------- */
@media (prefers-reduced-motion: reduce) {
  .dl-term .dl-list li, .lic-doc .feat-list > div { transition: none; }
}
@media print {
  .dl-bar::before, .dl-bar::after, .dl-arrow, .dl-or, .dl-readout, .dl-seq::before { display: none !important; }
  .card.dl-term > h3.dl-bar { margin: 0 0 0.75rem; padding: 0; background: none; border: 0; color: #000; }
  .dl-term .dl-list li, .dl-help code.dl-cmd, .dl-term .dl-list .sha { clip-path: none; background: none; box-shadow: none; border-color: #999; color: #000; }
  .sha-v, .dl-name, .dl-size { color: #000; }
  .grid.dl-steps { display: block; }
}

/* Polish (site-fit-check, 2026-11-24): on touch screens "Forgot your password?" is 40 px to tap (was 16 px);
   the larger tap area takes no extra room. */
@media (pointer: coarse), (max-width: 760px) {
  .dl-term p.hint > a:only-child { display: inline-block; padding-top: 0.75rem; padding-bottom: 0.75rem; margin-top: -0.75rem; margin-bottom: -0.75rem; }
}
