@font-face {
    font-family: 'Expansiva Bold';
    src: url('ExpansivaBold-stripped.woff2') format('woff2');
    font-weight: bold;
    font-style: normal;
}

html {
    height: 100%;
}

body {
    --ui-font-family: Arial, Helvetica, sans-serif;
    font-family: var(--ui-font-family);
    margin: 0;
    padding: 0;
    background: rgb(24,23,23);
    color: white;
    min-height: 100%;
    min-height: 100dvh;
    overflow-y: auto;
    overflow-x: hidden;
    padding-top: 90px; /* Prevent content under header */
    box-sizing: border-box;
}
/* CSS for helvetica-w01-roman) */
  
.container {
    text-align: center;
    width: 100%;
    min-height: calc(100vh - 90px);
    min-height: calc(100dvh - 90px);
    box-sizing: border-box;
}

.content-area {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    font-family: var(--ui-font-family);
}

h1 {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

p {
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
}

.button {
    padding: 10px 20px;
    font-size: 1rem;
    color: #E5FA00;
    background: white;
    border: none;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    transition: background 0.3s, color 0.3s;
    background-color: #E5FA00;
    color: #000;
    cursor: pointer;
    font-family: var(--ui-font-family);
}

.button:hover {
    background: #E5FA00;
    color: white;
    background-color: #E5FA00;
}

.time-display {
    position: absolute;
    top: 10px;
    right: 10px;
    text-align: right;
    font-size: 1rem;
    color: white;
}

.input-field {
    padding: 10px;
    font-size: 1rem;
    border: 1px solid #ccc;
    border-radius: 5px;
    margin-right: 10px; /* Add spacing between input and button */
    flex: 1;
    font-size: 16px;
    font-family: var(--ui-font-family);
    outline: none;
}

.input-field:focus {
    border-color: #E5FA00;
}

.input-button-group {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 10px 0; /* Add spacing between rows */
}

.terminal {
    margin-top: 20px;
    height: 200px;
    background-color: #000;
    color: #E5FA00;
    font-family: var(--ui-font-family);
    padding: 10px;
    overflow: auto;
    white-space: pre;
    border: 1px solid #ccc;
}

.input-container {
    display: flex;
    margin-top: 10px;
}

.main-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 90px;
    background: #575757;
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 1000;
    padding: 0 24px; /* slightly reduced */
    box-sizing: border-box; /* ensures padding is included in width */
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    overflow: hidden; /* prevents content overflow */
}

.header-left {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
}

.header-left .logo {
    height: 40px;
}

.header-center {
    font-family: 'Expansiva Bold', Arial, Helvetica, sans-serif;
    flex: 1 1 0;
    display: flex;
    justify-content: center;
    gap: 16px;
    font-size: 1rem;
    min-width: 0;
    overflow: hidden;
}

.header-center a {
    color: #E5FA00;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.2s;
    white-space: nowrap;
}

.header-center a:hover {
    color: #E5FA00;
}

.header-right {
    flex: 0 0 auto;
    font-family: var(--ui-font-family);
    font-size: 1rem;
    text-align: right;
    white-space: nowrap;
}

.connection-status {
    font-size: 0.85rem;
    font-weight: bold;
    min-height: 1.1em;
}

.connection-status.connected {
    color: #4CAF50;
}

.connection-status.disconnected {
    color: #f44336;
}

.tuning-frame {
    width: min(96vw, 1650px);
    max-width: 1650px;
    min-height: calc(100vh - 170px);
    box-sizing: border-box;
    border: 6px solid #E5FA00;
    background: #000;
    padding: 20px 18px 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tuning-mode-bar {
    width: min(94vw, 1500px);
    margin: 0 auto 12px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.tuning-mode-left,
.tuning-mode-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.tuning-mode-right {
    margin-left: auto;
    justify-content: flex-end;
}

.tuning-mode-label,
.tuning-mode-state,
.tuning-status {
    font-family: var(--ui-font-family);
    font-weight: 700;
}

.tuning-mode-label {
    color: #fff;
    font-size: 1rem;
}

.tuning-mode-state {
    color: #E5FA00;
    font-size: 1rem;
}

.tuning-status {
    width: min(94vw, 1500px);
    margin: 0 auto 10px;
    text-align: center;
    color: #E5FA00;
    font-size: 1rem;
}

.tuning-mode-bar .tuning-apply {
    min-width: 92px;
}

.tuning-row {
    display: grid;
    grid-template-columns: 1fr 92px;
    gap: 16px;
    align-items: center;
    position: relative;
    width: min(94vw, 1500px);
    margin: 0 auto;
}

.tuning-group-title {
    display: grid;
    grid-template-columns: 1fr 92px;
    gap: 16px;
    color: #E5FA00;
    font-size: 1.7rem;
    font-weight: 700;
    margin-top: 4px;
    margin-bottom: 2px;
    font-family: var(--ui-font-family);
    width: min(94vw, 1500px);
    margin-left: auto;
    margin-right: auto;
}

.tuning-group-title span {
    grid-column: 1;
    text-align: center;
}

.tuning-group-title-separator {
    margin-top: 72px;
}

.tuning-group-title + .tuning-row {
    margin-top: -24px;
}

.tuning-left,
.tuning-right {
    color: #fff;
    font-size: 1.45rem;
    line-height: 1.2;
    font-family: var(--ui-font-family);
    grid-column: 1;
    grid-row: 1;
    align-self: start;
    margin-top: 26px;
    width: max-content;
    text-align: center;
    z-index: 3;
}

.tuning-left {
    justify-self: start;
    transform: translateX(-45%);
}

.tuning-right {
    justify-self: end;
    transform: translateX(45%);
}

.tuning-center {
    grid-column: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    position: relative;
}

.tuning-center::before,
.tuning-center::after {
    content: "";
    position: absolute;
    top: 34px;
    width: 3px;
    height: 18px;
    background: #fff;
    z-index: 2;
}

.tuning-center::before {
    left: 0;
}

.tuning-center::after {
    right: 0;
}

.tuning-position {
    color: #fff;
    font-size: 1.05rem;
    font-weight: 700;
    font-family: var(--ui-font-family);
}

.tuning-slider {
    width: 100%;
    background: transparent;
    appearance: none;
    height: 24px;
    --fill-left: 50%;
    --fill-right: 50%;
}

.tuning-slider::-webkit-slider-runnable-track {
    height: 12px;
    background: linear-gradient(
        to right,
        #fff 0%,
        #fff var(--fill-left),
        #E5FA00 var(--fill-left),
        #E5FA00 var(--fill-right),
        #fff var(--fill-right),
        #fff 100%
    );
    border-radius: 999px;
}

.tuning-slider::-moz-range-track {
    height: 12px;
    background: linear-gradient(
        to right,
        #fff 0%,
        #fff var(--fill-left),
        #E5FA00 var(--fill-left),
        #E5FA00 var(--fill-right),
        #fff var(--fill-right),
        #fff 100%
    );
    border-radius: 999px;
}

.tuning-slider::-webkit-slider-thumb {
    appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #E5FA00;
    border: 2px solid #000;
    margin-top: -10px;
}

.tuning-slider::-moz-range-thumb {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #E5FA00;
    border: 2px solid #000;
}

.tuning-scale {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(21, 1fr);
    color: #fff;
    font-size: 0.72rem;
    line-height: 1;
    user-select: none;
    font-family: var(--ui-font-family);
}

.tuning-scale span {
    text-align: center;
    position: relative;
    padding-top: 6px;
    font-size: 0;
    line-height: 0;
}

.tuning-scale span::before {
    content: "";
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 9px;
    background: #fff;
}

.tuning-scale span:nth-child(11)::before {
    height: 13px;
}

.tuning-scale span:first-child::before,
.tuning-scale span:last-child::before {
    width: 3px;
    height: 15px;
}

.tuning-apply {
    grid-column: 2;
    background: #E5FA00;
    color: #000;
    border: none;
    border-radius: 0;
    padding: 8px 10px;
    font-family: var(--ui-font-family);
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
}

/* ── Data Log tab ────────────────────────────────────────────────────── */

.datlog-toolbar {
    margin: 10px 0;
    display: flex;
    gap: 14px;
    align-items: center;
    font-family: var(--ui-font-family);
}

.datlog-controls {
    margin: 10px 0;
    display: flex;
    gap: 10px;
    align-items: center;
    font-family: var(--ui-font-family);
}

.datlog-toggle-btn {
    padding: 6px 14px;
    font-size: 0.9em;
    font-weight: bold;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    min-width: 120px;
    font-family: var(--ui-font-family);
    transition: background-color 0.2s;
}

.datlog-toggle-btn.active {
    background-color: #4CAF50;
    color: #fff;
}

.datlog-toggle-btn.inactive {
    background-color: #666;
    color: #ccc;
}

.datlog-live-panel {
    width: 400px;
    max-height: calc(100vh - 250px);
    overflow: auto;
    border: 1px solid #444;
    padding: 10px;
    background: #1a1a1a;
}

.datlog-live-table {
    width: 100%;
    font-size: 0.85em;
    font-family: monospace;
    border-collapse: collapse;
}

.datlog-field-name {
    color: #888;
    padding: 2px 10px 2px 0;
    white-space: nowrap;
}

.datlog-field-value {
    color: #0f0;
    padding: 2px 0;
}


/* ── Arnold Query panels ─────────────────────────────────────────────── */

.query-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 12px;
    width: 100%;
    max-width: 1200px;
    margin: 14px 0;
}

.query-panel {
    border: 1px solid #444;
    background: #1a1a1a;
    border-radius: 4px;
    overflow: hidden;
}

.query-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #2a2a2a;
    padding: 6px 10px;
}

.query-panel-header h4 {
    margin: 0;
    font-size: 0.9em;
    color: #E5FA00;
}

.query-panel-body {
    padding: 8px 10px;
    font-family: monospace;
    font-size: 0.82em;
    min-height: 40px;
    color: #888;
}

.query-panel-body table {
    width: 100%;
    border-collapse: collapse;
}

.query-panel-body td {
    padding: 1px 6px 1px 0;
    vertical-align: top;
}

.query-panel-body td:first-child {
    color: #888;
    white-space: nowrap;
    width: 1%;
}

.query-panel-body td:last-child {
    color: #0f0;
    text-align: right;
}

.query-panel-body .bool-true { color: #4CAF50; }
.query-panel-body .bool-false { color: #f44336; }

.query-btn {
    padding: 3px 10px;
    font-size: 0.78em;
    background: #E5FA00;
    color: #000;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-weight: bold;
}

@media (max-width: 1200px) {
    .tuning-mode-bar {
        gap: 10px;
    }

    .tuning-mode-left,
    .tuning-mode-right {
        width: 100%;
    }

    .tuning-mode-right {
        justify-content: flex-end;
    }

    .tuning-row {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .tuning-left,
    .tuning-right {
        text-align: center;
        font-size: 1.2rem;
    }

    .tuning-apply {
        justify-self: center;
    }
}
