/* prtvprtl palette — generated by build.py. VS Code Dark/Light Modern. */

:root{--ptv-h:56px;--ptv-r:6px;
 --ptv-font:system-ui,"Segoe UI",Roboto,Ubuntu,sans-serif;
 --ptv-mono:ui-monospace,"Cascadia Mono",Consolas,"Liberation Mono",monospace}

/* The second selector lets the bar pin its own tokens: on a tool that has not
   been converted yet, the bar matches the page it sits on rather than the
   user's global preference, so you never get a white bar over a dark tool. */
:root[data-ptv-theme="dark"],
.ptv-nav[data-ptv-on="dark"],.ptv-scrim[data-ptv-on="dark"]{color-scheme:dark;
 --ptv-bg:#1f1f1f;--ptv-sunken:#181818;--ptv-raised:#252526;--ptv-chrome:#181818;
 --ptv-hover:#2a2d2e;--ptv-border:#2b2b2b;--ptv-border-2:#3c3c3c;
 --ptv-fg:#cccccc;--ptv-fg-strong:#e7e7e7;--ptv-fg-dim:#9d9d9d;--ptv-fg-faint:#7a7a7a;
 --ptv-acc:#4ec9b0;--ptv-acc-fg:#0d2b25;--ptv-acc-soft:rgba(78,201,176,.15);
 --ptv-s2:#ce9178;--ptv-s3:#dcdcaa;--ptv-s4:#c586c0;--ptv-s5:#b5cea8;--ptv-s6:#569cd6;
 --ptv-ok:#89d185;--ptv-warn:#cca700;--ptv-err:#f14c4c;
 --ptv-ok-soft:rgba(137,209,133,.15);--ptv-warn-soft:rgba(204,167,0,.15);
 --ptv-err-soft:rgba(241,76,76,.15);--ptv-s4-soft:rgba(197,134,192,.16);
 --ptv-s6-soft:rgba(86,156,214,.16);
 --ptv-scrim:rgba(0,0,0,.66);--ptv-shadow:0 12px 32px rgba(0,0,0,.5)}

:root[data-ptv-theme="light"],
.ptv-nav[data-ptv-on="light"],.ptv-scrim[data-ptv-on="light"]{color-scheme:light;
 --ptv-bg:#ffffff;--ptv-sunken:#f8f8f8;--ptv-raised:#ffffff;--ptv-chrome:#f8f8f8;
 --ptv-hover:#e8e8e8;--ptv-border:#e5e5e5;--ptv-border-2:#cecece;
 --ptv-fg:#3b3b3b;--ptv-fg-strong:#1f1f1f;--ptv-fg-dim:#616161;--ptv-fg-faint:#8b8b8b;
 --ptv-acc:#267f99;--ptv-acc-fg:#ffffff;--ptv-acc-soft:rgba(38,127,153,.13);
 --ptv-s2:#a31515;--ptv-s3:#795e26;--ptv-s4:#af00db;--ptv-s5:#098658;--ptv-s6:#0451a5;
 /* warn is #795e26, not the brighter #bf8803: amber-on-amber-tint measured
    2.68:1 as chip text. This is VS Code Light+'s own gold and reads 5.1:1. */
 --ptv-ok:#16825d;--ptv-warn:#795e26;--ptv-err:#cd3131;
 --ptv-ok-soft:rgba(22,130,93,.13);--ptv-warn-soft:rgba(191,136,3,.18);
 --ptv-err-soft:rgba(205,49,49,.11);--ptv-s4-soft:rgba(175,0,219,.10);
 --ptv-s6-soft:rgba(4,81,165,.10);
 --ptv-scrim:rgba(0,0,0,.35);--ptv-shadow:0 12px 32px rgba(0,0,0,.16)}

:where(html[data-ptv-adopt]) body{
 background:var(--ptv-bg);color:var(--ptv-fg);font-family:var(--ptv-font)}
:where(html[data-ptv-adopt]) h1,
:where(html[data-ptv-adopt]) h2,
:where(html[data-ptv-adopt]) h3,
:where(html[data-ptv-adopt]) h4,
:where(html[data-ptv-adopt]) h5,
:where(html[data-ptv-adopt]) h6{color:var(--ptv-fg-strong)}
:where(html[data-ptv-adopt]) a{color:var(--ptv-acc)}
:where(html[data-ptv-adopt]) input,
:where(html[data-ptv-adopt]) select,
:where(html[data-ptv-adopt]) textarea{
 background:var(--ptv-sunken);color:var(--ptv-fg);
 border:1px solid var(--ptv-border-2);border-radius:var(--ptv-r)}
:where(html[data-ptv-adopt]) input:focus-visible,
:where(html[data-ptv-adopt]) select:focus-visible,
:where(html[data-ptv-adopt]) textarea:focus-visible,
:where(html[data-ptv-adopt]) button:focus-visible{
 outline:2px solid var(--ptv-acc);outline-offset:1px}
:where(html[data-ptv-adopt]) button{
 background:var(--ptv-sunken);color:var(--ptv-fg);cursor:pointer;
 border:1px solid var(--ptv-border-2);border-radius:var(--ptv-r);font-family:inherit}
:where(html[data-ptv-adopt]) button:hover{
 background:var(--ptv-hover);border-color:var(--ptv-acc)}
:where(html[data-ptv-adopt]) th,
:where(html[data-ptv-adopt]) td{border-color:var(--ptv-border)}
:where(html[data-ptv-adopt]) th{
 background:var(--ptv-sunken);color:var(--ptv-fg-strong)}
:where(html[data-ptv-adopt]) pre,
:where(html[data-ptv-adopt]) code,
:where(html[data-ptv-adopt]) kbd,
:where(html[data-ptv-adopt]) samp{font-family:var(--ptv-mono)}
:where(html[data-ptv-adopt]) pre,
:where(html[data-ptv-adopt]) code{
 background:var(--ptv-sunken);color:var(--ptv-s2);border-radius:4px}
:where(html[data-ptv-adopt]) hr{
 border:0;border-top:1px solid var(--ptv-border)}
:where(html[data-ptv-theme]) ::selection{background:var(--ptv-acc);color:var(--ptv-acc-fg)}
:where(html[data-ptv-theme]) *{scrollbar-color:var(--ptv-border-2) transparent}

/* ---- phones ------------------------------------------------------------
   These tools were all built at desktop width. Measured at 390px: the
   Coding Reference put a 255px sidebar next to a 135px main pane, B8 Wiring
   left 90px for its content, and three tools scrolled the whole page
   sideways. Everything here is about width, not decoration.

   Not wrapped in :where() on purpose — these have to beat the tools' own
   layout rules, which is the entire point. */
@media (max-width: 820px) {
  /* A control under 16px makes iOS zoom the page the moment you tap it, and
     it never zooms back. This one line is most of "usable on a phone".

     It needs !important: several tools set the size inline (DCC's XML box is
     style="font-size:.68rem") or on a more specific selector, and both beat a
     plain rule here, so the fix silently did nothing on exactly the tools that
     needed it. This is a device-behaviour fix, not a style preference.

     The type exclusions matter — a range slider or colour swatch has no text,
     and forcing 16px on them changes their track and swatch size for nothing. */
  html[data-ptv-theme] input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]):not([type=file]):not([type=submit]):not([type=button]),
  html[data-ptv-theme] select,
  html[data-ptv-theme] textarea { font-size: 16px !important }

  /* A 26px button is a miss as often as a hit with a thumb. Only raises the
     short ones; anything already taller is untouched. */
  html[data-ptv-theme] button,
  html[data-ptv-theme] input[type=submit],
  html[data-ptv-theme] input[type=button] { min-height: 34px }

  /* A bare text link that is a list item's only child is a navigation target
     dressed as prose: 17px tall, because that is its line box. Padding it out
     is free on a phone and never reaches desktop. Scoped to :only-child so it
     cannot touch links that sit inside a sentence. */
  html[data-ptv-theme] li > a:only-child { display: inline-block; padding: 7px 4px }

  /* Sidebar-beside-content becomes sidebar-above-content. Every tool that
     does this uses the same aside+main inside .wrap. */
  html[data-ptv-theme] .wrap { flex-direction: column }
  /* six tabs do not fit on a phone; wrapping beats a hidden scrollbar */
  html[data-ptv-theme] .tabs { flex-wrap: wrap }
  html[data-ptv-theme] .wrap > aside,
  html[data-ptv-theme] .wrap > main { width: auto; max-width: 100%; min-width: 0 }
  html[data-ptv-theme] .wrap > aside { max-height: 42vh; overflow: auto;
    border-right: 0; border-bottom: 1px solid var(--ptv-border) }

  /* A table wider than the screen should scroll itself rather than drag the
     page with it, which is what left the toolbar half off-screen. */
  html[data-ptv-theme] table { display: block; overflow-x: auto; max-width: 100% }
  /* A select is as wide as its longest option, which on a phone is routinely
     wider than the screen. min-width:0 is the half that matters inside a flex
     row — without it the select refuses to shrink below its intrinsic width
     and drags the whole row off-screen. */
  html[data-ptv-theme] select { max-width: 100%; min-width: 0 }

  /* Stray fixed-width media */
  html[data-ptv-theme] img,
  html[data-ptv-theme] svg,
  html[data-ptv-theme] canvas,
  html[data-ptv-theme] pre { max-width: 100% }
}

/* ---- RE notes ----------------------------------------------------------
   Reverse-engineering commentary — where a byte came from, which firmware it
   was read out of, what is still a guess. Useful when working on the tool,
   noise for someone who just wants to convert a dataset.

   Hidden unless the reader turns them on with the 🔬 button beside the theme
   button. !important because a tool's own stylesheet is more specific than
   this one and the failure this guards against is one-directional: notes
   leaking to a normal user is the bad outcome, notes staying hidden from
   their author is a shrug.

   This is presentation, not secrecy. The text is still in the page source.
   Anything that must not ship must not be written into the file. */
html:not([data-ptv-re]) .ptv-re { display: none !important }
