/* The toolkit's web pages: rcplug's shared look (ui/rcplug.css) plus what a
   public page needs on top: a header, a home page and the firmware steps. */

/* ---- header and footer */
.site-top {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 10px;
  height: 56px; padding: 0 max(18px, calc((100% - 1080px) / 2 + 28px));
  background: rgba(11, 14, 18, .9); backdrop-filter: saturate(140%) blur(10px); border-bottom: 1px solid var(--border);
}
.brand { display: inline-flex; align-items: center; gap: 9px; color: var(--text); font-size: 15px; text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand .i { width: 22px; height: 22px; color: var(--accent); }
.site-top nav { display: flex; gap: 2px; margin-left: 12px; }
.site-top nav a { padding: 6px 10px; border-radius: var(--radius-sm); color: var(--text-2); font-size: 13.5px; font-weight: 550; text-decoration: none; }
.site-top nav a:hover, .site-top nav a[aria-current="page"] { color: var(--text); background: var(--surface-2); }
.footnote { color: var(--text-3); font-size: 12px; margin: 36px auto 0; text-align: center; max-width: 70ch; }
.footnote a { color: var(--text-2); }
@media (max-width: 560px) { .site-top nav { display: none; } }

/* ---- pages */
.page.narrow { max-width: 760px; }
.lead { color: var(--text-2); margin: 4px 0 12px; }
.card > .lead { margin-top: -4px; }
.narrow > .card + .card { margin-top: 14px; } /* the firmware steps; the home grid has its own gap */
@media (max-width: 640px) { .page { padding: 20px 14px 40px; } }

/* ---- home */
.hero { padding: 36px 0 26px; }
.hero h1 { font-size: clamp(26px, 5vw, 36px); letter-spacing: -.02em; line-height: 1.15; }
.hero .lead { font-size: 16px; max-width: 58ch; margin-top: 10px; }
.tools { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
.tool { display: flex; flex-direction: column; gap: 8px; padding: 18px; color: var(--text); text-decoration: none; transition: border-color .15s var(--ease), transform .15s var(--ease); }
a.tool:hover { text-decoration: none; border-color: rgba(52, 211, 153, .45); transform: translateY(-1px); }
.tool .tile { width: 38px; height: 38px; }
.tool h2 { font-size: 16px; margin-top: 4px; }
.tool p { color: var(--text-2); font-size: 13.5px; margin: 0; flex: 1; }
.tool .go { color: var(--accent); font-weight: 600; font-size: 13.5px; display: inline-flex; align-items: center; gap: 6px; }
.tool.main { border-color: rgba(52, 211, 153, .35); background: linear-gradient(160deg, rgba(52, 211, 153, .08), transparent 60%), var(--surface); }
.path { counter-reset: path; display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin: 0; padding: 0; list-style: none; }
.path li { counter-increment: path; position: relative; padding: 14px 14px 14px 46px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); font-size: 13.5px; color: var(--text-2); }
.path li b { display: block; color: var(--text); font-size: 14px; margin-bottom: 2px; }
.path li::before { content: counter(path); position: absolute; left: 14px; top: 14px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-3); color: var(--text); font-size: 12px; font-weight: 700; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px 22px; margin: 0; padding: 0; list-style: none; font-size: 13.5px; color: var(--text-2); }
.facts li { display: flex; gap: 9px; align-items: flex-start; }
.facts .i { color: var(--accent); flex: none; margin-top: 2px; }

/* ---- firmware steps */
.step .card-head .num { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-size: 13px; font-weight: 700; flex: none; }
.drop {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; margin-top: 14px; padding: 26px 16px;
  border: 1.5px dashed var(--border-2); border-radius: var(--radius); background: var(--bg-2); color: var(--text-2); text-align: center; cursor: pointer;
  transition: border-color .15s var(--ease), background .15s var(--ease);
}
.drop:hover, .drop.over { border-color: rgba(52, 211, 153, .6); background: var(--accent-soft); }
.drop.ok { border-style: solid; border-color: rgba(52, 211, 153, .5); color: var(--text); }
.drop.ok .i { color: var(--accent); }
.drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.drop:has(input:focus-visible) { box-shadow: var(--ring); }
#dropText { overflow-wrap: anywhere; }
.release { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 10px 12px; background: var(--surface-2); border-radius: var(--radius-sm); }
.release .mono { overflow-wrap: anywhere; }
.progress { margin-top: 14px; }
.progress .bar { height: 8px; margin-top: 6px; }
#result { margin-top: 14px; }
#result:empty { display: none; }
textarea.input { height: auto; padding: 9px 11px; resize: vertical; }
.drop.off { opacity: .55; pointer-events: none; }

/* ---- diagnostics */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.stats .stat { padding: 14px 16px; }
.stats .stat .value { font-size: 19px; overflow-wrap: anywhere; }
.prob summary { cursor: pointer; padding: 6px 0; }
.prob pre { margin: 4px 0 10px; }
.chart { width: 100%; height: auto; display: block; }
.chart .grid { stroke: var(--border); stroke-width: 1; }
.chart .axis { fill: var(--text-3); font-size: 10px; font-family: var(--mono); }
.chart polyline { fill: none; stroke-width: 1.8; stroke-linejoin: round; }
.chart .cpu { stroke: var(--info); } .chart .rode { stroke: var(--warn); } .chart .rcplug { stroke: var(--accent); } .chart .ram { stroke: var(--violet); stroke-dasharray: 4 3; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 8px; font-size: 12.5px; color: var(--text-2); }
.legend .item { display: inline-flex; align-items: center; gap: 7px; }
.legend i { width: 14px; height: 3px; border-radius: 2px; }
.legend i.cpu { background: var(--info); } .legend i.rode { background: var(--warn); } .legend i.rcplug { background: var(--accent); } .legend i.ram { background: var(--violet); }
.privrow { padding: 10px 0; border-top: 1px solid var(--border); display: grid; gap: 6px; }
.privrow:first-child { border-top: 0; padding-top: 0; }
.files { display: grid; grid-template-columns: minmax(200px, 300px) minmax(0, 1fr); gap: 14px; }
.filelist { display: flex; flex-direction: column; max-height: 520px; overflow: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 4px; }
.fileitem { display: flex; justify-content: space-between; gap: 10px; padding: 5px 8px; border: 0; border-radius: 6px; background: none; color: var(--text-2); text-align: left; cursor: pointer; font-size: 12px; }
.fileitem:hover { background: var(--surface-2); color: var(--text); }
.fileitem[aria-selected="true"] { background: var(--accent-soft); color: var(--text); }
.fileitem .mono { overflow-wrap: anywhere; }
.fileview { display: grid; gap: 8px; min-width: 0; align-content: start; }
.fileview .logs { max-height: 480px; min-height: 120px; }
@media (max-width: 720px) { .files { grid-template-columns: minmax(0, 1fr); } .filelist { max-height: 200px; } }

/* a preview build (sitegen -preview) */
.preview-banner { padding: 8px max(18px, calc((100% - 1080px) / 2 + 28px)); background: var(--warn-soft); border-bottom: 1px solid rgba(245, 176, 65, .4); color: var(--text); font-size: 12.5px; }
.preview-banner a { color: var(--warn); }

/* ---- flashing in the browser (firmware page, step 4) */
.flashbox { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }
.flashbox h3 { font-size: 15px; }
.fsteps { list-style: none; padding: 0; margin: 12px 0; display: grid; gap: 10px; counter-reset: fstep; }
.fsteps > li { counter-increment: fstep; position: relative; display: grid; gap: 8px; justify-items: start; padding: 12px 14px 12px 46px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-2); opacity: .55; transition: opacity .2s var(--ease), border-color .2s var(--ease); }
.fsteps > li > * { max-width: 100%; }
.fsteps > li::before { content: counter(fstep, lower-alpha); position: absolute; left: 14px; top: 12px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-3); color: var(--text); font-size: 12px; font-weight: 700; }
.fsteps > li.active { opacity: 1; border-color: rgba(52, 211, 153, .45); }
.fsteps > li.done { opacity: .85; }
.fsteps > li.done::before { content: "✓"; background: var(--accent-soft); color: var(--accent); }
.fsteps .progress, .fsteps .banner, .fsteps .kv { width: 100%; margin: 0; }
.checklist { margin: 0; padding-left: 18px; color: var(--text-2); font-size: 13px; display: grid; gap: 4px; }
.checklist code { overflow-wrap: anywhere; }
.btn.file { position: relative; overflow: hidden; }
.btn.file input { position: absolute; opacity: 0; width: 1px; height: 1px; }
#fLog { max-height: 240px; margin-top: 8px; }
