/* LORVA sub-pages (product, support, privacy, legal) on the Cobalt charter.
 * Loaded after tokens.css + base.css. Header, toolbar, keys, links and footer
 * repeat the home page's rules so every page shares one chrome; the rest is
 * the sub-page furniture (product header, section rows, ledger, releases,
 * forms, prose). One accent: --color-accent. Product colours live only in the
 * app icons. */

/* ---- language: both languages share the DOM, one shown at a time.
 * Hide-only rules (no `revert`): an element keeps its own display when shown. */
html:not(.fr) .lang-fr { display: none !important; }
html.fr .lang-en { display: none !important; }

/* ---- status colours, re-derived for dark like every other token ---- */
:root { --status-ok: var(--color-success); --status-err: var(--color-error); }
[data-mode="dark"] { --status-ok: oklch(78% 0.12 150); --status-err: oklch(75% 0.13 27); }
@media (prefers-color-scheme: dark) { :root:not([data-mode]) { --status-ok: oklch(78% 0.12 150); --status-err: oklch(75% 0.13 27); } }

/* ---- the toolbar (language + mode) — same as home ---- */
.toolbar { display: inline-flex; align-items: center; gap: var(--space-xs); }
.seg { display: inline-flex; gap: var(--space-3xs); padding: var(--space-3xs); border: var(--rule-hair) solid var(--color-rule-2); border-radius: var(--radius-input); background: var(--color-paper-2); }
.seg button { border: 0; background: none; cursor: pointer; color: var(--color-muted); font: 500 var(--text-sm)/1 var(--font-body); padding: var(--space-xs) var(--space-sm); border-radius: 4px; transition: color var(--dur-micro) var(--ease-out), background var(--dur-micro) var(--ease-out); }
.seg button[aria-pressed="true"] { color: var(--color-ink); background: var(--color-paper); box-shadow: var(--shadow-card); }
.seg button:hover { color: var(--color-ink); }

/* ---- nav — same as home ---- */
.nav { position: sticky; top: 0; z-index: var(--z-sticky-nav); background: color-mix(in oklab, var(--color-paper) 88%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: var(--rule-hair) solid var(--color-rule); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; gap: var(--space-lg); min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: var(--space-sm); text-decoration: none; color: var(--color-ink); }
.brand-mark { width: 30px; height: 30px; display: grid; place-items: center; background: var(--color-accent); color: var(--color-accent-ink); font: 600 var(--text-md)/1 var(--font-display); border-radius: var(--radius-input); border: var(--rule-hair) solid var(--color-accent-edge); }
@supports (corner-shape: bevel) { .brand-mark { border-radius: var(--cut) 3px var(--cut) 3px; corner-shape: bevel round bevel round; } }
.brand-name { font: 600 var(--text-lg)/1 var(--font-display); letter-spacing: var(--tracking-display); }
.nav-right { display: flex; align-items: center; gap: var(--space-lg); }
.nav-links { display: flex; gap: var(--space-lg); }
.nav-links a { color: var(--color-muted); text-decoration: none; font-size: var(--text-sm); white-space: nowrap; transition: color var(--dur-micro) var(--ease-out); }
.nav-links a:hover, .nav-links a.active { color: var(--color-ink); }

/* ---- trail: where am I + this product's own links. Sits under the shared
 * header so the header stays identical to home; stays visible on mobile,
 * where the header links fold away. */
.trail { border-bottom: var(--rule-hair) solid var(--color-rule); }
.trail-inner { display: flex; align-items: center; justify-content: space-between; gap: var(--space-md); flex-wrap: wrap; min-height: 44px; padding-block: var(--space-xs); }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; list-style: none; margin: 0; padding: 0; font: 400 var(--text-xs)/1.3 var(--font-outlier); color: var(--color-muted); }
.crumbs li + li::before { content: "/"; margin: 0 var(--space-xs); color: var(--color-rule-2); }
.crumbs a { color: var(--color-ink-2); text-decoration: none; }
.crumbs a:hover { color: var(--color-ink); text-decoration: underline; text-decoration-color: var(--color-accent); }
.crumbs [aria-current] { color: var(--color-ink); }
.trail-links { display: flex; flex-wrap: wrap; gap: var(--space-xs) var(--space-lg); font-size: var(--text-sm); }
.trail-links a { color: var(--color-ink-2); text-decoration: none; }
.trail-links a:hover, .trail-links a[aria-current] { color: var(--color-ink); text-decoration: underline; text-decoration-color: var(--color-accent); text-underline-offset: 0.2em; }

/* ---- keycap controls + underlined links — same as home ---- */
.key { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-xs); border: var(--rule-hair) solid var(--color-rule-2); border-radius: var(--radius-input); padding: 0 var(--space-lg); min-height: 48px; background: var(--color-key-face); color: var(--color-ink); font: 500 var(--text-md)/1 var(--font-display); text-decoration: none; box-shadow: var(--shadow-key); transition: transform var(--dur-micro) var(--ease-out), box-shadow var(--dur-micro) var(--ease-out); white-space: nowrap; cursor: pointer; }
.key:hover { transform: translateY(-1px); }
.key:active { transform: translateY(3px); box-shadow: var(--shadow-key-press); }
.key--primary { background: var(--color-accent); border-color: var(--color-accent-edge); color: var(--color-accent-ink); box-shadow: var(--shadow-key-accent); }
.key:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }
.key svg { flex-shrink: 0; }
.link-u { color: var(--color-ink); text-decoration: underline; text-decoration-color: var(--color-rule-2); text-underline-offset: 0.2em; transition: text-decoration-color var(--dur-micro) var(--ease-out); }
.link-u:hover { text-decoration-color: var(--color-accent); }

/* emoji kept from the old pages, set in graphite like the home page's photos
 * so they read as glyphs and never compete with the one accent */
.emo { filter: grayscale(1) contrast(1.05); opacity: 0.85; }

/* ---- product header ---- */
.phero-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-3xl); align-items: center; padding-block: clamp(40px, 7vh, 88px); }
.phero-grid--media { grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); }
.phero-title { display: flex; align-items: center; gap: var(--space-lg); }
.phero h1 { font-size: var(--text-display-s); }
.phero-icon { width: 72px; height: 72px; flex-shrink: 0; border-radius: 16px; border: var(--rule-hair) solid var(--color-rule); background: var(--color-paper-2); object-fit: cover; }
.phero-mark { width: 72px; height: 72px; flex-shrink: 0; display: grid; place-items: center; border-radius: 16px; background: var(--color-paper-3); border: var(--rule-hair) solid var(--color-rule-2); color: var(--color-ink-2); font: 600 var(--text-2xl)/1 var(--font-display); }
.phero .lead { margin-top: var(--space-lg); color: var(--color-ink-2); }
.tags { margin-top: var(--space-md); display: flex; flex-wrap: wrap; gap: var(--space-2xs) 0; font: 400 var(--text-xs)/1.3 var(--font-outlier); color: var(--color-muted); }
.tags span { display: inline-flex; align-items: center; }
.tags span + span::before { content: "/"; margin: 0 var(--space-xs); color: var(--color-rule-2); }
.actions { margin-top: var(--space-xl); display: flex; flex-wrap: wrap; gap: var(--space-md); align-items: center; }

/* ---- section rows: heading left, content right — the home ledger's split ---- */
.sec { border-top: var(--rule-hair) solid var(--color-rule); }
.sec-grid { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: var(--space-2xl); padding-block: var(--space-3xl); align-items: start; }
.sec-title { font-size: var(--text-2xl); max-width: 16ch; }

/* features: a ruled two-column ledger rather than boxed cards */
.feats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 var(--space-xl); }
.feat { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: var(--space-2xs) var(--space-md); padding-block: var(--space-lg); border-top: var(--rule-hair) solid var(--color-rule); align-content: start; }
.feat:nth-child(-n+2) { border-top: 0; padding-top: 0; }
.feat-icon { grid-row: 1 / span 2; font-size: 20px; line-height: 1.3; }
.feat h3 { font-size: var(--text-lg); line-height: 1.25; }
.feat p { color: var(--color-ink-2); font-size: var(--text-sm); line-height: 1.55; }

/* figures row (formats, languages): the home "facts" treatment */
.figs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; }
.fig { padding: var(--space-2xs) var(--space-lg); border-left: var(--rule-hair) solid var(--color-rule); }
.fig:first-child { padding-left: 0; border-left: 0; }
.fig-big { font: 600 var(--text-xl)/1.1 var(--font-display); letter-spacing: var(--tracking-display); color: var(--color-ink); }
.fig-sub { margin-top: var(--space-2xs); color: var(--color-muted); font-size: var(--text-sm); }

/* ---- release notes: ruled rows that open in place ---- */
.releases { display: flex; flex-direction: column; border-bottom: var(--rule-hair) solid var(--color-rule); }
.releases-older { display: none; flex-direction: column; }
.releases.show-older .releases-older { display: flex; }
.release { border-top: var(--rule-hair) solid var(--color-rule); }
.release-toggle { width: 100%; display: flex; align-items: baseline; gap: var(--space-md); padding: var(--space-md) 0; background: none; border: 0; color: var(--color-ink); cursor: pointer; text-align: left; }
.release-toggle:hover .release-version { text-decoration: underline; text-decoration-color: var(--color-accent); text-underline-offset: 0.2em; }
.release-version { font: 500 var(--text-lg)/1.2 var(--font-display); letter-spacing: var(--tracking-display); }
.release-date { flex: 1; font: 400 var(--text-xs)/1.3 var(--font-outlier); color: var(--color-muted); }
.release-chevron { color: var(--color-muted); transition: transform var(--dur-short) var(--ease-out); flex-shrink: 0; align-self: center; }
.release.open .release-chevron { transform: rotate(180deg); }
/* 0fr -> 1fr opens to the notes' real height, whatever their length */
.release-body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows var(--dur-long) var(--ease-out); }
.release.open .release-body { grid-template-rows: 1fr; }
.release-notes { min-height: 0; overflow: hidden; list-style: none; margin: 0; padding: 0; }
.release-notes li { position: relative; padding-left: var(--space-lg); margin-bottom: var(--space-xs); color: var(--color-ink-2); font-size: var(--text-sm); max-width: 72ch; overflow-wrap: anywhere; }
.release-notes li:last-child { margin-bottom: var(--space-lg); }
.release-notes li::before { content: "–"; position: absolute; left: 0; color: var(--color-muted); }
.releases-loading { font-size: var(--text-sm); color: var(--color-muted); }
.releases-more { align-self: flex-start; margin: var(--space-sm) 0; padding: var(--space-xs) 0; background: none; border: 0; cursor: pointer; color: var(--color-ink); font-size: var(--text-sm); text-decoration: underline; text-decoration-color: var(--color-rule-2); text-underline-offset: 0.2em; }
.releases-more:hover { text-decoration-color: var(--color-accent); }
.releases-more .less-label { display: none; }
.releases.show-older .releases-more .more-label { display: none; }
.releases.show-older .releases-more .less-label { display: inline; }

/* ---- page header for support / privacy / legal ---- */
.page-head { padding-block: clamp(40px, 6vh, 72px) var(--space-2xl); }
.page-head-title { display: flex; align-items: center; gap: var(--space-lg); }
.page-head h1 { font-size: var(--text-display-s); max-width: 18ch; }
.page-head .lead { margin-top: var(--space-md); color: var(--color-ink-2); }
.page-head .icon { width: 56px; height: 56px; flex-shrink: 0; border-radius: 12px; border: var(--rule-hair) solid var(--color-rule); background: var(--color-paper-2); object-fit: cover; }
.meta { font: 400 var(--text-xs)/1.4 var(--font-outlier); color: var(--color-muted); }
.page-head .meta { margin-bottom: var(--space-md); }

/* ---- support: form left (the task), FAQ right (the lookup) ---- */
.support-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: var(--space-3xl); align-items: start; padding-bottom: var(--section-gap-s); }
.panel { border: var(--rule-hair) solid var(--color-rule); border-radius: var(--radius-card); background: var(--color-paper-2); padding: clamp(20px, 3vw, 40px); }
.panel h2 { font-size: var(--text-xl); }
.panel > p { margin-top: var(--space-xs); color: var(--color-ink-2); }
.panel form { margin-top: var(--space-xl); }
.form-group { margin-bottom: var(--space-lg); }
.form-group label { display: block; margin-bottom: var(--space-xs); font-size: var(--text-sm); font-weight: 500; color: var(--color-ink); }
.form-group input, .form-group select, .form-group textarea { width: 100%; min-height: 44px; padding: 10px 12px; background: var(--color-paper); color: var(--color-ink); border: var(--rule-hair) solid var(--color-rule-2); border-radius: var(--radius-input); font-size: var(--text-md); transition: border-color var(--dur-micro) var(--ease-out), box-shadow var(--dur-micro) var(--ease-out); }
.form-group input::placeholder, .form-group textarea::placeholder { color: var(--color-muted); }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { outline: none; border-color: var(--color-accent); box-shadow: 0 0 0 3px color-mix(in oklab, var(--color-accent) 22%, transparent); }
.form-group textarea { resize: vertical; min-height: 140px; }
.form-group input[type="file"] { padding: 8px 10px; font-size: var(--text-sm); color: var(--color-ink-2); cursor: pointer; }
.form-group input[type="file"]::file-selector-button { margin-right: var(--space-sm); padding: 6px 12px; border: var(--rule-hair) solid var(--color-rule-2); border-radius: 4px; background: var(--color-key-face); color: var(--color-ink); font: 500 var(--text-sm)/1.2 var(--font-body); cursor: pointer; }
.field-hint { margin-top: var(--space-xs); font-size: var(--text-xs); color: var(--color-muted); }
.file-list { list-style: none; margin: var(--space-xs) 0 0; padding: 0; }
.file-list:empty { margin-top: 0; }
.file-list li { display: flex; gap: var(--space-xs); padding: 2px 0; font: 400 var(--text-xs)/1.4 var(--font-outlier); color: var(--color-ink-2); }
.file-list li .file-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.file-list li .file-size { flex-shrink: 0; color: var(--color-muted); }
.file-list li.rejected, .file-list li.rejected .file-size { color: var(--status-err); }
.btn-submit { width: 100%; margin-top: var(--space-xs); }
.status-msg { margin-top: var(--space-md); padding: var(--space-sm) var(--space-md); border-radius: var(--radius-input); font-size: var(--text-sm); display: none; border: var(--rule-hair) solid; }
.status-msg.success { color: var(--status-ok); border-color: color-mix(in oklab, var(--status-ok) 45%, transparent); background: color-mix(in oklab, var(--status-ok) 8%, var(--color-paper)); }
.status-msg.error { color: var(--status-err); border-color: color-mix(in oklab, var(--status-err) 45%, transparent); background: color-mix(in oklab, var(--status-err) 8%, var(--color-paper)); }

.notice { display: flex; align-items: center; gap: var(--space-md); margin-bottom: var(--space-lg); padding: var(--space-md) var(--space-lg); border: var(--rule-hair) solid color-mix(in oklab, var(--color-accent) 35%, var(--color-rule)); border-radius: var(--radius-card); background: var(--color-accent-wash); color: var(--color-ink); text-decoration: none; transition: border-color var(--dur-micro) var(--ease-out); }
.notice:hover { border-color: var(--color-accent); }
.notice .emo { font-size: 20px; flex-shrink: 0; }
.notice-text { flex: 1; min-width: 0; display: grid; gap: var(--space-3xs); }
.notice-title { font: 500 var(--text-md)/1.3 var(--font-display); }
.notice-sub { font-size: var(--text-sm); color: var(--color-ink-2); }
.notice-arrow { flex-shrink: 0; color: var(--color-accent); font-size: var(--text-lg); }

.faq h2 { font-size: var(--text-xl); }
.faq-list { margin-top: var(--space-lg); border-top: var(--rule-hair) solid var(--color-rule); }
.faq-item { padding-block: var(--space-md); border-bottom: var(--rule-hair) solid var(--color-rule); }
.faq-q { font: 500 var(--text-md)/1.35 var(--font-display); color: var(--color-ink); }
.faq-a { margin-top: var(--space-2xs); font-size: var(--text-sm); color: var(--color-ink-2); }

/* ---- prose (privacy, legal): a reading column offset to the ledger's right track ---- */
.doc-grid { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: var(--space-2xl); padding-bottom: var(--section-gap-s); border-top: var(--rule-hair) solid var(--color-rule); padding-top: var(--space-2xl); }
.doc-aside { position: sticky; top: calc(64px + var(--space-lg)); align-self: start; display: grid; gap: var(--space-xs); }
.prose { max-width: 68ch; color: var(--color-ink-2); }
.prose h2 { font-size: var(--text-xl); color: var(--color-ink); margin: var(--space-2xl) 0 var(--space-sm); }
.prose > h2:first-child, .prose .lang-section > h2:first-child { margin-top: 0; }
.prose p { margin-bottom: var(--space-sm); }
.prose ul { margin: var(--space-xs) 0 var(--space-md); padding-left: var(--space-lg); }
.prose li { margin-bottom: var(--space-2xs); }
.prose li::marker { color: var(--color-muted); }
.prose strong { color: var(--color-ink); font-weight: 500; }
.prose a { color: var(--color-ink); text-decoration: underline; text-decoration-color: var(--color-rule-2); text-underline-offset: 0.2em; overflow-wrap: anywhere; }
.prose a:hover { text-decoration-color: var(--color-accent); }
.prose hr { border: 0; border-top: var(--rule-hair) solid var(--color-rule); margin: var(--space-2xl) 0; }

/* ---- footer: index columns — same as home ---- */
.footer { border-top: var(--rule-hair) solid var(--color-rule); padding-block: var(--space-2xl); }
.footer-grid { display: grid; grid-template-columns: minmax(0, 2fr) repeat(4, minmax(0, 1fr)); gap: var(--space-xl); }
.footer-brand .brand-name { font-size: var(--text-title); }
.footer-brand p { margin-top: var(--space-sm); color: var(--color-muted); font-size: var(--text-sm); max-width: 34ch; }
.fcol h3 { font: 500 var(--text-sm)/1.2 var(--font-body); color: var(--color-muted); letter-spacing: 0; }
.fcol ul { list-style: none; margin: var(--space-md) 0 0; padding: 0; display: grid; gap: var(--space-sm); }
.fcol a { color: var(--color-ink-2); text-decoration: none; font-size: var(--text-sm); }
.fcol a:hover { color: var(--color-ink); text-decoration: underline; text-decoration-color: var(--color-accent); text-underline-offset: 0.2em; }
.footer-legal { margin-top: var(--space-2xl); padding-top: var(--space-lg); border-top: var(--rule-hair) solid var(--color-rule); display: flex; justify-content: space-between; gap: var(--space-md); flex-wrap: wrap; color: var(--color-muted); font-size: var(--text-xs); }

@media (max-width: 60rem) {
  .phero-grid--media { grid-template-columns: minmax(0, 1fr); gap: var(--space-xl); }
  .sec-grid { grid-template-columns: minmax(0, 1fr); gap: var(--space-lg); padding-block: var(--space-2xl); }
  .support-grid { grid-template-columns: minmax(0, 1fr); gap: var(--space-2xl); }
  .doc-grid { grid-template-columns: minmax(0, 1fr); gap: var(--space-lg); }
  .doc-aside { position: static; }
  .figs { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-lg) 0; }
  .fig:nth-child(odd) { padding-left: 0; border-left: 0; }
  .footer-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 40rem) {
  .nav-links { display: none; }
  .nav-inner { gap: var(--space-sm); }
  .seg button { padding: var(--space-xs) 10px; }
  .phero-title, .page-head-title { gap: var(--space-md); }
  .phero-icon, .phero-mark { width: 56px; height: 56px; border-radius: 13px; }
  .phero-mark { font-size: var(--text-xl); }
  .page-head .icon { width: 48px; height: 48px; }
  .feats { grid-template-columns: minmax(0, 1fr); }
  .feat:nth-child(2) { border-top: var(--rule-hair) solid var(--color-rule); padding-top: var(--space-lg); }
  .actions .key { flex: 1 1 100%; }
  .notice { padding: var(--space-md); }
  .footer-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 24rem) {
  .brand-name { display: none; }
}
