:root {
  --mat: #4f6b72;          /* ESD bench mat */
  --mat-deep: #3e565c;
  --mat-line: #5c7980;
  --bar: #2e4246;
  --card: rgba(30, 46, 50, .55);
  --card-line: rgba(255, 255, 255, .10);
  --field: #344b51;
  --field-line: rgba(255, 255, 255, .22);
  --body: #25282c;         /* radio plastic */
  --body-hi: #34383d;
  --cap: #31353a;
  --cap-hi: #3d4248;
  --legend: #e9ebef;
  --legend-dim: #9aa3ab;
  --glass: #d6d8e6;
  --amber: #f0a030;
  --amber-ink: #23170a;
  --green: #4ade6b;
  --red: #ff5a48;
  --text: #eef3f4;
  --muted: #b3c5ca;
  --cond: "Barlow Condensed", "Arial Narrow", "Roboto Condensed", sans-serif;
  --sans: "Barlow", system-ui, -apple-system, "Segoe UI", sans-serif;
  --bar-h: 56px;
  --nav-h: 60px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
html { scrollbar-color: #7f9aa0 var(--mat-deep); scrollbar-width: thin; }
html { background: var(--mat); }
body {
  min-height: 100vh;
  font: 400 15px/1.5 var(--sans);
  color: var(--text);
  background:
    linear-gradient(var(--mat-line) 1px, transparent 1px) 0 0 / 40px 40px,
    linear-gradient(90deg, var(--mat-line) 1px, transparent 1px) 0 0 / 40px 40px,
    var(--mat);
}
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--mat-deep); }
::-webkit-scrollbar-thumb { background: #7f9aa0; border-radius: 6px; border: 2px solid var(--mat-deep); }
::-webkit-scrollbar-thumb:hover { background: var(--amber); }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
[hidden] { display: none !important; }
svg { fill: currentColor; }

/* ---- top bar ---- */
.bar {
  position: sticky; top: 0; z-index: 20;
  height: var(--bar-h);
  display: flex; align-items: center; gap: 14px;
  padding: 0 max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left));
  background: color-mix(in srgb, var(--bar) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(0, 0, 0, .25);
  box-shadow: 0 2px 12px rgba(0, 0, 0, .18);
}
.brandmark { display: flex; align-items: center; gap: 8px; white-space: nowrap; border: 0; background: none; padding: 0; color: inherit; cursor: pointer; }
.logo { width: 24px; height: 24px; color: var(--amber); }
.name { font: 600 20px/1 var(--cond); letter-spacing: .02em; }
.name b { color: var(--amber); font-weight: 600; }
.pill {
  display: flex; align-items: center; gap: 8px; min-width: 0;
  padding: 5px 12px; border-radius: 999px;
  background: rgba(0, 0, 0, .22); font-size: 14px; color: var(--muted);
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
.pill #pillText { overflow: hidden; text-overflow: ellipsis; }
.dot { flex: 0 0 auto; width: 8px; height: 8px; border-radius: 50%; background: #7f9aa0; }
.dot.run { background: var(--green); box-shadow: 0 0 6px var(--green); }
.dot.tx { background: var(--red); box-shadow: 0 0 6px var(--red); }
.dot.err { background: var(--amber); }
.dot.pause { background: var(--muted); }
.tools { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.tsep { width: 1px; height: 22px; margin: 0 5px; background: rgba(255, 255, 255, .22); flex: none; }   /* between the screen's buttons and the radio's */

.seg { display: inline-flex; padding: 3px; border-radius: 10px; background: rgba(0, 0, 0, .25); gap: 2px; }
.seg button {
  min-width: 44px; height: 32px; padding: 0 10px; border: 0; border-radius: 7px;
  background: transparent; color: var(--muted); font: 600 15px/1 var(--cond); letter-spacing: .02em;
}
.seg button:hover { color: var(--text); }
.seg button[aria-checked="true"] { background: var(--text); color: var(--bar); }

.icon {
  width: 38px; height: 38px; display: inline-grid; place-items: center;
  border: 1px solid rgba(255, 255, 255, .16); border-radius: 10px; background: rgba(255, 255, 255, .06);
}
.icon svg { width: 20px; height: 20px; }
.icon:hover { border-color: var(--amber); }
.icon[aria-pressed="true"] { background: rgba(240, 160, 48, .18); border-color: var(--amber); color: var(--amber); }
.icon.accent { background: var(--amber); border-color: var(--amber); color: var(--amber-ink); }
.icon.accent:hover { filter: brightness(1.08); }

/* ---- layout ---- */
.bench {
  display: grid;
  grid-template-columns: 410px minmax(0, 560px);
  gap: 40px;
  justify-content: center;
  align-items: start;
  padding: 28px 24px 56px;
}
.radio-col { position: sticky; top: calc(var(--bar-h) + 20px); display: grid; justify-items: center; }

/* ---- the radio ---- */
.radio {
  position: relative;
  width: 360px;
  margin-left: 30px;                       /* room for the side keys */
  padding: 20px 20px 26px;
  border-radius: 34px 34px 46px 46px;
  background: linear-gradient(160deg, var(--body-hi), var(--body) 45%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), inset 0 -6px 14px rgba(0, 0, 0, .35), 0 18px 40px rgba(20, 30, 34, .55);
}
.grille { display: grid; gap: 7px; padding: 6px 54px 14px; }
.grille i { display: block; height: 4px; border-radius: 2px; background: #15171a; box-shadow: 0 1px 0 rgba(255, 255, 255, .05); }
.brand { display: flex; align-items: center; padding: 0 6px 8px; font: 600 13px/1 var(--cond); letter-spacing: .04em; color: var(--legend-dim); }
.brand #brand { color: var(--legend); font-size: 16px; }
.brand .fw { color: var(--amber); }
.leds { display: inline-flex; gap: 6px; margin: 0 10px 0 auto; }
.led { width: 8px; height: 8px; border-radius: 50%; background: #2c2a24; }
.led.tx.on { background: var(--red); box-shadow: 0 0 8px var(--red); }
.led.rx.on { background: var(--green); box-shadow: 0 0 8px var(--green); }
.bezel { padding: 10px; border-radius: 10px; background: #121416; box-shadow: inset 0 2px 6px rgba(0, 0, 0, .7); }
#lcd { display: block; margin: 0 auto; border-radius: 3px; image-rendering: pixelated; transition: filter .25s; }

.keypad { margin-top: 18px; display: grid; gap: 10px; }
.keypad button {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  border: 0; border-radius: 12px;
  background: linear-gradient(var(--cap-hi), var(--cap));
  box-shadow: 0 3px 0 #17191c, inset 0 1px 0 rgba(255, 255, 255, .07);
  color: var(--legend); font: 700 22px/1 var(--cond);
  touch-action: manipulation; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent;
}
.keypad button small { margin-top: 3px; font: 600 10px/1 var(--cond); letter-spacing: .05em; color: var(--amber); }
.keypad button.down { transform: translateY(2px); box-shadow: 0 1px 0 #17191c, inset 0 2px 4px rgba(0, 0, 0, .4); }
.row.fn { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.row.fn button { height: 40px; font-size: 16px; letter-spacing: .04em; }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.grid button { height: 52px; }

/* side keys: attached to the radio's left edge, rounded on the outside */
.side-keys { position: absolute; right: 100%; top: 168px; display: grid; gap: 10px; }
.side {
  width: 22px; height: 46px; padding: 0;
  border: 0; border-radius: 9px 0 0 9px;
  background: linear-gradient(90deg, #1b1d20, var(--body-hi) 70%, var(--body));
  box-shadow: inset 1px 0 0 rgba(255, 255, 255, .08), -2px 2px 4px rgba(0, 0, 0, .35);
  color: var(--legend-dim);
  display: grid; place-items: center;
  touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}
.side span { writing-mode: vertical-rl; transform: rotate(180deg); font: 600 10px/1 var(--cond); letter-spacing: .08em; }
.side.ptt { height: 88px; background: linear-gradient(90deg, #b56d14, var(--amber) 70%); color: var(--amber-ink); }
.side:hover { filter: brightness(1.15); }
.side.down { transform: translateX(2px); box-shadow: inset 2px 0 4px rgba(0, 0, 0, .4); }

.under { margin: 14px 0 0; text-align: center; color: var(--muted); font-size: 13px; min-height: 1.4em; }
.keys-hint { margin: 2px 0 0; max-width: 380px; text-align: center; color: var(--muted); font-size: 12px; opacity: .8; }

/* ---- tabs and cards ---- */
.panel-col { min-width: 0; }
.tabs {
  position: sticky; top: calc(var(--bar-h) + 12px); z-index: 10;
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 3px; padding: 4px;
  border-radius: 14px; background: color-mix(in srgb, var(--bar) 90%, transparent); backdrop-filter: blur(8px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .18);
}
.tabs button {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  height: 40px; border: 0; border-radius: 10px; background: transparent; color: var(--muted);
  font: 600 15px/1 var(--cond); letter-spacing: .02em; padding: 0 4px; min-width: 0;
}
.tabs svg { width: 17px; height: 17px; flex: 0 0 auto; }
.tabs button:hover { color: var(--text); background: rgba(255, 255, 255, .05); }
.tabs button[aria-selected="true"] { background: var(--amber); color: var(--amber-ink); }
.status { margin: 12px 4px 0; padding: 8px 12px; border-radius: 10px; background: rgba(0, 0, 0, .18); font-size: 14px; color: var(--muted); }
.status:empty { display: none; }
.status.bad { color: #ffcf8a; }

.card { margin-top: 14px; padding: 16px 18px 18px; border-radius: 16px; background: var(--card); border: 1px solid var(--card-line); }
.card h2 { margin: 0; font: 600 21px/1.2 var(--cond); letter-spacing: .01em; }
.card h3 { margin: 0; font: 600 16px/1.2 var(--cond); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card-head.sub { margin-top: 16px; }
.hint { margin: 6px 0 0; color: var(--muted); font-size: 13.5px; }
.card > .hint + *, .card > h2 + .form, .card > h2 + .chips { margin-top: 12px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 36px; padding: 6px 14px;
  border: 1px solid var(--field-line); border-radius: 9px; background: rgba(255, 255, 255, .06);
  font-weight: 500; font-size: 14.5px; cursor: pointer; white-space: nowrap;
}
.btn:hover { border-color: var(--amber); }
.btn.accent { background: var(--amber); border-color: var(--amber); color: var(--amber-ink); font-weight: 600; }
.btn.accent:hover { filter: brightness(1.08); }
.btn.danger:hover { border-color: var(--red); color: #ffd2cc; }
.btn.small { min-height: 28px; padding: 2px 10px; font-size: 13px; }
.btn.file { position: relative; overflow: hidden; }
/* the file input stays focusable but invisible: the label is the button, with its cursor */
.btn.file input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.btn.file:focus-within { outline: 2px solid var(--amber); outline-offset: 2px; }
label.btn, .chips button, .seg button, .tabs button, select, input[type=checkbox], input[type=range], label.check, summary { cursor: pointer; }
.row-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

.apps { list-style: none; padding: 0 10px 0 0; margin: 12px 0 0; display: grid; gap: 2px; max-height: 360px; overflow: auto; scrollbar-width: thin; scrollbar-gutter: stable; }   /* a row's highlight stops 10 px before the scrollbar */
.apps li { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 10px; font-size: 14.5px; }
.apps li:hover { background: rgba(255, 255, 255, .05); }
.apps li.running { background: rgba(74, 222, 107, .12); box-shadow: inset 3px 0 0 var(--green); }
.apps .n { width: 22px; color: var(--muted); font-variant-numeric: tabular-nums; text-align: right; }
.apps .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.apps .v { color: var(--muted); font-size: 12.5px; margin-left: 6px; }
.apps .acts { display: flex; gap: 4px; }
.apps .acts button { height: 30px; min-width: 30px; padding: 0 9px; border: 1px solid var(--field-line); border-radius: 8px; background: transparent; font-size: 13px; }
.apps .acts button:hover { border-color: var(--amber); }
.apps .acts .run { background: rgba(240, 160, 48, .16); border-color: rgba(240, 160, 48, .5); color: var(--amber); font-weight: 600; }
.apps .empty { color: var(--muted); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; max-height: 190px; overflow: auto; scrollbar-width: thin; }
.chips button { padding: 4px 11px; border: 1px solid var(--field-line); border-radius: 999px; background: transparent; font-size: 13.5px; }
.chips button:hover { border-color: var(--amber); color: var(--amber); }

.form { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: flex-end; margin-top: 12px; font-size: 14px; }
.form label { display: grid; gap: 4px; color: var(--muted); }
.form .f-wide { flex: 1 1 100%; }
.form label.check, .wide.check { display: flex; gap: 8px; align-items: center; color: var(--text); }
input:not([type]), input[inputmode], select, .wide input {
  height: 36px; padding: 0 10px; border: 1px solid var(--field-line); border-radius: 9px; background: var(--field); color: var(--text);
  width: 10.5em;
}
.f-wide input:not([type=range]):not([type=checkbox]), .f-wide select { width: 100%; }
input:focus, select:focus { border-color: var(--amber); outline: none; }
input[type=range] { width: 100%; accent-color: var(--amber); }
input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--amber); }
.form output, .slider output { color: var(--amber); font-weight: 600; font-variant-numeric: tabular-nums; margin-left: 6px; }
.wide { display: grid; gap: 4px; margin-top: 12px; font-size: 14px; color: var(--muted); }
.wide input { width: 100%; }
.slider { display: block; margin-top: 12px; }
.slider span { display: flex; justify-content: space-between; font-size: 14px; color: var(--muted); }

.table-wrap { overflow-x: auto; margin-top: 10px; }
.mem { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.mem th { text-align: left; color: var(--muted); font-weight: 500; padding: 2px 4px; }
.mem td { padding: 2px 4px; }
.mem input, .mem select { height: 32px; width: 100%; }
.mem td:first-child input { width: 4.5em; }
.mem td:nth-child(2) input { width: 7.5em; }
.mem td:nth-child(4) select { min-width: 6.5em; }
.mem button { height: 30px; width: 30px; border: 1px solid var(--field-line); border-radius: 8px; background: transparent; }
.mem button:hover { border-color: var(--red); }

.signals { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 6px; }
.signals li { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 10px; border-radius: 10px; background: rgba(0, 0, 0, .14); font-size: 14px; }
.signals li.live { box-shadow: inset 3px 0 0 var(--green); }
.signals .nm { flex: 1; min-width: 9em; }
.signals .f { font-variant-numeric: tabular-nums; color: var(--amber); }
.signals .lv { color: var(--muted); font-variant-numeric: tabular-nums; }
.signals button { height: 30px; padding: 0 10px; border: 1px solid var(--field-line); border-radius: 8px; background: transparent; font-size: 13px; }
.signals button:hover { border-color: var(--amber); }
.signals .empty { background: none; color: var(--muted); }

.info { display: grid; grid-template-columns: auto 1fr; gap: 3px 16px; margin: 12px 0 0; font-size: 14px; }
.info dt { color: var(--muted); }
.info dd { margin: 0; overflow-wrap: anywhere; }
.fault { white-space: pre-wrap; font-size: 12px; background: rgba(0, 0, 0, .28); padding: 10px 12px; border-radius: 10px; border-left: 3px solid #ffcf8a; margin: 12px 0 0; }
.log { list-style: none; padding: 0; margin: 8px 0 0; max-height: 260px; overflow: auto; font-size: 12.5px; display: grid; gap: 2px; scrollbar-width: thin; }
.log li { color: var(--muted); }
.log li b { color: var(--text); font-weight: 600; margin-right: 8px; font-variant-numeric: tabular-nums; }
.log li.error b, .log li.flash b { color: #ffcf8a; }
.credits { margin: 18px 4px 0; color: var(--muted); font-size: 12px; }

.drag .radio { box-shadow: 0 0 0 3px var(--amber), 0 18px 40px rgba(20, 30, 34, .55); }

/* ---- tooltips (mouse only) ---- */
.tip {
  position: fixed; z-index: 50; max-width: 260px; pointer-events: none;
  padding: 6px 10px; border-radius: 8px; background: #111a1c; color: var(--text);
  font-size: 12.5px; line-height: 1.35; box-shadow: 0 6px 18px rgba(0, 0, 0, .35);
}

/* ---- narrower screens ---- */
@media (max-width: 1000px) {
  .bench { grid-template-columns: 1fr; gap: 18px; justify-items: center; padding: 18px 12px calc(var(--nav-h) + 28px + env(safe-area-inset-bottom)); }
  .radio-col { position: static; }
  .panel-col { width: 100%; max-width: 560px; }
  .tabs {
    position: fixed; top: auto; bottom: 0; left: 0; right: 0; z-index: 20;
    height: calc(var(--nav-h) + env(safe-area-inset-bottom)); padding: 4px 6px env(safe-area-inset-bottom);
    border-radius: 0; box-shadow: 0 -2px 14px rgba(0, 0, 0, .25);
    background: color-mix(in srgb, var(--bar) 96%, transparent);
  }
  .tabs button { flex-direction: column; gap: 3px; height: 52px; font-size: 13px; }
  .tabs svg { width: 22px; height: 22px; }
  .tabs button[aria-selected="true"] { background: transparent; color: var(--amber); }
  .status { margin-top: 0; margin-bottom: 4px; }
}
@media (max-width: 640px) {
  .bar { gap: 8px; padding: 0 10px; }
  .name { display: none; }
  .pill { flex: 1; padding: 5px 10px; font-size: 13px; }
  .seg button { min-width: 36px; padding: 0 6px; }
  .tsep { margin: 0 1px; }
  .icon { width: 36px; height: 36px; }
  .keys-hint { display: none; }
}
@media (max-width: 420px) {
  .radio { width: calc(100vw - 52px); padding: 16px 14px 20px; margin-left: 26px; }
  .grid button { height: 46px; }
  .side-keys { top: 150px; }
  .pill { display: none; }
  .tools { margin-left: auto; }
}
/* a phone's width: the top bar in two rows (the name and the state, then the buttons), smaller buttons -
   up to v26 the buttons ran 25-85 px past the window's right edge under 444 px */
@media (max-width: 480px) {
  :root { --bar-h: 96px; }
  .bar { height: auto; min-height: var(--bar-h); flex-wrap: wrap; row-gap: 6px; padding-top: 7px; padding-bottom: 7px; }
  .pill { display: inline-flex; flex: 1; }
  .tools { width: 100%; margin-left: 0; justify-content: space-between; gap: 4px; }
  .icon { width: 32px; height: 32px; }
  .seg button { min-width: 30px; padding: 0 4px; }
  .tsep { margin: 0; }
}
@media (prefers-reduced-motion: reduce) { #lcd { transition: none; } }

/* ---- app services ---- */
.badge { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; background: rgba(255, 255, 255, .1); color: var(--muted); white-space: nowrap; }
.card-head .badge { font-weight: 500; }
.svc-tools { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; margin-top: 12px; font-size: 14px; }
.svc-tools input[type=search] { flex: 1 1 14em; width: auto; }
.svc-tools .check { display: flex; gap: 8px; align-items: center; }
.chips.how { margin-top: 10px; max-height: none; }
.chips.how button { display: inline-flex; gap: 6px; align-items: center; }
.chips.how button b { font-weight: 600; color: var(--muted); }
.chips.how button[aria-pressed="true"] { background: var(--text); color: var(--bar); border-color: var(--text); }
.chips.how button[aria-pressed="true"] b { color: var(--bar); }
.svc { margin-top: 12px; max-height: 460px; overflow: auto; scrollbar-width: thin; padding-right: 2px; }
.svc-group h4 { margin: 12px 0 4px; font: 600 14px/1.2 var(--cond); letter-spacing: .04em; color: var(--amber); text-transform: uppercase; }
.svc-group:first-child h4 { margin-top: 0; }
.svc-row { border-radius: 8px; }
.svc-row summary { display: flex; align-items: center; gap: 10px; padding: 5px 8px; border-radius: 8px; list-style: none; }
.svc-row summary::-webkit-details-marker { display: none; }
.svc-row summary:hover { background: rgba(255, 255, 255, .05); }
.svc-row[open] summary { background: rgba(255, 255, 255, .07); }
.svc-row code { font: 500 13.5px/1.3 ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
.svc-row summary code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.svc-row .uses { min-width: 3em; text-align: right; font-variant-numeric: tabular-nums; color: var(--green); font-size: 13px; }
.svc-body { padding: 4px 8px 10px 16px; font-size: 13.5px; border-left: 2px solid rgba(255, 255, 255, .12); margin: 2px 0 6px 8px; }
.svc-body p { margin: 4px 0 0; }
.svc-body .sig { display: block; color: var(--amber); overflow-wrap: anywhere; }
.svc-body .meta { color: var(--muted); font-size: 12.5px; }
.k-fw { background: rgba(110, 168, 255, .18); color: #a9cbff; }
.k-data { background: rgba(170, 140, 255, .18); color: #cdbfff; }
.k-emu { background: rgba(74, 222, 107, .16); color: #8ff0a4; }
.k-idle { background: rgba(255, 255, 255, .1); color: var(--muted); }
.k-none { background: rgba(255, 90, 72, .16); color: #ffb3a8; }
.k-absent { background: rgba(0, 0, 0, .25); color: #8fa4a9; }
.chips.how button.k-fw, .chips.how button.k-data, .chips.how button.k-emu, .chips.how button.k-idle, .chips.how button.k-none, .chips.how button.k-absent { background: transparent; }
.sub-box { margin-top: 14px; padding: 4px 12px 12px; border-radius: 12px; background: rgba(0, 0, 0, .14); }
input[type=search] { height: 36px; padding: 0 10px; border: 1px solid var(--field-line); border-radius: 9px; background: var(--field); color: var(--text); }
input[type=search]:focus { border-color: var(--amber); outline: none; }

/* ---- screen colours ---- */
.bezel { transition: box-shadow .4s; }
.swatches { display: flex; gap: 10px; margin-top: 14px; }
.swatches button {
  width: 30px; height: 22px; border-radius: 6px; border: 2px solid rgba(0, 0, 0, .35);
  background: linear-gradient(135deg, var(--c) 62%, var(--i) 62%);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .3);
}
.swatches button:hover { transform: translateY(-1px); }
.swatches button[aria-checked="true"] { border-color: var(--amber); box-shadow: 0 0 0 2px rgba(240, 160, 48, .35); }

/* ---- developer tools ---- */
.badge.on { background: rgba(74, 222, 107, .16); color: #8ff0a4; }
.icon.rec svg { color: var(--red); }
.icon.rec[aria-pressed="true"] { background: rgba(255, 90, 72, .18); border-color: var(--red); animation: recpulse 1.2s ease-in-out infinite; }
@keyframes recpulse { 50% { box-shadow: 0 0 0 4px rgba(255, 90, 72, .25); } }
.card h3.mt { margin-top: 16px; }
.muted { color: var(--muted); font: 400 13px/1.3 var(--sans); }
.card-head select { width: auto; max-width: 60%; }
.hexcfg { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 6px; margin-top: 8px; max-width: 420px; }
.hexcfg input { width: 100%; height: 32px; padding: 0; text-align: center; font: 500 14px/1 ui-monospace, Menlo, Consolas, monospace; text-transform: uppercase; }
.hexnav { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.hexnav input { width: 8.5em; font-family: ui-monospace, Menlo, Consolas, monospace; }
.hexnav select { width: auto; }
.hexview { margin: 8px 0 0; padding: 10px 12px; border-radius: 10px; background: rgba(0, 0, 0, .28); font: 12px/1.45 ui-monospace, Menlo, Consolas, monospace; overflow-x: auto; white-space: pre; }
.wf-wrap { position: relative; margin-top: 12px; border-radius: 10px; overflow: hidden; background: #08121f; }
#wf { display: block; width: 100%; height: 140px; image-rendering: pixelated; cursor: crosshair; }
.wf-mark { position: absolute; top: 0; bottom: 0; left: 50%; width: 1px; background: rgba(240, 160, 48, .8); pointer-events: none; }
.wf-scale { display: flex; justify-content: space-between; margin-top: 4px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.wf-scale span:nth-child(2) { color: var(--amber); }
.busy { display: flex; align-items: center; gap: 10px; margin-top: 12px; font-size: 14px; color: var(--muted); }
.meter { flex: 1; height: 8px; border-radius: 4px; background: rgba(0, 0, 0, .3); overflow: hidden; }
.meter i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--green), var(--amber)); transition: width .4s; }
.busy b { min-width: 3.5em; text-align: right; color: var(--text); font-variant-numeric: tabular-nums; }
.prof { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 4px; }
.prof li { display: grid; grid-template-columns: minmax(0, 1.6fr) 1fr 4em; gap: 10px; align-items: center; font-size: 13.5px; }
.prof .nm { display: flex; gap: 8px; align-items: center; min-width: 0; }
.prof .nm code { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 500 13px/1.3 ui-monospace, Menlo, Consolas, monospace; }
.prof .bar { height: 8px; border-radius: 4px; background: rgba(0, 0, 0, .25); overflow: hidden; }
.prof .bar i { display: block; height: 100%; background: var(--amber); }
.prof b { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
@media (max-width: 640px) { #rec { display: inline-grid; } .prof li { grid-template-columns: minmax(0, 1fr) 4.5em 4em; } }

/* ---- folding cards and the develop switch ---- */
details.card.fold > summary { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; cursor: pointer; list-style: none; }
details.card.fold > summary::-webkit-details-marker { display: none; }
details.card.fold > summary::after {
  content: ""; margin-left: auto; align-self: center; width: 9px; height: 9px;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform .15s;
}
details.card.fold[open] > summary::after { transform: rotate(-135deg); }
details.card.fold > summary:hover::after { border-color: var(--amber); }
details.card.fold > summary .muted { flex: 1 1 auto; }
details.card.fold:not([open]) { padding-bottom: 16px; }
.switch-row { display: flex; align-items: center; gap: 10px; margin-top: 14px; padding: 10px 12px; border-radius: 10px; background: rgba(0, 0, 0, .14); font-size: 14px; cursor: pointer; }
.switch-row input { flex: 0 0 auto; }
.card.dev .row-btns { margin-top: 14px; }
@media (max-width: 1000px) { .tabs button { font-size: 12px; } }
.panel-col { scroll-margin-top: calc(var(--bar-h) + 8px); }

/* ---- help dialog ---- */
dialog.help { width: min(720px, calc(100vw - 24px)); max-height: calc(100vh - 40px); overflow: auto; padding: 18px 20px 20px; border: 1px solid var(--card-line);
  border-radius: 16px; background: #26393d; color: var(--text); box-shadow: 0 20px 60px rgba(0, 0, 0, .5); }
dialog.help::backdrop { background: rgba(10, 18, 20, .55); backdrop-filter: blur(2px); }
.help-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 28px; margin-top: 8px; }
.help h3 { margin: 12px 0 6px; font: 600 16px/1.2 var(--cond); color: var(--amber); }
.keys { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; margin: 0; font-size: 14px; align-items: center; }
.keys dt { white-space: nowrap; color: var(--muted); }
.keys dd { margin: 0; }
kbd { display: inline-block; min-width: 1.6em; padding: 1px 6px; border-radius: 5px; border: 1px solid var(--field-line); border-bottom-width: 2px;
  background: rgba(255, 255, 255, .06); font: 600 12.5px/1.4 var(--sans); text-align: center; color: var(--text); }
.where { margin: 0; padding-left: 18px; font-size: 14px; display: grid; gap: 4px; color: var(--muted); }
.where b { color: var(--text); font-weight: 600; }
.peers { margin-top: 12px; }
@media (max-width: 640px) { .help-grid { grid-template-columns: 1fr; } #help { display: none; } }
label.off { opacity: .5; }

/* ---- radio number, serial terminal ---- */
.radio-no { margin-left: 4px; background: rgba(240, 160, 48, .18); color: var(--amber); }
.serout { margin: 10px 0 0; height: 170px; overflow: auto; padding: 10px 12px; border-radius: 10px; background: #0f191b; color: #a7f3b5;
  font: 12.5px/1.45 ui-monospace, Menlo, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.serin { display: flex; gap: 8px; margin-top: 8px; }
.serin input { flex: 1; width: auto; font-family: ui-monospace, Menlo, Consolas, monospace; }
.serin select { width: auto; }
.row-btns select { width: auto; height: 28px; font-size: 13px; }
@media (max-width: 640px) { .name { display: none; } .radio-no { display: inline-block; } }
.row-btns .muted { align-self: center; }
.row-btns .muted b { color: var(--text); font-weight: 600; }

/* Add an app: the catalogs (v29) */
.cat-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.cat-head .seg button { padding: 6px 14px; }
#catSearch { flex: 1; min-width: 120px; padding: 7px 10px; border-radius: 10px; border: 1px solid rgba(255, 255, 255, .15); background: rgba(0, 0, 0, .2); color: var(--text); font: inherit; }
.apps.cat { max-height: 420px; }
.apps.cat li { align-items: center; }
.apps.cat .nm { white-space: normal; }
.apps.cat .nm b { font-weight: 600; }
.apps.cat .nm small { display: block; color: var(--muted); font-size: 12.5px; line-height: 1.35; margin-top: 2px; }
.apps.cat .nm small a { color: var(--amber); }
.apps .shot, .cat-preview .shot { image-rendering: pixelated; border-radius: 4px; box-shadow: 0 0 0 3px #1d1f22; display: block; }
.shot-inline { display: block; margin: 8px 0 4px; }
.apps .iconbtn { width: 34px; padding: 0 !important; display: inline-grid; place-items: center; }
.apps .iconbtn svg { width: 18px; height: 18px; fill: currentColor; }
.apps .shotbtn[aria-expanded="true"] { color: var(--amber); border-color: var(--amber); }   /* open: the icon lit, the button as the others */
.cat-preview { position: fixed; z-index: 60; padding: 10px; border-radius: 12px; background: #1d2b30; box-shadow: 0 10px 30px rgba(0, 0, 0, .45); pointer-events: none; }
.cat-preview span { display: block; margin-top: 8px; color: var(--muted); font-size: 13px; text-align: center; }
.apps .tag { font-size: 12px; color: var(--muted); white-space: nowrap; }
@media (max-width: 640px) { #tsep2 { display: none; } .shot-inline .shot { width: 100%; height: auto; } }

/* the version and the repository, always there, quietly (bottom left) */
.ver { position: fixed; left: 12px; bottom: 8px; z-index: 5; font-size: 12px; color: var(--muted); opacity: .55; text-decoration: none; }
.ver:hover, .ver:focus-visible { opacity: 1; color: var(--amber); }
@media (max-width: 640px) { .ver { position: static; display: block; text-align: center; margin: 4px 0 calc(14px + env(safe-area-inset-bottom, 0px)); } }
