:root {
    --wg-navy: #071b2f;
    --wg-blue: #0b2a4a;
    --wg-cyan: #1976a2;
    --wg-orange: #ff6a1a;
    --wg-green: #16a34a;
    --wg-red: #dc2626;
    --wg-bg: #eef4f8;
    --wg-surface: #ffffff;
    --wg-surface-soft: #f7fafc;
    --wg-text: #17324d;
    --wg-muted: #64748b;
    --wg-border: rgba(25, 118, 162, .18);
    --wg-shadow: 0 18px 42px rgba(7, 27, 47, .08);
    --wg-sidebar-width: 250px;
    --wg-sidebar-collapsed-width: 74px;
    --wg-topbar-height: 58px;
}

html,
body {
    min-height: 100%;
    overflow-x: hidden;
}

body.weldgrid-shell {
    margin: 0;
    background: var(--wg-bg);
    color: var(--wg-text);
    font-family: Arial, "Segoe UI", sans-serif;
}

body.weldgrid-shell *,
body.weldgrid-shell *::before,
body.weldgrid-shell *::after {
    box-sizing: border-box;
}

/* ─────────────────────────────────────────────
   FONTS & TEXT ANIMATIONS
────────────────────────────────────────────── */
@import url("https://fonts.googleapis.com/css2?family=Orbitron&display=swap");
@property --num { syntax: "<integer>"; initial-value: 0; inherits: false; }
@keyframes initText {
  0% {
    content: "Αρχικοποίηση WeldGrid . . .";
  }

  17% {
    content: "Αρχικοποίηση WeldGrid . . .\00000a Φόρτωση βασικών μονάδων έργου . . .";
  }

  27% {
    content: "Αρχικοποίηση WeldGrid . . .\00000a Φόρτωση βασικών μονάδων έργου . . .\00000a Προετοιμασία PDF viewer . . .";
  }

  36% {
    content: "Αρχικοποίηση WeldGrid . . .\00000a Φόρτωση βασικών μονάδων έργου . . .\00000a Προετοιμασία PDF viewer . . .\00000a Έλεγχος ασφαλούς σύνδεσης . . .";
  }

  42% {
    content: "Αρχικοποίηση WeldGrid . . .\00000a Φόρτωση βασικών μονάδων έργου . . .\00000a Προετοιμασία PDF viewer . . .\00000a Έλεγχος ασφαλούς σύνδεσης . . .\00000a Φόρτωση δεδομένων έργων . . .";
  }

  49% {
    content: "Φόρτωση βασικών μονάδων έργου . . .\00000a Προετοιμασία PDF viewer . . .\00000a Έλεγχος ασφαλούς σύνδεσης . . .\00000a Φόρτωση δεδομένων έργων . . .\00000a Προετοιμασία BOM δεδομένων . . .";
  }

  60% {
    content: "Προετοιμασία PDF viewer . . .\00000a Έλεγχος ασφαλούς σύνδεσης . . .\00000a Φόρτωση δεδομένων έργων . . .\00000a Προετοιμασία BOM δεδομένων . . .\00000a Ενεργοποίηση annotation tools . . .";
  }

  66% {
    content: "Έλεγχος ασφαλούς σύνδεσης . . .\00000a Φόρτωση δεδομένων έργων . . .\00000a Προετοιμασία BOM δεδομένων . . .\00000a Ενεργοποίηση annotation tools . . .\00000a Φόρτωση spool workspace . . .\00000a";
  }

  78% {
    content: "Φόρτωση δεδομένων έργων . . .\00000a Προετοιμασία BOM δεδομένων . . .\00000a Ενεργοποίηση annotation tools . . .\00000a Φόρτωση spool workspace . . .\00000a Προετοιμασία export engine . . .\00000a";
  }

  100% {
    content: "Προετοιμασία BOM δεδομένων . . .\00000a Ενεργοποίηση annotation tools . . .\00000a Φόρτωση spool workspace . . .\00000a Προετοιμασία export engine . . .\00000a Σύνδεση με WeldGrid workspace . . .\00000a";
  }
}
@keyframes opcty {
  0% { opacity: 0; }
  100% { opacity: 1; }
}
@keyframes counting {
  0% { --num: 0; }
  60% { --num: 66; }
  100% { --num: 100; }
}
@keyframes charging {
  0% { width: 0%; }
  60% { width: 66%; }
  100% { width: 100%; }
}
@keyframes rotate {
  0% { transform: rotate(0); }
  100% { transform: rotate(360deg); }
}

/* =========================================================
   WeldGrid Shell Layout
========================================================= */
body.weldgrid-shell .app-wrapper {
    display: grid;
    grid-template-columns: var(--wg-sidebar-width) minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr) auto;
    grid-template-areas:
        "sidebar header"
        "sidebar main"
        "sidebar footer";
    min-height: 100vh;
    width: 100%;
    overflow-x: hidden;
    background: linear-gradient(180deg, #eef4f8 0%, #ffffff 100%);
}

body.weldgrid-shell.sidebar-collapse .app-wrapper {
    grid-template-columns: var(--wg-sidebar-collapsed-width) minmax(0, 1fr);
}

body.weldgrid-shell .app-header {
    grid-area: header;
    min-height: var(--wg-topbar-height);
    background: var(--wg-navy) !important;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
    position: sticky;
    top: 0;
    z-index: 1035;
    padding: 0;
}

body.weldgrid-shell .app-header .container-fluid {
    min-height: var(--wg-topbar-height);
    gap: 10px;
}

body.weldgrid-shell .app-main {
    grid-area: main;
    min-width: 0;
    min-height: 0;
    padding: 18px;
    background: transparent;
}

body.weldgrid-shell .app-content,
body.weldgrid-shell .container-fluid {
    min-width: 0;
}

body.weldgrid-shell .app-footer.weldgrid-footer {
    grid-area: footer;
    position: relative !important;
    inset: auto !important;
    width: auto !important;
    min-height: 56px;
    padding: 14px 18px;
    background: var(--wg-navy);
    border-top: 1px solid rgba(255, 255, 255, .08);
    color: #ffffff;
    z-index: 10;
}

body.weldgrid-shell .weldgrid-footer p {
    margin: 0;
    line-height: 1.5;
}

body.weldgrid-shell .weldgrid-footer a {
    color: #ffb074;
    font-weight: 700;
    text-decoration: none;
}

body.weldgrid-shell .weldgrid-footer a:hover {
    color: #ffffff;
    text-decoration: underline;
}

/* =========================================================
   WeldGrid Functional Pages
========================================================= */
.wg-functional-page {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.wg-card {
    background: var(--wg-surface);
    border: 1px solid var(--wg-border);
    border-radius: 8px;
    box-shadow: var(--wg-shadow);
    padding: 18px;
    min-width: 0;
}

.wg-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 16px;
}

.wg-card-head h2 {
    margin: 0;
    font-size: 1.02rem;
    font-weight: 800;
    color: var(--wg-navy);
}

.wg-card-head p,
.wg-modal-subtitle,
.wg-muted-text {
    margin: 4px 0 0;
    color: var(--wg-muted);
    font-size: .86rem;
}

.wg-btn,
.wg-icon-btn,
.wg-top-action,
.wg-export-option,
.wg-pdf-list-item,
.wg-annotation-list-item,
.wg-spool-list-item {
    border: 1px solid rgba(7, 27, 47, .13);
    background: #fff;
    color: var(--wg-text);
    border-radius: 8px;
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 12px;
    font-weight: 700;
    text-decoration: none;
    transition: background .18s ease, border-color .18s ease, color .18s ease, transform .18s ease;
}

.wg-btn:hover,
.wg-icon-btn:hover,
.wg-export-option:hover,
.wg-pdf-list-item:hover,
.wg-annotation-list-item:hover,
.wg-spool-list-item:hover {
    border-color: rgba(255, 106, 26, .45);
    color: var(--wg-orange);
}

.wg-btn-primary,
.wg-top-action-primary {
    background: var(--wg-orange);
    color: #fff;
    border-color: var(--wg-orange);
}

.wg-btn-primary:hover,
.wg-top-action-primary:hover {
    background: #e95d12;
    color: #fff;
}

.wg-btn-sm {
    min-height: 32px;
    padding: 6px 9px;
    font-size: .82rem;
}

.wg-icon-btn {
    width: 36px;
    height: 36px;
    min-height: 36px;
    padding: 0;
}

.wg-danger {
    color: var(--wg-red);
}

.wg-danger:hover {
    border-color: rgba(220, 38, 38, .4);
    color: var(--wg-red);
}

.wg-button-row,
.wg-row-actions,
.wg-inline-form,
.wg-active-pdf-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.wg-functional-toolbar {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: center;
}

.wg-status-pill {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: .78rem;
    font-weight: 800;
    background: #edf4f8;
    color: var(--wg-cyan);
}

.wg-status-active,
.wg-status-done {
    background: rgba(22, 163, 74, .12);
    color: var(--wg-green);
}

.wg-status-archived,
.wg-status-pending,
.wg-status-running,
.wg-status-warning {
    background: rgba(255, 106, 26, .13);
    color: #a9470b;
}

.wg-status-failed,
.wg-status-deleted {
    background: rgba(220, 38, 38, .12);
    color: var(--wg-red);
}

.wg-empty-note,
.wg-empty-cell {
    color: var(--wg-muted);
    text-align: center;
    padding: 18px;
}

.wg-empty-warning {
    color: var(--wg-red);
}

/* =========================================================
   WeldGrid Helper Messages
========================================================= */
.wg-helper-message {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 8px;
    border: 1px solid rgba(25, 118, 162, .22);
    background: #f3f9fc;
    color: var(--wg-text);
    font-size: .9rem;
}

.wg-helper-message i {
    color: var(--wg-cyan);
    font-size: 1.1rem;
    margin-top: 1px;
}

.wg-helper-warning {
    background: #fff7ed;
    border-color: rgba(255, 106, 26, .28);
}

.wg-helper-warning i {
    color: var(--wg-orange);
}

/* =========================================================
   WeldGrid Project Cards
========================================================= */
.wg-stat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.wg-stat-card {
    background: #fff;
    border: 1px solid var(--wg-border);
    border-radius: 8px;
    padding: 15px;
    box-shadow: var(--wg-shadow);
}

.wg-stat-card span {
    display: block;
    color: var(--wg-muted);
    font-size: .82rem;
    margin-bottom: 6px;
}

.wg-stat-card strong {
    color: var(--wg-navy);
    font-size: 1.35rem;
    line-height: 1.1;
}

.wg-table-responsive {
    width: 100%;
    overflow-x: auto;
}

.wg-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    min-width: 780px;
}

.wg-table th {
    background: #eef5f8;
    color: var(--wg-navy);
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: 0;
    padding: 11px 12px;
    border-bottom: 1px solid var(--wg-border);
    white-space: nowrap;
}

.wg-table td {
    padding: 11px 12px;
    border-bottom: 1px solid rgba(7, 27, 47, .08);
    vertical-align: middle;
    color: var(--wg-text);
}

.wg-functional-modal .modal-content {
    border: 0;
    border-radius: 8px;
    overflow: hidden;
}

.wg-functional-modal .modal-header {
    background: var(--wg-navy);
    color: #fff;
}

.wg-functional-modal .modal-title {
    font-weight: 800;
    color: var(--third-color);
}

.wg-functional-modal .wg-modal-subtitle {
    color: rgba(255, 255, 255, .72);
}

/* =========================================================
   WeldGrid PDF Viewer
========================================================= */
.wg-pdf-toolbar {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) repeat(8, auto);
    gap: 8px;
    align-items: center;
}

.wg-page-counter {
    min-width: 72px;
    text-align: center;
    font-weight: 800;
    color: var(--wg-navy);
}

.wg-pdf-layout {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr) 320px;
    gap: 14px;
    align-items: start;
}

.wg-pdf-side {
    min-width: 0;
}

.wg-upload-box,
.wg-form-stack {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.wg-pdf-list,
.wg-annotation-list,
.wg-spool-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.wg-pdf-list-item,
.wg-annotation-list-item,
.wg-spool-list-item {
    width: 100%;
    justify-content: flex-start;
    text-align: left;
    flex-direction: column;
    align-items: flex-start;
}

.wg-pdf-list-item.active,
.wg-annotation-list-item.active,
.wg-spool-list-item.active {
    border-color: var(--wg-orange);
    background: #fff7ed;
}

.wg-pdf-list-item span,
.wg-annotation-list-item span,
.wg-spool-list-item small {
    color: var(--wg-muted);
    font-size: .8rem;
}

.wg-pdf-viewer-card {
    padding: 0;
    overflow: hidden;
}

.wg-active-pdf-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--wg-border);
    background: #f7fafc;
}

.wg-active-pdf-bar strong,
.wg-active-pdf-bar span {
    display: block;
}

.wg-active-pdf-bar span {
    color: var(--wg-muted);
    font-size: .82rem;
}

.wg-toggle-line {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: .84rem;
    font-weight: 800;
    color: var(--wg-text);
}

.wg-pdf-canvas-shell {
    position: relative;
    min-height: 620px;
    overflow: auto;
    background:
        linear-gradient(45deg, rgba(7, 27, 47, .035) 25%, transparent 25%),
        linear-gradient(-45deg, rgba(7, 27, 47, .035) 25%, transparent 25%),
        #dfe9ef;
    background-size: 18px 18px;
    padding: 16px;
}

#wgPdfCanvas {
    display: block;
    background: #fff;
    box-shadow: 0 10px 30px rgba(7, 27, 47, .18);
}

.wg-annotation-layer {
    position: absolute;
    left: 16px;
    top: 16px;
    pointer-events: auto;
}

.wg-pdf-empty {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--wg-muted);
    background: rgba(238, 244, 248, .9);
    z-index: 2;
}

.wg-pdf-empty i {
    font-size: 2rem;
    color: var(--wg-orange);
}

/* =========================================================
   WeldGrid Annotation Tools
========================================================= */
.wg-pdf-annotation {
    position: absolute;
    transform: translate(-50%, -50%);
    border: 1px solid #d93025;
    background: #fff;
    color: #d93025;
    border-radius: 5px;
    min-width: 42px;
    min-height: 24px;
    padding: 2px 6px;
    font-weight: 900;
    font-size: .78rem;
    box-shadow: 0 4px 14px rgba(7, 27, 47, .18);
}

.wg-pdf-annotation.focused,
.wg-pdf-annotation:hover {
    background: #d93025;
    color: #fff;
}

.wg-check-row {
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 38px;
}

.wg-check-row label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 700;
}

/* =========================================================
   WeldGrid BOM Table
========================================================= */
.wg-bom-controls .wg-button-row {
    justify-content: flex-start;
}

.wg-bom-table-wrap {
    max-height: 620px;
}

.wg-bom-table th,
.wg-bom-table td {
    min-width: 130px;
}

.wg-cell-input {
    width: 100%;
    min-width: 120px;
    border: 1px solid rgba(7, 27, 47, .12);
    border-radius: 6px;
    padding: 7px 9px;
    color: var(--wg-text);
    background: #fff;
}

.wg-cell-input:focus {
    border-color: var(--wg-orange);
    outline: none;
}

.wg-raw-panel pre {
    max-height: 360px;
    overflow: auto;
    background: #071b2f;
    color: #e7f2f8;
    border-radius: 8px;
    padding: 14px;
    white-space: pre-wrap;
}

/* =========================================================
   WeldGrid Spools
========================================================= */
.wg-spool-layout {
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
    gap: 14px;
}

.wg-spool-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    display: inline-block;
    border: 1px solid rgba(7, 27, 47, .18);
}

.wg-assignment-panel {
    margin-bottom: 16px;
    padding: 14px;
    background: #f7fafc;
    border: 1px solid var(--wg-border);
    border-radius: 8px;
}

.wg-inline-form {
    align-items: stretch;
}

.wg-inline-form .form-select {
    min-width: 260px;
}

/* =========================================================
   WeldGrid Export Center
========================================================= */
.wg-export-layout {
    display: grid;
    grid-template-columns: 340px minmax(0, 1fr);
    gap: 14px;
}

.wg-export-options {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    margin: 16px 0;
}

.wg-export-option {
    justify-content: flex-start;
    min-height: 52px;
    font-size: .94rem;
}

.wg-export-option i {
    color: var(--wg-orange);
    font-size: 1.2rem;
}

/* =========================================================
   WeldGrid Settings Mapping
========================================================= */
.wg-mapping-builder {
    display: flex;
    flex-direction: column;
    gap: 9px;
    margin-top: 18px;
}

.wg-mapping-row {
    display: grid;
    grid-template-columns: minmax(220px, 1.3fr) 180px minmax(220px, 1fr) 42px;
    gap: 8px;
    align-items: center;
}

.wg-mapping-head {
    color: var(--wg-muted);
    font-weight: 800;
    font-size: .82rem;
    text-transform: uppercase;
}

.wg-preview-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.wg-preview-item {
    border: 1px solid var(--wg-border);
    border-radius: 8px;
    padding: 12px;
    background: #f7fafc;
}

.wg-preview-item span,
.wg-preview-item small {
    display: block;
    color: var(--wg-muted);
    font-size: .78rem;
}

.wg-preview-item strong {
    display: block;
    color: var(--wg-navy);
    margin: 4px 0;
}

@media (max-width: 1200px) {
    .wg-pdf-layout,
    .wg-export-layout,
    .wg-spool-layout {
        grid-template-columns: 1fr;
    }

    .wg-pdf-toolbar {
        grid-template-columns: minmax(220px, 1fr) repeat(4, auto);
    }

    .wg-stat-grid,
    .wg-preview-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .wg-functional-toolbar,
    .wg-card-head,
    .wg-active-pdf-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .wg-pdf-toolbar,
    .wg-mapping-row,
    .wg-stat-grid,
    .wg-preview-grid {
        grid-template-columns: 1fr;
    }

    .wg-inline-form {
        flex-direction: column;
    }

    .wg-table {
        min-width: 720px;
    }
}

body.weldgrid-shell .loader-spinner-container {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(238, 244, 248, .86);
}

body.weldgrid-shell .loader_spinner_css {
    width: 44px;
    height: 44px;
    border: 4px solid rgba(25, 118, 162, .18);
    border-top-color: var(--wg-orange);
    border-radius: 50%;
    animation: wgSpin .8s linear infinite;
}

@keyframes wgSpin {
    to {
        transform: rotate(360deg);
    }
}

/* =========================================================
   WeldGrid Sidebar
========================================================= */
body.weldgrid-shell .app-sidebar {
    grid-area: sidebar;
    width: var(--wg-sidebar-width);
    min-width: var(--wg-sidebar-width);
    max-width: var(--wg-sidebar-width);
    height: 100vh;
    position: sticky;
    top: 0;
    overflow: hidden;
    background: linear-gradient(180deg, var(--wg-navy) 0%, var(--wg-blue) 100%) !important;
    border-right: 1px solid rgba(255, 255, 255, .08);
    transition: width .18s ease, min-width .18s ease, max-width .18s ease;
}

body.weldgrid-shell.sidebar-collapse .app-sidebar {
    width: var(--wg-sidebar-collapsed-width) !important;
    min-width: var(--wg-sidebar-collapsed-width) !important;
    max-width: var(--wg-sidebar-collapsed-width) !important;
}

body.weldgrid-shell .sidebar-brand {
    min-height: 78px;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}

body.weldgrid-shell .weldgrid-brand-link,
body.weldgrid-shell .brand-link {
    width: 100%;
    min-height: 54px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 8px;
    background: rgba(255, 255, 255, .94);
    padding: 6px;
    text-decoration: none;
}

body.weldgrid-shell .weldgrid-sidebar-logo,
body.weldgrid-shell .brand-image {
    display: block;
    max-width: 150px !important;
    max-height: 46px !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain;
    margin: 0 !important;
}

body.weldgrid-shell.sidebar-collapse .weldgrid-brand-link,
body.weldgrid-shell.sidebar-collapse .brand-link {
    width: 48px;
    min-width: 48px;
    max-width: 48px;
    height: 54px;
    padding: 6px;
}

body.weldgrid-shell.sidebar-collapse .weldgrid-sidebar-logo,
body.weldgrid-shell.sidebar-collapse .brand-image {
    max-width: 38px !important;
    max-height: 38px !important;
}

body.weldgrid-shell .sidebar-wrapper {
    height: calc(100vh - 78px);
    overflow-y: auto;
    overflow-x: hidden;
    padding: 8px 8px 18px;
    scrollbar-gutter: stable;
}

body.weldgrid-shell .sidebar-wrapper::-webkit-scrollbar {
    width: 6px;
}

body.weldgrid-shell .sidebar-wrapper::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, .22);
    border-radius: 999px;
}

body.weldgrid-shell .sidebar-wrapper::-webkit-scrollbar-track {
    background: transparent;
}

body.weldgrid-shell .session-timeout-wrapper {
    margin: 2px 0 12px;
    border-radius: 8px;
    background: rgba(255, 255, 255, .08);
    color: #ffffff;
    padding: 10px 12px;
}

body.weldgrid-shell .session-timeout-content {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

body.weldgrid-shell .session-timeout-message {
    margin: 0;
    font-size: .86rem;
    line-height: 1.35;
}

body.weldgrid-shell .countdown {
    font-weight: 800;
    color: #ffb074;
}

body.weldgrid-shell .sidebar-menu {
    gap: 0;
}

body.weldgrid-shell .sidebar-menu .nav-header {
    color: rgba(255, 255, 255, .54);
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .08em;
    padding: 14px 10px 4px;
}

body.weldgrid-shell .sidebar-menu .nav-link {
    min-height: 42px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-radius: 8px;
    margin: 4px 0;
    padding: 10px 12px;
    color: rgba(255, 255, 255, .84);
    white-space: nowrap;
    overflow: hidden;
}

body.weldgrid-shell .sidebar-menu .nav-link:hover {
    background: rgba(255, 255, 255, .08);
    color: #ffffff;
}

body.weldgrid-shell .sidebar-menu .nav-link.active {
    background: linear-gradient(135deg, var(--wg-cyan) 0%, #145f87 100%) !important;
    color: #ffffff !important;
    box-shadow: 0 8px 18px rgba(25, 118, 162, .22);
}

body.weldgrid-shell .sidebar-menu .nav-link i {
    flex: 0 0 22px;
    width: 22px;
    text-align: center;
    font-size: 1.08rem;
}

body.weldgrid-shell .sidebar-menu .nav-link p {
    margin: 0;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

body.weldgrid-shell .sidebar-menu .nav-treeview {
    display: none;
    padding-left: 0;
}

body.weldgrid-shell .sidebar-menu .menu-open > .nav-treeview {
    display: block;
}

body.weldgrid-shell .sidebar-menu .nav-treeview .nav-link {
    min-height: 38px;
    margin-left: 12px;
    padding-left: 12px;
    font-size: .92rem;
    background: rgba(255, 255, 255, .04);
}

body.weldgrid-shell .nav-arrow {
    margin-left: auto;
    font-size: 1.25rem;
}

body.weldgrid-shell.sidebar-collapse .sidebar-wrapper {
    padding-left: 0;
    padding-right: 0;
    overflow-y: hidden;
}

body.weldgrid-shell.sidebar-collapse .sidebar-menu .nav-link {
    width: 48px;
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
    margin-left: auto;
    margin-right: auto;
}

body.weldgrid-shell.sidebar-collapse .sidebar-menu .nav-link p,
body.weldgrid-shell.sidebar-collapse .sidebar-menu .nav-header,
body.weldgrid-shell.sidebar-collapse .session-timeout-message,
body.weldgrid-shell.sidebar-collapse .nav-arrow,
body.weldgrid-shell.sidebar-collapse #timeoutCountdownMobile,
body.weldgrid-shell.sidebar-collapse .nav-treeview {
    display: none !important;
}

body.weldgrid-shell.sidebar-collapse .session-timeout-wrapper {
    width: 48px;
    margin-left: auto;
    margin-right: auto;
    padding: 10px 0;
}

body.weldgrid-shell.sidebar-collapse .session-timeout-content {
    justify-content: center;
}

/* =========================================================
   WeldGrid Topbar
========================================================= */
body.weldgrid-shell .app-header .nav-link {
    color: #ffffff !important;
}

body.weldgrid-shell .wg-top-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    min-width: 0;
}

body.weldgrid-shell .wg-top-action {
    min-height: 38px;
    color: #ffffff !important;
    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 8px;
    padding: 8px 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-decoration: none;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
}

body.weldgrid-shell .wg-top-action:hover,
body.weldgrid-shell .wg-top-action:focus {
    background: rgba(255, 255, 255, .14);
    color: #ffffff !important;
}

body.weldgrid-shell .wg-top-action-primary {
    background: linear-gradient(135deg, var(--wg-orange) 0%, #ff8a3d 100%);
    border-color: rgba(255, 106, 26, .42);
}

body.weldgrid-shell #notifications-nav-item {
    position: relative;
}

body.weldgrid-shell #notifications-bell-btn {
    position: relative;
    border: 0;
    background: transparent;
}

body.weldgrid-shell .wg-notification-icon {
    font-size: 1.45rem;
}

body.weldgrid-shell .app-header .wg-topbar-icon-button {
    display: inline-grid !important;
    width: 42px !important;
    height: 42px !important;
    min-width: 42px !important;
    min-height: 42px !important;
    place-items: center !important;
    gap: 0 !important;
    padding: 0 !important;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #ffffff !important;
    line-height: 1 !important;
}

body.weldgrid-shell .app-header .wg-topbar-icon-button::after {
    display: none;
}

body.weldgrid-shell .app-header .wg-topbar-icon-button > i {
    display: block;
    margin: 0 !important;
    font-size: 1.35rem;
    line-height: 1;
}

body.weldgrid-shell .app-header .wg-topbar-icon-button:hover,
body.weldgrid-shell .app-header .wg-topbar-icon-button[aria-expanded="true"] {
    background: rgba(255, 255, 255, .12);
}

body.weldgrid-shell .app-header .wg-topbar-icon-button:focus-visible {
    outline: 3px solid rgba(255, 255, 255, .28);
    outline-offset: 2px;
}

body.weldgrid-shell .wg-profile-menu-avatar {
    display: grid;
    width: 88px;
    height: 88px;
    margin: 0 auto 10px;
    place-items: center;
    border: 1px solid #cbd9e4;
    border-radius: 50%;
    background: #e8f3f8;
    color: #0c4b70;
    box-shadow: 0 4px 12px rgba(7, 31, 51, .10);
    font-size: 2.35rem;
    line-height: 1;
}

body.weldgrid-shell #notifications-badge {
    display: none;
}

body.weldgrid-shell .notifications-dropdown-menu {
    min-width: 340px;
    max-width: 450px;
    max-height: 65vh;
    overflow-y: auto;
    right: 0;
    left: auto;
}

body.weldgrid-shell .user-menu .user-image {
    width: 34px;
    height: 34px;
    object-fit: cover;
}

body.weldgrid-shell .user-menu .dropdown-menu {
    border: 1px solid var(--wg-border);
    box-shadow: var(--wg-shadow);
}

body.weldgrid-shell .user-menu .user-header {
    background: var(--wg-blue) !important;
    color: #ffffff !important;
}

body.weldgrid-shell .user-menu .user-footer {
    background: #f8fafc !important;
}

/* =========================================================
   WeldGrid Pages
========================================================= */
.wg-page-shell {
    width: 100%;
    min-height: 0;
}
.wg-page-header {
    background: linear-gradient(135deg, rgba(11, 42, 74, .98), rgba(25, 118, 162, .92));
    border: 1px solid rgba(255, 106, 26, .22);
    border-radius: 8px;
    color: #ffffff;
    margin: 0 0 18px;
    padding: 28px 30px;
    box-shadow: 0 18px 42px rgba(7, 27, 47, .14);
}

.wg-page-header-kicker {
    color: #ffb074;
    font-size: .78rem;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.wg-page-header h1 {
    font-size: 2rem;
    font-weight: 850;
    letter-spacing: 0;
    margin: 0 0 10px;
}

.wg-page-header p {
    color: rgba(255, 255, 255, .84);
    font-size: 1rem;
    line-height: 1.65;
    margin: 0;
    max-width: 860px;
}

.wg-module-panel {
    background: var(--wg-surface);
    border: 1px solid var(--wg-border);
    border-radius: 8px;
    box-shadow: var(--wg-shadow);
    padding: 22px;
}

.wg-module-empty {
    min-height: 340px;
    border: 1px dashed rgba(25, 118, 162, .28);
    border-radius: 8px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbfd 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 34px 24px;
    text-align: center;
}

.wg-module-empty-inner {
    max-width: 720px;
}

.wg-module-empty-icon {
    width: 72px;
    height: 72px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--wg-blue) 0%, var(--wg-cyan) 100%);
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 2.1rem;
    margin-bottom: 18px;
}

.wg-module-empty h2 {
    color: var(--wg-blue);
    font-size: 1.35rem;
    font-weight: 850;
    margin: 0 0 10px;
}

.wg-module-empty p {
    color: var(--wg-muted);
    line-height: 1.7;
    margin: 0;
}

.wg-overview-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.wg-overview-card {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-height: 220px;
    padding: 22px;
    color: var(--wg-text);
    text-decoration: none;
    background: var(--wg-surface);
    border: 1px solid var(--wg-border);
    border-radius: 8px;
    box-shadow: 0 14px 32px rgba(7, 27, 47, .06);
    transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}

.wg-overview-card:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 106, 26, .34);
    box-shadow: 0 18px 38px rgba(7, 27, 47, .1);
    color: var(--wg-text);
}

.wg-overview-card-icon {
    width: 52px;
    height: 52px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(25, 118, 162, .1);
    color: var(--wg-cyan);
    font-size: 1.6rem;
}

.wg-overview-card h2 {
    font-size: 1.18rem;
    font-weight: 850;
    margin: 0;
}

.wg-overview-card p {
    color: var(--wg-muted);
    line-height: 1.6;
    margin: 0;
}

.wg-overview-card-action {
    margin-top: auto;
    color: var(--wg-orange);
    font-weight: 800;
}

.wg-data-table-shell {
    overflow-x: auto;
}

.wg-table {
    width: 100%;
    border-collapse: collapse;
}

.wg-table th,
.wg-table td {
    padding: 12px 14px;
    border-bottom: 1px solid rgba(15, 23, 42, .08);
    vertical-align: middle;
}

.wg-table th {
    color: var(--wg-blue);
    font-size: .78rem;
    letter-spacing: .04em;
    text-transform: uppercase;
    background: #f8fafc;
}

.wg-status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 26px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: .78rem;
    font-weight: 800;
    color: #166534;
    background: rgba(22, 163, 74, .12);
    border: 1px solid rgba(22, 163, 74, .22);
}

.wg-status-pill.is-muted {
    color: #475569;
    background: rgba(100, 116, 139, .12);
    border-color: rgba(100, 116, 139, .22);
}

.wg-actions-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.wg-btn {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border: 1px solid rgba(25, 118, 162, .18);
    border-radius: 8px;
    padding: 8px 13px;
    background: var(--wg-surface);
    color: var(--wg-blue);
    font-weight: 800;
    text-decoration: none;
}

.wg-btn:hover {
    color: var(--wg-blue);
    border-color: rgba(255, 106, 26, .32);
}

.wg-btn-primary {
    background: var(--wg-orange);
    border-color: var(--wg-orange);
    color: #ffffff;
}

.wg-btn-primary:hover {
    color: #ffffff;
}

.wg-placeholder-panel {
    min-height: 360px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    border: 1px solid var(--wg-border);
    border-radius: 8px;
    background: #ffffff;
    box-shadow: var(--wg-shadow);
    padding: 28px;
}

.wg-eyebrow {
    color: var(--wg-orange);
    font-weight: 850;
    letter-spacing: .1em;
    text-transform: uppercase;
    margin: 0 0 8px;
}
.wg-legal-panel {
    padding: 26px;
}

.wg-legal-content {
    color: var(--wg-text);
    line-height: 1.75;
}

.wg-legal-content h1,
.wg-legal-content h2,
.wg-legal-content h3 {
    color: var(--wg-blue);
    font-weight: 850;
}

.wg-legal-content h1 {
    font-size: 1.7rem;
}

.wg-legal-content h2 {
    font-size: 1.25rem;
    margin-top: 1.4rem;
}

.wg-legal-content p,
.wg-legal-content li {
    color: var(--wg-muted);
}


/* Existing account pages */
.profiledash-shell {
    width: 100%;
    padding: 0;
}

.profiledash-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(260px, .6fr);
    gap: 22px;
    align-items: stretch;
    margin-bottom: 22px;
    padding: 26px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--wg-blue), var(--wg-cyan));
    color: #ffffff;
    box-shadow: var(--wg-shadow);
    overflow: hidden;
}

.profiledash-hero-main,
.profiledash-hero-content,
.profiledash-hero-copy {
    min-width: 0;
}

.profiledash-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    color: #ffb074;
    font-weight: 850;
}

.profiledash-hero-head {
    display: flex;
    gap: 16px;
    align-items: center;
}

.profiledash-avatar {
    width: 74px;
    height: 74px;
    border-radius: 8px;
    background: rgba(255, 255, 255, .14);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex: 0 0 74px;
}

.profiledash-avatar img {
    width: 58px;
    height: 58px;
    object-fit: contain;
}

.profiledash-hero-title {
    font-size: 1.9rem;
    font-weight: 850;
    letter-spacing: 0;
    margin: 0 0 6px;
}

.profiledash-hero-role,
.profiledash-hero-location,
.profiledash-hero-text {
    color: rgba(255, 255, 255, .82);
}

.profiledash-hero-text {
    max-width: 860px;
    line-height: 1.65;
    margin: 16px 0 0;
}

.profiledash-hero-actions,
.credentials-switch-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

.profiledash-hero-media,
.profiledash-hero-visual,
.profiledash-classic-side-media {
    min-height: 220px;
    border-radius: 8px;
    background: rgba(255, 255, 255, .12);
    overflow: hidden;
}

.profiledash-hero-video,
.profiledash-edit-video {
    width: 100%;
    height: 100%;
    min-height: 220px;
    object-fit: cover;
    display: block;
}

.profiledash-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-top: 20px;
}

.profiledash-summary-card,
.profiledash-classic-info-item {
    min-width: 0;
    border: 1px solid rgba(25, 118, 162, .16);
    border-radius: 8px;
    background: #ffffff;
    padding: 14px;
    color: var(--wg-text);
}

.profiledash-summary-label,
.profiledash-classic-info-label,
.profiledash-info-top {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--wg-muted);
    font-size: .82rem;
    font-weight: 800;
}

.profiledash-summary-value,
.profiledash-classic-info-value {
    margin-top: 8px;
    font-weight: 850;
    overflow-wrap: anywhere;
}

.tab-content-profile-page {
    display: none;
}

.tab-content-profile-page.active {
    display: block;
}

.profiledash-classic-card {
    background: #ffffff;
    border: 1px solid var(--wg-border);
    border-radius: 8px;
    box-shadow: var(--wg-shadow);
    overflow: hidden;
}

.profiledash-classic-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px;
    border-bottom: 1px solid rgba(15, 23, 42, .08);
    background: #f8fafc;
}

.profiledash-classic-card-title {
    color: var(--wg-blue);
    font-size: 1.16rem;
    font-weight: 850;
    margin: 0;
}

.profiledash-classic-card-subtitle {
    color: var(--wg-muted);
    margin: 5px 0 0;
}

.profiledash-classic-card-body {
    padding: 20px;
}

.profiledash-classic-info-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.profiledash-edit-layout {
    display: grid;
    grid-template-columns: minmax(260px, .36fr) minmax(0, .64fr);
    gap: 20px;
    align-items: start;
}

.profiledash-edit-layout--credentials {
    grid-template-columns: minmax(260px, .35fr) minmax(0, .65fr);
}
.profiledash-edit-form-shell {
    min-width: 0;
}

.credentials-switch-btn.is-active,
.tab-link.active {
    box-shadow: 0 0 0 3px rgba(255, 106, 26, .18);
}

.profiledash-classic-card.d-none {
    display: none !important;
}

.profiledash-classic-card.is-active {
    display: block;
}


.profiledash-classic-side {
    background: #ffffff;
    border: 1px solid var(--wg-border);
    border-radius: 8px;
    box-shadow: var(--wg-shadow);
    overflow: hidden;
}

.profiledash-classic-side-copy {
    padding: 18px;
}

.profiledash-classic-side-copy h5 {
    color: var(--wg-blue);
    font-weight: 850;
    margin: 0 0 8px;
}

.profiledash-classic-side-copy p,
.profiledash-classic-point {
    color: var(--wg-muted);
    line-height: 1.6;
}

.profiledash-classic-points {
    display: grid;
    gap: 9px;
    margin-top: 14px;
}

.profiledash-classic-point {
    display: flex;
    gap: 8px;
    align-items: flex-start;
}

.profiledash-classic-point i {
    color: var(--wg-green);
    font-size: 1.1rem;
}

.profiledash-form-wrap .form-label,
.profiledash-classic-card .form-label {
    color: var(--wg-blue);
    font-weight: 800;
}

.profiledash-classic-card .form-control,
.profiledash-classic-card .form-select,
.profiledash-classic-card .select2-selection {
    min-height: 42px;
    border-radius: 8px !important;
    border-color: rgba(15, 23, 42, .14) !important;
}

.input-group-text {
    border-radius: 8px 0 0 8px;
    color: var(--wg-blue);
    background: #f8fafc;
}

.toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 5;
    color: var(--wg-muted);
    cursor: pointer;
}

.btn-primary-theme {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 8px;
    border: 1px solid transparent;
    font-weight: 850;
}

.btn-primary-theme-container,
.btn-primary-theme-whole-round {
    background: var(--wg-orange);
    border-color: var(--wg-orange);
    color: #ffffff;
}

.btn-primary-theme-container-secondary {
    background: #ffffff;
    border-color: rgba(25, 118, 162, .2);
    color: var(--wg-blue);
}

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

.profiledash-delete-account-btn {
    border-radius: 8px;
    font-weight: 850;
}

.status-badge,
.profiledash-email-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 24px;
    padding: 4px 9px;
    border-radius: 999px;
    font-size: .76rem;
    font-weight: 800;
    color: #166534;
    background: rgba(22, 163, 74, .12);
    border: 1px solid rgba(22, 163, 74, .2);
}

.strength-password-box {
    border: 1px solid rgba(15, 23, 42, .1);
    border-radius: 8px;
    background: #f8fafc;
    padding: 14px;
}

.strength-bar {
    height: 8px;
    border-radius: 999px;
    background: #e2e8f0;
    margin-top: 8px;
    overflow: hidden;
}

.strength-bar.weak {
    background: #ef4444;
}

.strength-bar.medium {
    background: #f59e0b;
}

.strength-bar.strong {
    background: #22c55e;
}

.strength-password-requirements {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.strength-password-requirement {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 4px 9px;
    border-radius: 999px;
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, .1);
    color: var(--wg-muted);
    font-size: .8rem;
    font-weight: 700;
}

.strength-password-requirement.valid {
    color: #166534;
    border-color: rgba(22, 163, 74, .26);
    background: rgba(22, 163, 74, .08);
}

.otp-input {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.otp-input input {
    width: 44px;
    height: 44px;
    text-align: center;
    border-radius: 8px;
    border: 1px solid rgba(15, 23, 42, .14);
    font-weight: 850;
}

.required {
    color: var(--wg-red);
}

.invalid-feedback,
.error-message {
    color: var(--wg-red);
}


.profiledash-help-icon {
    color: var(--wg-muted);
    font-size: 1.6rem;
}

.profiledash-country-code-select {
    width: 20%;
}

.profiledash-job-select {
    width: 100%;
}

.qv-delete-account-card {
    margin-top: 16px;
}

.qv-delete-account-label {
    display: block;
    margin-bottom: 8px;
    color: var(--wg-blue);
    font-weight: 800;
}

.qv-delete-account-help {
    margin-top: 10px;
    color: var(--wg-muted);
    font-size: 13px;
    line-height: 1.6;
}

.qv-delete-account-error {
    display: none;
    margin-top: 12px;
    padding: 12px 14px;
    border-radius: 8px;
    background: rgba(220, 53, 69, .08);
    border: 1px solid rgba(220, 53, 69, .18);
    color: #b42318;
    font-size: 14px;
    font-weight: 700;
}

.qv-delete-account-actions {
    margin-top: 18px;
}

.qv-delete-account-submit {
    background: linear-gradient(135deg, #c62828 0%, #e04f4f 100%);
    border-color: #c62828;
    color: #ffffff;
}


/* =========================================================
   WeldGrid Responsive
========================================================= */
@media (max-width: 1199px) {
    .wg-overview-grid,
    .profiledash-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .profiledash-hero,
    .profiledash-edit-layout,
    .profiledash-edit-layout--credentials {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 991px) {
    body.weldgrid-shell .app-wrapper,
    body.weldgrid-shell.sidebar-collapse .app-wrapper {
        grid-template-columns: 1fr;
        grid-template-areas:
            "header"
            "main"
            "footer";
    }

    body.weldgrid-shell .app-sidebar {
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        z-index: 1040;
        transform: translateX(-100%);
        transition: transform .18s ease;
    }

    body.weldgrid-shell.sidebar-open .app-sidebar {
        transform: translateX(0);
    }

    body.weldgrid-shell .app-main {
        padding: 14px;
    }

    body.weldgrid-shell .wg-top-actions .wg-top-action span {
        display: none;
    }

    body.weldgrid-shell .notifications-dropdown-menu {
        min-width: min(340px, calc(100vw - 24px));
        max-width: calc(100vw - 24px);
    }
}

@media (max-width: 767px) {
    .wg-page-header {
        padding: 22px;
    }

    .wg-page-header h1,
    .profiledash-hero-title {
        font-size: 1.6rem;
    }

    .wg-overview-grid,
    .profiledash-summary-grid,
    .profiledash-classic-info-grid {
        grid-template-columns: 1fr;
    }

    .wg-placeholder-panel {
        flex-direction: column;
        align-items: flex-start;
    }

    .profiledash-hero {
        padding: 20px;
    }

    .profiledash-hero-head {
        align-items: flex-start;
    }
}

/* =========================================================
   WeldGrid Sidebar Stability
========================================================= */
body.weldgrid-shell #timeoutCountdownMobile {
    display: none;
}

body.weldgrid-shell .app-sidebar {
    overflow-x: hidden;
}

body.weldgrid-shell.sidebar-collapse .sidebar-menu .nav-link p,
body.weldgrid-shell.sidebar-collapse .sidebar-menu .nav-header,
body.weldgrid-shell.sidebar-collapse .nav-arrow {
    display: none !important;
}

body.weldgrid-shell.sidebar-collapse .session-timeout-message {
    display: none !important;
}

body.weldgrid-shell.sidebar-collapse #timeoutCountdownMobile {
    display: none !important;
}

body.weldgrid-shell.sidebar-collapse .sidebar-menu .nav-link {
    justify-content: center;
}

body.weldgrid-shell.sidebar-collapse .brand-link {
    justify-content: center;
    overflow: hidden;
}

body.weldgrid-shell.sidebar-collapse .brand-link img {
    max-width: 40px;
    object-fit: contain;
}

body.weldgrid-shell.sidebar-collapse .sidebar-wrapper {
    overflow-y: hidden;
}

/* =========================================================
   WeldGrid Users
========================================================= */
.wg-users-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.wg-users-toolbar h2 {
    color: var(--wg-blue);
    font-size: 1.25rem;
    font-weight: 850;
    margin: 0;
}

.wg-users-toolbar p,
.wg-modal-subtitle {
    color: var(--wg-muted);
    margin: 4px 0 0;
}

.wg-users-feedback {
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 14px;
    font-weight: 750;
}

.wg-users-feedback.is-info {
    color: #075985;
    background: rgba(14, 165, 233, .1);
    border: 1px solid rgba(14, 165, 233, .22);
}

.wg-users-feedback.is-success {
    color: #166534;
    background: rgba(22, 163, 74, .1);
    border: 1px solid rgba(22, 163, 74, .22);
}

.wg-users-feedback.is-error {
    color: #991b1b;
    background: rgba(220, 38, 38, .1);
    border: 1px solid rgba(220, 38, 38, .2);
}

.wg-users-table th,
.wg-users-table td {
    white-space: nowrap;
}

.wg-users-table td:nth-child(2),
.wg-users-table td:nth-child(3),
.wg-users-table td:nth-child(9) {
    white-space: normal;
}

.wg-users-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.wg-action-btn {
    min-height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    border: 1px solid rgba(25, 118, 162, .18);
    border-radius: 8px;
    padding: 6px 9px;
    background: #ffffff;
    color: var(--wg-blue);
    font-size: .8rem;
    font-weight: 800;
}

.wg-action-btn:hover {
    border-color: rgba(255, 106, 26, .34);
    color: var(--wg-blue);
}

.wg-action-btn.is-success {
    color: #166534;
    border-color: rgba(22, 163, 74, .24);
    background: rgba(22, 163, 74, .08);
}

.wg-action-btn.is-warning {
    color: #9a3412;
    border-color: rgba(249, 115, 22, .26);
    background: rgba(249, 115, 22, .1);
}

.wg-status-pill.is-active {
    color: #166534;
    background: rgba(22, 163, 74, .12);
    border-color: rgba(22, 163, 74, .22);
}

.wg-status-pill.is-banned,
.wg-status-pill.is-deleted {
    color: #991b1b;
    background: rgba(220, 38, 38, .1);
    border-color: rgba(220, 38, 38, .2);
}

.wg-user-modal .modal-content {
    border: 1px solid var(--wg-border);
    border-radius: 8px;
    box-shadow: var(--wg-shadow);
}

.wg-user-modal .modal-header,
.wg-user-modal .modal-footer {
    border-color: rgba(15, 23, 42, .08);
}

.wg-user-modal .form-label {
    color: var(--wg-blue);
    font-weight: 800;
}

.wg-user-modal .form-control,
.wg-user-modal .form-select {
    min-height: 42px;
    border-radius: 8px;
    border-color: rgba(15, 23, 42, .14);
}

.wg-users-note {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    border: 1px solid rgba(25, 118, 162, .16);
    border-radius: 8px;
    background: #f8fafc;
    color: var(--wg-muted);
    padding: 12px 14px;
    line-height: 1.55;
}

.wg-users-note i {
    color: var(--wg-cyan);
    font-size: 1.1rem;
    margin-top: 2px;
}

@media (max-width: 767px) {
    .wg-users-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .wg-users-toolbar .wg-btn {
        width: 100%;
    }

    .wg-action-btn span {
        display: none;
    }
}
/* =========================================================
   WeldGrid Forms
========================================================= */
.wg-functional-page .form-control,
.wg-functional-page .form-select,
.wg-functional-modal .form-control,
.wg-functional-modal .form-select {
    min-height: 42px;
    border: 1px solid rgba(12, 46, 76, 0.18);
    border-radius: 8px;
    background-color: #fbfdff;
    color: #08233e;
    box-shadow: none;
    transition: border-color .16s ease, box-shadow .16s ease, background-color .16s ease;
}

.wg-functional-page .form-control:focus,
.wg-functional-page .form-select:focus,
.wg-functional-modal .form-control:focus,
.wg-functional-modal .form-select:focus {
    border-color: #ff6a1a;
    background-color: #fff;
    box-shadow: 0 0 0 3px rgba(255, 106, 26, 0.16);
}

.wg-form-note {
    color: #5c7189;
    font-size: 12px;
    line-height: 1.35;
}

.wg-check-row label,
.wg-toggle-line {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #17324d;
    font-weight: 700;
}

.wg-check-row input[type="checkbox"],
.wg-toggle-line input[type="checkbox"] {
    appearance: none;
    width: 18px;
    height: 18px;
    border: 1px solid rgba(12, 46, 76, 0.28);
    border-radius: 5px;
    background: #fff;
    display: grid;
    place-items: center;
    cursor: pointer;
}

.wg-check-row input[type="checkbox"]:checked,
.wg-toggle-line input[type="checkbox"]:checked {
    border-color: #ff6a1a;
    background: #ff6a1a;
}

.wg-check-row input[type="checkbox"]:checked::after,
.wg-toggle-line input[type="checkbox"]:checked::after {
    content: "";
    width: 9px;
    height: 5px;
    border-left: 2px solid #fff;
    border-bottom: 2px solid #fff;
    transform: rotate(-45deg);
    margin-top: -2px;
}

/* =========================================================
   WeldGrid Tables
========================================================= */
.wg-table-tools {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border-top: 1px solid rgba(12, 46, 76, 0.08);
    border-bottom: 1px solid rgba(12, 46, 76, 0.08);
    background: #f8fbfd;
}

.wg-search-box {
    min-width: min(520px, 100%);
    display: flex;
    align-items: center;
    gap: 9px;
    border: 1px solid rgba(12, 46, 76, 0.16);
    border-radius: 8px;
    padding: 0 12px;
    background: #fff;
    color: #658098;
}

.wg-search-box input {
    width: 100%;
    min-height: 40px;
    border: 0;
    outline: 0;
    background: transparent;
    color: #08233e;
}

.wg-table-count,
.wg-table-subtext {
    color: #60758a;
    font-size: 12px;
    font-weight: 700;
}

.wg-table-subtext {
    display: block;
    margin-top: 2px;
}

.wg-empty-cell {
    color: #60758a;
    text-align: center;
    padding: 28px 18px !important;
    background: #fbfdff;
}

/* =========================================================
   WeldGrid Project Page
========================================================= */
.wg-projects-page .wg-table td {
    vertical-align: middle;
}

.wg-projects-page .wg-row-actions {
    justify-content: flex-start;
}


.wg-btn-archive {
    border-color: rgba(12, 46, 76, .18);
    background: #f8fbfd;
    color: #17324d;
}

.wg-btn-archive:hover {
    border-color: rgba(25, 118, 162, .36);
    background: #eef6fb;
    color: #0f5f82;
}

.wg-archive-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 7px;
    border-radius: 999px;
    background: #17324d;
    color: #ffffff;
    font-size: .76rem;
    font-weight: 900;
    line-height: 1;
}

.wg-archive-modal .modal-dialog {
    max-width: min(1180px, calc(100vw - 32px));
}

.wg-archive-modal .modal-body {
    background: #f8fbfd;
}

.wg-archive-table-wrap {
    border: 1px solid rgba(12, 46, 76, .1);
    border-radius: 8px;
    background: #ffffff;
}

.wg-archive-table {
    min-width: 1020px;
}

.wg-icon-btn.wg-restore {
    color: #047857;
}

.wg-icon-btn.wg-restore:hover {
    border-color: rgba(4, 120, 87, .35);
    background: #ecfdf5;
    color: #047857;
}

.wg-status-draft {
    background: rgba(96, 117, 138, .13);
    color: #475569;
}

.wg-status-on_hold {
    background: rgba(201, 130, 22, .14);
    color: #8d5d0f;
}

.wg-status-completed {
    background: rgba(25, 118, 162, .13);
    color: #0f5f82;
}

body.weldgrid-shell .swal2-container {
    z-index: 30060 !important;
}

body.weldgrid-shell .swal2-popup {
    border-radius: 8px;
}

/* =========================================================
   WeldGrid PDF Viewer Layout
========================================================= */
.wg-mode-pill,
.wg-extraction-status,
.wg-page-source {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 34px;
    padding: 6px 10px;
    border: 1px solid rgba(12, 46, 76, 0.16);
    border-radius: 999px;
    background: #f8fbfd;
    color: #17324d;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

.wg-mode-pill[data-mode="annotation"] {
    border-color: rgba(255, 106, 26, .4);
    background: rgba(255, 106, 26, .12);
    color: #b84b0f;
}

.wg-extraction-status[data-state="processing"] {
    border-color: rgba(24, 126, 184, .35);
    background: rgba(24, 126, 184, .12);
    color: #0d5d8d;
}

.wg-extraction-status[data-state="done"] {
    border-color: rgba(42, 143, 91, .32);
    background: rgba(42, 143, 91, .12);
    color: #1d7047;
}

.wg-extraction-status[data-state="warning"],
.wg-extraction-status[data-state="partial_failed"] {
    border-color: rgba(201, 130, 22, .35);
    background: rgba(201, 130, 22, .12);
    color: #8d5d0f;
}

.wg-extraction-status[data-state="failed"] {
    border-color: rgba(201, 45, 45, .35);
    background: rgba(201, 45, 45, .12);
    color: #a52323;
}

.wg-pdf-canvas-shell.wg-pan-enabled {
    cursor: grab;
}

.wg-pdf-canvas-shell.wg-pan-enabled.is-panning {
    cursor: grabbing;
    user-select: none;
}

.wg-pdf-canvas-shell.wg-annotation-enabled {
    cursor: crosshair;
}

/* =========================================================
   WeldGrid BOM Workspace
========================================================= */
.wg-bom-status-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    justify-content: space-between;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid rgba(12, 46, 76, 0.08);
}

.wg-bom-table-wrap {
    max-height: 64vh;
    overflow: auto;
}

.wg-bom-table th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #f3f7fa;
}

.wg-helper-info {
    border-color: rgba(24, 126, 184, 0.28);
    background: #eff8ff;
    color: #0a3557;
}

.wg-bom-worker-note {
    margin-top: 14px;
}

.wg-cell-input {
    width: 100%;
    min-width: 130px;
    min-height: 36px;
    border: 1px solid rgba(12, 46, 76, 0.14);
    border-radius: 7px;
    background: #fff;
    color: #08233e;
    padding: 7px 10px;
    font-weight: 600;
    transition: border-color .16s ease, box-shadow .16s ease, background-color .16s ease;
}

.wg-cell-input:focus {
    border-color: #ff6a1a;
    box-shadow: 0 0 0 3px rgba(255, 106, 26, .13);
    outline: 0;
}

.wg-cell-input.saving {
    border-color: #187eb8;
    background: #f0f8ff;
}

.wg-cell-input.saved {
    border-color: #2a8f5b;
    background: #f2fbf6;
}

.wg-cell-input.error {
    border-color: #c92d2d;
    background: #fff5f5;
}

.wg-raw-text-modal {
    max-height: 68vh;
    overflow: auto;
    margin: 0;
    padding: 14px;
    border-radius: 8px;
    border: 1px solid rgba(12, 46, 76, 0.12);
    background: #071d31;
    color: #eaf4ff;
    white-space: pre-wrap;
}

/* =========================================================
   WeldGrid Sidebar / Shell Stability Fixes
========================================================= */
.main-sidebar,
.sidebar {
    overflow-x: hidden;
}

.sidebar .nav-link,
.main-sidebar .brand-link,
.wg-sidebar-link {
    min-width: 0;
}

.sidebar .nav-link p,
.main-sidebar .brand-text,
.wg-sidebar-link span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

body:not(.sidebar-collapse) .main-sidebar {
    width: 250px;
}

body.sidebar-collapse .main-sidebar,
body.sidebar-collapse .main-sidebar::before {
    overflow-x: hidden;
}

.content-wrapper,
.wg-page-shell {
    min-width: 0;
    overflow-x: clip;
}

.main-footer {
    white-space: normal;
}

/* =========================================================
   WeldGrid BOM KPIs / Filters / Bulk Edit
========================================================= */
.wg-bom-secondary-actions {
    margin-top: 12px;
    align-items: center;
}

.wg-bom-kpi-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(130px, 1fr));
    gap: 10px;
    margin: 14px 0;
}

.wg-bom-kpi {
    min-height: 72px;
    border: 1px solid rgba(12, 46, 76, .12);
    border-radius: 8px;
    background: #fff;
    padding: 12px 14px;
    box-shadow: 0 8px 18px rgba(6, 29, 50, .05);
}

.wg-bom-kpi span {
    display: block;
    color: #60758a;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}

.wg-bom-kpi strong {
    display: block;
    margin-top: 6px;
    color: #08233e;
    font-size: 18px;
    line-height: 1.15;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wg-bom-filter-panel,
.wg-bom-bulk-panel {
    display: grid;
    gap: 10px;
    align-items: center;
    margin: 12px 0;
}

.wg-bom-filter-panel {
    grid-template-columns: minmax(240px, 1.4fr) repeat(3, minmax(180px, .8fr));
}

.wg-bom-bulk-panel {
    grid-template-columns: minmax(190px, auto) minmax(190px, .8fr) minmax(180px, 1fr) auto minmax(110px, auto);
    padding: 12px;
    border: 1px solid rgba(12, 46, 76, .10);
    border-radius: 8px;
    background: #f8fbfd;
}

.wg-checkline {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: #17324d;
    font-size: 13px;
    font-weight: 800;
    margin: 0;
}

.wg-checkline input,
.wg-row-select {
    width: 18px;
    height: 18px;
    appearance: none;
    border: 1px solid rgba(12, 46, 76, .28);
    border-radius: 5px;
    background: #fff;
    display: inline-grid;
    place-content: center;
    cursor: pointer;
}

.wg-checkline input:checked,
.wg-row-select:checked {
    border-color: #ff6a1a;
    background: #ff6a1a;
}

.wg-checkline input:checked::after,
.wg-row-select:checked::after {
    content: "";
    width: 9px;
    height: 5px;
    border-left: 2px solid #fff;
    border-bottom: 2px solid #fff;
    transform: rotate(-45deg);
    margin-bottom: 2px;
}

.wg-bulk-count {
    color: #60758a;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

.wg-bom-table .wg-select-col {
    width: 42px;
    min-width: 42px;
    text-align: center;
}

.wg-bom-table th,
.wg-bom-table td {
    white-space: nowrap;
}

.wg-bom-table .wg-cell-input {
    min-width: 118px;
    max-width: 210px;
}

.wg-bom-table-wrap {
    border: 1px solid rgba(12, 46, 76, .08);
    border-radius: 8px;
}

/* =========================================================
   WeldGrid User Modals
========================================================= */
.wg-user-modal .modal-content {
    border: 1px solid rgba(12, 46, 76, .18);
    border-radius: 8px;
    overflow: hidden;
    background: #edf5fa;
}

.wg-user-modal .modal-header {
    align-items: flex-start;
    border-bottom: 1px solid rgba(12, 46, 76, .10);
    background: #edf5fa;
    padding: 18px 20px;
}

.wg-user-modal .modal-title {
    color: #08233e;
    font-size: 24px;
    font-weight: 900;
    letter-spacing: 0;
}

.wg-user-modal .wg-modal-subtitle {
    margin: 5px 0 0;
    color: #64798e;
    font-weight: 700;
}

.wg-user-modal .modal-body {
    padding: 20px;
}

.wg-user-modal .form-label {
    color: #08233e;
    font-weight: 900;
    margin-bottom: 7px;
}

.wg-user-modal .form-control,
.wg-user-modal .form-select {
    min-height: 50px;
    border: 1px solid rgba(12, 46, 76, .20);
    border-radius: 8px;
    background-color: #fff;
    color: #102b46;
    font-weight: 700;
}

.wg-user-modal .form-control:disabled,
.wg-user-modal .form-control[readonly],
.wg-user-modal .form-select:disabled {
    background-color: #f6fafc;
    color: #334d66;
    opacity: 1;
    -webkit-text-fill-color: #334d66;
}

.wg-user-modal .form-control::placeholder {
    color: #7f91a3;
    opacity: 1;
}

/* =========================================================
   WeldGrid BOM UI Cleanup
========================================================= */
.wg-bom-page .wg-page-header { margin-bottom: 14px; }
.wg-bom-page .wg-page-header p { max-width: 760px; }
.wg-bom-controls { padding: 16px; }
.wg-bom-selector-row .form-label { margin-bottom: 4px; color: #17324d; font-size: 12px; font-weight: 900; }
.wg-bom-selector-row .form-select { min-height: 40px; font-size: 13px; font-weight: 700; }
.wg-bom-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.wg-bom-actions .wg-btn { min-height: 38px; padding: 8px 12px; font-size: 13px; }
.wg-bom-advanced-actions { display: inline-flex; }
.wg-bom-advanced-actions .dropdown-menu { border: 1px solid rgba(12, 46, 76, .14); border-radius: 8px; box-shadow: 0 16px 36px rgba(6, 29, 50, .14); }
.wg-bom-advanced-actions .dropdown-item { display: flex; align-items: center; gap: 8px; color: #17324d; font-size: 13px; font-weight: 800; }
.wg-danger-text { color: #b42318 !important; }
.wg-bom-export-helper { margin-top: 6px; color: #60758a; font-size: 12px; font-weight: 700; }
.wg-bom-info-note { margin-top: 10px; padding: 9px 11px; border-radius: 8px; font-size: 13px; line-height: 1.35; }
.wg-bom-page .wg-helper-info { border-color: rgba(24, 126, 184, .18); background: #f5fbff; }
.wg-bom-status-row { margin-top: 10px; padding-top: 10px; gap: 8px; font-size: 12px; }
.wg-bom-kpi-grid { grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); gap: 8px; margin: 12px 0; }
.wg-bom-kpi { min-height: 58px; padding: 9px 11px; border-radius: 7px; box-shadow: none; }
.wg-bom-kpi span { font-size: 10px; letter-spacing: 0; }
.wg-bom-kpi strong { margin-top: 4px; font-size: 16px; }
.wg-bom-page .wg-card-head { gap: 12px; align-items: center; }
.wg-bom-page .wg-card-head h2 { font-size: 18px; }
.wg-bom-page .wg-card-head p { margin: 3px 0 0; font-size: 12px; }
.wg-bom-table-tools { display: grid; gap: 8px; margin: 10px 0; }
.wg-bom-filter-panel { grid-template-columns: minmax(220px, 1.25fr) repeat(3, minmax(150px, .75fr)); gap: 8px; margin: 0; }
.wg-bom-filter-panel .form-select { min-height: 38px; font-size: 13px; font-weight: 700; }
.wg-bom-filter-panel .wg-search-box { min-height: 38px; border-radius: 7px; }
.wg-bom-filter-panel .wg-search-box input { min-height: 36px; font-size: 13px; }
.wg-bom-bulk-panel { grid-template-columns: minmax(175px, auto) minmax(170px, .7fr) minmax(160px, 1fr) auto minmax(92px, auto); gap: 8px; margin: 0; padding: 8px; border-radius: 7px; background: #f8fbfd; }
.wg-bom-bulk-panel .form-select, .wg-bom-bulk-panel .form-control { min-height: 38px; font-size: 13px; font-weight: 700; }
.wg-bom-bulk-panel .wg-btn { min-height: 38px; padding: 8px 12px; font-size: 13px; }
.wg-checkline { font-size: 12px; }
.wg-bulk-count { justify-self: end; font-size: 12px; }
.wg-bom-table-wrap { max-height: 58vh; border-radius: 7px; }
.wg-bom-table th { background: #f6f9fc; color: #17324d; font-size: 11px; letter-spacing: 0; text-transform: none; }
.wg-bom-table th, .wg-bom-table td { padding: 7px 8px; vertical-align: middle; }
.wg-bom-table .wg-cell-input { min-width: 112px; max-width: 220px; min-height: 32px; padding: 5px 8px; border-radius: 6px; font-size: 12px; font-weight: 700; }
.wg-bom-table .wg-select-col { width: 36px; min-width: 36px; }
.wg-bom-help-modal .modal-content { border: 1px solid rgba(12, 46, 76, .18); border-radius: 8px; overflow: hidden; }
.wg-bom-help-modal .modal-header { align-items: flex-start; background: #f6f9fc; border-bottom: 1px solid rgba(12, 46, 76, .10); }
.wg-bom-help-list { display: grid; gap: 10px; }
.wg-bom-help-list section { padding: 10px 12px; border: 1px solid rgba(12, 46, 76, .10); border-radius: 7px; background: #fff; }
.wg-bom-help-list h6 { margin: 0 0 4px; color: #08233e; font-size: 13px; font-weight: 900; }
.wg-bom-help-list p { margin: 0; color: #334d66; font-size: 13px; line-height: 1.45; }
.wg-bom-help-warning { border-color: rgba(180, 35, 24, .24) !important; background: #fff8f6 !important; }

.wg-user-modal .modal-footer {
    gap: 8px;
    justify-content: flex-end;
    border-top: 1px solid rgba(12, 46, 76, .10);
    background: #edf5fa;
    padding: 16px 20px;
}

@media (max-width: 768px) {
    .wg-table-tools {
        align-items: stretch;
        flex-direction: column;
    }

    .wg-search-box {
        min-width: 100%;
    }

    .wg-mode-pill,
    .wg-extraction-status,
    .wg-page-source {
        width: 100%;
        justify-content: center;
        white-space: normal;
    }

    .wg-bom-kpi-grid,
    .wg-bom-filter-panel,
    .wg-bom-bulk-panel {
        grid-template-columns: 1fr;
    }
}

/* =========================================================
   WeldGrid Sidebar Final Override
========================================================= */

body.weldgrid-shell .app-wrapper { --wg-active-sidebar-width: var(--wg-sidebar-width); background: linear-gradient(90deg, var(--wg-navy) 0 var(--wg-active-sidebar-width), var(--wg-bg) var(--wg-active-sidebar-width) 100%) !important; }
body.weldgrid-shell.sidebar-collapse .app-wrapper { --wg-active-sidebar-width: var(--wg-sidebar-collapsed-width); }
body.weldgrid-shell .app-header { margin-left: 0 !important; grid-area: header; }
body.weldgrid-shell .app-main { margin-left: 0 !important; grid-area: main; min-width: 0; overflow-x: hidden; }
body.weldgrid-shell .app-footer { margin-left: 0 !important; grid-area: footer; }
body.weldgrid-shell .app-sidebar { grid-area: sidebar; align-self: stretch !important; min-height: 100% !important; height: auto !important; position: relative !important; top: auto !important; left: auto !important; bottom: auto !important; background: linear-gradient(180deg, var(--wg-navy) 0%, var(--wg-blue) 100%) !important; overflow: visible !important; }
body.weldgrid-shell .sidebar-brand { position: sticky; top: 0; z-index: 5; min-height: 78px !important; height: 78px !important; background: linear-gradient(180deg, var(--wg-navy) 0%, var(--wg-blue) 100%) !important; }
body.weldgrid-shell .sidebar-menu .nav-link { min-width: 0; }
body.weldgrid-shell .sidebar-menu .nav-link p { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
body.weldgrid-shell.sidebar-collapse .sidebar-menu .nav-link p, body.weldgrid-shell.sidebar-collapse .sidebar-menu .nav-header, body.weldgrid-shell.sidebar-collapse .session-timeout-message, body.weldgrid-shell.sidebar-collapse .nav-arrow, body.weldgrid-shell.sidebar-collapse #timeoutCountdownMobile, body.weldgrid-shell.sidebar-collapse .nav-treeview { display: none !important; }
body.weldgrid-shell.sidebar-collapse .sidebar-menu .nav-link { justify-content: center !important; width: 48px !important; margin-left: auto !important; margin-right: auto !important; padding-left: 0 !important; padding-right: 0 !important; }
body.weldgrid-shell.sidebar-collapse .brand-link { justify-content: center !important; width: 48px !important; min-width: 48px !important; max-width: 48px !important; overflow: hidden !important; }
body.weldgrid-shell.sidebar-collapse .brand-link img { max-width: 38px !important; max-height: 38px !important; object-fit: contain !important; }

/* =========================================================
   WeldGrid Sidebar No Internal Scroll
========================================================= */

body.weldgrid-shell .app-sidebar { align-self: stretch !important; min-height: 100% !important; height: auto !important; overflow: visible !important; }

body.weldgrid-shell .sidebar-wrapper { height: auto !important; max-height: none !important; overflow-y: visible !important; overflow-x: hidden !important; padding-bottom: 28px !important; }

body.weldgrid-shell .sidebar-brand { position: relative !important; top: auto !important; }

/* =========================================================
   WeldGrid Sidebar Fixed Regions
========================================================= */
body.weldgrid-shell .app-sidebar {
    position: sticky !important;
    top: 0 !important;
    bottom: auto !important;
    align-self: start !important;
    min-height: 100dvh !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
}

body.weldgrid-shell .sidebar-brand,
body.weldgrid-shell .sidebar-fixed-top,
body.weldgrid-shell .sidebar-fixed-bottom {
    flex: 0 0 auto !important;
}

body.weldgrid-shell .sidebar-wrapper {
    display: flex !important;
    flex: 1 1 auto !important;
    flex-direction: column !important;
    min-height: 0 !important;
    height: auto !important;
    max-height: none !important;
    padding: 8px !important;
    overflow: hidden !important;
}

body.weldgrid-shell .sidebar-menu-scroll,
body.weldgrid-shell.sidebar-collapse .sidebar-menu-scroll {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    margin-top: 0 !important;
    padding-right: 3px;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,.24) transparent;
}

body.weldgrid-shell .sidebar-menu-scroll::-webkit-scrollbar {
    width: 6px;
}

body.weldgrid-shell .sidebar-menu-scroll::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,.24);
    border-radius: 999px;
}

body.weldgrid-shell .sidebar-menu-scroll::-webkit-scrollbar-track {
    background: transparent;
}

body.weldgrid-shell .sidebar-fixed-bottom {
    padding-top: 8px;
    border-top: 1px solid rgba(255,255,255,.12);
}

@media (max-width: 991px) {
    body.weldgrid-shell .app-sidebar {
        position: fixed !important;
        top: 0 !important;
        bottom: 0 !important;
        left: 0 !important;
        z-index: 1040;
        transform: translateX(-100%);
    }

    body.weldgrid-shell.sidebar-open .app-sidebar {
        transform: translateX(0);
    }
}

/* =========================================================
   WeldGrid BOM Compact Header
========================================================= */
.wg-bom-control-panel { display: grid; gap: 10px; padding: 12px 14px; overflow: visible; }
.wg-bom-select-grid { display: grid !important; grid-template-columns: minmax(180px, 1.05fr) minmax(240px, 1.2fr) minmax(150px, .72fr) minmax(120px, .66fr) minmax(170px, .82fr); gap: 10px; align-items: end; margin-left: 0 !important; margin-right: 0 !important; }
.wg-bom-select-grid > [class*="col-"] { width: auto !important; max-width: none !important; flex: none !important; padding-left: 0 !important; padding-right: 0 !important; }
.wg-bom-select-grid .form-label { margin-bottom: 4px; font-size: 12px; line-height: 1.2; }
.wg-bom-select-grid .form-select { min-height: 38px; padding-top: 7px; padding-bottom: 7px; font-size: 13px; }
.wg-bom-action-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-width: 0; }
.wg-bom-action-left { display: flex; align-items: center; gap: 8px; flex: 1 1 auto; flex-wrap: wrap; min-width: 0; margin-top: 0 !important; }
.wg-bom-action-left .wg-btn { min-height: 36px; padding: 7px 11px; border-radius: 7px; font-size: 13px; line-height: 1.2; }
.wg-bom-action-right { display: flex; align-items: center; justify-content: flex-end; gap: 6px; flex: 0 1 420px; min-width: 0; margin-left: auto; }
.wg-bom-current-context { display: block; min-width: 0; max-width: 310px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #60758a; font-size: 11px; font-weight: 800; text-align: right; }
.wg-bom-current-status { display: inline-flex; align-items: center; min-height: 24px; padding: 3px 8px; border: 1px solid rgba(12, 46, 76, .12); border-radius: 999px; background: #f8fbfd; color: #17324d; font-size: 11px; font-weight: 900; white-space: nowrap; }
.wg-bom-current-status[data-state="processing"] { border-color: rgba(24, 126, 184, .28); background: rgba(24, 126, 184, .09); color: #0d5d8d; }
.wg-bom-current-status[data-state="done"] { border-color: rgba(42, 143, 91, .25); background: rgba(42, 143, 91, .09); color: #1d7047; }
.wg-bom-current-status[data-state="warning"], .wg-bom-current-status[data-state="partial_failed"] { border-color: rgba(201, 130, 22, .28); background: rgba(201, 130, 22, .09); color: #8d5d0f; }
.wg-bom-current-status[data-state="failed"] { border-color: rgba(201, 45, 45, .28); background: rgba(201, 45, 45, .09); color: #a52323; }
.wg-bom-info-line { align-items: center; gap: 8px; margin-top: 0; padding: 7px 10px; border-radius: 7px; font-size: 12px; line-height: 1.3; }
.wg-bom-info-line i { font-size: 15px; margin-top: 0; }
.wg-bom-export-helper { display: none !important; }
.wg-bom-kpi-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; margin: 10px 0 12px; }
.wg-bom-kpi-card { min-height: 52px; padding: 8px 10px; border-radius: 7px; box-shadow: none; }
.wg-bom-kpi-card span { font-size: 10px; letter-spacing: 0; text-transform: none; }
.wg-bom-kpi-card strong { margin-top: 3px; font-size: 15px; line-height: 1.15; }
@media (max-width: 1180px) { .wg-bom-select-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 1180px) { .wg-bom-action-row { align-items: flex-start; flex-direction: column; } }
@media (max-width: 1180px) { .wg-bom-action-right { width: 100%; flex-basis: auto; justify-content: flex-start; margin-left: 0; } }
@media (max-width: 1180px) { .wg-bom-current-context { max-width: min(100%, 520px); text-align: left; } }
@media (max-width: 900px) { .wg-bom-kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 768px) { .wg-bom-select-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 768px) { .wg-bom-action-left { width: 100%; } }
@media (max-width: 768px) { .wg-bom-action-left .wg-btn, .wg-bom-action-left .dropdown { flex: 1 1 180px; } }
@media (max-width: 768px) { .wg-bom-action-left .dropdown .wg-btn { width: 100%; } }
@media (max-width: 560px) { .wg-bom-select-grid, .wg-bom-kpi-grid { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .wg-bom-action-right { align-items: flex-start; flex-direction: column; } }
@media (max-width: 560px) { .wg-bom-current-context { max-width: 100%; } }

/* =========================================================
   WeldGrid BOM Exact Excel Import
========================================================= */
.wg-bom-table th { white-space: nowrap; }
.wg-bom-table td { background-clip: padding-box; }
.wg-bom-table .wg-cell-input { width: 100%; }
.wg-bom-info-line { margin-top: 0; }

/* =========================================================
   WeldGrid BOM Clear Button
========================================================= */
.wg-btn-danger-solid { border-color: #dc2626; background: #dc2626; color: #ffffff; }
.wg-btn-danger-solid:hover, .wg-btn-danger-solid:focus { border-color: #b91c1c; background: #b91c1c; color: #ffffff; }
.wg-btn-danger-solid i { color: inherit; }

/* =========================================================
   WeldGrid PDF Annotation Layer
========================================================= */
.wg-annotation-toolbar { grid-template-columns: minmax(220px, 1fr) repeat(8, auto); align-items: center; gap: 8px; }
.wg-pdf-version-context { margin-top: 3px; color: #ffffff !important; font-size: 12px !important; font-weight: 900; }
.wg-pdf-canvas-shell.wg-annotation-mode-active { cursor: crosshair; }
.wg-pdf-canvas-shell.wg-annotation-mode-active #wgPdfCanvas { cursor: crosshair; }
.wg-annotation-layer { z-index: 3; pointer-events: auto; }
.wg-annotation-svg { position: absolute; inset: 0; overflow: visible; pointer-events: none; }
.wg-annotation-svg marker path { fill: #ff4f0f; }
.wg-annotation-arrow { stroke: #ff4f0f; stroke-width: 2.4; stroke-linecap: round; filter: drop-shadow(0 1px 1px rgba(7, 27, 47, .25)); }
.wg-annotation-arrow.wg-annotation-selected { stroke: #00a6d6; stroke-width: 3.2; }
.wg-annotation-label { position: absolute; transform: translate(-8px, -50%); min-width: 42px; min-height: 24px; padding: 3px 8px; border: 1px solid rgba(115, 34, 0, .35); border-radius: 4px; background: #ff6a1a; color: #fff; font-size: 12px; font-weight: 950; line-height: 1; letter-spacing: 0; box-shadow: 0 5px 14px rgba(7, 27, 47, .22); cursor: grab; user-select: none; }
.wg-annotation-label:hover { background: #e9550d; }
.wg-annotation-label:active { cursor: grabbing; }
.wg-annotation-label.is-red-marked { background: #d93025; border-color: rgba(140, 20, 12, .42); }
.wg-annotation-point { position: absolute; width: 10px; height: 10px; padding: 0; border: 2px solid #fff; border-radius: 50%; background: #d93025; box-shadow: 0 0 0 2px #ff6a1a, 0 2px 7px rgba(7, 27, 47, .28); transform: translate(-50%, -50%); cursor: pointer; }
.wg-annotation-point:hover { box-shadow: 0 0 0 3px #00a6d6, 0 2px 7px rgba(7, 27, 47, .32); }
.wg-annotation-ghost { opacity: .45; pointer-events: none; }
.wg-annotation-selected { outline: 2px solid #00a6d6; outline-offset: 2px; }
.wg-annotation-list-panel { min-height: 0; }
.wg-annotation-list-tools { display: grid; grid-template-columns: 1fr; gap: 8px; margin-bottom: 10px; }
.wg-annotation-list-tools .form-control, .wg-annotation-list-tools .form-select { min-height: 34px; font-size: 12px; font-weight: 800; }
.wg-toggle-compact { justify-content: flex-start; font-size: 12px; }
.wg-annotation-list { gap: 8px; overflow: auto; padding-right: 2px; }
.wg-annotation-list-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; width: 100%; padding: 8px; border: 1px solid rgba(12, 46, 76, .12); border-radius: 7px; background: #fff; }
.wg-annotation-list-item:hover { border-color: rgba(255, 106, 26, .42); background: #fff9f4; }
.wg-annotation-list-item.active { border-color: #00a6d6; background: #f0fbff; }
.wg-annotation-list-main { display: grid; gap: 2px; min-width: 0; padding: 0; border: 0; background: transparent; text-align: left; }
.wg-annotation-list-main strong { color: #08233e; font-size: 13px; font-weight: 950; }
.wg-annotation-list-main span, .wg-annotation-list-main small { min-width: 0; overflow: hidden; color: #60758a; font-size: 11px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.wg-annotation-list-actions { display: flex; align-items: center; gap: 4px; }
.wg-annotation-list-actions button { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border: 1px solid rgba(12, 46, 76, .12); border-radius: 6px; background: #f8fbfd; color: #17324d; }
.wg-annotation-list-actions button:hover { border-color: rgba(255, 106, 26, .42); background: #fff3ea; color: #c2460c; }
.wg-annotation-modal .modal-content { border: 1px solid rgba(12, 46, 76, .18); border-radius: 8px; overflow: hidden; }
.wg-annotation-modal .modal-header { align-items: flex-start; background: linear-gradient(135deg, #08233e, #17607d); color: #fff; }
.wg-annotation-modal .form-label { margin-bottom: 5px; color: #17324d; font-size: 12px; font-weight: 900; }
.wg-annotation-modal .form-control, .wg-annotation-modal .form-select { min-height: 38px; border-radius: 7px; font-size: 13px; font-weight: 750; }
.wg-segmented-control { display: inline-grid; grid-template-columns: repeat(2, minmax(48px, 1fr)); width: 100%; min-height: 38px; overflow: hidden; border: 1px solid rgba(12, 46, 76, .16); border-radius: 7px; background: #f8fbfd; }
.wg-segmented-control button { border: 0; background: transparent; color: #17324d; font-size: 13px; font-weight: 950; }
.wg-segmented-control button.active { background: #ff6a1a; color: #fff; }
.wg-bom-link-picker { min-height: 116px; }
.wg-annotation-tooltip { position: fixed; z-index: 1200; display: grid; gap: 4px; max-width: 320px; padding: 9px 10px; border: 1px solid rgba(12, 46, 76, .18); border-radius: 7px; background: #08233e; color: #fff; box-shadow: 0 10px 28px rgba(7, 27, 47, .24); pointer-events: none; }
.wg-annotation-tooltip[hidden] { display: none; }
.wg-annotation-tooltip strong { font-size: 13px; font-weight: 950; }
.wg-annotation-tooltip span, .wg-annotation-tooltip div { font-size: 11px; line-height: 1.35; }
.wg-annotation-tooltip-bom { display: grid; gap: 3px; margin-top: 3px; padding-top: 5px; border-top: 1px solid rgba(255, 255, 255, .18); color: rgba(255, 255, 255, .82); }
@media (max-width: 1180px) { .wg-annotation-toolbar { grid-template-columns: minmax(180px, 1fr) repeat(4, auto); } }
@media (max-width: 1180px) { .wg-pdf-layout { grid-template-columns: 240px minmax(0, 1fr); } }
@media (max-width: 1180px) { .wg-pdf-right { grid-column: 1 / -1; } }
@media (max-width: 900px) { .wg-annotation-toolbar { display: flex; flex-wrap: wrap; } }
@media (max-width: 900px) { .wg-annotation-toolbar .form-select { flex: 1 1 240px; } }
@media (max-width: 900px) { .wg-pdf-layout { grid-template-columns: 1fr; } }
@media (max-width: 640px) { .wg-annotation-list-item { grid-template-columns: 1fr; } }
@media (max-width: 640px) { .wg-annotation-list-actions { justify-content: flex-start; } }

/* =========================================================
   WeldGrid Annotation Mode
========================================================= */
.wg-annotation-mode-trigger { border-color: rgba(255, 106, 26, .34); background: #fff8f1; color: #b8460d; }
.wg-annotation-mode-trigger:hover, .wg-annotation-mode-trigger:focus { border-color: #ff6a1a; background: #fff0e5; color: #9f3908; }
.wg-annotation-mode-trigger.active { border-color: #ff6a1a; background: #ff6a1a; color: #ffffff; box-shadow: 0 8px 20px rgba(255, 106, 26, .24); }
.wg-annotation-mode-trigger[hidden] { display: none !important; }
.wg-annotation-placement-hint { position: absolute; top: 10px; left: 10px; z-index: 7; display: inline-flex; align-items: center; gap: 7px; width: max-content; max-width: calc(100% - 20px); padding: 7px 10px; border: 1px solid rgba(255, 106, 26, .36); border-radius: 7px; background: rgba(255, 248, 241, .96); color: #9f3908; font-size: 12px; font-weight: 900; box-shadow: 0 8px 18px rgba(7, 27, 47, .1); pointer-events: none; }
.wg-annotation-placement-hint[hidden] { display: none !important; }
.wg-pdf-canvas-shell.wg-annotation-mode-active { cursor: crosshair; }
.wg-pdf-canvas-shell.wg-annotation-mode-active .wg-annotation-layer, .wg-pdf-canvas-shell.wg-annotation-mode-active #wgPdfCanvas { cursor: crosshair; }
.wg-pdf-canvas-shell.wg-annotation-mode-active.is-panning { cursor: crosshair; }

/* =========================================================
   WeldGrid Annotation Preview
========================================================= */
.wg-annotation-ghost { opacity: .45; pointer-events: none; }
.wg-annotation-ghost-arrow { stroke: #f04418; stroke-width: 1.8; filter: none; }
.wg-annotation-ghost-point { width: 9px; height: 9px; background: #f04418; box-shadow: 0 0 0 2px rgba(255, 255, 255, .95), 0 0 0 4px rgba(240, 68, 24, .24); }
.wg-annotation-ghost-label { min-width: 42px; border-color: rgba(240, 68, 24, .68); background: #ff6a1a; color: #ffffff; box-shadow: 0 4px 12px rgba(7, 27, 47, .14); }
.wg-compare-canvas-shell { position: relative; }
.wg-compare-page-message { display: flex; align-items: center; justify-content: center; min-height: 220px; padding: 18px; border: 1px dashed rgba(12, 46, 76, .2); border-radius: 7px; background: #f8fbfd; color: #60758a; font-size: 13px; font-weight: 900; text-align: center; }
.wg-compare-page-message[hidden] { display: none !important; }
.wg-compare-canvas-shell canvas[hidden] { display: none !important; }

/* =========================================================
   WeldGrid Annotation Modal
========================================================= */
.wg-annotation-modal .modal-title { font-weight: 950; letter-spacing: 0; }
.wg-annotation-modal .modal-footer { gap: 8px; background: #f8fbfd; }
.wg-annotation-modal .wg-check-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; min-height: 38px; }
.wg-annotation-modal .wg-check-row label { display: inline-flex; align-items: center; gap: 6px; margin: 0; color: #17324d; font-size: 12px; font-weight: 850; }
.wg-annotation-modal .wg-form-note { margin-top: 6px; color: #60758a; font-size: 12px; font-weight: 800; }
.wg-annotation-modal .wg-helper-warning { border-color: rgba(201, 130, 22, .28); background: rgba(201, 130, 22, .08); color: #8d5d0f; }

/* =========================================================
   WeldGrid PDF Version Timeline
========================================================= */
.wg-version-timeline { display: flex; align-items: stretch; gap: 8px; padding: 10px 14px; border-bottom: 1px solid rgba(12, 46, 76, .1); background: #fbfdff; overflow-x: auto; }
.wg-version-step { display: grid; gap: 2px; min-width: 156px; padding: 8px 10px; border: 1px solid rgba(12, 46, 76, .14); border-radius: 7px; background: #ffffff; color: #17324d; text-align: left; box-shadow: 0 4px 12px rgba(7, 27, 47, .05); }
.wg-version-step:hover { border-color: rgba(255, 106, 26, .42); background: #fff8f1; }
.wg-version-step strong { font-size: 13px; font-weight: 950; color: #08233e; }
.wg-version-step span { overflow: hidden; color: #60758a; font-size: 11px; font-weight: 850; text-overflow: ellipsis; white-space: nowrap; }
.wg-version-step small { color: #35536f; font-size: 11px; font-weight: 850; }
.wg-version-step.active { border-color: rgba(42, 143, 91, .42); background: #f1fbf6; }
.wg-version-step.selected { outline: 2px solid rgba(0, 166, 214, .35); outline-offset: 1px; }

/* =========================================================
   WeldGrid PDF Viewer Panels
========================================================= */
.wg-panel-rail-head { gap: 8px; }
.wg-panel-toggle { width: 34px; height: 34px; padding: 0; flex: 0 0 auto; }
.wg-pdf-layout.left-collapsed { grid-template-columns: 54px minmax(0, 1fr) 320px; }
.wg-pdf-layout.right-collapsed { grid-template-columns: 280px minmax(0, 1fr) 54px; }
.wg-pdf-layout.left-collapsed.right-collapsed { grid-template-columns: 54px minmax(0, 1fr) 54px; }
.wg-pdf-layout.left-collapsed .wg-pdf-left .wg-card > *:not(.wg-panel-rail-head) { display: none; }
.wg-pdf-layout.right-collapsed .wg-pdf-right .wg-card > *:not(.wg-panel-rail-head) { display: none; }
.wg-pdf-layout.left-collapsed .wg-pdf-left .wg-card, .wg-pdf-layout.right-collapsed .wg-pdf-right .wg-card { min-height: 54px; padding: 10px; }
.wg-pdf-layout.right-collapsed .wg-pdf-right .wg-card:not(:first-child) { display: none; }
.wg-pdf-layout.left-collapsed .wg-pdf-left .wg-card-head > div, .wg-pdf-layout.right-collapsed .wg-pdf-right .wg-card-head > div { display: none; }
.wg-pdf-layout.left-collapsed .wg-pdf-left .wg-panel-toggle, .wg-pdf-layout.right-collapsed .wg-pdf-right .wg-panel-toggle { margin: 0 auto; }
.wg-pdf-mini-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 10px; }
.wg-pdf-mini-panel { display: grid; gap: 8px; }

/* =========================================================
   WeldGrid PDF Viewer Compact Layout
========================================================= */
.wg-pdf-toolbar { grid-template-columns: minmax(220px, 1fr) repeat(8, auto); gap: 8px; margin-bottom: 12px; }
.wg-upload-mode { display: grid; gap: 6px; padding: 8px; border: 1px solid rgba(12, 46, 76, .12); border-radius: 7px; background: #f8fbfd; }
.wg-upload-mode label { display: inline-flex; align-items: center; gap: 7px; margin: 0; color: #17324d; font-size: 12px; font-weight: 850; }
.wg-pdf-upload-copy-option { display: grid; gap: 4px; padding: 8px 10px; border: 1px solid rgba(12, 46, 76, .12); border-radius: 7px; background: #f8fbfd; }
.wg-pdf-upload-copy-option[hidden] { display: none !important; }
.wg-pdf-upload-copy-option small { color: #60758a; font-size: 11px; font-weight: 800; line-height: 1.35; }
.wg-pdf-upload-badge { display: inline-flex; align-items: center; margin-top: 5px; padding: 3px 8px; border: 1px solid rgba(15, 95, 130, .18); border-radius: 999px; background: #eef8fc; color: #0f5f82 !important; font-size: 10px !important; font-weight: 950 !important; line-height: 1.3; }
.wg-pdf-upload-badge.is-pending { border-color: rgba(255, 106, 26, .28); background: #fff7ed; color: #9a3412 !important; }
.wg-active-pdf-bar { align-items: flex-start; padding: 10px 12px; }
.wg-active-pdf-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; max-width: 560px; }
.wg-active-pdf-actions .form-select { min-width: 240px; }
.wg-pdf-status-chips { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.wg-pdf-chip { display: inline-flex !important; align-items: center; min-height: 30px; padding: 5px 9px; border: 1px solid rgba(12, 46, 76, .12); border-radius: 999px; background: #ffffff; color: #17324d !important; font-size: 11px !important; font-weight: 900; white-space: nowrap; }
.wg-pdf-canvas-shell { height: calc(100vh - 320px); min-height: 520px; max-height: calc(100vh - 260px); overflow: auto; }
.wg-pdf-list { max-height: calc(100vh - 330px); overflow: auto; padding-right: 2px; }
.wg-swal-preview { display: grid; gap: 10px; text-align: left; color: #17324d; }
.wg-swal-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.wg-swal-table th, .wg-swal-table td { padding: 7px 8px; border-bottom: 1px solid rgba(12, 46, 76, .12); vertical-align: top; text-align: left; }
.wg-swal-table th { color: #08233e; font-weight: 950; background: #f8fbfd; }
.wg-swal-empty { margin: 0; padding: 10px; border: 1px solid rgba(12, 46, 76, .1); border-radius: 7px; background: #f8fbfd; color: #60758a; font-weight: 800; }
.wg-swal-spool-list { display: grid; gap: 8px; }
.wg-swal-spool-row { display: grid; grid-template-columns: 16px minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid rgba(12, 46, 76, .12); border-radius: 7px; background: #fff; }
.wg-swal-color { width: 12px; height: 12px; border-radius: 50%; box-shadow: 0 0 0 2px rgba(12, 46, 76, .08); }
@media (max-width: 1180px) { .wg-pdf-layout.left-collapsed, .wg-pdf-layout.right-collapsed, .wg-pdf-layout.left-collapsed.right-collapsed { grid-template-columns: 1fr; } }
@media (max-width: 900px) { .wg-active-pdf-bar { display: grid; grid-template-columns: 1fr; } }
@media (max-width: 900px) { .wg-active-pdf-actions { justify-content: flex-start; max-width: none; } }
@media (max-width: 900px) { .wg-pdf-canvas-shell { height: calc(100vh - 280px); min-height: 420px; max-height: none; } }
@media (max-width: 640px) { .wg-pdf-mini-actions { grid-template-columns: 1fr; } }

/* =========================================================
   WeldGrid PDF Upload Area
========================================================= */
.wg-pdf-toolbar.wg-annotation-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.wg-pdf-toolbar.wg-annotation-toolbar .form-select { flex: 1 1 280px; min-width: 220px; }
.wg-btn-icon-only { width: 38px; padding-inline: 0; }
.wg-zoom-helper { display: inline-flex; align-items: center; min-height: 32px; padding: 4px 9px; border: 1px solid rgba(12, 46, 76, .12); border-radius: 999px; background: #fff; color: #60758a; font-size: 11px; font-weight: 900; white-space: nowrap; }
.wg-pdf-dropzone { display: grid; gap: 6px; justify-items: center; padding: 14px 10px; border: 1.5px dashed rgba(12, 46, 76, .28); border-radius: 8px; background: #f8fbfd; color: #17324d; text-align: center; cursor: pointer; transition: border-color .15s ease, background .15s ease, color .15s ease; }
.wg-pdf-dropzone input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.wg-pdf-dropzone i { color: #ff6a1a; font-size: 22px; }
.wg-pdf-dropzone strong { font-size: 13px; font-weight: 950; }
.wg-pdf-dropzone span { color: #60758a; font-size: 11px; font-weight: 800; }
.wg-pdf-dropzone.is-dragover { border-color: #ff6a1a; background: #fff7ed; }
.wg-pdf-dropzone.is-disabled { opacity: .64; cursor: not-allowed; }
.wg-pdf-upload-queue { display: grid; gap: 8px; }
.wg-pdf-upload-queue[hidden] { display: none !important; }
.wg-pdf-upload-queue-item { display: grid; grid-template-columns: 24px minmax(0, 1fr) 30px; align-items: center; gap: 8px; padding: 8px; border: 1px solid rgba(12, 46, 76, .12); border-radius: 8px; background: #ffffff; }
.wg-pdf-upload-queue-item > i { color: #ff6a1a; font-size: 20px; }
.wg-pdf-upload-queue-item strong { display: block; color: #08233e; font-size: 12px; font-weight: 950; line-height: 1.25; word-break: break-word; }
.wg-pdf-upload-queue-item span { color: #60758a; font-size: 11px; font-weight: 850; }
.wg-pdf-upload-queue-summary { display: grid; gap: 8px; padding: 10px; border: 1px solid rgba(15, 95, 130, .18); border-radius: 8px; background: #eef8fc; color: #0d2d4b; }
.wg-pdf-upload-queue-summary p { margin: 0; color: #52677d!important; font-size: 11px; font-weight: 850; line-height: 1.35; }
.wg-pdf-upload-queue-kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.wg-pdf-upload-queue-kpis span { display: grid; gap: 2px; min-width: 0; border: 1px solid rgba(12, 46, 76, .1); border-radius: 7px; background: #ffffff; padding: 7px 8px; }
.wg-pdf-upload-queue-kpis strong { color: #08233e; font-size: 13px; font-weight: 950; line-height: 1.1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wg-pdf-upload-queue-kpis small { color: #60758a!important; font-size: 10px; font-weight: 900; text-transform: uppercase; }
.wg-pdf-upload-manage, .wg-pdf-manager-trigger { justify-content: center; }
.wg-pdf-manager, .wg-pdf-upload-manager { display: grid; gap: 12px; text-align: left; color: #17324d; }
.wg-pdf-manager-kpis { display: grid; grid-template-columns: repeat(7, minmax(92px, 1fr)); gap: 8px; }
.wg-pdf-upload-manager-kpis { grid-template-columns: repeat(3, minmax(120px, 1fr)); }
.wg-pdf-manager-kpis span { display: grid; gap: 3px; min-width: 0; border: 1px solid #d6e4ee; border-radius: 8px; background: #ffffff; padding: 9px 10px; }
.wg-pdf-manager-kpis strong { color: #08233e; font-size: 17px; font-weight: 950; line-height: 1.1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wg-pdf-manager-kpis small { color: #60758a; font-size: 10px; font-weight: 900; text-transform: uppercase; }
.wg-pdf-manager-tools { display: grid; grid-template-columns: minmax(240px, 1fr) auto; gap: 10px; align-items: center; }
.wg-pdf-manager-search { display: flex; align-items: center; gap: 8px; min-height: 40px; margin: 0; border: 1px solid #cbdcea; border-radius: 8px; background: #ffffff; padding: 0 11px; }
.wg-pdf-manager-search i { color: #60758a; }
.wg-pdf-manager-search input { width: 100%; min-width: 0; border: 0; outline: 0; color: #08233e; font-size: 13px; font-weight: 850; }
.wg-pdf-manager-tool-actions { display: inline-flex; align-items: center; gap: 7px; flex-wrap: wrap; justify-content: flex-end; }
.wg-pdf-manager-selection { display: flex; align-items: center; justify-content: space-between; gap: 10px; border: 1px solid rgba(255, 106, 26, .22); border-radius: 8px; background: #fff7ed; padding: 8px 10px; }
.wg-pdf-manager-selection strong { color: #9a3412; font-size: 13px; font-weight: 950; }
.wg-pdf-manager-selection span { color: #60758a; font-size: 12px; font-weight: 850; }
.wg-pdf-manager-table-wrap { max-height: min(520px, 56vh); overflow: auto; border: 1px solid #d6e4ee; border-radius: 8px; background: #ffffff; }
.wg-pdf-manager-table { width: 100%; border-collapse: separate; border-spacing: 0; min-width: 860px; }
.wg-pdf-upload-manager-table { min-width: 720px; }
.wg-pdf-duplicate-manager { grid-template-rows: auto auto minmax(150px, 1fr) auto; }
.wg-pdf-duplicate-head { display: grid; gap: 10px; }
.wg-pdf-duplicate-summary { display: grid; grid-template-columns: repeat(5, minmax(120px, 1fr)); gap: 8px; }
.wg-pdf-duplicate-summary-chip { display: grid; gap: 3px; min-width: 0; padding: 9px 10px; border: 1px solid #d6e4ee; border-radius: 8px; background: #ffffff; }
.wg-pdf-duplicate-summary-chip strong { color: #08233e; font-size: 16px; font-weight: 950; line-height: 1.1; }
.wg-pdf-duplicate-summary-chip small { color: #60758a; font-size: 10px; font-weight: 900; text-transform: uppercase; }
.wg-pdf-duplicate-toolbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 10px 12px; border: 1px solid rgba(15, 95, 130, .18); border-radius: 10px; background: linear-gradient(180deg, #f8fbfd 0%, #eef8fc 100%); }
.wg-pdf-duplicate-toolbar-copy { display: grid; gap: 3px; max-width: 420px; }
.wg-pdf-duplicate-toolbar-copy strong { color: #08233e; font-size: 13px; font-weight: 950; }
.wg-pdf-duplicate-toolbar-copy span { color: #60758a; font-size: 11px; font-weight: 850; line-height: 1.4; }
.wg-pdf-duplicate-toolbar-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.wg-pdf-duplicate-row td { vertical-align: top; }
.wg-pdf-duplicate-file, .wg-pdf-duplicate-existing { display: grid; gap: 6px; }
.wg-pdf-duplicate-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.wg-pdf-duplicate-meta span { display: inline-flex; align-items: center; min-height: 24px; padding: 3px 8px; border: 1px solid rgba(12, 46, 76, .1); border-radius: 999px; background: #f8fbfd; color: #52677d; font-size: 10px; font-weight: 900; }
.wg-pdf-duplicate-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.wg-pdf-duplicate-actions .wg-inline-choice { display: inline-flex; align-items: center; gap: 7px; margin: 0; padding: 8px 10px; border: 1px solid rgba(12, 46, 76, .14); border-radius: 8px; background: #ffffff; color: #17324d; font-size: 12px; font-weight: 900; cursor: pointer; transition: border-color .15s ease, background .15s ease, box-shadow .15s ease; }
.wg-pdf-duplicate-actions .wg-inline-choice input[type="radio"] { margin: 0; }
.wg-pdf-duplicate-actions .wg-inline-choice.is-selected { border-color: rgba(255, 106, 26, .32); background: #fff7ed; box-shadow: inset 0 0 0 1px rgba(255, 106, 26, .15); }
.wg-pdf-duplicate-copy { display: inline-flex; align-items: center; gap: 7px; margin-top: 8px; padding: 6px 0; color: #17324d; font-size: 12px; font-weight: 850; }
.wg-pdf-duplicate-copy input[type="checkbox"] { accent-color: #ff6a1a; }
.wg-pdf-duplicate-empty { display: inline-flex; align-items: center; margin-top: 8px; padding: 6px 0; color: #60758a; font-size: 11px; font-weight: 850; }
.wg-pdf-duplicate-result { margin-top: 10px; padding: 9px 10px; border: 1px solid rgba(12, 46, 76, .1); border-radius: 8px; background: #f8fbfd; color: #17324d; font-size: 11px; font-weight: 850; line-height: 1.45; }
.wg-pdf-duplicate-row.is-copy-enabled .wg-pdf-duplicate-result { border-color: rgba(15, 95, 130, .18); background: #eef8fc; color: #0d2d4b; }
.wg-pdf-duplicate-row.is-replace-action .wg-pdf-duplicate-result { border-color: rgba(255, 106, 26, .22); background: #fff7ed; color: #9a3412; }
body.weldgrid-shell .swal2-popup.wg-pdf-upload-manager-popup {
    display: flex !important;
    flex-direction: column;
    width: min(1120px, calc(100vw - 24px)) !important;
    max-height: calc(100dvh - 48px);
    margin: 24px auto !important;
    padding-bottom: 12px !important;
    overflow: hidden !important;
}
body.weldgrid-shell .swal2-popup.wg-pdf-upload-manager-popup .swal2-html-container {
    flex: 1 1 auto;
    min-height: 0;
    max-height: calc(100dvh - 244px);
    margin: 10px 0 0 !important;
    padding-bottom: 8px !important;
    overflow: auto !important;
    overscroll-behavior: contain;
}
body.weldgrid-shell .swal2-popup.wg-pdf-upload-manager-popup .wg-pdf-upload-manager {
    min-height: 0;
    max-height: none;
    grid-template-rows: auto auto minmax(150px, 1fr) auto;
}
body.weldgrid-shell .swal2-popup.wg-pdf-upload-manager-popup .wg-pdf-manager-table-wrap {
    min-height: 150px;
    max-height: min(360px, calc(100dvh - 470px));
    overflow: auto;
}
body.weldgrid-shell .swal2-popup.wg-pdf-upload-manager-popup .swal2-actions {
    flex: 0 0 auto;
    margin-top: 12px !important;
    padding: 8px 18px 0 !important;
}
@supports not (height: 100dvh) {
    .wg-template-upload-card { max-height: calc(100vh - 48px); }
    body.weldgrid-shell .swal2-popup.wg-pdf-upload-manager-popup { max-height: calc(100vh - 48px); }
    body.weldgrid-shell .swal2-popup.wg-pdf-upload-manager-popup .swal2-html-container { max-height: calc(100vh - 244px); }
    body.weldgrid-shell .swal2-popup.wg-pdf-upload-manager-popup .wg-pdf-upload-manager { max-height: none; }
    body.weldgrid-shell .swal2-popup.wg-pdf-upload-manager-popup .wg-pdf-manager-table-wrap { max-height: min(360px, calc(100vh - 470px)); }
}
.wg-pdf-manager-table th { position: sticky; top: 0; z-index: 2; background: #f1f6fa; color: #52677d; font-size: 11px; font-weight: 950; text-transform: uppercase; padding: 9px 10px; border-bottom: 1px solid #d6e4ee; white-space: nowrap; }
.wg-pdf-manager-table td { padding: 10px; border-bottom: 1px solid #eef3f7; color: #17324d; font-size: 12px; font-weight: 850; vertical-align: middle; }
.wg-pdf-manager-table tr:last-child td { border-bottom: 0; }
.wg-pdf-manager-table tr:hover td { background: #f8fbfd; }
.wg-pdf-manager-table input[type="checkbox"] { accent-color: #ff6a1a; }
.wg-pdf-manager-name { min-width: 220px; }
.wg-pdf-manager-name strong, .wg-pdf-upload-manager-table strong { display: block; max-width: 320px; color: #08233e; font-weight: 950; line-height: 1.25; word-break: break-word; }
.wg-pdf-manager-name small, .wg-pdf-manager-table td small, .wg-pdf-upload-manager-table small { display: block; margin-top: 2px; color: #60758a; font-size: 10px; font-weight: 850; }
.wg-pdf-manager-badge { display: inline-flex; align-items: center; min-height: 22px; border-radius: 999px; background: #eef8fc; color: #0f5f82; padding: 3px 7px; font-size: 11px; font-weight: 950; }
.wg-pdf-manager-empty { border: 1px dashed #cbdcea; border-radius: 8px; background: #f8fbfd; color: #60758a; padding: 16px; text-align: center; font-size: 13px; font-weight: 850; }
.wg-pdf-delete-progress { display: grid; gap: 8px; text-align: left; color: #17324d; }
.wg-pdf-delete-progress strong { color: #08233e; font-size: 16px; font-weight: 950; }
.wg-pdf-delete-progress span { color: #60758a; font-size: 13px; font-weight: 850; word-break: break-word; }
.wg-pdf-delete-progress div { height: 10px; overflow: hidden; border-radius: 999px; background: #dbe7f0; }
.wg-pdf-delete-progress i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #ff6a1a, #dc2626); transition: width .2s ease; }
.wg-pdf-delete-errors { display: grid; gap: 8px; text-align: left; }
.wg-pdf-delete-errors p { margin: 0; color: #60758a; font-weight: 850; }
.wg-pdf-delete-errors div { display: grid; gap: 3px; border: 1px solid #fecaca; border-radius: 8px; background: #fff5f5; padding: 8px 10px; }
.wg-pdf-delete-errors strong { color: #991b1b; font-weight: 950; }
.wg-pdf-delete-errors span { color: #7f1d1d; font-size: 12px; font-weight: 800; }
@media (max-width: 900px) { .wg-pdf-manager-kpis, .wg-pdf-upload-manager-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .wg-pdf-manager-tools { grid-template-columns: 1fr; } .wg-pdf-manager-tool-actions { justify-content: stretch; } .wg-pdf-manager-tool-actions .wg-btn { flex: 1 1 auto; } }
@media (max-width: 900px) { .wg-pdf-duplicate-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); } .wg-pdf-duplicate-toolbar { flex-direction: column; } .wg-pdf-duplicate-toolbar-copy { max-width: none; } .wg-pdf-duplicate-toolbar-actions { width: 100%; justify-content: stretch; } .wg-pdf-duplicate-toolbar-actions .wg-btn { flex: 1 1 180px; } .wg-pdf-duplicate-actions { flex-direction: column; align-items: stretch; } .wg-pdf-duplicate-actions .wg-inline-choice { width: 100%; } }

.wg-pdf-list-controls { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; margin: 10px 0; }
.wg-pdf-list-controls .wg-pdf-manager-trigger { width: 100%; }
.wg-pdf-list-item { display: grid; grid-template-columns: minmax(0, 1fr) 32px; gap: 7px; align-items: start; padding: 10px; border: 1px solid rgba(12, 46, 76, .12); border-radius: 8px; background: #fff; }
.wg-pdf-list-main { display: grid; gap: 3px; min-width: 0; padding: 0; border: 0; background: transparent; text-align: left; }
.wg-pdf-list-main strong { color: #08233e; font-size: 14px; font-weight: 950; line-height: 1.25; word-break: break-word; }
.wg-pdf-list-main span, .wg-pdf-list-main small { color: #60758a; font-size: 11px; font-weight: 850; }
.wg-pdf-note-button { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border: 1px solid rgba(12, 46, 76, .12); border-radius: 7px; background: #f8fbfd; color: #17324d; }
.wg-pdf-note-button.has-notes { border-color: rgba(255, 106, 26, .35); background: #fff7ed; color: #c2460c; }

.wg-pdf-list {
    display: grid;
    align-content: start;
    gap: 8px;
    max-height: calc(100vh - 350px);
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0 6px 8px 0;
    scrollbar-gutter: stable;
}
.wg-pdf-list-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 32px;
    align-items: start;
    gap: 8px;
    width: 100%;
    min-height: auto;
    padding: 10px;
    overflow: visible;
    border: 1px solid rgba(12, 46, 76, .12);
    border-radius: 8px;
    background: #fff;
}
.wg-pdf-list-item.active {
    border-color: rgba(255, 106, 26, .9);
    background: #fff7ed;
    box-shadow: inset 3px 0 0 #ff6a1a;
}
.wg-pdf-list-main {
    display: grid;
    gap: 4px;
    min-width: 0;
    width: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    color: #08233e;
    text-align: left;
}
.wg-pdf-list-main strong {
    display: block;
    min-width: 0;
    color: #08233e;
    font-size: 13px;
    font-weight: 950;
    line-height: 1.22;
    overflow-wrap: anywhere;
    word-break: break-word;
}
.wg-pdf-list-main span,
.wg-pdf-list-main small {
    display: block;
    min-width: 0;
    color: #60758a;
    font-size: 11px;
    font-weight: 850;
    line-height: 1.35;
    overflow-wrap: anywhere;
}
.wg-pdf-note-button {
    align-self: start;
    flex: 0 0 auto;
}
.wg-pdf-upload-mini {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 10080;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 36px;
    align-items: stretch;
    width: min(430px, calc(100vw - 28px));
    overflow: hidden;
    border: 1px solid rgba(12, 46, 76, .18);
    border-radius: 10px;
    background: #ffffff;
    box-shadow: 0 18px 44px rgba(7, 27, 47, .22);
}
.wg-pdf-upload-mini[hidden] { display: none !important; }
.wg-pdf-upload-mini-main {
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr) auto;
    align-items: center;
    gap: 9px;
    min-width: 0;
    padding: 10px 12px;
    border: 0;
    background: #f8fbfd;
    color: #08233e;
    text-align: left;
}
.wg-pdf-upload-mini-main span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12px;
    font-weight: 900;
}
.wg-pdf-upload-mini-main strong {
    min-width: 44px;
    border-radius: 8px;
    background: #e8f3fa;
    color: #0f5f82;
    padding: 5px 7px;
    font-size: 12px;
    font-weight: 950;
    text-align: center;
}
.wg-pdf-upload-mini.is-warning .wg-pdf-upload-mini-main strong { background: #fff7ed; color: #9a3412; }
.wg-pdf-upload-mini.is-error .wg-pdf-upload-mini-main strong { background: #fee2e2; color: #991b1b; }
.wg-pdf-upload-mini.is-done .wg-pdf-upload-mini-main strong { background: #dcfce7; color: #166534; }
.wg-pdf-upload-mini-cancel {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-left: 1px solid rgba(12, 46, 76, .12);
    background: #fff5f5;
    color: #b91c1c;
    font-size: 18px;
}
.wg-pdf-upload-mini-cancel:hover { background: #fee2e2; color: #991b1b; }
.wg-pdf-upload-mini-cancel[hidden] { display: none !important; }
.wg-worker-progress-mini {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 10070;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 36px;
    align-items: stretch;
    width: min(440px, calc(100vw - 28px));
    overflow: hidden;
    border: 1px solid rgba(25, 118, 162, .24);
    border-radius: 10px;
    background: #ffffff;
    box-shadow: 0 18px 44px rgba(7, 27, 47, .24);
}
.wg-worker-progress-mini[hidden] { display: none !important; }
.wg-pdf-upload-mini:not([hidden]) + .wg-worker-progress-mini { bottom: 88px; }
.wg-worker-progress-mini.is-active { border-color: rgba(255, 106, 26, .36); }
.wg-worker-progress-mini.is-done { border-color: rgba(25, 118, 162, .34); }
.wg-worker-progress-mini.is-error { border-color: rgba(220, 38, 38, .32); }
.wg-worker-progress-mini-main {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr) auto;
    align-items: center;
    gap: 9px;
    min-width: 0;
    padding: 10px 12px 13px;
    border: 0;
    background: #f8fbfd;
    color: #08233e;
    text-align: left;
}
.wg-worker-progress-mini-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 999px;
    background: #e8f3fa;
    color: #0f5f82;
}
.wg-worker-progress-mini.is-active .wg-worker-progress-mini-icon { background: #fff4ec; color: #ff6a1a; }
.wg-worker-progress-mini.is-done .wg-worker-progress-mini-icon { background: #e8f3fa; color: #0f5f82; }
.wg-worker-progress-mini.is-error .wg-worker-progress-mini-icon { background: #fee2e2; color: #b91c1c; }
.wg-worker-progress-mini-copy { display: grid; gap: 2px; min-width: 0; }
.wg-worker-progress-mini-copy strong,
.wg-worker-progress-mini-copy small,
.wg-worker-progress-mini-copy em {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-style: normal;
    line-height: 1.18;
}
.wg-worker-progress-mini-copy strong { color: #08233e; font-size: 12px; font-weight: 950; }
.wg-worker-progress-mini-copy small { color: #52677d; font-size: 11px; font-weight: 850; }
.wg-worker-progress-mini-copy em { color: #0f5f82; font-size: 11px; font-weight: 900; }
.wg-worker-progress-mini-percent,
.wg-worker-progress-percent {
    min-width: 50px;
    border-radius: 8px;
    background: #e8f3fa;
    color: #0f5f82;
    padding: 6px 8px;
    font-size: 12px;
    font-weight: 950;
    text-align: center;
}
.wg-worker-progress-mini.is-active .wg-worker-progress-mini-percent { background: #fff4ec; color: #c2410c; }
.wg-worker-progress-mini.is-error .wg-worker-progress-mini-percent { background: #fee2e2; color: #991b1b; }
.wg-worker-progress-mini-cancel {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-left: 1px solid rgba(12, 46, 76, .12);
    background: #fff5f5;
    color: #b91c1c;
    font-size: 18px;
}
.wg-worker-progress-mini-cancel:hover { background: #fee2e2; color: #991b1b; }
.wg-worker-progress-mini-cancel[hidden] { display: none !important; }
.wg-worker-progress-mini > .wg-worker-progress-bar {
    grid-column: 1 / -1;
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 5px;
    border-radius: 0;
}
.wg-worker-progress-modal {
    position: fixed;
    inset: 0;
    z-index: 40070;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 22px;
    background: rgba(3, 18, 33, .52);
    backdrop-filter: blur(2px);
}
.wg-worker-progress-modal.is-visible { display: flex; }
.wg-worker-progress-modal[hidden] { display: none !important; }
.wg-worker-progress-dialog {
    width: min(680px, 100%);
    max-height: min(780px, calc(100vh - 44px));
    overflow: auto;
    border: 1px solid rgba(203, 220, 234, .96);
    border-radius: 10px;
    background: #f8fbfd;
    box-shadow: 0 24px 70px rgba(7, 27, 47, .34);
    padding: 22px;
    color: #08233e;
}
.wg-worker-progress-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 14px;
}
.wg-worker-progress-head h3 { margin: 0 0 5px; color: #08233e; font-size: 22px; font-weight: 950; }
.wg-worker-progress-head p { margin: 0; color: #60758a; font-size: 13px; font-weight: 850; }
.wg-worker-progress-head-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
}
.wg-worker-progress-minimize {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: 1px solid rgba(255, 106, 26, .34);
    border-radius: 8px;
    background: #fff7ed;
    color: #d94212;
    font-size: 18px;
    cursor: pointer;
}
.wg-worker-progress-minimize:hover {
    background: #ff6a1a;
    color: #ffffff;
}
.wg-worker-progress-bar {
    position: relative;
    width: 100%;
    height: 10px;
    overflow: hidden;
    border-radius: 999px;
    background: #dbe7f0;
    box-shadow: inset 0 1px 2px rgba(7, 27, 47, .14);
}
.wg-worker-progress-bar span {
    display: block;
    width: 0%;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #1976a2, #ff6a1a);
    box-shadow: 0 0 18px rgba(255, 106, 26, .28);
    transition: width .22s ease;
}
.wg-worker-progress-status {
    margin-top: 12px;
    padding: 9px 10px;
    border: 1px solid rgba(25, 118, 162, .18);
    border-radius: 8px;
    background: #eef7fc;
    color: #0d2d4b;
    font-size: 13px;
    font-weight: 900;
}
.wg-worker-progress-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 9px;
    margin-top: 14px;
}
.wg-worker-progress-summary div {
    display: grid;
    gap: 3px;
    min-width: 0;
    padding: 10px;
    border: 1px solid rgba(12, 46, 76, .1);
    border-radius: 8px;
    background: #ffffff;
}
.wg-worker-progress-summary span { color: #60758a; font-size: 11px; font-weight: 900; }
.wg-worker-progress-summary strong { color: #08233e; font-size: 18px; font-weight: 950; }
.wg-worker-progress-items { display: none !important; }
.wg-worker-progress-logs {
    display: grid;
    gap: 8px;
    margin-top: 14px;
}
.wg-worker-progress-logs div {
    display: grid;
    gap: 3px;
    padding: 10px;
    border: 1px solid #d6e4ee;
    border-radius: 8px;
    background: #ffffff;
}
.wg-worker-progress-logs strong { color: #08233e; font-size: 12px; font-weight: 950; }
.wg-worker-progress-logs span { color: #52677d; font-size: 12px; font-weight: 800; }
.wg-worker-progress-items div.is-running { border-color: rgba(255, 106, 26, .34); background: #fff7ed; }
.wg-worker-progress-items div.is-queued { border-color: #d6e4ee; background: #f8fbfd; }
.wg-worker-progress-items div.is-completed,
.wg-worker-progress-items div.is-skipped { border-color: rgba(16, 185, 129, .28); background: #f0fdf4; }
.wg-worker-progress-items div.is-failed { border-color: rgba(220, 38, 38, .3); background: #fff7f7; }
.wg-worker-progress-items div.is-cancelled { border-color: rgba(100, 116, 139, .24); background: #f8fafc; }
.wg-worker-progress-logs div.is-error { border-color: rgba(220, 38, 38, .28); background: #fff7f7; }
.wg-worker-progress-logs div.is-warning { border-color: rgba(255, 106, 26, .28); background: #fff7f1; }
.wg-worker-progress-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 18px;
}
@media (max-width: 640px) {
    .wg-pdf-upload-mini { right: 14px; bottom: 14px; width: calc(100vw - 28px); }
    .wg-pdf-upload-mini:not([hidden]) + .wg-worker-progress-mini { bottom: 86px; }
    .wg-worker-progress-mini { right: 14px; bottom: 14px; width: calc(100vw - 28px); }
    .wg-worker-progress-mini-main { grid-template-columns: 24px minmax(0, 1fr) auto; padding: 9px 10px 12px; }
    .wg-worker-progress-modal { padding: 14px; }
    .wg-worker-progress-dialog { padding: 18px; }
    .wg-worker-progress-head { flex-direction: column; }
    .wg-worker-progress-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .wg-worker-progress-actions { align-items: stretch; flex-direction: column; }
    .wg-pdf-list { max-height: none; }
}

/* =========================================================
   WeldGrid PDF Version Timeline / Compare
========================================================= */
.wg-version-timeline { display: grid; gap: 8px; }
.wg-version-steps { display: flex; align-items: stretch; gap: 8px; overflow-x: auto; }
.wg-version-slider { display: flex; align-items: center; gap: 8px; min-width: 240px; padding: 0 2px; }
.wg-version-slider input { flex: 1 1 auto; accent-color: #ff6a1a; }
.wg-version-slider span { color: #60758a; font-size: 11px; font-weight: 900; white-space: nowrap; }
.wg-compare-shell { display: grid; gap: 10px; padding: 12px; border-top: 1px solid rgba(12, 46, 76, .1); background: #eef5f8; }
.wg-compare-shell[hidden] { display: none; }
.wg-compare-toolbar { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 10px; align-items: end; }
.wg-compare-toolbar label { display: block; margin-bottom: 4px; color: #17324d; font-size: 11px; font-weight: 950; }
.wg-compare-toolbar span { display: block; margin-top: 3px; color: #60758a; font-size: 11px; font-weight: 850; }
.wg-compare-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; min-height: 520px; }
.wg-compare-pane { min-width: 0; border: 1px solid rgba(12, 46, 76, .12); border-radius: 8px; background: #fff; overflow: hidden; }
.wg-compare-pane-label { padding: 7px 10px; border-bottom: 1px solid rgba(12, 46, 76, .1); background: #08233e; color: #fff; font-size: 12px; font-weight: 950; }
.wg-compare-canvas-shell { position: relative; height: calc(100vh - 390px); min-height: 460px; overflow: auto; padding: 12px; background: #dfe9ef; }
.wg-compare-canvas-shell canvas { display: block; background: #fff; box-shadow: 0 8px 24px rgba(7, 27, 47, .14); }
.wg-compare-annotation-layer { position: absolute; z-index: 4; pointer-events: none; }
.wg-compare-annotation-svg { position: absolute; inset: 0; overflow: visible; pointer-events: none; }
.wg-compare-annotation-line { fill: none; stroke: var(--wg-ann-color, #22c8f8); stroke-width: var(--wg-ann-line-width, 1px); stroke-linecap: round; stroke-linejoin: round; opacity: .9; filter: drop-shadow(0 1px 2px rgba(7, 27, 47, .18)); }
.wg-compare-annotation-point { position: absolute; width: 9px; height: 9px; border: 2px solid var(--wg-ann-color, #22c8f8); border-radius: 999px; background: rgba(255, 255, 255, .82); transform: translate(-50%, -50%); box-shadow: 0 2px 8px rgba(7, 27, 47, .18); }
.wg-compare-annotation-label { position: absolute; min-width: 28px; max-width: 86px; padding: 3px 7px; border: 1px solid rgba(255, 255, 255, .5); border-radius: 5px; background: var(--wg-ann-color, #22c8f8); color: var(--wg-ann-text-color, #fff); font-size: 10px; font-weight: 950; line-height: 1.05; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transform: translate(-50%, -50%); box-shadow: 0 5px 14px rgba(7, 27, 47, .18); }

/* =========================================================
   WeldGrid PDF Preview Modals
========================================================= */
.wg-preview-tools { display: grid; grid-template-columns: minmax(0, 1fr) 190px; gap: 8px; align-items: center; }
.wg-preview-scroll { max-height: 420px; overflow: auto; border: 1px solid rgba(12, 46, 76, .1); border-radius: 8px; background: #fff; }
.wg-swal-table td:nth-child(2) { min-width: 280px; }
.wg-swal-spool-row { grid-template-columns: 16px minmax(0, 1fr) auto; }
.wg-swal-spool-row span:last-child { grid-column: 2 / -1; color: #60758a; font-size: 11px; font-weight: 800; }

/* =========================================================
   WeldGrid PDF Activity History
========================================================= */
.wg-activity-list { display: grid; gap: 8px; max-height: 430px; overflow: auto; }
.wg-activity-row { display: grid; gap: 3px; padding: 9px 10px; border: 1px solid rgba(12, 46, 76, .1); border-radius: 7px; background: #fff; text-align: left; }
.wg-activity-row strong { color: #08233e; font-size: 13px; font-weight: 950; }
.wg-activity-row span { color: #60758a; font-size: 11px; font-weight: 850; }
.wg-activity-note { margin: 8px 0 0; color: #60758a; font-size: 12px; font-weight: 850; text-align: left; }
@media (max-width: 1180px) { .wg-compare-grid { grid-template-columns: 1fr; } }
@media (max-width: 900px) { .wg-compare-toolbar { grid-template-columns: 1fr; } }
@media (max-width: 640px) { .wg-preview-tools { grid-template-columns: 1fr; } }

/* =========================================================
   WeldGrid PDF Viewer Toolbar Cleanup
========================================================= */
.wg-pdf-toolbar.wg-annotation-toolbar { align-items: center; gap: 8px; margin-bottom: 12px; }
.wg-pdf-toolbar.wg-annotation-toolbar .wg-btn { min-height: 38px; }
.wg-pdf-toolbar .wg-mode-pill, .wg-pdf-toolbar .wg-zoom-helper { display: none !important; }
.wg-active-pdf-actions #wgVersionSelect[hidden] { display: none !important; }
.wg-active-pdf-actions { gap: 8px; }
.wg-active-pdf-actions .form-select[hidden] { display: none !important; }
.wg-pdf-mini-panel { display: none !important; }

/* =========================================================
   WeldGrid PDF Collapsed Side Tabs
========================================================= */
.wg-pdf-layout { position: relative; }
.wg-pdf-side-tab { position: absolute; z-index: 20; display: none; align-items: center; justify-content: center; width: 30px; min-height: 118px; padding: 8px 4px; border: 1px solid rgba(12, 46, 76, .2); background: #17324d; color: #ffffff; font-size: 11px; font-weight: 950; letter-spacing: 0; line-height: 1.05; writing-mode: vertical-rl; transform: rotate(180deg); box-shadow: 0 8px 20px rgba(7, 27, 47, .16); }
.wg-pdf-side-tab[hidden] { display: none !important; }
.wg-pdf-side-tab:hover, .wg-pdf-side-tab:focus { background: #0b2f46; color: #ffffff; }
.wg-pdf-side-tab-right { top: 168px; right: 10px; border-radius: 7px 0 0 7px; }
.wg-pdf-side-tab-left { top: 168px; left: 10px; border-radius: 0 7px 7px 0; }
.wg-pdf-right-collapsed .wg-pdf-side-tab-right:not([hidden]) { display: inline-flex; }
.wg-pdf-left-collapsed .wg-pdf-side-tab-left:not([hidden]) { display: inline-flex; }
.wg-pdf-layout:not(.wg-pdf-right-collapsed) .wg-pdf-side-tab-right { display: none !important; }
.wg-pdf-layout:not(.wg-pdf-left-collapsed) .wg-pdf-side-tab-left { display: none !important; }
.wg-pdf-right-collapsed .wg-pdf-right-panel, .wg-pdf-right-collapsed .wg-pdf-right { overflow: visible; }
@media (max-width: 1180px) { .wg-pdf-side-tab { display: none !important; } }

/* =========================================================
   WeldGrid PDF Viewer Fullscreen
========================================================= */
body.wg-pdf-fullscreen-open { overflow: hidden; }
.wg-pdf-workspace.is-fullscreen, .wg-pdf-workspace:fullscreen { width: 100vw; height: 100vh; max-width: none; margin: 0; padding: 10px; overflow: hidden; background: #e8f0f5; display: grid; grid-template-rows: auto minmax(0, 1fr); gap: 10px; }
.wg-pdf-workspace.is-fullscreen .wg-page-header, .wg-pdf-workspace:fullscreen .wg-page-header { display: none; }
.wg-pdf-workspace.is-fullscreen .wg-pdf-toolbar, .wg-pdf-workspace:fullscreen .wg-pdf-toolbar { margin: 0; padding: 8px; border: 1px solid rgba(12, 46, 76, .12); border-radius: 8px; background: #ffffff; box-shadow: 0 10px 28px rgba(7, 27, 47, .1); }
.wg-pdf-workspace.is-fullscreen .wg-pdf-layout, .wg-pdf-workspace:fullscreen .wg-pdf-layout { height: 100%; min-height: 0; align-items: stretch; grid-template-columns: 220px minmax(0, 1fr) 330px; overflow: hidden; }
.wg-pdf-workspace.is-fullscreen .wg-pdf-center, .wg-pdf-workspace:fullscreen .wg-pdf-center, .wg-pdf-workspace.is-fullscreen .wg-pdf-side, .wg-pdf-workspace:fullscreen .wg-pdf-side { min-height: 0; overflow: hidden; }
.wg-pdf-workspace.is-fullscreen .wg-card, .wg-pdf-workspace:fullscreen .wg-card { min-height: 0; }
.wg-pdf-workspace.is-fullscreen .wg-pdf-left > .wg-card, .wg-pdf-workspace:fullscreen .wg-pdf-left > .wg-card, .wg-pdf-workspace.is-fullscreen .wg-pdf-right > .wg-card, .wg-pdf-workspace:fullscreen .wg-pdf-right > .wg-card { height: 100%; overflow: auto; }
.wg-pdf-workspace.is-fullscreen .wg-pdf-viewer-card, .wg-pdf-workspace:fullscreen .wg-pdf-viewer-card { height: 100%; min-height: 0; display: flex; flex-direction: column; }
.wg-pdf-workspace.is-fullscreen .wg-active-pdf-bar, .wg-pdf-workspace:fullscreen .wg-active-pdf-bar { flex: 0 0 auto; padding: 8px 10px; }
.wg-pdf-workspace.is-fullscreen .wg-version-timeline, .wg-pdf-workspace:fullscreen .wg-version-timeline { flex: 0 0 auto; max-height: 96px; overflow: auto; padding: 8px 10px; }
.wg-pdf-workspace.is-fullscreen .wg-pdf-canvas-shell, .wg-pdf-workspace:fullscreen .wg-pdf-canvas-shell { flex: 1 1 auto; height: auto; min-height: 0; max-height: none; }
.wg-pdf-workspace.is-fullscreen .wg-annotation-list, .wg-pdf-workspace:fullscreen .wg-annotation-list { max-height: none; }
.wg-pdf-workspace.is-fullscreen .wg-pdf-list, .wg-pdf-workspace:fullscreen .wg-pdf-list { max-height: none; }
.wg-pdf-workspace.is-fullscreen .wg-compare-shell, .wg-pdf-workspace:fullscreen .wg-compare-shell { flex: 1 1 auto; min-height: 0; overflow: auto; }
.wg-pdf-workspace.is-fullscreen .wg-compare-grid, .wg-pdf-workspace:fullscreen .wg-compare-grid { min-height: 0; height: 100%; }
.wg-pdf-workspace.is-fullscreen .wg-compare-canvas-shell, .wg-pdf-workspace:fullscreen .wg-compare-canvas-shell { height: calc(100vh - 230px); min-height: 0; }
.wg-pdf-workspace.is-fullscreen .wg-pdf-layout.left-collapsed, .wg-pdf-workspace:fullscreen .wg-pdf-layout.left-collapsed { grid-template-columns: 52px minmax(0, 1fr) 330px; }
.wg-pdf-workspace.is-fullscreen .wg-pdf-layout.right-collapsed, .wg-pdf-workspace:fullscreen .wg-pdf-layout.right-collapsed { grid-template-columns: 220px minmax(0, 1fr) 52px; }
.wg-pdf-workspace.is-fullscreen .wg-pdf-layout.left-collapsed.right-collapsed, .wg-pdf-workspace:fullscreen .wg-pdf-layout.left-collapsed.right-collapsed { grid-template-columns: 52px minmax(0, 1fr) 52px; }
.wg-pdf-workspace.is-fullscreen .wg-pdf-side-tab-right, .wg-pdf-workspace:fullscreen .wg-pdf-side-tab-right { top: 132px; right: 10px; }
.wg-pdf-workspace.is-fullscreen .wg-pdf-side-tab-left, .wg-pdf-workspace:fullscreen .wg-pdf-side-tab-left { top: 132px; left: 10px; }
.wg-pdf-workspace.is-fullscreen .wg-btn#wgPdfFullscreen, .wg-pdf-workspace:fullscreen .wg-btn#wgPdfFullscreen { border-color: rgba(255, 106, 26, .35); background: #fff7ed; color: #c2460c; }
@media (max-width: 1180px) { .wg-pdf-workspace.is-fullscreen .wg-pdf-layout, .wg-pdf-workspace:fullscreen .wg-pdf-layout { grid-template-columns: 1fr 320px; } }
@media (max-width: 1180px) { .wg-pdf-workspace.is-fullscreen .wg-pdf-left, .wg-pdf-workspace:fullscreen .wg-pdf-left { display: none; } }
@media (max-width: 900px) { .wg-pdf-workspace.is-fullscreen .wg-pdf-layout, .wg-pdf-workspace:fullscreen .wg-pdf-layout { grid-template-columns: 1fr; overflow: auto; } }
@media (max-width: 900px) { .wg-pdf-workspace.is-fullscreen .wg-pdf-right, .wg-pdf-workspace:fullscreen .wg-pdf-right { min-height: 260px; } }

/* =========================================================
   WeldGrid Annotation History Modal
========================================================= */
.wg-annotation-history-modal { gap: 10px; }
.wg-activity-helper { margin: 0; color: #60758a; font-size: 12px; font-weight: 850; text-align: left; }
.wg-annotation-history-modal .wg-activity-list { max-height: 440px; padding-right: 4px; }
.wg-annotation-history-modal .wg-activity-row { gap: 5px; border-color: rgba(25, 118, 162, .16); }
.wg-annotation-history-modal .wg-activity-row strong { color: #08233e; font-size: 14px; }
.wg-annotation-history-modal .wg-activity-meta { color: #60758a; font-size: 11px; font-weight: 850; }
.wg-activity-diff { display: block; padding-top: 4px; color: #35536f; font-size: 11px; font-weight: 800; line-height: 1.45; }

/* =========================================================
   WeldGrid Annotation BOM Auto Linking
========================================================= */
.wg-bom-auto-link-box { display: grid; gap: 6px; min-height: 52px; max-height: 128px; overflow: auto; padding: 8px; border: 1px solid rgba(12, 46, 76, .14); border-radius: 7px; background: #f8fbfd; color: #17324d; }
.wg-bom-auto-row { display: grid; gap: 2px; padding: 6px 8px; border: 1px solid rgba(12, 46, 76, .1); border-radius: 6px; background: #ffffff; }
.wg-bom-auto-row strong { color: #08233e; font-size: 12px; font-weight: 950; }
.wg-bom-auto-row span { color: #17324d; font-size: 12px; font-weight: 800; line-height: 1.3; }
.wg-bom-auto-row small, .wg-bom-auto-empty { color: #60758a; font-size: 11px; font-weight: 800; }

/* =========================================================
   WeldGrid Annotation Shape Color Controls
========================================================= */
.wg-ann-color-input { width: 100%; min-height: 38px; padding: 4px; border-radius: 7px; }
.wg-annotation-label { background: var(--wg-ann-color, #ff6a1a); }
.wg-annotation-label.is-red-marked { background: var(--wg-ann-color, #d93025); border-color: rgba(140, 20, 12, .42); box-shadow: 0 0 0 2px rgba(217, 48, 37, .22), 0 5px 14px rgba(7, 27, 47, .22); }
.wg-annotation-point { background: var(--wg-ann-color, #d93025); box-shadow: 0 0 0 2px #ffffff, 0 0 0 4px color-mix(in srgb, var(--wg-ann-color, #ff6a1a) 65%, transparent), 0 2px 7px rgba(7, 27, 47, .28); }
.wg-annotation-shape-pill { min-width: 44px; border-radius: 999px; padding-inline: 10px; }
.wg-annotation-shape-box { min-width: 30px; min-height: 30px; border-radius: 2px; padding: 5px 7px; }
.wg-annotation-shape-tag { border-radius: 4px; }

/* =========================================================
   WeldGrid Annotation Context Menu
========================================================= */
.wg-annotation-context-menu { position: fixed; z-index: 1250; display: grid; min-width: 168px; padding: 5px; border: 1px solid rgba(12, 46, 76, .18); border-radius: 7px; background: #ffffff; box-shadow: 0 14px 34px rgba(7, 27, 47, .24); }
.wg-annotation-context-menu[hidden] { display: none !important; }
.wg-annotation-context-menu button { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 9px; border: 0; border-radius: 5px; background: transparent; color: #17324d; font-size: 12px; font-weight: 900; text-align: left; }
.wg-annotation-context-menu button:hover, .wg-annotation-context-menu button:focus { background: #fff7ed; color: #c2460c; }
.wg-annotation-context-menu button.danger { color: #b42318; }
.wg-annotation-tooltip-source { color: rgba(255, 255, 255, .62); font-size: 10px !important; font-weight: 850; text-transform: none; }

/* =========================================================
   WeldGrid Annotation Preferences
========================================================= */
.wg-annotation-prefs-modal .modal-content { border: 1px solid rgba(12, 46, 76, .18); border-radius: 8px; overflow: hidden; }
.wg-annotation-prefs-modal .modal-header { align-items: flex-start; background: linear-gradient(135deg, #08233e, #17607d); color: #ffffff; }
.wg-annotation-prefs-modal .modal-title { font-weight: 950; letter-spacing: 0; }
.wg-annotation-prefs-modal .modal-footer { gap: 8px; background: #f8fbfd; }
.wg-annotation-prefs-modal .form-label { margin-bottom: 5px; color: #17324d; font-size: 12px; font-weight: 900; }
.wg-annotation-prefs-modal .form-control, .wg-annotation-prefs-modal .form-select { min-height: 38px; border-radius: 7px; font-size: 13px; font-weight: 750; }
.wg-annotation-prefs-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.wg-annotation-prefs-wide { grid-column: span 2; }
.wg-annotation-prefs-modal .wg-form-note { margin-top: 5px; color: #60758a; font-size: 11px; font-weight: 800; line-height: 1.35; }
.wg-annotation-prefs-modal .wg-helper-message { align-items: center; padding: 8px 10px; border-radius: 7px; font-size: 12px; }
@media (max-width: 768px) { .wg-annotation-prefs-grid { grid-template-columns: 1fr; } }
@media (max-width: 768px) { .wg-annotation-prefs-wide { grid-column: auto; } }

/* =========================================================
   WeldGrid Annotation Selected State Cleanup
========================================================= */
.wg-annotation-selected { outline: none; }
.wg-annotation-label.wg-annotation-selected, .wg-annotation-point.wg-annotation-selected { outline: 2px solid #00a6d6; outline-offset: 2px; }
.wg-annotation-arrow.wg-annotation-selected { filter: drop-shadow(0 0 2px rgba(0, 166, 214, .65)); }


/* =========================================================
   PDF Viewer Annotation Preferences
========================================================= */
.wg-annotation-prefs-modal .wg-check-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; min-height: 38px; }
.wg-annotation-prefs-modal .wg-check-row label { display: inline-flex; align-items: center; gap: 6px; margin: 0; color: #17324d; font-size: 12px; font-weight: 850; }

/* =========================================================
   PDF Viewer Annotation Modal
========================================================= */
.wg-ann-color-swatches { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; min-height: 38px; padding: 5px 0; }
.wg-ann-color-swatch { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border: 2px solid #ffffff; border-radius: 7px; background: var(--wg-swatch-color, #ff6a1a); box-shadow: 0 0 0 1px rgba(12, 46, 76, .2); color: #17324d; cursor: pointer; }
.wg-ann-color-swatch:hover, .wg-ann-color-swatch.active { box-shadow: 0 0 0 2px #00a6d6; transform: translateY(-1px); }
.wg-ann-color-swatch-custom { background: #f8fbfd; border-color: rgba(12, 46, 76, .12); }
.wg-ann-custom-color { display: flex; align-items: center; gap: 8px; margin-top: 6px; color: #60758a; font-size: 12px; font-weight: 850; }
.wg-bom-auto-table-wrap { max-height: 160px; overflow: auto; border: 1px solid rgba(12, 46, 76, .1); border-radius: 6px; background: #ffffff; }
.wg-bom-auto-table { width: 100%; border-collapse: collapse; font-size: 11px; }
.wg-bom-auto-table th { position: sticky; top: 0; z-index: 1; padding: 6px 7px; border-bottom: 1px solid rgba(12, 46, 76, .12); background: #eef5fa; color: #08233e; font-weight: 950; text-align: left; }
.wg-bom-auto-table td { padding: 6px 7px; border-bottom: 1px solid rgba(12, 46, 76, .08); color: #17324d; font-weight: 750; vertical-align: top; }
.wg-bom-auto-table tr.is-found td:last-child { color: #15803d; font-weight: 950; }
.wg-bom-auto-table tr.is-missing td:last-child { color: #b42318; font-weight: 950; }
.wg-annotation-shape-rectangle { border-radius: 4px; }
.wg-annotation-shape-triangle { min-width: 54px; min-height: 34px; padding: 12px 10px 6px; clip-path: polygon(50% 0, 100% 100%, 0 100%); text-align: center; }
.wg-annotation-shape-pentagon { min-width: 58px; min-height: 34px; padding: 9px 12px 6px; clip-path: polygon(50% 0, 100% 38%, 82% 100%, 18% 100%, 0 38%); text-align: center; }
.wg-annotation-shape-parallelogram { min-width: 54px; padding-inline: 14px; clip-path: polygon(14% 0, 100% 0, 86% 100%, 0 100%); text-align: center; }
.wg-annotation-arrow { fill: none; stroke-linejoin: round; }

/* =========================================================
   PDF Viewer Annotation Tooltip
========================================================= */
.wg-annotation-tooltip { max-width: 360px; }
.wg-annotation-tooltip-source { margin-top: 3px; color: rgba(255, 255, 255, .68); font-size: 10px !important; font-weight: 900; }

/* =========================================================
   PDF Viewer Annotation Side Panels
========================================================= */
.wg-pdf-workspace.is-fullscreen .wg-annotation-list-panel, .wg-pdf-workspace:fullscreen .wg-annotation-list-panel { min-height: 0; }
.wg-pdf-workspace.is-fullscreen .wg-bom-mini-panel, .wg-pdf-workspace:fullscreen .wg-bom-mini-panel { max-height: 42vh; overflow: auto; }

/* =========================================================
   Settings - Annotation Preferences
========================================================= */
.wg-settings-annotation-card .form-label { margin-bottom: 5px; color: #17324d; font-size: 12px; font-weight: 900; }
.wg-settings-annotation-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.wg-settings-annotation-wide { grid-column: span 2; }
.wg-settings-annotation-checks { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding-top: 24px; }
.wg-settings-annotation-checks label { display: inline-flex; align-items: center; gap: 7px; color: #17324d; font-size: 13px; font-weight: 850; }
.wg-settings-annotation-actions { display: flex; justify-content: flex-end; margin-top: 12px; }
.wg-settings-annotation-card .wg-form-note { margin-top: 5px; color: #60758a; font-size: 11px; font-weight: 800; line-height: 1.35; }
@media (max-width: 992px) { .wg-settings-annotation-grid { grid-template-columns: 1fr; } }
@media (max-width: 992px) { .wg-settings-annotation-wide { grid-column: auto; } }

/* =========================================================
   WeldGrid Excel Mapping Builder
========================================================= */
.wg-excel-builder-card { overflow: visible; }
.wg-excel-builder-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.wg-excel-builder { display: grid; grid-template-columns: minmax(300px, .85fr) minmax(0, 1.55fr); gap: 14px; align-items: start; }
.wg-excel-target-panel, .wg-excel-rule-panel { min-width: 0; border: 1px solid rgba(12, 46, 76, .12); border-radius: 8px; background: #f8fbfd; }
.wg-excel-target-panel { padding: 12px; }
.wg-excel-rule-panel { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 12px; }
.wg-excel-panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.wg-excel-panel-head h3 { margin: 0; color: var(--wg-navy); font-size: 15px; font-weight: 950; }
.wg-excel-panel-head p { margin: 2px 0 0; color: var(--wg-muted); font-size: 12px; font-weight: 750; }
.wg-excel-panel-head .form-control { max-width: 260px; min-height: 38px; }
@media (max-width: 992px) { .wg-excel-builder { grid-template-columns: 1fr; } }
@media (max-width: 760px) { .wg-excel-builder-actions { justify-content: stretch; } }
@media (max-width: 760px) { .wg-excel-builder-actions .wg-btn { flex: 1 1 180px; } }

/* =========================================================
   WeldGrid Excel Mapping Target Columns
========================================================= */
.wg-excel-sheet-tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 8px; margin-bottom: 8px; }
.wg-excel-sheet-tabs button { flex: 0 0 auto; border: 1px solid rgba(12, 46, 76, .16); border-radius: 999px; background: #fff; color: #17324d; padding: 7px 10px; font-size: 12px; font-weight: 900; }
.wg-excel-sheet-tabs button.is-active { border-color: rgba(255, 106, 26, .62); background: rgba(255, 106, 26, .1); color: #bf4a0b; }
.wg-excel-target-list { display: grid; gap: 8px; max-height: 620px; overflow: auto; padding-right: 2px; }
.wg-excel-target-row { display: grid; grid-template-columns: 46px minmax(0, 1fr) auto auto; gap: 8px; align-items: center; width: 100%; border: 1px solid rgba(12, 46, 76, .12); border-radius: 8px; background: #fff; padding: 9px; text-align: left; }
.wg-excel-target-row:hover { border-color: rgba(0, 119, 170, .35); background: #f3fbff; }
.wg-excel-target-row.is-selected { border-color: rgba(255, 106, 26, .68); box-shadow: 0 0 0 2px rgba(255, 106, 26, .12); }
.wg-excel-target-row.is-mapped .wg-target-status { color: #047857; background: rgba(16, 185, 129, .13); }
.wg-excel-target-row.is-auto .wg-target-status { color: #0369a1; background: rgba(14, 165, 233, .14); }
.wg-excel-target-row.is-auto .wg-target-letter { background: rgba(14, 165, 233, .12); color: #0369a1; }
.wg-excel-target-row.is-error .wg-target-status { color: #b91c1c; background: rgba(220, 38, 38, .12); }
.wg-target-letter { display: inline-flex; align-items: center; justify-content: center; min-height: 32px; border-radius: 7px; background: #eef5fa; color: #0f2f4d; font-size: 13px; font-weight: 950; }
.wg-target-main { min-width: 0; }
.wg-target-main strong { display: block; overflow: hidden; color: #062744; font-size: 13px; font-weight: 950; text-overflow: ellipsis; white-space: nowrap; }
.wg-target-main small { display: block; overflow: hidden; color: var(--wg-muted); font-size: 11px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.wg-target-status, .wg-target-custom { border-radius: 999px; padding: 4px 7px; color: #64748b; background: #edf2f7; font-size: 10px; font-weight: 950; text-transform: none; }
.wg-target-custom { justify-self: start; color: #7c2d12; background: rgba(255, 106, 26, .12); }
.wg-target-delete { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border: 1px solid rgba(220, 38, 38, .18); border-radius: 7px; color: #dc2626; background: #fff; }
.wg-target-delete:hover { border-color: rgba(220, 38, 38, .42); background: rgba(220, 38, 38, .08); }

/* =========================================================
   WeldGrid Excel Mapping Rule Editor
========================================================= */
.wg-excel-selected-target { display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 1px solid rgba(12, 46, 76, .12); border-radius: 8px; background: #fff; padding: 12px; }
.wg-excel-selected-target span, .wg-excel-selected-target small { display: block; color: var(--wg-muted); font-size: 12px; font-weight: 800; }
.wg-excel-selected-target strong { display: block; margin: 2px 0; color: var(--wg-navy); font-size: 18px; font-weight: 950; }
.wg-auto-sequence-info { width: 100%; }
.wg-auto-sequence-info p { margin: 8px 0 0; color: #17324d; font-size: 13px; font-weight: 850; }
.wg-auto-sequence-preview { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-top: 10px; }
.wg-auto-sequence-preview span { color: #64748b; font-size: 12px; font-weight: 900; }
.wg-auto-sequence-preview strong { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; margin: 0; border-radius: 999px; background: rgba(14, 165, 233, .13); color: #0369a1; font-size: 13px; font-weight: 950; }
.wg-excel-rule-editor { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; border: 1px solid rgba(12, 46, 76, .12); border-radius: 8px; background: #fff; padding: 12px; }
.wg-excel-rule-editor.is-disabled { opacity: .55; pointer-events: none; }
.wg-rule-expression-field { grid-column: 1 / -1; }
.wg-visual-rule-builder { display: grid; gap: 10px; border: 1px solid rgba(12, 46, 76, .12); border-radius: 8px; background: #f8fbfd; padding: 10px; }
.wg-visual-rule-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.wg-visual-rule-actions button { border: 1px solid rgba(12, 46, 76, .14); border-radius: 999px; background: #fff; color: #17324d; padding: 7px 10px; font-size: 12px; font-weight: 900; }
.wg-visual-rule-actions button:hover { border-color: rgba(255, 106, 26, .45); background: rgba(255, 106, 26, .08); color: #bf4a0b; }
.wg-visual-rule-steps { display: grid; gap: 8px; }
.wg-visual-step { display: grid; gap: 8px; border: 1px solid rgba(12, 46, 76, .12); border-radius: 8px; background: #fff; padding: 9px; }
.wg-visual-step-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: #0f2f4d; font-size: 12px; font-weight: 950; }
.wg-visual-step-body { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; align-items: center; }
.wg-visual-step-static { border: 1px dashed rgba(20, 184, 166, .32); border-radius: 7px; background: rgba(20, 184, 166, .08); color: #0f766e; padding: 8px 10px; font-size: 12px; font-weight: 850; }
.wg-expression-live-preview { margin-top: 7px; border: 1px solid rgba(20, 184, 166, .24); border-radius: 7px; background: rgba(20, 184, 166, .08); color: #0f766e; padding: 8px 10px; font-size: 12px; font-weight: 850; }
.wg-expression-live-preview.is-error { border-color: rgba(220, 38, 38, .24); background: rgba(220, 38, 38, .08); color: #b91c1c; }
.wg-expression-examples { margin-top: 8px; color: #17324d; font-size: 12px; font-weight: 850; }
.wg-expression-examples summary { cursor: pointer; color: #0f2f4d; font-weight: 950; }
.wg-expression-examples button { display: block; width: 100%; margin-top: 6px; border: 1px solid rgba(12, 46, 76, .1); border-radius: 7px; background: #fff; color: #17324d; padding: 7px 9px; text-align: left; font-size: 12px; font-weight: 850; }
.wg-expression-examples button:hover { border-color: rgba(0, 119, 170, .35); background: #f3fbff; }
.wg-excel-active-toggle { display: inline-flex; align-items: center; gap: 7px; align-self: end; color: #17324d; font-size: 13px; font-weight: 900; }
.wg-excel-source-library { border: 1px solid rgba(12, 46, 76, .12); border-radius: 8px; background: #fff; padding: 12px; }
.wg-excel-source-list { display: grid; gap: 10px; max-height: 360px; overflow: auto; }
.wg-source-group { display: grid; gap: 6px; }
.wg-source-group h4 { margin: 0; color: #64748b; font-size: 11px; font-weight: 950; text-transform: uppercase; letter-spacing: .03em; }
.wg-source-group button { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; border: 1px solid rgba(12, 46, 76, .1); border-radius: 7px; background: #f8fafc; padding: 8px 9px; text-align: left; }
.wg-source-group button:hover { border-color: rgba(255, 106, 26, .4); background: rgba(255, 106, 26, .07); }
.wg-source-group button strong { overflow: hidden; color: #0f2f4d; font-size: 12px; font-weight: 900; text-overflow: ellipsis; white-space: nowrap; }
.wg-source-group button small { flex: 0 0 auto; color: #64748b; font-size: 11px; font-weight: 800; }
.wg-source-group button.wg-bom-source-item1 { border-color: rgba(37, 99, 235, .28); background: #eff6ff; }
.wg-source-group button.wg-bom-source-item1:hover { border-color: rgba(37, 99, 235, .48); background: #dbeafe; }
.wg-source-group button.wg-bom-source-item2 { border-color: rgba(20, 184, 166, .28); background: #ecfdf5; }
.wg-source-group button.wg-bom-source-item2:hover { border-color: rgba(20, 184, 166, .48); background: #ccfbf1; }
@media (max-width: 760px) { .wg-excel-rule-editor { grid-template-columns: 1fr; } }
@media (max-width: 760px) { .wg-visual-rule-actions button { flex: 1 1 180px; } }

/* =========================================================
   WeldGrid Excel Mapping Preview
========================================================= */
.wg-excel-preview-card { overflow: hidden; }
.wg-excel-preview-status { margin-bottom: 10px; color: #60758a; font-size: 13px; font-weight: 800; }
.wg-excel-preview-table-wrap { overflow: auto; border: 1px solid rgba(12, 46, 76, .1); border-radius: 8px; background: #fff; }
.wg-excel-preview-tabs { display: flex; gap: 6px; padding: 8px; border-bottom: 1px solid rgba(12, 46, 76, .1); background: #f8fbfd; overflow-x: auto; }
.wg-excel-preview-tabs button { flex: 0 0 auto; border: 1px solid rgba(12, 46, 76, .16); border-radius: 999px; background: #fff; color: #17324d; padding: 7px 10px; font-size: 12px; font-weight: 900; }
.wg-excel-preview-tabs button.is-active { border-color: rgba(255, 106, 26, .62); background: rgba(255, 106, 26, .1); color: #bf4a0b; }
.wg-excel-preview-sheet { display: none; overflow: auto; }
.wg-excel-preview-sheet.is-active { display: block; }
.wg-excel-preview-table { width: 100%; min-width: 720px; border-collapse: collapse; }
.wg-excel-preview-table th { position: sticky; top: 0; z-index: 1; background: #f1f6fa; color: #062744; padding: 9px; font-size: 12px; font-weight: 950; text-align: left; }
.wg-excel-preview-table th span { display: block; color: #64748b; font-size: 10px; font-weight: 950; }
.wg-excel-preview-table th strong { display: block; color: #062744; font-size: 12px; font-weight: 950; white-space: nowrap; }
.wg-excel-preview-table td { border-top: 1px solid rgba(12, 46, 76, .08); color: #17324d; padding: 9px; font-size: 12px; font-weight: 750; vertical-align: top; }
.wg-preview-error { display: block; margin-top: 4px; color: #dc2626; font-size: 11px; font-weight: 900; }
.wg-preview-warnings { display: grid; gap: 5px; padding: 9px; border-bottom: 1px solid rgba(245, 158, 11, .25); background: rgba(245, 158, 11, .08); }
.wg-preview-warnings span { color: #92400e; font-size: 12px; font-weight: 850; }

/* =========================================================
   WeldGrid Excel Template Upload
========================================================= */
.wg-excel-builder-card input[type="file"][hidden] { display: none !important; }
.wg-excel-builder-card .swal2-input, .wg-excel-builder-card .swal2-select { font: inherit; }
.wg-custom-column-modal { display: grid; gap: 8px; text-align: left; }
.wg-custom-column-modal label { margin: 0 0 -4px; color: #17324d; font-size: 12px; font-weight: 900; }
.wg-custom-column-modal .swal2-input, .wg-custom-column-modal .swal2-select { width: 100%; margin: 0; }

/* =========================================================
   WeldGrid Annotation Drag Handles
========================================================= */
.wg-annotation-point { cursor: grab; }
.wg-annotation-point:active { cursor: grabbing; }
.wg-annotation-label { cursor: grab; }
.wg-annotation-label:active { cursor: grabbing; }
.wg-pdf-canvas-shell.is-panning, .wg-compare-canvas-shell.is-panning { cursor: grabbing; }

/* =========================================================
   WeldGrid Annotation Leader / Arrow
========================================================= */
.wg-annotation-arrow { stroke: var(--wg-ann-color, #ff6a1a); fill: none; stroke-linejoin: round; stroke-linecap: square; }
.wg-annotation-label.is-red-marked { background: var(--wg-ann-color, #ff6a1a); border-color: rgba(220, 38, 38, .9); box-shadow: 0 0 0 3px rgba(220, 38, 38, .28), 0 7px 16px rgba(7, 27, 47, .24); }
.wg-annotation-label.is-red-marked::after { content: "!"; position: absolute; top: -9px; right: -9px; display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; border: 2px solid #ffffff; border-radius: 999px; background: #dc2626; color: #ffffff; font-size: 10px; font-weight: 950; line-height: 1; box-shadow: 0 4px 10px rgba(220, 38, 38, .3); }
.wg-annotation-point.is-red-marked { box-shadow: 0 0 0 2px #ffffff, 0 0 0 5px rgba(220, 38, 38, .42), 0 2px 7px rgba(7, 27, 47, .28); }

/* =========================================================
   WeldGrid Annotation BOM Preview
========================================================= */
.wg-bom-auto-link-box { max-height: none; overflow: visible; }
.wg-bom-auto-table-wrap { max-height: none; overflow: visible; }
.wg-bom-auto-table { table-layout: fixed; }
.wg-bom-auto-table th, .wg-bom-auto-table td { white-space: normal; overflow-wrap: anywhere; }
.wg-bom-auto-table td:nth-child(3) { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* =========================================================
   WeldGrid Annotation Context Menu
========================================================= */
.wg-annotation-context-menu button[data-action="create_here"] { color: #c2460c; }
.wg-annotation-context-menu button[data-action="create_here"]:hover { background: #fff3ea; }

/* =========================================================
   WeldGrid Annotation Version Badge
========================================================= */
.wg-pdf-chip#wgVersionChip.wg-version-badge-active, .wg-pdf-chip#wgVersionChip.wg-version-badge-preview { display: inline-flex; align-items: center; gap: 7px; padding: 6px 10px; border-radius: 999px; font-weight: 950; }
.wg-pdf-chip#wgVersionChip.wg-version-badge-active { border-color: rgba(20, 184, 166, .32); background: #ecfdf5; color: #0f766e; }
.wg-pdf-chip#wgVersionChip.wg-version-badge-preview { border-color: rgba(37, 99, 235, .28); background: #eff6ff; color: #1d4ed8; }
.wg-version-badge-dot { display: inline-block; width: 8px; height: 8px; border-radius: 999px; background: currentColor; animation: wg-version-pulse 1.25s ease-in-out infinite; }
.wg-pdf-chip#wgVersionChip small { color: inherit; font-size: 10px; font-weight: 800; opacity: .72; }
@keyframes wg-version-pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, currentColor 35%, transparent); } 70% { box-shadow: 0 0 0 7px color-mix(in srgb, currentColor 0%, transparent); } 100% { box-shadow: 0 0 0 0 color-mix(in srgb, currentColor 0%, transparent); } }

/* =========================================================
   WeldGrid Compare Mode Pan
========================================================= */
.wg-compare-canvas-shell { cursor: grab; }
.wg-compare-canvas-shell canvas { cursor: inherit; }
.wg-compare-canvas-shell.is-panning canvas { cursor: grabbing; }

/* =========================================================
   WeldGrid Annotation Preferences Panel
========================================================= */
.wg-annotation-prefs-modal { z-index: 1085; }
.wg-annotation-modal.modal.show + .modal-backdrop, .wg-annotation-prefs-modal.modal.show + .modal-backdrop { z-index: 1080; }

/* =========================================================
   WeldGrid Version Timeline
========================================================= */
.wg-version-timeline { display: block; padding: 12px 14px 14px; border-bottom: 1px solid rgba(12, 46, 76, .1); background: #fbfdff; overflow-x: auto; overflow-y: hidden; }
.wg-version-flow { display: grid; gap: 0; min-width: max-content; }

/* =========================================================
   WeldGrid Version Timeline Nodes
========================================================= */

/* =========================================================
   WeldGrid Version Timeline Cards
========================================================= */
.wg-version-cards { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(210px, 1fr); gap: 12px; }
.wg-version-step.wg-version-card { position: relative; display: grid; gap: 5px; min-width: 210px; min-height: 76px; padding: 10px 11px; border: 1px solid rgba(12, 46, 76, .14); border-radius: 7px; background: #ffffff; color: #17324d; text-align: left; box-shadow: 0 4px 12px rgba(7, 27, 47, .05); }
.wg-version-step.wg-version-card:hover { border-color: rgba(255, 106, 26, .42); background: #fff8f1; }
.wg-version-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }
.wg-version-card-top strong { color: #08233e; font-size: 14px; font-weight: 950; line-height: 1; }
.wg-version-card-meta { display: block; overflow: hidden; color: #60758a; font-size: 11px; font-weight: 850; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }
.wg-version-step.wg-version-card small { color: #35536f; font-size: 11px; font-weight: 850; line-height: 1.25; }
.wg-version-card-badge { display: inline-flex; align-items: center; gap: 5px; flex: 0 0 auto; padding: 3px 7px; border-radius: 999px; font-size: 10px; font-weight: 950; line-height: 1; }
.wg-version-card-badge.active { border: 1px solid rgba(15, 118, 110, .24); background: #ecfdf5; color: #0f766e; }
.wg-version-card-badge.preview { border: 1px solid rgba(255, 106, 26, .28); background: #fff7ed; color: #c2410c; }
.wg-version-card-dot { display: inline-block; width: 7px; height: 7px; border-radius: 999px; background: currentColor; animation: wg-version-card-dot-pulse 1.35s ease-in-out infinite; }

/* =========================================================
   WeldGrid Version Timeline Active State
========================================================= */
.wg-version-step.wg-version-card.active { border-color: rgba(15, 118, 110, .24); background: #f1fbf6; }
.wg-version-step.wg-version-card.selected { border-color: rgba(255, 106, 26, .7); outline: none; box-shadow: 0 0 0 2px rgba(255, 106, 26, .16), 0 10px 22px rgba(7, 27, 47, .09); animation: wg-version-card-pulse 1.8s ease-in-out infinite; }
.wg-pdf-workspace.is-fullscreen .wg-version-timeline, .wg-pdf-workspace:fullscreen .wg-version-timeline { max-height: 150px; padding: 8px 10px 10px; }
@keyframes wg-version-card-pulse { 0% { box-shadow: 0 0 0 2px rgba(255, 106, 26, .14), 0 10px 22px rgba(7, 27, 47, .08); } 50% { box-shadow: 0 0 0 4px rgba(255, 106, 26, .24), 0 12px 26px rgba(7, 27, 47, .1); } 100% { box-shadow: 0 0 0 2px rgba(255, 106, 26, .14), 0 10px 22px rgba(7, 27, 47, .08); } }
@keyframes wg-version-card-dot-pulse { 0% { box-shadow: 0 0 0 0 rgba(255, 106, 26, .35); } 70% { box-shadow: 0 0 0 6px rgba(255, 106, 26, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 106, 26, 0); } }
.wg-version-flow { width: max-content; min-width: 100%; }
.wg-version-cards { min-width: 100%; }

/* =========================================================
   WeldGrid Annotation Arrowhead / Leader
========================================================= */
.wg-annotation-svg { pointer-events: auto; }
.wg-annotation-arrow { pointer-events: stroke; cursor: pointer; stroke: var(--wg-ann-color, #ff6a1a); fill: none; stroke-width: 2.4; stroke-linejoin: round; stroke-linecap: square; filter: drop-shadow(0 1px 1px rgba(7, 27, 47, .25)); }
.wg-annotation-arrow.wg-annotation-selected { stroke: var(--wg-ann-color, #ff6a1a); stroke-width: 3.2; filter: drop-shadow(0 0 2px rgba(0, 166, 214, .65)); }
.wg-annotation-point { background: var(--wg-ann-color, #ff6a1a); box-shadow: 0 0 0 2px #ffffff, 0 0 0 4px color-mix(in srgb, var(--wg-ann-color, #ff6a1a) 65%, transparent), 0 2px 7px rgba(7, 27, 47, .28); }
.wg-annotation-label.is-red-marked { border-color: var(--wg-ann-marked-color, #dc2626); box-shadow: 0 0 0 3px color-mix(in srgb, var(--wg-ann-marked-color, #dc2626) 28%, transparent), 0 7px 16px rgba(7, 27, 47, .24); }
.wg-annotation-label.is-red-marked::after { content: "!"; position: absolute; top: -9px; right: -9px; z-index: 3; display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; border: 2px solid #ffffff; border-radius: 999px; background: var(--wg-ann-marked-color, #dc2626); color: #ffffff; font-size: 10px; font-weight: 950; line-height: 1; box-shadow: 0 4px 10px color-mix(in srgb, var(--wg-ann-marked-color, #dc2626) 32%, transparent); }
.wg-annotation-point.is-red-marked { box-shadow: 0 0 0 2px #ffffff, 0 0 0 5px color-mix(in srgb, var(--wg-ann-marked-color, #dc2626) 42%, transparent), 0 2px 7px rgba(7, 27, 47, .28); }

/* =========================================================
   WeldGrid Annotation BOM Preview
========================================================= */
.wg-annotation-modal .modal-dialog { max-width: min(1180px, calc(100vw - 32px)); }
.wg-bom-link-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 7px; }
.wg-bom-link-head .form-label { margin: 0; }
.wg-bom-auto-link-box { max-height: none; overflow: visible; padding: 9px; }
.wg-bom-auto-table-wrap { max-height: none; overflow: visible; }
.wg-bom-auto-table { table-layout: auto; font-size: 11px; }
.wg-bom-auto-table th, .wg-bom-auto-table td { white-space: normal; overflow-wrap: anywhere; vertical-align: top; }
.wg-bom-auto-table th:nth-child(3), .wg-bom-auto-table td:nth-child(3) { width: 42%; min-width: 240px; }
.wg-bom-auto-table td:nth-child(3) { display: table-cell; line-height: 1.25; overflow: visible; -webkit-line-clamp: unset; -webkit-box-orient: unset; }
.wg-bom-auto-table td { padding: 8px 9px; }

/* =========================================================
   WeldGrid Annotation Label Shapes
========================================================= */
.wg-annotation-label { position: absolute; isolation: isolate; display: inline-flex; align-items: center; justify-content: center; overflow: visible; background: transparent !important; border-color: transparent; color: #ffffff; text-align: center; }
.wg-annotation-label::before { content: ""; position: absolute; inset: 0; z-index: -1; border: 1px solid rgba(115, 34, 0, .35); border-radius: inherit; background: var(--wg-ann-color, #ff6a1a); box-shadow: 0 5px 14px rgba(7, 27, 47, .22); }
.wg-annotation-label:hover::before { filter: brightness(.94); }
.wg-annotation-label > span { position: relative; z-index: 1; display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 1.05; }
.wg-annotation-shape-rectangle { min-width: 42px; min-height: 24px; padding: 3px 8px; border-radius: 4px; clip-path: none; }
.wg-annotation-shape-triangle { min-width: 74px; min-height: 52px; padding: 18px 12px 8px; border-radius: 0; clip-path: none; font-size: 11px; }
.wg-annotation-shape-triangle::before { clip-path: polygon(50% 0, 100% 100%, 0 100%); border-radius: 0; }
.wg-annotation-shape-pentagon { min-width: 70px; min-height: 42px; padding: 10px 12px 7px; border-radius: 0; clip-path: none; }
.wg-annotation-shape-pentagon::before { clip-path: polygon(50% 0, 100% 38%, 82% 100%, 18% 100%, 0 38%); border-radius: 0; }
.wg-annotation-shape-parallelogram { min-width: 62px; min-height: 28px; padding: 5px 15px; border-radius: 0; clip-path: none; }
.wg-annotation-shape-parallelogram::before { clip-path: polygon(14% 0, 100% 0, 86% 100%, 0 100%); border-radius: 0; }
.wg-annotation-label.wg-annotation-selected::before { box-shadow: 0 0 0 2px #00a6d6, 0 7px 16px rgba(7, 27, 47, .24); }

/* =========================================================
   WeldGrid Annotation Project Preferences
========================================================= */
.wg-pref-apply-existing { align-items: flex-start; gap: 8px; margin-top: 7px; color: #17324d; font-size: 12px; font-weight: 850; line-height: 1.3; }
.wg-annotation-prefs-modal .modal-title { letter-spacing: 0; }

/* =========================================================
   WeldGrid Version Cards Cleanup
========================================================= */
.wg-version-timeline { padding-top: 12px; padding-bottom: 12px; }
.wg-version-flow { display: block; gap: 0; }
.wg-version-cards { margin-top: 0; }
.wg-pdf-workspace.is-fullscreen .wg-version-timeline, .wg-pdf-workspace:fullscreen .wg-version-timeline { max-height: 112px; padding-top: 8px; padding-bottom: 8px; }

/* =========================================================
   WeldGrid Annotation Modal Tabs
========================================================= */
.wg-annotation-modal .modal-dialog { max-width: min(1180px, calc(100vw - 28px)); }
.wg-annotation-modal .modal-content { overflow: visible; }
.wg-annotation-modal .modal-body { overflow: visible; padding-bottom: 12px; }
.wg-annotation-modal .modal-footer { position: sticky; bottom: 0; z-index: 2; gap: 8px; background: #edf5fa; }
.wg-ann-modal-tabs { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin: 0 0 12px; padding-bottom: 10px; border-bottom: 1px solid rgba(12, 46, 76, .12); }
.wg-ann-modal-tabs button { min-height: 34px; padding: 7px 12px; border: 1px solid rgba(12, 46, 76, .14); border-radius: 999px; background: #ffffff; color: #17324d; font-size: 12px; font-weight: 950; }
.wg-ann-modal-tabs button.active { border-color: rgba(255, 106, 26, .46); background: #fff4ec; color: #c2410c; box-shadow: 0 0 0 2px rgba(255, 106, 26, .08); }
.wg-ann-modal-tabpanes { min-height: 250px; }
.wg-ann-tab-pane { display: none; }
.wg-ann-tab-pane.active { display: block; }
.wg-ann-tab-pane .form-label { margin-bottom: 5px; font-size: 12px; font-weight: 950; }

/* =========================================================
   WeldGrid Annotation Shape Rendering Fix
========================================================= */
.wg-annotation-label { background: transparent !important; border-color: transparent !important; box-shadow: none !important; }
.wg-annotation-label::before { box-shadow: none !important; filter: drop-shadow(0 6px 12px rgba(7, 27, 47, .22)); }
.wg-annotation-label.wg-annotation-selected { outline: none !important; box-shadow: none !important; }
.wg-annotation-label.wg-annotation-selected::before { box-shadow: none !important; filter: drop-shadow(0 0 3px rgba(0, 166, 214, .82)) drop-shadow(0 6px 12px rgba(7, 27, 47, .22)); }
.wg-annotation-shape-triangle, .wg-annotation-shape-pentagon, .wg-annotation-shape-parallelogram { background: transparent !important; border-color: transparent !important; box-shadow: none !important; }
.wg-annotation-shape-triangle > span, .wg-annotation-shape-pentagon > span, .wg-annotation-shape-parallelogram > span { max-width: 58px; text-align: center; }
.wg-annotation-shape-triangle { min-width: 78px; min-height: 56px; padding: 19px 12px 9px; }
.wg-annotation-shape-pentagon { min-width: 76px; min-height: 46px; padding: 11px 13px 8px; }
.wg-annotation-shape-parallelogram { min-width: 68px; min-height: 30px; padding: 6px 16px; }

/* =========================================================
   WeldGrid Annotation Preferences State
========================================================= */
.wg-annotation-prefs-modal .wg-helper-message { align-items: flex-start; }
.wg-annotation-prefs-modal .wg-pref-apply-existing { margin-top: 8px; }

/* =========================================================
   WeldGrid Annotation Undo Redo
========================================================= */
#wgUndoAction:not(:disabled), #wgRedoAction:not(:disabled) { border-color: rgba(255, 106, 26, .34); background: #fff7ed; color: #c2410c; }
#wgUndoAction:disabled, #wgRedoAction:disabled { opacity: .52; cursor: not-allowed; }
.wg-bom-auto-table tr.is-clickable { cursor: pointer; }
.wg-bom-auto-table tr.is-clickable:hover td { background: #fff7ed; }
.wg-bom-detail-preview dl { display: grid; grid-template-columns: minmax(90px, auto) minmax(0, 1fr); gap: 7px 12px; margin: 0; text-align: left; }
.wg-bom-detail-preview dt { color: #60758a; font-size: 12px; font-weight: 950; }
.wg-bom-detail-preview dd { margin: 0; color: #17324d; font-size: 13px; font-weight: 800; line-height: 1.35; }

/* =========================================================
   WeldGrid Annotation Shape Final Fix
========================================================= */
.wg-annotation-label { position: absolute; display: inline-flex; align-items: center; justify-content: center; min-width: 56px; min-height: 34px; padding: 0 !important; border: 0 !important; background: transparent !important; box-shadow: none !important; color: #ffffff; overflow: visible !important; transform: translate(-50%, -50%); isolation: isolate; }
.wg-annotation-label::before { content: none !important; }
.wg-annotation-shape-bg { position: absolute; inset: 0; z-index: 0; display: block; min-width: 0 !important; min-height: 0 !important; max-width: none !important; padding: 0 !important; box-sizing: border-box; overflow: visible !important; pointer-events: none; background: var(--wg-ann-color, #ff6a1a); filter: drop-shadow(0 7px 14px rgba(7, 27, 47, .24)); border: 1px solid rgba(7, 27, 47, .16); }
.wg-annotation-label-text { position: relative; z-index: 2; display: inline-flex; align-items: center; justify-content: center; max-width: 72px; padding: 0 8px; color: #ffffff; font-size: .78rem; font-weight: 950; line-height: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 1px 1px rgba(0, 0, 0, .18); pointer-events: none; }
.wg-annotation-shape-rectangle { border-radius: 5px; clip-path: none; }
.wg-annotation-label[data-shape="rectangle"] { min-width: 52px; min-height: 28px; }
.wg-annotation-label[data-shape="triangle"] { min-width: 78px; min-height: 58px; }
.wg-annotation-shape-triangle { clip-path: polygon(50% 0, 100% 100%, 0 100%); border: 0; }
.wg-annotation-label[data-shape="triangle"] .wg-annotation-label-text { transform: translateY(10px); max-width: 54px; font-size: .76rem; }
.wg-annotation-label[data-shape="pentagon"] { min-width: 76px; min-height: 50px; }
.wg-annotation-shape-pentagon { clip-path: polygon(50% 0, 100% 32%, 86% 100%, 14% 100%, 0 32%); border: 0; }
.wg-annotation-label[data-shape="pentagon"] .wg-annotation-label-text { transform: translateY(5px); max-width: 58px; }
.wg-annotation-label[data-shape="parallelogram"] { min-width: 68px; min-height: 32px; }
.wg-annotation-shape-parallelogram { clip-path: polygon(15% 0, 100% 0, 85% 100%, 0 100%); border: 0; }
.wg-annotation-label[data-shape="parallelogram"] .wg-annotation-label-text { max-width: 54px; }
.wg-annotation-label:hover .wg-annotation-shape-bg { filter: brightness(.96) drop-shadow(0 7px 14px rgba(7, 27, 47, .26)); }
.wg-annotation-label.wg-annotation-selected .wg-annotation-shape-bg { filter: drop-shadow(0 0 4px rgba(0, 166, 214, .9)) drop-shadow(0 7px 14px rgba(7, 27, 47, .24)); outline: 2px solid rgba(0, 166, 214, .72); outline-offset: 3px; }
.wg-annotation-label.is-red-marked .wg-annotation-shape-bg { box-shadow: 0 0 0 3px color-mix(in srgb, var(--wg-ann-marked-color, #dc2626) 28%, transparent); }
.wg-annotation-label.is-red-marked::after { content: "!"; position: absolute; top: -9px; right: -9px; z-index: 4; display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; border: 2px solid #ffffff; border-radius: 999px; background: var(--wg-ann-marked-color, #dc2626); color: #ffffff; font-size: 10px; font-weight: 950; line-height: 1; box-shadow: 0 4px 10px rgba(7, 27, 47, .25); }

/* =========================================================
   WeldGrid Annotation Label Visibility Fix
========================================================= */
.wg-annotation-label { position: absolute; display: inline-flex; align-items: center; justify-content: center; min-width: 56px; min-height: 34px; padding: 0 !important; border: 0 !important; background: transparent !important; box-shadow: none !important; color: #ffffff; overflow: visible !important; transform: translate(-50%, -50%); isolation: isolate; z-index: 20; }
.wg-annotation-label::before { content: none !important; }
.wg-annotation-shape-bg { position: absolute; inset: 0; z-index: 0; display: block; background: var(--wg-ann-color, #ff6a1a); filter: drop-shadow(0 7px 14px rgba(7, 27, 47, .24)); border: 1px solid rgba(7, 27, 47, .16); pointer-events: none; }
.wg-annotation-label-text { position: relative; z-index: 2; display: inline-flex; align-items: center; justify-content: center; max-width: 72px; padding: 0 8px; color: #ffffff; font-size: .78rem; font-weight: 950; line-height: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 1px 1px rgba(0, 0, 0, .18); pointer-events: none; }
.wg-annotation-shape-rectangle { border-radius: 5px; clip-path: none; }
.wg-annotation-label[data-shape="rectangle"] { min-width: 52px; min-height: 28px; }
.wg-annotation-label[data-shape="triangle"] { min-width: 78px; min-height: 58px; }
.wg-annotation-shape-triangle { clip-path: polygon(50% 0, 100% 100%, 0 100%); border: 0; }
.wg-annotation-label[data-shape="triangle"] .wg-annotation-label-text { transform: translateY(10px); max-width: 54px; font-size: .76rem; }
.wg-annotation-label[data-shape="pentagon"] { min-width: 76px; min-height: 50px; }
.wg-annotation-shape-pentagon { clip-path: polygon(50% 0, 100% 32%, 86% 100%, 14% 100%, 0 32%); border: 0; }
.wg-annotation-label[data-shape="pentagon"] .wg-annotation-label-text { transform: translateY(5px); max-width: 58px; }
.wg-annotation-label[data-shape="parallelogram"] { min-width: 68px; min-height: 32px; }
.wg-annotation-shape-parallelogram { clip-path: polygon(15% 0, 100% 0, 85% 100%, 0 100%); border: 0; }
.wg-annotation-label[data-shape="parallelogram"] .wg-annotation-label-text { max-width: 54px; }
.wg-annotation-label:hover .wg-annotation-shape-bg { filter: brightness(.96) drop-shadow(0 7px 14px rgba(7, 27, 47, .26)); }
.wg-annotation-label.wg-annotation-selected .wg-annotation-shape-bg { filter: drop-shadow(0 0 4px rgba(0, 166, 214, .9)) drop-shadow(0 7px 14px rgba(7, 27, 47, .24)); outline: 2px solid rgba(0, 166, 214, .72); outline-offset: 3px; }
.wg-annotation-label.is-red-marked::after { content: "!"; position: absolute; top: -9px; right: -9px; z-index: 4; display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; border: 2px solid #ffffff; border-radius: 999px; background: var(--wg-ann-marked-color, #dc2626); color: #ffffff; font-size: 10px; font-weight: 950; line-height: 1; box-shadow: 0 4px 10px rgba(7, 27, 47, .25); }

/* =========================================================
   WeldGrid BOM Extraction Progress
========================================================= */
.wg-bom-extraction-progress { display: grid; gap: 6px; width: min(100%, 620px); margin-top: 8px; padding: 8px 10px; border: 1px solid rgba(25, 118, 162, .18); border-radius: 7px; background: #f8fbfd; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .65); }
.wg-bom-extraction-progress[hidden] { display: none !important; }
.wg-bom-extraction-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: #17324d; font-size: 12px; font-weight: 950; }
.wg-bom-extraction-head strong { color: #0d5d8d; font-size: 12px; font-weight: 950; }
.wg-bom-extraction-track { width: 100%; height: 8px; overflow: hidden; border-radius: 999px; background: rgba(12, 46, 76, .12); }
.wg-bom-extraction-track span { display: block; width: 0%; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #1976a2, #16a34a); transition: width .24s ease; }
.wg-bom-extraction-details { min-height: 14px; color: #60758a; font-size: 11px; font-weight: 800; line-height: 1.3; }
.wg-bom-extraction-progress[data-state="warning"], .wg-bom-extraction-progress[data-state="partial_failed"] { border-color: rgba(201, 130, 22, .32); background: #fffaf0; }
.wg-bom-extraction-progress[data-state="warning"] .wg-bom-extraction-track span, .wg-bom-extraction-progress[data-state="partial_failed"] .wg-bom-extraction-track span { background: linear-gradient(90deg, #f59e0b, #ff6a1a); }
.wg-bom-extraction-progress[data-state="failed"] { border-color: rgba(220, 38, 38, .28); background: #fff7f7; }
.wg-bom-extraction-progress[data-state="failed"] .wg-bom-extraction-track span { background: linear-gradient(90deg, #dc2626, #f97316); }
.wg-bom-extraction-progress[data-state="done"] { border-color: rgba(22, 163, 74, .25); background: #f3fbf6; }
.wg-bom-extraction-progress[data-state="done"] .wg-bom-extraction-track span { background: linear-gradient(90deg, #16a34a, #0f766e); }
.wg-bom-extraction-progress .wg-btn { justify-self: start; min-height: 30px; padding: 5px 9px; font-size: 12px; }



/* =========================================================
   WeldGrid Annotation Shape Visibility Hotfix
========================================================= */

.wg-annotation-label .wg-annotation-shape-bg { position: absolute !important; inset: 0 !important; z-index: 0 !important; display: block !important; min-width: 0 !important; min-height: 0 !important; max-width: none !important; max-height: none !important; width: 100% !important; height: 100% !important; padding: 0 !important; margin: 0 !important; box-sizing: border-box !important; overflow: visible !important; background: var(--wg-ann-color, #ff6a1a) !important; border-color: rgba(7, 27, 47, .16) !important; box-shadow: none !important; filter: drop-shadow(0 7px 14px rgba(7, 27, 47, .24)) !important; pointer-events: none !important; white-space: normal !important; text-overflow: clip !important; }

.wg-annotation-label .wg-annotation-shape-rectangle { border-radius: 5px !important; clip-path: none !important; }

.wg-annotation-label .wg-annotation-shape-triangle { border: 0 !important; border-radius: 0 !important; clip-path: polygon(50% 0, 100% 100%, 0 100%) !important; }

.wg-annotation-label .wg-annotation-shape-pentagon { border: 0 !important; border-radius: 0 !important; clip-path: polygon(50% 0, 100% 32%, 86% 100%, 14% 100%, 0 32%) !important; }

.wg-annotation-label .wg-annotation-shape-parallelogram { border: 0 !important; border-radius: 0 !important; clip-path: polygon(15% 0, 100% 0, 85% 100%, 0 100%) !important; }

.wg-annotation-label .wg-annotation-label-text { position: relative !important; z-index: 2 !important; display: inline-flex !important; align-items: center !important; justify-content: center !important; color: #ffffff !important; font-weight: 950 !important; line-height: 1 !important; white-space: nowrap !important; overflow: hidden !important; text-overflow: ellipsis !important; pointer-events: none !important; text-shadow: 0 1px 1px rgba(0, 0, 0, .22) !important; }

.wg-annotation-label[data-shape="rectangle"] { min-width: 52px !important; min-height: 28px !important; }

.wg-annotation-label[data-shape="triangle"] { min-width: 78px !important; min-height: 58px !important; }

.wg-annotation-label[data-shape="triangle"] .wg-annotation-label-text { transform: translateY(10px) !important; max-width: 54px !important; font-size: .76rem !important; }

.wg-annotation-label[data-shape="pentagon"] { min-width: 76px !important; min-height: 50px !important; }

.wg-annotation-label[data-shape="pentagon"] .wg-annotation-label-text { transform: translateY(5px) !important; max-width: 58px !important; }

.wg-annotation-label[data-shape="parallelogram"] { min-width: 68px !important; min-height: 32px !important; }

.wg-annotation-label[data-shape="parallelogram"] .wg-annotation-label-text { max-width: 54px !important; }

/* =========================================================
   WeldGrid PDF Viewer Empty / Loading Fill Fix
========================================================= */
.wg-pdf-viewer-card { display: flex; flex-direction: column; min-height: 0; }
.wg-pdf-canvas-shell { position: relative; height: clamp(560px, calc(100dvh - 330px), 820px) !important; min-height: 560px !important; max-height: none !important; overflow: auto; }
.wg-pdf-empty { position: absolute; inset: 0; z-index: 5; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 9px; min-height: 100%; padding: 24px; text-align: center; background: rgba(238, 244, 248, .92); }
.wg-pdf-empty[hidden] { display: none !important; }
.wg-pdf-empty strong { color: #17324d; font-size: 15px; font-weight: 950; }
.wg-pdf-empty span { max-width: 460px; color: #60758a; font-size: 13px; font-weight: 800; line-height: 1.4; }
.wg-pdf-empty.is-loading i { animation: wgSpin 1s linear infinite; }
@keyframes wgSpin { to { transform: rotate(360deg); } }
@media (max-width: 900px) { .wg-pdf-canvas-shell { height: clamp(420px, calc(100dvh - 260px), 720px) !important; min-height: 420px !important; } }
/* =========================================================
   WeldGrid Page Height / Sticky Footer Fix
========================================================= */

body.weldgrid-shell {
    min-height: 100dvh;
    --wg-footer-height: 56px;
}

body.weldgrid-shell .app-wrapper {
    min-height: 100dvh !important;
    display: grid !important;
    grid-template-columns: var(--wg-sidebar-width) minmax(0, 1fr) !important;
    grid-template-rows: auto 1fr auto !important;
    grid-template-areas:
        "sidebar header"
        "sidebar main"
        "sidebar footer" !important;
}

body.weldgrid-shell.sidebar-collapse .app-wrapper {
    grid-template-columns: var(--wg-sidebar-collapsed-width) minmax(0, 1fr) !important;
}

body.weldgrid-shell .app-main {
    min-height: calc(120dvh - var(--wg-topbar-height) - var(--wg-footer-height)) !important;
    display: flex !important;
    flex-direction: column !important;
}

body.weldgrid-shell .wg-page-shell {
    flex: 1 1 auto !important;
    display: flex !important;
    flex-direction: column !important;
}

body.weldgrid-shell .wg-functional-page {
    flex: 1 1 auto !important;
    display: flex !important;
    flex-direction: column !important;
}

body.weldgrid-shell .wg-functional-page > .wg-card:last-child {
    flex: 1 1 auto !important;
}

body.weldgrid-shell .app-footer.weldgrid-footer {
    grid-area: footer !important;
    align-self: stretch !important;
}
/* =========================================================
   WeldGrid Annotation Spool Groups
========================================================= */
.wg-annotation-spool-group { display: grid; gap: 6px; margin-bottom: 10px; }
.wg-annotation-spool-group-head { display: flex; align-items: center; gap: 8px; width: 100%; border: 1px solid #cbdcea; background: #eef6fb; color: #08243d; border-radius: 6px; padding: 7px 9px; font-weight: 900; text-align: left; }
.wg-annotation-spool-group-head small { margin-left: auto; color: #52708a; font-weight: 900; }
.wg-annotation-spool-group-body { display: grid; gap: 7px; }

/* =========================================================
   WeldGrid Spool Groups
========================================================= */
.wg-spool-group-block { display: grid; gap: 7px; margin-bottom: 12px; }
.wg-spool-group-title { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 6px; background: #eef6fb; border: 1px solid #cbdcea; color: #08243d; font-weight: 900; }
.wg-spool-group-title small { margin-left: auto; color: #52708a; font-weight: 900; }
.wg-spool-list-item em { display: block; color: #64748b; font-size: .78rem; font-style: normal; font-weight: 800; }

/* =========================================================
   WeldGrid Spool Groups Panel
========================================================= */
.wg-pdf-mini-actions { flex-wrap: wrap; }
.wg-spool-bulk-action { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; margin: 10px 0; padding: 10px; border: 1px solid #cbdcea; border-radius: 7px; background: #f4f9fd; }
.wg-spool-bulk-action[hidden] { display: none !important; }
.wg-spool-bulk-action > div { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: #0d2d4b; font-size: 12px; font-weight: 900; }
.wg-spool-bulk-action span { color: #60758a; font-weight: 800; }
.wg-annotation-spool-group.active { border-radius: 8px; outline: 2px solid rgba(255, 106, 26, .25); outline-offset: 2px; }
.wg-annotation-spool-group-head { justify-content: space-between; }
.wg-spool-group-toggle { display: inline-flex; min-width: 0; flex: 1 1 auto; align-items: center; gap: 7px; border: 0; background: transparent; color: #08243d; text-align: left; font-weight: 950; }
.wg-spool-group-toggle i { color: #52708a; font-size: 15px; }
.wg-spool-group-toggle small { margin-left: auto; color: #52708a!important; font-weight: 950; }
.wg-spool-group-actions { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 4px; }
.wg-spool-group-actions button { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border: 1px solid #cbdcea; border-radius: 6px; background: #ffffff; color: #0d2d4b; }
.wg-spool-group-actions button:hover { border-color: #ff6a1a; color: #d6560f; }
.wg-annotation-list-item.multi-selected { border-color: #00a6d6; box-shadow: 0 0 0 2px rgba(0, 166, 214, .18); }
.wg-annotation-list-item.in-selected-spool { border-color: rgba(255, 106, 26, .58); background: #fff8f3; }
.wg-annotation-list-item.outside-selected-spool { opacity: .52; }
.wg-spool-editor-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; text-align: left; }
.wg-spool-editor-form label { display: grid; gap: 4px; margin: 0; color: #0d2d4b; font-size: 12px; font-weight: 900; }
.wg-spool-editor-form label:last-child { grid-column: 1 / -1; }
.wg-spool-editor-form .swal2-input, .wg-spool-editor-form .swal2-select, .wg-spool-editor-form .swal2-textarea { width: 100%; margin: 0; border: 1px solid #cbdcea; border-radius: 6px; color: #08243d; font-size: 13px; font-weight: 800; }
.wg-spool-editor-form .swal2-input.is-invalid { border-color: #ef4444; box-shadow: 0 0 0 3px rgba(239, 68, 68, .14); }
.wg-spool-editor-form .wg-spool-field-help { color: #64748b; font-size: 11px; font-weight: 800; line-height: 1.3; }
.wg-spool-editor-form .wg-spool-code-message { grid-column: 1 / -1; }
.wg-spool-editor-form .wg-spool-editor-alert { grid-column: 1 / -1; padding: 10px 12px; border: 1px solid rgba(239, 68, 68, .32); border-radius: 8px; background: rgba(254, 242, 242, .96); color: #991b1b; font-size: 13px; font-weight: 850; line-height: 1.45; white-space: normal; overflow-wrap: anywhere; word-break: normal; }
.wg-spool-editor-form .wg-swal-color-input { min-height: 42px; padding: 4px; }


body.weldgrid-shell .wg-spool-editor-segments,
body.weldgrid-shell .wg-segment-form {
    grid-column: 1 / -1;
    display: grid;
    gap: 10px;
    padding: 12px;
    border: 1px solid #cfe0ed;
    border-radius: 8px;
    background: #f7fbfe;
}

body.weldgrid-shell .wg-spool-editor-tabbar {
    display: flex;
    gap: 8px;
}

body.weldgrid-shell .wg-spool-editor-tabbar button {
    border: 1px solid #ffb18d;
    border-radius: 999px;
    background: #fff7f2;
    color: #d6560f;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 950;
}

body.weldgrid-shell .wg-spool-editor-tabbar button.active {
    background: #ff5f1f;
    border-color: #ff5f1f;
    color: #fff;
}

body.weldgrid-shell .wg-spool-segment-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    color: #0d2d4b;
    font-size: 12px;
    font-weight: 900;
}

body.weldgrid-shell .wg-spool-segment-message,
body.weldgrid-shell .wg-spool-segment-empty {
    padding: 10px 12px;
    border: 1px dashed #c7d8e7;
    border-radius: 7px;
    background: #fff;
    color: #60758a;
    font-size: 12px;
    font-weight: 850;
}

body.weldgrid-shell .wg-spool-segment-message.is-warning {
    border-color: #f6b56b;
    background: #fff7ed;
    color: #9a4a08;
}

body.weldgrid-shell .wg-spool-segment-message.is-error,
body.weldgrid-shell .wg-spool-segment-empty.is-error {
    border-color: #fecaca;
    background: #fff1f2;
    color: #be123c;
}

body.weldgrid-shell .wg-spool-segment-table-wrap {
    max-height: 220px;
    overflow: auto;
    border: 1px solid #d7e4ee;
    border-radius: 7px;
    background: #fff;
}

body.weldgrid-shell .wg-spool-segment-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 720px;
}

body.weldgrid-shell .wg-spool-segment-table th,
body.weldgrid-shell .wg-spool-segment-table td {
    padding: 8px 9px;
    border-bottom: 1px solid #e5eef5;
    color: #08243d;
    font-size: 12px;
    text-align: left;
    vertical-align: top;
}

body.weldgrid-shell .wg-spool-segment-table th {
    background: #eef6fb;
    font-weight: 950;
}

body.weldgrid-shell .wg-spool-segment-actions {
    display: inline-flex;
    gap: 5px;
    white-space: nowrap;
}

body.weldgrid-shell .wg-spool-segment-actions button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: 1px solid #cbdcea;
    border-radius: 6px;
    background: #fff;
    color: #0d2d4b;
}

body.weldgrid-shell .wg-spool-segment-actions button:hover {
    border-color: #ff5f1f;
    color: #d6560f;
}

body.weldgrid-shell .wg-spool-segment-form {
    display: grid;
    grid-template-columns: minmax(120px, .45fr) minmax(220px, 1fr);
    gap: 10px;
    padding: 10px;
    border: 1px solid #d7e4ee;
    border-radius: 8px;
    background: #fff;
}

body.weldgrid-shell .wg-spool-segment-form[hidden] {
    display: none !important;
}

body.weldgrid-shell .wg-spool-segment-form > [data-spool-segment-bom-preview],
body.weldgrid-shell .wg-spool-segment-form > label:has(textarea),
body.weldgrid-shell .wg-spool-segment-form-actions {
    grid-column: 1 / -1;
}

body.weldgrid-shell .wg-spool-segment-bom-preview,
body.weldgrid-shell .wg-segment-bom-preview {
    display: grid;
    gap: 4px;
    padding: 10px;
    border: 1px solid #bfe4ef;
    border-radius: 7px;
    background: #effbff;
    color: #0d2d4b;
    font-size: 12px;
    font-weight: 850;
}

body.weldgrid-shell .wg-spool-segment-bom-preview strong,
body.weldgrid-shell .wg-segment-bom-preview strong {
    color: #08243d;
    font-weight: 950;
}

body.weldgrid-shell .wg-spool-segment-bom-preview span,
body.weldgrid-shell .wg-segment-bom-preview span,
body.weldgrid-shell .wg-spool-segment-bom-preview small,
body.weldgrid-shell .wg-segment-bom-preview small {
    color: #60758a;
    font-weight: 850;
}

body.weldgrid-shell .wg-spool-segment-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}
/* =========================================================
   WeldGrid Spool Overlay Labels
========================================================= */
.wg-spool-overlay-label { position: absolute; z-index: 28; display: inline-flex; align-items: center; gap: 7px; min-width: 86px; min-height: 32px; padding: 7px 10px; border: 2px solid #ffffff; border-radius: 6px; background: var(--wg-spool-color, #ff6a1a); color: #ffffff; box-shadow: 0 8px 20px rgba(7, 27, 47, .24); transform: translate(-50%, -50%); cursor: grab; user-select: none; }
.wg-spool-overlay-label:active { cursor: grabbing; }
.wg-spool-overlay-label i { font-size: 14px; line-height: 1; }
.wg-spool-overlay-label strong { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #ffffff; font-size: 12px; font-weight: 950; line-height: 1; }
.wg-spool-overlay-label small { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px; background: rgba(255,255,255,.22); color: #ffffff; font-size: 11px; font-weight: 950; }
.wg-spool-overlay-label-active { outline: 3px solid rgba(0, 166, 214, .45); outline-offset: 3px; box-shadow: 0 0 0 4px rgba(255,255,255,.88), 0 10px 22px rgba(7, 27, 47, .28); }
.wg-spool-selection-bounds { position: absolute; z-index: 8; border: 2px dashed rgba(255, 106, 26, .62); border-radius: 10px; background: rgba(255, 106, 26, .06); pointer-events: none; }

/* WeldGrid spool label leader arrows */
.wg-spool-arrow { pointer-events: auto; }
.wg-spool-arrow-line { stroke: var(--wg-spool-color, #ff6a1a); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 1px 1px rgba(7, 27, 47, .24)); pointer-events: stroke; cursor: pointer; }
.wg-spool-arrow-head { fill: var(--wg-spool-color, #ff6a1a); }
.wg-spool-arrow-line:hover, .wg-spool-arrow-line.is-active { stroke-width: 3.2; filter: drop-shadow(0 0 3px rgba(0, 166, 214, .55)); }
.wg-spool-arrow-hit { stroke: rgba(255, 255, 255, .01) !important; stroke-width: 18; filter: none !important; marker-end: none; }
.wg-spool-arrow-hit:hover { stroke: rgba(255, 255, 255, .01) !important; stroke-width: 18; filter: none !important; }
.wg-spool-anchor-point { position: absolute; z-index: 29; width: 16px; height: 16px; border: 2px solid #ffffff; border-radius: 50%; background: var(--wg-spool-color, #ff6a1a); box-shadow: 0 3px 10px rgba(7, 27, 47, .28); transform: translate(-50%, -50%); cursor: grab; padding: 0; opacity: 0; pointer-events: none; transition: opacity .14s ease, transform .14s ease, outline-color .14s ease; }
.wg-spool-anchor-point.is-visible, .wg-spool-anchor-point:hover, .wg-spool-anchor-point:focus-visible { opacity: 1; pointer-events: auto; transform: translate(-50%, -50%) scale(1.04); }
.wg-spool-anchor-point:active { cursor: grabbing; }
.wg-spool-anchor-point:hover, .wg-spool-anchor-point:focus-visible, .wg-spool-anchor-point.is-active { outline: 3px solid rgba(0, 166, 214, .28); outline-offset: 2px; }
.wg-spool-leader-bend { position: absolute; z-index: 29; width: 22px; height: 22px; padding: 0; border: 0; border-radius: 999px; background: transparent; transform: translate(-50%, -50%); opacity: 0; cursor: grab; pointer-events: none; transition: opacity .14s ease, transform .14s ease; }
.wg-spool-leader-bend::before { content: ""; position: absolute; inset: 5px; border: 2px solid #ffffff; border-radius: inherit; background: var(--wg-spool-color, #ff6a1a); box-shadow: 0 0 0 2px var(--wg-spool-color, #ff6a1a), 0 6px 14px rgba(8, 36, 61, .2); }
.wg-spool-leader-bend.is-visible, .wg-spool-leader-bend:hover, .wg-spool-leader-bend:focus-visible { opacity: 1; pointer-events: auto; transform: translate(-50%, -50%) scale(1.06); }
.wg-spool-leader-bend:active { cursor: grabbing; }
.wg-spool-arrow-editor { display: grid; gap: 8px; border: 1px solid rgba(12, 46, 76, .12); border-radius: 8px; background: #f8fbfd; padding: 10px; }
.wg-spool-arrow-editor h3 { margin: 0; color: #08243d; font-size: 13px; font-weight: 950; }
.wg-spool-arrow-check { display: inline-flex !important; align-items: center; gap: 8px; font-weight: 900; }
.wg-spool-arrow-check input { width: 16px; height: 16px; accent-color: var(--wg-orange); }


/* =========================================================
   WeldGrid Spool Selection Highlight
========================================================= */
.wg-annotation-label.wg-annotation-in-selected-spool .wg-annotation-shape-bg { filter: drop-shadow(0 0 6px rgba(255, 106, 26, .95)) drop-shadow(0 7px 14px rgba(7, 27, 47, .24)) !important; outline: 3px solid rgba(255, 106, 26, .55); outline-offset: 4px; }
.wg-annotation-point.wg-annotation-in-selected-spool { box-shadow: 0 0 0 5px rgba(255, 106, 26, .25), 0 0 0 9px rgba(0, 166, 214, .14); }
.wg-annotation-arrow.wg-annotation-in-selected-spool { stroke-width: 4px; filter: drop-shadow(0 0 4px rgba(255, 106, 26, .62)); }
.wg-annotation-label.wg-annotation-outside-selected-spool, .wg-annotation-point.wg-annotation-outside-selected-spool, .wg-annotation-arrow.wg-annotation-outside-selected-spool { opacity: .34; }
.wg-annotation-label.wg-annotation-multi-selected .wg-annotation-shape-bg { outline: 3px solid rgba(0, 166, 214, .7); outline-offset: 4px; }
.wg-annotation-point.wg-annotation-multi-selected { box-shadow: 0 0 0 5px rgba(0, 166, 214, .24); }

/* =========================================================
   WeldGrid Spool Segments
========================================================= */
.wg-spool-segments-panel { display: grid; gap: 10px; margin-top: 18px; padding-top: 14px; border-top: 1px solid #dbe7f0; }
.wg-card-head-compact { margin-bottom: 0; }
.wg-card-head-compact h3 { margin: 0; color: #08243d; font-size: 15px; font-weight: 950; }
.wg-card-head-compact p { margin: 3px 0 0; color: #60758a; font-size: 12px; font-weight: 800; }
.wg-spool-segments-table td small { display: block; color: #64748b; font-size: 11px; font-weight: 800; }

/* =========================================================
   WeldGrid Spool Overlay Labels
========================================================= */
.wg-spool-overlay-label { min-width: 108px; max-width: 210px; min-height: 34px; padding: 7px 11px; border-radius: 7px; letter-spacing: 0; }
.wg-spool-overlay-label strong { max-width: 146px; font-size: 12px; letter-spacing: 0; }
.wg-spool-overlay-label small { flex: 0 0 auto; }
.wg-spool-overlay-label i { flex: 0 0 auto; }

/* =========================================================
   WeldGrid Spool Tooltip
========================================================= */
.wg-spool-tooltip { min-width: 230px; border-color: rgba(20, 184, 166, .32); }
.wg-spool-tooltip strong { color: #ffffff; }

/* =========================================================
   WeldGrid Spool Context Menu
========================================================= */
.wg-spool-context-menu { position: fixed; z-index: 10090; display: grid; min-width: 210px; padding: 6px; border: 1px solid #cbdcea; border-radius: 8px; background: #ffffff; box-shadow: 0 16px 34px rgba(7, 27, 47, .22); }
.wg-spool-context-menu[hidden] { display: none !important; }
.wg-spool-context-menu button { display: flex; align-items: center; gap: 9px; width: 100%; padding: 9px 10px; border: 0; border-radius: 6px; background: transparent; color: #0d2d4b; font-size: 13px; font-weight: 900; text-align: left; }
.wg-spool-context-menu button:hover { background: #eef6fb; color: #d6560f; }
.wg-spool-context-menu button.danger { color: #dc2626; }
.wg-spool-context-menu button.danger:hover { background: #fff1f2; color: #b91c1c; }

/* =========================================================
   WeldGrid Spool Icon Picker
========================================================= */
.wg-spool-icon-picker { display: grid; gap: 8px; }
.wg-spool-icon-current { display: flex; align-items: center; gap: 8px; min-height: 38px; padding: 7px 9px; border: 1px solid #cbdcea; border-radius: 7px; background: #f8fbfd; color: #0d2d4b; font-size: 12px; font-weight: 900; }
.wg-spool-icon-current i { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 6px; background: #e8f6fb; color: #0097a8; font-size: 17px; }
.wg-spool-icon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(58px, 1fr)); gap: 7px; max-height: 178px; overflow: auto; padding: 2px; }
.wg-spool-icon-choice { display: grid; place-items: center; gap: 3px; min-height: 52px; padding: 6px 4px; border: 1px solid #00a6b2; border-radius: 8px; background: #ffffff; color: #0097a8; font-size: 10px; font-weight: 850; }
.wg-spool-icon-choice i { font-size: 19px; line-height: 1; }
.wg-spool-icon-choice span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wg-spool-icon-choice:hover, .wg-spool-icon-choice.selected { border-color: #ffb547; background: #fff7e6; color: #b45309; box-shadow: 0 0 0 2px rgba(255, 181, 71, .22); }

/* =========================================================
   WeldGrid Spool Color Picker
========================================================= */
.wg-spool-color-picker { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.wg-spool-color-swatch { width: 31px; height: 31px; border: 2px solid #ffffff; border-radius: 7px; background: var(--wg-swatch-color); box-shadow: 0 0 0 1px #cbdcea; }
.wg-spool-color-swatch:hover, .wg-spool-color-swatch.selected { box-shadow: 0 0 0 3px rgba(0, 166, 214, .28); transform: translateY(-1px); }
.wg-spool-color-custom { position: relative; display: inline-flex !important; align-items: center; justify-content: center; width: 31px; height: 31px; margin: 0; border: 1px solid #cbdcea; border-radius: 7px; background: #ffffff; color: #0d2d4b; font-weight: 950; cursor: pointer; }
.wg-spool-color-custom input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.wg-spool-color-custom span { pointer-events: none; }

/* =========================================================
   WeldGrid Spool Grouped Panel
========================================================= */
.wg-annotation-spool-tree-group { display: grid; gap: 7px; margin-bottom: 10px; }
.wg-annotation-spool-tree-head { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 9px; border: 1px solid #cbdcea; border-radius: 7px; background: #f4f9fd; color: #08243d; text-align: left; }
.wg-annotation-spool-tree-head strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 950; }
.wg-annotation-spool-tree-head small { margin-left: auto; color: #60758a!important; font-size: 11px; font-weight: 900; white-space: nowrap; }
.wg-annotation-spool-tree-body { display: grid; gap: 7px; padding-left: 8px; border-left: 2px solid #dbe7f0; }
.wg-spool-group-copy { display: grid; min-width: 0; gap: 2px; }
.wg-spool-group-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wg-spool-group-copy em { overflow: hidden; color: #60758a!important; font-size: 11px; font-style: normal; font-weight: 850; text-overflow: ellipsis; white-space: nowrap; }
.wg-spool-group-edit-btn { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; margin-left: 4px; border: 1px solid #cbdcea; border-radius: 6px; background: #ffffff; color: #0d2d4b; }
.wg-spool-group-edit-btn:hover { border-color: #ff6a1a; color: #d6560f; }

/* =========================================================
   WeldGrid BOM Editable Headers
========================================================= */
.wg-bom-editable-header { position: relative; white-space: nowrap; cursor: text; }
.wg-bom-editable-header > span { display: inline-block; max-width: 210px; overflow: hidden; text-overflow: ellipsis; vertical-align: middle; }
.wg-bom-header-edit { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; margin-left: 5px; border: 1px solid #cbdcea; border-radius: 6px; background: #ffffff; color: #0d2d4b; opacity: 0; transition: opacity .16s ease, border-color .16s ease, color .16s ease; }
.wg-bom-editable-header:hover .wg-bom-header-edit, .wg-bom-header-edit:focus { opacity: 1; }
.wg-bom-header-edit:hover { border-color: #ff6a1a; color: #d6560f; }

/* =========================================================
   WeldGrid Annotation Fill / Text Color
========================================================= */
.wg-annotation-label { --wg-ann-text-color: #ffffff; }
.wg-annotation-label-text { color: var(--wg-ann-text-color, #ffffff) !important; }
.wg-annotation-label[data-fill-mode="solid"] .wg-annotation-shape-bg { background: var(--wg-ann-color, #ff6a1a) !important; border-color: rgba(7, 27, 47, .16) !important; }
.wg-annotation-label[data-fill-mode="transparent"] .wg-annotation-shape-bg { background: transparent !important; border: 2px solid var(--wg-ann-color, #ff6a1a) !important; }
.wg-annotation-label[data-fill-mode="transparent"] .wg-annotation-label-text { text-shadow: 0 1px 1px rgba(255, 255, 255, .65); }
.wg-ann-color-input { min-width: 56px; min-height: 38px; padding: 4px; }

/* =========================================================
   WeldGrid Spool Fill / Text Color
========================================================= */
.wg-spool-overlay-label { color: var(--wg-spool-text-color, #ffffff) !important; border-color: color-mix(in srgb, var(--wg-spool-color, #ff6a1a) 70%, #ffffff); background: var(--wg-spool-color, #ff6a1a); }
.wg-spool-overlay-label i, .wg-spool-overlay-label strong, .wg-spool-overlay-label small { color: var(--wg-spool-text-color, #ffffff) !important; }
.wg-spool-overlay-label[data-fill-mode="transparent"] { background: rgba(255, 255, 255, .92) !important; border: 2px solid var(--wg-spool-color, #ff6a1a) !important; color: var(--wg-spool-text-color, #0d2d4b) !important; }
.wg-spool-overlay-label[data-fill-mode="transparent"] i, .wg-spool-overlay-label[data-fill-mode="transparent"] strong, .wg-spool-overlay-label[data-fill-mode="transparent"] small { color: var(--wg-spool-text-color, #0d2d4b) !important; }
.wg-spool-inline-color, .wg-spool-style-color { min-width: 56px; min-height: 38px; padding: 4px; }

/* =========================================================
   WeldGrid Selected Spool Area Color
========================================================= */
.wg-spool-selection-bounds { border-color: var(--wg-spool-color, #ff6a1a) !important; background: color-mix(in srgb, var(--wg-spool-area-color, #ff6a1a) 12%, transparent); }

/* =========================================================
   WeldGrid Label Rendering Final Fix
========================================================= */
.wg-annotation-label { --wg-ann-fill-color: var(--wg-ann-color, #ff6a1a); --wg-ann-border-color: var(--wg-ann-color, #ff6a1a); --wg-ann-text-color: #ffffff; color: var(--wg-ann-text-color) !important; background: transparent !important; border: 0 !important; box-shadow: none !important; }
.wg-annotation-label .wg-annotation-shape-bg { position: absolute !important; inset: 0 !important; z-index: 0 !important; display: block !important; width: 100% !important; height: 100% !important; min-width: 0 !important; min-height: 0 !important; max-width: none !important; max-height: none !important; padding: 0 !important; margin: 0 !important; background: transparent !important; border: 0 !important; border-radius: 0 !important; box-shadow: none !important; clip-path: none !important; filter: drop-shadow(0 7px 14px rgba(7, 27, 47, .24)) !important; pointer-events: none !important; overflow: visible !important; }
.wg-annotation-label[data-fill-mode="solid"] .wg-annotation-shape-bg, .wg-annotation-label[data-fill-mode="transparent"] .wg-annotation-shape-bg { background: transparent !important; border: 0 !important; border-radius: 0 !important; clip-path: none !important; }
.wg-annotation-shape-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.wg-annotation-shape-path { fill: var(--wg-ann-fill-color, var(--wg-ann-color, #ff6a1a)); stroke: var(--wg-ann-border-color, var(--wg-ann-color, #ff6a1a)); stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.wg-annotation-label[data-fill-mode="solid"] .wg-annotation-shape-path { fill: var(--wg-ann-fill-color, var(--wg-ann-color, #ff6a1a)); stroke: var(--wg-ann-border-color, var(--wg-ann-color, #ff6a1a)); stroke-width: 2.5; }
.wg-annotation-label[data-fill-mode="transparent"] .wg-annotation-shape-path { fill: transparent; stroke: var(--wg-ann-border-color, var(--wg-ann-color, #ff6a1a)); stroke-width: 4; }
.wg-annotation-label .wg-annotation-label-text { color: var(--wg-ann-text-color, #ffffff) !important; text-shadow: 0 1px 1px rgba(255, 255, 255, .42) !important; }
.wg-annotation-label[data-fill-mode="solid"] .wg-annotation-label-text { color: var(--wg-ann-text-color, #ffffff) !important; text-shadow: 0 1px 1px rgba(0, 0, 0, .2) !important; }
.wg-annotation-label:hover .wg-annotation-shape-bg { filter: brightness(.97) drop-shadow(0 7px 14px rgba(7, 27, 47, .26)) !important; }
.wg-annotation-label.wg-annotation-selected .wg-annotation-shape-bg { filter: drop-shadow(0 0 4px rgba(0, 166, 214, .9)) drop-shadow(0 7px 14px rgba(7, 27, 47, .24)) !important; outline: 0 !important; }
.wg-annotation-label.wg-annotation-selected .wg-annotation-shape-path { stroke-width: 4.5; }
.wg-annotation-label.is-red-marked .wg-annotation-shape-bg { box-shadow: none !important; }
.wg-spool-overlay-label { --wg-spool-fill-color: var(--wg-spool-color, #ff6a1a); --wg-spool-border-color: var(--wg-spool-color, #ff6a1a); --wg-spool-text-color: #ffffff; background: var(--wg-spool-fill-color) !important; border: 2px solid var(--wg-spool-border-color) !important; color: var(--wg-spool-text-color) !important; }
.wg-spool-overlay-label[data-fill-mode="transparent"] { background: transparent !important; border-color: var(--wg-spool-border-color, var(--wg-spool-color, #ff6a1a)) !important; color: var(--wg-spool-text-color, var(--wg-spool-color, #ff6a1a)) !important; }
.wg-spool-overlay-label i, .wg-spool-overlay-label strong, .wg-spool-overlay-label small { color: var(--wg-spool-text-color, #ffffff) !important; }
.wg-spool-overlay-label small { background: color-mix(in srgb, var(--wg-spool-text-color, #ffffff) 18%, transparent) !important; border: 1px solid color-mix(in srgb, var(--wg-spool-text-color, #ffffff) 28%, transparent); }
.wg-spool-overlay-label[data-fill-mode="transparent"] small { background: color-mix(in srgb, var(--wg-spool-border-color, var(--wg-spool-color, #ff6a1a)) 10%, transparent) !important; border-color: color-mix(in srgb, var(--wg-spool-border-color, var(--wg-spool-color, #ff6a1a)) 35%, transparent); }

/* =========================================================
   WeldGrid Excel Auto Classification
========================================================= */
.wg-excel-target-row.is-formula .wg-target-status { color: #6d28d9; background: rgba(124, 58, 237, .12); }
.wg-excel-target-row.is-formula .wg-target-letter { background: rgba(124, 58, 237, .1); color: #6d28d9; }
.wg-excel-target-row.is-optional .wg-target-status { color: #92400e; background: rgba(245, 158, 11, .16); }
.wg-excel-target-row.is-hidden .wg-target-status { color: #475569; background: rgba(100, 116, 139, .14); }
.wg-auto-sequence-info p strong { color: #0f2f4d; font-weight: 950; }


/* =========================================================
   WeldGrid Excel Template Upload Progress
========================================================= */
.wg-template-upload-modal { position: fixed; inset: 0; z-index: 20000; display: none; align-items: center; justify-content: center; padding: 24px; background: rgba(3, 18, 33, .58); backdrop-filter: blur(2px); }
.wg-template-upload-modal.is-visible { display: flex; }
.wg-template-upload-card { width: min(560px, 100%); max-height: calc(100dvh - 48px); overflow: auto; border: 1px solid rgba(203, 220, 234, .95); border-radius: 10px; background: #f8fbfd; box-shadow: 0 24px 70px rgba(7, 27, 47, .35); padding: 22px; color: #08243d; }
.wg-template-upload-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 16px; }
.wg-template-upload-head h3 { margin: 0 0 5px; color: #08243d; font-size: 22px; font-weight: 950; }
.wg-template-upload-head p { margin: 0; color: #60758a; font-size: 13px; font-weight: 850; }
.wg-template-upload-percent { flex: 0 0 auto; min-width: 58px; padding: 8px 10px; border-radius: 8px; background: #e8f4fb; color: #0d5e85; font-size: 16px; font-weight: 950; text-align: center; }
.wg-template-upload-progress { position: relative; height: 12px; overflow: hidden; border-radius: 999px; background: #dbe7f0; box-shadow: inset 0 1px 2px rgba(7, 27, 47, .14); }
.wg-template-upload-progress-bar { width: 0%; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #ff6a1a, #14b8a6); box-shadow: 0 0 18px rgba(255, 106, 26, .32); transition: width .22s ease; }
.wg-template-upload-steps { display: grid; gap: 9px; margin-top: 18px; }
.wg-template-upload-step { display: flex; align-items: center; gap: 10px; min-height: 38px; padding: 8px 10px; border: 1px solid #d6e4ee; border-radius: 8px; background: #ffffff; color: #60758a; font-size: 13px; font-weight: 900; }
.wg-template-upload-step span { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 999px; background: #edf4f8; color: #60758a; }
.wg-template-upload-step.is-active { border-color: rgba(255, 106, 26, .55); background: #fff7f1; color: #0d2d4b; }
.wg-template-upload-step.is-active span { background: #ff6a1a; color: #ffffff; animation: wgSpin 1s linear infinite; }
.wg-template-upload-step.is-done { border-color: rgba(22, 163, 74, .28); background: #f1fbf5; color: #14532d; }
.wg-template-upload-step.is-done span { background: #16a34a; color: #ffffff; animation: none; }
.wg-template-upload-step.is-error { border-color: rgba(220, 38, 38, .35); background: #fff4f4; color: #991b1b; }
.wg-template-upload-step.is-error span { background: #dc2626; color: #ffffff; animation: none; }
.wg-template-upload-modal.is-success .wg-template-upload-percent { background: #dcfce7; color: #166534; }
.wg-template-upload-modal.is-error .wg-template-upload-percent { background: #fee2e2; color: #991b1b; }
.wg-template-upload-modal.is-warning .wg-template-upload-percent { background: #fff7ed; color: #9a3412; }
.wg-template-upload-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.wg-btn-danger-outline { border-color: rgba(220, 38, 38, .4); background: #fff5f5; color: #b91c1c; }
.wg-btn-danger-outline:hover { border-color: rgba(220, 38, 38, .65); background: #fee2e2; color: #991b1b; }
.wg-btn-danger-outline:disabled { opacity: .65; cursor: not-allowed; }
.wg-template-upload-details { margin-top: 14px; max-height: min(260px, 28vh); overflow: auto; padding: 12px; border: 1px solid #d6e4ee; border-radius: 8px; background: #ffffff; color: #0d2d4b; font-size: 13px; font-weight: 750; }
.wg-template-upload-details[hidden] { display: none !important; }
.wg-upload-summary { display: grid; gap: 6px; margin-bottom: 10px; }
.wg-upload-summary strong, .wg-upload-warnings strong { color: #08243d; font-weight: 950; }
.wg-upload-summary-list { display: grid; gap: 3px; max-height: 132px; overflow: auto; padding-right: 4px; }
.wg-upload-summary span, .wg-upload-summary em { color: #52677d; font-style: normal; }
.wg-upload-summary em { font-size: 12px; font-weight: 900; }
.wg-upload-summary.is-error span, .wg-upload-summary.is-error em { color: #991b1b; }
.wg-upload-summary.is-warning span, .wg-upload-summary.is-warning em { color: #9a3412; }
.wg-upload-warnings { display: grid; gap: 6px; }
.wg-upload-warnings p { margin: 0; color: #60758a; }
.wg-upload-warnings ul { margin: 0; padding-left: 18px; color: #52677d; }
.wg-upload-warnings li + li { margin-top: 3px; }
.ri-spin { animation: wgSpin 1s linear infinite; }
@media (max-width: 640px) { .wg-template-upload-card { padding: 18px; } .wg-template-upload-head { flex-direction: column; } .wg-template-upload-percent { align-self: flex-start; } }

/* WeldGrid Excel Reference Tables */
body.weldgrid-shell .wg-excel-reference-card { display: flex; flex-direction: column; gap: 16px; }
body.weldgrid-shell .wg-excel-reference-card .wg-card-head { align-items: flex-start; gap: 16px; }
body.weldgrid-shell .wg-reference-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
body.weldgrid-shell .wg-reference-tabs { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; border-bottom: 1px solid var(--wg-border); padding: 0 0 10px; }
body.weldgrid-shell .wg-reference-tabs button { position: relative; appearance: none; border: 1px solid #cfe0eb; background: #ffffff; color: var(--wg-navy); border-radius: 999px; box-shadow: none; font-size: .95rem; font-weight: 900; line-height: 1.1; padding: 10px 15px; transition: background-color .16s ease, border-color .16s ease, color .16s ease, box-shadow .16s ease; }
body.weldgrid-shell .wg-reference-tabs button::before,
body.weldgrid-shell .wg-reference-tabs button::after { content: none !important; display: none !important; border: 0 !important; }
body.weldgrid-shell .wg-reference-tabs button:hover { border-color: rgba(255, 106, 26, .45); background: #fff8f3; color: #0d2d4b; }
body.weldgrid-shell .wg-reference-tabs button.is-active { border-color: var(--wg-orange); background: rgba(255, 106, 26, .12); color: var(--wg-orange); box-shadow: inset 0 0 0 1px rgba(255, 106, 26, .08); }
body.weldgrid-shell .wg-reference-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding-top: 2px; }
body.weldgrid-shell .wg-reference-toolbar .form-control { max-width: 360px; min-height: 46px; }
body.weldgrid-shell #wgReferenceStatus { color: var(--wg-muted); font-weight: 700; }
body.weldgrid-shell .wg-reference-table-wrap { overflow: auto; border: 1px solid var(--wg-border); border-radius: 8px; }
body.weldgrid-shell .wg-reference-table { width: 100%; min-width: 780px; border-collapse: collapse; background: #fff; }
body.weldgrid-shell .wg-reference-table th { background: #f4f8fb; color: var(--wg-navy); font-size: .78rem; padding: 10px; text-align: left; border-bottom: 1px solid var(--wg-border); }
body.weldgrid-shell .wg-reference-table td { padding: 10px; border-bottom: 1px solid rgba(25, 118, 162, .12); color: var(--wg-text); vertical-align: middle; }
body.weldgrid-shell .wg-ref-action { border: 0; background: rgba(25, 118, 162, .1); color: var(--wg-cyan); border-radius: 6px; font-weight: 800; margin-right: 6px; padding: 6px 8px; }
body.weldgrid-shell .wg-ref-action.is-danger { background: rgba(220, 38, 38, .09); color: var(--wg-red); }

/* WeldGrid Excel Reference Table Tabs */
body.weldgrid-shell .wg-excel-reference-card .wg-reference-tabs { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; border-bottom: 1px solid var(--wg-border); padding: 0 0 10px; margin: 0; }
body.weldgrid-shell .wg-excel-reference-card .wg-reference-tabs button { position: relative; appearance: none; border: 1px solid #cfe0eb; background: #ffffff; color: var(--wg-navy); border-radius: 999px; box-shadow: none; font-size: .95rem; font-weight: 900; line-height: 1.1; padding: 10px 15px; cursor: pointer; transition: background-color .16s ease, border-color .16s ease, color .16s ease, box-shadow .16s ease; }
body.weldgrid-shell .wg-excel-reference-card .wg-reference-tabs button::before, body.weldgrid-shell .wg-excel-reference-card .wg-reference-tabs button::after { content: none !important; display: none !important; width: 0 !important; height: 0 !important; border: 0 !important; box-shadow: none !important; }
body.weldgrid-shell .wg-excel-reference-card .wg-reference-tabs button:hover { border-color: rgba(255, 106, 26, .45); background: #fff8f3; color: #0d2d4b; }
body.weldgrid-shell .wg-excel-reference-card .wg-reference-tabs button.is-active { border-color: var(--wg-orange); background: rgba(255, 106, 26, .12); color: var(--wg-orange); box-shadow: inset 0 0 0 1px rgba(255, 106, 26, .08); }
body.weldgrid-shell .wg-excel-reference-card .wg-reference-description { margin-top: -4px; color: var(--wg-muted); font-size: .9rem; font-weight: 700; line-height: 1.45; }

/* WeldGrid Excel Reference Table Sorting */
body.weldgrid-shell .wg-excel-reference-card .wg-reference-status-group { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px 14px; color: var(--wg-muted); font-weight: 800; }
body.weldgrid-shell .wg-excel-reference-card .wg-reference-sort-status { color: #0d2d4b; font-size: .82rem; font-weight: 900; }
body.weldgrid-shell .wg-excel-reference-card .wg-reference-sortable { padding: 0; }
body.weldgrid-shell .wg-excel-reference-card .wg-reference-actions-head { width: 180px; }
body.weldgrid-shell .wg-excel-reference-card .wg-reference-sort-btn { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; min-height: 40px; border: 0; background: transparent; color: inherit; font: inherit; font-weight: 900; text-align: left; padding: 10px; cursor: pointer; }
body.weldgrid-shell .wg-excel-reference-card .wg-reference-sort-btn span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.weldgrid-shell .wg-excel-reference-card .wg-reference-sort-btn i { flex: 0 0 auto; color: #60758a; font-size: 14px; line-height: 1; }
body.weldgrid-shell .wg-excel-reference-card .wg-reference-sortable.is-active .wg-reference-sort-btn { color: var(--wg-orange); }
body.weldgrid-shell .wg-excel-reference-card .wg-reference-sortable.is-active .wg-reference-sort-btn i { color: var(--wg-orange); }
body.weldgrid-shell .wg-excel-reference-card .wg-reference-sort-btn:hover { background: #fff8f3; }
@media (max-width: 640px) { body.weldgrid-shell .wg-excel-reference-card .wg-reference-status-group { justify-content: flex-start; } }

/* WeldGrid Excel Mapping Cleaning Rules */
body.weldgrid-shell .wg-cleaning-rules { border: 1px solid var(--wg-border); border-radius: 8px; padding: 12px; background: #f8fbfd; }
body.weldgrid-shell .wg-cleaning-rules h4 { margin: 0 0 10px; font-size: .92rem; font-weight: 900; color: var(--wg-navy); }
body.weldgrid-shell .wg-cleaning-checks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 14px; }
body.weldgrid-shell .wg-cleaning-checks label { display: flex; align-items: center; gap: 8px; color: var(--wg-text); font-weight: 700; font-size: .86rem; }
body.weldgrid-shell .wg-cleaning-empty-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }

/* WeldGrid Excel Mapping Preview */
body.weldgrid-shell .wg-excel-preview-table th { white-space: nowrap; }
body.weldgrid-shell .wg-excel-preview-table td { min-width: 96px; }

/* WeldGrid Excel Mapping Badges */
body.weldgrid-shell .wg-target-status { white-space: nowrap; }
body.weldgrid-shell .wg-excel-target-row .wg-target-status { background: #eef3f7; color: var(--wg-muted); }
body.weldgrid-shell .wg-excel-target-row.is-auto .wg-target-status { background: rgba(25, 118, 162, .12); color: var(--wg-cyan); }
body.weldgrid-shell .wg-excel-target-row.is-formula .wg-target-status { background: rgba(124, 58, 237, .1); color: #6d28d9; }
body.weldgrid-shell .wg-excel-target-row.is-mapped .wg-target-status { background: rgba(22, 163, 74, .12); color: var(--wg-green); }

@media (max-width: 860px) { body.weldgrid-shell .wg-cleaning-checks, body.weldgrid-shell .wg-cleaning-empty-grid { grid-template-columns: 1fr; } body.weldgrid-shell .wg-reference-toolbar { align-items: stretch; flex-direction: column; } body.weldgrid-shell .wg-reference-toolbar .form-control { max-width: none; } body.weldgrid-shell .wg-excel-reference-card .wg-card-head { align-items: stretch; } body.weldgrid-shell .wg-reference-actions { justify-content: flex-start; } }
@media (max-width: 640px) { body.weldgrid-shell .wg-reference-tabs { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 8px; scrollbar-width: thin; } body.weldgrid-shell .wg-reference-tabs button { flex: 0 0 auto; white-space: nowrap; } }
/* =========================================================
   WeldGrid PDF Viewer Coordinate Plane
========================================================= */
.wg-pdf-canvas-shell {
    position: relative;
    overflow: auto;
}

.wg-pdf-page-surface {
    position: relative;
    display: block;
    width: 0;
    height: 0;
    min-width: 0;
    min-height: 0;
    transform: none;
    transform-origin: top left;
}

.wg-pdf-page-surface #wgPdfCanvas {
    position: relative;
    z-index: 1;
    display: block;
    max-width: none;
    max-height: none;
    transform: none;
    transform-origin: top left;
}

.wg-pdf-page-surface #wgAnnotationLayer {
    position: absolute;
    inset: 0 auto auto 0 !important;
    left: 0 !important;
    top: 0 !important;
    z-index: 3;
    overflow: visible;
    transform: none;
    transform-origin: top left;
    pointer-events: auto;
}

.wg-pdf-page-surface .wg-annotation-svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: visible;
    transform: none;
    transform-origin: top left;
}

.wg-pdf-page-surface .wg-annotation-label,
.wg-pdf-page-surface .wg-annotation-point,
.wg-pdf-page-surface .wg-spool-overlay-label,
.wg-pdf-page-surface .wg-spool-selection-bounds {
    transform-origin: top left;
}

/* WeldGrid Drawing Context Menu */
body.weldgrid-shell .wg-annotation-context-menu, body.weldgrid-shell .wg-spool-context-menu { z-index: 10090; min-width: 210px; padding: 6px; border: 1px solid #cbdcea; border-radius: 8px; background: #ffffff; box-shadow: 0 16px 34px rgba(7, 27, 47, .22); }
body.weldgrid-shell .wg-annotation-context-menu button, body.weldgrid-shell .wg-spool-context-menu button { display: flex; align-items: center; gap: 9px; width: 100%; padding: 9px 10px; border: 0; border-radius: 6px; background: transparent; color: #0d2d4b; font-size: 13px; font-weight: 900; text-align: left; }
body.weldgrid-shell .wg-annotation-context-menu button:hover, body.weldgrid-shell .wg-annotation-context-menu button:focus, body.weldgrid-shell .wg-spool-context-menu button:hover, body.weldgrid-shell .wg-spool-context-menu button:focus { background: #eef6fb; color: #d6560f; outline: none; }
body.weldgrid-shell .wg-annotation-context-menu button.danger, body.weldgrid-shell .wg-spool-context-menu button.danger { color: #dc2626; }
body.weldgrid-shell .wg-annotation-context-menu button.danger:hover, body.weldgrid-shell .wg-spool-context-menu button.danger:hover { background: #fff1f2; color: #b91c1c; }
body.weldgrid-shell .wg-annotation-context-menu button[data-action="create_here"], body.weldgrid-shell .wg-annotation-context-menu button[data-action="create_spool_here"] { color: #c2460c; }
body.weldgrid-shell .wg-annotation-context-menu button[data-action="create_here"]:hover, body.weldgrid-shell .wg-annotation-context-menu button[data-action="create_spool_here"]:hover { background: #fff3ea; }

/* WeldGrid Spool Create Assignment */
body.weldgrid-shell .wg-spool-create-assignment { grid-column: 1 / -1; display: grid; gap: 10px; padding: 12px; border: 1px solid #cbdcea; border-radius: 8px; background: #f8fbfd; }
body.weldgrid-shell .wg-spool-create-assignment-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
body.weldgrid-shell .wg-spool-create-assignment-head h3 { margin: 0; color: #08243d; font-size: 15px; font-weight: 950; }
body.weldgrid-shell .wg-spool-create-assignment-head span { color: #60758a; font-size: 12px; font-weight: 900; }
body.weldgrid-shell .wg-spool-assignment-tools { display: grid; grid-template-columns: minmax(0, 1fr) minmax(180px, .72fr) auto; gap: 8px; align-items: center; }
body.weldgrid-shell .wg-spool-assignment-tools .swal2-input, body.weldgrid-shell .wg-spool-assignment-tools .swal2-select { width: 100%; margin: 0; min-height: 38px; }
body.weldgrid-shell .wg-spool-transfer-check { display: inline-flex !important; grid-template-columns: none !important; align-items: center; gap: 7px; color: #0d2d4b; white-space: nowrap; }
body.weldgrid-shell .wg-spool-assignment-warning { padding: 9px 10px; border: 1px solid rgba(245, 158, 11, .35); border-radius: 7px; background: rgba(245, 158, 11, .1); color: #92400e; font-size: 12px; font-weight: 850; }
body.weldgrid-shell .wg-spool-assignment-list { display: grid; gap: 7px; max-height: 250px; overflow: auto; padding-right: 3px; }
body.weldgrid-shell .wg-spool-assignment-row { display: grid !important; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 9px; margin: 0; padding: 9px; border: 1px solid rgba(12, 46, 76, .12); border-radius: 8px; background: #ffffff; }
body.weldgrid-shell .wg-spool-assignment-row.has-spool { border-color: rgba(245, 158, 11, .34); background: #fffaf0; }
body.weldgrid-shell .wg-spool-assignment-main { display: grid; gap: 2px; min-width: 0; }
body.weldgrid-shell .wg-spool-assignment-main strong { overflow: hidden; color: #08243d; font-size: 13px; font-weight: 950; text-overflow: ellipsis; white-space: nowrap; }
body.weldgrid-shell .wg-spool-assignment-main small { overflow: hidden; color: #60758a; font-size: 11px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
body.weldgrid-shell .wg-spool-assignment-row em { color: #64748b; font-size: 11px; font-style: normal; font-weight: 900; white-space: nowrap; }
body.weldgrid-shell .wg-spool-assignment-empty { padding: 18px; border: 1px dashed #cbdcea; border-radius: 8px; color: #60758a; text-align: center; font-size: 13px; font-weight: 850; }
body.weldgrid-shell .wg-spool-assignment-empty.is-error { border-color: rgba(220, 38, 38, .35); color: #b91c1c; background: rgba(220, 38, 38, .06); }
body.weldgrid-shell .wg-spool-placement-note { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; padding: 9px 10px; border: 1px solid rgba(20, 184, 166, .3); border-radius: 7px; background: rgba(20, 184, 166, .08); color: #0f766e; font-size: 12px; font-weight: 900; }
@media (max-width: 760px) { body.weldgrid-shell .wg-spool-assignment-tools { grid-template-columns: 1fr; } }

/* WeldGrid Live Label Style Preview */
body.weldgrid-shell .wg-live-label-preview { grid-column: 1 / -1; position: relative; display: flex; align-items: center; justify-content: center; min-height: 92px; overflow: hidden; border: 1px solid #cbdcea; border-radius: 8px; background: #ffffff; }
body.weldgrid-shell .wg-live-label-preview-area { position: absolute; inset: 14px; border: 2px dashed var(--wg-spool-preview-color, #ff6a1a); border-radius: 8px; background: var(--wg-spool-preview-area, rgba(255, 106, 26, .12)); }
body.weldgrid-shell .wg-live-label-preview .wg-spool-overlay-label { position: relative !important; left: auto !important; top: auto !important; z-index: 2; min-width: 118px; transform: none !important; cursor: default; --wg-spool-fill-color: var(--wg-spool-preview-fill, #ff6a1a); --wg-spool-border-color: var(--wg-spool-preview-color, #ff6a1a); --wg-spool-text-color: var(--wg-spool-preview-text, #ffffff); }
body.weldgrid-shell .wg-live-label-preview[data-fill-mode="transparent"] .wg-spool-overlay-label { background: transparent !important; }
body.weldgrid-shell .wg-spool-editor-form .wg-spool-inline-color { min-height: 42px; padding: 4px; }

/* WeldGrid Excel Export Active Setting */
body.weldgrid-shell .wg-excel-active-setting { margin: 0 0 16px; border: 1px solid var(--wg-border); border-radius: 8px; background: #fff; padding: 14px; box-shadow: 0 10px 24px rgba(12, 46, 76, .06); }
body.weldgrid-shell .wg-excel-active-setting-main { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
body.weldgrid-shell .wg-excel-active-setting-main h3 { margin: 0 0 4px; color: var(--wg-navy); font-size: 1.02rem; font-weight: 950; }
body.weldgrid-shell .wg-excel-active-setting-main p { margin: 0; color: var(--wg-muted); font-weight: 700; }
body.weldgrid-shell .wg-excel-active-setting-badge { display: inline-flex; align-items: center; justify-content: center; min-height: 28px; border-radius: 999px; padding: 5px 10px; font-size: .78rem; font-weight: 950; white-space: nowrap; }
body.weldgrid-shell .wg-excel-active-setting-badge.is-ready { color: #047857; background: rgba(16, 185, 129, .13); }
body.weldgrid-shell .wg-excel-active-setting-badge.is-missing { color: #b45309; background: rgba(245, 158, 11, .16); }
body.weldgrid-shell .wg-excel-active-setting-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
body.weldgrid-shell .wg-excel-active-setting-grid div { border: 1px solid rgba(12, 46, 76, .1); border-radius: 8px; background: #f8fbfd; padding: 10px; min-width: 0; }
body.weldgrid-shell .wg-excel-active-setting-grid span { display: block; margin-bottom: 3px; color: var(--wg-muted); font-size: .76rem; font-weight: 900; }
body.weldgrid-shell .wg-excel-active-setting-grid strong { display: block; overflow: hidden; color: var(--wg-navy); font-weight: 950; text-overflow: ellipsis; white-space: nowrap; }
body.weldgrid-shell .wg-excel-active-setting-missing { display: grid; gap: 5px; margin: 10px 0 0; padding-left: 18px; color: #92400e; font-weight: 800; }
body.weldgrid-shell .wg-excel-active-setting-selection { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 12px; border: 1px dashed rgba(12, 46, 76, .18); border-radius: 8px; background: #fbfdff; padding: 10px; color: var(--wg-text); font-weight: 800; }
body.weldgrid-shell .wg-excel-active-setting-selection span { border-radius: 999px; padding: 4px 8px; font-size: .76rem; font-weight: 950; }
body.weldgrid-shell .wg-excel-active-setting-selection span.is-active { color: #047857; background: rgba(16, 185, 129, .13); }
body.weldgrid-shell .wg-excel-active-setting-selection span.is-inactive { color: #b45309; background: rgba(245, 158, 11, .16); }
body.weldgrid-shell .wg-excel-active-setting-selection small { color: var(--wg-muted); font-weight: 800; }
body.weldgrid-shell .wg-excel-active-setting-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
body.weldgrid-shell .wg-excel-active-setting-actions .wg-btn:disabled { opacity: .55; cursor: not-allowed; }

/* WeldGrid Excel Mapping Compact Fallback */
body.weldgrid-shell .wg-cleaning-compact { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; grid-column: 1 / -1; border: 1px solid var(--wg-border); border-radius: 8px; background: #f8fbfd; padding: 12px; }
body.weldgrid-shell .wg-cleaning-compact .form-label { margin-bottom: 5px; color: #17324d; font-size: 12px; font-weight: 900; }
body.weldgrid-shell .wg-cleaning-compact .form-control:disabled { color: #94a3b8; background: #eef3f7; cursor: not-allowed; }
body.weldgrid-shell .wg-selected-target-main { min-width: 0; flex: 1 1 auto; }
body.weldgrid-shell .wg-selected-target-controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
body.weldgrid-shell .wg-excel-selected-target .wg-excel-active-toggle { align-self: center; border: 1px solid rgba(12, 46, 76, .12); border-radius: 999px; background: #f8fbfd; padding: 5px 9px; }

/* WeldGrid Excel Mapping Clear Button */
body.weldgrid-shell .wg-target-clear { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border: 1px solid rgba(12, 46, 76, .14); border-radius: 7px; color: var(--wg-cyan); background: #fff; pointer-events: auto; }
body.weldgrid-shell .wg-target-clear:not(.is-disabled):hover { border-color: rgba(255, 106, 26, .45); color: var(--wg-orange); background: rgba(255, 106, 26, .08); }
body.weldgrid-shell .wg-target-clear.is-disabled { opacity: .4; color: #94a3b8; cursor: not-allowed; }
body.weldgrid-shell .wg-target-clear-button { display: inline-flex; align-items: center; gap: 6px; min-height: 30px; border: 1px solid rgba(12, 46, 76, .14); border-radius: 8px; background: #fff; color: var(--wg-navy); padding: 5px 9px; font-weight: 900; }
body.weldgrid-shell .wg-target-clear-button:not(:disabled):hover { border-color: rgba(255, 106, 26, .45); color: var(--wg-orange); background: rgba(255, 106, 26, .08); }
body.weldgrid-shell .wg-target-clear-button:disabled { opacity: .5; color: #94a3b8; cursor: not-allowed; }
@media  (max-width: 1100px) { body.weldgrid-shell .wg-excel-active-setting-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) { body.weldgrid-shell .wg-excel-active-setting-grid, body.weldgrid-shell .wg-cleaning-compact { grid-template-columns: 1fr; } body.weldgrid-shell .wg-excel-active-setting-main, body.weldgrid-shell .wg-excel-active-setting-actions { align-items: stretch; flex-direction: column; } }

/* WeldGrid Excel Real Preview */
body.weldgrid-shell .wg-excel-preview-summary { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0 0 10px; }
body.weldgrid-shell .wg-excel-preview-summary span { display: inline-flex; align-items: center; gap: 4px; border: 1px solid rgba(12, 46, 76, .1); border-radius: 999px; background: #f8fbfd; color: var(--wg-muted); padding: 5px 9px; font-size: .8rem; font-weight: 850; }
body.weldgrid-shell .wg-excel-preview-summary strong { color: var(--wg-navy); font-weight: 950; }
body.weldgrid-shell .wg-excel-preview-table-scroll { overflow: auto; border: 1px solid rgba(12, 46, 76, .12); border-radius: 8px; background: #fff; max-height: 520px; }
body.weldgrid-shell .wg-excel-preview-table { width: max-content; min-width: 100%; border-collapse: separate; border-spacing: 0; }
body.weldgrid-shell .wg-excel-preview-table th { position: sticky; top: 0; z-index: 2; border-right: 1px solid rgba(12, 46, 76, .1); border-bottom: 1px solid rgba(12, 46, 76, .12); background: #f2f7fb; color: var(--wg-navy); padding: 8px 10px; text-align: left; white-space: nowrap; }
body.weldgrid-shell .wg-excel-preview-table tr:nth-child(2) th { top: 34px; }
body.weldgrid-shell .wg-excel-preview-table td { min-width: 110px; border-right: 1px solid rgba(12, 46, 76, .08); border-bottom: 1px solid rgba(12, 46, 76, .08); padding: 8px 10px; color: var(--wg-text); background: #fff; vertical-align: top; white-space: nowrap; }
body.weldgrid-shell .wg-excel-preview-table .wg-preview-letter { min-width: 70px; color: #52677f; font-size: .78rem; font-weight: 950; text-align: center; }
body.weldgrid-shell .wg-excel-preview-table .wg-preview-heading strong { display: block; font-size: .84rem; font-weight: 950; }
body.weldgrid-shell .wg-excel-preview-table .wg-preview-heading small { display: block; margin-top: 2px; color: var(--wg-muted); font-size: .68rem; font-weight: 850; }
body.weldgrid-shell .wg-excel-preview-table .is-formula { background: rgba(124, 58, 237, .06); color: #4c1d95; }
body.weldgrid-shell .wg-excel-preview-table .is-auto { background: rgba(14, 165, 233, .08); }
body.weldgrid-shell .wg-excel-preview-table .is-empty { color: #94a3b8; background: #fbfdff; }
body.weldgrid-shell .wg-preview-notices { display: grid; gap: 6px; margin: 0 0 10px; }
body.weldgrid-shell .wg-preview-notices span { display: block; border: 1px solid rgba(14, 165, 233, .22); border-radius: 8px; background: rgba(14, 165, 233, .08); color: #075985; padding: 8px 10px; font-weight: 850; }

/* WeldGrid Export Active Template Status */
body.weldgrid-shell .wg-export-setting-card { display: grid; gap: 10px; margin: 14px 0; border: 1px solid rgba(12, 46, 76, .12); border-radius: 8px; background: #f8fbfd; padding: 12px; }
body.weldgrid-shell .wg-export-setting-card p { margin: 0; color: var(--wg-muted); font-weight: 800; }
body.weldgrid-shell .wg-export-setting-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
body.weldgrid-shell .wg-export-setting-head strong { display: block; color: var(--wg-navy); font-weight: 950; }
body.weldgrid-shell .wg-export-setting-head span { display: block; margin-top: 3px; color: var(--wg-muted); font-size: .82rem; font-weight: 800; }
body.weldgrid-shell .wg-export-setting-head em, body.weldgrid-shell .wg-export-setting-state { border-radius: 999px; padding: 5px 9px; font-size: .74rem; font-style: normal; font-weight: 950; white-space: nowrap; }
body.weldgrid-shell .wg-export-setting-head em.is-ready { color: #047857; background: rgba(16, 185, 129, .13); }
body.weldgrid-shell .wg-export-setting-head em.is-missing, body.weldgrid-shell .wg-export-setting-state.is-missing { color: #b45309; background: rgba(245, 158, 11, .16); }
body.weldgrid-shell .wg-export-setting-grid { display: grid; gap: 7px; }
body.weldgrid-shell .wg-export-setting-grid div { min-width: 0; border: 1px solid rgba(12, 46, 76, .1); border-radius: 7px; background: #fff; padding: 8px; }
body.weldgrid-shell .wg-export-setting-grid span { display: block; margin-bottom: 2px; color: var(--wg-muted); font-size: .72rem; font-weight: 900; }
body.weldgrid-shell .wg-export-setting-grid strong { display: block; overflow: hidden; color: var(--wg-navy); font-size: .84rem; font-weight: 950; text-overflow: ellipsis; white-space: nowrap; }
body.weldgrid-shell .wg-export-setting-card ul { display: grid; gap: 4px; margin: 0; padding-left: 18px; color: #92400e; font-size: .82rem; font-weight: 850; }
body.weldgrid-shell .wg-export-option:disabled, body.weldgrid-shell .wg-export-option.is-disabled { opacity: .55; cursor: not-allowed; }
body.weldgrid-shell .wg-export-warning-list { display: grid; gap: 7px; margin: 12px 0; }
body.weldgrid-shell .wg-export-warning-list div { display: flex; gap: 8px; align-items: flex-start; border: 1px solid rgba(245, 158, 11, .35); border-radius: 8px; background: rgba(245, 158, 11, .09); color: #92400e; padding: 9px; font-size: .84rem; font-weight: 850; }
body.weldgrid-shell .wg-export-history-meta { display: block; margin-top: 3px; color: var(--wg-muted); font-size: .75rem; font-weight: 800; }

/* =========================================================
   WeldGrid Export Progress Modal
========================================================= */
body.weldgrid-shell .wg-export-progress-modal[hidden] { display: none !important; }
body.weldgrid-shell .wg-export-progress-modal { position: fixed; inset: 0; z-index: 10080; display: grid; place-items: center; padding: 22px; }
body.weldgrid-shell .wg-export-progress-backdrop { position: absolute; inset: 0; background: rgba(7, 27, 47, .56); backdrop-filter: blur(3px); }
body.weldgrid-shell .wg-export-progress-dialog { position: relative; z-index: 1; display: grid; gap: 16px; width: min(720px, 100%); max-height: min(760px, calc(100vh - 44px)); overflow: auto; border: 1px solid rgba(255, 255, 255, .4); border-radius: 8px; background: #ffffff; box-shadow: 0 26px 70px rgba(7, 27, 47, .34); padding: 22px; }
body.weldgrid-shell .wg-export-progress-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
body.weldgrid-shell .wg-export-progress-head span { display: block; margin-bottom: 4px; color: var(--wg-orange); font-size: .74rem; font-weight: 950; letter-spacing: .12em; }
body.weldgrid-shell .wg-export-progress-head h2 { margin: 0; color: var(--wg-navy); font-size: 1.25rem; font-weight: 950; }
body.weldgrid-shell .wg-export-progress-head p { margin: 5px 0 0; color: var(--wg-muted); font-weight: 800; }
body.weldgrid-shell .wg-export-progress-head strong { flex: 0 0 auto; min-width: 64px; border-radius: 999px; background: #eef6fb; color: var(--wg-cyan); padding: 7px 10px; text-align: center; font-size: .9rem; font-weight: 950; }
body.weldgrid-shell .wg-export-progress-track { height: 12px; overflow: hidden; border-radius: 999px; background: #dbe7f0; box-shadow: inset 0 1px 2px rgba(7, 27, 47, .14); }
body.weldgrid-shell .wg-export-progress-track span { display: block; width: 0%; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--wg-orange), #14b8a6); box-shadow: 0 0 18px rgba(255, 106, 26, .32); transition: width .22s ease; }
body.weldgrid-shell .wg-export-progress-modal[data-state="failed"] .wg-export-progress-track span { background: linear-gradient(90deg, #dc2626, #f97316); }
body.weldgrid-shell .wg-export-progress-modal[data-state="done"] .wg-export-progress-track span { background: linear-gradient(90deg, #16a34a, #0f766e); }
body.weldgrid-shell .wg-export-progress-modal[data-state="confirmation"] .wg-export-progress-track span { background: linear-gradient(90deg, var(--wg-orange), #f59e0b); }
body.weldgrid-shell .wg-export-progress-modal[data-state="confirmation"] .wg-export-progress-head strong { background: #fff7ed; color: #c2410c; }
body.weldgrid-shell .wg-export-progress-modal[data-state="confirmation"] .wg-export-progress-warnings { border-color: rgba(249, 115, 22, .34); background: #fff7ed; color: #9a3412; }
body.weldgrid-shell .wg-export-progress-steps { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
body.weldgrid-shell .wg-export-progress-steps div { display: flex; align-items: center; gap: 9px; min-width: 0; border: 1px solid rgba(12, 46, 76, .1); border-radius: 8px; background: #f8fbfd; color: var(--wg-muted); padding: 9px 10px; font-size: .84rem; font-weight: 850; }
body.weldgrid-shell .wg-export-progress-steps div i { flex: 0 0 auto; color: #94a3b8; font-size: 16px; }
body.weldgrid-shell .wg-export-progress-steps div span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.weldgrid-shell .wg-export-progress-steps div.is-active { border-color: rgba(255, 106, 26, .35); background: #fff8f3; color: var(--wg-navy); }
body.weldgrid-shell .wg-export-progress-steps div.is-active i { color: var(--wg-orange); animation: wg-export-spin 1s linear infinite; }
body.weldgrid-shell .wg-export-progress-steps div.is-done { border-color: rgba(22, 163, 74, .24); background: #f3fbf6; color: #047857; }
body.weldgrid-shell .wg-export-progress-steps div.is-done i { color: #16a34a; }
body.weldgrid-shell .wg-export-progress-steps div.is-error { border-color: rgba(220, 38, 38, .28); background: #fff7f7; color: #b91c1c; }
body.weldgrid-shell .wg-export-progress-steps div.is-error i { color: #dc2626; animation: none; }
body.weldgrid-shell .wg-export-progress-warnings { display: grid; gap: 7px; border: 1px solid rgba(245, 158, 11, .3); border-radius: 8px; background: #fffaf0; color: #92400e; padding: 12px; font-size: .84rem; font-weight: 850; }
body.weldgrid-shell .wg-export-progress-warnings strong { color: #78350f; font-weight: 950; }
body.weldgrid-shell .wg-export-progress-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }
@keyframes wg-export-spin { to { transform: rotate(360deg); } }
@media (max-width: 680px) {
    body.weldgrid-shell .wg-export-progress-modal { padding: 12px; }
    body.weldgrid-shell .wg-export-progress-dialog { padding: 16px; }
    body.weldgrid-shell .wg-export-progress-head { flex-direction: column; }
    body.weldgrid-shell .wg-export-progress-steps { grid-template-columns: 1fr; }
    body.weldgrid-shell .wg-export-progress-actions { justify-content: stretch; }
    body.weldgrid-shell .wg-export-progress-actions .wg-btn { width: 100%; justify-content: center; }
}

/* WeldGrid Excel Mapping Validation Warnings */
body.weldgrid-shell .wg-target-warning { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; flex: 0 0 auto; border: 1px solid rgba(245, 158, 11, .42); border-radius: 999px; background: #fff7ed; color: #d97706; font-size: 14px; cursor: help; }
body.weldgrid-shell .wg-excel-target-row.is-warning { border-color: rgba(245, 158, 11, .48); background: #fffbeb; }
body.weldgrid-shell .wg-excel-target-row.is-warning .wg-target-status { background: #fff7ed; color: #b45309; }
body.weldgrid-shell .wg-excel-target-row.is-error { border-color: rgba(239, 68, 68, .5); }

body.weldgrid-shell .wg-excel-target-searchbar { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px; align-items: center; margin: 0 0 10px; }
body.weldgrid-shell .wg-excel-search-box { display: flex; align-items: center; gap: 8px; min-width: 0; min-height: 38px; margin: 0; border: 1px solid #cbdcea; border-radius: 8px; background: #ffffff; color: var(--wg-muted); padding: 0 10px; }
body.weldgrid-shell .wg-excel-search-box i { flex: 0 0 auto; color: #60758a; font-size: 15px; }
body.weldgrid-shell .wg-excel-search-box input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--wg-navy); font-size: 12px; font-weight: 850; }
body.weldgrid-shell #wgTargetColumnSearchCount { justify-self: end; color: #60758a; font-size: 11px; font-weight: 900; white-space: nowrap; }
body.weldgrid-shell .wg-excel-source-library-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
body.weldgrid-shell .wg-excel-source-library-head h3 { margin: 0; color: var(--wg-navy); font-size: 15px; font-weight: 950; }
body.weldgrid-shell .wg-excel-source-library-head p { margin: 2px 0 0; color: var(--wg-muted); font-size: 12px; font-weight: 750; }
body.weldgrid-shell .wg-excel-source-searchbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; margin-bottom: 7px; }
body.weldgrid-shell .wg-excel-source-search-count { margin: 0 0 9px; color: #60758a; font-size: 11px; font-weight: 900; }
body.weldgrid-shell .wg-excel-preview-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
body.weldgrid-shell .wg-excel-preview-card.is-dirty .wg-excel-preview-status { border: 1px solid rgba(245, 158, 11, .35); border-radius: 8px; background: #fff7ed; color: #92400e; padding: 8px 10px; }
body.weldgrid-shell #wgRefreshMappingPreview.is-active { box-shadow: 0 0 0 3px rgba(255, 106, 26, .16); }
@media (max-width: 760px) { body.weldgrid-shell .wg-excel-target-searchbar { grid-template-columns: 1fr; } }
@media (max-width: 760px) { body.weldgrid-shell #wgTargetColumnSearchCount { justify-self: start; } }
@media (max-width: 760px) { body.weldgrid-shell .wg-excel-source-searchbar { grid-template-columns: 1fr; } }
body.weldgrid-shell .wg-selected-target-controls .wg-target-warning { margin-left: 2px; }
body.weldgrid-shell .wg-rule-validation-note { display: flex; align-items: flex-start; gap: 8px; border-color: rgba(245, 158, 11, .36); background: #fff7ed; color: #92400e; }
body.weldgrid-shell .wg-rule-validation-note i { flex: 0 0 auto; margin-top: 1px; color: #d97706; }

/* WeldGrid Excel Mapping Preview Fixes */
body.weldgrid-shell .wg-preview-warnings { display: grid; gap: 6px; margin: 0 0 10px; }
body.weldgrid-shell .wg-preview-warnings span { display: block; border: 1px solid rgba(245, 158, 11, .35); border-radius: 8px; background: #fff7ed; color: #92400e; padding: 8px 10px; font-weight: 850; }
body.weldgrid-shell .wg-excel-preview-table .is-warning { background: #fffbeb; color: #92400e; }
body.weldgrid-shell .wg-excel-preview-table th.is-warning { border-bottom-color: rgba(245, 158, 11, .35); }
body.weldgrid-shell .wg-excel-preview-table td.is-warning { box-shadow: inset 0 0 0 1px rgba(245, 158, 11, .18); }
/* =========================================================
   WeldGrid Export History Cleanup
========================================================= */
body.weldgrid-shell .wg-export-option em {
    display: inline-flex;
    align-items: center;
    margin-left: 6px;
    border-radius: 999px;
    background: rgba(245, 158, 11, .16);
    color: #92400e;
    padding: 2px 6px;
    font-size: .68rem;
    font-style: normal;
    font-weight: 950;
}
body.weldgrid-shell .wg-export-warning-list[data-level="error"] div {
    border-color: rgba(220, 38, 38, .32);
    background: #fff7f7;
    color: #b91c1c;
}
body.weldgrid-shell .wg-export-file-name {
    display: block;
    color: var(--wg-navy);
    font-weight: 900;
}
body.weldgrid-shell .wg-export-warning-badge {
    display: inline-flex;
    margin-top: 5px;
    border-radius: 999px;
    background: #fff7ed;
    color: #b45309;
    padding: 4px 7px;
    font-size: .72rem;
    font-weight: 900;
}
body.weldgrid-shell .wg-export-actions {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}
body.weldgrid-shell .wg-icon-btn.is-disabled {
    opacity: .45;
    pointer-events: none;
}
body.weldgrid-shell .wg-export-preview-modal[hidden] {
    display: none !important;
}
body.weldgrid-shell .wg-export-preview-modal {
    position: fixed;
    inset: 0;
    z-index: 10085;
    display: grid;
    place-items: center;
    padding: 22px;
}
body.weldgrid-shell .wg-export-preview-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(7, 27, 47, .56);
    backdrop-filter: blur(3px);
}
body.weldgrid-shell .wg-export-preview-dialog {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 14px;
    width: min(980px, 100%);
    max-height: min(820px, calc(100vh - 44px));
    border: 1px solid rgba(255,255,255,.38);
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 26px 70px rgba(7, 27, 47, .34);
    padding: 18px;
}
body.weldgrid-shell .wg-export-preview-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}
body.weldgrid-shell .wg-export-preview-head span {
    display: block;
    margin-bottom: 4px;
    color: var(--wg-orange);
    font-size: .72rem;
    font-weight: 950;
    letter-spacing: .12em;
}
body.weldgrid-shell .wg-export-preview-head h2 {
    margin: 0;
    color: var(--wg-navy);
    font-size: 1.1rem;
    font-weight: 950;
}
body.weldgrid-shell .wg-export-preview-head p {
    margin: 4px 0 0;
    color: var(--wg-muted);
    font-weight: 800;
}
body.weldgrid-shell .wg-export-preview-body {
    min-height: 260px;
    overflow: auto;
    border: 1px solid rgba(12, 46, 76, .1);
    border-radius: 8px;
    background: #f8fbfd;
    padding: 12px;
}
body.weldgrid-shell .wg-export-preview-frame {
    display: block;
    width: 100%;
    height: min(680px, calc(100vh - 210px));
    border: 0;
    border-radius: 7px;
    background: #ffffff;
}
body.weldgrid-shell .wg-export-preview-section {
    display: grid;
    gap: 8px;
    margin-bottom: 12px;
}
body.weldgrid-shell .wg-export-preview-section h3 {
    margin: 0;
    color: var(--wg-navy);
    font-size: .95rem;
    font-weight: 950;
}
body.weldgrid-shell .wg-export-preview-table-wrap {
    overflow: auto;
    border: 1px solid rgba(12, 46, 76, .12);
    border-radius: 7px;
    background: #ffffff;
}
body.weldgrid-shell .wg-export-preview-table td {
    min-width: 110px;
    font-size: .78rem;
    white-space: nowrap;
}
body.weldgrid-shell .wg-export-preview-files {
    display: grid;
    gap: 7px;
    margin: 0;
    padding: 0;
    list-style: none;
}
body.weldgrid-shell .wg-export-preview-files li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border: 1px solid rgba(12, 46, 76, .1);
    border-radius: 7px;
    background: #fff;
    padding: 9px 10px;
    color: var(--wg-navy);
    font-weight: 850;
}
body.weldgrid-shell .wg-export-preview-files em {
    color: var(--wg-muted);
    font-style: normal;
    font-size: .78rem;
    font-weight: 850;
}
body.weldgrid-shell .wg-export-preview-json {
    margin: 0;
    overflow: auto;
    color: #17324d;
    font-size: .78rem;
    white-space: pre-wrap;
}

body.weldgrid-shell .wg-export-preview-head > div {
    min-width: 0;
}
body.weldgrid-shell .wg-export-preview-head .wg-btn-sm {
    align-self: flex-start;
    min-height: 36px;
    padding: 7px 11px;
    font-size: .82rem;
    white-space: nowrap;
}
body.weldgrid-shell .wg-export-preview-loading,
body.weldgrid-shell .wg-export-preview-error {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 210px;
    border: 1px dashed rgba(12, 46, 76, .16);
    border-radius: 8px;
    background: #ffffff;
    color: var(--wg-muted);
    font-weight: 850;
    text-align: center;
}
body.weldgrid-shell .wg-export-preview-loading i {
    color: var(--wg-orange);
    font-size: 1.2rem;
    animation: wgSpin 1s linear infinite;
}
body.weldgrid-shell .wg-export-preview-error {
    justify-content: flex-start;
    align-items: flex-start;
    min-height: 0;
    border-color: rgba(220, 38, 38, .25);
    background: #fff7f7;
    color: #7f1d1d;
    padding: 14px;
    text-align: left;
}
body.weldgrid-shell .wg-export-preview-error i {
    color: #dc2626;
    font-size: 1.25rem;
    line-height: 1.35;
}
body.weldgrid-shell .wg-export-preview-error strong {
    display: block;
    color: #7f1d1d;
    font-weight: 950;
}
body.weldgrid-shell .wg-export-preview-error p {
    margin: 4px 0 10px;
    color: #8f3333;
}
body.weldgrid-shell .wg-export-preview-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-bottom: 10px;
}
body.weldgrid-shell .wg-export-preview-tab {
    border: 1px solid rgba(12, 46, 76, .14);
    border-radius: 999px;
    background: #ffffff;
    color: var(--wg-navy);
    padding: 7px 11px;
    font-size: .8rem;
    font-weight: 950;
}
body.weldgrid-shell .wg-export-preview-tab.is-active {
    border-color: var(--wg-orange);
    background: #fff7ed;
    color: #c2410c;
}
body.weldgrid-shell .wg-export-preview-section[hidden] {
    display: none !important;
}


body.weldgrid-shell .wg-mapping-help,
body.weldgrid-shell .wg-system-sheet-note {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    border: 1px solid rgba(14, 116, 144, .2);
    border-radius: 8px;
    background: #ecfeff;
    color: #17415f;
    padding: 10px 12px;
    font-size: .86rem;
    font-weight: 800;
    line-height: 1.45;
}

body.weldgrid-shell .wg-mapping-help {
    margin: 14px 0;
}

body.weldgrid-shell .wg-system-sheet-note {
    margin: 0 0 10px;
}

body.weldgrid-shell .wg-mapping-help i,
body.weldgrid-shell .wg-system-sheet-note i {
    color: #0e7490;
    font-size: 1.05rem;
    line-height: 1.35;
}

body.weldgrid-shell .wg-mapping-help strong {
    color: var(--wg-navy);
}


/* =========================================================
   WeldGrid Settings Excel Mapping UX Refactor
========================================================= */
body.weldgrid-shell .wg-settings-page .wg-excel-builder-card {
    overflow: visible;
}

body.weldgrid-shell .wg-settings-page .wg-excel-builder-actions {
    align-items: center;
    gap: 8px;
}

body.weldgrid-shell .wg-autosave-indicator {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 36px;
    border: 1px solid rgba(12, 46, 76, .12);
    border-radius: 999px;
    background: #f8fbfd;
    color: var(--wg-muted);
    padding: 7px 11px;
    font-size: .8rem;
    font-weight: 900;
    white-space: nowrap;
}

body.weldgrid-shell .wg-autosave-indicator.is-saving {
    border-color: rgba(255, 106, 26, .35);
    background: #fff7ed;
    color: #c2410c;
}

body.weldgrid-shell .wg-autosave-indicator.is-dirty {
    border-color: rgba(245, 158, 11, .28);
    background: #fffbeb;
    color: #92400e;
}

body.weldgrid-shell .wg-autosave-indicator.is-saved,
body.weldgrid-shell .wg-autosave-indicator.is-idle {
    border-color: rgba(16, 185, 129, .22);
    background: #ecfdf5;
    color: #047857;
}

body.weldgrid-shell .wg-autosave-indicator.is-error {
    border-color: rgba(220, 38, 38, .28);
    background: #fff7f7;
    color: #b91c1c;
}


body.weldgrid-shell .wg-excel-builder-card {
    position: relative;
}

body.weldgrid-shell .wg-mapping-loading-overlay[hidden] {
    display: none !important;
}

body.weldgrid-shell .wg-mapping-loading-overlay {
    position: absolute;
    inset: 82px 14px 14px;
    z-index: 30;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 18px;
    background: rgba(246, 251, 255, .72);
    backdrop-filter: blur(1.5px);
    pointer-events: none;
}

body.weldgrid-shell .wg-mapping-loading-card {
    width: min(520px, 100%);
    border: 1px solid rgba(11, 95, 143, .22);
    border-radius: 8px;
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 18px 42px rgba(8, 35, 58, .14);
    padding: 14px 16px;
}

body.weldgrid-shell .wg-mapping-loading-title {
    display: flex;
    align-items: center;
    gap: 9px;
    color: var(--wg-navy);
    font-size: .9rem;
    font-weight: 900;
}

body.weldgrid-shell .wg-mapping-loading-title i {
    color: #ff5f1f;
    animation: wgSpin 1s linear infinite;
}

body.weldgrid-shell .wg-mapping-loading-track {
    position: relative;
    overflow: hidden;
    height: 8px;
    margin-top: 12px;
    border-radius: 999px;
    background: #e8f4fb;
}

body.weldgrid-shell .wg-mapping-loading-track span {
    position: absolute;
    inset: 0 auto 0 0;
    width: 48%;
    border-radius: inherit;
    background: linear-gradient(90deg, #ff5f1f 0%, #0b5f8f 50%, #ff5f1f 100%);
    animation: wgMappingLoadingSlide 1.15s ease-in-out infinite;
}

body.weldgrid-shell .wg-mapping-editor-workspace.is-loading {
    min-height: 280px;
}

body.weldgrid-shell .wg-excel-preview-card.is-loading .wg-excel-preview-table-scroll,
body.weldgrid-shell .wg-excel-preview-card.is-loading .wg-excel-preview-tabs,
body.weldgrid-shell .wg-excel-preview-card.is-loading .wg-excel-preview-summary {
    opacity: .5;
}

@keyframes wgMappingLoadingSlide {
    0% { transform: translateX(-110%); }
    52% { transform: translateX(72%); }
    100% { transform: translateX(220%); }
}

body.weldgrid-shell .wg-project-empty-state {
    display: grid;
    place-items: center;
    gap: 8px;
    min-height: 220px;
    border: 1px dashed rgba(12, 46, 76, .22);
    border-radius: 8px;
    background: #fbfdff;
    color: var(--wg-muted);
    padding: 28px;
    text-align: center;
}

body.weldgrid-shell .wg-project-empty-state[hidden],
body.weldgrid-shell .wg-mapping-editor-workspace[hidden],
body.weldgrid-shell .wg-excel-preview-card[hidden],
body.weldgrid-shell .wg-management-modal[hidden] {
    display: none !important;
}

body.weldgrid-shell .wg-project-empty-state i {
    display: grid;
    place-items: center;
    width: 54px;
    height: 54px;
    border-radius: 8px;
    background: #eaf4fb;
    color: #147ca8;
    font-size: 1.5rem;
}

body.weldgrid-shell .wg-project-empty-state strong {
    color: var(--wg-navy);
    font-size: 1rem;
    font-weight: 950;
}

body.weldgrid-shell .wg-project-empty-state span {
    max-width: 620px;
    font-weight: 750;
}

body.weldgrid-shell .wg-excel-active-setting {
    display: grid;
    gap: 9px;
    margin: 0 0 12px;
    padding: 11px 12px;
}

body.weldgrid-shell .wg-excel-active-setting-main {
    align-items: center;
    margin-bottom: 0;
}

body.weldgrid-shell .wg-excel-active-setting-main h3 {
    font-size: .98rem;
}

body.weldgrid-shell .wg-excel-active-setting-main p {
    font-size: .84rem;
}

body.weldgrid-shell .wg-excel-active-setting-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

body.weldgrid-shell .wg-excel-active-setting-grid div {
    padding: 8px 9px;
}

body.weldgrid-shell .wg-excel-active-setting-actions {
    margin-top: 0;
}

body.weldgrid-shell .wg-editor-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 0 0 12px;
    border: 1px solid rgba(12, 46, 76, .1);
    border-radius: 8px;
    background: #ffffff;
    padding: 9px 10px;
}

body.weldgrid-shell .wg-editor-toolbar-main {
    display: flex;
    align-items: center;
    gap: 7px;
    flex-wrap: wrap;
}

body.weldgrid-shell .wg-editor-toolbar-note {
    color: var(--wg-muted);
    font-size: .8rem;
    font-weight: 850;
}

body.weldgrid-shell .wg-management-modal {
    position: fixed;
    inset: 0;
    z-index: 20020;
    display: grid;
    place-items: center;
    padding: 22px;
}

body.weldgrid-shell .wg-management-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(3, 18, 33, .58);
    backdrop-filter: blur(2px);
}

body.weldgrid-shell .wg-management-modal-dialog {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 14px;
    width: min(1120px, 100%);
    max-height: min(820px, calc(100vh - 44px));
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .42);
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 28px 70px rgba(7, 27, 47, .34);
    padding: 18px;
}

body.weldgrid-shell .wg-management-modal-dialog-sm {
    width: min(620px, 100%);
}

body.weldgrid-shell .wg-management-modal-dialog:not(.wg-management-modal-dialog-sm) {
    grid-template-rows: auto auto auto minmax(0, 1fr) auto;
}

body.weldgrid-shell .wg-management-modal-head,
body.weldgrid-shell .wg-management-modal-toolbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

body.weldgrid-shell .wg-management-filters {
    display: grid;
    grid-template-columns: minmax(240px, 1fr) auto;
    gap: 10px;
    align-items: end;
}

body.weldgrid-shell .wg-management-filters-mapping {
    grid-template-columns: minmax(220px, .75fr) minmax(260px, 1fr) auto;
}

body.weldgrid-shell .wg-management-filters .wg-search-box {
    width: 100%;
    min-width: 0;
}

body.weldgrid-shell .wg-management-filter-select,
body.weldgrid-shell .wg-management-page-size {
    display: grid;
    gap: 5px;
    color: var(--wg-muted);
    font-size: .76rem;
    font-weight: 900;
}

body.weldgrid-shell .wg-management-filter-select select,
body.weldgrid-shell .wg-management-page-size select {
    height: 38px;
    min-width: 92px;
    border: 1px solid rgba(12, 46, 76, .14);
    border-radius: 8px;
    background: #ffffff;
    color: var(--wg-navy);
    padding: 0 10px;
    font-weight: 900;
}

body.weldgrid-shell .wg-management-filter-select select {
    width: 100%;
}

body.weldgrid-shell .wg-management-modal-head h3 {
    margin: 0;
    color: var(--wg-navy);
    font-size: 1.05rem;
    font-weight: 950;
}

body.weldgrid-shell .wg-management-modal-head p,
body.weldgrid-shell .wg-management-hint {
    margin: 4px 0 0;
    color: var(--wg-muted);
    font-size: .82rem;
    font-weight: 800;
}

body.weldgrid-shell .wg-management-table-wrap {
    min-height: 0;
    max-height: min(56vh, 520px);
    overflow: auto;
    border: 1px solid rgba(12, 46, 76, .1);
    border-radius: 8px;
    background: #ffffff;
}

body.weldgrid-shell .wg-management-pagination {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    min-height: 38px;
}

body.weldgrid-shell .wg-management-pagination span {
    color: var(--wg-muted);
    font-size: .82rem;
    font-weight: 900;
}

body.weldgrid-shell .wg-management-table {
    width: 100%;
    min-width: 880px;
    border-collapse: separate;
    border-spacing: 0;
}

body.weldgrid-shell .wg-management-table th,
body.weldgrid-shell .wg-management-table td {
    border-bottom: 1px solid rgba(12, 46, 76, .08);
    padding: 10px;
    text-align: left;
    vertical-align: middle;
}

body.weldgrid-shell .wg-management-table th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #f2f7fb;
    color: var(--wg-navy);
    font-size: .76rem;
    font-weight: 950;
    text-transform: uppercase;
}

body.weldgrid-shell .wg-management-table td strong,
body.weldgrid-shell .wg-management-table td small {
    display: block;
}

body.weldgrid-shell .wg-management-table td strong {
    color: var(--wg-navy);
    font-weight: 950;
}

body.weldgrid-shell .wg-management-table td small {
    color: var(--wg-muted);
    font-size: .72rem;
    font-weight: 800;
}

body.weldgrid-shell .wg-management-table tr.is-selected td {
    background: #f8fbfd;
}

body.weldgrid-shell .wg-management-actions {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}

body.weldgrid-shell .wg-status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: #eef4f8;
    color: var(--wg-muted);
    padding: 4px 8px;
    font-size: .72rem;
    font-weight: 950;
}

body.weldgrid-shell .wg-status-pill.is-ready {
    background: #dcfce7;
    color: #047857;
}

body.weldgrid-shell .wg-history-list {
    display: grid;
    gap: 8px;
    max-height: 420px;
    overflow: auto;
}

body.weldgrid-shell .wg-history-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border: 1px solid rgba(12, 46, 76, .1);
    border-radius: 8px;
    background: #fbfdff;
    padding: 10px;
}

body.weldgrid-shell .wg-history-item strong {
    color: var(--wg-navy);
    font-weight: 900;
}

body.weldgrid-shell .wg-history-item span {
    color: var(--wg-muted);
    font-size: .78rem;
    font-weight: 800;
    white-space: nowrap;
}

body.weldgrid-shell .wg-template-structure-list {
    display: grid;
    gap: 8px;
    text-align: left;
}

body.weldgrid-shell .wg-template-structure-list div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    border: 1px solid rgba(12, 46, 76, .1);
    border-radius: 8px;
    padding: 9px 10px;
}
body.weldgrid-shell .wg-template-sheet-settings {
    display: grid;
    gap: 10px;
    text-align: left;
}

body.weldgrid-shell .wg-template-sheet-settings-note {
    margin: 0 0 4px;
    color: var(--wg-muted);
    font-size: .88rem;
    font-weight: 700;
    line-height: 1.45;
}

body.weldgrid-shell .wg-template-sheet-settings-row {
    align-items: end;
    border: 1px solid rgba(12, 46, 76, .12);
    border-radius: 8px;
    display: grid;
    gap: 10px;
    grid-template-columns: minmax(220px, 1fr) 120px 150px;
    padding: 10px;
}

body.weldgrid-shell .wg-template-sheet-settings-main {
    display: grid;
    gap: 3px;
}

body.weldgrid-shell .wg-template-sheet-settings-main strong {
    color: var(--wg-navy);
    font-weight: 900;
}

body.weldgrid-shell .wg-template-sheet-settings-main span,
body.weldgrid-shell .wg-template-sheet-settings-row label {
    color: var(--wg-muted);
    font-size: .78rem;
    font-weight: 800;
}

body.weldgrid-shell .wg-template-sheet-settings-row label {
    display: grid;
    gap: 5px;
}

body.weldgrid-shell .wg-template-sheet-settings-row input {
    border: 1px solid rgba(12, 46, 76, .18);
    border-radius: 7px;
    color: var(--wg-navy);
    font: inherit;
    font-size: .92rem;
    font-weight: 800;
    min-height: 38px;
    padding: 7px 9px;
    width: 100%;
}

@media (max-width: 900px) {
    body.weldgrid-shell .wg-editor-toolbar,
    body.weldgrid-shell .wg-management-modal-head,
    body.weldgrid-shell .wg-management-modal-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    body.weldgrid-shell .wg-excel-active-setting-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    body.weldgrid-shell .wg-management-filters,
    body.weldgrid-shell .wg-management-filters-mapping {
        grid-template-columns: 1fr;
    }

    body.weldgrid-shell .wg-management-pagination {
        justify-content: stretch;
        flex-wrap: wrap;
    }

    body.weldgrid-shell .wg-management-pagination .wg-btn {
        flex: 1 1 140px;
    }

    body.weldgrid-shell .wg-management-pagination span {
        flex: 1 1 100%;
        text-align: center;
    }
}



/* =========================================================
   WeldGrid Settings Top Management Cleanup
========================================================= */
body.weldgrid-shell .wg-btn-orange {
    border-color: #ff5f1f !important;
    background: #ff5f1f !important;
    color: #fff !important;
    box-shadow: 0 10px 20px rgba(255, 95, 31, .18);
}

body.weldgrid-shell .wg-btn-orange:hover {
    border-color: #e84d12 !important;
    background: #e84d12 !important;
    color: #fff !important;
}

body.weldgrid-shell .wg-template-upload-progress-bar {
    background: linear-gradient(90deg, #ff5f1f 0%, #0b5f8f 50%, #ff5f1f 100%) !important;
}

body.weldgrid-shell .wg-project-export-card {
    display: grid;
    gap: 12px;
    margin: 14px 0;
    border: 1px solid rgba(12, 46, 76, .12);
    border-radius: 8px;
    background: #fff;
    padding: 14px;
}

body.weldgrid-shell .wg-project-export-head,
body.weldgrid-shell .wg-project-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

body.weldgrid-shell .wg-project-export-head h3 {
    margin: 0;
    color: var(--wg-navy);
    font-size: 1rem;
    font-weight: 950;
}

body.weldgrid-shell .wg-project-export-head p,
body.weldgrid-shell .wg-project-pagination span {
    margin: 3px 0 0;
    color: var(--wg-muted);
    font-size: .82rem;
    font-weight: 800;
}

body.weldgrid-shell .wg-project-table-wrap {
    overflow: auto;
    border: 1px solid rgba(12, 46, 76, .1);
    border-radius: 8px;
    background: #fff;
}

body.weldgrid-shell .wg-project-table {
    width: 100%;
    min-width: 1220px;
    border-collapse: separate;
    border-spacing: 0;
}

body.weldgrid-shell .wg-project-table th,
body.weldgrid-shell .wg-project-table td {
    border-bottom: 1px solid rgba(12, 46, 76, .08);
    padding: 10px 11px;
    text-align: left;
    vertical-align: middle;
}

body.weldgrid-shell .wg-project-table th {
    background: #f2f7fb;
    color: var(--wg-navy);
    font-size: .72rem;
    font-weight: 950;
    text-transform: uppercase;
}

body.weldgrid-shell .wg-project-row {
    position: relative;
    cursor: pointer;
}

body.weldgrid-shell .wg-project-row.is-selected td {
    background: #fff7ed;
}

body.weldgrid-shell .wg-project-row.is-selected td:first-child {
    box-shadow: inset 4px 0 0 #ff5f1f;
}

body.weldgrid-shell .wg-project-main {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 180px;
}

body.weldgrid-shell .wg-project-main strong {
    color: var(--wg-navy);
    font-weight: 950;
}

body.weldgrid-shell .wg-current-project-badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    background: #ff5f1f;
    color: #fff;
    padding: 3px 7px;
    font-size: .68rem;
    font-weight: 950;
    animation: wgCurrentProjectPulse 1.55s ease-in-out infinite;
}

@keyframes wgCurrentProjectPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255, 95, 31, .28); }
    50% { box-shadow: 0 0 0 5px rgba(255, 95, 31, 0); }
}

body.weldgrid-shell .wg-count-pill,
body.weldgrid-shell .wg-mini-badge,
body.weldgrid-shell .wg-mini-more {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    border: 1px solid rgba(12, 46, 76, .12);
    background: #f2f7fb;
    color: var(--wg-navy);
    padding: 3px 8px;
    font-size: .72rem;
    font-weight: 950;
}

body.weldgrid-shell .wg-mini-badge.is-current {
    border-color: rgba(255, 95, 31, .35);
    background: #fff0e8;
    color: #c2410c;
}

body.weldgrid-shell .wg-mini-more {
    cursor: pointer;
}

body.weldgrid-shell .wg-usage-badges {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
}

body.weldgrid-shell .wg-muted {
    color: var(--wg-muted);
}

body.weldgrid-shell .wg-active-export-ribbon {
    display: grid;
    gap: 8px;
    margin: 0 0 12px;
    border: 1px solid rgba(12, 46, 76, .12);
    border-radius: 8px;
    background: #fbfdff;
    padding: 10px 12px;
}

body.weldgrid-shell .wg-active-export-ribbon-main,
body.weldgrid-shell .wg-active-export-ribbon-meta,
body.weldgrid-shell .wg-row-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

body.weldgrid-shell .wg-active-export-ribbon-main strong,
body.weldgrid-shell .wg-active-export-ribbon-meta strong {
    color: var(--wg-navy);
    font-weight: 950;
}

body.weldgrid-shell .wg-active-export-ribbon-main span:not(.wg-excel-active-setting-badge),
body.weldgrid-shell .wg-active-export-ribbon-meta span {
    color: var(--wg-muted);
    font-size: .82rem;
    font-weight: 850;
}


body.weldgrid-shell .wg-action-menu {
    position: relative;
    display: inline-flex;
}

body.weldgrid-shell .wg-action-menu-panel {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: 60;
    display: none;
    min-width: 210px;
    border: 1px solid rgba(12, 46, 76, .12);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 18px 36px rgba(7, 27, 47, .18);
    padding: 6px;
}

body.weldgrid-shell .wg-action-menu.is-open .wg-action-menu-panel {
    display: grid;
}

body.weldgrid-shell .wg-action-menu-panel button {
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--wg-navy);
    padding: 8px 9px;
    text-align: left;
    font-size: .82rem;
    font-weight: 850;
}

body.weldgrid-shell .wg-action-menu-panel button:hover {
    background: #f2f7fb;
}

body.weldgrid-shell .wg-action-menu-panel button.is-danger {
    color: #dc2626;
}

body.weldgrid-shell .wg-icon-btn.is-active {
    border-color: rgba(16, 185, 129, .35);
    background: #dcfce7;
    color: #047857;
}

body.weldgrid-shell .wg-swal-on-top {
    z-index: 30050 !important;
}

body.weldgrid-shell .wg-swal-form,
body.weldgrid-shell .wg-usage-list-modal {
    display: grid;
    gap: 10px;
    text-align: left;
}

body.weldgrid-shell .wg-swal-form label {
    margin: 0;
    color: var(--wg-navy);
    font-size: .82rem;
    font-weight: 900;
}

body.weldgrid-shell .wg-swal-check {
    display: flex !important;
    align-items: center;
    gap: 8px;
}

body.weldgrid-shell .wg-usage-list-modal div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border: 1px solid rgba(12, 46, 76, .1);
    border-radius: 8px;
    padding: 9px 10px;
}

body.weldgrid-shell .wg-usage-list-modal span {
    border-radius: 999px;
    background: #fff0e8;
    color: #c2410c;
    padding: 3px 8px;
    font-size: .72rem;
    font-weight: 950;
}

body.weldgrid-shell .wg-status-pill.is-missing {
    background: #fff7ed;
    color: #9a3412;
}

@media (max-width: 900px) {
    body.weldgrid-shell .wg-project-export-head,
    body.weldgrid-shell .wg-project-pagination,
    body.weldgrid-shell .wg-active-export-ribbon-main,
    body.weldgrid-shell .wg-active-export-ribbon-meta {
        align-items: stretch;
        flex-direction: column;
    }

}


/* WeldGrid floating action menus */
body.weldgrid-shell .wg-action-menu-panel.is-floating {
    position: fixed;
    top: auto;
    right: auto;
    z-index: 30020;
    max-height: min(320px, calc(100vh - 24px));
    overflow-y: auto;
}

/* =========================================================
   WeldGrid Settings Modal Stacking Follow-up
========================================================= */
body.weldgrid-shell .wg-template-upload-modal {
    z-index: 40100 !important;
}

body.weldgrid-shell .wg-template-upload-modal.is-visible {
    z-index: 40100 !important;
}

body.weldgrid-shell .wg-action-menu-panel.is-floating {
    z-index: 40150 !important;
}

.swal2-container.wg-swal-on-top,
body.weldgrid-shell .wg-swal-on-top {
    z-index: 40200 !important;
}



/* =========================================================
   WeldGrid Companies / Tenant Management
========================================================= */
.wg-companies-page .wg-companies-toolbar {
    align-items: stretch;
}

.wg-companies-page .wg-search-box {
    flex: 1 1 420px;
}

.wg-companies-table {
    min-width: 1020px;
}

.wg-count-chip,
.wg-user-chip,
.wg-company-status,
.wg-archive-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 24px;
    padding: 4px 9px;
    border-radius: 999px;
    font-size: .76rem;
    font-weight: 900;
    line-height: 1;
}

.wg-count-chip {
    min-width: 30px;
    background: #eef6fb;
    color: #0f5f82;
}

.wg-user-chip {
    background: #eef4f8;
    color: #17324d;
}

.wg-company-status-active {
    background: #dcfce7;
    color: #047857;
}

.wg-company-status-inactive {
    background: #eef4f8;
    color: #60758a;
}

.wg-company-status-suspended {
    background: #fff7ed;
    color: #b45309;
}

.wg-company-status-deleted {
    background: #fee2e2;
    color: #b91c1c;
}

.wg-company-actions {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.wg-action-menu {
    position: relative;
    display: inline-flex;
}

.wg-action-menu-list {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: 10090;
    display: grid;
    min-width: 190px;
    padding: 6px;
    border: 1px solid rgba(12, 46, 76, .14);
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 16px 34px rgba(7, 27, 47, .18);
}

.wg-action-menu-list.is-floating,
body.weldgrid-shell .wg-action-menu-list.is-floating {
    position: fixed;
    top: auto;
    right: auto;
    z-index: 40150;
    max-height: min(320px, calc(100vh - 24px));
    overflow-y: auto;
}

.wg-action-menu-list[hidden] {
    display: none !important;
}

.wg-action-menu-list button {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    min-height: 34px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #17324d;
    padding: 7px 9px;
    font-size: .82rem;
    font-weight: 850;
    text-align: left;
}

.wg-action-menu-list button:hover {
    background: #f1f6fa;
    color: #0f5f82;
}

.wg-companies-pagination {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 12px 16px;
    border-top: 1px solid rgba(12, 46, 76, .08);
    background: #f8fbfd;
    color: #60758a;
    font-size: .84rem;
    font-weight: 850;
}

.wg-company-modal .modal-dialog,
.wg-company-users-modal .modal-dialog {
    max-width: min(1180px, calc(100vw - 32px));
}

.wg-company-admin-panel,
.wg-company-user-form {
    display: grid;
    gap: 12px;
    padding: 12px;
    border: 1px solid rgba(12, 46, 76, .1);
    border-radius: 8px;
    background: #f8fbfd;
}

.wg-company-user-form {
    margin-top: 12px;
}

.wg-company-user-form h6 {
    margin: 0;
    color: #17324d;
    font-size: .88rem;
    font-weight: 950;
}

.wg-company-user-list {
    display: grid;
    gap: 8px;
    margin-top: 14px;
}

.wg-company-user-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid rgba(12, 46, 76, .1);
    border-radius: 8px;
    background: #ffffff;
}

.wg-company-user-row strong,
.wg-company-user-row span {
    display: block;
}

.wg-company-user-row span:not(.wg-user-chip) {
    color: #60758a;
    font-size: .78rem;
    font-weight: 750;
}

.wg-company-users-table {
    min-width: 820px;
}

.wg-btn:disabled,
.wg-icon-btn:disabled,
.wg-action-btn:disabled {
    opacity: .48;
    cursor: not-allowed;
    pointer-events: none;
}

@media (max-width: 780px) {
    .wg-companies-page .wg-functional-toolbar,
    .wg-companies-pagination {
        align-items: stretch;
        flex-direction: column;
    }

    .wg-company-user-row {
        grid-template-columns: 1fr;
        align-items: start;
    }
}


/* =========================================================
   WeldGrid Spool Split Editor
========================================================= */
body.weldgrid-shell.wg-spool-editor-docked .swal2-container {
    background: transparent !important;
    pointer-events: none !important;
}

body.weldgrid-shell.wg-spool-editor-docked .swal2-container .wg-spool-split-editor-popup {
    pointer-events: auto !important;
    align-self: stretch !important;
    width: min(820px, 48vw) !important;
    max-width: calc(100vw - 28px) !important;
    height: calc(100dvh - 24px) !important;
    max-height: calc(100dvh - 24px) !important;
    margin: 12px 14px 12px auto !important;
    padding: 0 !important;
    overflow: hidden !important;
    border: 1px solid rgba(12, 46, 76, .16) !important;
    border-radius: 10px !important;
    background: #eef6fb !important;
    box-shadow: 0 22px 54px rgba(7, 27, 47, .28) !important;
}

body.weldgrid-shell.wg-spool-editor-docked .wg-spool-split-editor-popup .swal2-title {
    margin: 0 !important;
    padding: 18px 22px 6px !important;
    color: #08243d !important;
    font-size: 22px !important;
    font-weight: 950 !important;
    text-align: left !important;
}

body.weldgrid-shell.wg-spool-editor-docked .wg-spool-split-editor-popup .swal2-html-container,
body.weldgrid-shell.wg-spool-editor-docked .wg-spool-split-editor-html {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 8px 22px 14px !important;
    overflow: auto !important;
    text-align: left !important;
}

body.weldgrid-shell.wg-spool-editor-docked .wg-spool-split-editor-actions {
    position: sticky !important;
    bottom: 0 !important;
    z-index: 2 !important;
    display: flex !important;
    justify-content: flex-end !important;
    gap: 10px !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 12px 18px 18px !important;
    border-top: 1px solid rgba(12, 46, 76, .12) !important;
    background: linear-gradient(180deg, rgba(238, 246, 251, .86), #eef6fb 36%) !important;
}

body.weldgrid-shell.wg-spool-editor-docked .wg-spool-split-editor-popup .swal2-close {
    top: 14px !important;
    right: 14px !important;
}

body.weldgrid-shell.wg-spool-editor-docked .wg-spool-editor-form {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    align-items: start !important;
    gap: 9px !important;
}

body.weldgrid-shell.wg-spool-editor-docked .wg-spool-editor-form label {
    min-width: 0 !important;
    gap: 4px !important;
    font-size: 12px !important;
}

body.weldgrid-shell.wg-spool-editor-docked .wg-spool-editor-form .swal2-input,
body.weldgrid-shell.wg-spool-editor-docked .wg-spool-editor-form .swal2-select,
body.weldgrid-shell.wg-spool-editor-docked .wg-spool-editor-form .swal2-textarea {
    min-height: 38px !important;
    padding: 7px 9px !important;
    font-size: 13px !important;
}

body.weldgrid-shell.wg-spool-editor-docked .wg-spool-editor-form .swal2-textarea {
    min-height: 92px !important;
    resize: vertical !important;
}

body.weldgrid-shell.wg-spool-editor-docked .wg-live-label-preview {
    grid-column: 1 / -1 !important;
    min-height: 82px !important;
    height: 82px !important;
    margin: 0 !important;
    border-radius: 8px !important;
}

body.weldgrid-shell.wg-spool-editor-docked .wg-live-label-preview-area {
    inset: 10px !important;
    border-radius: 8px !important;
}

body.weldgrid-shell.wg-spool-editor-docked .wg-spool-color-picker {
    gap: 6px !important;
}

body.weldgrid-shell.wg-spool-editor-docked .wg-spool-color-swatch,
body.weldgrid-shell.wg-spool-editor-docked .wg-spool-color-custom {
    width: 30px !important;
    height: 30px !important;
}

body.weldgrid-shell.wg-spool-editor-docked .wg-spool-icon-grid {
    grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)) !important;
    max-height: 130px !important;
}

body.weldgrid-shell.wg-spool-editor-docked .wg-spool-icon-choice {
    min-height: 48px !important;
    padding: 5px 4px !important;
}

body.weldgrid-shell.wg-spool-editor-docked .wg-spool-editor-segments {
    grid-column: 1 / -1 !important;
    gap: 8px !important;
    margin-top: 4px !important;
    padding: 10px !important;
}

body.weldgrid-shell.wg-spool-editor-docked .wg-spool-segment-toolbar {
    align-items: center !important;
    flex-wrap: wrap !important;
}

body.weldgrid-shell.wg-spool-editor-docked .wg-spool-segment-table-wrap {
    max-height: 155px !important;
}

body.weldgrid-shell.wg-spool-editor-docked .wg-spool-segment-table {
    min-width: 640px !important;
}

body.weldgrid-shell.wg-spool-editor-docked .wg-spool-segment-table th,
body.weldgrid-shell.wg-spool-editor-docked .wg-spool-segment-table td {
    padding: 7px 8px !important;
    font-size: 12px !important;
}

body.weldgrid-shell.wg-spool-editor-docked .wg-spool-segment-form {
    grid-template-columns: 120px minmax(0, 1fr) !important;
    gap: 8px !important;
    padding: 9px !important;
}

body.weldgrid-shell.wg-spool-editor-docked .wg-spool-segment-bom-preview,
body.weldgrid-shell.wg-spool-editor-docked .wg-segment-bom-preview {
    padding: 9px !important;
}

body.weldgrid-shell.wg-spool-editor-docked .wg-spool-create-assignment {
    grid-column: 1 / -1 !important;
    padding: 10px !important;
}

body.weldgrid-shell.wg-spool-editor-docked .wg-spool-assignment-list {
    max-height: 170px !important;
}

body.weldgrid-shell.wg-spool-editor-docked .wg-spool-assignment-tools {
    grid-template-columns: minmax(0, 1fr) minmax(150px, .72fr) auto !important;
}

@media (max-width: 1180px) {
    body.weldgrid-shell.wg-spool-editor-docked .swal2-container .wg-spool-split-editor-popup {
        width: min(760px, calc(100vw - 24px)) !important;
        height: calc(100dvh - 20px) !important;
        margin: 10px auto !important;
    }
}

@media (max-width: 720px) {
    body.weldgrid-shell.wg-spool-editor-docked .wg-spool-editor-form,
    body.weldgrid-shell.wg-spool-editor-docked .wg-spool-segment-form,
    body.weldgrid-shell.wg-spool-editor-docked .wg-spool-assignment-tools {
        grid-template-columns: 1fr !important;
    }
}

/* =========================================================
   WeldGrid Mapping Loading States
========================================================= */
body.weldgrid-shell .wg-template-structure-loading {
    min-height: 160px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: #12324a;
    text-align: center;
}

body.weldgrid-shell .wg-template-structure-loading span {
    color: #61738a;
    font-size: 0.9rem;
}

body.weldgrid-shell .wg-mapping-loading-bar {
    width: min(360px, 100%);
    height: 10px;
    border-radius: 999px;
    background: linear-gradient(90deg, #ff5f1f, #0b5f8f, #ff5f1f);
    background-size: 220% 100%;
    box-shadow: 0 8px 22px rgba(11, 95, 143, 0.18);
    animation: wgMappingLoadingSweep 1.1s linear infinite;
}

@keyframes wgMappingLoadingSweep {
    0% { background-position: 0% 50%; }
    100% { background-position: 220% 50%; }
}


/* =========================================================
   WeldGrid Spool Editor Docked Scroll Fix
========================================================= */
body.weldgrid-shell.wg-spool-editor-docked .swal2-container {
    align-items: stretch !important;
    justify-content: flex-end !important;
    padding: 0 !important;
    background: transparent !important;
    pointer-events: none !important;
}

body.weldgrid-shell.wg-spool-editor-docked .swal2-container .wg-spool-split-editor-popup {
    pointer-events: auto !important;
    align-self: stretch !important;
    width: min(940px, 52vw) !important;
    max-width: calc(100vw - 24px) !important;
    height: calc(100dvh - 24px) !important;
    max-height: calc(100dvh - 24px) !important;
    margin: 12px 14px 12px auto !important;
    padding: 0 !important;
    overflow: hidden !important;
    border: 1px solid rgba(12, 46, 76, .16) !important;
    border-radius: 10px !important;
    background: #eef6fb !important;
    box-shadow: 0 22px 54px rgba(7, 27, 47, .28) !important;
    display: flex !important;
    flex-direction: column !important;
}

body.weldgrid-shell.wg-spool-editor-docked .wg-spool-split-editor-popup .swal2-title {
    flex: 0 0 auto !important;
    margin: 0 !important;
    padding: 18px 22px 6px !important;
    color: #08243d !important;
    font-size: 22px !important;
    font-weight: 950 !important;
    text-align: left !important;
}

body.weldgrid-shell.wg-spool-editor-docked .wg-spool-split-editor-popup .swal2-html-container,
body.weldgrid-shell.wg-spool-editor-docked .wg-spool-split-editor-html {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 8px 22px 18px !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    overscroll-behavior: contain !important;
    text-align: left !important;
}

body.weldgrid-shell.wg-spool-editor-docked .wg-spool-split-editor-actions {
    position: relative !important;
    flex: 0 0 auto !important;
    z-index: 2 !important;
    display: flex !important;
    justify-content: flex-end !important;
    gap: 10px !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 12px 18px 18px !important;
    border-top: 1px solid rgba(12, 46, 76, .12) !important;
    background: linear-gradient(180deg, rgba(238, 246, 251, .9), #eef6fb 36%) !important;
    box-shadow: 0 -12px 24px rgba(8, 33, 55, .07) !important;
}

body.weldgrid-shell.wg-spool-editor-docked .wg-spool-split-editor-popup .swal2-close {
    top: 14px !important;
    right: 14px !important;
}

body.weldgrid-shell.wg-spool-editor-docked .wg-spool-editor-form {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    align-items: start !important;
    gap: 9px !important;
    width: 100% !important;
}

body.weldgrid-shell.wg-spool-editor-docked .wg-live-label-preview,
body.weldgrid-shell.wg-spool-editor-docked .wg-spool-editor-segments,
body.weldgrid-shell.wg-spool-editor-docked .wg-spool-create-assignment {
    grid-column: 1 / -1 !important;
}

body.weldgrid-shell.wg-spool-editor-docked .wg-spool-editor-form label {
    min-width: 0 !important;
    gap: 4px !important;
    font-size: 12px !important;
}

body.weldgrid-shell.wg-spool-editor-docked .wg-spool-editor-form .swal2-input,
body.weldgrid-shell.wg-spool-editor-docked .wg-spool-editor-form .swal2-select,
body.weldgrid-shell.wg-spool-editor-docked .wg-spool-editor-form .swal2-textarea {
    min-height: 38px !important;
    padding: 7px 9px !important;
    font-size: 13px !important;
}

body.weldgrid-shell.wg-spool-editor-docked .wg-spool-editor-form .swal2-textarea {
    min-height: 92px !important;
    resize: vertical !important;
}

body.weldgrid-shell.wg-spool-editor-docked .wg-live-label-preview {
    min-height: 82px !important;
    height: 82px !important;
    margin: 0 !important;
    border-radius: 8px !important;
}

body.weldgrid-shell.wg-spool-editor-docked .wg-live-label-preview-area {
    inset: 10px !important;
    border-radius: 8px !important;
}

body.weldgrid-shell.wg-spool-editor-docked .wg-spool-icon-grid {
    grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)) !important;
    max-height: 160px !important;
    overflow-y: auto !important;
}

body.weldgrid-shell.wg-spool-editor-docked .wg-spool-segment-table-wrap {
    max-height: 220px !important;
    overflow: auto !important;
}

body.weldgrid-shell.wg-spool-editor-docked .wg-spool-segment-table {
    min-width: 640px !important;
}

body.weldgrid-shell.wg-spool-editor-docked .wg-spool-segment-form {
    grid-template-columns: 150px minmax(0, 1fr) !important;
    gap: 8px !important;
    padding: 9px !important;
}

@media (max-width: 1180px) {
    body.weldgrid-shell.wg-spool-editor-docked .swal2-container .wg-spool-split-editor-popup {
        width: min(760px, 58vw) !important;
    }
}

@media (max-width: 900px) {
    body.weldgrid-shell.wg-spool-editor-docked .swal2-container .wg-spool-split-editor-popup {
        width: 100vw !important;
        max-width: 100vw !important;
        height: 100dvh !important;
        max-height: 100dvh !important;
        margin: 8px !important;
    }

    body.weldgrid-shell.wg-spool-editor-docked .wg-spool-editor-form,
    body.weldgrid-shell.wg-spool-editor-docked .wg-spool-segment-form,
    body.weldgrid-shell.wg-spool-editor-docked .wg-spool-assignment-tools {
        grid-template-columns: 1fr !important;
    }

    body.weldgrid-shell.wg-spool-editor-docked .wg-spool-split-editor-popup .swal2-title,
    body.weldgrid-shell.wg-spool-editor-docked .wg-spool-split-editor-popup .swal2-html-container,
    body.weldgrid-shell.wg-spool-editor-docked .wg-spool-split-editor-html,
    body.weldgrid-shell.wg-spool-editor-docked .wg-spool-split-editor-actions {
        padding-left: 16px !important;
        padding-right: 16px !important;
    }
}


/* =========================================================
   WeldGrid Spool Editor Scroll Hardening
========================================================= */
body.weldgrid-shell.wg-spool-editor-docked .swal2-container {
    align-items: flex-start !important;
    justify-content: flex-end !important;
    overflow: hidden !important;
    padding: 0 !important;
}

body.weldgrid-shell.wg-spool-editor-docked .swal2-container .wg-spool-split-editor-popup {
    display: block !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: calc(100dvh - 24px) !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    overscroll-behavior: contain !important;
    scrollbar-gutter: stable !important;
}

body.weldgrid-shell.wg-spool-editor-docked .wg-spool-split-editor-popup .swal2-html-container,
body.weldgrid-shell.wg-spool-editor-docked .wg-spool-split-editor-html {
    display: block !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: visible !important;
}

body.weldgrid-shell.wg-spool-editor-docked .wg-spool-split-editor-actions {
    position: sticky !important;
    bottom: 0 !important;
    z-index: 20 !important;
}

body.weldgrid-shell.wg-spool-editor-docked .wg-spool-segment-form .swal2-textarea,
body.weldgrid-shell.wg-spool-editor-docked #wgSwalSpoolNotes {
    max-height: 160px !important;
}

/* =========================================================
   WeldGrid Project Company Assignment
========================================================= */
body.weldgrid-shell .wg-field-hint {
    margin-top: 6px;
    color: #5f7187;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.35;
}



/* =========================================================
   WeldGrid Exports Full UX
========================================================= */
body.weldgrid-shell .wg-exports-page {
    display: grid;
    gap: 12px;
}
body.weldgrid-shell .wg-exports-page .wg-export-hero {
    margin-bottom: 0;
    padding: 22px 26px;
}
body.weldgrid-shell .wg-exports-page .wg-export-hero p {
    max-width: 760px;
    margin-bottom: 0;
}
body.weldgrid-shell .wg-export-kpi-row {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
}
body.weldgrid-shell .wg-export-kpi {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 4px 10px;
    align-items: center;
    min-height: 74px;
    border: 1px solid rgba(12, 46, 76, .1);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 8px 20px rgba(7, 27, 47, .06);
    padding: 12px;
}
body.weldgrid-shell .wg-export-kpi i {
    grid-row: span 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: #eef6fb;
    color: var(--wg-cyan);
    font-size: 18px;
}
body.weldgrid-shell .wg-export-kpi span {
    color: var(--wg-muted);
    font-size: .78rem;
    font-weight: 900;
}
body.weldgrid-shell .wg-export-kpi strong {
    overflow: hidden;
    color: var(--wg-navy);
    font-size: 1.08rem;
    font-weight: 950;
    text-overflow: ellipsis;
    white-space: nowrap;
}
body.weldgrid-shell .wg-export-kpi.is-loading strong {
    color: #94a3b8;
}
body.weldgrid-shell .wg-export-page-notice {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    border: 1px solid rgba(245, 158, 11, .28);
    border-radius: 8px;
    background: #fff7ed;
    color: #92400e;
    padding: 10px 12px;
    font-weight: 850;
}
body.weldgrid-shell .wg-export-page-notice[hidden] {
    display: none !important;
}
body.weldgrid-shell .wg-exports-page .wg-export-layout {
    grid-template-columns: 342px minmax(0, 1fr);
    gap: 14px;
    align-items: start;
}
body.weldgrid-shell .wg-export-control-card,
body.weldgrid-shell .wg-export-history-card {
    min-width: 0;
}
body.weldgrid-shell .wg-export-section {
    display: grid;
    gap: 8px;
    margin-top: 12px;
}
body.weldgrid-shell .wg-export-section-title {
    color: var(--wg-navy);
    font-size: .86rem;
    font-weight: 950;
}
body.weldgrid-shell .wg-export-inline-loading {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--wg-muted);
    font-size: .78rem;
    font-weight: 850;
}
body.weldgrid-shell .wg-export-inline-loading[hidden] {
    display: none !important;
}
body.weldgrid-shell .wg-export-inline-loading span {
    width: 56px;
    height: 6px;
    overflow: hidden;
    border-radius: 999px;
    background: #dbe7f0;
}
body.weldgrid-shell .wg-export-inline-loading span::after,
body.weldgrid-shell .wg-export-loading-bar span {
    content: "";
    display: block;
    width: 46%;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--wg-orange), var(--wg-cyan));
    animation: wg-export-loading-slide 1s ease-in-out infinite;
}
body.weldgrid-shell .wg-export-loading-bar {
    width: 100%;
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: #dbe7f0;
}
@keyframes wg-export-loading-slide {
    0% { transform: translateX(-115%); }
    50% { transform: translateX(60%); }
    100% { transform: translateX(230%); }
}
body.weldgrid-shell .wg-export-setting-loading,
body.weldgrid-shell .wg-export-table-loading {
    display: grid;
    gap: 8px;
    color: var(--wg-navy);
    font-weight: 900;
}
body.weldgrid-shell .wg-export-actions-section {
    gap: 8px;
}
body.weldgrid-shell .wg-export-option {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 2px 10px;
    align-items: center;
    width: 100%;
    min-height: 58px;
    border: 1px solid rgba(12, 46, 76, .14);
    border-radius: 8px;
    background: #fff;
    color: var(--wg-navy);
    padding: 10px 12px;
    text-align: left;
    font-weight: 950;
}
body.weldgrid-shell .wg-export-option i {
    grid-row: span 2;
    color: var(--wg-orange);
    font-size: 1.2rem;
}
body.weldgrid-shell .wg-export-option small {
    display: block;
    overflow: hidden;
    color: var(--wg-muted);
    font-size: .72rem;
    font-weight: 850;
    text-overflow: ellipsis;
    white-space: nowrap;
}
body.weldgrid-shell .wg-export-option:not(:disabled):hover {
    border-color: rgba(255, 106, 26, .45);
    background: #fff8f3;
}
body.weldgrid-shell .wg-export-filter-toolbar {
    display: grid;
    grid-template-columns: minmax(260px, 1.4fr) repeat(3, minmax(160px, .6fr)) auto;
    gap: 8px;
    align-items: stretch;
    margin-bottom: 10px;
}
body.weldgrid-shell .wg-export-search-box,
body.weldgrid-shell .wg-export-excel-toolbar label {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    border: 1px solid rgba(12, 46, 76, .14);
    border-radius: 8px;
    background: #fff;
    color: var(--wg-muted);
    padding: 0 11px;
}
body.weldgrid-shell .wg-export-search-box input,
body.weldgrid-shell .wg-export-excel-toolbar input {
    width: 100%;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--wg-navy);
    padding: 10px 0;
    font-weight: 850;
}
body.weldgrid-shell .wg-export-bulk-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
    border: 1px solid rgba(14, 116, 144, .22);
    border-radius: 8px;
    background: #eef8fc;
    color: var(--wg-navy);
    padding: 10px 12px;
}
body.weldgrid-shell .wg-export-bulk-bar[hidden] {
    display: none !important;
}
body.weldgrid-shell .wg-export-bulk-bar strong {
    font-weight: 950;
}
body.weldgrid-shell .wg-export-table-wrap {
    border: 1px solid rgba(12, 46, 76, .08);
    border-radius: 8px;
    background: #fff;
}
body.weldgrid-shell .wg-export-table {
    min-width: 1080px;
}
body.weldgrid-shell .wg-export-table th button {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border: 0;
    background: transparent;
    color: inherit;
    padding: 0;
    font: inherit;
    font-weight: 950;
}
body.weldgrid-shell .wg-export-table th button.is-active {
    color: var(--wg-orange);
}
body.weldgrid-shell .wg-export-table tbody tr.is-selected td {
    background: #fff8f3;
}
body.weldgrid-shell .wg-export-check-col {
    width: 44px;
    text-align: center;
}
body.weldgrid-shell .wg-export-table input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--wg-orange);
}
body.weldgrid-shell .wg-export-status-done,
body.weldgrid-shell .wg-export-status-completed {
    color: #047857;
    background: rgba(16, 185, 129, .13);
}
body.weldgrid-shell .wg-export-status-warning,
body.weldgrid-shell .wg-export-status-completed_with_warnings {
    color: #92400e;
    background: rgba(245, 158, 11, .16);
}
body.weldgrid-shell .wg-export-status-failed {
    color: #b91c1c;
    background: rgba(239, 68, 68, .12);
}
body.weldgrid-shell .wg-export-status-processing,
body.weldgrid-shell .wg-export-status-running,
body.weldgrid-shell .wg-export-status-pending {
    color: #075985;
    background: rgba(14, 165, 233, .12);
}
body.weldgrid-shell .wg-export-warning-badge {
    border: 0;
    cursor: pointer;
}
body.weldgrid-shell .wg-export-more {
    position: relative;
}
body.weldgrid-shell .wg-export-more summary {
    list-style: none;
}
body.weldgrid-shell .wg-export-more summary::-webkit-details-marker {
    display: none;
}
body.weldgrid-shell .wg-export-more div {
    position: fixed;
    left: var(--wg-export-menu-left, 0);
    top: var(--wg-export-menu-top, 0);
    right: auto;
    z-index: 12000;
    display: grid;
    gap: 4px;
    min-width: 190px;
    max-width: calc(100vw - 16px);
    border: 1px solid rgba(12, 46, 76, .14);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 18px 38px rgba(7, 27, 47, .18);
    padding: 6px;
}
body.weldgrid-shell .wg-export-more:not([open]) div {
    display: none;
}
body.weldgrid-shell .wg-export-more[open]:not(.is-positioned) div {
    visibility: hidden;
    pointer-events: none;
}
body.weldgrid-shell .wg-export-more div button {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--wg-navy);
    padding: 8px 9px;
    text-align: left;
    font-weight: 900;
}
body.weldgrid-shell .wg-export-more div button:hover {
    background: #f4f8fb;
}
body.weldgrid-shell .wg-export-more div button.is-danger {
    color: #b91c1c;
}
body.weldgrid-shell .wg-export-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 10px;
    color: var(--wg-muted);
    font-weight: 850;
}
body.weldgrid-shell .wg-export-page-actions {
    display: flex;
    align-items: center;
    gap: 7px;
}
body.weldgrid-shell .wg-export-preview-dialog {
    width: min(1220px, 100%);
}
body.weldgrid-shell .wg-export-preview-body {
    min-height: 360px;
}
body.weldgrid-shell .wg-export-preview-loading {
    display: grid;
    align-content: center;
    gap: 12px;
}
body.weldgrid-shell .wg-export-preview-summary {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}
body.weldgrid-shell .wg-export-preview-summary span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border: 1px solid rgba(12, 46, 76, .1);
    border-radius: 999px;
    background: #fff;
    color: var(--wg-muted);
    padding: 5px 9px;
    font-size: .8rem;
    font-weight: 850;
}
body.weldgrid-shell .wg-export-excel-toolbar {
    display: grid;
    grid-template-columns: minmax(240px, 1fr) 170px auto;
    gap: 8px;
    align-items: stretch;
    margin-bottom: 10px;
}
body.weldgrid-shell .wg-export-preview-tab small {
    margin-left: 5px;
    color: inherit;
    opacity: .72;
}
body.weldgrid-shell .wg-export-excel-table th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #f2f7fb;
    white-space: nowrap;
}
body.weldgrid-shell .wg-export-excel-table th:first-child,
body.weldgrid-shell .wg-export-excel-table td:first-child {
    position: sticky;
    left: 0;
    z-index: 3;
    background: #f8fbfd;
}
body.weldgrid-shell .wg-export-excel-table th span {
    display: block;
    color: #52677f;
    font-size: .72rem;
    font-weight: 950;
}
body.weldgrid-shell .wg-export-excel-table th strong {
    display: block;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
}
body.weldgrid-shell .wg-export-zip-layout {
    display: grid;
    grid-template-columns: minmax(260px, 360px) minmax(0, 1fr);
    gap: 12px;
    min-height: 480px;
}
body.weldgrid-shell .wg-export-zip-files {
    display: grid;
    align-content: start;
    gap: 8px;
    max-height: 620px;
    overflow: auto;
}
body.weldgrid-shell .wg-export-zip-files article {
    display: grid;
    gap: 8px;
    border: 1px solid rgba(12, 46, 76, .12);
    border-radius: 8px;
    background: #fff;
    padding: 10px;
}
body.weldgrid-shell .wg-export-zip-files strong,
body.weldgrid-shell .wg-export-zip-files span {
    display: block;
    overflow-wrap: anywhere;
}
body.weldgrid-shell .wg-export-zip-files span {
    margin-top: 3px;
    color: var(--wg-muted);
    font-size: .78rem;
    font-weight: 850;
}
body.weldgrid-shell .wg-export-zip-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
body.weldgrid-shell .wg-export-zip-frame {
    display: grid;
    place-items: center;
    min-height: 480px;
    border: 1px dashed rgba(12, 46, 76, .18);
    border-radius: 8px;
    background: #fff;
    color: var(--wg-muted);
    font-weight: 850;
}
body.weldgrid-shell .wg-export-zip-frame iframe {
    height: 100%;
    min-height: 520px;
}
body.weldgrid-shell .wg-export-readable-list,
body.weldgrid-shell .wg-export-observations ul {
    display: grid;
    gap: 7px;
    margin: 0;
    padding-left: 18px;
    color: var(--wg-navy);
    font-weight: 850;
}
body.weldgrid-shell .wg-export-observations label {
    display: block;
    margin-top: 12px;
    color: var(--wg-navy);
    font-weight: 950;
}
body.weldgrid-shell .wg-export-observations textarea {
    width: 100%;
    min-height: 120px;
}
@media (max-width: 1280px) {
    body.weldgrid-shell .wg-export-kpi-row {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    body.weldgrid-shell .wg-export-filter-toolbar {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media  (max-width: 1100px) {
    body.weldgrid-shell .wg-exports-page .wg-export-layout,
    body.weldgrid-shell .wg-export-zip-layout {
        grid-template-columns: 1fr;
    }
}
@media (max-width: 760px) {
    body.weldgrid-shell .wg-export-kpi-row,
    body.weldgrid-shell .wg-export-filter-toolbar,
    body.weldgrid-shell .wg-export-excel-toolbar {
        grid-template-columns: 1fr;
    }
    body.weldgrid-shell .wg-export-bulk-bar,
    body.weldgrid-shell .wg-export-pagination {
        align-items: stretch;
        flex-direction: column;
    }
    body.weldgrid-shell .wg-export-page-actions,
    body.weldgrid-shell .wg-export-bulk-bar .wg-btn {
        width: 100%;
    }
    body.weldgrid-shell .wg-export-page-actions .wg-btn {
        flex: 1 1 0;
        justify-content: center;
    }
}


/* =========================================================
   WeldGrid PDF Viewer Interaction Refinements
========================================================= */
body.weldgrid-shell .wg-pdf-workspace.is-fullscreen .wg-active-pdf-bar,
body.weldgrid-shell .wg-pdf-workspace:fullscreen .wg-active-pdf-bar,
body.weldgrid-shell .wg-pdf-workspace.is-fullscreen .wg-version-timeline,
body.weldgrid-shell .wg-pdf-workspace:fullscreen .wg-version-timeline {
    display: none !important;
}

body.weldgrid-shell .wg-pdf-workspace.is-fullscreen .wg-pdf-viewer-card,
body.weldgrid-shell .wg-pdf-workspace:fullscreen .wg-pdf-viewer-card {
    min-height: 0 !important;
}

body.weldgrid-shell .wg-annotation-point {
    width: 24px !important;
    height: 24px !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    outline: 0 !important;
}

body.weldgrid-shell .wg-annotation-point::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 10px;
    height: 10px;
    border: 2px solid #fff;
    border-radius: 50%;
    background: var(--wg-ann-color, #ff6a1a);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--wg-ann-color, #ff6a1a) 78%, transparent), 0 2px 7px rgba(7, 27, 47, .28);
    transform: translate(-50%, -50%) scale(.72);
    opacity: 0;
    transition: opacity .14s ease, transform .14s ease;
}

body.weldgrid-shell .wg-annotation-point:hover::after,
body.weldgrid-shell .wg-annotation-point:focus-visible::after,
body.weldgrid-shell .wg-annotation-point.wg-annotation-selected::after,
body.weldgrid-shell .wg-annotation-point.wg-annotation-multi-selected::after,
body.weldgrid-shell .wg-annotation-point.wg-annotation-in-selected-spool::after,
body.weldgrid-shell .wg-annotation-point.wg-annotation-ghost::after {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

body.weldgrid-shell .wg-annotation-arrow {
    vector-effect: non-scaling-stroke;
}

body.weldgrid-shell.wg-annotation-editor-docked .wg-annotation-modal {
    pointer-events: none;
}

body.weldgrid-shell.wg-annotation-editor-docked .wg-annotation-modal .modal-dialog {
    position: fixed;
    top: 10px;
    right: 12px;
    bottom: 10px;
    width: min(760px, 44vw);
    max-width: calc(100vw - 24px);
    height: calc(100dvh - 20px);
    margin: 0;
    pointer-events: auto;
    transform: none !important;
}

body.weldgrid-shell.wg-annotation-editor-docked .wg-annotation-modal .modal-content {
    height: 100%;
    display: flex;
    flex-direction: column;
}

body.weldgrid-shell.wg-annotation-editor-docked .wg-annotation-modal .modal-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto !important;
    overflow-x: hidden;
}

body.weldgrid-shell.wg-annotation-editor-docked .wg-annotation-modal .modal-footer,
body.weldgrid-shell.wg-annotation-editor-docked .wg-annotation-modal .modal-header {
    flex: 0 0 auto;
}

body.weldgrid-shell.wg-spool-editor-docked .swal2-container {
    height: 100dvh !important;
    align-items: stretch !important;
    justify-content: flex-end !important;
    overflow: hidden !important;
    padding: 0 !important;
}

body.weldgrid-shell.wg-spool-editor-docked .swal2-container .wg-spool-split-editor-popup {
    display: flex !important;
    flex-direction: column !important;
    height: calc(100dvh - 16px) !important;
    max-height: calc(100dvh - 16px) !important;
    margin: 0 0 0 auto !important;
    overflow: hidden !important;
}

body.weldgrid-shell.wg-spool-editor-docked .wg-spool-split-editor-popup .swal2-title {
    flex: 0 0 auto !important;
}

body.weldgrid-shell.wg-spool-editor-docked .wg-spool-split-editor-popup .swal2-html-container,
body.weldgrid-shell.wg-spool-editor-docked .wg-spool-split-editor-html {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
}

body.weldgrid-shell.wg-spool-editor-docked .wg-spool-split-editor-actions {
    flex: 0 0 auto !important;
    position: sticky !important;
    bottom: 0 !important;
    z-index: 30 !important;
    background: #eaf4fa !important;
    border-top: 1px solid rgba(12, 46, 76, .12);
}

body.weldgrid-shell .wg-spool-assignment-helper {
    margin: -4px 0 8px;
    color: #60758a;
    font-size: .82rem;
    font-weight: 850;
}

body.weldgrid-shell .wg-spool-icon-choice i[class^="wg-spool-symbol-"],
body.weldgrid-shell .wg-spool-overlay-label i[class^="wg-spool-symbol-"],
body.weldgrid-shell .wg-live-label-preview i[class^="wg-spool-symbol-"] {
    position: relative;
    display: inline-block;
    width: 22px;
    height: 16px;
    min-width: 22px;
}

body.weldgrid-shell .wg-spool-icon-choice i[class^="wg-spool-symbol-"]::before,
body.weldgrid-shell .wg-spool-overlay-label i[class^="wg-spool-symbol-"]::before,
body.weldgrid-shell .wg-live-label-preview i[class^="wg-spool-symbol-"]::before,
body.weldgrid-shell .wg-spool-icon-choice i[class^="wg-spool-symbol-"]::after,
body.weldgrid-shell .wg-spool-overlay-label i[class^="wg-spool-symbol-"]::after,
body.weldgrid-shell .wg-live-label-preview i[class^="wg-spool-symbol-"]::after {
    content: "";
    position: absolute;
    left: 2px;
    right: 2px;
    top: 50%;
    border-top: 2px solid currentColor;
    transform: translateY(-50%);
}

body.weldgrid-shell .wg-spool-symbol-butt-weld::after {
    left: 9px !important;
    right: 9px !important;
    top: 2px !important;
    bottom: 2px !important;
    border-top: 0 !important;
    border-left: 2px solid currentColor !important;
    transform: none !important;
}

body.weldgrid-shell .wg-spool-symbol-field-weld::after {
    left: 8px !important;
    right: auto !important;
    top: 3px !important;
    width: 8px !important;
    height: 8px !important;
    border: 2px solid currentColor !important;
    border-radius: 50% !important;
    transform: none !important;
}

body.weldgrid-shell .wg-spool-symbol-threaded::before {
    top: 4px !important;
    box-shadow: 0 5px 0 currentColor, 0 10px 0 currentColor;
}

body.weldgrid-shell .wg-spool-symbol-threaded::after {
    display: none;
}

body.weldgrid-shell .wg-spool-symbol-pipe-support::after {
    left: 10px !important;
    right: auto !important;
    top: 7px !important;
    height: 8px !important;
    border-top: 0 !important;
    border-left: 2px solid currentColor !important;
    transform: none !important;
}

body.weldgrid-shell .wg-spool-symbol-insulated::before {
    top: 5px !important;
    box-shadow: 0 7px 0 currentColor;
}

body.weldgrid-shell .wg-spool-symbol-insulated::after {
    display: none;
}

body.weldgrid-shell .wg-spool-symbol-insulated-traced::before {
    top: 5px !important;
    box-shadow: 0 7px 0 currentColor;
}

body.weldgrid-shell .wg-spool-symbol-insulated-traced::after {
    top: 2px !important;
    border-top-style: dashed !important;
}

@media  (max-width: 1100px) {
    body.weldgrid-shell.wg-annotation-editor-docked .wg-annotation-modal .modal-dialog {
        left: 12px;
        width: calc(100vw - 24px);
    }

    body.weldgrid-shell.wg-spool-editor-docked .swal2-container .wg-spool-split-editor-popup {
        width: calc(100vw - 24px) !important;
    }
}


/* WeldGrid Exports compact responsive refinements */
body.weldgrid-shell .wg-export-table {
    width: 100%;
    min-width: 0;
    table-layout: fixed;
}
body.weldgrid-shell .wg-export-table th,
body.weldgrid-shell .wg-export-table td {
    padding: 8px 10px;
    font-size: .84rem;
    vertical-align: middle;
}
body.weldgrid-shell .wg-export-table th:nth-child(1),
body.weldgrid-shell .wg-export-table td:nth-child(1) { width: 40px; }
body.weldgrid-shell .wg-export-table th:nth-child(2),
body.weldgrid-shell .wg-export-table td:nth-child(2) { width: 140px; }
body.weldgrid-shell .wg-export-table th:nth-child(3),
body.weldgrid-shell .wg-export-table td:nth-child(3) { width: 142px; }
body.weldgrid-shell .wg-export-table th:nth-child(4),
body.weldgrid-shell .wg-export-table td:nth-child(4) { width: auto; }
body.weldgrid-shell .wg-export-table th:nth-child(5),
body.weldgrid-shell .wg-export-table td:nth-child(5) { width: 190px; }
body.weldgrid-shell .wg-export-table th:nth-child(6),
body.weldgrid-shell .wg-export-table td:nth-child(6) { width: 86px; }
body.weldgrid-shell .wg-export-table th:nth-child(7),
body.weldgrid-shell .wg-export-table td:nth-child(7) { width: 132px; }
body.weldgrid-shell .wg-export-table th:nth-child(8),
body.weldgrid-shell .wg-export-table td:nth-child(8) { width: 132px; }
body.weldgrid-shell .wg-export-main-row {
    cursor: pointer;
}
body.weldgrid-shell .wg-export-main-row:hover td {
    background: #fbfdff;
}
body.weldgrid-shell .wg-export-main-row.is-expanded td {
    background: #fff8f3;
    border-bottom-color: rgba(255, 106, 26, .16);
}
body.weldgrid-shell .wg-export-file-name {
    overflow-wrap: anywhere;
    line-height: 1.25;
}
body.weldgrid-shell .wg-export-history-meta {
    overflow-wrap: anywhere;
    line-height: 1.25;
}
body.weldgrid-shell .wg-export-expand-hint {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    margin-top: 4px;
    color: var(--wg-muted);
    font-size: .7rem;
    font-weight: 850;
}
body.weldgrid-shell .wg-export-main-row.is-expanded .wg-export-expand-hint i {
    transform: rotate(180deg);
}
body.weldgrid-shell .wg-export-detail-row[hidden] {
    display: none !important;
}
body.weldgrid-shell .wg-export-detail-row td {
    padding: 0 10px 10px 50px;
    background: #fff8f3;
}
body.weldgrid-shell .wg-export-detail-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    border: 1px solid rgba(255, 106, 26, .18);
    border-radius: 8px;
    background: #fff;
    padding: 10px;
}
body.weldgrid-shell .wg-export-detail-grid div {
    min-width: 0;
    border: 1px solid rgba(12, 46, 76, .08);
    border-radius: 7px;
    background: #f8fbfd;
    padding: 8px;
}
body.weldgrid-shell .wg-export-detail-grid span {
    display: block;
    color: var(--wg-muted);
    font-size: .72rem;
    font-weight: 900;
}
body.weldgrid-shell .wg-export-detail-grid strong {
    display: block;
    margin-top: 3px;
    color: var(--wg-navy);
    font-size: .82rem;
    font-weight: 950;
    overflow-wrap: anywhere;
}
body.weldgrid-shell .wg-export-actions,
body.weldgrid-shell .wg-export-actions * {
    cursor: default;
}
body.weldgrid-shell #wgExportPreviewDownload {
    margin-left: auto;
}
body.weldgrid-shell .wg-export-preview-head {
    align-items: center;
}
body.weldgrid-shell .wg-export-pdf-shell {
    width: 100%;
    height: min(680px, calc(100vh - 210px));
    overflow: hidden;
    border-radius: 7px;
    background: #fff;
}
body.weldgrid-shell .wg-export-pdf-shell .wg-export-preview-frame {
    height: 100%;
}
body.weldgrid-shell .wg-export-excel-table th strong:only-child {
    padding-top: 0;
}
@media (max-width: 1280px) {
    body.weldgrid-shell .wg-export-table th:nth-child(5),
    body.weldgrid-shell .wg-export-table td:nth-child(5),
    body.weldgrid-shell .wg-export-table th:nth-child(6),
    body.weldgrid-shell .wg-export-table td:nth-child(6) {
        display: none;
    }
    body.weldgrid-shell .wg-export-detail-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}
@media (max-width: 980px) {
    body.weldgrid-shell .wg-export-table th:nth-child(2),
    body.weldgrid-shell .wg-export-table td:nth-child(2) { width: 120px; }
    body.weldgrid-shell .wg-export-table th:nth-child(3),
    body.weldgrid-shell .wg-export-table td:nth-child(3) { width: 118px; }
    body.weldgrid-shell .wg-export-table th:nth-child(7),
    body.weldgrid-shell .wg-export-table td:nth-child(7) {
        display: none;
    }
    body.weldgrid-shell .wg-export-detail-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (max-width: 700px) {
    body.weldgrid-shell .wg-export-table th:nth-child(2),
    body.weldgrid-shell .wg-export-table td:nth-child(2),
    body.weldgrid-shell .wg-export-table th:nth-child(3),
    body.weldgrid-shell .wg-export-table td:nth-child(3) {
        display: none;
    }
    body.weldgrid-shell .wg-export-table th:nth-child(8),
    body.weldgrid-shell .wg-export-table td:nth-child(8) { width: 118px; }
    body.weldgrid-shell .wg-export-detail-row td {
        padding-left: 10px;
    }
    body.weldgrid-shell .wg-export-detail-grid {
        grid-template-columns: 1fr;
    }
}

body.weldgrid-shell .wg-export-actions a,
body.weldgrid-shell .wg-export-actions button,
body.weldgrid-shell .wg-export-actions summary {
    cursor: pointer;
}


/* =========================================================
   WeldGrid PDF Spool Editor Scroll & Leader Bends
========================================================= */
body.weldgrid-shell.wg-spool-editor-docked .swal2-container {
    height: 100dvh !important;
    max-height: 100dvh !important;
    align-items: stretch !important;
    justify-content: flex-end !important;
    overflow: hidden !important;
    padding: 8px 12px !important;
    pointer-events: none !important;
}

body.weldgrid-shell.wg-spool-editor-docked .swal2-container .wg-spool-split-editor-popup {
    display: flex !important;
    flex-direction: column !important;
    width: min(1040px, 58vw) !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    min-height: 0 !important;
    margin: 0 0 0 auto !important;
    overflow: hidden !important;
    pointer-events: auto !important;
}

body.weldgrid-shell.wg-spool-editor-docked .wg-spool-split-editor-popup .swal2-title {
    flex: 0 0 auto !important;
}

body.weldgrid-shell.wg-spool-editor-docked .wg-spool-split-editor-popup .swal2-html-container,
body.weldgrid-shell.wg-spool-editor-docked .swal2-html-container.wg-spool-split-editor-html,
body.weldgrid-shell.wg-spool-editor-docked .wg-spool-split-editor-html {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    height: auto !important;
    max-height: none !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    padding: 0 18px 32px !important;
    margin: 0 !important;
    scrollbar-gutter: stable;
}

body.weldgrid-shell.wg-spool-editor-docked .wg-spool-split-editor-actions,
body.weldgrid-shell.wg-spool-editor-docked .swal2-actions.wg-spool-split-editor-actions {
    flex: 0 0 auto !important;
    position: relative !important;
    bottom: auto !important;
    left: auto !important;
    right: auto !important;
    z-index: 20 !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 12px 18px !important;
    box-sizing: border-box !important;
    background: #eaf4fa !important;
    border-top: 1px solid rgba(12, 46, 76, .12) !important;
}

body.weldgrid-shell .wg-annotation-leader-bend {
    position: absolute;
    z-index: 11;
    width: 22px;
    height: 22px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: transparent;
    transform: translate(-50%, -50%);
    opacity: .12;
    cursor: grab;
    pointer-events: auto;
    transition: opacity .14s ease, transform .14s ease;
}

body.weldgrid-shell .wg-annotation-leader-bend::before {
    content: "";
    position: absolute;
    inset: 5px;
    border: 2px solid #fff;
    border-radius: inherit;
    background: var(--wg-ann-color, #ff5f1f);
    box-shadow: 0 0 0 2px var(--wg-ann-color, #ff5f1f), 0 6px 14px rgba(8, 36, 61, .2);
}

body.weldgrid-shell .wg-annotation-leader-bend:hover,
body.weldgrid-shell .wg-annotation-leader-bend:focus-visible,
body.weldgrid-shell .wg-annotation-leader-bend.is-visible {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.06);
}

body.weldgrid-shell .wg-annotation-leader-bend:active {
    cursor: grabbing;
}

@media (max-width: 1180px) {
    body.weldgrid-shell.wg-spool-editor-docked .swal2-container .wg-spool-split-editor-popup {
        width: min(760px, 62vw) !important;
    }
}


/* =========================================================
   WeldGrid Spool Editor Final Scroll Guard
========================================================= */
body.weldgrid-shell.wg-spool-editor-docked .swal2-container .wg-spool-split-editor-popup {
    padding: 0 !important;
    box-sizing: border-box !important;
}

body.weldgrid-shell.wg-spool-editor-docked .wg-spool-split-editor-popup > .swal2-html-container.wg-spool-split-editor-html {
    display: block !important;
    flex: 1 1 0 !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    overscroll-behavior: contain !important;
    -webkit-overflow-scrolling: touch;
    padding: 0 20px 56px !important;
}

body.weldgrid-shell.wg-spool-editor-docked .wg-spool-split-editor-popup > .swal2-actions.wg-spool-split-editor-actions {
    display: flex !important;
    flex: 0 0 auto !important;
    justify-content: flex-end !important;
    gap: 12px !important;
    position: relative !important;
    inset: auto !important;
    min-height: 72px !important;
}

body.weldgrid-shell.wg-spool-editor-docked .wg-spool-split-editor-html .wg-spool-create-assignment {
    margin-bottom: 18px !important;
}


/* =========================================================
   WeldGrid Spool SweetAlert Scroll Hard Fix
========================================================= */
.swal2-container.wg-spool-editor-scroll-container {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    display: flex !important;
    align-items: stretch !important;
    justify-content: flex-end !important;
    overflow: hidden !important;
    padding: 0 !important;
    pointer-events: none !important;
    box-sizing: border-box !important;
}

.swal2-container.wg-spool-editor-scroll-container .wg-spool-split-editor-popup {
    display: flex !important;
    flex-direction: column !important;
    width: min(1040px, 58vw) !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    min-height: 0 !important;
    margin: 0 0 0 auto !important;
    padding: 0 !important;
    overflow: hidden !important;
    pointer-events: auto !important;
    box-sizing: border-box !important;
}

.swal2-container.wg-spool-editor-scroll-container .wg-spool-split-editor-popup > .swal2-title {
    flex: 0 0 auto !important;
}

.swal2-container.wg-spool-editor-scroll-container .wg-spool-split-editor-popup > .swal2-html-container.wg-spool-split-editor-html {
    flex: 1 1 0 !important;
    min-height: 0 !important;
    height: auto !important;
    max-height: none !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    overscroll-behavior: contain !important;
    -webkit-overflow-scrolling: touch !important;
    touch-action: pan-y !important;
    scrollbar-gutter: stable !important;
    margin: 0 !important;
    padding: 0 20px 118px !important;
    text-align: left !important;
    box-sizing: border-box !important;
}

.swal2-container.wg-spool-editor-scroll-container .wg-spool-split-editor-popup > .swal2-actions.wg-spool-split-editor-actions {
    flex: 0 0 auto !important;
    display: flex !important;
    justify-content: flex-end !important;
    gap: 12px !important;
    width: 100% !important;
    min-height: 72px !important;
    margin: 0 !important;
    padding: 12px 20px 16px !important;
    position: relative !important;
    inset: auto !important;
    z-index: 30 !important;
    box-sizing: border-box !important;
    background: #eaf4fa !important;
    border-top: 1px solid rgba(12, 46, 76, .12) !important;
    box-shadow: 0 -12px 22px rgba(8, 33, 55, .07) !important;
}

.swal2-container.wg-spool-editor-scroll-container .wg-spool-editor-form {
    min-height: max-content !important;
    padding-bottom: 18px !important;
}

.swal2-container.wg-spool-editor-scroll-container .wg-spool-assignment-list,
.swal2-container.wg-spool-editor-scroll-container .wg-spool-icon-grid,
.swal2-container.wg-spool-editor-scroll-container .wg-spool-segment-table-wrap {
    overscroll-behavior: contain !important;
}

@media (max-width: 1180px) {
    .swal2-container.wg-spool-editor-scroll-container .wg-spool-split-editor-popup {
        width: min(760px, 62vw) !important;
    }
}

@media (max-width: 900px) {
    .swal2-container.wg-spool-editor-scroll-container {
        padding: 0 !important;
    }

    .swal2-container.wg-spool-editor-scroll-container .wg-spool-split-editor-popup {
        width: 100vw !important;
        max-width: 100vw !important;
        height: 100dvh !important;
        max-height: 100dvh !important;
    }
}

/* Spool editor as right-side drawer */
.swal2-container.wg-spool-editor-scroll-container {
    padding: 0 !important;
    align-items: stretch !important;
    justify-content: flex-end !important;
    overflow: hidden !important;
    z-index: 20000 !important;
}

.swal2-container.wg-spool-editor-scroll-container .swal2-popup.wg-spool-split-editor-popup {
    width: min(860px, 48vw) !important;
    max-width: min(860px, 48vw) !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    margin: 0 !important;
    border-radius: 18px 0 0 18px !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
}

.swal2-container.wg-spool-editor-scroll-container .swal2-title {
    flex: 0 0 auto !important;
    padding: 22px 56px 10px 24px !important;
    margin: 0 !important;
    text-align: left !important;
}

.swal2-container.wg-spool-editor-scroll-container .swal2-close {
    position: absolute !important;
    top: 14px !important;
    right: 18px !important;
    z-index: 5 !important;
}

.swal2-container.wg-spool-editor-scroll-container .swal2-html-container.wg-spool-split-editor-html {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    height: auto !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 0 24px 18px 24px !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    overscroll-behavior: contain !important;
    text-align: left !important;
}

.swal2-container.wg-spool-editor-scroll-container .swal2-actions.wg-spool-split-editor-actions {
    flex: 0 0 auto !important;
    position: sticky !important;
    bottom: 0 !important;
    z-index: 3 !important;
    margin: 0 !important;
    padding: 16px 24px !important;
    justify-content: flex-end !important;
    background: #eef6fb !important;
    border-top: 1px solid rgba(12, 46, 76, .14) !important;
    box-shadow: 0 -10px 22px rgba(7, 27, 47, .08) !important;
}

@media (max-width: 1180px) {
    .swal2-container.wg-spool-editor-scroll-container .swal2-popup.wg-spool-split-editor-popup {
        width: min(720px, 92vw) !important;
        max-width: min(720px, 92vw) !important;
    }
}

@media (max-width: 720px) {
    .swal2-container.wg-spool-editor-scroll-container .swal2-popup.wg-spool-split-editor-popup {
        width: 100vw !important;
        max-width: 100vw !important;
        border-radius: 0 !important;
    }
}

/* =========================================================
   FINAL OVERRIDE: PDF Viewer spool editor right drawer
   Keeps the editor full-height on the right and scrolls inside.
========================================================= */
body.weldgrid-shell.wg-spool-editor-docked .swal2-container.wg-spool-editor-scroll-container,
.swal2-container.wg-spool-editor-scroll-container {
    position: fixed !important;
    inset: 0 !important;
    width: 100dvw !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    min-height: 100dvh !important;
    padding: 0 !important;
    margin: 0 !important;
    display: flex !important;
    align-items: stretch !important;
    justify-content: flex-end !important;
    overflow: hidden !important;
    pointer-events: none !important;
    z-index: 20000 !important;
}

body.weldgrid-shell.wg-spool-editor-docked .swal2-container.wg-spool-editor-scroll-container .swal2-popup.wg-spool-split-editor-popup,
.swal2-container.wg-spool-editor-scroll-container .swal2-popup.wg-spool-split-editor-popup,
.swal2-container.wg-spool-editor-scroll-container .wg-spool-split-editor-popup {
    align-self: stretch !important;
    display: flex !important;
    flex-direction: column !important;
    width: min(820px, 46vw) !important;
    max-width: min(820px, 46vw) !important;
    height: 100dvh !important;
    min-height: 100dvh !important;
    max-height: 100dvh !important;
    margin: 0 0 0 auto !important;
    padding: 0 !important;
    border-radius: 18px 0 0 18px !important;
    overflow: hidden !important;
    pointer-events: auto !important;
    box-sizing: border-box !important;
}

body.weldgrid-shell.wg-spool-editor-docked .wg-spool-split-editor-popup > .swal2-title,
.swal2-container.wg-spool-editor-scroll-container .wg-spool-split-editor-popup > .swal2-title {
    flex: 0 0 auto !important;
    margin: 0 !important;
    padding: 22px 58px 10px 24px !important;
    text-align: left !important;
    line-height: 1.15 !important;
}

body.weldgrid-shell.wg-spool-editor-docked .wg-spool-split-editor-popup > .swal2-close,
.swal2-container.wg-spool-editor-scroll-container .wg-spool-split-editor-popup > .swal2-close {
    position: absolute !important;
    top: 12px !important;
    right: 16px !important;
    z-index: 50 !important;
}

body.weldgrid-shell.wg-spool-editor-docked .wg-spool-split-editor-popup > .swal2-html-container.wg-spool-split-editor-html,
body.weldgrid-shell.wg-spool-editor-docked .wg-spool-split-editor-popup > .swal2-html-container,
.swal2-container.wg-spool-editor-scroll-container .wg-spool-split-editor-popup > .swal2-html-container.wg-spool-split-editor-html,
.swal2-container.wg-spool-editor-scroll-container .wg-spool-split-editor-popup > .swal2-html-container {
    display: block !important;
    flex: 1 1 0 !important;
    min-height: 0 !important;
    height: auto !important;
    max-height: none !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 24px 18px 24px !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    overscroll-behavior: contain !important;
    -webkit-overflow-scrolling: touch !important;
    text-align: left !important;
    box-sizing: border-box !important;
}

body.weldgrid-shell.wg-spool-editor-docked .wg-spool-split-editor-popup > .swal2-actions.wg-spool-split-editor-actions,
.swal2-container.wg-spool-editor-scroll-container .wg-spool-split-editor-popup > .swal2-actions.wg-spool-split-editor-actions,
.swal2-container.wg-spool-editor-scroll-container .swal2-actions.wg-spool-split-editor-actions {
    flex: 0 0 auto !important;
    display: flex !important;
    justify-content: flex-end !important;
    gap: 12px !important;
    width: 100% !important;
    min-height: 72px !important;
    margin: 0 !important;
    padding: 14px 24px 18px !important;
    position: relative !important;
    inset: auto !important;
    z-index: 40 !important;
    box-sizing: border-box !important;
    background: #eaf4fa !important;
    border-top: 1px solid rgba(12, 46, 76, .14) !important;
    box-shadow: 0 -12px 24px rgba(8, 33, 55, .08) !important;
}

body.weldgrid-shell.wg-spool-editor-docked .wg-spool-editor-form {
    min-height: max-content !important;
    padding-bottom: 18px !important;
}

body.weldgrid-shell.wg-spool-editor-docked .wg-spool-assignment-list,
body.weldgrid-shell.wg-spool-editor-docked .wg-spool-icon-grid,
body.weldgrid-shell.wg-spool-editor-docked .wg-spool-segment-table-wrap {
    overscroll-behavior: contain !important;
}

@media (max-width: 1280px) {
    body.weldgrid-shell.wg-spool-editor-docked .swal2-container.wg-spool-editor-scroll-container .swal2-popup.wg-spool-split-editor-popup,
    .swal2-container.wg-spool-editor-scroll-container .swal2-popup.wg-spool-split-editor-popup,
    .swal2-container.wg-spool-editor-scroll-container .wg-spool-split-editor-popup {
        width: min(720px, 56vw) !important;
        max-width: min(720px, 56vw) !important;
    }
}

@media (max-width: 900px) {
    body.weldgrid-shell.wg-spool-editor-docked .swal2-container.wg-spool-editor-scroll-container .swal2-popup.wg-spool-split-editor-popup,
    .swal2-container.wg-spool-editor-scroll-container .swal2-popup.wg-spool-split-editor-popup,
    .swal2-container.wg-spool-editor-scroll-container .wg-spool-split-editor-popup {
        width: 100vw !important;
        max-width: 100vw !important;
        border-radius: 0 !important;
    }
}

/* =========================================================
   WeldGrid Spool Modal Layout
   Normal SweetAlert layout for spool editing; separate from
   older right-drawer spool editor rules.
========================================================= */
.swal2-container.wg-spool-modal-container {
    position: fixed !important;
    inset: 0 !important;
    width: 100dvw !important;
    height: 100dvh !important;
    padding: 18px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    overflow: hidden !important;
    z-index: 20000 !important;
}

.swal2-container.wg-spool-modal-container .swal2-popup.wg-spool-modal-popup {
    width: min(760px, 94vw) !important;
    max-width: min(760px, 94vw) !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: 88vh !important;
    margin: 0 !important;
    padding: 0 !important;
    border-radius: 14px !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
}

.swal2-container.wg-spool-modal-container .wg-spool-modal-popup > .swal2-title {
    flex: 0 0 auto !important;
    margin: 0 !important;
    padding: 22px 56px 10px 24px !important;
    text-align: left !important;
    line-height: 1.15 !important;
}

.swal2-container.wg-spool-modal-container .wg-spool-modal-popup > .swal2-close {
    position: absolute !important;
    top: 12px !important;
    right: 16px !important;
    z-index: 50 !important;
}

.swal2-container.wg-spool-modal-container .wg-spool-modal-popup > .swal2-html-container.wg-spool-modal-html {
    flex: 1 1 0 !important;
    min-height: 0 !important;
    max-height: calc(88vh - 150px) !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 20px 24px !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    overscroll-behavior: contain !important;
    -webkit-overflow-scrolling: touch !important;
    text-align: left !important;
    box-sizing: border-box !important;
}

.swal2-container.wg-spool-modal-container .wg-spool-modal-popup > .swal2-actions.wg-spool-modal-actions {
    flex: 0 0 auto !important;
    display: flex !important;
    justify-content: flex-end !important;
    gap: 12px !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 14px 20px 18px !important;
    background: #eaf4fa !important;
    border-top: 1px solid rgba(12, 46, 76, .14) !important;
    box-shadow: 0 -10px 22px rgba(7, 27, 47, .08) !important;
    box-sizing: border-box !important;
}

.swal2-container.wg-spool-modal-container .wg-spool-editor-form {
    min-height: max-content !important;
    padding-bottom: 12px !important;
}

.swal2-container.wg-spool-modal-container .wg-spool-assignment-list,
.swal2-container.wg-spool-modal-container .wg-spool-icon-grid,
.swal2-container.wg-spool-modal-container .wg-spool-segment-table-wrap {
    overscroll-behavior: contain !important;
}

@media (max-width: 720px) {
    .swal2-container.wg-spool-modal-container {
        padding: 10px !important;
    }

    .swal2-container.wg-spool-modal-container .swal2-popup.wg-spool-modal-popup {
        width: 96vw !important;
        max-height: 94vh !important;
    }

    .swal2-container.wg-spool-modal-container .wg-spool-modal-popup > .swal2-html-container.wg-spool-modal-html {
        max-height: calc(94vh - 150px) !important;
        padding: 0 14px 20px !important;
    }
}


.swal2-container.wg-spool-editor-scroll-container .swal2-popup.wg-spool-split-editor-popup {
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-start !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    min-height: 0 !important;
    overflow: hidden !important;
}

.swal2-container.wg-spool-editor-scroll-container .wg-spool-split-editor-popup > .swal2-content {
    display: flex !important;
    flex-direction: column !important;
    flex: 1 1 0 !important;
    min-height: 0 !important;
    height: 0 !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    text-align: left !important;
}

.swal2-container.wg-spool-editor-scroll-container .wg-spool-split-editor-popup > .swal2-content > .swal2-html-container.wg-spool-split-editor-html {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    height: 100% !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 24px 18px !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    overscroll-behavior: contain !important;
    -webkit-overflow-scrolling: touch !important;
    text-align: left !important;
    box-sizing: border-box !important;
}

.swal2-container.wg-spool-editor-scroll-container .wg-spool-split-editor-popup > .swal2-actions.wg-spool-split-editor-actions {
    flex: 0 0 auto !important;
    margin: 0 !important;
    padding: 14px 24px 18px !important;
    position: relative !important;
    bottom: auto !important;
}
/* =========================================================
   WeldGrid PDF Viewer Focus Mode
========================================================= */

body.weldgrid-shell .wg-pdf-workspace {
    --wg-pdf-focus-dark: #06182a;
    --wg-pdf-focus-dark-2: #08243b;
    --wg-pdf-focus-dark-3: #0b3554;
    --wg-pdf-focus-line: rgba(137, 190, 222, .24);
    --wg-pdf-focus-text: #f7fbff;
    --wg-pdf-focus-muted: #a9bed1;
    --wg-pdf-focus-soft: rgba(255, 255, 255, .075);
    --wg-pdf-focus-soft-2: rgba(255, 255, 255, .12);
}

body.weldgrid-shell .wg-pdf-workspace .wg-pdf-toolbar {
    background: linear-gradient(135deg, var(--wg-pdf-focus-dark) 0%, var(--wg-pdf-focus-dark-2) 58%, var(--wg-pdf-focus-dark-3) 100%);
    border: 1px solid var(--wg-pdf-focus-line);
    box-shadow: 0 14px 34px rgba(2, 14, 28, .22);
}

body.weldgrid-shell .wg-pdf-workspace .wg-pdf-toolbar .wg-btn,
body.weldgrid-shell .wg-pdf-workspace .wg-pdf-toolbar .form-select,
body.weldgrid-shell .wg-pdf-workspace .wg-pdf-toolbar .wg-page-counter {
    background: var(--wg-pdf-focus-soft);
    border-color: var(--wg-pdf-focus-line);
    color: var(--wg-pdf-focus-text);
}

body.weldgrid-shell .wg-pdf-workspace .wg-pdf-toolbar .form-select {
    color-scheme: dark;
}

body.weldgrid-shell .wg-pdf-workspace .wg-pdf-toolbar .form-select option,
body.weldgrid-shell .wg-pdf-workspace .wg-pdf-side .form-select option {
    background: #ffffff;
    color: #06182a;
}

body.weldgrid-shell .wg-pdf-workspace .wg-pdf-toolbar .wg-btn:hover,
body.weldgrid-shell .wg-pdf-workspace .wg-pdf-toolbar .form-select:hover {
    background: var(--wg-pdf-focus-soft-2);
    border-color: rgba(255, 255, 255, .28);
    color: #ffffff;
}

body.weldgrid-shell .wg-pdf-workspace .wg-pdf-toolbar .wg-btn-primary,
body.weldgrid-shell .wg-pdf-workspace .wg-pdf-toolbar .wg-annotation-mode-trigger {
    background: #ff5f1f;
    border-color: #ff5f1f;
    color: #ffffff;
}

body.weldgrid-shell .wg-pdf-workspace .wg-pdf-toolbar .wg-btn-primary:hover,
body.weldgrid-shell .wg-pdf-workspace .wg-pdf-toolbar .wg-annotation-mode-trigger:hover {
    background: #e84f13;
    border-color: #e84f13;
}

body.weldgrid-shell .wg-pdf-workspace .wg-pdf-side > .wg-card,
body.weldgrid-shell .wg-pdf-workspace .wg-annotation-list-panel {
    background: linear-gradient(180deg, var(--wg-pdf-focus-dark-2) 0%, var(--wg-pdf-focus-dark) 100%);
    border-color: var(--wg-pdf-focus-line);
    color: var(--wg-pdf-focus-text);
    box-shadow: 0 18px 40px rgba(2, 14, 28, .18);
}

body.weldgrid-shell .wg-pdf-workspace .wg-pdf-side p,
body.weldgrid-shell .wg-pdf-workspace .wg-pdf-side small,
body.weldgrid-shell .wg-pdf-workspace .wg-pdf-side span,
body.weldgrid-shell .wg-pdf-workspace .wg-pdf-side label {
    color: var(--wg-pdf-focus-muted);
}

.wg-spool-group-copy strong {
    color: #08243d!important;
}
body.weldgrid-shell .wg-pdf-workspace .wg-pdf-side .form-control,
body.weldgrid-shell .wg-pdf-workspace .wg-pdf-side .form-select,
body.weldgrid-shell .wg-pdf-workspace .wg-pdf-side input[type="search"] {
    background: rgba(255, 255, 255, .08);
    border-color: var(--wg-pdf-focus-line);
    color: var(--wg-pdf-focus-text);
    color-scheme: dark;
}

body.weldgrid-shell .wg-pdf-workspace .wg-pdf-side .form-control::placeholder,
body.weldgrid-shell .wg-pdf-workspace .wg-pdf-side input[type="search"]::placeholder {
    color: rgba(247, 251, 255, .62);
}

body.weldgrid-shell .wg-pdf-workspace .wg-upload-mode,
body.weldgrid-shell .wg-pdf-workspace .wg-pdf-dropzone,
body.weldgrid-shell .wg-pdf-workspace .wg-pdf-list-controls,
body.weldgrid-shell .wg-pdf-workspace .wg-annotation-list-tools,
body.weldgrid-shell .wg-pdf-workspace .wg-spool-bulk-action,
body.weldgrid-shell .wg-pdf-workspace .wg-spool-group-toggle {
    background: rgba(255, 255, 255, .07);
    border-color: var(--wg-pdf-focus-line);
}

body.weldgrid-shell .wg-pdf-workspace .wg-pdf-list-item,
body.weldgrid-shell .wg-pdf-workspace .wg-annotation-list-item,
body.weldgrid-shell .wg-pdf-workspace .wg-spool-list-item,
body.weldgrid-shell .wg-pdf-workspace .wg-spool-group-card,
body.weldgrid-shell .wg-pdf-workspace .wg-spool-group-toggle {
    background: rgba(255, 255, 255, .06);
    border-color: var(--wg-pdf-focus-line);
    color: var(--wg-pdf-focus-text);
}

body.weldgrid-shell .wg-pdf-workspace .wg-pdf-list-item:hover,
body.weldgrid-shell .wg-pdf-workspace .wg-annotation-list-item:hover,
body.weldgrid-shell .wg-pdf-workspace .wg-spool-list-item:hover,
body.weldgrid-shell .wg-pdf-workspace .wg-spool-group-toggle:hover {
    background: rgba(255, 255, 255, .1);
    border-color: rgba(255, 255, 255, .28);
}

body.weldgrid-shell .wg-pdf-workspace .wg-pdf-list-item.active,
body.weldgrid-shell .wg-pdf-workspace .wg-annotation-list-item.active,
body.weldgrid-shell .wg-pdf-workspace .wg-spool-list-item.active {
    background: rgba(255, 95, 31, .14);
    border-color: rgba(255, 95, 31, .72);
    box-shadow: inset 3px 0 0 #ff5f1f;
}

body.weldgrid-shell .wg-pdf-workspace .wg-pdf-mini-actions .wg-btn,
body.weldgrid-shell .wg-pdf-workspace .wg-pdf-side .wg-btn {
    background: rgba(255, 255, 255, .08);
    border-color: var(--wg-pdf-focus-line);
    color: var(--wg-pdf-focus-text);
}

body.weldgrid-shell .wg-pdf-workspace .wg-pdf-mini-actions .wg-btn:hover,
body.weldgrid-shell .wg-pdf-workspace .wg-pdf-side .wg-btn:hover {
    background: rgba(255, 255, 255, .13);
    border-color: rgba(255, 255, 255, .3);
}

body.weldgrid-shell .wg-pdf-workspace .wg-pdf-side .wg-btn-primary,
body.weldgrid-shell .wg-pdf-workspace .wg-pdf-side .wg-upload-box .wg-btn-primary {
    background: #ff5f1f;
    border-color: #ff5f1f;
    color: #ffffff;
}

body.weldgrid-shell .wg-pdf-workspace .wg-pdf-viewer-card {
    background: #0a2034;
    border-color: rgba(8, 36, 59, .28);
}

body.weldgrid-shell .wg-pdf-workspace .wg-active-pdf-bar,
body.weldgrid-shell .wg-pdf-workspace .wg-version-timeline {
    background: linear-gradient(135deg, #06182a 0%, #08243b 100%);
    border-color: var(--wg-pdf-focus-line);
    color: var(--wg-pdf-focus-text);
}

body.weldgrid-shell .wg-pdf-workspace .wg-active-pdf-bar strong,
body.weldgrid-shell .wg-pdf-workspace .wg-active-pdf-bar span,
body.weldgrid-shell .wg-pdf-workspace .wg-version-timeline strong,
body.weldgrid-shell .wg-pdf-workspace .wg-version-timeline span,
body.weldgrid-shell .wg-pdf-workspace .wg-version-timeline small {
    color: var(--wg-pdf-focus-text);
}

body.weldgrid-shell .wg-pdf-workspace .wg-version-card {
    background: rgba(255, 255, 255, .075);
    border-color: var(--wg-pdf-focus-line);
    color: var(--wg-pdf-focus-text);
}

body.weldgrid-shell .wg-pdf-workspace .wg-version-card.selected,
body.weldgrid-shell .wg-pdf-workspace .wg-version-card.active {
    background: rgba(255, 95, 31, .16);
    border-color: rgba(255, 95, 31, .7);
}

body.weldgrid-shell .wg-pdf-workspace .wg-pdf-chip,
body.weldgrid-shell .wg-pdf-workspace .wg-extraction-status,
body.weldgrid-shell .wg-pdf-workspace .wg-version-card-badge,
body.weldgrid-shell .wg-pdf-workspace .wg-version-badge-active,
body.weldgrid-shell .wg-pdf-workspace .wg-version-badge-preview {
    background: rgba(255, 255, 255, .1);
    border-color: var(--wg-pdf-focus-line);
    color: var(--wg-pdf-focus-text)!important;
}

body.weldgrid-shell .wg-pdf-workspace .wg-pdf-canvas-shell {
    background: #ffffff;
    border-color: rgba(8, 36, 59, .22);
    box-shadow: 0 24px 52px rgba(2, 14, 28, .2);
}

body.weldgrid-shell .wg-pdf-workspace .wg-pdf-side-tab {
    background: #06182a;
    border-color: rgba(137, 190, 222, .32);
    color: #ffffff;
    box-shadow: 0 12px 26px rgba(2, 14, 28, .28);
}

body.weldgrid-shell .wg-pdf-workspace .wg-pdf-side-tab:hover {
    background: #0b3554;
}

/* =========================================================
   WeldGrid PDF Viewer Focus Tuning
========================================================= */

body.weldgrid-shell .wg-pdf-workspace {
    --wg-pdf-focus-dark: #0d314b;
    --wg-pdf-focus-dark-2: #123f5f;
    --wg-pdf-focus-dark-3: #1b6f97;
    --wg-pdf-focus-line: rgba(176, 221, 245, .34);
    --wg-pdf-focus-text: #ffffff;
    --wg-pdf-focus-muted: #d5e6f2;
    --wg-pdf-focus-soft: rgba(255, 255, 255, .11);
    --wg-pdf-focus-soft-2: rgba(255, 255, 255, .17);
}

body.weldgrid-shell .wg-pdf-workspace .wg-pdf-toolbar {
    padding: 12px 14px;
    row-gap: 10px;
    background: linear-gradient(135deg, #0d314b 0%, #124b6f 62%, #1f7fa8 100%);
    border-color: rgba(176, 221, 245, .38);
    box-shadow: 0 12px 28px rgba(7, 39, 64, .2);
}

body.weldgrid-shell .wg-pdf-workspace .wg-pdf-toolbar .wg-btn,
body.weldgrid-shell .wg-pdf-workspace .wg-pdf-toolbar .form-select,
body.weldgrid-shell .wg-pdf-workspace .wg-pdf-toolbar .wg-page-counter {
    background: rgba(255, 255, 255, .14);
    border-color: rgba(191, 226, 246, .36);
    color: #ffffff;
}

body.weldgrid-shell .wg-pdf-workspace .wg-pdf-toolbar .wg-btn:disabled,
body.weldgrid-shell .wg-pdf-workspace .wg-pdf-toolbar .wg-btn.disabled {
    background: rgba(255, 255, 255, .08);
    border-color: rgba(191, 226, 246, .22);
    color: rgba(235, 245, 251, .72);
    opacity: .78;
}

body.weldgrid-shell .wg-pdf-workspace .wg-pdf-toolbar .wg-btn:hover,
body.weldgrid-shell .wg-pdf-workspace .wg-pdf-toolbar .form-select:hover {
    background: rgba(255, 255, 255, .2);
    border-color: rgba(222, 241, 252, .5);
}

body.weldgrid-shell .wg-pdf-workspace .wg-pdf-side > .wg-card,
body.weldgrid-shell .wg-pdf-workspace .wg-annotation-list-panel {
    background: linear-gradient(180deg, #123f5f 0%, #0d314b 100%);
    border-color: rgba(176, 221, 245, .34);
    box-shadow: 0 16px 34px rgba(7, 39, 64, .16);
}

body.weldgrid-shell .wg-pdf-workspace .wg-pdf-side .wg-card-head h2,
body.weldgrid-shell .wg-pdf-workspace .wg-pdf-side .wg-card-head h3,
body.weldgrid-shell .wg-pdf-workspace .wg-pdf-side .wg-pdf-list-item strong,
body.weldgrid-shell .wg-pdf-workspace .wg-pdf-side .wg-annotation-list-item strong,
body.weldgrid-shell .wg-pdf-workspace .wg-pdf-side .wg-spool-list-item strong,
body.weldgrid-shell .wg-pdf-workspace .wg-pdf-side {
    color: #ffffff;
}

body.weldgrid-shell .wg-pdf-workspace .wg-pdf-side .wg-pdf-list-item small,
body.weldgrid-shell .wg-pdf-workspace .wg-pdf-side .wg-annotation-list-item small,
body.weldgrid-shell .wg-pdf-workspace .wg-pdf-side .wg-spool-list-item small,
body.weldgrid-shell .wg-pdf-workspace .wg-pdf-side .wg-spool-group-copy em {
    color: #c9ddea;
}

body.weldgrid-shell .wg-pdf-workspace .wg-pdf-side .form-control,
body.weldgrid-shell .wg-pdf-workspace .wg-pdf-side .form-select,
body.weldgrid-shell .wg-pdf-workspace .wg-pdf-side input[type="search"] {
    background: rgba(255, 255, 255, .13);
    border-color: rgba(191, 226, 246, .34);
    color: #ffffff;
}

body.weldgrid-shell .wg-pdf-workspace .wg-pdf-side .form-control::placeholder,
body.weldgrid-shell .wg-pdf-workspace .wg-pdf-side input[type="search"]::placeholder {
    color: rgba(235, 245, 251, .7);
}

body.weldgrid-shell .wg-pdf-workspace .wg-upload-mode,
body.weldgrid-shell .wg-pdf-workspace .wg-pdf-dropzone,
body.weldgrid-shell .wg-pdf-workspace .wg-pdf-list-controls,
body.weldgrid-shell .wg-pdf-workspace .wg-annotation-list-tools,
body.weldgrid-shell .wg-pdf-workspace .wg-spool-bulk-action,
body.weldgrid-shell .wg-pdf-workspace .wg-spool-group-toggle {
    background: rgba(255, 255, 255, .1);
    border-color: rgba(191, 226, 246, .28);
}

body.weldgrid-shell .wg-pdf-workspace .wg-pdf-list-item,
body.weldgrid-shell .wg-pdf-workspace .wg-annotation-list-item,
body.weldgrid-shell .wg-pdf-workspace .wg-spool-list-item,
body.weldgrid-shell .wg-pdf-workspace .wg-spool-group-card,
body.weldgrid-shell .wg-pdf-workspace .wg-spool-group-toggle {
    background: rgba(255, 255, 255, .1);
    border-color: rgba(191, 226, 246, .28);
}

body.weldgrid-shell .wg-pdf-workspace .wg-pdf-list-item:hover,
body.weldgrid-shell .wg-pdf-workspace .wg-annotation-list-item:hover,
body.weldgrid-shell .wg-pdf-workspace .wg-spool-list-item:hover,
body.weldgrid-shell .wg-pdf-workspace .wg-spool-group-toggle:hover {
    background: rgba(255, 255, 255, .16);
    border-color: rgba(222, 241, 252, .44);
}

body.weldgrid-shell .wg-pdf-workspace .wg-pdf-list-item.active,
body.weldgrid-shell .wg-pdf-workspace .wg-annotation-list-item.active,
body.weldgrid-shell .wg-pdf-workspace .wg-spool-list-item.active {
    background: rgba(255, 95, 31, .18);
    border-color: rgba(255, 95, 31, .78);
}

body.weldgrid-shell .wg-pdf-workspace .wg-pdf-viewer-card {
    background: #e8f2f7;
    border-color: rgba(13, 49, 75, .24);
}

body.weldgrid-shell .wg-pdf-workspace .wg-active-pdf-bar,
body.weldgrid-shell .wg-pdf-workspace .wg-version-timeline {
    background: linear-gradient(135deg, #123f5f 0%, #1c6f94 100%);
    border-color: rgba(176, 221, 245, .34);
}

body.weldgrid-shell .wg-pdf-workspace .wg-active-pdf-bar strong,
body.weldgrid-shell .wg-pdf-workspace .wg-active-pdf-bar span,
body.weldgrid-shell .wg-pdf-workspace .wg-active-pdf-bar small,
body.weldgrid-shell .wg-pdf-workspace .wg-version-timeline strong,
body.weldgrid-shell .wg-pdf-workspace .wg-version-timeline span,
body.weldgrid-shell .wg-pdf-workspace .wg-version-timeline small {
    color: #ffffff;
}

body.weldgrid-shell .wg-pdf-workspace .wg-version-card {
    background: rgba(255, 255, 255, .14);
    border-color: rgba(191, 226, 246, .32);
}

body.weldgrid-shell .wg-pdf-workspace .wg-pdf-canvas-shell {
    background: #ffffff;
    border-color: rgba(13, 49, 75, .18);
}

body.weldgrid-shell .wg-pdf-workspace .wg-pdf-side-tab {
    background: #123f5f;
    border-color: rgba(176, 221, 245, .38);
}

body.weldgrid-shell .wg-pdf-workspace .wg-pdf-side-tab:hover {
    background: #1b6f97;
}

body.weldgrid-shell .wg-pdf-workspace .wg-active-pdf-bar .text-muted,
body.weldgrid-shell .wg-pdf-workspace .wg-version-timeline .text-muted,
body.weldgrid-shell .wg-pdf-workspace .wg-pdf-side .text-muted,
body.weldgrid-shell .wg-pdf-workspace .wg-pdf-side .wg-muted,
body.weldgrid-shell .wg-pdf-workspace .wg-pdf-side .small,
body.weldgrid-shell .wg-pdf-workspace .wg-pdf-side .help-text {
    color: #d5e6f2 !important;
}

body.weldgrid-shell .wg-pdf-workspace .wg-active-pdf-bar .wg-pdf-meta,
body.weldgrid-shell .wg-pdf-workspace .wg-active-pdf-bar .wg-pdf-subtitle,
body.weldgrid-shell .wg-pdf-workspace .wg-version-timeline .wg-version-meta {
    color: #e6f2f9 !important;
}


/* WeldGrid export table density and observations */
body.weldgrid-shell .wg-export-history-card { min-width: 0; }
body.weldgrid-shell .wg-export-table { min-width: 960px; }
body.weldgrid-shell .wg-export-table th,
body.weldgrid-shell .wg-export-table td { padding: 6px 8px; font-size: .78rem; }
body.weldgrid-shell .wg-export-table th:nth-child(2),
body.weldgrid-shell .wg-export-table td:nth-child(2) { width: 118px; }
body.weldgrid-shell .wg-export-table th:nth-child(3),
body.weldgrid-shell .wg-export-table td:nth-child(3) { width: 126px; }
body.weldgrid-shell .wg-export-table th:nth-child(5),
body.weldgrid-shell .wg-export-table td:nth-child(5) { width: 118px; }
body.weldgrid-shell .wg-export-table th:nth-child(6),
body.weldgrid-shell .wg-export-table td:nth-child(6) { width: 74px; }
body.weldgrid-shell .wg-export-table th:nth-child(7),
body.weldgrid-shell .wg-export-table td:nth-child(7) { width: 118px; }
body.weldgrid-shell .wg-export-table th:nth-child(8),
body.weldgrid-shell .wg-export-table td:nth-child(8) { width: 128px; }
body.weldgrid-shell .wg-export-file-name { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; overflow-wrap: normal; word-break: normal; }
body.weldgrid-shell .wg-export-template-meta { display: -webkit-box; max-height: 2.5em; overflow: hidden; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
body.weldgrid-shell .wg-export-warning-badge { display: inline-flex; align-items: center; margin-top: 5px; padding: 2px 7px; border-radius: 999px; background: rgba(245, 158, 11, .16); color: #92400e; font-size: .7rem; font-weight: 950; }
@media (max-width: 1500px) {
    body.weldgrid-shell .wg-export-table th:nth-child(5),
    body.weldgrid-shell .wg-export-table td:nth-child(5) { display: none; }
}


/* =========================================================
   WeldGrid PDF Viewer Annotation List Compactness
========================================================= */

body.weldgrid-shell .wg-pdf-workspace .wg-pdf-right,
body.weldgrid-shell .wg-pdf-workspace .wg-annotation-list-panel,
body.weldgrid-shell .wg-pdf-workspace .wg-annotation-list,
body.weldgrid-shell .wg-pdf-workspace .wg-annotation-spool-tree-group,
body.weldgrid-shell .wg-pdf-workspace .wg-annotation-spool-tree-body,
body.weldgrid-shell .wg-pdf-workspace .wg-annotation-spool-group,
body.weldgrid-shell .wg-pdf-workspace .wg-annotation-spool-group-head,
body.weldgrid-shell .wg-pdf-workspace .wg-annotation-spool-group-body {
    min-width: 0;
    max-width: 100%;
    overflow-x: hidden;
}

body.weldgrid-shell .wg-pdf-workspace .wg-annotation-spool-tree-head {
    display: grid;
    grid-template-columns: auto auto minmax(0, 1fr) auto;
    align-items: center;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
}

body.weldgrid-shell .wg-pdf-workspace .wg-annotation-spool-tree-head strong,
body.weldgrid-shell .wg-pdf-workspace .wg-annotation-spool-tree-head small {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body.weldgrid-shell .wg-pdf-workspace .wg-annotation-list {
    overflow-x: hidden !important;
    padding-right: 4px;
}

body.weldgrid-shell .wg-pdf-workspace .wg-annotation-list-item {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
}

body.weldgrid-shell .wg-pdf-workspace .wg-annotation-list-main {
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
}

body.weldgrid-shell .wg-pdf-workspace .wg-annotation-list-main strong,
body.weldgrid-shell .wg-pdf-workspace .wg-annotation-list-main span,
body.weldgrid-shell .wg-pdf-workspace .wg-annotation-list-main small {
    display: block;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

body.weldgrid-shell .wg-pdf-workspace .wg-annotation-list-main span {
    white-space: nowrap;
}

body.weldgrid-shell .wg-pdf-workspace .wg-annotation-list-main small {
    white-space: nowrap;
    color: #d5e6f2 !important;
}

body.weldgrid-shell .wg-pdf-workspace .wg-annotation-list-actions {
    display: grid;
    grid-template-columns: repeat(2, 26px);
    flex: 0 0 56px;
    gap: 4px;
    width: 56px;
    max-width: 56px;
}

body.weldgrid-shell .wg-pdf-workspace .wg-annotation-list-actions button {
    width: 26px;
    min-width: 26px;
    height: 26px;
    padding: 0;
}

body.weldgrid-shell .wg-pdf-workspace .wg-spool-group-toggle {
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
}

body.weldgrid-shell .wg-pdf-workspace .wg-spool-group-copy {
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
}

body.weldgrid-shell .wg-pdf-workspace .wg-spool-group-copy strong,
body.weldgrid-shell .wg-pdf-workspace .wg-spool-group-copy em {
    display: block;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body.weldgrid-shell .wg-pdf-workspace .wg-spool-group-actions {
    flex: 0 0 auto;
    max-width: 86px;
}

body.weldgrid-shell .wg-pdf-workspace .wg-spool-group-actions button {
    width: 26px;
    min-width: 26px;
    height: 26px;
    padding: 0;
}


/* =========================================================
   WeldGrid PDF Viewer Toolbar Cleanup
========================================================= */
body.weldgrid-shell .wg-pdf-workspace .wg-pdf-toolbar,
body.weldgrid-shell .wg-pdf-workspace .wg-pdf-viewer-card,
body.weldgrid-shell .wg-pdf-workspace,
body.weldgrid-shell .wg-pdf-workspace {
    border-radius: 10px;
}

body.weldgrid-shell .wg-pdf-workspace .wg-pdf-toolbar {
    border-radius: 10px;
}

body.weldgrid-shell .wg-pdf-workspace .wg-pdf-toolbar .wg-btn-icon-only,
body.weldgrid-shell .wg-pdf-workspace .wg-active-pdf-actions .wg-btn-icon-only {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

body.weldgrid-shell .wg-pdf-workspace .wg-pdf-toolbar .wg-btn-icon-only {
    width: 42px;
    min-width: 42px;
    height: 42px;
    min-height: 42px;
}

body.weldgrid-shell .wg-pdf-workspace .wg-active-pdf-actions .wg-btn-icon-only {
    width: 40px;
    min-width: 40px;
    height: 38px;
    min-height: 38px;
}

body.weldgrid-shell .wg-pdf-workspace .wg-pdf-toolbar .wg-btn-icon-only i,
body.weldgrid-shell .wg-pdf-workspace .wg-active-pdf-actions .wg-btn-icon-only i {
    margin: 0;
    font-size: 1.08rem;
}

body.weldgrid-shell .wg-pdf-workspace .wg-pdf-status-chips,
body.weldgrid-shell .wg-pdf-workspace #wgToolbarPreviewBom,
body.weldgrid-shell .wg-pdf-workspace #wgToolbarPreviewSpools {
    display: none !important;
}

body.weldgrid-shell .wg-pdf-workspace .wg-pdf-toolbar .wg-btn,
body.weldgrid-shell .wg-pdf-workspace .wg-active-pdf-actions .wg-btn {
    border-radius: 8px;
}

/* =========================================================
   WeldGrid Spools Page Segment Modal
========================================================= */
body.weldgrid-shell .swal2-popup.wg-spool-segment-swal {
    width: min(760px, calc(100vw - 32px)) !important;
    max-width: calc(100vw - 32px) !important;
    padding: 0 0 18px !important;
    overflow: hidden;
}

body.weldgrid-shell .swal2-popup.wg-spool-segment-swal .swal2-title {
    margin: 0;
    padding: 20px 22px 6px;
    color: #08243d;
    font-size: 22px;
    font-weight: 950;
}

body.weldgrid-shell .swal2-popup.wg-spool-segment-swal .swal2-html-container,
body.weldgrid-shell .swal2-popup.wg-spool-segment-swal .wg-spool-segment-swal-html {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 22px !important;
    overflow-x: hidden;
    box-sizing: border-box;
}

body.weldgrid-shell .swal2-popup.wg-spool-segment-swal .wg-segment-form {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    grid-template-columns: minmax(0, 180px) minmax(0, 1fr);
    align-items: start;
    overflow: hidden;
    text-align: left;
}

body.weldgrid-shell .swal2-popup.wg-spool-segment-swal .wg-segment-form label {
    display: grid;
    gap: 6px;
    min-width: 0;
    margin: 0;
    color: #0d2d4b;
    font-size: 13px;
    font-weight: 900;
}

body.weldgrid-shell .swal2-popup.wg-spool-segment-swal .wg-segment-form label:has(textarea),
body.weldgrid-shell .swal2-popup.wg-spool-segment-swal #wgSegmentBomPreview {
    grid-column: 1 / -1;
}

body.weldgrid-shell .swal2-popup.wg-spool-segment-swal .swal2-input,
body.weldgrid-shell .swal2-popup.wg-spool-segment-swal .swal2-select,
body.weldgrid-shell .swal2-popup.wg-spool-segment-swal .swal2-textarea {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0;
    margin: 0 !important;
    box-sizing: border-box;
    border: 1px solid #cbdcea;
    border-radius: 7px;
    color: #08243d;
    font-size: 14px;
    font-weight: 850;
}

body.weldgrid-shell .swal2-popup.wg-spool-segment-swal .swal2-select {
    display: block;
    height: 42px;
    padding: 0 34px 0 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body.weldgrid-shell .swal2-popup.wg-spool-segment-swal .swal2-textarea {
    min-height: 118px;
    resize: vertical;
}

body.weldgrid-shell .swal2-popup.wg-spool-segment-swal .wg-segment-bom-preview {
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
    overflow-wrap: anywhere;
    word-break: break-word;
}

body.weldgrid-shell .swal2-popup.wg-spool-segment-swal .wg-segment-bom-preview strong,
body.weldgrid-shell .swal2-popup.wg-spool-segment-swal .wg-segment-bom-preview span,
body.weldgrid-shell .swal2-popup.wg-spool-segment-swal .wg-segment-bom-preview small {
    min-width: 0;
    overflow-wrap: anywhere;
}

@media (max-width: 640px) {
    body.weldgrid-shell .swal2-popup.wg-spool-segment-swal .swal2-html-container,
    body.weldgrid-shell .swal2-popup.wg-spool-segment-swal .wg-spool-segment-swal-html {
        padding: 0 14px !important;
    }

    body.weldgrid-shell .swal2-popup.wg-spool-segment-swal .wg-segment-form {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* =========================================================
   WeldGrid BOM Scope Loading / Pagination
========================================================= */
.wg-bom-scope-info {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-top: 10px;
    padding: 7px 10px;
    border: 1px solid rgba(24, 126, 184, .20);
    border-radius: 7px;
    background: #f5fbff;
    color: #0a3557;
    font-size: 12px;
    font-weight: 850;
}

.wg-bom-scope-info[hidden],
.wg-bom-selector-row .is-hidden,
.wg-bom-project-filter[hidden] {
    display: none !important;
}

.wg-bom-dataset-badge {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    margin-top: 4px;
    padding: 3px 8px;
    border: 1px solid rgba(255, 106, 26, .22);
    border-radius: 7px;
    background: #fff7ed;
    color: #9a3412;
    font-size: 11px;
    font-weight: 900;
}

.wg-bom-dataset-badge[hidden] {
    display: none !important;
}

.wg-bom-table-wrap {
    position: relative;
}

.wg-bom-loading-overlay[hidden] {
    display: none !important;
}

.wg-bom-loading-overlay {
    position: absolute;
    inset: 0;
    z-index: 20;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(248, 251, 253, .86);
    backdrop-filter: blur(1px);
}

.wg-bom-loading-card {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 46px;
    padding: 11px 14px;
    border: 1px solid rgba(24, 126, 184, .20);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 12px 28px rgba(6, 29, 50, .12);
    color: #17324d;
}

.wg-bom-loading-card i {
    color: #187eb8;
    font-size: 18px;
    animation: wgSpin 1s linear infinite;
}

.wg-bom-loading-card strong {
    color: #17324d;
    font-size: 13px;
    font-weight: 900;
}

.wg-bom-table-wrap.is-loading .wg-bom-table {
    opacity: .46;
}

.wg-bom-kpi-grid.is-loading .wg-bom-kpi {
    opacity: .72;
}

.wg-bom-kpi-grid.is-loading .wg-bom-kpi strong {
    color: #94a3b8;
}

.wg-bom-pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 10px;
    color: #60758a;
    font-size: 12px;
    font-weight: 800;
}

.wg-bom-pagination label {
    margin: 0;
    color: #17324d;
    font-weight: 900;
}

.wg-bom-pagination .form-select {
    width: 96px;
    min-height: 34px;
    padding: 4px 28px 4px 9px;
    font-size: 12px;
    font-weight: 800;
}

.wg-bom-pagination .wg-icon-btn {
    width: 34px;
    height: 34px;
    min-width: 34px;
}

.wg-bom-pagination .wg-icon-btn:disabled {
    opacity: .48;
    cursor: not-allowed;
}

.wg-bom-page .wg-bom-filter-panel {
    grid-template-columns: minmax(220px, 1.25fr) repeat(auto-fit, minmax(145px, .75fr));
}

@media (max-width: 900px) {
    .wg-bom-pagination {
        justify-content: flex-start;
    }
}

/* =========================================================
   WeldGrid BOM Project Management Toolbar
========================================================= */
.wg-bom-page .wg-bom-action-row {
    align-items: center;
    gap: 12px;
}

.wg-bom-page .wg-bom-actions .wg-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    border-radius: 7px;
    font-weight: 900;
}

.wg-bom-page .wg-bom-action-primary {
    border-color: rgba(24, 126, 184, .55);
    background: #187eb8;
    color: #fff;
    box-shadow: 0 8px 18px rgba(24, 126, 184, .18);
}

.wg-bom-page .wg-bom-action-primary:hover {
    border-color: #0f6f9f;
    background: #0f6f9f;
    color: #fff;
}

.wg-bom-page .wg-bom-action-outline,
.wg-bom-page .wg-bom-action-icon {
    border-color: rgba(24, 126, 184, .28);
    background: #f5fbff;
    color: #0a5f8f;
}

.wg-bom-page .wg-bom-action-outline:hover,
.wg-bom-page .wg-bom-action-icon:hover {
    border-color: rgba(24, 126, 184, .48);
    background: #e9f6ff;
    color: #084d75;
}

.wg-bom-page .wg-bom-action-danger {
    border-color: rgba(220, 38, 38, .34);
}

.wg-bom-import-preview {
    display: grid;
    grid-template-columns: repeat(5, minmax(90px, 1fr));
    gap: 10px;
    text-align: left;
}

.wg-bom-import-preview > div {
    padding: 10px;
    border: 1px solid rgba(12, 46, 76, .10);
    border-radius: 7px;
    background: #f8fbfd;
}

.wg-bom-import-preview span {
    display: block;
    color: #60758a;
    font-size: 11px;
    font-weight: 850;
}

.wg-bom-import-preview strong {
    display: block;
    margin-top: 4px;
    color: #17324d;
    font-size: 20px;
    font-weight: 950;
}

.wg-bom-import-preview section {
    grid-column: 1 / -1;
    padding: 10px;
    border: 1px solid rgba(24, 126, 184, .16);
    border-radius: 7px;
    background: #f5fbff;
    color: #17324d;
    font-size: 13px;
}

.wg-bom-import-preview ul {
    margin: 6px 0 0;
    padding-left: 18px;
}

@media (max-width: 900px) {
    .wg-bom-import-preview {
        grid-template-columns: repeat(2, minmax(120px, 1fr));
    }
}

/* =========================================================
   WeldGrid Spool Legend Group Icons
========================================================= */
.wg-spool-group-picker {
    display: grid;
    gap: 8px;
    width: 100%;
}

.wg-spool-editor-form .wg-spool-group-picker,
.wg-spool-editor-form section.wg-spool-group-picker {
    grid-column: 1 / -1;
}

.wg-spool-group-picker-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 10px;
    color: #0d2d4b;
}

.wg-spool-group-picker-head strong {
    font-size: 12px;
    font-weight: 950;
}

.wg-spool-group-picker-head span {
    color: #60758a;
    font-size: 11px;
    font-weight: 800;
    text-align: right;
}

.wg-spool-group-picker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
    gap: 7px;
}

.wg-spool-group-option {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    min-height: 48px;
    padding: 7px 8px;
    border: 1px solid #cbdcea;
    border-radius: 8px;
    background: #ffffff;
    color: #0d2d4b;
    text-align: left;
    font-size: 11px;
    font-weight: 950;
    line-height: 1.12;
    cursor: pointer;
    transition: border-color .14s ease, background .14s ease, box-shadow .14s ease, color .14s ease;
}

.wg-spool-group-option:hover {
    border-color: rgba(0, 166, 214, .42);
    background: #f2fbff;
}

.wg-spool-group-option:focus-visible {
    outline: 3px solid rgba(0, 166, 214, .25);
    outline-offset: 2px;
}

.wg-spool-group-option.is-selected {
    border-color: #ff6a1a;
    background: #fff7f2;
    color: #bf4a0b;
    box-shadow: 0 0 0 2px rgba(255, 106, 26, .16);
}

.wg-spool-group-icon {
    width: 30px;
    height: 24px;
    object-fit: contain;
    display: block;
}

.wg-spool-label-group-icon,
.wg-spool-card-group-icon {
    display: inline-block;
    flex: 0 0 auto;
    object-fit: contain;
    object-position: center;
    pointer-events: none;
}

.wg-spool-label-group-icon {
    width: 36px;
    height: 30px;
    opacity: .98;
    filter: brightness(0) invert(1);
}

.wg-spool-card-group-icon {
    width: 24px;
    height: 18px;
    filter: none;
}

.wg-spool-overlay-label[data-fill-mode="transparent"] .wg-spool-label-group-icon,
.wg-live-label-preview[data-fill-mode="transparent"] .wg-spool-label-group-icon {
    filter: none;
}

.wg-spool-tooltip-group .wg-spool-card-group-icon {
    filter: brightness(0) invert(1);
}

.wg-spool-list-item.active .wg-spool-card-group-icon,
.wg-annotation-spool-group.active .wg-spool-card-group-icon {
    filter: brightness(0) saturate(100%) invert(42%) sepia(93%) saturate(1456%) hue-rotate(352deg) brightness(95%) contrast(92%);
}

.wg-spool-tooltip-group {
    display: inline-flex !important;
    align-items: center;
    gap: 6px;
}

.wg-spool-tooltip-group .wg-spool-card-group-icon {
    color: rgba(255, 255, 255, .88);
}

@media (max-width: 760px) {
    .wg-spool-group-picker-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .wg-spool-group-picker-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .wg-spool-group-picker-head span {
        text-align: left;
    }
}


/* Compact annotation display modes */
.wg-annotation-toolbar-display-mode {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 38px;
    padding: 0 6px;
    border: 1px solid rgba(198, 215, 229, .85);
    border-radius: 8px;
    background: rgba(255, 255, 255, .86);
    color: #0d2d4b;
    font-size: .74rem;
    font-weight: 900;
    white-space: nowrap;
}

.wg-annotation-toolbar-display-mode select {
    min-width: 132px;
    height: 30px;
    padding-top: 2px;
    padding-bottom: 2px;
    font-size: .78rem;
    font-weight: 850;
}

.wg-annotation-toolbar-compact-actions {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.wg-annotation-toolbar-compact-actions .wg-btn {
    min-height: 32px !important;
    padding: 5px 9px !important;
    font-size: .74rem !important;
}

.wg-annotation-style-controls {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    padding: 12px;
    border: 1px solid rgba(198, 215, 229, .9);
    border-radius: 8px;
    background: rgba(255, 255, 255, .62);
}

.wg-annotation-display-full,
.wg-annotation-display-compact,
.wg-annotation-display-minimal,
.wg-annotation-display-code-only {
    --wg-annotation-font-scale: .72;
    --wg-annotation-padding-scale: .65;
    --wg-annotation-line-scale: .55;
    --wg-annotation-arrow-scale: .65;
    --wg-annotation-label-opacity: .82;
    --wg-annotation-box-border-scale: .7;
}

.wg-annotation-display-full {
    --wg-annotation-font-scale: 1;
    --wg-annotation-padding-scale: 1;
    --wg-annotation-line-scale: 1;
    --wg-annotation-arrow-scale: 1;
    --wg-annotation-label-opacity: 1;
    --wg-annotation-box-border-scale: 1;
}

.wg-annotation-display-minimal {
    --wg-annotation-font-scale: .58;
    --wg-annotation-padding-scale: .45;
    --wg-annotation-line-scale: .45;
    --wg-annotation-arrow-scale: .5;
    --wg-annotation-label-opacity: .72;
    --wg-annotation-box-border-scale: .55;
}

.wg-annotation-display-code-only {
    --wg-annotation-font-scale: .62;
    --wg-annotation-padding-scale: .48;
    --wg-annotation-line-scale: .5;
    --wg-annotation-arrow-scale: .55;
    --wg-annotation-label-opacity: .78;
    --wg-annotation-box-border-scale: .58;
}

body.weldgrid-shell .wg-annotation-arrow,
.wg-annotation-arrow {
    stroke-width: var(--wg-ann-line-width, calc(2.4px * var(--wg-annotation-line-scale, 1))) !important;
    filter: drop-shadow(0 1px 1px rgba(7, 27, 47, .16)) !important;
}

body.weldgrid-shell .wg-annotation-arrow.wg-annotation-selected,
.wg-annotation-arrow.wg-annotation-selected {
    stroke-width: calc(var(--wg-ann-line-width, 1.2px) + .55px) !important;
}

body.weldgrid-shell .wg-annotation-arrow.wg-annotation-in-selected-spool,
.wg-annotation-arrow.wg-annotation-in-selected-spool {
    stroke-width: calc(var(--wg-ann-line-width, 1.2px) + .45px) !important;
    filter: drop-shadow(0 0 3px rgba(255, 106, 26, .42)) !important;
}

body.weldgrid-shell .wg-annotation-point,
.wg-annotation-point {
    width: 24px !important;
    height: 24px !important;
    min-width: 18px;
    min-height: 18px;
}

body.weldgrid-shell .wg-annotation-point::after {
    width: calc(10px * var(--wg-annotation-handle-scale, 1)) !important;
    height: calc(10px * var(--wg-annotation-handle-scale, 1)) !important;
    min-width: 7px;
    min-height: 7px;
}

.wg-annotation-label {
    opacity: var(--wg-annotation-label-opacity, .82) !important;
    min-width: calc(52px * var(--wg-annotation-padding-scale, 1)) !important;
    min-height: calc(28px * var(--wg-annotation-padding-scale, 1)) !important;
}

.wg-annotation-label[data-style-size="full"] {
    --wg-annotation-font-scale: 1;
    --wg-annotation-padding-scale: 1;
}

.wg-annotation-label[data-style-size="compact"] {
    --wg-annotation-font-scale: .72;
    --wg-annotation-padding-scale: .65;
}

.wg-annotation-label[data-style-size="minimal"] {
    --wg-annotation-font-scale: .58;
    --wg-annotation-padding-scale: .45;
}

.wg-annotation-label-text {
    max-width: calc(72px * var(--wg-annotation-padding-scale, 1)) !important;
    padding: 0 calc(8px * var(--wg-annotation-padding-scale, 1)) !important;
    font-size: calc(.78rem * var(--wg-annotation-font-scale, 1)) !important;
}

.wg-annotation-label[data-shape="rectangle"] {
    min-width: calc(52px * var(--wg-annotation-padding-scale, 1)) !important;
    min-height: calc(28px * var(--wg-annotation-padding-scale, 1)) !important;
}

.wg-annotation-label[data-shape="triangle"] {
    min-width: calc(78px * var(--wg-annotation-padding-scale, 1)) !important;
    min-height: calc(58px * var(--wg-annotation-padding-scale, 1)) !important;
}

.wg-annotation-label[data-shape="pentagon"] {
    min-width: calc(76px * var(--wg-annotation-padding-scale, 1)) !important;
    min-height: calc(50px * var(--wg-annotation-padding-scale, 1)) !important;
}

.wg-annotation-label[data-shape="parallelogram"] {
    min-width: calc(68px * var(--wg-annotation-padding-scale, 1)) !important;
    min-height: calc(32px * var(--wg-annotation-padding-scale, 1)) !important;
}

.wg-annotation-label[data-fill-preset="translucent"][data-fill-mode="solid"] .wg-annotation-shape-path {
    fill: color-mix(in srgb, var(--wg-ann-fill-color, var(--wg-ann-color, #ff6a1a)) 82%, transparent) !important;
}

.wg-annotation-label[data-fill-preset="translucent"] .wg-annotation-shape-bg {
    filter: drop-shadow(0 4px 9px rgba(7, 27, 47, .16)) !important;
}

.wg-annotation-label[data-fill-mode="transparent"] .wg-annotation-shape-path,
.wg-annotation-label[data-fill-mode="transparent"][data-fill-preset="transparent"] .wg-annotation-shape-path {
    fill: transparent !important;
}

.wg-annotation-display-minimal .wg-annotation-label .wg-annotation-shape-bg,
.wg-annotation-display-code-only .wg-annotation-label .wg-annotation-shape-bg {
    filter: drop-shadow(0 3px 7px rgba(7, 27, 47, .14)) !important;
}

@media (max-width: 760px) {
    .wg-annotation-style-controls {
        grid-template-columns: 1fr;
    }

    .wg-annotation-toolbar-display-mode {
        flex: 1 1 100%;
        justify-content: space-between;
    }

    .wg-annotation-toolbar-compact-actions {
        width: 100%;
    }
}


.wg-annotation-appearance-button {
    display: inline-flex !important;
    align-items: center;
    gap: 7px;
    min-height: 38px !important;
    padding: 7px 12px !important;
    white-space: nowrap;
}

.wg-annotation-appearance-button i {
    font-size: 1rem;
}

.wg-annotation-appearance-popup {
    width: min(760px, calc(100vw - 28px)) !important;
}

.wg-annotation-appearance-dialog {
    display: grid;
    gap: 16px;
    text-align: left;
}

.wg-annotation-appearance-section {
    display: grid;
    gap: 10px;
}

.wg-annotation-appearance-section h3 {
    margin: 0;
    color: #0d2d4b;
    font-size: .92rem;
    font-weight: 950;
}

.wg-annotation-appearance-profiles {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
}

.wg-annotation-appearance-profile {
    display: grid;
    gap: 4px;
    min-height: 72px;
    padding: 10px 9px;
    border: 1px solid rgba(198, 215, 229, .95);
    border-radius: 8px;
    background: #ffffff;
    color: #0d2d4b;
    text-align: left;
    cursor: pointer;
}

.wg-annotation-appearance-profile strong {
    font-size: .82rem;
    font-weight: 950;
    line-height: 1.1;
}

.wg-annotation-appearance-profile span {
    color: #64748b;
    font-size: .68rem;
    font-weight: 800;
    line-height: 1.2;
}

.wg-annotation-appearance-profile:hover,
.wg-annotation-appearance-profile.is-selected {
    border-color: #ff6a1a;
    background: #fff7f2;
    box-shadow: 0 0 0 2px rgba(255, 106, 26, .14);
}

.wg-annotation-appearance-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.wg-annotation-appearance-control {
    display: grid;
    gap: 6px;
    padding: 10px;
    border: 1px solid rgba(198, 215, 229, .9);
    border-radius: 8px;
    background: rgba(255, 255, 255, .72);
}

.wg-annotation-appearance-control > span {
    color: #0d2d4b;
    font-size: .78rem;
    font-weight: 950;
}

.wg-annotation-appearance-control > div {
    display: grid;
    grid-template-columns: 1fr 72px auto;
    align-items: center;
    gap: 8px;
}

.wg-annotation-appearance-control input[type="range"] {
    width: 100%;
    accent-color: #ff6a1a;
}

.wg-annotation-appearance-control input[type="number"] {
    width: 72px;
    min-height: 32px;
    padding: 4px 6px;
    border: 1px solid rgba(198, 215, 229, .95);
    border-radius: 7px;
    color: #0d2d4b;
    font-size: .78rem;
    font-weight: 900;
}

.wg-annotation-appearance-control small {
    color: #64748b;
    font-size: .72rem;
    font-weight: 850;
}

.wg-annotation-appearance-note {
    margin: 0;
    padding: 10px 12px;
    border: 1px solid rgba(14, 165, 233, .18);
    border-radius: 8px;
    background: rgba(240, 249, 255, .82);
    color: #49657f;
    font-size: .78rem;
    font-weight: 800;
    line-height: 1.35;
}

.wg-annotation-label[data-fill-mode="solid"] .wg-annotation-shape-path {
    stroke-width: calc(2.5px * var(--wg-annotation-box-border-scale, 1)) !important;
}

.wg-annotation-label[data-fill-mode="transparent"] .wg-annotation-shape-path {
    stroke-width: calc(4px * var(--wg-annotation-box-border-scale, 1)) !important;
}

.wg-annotation-label.wg-annotation-selected .wg-annotation-shape-path {
    stroke-width: calc(4.5px * var(--wg-annotation-box-border-scale, 1)) !important;
}

@media (max-width: 760px) {
    .wg-annotation-appearance-profiles,
    .wg-annotation-appearance-grid {
        grid-template-columns: 1fr;
    }

    .wg-annotation-appearance-control > div {
        grid-template-columns: 1fr 68px auto;
    }
}


/* Annotation appearance settings refinements */
.wg-annotation-appearance-button.wg-btn-icon-only {
    padding: 0 !important;
    gap: 0;
}

.wg-annotation-label[data-style-size="full"],
.wg-annotation-label[data-style-size="compact"],
.wg-annotation-label[data-style-size="minimal"] {
    --wg-annotation-font-scale: var(--wg-annotation-global-font-scale, .72) !important;
    --wg-annotation-padding-scale: var(--wg-annotation-global-padding-scale, .65) !important;
}

.wg-annotation-appearance-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.wg-annotation-appearance-section-head .wg-btn {
    min-height: 32px !important;
    padding: 5px 10px !important;
    font-size: .74rem !important;
}

.wg-annotation-appearance-control > div {
    grid-template-columns: 1fr 72px auto 34px;
}

.wg-annotation-appearance-reset {
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(198, 215, 229, .95);
    border-radius: 8px;
    background: #ffffff;
    color: #0d2d4b;
    cursor: pointer;
}

.wg-annotation-appearance-reset:hover,
.wg-annotation-appearance-reset:focus-visible {
    border-color: #ff6a1a;
    color: #bf4a0b;
    background: #fff7f2;
}

@media (max-width: 760px) {
    .wg-annotation-appearance-section-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .wg-annotation-appearance-control > div {
        grid-template-columns: 1fr 68px auto 32px;
    }
}


/* Shared appearance scaling for spool overlays */
.wg-pdf-page-surface .wg-spool-overlay-label,
.wg-annotation-layer .wg-spool-overlay-label {
    opacity: var(--wg-annotation-label-opacity, 1) !important;
    gap: calc(7px * var(--wg-annotation-padding-scale, 1)) !important;
    min-width: calc(108px * var(--wg-annotation-padding-scale, 1)) !important;
    max-width: calc(210px * var(--wg-annotation-padding-scale, 1)) !important;
    min-height: calc(34px * var(--wg-annotation-padding-scale, 1)) !important;
    padding: calc(7px * var(--wg-annotation-padding-scale, 1)) calc(11px * var(--wg-annotation-padding-scale, 1)) !important;
    border-width: calc(2px * var(--wg-annotation-box-border-scale, 1)) !important;
    box-shadow: 0 calc(8px * var(--wg-annotation-padding-scale, 1)) calc(20px * var(--wg-annotation-padding-scale, 1)) rgba(7, 27, 47, .20) !important;
}

.wg-pdf-page-surface .wg-spool-overlay-label strong,
.wg-annotation-layer .wg-spool-overlay-label strong {
    max-width: calc(146px * var(--wg-annotation-padding-scale, 1)) !important;
    font-size: calc(12px * var(--wg-annotation-font-scale, 1)) !important;
}

.wg-pdf-page-surface .wg-spool-overlay-label small,
.wg-annotation-layer .wg-spool-overlay-label small {
    min-width: calc(20px * var(--wg-annotation-padding-scale, 1)) !important;
    height: calc(20px * var(--wg-annotation-padding-scale, 1)) !important;
    padding: 0 calc(5px * var(--wg-annotation-padding-scale, 1)) !important;
    font-size: calc(11px * var(--wg-annotation-font-scale, 1)) !important;
}

.wg-pdf-page-surface .wg-spool-label-group-icon,
.wg-annotation-layer .wg-spool-label-group-icon {
    width: calc(36px * var(--wg-annotation-padding-scale, 1)) !important;
    height: calc(30px * var(--wg-annotation-padding-scale, 1)) !important;
}

.wg-pdf-page-surface .wg-spool-arrow-line:not(.wg-spool-arrow-hit),
.wg-annotation-layer .wg-spool-arrow-line:not(.wg-spool-arrow-hit) {
    stroke-width: calc(2.4px * var(--wg-annotation-line-scale, 1)) !important;
}

.wg-pdf-page-surface .wg-spool-arrow-line:not(.wg-spool-arrow-hit):hover,
.wg-pdf-page-surface .wg-spool-arrow-line:not(.wg-spool-arrow-hit).is-active,
.wg-annotation-layer .wg-spool-arrow-line:not(.wg-spool-arrow-hit):hover,
.wg-annotation-layer .wg-spool-arrow-line:not(.wg-spool-arrow-hit).is-active {
    stroke-width: calc(3.2px * var(--wg-annotation-line-scale, 1)) !important;
}

.wg-pdf-page-surface .wg-spool-anchor-point,
.wg-annotation-layer .wg-spool-anchor-point {
    width: 16px !important;
    height: 16px !important;
    border-width: calc(2px * var(--wg-annotation-box-border-scale, 1)) !important;
}

.wg-pdf-page-surface .wg-spool-leader-bend::before,
.wg-annotation-layer .wg-spool-leader-bend::before {
    inset: 5px !important;
    border-width: calc(2px * var(--wg-annotation-box-border-scale, 1)) !important;
}

/* Excel mapping visual rule builder v2 */
.wg-rule-builder {
    border: 1px solid #cfe0ef;
    border-radius: 8px;
    background: #f8fbfe;
    padding: 12px;
}

.wg-rule-builder-toolbar,
.wg-rule-branch-head,
.wg-rule-group-head,
.wg-rule-result-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.wg-rule-builder-toolbar {
    justify-content: space-between;
    margin-bottom: 10px;
}

.wg-rule-builder-toolbar strong,
.wg-rule-branch-head strong,
.wg-rule-then > strong {
    color: #0d2d4b;
    font-weight: 900;
}

.wg-rule-builder-toolbar-actions button,
.wg-rule-group-head button,
.wg-rule-result-actions button,
.wg-rule-result-parts button,
.wg-rule-warning button,
.wg-expression-examples button {
    border: 1px solid #cbddeb;
    border-radius: 999px;
    background: #fff;
    color: #0d2d4b;
    font-size: 12px;
    font-weight: 800;
    padding: 7px 10px;
    cursor: pointer;
}

.wg-rule-builder-toolbar-actions button:hover,
.wg-rule-group-head button:hover,
.wg-rule-result-actions button:hover,
.wg-rule-result-parts button:hover,
.wg-rule-warning button:hover,
.wg-expression-examples button:hover {
    border-color: #ff6a1a;
    color: #bf4a0b;
    background: #fff7f2;
}

.wg-rule-source-search {
    width: 100%;
    margin: 0 0 10px;
    border: 1px solid #cbddeb;
    border-radius: 8px;
    padding: 9px 11px;
    color: #0d2d4b;
    background: #fff;
}

.wg-rule-branches {
    display: grid;
    gap: 10px;
}

.wg-rule-branch,
.wg-rule-condition-group,
.wg-rule-result-row {
    border: 1px solid #d5e4f0;
    border-radius: 8px;
    background: #fff;
}

.wg-rule-branch {
    padding: 10px;
}

.wg-rule-else {
    background: #fbfdff;
}

.wg-rule-branch-head {
    justify-content: space-between;
    margin-bottom: 8px;
}

.wg-rule-condition-group {
    padding: 8px;
    background: #f6faff;
}

.wg-rule-group-head {
    margin-bottom: 8px;
}

.wg-rule-not-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #48617b;
    font-size: 12px;
    font-weight: 800;
}

.wg-rule-group-children {
    display: grid;
    gap: 8px;
}

.wg-rule-condition-row,
.wg-rule-math-row,
.wg-rule-fallback-row {
    display: grid;
    grid-template-columns: minmax(160px, 1.2fr) minmax(140px, .8fr) minmax(120px, .7fr) minmax(160px, 1.1fr) 36px;
    gap: 8px;
    align-items: center;
}

.wg-rule-math-row,
.wg-rule-fallback-row {
    grid-template-columns: 1fr auto 1fr;
}

.wg-rule-fallback-row {
    grid-template-columns: 80px 1fr 110px 1fr;
}

.wg-rule-condition-row select,
.wg-rule-condition-row input,
.wg-rule-result-row select,
.wg-rule-result-row input,
.wg-rule-math-row select,
.wg-rule-math-row input,
.wg-rule-fallback-row select,
.wg-rule-fallback-row input {
    min-width: 0;
}

.wg-rule-then {
    display: grid;
    gap: 7px;
    margin-top: 9px;
}

.wg-rule-result-row {
    display: grid;
    gap: 8px;
    padding: 8px;
}

.wg-rule-result-actions button.is-active {
    border-color: #ff6a1a;
    background: #fff2ea;
    color: #bf4a0b;
}

.wg-rule-result-row > [data-result-type] {
    max-width: 260px;
}

.wg-rule-result-parts {
    display: grid;
    gap: 8px;
}

.wg-rule-result-parts > [data-result-part] {
    border-left: 3px solid #dcebf7;
    padding-left: 8px;
}

.wg-rule-static,
.wg-rule-empty-group {
    border: 1px dashed #cbddeb;
    border-radius: 8px;
    padding: 9px 10px;
    color: #60758b;
    background: #fbfdff;
    font-weight: 700;
}

.wg-rule-warning {
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid #ffd0d0;
    border-radius: 8px;
    background: #fff5f5;
    color: #b91c1c;
    padding: 9px 10px;
    font-weight: 800;
}

.wg-rule-warning span {
    color: inherit;
}

.wg-rule-preview {
    border: 1px solid #aee2e4;
    border-radius: 8px;
    background: #eaffff;
    color: #0f766e;
    padding: 9px 10px;
    font-weight: 900;
}

.wg-rule-preview.is-error {
    border-color: #ffc5c5;
    background: #fff5f5;
    color: #b91c1c;
}

.wg-rule-source-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid #cbddeb;
    border-radius: 999px;
    padding: 4px 8px;
    background: #fff;
    color: #0d2d4b;
    font-size: 12px;
    font-weight: 800;
}

.wg-expression-examples {
    margin-top: 10px;
}

.wg-expression-examples > div {
    display: grid;
    gap: 7px;
    margin-top: 8px;
}

.wg-expression-examples button {
    justify-content: flex-start;
    border-radius: 8px;
    text-align: left;
}

@media (max-width: 920px) {
    .wg-rule-condition-row,
    .wg-rule-math-row,
    .wg-rule-fallback-row {
        grid-template-columns: 1fr;
    }

    .wg-rule-condition-row .wg-icon-btn {
        justify-self: end;
    }
}

/* Engineer-friendly rule builder UX refinements */
.wg-rule-builder {
    background: linear-gradient(180deg, #f8fbfe 0%, #eef6fc 100%);
}

.wg-rule-builder-toolbar strong {
    display: block;
    font-size: 16px;
}

.wg-rule-builder-toolbar small {
    display: block;
    margin-top: 3px;
    color: #64758a;
    font-weight: 700;
}

.wg-rule-builder-toolbar-actions button {
    border-color: #ff6a1a;
    background: #fff7f2;
    color: #bf4a0b;
}

.wg-rule-branch {
    position: relative;
    overflow: visible;
    border-color: #c9dceb;
    box-shadow: 0 8px 22px rgba(9, 46, 78, .06);
}

.wg-rule-branch-head {
    align-items: flex-start;
    border-bottom: 1px solid #e1ebf3;
    padding-bottom: 8px;
}

.wg-rule-branch-head > div {
    display: grid;
    gap: 2px;
}

.wg-rule-branch-kicker {
    display: inline-flex;
    width: fit-content;
    align-items: center;
    border-radius: 999px;
    background: #e9f4ff;
    color: #15547f;
    font-size: 11px;
    font-weight: 900;
    padding: 3px 8px;
}

.wg-rule-branch-head small {
    color: #6a7d91;
    font-size: 12px;
    font-weight: 700;
}

.wg-rule-else {
    border-style: dashed;
    background: #fffdf8;
}

.wg-rule-else .wg-rule-branch-kicker {
    background: #fff2d8;
    color: #9a4a00;
}

.wg-rule-condition-group {
    position: relative;
    margin-left: 22px;
    padding: 10px 10px 10px 22px;
    background: #fbfdff;
}

.wg-rule-condition-group .wg-rule-condition-group {
    margin-top: 8px;
    margin-left: 30px;
    background: #f5faff;
}

.wg-rule-tree-rail {
    position: absolute;
    left: -18px;
    top: 12px;
    bottom: 12px;
    width: 18px;
    border-left: 2px solid #f6c300;
    border-top: 2px solid #f6c300;
    border-bottom: 2px solid #f6c300;
    border-radius: 8px 0 0 8px;
}

.wg-rule-tree-rail span {
    position: sticky;
    top: 10px;
    display: inline-flex;
    transform: translateX(-13px);
    align-items: center;
    justify-content: center;
    min-width: 30px;
    height: 22px;
    border-radius: 999px;
    background: #ffd400;
    color: #102a43;
    font-size: 11px;
    font-weight: 950;
    box-shadow: 0 2px 7px rgba(15, 38, 64, .12);
}

.wg-rule-condition-group.is-or .wg-rule-tree-rail,
.wg-rule-condition-group.is-or .wg-rule-tree-rail span {
    border-color: #31b4e8;
    background: #dff5ff;
    color: #075d86;
}

.wg-rule-condition-group.is-not {
    border-color: #ffc4c4;
    background: #fff8f8;
}

.wg-rule-condition-group.is-not .wg-rule-tree-rail,
.wg-rule-condition-group.is-not .wg-rule-tree-rail span {
    border-color: #ef4444;
    background: #fee2e2;
    color: #991b1b;
}

.wg-rule-group-head {
    align-items: center;
    border-bottom: 1px solid #e5eef6;
    padding-bottom: 8px;
}

.wg-rule-group-title {
    display: grid;
    min-width: 180px;
    margin-right: auto;
}

.wg-rule-group-title strong {
    color: #0d2d4b;
    font-size: 13px;
    font-weight: 950;
}

.wg-rule-group-title small {
    color: #6b7f95;
    font-size: 11px;
    font-weight: 750;
}

.wg-rule-logic-toggle {
    max-width: 190px;
}

.wg-rule-not-toggle {
    border: 1px solid #d8e7f3;
    border-radius: 999px;
    background: #fff;
    padding: 6px 9px;
}

.wg-rule-condition-row {
    position: relative;
    border: 1px solid #dbe8f2;
    border-radius: 8px;
    background: #fff;
    padding: 8px;
}

.wg-rule-condition-row::before {
    content: '';
    position: absolute;
    left: -24px;
    top: 50%;
    width: 20px;
    border-top: 2px solid #f6c300;
}

.wg-rule-condition-group.is-or > .wg-rule-group-children > .wg-rule-condition-row::before {
    border-color: #31b4e8;
}

.wg-rule-condition-row .wg-icon-btn {
    width: 34px;
    height: 34px;
}

.wg-rule-then {
    border-top: 1px solid #e1ebf3;
    padding-top: 10px;
}

.wg-rule-then > strong {
    display: inline-flex;
    width: fit-content;
    border-radius: 999px;
    background: #e9fbf6;
    color: #08745f;
    font-size: 12px;
    padding: 4px 9px;
}

.wg-rule-result-row {
    border-color: #cfe5dc;
    background: #fcfffe;
}

.wg-rule-result-actions {
    gap: 6px;
}

.wg-rule-result-actions button {
    border-radius: 7px;
    padding: 7px 9px;
}

.wg-rule-preview {
    display: grid;
    gap: 8px;
    margin-top: 10px;
    border-color: #a8dfe2;
    background: #f1ffff;
}

.wg-rule-preview-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.wg-rule-preview-head span {
    color: #55708a;
    font-size: 12px;
    font-weight: 850;
}

.wg-rule-preview-head strong {
    border-radius: 999px;
    background: #0f766e;
    color: #fff;
    padding: 5px 10px;
    font-size: 13px;
}

.wg-rule-preview-flow {
    display: flex;
    gap: 7px;
    flex-wrap: wrap;
}

.wg-rule-preview-flow span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border: 1px solid #d6e4ef;
    border-radius: 999px;
    background: #fff;
    color: #60758b;
    padding: 5px 8px;
    font-size: 12px;
    font-weight: 850;
}

.wg-rule-preview-flow span.is-hit {
    border-color: #6ed7bf;
    background: #eafff8;
    color: #08745f;
}

.wg-rule-preview small {
    color: #5d7288;
    font-weight: 750;
}

@media (max-width: 760px) {
    .wg-rule-condition-group {
        margin-left: 10px;
        padding-left: 14px;
    }

    .wg-rule-tree-rail {
        left: -10px;
        width: 12px;
    }

    .wg-rule-tree-rail span {
        transform: translateX(-10px);
        min-width: 26px;
    }
}

.wg-rule-result-row > [data-result-type] {
    display: none;
}


/* Rule builder source dropdowns and criteria tree alignment */
.wg-rule-builder .wg-rule-condition-group {
    margin-left: 0;
    padding: 12px 12px 12px 52px;
    overflow: visible;
    --wg-rule-rail: #f6c300;
    --wg-rule-rail-badge-bg: #ffd400;
    --wg-rule-rail-badge-color: #102a43;
}

.wg-rule-builder .wg-rule-condition-group .wg-rule-condition-group {
    margin-left: 0;
    padding-left: 48px;
}

.wg-rule-builder .wg-rule-condition-group.is-or {
    --wg-rule-rail: #31b4e8;
    --wg-rule-rail-badge-bg: #dff5ff;
    --wg-rule-rail-badge-color: #075d86;
}

.wg-rule-builder .wg-rule-condition-group.is-not {
    --wg-rule-rail: #ef4444;
    --wg-rule-rail-badge-bg: #fee2e2;
    --wg-rule-rail-badge-color: #991b1b;
}

.wg-rule-builder .wg-rule-tree-rail {
    left: 24px;
    top: 58px;
    bottom: 18px;
    width: 0;
    border: 0;
    border-left: 2px solid var(--wg-rule-rail);
    border-radius: 0;
    background: transparent;
    color: var(--wg-rule-rail);
}

.wg-rule-builder .wg-rule-tree-rail span {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translate(-50%, -50%);
    min-width: 30px;
    height: 22px;
    background: var(--wg-rule-rail-badge-bg);
    color: var(--wg-rule-rail-badge-color);
    z-index: 2;
}

.wg-rule-builder .wg-rule-condition-row {
    overflow: visible;
}

.wg-rule-builder .wg-rule-condition-row::before,
.wg-rule-builder .wg-rule-group-children > .wg-rule-condition-group::before {
    content: "";
    position: absolute;
    left: -29px;
    top: 50%;
    width: 28px;
    border-top: 2px solid var(--wg-rule-rail);
}

.wg-rule-builder .wg-rule-group-children > .wg-rule-condition-group::before {
    top: 30px;
}

.wg-rule-builder .select2-container {
    width: 100% !important;
    min-width: 0;
    font-size: 14px;
}

.wg-rule-builder .select2-container .select2-selection--single {
    min-height: 42px;
    height: auto;
    border: 1px solid #c9dbea;
    border-radius: 8px;
    background: #fff;
    display: flex;
    align-items: center;
}

.wg-rule-builder .select2-container--default .select2-selection--single .select2-selection__rendered {
    width: 100%;
    color: #0d2d4b;
    line-height: 1.15;
    padding: 6px 34px 6px 12px;
    font-weight: 850;
}

.wg-rule-builder .select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 40px;
    right: 8px;
    top: 1px;
}

.wg-rule-builder .select2-container--default.select2-container--focus .select2-selection--single,
.wg-rule-builder .select2-container--default.select2-container--open .select2-selection--single {
    border-color: #ff6a1a;
    box-shadow: 0 0 0 3px rgba(255, 106, 26, .12);
}

.wg-rule-builder-select2-dropdown {
    border: 1px solid #b9d2e6 !important;
    border-radius: 10px !important;
    overflow: hidden;
    box-shadow: 0 16px 35px rgba(15, 38, 64, .14);
}

.wg-rule-builder-select2-dropdown .select2-search--dropdown {
    padding: 8px;
    background: #f5faff;
}

.wg-rule-builder-select2-dropdown .select2-search__field {
    border: 1px solid #c9dbea !important;
    border-radius: 8px;
    padding: 8px 10px;
    outline: none;
}

.wg-rule-builder-select2-dropdown .select2-results__option {
    padding: 8px 10px;
}

.wg-rule-builder-select2-dropdown .select2-results__group {
    padding: 8px 10px 4px;
    color: #6b7f95;
    font-size: 11px;
    font-weight: 950;
    text-transform: uppercase;
}

.wg-rule-select2-option {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.wg-rule-select2-option strong {
    color: #0d2d4b;
    font-weight: 900;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wg-rule-select2-option small {
    color: #6b7f95;
    font-size: 11px;
    font-weight: 750;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 760px) {
    .wg-rule-builder .wg-rule-condition-group {
        padding-left: 42px;
    }

    .wg-rule-builder .wg-rule-tree-rail {
        left: 18px;
    }

    .wg-rule-builder .wg-rule-condition-row::before,
    .wg-rule-builder .wg-rule-group-children > .wg-rule-condition-group::before {
        left: -22px;
        width: 21px;
    }
}


.wg-rule-builder .wg-rule-condition-group.is-or .wg-rule-tree-rail,
.wg-rule-builder .wg-rule-condition-group.is-not .wg-rule-tree-rail {
    background: transparent;
    border-color: var(--wg-rule-rail);
    color: var(--wg-rule-rail);
}

.wg-rule-builder .wg-rule-condition-group.is-or .wg-rule-tree-rail span,
.wg-rule-builder .wg-rule-condition-group.is-not .wg-rule-tree-rail span {
    background: var(--wg-rule-rail-badge-bg);
    color: var(--wg-rule-rail-badge-color);
    border-color: transparent;
}


/* Rule builder Select2 behavior fixes */
.wg-rule-builder .wg-rule-group-head > .select2-container {
    width: 190px !important;
    flex: 0 1 190px;
}

.wg-rule-builder .wg-rule-condition-row > .select2-container,
.wg-rule-builder .wg-rule-condition-row > span > .select2-container,
.wg-rule-builder .wg-rule-result-row > .select2-container,
.wg-rule-builder .wg-rule-result-row > span > .select2-container,
.wg-rule-builder .wg-rule-math-row .select2-container,
.wg-rule-builder .wg-rule-fallback-row .select2-container {
    width: 100% !important;
}

.wg-rule-builder .wg-rule-condition-row > [hidden],
.wg-rule-builder .wg-rule-condition-row > span[hidden],
.wg-rule-builder .wg-rule-result-row > [hidden],
.wg-rule-builder .wg-rule-result-row > span[hidden] {
    display: none !important;
}

.wg-rule-builder .wg-rule-condition-row .wg-icon-btn {
    grid-column: -2 / -1;
    justify-self: end;
    align-self: center;
}

.wg-rule-builder .select2-container .select2-selection--single {
    background: #fff !important;
    border-color: #c9dbea !important;
}

.wg-rule-builder .select2-container--default .select2-selection--single .select2-selection__rendered {
    color: #0d2d4b !important;
}

.wg-rule-builder-select2-dropdown .select2-results__option--highlighted[aria-selected],
.wg-rule-builder-select2-dropdown .select2-results__option--highlighted.select2-results__option--selectable {
    background: #ff6a1a !important;
    color: #fff !important;
}

.wg-rule-builder-select2-dropdown .select2-results__option--highlighted .wg-rule-select2-option strong,
.wg-rule-builder-select2-dropdown .select2-results__option--highlighted .wg-rule-select2-option small {
    color: #fff !important;
}

.wg-rule-builder-select2-dropdown .select2-results__option[aria-selected="true"] {
    background: #eaf6ff;
    color: #0d2d4b;
}

.wg-rule-builder-select2-dropdown .select2-results__option[aria-selected="true"] .wg-rule-select2-option strong {
    color: #0d2d4b;
}

.wg-rule-builder-select2-dropdown .select2-results__option[aria-selected="true"] .wg-rule-select2-option small {
    color: #5d7288;
}

@media (max-width: 920px) {
    .wg-rule-builder .wg-rule-group-head > .select2-container {
        width: 100% !important;
        flex-basis: 100%;
    }
}


.wg-rule-builder .wg-rule-condition-row {
    grid-template-columns: minmax(210px, 1.25fr) minmax(160px, .8fr) minmax(150px, .7fr) minmax(210px, 1.15fr) 38px;
}

.wg-rule-builder .wg-rule-condition-row > span:not([hidden]),
.wg-rule-builder .wg-rule-result-row > span:not([hidden]) {
    display: block;
    min-width: 0;
}

.wg-rule-builder .wg-rule-condition-row input.form-control,
.wg-rule-builder .wg-rule-result-row input.form-control {
    min-height: 42px;
}


/* Hard reset Select2 palette inside the Excel rule builder */
.wg-rule-builder .select2-dropdown,
.wg-rule-builder-select2-dropdown {
    min-width: 390px;
    max-width: min(620px, calc(100vw - 48px));
    border: 1px solid #b9d2e6 !important;
    border-radius: 10px !important;
    background: #fff !important;
    color: #0d2d4b !important;
    overflow: hidden;
    box-shadow: 0 18px 36px rgba(15, 38, 64, .18) !important;
    z-index: 99999;
}

.wg-rule-builder .select2-search--dropdown,
.wg-rule-builder-select2-dropdown .select2-search--dropdown {
    padding: 9px;
    background: #f5faff !important;
}

.wg-rule-builder .select2-search__field,
.wg-rule-builder-select2-dropdown .select2-search__field {
    min-height: 38px;
    border: 1px solid #bfd6e8 !important;
    border-radius: 8px !important;
    background: #fff !important;
    color: #0d2d4b !important;
    padding: 8px 10px !important;
    outline: none !important;
}

.wg-rule-builder .select2-results,
.wg-rule-builder .select2-results__options,
.wg-rule-builder-select2-dropdown .select2-results,
.wg-rule-builder-select2-dropdown .select2-results__options {
    background: #fff !important;
    color: #0d2d4b !important;
}

.wg-rule-builder .select2-results__options,
.wg-rule-builder-select2-dropdown .select2-results__options {
    max-height: 280px;
}

.wg-rule-builder .select2-results__option,
.wg-rule-builder-select2-dropdown .select2-results__option {
    background: #fff !important;
    color: #0d2d4b !important;
    padding: 9px 12px !important;
}

.wg-rule-builder .select2-results__group,
.wg-rule-builder-select2-dropdown .select2-results__group {
    background: #f5faff !important;
    color: #60758b !important;
    padding: 8px 12px 5px !important;
    font-size: 11px;
    font-weight: 950;
    text-transform: uppercase;
}

.wg-rule-builder .select2-results__option--selected,
.wg-rule-builder .select2-results__option[aria-selected="true"],
.wg-rule-builder-select2-dropdown .select2-results__option--selected,
.wg-rule-builder-select2-dropdown .select2-results__option[aria-selected="true"] {
    background: #eaf6ff !important;
    color: #0d2d4b !important;
}

.wg-rule-builder .select2-results__option--highlighted,
.wg-rule-builder .select2-results__option--highlighted[aria-selected],
.wg-rule-builder .select2-results__option--highlighted.select2-results__option--selectable,
.wg-rule-builder-select2-dropdown .select2-results__option--highlighted,
.wg-rule-builder-select2-dropdown .select2-results__option--highlighted[aria-selected],
.wg-rule-builder-select2-dropdown .select2-results__option--highlighted.select2-results__option--selectable {
    background: #ff6a1a !important;
    color: #fff !important;
}

.wg-rule-builder .select2-results__option--highlighted .wg-rule-select2-option strong,
.wg-rule-builder .select2-results__option--highlighted .wg-rule-select2-option small,
.wg-rule-builder-select2-dropdown .select2-results__option--highlighted .wg-rule-select2-option strong,
.wg-rule-builder-select2-dropdown .select2-results__option--highlighted .wg-rule-select2-option small {
    color: #fff !important;
}

.wg-rule-builder .wg-rule-select2-selection-label {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wg-rule-builder .select2-container--default .select2-selection--single .select2-selection__rendered {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    line-height: 40px !important;
}

.wg-rule-builder .wg-rule-condition-row {
    grid-template-columns: minmax(240px, 1.35fr) minmax(160px, .78fr) minmax(150px, .72fr) minmax(230px, 1.1fr) 40px;
}


/* Final rule builder polish: compact selects, cleaner rails, useful truncation */
.wg-rule-builder .wg-rule-condition-group {
    padding-left: 46px;
}

.wg-rule-builder .wg-rule-condition-group .wg-rule-condition-group {
    padding-left: 42px;
}

.wg-rule-builder .wg-rule-tree-rail {
    left: 24px;
    top: 66px;
    bottom: 28px;
    border-left-width: 2px;
}

.wg-rule-builder .wg-rule-tree-rail span {
    top: 50%;
    min-width: 28px;
    height: 20px;
    font-size: 10px;
    line-height: 20px;
}

.wg-rule-builder .wg-rule-condition-row::before,
.wg-rule-builder .wg-rule-group-children > .wg-rule-condition-group::before {
    left: -23px;
    width: 22px;
}

.wg-rule-builder .wg-rule-group-children > .wg-rule-condition-group::before {
    top: 32px;
}

.wg-rule-builder .wg-rule-condition-row {
    grid-template-columns: minmax(250px, 1.45fr) minmax(150px, .72fr) minmax(140px, .62fr) minmax(230px, 1.05fr) 40px;
    gap: 8px;
}

.wg-rule-builder .select2-container .select2-selection--single {
    min-height: 38px !important;
    height: 38px !important;
    border-radius: 7px !important;
}

.wg-rule-builder .select2-container--default .select2-selection--single .select2-selection__rendered {
    height: 36px !important;
    line-height: 36px !important;
    padding: 0 30px 0 11px !important;
}

.wg-rule-builder .select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 36px !important;
    right: 7px !important;
}

.wg-rule-builder .wg-rule-select2-selection-label {
    font-size: 13px;
    font-weight: 900;
}

.wg-rule-builder .select2-dropdown,
.wg-rule-builder-select2-dropdown {
    min-width: 430px !important;
    max-width: min(680px, calc(100vw - 56px)) !important;
}

.wg-rule-builder .select2-results__options,
.wg-rule-builder-select2-dropdown .select2-results__options {
    max-height: 250px !important;
}

.wg-rule-builder .select2-results__option,
.wg-rule-builder-select2-dropdown .select2-results__option {
    min-height: 42px;
    padding: 7px 10px !important;
    overflow: hidden;
}

.wg-rule-builder .select2-results__group,
.wg-rule-builder-select2-dropdown .select2-results__group {
    padding: 7px 10px 4px !important;
    line-height: 1.1;
}

.wg-rule-builder .wg-rule-select2-option {
    display: block;
    max-width: 100%;
    overflow: hidden;
    line-height: 1.12;
}

.wg-rule-builder .wg-rule-select2-option strong,
.wg-rule-builder .wg-rule-select2-option small {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wg-rule-builder .wg-rule-select2-option strong {
    font-size: 13px;
    line-height: 1.15;
}

.wg-rule-builder .wg-rule-select2-option small {
    margin-top: 3px;
    font-size: 10px;
    line-height: 1.1;
}

.wg-rule-builder .wg-rule-preview-head strong {
    max-width: min(360px, 60vw);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}


/* Criteria rail behavior: no AND/OR marker for single condition, no extra top/bottom rail */
.wg-rule-builder .wg-rule-condition-group.is-single-criterion {
    padding-left: 18px;
}

.wg-rule-builder .wg-rule-condition-group.is-single-criterion > .wg-rule-tree-rail,
.wg-rule-builder .wg-rule-condition-group.is-single-criterion > .wg-rule-group-children::before,
.wg-rule-builder .wg-rule-condition-group.is-single-criterion > .wg-rule-group-children > .wg-rule-condition-row::before,
.wg-rule-builder .wg-rule-condition-group.is-single-criterion > .wg-rule-group-children > .wg-rule-condition-group::before {
    display: none !important;
}

.wg-rule-builder .wg-rule-condition-group.has-logic-rail > .wg-rule-tree-rail {
    top: 0;
    bottom: 0;
    left: 23px;
    border-left: 0 !important;
    pointer-events: none;
}

.wg-rule-builder .wg-rule-condition-group.has-logic-rail > .wg-rule-tree-rail span {
    top: calc(50% + 28px);
}

.wg-rule-builder .wg-rule-condition-group.has-logic-rail > .wg-rule-group-children {
    position: relative;
}

.wg-rule-builder .wg-rule-condition-group.has-logic-rail > .wg-rule-group-children::before {
    content: "";
    position: absolute;
    left: -23px;
    top: 20px;
    bottom: 20px;
    border-left: 2px solid var(--wg-rule-rail);
}

.wg-rule-builder .wg-rule-condition-group.has-logic-rail > .wg-rule-group-children > .wg-rule-condition-row::before,
.wg-rule-builder .wg-rule-condition-group.has-logic-rail > .wg-rule-group-children > .wg-rule-condition-group::before {
    left: -23px;
    width: 22px;
    display: block;
}

/* Detailed Excel rule-builder preview */
.wg-rule-preview-sample {
    border: 1px solid #b8e5e4;
    border-radius: 10px;
    background: #f8ffff;
    padding: 9px 10px;
    display: grid;
    gap: 7px;
}

.wg-rule-preview-sample > strong,
.wg-rule-preview-block > b,
.wg-rule-preview-result > b,
.wg-rule-preview-else > b {
    color: #12324f;
    font-size: 12px;
    font-weight: 900;
}

.wg-rule-preview-sample > div {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.wg-rule-preview-sample span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 260px;
    border: 1px solid #d3e5ef;
    border-radius: 999px;
    background: #fff;
    padding: 4px 8px;
    font-size: 11px;
}

.wg-rule-preview-sample b,
.wg-rule-preview-sample em {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wg-rule-preview-sample b {
    color: #5b7087;
    font-style: normal;
}

.wg-rule-preview-sample em {
    color: #0c2c49;
    font-style: normal;
    font-weight: 900;
}

.wg-rule-preview-scenarios {
    display: grid;
    gap: 8px;
}

.wg-rule-preview-scenario,
.wg-rule-preview-else {
    border: 1px solid #d6e4ef;
    border-radius: 10px;
    background: #fff;
    padding: 9px 10px;
    display: grid;
    gap: 8px;
}

.wg-rule-preview-scenario.is-hit,
.wg-rule-preview-else.is-hit {
    border-color: #7bdac8;
    background: #f0fffb;
}

.wg-rule-preview-scenario > header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
}

.wg-rule-preview-scenario > header strong {
    color: #0d2d4a;
    font-size: 13px;
    font-weight: 950;
}

.wg-rule-preview-scenario > header span {
    border-radius: 999px;
    background: #f1f5f9;
    color: #64748b;
    padding: 4px 8px;
    font-size: 11px;
    font-weight: 900;
}

.wg-rule-preview-scenario.is-hit > header span {
    background: #dffcf5;
    color: #04735e;
}

.wg-rule-preview-block {
    display: grid;
    gap: 6px;
}

.wg-rule-preview-condition {
    display: grid;
    grid-template-columns: auto minmax(120px, 1fr) auto minmax(100px, 1fr) auto;
    align-items: center;
    gap: 7px;
    border: 1px solid #e2edf5;
    border-radius: 9px;
    background: #fbfdff;
    padding: 7px 8px;
    margin-left: calc(var(--depth, 0) * 14px);
    min-width: 0;
}

.wg-rule-preview-condition.is-hit {
    border-color: #beeede;
}

.wg-rule-preview-condition.is-miss {
    border-color: #ffd2d2;
    background: #fffafa;
}

.wg-rule-preview-condition > i {
    font-size: 16px;
    color: #ef4444;
}

.wg-rule-preview-condition.is-hit > i {
    color: #0f9f8f;
}

.wg-rule-preview-value {
    display: grid;
    gap: 1px;
    min-width: 0;
}

.wg-rule-preview-value b,
.wg-rule-preview-value em,
.wg-rule-preview-op,
.wg-rule-preview-condition > strong,
.wg-rule-preview-result span,
.wg-rule-preview-result small,
.wg-rule-preview-else span,
.wg-rule-preview-else small {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wg-rule-preview-value b {
    color: #60758b;
    font-size: 10px;
    font-weight: 850;
}

.wg-rule-preview-value em {
    color: #0d2d4a;
    font-size: 12px;
    font-style: normal;
    font-weight: 950;
}

.wg-rule-preview-op {
    color: #9a3412;
    font-size: 11px;
    font-weight: 900;
}

.wg-rule-preview-condition > strong {
    justify-self: end;
    color: #ef4444;
    font-size: 11px;
    font-weight: 950;
}

.wg-rule-preview-condition.is-hit > strong {
    color: #04735e;
}

.wg-rule-preview-joiner {
    display: inline-flex;
    width: fit-content;
    border-radius: 999px;
    background: #fbbf24;
    color: #082f49;
    padding: 2px 7px;
    font-size: 10px;
    font-weight: 950;
    margin-left: calc(var(--depth, 0) * 14px);
}

.wg-rule-preview-subgroup {
    display: grid;
    gap: 6px;
    border-left: 2px solid #fbbf24;
    padding-left: 8px;
}

.wg-rule-preview-not {
    width: fit-content;
    border-radius: 999px;
    background: #fff7ed;
    color: #b45309;
    padding: 2px 7px;
    font-size: 10px;
    font-weight: 950;
}

.wg-rule-preview-result,
.wg-rule-preview-else {
    grid-template-columns: auto minmax(90px, max-content) minmax(120px, 1fr);
    align-items: center;
}

.wg-rule-preview-result {
    display: grid;
    gap: 8px;
    border-top: 1px solid #edf3f8;
    padding-top: 7px;
}

.wg-rule-preview-result span,
.wg-rule-preview-else span {
    border-radius: 999px;
    background: #0f766e;
    color: #fff;
    padding: 4px 9px;
    font-size: 12px;
    font-weight: 950;
}

.wg-rule-preview-result small,
.wg-rule-preview-else small {
    color: #64748b;
    font-size: 11px;
    font-weight: 800;
}

@media (max-width: 900px) {
    .wg-rule-preview-condition,
    .wg-rule-preview-result,
    .wg-rule-preview-else {
        grid-template-columns: 1fr;
    }

    .wg-rule-preview-condition > strong {
        justify-self: start;
    }
}

.wg-rule-select2-option.wg-bom-source-item1, .wg-rule-select2-selection-label.wg-bom-source-item1 { border-left: 3px solid #2563eb; padding-left: 7px; }
.wg-rule-select2-option.wg-bom-source-item2, .wg-rule-select2-selection-label.wg-bom-source-item2 { border-left: 3px solid #14b8a6; padding-left: 7px; }
.wg-rule-select2-option.wg-bom-source-item1 strong { color: #1d4ed8; }
.wg-rule-select2-option.wg-bom-source-item2 strong { color: #0f766e; }

/* Excel mapping base editor Select2 controls */
.wg-excel-rule-editor > div > .select2-container,
.wg-cleaning-compact .select2-container,
.wg-rule-source-field .select2-container {
    width: 100% !important;
}

.wg-excel-rule-editor .select2-container--default .select2-selection--single {
    min-height: 42px;
    border: 1px solid #f3c5a5;
    border-radius: 8px;
    background: #fff7ed;
    display: flex;
    align-items: center;
    color: #0d2d4a;
    font-weight: 800;
}

.wg-excel-rule-editor .select2-container--default .select2-selection--single .select2-selection__rendered {
    width: 100%;
    padding: 0 38px 0 12px;
    color: #0d2d4a;
    line-height: 40px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wg-excel-rule-editor .select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 40px;
    right: 8px;
}

.wg-excel-rule-editor .select2-container--default.select2-container--focus .select2-selection--single,
.wg-excel-rule-editor .select2-container--default.select2-container--open .select2-selection--single {
    border-color: #ff6a1a;
    box-shadow: 0 0 0 3px rgba(255, 106, 26, 0.14);
    background: #fff;
}

.wg-mapping-editor-select2-dropdown {
    border: 1px solid #f1c4a5 !important;
    border-radius: 10px !important;
    background: #fffaf6 !important;
    box-shadow: 0 18px 38px rgba(15, 45, 74, 0.18) !important;
    overflow: hidden;
    z-index: 10060;
}

.wg-mapping-editor-select2-dropdown .select2-search--dropdown {
    padding: 8px;
    background: #fff7ed;
    border-bottom: 1px solid #f5d8c3;
}

.wg-mapping-editor-select2-dropdown .select2-search__field {
    min-height: 34px;
    border: 1px solid #efbd99 !important;
    border-radius: 8px;
    color: #0d2d4a;
    font-weight: 800;
    outline: none;
}

.wg-mapping-editor-select2-dropdown .select2-results__options {
    max-height: 280px !important;
}

.wg-mapping-editor-select2-dropdown .select2-results__option {
    padding: 9px 12px;
    color: #0d2d4a;
    font-weight: 800;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wg-mapping-editor-select2-dropdown .select2-results__option--selected,
.wg-mapping-editor-select2-dropdown .select2-results__option[aria-selected="true"] {
    background: #fff0e4 !important;
    color: #9a3412 !important;
}

.wg-mapping-editor-select2-dropdown .select2-results__option--highlighted,
.wg-mapping-editor-select2-dropdown .select2-results__option--highlighted[aria-selected],
.wg-mapping-editor-select2-dropdown .select2-results__option--highlighted.select2-results__option--selectable {
    background: #ff6a1a !important;
    color: #fff !important;
}

/* PDF Viewer spools popup filters */
body.weldgrid-shell .wg-spools-popup-swal {
    max-width: min(880px, calc(100vw - 28px));
}
body.weldgrid-shell .wg-spools-popup {
    display: grid;
    gap: 10px;
    color: var(--wg-navy);
    text-align: left;
}
body.weldgrid-shell .wg-spools-popup-tools {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) auto;
    gap: 10px;
    align-items: center;
}
body.weldgrid-shell .wg-spools-popup-filters {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: flex-end;
}
body.weldgrid-shell .wg-spools-popup-filter-chip {
    border: 1px solid rgba(12, 46, 76, .16);
    border-radius: 999px;
    background: #ffffff;
    color: var(--wg-navy);
    padding: 7px 11px;
    font-size: .78rem;
    font-weight: 950;
    line-height: 1.1;
}
body.weldgrid-shell .wg-spools-popup-filter-chip.is-active {
    border-color: rgba(255, 106, 26, .55);
    background: #fff7ed;
    color: #c2410c;
}
body.weldgrid-shell .wg-spools-popup-filter-chip:disabled {
    opacity: .45;
    cursor: not-allowed;
}
body.weldgrid-shell .wg-spools-popup-summary {
    color: var(--wg-muted);
    font-size: .78rem;
    font-weight: 900;
}
body.weldgrid-shell .wg-spools-popup-list {
    max-height: min(56vh, 460px);
    overflow: auto;
    border: 1px solid rgba(12, 46, 76, .12);
    border-radius: 8px;
    background: #ffffff;
}
body.weldgrid-shell .wg-spools-popup-header,
body.weldgrid-shell .wg-spools-popup-row {
    display: grid;
    grid-template-columns: minmax(180px, 1.25fr) minmax(140px, .85fr) minmax(170px, 1.15fr) 76px minmax(116px, .75fr);
    gap: 10px;
    align-items: center;
}
body.weldgrid-shell .wg-spools-popup-header {
    position: sticky;
    top: 0;
    z-index: 2;
    padding: 9px 12px;
    border-bottom: 1px solid rgba(12, 46, 76, .12);
    background: #f4f8fb;
    color: #08233e;
    font-size: .74rem;
    font-weight: 950;
    text-transform: uppercase;
}
body.weldgrid-shell .wg-spools-popup-row {
    min-height: 48px;
    padding: 9px 12px;
    border-bottom: 1px solid rgba(12, 46, 76, .08);
    color: #17324d;
    font-size: .82rem;
    font-weight: 850;
}
body.weldgrid-shell .wg-spools-popup-row:last-child {
    border-bottom: 0;
}
body.weldgrid-shell .wg-spools-popup-name {
    display: flex;
    align-items: center;
    min-width: 0;
    gap: 8px;
}
body.weldgrid-shell .wg-spools-popup-name strong {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 950;
}
body.weldgrid-shell .wg-spools-popup-status {
    width: 10px;
    height: 10px;
    flex: 0 0 10px;
    border-radius: 999px;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, .95), 0 0 0 3px rgba(12, 46, 76, .12);
}
body.weldgrid-shell .wg-spools-popup-code,
body.weldgrid-shell .wg-spools-popup-pdf {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #31506d;
}
body.weldgrid-shell .wg-spools-popup-code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: .78rem;
}
body.weldgrid-shell .wg-spools-popup-current-badge {
    display: inline-flex;
    align-items: center;
    border: 1px solid rgba(25, 118, 162, .22);
    border-radius: 999px;
    background: #eef8fd;
    color: #0b5e83;
    padding: 4px 8px;
    font-size: .72rem;
    font-weight: 950;
    white-space: nowrap;
}
body.weldgrid-shell .wg-spools-popup-pdf-label {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
body.weldgrid-shell .wg-spools-popup-count {
    color: #17324d;
    font-size: .78rem;
    font-weight: 950;
    white-space: nowrap;
}
@media (max-width: 760px) {
    body.weldgrid-shell .wg-spools-popup-tools {
        grid-template-columns: 1fr;
    }
    body.weldgrid-shell .wg-spools-popup-filters {
        justify-content: flex-start;
    }
    body.weldgrid-shell .wg-spools-popup-header {
        display: none;
    }
    body.weldgrid-shell .wg-spools-popup-list {
        display: grid;
        gap: 8px;
        max-height: min(60vh, 520px);
        border: 0;
        background: transparent;
    }
    body.weldgrid-shell .wg-spools-popup-row {
        grid-template-columns: 1fr;
        gap: 5px;
        border: 1px solid rgba(12, 46, 76, .12);
        border-radius: 8px;
        background: #ffffff;
    }
    body.weldgrid-shell .wg-spools-popup-code::before,
    body.weldgrid-shell .wg-spools-popup-pdf::before,
    body.weldgrid-shell .wg-spools-popup-row > div:nth-child(4)::before,
    body.weldgrid-shell .wg-spools-popup-count::before {
        display: inline-block;
        min-width: 86px;
        color: var(--wg-muted);
        font-family: inherit;
        font-size: .72rem;
        font-weight: 950;
    }
    body.weldgrid-shell .wg-spools-popup-code::before { content: 'Κωδικός'; }
    body.weldgrid-shell .wg-spools-popup-pdf::before { content: 'PDF'; }
    body.weldgrid-shell .wg-spools-popup-row > div:nth-child(4)::before { content: 'Σελίδα'; }
    body.weldgrid-shell .wg-spools-popup-count::before { content: 'Συγκολλήσεις'; }
}


/* PDF Viewer client usability: filters, PDF done state and compact weld/spool cards */
.wg-pdf-list-filters,
.wg-pdf-list-controls {
    gap: 7px;
}
.wg-pdf-filter-chip {
    min-height: 34px;
}
.wg-pdf-list-item {
    grid-template-columns: minmax(0, 1fr) auto;
}
.wg-pdf-list-item.is-done {
    border-color: rgba(16, 185, 129, .34);
    background: linear-gradient(180deg, #ffffff 0%, #f0fdf4 100%);
}
.wg-pdf-list-actions {
    display: inline-flex;
    align-items: flex-start;
    justify-content: flex-end;
    gap: 5px;
}
.wg-pdf-card-done-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: 1px solid rgba(12, 46, 76, .16);
    border-radius: 7px;
    background: #f8fbfd;
    color: #64748b;
    cursor: pointer;
    transition: background .16s ease, border-color .16s ease, color .16s ease, transform .16s ease;
}
.wg-pdf-card-done-toggle:hover {
    border-color: rgba(255, 106, 26, .55);
    color: #ff6a1a;
    transform: translateY(-1px);
}
.wg-pdf-card-done-toggle.is-done {
    border-color: rgba(16, 185, 129, .45);
    background: #d1fae5;
    color: #047857;
}
.wg-pdf-card-done-toggle.is-saving i {
    animation: wgSpin .8s linear infinite;
}
.wg-pdf-list-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    min-width: 0;
    margin-top: 4px;
}
.wg-pdf-list-badge {
    display: inline-flex;
    align-items: center;
    min-height: 20px;
    padding: 2px 8px;
    border: 1px solid rgba(12, 46, 76, .14);
    border-radius: 999px;
    background: #eef6fb;
    color: #254a68;
    font-size: 10px;
    font-weight: 950;
    line-height: 1.1;
    white-space: nowrap;
}
.wg-weld-card-flat {
    border-radius: 8px;
}
.wg-weld-card-flat .wg-annotation-list-main strong {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}
.wg-weld-card-flat .wg-annotation-list-main strong > span:first-child {
    flex: 0 0 auto;
}
.wg-weld-card-spool-chip {
    display: inline-flex;
    align-items: center;
    min-width: 0;
    max-width: 145px;
    padding: 2px 6px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--wg-weld-spool-color, #ff6a1a) 14%, #ffffff);
    border: 1px solid color-mix(in srgb, var(--wg-weld-spool-color, #ff6a1a) 38%, #ffffff);
    color: color-mix(in srgb, var(--wg-weld-spool-color, #ff6a1a) 78%, #0f172a);
    font-size: 10px;
    font-weight: 950;
    line-height: 1.15;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.wg-weld-card-spool-chip.is-empty {
    background: #f1f5f9;
    border-color: #d8e2ec;
    color: #64748b;
}
.wg-spool-panel-compact {
    display: grid;
    gap: 6px;
    margin-bottom: 8px;
    padding: 8px;
    border: 1px solid rgba(12, 46, 76, .12);
    border-radius: 9px;
    background: rgba(248, 251, 253, .92);
}
.wg-spool-panel-compact.active {
    border-color: rgba(255, 106, 26, .38);
    background: #fff7ed;
}
.wg-spool-panel-compact-head {
    display: flex;
    align-items: center;
    gap: 6px;
}
.wg-spool-panel-compact-head .wg-spool-group-toggle {
    flex: 1 1 auto;
    min-width: 0;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    border: 0;
    background: transparent;
    padding: 0;
    color: #0f2b46;
    text-align: left;
}
.wg-spool-panel-compact-head strong {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 950;
}
.wg-spool-panel-compact-head small {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    border-radius: 999px;
    background: #e8f2fa;
    color: #35526d;
    font-size: 11px;
    font-weight: 950;
}
.wg-spool-panel-compact-body {
    display: grid;
    gap: 6px;
}

/* Fix compact spool grouping readability inside the dark PDF side panel */
body.weldgrid-shell .wg-pdf-workspace .wg-spool-panel-compact {
    background: #f8fbfd;
    border-color: rgba(12, 46, 76, .14);
    color: #0f2b46;
    box-shadow: 0 8px 18px rgba(2, 14, 28, .08);
}
body.weldgrid-shell .wg-pdf-workspace .wg-spool-panel-compact.active {
    background: #fff7ed;
    border-color: rgba(255, 106, 26, .42);
}
body.weldgrid-shell .wg-pdf-workspace .wg-spool-panel-compact .wg-spool-group-toggle,
body.weldgrid-shell .wg-pdf-workspace .wg-spool-panel-compact .wg-spool-group-toggle:hover {
    background: transparent;
    border-color: transparent;
    color: #0f2b46;
}
body.weldgrid-shell .wg-pdf-workspace .wg-spool-panel-compact-head strong {
    color: #0f2b46 !important;
}
body.weldgrid-shell .wg-pdf-workspace .wg-spool-panel-compact-head small {
    background: #e8f2fa;
    color: #31506d !important;
}
body.weldgrid-shell .wg-pdf-workspace .wg-spool-panel-compact .wg-annotation-list-item,
body.weldgrid-shell .wg-pdf-workspace .wg-spool-panel-compact .wg-annotation-list-item:hover {
    background: #ffffff;
    border-color: rgba(12, 46, 76, .12);
    color: #0f2b46;
    opacity: 1;
}
body.weldgrid-shell .wg-pdf-workspace .wg-spool-panel-compact .wg-annotation-list-item.active {
    background: #f0fbff;
    border-color: rgba(0, 166, 214, .55);
}
body.weldgrid-shell .wg-pdf-workspace .wg-spool-panel-compact .wg-annotation-list-main strong,
body.weldgrid-shell .wg-pdf-workspace .wg-spool-panel-compact .wg-annotation-list-main strong > span:first-child {
    color: #08233e !important;
}
body.weldgrid-shell .wg-pdf-workspace .wg-spool-panel-compact .wg-annotation-list-main span {
    color: #31506d !important;
}
body.weldgrid-shell .wg-pdf-workspace .wg-spool-panel-compact .wg-annotation-list-main small {
    color: #64748b !important;
}
body.weldgrid-shell .wg-pdf-workspace .wg-spool-panel-compact .wg-weld-card-spool-chip {
    background: color-mix(in srgb, var(--wg-weld-spool-color, #ff6a1a) 14%, #ffffff);
    border-color: color-mix(in srgb, var(--wg-weld-spool-color, #ff6a1a) 38%, #ffffff);
    color: color-mix(in srgb, var(--wg-weld-spool-color, #ff6a1a) 78%, #0f172a) !important;
}
body.weldgrid-shell .wg-pdf-workspace .wg-spool-panel-compact .wg-weld-card-spool-chip.is-empty {
    background: #f1f5f9;
    border-color: #d8e2ec;
    color: #64748b !important;
}
body.weldgrid-shell .wg-pdf-workspace .wg-spool-panel-compact .wg-spool-group-actions button,
body.weldgrid-shell .wg-pdf-workspace .wg-spool-panel-compact .wg-annotation-list-actions button {
    background: #f8fbfd;
    border-color: rgba(12, 46, 76, .14);
    color: #17324d;
}
body.weldgrid-shell .wg-pdf-workspace .wg-spool-panel-compact .wg-spool-group-actions button:hover,
body.weldgrid-shell .wg-pdf-workspace .wg-spool-panel-compact .wg-annotation-list-actions button:hover {
    background: #fff7ed;
    border-color: rgba(255, 106, 26, .34);
    color: #c2460c;
}

/* Keep compact spool names inside the right panel without horizontal overflow */
body.weldgrid-shell .wg-pdf-workspace .wg-spool-panel-compact {
    overflow: hidden;
}
body.weldgrid-shell .wg-pdf-workspace .wg-spool-panel-compact-head {
    min-width: 0;
    align-items: flex-start;
}
body.weldgrid-shell .wg-pdf-workspace .wg-spool-panel-compact-head .wg-spool-group-toggle {
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
}
body.weldgrid-shell .wg-pdf-workspace .wg-spool-panel-compact-head strong {
    display: -webkit-box;
    max-width: 100%;
    overflow: hidden;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    font-size: 13px;
    line-height: 1.18;
}
body.weldgrid-shell .wg-pdf-workspace .wg-spool-panel-compact-head .wg-spool-dot {
    flex: 0 0 auto;
    margin-top: 2px;
}
body.weldgrid-shell .wg-pdf-workspace .wg-spool-panel-compact-head small {
    flex: 0 0 auto;
    margin-left: 4px;
}
body.weldgrid-shell .wg-pdf-workspace .wg-spool-panel-compact .wg-annotation-list-item {
    min-width: 0;
    overflow: hidden;
}
body.weldgrid-shell .wg-pdf-workspace .wg-spool-panel-compact .wg-annotation-list-main,
body.weldgrid-shell .wg-pdf-workspace .wg-spool-panel-compact .wg-annotation-list-main strong {
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
}
body.weldgrid-shell .wg-pdf-workspace .wg-spool-panel-compact .wg-weld-card-spool-chip {
    max-width: min(100%, 180px);
}

/* PDF Viewer side panels: closed by default should not reserve workspace width */
.wg-pdf-layout.left-collapsed {
    grid-template-columns: 0 minmax(0, 1fr) 320px;
}
.wg-pdf-layout.right-collapsed {
    grid-template-columns: 280px minmax(0, 1fr) 0;
}
.wg-pdf-layout.left-collapsed.right-collapsed {
    grid-template-columns: 0 minmax(0, 1fr) 0;
}
.wg-pdf-layout.left-collapsed .wg-pdf-left,
.wg-pdf-layout.right-collapsed .wg-pdf-right {
    width: 0;
    min-width: 0;
    overflow: visible;
    pointer-events: none;
}
.wg-pdf-layout.left-collapsed .wg-pdf-left > .wg-card,
.wg-pdf-layout.right-collapsed .wg-pdf-right > .wg-card {
    display: none;
}
.wg-pdf-side-tab {
    width: 28px;
    min-height: 96px;
    padding: 7px 3px;
    border-color: rgba(176, 221, 245, .5);
    box-shadow: 0 10px 24px rgba(2, 14, 28, .24);
}
.wg-pdf-side-tab-left {
    left: -1px;
    top: 168px;
    border-radius: 0 8px 8px 0;
}
.wg-pdf-side-tab-right {
    right: -1px;
    top: 168px;
    border-radius: 8px 0 0 8px;
}
.wg-pdf-side-tab:not([hidden]) {
    pointer-events: auto;
}
.wg-pdf-workspace.is-fullscreen .wg-pdf-layout.left-collapsed,
.wg-pdf-workspace:fullscreen .wg-pdf-layout.left-collapsed {
    grid-template-columns: 0 minmax(0, 1fr) 330px;
}
.wg-pdf-workspace.is-fullscreen .wg-pdf-layout.right-collapsed,
.wg-pdf-workspace:fullscreen .wg-pdf-layout.right-collapsed {
    grid-template-columns: 220px minmax(0, 1fr) 0;
}
.wg-pdf-workspace.is-fullscreen .wg-pdf-layout.left-collapsed.right-collapsed,
.wg-pdf-workspace:fullscreen .wg-pdf-layout.left-collapsed.right-collapsed {
    grid-template-columns: 0 minmax(0, 1fr) 0;
}
.wg-pdf-workspace.is-fullscreen .wg-pdf-side-tab-left,
.wg-pdf-workspace:fullscreen .wg-pdf-side-tab-left {
    left: -1px;
    top: 132px;
}
.wg-pdf-workspace.is-fullscreen .wg-pdf-side-tab-right,
.wg-pdf-workspace:fullscreen .wg-pdf-side-tab-right {
    right: -1px;
    top: 132px;
}

/* Header pulsing panel toggles */
.wg-active-pdf-actions .wg-pdf-panel-pulse {
    position: static;
    z-index: auto;
    display: none;
    align-items: center;
    justify-content: center;
    gap: 7px;
    width: auto;
    min-width: 112px;
    min-height: 38px;
    padding: 8px 12px;
    border: 1px solid rgba(222, 241, 252, .55);
    border-radius: 9px;
    background: rgba(255, 255, 255, .14);
    color: #ffffff;
    font-size: 12px;
    font-weight: 950;
    letter-spacing: .01em;
    line-height: 1;
    writing-mode: horizontal-tb;
    transform: none;
    text-transform: uppercase;
    box-shadow: 0 0 0 0 rgba(255, 106, 26, .34), 0 8px 18px rgba(2, 14, 28, .14);
    animation: wgPanelPulse 1.85s ease-in-out infinite;
}
.wg-active-pdf-actions .wg-pdf-panel-pulse:not([hidden]) {
    display: inline-flex;
}
.wg-active-pdf-actions .wg-pdf-panel-pulse:hover,
.wg-active-pdf-actions .wg-pdf-panel-pulse:focus {
    background: #ff6a1a;
    border-color: #ff6a1a;
    color: #ffffff;
    animation-play-state: paused;
}
.wg-active-pdf-actions .wg-pdf-panel-pulse i {
    font-size: 15px;
    line-height: 1;
}
.wg-active-pdf-actions .wg-pdf-panel-pulse span {
    color: inherit !important;
    white-space: nowrap;
}
@keyframes wgPanelPulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(255, 106, 26, .38), 0 8px 18px rgba(2, 14, 28, .14);
        border-color: rgba(222, 241, 252, .55);
    }
    50% {
        box-shadow: 0 0 0 6px rgba(255, 106, 26, 0), 0 10px 22px rgba(2, 14, 28, .18);
        border-color: rgba(255, 106, 26, .78);
    }
}
@media (max-width: 980px) {
    .wg-active-pdf-actions .wg-pdf-panel-pulse {
        min-width: 40px;
        padding-inline: 10px;
    }
    .wg-active-pdf-actions .wg-pdf-panel-pulse span {
        display: none;
    }
}


/* PDF Viewer page-only: remove the overview banner and align toolbar/viewer width */
body.weldgrid-shell .wg-pdf-workspace > .wg-page-header {
    display: none !important;
}

body.weldgrid-shell .wg-pdf-workspace .wg-pdf-toolbar,
body.weldgrid-shell .wg-pdf-workspace .wg-pdf-layout,
body.weldgrid-shell .wg-pdf-workspace .wg-pdf-viewer-card {
    width: 100%;
    max-width: none;
    margin-left: 0;
    margin-right: 0;
}

body.weldgrid-shell .wg-pdf-workspace .wg-pdf-layout.left-collapsed.right-collapsed {
    column-gap: 0;
    gap: 0;
}

body.weldgrid-shell .wg-pdf-workspace .wg-pdf-layout.left-collapsed.right-collapsed .wg-pdf-center {
    width: 100%;
    min-width: 0;
}


/* PDF Viewer page-only: make the drawing area use the available viewport height */
body.weldgrid-shell #wgPdfWorkspace.wg-pdf-workspace {
    min-height: calc(100dvh - var(--wg-topbar-height, 64px) - var(--wg-footer-height, 56px) - 18px);
}

body.weldgrid-shell #wgPdfWorkspace .wg-pdf-layout {
    flex: 1 1 auto;
    min-height: 0;
    align-items: stretch;
}

body.weldgrid-shell #wgPdfWorkspace .wg-pdf-center,
body.weldgrid-shell #wgPdfWorkspace .wg-pdf-viewer-card {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

body.weldgrid-shell #wgPdfWorkspace .wg-pdf-center,
body.weldgrid-shell #wgPdfWorkspace .wg-pdf-viewer-card,
body.weldgrid-shell #wgPdfWorkspace .wg-pdf-canvas-shell {
    flex: 1 1 auto;
}

body.weldgrid-shell #wgPdfWorkspace .wg-pdf-canvas-shell {
    height: clamp(560px, calc(100dvh - 250px), 1200px) !important;
    min-height: 0 !important;
    max-height: clamp(560px, calc(100dvh - 250px), 1200px) !important;
    overflow: auto !important;
}
@media (max-width: 900px) {
    body.weldgrid-shell #wgPdfWorkspace .wg-pdf-canvas-shell {
        height: clamp(420px, calc(100dvh - 210px), 900px) !important;
        min-height: 0 !important;
        max-height: clamp(420px, calc(100dvh - 210px), 900px) !important;
    }
}


/* PDF Viewer fit-width active state */
body.weldgrid-shell #wgPdfWorkspace .wg-pdf-toolbar #wgFitWidth.active {
    background: #ff6a1a;
    border-color: #ff6a1a;
    color: #ffffff;
    box-shadow: 0 8px 20px rgba(255, 106, 26, .24);
}

body.weldgrid-shell #wgPdfWorkspace .wg-pdf-toolbar #wgFitWidth.active:hover,
body.weldgrid-shell #wgPdfWorkspace .wg-pdf-toolbar #wgFitWidth.active:focus {
    background: #e84f13;
    border-color: #e84f13;
    color: #ffffff;
}


/* PDF Viewer compact side spacing and project-colored scrollbars */
body.weldgrid-shell #wgPdfWorkspace .wg-pdf-layout {
    gap: 10px;
    column-gap: 10px;
}

body.weldgrid-shell #wgPdfWorkspace .wg-pdf-layout.left-collapsed,
body.weldgrid-shell #wgPdfWorkspace .wg-pdf-layout.right-collapsed,
body.weldgrid-shell #wgPdfWorkspace .wg-pdf-layout.left-collapsed.right-collapsed {
    gap: 0;
    column-gap: 0;
}

body.weldgrid-shell #wgPdfWorkspace {
    --wg-scroll-track: #08243b;
    --wg-scroll-track-soft: #e7f1f7;
    --wg-scroll-thumb: #1f7fa8;
    --wg-scroll-thumb-hover: #ff6a1a;
    --wg-scroll-thumb-border: rgba(255, 255, 255, .55);
    scrollbar-color: var(--wg-scroll-thumb) var(--wg-scroll-track-soft);
    scrollbar-width: thin;
}

body.weldgrid-shell #wgPdfWorkspace .wg-pdf-side > .wg-card,
body.weldgrid-shell #wgPdfWorkspace .wg-annotation-list-panel,
body.weldgrid-shell #wgPdfWorkspace .wg-pdf-list,
body.weldgrid-shell #wgPdfWorkspace .wg-annotation-list,
body.weldgrid-shell #wgPdfWorkspace .wg-spool-list {
    scrollbar-color: var(--wg-scroll-thumb) var(--wg-scroll-track);
    scrollbar-width: thin;
}

body.weldgrid-shell #wgPdfWorkspace .wg-pdf-canvas-shell {
    scrollbar-color: var(--wg-scroll-thumb) var(--wg-scroll-track-soft);
    scrollbar-width: thin;
}

body.weldgrid-shell #wgPdfWorkspace *::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

body.weldgrid-shell #wgPdfWorkspace *::-webkit-scrollbar-track {
    background: var(--wg-scroll-track-soft);
    border-radius: 999px;
}

body.weldgrid-shell #wgPdfWorkspace .wg-pdf-side *::-webkit-scrollbar-track,
body.weldgrid-shell #wgPdfWorkspace .wg-annotation-list-panel *::-webkit-scrollbar-track {
    background: rgba(8, 36, 59, .9);
}

body.weldgrid-shell #wgPdfWorkspace *::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #1f7fa8 0%, #123f5f 100%);
    border: 2px solid var(--wg-scroll-thumb-border);
    border-radius: 999px;
}

body.weldgrid-shell #wgPdfWorkspace .wg-pdf-side *::-webkit-scrollbar-thumb,
body.weldgrid-shell #wgPdfWorkspace .wg-annotation-list-panel *::-webkit-scrollbar-thumb {
    border-color: rgba(8, 36, 59, .9);
}

body.weldgrid-shell #wgPdfWorkspace *::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #ff8a3d 0%, #ff6a1a 100%);
}

body.weldgrid-shell #wgPdfWorkspace *::-webkit-scrollbar-corner {
    background: transparent;
}


/* PDF Viewer final viewport lock: keep zoom inside the drawing scroll area */
body.weldgrid-shell #wgPdfWorkspace.wg-pdf-workspace {
    height: calc(100dvh - var(--wg-topbar-height, 64px) - var(--wg-footer-height, 56px) - 18px);
    min-height: 0 !important;
    overflow: hidden;
}

body.weldgrid-shell #wgPdfWorkspace .wg-pdf-toolbar {
    flex: 0 0 auto;
}

body.weldgrid-shell #wgPdfWorkspace .wg-pdf-layout {
    flex: 1 1 0;
    min-height: 0;
    height: auto;
    align-items: stretch;
    gap: 10px;
    column-gap: 10px;
}

body.weldgrid-shell #wgPdfWorkspace .wg-pdf-center,
body.weldgrid-shell #wgPdfWorkspace .wg-pdf-side {
    min-height: 0;
    height: 100%;
}

body.weldgrid-shell #wgPdfWorkspace .wg-pdf-viewer-card {
    height: 100%;
    min-height: 0;
    overflow: hidden;
}

body.weldgrid-shell #wgPdfWorkspace .wg-active-pdf-bar,
body.weldgrid-shell #wgPdfWorkspace .wg-version-timeline {
    flex: 0 0 auto;
}

body.weldgrid-shell #wgPdfWorkspace .wg-pdf-canvas-shell {
    flex: 1 1 0 !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: auto !important;
}

body.weldgrid-shell #wgPdfWorkspace .wg-pdf-side > .wg-card,
body.weldgrid-shell #wgPdfWorkspace .wg-annotation-list-panel {
    max-height: 100%;
    overflow: auto;
}

body.weldgrid-shell #wgPdfWorkspace .wg-pdf-layout.left-collapsed,
body.weldgrid-shell #wgPdfWorkspace .wg-pdf-layout.right-collapsed,
body.weldgrid-shell #wgPdfWorkspace .wg-pdf-layout.left-collapsed.right-collapsed {
    gap: 0;
    column-gap: 0;
}
@media (max-width: 900px) {
    body.weldgrid-shell #wgPdfWorkspace.wg-pdf-workspace {
        height: auto;
        min-height: calc(100dvh - var(--wg-topbar-height, 64px) - var(--wg-footer-height, 56px));
        overflow: visible;
    }

    body.weldgrid-shell #wgPdfWorkspace .wg-pdf-layout,
    body.weldgrid-shell #wgPdfWorkspace .wg-pdf-center,
    body.weldgrid-shell #wgPdfWorkspace .wg-pdf-side,
    body.weldgrid-shell #wgPdfWorkspace .wg-pdf-viewer-card {
        height: auto;
    }

    body.weldgrid-shell #wgPdfWorkspace .wg-pdf-canvas-shell {
        height: clamp(420px, calc(100dvh - 210px), 900px) !important;
        flex: 0 0 auto !important;
    }
}


/* PDF Viewer fullscreen access tabs and tighter drawing height */
body.weldgrid-shell #wgPdfWorkspace.wg-pdf-workspace {
    height: calc(100dvh - var(--wg-topbar-height, 64px) - var(--wg-footer-height, 56px) - 6px);
}

body.weldgrid-shell #wgPdfWorkspace .wg-active-pdf-bar {
    padding-block: 8px;
}

body.weldgrid-shell #wgPdfWorkspace .wg-version-timeline {
    padding-block: 6px;
}

body.weldgrid-shell #wgPdfWorkspace.is-fullscreen,
body.weldgrid-shell #wgPdfWorkspace:fullscreen {
    width: 100vw !important;
    height: 100dvh !important;
    min-height: 0 !important;
    padding: 6px !important;
    gap: 6px !important;
    overflow: hidden !important;
}

body.weldgrid-shell #wgPdfWorkspace.is-fullscreen .wg-pdf-toolbar,
body.weldgrid-shell #wgPdfWorkspace:fullscreen .wg-pdf-toolbar {
    flex: 0 0 auto;
    margin: 0 !important;
    padding: 6px 8px !important;
    border-radius: 8px !important;
}

body.weldgrid-shell #wgPdfWorkspace.is-fullscreen .wg-pdf-layout,
body.weldgrid-shell #wgPdfWorkspace:fullscreen .wg-pdf-layout {
    flex: 1 1 0 !important;
    min-height: 0 !important;
    height: auto !important;
    align-items: stretch !important;
}

body.weldgrid-shell #wgPdfWorkspace.is-fullscreen .wg-pdf-center,
body.weldgrid-shell #wgPdfWorkspace:fullscreen .wg-pdf-center,
body.weldgrid-shell #wgPdfWorkspace.is-fullscreen .wg-pdf-viewer-card,
body.weldgrid-shell #wgPdfWorkspace:fullscreen .wg-pdf-viewer-card {
    height: 100% !important;
    min-height: 0 !important;
}

body.weldgrid-shell #wgPdfWorkspace.is-fullscreen .wg-active-pdf-bar,
body.weldgrid-shell #wgPdfWorkspace:fullscreen .wg-active-pdf-bar {
    padding: 6px 8px !important;
}

body.weldgrid-shell #wgPdfWorkspace.is-fullscreen .wg-version-timeline,
body.weldgrid-shell #wgPdfWorkspace:fullscreen .wg-version-timeline {
    padding: 5px 8px !important;
    max-height: 78px !important;
}

body.weldgrid-shell #wgPdfWorkspace.is-fullscreen .wg-pdf-canvas-shell,
body.weldgrid-shell #wgPdfWorkspace:fullscreen .wg-pdf-canvas-shell {
    flex: 1 1 0 !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    padding: 8px !important;
    overflow: auto !important;
}

body.weldgrid-shell #wgPdfWorkspace.is-fullscreen .wg-active-pdf-actions .wg-pdf-panel-pulse:not([hidden]),
body.weldgrid-shell #wgPdfWorkspace:fullscreen .wg-active-pdf-actions .wg-pdf-panel-pulse:not([hidden]) {
    position: fixed !important;
    z-index: 2147483647 !important;
    top: 50% !important;
    display: inline-flex !important;
    width: 44px !important;
    min-width: 44px !important;
    min-height: 168px !important;
    padding: 12px 6px !important;
    writing-mode: vertical-rl !important;
    text-orientation: mixed !important;
    transform: translateY(-50%) !important;
    border-radius: 12px !important;
    background: linear-gradient(180deg, #123f5f 0%, #0d314b 100%) !important;
    border-color: rgba(176, 221, 245, .58) !important;
    color: #ffffff !important;
    box-shadow: 0 18px 34px rgba(2, 14, 28, .35) !important;
}

body.weldgrid-shell #wgPdfWorkspace.is-fullscreen .wg-active-pdf-actions .wg-pdf-side-tab-left:not([hidden]),
body.weldgrid-shell #wgPdfWorkspace:fullscreen .wg-active-pdf-actions .wg-pdf-side-tab-left:not([hidden]) {
    left: 8px !important;
    right: auto !important;
}

body.weldgrid-shell #wgPdfWorkspace.is-fullscreen .wg-active-pdf-actions .wg-pdf-side-tab-right:not([hidden]),
body.weldgrid-shell #wgPdfWorkspace:fullscreen .wg-active-pdf-actions .wg-pdf-side-tab-right:not([hidden]) {
    right: 8px !important;
    left: auto !important;
}

body.weldgrid-shell #wgPdfWorkspace.is-fullscreen .wg-active-pdf-actions .wg-pdf-panel-pulse span,
body.weldgrid-shell #wgPdfWorkspace:fullscreen .wg-active-pdf-actions .wg-pdf-panel-pulse span {
    display: inline !important;
    color: inherit !important;
    white-space: nowrap !important;
}


/* Fullscreen keeps only side access tabs from the active PDF bar */
body.weldgrid-shell #wgPdfWorkspace.is-fullscreen .wg-active-pdf-bar,
body.weldgrid-shell #wgPdfWorkspace:fullscreen .wg-active-pdf-bar {
    display: block !important;
    position: relative !important;
    flex: 0 0 0 !important;
    height: 0 !important;
    min-height: 0 !important;
    max-height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: visible !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

body.weldgrid-shell #wgPdfWorkspace.is-fullscreen .wg-active-pdf-bar > div:first-child,
body.weldgrid-shell #wgPdfWorkspace:fullscreen .wg-active-pdf-bar > div:first-child,
body.weldgrid-shell #wgPdfWorkspace.is-fullscreen .wg-active-pdf-actions > :not(.wg-pdf-panel-pulse),
body.weldgrid-shell #wgPdfWorkspace:fullscreen .wg-active-pdf-actions > :not(.wg-pdf-panel-pulse) {
    display: none !important;
}

body.weldgrid-shell #wgPdfWorkspace.is-fullscreen .wg-active-pdf-actions,
body.weldgrid-shell #wgPdfWorkspace:fullscreen .wg-active-pdf-actions {
    display: block !important;
    position: static !important;
    width: 0 !important;
    height: 0 !important;
    min-width: 0 !important;
    min-height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: visible !important;
}


/* PDF Viewer versions toggle and wider PDF rail */
body.weldgrid-shell #wgPdfWorkspace .wg-active-pdf-actions {
    max-width: none;
}

body.weldgrid-shell #wgPdfWorkspace .wg-pdf-version-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-width: 116px;
    min-height: 38px;
    padding: 8px 13px;
    border: 1px solid rgba(222, 241, 252, .58);
    border-radius: 9px;
    background: rgba(255, 255, 255, .14);
    color: #ffffff;
    font-size: 12px;
    font-weight: 950;
    letter-spacing: .01em;
    line-height: 1;
    text-transform: uppercase;
    box-shadow: 0 8px 18px rgba(2, 14, 28, .14);
}

body.weldgrid-shell #wgPdfWorkspace .wg-pdf-version-toggle:hover,
body.weldgrid-shell #wgPdfWorkspace .wg-pdf-version-toggle:focus,
body.weldgrid-shell #wgPdfWorkspace .wg-pdf-version-toggle.active {
    background: #ff6a1a;
    border-color: #ff6a1a;
    color: #ffffff;
    box-shadow: 0 10px 22px rgba(255, 106, 26, .22);
}

body.weldgrid-shell #wgPdfWorkspace .wg-pdf-version-toggle i {
    font-size: 15px;
    line-height: 1;
}

body.weldgrid-shell #wgPdfWorkspace .wg-version-timeline.is-collapsed,
body.weldgrid-shell #wgPdfWorkspace .wg-version-timeline[hidden] {
    display: none !important;
}

body.weldgrid-shell #wgPdfWorkspace .wg-pdf-layout {
    grid-template-columns: 320px minmax(0, 1fr) 320px;
}

body.weldgrid-shell #wgPdfWorkspace .wg-pdf-layout.left-collapsed {
    grid-template-columns: 0 minmax(0, 1fr) 320px;
}

body.weldgrid-shell #wgPdfWorkspace .wg-pdf-layout.right-collapsed {
    grid-template-columns: 320px minmax(0, 1fr) 0;
}

body.weldgrid-shell #wgPdfWorkspace .wg-pdf-layout.left-collapsed.right-collapsed {
    grid-template-columns: 0 minmax(0, 1fr) 0;
}

body.weldgrid-shell #wgPdfWorkspace.is-fullscreen .wg-pdf-layout.right-collapsed,
body.weldgrid-shell #wgPdfWorkspace:fullscreen .wg-pdf-layout.right-collapsed {
    grid-template-columns: 320px minmax(0, 1fr) 0;
}

body.weldgrid-shell #wgPdfWorkspace.is-fullscreen .wg-pdf-layout.left-collapsed,
body.weldgrid-shell #wgPdfWorkspace:fullscreen .wg-pdf-layout.left-collapsed {
    grid-template-columns: 0 minmax(0, 1fr) 320px;
}

body.weldgrid-shell #wgPdfWorkspace.is-fullscreen .wg-pdf-layout.left-collapsed.right-collapsed,
body.weldgrid-shell #wgPdfWorkspace:fullscreen .wg-pdf-layout.left-collapsed.right-collapsed {
    grid-template-columns: 0 minmax(0, 1fr) 0;
}

@media (max-width: 900px) {
    body.weldgrid-shell #wgPdfWorkspace .wg-pdf-layout,
    body.weldgrid-shell #wgPdfWorkspace .wg-pdf-layout.left-collapsed,
    body.weldgrid-shell #wgPdfWorkspace .wg-pdf-layout.right-collapsed,
    body.weldgrid-shell #wgPdfWorkspace .wg-pdf-layout.left-collapsed.right-collapsed {
        grid-template-columns: 1fr;
    }
}


/* Compact PDF upload accordion and single-row PDF controls */
body.weldgrid-shell #wgPdfWorkspace .wg-upload-box {
    display: grid;
    gap: 8px;
    margin: 8px 0 10px;
}

body.weldgrid-shell #wgPdfWorkspace .wg-pdf-upload-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    min-height: 38px;
    padding: 8px 10px;
    border-color: rgba(222, 241, 252, .5);
    background: rgba(255, 255, 255, .12);
    color: #ffffff;
    font-weight: 950;
}

body.weldgrid-shell #wgPdfWorkspace .wg-pdf-upload-toggle:hover,
body.weldgrid-shell #wgPdfWorkspace .wg-pdf-upload-toggle:focus,
body.weldgrid-shell #wgPdfWorkspace .wg-pdf-upload-toggle.active {
    background: #ff6a1a;
    border-color: #ff6a1a;
    color: #ffffff;
}

body.weldgrid-shell #wgPdfWorkspace .wg-pdf-upload-toggle .ri-arrow-down-s-line {
    transition: transform .18s ease;
}

body.weldgrid-shell #wgPdfWorkspace .wg-pdf-upload-toggle.active .ri-arrow-down-s-line {
    transform: rotate(180deg);
}

body.weldgrid-shell #wgPdfWorkspace .wg-pdf-upload-collapsible {
    display: grid;
    gap: 8px;
}

body.weldgrid-shell #wgPdfWorkspace .wg-pdf-upload-collapsible[hidden] {
    display: none !important;
}

body.weldgrid-shell #wgPdfWorkspace .wg-upload-box.is-collapsed {
    margin-bottom: 8px;
}

body.weldgrid-shell #wgPdfWorkspace .wg-pdf-list-controls {
    display: grid;
    grid-template-columns: minmax(76px, 1fr) minmax(78px, .82fr) minmax(66px, .72fr) 42px;
    gap: 6px;
    align-items: center;
    margin: 8px 0 9px;
}

body.weldgrid-shell #wgPdfWorkspace .wg-pdf-list-controls .form-control,
body.weldgrid-shell #wgPdfWorkspace .wg-pdf-list-controls .form-select,
body.weldgrid-shell #wgPdfWorkspace .wg-pdf-list-controls .wg-btn {
    width: 100%;
    min-height: 36px;
    padding: 7px 8px;
    border-radius: 7px;
    font-size: 12px;
    font-weight: 850;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

body.weldgrid-shell #wgPdfWorkspace .wg-pdf-list-controls .wg-pdf-manager-trigger {
    min-width: 42px;
    width: 42px;
    padding-inline: 0;
    font-size: 0;
}

body.weldgrid-shell #wgPdfWorkspace .wg-pdf-list-controls .wg-pdf-manager-trigger i {
    margin: 0;
    font-size: 15px;
}


/* PDF Viewer side panel height balance after compact upload */
body.weldgrid-shell #wgPdfWorkspace .wg-pdf-side {
    display: flex;
    min-height: 0;
    height: 100%;
}

body.weldgrid-shell #wgPdfWorkspace .wg-pdf-side > .wg-card,
body.weldgrid-shell #wgPdfWorkspace .wg-annotation-list-panel {
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: 100%;
    overflow: hidden;
}

body.weldgrid-shell #wgPdfWorkspace .wg-pdf-layout.left-collapsed .wg-pdf-left > .wg-card,
body.weldgrid-shell #wgPdfWorkspace .wg-pdf-layout.right-collapsed .wg-pdf-right > .wg-card {
    display: none !important;
}

body.weldgrid-shell #wgPdfWorkspace .wg-pdf-side .wg-card-head,
body.weldgrid-shell #wgPdfWorkspace .wg-pdf-left .wg-upload-box,
body.weldgrid-shell #wgPdfWorkspace .wg-pdf-left .wg-pdf-list-controls,
body.weldgrid-shell #wgPdfWorkspace .wg-pdf-right .wg-pdf-mini-actions,
body.weldgrid-shell #wgPdfWorkspace .wg-pdf-right .wg-annotation-list-tools,
body.weldgrid-shell #wgPdfWorkspace .wg-pdf-right .wg-spool-bulk-action {
    flex: 0 0 auto;
}

body.weldgrid-shell #wgPdfWorkspace .wg-pdf-list,
body.weldgrid-shell #wgPdfWorkspace .wg-annotation-list {
    flex: 1 1 auto;
    min-height: 120px;
    max-height: none !important;
    overflow-y: auto;
    overflow-x: hidden;
}

body.weldgrid-shell #wgPdfWorkspace .wg-pdf-list {
    padding-bottom: 10px;
}

body.weldgrid-shell #wgPdfWorkspace .wg-annotation-list {
    padding-bottom: 8px;
}

body.weldgrid-shell #wgPdfWorkspace .wg-pdf-canvas-shell {
    min-height: 0 !important;
}

/* PDF Viewer fullscreen versions toolbar button */
body.weldgrid-shell #wgPdfWorkspace #wgToolbarToggleVersions {
    display: none;
}
body.weldgrid-shell #wgPdfWorkspace.is-fullscreen #wgToolbarToggleVersions,
body.weldgrid-shell #wgPdfWorkspace:fullscreen #wgToolbarToggleVersions {
    display: inline-flex !important;
}
body.weldgrid-shell #wgPdfWorkspace.is-fullscreen #wgToolbarToggleVersions.active,
body.weldgrid-shell #wgPdfWorkspace:fullscreen #wgToolbarToggleVersions.active {
    border-color: rgba(255, 106, 26, .35);
    background: #fff7ed;
    color: #c2460c;
}

/* PDF Viewer annotation/spool UX fixes */
body.weldgrid-shell #wgPdfWorkspace.is-fullscreen .wg-version-timeline:not([hidden]),
body.weldgrid-shell #wgPdfWorkspace:fullscreen .wg-version-timeline:not([hidden]) {
    display: block !important;
    flex: 0 0 auto !important;
    max-height: 124px !important;
    padding: 7px 10px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
}
body.weldgrid-shell #wgPdfWorkspace.is-fullscreen .wg-pdf-viewer-card,
body.weldgrid-shell #wgPdfWorkspace:fullscreen .wg-pdf-viewer-card {
    display: flex !important;
    flex-direction: column !important;
}
body.weldgrid-shell #wgPdfWorkspace.is-fullscreen .wg-pdf-canvas-shell,
body.weldgrid-shell #wgPdfWorkspace:fullscreen .wg-pdf-canvas-shell {
    flex: 1 1 0 !important;
}
body.weldgrid-shell.wg-spool-editor-docked .wg-spool-notes-field,
.swal2-container.wg-spool-editor-scroll-container .wg-spool-notes-field {
    align-self: start;
}
body.weldgrid-shell.wg-spool-editor-docked #wgSwalSpoolNotes,
.swal2-container.wg-spool-editor-scroll-container #wgSwalSpoolNotes {
    min-height: 74px !important;
    max-height: 96px !important;
}
body.weldgrid-shell.wg-spool-editor-docked .wg-spool-create-assignment,
.swal2-container.wg-spool-editor-scroll-container .wg-spool-create-assignment {
    gap: 7px !important;
    padding-top: 10px !important;
}
body.weldgrid-shell.wg-spool-editor-docked .wg-spool-assignment-list,
.swal2-container.wg-spool-editor-scroll-container .wg-spool-assignment-list,
.swal2-container.wg-spool-modal-container .wg-spool-assignment-list {
    max-height: min(46vh, 430px) !important;
    min-height: 286px !important;
}
body.weldgrid-shell.wg-spool-editor-docked .wg-spool-assignment-row,
.swal2-container.wg-spool-editor-scroll-container .wg-spool-assignment-row {
    padding: 7px 9px !important;
}



/* PDF Viewer spool editor tabs and item picker */
.swal2-container.wg-spool-editor-scroll-container .wg-spool-editor-form-tabbed,
body.weldgrid-shell.wg-spool-editor-docked .wg-spool-editor-form-tabbed {
    display: block !important;
    text-align: left;
}
.swal2-container.wg-spool-editor-scroll-container .wg-spool-editor-form-tabbed > .wg-live-label-preview,
body.weldgrid-shell.wg-spool-editor-docked .wg-spool-editor-form-tabbed > .wg-live-label-preview {
    margin-bottom: 10px;
}
.swal2-container.wg-spool-editor-scroll-container .wg-spool-editor-tabs,
body.weldgrid-shell.wg-spool-editor-docked .wg-spool-editor-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 12px;
    padding: 8px 0 10px;
    border-bottom: 1px solid #cfe0ed;
}
.swal2-container.wg-spool-editor-scroll-container .wg-spool-editor-tabs button,
body.weldgrid-shell.wg-spool-editor-docked .wg-spool-editor-tabs button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 34px;
    padding: 7px 12px;
    border: 1px solid #d6e4ef;
    border-radius: 999px;
    background: #ffffff;
    color: #0d2d4b;
    font-size: 12px;
    font-weight: 950;
}
.swal2-container.wg-spool-editor-scroll-container .wg-spool-editor-tabs button.active,
body.weldgrid-shell.wg-spool-editor-docked .wg-spool-editor-tabs button.active {
    border-color: #ff8a4c;
    background: #fff4ec;
    color: #d6560f;
}
.swal2-container.wg-spool-editor-scroll-container .wg-spool-editor-pane[hidden],
body.weldgrid-shell.wg-spool-editor-docked .wg-spool-editor-pane[hidden] {
    display: none !important;
}
.swal2-container.wg-spool-editor-scroll-container .wg-spool-editor-pane,
body.weldgrid-shell.wg-spool-editor-docked .wg-spool-editor-pane {
    display: block;
    min-height: 0;
}
.swal2-container.wg-spool-editor-scroll-container .wg-spool-editor-grid,
body.weldgrid-shell.wg-spool-editor-docked .wg-spool-editor-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}
.swal2-container.wg-spool-editor-scroll-container .wg-spool-editor-grid > .wg-spool-group-picker,
body.weldgrid-shell.wg-spool-editor-docked .wg-spool-editor-grid > .wg-spool-group-picker,
.swal2-container.wg-spool-editor-scroll-container .wg-spool-editor-grid > .wg-spool-notes-field,
body.weldgrid-shell.wg-spool-editor-docked .wg-spool-editor-grid > .wg-spool-notes-field,
.swal2-container.wg-spool-editor-scroll-container .wg-spool-style-grid > .wg-spool-arrow-editor,
body.weldgrid-shell.wg-spool-editor-docked .wg-spool-style-grid > .wg-spool-arrow-editor {
    grid-column: 1 / -1;
}
.swal2-container.wg-spool-editor-scroll-container .wg-spool-editor-grid label,
body.weldgrid-shell.wg-spool-editor-docked .wg-spool-editor-grid label {
    display: grid;
    gap: 5px;
    margin: 0;
    color: #0d2d4b;
    font-size: 12px;
    font-weight: 900;
}
.swal2-container.wg-spool-editor-scroll-container .wg-spool-create-assignment,
body.weldgrid-shell.wg-spool-editor-docked .wg-spool-create-assignment {
    min-height: min(58vh, 520px);
}
.swal2-container.wg-spool-editor-scroll-container .wg-spool-assignment-list,
body.weldgrid-shell.wg-spool-editor-docked .wg-spool-assignment-list {
    max-height: min(52vh, 480px) !important;
    min-height: 338px !important;
}
.wg-ann-item-field {
    position: relative;
}
.wg-ann-item-picker {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    right: 0;
    z-index: 1085;
    display: grid;
    gap: 3px;
    max-height: 260px;
    overflow: auto;
    padding: 6px;
    border: 1px solid #cbdcea;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 14px 28px rgba(7, 27, 47, .22);
}
.wg-ann-item-picker[hidden] {
    display: none !important;
}
.wg-ann-item-option {
    display: grid;
    grid-template-columns: minmax(42px, auto) minmax(0, 1fr);
    gap: 4px 9px;
    width: 100%;
    padding: 8px 9px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: #0d2d4b;
    text-align: left;
}
.wg-ann-item-option:hover,
.wg-ann-item-option.is-active {
    background: #eaf6fb;
}
.wg-ann-item-option strong {
    color: #08243d;
    font-size: 13px;
    font-weight: 950;
}
.wg-ann-item-option span {
    min-width: 0;
    overflow: hidden;
    color: #0d2d4b;
    font-size: 12px;
    font-weight: 850;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.wg-ann-item-option small {
    grid-column: 2;
    overflow: hidden;
    color: #60758a;
    font-size: 11px;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.wg-ann-item-picker-empty {
    padding: 10px;
    color: #60758a;
    font-size: 12px;
    font-weight: 850;
}
@media (max-width: 900px) {
    .swal2-container.wg-spool-editor-scroll-container .wg-spool-editor-grid,
    body.weldgrid-shell.wg-spool-editor-docked .wg-spool-editor-grid {
        grid-template-columns: 1fr;
    }
}


/* PDF Viewer annotation item picker width fix */
.wg-annotation-modal .wg-ann-item-col {
    flex: 0 0 100% !important;
    max-width: 100% !important;
}
.wg-annotation-modal .wg-ann-item-field {
    width: 100%;
}
.wg-annotation-modal .wg-ann-item-picker {
    width: 100% !important;
    max-height: min(44vh, 430px) !important;
    padding: 8px !important;
}
.wg-annotation-modal .wg-ann-item-option {
    grid-template-columns: minmax(56px, auto) minmax(0, 1fr) !important;
    align-items: start;
    min-height: 54px;
    padding: 9px 11px !important;
}
.wg-annotation-modal .wg-ann-item-option strong {
    white-space: nowrap;
}
.wg-annotation-modal .wg-ann-item-option span,
.wg-annotation-modal .wg-ann-item-option small {
    overflow: visible !important;
    text-overflow: clip !important;
    white-space: normal !important;
    line-height: 1.25;
}
.wg-annotation-modal .wg-ann-item-option small {
    display: block;
    margin-top: 2px;
}


/* PDF Viewer right spool panel scroll/expansion fix */
body.weldgrid-shell #wgPdfWorkspace .wg-pdf-right,
body.weldgrid-shell #wgPdfWorkspace .wg-pdf-right > .wg-card,
body.weldgrid-shell #wgPdfWorkspace .wg-pdf-right .wg-annotation-list-panel {
    min-height: 0 !important;
}
body.weldgrid-shell #wgPdfWorkspace .wg-pdf-right .wg-annotation-list-panel {
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
}
body.weldgrid-shell #wgPdfWorkspace .wg-pdf-right .wg-annotation-list {
    flex: 1 1 0 !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    overscroll-behavior: contain;
    padding-right: 6px !important;
    padding-bottom: 16px !important;
}
body.weldgrid-shell #wgPdfWorkspace .wg-pdf-right .wg-spool-panel-compact,
body.weldgrid-shell #wgPdfWorkspace .wg-pdf-right .wg-spool-panel-compact-body,
body.weldgrid-shell #wgPdfWorkspace .wg-pdf-right .wg-spool-panel-compact .wg-annotation-list-item,
body.weldgrid-shell #wgPdfWorkspace .wg-pdf-right .wg-spool-panel-compact .wg-annotation-list-main {
    overflow: visible !important;
}
body.weldgrid-shell #wgPdfWorkspace .wg-pdf-right .wg-spool-panel-compact {
    height: auto !important;
    max-height: none !important;
}
body.weldgrid-shell #wgPdfWorkspace .wg-pdf-right .wg-spool-panel-compact-head strong {
    display: block !important;
    max-width: 100% !important;
    overflow: visible !important;
    text-overflow: clip !important;
    white-space: normal !important;
    overflow-wrap: anywhere;
    word-break: break-word;
    -webkit-line-clamp: unset !important;
    line-clamp: unset !important;
}
body.weldgrid-shell #wgPdfWorkspace .wg-pdf-right .wg-spool-panel-compact .wg-annotation-list-main strong {
    display: grid !important;
    grid-template-columns: minmax(42px, auto) minmax(0, 1fr);
    align-items: start;
    gap: 4px 7px;
    overflow: visible !important;
    white-space: normal !important;
}
body.weldgrid-shell #wgPdfWorkspace .wg-pdf-right .wg-spool-panel-compact .wg-annotation-list-main strong > span:first-child {
    overflow: visible !important;
    white-space: nowrap !important;
}
body.weldgrid-shell #wgPdfWorkspace .wg-pdf-right .wg-spool-panel-compact .wg-annotation-list-main span,
body.weldgrid-shell #wgPdfWorkspace .wg-pdf-right .wg-spool-panel-compact .wg-annotation-list-main small {
    overflow: visible !important;
    text-overflow: clip !important;
    white-space: normal !important;
    line-height: 1.25;
}
body.weldgrid-shell #wgPdfWorkspace .wg-pdf-right .wg-spool-panel-compact .wg-weld-card-spool-chip {
    display: inline-flex !important;
    max-width: 100% !important;
    overflow: visible !important;
    text-overflow: clip !important;
    white-space: normal !important;
    overflow-wrap: anywhere;
    word-break: break-word;
    border-radius: 7px;
}


/* PDF Viewer annotation item picker z-index fix */
.wg-annotation-modal .modal-content,
.wg-annotation-modal .modal-body,
.wg-annotation-modal .wg-ann-modal-tabpanes,
.wg-annotation-modal .wg-ann-tab-pane {
    overflow: visible !important;
}
.wg-annotation-modal .modal-body {
    position: relative;
    z-index: 5;
}
.wg-annotation-modal .modal-footer {
    z-index: 1 !important;
}
.wg-annotation-modal .wg-ann-item-col:focus-within,
.wg-annotation-modal .wg-ann-item-field:focus-within {
    position: relative;
    z-index: 10050 !important;
}
.wg-annotation-modal .wg-ann-item-picker {
    z-index: 10060 !important;
}


/* =========================================================
   WeldGrid Floating BOM Picker Overlay Fix
========================================================= */
body.weldgrid-shell .wg-ann-item-picker.wg-floating-bom-picker {
    position: fixed !important;
    right: auto !important;
    bottom: auto !important;
    display: grid;
    gap: 3px;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    padding: 8px !important;
    border: 1px solid #cbdcea !important;
    border-radius: 8px !important;
    background: #ffffff !important;
    box-shadow: 0 18px 42px rgba(7, 27, 47, .28) !important;
    z-index: 40080 !important;
    overscroll-behavior: contain;
}

body.weldgrid-shell .wg-ann-item-picker.wg-floating-bom-picker[hidden] {
    display: none !important;
}

body.weldgrid-shell .wg-ann-item-picker.wg-floating-bom-picker.is-open-up {
    transform-origin: bottom left;
}

body.weldgrid-shell .wg-ann-item-picker.wg-floating-bom-picker.is-open-down {
    transform-origin: top left;
}

body.weldgrid-shell .wg-ann-item-picker.wg-floating-bom-picker .wg-ann-item-option {
    width: 100%;
    min-height: 54px;
}

body.weldgrid-shell .wg-annotation-modal .modal-footer {
    z-index: 20 !important;
}

body.weldgrid-shell .wg-annotation-modal .modal-body {
    padding-bottom: 18px;
}
.wg-weld-type-picker { display: flex; gap: 8px; align-items: stretch; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x proximity; padding: 2px 2px 8px; max-width: 100%; }
.wg-weld-type-loading { border: 1px dashed rgba(100, 116, 139, .35); border-radius: 8px; color: #64748b; font-size: 12px; padding: 10px 12px; background: #f8fafc; }
.wg-weld-type-chip { position: relative; min-height: 58px; min-width: 132px; max-width: 190px; border: 1px solid rgba(15, 23, 42, .12); border-left: 4px solid var(--wg-weld-type-color, #ff6a1a); border-radius: 8px; background: #ffffff; color: #0f172a; display: flex; flex: 0 0 150px; flex-direction: column; justify-content: center; gap: 2px; padding: 8px 10px; text-align: left; scroll-snap-align: start; box-shadow: 0 1px 2px rgba(15, 23, 42, .06); transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease; }
.wg-weld-type-chip:hover { border-color: color-mix(in srgb, var(--wg-weld-type-color, #ff6a1a) 48%, #cbd5e1); box-shadow: 0 8px 18px rgba(15, 23, 42, .10); transform: translateY(-1px); }
.wg-weld-type-chip.active { background: color-mix(in srgb, var(--wg-weld-type-color, #ff6a1a) 10%, #ffffff); border-color: color-mix(in srgb, var(--wg-weld-type-color, #ff6a1a) 72%, #0f172a); box-shadow: 0 0 0 2px color-mix(in srgb, var(--wg-weld-type-color, #ff6a1a) 18%, transparent); }
.wg-weld-type-chip-code { font-size: 16px; font-weight: 800; line-height: 1; letter-spacing: 0; }
.wg-weld-type-chip-label { font-size: 11px; font-weight: 650; color: #334155; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wg-weld-type-chip-group { font-size: 10px; color: #64748b; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wg-color-source-panel { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-bottom: 6px; }
.wg-color-source-panel > div:first-child { display: grid; gap: 1px; min-width: 0; }
.wg-color-source-panel .form-label { margin-bottom: 0; }
.wg-color-source-panel span { color: #64748b; font-size: 11px; font-weight: 800; }
.wg-color-source-toggle { display: inline-flex; align-items: center; gap: 4px; padding: 3px; border: 1px solid rgba(148, 163, 184, .36); border-radius: 8px; background: #ffffff; }
.wg-color-source-toggle button { min-height: 28px; border: 0; border-radius: 6px; background: transparent; color: #0d2d4b; font-size: 11px; font-weight: 900; padding: 4px 9px; white-space: nowrap; }
.wg-color-source-toggle button.active { background: #0d2d4b; color: #ffffff; }
.wg-color-source-toggle-compact button { min-height: 26px; padding: 3px 8px; }
.wg-annotation-modal.wg-ann-color-source-type .wg-ann-color-swatches { opacity: .72; }
body.weldgrid-shell .wg-annotation-modal .modal-footer { justify-content: flex-start !important; z-index: 20 !important; }
.swal2-popup.wg-weld-config-popup { display: flex !important; flex-direction: column; width: min(980px, calc(100vw - 24px)) !important; max-height: calc(100dvh - 32px); overflow: hidden; padding: 18px 28px 0; }
.swal2-popup.wg-weld-config-popup .swal2-title { flex: 0 0 auto; margin: 0 0 8px; color: #0d2d4b; line-height: 1.18; }
.swal2-popup.wg-weld-config-popup .swal2-html-container { flex: 1 1 auto; min-height: 0; max-height: calc(100dvh - 170px); margin: 0 !important; overflow-x: hidden !important; overflow-y: auto !important; overscroll-behavior: contain; padding: 0 4px 12px !important; scrollbar-width: thin; }
.swal2-popup.wg-weld-config-popup .swal2-actions { flex: 0 0 auto; margin: 10px 0 16px !important; }
@supports not (height: 100dvh) { .swal2-popup.wg-weld-config-popup { max-height: calc(100vh - 32px); } }
@supports not (height: 100dvh) { .swal2-popup.wg-weld-config-popup .swal2-html-container { max-height: calc(100vh - 170px); } }
.wg-weld-config-dialog { height: auto; max-height: none; overflow: visible; padding: 0 0 12px; text-align: left; }
.wg-weld-config-intro { margin: 0 0 12px; color: #475569; font-size: 13px; }
.wg-weld-config-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.wg-weld-config-section { border: 1px solid rgba(148, 163, 184, .35); border-radius: 8px; background: #ffffff; padding: 12px; margin-top: 12px; }
.wg-weld-config-section-head { display: flex; justify-content: space-between; gap: 10px; align-items: center; margin-bottom: 10px; }
.wg-weld-config-section-head h4 { margin: 0; font-size: 14px; color: #0f172a; font-weight: 800; }
.wg-weld-config-type-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 10px; }
.wg-weld-config-type-card { border: 1px solid rgba(148, 163, 184, .35); border-radius: 8px; background: #f8fafc; padding: 10px; min-width: 0; }
.wg-weld-config-type-card.is-archived { opacity: .58; }
.wg-weld-config-type-card.is-dragging { opacity: .7; }
.wg-weld-config-type-card.is-drop-target { outline: 2px solid rgba(14, 165, 233, .45); outline-offset: 2px; }
.wg-weld-config-type-head { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; margin-bottom: 10px; min-width: 0; }
.wg-weld-config-type-title { display: grid; flex: 1 1 88px; min-width: 0; gap: 1px; }
.wg-weld-config-type-title strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #0d72a8; font-size: 15px; font-weight: 950; }
.wg-weld-config-type-title small { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #64748b; font-size: 10px; font-weight: 800; }
.wg-weld-config-color-dot { width: 14px; height: 14px; border-radius: 999px; background: var(--wg-weld-type-color, #ff6a1a); box-shadow: 0 0 0 3px color-mix(in srgb, var(--wg-weld-type-color, #ff6a1a) 18%, transparent); flex: 0 0 auto; }
.wg-weld-config-default { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; color: #475569; white-space: nowrap; }
.wg-weld-config-drag { display: inline-flex; align-items: center; gap: 4px; width: auto; min-width: 38px; height: 28px; border: 1px solid rgba(148, 163, 184, .36); border-radius: 7px; background: #ffffff; color: #0d2d4b; cursor: grab; font-size: 11px; font-weight: 900; padding: 0 6px; }
.wg-weld-config-drag:active { cursor: grabbing; }
.wg-weld-config-drag[aria-disabled="true"] { cursor: default; opacity: .58; }
.wg-weld-config-type-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.wg-weld-config-type-grid label { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.wg-weld-config-type-grid label span, .wg-weld-config-field > span { font-size: 11px; color: #475569; font-weight: 700; }
.wg-weld-config-type-grid .form-control, .wg-weld-config-type-grid .form-select { min-width: 0; font-size: 12px; }
.wg-weld-config-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.wg-weld-config-color-palette { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-height: 38px; }
.wg-weld-config-color-swatch { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border: 2px solid #ffffff; border-radius: 7px; background: var(--wg-swatch-color, #ff6a1a); color: #17324d; box-shadow: 0 0 0 1px rgba(12, 46, 76, .2); cursor: pointer; }
.wg-weld-config-color-swatch:hover, .wg-weld-config-color-swatch.active { box-shadow: 0 0 0 2px #00a6d6; transform: translateY(-1px); }
.wg-weld-config-color-custom { background: color-mix(in srgb, var(--wg-swatch-color, #ff6a1a) 18%, #f8fbfd); border-color: rgba(12, 46, 76, .12); }
.wg-weld-config-color-input { position: absolute; width: 1px; height: 1px; min-height: 1px; opacity: 0; pointer-events: none; }
.wg-weld-config-empty { border: 1px dashed rgba(148, 163, 184, .45); border-radius: 8px; padding: 14px; color: #64748b; background: #f8fafc; }
.wg-weld-config-group-head { display: grid; grid-template-columns: 52px minmax(80px, .65fr) minmax(150px, 1.45fr) 76px; gap: 8px; color: #475569; font-size: 11px; font-weight: 800; padding: 0 0 6px; }
.wg-weld-config-group-list { display: grid; gap: 8px; }
.wg-weld-config-group-row { display: grid; grid-template-columns: 52px minmax(80px, .65fr) minmax(150px, 1.45fr) 76px; gap: 8px; align-items: center; min-width: 0; }
.wg-weld-config-group-row.is-archived { opacity: .58; }
.wg-weld-config-group-row.is-dragging { opacity: .7; }
.wg-weld-config-group-row.is-drop-target { outline: 2px solid rgba(14, 165, 233, .45); outline-offset: 2px; }
.wg-weld-config-group-row .form-control, .wg-weld-config-group-row .form-select { min-width: 0; font-size: 12px; }
.wg-weld-copy-dialog { display: grid; gap: 12px; text-align: left; }
.wg-weld-copy-dialog label { display: grid; gap: 6px; color: #475569; font-size: 12px; font-weight: 700; }
.wg-weld-copy-note { margin: 0; color: #64748b; font-size: 12px; font-weight: 750; }
.swal2-popup.wg-weld-copy-report-popup { width: min(720px, calc(100vw - 24px)) !important; }
.wg-weld-copy-report { display: grid; gap: 14px; text-align: left; color: #0f172a; }
.wg-weld-copy-report-route { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 10px; align-items: stretch; }
.wg-weld-copy-report-route div { min-width: 0; border: 1px solid rgba(148, 163, 184, .35); border-radius: 8px; background: #f8fafc; padding: 10px 12px; }
.wg-weld-copy-report-route span { display: block; margin-bottom: 3px; color: #64748b; font-size: 11px; font-weight: 800; }
.wg-weld-copy-report-route strong { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #0d2d4b; font-size: 14px; font-weight: 900; }
.wg-weld-copy-report-route i { align-self: center; color: #0d72a8; font-size: 20px; }
.wg-weld-copy-report-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.wg-weld-copy-report-stat { min-width: 0; border: 1px solid rgba(148, 163, 184, .32); border-radius: 8px; background: #ffffff; padding: 10px 12px; box-shadow: 0 1px 2px rgba(15, 23, 42, .05); }
.wg-weld-copy-report-stat strong { display: block; color: #0d2d4b; font-size: 24px; font-weight: 950; line-height: 1; }
.wg-weld-copy-report-stat span { display: block; margin-top: 5px; color: #475569; font-size: 11px; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wg-weld-copy-report-stat.is-strong { border-color: rgba(22, 163, 74, .32); background: #f0fdf4; }
.wg-weld-copy-report-stat.is-info { border-color: rgba(14, 165, 233, .32); background: #f0f9ff; }
.wg-weld-copy-report-stat.is-warn { border-color: rgba(245, 158, 11, .38); background: #fffbeb; }
.wg-weld-copy-report-notes { display: grid; gap: 7px; border: 1px solid rgba(148, 163, 184, .30); border-radius: 8px; background: #f8fafc; padding: 10px 12px; }
.wg-weld-copy-report-notes p { margin: 0; color: #334155; font-size: 12px; font-weight: 750; line-height: 1.45; }
.wg-weld-config-source { display: inline-flex; align-items: center; gap: 7px; padding: 3px 4px 3px 8px; border: 1px solid rgba(148, 163, 184, .28); border-radius: 8px; background: #f8fafc; }
.wg-weld-config-source > span { color: #475569; font-size: 11px; font-weight: 850; white-space: nowrap; }
.wg-weld-config-search { display: inline-flex; align-items: center; gap: 8px; min-width: min(280px, 100%); border: 1px solid rgba(148, 163, 184, .38); border-radius: 8px; background: #ffffff; color: #64748b; padding: 0 10px; margin-left: auto; }
.wg-weld-config-search input { width: 100%; min-width: 0; border: 0; outline: 0; padding: 8px 0; color: #0f172a; background: transparent; font-size: 12px; }
.wg-weld-config-usage { display: inline-flex; align-items: center; border-radius: 999px; background: #fff7ed; color: #c2410c; font-size: 10px; font-weight: 800; padding: 3px 7px; white-space: nowrap; }
.wg-weld-config-actions { display: inline-flex; align-items: center; gap: 6px; justify-content: flex-end; }
.wg-weld-config-inline-message { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: start; border: 1px solid rgba(249, 115, 22, .28); border-radius: 8px; background: #fff7ed; color: #9a3412; font-size: 12px; font-weight: 700; padding: 10px 12px; margin-bottom: 12px; }
.wg-weld-config-inline-message i { font-size: 16px; line-height: 1.2; }
.wg-weld-config-archived-badge { display: inline-flex; align-items: center; border-radius: 999px; background: #e2e8f0; color: #475569; font-size: 10px; font-weight: 800; padding: 3px 7px; white-space: nowrap; }
.wg-weld-delete-inline { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr minmax(130px, .6fr) auto auto; gap: 8px; align-items: center; border: 1px solid rgba(220, 38, 38, .20); border-radius: 8px; background: #fff7f7; color: #991b1b; font-size: 12px; font-weight: 700; padding: 8px; margin-top: 10px; }
.wg-weld-delete-inline strong { color: #7f1d1d; }
.wg-weld-delete-inline .form-control { min-width: 0; font-size: 12px; background: #ffffff; }
body.weldgrid-shell .wg-icon-btn.wg-danger { color: #dc2626; border-color: rgba(220, 38, 38, .18); background: #fff7f7; }
body.weldgrid-shell .wg-icon-btn.wg-danger:hover { color: #991b1b; border-color: rgba(220, 38, 38, .35); background: #fee2e2; }
body.weldgrid-shell .wg-btn.is-active { border-color: rgba(249, 115, 22, .45); background: #fff7ed; color: #c2410c; }
body.weldgrid-shell .wg-btn.wg-danger { border-color: rgba(220, 38, 38, .28); background: #dc2626; color: #ffffff; }
body.weldgrid-shell .wg-btn.wg-danger:hover { background: #b91c1c; color: #ffffff; }
@media (max-width: 720px) { .wg-color-source-panel { align-items: flex-start; flex-direction: column; } }
@media (max-width: 720px) { .wg-weld-copy-report-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 576px) { .wg-weld-copy-report-route { grid-template-columns: 1fr; } }
@media (max-width: 576px) { .wg-weld-copy-report-route i { display: none; } }
@media (max-width: 576px) { .wg-weld-copy-report-grid { grid-template-columns: 1fr; } }
@media (max-width: 720px) { .wg-weld-config-type-grid { grid-template-columns: 1fr; } }
@media (max-width: 720px) { .wg-weld-config-group-head { display: none; } }
@media (max-width: 720px) { .wg-weld-config-group-row { grid-template-columns: 1fr; } }
@media (max-width: 720px) { .wg-weld-config-search { margin-left: 0; width: 100%; } }
@media (max-width: 720px) { .wg-weld-config-source { flex: 1 1 100%; justify-content: space-between; } }
@media (max-width: 720px) { .wg-weld-delete-inline { grid-template-columns: 1fr; } }
@media (max-width: 576px) { .wg-weld-type-chip { flex-basis: 132px; min-width: 132px; } }

.wg-pipe-cut-page { margin-bottom: 18px; }
.wg-pipe-cut-toolbar { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; align-items: end; margin-bottom: 12px; }
.wg-pipe-cut-toolbar label { display: grid; gap: 5px; min-width: 0; color: #475569; font-size: 12px; font-weight: 800; }
.wg-pipe-cut-toolbar .form-control, .wg-pipe-cut-toolbar .form-select { min-width: 0; font-size: 12px; }
.wg-pipe-cut-scope-badge { align-self: end; justify-self: start; border-radius: 999px; background: #e0f2fe; color: #075985; font-size: 11px; font-weight: 900; padding: 7px 10px; white-space: nowrap; }
.wg-pipe-cut-table { min-width: 980px; }
.wg-pipe-cut-table .form-control { min-width: 86px; font-size: 12px; padding: 5px 7px; }
.wg-pipe-cut-source-text { display: inline-block; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #475569; font-size: 12px; }
.wg-pipe-cut-pagination { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 10px; color: #475569; font-size: 12px; font-weight: 800; }
.wg-pipe-cut-picker { display: grid; gap: 8px; border: 1px solid rgba(25, 118, 162, .18); border-radius: 8px; background: #f8fbfd; padding: 8px; }
.wg-pipe-cut-picker[hidden] { display: none !important; }
.wg-pipe-cut-picker-tools { display: grid; grid-template-columns: minmax(150px, .8fr) minmax(180px, 1fr); gap: 8px; }
.wg-pipe-cut-options { display: grid; gap: 7px; max-height: 220px; overflow: auto; padding-right: 2px; }
.wg-pipe-cut-option { display: grid; grid-template-columns: minmax(70px, .45fr) minmax(120px, .75fr) minmax(150px, 1fr); gap: 8px; align-items: center; width: 100%; border: 1px solid rgba(148, 163, 184, .35); border-radius: 8px; background: #ffffff; color: #17324d; padding: 8px 10px; text-align: left; }
.wg-pipe-cut-option:hover { border-color: rgba(25, 118, 162, .38); background: #f8fbfd; }
.wg-pipe-cut-option.is-selected { border-color: #ff6a1a; box-shadow: 0 0 0 2px rgba(255, 106, 26, .14); }
.wg-pipe-cut-option strong { color: #0d5d8d; font-size: 13px; font-weight: 950; }
.wg-pipe-cut-option span { color: #17324d; font-size: 12px; font-weight: 850; }
.wg-pipe-cut-option small { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #64748b; font-size: 11px; font-weight: 750; }
.wg-segment-source-toggle { display: inline-flex; flex-wrap: wrap; gap: 6px; align-items: center; border: 1px solid rgba(148, 163, 184, .28); border-radius: 8px; background: #ffffff; padding: 5px; }
.wg-segment-source-toggle label { display: inline-flex !important; align-items: center; gap: 6px; margin: 0; border-radius: 7px; padding: 7px 9px; color: #17324d; font-size: 12px; font-weight: 850; cursor: pointer; }
.wg-segment-source-toggle label:has(input:checked) { background: #0d2d4b; color: #ffffff; }
.wg-segment-primary-badge { display: inline-flex; align-items: center; border-radius: 999px; background: #fff7ed; color: #c2410c; font-size: 10px; font-weight: 900; padding: 3px 7px; white-space: nowrap; }
.wg-segment-length-breakdown { display: inline-flex; align-items: center; border-radius: 7px; background: #f8fafc; color: #17324d; font-size: 11px; font-weight: 850; padding: 5px 7px; white-space: nowrap; }
@media (max-width: 720px) { .wg-pipe-cut-picker-tools { grid-template-columns: 1fr; } }
@media (max-width: 720px) { .wg-pipe-cut-option { grid-template-columns: 1fr; } }

body.weldgrid-shell .wg-spin { animation: wgSpin 1s linear infinite; }
body.weldgrid-shell .wg-pipe-cut-page { border-color: rgba(13, 45, 75, .12); background: linear-gradient(180deg, #ffffff 0%, #f6fafc 100%); box-shadow: 0 14px 34px rgba(15, 40, 65, .08); }
body.weldgrid-shell .wg-pipe-cut-page .wg-card-head { border-bottom: 1px solid rgba(148, 163, 184, .22); padding-bottom: 12px; }
body.weldgrid-shell .wg-pipe-cut-page h2 { color: #0d2d4b; letter-spacing: 0; }
body.weldgrid-shell .wg-pipe-cut-page p { color: #5b6f83; font-weight: 700; }
body.weldgrid-shell .wg-pipe-cut-toolbar { grid-template-columns: minmax(140px, .8fr) minmax(180px, 1.1fr) minmax(130px, .8fr) minmax(92px, .5fr) minmax(220px, 1.2fr) minmax(160px, .9fr) minmax(120px, .7fr) auto; align-items: end; border: 1px solid rgba(148, 163, 184, .20); border-radius: 8px; background: #f8fbfd; padding: 12px; }
body.weldgrid-shell .wg-pipe-cut-toolbar label span { color: #304a63; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
body.weldgrid-shell .wg-pipe-cut-toolbar .form-control, body.weldgrid-shell .wg-pipe-cut-toolbar .form-select { border-color: #cbd8e3; background-color: #ffffff; color: #0d2d4b; font-weight: 750; }
body.weldgrid-shell .wg-pipe-cut-scope-badge { border: 1px solid rgba(13, 93, 141, .16); background: #e9f6fb; color: #0d5d8d; }
body.weldgrid-shell .wg-pipe-cut-table thead th { background: #eaf3f8; color: #0d2d4b; font-size: 11px; text-transform: uppercase; letter-spacing: .03em; }
body.weldgrid-shell .wg-pipe-cut-table tbody tr:hover { background: #f8fbfd; }
body.weldgrid-shell .wg-pipe-cut-table .form-control { border-color: #d1dce6; background: #ffffff; color: #0d2d4b; font-weight: 750; }
body.weldgrid-shell .wg-pipe-cut-picker { border-color: rgba(13, 93, 141, .20); background: #f8fbfd; }
body.weldgrid-shell .wg-pipe-cut-picker-note { display: grid; gap: 2px; border: 1px solid rgba(13, 93, 141, .14); border-radius: 8px; background: #edf8fc; color: #0d2d4b; padding: 9px 10px; }
body.weldgrid-shell .wg-pipe-cut-picker-note strong { font-size: 12px; font-weight: 950; }
body.weldgrid-shell .wg-pipe-cut-picker-note span { color: #567086; font-size: 11px; font-weight: 750; line-height: 1.35; }
body.weldgrid-shell .wg-pipe-cut-picker-tools { grid-template-columns: 1fr; }
body.weldgrid-shell .wg-pipe-cut-option { border-color: rgba(148, 163, 184, .32); background: #ffffff; box-shadow: 0 6px 16px rgba(15, 40, 65, .05); }
body.weldgrid-shell .wg-pipe-cut-option:hover { border-color: rgba(13, 93, 141, .34); background: #f5fbfe; }
body.weldgrid-shell .wg-pipe-cut-option.is-selected { border-color: #ff6a1a; background: #fff7f1; box-shadow: 0 0 0 2px rgba(255, 106, 26, .16), 0 8px 18px rgba(255, 106, 26, .12); }
body.weldgrid-shell .wg-segment-source-toggle { background: #f8fbfd; border-color: rgba(148, 163, 184, .30); }
body.weldgrid-shell .wg-segment-source-toggle label { color: #0d2d4b; }
body.weldgrid-shell .wg-segment-source-toggle label:has(input:checked) { background: #0d2d4b; color: #ffffff; box-shadow: 0 6px 14px rgba(13, 45, 75, .18); }
@media (max-width: 1180px) { body.weldgrid-shell .wg-pipe-cut-toolbar { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 720px) { body.weldgrid-shell .wg-pipe-cut-toolbar { grid-template-columns: 1fr; } }

/* WeldGrid compact spool segment UI */
body.weldgrid-shell .wg-spool-segments-panel { gap: 8px; margin-top: 12px; padding-top: 10px; }
body.weldgrid-shell .wg-spool-segments-panel .wg-card-head { margin-bottom: 0; }
body.weldgrid-shell .wg-spool-segments-panel .wg-table-responsive { max-height: none !important; overflow-x: auto !important; overflow-y: visible !important; }
body.weldgrid-shell .wg-spool-segments-table { min-width: 980px; }
body.weldgrid-shell .wg-spool-segments-table th, body.weldgrid-shell .wg-spool-segments-table td { padding: 7px 8px; font-size: 12px; line-height: 1.25; vertical-align: top; }
body.weldgrid-shell .wg-spool-segments-table td:nth-child(9) { min-width: 220px; max-width: 320px; white-space: normal; }
body.weldgrid-shell .wg-spool-segments-table td:nth-child(11) { min-width: 130px; max-width: 180px; white-space: normal; }
body.weldgrid-shell.wg-spool-editor-docked .swal2-container .wg-spool-split-editor-popup, .swal2-container.wg-spool-editor-scroll-container .swal2-popup.wg-spool-split-editor-popup { height: calc(100dvh - 10px) !important; max-height: calc(100dvh - 10px) !important; margin: 5px auto !important; }
body.weldgrid-shell.wg-spool-editor-docked .wg-spool-split-editor-popup > .swal2-title, .swal2-container.wg-spool-editor-scroll-container .wg-spool-split-editor-popup > .swal2-title { padding: 12px 18px 4px !important; font-size: 22px !important; line-height: 1.1 !important; }
body.weldgrid-shell.wg-spool-editor-docked .wg-spool-split-editor-popup > .swal2-html-container.wg-spool-split-editor-html, .swal2-container.wg-spool-editor-scroll-container .wg-spool-split-editor-popup > .swal2-html-container.wg-spool-split-editor-html { padding: 8px 18px 10px !important; }
body.weldgrid-shell.wg-spool-editor-docked .wg-spool-split-editor-popup > .swal2-actions.wg-spool-split-editor-actions, .swal2-container.wg-spool-editor-scroll-container .wg-spool-split-editor-popup > .swal2-actions.wg-spool-split-editor-actions { min-height: 62px !important; padding: 10px 18px !important; }
body.weldgrid-shell.wg-spool-editor-docked .wg-live-label-preview, .swal2-container.wg-spool-editor-scroll-container .wg-live-label-preview { min-height: 58px !important; height: 58px !important; margin-bottom: 6px !important; }
body.weldgrid-shell.wg-spool-editor-docked .wg-live-label-preview-area, .swal2-container.wg-spool-editor-scroll-container .wg-live-label-preview-area { inset: 7px !important; }
body.weldgrid-shell.wg-spool-editor-docked .wg-spool-editor-tabs, .swal2-container.wg-spool-editor-scroll-container .wg-spool-editor-tabs { gap: 6px !important; margin: 0 0 8px !important; padding: 5px 0 8px !important; }
body.weldgrid-shell.wg-spool-editor-docked .wg-spool-editor-tabs button, .swal2-container.wg-spool-editor-scroll-container .wg-spool-editor-tabs button { min-height: 30px !important; padding: 5px 10px !important; font-size: 12px !important; }
body.weldgrid-shell.wg-spool-editor-docked .wg-spool-editor-grid, .swal2-container.wg-spool-editor-scroll-container .wg-spool-editor-grid { gap: 8px !important; }
body.weldgrid-shell.wg-spool-editor-docked .wg-spool-editor-segments, .swal2-container.wg-spool-editor-scroll-container .wg-spool-editor-segments { display: flex !important; flex-direction: column !important; gap: 8px !important; min-height: 0 !important; padding: 8px !important; }
body.weldgrid-shell.wg-spool-editor-docked .wg-spool-editor-segments [data-spool-segment-list], .swal2-container.wg-spool-editor-scroll-container .wg-spool-editor-segments [data-spool-segment-list] { min-height: 0 !important; }
body.weldgrid-shell.wg-spool-editor-docked .wg-spool-segment-table-wrap, .swal2-container.wg-spool-editor-scroll-container .wg-spool-segment-table-wrap { max-height: none !important; overflow-x: auto !important; overflow-y: visible !important; }
body.weldgrid-shell.wg-spool-editor-docked .wg-spool-segment-table, .swal2-container.wg-spool-editor-scroll-container .wg-spool-segment-table { min-width: 900px !important; }
body.weldgrid-shell.wg-spool-editor-docked .wg-spool-segment-table th, body.weldgrid-shell.wg-spool-editor-docked .wg-spool-segment-table td, .swal2-container.wg-spool-editor-scroll-container .wg-spool-segment-table th, .swal2-container.wg-spool-editor-scroll-container .wg-spool-segment-table td { padding: 6px 7px !important; font-size: 11.5px !important; line-height: 1.22 !important; }
body.weldgrid-shell.wg-spool-editor-docked .wg-spool-segment-table td:nth-child(9), .swal2-container.wg-spool-editor-scroll-container .wg-spool-segment-table td:nth-child(9) { min-width: 210px; max-width: 300px; white-space: normal; }
body.weldgrid-shell.wg-spool-editor-docked .wg-spool-segment-table td:nth-child(11), .swal2-container.wg-spool-editor-scroll-container .wg-spool-segment-table td:nth-child(11) { min-width: 120px; max-width: 170px; white-space: normal; }
body.weldgrid-shell.wg-spool-editor-docked .wg-spool-segment-toolbar, .swal2-container.wg-spool-editor-scroll-container .wg-spool-segment-toolbar { min-height: 34px !important; }
body.weldgrid-shell.wg-spool-editor-docked .wg-spool-segment-form, .swal2-container.wg-spool-editor-scroll-container .wg-spool-segment-form { grid-template-columns: minmax(156px, .58fr) minmax(108px, .38fr) minmax(108px, .38fr) minmax(0, 1fr) !important; align-items: end !important; gap: 8px !important; padding: 8px !important; }
body.weldgrid-shell.wg-spool-editor-docked .wg-spool-segment-form .wg-segment-source-toggle, .swal2-container.wg-spool-editor-scroll-container .wg-spool-segment-form .wg-segment-source-toggle { grid-row: span 2; align-self: start; }
body.weldgrid-shell.wg-spool-editor-docked .wg-spool-segment-form [data-spool-segment-cut-picker], .swal2-container.wg-spool-editor-scroll-container .wg-spool-segment-form [data-spool-segment-cut-picker] { grid-column: 2 / -1; }
body.weldgrid-shell.wg-spool-editor-docked .wg-spool-segment-form label:has([data-spool-segment-bom]), .swal2-container.wg-spool-editor-scroll-container .wg-spool-segment-form label:has([data-spool-segment-bom]) { grid-column: 1 / span 2; }
body.weldgrid-shell.wg-spool-editor-docked .wg-spool-segment-form > [data-spool-segment-bom-preview], .swal2-container.wg-spool-editor-scroll-container .wg-spool-segment-form > [data-spool-segment-bom-preview] { grid-column: 3 / -1; }
body.weldgrid-shell.wg-spool-editor-docked .wg-spool-segment-form label:has([data-spool-segment-notes]), .swal2-container.wg-spool-editor-scroll-container .wg-spool-segment-form label:has([data-spool-segment-notes]) { grid-column: 1 / -1; }
body.weldgrid-shell.wg-spool-editor-docked .wg-spool-segment-form [data-spool-segment-notes], .swal2-container.wg-spool-editor-scroll-container .wg-spool-segment-form [data-spool-segment-notes] { min-height: 64px !important; max-height: 92px !important; }
body.weldgrid-shell .swal2-popup.wg-spool-segment-swal { width: min(780px, calc(100vw - 24px)) !important; max-height: calc(100dvh - 24px) !important; padding: 0 0 12px !important; }
body.weldgrid-shell .swal2-popup.wg-spool-segment-swal .swal2-title { padding: 14px 18px 4px !important; font-size: 20px !important; line-height: 1.12 !important; }
body.weldgrid-shell .swal2-popup.wg-spool-segment-swal .swal2-html-container, body.weldgrid-shell .swal2-popup.wg-spool-segment-swal .wg-spool-segment-swal-html { padding: 0 18px !important; }
body.weldgrid-shell .swal2-popup.wg-spool-segment-swal .wg-segment-form { grid-template-columns: minmax(156px, .58fr) minmax(108px, .38fr) minmax(108px, .38fr) minmax(0, 1fr) !important; align-items: end !important; gap: 8px !important; padding: 10px !important; }
body.weldgrid-shell .swal2-popup.wg-spool-segment-swal #wgSegmentSourceToggle { grid-row: span 2; align-self: start; }
body.weldgrid-shell .swal2-popup.wg-spool-segment-swal #wgSegmentCutPicker { grid-column: 2 / -1; }
body.weldgrid-shell .swal2-popup.wg-spool-segment-swal .wg-segment-form label:has(#wgSegmentBom) { grid-column: 1 / span 2; }
body.weldgrid-shell .swal2-popup.wg-spool-segment-swal #wgSegmentBomPreview { grid-column: 3 / -1; align-self: stretch; }
body.weldgrid-shell .swal2-popup.wg-spool-segment-swal .wg-segment-form label:has(#wgSegmentNotes) { grid-column: 1 / -1; }
body.weldgrid-shell .swal2-popup.wg-spool-segment-swal #wgSegmentNotes { min-height: 70px !important; max-height: 96px !important; }
body.weldgrid-shell .swal2-popup.wg-spool-segment-swal .wg-pipe-cut-options { max-height: min(30vh, 240px) !important; }
body.weldgrid-shell .swal2-popup.wg-spool-segment-swal .swal2-actions { margin-top: 12px !important; }
@media (max-width: 900px) { body.weldgrid-shell.wg-spool-editor-docked .wg-spool-segment-form, .swal2-container.wg-spool-editor-scroll-container .wg-spool-segment-form, body.weldgrid-shell .swal2-popup.wg-spool-segment-swal .wg-segment-form { grid-template-columns: 1fr !important; } }
@media (max-width: 900px) { body.weldgrid-shell.wg-spool-editor-docked .wg-spool-segment-form .wg-segment-source-toggle, .swal2-container.wg-spool-editor-scroll-container .wg-spool-segment-form .wg-segment-source-toggle, body.weldgrid-shell .swal2-popup.wg-spool-segment-swal #wgSegmentSourceToggle, body.weldgrid-shell .swal2-popup.wg-spool-segment-swal #wgSegmentCutPicker, body.weldgrid-shell.wg-spool-editor-docked .wg-spool-segment-form [data-spool-segment-cut-picker], .swal2-container.wg-spool-editor-scroll-container .wg-spool-segment-form [data-spool-segment-cut-picker], body.weldgrid-shell.wg-spool-editor-docked .wg-spool-segment-form label:has([data-spool-segment-bom]), .swal2-container.wg-spool-editor-scroll-container .wg-spool-segment-form label:has([data-spool-segment-bom]), body.weldgrid-shell.wg-spool-editor-docked .wg-spool-segment-form > [data-spool-segment-bom-preview], .swal2-container.wg-spool-editor-scroll-container .wg-spool-segment-form > [data-spool-segment-bom-preview], body.weldgrid-shell .swal2-popup.wg-spool-segment-swal .wg-segment-form label:has(#wgSegmentBom), body.weldgrid-shell .swal2-popup.wg-spool-segment-swal #wgSegmentBomPreview { grid-column: 1 / -1 !important; grid-row: auto !important; } }


/* WeldGrid Pipe Cut import/export progress */
body.weldgrid-shell .wg-pipe-cut-progress { display: grid; gap: 8px; margin: 0 0 12px; padding: 10px 12px; border: 1px solid rgba(13, 93, 141, .18); border-radius: 8px; background: #f0f8fc; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .82); }
body.weldgrid-shell .wg-pipe-cut-progress[hidden] { display: none !important; }
body.weldgrid-shell .wg-pipe-cut-progress-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: #0d2d4b; font-size: 12px; font-weight: 850; }
body.weldgrid-shell .wg-pipe-cut-progress-head strong { color: #08243d; font-size: 13px; font-weight: 950; }
body.weldgrid-shell .wg-pipe-cut-progress-head span { color: #526b82; text-align: right; }
body.weldgrid-shell .wg-pipe-cut-progress-track { position: relative; height: 8px; overflow: hidden; border-radius: 999px; background: #dbeaf3; }
body.weldgrid-shell .wg-pipe-cut-progress-track span { position: absolute; inset: 0 auto 0 0; width: 0; border-radius: inherit; background: linear-gradient(90deg, #0d5d8d, #1fa8d0, #ff6a1a); transition: width .22s ease; }
body.weldgrid-shell .wg-pipe-cut-progress.is-indeterminate .wg-pipe-cut-progress-track span { width: 42% !important; animation: wgPipeCutProgress 1.15s ease-in-out infinite; }
@keyframes wgPipeCutProgress { 0% { transform: translateX(-110%); } 50% { transform: translateX(55%); } 100% { transform: translateX(245%); } }
body.weldgrid-shell .wg-pipe-cut-import-dialog { display: grid; gap: 12px; color: #0d2d4b; text-align: left; }
body.weldgrid-shell .wg-pipe-cut-import-dialog p { margin: 0; color: #526b82; font-size: 13px; font-weight: 750; line-height: 1.45; }
body.weldgrid-shell .wg-pipe-cut-import-dialog .swal2-file { width: 100%; margin: 0; border: 1px solid #cbdcea; border-radius: 8px; background: #ffffff; color: #08243d; font-size: 13px; font-weight: 800; }
body.weldgrid-shell .wg-pipe-cut-import-dialog small { color: #64748b; font-size: 12px; font-weight: 750; line-height: 1.4; }
body.weldgrid-shell .swal2-popup.wg-pipe-cut-import-popup { width: min(620px, calc(100vw - 24px)) !important; padding: 28px 32px !important; }
body.weldgrid-shell .swal2-popup.wg-pipe-cut-import-popup .swal2-title { color: #0d2d4b !important; font-size: 24px !important; font-weight: 950 !important; }
body.weldgrid-shell .swal2-popup.wg-pipe-cut-import-popup .swal2-html-container { margin: 12px 0 0 !important; }
body.weldgrid-shell .wg-pipe-cut-file-drop { display: grid; place-items: center; gap: 7px; min-height: 124px; padding: 18px 16px; border: 1px dashed rgba(13, 93, 141, .42); border-radius: 10px; background: linear-gradient(180deg, #f6fbfe, #edf7fc); color: #0d2d4b; cursor: pointer; text-align: center; transition: border-color .16s ease, background .16s ease, transform .16s ease; }
body.weldgrid-shell .wg-pipe-cut-file-drop:hover { border-color: rgba(255, 106, 26, .72); background: #fff7ed; transform: translateY(-1px); }
body.weldgrid-shell .wg-pipe-cut-file-drop i { color: #ff6a1a; font-size: 32px; line-height: 1; }
body.weldgrid-shell .wg-pipe-cut-file-drop strong { color: #0d2d4b; font-size: 15px; font-weight: 950; }
body.weldgrid-shell .wg-pipe-cut-file-drop span { max-width: 360px; color: #64748b; font-size: 12px; font-weight: 850; line-height: 1.35; }
body.weldgrid-shell .wg-pipe-cut-hidden-file { position: absolute !important; width: 1px !important; height: 1px !important; opacity: 0 !important; pointer-events: none !important; }
body.weldgrid-shell .wg-pipe-cut-selected-file { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; align-items: center; padding: 10px 12px; border: 1px solid rgba(13, 93, 141, .18); border-radius: 8px; background: #f8fbfd; }
body.weldgrid-shell .wg-pipe-cut-selected-file[hidden] { display: none !important; }
body.weldgrid-shell .wg-pipe-cut-selected-file strong { min-width: 0; overflow: hidden; color: #0d2d4b; font-size: 13px; font-weight: 950; text-overflow: ellipsis; white-space: nowrap; }
body.weldgrid-shell .wg-pipe-cut-selected-file span { color: #526b82; font-size: 12px; font-weight: 900; white-space: nowrap; }
body.weldgrid-shell .wg-pipe-cut-selected-file small { grid-column: 1 / -1; color: #526b82; font-size: 12px; font-weight: 800; line-height: 1.35; }
body.weldgrid-shell .wg-pipe-cut-selected-file.is-ok { border-color: rgba(16, 185, 129, .36); background: #ecfdf5; }
body.weldgrid-shell .wg-pipe-cut-selected-file.is-ok small { color: #047857; }
body.weldgrid-shell .wg-pipe-cut-selected-file.is-error { border-color: rgba(220, 38, 38, .32); background: #fff1f2; }
body.weldgrid-shell .wg-pipe-cut-selected-file.is-error small { color: #991b1b; }
body.weldgrid-shell .wg-pipe-cut-import-rules { display: grid; gap: 5px; padding: 10px 12px; border: 1px solid rgba(255, 106, 26, .2); border-radius: 8px; background: #fff7ed; }
body.weldgrid-shell .wg-pipe-cut-import-rules strong { color: #9a3412; font-size: 13px; font-weight: 950; }
body.weldgrid-shell .wg-pipe-cut-import-rules span { color: #526b82; font-size: 12px; font-weight: 800; line-height: 1.35; }
body.weldgrid-shell .wg-pipe-cut-import-errors { max-height: 190px; scrollbar-color: #1e88b7 #e5f2f8; scrollbar-width: thin; }
body.weldgrid-shell .wg-pipe-cut-import-errors p { padding: 6px 8px; border-radius: 6px; background: rgba(255, 255, 255, .72); }
@media (max-width: 576px) { body.weldgrid-shell .swal2-popup.wg-pipe-cut-import-popup { padding: 22px 18px !important; } body.weldgrid-shell .wg-pipe-cut-selected-file { grid-template-columns: 1fr; } }
body.weldgrid-shell .wg-pipe-cut-import-report { display: grid; gap: 12px; text-align: left; }
body.weldgrid-shell .wg-pipe-cut-import-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
body.weldgrid-shell .wg-pipe-cut-import-stats span { display: grid; gap: 2px; padding: 10px; border: 1px solid rgba(13, 93, 141, .16); border-radius: 8px; background: #f5fbfe; color: #526b82; font-size: 11px; font-weight: 850; }
body.weldgrid-shell .wg-pipe-cut-import-stats strong { color: #0d2d4b; font-size: 20px; font-weight: 950; line-height: 1; }
body.weldgrid-shell .wg-pipe-cut-import-warnings, body.weldgrid-shell .wg-pipe-cut-import-errors { display: grid; gap: 6px; max-height: 220px; overflow: auto; padding: 10px; border-radius: 8px; text-align: left; }
body.weldgrid-shell .wg-pipe-cut-import-warnings { border: 1px solid rgba(249, 115, 22, .24); background: #fff7ed; color: #9a3412; }
body.weldgrid-shell .wg-pipe-cut-import-errors { border: 1px solid rgba(220, 38, 38, .22); background: #fff1f2; color: #991b1b; }
body.weldgrid-shell .wg-pipe-cut-import-warnings p, body.weldgrid-shell .wg-pipe-cut-import-errors p { margin: 0; font-size: 12px; font-weight: 750; line-height: 1.35; }
@media (max-width: 720px) { body.weldgrid-shell .wg-pipe-cut-import-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 576px) { body.weldgrid-shell .wg-pipe-cut-progress-head { align-items: flex-start; flex-direction: column; } }

/* WeldGrid docked editor horizontal drag */
body.weldgrid-shell .wg-docked-editor-drag-handle { position: absolute; left: 8px; top: 50%; z-index: 90; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; width: 32px; height: 86px; border: 1px solid rgba(12, 46, 76, .22); border-radius: 999px; background: #ffffff; color: #0d2d4b; box-shadow: 0 10px 24px rgba(7, 27, 47, .18); cursor: default; transform: translateY(-50%); }
body.weldgrid-shell .wg-docked-editor-drag-handle i { font-size: 16px; line-height: 1; }
body.weldgrid-shell .wg-docked-editor-drag-handle span { writing-mode: vertical-rl; transform: rotate(180deg); font-size: 9px; font-weight: 950; letter-spacing: 0; line-height: 1; }
body.weldgrid-shell .wg-docked-editor-drag-handle:hover { border-color: rgba(255, 106, 26, .48); color: #c2410c; background: #fff7ed; }
body.weldgrid-shell.wg-docked-editor-dragging { user-select: none; cursor: default; }
body.weldgrid-shell.wg-annotation-editor-docked .wg-annotation-modal .modal-dialog { transform: none !important; transition: transform .16s ease; }
body.weldgrid-shell.wg-annotation-editor-docked .wg-annotation-modal .modal-dialog.is-dragging-editor { transition: none !important; }
body.weldgrid-shell.wg-spool-editor-docked .swal2-container.wg-spool-editor-scroll-container .swal2-popup.wg-spool-split-editor-popup, .swal2-container.wg-spool-editor-scroll-container .swal2-popup.wg-spool-split-editor-popup, .swal2-container.wg-spool-editor-scroll-container .wg-spool-split-editor-popup { position: relative !important; transform: none !important; transition: transform .16s ease; }
body.weldgrid-shell.wg-spool-editor-docked .swal2-container.wg-spool-editor-scroll-container .swal2-popup.wg-spool-split-editor-popup.is-dragging-editor, .swal2-container.wg-spool-editor-scroll-container .swal2-popup.wg-spool-split-editor-popup.is-dragging-editor { transition: none !important; }
body.weldgrid-shell.wg-spool-editor-docked .wg-spool-split-editor-popup > .swal2-title, .swal2-container.wg-spool-editor-scroll-container .wg-spool-split-editor-popup > .swal2-title { padding-left: 48px !important; }
body.weldgrid-shell.wg-annotation-editor-docked .wg-annotation-modal .modal-header { padding-left: 48px; }
@media (max-width: 900px) { body.weldgrid-shell .wg-docked-editor-drag-handle { display: none; } }



body.weldgrid-shell .wg-pipe-cut-empty-action { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 10px; padding: 12px; color: #526b82; font-weight: 850; }
body.weldgrid-shell .wg-pipe-cut-empty-action .wg-btn { min-height: 34px; }
body.weldgrid-shell .wg-pipe-cut-toolbar { grid-template-columns: minmax(140px, .8fr) minmax(180px, 1.1fr) minmax(130px, .8fr) minmax(92px, .5fr) minmax(220px, 1.2fr) minmax(160px, .9fr) auto; }
body.weldgrid-shell .wg-pipe-cut-toolbar [hidden] { display: none !important; }
body.weldgrid-shell .wg-pipe-cut-toolbar label:first-child .form-select { border-color: rgba(255, 106, 26, .32); box-shadow: 0 0 0 1px rgba(255, 106, 26, .08); }
@media (max-width: 1180px) { body.weldgrid-shell .wg-pipe-cut-toolbar { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 720px) { body.weldgrid-shell .wg-pipe-cut-toolbar { grid-template-columns: 1fr; } }

/* WeldGrid loose materials UI */
body.weldgrid-shell .wg-loose-materials-panel { display: grid; gap: 10px; min-width: 0; border: 1px solid rgba(13, 93, 141, .16); border-radius: 8px; background: #f8fbfd; padding: 12px; }
body.weldgrid-shell .wg-spool-editor-pane.wg-loose-materials-panel { border: 0; background: transparent; padding: 0; }
body.weldgrid-shell .wg-loose-materials-summary { display: inline-flex; flex-wrap: wrap; gap: 6px; align-items: center; width: fit-content; border: 1px solid rgba(13, 93, 141, .14); border-radius: 999px; background: #eaf6fb; color: #0d2d4b; font-size: 12px; font-weight: 850; padding: 6px 10px; }
body.weldgrid-shell .wg-loose-materials-toolbar { display: flex; justify-content: flex-end; gap: 8px; }
body.weldgrid-shell .wg-loose-material-picker { display: grid; gap: 10px; border: 1px solid rgba(13, 93, 141, .20); border-radius: 8px; background: #ffffff; padding: 10px; box-shadow: 0 10px 22px rgba(15, 40, 65, .06); }
body.weldgrid-shell .wg-loose-material-picker[hidden] { display: none !important; }
body.weldgrid-shell .wg-loose-material-picker-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: #0d2d4b; }
body.weldgrid-shell .wg-loose-material-picker-head strong { font-size: 14px; font-weight: 950; }
body.weldgrid-shell .wg-loose-material-scope-tabs { display: inline-flex; flex-wrap: wrap; gap: 6px; align-items: center; }
body.weldgrid-shell .wg-loose-material-scope-tabs button { border: 1px solid rgba(148, 163, 184, .34); border-radius: 999px; background: #ffffff; color: #0d2d4b; font-size: 12px; font-weight: 850; padding: 7px 10px; }
body.weldgrid-shell .wg-loose-material-scope-tabs button:hover { border-color: rgba(13, 93, 141, .34); background: #f0f9ff; }
body.weldgrid-shell .wg-loose-material-scope-tabs button.is-active { border-color: rgba(255, 106, 26, .45); background: #fff7ed; color: #c2410c; box-shadow: 0 0 0 2px rgba(255, 106, 26, .10); }
body.weldgrid-shell .wg-loose-material-options { display: grid; gap: 7px; max-height: 280px; overflow: auto; padding-right: 2px; }
body.weldgrid-shell .wg-loose-material-option { display: grid; grid-template-columns: minmax(0, 1fr); gap: 3px; width: 100%; border: 1px solid rgba(148, 163, 184, .32); border-radius: 8px; background: #ffffff; color: #0d2d4b; padding: 9px 10px; text-align: left; }
body.weldgrid-shell .wg-loose-material-option:hover { border-color: rgba(13, 93, 141, .35); background: #f5fbfe; }
body.weldgrid-shell .wg-loose-material-option.is-selected { border-color: #ff6a1a; background: #fff7ed; box-shadow: 0 0 0 2px rgba(255, 106, 26, .14); }
body.weldgrid-shell .wg-loose-material-option strong { color: #0d2d4b; font-size: 13px; font-weight: 950; line-height: 1.25; }
body.weldgrid-shell .wg-loose-material-option span { color: #334155; font-size: 12px; font-weight: 750; line-height: 1.35; }
body.weldgrid-shell .wg-loose-material-option small { color: #64748b; font-size: 11px; font-weight: 750; }
body.weldgrid-shell .wg-loose-material-edit-grid { display: grid; grid-template-columns: minmax(130px, .45fr) minmax(120px, .35fr) minmax(220px, 1fr); gap: 8px; align-items: end; }
body.weldgrid-shell .wg-loose-material-edit-grid label { display: grid; gap: 5px; min-width: 0; color: #475569; font-size: 12px; font-weight: 850; }
body.weldgrid-shell .wg-loose-material-edit-grid .form-control, body.weldgrid-shell .wg-loose-material-edit-grid .form-select, body.weldgrid-shell .wg-loose-material-edit-grid .swal2-input, body.weldgrid-shell .wg-loose-material-edit-grid .swal2-select, body.weldgrid-shell .wg-loose-material-edit-grid .swal2-textarea { width: 100%; min-width: 0; margin: 0; border-color: #cbd8e3; color: #0d2d4b; font-size: 12px; font-weight: 750; }
body.weldgrid-shell .wg-loose-material-notes { grid-column: auto; }
body.weldgrid-shell .wg-loose-material-picker-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
body.weldgrid-shell .wg-loose-materials-list { min-width: 0; }
body.weldgrid-shell .wg-loose-materials-table { display: grid; gap: 8px; max-height: 320px; overflow: auto; padding-right: 2px; }
body.weldgrid-shell .wg-loose-material-row { display: grid; grid-template-columns: minmax(190px, 1.25fr) minmax(120px, .7fr) minmax(92px, .45fr) minmax(120px, .7fr) auto; gap: 8px; align-items: center; min-width: 0; border: 1px solid rgba(148, 163, 184, .28); border-radius: 8px; background: #ffffff; padding: 9px 10px; }
body.weldgrid-shell .wg-loose-material-row strong { display: block; min-width: 0; color: #0d2d4b; font-size: 13px; font-weight: 950; line-height: 1.25; }
body.weldgrid-shell .wg-loose-material-row span, body.weldgrid-shell .wg-loose-material-pdf, body.weldgrid-shell .wg-loose-material-qty, body.weldgrid-shell .wg-loose-material-notes-text { min-width: 0; color: #526b82; font-size: 11px; font-weight: 750; line-height: 1.35; overflow: hidden; text-overflow: ellipsis; }
body.weldgrid-shell .wg-loose-material-pdf, body.weldgrid-shell .wg-loose-material-qty { white-space: nowrap; }
body.weldgrid-shell .wg-loose-material-notes-text { color: #64748b; }
body.weldgrid-shell .wg-loose-material-actions { display: inline-flex; justify-content: flex-end; gap: 5px; }
body.weldgrid-shell .wg-loose-material-actions button { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border: 1px solid rgba(13, 93, 141, .18); border-radius: 7px; background: #ffffff; color: #0d2d4b; }
body.weldgrid-shell .wg-loose-material-actions button:hover { background: #eaf6fb; }
body.weldgrid-shell .wg-loose-material-actions button.danger { border-color: rgba(220, 38, 38, .20); color: #dc2626; }
body.weldgrid-shell .wg-loose-material-actions button.danger:hover { background: #fff1f2; }
body.weldgrid-shell .wg-loose-material-empty { border: 1px dashed rgba(148, 163, 184, .36); border-radius: 8px; background: #ffffff; color: #64748b; font-size: 12px; font-weight: 800; padding: 12px; text-align: center; }
body.weldgrid-shell .wg-loose-material-empty.is-error { border-color: rgba(220, 38, 38, .24); background: #fff1f2; color: #991b1b; }
body.weldgrid-shell .wg-loose-material-count-badge, body.weldgrid-shell .wg-loose-material-virtual-badge { display: inline-flex; align-items: center; justify-content: center; width: fit-content; border-radius: 999px; font-size: 10px; font-weight: 900; line-height: 1; padding: 5px 7px; white-space: nowrap; }
body.weldgrid-shell .wg-loose-material-count-badge { background: #e0f2fe; color: #075985; }
body.weldgrid-shell .wg-loose-material-virtual-badge { background: #f1f5f9; color: #475569!important; }
body.weldgrid-shell .wg-loose-material-virtual-group { border-color: rgba(14, 165, 233, .24); background: #f0f9ff; }
body.weldgrid-shell .wg-rest-spool-lm-card { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 6px 8px; align-items: center; width: 100%; border: 1px solid rgba(14, 165, 233, .28); border-radius: 8px; background: #ffffff; color: #0d2d4b; padding: 9px 10px; text-align: left; }
body.weldgrid-shell .wg-rest-spool-lm-card:hover { border-color: rgba(14, 165, 233, .46); background: #f0f9ff; }
body.weldgrid-shell .wg-rest-spool-lm-card strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 950; }
body.weldgrid-shell .wg-rest-spool-lm-card em { grid-column: 2 / 5; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #526b82; font-size: 11px; font-style: normal; font-weight: 800; }
body.weldgrid-shell .wg-rest-spool-lm-card small { justify-self: end; color: #075985; font-size: 11px; font-weight: 900; }
body.weldgrid-shell .wg-rest-spool-lm-desc { margin: 4px 0 8px; color: #526b82!important; font-size: 12px; font-weight: 800; line-height: 1.35; }
body.weldgrid-shell .wg-rest-spool-lm-card-list { display: grid; gap: 7px; max-height: 320px; overflow: auto; text-align: left; }
body.weldgrid-shell .wg-rest-spool-lm-card-list .wg-rest-spool-lm-card { grid-template-columns: minmax(0, 1fr); }
body.weldgrid-shell .wg-rest-spool-lm-card-list .wg-rest-spool-lm-card span { color: #526b82; font-size: 11px; font-weight: 750; }
@media (max-width: 980px) { body.weldgrid-shell .wg-loose-material-row { grid-template-columns: 1fr auto; } body.weldgrid-shell .wg-loose-material-pdf, body.weldgrid-shell .wg-loose-material-qty, body.weldgrid-shell .wg-loose-material-notes-text { grid-column: 1 / -1; white-space: normal; } }
@media (max-width: 760px) { body.weldgrid-shell .wg-loose-material-edit-grid { grid-template-columns: 1fr; } body.weldgrid-shell .wg-rest-spool-lm-card { grid-template-columns: auto minmax(0, 1fr) auto; } body.weldgrid-shell .wg-rest-spool-lm-card em { grid-column: 2 / 4; } }



/* WeldGrid Excel template sheet settings */
body.weldgrid-shell .wg-template-sheet-status-wrap { display: grid; gap: 4px; margin-top: 6px; }
body.weldgrid-shell .wg-template-sheet-status { display: inline-flex; align-items: center; width: fit-content; border-radius: 999px; font-size: 11px; font-weight: 900; line-height: 1; padding: 5px 8px; }
body.weldgrid-shell .wg-template-sheet-status.is-ready { border: 1px solid rgba(22, 163, 74, .22); background: #dcfce7; color: #15803d; }
body.weldgrid-shell .wg-template-sheet-status.is-warning { border: 1px solid rgba(249, 115, 22, .24); background: #fff7ed; color: #c2410c; }
body.weldgrid-shell .wg-template-sheet-status-line { display: flex; flex-wrap: wrap; gap: 6px; color: #64748b; font-size: 11px; font-weight: 800; }
body.weldgrid-shell .swal2-popup.wg-template-sheet-settings-popup { width: min(1060px, calc(100vw - 28px)) !important; max-height: calc(100dvh - 28px) !important; padding: 0 0 16px !important; overflow: hidden !important; }
body.weldgrid-shell .swal2-popup.wg-template-sheet-settings-popup .swal2-title { padding: 18px 24px 8px !important; color: #0d2d4b !important; font-size: 24px !important; line-height: 1.15 !important; }
body.weldgrid-shell .swal2-popup.wg-template-sheet-settings-popup .swal2-html-container { margin: 0 !important; padding: 0 24px !important; overflow: hidden !important; }
body.weldgrid-shell .swal2-popup.wg-template-sheet-settings-popup .swal2-actions { padding: 8px 24px 0 !important; }
body.weldgrid-shell .wg-template-sheet-settings-modal { display: grid; gap: 12px; max-height: min(70vh, 680px); overflow-x: hidden; overflow-y: auto; padding: 4px 2px 2px; color: #0d2d4b; text-align: left; }
body.weldgrid-shell .wg-template-sheet-settings-modal * { box-sizing: border-box; }
body.weldgrid-shell .wg-template-sheet-settings-note { margin: 0; border: 1px solid rgba(13, 93, 141, .16); border-radius: 8px; background: #f0f8fc; color: #526b82; font-size: 13px; font-weight: 800; line-height: 1.45; padding: 11px 12px; }
body.weldgrid-shell .wg-template-sheet-card { display: grid; gap: 12px; border: 1px solid rgba(13, 93, 141, .16); border-radius: 8px; background: linear-gradient(180deg, #ffffff 0%, #f8fbfd 100%); padding: 12px; box-shadow: 0 8px 18px rgba(15, 40, 65, .05); }
body.weldgrid-shell .wg-template-sheet-card.is-passthrough { border-color: rgba(13, 93, 141, .2); background: #f8fbfd; }
body.weldgrid-shell .wg-template-sheet-card.is-hidden-sheet { border-color: rgba(148, 163, 184, .32); background: #f8fafc; opacity: .94; }
body.weldgrid-shell .wg-template-sheet-card-main { display: grid; gap: 7px; min-width: 0; }
body.weldgrid-shell .wg-template-sheet-card-main strong { color: #0d2d4b; font-size: 16px; font-weight: 950; line-height: 1.25; overflow-wrap: anywhere; }
body.weldgrid-shell .wg-template-sheet-meta { display: flex; flex-wrap: wrap; gap: 6px; }
body.weldgrid-shell .wg-template-sheet-meta span { display: inline-flex; align-items: center; gap: 4px; min-height: 25px; border: 1px solid rgba(13, 93, 141, .12); border-radius: 999px; background: #f1f7fb; color: #526b82; padding: 4px 8px; font-size: 12px; font-weight: 850; }
body.weldgrid-shell .wg-template-sheet-meta b { color: #0d2d4b; font-weight: 950; }
body.weldgrid-shell .wg-template-sheet-warning { display: grid; gap: 4px; margin-top: 2px; border: 1px solid rgba(249, 115, 22, .22); border-radius: 8px; background: #fff7ed; color: #9a3412; padding: 8px 9px; }
body.weldgrid-shell .wg-template-sheet-warning span { color: inherit; font-size: 12px; font-weight: 800; line-height: 1.35; }
body.weldgrid-shell .wg-template-sheet-controls { display: grid; gap: 9px; min-width: 0; }
body.weldgrid-shell .wg-template-sheet-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; align-items: end; min-width: 0; }
body.weldgrid-shell .wg-template-sheet-grid label, body.weldgrid-shell .wg-template-sheet-type { display: grid; gap: 5px; min-width: 0; color: #475569; font-size: 11px; font-weight: 900; line-height: 1.2; }
body.weldgrid-shell .wg-template-sheet-grid label > span, body.weldgrid-shell .wg-template-sheet-type > span { min-height: 14px; }
body.weldgrid-shell .wg-template-sheet-type, body.weldgrid-shell .wg-template-sheet-toggles { grid-column: span 2; }
body.weldgrid-shell .wg-template-sheet-grid select, body.weldgrid-shell .wg-template-sheet-grid input { width: 100%; min-width: 0; height: 38px; border: 1px solid #cbd8e3; border-radius: 8px; background: #ffffff; color: #0d2d4b; font-size: 13px; font-weight: 850; padding: 7px 9px; }
body.weldgrid-shell .wg-template-sheet-grid select:focus, body.weldgrid-shell .wg-template-sheet-grid input:focus { border-color: rgba(255, 106, 26, .65); box-shadow: 0 0 0 3px rgba(255, 106, 26, .12); outline: none; }
body.weldgrid-shell .wg-template-sheet-toggles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; border: 1px solid rgba(148, 163, 184, .22); border-radius: 8px; background: #f8fbfd; padding: 8px; }
body.weldgrid-shell .wg-template-sheet-toggles label { display: flex; align-items: center; gap: 7px; min-height: 22px; color: #0d2d4b; font-size: 12px; font-weight: 850; }
body.weldgrid-shell .wg-template-sheet-toggles input { width: 16px; min-width: 16px; height: 16px; accent-color: #ff6a1a; }
body.weldgrid-shell .wg-template-sheet-toggles input:disabled + span { color: #94a3b8; }
body.weldgrid-shell .wg-template-sheet-columns-range input { text-transform: uppercase; }
body.weldgrid-shell .wg-template-sheet-hint { margin: 0; border-radius: 8px; background: #edf8fc; color: #526b82; font-size: 12px; font-weight: 850; line-height: 1.35; padding: 8px 10px; }
body.weldgrid-shell .wg-template-structure-loading { display: grid; gap: 8px; align-items: center; justify-items: center; color: #0d2d4b; padding: 18px; }
body.weldgrid-shell .wg-template-structure-loading strong { font-size: 14px; font-weight: 950; }
body.weldgrid-shell .wg-template-structure-loading span { color: #64748b; font-size: 12px; font-weight: 750; }
@media (max-width: 780px) { body.weldgrid-shell .wg-template-sheet-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } body.weldgrid-shell .wg-template-sheet-type, body.weldgrid-shell .wg-template-sheet-toggles { grid-column: 1 / -1; } }
@media (max-width: 560px) { body.weldgrid-shell .swal2-popup.wg-template-sheet-settings-popup .swal2-title { font-size: 20px !important; padding-inline: 16px !important; } body.weldgrid-shell .swal2-popup.wg-template-sheet-settings-popup .swal2-html-container { padding-inline: 16px !important; } body.weldgrid-shell .wg-template-sheet-settings-modal { max-height: 68vh; } body.weldgrid-shell .wg-template-sheet-grid, body.weldgrid-shell .wg-template-sheet-toggles { grid-template-columns: 1fr; } body.weldgrid-shell .wg-template-sheet-type, body.weldgrid-shell .wg-template-sheet-toggles { grid-column: auto; } }

/* WeldGrid export sheet selection */
body.weldgrid-shell .wg-export-sheet-selection { display: grid; gap: 9px; }
body.weldgrid-shell .wg-export-sheet-loading, body.weldgrid-shell .wg-export-sheet-empty { display: grid; gap: 8px; border: 1px solid rgba(13, 93, 141, .14); border-radius: 8px; background: #f7fbfd; color: #526b82; padding: 10px; font-size: 12px; font-weight: 800; }
body.weldgrid-shell .wg-export-sheet-empty.is-error { border-color: rgba(220, 38, 38, .22); background: #fff1f2; color: #991b1b; }
body.weldgrid-shell .wg-export-sheet-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: #526b82; font-size: 12px; font-weight: 900; }
body.weldgrid-shell .wg-export-sheet-actions { display: inline-flex; flex-wrap: wrap; gap: 5px; }
body.weldgrid-shell .wg-export-sheet-actions button { border: 1px solid rgba(13, 93, 141, .18); border-radius: 7px; background: #ffffff; color: #0d2d4b; font-size: 11px; font-weight: 900; line-height: 1; padding: 6px 8px; }
body.weldgrid-shell .wg-export-sheet-actions button:hover { border-color: rgba(255, 106, 26, .38); background: #fff7ed; color: #c2410c; }
body.weldgrid-shell .wg-export-sheet-list { display: grid; gap: 7px; max-height: 260px; overflow: auto; padding-right: 2px; }
body.weldgrid-shell .wg-export-sheet-option { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px; align-items: center; border: 1px solid rgba(148, 163, 184, .28); border-radius: 8px; background: #ffffff; padding: 8px 9px; cursor: pointer; }
body.weldgrid-shell .wg-export-sheet-option:hover { border-color: rgba(13, 93, 141, .28); background: #f5fbfe; }
body.weldgrid-shell .wg-export-sheet-option.is-selected { border-color: rgba(255, 106, 26, .55); background: #fff7ed; box-shadow: 0 0 0 2px rgba(255, 106, 26, .10); }
body.weldgrid-shell .wg-export-sheet-option.is-hidden-sheet { opacity: .9; }
body.weldgrid-shell .wg-export-sheet-option input { width: 16px; height: 16px; accent-color: #ff6a1a; }
body.weldgrid-shell .wg-export-sheet-main { display: grid; gap: 2px; min-width: 0; }
body.weldgrid-shell .wg-export-sheet-main strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #0d2d4b; font-size: 12px; font-weight: 950; }
body.weldgrid-shell .wg-export-sheet-main em { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #526b82; font-size: 11px; font-style: normal; font-weight: 800; }
body.weldgrid-shell .wg-export-sheet-badges { display: inline-flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px; }
body.weldgrid-shell .wg-export-sheet-badges small { display: inline-flex; align-items: center; border-radius: 999px; background: #eaf6fb; color: #075985; font-size: 10px; font-weight: 900; line-height: 1; padding: 4px 6px; white-space: nowrap; }
@media (max-width: 720px) { body.weldgrid-shell .wg-export-sheet-toolbar { align-items: flex-start; flex-direction: column; } body.weldgrid-shell .wg-export-sheet-option { grid-template-columns: auto minmax(0, 1fr); } body.weldgrid-shell .wg-export-sheet-badges { grid-column: 2 / 3; justify-content: flex-start; } }

/* WeldGrid spool editor spacing and segment row editing */
body.weldgrid-shell.wg-spool-editor-docked .wg-spool-split-editor-popup > .swal2-html-container.wg-spool-split-editor-html,
.swal2-container.wg-spool-editor-scroll-container .wg-spool-split-editor-popup > .swal2-html-container.wg-spool-split-editor-html {
    padding-top: 12px !important;
}
body.weldgrid-shell.wg-spool-editor-docked .wg-live-label-preview,
.swal2-container.wg-spool-editor-scroll-container .wg-live-label-preview {
    min-height: 76px !important;
    height: 76px !important;
    margin-bottom: 10px !important;
}
body.weldgrid-shell.wg-spool-editor-docked .wg-live-label-preview-area,
.swal2-container.wg-spool-editor-scroll-container .wg-live-label-preview-area {
    inset: 9px !important;
}
body.weldgrid-shell.wg-spool-editor-docked .wg-spool-editor-tabs,
.swal2-container.wg-spool-editor-scroll-container .wg-spool-editor-tabs {
    margin-bottom: 10px !important;
    padding-bottom: 10px !important;
}
body.weldgrid-shell.wg-spool-editor-docked .wg-spool-segment-table-wrap,
.swal2-container.wg-spool-editor-scroll-container .wg-spool-segment-table-wrap {
    max-height: min(34vh, 330px) !important;
    overflow: auto !important;
}
body.weldgrid-shell.wg-spool-editor-docked .wg-spool-segment-table tbody tr[data-spool-segment-row],
.swal2-container.wg-spool-editor-scroll-container .wg-spool-segment-table tbody tr[data-spool-segment-row] {
    cursor: pointer;
}
body.weldgrid-shell.wg-spool-editor-docked .wg-spool-segment-table tbody tr[data-spool-segment-row]:hover,
.swal2-container.wg-spool-editor-scroll-container .wg-spool-segment-table tbody tr[data-spool-segment-row]:hover {
    background: #f0f9ff;
}
body.weldgrid-shell.wg-spool-editor-docked .wg-spool-segment-table tbody tr[data-spool-segment-row]:hover td,
.swal2-container.wg-spool-editor-scroll-container .wg-spool-segment-table tbody tr[data-spool-segment-row]:hover td {
    color: #08243d;
}

/* WeldGrid loose materials page-scoped UI cleanup */
body.weldgrid-shell .wg-loose-material-page-note {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    width: fit-content;
    border: 1px solid rgba(13, 93, 141, .16);
    border-radius: 999px;
    background: #eef8fc;
    color: #0d2d4b;
    font-size: 12px;
    font-weight: 850;
    padding: 7px 10px;
}
body.weldgrid-shell .wg-loose-material-page-note i {
    color: #0e7490;
    font-size: 14px;
}
body.weldgrid-shell .wg-loose-material-picker {
    gap: 12px;
    padding: 12px;
}
body.weldgrid-shell .wg-loose-material-options {
    max-height: min(34vh, 330px);
}
body.weldgrid-shell .wg-loose-material-edit-grid {
    grid-template-columns: minmax(190px, .42fr) minmax(0, 1fr) !important;
    align-items: stretch;
}
body.weldgrid-shell .wg-loose-material-edit-grid label small {
    color: #64748b;
    font-size: 11px;
    font-weight: 800;
}
body.weldgrid-shell .wg-loose-material-notes {
    grid-column: auto !important;
}
body.weldgrid-shell .wg-loose-material-notes textarea {
    min-height: 70px !important;
    max-height: 120px !important;
}
body.weldgrid-shell .wg-loose-material-row {
    grid-template-columns: minmax(240px, 1.35fr) minmax(130px, .65fr) minmax(105px, .45fr) minmax(130px, .7fr) auto;
}
@media (max-width: 760px) {
    body.weldgrid-shell .wg-loose-material-edit-grid {
        grid-template-columns: 1fr !important;
    }
    body.weldgrid-shell .wg-loose-material-notes {
        grid-column: 1 / -1 !important;
    }
}

/* WeldGrid loose material action click fix */
body.weldgrid-shell .wg-loose-material-actions {
    position: relative;
    z-index: 8;
    pointer-events: auto;
}
body.weldgrid-shell .wg-loose-material-actions button {
    position: relative;
    z-index: 9;
    pointer-events: auto;
    cursor: pointer;
    touch-action: manipulation;
    user-select: none;
}
body.weldgrid-shell .wg-loose-material-actions button:active {
    transform: translateY(1px);
}

/* WeldGrid loose materials multi-select cleanup */
body.weldgrid-shell .wg-loose-material-option {
    position: relative;
    grid-template-columns: 28px minmax(0, 1fr) !important;
    align-items: start;
}
body.weldgrid-shell .wg-loose-material-option strong,
body.weldgrid-shell .wg-loose-material-option span,
body.weldgrid-shell .wg-loose-material-option small {
    grid-column: 2 / 3;
}
body.weldgrid-shell .wg-loose-material-check {
    grid-column: 1 / 2 !important;
    grid-row: 1 / span 3;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    margin-top: 1px;
    border: 1px solid rgba(13, 93, 141, .22);
    border-radius: 6px;
    background: #ffffff;
    color: #ffffff !important;
    font-size: 15px !important;
    font-weight: 950;
}
body.weldgrid-shell .wg-loose-material-option.is-selected .wg-loose-material-check {
    border-color: #ff6a1a;
    background: #ff6a1a;
}
body.weldgrid-shell .wg-loose-material-edit-grid {
    grid-template-columns: 1fr !important;
}
body.weldgrid-shell .wg-loose-material-notes {
    grid-column: 1 / -1 !important;
}
body.weldgrid-shell .wg-loose-material-row {
    grid-template-columns: minmax(260px, 1.45fr) minmax(150px, .7fr) minmax(150px, .75fr) auto !important;
}
body.weldgrid-shell .wg-loose-material-qty {
    display: none !important;
}


/* Pipe cut realistic progress summary */
body.weldgrid-shell .wg-pipe-cut-progress-meta {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin: 10px 0 0;
}
body.weldgrid-shell .wg-pipe-cut-progress-meta[hidden] { display: none !important; }
body.weldgrid-shell .wg-pipe-cut-progress-meta > div {
    display: grid;
    gap: 2px;
    min-width: 0;
    border: 1px solid rgba(13, 93, 141, .15);
    border-radius: 8px;
    background: #f5fbfe;
    padding: 9px 10px;
}
body.weldgrid-shell .wg-pipe-cut-progress-meta strong {
    min-width: 0;
    overflow: hidden;
    color: #0d2d4b;
    font-size: 15px;
    font-weight: 950;
    line-height: 1.15;
    text-overflow: ellipsis;
    white-space: nowrap;
}
body.weldgrid-shell .wg-pipe-cut-progress-meta span {
    color: #64748b;
    font-size: 11px;
    font-weight: 850;
    line-height: 1.2;
    text-transform: uppercase;
    letter-spacing: .03em;
}
body.weldgrid-shell .wg-pipe-cut-progress-meta .wg-pipe-cut-progress-current {
    grid-column: 1 / -1;
    background: #fff7ed;
    border-color: rgba(255, 106, 26, .22);
}
body.weldgrid-shell .wg-pipe-cut-progress-meta .wg-pipe-cut-progress-current strong { color: #9a3412; }
@media (max-width: 720px) {
    body.weldgrid-shell .wg-pipe-cut-progress-meta { grid-template-columns: 1fr; }
}
body.weldgrid-shell .wg-pipe-cut-import-help {
    display: grid;
    gap: 5px;
    margin: 10px 0;
    padding: 10px 12px;
    border: 1px solid rgba(13, 93, 141, .18);
    border-radius: 8px;
    background: #f0f8fc;
    color: #0d2d4b;
    text-align: left;
}
body.weldgrid-shell .wg-pipe-cut-import-help strong {
    font-size: 13px;
    font-weight: 950;
}
body.weldgrid-shell .wg-pipe-cut-import-help span {
    color: #526b82;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.35;
}

/* Global WeldGrid Select2 styling for standard page selects */
body.weldgrid-shell .wg-global-select2-container,
body.weldgrid-shell .select2-container.wg-global-select2-container {
    width: 100% !important;
    min-width: 0;
}
body.weldgrid-shell .select2-container .wg-global-select2-selection.select2-selection--single {
    min-height: 42px;
    height: auto;
    border: 1px solid #f3c5a5;
    border-radius: 8px;
    background: #fff7ed;
    display: flex;
    align-items: center;
    color: #0d2d4a;
    font-weight: 850;
    transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}
body.weldgrid-shell .select2-container--default.select2-container--focus .wg-global-select2-selection.select2-selection--single,
body.weldgrid-shell .select2-container--default.select2-container--open .wg-global-select2-selection.select2-selection--single {
    border-color: #ff6a1a;
    background: #fff3e8;
    box-shadow: 0 0 0 3px rgba(255, 106, 26, .16);
}
body.weldgrid-shell .select2-container--default .wg-global-select2-selection.select2-selection--single .select2-selection__rendered {
    width: 100%;
    padding: 0 38px 0 12px;
    color: #0d2d4a;
    line-height: 40px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
body.weldgrid-shell .select2-container--default .wg-global-select2-selection.select2-selection--single .select2-selection__placeholder {
    color: #6b7f95;
    font-weight: 750;
}
body.weldgrid-shell .select2-container--default .wg-global-select2-selection.select2-selection--single .select2-selection__arrow {
    height: 40px;
    right: 8px;
    top: 1px;
}
body.weldgrid-shell .select2-container--default .wg-global-select2-selection.select2-selection--single .select2-selection__clear {
    margin-right: 24px;
    color: #64748b;
    font-weight: 900;
}
body.weldgrid-shell .select2-container.wg-global-select2-sm .wg-global-select2-selection.select2-selection--single {
    min-height: 34px;
    border-radius: 7px;
}
body.weldgrid-shell .select2-container.wg-global-select2-sm .wg-global-select2-selection.select2-selection--single .select2-selection__rendered {
    line-height: 32px;
    padding-left: 10px;
    padding-right: 30px;
    font-size: 13px;
}
body.weldgrid-shell .select2-container.wg-global-select2-sm .wg-global-select2-selection.select2-selection--single .select2-selection__arrow {
    height: 32px;
    right: 6px;
}
body.weldgrid-shell .select2-container--default.select2-container--disabled .wg-global-select2-selection.select2-selection--single {
    background: #f5eee8;
    color: #9a8a7e;
    cursor: not-allowed;
}
body.weldgrid-shell .wg-global-select2-dropdown {
    min-width: 220px !important;
    border: 1px solid #f1c4a5 !important;
    border-radius: 10px !important;
    background: #fffaf6 !important;
    color: #0d2d4a !important;
    box-shadow: 0 18px 38px rgba(15, 45, 74, .18) !important;
    overflow: hidden;
    z-index: 10070;
}
body.weldgrid-shell .wg-global-select2-dropdown .select2-search--dropdown {
    padding: 8px;
    background: #fff7ed;
    border-bottom: 1px solid #f5d8c3;
}
body.weldgrid-shell .wg-global-select2-dropdown .select2-search__field {
    min-height: 34px;
    border: 1px solid #efbd99 !important;
    border-radius: 8px;
    background: #fff;
    color: #0d2d4a;
    font-weight: 800;
    outline: none;
    padding: 7px 10px;
}
body.weldgrid-shell .wg-global-select2-dropdown .select2-results__options {
    max-height: 280px !important;
    scrollbar-color: #1687b6 #e7f1f7;
    scrollbar-width: thin;
}
body.weldgrid-shell .wg-global-select2-dropdown .select2-results__option {
    padding: 9px 12px;
    color: #0d2d4a;
    font-weight: 800;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
body.weldgrid-shell .wg-global-select2-dropdown .select2-results__option--selected,
body.weldgrid-shell .wg-global-select2-dropdown .select2-results__option[aria-selected="true"] {
    background: #fff0e4 !important;
    color: #9a3412 !important;
}
body.weldgrid-shell .wg-global-select2-dropdown .select2-results__option--highlighted,
body.weldgrid-shell .wg-global-select2-dropdown .select2-results__option--highlighted[aria-selected],
body.weldgrid-shell .wg-global-select2-dropdown .select2-results__option--highlighted.select2-results__option--selectable {
    background: #ff6a1a !important;
    color: #fff !important;
}

/* PDF Viewer toolbar Select2 project selector */
body.weldgrid-shell #wgPdfWorkspace .wg-pdf-toolbar.wg-annotation-toolbar {
    flex-wrap: nowrap;
    align-items: center;
    overflow-x: auto;
    overflow-y: visible;
}
body.weldgrid-shell #wgPdfWorkspace #wgPdfProjectSelect + .select2-container.wg-global-select2-container {
    flex: 1 1 560px;
    width: auto !important;
    min-width: 300px;
    max-width: none;
}
body.weldgrid-shell #wgPdfWorkspace .wg-pdf-toolbar .select2-container .wg-global-select2-selection.select2-selection--single {
    min-height: 42px;
    border-color: rgba(191, 226, 246, .48);
    background: rgba(255, 255, 255, .14);
    color: #ffffff;
}
body.weldgrid-shell #wgPdfWorkspace .wg-pdf-toolbar .select2-container--default.select2-container--focus .wg-global-select2-selection.select2-selection--single,
body.weldgrid-shell #wgPdfWorkspace .wg-pdf-toolbar .select2-container--default.select2-container--open .wg-global-select2-selection.select2-selection--single {
    border-color: #ff6a1a;
    background: rgba(255, 255, 255, .2);
    box-shadow: 0 0 0 3px rgba(255, 106, 26, .18);
}
body.weldgrid-shell #wgPdfWorkspace .wg-pdf-toolbar .select2-container--default .wg-global-select2-selection.select2-selection--single .select2-selection__rendered,
body.weldgrid-shell #wgPdfWorkspace .wg-pdf-toolbar .select2-container--default .wg-global-select2-selection.select2-selection--single .select2-selection__placeholder {
    color: #ffffff;
    font-weight: 950;
}
body.weldgrid-shell #wgPdfWorkspace .wg-pdf-toolbar .select2-container--default .wg-global-select2-selection.select2-selection--single .select2-selection__arrow b {
    border-color: #d9edf8 transparent transparent transparent;
}
body.weldgrid-shell #wgPdfWorkspace .wg-pdf-toolbar .select2-container--default.select2-container--open .wg-global-select2-selection.select2-selection--single .select2-selection__arrow b {
    border-color: transparent transparent #d9edf8 transparent;
}
@media (max-width: 980px) {
    body.weldgrid-shell #wgPdfWorkspace .wg-pdf-toolbar.wg-annotation-toolbar {
        flex-wrap: wrap;
    }
    body.weldgrid-shell #wgPdfWorkspace #wgPdfProjectSelect + .select2-container.wg-global-select2-container {
        flex-basis: 100%;
        min-width: 0;
    }
}


/* PDF Viewer Select2 contrast and compact control polish */
body.weldgrid-shell #wgPdfWorkspace .wg-pdf-list-controls .select2-container.wg-global-select2-container {
    width: 100% !important;
    min-width: 0;
}
body.weldgrid-shell #wgPdfWorkspace .wg-pdf-side .select2-container.wg-global-select2-container {
    min-width: 0;
}
body.weldgrid-shell #wgPdfWorkspace .wg-pdf-side .select2-container .wg-global-select2-selection.select2-selection--single {
    min-height: 36px;
    border-color: rgba(222, 241, 252, .42);
    background: rgba(255, 255, 255, .13);
    color: #ffffff;
}
body.weldgrid-shell #wgPdfWorkspace .wg-pdf-side .select2-container--default.select2-container--focus .wg-global-select2-selection.select2-selection--single,
body.weldgrid-shell #wgPdfWorkspace .wg-pdf-side .select2-container--default.select2-container--open .wg-global-select2-selection.select2-selection--single {
    border-color: #ff6a1a;
    background: rgba(255, 255, 255, .18);
    box-shadow: 0 0 0 3px rgba(255, 106, 26, .16);
}
body.weldgrid-shell #wgPdfWorkspace .wg-pdf-side .select2-container--default .wg-global-select2-selection.select2-selection--single .select2-selection__rendered {
    color: #ffffff;
    font-size: 12px;
    font-weight: 950;
    line-height: 34px;
}
body.weldgrid-shell #wgPdfWorkspace .wg-pdf-side .select2-container--default .wg-global-select2-selection.select2-selection--single .select2-selection__placeholder {
    color: rgba(255, 255, 255, .78);
    font-weight: 900;
}
body.weldgrid-shell #wgPdfWorkspace .wg-pdf-side .select2-container--default .wg-global-select2-selection.select2-selection--single .select2-selection__arrow {
    height: 34px;
    right: 5px;
}
body.weldgrid-shell #wgPdfWorkspace .wg-pdf-side .select2-container--default .wg-global-select2-selection.select2-selection--single .select2-selection__arrow b,
body.weldgrid-shell #wgPdfWorkspace .wg-pdf-list-controls .select2-container--default .wg-global-select2-selection.select2-selection--single .select2-selection__arrow b {
    border-color: rgba(255, 255, 255, .88) transparent transparent transparent;
}
body.weldgrid-shell #wgPdfWorkspace .wg-pdf-side .select2-container--default.select2-container--open .wg-global-select2-selection.select2-selection--single .select2-selection__arrow b,
body.weldgrid-shell #wgPdfWorkspace .wg-pdf-list-controls .select2-container--default.select2-container--open .wg-global-select2-selection.select2-selection--single .select2-selection__arrow b {
    border-color: transparent transparent rgba(255, 255, 255, .88) transparent;
}
body.weldgrid-shell #wgPdfWorkspace .wg-pdf-list-controls .select2-container .wg-global-select2-selection.select2-selection--single {
    min-height: 36px;
    border-radius: 7px;
}
body.weldgrid-shell #wgPdfWorkspace .wg-pdf-list-controls .select2-container--default .wg-global-select2-selection.select2-selection--single .select2-selection__rendered {
    padding-left: 8px;
    padding-right: 24px;
}
body.weldgrid-shell #wgPdfWorkspace .wg-annotation-list-tools .select2-container.wg-global-select2-container,
body.weldgrid-shell #wgPdfWorkspace .wg-spool-bulk-action .select2-container.wg-global-select2-container {
    width: 100% !important;
}
@media (max-width: 1260px) {
    body.weldgrid-shell #wgPdfWorkspace .wg-pdf-list-controls {
        grid-template-columns: minmax(0, 1fr) minmax(74px, .72fr);
    }
    body.weldgrid-shell #wgPdfWorkspace .wg-pdf-list-controls .wg-pdf-manager-trigger {
        width: 100%;
    }
}

body.weldgrid-shell .wg-pipe-cut-inch {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 64px;
    min-height: 30px;
    padding: 5px 9px;
    border: 1px solid rgba(13, 93, 141, .14);
    border-radius: 8px;
    background: #eef7fb;
    color: #0d2d4b;
    font-size: 12px;
    font-weight: 900;
    white-space: nowrap;
}
body.weldgrid-shell .wg-pipe-cut-row-actions {
    align-items: center;
    gap: 7px;
}
body.weldgrid-shell .wg-pipe-cut-autosave-state {
    display: inline-flex;
    align-items: center;
    min-width: 82px;
    color: #64748b;
    font-size: 10px;
    font-weight: 900;
    line-height: 1.1;
    white-space: nowrap;
}
body.weldgrid-shell .wg-pipe-cut-autosave-state.is-saved { color: #047857; }
body.weldgrid-shell .wg-pipe-cut-autosave-state.is-pending,
body.weldgrid-shell .wg-pipe-cut-autosave-state.is-saving { color: #c2410c; }
body.weldgrid-shell .wg-pipe-cut-autosave-state.is-error { color: #b91c1c; }


/* =========================================================
   WeldGrid PDF Viewer Annotated Download / Compact Filters
========================================================= */
body.weldgrid-shell #wgPdfWorkspace .wg-pdf-list-controls { display: grid !important; grid-template-columns: minmax(0, 1fr) !important; gap: 7px !important; margin: 8px 0 9px !important; }
body.weldgrid-shell #wgPdfWorkspace .wg-pdf-list-controls-main { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; align-items: center; }
body.weldgrid-shell #wgPdfWorkspace .wg-pdf-list-controls-filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; align-items: center; }
body.weldgrid-shell #wgPdfWorkspace .wg-pdf-list-controls .form-control, body.weldgrid-shell #wgPdfWorkspace .wg-pdf-list-controls .form-select, body.weldgrid-shell #wgPdfWorkspace .wg-pdf-list-controls .wg-btn { min-height: 34px !important; padding: 6px 8px !important; font-size: 12px !important; font-weight: 850 !important; }
body.weldgrid-shell #wgPdfWorkspace .wg-pdf-list-controls .wg-pdf-manager-trigger { width: auto !important; min-width: 38px !important; padding-inline: 9px !important; font-size: 12px !important; gap: 5px; }
body.weldgrid-shell #wgPdfWorkspace .wg-pdf-list-controls .wg-pdf-manager-trigger i { margin: 0 !important; font-size: 15px !important; }
body.weldgrid-shell #wgPdfWorkspace .wg-pdf-list-controls .wg-pdf-manager-trigger span { display: inline; }
.wg-pdf-card-download { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border: 1px solid rgba(12, 46, 76, .16); border-radius: 7px; background: #f8fbfd; color: #17324d; cursor: pointer; transition: background .16s ease, border-color .16s ease, color .16s ease, transform .16s ease; }
.wg-pdf-card-download:hover { border-color: rgba(255, 106, 26, .55); background: #fff7ed; color: #c2460c; transform: translateY(-1px); }
.wg-pdf-card-download.is-loading, #wgDownloadOriginal.is-loading { pointer-events: none; opacity: .74; }
.wg-pdf-card-download.is-loading i:not(.wg-spin-once), #wgDownloadOriginal.is-loading i:not(.wg-spin-once) { animation: wgSpin .8s linear infinite; }
body.weldgrid-shell #wgPdfWorkspace .wg-active-pdf-actions [hidden] { display: none !important; }
@media (max-width: 1260px) { body.weldgrid-shell #wgPdfWorkspace .wg-pdf-list-controls-main { grid-template-columns: minmax(0, 1fr) 38px; } body.weldgrid-shell #wgPdfWorkspace .wg-pdf-list-controls .wg-pdf-manager-trigger span { display: none; } }


/* Theme override: Select2 states use WeldGrid orange instead of pale green/teal. */
body.weldgrid-shell .select2-container .wg-global-select2-selection.select2-selection--single,
body.weldgrid-shell .select2-container .wg-global-select2-selection.select2-selection--multiple {
    background: #fff7ed !important;
    border-color: #f3c5a5 !important;
    color: #08233e !important;
}
body.weldgrid-shell .select2-container--default.select2-container--focus .wg-global-select2-selection.select2-selection--single,
body.weldgrid-shell .select2-container--default.select2-container--open .wg-global-select2-selection.select2-selection--single,
body.weldgrid-shell .select2-container--default.select2-container--focus .wg-global-select2-selection.select2-selection--multiple,
body.weldgrid-shell .select2-container--default.select2-container--open .wg-global-select2-selection.select2-selection--multiple {
    background: #fff3e8 !important;
    border-color: #ff6a1a !important;
    box-shadow: 0 0 0 3px rgba(255, 106, 26, .16) !important;
}
body.weldgrid-shell .select2-container--default .wg-global-select2-selection.select2-selection--single .select2-selection__rendered,
body.weldgrid-shell .select2-container--default .wg-global-select2-selection.select2-selection--multiple .select2-selection__rendered {
    color: #08233e !important;
}
body.weldgrid-shell .wg-global-select2-dropdown .select2-results__option--selected,
body.weldgrid-shell .wg-global-select2-dropdown .select2-results__option[aria-selected="true"],
body.weldgrid-shell .select2-results__option--selected,
body.weldgrid-shell .select2-results__option[aria-selected="true"] {
    background: #fff0e4 !important;
    color: #9a3412 !important;
}
body.weldgrid-shell .wg-global-select2-dropdown .select2-results__option--highlighted,
body.weldgrid-shell .wg-global-select2-dropdown .select2-results__option--highlighted[aria-selected],
body.weldgrid-shell .wg-global-select2-dropdown .select2-results__option--highlighted.select2-results__option--selectable,
body.weldgrid-shell .select2-results__option--highlighted,
body.weldgrid-shell .select2-results__option--highlighted[aria-selected],
body.weldgrid-shell .select2-results__option--highlighted.select2-results__option--selectable {
    background: #ff6a1a !important;
    color: #ffffff !important;
}
body.weldgrid-shell #wgPdfWorkspace .wg-pdf-toolbar .select2-container .wg-global-select2-selection.select2-selection--single,
body.weldgrid-shell #wgPdfWorkspace .wg-pdf-side .select2-container .wg-global-select2-selection.select2-selection--single {
    background: rgba(255, 255, 255, .16) !important;
    border-color: rgba(255, 184, 128, .58) !important;
    color: #ffffff !important;
}
body.weldgrid-shell #wgPdfWorkspace .wg-pdf-toolbar .select2-container--default .wg-global-select2-selection.select2-selection--single .select2-selection__rendered,
body.weldgrid-shell #wgPdfWorkspace .wg-pdf-toolbar .select2-container--default .wg-global-select2-selection.select2-selection--single .select2-selection__placeholder,
body.weldgrid-shell #wgPdfWorkspace .wg-pdf-side .select2-container--default .wg-global-select2-selection.select2-selection--single .select2-selection__rendered,
body.weldgrid-shell #wgPdfWorkspace .wg-pdf-side .select2-container--default .wg-global-select2-selection.select2-selection--single .select2-selection__placeholder {
    color: #ffffff !important;
}

/* Final Select2 orange normalization across custom and global instances. */
body.weldgrid-shell .select2-container--default .select2-selection--single,
body.weldgrid-shell .select2-container--default .select2-selection--multiple {
    background: #fff7ed !important;
    border-color: #f3c5a5 !important;
    color: #08233e !important;
}
body.weldgrid-shell .select2-container--default.select2-container--focus .select2-selection--single,
body.weldgrid-shell .select2-container--default.select2-container--open .select2-selection--single,
body.weldgrid-shell .select2-container--default.select2-container--focus .select2-selection--multiple,
body.weldgrid-shell .select2-container--default.select2-container--open .select2-selection--multiple {
    background: #fff3e8 !important;
    border-color: #ff6a1a !important;
    box-shadow: 0 0 0 3px rgba(255, 106, 26, .16) !important;
}
body.weldgrid-shell .select2-container--default .select2-selection--single .select2-selection__rendered,
body.weldgrid-shell .select2-container--default .select2-selection--multiple .select2-selection__rendered {
    color: #08233e !important;
}
body.weldgrid-shell .select2-dropdown {
    background: #fffaf6 !important;
    border-color: #f1c4a5 !important;
    color: #08233e !important;
}
body.weldgrid-shell .select2-results__option,
body.weldgrid-shell .wg-rule-builder-select2-dropdown .select2-results__option,
body.weldgrid-shell .wg-mapping-editor-select2-dropdown .select2-results__option {
    color: #08233e !important;
}
body.weldgrid-shell .select2-results__option--selected,
body.weldgrid-shell .select2-results__option[aria-selected="true"],
body.weldgrid-shell .wg-rule-builder-select2-dropdown .select2-results__option--selected,
body.weldgrid-shell .wg-rule-builder-select2-dropdown .select2-results__option[aria-selected="true"],
body.weldgrid-shell .wg-mapping-editor-select2-dropdown .select2-results__option--selected,
body.weldgrid-shell .wg-mapping-editor-select2-dropdown .select2-results__option[aria-selected="true"] {
    background: #fff0e4 !important;
    color: #9a3412 !important;
}
body.weldgrid-shell .select2-results__option--highlighted,
body.weldgrid-shell .select2-results__option--highlighted[aria-selected],
body.weldgrid-shell .select2-results__option--highlighted.select2-results__option--selectable,
body.weldgrid-shell .wg-rule-builder-select2-dropdown .select2-results__option--highlighted,
body.weldgrid-shell .wg-rule-builder-select2-dropdown .select2-results__option--highlighted[aria-selected],
body.weldgrid-shell .wg-rule-builder-select2-dropdown .select2-results__option--highlighted.select2-results__option--selectable,
body.weldgrid-shell .wg-mapping-editor-select2-dropdown .select2-results__option--highlighted,
body.weldgrid-shell .wg-mapping-editor-select2-dropdown .select2-results__option--highlighted[aria-selected],
body.weldgrid-shell .wg-mapping-editor-select2-dropdown .select2-results__option--highlighted.select2-results__option--selectable {
    background: #ff6a1a !important;
    color: #ffffff !important;
}
body.weldgrid-shell .select2-results__option--highlighted .wg-rule-select2-option strong,
body.weldgrid-shell .select2-results__option--highlighted .wg-rule-select2-option small {
    color: #ffffff !important;
}
body.weldgrid-shell #wgPdfWorkspace .wg-pdf-toolbar .select2-container--default .select2-selection--single,
body.weldgrid-shell #wgPdfWorkspace .wg-pdf-side .select2-container--default .select2-selection--single {
    background: rgba(255, 255, 255, .16) !important;
    border-color: rgba(255, 184, 128, .58) !important;
    color: #ffffff !important;
}
body.weldgrid-shell #wgPdfWorkspace .wg-pdf-toolbar .select2-container--default.select2-container--focus .select2-selection--single,
body.weldgrid-shell #wgPdfWorkspace .wg-pdf-toolbar .select2-container--default.select2-container--open .select2-selection--single,
body.weldgrid-shell #wgPdfWorkspace .wg-pdf-side .select2-container--default.select2-container--focus .select2-selection--single,
body.weldgrid-shell #wgPdfWorkspace .wg-pdf-side .select2-container--default.select2-container--open .select2-selection--single {
    background: rgba(255, 255, 255, .20) !important;
    border-color: #ff6a1a !important;
    box-shadow: 0 0 0 3px rgba(255, 106, 26, .16) !important;
}
body.weldgrid-shell #wgPdfWorkspace .wg-pdf-toolbar .select2-container--default .select2-selection--single .select2-selection__rendered,
body.weldgrid-shell #wgPdfWorkspace .wg-pdf-toolbar .select2-container--default .select2-selection--single .select2-selection__placeholder,
body.weldgrid-shell #wgPdfWorkspace .wg-pdf-side .select2-container--default .select2-selection--single .select2-selection__rendered,
body.weldgrid-shell #wgPdfWorkspace .wg-pdf-side .select2-container--default .select2-selection--single .select2-selection__placeholder {
    color: #ffffff !important;
}

/* PDF compare UX: fullscreen-first mode, wider selects and floating close action. */
body.weldgrid-shell #wgPdfWorkspace .wg-compare-shell {
    position: relative;
    padding: 12px 58px 12px 12px;
}
body.weldgrid-shell #wgPdfWorkspace .wg-compare-toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px;
    align-items: end;
}
body.weldgrid-shell #wgPdfWorkspace .wg-compare-exit-floating {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 12;
    width: 36px;
    height: 36px;
    min-width: 36px;
    padding: 0 !important;
    border-color: rgba(255, 106, 26, .55) !important;
    background: #fff7ed !important;
    color: #c2410c !important;
    box-shadow: 0 10px 24px rgba(7, 27, 47, .16);
}
body.weldgrid-shell #wgPdfWorkspace .wg-compare-exit-floating:hover,
body.weldgrid-shell #wgPdfWorkspace .wg-compare-exit-floating:focus-visible {
    background: #ff6a1a !important;
    color: #ffffff !important;
    transform: translateY(-1px);
}
body.weldgrid-shell #wgPdfWorkspace .wg-compare-toolbar .select2-container,
body.weldgrid-shell #wgPdfWorkspace .wg-compare-toolbar select {
    width: 100% !important;
}
body.weldgrid-shell .wg-compare-select2-dropdown {
    z-index: 2147483000 !important;
}
body.weldgrid-shell #wgPdfWorkspace .wg-compare-select2-container {
    min-width: 0;
}
body.weldgrid-shell #wgPdfWorkspace.is-fullscreen .wg-compare-shell,
body.weldgrid-shell #wgPdfWorkspace:fullscreen .wg-compare-shell {
    padding: 10px 56px 10px 10px;
}
body.weldgrid-shell #wgPdfWorkspace.is-fullscreen .wg-compare-exit-floating,
body.weldgrid-shell #wgPdfWorkspace:fullscreen .wg-compare-exit-floating {
    top: 10px;
    right: 10px;
}
@media (max-width: 900px) {
    body.weldgrid-shell #wgPdfWorkspace .wg-compare-shell {
        padding-right: 12px;
        padding-top: 54px;
    }
    body.weldgrid-shell #wgPdfWorkspace .wg-compare-toolbar {
        grid-template-columns: 1fr !important;
    }
}


/* =========================================================
   WeldGrid Weld Label Prefix / Circle Shape
========================================================= */
.wg-annotation-label[data-shape="circle"] {
    min-width: calc(44px * var(--wg-annotation-padding-scale, 1)) !important;
    min-height: calc(44px * var(--wg-annotation-padding-scale, 1)) !important;
    aspect-ratio: 1 / 1;
}
.wg-annotation-label[data-shape="circle"] .wg-annotation-label-text {
    max-width: calc(44px * var(--wg-annotation-padding-scale, 1)) !important;
    padding-inline: calc(6px * var(--wg-annotation-padding-scale, 1)) !important;
    transform: none !important;
}
.wg-annotation-label[data-shape="circle"] .wg-annotation-shape-bg {
    border-radius: 999px !important;
}
.wg-weld-config-check {
    grid-column: 1 / -1;
    display: grid !important;
    grid-template-columns: minmax(120px, .65fr) minmax(150px, 1fr);
    align-items: center;
    gap: 4px 10px !important;
    padding: 8px 10px;
    border: 1px solid rgba(12, 46, 76, .12);
    border-radius: 7px;
    background: rgba(255, 255, 255, .72);
}
.wg-weld-config-check > span:first-child {
    color: #17324d !important;
}
.wg-weld-config-check > span:nth-child(2) {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: #0d2d4b;
    font-size: 12px;
    font-weight: 900;
}
.wg-weld-config-check input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #ff6a1a;
}
.wg-weld-config-check small {
    grid-column: 1 / -1;
    color: #60758a;
    font-size: 11px;
    font-weight: 800;
    line-height: 1.3;
}

/* =========================================================
   WeldGrid PDF Viewer Zoom-Proportional Annotation Layer
========================================================= */
.wg-annotation-layer { --wg-pdf-zoom-ratio: 1; --wg-annotation-handle-scale: 1; --wg-spool-handle-scale: 1; }
body.weldgrid-shell .wg-annotation-layer .wg-annotation-label { transform: translate(calc(-8px * var(--wg-pdf-zoom-ratio, 1)), -50%) !important; }
body.weldgrid-shell .wg-annotation-layer .wg-annotation-label[data-shape="triangle"] .wg-annotation-label-text { transform: translateY(calc(10px * var(--wg-pdf-text-offset-zoom-ratio, 1))) !important; }
body.weldgrid-shell .wg-annotation-layer .wg-annotation-label[data-shape="pentagon"] .wg-annotation-label-text { transform: translateY(calc(5px * var(--wg-pdf-text-offset-zoom-ratio, 1))) !important; }
body.weldgrid-shell .wg-annotation-layer .wg-annotation-leader-bend { width: 22px !important; height: 22px !important; }
body.weldgrid-shell .wg-annotation-layer .wg-annotation-leader-bend::before { inset: 5px !important; border-width: calc(2px * var(--wg-annotation-box-border-scale, 1)) !important; box-shadow: 0 0 0 calc(2px * var(--wg-annotation-box-border-scale, 1)) var(--wg-ann-color, #ff5f1f), 0 6px 14px rgba(8, 36, 61, .2) !important; }
body.weldgrid-shell .wg-annotation-layer .wg-spool-selection-bounds { border-width: calc(2px * var(--wg-annotation-box-border-scale, 1)) !important; border-radius: calc(10px * var(--wg-pdf-zoom-ratio, 1)) !important; }

body.weldgrid-shell .wg-annotation-layer .wg-annotation-label .wg-annotation-shape-path { stroke-width: calc(1.8px * var(--wg-annotation-box-border-scale, 1)) !important; }
body.weldgrid-shell .wg-annotation-layer .wg-annotation-label[data-fill-mode="transparent"] .wg-annotation-shape-path { stroke-width: calc(2.1px * var(--wg-annotation-box-border-scale, 1)) !important; }
body.weldgrid-shell .wg-annotation-layer .wg-annotation-label.wg-annotation-selected .wg-annotation-shape-path { stroke-width: calc(2.6px * var(--wg-annotation-box-border-scale, 1)) !important; }


/* =========================================================
   WeldGrid Spool Fixed Zoom Size
========================================================= */
body.weldgrid-shell .wg-annotation-layer .wg-spool-overlay-label { gap: calc(7px * var(--wg-spool-padding-scale, 1)) !important; min-width: calc(108px * var(--wg-spool-padding-scale, 1)) !important; max-width: calc(210px * var(--wg-spool-padding-scale, 1)) !important; min-height: calc(34px * var(--wg-spool-padding-scale, 1)) !important; padding: calc(7px * var(--wg-spool-padding-scale, 1)) calc(11px * var(--wg-spool-padding-scale, 1)) !important; border-width: calc(2px * var(--wg-spool-box-border-scale, 1)) !important; box-shadow: 0 calc(8px * var(--wg-spool-padding-scale, 1)) calc(20px * var(--wg-spool-padding-scale, 1)) rgba(7, 27, 47, .20) !important; }
body.weldgrid-shell .wg-annotation-layer .wg-spool-overlay-label strong { max-width: calc(146px * var(--wg-spool-padding-scale, 1)) !important; font-size: calc(12px * var(--wg-spool-font-scale, 1)) !important; }
body.weldgrid-shell .wg-annotation-layer .wg-spool-overlay-label small { min-width: calc(20px * var(--wg-spool-padding-scale, 1)) !important; height: calc(20px * var(--wg-spool-padding-scale, 1)) !important; padding: 0 calc(5px * var(--wg-spool-padding-scale, 1)) !important; font-size: calc(11px * var(--wg-spool-font-scale, 1)) !important; }
body.weldgrid-shell .wg-annotation-layer .wg-spool-label-group-icon { width: calc(36px * var(--wg-spool-padding-scale, 1)) !important; height: calc(30px * var(--wg-spool-padding-scale, 1)) !important; }
body.weldgrid-shell .wg-annotation-layer .wg-spool-arrow-line:not(.wg-spool-arrow-hit) { stroke-width: calc(2.4px * var(--wg-spool-line-scale, 1)) !important; }
body.weldgrid-shell .wg-annotation-layer .wg-spool-arrow-line:not(.wg-spool-arrow-hit):hover, body.weldgrid-shell .wg-annotation-layer .wg-spool-arrow-line:not(.wg-spool-arrow-hit).is-active { stroke-width: calc(3.2px * var(--wg-spool-line-scale, 1)) !important; }
body.weldgrid-shell .wg-annotation-layer .wg-spool-anchor-point { width: 16px !important; height: 16px !important; border-width: calc(2px * var(--wg-spool-box-border-scale, 1)) !important; }
body.weldgrid-shell .wg-annotation-layer .wg-spool-leader-bend::before { inset: 5px !important; border-width: calc(2px * var(--wg-spool-box-border-scale, 1)) !important; }
body.weldgrid-shell .wg-annotation-layer .wg-spool-selection-bounds { border-width: calc(2px * var(--wg-spool-box-border-scale, 1)) !important; border-radius: calc(10px * var(--wg-spool-padding-scale, 1)) !important; }


/* =========================================================
   WeldGrid PDF Note Tags
========================================================= */
.wg-pdf-note-tags { display: flex; flex-wrap: wrap; gap: 4px; min-width: 0; margin-top: 2px; }
.wg-pdf-note-tag { display: inline-flex; align-items: center; max-width: 100%; min-height: 18px; padding: 2px 7px; border: 1px solid rgba(255, 106, 26, .30); border-radius: 999px; background: rgba(255, 106, 26, .12); color: #c2460c; font-size: 10px; font-weight: 950; line-height: 1.1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.weldgrid-shell .wg-pdf-workspace .wg-pdf-note-tag { border-color: rgba(255, 151, 87, .42); background: rgba(255, 106, 26, .18); color: #ffd9c5; }
body.weldgrid-shell .wg-pdf-workspace .wg-pdf-list-item.active .wg-pdf-note-tag { border-color: rgba(255, 151, 87, .58); background: rgba(255, 106, 26, .24); color: #ffffff; }
body.weldgrid-shell .wg-pdf-workspace .wg-pdf-list-badge { border-color: rgba(255, 255, 255, .12); background: rgba(255, 255, 255, .10); color: #dbeafe; }
body.weldgrid-shell .wg-pdf-workspace .wg-pdf-list-item.active .wg-pdf-list-badge { border-color: rgba(255, 151, 87, .42); background: rgba(255, 106, 26, .16); color: #ffffff; }

/* =========================================================
   WeldGrid Annotation Modal Selects / Header Drag
========================================================= */
body.weldgrid-shell .wg-docked-editor-drag-handle { display: none !important; }
body.weldgrid-shell .wg-docked-editor-drag-zone { cursor: default; user-select: none; }
body.weldgrid-shell .wg-docked-editor-drag-zone button, body.weldgrid-shell .wg-docked-editor-drag-zone .btn, body.weldgrid-shell .wg-docked-editor-drag-zone .btn-close { cursor: pointer; }
body.weldgrid-shell.wg-annotation-editor-docked .wg-annotation-modal .modal-header { padding-left: 1rem; cursor: default; user-select: none; }
body.weldgrid-shell.wg-annotation-editor-docked .wg-annotation-modal .modal-header .btn-close, body.weldgrid-shell.wg-annotation-editor-docked .wg-annotation-modal .modal-header button { cursor: pointer; }
body.weldgrid-shell.wg-spool-editor-docked .wg-spool-split-editor-popup > .swal2-title, .swal2-container.wg-spool-editor-scroll-container .wg-spool-split-editor-popup > .swal2-title { padding-left: 1.25rem !important; cursor: default; user-select: none; }
body.weldgrid-shell .wg-ann-modal-select2-container { width: 100% !important; }
body.weldgrid-shell .wg-ann-item-field .select2-container { width: 100% !important; }
body.weldgrid-shell .wg-ann-modal-select2-dropdown { z-index: 40120 !important; }
body.weldgrid-shell .wg-ann-modal-select2-dropdown .select2-results__option { cursor: pointer; }
body.weldgrid-shell .wg-annotation-modal .select2-container--open { z-index: 40115 !important; }

/* =========================================================
   WeldGrid Floating Annotation Editor Drag / Canvas Fit
========================================================= */
body.weldgrid-shell.wg-docked-editor-dragging { user-select: none; cursor: default; }
body.weldgrid-shell.wg-annotation-editor-docked .wg-annotation-modal .modal-dialog { top: 14px !important; right: 12px !important; bottom: auto !important; width: min(760px, 44vw) !important; max-width: calc(100vw - 24px) !important; height: min(780px, calc(100dvh - 72px)) !important; max-height: calc(100dvh - 28px) !important; transform: none !important; transition: transform .16s ease; }
body.weldgrid-shell.wg-annotation-editor-docked .wg-annotation-modal .modal-dialog.is-dragging-editor { transition: none !important; }
body.weldgrid-shell.wg-spool-editor-docked .swal2-container.wg-spool-editor-scroll-container .swal2-popup.wg-spool-split-editor-popup, .swal2-container.wg-spool-editor-scroll-container .swal2-popup.wg-spool-split-editor-popup, .swal2-container.wg-spool-editor-scroll-container .wg-spool-split-editor-popup { transform: none !important; }
body.weldgrid-shell .wg-docked-editor-drag-zone { cursor: default; user-select: none; }
body.weldgrid-shell .wg-docked-editor-header-tools { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; margin-right: 12px; flex: 0 0 auto; }
body.weldgrid-shell .wg-docked-editor-move-hint { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border: 1px solid rgba(255, 255, 255, .28); border-radius: 999px; background: rgba(255, 255, 255, .12); color: #ffffff; box-shadow: 0 0 0 0 rgba(255, 106, 26, .46); animation: wgDockedMovePulse 1.65s ease-out infinite; }
body.weldgrid-shell .wg-docked-editor-move-hint i { font-size: 18px; line-height: 1; }
body.weldgrid-shell .wg-docked-editor-center-btn { display: inline-flex; align-items: center; justify-content: center; gap: 5px; min-height: 34px; padding: 0 10px; border: 1px solid rgba(255, 255, 255, .30); border-radius: 8px; background: rgba(255, 255, 255, .14); color: #ffffff; font-size: 12px; font-weight: 950; line-height: 1; cursor: pointer; }
body.weldgrid-shell .wg-docked-editor-center-btn:hover { border-color: rgba(255, 255, 255, .58); background: rgba(255, 255, 255, .22); }
body.weldgrid-shell.wg-annotation-editor-canvas-fitted #wgPdfWorkspace .wg-pdf-layout { box-sizing: border-box; padding-right: var(--wg-annotation-editor-safe-right, 0px); transition: padding-right .16s ease; }
body.weldgrid-shell.wg-annotation-editor-canvas-fitted #wgPdfWorkspace .wg-pdf-right { display: none !important; }
body.weldgrid-shell.wg-annotation-editor-canvas-fitted #wgPdfWorkspace .wg-pdf-layout, body.weldgrid-shell.wg-annotation-editor-canvas-fitted #wgPdfWorkspace .wg-pdf-layout.left-collapsed, body.weldgrid-shell.wg-annotation-editor-canvas-fitted #wgPdfWorkspace .wg-pdf-layout.right-collapsed, body.weldgrid-shell.wg-annotation-editor-canvas-fitted #wgPdfWorkspace .wg-pdf-layout.left-collapsed.right-collapsed { grid-template-columns: minmax(220px, 280px) minmax(360px, 1fr) !important; }
body.weldgrid-shell.wg-annotation-editor-canvas-fitted #wgPdfWorkspace .wg-pdf-layout.left-collapsed { grid-template-columns: 54px minmax(360px, 1fr) !important; }
@keyframes wgDockedMovePulse { 0% { box-shadow: 0 0 0 0 rgba(255, 106, 26, .52); } 70% { box-shadow: 0 0 0 10px rgba(255, 106, 26, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 106, 26, 0); } }
@media  (max-width: 1100px) { body.weldgrid-shell.wg-annotation-editor-canvas-fitted #wgPdfWorkspace .wg-pdf-layout { padding-right: 0 !important; } body.weldgrid-shell.wg-annotation-editor-canvas-fitted #wgPdfWorkspace .wg-pdf-right { display: block !important; } body.weldgrid-shell.wg-annotation-editor-canvas-fitted #wgPdfWorkspace .wg-pdf-layout, body.weldgrid-shell.wg-annotation-editor-canvas-fitted #wgPdfWorkspace .wg-pdf-layout.left-collapsed, body.weldgrid-shell.wg-annotation-editor-canvas-fitted #wgPdfWorkspace .wg-pdf-layout.right-collapsed, body.weldgrid-shell.wg-annotation-editor-canvas-fitted #wgPdfWorkspace .wg-pdf-layout.left-collapsed.right-collapsed { grid-template-columns: 1fr !important; } }

/* =========================================================
   WeldGrid PDF Upload Dropzone Drag Feedback
========================================================= */
body.weldgrid-shell .wg-pdf-dropzone { position: relative; isolation: isolate; overflow: hidden; }
body.weldgrid-shell .wg-pdf-dropzone::before { content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; background: radial-gradient(circle at 50% 45%, rgba(255, 106, 26, .26), rgba(255, 106, 26, .08) 52%, rgba(20, 184, 166, .10)); opacity: 0; transform: scale(.96); transition: opacity .16s ease, transform .16s ease; pointer-events: none; }
body.weldgrid-shell .wg-pdf-dropzone::after { content: attr(data-drop-text); position: absolute; inset: 9px; z-index: 2; display: none; align-items: center; justify-content: center; border: 2px dashed rgba(255, 255, 255, .82); border-radius: 7px; background: rgba(255, 106, 26, .88); color: #ffffff; font-size: 14px; font-weight: 950; line-height: 1; text-shadow: 0 1px 1px rgba(7, 27, 47, .22); pointer-events: none; }
body.weldgrid-shell .wg-pdf-dropzone.is-dragover, body.weldgrid-shell .wg-pdf-dropzone.is-drop-ready { border-color: #ff6a1a !important; background: #fff7ed !important; color: #08233e; box-shadow: 0 0 0 3px rgba(255, 106, 26, .18), 0 12px 26px rgba(255, 106, 26, .18); animation: wgPdfDropzonePulse 1.1s ease-in-out infinite; }
body.weldgrid-shell .wg-pdf-dropzone.is-dragover::before, body.weldgrid-shell .wg-pdf-dropzone.is-drop-ready::before { opacity: 1; transform: scale(1); }
body.weldgrid-shell .wg-pdf-dropzone.is-dragover::after, body.weldgrid-shell .wg-pdf-dropzone.is-drop-ready::after { display: flex; animation: wgPdfDropzoneTextPulse 1.1s ease-in-out infinite; }
body.weldgrid-shell .wg-pdf-dropzone.is-dragover i, body.weldgrid-shell .wg-pdf-dropzone.is-drop-ready i { color: #ffffff; transform: scale(1.08); }
@keyframes wgPdfDropzonePulse { 0%, 100% { box-shadow: 0 0 0 3px rgba(255, 106, 26, .16), 0 12px 26px rgba(255, 106, 26, .16); } 50% { box-shadow: 0 0 0 7px rgba(255, 106, 26, .08), 0 16px 34px rgba(255, 106, 26, .24); } }
@keyframes wgPdfDropzoneTextPulse { 0%, 100% { transform: scale(.985); opacity: .94; } 50% { transform: scale(1); opacity: 1; } }

.wg-source-group button.wg-bom-source-bom { border-color: rgba(100, 116, 139, .30); background: #f8fafc; }
.wg-source-group button.wg-bom-source-bom:hover { border-color: rgba(100, 116, 139, .55); background: #f1f5f9; }
.wg-source-group button.wg-bom-source-spool_item,
.wg-source-group button.wg-bom-source-spool_segment_item { border-color: rgba(245, 158, 11, .34); background: #fffbeb; }
.wg-source-group button.wg-bom-source-spool_item:hover,
.wg-source-group button.wg-bom-source-spool_segment_item:hover { border-color: rgba(245, 158, 11, .60); background: #fef3c7; }
.wg-rule-select2-option.wg-bom-source-bom,
.wg-rule-select2-selection-label.wg-bom-source-bom { border-left: 3px solid #64748b; padding-left: 7px; }
.wg-rule-select2-option.wg-bom-source-spool_item,
.wg-rule-select2-option.wg-bom-source-spool_segment_item,
.wg-rule-select2-selection-label.wg-bom-source-spool_item,
.wg-rule-select2-selection-label.wg-bom-source-spool_segment_item { border-left: 3px solid #f59e0b; padding-left: 7px; }
.wg-rule-select2-option.wg-bom-source-bom strong { color: #475569; }
.wg-rule-select2-option.wg-bom-source-spool_item strong,
.wg-rule-select2-option.wg-bom-source-spool_segment_item strong { color: #b45309; }

body.weldgrid-shell .wg-spin-once { display: inline-block; animation: wgSpin 1s linear infinite; transform-origin: 50% 50%; }


/* Fixed docked PDF editors: no window dragging, canvas fills the left split */
body.weldgrid-shell .wg-docked-editor-drag-handle,
body.weldgrid-shell .wg-docked-editor-header-tools,
body.weldgrid-shell .wg-docked-editor-move-hint,
body.weldgrid-shell .wg-docked-editor-center-btn {
    display: none !important;
}

body.weldgrid-shell .wg-docked-editor-drag-zone,
body.weldgrid-shell.wg-annotation-editor-docked .wg-annotation-modal .modal-header,
body.weldgrid-shell.wg-spool-editor-docked .wg-spool-split-editor-popup > .swal2-title,
.swal2-container.wg-spool-editor-scroll-container .wg-spool-split-editor-popup > .swal2-title {
    cursor: default !important;
    user-select: auto !important;
}

body.weldgrid-shell.wg-docked-editor-dragging {
    cursor: default !important;
    user-select: auto !important;
}

body.weldgrid-shell.wg-annotation-editor-docked .wg-annotation-modal .modal-dialog {
    transform: none !important;
    right: 12px !important;
    left: auto !important;
}

body.weldgrid-shell.wg-spool-editor-docked .swal2-container.wg-spool-editor-scroll-container .swal2-popup.wg-spool-split-editor-popup,
.swal2-container.wg-spool-editor-scroll-container .swal2-popup.wg-spool-split-editor-popup,
.swal2-container.wg-spool-editor-scroll-container .wg-spool-split-editor-popup {
    transform: none !important;
    margin-left: auto !important;
    margin-right: 0 !important;
}

body.weldgrid-shell.wg-pdf-editor-canvas-fitted #wgPdfWorkspace .wg-pdf-layout,
body.weldgrid-shell.wg-annotation-editor-canvas-fitted #wgPdfWorkspace .wg-pdf-layout,
body.weldgrid-shell.wg-pdf-editor-canvas-fitted #wgPdfWorkspace .wg-pdf-layout.left-collapsed,
body.weldgrid-shell.wg-pdf-editor-canvas-fitted #wgPdfWorkspace .wg-pdf-layout.right-collapsed,
body.weldgrid-shell.wg-pdf-editor-canvas-fitted #wgPdfWorkspace .wg-pdf-layout.left-collapsed.right-collapsed {
    box-sizing: border-box !important;
    grid-template-columns: 0 minmax(0, 1fr) 0 !important;
    gap: 0 !important;
    column-gap: 0 !important;
    padding-right: var(--wg-annotation-editor-safe-right, 0px) !important;
    transition: padding-right .16s ease !important;
}

body.weldgrid-shell.wg-pdf-editor-canvas-fitted #wgPdfWorkspace .wg-pdf-left,
body.weldgrid-shell.wg-pdf-editor-canvas-fitted #wgPdfWorkspace .wg-pdf-right,
body.weldgrid-shell.wg-annotation-editor-canvas-fitted #wgPdfWorkspace .wg-pdf-left,
body.weldgrid-shell.wg-annotation-editor-canvas-fitted #wgPdfWorkspace .wg-pdf-right {
    display: none !important;
}

body.weldgrid-shell.wg-pdf-editor-canvas-fitted #wgPdfWorkspace .wg-pdf-center,
body.weldgrid-shell.wg-pdf-editor-canvas-fitted #wgPdfWorkspace .wg-pdf-viewer-card,
body.weldgrid-shell.wg-pdf-editor-canvas-fitted #wgPdfWorkspace .wg-pdf-canvas-shell {
    width: 100% !important;
    min-width: 0 !important;
}

body.weldgrid-shell.wg-pdf-editor-canvas-fitted #wgPdfWorkspace .wg-pdf-side-tab {
    display: inline-flex !important;
}
@media (max-width: 1100px) {
    body.weldgrid-shell.wg-pdf-editor-canvas-fitted #wgPdfWorkspace .wg-pdf-layout,
    body.weldgrid-shell.wg-annotation-editor-canvas-fitted #wgPdfWorkspace .wg-pdf-layout {
        grid-template-columns: 1fr !important;
        padding-right: 0 !important;
    }
}


/* BOM table all-rows and fullscreen view */
body.weldgrid-shell .wg-bom-pagination.is-summary-only {
    justify-content: flex-end !important;
}

body.weldgrid-shell .wg-bom-pagination.is-summary-only label,
body.weldgrid-shell .wg-bom-pagination.is-summary-only .form-select,
body.weldgrid-shell .wg-bom-pagination.is-summary-only .wg-icon-btn {
    display: none !important;
}

body.weldgrid-shell.wg-bom-fullscreen-open {
    overflow: hidden;
}

body.weldgrid-shell .wg-bom-table-card.is-fullscreen,
body.weldgrid-shell .wg-bom-table-card:fullscreen {
    width: 100vw !important;
    height: 100vh !important;
    max-width: none !important;
    margin: 0 !important;
    border-radius: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    background: #ffffff !important;
}

body.weldgrid-shell .wg-bom-table-card.is-fullscreen .wg-card-head,
body.weldgrid-shell .wg-bom-table-card:fullscreen .wg-card-head,
body.weldgrid-shell .wg-bom-table-card.is-fullscreen .wg-bom-table-tools,
body.weldgrid-shell .wg-bom-table-card:fullscreen .wg-bom-table-tools,
body.weldgrid-shell .wg-bom-table-card.is-fullscreen .wg-bom-pagination,
body.weldgrid-shell .wg-bom-table-card:fullscreen .wg-bom-pagination {
    flex: 0 0 auto !important;
}

body.weldgrid-shell .wg-bom-table-card.is-fullscreen .wg-bom-table-wrap,
body.weldgrid-shell .wg-bom-table-card:fullscreen .wg-bom-table-wrap {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: auto !important;
}

/* WeldGrid fixed split PDF editors */
body.weldgrid-shell { --wg-pdf-editor-width: clamp(560px, 36vw, 720px); }
body.weldgrid-shell .wg-docked-editor-drag-handle, body.weldgrid-shell .wg-docked-editor-header-tools, body.weldgrid-shell .wg-docked-editor-move-hint, body.weldgrid-shell .wg-docked-editor-center-btn { display: none !important; }
body.weldgrid-shell .wg-docked-editor-drag-zone, body.weldgrid-shell.wg-annotation-editor-docked .wg-annotation-modal .modal-header, body.weldgrid-shell.wg-spool-editor-docked .wg-spool-split-editor-popup > .swal2-title, .swal2-container.wg-spool-editor-scroll-container .wg-spool-split-editor-popup > .swal2-title { cursor: default !important; user-select: auto !important; }
body.weldgrid-shell.wg-docked-editor-dragging { cursor: default !important; user-select: auto !important; }
body.weldgrid-shell.wg-annotation-editor-docked, body.weldgrid-shell.wg-spool-editor-docked { overflow: hidden !important; }
body.weldgrid-shell.wg-annotation-editor-docked #wgPdfWorkspace, body.weldgrid-shell.wg-spool-editor-docked #wgPdfWorkspace { width: calc(100dvw - var(--wg-pdf-editor-width)) !important; max-width: calc(100dvw - var(--wg-pdf-editor-width)) !important; min-width: 0 !important; height: 100dvh !important; max-height: 100dvh !important; margin: 0 auto 0 0 !important; padding: 8px !important; overflow: hidden !important; }
body.weldgrid-shell.wg-annotation-editor-docked #wgPdfWorkspace .wg-page-header, body.weldgrid-shell.wg-spool-editor-docked #wgPdfWorkspace .wg-page-header { display: none !important; }
body.weldgrid-shell.wg-annotation-editor-docked #wgPdfWorkspace .wg-pdf-toolbar, body.weldgrid-shell.wg-spool-editor-docked #wgPdfWorkspace .wg-pdf-toolbar { margin: 0 0 8px !important; width: 100% !important; max-width: 100% !important; }
body.weldgrid-shell.wg-annotation-editor-docked #wgPdfWorkspace .wg-pdf-layout, body.weldgrid-shell.wg-spool-editor-docked #wgPdfWorkspace .wg-pdf-layout, body.weldgrid-shell.wg-pdf-editor-canvas-fitted #wgPdfWorkspace .wg-pdf-layout, body.weldgrid-shell.wg-annotation-editor-canvas-fitted #wgPdfWorkspace .wg-pdf-layout, body.weldgrid-shell.wg-pdf-editor-canvas-fitted #wgPdfWorkspace .wg-pdf-layout.left-collapsed, body.weldgrid-shell.wg-pdf-editor-canvas-fitted #wgPdfWorkspace .wg-pdf-layout.right-collapsed, body.weldgrid-shell.wg-pdf-editor-canvas-fitted #wgPdfWorkspace .wg-pdf-layout.left-collapsed.right-collapsed { display: grid !important; grid-template-columns: minmax(0, 1fr) !important; gap: 0 !important; width: 100% !important; height: calc(100dvh - 82px) !important; min-height: 0 !important; padding-right: 0 !important; overflow: hidden !important; }
body.weldgrid-shell.wg-annotation-editor-docked #wgPdfWorkspace .wg-pdf-left, body.weldgrid-shell.wg-annotation-editor-docked #wgPdfWorkspace .wg-pdf-right, body.weldgrid-shell.wg-spool-editor-docked #wgPdfWorkspace .wg-pdf-left, body.weldgrid-shell.wg-spool-editor-docked #wgPdfWorkspace .wg-pdf-right, body.weldgrid-shell.wg-pdf-editor-canvas-fitted #wgPdfWorkspace .wg-pdf-left, body.weldgrid-shell.wg-pdf-editor-canvas-fitted #wgPdfWorkspace .wg-pdf-right { display: none !important; }
body.weldgrid-shell.wg-annotation-editor-docked #wgPdfWorkspace .wg-pdf-center, body.weldgrid-shell.wg-spool-editor-docked #wgPdfWorkspace .wg-pdf-center, body.weldgrid-shell.wg-annotation-editor-docked #wgPdfWorkspace .wg-pdf-viewer-card, body.weldgrid-shell.wg-spool-editor-docked #wgPdfWorkspace .wg-pdf-viewer-card, body.weldgrid-shell.wg-annotation-editor-docked #wgPdfWorkspace .wg-pdf-canvas-shell, body.weldgrid-shell.wg-spool-editor-docked #wgPdfWorkspace .wg-pdf-canvas-shell { width: 100% !important; min-width: 0 !important; max-width: 100% !important; }
body.weldgrid-shell.wg-annotation-editor-docked #wgPdfWorkspace .wg-pdf-center, body.weldgrid-shell.wg-spool-editor-docked #wgPdfWorkspace .wg-pdf-center, body.weldgrid-shell.wg-annotation-editor-docked #wgPdfWorkspace .wg-pdf-viewer-card, body.weldgrid-shell.wg-spool-editor-docked #wgPdfWorkspace .wg-pdf-viewer-card { height: 100% !important; min-height: 0 !important; overflow: hidden !important; }
body.weldgrid-shell.wg-annotation-editor-docked #wgPdfWorkspace .wg-pdf-canvas-shell, body.weldgrid-shell.wg-spool-editor-docked #wgPdfWorkspace .wg-pdf-canvas-shell { flex: 1 1 auto !important; height: auto !important; min-height: 0 !important; max-height: none !important; overflow: auto !important; }
body.weldgrid-shell.wg-annotation-editor-docked .wg-annotation-modal { pointer-events: none !important; }
body.weldgrid-shell.wg-annotation-editor-docked .wg-annotation-modal .modal-dialog { position: fixed !important; inset: 0 0 0 auto !important; width: var(--wg-pdf-editor-width) !important; max-width: var(--wg-pdf-editor-width) !important; height: 100dvh !important; max-height: 100dvh !important; margin: 0 !important; transform: none !important; transition: none !important; pointer-events: auto !important; }
body.weldgrid-shell.wg-annotation-editor-docked .wg-annotation-modal .modal-content { height: 100% !important; max-height: 100dvh !important; border-radius: 0 !important; display: flex !important; flex-direction: column !important; overflow: hidden !important; }
body.weldgrid-shell.wg-annotation-editor-docked .wg-annotation-modal .modal-body { flex: 1 1 auto !important; min-height: 0 !important; overflow: auto !important; }
body.weldgrid-shell.wg-annotation-editor-docked .wg-annotation-modal .modal-header, body.weldgrid-shell.wg-annotation-editor-docked .wg-annotation-modal .modal-footer { flex: 0 0 auto !important; }
body.weldgrid-shell.wg-spool-editor-docked .swal2-container.wg-spool-editor-scroll-container, .swal2-container.wg-spool-editor-scroll-container { justify-content: flex-end !important; align-items: stretch !important; padding: 0 !important; pointer-events: none !important; overflow: hidden !important; }
body.weldgrid-shell.wg-spool-editor-docked .swal2-container.wg-spool-editor-scroll-container .swal2-popup.wg-spool-split-editor-popup, .swal2-container.wg-spool-editor-scroll-container .swal2-popup.wg-spool-split-editor-popup, .swal2-container.wg-spool-editor-scroll-container .wg-spool-split-editor-popup { position: fixed !important; inset: 0 0 0 auto !important; width: var(--wg-pdf-editor-width) !important; max-width: var(--wg-pdf-editor-width) !important; height: 100dvh !important; min-height: 100dvh !important; max-height: 100dvh !important; margin: 0 !important; padding: 0 !important; border-radius: 0 !important; transform: none !important; transition: none !important; overflow: hidden !important; pointer-events: auto !important; }
body.weldgrid-shell.wg-spool-editor-docked .wg-spool-split-editor-popup > .swal2-html-container.wg-spool-split-editor-html, .swal2-container.wg-spool-editor-scroll-container .wg-spool-split-editor-popup > .swal2-html-container.wg-spool-split-editor-html { flex: 1 1 auto !important; min-height: 0 !important; height: 0 !important; max-height: none !important; overflow: auto !important; }
body.weldgrid-shell.wg-spool-editor-docked .wg-spool-split-editor-popup > .swal2-title, body.weldgrid-shell.wg-spool-editor-docked .wg-spool-split-editor-popup > .swal2-actions, .swal2-container.wg-spool-editor-scroll-container .wg-spool-split-editor-popup > .swal2-title, .swal2-container.wg-spool-editor-scroll-container .wg-spool-split-editor-popup > .swal2-actions { flex: 0 0 auto !important; }
@media (max-width: 1100px) { body.weldgrid-shell { --wg-pdf-editor-width: 100dvw; } body.weldgrid-shell.wg-annotation-editor-docked #wgPdfWorkspace, body.weldgrid-shell.wg-spool-editor-docked #wgPdfWorkspace { display: none !important; } body.weldgrid-shell.wg-annotation-editor-docked .wg-annotation-modal .modal-dialog, body.weldgrid-shell.wg-spool-editor-docked .swal2-container.wg-spool-editor-scroll-container .swal2-popup.wg-spool-split-editor-popup, .swal2-container.wg-spool-editor-scroll-container .swal2-popup.wg-spool-split-editor-popup { width: 100dvw !important; max-width: 100dvw !important; } }

/* WeldGrid editor split correction: left canvas stops at editor edge */
body.weldgrid-shell.wg-annotation-editor-docked, body.weldgrid-shell.wg-spool-editor-docked { --wg-pdf-left-pane-width: calc(100dvw - var(--wg-pdf-editor-width)); }
body.weldgrid-shell.wg-annotation-editor-docked #wgPdfWorkspace, body.weldgrid-shell.wg-spool-editor-docked #wgPdfWorkspace { box-sizing: border-box !important; width: 100dvw !important; max-width: 100dvw !important; min-width: 100dvw !important; padding: 8px calc(var(--wg-pdf-editor-width) + 8px) 8px 8px !important; overflow: hidden !important; }
body.weldgrid-shell.wg-annotation-editor-docked #wgPdfWorkspace .wg-pdf-toolbar, body.weldgrid-shell.wg-spool-editor-docked #wgPdfWorkspace .wg-pdf-toolbar, body.weldgrid-shell.wg-annotation-editor-docked #wgPdfWorkspace .wg-pdf-layout, body.weldgrid-shell.wg-spool-editor-docked #wgPdfWorkspace .wg-pdf-layout { box-sizing: border-box !important; width: calc(var(--wg-pdf-left-pane-width) - 16px) !important; max-width: calc(var(--wg-pdf-left-pane-width) - 16px) !important; margin-left: 0 !important; margin-right: auto !important; }
body.weldgrid-shell.wg-annotation-editor-docked #wgPdfWorkspace .wg-pdf-center, body.weldgrid-shell.wg-spool-editor-docked #wgPdfWorkspace .wg-pdf-center, body.weldgrid-shell.wg-annotation-editor-docked #wgPdfWorkspace .wg-pdf-viewer-card, body.weldgrid-shell.wg-spool-editor-docked #wgPdfWorkspace .wg-pdf-viewer-card, body.weldgrid-shell.wg-annotation-editor-docked #wgPdfWorkspace .wg-pdf-canvas-shell, body.weldgrid-shell.wg-spool-editor-docked #wgPdfWorkspace .wg-pdf-canvas-shell { box-sizing: border-box !important; width: 100% !important; max-width: 100% !important; }
body.weldgrid-shell.wg-annotation-editor-docked #wgPdfWorkspace .wg-pdf-canvas-shell canvas, body.weldgrid-shell.wg-spool-editor-docked #wgPdfWorkspace .wg-pdf-canvas-shell canvas { max-width: none !important; }
@media (max-width: 1100px) { body.weldgrid-shell.wg-annotation-editor-docked #wgPdfWorkspace, body.weldgrid-shell.wg-spool-editor-docked #wgPdfWorkspace { display: none !important; } }

/* PDF left panel upload queue scrolling */
body.weldgrid-shell #wgPdfWorkspace .wg-pdf-left .wg-upload-box { min-height: 0 !important; }
body.weldgrid-shell #wgPdfWorkspace .wg-pdf-left .wg-pdf-upload-collapsible { min-height: 0 !important; }
body.weldgrid-shell #wgPdfWorkspace .wg-pdf-left .wg-pdf-upload-queue { max-height: min(34dvh, 320px); overflow-y: auto; overflow-x: hidden; padding-right: 2px; }
body.weldgrid-shell #wgPdfWorkspace .wg-pdf-left .wg-pdf-upload-queue-summary { position: sticky; top: 0; z-index: 1; }
@media (max-height: 860px) { body.weldgrid-shell #wgPdfWorkspace .wg-pdf-left .wg-pdf-upload-queue { max-height: min(28dvh, 240px); } }

/* PDF upload compact preview */
body.weldgrid-shell #wgPdfWorkspace .wg-pdf-upload-queue-preview { display: grid; gap: 6px; margin-top: 4px; }
body.weldgrid-shell #wgPdfWorkspace .wg-pdf-upload-queue-preview-item { display: grid; gap: 2px; padding: 8px 10px; border: 1px solid rgba(12, 46, 76, .12); border-radius: 8px; background: #ffffff; }
body.weldgrid-shell #wgPdfWorkspace .wg-pdf-upload-queue-preview-item strong { display: block; color: #08233e; font-size: 12px; font-weight: 950; line-height: 1.25; word-break: break-word; }
body.weldgrid-shell #wgPdfWorkspace .wg-pdf-upload-queue-preview-item small { color: #60758a; font-size: 11px; font-weight: 850; }
body.weldgrid-shell #wgPdfWorkspace .wg-pdf-upload-queue-more { margin: 0; color: #0d2d4b !important; font-size: 11px; font-weight: 900; }


/* =========================================================
   WeldGrid Spool Per-PDF / Line Preview Fix
========================================================= */
.wg-spool-selection-line {
    fill: none;
    stroke: var(--wg-spool-area-color, var(--wg-spool-color, #ff6a1a));
    stroke-width: 3.2px;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 8 6;
    opacity: var(--wg-spool-line-opacity, .72);
    filter: drop-shadow(0 1px 2px rgba(7, 27, 47, .28));
    pointer-events: none;
}
.wg-spool-selection-lines {
    pointer-events: none;
}
body.weldgrid-shell .wg-live-label-preview-area {
    display: none !important;
}
body.weldgrid-shell .wg-live-label-preview-line {
    position: absolute;
    inset: 10px 16px;
    z-index: 1;
    width: calc(100% - 32px);
    height: calc(100% - 20px);
    overflow: visible;
    pointer-events: none;
}
body.weldgrid-shell .wg-live-label-preview-line polyline {
    fill: none;
    stroke: var(--wg-spool-preview-area, var(--wg-spool-preview-color, #ff6a1a));
    stroke-width: 5;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 12 8;
    opacity: .82;
    filter: drop-shadow(0 2px 3px rgba(7, 27, 47, .24));
}
body.weldgrid-shell .wg-spool-editor-form .wg-spool-field-help {
    line-height: 1.35;
}


/* =========================================================
   WeldGrid Spool Connection Line Visibility Fix
========================================================= */
.wg-spool-selection-line { display: none !important; }
.wg-spool-connection-lines { pointer-events: auto; }
.wg-spool-connection-line { fill: none !important; stroke-linecap: round !important; stroke-linejoin: round !important; pointer-events: stroke; cursor: pointer; vector-effect: non-scaling-stroke; }
.wg-spool-connection-line-glow { stroke: #00a6d6 !important; stroke-width: 13px !important; opacity: .42 !important; filter: drop-shadow(0 0 5px rgba(0, 166, 214, .55)) drop-shadow(0 2px 3px rgba(7, 27, 47, .28)); }
.wg-spool-connection-line-main { stroke: var(--wg-spool-color, #ff6a1a) !important; stroke-width: 5.8px !important; opacity: .98 !important; filter: drop-shadow(0 1px 2px rgba(7, 27, 47, .35)); }
.wg-spool-connection-line-main.is-active { stroke-width: 6.6px !important; }
body.weldgrid-shell .wg-annotation-layer .wg-spool-connection-line-main { stroke-width: calc(5.8px * var(--wg-spool-line-scale, 1)) !important; }
body.weldgrid-shell .wg-annotation-layer .wg-spool-connection-line-glow { stroke-width: calc(13px * var(--wg-spool-line-scale, 1)) !important; }

/* =========================================================
   WeldGrid Spool Connection Route Editor
========================================================= */
.wg-spool-connection-lines { pointer-events: auto; }
.wg-spool-connection-line { fill: none !important; stroke-linecap: round !important; stroke-linejoin: round !important; pointer-events: stroke; cursor: crosshair; vector-effect: non-scaling-stroke; }
.wg-spool-connection-hit { stroke: rgba(255, 255, 255, .01) !important; stroke-width: 18px !important; opacity: 1 !important; filter: none !important; }
.wg-spool-connection-line-glow { stroke: #00a6d6 !important; stroke-width: 8px !important; opacity: .10 !important; filter: drop-shadow(0 0 3px rgba(0, 166, 214, .20)); }
.wg-spool-connection-line-main { stroke: var(--wg-spool-color, #ff6a1a) !important; stroke-width: 2.6px !important; opacity: .38 !important; filter: none !important; }
.wg-spool-connection-line-main.is-active { stroke-width: 3px !important; opacity: .46 !important; }
body.weldgrid-shell .wg-annotation-layer .wg-spool-connection-line-main { stroke-width: calc(2.6px * var(--wg-spool-line-scale, 1)) !important; }
body.weldgrid-shell .wg-annotation-layer .wg-spool-connection-line-glow { stroke-width: calc(8px * var(--wg-spool-line-scale, 1)) !important; }
.wg-spool-connection-bend { position: absolute; z-index: 30; width: 22px; height: 22px; padding: 0; border: 0; border-radius: 999px; background: transparent; transform: translate(-50%, -50%); opacity: 0; cursor: grab; pointer-events: none; transition: opacity .14s ease, transform .14s ease; }
.wg-spool-connection-bend::before { content: ""; position: absolute; inset: 6px; border: 2px solid #ffffff; border-radius: inherit; background: var(--wg-spool-color, #ff6a1a); box-shadow: 0 0 0 2px rgba(0, 166, 214, .38), 0 5px 14px rgba(7, 27, 47, .18); opacity: .82; }
.wg-spool-connection-bend.is-visible, .wg-spool-connection-bend:hover, .wg-spool-connection-bend:focus-visible { opacity: 1; pointer-events: auto; transform: translate(-50%, -50%) scale(1.06); }
.wg-spool-connection-bend:active { cursor: grabbing; }

/* =========================================================
   WeldGrid PDF Download Choice
========================================================= */
body.weldgrid-shell .swal2-popup.wg-download-choice-popup { border: 1px solid rgba(12, 46, 76, .18); border-radius: 12px; background: linear-gradient(180deg, #eef5fa 0%, #ffffff 100%); box-shadow: 0 24px 70px rgba(7, 27, 47, .28); }
.wg-download-choice-dialog { display: grid; gap: 16px; text-align: left; color: #17324d; }
.wg-download-choice-dialog p { margin: 0; color: #52677d; font-size: 13px; font-weight: 850; text-align: center; }
.wg-download-choice-dialog p strong { color: #08233e; }
.wg-download-choice-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.wg-download-choice-card { display: grid; justify-items: center; gap: 8px; min-height: 172px; padding: 18px 14px; border: 1px solid rgba(12, 46, 76, .14); border-radius: 16px; background: #ffffff; color: #17324d; text-align: center; box-shadow: 0 12px 26px rgba(7, 27, 47, .08); transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease, background .16s ease; }
.wg-download-choice-card:hover, .wg-download-choice-card:focus-visible { transform: translateY(-2px); border-color: rgba(255, 106, 26, .52); background: #fff8f1; box-shadow: 0 18px 34px rgba(7, 27, 47, .12); outline: none; }
.wg-download-choice-card.is-selected { transform: translateY(-2px); border-color: rgba(255, 106, 26, .72); background: #fff4e8; box-shadow: 0 20px 38px rgba(7, 27, 47, .14); outline: none; }
.wg-download-choice-card span { display: inline-flex; align-items: center; justify-content: center; width: 54px; height: 54px; border-radius: 999px; background: linear-gradient(135deg, #08233e 0%, #1976a2 100%); color: #ffffff; font-size: 25px; box-shadow: 0 10px 20px rgba(7, 27, 47, .18); }
.wg-download-choice-card:nth-child(3) span { background: linear-gradient(135deg, #ff6a1a 0%, #1976a2 100%); }
.wg-download-choice-card strong { color: #08233e; font-size: 14px; font-weight: 950; line-height: 1.2; }
.wg-download-choice-card small { color: #60758a; font-size: 11px; font-weight: 800; line-height: 1.4; }
@media (max-width: 760px) { .wg-download-choice-grid { grid-template-columns: 1fr; } }

/* =========================================================
   WeldGrid Spool Connection Route Control Final
========================================================= */
.wg-spool-connection-lines { pointer-events: auto !important; }
.wg-spool-connection-line { fill: none !important; stroke-linecap: round !important; stroke-linejoin: round !important; pointer-events: stroke !important; cursor: crosshair !important; vector-effect: non-scaling-stroke !important; }
.wg-spool-connection-hit { stroke: rgba(255, 255, 255, .02) !important; stroke-width: 26px !important; opacity: 1 !important; filter: none !important; }
.wg-spool-connection-line-glow { stroke: #00a6d6 !important; stroke-width: 9px !important; opacity: .22 !important; filter: drop-shadow(0 0 4px rgba(0, 166, 214, .34)) !important; }
.wg-spool-connection-line-main { stroke: var(--wg-spool-color, #ff6a1a) !important; stroke-width: 4.2px !important; opacity: .72 !important; filter: drop-shadow(0 1px 2px rgba(7, 27, 47, .28)) !important; }
.wg-spool-connection-line-main.is-active { stroke-width: 4.8px !important; opacity: .82 !important; }
body.weldgrid-shell .wg-annotation-layer .wg-spool-connection-line-main { stroke-width: calc(4.2px * var(--wg-spool-line-scale, 1)) !important; }
body.weldgrid-shell .wg-annotation-layer .wg-spool-connection-line-main.is-active { stroke-width: calc(4.8px * var(--wg-spool-line-scale, 1)) !important; }
body.weldgrid-shell .wg-annotation-layer .wg-spool-connection-line-glow { stroke-width: calc(9px * var(--wg-spool-line-scale, 1)) !important; }
.wg-spool-connection-bend { position: absolute !important; z-index: 60 !important; width: 24px !important; height: 24px !important; padding: 0 !important; border: 0 !important; border-radius: 999px !important; background: transparent !important; transform: translate(-50%, -50%) !important; opacity: 0 !important; cursor: grab !important; pointer-events: none !important; transition: opacity .14s ease, transform .14s ease !important; }
.wg-spool-connection-bend::before { content: "" !important; position: absolute !important; inset: 6px !important; border: 2px solid #ffffff !important; border-radius: inherit !important; background: var(--wg-spool-color, #ff6a1a) !important; box-shadow: 0 0 0 2px rgba(0, 166, 214, .45), 0 5px 14px rgba(7, 27, 47, .22) !important; opacity: .96 !important; }
.wg-spool-connection-bend::after { content: "" !important; position: absolute !important; inset: 10px !important; border-radius: inherit !important; background: #ffffff !important; opacity: .78 !important; }
.wg-spool-connection-bend.is-default-point::before { box-shadow: 0 0 0 2px rgba(255, 106, 26, .32), 0 5px 14px rgba(7, 27, 47, .2) !important; }
.wg-spool-connection-bend.is-visible, .wg-spool-connection-bend:hover, .wg-spool-connection-bend:focus-visible { opacity: 1 !important; pointer-events: auto !important; transform: translate(-50%, -50%) scale(1.06) !important; }
.wg-spool-connection-bend:active { cursor: grabbing !important; transform: translate(-50%, -50%) scale(1.12) !important; }

body.weldgrid-shell #wgPdfWorkspace .wg-pdf-groups-manage { justify-content: center; }
body.weldgrid-shell #wgPdfWorkspace .wg-pdf-group-block { display: grid; gap: 7px; margin-bottom: 9px; }
body.weldgrid-shell #wgPdfWorkspace .wg-pdf-group-header { display: grid; grid-template-columns: minmax(0, 1fr) auto 26px; align-items: center; gap: 8px; width: 100%; min-height: 42px; overflow: hidden; border: 1px solid rgba(255, 106, 26, .34); border-left: 4px solid #ff6a1a; border-radius: 10px; background: linear-gradient(135deg, #ffffff 0%, #f8fbfd 64%, #fff1e8 100%); color: #08233e; padding: 8px 8px 8px 10px; font-size: 12px; font-weight: 950; text-align: left; box-shadow: 0 8px 18px rgba(7, 27, 47, .08); }
body.weldgrid-shell #wgPdfWorkspace .wg-pdf-group-header:hover { border-color: rgba(255, 106, 26, .52); background: linear-gradient(135deg, #ffffff 0%, #fff7ed 100%); }
body.weldgrid-shell #wgPdfWorkspace .wg-pdf-group-title { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.weldgrid-shell #wgPdfWorkspace .wg-pdf-group-title strong { color: #08233e; font-size: 12px; font-weight: 950; line-height: 1.15; }
body.weldgrid-shell #wgPdfWorkspace .wg-pdf-group-header em { display: inline-flex; align-items: center; justify-content: center; min-height: 22px; flex: 0 0 auto; border: 1px solid rgba(255, 106, 26, .25); border-radius: 999px; background: #fff7ed; color: #c2410c; padding: 2px 8px; font-style: normal; font-size: 10px; font-weight: 950; white-space: nowrap; }
body.weldgrid-shell #wgPdfWorkspace .wg-pdf-group-chevron { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 999px; background: #eef3f7; color: #ff6a1a; font-size: 20px; font-weight: 950; line-height: 1; transform: rotate(90deg); transition: transform .15s ease, background .15s ease; }
body.weldgrid-shell #wgPdfWorkspace .wg-pdf-group-block.is-collapsed .wg-pdf-group-chevron { transform: rotate(0deg); }
body.weldgrid-shell #wgPdfWorkspace .wg-pdf-group-items { display: grid; gap: 7px; }
body.weldgrid-shell #wgPdfWorkspace .wg-pdf-group-badge { display: inline-flex; align-items: center; gap: 5px; width: fit-content; max-width: 100%; border: 1px solid color-mix(in srgb, var(--wg-pdf-group-color, #0f766e) 38%, transparent); border-radius: 999px; background: color-mix(in srgb, var(--wg-pdf-group-color, #0f766e) 12%, #ffffff); color: #17324d; padding: 3px 7px; font-size: 10px; font-weight: 950; line-height: 1.2; }
body.weldgrid-shell #wgPdfWorkspace .wg-pdf-group-badge.is-empty { --wg-pdf-group-color: #60758a; color: #52677d; }
body.weldgrid-shell .wg-pdf-group-manager { display: grid; gap: 12px; text-align: left; color: #17324d; }
body.weldgrid-shell .wg-pdf-group-manager-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; border: 1px solid #d6e4ee; border-radius: 10px; background: #f8fbfd; padding: 10px; }
body.weldgrid-shell .wg-pdf-group-manager-head span { color: #60758a; font-size: 12px; font-weight: 850; }
body.weldgrid-shell .wg-pdf-group-manager .wg-pdf-group-badge { display: inline-flex; align-items: center; gap: 5px; width: fit-content; max-width: 100%; border: 1px solid color-mix(in srgb, var(--wg-pdf-group-color, #0f766e) 38%, transparent); border-radius: 999px; background: color-mix(in srgb, var(--wg-pdf-group-color, #0f766e) 12%, #ffffff); color: #17324d; padding: 3px 7px; font-size: 10px; font-weight: 950; line-height: 1.2; }
body.weldgrid-shell .wg-pdf-group-manager-actions { display: inline-flex; align-items: center; gap: 6px; justify-content: flex-end; }
body.weldgrid-shell .wg-pdf-group-manager-note { margin: 0; color: #60758a; font-size: 12px; font-weight: 850; }
body.weldgrid-shell .wg-pdf-group-form { display: grid; gap: 10px; text-align: left; }
body.weldgrid-shell .wg-pdf-group-form label { display: grid; gap: 5px; margin: 0; color: #17324d; font-size: 12px; font-weight: 900; }
body.weldgrid-shell .wg-pdf-manager-group-tools { display: grid; grid-template-columns: minmax(180px, 1fr) auto; gap: 8px; align-items: center; }

body.weldgrid-shell .swal2-popup.wg-pdf-group-manager-popup { display: flex !important; flex-direction: column; width: min(1120px, calc(100vw - 24px)) !important; max-height: calc(100dvh - 48px); overflow: hidden !important; }
body.weldgrid-shell .swal2-popup.wg-pdf-group-manager-popup .swal2-html-container { flex: 1 1 auto; min-height: 0; max-height: calc(100dvh - 220px); margin: 10px 0 0 !important; padding: 0 4px 8px !important; overflow: auto !important; overscroll-behavior: contain; }
body.weldgrid-shell .swal2-popup.wg-pdf-group-manager-popup .swal2-actions { flex: 0 0 auto; margin-top: 12px !important; }
body.weldgrid-shell .wg-pdf-group-manager-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 12px; align-items: stretch; min-height: 0; }
body.weldgrid-shell .wg-pdf-group-sidebar { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; gap: 10px; min-width: 0; border: 1px solid #d6e4ee; border-radius: 12px; background: linear-gradient(180deg, #f8fbfd 0%, #eef8fc 100%); padding: 10px; }
body.weldgrid-shell .wg-pdf-group-sidebar-title { color: #08233e; font-size: 12px; font-weight: 950; text-transform: uppercase; letter-spacing: .04em; }
body.weldgrid-shell .wg-pdf-group-card-list { display: grid; align-content: start; gap: 8px; min-height: 0; max-height: min(500px, calc(100dvh - 360px)); overflow: auto; padding-right: 2px; }
body.weldgrid-shell .wg-pdf-group-card { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto; align-items: center; gap: 9px; width: 100%; border: 1px solid rgba(12, 46, 76, .12); border-radius: 10px; background: #ffffff; padding: 9px; color: #17324d; cursor: pointer; transition: border-color .15s ease, background .15s ease, box-shadow .15s ease, transform .15s ease; }
body.weldgrid-shell .wg-pdf-group-card:hover { border-color: color-mix(in srgb, var(--wg-pdf-group-color, #0f766e) 42%, #d6e4ee); background: color-mix(in srgb, var(--wg-pdf-group-color, #0f766e) 8%, #ffffff); }
body.weldgrid-shell .wg-pdf-group-card:focus-visible { outline: 3px solid rgba(255, 106, 26, .22); outline-offset: 2px; }
body.weldgrid-shell .wg-pdf-group-card.is-active { border-color: color-mix(in srgb, var(--wg-pdf-group-color, #0f766e) 62%, #d6e4ee); background: color-mix(in srgb, var(--wg-pdf-group-color, #0f766e) 14%, #ffffff); box-shadow: inset 3px 0 0 var(--wg-pdf-group-color, #0f766e), 0 10px 24px rgba(7, 27, 47, .08); }
body.weldgrid-shell .wg-pdf-group-card-swatch { width: 12px; height: 38px; border-radius: 999px; background: var(--wg-pdf-group-color, #0f766e); box-shadow: 0 0 0 2px rgba(255, 255, 255, .9), 0 4px 12px rgba(7, 27, 47, .12); }
body.weldgrid-shell .wg-pdf-group-card-copy { display: grid; gap: 2px; min-width: 0; }
body.weldgrid-shell .wg-pdf-group-card-copy strong { color: #08233e; font-size: 13px; font-weight: 950; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.weldgrid-shell .wg-pdf-group-card-copy small { color: #60758a; font-size: 11px; font-weight: 850; }
body.weldgrid-shell .wg-pdf-group-card-actions { display: inline-flex; align-items: center; gap: 5px; }
body.weldgrid-shell .wg-pdf-group-card-actions button { min-height: 28px; border: 1px solid rgba(12, 46, 76, .12); border-radius: 7px; background: #ffffff; color: #17324d; padding: 4px 7px; font-size: 10px; font-weight: 950; }
body.weldgrid-shell .wg-pdf-group-card-actions button:hover { border-color: rgba(255, 106, 26, .38); background: #fff7ed; color: #9a3412; }
body.weldgrid-shell .wg-pdf-group-workspace { display: grid; grid-template-rows: auto auto minmax(180px, 1fr) auto; gap: 10px; min-width: 0; }
body.weldgrid-shell .wg-pdf-group-tools { display: grid; grid-template-columns: minmax(220px, 1fr) auto; gap: 10px; align-items: center; }
body.weldgrid-shell .wg-pdf-group-assignment { display: grid; grid-template-columns: minmax(190px, 1fr) minmax(180px, 240px) auto auto; gap: 8px; align-items: center; border: 1px solid rgba(255, 106, 26, .22); border-radius: 10px; background: #fff7ed; padding: 9px; }
body.weldgrid-shell .wg-pdf-group-selection { display: grid; gap: 2px; min-width: 0; }
body.weldgrid-shell .wg-pdf-group-selection strong { color: #9a3412; font-size: 13px; font-weight: 950; }
body.weldgrid-shell .wg-pdf-group-selection span { color: #60758a; font-size: 11px; font-weight: 850; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.weldgrid-shell .wg-pdf-group-table-wrap { max-height: min(500px, calc(100dvh - 420px)); }
body.weldgrid-shell .wg-pdf-group-table { min-width: 760px; }
body.weldgrid-shell .wg-pdf-group-pdf-title .wg-pdf-group-badge { margin-top: 5px; }
@media (max-width: 980px) { body.weldgrid-shell .wg-pdf-group-manager-layout { grid-template-columns: 1fr; } }
@media (max-width: 980px) { body.weldgrid-shell .wg-pdf-group-sidebar { grid-template-rows: auto auto auto; } }
@media (max-width: 980px) { body.weldgrid-shell .wg-pdf-group-card-list { max-height: 230px; } }
@media (max-width: 760px) { body.weldgrid-shell .wg-pdf-group-tools { grid-template-columns: 1fr; } }
@media (max-width: 760px) { body.weldgrid-shell .wg-pdf-group-assignment { grid-template-columns: 1fr; } }
@media (max-width: 760px) { body.weldgrid-shell .wg-pdf-manager-group-tools { grid-template-columns: 1fr; } }


/* PDF Viewer weld type shape/preferences and editor select stacking fixes */
.swal2-popup.wg-weld-config-popup .form-control,
.swal2-popup.wg-weld-config-popup .form-select {
    background-color: #ffffff !important;
    color: #08233e !important;
    -webkit-text-fill-color: #08233e !important;
    opacity: 1 !important;
}

.swal2-popup.wg-weld-config-popup .form-control:disabled,
.swal2-popup.wg-weld-config-popup .form-select:disabled {
    background-color: #f1f5f9 !important;
    color: #64748b !important;
    -webkit-text-fill-color: #64748b !important;
    opacity: 1 !important;
}

.swal2-popup.wg-weld-config-popup .wg-weld-config-source {
    min-height: 38px;
}

.swal2-popup.wg-weld-config-popup .wg-weld-config-type-grid .form-select {
    cursor: pointer;
}

body.weldgrid-shell .wg-shape-source-panel {
    margin-bottom: 6px;
}

body.weldgrid-shell .wg-ann-shape-source-type #wgAnnShape + .select2-container .select2-selection,
body.weldgrid-shell .wg-ann-shape-source-type #wgAnnShape {
    cursor: not-allowed !important;
}

body.weldgrid-shell .wg-ann-modal-select2-dropdown,
body.weldgrid-shell .wg-annotation-modal .select2-dropdown {
    z-index: 2147483000 !important;
    pointer-events: auto !important;
}

body.weldgrid-shell .wg-annotation-modal .select2-container--open {
    z-index: 2147482999 !important;
}

body.weldgrid-shell .wg-fill-source-panel,
body.weldgrid-shell .wg-text-source-panel,
body.weldgrid-shell .wg-options-source-panel,
body.weldgrid-shell .wg-direction-source-panel {
    margin-bottom: 6px;
}

body.weldgrid-shell .wg-ann-fill-source-type #wgAnnFillMode + .select2-container .select2-selection,
body.weldgrid-shell .wg-ann-direction-source-type #wgAnnLeaderDirection + .select2-container .select2-selection,
body.weldgrid-shell .wg-ann-fill-source-type #wgAnnFillMode,
body.weldgrid-shell .wg-ann-text-source-type #wgAnnTextColor,
body.weldgrid-shell .wg-ann-direction-source-type #wgAnnLeaderDirection {
    cursor: not-allowed !important;
}

body.weldgrid-shell .wg-ann-options-source-type #wgAnnArrow,
body.weldgrid-shell .wg-ann-options-source-type #wgAnnRed {
    cursor: not-allowed !important;
}

.swal2-popup.wg-weld-config-popup .wg-weld-config-check {
    gap: 7px;
}

.swal2-popup.wg-weld-config-popup .wg-weld-config-check span + span {
    margin-left: 0;
}


body.weldgrid-shell .wg-spool-style-toolbar {
    display: flex;
    justify-content: flex-end;
    margin: 0 0 10px;
}

body.weldgrid-shell .wg-spool-project-prefs-inline {
    margin: 0 0 12px;
    border: 1px solid rgba(12, 46, 76, .14);
    border-radius: 12px;
    background: rgba(255, 255, 255, .68);
    padding: 12px;
}

body.weldgrid-shell .wg-spool-project-prefs-dialog {
    display: grid;
    gap: 12px;
    text-align: left;
}

body.weldgrid-shell .wg-spool-pref-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

body.weldgrid-shell .wg-spool-pref-grid label,
body.weldgrid-shell .wg-spool-pref-wide {
    display: grid;
    gap: 6px;
    color: #0d2d4b;
    font-size: 12px;
    font-weight: 900;
}

body.weldgrid-shell .wg-spool-pref-grid .swal2-input,
body.weldgrid-shell .wg-spool-pref-grid .swal2-select,
body.weldgrid-shell .wg-spool-pref-wide .swal2-input {
    width: 100% !important;
    margin: 0 !important;
}

@media (max-width: 720px) {
    body.weldgrid-shell .wg-spool-pref-grid {
        grid-template-columns: 1fr;
    }
}

body.weldgrid-shell .wg-spool-project-prefs-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 12px;
}


body.weldgrid-shell .wg-spool-pref-palette {
    display: grid;
    gap: 8px;
    border: 1px solid rgba(255, 106, 26, .18);
    border-radius: 12px;
    background: linear-gradient(135deg, #ffffff 0%, #fff7ed 100%);
    padding: 10px;
}

body.weldgrid-shell .wg-spool-pref-palette-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

body.weldgrid-shell .wg-spool-pref-palette-head strong {
    color: #0d2d4b;
    font-size: 12px;
    font-weight: 950;
}

body.weldgrid-shell .wg-spool-pref-palette-head span {
    color: #64748b;
    font-size: 11px;
    font-weight: 850;
}

body.weldgrid-shell .wg-spool-pref-color-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

body.weldgrid-shell .wg-spool-pref-color-chip {
    position: relative;
    width: 34px;
    height: 34px;
    border: 2px solid rgba(12, 46, 76, .12);
    border-radius: 10px;
    background: var(--wg-spool-pref-color, #ff6a1a);
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .75), 0 6px 14px rgba(7, 27, 47, .10);
    cursor: pointer;
}

body.weldgrid-shell .wg-spool-pref-color-chip:hover {
    border-color: rgba(255, 106, 26, .65);
    transform: translateY(-1px);
}

body.weldgrid-shell .wg-spool-pref-color-chip.is-selected {
    border-color: #ff6a1a;
    box-shadow: 0 0 0 3px rgba(255, 106, 26, .18), inset 0 0 0 2px rgba(255, 255, 255, .85);
}

body.weldgrid-shell .wg-spool-pref-color-chip.is-selected::after {
    content: "";
    position: absolute;
    right: -4px;
    top: -4px;
    width: 12px;
    height: 12px;
    border: 2px solid #ffffff;
    border-radius: 999px;
    background: #ff6a1a;
}

body.weldgrid-shell .wg-spool-pref-color-custom {
    display: inline-grid;
    place-items: center;
    background: #ffffff;
    color: #0d2d4b;
    overflow: hidden;
}

body.weldgrid-shell .wg-spool-pref-color-custom input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

body.weldgrid-shell .wg-spool-pref-color-custom span {
    font-size: 18px;
    font-weight: 950;
    line-height: 1;
}


body.weldgrid-shell .wg-annotation-context-menu .wg-context-menu-separator,
body.weldgrid-shell .wg-spool-context-menu .wg-context-menu-separator {
    height: 1px;
    margin: 5px 4px;
    background: linear-gradient(90deg, transparent 0%, rgba(12, 46, 76, .18) 18%, rgba(255, 106, 26, .30) 50%, rgba(12, 46, 76, .18) 82%, transparent 100%);
}

body.weldgrid-shell .wg-annotation-context-menu button.primary,
body.weldgrid-shell .wg-spool-context-menu button.primary {
    background: #fff7ed;
    color: #c2460c;
}

body.weldgrid-shell .wg-annotation-context-menu button.primary:hover,
body.weldgrid-shell .wg-annotation-context-menu button.primary:focus,
body.weldgrid-shell .wg-spool-context-menu button.primary:hover,
body.weldgrid-shell .wg-spool-context-menu button.primary:focus {
    background: #ffedd5;
    color: #9a3412;
}

/* =========================================================
   Welding Log Control v2 · SheetJS Virtual Workbook
========================================================= */
body.weldgrid-shell .wg-wlc-page { display: grid; gap: 14px; min-width: 0; }
body.weldgrid-shell .wg-wlc-hero { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
body.weldgrid-shell .wg-wlc-hero-actions, body.weldgrid-shell .wg-wlc-toolbar-actions, body.weldgrid-shell .wg-wlc-grid-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
body.weldgrid-shell .wg-wlc-control-card { display: grid; gap: 10px; padding: 14px; }
body.weldgrid-shell .wg-wlc-project-tools { display: flex; align-items: end; justify-content: space-between; gap: 14px; }
body.weldgrid-shell .wg-wlc-project-tools > label { display: grid; gap: 5px; width: min(480px, 100%); color: var(--wg-navy); font-size: .82rem; font-weight: 900; }
body.weldgrid-shell .wg-wlc-inline-state { padding: 9px 11px; border: 1px solid rgba(12, 46, 76, .12); border-radius: 8px; background: #f8fbfd; color: var(--wg-muted); font-size: .82rem; font-weight: 850; }
body.weldgrid-shell .wg-wlc-inline-state[data-state="loading"] { border-color: rgba(14, 165, 233, .28); background: #eff8ff; color: #075985; }
body.weldgrid-shell .wg-wlc-inline-state[data-state="ready"] { border-color: rgba(16, 185, 129, .24); background: #ecfdf5; color: #047857; }
body.weldgrid-shell .wg-wlc-inline-state[data-state="warning"] { border-color: rgba(245, 158, 11, .32); background: #fff7ed; color: #92400e; }
body.weldgrid-shell .wg-wlc-inline-state[data-state="error"] { border-color: rgba(220, 38, 38, .28); background: #fff7f7; color: #b91c1c; }
body.weldgrid-shell .wg-wlc-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; }
body.weldgrid-shell .wg-wlc-kpi { display: grid; gap: 4px; min-height: 70px; border: 1px solid rgba(12, 46, 76, .1); border-radius: 8px; background: #fff; box-shadow: 0 8px 20px rgba(7, 27, 47, .05); padding: 11px 12px; }
body.weldgrid-shell .wg-wlc-kpi strong { overflow: hidden; color: var(--wg-navy); font-size: 1.05rem; font-weight: 950; text-overflow: ellipsis; white-space: nowrap; }
body.weldgrid-shell .wg-wlc-kpi span { color: var(--wg-muted); font-size: .72rem; font-weight: 900; text-transform: uppercase; }
body.weldgrid-shell .wg-wlc-latest-card { padding: 14px; }
body.weldgrid-shell .wg-wlc-status-chip, body.weldgrid-shell .wg-wlc-workbook-badge { display: inline-flex; align-items: center; min-height: 27px; border-radius: 999px; background: #eef4f8; color: var(--wg-muted); padding: 4px 9px; font-size: .74rem; font-weight: 950; white-space: nowrap; }
body.weldgrid-shell .wg-wlc-status-chip[data-state="done"] { background: #dcfce7; color: #047857; }
body.weldgrid-shell .wg-wlc-status-chip[data-state="loading"] { background: #e0f2fe; color: #075985; }
body.weldgrid-shell .wg-wlc-workbook-card { min-width: 0; overflow: hidden; padding: 14px; }
body.weldgrid-shell .wg-wlc-grid-head { align-items: flex-start; margin-bottom: 10px; }
body.weldgrid-shell .wg-wlc-workbook-loading { display: grid; gap: 7px; margin: 8px 0 10px; border: 1px solid rgba(14, 116, 144, .22); border-radius: 8px; background: #eff8ff; padding: 10px 12px; }
body.weldgrid-shell .wg-wlc-workbook-loading[hidden] { display: none !important; }
body.weldgrid-shell .wg-wlc-workbook-loading > div:first-child { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--wg-navy); font-size: .83rem; font-weight: 900; }
body.weldgrid-shell .wg-wlc-workbook-loading small { color: var(--wg-muted); font-size: .74rem; font-weight: 800; }
body.weldgrid-shell .wg-wlc-loading-track { height: 9px; overflow: hidden; border-radius: 999px; background: #dbe7f0; }
body.weldgrid-shell .wg-wlc-loading-track i { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--wg-cyan), var(--wg-orange)); transition: width .18s ease; }
body.weldgrid-shell .wg-wlc-sheet-tabs { display: flex; align-items: center; gap: 6px; margin: 2px 0 9px; padding-bottom: 5px; overflow-x: auto; scrollbar-width: thin; }
body.weldgrid-shell .wg-wlc-sheet-tabs button { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 7px; min-height: 36px; border: 1px solid rgba(12, 46, 76, .14); border-radius: 999px; background: #fff; color: var(--wg-navy); padding: 6px 10px; font-size: .78rem; font-weight: 900; }
body.weldgrid-shell .wg-wlc-sheet-tabs button span { color: var(--wg-muted); font-size: .68rem; font-weight: 850; }
body.weldgrid-shell .wg-wlc-sheet-tabs button em { border-radius: 999px; background: #eef4f8; color: #64748b; padding: 2px 5px; font-size: .62rem; font-style: normal; }
body.weldgrid-shell .wg-wlc-sheet-tabs button.is-active { border-color: var(--wg-orange); background: #fff7ed; color: #c2410c; box-shadow: inset 0 0 0 1px rgba(255, 106, 26, .08); }
body.weldgrid-shell .wg-wlc-view-toolbar { display: grid; grid-template-columns: minmax(180px, .75fr) minmax(240px, 1.25fr) minmax(170px, .7fr) auto auto; gap: 8px; align-items: end; margin-bottom: 9px; }
body.weldgrid-shell .wg-wlc-view-toolbar[hidden] { display: none !important; }
body.weldgrid-shell .wg-wlc-view-toolbar label { display: grid; gap: 4px; color: var(--wg-muted); font-size: .7rem; font-weight: 900; }
body.weldgrid-shell .wg-wlc-view-toolbar .form-control, body.weldgrid-shell .wg-wlc-view-toolbar .form-select { min-height: 38px; font-size: .8rem; font-weight: 800; }
body.weldgrid-shell .wg-wlc-workbook-warning { margin: 0 0 9px; border: 1px solid rgba(245, 158, 11, .32); border-radius: 8px; background: #fff7ed; color: #92400e; padding: 9px 10px; font-size: .8rem; font-weight: 850; }
body.weldgrid-shell .wg-wlc-workbook-warning[hidden] { display: none !important; }
body.weldgrid-shell .wg-wlc-grid-empty { display: grid; place-items: center; min-height: 420px; border: 1px dashed rgba(12, 46, 76, .18); border-radius: 8px; background: #f8fbfd; color: var(--wg-muted); padding: 20px; font-weight: 850; text-align: center; }
body.weldgrid-shell .wg-wlc-grid-empty[hidden] { display: none !important; }
body.weldgrid-shell .wg-wlc-grid-viewport { position: relative; width: 100%; height: clamp(520px, 67vh, 780px); min-height: 520px; overflow: auto; border: 1px solid rgba(12, 46, 76, .16); border-radius: 8px; background: #f3f7fa; overscroll-behavior: contain; contain: strict; }
body.weldgrid-shell .wg-wlc-grid-viewport[hidden] { display: none !important; }
body.weldgrid-shell .wg-wlc-grid-canvas { position: relative; min-width: 100%; min-height: 100%; background: #fff; }
body.weldgrid-shell .wg-wlc-grid-layer { position: absolute; inset: 0; }
body.weldgrid-shell .wg-wlc-grid-cell, body.weldgrid-shell .wg-wlc-column-header, body.weldgrid-shell .wg-wlc-row-header, body.weldgrid-shell .wg-wlc-grid-corner { position: absolute; box-sizing: border-box; border-right: 1px solid #d8e3eb; border-bottom: 1px solid #d8e3eb; }
body.weldgrid-shell .wg-wlc-grid-cell { display: flex; align-items: center; min-width: 0; overflow: hidden; background: #fff; color: #102f4b; padding: 4px 7px; font-size: .78rem; font-weight: 700; white-space: nowrap; }
body.weldgrid-shell .wg-wlc-grid-cell > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.weldgrid-shell .wg-wlc-grid-cell > i { margin-left: auto; color: #6d28d9; font-size: .64rem; font-style: normal; font-weight: 950; }
body.weldgrid-shell .wg-wlc-grid-cell.is-empty { color: #94a3b8; }
body.weldgrid-shell .wg-wlc-grid-cell.is-formula { background: #faf7ff; }
body.weldgrid-shell .wg-wlc-grid-cell.is-editable { background: #f2fbf7; cursor: cell; box-shadow: inset 0 0 0 1px rgba(16, 185, 129, .08); }
body.weldgrid-shell .wg-wlc-grid-cell.is-editable:hover { background: #e8f8f0; box-shadow: inset 0 0 0 2px rgba(16, 185, 129, .2); }
body.weldgrid-shell .wg-wlc-grid-cell.is-dirty { background: #fff7ed; box-shadow: inset 0 0 0 2px rgba(255, 106, 26, .28); }
body.weldgrid-shell .wg-wlc-grid-editor { width: 100%; height: calc(100% - 2px); min-width: 0; border: 1px solid var(--wg-orange); border-radius: 4px; outline: 0; background: #fff; color: var(--wg-navy); padding: 3px 5px; font: inherit; font-weight: 800; }
body.weldgrid-shell .wg-wlc-column-header { z-index: 30; display: flex; align-items: center; gap: 6px; overflow: hidden; background: #eaf2f7; color: var(--wg-navy); padding: 4px 7px; box-shadow: 0 2px 5px rgba(7, 27, 47, .06); }
body.weldgrid-shell .wg-wlc-column-header strong { flex: 0 0 auto; color: #0f5f82; font-size: .72rem; font-weight: 950; }
body.weldgrid-shell .wg-wlc-column-header span { overflow: hidden; font-size: .7rem; font-weight: 850; text-overflow: ellipsis; white-space: nowrap; }
body.weldgrid-shell .wg-wlc-row-header { z-index: 29; display: flex; align-items: center; justify-content: center; background: #edf3f7; color: #60758a; font-size: .7rem; font-weight: 900; }
body.weldgrid-shell .wg-wlc-grid-corner { z-index: 40; background: #dce8ef; box-shadow: 2px 2px 6px rgba(7, 27, 47, .08); }
body.weldgrid-shell .wg-wlc-grid-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; color: var(--wg-muted); font-size: .74rem; font-weight: 850; }
body.weldgrid-shell .wg-wlc-grid-footer[hidden] { display: none !important; }
body.weldgrid-shell .wg-wlc-choice-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
body.weldgrid-shell .wg-wlc-choice-grid button { display: grid; place-items: center; gap: 8px; min-height: 168px; border: 1px solid rgba(12, 46, 76, .14); border-radius: 14px; background: #fff; color: var(--wg-navy); padding: 18px; text-align: center; }
body.weldgrid-shell .wg-wlc-choice-grid button:hover { border-color: var(--wg-orange); background: #fff8f3; transform: translateY(-1px); }
body.weldgrid-shell .wg-wlc-choice-grid button i { display: grid; place-items: center; width: 54px; height: 54px; border-radius: 999px; background: #0b4c70; color: #fff; font-size: 1.55rem; }
body.weldgrid-shell .wg-wlc-choice-grid button strong { font-size: 1rem; font-weight: 950; }
body.weldgrid-shell .wg-wlc-choice-grid button span { color: var(--wg-muted); font-size: .8rem; font-weight: 800; line-height: 1.4; }
body.weldgrid-shell .wg-wlc-production-selector { display: grid; gap: 12px; text-align: left; }
body.weldgrid-shell .wg-wlc-production-locked { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; border: 1px solid rgba(14, 116, 144, .18); border-radius: 8px; background: #eff8ff; padding: 9px 10px; }
body.weldgrid-shell .wg-wlc-production-locked strong { margin-right: auto; color: var(--wg-navy); font-weight: 950; }
body.weldgrid-shell .wg-wlc-production-locked span { border-radius: 999px; background: #fff; color: #0f5f82; padding: 4px 8px; font-size: .76rem; font-weight: 900; }
body.weldgrid-shell .wg-wlc-production-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
body.weldgrid-shell .wg-wlc-production-columns section { min-width: 0; border: 1px solid rgba(12, 46, 76, .12); border-radius: 8px; background: #f8fbfd; padding: 10px; }
body.weldgrid-shell .wg-wlc-production-columns h4 { margin: 0 0 8px; color: var(--wg-navy); font-size: .86rem; font-weight: 950; }
body.weldgrid-shell #wgWlcAvailableColumns, body.weldgrid-shell #wgWlcSelectedColumns { display: grid; gap: 6px; max-height: 390px; overflow: auto; padding-right: 3px; }
body.weldgrid-shell #wgWlcAvailableColumns button { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 8px; align-items: center; width: 100%; border: 1px solid rgba(12, 46, 76, .1); border-radius: 7px; background: #fff; color: var(--wg-navy); padding: 8px 9px; text-align: left; }
body.weldgrid-shell #wgWlcAvailableColumns button strong { font-size: .8rem; font-weight: 900; }
body.weldgrid-shell #wgWlcAvailableColumns button span { grid-column: 1; color: var(--wg-muted); font-size: .68rem; font-weight: 800; }
body.weldgrid-shell #wgWlcAvailableColumns button i { grid-column: 2; grid-row: 1 / 3; color: var(--wg-orange); font-size: 1rem; }
body.weldgrid-shell #wgWlcSelectedColumns > div { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto auto auto; gap: 5px; align-items: center; border: 1px solid rgba(12, 46, 76, .1); border-radius: 7px; background: #fff; padding: 7px; }
body.weldgrid-shell #wgWlcSelectedColumns > div > span { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 999px; background: #eef6fb; color: #0f5f82; font-size: .7rem; font-weight: 950; }
body.weldgrid-shell #wgWlcSelectedColumns > div > strong { min-width: 0; overflow: hidden; color: var(--wg-navy); font-size: .78rem; font-weight: 900; text-overflow: ellipsis; white-space: nowrap; }
body.weldgrid-shell #wgWlcSelectedColumns > div > small { display: none; }
body.weldgrid-shell #wgWlcSelectedColumns button { display: grid; place-items: center; width: 27px; height: 27px; border: 1px solid rgba(12, 46, 76, .12); border-radius: 6px; background: #f8fbfd; color: var(--wg-navy); }
body.weldgrid-shell #wgWlcSelectedColumns button:disabled { opacity: .35; }
body.weldgrid-shell .wg-wlc-job-progress { display: grid; gap: 8px; text-align: left; }
body.weldgrid-shell .wg-wlc-job-progress > div:first-child { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--wg-navy); font-weight: 900; }
body.weldgrid-shell .wg-wlc-job-progress > div:nth-child(2) { height: 10px; overflow: hidden; border-radius: 999px; background: #dbe7f0; }
body.weldgrid-shell .wg-wlc-job-progress > div:nth-child(2) i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--wg-cyan), var(--wg-orange)); transition: width .2s ease; }
body.weldgrid-shell .wg-wlc-job-progress small { color: var(--wg-muted); font-weight: 800; }
body.weldgrid-shell .wg-wlc-report-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; }
body.weldgrid-shell .wg-wlc-report-kpis span { display: grid; gap: 3px; border: 1px solid rgba(12, 46, 76, .1); border-radius: 8px; background: #f8fbfd; padding: 9px; text-align: center; }
body.weldgrid-shell .wg-wlc-report-kpis strong { color: var(--wg-navy); font-size: 1rem; font-weight: 950; }
body.weldgrid-shell .wg-wlc-report-kpis small { color: var(--wg-muted); font-size: .7rem; font-weight: 850; }
@media (max-width: 1100px) { body.weldgrid-shell .wg-wlc-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } body.weldgrid-shell .wg-wlc-view-toolbar { grid-template-columns: repeat(2, minmax(0, 1fr)); } body.weldgrid-shell .wg-wlc-production-columns { grid-template-columns: 1fr; } }
@media (max-width: 760px) { body.weldgrid-shell .wg-wlc-hero, body.weldgrid-shell .wg-wlc-project-tools, body.weldgrid-shell .wg-wlc-grid-footer { align-items: stretch; flex-direction: column; } body.weldgrid-shell .wg-wlc-kpis, body.weldgrid-shell .wg-wlc-view-toolbar, body.weldgrid-shell .wg-wlc-choice-grid, body.weldgrid-shell .wg-wlc-report-kpis { grid-template-columns: 1fr; } body.weldgrid-shell .wg-wlc-grid-viewport { height: 60vh; min-height: 420px; } }


/* =========================================================
   Welding Log Control v3 · Workbook Editing UX Additions
========================================================= */
body.weldgrid-shell .wg-wlc-save-status {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    border: 1px solid rgba(12, 46, 76, .12);
    border-radius: 999px;
    background: #f8fbfd;
    color: #60758a;
    padding: 5px 10px;
    font-size: .74rem;
    font-weight: 900;
    white-space: nowrap;
}

body.weldgrid-shell .wg-wlc-save-status[hidden] {
    display: none !important;
}

body.weldgrid-shell .wg-wlc-save-status[data-state="dirty"] {
    border-color: rgba(245, 158, 11, .32);
    background: #fff7ed;
    color: #92400e;
}

body.weldgrid-shell .wg-wlc-save-status[data-state="loading"] {
    border-color: rgba(14, 116, 144, .26);
    background: #eff8ff;
    color: #0f5f82;
}

body.weldgrid-shell .wg-wlc-save-status[data-state="ready"] {
    border-color: rgba(16, 185, 129, .24);
    background: #ecfdf5;
    color: #047857;
}

body.weldgrid-shell .wg-wlc-save-status[data-state="error"] {
    border-color: rgba(220, 38, 38, .28);
    background: #fff7f7;
    color: #b91c1c;
}

body.weldgrid-shell .wg-wlc-grid-cell.is-readonly {
    background: #f7fafc;
    color: #718096;
    cursor: default;
}

body.weldgrid-shell .wg-wlc-grid-cell.is-readonly:hover {
    box-shadow: inset 0 0 0 1px rgba(100, 116, 139, .18);
}

body.weldgrid-shell .wg-wlc-grid-cell.is-selected {
    box-shadow: inset 0 0 0 2px rgba(14, 116, 144, .34);
}

body.weldgrid-shell .wg-wlc-column-header button {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 24px;
    height: 24px;
    margin-left: auto;
    border: 1px solid rgba(12, 46, 76, .12);
    border-radius: 6px;
    background: #ffffff;
    color: #0f5f82;
    font-size: .82rem;
}

body.weldgrid-shell .wg-wlc-column-header button:hover {
    border-color: rgba(255, 106, 26, .55);
    color: #c2410c;
}

body.weldgrid-shell .wg-wlc-column-filter-popup {
    position: fixed;
    z-index: 50020;
    display: grid;
    gap: 8px;
    width: 310px;
    max-height: 410px;
    border: 1px solid rgba(12, 46, 76, .18);
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 18px 44px rgba(7, 27, 47, .22);
    padding: 10px;
}

body.weldgrid-shell .wg-wlc-filter-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    color: var(--wg-navy);
    font-size: .82rem;
    font-weight: 950;
}

body.weldgrid-shell .wg-wlc-filter-head button {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border: 1px solid rgba(12, 46, 76, .12);
    border-radius: 6px;
    background: #f8fbfd;
    color: var(--wg-navy);
}

body.weldgrid-shell .wg-wlc-filter-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

body.weldgrid-shell .wg-wlc-filter-actions button {
    border: 1px solid rgba(12, 46, 76, .12);
    border-radius: 6px;
    background: #f8fbfd;
    color: #0f5f82;
    padding: 5px 8px;
    font-size: .72rem;
    font-weight: 900;
}

body.weldgrid-shell .wg-wlc-filter-values {
    display: grid;
    gap: 2px;
    max-height: 210px;
    overflow: auto;
    border: 1px solid rgba(12, 46, 76, .08);
    border-radius: 7px;
    background: #fbfdff;
    padding: 5px;
}

body.weldgrid-shell .wg-wlc-filter-values label {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 7px;
    min-height: 28px;
    border-radius: 5px;
    padding: 3px 5px;
    color: var(--wg-navy);
    font-size: .76rem;
    font-weight: 800;
}

body.weldgrid-shell .wg-wlc-filter-values label:hover {
    background: #eef6fb;
}

body.weldgrid-shell .wg-wlc-filter-values span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body.weldgrid-shell .wg-wlc-filter-values small {
    color: #64748b;
    font-size: .68rem;
    font-weight: 850;
}

body.weldgrid-shell .wg-wlc-filter-footer {
    display: flex;
    justify-content: flex-end;
    gap: 7px;
}

body.weldgrid-shell .wg-wlc-general-options {
    display: grid;
    gap: 10px;
    text-align: left;
}

body.weldgrid-shell .wg-wlc-general-options label {
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid rgba(12, 46, 76, .12);
    border-radius: 8px;
    background: #ffffff;
    padding: 12px;
    color: var(--wg-navy);
    font-size: .88rem;
    font-weight: 900;
}

body.weldgrid-shell .wg-wlc-modal-warning {
    border: 1px solid rgba(245, 158, 11, .34);
    border-radius: 8px;
    background: #fff7ed;
    color: #92400e;
    padding: 9px 10px;
    font-size: .82rem;
    font-weight: 850;
}

body.weldgrid-shell .wg-wlc-report-table {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
    text-align: left;
}

body.weldgrid-shell .wg-wlc-report-table div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border: 1px solid rgba(12, 46, 76, .1);
    border-radius: 8px;
    background: #f8fbfd;
    padding: 8px 9px;
}

body.weldgrid-shell .wg-wlc-report-table span {
    color: #64748b;
    font-size: .72rem;
    font-weight: 850;
}

body.weldgrid-shell .wg-wlc-report-table strong {
    min-width: 0;
    overflow: hidden;
    color: var(--wg-navy);
    font-size: .8rem;
    font-weight: 950;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body.weldgrid-shell .wg-wlc-report-messages {
    display: grid;
    gap: 5px;
    margin-top: 10px;
    text-align: left;
}

body.weldgrid-shell .wg-wlc-report-messages p {
    margin: 0;
    border-left: 3px solid #f59e0b;
    background: #fff7ed;
    color: #92400e;
    padding: 6px 8px;
    font-size: .76rem;
    font-weight: 800;
}

body.weldgrid-shell .wg-wlc-job-progress ul {
    display: grid;
    gap: 4px;
    margin: 2px 0 0;
    padding-left: 18px;
    color: #92400e;
    font-size: .76rem;
    font-weight: 800;
}

@media (max-width: 760px) {
    body.weldgrid-shell .wg-wlc-report-table {
        grid-template-columns: 1fr;
    }
}

/* Welding Log Control interaction refinements */
body.weldgrid-shell .wg-wlc-filter-text {
    position: relative;
}

body.weldgrid-shell .wg-wlc-filter-text input {
    padding-right: 40px;
}

body.weldgrid-shell .wg-wlc-filter-text.is-searching::after {
    content: "";
    position: absolute;
    right: 14px;
    bottom: 13px;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(15, 95, 130, .18);
    border-top-color: #ff6a1a;
    border-radius: 999px;
    pointer-events: none;
    animation: wg-wlc-search-spin .75s linear infinite;
}

body.weldgrid-shell .wg-wlc-column-header.has-active-filter {
    background: #fff7ed;
}

body.weldgrid-shell .wg-wlc-column-header button.is-filter-active {
    border-color: rgba(255, 106, 26, .76);
    background: #ff6a1a;
    color: #ffffff;
    box-shadow: 0 0 0 0 rgba(255, 106, 26, .42);
    animation: wg-wlc-filter-pulse 1.15s ease-in-out infinite;
}

body.weldgrid-shell .wg-wlc-grid-cell.is-selected {
    background: #eaf7ff;
    box-shadow: inset 0 0 0 1px rgba(37, 99, 235, .44);
}

body.weldgrid-shell .wg-wlc-grid-cell.is-active-cell {
    box-shadow: inset 0 0 0 2px #ff6a1a;
}

body.weldgrid-shell .wg-wlc-grid-cell.is-selected.is-active-cell {
    box-shadow: inset 0 0 0 2px #ff6a1a, inset 0 0 0 4px rgba(255, 255, 255, .72);
}

body.weldgrid-shell .wg-wlc-production-mode-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 12px;
    text-align: left;
}

body.weldgrid-shell .wg-wlc-production-mode-options label {
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid rgba(12, 46, 76, .12);
    border-radius: 8px;
    background: #ffffff;
    padding: 12px;
    color: var(--wg-navy);
    font-size: .86rem;
    font-weight: 900;
}

@keyframes wg-wlc-search-spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes wg-wlc-filter-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 106, 26, .42);
    }

    70% {
        box-shadow: 0 0 0 7px rgba(255, 106, 26, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(255, 106, 26, 0);
    }
}

@media (max-width: 760px) {
    body.weldgrid-shell .wg-wlc-production-mode-options {
        grid-template-columns: 1fr;
    }
}

/* Welding Log Control mapped columns and progress polish */
body.weldgrid-shell .wg-wlc-grid-cell.is-mapped {
    background: #f5f0ff;
    color: #4c1d95;
    box-shadow: inset 0 0 0 1px rgba(124, 58, 237, .12);
}

body.weldgrid-shell .wg-wlc-grid-cell.is-mapped:hover {
    box-shadow: inset 0 0 0 2px rgba(124, 58, 237, .24);
}

body.weldgrid-shell .wg-wlc-grid-cell.is-dirty {
    background: #fff7ed;
    color: #7c2d12;
    box-shadow: inset 0 0 0 2px rgba(255, 106, 26, .34);
}

body.weldgrid-shell .wg-wlc-column-header.has-mapped-lock {
    background: #efe7ff;
    color: #4c1d95;
}

body.weldgrid-shell .wg-wlc-column-header.has-mapped-lock strong {
    color: #6d28d9;
}

body.weldgrid-shell .wg-wlc-column-header.has-manual-cells {
    background: #edfdf5;
}

body.weldgrid-shell .wg-wlc-column-header.has-dirty-cells {
    background: #fff7ed;
}

body.weldgrid-shell .wg-wlc-column-header button.wg-wlc-column-lock {
    border-color: rgba(124, 58, 237, .24);
    background: #ffffff;
    color: #6d28d9;
}

body.weldgrid-shell .wg-wlc-column-header button.wg-wlc-column-lock:hover {
    border-color: rgba(124, 58, 237, .46);
    background: #f5f0ff;
    color: #4c1d95;
}

body.weldgrid-shell .wg-wlc-cell-marker.ri-lock-2-line {
    color: #6d28d9;
}

body.weldgrid-shell .wg-wlc-modal-info {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    border: 1px solid rgba(124, 58, 237, .22);
    border-radius: 8px;
    background: #f5f0ff;
    color: #4c1d95;
    padding: 9px 10px;
    font-size: .82rem;
    font-weight: 850;
}

body.weldgrid-shell .wg-wlc-modal-info i {
    margin-top: 1px;
    color: #6d28d9;
}

body.weldgrid-shell .swal2-html-container .wg-wlc-progress-dialog {
    width: 100%;
    max-height: none;
    border: 0;
    box-shadow: none;
    padding: 0;
}

body.weldgrid-shell .wg-wlc-progress-dialog[data-state="done"] .wg-export-progress-track span {
    background: linear-gradient(90deg, #16a34a, #0f766e);
}

body.weldgrid-shell .wg-wlc-progress-dialog[data-state="failed"] .wg-export-progress-track span {
    background: linear-gradient(90deg, #dc2626, #f97316);
}

body.weldgrid-shell .wg-wlc-progress-dialog .wg-export-progress-warnings span {
    display: block;
}

body.weldgrid-shell .wg-wlc-grid-cell.is-mapped.is-selected {
    box-shadow: inset 0 0 0 1px rgba(37, 99, 235, .42), inset 0 0 0 3px rgba(124, 58, 237, .14);
}

body.weldgrid-shell .wg-wlc-grid-cell.is-mapped.is-active-cell {
    box-shadow: inset 0 0 0 2px #ff6a1a, inset 0 0 0 4px rgba(255, 255, 255, .72);
}

/* =========================================================
   Welding Log Control Cell States
========================================================= */
body.weldgrid-shell .wg-wlc-grid-legend {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin: 8px 0 10px;
    color: #475569;
    font-size: .72rem;
    font-weight: 850;
}

body.weldgrid-shell .wg-wlc-grid-legend[hidden] {
    display: none !important;
}

body.weldgrid-shell .wg-wlc-grid-legend span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 24px;
    border: 1px solid rgba(12, 46, 76, .1);
    border-radius: 999px;
    background: #ffffff;
    padding: 3px 8px;
}

body.weldgrid-shell .wg-wlc-grid-legend i {
    display: inline-grid;
    place-items: center;
    width: 13px;
    height: 13px;
    border-radius: 4px;
    font-size: .56rem;
    font-style: normal;
    font-weight: 950;
    line-height: 1;
}

body.weldgrid-shell .wg-wlc-grid-legend .is-mapped i {
    background: #f3e8ff;
    box-shadow: inset 0 0 0 1px #c084fc;
}

body.weldgrid-shell .wg-wlc-grid-legend .is-editable i {
    background: #ecfdf5;
    box-shadow: inset 0 0 0 1px #34d399;
}

body.weldgrid-shell .wg-wlc-grid-legend .is-dirty i {
    background: #fff7ed;
    box-shadow: inset 0 0 0 1px #fb923c;
}

body.weldgrid-shell .wg-wlc-grid-legend .is-formula i {
    background: #faf5ff;
    color: #6b21a8;
    box-shadow: inset 0 0 0 1px #c084fc;
}

body.weldgrid-shell .wg-wlc-column-header.wg-wlc-column-mapped {
    background: #f3e8ff;
    color: #6b21a8;
    box-shadow: inset 0 0 0 1px rgba(192, 132, 252, .58), 0 2px 5px rgba(107, 33, 168, .08);
}

body.weldgrid-shell .wg-wlc-column-header.wg-wlc-column-mapped strong {
    color: #6b21a8;
}

body.weldgrid-shell .wg-wlc-column-header.wg-wlc-column-locked {
    border-bottom-color: #c084fc;
}

body.weldgrid-shell .wg-wlc-column-header.wg-wlc-column-unlocked {
    background: #faf5ff;
    color: #6b21a8;
    box-shadow: inset 0 0 0 2px rgba(192, 132, 252, .7), 0 2px 5px rgba(107, 33, 168, .08);
}

body.weldgrid-shell .wg-wlc-column-header.wg-wlc-column-editable {
    background: #ecfdf5;
    color: #047857;
    box-shadow: inset 0 0 0 1px rgba(52, 211, 153, .42), 0 2px 5px rgba(4, 120, 87, .06);
}

body.weldgrid-shell .wg-wlc-column-header.wg-wlc-column-editable strong {
    color: #047857;
}

body.weldgrid-shell .wg-wlc-column-header.wg-wlc-column-dirty {
    background: #fff7ed;
    color: #c2410c;
    box-shadow: inset 0 0 0 2px rgba(251, 146, 60, .78), 0 2px 5px rgba(194, 65, 12, .08);
}

body.weldgrid-shell .wg-wlc-column-header.wg-wlc-column-dirty strong {
    color: #c2410c;
}

body.weldgrid-shell .wg-wlc-grid-cell.is-mapped {
    background: rgba(168, 85, 247, .08);
    color: #4c1d95;
    box-shadow: inset 0 0 0 1px rgba(168, 85, 247, .24);
}

body.weldgrid-shell .wg-wlc-grid-cell.is-mapped.is-mapped-locked {
    cursor: not-allowed;
}

body.weldgrid-shell .wg-wlc-grid-cell.is-mapped.is-mapped-unlocked {
    background: #faf5ff;
    color: #581c87;
    cursor: cell;
    box-shadow: inset 0 0 0 2px rgba(168, 85, 247, .32);
}

body.weldgrid-shell .wg-wlc-grid-cell.is-readonly {
    background: #f8fafc;
    color: #64748b;
    cursor: not-allowed;
}

body.weldgrid-shell .wg-wlc-grid-cell.is-hard-readonly {
    background: #f1f5f9;
    color: #64748b;
    cursor: not-allowed;
}

body.weldgrid-shell .wg-wlc-grid-cell.is-hand-editable {
    background: #ecfdf5;
    color: #064e3b;
    cursor: cell;
    box-shadow: inset 0 0 0 1px rgba(52, 211, 153, .32);
}

body.weldgrid-shell .wg-wlc-grid-cell.is-hand-editable:hover {
    background: #dffbf0;
    box-shadow: inset 0 0 0 2px rgba(16, 185, 129, .32);
}

body.weldgrid-shell .wg-wlc-grid-cell.is-dirty {
    background: #fff7ed;
    color: #c2410c;
    box-shadow: inset 0 0 0 2px rgba(251, 146, 60, .82);
}

body.weldgrid-shell .wg-wlc-grid-cell.is-formula {
    background: #faf5ff;
    color: #6b21a8;
    cursor: not-allowed;
    box-shadow: inset 0 0 0 1px rgba(192, 132, 252, .4);
}

body.weldgrid-shell .wg-wlc-grid-cell.is-formula.is-dirty {
    background: #fff7ed;
    color: #c2410c;
}

body.weldgrid-shell .wg-wlc-cell-marker {
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    margin-left: auto;
    color: #6b21a8;
    font-size: .68rem;
    font-style: normal;
    font-weight: 950;
}

body.weldgrid-shell .wg-wlc-column-lock {
    border-color: #c084fc !important;
    background: #ffffff !important;
    color: #6b21a8 !important;
}

body.weldgrid-shell .wg-wlc-column-lock:hover {
    border-color: #a855f7 !important;
    background: #faf5ff !important;
    color: #581c87 !important;
}

body.weldgrid-shell .wg-wlc-column-header.wg-wlc-column-unlocked .wg-wlc-column-lock {
    background: #f3e8ff !important;
    color: #581c87 !important;
}

body.weldgrid-shell .wg-wlc-header-badge {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    max-width: 92px;
    overflow: hidden;
    border: 1px solid rgba(192, 132, 252, .58);
    border-radius: 999px;
    background: #ffffff;
    color: #6b21a8;
    padding: 2px 6px;
    font-size: .58rem;
    font-weight: 950;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body.weldgrid-shell .wg-wlc-column-header.wg-wlc-column-dirty .wg-wlc-header-badge {
    border-color: rgba(251, 146, 60, .7);
    background: #ffffff;
    color: #c2410c;
}

body.weldgrid-shell .wg-wlc-column-header.wg-wlc-column-unlocked .wg-wlc-header-badge {
    border-color: rgba(168, 85, 247, .65);
    background: #f3e8ff;
    color: #581c87;
}

body.weldgrid-shell .wg-wlc-grid-cell.is-mapped.is-readonly:not(.is-hard-readonly):not(.is-dirty) {
    background: rgba(168, 85, 247, .08);
    color: #4c1d95;
    box-shadow: inset 0 0 0 1px rgba(168, 85, 247, .24);
}

body.weldgrid-shell .wg-wlc-grid-cell.is-mapped.is-readonly:not(.is-hard-readonly):not(.is-dirty):hover {
    box-shadow: inset 0 0 0 2px rgba(168, 85, 247, .34);
}


/* =========================================================
   Welding Log Control Excel Selection / Clipboard
========================================================= */
body.weldgrid-shell .wg-wlc-excel-commandbar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    flex-wrap: wrap;
}

body.weldgrid-shell .wg-wlc-excel-commandbar .wg-btn {
    min-height: 32px;
    padding: 6px 9px;
    font-size: .74rem;
}

body.weldgrid-shell .wg-wlc-excel-commandbar .wg-btn:disabled {
    opacity: .46;
    cursor: not-allowed;
    filter: grayscale(.3);
}

body.weldgrid-shell .wg-wlc-selection-status {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    border: 1px solid rgba(12, 46, 76, .12);
    border-radius: 999px;
    background: #f8fbfd;
    color: #60758a;
    padding: 5px 9px;
    font-size: .7rem;
    font-weight: 900;
    white-space: nowrap;
}

body.weldgrid-shell .wg-wlc-selection-status[data-state="selected"] {
    border-color: rgba(37, 99, 235, .32);
    background: #eff6ff;
    color: #1d4ed8;
}

body.weldgrid-shell .wg-wlc-grid-viewport,
body.weldgrid-shell .wg-wlc-grid-layer,
body.weldgrid-shell .wg-wlc-grid-cell {
    user-select: none;
    -webkit-user-select: none;
}

body.weldgrid-shell .wg-wlc-grid-cell.is-selected {
    position: absolute;
    z-index: 4;
    box-shadow: inset 0 0 0 2px rgba(37, 99, 235, .72) !important;
}

body.weldgrid-shell .wg-wlc-grid-cell.is-selected:not(.is-dirty) {
    background-image: linear-gradient(rgba(37, 99, 235, .08), rgba(37, 99, 235, .08));
}

body.weldgrid-shell .wg-wlc-grid-cell.is-active-cell {
    z-index: 5;
    box-shadow: inset 0 0 0 2px #2563eb, inset 0 0 0 4px rgba(255, 255, 255, .88) !important;
}

body.weldgrid-shell .wg-wlc-grid-cell.is-dirty.is-selected {
    background: #fff7ed;
    box-shadow: inset 0 0 0 2px #2563eb, inset 0 0 0 4px rgba(251, 146, 60, .5) !important;
}

body.weldgrid-shell .wg-wlc-grid-cell.is-mapped.is-selected {
    background: #f3e8ff;
    box-shadow: inset 0 0 0 2px #2563eb, inset 0 0 0 4px rgba(168, 85, 247, .28) !important;
}

body.weldgrid-shell .wg-wlc-grid-cell.is-formula.is-selected {
    background: #faf5ff;
    box-shadow: inset 0 0 0 2px #2563eb, inset 0 0 0 4px rgba(192, 132, 252, .24) !important;
}

body.weldgrid-shell .wg-wlc-grid-editor {
    user-select: text;
    -webkit-user-select: text;
}

@media (max-width: 1180px) {
    body.weldgrid-shell .wg-wlc-grid-actions {
        align-items: stretch;
        flex-direction: column;
    }

    body.weldgrid-shell .wg-wlc-excel-commandbar {
        justify-content: flex-start;
    }
}

/* =========================================================
   Welding Log Control Excel UX / Fullscreen / Loading
========================================================= */
body.weldgrid-shell .wg-wlc-view-toolbar .select2-container,
body.weldgrid-shell .wg-wlc-project-tools .select2-container {
    width: 100% !important;
    min-width: 0;
}

body.weldgrid-shell .wg-wlc-view-toolbar .select2-selection--single,
body.weldgrid-shell .wg-wlc-project-tools .select2-selection--single,
body.weldgrid-shell .wg-wlc-select2-selection {
    min-height: 42px !important;
    border: 1px solid rgba(12, 46, 76, .18) !important;
    border-radius: 8px !important;
    background: #ffffff !important;
}

body.weldgrid-shell .wg-wlc-view-toolbar .select2-selection__rendered,
body.weldgrid-shell .wg-wlc-project-tools .select2-selection__rendered,
body.weldgrid-shell .wg-wlc-select2-selection .select2-selection__rendered {
    min-height: 40px;
    padding: 8px 38px 8px 12px !important;
    color: #08233e !important;
    font-size: 13px;
    font-weight: 900;
    line-height: 24px !important;
}

body.weldgrid-shell .wg-wlc-view-toolbar .select2-selection__arrow,
body.weldgrid-shell .wg-wlc-project-tools .select2-selection__arrow {
    top: 8px !important;
    right: 8px !important;
}

body.weldgrid-shell .wg-wlc-select2-dropdown {
    z-index: 50080;
    border: 1px solid #cbdcea;
    border-radius: 8px;
    box-shadow: 0 16px 34px rgba(7, 27, 47, .2);
    overflow: hidden;
}

body.weldgrid-shell .wg-wlc-column-header {
    min-width: 0;
    gap: 5px;
    padding: 5px 6px;
    overflow: hidden;
}

body.weldgrid-shell .wg-wlc-column-header .wg-wlc-header-label {
    flex: 1 1 auto;
    min-width: 42px;
    overflow: hidden;
    color: inherit;
    font-size: 11px;
    font-weight: 950;
    line-height: 1.15;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body.weldgrid-shell .wg-wlc-column-header .wg-wlc-header-badge {
    flex: 0 0 auto;
    max-width: none;
    padding-inline: 6px;
}

body.weldgrid-shell .wg-wlc-column-header .wg-wlc-column-lock,
body.weldgrid-shell .wg-wlc-column-header [data-filter-col] {
    flex: 0 0 24px;
    width: 24px;
    height: 24px;
    margin-left: 0;
}

body.weldgrid-shell .wg-wlc-column-header.wg-wlc-column-unlocked {
    border-bottom-color: #34d399 !important;
    background: #ecfdf5 !important;
    color: #047857 !important;
    box-shadow: inset 0 0 0 2px rgba(52, 211, 153, .58), 0 2px 5px rgba(4, 120, 87, .08) !important;
}

body.weldgrid-shell .wg-wlc-column-header.wg-wlc-column-unlocked strong {
    color: #047857 !important;
}

body.weldgrid-shell .wg-wlc-column-header.wg-wlc-column-unlocked .wg-wlc-header-badge {
    border-color: rgba(52, 211, 153, .65) !important;
    background: #ffffff !important;
    color: #047857 !important;
}

body.weldgrid-shell .wg-wlc-column-header.wg-wlc-column-unlocked .wg-wlc-column-lock {
    border-color: rgba(52, 211, 153, .68) !important;
    background: #ffffff !important;
    color: #047857 !important;
}

body.weldgrid-shell .wg-wlc-grid-cell.is-mapped.is-mapped-unlocked:not(.is-dirty) {
    background: #ecfdf5 !important;
    color: #064e3b !important;
    cursor: cell;
    box-shadow: inset 0 0 0 1px rgba(52, 211, 153, .42) !important;
}

body.weldgrid-shell .wg-wlc-grid-cell.is-mapped.is-mapped-unlocked:not(.is-dirty):hover {
    background: #dcfce7 !important;
    box-shadow: inset 0 0 0 2px rgba(16, 185, 129, .45) !important;
}

body.weldgrid-shell .wg-wlc-column-header.wg-wlc-column-dirty,
body.weldgrid-shell .wg-wlc-column-header.wg-wlc-column-unlocked.wg-wlc-column-dirty {
    border-bottom-color: #fb923c !important;
    background: #fff7ed !important;
    color: #c2410c !important;
    box-shadow: inset 0 0 0 2px rgba(251, 146, 60, .78), 0 2px 5px rgba(194, 65, 12, .08) !important;
}

body.weldgrid-shell .wg-wlc-grid-cell.is-dirty,
body.weldgrid-shell .wg-wlc-grid-cell.is-mapped.is-mapped-unlocked.is-dirty {
    background: #fff7ed !important;
    color: #c2410c !important;
    box-shadow: inset 0 0 0 2px rgba(251, 146, 60, .82) !important;
}

body.weldgrid-shell .wg-wlc-copy-outline {
    position: absolute;
    z-index: 11;
    pointer-events: none;
    background:
        repeating-linear-gradient(90deg, #2563eb 0 6px, transparent 6px 12px) 0 0 / 12px 2px repeat-x,
        repeating-linear-gradient(180deg, #2563eb 0 6px, transparent 6px 12px) 100% 0 / 2px 12px repeat-y,
        repeating-linear-gradient(90deg, #2563eb 0 6px, transparent 6px 12px) 100% 100% / 12px 2px repeat-x,
        repeating-linear-gradient(180deg, #2563eb 0 6px, transparent 6px 12px) 0 100% / 2px 12px repeat-y;
    animation: wgWlcMarchingAnts .65s linear infinite;
}

body.weldgrid-shell .wg-wlc-fill-handle {
    position: absolute;
    z-index: 14;
    width: 11px;
    height: 11px;
    min-height: 0;
    border: 2px solid #ffffff;
    border-radius: 2px;
    background: #2563eb;
    box-shadow: 0 0 0 1px #1d4ed8;
    cursor: crosshair;
    padding: 0;
}

body.weldgrid-shell .wg-wlc-fill-preview {
    position: absolute;
    z-index: 10;
    border: 2px dashed #2563eb;
    background: rgba(37, 99, 235, .055);
    pointer-events: none;
}

@keyframes wgWlcMarchingAnts {
    to {
        background-position: 12px 0, 100% 12px, -12px 100%, 0 -12px;
    }
}

body.weldgrid-shell.wg-wlc-fullscreen-open {
    overflow: hidden !important;
}

body.weldgrid-shell #wgWlcWorkbookCard.is-fullscreen,
body.weldgrid-shell #wgWlcWorkbookCard:fullscreen {
    position: fixed;
    inset: 0;
    z-index: 40040;
    display: flex;
    flex-direction: column;
    width: 100vw;
    height: 100dvh;
    max-width: none;
    margin: 0;
    border: 0;
    border-radius: 0;
    background: #eef4f8;
    padding: 10px;
    overflow: hidden;
}

body.weldgrid-shell #wgWlcWorkbookCard.is-fullscreen .wg-wlc-grid-head,
body.weldgrid-shell #wgWlcWorkbookCard:fullscreen .wg-wlc-grid-head {
    flex: 0 0 auto;
    margin-bottom: 6px;
    border-radius: 8px;
    background: #ffffff;
    padding: 8px 10px;
}

body.weldgrid-shell #wgWlcWorkbookCard.is-fullscreen .wg-wlc-sheet-tabs,
body.weldgrid-shell #wgWlcWorkbookCard:fullscreen .wg-wlc-sheet-tabs,
body.weldgrid-shell #wgWlcWorkbookCard.is-fullscreen .wg-wlc-view-toolbar,
body.weldgrid-shell #wgWlcWorkbookCard:fullscreen .wg-wlc-view-toolbar,
body.weldgrid-shell #wgWlcWorkbookCard.is-fullscreen .wg-wlc-grid-legend,
body.weldgrid-shell #wgWlcWorkbookCard:fullscreen .wg-wlc-grid-legend {
    flex: 0 0 auto;
}

body.weldgrid-shell #wgWlcWorkbookCard.is-fullscreen .wg-wlc-grid-viewport,
body.weldgrid-shell #wgWlcWorkbookCard:fullscreen .wg-wlc-grid-viewport {
    flex: 1 1 auto;
    width: 100%;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    border-radius: 8px;
}

body.weldgrid-shell #wgWlcWorkbookCard.is-fullscreen .wg-wlc-grid-footer,
body.weldgrid-shell #wgWlcWorkbookCard:fullscreen .wg-wlc-grid-footer {
    flex: 0 0 auto;
    margin-top: 6px;
}

body.weldgrid-shell #wgWlcWorkbookCard.is-fullscreen #wgWlcFullscreen,
body.weldgrid-shell #wgWlcWorkbookCard:fullscreen #wgWlcFullscreen {
    border-color: rgba(255, 106, 26, .45);
    background: #fff7ed;
    color: #c2410c;
}

body.weldgrid-shell .wg-wlc-task-overlay[hidden] {
    display: none !important;
}

body.weldgrid-shell .wg-wlc-task-overlay {
    position: fixed;
    inset: 0;
    z-index: 50070;
    display: grid;
    place-items: center;
    padding: 22px;
    background: rgba(7, 27, 47, .56);
    backdrop-filter: blur(3px);
}

body.weldgrid-shell .wg-wlc-task-dialog {
    display: grid;
    gap: 15px;
    width: min(720px, 100%);
    border: 1px solid rgba(255, 255, 255, .42);
    border-radius: 10px;
    background: #ffffff;
    box-shadow: 0 26px 70px rgba(7, 27, 47, .34);
    padding: 22px;
}

body.weldgrid-shell .wg-wlc-task-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
}

body.weldgrid-shell .wg-wlc-task-head span {
    display: block;
    margin-bottom: 5px;
    color: #ff6a1a;
    font-size: 12px;
    font-weight: 950;
    letter-spacing: .12em;
}

body.weldgrid-shell .wg-wlc-task-head h2 {
    margin: 0;
    color: #08233e;
    font-size: 22px;
    font-weight: 950;
}

body.weldgrid-shell .wg-wlc-task-head p {
    margin: 5px 0 0;
    color: #60758a;
    font-size: 13px;
    font-weight: 850;
}

body.weldgrid-shell .wg-wlc-task-head > strong {
    min-width: 64px;
    border-radius: 999px;
    background: #e8f4fb;
    color: #0d5e85;
    padding: 8px 10px;
    text-align: center;
    font-size: 15px;
    font-weight: 950;
}

body.weldgrid-shell .wg-wlc-task-track {
    height: 11px;
    overflow: hidden;
    border-radius: 999px;
    background: #dbe7f0;
    box-shadow: inset 0 1px 2px rgba(7, 27, 47, .14);
}

body.weldgrid-shell .wg-wlc-task-track i {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #ff6a1a, #14b8a6);
    transition: width .2s ease;
}

body.weldgrid-shell .wg-wlc-task-steps {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
}

body.weldgrid-shell .wg-wlc-task-steps > div {
    display: flex;
    align-items: center;
    gap: 9px;
    min-height: 42px;
    border: 1px solid #d6e4ee;
    border-radius: 8px;
    background: #f8fbfd;
    color: #60758a;
    padding: 9px 10px;
    font-size: 13px;
    font-weight: 900;
}

body.weldgrid-shell .wg-wlc-task-steps > div.is-active {
    border-color: rgba(255, 106, 26, .5);
    background: #fff7ed;
    color: #08233e;
}

body.weldgrid-shell .wg-wlc-task-steps > div.is-active i {
    color: #ff6a1a;
    animation: wgSpin 1s linear infinite;
}

body.weldgrid-shell .wg-wlc-task-steps > div.is-done {
    border-color: rgba(22, 163, 74, .28);
    background: #f1fbf5;
    color: #047857;
}

body.weldgrid-shell .wg-wlc-task-steps > div.is-done i {
    color: #16a34a;
}

body.weldgrid-shell .swal2-popup.wg-wlc-progress-popup,
body.weldgrid-shell .swal2-popup:has(.wg-wlc-progress-dialog) {
    width: min(760px, calc(100vw - 32px)) !important;
    border-radius: 10px !important;
    padding: 20px !important;
}

body.weldgrid-shell .wg-wlc-progress-dialog .wg-export-progress-head h2 {
    max-width: 520px;
    font-size: 21px;
    line-height: 1.15;
    overflow-wrap: normal;
    word-break: normal;
}

body.weldgrid-shell .wg-wlc-progress-dialog .wg-export-progress-head p {
    max-width: 540px;
    line-height: 1.4;
}

body.weldgrid-shell .wg-wlc-progress-dialog .wg-export-progress-steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 720px) {
    body.weldgrid-shell .wg-wlc-task-head {
        flex-direction: column;
    }

    body.weldgrid-shell .wg-wlc-task-steps,
    body.weldgrid-shell .wg-wlc-progress-dialog .wg-export-progress-steps {
        grid-template-columns: 1fr;
    }

    body.weldgrid-shell #wgWlcFullscreen span {
        display: none;
    }
}

body.weldgrid-shell .wg-wlc-report-sheets {
    display: grid;
    gap: 6px;
    margin-top: 12px;
    text-align: left;
}

body.weldgrid-shell .wg-wlc-report-sheets > strong {
    color: #08233e;
    font-size: 13px;
    font-weight: 950;
}

body.weldgrid-shell .wg-wlc-report-sheets > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border: 1px solid #d6e4ee;
    border-radius: 7px;
    background: #f8fbfd;
    padding: 7px 9px;
}

body.weldgrid-shell .wg-wlc-report-sheets span {
    color: #08233e;
    font-size: 12px;
    font-weight: 900;
}

body.weldgrid-shell .wg-wlc-report-sheets small {
    color: #60758a;
    font-size: 11px;
    font-weight: 850;
}


/* =========================================================
   Welding Log Control Excel Toolbar and Date Fill
========================================================= */
body.weldgrid-shell .wg-wlc-icon-btn {
    display: inline-grid;
    place-items: center;
    width: 36px;
    min-width: 36px;
    height: 36px;
    min-height: 36px;
    padding: 0 !important;
    line-height: 1;
}

body.weldgrid-shell .wg-wlc-icon-btn i {
    margin: 0;
    font-size: 18px;
    line-height: 1;
}

body.weldgrid-shell .wg-wlc-icon-btn:disabled {
    opacity: .45;
    cursor: not-allowed;
}

body.weldgrid-shell .wg-wlc-save-button {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-width: 96px;
    min-height: 40px;
    padding-inline: 12px !important;
}

body.weldgrid-shell .wg-wlc-save-button i {
    margin: 0;
    font-size: 18px;
}

body.weldgrid-shell .wg-wlc-save-shortcut {
    font-size: .78rem;
    font-weight: 950;
    line-height: 1;
}

body.weldgrid-shell .wg-wlc-pending-badge {
    display: none;
    min-width: 18px;
    height: 18px;
    border-radius: 999px;
    background: #fff7ed;
    color: #c2410c;
    padding: 2px 5px;
    font-size: 11px;
    font-weight: 950;
    line-height: 14px;
    text-align: center;
}

body.weldgrid-shell .wg-wlc-save-button[data-pending="true"] .wg-wlc-pending-badge {
    display: inline-block;
}

body.weldgrid-shell .wg-wlc-selection-stats {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    border: 1px solid rgba(12, 46, 76, .12);
    border-radius: 999px;
    background: #ffffff;
    color: #415a72;
    padding: 5px 9px;
    font-size: .7rem;
    font-weight: 900;
    white-space: nowrap;
}

body.weldgrid-shell .wg-wlc-selection-stats[data-state="loading"] {
    border-color: rgba(255, 106, 26, .36);
    background: #fff7ed;
    color: #c2410c;
}

body.weldgrid-shell .wg-wlc-grid-legend .is-system i {
    background: #e8f4fb;
    box-shadow: inset 0 0 0 1px #9cc3d9;
}

body.weldgrid-shell .wg-wlc-column-header {
    align-items: center;
    min-width: 0;
}

body.weldgrid-shell .wg-wlc-column-header .wg-wlc-header-label {
    min-width: 0;
    max-width: 100%;
}

body.weldgrid-shell .wg-wlc-column-header .wg-wlc-header-badge {
    max-width: 98px;
}

body.weldgrid-shell .wg-wlc-column-header.wg-wlc-column-system {
    border-bottom-color: #9cc3d9 !important;
    background: #eef7fb !important;
    color: #315c72 !important;
    box-shadow: inset 0 0 0 1px rgba(12, 94, 133, .22), 0 2px 5px rgba(49, 92, 114, .06) !important;
}

body.weldgrid-shell .wg-wlc-column-header.wg-wlc-column-system strong {
    color: #315c72 !important;
}

body.weldgrid-shell .wg-wlc-column-header.wg-wlc-column-system .wg-wlc-header-badge {
    border-color: rgba(12, 94, 133, .24) !important;
    background: #ffffff !important;
    color: #315c72 !important;
}

body.weldgrid-shell .wg-wlc-column-lock.is-disabled {
    display: inline-grid;
    place-items: center;
    flex: 0 0 24px;
    width: 24px;
    height: 24px;
    border: 1px solid rgba(12, 94, 133, .24) !important;
    border-radius: 7px;
    background: #ffffff !important;
    color: #315c72 !important;
    cursor: not-allowed;
}

body.weldgrid-shell .wg-wlc-grid-cell.is-bom-system,
body.weldgrid-shell .wg-wlc-grid-cell.is-system-readonly {
    background: #f1f7fb !important;
    color: #476a7d !important;
    cursor: not-allowed !important;
    box-shadow: inset 0 0 0 1px rgba(12, 94, 133, .18) !important;
}

body.weldgrid-shell .wg-wlc-grid-cell.is-bom-system.is-formula {
    background: #faf5ff !important;
    color: #6b21a8 !important;
    box-shadow: inset 0 0 0 1px rgba(192, 132, 252, .4) !important;
}

body.weldgrid-shell .wg-wlc-grid-cell.has-saved-override:not(.is-dirty) {
    box-shadow: inset 0 0 0 1px rgba(20, 184, 166, .5);
}

body.weldgrid-shell .wg-wlc-mo-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    margin-left: auto;
    border: 1px solid rgba(20, 184, 166, .34);
    border-radius: 999px;
    background: #ecfdf5;
    color: #047857;
    padding: 1px 4px;
    font-size: 9px;
    font-style: normal;
    font-weight: 950;
    line-height: 1.1;
}

body.weldgrid-shell .wg-wlc-grid-cell.is-dirty .wg-wlc-mo-badge {
    border-color: rgba(251, 146, 60, .55);
    background: #ffffff;
    color: #c2410c;
}

body.weldgrid-shell .wg-wlc-grid-cell.is-mapped.is-mapped-unlocked:not(.is-dirty) {
    background: #ecfdf5 !important;
    color: #064e3b !important;
    cursor: cell !important;
    box-shadow: inset 0 0 0 1px rgba(52, 211, 153, .42) !important;
}

body.weldgrid-shell .wg-wlc-column-header.wg-wlc-column-unlocked:not(.wg-wlc-column-dirty) {
    background: #ecfdf5 !important;
    color: #047857 !important;
    box-shadow: inset 0 0 0 2px rgba(52, 211, 153, .58), 0 2px 5px rgba(4, 120, 87, .08) !important;
}

body.weldgrid-shell .wg-wlc-column-header.wg-wlc-column-dirty,
body.weldgrid-shell .wg-wlc-grid-cell.is-dirty {
    background: #fff7ed !important;
    color: #c2410c !important;
}

body.weldgrid-shell .wg-wlc-grid-editor {
    cursor: text;
    caret-color: #ff6a1a;
    user-select: text;
    -webkit-user-select: text;
}

body.weldgrid-shell .wg-wlc-fill-handle:hover,
body.weldgrid-shell .wg-wlc-fill-handle:focus-visible {
    width: 13px;
    height: 13px;
    background: #ff6a1a;
    box-shadow: 0 0 0 2px rgba(255, 106, 26, .26);
}

body.weldgrid-shell #wgWlcWorkbookCard.is-fullscreen .wg-wlc-grid-head,
body.weldgrid-shell #wgWlcWorkbookCard:fullscreen .wg-wlc-grid-head {
    flex: 0 0 auto;
}

body.weldgrid-shell #wgWlcWorkbookCard.is-fullscreen .wg-wlc-grid-viewport,
body.weldgrid-shell #wgWlcWorkbookCard:fullscreen .wg-wlc-grid-viewport {
    min-height: 0 !important;
}

body.weldgrid-shell .wg-wlc-task-steps > div.is-active i {
    animation: none !important;
    color: #ff6a1a;
}

body.weldgrid-shell .wg-wlc-task-steps > div.is-done i {
    color: #16a34a;
}

body.weldgrid-shell .wg-wlc-task-steps > div.is-error i {
    color: #dc2626;
}

body.weldgrid-shell .wg-wlc-task-dialog {
    max-height: calc(100vh - 44px);
    overflow: auto;
}

@media (hover: none), (pointer: coarse) {
    body.weldgrid-shell .wg-wlc-icon-btn {
        width: 40px;
        min-width: 40px;
        height: 40px;
        min-height: 40px;
    }
}

@media (max-width: 860px) {
    body.weldgrid-shell .wg-wlc-excel-commandbar {
        justify-content: flex-start;
    }

    body.weldgrid-shell .wg-wlc-selection-stats {
        flex: 1 1 100%;
        justify-content: flex-start;
    }

    body.weldgrid-shell .wg-wlc-save-button {
        min-width: 84px;
    }
}


/* =========================================================
   Welding Log Control Stable Two Row Toolbar
========================================================= */
body.weldgrid-shell .wg-wlc-grid-head {
    align-items: flex-start;
}

body.weldgrid-shell .wg-wlc-grid-head .wg-wlc-grid-actions {
    display: none !important;
}

body.weldgrid-shell .wg-wlc-sheet-tabs {
    margin-top: 8px;
    margin-bottom: 8px;
}

body.weldgrid-shell .wg-wlc-view-toolbar {
    display: grid;
    grid-template-columns: minmax(220px, .75fr) minmax(320px, 1.35fr) 40px 40px minmax(140px, auto) 40px auto;
    align-items: end;
    gap: 8px;
    margin-bottom: 9px;
}

body.weldgrid-shell .wg-wlc-view-toolbar[hidden] {
    display: none !important;
}

body.weldgrid-shell .wg-wlc-view-toolbar .wg-wlc-save-status {
    align-self: end;
    min-height: 36px;
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body.weldgrid-shell .wg-wlc-view-toolbar .wg-wlc-save-status[hidden] {
    display: none !important;
}

body.weldgrid-shell .wg-wlc-view-toolbar .wg-wlc-save-button {
    align-self: end;
    min-height: 40px;
}

body.weldgrid-shell .wg-wlc-view-toolbar #wgWlcFullscreen,
body.weldgrid-shell .wg-wlc-view-toolbar #wgWlcApplyView,
body.weldgrid-shell .wg-wlc-view-toolbar #wgWlcClearView {
    align-self: end;
}

body.weldgrid-shell .wg-wlc-selection-status,
body.weldgrid-shell .wg-wlc-selection-stats,
body.weldgrid-shell .wg-wlc-workbook-badge {
    display: none !important;
}

@media (max-width: 1180px) {
    body.weldgrid-shell .wg-wlc-view-toolbar {
        grid-template-columns: minmax(180px, 1fr) minmax(240px, 1fr) 40px 40px 40px auto;
    }

    body.weldgrid-shell .wg-wlc-view-toolbar .wg-wlc-save-status {
        grid-column: 1 / -1;
        max-width: none;
    }
}

@media (max-width: 760px) {
    body.weldgrid-shell .wg-wlc-view-toolbar {
        grid-template-columns: 1fr 1fr 40px 40px 40px auto;
    }

    body.weldgrid-shell .wg-wlc-view-toolbar label {
        grid-column: 1 / -1;
    }
}


/* =========================================================
   Welding Log Control Save and Fullscreen Fixes
========================================================= */
body.weldgrid-shell .wg-wlc-view-toolbar {
    grid-template-columns: minmax(190px, .55fr) minmax(260px, 1fr) 40px 40px 40px max-content !important;
    overflow: visible;
}

body.weldgrid-shell .wg-wlc-view-toolbar label {
    min-width: 0;
}

body.weldgrid-shell .wg-wlc-view-toolbar .form-control,
body.weldgrid-shell .wg-wlc-view-toolbar .form-select,
body.weldgrid-shell .wg-wlc-view-toolbar .select2-container {
    min-width: 0;
    max-width: 100%;
}

body.weldgrid-shell .wg-wlc-view-toolbar #wgWlcApplyView {
    grid-column: 3;
}

body.weldgrid-shell .wg-wlc-view-toolbar #wgWlcClearView {
    grid-column: 4;
}

body.weldgrid-shell .wg-wlc-view-toolbar #wgWlcFullscreen {
    grid-column: 5;
}

body.weldgrid-shell .wg-wlc-view-toolbar #wgWlcSave {
    grid-column: 6;
    justify-self: end;
}

body.weldgrid-shell .wg-wlc-view-toolbar .wg-wlc-save-status {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-self: end;
    max-width: min(420px, 100%);
}

body.weldgrid-shell .wg-wlc-save-button {
    min-width: 104px;
    white-space: nowrap;
}

body.weldgrid-shell #wgWlcWorkbookCard.is-fullscreen .wg-wlc-view-toolbar,
body.weldgrid-shell #wgWlcWorkbookCard:fullscreen .wg-wlc-view-toolbar {
    grid-template-columns: minmax(220px, .5fr) minmax(360px, 1fr) 40px 40px 40px max-content !important;
}

@media (max-width: 1180px) {
    body.weldgrid-shell .wg-wlc-view-toolbar {
        grid-template-columns: minmax(180px, .7fr) minmax(220px, 1fr) 40px 40px 40px max-content !important;
    }
}

@media (max-width: 760px) {
    body.weldgrid-shell .wg-wlc-view-toolbar {
        grid-template-columns: 1fr 40px 40px 40px max-content !important;
    }

    body.weldgrid-shell .wg-wlc-view-toolbar label {
        grid-column: 1 / -1;
    }

    body.weldgrid-shell .wg-wlc-view-toolbar #wgWlcApplyView {
        grid-column: 2;
    }

    body.weldgrid-shell .wg-wlc-view-toolbar #wgWlcClearView {
        grid-column: 3;
    }

    body.weldgrid-shell .wg-wlc-view-toolbar #wgWlcFullscreen {
        grid-column: 4;
    }

    body.weldgrid-shell .wg-wlc-view-toolbar #wgWlcSave {
        grid-column: 5;
    }
}

/* =========================================================
   WeldGrid DB-backed Excel Grid (BOM / CUT)
========================================================= */
body.weldgrid-shell .wg-db-excel-grid {
    position: relative;
    display: grid;
    grid-template-rows: auto auto minmax(430px, 1fr) auto;
    min-width: 0;
    min-height: 600px;
    overflow: hidden;
    border: 1px solid rgba(12, 46, 76, .14);
    border-radius: 9px;
    background: #ffffff;
}

body.weldgrid-shell .wg-dbx-toolbar {
    display: grid;
    grid-template-columns: auto minmax(240px, 1fr) auto auto;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-bottom: 1px solid rgba(12, 46, 76, .12);
    background: linear-gradient(180deg, #ffffff 0%, #f6fafc 100%);
}

body.weldgrid-shell .wg-dbx-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

body.weldgrid-shell .wg-dbx-actions button {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    width: 36px;
    min-width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid #ccdae5;
    border-radius: 8px;
    background: #ffffff;
    color: #0d2d4b;
    font-size: 17px;
    font-weight: 900;
}

body.weldgrid-shell .wg-dbx-actions button:hover:not(:disabled) {
    border-color: rgba(255, 106, 26, .48);
    background: #fff7ed;
    color: #c2410c;
}

body.weldgrid-shell .wg-dbx-actions button:disabled {
    opacity: .42;
    cursor: not-allowed;
}

body.weldgrid-shell .wg-dbx-actions .wg-dbx-save {
    width: auto;
    min-width: 82px;
    padding: 0 10px;
    border-color: #ff6a1a;
    background: #ff6a1a;
    color: #ffffff;
}

body.weldgrid-shell .wg-dbx-actions .wg-dbx-save:hover:not(:disabled) {
    background: #e95d12;
    color: #ffffff;
}

body.weldgrid-shell .wg-dbx-actions kbd {
    border: 0;
    background: transparent;
    color: inherit;
    padding: 0;
    font: inherit;
    font-size: 11px;
}

body.weldgrid-shell .wg-dbx-actions [data-role="pending"] {
    position: absolute;
    top: -6px;
    right: -6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    border: 2px solid #ffffff;
    border-radius: 999px;
    background: #dc2626;
    color: #ffffff;
    padding: 0 5px;
    font-size: 10px;
    font-weight: 950;
}

body.weldgrid-shell .wg-dbx-search {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    min-height: 38px;
    border: 1px solid #cbd8e3;
    border-radius: 8px;
    background: #ffffff;
    padding: 0 11px;
    color: #60758a;
}

body.weldgrid-shell .wg-dbx-search input {
    width: 100%;
    min-width: 0;
    min-height: 36px;
    border: 0;
    outline: 0;
    background: transparent;
    color: #0d2d4b;
    font-size: 13px;
    font-weight: 800;
}

body.weldgrid-shell .wg-dbx-search span {
    color: #c2410c;
    font-size: 11px;
    font-weight: 900;
    white-space: nowrap;
}

body.weldgrid-shell .wg-dbx-stats {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

body.weldgrid-shell .wg-dbx-stats span,
body.weldgrid-shell .wg-dbx-meta {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    border: 1px solid #d6e3ed;
    border-radius: 999px;
    background: #f8fbfd;
    color: #60758a;
    padding: 5px 9px;
    font-size: 11px;
    font-weight: 850;
    white-space: nowrap;
}

body.weldgrid-shell .wg-dbx-stats strong {
    margin-left: 4px;
    color: #0d2d4b;
    font-weight: 950;
}

body.weldgrid-shell .wg-dbx-status {
    margin: 8px 12px 0;
    border: 1px solid #d6e3ed;
    border-radius: 7px;
    background: #f8fbfd;
    color: #52677d;
    padding: 8px 10px;
    font-size: 12px;
    font-weight: 850;
}

body.weldgrid-shell .wg-dbx-status[data-state="ready"] {
    border-color: rgba(16, 185, 129, .24);
    background: #ecfdf5;
    color: #047857;
}

body.weldgrid-shell .wg-dbx-status[data-state="warning"] {
    border-color: rgba(245, 158, 11, .3);
    background: #fff7ed;
    color: #92400e;
}

body.weldgrid-shell .wg-dbx-status[data-state="error"] {
    border-color: rgba(220, 38, 38, .28);
    background: #fff1f2;
    color: #991b1b;
}

body.weldgrid-shell .wg-dbx-viewport {
    position: relative;
    min-width: 0;
    min-height: 430px;
    height: min(68vh, 780px);
    overflow: auto;
    outline: 0;
    background: #ffffff;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
}

body.weldgrid-shell .wg-dbx-canvas {
    position: relative;
    min-width: 100%;
    min-height: 100%;
}

body.weldgrid-shell .wg-dbx-layer {
    position: absolute;
    inset: 0;
}

body.weldgrid-shell .wg-dbx-corner,
body.weldgrid-shell .wg-dbx-column-header,
body.weldgrid-shell .wg-dbx-row-header,
body.weldgrid-shell .wg-dbx-cell {
    position: absolute;
    box-sizing: border-box;
}

body.weldgrid-shell .wg-dbx-corner {
    z-index: 20;
    border-right: 1px solid #bdcfdd;
    border-bottom: 1px solid #bdcfdd;
    background: #dfeaf1;
}

body.weldgrid-shell .wg-dbx-column-header {
    z-index: 18;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto auto auto;
    align-items: center;
    gap: 5px;
    overflow: hidden;
    border-right: 1px solid #bed4df;
    border-bottom: 1px solid #9fc8bb;
    background: #eafbf4;
    color: #075b45;
    padding: 0 5px 0 8px;
    font-size: 11px;
    font-weight: 950;
    user-select: none;
}

body.weldgrid-shell .wg-dbx-column-header.has-filter {
    background: #fff7ed;
    color: #9a3412;
}

body.weldgrid-shell .wg-dbx-column-header > strong {
    color: #0f766e;
    font-size: 11px;
}

body.weldgrid-shell .wg-dbx-column-header > span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body.weldgrid-shell .wg-dbx-lock,
body.weldgrid-shell .wg-dbx-formula {
    color: #7c3aed;
    font-size: 11px;
    font-style: normal;
    font-weight: 950;
}

body.weldgrid-shell .wg-dbx-filter-button,
body.weldgrid-shell .wg-dbx-rename-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 25px;
    height: 25px;
    border: 1px solid rgba(12, 46, 76, .16);
    border-radius: 7px;
    background: #ffffff;
    color: #0d5d75;
    padding: 0;
    font-size: 13px;
}

body.weldgrid-shell .wg-dbx-filter-button.is-active,
body.weldgrid-shell .wg-dbx-filter-button:hover,
body.weldgrid-shell .wg-dbx-rename-button:hover {
    border-color: #ff6a1a;
    background: #ff6a1a;
    color: #ffffff;
}

body.weldgrid-shell .wg-dbx-resize {
    position: absolute;
    top: 0;
    right: -3px;
    bottom: 0;
    z-index: 5;
    width: 7px;
    cursor: col-resize;
}

body.weldgrid-shell .wg-dbx-row-header {
    z-index: 15;
    display: flex;
    align-items: center;
    justify-content: center;
    border-right: 1px solid #bdcfdd;
    border-bottom: 1px solid #d7e3eb;
    background: #edf3f7;
    color: #52677d;
    font-size: 11px;
    font-weight: 900;
    user-select: none;
}

body.weldgrid-shell .wg-dbx-row-header.is-selected {
    background: #dbeafe;
    color: #1d4ed8;
}

body.weldgrid-shell .wg-dbx-cell {
    z-index: 3;
    display: flex;
    align-items: center;
    overflow: hidden;
    border-right: 1px solid #bfe7d8;
    border-bottom: 1px solid #bfe7d8;
    background: #ecfdf5;
    color: #0d2d4b;
    padding: 0 8px;
    font-size: 12px;
    font-weight: 750;
    white-space: nowrap;
    user-select: none;
}

body.weldgrid-shell .wg-dbx-cell > span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

body.weldgrid-shell .wg-dbx-cell.is-readonly {
    border-color: #d9e3ea;
    background: #f5f8fa;
    color: #4f6377;
    cursor: not-allowed;
}

body.weldgrid-shell .wg-dbx-cell.is-formula {
    border-color: #dbc7ff;
    background: #f7f0ff;
    color: #5b21b6;
}

body.weldgrid-shell .wg-dbx-cell.is-editable {
    cursor: cell;
}

body.weldgrid-shell .wg-dbx-cell.is-dirty {
    border-color: #fb923c;
    background: #fff7ed;
    color: #c2410c;
    box-shadow: inset 0 0 0 1px #fb923c;
}

body.weldgrid-shell .wg-dbx-cell.is-selected {
    box-shadow: inset 0 0 0 1px #60a5fa;
    background-image: linear-gradient(rgba(59, 130, 246, .08), rgba(59, 130, 246, .08));
}

body.weldgrid-shell .wg-dbx-cell.is-active {
    z-index: 8;
    box-shadow: inset 0 0 0 2px #2563eb;
}

body.weldgrid-shell .wg-dbx-cell.is-copied::after {
    content: "";
    position: absolute;
    inset: 1px;
    border: 2px dashed #2563eb;
    pointer-events: none;
    animation: wgDbxMarchingAnts .72s linear infinite;
}

body.weldgrid-shell .wg-dbx-cell-marker {
    margin-left: auto;
    color: #7c3aed;
    font-size: 10px;
    font-style: normal;
    font-weight: 950;
}

body.weldgrid-shell .wg-dbx-fill-handle {
    position: absolute;
    right: -4px;
    bottom: -4px;
    z-index: 12;
    width: 9px;
    height: 9px;
    border: 1px solid #ffffff;
    border-radius: 2px;
    background: #2563eb;
    cursor: crosshair;
}

body.weldgrid-shell .wg-dbx-editor {
    position: absolute;
    inset: 1px;
    z-index: 20;
    width: calc(100% - 2px);
    height: calc(100% - 2px);
    border: 2px solid #ff6a1a;
    border-radius: 3px;
    background: #ffffff;
    color: #0d2d4b;
    padding: 0 6px;
    outline: 0;
    font: inherit;
    font-weight: 800;
}

body.weldgrid-shell .wg-dbx-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 36px;
    border-top: 1px solid #d7e3eb;
    background: #f8fbfd;
    color: #60758a;
    padding: 7px 11px;
    font-size: 11px;
    font-weight: 850;
}

body.weldgrid-shell .wg-dbx-filter-popup {
    position: fixed;
    z-index: 30070;
    display: grid;
    gap: 8px;
    width: 330px;
    max-height: min(480px, calc(100vh - 24px));
    overflow: hidden;
    border: 1px solid #cbd8e3;
    border-radius: 10px;
    background: #ffffff;
    box-shadow: 0 18px 48px rgba(7, 27, 47, .25);
    padding: 10px;
}

body.weldgrid-shell .wg-dbx-filter-head,
body.weldgrid-shell .wg-dbx-filter-tools,
body.weldgrid-shell .wg-dbx-filter-footer,
body.weldgrid-shell .wg-dbx-filter-sort {
    display: flex;
    align-items: center;
    gap: 7px;
}

body.weldgrid-shell .wg-dbx-filter-head {
    justify-content: space-between;
    color: #0d2d4b;
    font-weight: 950;
}

body.weldgrid-shell .wg-dbx-filter-head button,
body.weldgrid-shell .wg-dbx-filter-sort button,
body.weldgrid-shell .wg-dbx-filter-tools button,
body.weldgrid-shell .wg-dbx-filter-footer button {
    border: 1px solid #cbd8e3;
    border-radius: 7px;
    background: #ffffff;
    color: #0d2d4b;
    padding: 6px 8px;
    font-size: 11px;
    font-weight: 850;
}

body.weldgrid-shell .wg-dbx-filter-sort {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

body.weldgrid-shell .wg-dbx-filter-sort button:hover,
body.weldgrid-shell .wg-dbx-filter-footer [data-apply] {
    border-color: #ff6a1a;
    background: #fff7ed;
    color: #c2410c;
}

body.weldgrid-shell .wg-dbx-filter-popup > input {
    min-height: 38px;
    border: 1px solid #cbd8e3;
    border-radius: 7px;
    padding: 7px 9px;
    color: #0d2d4b;
    font-weight: 800;
}

body.weldgrid-shell .wg-dbx-filter-values {
    display: grid;
    align-content: start;
    gap: 4px;
    min-height: 100px;
    max-height: 260px;
    overflow: auto;
    border: 1px solid #e1e9ef;
    border-radius: 7px;
    background: #f8fbfd;
    padding: 6px;
}

body.weldgrid-shell .wg-dbx-filter-values label {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 7px;
    border-radius: 6px;
    padding: 5px 6px;
    color: #17324d;
    font-size: 12px;
    font-weight: 800;
}

body.weldgrid-shell .wg-dbx-filter-values label:hover {
    background: #ffffff;
}

body.weldgrid-shell .wg-dbx-filter-values small {
    color: #64748b;
    font-weight: 900;
}

body.weldgrid-shell .wg-dbx-filter-footer {
    justify-content: flex-end;
}

body.weldgrid-shell .wg-dbx-progress[hidden] {
    display: none !important;
}

body.weldgrid-shell .wg-dbx-progress {
    position: absolute;
    inset: 0;
    z-index: 120;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(7, 27, 47, .48);
    backdrop-filter: blur(2px);
}

body.weldgrid-shell .wg-dbx-progress-card {
    display: grid;
    gap: 14px;
    width: min(650px, 100%);
    border: 1px solid rgba(255, 255, 255, .48);
    border-radius: 10px;
    background: #ffffff;
    box-shadow: 0 24px 70px rgba(7, 27, 47, .34);
    padding: 20px;
}

body.weldgrid-shell .wg-dbx-progress-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

body.weldgrid-shell .wg-dbx-progress-head small {
    color: #ff6a1a;
    font-weight: 950;
    letter-spacing: .12em;
}

body.weldgrid-shell .wg-dbx-progress-head h3 {
    margin: 3px 0;
    color: #0d2d4b;
    font-size: 20px;
    font-weight: 950;
}

body.weldgrid-shell .wg-dbx-progress-head p {
    margin: 0;
    color: #60758a;
    font-size: 13px;
    font-weight: 850;
}

body.weldgrid-shell .wg-dbx-progress-head > strong {
    min-width: 62px;
    border-radius: 999px;
    background: #e8f4fb;
    color: #0d5d8d;
    padding: 7px 10px;
    text-align: center;
    font-weight: 950;
}

body.weldgrid-shell .wg-dbx-progress-track {
    height: 11px;
    overflow: hidden;
    border-radius: 999px;
    background: #dbe7f0;
}

body.weldgrid-shell .wg-dbx-progress-track span {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #ff6a1a, #14b8a6);
    transition: width .2s ease;
}

body.weldgrid-shell .wg-dbx-progress-steps {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

body.weldgrid-shell .wg-dbx-progress-steps div {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    border: 1px solid #d7e3eb;
    border-radius: 8px;
    background: #f8fbfd;
    color: #60758a;
    padding: 8px 10px;
    font-size: 12px;
    font-weight: 900;
}

body.weldgrid-shell .wg-dbx-progress-steps div.is-active {
    border-color: rgba(255, 106, 26, .45);
    background: #fff7ed;
    color: #9a3412;
}

body.weldgrid-shell .wg-dbx-progress-steps div.is-done {
    border-color: rgba(16, 185, 129, .28);
    background: #ecfdf5;
    color: #047857;
}

body.weldgrid-shell .wg-db-excel-grid:fullscreen,
body.weldgrid-shell .wg-db-excel-grid.is-fullscreen {
    position: fixed;
    inset: 0;
    z-index: 30020;
    width: 100vw;
    height: 100vh;
    min-height: 100vh;
    border-radius: 0;
    background: #ffffff;
}

body.weldgrid-shell .wg-db-excel-grid:fullscreen .wg-dbx-viewport,
body.weldgrid-shell .wg-db-excel-grid.is-fullscreen .wg-dbx-viewport {
    height: calc(100vh - 122px);
}

body.wg-dbx-fullscreen-open {
    overflow: hidden;
}

body.weldgrid-shell .wg-bom-legacy-compat,
body.weldgrid-shell .wg-pipe-cut-legacy-compat {
    display: none !important;
}

body.weldgrid-shell .wg-pipe-cut-toolbar-scope-only {
    grid-template-columns: minmax(160px, .85fr) minmax(220px, 1.25fr) minmax(150px, .8fr) minmax(100px, .55fr) auto;
}

body.weldgrid-shell .wg-bom-excel-grid,
body.weldgrid-shell .wg-pipe-cut-excel-grid {
    margin-top: 10px;
}

@keyframes wgDbxMarchingAnts {
    0% { border-color: #2563eb; }
    50% { border-color: #93c5fd; }
    100% { border-color: #2563eb; }
}

@media (max-width: 1180px) {
    body.weldgrid-shell .wg-dbx-toolbar {
        grid-template-columns: 1fr minmax(240px, 1fr);
    }

    body.weldgrid-shell .wg-dbx-stats,
    body.weldgrid-shell .wg-dbx-meta {
        justify-self: start;
    }

    body.weldgrid-shell .wg-pipe-cut-toolbar-scope-only {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    body.weldgrid-shell .wg-db-excel-grid {
        min-height: 520px;
    }

    body.weldgrid-shell .wg-dbx-toolbar {
        grid-template-columns: 1fr;
    }

    body.weldgrid-shell .wg-dbx-actions button {
        width: 40px;
        height: 40px;
    }

    body.weldgrid-shell .wg-dbx-viewport {
        height: 62vh;
    }

    body.weldgrid-shell .wg-dbx-progress-steps,
    body.weldgrid-shell .wg-pipe-cut-toolbar-scope-only {
        grid-template-columns: 1fr;
    }

    body.weldgrid-shell .wg-dbx-footer,
    body.weldgrid-shell .wg-dbx-progress-head {
        align-items: stretch;
        flex-direction: column;
    }
}

/* Production background export queue */
body.weldgrid-shell .wg-export-active-job {
    display: grid;
    gap: 10px;
    border: 1px solid rgba(14, 116, 144, .24);
    border-radius: 9px;
    background: linear-gradient(135deg, rgba(236, 254, 255, .9), rgba(248, 250, 252, .96));
    padding: 12px;
}
body.weldgrid-shell .wg-export-active-job-head,
body.weldgrid-shell .wg-export-active-job-meta,
body.weldgrid-shell .wg-export-active-job-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
body.weldgrid-shell .wg-export-active-job-head > div { min-width: 0; }
body.weldgrid-shell .wg-export-active-job-head strong {
    display: block;
    overflow: hidden;
    color: var(--wg-navy);
    font-size: .9rem;
    font-weight: 950;
    text-overflow: ellipsis;
    white-space: nowrap;
}
body.weldgrid-shell .wg-export-active-job-head span,
body.weldgrid-shell .wg-export-active-job-meta small {
    display: block;
    margin-top: 3px;
    color: var(--wg-muted);
    font-size: .76rem;
    font-weight: 850;
}
body.weldgrid-shell .wg-export-active-job-head em {
    flex: 0 0 auto;
    border-radius: 999px;
    background: rgba(14, 165, 233, .13);
    color: #0369a1;
    padding: 5px 9px;
    font-size: .76rem;
    font-style: normal;
    font-weight: 950;
}
body.weldgrid-shell .wg-export-active-job-head em.wg-export-status-cancelling {
    background: rgba(245, 158, 11, .16);
    color: #b45309;
}
body.weldgrid-shell .wg-export-active-job-track {
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: #dbe7f0;
}
body.weldgrid-shell .wg-export-active-job-track span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--wg-orange), #14b8a6);
    transition: width .2s ease;
}
body.weldgrid-shell .wg-export-active-job-actions { justify-content: flex-end; flex-wrap: wrap; }
body.weldgrid-shell .wg-export-active-job-actions .wg-btn { min-height: 34px; padding: 7px 10px; font-size: .78rem; }
body.weldgrid-shell .wg-export-progress-actions .wg-danger {
    border-color: rgba(220, 38, 38, .28);
    background: #fff7f7;
    color: #b91c1c;
}

/* =========================================================
   Welding Log Control Progress Modal Final Layout
========================================================= */

body.weldgrid-shell .swal2-container:has(.wg-wlc-progress-dialog) {
    align-items: center !important;
    padding: 18px !important;
    overflow-y: auto !important;
}

body.weldgrid-shell .swal2-popup.wg-wlc-progress-popup,
body.weldgrid-shell .swal2-popup:has(.wg-wlc-progress-dialog) {
    box-sizing: border-box !important;
    width: min(760px, calc(100vw - 36px)) !important;
    max-width: min(760px, calc(100vw - 36px)) !important;
    margin: 0 auto !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    padding: 0 !important;
    overflow: visible !important;
}

body.weldgrid-shell .swal2-popup.wg-wlc-progress-popup .swal2-html-container,
body.weldgrid-shell .swal2-popup:has(.wg-wlc-progress-dialog) .swal2-html-container {
    display: block !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
}

body.weldgrid-shell .swal2-popup.wg-wlc-progress-popup .swal2-actions,
body.weldgrid-shell .swal2-popup:has(.wg-wlc-progress-dialog) .swal2-actions {
    display: none !important;
}

body.weldgrid-shell .swal2-popup.wg-wlc-progress-popup .wg-wlc-progress-dialog,
body.weldgrid-shell .swal2-popup:has(.wg-wlc-progress-dialog) .wg-wlc-progress-dialog {
    box-sizing: border-box !important;
    display: grid !important;
    gap: 14px !important;
    width: 100% !important;
    max-height: min(720px, calc(100dvh - 48px)) !important;
    overflow: auto !important;
    border: 1px solid rgba(255, 255, 255, .52) !important;
    border-radius: 8px !important;
    background: #ffffff !important;
    box-shadow: 0 24px 64px rgba(7, 27, 47, .34) !important;
    padding: 22px 24px !important;
}

body.weldgrid-shell .swal2-popup.wg-wlc-progress-popup .wg-export-progress-head,
body.weldgrid-shell .swal2-popup:has(.wg-wlc-progress-dialog) .wg-export-progress-head {
    align-items: flex-start !important;
    gap: 14px !important;
}

body.weldgrid-shell .swal2-popup.wg-wlc-progress-popup .wg-export-progress-head h2,
body.weldgrid-shell .swal2-popup:has(.wg-wlc-progress-dialog) .wg-export-progress-head h2 {
    margin: 0 !important;
    font-size: 22px !important;
    line-height: 1.15 !important;
}

body.weldgrid-shell .swal2-popup.wg-wlc-progress-popup .wg-export-progress-head p,
body.weldgrid-shell .swal2-popup:has(.wg-wlc-progress-dialog) .wg-export-progress-head p {
    margin-top: 6px !important;
    line-height: 1.35 !important;
}

body.weldgrid-shell .swal2-popup.wg-wlc-progress-popup .wg-export-progress-steps,
body.weldgrid-shell .swal2-popup:has(.wg-wlc-progress-dialog) .wg-export-progress-steps {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
}

body.weldgrid-shell .swal2-popup.wg-wlc-progress-popup .wg-export-progress-steps div,
body.weldgrid-shell .swal2-popup:has(.wg-wlc-progress-dialog) .wg-export-progress-steps div {
    min-height: 38px !important;
    padding: 8px 10px !important;
}

body.weldgrid-shell .swal2-popup.wg-wlc-progress-popup .wg-export-progress-steps div.is-active i,
body.weldgrid-shell .swal2-popup:has(.wg-wlc-progress-dialog) .wg-export-progress-steps div.is-active i {
    animation: none !important;
}

body.weldgrid-shell .swal2-popup.wg-wlc-progress-popup .wg-export-progress-actions,
body.weldgrid-shell .swal2-popup:has(.wg-wlc-progress-dialog) .wg-export-progress-actions {
    justify-content: flex-end !important;
    margin-top: 0 !important;
    padding-top: 2px !important;
}

body.weldgrid-shell .swal2-popup.wg-wlc-progress-popup .wg-export-progress-actions .wg-btn,
body.weldgrid-shell .swal2-popup:has(.wg-wlc-progress-dialog) .wg-export-progress-actions .wg-btn {
    min-height: 40px !important;
    padding: 9px 16px !important;
}

@media (max-width: 720px) {
    body.weldgrid-shell .swal2-popup.wg-wlc-progress-popup .wg-wlc-progress-dialog,
    body.weldgrid-shell .swal2-popup:has(.wg-wlc-progress-dialog) .wg-wlc-progress-dialog {
        max-height: calc(100dvh - 28px) !important;
        padding: 18px 16px !important;
    }

    body.weldgrid-shell .swal2-popup.wg-wlc-progress-popup .wg-export-progress-head,
    body.weldgrid-shell .swal2-popup:has(.wg-wlc-progress-dialog) .wg-export-progress-head {
        flex-direction: column !important;
    }

    body.weldgrid-shell .swal2-popup.wg-wlc-progress-popup .wg-export-progress-steps,
    body.weldgrid-shell .swal2-popup:has(.wg-wlc-progress-dialog) .wg-export-progress-steps {
        grid-template-columns: 1fr !important;
    }

    body.weldgrid-shell .swal2-popup.wg-wlc-progress-popup .wg-export-progress-actions .wg-btn,
    body.weldgrid-shell .swal2-popup:has(.wg-wlc-progress-dialog) .wg-export-progress-actions .wg-btn {
        width: 100% !important;
        justify-content: center !important;
    }
}



/* =========================================================
   Welding Log Control Import Report Cards
========================================================= */
body.weldgrid-shell .swal2-popup.wg-wlc-report-popup {
    max-height: calc(100dvh - 56px) !important;
    overflow: hidden !important;
    padding: 24px !important;
}

body.weldgrid-shell .swal2-popup.wg-wlc-report-popup .swal2-html-container {
    max-height: calc(100dvh - 210px) !important;
    overflow: auto !important;
    padding: 0 8px 2px !important;
}

body.weldgrid-shell .wg-wlc-report-changes {
    display: grid;
    gap: 8px;
    margin-top: 14px;
    text-align: left;
}

body.weldgrid-shell .wg-wlc-report-changes > strong {
    color: #08233e;
    font-size: 13px;
    font-weight: 950;
}

body.weldgrid-shell .wg-wlc-report-changes > div {
    display: grid;
    gap: 8px;
}

body.weldgrid-shell .wg-wlc-report-change-card {
    display: grid;
    grid-template-columns: minmax(170px, 1.1fr) minmax(140px, .8fr) minmax(240px, 1.4fr);
    align-items: center;
    gap: 10px;
    border: 1px solid #d7e4ed;
    border-radius: 9px;
    background: #ffffff;
    padding: 10px 12px;
}

body.weldgrid-shell .wg-wlc-report-change-meta {
    display: grid;
    gap: 3px;
    min-width: 0;
}

body.weldgrid-shell .wg-wlc-report-change-meta span {
    color: #60758a;
    font-size: 11px;
    font-weight: 900;
}

body.weldgrid-shell .wg-wlc-report-change-meta strong {
    overflow: hidden;
    color: #08233e;
    font-size: 13px;
    font-weight: 950;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body.weldgrid-shell .wg-wlc-report-change-field {
    display: grid;
    gap: 3px;
    min-width: 0;
}

body.weldgrid-shell .wg-wlc-report-change-field span {
    color: #60758a;
    font-size: 11px;
    font-weight: 900;
}

body.weldgrid-shell .wg-wlc-report-change-field strong {
    overflow: hidden;
    color: #00618a;
    font-size: 13px;
    font-weight: 950;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body.weldgrid-shell .wg-wlc-report-change-values {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 22px minmax(0, 1fr);
    align-items: center;
    gap: 8px;
}

body.weldgrid-shell .wg-wlc-report-change-values span {
    display: grid;
    gap: 3px;
    min-width: 0;
    border-radius: 8px;
    background: #f7fbfe;
    padding: 7px 8px;
}

body.weldgrid-shell .wg-wlc-report-change-values small {
    color: #60758a;
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
}

body.weldgrid-shell .wg-wlc-report-change-values b {
    overflow: hidden;
    color: #08233e;
    font-size: 12px;
    font-weight: 950;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body.weldgrid-shell .wg-wlc-report-change-values i {
    color: #ff6a1a;
    font-size: 15px;
    text-align: center;
}

body.weldgrid-shell .wg-wlc-report-problems {
    display: grid;
    gap: 8px;
    margin-top: 14px;
    text-align: left;
}

body.weldgrid-shell .wg-wlc-report-problems > strong {
    color: #08233e;
    font-size: 13px;
    font-weight: 950;
}

body.weldgrid-shell .wg-wlc-report-problems > p {
    margin: 0;
    color: #0277a8;
    font-size: 12px;
    font-weight: 850;
}

body.weldgrid-shell .wg-wlc-report-problems > div {
    display: grid;
    gap: 7px;
}

body.weldgrid-shell .wg-wlc-report-problem-card {
    display: grid;
    grid-template-columns: minmax(210px, .9fr) minmax(240px, 1.2fr);
    gap: 10px;
    border: 1px solid #fecaca;
    border-radius: 8px;
    background: #fff7f7;
    padding: 9px 11px;
}

body.weldgrid-shell .wg-wlc-report-problem-card div {
    display: grid;
    gap: 3px;
    min-width: 0;
}

body.weldgrid-shell .wg-wlc-report-problem-card span {
    color: #60758a;
    font-size: 11px;
    font-weight: 900;
}

body.weldgrid-shell .wg-wlc-report-problem-card strong {
    overflow: hidden;
    color: #7f1d1d;
    font-size: 12px;
    font-weight: 950;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body.weldgrid-shell .wg-wlc-report-problem-card em {
    align-self: center;
    color: #991b1b;
    font-size: 12px;
    font-style: normal;
    font-weight: 900;
}

@media (max-width: 820px) {
    body.weldgrid-shell .wg-wlc-report-change-card {
        grid-template-columns: 1fr;
    }

    body.weldgrid-shell .wg-wlc-report-problem-card {
        grid-template-columns: 1fr;
    }
}

/* =========================================================
   Shared Excel Grid Visual Restoration (BOM / CUT)
========================================================= */
body.weldgrid-shell .wg-db-excel-grid {
    border-color: #d6e4ee;
    background: #ffffff;
    box-shadow: 0 1px 0 rgba(12, 46, 76, .04);
}

body.weldgrid-shell .wg-dbx-toolbar {
    grid-template-columns: auto minmax(280px, 1fr) auto auto;
    align-items: center;
    gap: 8px;
    background: #f8fbfd;
    padding: 10px 12px;
}

body.weldgrid-shell .wg-dbx-actions button {
    border-color: #cfe0eb;
    background: #ffffff;
    color: #0b2f4a;
    box-shadow: 0 1px 2px rgba(12, 46, 76, .04);
}

body.weldgrid-shell .wg-dbx-actions button:hover:not(:disabled) {
    border-color: #ff6a1a;
    background: #fff7ed;
    color: #c2410c;
}

body.weldgrid-shell .wg-dbx-actions .wg-dbx-save {
    border-color: #ff6a1a;
    background: #ff6a1a;
    color: #ffffff;
}

body.weldgrid-shell .wg-dbx-actions .wg-dbx-save:hover:not(:disabled) {
    border-color: #e95d12;
    background: #e95d12;
    color: #ffffff;
}

body.weldgrid-shell .wg-dbx-column-header {
    grid-template-columns: auto minmax(0, 1fr) auto auto auto auto auto;
    gap: 5px;
    border-right: 1px solid #a7f3d0;
    border-bottom: 1px solid #8de7c4;
    background: #ecfdf5;
    color: #047857;
}

body.weldgrid-shell .wg-dbx-column-header > strong {
    color: #047857;
}

body.weldgrid-shell .wg-dbx-column-header.is-locked,
body.weldgrid-shell .wg-dbx-column-header.is-system,
body.weldgrid-shell .wg-dbx-column-header.is-formula-column {
    border-color: #c084fc;
    background: #f3e8ff;
    color: #6b21a8;
}

body.weldgrid-shell .wg-dbx-column-header.is-locked > strong,
body.weldgrid-shell .wg-dbx-column-header.is-system > strong,
body.weldgrid-shell .wg-dbx-column-header.is-formula-column > strong {
    color: #7c3aed;
}

body.weldgrid-shell .wg-dbx-column-header.has-filter,
body.weldgrid-shell .wg-dbx-column-header.is-sorted {
    border-color: #fb923c;
    background: #fff7ed;
    color: #c2410c;
}

body.weldgrid-shell .wg-dbx-column-header.has-filter > strong,
body.weldgrid-shell .wg-dbx-column-header.is-sorted > strong {
    color: #c2410c;
}

body.weldgrid-shell .wg-dbx-lock,
body.weldgrid-shell .wg-dbx-formula {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    min-width: 18px;
    height: 18px;
    border-radius: 6px;
    background: rgba(124, 58, 237, .12);
    color: #7c3aed;
    font-size: 12px;
    line-height: 1;
}

body.weldgrid-shell .wg-dbx-sort-button,
body.weldgrid-shell .wg-dbx-filter-button,
body.weldgrid-shell .wg-dbx-rename-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 25px;
    height: 25px;
    border: 1px solid #cfe0eb;
    border-radius: 7px;
    background: #ffffff;
    color: #0d5d75;
    padding: 0;
    font-size: 13px;
    line-height: 1;
    box-shadow: 0 1px 2px rgba(12, 46, 76, .04);
    cursor: pointer;
}

body.weldgrid-shell .wg-dbx-sort-button:hover,
body.weldgrid-shell .wg-dbx-filter-button:hover,
body.weldgrid-shell .wg-dbx-rename-button:hover {
    border-color: #ff6a1a;
    background: #ff6a1a;
    color: #ffffff;
}

body.weldgrid-shell .wg-dbx-sort-button.is-active,
body.weldgrid-shell .wg-dbx-filter-button.is-active {
    border-color: #ff6a1a;
    background: #fff7ed;
    color: #c2410c;
}

body.weldgrid-shell .wg-dbx-sort-button.is-active:hover,
body.weldgrid-shell .wg-dbx-filter-button.is-active:hover {
    background: #ff6a1a;
    color: #ffffff;
}

body.weldgrid-shell .wg-dbx-cell {
    border-right: 1px solid #b7ead7;
    border-bottom: 1px solid #b7ead7;
    background: #ecfdf5;
    color: #0b2f4a;
}

body.weldgrid-shell .wg-dbx-cell.is-editable {
    background: #ecfdf5;
    cursor: cell;
}

body.weldgrid-shell .wg-dbx-cell.is-readonly,
body.weldgrid-shell .wg-dbx-cell.is-locked,
body.weldgrid-shell .wg-dbx-cell.is-system {
    border-color: #d8c5ff;
    background: #f3e8ff;
    color: #5b21b6;
    cursor: not-allowed;
}

body.weldgrid-shell .wg-dbx-cell.is-formula {
    border-color: #d8c5ff;
    background: #f7f0ff;
    color: #5b21b6;
}

body.weldgrid-shell .wg-dbx-cell.is-dirty {
    border-color: #fb923c;
    background: #fff7ed;
    color: #c2410c;
    box-shadow: inset 0 0 0 1px #fb923c;
}

body.weldgrid-shell .wg-dbx-cell.is-selected {
    background-image: linear-gradient(rgba(59, 130, 246, .10), rgba(59, 130, 246, .10));
    box-shadow: inset 0 0 0 1px #3b82f6;
}

body.weldgrid-shell .wg-dbx-cell.is-active {
    z-index: 9;
    box-shadow: inset 0 0 0 2px #2563eb;
}

body.weldgrid-shell .wg-dbx-cell-lock,
body.weldgrid-shell .wg-dbx-cell-marker {
    flex: 0 0 auto;
    margin-left: auto;
    color: #7c3aed;
    font-size: 11px;
    font-style: normal;
    font-weight: 950;
}

body.weldgrid-shell .wg-dbx-fill-handle {
    right: -5px;
    bottom: -5px;
    z-index: 18;
    width: 10px;
    height: 10px;
    border: 2px solid #ffffff;
    border-radius: 3px;
    background: #2563eb;
    box-shadow: 0 0 0 1px #2563eb;
}

body.weldgrid-shell .wg-dbx-fill-handle:hover {
    background: #1d4ed8;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, .24);
}

body.weldgrid-shell .wg-dbx-viewport {
    border-top: 1px solid #d6e4ee;
    background: #ffffff;
}

body.weldgrid-shell .wg-dbx-filter-popup {
    display: grid;
    grid-template-rows: auto auto auto minmax(130px, 1fr) auto;
    max-height: min(560px, calc(100vh - 28px));
    border-color: #cfe0eb;
    box-shadow: 0 20px 52px rgba(7, 27, 47, .26);
}

body.weldgrid-shell .wg-dbx-filter-values {
    max-height: 300px;
}

body.weldgrid-shell .wg-dbx-filter-footer {
    position: sticky;
    bottom: 0;
    z-index: 1;
    padding-top: 8px;
    background: #ffffff;
}

@media (max-width: 900px) {
    body.weldgrid-shell .wg-dbx-toolbar {
        grid-template-columns: 1fr;
    }

    body.weldgrid-shell .wg-dbx-actions button {
        width: 40px;
        min-width: 40px;
        height: 40px;
    }
}


/* =========================================================
   WeldGrid Fixed Desktop Shell
========================================================= */
@media (min-width: 992px) {
    html:has(body.weldgrid-shell),
    body.weldgrid-shell {
        width: 100%;
        height: 100%;
        min-height: 0;
        overflow: hidden;
    }

    body.weldgrid-shell .app-wrapper {
        width: 100%;
        height: 100dvh !important;
        min-height: 0 !important;
        max-height: 100dvh !important;
        grid-template-rows: var(--wg-topbar-height) minmax(0, 1fr) var(--wg-footer-height) !important;
        overflow: hidden !important;
    }

    body.weldgrid-shell .app-header {
        position: relative !important;
        top: auto !important;
        min-height: 0 !important;
        height: var(--wg-topbar-height) !important;
        overflow: visible;
    }

    body.weldgrid-shell .app-main {
        min-width: 0 !important;
        min-height: 0 !important;
        height: auto !important;
        max-height: none !important;
        overflow-x: hidden !important;
        overflow-y: auto !important;
        overscroll-behavior: contain;
        scrollbar-gutter: stable;
    }

    body.weldgrid-shell .app-footer.weldgrid-footer {
        min-height: 0 !important;
        height: var(--wg-footer-height) !important;
        overflow: hidden;
    }

    body.weldgrid-shell .app-sidebar {
        position: relative !important;
        top: auto !important;
        bottom: auto !important;
        align-self: stretch !important;
        min-height: 0 !important;
        height: 100dvh !important;
        max-height: 100dvh !important;
        overflow: hidden !important;
    }

    body.weldgrid-shell .sidebar-brand {
        position: relative !important;
        top: auto !important;
        flex: 0 0 78px !important;
    }

    body.weldgrid-shell .sidebar-wrapper {
        flex: 1 1 auto !important;
        min-height: 0 !important;
        height: auto !important;
        max-height: none !important;
        overflow: hidden !important;
    }

    body.weldgrid-shell .sidebar-menu-scroll,
    body.weldgrid-shell.sidebar-collapse .sidebar-menu-scroll {
        flex: 1 1 auto !important;
        min-height: 0 !important;
        overflow-x: hidden !important;
        overflow-y: auto !important;
        overscroll-behavior: contain;
        scrollbar-gutter: stable;
    }
}


/* =========================================================
   WeldGrid Hidden Sidebar With Hover Reveal
========================================================= */
@media (min-width: 992px) {
    body.weldgrid-shell.sidebar-collapse .app-wrapper {
        --wg-active-sidebar-width: var(--wg-sidebar-collapsed-width);
        grid-template-columns: var(--wg-sidebar-collapsed-width) minmax(0, 1fr) !important;
    }

    body.weldgrid-shell.sidebar-collapse .app-sidebar {
        display: flex !important;
        position: fixed !important;
        inset: 0 auto 0 0 !important;
        z-index: 1050 !important;
        width: var(--wg-sidebar-collapsed-width) !important;
        min-width: var(--wg-sidebar-collapsed-width) !important;
        max-width: var(--wg-sidebar-collapsed-width) !important;
        visibility: visible !important;
        opacity: 1;
        pointer-events: auto !important;
        box-shadow: none !important;
        transition: width .18s ease, min-width .18s ease, max-width .18s ease, opacity .12s ease, box-shadow .18s ease !important;
    }

    body.weldgrid-shell.sidebar-collapse .app-sidebar:not(:hover):not(:focus-within) .sidebar-brand,
    body.weldgrid-shell.sidebar-collapse .app-sidebar:not(:hover):not(:focus-within) .sidebar-wrapper,
    body.weldgrid-shell.sidebar-collapse .app-sidebar:not(:hover):not(:focus-within) .sidebar-menu-scroll,
    body.weldgrid-shell.sidebar-collapse .app-sidebar:not(:hover):not(:focus-within) .sidebar-fixed-top,
    body.weldgrid-shell.sidebar-collapse .app-sidebar:not(:hover):not(:focus-within) .sidebar-fixed-bottom {
        width: 100% !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    body.weldgrid-shell.sidebar-collapse .app-sidebar:not(:hover):not(:focus-within) .sidebar-menu,
    body.weldgrid-shell.sidebar-collapse .app-sidebar:not(:hover):not(:focus-within) .sidebar-menu > .nav-item {
        width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    body.weldgrid-shell.sidebar-collapse .app-sidebar:not(:hover):not(:focus-within) .sidebar-menu .nav-link {
        width: 48px !important;
        min-width: 48px !important;
        max-width: 48px !important;
        margin-left: auto !important;
        margin-right: auto !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        gap: 0 !important;
        justify-content: center !important;
    }

    body.weldgrid-shell.sidebar-collapse .app-sidebar:not(:hover):not(:focus-within) .sidebar-menu .nav-link > i {
        width: 22px !important;
        margin: 0 !important;
        flex: 0 0 22px !important;
        text-align: center !important;
    }

    body.weldgrid-shell.sidebar-collapse .app-sidebar:not(:hover):not(:focus-within) .session-timeout-wrapper,
    body.weldgrid-shell.sidebar-collapse .app-sidebar:not(:hover):not(:focus-within) .brand-link {
        width: 48px !important;
        min-width: 48px !important;
        max-width: 48px !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }

    body.weldgrid-shell.sidebar-collapse .sidebar-menu-scroll {
        overflow-y: auto !important;
        scrollbar-width: none !important;
        scrollbar-gutter: auto !important;
    }

    body.weldgrid-shell.sidebar-collapse .sidebar-menu-scroll::-webkit-scrollbar {
        display: none !important;
        width: 0 !important;
    }

    body.weldgrid-shell.sidebar-collapse .app-sidebar:hover,
    body.weldgrid-shell.sidebar-collapse .app-sidebar:focus-within {
        width: var(--wg-sidebar-width) !important;
        min-width: var(--wg-sidebar-width) !important;
        max-width: var(--wg-sidebar-width) !important;
        opacity: 1;
        box-shadow: 14px 0 32px rgba(7, 27, 47, .28) !important;
    }

    body.weldgrid-shell.sidebar-collapse .app-sidebar:hover .sidebar-wrapper,
    body.weldgrid-shell.sidebar-collapse .app-sidebar:focus-within .sidebar-wrapper {
        padding: 8px !important;
        overflow: hidden !important;
    }

    body.weldgrid-shell.sidebar-collapse .app-sidebar:hover .sidebar-menu-scroll,
    body.weldgrid-shell.sidebar-collapse .app-sidebar:focus-within .sidebar-menu-scroll {
        overflow-y: auto !important;
    }

    body.weldgrid-shell.sidebar-collapse .app-sidebar:hover .sidebar-menu .nav-link,
    body.weldgrid-shell.sidebar-collapse .app-sidebar:focus-within .sidebar-menu .nav-link {
        width: auto !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        padding-left: 12px !important;
        padding-right: 12px !important;
        justify-content: flex-start !important;
    }

    body.weldgrid-shell.sidebar-collapse .app-sidebar:hover .sidebar-menu .nav-link p,
    body.weldgrid-shell.sidebar-collapse .app-sidebar:focus-within .sidebar-menu .nav-link p,
    body.weldgrid-shell.sidebar-collapse .app-sidebar:hover .sidebar-menu .nav-header,
    body.weldgrid-shell.sidebar-collapse .app-sidebar:focus-within .sidebar-menu .nav-header,
    body.weldgrid-shell.sidebar-collapse .app-sidebar:hover .session-timeout-message,
    body.weldgrid-shell.sidebar-collapse .app-sidebar:focus-within .session-timeout-message,
    body.weldgrid-shell.sidebar-collapse .app-sidebar:hover .nav-arrow,
    body.weldgrid-shell.sidebar-collapse .app-sidebar:focus-within .nav-arrow {
        display: block !important;
    }

    body.weldgrid-shell.sidebar-collapse .app-sidebar:hover .sidebar-menu .menu-open > .nav-treeview,
    body.weldgrid-shell.sidebar-collapse .app-sidebar:focus-within .sidebar-menu .menu-open > .nav-treeview {
        display: block !important;
    }

    body.weldgrid-shell.sidebar-collapse .app-sidebar:hover .session-timeout-wrapper,
    body.weldgrid-shell.sidebar-collapse .app-sidebar:focus-within .session-timeout-wrapper {
        width: auto !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        padding: 10px 12px !important;
    }

    body.weldgrid-shell.sidebar-collapse .app-sidebar:hover .session-timeout-content,
    body.weldgrid-shell.sidebar-collapse .app-sidebar:focus-within .session-timeout-content {
        justify-content: flex-start !important;
    }

    body.weldgrid-shell.sidebar-collapse .app-sidebar:hover .brand-link,
    body.weldgrid-shell.sidebar-collapse .app-sidebar:focus-within .brand-link {
        width: 100% !important;
        min-width: 0 !important;
        max-width: none !important;
    }

    body.weldgrid-shell.sidebar-collapse .app-sidebar:hover .brand-link img,
    body.weldgrid-shell.sidebar-collapse .app-sidebar:focus-within .brand-link img {
        max-width: 150px !important;
        max-height: 46px !important;
    }
}

.wg-project-merge-modal { padding: 12px !important; overflow: hidden; }
.wg-project-merge-modal .modal-dialog { width: min(1180px, calc(100vw - 24px)); max-width: none; height: calc(100dvh - 24px); max-height: calc(100dvh - 24px); margin: 0 auto; }
.wg-project-merge-modal .modal-content { display: grid; height: 100%; max-height: none; grid-template-rows: auto auto minmax(0, 1fr) auto; overflow: hidden; border: 1px solid #bfd3e1; border-radius: 8px; background: #eef5f9; box-shadow: 0 22px 60px rgba(4, 31, 52, .24); }
.wg-project-merge-modal .modal-header { min-width: 0; align-items: flex-start; padding: 16px 24px 13px; border-bottom: 1px solid #cadbe6; background: #f8fbfd; }
.wg-project-merge-modal .modal-header > div { min-width: 0; padding-right: 28px; }
.wg-project-merge-modal .modal-title { margin: 2px 0 3px; color: #0c2e4d; font-size: 1.42rem; font-weight: 800; letter-spacing: 0; }
.wg-project-merge-modal .wg-modal-subtitle { max-width: 900px; margin: 0; color: #60778a; font-size: .84rem; line-height: 1.4; }
.wg-modal-kicker { color: #e85c16; font-size: .68rem; font-weight: 800; letter-spacing: .08em; }
.wg-project-merge-body { min-width: 0; min-height: 0; height: auto; padding: 14px 24px; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; }
.wg-project-merge-footer { position: relative; z-index: 3; flex: 0 0 auto; gap: 10px; min-height: 66px; padding: 11px 24px; border-top: 1px solid #cadbe6; background: #f8fbfd; }
.wg-project-merge-steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 12px 24px 0; padding: 5px; border: 1px solid #d5e2eb; border-radius: 8px; background: #e8f0f5; }
.wg-project-merge-step { position: relative; display: flex; align-items: center; gap: 9px; min-width: 0; min-height: 46px; padding: 7px 9px; border-radius: 7px; color: #718697; font-weight: 750; }
.wg-project-merge-step:not(:last-child)::after { position: absolute; top: 50%; right: -7px; width: 6px; height: 1px; content: ""; background: #c4d5e1; }
.wg-project-merge-step-index { display: grid; width: 30px; height: 30px; flex: 0 0 30px; place-items: center; border: 1px solid #bfd1de; border-radius: 50%; background: #fff; color: #60778a; font-weight: 800; }
.wg-project-merge-step-label { min-width: 0; overflow: hidden; font-size: .8rem; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }
.wg-project-merge-step.is-active { background: #fff; color: #0c2e4d; box-shadow: 0 4px 14px rgba(7, 31, 66, .08); }
.wg-project-merge-step.is-active .wg-project-merge-step-index { border-color: #ff651f; background: #ff651f; color: #fff; }
.wg-project-merge-step.is-complete { color: #0d4770; }
.wg-project-merge-step.is-complete .wg-project-merge-step-index { border-color: #0d4770; background: #0d4770; color: #fff; }
.wg-project-merge-step.is-complete .wg-project-merge-step-index i { font-size: 1rem; font-weight: 900; }
.wg-project-merge-panel { min-width: 0; padding: 20px; border: 1px solid #cadbe6; border-radius: 8px; background: #fff; }
.wg-project-merge-panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.wg-project-merge-panel-head h3 { margin: 2px 0 0; color: #0c2e4d; font-size: 1.18rem; font-weight: 800; letter-spacing: 0; }
.wg-step-kicker { color: #e85c16; font-size: .68rem; font-weight: 800; letter-spacing: .08em; }
.wg-project-merge-limit, .wg-dry-run-badge { padding: 5px 9px; border-radius: 6px; background: #e6f4fb; color: #11648b; font-size: .73rem; font-weight: 800; }
.wg-project-merge-modal .form-control, .wg-project-merge-modal .form-select { border-color: #c4d5e1; background-color: #fff !important; color: #0c2e4d !important; -webkit-text-fill-color: #0c2e4d; opacity: 1; }
.wg-project-merge-modal .form-control:not(:focus), .wg-project-merge-modal .form-select:not(:focus) { color: #0c2e4d !important; -webkit-text-fill-color: #0c2e4d; }
.wg-project-merge-modal .form-control::placeholder { color: #718697 !important; -webkit-text-fill-color: #718697; opacity: 1; }
.wg-project-merge-modal textarea.form-control { min-height: 88px; resize: vertical; }
.wg-project-merge-modal .select2-container { width: 100% !important; max-width: 100%; }
.wg-project-merge-modal .wg-project-merge-select2 .select2-selection--single, .wg-project-merge-modal .wg-project-merge-select2 .select2-selection--multiple { min-height: 46px; border: 1px solid #c4d5e1 !important; border-radius: 7px !important; background: #fff !important; color: #0c2e4d !important; }
.wg-project-merge-modal .wg-project-merge-select2.select2-container--focus .select2-selection, .wg-project-merge-modal .wg-project-merge-select2.select2-container--open .select2-selection { border-color: #ff651f !important; box-shadow: 0 0 0 3px rgba(255, 101, 31, .12) !important; }
.wg-project-merge-modal .wg-project-merge-select2 .select2-selection--single .select2-selection__rendered { min-height: 44px; padding: 10px 38px 9px 12px; color: #0c2e4d !important; font-weight: 700; line-height: 24px; }
.wg-project-merge-modal .wg-project-merge-select2 .select2-selection--single .select2-selection__arrow { width: 36px; height: 44px; }
.wg-project-merge-modal .wg-project-merge-select2 .select2-selection--multiple { display: flex; align-items: center; padding: 5px 38px 5px 7px; }
.wg-project-merge-modal .wg-project-merge-select2 .select2-selection--multiple .select2-selection__rendered { display: flex; min-width: 0; flex-wrap: wrap; gap: 5px; padding: 0; }
.wg-project-merge-modal .wg-project-merge-select2 .select2-selection__choice { display: inline-flex; max-width: min(390px, 38vw); align-items: center; margin: 0 !important; padding: 5px 8px 5px 25px !important; border: 1px solid #b9d8e8 !important; border-radius: 6px !important; background: #edf7fc !important; color: #0c2e4d !important; font-size: .76rem; font-weight: 750; }
.wg-project-merge-modal .wg-project-merge-select2 .select2-selection__choice__display { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wg-project-merge-modal .wg-project-merge-select2 .select2-selection__choice__remove { height: 100%; border-right-color: #b9d8e8 !important; color: #4f6f84 !important; }
.wg-project-merge-modal .wg-project-merge-select2 .select2-search--inline .select2-search__field { min-width: 210px; margin: 4px 0 0; color: #0c2e4d !important; -webkit-text-fill-color: #0c2e4d; }
.wg-project-merge-modal .wg-project-merge-select2-dropdown { overflow: hidden; border-color: #bfd3e1 !important; border-radius: 7px !important; background: #fff !important; box-shadow: 0 14px 34px rgba(5, 41, 67, .2); }
.wg-project-merge-modal .wg-project-merge-select2-dropdown .select2-search { padding: 8px; background: #f3f8fb; }
.wg-project-merge-modal .wg-project-merge-select2-dropdown .select2-search__field { height: 40px; border: 1px solid #c4d5e1 !important; border-radius: 6px; color: #0c2e4d !important; -webkit-text-fill-color: #0c2e4d; }
.wg-project-merge-modal .wg-project-merge-select2-dropdown .select2-results__options { max-height: 290px; }
.wg-project-merge-modal .wg-project-merge-select2-dropdown .select2-results__option { padding: 9px 11px; color: #0c2e4d !important; }
.wg-project-merge-modal .wg-project-merge-select2-dropdown .select2-results__option--highlighted { background: #0d6f9e !important; color: #fff !important; }
.wg-project-merge-modal .wg-project-merge-select2-dropdown .select2-results__option--selected { background: #fff1e8 !important; color: #9a3412 !important; }
.wg-project-merge-select2-option { display: grid; min-width: 0; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 3px 12px; }
.wg-project-merge-select2-option > span:first-child { min-width: 0; }
.wg-project-merge-select2-option strong, .wg-project-merge-select2-option small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wg-project-merge-select2-option strong { font-size: .82rem; }
.wg-project-merge-select2-option small { margin-top: 2px; color: #6b8091; font-size: .71rem; }
.select2-results__option--highlighted .wg-project-merge-select2-option small, .select2-results__option--highlighted .wg-project-merge-select2-kpis, .select2-results__option--highlighted .wg-project-merge-select2-excel { color: #fff !important; }
.wg-project-merge-select2-kpis { color: #5d7486; font-size: .69rem; white-space: nowrap; }
.wg-project-merge-select2-excel { grid-column: 1 / 3; color: #18704f !important; }
.wg-project-merge-base-info { display: flex; align-items: flex-start; gap: 9px; margin-top: 9px; padding: 10px 12px; border: 1px solid #a9d9c6; border-radius: 7px; background: #edf9f4; color: #176746; font-size: .78rem; }
.wg-project-merge-base-info i { flex: 0 0 auto; font-size: 1rem; }
.wg-project-merge-base-info strong { color: #0c5138; }
.wg-project-merge-selection { display: grid; gap: 9px; margin-top: 16px; }
.wg-project-source-card { display: grid; grid-template-columns: minmax(220px, 1fr) minmax(360px, auto); align-items: center; gap: 18px; padding: 13px 15px; border: 1px solid #d2e0e9; border-left: 4px solid #1683b5; border-radius: 7px; background: #f8fbfd; }
.wg-project-source-main { display: flex; align-items: center; gap: 12px; min-width: 0; }
.wg-project-source-main div { min-width: 0; }
.wg-project-source-main strong, .wg-project-source-main small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wg-project-source-main strong { color: #0c2e4d; font-size: .9rem; }
.wg-project-source-main small { margin-top: 3px; color: #6c8091; }
.wg-project-source-code { flex: 0 0 auto; padding: 5px 8px; border-radius: 5px; background: #0d385a; color: #fff; font-size: .76rem; font-weight: 800; }
.wg-project-source-kpis { display: grid; grid-template-columns: repeat(4, minmax(78px, auto)); gap: 8px; }
.wg-project-source-kpis span { color: #617688; font-size: .72rem; white-space: nowrap; }
.wg-project-source-kpis b { display: block; color: #143754; font-size: .88rem; }
.wg-project-merge-empty { display: flex; align-items: center; justify-content: center; gap: 9px; min-height: 88px; border: 1px dashed #b8ccd9; border-radius: 7px; color: #718697; }
.wg-project-merge-notice, .wg-project-merge-ok { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; padding: 11px 13px; border: 1px solid #a9d9c6; border-radius: 7px; background: #edf9f4; color: #176746; }
.wg-project-merge-loading { display: flex; min-height: 390px; flex-direction: column; align-items: center; justify-content: center; gap: 10px; color: #0c2e4d; text-align: center; }
.wg-project-merge-loading .spinner-border { width: 2.5rem; height: 2.5rem; color: #ff651f; }
.wg-project-merge-loading small { max-width: 600px; color: #6c8091; }
.wg-project-merge-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.wg-project-merge-kpis article { display: grid; min-width: 0; grid-template-columns: auto 1fr; column-gap: 10px; padding: 13px; border: 1px solid #d1e0e9; border-radius: 7px; background: #f7fafc; }
.wg-project-merge-kpis i { grid-row: 1 / 3; align-self: center; color: #1683b5; font-size: 1.3rem; }
.wg-project-merge-kpis span { overflow: hidden; color: #718697; font-size: .72rem; text-overflow: ellipsis; white-space: nowrap; }
.wg-project-merge-kpis strong { color: #0c2e4d; font-size: 1rem; }
.wg-project-merge-detail-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; margin-top: 15px; overflow: hidden; border: 1px solid #d1e0e9; border-radius: 7px; background: #d1e0e9; }
.wg-project-merge-detail-grid div { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; background: #fff; }
.wg-project-merge-detail-grid span { color: #647a8b; font-size: .76rem; }
.wg-project-merge-blockers, .wg-project-merge-warnings { margin-top: 15px; padding: 13px 15px; border-radius: 7px; }
.wg-project-merge-blockers { border: 1px solid #edb9b9; background: #fff3f3; color: #962f2f; }
.wg-project-merge-warnings { border: 1px solid #f0d29a; background: #fff9eb; color: #785213; }
.wg-project-merge-blockers ul, .wg-project-merge-warnings ul { margin: 7px 0 0; padding-left: 20px; }
.wg-project-merge-final-warning { display: flex; align-items: center; gap: 13px; padding: 15px; border: 1px solid #f0bd8f; border-radius: 7px; background: #fff6ed; color: #7a3c12; }
.wg-project-merge-final-warning i { font-size: 1.7rem; }
.wg-project-merge-final-warning p { margin: 2px 0 0; }
.wg-project-merge-summary { display: grid; gap: 1px; margin: 16px 0; overflow: hidden; border: 1px solid #d1e0e9; border-radius: 7px; background: #d1e0e9; }
.wg-project-merge-summary div { display: grid; grid-template-columns: 180px 1fr; gap: 14px; padding: 10px 12px; background: #f9fbfc; }
.wg-project-merge-summary dt { color: #657b8d; }
.wg-project-merge-summary dd { margin: 0; color: #0c2e4d; font-weight: 700; }
.wg-project-merge-confirm-code { display: block; width: fit-content; margin-bottom: 8px; padding: 7px 9px; border-radius: 5px; background: #0c2e4d; color: #fff; }
.wg-project-merge-confirm-input { max-width: 520px; border-color: #ef9a63; }
.wg-project-merge-progress { display: grid; min-height: 400px; max-width: 760px; grid-template-columns: auto 1fr; align-content: center; gap: 14px 20px; margin: 0 auto; }
.wg-project-merge-progress-ring { position: relative; display: grid; width: 112px; height: 112px; grid-row: 1 / 3; place-items: center; border-radius: 50%; background: conic-gradient(#ff651f var(--wg-progress), #d7e4ec 0); }
.wg-project-merge-progress-ring::before { width: 88px; height: 88px; content: ""; border-radius: 50%; background: #eef5f9; }
.wg-project-merge-progress-ring strong { position: absolute; color: #0c2e4d; font-size: 1.25rem; }
.wg-project-merge-progress-copy h3 { margin: 4px 0; color: #0c2e4d; font-size: 1.3rem; }
.wg-project-merge-progress-copy p { margin: 0; color: #687f91; }
.wg-project-merge-progress-bar { height: 10px; grid-column: 2; overflow: hidden; border-radius: 5px; background: #d7e4ec; }
.wg-project-merge-progress-bar span { display: block; height: 100%; border-radius: inherit; background: #ff651f; transition: width .35s ease; }
.wg-project-merge-live-counts { display: grid; grid-column: 1 / 3; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.wg-project-merge-live-counts span { min-width: 0; padding: 9px; border: 1px solid #cfdee8; border-radius: 6px; background: #fff; color: #6b8192; font-size: .68rem; overflow-wrap: anywhere; }
.wg-project-merge-live-counts b { display: block; color: #0c2e4d; font-size: .88rem; }
.wg-project-merge-progress .wg-project-merge-warnings, .wg-project-merge-progress .wg-btn-danger-outline { grid-column: 1 / 3; }
.wg-btn-danger-outline { border: 1px solid #dc5b5b; background: #fff; color: #a42f2f; }
.wg-project-merge-complete, .wg-project-merge-failed { display: flex; min-height: 390px; flex-direction: column; align-items: center; justify-content: center; color: #0c2e4d; text-align: center; }
.wg-project-merge-complete-icon { display: grid; width: 74px; height: 74px; margin-bottom: 15px; place-items: center; border-radius: 50%; background: #e3f7ee; color: #168a5d; font-size: 2.6rem; }
.wg-project-merge-result-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 9px; margin-top: 16px; }
.wg-project-merge-failed > i { color: #c23d3d; font-size: 3.2rem; }
.wg-project-merge-error { display: flex; min-height: 300px; align-items: center; justify-content: center; gap: 14px; color: #9b3030; }
.wg-project-merge-modal .select2-container { max-width: 100%; }
.wg-project-merge-modal .select2-selection--multiple { min-height: 46px; border-color: #bfcfda !important; border-radius: 6px !important; }
.wg-btn-success { border-color: #168a5d !important; background: #168a5d !important; color: #fff !important; }

@media (max-width: 900px) {
.wg-project-merge-modal { padding: 8px !important; }
.wg-project-merge-modal .modal-dialog { width: calc(100vw - 16px); max-width: none; height: calc(100dvh - 16px); max-height: calc(100dvh - 16px); margin: 0 auto; }
.wg-project-merge-modal .modal-content { height: 100%; max-height: none; }
.wg-project-merge-modal .modal-header, .wg-project-merge-body, .wg-project-merge-footer { padding-right: 16px; padding-left: 16px; }
.wg-project-merge-steps { margin-right: 16px; margin-left: 16px; }
.wg-project-source-card { grid-template-columns: 1fr; }
.wg-project-source-kpis, .wg-project-merge-kpis, .wg-project-merge-live-counts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.wg-project-merge-detail-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 560px) {
.wg-project-merge-steps strong { display: none; }
.wg-project-merge-steps div { justify-content: center; padding-right: 0; }
.wg-project-merge-panel { padding: 14px; }
.wg-project-merge-kpis, .wg-project-merge-detail-grid { grid-template-columns: 1fr; }
.wg-project-merge-summary div { grid-template-columns: 1fr; gap: 3px; }
.wg-project-merge-progress { grid-template-columns: 1fr; justify-items: center; text-align: center; }
.wg-project-merge-progress-ring { grid-row: auto; }
.wg-project-merge-progress-bar, .wg-project-merge-live-counts, .wg-project-merge-progress .wg-project-merge-warnings, .wg-project-merge-progress .wg-btn-danger-outline { width: 100%; grid-column: 1; }
}
