:root {
    --brand-primary: #00263E;     
    --brand-accent: #00AEC7;      
    --brand-danger: #D22630;      
    --brand-warning: #eab308;
    --brand-success: #166534;
    --surface-page: #f4f5f7;      
    --surface-card: #ffffff;      
    --surface-hover: #f9fafb;     
    --surface-highlight: rgba(0, 174, 199, 0.08);
    --surface-selected: #e6f0f9;
    --text-main: #1e293b;
    --text-muted: #55647a;
    --text-light: #ffffff;
    --text-heading: var(--brand-primary);
    --border-color: #cbd5e1;
    --border-focus: var(--brand-primary);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --shadow-subtle: 0 4px 20px rgba(0, 0, 0, 0.04);
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --font-stack: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    color-scheme: light;
}

:root[data-theme="dark"] {
    --surface-page: #10141a;
    --surface-card: #1a2029;
    --surface-hover: #232a35;
    --surface-highlight: rgba(0, 174, 199, 0.15);
    --surface-selected: rgba(0, 174, 199, 0.18);
    --text-main: #e2e8f0;
    --text-muted: #94a3b8;
    --text-heading: var(--brand-accent);
    --border-color: #333c4a;
    --border-focus: var(--brand-accent);
    --shadow-subtle: 0 4px 20px rgba(0, 0, 0, 0.35);
    color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

body {
    font-family: var(--font-stack); background-color: var(--surface-page);
    color: var(--text-main); line-height: 1.6; font-size: 16px;
    padding: 2rem 1rem; -webkit-font-smoothing: antialiased;
}

.container { max-width: 1200px; margin: 0 auto; }

.site-footer { max-width: 1200px; margin: 0 auto; padding: 1.5rem 1rem 0; text-align: center; }
h1, h2, h3 { line-height: 1.3; letter-spacing: -0.02em; }

/* Headers & Sections */
.form-header {
    background: var(--surface-card); color: var(--text-heading); padding: 3rem 2rem;
    text-align: center; border-radius: var(--radius-lg); margin-bottom: 2.5rem;
    box-shadow: var(--shadow-subtle); border-bottom: 4px solid var(--brand-accent);
}
.form-header-kicker { font-size: 1.1rem; font-weight: 500; color: var(--text-muted); margin-bottom: 0.5rem; text-transform: uppercase; letter-spacing: 1px; display: block;}
.form-header h1 { font-size: 1.6rem; font-weight: 700; color: var(--text-heading); border: none; padding: 0; }

.form-section {
    background: var(--surface-card); padding: 2.5rem; border-radius: var(--radius-lg);
    margin-bottom: 2rem; box-shadow: var(--shadow-subtle); border: 1px solid rgba(0,0,0,0.02);
}
.form-section h2 {
    font-size: 1.4rem; color: var(--text-heading); margin-bottom: 1.5rem;
    padding-bottom: 0.75rem; border-bottom: 2px solid var(--surface-page);
}
.instruction, .section-desc { color: var(--text-muted); font-size: 0.95rem; margin-bottom: 1.5rem; max-width: 800px; }
.police-question-heading { font-weight: 700; color: var(--text-heading); font-size: 1.1rem; margin-bottom: 0.35rem; max-width: 800px; }

/* Grid Layouts */
.grid-2-col, .grid-3-col, .grid-4-col { display: grid; gap: 1.5rem; margin-bottom: 1.5rem; }
@media (min-width: 768px) {
    .grid-2-col { grid-template-columns: repeat(2, 1fr); }
    .grid-3-col { grid-template-columns: repeat(3, 1fr); }
    .grid-4-col { grid-template-columns: repeat(4, 1fr); }
}

/* Inputs */
.input-group { display: flex; flex-direction: column; gap: 0.5rem; }
.input-group label { font-weight: 600; font-size: 0.9rem; color: var(--text-main); }
input[type="text"], input[type="email"], input[type="tel"], input[type="datetime-local"], input[type="date"], input[type="time"], select, textarea {
    width: 100%; padding: 0.85rem 1rem; border: 2px solid var(--border-color);
    border-radius: var(--radius-sm); font-family: inherit; font-size: 1rem;
    color: var(--text-main); background-color: var(--surface-card); transition: var(--transition);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--border-focus); background-color: var(--surface-hover); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; padding: 1rem 2rem; font-size: 1.05rem; font-weight: 600; border: none; border-radius: var(--radius-sm); cursor: pointer; transition: var(--transition); }
.primary-btn { background-color: var(--brand-primary); color: var(--text-light); box-shadow: 0 4px 10px rgba(0, 43, 92, 0.2); }
.primary-btn:hover { background-color: #001a38; transform: translateY(-2px); }
.secondary-btn { background-color: var(--surface-card); color: var(--text-heading); border: 2px solid var(--text-heading); }
.secondary-btn:hover { background-color: var(--surface-page); }
.btn-success { background: var(--brand-success); color: white; width: 100%; font-size: 1.1rem; padding: 1.25rem; }
.btn-success:hover { background: #14532d; }
.btn-danger { background: var(--brand-danger); color: white; width: 100%; font-size: 1.1rem; padding: 1.25rem; }
.btn-danger:hover { background: #a31d24; }
.btn-add { background: var(--brand-accent); color: white; border: none; margin-top: 0.5rem; width: auto; padding: 0.6rem 1.2rem; font-size: 0.9rem; }
.remove-btn { background: transparent; color: var(--brand-danger); font-size: 1.5rem; line-height: 1; border: none; cursor: pointer; padding: 0.25rem 0.5rem; border-radius: var(--radius-sm); transition: var(--transition); }
.remove-btn:hover { background: rgba(220, 38, 38, 0.1); }

/* Wizard & Progress Bar */
.form-step { display: none; animation: fadeIn 0.4s ease-in-out; }
.form-step.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(15px); } to { opacity: 1; transform: translateY(0); } }

.progress-container { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2.5rem; position: relative; padding: 0 1rem; max-width: 800px; margin-left: auto; margin-right: auto; }
.progress-bar-bg { position: absolute; top: 50%; left: 1rem; right: 1rem; transform: translateY(-50%); height: 4px; background: var(--border-color); z-index: 1; }
.progress-bar-fill { position: absolute; top: 50%; left: 1rem; transform: translateY(-50%); height: 4px; background: var(--brand-accent); z-index: 2; transition: width 0.4s ease; width: 0%; }
.progress-step { width: 40px; height: 40px; background: var(--surface-card); border: 3px solid var(--border-color); border-radius: 50%; z-index: 3; display: flex; align-items: center; justify-content: center; font-weight: 700; color: var(--text-muted); transition: var(--transition); }
.progress-step.active { border-color: var(--brand-accent); color: var(--text-heading); box-shadow: 0 0 0 4px var(--surface-highlight); }
.progress-step.completed { background: var(--brand-accent); border-color: var(--brand-accent); color: white; }
.step-nav-buttons { display: flex; justify-content: space-between; margin-top: 1rem; }

/* Components (Locations, Equipment) */
.hidden { display: none !important; }
.highlight-box { background: var(--surface-page); padding: 1.5rem; border: 1px solid var(--border-color); border-radius: var(--radius-md); }
.alert-success { background: #dcfce7; color: #166534; padding: 1rem; border-radius: 6px; border: 1px solid #bbf7d0; }
.alert-warning { background: #fef08a; color: #78350f; border: 1px solid #facc15; }
.alert-warning h3, .alert-warning p, .alert-warning label, .alert-warning strong, .alert-warning span { color: #78350f; }

/* Dynamic Crew & Locations */
.crew-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 1.5rem; align-items: end; margin-bottom: 1rem; padding-bottom: 1rem; border-bottom: 1px dashed var(--border-color); }
.location-block { background: var(--surface-page); border: 1px solid var(--border-color); padding: 1.5rem; margin-bottom: 1rem; border-radius: 8px; }
.location-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.location-header h3 { margin: 0; font-size: 1.1rem; color: var(--text-heading); }
.env-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; margin-top: 1rem; padding-top: 1rem; border-top: 1px dashed var(--border-color); }
.env-item { display: flex; flex-direction: column; gap: 0.25rem; }
.env-item label { font-size: 0.85rem; font-weight: normal; line-height: 1.3; min-height: 2.2rem; }

/* Equipment Search */
.search-container { position: relative; }
.search-results { position: absolute; top: 100%; left: 0; width: 100%; max-height: 250px; overflow-y: auto; background: var(--surface-card); border: 1px solid var(--border-color); border-top: none; border-radius: 0 0 6px 6px; list-style: none; padding: 0; margin: 0; z-index: 10; box-shadow: 0 4px 6px rgba(0,0,0,0.1); }
.search-results li { padding: 0.85rem; cursor: pointer; border-bottom: 1px solid var(--border-color); font-size: 0.95rem; }
.search-results li:hover, .search-results li.highlighted { background: var(--surface-page); color: var(--text-heading); }
.tags-container { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1rem; }
.eq-tag { background: var(--brand-primary); color: white; padding: 0.5rem 0.75rem; border-radius: 4px; font-size: 0.9rem; display: flex; align-items: center; gap: 0.5rem; }
.eq-tag-remove { background: rgba(255,255,255,0.2); border: none; color: white; width: 20px; height: 20px; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 0.8rem; }
.eq-tag-remove:hover { background: var(--brand-danger); }

/* Custom Checkbox Cards (Declarations & PSNI) */
.declarations-block { background: var(--surface-page); padding: 1.5rem; border-radius: 6px; border: 1px solid var(--border-color); }
.custom-checkbox-card { display: flex; align-items: flex-start; gap: 1.25rem; padding: 1.25rem; margin-bottom: 0.75rem; background: var(--surface-card); border: 2px solid var(--border-color); border-radius: 8px; cursor: pointer; transition: all 0.2s ease; user-select: none; }
.custom-checkbox-card:hover { border-color: var(--brand-accent); }
.custom-checkbox-card input[type="checkbox"] { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.custom-checkbox-card.selected { border-color: var(--text-heading); background: var(--surface-selected); }
.custom-check-indicator { width: 28px; height: 28px; border: 2px solid var(--border-color); border-radius: 6px; display: flex; align-items: center; justify-content: center; background: var(--surface-card); transition: all 0.2s ease; flex-shrink: 0; margin-top: 2px; }
.custom-checkbox-card input[type="checkbox"]:checked + .custom-check-indicator { background: var(--brand-primary); border-color: var(--brand-primary); }
.custom-checkbox-card input[type="checkbox"]:focus-visible + .custom-check-indicator { outline: 3px solid var(--brand-accent); outline-offset: 2px; }
.custom-check-indicator::after { content: "✓"; color: white; font-size: 18px; font-weight: bold; display: none; }
.custom-checkbox-card input[type="checkbox"]:checked + .custom-check-indicator::after { display: block; }
.custom-checkbox-card span { line-height: 1.5; font-size: 0.95rem; }

/* Risk Calculator Guidance */
#riskCalculatorGuidance summary { cursor: pointer; font-size: 1.25rem; font-weight: 700; color: var(--text-heading); list-style: none; }
#riskCalculatorGuidance summary::-webkit-details-marker { display: none; }
#riskCalculatorGuidance summary::after { content: "→"; display: inline-block; margin-left: 0.5rem; transition: transform 0.2s ease; }
#riskCalculatorGuidance[open] summary::after { transform: rotate(90deg); }
#riskCalculatorGuidance summary:focus-visible { outline: 3px solid var(--brand-accent); outline-offset: 2px; }
#riskCalculatorGuidance[open] summary { margin-bottom: 1rem; }
#riskCalculatorGuidance h4 { margin-top: 1.5rem; margin-bottom: 0.5rem; }
#riskCalculatorGuidance p { margin-bottom: 1rem; }
.severity-guide-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.severity-guide-item { background: var(--surface-card); border: 1px solid var(--border-color); border-radius: var(--radius-sm); padding: 1rem; }
.severity-guide-item strong { display: block; margin-bottom: 0.4rem; color: var(--brand-primary); }
.severity-guide-item p { margin: 0; font-size: 0.9rem; }

/* Interactive Risk Calculator & Visual Matrix */
.visual-matrix-container { display: flex; align-items: center; justify-content: center; background: var(--surface-page); padding: 1.5rem; border-radius: 8px; border: 1px solid var(--border-color); height: 100%; box-sizing: border-box; }
.calculator-container { background: var(--surface-page); padding: 1.5rem; border: 1px solid var(--border-color); border-radius: var(--radius-md); height: 100%; box-sizing: border-box;}
.matrix-y-axis { writing-mode: vertical-rl; transform: rotate(180deg); text-align: center; font-weight: bold; padding-right: 1.5rem; color: var(--text-muted); letter-spacing: 2px; }
.matrix-x-axis { text-align: center; font-weight: bold; padding-top: 1.5rem; color: var(--text-muted); letter-spacing: 2px; }
.matrix-grid { border-collapse: collapse; text-align: center; font-weight: bold; color: #fff; }
.matrix-grid td { width: 52px; height: 44px; border: 2px solid white; font-size: 1rem; }
.matrix-grid td.axis-label { background: transparent; color: var(--text-muted); border: none; font-size: 1rem; }
.bg-low { background-color: #22c55e; color: #000; }
.bg-med { background-color: #eab308; color: #000; }
.bg-high { background-color: #ef4444; }

/* Highlighter for visual matrix */
.matrix-cell { transition: all 0.2s ease; }
.matrix-highlight { outline: 4px solid var(--brand-primary); transform: scale(1.15); box-shadow: 0 4px 15px rgba(0,0,0,0.2); position: relative; z-index: 10; border-radius: 4px;}

.risk-calculator { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; align-items: start; }
.calc-col { display: flex; flex-direction: column; gap: 0.5rem; }
.calc-col h4 { text-align: center; margin-bottom: 0.5rem; font-size: 0.95rem; color: var(--text-muted); }
.calc-btn { background: var(--surface-card); border: 2px solid var(--border-color); padding: 0.75rem; border-radius: var(--radius-sm); font-weight: 600; cursor: pointer; transition: var(--transition); color: var(--text-main); position: relative; }
.calc-btn:hover { border-color: var(--brand-accent); }
.calc-btn.active { background: var(--brand-primary); color: white; border-color: var(--brand-primary); }
.calc-result { padding: 1.5rem; text-align: center; font-size: 1.2rem; font-weight: bold; border-radius: var(--radius-sm); background: var(--surface-card); border: 2px dashed var(--border-color); height: 100%; display: flex; align-items: center; justify-content: center; }
.calc-result.low { background: #22c55e; color: white; border-style: solid; border-color: #166534; }
.calc-result.med { background: #eab308; color: #1e293b; border-style: solid; border-color: #854d0e; }
.calc-result.high { background: #ef4444; color: white; border-style: solid; border-color: #991b1b; }

/* Hazard Table */
.table-responsive { width: 100%; overflow-x: auto; margin-bottom: 1.5rem; border-radius: var(--radius-md); border: 1px solid var(--border-color); box-shadow: var(--shadow-subtle); }
table.hazard-table { width: 100%; border-collapse: collapse; background: var(--surface-card); text-align: left; }
table.hazard-table th { background-color: var(--surface-page); color: var(--text-heading); padding: 1rem; font-weight: 700; font-size: 0.9rem; text-transform: uppercase; border-bottom: 2px solid var(--border-color); }
table.hazard-table td { padding: 1rem; border-bottom: 1px solid var(--border-color); vertical-align: top; }
table.hazard-table tr:hover td { background-color: var(--surface-hover); }
table.hazard-table select { width: 100%; font-weight: bold; text-align: center; text-align-last: center; padding: 0.5rem 0.25rem; }
.hazard-calc-input { width: 100%; margin-bottom: 0.5rem; padding: 0.5rem 0.5rem; font-size: 0.85rem; text-align: center; }
.category-badge { display: inline-block; background: var(--brand-primary); color: white; padding: 0.4rem 0.6rem; border-radius: 4px; font-size: 0.85rem; font-weight: bold; width: 100%; text-align: center; margin-bottom: 0.5rem;}
.hazard-subtitle { display: block; width: 100%; margin-top: 0.35rem; padding: 0.35rem 0.5rem; font-size: 0.75rem; font-style: italic; color: var(--text-muted); border: 1px dashed var(--border-color); border-radius: 4px; background: transparent; }
.category-badge-print { display: none; background: var(--brand-primary); color: white; padding: 0.4rem 0.6rem; border-radius: 4px; font-size: 0.85rem; font-weight: bold; width: 100%; text-align: center; margin-bottom: 0.5rem; }
.textarea-print-mirror { display: none; }

/* Tutor Box */
.tutor-block { background: rgba(0, 174, 199, 0.05); border-left: 4px solid var(--brand-accent); padding: 2rem; margin-top: 2rem; }
.sig-block { background: var(--surface-page); border: 1px dashed var(--border-color); padding: 2rem; border-radius: var(--radius-md); display: flex; flex-direction: column; }
.sig-block-heading { display: block; font-weight: 700; color: var(--text-heading); margin-bottom: 1.5rem; font-size: 1.1rem; }
.signature-timestamp { margin-top: 0.75rem; font-size: 0.85rem; color: var(--text-muted); font-style: italic; }

/* Modals */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,38,62,0.8); display: flex; align-items: center; justify-content: center; z-index: 1000; opacity: 0; pointer-events: none; transition: opacity 0.3s ease; }
.modal-overlay.active { opacity: 1; pointer-events: all; }
.modal-card { background: var(--surface-card); padding: 2.5rem; border-radius: var(--radius-md); max-width: 550px; width: 90%; box-shadow: 0 20px 40px rgba(0,0,0,0.2); transform: translateY(20px); transition: transform 0.3s ease; }
.modal-overlay.active .modal-card { transform: translateY(0); }
.modal-title { margin-top: 0; color: var(--text-heading); }
.modal-message { margin: 1.5rem 0; background: var(--surface-page); padding: 1.5rem; border-radius: 6px; border: 1px solid var(--border-color); font-size: 0.95rem; }
#modalActions { display: flex; flex-wrap: wrap; gap: 0.75rem; }

/* Print & Responsive Fixes */
/* Tutorial */
.tour-overlay { position: fixed; inset: 0; z-index: 2000; pointer-events: none; }
.tour-highlight {
    position: fixed; border-radius: var(--radius-md); border: 2px dashed #fdfcf3;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.72); transition: all 0.35s ease; pointer-events: none;
}
.modal-card:focus, .tour-card:focus { outline: none; }
.tour-card {
    position: fixed; z-index: 2002; background: var(--surface-card); color: var(--text-main);
    border: 1px solid var(--border-color); border-radius: var(--radius-md); box-shadow: 0 20px 40px rgba(0,0,0,0.35);
    padding: 1.5rem; width: 320px; max-width: calc(100vw - 1.5rem); pointer-events: auto; transition: all 0.35s ease;
}
.tour-progress { font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--brand-accent); margin-bottom: 0.5rem; }
.tour-card h3 { color: var(--text-heading); font-size: 1.15rem; margin-bottom: 0.5rem; }
.tour-card p { font-size: 0.9rem; color: var(--text-muted); line-height: 1.5; margin-bottom: 1.25rem; }
.tour-close { position: absolute; top: 0.6rem; right: 0.75rem; background: transparent; border: none; font-size: 1.5rem; line-height: 1; color: var(--text-muted); cursor: pointer; padding: 0.25rem; }
.tour-close:hover { color: var(--brand-danger); }
.tour-actions { display: flex; justify-content: space-between; gap: 0.75rem; }
.tour-actions .btn { width: auto; }

@media (max-width: 768px) {
    .grid-2-col, .grid-3-col, .grid-4-col { grid-template-columns: 1fr !important; }
    .btn { width: 100%; margin-bottom: 0.5rem; }

    .corner-toggles { position: fixed !important; }
    .corner-toggles .btn { width: auto; margin-bottom: 0; }
    #devAutoFillBtn { display: none !important; }

    body { padding: 1rem 0.75rem; font-size: 15px; }

    .form-header { padding: 1.5rem 1.25rem; margin-bottom: 1.5rem; }
    .form-header h3 { font-size: 1.3rem; }
    .form-header h2 { font-size: 0.95rem; }

    .form-section { padding: 1.25rem 1rem; margin-bottom: 1.25rem; }
    .form-section h2 { font-size: 1.2rem; }

    .instruction, .section-desc { font-size: 0.9rem; }

    .step-nav-buttons { flex-direction: column-reverse; gap: 0.5rem; }
    .step-nav-buttons .btn, #modalActions .btn { margin-bottom: 0; }

    .crew-row { grid-template-columns: 1fr; gap: 0.5rem; position: relative; padding-right: 2.5rem; }
    .crew-row .remove-btn { position: absolute; top: 0; right: 0; }

    .risk-calculator { grid-template-columns: 1fr; }

    .location-block, .declarations-block, .highlight-box,
    .calculator-container, .visual-matrix-container { padding: 1rem; }

    .visual-matrix-container { overflow-x: auto; justify-content: flex-start; }
    .matrix-grid td { width: 34px; height: 32px; font-size: 0.75rem; }
    .matrix-grid td.axis-label { font-size: 0.75rem; }
    .matrix-y-axis { padding-right: 0.5rem; font-size: 0.8rem; letter-spacing: 1px; }
    .matrix-x-axis { padding-top: 0.75rem; font-size: 0.8rem; letter-spacing: 1px; }

    .tutor-block, .sig-block { padding: 1.25rem; }

    .custom-checkbox-card { padding: 1rem; gap: 0.85rem; }

    .progress-container { padding: 0 0.25rem; }
    .progress-step { width: 32px; height: 32px; font-size: 0.9rem; }
    .progress-bar-bg, .progress-bar-fill { left: 0.25rem; right: 0.25rem; }

    .table-responsive { overflow-x: visible; border: none; box-shadow: none; border-radius: 0; }
    table.hazard-table thead { display: none; }
    table.hazard-table, table.hazard-table tbody, table.hazard-table tr, table.hazard-table td { display: block; width: 100%; }
    table.hazard-table tr { position: relative; background: var(--surface-card); border: 1px solid var(--border-color); border-radius: var(--radius-md); box-shadow: var(--shadow-subtle); padding: 1.25rem; margin-bottom: 1rem; }
    table.hazard-table tr:hover td { background-color: transparent; }
    table.hazard-table td { border: none; padding: 0.6rem 0; }
    table.hazard-table td[data-label]::before {
        content: attr(data-label); display: block; margin-bottom: 0.4rem;
        font-size: 0.75rem; font-weight: 700; text-transform: uppercase;
        letter-spacing: 0.03em; color: var(--text-muted);
    }
    table.hazard-table td textarea { min-height: 6rem; }
    table.hazard-table td.wizard-hide-print { position: absolute; top: 0.75rem; right: 0.75rem; padding: 0; width: auto; }
    .category-badge { margin-bottom: 0; }

    .modal-overlay { align-items: flex-start; overflow-y: auto; padding: 1.25rem 0; }
    .modal-card { padding: 1.25rem; width: 94%; }
    .modal-message { padding: 1rem; margin: 1rem 0; }
}

@media (max-width: 420px) {
    .progress-step { width: 28px; height: 28px; font-size: 0.8rem; }
}

@media print {
    :root, :root[data-theme="dark"] {
        --surface-page: #ffffff; --surface-card: #ffffff; --surface-hover: #ffffff;
        --surface-highlight: rgba(0, 174, 199, 0.08); --surface-selected: #e6f0f9;
        --text-main: #1e293b; --text-muted: #55647a; --text-heading: #00263E;
        --border-color: #cbd5e1; --border-focus: #00263E; color-scheme: light;
    }
    @page { margin: 1cm; }
    html, body, .container { background: white !important; margin: 0 !important; padding: 0 !important; box-shadow: none !important; width: 100% !important; }
    .step-nav-buttons, .progress-container, button, .wizard-hide-print, .no-print, .modal-overlay, .section-desc, .instruction { display: none !important; }
    #preScreenSection:has(#droneDetailsBox.hidden) { display: none !important; }
    .form-step { display: block !important; opacity: 1 !important; }
    .form-section { padding: 5px 0 !important; margin: 0 0 15px 0 !important; border: none !important; border-bottom: 2px solid #ddd !important; box-shadow: none !important;}
    h2 { font-size: 14pt !important; margin-bottom: 8px !important; }
    h2, h3, h4, .police-question-heading, .sig-block-heading, .location-header h3 {
        break-after: avoid-page; page-break-after: avoid;
    }
    input, textarea, select { border: 1px solid #aaa !important; background: transparent !important; }
    textarea { display: none !important; }
    .textarea-print-mirror {
        display: block !important;
        white-space: pre-wrap;
        word-break: break-word;
        border: 1px solid #aaa;
        border-radius: 4px;
        padding: 0.5rem;
        min-height: 2.5rem;
        background: transparent;
    }
    .hazard-cat-select { display: none !important; }
    .category-badge-print { display: block !important; }
    .location-block, .hazard-table tr, .custom-checkbox-card, .declarations-block, .visual-matrix-container, .calculator-container, .sig-block, .tutor-block,
    .input-group, .env-item, .grid-2-col, .grid-3-col {
        break-inside: avoid-page; page-break-inside: avoid;
    }
}