/* Fleet inspection report (fleet.html #maintenanceModal) design, scoped to
   the investigation dialog so the register and page header remain unchanged. */
#editorModal {
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    font-family: Inter, system-ui, -apple-system, sans-serif;
    font-size: .9rem;
    line-height: 1.5;
}
#editorModal .fw-editor-container {
    background: linear-gradient(to bottom right, #ffffff, #f8f9fa);
    border-radius: 0;
    width: 95%;
    max-width: 1200px;
    height: auto;
    max-height: 90vh;
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.05);
}
#editorModal.show .fw-editor-container { animation: fwFleetModalSlide .25s ease-out; }
@keyframes fwFleetModalSlide {
    from { transform: translateY(15px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
#editorModal .fw-editor-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    background: rgba(255, 255, 255, 0.95);
    position: sticky;
    top: 0;
    z-index: 2;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.03);
    gap: 10px;
}
#editorModal .fw-editor-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0;
    position: relative;
    gap: 10px;
    overflow-wrap: anywhere;
}
#editorModal .fw-editor-header h3::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 40px;
    height: 3px;
    background: #3b82f6;
    border-radius: 2px;
}
#editorModal .fw-editor-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #666;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    flex-shrink: 0;
    transition: all .2s ease;
}
#editorModal .fw-editor-close:hover { background-color: #f0f0f0; color: #333; transform: rotate(90deg); }
#editorModal .fw-editor-body {
    padding: 1.25rem 1.5rem;
    overflow: auto;
    max-height: 72vh;
    min-height: 0;
    background: transparent;
    position: relative;
    scrollbar-width: thin;
    scrollbar-color: #ddd transparent;
}
#editorModal .fw-editor-body::-webkit-scrollbar { width: 6px; }
#editorModal .fw-editor-body::-webkit-scrollbar-track { background: transparent; }
#editorModal .fw-editor-body::-webkit-scrollbar-thumb { background-color: #ddd; border-radius: 3px; }
#editorModal .fw-editor-body::-webkit-scrollbar-thumb:hover { background-color: #bbb; }
#editorModal #editor { margin: 0; border: 0; border-radius: 0; overflow: visible; background: transparent; }
#editorModal .fw-editor-summary {
    gap: 12px;
    margin-bottom: 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 12px;
    border-radius: 8px;
}
#editorModal .fw-editor-summary h2 { font-size: .85rem; color: #334155; }
#editorModal .fw-editor-note { padding: 0 0 12px; font-size: .75rem; }
#editorModal .fw-editor-note:empty { display: none; }
#editorModal .fw-section-tabs {
    /* A sibling of the scrolling body, so tabs stay visible at every depth. */
    position: relative;
    flex-shrink: 0;
    padding: 0 1.5rem;
    margin: 0;
    gap: 0;
    background: #f8f9fa;
    border-bottom: 1px solid #e2e8f0;
}
#editorModal .fw-section-tab {
    padding: .65rem .75rem;
    font-size: .75rem;
    border-bottom-width: 2px;
    font-weight: 500;
    gap: 6px;
}
#editorModal .fw-section-tab[aria-selected="true"] { color: #2c3e50; border-bottom-color: #3b82f6; background: #fff; font-weight: 600; }
#editorModal .fw-section-tab span { width: auto; height: auto; border-radius: 0; background: none; color: inherit; font-size: .65rem; }
#editorModal .fw-section { border: 1px solid #e0e0e0; border-radius: 8px; padding: 10px; background: #fff; }
#editorModal .fw-section h3 { font-size: .85rem; font-weight: 600; gap: 6px; margin-bottom: 10px; }
#editorModal .fw-section h3 > span { display: none; }
#editorModal .fw-section > .fw-toolbar h3 { margin: 0; }
#editorModal .fw-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
#editorModal .fw-grid label { font-size: .75rem; color: #334155; font-weight: 600; gap: 6px; min-width: 0; }
#editorModal .fw-grid input:not([type="checkbox"]),
#editorModal .fw-grid select,
#editorModal .fw-grid textarea {
    border: 1px solid #dfe3e8;
    background: #fff;
    padding: 8px 10px;
    border-radius: 6px;
    font-size: .85rem;
    color: #333;
    outline: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}
#editorModal .fw-grid input:focus, #editorModal .fw-grid select:focus, #editorModal .fw-grid textarea:focus {
    outline: none;
    border-color: #80bdff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, .15);
}
#editorModal .fw-branch, #editorModal .fw-action { border: 1px solid #e0e0e0; border-radius: 8px; padding: 10px; background: #fff; }
#editorModal .fw-step { background: #f8fafc; }
#editorModal .fw-hint { font-size: .75rem; }
#editorModal .fw-history { padding: 12px 0 0; }
#editorModal .fw-save-bar {
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    gap: .85rem;
    justify-content: flex-end;
    background: rgba(255, 255, 255, 0.95);
    position: sticky;
    bottom: 0;
    z-index: 2;
    flex-shrink: 0;
    box-shadow: 0 -2px 15px rgba(0, 0, 0, 0.03);
}
#editorModal #saveState { margin-right: auto; }
#editorModal .fw-save-bar .fw-tools { justify-content: flex-end; gap: .85rem; }
#editorModal .fw-btn {
    padding: .45rem .85rem;
    border: none;
    border-radius: 6px;
    font-size: .7rem;
    font-weight: 600;
    background: #efefef;
    color: #333;
    transition: .2s;
}
#editorModal .fw-btn:hover { opacity: .9; transform: translateY(-1px); }
#editorModal .fw-btn.fw-cancel { background: #3498db; color: #fff; }
#editorModal .fw-btn.fw-primary { background: #2c3e50; color: #fff; }
#editorModal .fw-btn.fw-danger { background: #e74c3c; color: #fff; }
/* Incident Board .nim-inner Responsible Person search control. */
#editorModal .fw-grid .fw-search-label { font-size: .85rem; gap: 4px; }
#editorModal .fw-search-container { display: block; position: relative; width: 100%; min-width: 0; }
#editorModal .fw-grid input.fw-search-input {
    width: 100%; padding: 10px; border: 1px solid #ced4da; border-radius: 6px;
    font-size: .9rem; box-sizing: border-box; font-weight: 400;
}
#editorModal .fw-search-input:disabled { background: #f8f9fa; color: #666; cursor: not-allowed; }
#editorModal .fw-search-dropdown {
    display: block; position: absolute; top: 100%; left: 0; right: 0;
    background: #fff; border: 1px solid #ced4da; border-top: none;
    border-radius: 0 0 6px 6px; max-height: 200px; overflow-y: auto;
    z-index: 100; font-size: .9rem; font-weight: 400;
}
#editorModal .fw-search-dropdown.fw-search-above { top: auto; bottom: 100%; border-top: 1px solid #ced4da; border-bottom: none; border-radius: 6px 6px 0 0; }
#editorModal .fw-search-result { display: block; padding: 10px 12px; cursor: pointer; border-bottom: 1px solid #f0f0f0; }
#editorModal .fw-search-result:hover, #editorModal .fw-search-active { background: #f8f9fa; }
#editorModal .fw-user-name { display: block; font-weight: 600; color: #333; }
#editorModal .fw-user-title { display: block; font-size: .8rem; color: #666; margin-top: 2px; }
#editorModal .fw-employee-id { color: #6b7280; font-weight: normal; }
#editorModal .fw-search-empty { color: #9ca3af; cursor: default; }
/* Investigation List -> Investigation Team / Add Person cards. */
#editorModal .fw-team-section h3, #editorModal .fw-attachments-section h3 { font-size: .95rem; font-weight: 600; color: #374151; margin-bottom: .5rem; }
#editorModal #addTeamMember { margin-bottom: .75rem; padding: 0; width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; background: #3b82f6; font-size: .85rem; font-weight: 500; }
#editorModal .intro-team-member { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px; padding: 1rem; margin-bottom: .75rem; }
#editorModal .intro-team-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 1rem; align-items: end; }
#editorModal .intro-team-row label { font-size: .85rem; font-weight: 600; gap: .25rem; }
#editorModal .intro-team-row input.fw-search-input, #editorModal .intro-team-row select.intro-role-select { width: 100%; padding: .5rem; border: 1px solid #d1d5db; border-radius: 4px; font-size: .85rem; }
#editorModal .intro-team-row .fw-search-dropdown { z-index: 100; box-shadow: 0 4px 12px rgba(0,0,0,.15); }
/* Embedded editor page (5w-create.html), hosted full-bleed inside investigation-list.html's
   own dialog/iframe: drop this page's own backdrop and header, since the host already
   provides them. */
html.in-iframe, html.in-iframe body { height: 100%; margin: 0; background: transparent; }
html.in-iframe #editorModal { position: static; width: 100%; height: 100%; background: transparent; backdrop-filter: none; }
html.in-iframe #editorModal .fw-editor-container { width: 100%; height: 100%; max-width: none; border: 0; border-radius: 0; box-shadow: none; }
html.in-iframe #editorModal .fw-editor-header { display: none; }
html.in-iframe #editorModal .fw-editor-body { max-height: none; flex: 1 1 auto; }
#editorModal .intro-team-row .fw-search-result { padding: 8px 12px; }
#editorModal .intro-team-row .fw-danger { padding: .5rem .75rem; font-size: .8rem; height: fit-content; }
#editorModal .fw-attachments-section .fw-table td { overflow-wrap: anywhere; }
#editorModal #legacyTeam, #editorModal #legacyEvidence { white-space: pre-wrap; }
@media screen and (max-width: 600px) {
    #editorModal .intro-team-row { grid-template-columns: minmax(0, 1fr); }
    #editorModal .fw-editor-header { padding: 1rem; }
    #editorModal .fw-section-tabs { padding: 0 1rem; }
    #editorModal .fw-editor-body { padding: 1rem; }
    #editorModal .fw-save-bar { padding: .75rem 1rem; }
    #editorModal .fw-grid { grid-template-columns: minmax(0, 1fr); }
    #editorModal .fw-save-bar .fw-tools { gap: .5rem; }
}
@media (prefers-reduced-motion: reduce) {
    #editorModal.show .fw-editor-container { animation: none; }
    #editorModal .fw-editor-close, #editorModal .fw-btn { transition: none; }
}