* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Light theme (default) - Cyan accent matching dark mode */
:root {
    --bg-primary: #f4f1ea;
    --bg-secondary: #fffdf8;
    --bg-accent: #edeae2;
    --bg-card: #fffdf8;
    --text-primary: #1c2733;
    --text-secondary: #45525f;
    --text-muted: #8a94a0;
    --border-color: #d8d2c4;
    --border-hover: #c9c2b2;
    --border-accent: #2f5d8f;
    --accent-primary: #2f5d8f;
    --accent-hover: #264b74;
    --accent-light: rgba(47, 93, 143, 0.1);
    --accent-text: #264b74;
    --success: #15803d;
    --warning: #b45309;
    --error: #b91c1c;
    --header-bg: linear-gradient(135deg, #1c2733 0%, #2a3744 100%);
    --shadow-sm: 0 1px 3px rgba(28,39,51,0.08);
    --shadow-md: 0 4px 12px rgba(28,39,51,0.10);
    --input-bg: #fffdf8;
    --input-border: #d8d2c4;
}

/* Dark theme */
[data-theme="dark"] {
    --bg-primary: #f4f1ea;
    --bg-secondary: #fffdf8;
    --bg-accent: #edeae2;
    --text-primary: #1c2733;
    --text-secondary: #45525f;
    --text-muted: #8a94a0;
    --border-color: #d8d2c4;
    --border-accent: #2f5d8f;
    --accent-primary: #2f5d8f;
    --accent-light: rgba(47, 93, 143, 0.12);
    --accent-text: #264b74;
    --header-bg: linear-gradient(135deg, #1c2733 0%, #2a3744 100%);
    --shadow-sm: 0 1px 3px rgba(28,39,51,0.08);
    --shadow-md: 0 4px 12px rgba(28,39,51,0.10);
    --input-bg: #fffdf8;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--bg-primary);
    min-height: 100vh;
    color: var(--text-primary);
    line-height: 1.6;
    transition: background 0.3s ease, color 0.3s ease;
}

.container {
    max-width: 880px;
    margin: 0 auto;
    padding: 16px;
}

/* Theme toggle button */
.theme-toggle {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(28,39,51,0.15);
    border: 1px solid rgba(28,39,51,0.2);
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 1rem;
    z-index: 10;
    transition: all 0.2s;
}
.theme-toggle:hover {
    background: rgba(28,39,51,0.25);
}

header {
    text-align: center;
    margin-bottom: 30px;
}

.header-banner {
    background: var(--header-bg);
    border-radius: 16px;
    padding: 28px 24px;
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(28,39,51,0.05);
}

.header-content {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 14px;
}

.logo-icon {
    width: 48px;
    height: 48px;
    color: #2f5d8f;
    filter: drop-shadow(0 2px 4px rgba(6, 182, 212, 0.3));
}

.logo-icon svg {
    width: 100%;
    height: 100%;
}

.logo-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.logo-freight {
    font-size: 1.9rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.5px;
    line-height: 1;
}

.logo-deck {
    font-size: 1.9rem;
    font-weight: 700;
    color: #2f5d8f;
    letter-spacing: -0.5px;
    line-height: 1;
}

.logo-tagline {
    font-size: 0.7rem;
    color: rgba(28,39,51,0.6);
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-top: 4px;
    font-weight: 500;
}

.header-logo {
    max-height: 45px;
    width: auto;
    filter: brightness(0) invert(1);
}

.header-user {
    position: absolute;
    top: 12px;
    right: 16px;
    display: none; /* Hidden by default, shown by JS when logged in */
    align-items: center;
    gap: 10px;
    color: rgba(28,39,51,0.9);
    font-size: 0.85rem;
    z-index: 10;
}

.header-user .btn-outline {
    background: transparent;
    border: 1px solid rgba(28,39,51,0.3);
    color: rgba(28,39,51,0.9);
    padding: 4px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
}

.header-user .btn-outline:hover {
    background: rgba(28,39,51,0.1);
    border-color: rgba(28,39,51,0.5);
}

header h1 {
    color: #fff;
    font-size: 1.8rem;
    margin-bottom: 2px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
    font-weight: 700;
    letter-spacing: 0.5px;
}

.subtitle {
    color: rgba(28,39,51,0.9);
    font-size: 1.1rem;
    font-weight: 300;
}

.start-fresh-btn {
    margin-top: 15px;
    padding: 8px 20px;
    background: rgba(28,39,51,0.15);
    border: 1px solid rgba(28,39,51,0.3);
    border-radius: 20px;
    color: rgba(28,39,51,0.9);
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
    position: relative;
    z-index: 2;
}

.start-fresh-btn:hover {
    background: rgba(28,39,51,0.25);
    border-color: rgba(28,39,51,0.5);
    color: #fff;
}

/* Collapsible Section */
.collapsible {
    padding: 0;
}

.collapsible-header {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 15px 20px;
    background: var(--bg-accent);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-align: left;
    transition: background 0.2s;
}

.collapsible-header:hover {
    background: var(--border-color);
}

.collapsible-header .collapse-icon {
    font-size: 0.8rem;
    transition: transform 0.2s;
}

.collapsible.open .collapse-icon {
    transform: rotate(90deg);
}

.collapsible-header .hint {
    margin-left: auto;
    font-weight: normal;
}

.collapsible-content {
    padding: 20px;
    border-top: 1px solid var(--border-color);
}

/* Section Header with inline units */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.section-header h2 {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.unit-selectors-inline {
    display: flex;
    gap: 8px;
    align-items: center;
}

.unit-selectors-inline select {
    padding: 6px 10px;
    font-size: 0.85rem;
}

/* Input Mode Toggle */
.input-mode-toggle {
    display: flex;
    background: var(--bg-accent);
    border-radius: 6px;
    padding: 2px;
    gap: 2px;
}
.input-mode-toggle .mode-btn {
    padding: 5px 12px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.15s;
}
.input-mode-toggle .mode-btn:hover {
    color: var(--text-primary);
}
.input-mode-toggle .mode-btn.active {
    background: var(--accent-primary);
    color: #fff;
}

/* Ft+In inputs in table cells */
.dim-ft-in {
    display: flex;
    align-items: center;
    gap: 2px;
}
.dim-ft-in input {
    width: 38px;
    padding: 6px 4px;
    text-align: center;
}
.dim-ft-in .dim-label {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* Add Piece Button */
.btn-add-piece {
    width: 100%;
    padding: 12px;
    margin-top: 10px;
    background: #f7f4ec;
    border: 2px dashed #2f5d8f;
    border-radius: 6px;
    color: #2f5d8f;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-add-piece:hover {
    background: #e0f0ff;
    border-color: #2f5d8f;
    color: #2f5d8f;
}

/* Upload Section */
.upload-section {
    margin-bottom: 20px;
}

.upload-section:not(.collapsible) {
    display: flex;
    gap: 15px;
    align-items: flex-start;
}

/* Paste Target Box */
.paste-target-container {
    margin-bottom: 15px;
}

.paste-target {
    border: 3px dashed var(--accent-primary);
    border-radius: 12px;
    padding: 40px 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background: var(--bg-accent);
    outline: none;
}

.paste-target:hover,
.paste-target:focus {
    border-color: var(--border-accent);
    background: var(--accent-light);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.2);
}

.paste-target:focus {
    border-style: solid;
}

.paste-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.paste-text {
    font-size: 1.1rem;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.paste-text kbd {
    background: #edeae2;
    color: #fff;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.85rem;
    font-family: inherit;
    margin: 0 2px;
}

.paste-hint {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.file-types-inline {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed var(--border-color);
}

.paste-target.drag-over {
    border-color: #15803d;
    background: linear-gradient(135deg, #e8f8f0 0%, #d4f5e4 100%);
}

.paste-target-container.hidden {
    display: none;
}

/* File upload option */
.upload-file-option {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #d8d2c4;
}

.upload-file-option .divider-text {
    color: #95a5a6;
    font-size: 0.9rem;
}

.upload-file-option .file-types {
    color: #7f8c8d;
    font-size: 0.8rem;
}

/* Excel preview */
.excel-preview {
    background: linear-gradient(135deg, #d9ead9 0%, #c8e6c9 100%);
    border: 2px solid #15803d;
    border-radius: 12px;
    padding: 30px;
    text-align: center;
}

.excel-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.excel-icon {
    font-size: 2.5rem;
}

.excel-filename {
    font-size: 1.1rem;
    font-weight: 600;
    color: #15803d;
}

.upload-zone {
    flex: 1;
    border: 2px dashed #d8d2c4;
    border-radius: 8px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background: #fffdf8;
}

.upload-zone:hover {
    border-color: #2f5d8f;
    background: #f7f4ec;
}

.upload-zone.drag-over {
    border-color: #2f5d8f;
    background: #f7f4ec;
}

.upload-icon {
    font-size: 2rem;
    display: block;
    margin-bottom: 10px;
}

.upload-hint {
    font-size: 0.85rem;
    color: #8a94a0;
    margin-top: 5px;
}

.upload-area {
    flex: 1;
}

.upload-tips {
    margin-top: 12px;
    padding: 12px 15px;
    background: var(--bg-accent);
    border-radius: 6px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.upload-tips .tips-header {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.upload-tips ul {
    margin: 0;
    padding-left: 18px;
}

.upload-tips li {
    margin: 3px 0;
}

.upload-tips strong {
    color: var(--text-primary);
}

.upload-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.image-preview {
    max-width: 100%;
    max-height: 300px;
    border-radius: 4px;
}

.upload-zone.has-image {
    padding: 15px;
}

.ocr-status {
    margin-top: 10px;
    padding: 10px 15px;
    border-radius: 6px;
    font-size: 0.9rem;
}

.ocr-status.loading {
    background: #f7f4ec;
    color: #2f5d8f;
}

.ocr-status.success {
    background: #e8f8f5;
    color: #15803d;
}

.ocr-status.error {
    background: #fdedec;
    color: #b91c1c;
}

/* OCR Preview */
.ocr-preview pre {
    background: #f7f4ec;
    padding: 15px;
    border-radius: 6px;
    overflow-x: auto;
    font-family: 'SF Mono', Monaco, 'Courier New', monospace;
    font-size: 0.9rem;
    white-space: pre-wrap;
    word-wrap: break-word;
    max-height: 200px;
    overflow-y: auto;
    margin-bottom: 15px;
}

/* Lane Section */
.lane-section {
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
}

.lane-inputs {
    display: flex;
    gap: 15px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.lane-field {
    flex: 1;
    min-width: 180px;
}

.lane-field label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 5px;
    font-weight: 500;
}

.lane-field input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.95rem;
    background: var(--input-bg);
    color: var(--text-primary);
}

.lane-field input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

.lane-arrow {
    font-size: 1.5rem;
    color: #8a94a0;
    padding-bottom: 26px; /* Align with input boxes accounting for validation span */
    align-self: flex-end;
}

.lane-field-btn {
    display: flex;
    align-items: flex-end;
}

.lane-field-btn .btn {
    height: 42px;
    white-space: nowrap;
}

/* Location Input Validation */
.lane-field {
    position: relative;
}

.lane-field input.input-error {
    border-color: #b91c1c;
    background: rgba(185,28,28, 0.1);
}

.lane-field input.input-valid {
    border-color: #15803d;
    background: rgba(21,128,61, 0.1);
}

.input-feedback {
    font-size: 0.75rem;
    position: absolute;
    bottom: -18px;
    left: 0;
    min-height: 18px;
}

.input-feedback.error {
    color: #b91c1c;
}

.input-feedback.valid {
    color: #15803d;
}

.lane-validation {
    font-size: 0.75rem;
    display: block;
    min-height: 18px;
    margin-top: 2px;
}

.lane-validation.valid {
    color: #15803d;
}

.lane-validation.error {
    color: #b91c1c;
}

.lane-validation.loading {
    color: #5b6875;
    font-style: italic;
}

.lane-validation.suggestion {
    color: #2f5d8f;
}

.suggestion-text {
    color: #5b6875;
}

.suggestion-btn {
    background: #2f5d8f;
    color: #fff;
    border: none;
    padding: 2px 8px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.75rem;
    margin: 0 4px;
    transition: background 0.2s;
}

.suggestion-btn:hover {
    background: #2f5d8f;
}

.suggestion-hint {
    color: #8a94a0;
    font-size: 0.7rem;
}

/* Add padding to lane-inputs for feedback space */
.mapper-inputs {
    padding-bottom: 20px;
}

/* Output lane info */
.output-lane-info {
    background: #f7f4ec;
    border-radius: 6px;
    padding: 12px 16px;
    margin-bottom: 15px;
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    font-size: 0.95rem;
}

.output-lane-info .lane-item {
    display: flex;
    gap: 6px;
}

.output-lane-info .lane-label {
    color: #5b6875;
    font-weight: 500;
}

.output-lane-info .lane-value {
    color: #1c2733;
    font-weight: 600;
}

.output-lane-info .lane-arrow {
    color: #2f5d8f;
    font-size: 1.1rem;
    padding: 0;
}

/* Sections */
section {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--border-accent);
    transition: all 0.2s ease;
}

section:hover {
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
    transform: translateY(-1px);
}

section h2 {
    color: var(--text-primary);
    font-size: 1.15rem;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 8px;
}

.hint {
    font-weight: normal;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Unit Selectors */
.unit-selectors {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.unit-selectors label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Tables */
.table-wrapper {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

th, td {
    padding: 10px 8px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

th {
    background: var(--bg-accent);
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.85rem;
    text-transform: uppercase;
}

input[type="text"],
input[type="number"] {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.9rem;
    background: var(--input-bg);
    color: var(--text-primary);
    transition: all 0.2s ease;
}

input[type="text"]:hover,
input[type="number"]:hover {
    border-color: var(--text-muted);
    background: var(--bg-secondary);
}

input[type="text"]:focus,
input[type="number"]:focus,
select:focus {
    outline: none;
    border-color: var(--accent-primary);
    background: var(--bg-secondary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

select {
    padding: 10px 12px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.9rem;
    background: var(--input-bg);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
}

select:hover {
    border-color: var(--text-muted);
    background: var(--bg-secondary);
}

/* Input widths */
td:nth-child(1) input { min-width: 120px; } /* Description */
td:nth-child(2) input,
td:nth-child(3) input,
td:nth-child(4) input { width: 80px; } /* L, W, H */
td:nth-child(6) input { width: 100px; min-width: 100px; } /* Weight - wider */
td:nth-child(8) input { width: 60px; } /* Qty */

/* Delete button */
.delete-btn {
    background: none;
    border: none;
    color: #b91c1c;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 5px;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.delete-btn:hover {
    opacity: 1;
}

/* Output table */
#outputTable td {
    font-weight: 500;
}

.checkbox-col {
    width: 40px;
    text-align: center;
}

.checkbox-col input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

#outputTable tbody tr {
    transition: background-color 0.2s;
}

#outputTable tbody tr.selected {
    background-color: #f7f4ec;
}

#outputTable tbody tr:not(.selected) {
    opacity: 0.6;
}

#outputTable td:nth-child(2),
#outputTable td:nth-child(3),
#outputTable td:nth-child(4),
#outputTable td:nth-child(5),
#outputTable td:nth-child(6) {
    font-family: 'SF Mono', Monaco, 'Courier New', monospace;
    color: #1c2733;
}

/* Over-dimensional value highlighting */
#outputTable td.od-value,
td.od-value {
    color: #b91c1c !important;
    font-weight: 600 !important;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.15s ease;
    font-weight: 500;
    box-shadow: 0 1px 2px rgba(0,0,0,0.08);
}

.btn-primary {
    background: linear-gradient(135deg, #2f5d8f 0%, #2f5d8f 100%);
    color: #fff;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #3182ce 0%, #2f5d8f 100%);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.btn-secondary {
    background: var(--bg-accent);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: var(--border-color);
}

.action-buttons,
.export-buttons {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    align-items: center;
}

/* Force Build Loads button to far left */
#sendToLoadBuilderBtn {
    order: -100 !important;
}

.export-buttons {
    flex-direction: row !important;
}

.export-buttons .btn-secondary {
    order: 10;
}

.convert-options {
    display: flex;
    gap: 10px;
    align-items: center;
}

.convert-options select {
    padding: 10px;
    border-radius: 6px;
    border: 1px solid #d8d2c4;
    font-size: 0.9rem;
}

/* Footer */
footer {
    text-align: center;
    color: #8a94a0;
    font-size: 0.85rem;
    margin-top: 30px;
}

/* Toast notification */
.toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #fffdf8;
    color: #1c2733;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 0.9rem;
    border: 1px solid rgba(237,234,226, 0.6);
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    animation: toastIn 0.3s ease;
    z-index: 1100;
}

@keyframes toastIn {
    from {
        transform: translateX(-50%) translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

/* Tabs */
.tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 16px;
    background: var(--bg-secondary);
    padding: 6px;
    border-radius: 10px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.tab-btn {
    flex: 1;
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    background: transparent;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.tab-btn:hover {
    background: var(--bg-accent);
    color: var(--text-primary);
}

.tab-btn.active {
    background: var(--accent-primary);
    color: #fff;
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.3);
}

.tab-content {
    display: none;
}

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

/* Subtabs (for Load Planning module) */
.subtab-nav {
    display: flex;
    gap: 4px;
    margin-bottom: 16px;
    background: var(--bg-accent);
    padding: 4px;
    border-radius: 10px;
}

.subtab-btn {
    flex: 1;
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    background: transparent;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.subtab-btn:hover {
    background: rgba(28,39,51,0.3);
}

.subtab-btn.active {
    background: var(--bg-secondary);
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
}

.subtab-content {
    display: none;
}

.subtab-content.active {
    display: block;
}

/* Oversize CTA Banner */
.oversize-cta {
    background: linear-gradient(135deg, #f0e2c4 0%, #f0e2c4 100%);
    border: 2px solid #b45309;
    border-radius: 12px;
    padding: 16px 20px;
    margin: 20px 0;
}

.oversize-cta-content {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.oversize-cta-icon {
    font-size: 1.5rem;
}

.oversize-cta-text {
    flex: 1;
    min-width: 200px;
    color: #92400e;
}

.oversize-cta-text strong {
    color: #78350f;
}

.oversize-cta .btn {
    white-space: nowrap;
}

/* Maybe-Oversize Warning */
.maybe-oversize-warning {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    border: 1px solid #2f5d8f;
    border-radius: 8px;
    padding: 12px 16px;
    margin: 15px 0;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #2f5d8f;
}

.maybe-oversize-warning .warning-icon {
    font-size: 1.2rem;
}

.maybe-oversize-warning .warning-text {
    font-size: 0.9rem;
}

/* Dims & Load Builder Sections */
.dims-section {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
}

.loadbuild-section {
    margin-top: 20px;
}

.loadbuild-section h2 {
    margin-bottom: 10px;
    color: var(--text-primary);
}

/* Permit Checker */
.permit-input-section .permit-dims {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.permit-field {
    flex: 1;
    min-width: 150px;
}

.permit-field label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 5px;
    font-weight: 500;
}

.input-with-unit {
    display: flex;
    gap: 8px;
}

.input-with-unit input {
    flex: 1;
    min-width: 80px;
}

.input-with-unit select {
    width: 60px;
}

/* Ft + In dual input */
.ft-in-input {
    display: flex;
    align-items: center;
    gap: 4px;
}

.ft-in-input input {
    width: 60px;
    padding: 8px 10px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.95rem;
    background: var(--input-bg);
    color: var(--text-primary);
    text-align: center;
}

.ft-in-input input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* Help tooltips */
.help-tip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    background: var(--text-muted);
    color: white;
    border-radius: 50%;
    font-size: 10px;
    font-weight: 600;
    cursor: help;
    margin-left: 4px;
    vertical-align: middle;
}
.help-tip:hover {
    background: var(--accent-primary);
}

.ft-in-input .unit-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    min-width: 20px;
}

/* Trailer Section */
.trailer-section {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #d8d2c4;
}

.trailer-section h3 {
    font-size: 1rem;
    color: #1c2733;
    margin-bottom: 12px;
}

.trailer-selector {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.trailer-selector select {
    flex: 1;
    max-width: 300px;
    padding: 10px 12px;
    font-size: 0.95rem;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    background: var(--input-bg);
    color: var(--text-primary);
    transition: border-color 0.2s;
}

.trailer-selector select:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.trailer-selector select.recommended {
    border-color: #15803d;
    background: rgba(21,128,61, 0.1);
}

.trailer-recommendation {
    font-size: 0.75rem;
    color: #15803d;
    font-weight: 600;
    padding: 0;
    background: transparent;
    border-radius: 0;
    display: inline;
    margin-left: 6px;
}

.rec-badge {
    display: inline-block;
    padding: 3px 10px;
    font-size: 0.72rem;
    font-weight: 600;
    color: #15803d;
    background: rgba(21,128,61, 0.12);
    border: 1px solid rgba(21,128,61, 0.35);
    border-radius: 6px;
    letter-spacing: 0.3px;
    cursor: help;
}

.trailer-recommendation:empty {
    display: none;
}

.custom-deck-input {
    margin-top: 12px;
    padding: 12px 15px;
    background: #f0e2c4;
    border: 1px solid #f0d78c;
    border-radius: 6px;
}

.custom-deck-input label {
    display: block;
    font-size: 0.9rem;
    color: #5b6875;
    margin-bottom: 8px;
    font-weight: 500;
}

.custom-deck-input .input-with-unit {
    max-width: 200px;
}

.custom-deck-input .unit-label {
    padding: 8px 12px;
    background: #f7f4ec;
    border: 1px solid #d8d2c4;
    border-left: none;
    border-radius: 0 4px 4px 0;
    font-size: 0.9rem;
    color: #5b6875;
}

.trailer-info {
    margin-top: 12px;
    background: var(--bg-accent);
    border-radius: 6px;
    padding: 12px 16px;
}

.trailer-specs {
    display: flex;
    gap: 25px;
    flex-wrap: wrap;
}

.trailer-specs .spec {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.trailer-specs .spec strong {
    color: var(--text-primary);
}

#totalHeight {
    color: #2f5d8f;
    font-weight: 600;
}

.height-warning {
    color: #b91c1c !important;
}

.height-ok {
    color: #15803d !important;
}

/* Trailer specs summary */
.trailer-specs-summary {
    display: flex;
    gap: 25px;
    flex-wrap: wrap;
}

.trailer-specs-summary .spec {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.trailer-specs-summary .spec strong {
    color: var(--text-primary);
}

.btn-link {
    background: none;
    border: none;
    color: #2f5d8f;
    cursor: pointer;
    padding: 8px 0 0 0;
    font-size: 0.85rem;
    text-decoration: none;
}

.btn-link:hover {
    text-decoration: underline;
}

/* Expanded Trailer Specs Panel */
.trailer-specs-expanded {
    margin-top: 15px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
}

.specs-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.specs-header h4 {
    margin: 0;
    font-size: 1rem;
    color: var(--text-primary);
}

.specs-header .hint {
    font-size: 0.8rem;
    color: #8a94a0;
}

.specs-grid {
    display: grid;
    gap: 12px;
}

.specs-zone {
    background: #f7f4ec;
    border-radius: 6px;
    padding: 12px;
}

.specs-zone-header {
    font-weight: 600;
    color: #2f5d8f;
    margin-bottom: 8px;
    text-transform: capitalize;
}

.specs-zone-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
}

.spec-item {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.spec-item label {
    font-size: 0.75rem;
    color: #5b6875;
    font-weight: 500;
}

.spec-value {
    font-size: 0.9rem;
    font-weight: 600;
    color: #1c2733;
    padding: 4px 8px;
    background: #fffdf8;
    border: 1px solid transparent;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s;
}

.spec-value:hover {
    border-color: #2f5d8f;
    background: #f7f4ec;
}

.spec-value.editing {
    border-color: #2f5d8f;
    background: #fffdf8;
    outline: none;
}

.spec-value.modified {
    background: #f0e2c4;
    border-color: #b45309;
}

.specs-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    padding-top: 12px;
    border-top: 1px solid #d8d2c4;
}

.specs-modified-notice {
    margin-top: 10px;
    padding: 8px 12px;
    background: #f0e2c4;
    border-radius: 4px;
    font-size: 0.85rem;
    color: #b45309;
}

/* Overall trailer specs row (single zone trailers) */
.specs-overall {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    background: #f7f4ec;
    border-radius: 6px;
    padding: 12px;
}

/* Custom trailer save modal */
.save-trailer-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fffdf8;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    z-index: 1001;
    width: 90%;
    max-width: 400px;
}

.save-trailer-modal h3 {
    margin: 0 0 16px 0;
}

.save-trailer-modal input {
    width: 100%;
    padding: 10px;
    border: 1px solid #d8d2c4;
    border-radius: 6px;
    margin-bottom: 16px;
}

.save-trailer-modal .modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* State Selector */
.state-selector {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.state-selector select {
    flex: 1;
    max-width: 300px;
}

.selected-states {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
    min-height: 40px;
}

.state-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #f7f4ec;
    color: #2f5d8f;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
}

.state-tag .remove-state {
    background: none;
    border: none;
    color: #2f5d8f;
    cursor: pointer;
    font-size: 1rem;
    padding: 0;
    line-height: 1;
    opacity: 0.6;
}

.state-tag .remove-state:hover {
    opacity: 1;
}

.state-tag.canadian {
    background: #fef3e8;
    color: #b91c1c;
    border: 1px solid #f5d0c0;
}

.state-tag.canadian .remove-state {
    color: #b91c1c;
}

.canada-note {
    color: #b91c1c;
    font-weight: 500;
}

.permit-table tr.canadian-row {
    background: rgba(196, 30, 58, 0.06);
}
[data-theme="dark"] .permit-table tr.canadian-row {
    background: rgba(196, 30, 58, 0.12);
}

.permit-table tr.canadian-row:hover {
    background: rgba(196, 30, 58, 0.1);
}
[data-theme="dark"] .permit-table tr.canadian-row:hover {
    background: rgba(196, 30, 58, 0.18);
}

/* Permit Results */
.permit-results {
    margin-top: 20px;
}

.permit-state-result {
    background: #f7f4ec;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    border-left: 4px solid #d8d2c4;
}

.permit-state-result.permit-required {
    border-left-color: #b91c1c;
    background: #fef5f5;
}

.permit-state-result.no-permit {
    border-left-color: #15803d;
    background: #f0fdf4;
}

.permit-state-result h3 {
    margin-bottom: 10px;
    color: #1c2733;
    font-size: 1.1rem;
}

.permit-state-result .permit-status {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.permit-status.required {
    background: #b91c1c;
    color: #fff;
}

.permit-status.not-required {
    background: #15803d;
    color: #fff;
}

.permit-status.escort {
    background: #b45309;
    color: #fff;
    margin-left: 8px;
}

.permit-reasons {
    margin: 10px 0;
}

.permit-reasons li {
    color: #b91c1c;
    margin-left: 20px;
    font-size: 0.9rem;
}

.escort-reasons li {
    color: #b45309;
}

.permit-notes {
    font-size: 0.85rem;
    color: #5b6875;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #d8d2c4;
}

.permit-notes strong {
    color: #45525f;
}

/* Cost Summary Box */
/* Trailer Summary in Results */
.trailer-summary {
    background: #f7f4ec;
    border: 1px solid #d8d2c4;
    border-radius: 10px;
    padding: 15px 20px;
    margin-bottom: 15px;
}

.trailer-summary h3 {
    font-size: 1rem;
    color: #1c2733;
    margin-bottom: 12px;
}

.trailer-summary-grid {
    display: flex;
    gap: 25px;
    flex-wrap: wrap;
}

.trailer-summary-item {
    display: flex;
    gap: 8px;
    align-items: center;
}

.trailer-summary-item .label {
    color: #5b6875;
    font-size: 0.9rem;
}

.trailer-summary-item .value {
    font-weight: 600;
    color: #1c2733;
}

.trailer-summary-item.highlight {
    background: #f7f4ec;
    padding: 6px 12px;
    border-radius: 6px;
}

.trailer-summary-item.highlight .value.height-ok {
    color: #15803d;
}

.trailer-summary-item.highlight .value.height-warning {
    color: #b91c1c;
}

.cost-summary {
    background: linear-gradient(135deg, #edeae2 0%, #2f5d8f 100%);
    color: #fff;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
}

.cost-summary h3 {
    font-size: 1.1rem;
    margin-bottom: 15px;
    opacity: 0.9;
}

.cost-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.cost-item {
    background: rgba(28,39,51,0.1);
    border-radius: 8px;
    padding: 12px 15px;
}

.cost-item.total {
    background: rgba(28,39,51,0.25);
    grid-column: 1 / -1;
}

.cost-label {
    display: block;
    font-size: 0.85rem;
    opacity: 0.85;
    margin-bottom: 4px;
}

.survey-likely-tag {
    display: inline-block;
    background: #b45309;
    color: #fff;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 3px;
    margin-left: 6px;
    font-weight: 600;
}

.cost-value {
    display: block;
    font-size: 1.25rem;
    font-weight: 700;
}

.cost-item.total .cost-value {
    font-size: 1.5rem;
}

.cost-note {
    font-size: 0.8rem;
    opacity: 0.7;
    margin-top: 15px;
    font-style: italic;
}

/* Permit Table */
.permit-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-secondary);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.permit-table th,
.permit-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

.permit-table th {
    background: var(--bg-accent);
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.permit-table tr.permit-row {
    background: rgba(231, 76, 60, 0.08);
}
[data-theme="dark"] .permit-table tr.permit-row {
    background: rgba(231, 76, 60, 0.15);
}

.permit-table .status-yes {
    color: #b91c1c;
    font-weight: 700;
}

.permit-table .status-no {
    color: #15803d;
}

.permit-table .status-maybe {
    color: #b45309;
    font-weight: 600;
}

.permit-table .notes-cell {
    font-size: 0.85rem;
    color: var(--text-secondary);
    max-width: 250px;
}

/* Survey Warning Banner */
.survey-warning {
    background: rgba(243, 156, 18, 0.1);
    border: 2px solid #b45309;
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}
[data-theme="dark"] .survey-warning {
    background: rgba(243, 156, 18, 0.15);
}

.survey-warning strong {
    color: #b45309;
    white-space: nowrap;
}

.survey-warning span {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Travel Restrictions Warning */
.travel-restrictions-warning {
    background: rgba(52, 152, 219, 0.1);
    border: 2px solid #2f5d8f;
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 15px;
}
[data-theme="dark"] .travel-restrictions-warning {
    background: rgba(52, 152, 219, 0.15);
}

.travel-restrictions-warning > strong {
    color: #2f5d8f;
    display: block;
    margin-bottom: 8px;
}

.travel-restrictions-warning .restriction-details {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    font-size: 0.9rem;
}

.travel-restrictions-warning .restriction-details > span {
    color: var(--text-secondary);
}

.travel-restrictions-warning .restriction-note {
    width: 100%;
    color: #5a7d9a;
    font-size: 0.85rem;
    font-style: italic;
    margin-top: 5px;
}

/* Superload Warning */
.superload-warning {
    background: linear-gradient(135deg, #fef2f2 0%, #fde8e8 100%);
    border: 2px solid #b91c1c;
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 15px;
}

.superload-warning > strong {
    color: #c53030;
    display: block;
    margin-bottom: 8px;
    font-size: 1.05rem;
}

.superload-warning .superload-details p {
    margin: 0 0 10px 0;
    color: #742a2a;
    font-size: 0.9rem;
}

.superload-warning .superload-details ul {
    margin: 0 0 10px 20px;
    padding: 0;
    color: #742a2a;
    font-size: 0.9rem;
}

.superload-warning .superload-details li {
    margin-bottom: 4px;
}

.superload-warning .superload-note {
    display: block;
    color: #9b2c2c;
    font-size: 0.85rem;
    font-weight: 600;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #feb2b2;
}

/* Export Actions */
.export-actions {
    display: flex;
    gap: 8px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #d8d2c4;
}

.export-actions .btn {
    font-size: 0.85rem;
}

/* Pieces Queue Section */
.pieces-queue-section {
    background: #fffdf8;
    border: 2px solid #2f5d8f;
    border-radius: 8px;
}

.pieces-queue-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

.pieces-queue-header h2 {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.pieces-queue {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
}

.piece-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: #f7f4ec;
    border: 2px solid #d8d2c4;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.9rem;
}

.piece-chip:hover {
    border-color: #2f5d8f;
    background: #f7f4ec;
}

.piece-chip.active {
    border-color: #2f5d8f;
    background: #f7f4ec;
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.2);
}

.piece-chip.checked {
    border-color: #15803d;
    background: #f0fdf4;
}

.piece-chip.checked::after {
    content: '✓';
    color: #15803d;
    font-weight: bold;
}

.piece-chip .piece-name {
    font-weight: 500;
    color: #1c2733;
}

.piece-chip .piece-dims {
    font-size: 0.8rem;
    color: #5b6875;
}

.piece-chip.tall-piece {
    border-color: #b45309;
    background: #f0e2c4;
}

.pieces-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    padding-top: 10px;
    border-top: 1px solid #d8d2c4;
}

.pieces-counter {
    font-weight: 600;
    color: #1c2733;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.85rem;
}

/* Current piece label in header */
.current-piece-label {
    font-size: 0.9rem;
    font-weight: 500;
    color: #2f5d8f;
    background: #f7f4ec;
    padding: 4px 12px;
    border-radius: 12px;
    margin-left: 10px;
}

/* BETA Tab Styles */
.beta-tab {
    position: relative;
}

.beta-badge {
    font-size: 0.65rem;
    background: #b45309;
    color: #fff;
    padding: 2px 6px;
    border-radius: 8px;
    font-weight: 700;
    vertical-align: middle;
    margin-left: 4px;
}

.beta-badge-large {
    font-size: 0.8rem;
    background: #b45309;
    color: #fff;
    padding: 4px 10px;
    border-radius: 10px;
    font-weight: 700;
    vertical-align: middle;
    margin-left: 8px;
}

.btn-outline-beta {
    background: transparent;
    border: 2px solid #b45309;
    color: #b45309;
    font-weight: 600;
}

.btn-outline-beta:hover {
    background: #f0e2c4;
    border-color: #b45309;
    color: #b45309;
}

/* BETA Banner */
.beta-banner {
    background: linear-gradient(135deg, #f0e2c4 0%, #fef5e6 100%);
    border: 2px solid #b45309;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.beta-banner h2 {
    color: #b7791f;
    border-bottom: none;
    margin-bottom: 10px;
    padding-bottom: 0;
}

.beta-banner > p {
    color: #b45309;
    margin-bottom: 15px;
}

.beta-warnings {
    background: #fffdf8;
    border-radius: 8px;
    padding: 15px;
    font-size: 0.9rem;
    color: #b45309;
}

.beta-warnings ul {
    margin: 10px 0;
    padding-left: 20px;
}

.beta-warnings li {
    margin: 5px 0;
}

.beta-warnings strong {
    color: #b45309;
}

/* Load Builder Header */
.loadbuilder-header {
    background: linear-gradient(135deg, #f7f4ec 0%, #d4ecfa 100%);
    border: 2px solid #2f5d8f;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.loadbuilder-header h2 {
    color: #2f5d8f;
    border-bottom: none;
    margin-bottom: 10px;
    padding-bottom: 0;
}

.loadbuilder-header > p {
    color: #2a3744;
    margin-bottom: 15px;
}

.loadbuilder-warning {
    background: #fffdf8;
    border-radius: 8px;
    padding: 15px;
    font-size: 0.9rem;
    color: #b45309;
    border-left: 4px solid #b45309;
}

.loadbuilder-warning strong {
    color: #b45309;
}

/* State Regulations Styles */
.state-regs-section {
    background: #fffdf8;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.state-regs-section h2 {
    margin: 0 0 10px 0;
    color: #1c2733;
}

.state-regs-section > p {
    color: #5b6875;
    margin-bottom: 25px;
}

.state-selector {
    margin-bottom: 25px;
}

.state-selector label {
    font-weight: 600;
    margin-right: 10px;
}

.state-selector select {
    padding: 10px 15px;
    font-size: 1rem;
    border: 2px solid #d8d2c4;
    border-radius: 6px;
    min-width: 250px;
    cursor: pointer;
}

.state-selector select:focus {
    border-color: #2f5d8f;
    outline: none;
}

.state-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
    gap: 20px;
}

.info-card {
    background: #f7f4ec;
    border: 1px solid #d8d2c4;
    border-radius: 8px;
    padding: 20px;
}

.info-card h3 {
    margin: 0 0 15px 0;
    font-size: 1rem;
    color: #1c2733;
    border-bottom: 2px solid #2f5d8f;
    padding-bottom: 8px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #d8d2c4;
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    color: #5b6875;
    font-weight: 500;
}

.info-value {
    font-weight: 600;
    color: #1c2733;
}

.notes-row {
    flex-direction: column;
    gap: 5px;
}

.notes-row .info-value {
    font-weight: 400;
    font-size: 0.9rem;
    color: #5b6875;
    font-style: italic;
}

/* Disclaimer Banner */
.disclaimer-banner {
    background: linear-gradient(135deg, #f0e2c4 0%, #ffeeba 100%);
    border: 1px solid #b45309;
    border-left: 4px solid #b45309;
    border-radius: 6px;
    padding: 12px 16px;
    margin-bottom: 20px;
    font-size: 0.9rem;
    color: #b45309;
}

.disclaimer-banner strong {
    color: #664d03;
}

/* Full-width info card */
.info-card.full-width {
    grid-column: 1 / -1;
}

/* Load Builder Styles - Drag & Drop */
.loadbuilder-pool {
    background: #fffdf8;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.piece-pool {
    min-height: 80px;
    border: 2px dashed #d8d2c4;
    border-radius: 8px;
    padding: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    transition: all 0.2s;
}

.piece-pool.drag-over {
    border-color: #2f5d8f;
    background: #f7f4ec;
}

.piece-pool .empty-state {
    width: 100%;
    text-align: center;
    color: #8a94a0;
    padding: 20px;
}

/* Draggable Piece */
.draggable-piece {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px;
    background: rgba(255,253,248, 0.8);
    border: 1px solid rgba(100, 116, 139, 0.3);
    border-radius: 6px;
    cursor: grab;
    transition: all 0.2s;
    font-size: 12px;
    user-select: none;
    color: #1c2733;
}

.draggable-piece:hover {
    border-color: #2f5d8f;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.draggable-piece.dragging {
    opacity: 0.5;
    cursor: grabbing;
}

.draggable-piece.tall {
    background: rgba(185,28,28, 0.1);
    border-color: rgba(185,28,28, 0.3);
}

.draggable-piece .piece-name {
    font-weight: 600;
    color: #1c2733;
}

/* Piece number badge in Load Builder */
.piece-num-badge {
    display: inline-block;
    background: #2f5d8f;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 5px;
    border-radius: 3px;
    margin-right: 6px;
}

/* Piece number column in results table */
.piece-num-col {
    width: 40px;
    text-align: center;
}

.piece-number {
    display: inline-block;
    background: #2f5d8f;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 3px;
}

.draggable-piece .piece-dims {
    color: #5b6875;
    font-size: 0.85rem;
}

.draggable-piece .piece-weight {
    color: #8a94a0;
    font-size: 0.8rem;
}

.draggable-piece.stackable {
    border-left: 3px solid #15803d;
}

.stackable-badge {
    margin-left: 6px;
    font-size: 0.75rem;
    color: #15803d;
}

/* Stackable checkbox column in output table */
.stackable-col {
    text-align: center;
    width: 80px;
}

.stackable-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Route Info Panel */
.route-info-panel {
    background: linear-gradient(135deg, #f7f4ec 0%, #2f5d8f 100%);
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    color: #fff;
}

.route-info-panel > div {
    display: flex;
    align-items: center;
    gap: 8px;
}

.route-label {
    font-size: 0.85rem;
    opacity: 0.8;
}

.route-value {
    font-weight: 600;
    font-size: 1rem;
}

.route-note {
    font-size: 0.8rem;
    opacity: 0.7;
    font-style: italic;
}

.permit-warning {
    color: #b45309;
}

.escort-warning {
    color: #b91c1c;
}

.night-warning {
    color: #2f5d8f;
}

/* AI Recommendations */
.ai-recommendations {
    background: #fffdf8;
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.ai-recommendations h4 {
    margin: 0 0 12px 0;
    color: #1c2733;
}

.recommendations-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.recommendation-card {
    background: #f7f4ec;
    border: 1px solid #d8d2c4;
    border-radius: 6px;
    padding: 10px 14px;
    min-width: 180px;
    cursor: pointer;
    transition: all 0.2s;
}

.recommendation-card:hover {
    background: #e8f4f8;
    border-color: #2f5d8f;
}

.recommendation-card.legal {
    border-left: 3px solid #15803d;
}

.recommendation-card.permit-needed {
    border-left: 3px solid #b45309;
}

.recommendation-card .trailer-name {
    font-weight: 600;
    color: #1c2733;
    margin-bottom: 4px;
}

.recommendation-card .trailer-height {
    font-size: 0.85rem;
    color: #5b6875;
}

.recommendation-card .trailer-status {
    font-size: 0.8rem;
    margin-top: 4px;
}

.recommendation-card .trailer-status.legal {
    color: #15803d;
}

.recommendation-card .trailer-status.permit {
    color: #b45309;
}

.recommendation-card .accept-btn {
    margin-top: 8px;
    width: 100%;
    padding: 6px 12px;
    font-size: 0.85rem;
    background: #15803d;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
}

.recommendation-card .accept-btn:hover {
    background: #219a52;
}

.recommendation-card .view-specs-btn {
    width: 100%;
    padding: 4px 8px;
    margin-top: 6px;
    font-size: 0.8rem;
    background: transparent;
    color: #2f5d8f;
    border: 1px solid #d8d2c4;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.recommendation-card .view-specs-btn:hover {
    background: #f7f4ec;
    border-color: #2f5d8f;
}

.recommendation-specs {
    margin-top: 8px;
    padding: 10px;
    background: #fffdf8;
    border: 1px solid #d8d2c4;
    border-radius: 4px;
    font-size: 0.8rem;
}

.recommendation-specs .spec-row {
    margin-bottom: 4px;
    color: #45525f;
}

.recommendation-specs .zones-header {
    margin-top: 8px;
    margin-bottom: 4px;
    color: #1c2733;
}

.recommendation-specs .zone-spec {
    padding-left: 10px;
    color: #5b6875;
    font-size: 0.75rem;
}

/* Accepted Load Plan */
.accepted-plan {
    background: #f0fff4;
    border: 2px solid #15803d;
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 20px;
}

.accepted-plan-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.accepted-plan-header h4 {
    margin: 0;
    color: #15803d;
}

.plan-header-actions {
    display: flex;
    gap: 8px;
}

.accepted-plan-actions {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #15803d;
    display: flex;
    align-items: center;
    gap: 15px;
}

.accepted-plan-actions .btn {
    min-width: 200px;
}

.action-hint {
    font-size: 12px;
    color: #5b6875;
}

.recommendations-actions {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #d8d2c4;
    text-align: center;
}

.recommendations-actions .btn {
    min-width: 160px;
}

.accepted-plan-details {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.plan-truck {
    background: #fffdf8;
    border: 1px solid #d8d2c4;
    border-radius: 6px;
    padding: 12px;
    min-width: 200px;
    flex: 1;
}

.plan-truck-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    font-weight: 600;
    color: #1c2733;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid #d8d2c4;
}

.plan-truck-pieces {
    font-size: 0.85rem;
    color: #5b6875;
}

.plan-truck-pieces li {
    margin: 4px 0;
}

.plan-truck-stats {
    margin-top: 8px;
    font-size: 0.9rem;
    color: #45525f;
    font-weight: 500;
}

.overweight-warning {
    color: #b91c1c;
    font-weight: 700;
    animation: pulse 1s ease-in-out infinite;
}

.od-warning {
    color: #b45309;
    font-weight: 700;
    animation: pulse 1s ease-in-out infinite;
}

.truck-warnings {
    display: flex;
    gap: 10px;
    margin-top: 6px;
    flex-wrap: wrap;
    font-size: 0.85rem;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* Super-heavy and warning alerts */
.super-heavy-alert {
    background: #b91c1c;
    color: white;
    padding: 10px 15px;
    border-radius: 6px;
    margin-bottom: 10px;
    font-size: 13px;
}

.super-heavy-alert strong {
    display: block;
    margin-bottom: 5px;
    font-size: 14px;
}

.plan-warnings {
    background: #f0e2c4;
    border: 1px solid #b45309;
    border-radius: 6px;
    padding: 8px 12px;
    margin: 10px 0;
    font-size: 12px;
}

.warning-item {
    color: #b45309;
    margin: 4px 0;
}

/* OD Truck styling */
.plan-truck.od-truck {
    border-left: 4px solid #b91c1c;
    background: #fff5f5;
}

.plan-truck.legal-truck {
    border-left: 4px solid #15803d;
    background: #f0fff4;
}

.plan-truck-header .od-badge {
    display: inline-block;
    background: #b91c1c;
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 3px;
    margin-left: 8px;
    font-weight: 600;
    width: auto;
    height: auto;
}

.plan-truck-header .legal-badge {
    display: inline-block;
    background: #15803d;
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 3px;
    margin-left: 8px;
    font-weight: 600;
    width: auto;
    height: auto;
}

.od-truck-checkbox {
    width: 18px;
    height: 18px;
    margin-right: 8px;
    vertical-align: middle;
    cursor: pointer;
}

.permit-check-actions {
    width: 100%;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #d8d2c4;
    text-align: center;
}

.permit-check-actions .btn {
    min-width: 280px;
}

.permit-check-note {
    font-size: 12px;
    color: #5b6875;
    margin-top: 8px;
}

/* Trailer breakdown in recommendations */
.trailer-breakdown {
    margin: 8px 0;
    padding: 8px;
    background: rgba(28,39,51,0.01);
    border-radius: 4px;
}

.trailer-breakdown-item {
    font-size: 12px;
    color: #45525f;
    padding: 2px 0;
}

/* Birds-Eye Trailer Visualization */
.trailer-viz-container {
    margin: 12px 0;
    padding: 10px;
    background: #f7f4ec;
    border-radius: 6px;
}

.trailer-viz-label {
    font-size: 11px;
    color: #5b6875;
    margin-bottom: 8px;
    font-weight: 600;
    text-transform: uppercase;
}

.trailer-viz {
    position: relative;
    background: #fffdf8;
    border: 2px solid #c9c2b2;
    border-radius: 4px;
    overflow: hidden;
    margin: 0 auto;
}

.trailer-outline {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 1px dashed #d8d2c4;
    pointer-events: none;
}

.trailer-front,
.trailer-rear {
    position: absolute;
    font-size: 9px;
    color: #8a94a0;
    font-weight: 600;
    text-transform: uppercase;
}

.trailer-front {
    left: 4px;
    top: 50%;
    transform: translateY(-50%) rotate(-90deg);
    transform-origin: left center;
}

.trailer-rear {
    right: 4px;
    top: 50%;
    transform: translateY(-50%) rotate(90deg);
    transform-origin: right center;
}

.trailer-piece {
    position: absolute;
    border: 1px solid rgba(0,0,0,0.3);
    border-radius: 2px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.1s, box-shadow 0.1s;
}

.trailer-piece:hover {
    transform: scale(1.02);
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    z-index: 10;
}

.piece-label {
    font-size: 9px;
    font-weight: 600;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
    text-align: center;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 0 2px;
}

.piece-dims {
    font-size: 8px;
    color: rgba(28,39,51,0.8);
    text-shadow: 0 1px 1px rgba(0,0,0,0.5);
}

.trailer-dims-label {
    font-size: 10px;
    color: #8a94a0;
    text-align: center;
    margin-top: 6px;
}

.trailer-viz-placeholder {
    padding: 20px;
    text-align: center;
    color: #8a94a0;
    font-size: 0.85rem;
    font-style: italic;
    background: #f7f4ec;
    border-radius: 6px;
    border: 1px dashed #d8d2c4;
}

.trailer-piece.oversize-piece {
    box-shadow: 0 0 0 2px #b91c1c;
}

.recommendation-card.has-warnings {
    border-color: #b45309;
    background: #fffef5;
}

/* Truck Groups */
.loadbuilder-trucks {
    background: #fffdf8;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.trucks-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.trucks-header h3 {
    margin: 0;
}

.truck-groups {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Individual Truck */
.truck-group {
    background: #f7f4ec;
    border: 2px solid #d8d2c4;
    border-radius: 10px;
    overflow: hidden;
    transition: all 0.2s;
}

.truck-group.drag-over {
    border-color: #2f5d8f;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

.truck-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: #edeae2;
    color: #fff;
}

.truck-header h4 {
    margin: 0;
    font-size: 1rem;
}

.truck-remove {
    background: transparent;
    border: none;
    color: #b91c1c;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0 5px;
    opacity: 0.7;
}

.truck-remove:hover {
    opacity: 1;
}

.truck-drop-zone {
    min-height: 70px;
    padding: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-content: flex-start;
    background: #fffdf8;
}

.truck-drop-zone .empty-hint {
    width: 100%;
    text-align: center;
    color: #8a94a0;
    padding: 20px;
    font-size: 0.9rem;
    font-style: italic;
}

.truck-footer {
    padding: 12px 15px;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
    background: #f7f4ec;
    border-top: 1px solid #d8d2c4;
}

.truck-stat {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
}

.truck-stat .label {
    color: #5b6875;
}

.truck-stat .value {
    font-weight: 600;
    color: #1c2733;
}

.truck-stat .value.weight-ok {
    color: #15803d;
}

.truck-stat .value.weight-warning {
    color: #b91c1c;
    font-weight: 700;
}

.truck-stat .value.height-ok {
    color: #15803d;
}

.truck-stat .value.height-warning {
    color: #b91c1c;
}

.truck-trailer-select {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.truck-trailer-select select {
    padding: 6px 10px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.85rem;
    background: var(--input-bg);
    color: var(--text-primary);
}

.trailer-recommended {
    font-size: 0.75rem;
    color: #15803d;
    font-weight: 500;
}

/* No trucks message */
.no-trucks-msg {
    text-align: center;
    padding: 30px;
    color: #8a94a0;
}

/* Trucks permit action */
.trucks-permit-action {
    margin-top: 20px;
    padding: 15px;
    text-align: center;
    background: #f7f4ec;
    border-radius: 8px;
}

/* Truck visualization (birds-eye) */
.truck-viz {
    padding: 10px 15px;
    background: #f7f4ec;
    border-top: 1px dashed #d8d2c4;
}

.viz-trailer {
    position: relative;
    background: linear-gradient(to bottom, #f7f4ec 0%, #f7f4ec 100%);
    border: 2px solid #999;
    border-radius: 4px;
    margin: 0 auto;
    overflow: visible;
}

.viz-label-front, .viz-label-rear {
    position: absolute;
    font-size: 9px;
    color: #8a94a0;
    font-weight: 600;
    top: 50%;
    transform: translateY(-50%);
}

.viz-label-front {
    left: -45px;
}

.viz-label-rear {
    right: -45px;
}

.viz-piece {
    position: absolute;
    border: 1px solid rgba(28,39,51,0.5);
    border-radius: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 600;
    color: #fff;
    text-shadow: 0 1px 1px rgba(0,0,0,0.3);
    overflow: hidden;
    box-sizing: border-box;
}

.viz-piece.viz-od {
    border: 2px solid #b91c1c;
    box-shadow: 0 0 4px rgba(231,76,60,0.5);
}

.viz-dims {
    text-align: center;
    font-size: 11px;
    color: #8a94a0;
    margin-top: 8px;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    header h1 {
        font-size: 1.5rem;
    }

    .tabs {
        flex-direction: column;
        gap: 5px;
    }

    .tab-btn {
        padding: 10px 15px;
        font-size: 0.9rem;
    }

    .upload-section:not(.collapsible) {
        flex-direction: column;
    }

    .collapsible-header {
        padding: 12px 15px;
        font-size: 0.9rem;
    }

    .collapsible-header .hint {
        display: none;
    }

    .collapsible-content {
        padding: 15px;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .unit-selectors-inline {
        width: 100%;
    }

    .unit-selectors-inline select {
        flex: 1;
    }

    .unit-selectors {
        flex-direction: column;
        gap: 10px;
    }

    .lane-inputs {
        flex-direction: column;
    }

    .lane-arrow {
        display: none;
    }

    .permit-dims {
        flex-direction: column;
    }

    .permit-field {
        min-width: 100%;
    }

    .state-selector {
        flex-direction: column;
    }

    .state-selector select {
        max-width: 100%;
    }

    .action-buttons,
    .export-buttons {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }

    /* Make table scroll horizontally on mobile */
    .table-wrapper {
        margin: 0 -10px;
        padding: 0 10px;
    }

    table {
        font-size: 0.85rem;
    }

    th, td {
        padding: 8px 4px;
    }

    /* Reduce input sizes on mobile */
    td input[type="number"],
    td input[type="text"] {
        padding: 6px;
        font-size: 0.85rem;
    }

    td select {
        padding: 6px;
        font-size: 0.8rem;
    }

    /* Permit results on mobile */
    .permit-state-result {
        padding: 12px;
    }

    .permit-status {
        display: block;
        margin-bottom: 5px;
    }

    .permit-status.escort {
        margin-left: 0;
    }
}

/* Floating Feedback Button (bottom-right corner) */
.floating-feedback-btn {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: #2f5d8f;
    color: #fff;
    border: none;
    border-radius: 25px;
    padding: 12px 20px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.4);
    transition: all 0.2s;
    z-index: 100;
}

.floating-feedback-btn:hover {
    background: #2f5d8f;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(52, 152, 219, 0.5);
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal {
    background: #fffdf8;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #d8d2c4;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    color: #1c2733;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #8a94a0;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.modal-close:hover {
    color: #1c2733;
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    max-height: 60vh;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 15px 20px;
    border-top: 1px solid #d8d2c4;
    background: #f7f4ec;
}

.feedback-field {
    margin-bottom: 15px;
}

.feedback-field label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    color: #45525f;
    margin-bottom: 6px;
}

.feedback-field input[type="text"],
.feedback-field textarea,
.feedback-field select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d8d2c4;
    border-radius: 6px;
    font-size: 0.95rem;
}

.feedback-field textarea {
    resize: vertical;
    min-height: 100px;
}

.feedback-field input[type="checkbox"] {
    margin-right: 8px;
}

.feedback-field label:has(input[type="checkbox"]) {
    display: flex;
    align-items: center;
    font-weight: normal;
    color: #5b6875;
}

/* Customer Quote Modal */
.quote-modal {
    max-width: 1100px;
    width: 95%;
}

.quote-modal .modal-body {
    max-height: 70vh;
}

.quote-route {
    padding: 12px 15px;
    background: linear-gradient(135deg, #f7f4ec 0%, #f7f4ec 100%);
    border-radius: 6px;
    margin-bottom: 12px;
    font-size: 1.1rem;
}

.quote-route .route-label {
    font-weight: 600;
    color: #45525f;
    margin-right: 8px;
}

.quote-route-states {
    padding: 8px 15px;
    background: #f7f4ec;
    border-radius: 4px;
    margin-bottom: 12px;
    font-size: 0.9rem;
    color: #5b6875;
}

.quote-disclaimer {
    padding: 10px 15px;
    background: #f0e2c4;
    border: 1px solid #b45309;
    border-radius: 6px;
    margin-bottom: 15px;
    font-size: 0.85rem;
    color: #b45309;
}

.quote-table-wrapper {
    overflow-x: auto;
}

.quote-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.quote-table th {
    background: #edeae2;
    color: white;
    padding: 10px 8px;
    text-align: left;
    font-weight: 600;
    white-space: nowrap;
}

.quote-table td {
    padding: 10px 8px;
    border: 1px solid #d8d2c4;
    vertical-align: top;
}

.quote-table tbody tr:nth-child(even) {
    background: #f9f9f9;
}

.quote-table tbody tr:hover {
    background: #f7f4ec;
}

.quote-table tbody tr.od-row {
    background: #f0e2c4;
}

.quote-table tbody tr.od-row:hover {
    background: #fff3cc;
}

.quote-table .pieces-cell {
    font-size: 0.8rem;
    max-width: 150px;
}

.quote-table .linehaul-input {
    width: 90px;
    padding: 6px 8px;
    border: 1px solid #d8d2c4;
    border-radius: 4px;
    font-size: 0.9rem;
    text-align: right;
}

.quote-table .linehaul-input:focus {
    outline: none;
    border-color: #2f5d8f;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.quote-table tfoot .totals-row {
    background: #edeae2;
    color: white;
}

.quote-table tfoot .totals-row td {
    border-color: #d8d2c4;
    padding: 12px 8px;
}

.quote-truck-total {
    font-weight: 600;
    color: #1c2733;
}

.quote-od-badge {
    display: inline-block;
    background: #b45309;
    color: white;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 3px;
    margin-left: 6px;
}

.quote-legal-badge {
    display: inline-block;
    background: #15803d;
    color: white;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 3px;
    margin-left: 6px;
}

/* Generate Quote Button */
.generate-quote-action {
    margin-top: 15px;
    text-align: center;
}

.generate-quote-action .btn {
    font-size: 1rem;
    padding: 12px 24px;
}

/* Lane Mapper Styles */
.lane-mapper-section {
    background: #fffdf8;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.voice-input-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #d8d2c4;
}

.mic-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 3px solid #2f5d8f;
    background: linear-gradient(135deg, #f7f4ec 0%, #f7f4ec 100%);
    cursor: pointer;
    transition: all 0.3s;
    margin-bottom: 15px;
}

.mic-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 20px rgba(52, 152, 219, 0.3);
}

.mic-btn.listening {
    border-color: #b91c1c;
    background: linear-gradient(135deg, #fef5f5 0%, #fdedec 100%);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(231, 76, 60, 0.4); }
    70% { box-shadow: 0 0 0 20px rgba(231, 76, 60, 0); }
    100% { box-shadow: 0 0 0 0 rgba(231, 76, 60, 0); }
}

.mic-icon {
    font-size: 2.5rem;
    margin-bottom: 5px;
}

.mic-text {
    font-size: 0.85rem;
    color: #5b6875;
    font-weight: 500;
}

.mic-btn.listening .mic-text {
    color: #b91c1c;
}

.voice-status {
    font-size: 0.95rem;
    color: #5b6875;
    text-align: center;
    min-height: 24px;
}

.voice-status.error {
    color: #b91c1c;
}

.voice-status.success {
    color: #15803d;
}

.voice-status.processing {
    color: #2f5d8f;
}

.voice-status.listening {
    color: #2f5d8f;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.mapper-inputs {
    margin-bottom: 20px;
}

/* Miles Display */
.miles-display {
    background: linear-gradient(135deg, #edeae2 0%, #2f5d8f 100%);
    color: #fff;
    border-radius: 10px;
    padding: 20px;
    margin-top: 20px;
}

.miles-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.miles-value.truck-miles {
    background: rgba(39, 174, 96, 0.2);
    border-radius: 8px;
    padding: 12px;
}

.miles-value.car-miles {
    background: rgba(28,39,51, 0.1);
    border-radius: 8px;
    padding: 12px;
}

.miles-value.drive-time {
    background: rgba(241, 196, 15, 0.2);
    border-radius: 8px;
    padding: 12px;
}

.miles-value {
    display: flex;
    align-items: baseline;
    gap: 15px;
    margin-bottom: 10px;
}

.miles-label {
    font-size: 1rem;
    opacity: 0.9;
}

.miles-number {
    font-size: 2.5rem;
    font-weight: 700;
    font-family: 'SF Mono', Monaco, 'Courier New', monospace;
}

.route-info {
    font-size: 0.9rem;
    opacity: 0.85;
}

/* Map Section */
.map-section {
    background: #fffdf8;
    border-radius: 8px;
    padding: 0;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.route-map {
    width: 100%;
    height: 450px;
    background: #f7f4ec;
}

/* Leaflet popup styling */
.leaflet-popup-content-wrapper {
    border-radius: 8px;
}

.leaflet-popup-content {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 0.9rem;
}

/* Mobile responsive for Lane Mapper */
@media (max-width: 768px) {
    .mic-btn {
        width: 100px;
        height: 100px;
    }

    .mic-icon {
        font-size: 2rem;
    }

    .miles-number {
        font-size: 2rem;
    }

    .route-map {
        height: 350px;
    }
}

/* Permit Checker Mini Map */
.permit-map-container {
    margin-top: 15px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

.permit-route-map {
    width: 100%;
    height: 200px;
    background: #f7f4ec;
}

@media (max-width: 768px) {
    .permit-route-map {
        height: 150px;
    }
}

/* ============================
   RATE CHECK TAB STYLES
   ============================ */

.ratecheck-header {
    margin-bottom: 20px;
}

.ratecheck-header h2 {
    margin: 0 0 5px 0;
    font-size: 1.5rem;
}

.ratecheck-header p {
    color: #5b6875;
    margin: 0;
}

/* Upload Section */
.ratecheck-upload-section {
    margin-bottom: 20px;
}

.ratecheck-upload-section .paste-target {
    min-height: 150px;
}

.ratecheck-image-preview {
    background: #f7f4ec;
    border: 1px solid #d8d2c4;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
}

.ratecheck-image-preview .image-preview {
    max-width: 100%;
    max-height: 300px;
    border-radius: 4px;
    margin-bottom: 15px;
}

.ratecheck-image-preview .preview-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

/* Info Section */
.ratecheck-info-section {
    background: #f7f4ec;
    border: 1px solid #d8d2c4;
    border-radius: 8px;
    padding: 12px 15px;
    margin-bottom: 15px;
}

.ratecheck-info-section h3 {
    margin: 0 0 3px 0;
    font-size: 1rem;
}

.ratecheck-info-section .hint {
    margin-bottom: 8px;
    font-size: 0.8rem;
}

/* Lane + Map Side-by-Side Layout */
.lane-map-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: start;
}

.lane-inputs-col {
    min-width: 0;
}

.lane-map-col {
    min-height: 300px;
}

.lane-map-col .ratecheck-map {
    height: 280px;
    border-radius: 8px;
    border: 1px solid #d8d2c4;
}

.lane-map-col .map-info {
    text-align: center;
    padding: 8px;
    background: #edeae2;
    color: white;
    border-radius: 0 0 8px 8px;
    margin-top: -4px;
}

@media (max-width: 900px) {
    .lane-map-layout {
        grid-template-columns: 1fr;
    }
    .lane-map-col {
        order: -1;
    }
}

/* Results Container (no map, just rates) */
.results-rates-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Multi-Stop Styles */
.multistop-toggle {
    margin-bottom: 15px;
}

.multistop-toggle label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 500;
    color: #1c2733;
}

.multistop-toggle input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.multistop-container {
    background: #f7f4ec;
    border: 1px solid #d8d2c4;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
}

.stops-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 15px;
    max-height: 300px;
    overflow-y: auto;
}

.stop-row {
    display: flex;
    align-items: center;
    gap: 10px;
    background: white;
    padding: 10px 12px;
    border-radius: 6px;
    border: 1px solid #d8d2c4;
}

.stop-number {
    min-width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #2f5d8f;
    color: white;
    border-radius: 50%;
    font-size: 0.8rem;
    font-weight: 600;
}

.stop-location {
    flex: 1;
    padding: 8px 10px;
    border: 1px solid #d8d2c4;
    border-radius: 4px;
    font-size: 0.95rem;
}

.stop-location:focus {
    outline: none;
    border-color: #2f5d8f;
}

.stop-type {
    width: 50px;
    padding: 8px 4px;
    border: 1px solid #d8d2c4;
    border-radius: 4px;
    background: white;
    font-size: 0.9rem;
    font-weight: 500;
}

.stop-remove-btn {
    width: 30px;
    height: 30px;
    border: none;
    background: #b91c1c;
    color: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stop-remove-btn:hover {
    background: #b91c1c;
}

.stop-remove-btn:disabled {
    background: #d8d2c4;
    cursor: not-allowed;
}

.stop-reorder-btns {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.stop-move-btn {
    width: 24px;
    height: 16px;
    border: 1px solid #c9c2b2;
    background: #f7f4ec;
    color: #45525f;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
}

.stop-move-btn:hover:not(:disabled) {
    background: #2f5d8f;
    color: white;
    border-color: #2f5d8f;
}

.stop-move-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.stop-days-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #d8d2c4;
}

.stop-days-row label {
    font-weight: 500;
    color: #45525f;
}

.stop-days-row input {
    padding: 6px 10px;
    border: 1px solid #d8d2c4;
    border-radius: 4px;
    text-align: center;
}

.stop-days-calc {
    color: #5b6875;
}

.stop-days-calc strong {
    color: #b45309;
}

.stop-charge-line {
    color: #b45309;
    font-weight: 500;
}

/* Leg Miles Breakdown */
.leg-miles-section {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #d8d2c4;
}

.leg-miles-header {
    font-weight: 600;
    font-size: 0.9rem;
    color: #1c2733;
    margin-bottom: 10px;
}

.leg-miles-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.leg-miles-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 10px;
    background: white;
    border-radius: 4px;
    font-size: 0.85rem;
}

.leg-miles-route {
    color: #45525f;
}

.leg-miles-route .leg-arrow {
    color: #2f5d8f;
    margin: 0 6px;
}

.leg-miles-value {
    font-weight: 600;
    color: #1c2733;
}

.leg-miles-total {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed #d8d2c4;
    font-size: 0.95rem;
}

.leg-miles-total strong {
    color: #2f5d8f;
}

/* Trip Time Estimate */
.trip-estimate-section {
    margin-top: 15px;
    padding: 15px;
    background: #fff8e1;
    border: 1px solid #b45309;
    border-radius: 8px;
}

.trip-estimate-header {
    font-weight: 600;
    font-size: 0.95rem;
    color: #b45309;
    margin-bottom: 12px;
}

.trip-estimate-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
    font-size: 0.85rem;
    color: #5b6875;
}

.trip-days-row {
    padding-top: 8px;
    margin-top: 8px;
    border-top: 1px dashed #b45309;
}

.trip-days-row strong {
    font-size: 1.1rem;
    color: #b45309;
}

.trip-estimate-rates {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #b45309;
}

.rate-compare {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

.rate-compare-item {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.rate-compare-item .rate-label {
    font-weight: 500;
    color: #45525f;
    min-width: 100px;
}

.rate-compare-item span:not(.rate-label):not(.rate-formula) {
    font-weight: 600;
    font-size: 1rem;
}

.rate-formula {
    font-size: 0.8rem;
    color: #8a94a0;
}

.rate-formula input {
    padding: 4px 6px;
    border: 1px solid #d8d2c4;
    border-radius: 4px;
    text-align: center;
}

.recommended-rate {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: #15803d;
    color: white;
    border-radius: 6px;
}

.recommended-rate span {
    font-weight: 500;
}

.recommended-rate strong {
    font-size: 1.2rem;
}

.rate-indicator-hint {
    font-size: 0.8rem;
    color: #5b6875;
    margin-top: 8px;
    text-align: center;
}

/* Screen Capture Actions */
.capture-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.capture-hint {
    font-size: 0.85rem;
    color: #8a94a0;
}

#screenCaptureBtn {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.95rem;
}

.ratecheck-inputs {
    display: flex;
    gap: 10px;
    align-items: flex-end;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.ratecheck-field {
    flex: 1;
    min-width: 120px;
}

.ratecheck-field label {
    display: block;
    font-size: 0.75rem;
    font-weight: 500;
    color: #45525f;
    margin-bottom: 2px;
}

.ratecheck-field input,
.ratecheck-field select {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.9rem;
    background: var(--input-bg);
    color: var(--text-primary);
}

.ratecheck-field input:focus,
.ratecheck-field select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.ratecheck-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 10px;
}

.btn-large {
    padding: 12px 30px;
    font-size: 1.1rem;
}

/* Results Section */
.ratecheck-results {
    margin-top: 20px;
}

.results-grid {
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: 15px;
}

@media (max-width: 900px) {
    .results-grid {
        grid-template-columns: 1fr;
    }
}

/* Map Column */
.results-map-col {
    background: #f7f4ec;
    border: 1px solid #d8d2c4;
    border-radius: 8px;
    overflow: hidden;
    order: 2; /* Move map to right side */
}

/* Note: results-rates-col main styles are below after map-info */

.ratecheck-map {
    width: 100%;
    height: 180px;
    background: #f7f4ec;
}

.map-info {
    padding: 12px 15px;
    background: white;
    border-top: 1px solid #d8d2c4;
    text-align: center;
}

.map-info .miles-display {
    font-size: 1.2rem;
    font-weight: 600;
    color: #1c2733;
}

/* Rates Column */
.results-rates-col {
    display: flex;
    flex-direction: column;
    gap: 15px;
    order: 1; /* Display rates on left */
}

/* Dual Rate Cards Grid */
.dual-rates-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

@media (max-width: 600px) {
    .dual-rates-grid {
        grid-template-columns: 1fr;
    }
}

.rates-card,
.margin-card {
    background: white;
    border: 1px solid #d8d2c4;
    border-radius: 8px;
    padding: 10px 12px;
}

.rates-card.market-rates {
    border-top: 3px solid #2f5d8f;
}

.rates-card.network-rates {
    border-top: 3px solid #2f5d8f;
}

.rates-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    border-bottom: 1px solid #d8d2c4;
    padding-bottom: 8px;
}

.rates-header h4 {
    margin: 0;
    font-size: 0.95rem;
    color: #1c2733;
}

.rates-source {
    font-size: 0.75rem;
    color: #8a94a0;
    background: #f7f4ec;
    padding: 2px 8px;
    border-radius: 10px;
}

.market-rates .rates-source {
    background: #f7f4ec;
    color: #2f5d8f;
}

.network-rates .rates-source {
    background: #f5eef8;
    color: #2f5d8f;
}

/* AI Rates Card - Freight-Tools Prediction (BETA) */
.rates-card.ai-rates {
    border-top: 3px solid #b45309;
    background: linear-gradient(to bottom, #fff9f5 0%, #fffdf8 100%);
}

.ai-rates .rates-source.beta-tag {
    background: #ffeaa7;
    color: #b45309;
    font-weight: 600;
    animation: pulse-beta 2s ease-in-out infinite;
}

@keyframes pulse-beta {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.ai-rates .rates-header h4 {
    color: #b45309;
}

.rate-row.rate-ai-prediction {
    background: #fef5e7;
    border-radius: 6px;
    padding: 8px 10px;
    margin: -2px -4px;
}

.rate-value.ai-rate {
    color: #b45309;
    font-size: 1.25rem;
    font-weight: 700;
}

.ai-reasoning {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed #d8d2c4;
}

.ai-reasoning small {
    color: #8a94a0;
    font-size: 0.75rem;
    font-style: italic;
    line-height: 1.3;
}

.ai-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 15px;
    color: #5b6875;
    font-size: 0.85rem;
}

.spinner-small {
    width: 16px;
    height: 16px;
    border: 2px solid #d8d2c4;
    border-top-color: #b45309;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.rates-confidence {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 10px;
    font-size: 0.85rem;
}

.rates-confidence .conf-label {
    color: #5b6875;
}

.rates-confidence .conf-value {
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    background: #f7f4ec;
}

.rates-confidence .conf-value.high {
    background: #d4edda;
    color: #155724;
}

.rates-confidence .conf-value.medium {
    background: #f0e2c4;
    color: #b45309;
}

/* Public Mode - Two equal cards: FreightDeck Rate + Log Truck Rate */
.ratecheck-results-section.public-mode .rates-row-layout {
    grid-template-columns: 1fr 1fr;
}

.ratecheck-results-section.public-mode .rates-card.ai-rates,
.ratecheck-results-section.public-mode .rates-card.truck-rate-card {
    flex: 1;
}

.ratecheck-results-section.public-mode .rate-actions-row {
    display: none;
}

/* Truck Rate Card */
.rates-card.truck-rate-card {
    border-top: 3px solid #15803d;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.truck-rate-desc {
    font-size: 0.8rem;
    color: #5b6875;
    margin-bottom: 12px;
}

.truck-rate-input {
    display: flex;
    align-items: center;
    gap: 6px;
}

.truck-rate-input input {
    flex: 1;
    padding: 8px 10px;
    border: 1px solid #d8d2c4;
    border-radius: 4px;
    font-size: 1rem;
    max-width: 120px;
}

.truck-rate-thanks {
    color: #15803d;
    font-size: 0.85rem;
    margin-top: 8px;
}

/* Bottom actions row */
.rate-bottom-actions {
    display: flex;
    gap: 12px;
    margin-top: 16px;
    justify-content: center;
}

.rate-bottom-actions .btn {
    flex: 1;
    max-width: 200px;
}

/* Market Intelligence Modal */
#marketIntelModal {
    z-index: 9999;
}

.market-intel-modal {
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    position: relative;
}

.market-intel-modal .modal-body {
    max-height: 60vh;
    overflow-y: auto;
    padding: 16px;
}

.market-intel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    font-size: 0.8rem;
    color: #5b6875;
}

.intel-stale-warning {
    color: #d68910;
    font-weight: 500;
}

.market-intel-signals {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

.intel-signal {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

.intel-signal.tight {
    background: rgba(185,28,28,0.15);
    color: #b91c1c;
}

.intel-signal.normal {
    background: rgba(21,128,61,0.15);
    color: #15803d;
}

.intel-signal.loose {
    background: rgba(56,189,248,0.15);
    color: #2f5d8f;
}

.intel-signal.rising {
    background: rgba(185,28,28,0.15);
    color: #b91c1c;
}

.intel-signal.stable {
    background: rgba(234,179,8,0.15);
    color: #fde047;
}

.intel-signal.falling {
    background: rgba(21,128,61,0.15);
    color: #15803d;
}

.market-intel-summary {
    font-size: 0.85rem;
    line-height: 1.7;
    color: #1c2733;
    max-height: none;
    overflow-y: visible;
}

.market-intel-summary h1, .market-intel-summary h2 {
    font-size: 1.05rem;
    font-weight: 700;
    color: #1c2733;
    margin: 20px 0 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(71,85,105,0.3);
}

.market-intel-summary h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: #1c2733;
    margin: 16px 0 6px;
}

.market-intel-summary strong {
    color: #1c2733;
    font-weight: 600;
}

.market-intel-summary hr {
    border: none;
    border-top: 1px solid rgba(71,85,105,0.3);
    margin: 16px 0;
}

/* Lane reminder for permits */
.lane-reminder {
    background: #f0e2c4;
    border: 1px solid #b45309;
    border-radius: 8px;
    padding: 12px 16px;
    margin: 16px 0;
    color: #b45309;
    font-size: 0.9rem;
}

/* Linehaul field in permit dims */
.permit-field.linehaul-field input {
    max-width: 100px;
}

/* Next Truck Section */
.next-truck-section {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin: 20px 0;
    padding: 16px;
    background: #d9ead9;
    border-radius: 8px;
}

.next-truck-section .btn-lg {
    padding: 12px 32px;
    font-size: 1.1rem;
}

.next-truck-status {
    color: #15803d;
    font-weight: 500;
}

/* Truck selector with prev/next */
.truck-selector-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
    margin: 16px 0;
}

.truck-selector-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

.truck-selector-label {
    font-weight: 600;
    font-size: 1.1rem;
}

.truck-selector-info {
    text-align: center;
    margin-top: 8px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Linehaul section */
.linehaul-section {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.linehaul-section label {
    display: block;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text-primary);
}

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

.linehaul-input .currency {
    font-size: 1.1rem;
    color: var(--text-secondary);
}

.linehaul-input input {
    width: 150px;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 1rem;
}

.linehaul-input .linehaul-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Export All Trucks Section */
.export-all-trucks-section {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 2px solid #2f5d8f;
    border-radius: 12px;
    padding: 20px;
    margin-top: 24px;
}

.export-all-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.export-all-header h3 {
    margin: 0;
    color: #2f5d8f;
    font-size: 1.1rem;
}

.export-all-status {
    background: #2f5d8f;
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.export-all-status.complete {
    background: #15803d;
}

.export-all-note {
    color: #2f5d8f;
    font-size: 0.9rem;
    margin-bottom: 16px;
}

.export-all-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.export-all-actions .btn {
    flex: 1;
    min-width: 120px;
}

[data-theme="dark"] .export-all-trucks-section {
    background: linear-gradient(135deg, #f4f1ea 0%, #fffdf8 100%);
    border-color: #2f5d8f;
}

[data-theme="dark"] .export-all-header h3,
[data-theme="dark"] .export-all-note {
    color: #2f5d8f;
}

.rates-confidence .conf-value.low {
    background: #f8d7da;
    color: #721c24;
}

.rates-card h4,
.margin-card h4 {
    margin: 0 0 15px 0;
    font-size: 1rem;
    color: #45525f;
    border-bottom: 1px solid #d8d2c4;
    padding-bottom: 8px;
}

/* Collapsible Section Toggle */
.collapsible-section {
    background: white;
    border: 1px solid #d8d2c4;
    border-radius: 8px;
    margin-bottom: 15px;
    overflow: hidden;
}

.section-toggle {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #f7f4ec;
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    color: #1c2733;
}

.section-toggle:hover {
    background: #f7f4ec;
}

.section-toggle .toggle-icon {
    font-size: 1.2rem;
    font-weight: bold;
    color: #5b6875;
}

.section-content {
    padding: 15px;
    border-top: 1px solid #d8d2c4;
}

/* Floating Voice Button */
.floating-voice-btn {
    position: fixed;
    bottom: 100px;
    right: 25px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    cursor: pointer;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, box-shadow 0.2s;
}

.floating-voice-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.floating-voice-btn:active {
    transform: scale(0.95);
}

.floating-voice-btn .mic-icon {
    font-size: 1.3rem;
}

.floating-voice-btn.listening {
    animation: pulse-voice 1.5s infinite;
}

@keyframes pulse-voice {
    0%, 100% { box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4); }
    50% { box-shadow: 0 4px 25px rgba(102, 126, 234, 0.7); }
}

/* Fuel Backout Section */
.fuel-backout-section {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #d8d2c4;
}

.fuel-backout-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.9rem;
}

.fuel-backout-toggle input[type="checkbox"] {
    width: 18px;
    height: 18px;
}

.custom-fuel-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    padding-left: 26px;
}

.custom-fuel-row label {
    font-size: 0.85rem;
    color: #5b6875;
}

.custom-fuel-row input {
    width: 70px;
    padding: 6px 10px;
    border: 1px solid #d8d2c4;
    border-radius: 4px;
    font-size: 0.9rem;
}

.fuel-hint {
    font-size: 0.8rem;
    color: #8a94a0;
}

.fuel-line {
    color: #b91c1c;
}

.fuel-line span:last-child {
    color: #b91c1c;
}

.margin-line {
    border-top: 1px dashed #d8d2c4;
    padding-top: 8px;
    margin-top: 4px;
}

/* Carriers Card */
.carriers-card {
    background: white;
    border: 1px solid #d8d2c4;
    border-radius: 8px;
    padding: 15px;
}

.carriers-card h4 {
    margin: 0 0 12px 0;
    font-size: 0.95rem;
    color: #1c2733;
    display: flex;
    align-items: center;
    gap: 8px;
}

.carrier-source {
    font-size: 0.75rem;
    color: #8a94a0;
    font-weight: normal;
}

.carriers-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 200px;
    overflow-y: auto;
}

.carrier-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: #f7f4ec;
    border-radius: 6px;
    border-left: 3px solid #15803d;
}

.carrier-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.carrier-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: #1c2733;
}

.carrier-mc {
    font-size: 0.8rem;
    color: #5b6875;
}

.carrier-rate {
    text-align: right;
}

.carrier-rate-value {
    font-weight: 700;
    color: #15803d;
    font-size: 1rem;
}

.carrier-rate-pm {
    font-size: 0.75rem;
    color: #8a94a0;
}

.carrier-link-gs {
    display: inline-block;
    padding: 4px 10px;
    background: #2f5d8f;
    color: white;
    border-radius: 4px;
    font-size: 0.75rem;
    text-decoration: none;
    margin-top: 4px;
}

.carrier-link-gs:hover {
    background: #2f5d8f;
}

.no-carriers {
    color: #8a94a0;
    font-size: 0.9rem;
    text-align: center;
    padding: 15px;
}

/* Accessorials Card */
.accessorials-card {
    background: white;
    border: 1px solid #d8d2c4;
    border-radius: 8px;
    overflow: hidden;
}

.accessorials-toggle {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #f7f4ec;
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    color: #1c2733;
}

.accessorials-toggle:hover {
    background: #f7f4ec;
}

.accessorials-toggle .toggle-icon {
    font-size: 1.2rem;
    font-weight: bold;
    color: #5b6875;
}

.accessorials-content {
    padding: 12px 16px;
    border-top: 1px solid #d8d2c4;
}

.accessorial-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

.accessorial-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    background: #f7f4ec;
    border-radius: 6px;
    cursor: pointer;
}

.accessorial-item:hover {
    background: #f7f4ec;
}

.accessorial-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.accessorial-item .acc-label {
    flex: 1;
    font-size: 0.9rem;
}

.accessorial-item .acc-amount {
    font-weight: 600;
    color: #b45309;
    font-size: 0.9rem;
}

.accessorials-total {
    display: flex;
    justify-content: space-between;
    padding: 10px 12px;
    background: #f0e2c4;
    border-radius: 6px;
    font-weight: 600;
}

.accessorials-total span:last-child {
    color: #b45309;
}

/* Quote Builder */
.quote-breakdown {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px dashed #d8d2c4;
}

.quote-line {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    font-size: 0.9rem;
}

.quote-line span:first-child {
    color: #5b6875;
}

.quote-line span:last-child {
    font-weight: 500;
}

/* Rate Breakdown Card */
.rate-breakdown-card {
    background: #f7f4ec;
    border: 1px solid #d8d2c4;
    border-radius: 8px;
    padding: 12px 16px;
    display: flex;
    gap: 20px;
    font-size: 0.85rem;
}

.breakdown-row {
    display: flex;
    gap: 6px;
}

.breakdown-row span:first-child {
    color: #5b6875;
}

.breakdown-row span:last-child {
    font-weight: 600;
    color: #1c2733;
}

/* Rate Range Display */
.rate-range {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.rate-row {
    display: flex;
    align-items: center;
    padding: 5px 8px;
    border-radius: 4px;
    background: #f7f4ec;
}

.rate-row .rate-label {
    width: 45px;
    font-size: 0.75rem;
    font-weight: 500;
    color: #5b6875;
}

.rate-row .rate-value {
    flex: 1;
    font-size: 1.1rem;
    font-weight: 700;
    text-align: center;
}

.rate-row .rate-per-mile {
    width: 70px;
    text-align: right;
    font-size: 0.8rem;
    color: #5b6875;
}

.rate-low {
    border-left: 4px solid #15803d;
}

.rate-low .rate-value {
    color: #15803d;
}

.rate-avg {
    border-left: 4px solid #2f5d8f;
    background: #f7f4ec;
}

.rate-avg .rate-value {
    color: #2f5d8f;
}

.rate-high {
    border-left: 4px solid #b91c1c;
}

.rate-high .rate-value {
    color: #b91c1c;
}

/* Margin Calculator */
.margin-input-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.margin-input-row label {
    font-weight: 500;
    color: #45525f;
}

.margin-input-row input {
    width: 80px;
    padding: 8px 12px;
    border: 1px solid #d8d2c4;
    border-radius: 6px;
    font-size: 1.1rem;
    text-align: center;
}

.margin-result {
    background: linear-gradient(135deg, #15803d, #15803d);
    border-radius: 8px;
    padding: 15px;
    color: white;
}

.sell-rate {
    text-align: center;
    margin-bottom: 10px;
}

.sell-rate .sell-label {
    display: block;
    font-size: 0.85rem;
    opacity: 0.9;
    margin-bottom: 5px;
}

.sell-rate .sell-value {
    font-size: 2rem;
    font-weight: 700;
    display: block;
}

.sell-rate .sell-per-mile {
    font-size: 0.95rem;
    opacity: 0.9;
}

.margin-breakdown {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    opacity: 0.9;
    border-top: 1px solid rgba(28,39,51,0.3);
    padding-top: 10px;
    margin-top: 5px;
}

/* Voice Input for Rate Check */
.ratecheck-voice-section {
    margin: 15px 0;
    padding: 15px 20px;
    background: #f7f4ec;
    border-radius: 8px;
}

.voice-input-row {
    display: flex;
    align-items: center;
    gap: 15px;
}

.btn-voice {
    background: linear-gradient(135deg, #2f5d8f, #2f5d8f);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.btn-voice:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(155, 89, 182, 0.4);
}

.btn-voice.listening {
    background: linear-gradient(135deg, #b91c1c, #b91c1c);
    animation: pulse-voice 1s infinite;
}

@keyframes pulse-voice {
    0%, 100% { box-shadow: 0 0 0 0 rgba(231, 76, 60, 0.4); }
    50% { box-shadow: 0 0 0 10px rgba(231, 76, 60, 0); }
}

.voice-hint {
    color: #5b6875;
    font-size: 0.9rem;
    font-style: italic;
}

#rateCheckVoiceStatus {
    margin-top: 10px;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.9rem;
}

#rateCheckVoiceStatus.listening {
    background: #f0e2c4;
    color: #b45309;
}

#rateCheckVoiceStatus.success {
    background: #d9ead9;
    color: #15803d;
}

#rateCheckVoiceStatus.error {
    background: #ffebee;
    color: #c62828;
}

/* Confidence Card */
.confidence-card {
    background: white;
    border: 1px solid #d8d2c4;
    border-radius: 8px;
    padding: 12px 15px;
    margin-top: 10px;
}

.confidence-indicator {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.confidence-label {
    font-size: 0.85rem;
    color: #5b6875;
}

.confidence-value {
    font-size: 1.3rem;
    font-weight: 700;
    color: #2f5d8f;
}

.confidence-value.high { color: #15803d; }
.confidence-value.medium { color: #b45309; }
.confidence-value.low { color: #b91c1c; }

.rate-breakdown {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: #5b6875;
    border-top: 1px solid #d8d2c4;
    padding-top: 8px;
}

/* Carrier Links Card */
.carrier-links-card {
    background: white;
    border: 1px solid #d8d2c4;
    border-radius: 8px;
    padding: 15px 20px;
    margin-top: 10px;
}

.carrier-links-card h4 {
    margin: 0 0 12px 0;
    font-size: 1rem;
    color: #45525f;
}

.carrier-links {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.carrier-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s;
}

.carrier-link:hover {
    transform: translateX(5px);
}

.carrier-icon {
    font-size: 1.2rem;
}

.highway-link {
    background: #f7f4ec;
    color: #0066cc;
    border: 1px solid #b8daff;
}

.highway-link:hover {
    background: #d0e9fc;
}

.dat-link {
    background: #f0e2c4;
    color: #b45309;
    border: 1px solid #b45309;
}

.dat-link:hover {
    background: #f0e2c4;
}

.truckstop-link {
    background: #d9ead9;
    color: #15803d;
    border: 1px solid #a5d6a7;
}

.truckstop-link:hover {
    background: #c8e6c9;
}

/* Mobile adjustments for Rate Check */
@media (max-width: 768px) {
    .ratecheck-inputs {
        flex-direction: column;
    }

    .ratecheck-field {
        min-width: 100%;
    }

    .ratecheck-inputs .lane-arrow {
        display: none;
    }

    .ratecheck-map {
        height: 250px;
    }

    .rate-row .rate-value {
        font-size: 1.1rem;
    }

    .sell-rate .sell-value {
        font-size: 1.6rem;
    }
}

/* User Identification Modal */
.user-id-modal {
    max-width: 400px;
    text-align: center;
}

.user-id-modal .modal-header {
    justify-content: center;
    border-bottom: none;
    padding-bottom: 0;
}

.user-id-modal .modal-header h3 {
    font-size: 1.5rem;
}

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

.user-id-modal .modal-body p {
    color: #5b6875;
    margin-bottom: 20px;
}

.user-id-field {
    text-align: left;
}

.user-id-field label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #1c2733;
}

.user-id-field input {
    width: 100%;
    padding: 12px 15px;
    font-size: 1rem;
    border: 2px solid #d8d2c4;
    border-radius: 8px;
    transition: border-color 0.2s;
}

.user-id-field input:focus {
    outline: none;
    border-color: #2f5d8f;
}

.user-id-modal .modal-actions {
    padding: 20px 30px 30px;
    border-top: none;
}

.user-id-modal .btn-primary {
    width: 100%;
    padding: 14px;
    font-size: 1.1rem;
}


/* Site Footer */
.site-footer {
    text-align: center;
    padding: 24px 16px;
    margin-top: 40px;
    border-top: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.85rem;
    background: var(--bg-secondary);
}

.footer-disclaimer {
    background: rgba(180,83,9, 0.1);
    border: 1px solid rgba(180,83,9, 0.3);
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 16px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.footer-disclaimer strong {
    color: #b45309;
}

.footer-contact {
    margin-bottom: 12px;
}

.footer-contact a {
    color: var(--accent-primary);
    text-decoration: none;
}

.footer-contact a:hover {
    text-decoration: underline;
}

.footer-copyright {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Auth Modal */
.auth-modal {
    max-width: 400px;
    text-align: center;
}

.auth-modal .modal-header {
    justify-content: center;
    border-bottom: none;
    padding-bottom: 0;
}

.auth-modal .modal-header h3 {
    font-size: 1.5rem;
}

.auth-modal .modal-body {
    padding: 20px 30px 30px;
}

.auth-notice {
    color: #5b6875;
    margin-bottom: 20px;
    font-size: 0.9rem;
}

.auth-error {
    background: #fef2f2;
    border: 1px solid #b91c1c;
    color: #b91c1c;
    padding: 10px 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    font-size: 0.9rem;
}

.auth-field {
    text-align: left;
    margin-bottom: 15px;
}

.auth-field label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    color: #1c2733;
    font-size: 0.9rem;
}

.auth-field input {
    width: 100%;
    padding: 12px 15px;
    font-size: 1rem;
    border: 2px solid #d8d2c4;
    border-radius: 8px;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.auth-field input:focus {
    outline: none;
    border-color: #2f5d8f;
}

.btn-block {
    width: 100%;
    padding: 14px;
    font-size: 1.1rem;
    margin-top: 10px;
}

.auth-switch {
    margin-top: 20px;
    color: #5b6875;
    font-size: 0.9rem;
}

.auth-switch a {
    color: #2f5d8f;
    text-decoration: none;
    font-weight: 600;
}

.auth-switch a:hover {
    text-decoration: underline;
}

/* ============================================
   NEW COMPACT RATE CHECK LAYOUT
   ============================================ */

/* Details row (commodity/weight/trailer/pickup) */
.ratecheck-details-row {
    margin-top: 15px;
}

/* Row 1: Map + Competitor Intel (50/50) */
.top-row-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-top: 20px;
    align-items: stretch;
}

.top-row-layout .competitor-rate-card {
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* Row 2: Rate Cards (3 equal) */
.rates-row-layout {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 15px;
    margin-top: 15px;
    align-items: stretch;
}

/* Legacy fallback */
.map-rates-layout {
    display: grid;
    grid-template-columns: 1.2fr 1fr 1fr;
    gap: 15px;
    margin-top: 20px;
    align-items: stretch;
}

.map-col {
    position: relative;
}

.map-col .ratecheck-map {
    height: 100%;
    min-height: 220px;
    border-radius: 8px;
    border: 1px solid #d8d2c4;
}

/* Miles badge - prominent color */
.map-miles-badge {
    position: absolute;
    bottom: 10px;
    left: 10px;
    background: #b91c1c;
    color: white;
    padding: 6px 12px;
    border-radius: 16px;
    font-weight: 700;
    font-size: 0.95rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.25);
    z-index: 1000;
}

/* Compact rate cards for 3-col */
.rates-card.compact {
    padding: 10px 12px;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.rates-card.compact .rates-header {
    margin-bottom: 6px;
}

.rates-card.compact .rates-header h4 {
    font-size: 0.9rem;
    margin: 0;
}

.rates-card.compact .rates-source {
    font-size: 0.7rem;
}

.rates-card.compact .rates-confidence {
    margin-bottom: 6px;
}

.rates-card.compact .rate-range {
    gap: 3px;
    flex: 1;
}

.rates-card.compact .rate-row {
    padding: 5px 6px;
}

.rates-card.compact .rate-label {
    font-size: 0.85rem;
}

.rates-card.compact .rate-value {
    font-size: 1.1rem;
}

.rates-card.compact .rate-per-mile {
    font-size: 0.85rem;
}

/* Per-card feedback buttons */
.card-feedback {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #d8d2c4;
    justify-content: center;
}

.card-feedback-label {
    font-size: 0.75rem;
    color: #5b6875;
    font-weight: 500;
}

.card-fb-btn {
    background: rgba(100,116,139,0.1);
    border: 1px solid rgba(100,116,139,0.3);
    border-radius: 6px;
    padding: 5px 12px;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.15s ease;
    cursor: pointer;
    transition: all 0.15s;
}

.card-fb-btn:hover {
    background: #f7f4ec;
    border-color: #bbb;
}

.card-fb-btn.voted {
    opacity: 0.5;
    cursor: default;
}

.card-fb-btn[data-vote="too_high"].selected {
    background: #f8d7da;
    border-color: #b91c1c;
    color: #721c24;
}

.card-fb-btn[data-vote="about_right"].selected {
    background: #d4edda;
    border-color: #28a745;
    color: #155724;
}

.card-fb-btn[data-vote="too_low"].selected {
    background: #f0e2c4;
    border-color: #b45309;
    color: #b45309;
}

.card-feedback.submitted .card-feedback-label {
    color: #28a745;
}

.card-feedback.submitted .card-feedback-label::after {
    content: ' ✓';
}

[data-theme="dark"] .card-feedback {
    border-color: #c9c2b2;
}
[data-theme="dark"] .card-fb-btn {
    background: rgba(71,85,105,0.2);
    border: 1px solid rgba(100,116,139,0.35);
    color: #5b6875;
    padding: 5px 12px;
    font-weight: 500;
    border-radius: 6px;
    transition: all 0.15s ease;
}
[data-theme="dark"] .card-fb-btn:hover {
    background: rgba(47,93,143,0.15);
    border-color: rgba(47,93,143,0.4);
    color: #2f5d8f;
    transform: translateY(-1px);
}


[data-theme="dark"] .card-fb-btn {
    border-color: #c9c2b2;
    color: #2a3744;
}

[data-theme="dark"] .card-fb-btn:hover {
    background: #edeae2;
}

@media (max-width: 1000px) {
    .top-row-layout {
        grid-template-columns: 1fr;
    }
    .rates-row-layout {
        grid-template-columns: 1fr 1fr;
    }
    .map-rates-layout {
        grid-template-columns: 1fr 1fr;
    }
    .map-col {
        grid-column: span 2;
    }
}

@media (max-width: 600px) {
    .top-row-layout {
        grid-template-columns: 1fr;
    }
    .rates-row-layout {
        grid-template-columns: 1fr;
    }
    .map-rates-layout {
        grid-template-columns: 1fr;
    }
    .map-col {
        grid-column: span 1;
    }
}

/* Voice recording indicator */
.voice-btn.recording {
    background: #b91c1c !important;
    animation: pulse-recording 1s infinite;
}

@keyframes pulse-recording {
    0%, 100% { box-shadow: 0 0 0 0 rgba(231, 76, 60, 0.7); }
    50% { box-shadow: 0 0 0 10px rgba(231, 76, 60, 0); }
}

.voice-status.recording {
    color: #b91c1c;
    font-weight: 600;
}

/* OD badges for Load Builder pieces */
.od-indicators {
    display: inline-flex;
    gap: 3px;
    margin-left: 6px;
}

.od-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    color: white;
    cursor: help;
}

.od-badge.od-width {
    background: #b91c1c;
}

.od-badge.od-height {
    background: #b45309;
}

.od-badge.od-weight {
    background: #2f5d8f;
}

.draggable-piece.od-piece {
    border-left: 3px solid #b91c1c;
}

/* Truck fit warning */
.truck-fit-warning {
    background: #f0e2c4;
    border: 1px solid #b45309;
    color: #b45309;
    padding: 8px 12px;
    border-radius: 6px;
    margin-top: 8px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.truck-fit-warning.error {
    background: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

.truck-fit-warning .warning-icon {
    font-size: 16px;
}

/* Truck Selector for Permits */
.truck-selector-section {
    background: #f7f4ec;
    border: 1px solid #b8daff;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 16px;
}

.truck-selector-header {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.truck-selector-label {
    font-weight: 600;
    color: #004085;
}

.truck-selector-dropdown {
    padding: 8px 12px;
    border: 1px solid #b8daff;
    border-radius: 6px;
    font-size: 14px;
    min-width: 200px;
    background: white;
}

.truck-selector-count {
    color: #5b6875;
    font-size: 13px;
}

/* State Regulations in Permits */
.state-regs-collapsible {
    margin-top: 24px;
    border-top: 1px solid #d8d2c4;
    padding-top: 16px;
}

.state-selector {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.state-selector label {
    font-weight: 500;
}

.state-selector select {
    padding: 8px 12px;
    border: 1px solid #d8d2c4;
    border-radius: 6px;
    min-width: 200px;
}

.state-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
}

.info-card {
    background: #f7f4ec;
    border: 1px solid #d8d2c4;
    border-radius: 8px;
    padding: 16px;
}

.info-card h4 {
    margin: 0 0 12px 0;
    font-size: 14px;
    color: #1c2733;
    border-bottom: 1px solid #d8d2c4;
    padding-bottom: 8px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 13px;
}

.info-label {
    color: #5b6875;
}

.info-value {
    font-weight: 500;
    color: #1c2733;
}

/* Export Plan Action */
.export-plan-action {
    margin-top: 16px;
    text-align: center;
}

/* PermitCalc CTA Banner */
.permitcalc-cta {
    background: linear-gradient(135deg, #dbeafe 0%, #e0e7ff 100%);
    border: 2px solid #2f5d8f;
    border-radius: 12px;
    padding: 18px 24px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    position: relative;
    overflow: hidden;
}
.permitcalc-cta::before {
    content: '📋';
    position: absolute;
    right: 120px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 2.5rem;
    opacity: 0.15;
}
.permitcalc-cta .cta-text {
    flex: 1;
}
.permitcalc-cta .cta-text strong {
    color: #2f5d8f;
    font-size: 1rem;
}
.permitcalc-cta .cta-text p {
    color: #2f5d8f;
    font-size: 0.85rem;
    margin: 4px 0 0 0;
}
.permitcalc-cta .btn {
    white-space: nowrap;
    background: #2f5d8f;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.2s;
}
.permitcalc-cta .btn:hover {
    background: #f7f4ec;
    transform: translateY(-1px);
}

/* PermitCalc Header */
.permitcalc-header {
    background: url('permitcalc-bg.png') center center / cover no-repeat !important;
    padding: 0 !important;
    margin-bottom: 20px !important;
    border: none !important;
    box-shadow: 0 4px 32px rgba(0,0,0,0.5) !important;
    overflow: hidden;
}
.permitcalc-hero {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 28px;
    padding: 48px 32px;
    background: linear-gradient(90deg, rgba(28,39,51,0.85) 0%, rgba(28,39,51,0.4) 50%, rgba(28,39,51,0.7) 100%);
}
.permitcalc-icon {
    flex-shrink: 0;
}
.permitcalc-icon svg {
    width: 72px;
    height: 72px;
    filter: drop-shadow(0 4px 12px rgba(20, 184, 166, 0.4));
}
.permitcalc-text h1 {
    font-size: 2.8rem;
    font-weight: 700;
    color: #fff;
    margin: 0;
    letter-spacing: -1px;
    text-shadow: 0 2px 8px rgba(0,0,0,0.5);
}
.permitcalc-text p {
    font-size: 1.1rem;
    color: rgba(216,210,196, 0.95);
    margin: 6px 0 0 0;
    font-weight: 400;
    letter-spacing: 0.5px;
}
.permitcalc-header .theme-toggle {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 10;
    background: rgba(0,0,0,0.5);
    border: 1px solid rgba(28,39,51,0.2);
    backdrop-filter: blur(8px);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 1.1rem;
}
.permitcalc-header .theme-toggle:hover {
    background: rgba(0,0,0,0.7);
    border-color: rgba(28,39,51,0.3);
}
@media (max-width: 600px) {
    .permitcalc-hero {
        padding: 32px 20px;
        gap: 20px;
    }
    .permitcalc-icon svg {
        width: 56px;
        height: 56px;
    }
    .permitcalc-text h1 {
        font-size: 2rem;
    }
    .permitcalc-text p {
        font-size: 1rem;
    }
    .permitcalc-header .theme-toggle {
        top: 12px;
        right: 12px;
    }
}

/* Legacy small logo styles - kept for backwards compat */
.permitcalc-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
}
.permitcalc-logo {
    width: 72px;
    height: 72px;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}
[data-theme="dark"] .permitcalc-cta {
    background: linear-gradient(135deg, rgba(230,236,243, 0.6) 0%, rgba(230,236,243, 0.6) 100%);
    border-color: rgba(47,93,143, 0.5);
    backdrop-filter: blur(8px);
}
[data-theme="dark"] .permitcalc-cta .cta-text strong {
    color: #2f5d8f;
}
[data-theme="dark"] .permitcalc-cta .cta-text p {
    color: #5b6875;
}
[data-theme="dark"] .permitcalc-cta .btn {
    background: #2f5d8f;
}
[data-theme="dark"] .permitcalc-cta .btn:hover {
    background: #2f5d8f;
}

/* ============================================
   MAP EXPAND MODAL
   ============================================ */

/* Expand button on maps */
.map-expand-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 1000;
    background: rgba(28,39,51, 0.95);
    border: 1px solid #d8d2c4;
    border-radius: 6px;
    width: 32px;
    height: 32px;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.map-expand-btn:hover {
    background: #2f5d8f;
    color: white;
    border-color: #2f5d8f;
    transform: scale(1.1);
}

/* Container positioning for expand button */
.permit-map-container,
.map-section,
.map-col {
    position: relative;
}

/* Expanded map modal */
.map-expand-modal {
    width: 95vw !important;
    max-width: 1400px !important;
    height: 85vh;
    max-height: none !important;
}

.map-expand-modal .modal-body {
    padding: 0;
    height: calc(100% - 60px);
    max-height: none;
}

.expanded-map {
    width: 100%;
    height: 100%;
    min-height: 500px;
    background: #f7f4ec;
}

/* Dark theme support */
[data-theme="dark"] .map-expand-btn {
    background: rgba(255,253,248, 0.95);
    border-color: #c9c2b2;
    color: #2a3744;
}

[data-theme="dark"] .map-expand-btn:hover {
    background: #2f5d8f;
    color: white;
    border-color: #2f5d8f;
}

[data-theme="dark"] .map-expand-modal {
    background: #f4f1ea;
}

[data-theme="dark"] .map-expand-modal .modal-header {
    background: #fffdf8;
    border-color: #c9c2b2;
}

[data-theme="dark"] .map-expand-modal .modal-header h3 {
    color: #2a3744;
}

/* ============================================
   AUTH REQUIRED - LOCK SCREEN
   ============================================ */

body.auth-required .container {
    filter: blur(8px);
    pointer-events: none;
    user-select: none;
}

/* Logged out: the top nav is injected OUTSIDE .container by topnav-mode.js, so the
   .container blur above never touched it — the menu rendered crisp BEHIND the Sign In
   modal and looked like an outside viewer could see internal nav. Hide it outright. */
body.auth-required .tn-topbar { display: none !important; }

body.auth-required #authModal {
    display: flex;
}

body.auth-required #authModal .modal-overlay {
    background: rgba(0, 0, 0, 0.8);
}

/* ============================================
   RATE FEEDBACK CARD
   ============================================ */

.rate-feedback-card {
    grid-column: 1 / -1;
    background: #f7f4ec;
    border: 1px solid #d8d2c4;
    border-radius: 8px;
    padding: 12px 16px;
    margin-top: 10px;
}

.feedback-question {
    font-size: 13px;
    color: #5b6875;
    margin-bottom: 10px;
    text-align: center;
}

.feedback-buttons {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.feedback-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 10px 20px;
    border: 2px solid #d8d2c4;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 90px;
}

.feedback-btn:hover {
    border-color: #2f5d8f;
    background: #f7f4ec;
}

.feedback-btn.selected {
    border-color: #15803d;
    background: #d9ead9;
}

.feedback-btn[data-feedback="too_low"]:hover,
.feedback-btn[data-feedback="too_low"].selected {
    border-color: #b91c1c;
    background: #fdecea;
}

.feedback-btn[data-feedback="too_high"]:hover,
.feedback-btn[data-feedback="too_high"].selected {
    border-color: #b45309;
    background: #fef9e7;
}

.feedback-icon {
    font-size: 20px;
}

.feedback-label {
    font-size: 12px;
    font-weight: 500;
    color: #1c2733;
}

.feedback-actual {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #d8d2c4;
}

.feedback-actual label {
    display: block;
    font-size: 13px;
    color: #5b6875;
    margin-bottom: 8px;
}

.feedback-actual small {
    color: #8a94a0;
}

.actual-rate-input {
    display: flex;
    align-items: center;
    gap: 8px;
}

.actual-rate-input span {
    font-size: 16px;
    color: #5b6875;
}

.actual-rate-input input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #d8d2c4;
    border-radius: 6px;
    font-size: 14px;
    max-width: 120px;
}

.btn-small {
    padding: 8px 16px;
    font-size: 13px;
}

.feedback-thanks {
    text-align: center;
    color: #15803d;
    font-weight: 500;
    padding: 12px;
    background: #d9ead9;
    border-radius: 6px;
    margin-top: 8px;
}

/* Dark theme */
[data-theme="dark"] .rate-feedback-card {
    background: #fffdf8;
    border-color: #c9c2b2;
}

[data-theme="dark"] .feedback-question {
    color: #8a94a0;
}

[data-theme="dark"] .feedback-btn {
    background: #edeae2;
    border-color: #c9c2b2;
}

[data-theme="dark"] .feedback-btn:hover {
    background: #f4f1ea;
}

[data-theme="dark"] .feedback-label {
    color: #2a3744;
}

[data-theme="dark"] .feedback-actual {
    border-color: #c9c2b2;
}

[data-theme="dark"] .actual-rate-input input {
    background: #edeae2;
    border-color: #c9c2b2;
    color: #2a3744;
}

/* ============================================
   LOG ACTUAL RATE CARD (Results Section)
   ============================================ */

.actual-rate-card {
    background: linear-gradient(135deg, #d9ead9 0%, #f1f8e9 100%);
    border: 2px solid #81c784;
    border-radius: 10px;
    padding: 16px;
    text-align: center;
}

.actual-rate-card h4 {
    margin: 0 0 4px 0;
    font-size: 14px;
    color: #15803d;
}

.actual-rate-hint {
    font-size: 12px;
    color: #5b6875;
    margin: 0 0 12px 0;
}

.actual-rate-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.actual-rate-row .dollar-sign {
    font-size: 18px;
    font-weight: bold;
    color: #1c2733;
}

.actual-rate-row input {
    width: 120px;
    padding: 8px 12px;
    font-size: 16px;
    border: 2px solid #d8d2c4;
    border-radius: 6px;
    text-align: center;
}

.actual-rate-row input:focus {
    border-color: #15803d;
    outline: none;
}

.actual-rate-thanks {
    color: #15803d;
    font-weight: 500;
    margin-top: 10px;
    padding: 8px;
    background: rgba(76, 175, 80, 0.15);
    border-radius: 6px;
}

[data-theme="dark"] .actual-rate-card {
    background: linear-gradient(135deg, #f7f4ec 0%, #f7f4ec 100%);
    border-color: #15803d;
}

[data-theme="dark"] .actual-rate-card h4 {
    color: #81c784;
}

[data-theme="dark"] .actual-rate-hint {
    color: #8a94a0;
}

[data-theme="dark"] .actual-rate-row .dollar-sign {
    color: #2a3744;
}

[data-theme="dark"] .actual-rate-row input {
    background: #edeae2;
    border-color: #c9c2b2;
    color: #2a3744;
}

[data-theme="dark"] .actual-rate-thanks {
    background: rgba(76, 175, 80, 0.25);
    color: #a5d6a7;
}

/* ============================================
   LOG COMPETITOR RATE CARD
   ============================================ */

.competitor-rate-card {
    border-color: #b45309 !important;
}

.competitor-rate-card .rates-header {
    background: linear-gradient(135deg, #f0e2c4 0%, #f0e2c4 100%);
}

.competitor-rate-card .rates-header h4 {
    color: #b45309;
}

.competitor-rate-card .rates-source {
    background: #b45309;
    color: white;
}

/* Screenshot dropzone */
.competitor-screenshot {
    margin-bottom: 10px;
}

.screenshot-dropzone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 10px;
    border: 2px dashed #b45309;
    border-radius: 6px;
    background: #fffaf5;
    cursor: pointer;
    transition: all 0.2s;
}

.screenshot-dropzone:hover {
    border-color: #b45309;
    background: #f0e2c4;
}

.screenshot-dropzone.drag-over {
    border-color: #b45309;
    background: #f0e2c4;
}

.dropzone-icon {
    font-size: 18px;
}

.dropzone-text {
    font-size: 10px;
    color: #8a94a0;
}

.screenshot-preview {
    position: relative;
    max-height: 60px;
    overflow: hidden;
    border-radius: 6px;
}

.screenshot-preview img {
    width: 100%;
    height: auto;
    max-height: 60px;
    object-fit: cover;
    border-radius: 6px;
}

.preview-clear {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 18px;
    height: 18px;
    border: none;
    border-radius: 50%;
    background: rgba(0,0,0,0.6);
    color: white;
    font-size: 12px;
    cursor: pointer;
    line-height: 1;
}

.screenshot-parsing {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px;
    color: #b45309;
    font-size: 11px;
}

.competitor-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.competitor-row {
    display: flex;
    gap: 12px;
}

.competitor-field {
    flex: 1;
}

.competitor-field.full-width {
    flex: 1 1 100%;
}

.competitor-field label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: #45525f;
    margin-bottom: 4px;
}

.competitor-field label small {
    font-weight: normal;
    color: #8a94a0;
}

.rate-input-wrap {
    display: flex;
    align-items: center;
    gap: 4px;
}

.rate-input-wrap span {
    font-size: 16px;
    font-weight: bold;
    color: #1c2733;
}

.competitor-field input,
.competitor-field select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #d8d2c4;
    border-radius: 6px;
    font-size: 14px;
}

.competitor-field input:focus,
.competitor-field select:focus {
    border-color: #b45309;
    outline: none;
}

.competitor-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 4px;
}

.competitor-thanks {
    color: #b45309;
    font-weight: 500;
    margin-top: 12px;
    padding: 8px;
    background: rgba(255, 152, 0, 0.15);
    border-radius: 6px;
    text-align: center;
}

.competitor-history {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid #b45309;
}

.history-header {
    font-size: 12px;
    font-weight: 600;
    color: #b45309;
    margin-bottom: 8px;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 10px;
    background: #fffdf8;
    border-radius: 4px;
    font-size: 13px;
}

.history-rate {
    font-weight: 600;
    color: #1c2733;
}

.history-meta {
    color: #8a94a0;
    font-size: 11px;
}

/* Dark mode */
[data-theme="dark"] .competitor-rate-card {
    border-color: #b36800 !important;
}

[data-theme="dark"] .competitor-rate-card .rates-header {
    background: linear-gradient(135deg, #f7f4ec 0%, #f7f4ec 100%);
}

[data-theme="dark"] .competitor-rate-card .rates-header h4 {
    color: #ffb74d;
}

[data-theme="dark"] .screenshot-dropzone {
    border-color: #d8d2c4;
    background: #fffdf8;
}

[data-theme="dark"] .screenshot-dropzone:hover {
    border-color: #b36800;
    background: #f7f4ec;
}

[data-theme="dark"] .dropzone-text {
    color: #8a94a0;
}

[data-theme="dark"] .competitor-field label {
    color: #2a3744;
}

[data-theme="dark"] .competitor-field input,
[data-theme="dark"] .competitor-field select {
    background: #edeae2;
    border-color: #c9c2b2;
    color: #2a3744;
}

[data-theme="dark"] .rate-input-wrap span {
    color: #2a3744;
}

[data-theme="dark"] .competitor-thanks {
    background: rgba(255, 152, 0, 0.2);
    color: #b45309;
}

[data-theme="dark"] .competitor-history {
    border-color: #d8d2c4;
}

[data-theme="dark"] .history-header {
    color: #ffb74d;
}

[data-theme="dark"] .history-item {
    background: #edeae2;
}

[data-theme="dark"] .history-rate {
    color: #2a3744;
}

/* Dark Mode - Accessorials */
[data-theme="dark"] .accessorials-card {
    background: #fffdf8;
    border-color: #c9c2b2;
}

[data-theme="dark"] .accessorials-toggle {
    background: #edeae2;
    color: #2a3744;
}

[data-theme="dark"] .accessorials-toggle:hover {
    background: #f4f1ea;
}

[data-theme="dark"] .accessorials-toggle .toggle-icon {
    color: #8a94a0;
}

[data-theme="dark"] .accessorials-content {
    border-color: #c9c2b2;
    background: #fffdf8;
    color: #2a3744;
}

[data-theme="dark"] .accessorial-item {
    background: #f4f1ea !important;
    color: #2a3744 !important;
}

[data-theme="dark"] .accessorial-item:hover {
    background: #edeae2 !important;
}

[data-theme="dark"] .accessorial-item .acc-label,
[data-theme="dark"] .accessorial-item span {
    color: #2a3744 !important;
}

[data-theme="dark"] .accessorial-item .acc-amount {
    color: #f5a623 !important;
}

[data-theme="dark"] .accessorial-group {
    color: #2a3744;
}

[data-theme="dark"] .accessorials-total {
    background: #f7f4ec;
    color: #2a3744;
}

/* Dark Mode - Quote Builder */
[data-theme="dark"] .quote-builder-card {
    background: #fffdf8;
    border-color: #c9c2b2;
}

[data-theme="dark"] .quote-builder-card h4 {
    color: #2a3744;
    border-color: #c9c2b2;
}

[data-theme="dark"] .quote-line {
    color: #2a3744;
}

[data-theme="dark"] .quote-breakdown {
    border-color: #c9c2b2;
}

/* Responsive */
@media (max-width: 600px) {
    .rate-feedback-card {
        grid-column: span 1;
    }
    .feedback-buttons {
        flex-direction: column;
    }
    .feedback-btn {
        flex-direction: row;
        justify-content: center;
    }
}


/* ==================== PERMIT FEEDBACK STYLES ==================== */
.permit-feedback-section {
    background: #f7f4ec;
    border: 1px solid #d8d2c4;
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
}
.permit-feedback-header h3 { margin: 0 0 4px 0; color: #2f5d8f; font-size: 1.1rem; }
.permit-feedback-note { color: #718096; font-size: 0.85rem; margin: 0 0 16px 0; }
.permit-feedback-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 20px; }
.permit-feedback-item { background: white; border: 1px solid #d8d2c4; border-radius: 6px; padding: 12px; }
.permit-feedback-item label { display: block; font-weight: 600; color: #2a3744; margin-bottom: 8px; font-size: 0.9rem; }
.permit-feedback-btns { display: flex; gap: 6px; }
.permit-feedback-btns .feedback-btn { flex: 1; padding: 6px 8px; font-size: 0.75rem; }
.permit-feedback-actual { border-top: 1px solid #d8d2c4; padding-top: 16px; }
.permit-feedback-actual > label { display: block; font-weight: 500; color: #2a3744; margin-bottom: 10px; font-size: 0.9rem; }
.permit-actual-inputs { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.permit-actual-field { display: flex; align-items: center; gap: 6px; }
.permit-actual-field span { color: #718096; font-size: 0.85rem; white-space: nowrap; }
.permit-actual-field input { width: 100px; padding: 6px 10px; border: 1px solid #d8d2c4; border-radius: 4px; font-size: 0.9rem; }
.permit-feedback-thanks { background: #c6f6d5; border: 1px solid #68d391; color: #276749; padding: 10px 14px; border-radius: 6px; margin-top: 12px; text-align: center; font-size: 0.9rem; }
[data-theme="dark"] .permit-feedback-section { background: #fffdf8; border-color: #d8d2c4; }
[data-theme="dark"] .permit-feedback-header h3 { color: #1c2733; }
[data-theme="dark"] .permit-feedback-note { color: #5b6875; }
[data-theme="dark"] .permit-feedback-item { background: #f4f1ea; border-color: #d8d2c4; }
[data-theme="dark"] .permit-feedback-item label { color: #1c2733; }
[data-theme="dark"] .permit-feedback-actual { border-color: #d8d2c4; }
[data-theme="dark"] .permit-feedback-actual > label { color: #1c2733; }
[data-theme="dark"] .permit-actual-field input { background: #f4f1ea; border-color: #d8d2c4; color: #1c2733; }
@media (max-width: 600px) { .permit-feedback-grid { grid-template-columns: 1fr; } .permit-actual-inputs { flex-direction: column; align-items: stretch; } .permit-actual-field { width: 100%; } .permit-actual-field input { flex: 1; } }
/* ==================== UPDATED DARK MODE + WIDER LAYOUT ==================== */

/* Wider container for desktop */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Updated Dark theme - modern slate palette with blue accent */
[data-theme="dark"] {
    --bg-primary: #f4f1ea;
    --bg-secondary: #fffdf8;
    --bg-accent: #edeae2;
    --bg-card: #fffdf8;
    --text-primary: #1c2733;
    --text-secondary: #1c2733;
    --text-muted: #5b6875;
    --border-color: #edeae2;
    --border-accent: #2f5d8f;
    --accent-primary: #2f5d8f;
    --accent-hover: #2f5d8f;
    --accent-light: #fffdf8;
    --accent-text: #2f5d8f;
    --success: #15803d;
    --success-bg: rgba(21,128,61, 0.1);
    --warning: #b45309;
    --warning-bg: rgba(180,83,9, 0.1);
    --error: #b91c1c;
    --error-bg: rgba(185,28,28, 0.1);
    --header-bg: linear-gradient(135deg, #fffdf8 0%, #edeae2 100%);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.4);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.3);
    --input-bg: #fffdf8;
    --input-border: #45525f;
}

/* Dark mode specific overrides */
[data-theme="dark"] .container {
    background: transparent;
}

[data-theme="dark"] .tab-content {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 24px;
    border: 1px solid var(--border-color);
}

[data-theme="dark"] .tabs {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 4px;
    margin-bottom: 20px;
}

[data-theme="dark"] .tab-btn {
    background: transparent;
    color: var(--text-secondary);
    border: none;
    border-radius: 6px;
    padding: 10px 20px;
    font-weight: 500;
}

[data-theme="dark"] .tab-btn:hover {
    background: var(--bg-accent);
    color: var(--text-primary);
}

[data-theme="dark"] .tab-btn.active {
    background: var(--accent-primary);
    color: white;
}

/* Inputs - cleaner dark styling */
[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea {
    background: var(--bg-primary);
    border: 1px solid var(--input-border);
    color: var(--text-primary);
    border-radius: 6px;
    padding: 10px 12px;
}

[data-theme="dark"] input:focus,
[data-theme="dark"] select:focus,
[data-theme="dark"] textarea:focus {
    border-color: var(--accent-primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(47,93,143, 0.2);
}

[data-theme="dark"] input::placeholder {
    color: var(--text-muted);
}

/* Cards - cleaner borders, subtle glow */
[data-theme="dark"] .rates-card,
[data-theme="dark"] .competitor-rate-card,
[data-theme="dark"] .margin-card,
[data-theme="dark"] .accessorials-card,
[data-theme="dark"] .carriers-card,
[data-theme="dark"] .actual-rate-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    box-shadow: var(--shadow-sm);
}

[data-theme="dark"] .rates-card h4,
[data-theme="dark"] .competitor-rate-card h4 {
    color: var(--text-primary);
    font-weight: 600;
}

[data-theme="dark"] .rates-source {
    color: var(--accent-text);
    background: var(--accent-light);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
}

/* Rate rows - better contrast */
[data-theme="dark"] .rate-row {
    background: var(--bg-primary);
    border-radius: 6px;
    margin: 4px 0;
}

[data-theme="dark"] .rate-row.rate-avg {
    background: var(--accent-light);
    border: 1px solid var(--accent-primary);
}

[data-theme="dark"] .rate-value {
    color: var(--text-primary);
    font-weight: 700;
}

[data-theme="dark"] .rate-per-mile {
    color: var(--text-muted);
}

/* Buttons - clean blue */
[data-theme="dark"] .btn-primary {
    background: var(--accent-primary);
    color: white;
    border: none;
    font-weight: 600;
}

[data-theme="dark"] .btn-primary:hover {
    background: var(--accent-hover);
}

[data-theme="dark"] .btn-secondary {
    background: var(--bg-accent);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

[data-theme="dark"] .btn-secondary:hover {
    background: var(--input-border);
}

/* Collapsible sections */
[data-theme="dark"] .collapsible-section,
[data-theme="dark"] .ratecheck-upload-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    margin-bottom: 16px;
}

[data-theme="dark"] .section-toggle,
[data-theme="dark"] .collapsible-header {
    background: transparent;
    color: var(--text-primary);
    border: none;
    padding: 14px 16px;
    width: 100%;
    text-align: left;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 500;
}

[data-theme="dark"] .toggle-icon {
    color: var(--accent-text);
}

/* Paste target - cleaner */
[data-theme="dark"] .paste-target {
    background: var(--bg-primary);
    border: 2px dashed var(--border-color);
    border-radius: 10px;
    color: var(--text-secondary);
}

[data-theme="dark"] .paste-target:hover,
[data-theme="dark"] .paste-target:focus {
    border-color: var(--accent-primary);
    background: var(--accent-light);
}

/* Map styling */
[data-theme="dark"] .map-col {
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

[data-theme="dark"] .map-miles-badge {
    background: var(--accent-primary);
    color: white;
    font-weight: 600;
}

/* Competitor card - cleaner */
[data-theme="dark"] .competitor-rate-card {
    border: 1px solid var(--border-color);
}

[data-theme="dark"] .competitor-rate-card .rates-header {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
    margin-bottom: 12px;
}

[data-theme="dark"] .screenshot-dropzone {
    background: var(--bg-primary);
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    color: var(--text-muted);
}

[data-theme="dark"] .screenshot-dropzone:hover {
    border-color: var(--accent-primary);
}

/* Info section */
[data-theme="dark"] .ratecheck-info-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 20px;
}

[data-theme="dark"] .ratecheck-info-section h3 {
    color: var(--text-primary);
    margin-bottom: 4px;
}

[data-theme="dark"] .ratecheck-info-section .hint {
    color: var(--text-muted);
}

/* Labels */
[data-theme="dark"] label {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.85rem;
}

/* Lane validation checkmarks */
[data-theme="dark"] .lane-validation {
    color: var(--success);
}

/* Card feedback buttons */
[data-theme="dark"] .card-feedback {
    border-top: 1px solid var(--border-color);
    padding-top: 10px;
    margin-top: 10px;
}

[data-theme="dark"] .card-fb-btn {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
}

[data-theme="dark"] .card-fb-btn:hover {
    background: var(--bg-accent);
    border-color: var(--accent-primary);
    color: var(--text-primary);
}

[data-theme="dark"] .card-fb-btn.selected {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
}

/* Quote builder section */
[data-theme="dark"] .quote-breakdown {
    background: var(--bg-primary);
    border-radius: 8px;
    padding: 12px;
}

[data-theme="dark"] .quote-line {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
}

[data-theme="dark"] .quote-line:last-child {
    border-bottom: none;
}

[data-theme="dark"] .sell-rate {
    background: var(--accent-light);
    border: 1px solid var(--accent-primary);
    border-radius: 8px;
    padding: 12px;
    text-align: center;
    margin-top: 12px;
}

[data-theme="dark"] .sell-value {
    color: var(--success);
    font-size: 1.5rem;
    font-weight: 700;
}

/* Accessorials */
[data-theme="dark"] .accessorials-toggle {
    background: transparent;
    border: none;
    color: var(--text-primary);
    padding: 12px;
    width: 100%;
    text-align: left;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
}

[data-theme="dark"] .accessorial-item {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 10px 12px;
    margin: 6px 0;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

[data-theme="dark"] .accessorial-item:hover {
    border-color: var(--accent-primary);
}

[data-theme="dark"] .acc-label {
    flex: 1;
    color: var(--text-primary);
}

[data-theme="dark"] .acc-amount {
    color: var(--accent-text);
    font-weight: 500;
}

/* Header */
[data-theme="dark"] .header-banner {
    background: var(--header-bg);
    border-bottom: 1px solid var(--border-color);
}

/* Footer */
[data-theme="dark"] .site-footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
}

/* Subtab navigation */
[data-theme="dark"] .subtab-nav {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 4px;
    margin-bottom: 20px;
}

[data-theme="dark"] .subtab-btn {
    background: transparent;
    color: var(--text-secondary);
    border: none;
}

[data-theme="dark"] .subtab-btn.active {
    background: var(--accent-primary);
    color: white;
}

/* Mobile - keep stacked */
@media (max-width: 768px) {
    .container {
        max-width: 100%;
        padding: 12px;
    }
    
    .top-row-layout,
    .rates-row-layout {
        grid-template-columns: 1fr;
    }
}

/* ==================== NEW RATE CHECK LAYOUT (Map-First) ==================== */

/* Main two-column layout */
.ratecheck-main-layout {
    display: grid;
    grid-template-columns: 0.85fr 1fr;
    gap: 24px;
    min-height: 500px;
}

/* Map Panel - Right Side */
.ratecheck-map-panel {
    position: relative;
}

.ratecheck-map-panel .map-container {
    position: relative;
    height: 100%;
    min-height: 480px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.ratecheck-map-panel .ratecheck-map {
    height: 100%;
    width: 100%;
}

.ratecheck-map-panel .map-miles-badge {
    position: absolute;
    bottom: 16px;
    left: 16px;
    background: var(--accent-primary);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 1rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    z-index: 1000;
}

.ratecheck-map-panel .map-expand-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 1000;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 6px 10px;
    cursor: pointer;
    color: var(--text-primary);
}

/* Form Panel - Left Side */
.ratecheck-form-panel {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.ratecheck-form-panel .form-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 16px;
}

.ratecheck-form-panel .form-section label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.ratecheck-form-panel .field-icon {
    margin-right: 4px;
}

/* Lane Row - Origin/Dest side by side */
.ratecheck-form-panel .lane-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 12px;
}

.ratecheck-form-panel .lane-field input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.95rem;
}

.ratecheck-form-panel .lane-field input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(47,93,143, 0.15);
}

.ratecheck-form-panel .lane-validation {
    font-size: 0.75rem;
    margin-top: 4px;
    color: var(--success, #15803d);
}

/* Route Type Toggle (Interstate / Non-Interstate) */
.route-type-toggle {
    display: flex;
    gap: 16px;
    padding-top: 4px;
}

.route-type-toggle .toggle-option {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.route-type-toggle .toggle-option input {
    accent-color: var(--accent-primary);
}

.route-type-toggle .toggle-option input:checked + span {
    color: var(--text-primary);
    font-weight: 500;
}

/* Equipment Select */
.equipment-select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.95rem;
    cursor: pointer;
}

.equipment-select:focus {
    outline: none;
    border-color: var(--accent-primary);
}

/* Collapsible Dimensions */
.collapsible-dims {
    padding: 0 !important;
    overflow: hidden;
}

.dims-toggle {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 0.9rem;
    cursor: pointer;
    text-align: left;
}

.dims-toggle:hover {
    background: var(--bg-accent);
}

.dims-toggle .toggle-arrow {
    color: var(--text-muted);
    transition: transform 0.2s;
}

.dims-toggle.open .toggle-arrow {
    transform: rotate(180deg);
}

.dims-content {
    padding: 0 16px 16px 16px;
}

.dims-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.dim-field label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.dim-field input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.9rem;
    text-align: center;
}

/* Form Row (date + commodity) */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding: 12px 16px !important;
}

.form-field input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.95rem;
}

/* Full-width button */
.btn-full {
    width: 100%;
    padding: 14px 20px;
    font-size: 1rem;
}

/* OCR Hint (collapsed) */
.ocr-hint {
    text-align: center;
    margin-top: 8px;
}

.ocr-toggle-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.85rem;
    cursor: pointer;
    padding: 8px;
}

.ocr-toggle-btn:hover {
    color: var(--accent-text);
}

.ocr-content {
    margin-top: 12px;
}

.paste-target-mini {
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    padding: 16px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.paste-target-mini:hover,
.paste-target-mini:focus {
    border-color: var(--accent-primary);
    background: var(--accent-light);
}

/* Results Section */
.ratecheck-results-section {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}


/* ── Rate/Permit Check compact layout ────────────────────────────── */
/* Tighten the form panel so the OD accordion fits on one screen     */
.ratecheck-main-layout {
    gap: 16px;
}
.ratecheck-form-panel {
    gap: 8px;
    padding: 10px;
}
.ratecheck-form-panel .form-section {
    padding: 10px 14px;
    margin-bottom: 0;
}
.ratecheck-form-panel .lane-row {
    margin-bottom: 6px;
}
.ratecheck-form-panel .form-row {
    padding: 8px 14px !important;
}
.ratecheck-map-panel .map-container {
    min-height: 400px;
}
#ratecheck .rc-screenshot-row .paste-target-mini {
    padding: 6px 10px;
}
#ratecheck .tab-content-inner {
    padding: 16px;
}

/* Mobile responsive */
@media (max-width: 900px) {
    .ratecheck-main-layout {
        grid-template-columns: 1fr;
    }
    
    .ratecheck-map-panel .map-container {
        min-height: 300px;
    }
    
    .dims-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .lane-row {
        grid-template-columns: 1fr;
    }
}

/* Dark mode refinements for new layout */
[data-theme="dark"] .ratecheck-form-panel .form-section {
    background: var(--bg-secondary);
    border-color: var(--border-color);
}

[data-theme="dark"] .ratecheck-map-panel .map-container {
    border-color: var(--border-color);
}

[data-theme="dark"] .dims-toggle:hover {
    background: rgba(28,39,51,0.05);
}

[data-theme="dark"] .paste-target-mini {
    background: var(--bg-primary);
}


/* ==================== SHARP DARK MODE V2 ==================== */

/* Modern dark palette with cyan/teal accent */
[data-theme="dark"] {
    --bg-primary: #f4f1ea;
    --bg-secondary: #f4f1ea;
    --bg-accent: #fffdf8;
    --bg-card: #f7f4ec;
    --text-primary: #1c2733;
    --text-secondary: #5b6875;
    --text-muted: #5b6875;
    --border-color: #fffdf8;
    --border-hover: #edeae2;
    --accent-primary: #2f5d8f;
    --accent-hover: #22d3ee;
    --accent-light: rgba(6, 182, 212, 0.1);
    --accent-text: #2f5d8f;
    --success: #15803d;
    --warning: #b45309;
    --error: #b91c1c;
    --input-bg: #f4f1ea;
    --input-border: #fffdf8;
}

/* Cleaner dark body */
[data-theme="dark"] body {
    background: var(--bg-primary);
}

/* Header - sleek gradient */
[data-theme="dark"] .header-banner {
    background: linear-gradient(135deg, #f4f1ea 0%, #fffdf8 100%);
    border-bottom: 1px solid var(--border-color);
}

[data-theme="dark"] .header-banner h1 {
    color: #1c2733;
}

/* Tab nav - minimal */
[data-theme="dark"] .tabs {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 4px;
}

[data-theme="dark"] .tab-btn {
    background: transparent;
    color: var(--text-muted);
    border: none;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.15s;
}

[data-theme="dark"] .tab-btn:hover {
    color: var(--text-primary);
    background: var(--bg-accent);
}

[data-theme="dark"] .tab-btn.active {
    background: var(--accent-primary);
    color: #1c2733;
    font-weight: 600;
}

/* Form sections */
[data-theme="dark"] .ratecheck-form-panel .form-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
}

/* Inputs - cleaner */
[data-theme="dark"] input,
[data-theme="dark"] select {
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    color: var(--text-primary);
}

[data-theme="dark"] input:focus,
[data-theme="dark"] select:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-light);
    outline: none;
}

[data-theme="dark"] input::placeholder {
    color: var(--text-muted);
}

/* Buttons */
[data-theme="dark"] .btn-primary {
    background: var(--accent-primary);
    color: #1c2733;
    border: none;
    font-weight: 600;
}

[data-theme="dark"] .btn-primary:hover {
    background: var(--accent-hover);
}

[data-theme="dark"] .btn-secondary {
    background: var(--bg-accent);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

[data-theme="dark"] .btn-secondary:hover {
    background: var(--border-hover);
    border-color: var(--border-hover);
}

/* Map container */
[data-theme="dark"] .ratecheck-map-panel .map-container {
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

[data-theme="dark"] .map-miles-badge {
    background: var(--accent-primary);
    color: #1c2733;
    font-weight: 700;
}

/* Route type toggle */
[data-theme="dark"] .route-type-toggle .toggle-option {
    color: var(--text-muted);
}

[data-theme="dark"] .route-type-toggle .toggle-option input:checked + span {
    color: var(--accent-text);
}

/* Equipment dropdown */
[data-theme="dark"] .equipment-select {
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    color: var(--text-primary);
}

[data-theme="dark"] .equipment-select option {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

/* Dims toggle */
[data-theme="dark"] .dims-toggle {
    color: var(--text-primary);
}

[data-theme="dark"] .dims-toggle:hover {
    background: var(--bg-accent);
}

/* OCR hint */
[data-theme="dark"] .ocr-toggle-btn {
    color: var(--text-muted);
}

[data-theme="dark"] .ocr-toggle-btn:hover {
    color: var(--accent-text);
}

[data-theme="dark"] .paste-target-mini {
    background: var(--input-bg);
    border-color: var(--border-color);
    color: var(--text-muted);
}

[data-theme="dark"] .paste-target-mini:hover {
    border-color: var(--accent-primary);
    background: var(--accent-light);
}

/* Rate cards */
[data-theme="dark"] .rates-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
}

[data-theme="dark"] .rates-card h4 {
    color: var(--text-primary);
}

[data-theme="dark"] .rates-source {
    background: var(--accent-light);
    color: var(--accent-text);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
}

[data-theme="dark"] .rate-row {
    background: var(--bg-accent);
}

[data-theme="dark"] .rate-row.rate-avg {
    background: var(--accent-light);
    border: 1px solid var(--accent-primary);
}

[data-theme="dark"] .rate-value {
    color: var(--text-primary);
}

[data-theme="dark"] .sell-value {
    color: var(--success);
}

/* Subtab nav */
[data-theme="dark"] .subtab-nav {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
}

[data-theme="dark"] .subtab-btn {
    color: var(--text-muted);
}

[data-theme="dark"] .subtab-btn.active {
    background: var(--accent-primary);
    color: #1c2733;
}

/* Lane validation checkmark */
[data-theme="dark"] .lane-validation {
    color: var(--success);
}

/* Footer */
[data-theme="dark"] .site-footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
}

/* Scrollbar styling for dark mode */
[data-theme="dark"] ::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

[data-theme="dark"] ::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

[data-theme="dark"] ::-webkit-scrollbar-thumb {
    background: var(--bg-accent);
    border-radius: 4px;
}

[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
    background: var(--border-hover);
}


/* ==================== EQUIPMENT RECOMMENDATION ==================== */
.equipment-recommendation {
    margin-top: 8px;
    padding: 10px 12px;
    background: var(--accent-light);
    border: 1px solid var(--accent-primary);
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.15s;
}

.equipment-recommendation:hover {
    background: rgba(47,93,143, 0.15);
    border-color: var(--accent-hover);
}

.equipment-recommendation .rec-icon {
    margin-right: 4px;
}

.equipment-recommendation strong {
    color: var(--accent-text);
}

.equipment-recommendation .rec-reason {
    color: var(--text-muted);
    font-size: 0.85em;
}

[data-theme="dark"] .equipment-recommendation {
    background: rgba(6, 182, 212, 0.1);
    border-color: var(--accent-primary);
}

[data-theme="dark"] .equipment-recommendation:hover {
    background: rgba(6, 182, 212, 0.2);
}

[data-theme="dark"] .equipment-recommendation strong {
    color: var(--accent-text);
}

/* Equipment select optgroup styling */
.equipment-select optgroup {
    font-weight: 600;
    color: var(--text-secondary);
}

.equipment-select option {
    padding: 8px;
}

/* ==================== LOG ACTUAL RATE COMPACT ==================== */
.actual-rate-card.compact {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px 16px;
    margin-top: 16px;
}

.actual-rate-inline {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.actual-rate-label {
    font-weight: 500;
    color: var(--text-primary);
}

.actual-rate-inline .dollar-sign {
    color: var(--text-muted);
}

.actual-rate-inline input {
    width: 120px;
    padding: 6px 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--input-bg);
    color: var(--text-primary);
}

/* ==================== RATE ACTIONS ROW (Recommended + Log) ==================== */
.rate-actions-row {
    display: flex;
    gap: 12px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.recommended-rate-compact {
    display: flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, var(--accent-primary) 0%, #2f5d8f 100%);
    border-radius: 8px;
    padding: 10px 14px;
    color: white;
    flex-wrap: wrap;
}

.rec-label {
    font-weight: 500;
    font-size: 0.85rem;
    opacity: 0.9;
}

.rec-amount {
    font-size: 1.25rem;
    font-weight: 700;
}

.rec-permile {
    font-size: 0.85rem;
    opacity: 0.8;
}

.rec-note {
    font-size: 0.75rem;
    opacity: 0.75;
    width: 100%;
    margin-top: 2px;
}

.rate-actions-row .actual-rate-card.compact {
    margin-top: 0;
    flex: 1;
    min-width: 200px;
}

/* TAI Integration Button */
.tai-integration {
    margin-top: 16px;
}

.tai-btn {
    width: 100%;
    padding: 12px;
    font-size: 1rem;
}

.tai-btn .coming-soon {
    font-size: 0.85em;
    opacity: 0.7;
    font-style: italic;
}

.tai-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ==================== SUGGESTED START RATE CARD ==================== */
.start-rate-card {
    background: linear-gradient(135deg, var(--accent-primary) 0%, #2f5d8f 100%);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    color: white;
    margin-top: 16px;
}

.start-rate-header {
    margin-bottom: 8px;
}

.start-rate-label {
    font-size: 0.9rem;
    font-weight: 500;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.start-rate-value {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 8px;
}

.start-rate-amount {
    font-size: 2.5rem;
    font-weight: 700;
}

.start-rate-permile {
    font-size: 1.1rem;
    opacity: 0.85;
}

.start-rate-note {
    font-size: 0.8rem;
    opacity: 0.75;
    margin-top: 8px;
}

/* Highway Link Card */
.highway-link-card {
    margin-top: 12px;
}

.highway-link-card .carrier-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--accent-primary);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.15s;
}

.highway-link-card .carrier-link:hover {
    background: var(--accent-light);
    border-color: var(--accent-primary);
}

[data-theme="dark"] .start-rate-card {
    background: linear-gradient(135deg, #2f5d8f 0%, #2f5d8f 100%);
}

/* Quote Builder */
.quote-builder.compact { min-width: 180px; }
.qb-inputs { padding: 10px; border-bottom: 1px solid var(--border-color); }
.qb-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.qb-row:last-child { margin-bottom: 0; }
.qb-row label { font-size: 12px; color: var(--text-secondary); }
.qb-row input { width: 70px; padding: 4px 6px; background: var(--input-bg); border: 1px solid var(--border-color); border-radius: 4px; color: var(--text-primary); font-size: 13px; }
.qb-result { padding: 10px; }
.qb-line { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-secondary); margin-bottom: 4px; }
.qb-divider { height: 1px; background: var(--border-color); margin: 8px 0; }
.qb-line.qb-total { font-size: 15px; font-weight: 600; color: var(--success-color); }
.qb-line.qb-total span:last-child { font-size: 18px; }
.qb-line.qb-rpm { font-size: 11px; color: var(--text-muted); }

/* Simplify rate cards - single rate display */
.rate-row.rate-low, .rate-row.rate-high { display: none !important; }
.rates-confidence { display: none; }

/* Hide Network Rates card completely */
#networkRatesCard { display: none !important; }

/* Hide Greenscreens subtitle */
.rates-card.market-rates .rates-source { display: none !important; }

/* FreightDeck Rate card - hide Market Rate row and reasoning */
#aiRatesCard .rate-row:first-child { display: none !important; }
#aiRatesCard .ai-reasoning { display: none !important; }
#aiRatesCard .use-rate-row { display: none !important; }

/* Force cards to stay in a row */
.rates-row-layout {
    display: flex;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    gap: 16px;
    align-items: flex-start;
}

.rates-row-layout > .rates-card {
    flex: 1;
    min-width: 0;
}

/* Quote Builder should not wrap below */
#quoteBuilderCard {
    flex: 0 0 220px !important;
}

/* Rate cards layout - stacked rates on left, quote builder on right */
.rates-row-layout {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    grid-template-rows: auto auto !important;
    gap: 12px !important;
}

#marketRatesCard {
    grid-column: 1;
    grid-row: 1;
}

#aiRatesCard {
    grid-column: 1;
    grid-row: 2;
}

#quoteBuilderCard {
    grid-column: 2;
    grid-row: 1 / 3;
    display: flex;
    flex-direction: column;
}

#quoteBuilderCard .qb-result {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

#quoteBuilderCard .qb-line.qb-total {
    font-size: 20px;
}

#quoteBuilderCard .qb-line.qb-total span:last-child {
    font-size: 28px;
}

/* Quote Builder better styling */
#quoteBuilderCard {
    background: var(--card-bg) !important;
}

#quoteBuilderCard .rates-header {
    border-bottom: 1px solid var(--border-color);
    padding: 12px 16px;
}

#quoteBuilderCard .qb-inputs {
    padding: 12px 16px;
    background: rgba(28,39,51,0.07);
}

#quoteBuilderCard .qb-row label {
    color: var(--text-primary);
    font-weight: 500;
}

#quoteBuilderCard .qb-result {
    padding: 16px;
}

#quoteBuilderCard .qb-line {
    color: var(--text-primary);
}

/* Accessorials section */
.qb-accessorials {
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.acc-toggle {
    width: 100%;
    padding: 10px 16px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    text-align: left;
    cursor: pointer;
    font-size: 13px;
}

.acc-toggle:hover {
    background: rgba(28,39,51,0.05);
}

.acc-content {
    padding: 8px 16px 12px;
    background: rgba(28,39,51,0.052);
}

.acc-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    cursor: pointer;
    font-size: 12px;
    color: var(--text-secondary);
}

.acc-item input {
    margin: 0;
}

.acc-item span:last-child {
    margin-left: auto;
    color: var(--success-color);
    font-weight: 500;
}

.acc-item:has(input:checked) {
    color: var(--text-primary);
}

/* Permit Results Grid Layout */
.permit-results-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.permit-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
}

.permit-card h4 {
    margin: 0 0 12px 0;
    font-size: 14px;
    color: var(--text-primary);
    border-bottom: 2px solid var(--accent-color);
    padding-bottom: 8px;
    display: inline-block;
}

.permit-card h4 small {
    font-weight: normal;
    color: var(--text-secondary);
}

/* Dims grid inside permit card */
.permit-card .dims-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.permit-card .dim-item {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px solid var(--border-color);
}

.permit-card .dim-label {
    color: var(--text-secondary);
    font-size: 12px;
}

.permit-card .dim-value {
    font-weight: 600;
    color: var(--text-primary);
}

.permit-card .dim-value.height-warning {
    color: var(--warning-color);
}

.permit-card .dim-value.height-caution {
    color: #b45309;
}

/* State costs mini */
.state-costs-mini {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.state-cost-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: var(--text-secondary);
    padding: 4px 0;
}

.state-cost-row.survey {
    color: #b45309;
}

.state-cost-row.subtotal {
    border-top: 1px solid var(--border-color);
    padding-top: 8px;
    font-weight: 600;
    color: var(--text-primary);
}

/* Quote breakdown */
.quote-breakdown {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.quote-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: var(--text-secondary);
    padding: 4px 0;
}

.quote-row.total {
    border-top: 2px solid var(--accent-color);
    padding-top: 10px;
    margin-top: 4px;
    font-size: 16px;
    font-weight: 700;
    color: var(--success-color);
}

.quote-rpm {
    text-align: right;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 8px;
}

/* Warnings row */
.warnings-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.warning-badge {
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.warning-badge.survey {
    background: rgba(180,83,9, 0.2);
    color: #b45309;
}

.warning-badge.daylight {
    background: rgba(47,93,143, 0.2);
    color: #2f5d8f;
}

.warning-badge.weekend {
    background: rgba(185,28,28, 0.2);
    color: #b91c1c;
}

/* State details collapsible */
.state-details {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 16px;
}

.state-details summary {
    padding: 12px 16px;
    cursor: pointer;
    font-weight: 500;
    color: var(--text-primary);
}

.state-details[open] summary {
    border-bottom: 1px solid var(--border-color);
}

/* Permit disclaimers */
.permit-disclaimers {
    font-size: 11px;
    color: var(--text-muted);
    padding: 12px;
    background: rgba(28,39,51,0.07);
    border-radius: 6px;
}

.permit-disclaimers p {
    margin: 4px 0;
}

/* Compact permit table */
.permit-table.compact {
    font-size: 12px;
}

.permit-table.compact th,
.permit-table.compact td {
    padding: 6px 10px;
}

.permit-table td.yes {
    color: var(--success-color);
    font-weight: 600;
}

.permit-table td.maybe {
    color: #b45309;
}

/* Fix Quote Builder text visibility */
#quoteBuilderCard .qb-row label,
#quoteBuilderCard .qb-line span {
    color: var(--text-primary) !important;
}

#quoteBuilderCard .qb-line span:first-child {
    color: var(--text-secondary) !important;
}

.acc-toggle {
    color: var(--text-primary) !important;
}

/* Permit results - 2/3 state breakdown, 1/3 quote summary */
.permit-results-grid {
    grid-template-columns: auto 2fr 1fr !important;
}

/* Overall dims card - make compact */
.permit-card.dims-card {
    padding: 12px;
}

.permit-card.dims-card h4 {
    font-size: 12px;
    margin-bottom: 8px;
}

.permit-card.dims-card .dims-grid {
    gap: 4px;
}

.permit-card.dims-card .dim-item {
    padding: 3px 0;
    font-size: 12px;
}

/* State card full details */
.permit-card.state-card {
    min-width: 0;
}

/* Permit results row - 2/3 state, 1/3 quote */
.permit-results-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

/* State details card with table */
.state-details-card {
    overflow-x: auto;
}

.state-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.state-table th,
.state-table td {
    padding: 8px 10px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.state-table th {
    background: rgba(28,39,51,0.07);
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 11px;
    text-transform: uppercase;
}

.state-table td.yes {
    color: var(--success-color);
}

.state-table td.warn {
    color: #b45309;
}

.state-table tfoot td {
    background: rgba(28,39,51,0.105);
    font-weight: 600;
    border-top: 2px solid var(--border-color);
}

/* Quote summary card */
.quote-summary-card {
    display: flex;
    flex-direction: column;
}

.quote-rows {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.q-row {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 8px;
    font-size: 13px;
    padding: 6px 0;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

.q-row .q-sub {
    color: var(--text-muted);
    font-size: 11px;
}

.q-row.survey {
    color: #b45309;
}

.q-row.total {
    border-top: 2px solid var(--accent-color);
    border-bottom: none;
    margin-top: 8px;
    padding-top: 12px;
    font-size: 16px;
    font-weight: 700;
    color: var(--success-color);
}

.q-rpm {
    text-align: right;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 12px;
    padding-top: 8px;
    border-top: 1px solid var(--border-color);
}

/* Overall dims in trailer section */
#trailerDeckInfo {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 8px;
}

/* Overall dims display under trailer */
.overall-dims-mini {
    margin-top: 8px;
    padding: 8px 12px;
    background: rgba(47,93,143, 0.1);
    border-radius: 6px;
    font-size: 12px;
    color: var(--text-secondary);
}

.overall-dims-mini strong {
    color: var(--text-primary);
}

/* Workflow Helper - Permit Page */
.workflow-helper {
    background: rgba(47,93,143, 0.08);
    border: 1px solid rgba(47,93,143, 0.25);
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 20px;
}
.workflow-title {
    margin: 0 0 12px 0;
    font-size: 14px;
    color: #5b6875;
}
.workflow-options {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}
.workflow-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(255,253,248, 0.6);
    border: 1px solid rgba(100, 116, 139, 0.3);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    flex: 1;
    min-width: 220px;
}
.workflow-option:hover {
    background: rgba(47,93,143, 0.15);
    border-color: rgba(47,93,143, 0.4);
    transform: translateY(-1px);
}
.workflow-icon {
    font-size: 24px;
}
.workflow-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.workflow-text strong {
    color: #1c2733;
    font-size: 14px;
}
.workflow-text span {
    color: #5b6875;
    font-size: 12px;
}

/* ==================== DIMS CONVERTER TWO-CARD LAYOUT ==================== */
.dims-cards-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 16px;
}
.dims-card {
    border-radius: 8px;
    padding: 16px;
}
.dims-card.input-card {
    background: rgba(47,93,143, 0.08);
    border: 1px solid rgba(47,93,143, 0.25);
    border-left: 4px solid #2f5d8f;
}
.dims-card.results-card {
    background: rgba(21,128,61, 0.08);
    border: 1px solid rgba(21,128,61, 0.25);
    border-left: 4px solid #15803d;
}
.dims-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.dims-card-header h4 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #1c2733;
}
.unit-toggle {
    display: flex;
    gap: 4px;
}
.unit-toggle .mode-btn {
    padding: 4px 10px;
    font-size: 12px;
    border: 1px solid rgba(100, 116, 139, 0.3);
    background: transparent;
    color: #5b6875;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s;
}
.unit-toggle .mode-btn.active {
    background: #2f5d8f;
    border-color: #2f5d8f;
    color: white;
}
/* Base dims table styles - overridden by unified block below */
.input-card-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(100, 116, 139, 0.2);
}
.btn-link {
    background: none;
    border: none;
    color: #2f5d8f;
    cursor: pointer;
    font-size: 13px;
}
.btn-link:hover {
    text-decoration: underline;
}
.unit-select, .format-select {
    padding: 4px 8px;
    background: rgba(255,253,248, 0.6);
    border: 1px solid rgba(100, 116, 139, 0.3);
    border-radius: 4px;
    color: #1c2733;
    font-size: 12px;
}
.dims-results-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: #5b6875;
    text-align: center;
}
.placeholder-icon {
    font-size: 32px;
    margin-bottom: 8px;
    opacity: 0.5;
}
.results-card-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(100, 116, 139, 0.2);
}
.checkbox-col { width: 30px; text-align: center; }
.stackable-col { width: 50px; text-align: center; }

/* Upload section compact */
.upload-section-compact {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(255,253,248, 0.4);
    border: 1px solid rgba(100, 116, 139, 0.2);
    border-radius: 8px;
    flex-wrap: wrap;
}
.paste-target-compact {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(47,93,143, 0.1);
    border: 1px dashed rgba(47,93,143, 0.4);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
}
.paste-target-compact:hover {
    background: rgba(47,93,143, 0.15);
    border-color: #2f5d8f;
}
.paste-target-compact .paste-icon { font-size: 18px; }
.paste-target-compact .paste-text { color: #1c2733; font-size: 13px; }
.paste-target-compact .paste-hint { color: #5b6875; font-size: 11px; }
.paste-target-compact .paste-hint kbd {
    background: rgba(100, 116, 139, 0.3);
    padding: 2px 5px;
    border-radius: 3px;
    font-size: 10px;
}
.upload-preview-compact {
    display: flex;
    align-items: center;
    gap: 8px;
}
.image-preview-small {
    max-height: 40px;
    max-width: 80px;
    border-radius: 4px;
}
.ocr-status-inline {
    padding: 6px 12px;
    background: rgba(47,93,143, 0.1);
    border-radius: 4px;
    font-size: 12px;
    color: #5b6875;
}

/* Lane section compact */
.lane-section-compact {
    margin-top: 16px;
    padding: 12px 16px;
    background: rgba(255,253,248, 0.3);
    border-radius: 8px;
}
.lane-inputs-compact {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.lane-inputs-compact input {
    flex: 1;
    min-width: 150px;
    padding: 8px 12px;
    background: rgba(255,253,248, 0.6);
    border: 1px solid rgba(100, 116, 139, 0.3);
    border-radius: 6px;
    color: #1c2733;
    font-size: 13px;
}
.lane-inputs-compact .lane-arrow {
    color: #5b6875;
}

/* Oversize CTA */
.oversize-cta {
    margin-top: 16px;
    padding: 12px 16px;
    background: rgba(180,83,9, 0.1);
    border: 1px solid rgba(180,83,9, 0.3);
    border-left: 4px solid #b45309;
    border-radius: 8px;
}
.oversize-cta-content {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.oversize-cta-icon { font-size: 20px; }
.oversize-cta-text { flex: 1; color: #1c2733; }
.maybe-oversize-warning {
    margin-top: 12px;
    padding: 10px 14px;
    background: rgba(47,93,143, 0.08);
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #5b6875;
}

@media (max-width: 768px) {
    .dims-cards-row {
        grid-template-columns: 1fr;
    }
}

/* ==================== DARK THEME OVERRIDES ==================== */

/* 2-column truck layout */
body #truckGroups {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 16px !important;
}

/* Truck cards - lighter gray tinted background */
body .truck-group {
    background: rgba(28, 39, 51, 0.9) !important;
    border: 1px solid rgba(100, 100, 110, 0.4) !important;
    border-radius: 8px !important;
}

/* AI Recommendations / FreightDeck Intelligence panel */
body .ai-recommendations {
    background: rgba(47,93,143, 0.08) !important;
    border: 1px solid rgba(47,93,143, 0.25) !important;
    border-left: 4px solid #2f5d8f !important;
    border-radius: 8px !important;
    padding: 16px !important;
}

body .ai-recommendations h3 {
    color: #1c2733 !important;
    margin-bottom: 12px !important;
}

/* Warning banner - match OD card style (orange tint) */
body .loadbuilder-warning,
body .od-warning {
    background: rgba(180,83,9, 0.1) !important;
    border: 1px solid rgba(180,83,9, 0.3) !important;
    border-left: 4px solid #b45309 !important;
    border-radius: 8px !important;
    color: #1c2733 !important;
}

/* State Regulations page dark theme */
body #stateregs {
    background: transparent !important;
}

body .state-regs-container,
body .regs-content {
    background: rgba(255,253,248, 0.4) !important;
    border: 1px solid rgba(100, 116, 139, 0.2) !important;
    border-radius: 8px !important;
}

body .regs-table th {
    background: rgba(255,253,248, 0.6) !important;
    color: #5b6875 !important;
}

body .regs-table td {
    background: transparent !important;
    color: #1c2733 !important;
    border-color: rgba(100, 116, 139, 0.2) !important;
}

body .regs-table tr:hover td {
    background: rgba(47,93,143, 0.08) !important;
}

/* Unassigned pieces pool */
body .unassigned-pool {
    background: rgba(255,253,248, 0.4) !important;
    border: 1px solid rgba(100, 116, 139, 0.2) !important;
    border-radius: 8px !important;
}

body .piece-card {
    background: rgba(237,234,226, 0.9) !important;
    border: 1px solid rgba(100, 116, 139, 0.3) !important;
}

body .piece-card:hover {
    border-color: #2f5d8f !important;
}

/* Remove all white backgrounds */
body .card,
body .panel,
body .section,
body .box {
    background: rgba(255,253,248, 0.4) !important;
}

/* Permit results styling */
body .permit-results,
body #permitResults {
    background: rgba(255,253,248, 0.4) !important;
    border: 1px solid rgba(100, 116, 139, 0.2) !important;
    border-radius: 8px !important;
}

body .cost-summary {
    background: rgba(21,128,61, 0.08) !important;
    border: 1px solid rgba(21,128,61, 0.25) !important;
    border-left: 4px solid #15803d !important;
}

body .trailer-summary {
    background: rgba(47,93,143, 0.08) !important;
    border: 1px solid rgba(47,93,143, 0.25) !important;
    border-left: 4px solid #2f5d8f !important;
}

/* Mobile responsive for truck grid */
@media (max-width: 900px) {
    body #truckGroups {
        grid-template-columns: 1fr !important;
    }
}

/* ==================== RATE CHECK DARK THEME ==================== */

/* Rate cards row - 3 columns */
body .rates-row-layout {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 16px !important;
    margin-bottom: 16px !important;
}

/* Base rate card - dark theme */
body .rates-card,
body .margin-card {
    background: rgba(255,253,248, 0.6) !important;
    border: 1px solid rgba(100, 116, 139, 0.3) !important;
    border-radius: 8px !important;
    color: #1c2733 !important;
}

/* Market Rates - Blue tint */
body .rates-card.market-rates {
    background: rgba(47,93,143, 0.08) !important;
    border: 1px solid rgba(47,93,143, 0.25) !important;
    border-left: 4px solid #2f5d8f !important;
    border-top: none !important;
}

/* Network Rates - Purple tint */
body .rates-card.network-rates {
    background: rgba(47,93,143, 0.08) !important;
    border: 1px solid rgba(47,93,143, 0.25) !important;
    border-left: 4px solid #2f5d8f !important;
    border-top: none !important;
}

/* AI/FreightDeck Rates - Orange tint */
body .rates-card.ai-rates {
    background: rgba(180,83,9, 0.08) !important;
    border: 1px solid rgba(180,83,9, 0.25) !important;
    border-left: 4px solid #b45309 !important;
    border-top: none !important;
}

/* Lane History - Gray tint */
body .rates-card.lane-history {
    background: rgba(28, 39, 51, 0.9) !important;
    border: 1px solid rgba(100, 100, 110, 0.4) !important;
    border-left: 4px solid #c9c2b2 !important;
}

/* Truck Rate Card - Green tint */
body .rates-card.truck-rate-card {
    background: rgba(21,128,61, 0.08) !important;
    border: 1px solid rgba(21,128,61, 0.25) !important;
    border-left: 4px solid #15803d !important;
}

/* Rate card headers */
body .rates-card .rates-header {
    border-bottom: 1px solid rgba(100, 116, 139, 0.2) !important;
}

body .rates-card .rates-header h4 {
    color: #1c2733 !important;
}

body .rates-card.market-rates .rates-header h4 { color: #2f5d8f !important; }
body .rates-card.network-rates .rates-header h4 { color: #2f5d8f !important; }
body .rates-card.ai-rates .rates-header h4 { color: #b45309 !important; }

/* Source badges */
body .rates-source {
    background: rgba(100, 116, 139, 0.3) !important;
    color: #5b6875 !important;
}

body .market-rates .rates-source {
    background: rgba(47,93,143, 0.2) !important;
    color: #2f5d8f !important;
}

body .network-rates .rates-source {
    background: rgba(47,93,143, 0.2) !important;
    color: #2f5d8f !important;
}

body .ai-rates .rates-source.beta-tag {
    background: rgba(180,83,9, 0.3) !important;
    color: #b45309 !important;
}

/* Rate values */
body .rate-row {
    color: #1c2733 !important;
}

body .rate-label {
    color: #5b6875 !important;
}

body .rate-value {
    color: #1c2733 !important;
}

body .rate-per-mile {
    color: #5b6875 !important;
}

/* Target/avg row highlight */
body .rate-row.rate-avg {
    background: rgba(21,128,61, 0.1) !important;
    border-radius: 6px !important;
    padding: 8px !important;
    margin: 4px -4px !important;
}

body .rate-row.rate-avg .rate-value {
    color: #15803d !important;
    font-weight: 700 !important;
}

/* AI prediction row */
body .rate-row.rate-ai-prediction {
    background: rgba(180,83,9, 0.15) !important;
    border-radius: 6px !important;
}

body .rate-row.rate-ai-prediction .rate-value {
    color: #b45309 !important;
}

/* Confidence display */
body .rates-confidence {
    color: #5b6875 !important;
}

body .rates-confidence .conf-value {
    color: #1c2733 !important;
}

/* AI reasoning box */
body .ai-reasoning {
    background: rgba(47,93,143, 0.1) !important;
    color: #5b6875 !important;
}

/* Feedback buttons */
body .card-feedback {
    border-top: 1px solid rgba(100, 116, 139, 0.2) !important;
    padding-top: 8px !important;
    margin-top: 8px !important;
}

body .card-feedback-label {
    color: #5b6875 !important;
}

body .card-fb-btn {
    background: rgba(100, 116, 139, 0.2) !important;
    border: 1px solid rgba(100, 116, 139, 0.3) !important;
    color: #5b6875 !important;
}

body .card-fb-btn:hover {
    background: rgba(47,93,143, 0.2) !important;
    border-color: #2f5d8f !important;
    color: #1c2733 !important;
}

/* Lane stats */
body .lane-stats {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 8px !important;
}

body .lane-stat {
    text-align: center !important;
}

body .lane-stat .stat-label {
    color: #5b6875 !important;
    font-size: 11px !important;
}

body .lane-stat .stat-value {
    color: #1c2733 !important;
    font-weight: 600 !important;
}

/* Rate bottom actions */
body .rate-bottom-actions {
    display: flex;
    gap: 16px !important;
    align-items: flex-start !important;
    flex-wrap: wrap !important;
}

/* Quote Builder Card - Green tint */
body .rates-card.quote-builder,
body .quote-builder-card {
    background: rgba(21,128,61, 0.08) !important;
    border: 1px solid rgba(21,128,61, 0.25) !important;
    border-left: 4px solid #15803d !important;
}

/* Mobile: stack rate cards */
@media (max-width: 1024px) {
    body .rates-row-layout {
        grid-template-columns: 1fr 1fr !important;
    }
}

@media (max-width: 768px) {
    body .rates-row-layout {
        grid-template-columns: 1fr !important;
    }
}

/* ==================== RATE CHECK FORM DARK THEME ==================== */

/* Form panels */
body .ratecheck-form-panel,
body .permit-form-panel {
    background: rgba(255,253,248, 0.4) !important;
    border: 1px solid rgba(100, 116, 139, 0.2) !important;
    border-radius: 8px !important;
    padding: 16px !important;
}

/* Form sections */
body .form-section {
    margin-bottom: 12px !important;
}

body .form-section label {
    color: #5b6875 !important;
    font-size: 12px !important;
    font-weight: 500 !important;
}

body .form-section .field-icon {
    margin-right: 4px !important;
}

/* Inputs */
body .ratecheck-form-panel input,
body .ratecheck-form-panel select,
body .permit-form-panel input,
body .permit-form-panel select {
    background: rgba(255,253,248, 0.8) !important;
    border: 1px solid rgba(100, 116, 139, 0.3) !important;
    color: #1c2733 !important;
    border-radius: 6px !important;
    padding: 10px 12px !important;
}

body .ratecheck-form-panel input:focus,
body .ratecheck-form-panel select:focus,
body .permit-form-panel input:focus,
body .permit-form-panel select:focus {
    border-color: #2f5d8f !important;
    outline: none !important;
    box-shadow: 0 0 0 2px rgba(47,93,143, 0.2) !important;
}

body .ratecheck-form-panel input::placeholder,
body .permit-form-panel input::placeholder {
    color: #5b6875 !important;
}

/* Equipment select */
body .equipment-select {
    background: rgba(255,253,248, 0.8) !important;
    color: #1c2733 !important;
}

body .equipment-select optgroup {
    background: #fffdf8 !important;
    color: #5b6875 !important;
}

body .equipment-select option {
    background: #fffdf8 !important;
    color: #1c2733 !important;
}

/* Lane validation */
body .lane-validation {
    font-size: 11px !important;
    margin-top: 4px !important;
}

/* OCR hint section */
body .ocr-hint {
    margin-top: 12px !important;
    padding-top: 12px !important;
    border-top: 1px solid rgba(100, 116, 139, 0.2) !important;
}

body .ocr-toggle-btn {
    background: transparent !important;
    border: none !important;
    color: #5b6875 !important;
    cursor: pointer !important;
    font-size: 13px !important;
}

body .ocr-toggle-btn:hover {
    color: #2f5d8f !important;
}

body .paste-target-mini {
    background: rgba(47,93,143, 0.08) !important;
    border: 1px dashed rgba(47,93,143, 0.4) !important;
    border-radius: 6px !important;
    padding: 12px !important;
    text-align: center !important;
    color: #5b6875 !important;
    cursor: pointer !important;
    margin-top: 8px !important;
}

body .paste-target-mini:hover {
    background: rgba(47,93,143, 0.12) !important;
    border-color: #2f5d8f !important;
}

/* Map panels */
body .ratecheck-map-panel,
body .permit-map-panel {
    background: rgba(255,253,248, 0.3) !important;
    border: 1px solid rgba(100, 116, 139, 0.2) !important;
    border-radius: 8px !important;
    overflow: hidden !important;
}

body .map-placeholder {
    background: rgba(255,253,248, 0.6) !important;
    color: #5b6875 !important;
}

body .map-placeholder-icon {
    font-size: 48px !important;
    opacity: 0.5 !important;
}

body .map-miles-badge {
    background: rgba(21,128,61, 0.9) !important;
    color: white !important;
    padding: 4px 12px !important;
    border-radius: 4px !important;
    font-weight: 600 !important;
}

/* Primary button */
body .btn-primary.btn-large {
    background: linear-gradient(135deg, #2f5d8f 0%, #2f5d8f 100%) !important;
    border: none !important;
    padding: 14px 24px !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    border-radius: 8px !important;
    color: white !important;
    box-shadow: 0 4px 12px rgba(47,93,143, 0.3) !important;
}

body .btn-primary.btn-large:hover {
    background: linear-gradient(135deg, #2f5d8f 0%, #2f5d8f 100%) !important;
    box-shadow: 0 6px 16px rgba(47,93,143, 0.4) !important;
}

/* ==================== PERMIT RESULTS - 2 CARD LAYOUT ==================== */

/* Results section container */
body .permit-results-section {
    margin-top: 20px !important;
}

/* Two-card row: State Breakdown (2/3) + Quote Summary (1/3) */
body .permit-cards-row {
    display: grid !important;
    grid-template-columns: 2fr 1fr !important;
    gap: 16px !important;
    margin-bottom: 16px !important;
}

/* Base permit card */
body .permit-card {
    background: rgba(255,253,248, 0.6) !important;
    border: 1px solid rgba(100, 116, 139, 0.3) !important;
    border-radius: 8px !important;
    padding: 16px !important;
}

body .permit-card h4 {
    color: #1c2733 !important;
    margin: 0 0 12px 0 !important;
    font-size: 14px !important;
    font-weight: 600 !important;
}

/* State Breakdown Card - Blue tint */
body .permit-card.state-breakdown {
    background: rgba(47,93,143, 0.06) !important;
    border: 1px solid rgba(47,93,143, 0.2) !important;
    border-left: 4px solid #2f5d8f !important;
}

/* Quote Summary Card - Green tint */
body .permit-card.quote-summary-card {
    background: rgba(21,128,61, 0.08) !important;
    border: 1px solid rgba(21,128,61, 0.25) !important;
    border-left: 4px solid #15803d !important;
}

/* State breakdown table */
body .state-breakdown-table {
    width: 100% !important;
    border-collapse: collapse !important;
    font-size: 13px !important;
}

body .state-breakdown-table th {
    text-align: left !important;
    padding: 8px 10px !important;
    font-weight: 500 !important;
    color: #5b6875 !important;
    border-bottom: 1px solid rgba(100, 116, 139, 0.3) !important;
    font-size: 11px !important;
    text-transform: uppercase !important;
}

body .state-breakdown-table td {
    padding: 8px 10px !important;
    border-bottom: 1px solid rgba(100, 116, 139, 0.15) !important;
    color: #1c2733 !important;
}

body .state-breakdown-table td.yes {
    color: #15803d !important;
    font-weight: 500 !important;
}

body .state-breakdown-table td.no {
    color: #5b6875 !important;
}

body .state-breakdown-table tr:hover td {
    background: rgba(47,93,143, 0.08) !important;
}

/* Quote summary line items */
body .quote-line-item {
    display: flex;
    justify-content: space-between !important;
    padding: 8px 0 !important;
    border-bottom: 1px solid rgba(100, 116, 139, 0.15) !important;
}

body .quote-line-item .label {
    color: #5b6875 !important;
    font-size: 13px !important;
}

body .quote-line-item .value {
    color: #1c2733 !important;
    font-weight: 500 !important;
}

body .quote-line-item.total {
    border-top: 2px solid rgba(21,128,61, 0.4) !important;
    border-bottom: none !important;
    margin-top: 8px !important;
    padding-top: 12px !important;
}

body .quote-line-item.total .label {
    color: #15803d !important;
    font-weight: 600 !important;
}

body .quote-line-item.total .value {
    color: #15803d !important;
    font-size: 18px !important;
    font-weight: 700 !important;
}

/* Warnings row */
body .warnings-row {
    display: flex;
    gap: 12px !important;
    flex-wrap: wrap !important;
    margin-bottom: 16px !important;
}

body .warning-badge {
    padding: 8px 14px !important;
    border-radius: 6px !important;
    font-size: 12px !important;
    font-weight: 500 !important;
}

body .warning-badge.survey {
    background: rgba(47,93,143, 0.15) !important;
    border: 1px solid rgba(47,93,143, 0.3) !important;
    color: #2f5d8f !important;
}

body .warning-badge.daylight {
    background: rgba(180,83,9, 0.15) !important;
    border: 1px solid rgba(180,83,9, 0.3) !important;
    color: #b45309 !important;
}

body .warning-badge.weekend {
    background: rgba(185,28,28, 0.15) !important;
    border: 1px solid rgba(185,28,28, 0.3) !important;
    color: #b91c1c !important;
}

/* Permit disclaimers */
body .permit-disclaimers {
    background: rgba(255,253,248, 0.4) !important;
    border: 1px solid rgba(100, 116, 139, 0.2) !important;
    border-radius: 6px !important;
    padding: 12px 16px !important;
    font-size: 11px !important;
    color: #5b6875 !important;
}

body .permit-disclaimers strong {
    color: #5b6875 !important;
}

body .permit-disclaimers ul {
    margin: 8px 0 0 16px !important;
    padding: 0 !important;
}

body .permit-disclaimers li {
    margin: 4px 0 !important;
}

/* Old permit table styling (fallback) */
body .permit-table {
    width: 100% !important;
    border-collapse: collapse !important;
    background: rgba(255,253,248, 0.4) !important;
    border-radius: 8px !important;
    overflow: hidden !important;
}

body .permit-table th {
    background: rgba(255,253,248, 0.8) !important;
    color: #5b6875 !important;
    padding: 10px 12px !important;
    font-size: 11px !important;
    text-transform: uppercase !important;
}

body .permit-table td {
    padding: 10px 12px !important;
    border-bottom: 1px solid rgba(100, 116, 139, 0.15) !important;
    color: #1c2733 !important;
}

body .permit-table .permit-row {
    background: rgba(180,83,9, 0.05) !important;
}

body .permit-table .status-yes {
    color: #15803d !important;
    font-weight: 600 !important;
}

body .permit-table .status-no {
    color: #5b6875 !important;
}

body .permit-table .status-maybe {
    color: #b45309 !important;
}

/* Cost summary box */
body .cost-summary {
    background: rgba(21,128,61, 0.08) !important;
    border: 1px solid rgba(21,128,61, 0.25) !important;
    border-left: 4px solid #15803d !important;
    border-radius: 8px !important;
    padding: 16px !important;
    margin-bottom: 16px !important;
}

body .cost-summary h3 {
    color: #15803d !important;
    margin: 0 0 12px 0 !important;
}

body .cost-grid {
    display: grid !important;
    gap: 8px !important;
}

body .cost-item {
    display: flex;
    justify-content: space-between !important;
    padding: 8px 0 !important;
    border-bottom: 1px solid rgba(100, 116, 139, 0.15) !important;
}

body .cost-item .cost-label {
    color: #5b6875 !important;
}

body .cost-item .cost-value {
    color: #1c2733 !important;
    font-weight: 500 !important;
}

body .cost-item.total {
    border-top: 2px solid rgba(21,128,61, 0.4) !important;
    border-bottom: none !important;
    margin-top: 8px !important;
    padding-top: 12px !important;
}

body .cost-item.total .cost-label,
body .cost-item.total .cost-value {
    color: #15803d !important;
    font-weight: 700 !important;
    font-size: 16px !important;
}

/* Trailer summary box */
body .trailer-summary {
    background: rgba(47,93,143, 0.08) !important;
    border: 1px solid rgba(47,93,143, 0.25) !important;
    border-left: 4px solid #2f5d8f !important;
    border-radius: 8px !important;
    padding: 16px !important;
    margin-bottom: 16px !important;
}

body .trailer-summary h3 {
    color: #2f5d8f !important;
    margin: 0 0 12px 0 !important;
}

body .trailer-summary-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
}

body .trailer-summary-item {
    display: flex;
    justify-content: space-between !important;
}

body .trailer-summary-item .label {
    color: #5b6875 !important;
}

body .trailer-summary-item .value {
    color: #1c2733 !important;
    font-weight: 500 !important;
}

body .trailer-summary-item.highlight .value {
    color: #15803d !important;
}

body .trailer-summary-item.highlight .value.height-warning {
    color: #b45309 !important;
}

/* Survey & travel warnings */
body .survey-warning,
body .travel-restrictions-warning,
body .superload-warning {
    background: rgba(180,83,9, 0.1) !important;
    border: 1px solid rgba(180,83,9, 0.3) !important;
    border-left: 4px solid #b45309 !important;
    border-radius: 8px !important;
    padding: 12px 16px !important;
    margin-bottom: 12px !important;
    color: #1c2733 !important;
}

body .survey-warning strong,
body .travel-restrictions-warning strong,
body .superload-warning strong {
    color: #b45309 !important;
}

/* Mobile responsive */
@media (max-width: 900px) {
    body .permit-cards-row {
        grid-template-columns: 1fr !important;
    }
}

/* ==================== STATE REGULATIONS DARK THEME ==================== */

body .state-regs-section {
    padding: 10px 12px !important;
}

/* Header row: title + selector + disclaimer inline */
.sr-header {
    display: flex !important;
    align-items: center !important;
    gap: 16px !important;
    margin-bottom: 8px !important;
    flex-wrap: wrap !important;
}
.sr-header h2 {
    color: #1c2733 !important;
    font-size: 16px !important;
    margin: 0 !important;
    white-space: nowrap !important;
}
.sr-selector select {
    background: rgba(255,253,248, 0.8) !important;
    border: 1px solid rgba(100, 116, 139, 0.3) !important;
    color: #1c2733 !important;
    padding: 6px 10px !important;
    border-radius: 6px !important;
    font-size: 13px !important;
    min-width: 180px !important;
}
.sr-disclaimer {
    color: #5b6875 !important;
    font-size: 11px !important;
    font-style: italic !important;
    margin-left: auto !important;
}

/* 3-column grid */
.sr-grid-3 {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 8px !important;
}

/* Compact card */
.sr-card {
    background: rgba(255,253,248, 0.6) !important;
    border: 1px solid rgba(100, 116, 139, 0.3) !important;
    border-radius: 6px !important;
    padding: 8px 10px !important;
    border-left: 3px solid #d8d2c4 !important;
}
.sr-card h4 {
    color: #1c2733 !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    margin: 0 0 6px 0 !important;
    padding-bottom: 4px !important;
    border-bottom: 1px solid rgba(100, 116, 139, 0.15) !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
}

/* Card color variants */
.sr-card.sr-blue { background: rgba(47,93,143, 0.06) !important; border-left-color: #2f5d8f !important; }
.sr-card.sr-blue h4 { color: #2f5d8f !important; }
.sr-card.sr-green { background: rgba(21,128,61, 0.06) !important; border-left-color: #15803d !important; }
.sr-card.sr-green h4 { color: #15803d !important; }
.sr-card.sr-orange { background: rgba(180,83,9, 0.06) !important; border-left-color: #b45309 !important; }
.sr-card.sr-orange h4 { color: #b45309 !important; }
.sr-card.sr-amber { background: rgba(180,83,9, 0.04) !important; border-left-color: #b45309 !important; }
.sr-card.sr-amber h4 { color: #b45309 !important; }
.sr-card.sr-purple { background: rgba(139, 92, 246, 0.06) !important; border-left-color: #2f5d8f !important; }
.sr-card.sr-purple h4 { color: #2f5d8f !important; }
.sr-card.sr-slate { background: rgba(237,234,226, 0.4) !important; border-left-color: #c9c2b2 !important; }
.sr-card.sr-slate h4 { color: #5b6875 !important; }
.sr-card.sr-red { background: rgba(185,28,28, 0.06) !important; border-left-color: #b91c1c !important; }
.sr-card.sr-red h4 { color: #b91c1c !important; }

/* Compact rows */
.sr-row {
    display: flex !important;
    justify-content: space-between !important;
    padding: 3px 0 !important;
    border-bottom: 1px solid rgba(100, 116, 139, 0.08) !important;
    font-size: 12px !important;
}
.sr-row:last-of-type { border-bottom: none !important; }
.sr-row span:first-child { color: #5b6875 !important; }
.sr-row span:last-child { color: #1c2733 !important; font-weight: 500 !important; text-align: right !important; }

/* Notes text */
.sr-notes {
    font-size: 11px !important;
    color: #5b6875 !important;
    line-height: 1.3 !important;
    margin-top: 4px !important;
    font-style: italic !important;
}

/* Cost reference bar */
.sr-cost-bar {
    display: flex !important;
    gap: 0 !important;
    margin-top: 8px !important;
    background: rgba(255,253,248, 0.5) !important;
    border: 1px solid rgba(71, 85, 105, 0.25) !important;
    border-radius: 6px !important;
    overflow: hidden !important;
    font-size: 11px !important;
    color: #5b6875 !important;
}
.sr-cost-bar > div {
    flex: 1 !important;
    padding: 6px 10px !important;
    border-right: 1px solid rgba(71, 85, 105, 0.25) !important;
    line-height: 1.3 !important;
}
.sr-cost-bar > div:last-child { border-right: none !important; }
.sr-cost-bar strong { color: #1c2733 !important; font-size: 11px !important; }

/* Mobile */
@media (max-width: 900px) {
    .sr-grid-3 { grid-template-columns: 1fr 1fr !important; }
    .sr-cost-bar { flex-wrap: wrap !important; }
    .sr-cost-bar > div { flex: 1 1 45% !important; }
}
@media (max-width: 600px) {
    .sr-grid-3 { grid-template-columns: 1fr !important; }
    .sr-cost-bar > div { flex: 1 1 100% !important; }
}

/* Keep old classes working for any other references */
body .info-card { display: none !important; }
body .state-info-grid { display: none !important; }

/* Mobile */
@media (max-width: 768px) {
    body .state-info-grid {
        grid-template-columns: 1fr !important;
    }
    
    body .info-card.full-width {
        grid-column: span 1 !important;
    }
}

/* ==================== LOAD BUILDER DARK THEME ==================== */

/* Load builder container */
body #loadbuild {
    padding: 16px !important;
}

/* Top row: Intelligence + Unassigned Pool side by side */
body .loadbuilder-top-row {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 16px !important;
    margin-bottom: 16px !important;
}

/* FreightDeck Intelligence panel */
body .ai-recommendations {
    background: rgba(47,93,143, 0.08) !important;
    border: 1px solid rgba(47,93,143, 0.25) !important;
    border-left: 4px solid #2f5d8f !important;
    border-radius: 8px !important;
    padding: 16px !important;
}

body .ai-recommendations h4 {
    color: #2f5d8f !important;
    margin: 0 0 8px 0 !important;
    font-size: 15px !important;
}

body .ai-recommendations .hint {
    color: #5b6875 !important;
    font-size: 12px !important;
    margin-bottom: 12px !important;
}

body .recommendations-list {
    display: flex;
    flex-direction: column !important;
    gap: 8px !important;
}

body .recommendation-item {
    background: rgba(255,253,248, 0.6) !important;
    border: 1px solid rgba(100, 116, 139, 0.3) !important;
    border-radius: 6px !important;
    padding: 12px !important;
    cursor: pointer !important;
    transition: all 0.15s !important;
}

body .recommendation-item:hover {
    background: rgba(47,93,143, 0.15) !important;
    border-color: #2f5d8f !important;
}

body .recommendation-item.selected {
    background: rgba(21,128,61, 0.15) !important;
    border-color: #15803d !important;
}

/* Unassigned pieces pool */
body .loadbuilder-pool {
    background: rgba(28, 39, 51, 0.6) !important;
    border: 1px solid rgba(100, 100, 110, 0.4) !important;
    border-radius: 8px !important;
    padding: 16px !important;
}

body .loadbuilder-pool h3 {
    color: #1c2733 !important;
    font-size: 15px !important;
    margin: 0 0 8px 0 !important;
}

body .loadbuilder-pool .hint {
    color: #5b6875 !important;
    font-size: 12px !important;
    margin-bottom: 12px !important;
}

body .piece-pool {
    min-height: 80px !important;
    background: rgba(255,253,248, 0.4) !important;
    border: 2px dashed rgba(100, 116, 139, 0.3) !important;
    border-radius: 6px !important;
    padding: 12px !important;
    display: flex;
    flex-wrap: wrap !important;
    gap: 8px !important;
}

body .piece-pool .empty-state {
    color: #5b6875 !important;
    font-size: 13px !important;
    width: 100% !important;
    text-align: center !important;
    padding: 20px !important;
}

/* Piece cards */
body .piece-card {
    background: rgba(237,234,226, 0.95) !important;
    border: 1px solid rgba(100, 116, 139, 0.3) !important;
    border-radius: 6px !important;
    padding: 10px 12px !important;
    cursor: grab !important;
    transition: all 0.15s !important;
    min-width: 140px !important;
}

body .piece-card:hover {
    border-color: #2f5d8f !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
}

body .piece-card.dragging {
    opacity: 0.5 !important;
}

body .piece-card .piece-name {
    color: #1c2733 !important;
    font-weight: 500 !important;
    font-size: 13px !important;
    margin-bottom: 4px !important;
}

body .piece-card .piece-dims {
    color: #5b6875 !important;
    font-size: 11px !important;
}

body .piece-card .piece-weight {
    color: #5b6875 !important;
    font-size: 11px !important;
}

/* Accepted plan banner */
body .accepted-plan {
    background: rgba(21,128,61, 0.08) !important;
    border: 1px solid rgba(21,128,61, 0.25) !important;
    border-left: 4px solid #15803d !important;
    border-radius: 8px !important;
    padding: 16px !important;
    margin-bottom: 16px !important;
}

body .accepted-plan-header {
    display: flex;
    justify-content: space-between !important;
    align-items: center !important;
    flex-wrap: wrap !important;
    gap: 12px !important;
    margin-bottom: 12px !important;
}

body .accepted-plan-header h4 {
    color: #15803d !important;
    margin: 0 !important;
}

body .plan-header-actions {
    display: flex;
    gap: 8px !important;
    flex-wrap: wrap !important;
}

body .accepted-plan-details {
    color: #1c2733 !important;
}

body .accepted-plan-actions {
    margin-top: 12px !important;
    padding-top: 12px !important;
    border-top: 1px solid rgba(21,128,61, 0.2) !important;
    display: flex;
    align-items: center !important;
    gap: 12px !important;
}

body .action-hint {
    color: #5b6875 !important;
    font-size: 12px !important;
}

/* Trucks section */
body .loadbuilder-trucks {
    margin-top: 16px !important;
}

body .trucks-header {
    display: flex;
    justify-content: space-between !important;
    align-items: center !important;
    margin-bottom: 12px !important;
}

body .trucks-header h3 {
    color: #1c2733 !important;
    margin: 0 !important;
}

/* Truck groups - 2 column grid (already defined but reinforcing) */
body .truck-groups,
body #truckGroups {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 16px !important;
}

/* Individual truck card */
body .truck-group {
    background: rgba(28, 39, 51, 0.9) !important;
    border: 1px solid rgba(100, 100, 110, 0.4) !important;
    border-radius: 8px !important;
    padding: 14px !important;
}

body .truck-group.od-truck {
    border-left: 4px solid #b45309 !important;
    background: rgba(180,83,9, 0.05) !important;
}

body .truck-group .truck-header {
    display: flex;
    justify-content: space-between !important;
    align-items: center !important;
    margin-bottom: 10px !important;
    padding-bottom: 8px !important;
    border-bottom: 1px solid rgba(100, 116, 139, 0.2) !important;
}

body .truck-group .truck-name {
    color: #1c2733 !important;
    font-weight: 600 !important;
}

body .truck-group .truck-type {
    color: #5b6875 !important;
    font-size: 12px !important;
}

body .truck-group .truck-pieces {
    min-height: 60px !important;
    background: rgba(255,253,248, 0.4) !important;
    border: 2px dashed rgba(100, 116, 139, 0.2) !important;
    border-radius: 6px !important;
    padding: 8px !important;
    display: flex;
    flex-wrap: wrap !important;
    gap: 6px !important;
}

body .truck-group .truck-summary {
    margin-top: 10px !important;
    padding-top: 8px !important;
    border-top: 1px solid rgba(100, 116, 139, 0.2) !important;
    font-size: 12px !important;
    color: #5b6875 !important;
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 4px !important;
}

body .truck-group .truck-summary strong {
    color: #1c2733 !important;
}

/* OD warning in truck */
body .truck-od-warning {
    background: rgba(180,83,9, 0.15) !important;
    border: 1px solid rgba(180,83,9, 0.3) !important;
    border-radius: 4px !important;
    padding: 6px 10px !important;
    margin-top: 8px !important;
    font-size: 11px !important;
    color: #b45309 !important;
}

/* Permit action button row */
body .trucks-permit-action,
body .export-plan-action,
body .generate-quote-action {
    margin-top: 16px !important;
    text-align: center !important;
}

/* Mobile */
@media (max-width: 900px) {
    body .loadbuilder-top-row {
        grid-template-columns: 1fr !important;
    }
    
    body .truck-groups,
    body #truckGroups {
        grid-template-columns: 1fr !important;
    }
}

/* ==================== GLOBAL DARK THEME POLISH ==================== */

/* All buttons base */
body .btn {
    border-radius: 6px !important;
    font-weight: 500 !important;
    transition: all 0.15s !important;
}

body .btn-primary {
    background: #2f5d8f !important;
    border: none !important;
    color: white !important;
}

body .btn-primary:hover {
    background: #2f5d8f !important;
}

body .btn-secondary {
    background: rgba(100, 116, 139, 0.2) !important;
    border: 1px solid rgba(100, 116, 139, 0.3) !important;
    color: #1c2733 !important;
}

body .btn-secondary:hover {
    background: rgba(100, 116, 139, 0.3) !important;
    border-color: rgba(100, 116, 139, 0.5) !important;
}

body .btn-success {
    background: #15803d !important;
    border: none !important;
    color: white !important;
}

body .btn-success:hover {
    background: #15803d !important;
}

body .btn-outline {
    background: transparent !important;
    border: 1px solid rgba(100, 116, 139, 0.4) !important;
    color: #5b6875 !important;
}

body .btn-outline:hover {
    background: rgba(47,93,143, 0.1) !important;
    border-color: #2f5d8f !important;
    color: #2f5d8f !important;
}

body .btn-sm {
    padding: 6px 12px !important;
    font-size: 12px !important;
}

/* Hint text */
body .hint {
    color: #5b6875 !important;
    font-size: 12px !important;
}

/* Section titles */
body h2, body h3 {
    color: #1c2733 !important;
}

/* All selects */
body select {
    background: rgba(255,253,248, 0.8) !important;
    border: 1px solid rgba(100, 116, 139, 0.3) !important;
    color: #1c2733 !important;
    border-radius: 6px !important;
    padding: 8px 12px !important;
}

body select:focus {
    border-color: #2f5d8f !important;
    outline: none !important;
}

body select option {
    background: #fffdf8 !important;
    color: #1c2733 !important;
}

/* All text inputs */
body input[type=text],
body input[type=number],
body input[type=date],
body input[type=email],
body textarea {
    background: rgba(255,253,248, 0.8) !important;
    border: 1px solid rgba(100, 116, 139, 0.3) !important;
    color: #1c2733 !important;
    border-radius: 6px !important;
}

body input::placeholder {
    color: #5b6875 !important;
}

body input:focus,
body textarea:focus {
    border-color: #2f5d8f !important;
    outline: none !important;
    box-shadow: 0 0 0 2px rgba(47,93,143, 0.2) !important;
}

/* Tables general */
body table {
    color: #1c2733 !important;
}

body th {
    color: #5b6875 !important;
}

body td {
    color: #1c2733 !important;
}

/* Links */
body a {
    color: #2f5d8f !important;
}

body a:hover {
    color: #2f5d8f !important;
}

/* Scrollbar styling */
body ::-webkit-scrollbar {
    width: 8px !important;
    height: 8px !important;
}

body ::-webkit-scrollbar-track {
    background: rgba(255,253,248, 0.4) !important;
}

body ::-webkit-scrollbar-thumb {
    background: rgba(100, 116, 139, 0.4) !important;
    border-radius: 4px !important;
}

body ::-webkit-scrollbar-thumb:hover {
    background: rgba(100, 116, 139, 0.6) !important;
}

/* OCR status */
body .ocr-status {
    background: rgba(47,93,143, 0.1) !important;
    border: 1px solid rgba(47,93,143, 0.25) !important;
    border-radius: 6px !important;
    padding: 10px 14px !important;
    color: #5b6875 !important;
}

/* Loading spinner */
body .spinner-small,
body .loading-spinner {
    border-color: rgba(47,93,143, 0.2) !important;
    border-top-color: #2f5d8f !important;
}

/* Modals */
body .modal,
body .modal-content {
    background: #fffdf8 !important;
    border: 1px solid rgba(100, 116, 139, 0.3) !important;
    color: #1c2733 !important;
}

body .modal-header {
    border-bottom: 1px solid rgba(100, 116, 139, 0.2) !important;
}

body .modal-footer {
    border-top: 1px solid rgba(100, 116, 139, 0.2) !important;
}

/* Tooltips */
body [title]:hover::after {
    background: #fffdf8 !important;
    color: #1c2733 !important;
    border: 1px solid rgba(100, 116, 139, 0.3) !important;
}

/* Focus visible for accessibility */
body *:focus-visible {
    outline: 2px solid #2f5d8f !important;
    outline-offset: 2px !important;
}

/* Badge/tag styling */
body .badge,
body .tag {
    background: rgba(100, 116, 139, 0.2) !important;
    color: #5b6875 !important;
    border-radius: 4px !important;
    padding: 2px 8px !important;
    font-size: 11px !important;
}

/* Empty states */
body .empty-state {
    color: #5b6875 !important;
    text-align: center !important;
    padding: 24px !important;
}

/* Dividers */
body hr {
    border: none !important;
    border-top: 1px solid rgba(100, 116, 139, 0.2) !important;
}

/* ==================== DIMS CONVERTER COMPACT LAYOUT ==================== */

/* Dims lane inputs - show inline above cards */
body #dims .lane-section-compact.dims-lane {
    margin: 8px 0 12px 0 !important;
    padding: 8px 12px !important;
    background: rgba(255,253,248, 0.4) !important;
    border: 1px solid rgba(100, 116, 139, 0.2) !important;
    border-radius: 6px !important;
}

/* Dims cards row - tighter spacing */
body .dims-cards-row {
    gap: 12px !important;
    margin-top: 12px !important;
}

/* Smaller input fields */
body .dims-card {
    padding: 12px !important;
}

body .dims-input-table input {
    padding: 4px 6px !important;
    font-size: 12px !important;
    min-width: 40px !important;
}

body .dims-input-table th {
    padding: 4px 6px !important;
    font-size: 10px !important;
}

body .dims-input-table td {
    padding: 3px 4px !important;
}

/* Compact card headers */
body .dims-card-header {
    margin-bottom: 8px !important;
    padding-bottom: 8px !important;
}

body .dims-card-header h4 {
    font-size: 13px !important;
}

/* Upload section - hidden, replaced by dims-toolbar */
body .upload-section-compact {
    display: none !important;
}

/* Flashing extract button */
@keyframes pulse-extract {
    0%, 100% { 
        box-shadow: 0 0 0 0 rgba(47,93,143, 0.7);
    }
    50% { 
        box-shadow: 0 0 0 8px rgba(47,93,143, 0);
    }
}

body #extractBtn.extracting,
body .btn.extracting {
    animation: pulse-extract 1.5s infinite !important;
    background: linear-gradient(135deg, #2f5d8f 0%, #2f5d8f 100%) !important;
}

/* OCR status while extracting */
body .ocr-status.loading {
    background: rgba(47,93,143, 0.15) !important;
    border: 1px solid rgba(47,93,143, 0.4) !important;
    color: #2f5d8f !important;
    animation: pulse-extract 1.5s infinite !important;
}

/* Reorder dims page layout */
body #dims.active, body #dims[style*="display: block"] {
    display: flex;
    flex-direction: column !important;
}

body #dims.tab-content > .dims-cards-row {
    order: 1 !important;
}

body #dims.tab-content > .dims-toolbar {
    order: 2 !important;
}

body #dims .ocr-preview {
    order: 3 !important;
}

body #dims .oversize-cta,
body #dims .maybe-oversize-warning {
    order: 4 !important;
}

/* ==================== QUOTE BUILDER CARD ==================== */

body .rates-card.quote-builder {
    background: rgba(21,128,61, 0.08) !important;
    border: 1px solid rgba(21,128,61, 0.25) !important;
    border-left: 4px solid #15803d !important;
    display: block !important;
}

body .rates-card.quote-builder .rates-header {
    display: flex;
    justify-content: space-between !important;
    align-items: center !important;
}

body .rates-card.quote-builder .rates-header h4 {
    color: #15803d !important;
}

body .quote-builder-inputs {
    margin-bottom: 10px !important;
}

body .quote-input-row {
    display: flex;
    justify-content: space-between !important;
    align-items: center !important;
    margin-bottom: 8px !important;
}

body .quote-input-row label {
    color: #5b6875 !important;
    font-size: 13px !important;
}

body .quote-input-row input {
    width: 80px !important;
    padding: 6px 8px !important;
    font-size: 14px !important;
    text-align: right !important;
}

body .input-with-unit {
    display: flex;
    align-items: center !important;
    gap: 4px !important;
}

body .unit-prefix,
body .unit-suffix {
    color: #5b6875 !important;
    font-size: 14px !important;
}

/* Accessorials section */
body .accessorials-section {
    background: rgba(255,253,248, 0.4) !important;
    border: 1px solid rgba(100, 116, 139, 0.2) !important;
    border-radius: 6px !important;
    padding: 10px !important;
    margin: 10px 0 !important;
}

body .accessorial-row {
    display: flex;
    justify-content: space-between !important;
    align-items: center !important;
    margin-bottom: 6px !important;
}

body .accessorial-row:last-child {
    margin-bottom: 0 !important;
}

body .accessorial-row label {
    color: #5b6875 !important;
    font-size: 11px !important;
}

body .accessorial-row input {
    width: 70px !important;
    padding: 4px 6px !important;
    font-size: 12px !important;
    text-align: right !important;
}

body .fsc-row {
    display: flex;
    align-items: center !important;
    gap: 6px !important;
}

body .fsc-auto {
    font-size: 10px !important;
    color: #5b6875 !important;
    background: rgba(47,93,143, 0.1) !important;
    padding: 2px 6px !important;
    border-radius: 4px !important;
}

body .btn-xs {
    padding: 2px 6px !important;
    font-size: 10px !important;
}

/* Quote result */
body .quote-result {
    padding-top: 8px !important;
}

body .quote-line {
    display: flex;
    justify-content: space-between !important;
    padding: 4px 0 !important;
    font-size: 12px !important;
    color: #5b6875 !important;
}

body .quote-divider {
    height: 1px !important;
    background: rgba(100, 116, 139, 0.2) !important;
    margin: 8px 0 !important;
}

body .quote-line.quote-total {
    font-size: 16px !important;
    font-weight: 700 !important;
}

body .quote-line.quote-total span:first-child {
    color: #15803d !important;
}

body .quote-line.quote-total span:last-child {
    color: #15803d !important;
}

body .quote-line.quote-rpm {
    font-size: 11px !important;
    color: #5b6875 !important;
}

/* Toggle accessorials button */
body #toggleAccessorials {
    font-size: 11px !important;
    color: #5b6875 !important;
}

body #toggleAccessorials:hover {
    color: #15803d !important;
}

/* Convert Button - prominent action */
body #convertBtn {
    background: linear-gradient(135deg, #2f5d8f 0%, #2f5d8f 100%) !important;
    color: white !important;
    padding: 8px 20px !important;
    font-weight: 600 !important;
    border: none !important;
    border-radius: 6px !important;
    box-shadow: 0 2px 8px rgba(47,93,143, 0.4) !important;
    transition: all 0.2s ease !important;
}
body #convertBtn:hover {
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(47,93,143, 0.5) !important;
}

/* =============================================
   CRISP UI FIXES - CLEAN VERSION
   ============================================= */

/* === TAB VISIBILITY === */
.tab-content {
    display: none !important;
}
.tab-content.active {
    display: block !important;
}

/* === DIMS TAB SPECIFIC === */
#dims.tab-content.active {
    display: flex;
    flex-direction: column !important;
}

/* === INFO CARDS (State Regs) === */
.info-card {
    background: #fffdf8 !important;
    border: 1px solid rgba(100, 116, 139, 0.2) !important;
    border-left: 3px solid #2f5d8f !important;
    border-radius: 8px !important;
    padding: 20px !important;
}
.info-card:nth-child(1) h3 { color: #b45309 !important; }
.info-card:nth-child(2) h3 { color: #15803d !important; }
.info-card:nth-child(3) h3 { color: #b91c1c !important; }
.info-card:nth-child(4) h3 { color: #2f5d8f !important; }
.info-row {
    display: flex;
    justify-content: space-between !important;
    padding: 8px 0 !important;
    border-bottom: none !important;
}
.info-label { color: #5b6875 !important; }
.info-value { color: #1c2733 !important; font-weight: 500 !important; }

/* === DIMS EXTRACT AREA (replaced by dims-toolbar) === */
#dims .upload-section-compact {
    display: none !important;
    gap: 30px !important;
    padding: 24px !important;
    background: rgba(255,253,248, 0.3) !important;
    border-radius: 12px !important;
    margin-bottom: 20px !important;
}

/* Lane inputs inside upload section */
#dims .upload-section-compact .lane-inputs-compact {
    display: flex;
    align-items: center !important;
    gap: 6px !important;
    width: 100% !important;
    padding: 6px 0 0 0 !important;
    margin-top: 0 !important;
    border-top: 1px solid rgba(100, 116, 139, 0.15) !important;
    padding-top: 10px !important;
}
#dims .upload-section-compact .lane-inputs-compact input {
    flex: 1 !important;
    padding: 5px 8px !important;
    font-size: 13px !important;
    background: rgba(255,253,248, 0.6) !important;
    border: 1px solid rgba(100, 116, 139, 0.3) !important;
    border-radius: 4px !important;
    color: #1c2733 !important;
    min-width: 100px !important;
}
#dims .upload-section-compact .lane-inputs-compact .lane-arrow {
    color: #5b6875 !important;
    flex-shrink: 0 !important;
}
#dims .upload-section-compact .lane-validation {
    font-size: 11px !important;
}

/* Hide old standalone dims-lane section (now inside upload) */
body #dims .lane-section-compact.dims-lane {
    display: none !important;
}
#dims .upload-section-compact.has-image .paste-target-compact {
    display: none !important;
}
#dims .upload-preview-compact {
    display: flex;
    align-items: center !important;
    gap: 24px !important;
}
#dims .image-preview-small {
    max-width: 250px !important;
    max-height: 200px !important;
    border-radius: 8px !important;
}
#dims .preview-actions {
    display: flex;
    flex-direction: column !important;
    gap: 10px !important;
}
#dims #extractBtn {
    padding: 14px 32px !important;
    background: linear-gradient(135deg, #2f5d8f, #2f5d8f) !important;
    border: none !important;
    border-radius: 10px !important;
    color: white !important;
    font-weight: 600 !important;
}
#dims .ocr-status-inline {
    padding: 12px 24px !important;
    background: rgba(21,128,61, 0.15) !important;
    border: 1px solid rgba(21,128,61, 0.3) !important;
    border-radius: 8px !important;
    color: #15803d !important;
}

/* ==============================================
   DIMS CONVERTER - UNIFIED DESIGN (replaces all prior dims table CSS)
   Both cards and both tables share identical visual rules
   ============================================== */

/* --- CARD CONTAINERS: identical styling --- */
#dims .dims-card.input-card,
#dims .dims-card.results-card {
    background: #fffdf8 !important;
    border: 1px solid rgba(100, 116, 139, 0.25) !important;
    border-left: 3px solid #2f5d8f !important;
    border-radius: 8px !important;
    padding: 14px !important;
    overflow: visible !important;
    max-height: none !important;
}

/* Card headers: identical */
#dims .dims-card-header {
    margin-bottom: 10px !important;
    padding-bottom: 8px !important;
    border-bottom: 1px solid rgba(100, 116, 139, 0.15) !important;
}
#dims .dims-card-header h4 {
    font-size: 13px !important;
    font-weight: 600 !important;
    color: #1c2733 !important;
    margin: 0 !important;
}
/* Remove green color from results header - match input */
#dims .results-card .dims-card-header h4 {
    color: #1c2733 !important;
}

/* --- TABLE CONTAINERS --- */
#dims .dims-input-table,
#dims .dims-output-table {
    width: 100% !important;
    overflow-x: auto !important;
}

/* --- TABLE ELEMENT --- */
#dims #inputTable,
#dims #outputTable {
    width: 100% !important;
    border-collapse: separate !important;
    border-spacing: 2px 2px !important;
    table-layout: fixed !important;
}

/* --- COLUMN WIDTHS: input table --- */
/* Cols: desc | L | W | H | weight | unit-select | delete */
#dims #inputTable th:nth-child(1),
#dims #inputTable td:nth-child(1) { width: 48px !important; }  /* desc */
#dims #inputTable th:nth-child(2),
#dims #inputTable td:nth-child(2) { width: auto !important; }  /* L */
#dims #inputTable th:nth-child(3),
#dims #inputTable td:nth-child(3) { width: auto !important; }  /* W */
#dims #inputTable th:nth-child(4),
#dims #inputTable td:nth-child(4) { width: auto !important; }  /* H */
#dims #inputTable th:nth-child(5),
#dims #inputTable td:nth-child(5) { width: 60px !important; }  /* weight */
#dims #inputTable th:nth-child(6),
#dims #inputTable td:nth-child(6) { width: 36px !important; }  /* unit select */
#dims #inputTable th:nth-child(7),
#dims #inputTable td:nth-child(7) { width: 28px !important; }  /* delete */

/* --- COLUMN WIDTHS: output table --- */
/* Cols: checkbox | desc | L | W | H | wt | stackable */
#dims #outputTable th:nth-child(1),
#dims #outputTable td:nth-child(1) { width: 28px !important; }   /* checkbox */
#dims #outputTable th:nth-child(2),
#dims #outputTable td:nth-child(2) { width: 36px !important; }   /* desc */
#dims #outputTable th:nth-child(3),
#dims #outputTable td:nth-child(3) { width: auto !important; }   /* L */
#dims #outputTable th:nth-child(4),
#dims #outputTable td:nth-child(4) { width: auto !important; }   /* W */
#dims #outputTable th:nth-child(5),
#dims #outputTable td:nth-child(5) { width: auto !important; }   /* H */
#dims #outputTable th:nth-child(6),
#dims #outputTable td:nth-child(6) { width: 72px !important; }   /* wt */
#dims #outputTable th:nth-child(7),
#dims #outputTable td:nth-child(7) { width: 28px !important; }   /* stackable */

/* --- HEADER CELLS: identical for both --- */
#dims #inputTable th,
#dims #outputTable th {
    padding: 4px 3px !important;
    font-size: 10px !important;
    font-weight: 500 !important;
    color: #5b6875 !important;
    text-transform: uppercase !important;
    text-align: center !important;
    background: transparent !important;
    line-height: 1.2 !important;
    border: none !important;
    white-space: nowrap !important;
    overflow: hidden !important;
}

/* --- DATA CELLS: identical for both --- */
#dims #inputTable td,
#dims #outputTable td {
    background: rgba(255,253,248, 0.6) !important;
    border: 1px solid rgba(100, 116, 139, 0.25) !important;
    border-radius: 4px !important;
    padding: 3px 4px !important;
    font-size: 12px !important;
    font-family: 'SF Mono', Monaco, 'Courier New', monospace !important;
    line-height: 20px !important;
    height: 26px !important;
    color: #1c2733 !important;
    text-align: center !important;
    vertical-align: middle !important;
    white-space: nowrap !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    font-weight: 400 !important;
}

/* --- INPUT FIELDS inside input table: invisible, inherit cell look --- */
#dims #inputTable input,
#dims #inputTable select {
    background: transparent !important;
    border: none !important;
    color: #1c2733 !important;
    font-size: 12px !important;
    font-family: 'SF Mono', Monaco, 'Courier New', monospace !important;
    line-height: 20px !important;
    height: 20px !important;
    text-align: center !important;
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    box-sizing: border-box !important;
    outline: none !important;
    -webkit-appearance: none !important;
    appearance: none !important;
}
#dims #inputTable select {
    height: 20px !important;
}
#dims #inputTable input:focus {
    outline: none !important;
}

/* --- dim-ft-in containers: seamless inside cells --- */
#dims .dim-ft-in {
    display: flex;
    align-items: center !important;
    justify-content: center !important;
    gap: 1px !important;
    height: 20px !important;
    width: 100% !important;
}
#dims .dim-ft-in input {
    width: 28px !important;
    min-width: 20px !important;
    flex: 1 !important;
    padding: 0 !important;
    text-align: center !important;
}
#dims .dim-ft-in .dim-label {
    font-size: 10px !important;
    color: #5b6875 !important;
    flex-shrink: 0 !important;
    line-height: 20px !important;
}

/* --- Hide number spinners --- */
#dims input[type="number"]::-webkit-inner-spin-button,
#dims input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none !important;
    margin: 0 !important;
}
#dims input[type="number"] {
    -moz-appearance: textfield !important;
}

/* --- ROW BACKGROUNDS: transparent, no zebra, no selection highlight --- */
#dims #inputTable tbody tr,
#dims #outputTable tbody tr,
#dims #outputTable tbody tr:nth-child(odd),
#dims #outputTable tbody tr:nth-child(even),
#dims #outputTable tbody tr.selected,
#dims #outputTable tbody tr:not(.selected) {
    background: transparent !important;
    height: auto !important;
    opacity: 1 !important;
}
/* Deselected output rows: dim slightly */
#dims #outputTable tbody tr:not(.selected) {
    opacity: 0.5 !important;
}

/* --- CHECKBOX & STACKABLE cols: no cell bg/border --- */
#dims #outputTable th:nth-child(1),
#dims #outputTable td:nth-child(1),
#dims #outputTable th:nth-child(7),
#dims #outputTable td:nth-child(7) {
    background: transparent !important;
    border: none !important;
    padding: 2px !important;
    font-family: inherit !important;
}
#dims #outputTable input[type="checkbox"] {
    width: 14px !important;
    height: 14px !important;
    margin: 0 !important;
    padding: 0 !important;
    vertical-align: middle !important;
    accent-color: #2f5d8f !important;
    cursor: pointer !important;
}

/* --- DELETE BUTTON col: no cell bg/border --- */
#dims #inputTable th:nth-child(7),
#dims #inputTable td:nth-child(7) {
    background: transparent !important;
    border: none !important;
    padding: 2px !important;
    width: 28px !important;
    font-family: inherit !important;
}
#dims #inputTable .delete-btn {
    background: none !important;
    border: none !important;
    cursor: pointer !important;
    font-size: 14px !important;
    opacity: 0.5 !important;
    padding: 0 !important;
}
#dims #inputTable .delete-btn:hover {
    opacity: 1 !important;
}

/* --- UNIT SELECT col: no cell bg/border --- */
#dims #inputTable th:nth-child(6),
#dims #inputTable td:nth-child(6) {
    background: transparent !important;
    border: none !important;
    padding: 2px !important;
    font-family: inherit !important;
}
#dims #inputTable .row-weight-unit,
#dims #inputTable .row-length-unit,
#dims #inputTable .row-dim-unit {
    font-size: 10px !important;
    color: #5b6875 !important;
    background: transparent !important;
    border: none !important;
    text-align: center !important;
    cursor: pointer !important;
    height: 20px !important;
}

/* --- OD VALUES: red highlight --- */
#dims #outputTable td.od-value {
    background: rgba(185,28,28, 0.15) !important;
    border: 1px solid rgba(185,28,28, 0.4) !important;
    color: #b91c1c !important;
    font-weight: 600 !important;
}

/* --- Override old output table CSS (from ~line 930) --- */
#outputTable td {
    font-weight: 400 !important;
}
#outputTable td:nth-child(2),
#outputTable td:nth-child(3),
#outputTable td:nth-child(4),
#outputTable td:nth-child(5),
#outputTable td:nth-child(6) {
    font-family: inherit !important;
    color: inherit !important;
}
#outputTable tbody tr.selected {
    background-color: transparent !important;
}

/* --- INPUT CARD ACTIONS --- */
#dims .input-card-actions {
    display: flex;
    align-items: center !important;
    gap: 10px !important;
    padding-top: 12px !important;
    margin-top: 8px !important;
    border-top: 1px solid rgba(100, 116, 139, 0.15) !important;
}
#dims .input-card-actions .unit-select,
#dims #weightUnit,
#dims #defaultLengthUnit {
    display: none !important;
}
#dims #convertBtn {
    padding: 8px 20px !important;
    background: linear-gradient(135deg, #2f5d8f, #2f5d8f) !important;
    border: none !important;
    border-radius: 6px !important;
    color: white !important;
    font-size: 13px !important;
    cursor: pointer !important;
}
#dims #addRowBtn {
    font-size: 12px !important;
}

/* --- FORMAT SELECT (output card header) --- */
#dims .format-select {
    padding: 4px 8px !important;
    background: rgba(255,253,248, 0.6) !important;
    border: 1px solid rgba(100, 116, 139, 0.3) !important;
    border-radius: 4px !important;
    color: #1c2733 !important;
    font-size: 12px !important;
}

/* --- PLACEHOLDER --- */
#dims .dims-results-placeholder { 
    display: flex;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 60px 20px !important;
    color: #5b6875 !important;
}
#dims #outputSection[style*="block"] ~ .dims-results-placeholder,
#dims .dims-output-table:not(:empty) ~ .dims-results-placeholder {
    display: none !important;
}
#dims #outputSection:not([style*="none"]) ~ #resultsPlaceholder,
#dims #outputSection[style*="block"] ~ #resultsPlaceholder {
    display: none !important;
}

/* --- RESULTS ACTION BUTTONS --- */
#dims .results-card-actions {
    display: flex;
    flex-wrap: wrap !important;
    gap: 8px !important;
    padding-top: 12px !important;
    margin-top: 8px !important;
    border-top: 1px solid rgba(100, 116, 139, 0.15) !important;
}
#dims .results-card-actions .btn {
    padding: 8px 16px !important;
    font-size: 13px !important;
    border-radius: 6px !important;
    cursor: pointer !important;
}
#dims .results-card-actions .btn-primary {
    background: linear-gradient(135deg, #2f5d8f, #2f5d8f) !important;
    border: none !important;
    color: white !important;
}
#dims .results-card-actions .btn-secondary {
    background: rgba(100, 116, 139, 0.2) !important;
    border: 1px solid rgba(100, 116, 139, 0.3) !important;
    color: #5b6875 !important;
}
#dims .results-card-actions .btn-secondary:hover {
    background: rgba(100, 116, 139, 0.3) !important;
    color: #1c2733 !important;
}


/* =============================================
   DIMS TOOLBAR (Lane + Upload in one compact row)
   ============================================= */
#dims .dims-toolbar {
    display: flex;
    align-items: center !important;
    gap: 8px !important;
    padding: 8px 12px !important;
    margin-top: 8px !important;
    background: rgba(255,253,248, 0.4) !important;
    border: 1px solid rgba(100, 116, 139, 0.2) !important;
    border-radius: 6px !important;
    flex-wrap: wrap !important;
}
#dims .dims-toolbar-lane {
    display: flex;
    align-items: center !important;
    gap: 6px !important;
    flex: 1 !important;
    min-width: 0 !important;
}
#dims .dims-toolbar-lane input {
    flex: 1 !important;
    padding: 5px 8px !important;
    font-size: 13px !important;
    background: rgba(255,253,248, 0.6) !important;
    border: 1px solid rgba(100, 116, 139, 0.3) !important;
    border-radius: 4px !important;
    color: #1c2733 !important;
    min-width: 80px !important;
}
#dims .dims-toolbar-lane input.commodity-input {
    max-width: 120px !important;
}
#dims .dims-toolbar-lane input:focus {
    border-color: #2f5d8f !important;
    outline: none !important;
}
#dims .dims-toolbar-lane .lane-arrow {
    color: #5b6875 !important;
    font-size: 14px !important;
    flex-shrink: 0 !important;
}
#dims .dims-toolbar-upload {
    display: flex;
    align-items: center !important;
    gap: 6px !important;
    flex-shrink: 0 !important;
}
#dims .paste-target-mini {
    display: flex;
    align-items: center !important;
    gap: 4px !important;
    padding: 5px 10px !important;
    background: rgba(47,93,143, 0.1) !important;
    border: 1px dashed rgba(47,93,143, 0.4) !important;
    border-radius: 4px !important;
    cursor: pointer !important;
    font-size: 12px !important;
    color: #5b6875 !important;
    white-space: nowrap !important;
    transition: border-color 0.2s !important;
}
#dims .paste-target-mini:hover,
#dims .paste-target-mini:focus {
    border-color: #2f5d8f !important;
    background: rgba(47,93,143, 0.15) !important;
    color: #1c2733 !important;
}
#dims .paste-target-mini .paste-icon {
    font-size: 14px !important;
}
#dims .paste-target-mini .paste-text {
    font-size: 12px !important;
}
#dims .dims-toolbar .lane-validation {
    display: none !important;
}
#dims .dims-toolbar .upload-preview-compact {
    display: flex;
    align-items: center !important;
    gap: 4px !important;
}
#dims .dims-toolbar .image-preview-small {
    max-height: 40px !important;
    border-radius: 4px !important;
    border: 1px solid rgba(100, 116, 139, 0.3) !important;
}

/* =============================================
   LOAD BUILDER - DARK THEME STYLING
   ============================================= */

/* Main section */
#loadbuild {
    padding: 16px !important;
}

#loadbuild h2 {
    color: #1c2733 !important;
    font-size: 1.3rem !important;
    margin-bottom: 8px !important;
}

#loadbuild > p {
    color: #5b6875 !important;
    font-size: 13px !important;
    margin-bottom: 12px !important;
}

/* Warning banner - dark style */
#loadbuild .loadbuilder-warning {
    background: rgba(180,83,9, 0.1) !important;
    border: 1px solid rgba(180,83,9, 0.3) !important;
    border-left: 3px solid #b45309 !important;
    border-radius: 6px !important;
    padding: 10px 14px !important;
    margin-bottom: 16px !important;
    font-size: 13px !important;
    color: #b45309 !important;
}

#loadbuild .loadbuilder-warning strong {
    color: #b45309 !important;
}

/* Unassigned Pieces Pool */
#loadbuild .loadbuilder-pool {
    background: #fffdf8 !important;
    border: 1px solid rgba(100, 116, 139, 0.2) !important;
    border-left: 3px solid #2f5d8f !important;
    border-radius: 8px !important;
    padding: 12px !important;
    margin-bottom: 16px !important;
}

#loadbuild .loadbuilder-pool h3 {
    color: #2f5d8f !important;
    font-size: 14px !important;
    margin-bottom: 8px !important;
}

#loadbuild .loadbuilder-pool .hint {
    color: #5b6875 !important;
    font-size: 12px !important;
}

#loadbuild .pool-header {
    display: flex;
    align-items: center !important;
    justify-content: space-between !important;
    margin-bottom: 4px !important;
}
#loadbuild .pool-header h3 {
    margin: 0 !important;
}
#loadbuild .piece-pool {
    background: rgba(28,39,51, 0.6) !important;
    border: 1px dashed rgba(100, 116, 139, 0.25) !important;
    border-radius: 6px !important;
    min-height: 40px !important;
    max-height: 200px !important;
    overflow-y: auto !important;
    padding: 6px !important;
    display: flex;
    flex-wrap: wrap !important;
    gap: 4px !important;
}

#loadbuild .piece-pool .empty-state {
    color: #5b6875 !important;
    font-size: 13px !important;
}

/* Piece Cards - DARK & compact */
#loadbuild .piece-card,
#loadbuild .draggable-piece {
    background: rgba(28,39,51, 0.9) !important;
    border: 1px solid rgba(100, 116, 139, 0.25) !important;
    border-radius: 5px !important;
    padding: 4px 8px !important;
    cursor: grab !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    font-size: 11px !important;
    color: #1c2733 !important;
    transition: all 0.15s !important;
}

#loadbuild .piece-card:hover {
    background: rgba(47,93,143, 0.15) !important;
    border-color: rgba(47,93,143, 0.4) !important;
}

#loadbuild .piece-card.dragging {
    opacity: 0.5 !important;
}

#loadbuild .piece-card .piece-name {
    background: #2f5d8f !important;
    color: white !important;
    padding: 2px 6px !important;
    border-radius: 4px !important;
    font-weight: 600 !important;
    font-size: 11px !important;
}

#loadbuild .piece-card .piece-dims {
    color: #5b6875 !important;
    font-size: 11px !important;
}

#loadbuild .piece-card .piece-weight {
    color: #5b6875 !important;
    font-size: 11px !important;
}

/* OD badges */
#loadbuild .piece-card .od-badge {
    background: rgba(185,28,28, 0.2) !important;
    color: #b91c1c !important;
    padding: 1px 4px !important;
    border-radius: 3px !important;
    font-size: 10px !important;
    font-weight: 600 !important;
}

/* =============================================
   TRUCKS SECTION - HORIZONTAL LAYOUT
   ============================================= */

#loadbuild .loadbuilder-trucks {
    background: #fffdf8 !important;
    border: 1px solid rgba(100, 116, 139, 0.2) !important;
    border-left: 3px solid #15803d !important;
    border-radius: 8px !important;
    padding: 12px !important;
}

#loadbuild .loadbuilder-trucks h3 {
    color: #15803d !important;
    font-size: 14px !important;
    margin-bottom: 10px !important;
    display: flex;
    justify-content: space-between !important;
    align-items: center !important;
}

/* Trucks container - HORIZONTAL grid */
#loadbuild .trucks-container,
#loadbuild #trucksContainer {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)) !important;
    gap: 12px !important;
}

/* Individual Truck Card - DARK */
#loadbuild .truck-card {
    background: rgba(255,253,248, 0.6) !important;
    border: 1px solid rgba(100, 116, 139, 0.3) !important;
    border-radius: 8px !important;
    overflow: hidden !important;
}

#loadbuild .truck-card .truck-header {
    background: rgba(21,128,61, 0.15) !important;
    padding: 8px 12px !important;
    display: flex;
    justify-content: space-between !important;
    align-items: center !important;
    border-bottom: 1px solid rgba(100, 116, 139, 0.2) !important;
}

#loadbuild .truck-card .truck-header span {
    color: #15803d !important;
    font-weight: 600 !important;
    font-size: 13px !important;
}

#loadbuild .truck-card .truck-header button {
    background: transparent !important;
    border: none !important;
    color: #b91c1c !important;
    cursor: pointer !important;
    font-size: 16px !important;
}

/* Truck drop zone - DARK */
#loadbuild .truck-card .truck-pieces,
#loadbuild .truck-card .piece-drop-zone {
    background: rgba(255,253,248, 0.5) !important;
    min-height: 50px !important;
    padding: 8px !important;
    display: flex;
    flex-wrap: wrap !important;
    gap: 4px !important;
    border: 1px dashed rgba(100, 116, 139, 0.2) !important;
    margin: 8px !important;
    border-radius: 4px !important;
}

#loadbuild .truck-card .truck-pieces .empty-hint {
    color: #5b6875 !important;
    font-size: 12px !important;
    width: 100% !important;
    text-align: center !important;
}

/* Truck stats */
#loadbuild .truck-card .truck-stats {
    padding: 8px 12px !important;
    font-size: 12px !important;
    color: #5b6875 !important;
    display: flex;
    gap: 16px !important;
    flex-wrap: wrap !important;
}

#loadbuild .truck-card .truck-stats strong {
    color: #1c2733 !important;
}

/* Trailer select */
#loadbuild .truck-card select {
    background: rgba(255,253,248, 0.8) !important;
    border: 1px solid rgba(100, 116, 139, 0.3) !important;
    border-radius: 4px !important;
    padding: 6px 10px !important;
    color: #1c2733 !important;
    font-size: 12px !important;
    margin: 0 8px 8px 8px !important;
    width: calc(100% - 16px) !important;
}

#loadbuild .truck-card .recommended {
    color: #15803d !important;
    font-size: 11px !important;
}

/* Add Truck button */
#loadbuild .add-truck-btn,
#loadbuild [id*="addTruck"] {
    background: rgba(21,128,61, 0.15) !important;
    border: 1px dashed rgba(21,128,61, 0.4) !important;
    border-radius: 6px !important;
    padding: 8px 16px !important;
    color: #15803d !important;
    cursor: pointer !important;
    font-size: 13px !important;
}

#loadbuild .add-truck-btn:hover {
    background: rgba(21,128,61, 0.25) !important;
}

/* AI Auto-Build button */
#loadbuild .ai-build-btn {
    background: linear-gradient(135deg, #2f5d8f, #2f5d8f) !important;
    border: none !important;
    border-radius: 6px !important;
    padding: 8px 16px !important;
    color: white !important;
    cursor: pointer !important;
    font-size: 13px !important;
    font-weight: 500 !important;
}

#loadbuild .ai-build-btn:hover {
    background: linear-gradient(135deg, #2f5d8f, #2f5d8f) !important;
}

/* Fix truck groups container */
#loadbuild #truckGroups,
#loadbuild .truck-groups {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)) !important;
    gap: 12px !important;
    margin-top: 12px !important;
}

/* Trucks header with buttons */
#loadbuild .trucks-header {
    display: flex;
    justify-content: space-between !important;
    align-items: center !important;
    margin-bottom: 8px !important;
}

#loadbuild .trucks-header h3 {
    margin: 0 !important;
    color: #15803d !important;
}

#loadbuild .trucks-header .btn {
    margin-left: 8px !important;
}

/* Compact layout for trucks */
#loadbuild .truck-group {
    background: rgba(255,253,248, 0.6) !important;
    border: 1px solid rgba(100, 116, 139, 0.3) !important;
    border-radius: 8px !important;
    overflow: hidden !important;
}

#loadbuild .truck-group-header {
    background: rgba(21,128,61, 0.15) !important;
    padding: 8px 12px !important;
    display: flex;
    justify-content: space-between !important;
    align-items: center !important;
    border-bottom: 1px solid rgba(100, 116, 139, 0.2) !important;
}

#loadbuild .truck-group-header .truck-name {
    color: #15803d !important;
    font-weight: 600 !important;
    font-size: 13px !important;
}

#loadbuild .truck-group-pieces {
    min-height: 40px !important;
    padding: 8px !important;
    background: rgba(255,253,248, 0.5) !important;
}

#loadbuild .truck-group-stats {
    padding: 8px 12px !important;
    font-size: 11px !important;
    color: #5b6875 !important;
    background: rgba(255,253,248, 0.4) !important;
}

/* Action buttons at bottom */
#loadbuild .trucks-permit-action,
#loadbuild .export-plan-action,
#loadbuild .generate-quote-action {
    margin-top: 12px !important;
    padding-top: 12px !important;
    border-top: 1px solid rgba(100, 116, 139, 0.2) !important;
}

/* Dark theme for truck visualizations */
.truck-viz {
    background: #fffdf8 !important;
    border-top: 1px dashed rgba(100, 116, 139, 0.3) !important;
}

.viz-trailer {
    background: linear-gradient(to bottom, #edeae2 0%, #fffdf8 100%) !important;
    border: 2px solid #d8d2c4 !important;
}

.viz-label-front, .viz-label-rear {
    color: #5b6875 !important;
}

.trailer-viz {
    background: #fffdf8 !important;
    border: 2px solid #d8d2c4 !important;
}

.trailer-front, .trailer-rear {
    color: #5b6875 !important;
}

/* OD/Legal badges for truck headers */
.truck-od-badge {
    background: rgba(185,28,28, 0.2);
    color: #b91c1c;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    margin-left: 8px;
}

.truck-legal-badge {
    background: rgba(21,128,61, 0.2);
    color: #15803d;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    margin-left: 8px;
}

/* AI Build preview panel */
.ai-build-preview {
    background: rgba(47,93,143, 0.1);
    border: 1px solid rgba(47,93,143, 0.3);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
    display: none;
}

.ai-build-preview.active {
    display: block;
}

.ai-build-summary {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.ai-build-stat {
    background: rgba(255,253,248, 0.6);
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
}

.ai-build-stat .count {
    font-weight: 700;
    color: #2f5d8f;
    font-size: 18px;
}

.ai-build-stat .label {
    color: #5b6875;
    font-size: 12px;
}

.ai-build-actions {
    display: flex;
    gap: 12px;
}

/* Improved AI Build Preview */
.ai-build-preview {
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    padding: 8px 0 0 !important;
    margin-bottom: 0 !important;
    text-align: center !important;
}

.ai-build-preview .ai-build-summary {
    justify-content: center !important;
    gap: 24px !important;
}

.ai-build-preview .ai-build-stat {
    background: rgba(255,253,248, 0.8) !important;
    border: 1px solid rgba(100, 116, 139, 0.3) !important;
    padding: 12px 20px !important;
    border-radius: 8px !important;
    min-width: 120px !important;
}

.ai-build-preview .ai-build-actions {
    justify-content: center !important;
    margin-top: 16px !important;
}

/* Truck Navigation for Permits Page */
.truck-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    padding: 12px 20px;
    background: linear-gradient(135deg, rgba(47,93,143, 0.15), rgba(37, 99, 235, 0.1));
    border: 1px solid rgba(47,93,143, 0.3);
    border-radius: 8px;
    margin-bottom: 16px;
}
.truck-nav-label {
    font-size: 16px;
    color: #1c2733;
}
.truck-nav button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Overall Dims Display for Permits */
.permit-overall-dims {
    background: rgba(255,253,248, 0.8);
    border: 1px solid rgba(100, 116, 139, 0.4);
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
}
.permit-overall-dims .dim-item {
    text-align: center;
}
.permit-overall-dims .dim-label {
    font-size: 11px;
    color: #5b6875;
    text-transform: uppercase;
}
.permit-overall-dims .dim-value {
    font-size: 18px;
    font-weight: 600;
    color: #1c2733;
}
.permit-overall-dims .dim-value.warning {
    color: #b91c1c;
}

/* Two-Card Permit Results Layout */
.permit-results-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}
@media (max-width: 900px) {
    .permit-results-grid {
        grid-template-columns: 1fr;
    }
}
.permit-card {
    background: rgba(255,253,248, 0.6);
    border: 1px solid rgba(100, 116, 139, 0.3);
    border-radius: 8px;
    padding: 16px;
}
.permit-card h4 {
    margin: 0 0 12px 0;
    color: #2f5d8f;
    font-size: 14px;
}
.state-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid rgba(100, 116, 139, 0.2);
    font-size: 13px;
}
.state-row:last-child {
    border-bottom: none;
}
.state-name {
    color: #1c2733;
    font-weight: 500;
}
.state-cost {
    color: #15803d;
}
.cost-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 14px;
}
.cost-label {
    color: #5b6875;
}
.cost-value {
    color: #1c2733;
    font-weight: 500;
}
.cost-row.total {
    border-top: 2px solid rgba(47,93,143, 0.5);
    margin-top: 8px;
    padding-top: 12px;
}
.cost-row.total .cost-label,
.cost-row.total .cost-value {
    color: #2f5d8f;
    font-weight: 700;
    font-size: 16px;
}

/* Travel Restrictions Compact */
.travel-restrictions-compact {
    background: rgba(180,83,9, 0.1);
    border: 1px solid rgba(180,83,9, 0.3);
    border-radius: 6px;
    padding: 10px 14px;
    font-size: 12px;
    margin-top: 12px;
}
.travel-restrictions-compact h5 {
    margin: 0 0 6px 0;
    color: #b45309;
    font-size: 12px;
}
.travel-restrictions-compact p {
    margin: 0;
    color: #b45309;
    line-height: 1.4;
}

/* More compact cost summary */
body .cost-summary {
    padding: 14px !important;
    margin-bottom: 12px !important;
}
body .cost-summary h3 {
    font-size: 14px !important;
    margin-bottom: 10px !important;
}
body .cost-grid {
    display: flex;
    flex-wrap: wrap !important;
    gap: 8px !important;
}
body .cost-item {
    flex: 1 1 150px !important;
    padding: 8px 12px !important;
    background: rgba(28,39,51,0.07) !important;
    border-radius: 6px !important;
}
body .cost-item.total {
    flex: 1 1 100% !important;
    margin-top: 4px !important;
}
body .cost-label {
    font-size: 11px !important;
}
body .cost-value {
    font-size: 16px !important;
}
body .cost-note {
    font-size: 10px !important;
    margin-top: 8px !important;
    opacity: 0.7;
}

/* Compact permit table */
body .permit-table {
    font-size: 12px !important;
    margin-top: 12px !important;
}
body .permit-table th,
body .permit-table td {
    padding: 6px 8px !important;
}

/* Hide the separate load configuration since we have Overall Dims */
body .trailer-summary {
    display: none !important;
}

/* Two-card permit results layout */
#permitResults .cost-summary,
#permitResultsContent .cost-summary {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 16px !important;
    padding: 16px !important;
}

#permitResults .cost-grid,
#permitResultsContent .cost-grid {
    display: flex;
    flex-direction: column !important;
    gap: 8px !important;
}

#permitResults .cost-item,
#permitResultsContent .cost-item {
    display: flex;
    justify-content: space-between !important;
    padding: 8px 12px !important;
    background: rgba(28,39,51,0.052) !important;
    border-radius: 6px !important;
    flex: none !important;
}

#permitResults .cost-item.total,
#permitResultsContent .cost-item.total {
    background: rgba(47,93,143, 0.2) !important;
    border: 1px solid rgba(47,93,143, 0.4) !important;
    margin-top: 8px !important;
}

/* State table more compact */
#permitResults .permit-table,
#permitResultsContent .permit-table {
    font-size: 11px !important;
}

#permitResults .permit-table th,
#permitResults .permit-table td,
#permitResultsContent .permit-table th,
#permitResultsContent .permit-table td {
    padding: 5px 8px !important;
}

/* Responsive */
@media (max-width: 768px) {
    #permitResults .cost-summary,
    #permitResultsContent .cost-summary {
        grid-template-columns: 1fr !important;
    }
}

/* Compact travel restrictions */
#permitResults .travel-restrictions-compact,
#permitResultsContent .travel-restrictions-compact {
    font-size: 11px !important;
    padding: 8px 12px !important;
}

/* Fix permit cost layout - remove grid, make compact */
#permitResults .cost-summary,
#permitResultsContent .cost-summary {
    display: block !important;
    grid-template-columns: none !important;
    padding: 12px !important;
}

#permitResults .cost-grid,
#permitResultsContent .cost-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
}

#permitResults .cost-item,
#permitResultsContent .cost-item {
    flex: none !important;
    padding: 6px 10px !important;
}

#permitResults .cost-item.total,
#permitResultsContent .cost-item.total {
    grid-column: span 2 !important;
}

/* Even more compact permit table */
#permitResults .permit-table,
#permitResultsContent .permit-table {
    font-size: 10px !important;
    margin-top: 8px !important;
}

#permitResults .permit-table th,
#permitResults .permit-table td {
    padding: 4px 6px !important;
}

/* Compact overall dims */
.permit-overall-dims {
    padding: 8px 12px !important;
    gap: 16px !important;
    margin-bottom: 8px !important;
}

.permit-overall-dims .dim-value {
    font-size: 16px !important;
}

/* Truck nav compact */
.truck-nav {
    padding: 8px 16px !important;
    margin-bottom: 8px !important;
}

/* Permit results section compact */
#permitResultsSection h3 {
    margin-bottom: 8px !important;
    font-size: 16px !important;
}

/* Hide the Estimated Costs h3 */
#permitResults .cost-summary h3,
#permitResultsContent .cost-summary h3 {
    display: none !important;
}

/* Two-column permit layout: State table LEFT, Cost summary RIGHT */
#permitResults {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

#permitResults .permit-overall-dims {
    width: 100%;
    order: 1;
}

#permitResults .permit-left-card {
    flex: 1 1 55%;
    min-width: 400px;
    order: 2;
}

#permitResults .permit-right-card {
    flex: 1 1 40%;
    min-width: 300px;
    order: 3;
}

#permitResults .travel-restrictions-compact,
#permitResults .survey-warning,
#permitResults .superload-warning {
    width: 100%;
    order: 4;
}

#permitResults .permit-export-buttons {
    width: 100%;
    order: 5;
}

#permitResults .truck-nav {
    width: 100%;
    order: 6;
}

/* Make state table more compact */
#permitResults .permit-table {
    font-size: 12px;
}

#permitResults .permit-table th,
#permitResults .permit-table td {
    padding: 6px 8px;
}

/* Responsive - stack on mobile */
@media (max-width: 900px) {
    #permitResults .permit-left-card,
    #permitResults .permit-right-card {
        flex: 1 1 100%;
        min-width: 100%;
    }
    #permitResults .permit-right-card {
        order: 3;
    }
    #permitResults .permit-left-card {
        order: 2;
    }
}

/* FORCE two-column layout: State table LEFT, Cost summary RIGHT */
body #permitResults,
body #permitResultsContent {
    display: flex;
    flex-wrap: wrap !important;
    gap: 16px !important;
}

body #permitResults > .permit-overall-dims,
body #permitResultsContent > .permit-overall-dims {
    width: 100% !important;
    flex: 0 0 100% !important;
    order: 1 !important;
}

body #permitResults > .permit-left-card,
body #permitResultsContent > .permit-left-card {
    flex: 1 1 55% !important;
    min-width: 450px !important;
    order: 2 !important;
}

body #permitResults > .permit-right-card,
body #permitResults > .cost-summary,
body #permitResultsContent > .permit-right-card,
body #permitResultsContent > .cost-summary {
    flex: 1 1 40% !important;
    min-width: 320px !important;
    order: 3 !important;
}

body #permitResults > .travel-restrictions-compact,
body #permitResults > .survey-warning,
body #permitResults > .superload-warning,
body #permitResultsContent > .travel-restrictions-compact {
    width: 100% !important;
    flex: 0 0 100% !important;
    order: 4 !important;
}

body #permitResults > .permit-export-actions,
body #permitResultsContent > .permit-export-actions {
    width: 100% !important;
    flex: 0 0 100% !important;
    order: 5 !important;
}

body #permitResults > .truck-nav,
body #permitResultsContent > .truck-nav {
    width: 100% !important;
    flex: 0 0 100% !important;
    order: 6 !important;
}

/* Clean cost summary layout */
.cost-summary-clean {
    background: rgba(21,128,61, 0.08);
    border: 1px solid rgba(21,128,61, 0.25);
    border-left: 4px solid #15803d;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
}

.cost-summary-clean .cost-line {
    display: flex;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid rgba(100, 116, 139, 0.2);
}

.cost-summary-clean .cost-line:last-child {
    border-bottom: none;
}

.cost-summary-clean .cost-line.total {
    border-top: 2px solid rgba(21,128,61, 0.4);
    margin-top: 8px;
    padding-top: 12px;
    font-weight: bold;
    font-size: 1.1em;
}

.cost-summary-clean .cost-label {
    flex: 1;
    color: #5b6875;
}

.cost-summary-clean .cost-value {
    font-weight: 600;
    color: #1c2733;
    min-width: 120px;
    text-align: right;
}

.cost-summary-clean .cost-line.total .cost-value {
    color: #15803d;
}

.cost-summary-clean .details-btn {
    background: rgba(47,93,143, 0.2);
    border: 1px solid rgba(47,93,143, 0.4);
    color: #2f5d8f;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    cursor: pointer;
    margin-left: 12px;
}

.cost-summary-clean .details-btn:hover {
    background: rgba(47,93,143, 0.3);
}

/* Details popup panel */
.permit-details-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fffdf8;
    border: 1px solid rgba(100, 116, 139, 0.3);
    border-radius: 12px;
    padding: 20px;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.permit-details-panel .details-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(100, 116, 139, 0.3);
}

.permit-details-panel h4 {
    margin: 0;
    color: #1c2733;
}

.permit-details-panel .close-details {
    background: none;
    border: none;
    color: #5b6875;
    font-size: 24px;
    cursor: pointer;
    padding: 0 8px;
}

.permit-details-panel .close-details:hover {
    color: #1c2733;
}

.details-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.details-table th,
.details-table td {
    padding: 8px 12px;
    text-align: left;
    border-bottom: 1px solid rgba(100, 116, 139, 0.2);
}

.details-table th {
    background: rgba(28,39,51,0.07);
    color: #5b6875;
    font-weight: 500;
}

.details-table .yes {
    color: #15803d;
    font-weight: 600;
}

.details-note {
    font-size: 11px;
    color: #5b6875;
    margin-top: 12px;
    font-style: italic;
}

/* Backdrop when panel is open */
.permit-details-panel::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: -1;
}

/* Editable cost inputs */
.cost-summary-clean .cost-input-wrap {
    display: flex;
    align-items: center;
    gap: 2px;
    color: #1c2733;
    font-weight: 600;
}

.cost-summary-clean .cost-input {
    background: rgba(28,39,51,0.105);
    border: 1px solid rgba(100, 116, 139, 0.3);
    border-radius: 4px;
    color: #1c2733;
    font-weight: 600;
    padding: 4px 8px;
    width: 100px;
    text-align: right;
    font-size: 14px;
}

.cost-summary-clean .cost-input:focus {
    outline: none;
    border-color: #2f5d8f;
    background: rgba(47,93,143, 0.1);
}

.cost-summary-clean .markup-input {
    width: 60px;
}

.cost-summary-clean .cost-line.editable .cost-label {
    color: #5b6875;
}

.cost-summary-clean .cost-line.truck-total {
    border-top: 1px solid rgba(100, 116, 139, 0.3);
    margin-top: 8px;
    padding-top: 10px;
}

.cost-summary-clean .cost-line.truck-total .cost-label {
    font-weight: 600;
    color: #5b6875;
}

.cost-summary-clean .cost-line.truck-total .cost-value {
    color: #1c2733;
}

.cost-summary-clean .cost-line.markup {
    background: rgba(47,93,143, 0.05);
    margin: 8px -16px;
    padding: 10px 16px;
}

.cost-summary-clean .cost-line.customer {
    background: rgba(21,128,61, 0.1);
    margin: 0 -16px -16px -16px;
    padding: 14px 16px;
    border-radius: 0 0 8px 8px;
}

.cost-summary-clean .cost-line.customer .cost-label {
    font-weight: 700;
    color: #15803d;
    font-size: 1.05em;
}

.cost-summary-clean .cost-line.customer .cost-value {
    color: #15803d;
    font-size: 1.15em;
    font-weight: 700;
}

/* Improved Overall Dimensions Display */
.permit-overall-dims-v2 {
    background: rgba(255,253,248, 0.6);
    border: 1px solid rgba(100, 116, 139, 0.3);
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 16px;
}

.permit-overall-dims-v2 .dims-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(100, 116, 139, 0.2);
}

.permit-overall-dims-v2 .dims-title {
    font-weight: 600;
    color: #5b6875;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.permit-overall-dims-v2 .trailer-badge {
    background: rgba(47,93,143, 0.2);
    border: 1px solid rgba(47,93,143, 0.4);
    color: #2f5d8f;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.permit-overall-dims-v2 .dims-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.permit-overall-dims-v2 .dim-box {
    background: rgba(28,39,51,0.07);
    border-radius: 8px;
    padding: 12px;
    text-align: center;
    border: 2px solid transparent;
}

.permit-overall-dims-v2 .dim-box.legal {
    border-color: rgba(21,128,61, 0.3);
}

.permit-overall-dims-v2 .dim-box.warning {
    border-color: rgba(180,83,9, 0.5);
    background: rgba(180,83,9, 0.1);
}

.permit-overall-dims-v2 .dim-box.od {
    border-color: rgba(185,28,28, 0.5);
    background: rgba(185,28,28, 0.1);
}

.permit-overall-dims-v2 .dim-label {
    font-size: 10px;
    color: #5b6875;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.permit-overall-dims-v2 .dim-value {
    font-size: 20px;
    font-weight: 700;
    color: #1c2733;
    margin-bottom: 4px;
}

.permit-overall-dims-v2 .dim-box.od .dim-value {
    color: #b91c1c;
}

.permit-overall-dims-v2 .dim-box.warning .dim-value {
    color: #b45309;
}

.permit-overall-dims-v2 .dim-status {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
}

.permit-overall-dims-v2 .dim-box.legal .dim-status {
    color: #15803d;
}

.permit-overall-dims-v2 .dim-box.warning .dim-status {
    color: #b45309;
}

.permit-overall-dims-v2 .dim-box.od .dim-status {
    color: #b91c1c;
}

/* Responsive */
@media (max-width: 700px) {
    .permit-overall-dims-v2 .dims-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Collapsed warnings section */
.warnings-collapsed {
    margin: 12px 0;
}

.warnings-collapsed .warnings-toggle {
    width: 100%;
    background: rgba(180,83,9, 0.1);
    border: 1px solid rgba(180,83,9, 0.3);
    color: #b45309;
    padding: 10px 16px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    font-weight: 500;
}

.warnings-collapsed .warnings-toggle:hover {
    background: rgba(180,83,9, 0.15);
}

.warnings-collapsed .toggle-icon {
    transition: transform 0.2s;
}

.warnings-collapsed.expanded .toggle-icon {
    transform: rotate(180deg);
}

.warnings-collapsed .warnings-content {
    display: none;
    padding: 12px 0;
}

.warnings-collapsed.expanded .warnings-content {
    display: block;
}

/* Make warnings more compact */
.warnings-content .survey-warning,
.warnings-content .travel-restrictions-compact,
.warnings-content .superload-warning {
    margin-bottom: 8px;
    padding: 10px 12px;
    font-size: 12px;
}

/* Hide state table completely */
.permit-state-table-hidden {
    display: none !important;
}

/* Details button inline */
.cost-line .details-btn {
    background: rgba(47,93,143, 0.2);
    border: 1px solid rgba(47,93,143, 0.4);
    color: #2f5d8f;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10px;
    cursor: pointer;
    margin-left: 8px;
    vertical-align: middle;
}

.cost-line .details-btn:hover {
    background: rgba(47,93,143, 0.3);
}

/* Details button in cost-summary cost-item */
.cost-summary .details-btn,
.cost-grid .details-btn {
    background: rgba(47,93,143, 0.2);
    border: 1px solid rgba(47,93,143, 0.4);
    color: #2f5d8f;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10px;
    cursor: pointer;
    margin-left: 8px;
    vertical-align: middle;
}

.cost-summary .details-btn:hover,
.cost-grid .details-btn:hover {
    background: rgba(47,93,143, 0.3);
}

/* Permit rate inputs */
.rate-input {
    width: 70px;
    padding: 4px 6px;
    border: 1px solid rgba(28,39,51,0.2);
    border-radius: 4px;
    background: rgba(28,39,51,0.105);
    color: #fff;
    font-size: 14px;
    text-align: right;
}
.rate-input:focus {
    outline: none;
    border-color: #2f5d8f;
}
.markup-row .cost-value {
    display: flex;
    align-items: center;
    gap: 4px;
}
.markup-row .rate-input {
    width: 50px;
}
.cost-item.truck-cost {
    background: rgba(47,93,143, 0.15) !important;
    border: 1px solid rgba(47,93,143, 0.3);
}
.cost-item.customer-price {
    background: rgba(21,128,61, 0.15) !important;
    border: 1px solid rgba(21,128,61, 0.3);
}
.cost-item.customer-price .cost-value {
    color: #15803d;
    font-weight: 700;
}

/* Compact dims bar */
.permit-dims-compact {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 14px;
    background: rgba(28,39,51,0.07);
    border-radius: 8px;
    margin-bottom: 16px;
    align-items: center;
    font-size: 13px;
}
.permit-dims-compact .trailer-tag {
    background: #2f5d8f;
    color: #fff;
    padding: 4px 10px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 12px;
}
.permit-dims-compact .dim-tag {
    color: #5b6875;
    padding: 4px 8px;
    background: rgba(28,39,51,0.05);
    border-radius: 4px;
}
.permit-dims-compact .dim-tag.od {
    color: #b45309;
    background: rgba(180,83,9, 0.15);
    font-weight: 600;
}

/* Financial statement style - vertical stacked */
.cost-grid {
    display: flex;
    flex-direction: column !important;
    gap: 0 !important;
}
.cost-item {
    display: flex;
    justify-content: space-between !important;
    padding: 10px 14px !important;
    border-bottom: 1px solid rgba(28,39,51,0.06) !important;
    background: transparent !important;
    border-radius: 0 !important;
}
.cost-item:last-child {
    border-bottom: none !important;
}
.cost-item.markup-row {
    background: rgba(28,39,51,0.035) !important;
    border-top: 1px solid rgba(28,39,51,0.1) !important;
    margin-top: 8px !important;
    padding-top: 12px !important;
}
.cost-item.total {
    border-top: 2px solid rgba(28,39,51,0.2) !important;
    margin-top: 8px !important;
    padding-top: 12px !important;
}
.cost-item.truck-cost {
    background: transparent !important;
    border: none !important;
}
.cost-item.customer-price {
    background: rgba(21,128,61, 0.1) !important;
    border-radius: 6px !important;
    margin-top: 4px !important;
}

/* Details button in cost items */
.cost-item .details-btn {
    background: rgba(47,93,143, 0.2);
    border: 1px solid rgba(47,93,143, 0.4);
    color: #2f5d8f;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    cursor: pointer;
    margin-left: 8px;
}
.cost-item .details-btn:hover {
    background: rgba(47,93,143, 0.4);
    color: #fff;
}

/* Ensure details panel shows above everything */
.permit-details-panel {
    z-index: 9999 !important;
}

/* Force financial statement single column layout */
.financial-statement {
    display: block !important;
    max-width: 500px !important;
    margin: 0 auto !important;
}
.financial-statement .cost-grid {
    display: flex;
    flex-direction: column !important;
    gap: 0 !important;
}
.financial-statement .cost-item {
    display: flex;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 12px 16px !important;
    border-bottom: 1px solid rgba(28,39,51,0.08) !important;
    background: transparent !important;
    width: 100% !important;
    box-sizing: border-box !important;
}
.financial-statement .cost-label {
    display: flex;
    align-items: center;
    gap: 8px;
}
.financial-statement .cost-value {
    text-align: right;
    font-weight: 600;
}

/* FINAL FIX: Force single column financial statement */
body #permitResults .cost-summary.financial-statement,
body #permitResultsContent .cost-summary.financial-statement {
    display: block !important;
    grid-template-columns: unset !important;
    max-width: 480px !important;
    margin: 0 auto 16px auto !important;
    padding: 0 !important;
    background: rgba(28,39,51,0.052) !important;
    border-radius: 8px !important;
    overflow: hidden !important;
}
body #permitResults .cost-summary.financial-statement h3,
body #permitResultsContent .cost-summary.financial-statement h3 {
    padding: 12px 16px !important;
    margin: 0 !important;
    background: rgba(28,39,51,0.07) !important;
    border-bottom: 1px solid rgba(28,39,51,0.1) !important;
}
body #permitResults .cost-summary.financial-statement .cost-grid,
body #permitResultsContent .cost-summary.financial-statement .cost-grid {
    display: flex;
    flex-direction: column !important;
    gap: 0 !important;
    grid-template-columns: unset !important;
}
body #permitResults .cost-summary.financial-statement .cost-item,
body #permitResultsContent .cost-summary.financial-statement .cost-item {
    display: flex;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 10px 16px !important;
    border-bottom: 1px solid rgba(28,39,51,0.06) !important;
    background: transparent !important;
    border-radius: 0 !important;
    margin: 0 !important;
}
body .cost-summary.financial-statement .cost-item.truck-cost {
    background: rgba(47,93,143, 0.1) !important;
    border-top: 2px solid rgba(28,39,51,0.15) !important;
    margin-top: 8px !important;
}
body .cost-summary.financial-statement .cost-item.customer-price {
    background: rgba(21,128,61, 0.15) !important;
}

/* Fix $ placement - inline with input */
.cost-value {
    display: flex;
    align-items: center !important;
    gap: 4px !important;
}
.cost-value .dollar {
    font-weight: 600;
    color: #5b6875;
}
.cost-value .rate-input {
    width: 80px !important;
}

/* Center the dims bar */
.permit-dims-compact {
    justify-content: center !important;
    margin: 0 0 16px 0 !important;
    max-width: none !important;
}

/* Move warnings below - ensure it comes after cost summary */
.warnings-collapsed {
    order: 99 !important;
    margin-top: 16px !important;
}

/* Make permit results a flex column to control order */
#permitResultsContent {
    display: flex;
    flex-direction: column !important;
}
#permitResultsContent > .permit-dims-compact { order: 1; }
#permitResultsContent > .cost-summary { order: 2; }
#permitResultsContent > .warnings-collapsed { order: 3; }
#permitResultsContent > .permit-export-actions { order: 4; }
#permitResultsContent > #permitDetailsPanel { order: 5; }

/* Wider markup input */
.markup-row .rate-input {
    width: 60px !important;
}

/* RESET - Remove all the conflicting layout rules */
#permitResultsContent {
    display: block !important;
    max-width: 600px !important;
    margin: 0 auto !important;
}

/* Dims bar - full width, centered content */
.permit-dims-compact {
    display: flex;
    flex-wrap: wrap !important;
    justify-content: center !important;
    gap: 8px !important;
    padding: 12px 16px !important;
    background: rgba(28,39,51,0.07) !important;
    border-radius: 8px !important;
    margin-bottom: 16px !important;
    width: 100% !important;
    max-width: none !important;
    box-sizing: border-box !important;
}

/* Cost summary - full width */
body .cost-summary.financial-statement,
body #permitResults .cost-summary.financial-statement,
body #permitResultsContent .cost-summary.financial-statement {
    display: block !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 0 16px 0 !important;
    padding: 0 16px !important;
    background: rgba(28,39,51,0.052) !important;
    border-radius: 8px !important;
    border: 1px solid rgba(100,116,139,0.3) !important;
}

/* Cost grid - single column */
body .cost-summary.financial-statement .cost-grid {
    display: flex;
    flex-direction: column !important;
    gap: 0 !important;
}

/* Cost items - full width rows */
body .cost-summary.financial-statement .cost-item {
    display: flex;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 12px 20px !important;
    border-bottom: 1px solid rgba(28,39,51,0.08) !important;
    background: transparent !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

/* Warnings - full width below */
.warnings-collapsed {
    width: 100% !important;
    margin-top: 0 !important;
}

/* Details popup - make sure it shows */
.permit-details-panel {
    display: none;
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    background: #fffdf8 !important;
    border: 1px solid rgba(47,93,143, 0.5) !important;
    border-radius: 12px !important;
    padding: 20px !important;
    min-width: 400px !important;
    max-width: 90vw !important;
    max-height: 80vh !important;
    overflow-y: auto !important;
    z-index: 10000 !important;
    box-shadow: 0 25px 80px rgba(0,0,0,0.7) !important;
}
.permit-details-panel[style*="display: block"],
.permit-details-panel[style*="display:block"] {
    display: block !important;
}

/* Backdrop */
body.details-open::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.6);
    z-index: 9999;
}

/* MASTER OVERRIDE - Single column stacked layout */
#permitResults,
#permitResultsContent {
    display: block !important;
}

#permitResults > *,
#permitResultsContent > * {
    width: 100% !important;
    max-width: 600px !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

#permitResults .cost-summary,
#permitResultsContent .cost-summary,
#permitResults .cost-summary.financial-statement,
#permitResultsContent .cost-summary.financial-statement {
    display: block !important;
    grid-template-columns: unset !important;
    width: 100% !important;
    max-width: 600px !important;
}

#permitResults .permit-dims-compact,
#permitResultsContent .permit-dims-compact {
    max-width: 600px !important;
    justify-content: center !important;
}

#permitResults .warnings-collapsed,
#permitResultsContent .warnings-collapsed {
    max-width: 600px !important;
}

/* ========== FINAL OVERRIDE - PERMIT RESULTS ========== */
/* Force single column for entire permit results section */
.permit-results-section,
#permitResultsSection,
#permitResults,
#permitResultsContent,
.permit-results-section > *,
#permitResultsSection > *,
#permitResults > *,
#permitResultsContent > * {
    display: block !important;
    grid-template-columns: unset !important;
    flex-direction: column !important;
}

/* Center everything in permit results */
#permitResults {
    max-width: 650px !important;
    margin: 0 auto !important;
    padding: 20px !important;
}

/* Dims bar - centered */
#permitResults .permit-dims-compact {
    display: flex;
    flex-wrap: wrap !important;
    justify-content: center !important;
    margin: 0 0 16px 0 !important;
    width: 100% !important;
    max-width: none !important;
}

/* Cost summary - full width, single column */
#permitResults .cost-summary,
#permitResults .cost-summary.financial-statement {
    display: block !important;
    width: 100% !important;
    margin-bottom: 20px !important;
}

#permitResults .cost-grid {
    display: flex;
    flex-direction: column !important;
}

/* Warnings - full width */
#permitResults .warnings-collapsed {
    width: 100% !important;
}

/* ========== FIX DETAILS POPUP ========== */
#permitDetailsPanel {
    display: none !important;
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    z-index: 100000 !important;
    background: #fffdf8 !important;
    border: 2px solid #2f5d8f !important;
    border-radius: 12px !important;
    padding: 24px !important;
    min-width: 450px !important;
    max-width: 600px !important;
    max-height: 70vh !important;
    overflow-y: auto !important;
    box-shadow: 0 25px 80px rgba(0,0,0,0.8) !important;
}
#permitDetailsPanel.visible {
    display: block !important;
}
#permitDetailsOverlay {
    display: none !important;
}
#permitDetailsOverlay.visible {
    display: block !important;
}

/* Clickable overlay behind details panel */
.permit-details-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    background: rgba(0,0,0,0.7) !important;
    z-index: 99999 !important;
    cursor: pointer;
}

/* Beta tag */
.beta-tag {
    background: rgba(180,83,9, 0.2);
    color: #b45309;
    border: 1px solid rgba(180,83,9, 0.4);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    cursor: pointer;
    margin-left: 6px;
}
.beta-tag:hover {
    background: rgba(180,83,9, 0.3);
}

/* Beta info popup */
.beta-info-popup {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100001;
}
.beta-popup-content {
    background: #fffdf8;
    border: 1px solid rgba(180,83,9, 0.4);
    border-radius: 12px;
    padding: 24px;
    max-width: 450px;
    position: relative;
}
.beta-popup-content h4 {
    color: #b45309;
    margin: 0 0 12px 0;
}
.beta-popup-content p {
    color: #5b6875;
    font-size: 14px;
    line-height: 1.5;
    margin: 0 0 12px 0;
}
.beta-popup-content ul {
    color: #5b6875;
    font-size: 13px;
    margin: 0 0 12px 0;
    padding-left: 20px;
}
.beta-popup-content li {
    margin-bottom: 6px;
}
.beta-warning {
    background: rgba(180,83,9, 0.1);
    border-left: 3px solid #b45309;
    padding: 10px 12px;
    border-radius: 0 6px 6px 0;
}
.close-beta {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: none;
    color: #5b6875;
    font-size: 24px;
    cursor: pointer;
}
.close-beta:hover {
    color: #fff;
}

/* Compact superload note */
.superload-note-compact {
    color: #b45309;
    font-size: 12px;
    background: rgba(180,83,9, 0.1);
    border-left: 3px solid #b45309;
    padding: 10px 14px;
    border-radius: 0 6px 6px 0;
    margin: 12px 0;
}

/* Better warnings section */
.warnings-content {
    font-size: 13px;
}
.survey-warning {
    background: rgba(47,93,143, 0.1);
    border-left: 3px solid #2f5d8f;
    padding: 10px 14px;
    border-radius: 0 6px 6px 0;
    margin-bottom: 12px;
    color: #5b6875;
}
.survey-warning strong {
    color: #2f5d8f;
}
.travel-restrictions-compact {
    background: rgba(100, 116, 139, 0.1);
    border-left: 3px solid #c9c2b2;
    padding: 10px 14px;
    border-radius: 0 6px 6px 0;
    color: #5b6875;
}
.travel-restrictions-compact strong {
    color: #1c2733;
}
.restriction-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 6px;
}
.restriction-note {
    font-size: 11px;
    opacity: 0.7;
    font-style: italic;
}


/* Rate Check page - Market Rates and Quote Builder side by side */
.rates-row-layout {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 16px !important;
    align-items: start !important;
}

/* Stack rate cards on left, quote builder takes right */
#marketRatesCard, #aiRatesCard {
    grid-column: 1 !important;
}

#quoteBuilderCard {
    grid-column: 2 !important;
    grid-row: 1 / span 2 !important;
}

@media (max-width: 900px) {
    .rates-row-layout {
        grid-template-columns: 1fr !important;
    }
    #marketRatesCard, #aiRatesCard, #quoteBuilderCard {
        grid-column: 1 !important;
        grid-row: auto !important;
    }
}

/* ==================== RATE CHECK TWO-COLUMN LAYOUT ==================== */
/* Rate cards stacked on left, quote builder on right */
.rates-row-layout {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    grid-template-rows: auto auto !important;
    gap: 16px !important;
    align-items: start !important;
}

/* Market rates card - top left */
#marketRatesCard {
    grid-column: 1 !important;
    grid-row: 1 !important;
}

/* AI/FreightDeck rates card - bottom left (stacked under market) */
#aiRatesCard {
    grid-column: 1 !important;
    grid-row: 2 !important;
}

/* Network rates (if shown) - also left column */
#networkRatesCard {
    grid-column: 1 !important;
}

/* Quote Builder - spans full right column */
#quoteBuilderCard {
    grid-column: 2 !important;
    grid-row: 1 / span 3 !important;
    height: fit-content !important;
}

/* Mobile: stack everything */
@media (max-width: 900px) {
    .rates-row-layout {
        grid-template-columns: 1fr !important;
    }
    #marketRatesCard, #aiRatesCard, #networkRatesCard, #quoteBuilderCard {
        grid-column: 1 !important;
        grid-row: auto !important;
    }
}

/* Quote Builder - stretch to fill full height */
#quoteBuilderCard {
    height: 100% !important;
    display: flex;
    flex-direction: column !important;
}

#quoteBuilderCard .quote-builder-inputs {
    flex: 1 !important;
}

#quoteBuilderCard .quote-summary {
    margin-top: auto !important;
}

/* Make the grid rows stretch */
.rates-row-layout {
    align-items: stretch !important;
}

/* ==================== STRONGSOLO FEEDBACK BUTTONS ==================== */
.message-feedback {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(28,39,51,0.1);
}

.feedback-btn {
    background: rgba(28,39,51,0.1) !important;
    border: 1px solid rgba(28,39,51,0.2) !important;
    border-radius: 6px !important;
    padding: 6px 12px !important;
    font-size: 14px !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    color: #1c2733 !important;
}

.feedback-btn:hover {
    background: rgba(28,39,51,0.2) !important;
    transform: scale(1.05);
}

.report-btn {
    background: transparent !important;
    border: none !important;
    color: #5b6875 !important;
    font-size: 11px !important;
    cursor: pointer !important;
    padding: 4px 8px !important;
    margin-left: auto !important;
    opacity: 0.7;
    transition: all 0.2s ease !important;
}

.report-btn:hover {
    color: #5b6875 !important;
    opacity: 1;
}

/* ==================== LOAD BUILDER REDESIGN ==================== */

/* Hero row - AI Build as primary CTA */
#loadbuild .loadbuilder-hero {
    display: flex;
    flex-direction: column !important;
    align-items: center !important;
    gap: 12px !important;
    margin-bottom: 16px !important;
    padding: 20px !important;
    background: rgba(255,253,248, 0.4) !important;
    border: 1px solid rgba(100, 116, 139, 0.2) !important;
    border-radius: 8px !important;
}

#loadbuild .loadbuilder-hero .ai-build-btn {
    background: linear-gradient(135deg, #2f5d8f, #2f5d8f) !important;
    font-size: 16px !important;
    padding: 14px 36px !important;
    box-shadow: 0 0 20px rgba(47,93,143, 0.4) !important;
    border: none !important;
    border-radius: 8px !important;
    color: #fff !important;
    cursor: pointer !important;
}

#loadbuild .loadbuilder-hero .ai-build-preview {
    width: 100% !important;
}

#loadbuild .loadbuilder-hero #addTruckBtn {
    font-size: 13px !important;
    padding: 6px 16px !important;
}

/* Top permit action */
#loadbuild .trucks-permit-action-top {
    margin-bottom: 12px !important;
    text-align: center !important;
}

#loadbuild .trucks-permit-action-top .btn {
    width: 100% !important;
    padding: 10px 20px !important;
    font-size: 14px !important;
}

/* Lane inputs on load builder */
#loadbuild .loadbuilder-lane {
    background: rgba(255,253,248, 0.4) !important;
    border: 1px solid rgba(100, 116, 139, 0.2) !important;
    border-radius: 6px !important;
    padding: 10px 14px !important;
    margin-top: 16px !important;
}

#loadbuild .loadbuilder-lane .lane-label {
    color: #5b6875 !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    margin-right: 4px !important;
}

#loadbuild .loadbuilder-lane .lane-inputs-compact {
    display: flex;
    align-items: center !important;
    gap: 10px !important;
}

#loadbuild .loadbuilder-lane input {
    flex: 1 !important;
    background: rgba(255,253,248, 0.6) !important;
    border: 1px solid rgba(100, 116, 139, 0.3) !important;
    border-radius: 4px !important;
    padding: 8px 12px !important;
    color: #1c2733 !important;
    font-size: 13px !important;
}

#loadbuild .loadbuilder-lane .lane-arrow {
    color: #5b6875 !important;
}

/* Bottom disclaimer */
#loadbuild .loadbuilder-disclaimer {
    background: rgba(180,83,9, 0.08) !important;
    border: 1px solid rgba(180,83,9, 0.2) !important;
    border-radius: 6px !important;
    padding: 8px 14px !important;
    margin-top: 16px !important;
    font-size: 12px !important;
    color: #b45309 !important;
}

#loadbuild .loadbuilder-disclaimer strong {
    margin-right: 4px !important;
}

/* ==================== LOAD BUILDER UI OVERHAUL ==================== */

/* Remove old hero section styling */
#loadbuild .loadbuilder-hero {
    display: none !important;
}

/* Pool actions row - below pieces, above trucks */
#loadbuild .pool-actions-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 0 4px;
    margin-top: 12px;
    border-top: 1px solid rgba(100, 116, 139, 0.15);
    flex-wrap: wrap;
    justify-content: center;
}

/* Prominent drag instruction */
#loadbuild .pool-instruction {
    color: #5b6875 !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    margin: 0 !important;
    letter-spacing: 0.01em;
}

/* "or" divider */
#loadbuild .pool-or-divider {
    display: flex;
    align-items: center;
    gap: 10px;
}
#loadbuild .pool-or-divider .divider-line {
    width: 24px;
    height: 1px;
    background: rgba(100, 116, 139, 0.3);
}
#loadbuild .pool-or-divider .divider-text {
    color: #5b6875;
    font-size: 12px;
    font-style: italic;
}

/* AI Build inline CTA */
#loadbuild .ai-build-cta {
    display: flex;
    align-items: center;
    gap: 12px;
}
#loadbuild .ai-build-cta .ai-build-btn {
    background: linear-gradient(135deg, #2f5d8f, #2f5d8f) !important;
    font-size: 14px !important;
    padding: 10px 24px !important;
    box-shadow: 0 0 16px rgba(47,93,143, 0.3) !important;
    border: none !important;
    border-radius: 8px !important;
    color: #fff !important;
    cursor: pointer !important;
    font-weight: 600 !important;
    white-space: nowrap;
}
#loadbuild .ai-build-cta .ai-build-btn:hover {
    box-shadow: 0 0 24px rgba(47,93,143, 0.5) !important;
    transform: translateY(-1px);
}
#loadbuild .ai-build-subtitle {
    color: #2f5d8f;
    font-size: 13px;
    font-weight: 400;
    white-space: nowrap;
}

/* AI Build Preview - cleaned up */
#loadbuild .ai-build-preview {
    width: 100% !important;
    background: transparent !important;
    border: none !important;
    padding: 8px 0 0 !important;
    margin: 0 !important;
    display: none;
}
#loadbuild .ai-build-preview.active {
    display: flex !important;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}
#loadbuild .ai-build-preview .ai-build-summary {
    display: flex !important;
    gap: 12px !important;
    justify-content: center !important;
    flex-wrap: wrap !important;
    margin: 0 !important;
}
#loadbuild .ai-build-preview .ai-build-stat {
    background: rgba(47,93,143, 0.1) !important;
    border: 1px solid rgba(47,93,143, 0.25) !important;
    border-radius: 8px !important;
    padding: 8px 16px !important;
    display: flex;
    align-items: center;
    gap: 8px;
}
#loadbuild .ai-build-preview .ai-build-stat .count {
    font-weight: 700 !important;
    color: #2f5d8f !important;
    font-size: 18px !important;
}
#loadbuild .ai-build-preview .ai-build-stat .label {
    color: #5b6875 !important;
    font-size: 12px !important;
}

/* + Add Truck row - below trucks */
#loadbuild .add-truck-row {
    margin-top: 12px;
    text-align: center;
}
#loadbuild .add-truck-row .btn {
    padding: 8px 20px !important;
    font-size: 13px !important;
    background: rgba(100, 116, 139, 0.15) !important;
    border: 1px dashed rgba(100, 116, 139, 0.4) !important;
    border-radius: 6px !important;
    color: #5b6875 !important;
    cursor: pointer !important;
}
#loadbuild .add-truck-row .btn:hover {
    background: rgba(100, 116, 139, 0.25) !important;
    border-color: #2f5d8f !important;
    color: #1c2733 !important;
}

/* Hide old hint class in pool, replaced by pool-instruction */
#loadbuild .loadbuilder-pool > .hint {
    display: none !important;
}

/* Mobile adjustments */
@media (max-width: 600px) {
    #loadbuild .pool-actions-row {
        flex-direction: column;
        gap: 10px;
    }
    #loadbuild .ai-build-cta {
        flex-direction: column;
        gap: 6px;
    }
}

/* ==================== DIMS INPUT TABLE - COMPACT CELLS ==================== */
/* Make input table cells smaller to match output */
#dims #inputTable td {
    height: 22px !important;
    padding: 1px 3px !important;
    line-height: 18px !important;
    font-size: 11px !important;
}
#dims #inputTable input,
#dims #inputTable select {
    font-size: 11px !important;
    line-height: 16px !important;
    height: 16px !important;
}
#dims #inputTable select {
    height: 16px !important;
}
#dims .dim-ft-in {
    height: 16px !important;
}
#dims .dim-ft-in input {
    font-size: 11px !important;
    height: 16px !important;
    line-height: 16px !important;
}
#dims .dim-ft-in .dim-label {
    font-size: 9px !important;
    line-height: 16px !important;
}
#dims #inputTable th {
    padding: 2px 2px !important;
    font-size: 9px !important;
}
/* Output table also compact to match */
#dims #outputTable td {
    height: 22px !important;
    padding: 1px 3px !important;
    line-height: 18px !important;
    font-size: 11px !important;
}
#dims #outputTable th {
    padding: 2px 2px !important;
    font-size: 9px !important;
}

/* ==================== DIMS TOOLBAR - COMMODITY REMOVED ==================== */
/* Hide commodity validation */
#dims .dims-toolbar .lane-validation[id="commodityValidation"] {
    display: none !important;
}
/* Screenshot preview stacked to right of extract */
#dims .dims-toolbar .upload-preview-compact {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    flex-direction: row !important;
}
#dims .dims-toolbar .image-preview-small {
    max-height: 32px !important;
    max-width: 48px !important;
    border-radius: 3px !important;
    border: 1px solid rgba(100, 116, 139, 0.3) !important;
    object-fit: cover !important;
}

/* ==================== LOAD BUILDER - AI BUILD HERO ON TOP ==================== */
/* Remove old hero and pool-actions-row styles */
#loadbuild .loadbuilder-hero,
#loadbuild .pool-actions-row,
#loadbuild .pool-or-divider,
#loadbuild .ai-build-cta {
    display: none !important;
}

/* New AI Build Hero - prominent at top */
#loadbuild .ai-build-hero {
    background: linear-gradient(135deg, rgba(47,93,143, 0.12), rgba(37, 99, 235, 0.08)) !important;
    border: 1px solid rgba(47,93,143, 0.3) !important;
    border-radius: 10px !important;
    padding: 20px !important;
    margin-bottom: 16px !important;
    text-align: center !important;
}
#loadbuild .ai-build-hero-main {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}
#loadbuild .ai-build-hero .ai-build-btn {
    background: linear-gradient(135deg, #2f5d8f, #2f5d8f) !important;
    font-size: 16px !important;
    padding: 14px 36px !important;
    box-shadow: 0 0 24px rgba(47,93,143, 0.4) !important;
    border: none !important;
    border-radius: 10px !important;
    color: #fff !important;
    cursor: pointer !important;
    font-weight: 700 !important;
    letter-spacing: 0.02em;
    transition: all 0.2s;
}
#loadbuild .ai-build-hero .ai-build-btn:hover {
    box-shadow: 0 0 32px rgba(47,93,143, 0.6) !important;
    transform: translateY(-2px);
}
#loadbuild .ai-build-hero-subtitle {
    color: #2f5d8f;
    font-size: 13px;
    font-weight: 400;
}

/* AI Build Preview inside hero */
#loadbuild .ai-build-hero .ai-build-preview {
    width: 100% !important;
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    padding: 12px 0 0 !important;
    margin: 0 !important;
}
#loadbuild .ai-build-hero .ai-build-preview.active {
    display: block !important;
}
#loadbuild .ai-build-hero .ai-build-preview .ai-build-summary {
    display: flex !important;
    gap: 16px !important;
    justify-content: center !important;
    flex-wrap: wrap !important;
    margin: 0 !important;
}
#loadbuild .ai-build-hero .ai-build-preview .ai-build-stat {
    background: rgba(47,93,143, 0.15) !important;
    border: 1px solid rgba(47,93,143, 0.3) !important;
    border-radius: 8px !important;
    padding: 10px 20px !important;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 140px;
    justify-content: center;
}
#loadbuild .ai-build-hero .ai-build-stat .count {
    font-weight: 700 !important;
    color: #2f5d8f !important;
    font-size: 22px !important;
}
#loadbuild .ai-build-hero .ai-build-stat .label {
    color: #5b6875 !important;
    font-size: 13px !important;
    font-weight: 500 !important;
}

/* Pool instruction - more prominent */
#loadbuild .pool-instruction {
    color: #5b6875 !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    margin: 0 0 8px 0 !important;
    text-align: center !important;
}

/* Mobile */
@media (max-width: 600px) {
    #loadbuild .ai-build-hero .ai-build-btn {
        font-size: 14px !important;
        padding: 12px 24px !important;
    }
}

/* ==================== AI BUILD HERO - COMPACT + BLUE ==================== */
/* Override: fit-content width, centered, blue instead of purple */
#loadbuild .ai-build-hero {
    background: linear-gradient(135deg, rgba(47,93,143, 0.1), rgba(37, 99, 235, 0.06)) !important;
    border: 1px solid rgba(47,93,143, 0.3) !important;
    border-radius: 10px !important;
    padding: 16px 28px !important;
    margin: 0 auto 16px !important;
    text-align: center !important;
    width: fit-content !important;
    max-width: 100% !important;
    min-width: 300px !important;
}
#loadbuild .ai-build-hero .ai-build-btn {
    background: linear-gradient(135deg, #2f5d8f, #2f5d8f) !important;
    box-shadow: 0 0 20px rgba(47,93,143, 0.35) !important;
}
#loadbuild .ai-build-hero .ai-build-btn:hover {
    box-shadow: 0 0 28px rgba(47,93,143, 0.55) !important;
}
#loadbuild .ai-build-hero-subtitle {
    color: #2f5d8f !important;
}

/* AI Build Preview stat cards - blue tint */
#loadbuild .ai-build-hero .ai-build-preview .ai-build-stat,
#loadbuild .ai-build-preview .ai-build-stat {
    background: rgba(47,93,143, 0.1) !important;
    border: 1px solid rgba(47,93,143, 0.25) !important;
}
#loadbuild .ai-build-hero .ai-build-stat .count,
#loadbuild .ai-build-preview .ai-build-stat .count {
    color: #2f5d8f !important;
}

/* Screenshot popup hint on small preview */
#dims .dims-toolbar .image-preview-small {
    cursor: pointer !important;
    transition: opacity 0.15s !important;
}
#dims .dims-toolbar .image-preview-small:hover {
    opacity: 0.8 !important;
}

/* ==================== QUOTE BUILDER - FINANCIAL STATEMENT LAYOUT ==================== */
/* Single column, reads top to bottom like a P&L */

/* Override 2-column grid to single column */
#permitResults .cost-grid,
#permitResultsContent .cost-grid,
body .cost-grid {
    display: flex !important;
    flex-direction: column !important;
    grid-template-columns: none !important;
    gap: 0 !important;
}

/* Each cost item is a single row, full width */
#permitResults .cost-item,
#permitResultsContent .cost-item,
body .cost-item {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 8px 12px !important;
    background: transparent !important;
    border-bottom: 1px solid rgba(100, 116, 139, 0.12) !important;
    border-radius: 0 !important;
    flex: none !important;
    grid-column: unset !important;
}

/* Labels - clean, left aligned */
#permitResults .cost-item .cost-label,
#permitResultsContent .cost-item .cost-label,
body .cost-item .cost-label {
    color: #5b6875 !important;
    font-size: 13px !important;
    font-weight: 400 !important;
}

/* Values - right aligned */
#permitResults .cost-item .cost-value,
#permitResultsContent .cost-item .cost-value,
body .cost-item .cost-value {
    color: #1c2733 !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    text-align: right !important;
}

/* Markup row - subtle divider above */
.cost-item.markup-row {
    border-top: 1px dashed rgba(100, 116, 139, 0.2) !important;
    margin-top: 4px !important;
    padding-top: 10px !important;
}

/* Total rows - TRUCK COST and CUSTOMER PRICE */
#permitResults .cost-item.total,
#permitResultsContent .cost-item.total,
body .cost-item.total {
    grid-column: unset !important;
    border-bottom: none !important;
    margin-top: 4px !important;
    padding: 10px 12px !important;
    border-radius: 6px !important;
}

/* Truck cost row - blue accent */
.cost-item.truck-cost {
    background: rgba(47,93,143, 0.1) !important;
    border: 1px solid rgba(47,93,143, 0.25) !important;
    border-bottom: 1px solid rgba(47,93,143, 0.25) !important;
}
.cost-item.truck-cost .cost-label {
    color: #2f5d8f !important;
    font-weight: 700 !important;
    font-size: 14px !important;
}
.cost-item.truck-cost .cost-value {
    color: #2f5d8f !important;
    font-weight: 700 !important;
    font-size: 16px !important;
}

/* Customer price row - green accent */
.cost-item.customer-price {
    background: rgba(21,128,61, 0.1) !important;
    border: 1px solid rgba(21,128,61, 0.25) !important;
    border-bottom: 1px solid rgba(21,128,61, 0.25) !important;
}
.cost-item.customer-price .cost-label {
    color: #15803d !important;
    font-weight: 700 !important;
    font-size: 14px !important;
}
.cost-item.customer-price .cost-value {
    color: #15803d !important;
    font-weight: 700 !important;
    font-size: 16px !important;
}

/* Rate input fields - cleaner */
.rate-input {
    background: rgba(255,253,248, 0.6) !important;
    border: 1px solid rgba(100, 116, 139, 0.3) !important;
    border-radius: 4px !important;
    color: #1c2733 !important;
    font-size: 14px !important;
    padding: 4px 8px !important;
    text-align: right !important;
    width: 80px !important;
}
.rate-input:focus {
    border-color: #2f5d8f !important;
    outline: none !important;
}

/* Beta tag - keep purple as accent */
.beta-tag {
    background: #2f5d8f !important;
    color: #fff !important;
    font-size: 9px !important;
    padding: 2px 6px !important;
    border-radius: 3px !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em;
    cursor: pointer;
    border: none;
    vertical-align: middle;
}

/* Details button - keep purple accent */
.cost-item .details-btn,
.cost-grid .details-btn,
.cost-summary .details-btn {
    background: rgba(47,93,143, 0.15) !important;
    border: 1px solid rgba(47,93,143, 0.3) !important;
    color: #2f5d8f !important;
    font-size: 10px !important;
    padding: 2px 8px !important;
    border-radius: 3px !important;
    cursor: pointer !important;
}
.cost-item .details-btn:hover,
.cost-grid .details-btn:hover {
    background: rgba(47,93,143, 0.25) !important;
}

/* Trailer tag in dims bar - blue instead of purple */
.permit-dims-compact .trailer-tag {
    background: #2f5d8f !important;
}

/* Cost summary container - cleaner border */
body .cost-summary,
.cost-summary.financial-statement {
    background: rgba(255,253,248, 0.4) !important;
    border: 1px solid rgba(100, 116, 139, 0.25) !important;
    border-left: 3px solid #2f5d8f !important;
    border-radius: 8px !important;
    padding: 14px !important;
}
body .cost-summary h3,
.cost-summary.financial-statement h3 {
    color: #1c2733 !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    margin: 0 0 10px 0 !important;
}

/* Cost note */
.cost-note {
    font-size: 10px !important;
    color: #5b6875 !important;
    margin-top: 10px !important;
    line-height: 1.4 !important;
}

/* Warnings section - amber accent (consistent with site warnings) */
.warnings-collapsed {
    background: rgba(180,83,9, 0.06) !important;
    border: 1px solid rgba(180,83,9, 0.2) !important;
    border-radius: 8px !important;
}
.warnings-collapsed .warnings-toggle {
    color: #b45309 !important;
}

/* ==================== PURPLE ACCENTS - BETA & DETAILS ONLY ==================== */
/* These elements intentionally stay purple to stand out */
.beta-tag,
.beta-badge,
.nav-item-badge {
    background: #2f5d8f !important;
    color: #fff !important;
}
.beta-badge {
    background: linear-gradient(135deg, #2f5d8f, #2f5d8f) !important;
}
.cost-item .details-btn,
.cost-grid .details-btn,
.cost-summary .details-btn {
    background: rgba(139, 92, 246, 0.15) !important;
    border: 1px solid rgba(139, 92, 246, 0.3) !important;
    color: #2f5d8f !important;
}
.cost-item .details-btn:hover,
.cost-grid .details-btn:hover {
    background: rgba(139, 92, 246, 0.25) !important;
}
/* Survey likely tag - amber/warning color */
.survey-likely-tag {
    background: rgba(180,83,9, 0.15) !important;
    color: #b45309 !important;
    border: 1px solid rgba(180,83,9, 0.3) !important;
}

/* Overall Dims label */
.permit-dims-compact .overall-dims-label {
    color: #5b6875 !important;
    font-size: 10px !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em;
    margin-right: 4px;
}


/* ========== TRUCK CARDS DARK THEME ========== */
body .truck-groups,
body #truckGroups {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)) !important;
    gap: 16px !important;
}

body .truck-group {
    background: rgba(255,253,248, 0.7) !important;
    border: 1px solid rgba(100, 116, 139, 0.3) !important;
    border-radius: 10px !important;
    overflow: hidden !important;
}

body .truck-group .truck-header {
    background: rgba(255,253,248, 0.9) !important;
    padding: 10px 14px !important;
    border-bottom: 1px solid rgba(100, 116, 139, 0.2) !important;
}

body .truck-group .truck-header h4 {
    color: #1c2733 !important;
    font-size: 14px !important;
    margin: 0 !important;
}

body .truck-group .truck-remove {
    color: rgba(185,28,28, 0.7) !important;
    font-size: 18px !important;
}

body .truck-group .truck-remove:hover {
    color: #b91c1c !important;
}

body .truck-group .truck-drop-zone {
    background: rgba(28,39,51, 0.4) !important;
    border: 1px dashed rgba(100, 116, 139, 0.2) !important;
    border-radius: 6px !important;
    margin: 8px !important;
    padding: 6px !important;
    min-height: 50px !important;
    gap: 4px !important;
}

body .truck-group .truck-drop-zone .empty-hint {
    color: #45525f !important;
    font-size: 12px !important;
}

/* Pieces inside truck - compact */
body .truck-group .draggable-piece {
    padding: 4px 8px !important;
    font-size: 11px !important;
    gap: 6px !important;
    background: rgba(255,253,248, 0.9) !important;
    border: 1px solid rgba(100, 116, 139, 0.25) !important;
}

body .truck-group .draggable-piece .piece-name,
body .truck-group .draggable-piece .piece-num-badge {
    color: #1c2733 !important;
}

body .truck-group .draggable-piece .piece-dims {
    color: #5b6875 !important;
    font-size: 11px !important;
}

body .truck-group .draggable-piece .piece-weight {
    color: #5b6875 !important;
    font-size: 11px !important;
}

/* Truck footer / stats - compact */
body .truck-group .truck-footer {
    background: transparent !important;
    border-top: 1px solid rgba(100, 116, 139, 0.15) !important;
    padding: 8px 14px !important;
    gap: 8px 16px !important;
    font-size: 12px !important;
}

body .truck-group .truck-stat {
    font-size: 12px !important;
    gap: 4px !important;
}

body .truck-group .truck-stat .label {
    color: #5b6875 !important;
    font-size: 11px !important;
}

body .truck-group .truck-stat .value {
    color: #1c2733 !important;
    font-weight: 600 !important;
    font-size: 12px !important;
}

body .truck-group .truck-stat .value.weight-ok,
body .truck-group .truck-stat .value.height-ok {
    color: #15803d !important;
}

body .truck-group .truck-stat .value.weight-warning,
body .truck-group .truck-stat .value.height-warning {
    color: #b91c1c !important;
}

/* Overall dims - compact single line */
body .truck-group .truck-overall-dims {
    width: 100% !important;
    font-size: 11px !important;
}

body .truck-group .truck-overall-dims .value {
    font-size: 11px !important;
    font-weight: 500 !important;
    letter-spacing: -0.02em !important;
}

/* Trailer select in truck */
body .truck-group .truck-trailer-select {
    width: 100% !important;
    margin-top: 4px !important;
}

body .truck-group .truck-trailer-select select {
    background: rgba(28,39,51, 0.6) !important;
    border: 1px solid rgba(100, 116, 139, 0.3) !important;
    border-radius: 6px !important;
    color: #1c2733 !important;
    padding: 6px 10px !important;
    font-size: 12px !important;
}

body .truck-group .trailer-recommended {
    color: #15803d !important;
    font-size: 11px !important;
}

/* OD badge */
body .truck-group .od-badge {
    background: rgba(180,83,9, 0.2) !important;
    color: #b45309 !important;
    font-size: 10px !important;
    padding: 2px 6px !important;
    border-radius: 4px !important;
    font-weight: 700 !important;
    margin-left: 8px !important;
}

/* W and H flag badges */
body .truck-group .flag-badge,
body .truck-group .dim-flag {
    font-size: 9px !important;
    padding: 1px 4px !important;
    border-radius: 2px !important;
    font-weight: 700 !important;
}

/* Truck visualization - compact */
body .truck-group .truck-viz {
    margin: 4px 8px !important;
    max-height: 60px !important;
}

/* Fit warning */
body .truck-group .fit-warning {
    color: #b45309 !important;
    font-size: 11px !important;
    padding: 4px 14px 8px !important;
}


/* ========== GLOBAL NUMBER INPUT SPINNER REMOVAL ========== */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none !important;
    margin: 0 !important;
}
input[type="number"] {
    -moz-appearance: textfield !important;
}

/* ========== WIDER DIM INPUTS ========== */
.ft-in-input input[type="number"] {
    min-width: 50px !important;
    width: 50px !important;
}
.weight-input input[type="number"] {
    min-width: 90px !important;
}

/* ========== HIDE PIECE LABEL WHEN EMPTY ========== */
.current-piece-label:empty {
    display: none !important;
}
.current-piece-label {
    background: rgba(47,93,143, 0.15) !important;
    color: #2f5d8f !important;
    font-size: 12px !important;
    padding: 2px 8px !important;
    border-radius: 8px !important;
}

/* ========== PERMIT RESULTS - NO DUPLICATE HEADER ========== */
.permit-results-section > h3 {
    display: none !important;
}


/* ========== FIX: Lane field overflow ========== */
.lane-row {
    overflow: hidden !important;
}
.lane-field {
    overflow: hidden !important;
    min-width: 0 !important;
}
.lane-field input {
    box-sizing: border-box !important;
    max-width: 100% !important;
}

/* ==================== HOME PAGE — FREIGHTDECK IDENTITY ==================== */
.home-page {
    max-width: 820px;
    margin: 0 auto;
    padding: 48px 24px 40px;
    position: relative;
}
.home-bg-pattern {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image: radial-gradient(rgba(47,93,143,0.03) 1px, transparent 1px);
    background-size: 28px 28px;
    pointer-events: none;
    z-index: 0;
}
.home-page > * { position: relative; z-index: 1; }

.home-header {
    text-align: center;
    margin-bottom: 36px;
}
.home-broker-badge {
    display: inline-block;
    padding: 5px 16px;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: #2f5d8f;
    border: 1px solid rgba(47,93,143,0.2);
    border-radius: 20px;
    background: rgba(47,93,143,0.06);
    margin-bottom: 18px;
}
.home-title {
    font-size: 2.8rem;
    font-weight: 800;
    color: #1c2733;
    margin: 0 0 12px;
    letter-spacing: -1.5px;
}
.home-title-accent {
    background: linear-gradient(135deg, #2f5d8f 0%, #2f5d8f 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.home-subtitle {
    font-size: 1.05rem;
    color: #5b6875;
    margin: 0 auto;
    line-height: 1.65;
    max-width: 460px;
}

/* Hero Rate Check Card */
.home-hero-card {
    display: flex;
    align-items: center;
    gap: 28px;
    background: linear-gradient(135deg, rgba(37,99,235,0.06) 0%, rgba(6,182,212,0.03) 100%);
    border: 1px solid rgba(47,93,143,0.15);
    border-radius: 16px;
    padding: 28px 32px;
    margin-bottom: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
}
.home-hero-card:hover {
    border-color: rgba(47,93,143,0.3);
    background: linear-gradient(135deg, rgba(37,99,235,0.1) 0%, rgba(6,182,212,0.05) 100%);
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(37,99,235,0.08);
}
.home-hero-content { flex: 1; }
.home-hero-badge {
    display: inline-block;
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #2f5d8f;
    background: rgba(6,182,212,0.1);
    padding: 3px 10px;
    border-radius: 4px;
    margin-bottom: 10px;
}
.home-hero-content h2 {
    font-size: 1.3rem;
    font-weight: 700;
    color: #1c2733;
    margin: 0 0 8px;
}
.home-hero-content p {
    font-size: 0.875rem;
    color: #5b6875;
    line-height: 1.55;
    margin: 0 0 14px;
}
.home-hero-cta {
    font-size: 0.85rem;
    font-weight: 600;
    color: #2f5d8f;
    transition: color 0.2s;
}
.home-hero-card:hover .home-hero-cta { color: #2f5d8f; }
.home-hero-preview {
    flex: 0 0 220px;
    background: rgba(28,39,51,0.8);
    border: 1px solid rgba(237,234,226,0.5);
    border-radius: 12px;
    padding: 18px 20px;
    text-align: center;
}
.hero-preview-lane {
    font-size: 0.78rem;
    color: #1c2733;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.hero-dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; margin-right: 4px; }
.hero-dot-o { background: #15803d; }
.hero-dot-d { background: #b91c1c; }
.hero-preview-rate {
    font-size: 1.7rem;
    font-weight: 800;
    color: #1c2733;
    letter-spacing: -0.5px;
}
.hero-preview-detail {
    font-size: 0.72rem;
    color: #5b6875;
    margin-top: 3px;
}

/* Tool Cards — horizontal layout */
.home-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}
.home-card {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    background: rgba(255,253,248, 0.35);
    border: 1px solid rgba(237,234,226, 0.35);
    border-radius: 12px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.25s ease;
}
.home-card:hover {
    border-color: rgba(6,182,212,0.2);
    background: rgba(255,253,248, 0.6);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}
.home-card-icon {
    width: 38px;
    height: 38px;
    min-width: 38px;
    border-radius: 9px;
    background: rgba(6,182,212,0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #2f5d8f;
    transition: background 0.25s ease;
}
.home-card:hover .home-card-icon { background: rgba(6,182,212,0.14); }
.home-card-text h3 {
    font-size: 0.88rem;
    font-weight: 600;
    color: #1c2733;
    margin: 0 0 4px;
}
.home-card-text p {
    font-size: 0.78rem;
    color: #5b6875;
    line-height: 1.45;
    margin: 0;
}
.home-card-ai { grid-column: 1 / -1; }
.home-card-ai .home-card-icon {
    background: rgba(47,93,143,0.1);
    color: #2f5d8f;
}
.home-ai-tag {
    display: inline-block;
    font-size: 0.55rem;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 3px;
    background: rgba(47,93,143,0.15);
    color: #2f5d8f;
    vertical-align: middle;
    margin-left: 4px;
    letter-spacing: 0.5px;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .home-page { padding: 24px 16px; }
    .home-title { font-size: 2rem; }
    .home-hero-card { flex-direction: column; gap: 16px; padding: 20px; }
    .home-hero-preview { flex: none; width: 100%; }
    .home-cards { grid-template-columns: 1fr; }
}

/* ==================== PERMIT DIMS COMPACT (one-line layout) ==================== */

.permit-dims-compact {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 16px 20px;
    background: rgba(28,39,51, 0.6);
    border: 1px solid rgba(237,234,226, 0.5);
    border-radius: 10px;
    margin-bottom: 16px;
}

.overall-dims-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #5b6875;
    margin-right: 4px;
}

.trailer-tag {
    display: inline-block;
    padding: 4px 12px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, #2f5d8f, #2f5d8f);
    border-radius: 20px;
    white-space: nowrap;
}

.dim-tag {
    display: inline-block;
    padding: 4px 10px;
    font-size: 0.85rem;
    font-weight: 500;
    color: #1c2733;
    background: rgba(255,253,248, 0.8);
    border: 1px solid rgba(237,234,226, 0.6);
    border-radius: 6px;
    white-space: nowrap;
}

.dim-tag.od {
    color: #b45309;
    border-color: rgba(180,83,9, 0.4);
    background: rgba(180,83,9, 0.1);
    font-weight: 600;
}

/* ==================== SUPERLOAD WARNING BANNER ==================== */

.superload-banner {
    background: linear-gradient(135deg, rgba(220, 38, 38, 0.15), rgba(251, 146, 60, 0.1));
    border: 1px solid rgba(220, 38, 38, 0.4);
    border-left: 4px solid #b91c1c;
    border-radius: 10px;
    padding: 16px 20px;
    margin-bottom: 16px;
}

.superload-banner-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
    font-weight: 700;
    color: #b91c1c;
    margin-bottom: 8px;
}

.superload-banner-items {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.superload-banner-item {
    font-size: 0.85rem;
    color: #b91c1c;
    line-height: 1.4;
    padding-left: 4px;
}

.superload-banner-item strong {
    color: #b45309;
}

.superload-banner-note {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(220, 38, 38, 0.2);
    font-size: 0.8rem;
    color: #5b6875;
    font-style: italic;
}

/* ==================== CITY AUTOCOMPLETE DROPDOWN ==================== */

.location-input-wrapper {
    position: relative;
}

.city-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1000;
    background: #fffdf8;
    border: 1px solid rgba(237,234,226, 0.8);
    border-top: none;
    border-radius: 0 0 8px 8px;
    max-height: 200px;
    overflow-y: auto;
    display: none;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.city-suggestions.active {
    display: block;
}

.city-suggestion-item {
    padding: 10px 14px;
    font-size: 0.85rem;
    color: #1c2733;
    cursor: pointer;
    border-bottom: 1px solid rgba(237,234,226, 0.3);
    transition: background 0.15s;
}

.city-suggestion-item:hover,
.city-suggestion-item.highlighted {
    background: rgba(6, 182, 212, 0.1);
    color: #fff;
}

.city-suggestion-item:last-child {
    border-bottom: none;
}

.city-suggestion-state {
    color: #5b6875;
    font-size: 0.75rem;
    margin-left: 4px;
}

@media (max-width: 640px) {
    .permit-dims-compact {
        gap: 6px;
        padding: 12px 14px;
    }
    .dim-tag, .trailer-tag {
        font-size: 0.75rem;
        padding: 3px 8px;
    }
}

/* ==================== MY QUOTES TAB ==================== */
.quotes-container { max-width: 1400px; margin: 0 auto; padding: 20px; }
.quotes-title { font-size: 0.78rem; font-weight: 700; color: #5b6875; margin: 0 0 16px; text-transform: uppercase; letter-spacing: 0.12em; border-left: 3px solid #2f5d8f; padding-left: 10px; line-height: 1.1; }

.nav-tabs { display: flex; gap: 8px; margin-bottom: 20px; }
.quotes-nav-tab { padding: 7px 16px; background: transparent; border: none; border-radius: 7px; color: #5b6875; font-weight: 600; font-size: 0.8rem; cursor: pointer; transition: all 0.15s; }
.quotes-nav-tab.active { background: linear-gradient(135deg, #2f5d8f, #2f5d8f); color: #fff; box-shadow: 0 1px 6px rgba(47,93,143,0.3); }
.quotes-nav-tab:hover:not(.active) { background: rgba(28,39,51,0.05); color: #1c2733; }

.quotes-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); gap: 10px; margin-bottom: 20px; }
.quotes-stat-card { background: #f4f1ea; border: 1px solid rgba(28,39,51,0.1); border-radius: 14px; padding: 16px; text-align: center; min-height: 90px; display: flex; flex-direction: column; justify-content: center; }
.quotes-stat-value { font-size: 1.9rem; font-weight: 700; color: #1c2733; letter-spacing: -0.01em; line-height: 1; }
.quotes-stat-value.quotes-won { color: #15803d; }
.quotes-stat-value.quotes-lost { color: #b91c1c; }
.quotes-stat-label { font-size: 0.66rem; color: #5b6875; text-transform: uppercase; letter-spacing: 0.1em; margin-top: 8px; font-weight: 600; }

.quotes-search-section { background: #f4f1ea; border: 1px solid rgba(28,39,51,0.1); border-radius: 14px; padding: 18px; margin-bottom: 14px; }
.quotes-search-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.quotes-search-group { display: flex; flex-direction: column; gap: 4px; }
.quotes-search-group label { font-size: 0.66rem; color: #5b6875; font-weight: 600; text-transform: uppercase; letter-spacing: 0.07em; }
.quotes-search-group input, .quotes-search-group select { padding: 9px 12px; border: 1px solid rgba(28,39,51,0.1); border-radius: 8px; min-width: 170px; background: #f4f1ea; color: #1c2733; font-size: 0.85rem; }
.quotes-search-group input::placeholder { color: #45525f; }
.quotes-search-btn { padding: 9px 20px; background: linear-gradient(135deg, #2f5d8f, #2f5d8f); color: #fff; border: none; border-radius: 8px; cursor: pointer; font-weight: 600; transition: all 0.15s; }
.quotes-search-btn:hover { background: linear-gradient(135deg, #5aa8ff, #4a90f0); box-shadow: 0 2px 10px rgba(47,93,143,0.3); }
.quotes-clear-btn { padding: 9px 16px; background: transparent; border: 1px solid rgba(28,39,51,0.15); border-radius: 8px; cursor: pointer; color: #5b6875; transition: all 0.15s; }
.quotes-clear-btn:hover { border-color: rgba(28,39,51,0.3); color: #1c2733; background: rgba(28,39,51,0.05); }

.quotes-filters { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; align-items: flex-end; background: #f4f1ea; border: 1px solid rgba(28,39,51,0.1); border-radius: 14px; padding: 14px 16px; }
.quotes-filter-group { display: flex; flex-direction: column; gap: 4px; }
.quotes-filter-group label { font-size: 0.66rem; color: #5b6875; font-weight: 600; text-transform: uppercase; letter-spacing: 0.07em; }
.quotes-filter-group select, .quotes-filter-group input { padding: 8px 10px; border: 1px solid rgba(28,39,51,0.1); border-radius: 8px; min-width: 110px; background: #f4f1ea; color: #1c2733; font-size: 0.8rem; }
.quotes-filter-group input::placeholder { color: #45525f; }

.quotes-table-wrap { overflow-x: auto; border-radius: 14px; border: 1px solid rgba(28,39,51,0.1); }
.quotes-table { width: 100%; border-collapse: collapse; min-width: 1100px; }
.quotes-table th { background: #f4f1ea; padding: 11px 10px; text-align: left; font-weight: 600; font-size: 0.7rem; color: #5b6875; white-space: nowrap; text-transform: uppercase; letter-spacing: 0.06em; }
.quotes-table th.sortable { cursor: pointer; user-select: none; }
.quotes-table th.sortable:hover { background: rgba(28,39,51,0.04); color: #1c2733; }
.quotes-table th .sort-icon { margin-left: 3px; opacity: 0.4; font-size: 10px; }
.quotes-table th.sorted .sort-icon { opacity: 1; color: #2f5d8f; }
.quotes-table td { padding: 9px 10px; border-bottom: 1px solid rgba(28,39,51,0.05); font-size: 0.82rem; color: #1c2733; }
.quotes-table tbody tr:hover { background: rgba(28,39,51,0.025); }
.quotes-table .empty-state { text-align: center; padding: 48px 40px; color: #5b6875; font-size: 0.9rem; }

.status-badge { padding: 3px 10px; border-radius: 20px; font-size: 0.65rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.3px; }
.status-badge.pending { background: rgba(180,83,9, 0.15); color: #b45309; border: 1px solid rgba(180,83,9, 0.3); }
.status-badge.won { background: rgba(52, 211, 153, 0.15); color: #15803d; border: 1px solid rgba(52, 211, 153, 0.3); }
.status-badge.lost { background: rgba(185,28,28, 0.15); color: #b91c1c; border: 1px solid rgba(185,28,28, 0.3); }

.action-btn { width: 28px; height: 28px; border: none; border-radius: 6px; cursor: pointer; margin-right: 4px; font-size: 12px; transition: all 0.15s; }
.action-btn.win { background: rgba(52, 211, 153, 0.15); color: #15803d; border: 1px solid rgba(52, 211, 153, 0.3); }
.action-btn.win:hover { background: rgba(52, 211, 153, 0.3); }
.action-btn.lose { background: rgba(185,28,28, 0.15); color: #b91c1c; border: 1px solid rgba(185,28,28, 0.3); }
.action-btn.lose:hover { background: rgba(185,28,28, 0.3); }
.action-btn.edit { background: rgba(47,93,143, 0.15); color: #2f5d8f; border: 1px solid rgba(47,93,143, 0.3); }
.action-btn.edit:hover { background: rgba(47,93,143, 0.3); }
.action-btn.delete { background: rgba(100, 116, 139, 0.15); color: #5b6875; border: 1px solid rgba(100, 116, 139, 0.3); }
.action-btn.delete:hover { background: rgba(185,28,28, 0.2); color: #b91c1c; border-color: rgba(185,28,28, 0.3); }

.user-name { font-size: 0.7rem; color: #5b6875; }
.distance-badge { font-size: 0.65rem; color: #2f5d8f; margin-left: 4px; }

/* Quotes Modals */
.quotes-modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.6); backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; z-index: 1000; }
.quotes-modal-box { background: #fffdf8; border: 1px solid rgba(237,234,226, 0.8); border-radius: 14px; padding: 24px; width: 90%; max-width: 400px; box-shadow: 0 20px 60px rgba(0,0,0,0.5); }
.quotes-modal-box h3 { margin: 0 0 12px; color: #1c2733; font-size: 1.1rem; }
.quotes-modal-box p { margin: 0 0 12px; color: #5b6875; font-size: 0.85rem; }
.quotes-modal-box label { display: block; font-size: 0.75rem; color: #5b6875; margin: 14px 0 6px; font-weight: 500; }
.quotes-modal-box input, .quotes-modal-box select { width: 100%; padding: 10px 12px; border: 1px solid rgba(237,234,226, 0.5); border-radius: 8px; font-size: 0.85rem; background: rgba(247,244,236,0.95); color: #1c2733; box-sizing: border-box; }
.quotes-modal-btns { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }
.quotes-modal-cancel { padding: 8px 16px; background: transparent; border: 1px solid rgba(237,234,226, 0.5); border-radius: 8px; color: #5b6875; cursor: pointer; }
.quotes-modal-cancel:hover { border-color: #c9c2b2; }
.quotes-modal-confirm { padding: 8px 16px; background: rgba(6, 182, 212, 0.15); border: 1px solid rgba(6, 182, 212, 0.4); border-radius: 8px; color: #2f5d8f; cursor: pointer; font-weight: 500; }
.quotes-modal-confirm:hover { background: rgba(6, 182, 212, 0.25); }
.quotes-modal-danger { background: rgba(185,28,28, 0.15); border-color: rgba(185,28,28, 0.4); color: #b91c1c; }
.quotes-modal-danger:hover { background: rgba(185,28,28, 0.25); }
.quotes-warning-text { color: #b91c1c !important; font-weight: 500; }

@media (max-width: 640px) {
    .quotes-stats { grid-template-columns: repeat(3, 1fr); }
    .quotes-search-row { flex-direction: column; }
    .quotes-search-group input { min-width: auto; width: 100%; }
    .quotes-filters { flex-direction: column; }
}

/* ==================== DIMENSION WARNINGS v2 ==================== */
.dim-warnings { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.dim-warnings:empty { display: none; }

.dim-warning {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 12px; border-radius: 8px;
    font-size: 0.82rem; cursor: pointer;
    animation: dimWarnIn 0.25s ease;
    transition: background 0.15s;
}
@keyframes dimWarnIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }

.dim-warning.warn {
    background: rgba(180,83,9, 0.08);
    border: 1px solid rgba(180,83,9, 0.25);
    color: #b45309;
}
.dim-warning.warn:hover { background: rgba(180,83,9, 0.14); }
.dim-warning.block {
    background: rgba(185,28,28, 0.1);
    border: 1px solid rgba(185,28,28, 0.35);
    color: #b91c1c;
}
.dim-warning.block:hover { background: rgba(185,28,28, 0.16); }
.dim-warning.caution {
    background: rgba(249, 115, 22, 0.08);
    border: 1px solid rgba(249, 115, 22, 0.3);
    color: #b45309;
}
.dim-warning.caution:hover { background: rgba(249, 115, 22, 0.14); }

.dim-caution-banner {
    margin-top: 12px; padding: 14px 16px;
    background: rgba(249, 115, 22, 0.08);
    border: 1px solid rgba(249, 115, 22, 0.3);
    border-radius: 10px;
    text-align: center; color: #b45309;
    font-size: 0.85rem; line-height: 1.55;
}
.dim-caution-banner strong { display: block; margin-bottom: 4px; font-size: 0.9rem; color: #b45309; }

.dim-warning-icon { flex-shrink: 0; color: inherit; }
.dim-warning-label { flex: 1; font-weight: 600; }

.dim-blocked-banner {
    margin-top: 12px; padding: 14px 16px;
    background: rgba(185,28,28, 0.08);
    border: 1px solid rgba(185,28,28, 0.3);
    border-radius: 10px;
    text-align: center; color: #b91c1c;
    font-size: 0.85rem; line-height: 1.55;
}
.dim-blocked-banner strong { display: block; margin-bottom: 4px; font-size: 0.9rem; }

/* Warning detail popout */
.dim-warning-popout {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.6); backdrop-filter: blur(4px);
    display: flex; align-items: center; justify-content: center;
    z-index: 1100;
    animation: dimWarnIn 0.2s ease;
}
.dim-warning-popout-box {
    background: #fffdf8; border: 1px solid rgba(237,234,226, 0.8);
    border-radius: 14px; padding: 24px 28px;
    width: 90%; max-width: 520px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    max-height: 80vh; overflow-y: auto;
}
.dim-warning-popout-box h3 { color: #1c2733; margin: 0 0 14px; font-size: 1.1rem; }
.dim-warning-popout-box p { color: #5b6875; font-size: 0.85rem; line-height: 1.65; margin: 0 0 12px; }
.dim-warning-popout-box ul { color: #5b6875; font-size: 0.85rem; line-height: 1.65; margin: 0 0 12px; padding-left: 20px; }
.dim-warning-popout-box li { margin-bottom: 6px; }
.dim-warning-popout-box .hl-warn { color: #b45309; font-weight: 600; }
.dim-warning-popout-box .hl-block { color: #b91c1c; font-weight: 600; }
.dim-warning-popout-close {
    display: block; margin: 18px auto 0; padding: 8px 24px;
    background: rgba(237,234,226, 0.5); border: 1px solid rgba(237,234,226, 0.8);
    border-radius: 8px; color: #1c2733; cursor: pointer; font-size: 0.85rem;
}
.dim-warning-popout-close:hover { background: rgba(237,234,226, 0.8); }

/* Field validation error state */
.permit-field-error {
    border-color: rgba(185,28,28, 0.6) !important;
    box-shadow: 0 0 0 2px rgba(185,28,28, 0.15) !important;
}
.permit-field-error:focus {
    border-color: rgba(185,28,28, 0.8) !important;
    box-shadow: 0 0 0 3px rgba(185,28,28, 0.2) !important;
}

/* One-line dims layout */
.permit-dims-oneline {
    flex-wrap: wrap !important;
    gap: 6px !important;
    padding: 10px 14px !important;
    justify-content: center !important;
    width: 100% !important;
    max-width: 600px !important;
}
.permit-dims-oneline .trailer-tag {
    font-size: 0.72rem;
    padding: 3px 10px;
}
.permit-dims-oneline .dim-tag {
    font-size: 0.78rem;
    padding: 3px 8px;
    min-width: 0;
}
@media (max-width: 640px) {
    .permit-dims-oneline .trailer-tag {
        font-size: 0.65rem;
        padding: 2px 8px;
    }
    .permit-dims-oneline .dim-tag {
        font-size: 0.7rem;
        padding: 2px 6px;
    }
}

/* Dims preview under trailer type */
.dims-preview {
    display: inline;
    white-space: nowrap;
    font-size: 0.72rem;
    color: #5b6875;
    margin-top: 0;
    letter-spacing: 0.3px;
}
.dims-preview:empty { display: none; }
.dims-preview .dim-od {
    color: #b45309;
    font-weight: 600;
}
#deckHeight {
    cursor: pointer;
    border-bottom: 1px dashed rgba(100, 116, 139, 0.5);
    padding-bottom: 1px;
}
#deckHeight:hover {
    color: #2f5d8f;
    border-bottom-color: #2f5d8f;
}

/* Deck height edit icon - show on hover */
.deck-edit-icon {
    opacity: 0;
    margin-left: 3px;
    vertical-align: middle;
    transition: opacity 0.15s;
}
#deckHeight:hover .deck-edit-icon {
    opacity: 0.6;
}

/* Escort cost breakdown */
.escort-cost-breakdown { margin-top: 4px; }
.escort-cost-line {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 0; border-bottom: 1px solid rgba(237,234,226,0.3);
    font-size: 0.82rem;
}
.escort-cost-label { color: #1c2733; font-weight: 600; min-width: 100px; }
.escort-cost-calc { color: #5b6875; flex: 1; font-size: 0.78rem; }
.escort-cost-amt { color: #2f5d8f; font-weight: 600; font-size: 0.85rem; }
.escort-cost-note {
    font-size: 0.75rem; color: #5b6875; font-style: italic;
    padding: 6px 0;
}
.escort-cost-total {
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px 0 4px; margin-top: 4px;
    border-top: 1px solid rgba(237,234,226,0.6);
    font-weight: 700; font-size: 0.9rem;
    color: #1c2733;
}
.escort-cost-total span:last-child { color: #2f5d8f; font-size: 1rem; }

/* City autocomplete dropdown items */
.ac-item:hover {
    background: #edeae2 !important;
}

/* ==================== PERMIT TYPE TAGS (OS/OW) ==================== */
.permit-type-tag {
    display: inline-block;
    padding: 2px 8px;
    font-size: 0.72rem;
    font-weight: 700;
    border-radius: 4px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    vertical-align: middle;
}
.os-tag {
    color: #b45309;
    background: rgba(180,83,9, 0.15);
    border: 1px solid rgba(180,83,9, 0.4);
}
.ow-tag {
    color: #b91c1c;
    background: rgba(185,28,28, 0.15);
    border: 1px solid rgba(185,28,28, 0.4);
}

/* ==================== PERMIT LANE VALIDATION ==================== */
.permit-lane-validation {
    font-size: 0.75rem;
    margin-top: 4px;
    min-height: 16px;
    transition: color 0.2s;
}
.permit-lane-validation.valid {
    color: #15803d;
}
.permit-lane-validation.error {
    color: #b91c1c;
}

/* Load Builder 3D View Link */
.truck-3d-link {
    padding: 6px 15px;
    text-align: center;
    border-top: 1px dashed #d8d2c4;
}
.truck-3d-link a {
    color: #2f5d8f;
    text-decoration: none;
    font-weight: 600;
    font-size: 12px;
    padding: 4px 14px;
    border: 1px solid #2f5d8f;
    border-radius: 6px;
    transition: all 0.2s;
    display: inline-block;
}
.truck-3d-link a:hover {
    background: #2f5d8f;
    color: #fff;
}


/* ==================== TRUCK BUILDER ==================== */
.tb-section {
    padding: 28px; max-width: 1100px; margin: 0 auto;
    background: #f7f4ec; border: 1px solid rgba(28,39,51,0.08);
    border-radius: 16px; box-shadow: 0 8px 30px rgba(0,0,0,0.28);
}
/* Brand-blue primary CTA, scoped to TB (global .btn-primary is a navy gradient) */
.tb-section .btn-primary {
    background: linear-gradient(135deg,#2f5d8f,#2f5d8f); color: #fff;
    box-shadow: 0 2px 10px rgba(47,93,143,0.25);
}
.tb-section .btn-primary:hover { background: linear-gradient(135deg,#5aa8ff,#4a90f0); }
.tb-section .btn-primary:disabled {
    background: #f7f4ec; color: #5b6875; box-shadow: none; cursor: not-allowed; transform: none;
}
/* Switch to cm/kg ghost pill */
.tb-cmkg-pill {
    background: transparent; border: 1px solid rgba(28,39,51,0.2);
    color: #5b6875; font-size: 10px; font-weight: 600; text-transform: uppercase;
    letter-spacing: 0.04em; padding: 3px 10px; border-radius: 999px; cursor: pointer;
    transition: all 0.15s ease;
}
.tb-cmkg-pill:hover { color: #fff; border-color: rgba(28,39,51,0.4); }

/* Stepper */
.tb-stepper {
    display: flex; align-items: center; justify-content: center;
    gap: 0; margin-bottom: 28px; padding: 16px 0;
}
.tb-step-indicator {
    display: flex; align-items: center; gap: 10px; opacity: 0.45;
    transition: opacity 0.3s;
}
.tb-step-indicator.active { opacity: 1; }
.tb-step-indicator.completed { opacity: 0.85; }
.tb-step-num {
    width: 32px; height: 32px; border-radius: 50%;
    background: #fffdf8; color: #5b6875; border: 1px solid rgba(28,39,51,0.12);
    display: flex; align-items: center; justify-content: center;
    font-family: 'Oswald',sans-serif; font-size: 15px; font-weight: 600;
    transition: all 0.25s ease;
}
.tb-step-indicator.active .tb-step-num {
    background: linear-gradient(135deg,#2f5d8f,#2f5d8f); color: #fff;
    border-color: transparent; box-shadow: 0 3px 12px rgba(47,93,143,0.45);
}
.tb-step-indicator.completed .tb-step-num {
    background: rgba(47,93,143,0.15); color: #2f5d8f; border-color: rgba(47,93,143,0.4);
}
.tb-step-label { font-family: 'Oswald',sans-serif; font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: #5b6875; white-space: nowrap; }
.tb-step-indicator.active .tb-step-label { color: #1c2733; font-weight: 600; }
.tb-step-connector {
    width: 56px; height: 2px; background: rgba(28,39,51,0.1);
    margin: 0 14px; flex-shrink: 0;
}

/* Steps */
.tb-step { animation: fadeIn 0.2s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* Upload Area */
.tb-upload-area {
    margin-bottom: 20px; border: 2px dashed rgba(47,93,143,0.4);
    border-radius: 14px; overflow: hidden; background: #f4f1ea;
    transition: border-color 0.2s, background 0.2s;
}
.tb-upload-area:hover { border-color: rgba(47,93,143,0.7); }
.tb-paste-target {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 6px; padding: 28px; cursor: pointer; color: #5b6875;
    transition: background 0.2s, border-color 0.2s;
}
.tb-paste-target:hover { background: rgba(47,93,143,0.04); }
.tb-paste-target.drag-over { background: rgba(47,93,143,0.1); }
.tb-paste-target svg { color: #2f5d8f; opacity: 0.7 !important; }
.tb-paste-target span { font-size: 14px; color: #1c2733; }
.tb-upload-hint { font-size: 11px; color: #5b6875; opacity: 1; }
.tb-upload-preview { padding: 16px; text-align: center; }
.tb-upload-preview img { max-width: 100%; max-height: 200px; border-radius: 8px; margin-bottom: 12px; }
.tb-upload-actions { display: flex; gap: 8px; justify-content: center; }
.tb-ocr-status {
    margin-top: 10px; padding: 8px 12px; border-radius: 6px; font-size: 13px;
}
.tb-ocr-status.loading {
    background: rgba(47,93,143,0.15); color: #2f5d8f;
    position: relative; padding-left: 38px;
    animation: tb-loading-pulse 1.6s ease-in-out infinite;
}
.tb-ocr-status.loading::before {
    content: ''; position: absolute; left: 12px; top: 50%; margin-top: -8px;
    width: 16px; height: 16px;
    border: 2px solid rgba(47,93,143,0.3);
    border-top-color: #2f5d8f;
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
}
@keyframes tb-loading-pulse {
    0%, 100% { background: rgba(47,93,143,0.12); }
    50%      { background: rgba(47,93,143,0.24); }
}
.tb-ocr-status.success { background: rgba(21,128,61,0.15); color: #15803d; }
.tb-ocr-status.error { background: rgba(185,28,28,0.15); color: #b91c1c; }

/* Manual Entry */
.tb-manual-entry { margin-bottom: 20px; }
.tb-manual-entry h4 {
    margin: 0 0 12px; font-family: 'Oswald',sans-serif; font-size: 13px; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.08em; color: #1c2733;
    border-left: 3px solid #2f5d8f; padding-left: 10px; line-height: 1.1;
}
.tb-add-row {
    display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.tb-add-row input[type="number"] { width: 64px; }
.tb-add-row input[type="text"] { width: 120px; }
.tb-name-input { flex: 0 0 120px; }
.tb-weight-input { width: 80px !important; }
.tb-qty-input { width: 48px !important; }
.tb-x { color: #5b6875; font-size: 14px; }
.tb-stack-check { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--text-secondary, #5b6875); white-space: nowrap; cursor: pointer; }
.tb-stack-check input { margin: 0; accent-color: #2f5d8f; }
.tb-input-hint { font-size: 11px; color: var(--text-secondary, #5b6875); margin-top: 6px; }

.tb-add-row input {
    background: #f4f1ea; border: 1px solid rgba(28,39,51,0.1);
    color: #1c2733; padding: 8px 10px; border-radius: 8px; font-size: 13px;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.tb-add-row input::placeholder { color: #5a6675; }
.tb-add-row input:focus { border-color: #2f5d8f; outline: none; box-shadow: 0 0 0 3px rgba(47,93,143,0.15); }

/* Items Table */
.tb-items-section { margin-bottom: 20px; }
.tb-items-header {
    display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px;
}
.tb-items-header span {
    font-family: 'Oswald',sans-serif; font-size: 12px; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.07em; color: #1c2733;
    border-left: 3px solid #2f5d8f; padding-left: 10px;
}
.tb-clear-btn {
    background: none; border: none; color: #e06b6b; font-size: 11px; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.04em; cursor: pointer;
    padding: 3px 8px; border-radius: 6px;
}
.tb-clear-btn:hover { background: rgba(185,28,28,0.12); }
.tb-items-scroll { max-height: 300px; overflow-y: auto; }
.tb-table {
    width: 100%; border-collapse: collapse; font-size: 13px;
}
.tb-table th {
    text-align: left; padding: 8px 10px; font-size: 10px; text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #5b6875; border-bottom: 1px solid rgba(28,39,51,0.1);
    position: sticky; top: 0; background: #f4f1ea; z-index: 1;
}
.tb-table td {
    padding: 8px 10px; border-bottom: 1px solid rgba(28,39,51,0.05);
    color: #e6eaf0;
}
.tb-table tbody tr:hover { background: rgba(28,39,51,0.02); }
.tb-table td.tb-empty {
    text-align: center; padding: 28px; color: #5b6875; font-style: italic;
}
.tb-table .tb-edit-cell input {
    width: 64px; background: transparent; border: 1px solid transparent; color: inherit;
    padding: 2px 4px; border-radius: 3px; font-size: 13px;
}
.tb-table .tb-edit-cell input:hover { border-color: var(--border-primary, #d8d2c4); }
.tb-table .tb-edit-cell input:focus { border-color: #2f5d8f; outline: none; background: var(--bg-secondary, #fffdf8); }
.tb-remove-item {
    background: none; border: none; color: #b91c1c; cursor: pointer; font-size: 16px;
    padding: 0 4px; opacity: 0.5;
}
.tb-remove-item:hover { opacity: 1; }

/* Step Actions */
.tb-step-actions {
    display: flex; justify-content: space-between; align-items: center;
    padding-top: 20px; border-top: 1px solid rgba(28,39,51,0.08);
    margin-top: 20px;
}

/* Step 2: Build Trucks */
.tb-partial-banner {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 16px; border-radius: 0 8px 8px 0;
    background: rgba(180,83,9,0.1); border-left: 4px solid #b45309;
    color: #b45309; font-size: 13px; margin-bottom: 16px;
}
.tb-lane-section {
    display: flex; align-items: center; gap: 8px; margin-bottom: 16px; flex-wrap: wrap;
}
.tb-lane-label { font-size: 11px; color: #5b6875; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; }
.tb-lane-section input {
    flex: 1; min-width: 160px; padding: 9px 12px; border-radius: 8px; font-size: 13px;
    background: #f4f1ea; border: 1px solid rgba(28,39,51,0.1);
    color: #1c2733;
}
.tb-lane-section input:focus { border-color: #2f5d8f; outline: none; box-shadow: 0 0 0 3px rgba(47,93,143,0.15); }
.tb-lane-arrow { color: #5b6875; font-size: 16px; display: inline-flex; align-items: center; }

.tb-build-hero {
    display: flex; align-items: center; gap: 12px; margin-bottom: 20px;
    padding: 18px; background: #f7f4ec; border: 1px solid rgba(28,39,51,0.08); border-radius: 12px;
}
.tb-build-subtitle { font-size: 13px; color: var(--text-secondary, #5b6875); }

.tb-trucks-container {
    margin-bottom: 16px;
    display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px;
}
.tb-trucks-container .tb-no-trucks { grid-column: 1 / -1; }
.tb-no-trucks { color: #5b6875; font-size: 13px; padding: 32px 20px; text-align: center; }
.tb-no-trucks::before { content: ""; display: block; width: 30px; height: 30px; margin: 0 auto 8px; opacity: 0.55; background: no-repeat center / contain; background-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='30'%20height='30'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='%236b7888'%20stroke-width='1.5'%3E%3Crect%20x='1'%20y='5'%20width='14'%20height='11'%20rx='1'/%3E%3Cpath%20d='M15%209h4l3%203v4h-7z'/%3E%3Ccircle%20cx='5'%20cy='18'%20r='2'/%3E%3Ccircle%20cx='18'%20cy='18'%20r='2'/%3E%3C/svg%3E"); }

.tb-add-truck-row { margin-bottom: 16px; }

/* Truck Cards */
.tb-truck-card {
    background: #f7f4ec; border: 1px solid rgba(28,39,51,0.08);
    border-radius: 12px; margin-bottom: 12px; overflow: hidden;
}
.tb-truck-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px 16px; border-bottom: 1px solid var(--border-primary, #d8d2c4);
}
.tb-truck-header h4 { margin: 0; font-size: 15px; color: var(--text-primary, #1c2733); display: flex; align-items: center; gap: 8px; }
.tb-truck-header-actions { display: flex; align-items: center; gap: 8px; }
.tb-truck-remove {
    background: none; border: none; color: #b91c1c; cursor: pointer; font-size: 18px;
    opacity: 0.5; padding: 0 4px;
}
.tb-truck-remove:hover { opacity: 1; }

.tb-truck-body { padding: 12px 16px; }

.tb-truck-pieces {
    display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; min-height: 36px;
    padding: 8px; border: 2px dashed var(--border-primary, #d8d2c4); border-radius: 6px;
}
.tb-truck-pieces.drag-over { border-color: #2f5d8f; background: rgba(47,93,143,0.05); }
.tb-truck-pieces .tb-piece-chip {
    display: flex; align-items: center; gap: 4px;
    padding: 4px 8px; border-radius: 4px; font-size: 12px;
    background: var(--bg-tertiary, #edeae2); color: var(--text-primary, #1c2733);
    cursor: grab; white-space: nowrap;
}
.tb-truck-pieces .tb-piece-chip:active { cursor: grabbing; }
.tb-piece-chip .tb-piece-dims { opacity: 0.5; font-size: 11px; }
.tb-piece-chip.od-piece { border-left: 3px solid #b91c1c; }

.tb-truck-stats {
    display: flex; flex-wrap: wrap; gap: 12px; font-size: 13px; margin-bottom: 8px;
}
.tb-truck-stat { display: flex; align-items: center; gap: 4px; }
.tb-truck-stat .label { color: var(--text-secondary, #5b6875); }
.tb-truck-stat .value { color: var(--text-primary, #1c2733); font-weight: 500; }
.tb-truck-stat .value.od-value { color: #b91c1c; }
.tb-truck-stat .value.legal-value { color: #15803d; }

.tb-truck-badge { font-size: 10px; padding: 2px 6px; border-radius: 3px; font-weight: 600; text-transform: uppercase; }
.tb-truck-badge.od { background: rgba(185,28,28,0.2); color: #b91c1c; }
.tb-truck-badge.legal { background: rgba(21,128,61,0.2); color: #15803d; }

.tb-truck-trailer-select {
    display: flex; align-items: center; gap: 8px; font-size: 13px;
}
.tb-truck-trailer-select .label { color: var(--text-secondary, #5b6875); }
.tb-truck-trailer-select select {
    padding: 4px 8px; border-radius: 4px; font-size: 12px;
    background: var(--bg-tertiary, #edeae2); border: 1px solid var(--border-primary, #d8d2c4);
    color: var(--text-primary, #1c2733);
}

.tb-truck-viz { margin: 10px 0; }
.tb-truck-viz canvas { width: 100%; border-radius: 8px; background: #f4f1ea; border: 1px solid rgba(28,39,51,0.08); }

.tb-truck-actions {
    display: flex; gap: 8px; margin-top: 8px;
}
.tb-truck-actions a, .tb-truck-actions button {
    font-size: 12px; color: #2f5d8f; text-decoration: none; cursor: pointer;
    background: none; border: none; padding: 2px 0;
}
.tb-truck-actions a:hover, .tb-truck-actions button:hover { text-decoration: underline; }

/* Details Expander */
.tb-details-toggle {
    background: none; border: none; color: #2f5d8f; font-size: 12px;
    cursor: pointer; padding: 2px 0; display: flex; align-items: center; gap: 4px;
}
.tb-details-toggle:hover { text-decoration: underline; }
.tb-truck-details {
    padding: 12px 0; border-top: 1px solid var(--border-primary, #d8d2c4);
    margin-top: 8px; display: none;
}
.tb-truck-details.open { display: block; }

/* Utilization Bars (reused from Partial TL) */
.tb-util-row {
    display: flex; align-items: center; gap: 8px; margin-bottom: 6px; font-size: 12px;
}
.tb-util-label { width: 50px; color: var(--text-secondary, #5b6875); text-align: right; }
.tb-util-bar-wrap {
    flex: 1; height: 14px; background: var(--bg-tertiary, #edeae2);
    border-radius: 7px; overflow: hidden;
}
.tb-util-bar {
    height: 100%; border-radius: 7px; transition: width 0.4s;
    background: linear-gradient(90deg, #2f5d8f, #2f5d8f);
}
.tb-util-bar.warning { background: linear-gradient(90deg, #b45309, #b45309); }
.tb-util-bar.danger { background: linear-gradient(90deg, #b91c1c, #f2d5d5); }
.tb-util-text { width: 80px; font-size: 11px; color: var(--text-secondary, #5b6875); }

/* Axle weights inside details */
.tb-axle-section { margin-top: 8px; }
.tb-axle-row {
    display: flex; align-items: center; gap: 8px; margin-bottom: 4px; font-size: 12px;
}
.tb-axle-label { width: 55px; color: var(--text-secondary, #5b6875); text-align: right; }
.tb-axle-bar-wrap {
    flex: 1; height: 10px; background: var(--bg-tertiary, #edeae2);
    border-radius: 5px; overflow: hidden;
}
.tb-axle-bar { height: 100%; border-radius: 5px; background: #2f5d8f; transition: width 0.3s; }
.tb-axle-bar.warning { background: #b45309; }
.tb-axle-bar.danger { background: #b91c1c; }
.tb-axle-val { width: 40px; font-size: 11px; color: var(--text-primary, #1c2733); }
.tb-axle-limit { font-size: 11px; color: var(--text-secondary, #5b6875); width: 40px; }

/* Editable specs row inside details */
.tb-specs-row {
    display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 8px;
}
.tb-spec-item {
    display: flex; align-items: center; gap: 4px; font-size: 12px;
    color: var(--text-secondary, #5b6875);
}
.tb-spec-item input {
    width: 48px; background: transparent; border: 1px solid transparent;
    color: var(--text-primary, #1c2733); padding: 2px 4px; border-radius: 3px;
    font-size: 12px; text-align: right;
}
.tb-spec-item input:hover { border-color: var(--border-primary, #d8d2c4); }
.tb-spec-item input:focus { border-color: #2f5d8f; outline: none; background: var(--bg-secondary, #fffdf8); }

/* Step 3: Results */
.tb-summary {
    background: var(--bg-secondary, #fffdf8); border-radius: 10px;
    padding: 20px; margin-bottom: 20px;
}
.tb-summary h3 { margin: 0 0 16px; font-size: 17px; color: var(--text-primary, #1c2733); }
.tb-summary-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px;
    margin-bottom: 16px;
}
.tb-summary-stat {
    background: var(--bg-tertiary, #edeae2); padding: 12px; border-radius: 8px;
}
.tb-summary-stat .stat-value { font-size: 22px; font-weight: 700; color: var(--text-primary, #1c2733); }
.tb-summary-stat .stat-label { font-size: 12px; color: var(--text-secondary, #5b6875); margin-top: 2px; }

.tb-summary-trucks {
    margin-top: 16px;
    display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px;
}
.tb-summary-truck-row {
    flex-wrap: wrap;
    display: flex; align-items: center; gap: 12px; padding: 8px 0;
    border-bottom: 1px solid var(--border-primary, #d8d2c4); font-size: 13px;
}
.tb-summary-truck-row:last-child { border-bottom: none; }
.tb-summary-truck-row { border: 1px solid rgba(100,116,139,0.15); border-radius: 8px; padding: 10px 14px; border-bottom: none; }

.tb-results-actions { display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }

/* Responsive */
@media (max-width: 768px) {
    .tb-stepper { gap: 0; }
    .tb-step-label { display: none; }
    .tb-step-connector { width: 24px; }
    .tb-add-row { flex-wrap: wrap; }
    .tb-add-row input[type="number"] { width: 52px; }
    .tb-name-input { flex: 1 1 100% !important; }
    .tb-lane-section { flex-direction: column; align-items: stretch; }
    .tb-lane-arrow { text-align: center; }
    .tb-build-hero { flex-direction: column; text-align: center; }
    .tb-summary-grid { grid-template-columns: repeat(2, 1fr); }
    .tb-truck-stats { flex-direction: column; gap: 4px; }
}

/* Unit Detection Banner */
.tb-unit-banner {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; padding: 12px 16px; border-radius: 0 8px 8px 0; margin-bottom: 16px;
    background: rgba(47,93,143,0.1); border-left: 4px solid #2f5d8f;
    flex-wrap: wrap;
}
.tb-unit-banner-text {
    display: flex; align-items: center; gap: 8px;
    color: #2f5d8f; font-size: 13px;
}
.tb-unit-banner-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.tb-stack-toggle { cursor: pointer; user-select: none; }
.tb-stack-toggle:hover { text-decoration: underline; }
.tb-ftin-val { cursor: pointer; }
.tb-ftin-val:hover { text-decoration: underline; color: #2f5d8f; }

/* Entry Options — Upload OR Manual */
.tb-entry-options {
    display: flex; align-items: center; gap: 0;
    margin-bottom: 16px; justify-content: center;
}
.tb-entry-option {
    display: flex; flex-direction: column; align-items: center;
    padding: 12px 24px; border-radius: 10px; cursor: pointer;
    transition: all 0.15s ease; text-align: center;
    border: 1px solid transparent;
}
.tb-entry-option:hover {
    background: rgba(47,93,143,0.06);
    border-color: rgba(47,93,143,0.15);
}
.tb-entry-option.active {
    background: rgba(47,93,143,0.08);
    border-color: rgba(47,93,143,0.25);
}
.tb-entry-label {
    display: flex; align-items: center; gap: 6px;
    font-size: 14px; font-weight: 600;
    color: var(--text-primary, #1c2733);
}
.tb-entry-label svg { color: #2f5d8f; }
.tb-entry-desc {
    font-size: 12px; color: var(--text-secondary, #5b6875);
    margin: 4px 0 0; line-height: 1.3;
}
.tb-entry-divider {
    font-size: 12px; color: var(--text-secondary, #45525f);
    padding: 0 12px; text-transform: uppercase; letter-spacing: 0.5px;
}

@media (max-width: 768px) {
    .tb-entry-options { gap: 0; }
    .tb-entry-option { padding: 10px 14px; }
    .tb-entry-label { font-size: 13px; }
}

/* Unassigned Pieces Queue */
.tb-queue {
    margin-bottom: 16px; border-radius: 12px;
    border: 1px solid rgba(28,39,51,0.08);
    background: #f7f4ec;
    overflow: hidden;
}
.tb-queue-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 8px 14px;
    background: rgba(255,253,248,0.6);
    border-bottom: 1px solid rgba(100,116,139,0.15);
}
.tb-queue-title {
    font-size: 12px; font-weight: 600; text-transform: uppercase;
    letter-spacing: 0.5px; color: var(--text-secondary, #5b6875);
}
.tb-queue-count {
    font-size: 11px; font-weight: 700; padding: 2px 8px;
    border-radius: 10px; background: rgba(47,93,143,0.15);
    color: #2f5d8f; min-width: 20px; text-align: center; border: 1px solid rgba(47,93,143,0.3);
}
.tb-queue-count.empty { background: rgba(21,128,61,0.15); color: #15803d; }
.tb-queue-list {
    display: flex; flex-wrap: wrap; gap: 6px;
    padding: 10px 14px; min-height: 20px;
}
.tb-queue-item {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 5px 10px; border-radius: 6px; font-size: 12px;
    background: #f4f1ea; border: 1px solid rgba(28,39,51,0.1);
    color: #1c2733; font-weight: 500;
    transition: all 0.3s ease;
}
.tb-queue-item .tb-qi-dims {
    font-size: 11px; color: #5b6875; font-weight: 400;
}
.tb-queue-item.assigned {
    opacity: 0; transform: scale(0.8); pointer-events: none;
}
.tb-queue-empty {
    font-size: 12px; color: var(--text-secondary, #5b6875);
    font-style: italic; padding: 2px 0;
}

/* Compact 2-col layout adjustments */
.tb-truck-stats {
    display: flex; flex-wrap: wrap; gap: 4px 12px;
}
.tb-truck-stat { font-size: 12px; }
.tb-truck-stat .label { font-size: 11px; }

/* Pieces queue — inline horizontal to save space */
.tb-queue-list { max-height: 80px; overflow-y: auto; }

/* Mobile: back to single column */
@media (max-width: 900px) {
    .tb-trucks-container { grid-template-columns: 1fr; }
    .tb-summary-trucks { grid-template-columns: 1fr; }
}

/* Known/Variable cost sections (OD audit Feb 2026) */
.cost-section-known { border-left: 3px solid #15803d; padding-left: 12px; margin: 12px 0 8px; }
.cost-section-known h4 { color: #15803d; font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; margin: 0 0 6px; }
.cost-section-variable { border-left: 3px solid #b45309; padding-left: 12px; margin: 12px 0 8px; }
.cost-section-variable h4 { color: #b45309; font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; margin: 0 0 6px; }
.variable-tag { background: rgba(180,83,9,0.2); color: #b45309; font-size: 10px; padding: 2px 6px; border-radius: 4px; }
.cost-state-line { display: flex; justify-content: space-between; padding: 2px 0; font-size: 12px; color: #5b6875; }
.cost-state-line .state-code { font-weight: 600; color: #1c2733; min-width: 28px; }
.cost-state-line .state-info { flex: 1; margin: 0 8px; font-size: 11px; }
.cost-state-line .state-range { text-align: right; color: #b45309; white-space: nowrap; }
.cost-state-line.unknown .state-info { font-style: italic; color: #5b6875; }
.quote-section-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.5px; margin: 8px 0 4px; padding-top: 8px; border-top: 1px solid rgba(100,116,139,0.3); }
.cost-known-subtotal { display: flex; justify-content: space-between; padding: 4px 0; margin-top: 4px; border-top: 1px dashed rgba(100,116,139,0.3); font-size: 12px; color: #15803d; font-weight: 600; }
.cost-variable-range { display: flex; justify-content: space-between; padding: 4px 0; margin-top: 4px; border-top: 1px dashed rgba(100,116,139,0.3); font-size: 12px; color: #b45309; font-weight: 600; }

/* Per-row dim/weight unit selectors in truck builder */
.tb-dim-unit-sel, .tb-wt-unit-sel {
    font-size: 10px !important;
    color: #5b6875 !important;
    background: transparent !important;
    border: none !important;
    cursor: pointer !important;
    padding: 0 4px !important;
    height: 20px !important;
    min-width: 34px !important;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    text-align: center;
    text-align-last: center;
}
.tb-dim-unit-sel:hover, .tb-wt-unit-sel:hover {
    color: #5b6875 !important;
}
.tb-dim-unit-sel:focus, .tb-wt-unit-sel:focus {
    outline: none;
    color: #2f5d8f !important;
}

}

/* Rate Check - Compact Screenshot Row */
.rc-screenshot-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}
.rc-screenshot-row .paste-target-mini {
    padding: 8px 12px;
    font-size: 12px;
}
.rc-upload-preview {
    display: flex;
    align-items: center;
    gap: 6px;
}
.rc-image-thumb {
    max-height: 36px;
    max-width: 70px;
    border-radius: 4px;
    cursor: pointer;
    transition: opacity 0.15s;
    object-fit: cover;
}
.rc-image-thumb:hover {
    opacity: 0.8;
}

/* 3D Navigation Buttons */
.nav3d-btn {
    background: rgba(255,253,248, 0.8) !important;
    border: 1px solid #d8d2c4 !important;
    color: #5b6875 !important;
    padding: 5px 10px !important;
    border-radius: 5px !important;
    font-size: 12px !important;
    cursor: pointer !important;
    transition: all 0.15s ease !important;
    white-space: nowrap !important;
}
.nav3d-btn:hover {
    background: rgba(47,93,143, 0.2) !important;
    border-color: #2f5d8f !important;
    color: #1c2733 !important;
}

/* Get Rate pulse animation after extraction */
@keyframes pulseGetRate {
    0% { outline: 3px solid rgba(47,93,143, 0.7); outline-offset: 0px; }
    50% { outline: 3px solid rgba(47,93,143, 0.3); outline-offset: 8px; }
    100% { outline: 3px solid rgba(47,93,143, 0.7); outline-offset: 0px; }
}
#getRatesBtn.btn-pulse,
body .btn-primary.btn-large.btn-pulse {
    animation: pulseGetRate 1.2s ease-in-out infinite !important;
    outline: 3px solid rgba(47,93,143, 0.7) !important;
}

/* Show screenshot row when image is being previewed */
.rc-screenshot-row:has(.rc-upload-preview[style*="display: flex"]),
.rc-screenshot-row:has(.rc-upload-preview[style*="display:flex"]),
.rc-screenshot-row:has(.ocr-status-inline[style*="display: block"]),
.rc-screenshot-row:has(.ocr-status-inline[style*="display:block"]) {
    display: flex !important;
}

/* FreightDeck Quote Builder action buttons */
.rc-quote-btn:hover:not(:disabled) {
    background: rgba(91,104,117,0.12) !important;
    border-color: rgba(91,104,117,0.35) !important;
    color: #fff !important;
}
.rc-quote-btn:disabled {
    pointer-events: none;
}

/* Load Info active state hover — keeps amber feel */
.rc-quote-btn.rc-loadinfo-active:hover:not(:disabled) {
    background: rgba(180,83,9,0.20) !important;
    border-color: rgba(180,83,9,0.55) !important;
    color: #b45309 !important;
}


/* ---------- Quote Builder redesign (fd-*) ---------- */
.fd-redesign { padding: 0; background: transparent; border: none; }

.fd-rate-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid rgba(91,104,117,0.08);
}
.fd-rate-row:last-child { border-bottom: none; }

.fd-rate-row__label {
    display: flex;
    align-items: baseline;
    gap: 8px;
    min-width: 0;
}
.fd-rate-name {
    color: #1c2733;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: -0.005em;
}
.fd-rate-sub {
    color: #5b6875;
    font-size: 11px;
    font-weight: 400;
}
.fd-rate-sub.editable-rate {
    cursor: pointer;
    transition: color 0.15s ease;
}
.fd-rate-sub.editable-rate:hover { color: #5b6875; }

.fd-rate-row__value {
    display: inline-flex;
    align-items: center;
    gap: 2px;
}
.fd-dollar {
    color: #5b6875;
    font-size: 12px;
    font-weight: 500;
}
.fd-rate-input {
    background: transparent;
    border: none;
    color: #1c2733;
    font-size: 14px;
    font-weight: 600;
    text-align: right;
    width: 88px;
    padding: 2px 4px;
    border-radius: 3px;
    transition: background 0.15s ease;
    font-variant-numeric: tabular-nums;
}
.fd-rate-input:hover { background: rgba(91,104,117,0.06); }
.fd-rate-input:focus {
    outline: none;
    background: rgba(47,93,143,0.08);
    box-shadow: inset 0 0 0 1px rgba(47,93,143,0.3);
}

.fd-markup-row {
    padding: 10px 0;
    border-bottom: none;
}
.fd-markup-input {
    width: 48px;
    font-size: 13px;
    font-weight: 500;
    color: #5b6875;
}
.fd-pct {
    color: #5b6875;
    font-size: 12px;
    margin-left: 2px;
}

.fd-muted { color: #5b6875; font-weight: 400; }

.fd-subtotal-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    padding: 10px 0 12px;
    border-top: 1px solid rgba(91,104,117,0.12);
    margin-top: 2px;
}
.fd-subtotal-label {
    color: #1c2733;
    font-size: 12px;
    font-weight: 500;
}
.fd-subtotal-value {
    color: #1c2733;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -0.01em;
    font-variant-numeric: tabular-nums;
}

.fd-allin-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    padding: 16px 0 6px;
    border-top: 2px solid rgba(91,104,117,0.3);
    margin-top: 6px;
}
.fd-allin-label {
    color: #1c2733;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: -0.005em;
}
.fd-allin-value {
    color: #1c2733;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
}

.fd-od-premium {
    font-size: 10px;
    color: #5b6875;
    padding: 4px 0 0;
    text-align: right;
    font-style: italic;
}



/* === Market Intelligence Modal (newsletter digest) === */
.market-intel-modal {
    max-width: 720px;
    width: 92%;
    max-height: 86vh;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}
.market-intel-modal .modal-header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 14px 20px;
}
.market-intel-modal .modal-header h3 {
    color: var(--text-primary);
    font-size: 1.02rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    letter-spacing: 0.01em;
}
.market-intel-modal .modal-close {
    color: var(--text-muted);
    font-size: 1.5rem;
}
.market-intel-modal .modal-close:hover { color: var(--text-primary); }
.market-intel-modal .modal-body {
    background: var(--bg-primary);
    padding: 4px 0 0 0;
    max-height: calc(86vh - 56px);
    overflow-y: auto;
}

.mi-section { padding: 16px 22px; border-bottom: 1px solid var(--border-color); }
.mi-section:last-of-type { border-bottom: none; }
.mi-section-title {
    color: var(--text-muted);
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-weight: 700;
    margin-bottom: 10px;
}
.mi-section-body { display: flex; flex-direction: column; gap: 6px; }

.mi-line {
    display: flex; gap: 8px; align-items: baseline;
    color: var(--text-primary);
    font-size: 0.92rem;
    line-height: 1.5;
    padding: 2px 0;
}
.mi-arrow {
    display: inline-block;
    width: 18px;
    text-align: center;
    font-weight: 700;
    flex-shrink: 0;
}
.mi-line-up    { color: var(--text-primary); }
.mi-line-up    .mi-arrow { color: var(--success); }
.mi-line-down  { color: var(--text-primary); }
.mi-line-down  .mi-arrow { color: var(--error); }
.mi-line-flat  { color: var(--text-secondary); }
.mi-line-flat  .mi-arrow { color: var(--text-muted); }
.mi-line-warn  { color: var(--text-primary); }
.mi-line-warn  .mi-arrow { color: var(--warning); }
.mi-line-note  { color: var(--text-muted); font-size: 0.84rem; }
.mi-tag-small  { margin-left: 8px; font-size: 0.7rem; color: var(--text-muted); background: var(--bg-accent); padding: 1px 6px; border-radius: 4px; }

.mi-moved {
    padding: 10px 0;
    border-top: 1px solid var(--border-color);
}
.mi-moved:first-child { border-top: none; padding-top: 2px; }
.mi-moved-head {
    display: flex; justify-content: space-between; align-items: baseline; gap: 10px;
    margin-bottom: 4px;
}
.mi-moved-title {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.88rem;
    text-decoration: none;
    line-height: 1.35;
}
a.mi-moved-title:hover { color: var(--accent-text); }
.mi-news-source {
    color: var(--text-muted);
    font-size: 0.68rem;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 500;
}
.mi-moved-summary {
    color: var(--text-secondary);
    font-size: 0.82rem;
    line-height: 1.5;
}

.mi-empty {
    margin: 20px;
    color: var(--text-muted);
    font-size: 0.85rem;
    text-align: center;
}
.mi-footer {
    padding: 12px 22px 16px;
    color: var(--text-muted);
    font-size: 0.7rem;
    text-align: right;
    border-top: 1px solid var(--border-color);
}

/* tb-restyle-specfix: th would otherwise revert to #2d2d2d via styles-sidebar.css */
body.topnav-mode .tb-table th {
    background: #f4f1ea;
}

/* tb-table-editor-exemption */
body.topnav-mode .tb-table .tb-edit-cell input[data-field] {
    padding: 2px 4px !important;
    height: auto !important;
    min-height: 0 !important;
    font-size: 13px !important;
    border-radius: 3px !important;
    background: transparent !important;
    border: 1px solid transparent !important;
    width: 64px !important;
}
body.topnav-mode .tb-table .tb-edit-cell input[data-field]:focus {
    border-color: #2f5d8f !important;
    background: rgba(47,93,143,0.06) !important;
}
body.topnav-mode .tb-table .tb-dim-unit-sel,
body.topnav-mode .tb-table .tb-wt-unit-sel {
    padding: 0 2px !important;
    height: 20px !important;
    min-height: 0 !important;
    font-size: 11px !important;
    border: 1px solid transparent !important;
    background: transparent !important;
    color: #5b6875 !important;
    border-radius: 3px !important;
    width: auto !important;
    min-width: 34px !important;
    padding: 0 4px !important;
    text-align-last: center !important;
    -webkit-appearance: none !important;
    appearance: none !important;
}
body.topnav-mode .tb-table .tb-dim-unit-sel:hover,
body.topnav-mode .tb-table .tb-wt-unit-sel:hover { color: #1c2733 !important; }

/* tb-build-trucks-polish */
body.topnav-mode .tb-even-split-label input[type="checkbox"] {
    -webkit-appearance: none !important; appearance: none !important;
    width: 16px !important; height: 16px !important;
    background: #f4f1ea !important; border: 1px solid rgba(28,39,51,0.2) !important;
    border-radius: 4px !important; cursor: pointer; position: relative; flex: 0 0 auto;
    box-sizing: border-box !important; padding: 0 !important; margin: 0 !important; min-width: 0 !important;
    transition: background .15s ease, border-color .15s ease;
}
body.topnav-mode .tb-even-split-label input[type="checkbox"]:hover { border-color: rgba(47,93,143,0.6) !important; }
body.topnav-mode .tb-even-split-label input[type="checkbox"]:checked {
    background: linear-gradient(135deg, #2f5d8f, #2f5d8f) !important; border-color: #2f5d8f !important;
}
body.topnav-mode .tb-even-split-label input[type="checkbox"]:checked::after {
    content: ""; position: absolute; left: 5px; top: 1px; width: 4px; height: 8px;
    border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg);
}
/* Ghost secondary buttons inside Truck Builder (+ Add Truck, Back, Copy, Export) */
.tb-section .btn-secondary {
    background: transparent; border: 1px solid rgba(28,39,51,0.18); color: #1c2733;
    transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.tb-section .btn-secondary:hover { background: rgba(28,39,51,0.06); color: #1c2733; border-color: rgba(28,39,51,0.28); }
/* Danger-ghost Start Over */
.tb-section .btn-outline-danger {
    background: transparent; border: 1px solid rgba(185,28,28,0.3); color: #b91c1c;
    padding: 10px 20px; font-size: 0.9rem;
    transition: all .15s ease;
}
.tb-section .btn-outline-danger:hover { border-color: rgba(185,28,28,0.6); color: #b91c1c; background: rgba(185,28,28,0.08); }
.tb-add-truck-row { margin-top: 16px !important; }

/* my-quotes-polish */
.quotes-container .nav-tabs {
    display: inline-flex; gap: 4px; padding: 4px;
    background: #f4f1ea; border: 1px solid rgba(28,39,51,0.1);
    border-radius: 10px; margin-bottom: 16px;
}
.quotes-stat-value.quotes-pending { color: #b45309; }
.quotes-stat-value.quotes-winrate { color: #2f5d8f; }
.quotes-search-group input:focus, .quotes-search-group select:focus,
.quotes-filter-group input:focus, .quotes-filter-group select:focus {
    border-color: #2f5d8f; outline: none; box-shadow: 0 0 0 3px rgba(47,93,143,0.15);
}
/* tabular $ alignment for Quoted (6th) and Carrier (7th) columns */
.quotes-table td:nth-child(6), .quotes-table td:nth-child(7) {
    font-weight: 600; font-variant-numeric: tabular-nums;
}

/* my-quotes-th-fix */
body.topnav-mode .quotes-table th { background: #f4f1ea; }

/* tb-step2-actionbar */
.tb-step-actions-group { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.tb-step-actions-group .btn { white-space: nowrap; }



/* my-quotes-polish2 */
/* bigger stat numbers */
.quotes-stat-value { font-size: 2.2rem; }
/* custom dropdown arrow + appearance reset (brand blue chevron) */
.quotes-search-group select, .quotes-filter-group select {
    -webkit-appearance: none; -moz-appearance: none; appearance: none;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%234a9eff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 10px center;
    padding-right: 30px;
}
/* monospace $ alignment for Quoted (6th) and Carrier (7th) columns */
.quotes-table td:nth-child(6), .quotes-table td:nth-child(7) {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
/* action buttons: single ghost row */
.quotes-table td:last-child { white-space: nowrap; }
.action-btn {
    background: transparent !important; border: 1px solid transparent !important;
    margin-right: 2px;
}
.action-btn.win { color: #15803d; }
.action-btn.lose { color: #b91c1c; }
.action-btn.edit { color: #2f5d8f; }
.action-btn.delete { color: #5b6875; }
.action-btn:hover { background: rgba(28,39,51,0.1) !important; }
.action-btn.delete:hover { color: #b91c1c; border-color: transparent !important; }
/* notes hover -> brand blue */
.notes-preview { transition: color 0.15s; }
.notes-preview:hover { color: #2f5d8f; cursor: pointer; }
/* Export CSV: smaller ghost button next to Quote History */
#quotesExportBtn { padding: 6px 12px; font-size: 0.78rem; }

/* Rate card cleanup — uniform font size, single calm palette (Patrick 2026-06-11) */
.fd-redesign .fd-rate-name,
.fd-redesign .fd-rate-sub,
.fd-redesign .fd-dollar,
.fd-redesign .fd-rate-input,
.fd-redesign .fd-markup-input,
.fd-redesign .fd-pct,
.fd-redesign .fd-subtotal-label,
.fd-redesign .fd-subtotal-value,
.fd-redesign .fd-allin-label,
.fd-redesign .fd-allin-value { font-size: 14px !important; }

/* Truck Builder Enter-Pieces: 2-column (input left, items right) — Patrick 2026-06-12 */
.tb-s1-grid{display:grid;grid-template-columns:minmax(0,2fr) minmax(0,3fr);gap:16px;align-items:start;}
.tb-s1-col{min-width:0;}
@media(max-width:920px){.tb-s1-grid{grid-template-columns:1fr;}}


/* Freight list tighten + readability (Patrick 2026-06-12) */
.tb-s1-col .tb-items-section { margin-bottom:12px; }
.tb-s1-col .tb-items-scroll { max-height:420px; }
.tb-s1-col .tb-table td { padding:5px 8px !important; }
.tb-s1-col .tb-table th { padding:6px 8px !important; }
.tb-s1-col .tb-table td[data-field="name"] { white-space:nowrap; max-width:200px; overflow:hidden; text-overflow:ellipsis; }
body.topnav-mode .tb-s1-col .tb-table .tb-edit-cell input[data-field="lengthRaw"],
body.topnav-mode .tb-s1-col .tb-table .tb-edit-cell input[data-field="widthRaw"],
body.topnav-mode .tb-s1-col .tb-table .tb-edit-cell input[data-field="heightRaw"] { width:44px !important; }
body.topnav-mode .tb-s1-col .tb-table .tb-edit-cell input[data-field="weightRaw"] { width:54px !important; }
body.topnav-mode .tb-s1-col .tb-table .tb-edit-cell input[data-field="qty"] { width:38px !important; }


/* Freight list — fit to column, no horizontal scroll (Patrick 2026-06-12 v2) */
.tb-s1-grid{grid-template-columns:minmax(0,1.8fr) minmax(0,3.2fr) !important;}
.tb-s1-col .tb-table td, .tb-s1-col .tb-table th { padding:4px 6px !important; font-size:12px !important; }
.tb-s1-col .tb-table td[data-field="name"] { max-width:150px !important; }
body.topnav-mode .tb-s1-col .tb-table .tb-edit-cell input[data-field="lengthRaw"],
body.topnav-mode .tb-s1-col .tb-table .tb-edit-cell input[data-field="widthRaw"],
body.topnav-mode .tb-s1-col .tb-table .tb-edit-cell input[data-field="heightRaw"] { width:36px !important; }
body.topnav-mode .tb-s1-col .tb-table .tb-edit-cell input[data-field="weightRaw"] { width:48px !important; }
body.topnav-mode .tb-s1-col .tb-table .tb-edit-cell input[data-field="qty"] { width:32px !important; }
body.topnav-mode .tb-s1-col .tb-table .tb-dim-unit-sel, body.topnav-mode .tb-s1-col .tb-table .tb-wt-unit-sel { min-width:18px !important; padding:0 2px !important; font-size:10px !important; }

/* tb-add-row tidy grid — clean 2-row layout in the left column (Patrick 2026-06-12) */
.tb-s1-col .tb-add-row { display:grid; grid-template-columns:1.5fr 1fr 1fr 1fr; gap:8px; align-items:center; }
.tb-s1-col .tb-add-row .tb-x { display:none; }
.tb-s1-col .tb-add-row input { width:100% !important; }
.tb-s1-col .tb-stack-check { display:flex; align-items:center; justify-content:center; gap:6px; white-space:nowrap; }
.tb-s1-col #tbAddItemBtn { width:100%; }
.tb-s1-col .tb-upload-area { margin-bottom:14px !important; }

/* pruix-fix 2026-07-01: Production Report / Customer Master / TAI Sync tabs are direct
   children of .main-content (a flex column, height:100vh via styles-sidebar.css), placed
   AFTER .main-scroll which has flex-grow:1. When one of these tabs is active, .main-scroll
   is empty but still eats all vertical space, shoving the tab to the bottom (big gap above,
   worst when the table is short/empty). Collapse the empty .main-scroll when one of these
   out-of-scroll tabs is active so the content sits at the TOP. Scoped so normal in-scroll
   tabs (Home/Quote/etc.) and the full-height Quote layout are untouched. */
.main-content:has(> #productionreport.tab-content.active) > .main-scroll,
.main-content:has(> #customermaster.tab-content.active) > .main-scroll,
.main-content:has(> #taisync.tab-content.active) > .main-scroll,
.main-content:has(> #fsc.tab-content.active) > .main-scroll {
    flex: 0 0 auto !important;
    height: 0 !important;
    min-height: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
}

/* ── PR readability (dark, on-brand) — softer field, row separation, visible date bands. v=pruix3 ── */
body:has(#productionreport.tab-content.active){background:#efece4!important}
#prScrollWrap{background:#fffdf8!important;border-color:#d8d2c4!important}
#prTable tbody tr{background:#fffdf8}
#prTable tbody td{border-bottom:1px solid #e3ddd0!important;color:#1c2733!important}
#prTable tbody tr:hover td{background:rgba(47,93,143,0.07)!important}
#prTable tbody tr.pr-datesep td{background:#e6ecf3!important;color:#264b74!important;font-weight:700!important;letter-spacing:.05em!important;padding:8px 10px!important}
#prTable thead th{background:#edeae2!important;color:#45525f!important}
#prTable tbody td b{color:#1c2733!important}
/* pruix3: single-line spreadsheet density — each load renders on ONE row. */
#prTable tbody td{white-space:nowrap!important;vertical-align:middle!important;padding:4px 8px!important}
#prTable tbody tr.pr-datesep td{padding:8px 10px!important}
