:root {
    /* JetBrains IntelliJ Dracula/Darcula-like palette (neutral charcoal, purple accent, minimal blue) */
    --bg: #2b2b2b;          /* editor/background charcoal */
    --surface: #313335;     /* primary surface (cards/topbar items) */
    --surface2: #3c3f41;    /* secondary surface (panels/inputs) */
    --fg: #a9b7c6;          /* IntelliJ-like foreground */
    --muted: #8a8f98;       /* neutral muted (replaces blue-ish comment tone) */
    --border: #4e5254;      /* Darcula separators/borders */
    --c-border: var(--border); /* compatibility alias */
    --accent: #9876aa;      /* IntelliJ-ish purple */
    --accent_soft: #f6b2b2;

    /* Semantic colors */
    --danger: #ff5555;
    --success: #50fa7b;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
    margin: 0;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    background: var(--bg);
    color: var(--fg);
}

a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
    /*padding: 12px;*/
    /*max-width: 1100px;*/
    /*margin: 0 auto;*/

    padding: 12px;
    max-width: none;   /* was 1100px */
    width: 100%;
    margin: 0;         /* was 0 auto */
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    background: rgba(43, 43, 43, 0.92);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
    padding: 10px 12px;

    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    justify-content: space-between;
}

.topbar__left {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.topbar__label {
    font-size: 12px;
    color: var(--muted);
}

.topbar__select {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--fg);
    border-radius: 10px;
    padding: 8px 10px;
    min-width: 160px;
}

.status {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 12px;
}

.status__dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: var(--danger); /* Disconnected placeholder */
}

.topbar__nav {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.navlink {
    display: inline-block;
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px solid transparent;
    color: var(--fg);
}

.navlink--active {
    background: var(--surface);
    border-color: var(--border);
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 14px;
}

.card-small {
    /*width: 50%;*/
    /*max-width: 960px;*/
    max-width: 1100px;
    margin: 0 auto;
}

.h1 {
    margin: 0 0 8px 0;
    font-size: 20px;
}

.muted { color: var(--muted); }
.small { font-size: 12px; }

.grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin-top: 12px;
}

@media (min-width: 820px) {
    .grid {
        grid-template-columns: 1fr 1fr;
    }
}

.panel {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 12px;
}

.panel--mt { margin-top: 12px; }

.panel__title {
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 8px;
}




/* Step response: recorded runs toggle */
.step-runs-toggle-btn{
    background: transparent;
    border: 0;
    padding: 0;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: inherit;
}

.step-runs-toggle-btn:hover{
    color: var(--fg);
}

.step-runs-toggle-icon{
    width: 14px;
    display: inline-block;
    transform: translateY(-1px);
}

.step-runs-msg{
    font-size: 13px;
}

/* Step response: plot header metadata (next to title) */
.step-plot-titlebar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.step-plot-meta {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}

.step-plot-meta-item {
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
    font-size: 12px;
    color: var(--muted);
}

.step-plot-meta-item .v {
    color: var(--fg);
    font-variant-numeric: tabular-nums;
}

.step-plot-meta-item.name .v {
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 700px) {
    .step-plot-meta-item.name .v {
        max-width: 160px;
    }
}

/*!* Step response: stimulus bar (inputs + buttons in one line) *!*/
/*.step-stimulus-bar {*/
/*    display: flex;*/
/*    !*display: inline-flex;*!*/
/*    align-items: center;*/
/*    gap: 10px;*/
/*    flex-wrap: wrap;*/
/*    justify-content: flex-start;   !* important: no space-between *!*/
/*}*/
/*@media (min-width: 980px) {*/
/*    .step-stimulus-bar { flex-wrap: nowrap; }*/
/*}*/
/*.step-stimulus-field {*/
/*    display: inline-flex;*/
/*    align-items: center;*/
/*    !flex: 0 0 auto;*max-width:170px;*!*/
/*    gap: 6px;*/
/*    */
/*}*/

/*.step-stimulus-field label {*/
/*    !*font-size: 12px;*!*/
/*    color: var(--muted);*/
/*    margin: 4px 0 0;*/
/*    white-space: nowrap;*/
/*}*/
/*.step-inline-input {*/
/*    !*width: 92px;*!*/
/*    !*margin-top: 0;*!*/
/*    !*padding: 8px 10px;*!*/
/*    !*border-radius: 10px;*!*/
/*    width: auto;                  !* important if you had width:100% somewhere *!*/
/*    flex: 0 0 auto;*/
/*    min-width: 5.5ch;             !* optional: keeps them usable without “170px hacks” *!*/
/*}*/
/*.step-inline-input--wide {*/
/*    width: 110px;*/
/*}*/
/*.step-stimulus-actions {*/
/*    !*display: inline-flex;*!*/
/*    !*align-items: center;*!*/
/*    !*gap: 10px;*!*/
/*    !*flex-wrap: wrap;*!*/
/*    !*margin-left: auto;*!*/
/*    display: inline-flex;*/
/*    align-items: center;*/
/*    gap: 10px;*/
/*    flex: 0 0 auto;*/
/*}*/

/*.form { margin-top: 12px; display: grid; gap: 12px; }*/
/*.form__row { display: grid; gap: 6px; }*/
/*.form__label { font-size: 12px; color: var(--muted); }*/
/*.form__input {*/
/*    width:50%;*/
/*    background: var(--surface2);*/
/*    border: 1px solid var(--border);*/
/*    color: var(--fg);*/
/*    border-radius: 12px;*/
/*    padding: 10px 12px;*/
/*    margin-top: 8px;*/
/*}*/

.step-stimulus-field {
    display: inline-flex;
    align-items: center;
    /*max-width:170px;*/
    gap: 6px;
    flex: 0 0 auto;
}

.step-stimulus-actions {
    /*display: inline-flex;*/
    /*align-items: center;*/
    /*gap: 10px;*/
    /*flex-wrap: wrap;*/
    /*margin-left: auto;*/
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
}

/* Minimal dialog styling */
dialog.step-dialog {
    background: var(--surface);
    color: var(--fg);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 14px;
    max-width: 620px;
    width: calc(100% - 24px);
}

/* Step response: Timeout = 0 -> show "MANUAL TIMEOUT" hint */
.step-timeout-hint {
    min-width: 0;
    padding: 6px 8px;
    font-size: 11px;
    letter-spacing: 0.4px;
    white-space: nowrap;
    margin-top: 4px;
    background: rgba(255, 0, 0, 0.4);

}

.form__label {  color: var(--muted); }
.form__label_login { display: inline-block; min-width:75px; }

.btn_login { margin-left: 77px; }

.form__input {
    background: var(--surface2);
    border: 1px solid var(--border);
    color: var(--fg);
    border-radius: 4px;
    padding: 8px 6px 8px 4px;
    margin-top: 4px;
    margin-right: 8px;
    width: 70px;
    text-align: center;
}

.form__input_edit {
    width: 100%;
    text-align: left;
    margin-bottom: 8px;
}

.form__input_login {

    width: calc(100% - 100px);
    text-align: left;
    margin-bottom: 8px;
}

.link-login {
    margin-left: 12px;
}


.placeholder {
    border: 1px dashed var(--border);
    border-radius: 12px;
    padding: 18px;
    color: var(--muted);
}

.kv { display: grid; gap: 8px; }
.kv__row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}
.kv__k { color: var(--muted); }
.kv__v { font-variant-numeric: tabular-nums; }

.list { margin: 0; padding-left: 18px; color: var(--muted); }



.row { display: flex; gap: 10px; flex-wrap: wrap; }
.row--mt { margin-top: 12px; }

.btn {
    background: var(--accent);
    border: 1px solid transparent;
    color: var(--bg); /* readable on purple, matches bg */
    border-radius: 12px;
    padding: 10px 12px;
    font-weight: 600;
    cursor: pointer;
}
.btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}
.btn--secondary {
    background: transparent;
    border-color: var(--border);
    color: var(--fg);
}

.pid {
    display: grid;
    gap: 12px;
}

@media (min-width: 820px) {
    .pid {
        grid-template-columns: 1fr 1fr;
    }
}

.pid__section {
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 10px;
    background: rgba(0,0,0,0.18);
}

.pid__heading {
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 10px;
}

.pid__axis {
    margin-bottom: 12px;
}

.pid__axisTitle {
    font-size: 13px;
    margin-bottom: 6px;
}

.pid__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

@media (min-width: 520px) {
    .pid__grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.pid__cell {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 10px;
}

.pid__label {
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 6px;
}

.pid__input {
    width: 100%;
    background: #252526; /* IntelliJ editor-ish dark */
    border: 1px solid var(--border);
    color: var(--fg);
    border-radius: 10px;
    padding: 10px;
}

/* Tuning UX: make disabled/enabled state visually obvious */
.pid--disabled .pid__cell {
    opacity: 0.65;
}

.pid--disabled .pid__input {
    cursor: not-allowed;
}

.pid__input:disabled {
    background: #1c1c1c;
    color: var(--muted);
    border-color: rgba(255, 255, 255, 0.10);
}

.pid--enabled .pid__cell {
    opacity: 1;
}

.pid--enabled .pid__input {
    cursor: text;
}

/* Small status badge next to "Send changes" */
.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 10px;
    border-radius: 999px;
    border: 1px solid var(--border);
    font-size: 12px;
    line-height: 1;
    min-width: 72px;
}

.badge--muted {
    color: var(--muted);
    background: rgba(255, 255, 255, 0.06);
    display: none;
}

.badge--ok {
    background: rgba(80, 250, 123, 0.12);
    border-color: rgba(80, 250, 123, 0.40);
}

.badge--bad {
    background: rgba(255, 85, 85, 0.14);
    border-color: rgba(255, 85, 85, 0.40);
}

.footer {
    /*padding: 14px 12px;*/
    padding: 4px 4px;
    border-top: 0px solid var(--border);
    border-bottom: 0px solid var(--border);
    /*margin-top: 16px;*/
    margin-top: 0px;
    text-align: center;
}

/* Alerts (default = error, so plain <div class="alert"> is red) */
.alert {
    margin-top: 10px;
    margin-bottom: 10px;
    padding: 10px 12px;
    border: 1px solid rgba(255, 85, 85, 0.40);
    border-radius: 12px;
    background: rgba(255, 85, 85, 0.14);
    color: var(--fg);
}

.alert.success {
    background: rgba(80, 250, 123, 0.12);
    border-color: rgba(80, 250, 123, 0.40);
}

.alert.error {
    background: rgba(255, 85, 85, 0.14);
    border-color: rgba(255, 85, 85, 0.40);
}

/* Fade-out animation for success messages */
.alert.fade-out {
    opacity: 0;
    transition: opacity 0.5s ease;
}

.navsep {
    width: 1px;
    height: 28px;
    background: var(--border);
    display: inline-block;
    margin: 0 4px;
}

.userpill {
    display: inline-flex;
    align-items: center;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    font-size: 12px;
    color: var(--fg);
}

/* Topbar control toggle */
.control {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 6px 8px;
}

.control__owner {
    font-size: 12px;
    white-space: nowrap;
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.btn--control-on {
    background: var(--accent);
    border-color: transparent;
    color: var(--bg);
}

/* Page header + per-subsite enable */
.pagehead {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-start;
    justify-content: space-between;
}

.subsite {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.pill {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 12px;
    background: var(--surface2);
    color: var(--fg);
}

.pill--off {
    border-color: rgba(231, 76, 60, 0.55);
    background: rgba(231, 76, 60, 0.10);
}

.pill--on {
    border-color: rgba(46, 204, 113, 0.55);
    background: rgba(46, 204, 113, 0.10);
}

.btn--sm {
    padding: 8px 10px;
    border-radius: 10px;
    font-size: 12px;
}

.logoutForm {
    display: inline;
}

.status__dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 999px;
    margin-right: 8px;
    vertical-align: middle;
}

.status__dot--ok {
    background: #2ecc71;
}

.status__dot--bad {
    background: #e74c3c;
}



#controlToggleBtn {
    background-color: var(--accent);
    color: #1b1b1b;
}

/* Take Control: show "inactive" (Take control) with 45% background opacity */
#controlToggleBtn[aria-pressed="false"] {
    opacity: 0.45;
}

/* Take Control: active (pressed) uses normal accent */
#controlToggleBtn[aria-pressed="true"] {
    background-color: #ff9900;
    opacity: 1.00;
}

#controlToggleBtn:hover {
    opacity: 0.75;
}


/* =========================================================
   Global button behavior:
   - default: accent color, 45% opacity
   - hover: 75% opacity
   - active/pressed (toggle): 100% opacity
   - disabled: fixed 45% opacity, NO hover behavior
   ========================================================= */

.btn,
.btn--secondary {
    background-color: var(--accent);
    color: #1b1b1b;
    opacity: 0.75;
    transition: none;
}

/* Hover only when enabled */
.btn:hover:not(:disabled),
.btn--secondary:hover:not(:disabled) {
    opacity: 0.45;
}

/* Button visual when it shows "Disable" */
.btn-disable {
    background-color: #ff9900;
    border-color: #ff9900;
    color: #000000;
}

/* Optional: keep disabled buttons visually disabled even if class is present */
button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.tune-main {
    /*max-width: 1100px;*/
    /*margin: 0 auto;*/
    /*width: 100%;*/

    max-width: none;
    margin: 0;
    width: 100%;
}

.tune-actions {
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.rate-controller-layout {
    width: 100%;
}

.rate-controller-main {
    max-width: none;
    margin: 0;
    width: 100%;
}

.rate-controller-columns {
    display: grid;
    gap: 12px;
    align-items: start;
}

.rate-controller-column {
    min-width: 0;
}

.rate-controller-column--outer {
    position: relative;
}

@media (min-width: 1200px) {
    .rate-controller-columns {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    }
}

.rate-controller-plot-toolbar {
    display: none;
    position: absolute;
    top: 6px;
    right: 4px;
    /*transform: translateY(calc(-100% - 4px));*/
    transform: translateY(calc(-100%));
    z-index: 2;
}

.rate-controller-plot-toolbar.is-visible {
    display: flex;
}

.rate-controller-head {
    margin-bottom: 16px;
}

.rate-controller-note {
    font-size: 13px;
}

.rate-controller-inputs-shell {
    position: relative;
}

.rate-controller-inputs-shell .step-stimulus-field {
    gap: 4px;
}

.rate-controller-inputs-shell .step-stimulus-field .label,
.rate-controller-inputs-shell .step-stimulus-field label {
    font-size: 11px;
    line-height: 1.1;
}

.rate-controller-inputs-shell .form__input.step-inline-input {
    height: 28px;
    padding: 4px 6px 4px 4px;
    margin-top: 0;
    font-size: 12px;
}

.rate-controller-inputs-shell .step-stimulus-actions {
    gap: 6px;
}

.rate-controller-inputs-shell .step-stimulus-actions .btn--sm {
    padding: 6px 8px;
    font-size: 11px;
}

.rate-controller-inputs-shell .badge {
    min-width: 58px;
    padding: 6px 8px;
    font-size: 11px;
}

.rate-controller-inputs-toggle {
    display: inline-flex;
    margin: 0;
}

.rate-controller-inputs-toggle--mini {
    min-width: 0;
    width: 24px;
    height: 24px;
    padding: 0;
    border-radius: 8px;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    line-height: 1;
}

.rate-controller-inputs-shell.is-collapsed {
    margin-bottom: 10px;
}

.rate-controller-inputs-wrap {
    display: block;
}

.rate-controller-inputs-wrap.is-collapsed {
    display: none;
}

.rate-controller-inputs-top-panel {
    padding-right: 12px;
}

.rate-controller-stage-host {
    display: block;
}

.rate-controller-top-toolbar {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-bottom: 10px;
}

.rate-controller-top-toolbar--below-line3 {
    margin-bottom: 0;
}

.rc-server-log-panel {
    margin-top: 12px;
}

.rc-server-log-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.rc-server-log-list {
    max-height: 280px;
    overflow: auto;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface2);
}

.rc-server-log-empty {
    font-size: 12px;
}

.rc-server-log-entry {
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    font-family: Consolas, Monaco, 'Courier New', monospace;
    font-size: 12px;
    line-height: 1.45;
}

.rc-server-log-entry:first-child {
    padding-top: 0;
}

.rc-server-log-entry:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.rc-server-log-entry.is-warn .rc-server-log-scope {
    color: var(--accent_soft);
}

.rc-server-log-line {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: flex-start;
}

.rc-server-log-time {
    min-width: 152px;
}

.rc-server-log-scope {
    color: var(--accent);
}

.rc-server-log-message {
    flex: 1 1 220px;
    min-width: 220px;
    word-break: break-word;
}

.rc-server-log-details {
    margin: 6px 0 0 160px;
    white-space: pre-wrap;
    color: var(--muted);
}

@media (max-width: 900px) {
    .rc-server-log-time {
        min-width: 0;
        width: 100%;
    }

    .rc-server-log-details {
        margin-left: 0;
    }
}

.rate-controller-top-grid {
    display: grid;
    gap: 12px;
    align-items: start;
}

.rate-controller-top-left,
.rate-controller-top-right {
    display: grid;
    gap: 12px;
    min-width: 0;
}

.rate-controller-line-shell {
    min-width: 0;
}

.rate-controller-force-break {
    flex-basis: 100%;
    width: 100%;
    height: 0;
}

@media (min-width: 1200px) {
    .rate-controller-top-grid {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    }
}

.rate-controller-stages {
    margin-top: 4px;
}

.rate-controller-stage-pill,
.rate-controller-panel-pill {
    background: rgba(255, 255, 255, 0.03);
}

.rate-controller-input-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
}

.rate-controller-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 120px;
}

.rate-controller-field--narrow {
    min-width: 100px;
}

.rate-controller-input {
    width: 100px;
    min-width: 100px;
    margin-top: 0;
    margin-right: 0;
}

.rate-controller-actions {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-left: auto;
}

.rate-controller-layout-badge {
    display: inline-flex;
}

.rate-controller-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    letter-spacing: 0.02em;
}

.rate-controller-placeholder--plot {
    min-height: 420px;
}

.rate-controller-placeholder--runs {
    min-height: 120px;
}

.step-plot-frame {
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}

.step-plot-frame.is-fullscreen {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100vw;
    height: 100vh;
    padding: 12px;
    border: 0;
    border-radius: 0;
    background: var(--bg);
}

.step-plot-frame.is-fullscreen #stepInnerPlot {
    flex: 1 1 auto;
    min-height: 0;
    height: auto !important;
}

.step-plot-frame.is-fullscreen #rcOuterPlot {
    flex: 1 1 auto;
    min-height: 0;
    height: auto !important;
}

.step-plot-frame.is-fullscreen #stepInnerSignals {
    flex: 0 0 auto;
    overflow: auto;
}

.step-plot-frame.is-fullscreen #rcOuterSignals {
    flex: 0 0 auto;
    overflow: auto;
}

#sigGyroX {
    accent-color: rgba(255,80,80,0.9);
}

#sigGyroX + span {
    color: rgba(255,80,80,0.9);
}

#sigGyroY {
    accent-color: rgba(80,255,80,0.9);
}

#sigGyroY + span {
    color: rgba(80,255,80,0.9);
}

#sigGyroZ {
    accent-color: rgba(80,140,255,0.9);
}

#sigGyroZ + span {
    color: rgba(80,140,255,0.9);
}

#sigM0 {
    accent-color: rgba(180,120,255,0.85);
}

#sigM0 + span {
    color: rgba(180,120,255,0.85);
}

#sigM1 {
    accent-color: rgba(100,200,255,0.85);
}

#sigM1 + span {
    color: rgba(100,200,255,0.85);
}

#sigM2 {
    accent-color: rgba(255,180,60,0.85);
}

#sigM2 + span {
    color: rgba(255,180,60,0.85);
}

#sigM3 {
    accent-color: rgba(60,220,180,0.85);
}

#sigM3 + span {
    color: rgba(60,220,180,0.85);
}

#sigM4 {
    accent-color: rgba(255,120,180,0.85);
}

#sigM4 + span {
    color: rgba(255,120,180,0.85);
}

#sigM5 {
    accent-color: rgba(200,200,80,0.85);
}

#sigM5 + span {
    color: rgba(200,200,80,0.85);
}

#rcOuterSigGyroX {
    accent-color: rgba(255,80,80,0.9);
}

#rcOuterSigGyroX + span {
    color: rgba(255,80,80,0.9);
}

#rcOuterSigGyroY {
    accent-color: rgba(80,255,80,0.9);
}

#rcOuterSigGyroY + span {
    color: rgba(80,255,80,0.9);
}

#rcOuterSigGyroZ {
    accent-color: rgba(80,140,255,0.9);
}

#rcOuterSigGyroZ + span {
    color: rgba(80,140,255,0.9);
}

#rcOuterSigM0 {
    accent-color: rgba(180,120,255,0.85);
}

#rcOuterSigM0 + span {
    color: rgba(180,120,255,0.85);
}

#rcOuterSigM1 {
    accent-color: rgba(100,200,255,0.85);
}

#rcOuterSigM1 + span {
    color: rgba(100,200,255,0.85);
}

#rcOuterSigM2 {
    accent-color: rgba(255,180,60,0.85);
}

#rcOuterSigM2 + span {
    color: rgba(255,180,60,0.85);
}

#rcOuterSigM3 {
    accent-color: rgba(60,220,180,0.85);
}

#rcOuterSigM3 + span {
    color: rgba(60,220,180,0.85);
}

#rcOuterSigM4 {
    accent-color: rgba(255,120,180,0.85);
}

#rcOuterSigM4 + span {
    color: rgba(255,120,180,0.85);
}

#rcOuterSigM5 {
    accent-color: rgba(200,200,80,0.85);
}

#rcOuterSigM5 + span {
    color: rgba(200,200,80,0.85);
}

@media (max-width: 900px) {
    .rate-controller-inputs-toggle {
        margin-bottom: 10px;
    }

    .rate-controller-inputs-top-panel {
        padding-right: 12px;
    }

    .rate-controller-actions {
        margin-left: 0;
        width: 100%;
    }
}

/* Pressed/toggled state */
/*.btn[aria-pressed="true"],*/
/*.btn--secondary[aria-pressed="true"],*/
/*.btn.is-active,*/
/*.btn--secondary.is-active {*/
/*    background-color: #ff9900;*/
/*    opacity: 0.10;*/
/*}*/

/*!* Optional: if you want pressed state to also change color (like your #ff9900 example)*/
/*   set a variable and use it here instead of hardcoding:*/
/*   .btn[aria-pressed="true"] { background-color: var(--accent_active); }*/
/**!*/

/*!* Disabled: no hover, keep dim, keep cursor *!*/
/*.btn:disabled,*/
/*.btn--secondary:disabled,*/
/*.btn[disabled],*/
/*.btn--secondary[disabled] {*/
/*    opacity: 0.45;*/
/*    cursor: not-allowed;*/
/*}*/

/*!* Ensure disabled never changes on hover even if other rules match *!*/
/*.btn:disabled:hover,*/
/*.btn--secondary:disabled:hover,*/
/*.btn[disabled]:hover,*/
/*.btn--secondary[disabled]:hover {*/
/*    opacity: 0.45;*/
/*}*/

/* ===========================
   Mobile topbar hamburger
   =========================== */

.topbar {
    position: sticky;
}

/* Right side wrapper for hamburger + dropdown nav */
.topbar__right {
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
}

/* Hide the checkbox itself */
.navToggle {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

/* Hamburger button (hidden on desktop) */
.hamburger {
    display: none;
    width: 40px;
    height: 36px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

/* 3-bar icon */
.hamburger span {
    display: block;
    width: 18px;
    height: 2px;
    background: var(--fg);
    position: relative;
}

.hamburger span::before,
.hamburger span::after {
    content: "";
    position: absolute;
    left: 0;
    width: 18px;
    height: 2px;
    background: var(--fg);
}

.hamburger span::before { top: -6px; }
.hamburger span::after  { top:  6px; }

/* Mobile breakpoint (matches your project convention) */
@media (max-width: 770px) {

    /* Keep left items visible, collapse everything else into hamburger */
    .topbar {
        flex-wrap: nowrap;
    }

    /* Show hamburger */
    .hamburger {
        display: inline-flex;
    }

    /* Nav becomes a dropdown panel */
    .topbar__nav {
        display: none;
        position: absolute;
        right: 0;
        top: calc(100% + 8px);
        min-width: 180px;
        padding: 8px;
        background: var(--surface);
        border: 1px solid var(--border);
        border-radius: 12px;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
        flex-direction: column;
        gap: 6px;
        z-index: 20;
    }

    /* Reveal when checked (CSS-only) */
    .topbar:has(#navToggle:checked) .topbar__nav {
        display: flex;
    }

    /* Turn hamburger into X when open */
    .topbar:has(#navToggle:checked) .hamburger span {
        background: transparent;
    }
    .topbar:has(#navToggle:checked) .hamburger span::before {
        top: 0;
        transform: rotate(45deg);
    }
    .topbar:has(#navToggle:checked) .hamburger span::after {
        top: 0;
        transform: rotate(-45deg);
    }

    /* ---------------------------------------
       Mobile abbreviations (no JS required)
       - Connection text: Con / Dis
       - Control button: TC / RC
       --------------------------------------- */

    /* Replace status text visually */
    #connText {
        font-size: 0;          /* hide original text, keep for JS/screen readers */
        line-height: 0;
    }
    #connText::after {
        font-size: 12px;
        line-height: 1;
        content: "";
    }
    /*.status:has(#connDot.status__dot--ok) #connText::after  { content: "Con"; }*/
    /*.status:has(#connDot.status__dot--bad) #connText::after { content: "Dis"; }*/

    #connText {
        display: none;         /* removes it from layout -> no reserved space */
    }

    .status__dot {
        margin: 0;
        padding: 0;
        width: 10px;
        height: 10px;
    }

    /* Replace control button label visually */
    #controlToggleBtn {
        font-size: 0;          /* hide original text, keep for JS/screen readers */
        line-height: 0;
        min-width: 44px;       /* keeps it tappable */
        padding-left: 12px;
        padding-right: 12px;
    }
    #controlToggleBtn::after {
        font-size: 12px;
        line-height: 1;
        content: "TC";
    }
    #controlToggleBtn[aria-pressed="true"]::after {
        content: "RC";
    }
}

/** Danger button *************************************************************************************************** */
.btn--danger {
    background: rgba(255, 85, 85, 0.14);
    border: 1px solid rgba(255, 85, 85, 0.40);
    color: var(--fg);
}
.btn--danger:hover:not(:disabled) {
    background: rgba(255, 85, 85, 0.22);
}

/** ADMIN SITE ****************************************************************************************************** */

/* Admin tabs */
.adminTabs {
    display: flex;
    gap: 10px;
    margin: 0 0 14px 0;
    padding: 6px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
}

.adminTab {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 10px;
    text-decoration: none;
    color: var(--fg);
    border: 1px solid transparent;
}

.adminTab:hover {
    border-color: var(--border);
}

.adminTab--active {
    border-color: var(--border);
    background: rgba(255, 255, 255, 0.06);
}

@media (max-width: 770px) {
    .adminTabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
    }
}



/*!*!* Step response recorded runs (DB) *!*!*/
/*.step-run-table {*/
/*    border: 1px solid var(--border);*/
/*    border-radius: 12px;*/
/*    overflow-x: auto;   !* never spill out of the panel *!*/
/*    overflow-y: hidden;*/
/*    width: 100%;*/
/*}*/



/*.step-stars {*/
/*    display: inline-flex;*/
/*    gap: 2px;*/
/*    align-items: center;*/
/*}*/

/*.step-stars button {*/
/*    appearance: none;*/
/*    border: 0;*/
/*    background: transparent;*/
/*    color: var(--muted);*/
/*    padding: 0 2px;*/
/*    font-size: 16px;*/
/*    cursor: pointer;*/
/*    line-height: 1;*/
/*}*/

/*.step-stars button.is-on {*/
/*    color: var(--accent);*/
/*}*/

/*.step-runs-empty {*/
/*    color: var(--muted);*/
/*    font-size: 13px;*/
/*}*/

/*!* Minimal dialog styling *!*/
/*dialog.step-dialog {*/
/*    background: var(--surface);*/
/*    color: var(--fg);*/
/*    border: 1px solid var(--border);*/
/*    border-radius: 14px;*/
/*    padding: 14px;*/
/*    max-width: 620px;*/
/*    width: calc(100% - 24px);*/
/*}*/

/*dialog.step-dialog::backdrop {*/
/*    background: rgba(0, 0, 0, 0.65);*/
/*}*/

/*.step-dialog .dlg-title {*/
/*    font-weight: 800;*/
/*    margin-bottom: 10px;*/
/*}*/

/*.step-dialog .dlg-actions {*/
/*    display: flex;*/
/*    gap: 10px;*/
/*    justify-content: flex-end;*/
/*    margin-top: 12px;*/
/*}*/
