/* vendor fonts loaded via <link> in index.html */

/* Responsive: hide elements on desktop */
@media (min-width: 768px) {
    .mobile-only { display: none !important; }
}

/* Lucide icon sizing — inherit font-size so text-* classes control SVG size */
[data-lucide] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1em;
    height: 1em;
    flex-shrink: 0;
}
[data-lucide] svg {
    width: 100% !important;
    height: 100% !important;
}

@keyframes spin-slow {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
@keyframes spin-reverse {
    from { transform: rotate(0deg); }
    to { transform: rotate(-360deg); }
}
@keyframes flood-bob {
    0%, 100% { transform: translateY(0) scale(1); }
    35% { transform: translateY(1px) scale(0.94); }
    65% { transform: translateY(-1px) scale(1.06); }
}
.animate-spin-slow { animation: spin-slow 2s linear infinite; }
.animate-spin-reverse { animation: spin-reverse 2s linear infinite; }
.animate-flood-flow { animation: flood-bob 1s ease-in-out infinite; }

/*
 * OOZNEST MACHINE CONTROL THEME v9.0
 * This file is now the SOLE authority for all component styling.
 * @layer components removed from index.html — Tailwind CDN provides utilities only.
 * No !important wars. Clean cascade.
 *
 * Card design: oz-showcase-sidebar from OOZNEST-CSS/ooznest-ui.css
 *   - Full colored background per section
 *   - Single large corner (96px) alternating per card
 *   - CSS callout pointer arrows (right + bottom)
 */

/* ================================================================
   BRAND TOKENS — 1:1 with OOZNEST-CSS/ooznest-ui.css
   ================================================================ */
:root {
    /* Primary orange */
    --oz-primary: #FF6600;
    --oz-primary-light: #FF8533;
    --oz-primary-dark: #D55700;

    /* Teal */
    --oz-teal-brand: #004C5B;
    --oz-teal-mid: #449D9F;
    --oz-teal-light: #B0CACF;
    --oz-teal-xlight: #EBEFEF;
    --oz-secondary-dark: var(--oz-teal-brand);
    --oz-secondary: var(--oz-teal-mid);
    --oz-secondary-light: var(--oz-teal-light);

    /* Neutrals */
    --oz-black: #0D1F22;
    --oz-grey-dark: #2F373C;
    --oz-grey-mid: #6B7280;
    --oz-grey-light: #EBEFEF;
    --oz-white: #FFFFFF;
    --oz-bg-panel: #F7F9F9;

    /* Gradients */
    --oz-grad-teal: radial-gradient(78.83% 124.97% at 96% 82.92%, #004C5B 0%, #449D9F 100%);
    --oz-grad-orange: radial-gradient(78.83% 124.97% at 96% 82.92%, #FFB482 0%, #FF6600 100%);

    /* Shadows */
    --oz-shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --oz-shadow-md: 0 8px 24px rgba(0, 0, 0, 0.08);
    --oz-shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.12);

    /* Radius — from ooznest-ui.css but scaled down for the app */
    --oz-r-xl: 30px;
    --oz-r-md: 16px;
    --oz-r-sm: 10px;
    --oz-r-xs: 6px;
    --oz-r-control: 8px;

    /* Status */
    --oz-success: #027A48;
    --oz-error: #B41B13;
    --oz-warning: #FFB300;

    /* Axis colours */
    --axis-x: #e11d48;
    --axis-y: #16a34a;
    --axis-z: #2563eb;
    --axis-a: #ea580c;

    /* ── Tailwind token aliases so bg-primary etc still resolve ── */
    --color-primary: var(--oz-teal-mid);
    --color-primary-light: #6DBCBE;
    --color-primary-dark: var(--oz-teal-brand);
    --color-secondary: var(--oz-primary);
    --color-secondary-light: var(--oz-primary-light);
    --color-secondary-dark: var(--oz-primary-dark);
    --color-grey-dark: var(--oz-grey-dark);
    --color-grey: var(--oz-grey-mid); /* #6B7280 — WCAG AA compliant on white */
    --color-grey-light: var(--oz-teal-xlight);
    --color-bg: var(--oz-bg-panel);
    --color-surface: var(--oz-white);
    --color-axis-x: var(--axis-x);
    --color-axis-y: var(--axis-y);
    --color-axis-z: var(--axis-z);
    --color-axis-a: var(--axis-a);
    --oz-select-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M4 6l4 4 4-4' stroke='%236B7280' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

/* ================================================================
   GLOBAL RESET & BASE
   ================================================================ */
*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', 'Inter', sans-serif;
    color: var(--oz-grey-dark);
    background: #EBEFEF;
    -webkit-font-smoothing: antialiased;
    margin: 0;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Nunito', 'Inter', sans-serif;
    font-weight: 700;
}

button,
.btn,
.tab-btn,
.dro-zero-btn,
.dro-sub-btn,
.jog-btn,
.jog-btn-extra,
.btn-secondary,
.btn-ovr,
.btn-primary,
.btn-danger,
.btn-ghost,
select {
    font-family: 'Nunito', 'Inter', sans-serif;
}

.macro-card {
    border-radius: 22px;
    min-height: 5.25rem;
}

.macro-card-actions {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: var(--oz-shadow-sm);
    opacity: 1;
    transition: opacity 0.15s ease;
}

.macro-card-action-btn {
    width: 2rem;
    height: 2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 9999px;
    background: rgba(0, 0, 0, 0.05);
    color: var(--oz-secondary);
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.macro-card-action-btn:hover {
    background: rgba(255, 102, 0, 0.12);
    color: #FF6600;
}

.macro-card-action-btn:focus-visible {
    outline: 2px solid rgba(255, 102, 0, 0.45);
    outline-offset: 2px;
}

.macro-card-action-btn [data-lucide] {
    pointer-events: none;
}

@media (min-width: 768px) {
    .macro-card-actions {
        opacity: 0;
    }

    .macro-card:hover .macro-card-actions {
        opacity: 1;
    }
}

.macro-card-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 9999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.macro-card-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.macro-card--add {
    min-height: 5.25rem;
}

.macro-card-add-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 0.9rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #eef2f3;
    color: #0b6172;
    flex-shrink: 0;
}

.macro-card-add-label {
    font-size: 1.15rem;
    line-height: 1.1;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: rgb(107, 114, 128);
}

.macro-grid-responsive {
    grid-template-columns: repeat(1, minmax(0, 1fr));
}

@media (min-width: 700px) {
    .macro-grid-responsive {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1050px) {
    .macro-grid-responsive {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (min-width: 1380px) {
    .macro-grid-responsive {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.macro-card--add {
    border-radius: 22px;
    min-height: 5.25rem;
}

.macro-card-gcode {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--oz-teal-light);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--oz-teal-mid);
}

/* ================================================================
   APP SHELL
   ================================================================ */
.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    background: #EBEFEF;
    color: var(--oz-grey-dark);
    font-family: 'Roboto', 'Inter', sans-serif;
    position: relative;
}

@media (min-width: 768px) {
    .app-container {
        flex-direction: row;
    }
}

/* ================================================================
   ELECTRON TITLE BAR
   ================================================================ */
#electron-title-bar {
    background: var(--oz-teal-brand);
    border-bottom: 1px solid rgba(68, 157, 159, 0.3);
    z-index: 10000;
}

#electron-title-bar span {
    color: var(--oz-teal-mid);
    font-family: 'Roboto', sans-serif;
    letter-spacing: 2px;
    font-size: 9px;
}

/* ================================================================
   NAV / TAB BAR — White header like oz-header
   ================================================================ */
/* The very first div inside main is the nav bar */
.app-container>main>div:first-child,
.app-container>div:not(.machine-sidebar)>div:first-child {
    background: var(--oz-white);
    display: flex;
    align-items: center;
    height: 52px;
    flex-shrink: 0;
    overflow: visible;
}

#app-logo {
    filter: none;
    opacity: 1;
}

/* Hamburger button */
#sidebar-toggle {
    color: var(--oz-teal-brand);
    background: transparent;
    border: none;
    border-radius: var(--oz-r-xs);
    padding: 6px 8px;
    cursor: pointer;
    transition: all 0.15s;
    flex-shrink: 0;
}

#sidebar-toggle:hover {
    color: var(--oz-primary);
    background: var(--oz-teal-xlight);
}

/* Scroll arrows on tab bar */
#tabs-scroll-container {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 4px;
    background: transparent;
    overflow-x: auto;
    flex: 1;
    scrollbar-width: none;
}

#tabs-scroll-container::-webkit-scrollbar {
    display: none;
}

/* ================================================================
   TABS
   ================================================================ */
.tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 14px;
    border-radius: var(--oz-r-xs);
    border: 1.5px solid transparent;
    background: transparent;
    color: var(--oz-grey-mid);
    font-family: 'Nunito', 'Roboto', sans-serif;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.15s;
    user-select: none;
}

.tab-btn:hover {
    color: var(--oz-teal-brand);
    background: var(--oz-teal-xlight);
    border-color: var(--oz-teal-xlight);
}

.tab-btn.active {
    background: var(--oz-primary);
    color: white;
    border-color: var(--oz-primary);
    font-weight: 800;
    box-shadow: 0 3px 10px rgba(13, 31, 34, 0.12);
}

.tab-badge {
    background: var(--oz-primary);
    color: white;
    border-radius: 10px;
    font-size: 9px;
    font-weight: 800;
    padding: 1px 5px;
}

/* ================================================================
   MACHINE SIDEBAR
   ================================================================ */
.machine-sidebar {
    width: 100%;
    flex-shrink: 0;
    background: var(--oz-grey-light);
    border-right: 1px solid var(--oz-teal-xlight);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: fixed;
    inset-block: 0;
    left: 0;
    z-index: 50;
    transform: translateX(-100%);
    transition: transform 300ms ease-in-out;
    box-shadow: 6px 0 20px rgba(0, 0, 0, 0.22);
}

.machine-sidebar.open {
    transform: translateX(0);
}

@media (min-width: 768px) {
    .machine-sidebar {
        position: relative;
        transform: translateX(0);
        width: 376px;
    }
}

/* Mobile header strip */
@media (max-width: 767px) {
    .machine-sidebar>div.md\:hidden {
        background: var(--oz-teal-brand);
        color: white;
        padding: 10px 14px;
        font-weight: 700;
        font-size: 13px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        flex-shrink: 0;
    }
}

@media (min-width: 768px) {
    .machine-sidebar .md\:hidden {
    display: none !important;
}

/* ── Shockwave animation for Unlock button ─────────────────────── */
.shockwave {
    animation: shockwaveJump 0.8s ease-out infinite;
    position: relative;
    z-index: 1;
}
.shockwave::before,
.shockwave::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    border-radius: inherit;
    animation: shockwaveRing 0.8s ease-out infinite;
    pointer-events: none;
}
.shockwave::after {
    animation-delay: 0.15s;
}
@keyframes shockwaveJump {
    0%   { transform: scale(1); }
    30%  { transform: scale(1.06); }
    45%  { transform: scale(0.97); }
    55%  { transform: scale(1.02); }
    65%  { transform: scale(0.98); }
    100% { transform: scale(1); }
}
@keyframes shockwaveRing {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.5);
    }
    100% {
        transform: scale(1.15);
        box-shadow: 0 0 0 8px rgba(255, 255, 255, 0);
    }
}
}

/* Machine controls scrollable area.
   flex: 0 1 auto = don't grow beyond content, but CAN shrink.
   min-height: 0 is required to allow a flex item to shrink below
   its content size — without it, the item won't scroll, it'll just overflow. */
#machine-controls {
    flex: 0 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 8px 8px 8px 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    scrollbar-width: thin;
    scrollbar-color: var(--oz-teal-light) transparent;
}

/* ────────────────────────────────────────────────────────────────
   SIDEBAR CARD 1 — CONNECTION
   oz-showcase-sidebar--teal style
   Full #449D9F background, 96px top-left corner, right callout arrow
   ──────────────────────────────────────────────────────────────── */
#sidebar-connect {
    border-radius: 0;
    background: transparent;
    border: none;
    padding: 2px 0;
    box-shadow: none;
    position: relative;
    overflow: visible;
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

@media (min-width: 768px) {
    #sidebar-connect {
        border-radius: var(--oz-r-xl) 0 0 0;
        background: var(--oz-teal-xlight);
        padding: 2px;
        gap: 6px;
        box-shadow: var(--oz-shadow-md);
    }
}

/* Connect button: white on teal, orange on hover (oz-btn--white) */
#btn-connect {
    flex: 1;
    height: 36px;
    background: var(--oz-primary);
    color: white;
    border: none;
    border-radius: var(--oz-r-xs);
    font-family: 'Nunito', sans-serif;
    font-weight: 800;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: all 0.2s;
}

#btn-connect:hover {
    background: var(--oz-primary);
    transform: translateY(-1px);
}

/* Reset button: transparent on teal -> Updated to Solid White for Contrast */
#btn-reset {
    flex: 1;
    height: 36px;
    background: white;
    color: var(--oz-teal-brand);
    border: 1px solid var(--oz-teal-xlight);
    border-radius: var(--oz-r-xs);
    font-weight: 800;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

#btn-reset:hover {
    background: var(--oz-teal-xlight);
    transform: translateY(-1px);
}

#btn-reset:disabled {
    opacity: 0.5;
    pointer-events: none;
    box-shadow: none;
}

/* Axis card row */
.dro-card {
    display: flex;
    align-items: stretch;
    background: transparent !important;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.25) !important;
    margin-bottom: 4px;
    height: 28px;
}

@media (min-width: 768px) {
    .dro-card {
        height: 28px;
        margin-bottom: 6px;
    }
}

.dro-card.border-l-axis-x {
    border-left: none;
}

.dro-card.border-l-axis-y {
    border-left: none;
}

.dro-card.border-l-axis-z {
    border-left: none;
}

.dro-card.border-l-axis-a {
    border-left: none;
}

/* Home / Zero axis button (left of axis label) */
.dro-home-btn,
.dro-zero-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 6px 5px;
    margin: 2px 2px 2px 0;
    border: none;
    background: rgba(255, 255, 255, 0.12);
    color: white;
    font-size: 8px;
    font-weight: 700;
    cursor: pointer;
    border-radius: var(--oz-r-xs);
    transition: all 0.15s;
    white-space: nowrap;
    line-height: 1.1;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    min-height: 34px;
}
.dro-home-btn:hover,
.dro-zero-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    color: white;
}
.dro-home-btn:active,
.dro-zero-btn:active {
    transform: scale(0.95);
}
.dro-home-btn.text-green-500,
.dro-zero-btn.text-green-500 {
    color: #22c55e;
}
.dro-home-btn.text-green-500:hover,
.dro-zero-btn.text-green-500:hover {
    color: #22c55e;
    background: rgba(34, 197, 94, 0.2);
}
.dro-home-btn i,
.dro-zero-btn i {
    font-size: 10px;
}

@media (min-width: 768px) {
    .dro-home-btn,
    .dro-zero-btn {
        padding: 7px 7px;
        gap: 3px;
        font-size: 9px;
        min-height: 38px;
    }
    .dro-home-btn i,
    .dro-zero-btn i {
        font-size: 11px;
    }
}

/* Column header row */
.dro-header-row {
    height: 18px !important;
    border-bottom: none !important;
    margin-bottom: 1px !important;
}
.dro-header-row .dro-readout {
    align-items: center;
}
.dro-header-row {
    min-width: 72px;
    justify-content: flex-end;
    padding-right: 4px;
}
.dro-header-row .dro-mach-group .dro-coord-header {
    text-align: right;
}
.dro-header-row .dro-work-group {
    justify-content: flex-end;
    padding-right: 5px;
}
@media (min-width: 768px) {
.dro-header-row .dro-mach-group {
        min-width: 60px;
    }
}
.dro-coord-header {
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.4);
    line-height: 1;
}
.dro-home-header {
    display: flex;
    min-width: 24px;
    margin: 2px 2px 2px 0;
}
.dro-zero-header {
    display: flex;
    width: 38px;
    margin: 2px 0;
}
@media (min-width: 768px) {
    .dro-home-header {
        min-width: 52px;
    }
    .dro-zero-header {
        width: 42px;
    }
}

/* Axis letter box */
.dro-label-box {
    width: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent !important;
    border-right: none !important;
    font-family: 'Nunito', sans-serif;
    font-weight: 900;
    font-size: 16px;
    color: white !important;
}

@media (min-width: 768px) {
    .dro-label-box {
        width: 28px;
        font-size: 18px;
    }
}

/* Number area */
.dro-readout {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0px;
    padding: 0 0px;
    background: transparent !important;
    overflow: hidden;
}

/* Work coordinate (large) */
.dro-val-lg {
    font-family: 'Roboto Mono', monospace;
    font-size: 15px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    color: white !important;
    line-height: 1;
    text-align: right;
    flex: 1;
    min-width: 96px;
    align-self: center;
}

@media (min-width: 768px) {
    .dro-val-lg {
        font-size: 21px;
        min-width: 112px;
    }
}

/* Machine coordinate (small) */
.dro-val-sm {
    font-family: 'Roboto Mono', monospace;
    font-size: 13px;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    color: rgba(255, 255, 255, 0.7) !important;
    line-height: 1;
    text-align: right;
    min-width: 48px;
    flex-shrink: 0;
    align-self: center;
}

@media (min-width: 768px) {
    .dro-val-sm {
        min-width: 65px;
    }
}

/* Force full white text on override buttons (spindle, feed, rapids) */
.dro-panel .border-t button,
.dro-panel .border-t span {
    color: white !important;
}

/* Coordinate label tag (W / M) */
.dro-coord-label {
    font-size: 9px;
    font-weight: 800;
    opacity: 0.4;
    letter-spacing: 0.5px;
    line-height: 1;
    align-self: center;
}
.dro-mach-group {
    display: inline-flex;
    align-items: baseline;
    gap: 1px;
    flex-shrink: 0;
    min-width: 60px;
}
.dro-work-group {
    display: inline-flex;
    align-items: baseline;
    gap: 1px;
    flex: 1 0 112px;
    min-width: 112px;
    justify-content: flex-end;
    padding-right: 8px;
}

/* Machine status pill */
.machine-status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 22px;
    padding: 3px 10px;
    background: rgba(255, 255, 255, 0.94);
    color: var(--oz-teal-brand);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 20px;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* Sub-controls: IDLE, HOME, SET ZERO, GO XY0 */
.dro-sub-btn {
    flex: 1;
    background: white !important;
    border: none !important;
    border-radius: 4px;
    color: var(--oz-grey-dark) !important;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 10px 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    transition: all 0.15s;
    text-align: center;
    line-height: 1.2;
    user-select: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.dro-sub-btn:hover {
    background: #fff8f3 !important;
    transform: translateY(-1px);
}

.dro-sub-btn:active {
    transform: scale(0.96);
}

/* HOME button override → solid white on matching bg */
.dro-sub-btn.\!bg-primary,
.dro-panel .bg-primary {
    background: white !important;
    border-color: white !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
}

.dro-sub-btn.\!bg-primary:hover,
.dro-panel .bg-primary:hover {
    background: #FFF7F0 !important;
    transform: translateY(-1px);
}

/* ────────────────────────────────────────────────────────────────
   SIDEBAR CARD 3 — JOG PANEL
   Light teal card, 96px top-left, right callout arrow
   ──────────────────────────────────────────────────────────────── */
#jog-panel {
    background: var(--oz-primary-light);
    border-radius: 0;
    border: none;
    box-shadow: var(--oz-shadow-md);
    padding: 10px;
    position: relative;
    overflow: visible;
    display: flex;
    flex-direction: column;
    flex: 1 1 0;
    min-height: 320px;
}

/* Jog wrapper & grid */
.jog-wrapper {
    display: flex;
    flex: 1 1 auto;
    min-height: 0;
    gap: 12px;
    align-items: center;
    justify-content: center;
}

.jog-pad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 6px;
    width: var(--jog-xy-size, 168px);
    height: var(--jog-xy-size, 168px);
    flex: 0 0 auto;
}

.jog-extra-col {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: var(--jog-z-width, 52px);
    height: 100%;
}

.jog-side {
    display: flex;
    align-items: stretch;
    height: var(--jog-xy-size, 168px);
    flex: 0 0 auto;
}

.jog-side-stack {
    display: flex;
    gap: 6px;
    height: 100%;
}

.jog-toolbar {
    flex: 0 0 auto;
}

/* XY direction buttons */
.jog-btn {
    width: 100%;
    height: 100%;
    background: white;
    border: none;
    border-radius: 4px;
    color: var(--oz-grey-dark);
    font-size: clamp(18px, calc(var(--jog-xy-size, 168px) * 0.22), 30px);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.12s;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    user-select: none;
    -webkit-user-select: none;
}

.jog-btn i {
    width: clamp(18px, calc(var(--jog-xy-size, 168px) * 0.24), 28px);
    height: clamp(18px, calc(var(--jog-xy-size, 168px) * 0.24), 28px);
}

/* Outer corner buttons — big organic radius on the outermost corner */
.jog-btn.rounded-tl-xl {
    border-radius: 20px 6px 6px 6px;
}

.jog-btn.rounded-tr-xl {
    border-radius: 6px 20px 6px 6px;
}

.jog-btn.rounded-bl-xl {
    border-radius: 6px 6px 6px 20px;
}

.jog-btn.rounded-br-xl {
    border-radius: 6px 6px 20px 6px;
}

/* Axis-coloured hover states (Full Color Backgrounds without borders) */
.jog-btn.\!text-axis-y {
    color: var(--axis-y);
}

.jog-btn.\!text-axis-x {
    color: var(--axis-x);
}

.jog-btn[data-jog="Y+"]:hover,
.jog-btn[data-jog="Y-"]:hover {
    background: var(--oz-teal-mid);
    color: white !important;
    box-shadow: 0 4px 12px rgba(68, 157, 159, 0.3);
    transform: translateY(-1px);
}

.jog-btn[data-jog="Y+"]:hover>i,
.jog-btn[data-jog="Y-"]:hover>i {
    color: white !important;
}

.jog-btn[data-jog="X+"]:hover,
.jog-btn[data-jog="X-"]:hover {
    background: var(--oz-teal-mid);
    color: white !important;
    box-shadow: 0 4px 12px rgba(68, 157, 159, 0.3);
    transform: translateY(-1px);
}

.jog-btn[data-jog="X+"]:hover>i,
.jog-btn[data-jog="X-"]:hover>i {
    color: white !important;
}

.jog-btn[data-jog*="X"][data-jog*="Y"]:hover {
    background: var(--oz-teal-mid);
    color: white;
    box-shadow: 0 4px 12px rgba(68, 157, 159, 0.3);
    transform: translateY(-1px);
}

.jog-btn:active {
    transform: scale(0.91);
    box-shadow: none;
}

/* Center D-pad button */
.jog-pad-center {
    background: var(--oz-teal-xlight);
    border-radius: 50%;
    border: 2px solid var(--oz-teal-light);
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.jog-pad-center i {
    color: var(--oz-teal-mid);
    width: clamp(18px, calc(var(--jog-xy-size, 168px) * 0.2), 26px);
    height: clamp(18px, calc(var(--jog-xy-size, 168px) * 0.2), 26px);
}

/* Z / A extra buttons */
.jog-btn-extra {
    width: 100%;
    flex: 1 1 0;
    min-height: 0;
    background: white;
    border: none;
    border-radius: 4px;
    color: var(--oz-grey-dark);
    font-size: clamp(13px, calc(var(--jog-xy-size, 168px) * 0.12), 18px);
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.12s;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    user-select: none;
}

.jog-btn-extra.\!text-axis-z {
    color: var(--axis-z);
}

.jog-btn-extra.\!text-axis-a {
    color: var(--axis-a);
}

.jog-btn-extra.\!text-axis-z:hover,
.jog-btn-extra[data-jog="Z+"]:hover,
.jog-btn-extra[data-jog="Z-"]:hover {
    background: var(--oz-teal-mid);
    color: white !important;
    box-shadow: 0 4px 12px rgba(68, 157, 159, 0.3);
    transform: translateY(-1px);
}

.jog-btn-extra.\!text-axis-z:hover>i {
    color: white !important;
}

.jog-btn-extra.\!text-axis-a:hover {
    background: var(--axis-a);
    color: white !important;
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.3);
    transform: translateY(-1px);
}

.jog-btn-extra.\!text-axis-a:hover>i {
    color: white !important;
}

.jog-btn-extra:active {
    transform: scale(0.91);
}

/* Unlock button */
.btn-secondary {
    background: var(--oz-teal-mid);
    color: white;
    border: 2px solid var(--oz-teal-mid);
    border-radius: var(--oz-r-xs);
    font-weight: 700;
    font-size: 12px;
    padding: 6px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(68, 157, 159, 0.25);
}

.btn-secondary:hover {
    background: var(--oz-primary);
    border-color: var(--oz-primary);
    box-shadow: 0 3px 10px rgba(13, 31, 34, 0.12);
}

/* ================================================================
   WIZARD / FILTER RADIO ROWS
   ================================================================ */

.config-filter-choice {
    background: #ffffff;
    border-top: 0 !important;
    border-bottom: 0 !important;
}

.config-filter-choice.is-selected {
    background: rgba(176, 202, 207, 0.28);
}

.config-filter-choice__label {
    color: var(--oz-grey-dark);
    font-weight: 700;
}

.config-filter-choice__control {
    width: 18px;
    height: 18px;
    min-width: 18px;
    min-height: 18px;
    border: 2px solid #c7d0d5;
    background: #ffffff;
    border-radius: 9999px;
    position: relative;
    flex: 0 0 auto;
}

.config-filter-choice__control > div {
    display: none;
}

.config-filter-choice__control.is-selected {
    background: var(--oz-primary) !important;
    border-color: var(--oz-primary) !important;
}

.config-filter-choice__control.is-selected::after {
    content: "\2713";
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 11px;
    font-weight: 900;
    line-height: 1;
}

/* ================================================================
   WIZARD STEPPER
   ================================================================ */

.wizard-stepper {
    display: flex;
    gap: 18px;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.wizard-stepper__item {
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    position: relative;
}

.wizard-stepper__item::after {
    content: "";
    width: 52px;
    height: 1px;
    margin-left: 0;
    background: #909090;
    border-radius: 4px;
}

.wizard-stepper__item:last-child::after {
    content: none;
}

.wizard-stepper__circle {
    width: 34px;
    height: 34px;
    min-width: 34px;
    min-height: 34px;
    border-radius: 9999px;
    background: #909090;
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
}

.wizard-stepper__label {
    color: var(--oz-grey-dark);
    font-size: 14px;
    font-weight: 400;
}

.wizard-stepper__item.is-active .wizard-stepper__circle {
    background: var(--oz-primary);
    color: #ffffff;
}

.wizard-stepper__item.is-complete .wizard-stepper__circle {
    background: var(--oz-teal-brand);
    color: transparent;
}

.wizard-stepper__item.is-complete .wizard-stepper__circle [data-lucide] {
    color: #ffffff;
}

.wizard-stepper--compact {
    gap: 4px;
    justify-content: flex-start;
}

.wizard-stepper--compact .wizard-stepper__item {
    gap: 5px;
}

.wizard-stepper--compact .wizard-stepper__item::after {
    width: 14px;
    margin-left: 0;
}

.wizard-stepper--compact .wizard-stepper__circle {
    width: 28px;
    height: 28px;
    min-width: 28px;
    min-height: 28px;
    font-size: 12px;
}

.wizard-stepper--compact .wizard-stepper__label {
    font-size: 12px;
}

@media screen and (max-width: 1159px) {
    .wizard-stepper__circle {
        width: 28px;
        height: 28px;
        min-width: 28px;
        min-height: 28px;
    }

    .wizard-stepper__item::after {
        width: 36px;
    }

    .wizard-stepper--compact {
        gap: 4px;
    }

    .wizard-stepper--compact .wizard-stepper__item::after {
        width: 9px;
        margin-left: 0;
    }

    .wizard-stepper--compact .wizard-stepper__circle {
        width: 24px;
        height: 24px;
        min-width: 24px;
        min-height: 24px;
        font-size: 11px;
    }

    .wizard-stepper--compact .wizard-stepper__label {
        font-size: 11px;
    }
}

@media screen and (max-width: 1023px) {
    .wizard-stepper__item::after {
        width: 24px;
    }
}

/* ================================================================
   TOGGLES (Segmented Pills a.k.a Ooznest Style)
   ================================================================ */

/* ────────────────────────────────────────────────────────────────
   SIDEBAR SMALL CARDS — Overrides & Signals
   ──────────────────────────────────────────────────────────────── */


/* Override +/- buttons */
.btn-ovr {
    width: 100%;
    height: 28px;
    background: var(--oz-bg-panel);
    border: 1px solid var(--oz-teal-xlight);
    border-radius: 4px;
    color: var(--oz-grey-dark);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    text-align: center;
    user-select: none;
}

.btn-ovr:hover {
    background: var(--oz-primary);
    color: white;
    border-color: var(--oz-primary);
}

/* Pin indicator badges */
[id^="pin-indicator-"] {
    border-radius: 4px;
    font-weight: 800;
    border: 1px solid var(--oz-teal-xlight);
    color: var(--oz-grey-mid);
    background: var(--oz-bg-panel);
    transition: all 0.15s;
    text-align: center;
}

/* ────────────────────────────────────────────────────────────────
   SIGNAL BADGES — Troubleshooting tab ON/OFF indicators
   ──────────────────────────────────────────────────────────────── */
.signal-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    padding: 3px 10px;
    border-radius: 20px;
    font-family: 'Nunito', 'Inter', sans-serif;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    transition: all 0.2s ease;
}

.signal-off {
    background: var(--oz-teal-xlight);
    color: var(--oz-grey-mid);
    border: 1px solid var(--oz-teal-light);
}

.signal-on {
    background: #dcfce7;
    color: #15803d;
    border: 1px solid #86efac;
    box-shadow: 0 0 8px rgba(22, 163, 74, 0.25);
}

/* Override default pin-indicator styling when inside signal table */
table [id^="pin-indicator-"] {
    border: none;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 800;
    text-align: center;
    background: none;
    color: inherit;
    transition: all 0.2s;
}

/* ────────────────────────────────────────────────────────────────
   TERMINAL / CONSOLE — xterm5
   ──────────────────────────────────────────────────────────────── */

/* CRITICAL: All xterm ancestor elements must explicitly match the light theme bg
   otherwise xterm5 contrast engine shifts colors unexpectedly. */
#terminal-container,
#terminal-container .xterm,
#terminal-container .xterm-viewport,
#terminal-container .xterm-screen {
    background-color: #ffffff !important;
}

/* Console input row */
#console-input-area {
    margin-top: 8px;
    display: flex;
    gap: 8px;
    align-items: center;
    flex-shrink: 0;
}

#console-input-area input {
    flex: 1;
    background: white;
    border: 1.5px solid var(--oz-teal-light);
    border-radius: 4px;
    color: var(--oz-grey-dark);
    font-family: "JetBrains Mono", monospace;
    font-size: 13px;
    padding: 6px 10px;
    height: 32px;
    transition: all 0.2s;
}

#console-input-area input::placeholder {
    color: var(--oz-grey-mid);
}

#console-input-area input:focus {
    border-color: var(--oz-teal-mid);
    background: white;
    outline: none;
    box-shadow: 0 0 0 2px rgba(68, 157, 159, 0.15);
}

#btnSend {
    background: var(--oz-primary-light);
    color: white;
    border: none;
    border-radius: 4px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s;
    padding: 0;
}

#btnSend:hover {
    background: var(--oz-primary);
    transform: translateY(-1px);
}

/* ================================================================
   BUTTONS — Global
   ================================================================ */
.btn {
    padding: 6px 12px;
    border-radius: var(--oz-r-xs);
    font-family: 'Nunito', 'Roboto', sans-serif;
    font-weight: 700;
    font-size: 13px;
    line-height: 1;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s;
    user-select: none;
}

@media (min-width: 768px) {
    .btn {
        padding: 8px 16px;
    }
}

.btn:active {
    transform: scale(0.96);
}

.btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--oz-primary-light);
    color: white;
}

.btn-primary:hover {
    background: var(--oz-primary);
    transform: translateY(-1px);
}

.btn-danger {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.btn-danger:hover {
    background: #dc2626;
    color: white;
}

.btn-ghost {
    background: var(--oz-grey-light);
    color: var(--oz-grey-dark);
    border-radius: var(--oz-r-xs);
    padding: 4px;
}

.btn-ghost:hover {
    color: var(--oz-primary);
    background: var(--oz-bg-panel);
}

.btn-icon {
    padding: 8px;
    border-radius: var(--oz-r-xs);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.15s;
}

.btn-icon:hover {
    background: var(--oz-bg-panel);
}

.btn-icon [data-lucide],
.btn-icon [data-lucide] svg {
    pointer-events: none;
}

/* ================================================================
   MAIN CONTENT AREA
   ================================================================ */
.tab-pane {
    background: #ffffff;
    width: 100%;
    height: 100%;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

#viewer-view {
    position: relative;
    flex: 1;
    min-height: 0;
}

/* ================================================================
   FORMS (content pane)
   ================================================================ */
.tab-pane input[type="text"],
.tab-pane input[type="number"],
.tab-pane input[type="search"],
.tab-pane textarea:not(.xterm-helper-textarea) {
    border-radius: var(--oz-r-xs);
    border: 1.5px solid var(--oz-teal-xlight);
    color: var(--oz-grey-dark);
    background: var(--oz-bg-panel);
    font-family: 'Nunito', 'Inter', sans-serif;
    padding: 6px 10px;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.tab-pane input:focus,
.tab-pane textarea:focus {
    background: white;
    outline: none;
}

/* Progress bar */
#job-progress-bar {
    background: var(--oz-primary);
}

/* Send buffer fill bar */
#job-buffer-bar {
    background: var(--oz-teal-mid);
}

/* xterm accessibility textarea — must stay hidden */
textarea.xterm-helper-textarea {
    opacity: 0 !important;
    width: 0 !important;
    height: 0 !important;
    pointer-events: none !important;
    position: absolute !important;
    left: -9999px !important;
}

/* No scrollbar utility */
.no-scrollbar::-webkit-scrollbar {
    display: none;
}

.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Tab pane sizing and scrollbar stability */
.tab-pane {
    width: 100% !important;
    height: 100% !important;
    scrollbar-gutter: stable;
    position: relative;
    display: flex;
    flex-direction: column;
}

/* Tailwind v4 missing .hidden utility — needed for elements without tab-pane */
.hidden {
    display: none !important;
}
/* Override Tailwind v4 @layer utilities cascade layer issue for tab-pane only */
.tab-pane.hidden {
    display: none !important;
}

/* ================================================================
   WORDPRESS IDENTITY REFRESH
   Match the current Ooznest theme more closely across shell,
   sidebar, tabs, content panels, wizards, notices, and modals.
   ================================================================ */

:root {
    --oz-surface-shadow: 0 18px 44px rgba(13, 31, 34, 0.1);
    --oz-surface-shadow-soft: 0 10px 24px rgba(13, 31, 34, 0.08);
    --oz-panel-corner: 0 0 20px 0;
    --oz-panel-corner-lg: 0 0 20px 0;
    --oz-border-strong: rgba(0, 76, 91, 0.2);
    --oz-border-soft: rgba(0, 76, 91, 0.1);
    --oz-notice-info: #f6fbfb;
    --oz-notice-error: #fcdbd9;
    --oz-notice-warning: #fff2cf;
    --oz-notice-success: #e7fff5;
}

body {
    background: #ffffff;
}

.app-container {
    background: #ffffff;
}

.shadow-soft {
    box-shadow: none;
}

#main-content-area {
    background: #ffffff;
}

.app-container > main > div:first-of-type,
.app-container > div:not(.machine-sidebar) > div:first-child {
    background: transparent;
    box-shadow: none;
    padding-inline: 16px;
    margin-top: 12px;
    margin-right: 8px;
    position: relative;
    z-index: 5;
}

#main-content-area {
    position: relative;
    z-index: 0;
}

#gcode-editor textarea {
    border-radius: 0 !important;
    border: none !important;
    font-weight: 400 !important;
}

#btn-connect {
    background: var(--oz-primary-light);
    color: #fff;
    border: 1px solid var(--oz-primary-light);
    box-shadow: 0 3px 10px rgba(13, 31, 34, 0.12);
}

#btn-connect:hover,
.btn-primary:hover {
    background: var(--oz-primary);
    border-color: var(--oz-primary);
    color: #fff;
}

#btn-reset,
.btn-secondary {
    background: #fff;
    color: var(--oz-primary);
    border: 1px solid var(--oz-primary-light);
    box-shadow: none;
}

#btn-reset:hover,
.btn-secondary:hover {
    background: var(--oz-primary);
    border-color: var(--oz-primary);
    color: #fff;
}

.btn-danger {
    background: var(--oz-notice-error);
    border: 1px solid var(--oz-error);
    color: var(--oz-error);
}

.btn-danger:hover {
    background: var(--oz-error);
    border-color: var(--oz-error);
    color: #fff;
}

.btn-warning {
    background: var(--oz-notice-warning);
    border: 1px solid #f2b23b;
    color: #935d00;
}

.btn-warning:hover {
    background: #f2b23b;
    border-color: #f2b23b;
    color: #fff;
}

.btn-ghost {
    background: rgba(68, 157, 159, 0.08);
    color: var(--oz-secondary-dark);
}

.btn-ghost:hover {
    background: rgba(68, 157, 159, 0.16);
    color: var(--oz-secondary-dark);
}

.dro-panel {
    border: 0;
    border-radius: 0;
    box-shadow: var(--oz-surface-shadow);
    padding: 12px;
}

#jog-panel {
    background-color: rgb(176, 202, 207);
    border: 2px solid rgba(176, 202, 207, 0.72);
    border-radius: var(--oz-panel-corner);
    box-shadow: var(--oz-surface-shadow);
    color: #fff;
    padding: 12px;
}

#jog-panel .text-secondary-dark,
#jog-panel .text-grey-dark,
#jog-panel .text-grey,
#jog-panel .text-xs,
#jog-panel .text-sm,
#jog-panel label,
#jog-panel span,
#jog-panel p,
#jog-panel div,
#jog-panel button {
    color: #fff;
}

.jog-pad-center {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.22);
}

.jog-btn,
.jog-btn-extra,
.btn-ovr {
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 18px rgba(13, 31, 34, 0.07);
}

.jog-btn:hover,
.jog-btn-extra:hover,
.btn-ovr:hover {
    color: #fff;
}

.jog-btn-extra[data-jog^="Z"]:hover {
    color: #dbeafe;
}

.jog-btn-extra[data-jog^="A"]:hover {
    color: #ffedd5;
}

.tab-pane {
    background: #ffffff;
    padding: 0;
}


#settings-toolbar .btn,
#probe-view .btn,
#tools-view .btn,
#troubleshooting-view .btn,
.oz-modal .btn {
    border-radius: var(--oz-r-control);
}

#settings-view .overflow-x-auto > div,
#tools-view .tools-tab-content > div:first-child,
#probe-view .grid > div > .bg-white,
#troubleshooting-view .bg-white,
.oz-modal .bg-white {
    backdrop-filter: saturate(1.05);
}

#settings-view,
#settings-view > div,
#grbl-settings-container,
#grbl-settings-container > div {
    min-height: 0;
}

#settings-sidebar {
    background: transparent !important;
}

#settings-sidebar > div:first-child {
    background: transparent !important;
}

#settings-sidebar .settings-sidebar-search-card {
    background: var(--oz-teal-brand);
    color: #ffffff;
    border-radius: 24px 0 0 0;
    padding: 18px 16px 16px;
}

#settings-sidebar .settings-sidebar-search-label {
    display: block;
    font-weight: 700;
    font-size: 11px;
    line-height: 1.2;
    color: #ffffff;
    margin-bottom: 4px;
    letter-spacing: 0.01em;
}

#config-wizard-overlay [data-modal-panel] {
    max-width: min(96vw, 820px) !important;
}

#settings-sidebar .settings-nav-item {
    background: #ffffff;
    color: var(--oz-teal-brand);
    border: 1px solid rgba(68, 157, 159, 0.10);
    border-radius: 10px;
    box-shadow: none;
}

#settings-sidebar .settings-nav-item:hover {
    background: #ffffff;
    color: var(--oz-teal-brand);
    border-color: rgba(68, 157, 159, 0.18);
    transform: none;
    box-shadow: none;
}

#settings-sidebar .settings-nav-item.is-active {
    background: var(--oz-primary);
    color: #ffffff;
    border-color: var(--oz-primary);
    box-shadow: none;
}

#settings-sidebar .settings-nav-item.is-active:hover {
    background: var(--oz-primary);
    color: #ffffff;
    border-color: var(--oz-primary);
}

#settings-sidebar .settings-nav-badge {
    background: var(--oz-primary);
    color: #ffffff;
}

#settings-sidebar .settings-nav-item.is-active .settings-nav-badge {
    background: #ffffff;
    color: var(--oz-primary-dark);
}

#settings-search-input {
    border-radius: var(--oz-r-control) !important;
    border-color: rgba(255, 255, 255, 0.22) !important;
    background: #fff !important;
    padding-left: 12px !important;
    min-height: 40px;
    box-shadow: inset 0 1px 2px rgba(13, 31, 34, 0.03);
}


#settings-main-panel .bg-grey-bg,
#tools-view .bg-grey-bg,
#troubleshooting-view .bg-grey-bg,
#connection-modal #discover-panel,
#connection-modal #scan-results,
#connection-modal #discovered-list,
#macro-icon-grid {
    background: #ffffff !important;
    border-color: rgba(68, 157, 159, 0.14) !important;
}

#settings-main-panel table,
#tools-view table,
#sd-table {
    border-collapse: separate;
    border-spacing: 0;
}

#sd-table {
    table-layout: fixed;
}

#sd-table th:nth-child(2),
#sd-table td:nth-child(2) {
    width: 64px;
}

#sd-table th:nth-child(3),
#sd-table td:nth-child(3) {
    width: 120px;
}

#settings-main-panel thead th,
#tools-view thead th,
#sd-table thead th {
    background: #ffffff !important;
    color: var(--oz-secondary-dark);
    border-bottom-color: rgba(68, 157, 159, 0.14) !important;
}

#sd-view .shadow-soft,
#troubleshooting-view .shadow-soft,
#sd-view .shadow-card,
#troubleshooting-view .shadow-card {
    box-shadow: none !important;
}

#settings-main-panel tbody tr,
#tool-table-body tr,
#sd-table tbody tr {
    transition: background-color 0.18s ease, transform 0.18s ease;
}

#settings-main-panel tbody tr:hover,
#tool-table-body tr:hover,
#sd-table tbody tr:hover {
    background: rgba(68, 157, 159, 0.05) !important;
}

#sd-table tbody tr:hover {
    background: transparent !important;
}

#settings-main-panel tbody tr.bg-yellow-50 {
    background: rgba(255, 242, 207, 0.82) !important;
}

#settings-main-panel .group button,
#settings-sidebar button,
#settings-main-panel button,
#macro-icon-grid button {
    transition:
        transform 0.18s ease,
        box-shadow 0.18s ease,
        border-color 0.18s ease,
        background-color 0.18s ease,
        color 0.18s ease;
}

#macro-icon-grid button:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 22px rgba(13, 31, 34, 0.08);
}

#connection-modal #discover-progress-wrap .bg-grey-bg {
    background: rgba(68, 157, 159, 0.08) !important;
}

#macro-icon-grid {
    border-radius: var(--oz-r-control);
    padding: 12px;
}

#macro-icon-grid .icon-option {
    width: 44px;
    height: 44px;
    border-radius: var(--oz-r-control);
    border-color: rgba(68, 157, 159, 0.16);
    background: rgba(255, 255, 255, 0.9);
}

#macro-icon-grid .icon-option.bg-primary,
#macro-icon-grid .icon-option.border-primary {
    background: var(--oz-primary) !important;
    color: #fff !important;
    box-shadow: 0 3px 10px rgba(13, 31, 34, 0.1);
}

#macro-gcode-input {
    min-height: 168px;
    background: #fff !important;
    border: 1px solid rgba(68, 157, 159, 0.24) !important;
    border-radius: var(--oz-r-control) !important;
    box-shadow: inset 0 1px 2px rgba(13, 31, 34, 0.03);
}

#tool-table-body tr td:first-child {
    font-weight: 800;
    color: var(--oz-secondary-dark);
}

#tool-table-body tr.bg-primary\/10,
#tool-table-body tr[class*="bg-primary"] {
    background: rgba(255, 133, 51, 0.14) !important;
}

#console-view #terminal-container {
    border: 0;
    box-shadow: none;
    overflow: hidden;
}

#console-input-area {
    background: transparent;
    border: 0;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
}

.console-input-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    border: 1px solid var(--oz-grey-light);
    border-radius: 0.5rem;
    padding: 0.75rem;
    box-shadow:
        0 10px 15px -3px rgba(0, 0, 0, 0.1),
        0 4px 6px -4px rgba(0, 0, 0, 0.1);
}

#cmdInput {
    min-height: 42px;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--oz-grey-dark);
    font-family: "JetBrains Mono", monospace;
    font-size: 13px;
    padding: 0;
    box-shadow: none;
}

#cmdInput:focus {
    outline: none;
    box-shadow: none;
}

#btnSend {
    min-width: 84px;
    min-height: 42px;
    border-radius: var(--oz-r-control);
    background: var(--oz-primary);
    color: #fff;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0 14px;
    font-weight: 800;
    transition: all 0.2s ease;
}

#btnSend:hover {
    background: var(--oz-primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(255, 102, 0, 0.22);
}

.signal-badge {
    min-width: 52px;
    border-radius: 999px;
    border: 1px solid rgba(68, 157, 159, 0.16);
    background: #fff;
    color: var(--oz-secondary-dark);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.signal-on {
    background: var(--oz-notice-success) !important;
    border-color: rgba(2, 122, 72, 0.3) !important;
    color: var(--oz-success) !important;
}

.signal-off {
    background: rgba(255, 255, 255, 0.92) !important;
    color: var(--oz-grey-mid) !important;
}

@media (max-width: 767px) {
    .machine-sidebar {
        width: min(96vw, 392px);
    }

    #machine-controls {
        padding: 10px;
        gap: 10px;
    }

    .tab-btn {
        min-height: 34px;
        padding: 7px 14px;
        font-size: 11px;
    }

    .overlay-btn {
        border-radius: 14px;
    }

    #settings-main-panel table,
    #tools-view table,
    #sd-table {
        font-size: 11px;
    }

    #console-input-area {
        padding: 0;
        border-radius: 0;
        border: 0;
        background: transparent;
        box-shadow: none;
    }
}

.console-shell {
    background: #fff;
    border: 1.5px solid rgba(68, 157, 159, 0.92) !important;
    border-radius: 0 0 58px 0 !important;
    box-shadow: 0 18px 38px rgba(13, 31, 34, 0.08);
}

.console-shell {
    padding: 0 0 20px;
    background: transparent;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none;
}

.console-terminal {
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none;
    padding: 0;
    box-sizing: border-box;
    overflow: hidden;
    min-height: 0;
}

#terminal-container,
#terminal-container .xterm,
#terminal-container .xterm-viewport,
#terminal-container .xterm-screen {
    background-color: #ffffff !important;
}

#terminal-container .xterm,
#terminal-container .xterm-screen,
#terminal-container .xterm-viewport {
    height: 100% !important;
    max-height: 100% !important;
}

#terminal-container .xterm,
#terminal-container .xterm-rows,
#terminal-container .xterm-screen {
    font-family: "JetBrains Mono", monospace !important;
    font-size: 13px !important;
}

#console-view #terminal-container {
    border: 0;
    box-shadow: none;
    overflow: hidden;
}

#console-input-area {
    background: transparent;
    border: 0;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
}

select::-ms-expand {
    display: none;
}

.dro-mach-group {
    min-width: 60px;
    justify-content: flex-end;
    padding-right: 0px;
}

#machine-controls .dro-home-btn,
#machine-controls .dro-zero-btn,
#machine-controls .dro-home-btn span,
#machine-controls .dro-zero-btn span,
#machine-controls .dro-home-btn i,
#machine-controls .dro-zero-btn i {
    color: white !important;
}

#machine-controls .dro-home-btn:hover,
#machine-controls .dro-zero-btn:hover,
#machine-controls .dro-home-btn:hover span,
#machine-controls .dro-zero-btn:hover span,
#machine-controls .dro-home-btn:hover i,
#machine-controls .dro-zero-btn:hover i {
    color: var(--oz-primary) !important;
}

#machine-controls .dro-home-btn.text-green-500,
#machine-controls .dro-home-btn.text-green-500 span,
#machine-controls .dro-home-btn.text-green-500 i {
    color: #22c55e !important;
}

#machine-controls .dro-home-btn.text-green-500:hover,
#machine-controls .dro-home-btn.text-green-500:hover span,
#machine-controls .dro-home-btn.text-green-500:hover i {
    color: #22c55e !important;
}

.machine-status-pill {
    background: var(--oz-teal-brand) !important;
    color: #ffffff !important;
    border-color: rgba(255, 255, 255, 0.16) !important;
}

#machine-controls .dro-sub-btn,
#machine-controls .dro-sub-btn span,
#machine-controls .dro-sub-btn i,
#home-all-btn,
#home-all-btn span,
#home-all-btn i {
    color: var(--oz-grey-dark) !important;
}

.machine-status-pill.status-idle {
    background: rgba(255, 255, 255, 0.96);
    color: var(--oz-teal-brand);
}

.machine-status-pill.status-run {
    background: var(--oz-notice-success);
    color: var(--oz-success);
    border-color: rgba(2, 122, 72, 0.24);
}

.machine-status-pill.status-warn {
    background: var(--oz-notice-warning);
    color: #935d00;
    border-color: rgba(242, 178, 59, 0.28);
}

.machine-status-pill.status-alarm {
    background: var(--oz-notice-error);
    color: var(--oz-error);
    border-color: rgba(180, 27, 19, 0.28);
}

.override-mini-btn,
.override-preset-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 6px 5px;
    margin: 2px 2px 2px 0;
    border: none;
    background: rgba(255, 255, 255, 0.12);
    color: white;
    font-size: 8px;
    font-weight: 700;
    cursor: pointer;
    border-radius: var(--oz-r-xs);
    transition: all 0.15s;
    white-space: nowrap;
    line-height: 1.1;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    min-height: 34px;
}

.override-mini-btn:hover,
.override-preset-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    color: white;
}

.override-mini-btn {
    font-size: 9px;
    padding: 6px 8px;
    min-width: 36px;
}

.override-preset-btn {
    font-size: 9px;
    padding: 6px 8px;
    min-width: 36px;
}

.dro-card {
    min-height: 40px;
    height: auto;
    margin-bottom: 6px;
    align-items: stretch;
}

@media (min-width: 768px) {
    .dro-card {
        min-height: 24px;
        margin-bottom: 7px;
    }
}

.dro-home-btn,
.dro-zero-btn,
.dro-sub-btn,
#btn-connect,
#btn-reset,
#sidebar-connect .btn,
.btn,
.btn-primary,
.btn-secondary,
.btn-danger,
.btn-ghost,
.tab-btn,
.overlay-btn,
.jog-btn,
.jog-btn-extra,
.btn-ovr,
.override-mini-btn,
.override-preset-btn,
#btnSend,
#btnClearConsole,
#settings-toolbar .btn,
#probe-view .btn,
#tools-view .btn,
#troubleshooting-view .btn,
.oz-modal .btn {
    border-radius: var(--oz-r-control) !important;
}

.tab-btn {
    border-radius: var(--oz-r-control) !important;
}

#tabs-scroll-container .tab-btn {
    border-radius: 0 !important;
}

.overlay-btn {
    border-radius: var(--oz-r-control) !important;
}

.jog-btn,
.jog-btn-extra,
.btn-ovr,
.dro-sub-btn {
    border-radius: var(--oz-r-control) !important;
}

.jog-btn.rounded-tl-xl {
    border-radius: 20px var(--oz-r-control) var(--oz-r-control) var(--oz-r-control) !important;
}

.jog-btn.rounded-tr-xl {
    border-radius: var(--oz-r-control) 20px var(--oz-r-control) var(--oz-r-control) !important;
}

.jog-btn.rounded-bl-xl {
    border-radius: var(--oz-r-control) var(--oz-r-control) var(--oz-r-control) 20px !important;
}

.jog-btn.rounded-br-xl {
    border-radius: var(--oz-r-control) var(--oz-r-control) 20px var(--oz-r-control) !important;
}


