/* x6ng look for every page, matching home-x6ng.html: the radio's Default theme on top of style.css */
:root {
  --bg: #0e141b; --panel: #16202a; --tile: #1e2a36; --line: #35444f; --text: #eef2f6; --dim: #8a96a3;
  --accent: #f3c03e; --sel: #5b4416; --aqua: #4cb6f2; --blue: #4cb6f2; --mint: #66d3b0; --code: #1e2a36; --radius: 8px;
}
body { font-family: Montserrat, system-ui, "Segoe UI", Roboto, sans-serif; background: #070b10; padding-bottom: 76px; }

/* top bar = the radio's status row: the links are small tiles in one panel, the current page in amber */
header.top { background: var(--bg); border-bottom: 1px solid var(--line); }
header.top .wrap { max-width: 1200px; }
.brand { font-weight: 700; letter-spacing: .04em; }
header nav { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 4px; gap: 4px; }
header nav a { background: var(--tile); color: var(--text); border-radius: 4px; padding: 3px 9px; font-size: 14px; }
header nav a:hover { background: var(--tile); color: var(--accent); }
header nav a.on { background: var(--tile); color: var(--accent); font-weight: 600; }
.lang { border-color: var(--line); }

/* page title = the frequency panel */
.hero { padding: 36px 0 26px; }
.hero h1 { font-weight: 500; letter-spacing: .01em; }
.vfo { background: var(--accent); color: #1b1000; border: 0; border-radius: 6px; font: 700 15px Montserrat, sans-serif; text-transform: uppercase; padding: 4px 12px; }

/* each section = a radio panel with its mint title */
section { border-top: 0; padding: 12px 0; }
section > .wrap { max-width: 1200px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 22px 24px; }
h2 { color: var(--mint); font-size: 22px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; }
h2::before { background: var(--mint); width: 14px; height: 14px; border-radius: 3px; }
h3 { font-weight: 500; }

/* cards = the Apps tiles; hover = the amber selection */
.card { background: var(--tile); border-radius: var(--radius); }
.card h3 { color: var(--text); font-size: 20px; }
.card:hover { background: var(--sel); border-color: var(--accent); }
.card:hover h3 { color: var(--accent); }

/* buttons = the function keys: blue label; the main one amber */
.btn { background: var(--tile); color: var(--aqua); border-radius: 6px; font-weight: 500; }
.btn:hover { filter: none; border-color: var(--aqua); }
.btn.main { background: var(--accent); border-color: var(--accent); color: #1b1000; font-weight: 700; }
.btn.main:hover { filter: brightness(1.1); }

/* forms and tables, flat like the Settings rows */
input, select, textarea { background: var(--bg); border-color: var(--line); border-radius: 6px; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: none; }
table th { color: var(--mint); font-weight: 500; }
.note { background: var(--tile); border: 1px solid var(--line); border-radius: var(--radius); }
code { background: var(--tile); }
img, .hero .shot { border-radius: var(--radius); }
footer { border-top: 0; background: var(--bg); }

/* the five function keys at the bottom, as on the home (added by keys-x6ng.js) */
.keys { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: var(--bg); border-top: 1px solid var(--line); }
.keys .kw { max-width: 1200px; margin: 0 auto; padding: 6px 16px; display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.keys a { background: var(--tile); border: 1px solid var(--line); border-radius: 6px; text-align: center; text-decoration: none; color: var(--text); padding: 4px 6px; line-height: 1.25; font-size: 15px; }
.keys a small { display: block; font-size: 18px; font-weight: 500; }
.keys a.gen { color: var(--blue); }
.keys a:hover { border-color: var(--accent); color: var(--accent); }
.keys a.donate { background: var(--accent); border-color: var(--accent); color: #1b1000; font-weight: 600; }
header nav a.donate { background: var(--accent); border-color: var(--accent); color: #1b1000 !important; font-weight: 600; }
@media (max-width: 820px) { .keys a { font-size: 12px; } .keys a small { font-size: 14px; } }

/* app page: one box per feature (what it does, how to use it, screenshots) */
.fgrid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); align-items: start; }
.fbox { display: flex; flex-direction: column; gap: 8px; background: var(--tile); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px 18px; min-width: 0; }
.fbox[hidden] { display: none; }
.fbox h3 { margin: 0; font-size: 20px; font-weight: 500; color: var(--text); }
.fbox p { margin: 0; }
.fbox .what { color: var(--dim); }
.fbox ul { margin: 0; padding-left: 20px; }
.fbox li { margin: 3px 0; }
.fbox .howto { list-style: none; counter-reset: h; margin: 2px 0; padding: 0; }
.fbox .howto li { counter-increment: h; position: relative; padding: 5px 0 5px 38px; margin: 0; }
.fbox .howto li::before { content: counter(h); position: absolute; left: 0; top: 4px; width: 26px; height: 26px; border-radius: 6px; background: var(--sel); color: var(--accent); border: 1px solid var(--accent); font-weight: 600; text-align: center; line-height: 24px; font-size: 14px; }
.fbox .note { margin: 0; padding: 10px 14px; font-size: 15px; }
.fbox .note b { color: var(--blue); }
.fbox .btn { margin: 2px 4px 2px 0; }
.fshots { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); margin-top: 6px; }
.fshots figure { margin: 0; }
.fshots img { width: 100%; border: 1px solid var(--line); border-radius: 6px; background: #000; }

/* polish: type scale, spacing, manual and account pages (the site is dark only: no light theme exists to keep) */
h1 { font-size: clamp(28px, 6vw, 44px); line-height: 1.15; }
h3 { font-size: 18px; line-height: 1.3; }
p, li { line-height: 1.6; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
main.account, main.admin { max-width: 1200px; padding-top: 24px; }
.account .card, .install .card { background: var(--panel); }
.account .card h2, .account .card h3 { color: var(--mint); font-weight: 500; }
label { font-size: 14px; }
.small, figcaption { font-size: 14px; }
.guide { max-width: 1200px; gap: 28px; }
.toc { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.toc a { padding: 3px 0; }
.toc a:hover { color: var(--accent); }
.doc { max-width: 80ch; }
.doc p, .doc li { line-height: 1.65; }
.doc h1 { font-size: clamp(26px, 5vw, 36px); font-weight: 500; }
.doc h2 { color: var(--mint); font-size: 22px; font-weight: 500; letter-spacing: .04em; text-transform: uppercase; margin-top: 40px; }
.doc h2::before { display: none; }
.doc h3 { font-size: 18px; font-weight: 500; }
.doc th { color: var(--mint); }
.doc tr:hover td { background: var(--tile); }
.doc pre { background: var(--bg); }
.doc img { max-width: 100%; }
@media (max-width: 760px) {
  .hero { padding: 24px 0 18px; }
  section > .wrap { padding: 14px 14px 18px; }
  .guide { padding: 20px 16px; }
  .keys .kw { padding: 6px 8px; gap: 4px; }
  .keys a { padding: 3px 2px; }
}

/* narrow screens (390 px): nothing may be wider than the viewport */
html, body { max-width: 100%; overflow-x: clip; }
.wrap, .hero .wrap, section > .wrap, header.top .wrap { min-width: 0; }
header nav, .fbox, .early-card { min-width: 0; max-width: 100%; }
header.top .wrap { flex-wrap: wrap; height: auto; min-height: 54px; gap: 8px 12px; }
header nav { flex-wrap: wrap; max-width: 100%; margin-left: auto; }
.btns { flex-wrap: wrap; }
.stamped { max-width: 100%; overflow: hidden; }
p, li, h1, h2, h3, .note, .lead, figcaption { overflow-wrap: anywhere; }
img, video, svg { max-width: 100%; }

/* Versions page: one reading column, hero, collapsible sections (release notes rendered by site.js) */
.versions { max-width: 800px; }
.versions .vgrid { display: block; }
.versions .vlist { position: static; flex-direction: row; flex-wrap: wrap; gap: 6px; max-height: none; overflow: visible; margin: 0 0 18px; }
.versions .vlist a { padding: 5px 12px; border: 1px solid var(--line); border-radius: 999px; font-size: 14px; white-space: nowrap; }
.versions .vlist a .small { display: inline; margin-left: 6px; }
.versions .vlist a.on { box-shadow: none; border-color: var(--accent); }
.versions .vdetail { padding: 0; background: none; border: 0; box-shadow: none; }
.vhero { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 22px 24px; margin-bottom: 22px; }
.vkicker { margin: 0; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted, #8fa3b8); }
.vhero h2 { margin: 2px 0 14px; font-size: 34px; line-height: 1.1; }
.vhero h2 .vdate { font-size: 15px; font-weight: 400; color: var(--muted, #8fa3b8); margin-left: 10px; }
.vhero .row { margin: 0; }
.vnote { margin-top: 16px; padding: 12px 14px; border-radius: 10px; background: rgba(255, 176, 32, .07); border: 1px solid rgba(255, 176, 32, .35); font-size: 14px; line-height: 1.55; }
.vnote b { display: block; margin-bottom: 2px; color: var(--accent); }
.versions .vdetail > h3 { display: none; }
.rn2-intro { font-size: 17px; line-height: 1.7; margin: 0 0 22px; }
.rn2-intro p { margin: 0 0 12px; }
.rn2-sec { border-top: 1px solid var(--line); }
.rn2-sec:last-child { border-bottom: 1px solid var(--line); }
.rn2-sec > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 16px 2px; font-size: 19px; font-weight: 600; }
.rn2-sec > summary::-webkit-details-marker { display: none; }
.rn2-sec > summary::before { content: "›"; display: inline-block; width: 14px; color: var(--accent); transition: transform .15s; }
.rn2-sec[open] > summary::before { transform: rotate(90deg); }
.rn2-n { margin-left: auto; font-size: 13px; font-weight: 400; color: var(--muted, #8fa3b8); }
.rn2-body { padding: 0 2px 18px 24px; }
.rn2-item { margin: 0 0 18px; }
.rn2-item h4 { margin: 0 0 4px; font-size: 16px; color: var(--text); }
.rn2-item p { margin: 0; font-size: 15px; line-height: 1.7; color: var(--text); opacity: .88; }
.rn2-fixlist { margin: 0; padding-left: 18px; }
.rn2-fixlist li { margin: 0 0 6px; font-size: 14px; line-height: 1.55; opacity: .88; }
.rn2-note { font-size: 14px; line-height: 1.6; opacity: .8; }
@media (max-width: 600px) {
  .vhero { padding: 18px 16px; } .vhero h2 { font-size: 28px; }
  .rn2-body { padding-left: 6px; } .rn2-sec > summary { font-size: 17px; }
}
.rn2-intro p:first-child { font-size: 19px; color: var(--text); }
.rn2-intro p { color: var(--text); opacity: .9; }
.rn2-item p + p { margin-top: 8px; }

/* Versions page with "at a glance" boxes: wider page, equal boxes, 3/2/1 columns */
.versions:has(.has-boxes) { max-width: 1120px; }
.has-boxes .vhero, .has-boxes .md.rn, .has-boxes .vfull { max-width: 800px; margin-left: auto; margin-right: auto; }
.vlead { margin: -4px 0 16px; }
.vlead p { margin: 0 0 4px; font-size: 17px; line-height: 1.5; color: var(--text); }
.vboxes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 0 0 30px; align-items: stretch; }
.vbox { display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px 14px; }
.vbox h3 { display: flex; align-items: center; gap: 10px; margin: 0 0 10px; font-size: 17px; color: var(--text); }
.vbox h3 svg { width: 22px; height: 22px; flex: none; fill: none; stroke: var(--accent); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.vbox ul { margin: 0 0 12px; padding-left: 18px; flex: 1; }
.vbox li { margin: 0 0 5px; font-size: 14px; line-height: 1.45; color: var(--text); opacity: .9; }
.vmore { align-self: flex-start; font-size: 14px; text-decoration: none; color: var(--accent); }
.vmore:hover { text-decoration: underline; }
.vfull { font-size: 20px; margin: 0 auto 6px; }
@media (max-width: 1000px) { .vboxes { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .vboxes { grid-template-columns: 1fr; } }
.has-boxes .vhero, .has-boxes .md.rn, .has-boxes .vfull { max-width: none; }
.vbox { border-top: 3px solid var(--accent); }
.vfull { padding-top: 6px; border-top: 1px solid var(--line); }
/* Credits: one list per section, one row per component (name | what | licence | link) */
.credits .fgrid { display: block; background: var(--tile); border: 1px solid var(--line); border-radius: var(--radius); padding: 0 18px; }
.credits .fbox { display: grid; grid-template-columns: minmax(0, 15rem) minmax(0, 1fr) minmax(0, 12rem) minmax(0, 10rem); gap: 2px 20px; align-items: baseline; background: none; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 12px 0; }
.credits .fbox:last-child { border-bottom: 0; }
.credits .fbox > h3 { grid-column: 1; grid-row: 1 / span 4; font-size: 16px; font-weight: 600; }
.credits .fbox > p { grid-column: 2; font-size: 15px; }
.credits .fbox > p:has(> b) { grid-column: 3; grid-row: 1; color: var(--dim); font-size: 14px; }
.credits .fbox > p:has(> b) b { font-weight: 400; }
.credits .fbox > p:not(.what):has(> a) { grid-column: 4; grid-row: 1; font-size: 14px; }
@media (max-width: 760px) {
  .credits .fbox { grid-template-columns: minmax(0, 1fr); }
  .credits .fbox > h3, .credits .fbox > p, .credits .fbox > p:has(> b), .credits .fbox > p:not(.what):has(> a) { grid-column: 1; grid-row: auto; }
}
.credits .fbox.intro { display: flex; flex-direction: column; gap: 8px; padding: 16px 0; max-width: 80ch; }
.credits .fbox.intro > * { grid-column: auto; grid-row: auto; }
.credits .fbox.intro > h3 { font-size: 18px; }
.credits .fbox.intro > p:has(> b) { color: var(--text); font-size: 15px; }
.credits .fbox.intro > p:has(> b) b { font-weight: 600; }

/* App page: "new in 0.2" strip, cards of equal height, steps folded */
.linkpage .newlist { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); }
.linkpage .newlist li { display: flex; flex-direction: column; gap: 4px; background: var(--tile); border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: var(--radius); padding: 12px 14px; }
.linkpage .newlist b { color: var(--text); font-size: 16px; }
.linkpage .newlist span { color: var(--dim); font-size: 14px; }
.linkpage :is(#features, #funzioni) .fgrid { align-items: stretch; }
.linkpage :is(#features, #funzioni) .fbox { gap: 10px; }
.linkpage .fbox.new { border-color: var(--accent); }
.linkpage .nbadge { display: inline-block; vertical-align: middle; margin-left: 6px; padding: 1px 7px; border-radius: 999px; background: var(--accent); color: #000; font-size: 11px; font-weight: 700; letter-spacing: .04em; }
.linkpage .fshots { grid-template-columns: repeat(auto-fit, minmax(min(100%, 140px), 1fr)); }
.linkpage .fshots img { height: 190px; object-fit: cover; object-position: top; }
.linkpage details.more { margin-top: auto; border-top: 1px solid var(--line); padding-top: 8px; }
.linkpage details.more > summary { cursor: pointer; list-style: none; color: var(--accent); font-weight: 600; font-size: 15px; }
.linkpage details.more > summary::-webkit-details-marker { display: none; }
.linkpage details.more > summary::before { content: "› "; display: inline-block; transition: transform .15s; }
.linkpage details.more[open] > summary::before { transform: rotate(90deg); }
.linkpage details.more > * + * { margin-top: 8px; }
