/* beats.css · the LIVE beats viewer, the settings cog and panel, and the SIM badge. */
#cog:hover, #cog.on { opacity: 1; color: var(--cyan); border-color: var(--cyan); }
#settings {
        position: fixed;
        top: calc(7 * var(--sh) / 100);
        right: calc(2 * var(--sw) / 100);
        z-index: 60;
        width: min(30rem, calc(42 * var(--sw) / 100));
        display: none;
        flex-direction: column;
        gap: calc(1.4 * var(--sh) / 100);
        padding: calc(2.4 * var(--sh) / 100) calc(1.6 * var(--sw) / 100);
        border: 1px solid var(--line);
        border-radius: 14px;
        background: color-mix(in srgb, var(--bg1) 96.8627%, transparent);
        backdrop-filter: blur(8px);
        box-shadow: 0 calc(1.6 * var(--sh) / 100) calc(4 * var(--sh) / 100) rgba(0, 0, 0, 0.55);
    }
#settings.on { display: flex; }
#settings h3 { font-family: var(--mono); font-size: clamp(13px, calc(1.15 * var(--sw) / 100), 16px); font-weight: 600; letter-spacing: 0.28em; text-transform: uppercase; color: var(--gold); }
#settings label { display: flex; flex-direction: column; gap: calc(0.5 * var(--sh) / 100); font-family: var(--mono); font-size: clamp(12px, calc(1.05 * var(--sw) / 100), 15px); color: var(--faint); letter-spacing: 0.06em; }
#settings input[type="text"] {
        font-family: var(--mono);
        font-size: clamp(13px, calc(1.1 * var(--sw) / 100), 16px);
        color: var(--ink);
        background: var(--panel);
        border: 1px solid var(--line);
        border-radius: 6px;
        padding: 0.55em 0.7em;
    }
#settings input[type="text"]:focus { outline: none; border-color: var(--cyan); }
#settings label.scheck { flex-direction: row; align-items: center; gap: 0.7em; color: var(--mut); }
#settings label.scheck input { accent-color: var(--cyan); width: 1em; height: 1em; }
#settings .srow { display: flex; align-items: center; gap: 0.9em; }
#settings button {
        font-family: var(--mono);
        font-size: clamp(12px, calc(1.05 * var(--sw) / 100), 15px);
        letter-spacing: 0.1em;
        color: var(--void);
        background: var(--cyan);
        border: 0;
        border-radius: 4px;
        padding: 0.5em 0.9em;
        cursor: pointer;
    }
#settings { max-height: calc(86 * var(--sh) / 100); overflow-y: auto; }
#settings .shead { display: flex; align-items: center; justify-content: space-between; }
#settings .shead .sclose { color: var(--mut); background: transparent; border: 1px solid var(--line); border-radius: 999px; padding: 0.2em 0.6em; letter-spacing: 0; }
#settings .shead .sclose:hover { color: var(--ink); border-color: var(--cyan); }
#settings h4 { font-family: var(--mono); font-size: clamp(11px, calc(0.95 * var(--sw) / 100), 14px); font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase; color: var(--faint); margin: 0 0 0.3em 0.6em; }
#settings .controls { display: flex; flex-direction: column; gap: calc(1.6 * var(--sh) / 100); }
#settings .controls .cgroup { display: flex; flex-direction: column; gap: 1px; }
#settings .controls .cgroup + .cgroup { border-top: 1px solid var(--line); padding-top: calc(1.2 * var(--sh) / 100); }
#settings .controls .ctl { display: flex; align-items: center; gap: 0.8em; width: 100%; text-align: left; font-family: var(--sans, system-ui, sans-serif); font-size: clamp(12px, calc(1.05 * var(--sw) / 100), 15px); letter-spacing: 0; color: var(--ink); background: transparent; border: 1px solid transparent; border-radius: 8px; padding: 0.45em 0.6em; }
#settings .controls button.ctl { cursor: pointer; }
#settings .controls button.ctl:hover, #settings .controls button.ctl:focus-visible { border-color: var(--line); background: color-mix(in srgb, var(--ink) 4%, transparent); outline: none; }
#settings .controls .cname { flex: 1; display: flex; flex-direction: column; gap: 0.1em; }
#settings .controls .cname small { color: var(--faint); font-size: 0.82em; }
#settings .controls kbd { font-family: var(--mono); font-size: 0.85em; color: var(--cyan); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; padding: 0.05em 0.45em; min-width: 1.4em; text-align: center; white-space: nowrap; }
#settings .controls .sw { flex: none; position: relative; width: 2.2em; height: 1.25em; border-radius: 999px; background: var(--line); transition: background 150ms; }
#settings .controls .sw::after { content: ""; position: absolute; top: 0.175em; left: 0.175em; width: 0.9em; height: 0.9em; border-radius: 50%; background: var(--mut); transition: transform 150ms, background 150ms; }
#settings .controls .sw.on { background: color-mix(in srgb, var(--green) 38%, transparent); }
#settings .controls .sw.on::after { transform: translateX(0.95em); background: var(--green); }
#settings .controls .choice { cursor: default; }
#settings .controls .seg { display: inline-flex; gap: 2px; padding: 2px; border: 1px solid var(--line); border-radius: 999px; }
#settings .controls .seg .opt { font: inherit; letter-spacing: 0; color: var(--mut); background: transparent; border: 0; border-radius: 999px; padding: 0.25em 0.85em; cursor: pointer; }
#settings .controls .seg .opt:hover { color: var(--ink); }
#settings .controls .seg .opt.on { color: var(--void); background: var(--cyan); }
#settings .controls .ckeys { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.35em 1em; padding: 0 0.6em; }
#settings .controls .ckey { display: flex; align-items: center; gap: 0.6em; font-size: clamp(11px, calc(0.95 * var(--sw) / 100), 14px); color: var(--mut); }
/* the theme button beside the cog, and its menu; then one corner icon per command that declares one,
   each a slot further left */
#themebtn, .cornerbtn {
        position: fixed;
        top: calc(2.2 * var(--sh) / 100);
        right: calc(2 * var(--sw) / 100 + 3em * var(--slot, 1));
        z-index: 60;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 0;
        width: 2.4em;
        height: 2.4em;
        font-size: clamp(13px, calc(1.15 * var(--sw) / 100), 17px);
        line-height: 1;
        border-radius: 999px;
        border: 1px solid var(--line);
        background: var(--panel);
        color: var(--mut);
        cursor: pointer;
        opacity: 0.35;
        transition: opacity 150ms, color 150ms, border-color 150ms;
    }
#themebtn:hover, #themebtn.on, .cornerbtn:hover, .cornerbtn.on { opacity: 1; color: var(--gold); border-color: var(--gold); }
.cornerbtn svg { width: 1.1em; height: 1.1em; }
body:has(.appframe.open) #themebtn, body:has(.appframe.open) .cornerbtn { opacity: 0; pointer-events: none; }
#themepop {
        position: fixed;
        top: calc(2.2 * var(--sh) / 100 + 3em);
        right: calc(2 * var(--sw) / 100 + 3em);
        z-index: 61;
        display: none;
        flex-direction: column;
        gap: 2px;
        min-width: 11em;
        padding: 0.6em;
        font-size: clamp(13px, calc(1.15 * var(--sw) / 100), 17px);
        border: 1px solid var(--line);
        border-radius: 12px;
        background: color-mix(in srgb, var(--bg1) 96.8627%, transparent);
        backdrop-filter: blur(8px);
        box-shadow: 0 calc(1.6 * var(--sh) / 100) calc(4 * var(--sh) / 100) rgba(0, 0, 0, 0.55);
    }
#themepop.on { display: flex; }
#themepop h4 { font-family: var(--mono); font-size: 0.72em; font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase; color: var(--faint); margin: 0.1em 0.4em 0.3em; }
#themepop button { display: flex; align-items: center; gap: 0.7em; font: inherit; font-size: 0.9em; color: var(--ink); background: transparent; border: 1px solid transparent; border-radius: 8px; padding: 0.4em 0.5em; cursor: pointer; text-align: left; }
#themepop button:hover { border-color: var(--line); }
#themepop button.on { border-color: var(--gold); }
#themepop .dot { width: 1.2em; height: 1.2em; border-radius: 50%; border: 1px solid; flex: none; }
#themepop .tkey { font-family: var(--mono); font-size: 0.72em; color: var(--faint); margin: 0.4em 0.4em 0.1em; }
#themepop kbd { color: var(--cyan); border: 1px solid var(--line); border-radius: 4px; padding: 0 0.35em; }
#settings .local { display: flex; flex-direction: column; gap: calc(1.4 * var(--sh) / 100); }
#settings .status { font-family: var(--mono); font-size: clamp(12px, calc(1.05 * var(--sw) / 100), 15px); color: var(--faint); }
#settings .status.ok { color: var(--green); }
#settings .status.bad { color: var(--red); }
#settings .snote { font-family: var(--mono); font-size: clamp(11px, calc(0.95 * var(--sw) / 100), 14px); color: var(--faint); line-height: 1.5; }
#viewer.on { display: flex; }
#viewer .vwrap {
        display: flex;
        flex-direction: column;
        width: min(calc(92 * var(--sw) / 100), 88rem);
        max-height: calc(88 * var(--sh) / 100);
        border: 1px solid var(--line);
        border-radius: 14px;
        background: var(--void);
        overflow: hidden;
    }
#viewer header {
        display: flex;
        align-items: center;
        gap: 0.8em;
        padding: calc(1.4 * var(--sh) / 100) calc(1.2 * var(--sw) / 100);
        border-bottom: 1px solid var(--line);
        background: var(--panel);
    }
#viewer .vname { font-family: var(--mono); font-size: clamp(13px, calc(1.2 * var(--sw) / 100), 18px); color: var(--ink); }
#viewer .vmeta { font-family: var(--mono); font-size: clamp(11px, calc(0.95 * var(--sw) / 100), 14px); color: var(--faint); letter-spacing: 0.14em; text-transform: uppercase; }
#viewer .vspace { flex: 1; }
#viewer button {
        font-family: var(--mono);
        font-size: clamp(11px, calc(1 * var(--sw) / 100), 14px);
        letter-spacing: 0.1em;
        color: var(--mut);
        background: transparent;
        border: 1px solid var(--line);
        border-radius: 4px;
        padding: 0.42em 0.8em;
        cursor: pointer;
        transition: color 150ms, border-color 150ms;
    }
#viewer button:hover { color: var(--cyan); border-color: var(--cyan); }
#viewer button.primary { color: var(--void); background: var(--gold); border-color: var(--gold); }
#viewer .vbody {
        margin: 0;
        padding: calc(1.8 * var(--sh) / 100) calc(1.2 * var(--sw) / 100);
        overflow: auto;
        font-family: var(--mono);
        font-size: clamp(12px, calc(1.05 * var(--sw) / 100), 16px);
        line-height: 1.62;
        color: var(--ink);
        tab-size: 4;
    }
#viewer .vline { display: flex; gap: 1.2em; white-space: pre; }
#viewer.wrap .vline { white-space: pre-wrap; word-break: break-word; }
#viewer .vline .no { flex: 0 0 3.2em; text-align: right; color: color-mix(in srgb, var(--faint) 60%, transparent); user-select: none; }
#viewer .vline.hit { background: var(--gold-soft); }
#viewer .vline.hit .no { color: var(--gold); }
#viewer .vfoot { padding: calc(1.2 * var(--sh) / 100) calc(1.2 * var(--sw) / 100); border-top: 1px solid var(--line); font-family: var(--mono); font-size: clamp(11px, calc(0.95 * var(--sw) / 100), 14px); color: var(--faint); line-height: 1.55; }
#viewer .t-c { color: var(--faint); }
#viewer .t-s { color: var(--green); }
#viewer .t-k { color: var(--cyan); }
#viewer .t-n { color: var(--gold); }
#viewer .t-h { color: var(--gold); font-weight: 600; }
