/* ==========================================================================
   ECO CutList Optimizer - Professional App UI (Replicated from CutListOptimizer.com)
   ========================================================================== */

:root {
    /* 1a73e8 */
    --cl-primary: #c0a05d;
    --cl-secondary: #44484c;
    --cl-primary-hover: #8b7444;
    --cl-surface: #ffffff;
    --cl-bg: #f0f0f0;
    --cl-text-main: #333333;
    --cl-text-muted: #ccc;
    --cl-border: #dddddd;
    /* Thin light-grey borders */
    --cl-radius: 0;
    /* No radius for technical look */
    --cl-shadow-sm: none;
    /* Minimal shadows */
    --cl-shadow-md: none;
    --cl-shadow-lg: none;
    --cl-transition: all 0.2s ease-in-out;
    --cl-font-base: system-ui, -apple-system, sans-serif;
    --cl-focus-ring: 0 0 0 2px rgba(40, 167, 69, 0.3);
    /* Green focus */
}

/* Base App Wrapper */
body {
    margin: 0;
    background-color: var(--cl-bg);
    font-family: var(--cl-font-base);
    color: var(--cl-text-main);
    line-height: 1.2;
    font-size: 13px;
    scroll-behavior: smooth;
}

.ct-drawer-canvas {
    display: none;
}

/* Make full page flex layout */
html,
body {
    height: 100%;
    margin: 0;
}

/* Page becomes vertical app shell */
body {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Make WP wrapper fill viewport */
#main-container {
    height: 100vh;
    display: flex;
    flex-direction: column;
}

#main {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 0;
    margin: 0;
    min-height: 0;
}

/* ==========================================================================
   Navbar & Actions
   ========================================================================== */

.cl-navbar__brand {
    display: flex;
    align-items: center;
}

.cl-navbar__logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: inherit;
    gap: 12px;
}

.cl-navbar__logo {
    height: 32px;
    width: auto;
    display: block;
}

.cl-navbar__title {
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
}

.cl-navbar__logo-link:hover .cl-navbar__title {
    opacity: 0.8;
}

.cl-navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    height: 56px;
    background: rgb(241 241 241 / 95%);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid #e0e0e0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* ==========================================================================
   Navbar Actions & Export Dropdown
   ========================================================================== */

.cl-navbar__actions {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
}

.cl-navbar__actions .btn svg:first-child {
    margin-right: 8px;
}

.cl-navbar__actions .btn svg:last-child {
    margin-left: 8px;
}

.cl-navbar__actions a {
    text-decoration: none;
}

/* Base style for Navbar buttons (Secondary/Ghost style) */
.cl-navbar__actions .btn {
    height: 36px;
    padding: 0 16px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 6px;
    border: 1px solid transparent;
    background: transparent;
    color: #5f6368;
    /* Muted grey for secondary actions */
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Hover effect for Save, Export, and Help */
.cl-navbar__actions .btn:not(#btn-calc):hover {
    background-color: #f1f3f4;
    color: var(--cl-primary);
}

/* ==========================================================================
   Primary Call to Action
   ========================================================================== */
#btn-calc {
    background-color: var(--cl-primary);
    color: #ffffff;
    border: none;
    box-shadow: 0 1px 2px rgba(26, 115, 232, 0.3);
    margin-right: 8px;
}

#btn-calc:hover,
#btn-calc:active {
    background-color: var(--cl-primary-hover);
    box-shadow: 0 4px 8px rgba(39, 40, 40, 0.4);
    transform: translateY(-1px);
}

#btn-order {
    background: #1a73e8;
    color: #fff;
    border: 1px solid #1a73e8;
    margin-right: 8px;
}

#btn-order:hover,
#btn-order:active {
    background: #1557b0 !important;
    color: #fff !important;
    box-shadow: 0 4px 8px rgba(39, 40, 40, 0.4);
    transform: translateY(-1px);
}



/* ==========================================================================
   Export Dropdown Specifics
   ========================================================================== */
.cl-navbar__dropdown {
    position: relative;
    /* Essential: Anchor for the dropdown */
    display: inline-block;
}

/* Position and animate the Export menu */
.cl-navbar__dropdown .cl-dropdown {
    top: calc(100% + 8px);
    right: 0;
    min-width: 180px;
    transform-origin: top right;
    animation: dropFade 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Subtle open animation for a premium feel */
@keyframes dropFade {
    0% {
        opacity: 0;
        transform: scale(0.95) translateY(-5px);
    }

    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* ==========================================================================
   Card Header & Child Items (Toolbar Style)
   ========================================================================== */

.cl-card__header,
.right-sidebar-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background-color: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
    min-height: auto;
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
    position: sticky;
    top: 0;
    z-index: 10;
    box-shadow: 0 3px 4px 0 #33333312;
    transition: transform 0.1s ease-in-out, padding 0.8s cubic-bezier(0.32, 0.72, 0, 1), justify-content 0.8s;
}

.cl-card__header {
    justify-content: space-between;
}

#right-sidebar.collapsed .cl-card__header {
    cursor: pointer;
}

#right-sidebar.collapsed .cl-card__header:hover {
    transform: translatex(-2px);
}

.cl-card.is-collapsed .cl-card__header {
    border-radius: 12px;
}

#right-sidebar.collapsed .cl-card__header,
#right-sidebar.collapsed .right-sidebar-header {
    padding: 8px 10px;
}

h3.cl-sidebar__title {
    margin: 0;
}

#right-sidebar:not(.collapsed) .right-sidebar-header {
    border-radius: 12px;
}

.cl-card__header h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #5f6368;
    display: flex;
    align-items: center;
    gap: 8px;
}

.cl-card__header h2 .count-badge {
    background: #e8eaed;
    color: #3c4043;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
}

.cl_card__label {
    display: flex;
    gap: 5px;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-start
}

.cl-card__header .cl-card__actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.cl-card__header .btn {
    height: 32px;
    padding: 0 12px;
    font-size: 12px;
    font-weight: 600;
    background: white;
    border: 1px solid #dadce0;
    color: var(--cl-primary);
    border-radius: 4px;
    transition: all 0.2s ease;
}

.cl-card__header .btn:hover {
    background-color: #f1f3f4;
    border-color: var(--cl-primary);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    cursor: pointer;
}

#add-row-parts {
    background-color: #fff;
    border-color: var(--cl-primary);
    color: var(--cl-primary);
}

#add-row-parts:hover {
    background-color: #e8f0fe;
}

.cl-card__header .btn-danger {
    color: #d93025;
}

.cl-card__header .btn-danger:hover {
    background-color: #fce8e6;
    border-color: #d93025;
}

.cl-card__header .cl-caret,
.cl-card__header .btn-icon {
    color: #5f6368;
    transition: all 0.2s ease;
    padding: 0 8px;
}

.cl-card__header .cl-caret:hover,
.cl-card__header .btn-icon:hover {
    cursor: pointer;
    color: var(--cl-primary);
}

.cl-caret svg {
    width: 10px;
    transition: transform 0.2s;
}

.is-collapsed .cl-caret svg {
    transform: rotate(-90deg);
}

.group-brands-stat {
    padding-inline: 5px;
    margin-left: 5px;
    font-size: 0.9em;
    border: 1px solid #eee;
    border-left: 5px solid var(--cl-primary);
}

.group-brands-stat .cl-stat {
    color: var(--cl-primary) !important;
}

#stat-unplaced-wrapper {
    display: none;
    color: #dc2626;
    flex-direction: column;
    align-items: flex-start;
}

.stat-unplaced-total {
    display: flex;
    justify-content: space-between;
    width: 100%;
}

#stat-unplaced-breakdown {

    margin-block: 10px;
    width: 100%;

}

#stat-unplaced-breakdown div {
    display: block;
    width: 100%;
    padding: 5px;
    margin-inline: 10px;
    box-sizing: border-box;
    border: 1px solid #eeeeee;
    display: flex;
    justify-content: space-between;
}

/* ==========================================================================
   Professional Card Body & Data Entry
   ========================================================================== */

.cl-card {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    display: grid;
    flex-direction: column;
    transition: box-shadow 0.2s ease;
    position: relative;
    z-index: 1;
}

/* Elevated state when dropdown is active */
.cl-card.is-open {
    z-index: 100;
}

.cl-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.cl-card__body {
    padding: 12px 16px;
    opacity: 1;
    z-index: 1;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.cl-card__body.no-padding {
    padding: 0;
}

.cl-card.is-collapsed .cl-card__body,
.cl-card.is-collapsed .cl-card__actions {
    max-height: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    opacity: 0;
    pointer-events: none;
}

.cl-card.is-scrollable .cl-card__body {
    overflow-y: auto;
}

.cl-card__description {
    white-space: normal;
    overflow-wrap: break-word;
}


/** Swap Icon **/
.swap-icon-btn {
    position: absolute;
    right: -10px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    cursor: pointer;
    background: #fff;
    color: #333;
    border: 1px solid #ddd;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.swap-icon-btn:hover {
    background-color: #f0f0f0;
    transform: translateY(-50%);
    box-shadow: 0 0 3px #7e7d7d7e;
    border-color: #aaa;
}

.swap-icon-btn:hover svg {
    fill: var(--cl-primary);
}

.swap-icon-btn.hidden {
    display: none !important;
}

.swap-icon-btn svg {
    width: 14px;
    height: 14px;
    fill: #555;
}

/* ==========================================================================
   Sidebar Stats & Options
   ========================================================================== */

.cl-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 0;
    border-bottom: 1px solid #f1f3f4;
    font-size: 13px;
    color: #5f6368;
}

.cl-stat:last-child {
    border-bottom: none;
}

.cl-stat strong {
    color: #202124;
    font-weight: 600;
}

#stats-section .cl-stat-group-detail {
    white-space: normal !important;
    overflow-wrap: break-word !important;
    word-wrap: break-word !important;
    word-break: break-word !important;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 15px;
}

/* Make Total Sheets & Edge Banding more prominent */
#stat-sheets-used,
#stat-edge-banding {
    font-size: 15px;
    background-color: rgba(192, 160, 93, 0.1);
    padding: 3px 10px;
    border-radius: 6px;
    border: 1px solid rgba(192, 160, 93, 0.4);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

#stat-double-edge-banding {
    font-size: 15px;
    background-color: rgba(180, 83, 107, 0.10);
    padding: 3px 10px;
    border-radius: 6px;
    border: 1px solid rgba(180, 83, 107, 0.40);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    color: #9f1239;
}

#stats-empty-note {
    display: none;
}



/* ==========================================================================
   Professional Section Dropdowns
   ========================================================================== */

.cl-dropdown {
    position: absolute;
    min-width: 200px;
    background-color: #ffffff;
    border: 1px solid #dadce0;
    border-radius: 8px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.05);
    padding: 6px 0;
    margin-top: 4px;
    z-index: 999;
}

.cl-dropdown__item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 500;
    text-align: left;
    color: #3c4043;
    background: transparent;
    border: none;
    cursor: pointer;
    text-decoration: none;
    box-sizing: border-box;
    transition: background-color 0.15s, color 0.15s;
}

.cl-dropdown__item:hover {
    background-color: #f1f3f4;
    color: var(--cl-primary);
}

/* Styling for SVGs inside the dropdown */
.cl-dropdown__item svg {
    flex-shrink: 0;
    color: #5f6368;
    transition: color 0.15s;
}

/* Make SVG match primary color on hover */
.cl-dropdown__item:hover svg {
    color: var(--cl-primary);
}

/* Position the Kebab dropdown properly */
#navbar-kebab-menu {
    top: calc(100% + 12px);
    right: 0;
    min-width: 220px;
}

.cl-dropdown hr {
    border: 0;
    border-top: 1px solid #eee;
    margin: 6px 0;
}

.cl-dropdown__item.action-import-csv,
.cl-dropdown__item.action-load-list {
    color: #1e8e3e;
}

.cl-dropdown__item.action-import-csv:hover,
.cl-dropdown__item.action-load-list:hover {
    background-color: #e6f4ea;
}

.cl-dropdown__item.action-clear {
    color: #d93025;
    border-top: 1px solid #f1f3f4;
    margin-top: 4px;
    padding-top: 12px;
}

.cl-dropdown__item.action-clear:hover {
    background-color: #fce8e6;
    color: #a50e0e;
}

.cl-hidden {
    display: none !important;
}

/* ==========================================================================
   COMPLETE SETTINGS SECTION STYLES
   ========================================================================== */

.cl-opt-item {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    position: relative;
    border-bottom: 1px solid #eee;
    padding: 10px 0;
    gap: 12px;
    height: 60px;
}

.cl-opt-item.opt-reset {
    margin-bottom: 20px;
}

#btn-reset {
    background-color: #fce8e6;
    color: #d93025;
    margin-left: auto;
    border: none;
    transition: all 0.3s ease-in-out;
    cursor: pointer;
    padding: 8px 20px;
    border-radius: 4px;
    outline: none;
}

#btn-reset:hover {
    background-color: #f9d7d3;
    color: #a50e0e;
}

.cl-opt-item:last-child {
    border-bottom: none;
}

.opt-label.checkbox {
    margin-bottom: 0;
    flex: 1;
}

.cl-opt-item.slider {
    flex-direction: column;
}

.opt-label--icon {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.opt-label-icon {
    width: 16px;
    height: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #aaaaaa;
    flex-shrink: 0;
}

.opt-label-icon svg {
    width: 100%;
    height: 100%;
    display: block;
}

.opt-label.text,
.opt-label.checkbox {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.opt-label__main {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

#opt-unit,
#input-kerf,
#edge-offset {
    height: 36px;
    padding: 0 12px;
    background-color: #ffffff;
    border: 1px solid #dadce0;
    border-radius: 6px;
    font-size: 13px;
    color: #3c4043;
    transition: all 0.2s ease;
}

#opt-unit {
    width: 200px;
    cursor: pointer;
}

#input-kerf,
#edge-offset {
    width: 100px;
}

#opt-unit:hover,
#input-kerf:hover,
#edge-offset:hover {
    border-color: var(--cl-primary);
}

#opt-unit:focus,
#input-kerf:focus,
#edge-offset:focus {
    outline: none;
    border-color: var(--cl-primary);
    box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.15);
}

.toggle-checkbox {
    position: absolute;
    opacity: 0;
    z-index: -1;
}

.switch-container {
    width: 44px;
    height: 22px;
    background: #bdc1c6;
    border-radius: 20px;
    position: relative;
    box-shadow: inset 0 0 3px #00000011;
    transition: background-color 0.2s ease;
}

.switch {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    z-index: 10;
}

.toggle {
    position: absolute;
    width: 18px;
    height: 18px;
    top: 2px;
    left: 2px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.led {
    width: 4px;
    height: 4px;
    background: #dadce0;
    border-radius: 50%;
    transition: background 0.2s;
}

.switch-container:has(.toggle-checkbox:checked) {
    background: var(--cl-primary);
}

.toggle-checkbox:checked~.switch .toggle {
    transform: translateX(22px);
}

.toggle-checkbox:checked~.switch .led {
    background: #ffffff;
    box-shadow: 0 0 4px rgba(255, 255, 255, 0.8);
}

.cl-opt-item.slider .opt-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.cl-range-value {
    font-size: 12px;
    font-weight: 700;
    color: var(--cl-primary);
    background: #e8f0fe;
    padding: 2px 8px;
    border-radius: 4px;
}

.cl-slider {
    -webkit-appearance: none;
    width: 100%;
    height: 4px;
    background: #e0e0e0;
    border-radius: 2px;
    outline: none;
    margin: 10px 0;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cl-slider:hover {
    background-color: #c4c4c4;
}

.cl-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: #ffffff;
    border: 2px solid var(--cl-primary);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease-in-out;
}

.cl-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: #ffffff;
    border: 2px solid var(--cl-primary);
    border-radius: 50%;
    cursor: pointer;
}

/* ==========================================================================
   Canvas Workspace, Toolbar & Tabs
   ========================================================================== */

#canvas-card {
    display: flex;
    flex-direction: column;
    height: auto;
    background: #f8f9fa;
}

#cl-app.right-collapsed #canvas-card,
#cl-app #canvas-card.no-svg {
    height: 100%;
}

#canvas-card .cl-card__header {
    background: #ffffff;
    /* Toolbar stays crisp white */
    padding: 8px 16px;
    border-bottom: 1px solid #e0e0e0;
    min-height: auto;
}

.group-separator {
    border-style: dashed;
}

/* --- 2. The Toolbar & Icons --- */
.cl-toolbar {
    display: flex;
    align-items: center;
    gap: 4px;
    /* Tight grouping for tools */
    flex-wrap: wrap;
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 6px;
    color: #5f6368;
    /* Default grey icon */
    cursor: pointer;
    transition: all 0.2s ease;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.btn-icon svg.cl-icon {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

/* Specific fix for the pallet icon which uses fill */
#pallet svg.cl-icon path {
    fill: currentColor;
    stroke: none;
}

/* Active state should work everywhere, including touch devices */
.btn-icon.is-active {
    color: var(--cl-primary);
    border-color: rgba(26, 115, 232, 0.2);
}

/* Touch feedback for mobile browsers */
.btn-icon:active {
    color: var(--cl-primary);
}

/* Hover state only on devices that actually support hover */
@media (hover: hover) and (pointer: fine) {
    .btn-icon:hover {
        color: var(--cl-primary);
        border-color: rgba(26, 115, 232, 0.2);
    }
}

.btn-icon:focus-visible {
    color: var(--cl-primary);
    border-color: rgba(26, 115, 232, 0.2);
}

/* =============================================
   LOCKED TOOLBAR - Dim all buttons except Lock
   ============================================= */
.cl-toolbar.is-locked .btn-icon:not(#btn-lock) {
    opacity: 0.5;
    filter: grayscale(25%);
    pointer-events: none;
    cursor: not-allowed;
}

/* Optional nice visual feedback on locked toolbar */
.cl-toolbar.is-locked {
    background-color: #f8f9fa;
}

/* --- 3. Sheet Tabs --- */
.cl-canvas__body {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: visible;
    padding: 16px;
    align-items: center;
}

.cl-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.sheet-tab {
    padding: 6px 16px;
    font-size: 13px;
    font-weight: 600;
    color: #5f6368;
    background: #ffffff;
    border: 1px solid #dadce0;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.sheet-tab:hover {
    background: #f8f9fa;
    color: #202124;
    border-color: #bdc1c6;
}

.sheet-tab.active {
    background: var(--cl-primary);
    color: #ffffff;
    border-color: var(--cl-primary);
    box-shadow: 0 2px 4px rgba(26, 115, 232, 0.3);
}

/* --- 4. The Canvas Area --- */
.cl-canvas {
    flex: 1;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    overflow: auto;
    background: #ffffff;
    border-radius: 8px;
    border: 1px dashed #dadce0;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.02);
    padding: 20px;
    box-sizing: border-box;
}

/* --- 5. All Sheets Scroll Container --- */
#all-sheets-grid {
    width: 100%;
    height: 100%;
    overflow-y: auto;
    padding-right: 8px;
}

#all-sheets-grid.scroll-mode {
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Scrollbar styling for the canvas/grid to keep it clean */
.cl-canvas::-webkit-scrollbar,
#all-sheets-grid::-webkit-scrollbar,
.cl-card__body.table-container::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.cl-canvas::-webkit-scrollbar-track,
#all-sheets-grid::-webkit-scrollbar-track,
.cl-card__body.table-container::-webkit-scrollbar-track {
    background: #f1f3f4;
    border-radius: 4px;
}

.cl-canvas::-webkit-scrollbar-thumb,
#all-sheets-grid::-webkit-scrollbar-thumb,
.cl-card__body.table-container::-webkit-scrollbar-thumb {
    background: #bdc1c6;
    border-radius: 4px;
}

.cl-canvas::-webkit-scrollbar-thumb:hover,
#all-sheets-grid::-webkit-scrollbar-thumb:hover,
.cl-card__body.table-container::-webkit-scrollbar-thumb:hover {
    background: #5b5b5c;
    cursor: pointer;
}


/* =============================================
   SINGLE / SCROLL MODE LOGIC (Master Grid)
   ============================================= */


/* SCROLL MODE - show all sheets as thumbnails */
#all-sheets-grid.scroll-mode .sheet-svg-wrapper {
    display: flex !important;
    width: 520px;
    margin: 0 auto 40px auto;
}

#all-sheets-grid.single-mode .sheet-svg-wrapper {
    display: none !important;
}

#all-sheets-grid.single-mode .sheet-svg-wrapper.active {
    display: flex !important;
    width: 520px;
    margin: 0 auto;
}

/* Grid View Layout */
#all-sheets-grid.grid-mode {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: flex-start;
    padding: 20px;
}

#all-sheets-grid.grid-mode .sheet-svg-wrapper {
    width: 100px !important;
    height: auto;
    cursor: pointer;
    border: 2px solid transparent;
    transition: transform 0.2s, border-color 0.2s;
}

#all-sheets-grid.grid-mode .sheet-svg-wrapper:hover {
    transform: scale(1.05);
    border-color: var(--cl-primary);
}

#all-sheets-grid.grid-mode .sheet-svg-wrapper svg {
    width: 100% !important;
    height: auto !important;
}

#all-sheets-grid.grid-mode+#sheet-tabs,
.grid-mode~#sheet-tabs {
    display: none !important;
}

/* Hide dimensions in grid mode */
#all-sheets-grid.grid-mode .sheet-dim-indicator,
#all-sheets-grid.grid-mode .part-hover-dim {
    display: none !important;
}

/* Disable hover effects in grid mode */
#all-sheets-grid.grid-mode .sheet-svg-wrapper .panel-group:hover {
    pointer-events: none;
}

.view-mode-drop-down .cl-dropdown {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.view-mode-drop-down .cl-dropdown__item {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 8px;
    align-items: center;
    padding: 10px 20px;
    border-bottom: 1px solid #eeeeefc7;
}

.view-mode-drop-down .cl-dropdown__item:hover,
.view-mode-drop-down .cl-dropdown__item.active {
    background: #eeeeee;
    color: var(--cl-primary);
}

.view-mode-drop-down .cl-dropdown__item:last-child {
    border: none;
}

/* ==========================================================================
   Canvas Empty State
   ========================================================================== */
.empty-canvas-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 300px;
    width: 100%;
    text-align: center;
    color: #5f6368;
}

.empty-canvas-state .empty-icon {
    width: 80px;
    height: 80px;
    margin-bottom: 20px;
    color: #dadce0;
    /* Subtle grey */
}

.empty-canvas-state h4 {
    font-size: 18px;
    font-weight: 500;
    margin: 0 0 10px 0;
}

.empty-canvas-state p {
    font-size: 14px;
    color: #9aa0a6;
    max-width: 300px;
    margin: 0;
}

/* Hide message when grid has items */
#all-sheets-grid.has-results .empty-canvas-state {
    display: none;
}


/* ==========================================================================
   RIGHT SIDEBAR - ARCHITECTURAL REFACTOR
   ========================================================================== */

#right-sidebar {
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
}

#cl-app.right-collapsed #main-content {
    margin-right: -8px;
}

.cl-sidebar__title,
.cl-card__title,
.cl-caret,
.cl-card__body,
.cl-stat {
    opacity: 1;
    white-space: nowrap;
    transition:
        opacity 0.4s ease,
        max-width 0.6s cubic-bezier(0.32, 0.72, 0, 1),
        visibility 0.4s;
    visibility: visible;
}

#right-sidebar.collapsed .cl-sidebar__title,
#right-sidebar.collapsed .cl-card__title,
#right-sidebar.collapsed .cl-caret,
#right-sidebar.collapsed .cl-card__body,
#right-sidebar.collapsed .cl-stat {
    opacity: 0;
    visibility: hidden;
    margin: 0;
    padding: 0;
}

#right-sidebar.collapsed .cl-card__header,
#right-sidebar.collapsed .cl-card {
    box-shadow: none;
    border: none;
    background: #fff;
}



/* Toggle button rotation */
#toggle-right-sidebar {
    transition: transform 0.6s cubic-bezier(0.32, 0.72, 0, 1);
}

#right-sidebar.collapsed #toggle-right-sidebar {
    transform: rotate(180deg);
    transition: transform 500ms ease;
    ;
}

#right-sidebar #toggle-right-sidebar {
    transition: transform 500ms ease;
    ;
}

.section-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    inline-size: 24px;
    block-size: 24px;
    flex-shrink: 0;
    color: #5f6368;
}

.section-icon svg {
    inline-size: 20px;
    block-size: 20px;
}

/* ==========================================================================
   APPLICATION SHELL - GRID ENGINE
   ========================================================================== */

#cl-app {
    flex: 1;
    inline-size: 100%;
    display: grid;
    grid-template-columns: 350px 1fr 300px;
    gap: 8px;
    padding: 8px;
    max-inline-size: 100%;
    min-block-size: 0;
    margin: 0 auto;
    overflow: hidden;
    box-sizing: border-box;
    transition: grid-template-columns 1s cubic-bezier(0.32, 0.72, 0, 1);
}

#cl-app.right-collapsed {
    grid-template-columns: 40% 1fr 0;
}

/* Scrollbar and Typography consistency */
#left-sidebar,
#main-content,
#right-sidebar {
    block-size: auto;
    min-block-size: 0;
    overflow-y: auto !important;
    overflow-x: hidden;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

#left-sidebar::-webkit-scrollbar,
#main-content::-webkit-scrollbar,
#right-sidebar::-webkit-scrollbar {
    inline-size: 6px;
}

#left-sidebar::-webkit-scrollbar-thumb,
#main-content::-webkit-scrollbar-thumb,
#right-sidebar::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
}

#cl-app h2 {
    font-size: clamp(0.8rem, 2vw, 14px);
    font-weight: 500;
}

#cl-app h3 {
    font-size: clamp(0.75rem, 1.5vw, 13px);
    font-weight: 500;
}




/* ================================
   Cuts Section – Internal Content
================================ */

/* Make table wrapper fill available width */
#cuts-section .cl-table-wrap {
    width: 100%;
    overflow-x: auto;
}

/* Table base */
#cuts-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 11px;
    table-layout: fixed;
}

/* Header */
#cuts-table thead {
    background: #f3f4f6;
}

#cuts-table th {
    text-align: left;
    padding: 8px 10px;
    font-weight: 600;
    border-bottom: 1px solid #e5e7eb;
    white-space: nowrap;
}

/* Cells */
#cuts-table td {
    padding: 5px 2px;
    border-bottom: 1px solid #f1f1f1;
    vertical-align: middle;
}

/* Zebra rows */
#cuts-table tbody tr:nth-child(even):not(.cut-separator) {
    background: #fafafa;
}

/* Hover state */
#cuts-table tbody tr:not(.cut-separator):hover {
    background: #eef2ff;
}

/* Sheet separator row */
#cuts-table .cut-separator td {
    padding: 6px 10px;
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    background: #e9ecef;
    border-bottom: 1px solid #dcdcdc;
}

/* First column (#) compact */
#cuts-table th:first-child,
#cuts-table td:first-child {
    width: 10px;
    text-align: center;
}

/* Result column slightly emphasized */
#cuts-table td:last-child {
    font-weight: 500;
}

/* ==========================================================================
   Section Dropdown Menus (Kebab)
   ========================================================================== */
.btn-kebab {
    border: none;
    background: transparent;
    padding: 0 4px;
    margin-left: auto;
    display: flex;
    align-items: center;
}

.btn-kebab:hover {
    background: transparent;
    color: var(--cl-primary);
}

.btn-kebab svg {
    width: 14px;
    height: 14px;
    fill: #666;
    transition: fill 0.2s ease;
}

.btn-kebab:hover svg {
    fill: var(--cl-primary);
}

.section-dropdown {
    top: 100%;
    right: 0;
    margin-top: 8px;
    min-width: 170px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-radius: 4px;
    z-index: 100;
}

/* Loading Overlay */

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(6px);
    z-index: 999;
}

.loading-overlay.is-active {
    display: flex !important;
    z-index: 9999 !important;
}

.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

#time-left {
    font-size: 1.2rem;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

/* Container for the buttons */
.loading-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 15px;
}

/* Base button styling */
.loading-buttons .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 110px;
    padding: 8px 18px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    outline: none;
    text-decoration: none;
}

/* Primary "Stop & Show" Button */
.btn-primary {
    background-color: var(--cl-primary, var(--cl-primary));
    color: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.btn-primary:hover {
    filter: brightness(1.1);
}

/* Cancel Button - Optimized for Overlay */
.btn-danger-outline {
    background-color: rgba(255, 255, 255, 0.9);
    color: #b91c1c;
    border-color: #fca5a5;
}

.btn-danger-outline:hover {
    background-color: #ffffff;
    border-color: #dc2626;
    color: #dc2626;
}

#progress-percent {
    font-size: 2.4rem;
    font-weight: 700;
    margin-top: 20px;
    text-shadow: 0 3px 15px rgba(237, 184, 51, 0.6);
}

.pl {
    width: 6em;
    height: 6em;
}

.pl__ring {
    animation: ringA 2s linear infinite;
}

.pl__ring--a {
    stroke: #f42f25;
}

.pl__ring--b {
    animation-name: ringB;
    stroke: #f49725;
}

.pl__ring--c {
    animation-name: ringC;
    stroke: #255ff4;
}

.pl__ring--d {
    animation-name: ringD;
    stroke: #f42582;
}

/* Animations */
@keyframes ringA {

    from,
    4% {
        stroke-dasharray: 0 660;
        stroke-width: 20;
        stroke-dashoffset: -330;
    }

    12% {
        stroke-dasharray: 60 600;
        stroke-width: 30;
        stroke-dashoffset: -335;
    }

    32% {
        stroke-dasharray: 60 600;
        stroke-width: 30;
        stroke-dashoffset: -595;
    }

    40%,
    54% {
        stroke-dasharray: 0 660;
        stroke-width: 20;
        stroke-dashoffset: -660;
    }

    62% {
        stroke-dasharray: 60 600;
        stroke-width: 30;
        stroke-dashoffset: -665;
    }

    82% {
        stroke-dasharray: 60 600;
        stroke-width: 30;
        stroke-dashoffset: -925;
    }

    90%,
    to {
        stroke-dasharray: 0 660;
        stroke-width: 20;
        stroke-dashoffset: -990;
    }
}

@keyframes ringB {

    from,
    12% {
        stroke-dasharray: 0 220;
        stroke-width: 20;
        stroke-dashoffset: -110;
    }

    20% {
        stroke-dasharray: 20 200;
        stroke-width: 30;
        stroke-dashoffset: -115;
    }

    40% {
        stroke-dasharray: 20 200;
        stroke-width: 30;
        stroke-dashoffset: -195;
    }

    48%,
    62% {
        stroke-dasharray: 0 220;
        stroke-width: 20;
        stroke-dashoffset: -220;
    }

    70% {
        stroke-dasharray: 20 200;
        stroke-width: 30;
        stroke-dashoffset: -225;
    }

    90% {
        stroke-dasharray: 20 200;
        stroke-width: 30;
        stroke-dashoffset: -305;
    }

    98%,
    to {
        stroke-dasharray: 0 220;
        stroke-width: 20;
        stroke-dashoffset: -330;
    }
}

@keyframes ringC {
    from {
        stroke-dasharray: 0 440;
        stroke-width: 20;
        stroke-dashoffset: 0;
    }

    8% {
        stroke-dasharray: 40 400;
        stroke-width: 30;
        stroke-dashoffset: -5;
    }

    28% {
        stroke-dasharray: 40 400;
        stroke-width: 30;
        stroke-dashoffset: -175;
    }

    36%,
    58% {
        stroke-dasharray: 0 440;
        stroke-width: 20;
        stroke-dashoffset: -220;
    }

    66% {
        stroke-dasharray: 40 400;
        stroke-width: 30;
        stroke-dashoffset: -225;
    }

    86% {
        stroke-dasharray: 40 400;
        stroke-width: 30;
        stroke-dashoffset: -395;
    }

    94%,
    to {
        stroke-dasharray: 0 440;
        stroke-width: 20;
        stroke-dashoffset: -440;
    }
}

@keyframes ringD {

    from,
    8% {
        stroke-dasharray: 0 440;
        stroke-width: 20;
        stroke-dashoffset: 0;
    }

    16% {
        stroke-dasharray: 40 400;
        stroke-width: 30;
        stroke-dashoffset: -5;
    }

    36% {
        stroke-dasharray: 40 400;
        stroke-width: 30;
        stroke-dashoffset: -175;
    }

    44%,
    50% {
        stroke-dasharray: 0 440;
        stroke-width: 20;
        stroke-dashoffset: -220;
    }

    58% {
        stroke-dasharray: 40 400;
        stroke-width: 30;
        stroke-dashoffset: -225;
    }

    78% {
        stroke-dasharray: 40 400;
        stroke-width: 30;
        stroke-dashoffset: -395;
    }

    86%,
    to {
        stroke-dasharray: 0 440;
        stroke-width: 20;
        stroke-dashoffset: -440;
    }
}

/* SVG Panel Hover & Dimension Indicators */
.panel-group {
    transition: filter 0.2s ease, opacity 0.2s ease;
    cursor: pointer;
}

.dim-indicator,
.sheet-dim-indicator {
    transition: opacity 0.2s ease;
    pointer-events: none;
}

svg {
    overflow: visible !important;
    /* Ensure outside dims show */
}

/* Show dimensions on hover over the panel */
.panel-group:hover .dim-indicator {
    opacity: 1 !important;
}

/* Optimization Results Visual Styles: Handles part/sheet highlighting, dimensions, and auto-fading */

/* 1. Dimensions Visibility Logic */
svg:has(.panel-group:hover) .sheet-dim-indicator,
svg:has(.panel-group.is-highlighted) .sheet-dim-indicator {
    opacity: 0 !important;
}

.panel-group:hover .part-hover-dim,
.panel-group.is-highlighted .part-hover-dim {
    opacity: 1 !important;
}

/* 2. FADE LOGIC: When a sheet or part is active, fade out the siblings */
/* Fade other sheets in the grid when one is highlighted */
#all-sheets-grid:has(.sheet-svg-wrapper.is-highlighted)~#all-sheets-grid .sheet-svg-wrapper:not(.is-highlighted),
svg:has(.panel-group.is-highlighted) .panel-group:not(.is-highlighted) {
    filter: grayscale(100%) brightness(0.8);
    transition: filter 0.2s ease;
}

/* 3. Highlight the specific PART (The Rectangle) */
.panel-group.is-highlighted rect {
    stroke: #000000 !important;
    vector-effect: non-scaling-stroke !important;
    stroke-width: 2px !important;
    transform-origin: center;
    paint-order: fill markers stroke;
    transition: all 0.2s ease;
}

/* 4. Highlight the SHEET boundary (The background rect) */
.sheet-svg-wrapper.is-highlighted .sheet-base-bg {
    stroke: var(--cl-primary) !important;
    vector-effect: non-scaling-stroke !important;
    stroke-width: 2px !important;
    filter: drop-shadow(0 0 20px rgba(32, 75, 231, 0.6)) !important;
    transition: all 0.2s ease;
}

/* 5. Reset the outer HTML wrapper boundaries */
.sheet-svg-wrapper {
    transition: opacity 0.3s ease, filter 0.3s ease;
}

.sheet-svg-wrapper.is-highlighted {
    box-shadow: none !important;
    outline: none !important;
    border-color: transparent !important;
    background: transparent !important;
    z-index: 10;
    /* Ensures the glow of the sheet is above neighbors */
}

.panel-group {
    cursor: pointer;
    transition: opacity 0.3s ease;
}

/* container-level containment reduces layout scope */
#all-sheets-grid {
    contain: layout paint;
}

/* hint to GPU/compositor for smoother transforms */
.sheet-svg-wrapper svg {
    will-change: transform, opacity;
    backface-visibility: hidden;
}

/* panels are usually static — promote to its own layer */
.panel-group {
    will-change: transform, opacity;
    transform: translateZ(0);
}

.sheet-placeholder {
    content-visibility: auto;
    contain-intrinsic-size: 800px;
}

:root {
    --modal-bg: #ffffff;
    --modal-overlay: rgba(32, 33, 36, 0.6);
    --primary-text: #202124;
    --secondary-text: #5f6368;
    --radius: 8px;
    --shadow: 0 12px 15px 0 rgba(0, 0, 0, 0.24), 0 17px 50px 0 rgba(0, 0, 0, 0.19);
}

/* ==========================================================================
   Global Modal System (Unified for Alert, Help, Auth, and Bug Report)
   ========================================================================== */

.cl-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(32, 33, 36, 0.6);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(1px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.1s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.1s;
}

/* Active State */
.cl-modal.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* Modal Content Box */
.cl-modal__content {
    background: #ffffff;
    width: 95%;
    max-width: 550px;
    border-radius: 8px;
    box-shadow: 0 24px 38px 3px rgba(0, 0, 0, 0.14), 0 9px 46px 8px rgba(0, 0, 0, 0.12), 0 11px 15px -7px rgba(0, 0, 0, 0.2);
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(10px);
    transition: transform 0.1s cubic-bezier(0.4, 0, 0.2, 1);
}

.cl-modal.is-open .cl-modal__content {
    transform: translateY(0);
}

/* Specific Modifiers */
.cl-modal--bug .cl-modal__content {
    max-width: 600px;
}

/* Header */
.cl-modal__header,
.cl-modal__header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #eeeeee;
}

.cl-modal__header h2,
.cl-modal__title {
    margin: 0;
    font-size: 20px;
    font-weight: 500;
    color: #202124;
}

/* Close Buttons */
.cl-modal__close,
.cl-modal__close-btn {
    background: transparent;
    border: none;
    color: #5f6368;
    cursor: pointer;
    width: 36px;
    height: 36px;
    display: flex;
    border-radius: 50%;
    font-size: 24px;
    line-height: 1;
    justify-content: center;
    align-items: center;
    transition: background-color 0.2s;
    padding: 0;
}

.cl-modal__close:hover,
.cl-modal__close-btn:hover {
    background-color: rgba(60, 64, 67, 0.08);
}

/* Body */
.cl-modal__body {
    padding: 5px 24px;
    font-size: 14px;
    line-height: 1.5;
    color: #3c4043;
    max-height: 80vh;
    overflow-y: auto;
}

/* Footer (For Alerts/Prompts) */
.cl-modal__footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    border-top: 1px solid #eeeeee;
    padding: 16px 24px;
    background: #f8f9fa;
}

.cl-modal__footer .btn {
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s, box-shadow 0.2s;
    border: 1px solid transparent;
}


/* ==========================================================================
   PDF Export Modal - Consistent with left sidebar options
   ========================================================================== */
/* ==========================================================================
   PDF Export Modal
   ========================================================================== */

.pdf-modal-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 10px 0;
}

.pdf-input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pdf-label {
    font-weight: 600;
    font-size: 11px;
    color: #70757a;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.pdf-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.pdf-label {
    font-weight: 600;
    font-size: 11px;
    color: #70757a;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.pdf-label--with-icon {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.pdf-label-icon {
    width: 14px;
    height: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #9a9a9a;
    flex-shrink: 0;
}

.pdf-label-icon svg {
    width: 100%;
    height: 100%;
    display: block;
}

.pdf-input--with-suffix {
    padding-right: 52px;
}


.pdf-input {
    width: 100%;
    height: 44px;
    padding: 10px 12px;
    border: 1px solid #dadce0;
    border-radius: 10px;
    font-size: 14px;
    background: #ffffff;
    color: #3c4043;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.pdf-input:hover {
    border-color: #b8c1cc;
}

.pdf-input:focus {
    outline: none;
    border-color: var(--cl-primary);
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.12);
}

input.pdf-input::placeholder {
    color: #ababab;
}

.pdf-input--with-suffix {
    padding-right: 52px;
}

.pdf-suffix {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #d93025;
    font-size: 13px;
    font-weight: 600;
    pointer-events: none;
    z-index: 2;
}

/* Options */

.pdf-options-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
    border-top: 1px solid #eee;
    padding-top: 15px;
}

.pdf-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.pdf-option-label {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    cursor: pointer;
    min-width: 0;
}

.pdf-option-icon {
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #aaaaaa;
    flex-shrink: 0;
}

.pdf-option-icon svg {
    width: 100%;
    height: 100%;
    display: block;
}

.pdf-option-label .opt-label.checkbox {
    margin: 0;
    flex: 1;
    color: #3c4043;
    font-size: 14px;
    font-weight: 500;
}

.switch-container:has(.toggle-checkbox:checked) {
    background: var(--cl-primary);
}

.toggle-checkbox:checked~.switch .toggle {
    transform: translateX(22px);
}

.toggle-checkbox:checked~.switch .led {
    background: #ffffff;
    box-shadow: 0 0 4px rgba(255, 255, 255, 0.8);
}

/* Responsive */

@media (max-width: 640px) {
    .pdf-option {
        gap: 12px;
    }

    .pdf-option-label .opt-label.checkbox {
        font-size: 13px;
    }

    .pdf-input {
        height: 42px;
        font-size: 13px;
    }
}


/* Primary Button (Login / Clear List) */
.btn--primary {
    background-color: var(--cl-primary);
    color: #ffffff;
}

.btn--primary:hover {
    background-color: var(--cl-primary-hover);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.btn--primary:active {
    transform: translateY(1px);
}

.btn--secondary {
    background-color: #e5e7e9;
    color: #475569;
    border-color: #6e7683;
}

.btn--secondary:hover,
.btn--secondary:active {
    background-color: #cbcccd;
    color: #1e293b;
}

/* =========================================
   Mobile Custom Numpad
   ========================================= */
.eco-numpad {
    display: none;
    /* Hidden by default on desktop */
}

.numpad-expand-btn {
    display: none;
}

@media (max-width: 1024px) {
    .eco-numpad {
        display: block;
        position: fixed;
        bottom: 0;
        left: auto;
        right: 0;
        width: 100%;
        max-width: 320px;
        z-index: 99999;
        transform: translateY(100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .eco-numpad.active {
        transform: translateY(0);
    }

    .numpad-header {
        display: flex;
        justify-content: flex-end;
        align-items: center;
        padding: 6px 12px;
        /* Reduced from 10px 15px */
        background: var(--cl-primary);
        color: #fff;
        font-weight: 600;
        border-top-left-radius: 12px;
        border-top-right-radius: 12px;
        width: 80px;
        margin-left: auto;
    }

    .numpad-toggle-btn {
        background: transparent;
        border: none;
        color: #fff;
        font-size: 16px;
        /* Reduced from 18px */
        padding: 4px;
        /* Reduced from 5px */
        display: flex;
        align-items: center;
        gap: 5px;
    }

    .numpad-grid button {
        background: #fff;
        border: none;
        padding: 12px 0;
        /* Reduced from 18px 0 (This is the main height driver) */
        font-size: 18px;
        /* Reduced from 22px */
        font-weight: 500;
        color: var(--cl-text-main);
        touch-action: manipulation;
        cursor: pointer;
    }

    .numpad-grid {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 1px;
        background: #cbd5e1;
        padding-bottom: 0;
        box-shadow: -4px 0 15px rgba(0, 0, 0, 0.1);
    }

    .numpad-grid button:active {
        background: #e2e8f0;
    }

    .nk-action {
        background: #f1f5f9;
        font-size: 16px !important;
        /* Reduced from 18px */
    }

    .nk-next,
    .nk-ok {
        background: var(--cl-secondary) !important;
        color: #fff !important;
        font-size: 14px !important;
        /* Reduced from 16px */
        text-transform: uppercase;
        letter-spacing: 1px;
    }

    .nk-next {
        grid-row: span 2;
    }

    /* Floating Expand Button */
    .numpad-expand-btn {
        position: fixed;
        bottom: 25px;
        right: 25px;
        width: 50px;
        height: 50px;
        border-radius: 50%;
        background: var(--cl-primary);
        color: #fff;
        border: none;
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
        z-index: 99998;
        display: none;
        /* Controlled via JS */
        align-items: center;
        justify-content: center;
    }

    .numpad-expand-btn.active {
        display: flex;
    }
}



/* ==========================================================================
   COMPONENT: GROUP CARD & HEADER
   ========================================================================== */
.ec-group-wrapper {
    container-type: inline-size;
    background-color: #ffffff;
    border: 1px solid var(--cl-primary);
    border-radius: 12px;
    padding-block: 24px;
    padding-inline: 5px;
    margin-block: 24px;
    margin-inline: 5px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 1;
}

.ec-group-wrapper:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Add side breathing room to group controls, but keep the parts table full width. */
.ec-group-wrapper > .group-meta-row,
.ec-group-wrapper > .sheet-type-row,
.ec-group-wrapper > .group-option-divider,
.ec-group-wrapper > .double-toggle-row,
.ec-group-wrapper > .group-footer {
    margin-inline: 15px;
}

.ec-group-wrapper > .parts-table {
    margin-inline: 0;
}

@media (max-width: 640px) {
    .ec-group-wrapper > .group-meta-row,
    .ec-group-wrapper > .sheet-type-row,
    .ec-group-wrapper > .group-option-divider,
    .ec-group-wrapper > .double-toggle-row,
    .ec-group-wrapper > .group-footer {
        margin-inline: 10px;
    }
}

.group-header {
    text-align: center;
    margin-block-start: -36px;
    margin-block-end: 20px;
}

.group-badge {
    background-color: var(--cl-primary);
    color: #ffffff;
    font-size: clamp(14px, 2vw, 15px);
    font-weight: 600;
    padding-block: 8px;
    padding-inline: 24px;
    border-radius: 9999px;
    box-shadow: 0 2px 6px rgba(26, 115, 232, 0.3);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    position: relative;
    z-index: 10;
}

.remove-group {
    background: none;
    border: none;
    color: #ffffff;
    font-size: 20px;
    inline-size: 28px;
    block-size: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.remove-group:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/*
 * Group Elements
 */
.group-meta-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-block-end: 20px;
}

.meta-field {
    display: flex;
    flex-direction: column;
}

.meta-label {
    font-size: 13px;
    font-weight: 500;
    color: #5f6368;
    margin-block-end: 6px;
}

/* Styled Select Dropdown */
.ec-select {
    appearance: none;
    background-color: #ffffff;
    border: 1px solid #dadce0;
    border-radius: 8px;
    padding-block: 10px;
    padding-inline: 12px 32px;
    /* Space for chevron */
    font-size: 14px;
    color: #3c4043;
    inline-size: 100%;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);

    /* Embedded Chevron SVG for zero HTTP request rendering */
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235f6368' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 1em;
}

.ec-select:focus {
    border-color: var(--cl-primary);
    outline: 2px solid rgba(26, 115, 232, 0.15);
    outline-offset: 1px;
}

.ec-input-meta {
    inline-size: 100%;
    max-inline-size: 100%;
    display: block;
    padding-block: 8px;
    padding-inline: 12px;
    border: 1px solid #dadce0;
    border-radius: 8px;
    box-sizing: border-box;
    font-size: 14px;
    background-color: #ececec;
    color: #3c4043;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.ec-input-meta:focus {
    background: #fff;
    border-color: var(--cl-primary);
    outline: 2px solid rgba(26, 115, 232, 0.15);
    outline-offset: 1px;
}

/* Sheet Type Buttons */
.sheet-type-row {
    margin-block-end: 24px;
}

.sheet-type-buttons {
    display: flex;
    gap: 8px;
    background-color: #f8f9fa;
    padding: 4px;
    border: 1px solid #dadce0;
    border-radius: 9999px;
    inline-size: fit-content;
    margin-block-start: 6px;
}

.type-btn {
    cursor: pointer;
    user-select: none;
    margin-bottom: 0;
}

.type-btn input[type="radio"] {
    display: none;
}

.btn-label {
    display: block;
    padding-block: 10px;
    padding-inline: 24px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 9999px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    background-color: transparent;
    color: #3c4043;
}

.type-btn input[type="radio"]:checked+.btn-label {
    background-color: var(--cl-primary);
    color: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.custom-sheet-inputs {
    display: none;
    margin-block-start: 12px;
}

.custom-sheet-inputs.show {
    display: block;
}

.custom-inputs-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

/* ====================== SHEET TYPE + DIMENSIONS ONE-ROW LAYOUT ====================== */
.sheet-type-flex {
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
    flex: 1;
}

.sheet-type-buttons {
    display: flex;
    gap: 8px;
    background: #f8f9fa;
    padding: 4px;
    border: 1px solid #dadce0;
    border-radius: 9999px;
}

/* Static size text (8ft/9ft) */
.sheet-dim-static {
    font-weight: 600;
    font-size: 14px;
    color: #3c4043;
    white-space: nowrap;
}

/* Custom mode - smaller inline inputs */
.custom-inputs-grid {
    display: flex;
    align-items: center;
    gap: 8px;
}

.dim-input-pair {
    display: flex;
    align-items: center;
    gap: 4px;
}

.sheet-dim-input-small {
    width: 78px !important;
    padding: 6px 8px !important;
    font-size: 13px;
    text-align: right;
}

.dim-x {
    font-size: 16px;
    color: #5f6368;
    font-weight: 400;
}

/* Responsive: wrap only when screen is very narrow */
@media (max-width: 520px) {
    .sheet-type-flex {
        gap: 12px;
    }
}

/* Add New Group */
.add-group-wrapper {
    display: flex;
    justify-content: center;
    margin-block: 40px;
}

#btn-add-group {
    background-color: #ffffff;
    color: var(--cl-primary);
    border: 1px dashed var(--cl-primary);
    padding-block: 14px;
    padding-inline: 40px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-left: 50%;
    margin-block: 15px;
    transform: translateX(-50%);
    width: 300px;
}

#btn-add-group:hover {
    background-color: #f0f4f8;
    box-shadow: 0 4px 12px rgba(26, 115, 232, 0.15);
}

/**
 * Parts Table
 */
.parts-table {
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid #aaa;
    border-radius: 8px;
    inline-size: 100%;
}

.parts-table thead tr th {
    padding-block: 10px;
    background: #eee;
    height: 50px;
}

.parts-table thead tr th:first-child {
    border-top-left-radius: 8px;
}

.parts-table thead tr th:last-child {
    border-top-right-radius: 8px;
}

.parts-table th,
.parts-table td {
    border: 1px solid #dbdada;
    padding: 0 !important;
}

@media (max-width: 640px) {
    .parts-table thead tr th {
        height: 60px;
    }
}


.parts-table td input {
    border-style: none;
    border-width: 0;
    border-color: inherit;
    border-radius: 0;
}

th.action-col {
    position: relative;
    width: 40px;
    min-width: 40px;
    max-width: 40px;
    text-align: center;
    vertical-align: middle;
}

th.action-col .btn-kebab {
    margin: auto;
}

td.action-col {
    position: relative;
    width: 40px !important;
    min-width: 40px !important;
    max-width: 40px !important;
    padding: 0 !important;
    text-align: center;
    vertical-align: middle;
}


.parts-table th:last-child,
.parts-table td:last-child {
    border-right: none;
}

.parts-table tr:last-child td {
    border-bottom: none;
}

/* Active Cell Highlighting */
.parts-table td:focus-within,
.parts-table td.is-numpad-active-cell {
    background-color: #f0f4f8;
    box-shadow: inset 0 0 0 2px var(--cl-primary);
    z-index: 1;
}

.ec-input {
    inline-size: 100%;
    width: 100%;
    box-sizing: border-box;
    display: block;
    padding: 1px 5px !important;
    border: none;
    border-radius: 0;
    font-size: 14px;
    background-color: transparent;
    color: #3c4043;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.ec-input:focus,
.ec-input.is-numpad-active {
    outline: none;
    caret-color: var(--cl-primary);
}

/* ==========================================================================
   COMPONENT: EDGING MATRIX & CHECKBOX
   ========================================================================== */
.edging-cell {
    text-align: center;
    padding-block: 2px !important;
}

.ec-eb-wrapper {
    --eb-thickness: 12px;
    --eb-sq-size: 45px;
    --eb-small-size: 35px;
    --eb-large-size: 50px;

    width: var(--eb-sq-size);
    height: var(--eb-sq-size);
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    position: relative;
    margin: 0 auto;
    overflow: hidden;
    border-radius: 4px;
}

.ec-eb-side {
    position: absolute;
    inset: 0;
    cursor: pointer;
    background: #e2e8f0;
    transition: all 0.1s;
    z-index: 9 !important;
}

.ec-eb-side.active {
    background: var(--cl-primary);
}

.ec-eb-center {
    position: absolute;
    background: white;
    inset: var(--eb-thickness);
    cursor: pointer;
    z-index: 10 !important;
    border-radius: 4px;
}


.ec-eb-top {
    clip-path: polygon(-2px -2px, calc(100% + 2px) -2px, calc(100% - var(--eb-thickness)) var(--eb-thickness), var(--eb-thickness) var(--eb-thickness));
}

.ec-eb-right {
    clip-path: polygon(calc(100% + 2px) -2px, calc(100% + 2px) calc(100% + 2px), calc(100% - var(--eb-thickness)) calc(100% - var(--eb-thickness)), calc(100% - var(--eb-thickness)) var(--eb-thickness));
}

.ec-eb-bottom {
    clip-path: polygon(-2px calc(100% + 2px), calc(100% + 2px) calc(100% + 2px), calc(100% - var(--eb-thickness)) calc(100% - var(--eb-thickness)), var(--eb-thickness) calc(100% - var(--eb-thickness)));
}

.ec-eb-left {
    clip-path: polygon(-2px -2px, var(--eb-thickness) var(--eb-thickness), var(--eb-thickness) calc(100% - var(--eb-thickness)), -2px calc(100% + 2px));
}


/* Double Checkbox */
.double-label {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    justify-content: center;
    padding-block: 10px;
    inline-size: 100%;
}

.calc-double {
    display: none;
}

.checkmark {
    inline-size: 22px;
    block-size: 22px;
    border: 2px solid #dadce0;
    border-radius: 6px;
    position: relative;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.calc-double:checked+.checkmark {
    background-color: var(--cl-primary);
    border-color: var(--cl-primary);
}

.checkmark:after {
    content: "✓";
    color: #ffffff;
    font-size: 16px;
    position: absolute;
    inset-block-start: 50%;
    inset-inline-start: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.calc-double:checked+.checkmark:after {
    opacity: 1;
}

/* Group-level "Have Double Parts?" - clean label style like Sheet Type */
.double-toggle-row {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin: 16px 0 20px;
}

.double-group-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
    color: #5f6368;
    cursor: pointer;
    font-size: 14px;
}

.double-group-label .checkmark {
    flex-shrink: 0;
}

.group-option-divider {
    border: 0;
    border-top: 1px solid #e5e7eb;
    margin: 18px 0 14px;
}

.double-toggle-row {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin: 0 0 20px;
}

.group-toggle-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 32px;
}

.group-toggle-label {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #5f6368;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.group-toggle-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    color: #aaaaaa;
    flex: 0 0 auto;
}

.group-toggle-icon svg {
    width: 20px;
    height: 20px;
    display: block;
}

.group-switch {
    flex: 0 0 auto;
}

/* ==========================================================================
   COMPONENT: FOOTER ACTIONS
   ========================================================================== */
.group-footer {
    text-align: end;
    margin-block-start: 16px;
}

.add-part-btn {
    background-color: var(--cl-primary);
    color: #ffffff;
    border: none;
    padding-block: 10px;
    padding-inline: 20px;
    border-radius: 9999px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 3px rgba(26, 115, 232, 0.3);
}

.add-part-btn:hover {
    background-color: var(--cl-primary-hover);
    transform: translateY(-1px);
}

.plus-icon {
    font-size: 18px;
    line-height: 1;
}

.remove-part {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
    color: #d63638;
    font-size: 18px;
    line-height: 1;
    background: none;
    border: none;
    cursor: pointer;
}


/* Squeeze Action Column and Add Hover Effect */
.parts-table th:last-child {
    width: 40px !important;
    min-width: 40px !important;
}

.parts-table td:last-child {
    width: 40px !important;
    text-align: center;
    vertical-align: middle;
    transition: background-color 0.2s ease;
    cursor: pointer;
}

.parts-table td:last-child:hover {
    background-color: #fee2e2 !important;
}

/* Sr. No Auto-numbering */
.parts-table {
    counter-reset: partRowCounter;
}

.parts-table tbody tr {
    counter-increment: partRowCounter;
}

.sr-cell::before {
    content: counter(partRowCounter);
}

.parts-table tbody tr:last-child td:first-child {
    border-bottom-left-radius: 10px;
}

.parts-table tbody tr:last-child td:last-child {
    border-bottom-right-radius: 10px;
}

/* ==========================================================================
   Responsive Architecture - Optimized App Shell Mode for Mobiles 
   Applies an auto-flex mapping protocol identical to top-tier enterprise apps! 
   ========================================================================== */

@media (max-width: 1024px) {

    html,
    body {
        height: auto;
        overflow: visible !important;
    }

    #main-container {
        height: auto;
    }

    #cl-app,
    #cl-app.right-collapsed {
        display: flex !important;
        flex-direction: column !important;
        gap: 12px !important;
        padding: 10px !important;
        min-height: auto;
        height: auto !important;
    }

    #left-sidebar,
    #main-content,
    #right-sidebar {
        width: 100% !important;
        max-width: 100% !important;
        min-width: unset !important;
        height: auto !important;
        block-size: auto !important;
        min-block-size: auto !important;
        overflow-y: visible !important;
        border: none;
    }


    .cl-navbar {
        padding: 0 10px;
        gap: 5px;
        position: sticky !important;
        top: 0;
        z-index: 1000 !important;
        background-color: var(--cl-surface) !important;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    }

    .cl-navbar__title {
        display: none !important;
    }

    .cl-navbar__brand img {
        max-height: 28px;
    }

    .cl-navbar__actions {
        width: 100%;
    }

    .cl-navbar__actions .btn.nav-btn:not(#btn-calc) {
        font-size: 0 !important;
        padding: 0 12px !important;
        min-width: unset;
    }

    .cl-navbar__actions .btn.nav-btn:not(#btn-calc) svg {
        margin: 0 !important;
        width: 22px;
        height: 22px;
    }

    #btn-calc {
        font-size: 13px !important;
        padding: 0 16px !important;
        order: -1;
    }

    #right-sidebar.collapsed .cl-sidebar__title,
    #right-sidebar.collapsed .cl-card__title,
    #right-sidebar.collapsed .cl-caret,
    #right-sidebar.collapsed #cuts-title .cl-card__title,
    #right-sidebar.collapsed #cuts-title #total-cuts {
        opacity: 1 !important;
        max-width: 100% !important;
        visibility: visible !important;
    }

    #right-sidebar.collapsed .cl-card__body,
    #right-sidebar.collapsed .cl-stat {
        max-height: 0;
        opacity: 0;
        margin: 0;
        padding: 0;
        overflow: hidden;
    }

    #right-sidebar.collapsed #stats-section.is-empty #stats-empty-note {
        display: block;
        margin: 8px 0 0;
        padding: 12px 14px;
        font-size: 12px;
        line-height: 1.5;
        color: #64748b;
        background: #f8fafc;
        border: 1px dashed #cbd5e1;
        border-radius: 10px;
    }


    #right-sidebar.collapsed {
        box-shadow: none !important;
        background: transparent !important;
    }

    #right-sidebar.collapsed .cl-card {
        border: 1px solid var(--cl-border, #e0e0e0) !important;
        background: var(--cl-surface, #ffffff);
        display: block !important;
        margin-bottom: 8px !important;
    }

    #right-sidebar.collapsed .right-sidebar-header {
        margin-bottom: 8px;
        justify-content: space-between;
    }

    #canvas-card,
    #all-sheets-grid {
        min-height: auto;
        height: auto !important;
        overflow: visible !important;
    }

    .sheet-svg-wrapper,
    #all-sheets-grid.scroll-mode .sheet-svg-wrapper,
    #all-sheets-grid.single-mode .sheet-svg-wrapper.active {
        width: 100% !important;
        max-width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        margin-bottom: 25px !important;
    }

    .sheet-svg-wrapper svg {
        max-width: 100% !important;
        height: auto !important;
        overflow: visible !important;
    }

    .cl-canvas__body {
        padding: 15px 5px !important;
    }

    .cl-toolbar {
        justify-content: flex-start !important;
    }

    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        overflow-y: hidden;
    }

    .cl-excel-table input,
    .cl-excel-table select {
        min-width: 60px;
    }

    .cl-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        max-width: 100%;
        padding-bottom: 4px;
    }

    .cl-navbar__dropdown .cl-dropdown {
        left: auto !important;
        right: 0 !important;
    }
}

/* ==========================================================================
   iOS Safari Specific Fixes
   ========================================================================== */
@media screen and (max-width: 1024px) {

    /* 1. Prevent iOS Auto-Zoom by forcing inputs to 16px on mobile */
    input[type="text"],
    input[type="number"],
    input[type="email"],
    textarea,
    select,
    .ec-input,
    .ec-select,
    .ec-input-meta,
    .pdf-input,
    #opt-unit,
    #input-kerf,
    #edge-offset {
        font-size: 16px !important;
    }

    /* 2. Remove default iOS styling/shadows on inputs */
    input,
    select,
    textarea {
        -webkit-appearance: none;
        appearance: none;
    }


}


/* ==========================================================================
   MODERN ORDER FORM UI
   ========================================================================== */
.eco-modern-form .eco-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.eco-modern-form .eco-input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
}

.eco-modern-form .eco-form-grid .eco-input-group {
    margin-bottom: 0;
}

.eco-modern-form label {
    font-size: 13.5px;
    font-weight: 600;
    color: #334155;
    letter-spacing: 0.2px;
}

.eco-modern-form .eco-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
    background: #ffffff;
    border: 1.5px solid #cbd5e1;
    border-radius: 10px;
    overflow: hidden;
    transition: all 0.2s ease;
}

.eco-modern-form .eco-input-wrap:focus-within {
    border-color: var(--cl-primary);
    box-shadow: 0 0 0 3px rgba(192, 160, 93, 0.15);
}

.eco-modern-form .eco-input-wrap svg {
    position: absolute;
    left: 14px;
    color: #94a3b8;
    transition: color 0.2s ease;
}

.eco-modern-form .eco-input-wrap:focus-within svg {
    color: var(--cl-primary);
}

.eco-modern-form .eco-input-wrap input,
.eco-modern-form .eco-input-wrap textarea {
    width: 100%;
    border: none;
    padding: 14px 14px 14px 40px;
    font-size: 15px;
    color: #1e293b;
    background: transparent;
    outline: none;
    font-family: inherit;
    box-sizing: border-box;
}

.eco-modern-form .eco-input-wrap textarea {
    padding-top: 14px;
    resize: none;
    max-height: 80px;
}

.eco-modern-form .eco-input-wrap input::placeholder,
.eco-modern-form .eco-input-wrap textarea::placeholder {
    color: #94a3b8;
    font-weight: 400;
}

.ec-order-prefill {
    margin-bottom: 18px;
}

.ec-order-prefill-view {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 14px 16px;
    position: relative;
}

.ec-order-prefill-title {
    font-size: 13px;
    color: #64748b;
    margin-bottom: 10px;
    font-weight: 600;
    letter-spacing: .03em;
    text-transform: uppercase;
}

.ec-order-prefill-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 16px;
    align-items: start;
}

.ec-order-prefill-item--full {
    grid-column: 1 / -1;
}

.ec-order-prefill-label {
    display: block;
    font-size: 11px;
    color: #94a3b8;
    margin-bottom: 2px;
}

.ec-order-prefill-value {
    display: block;
    font-size: 14px;
    color: #0f172a;
    line-height: 1.45;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.ec-order-prefill-edit-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: 1px solid #cbd5e1;
    border-radius: 7px;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 600;
    color: #475569;
    cursor: pointer;
}

.ec-order-prefill-edit {
    margin-top: 12px;
}

@media (max-width: 640px) {
    .ec-order-prefill-grid {
        grid-template-columns: 1fr;
    }

    .ec-order-prefill-edit-btn {
        position: static;
        margin-top: 12px;
    }

    .eco-modern-form .eco-form-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}