/* T-L Quick Calculators - Unified Web Application Styles */

:root {
    --primary-color: #1e5799;
    --primary-dark: #153d66;
    --primary-light: #2a7ccc;
    --accent-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --text-color: #222;
    --text-muted: #000;
    --border-color: #ccc;
    --background-color: #f8f9fa;
    --card-background: #ffffff;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 4px 12px rgba(0, 0, 0, 0.15);
    --radius: 8px;
    --radius-sm: 4px;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 16px;
    color: var(--text-color);
    background-color: var(--background-color);
    line-height: 1.5;
}

/* Page Layout */
.page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.top-header {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    padding: 1rem 2rem;
    box-shadow: var(--shadow);
}

.header-content {
    max-width: 1800px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo-image {
    height: 50px;
    width: auto;
    border-radius: 4px;
}

.logo-text {
    font-size: 1.25rem;
    font-weight: 600;
}

.top-header h1 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 500;
}

.version {
    font-size: 0.875rem;
    opacity: 0.8;
}

/* Main Tabs Navigation */
.main-tabs {
    background: var(--primary-dark);
    padding: 0 2rem;
    display: flex;
    gap: 0.25rem;
    max-width: 100%;
    overflow-x: auto;
}

.main-tabs button {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.8);
    padding: 1rem 1.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    border-bottom: 3px solid transparent;
}

.main-tabs button:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

.main-tabs button.active {
    color: white;
    background: rgba(255, 255, 255, 0.15);
    border-bottom-color: var(--accent-color);
}

/* Sub Tabs */
.sub-tabs {
    background: var(--background-color);
    padding: 0.5rem 1.5rem;
    display: flex;
    gap: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.sub-tabs button {
    background: white;
    border: 2px solid var(--border-color);
    color: var(--text-color);
    padding: 0.625rem 1.25rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.sub-tabs button:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.sub-tabs button.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 2rem;
    max-width: 1800px;
    margin: 0 auto;
    width: 100%;
}

/* Footer */
.footer {
    background: var(--primary-dark);
    color: white;
    padding: 1rem 2rem;
    text-align: center;
    font-size: 0.875rem;
}

.footer-content {
    max-width: 1800px;
    margin: 0 auto;
}

.separator {
    margin: 0 1rem;
    opacity: 0.5;
}

/* Project Management Bar */
.project-management-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, #153d66 0%, #1e5a8a 100%);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.project-management-bar .project-selector {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
}

.project-management-bar .project-selector label {
    color: white;
    font-weight: 600;
    white-space: nowrap;
}

.project-management-bar .project-selector select {
    flex: 1;
    max-width: 400px;
    padding: 0.5rem 0.75rem;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: var(--radius-sm);
    background: white;
    font-size: 0.9rem;
    cursor: pointer;
}

.project-management-bar .project-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-project {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}

.btn-project.btn-new {
    background: #28a745;
    color: white;
}

.btn-project.btn-new:hover {
    background: #218838;
}

.btn-project.btn-delete {
    background: #dc3545;
    color: white;
}

.btn-project.btn-delete:hover:not(:disabled) {
    background: #c82333;
}

.btn-project:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Project Info Bar */
.project-info-bar {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.project-info-bar .form-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0;
}

.project-info-bar label {
    font-weight: 500;
    white-space: nowrap;
}

.project-info-bar input {
    width: 200px;
    padding: 0.375rem 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
}

/* Calculator Container */
.calculator-container {
    background: var(--card-background);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.tab-content {
    padding: 2.5rem;
}

/* Calculator Panel */
.calculator-panel {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.calculator-panel h2 {
    margin: 0 0 0.5rem 0;
    color: var(--primary-color);
    font-size: 1.5rem;
}

.calculator-panel .description {
    color: var(--text-muted);
    margin: 0 0 2rem 0;
}

/* Mode Toggle */
.mode-toggle {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.mode-toggle button {
    padding: 0.5rem 1.5rem;
    border: 2px solid var(--primary-color);
    background: white;
    color: var(--primary-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
}

.mode-toggle button.active {
    background: var(--primary-color);
    color: white;
}

.mode-toggle button:hover:not(.active) {
    background: rgba(30, 87, 153, 0.1);
}

/* Equipment Toggle */
.equipment-toggle {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.equipment-toggle button {
    padding: 0.5rem 1rem;
    border: 2px solid var(--accent-color);
    background: white;
    color: var(--accent-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
}

.equipment-toggle button.active {
    background: var(--accent-color);
    color: white;
}

.equipment-toggle button:hover:not(.active) {
    background: rgba(40, 167, 69, 0.1);
}

/* Form Grid */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(380px, 100%), 1fr));
    gap: 2.5rem;
    margin-bottom: 2rem;
}

/* Input Section */
.input-section {
    background: var(--background-color);
    padding: 2rem;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
}

.input-section h3 {
    margin: 0 0 1.25rem 0;
    font-size: 1.25rem;
    color: var(--primary-dark);
    padding-bottom: 0.5rem;
    border-bottom: 3px solid var(--primary-color);
}

.input-section h4 {
    margin: 1rem 0 0.5rem 0;
    font-size: 0.9rem;
    color: var(--primary-dark);
}

.input-section.blended-section {
    background: linear-gradient(135deg, rgba(40, 167, 69, 0.1), rgba(30, 87, 153, 0.1));
    border-color: var(--accent-color);
}

.input-section.blended-section h3 {
    border-bottom-color: var(--accent-color);
}

/* Form Groups */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-color);
}

.form-group input[type="number"],
.form-group input[type="text"],
.form-group input[type="date"],
.form-group select {
    width: 100%;
    height: 2.5rem;
    padding: 0.625rem 0.875rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(30, 87, 153, 0.15);
}

.input-with-unit {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.input-with-unit input,
.input-with-unit select {
    flex: 1;
}

.unit {
    font-size: 0.875rem;
    color: var(--text-muted);
    min-width: 30px;
}

.currency {
    font-size: 1rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* Average Span Display */
.avg-span {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem;
    background: rgba(30, 87, 153, 0.1);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
}

.avg-label {
    color: var(--text-muted);
}

.avg-value {
    font-weight: 600;
    color: var(--primary-dark);
}

/* Info Box */
.info-box {
    background: rgba(30, 87, 153, 0.05);
    border: 1px solid rgba(30, 87, 153, 0.2);
    border-radius: var(--radius-sm);
    padding: 1rem;
    margin-top: 1rem;
}

.info-box h4 {
    margin: 0 0 0.5rem 0;
    font-size: 0.875rem;
    color: var(--primary-dark);
}

.info-box .hint {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

/* Readonly Value */
.readonly-value {
    padding: 0.625rem 0.75rem;
    background: rgba(30, 87, 153, 0.05);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-family: 'Consolas', monospace;
    font-weight: 500;
    color: var(--primary-dark);
}

.readonly-value.highlight {
    background: rgba(40, 167, 69, 0.15);
    border-color: var(--accent-color);
    color: #155724;
}

/* Results Section */
.results-section {
    background: linear-gradient(135deg, rgba(30, 87, 153, 0.05), rgba(40, 167, 69, 0.05));
}

.result-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
}

.result-row:last-of-type {
    border-bottom: none;
}

.result-row .result-label {
    color: var(--text-muted);
    font-size: 1rem;
}

.result-row .result-value {
    font-weight: 700;
    font-size: 1.1rem;
    font-family: 'Consolas', monospace;
}

.result-row.highlight {
    background: var(--primary-color);
    color: white;
    padding: 1rem;
    margin: 0.5rem -1rem;
    border-radius: 4px;
    font-size: 1.15rem;
}

.result-row.highlight .result-label {
    color: rgba(255, 255, 255, 0.9);
}

.result-row.warning .result-value {
    color: var(--danger-color);
}

.result-warning {
    color: var(--danger-color);
    font-weight: 600;
    font-size: 0.875rem;
    padding: 0.5rem;
    background: rgba(220, 53, 69, 0.1);
    border-radius: var(--radius-sm);
    margin: 0.5rem 0;
}

.result-note {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-style: italic;
    margin: 0.125rem 0 0.5rem 0;
    padding-left: 0.5rem;
    border-left: 2px solid var(--border-color);
}

/* Report Info */
.report-info {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 1rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.report-info .form-group {
    flex: 1;
    margin-bottom: 0;
}

.report-info input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
}

/* Actions */
.actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-bottom: 2rem;
}

.btn-primary,
.btn-secondary {
    padding: 0.875rem 2.25rem;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-dark);
    box-shadow: var(--shadow);
}

.btn-primary:disabled {
    background: #adb5bd;
    cursor: not-allowed;
}

.btn-secondary {
    background: var(--card-background);
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

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

/* Print Orientation Selector */
.print-orientation-select {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    background: var(--card-background);
    color: var(--text-color);
    cursor: pointer;
}

.print-orientation-select:hover {
    border-color: var(--primary-color);
}

/* Results Panel */
.results-panel {
    background: linear-gradient(135deg, rgba(30, 87, 153, 0.05), rgba(40, 167, 69, 0.05));
    border: 2px solid var(--primary-color);
    border-radius: var(--radius);
    padding: 1.75rem;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.results-panel h3 {
    margin: 0 0 0.5rem 0;
    color: var(--primary-dark);
    font-size: 1.25rem;
}

.results-panel h4 {
    margin: 1.5rem 0 0.75rem 0;
    color: var(--primary-dark);
    font-size: 1rem;
}

.table-subtitle {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin: 0 0 1rem 0;
    text-align: center;
}

/* Results Table */
.results-table-container {
    max-height: 500px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
}

.results-table {
    width: 100%;
    border-collapse: collapse;
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 1rem;
}

.results-table thead {
    background: var(--primary-color);
    color: white;
    position: sticky;
    top: 0;
}

.results-table th {
    padding: 0.875rem 1rem;
    text-align: left;
    font-weight: 700;
    font-size: 1rem;
}

.results-table td {
    padding: 0.625rem 1rem;
    border-bottom: 1px solid var(--border-color);
}

.results-table tbody tr:hover {
    background: rgba(30, 87, 153, 0.05);
}

.results-table tbody tr:nth-child(even) {
    background: rgba(0, 0, 0, 0.02);
}

.results-table tbody tr.buyout-row {
    background: #fff3cd;
    font-weight: 600;
}

.results-table tbody tr.buyout-row:hover {
    background: #ffe69c;
}

.results-table tfoot {
    background: var(--background-color);
}

.results-table .totals-row td {
    border-top: 2px solid var(--primary-color);
    padding: 0.75rem 1rem;
}

/* Buyout Info */
.buyout-info {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    margin-top: 1rem;
    color: #856404;
}

/* Responsive - Tablets */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }

    .top-header {
        padding: 0.75rem 1rem;
    }

    .main-tabs {
        padding: 0 0.25rem;
    }

    .main-tabs button {
        padding: 0.625rem 0.75rem;
        font-size: 0.85rem;
    }

    .sub-tabs {
        padding: 0.5rem 0.75rem;
        flex-wrap: wrap;
    }

    .sub-tabs button {
        padding: 0.5rem 0.875rem;
        font-size: 0.875rem;
    }

    .main-content {
        padding: 1rem;
    }

    .tab-content {
        padding: 1.25rem;
    }

    .form-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    .input-section {
        padding: 1.25rem;
    }

    .input-section h3 {
        font-size: 1.1rem;
    }

    .results-panel {
        padding: 1.25rem;
    }

    .actions {
        flex-direction: row;
    }

    .mode-toggle,
    .equipment-toggle {
        flex-wrap: wrap;
        justify-content: center;
    }

    .result-row.highlight {
        margin: 0.5rem -0.5rem;
    }

    .calculator-panel h2 {
        font-size: 1.25rem;
    }
}

/* Responsive - Phones */
@media (max-width: 480px) {
    .top-header {
        padding: 0.5rem 0.75rem;
    }

    .top-header h1 {
        font-size: 1.15rem;
    }

    .logo-text {
        font-size: 1rem;
    }

    .logo-image {
        height: 36px;
    }

    .main-tabs {
        padding: 0;
        gap: 0;
    }

    .main-tabs button {
        padding: 0.5rem 0.5rem;
        font-size: 0.75rem;
    }

    .sub-tabs {
        padding: 0.375rem 0.5rem;
        gap: 0.375rem;
    }

    .sub-tabs button {
        padding: 0.375rem 0.625rem;
        font-size: 0.8rem;
    }

    .main-content {
        padding: 0.5rem;
    }

    .tab-content {
        padding: 0.75rem;
    }

    .form-grid {
        gap: 1rem;
    }

    .input-section {
        padding: 0.875rem;
    }

    .input-section h3 {
        font-size: 1rem;
        margin-bottom: 0.875rem;
    }

    .form-group {
        margin-bottom: 0.875rem;
    }

    .form-group label {
        font-size: 0.875rem;
        margin-bottom: 0.25rem;
    }

    .form-group input[type="number"],
    .form-group input[type="text"],
    .form-group input[type="date"],
    .form-group select {
        padding: 0.5rem 0.625rem;
        font-size: 0.9rem;
    }

    .btn-primary,
    .btn-secondary {
        padding: 0.625rem 1.25rem;
        font-size: 0.95rem;
    }

    .results-panel {
        padding: 0.875rem;
    }

    .results-table th {
        padding: 0.5rem 0.375rem;
        font-size: 0.8rem;
    }

    .results-table td {
        padding: 0.375rem;
        font-size: 0.85rem;
    }

    .calculator-panel h2 {
        font-size: 1.1rem;
    }

    .calculator-panel .description {
        font-size: 0.85rem;
        margin-bottom: 1rem;
    }

    .readonly-value {
        padding: 0.5rem 0.625rem;
        font-size: 0.9rem;
    }

    .footer {
        padding: 0.75rem;
        font-size: 0.75rem;
    }

    .separator {
        margin: 0 0.25rem;
    }

    /* Project management bar */
    .project-management-bar {
        flex-wrap: wrap;
    }

    .project-info-bar {
        flex-direction: column;
        gap: 0.75rem;
    }

    .project-info-bar .form-group {
        flex-direction: column;
        align-items: stretch;
    }

    .project-info-bar input {
        width: 100%;
    }
}

/* Responsive - Oil Flow mobile stacking */
@media (max-width: 768px) {
    /* Override Oil Flow inline flex layouts to stack */
    .calculator-panel > div[style*="flex-direction: row"] {
        flex-direction: column !important;
    }

    .calculator-panel > div > div[style*="flex: 0 0 500px"] {
        flex: 1 1 auto !important;
        width: 100% !important;
    }

    .calculator-panel > div > div[style*="max-width: 750px"] {
        max-width: 100% !important;
    }

    /* Stack the calc inputs + calc results row */
    .calculator-panel div[style*="flex-wrap: nowrap"] {
        flex-wrap: wrap !important;
    }

    .calculator-panel div[style*="flex-wrap: nowrap"] > div[style*="min-width: 320px"] {
        min-width: 0 !important;
        flex: 1 1 100% !important;
    }

    .calculator-panel div[style*="flex-wrap: nowrap"] > div[style*="flex: 0 0 220px"] {
        flex: 1 1 100% !important;
    }

    /* Stack 2-col grids inside boxes */
    .calculator-panel div[style*="grid-template-columns: 1fr 1fr"] {
        grid-template-columns: 1fr !important;
    }

    /* Friction calculator header */
    .friction-header {
        flex-direction: column;
        gap: 0.75rem;
        align-items: stretch;
    }

    .section-toggles {
        flex-wrap: wrap;
    }

    .section-toggle {
        padding: 0.5rem 0.75rem;
        font-size: 0.85rem;
    }

    .friction-header .mode-toggle {
        gap: 0.75rem;
        padding: 0.375rem 0.75rem;
    }

    .friction-header .mode-toggle label {
        font-size: 0.85rem;
    }

    /* Friction calculator - full layout */
    .friction-calculator {
        padding: 0.75rem;
        overflow-x: hidden;
        max-width: 100%;
    }

    .friction-section {
        padding: 0.75rem;
        max-width: 100%;
        overflow-x: hidden;
    }

    .friction-section .section-content {
        flex-direction: column;
        gap: 1rem;
    }

    .friction-section .inputs-column {
        min-width: 0;
    }

    .friction-section .pipes-column,
    .friction-section .pipes-column.linear-pipes {
        min-width: 0;
    }

    .friction-section .results-column {
        min-width: 0;
    }

    /* Friction form rows - stack label above input */
    .friction-section .form-row {
        flex-wrap: wrap;
    }

    .friction-section .form-row label {
        flex: 1 1 100% !important;
        text-align: left !important;
        min-width: 0;
        padding-right: 0;
        margin-bottom: 0.25rem;
    }

    .friction-section .form-row input {
        width: auto !important;
        min-width: 0 !important;
        max-width: 100% !important;
        flex: 1 1 0 !important;
        box-sizing: border-box;
    }

    .friction-section .form-row .result-field,
    .friction-section .form-row .readonly-field {
        width: auto !important;
        min-width: 0 !important;
        max-width: 100% !important;
        flex: 1 1 0 !important;
        box-sizing: border-box;
    }

    .friction-section .form-row .unit {
        min-width: auto;
        flex-shrink: 0;
    }

    /* Pipe rows */
    .pipe-row .pipe-label {
        min-width: 120px;
        font-size: 0.8rem;
    }

    .pipe-row-linear .pipe-label {
        font-size: 0.8rem;
    }

    .side-headers {
        padding-left: 0;
        font-size: 0.8rem;
    }

    /* Mainline & Hose */
    .mainline-section .form-row label {
        flex: 1 1 100% !important;
        text-align: left;
    }

    .mainline-section select {
        width: 100%;
    }

    .hose-section .form-row label {
        flex: 1 1 100% !important;
        text-align: left;
    }

    .hose-section select {
        width: 100%;
    }
}

/* ============================================
   WIRE CALCULATOR SPECIFIC STYLES
   ============================================ */

/* Formula Display */
.formula-display {
    background: rgba(30, 87, 153, 0.1);
    border: 1px solid rgba(30, 87, 153, 0.3);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1.5rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

.formula-text {
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 1rem;
    color: var(--primary-dark);
    font-weight: 500;
}

/* Main Layout for Wire Calculator */
.main-layout {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
}

.lines-container {
    flex: 2;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.reference-panel {
    flex: 1;
    min-width: 280px;
    max-width: 320px;
    background: var(--background-color);
    border-radius: var(--radius);
    padding: 1rem;
    border: 1px solid var(--border-color);
    max-height: 700px;
    overflow-y: auto;
}

/* Line Frame */
.line-frame {
    background: var(--background-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1rem;
}

.line-frame h4 {
    margin: 0 0 1rem 0;
    color: #800080;
    font-size: 1rem;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}

/* Calculation Section */
.calc-section {
    margin-bottom: 1rem;
}

.calc-section:last-child {
    margin-bottom: 0;
}

.section-header {
    color: #800000;
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

/* Form Row (Wire Calculator) */
.form-row {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
    gap: 0.5rem;
}

.form-row label {
    flex: 1;
    font-size: 0.875rem;
    color: #000080;
    text-align: right;
}

.form-row input {
    width: 120px;
    padding: 0.375rem 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    text-align: center;
}

.form-row input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(30, 87, 153, 0.15);
}

.form-row.result label {
    color: #008000;
}

.form-row .result-field {
    background: #e9ecef;
    color: #008000;
    font-weight: 600;
}

/* Reference Panel Sections */
.reference-section {
    margin-bottom: 1rem;
}

.reference-section h4 {
    margin: 0 0 0.5rem 0;
    font-size: 0.875rem;
    color: #800000;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.25rem;
}

.reference-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.75rem;
    font-family: 'Consolas', 'Courier New', monospace;
}

.reference-table thead {
    background: var(--primary-color);
    color: white;
}

.reference-table th {
    padding: 0.375rem 0.5rem;
    text-align: left;
    font-weight: 500;
    font-size: 0.7rem;
}

.reference-table td {
    padding: 0.25rem 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.reference-table tbody tr:hover {
    background: rgba(30, 87, 153, 0.05);
}

.info-note {
    margin-top: 1rem;
    font-size: 0.75rem;
    color: #800080;
    text-align: center;
    font-style: italic;
}

/* Wire Calculator Responsive */
@media (max-width: 1200px) {
    .main-layout {
        flex-direction: column;
    }

    .reference-panel {
        max-width: none;
        max-height: none;
    }

    .lines-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .lines-container {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   MODERN WIRE CALCULATOR (VB6 Layout)
   ============================================ */

.wire-calculator {
    background: #f8f9fa;
}

.formula-display-vb6 {
    font-family: 'Courier New', monospace;
    font-size: 1rem;
    font-weight: 600;
    color: #153d66;
    text-align: center;
    margin-bottom: 1.25rem;
    line-height: 1.3;
    background: #fff;
    padding: 0.75rem;
    border-radius: 8px;
    border: 1px solid #dee2e6;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.wire-layout-vb6 {
    display: grid;
    grid-template-columns: 1fr 1.3fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.wire-column-left,
.wire-column-right {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.wire-column-center {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    font-size: 0.85rem;
}

.line-frame-vb6 {
    border: 1px solid #dee2e6;
    background: #fff;
    padding: 0.75rem;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.line-header-vb6 {
    color: #153d66;
    font-size: 0.95rem;
    font-weight: 700;
    margin: 0 0 0.6rem 0;
    text-align: center;
    padding-bottom: 0.4rem;
    border-bottom: 2px solid #153d66;
}

.calc-section-vb6 {
    margin-bottom: 0.75rem;
}

.calc-section-vb6:last-child {
    margin-bottom: 0;
}

.section-header-vb6 {
    color: #28a745;
    font-weight: 600;
    font-size: 0.8rem;
    margin-bottom: 0.4rem;
}

.form-row-vb6 {
    display: flex;
    align-items: center;
    margin-bottom: 0.35rem;
    gap: 0.5rem;
}

.form-row-vb6 label {
    flex: 1;
    font-size: 0.8rem;
    color: #495057;
    text-align: right;
    padding-right: 0.25rem;
}

.form-row-vb6 input,
.form-row-vb6 select {
    width: 130px;
    padding: 0.3rem 0.4rem;
    border: 1px solid #ced4da;
    border-radius: 4px;
    background: #fff;
    font-size: 0.8rem;
    text-align: right;
    transition: border-color 0.15s ease;
}

.form-row-vb6 input:focus {
    border-color: #153d66;
    outline: none;
    box-shadow: 0 0 0 2px rgba(21, 61, 102, 0.15);
}

.form-row-vb6 input:read-only {
    background: #f8f9fa;
    font-weight: 600;
}

.result-vb6 input {
    background: #d4edda !important;
    border-color: #28a745 !important;
    font-weight: 700;
    color: #155724;
}

.reference-table-vb6 {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.75rem;
    background: #fff;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.reference-table-vb6 th {
    background: #153d66;
    color: #fff;
    padding: 0.4rem 0.5rem;
    text-align: center;
    font-weight: 600;
    font-size: 0.7rem;
}

.reference-table-vb6 td {
    padding: 0.25rem 0.4rem;
    text-align: center;
    color: #495057;
    border-bottom: 1px solid #e9ecef;
}

.reference-table-vb6 tbody tr:hover {
    background: #f1f3f4;
}

.reference-table-vb6 tbody tr:last-child td {
    border-bottom: none;
}

@media (max-width: 1100px) {
    .wire-layout-vb6 {
        grid-template-columns: 1fr 1fr;
    }
    .wire-column-center {
        grid-column: 1 / -1;
        flex-direction: row;
        justify-content: center;
        gap: 2rem;
    }
}

@media (max-width: 700px) {
    .wire-layout-vb6 {
        grid-template-columns: 1fr;
    }
    .wire-column-center {
        flex-direction: column;
    }
}

/* ============================================
   FUEL CALCULATOR SPECIFIC STYLES
   ============================================ */

/* Fuel Table */
.fuel-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

.fuel-table thead {
    background: var(--primary-color);
    color: white;
}

.fuel-table th {
    padding: 0.5rem;
    text-align: left;
    font-weight: 500;
    font-size: 0.8rem;
}

.fuel-table td {
    padding: 0.375rem 0.5rem;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.fuel-table tbody tr:hover {
    background: rgba(30, 87, 153, 0.05);
}

.fuel-table input[type="number"] {
    width: 80px;
    padding: 0.25rem 0.375rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    text-align: right;
}

.fuel-table input[type="number"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(30, 87, 153, 0.15);
}

/* Compact input with unit */
.input-with-unit.compact {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.input-with-unit.compact .unit {
    font-size: 0.8rem;
    color: var(--text-muted);
    min-width: auto;
}

.input-with-unit.compact input {
    width: 70px;
}

/* Small button */
.btn-sm {
    padding: 0.25rem 0.75rem;
    font-size: 0.8rem;
}

/* ============================================
   OIL FLOW CALCULATOR LAYOUT
   ============================================ */

.oil-flow-layout {
    display: flex !important;
    flex-direction: row !important;
    gap: 2.5rem;
    align-items: flex-start;
}

.oil-flow-boxes {
    flex: 0 0 650px;
    min-width: 0;
}

.oil-flow-table {
    flex: 0 0 300px;
    min-width: 0;
}

.oil-flow-table .results-panel {
    position: sticky;
    top: 1rem;
}

.two-column-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 2rem;
}

@media (max-width: 1100px) {
    .oil-flow-layout {
        flex-direction: column !important;
    }

    .oil-flow-boxes {
        flex: 1 1 auto;
        width: 100%;
    }

    .oil-flow-table {
        flex: 1 1 auto;
        width: 100%;
    }
}

@media (max-width: 600px) {
    .two-column-grid {
        grid-template-columns: 1fr !important;
    }
}


/* Velocity Reference Box */
.reference-box {
    background: #f8f9fa;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.75rem;
    margin-top: 1rem;
}

.reference-box h4 {
    margin: 0 0 0.5rem 0;
    font-size: 0.875rem;
    color: var(--primary-dark);
}

.reference-item {
    font-size: 0.8rem;
    padding: 0.25rem 0.5rem;
    margin: 0.25rem 0;
    border-radius: 3px;
}

.reference-item.optimal {
    background: #d4edda;
    color: #155724;
}

.reference-item.caution {
    background: #fff3cd;
    color: #856404;
}

.reference-item.danger {
    background: #f8d7da;
    color: #721c24;
}

/* Velocity Warning Styles */
.velocity-optimal {
    color: #28a745;
    font-weight: 600;
}

.velocity-caution {
    color: #ffc107;
    font-weight: 600;
}

.velocity-danger {
    color: #dc3545;
    font-weight: 700;
}

.warning-item {
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    text-align: center;
    margin-top: 0.5rem;
}

.warning-item.warning-high {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.warning-item.warning-caution {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

/* Length Total Styles */
.length-total {
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    text-align: center;
    font-weight: 600;
    margin-top: 0.5rem;
}

.length-total.valid {
    background: #d4edda;
    color: #155724;
}

.length-total.invalid {
    background: #f8d7da;
    color: #721c24;
}

.length-total .error-hint {
    font-weight: normal;
    font-size: 0.85rem;
}

/* ============================================
   FRICTION CALCULATOR STYLES (Modern VB6-Inspired)
   ============================================ */

.friction-calculator {
    background: linear-gradient(180deg, #f0f4f8 0%, #e4e8ec 100%);
    padding: 1.5rem;
    min-height: 500px;
    border-radius: var(--radius);
}

/* Header with section toggles and mode selection */
.friction-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--primary-color);
}

.section-toggles {
    display: flex;
    gap: 0.5rem;
}

.section-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    background: linear-gradient(180deg, #fff 0%, #e8edf2 100%);
    border: 1px solid #a0aec0;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    color: #2d3748;
    transition: all 0.2s ease;
    box-shadow: 0 -2px 4px rgba(0,0,0,0.05);
}

.section-toggle:hover {
    background: linear-gradient(180deg, #fff 0%, #dce3eb 100%);
}

.section-toggle input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--primary-color);
}

.section-toggle input[type="checkbox"]:checked + span {
    color: var(--primary-color);
}

.section-toggle span {
    color: #4a5568;
}

.friction-header .mode-toggle {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    background: #fff;
    padding: 0.5rem 1.25rem;
    border-radius: var(--radius);
    border: 1px solid #cbd5e0;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.05);
    margin-bottom: 0;
}

.friction-header .mode-toggle label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    color: #4a5568;
}

.friction-header .mode-toggle input[type="radio"] {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--primary-color);
}

.friction-header .mode-toggle input[type="radio"]:checked + span {
    color: var(--primary-color);
}

/* Friction Section (Pivot, Linear, Mainline, Hose) */
.friction-section {
    background: #fff;
    border: 1px solid #cbd5e0;
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.25rem;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    display: flex;
    flex-direction: column;
}

.friction-section .section-content {
    display: flex;
    gap: 2.5rem;
    padding-bottom: 0.5rem;
}

/* Left column - inputs */
.friction-section .inputs-column {
    flex: 1;
    min-width: 380px;
}

/* Right column - pipes */
.friction-section .pipes-column {
    flex: 0 0 auto;
    border: 1px solid #cbd5e0;
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
}

.friction-section .pipes-column.linear-pipes {
    min-width: 420px;
}

/* Results column */
.friction-section .results-column {
    flex: 1;
    min-width: 300px;
}

/* Form rows in friction calculator */
.friction-section .form-row {
    display: flex;
    align-items: center;
    margin-bottom: 0.625rem;
    gap: 0.75rem;
}

.friction-section .form-row label {
    flex: 0 0 280px;
    text-align: right;
    font-size: 0.95rem;
    color: #2d3748;
    font-weight: 500;
    padding-right: 0.5rem;
}

.friction-section .form-row input {
    width: 110px;
    padding: 0.5rem 0.625rem;
    border: 1px solid #a0aec0;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    text-align: right;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
    -moz-appearance: textfield;
}

.friction-section .form-row input::-webkit-outer-spin-button,
.friction-section .form-row input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.friction-section .form-row input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(30, 87, 153, 0.15);
}

.friction-section .form-row .unit {
    font-size: 0.9rem;
    color: #718096;
    min-width: 45px;
    font-weight: 500;
}

.friction-section .form-row.result-row {
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px dashed #e2e8f0;
}

.friction-section .form-row.result-row:first-of-type {
    margin-top: 1.5rem;
    border-top: 2px solid var(--primary-color);
}

.friction-section .form-row.result-row label {
    color: var(--primary-dark);
    font-weight: 600;
}

.friction-section .form-row .readonly-field {
    background: #f7fafc;
    color: #2d3748;
    width: 110px;
    text-align: right;
}

.friction-section .form-row .result-field {
    background: linear-gradient(180deg, #ebf8ff 0%, #e3f2fd 100%);
    border: 1px solid var(--primary-color);
    color: var(--primary-dark);
    font-weight: 600;
    font-family: 'Consolas', monospace;
}

/* Warning message */
.friction-section .warning-message {
    color: #c53030;
    font-weight: 700;
    font-size: 0.95rem;
    text-align: center;
    padding: 0.75rem 1rem;
    margin: 1rem 0;
    background: #fff5f5;
    border: 1px solid #fc8181;
    border-radius: var(--radius-sm);
}

.friction-section .warning-message.warning-caution {
    color: #7c5e00;
    background: #fffbe6;
    border-color: #e6a000;
}

.friction-section .warning-note {
    font-size: 0.85rem;
    font-weight: 600;
    text-align: center;
    color: #555;
    margin: -0.5rem 0 0.5rem 0;
    padding: 0.25rem 1rem;
}

/* Pipe groups */
.pipe-group {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e2e8f0;
}

.pipe-group:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.pipe-radio {
    padding-top: 0.375rem;
}

.pipe-radio input[type="radio"] {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--primary-color);
}

.pipe-options {
    flex: 1;
}

.pipe-row {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    margin-bottom: 0.375rem;
}

.pipe-row .pipe-label {
    min-width: 190px;
    font-size: 0.9rem;
    color: #4a5568;
    font-weight: 500;
}

.pipe-row .pct-input {
    width: 55px;
    padding: 0.375rem 0.25rem;
    border: 1px solid #2d3748;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    text-align: center;
    background: #1a365d;
    color: #faf089;
    font-weight: 600;
    font-family: 'Consolas', monospace;
}

.pipe-row .pct-input:disabled {
    background: #edf2f7;
    color: #a0aec0;
    border-color: #cbd5e0;
}

.pipe-row .pct {
    font-size: 0.9rem;
    color: #4a5568;
    font-weight: 600;
}

/* Linear pipes with Side 1/Side 2 */
.side-headers {
    display: flex;
    gap: 0.625rem;
    margin-bottom: 0.75rem;
    padding-left: 35px;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary-color);
}

.side-headers span {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--primary-dark);
}

.side-headers span:first-child {
    flex: 1;
}

.side-headers span:nth-child(2),
.side-headers span:nth-child(3) {
    width: 55px;
    text-align: center;
}

.pipe-options-linear {
    flex: 1;
}

.pipe-row-linear {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    margin-bottom: 0.375rem;
}

.pipe-row-linear .pipe-label-na {
    color: #c53030;
    font-size: 0.85rem;
    min-width: 32px;
    font-weight: 600;
}

.pipe-row-linear .pipe-label-spacer {
    min-width: 32px;
}

.pipe-row-linear .pipe-label {
    flex: 1;
    font-size: 0.9rem;
    color: #4a5568;
    font-weight: 500;
}

.pipe-row-linear .pct-input {
    width: 55px;
    padding: 0.375rem 0.25rem;
    border: 1px solid #2d3748;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    text-align: center;
    background: #1a365d;
    color: #faf089;
    font-weight: 600;
    font-family: 'Consolas', monospace;
}

.pipe-row-linear .pct-input:disabled {
    background: #edf2f7;
    color: #a0aec0;
    border-color: #cbd5e0;
}

/* RC Display */
.rc-display {
    text-align: right;
    font-size: 0.95rem;
    color: #319795;
    font-weight: 700;
    background: #e6fffa;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-sm);
    border: 1px solid #81e6d9;
    display: inline-block;
    margin-top: 1rem;
    margin-left: auto;
}

/* Section footer with Clear button */
.section-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-direction: row-reverse;
    margin-top: 0.5rem;
}

.btn-clear {
    padding: 0.5rem 1.25rem;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    background: var(--card-background);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-clear:hover {
    background: var(--background-color);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Action buttons */
.friction-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    padding-top: 1rem;
    border-top: 2px solid #e2e8f0;
    margin-top: 0.5rem;
}

.friction-actions .btn-secondary {
    padding: 0.625rem 1.75rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.friction-actions .btn-secondary:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.friction-actions .btn-danger {
    padding: 0.625rem 1.75rem;
    font-size: 1rem;
    font-weight: 600;
    background: linear-gradient(180deg, #e53e3e 0%, #c53030 100%);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
}

.friction-actions .btn-danger:hover {
    background: linear-gradient(180deg, #c53030 0%, #9b2c2c 100%);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

/* Mainline section specific */
.mainline-section .form-row label {
    flex: 0 0 220px;
}

.mainline-section select {
    width: 220px;
    padding: 0.5rem 0.625rem;
    border: 1px solid #a0aec0;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    background: #fff;
    cursor: pointer;
}

.mainline-section select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(30, 87, 153, 0.15);
}

/* Hose section specific */
.hose-section .form-row label {
    flex: 0 0 160px;
}

.hose-section select {
    width: 200px;
    padding: 0.5rem 0.625rem;
    border: 1px solid #a0aec0;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    background: #fff;
    cursor: pointer;
}

.hose-section select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(30, 87, 153, 0.15);
}

.highlight-result .result-field {
    background: linear-gradient(180deg, #fefcbf 0%, #faf089 100%) !important;
    border-color: #d69e2e !important;
    font-weight: 700;
}

/* Checkbox for inner pipe diameter override */
.friction-section .form-row input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-right: 0.375rem;
    accent-color: var(--primary-color);
}

/* Print Styles */
@media print {
    @page {
        size: letter portrait;
        margin: 0.5in;
    }

    html, body {
        background: white;
        font-size: 9pt;
    }

    .top-header {
        background: none;
        color: black;
        padding: 0.25rem 0;
        box-shadow: none;
        border-bottom: 1px solid black;
    }

    .main-tabs,
    .sub-tabs,
    .btn-print,
    .version,
    .footer,
    .actions,
    .mode-toggle,
    .equipment-toggle,
    .info-box {
        display: none !important;
    }

    .page {
        min-height: auto;
    }

    .main-content {
        padding: 0.5rem 0;
    }

    .calculator-container {
        box-shadow: none;
    }

    .user-guide {
        display: none !important;
    }
}

/* ========================================
   User Guide
   ======================================== */

.user-guide {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

.guide-header {
    margin-bottom: 2rem;
    text-align: center;
}

.guide-header h2 {
    margin: 0 0 0.25rem 0;
    font-size: 1.75rem;
    color: var(--primary-color);
}

.guide-subtitle {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* Table of Contents */
.guide-toc {
    background: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
}

.guide-toc h3 {
    margin: 0 0 0.75rem 0;
    font-size: 1.1rem;
    color: var(--primary-dark);
}

.guide-toc ul {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.5rem;
}

.guide-toc a {
    color: var(--primary-light);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
}

.guide-toc a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* Sections */
.guide-section {
    margin-bottom: 2rem;
}

.guide-section h3 {
    font-size: 1.35rem;
    color: var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 0.4rem;
    margin: 0 0 1rem 0;
}

/* Cards */
.guide-card {
    background: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    margin-bottom: 0.75rem;
    box-shadow: var(--shadow);
}

.guide-card h4 {
    margin: 0 0 0.5rem 0;
    font-size: 1.05rem;
    color: var(--primary-dark);
}

.guide-card p {
    margin: 0 0 0.5rem 0;
    line-height: 1.6;
}

.guide-card p:last-child {
    margin-bottom: 0;
}

.guide-card ul {
    margin: 0.25rem 0 0.5rem 0;
    padding-left: 1.25rem;
}

.guide-card ul:last-child {
    margin-bottom: 0;
}

.guide-card li {
    margin-bottom: 0.3rem;
    line-height: 1.5;
}

/* Blazor Error UI - Hidden by default, shown by Blazor on errors */
#blazor-error-ui {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--danger-color);
    color: white;
    padding: 1rem;
    text-align: center;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.2);
    z-index: 9999;
}

#blazor-error-ui .reload {
    color: white;
    text-decoration: underline;
    margin-left: 0.5rem;
}
