@import '../shared/document.css';

/* ============================================================
   FOUNDATION DESIGN SUITE — STUDIO & A4 SHEET STYLES
   SFS-EN 1997-1 (Geotechnics) & SFS-EN 1992-1-1 (Concrete Footings)
   Matches the standardized Eurocode Suite Studio & Dock Architecture
   ============================================================ */

/* --- Workspace Wrapper (Centered Studio for Desktop) --- */
.workspace-wrapper {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 20px;
    max-width: 1480px;
    margin: 0 auto;
    padding: 0 16px;
    min-height: 100vh;
    box-sizing: border-box;
}

/* --- Left Sidebar Dock (Left-Hand Scrollbar) --- */
.app-sidebar-dock {
    width: 440px;
    background: #ffffff;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: var(--sp-md);
    display: flex;
    flex-direction: column;
    gap: var(--sp-sm);
    flex-shrink: 0;
    position: sticky;
    top: 16px;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    z-index: 10;
    box-sizing: border-box;
    margin-bottom: 16px;

    /* Move scrollbar to the left for clean visual boundary */
    direction: rtl;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.18) transparent;
}

.app-sidebar-dock > * {
    direction: ltr; /* Reset children to standard LTR text */
}

/* Mode switching for Pad vs Strip Footing inputs */
body.mode-pad .found-input-strip {
    display: none !important;
}
body.mode-strip .found-input-pad {
    display: none !important;
}

.app-sidebar-dock::-webkit-scrollbar {
    width: 5px;
}
.app-sidebar-dock::-webkit-scrollbar-track {
    background: transparent;
}
.app-sidebar-dock::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 10px;
}
.app-sidebar-dock:hover::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.30);
}

/* --- Dock Sections & Elements --- */
.dock-section {
    background: #fafaf8;
    border: 1px solid var(--color-border-light);
    border-radius: 6px;
    padding: var(--sp-sm) var(--sp-md);
}

.dock-section-title {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--color-heading);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: var(--sp-xs);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dock-section-title .badge-tag {
    font-size: 0.68rem;
    padding: 2px 6px;
    background: #e2e8f0;
    color: #334155;
    border-radius: 3px;
    font-weight: 600;
    text-transform: none;
    letter-spacing: normal;
}

/* Input Fields inside Dock */
.dock-meta-field {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 3px;
    margin-bottom: 6px;
    height: 100%;
}

.dock-meta-field label {
    font-size: 0.74rem;
    font-weight: 600;
    color: var(--color-text-secondary);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    line-height: 1.25;
}

.dock-meta-field label .unit {
    font-family: var(--font-mono);
    color: var(--color-text-muted);
    font-size: 0.70rem;
    flex-shrink: 0;
    margin-left: 4px;
}

.dock-meta-field input,
.dock-meta-field select {
    width: 100%;
    margin-top: auto;
    padding: 5px 8px;
    font-size: 0.82rem;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    background: #ffffff;
    color: var(--color-heading);
    box-sizing: border-box;
}

.dock-meta-field input:focus,
.dock-meta-field select:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 2px var(--color-accent-light);
}

.dock-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 6px;
}

.dock-grid-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 6px;
    margin-bottom: 6px;
}

/* Preset Selector Dropdown */
.dock-preset-select {
    width: 100%;
    padding: 6px 10px;
    font-size: 0.82rem;
    font-weight: 600;
    border: 1.5px solid var(--color-accent);
    border-radius: 4px;
    background: var(--color-accent-bg);
    color: var(--color-accent);
    cursor: pointer;
    margin-bottom: 8px;
}

/* --- Utilization HUD / Scorecard in Left Dock --- */
.dock-hud-card {
    background: #ffffff;
    border: 1.5px solid var(--color-border);
    border-radius: 6px;
    padding: 10px 12px;
    margin-bottom: 6px;
}

.hud-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--color-border-light);
}

.hud-title {
    font-size: 0.80rem;
    font-weight: 700;
    color: var(--color-heading);
    text-transform: uppercase;
}

.hud-verdict-pill {
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.74rem;
    font-weight: 700;
    font-family: var(--font-mono);
}

.hud-verdict-pill.pass {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #c8e6c9;
}

.hud-verdict-pill.fail {
    background: #ffebee;
    color: #c62828;
    border: 1px solid #ffcdd2;
}

.hud-meter-row {
    margin-bottom: 6px;
}

.hud-meter-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.72rem;
    margin-bottom: 2px;
}

.hud-meter-name {
    font-weight: 600;
    color: var(--color-heading);
}

.hud-meter-val {
    font-family: var(--font-mono);
    font-weight: 700;
}

.hud-progress-bar {
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    overflow: hidden;
}

.hud-progress-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.2s ease, background-color 0.2s ease;
}

.hud-progress-fill.safe {
    background: #2e7d32;
}
.hud-progress-fill.warning {
    background: #e65100;
}
.hud-progress-fill.danger {
    background: #c62828;
}

/* Kern Status Badge */
.hud-kern-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 8px;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 600;
    margin-top: 8px;
}

.hud-kern-badge.in-kern {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.hud-kern-badge.out-kern {
    background: #fffbeb;
    color: #b45309;
    border: 1px solid #fde68a;
}

.hud-kern-badge.toppling {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* --- Right Side Main Workspace --- */
.app-main-workspace {
    flex: 1;
    min-width: 0;
    max-width: 1020px;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

/* Attached Hub Nav Bar */
.app-main-workspace .top-hub-nav {
    width: 100%;
    background: #e9e6df;
    border: 1px solid var(--color-border);
    border-top: none;
    border-bottom: 1px solid var(--color-border);
    padding: 8px 16px;
    box-sizing: border-box;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Attached Export Bar */
.app-main-workspace .doc-actions-bar {
    width: 100%;
    background: #fcfbfa;
    border-left: 1px solid var(--color-border);
    border-right: 1px solid var(--color-border);
    border-top: none;
    border-bottom: 1px solid var(--color-border-light);
    padding: 8px 16px;
    box-sizing: border-box;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--sp-md);
    flex-wrap: wrap;
}

/* --- True A4 Printable Document Sheet --- */
.app-main-workspace .page-container {
    width: 100%;
    max-width: 100%;
    margin: 0;
    background: #fafaf8;
    border: 1px solid var(--color-border);
    border-top: none;
    box-shadow: 0 4px 16px var(--color-paper-shadow);
    padding: 24px 32px;
    box-sizing: border-box;
}

/* Visualizer Card inside Sheet */
.foundation-visualizer-card {
    background: #ffffff;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    padding: var(--sp-md);
    margin-bottom: var(--sp-md);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.visualizer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--sp-sm);
}

.visualizer-title {
    font-family: var(--font-serif);
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--color-heading);
}

.visualizer-view-toggle {
    display: flex;
    gap: 4px;
    background: #f1f5f9;
    padding: 3px;
    border-radius: 4px;
    border: 1px solid var(--color-border);
}

.view-toggle-btn {
    border: none;
    background: transparent;
    padding: 4px 10px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-text-secondary);
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.15s;
}

.view-toggle-btn.active {
    background: #ffffff;
    color: var(--color-accent);
    box-shadow: 0 1px 2px rgba(0,0,0,0.08);
}

.foundation-svg-container {
    width: 100%;
    height: 250px;
    border: 1px solid var(--color-border-light);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
    background: #ffffff;
}

/* Mathematical Calculation Steps Cards */
.formula-block .katex .fbox,
.formula-block .katex .boxed {
    border: none !important;
    padding: 0 !important;
}

/* Summary Verification Table */
.summary-table-section {
    margin-top: var(--sp-lg);
    margin-bottom: var(--sp-lg);
}

.summary-table-title {
    font-family: var(--font-serif);
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--color-heading);
    margin-bottom: 12px;
}

.verification-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}

.verification-table th {
    background: #f8fafc;
    color: var(--color-heading);
    font-weight: 700;
    padding: 8px 10px;
    border-bottom: 2px solid var(--color-border);
    text-align: left;
}

.verification-table td {
    padding: 8px 10px;
    border-bottom: 1px solid var(--color-border-light);
}

.verification-table tr:hover td {
    background: #f8fafc;
}

/* ============================================================
   STRICT PRINT STYLING (A4 SHEET ONLY)
   ============================================================ */
@media print {
    /* Hide all workspace non-printable chrome */
    .app-sidebar-dock,
    .top-hub-nav,
    .doc-actions-bar,
    .tab-nav,
    .visualizer-view-toggle,
    .btn-calculate,
    .print-hide {
        display: none !important;
    }

    body {
        background: #ffffff !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .workspace-wrapper {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .app-main-workspace {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .app-main-workspace .page-container {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 10mm 12mm !important;
        padding: 0 !important;
        border: none !important;
        box-shadow: none !important;
        background: #ffffff !important;
    }

    .calc-step,
    .foundation-visualizer-card,
    .summary-table-section {
        box-shadow: none !important;
        border: 1px solid #bbb !important;
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .foundation-svg-container {
        height: 210px !important;
        border: 1px solid #ccc !important;
    }
}

/* ============================================================
   TOP HUB NAV CONTROLS & ACTIVE MEMBER BADGE
   ============================================================ */
.top-hub-nav-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.active-member-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #e8f5e9;
    color: #1b5e20;
    border: 1px solid #c8e6c9;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
    font-family: var(--font-mono, monospace);
}

.active-member-indicator .dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #2e7d32;
    animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(46, 125, 50, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(46, 125, 50, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(46, 125, 50, 0); }
}

.btn-toggle-drawer {
    background: var(--color-accent-bg, #e8f0fa);
    border: 1px solid var(--color-accent-border, #bcd3ed);
    color: var(--color-accent, #0055a3);
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.15s;
}
.btn-toggle-drawer:hover {
    background: var(--color-accent, #0055a3);
    color: #ffffff;
}

/* ============================================================
   COLLAPSIBLE MEMBER DRAWER
   ============================================================ */
.col-member-drawer,
.member-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 340px;
    max-width: 90vw;
    background: #ffffff;
    border-left: 1px solid var(--color-border, #e2e8f0);
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.12);
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.26s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 1050;
}
.col-member-drawer.open,
.member-drawer.open {
    transform: translateX(0);
}

.drawer-header {
    padding: 12px 16px;
    border-bottom: 1px solid var(--color-border, #e2e8f0);
    background: #f7f6f3;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.drawer-heading-block {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.drawer-heading {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--color-heading, #1e293b);
    display: flex;
    align-items: center;
    gap: 6px;
}

.drawer-subheading {
    font-size: 0.72rem;
    color: var(--color-text-secondary, #64748b);
}

.btn-drawer-close {
    background: transparent;
    border: none;
    color: var(--color-text-muted, #94a3b8);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    line-height: 1;
    transition: all 0.15s;
}
.btn-drawer-close:hover {
    background: #e9e6df;
    color: var(--color-heading, #1e293b);
}

.drawer-toolbar {
    padding: 8px 12px;
    background: #fafaf8;
    border-bottom: 1px solid var(--color-border-light, #e2e8f0);
    display: flex;
    gap: 6px;
}

.btn-drawer-action {
    background: #ffffff;
    border: 1px solid var(--color-border, #cbd5e1);
    color: var(--color-text, #334155);
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.12s;
}
.btn-drawer-action:hover {
    background: #f0ede8;
    border-color: var(--color-accent, #0055a3);
}
.btn-drawer-action--primary {
    background: var(--color-accent-bg, #e8f0fa);
    border-color: var(--color-accent-border, #bcd3ed);
    color: var(--color-accent, #0055a3);
}
.btn-drawer-action--primary:hover {
    background: var(--color-accent, #0055a3);
    color: #ffffff;
}

.drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.drawer-card {
    background: #fafaf8;
    border: 1px solid var(--color-border-light, #e2e8f0);
    border-radius: 5px;
    padding: 10px 12px;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    flex-direction: column;
    gap: 3px;
    position: relative;
}
.drawer-card:hover {
    border-color: var(--color-accent, #0055a3);
    background: #f4f7fb;
    transform: translateY(-1px);
}
.drawer-card.active {
    background: #f0f7ff;
    border-color: var(--color-accent, #0055a3);
    box-shadow: 0 0 0 2px var(--color-accent-border, #bcd3ed);
}

.card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.card-tag {
    font-size: 0.84rem;
    font-weight: 700;
    color: var(--color-heading, #1e293b);
}
.card-pill {
    font-size: 0.68rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 10px;
    text-transform: uppercase;
}
.pill-pass { background: #e8f5e9; color: #2e7d32; border: 1px solid #c8e6c9; }
.pill-fail { background: #ffebee; color: #c62828; border: 1px solid #ffcdd2; }
.pill-stale { background: #fff8e1; color: #b78103; border: 1px solid #ffe082; }

.card-details {
    font-size: 0.74rem;
    color: #4b5563;
    font-family: var(--font-mono, monospace);
    line-height: 1.35;
    background: #f3f1ec;
    padding: 3px 6px;
    border-radius: 3px;
    margin: 2px 0;
    display: flex;
    justify-content: space-between;
    gap: 4px;
}

.card-linked-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 0.65rem;
    font-weight: 700;
    color: #0284c7;
    background: #e0f2fe;
    border: 1px solid #bae6fd;
    border-radius: 3px;
    padding: 1px 5px;
}

/* ============================================================
   FRONT PAGE & TITLE BLOCK STYLING (CAD Nimiö Style)
   ============================================================ */
.front-page-container {
    margin-bottom: 16px;
}

/* CAD Nimiö (Official drawing 3-line square perimeter box) */
.engineering-title-block,
.title-block-card {
    background: #ffffff;
    border: 2px solid #0f172a;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
    box-sizing: border-box;
    margin-bottom: 0;
}

.engineering-title-block .title-block-main,
.title-block-card .title-block-main {
    padding: 10px 14px 8px 14px;
    border-bottom: 1.5px solid #0f172a;
    margin: 0;
    box-sizing: border-box;
}

.engineering-title-block.is-minimized,
.title-block-card.is-minimized {
    margin-bottom: 12px;
}

.engineering-title-block.is-minimized .title-block-main,
.title-block-card.is-minimized .title-block-main {
    border-bottom: none !important;
}

.engineering-title-block.is-minimized .title-block-grid,
.title-block-card.is-minimized .title-block-grid {
    display: none !important;
}

.engineering-title-block .title-block-grid,
.title-block-card .title-block-grid {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    border-radius: 0 !important;
    box-sizing: border-box;
}

.engineering-title-block .title-block-cell,
.title-block-card .title-block-cell {
    padding: 6px 10px;
    border-right: 1px solid #cbd5e1;
    border-bottom: 1px solid #cbd5e1;
    background: #ffffff;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.engineering-title-block .title-block-cell:nth-child(4n),
.title-block-card .title-block-cell:nth-child(4n) {
    border-right: none;
}

.engineering-title-block .title-block-cell:nth-last-child(-n+4),
.title-block-card .title-block-cell:nth-last-child(-n+4) {
    border-bottom: none;
}

.title-block-label {
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 2px;
    display: block;
}

.title-block-input {
    width: 100%;
    border: 1px solid transparent;
    background: transparent;
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--color-heading);
    padding: 2px 4px;
    border-radius: 0;
    box-sizing: border-box;
    transition: all 0.15s ease;
}

.title-block-input:hover {
    border-color: #cbd5e1;
    background: #f8fafc;
}

.title-block-input:focus {
    outline: none;
    border-color: var(--color-accent);
    background: #ffffff;
    box-shadow: 0 0 0 1px var(--color-accent);
}

/* Foundation Key Properties & Reinforcement Summary Card (Standard card style directly below nimiö) */
.found-properties-summary-card {
    background: #f8fafc;
    border: 1.5px solid var(--color-border);
    border-radius: 6px;
    padding: 12px 16px;
    margin-top: 12px;
    margin-bottom: 16px;
    transition: all 0.2s ease;
}

.found-properties-summary-card strong {
    color: #0f172a;
}

.btn-minimize-front:hover {
    background: var(--color-accent-bg, #f0f7ff) !important;
    border-color: var(--color-accent, #0284c7) !important;
}

/* ============================================================
   LINKED MODE HUD & LOAD BREAKDOWN STYLES
   ============================================================ */
.found-linked-banner {
    background: #f0f9ff;
    border: 1.5px solid #bae6fd;
    border-radius: 6px;
    padding: 8px 10px;
    margin-bottom: 8px;
}

.linked-banner-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.linked-banner-actions {
    display: flex;
    gap: 6px;
    margin-top: 6px;
}

.btn-linked-action {
    flex: 1;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 3px 6px;
    border-radius: 4px;
    border: 1px solid #0284c7;
    background: #ffffff;
    color: #0369a1;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-linked-action:hover {
    background: #e0f2fe;
}

.btn-linked-action.detach {
    border-color: #cbd5e1;
    color: #64748b;
}

.btn-linked-action.detach:hover {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #b91c1c;
}

.load-breakdown-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}

.load-breakdown-table th,
.load-breakdown-table td {
    padding: 6px 8px;
    border: 1px solid var(--color-border-light, #e2e8f0);
}

.load-breakdown-table th {
    background: #f8fafc;
    color: var(--color-heading, #1e293b);
    font-weight: 700;
}

.load-breakdown-table tbody tr:nth-child(even) {
    background: #fafaf9;
}

/* Collapsible Step Styles */
.step-header.collapsible {
    cursor: pointer;
    user-select: none;
    transition: background-color 0.15s ease;
}

.step-header.collapsible:hover {
    background-color: #f8fafc;
}

.calc-step.collapsed .step-body {
    display: none !important;
}

/* ============================================================
   PRINT CONFIGURATOR & REPORT EXPORT MODAL STYLES
   ============================================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    backdrop-filter: blur(2px);
}

.modal-print-card {
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2), 0 10px 10px -5px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.print-modal-grid {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 16px;
    padding: 16px;
    overflow-y: auto;
}

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

.btn-print-preset {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    padding: 4px 10px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    color: #334155;
}

.btn-print-preset:hover {
    background: #e2e8f0;
    border-color: #94a3b8;
}

.btn-print-preset.active {
    background: #0284c7;
    border-color: #0369a1;
    color: #ffffff;
}

.print-sections-checklist {
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: #f8fafc;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    padding: 8px 12px;
}

.print-check-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.78rem;
    cursor: pointer;
    padding: 2px 0;
}

.print-check-row input[type="checkbox"] {
    width: 15px;
    height: 15px;
    cursor: pointer;
}

/* Live Wireframe Preview Panel */
.print-modal-preview {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 12px;
    display: flex;
    flex-direction: column;
}

.print-preview-wireframe {
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto;
    max-height: 380px;
    padding-right: 4px;
}

.preview-page-sheet {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    padding: 10px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
    font-size: 0.70rem;
}

.preview-sheet-header {
    border-bottom: 1.5px solid #0284c7;
    padding-bottom: 4px;
    margin-bottom: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 700;
    color: #0f172a;
}

.preview-sheet-badge {
    background: #e0f2fe;
    color: #0369a1;
    font-size: 0.65rem;
    padding: 1px 5px;
    border-radius: 2px;
}

.preview-section-item {
    background: #f8fafc;
    border-left: 3px solid #0284c7;
    padding: 4px 6px;
    margin-bottom: 4px;
    border-radius: 2px;
    font-size: 0.68rem;
    color: #334155;
    display: flex;
    justify-content: space-between;
}

/* ============================================================
   SIGNOFF BLOCK FOR PRINTS
   ============================================================ */
.print-signoff-block {
    margin-top: 24px;
    border-top: 1.5px solid var(--color-border, #e2e8f0);
    padding-top: 14px;
    break-inside: avoid;
    page-break-inside: avoid;
}

.signoff-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
    font-size: 0.76rem;
}

.signoff-cell {
    border: 1px solid var(--color-border, #e2e8f0);
    border-radius: 4px;
    padding: 8px 12px;
    background: #fafaf8;
}

.signoff-label {
    font-size: 0.68rem;
    text-transform: uppercase;
    color: var(--color-text-secondary);
    font-weight: 700;
    margin-bottom: 4px;
}

.signoff-line {
    border-bottom: 1px solid #94a3b8;
    margin-top: 22px;
    margin-bottom: 4px;
}

/* ============================================================
   STRICT PRINT STYLING (A4 SHEET ONLY)
   ============================================================ */
@media print {
    /* Hide workspace chrome */
    .app-sidebar-dock,
    .top-hub-nav,
    .doc-actions-bar,
    .tab-nav,
    .btn-calculate,
    .member-drawer,
    .modal-overlay,
    .btn-minimize-front,
    .print-hide {
        display: none !important;
    }

    body {
        background: #ffffff !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .workspace-wrapper {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .app-main-workspace {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .app-main-workspace .page-container {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        border: none !important;
        box-shadow: none !important;
        background: #ffffff !important;
    }

    .calc-step,
    .foundation-visualizer-card {
        box-shadow: none !important;
        border: 1px solid #bbb !important;
        break-inside: avoid;
        page-break-inside: avoid;
    }

    /* Print separation: only show active foundation type */
    body.mode-pad #panel-strip {
        display: none !important;
    }
    body.mode-strip #panel-pad {
        display: none !important;
    }
    .tab-panel:not(.active) {
        display: none !important;
    }

    /* Expand collapsible steps during print */
    .calc-step .step-body {
        display: block !important;
    }
    .front-page-collapsible-content {
        display: block !important;
    }

    /* Clean Title Block inputs on print */
    .title-block-input,
    input.title-block-input {
        border: none !important;
        background: transparent !important;
        color: #000000 !important;
        box-shadow: none !important;
        font-weight: 600 !important;
        padding: 0 !important;
        margin: 0 !important;
        outline: none !important;
    }

    /* Print-optimized summary card */
    .found-properties-summary-card {
        background: #f8fafc !important;
        border: 1.5px solid #334155 !important;
        border-radius: 4px !important;
        padding: 10px 14px !important;
        margin-bottom: 14px !important;
        page-break-inside: avoid;
        break-inside: avoid;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .found-properties-summary-card strong {
        color: #0f172a !important;
    }

    .found-properties-summary-card .scorecard-pill {
        border: 1px solid #0f172a !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    /* Print-optimized Load Breakdown Table */
    .load-breakdown-table {
        width: 100% !important;
        border: 1px solid #64748b !important;
        border-collapse: collapse !important;
        page-break-inside: avoid;
        break-inside: avoid;
    }

    .load-breakdown-table th {
        background: #f1f5f9 !important;
        color: #0f172a !important;
        border: 1px solid #94a3b8 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .load-breakdown-table td {
        border: 1px solid #cbd5e1 !important;
        color: #1e293b !important;
    }

    .load-breakdown-table .row-total {
        background: #e2e8f0 !important;
        color: #0f172a !important;
        border-top: 2px solid #475569 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    /* Selective section print omissions */
    body.print-omit-signoff #print-signoff-block { display: none !important; }
    body.print-omit-summary-card #found-properties-summary-card { display: none !important; }
    body.print-omit-loads #print-sec-load-breakdown { display: none !important; }
    body.print-omit-diagram .foundation-visualizer-card { display: none !important; }
    body.print-omit-geo .calc-step[data-step="geo"] { display: none !important; }
    body.print-omit-structural .calc-step[data-step="structural"] { display: none !important; }
    body.print-omit-sls .calc-step[data-step="sls"] { display: none !important; }
    body.print-omit-matrix .summary-table-section { display: none !important; }

    .print-page-break {
        page-break-before: always !important;
        break-before: page !important;
    }
}

/* Suite Badge Spacing Standard */
.suite-badge {
    margin-left: 10px;
}

/* Dock & Drawer Member Locking Standard */
.dock-locked-banner {
    display: none;
    align-items: center;
    gap: 6px;
    background: #fff8e6;
    border: 1px solid #ffe082;
    padding: 7px 10px;
    border-radius: 4px;
    margin-top: 8px;
    font-size: 0.74rem;
    color: #856404;
    font-weight: 600;
}

.dock-is-locked {
    border-left: 4px solid #f59e0b !important;
}

.card-lock-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.85rem;
    padding: 2px 4px;
    border-radius: 3px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
    line-height: 1;
}

.card-lock-btn:hover {
    background: rgba(0, 0, 0, 0.08);
}

.card-pill.locked {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
    font-weight: 700;
}


