* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 30px;
}

.header-banner {
    background: linear-gradient(135deg, #1a2a3a 0%, #2c4a6a 100%);
    background-image: url('header-bg.png');
    background-size: cover;
    background-position: center;
    border-radius: 12px;
    padding: 30px 20px;
    margin-bottom: 30px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.header-banner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(26,42,58,0.85) 0%, rgba(44,74,106,0.7) 100%);
    z-index: 1;
}

.header-content {
    position: relative;
    z-index: 2;
}

header h1 {
    color: #fff;
    font-size: 2.5rem;
    margin-bottom: 5px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    font-weight: 700;
    letter-spacing: 1px;
}

.subtitle {
    color: rgba(255,255,255,0.9);
    font-size: 1.1rem;
    font-weight: 300;
}

.start-fresh-btn {
    margin-top: 15px;
    padding: 8px 20px;
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 20px;
    color: rgba(255,255,255,0.9);
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
    position: relative;
    z-index: 2;
}

.start-fresh-btn:hover {
    background: rgba(255,255,255,0.25);
    border-color: rgba(255,255,255,0.5);
    color: #fff;
}

/* Collapsible Section */
.collapsible {
    padding: 0;
}

.collapsible-header {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 15px 20px;
    background: #f8f9fa;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    color: #555;
    text-align: left;
    transition: background 0.2s;
}

.collapsible-header:hover {
    background: #eef2f5;
}

.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 #eee;
}

/* 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 #eee;
}

.section-header h2 {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.unit-selectors-inline {
    display: flex;
    gap: 8px;
}

.unit-selectors-inline select {
    padding: 6px 10px;
    font-size: 0.85rem;
}

/* Add Piece Button */
.btn-add-piece {
    width: 100%;
    padding: 12px;
    margin-top: 10px;
    background: #f0f7ff;
    border: 2px dashed #3498db;
    border-radius: 6px;
    color: #3498db;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-add-piece:hover {
    background: #e0f0ff;
    border-color: #2980b9;
    color: #2980b9;
}

/* 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 #3498db;
    border-radius: 12px;
    padding: 40px 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background: linear-gradient(135deg, #f8fafc 0%, #ebf5fb 100%);
    outline: none;
}

.paste-target:hover,
.paste-target:focus {
    border-color: #2980b9;
    background: linear-gradient(135deg, #ebf5fb 0%, #d4edfc 100%);
    box-shadow: 0 0 0 4px rgba(52, 152, 219, 0.2);
}

.paste-target:focus {
    border-style: solid;
}

.paste-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.paste-text {
    font-size: 1.1rem;
    color: #2c3e50;
    margin-bottom: 8px;
}

.paste-text kbd {
    background: #34495e;
    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: #7f8c8d;
}

.file-types-inline {
    font-size: 0.8rem;
    color: #95a5a6;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed #ddd;
}

.paste-target.drag-over {
    border-color: #27ae60;
    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 #e0e0e0;
}

.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, #e8f5e9 0%, #c8e6c9 100%);
    border: 2px solid #4caf50;
    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: #2e7d32;
}

.upload-zone {
    flex: 1;
    border: 2px dashed #ccc;
    border-radius: 8px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background: #fff;
}

.upload-zone:hover {
    border-color: #3498db;
    background: #f8fafc;
}

.upload-zone.drag-over {
    border-color: #3498db;
    background: #ebf5fb;
}

.upload-icon {
    font-size: 2rem;
    display: block;
    margin-bottom: 10px;
}

.upload-hint {
    font-size: 0.85rem;
    color: #999;
    margin-top: 5px;
}

.upload-area {
    flex: 1;
}

.upload-tips {
    margin-top: 12px;
    padding: 12px 15px;
    background: #f8f9fa;
    border-radius: 6px;
    font-size: 0.85rem;
    color: #666;
}

.upload-tips .tips-header {
    font-weight: 500;
    color: #555;
    margin-bottom: 6px;
}

.upload-tips ul {
    margin: 0;
    padding-left: 18px;
}

.upload-tips li {
    margin: 3px 0;
}

.upload-tips strong {
    color: #333;
}

.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: #ebf5fb;
    color: #2980b9;
}

.ocr-status.success {
    background: #e8f8f5;
    color: #27ae60;
}

.ocr-status.error {
    background: #fdedec;
    color: #e74c3c;
}

/* OCR Preview */
.ocr-preview pre {
    background: #f8f9fa;
    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: #fff;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.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: #666;
    margin-bottom: 5px;
    font-weight: 500;
}

.lane-field input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.95rem;
}

.lane-field input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.lane-arrow {
    font-size: 1.5rem;
    color: #999;
    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: #e74c3c;
    background: #fdf2f2;
}

.lane-field input.input-valid {
    border-color: #27ae60;
    background: #f0fff4;
}

.input-feedback {
    font-size: 0.75rem;
    position: absolute;
    bottom: -18px;
    left: 0;
    min-height: 18px;
}

.input-feedback.error {
    color: #e74c3c;
}

.input-feedback.valid {
    color: #27ae60;
}

.lane-validation {
    font-size: 0.75rem;
    display: block;
    min-height: 18px;
    margin-top: 2px;
}

.lane-validation.valid {
    color: #27ae60;
}

.lane-validation.error {
    color: #e74c3c;
}

.lane-validation.loading {
    color: #666;
    font-style: italic;
}

.lane-validation.suggestion {
    color: #2980b9;
}

.suggestion-text {
    color: #666;
}

.suggestion-btn {
    background: #3498db;
    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: #2980b9;
}

.suggestion-hint {
    color: #999;
    font-size: 0.7rem;
}

/* Add padding to lane-inputs for feedback space */
.mapper-inputs {
    padding-bottom: 20px;
}

/* Output lane info */
.output-lane-info {
    background: #f8f9fa;
    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: #666;
    font-weight: 500;
}

.output-lane-info .lane-value {
    color: #2c3e50;
    font-weight: 600;
}

.output-lane-info .lane-arrow {
    color: #3498db;
    font-size: 1.1rem;
    padding: 0;
}

/* Sections */
section {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

section h2 {
    color: #2c3e50;
    font-size: 1.25rem;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.hint {
    font-weight: normal;
    color: #999;
    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: #666;
}

/* 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 #eee;
}

th {
    background: #f8f9fa;
    font-weight: 600;
    color: #555;
    font-size: 0.85rem;
    text-transform: uppercase;
}

input[type="text"],
input[type="number"] {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.95rem;
}

input[type="text"]:focus,
input[type="number"]:focus,
select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

select {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.95rem;
    background: #fff;
    cursor: pointer;
}

/* 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: #e74c3c;
    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: #e8f4fd;
}

#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: #2c3e50;
}

/* Over-dimensional value highlighting */
#outputTable td.od-value,
td.od-value {
    color: #e74c3c !important;
    font-weight: 600 !important;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

.btn-primary {
    background: #3498db;
    color: #fff;
}

.btn-primary:hover {
    background: #2980b9;
}

.btn-secondary {
    background: #ecf0f1;
    color: #555;
}

.btn-secondary:hover {
    background: #dde4e6;
}

.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 #ddd;
    font-size: 0.9rem;
}

/* Footer */
footer {
    text-align: center;
    color: #999;
    font-size: 0.85rem;
    margin-top: 30px;
}

/* Toast notification */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #2c3e50;
    color: #fff;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 0.95rem;
    animation: slideIn 0.3s ease;
    z-index: 1000;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Tabs */
.tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 20px;
    background: #fff;
    padding: 8px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.tab-btn {
    flex: 1;
    padding: 12px 20px;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    background: transparent;
    color: #666;
    transition: all 0.2s;
}

.tab-btn:hover {
    background: #f0f0f0;
}

.tab-btn.active {
    background: #3498db;
    color: #fff;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* 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: #666;
    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;
}

/* Trailer Section */
.trailer-section {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.trailer-section h3 {
    font-size: 1rem;
    color: #2c3e50;
    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 #ddd;
    border-radius: 6px;
    background: #fff;
    transition: border-color 0.2s;
}

.trailer-selector select:focus {
    outline: none;
    border-color: #3498db;
}

.trailer-selector select.recommended {
    border-color: #27ae60;
    background: #f0fff4;
}

.trailer-recommendation {
    font-size: 0.85rem;
    color: #27ae60;
    font-weight: 500;
    padding: 4px 10px;
    background: #e8f8ef;
    border-radius: 12px;
}

.trailer-recommendation:empty {
    display: none;
}

.custom-deck-input {
    margin-top: 12px;
    padding: 12px 15px;
    background: #fff8e6;
    border: 1px solid #f0d78c;
    border-radius: 6px;
}

.custom-deck-input label {
    display: block;
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 8px;
    font-weight: 500;
}

.custom-deck-input .input-with-unit {
    max-width: 200px;
}

.custom-deck-input .unit-label {
    padding: 8px 12px;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-left: none;
    border-radius: 0 4px 4px 0;
    font-size: 0.9rem;
    color: #666;
}

.trailer-info {
    margin-top: 12px;
    background: #f8f9fa;
    border-radius: 6px;
    padding: 12px 16px;
}

.trailer-specs {
    display: flex;
    gap: 25px;
    flex-wrap: wrap;
}

.trailer-specs .spec {
    font-size: 0.9rem;
    color: #555;
}

.trailer-specs .spec strong {
    color: #333;
}

#totalHeight {
    color: #2980b9;
    font-weight: 600;
}

.height-warning {
    color: #e74c3c !important;
}

.height-ok {
    color: #27ae60 !important;
}

/* Trailer specs summary */
.trailer-specs-summary {
    display: flex;
    gap: 25px;
    flex-wrap: wrap;
}

.trailer-specs-summary .spec {
    font-size: 0.9rem;
    color: #555;
}

.trailer-specs-summary .spec strong {
    color: #333;
}

.btn-link {
    background: none;
    border: none;
    color: #2980b9;
    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: #fff;
    border: 1px solid #ddd;
    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 #eee;
}

.specs-header h4 {
    margin: 0;
    font-size: 1rem;
    color: #333;
}

.specs-header .hint {
    font-size: 0.8rem;
    color: #888;
}

.specs-grid {
    display: grid;
    gap: 12px;
}

.specs-zone {
    background: #f8f9fa;
    border-radius: 6px;
    padding: 12px;
}

.specs-zone-header {
    font-weight: 600;
    color: #2c4a6a;
    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: #666;
    font-weight: 500;
}

.spec-value {
    font-size: 0.9rem;
    font-weight: 600;
    color: #333;
    padding: 4px 8px;
    background: #fff;
    border: 1px solid transparent;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s;
}

.spec-value:hover {
    border-color: #2980b9;
    background: #f0f7ff;
}

.spec-value.editing {
    border-color: #2980b9;
    background: #fff;
    outline: none;
}

.spec-value.modified {
    background: #fff3e0;
    border-color: #f39c12;
}

.specs-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    padding-top: 12px;
    border-top: 1px solid #eee;
}

.specs-modified-notice {
    margin-top: 10px;
    padding: 8px 12px;
    background: #fff3e0;
    border-radius: 4px;
    font-size: 0.85rem;
    color: #e67e22;
}

/* Overall trailer specs row (single zone trailers) */
.specs-overall {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    background: #f8f9fa;
    border-radius: 6px;
    padding: 12px;
}

/* Custom trailer save modal */
.save-trailer-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    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 #ddd;
    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: #e8f4fd;
    color: #2980b9;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
}

.state-tag .remove-state {
    background: none;
    border: none;
    color: #2980b9;
    cursor: pointer;
    font-size: 1rem;
    padding: 0;
    line-height: 1;
    opacity: 0.6;
}

.state-tag .remove-state:hover {
    opacity: 1;
}

/* Permit Results */
.permit-results {
    margin-top: 20px;
}

.permit-state-result {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    border-left: 4px solid #ccc;
}

.permit-state-result.permit-required {
    border-left-color: #e74c3c;
    background: #fef5f5;
}

.permit-state-result.no-permit {
    border-left-color: #27ae60;
    background: #f0fdf4;
}

.permit-state-result h3 {
    margin-bottom: 10px;
    color: #2c3e50;
    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: #e74c3c;
    color: #fff;
}

.permit-status.not-required {
    background: #27ae60;
    color: #fff;
}

.permit-status.escort {
    background: #f39c12;
    color: #fff;
    margin-left: 8px;
}

.permit-reasons {
    margin: 10px 0;
}

.permit-reasons li {
    color: #e74c3c;
    margin-left: 20px;
    font-size: 0.9rem;
}

.escort-reasons li {
    color: #f39c12;
}

.permit-notes {
    font-size: 0.85rem;
    color: #666;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #eee;
}

.permit-notes strong {
    color: #555;
}

/* Cost Summary Box */
/* Trailer Summary in Results */
.trailer-summary {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 15px 20px;
    margin-bottom: 15px;
}

.trailer-summary h3 {
    font-size: 1rem;
    color: #2c3e50;
    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: #666;
    font-size: 0.9rem;
}

.trailer-summary-item .value {
    font-weight: 600;
    color: #2c3e50;
}

.trailer-summary-item.highlight {
    background: #e8f4fd;
    padding: 6px 12px;
    border-radius: 6px;
}

.trailer-summary-item.highlight .value.height-ok {
    color: #27ae60;
}

.trailer-summary-item.highlight .value.height-warning {
    color: #e74c3c;
}

.cost-summary {
    background: linear-gradient(135deg, #2c3e50 0%, #3498db 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(255,255,255,0.1);
    border-radius: 8px;
    padding: 12px 15px;
}

.cost-item.total {
    background: rgba(255,255,255,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: #f39c12;
    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: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.permit-table th,
.permit-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.permit-table th {
    background: #f8f9fa;
    font-weight: 600;
    font-size: 0.85rem;
    color: #555;
    text-transform: uppercase;
}

.permit-table tr.permit-row {
    background: #fef5f5;
}

.permit-table .status-yes {
    color: #e74c3c;
    font-weight: 700;
}

.permit-table .status-no {
    color: #27ae60;
}

.permit-table .status-maybe {
    color: #f39c12;
    font-weight: 600;
}

.permit-table .notes-cell {
    font-size: 0.85rem;
    color: #666;
    max-width: 250px;
}

/* Survey Warning Banner */
.survey-warning {
    background: linear-gradient(135deg, #fff8e6 0%, #fef5e6 100%);
    border: 2px solid #f39c12;
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.survey-warning strong {
    color: #e67e22;
    white-space: nowrap;
}

.survey-warning span {
    color: #7c5c00;
    font-size: 0.9rem;
}

/* Export Actions */
.export-actions {
    display: flex;
    gap: 8px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
}

.export-actions .btn {
    font-size: 0.85rem;
}

/* Pieces Queue Section */
.pieces-queue-section {
    background: #fff;
    border: 2px solid #3498db;
    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: #f8f9fa;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.9rem;
}

.piece-chip:hover {
    border-color: #3498db;
    background: #f0f7ff;
}

.piece-chip.active {
    border-color: #3498db;
    background: #e8f4fd;
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.2);
}

.piece-chip.checked {
    border-color: #27ae60;
    background: #f0fdf4;
}

.piece-chip.checked::after {
    content: '✓';
    color: #27ae60;
    font-weight: bold;
}

.piece-chip .piece-name {
    font-weight: 500;
    color: #2c3e50;
}

.piece-chip .piece-dims {
    font-size: 0.8rem;
    color: #666;
}

.piece-chip.tall-piece {
    border-color: #f39c12;
    background: #fff8e6;
}

.pieces-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    padding-top: 10px;
    border-top: 1px solid #eee;
}

.pieces-counter {
    font-weight: 600;
    color: #2c3e50;
}

.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: #3498db;
    background: #e8f4fd;
    padding: 4px 12px;
    border-radius: 12px;
    margin-left: 10px;
}

/* BETA Tab Styles */
.beta-tab {
    position: relative;
}

.beta-badge {
    font-size: 0.65rem;
    background: #f39c12;
    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: #f39c12;
    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 #f39c12;
    color: #f39c12;
    font-weight: 600;
}

.btn-outline-beta:hover {
    background: #fff8e6;
    border-color: #e67e22;
    color: #e67e22;
}

/* BETA Banner */
.beta-banner {
    background: linear-gradient(135deg, #fff8e6 0%, #fef5e6 100%);
    border: 2px solid #f39c12;
    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: #7c5c00;
    margin-bottom: 15px;
}

.beta-warnings {
    background: #fff;
    border-radius: 8px;
    padding: 15px;
    font-size: 0.9rem;
    color: #7c5c00;
}

.beta-warnings ul {
    margin: 10px 0;
    padding-left: 20px;
}

.beta-warnings li {
    margin: 5px 0;
}

.beta-warnings strong {
    color: #e67e22;
}

/* Load Builder Header */
.loadbuilder-header {
    background: linear-gradient(135deg, #e8f4fd 0%, #d4ecfa 100%);
    border: 2px solid #3498db;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.loadbuilder-header h2 {
    color: #2980b9;
    border-bottom: none;
    margin-bottom: 10px;
    padding-bottom: 0;
}

.loadbuilder-header > p {
    color: #34495e;
    margin-bottom: 15px;
}

.loadbuilder-warning {
    background: #fff;
    border-radius: 8px;
    padding: 15px;
    font-size: 0.9rem;
    color: #7c5c00;
    border-left: 4px solid #f39c12;
}

.loadbuilder-warning strong {
    color: #e67e22;
}

/* State Regulations Styles */
.state-regs-section {
    background: #fff;
    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: #2c3e50;
}

.state-regs-section > p {
    color: #666;
    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 #ddd;
    border-radius: 6px;
    min-width: 250px;
    cursor: pointer;
}

.state-selector select:focus {
    border-color: #3498db;
    outline: none;
}

.state-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.info-card {
    background: #f8fafc;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
}

.info-card h3 {
    margin: 0 0 15px 0;
    font-size: 1rem;
    color: #2c3e50;
    border-bottom: 2px solid #3498db;
    padding-bottom: 8px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    color: #666;
    font-weight: 500;
}

.info-value {
    font-weight: 600;
    color: #2c3e50;
}

.notes-row {
    flex-direction: column;
    gap: 5px;
}

.notes-row .info-value {
    font-weight: 400;
    font-size: 0.9rem;
    color: #666;
    font-style: italic;
}

/* Load Builder Styles - Drag & Drop */
.loadbuilder-pool {
    background: #fff;
    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 #ddd;
    border-radius: 8px;
    padding: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    transition: all 0.2s;
}

.piece-pool.drag-over {
    border-color: #3498db;
    background: #f0f7ff;
}

.piece-pool .empty-state {
    width: 100%;
    text-align: center;
    color: #999;
    padding: 20px;
}

/* Draggable Piece */
.draggable-piece {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: #f8f9fa;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: grab;
    transition: all 0.2s;
    font-size: 0.85rem;
    user-select: none;
}

.draggable-piece:hover {
    border-color: #3498db;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.draggable-piece.dragging {
    opacity: 0.5;
    cursor: grabbing;
}

.draggable-piece.tall {
    background: #fff8e6;
    border-color: #f39c12;
}

.draggable-piece .piece-name {
    font-weight: 600;
    color: #2c3e50;
}

/* Piece number badge in Load Builder */
.piece-num-badge {
    display: inline-block;
    background: #3498db;
    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: #3498db;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 3px;
}

.draggable-piece .piece-dims {
    color: #666;
    font-size: 0.85rem;
}

.draggable-piece .piece-weight {
    color: #888;
    font-size: 0.8rem;
}

.draggable-piece.stackable {
    border-left: 3px solid #27ae60;
}

.stackable-badge {
    margin-left: 6px;
    font-size: 0.75rem;
    color: #27ae60;
}

/* 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, #1a2a3a 0%, #2c4a6a 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: #f39c12;
}

.escort-warning {
    color: #e74c3c;
}

.night-warning {
    color: #9b59b6;
}

/* AI Recommendations */
.ai-recommendations {
    background: #fff;
    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: #2c3e50;
}

.recommendations-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.recommendation-card {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 10px 14px;
    min-width: 180px;
    cursor: pointer;
    transition: all 0.2s;
}

.recommendation-card:hover {
    background: #e8f4f8;
    border-color: #3498db;
}

.recommendation-card.legal {
    border-left: 3px solid #27ae60;
}

.recommendation-card.permit-needed {
    border-left: 3px solid #f39c12;
}

.recommendation-card .trailer-name {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 4px;
}

.recommendation-card .trailer-height {
    font-size: 0.85rem;
    color: #666;
}

.recommendation-card .trailer-status {
    font-size: 0.8rem;
    margin-top: 4px;
}

.recommendation-card .trailer-status.legal {
    color: #27ae60;
}

.recommendation-card .trailer-status.permit {
    color: #f39c12;
}

.recommendation-card .accept-btn {
    margin-top: 8px;
    width: 100%;
    padding: 6px 12px;
    font-size: 0.85rem;
    background: #27ae60;
    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: #2980b9;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.recommendation-card .view-specs-btn:hover {
    background: #f0f7ff;
    border-color: #2980b9;
}

.recommendation-specs {
    margin-top: 8px;
    padding: 10px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.8rem;
}

.recommendation-specs .spec-row {
    margin-bottom: 4px;
    color: #555;
}

.recommendation-specs .zones-header {
    margin-top: 8px;
    margin-bottom: 4px;
    color: #333;
}

.recommendation-specs .zone-spec {
    padding-left: 10px;
    color: #666;
    font-size: 0.75rem;
}

/* Accepted Load Plan */
.accepted-plan {
    background: #f0fff4;
    border: 2px solid #27ae60;
    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: #27ae60;
}

.plan-header-actions {
    display: flex;
    gap: 8px;
}

.accepted-plan-actions {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #27ae60;
    display: flex;
    align-items: center;
    gap: 15px;
}

.accepted-plan-actions .btn {
    min-width: 200px;
}

.action-hint {
    font-size: 12px;
    color: #666;
}

.recommendations-actions {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
    text-align: center;
}

.recommendations-actions .btn {
    min-width: 160px;
}

.accepted-plan-details {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.plan-truck {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 12px;
    min-width: 200px;
    flex: 1;
}

.plan-truck-header {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid #eee;
}

.plan-truck-pieces {
    font-size: 0.85rem;
    color: #666;
}

.plan-truck-pieces li {
    margin: 4px 0;
}

.plan-truck-stats {
    margin-top: 8px;
    font-size: 0.9rem;
    color: #555;
    font-weight: 500;
}

.overweight-warning {
    color: #e74c3c;
    font-weight: 700;
    margin-left: 10px;
    animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* Super-heavy and warning alerts */
.super-heavy-alert {
    background: #e74c3c;
    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: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 6px;
    padding: 8px 12px;
    margin: 10px 0;
    font-size: 12px;
}

.warning-item {
    color: #856404;
    margin: 4px 0;
}

/* OD Truck styling */
.plan-truck.od-truck {
    border-left: 4px solid #e74c3c;
    background: #fff5f5;
}

.plan-truck.legal-truck {
    border-left: 4px solid #27ae60;
    background: #f0fff4;
}

.od-badge {
    background: #e74c3c;
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 3px;
    margin-left: 8px;
    font-weight: 600;
}

.legal-badge {
    background: #27ae60;
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 3px;
    margin-left: 8px;
    font-weight: 600;
}

.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 #e0e0e0;
    text-align: center;
}

.permit-check-actions .btn {
    min-width: 280px;
}

.permit-check-note {
    font-size: 12px;
    color: #666;
    margin-top: 8px;
}

/* Trailer breakdown in recommendations */
.trailer-breakdown {
    margin: 8px 0;
    padding: 8px;
    background: rgba(0,0,0,0.03);
    border-radius: 4px;
}

.trailer-breakdown-item {
    font-size: 12px;
    color: #555;
    padding: 2px 0;
}

/* Birds-Eye Trailer Visualization */
.trailer-viz-container {
    margin: 12px 0;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 6px;
}

.trailer-viz-label {
    font-size: 11px;
    color: #666;
    margin-bottom: 8px;
    font-weight: 600;
    text-transform: uppercase;
}

.trailer-viz {
    position: relative;
    background: #fff;
    border: 2px solid #333;
    border-radius: 4px;
    overflow: hidden;
    margin: 0 auto;
}

.trailer-outline {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 1px dashed #ccc;
    pointer-events: none;
}

.trailer-front,
.trailer-rear {
    position: absolute;
    font-size: 9px;
    color: #999;
    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(255,255,255,0.8);
    text-shadow: 0 1px 1px rgba(0,0,0,0.5);
}

.trailer-dims-label {
    font-size: 10px;
    color: #888;
    text-align: center;
    margin-top: 6px;
}

.trailer-viz-placeholder {
    padding: 20px;
    text-align: center;
    color: #888;
    font-size: 0.85rem;
    font-style: italic;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px dashed #ddd;
}

.trailer-piece.oversize-piece {
    box-shadow: 0 0 0 2px #e74c3c;
}

.recommendation-card.has-warnings {
    border-color: #ffc107;
    background: #fffef5;
}

/* Truck Groups */
.loadbuilder-trucks {
    background: #fff;
    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: #f8f9fa;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    transition: all 0.2s;
}

.truck-group.drag-over {
    border-color: #3498db;
    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: #2c3e50;
    color: #fff;
}

.truck-header h4 {
    margin: 0;
    font-size: 1rem;
}

.truck-remove {
    background: transparent;
    border: none;
    color: #e74c3c;
    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: #fff;
}

.truck-drop-zone .empty-hint {
    width: 100%;
    text-align: center;
    color: #bbb;
    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: #f8f9fa;
    border-top: 1px solid #e0e0e0;
}

.truck-stat {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
}

.truck-stat .label {
    color: #666;
}

.truck-stat .value {
    font-weight: 600;
    color: #2c3e50;
}

.truck-stat .value.weight-ok {
    color: #27ae60;
}

.truck-stat .value.weight-warning {
    color: #e74c3c;
    font-weight: 700;
}

.truck-stat .value.height-ok {
    color: #27ae60;
}

.truck-stat .value.height-warning {
    color: #e74c3c;
}

.truck-trailer-select {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.truck-trailer-select select {
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.85rem;
    background: #fff;
}

.trailer-recommended {
    font-size: 0.75rem;
    color: #27ae60;
    font-weight: 500;
}

/* No trucks message */
.no-trucks-msg {
    text-align: center;
    padding: 30px;
    color: #999;
}

/* Trucks permit action */
.trucks-permit-action {
    margin-top: 20px;
    padding: 15px;
    text-align: center;
    background: #f0f7ff;
    border-radius: 8px;
}

/* Truck visualization (birds-eye) */
.truck-viz {
    padding: 10px 15px;
    background: #fafafa;
    border-top: 1px dashed #ddd;
}

.viz-trailer {
    position: relative;
    background: linear-gradient(to bottom, #e8e8e8 0%, #f5f5f5 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: #888;
    font-weight: 600;
    left: 50%;
    transform: translateX(-50%);
}

.viz-label-front {
    top: -16px;
}

.viz-label-rear {
    bottom: -16px;
}

.viz-piece {
    position: absolute;
    border: 1px solid rgba(255,255,255,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 #e74c3c;
    box-shadow: 0 0 4px rgba(231,76,60,0.5);
}

.viz-dims {
    text-align: center;
    font-size: 11px;
    color: #888;
    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;
    }
}

/* Feedback Button */
.feedback-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #3498db;
    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;
}

.feedback-btn:hover {
    background: #2980b9;
    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: #fff;
    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 #eee;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    color: #2c3e50;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #999;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.modal-close:hover {
    color: #333;
}

.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 #eee;
    background: #f8f9fa;
}

.feedback-field {
    margin-bottom: 15px;
}

.feedback-field label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    color: #555;
    margin-bottom: 6px;
}

.feedback-field input[type="text"],
.feedback-field textarea,
.feedback-field select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    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: #666;
}

/* Lane Mapper Styles */
.lane-mapper-section {
    background: #fff;
    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 #eee;
}

.mic-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 3px solid #3498db;
    background: linear-gradient(135deg, #f0f7ff 0%, #e8f4fd 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: #e74c3c;
    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: #666;
    font-weight: 500;
}

.mic-btn.listening .mic-text {
    color: #e74c3c;
}

.voice-status {
    font-size: 0.95rem;
    color: #666;
    text-align: center;
    min-height: 24px;
}

.voice-status.error {
    color: #e74c3c;
}

.voice-status.success {
    color: #27ae60;
}

.voice-status.processing {
    color: #3498db;
}

.voice-status.listening {
    color: #9b59b6;
    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, #2c3e50 0%, #3498db 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(255, 255, 255, 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: #fff;
    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: #e8e8e8;
}

/* 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: #e8e8e8;
}

@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: #666;
    margin: 0;
}

/* Upload Section */
.ratecheck-upload-section {
    margin-bottom: 20px;
}

.ratecheck-upload-section .paste-target {
    min-height: 150px;
}

.ratecheck-image-preview {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    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: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.ratecheck-info-section h3 {
    margin: 0 0 5px 0;
    font-size: 1.1rem;
}

.ratecheck-inputs {
    display: flex;
    gap: 15px;
    align-items: flex-end;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.ratecheck-field {
    flex: 1;
    min-width: 150px;
}

.ratecheck-field label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: #555;
    margin-bottom: 4px;
}

.ratecheck-field input,
.ratecheck-field select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    font-size: 1rem;
    background: white;
}

.ratecheck-field input:focus,
.ratecheck-field select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 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: 1fr 1fr;
    gap: 20px;
}

@media (max-width: 900px) {
    .results-grid {
        grid-template-columns: 1fr;
    }
}

/* Map Column */
.results-map-col {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    overflow: hidden;
}

.ratecheck-map {
    width: 100%;
    height: 350px;
    background: #e8e8e8;
}

.map-info {
    padding: 12px 15px;
    background: white;
    border-top: 1px solid #dee2e6;
    text-align: center;
}

.map-info .miles-display {
    font-size: 1.2rem;
    font-weight: 600;
    color: #2c3e50;
}

/* Rates Column */
.results-rates-col {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* 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 #dee2e6;
    border-radius: 8px;
    padding: 15px 20px;
}

.rates-card.market-rates {
    border-top: 3px solid #3498db;
}

.rates-card.network-rates {
    border-top: 3px solid #9b59b6;
}

.rates-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    border-bottom: 1px solid #eee;
    padding-bottom: 8px;
}

.rates-header h4 {
    margin: 0;
    font-size: 0.95rem;
    color: #333;
}

.rates-source {
    font-size: 0.75rem;
    color: #888;
    background: #f0f0f0;
    padding: 2px 8px;
    border-radius: 10px;
}

.market-rates .rates-source {
    background: #ebf5fb;
    color: #2980b9;
}

.network-rates .rates-source {
    background: #f5eef8;
    color: #8e44ad;
}

.rates-confidence {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 10px;
    font-size: 0.85rem;
}

.rates-confidence .conf-label {
    color: #666;
}

.rates-confidence .conf-value {
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    background: #f0f0f0;
}

.rates-confidence .conf-value.high {
    background: #d4edda;
    color: #155724;
}

.rates-confidence .conf-value.medium {
    background: #fff3cd;
    color: #856404;
}

.rates-confidence .conf-value.low {
    background: #f8d7da;
    color: #721c24;
}

.rates-card h4,
.margin-card h4 {
    margin: 0 0 15px 0;
    font-size: 1rem;
    color: #555;
    border-bottom: 1px solid #eee;
    padding-bottom: 8px;
}

/* Collapsible Section Toggle */
.collapsible-section {
    background: white;
    border: 1px solid #dee2e6;
    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: #f8f9fa;
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    color: #333;
}

.section-toggle:hover {
    background: #e9ecef;
}

.section-toggle .toggle-icon {
    font-size: 1.2rem;
    font-weight: bold;
    color: #666;
}

.section-content {
    padding: 15px;
    border-top: 1px solid #dee2e6;
}

/* 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 #eee;
}

.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: #666;
}

.custom-fuel-row input {
    width: 70px;
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
}

.fuel-hint {
    font-size: 0.8rem;
    color: #888;
}

.fuel-line {
    color: #e74c3c;
}

.fuel-line span:last-child {
    color: #e74c3c;
}

.margin-line {
    border-top: 1px dashed #ddd;
    padding-top: 8px;
    margin-top: 4px;
}

/* Carriers Card */
.carriers-card {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 15px;
}

.carriers-card h4 {
    margin: 0 0 12px 0;
    font-size: 0.95rem;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
}

.carrier-source {
    font-size: 0.75rem;
    color: #888;
    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: #f8f9fa;
    border-radius: 6px;
    border-left: 3px solid #27ae60;
}

.carrier-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.carrier-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: #333;
}

.carrier-mc {
    font-size: 0.8rem;
    color: #666;
}

.carrier-rate {
    text-align: right;
}

.carrier-rate-value {
    font-weight: 700;
    color: #27ae60;
    font-size: 1rem;
}

.carrier-rate-pm {
    font-size: 0.75rem;
    color: #888;
}

.carrier-link-gs {
    display: inline-block;
    padding: 4px 10px;
    background: #3498db;
    color: white;
    border-radius: 4px;
    font-size: 0.75rem;
    text-decoration: none;
    margin-top: 4px;
}

.carrier-link-gs:hover {
    background: #2980b9;
}

.no-carriers {
    color: #888;
    font-size: 0.9rem;
    text-align: center;
    padding: 15px;
}

/* Accessorials Card */
.accessorials-card {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    overflow: hidden;
}

.accessorials-toggle {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #f8f9fa;
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    color: #333;
}

.accessorials-toggle:hover {
    background: #e9ecef;
}

.accessorials-toggle .toggle-icon {
    font-size: 1.2rem;
    font-weight: bold;
    color: #666;
}

.accessorials-content {
    padding: 12px 16px;
    border-top: 1px solid #dee2e6;
}

.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: #f8f9fa;
    border-radius: 6px;
    cursor: pointer;
}

.accessorial-item:hover {
    background: #e9ecef;
}

.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: #e67e22;
    font-size: 0.9rem;
}

.accessorials-total {
    display: flex;
    justify-content: space-between;
    padding: 10px 12px;
    background: #fff3cd;
    border-radius: 6px;
    font-weight: 600;
}

.accessorials-total span:last-child {
    color: #e67e22;
}

/* Quote Builder */
.quote-breakdown {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px dashed #dee2e6;
}

.quote-line {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    font-size: 0.9rem;
}

.quote-line span:first-child {
    color: #666;
}

.quote-line span:last-child {
    font-weight: 500;
}

/* Rate Breakdown Card */
.rate-breakdown-card {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    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: #666;
}

.breakdown-row span:last-child {
    font-weight: 600;
    color: #333;
}

/* Rate Range Display */
.rate-range {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.rate-row {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 6px;
    background: #f8f9fa;
}

.rate-row .rate-label {
    width: 50px;
    font-size: 0.85rem;
    font-weight: 500;
    color: #666;
}

.rate-row .rate-value {
    flex: 1;
    font-size: 1.3rem;
    font-weight: 700;
    text-align: center;
}

.rate-row .rate-per-mile {
    width: 80px;
    text-align: right;
    font-size: 0.9rem;
    color: #666;
}

.rate-low {
    border-left: 4px solid #27ae60;
}

.rate-low .rate-value {
    color: #27ae60;
}

.rate-avg {
    border-left: 4px solid #3498db;
    background: #ebf5fb;
}

.rate-avg .rate-value {
    color: #2980b9;
}

.rate-high {
    border-left: 4px solid #e74c3c;
}

.rate-high .rate-value {
    color: #e74c3c;
}

/* Margin Calculator */
.margin-input-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.margin-input-row label {
    font-weight: 500;
    color: #555;
}

.margin-input-row input {
    width: 80px;
    padding: 8px 12px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    font-size: 1.1rem;
    text-align: center;
}

.margin-result {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    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(255,255,255,0.3);
    padding-top: 10px;
    margin-top: 5px;
}

/* Voice Input for Rate Check */
.ratecheck-voice-section {
    margin: 15px 0;
    padding: 15px 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.voice-input-row {
    display: flex;
    align-items: center;
    gap: 15px;
}

.btn-voice {
    background: linear-gradient(135deg, #9b59b6, #8e44ad);
    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, #e74c3c, #c0392b);
    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: #666;
    font-size: 0.9rem;
    font-style: italic;
}

#rateCheckVoiceStatus {
    margin-top: 10px;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.9rem;
}

#rateCheckVoiceStatus.listening {
    background: #fff3e0;
    color: #e65100;
}

#rateCheckVoiceStatus.success {
    background: #e8f5e9;
    color: #2e7d32;
}

#rateCheckVoiceStatus.error {
    background: #ffebee;
    color: #c62828;
}

/* Confidence Card */
.confidence-card {
    background: white;
    border: 1px solid #dee2e6;
    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: #666;
}

.confidence-value {
    font-size: 1.3rem;
    font-weight: 700;
    color: #3498db;
}

.confidence-value.high { color: #27ae60; }
.confidence-value.medium { color: #f39c12; }
.confidence-value.low { color: #e74c3c; }

.rate-breakdown {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: #666;
    border-top: 1px solid #eee;
    padding-top: 8px;
}

/* Carrier Links Card */
.carrier-links-card {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 15px 20px;
    margin-top: 10px;
}

.carrier-links-card h4 {
    margin: 0 0 12px 0;
    font-size: 1rem;
    color: #555;
}

.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: #e8f4fd;
    color: #0066cc;
    border: 1px solid #b8daff;
}

.highway-link:hover {
    background: #d0e9fc;
}

.dat-link {
    background: #fff3e0;
    color: #e65100;
    border: 1px solid #ffcc80;
}

.dat-link:hover {
    background: #ffe0b2;
}

.truckstop-link {
    background: #e8f5e9;
    color: #2e7d32;
    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: #666;
    margin-bottom: 20px;
}

.user-id-field {
    text-align: left;
}

.user-id-field label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #2c3e50;
}

.user-id-field input {
    width: 100%;
    padding: 12px 15px;
    font-size: 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    transition: border-color 0.2s;
}

.user-id-field input:focus {
    outline: none;
    border-color: #3498db;
}

.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: 20px;
    margin-top: 40px;
    border-top: 1px solid #333;
    color: #666;
    font-size: 0.85rem;
}

.site-footer p {
    margin: 5px 0;
}

.site-footer .confidential {
    font-size: 0.75rem;
    color: #555;
}

/* 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: #666;
    margin-bottom: 20px;
    font-size: 0.9rem;
}

.auth-error {
    background: #fef2f2;
    border: 1px solid #ef4444;
    color: #dc2626;
    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: #2c3e50;
    font-size: 0.9rem;
}

.auth-field input {
    width: 100%;
    padding: 12px 15px;
    font-size: 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.auth-field input:focus {
    outline: none;
    border-color: #3498db;
}

.btn-block {
    width: 100%;
    padding: 14px;
    font-size: 1.1rem;
    margin-top: 10px;
}

.auth-switch {
    margin-top: 20px;
    color: #666;
    font-size: 0.9rem;
}

.auth-switch a {
    color: #3498db;
    text-decoration: none;
    font-weight: 600;
}

.auth-switch a:hover {
    text-decoration: underline;
}
