/* =========================================================================
   IQ Pong - "Court" theme
   Dark, phone-first skin over the Bootstrap 3 + jQuery UI markup used by
   the robot partials. Change the look here; the robot scripts never need to.
   ========================================================================= */

:root {
    --court-bg: #0E1A24;
    --court-bg-deep: #0B151D;
    --court-surface: #15263A;
    --court-surface-2: #1B3049;
    --court-line: #2C4560;
    --court-table: #1F5F8B;
    --court-text: #E8EEF3;
    --court-muted: #9FB1C1;
    --court-soft: #B9C8D6;
    --court-accent: #F28C28;        /* ball orange */
    --court-accent-ink: #1A0E02;    /* text on accent */
    --court-ok: #4CC38A;
    --court-danger: #E25B5B;
    --court-danger-text: #FF8A8A;
    --court-in: #7FD3A8;            /* terminal: from robot */
    --court-out: #9CC3F5;           /* terminal: to robot */
    --court-radius: 14px;
    --court-bar-h: 84px;
}

/* ---------- base ---------- */
html, body {
    background: var(--court-bg);
    color: var(--court-text);
}
body {
    font-family: Barlow, "Segoe UI", sans-serif;
    font-size: 15px;
    line-height: 1.45;
    padding-bottom: calc(var(--court-bar-h) + env(safe-area-inset-bottom));
}
h1, h2, h3, h4 {
    font-family: "Barlow Condensed", Barlow, sans-serif;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--court-text);
}
h3 { font-size: 22px; margin: 18px 0 12px; }
h4 { font-size: 18px; }
a { color: #F5A04F; }
a:hover, a:focus { color: #FFC48A; }
hr { border-top-color: var(--court-line); }
::selection { background: var(--court-accent); color: var(--court-accent-ink); }

/* ---------- header ---------- */
.court-header {
    position: sticky;
    top: 0;
    z-index: 1030;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px 8px;
    background: var(--court-bg);
}
.court-brand {
    font-family: "Barlow Condensed", sans-serif;
    font-weight: 700;
    font-size: 26px;
    letter-spacing: 0.04em;
    color: var(--court-text);
    text-decoration: none;
}
.court-brand:hover, .court-brand:focus { color: var(--court-text); text-decoration: none; }
.court-brand span { color: var(--court-accent); }

.court-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 999px;
    background: var(--court-surface);
    color: var(--court-soft);
    font-size: 13px;
    white-space: nowrap;
}
.court-dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--court-muted);
}
.court-status.is-connected .court-dot { background: var(--court-ok); }
.court-temp[hidden] { display: none; }

/* ---------- section tabs ---------- */
.court-tabs {
    position: sticky;
    top: 58px;
    z-index: 1029;
    display: flex;
    gap: 6px;
    padding: 4px 16px 10px;
    background: var(--court-bg);
}
.court-tabs a {
    flex: 1;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    color: var(--court-muted);
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
}
.court-tabs a:hover, .court-tabs a:focus { color: var(--court-text); text-decoration: none; background: var(--court-surface); }
.court-tabs a.active { background: var(--court-surface-2); color: #FFFFFF; }

/* ---------- main ---------- */
.court-main {
    max-width: 960px;
    margin: 0 auto;
    padding: 4px 16px 24px;
}
#maintabs > #tabs > section { padding-bottom: 8px; }

/* ---------- Feed / Stop bar ---------- */
.court-actionbar {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 1040;
    display: flex;
    gap: 10px;
    padding: 12px 16px calc(14px + env(safe-area-inset-bottom));
    background: var(--court-bg-deep);
    border-top: 1px solid var(--court-surface-2);
}
.court-actionbar button {
    height: 56px;
    border-radius: var(--court-radius);
    font-family: "Barlow Condensed", sans-serif;
    font-weight: 700;
    font-size: 22px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}
.court-feed {
    flex: 1;
    border: 0;
    background: var(--court-accent);
    color: var(--court-accent-ink);
}
.court-feed:disabled { opacity: 0.4; }
.court-stop {
    width: 110px;
    border: 2px solid var(--court-danger);
    background: transparent;
    color: var(--court-danger-text);
}
@media (min-width: 768px) {
    .court-actionbar { justify-content: center; }
    .court-feed { flex: 0 1 420px; }
}

/* ---------- Bootstrap 3 re-skin ---------- */
.well, .panel, .panel-default, .jarviswidget {
    background: var(--court-surface);
    border: 1px solid var(--court-line);
    border-radius: var(--court-radius);
    box-shadow: none;
    color: var(--court-text);
}
.well-light { background: var(--court-surface); }
.panel-default > .panel-heading {
    background: var(--court-surface-2);
    border-color: var(--court-line);
    color: var(--court-text);
    border-radius: var(--court-radius) var(--court-radius) 0 0;
}
.panel-group .panel + .panel { margin-top: 8px; }
.panel-group .panel-heading + .panel-collapse > .panel-body { border-top-color: var(--court-line); }
.panel-title > a { display: block; color: var(--court-text); text-decoration: none; min-height: 28px; }
.jarviswidget > header {
    padding: 12px 16px 0;
}
.jarviswidget > header h2 { margin: 0; font-size: 22px; }
.widget-body { padding: 8px 16px 16px; }

.form-control {
    background: var(--court-bg-deep);
    border: 1px solid var(--court-line);
    color: var(--court-text);
    border-radius: 10px;
    height: 44px;
    box-shadow: none;
}
.form-control:focus {
    border-color: var(--court-accent);
    box-shadow: 0 0 0 3px rgba(242, 140, 40, 0.25);
}
select.form-control option { background: var(--court-bg-deep); color: var(--court-text); }
.form-control[disabled], .form-control[readonly] { background: var(--court-surface); color: var(--court-muted); }
.control-label, label { color: var(--court-soft); font-weight: 500; }
textarea.form-control { height: auto; }

.btn {
    min-height: 44px;
    border-radius: 12px;
    font-weight: 600;
    padding: 10px 16px;
    margin: 2px 4px 6px 0;
}
.btn-primary {
    background: var(--court-accent);
    border-color: var(--court-accent);
    color: var(--court-accent-ink);
}
.btn-primary:hover, .btn-primary:focus, .btn-primary:active, .btn-primary.active {
    background: #FFA24A;
    border-color: #FFA24A;
    color: var(--court-accent-ink);
}
.btn-default {
    background: var(--court-surface-2);
    border-color: var(--court-line);
    color: var(--court-text);
}
.btn-default:hover, .btn-default:focus { background: #23405F; color: #FFFFFF; border-color: var(--court-line); }
.btn-danger {
    background: transparent;
    border: 2px solid var(--court-danger);
    color: var(--court-danger-text);
}
.btn-danger:hover, .btn-danger:focus { background: rgba(226, 91, 91, 0.15); color: #FFB0B0; border-color: var(--court-danger); }
.btn[disabled], .btn.disabled { opacity: 0.4; }

/* the round -/+ buttons beside every slider */
.btn-circle, .btn-blue {
    width: 40px;
    height: 40px;
    min-height: 40px;
    padding: 0;
    margin: 0;
    border-radius: 50%;
    border: 1px solid var(--court-line);
    background: var(--court-surface-2);
    color: var(--court-text);
    font-size: 20px;
    line-height: 38px;
    text-align: center;
}
.btn-circle:hover, .btn-blue:hover { background: #23405F; color: #FFFFFF; }

.table { color: var(--court-text); background: transparent; }
.table > thead > tr > th {
    color: var(--court-muted);
    border-bottom: 1px solid var(--court-line);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.table > tbody > tr > td, .table > tbody > tr > th { border-top: 1px solid var(--court-surface-2); vertical-align: middle; }
.table-bordered, .table-bordered > thead > tr > th, .table-bordered > tbody > tr > td { border-color: var(--court-surface-2); }
.table-striped > tbody > tr:nth-of-type(odd) { background: rgba(255, 255, 255, 0.03); }
.table > tbody > tr.active > td, .table > tbody > tr.info > td, .table > tbody > tr.success > td {
    background: rgba(242, 140, 40, 0.16);
}
.table-hover > tbody > tr:hover { background: rgba(255, 255, 255, 0.05); }
.table-responsive { border: 0; }

/* plain checkboxes / radios (SmartAdmin's custom ones are gone) */
input.checkbox, input.radiobox {
    display: inline-block;
    position: static;
    width: 20px;
    height: 20px;
    margin: 0 8px 0 0;
    vertical-align: middle;
    accent-color: var(--court-accent);
}
.radio-inline, label > span { color: var(--court-soft); }

/* ---------- bootstrap wizard (drills) ---------- */
.bootstrapWizard {
    display: flex;
    gap: 6px;
    list-style: none;
    padding: 0;
    margin: 0 0 16px;
}
.bootstrapWizard > li { flex: 1; }
.bootstrapWizard > li > a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 4px;
    border-radius: 10px;
    color: var(--court-muted);
    text-decoration: none;
}
.bootstrapWizard .step {
    width: 32px; height: 32px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--court-surface-2);
    border: 1px solid var(--court-line);
    font-family: "Barlow Condensed", sans-serif;
    font-weight: 700;
    font-size: 17px;
}
.bootstrapWizard .title { font-size: 13px; font-weight: 600; }
.bootstrapWizard > li.active > a { color: var(--court-text); }
.bootstrapWizard > li.active .step { background: var(--court-accent); border-color: var(--court-accent); color: var(--court-accent-ink); }
.bootstrapWizard > li.complete .step { border-color: var(--court-accent); color: var(--court-accent); }
.form-wizard .tab-content, .tab-content { padding-top: 4px; }
.pager li > a, .pager li > span {
    background: var(--court-surface-2);
    border-color: var(--court-line);
    color: var(--court-text);
    min-height: 44px;
    padding: 10px 18px;
    border-radius: 12px;
}
.pager .disabled > a { background: var(--court-surface); color: var(--court-muted); }

/* ---------- jQuery UI sliders ---------- */
.ui-widget, .ui-widget input, .ui-widget select, .ui-widget button { font-family: Barlow, sans-serif; }
.ui-widget.ui-widget-content { border: 0; }
.ui-slider-horizontal {
    height: 6px;
    margin: 17px 0;
    background: var(--court-line);
    border: 0;
    border-radius: 999px;
}
.ui-slider-horizontal .ui-slider-range {
    background: var(--court-accent);
    border-radius: 999px;
}
.ui-slider .ui-slider-handle,
.ui-slider .ui-slider-handle.ui-state-default {
    top: 50%;
    width: 46px;
    height: 30px;
    margin-top: -15px;
    margin-left: -23px;
    border: 0;
    border-radius: 999px;
    background: var(--court-accent);
    color: var(--court-accent-ink);
    font-family: "Barlow Condensed", sans-serif;
    font-weight: 700;
    font-size: 17px;
    line-height: 30px;
    text-align: center;
    cursor: grab;
    touch-action: none;
}
.ui-slider .ui-slider-handle:focus { outline: 3px solid rgba(242, 140, 40, 0.45); outline-offset: 2px; }
.ui-slider.ui-state-disabled { opacity: 0.35; }
#custom-handle { width: 46px; height: 30px; margin-top: -15px; margin-left: -23px; line-height: 30px; }

/* -/+ slider rows: keep the three parts on one line on a phone */
.form-group.col-sm-12:has(> .inputValueMinus) {
    display: flex;
    align-items: center;
    gap: 10px;
    float: none;
    padding-left: 0;
    padding-right: 0;
}
.form-group.col-sm-12:has(> .inputValueMinus) > .inputValueMinus,
.form-group.col-sm-12:has(> .inputValueMinus) > .inputValuePlus { flex: 0 0 40px; }
.form-group.col-sm-12:has(> .inputValueMinus) > .col-sm-10,
.form-group.col-sm-12:has(> .inputValueMinus) > .col-xs-9 {
    flex: 1;
    width: auto;
    height: auto !important;
    padding: 0 14px !important;
    float: none;
}
.col.col-sm-2, .col.col-sm-3 { color: var(--court-soft); font-size: 14px; font-weight: 500; padding-top: 4px; }

/* ---------- Bluetooth terminal log ---------- */
#terminal, div[id$="Console"]:not(.btn), #pulseValues {
    font-family: Consolas, "Cascadia Mono", monospace;
    font-size: 13px;
    background: #0A1219;
    border-radius: 10px;
    padding: 8px 10px;
}
#terminal div, div[id$="Console"]:not(.btn) div { color: var(--court-muted); }
#terminal div.out, div.out { color: var(--court-out); }
#terminal div.in, div.in { color: var(--court-in); }
#terminal div.error, div.error { color: var(--court-danger-text); }

/* the On/Off toggle switches in the terminal (BTterminal partial) */
input:checked + .slider { background-color: var(--court-accent); }
input:focus + .slider { box-shadow: 0 0 0 3px rgba(242, 140, 40, 0.3); }

/* ---------- small screens ---------- */
@media (max-width: 767px) {
    .court-main { padding: 4px 12px 24px; }
    .row { margin-left: -6px; margin-right: -6px; }
    [class*="col-"] { padding-left: 6px; padding-right: 6px; }
    .bootstrapWizard .title { font-size: 11px; }
    .table-responsive { margin-bottom: 8px; }
}

/* ---------- plain inputs / selects the scripts create without .form-control ---------- */
select:not(.form-control),
input[type="text"]:not(.form-control),
input[type="number"]:not(.form-control) {
    min-height: 36px;
    padding: 4px 8px;
    border: 1px solid var(--court-line);
    border-radius: 8px;
    background: var(--court-bg-deep);
    color: var(--court-text);
    font: inherit;
    font-size: 14px;
}
select:not(.form-control) { padding-right: 4px; }
select option { background: var(--court-bg-deep); color: var(--court-text); }
select:focus, input[type="text"]:focus, input[type="number"]:focus {
    outline: none;
    border-color: var(--court-accent);
    box-shadow: 0 0 0 3px rgba(242, 140, 40, 0.25);
}

/* ---------- ball / drill tables ---------- */
.table > tbody > tr > td { white-space: nowrap; }

/* "1  ( ) Play" : number and radio on one line */
.table td .radio-inline {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0 0 0 8px;
    padding: 0;
    vertical-align: middle;
    color: var(--court-soft);
}
.table td .radio-inline input[type="radio"] {
    position: static;
    margin: 0;
    width: 20px;
    height: 20px;
    accent-color: var(--court-accent);
}

/* action icons: one row, touch-sized, not oversized */
.table td a > .fa-2x, .table td a > .fas.fa-2x {
    font-size: 26px;
    line-height: 1;
}
.table td a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    min-height: 40px;
    color: var(--court-accent);
    text-decoration: none;
}
.table td a:hover { color: #FFC48A; }
.table td a + a { margin-left: 2px; }

/* ---------- Court map (aim the ball) ---------- */
.court-map {
    max-width: 420px;
    margin: 4px auto 22px;
}
.court-map-caption {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--court-muted);
    margin-bottom: 8px;
}
.court-map button {
    font-family: "Barlow Condensed", sans-serif;
    font-weight: 700;
    cursor: pointer;
}
.court-map-table {
    border: 2px solid var(--court-text);
    border-radius: 6px;
    background: var(--court-table);
    overflow: hidden;
}
.court-map-net {
    height: 6px;
    background: repeating-linear-gradient(90deg, var(--court-text) 0 4px, transparent 4px 8px);
    opacity: 0.85;
}
.court-map-zones {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}
.court-map-zones button {
    height: 64px;
    border: 1px solid rgba(232, 238, 243, 0.35);
    background: transparent;
    color: rgba(232, 238, 243, 0.8);
    font-size: 22px;
}
.court-map-zones button:hover { background: rgba(255, 255, 255, 0.08); }
.court-map-zones button.is-on,
.court-map-range.is-on {
    background: var(--court-accent);
    color: var(--court-accent-ink);
}
.court-map-footer {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--court-muted);
}
.court-map-range {
    min-height: 36px;
    padding: 0 14px;
    border-radius: 999px;
    border: 1px solid var(--court-line);
    background: var(--court-surface-2);
    color: var(--court-soft);
    font-size: 14px;
    letter-spacing: 0.06em;
}
.court-map-label {
    margin-left: auto;
    text-transform: none;
    letter-spacing: 0;
    font-size: 14px;
    color: var(--court-soft);
    text-align: right;
}

/* robot end of the table: the 5 stations, robot drawn at the selected one */
.court-map-robotside.court-map-stations {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    height: 72px;
    background:
        linear-gradient(90deg, transparent calc(50% - 1px), rgba(232, 238, 243, 0.45) calc(50% - 1px), rgba(232, 238, 243, 0.45) calc(50% + 1px), transparent calc(50% + 1px));
    border-bottom: 0;
}
.court-map-stations button {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 6px;
    padding: 6px 0 0;
    border: 0;
    background: transparent;
    color: rgba(232, 238, 243, 0.7);
}
.court-map-stations button:hover { background: rgba(255, 255, 255, 0.06); }
.court-robot {
    width: 34px;
    height: 22px;
    border-radius: 6px 6px 12px 12px;
    border: 2px dashed rgba(232, 238, 243, 0.35);
    background: transparent;
}
.court-st-label { font-size: 15px; line-height: 1; }
.court-map-stations button.is-on .court-robot {
    border: 0;
    background: var(--court-accent);
    box-shadow: 0 0 0 4px rgba(242, 140, 40, 0.25);
}
.court-map-stations button.is-on .court-st-label { color: #FFD2A6; }

/* ---------- predicted landing (court-physics.js) ---------- */
.court-map-zones { position: relative; }
.court-pred-layer { position: absolute; inset: 0; pointer-events: none; }
.court-pred-dot {
    position: absolute;
    width: 12px;
    height: 12px;
    margin: -6px 0 0 -6px;
    border-radius: 50%;
    background: #FFFFFF;
    border: 2px solid var(--court-bg);
    opacity: 0.75;
}
.court-pred-dot.is-main {
    width: 18px;
    height: 18px;
    margin: -9px 0 0 -9px;
    opacity: 1;
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.3);
}
.court-map-zones button.is-predicted:not(.is-on) {
    box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.85);
}
.court-pred-info {
    margin-top: 8px;
    font-size: 14px;
    color: var(--court-text);
    min-height: 20px;
}
.court-pred-use {
    margin-left: 6px;
    min-height: 32px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid var(--court-accent);
    background: transparent;
    color: #FFC48A;
    font-weight: 600;
    font-size: 13px;
}

/* ---------- drag the ball to aim ---------- */
.court-drag-dock {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
    padding: 10px 12px;
    border: 1px dashed var(--court-line);
    border-radius: 12px;
    color: var(--court-soft);
    font-size: 14px;
}
.court-drag-ball {
    flex: 0 0 auto;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #FFFFFF 0 18%, #FFB25E 45%, var(--court-accent) 75%, #C96512 100%);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
    cursor: grab;
    touch-action: none;
}
.court-drag-ghost {
    position: fixed;
    z-index: 2000;
    width: 30px;
    height: 30px;
    margin: -15px 0 0 -15px;
    pointer-events: none;
    cursor: grabbing;
}
.court-pred-dot.is-main { pointer-events: auto; cursor: grab; touch-action: none; }
.court-map-zones.is-drop-target { outline: 3px solid #FFFFFF; outline-offset: -3px; }
.court-drag-msg { margin-top: 8px; font-size: 14px; color: #FFD2A6; min-height: 20px; }

/* ---------- speed / spin presets ---------- */
.court-presets {
    max-width: 420px;
    margin: -8px auto 22px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.court-preset { display: flex; flex-direction: column; gap: 6px; }
.court-preset-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--court-muted);
}
.court-seg {
    display: flex;
    gap: 4px;
    padding: 4px;
    border-radius: 12px;
    background: var(--court-bg-deep);
    border: 1px solid var(--court-line);
}
.court-seg button {
    flex: 1;
    min-height: 40px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--court-soft);
    font-family: "Barlow Condensed", sans-serif;
    font-weight: 700;
    font-size: 17px;
    letter-spacing: 0.03em;
}
.court-seg button:hover { color: #FFFFFF; background: var(--court-surface-2); }
.court-seg button.is-on { background: var(--court-accent); color: var(--court-accent-ink); }

/* ---------- Play / Serve switch under the table ---------- */
.court-balltype { margin-top: 10px; }
.court-balltype button { min-height: 44px; font-size: 18px; }

/* ---------- Fine-tuning panel (wheel / pitch / oscillation sliders) ---------- */
.court-fine {
    margin: 4px 0 18px;
    border: 1px solid var(--court-line);
    border-radius: var(--court-radius);
    background: var(--court-bg-deep);
}
.court-fine > summary {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px 12px;
    min-height: 52px;
    padding: 10px 16px 10px 40px;
    position: relative;
    cursor: pointer;
    list-style: none;
}
.court-fine > summary::-webkit-details-marker { display: none; }
.court-fine > summary::before {
    content: "";
    position: absolute;
    left: 16px;
    top: 50%;
    width: 9px;
    height: 9px;
    margin-top: -6px;
    border-right: 2px solid var(--court-accent);
    border-bottom: 2px solid var(--court-accent);
    transform: rotate(-45deg);
    transition: transform 0.15s;
}
.court-fine[open] > summary::before { transform: rotate(45deg); margin-top: -8px; }
.court-fine-title {
    font-family: "Barlow Condensed", sans-serif;
    font-weight: 700;
    font-size: 18px;
    color: var(--court-text);
}
.court-fine-values { font-size: 14px; color: var(--court-soft); }
.court-fine-body { padding: 4px 16px 12px; border-top: 1px solid var(--court-line); }
.court-fine > summary:focus-visible { outline: 3px solid rgba(242, 140, 40, 0.45); outline-offset: 2px; border-radius: var(--court-radius); }
.court-fine-body .court-fine-random {
    float: none;
    width: auto;
    margin: 8px 0 0;
    padding: 0;
}
.court-fine-body .court-fine-random label {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    margin: 0;
    cursor: pointer;
}

/* "From Station" / "To Zone" dropdowns: replaced by the court map. They stay in the page
   (hidden) because the robot scripts read and write the station and zone through them. */
.form-group:has(#sb_Station),
.form-group:has(#sb_Zone),
.form-group:has(#sb_ballType) { display: none; }   /* Ball Type: replaced by the Play / Serve switch */

/* ---------- sign in / out ---------- */
.court-header-right { display: flex; align-items: center; gap: 10px; }
.court-signin, .court-signout button {
    min-height: 32px;
    display: inline-flex;
    align-items: center;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid var(--court-line);
    background: transparent;
    color: var(--court-soft);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
}
.court-signin:hover, .court-signin:focus, .court-signout button:hover { color: #FFFFFF; text-decoration: none; border-color: var(--court-accent); }
.court-signout { margin: 0; }

.court-authbar {
    position: fixed;
    left: 12px; right: 12px;
    bottom: calc(var(--court-bar-h) + 12px + env(safe-area-inset-bottom));
    z-index: 1050;
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 640px;
    margin: 0 auto;
    padding: 10px 12px 10px 16px;
    border-radius: 12px;
    background: #3A2A14;
    border: 1px solid var(--court-accent);
    color: #FFE3C7;
    font-size: 14px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
}
.court-authbar-text { flex: 1; }
.court-authbar-signin {
    min-height: 40px; padding: 0 16px; border: 0; border-radius: 10px;
    background: var(--court-accent); color: var(--court-accent-ink); font-weight: 700;
}
.court-authbar-close {
    width: 36px; height: 36px; border: 0; border-radius: 50%;
    background: transparent; color: #FFE3C7; font-size: 22px; line-height: 1;
}

.court-auth-page { padding: 0; min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.court-auth {
    width: 100%;
    max-width: 380px;
    margin: 24px 16px;
    padding: 28px 24px;
    border-radius: var(--court-radius);
    background: var(--court-surface);
    border: 1px solid var(--court-line);
}
.court-auth .court-brand { display: block; margin-bottom: 12px; }
.court-auth h1 { font-size: 28px; margin: 0 0 8px; }
.court-auth p { color: var(--court-soft); }
.court-auth label { display: block; margin: 14px 0 6px; }
.court-auth-submit {
    width: 100%; height: 50px; margin-top: 16px; border: 0; border-radius: 12px;
    background: var(--court-accent); color: var(--court-accent-ink);
    font-family: "Barlow Condensed", sans-serif; font-weight: 700; font-size: 20px; letter-spacing: 0.06em; text-transform: uppercase;
}
.court-auth-error { color: var(--court-danger-text) !important; }
.court-auth code { color: #FFD2A6; background: transparent; }

/* ---------- ball search table (Balls tab): force the dark theme over Bootstrap's table colours ---------- */
.court-main div.table,
.court-main .table-responsive,
.court-main table.table,
.court-main table.table > thead > tr,
.court-main table.table > tbody > tr,
.court-main table.table > thead > tr > th,
.court-main table.table > tbody > tr > td {
    background-color: transparent !important;
    color: var(--court-text);
}
.court-main table.table > thead > tr > th { color: var(--court-muted); }
.court-main table.table-striped > tbody > tr:nth-of-type(odd) { background-color: rgba(255, 255, 255, 0.04) !important; }
.court-main table.table > tbody > tr:hover { background-color: rgba(242, 140, 40, 0.10) !important; }
.court-main table.table-bordered,
.court-main table.table-bordered > thead > tr > th,
.court-main table.table-bordered > tbody > tr > td { border-color: var(--court-surface-2) !important; }
.court-main div.table { border: 0; margin-bottom: 8px; }
.court-main table.table td label { color: var(--court-text); font-weight: 500; }

/* ---------- Servos screen: buttons that have no Bootstrap "btn" class ---------- */
#clearPulseValues, #scSaveDeviceSettings, #scClearConsole {
    min-height: 44px;
    padding: 10px 18px;
    margin: 8px 8px 8px 0;
    border-radius: 12px;
    font-family: Barlow, sans-serif;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
}
#scSaveDeviceSettings {
    border: 0;
    background: var(--court-accent);
    color: var(--court-accent-ink);
}
#scSaveDeviceSettings:hover, #scSaveDeviceSettings:focus { background: #FFA24A; }
#clearPulseValues, #scClearConsole {
    border: 1px solid var(--court-line);
    background: var(--court-surface-2);
    color: var(--court-text);
}
#clearPulseValues:hover, #scClearConsole:hover { background: #23405F; color: #FFFFFF; }
/* log boxes stay hidden until there is something in them */
#pulseValues:empty, div[id$="Console"]:not(.btn):empty { display: none; }

/* Play / Stop live only in the bottom bar: hide the duplicates inside the windows */
#SendSingleBall, #StopSingle, #trm_Stop { display: none !important; }


/* Connect / Disconnect when not available: dimmed and not clickable-looking */
#trm_connect[disabled], #trm_disconnect[disabled] { opacity: 0.35; cursor: not-allowed; pointer-events: none; }
.court-test-voice {
    min-height: 40px; margin: 4px 0 10px 10px; padding: 0 14px;
    border-radius: 10px; border: 1px solid var(--court-line);
    background: var(--court-surface-2); color: var(--court-text); font-weight: 600;
}
.court-test-voice:hover { background: #23405F; color: #FFFFFF; }

/* mini 3x3 zone grid in the ball tables (random oscillation): net side at the top */
.court-zone-mini {
    display: inline-grid;
    grid-template-columns: repeat(3, 10px);
    grid-auto-rows: 10px;
    gap: 2px;
    padding: 3px;
    border: 1px solid var(--court-text);
    border-top: 3px dotted var(--court-text);      /* the net */
    border-radius: 3px;
    background: var(--court-table);
    vertical-align: middle;
    cursor: help;
}
.court-zone-mini i { display: block; background: rgba(232, 238, 243, 0.18); border-radius: 1px; }
.court-zone-mini i.on { background: var(--court-accent); }

/* Speed gauge / spin ball icons in the ball tables (CourtSpeedCell / CourtSpinCell, court-physics.js) */
.court-icon-mini { display: inline-block; vertical-align: middle; }
.court-icon-tip, .court-zone-mini { cursor: help; }

/* Ball tab: icons on the Speed / Spin / Spin type and Play / Serve buttons, live Spin Angle dial */
.court-seg button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.court-btn-icon:empty { display: none; }
.court-btn-icon { display: inline-flex; line-height: 0; }
.court-seg button .court-icon-tip { cursor: inherit; }
.court-seg button .court-icon-mini { width: 20px; height: 20px; }
.court-balltype button .court-icon-mini { width: 32px; height: 20px; }
/* on the orange selected button the orange parts turn dark and the dim parts light */
.court-seg button.is-on .court-icon-mini [stroke="#F28C28"] { stroke: var(--court-accent-ink); }
.court-seg button.is-on .court-icon-mini [fill="#F28C28"] { fill: var(--court-accent-ink); }
.court-seg button.is-on .court-icon-mini [stroke="#2C4560"] { stroke: rgba(255,255,255,.45); }
.court-seg button.is-on .court-icon-mini [stroke="#9FB1C1"] { stroke: var(--court-accent-ink); }
.court-angle-live { display: inline-block; margin-left: 8px; vertical-align: middle; }
@media (max-width: 420px) { .court-presets .court-btn-text { font-size: 13px; } .court-seg button { gap: 3px; } }

/* ---------- Table setup tab (court-config.js) ---------- */
.court-setup { max-width: 640px; margin: 0 auto; padding: 8px 0 24px; }
.court-setup h2 { font-family: "Barlow Condensed", sans-serif; font-weight: 700; font-size: 26px; margin: 4px 0 4px; color: var(--court-text); }
.court-setup-intro { color: var(--court-muted); margin: 0 0 12px; }
.court-setup-drawing { display: block; width: 100%; height: auto; margin: 0 0 14px; padding: 10px; box-sizing: border-box;
    background: var(--court-bg-deep); border: 1px solid var(--court-line); border-radius: var(--court-radius); }
.court-setup-group { margin: 0 0 14px; padding: 6px 16px 10px; border: 1px solid var(--court-line); border-radius: var(--court-radius); background: var(--court-surface); }
.court-setup-group legend { width: auto; margin: 0; padding: 0 6px; border: 0; font-family: "Barlow Condensed", sans-serif; font-weight: 700; font-size: 18px;
    color: var(--court-text); }
.court-setup-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--court-line); }
.court-setup-row:first-of-type { border-top: 0; }
.court-setup-row label { margin: 0; font-weight: 500; color: var(--court-soft); flex: 1 1 auto; min-width: 0; }
.court-setup-row label small { display: block; font-weight: 400; color: var(--court-muted); font-size: 12px; margin-top: 2px; }
.court-setup-key { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; margin-right: 8px; border-radius: 6px;
    background: var(--court-accent); color: var(--court-accent-ink); font-size: 12px; vertical-align: 1px; }
.court-setup-input { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.court-setup-input input, .court-setup-input select { width: 96px; min-height: 40px; padding: 6px 8px; border-radius: 9px; border: 1px solid var(--court-line);
    background: var(--court-bg-deep) !important; color: var(--court-text) !important; font-size: 16px; text-align: right; }
.court-setup-input select { width: 128px; text-align: left; }
.court-setup-input input[aria-invalid="true"] { border-color: var(--court-danger); }
.court-setup-unit { width: 34px; color: var(--court-muted); }
.court-setup-derived { padding: 8px 0 2px; font-size: 13px; color: var(--court-muted); border-top: 1px solid var(--court-line); }
.court-setup-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.court-setup-reset { min-height: 44px; padding: 0 18px; border-radius: 10px; border: 1px solid var(--court-line); background: var(--court-surface-2);
    color: var(--court-text); font-weight: 600; }
.court-setup-reset:hover { border-color: var(--court-accent); }
.court-setup-status { color: var(--court-ok); font-size: 14px; }
@media (max-width: 420px) { .court-setup-input input { width: 80px; } .court-setup-input select { width: 110px; } }
.court-setup-upload { min-height: 44px; padding: 0 18px; border-radius: 10px; border: 0; background: var(--court-accent); color: var(--court-accent-ink); font-weight: 700; }
/* a predicted shot that misses the table (out at the side / long), drawn at the edge it leaves */
.court-pred-miss { position: absolute; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%;
    border: 2px solid var(--court-danger); background: rgba(226, 91, 91, .18); pointer-events: none; }
/* two-line headers so the narrow icon columns (From Station, Osc Random) stay narrow */
.court-main table.table > thead > tr > th.court-th-2 { white-space: normal; line-height: 1.15; text-align: center; width: 1%; }
/* Balls tab: edit button next to each ball */
.court-edit-ball { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; margin-left: 6px;
    vertical-align: middle; border-radius: 9px; border: 1px solid var(--court-line); background: var(--court-surface-2);
    color: var(--court-accent); font-size: 16px; }
.court-edit-ball:hover, .court-edit-ball:focus-visible { border-color: var(--court-accent); background: var(--court-bg-deep); }

/* ---------- Ball tables as cards on phones (cells labelled by CourtLabelCells, court.js) ----------
   Drill Balls: 1 type · 2 actions | 3 station · 4 zone · 5 osc random · 6 speed · 7 spin · 8 spin angle | 9 repeat · 10 wait
   Balls:       1 type + edit · 8 id | 2 station · 3 zone · 4 osc random · 5 speed · 6 spin · 7 spin angle */
@media (max-width: 640px) {
    .court-main table.court-cards,
    .court-main table.court-cards > tbody { display: block; width: 100%; }
    .court-main table.court-cards { border: 0 !important; }
    .court-main table.court-cards > thead { display: none; }
    .court-main table.court-cards > tbody > tr {
        display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px 4px;
        padding: 10px 8px; margin-bottom: 8px; border: 1px solid var(--court-line); border-radius: 12px;
    }
    .court-main table.court-cards > tbody > tr > td {
        display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 4px;
        min-width: 0; padding: 2px !important; border: 0 !important; white-space: normal; text-align: center;
    }
    .court-main table.court-cards > tbody > tr > td::before {
        content: attr(data-label); font-size: 10px; line-height: 1.1; letter-spacing: .06em; text-transform: uppercase; color: var(--court-muted);
    }
    /* first line: ball (and actions / id) without labels */
    .court-main table.court-cards > tbody > tr > td.c-1 { grid-column: 1 / span 3; flex-direction: row; justify-content: flex-start; align-items: center; }
    .court-main table.court-cards > tbody > tr > td.c-1::before { content: none; }
    #frmDrillBalls.court-cards > tbody > tr > td.c-2 { grid-column: 4 / span 3; flex-direction: row; justify-content: flex-end; flex-wrap: wrap; }
    #frmDrillBalls.court-cards > tbody > tr > td.c-2::before { content: none; }
    #frmDrillBalls.court-cards > tbody > tr > td.c-2 .fa-2x { font-size: 1.6em; }
    #frmDrillBalls.court-cards > tbody > tr > td.c-9 { grid-column: 1 / span 3; }
    #frmDrillBalls.court-cards > tbody > tr > td.c-10 { grid-column: 4 / span 3; }
    #frmDrillBalls.court-cards > tbody > tr > td select { width: 100%; }
    #tblSearchBalls.court-cards > tbody > tr > td.c-1 { grid-column: 1 / span 4; }
    #tblSearchBalls.court-cards > tbody > tr > td.c-8 { grid-column: 5 / span 2; grid-row: 1; justify-content: center; }
    #tblSearchBalls.court-cards > tbody > tr > td.c-8::before { content: "Ball"; }
}

/* ---------- Confirmation dialog (CourtConfirm, court.js) ---------- */
.court-modal-back { position: fixed; inset: 0; z-index: 2000; display: flex; align-items: center; justify-content: center; padding: 16px;
    background: rgba(5, 10, 15, .72); }
.court-modal { width: 100%; max-width: 380px; padding: 22px 20px 18px; border-radius: 18px; background: var(--court-surface);
    border: 1px solid var(--court-line); box-shadow: 0 18px 48px rgba(0, 0, 0, .5); color: var(--court-text); }
.court-modal h2 { margin: 0 0 8px; font-family: "Barlow Condensed", sans-serif; font-weight: 700; font-size: 24px; line-height: 1.15; color: var(--court-text); }
.court-modal p { margin: 0 0 18px; font-size: 15px; line-height: 1.45; color: var(--court-soft); }
.court-modal-actions { display: flex; gap: 10px; }
.court-modal-actions button { flex: 1; min-height: 48px; border-radius: 12px; font-family: "Barlow Condensed", sans-serif; font-weight: 700;
    font-size: 19px; letter-spacing: .04em; text-transform: uppercase; cursor: pointer; }
.court-modal-cancel { border: 1px solid var(--court-line); background: var(--court-bg-deep); color: var(--court-text); }
.court-modal-ok { border: 0; background: var(--court-accent); color: var(--court-accent-ink); }
.court-modal-ok.is-danger { background: var(--court-danger); color: #FFFFFF; }
.court-modal-actions button:focus-visible { outline: 3px solid #FFFFFF; outline-offset: 2px; }

/* Drill wizard steps 2-4 before a drill is selected (court.js) */
#drill-wizard .form-wizard > li.court-step-off { opacity: .35; }
#drill-wizard .form-wizard > li.court-step-off > a { cursor: not-allowed; }
label.court-disabled { opacity: .45; cursor: not-allowed; }

/* ---------- Drill wizard Step 2: drill details (EditDrill.cshtml / EditDrill.js) ---------- */
.court-edit-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 8px 0 14px; }
.court-edit-head h3 { margin: 0; }
.court-chip { flex: 0 0 auto; padding: 5px 12px; border-radius: 999px; background: var(--court-surface-2); border: 1px solid var(--court-line);
    color: var(--court-soft); font-size: 13px; font-weight: 600; }
.court-edit-card { display: flex; flex-direction: column; gap: 18px; padding: 18px 16px; border-radius: var(--court-radius);
    background: var(--court-surface); border: 1px solid var(--court-line); }
.court-field { display: flex; flex-direction: column; gap: 8px; }
.court-field > label, .court-field-label { margin: 0; font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--court-muted); }
.court-field > label small { margin-left: 6px; font-size: 11px; font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--court-muted); opacity: .8; }
.court-input { box-sizing: border-box; font-family: inherit; width: 100%; min-height: 46px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--court-line);
    background: var(--court-bg-deep) !important; color: var(--court-text) !important; font-size: 16px; box-shadow: none; }
.court-input::placeholder { color: var(--court-muted); opacity: .7; }
.court-input:focus { outline: none; border-color: var(--court-accent); box-shadow: 0 0 0 3px rgba(242, 140, 40, .25); }
.court-input[aria-invalid="true"] { border-color: var(--court-danger); }
.court-input-lg { min-height: 52px; font-family: "Barlow Condensed", sans-serif; font-weight: 700; font-size: 22px; letter-spacing: .01em; }
textarea.court-input { resize: vertical; min-height: 84px; line-height: 1.4; }
.court-input-row { display: flex; gap: 8px; }
.court-input-row .court-input { flex: 1; min-width: 0; }
.court-icon-btn { flex: 0 0 46px; display: inline-flex; align-items: center; justify-content: center; height: 46px; border-radius: 10px;
    background: var(--court-accent); color: var(--court-accent-ink) !important; font-size: 16px; text-decoration: none !important; }
.court-icon-btn[hidden] { display: none; }
.court-hidden-select { position: absolute !important; width: 1px; height: 1px; overflow: hidden; opacity: 0; pointer-events: none; }
.court-type-seg { flex-wrap: wrap; }
.court-type-seg button { min-width: calc(50% - 4px); }
@media (min-width: 520px) { .court-type-seg button { min-width: 0; } }
.court-edit-summary { margin: 12px 2px 0; color: var(--court-muted); font-size: 14px; }
.court-edit-actions { display: flex; gap: 10px; margin: 14px 0 6px; }
.court-edit-actions button { flex: 1; min-height: 50px; border-radius: 12px; font-family: "Barlow Condensed", sans-serif; font-weight: 700;
    font-size: 19px; letter-spacing: .05em; text-transform: uppercase; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.court-btn-secondary { border: 1px solid var(--court-line); background: var(--court-surface-2); color: var(--court-text); }
.court-btn-primary { border: 0; background: var(--court-accent); color: var(--court-accent-ink); }
.court-edit-actions button:focus-visible { outline: 3px solid #FFFFFF; outline-offset: 2px; }

/* ---------- Drill wizard Step 4: play (PlayDrill.cshtml / PlayDrill.js) - sized to fit one phone screen ---------- */
.court-play-head { margin: 2px 0 8px; }
.court-play-head .court-chip { max-width: 55%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.court-play-card { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px 12px; border-radius: var(--court-radius);
    background: var(--court-surface); border: 1px solid var(--court-line); }
.court-seg-sm button { min-height: 36px; font-size: 15px; }
.court-play-row { display: flex; flex-direction: column; gap: 2px; }
.court-play-label { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--court-soft); }
.court-play-label b { color: var(--court-accent); font-weight: 700; white-space: nowrap; }
.court-step-row { display: flex; align-items: center; gap: 10px; }
.court-step-row > .inputValueMinus, .court-step-row > .inputValuePlus { flex: 0 0 34px; width: 34px; height: 34px; min-height: 34px; line-height: 32px; font-size: 18px; }
.court-slider-wrap { flex: 1; min-width: 0; padding: 0 14px; }
.court-slider-wrap .ui-slider-horizontal { margin: 12px 0; }
.court-slider-wrap .ui-slider .ui-slider-handle,
.court-slider-wrap .ui-slider .ui-slider-handle.ui-state-default { width: 40px; height: 26px; margin-top: -13px; margin-left: -20px; line-height: 26px; font-size: 13px; }
.court-toggles { display: flex; gap: 8px; margin-top: 4px; }
.court-toggle { flex: 1; margin: 0; cursor: pointer; }
.court-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.court-toggle span { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 0 8px; border-radius: 10px;
    border: 1px solid var(--court-line); background: var(--court-bg-deep); color: var(--court-soft); font-size: 14px; font-weight: 600; text-align: center; }
.court-toggle input:checked + span { background: rgba(242, 140, 40, .16); border-color: var(--court-accent); color: var(--court-text); }
.court-toggle input:checked + span i { color: var(--court-accent); }
.court-toggle input:focus-visible + span { outline: 3px solid #FFFFFF; outline-offset: 2px; }
.court-play-summary { margin: 8px 2px; font-size: 14px; color: var(--court-muted); }
.court-play-actions { display: flex; gap: 8px; }
.court-play-go { flex: 1; min-height: 52px; border: 0; border-radius: 12px; background: var(--court-accent); color: var(--court-accent-ink);
    font-family: "Barlow Condensed", sans-serif; font-weight: 700; font-size: 22px; letter-spacing: .06em; text-transform: uppercase;
    display: inline-flex; align-items: center; justify-content: center; gap: 10px; cursor: pointer; }
.court-play-go:disabled { opacity: .4; cursor: not-allowed; }
.court-play-icon { flex: 0 0 52px; min-height: 52px; border-radius: 12px; border: 1px solid var(--court-line); background: var(--court-surface-2);
    color: var(--court-text); font-size: 19px; cursor: pointer; }
.court-play-go:focus-visible, .court-play-icon:focus-visible { outline: 3px solid #FFFFFF; outline-offset: 2px; }
/* the robot's answers while the drill plays stay below, out of the way */
.court-play #pdConsole { margin-top: 10px; }

/* bottom bar only on the Ball tab and the drill Play step (court.js refreshActionBar) */
body.court-no-bar { padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
.court-actionbar.is-stop-only .court-stop { flex: 1; width: auto; }
@media (min-width: 768px) { .court-actionbar.is-stop-only .court-stop { flex: 0 1 420px; } }

/* Drill wizard step buttons stay under the header and tabs while the step's content scrolls.
   --court-sticky-top = header + tabs height (set by court.js; 116px until then). */
#drill-wizard .form-bootstrapWizard {
    position: sticky;
    top: var(--court-sticky-top, 116px);
    z-index: 1020;
    margin: 0 -12px 6px;
    padding: 6px 12px 4px;
    background: var(--court-surface);
    border-bottom: 1px solid var(--court-line);
}

/* Drill Balls (Step 3): Find / Add / Save always visible at the bottom of the screen */
.court-sticky-actions {
    position: sticky;
    bottom: 0;
    z-index: 1010;
    display: flex;
    gap: 8px;
    margin: 8px -12px 0;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
    background: var(--court-surface);
    border-top: 1px solid var(--court-line);
}
.court-sticky-actions > .btn {
    flex: 1;
    margin: 0 !important;
    min-height: 50px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.court-sticky-actions > .btn .fa-2x { font-size: 1.4em; }
.court-sticky-actions > .btn span { font-family: "Barlow Condensed", sans-serif; font-weight: 700; font-size: 18px; letter-spacing: .05em; text-transform: uppercase; }

/* Play step: Play drill lives in the bottom bar next to Stop (court.js), so the in-page one is hidden
   and Announce / Save share the row */
body.court-on-play .court-play-go { display: none; }
.court-play-actions .court-play-icon { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; }
.court-play-actions .court-play-icon span { font-family: "Barlow Condensed", sans-serif; font-weight: 700; font-size: 18px; letter-spacing: .05em; text-transform: uppercase; }

/* ---------- Robot tab: "Bluetooth and Test" panel (BTterminal.cshtml) ---------- */
.court-bt { display: flex; flex-direction: column; gap: 14px; }
.court-bt-connect { display: flex; gap: 10px; }
.court-bt-connect .btn { flex: 1; min-height: 52px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    border-radius: 12px; font-family: "Barlow Condensed", sans-serif; font-weight: 700; font-size: 20px; letter-spacing: .05em; text-transform: uppercase; }
.court-bt-connect #trm_connect { border: 0; background: var(--court-accent); color: var(--court-accent-ink); }
.court-bt-connect #trm_disconnect { border: 2px solid var(--court-danger); background: transparent; color: var(--court-danger-text); }
.court-bt-block { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: 12px; background: var(--court-bg-deep); border: 1px solid var(--court-line); }
.court-bt-block .court-field-label small { margin-left: 6px; font-size: 11px; font-weight: 500; letter-spacing: 0; text-transform: none; opacity: .8; }
.court-bt-run { display: flex; gap: 8px; }
.court-bt-run select { flex: 1; min-width: 0; }
.court-bt-run .btn { flex: 0 0 auto; min-width: 96px; min-height: 46px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    border: 0; border-radius: 10px; background: var(--court-accent); color: var(--court-accent-ink); font-weight: 700; font-size: 16px; }
.court-bt-num { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0; font-weight: 500; color: var(--court-soft); }
.court-bt-num > span:first-child { flex: 1; min-width: 0; }
.court-bt-num-in { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.court-bt-num-in input { width: 90px; min-height: 40px; text-align: right; }
.court-bt-num-in em { width: 24px; font-style: normal; color: var(--court-muted); font-size: 13px; }
.court-bt-switches { gap: 0; padding-bottom: 4px; }
.court-bt-switches .court-field-label { margin-bottom: 4px; }
.court-bt-switch { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0; padding: 10px 0;
    border-top: 1px solid var(--court-line); cursor: pointer; font-weight: 600; color: var(--court-text); }
.court-bt-switch > span small { display: block; font-weight: 400; font-size: 12px; color: var(--court-muted); }
.court-bt-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.court-bt-switch i { flex: 0 0 46px; position: relative; height: 26px; border-radius: 999px; background: var(--court-line); transition: background .2s; }
.court-bt-switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #FFFFFF; transition: transform .2s; }
.court-bt-switch input:checked + i { background: var(--court-accent); }
.court-bt-switch input:checked + i::after { transform: translateX(20px); }
.court-bt-switch input:focus-visible + i { outline: 3px solid #FFFFFF; outline-offset: 2px; }
.court-bt-switches .court-test-voice { align-self: flex-start; margin: 0 0 8px; }

/* ---------- Robot tab (BTterminal.cshtml) ---------- */
.court-robot-head { display: flex; align-items: center; justify-content: space-between; margin: 6px 0 12px; }
.court-robot-head h3 { margin: 0; }
.court-acc .panel { border-radius: var(--court-radius) !important; overflow: hidden; }
.court-acc .panel-heading { padding: 0 !important; }
.court-acc .panel-title > a { position: relative; display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 12px 44px 12px 16px;
    font-family: "Barlow Condensed", sans-serif; font-weight: 700; font-size: 20px; letter-spacing: .02em; }
.court-acc .panel-title > a > i { width: 20px; text-align: center; color: var(--court-accent); font-size: 17px; }
.court-acc .panel-title > a::after { content: ""; position: absolute; right: 18px; top: 50%; width: 9px; height: 9px; margin-top: -7px;
    border-right: 2px solid var(--court-muted); border-bottom: 2px solid var(--court-muted); transform: rotate(45deg); transition: transform .2s; }
.court-acc .panel-title > a.collapsed::after { transform: rotate(-45deg); margin-top: -4px; }
.court-acc .panel-body { padding: 4px 12px 14px; }
.court-bt-field { display: flex; flex-direction: column; gap: 6px; margin: 0; font-weight: 500; color: var(--court-soft); }
.court-select-sm { width: 140px !important; text-align: left !important; }
.court-readout { width: auto; max-width: 50%; border: 0; background: transparent !important; color: var(--court-accent) !important;
    font-weight: 700; text-align: right; padding: 0; }
.court-readout-box { color: var(--court-accent) !important; font-weight: 700; }
.court-bt-run #trm_SendStationCommand { min-width: 96px; }
.court-log-head { display: flex; align-items: center; justify-content: space-between; margin: 16px 0 6px; }
.court-log-head .btn { min-height: 38px; display: inline-flex; align-items: center; gap: 6px; padding: 0 14px; border-radius: 10px;
    border: 1px solid var(--court-line); background: var(--court-surface-2); color: var(--court-text); }
.court-acc .panel { padding: 0; }
.court-acc .panel-heading { background: var(--court-surface-2) !important; border: 0; }
.court-acc .panel-title { margin: 0; font-size: inherit; }
.court-acc .panel-collapse > .panel-body { border-top: 1px solid var(--court-line); padding-top: 12px; }
.court-bt-connect .btn { min-width: 0; padding: 0 8px; font-size: 18px; white-space: nowrap; }
.court-play-label input.court-readout { min-height: 0 !important; height: auto; padding: 0 !important; border: 0 !important;
    background: transparent !important; box-shadow: none !important; width: 50%; color: var(--court-accent) !important; font-weight: 700; text-align: right; }

#pnl_TextToSpeech .court-test-voice { align-self: flex-start; margin-top: 4px; }
/* Robot tab: Connect / Disconnect stay visible at the top while the tab scrolls */
.court-bt-connect-top { position: sticky; top: var(--court-sticky-top, 116px); z-index: 1020; margin: 0 -16px 12px; padding: 8px 16px 10px;
    background: var(--court-bg); border-bottom: 1px solid var(--court-surface-2); }
/* a value that just arrived from the robot (steps in track) */
.court-flash { animation: court-flash 1.2s ease-out; }
@keyframes court-flash { 0% { background: rgba(242, 140, 40, .45) !important; } 100% { background: var(--court-bg-deep); } }
