/* ============================================================
   DnnCutList Module Styles
   Sydenhams Branding – Light Theme, Responsive & Accessible
   ============================================================

   Migrated from dark theme to align with Sydenhams site branding.
   Uses --syd-* CSS custom properties from syd-components.css.
   All class names preserved for JS compatibility.
   ============================================================ */


/* ============================================================
   HEADER (CutList details)
   ============================================================ */

.dnncutlist {
    font-family: var(--syd-font, 'Barlow Condensed', Arial, sans-serif);
    font-size: 15px;
    color: var(--syd-text-body, #424242);
    line-height: 1.5;
}

.dnncutlist .cl-header {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    padding: 18px;
    color: var(--syd-text-body, #424242);
    margin: 10px 0 14px;
}

.dnncutlist .cl-header-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 14px;
}

.dnncutlist .cl-header-links {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.dnncutlist .cl-link {
    color: var(--syd-primary, #0071b9);
    text-decoration: none;
    font-weight: 700;
}

.dnncutlist .cl-link:hover {
    text-decoration: underline;
}

.dnncutlist .cl-muted {
    color: #888;
    font-size: 13px;
}

.dnncutlist .cl-header-fields {
    display: grid;
    grid-template-columns: repeat(4, minmax(160px, 1fr));
    gap: 12px;
}

.dnncutlist .cl-field label {
    display: block;
    margin: 0 0 6px;
    font-weight: 600;
    color: var(--syd-text-dark, #363e4c);
    font-size: 13px;
}

.dnncutlist .cl-input,
.dnncutlist input[type="text"],
.dnncutlist textarea {
    width: 100%;
    background: #fff;
    color: var(--syd-text-body, #424242);
    border: 1px solid #ccc;
    border-radius: 6px;
    padding: 10px 12px;
    box-sizing: border-box;
    font-family: var(--syd-font, 'Barlow Condensed', Arial, sans-serif);
    font-size: 15px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.dnncutlist .cl-input:focus,
.dnncutlist input[type="text"]:focus,
.dnncutlist textarea:focus {
    outline: none;
    border-color: var(--syd-primary, #0071b9);
    box-shadow: 0 0 0 2px rgba(0, 113, 185, 0.15);
}

.dnncutlist .cl-notes {
    grid-column: 1 / -1;
}

.dnncutlist .cl-header-status {
    grid-column: 1 / -1;
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 4px;
}

.dnncutlist .cl-saved {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid #a5d6a7;
    background: #e8f5e9;
    color: #2e7d32;
    font-weight: 700;
    font-size: 13px;
}

.dnncutlist .cl-error {
    display: inline-block;
    padding: 8px 10px;
    border-radius: 6px;
    background: #fef6f6;
    border: 1px solid #f5c6cb;
    color: #d32f2f;
    font-weight: 700;
}

/* Focused validation highlighting (field-level) */
.dnncutlist .cl-input-error {
    border-color: #d32f2f !important;
    box-shadow: 0 0 0 2px rgba(211, 47, 47, 0.15) !important;
}

.dnncutlist .cl-input-error:focus {
    border-color: #d32f2f !important;
    box-shadow: 0 0 0 3px rgba(211, 47, 47, 0.2) !important;
}

@keyframes clErrorPulse {
    0%   { transform: translateX(0); }
    25%  { transform: translateX(-2px); }
    50%  { transform: translateX(2px); }
    75%  { transform: translateX(-1px); }
    100% { transform: translateX(0); }
}

.dnncutlist .cl-input-error {
    animation: clErrorPulse .18s ease-in-out 2;
}

/* Info line (UX guidance / auto-adjust notes) */
.dnncutlist .cl-info {
    display: block;
    margin-top: 6px;
    font-weight: 600;
    color: var(--syd-primary, #0071b9);
}

.dnncutlist .cl-header-actions {
    display: flex;
    justify-content: flex-start;
    margin-top: 14px;
}

.dnncutlist .cl-divider {
    border: 0;
    height: 1px;
    background: #e0e0e0;
    margin: 14px 0 18px;
}


/* ============================================================
   Buttons
   ============================================================ */

.dnncutlist .cl-btn {
    border-radius: 20px;
    border: 1px solid var(--syd-primary, #0071b9);
    background: var(--syd-primary, #0071b9);
    color: #fff;
    font-family: var(--syd-font, 'Barlow Condensed', Arial, sans-serif);
    font-weight: 700;
    font-size: 14px;
    padding: 10px 14px;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
    height: 42px;
    white-space: nowrap;
}

.dnncutlist .cl-btn:hover {
    background: var(--syd-dark-blue, #2d4c72);
    border-color: var(--syd-dark-blue, #2d4c72);
}

.dnncutlist .cl-btn-primary {
    background: var(--syd-primary, #0071b9);
    border-color: var(--syd-primary, #0071b9);
}

.dnncutlist .cl-btn-danger {
    border-color: #d32f2f;
    background: #fff;
    color: #d32f2f;
}

.dnncutlist .cl-btn-danger:hover {
    background: #d32f2f;
    border-color: #d32f2f;
    color: #fff;
}


/* ============================================================
   CutList Groups + Lines UI
   ============================================================ */

.dnncutlist .cl-group-wrapper{
	border: 1px solid #e0e0e0;
	border-radius: 8px;
	background: #f0f4f8;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    padding: 14px;
    margin: 14px 0;
}

.dnncutlist .cl-group {
    
}

.dnncutlist .cl-group-header {
    padding-bottom: 12px;
    border-bottom: 1px solid #eee;
    margin-bottom: 10px;
	margin-top: 15px;
	border-top: 1px solid #000;
    padding-top: 10px;
}

.dnncutlist .cl-group-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.dnncutlist .cl-h {
    font-size: 20px;
    font-weight: 700;
    color: var(--syd-primary, #0071b9);
    letter-spacing: .2px;
    font-family: var(--syd-font, 'Barlow Condensed', Arial, sans-serif);
}

.dnncutlist .cl-group-controls {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr auto;
    gap: 12px;
    align-items: end;
}

/* Inputs + selects within groups */
.dnncutlist .cl-field input[type="text"],
.dnncutlist .cl-field textarea,
.dnncutlist .cl-field select {
    width: 100%;
    height: 42px;
    box-sizing: border-box;
    border-radius: 6px;
    border: 1px solid #ccc;
    background: #fff;
    color: var(--syd-text-body, #424242);
    padding: 8px 10px;
    font-family: var(--syd-font, 'Barlow Condensed', Arial, sans-serif);
    font-size: 15px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.dnncutlist .cl-field textarea {
    height: auto;
    min-height: 90px;
}

.dnncutlist .cl-field select option {
    background: #fff;
    color: var(--syd-text-body, #424242);
}

.dnncutlist .cl-field input:focus,
.dnncutlist .cl-field select:focus,
.dnncutlist .cl-field textarea:focus {
    outline: none;
    border-color: var(--syd-primary, #0071b9);
    box-shadow: 0 0 0 2px rgba(0, 113, 185, 0.15);
}


/* ============================================================
   Lines
   ============================================================ */

.dnncutlist .cl-line {
    border-top: 1px solid #777;
    padding: 12px 0;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 6px 14px;
}

/* Part number label — spans both grid columns */
.dnncutlist .cl-line-header {
    grid-column: 1 / -1;
    padding-bottom: 4px;
}

.dnncutlist .cl-part-num {
    font-size: 15px;
    font-weight: 700;
    color: var(--syd-text-dark, #363e4c);
    font-family: var(--syd-font, 'Barlow Condensed', Arial, sans-serif);
    letter-spacing: .1px;
}

.dnncutlist .cl-line-main {
    display: grid;
    grid-template-columns: 2.2fr .8fr .8fr .6fr .7fr;
    gap: 12px;
    align-items: end;
}

.dnncutlist .cl-desc input[type="text"] {
    width: 100%;
}

.dnncutlist .cl-line-status {
    grid-column: 1 / -1;
    display: flex;
    gap: 10px;
    align-items: center;
    margin-top: 6px;
}

.dnncutlist .cl-line-side {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.dnncutlist .cl-line-actions {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 22px;
    margin-bottom: 16px;
}

/* Wrapper for Add Cut Size Item + Add New Material buttons at bottom of each group */
.dnncutlist .cl-group-footer-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
    align-items: center;
}

.dnncutlist .cl-addline {
    margin-top: 0; /* spacing now handled by the flex wrapper */
}

/* Material Type search filter */
.dnncutlist .mat-type-filter {
    height: 34px !important;
    margin-bottom: 4px !important;
    font-size: 13px;
    opacity: .85;
}

.dnncutlist .mat-type-filter::placeholder {
    color: #999;
    font-style: italic;
}


/* ============================================================
   Grain Direction Header
   ============================================================ */

.dnncutlist .panelPreview,
.dnncutlist .edge-grid {
    position: relative;
    padding-top: 36px;
}

.dnncutlist .grain-header {
    position: absolute;
    top: 6px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    font-weight: 600;
    color: var(--syd-text-dark, #363e4c);
    pointer-events: none;
    text-align: center;
    margin-left: Calc((100% - 100px) / 2);
}

.dnncutlist .grain-arrow {
    font-size: 16px;
    font-weight: bold;
}


/* ============================================================
   Edging Highlights
   ============================================================ */

.dnncutlist .panelCanvas .edge {
    position: absolute;
    pointer-events: none;
    opacity: 0;
    transition: opacity .15s ease;
}

.dnncutlist .panelCanvas .edge.on {
    opacity: 1;
}

.dnncutlist .panelCanvas .edge.edge-top,
.dnncutlist .panelCanvas .edge.edge-bottom {
    left: 0;
    right: 0;
    height: 4px;
    background: var(--syd-primary, #0071b9);
}

.dnncutlist .panelCanvas .edge.edge-left,
.dnncutlist .panelCanvas .edge.edge-right {
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--syd-primary, #0071b9);
}

.dnncutlist .panelCanvas .edge.edge-top    { top: 0; }
.dnncutlist .panelCanvas .edge.edge-bottom { bottom: 0; }
.dnncutlist .panelCanvas .edge.edge-left   { left: 0; }
.dnncutlist .panelCanvas .edge.edge-right  { right: 0; }


/* ============================================================
   Panel Dimension Badges
   ============================================================ */

.dnncutlist .panelDim {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 6px;
    background: var(--syd-primary, #0071b9);
    color: #fff;
    font-weight: 500;
    font-size: 14px;
    line-height: 1;
    white-space: nowrap;
    border: 1px solid rgba(0, 113, 185, 0.6);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

/* Image scaling */
.dnncutlist .panelPreview {
    position: relative;
    width: 220px;
    height: 140px;
    flex-shrink: 0;
}

.dnncutlist .panelCanvas {
    position: relative;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 6px;
    overflow: visible;
}

.dnncutlist .panelCanvas img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    border-radius: 6px;
}

/* Dimension overlays (Width/Length) */
.dnncutlist .panelCanvas .panelDim {
    position: absolute;
    z-index: 20;
    pointer-events: none;
    padding: 4px 8px;
    border-radius: 6px;
    background: var(--syd-primary, #0071b9);
    color: #fff;
    font-weight: 500;
    font-size: 14px;
    line-height: 1;
    white-space: nowrap;
}

.dnncutlist .panelCanvas .panelDim-width {
    left: calc(100% + 10px);
    top: calc((100% - 65px) / 2);
    right: auto;
    bottom: auto;
    transform: translateY(-50%) rotate(90deg);
    transform-origin: left center;
    margin-left: 10px;
}

.dnncutlist .panelCanvas .panelDim-length {
    left: 50%;
    top: calc(100% + 10px);
    right: auto;
    bottom: auto;
    transform: translateX(-50%);
}


/* ============================================================
   Processing Overlay
   ============================================================ */

.dnncutlist .dnncl-processing {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.6);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dnncutlist .dnncl-processing-card {
    background: #fff;
    padding: 18px 22px;
    border-radius: 8px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 12px;
}

.dnncutlist .dnncl-spinner {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 3px solid rgba(0, 0, 0, 0.15);
    border-top-color: var(--syd-primary, #0071b9);
    animation: dnnclSpin 0.8s linear infinite;
}

.dnncutlist .dnncl-processing-text {
    font-size: 14px;
    font-weight: 600;
    color: var(--syd-text-dark, #363e4c);
}

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


/* ============================================================
   FOOTER
   ============================================================ */

.dnncutlist .cl-footer {
    background: var(--syd-bg-light, #f4f4f4);
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    padding: 16px;
    margin: 16px 0 10px;
    color: var(--syd-text-body, #424242);
}

.dnncutlist .cl-footer-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.dnncutlist .cl-footer-notes {
    margin-bottom: 14px;
}

.dnncutlist .cl-footer-upload {
    margin-bottom: 14px;
}

/* Confirmed (server-rendered) file list — subtle tint to distinguish from pending */
.dnncutlist .syd-file-list-confirmed .syd-file-item {
    background: #eaf4ea;
    border-color: #c3e6c3;
}

.dnncutlist .cl-footer-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 14px;
}

.dnncutlist .cl-btn-submit {
    padding: 12px 18px;
    font-size: 15px;
    letter-spacing: .2px;
}


/* ============================================================
   EDGE POPUP MODAL
   ============================================================ */

.dnncutlist .edge-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: none;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(2px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 16px 0;
}

.dnncutlist .edge-modal-content {
    position: relative;
    width: min(760px, calc(100vw - 32px));
    margin: 16px auto;
    padding: 22px 22px 18px;
    background: #fff;
    border: 1px solid #e0e0e0;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    color: var(--syd-text-body, #424242);
    max-height: none;
    overflow: visible;
}

.dnncutlist .edge-modal-content h3 {
    margin: 0 0 14px 0;
    font-size: 22px;
    letter-spacing: .2px;
    color: var(--syd-primary, #0071b9);
    font-family: var(--syd-font, 'Barlow Condensed', Arial, sans-serif);
}

/* Close button (top-right X) */
.dnncutlist .edge-close {
    position: absolute;
    top: 10px;
    right: 12px;
    width: 52px;
    height: 52px;
    line-height: 52px;
    text-align: center;
    cursor: pointer;
    user-select: none;
    font-size: 36px;
    font-weight: 800;
    color: var(--syd-primary, #0071b9);
}

.dnncutlist .edge-close:hover {
    color: var(--syd-dark-blue, #2d4c72);
}

/* Stacked dropdowns */
.dnncutlist .edge-modal-content label {
    display: inline-block !important;
    margin: 0 !important;
    font-weight: 600;
    text-align: center;
    white-space: nowrap;
    color: var(--syd-text-dark, #363e4c);
}

.dnncutlist .edge-modal-content select {
    width: 100%;
    max-width: 560px;
    background: #fff;
    color: var(--syd-text-body, #424242);
    border: 1px solid #ccc;
    border-radius: 6px;
    padding: 10px 12px;
    height: 44px;
    box-sizing: border-box;
    font-family: var(--syd-font, 'Barlow Condensed', Arial, sans-serif);
    font-size: 15px;
}

.dnncutlist .edge-grid span,
.dnncutlist .edge-grid .aspNetDisabled {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.dnncutlist .edge-modal-content select:focus {
    outline: none;
    border-color: var(--syd-primary, #0071b9);
    box-shadow: 0 0 0 2px rgba(0, 113, 185, 0.15);
}

.dnncutlist .edge-modal-content select option {
    background: #fff;
    color: var(--syd-text-body, #424242);
}

/* Error line */
.dnncutlist .popup-error {
    display: block;
    margin: 10px 0 0;
    font-weight: 700;
    color: #d32f2f;
}

/* All edges checkbox */
.dnncutlist .edge-modal-content input[type="checkbox"] {
    transform: scale(1.25);
    margin-right: 10px;
    accent-color: var(--syd-primary, #0071b9);
}

.dnncutlist .edge-modal-content .edge-actions {
    display: flex;
    gap: 16px;
    justify-content: flex-start;
    margin-top: 18px;
}

/* Edge action buttons */
.dnncutlist .edge-actions input[type="submit"],
.dnncutlist .edge-actions button {
    min-width: 160px;
    height: 50px;
    border-radius: 6px;
    border: 1px solid var(--syd-primary, #0071b9);
    background: var(--syd-primary, #0071b9);
    color: #fff;
    font-size: 18px;
    font-family: var(--syd-font, 'Barlow Condensed', Arial, sans-serif);
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s;
}

.dnncutlist .edge-actions input[type="submit"]:hover,
.dnncutlist .edge-actions button:hover {
    background: var(--syd-dark-blue, #2d4c72);
    border-color: var(--syd-dark-blue, #2d4c72);
}

/* Cancel should look secondary */
.dnncutlist #btnEdgingCancel {
    background: #fff;
    color: var(--syd-primary, #0071b9);
    border-color: var(--syd-primary, #0071b9);
}

.dnncutlist #btnEdgingCancel:hover {
    background: var(--syd-bg-light, #f4f4f4);
}


/* ============================================================
   EDGE PREVIEW GRID
   ============================================================ */

.dnncutlist .edge-grid {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    grid-template-rows: auto auto auto;
    gap: 14px 18px;
    align-items: center;
    justify-items: center;
    margin-top: 14px;
}

.dnncutlist .edge-grid-top    { grid-column: 2; grid-row: 1; }
.dnncutlist .edge-grid-left   { grid-column: 1; grid-row: 2; justify-self: end; }
.dnncutlist .edge-grid-center { grid-column: 2; grid-row: 2; }
.dnncutlist .edge-grid-right  { grid-column: 3; grid-row: 2; justify-self: start; }
.dnncutlist .edge-grid-bottom { grid-column: 2; grid-row: 3; }

.dnncutlist .edge-grid label {
    margin: 0;
    font-weight: 600;
    color: var(--syd-text-dark, #363e4c);
}

/* Preview block inside the grid */
.dnncutlist .edge-preview {
    position: relative;
    width: 360px;
    max-width: 55vw;
    /* height: auto overrides the 140px set by .panelPreview so aspect-ratio works */
    height: auto;
    aspect-ratio: 4 / 3;
    border-radius: 8px;
    overflow: hidden;
    display: block;
    background: var(--syd-bg-light, #f4f4f4);
    border: 1px solid #e0e0e0;
    /* Small bottom padding keeps the canvas off the overflow:hidden edge so the
       edge-bottom highlight is never clipped */
    padding-bottom: 8px;
    box-sizing: content-box;
}

/* Edge grid: put dimension badges next to checkboxes (popup) */
.dnncutlist .edge-grid-right,
.dnncutlist .edge-grid-bottom {
    display: flex;
    align-items: center;
    gap: 12px;
}

.dnncutlist .edge-grid-right  { justify-self: start; }
.dnncutlist .edge-grid-bottom { justify-self: center; }

.dnncutlist .edge-grid-right .panelDim,
.dnncutlist .edge-grid-bottom .panelDim {
    position: relative;
    left: auto;
    top: auto;
    right: auto;
    bottom: auto;
    transform: none;
    pointer-events: none;
}

.dnncutlist .edge-grid-right .panelDim-width {
    transform: rotate(90deg);
    transform-origin: left center;
    margin-bottom: calc((100% - 65px) / 2);
    margin-left: 10px;
}


/* Edge highlight bars (popup) */
.dnncutlist .edge {
    position: absolute;
    opacity: 0;
    transition: opacity .15s ease;
    pointer-events: none;
}

.dnncutlist .edge.on {
    opacity: 1;
}

.dnncutlist .edge.edge-top,
.dnncutlist .edge.edge-bottom {
    left: 0;
    right: 0;
    height: 6px;
    background: var(--syd-primary, #0071b9);
}

.dnncutlist .edge.edge-left,
.dnncutlist .edge.edge-right {
    top: 0;
    bottom: 0;
    width: 6px;
    background: var(--syd-primary, #0071b9);
}

.dnncutlist .edge.edge-top    { top: 0; }
.dnncutlist .edge.edge-bottom { bottom: 0; }
.dnncutlist .edge.edge-left   { left: 0; }
.dnncutlist .edge.edge-right  { right: 0; }


/* ============================================================
   GDPR CONSENT
   ============================================================ */

/* Consent — amber box comes from .syd-consent-group in syd-components.css.
   These rules handle the inner layout only. */

.dnncutlist .cl-consent-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.dnncutlist .cl-consent-chk input[type="checkbox"] {
    margin-top: 3px;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    accent-color: var(--syd-primary, #0071b9);
    cursor: pointer;
}

.dnncutlist .cl-consent-label {
    font-size: 13px;
    color: var(--syd-text-body, #424242);
    line-height: 1.5;
    cursor: pointer;
}

.dnncutlist .cl-consent-label a {
    color: var(--syd-primary, #0071b9);
    text-decoration: underline;
}

.dnncutlist .cl-consent-error {
    display: block;
    margin-top: 8px;
    font-size: 13px;
}


/* ============================================================
   Thank You Panel
   (uses .syd-thankyou from shared library for outer wrapper)
   ============================================================ */

.dnncutlist .syd-thankyou .syd-thankyou-content h3 {
    color: var(--syd-primary, #0071b9);
    font-family: var(--syd-font, 'Barlow Condensed', Arial, sans-serif);
    font-size: 16px;
    font-weight: 700;
    margin: 20px 0 10px;
}

.dnncutlist .syd-thankyou .syd-thankyou-content p {
    font-size: 14px;
    line-height: 1.6;
    margin: 0 0 8px;
}


/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 980px) {
    .dnncutlist .cl-group-controls {
        grid-template-columns: 1fr;
    }

    .dnncutlist .cl-line {
        grid-template-columns: 1fr;
    }

    .dnncutlist .cl-line-side {
        justify-content: center;
    }

    /* rptLine on mobile:
       Row 1 — Description (full width)
       Row 2 — Length | Width | Qty (3 equal columns)
       Status/grain column tucks under as needed */
    .dnncutlist .cl-line-main {
        grid-template-columns: 1fr 1fr 1fr;
    }

    .dnncutlist .cl-line-main .cl-desc {
        grid-column: 1 / -1;
    }

    .dnncutlist .cl-line-main .cl-desc input[type="text"] {
        width: 100%;
        min-width: 0;
        max-width: none;
    }

    .dnncutlist .cl-line-main input[name$="txtLength"],
    .dnncutlist .cl-line-main input[name$="txtWidth"],
    .dnncutlist .cl-line-main input[name$="txtQty"] {
        width: 100%;
        min-width: 0;
        max-width: none;
        text-align: center;
    }

    .dnncutlist .cl-line-main select[name$="ddlGrain"] {
        width: 100%;
        min-width: 0;
        max-width: none;
    }

    .dnncutlist .panelPreview {
        position: relative;
        width: 120px;
        height: 90px;
        flex-shrink: 0;
        padding-right: 35px;
        padding-bottom: 22px;
        box-sizing: border-box;
    }

    .dnncutlist .panelCanvas .panelDim {
        font-size: 11px;
        padding: 3px 6px;
    }

    .dnncutlist .cl-header-fields {
        grid-template-columns: repeat(2, minmax(160px, 1fr));
    }
}

@media (max-width: 680px) {
    .dnncutlist .edge-grid {
        display: grid !important;
        grid-template-columns: 90px auto 90px;
        gap: 8px 8px;
        align-items: center;
        justify-content: center;
        justify-items: center;
    }

    .dnncutlist .edge-grid-top,
    .dnncutlist .edge-grid-left,
    .dnncutlist .edge-grid-center,
    .dnncutlist .edge-grid-right,
    .dnncutlist .edge-grid-bottom {
        justify-self: center;
    }

    .dnncutlist .edge.edge-top,
    .dnncutlist .edge.edge-bottom {
        height: 4px;
    }

    .dnncutlist .edge.edge-left,
    .dnncutlist .edge.edge-right {
        width: 4px;
    }

    .dnncutlist .edge-preview {
        width: 140px;
        max-width: 48vw;
    }

    .dnncutlist .edge-grid label {
        font-size: 13px;
        white-space: nowrap;
        text-align: center;
    }

    .dnncutlist .edge-actions {
        flex-direction: column;
        align-items: stretch;
        margin-top: 16px;
    }

    .dnncutlist .edge-actions input[type="submit"],
    .dnncutlist .edge-actions button {
        width: 100%;
    }
}

@media (max-width: 520px) {
    /* Keep Length/Width/Qty in a 3-column row down to the smallest viewports —
       they're short numeric values and stacking wastes too much vertical space */

    .dnncutlist .cl-btn {
        width: 100%;
    }

    .dnncutlist .cl-header-top {
        flex-direction: column;
        align-items: stretch;
    }

    .dnncutlist .cl-header-fields {
        grid-template-columns: 1fr;
    }

    .dnncutlist .cl-header-danger .cl-btn {
        width: 100%;
    }

    .dnncutlist .cl-header-actions .cl-btn {
        width: 100%;
    }

    .dnncutlist .cl-upload-btn {
        width: 100%;
    }
}


/* ============================================================
   Accessibility
   ============================================================ */

@media (forced-colors: active) {
    .dnncutlist .cl-btn {
        border: 2px solid ButtonText;
    }

    .dnncutlist .cl-input:focus,
    .dnncutlist .cl-field input:focus,
    .dnncutlist .cl-field select:focus {
        outline: 2px solid Highlight;
    }
}

@media (prefers-reduced-motion: reduce) {
    .dnncutlist .cl