/* Savvy Property Assessment - spa-global.css (merged bundle) */

/* =====================================================
   Voice-to-text mic button (added by spa-mic-input.js)
===================================================== */

.spa-mic-wrap {
    position: relative;
    display: inline-block;
    width: 100%;
}

.spa-mic-wrap--block {
    display: block;
}

.spa-mic-wrap > input,
.spa-mic-wrap > textarea {
    padding-right: 38px !important;
    box-sizing: border-box;
    width: 100%;
}

.spa-mic-btn {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 28px;
    height: 28px;
    padding: 0;
    margin: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #d1d5db;
    border-radius: 50%;
    background: #ffffff;
    color: #4b5563;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
    z-index: 5;
    line-height: 0;
}

.spa-mic-btn:hover {
    color: #111827;
    border-color: #9ca3af;
    background: #f9fafb;
}

.spa-mic-btn:focus {
    outline: none;
    border-color: #558bf6;
    box-shadow: 0 0 0 3px rgba(85, 139, 246, 0.18);
}

.spa-mic-btn:active {
    transform: scale(0.96);
}

.spa-mic-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Listening (recording) state — red, pulsing */
.spa-mic-btn.is-listening {
    background: #ef4444;
    border-color: #dc2626;
    color: #ffffff;
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.25);
    animation: spa-mic-pulse 1.2s ease-in-out infinite;
}

.spa-mic-btn.is-listening:hover {
    background: #dc2626;
    color: #ffffff;
}

@keyframes spa-mic-pulse {
    0%, 100% { box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.25); }
    50%      { box-shadow: 0 0 0 7px rgba(239, 68, 68, 0.10); }
}

/* When the mic sits over a textarea, nudge it down a touch from the top edge */
.spa-mic-wrap > textarea + .spa-mic-btn {
    top: 8px;
    right: 8px;
}

/* Inside the AI Deficiencies modal, position the same way */
#spa-ai-def-modal .spa-mic-wrap > textarea + .spa-mic-btn {
    top: 8px;
    right: 8px;
}

/* When the field is inside an inline AI wrapper (Building Type, etc.), the
   input was the flex child. Wrapping it makes the .spa-mic-wrap the flex
   child instead, so we have to give the wrap the same flex behavior so the
   input doesn't collapse to a small box. */
.spa-ai-wrapper--inline > .spa-mic-wrap {
    flex: 1 1 auto;
    min-width: 0;
    width: auto;
}

.spa-ai-wrapper--inline > .spa-mic-wrap > input,
.spa-ai-wrapper--inline > .spa-mic-wrap > textarea {
    width: 100%;
    min-width: 0;
}

/* Mic button anchored to a .spa-ai-wrapper. Positioned absolutely in the
   top-right of the wrapper, above any .wp-editor-wrap iframe inside it.
   Used for both simple inputs AND TinyMCE-bound textareas — the wrapper
   stays visible after TinyMCE replaces the textarea with an iframe, so
   anchoring here gives us a consistent mic location on every step. */
.spa-form-wrap .spa-ai-wrapper,
.spa-step-container .spa-ai-wrapper,
#spa-ai-def-modal .spa-ai-wrapper {
    position: relative;
}

.spa-ai-wrapper > .spa-mic-btn--ai {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 12;
}

/* Inline AI wrappers (Building Type, etc.) lay their children out as a
   row, so the mic shouldn't overlap the field — push it further right
   and above the AI Improve button. The flex children keep their normal
   widths since the mic is absolutely positioned out of flow. */
.spa-ai-wrapper--inline > .spa-mic-btn--ai {
    top: 6px;
    right: 6px;
}

/* When a single-field AI wrapper holds a TinyMCE editor, give its inner
   inputs a bit of right padding so the mic doesn't sit on top of typed
   text. */
.spa-ai-wrapper > input.spa-ai-input,
.spa-ai-wrapper > textarea.spa-ai-textarea,
.spa-ai-wrapper > textarea.spa-textarea {
    padding-right: 42px;
    box-sizing: border-box;
}





/* Rich text (TinyMCE) on inspection forms */
.spa-form-wrap .wp-editor-wrap,
.spa-step-container .wp-editor-wrap {
    margin-top: 6px;
    max-width: 100%;
}

.spa-form-wrap .mce-tinymce,
.spa-step-container .mce-tinymce {
    border-radius: 5px;
}

.spa-form-wrap .wp-editor-container textarea.wp-editor-area,
.spa-step-container .wp-editor-container textarea.wp-editor-area {
    min-height: 120px;
}

/* =====================================================
   Toolbar-on-focus rich textareas
   - Hide all editor chrome by default (Visual/Text tabs, media buttons,
     quicktags, status bar, resize handle, AND the formatting toolbar).
   - Show the formatting toolbar only when the editor is focused / hovered
     (the wrapper gets .spa-rich-is-editing added on TinyMCE focus).
   - Always KEEP the rendered formatted content (headings, bold, italic,
     bullets) inside the editor body.
   - Selectors are scoped to .spa-form-wrap / .spa-step-container so they
     never bleed into the rest of WP admin, and use !important to beat
     Divi/other theme overrides.
   - Covers both classic TinyMCE 4 (.mce-*) and newer TinyMCE 5/6 (.tox-*).
===================================================== */

/* Always-hidden chrome on inspection-form editors */
.spa-form-wrap .wp-editor-tabs,
.spa-step-container .wp-editor-tabs,
.spa-form-wrap .wp-media-buttons,
.spa-step-container .wp-media-buttons,
.spa-form-wrap .quicktags-toolbar,
.spa-step-container .quicktags-toolbar,
.spa-form-wrap .mce-menubar,
.spa-step-container .mce-menubar,
.spa-form-wrap .mce-statusbar,
.spa-step-container .mce-statusbar,
.spa-form-wrap .mce-path,
.spa-step-container .mce-path,
.spa-form-wrap .mce-resizehandle,
.spa-step-container .mce-resizehandle,
.spa-form-wrap .tox-statusbar,
.spa-step-container .tox-statusbar,
.spa-form-wrap .tox-menubar,
.spa-step-container .tox-menubar {
    display: none !important;
}

/* Hide the formatting toolbar by default — covers TinyMCE 4 (.mce-) and 5/6 (.tox-) */
.spa-form-wrap .mce-toolbar-grp,
.spa-step-container .mce-toolbar-grp,
.spa-form-wrap .mce-toolbar,
.spa-step-container .mce-toolbar,
.spa-form-wrap .tox-editor-header,
.spa-step-container .tox-editor-header,
.spa-form-wrap .tox-toolbar-overlord,
.spa-step-container .tox-toolbar-overlord,
.spa-form-wrap .tox-toolbar,
.spa-step-container .tox-toolbar,
.spa-form-wrap .tox-toolbar__primary,
.spa-step-container .tox-toolbar__primary {
    max-height: 0 !important;
    min-height: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
    opacity: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
    visibility: hidden !important;
    transition: max-height 0.15s ease, opacity 0.15s ease, visibility 0s linear 0.15s !important;
    pointer-events: none !important;
}

/* Reveal the toolbar only when the editor is focused / actively being edited.
   (No :hover triggers — toolbar stays collapsed until the user clicks in.) */
.spa-form-wrap .wp-editor-wrap:focus-within .mce-toolbar-grp,
.spa-form-wrap .wp-editor-wrap:focus-within .mce-toolbar,
.spa-form-wrap .wp-editor-wrap.spa-rich-is-editing .mce-toolbar-grp,
.spa-form-wrap .wp-editor-wrap.spa-rich-is-editing .mce-toolbar,
.spa-step-container .wp-editor-wrap:focus-within .mce-toolbar-grp,
.spa-step-container .wp-editor-wrap:focus-within .mce-toolbar,
.spa-step-container .wp-editor-wrap.spa-rich-is-editing .mce-toolbar-grp,
.spa-step-container .wp-editor-wrap.spa-rich-is-editing .mce-toolbar,
.spa-form-wrap .mce-tinymce:focus-within .mce-toolbar-grp,
.spa-form-wrap .mce-tinymce:focus-within .mce-toolbar,
.spa-step-container .mce-tinymce:focus-within .mce-toolbar-grp,
.spa-step-container .mce-tinymce:focus-within .mce-toolbar,
.spa-form-wrap .wp-editor-wrap:focus-within .tox-editor-header,
.spa-form-wrap .wp-editor-wrap.spa-rich-is-editing .tox-editor-header,
.spa-step-container .wp-editor-wrap:focus-within .tox-editor-header,
.spa-step-container .wp-editor-wrap.spa-rich-is-editing .tox-editor-header,
.spa-form-wrap .wp-editor-wrap:focus-within .tox-toolbar-overlord,
.spa-form-wrap .wp-editor-wrap:focus-within .tox-toolbar,
.spa-form-wrap .wp-editor-wrap.spa-rich-is-editing .tox-toolbar-overlord,
.spa-form-wrap .wp-editor-wrap.spa-rich-is-editing .tox-toolbar,
.spa-step-container .wp-editor-wrap:focus-within .tox-toolbar-overlord,
.spa-step-container .wp-editor-wrap:focus-within .tox-toolbar,
.spa-step-container .wp-editor-wrap.spa-rich-is-editing .tox-toolbar-overlord,
.spa-step-container .wp-editor-wrap.spa-rich-is-editing .tox-toolbar {
    max-height: 200px !important;
    min-height: 0 !important;
    height: auto !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    padding: 4px !important;
    transition: max-height 0.15s ease, opacity 0.15s ease, visibility 0s linear 0s !important;
}

/* Visible bordered container — placed on .mce-tinymce (TinyMCE's own wrapper)
   AND .wp-editor-container as a fallback, so the editor is always visible
   even if Divi/theme suppresses one of them. */
.spa-form-wrap .wp-editor-container,
.spa-step-container .wp-editor-container,
.spa-form-wrap .mce-tinymce,
.spa-step-container .mce-tinymce {
    border: 1px solid #cbd5e1 !important;
    border-radius: 6px !important;
    background: #fff !important;
    overflow: hidden !important;
    transition: border-color 0.15s ease, box-shadow 0.15s ease !important;
    box-shadow: none;
}

/* Blue focus ring while editing */
.spa-form-wrap .wp-editor-wrap:focus-within .wp-editor-container,
.spa-form-wrap .wp-editor-wrap.spa-rich-is-editing .wp-editor-container,
.spa-step-container .wp-editor-wrap:focus-within .wp-editor-container,
.spa-step-container .wp-editor-wrap.spa-rich-is-editing .wp-editor-container,
.spa-form-wrap .wp-editor-wrap:focus-within .mce-tinymce,
.spa-form-wrap .wp-editor-wrap.spa-rich-is-editing .mce-tinymce,
.spa-step-container .wp-editor-wrap:focus-within .mce-tinymce,
.spa-step-container .wp-editor-wrap.spa-rich-is-editing .mce-tinymce {
    border-color: #558bf6 !important;
    box-shadow: 0 0 0 3px rgba(85, 139, 246, 0.15) !important;
}

/* Always-visible editor body — guarantee a minimum height so the field is
   never an invisible empty box, even when the toolbar is collapsed and the
   field has no content yet. */
.spa-form-wrap .mce-edit-area,
.spa-step-container .mce-edit-area,
.spa-form-wrap .wp-editor-container,
.spa-step-container .wp-editor-container {
    min-height: 160px !important;
}

.spa-form-wrap .mce-edit-area iframe,
.spa-step-container .mce-edit-area iframe {
    min-height: 160px !important;
    background: #fff !important;
    border: 0 !important;
    display: block !important;
    width: 100% !important;
}

/* Strip the inner TinyMCE strut frames (we don't want a double border). */
.spa-form-wrap .mce-edit-area,
.spa-step-container .mce-edit-area,
.spa-form-wrap .mce-container-body,
.spa-step-container .mce-container-body,
.spa-form-wrap .mce-stack-layout,
.spa-step-container .mce-stack-layout,
.spa-form-wrap .mce-stack-layout-item,
.spa-step-container .mce-stack-layout-item {
    border: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
}

.spa-form-wrap textarea.wp-editor-area,
.spa-step-container textarea.wp-editor-area {
    border: 0 !important;
    box-shadow: none !important;
    padding: 10px 12px !important;
    min-height: 160px !important;
    background: #fff !important;
}

/* ========== AI Improve (all steps) ========== */

.spa-form-wrap .spa-ai-wrapper .screen-reader-text,
.spa-step-container .spa-ai-wrapper .screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.spa-form-wrap .spa-images-section .spa-ai-wrapper,
.spa-step-container .spa-images-section .spa-ai-wrapper {
    position: relative;
    width: 100%;
    margin-top: 10px;
}

.spa-form-wrap .spa-images-section .spa-ai-wrapper .spa-ai-textarea,
.spa-step-container .spa-images-section .spa-ai-wrapper .spa-ai-textarea {
    min-height: 110px;
}

/* Stacked textarea + AI icon (image captions, deficiencies, notes, etc.) */
.spa-form-wrap .spa-ai-wrapper:not(.spa-ai-wrapper--inline),
.spa-step-container .spa-ai-wrapper:not(.spa-ai-wrapper--inline) {
    position: relative;
    width: 100%;
    margin-top: 6px;
    box-sizing: border-box;
}

.spa-form-wrap .spa-ai-wrapper:not(.spa-ai-wrapper--inline) .spa-ai-textarea,
.spa-step-container .spa-ai-wrapper:not(.spa-ai-wrapper--inline) .spa-ai-textarea {
    width: 100%;
    min-height: 90px;
    box-sizing: border-box;
    resize: vertical;
    padding-right: 48px;
    padding-bottom: 42px;
    margin-top: 0;
}

.spa-form-wrap .spa-ai-wrapper:not(.spa-ai-wrapper--inline) .spa-ai-trigger,
.spa-step-container .spa-ai-wrapper:not(.spa-ai-wrapper--inline) .spa-ai-trigger {
    position: absolute;
    top: auto;
    right: 8px;
    bottom: 8px;
    width: 36px;
    height: 36px;
    padding: 0;
    margin: 0;
    border: none;
    border-radius: 8px;
    background: #558bf6;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 4;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
    line-height: 0;
}

.spa-form-wrap .spa-ai-wrapper:not(.spa-ai-wrapper--inline) .spa-ai-trigger:hover:not(:disabled),
.spa-step-container .spa-ai-wrapper:not(.spa-ai-wrapper--inline) .spa-ai-trigger:hover:not(:disabled) {
    background: #4478e8;
}

.spa-form-wrap .spa-ai-wrapper:not(.spa-ai-wrapper--inline) .spa-ai-trigger:disabled,
.spa-step-container .spa-ai-wrapper:not(.spa-ai-wrapper--inline) .spa-ai-trigger:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.spa-form-wrap .spa-ai-wrapper:not(.spa-ai-wrapper--inline) .spa-ai-trigger svg,
.spa-step-container .spa-ai-wrapper:not(.spa-ai-wrapper--inline) .spa-ai-trigger svg {
    display: block;
    flex-shrink: 0;
}

.spa-form-wrap .spa-ai-wrapper:not(.spa-ai-wrapper--inline) .spa-ai-trigger--processing svg,
.spa-step-container .spa-ai-wrapper:not(.spa-ai-wrapper--inline) .spa-ai-trigger--processing svg {
    animation: spa-ai-spin 0.9s linear infinite;
}

.spa-form-wrap .spa-ai-wrapper--inline,
.spa-step-container .spa-ai-wrapper--inline {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: 8px;
    max-width: 100%;
    margin-bottom: 0.75rem;
}

.spa-form-wrap .spa-ai-wrapper--inline .spa-ai-inline-target,
.spa-step-container .spa-ai-wrapper--inline .spa-ai-inline-target {
    flex: 1 1 auto;
    min-width: 0;
    width: auto;
}

.spa-form-wrap .spa-ai-wrapper--inline .spa-ai-trigger,
.spa-step-container .spa-ai-wrapper--inline .spa-ai-trigger {
    position: static;
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    padding: 0;
    margin: 0;
    border: none;
    border-radius: 8px;
    background: #558bf6;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    align-self: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
    line-height: 0;
}

.spa-form-wrap .spa-ai-wrapper--inline .spa-ai-trigger:hover:not(:disabled),
.spa-step-container .spa-ai-wrapper--inline .spa-ai-trigger:hover:not(:disabled) {
    background: #4478e8;
}

.spa-form-wrap .spa-ai-wrapper--inline .spa-ai-trigger:disabled,
.spa-step-container .spa-ai-wrapper--inline .spa-ai-trigger:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.spa-form-wrap .spa-ai-wrapper--inline .spa-ai-trigger svg,
.spa-step-container .spa-ai-wrapper--inline .spa-ai-trigger svg {
    display: block;
    flex-shrink: 0;
}

.spa-form-wrap .spa-ai-wrapper--inline .spa-ai-trigger--processing svg,
.spa-step-container .spa-ai-wrapper--inline .spa-ai-trigger--processing svg {
    animation: spa-ai-spin 0.9s linear infinite;
}

@keyframes spa-ai-spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Deficiency AI modal */
.spa-ai-def-modal {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: none;
}

.spa-ai-def-modal.is-open {
    display: block;
}

.spa-ai-def-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
}

.spa-ai-def-modal__dialog {
    position: relative;
    width: min(760px, calc(100vw - 24px));
    max-height: calc(100vh - 24px);
    margin: 12px auto;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 12px 38px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.spa-ai-def-modal__header,
.spa-ai-def-modal__footer {
    padding: 12px 14px;
    border-bottom: 1px solid #e3e3e3;
}

.spa-ai-def-modal__footer {
    border-top: 1px solid #e3e3e3;
    border-bottom: none;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.spa-ai-def-modal__header h3 {
    margin: 0;
    font-size: 18px;
}

.spa-ai-def-modal__close {
    position: absolute;
    right: 12px;
    top: 8px;
    width: 34px;
    height: 34px;
    border: none;
    background: transparent;
    font-size: 24px;
    cursor: pointer;
}

.spa-ai-def-modal__body {
    padding: 14px;
    overflow-y: auto;
}

.spa-ai-def-modal__label {
    display: block;
    margin: 0 0 6px;
    font-weight: 700;
}

.spa-ai-def-modal__prompt {
    width: 100%;
    min-height: 130px;
    resize: vertical;
    box-sizing: border-box;
}

.spa-ai-def-drop {
    margin-top: 4px;
    border: 2px dashed #c8c8c8;
    border-radius: 8px;
    padding: 14px;
    text-align: center;
    background: #fafafa;
}

.spa-ai-def-drop.is-dragging {
    border-color: #558bf6;
    background: #eff5ff;
}

.spa-ai-def-drop input[type="file"] {
    display: none;
}

.spa-ai-def-link-btn {
    border: none;
    background: transparent;
    color: #1d5ad8;
    text-decoration: underline;
    cursor: pointer;
}

.spa-ai-def-file-list {
    margin-top: 10px;
    border: 1px solid #eee;
    border-radius: 6px;
    padding: 8px;
    max-height: 140px;
    overflow-y: auto;
}

.spa-ai-def-file-empty {
    margin: 0;
    color: #666;
}

.spa-ai-def-file-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
    border-bottom: 1px solid #f1f1f1;
}

.spa-ai-def-file-row:last-child {
    border-bottom: none;
}

.spa-ai-def-file-remove {
    border: 1px solid #c5c5c5;
    background: #fff;
    border-radius: 4px;
    cursor: pointer;
    padding: 4px 8px;
}

.spa-ai-def-status {
    margin-top: 10px;
    font-weight: 600;
    color: #244a99;
    min-height: 22px;
}

.spa-ai-def-status.is-error {
    color: #b42318;
}

/* Step 9 preview / email panel (not always .spa-form-wrap) */
#spa-step8-preview .spa-ai-wrapper .screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

#spa-step8-preview .spa-ai-wrapper:not(.spa-ai-wrapper--inline) {
    position: relative;
    width: 100%;
    margin-top: 6px;
    box-sizing: border-box;
}

#spa-step8-preview .spa-ai-wrapper:not(.spa-ai-wrapper--inline) .spa-ai-textarea {
    width: 100%;
    min-height: 90px;
    box-sizing: border-box;
    resize: vertical;
    padding-right: 48px;
    padding-bottom: 42px;
    margin-top: 0;
}

#spa-step8-preview .spa-ai-wrapper:not(.spa-ai-wrapper--inline) .spa-ai-trigger {
    position: absolute;
    right: 8px;
    bottom: 8px;
    width: 36px;
    height: 36px;
    padding: 0;
    margin: 0;
    border: none;
    border-radius: 8px;
    background: #558bf6;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 4;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
    line-height: 0;
}

#spa-step8-preview .spa-ai-wrapper:not(.spa-ai-wrapper--inline) .spa-ai-trigger:hover:not(:disabled) {
    background: #4478e8;
}

#spa-step8-preview .spa-ai-wrapper:not(.spa-ai-wrapper--inline) .spa-ai-trigger--processing svg {
    animation: spa-ai-spin 0.9s linear infinite;
}

/* ========== form-style.css ========== */

.spa-form-wrap {
  max-width: 1200px;
  margin: 30px auto;
  padding: 25px;
  border: 1px solid #ddd;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
}

.spa-form-wrap label {
  font-weight: 600;
  display: block;
  margin-top: 10px;
}

.spa-form-wrap input,
.spa-form-wrap select,
.spa-form-wrap textarea,
.spa-form-wrap button {
  width: 100%;
  padding: 8px;
  margin-top: 5px;
  border-radius: 5px;
  border: 1px solid #ccc;
}

/* Buttons should not default to full width (step styles use float/inline-block). */
.spa-form-wrap button {
  width: auto;
}

.spa-form-wrap button.spa-btn {
  margin-top: 15px;
  background: #002b6f;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

.spa-form-wrap button.spa-btn:hover {
  background: #0045b5;
}

#spa-response {
  margin-top: 10px;
  font-weight: 600;
}

/* Image preview styling */
#spa-image-preview-area img {
  box-shadow: 0 2px 5px rgba(0,0,0,0.15);
  transition: transform 0.2s ease;
}
#spa-image-preview-area img:hover {
  transform: scale(1.05);
}

#spa-uploaded-images img {
  box-shadow: 0 2px 5px rgba(0,0,0,0.15);
  transition: transform 0.2s ease;
}
#spa-uploaded-images img:hover {
  transform: scale(1.05);
}

#input.text, input.title, input[type=email], input[type=password], input[type=tel], input[type=text], select, textarea {
    background-color: #fff;
    border: 1px solid #bbb !important;
    padding: 12px !important;
    color: #4e4e4e;
}

/* Force left alignment for all "Condition" columns */
#inspection-step9 table td:nth-child(2),
#inspection-step9 table th:nth-child(2) {
    text-align: left !important;
}

/* Table spacing for rating grids (tighter cells) */
.spa-check-table {
  border-spacing: 0;
  table-layout: fixed;
}

/* Only the rating grids (those with radios) should get fixed column widths. */
table.spa-check-table:has(input[type="radio"]) th:first-child,
table.spa-check-table:has(input[type="radio"]) td:first-child {
  width: 280px !important;
  min-width: 280px !important;
}

/* Radio columns (everything except first column) should be tight */
table.spa-check-table:has(input[type="radio"]) thead th:not(:first-child),
table.spa-check-table:has(input[type="radio"]) tbody td:not(:first-child) {
  width: 44px !important;
  min-width: 44px !important;
  white-space: nowrap;
}

.spa-check-table th,
.spa-check-table td {
  padding: 6px 6px !important;
  line-height: 1.15 !important;
}

/* ========== spa-image-style.css ========== */

/* Consistent styling for all image upload previews */

.spa-preview-area {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}

.spa-preview-item {
  display: flex;
  align-items: center;
  gap: 10px;
}

.spa-preview-item img {
  width: 120px;
  height: 120px;
  object-fit: cover;
  border: 1px solid #ccc;
  border-radius: 6px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.spa-remove-btn {
  background: #d9534f;
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  font-size: 16px;
  cursor: pointer;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}

.spa-remove-btn:hover {
  background: #b52b27;
}


/* ========== spa-image-upload.css ========== */

/* === Image Uploader — Unified === */

.spa-uploader-block {
    margin-bottom: 20px;
}

/* Preview grid */
.spa-preview-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 12px;
}

/* Individual preview card */
.spa-preview-box {
    border: 1px solid #ddd;
    padding: 10px;
    border-radius: 8px;
    background: #fafafa;
    display: inline-block;
    position: relative;
    max-width: 160px;
}

/* Preview image */
.spa-preview-box {
    border: 1px solid #ddd;
    padding: 10px;
    padding-top: 35px;   /* ← Gives room above the image */
    border-radius: 8px;
    background: #fafafa;
    display: inline-block;
    position: relative;
    max-width: 160px;
}

/* Delete (X) button — scope to delete classes only (not e.g. Step 1 .spa-ai-trigger) */
.spa-preview-box .spa-delete-image-btn,
.spa-preview-box .spa-delete-existing {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;

    position: absolute;
    top: 5px;
    right: 5px;
    z-index: 12;

    background: #c0392b;
    color: #fff;
    border: none;

    width: 34px;
    height: 34px;
    border-radius: 50%;
    cursor: pointer;

    font-size: 18px;     /* adjust to taste */
    font-weight: bold;
    line-height: 24px;   /* <<< THE IMPORTANT FIX */
    padding: 0 !important;
}

/* Annotation textarea */
.spa-preview-box textarea {
    width: 100%;
    height: 55px;
    border-radius: 4px;
    border: 1px solid #ccc;
    resize: vertical;
    padding: 4px;
    font-size: 13px;
    font-family: inherit;
}


/* ========== spa-images-section.css ========== */

/**
 * Shared layout for inspection image areas (one uploader per step).
 */
.spa-images-section {
  margin-top: 1.5rem;
}

.spa-images-section .spa-report-section-title {
  margin-top: 0;
}

.spa-images-section__hint {
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
  color: #444;
}

.spa-images-warning {
  background: #fff3cd;
  border: 1px solid #ffc107;
  border-radius: 6px;
  padding: 12px 16px;
  margin-top: 16px;
  color: #856404;
  font-size: 14px;
  font-weight: bold;
}

.spa-images-section .spa-preview-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
  align-items: flex-start;
}

/* Empty image grid: show a clear drop target (spa-preview-reorder.js adds .spa-drop-zone-hint) */
.spa-preview-grid.spa-drop-target-empty,
#spa-image-preview-area.spa-drop-target-empty {
  min-height: 112px;
  border: 2px dashed #c5cad1;
  border-radius: 8px;
  background: #f8f9fb;
  box-sizing: border-box;
  align-items: center;
  justify-content: center;
  padding: 14px 16px;
}

.spa-drop-zone-hint {
  pointer-events: none;
  text-align: center;
  max-width: 22rem;
  margin: 0 auto;
}

.spa-drop-zone-hint__title {
  display: block;
  font-weight: 600;
  color: #2c3338;
  font-size: 1rem;
  margin-bottom: 0.4rem;
}

.spa-drop-zone-hint__detail {
  display: block;
  font-size: 0.9rem;
  color: #50575e;
  line-height: 1.45;
}

.spa-images-section .spa-preview-box {
  border: 1px solid #ddd;
  padding: 10px;
  display: inline-block;
  margin: 0;
  position: relative;
  border-radius: 6px;
  background: #fafafa;
  max-width: 180px;
}

.spa-images-section .spa-preview-box img {
  width: 110px;
  height: auto;
  border-radius: 4px;
  display: block;
}

.spa-images-section .spa-delete-existing,
.spa-images-section .spa-delete-image-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 12;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #c0392b;
  color: #fff;
  border: none;
  font-size: 18px;
  font-weight: bold;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.spa-images-section .spa-preview-box textarea {
  width: 100%;
  margin-top: 6px;
  min-height: 60px;
  border: 1px solid #ccc;
  border-radius: 4px;
  box-sizing: border-box;
}

.spa-images-section .spa-btn-light {
  margin-top: 0.75rem;
}

/* Drag-to-reorder grip (spa-preview-reorder.js) */
.spa-preview-box .spa-preview-drag-handle {
  position: absolute;
  left: 4px;
  top: 4px;
  z-index: 6;
  width: 28px;
  height: 28px;
  min-width: 28px;
  min-height: 28px;
  box-sizing: border-box;
  padding: 0;
  margin: 0;
  border-radius: 4px;
  background: rgba(30, 30, 30, 0.55);
  color: #fff;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
}

.spa-preview-box .spa-preview-drag-handle::before {
  content: "⋮";
  display: block;
  font-size: 14px;
  line-height: 28px;
  text-align: center;
  letter-spacing: -2px;
}

.spa-preview-box.spa-preview-is-dragging {
  opacity: 0.85;
  outline: 2px dashed #0073aa;
  outline-offset: 2px;
}

/* Live reorder: dim other tiles; insertion bar is a body-fixed element (spa-preview-reorder.js) */
.spa-preview-reorder-active .spa-preview-box:not(.spa-preview-is-dragging) {
  opacity: 0.7;
  transition: opacity 0.12s ease;
}

.spa-preview-reorder-mark {
  pointer-events: none;
  border-radius: 3px;
  background: #0073aa;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.95),
    0 2px 10px rgba(0, 115, 170, 0.5);
}


/* ========== spa-inspection-stepper.css ========== */

/* Numbered step navigation (inspection flow) */
.spa-inspection-stepper {
  margin: 0 0 1.25rem;
  padding: 0.75rem 0 1rem;
  border-bottom: 1px solid #e0e0e0;
}

/* Duplicate stepper after long forms: mirror top nav, separated above */
.spa-inspection-stepper--bottom {
  margin: 1.75rem 0 0;
  padding: 1rem 0 0.75rem;
  border-bottom: none;
  border-top: 1px solid #e0e0e0;
}

.spa-inspection-stepper__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0;
}

.spa-inspection-stepper__item {
  position: relative;
  display: flex;
  align-items: center;
  margin: 0;
  padding: 0;
}

/* Connector line between circles */
.spa-inspection-stepper__item:not(:last-child)::after {
  content: "";
  display: block;
  width: clamp(12px, 3vw, 28px);
  height: 2px;
  background: #333;
  opacity: 0.35;
  flex-shrink: 0;
  margin: 0 2px;
}

.spa-inspection-stepper__circle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none !important;
  box-sizing: border-box;
  transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease;
  /* Inactive: orange (brand) */
  background: #cc5500;
  color: #fff !important;
  border: 2px solid #a84600;
}

a.spa-inspection-stepper__circle:hover,
a.spa-inspection-stepper__circle:focus {
  background: #e06510;
  color: #fff !important;
  transform: scale(1.06);
  outline: none;
}

/* Active step: navy */
.spa-inspection-stepper__circle.is-active,
span.spa-inspection-stepper__circle.is-active {
  background: #001f5b;
  color: #fff !important;
  border-color: #001040;
  cursor: default;
  transform: none;
}

.spa-inspection-stepper__item.is-active span.spa-inspection-stepper__circle {
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px #cc5500;
}

@media (max-width: 600px) {
  .spa-inspection-stepper__circle {
    width: 2rem;
    height: 2rem;
    font-size: 0.85rem;
  }
  .spa-inspection-stepper__item:not(:last-child)::after {
    width: 8px;
  }
}

/* Deficiencies list fields — shared height on every inspection step that has one */
textarea[name="deficiencyList"],
textarea[name="deficiencyList4"],
textarea[name="deficiencyList7"],
textarea[name="deficiencyList9"],
textarea[name="deficiencyList10"] {
  width: 100%;
  height: 300px;
  min-height: 300px;
  box-sizing: border-box;
  padding: 8px;
  line-height: 1.4;
  resize: vertical;
  overflow-y: auto;
}


/* ========== spa-fixed-save-tab.css ========== */

/* Fixed vertical SAVE tab — inspection steps only (see spa-fixed-save-tab.js) */
.spa-fixed-save-tab {
  position: fixed;
  left: 0;
  top: 50%;
  z-index: 99990;
  transform: translateY(-50%);
  width: 56px;
  height: 400px;
  margin: 0;
  padding: 0;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-left: none;
  border-radius: 0 12px 12px 0;
  background: #e8dcc8;
  color: #111;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1;
  box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.08);
  -webkit-appearance: none;
  appearance: none;
}

.spa-fixed-save-tab:hover {
  background: #ddd0ba;
}

.spa-fixed-save-tab.is-saving {
  opacity: 0.75;
  cursor: progress;
}

.spa-fixed-save-tab.is-saved {
  background: #28a745;
  color: #fff;
}

.spa-fixed-save-tab:focus {
  outline: 2px solid #2c5530;
  outline-offset: 2px;
}

.spa-fixed-save-tab__label {
  display: block;
  writing-mode: vertical-rl;
  text-orientation: upright;
  letter-spacing: 0.12em;
  font-size: 1.625rem;
  font-weight: 900;
}


/* ========== image-library.css ========== */

/* Savvy Property Assessment — floating image library */

.spa-image-library-panel {
    position: fixed;
    z-index: 999999;
    bottom: 16px;
    right: 16px;
    width: min(360px, calc(100vw - 24px));
    max-height: min(70vh, 520px);
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #c5c5c5;
    border-radius: 10px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.18);
    font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
    font-size: 13px;
}

.spa-lib-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: linear-gradient(180deg, #f7f7f7, #ececec);
    border-radius: 10px 10px 0 0;
    cursor: grab;
    user-select: none;
    border-bottom: 1px solid #ddd;
}

.spa-lib-header:active {
    cursor: grabbing;
}

.spa-lib-title {
    font-weight: 700;
    flex: 1;
    min-width: 0;
}

.spa-lib-selection-badge {
    font-size: 11px;
    background: #0073aa;
    color: #fff;
    padding: 2px 8px;
    border-radius: 999px;
}

.spa-lib-clear-selection {
    position: relative;
    z-index: 2;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 4px;
    border: 1px solid #999;
    background: #fff;
    cursor: pointer;
    pointer-events: auto;
}

.spa-lib-collapse {
    position: relative;
    z-index: 2;
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 4px;
    border: 1px solid #999;
    background: #fff;
    cursor: pointer;
    flex-shrink: 0;
}

.spa-lib-collapse:hover {
    border-color: #0073aa;
    color: #0073aa;
}

/* Docked tab — shown when panel is hidden to the side */
.spa-lib-dock-tab {
    position: fixed;
    z-index: 999998;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    margin: 0;
    padding: 14px 8px;
    min-height: 120px;
    width: auto;
    border: 1px solid #c5c5c5;
    border-right: none;
    border-radius: 10px 0 0 10px;
    background: #fff;
    box-shadow: -4px 4px 16px rgba(0, 0, 0, 0.12);
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    color: #1d2327;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    letter-spacing: 0.06em;
}

.spa-lib-dock-tab:hover {
    background: #f0f6fc;
    border-color: #0073aa;
    color: #0073aa;
}

.spa-lib-dock-tab-label {
    display: block;
}

.spa-lib-drop-area {
    padding: 10px 12px;
    border-bottom: 1px solid #eee;
    text-align: center;
    transition: background 0.15s ease, border-color 0.15s ease;
    border: 2px dashed transparent;
    margin: 8px;
    border-radius: 8px;
}

.spa-lib-drop-area.spa-drop-active {
    background: #e8f4fc;
    border-color: #0073aa;
}

.spa-lib-file-input {
    position: absolute;
    width: 0;
    height: 0;
    opacity: 0;
    pointer-events: none;
}

.spa-lib-drop-label {
    color: #444;
    line-height: 1.4;
}

.spa-lib-choose-btn {
    background: none;
    border: none;
    color: #0073aa;
    text-decoration: underline;
    cursor: pointer;
    font: inherit;
    padding: 0;
}

.spa-lib-upload-progress {
    margin-top: 8px;
    padding: 0;
}

.spa-lib-upload-progress-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.spa-lib-upload-progress-text {
    font-size: 12px;
    color: #2c3338;
    font-weight: 600;
    margin: 0;
    line-height: 1.2;
    flex: 1;
    min-width: 0;
}

.spa-lib-upload-cancel {
    flex-shrink: 0;
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 4px;
    border: 1px solid #b32d2e;
    background: #fff;
    color: #b32d2e;
    cursor: pointer;
    font-weight: 600;
}

.spa-lib-upload-cancel:hover {
    background: #fcf0f1;
}

.spa-lib-upload-progress-bar-track {
    height: 6px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
}

.spa-lib-upload-progress-bar {
    height: 100%;
    width: 0%;
    background: #0073aa;
    transition: width 0.12s linear;
}

.spa-image-library-grid {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-content: flex-start;
    min-height: 80px;
}

.spa-lib-thumb-wrap {
    position: relative;
    width: 72px;
    height: 72px;
    border-radius: 6px;
    overflow: hidden;
    border: 2px solid transparent;
    cursor: pointer;
    flex-shrink: 0;
}

.spa-lib-thumb-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    pointer-events: none;
}

.spa-lib-thumb-wrap.spa-lib-selected {
    border-color: #0073aa;
    box-shadow: 0 0 0 1px #0073aa;
}

.spa-lib-thumb-wrap.spa-lib-dragging {
    opacity: 0.55;
}

/* Drop targets on step forms */
.spa-preview-grid,
#spa-image-preview-area {
    position: relative;
}

.spa-preview-grid.spa-lib-drop-ready::after,
#spa-image-preview-area.spa-lib-drop-ready::after {
    content: "";
    position: absolute;
    inset: 0;
    border: 2px dashed #0073aa;
    border-radius: 8px;
    pointer-events: none;
    background: rgba(0, 115, 170, 0.04);
    z-index: 1;
}

.spa-preview-grid.spa-lib-drag-over::after,
#spa-image-preview-area.spa-lib-drag-over::after {
    background: rgba(0, 115, 170, 0.12);
}

.spa-preview-grid.spa-lib-drag-over::before,
#spa-image-preview-area.spa-lib-drag-over::before {
    content: "Drop photo here";
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
    font-weight: 600;
    color: #0073aa;
    pointer-events: none;
    font-size: 14px;
    text-shadow: 0 0 6px #fff, 0 0 6px #fff;
}

/* OS folder drop → processing (see spaBeginOsDropLoading in image-library.js) */
.spa-os-drop-loading {
    position: fixed;
    inset: 0;
    z-index: 999997;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(2px);
    pointer-events: none;
}

.spa-os-drop-loading__inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: 22px 28px;
    background: #fff;
    border: 1px solid #c5c5c5;
    border-radius: 10px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.14);
    pointer-events: none;
}

.spa-os-drop-loading__text {
    font: 600 15px system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
    color: #1d2327;
}

.spa-os-drop-loading__spinner {
    width: 36px;
    height: 36px;
    border: 3px solid #e0e0e0;
    border-top-color: #0073aa;
    border-radius: 50%;
    animation: spa-os-drop-spin 0.75s linear infinite;
}

@keyframes spa-os-drop-spin {
    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 600px) {
    .spa-image-library-panel {
        width: calc(100vw - 16px);
        right: 8px;
        bottom: 8px;
    }
}


/* ========== step1-style.css ========== */

/* === Step 1 Base Styling (unchanged) === */
.spa-form-wrap {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    padding: 25px 30px;
    font-family: "Segoe UI", Arial, sans-serif;
    color: #222;
}

.spa-form-wrap label {
    font-weight: 600;
    display: block;
    margin-top: 10px;
}

.spa-form-wrap input,
.spa-form-wrap select,
.spa-form-wrap textarea {
    width: 100%;
    padding: 8px;
    margin-top: 5px;
    border-radius: 5px;
    border: 1px solid #ccc;
}

/* Required asterisk */
.spa-required {
    color: red;
}

/* =====================
   Buttons
===================== */
.spa-btn,
.spa-btn-light {
    background: #CC5500 !important;
    color: #fff !important;
    border: none !important;
    border-radius: 4px !important;
    padding: 10px 25px !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    margin-top: 15px !important;
    cursor: pointer !important;
    transition: background 0.3s ease !important;
}

.spa-btn:hover,
.spa-btn-light:hover {
    background: #AE0000 !important;
}

/* ===============================================
   STEP 2 PROGRESS OVERLAY (Cloned 100% for Step 1)
=============================================== */
#spa-upload-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.55);
    z-index: 999999;
    display: none;
    backdrop-filter: blur(3px);
}

#spa-upload-overlay-box {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #ffffff;
    padding: 30px 35px;
    border-radius: 10px;
    text-align: center;
    width: 420px;
    max-width: 95%;
    box-shadow: 0px 10px 30px rgba(0,0,0,0.25);
}

#spa-upload-overlay-text {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 18px;
    color: #00338d;
}

#spa-upload-overlay-bar {
    width: 0%;
    height: 14px;
    background: #1976d2;
    border-radius: 8px;
    transition: width 0.35s ease;
}

/* ============================================================
   STEP 1 — Position Save & Next button to the right & lower
============================================================ */
#spa-step1 form {
    display: block;
    width: 100%;
}

#spa-step1 .spa-btn {
    display: inline-block;
    float: right;
    margin-top: 55px !important;
    margin-bottom: 22px !important;
}

/* =====================
   Titles & Headers
===================== */
.spa-report-title {
    text-align: center;
    font-size: 22px;
    margin: 0 0 15px 0;
    font-weight: bold;
}

.spa-report-section-title {
    background: #001f5b;
    border-left: 4px solid #CC5500;
    padding: 8px 12px;
    margin: 30px 0 12px;
    font-size: 16px;
    font-weight: 600;            /* FIXED (was invalid) */
    color: #ffffff;
    border-radius: 6px;

    /* CRITICAL: prevent blocking dropdowns */
    position: relative;
    z-index: 1;
}

.spa-assessment-id {
    text-align: center;
    margin-bottom: 20px;
    font-weight: 600;
    color: #444;
}

/* ============================================================
   CRITICAL FIX — Ensure form controls stay above section bars
============================================================ */
#spa-step1 input,
#spa-step1 select,
#spa-step1 textarea {
    position: relative;
    z-index: 5;
}

/* Image tile captions: keep below delete (×) and drag grip — avoids overlap after drag-drop */
#spa-step1 .spa-preview-box textarea {
    z-index: 1;
}

/* ======================================================
   GLOBAL – MOBILE FLATTEN spa-form-wrap
   No padding / no shadow
   ====================================================== */
@media (max-width: 767px) {
    body .spa-form-wrap {
        padding: 0 !important;
        margin: 0 !important;
        box-shadow: none !important;
        border-radius: 0 !important;
        background: transparent !important;
    }
}

/* ========== step2-style.css ========== */

/* ============================================================
   STEP 2 – BASE CONTAINER & GLOBAL ELEMENTS
============================================================ */
.spa-form-wrap {
  margin: 30px auto;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
  padding: 25px 30px;
  font-family: "Segoe UI", Arial, sans-serif;
  color: #222;
}

h2.spa-title {
  text-align: center;
  font-weight: 700;
  margin: 0 0 4px;
  color: #111;
}

h3.spa-step-title {
  text-align: center;
  margin: 0 0 18px;
  color: #002b6f;
  font-weight: 600;
  font-size: 22px;
}

.spa-assessment-id {
  text-align: center;
  margin-bottom: 20px;
  font-weight: 600;
  color: #444;
}


/* ============================================================
   CARDS & BOXES
============================================================ */
.spa-card {
  background: #fdfdfd;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 20px 25px;
  margin-bottom: 25px;
}

/* --- Yellow Instruction Box --- */
.spa-instructions-card {
  background: #fff8e1;
  border-left: 6px solid #CC5500;
}

.spa-instructions-card h3 {
  font-weight: 700;
  font-size: 16px;
  margin-top: 0;
  color: #111;
}

.spa-instructions-card strong {
  color: #000;
}

/* --- Blue Section Header --- */
.spa-section-head {
  border-left: 5px solid #1976d2;
  background: #f5f9ff;
  padding: 12px 15px;
  margin-bottom: 20px;
  border-radius: 4px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.spa-section-head img {
  width: 48px;
  height: auto;
}

.spa-section-title {
  margin: 0;
  font-weight: 700;
  color: #0b245b;
}

.spa-section-desc {
  font-size: 14px;
  color: #333;
  margin-top: 6px;
}


/* ============================================================
   EXAMPLE IMAGES
============================================================ */
.spa-example-images {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 10px 0 15px;
}

.spa-example-images img {
  width: 250px;
  height: auto;
  border-radius: 6px;
  border: 1px solid #ccc;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}


/* ============================================================
   FORM FIELDS & LABELS
============================================================ */
.spa-field-block {
  margin-top: 15px;
}

.spa-label {
  font-weight: 700;
  color: #111;
  display: block;
  margin-bottom: 4px;
}

.spa-label-hint {
  font-weight: normal;
  color: #777;
  font-size: 12px;
  display: block;
  margin-top: 2px;
}

.spa-hidden-file-input {
  display: none;
}

.spa-textarea {
  width: 100%;
  border-radius: 5px;
  border: 1px solid #ccc;
  padding: 8px;
  resize: vertical;
  font-family: inherit;
}


/* =====================
   Buttons
===================== */
.spa-btn,
.spa-btn-light {
    background: #CC5500 !important;
    color: #fff !important;
    border: none !important;
    border-radius: 4px !important;
    padding: 10px 25px !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    margin-top: 15px !important;
    cursor: pointer !important;
    transition: background 0.3s ease !important;
}

.spa-btn:hover,
.spa-btn-light:hover {
    background: #AE0000 !important;
}

.spa-step-buttons {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 25px;
}

.spa-response-msg {
  margin-top: 15px;
  font-size: 14px;
  font-weight: 600;
  color: #333;
}


/* ============================================================
   LEGENDS
============================================================ */
.spa-legend {
  background: #e8f1ff;
  border-left: 4px solid #1976d2;
  border-radius: 4px;
  padding: 12px 16px;
  margin: 20px 0;
}

.spa-legend ul {
  margin: 8px 0 0;
  padding-left: 18px;
}

.legend {
  background-color: #eef6ff;
  border-left: 4px solid #007bff;
  padding: 1rem;
  margin-bottom: 1rem;
  font-size: 0.95rem;
  margin-top: 1rem;
}


/* ============================================================
   TABLE STYLES
============================================================ */
.spa-table-wrap {
  /* Step tables should fit within the report container (no left-right slider). */
  overflow-x: hidden;
}

/* On mobile, allow horizontal scroll if the table doesn't fit. */
@media (max-width: 767px) {
  .spa-table-wrap {
    overflow-x: auto;
  }
}

.spa-check-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.spa-check-table th,
.spa-check-table td {
  border: 1px solid #ccc;
  text-align: center;
  padding: 8px;
  background-color: #001f5b;
}

.entry-content thead th,
.entry-content tr th {
  color: #fff;
  font-weight: 700;
  padding: 9px 24px;
}

.spa-check-table tbody th {
  background: #CC5500;
  color: #fff;
  text-align: left;
}

.spa-check-table tbody td {
  background: #fff;
}

table.spa-check-table input[type="radio"] {
  transform: scale(1.8) !important;
}


/* ============================================================
   SECTION TITLES
============================================================ */
.spa-report-section-title {
  background: #001f5b;
  border-left: 4px solid #CC5500;
  padding: 8px 12px;
  margin: 30px 0 12px;
  font-size: 18px;
  font-weight: !important;
  color: #fff !important;
  border-radius: 6px;
}

/* ======================================================
   GLOBAL – MOBILE FLATTEN spa-form-wrap
   No padding / no shadow
   ====================================================== */
@media (max-width: 767px) {
    body .spa-form-wrap {
        padding: 0 !important;
        margin: 0 !important;
        box-shadow: none !important;
        border-radius: 0 !important;
        background: transparent !important;
    }
}

/* ========== step3-style.css ========== */

/* ============================================================
   STEP 2 – BASE WRAPPER & HEADINGS
============================================================ */
.spa-form-wrap {
  margin: 30px auto;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
  padding: 25px 30px;
  font-family: "Segoe UI", Arial, sans-serif;
  color: #222;
}

h2.spa-title {
  text-align: center;
  font-weight: 700;
  margin: 0 0 4px;
  color: #111;
}

h3.spa-step-title {
  text-align: center;
  margin: 0 0 18px;
  color: #002b6f;
  font-weight: 600;
}

.spa-assessment-id {
  text-align: center;
  margin-bottom: 20px;
  font-weight: 600;
  color: #444;
}


/* ============================================================
   GENERAL CARD STYLES
============================================================ */
.spa-card {
  background: #fdfdfd;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 20px 25px;
  margin-bottom: 25px;
}


/* ============================================================
   YELLOW INSTRUCTION BOX
============================================================ */
.spa-instructions-card {
  background: #fff8e1;
  border-left: 6px solid #CC5500;
}

.spa-instructions-card h3 {
  font-weight: 700;
  font-size: 16px;
  margin-top: 0;
  color: #111;
}

.spa-instructions-card strong {
  color: #000;
}


/* ============================================================
   EXAMPLE IMAGES
============================================================ */
.spa-example-images {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 10px 0 15px;
}

.spa-example-images img {
  width: 250px;
  height: auto;
  border-radius: 6px;
  border: 1px solid #ccc;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}


/* ============================================================
   BLUE SECTION HEADER BLOCK
============================================================ */
.spa-section-head {
  border-left: 5px solid #1976d2;
  background: #f5f9ff;
  padding: 12px 15px;
  margin-bottom: 20px;
  border-radius: 4px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.spa-section-head img {
  width: 48px;
  height: auto;
}

.spa-section-title {
  margin: 0;
  font-weight: 700;
  color: #0b245b;
}

.spa-section-desc {
  font-size: 14px;
  color: #333;
  margin-top: 6px;
}


/* ============================================================
   FORM FIELDS & LABELS
============================================================ */
.spa-field-block {
  margin-top: 15px;
}

.spa-label {
  font-weight: 700;
  color: #111;
  display: block;
  margin-bottom: 4px;
}

.spa-label-hint {
  font-weight: normal;
  color: #777;
  font-size: 12px;
  display: block;
  margin-top: 2px;
}

.spa-hidden-file-input {
  display: none;
}

.spa-textarea {
  width: 100%;
  border-radius: 5px;
  border: 1px solid #ccc;
  padding: 8px;
  resize: vertical;
  font-family: inherit;
}

/* System Details — roof detail row (textareas, equal height) */
textarea.spa-step3-envelope-detail-textarea {
  height: 120px;
  min-height: 120px;
  box-sizing: border-box;
  resize: none;
}


/* =====================
   Buttons
===================== */
.spa-btn,
.spa-btn-light {
    background: #CC5500 !important;
    color: #fff !important;
    border: none !important;
    border-radius: 4px !important;
    padding: 10px 25px !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    margin-top: 15px !important;
    cursor: pointer !important;
    transition: background 0.3s ease !important;
}

.spa-btn:hover,
.spa-btn-light:hover {
    background: #AE0000 !important;
}

.spa-btn:hover {
  background: #0045b5;
}

.spa-step-buttons {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 25px;
}

.spa-response-msg {
  margin-top: 15px;
  font-size: 14px;
  font-weight: 600;
  color: #333;
}

/* Step-2 style primary add button */
.spa-add-images-btn {
    background: #ffffff;
    border: 1px solid #ccc;
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    margin-bottom: 10px;
    display: inline-block;
}

.spa-add-images-btn:hover {
    background: #f2f2f2;
}

/* FIX APPLIED — REMOVED rule that hides the top uploader */
/* #addMoreImagesBtn3 { display:none !important; } */


/* ============================================================
   CUSTOM LEGEND BLOCKS
============================================================ */
.spa-legend {
  background: #e8f1ff;
  border-left: 4px solid #1976d2;
  border-radius: 4px;
  padding: 12px 16px;
  margin: 20px 0;
}

.spa-legend ul {
  margin: 8px 0 0;
  padding-left: 18px;
}

.legend {
  background: #eef6ff !important;
  border-left: 5px solid #007bff !important;
  border-radius: 6px !important;
  padding: 10px 15px !important;
  margin-bottom: 25px !important;
  font-size: 14px !important;
}


/* ============================================================
   TABLE STYLES
============================================================ */
.spa-table-wrap {
  overflow-x: auto;
}

.spa-check-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.spa-check-table th,
.spa-check-table td {
  border: 1px solid #ccc;
  text-align: center;
  padding: 8px;
  background-color: #001f5b;
}

.entry-content thead th,
.entry-content tr th {
  color: #fff;
  font-weight: 700;
  padding: 9px 24px;
}

.spa-check-table tbody th {
  background: #CC5500;
  color: #fff;
  text-align: left;
}

.spa-check-table tbody td {
  background: #fff;
}

table.spa-check-table input[type="radio"] {
  transform: scale(1.8) !important;
}


/* ============================================================
   SECTION TITLE BAR
============================================================ */
.spa-report-section-title {
  background: #001f5b;
  border-left: 4px solid #CC5500;
  padding: 8px 12px;
  margin: 30px 0 12px;
  font-size: 18px;
  font-weight: !important;
  color: #fff !important;
  border-radius: 6px;
}

/* ======================================================
   GLOBAL – MOBILE FLATTEN spa-form-wrap
   No padding / no shadow
   ====================================================== */
@media (max-width: 767px) {
    body .spa-form-wrap {
        padding: 0 !important;
        margin: 0 !important;
        box-shadow: none !important;
        border-radius: 0 !important;
        background: transparent !important;
    }
}

/* ========== step4-style.css ========== */

/* ============================================================
   STEP 4 – BASE CONTAINER & GLOBAL ELEMENTS
============================================================ */
.spa-form-wrap {
  margin: 30px auto;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
  padding: 25px 30px;
  font-family: "Segoe UI", Arial, sans-serif;
  color: #222;
}

h2.spa-title {
  text-align: center;
  font-weight: 700;
  margin: 0 0 4px;
  color: #111;
}

h3.spa-step-title {
  text-align: center;
  margin: 0 0 18px;
  color: #002b6f;
  font-weight: 600;
}

.spa-assessment-id {
  text-align: center;
  margin-bottom: 20px;
  font-weight: 600;
  color: #444;
}


/* ============================================================
   CARDS & BOXES
============================================================ */
.spa-card {
  background: #fdfdfd;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 20px 25px;
  margin-bottom: 25px;
}

/* Yellow Instruction Box */
.spa-instructions-card {
  background: #fff8e1;
  border-left: 6px solid #CC5500;
}

.spa-instructions-card h3 {
  font-weight: 700;
  font-size: 16px;
  margin-top: 0;
  color: #111;
}

.spa-instructions-card strong {
  color: #000;
}

/* Blue Section Header */
.spa-section-head {
  border-left: 5px solid #1976d2;
  background: #f5f9ff;
  padding: 12px 15px;
  margin-bottom: 20px;
  border-radius: 4px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.spa-section-head img {
  width: 48px;
}

.spa-section-title {
  margin: 0;
  font-weight: 700;
  color: #0b245b;
}

.spa-section-desc {
  font-size: 14px;
  color: #333;
  margin-top: 6px;
}


/* ============================================================
   EXAMPLE IMAGES
============================================================ */
.spa-example-images {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 10px 0 15px;
}

.spa-example-images img {
  width: 250px;
  border-radius: 6px;
  border: 1px solid #ccc;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}


/* ============================================================
   FORM FIELDS & LABELS
============================================================ */
.spa-field-block {
  margin-top: 15px;
}

.spa-label {
  font-weight: 700;
  color: #111;
  display: block;
  margin-bottom: 4px;
}

.spa-label-hint {
  color: #777;
  font-size: 12px;
}

.spa-hidden-file-input {
  display: none !important;
}


/* =====================
   Buttons
===================== */
.spa-btn,
.spa-btn-light {
    background: #CC5500 !important;
    color: #fff !important;
    border: none !important;
    border-radius: 4px !important;
    padding: 10px 25px !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    margin-top: 15px !important;
    cursor: pointer !important;
    transition: background 0.3s ease !important;
}

.spa-btn:hover,
.spa-btn-light:hover {
    background: #AE0000 !important;
}

.spa-step-buttons {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.spa-response-msg {
  margin-top: 15px;
  font-weight: 600;
}


/* ============================================================
   LEGEND BLOCK
============================================================ */
.spa-legend {
  background: #e8f1ff;
  border-left: 4px solid #1976d2;
  border-radius: 4px;
  padding: 12px 16px;
  margin: 20px 0;
}

.spa-legend ul {
  margin: 8px 0 0;
  padding-left: 18px;
}


/* ============================================================
   TABLE STYLES
============================================================ */
.spa-table-wrap {
  overflow-x: auto;
}

.spa-check-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.spa-check-table th,
.spa-check-table td {
  border: 1px solid #ccc;
  text-align: center;
  padding: 8px;
}

.entry-content thead th,
.entry-content tr th {
  background-color: #001f5b !important;
  color: #fff !important;
}

.spa-check-table tbody th {
  background: #CC5500 !important;
  color: #fff !important;
  text-align: left !important;
}

.spa-check-table tbody td {
  background: #fff;
}

table.spa-check-table input[type="radio"] {
  transform: scale(1.8) !important;
}


/* ============================================================
   TEXTAREAS & INPUTS
============================================================ */
.spa-textarea {
  width: 100%;
  border-radius: 6px;
  border: 1px solid #ccc;
  padding: 10px;
  resize: vertical;
  font-family: inherit;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 14px;
}

.form-group select[multiple] {
  min-height: 160px;
}


/* ============================================================
   FORM GRID
============================================================ */
.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

@media (min-width: 768px) {
  .form-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.form-row {
  display: flex;
  flex-direction: row;
  gap: 20px;
}

.form-group {
  flex: 1;
}


/* ============================================================
   TITLE HEADERS
============================================================ */
.spa-report-section-title {
  background: #001f5b;
  border-left: 4px solid #CC5500;
  padding: 8px 12px;
  margin: 30px 0 12px;
  font-size: 18px;
  font-weight: bold !important;
  color: #fff !important;
  border-radius: 6px;
}

/* System Details grid — uniform control heights */
#spa-step4 .spa-step4-system-details-title.spa-report-section-title {
  margin-top: 1.25rem;
  margin-bottom: 1rem;
}

#spa-step4 .spa-step4-system-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  align-items: stretch;
}

#spa-step4 .spa-step4-system-grid .form-group {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

#spa-step4 .spa-step4-system-grid .form-group .spa-label {
  flex-shrink: 0;
  margin-bottom: 6px;
}

#spa-step4 .spa-step4-system-grid .form-group select[multiple],
#spa-step4 .spa-step4-system-grid .form-group textarea,
#spa-step4 .spa-step4-system-grid .form-group input[type="number"] {
  flex: 1 1 auto;
  min-height: 160px;
  width: 100%;
  box-sizing: border-box;
}


/* ============================================================
   STEP 2 STYLE IMAGE UPLOADER (USED BY STEP 4)
============================================================ */

/* PREVIEW BOX — FIXED TO MATCH STEP 2 EXACTLY */
#spa-step4 .spa-preview-box {
    border: 1px solid #ddd !important;
    padding: 10px !important;
    border-radius: 8px !important;
    margin-bottom: 10px !important;
    background: #fafafa !important;
    display: inline-block !important;
    position: relative !important;
    margin-right: 10px !important;
    width: auto !important;
    height: auto !important;
    overflow: visible !important;
}

#spa-step4 .spa-preview-box img {
    width: 110px !important;
    height: auto !important;
    display: block !important;
    border-radius: 5px !important;
}

#spa-step4 .spa-preview-box textarea {
    width: 100% !important;
    height: 60px !important;
    border-radius: 5px !important;
    border: 1px solid #ccc !important;
    padding: 5px !important;
    margin-top: 8px !important;
    display: block !important;
}

#spa-step4 .spa-delete-existing,
#spa-step4 .spa-delete-img {
    position: absolute !important;
    top: 5px !important;
    right: 5px !important;
    width: 26px !important;
    height: 26px !important;
    background: #c0392b !important;
    color: #fff !important;
    border-radius: 50% !important;
    border: none !important;
    font-size: 18px !important;
    font-weight: bold !important;
    cursor: pointer !important;
}


/* Annotate button if used */
.spa-annotate-btn {
    position: absolute;
    bottom: 6px;
    left: 6px;
    background: #001f5b;
    color: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
}

/* ======================================================
   GLOBAL – MOBILE FLATTEN spa-form-wrap
   No padding / no shadow
   ====================================================== */
@media (max-width: 767px) {
    body .spa-form-wrap {
        padding: 0 !important;
        margin: 0 !important;
        box-shadow: none !important;
        border-radius: 0 !important;
        background: transparent !important;
    }
}

/* ========== step5-style.css ========== */

/* ============================================================
   STEP 5 – BASE WRAPPER & HEADINGS
============================================================ */
.spa-form-wrap {
  margin: 30px auto;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
  padding: 25px 30px;
  font-family: "Segoe UI", Arial, sans-serif;
  color: #222;
}

h2.spa-title {
  text-align: center;
  font-weight: 700;
  margin: 0 0 4px;
  color: #111;
}

h3.spa-step-title {
  text-align: center;
  margin: 0 0 18px;
  color: #002b6f;
  font-weight: 600;
  font-size: 22px;
}

.spa-assessment-id {
  text-align: center;
  margin-bottom: 20px;
  font-weight: 600;
  color: #444;
}


/* ============================================================
   GENERAL CARDS & CONTENT WRAPPERS
============================================================ */
.spa-card {
  background: #fdfdfd;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 20px 25px;
  margin-bottom: 25px;
}


/* ============================================================
   YELLOW INSTRUCTION BOX
============================================================ */
.spa-instructions-card {
  background: #fff8e1;
  border-left: 6px solid #CC5500;
}

.spa-instructions-card h3 {
  font-weight: 700;
  font-size: 16px;
  margin-top: 0;
  color: #111;
}

.spa-instructions-card strong {
  color: #000;
}


/* ============================================================
   EXAMPLE IMAGES
============================================================ */
.spa-example-images {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 10px 0 15px;
}

.spa-example-images img {
  width: 250px;
  height: auto;
  border-radius: 6px;
  border: 1px solid #ccc;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}


/* ============================================================
   BLUE SECTION HEADER
============================================================ */
.spa-section-head {
  border-left: 5px solid #1976d2;
  background: #f5f9ff;
  padding: 12px 15px;
  margin-bottom: 20px;
  border-radius: 4px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.spa-section-head img {
  width: 48px;
  height: auto;
}

.spa-section-title {
  margin: 0;
  font-weight: 700;
  color: #0b245b;
}

.spa-section-desc {
  font-size: 14px;
  color: #333;
  margin-top: 6px;
}


/* ============================================================
   FORM FIELDS & LABELS
============================================================ */
.spa-field-block {
  margin-top: 15px;
}

.spa-label {
  font-weight: 700;
  color: #111;
  display: block;
  margin-bottom: 4px;
}

.spa-label-hint {
  font-weight: normal;
  color: #777;
  font-size: 12px;
  display: block;
  margin-top: 2px;
}

.spa-hidden-file-input {
  display: none;
}

.spa-textarea {
  width: 100%;
  border-radius: 5px;
  border: 1px solid #ccc;
  padding: 8px;
  resize: vertical;
  font-family: inherit;
}


/* =====================
   Buttons
===================== */
.spa-btn,
.spa-btn-light {
    background: #CC5500 !important;
    color: #fff !important;
    border: none !important;
    border-radius: 4px !important;
    padding: 10px 25px !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    margin-top: 15px !important;
    cursor: pointer !important;
    transition: background 0.3s ease !important;
}

.spa-btn:hover,
.spa-btn-light:hover {
    background: #AE0000 !important;
}

.spa-btn-light:hover {
  background: #ddd;
}

.spa-step-buttons {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 25px;
}

.spa-response-msg {
  margin-top: 15px;
  font-size: 14px;
  font-weight: 600;
  color: #333;
}


/* ============================================================
   LEGENDS & INFO BOXES
============================================================ */
.legend,
#spa-step6-wrapper .legend {
  background: #eef6ff !important;
  border-left: 5px solid #007bff !important;
  border-radius: 6px !important;
  padding: 10px 15px !important;
  margin-bottom: 25px !important;
  font-size: 14px !important;
}

.spa-legend ul {
  margin: 8px 0 0;
  padding-left: 18px;
}


/* ============================================================
   TABLE STYLES
============================================================ */
.spa-table-wrap {
  overflow-x: auto;
}

.spa-check-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.spa-check-table th,
.spa-check-table td {
  border: 1px solid #ccc;
  text-align: center;
  padding: 8px;
  background-color: #001f5b;
}

.entry-content thead th,
.entry-content tr th {
  color: #fff;
  font-weight: 700;
  padding: 9px 24px;
}

.spa-check-table tbody th {
  background: #CC5500;
  color: #fff;
  text-align: left;
}

.spa-check-table tbody td {
  background: #fff;
}

table.spa-check-table input[type="radio"] {
  transform: scale(1.8) !important;
}


/* ============================================================
   SECTION TITLE BAR
============================================================ */
.spa-report-section-title {
  background: #001f5b;
  border-left: 4px solid #CC5500;
  padding: 8px 12px;
  margin: 30px 0 12px;
  font-size: 18px;
  font-weight: !important;
  color: #fff !important;
  border-radius: 6px;
}

/* ======================================================
   GLOBAL – MOBILE FLATTEN spa-form-wrap
   No padding / no shadow
   ====================================================== */
@media (max-width: 767px) {
    body .spa-form-wrap {
        padding: 0 !important;
        margin: 0 !important;
        box-shadow: none !important;
        border-radius: 0 !important;
        background: transparent !important;
    }
}

/* ========== step6-style.css ========== */

/* =====================================================
   MOBILE FIX — REMOVE CARD WRAP ON SMALL SCREENS
   ===================================================== */
@media (max-width: 768px) {

    /* Outer preview container */
    #spa-step8-preview,
    .spa-form-wrap,
    .spa-report-wrapper {
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        box-shadow: none !important;
        border-radius: 0 !important;
        background: transparent !important;
    }

    /* Inner sections still get breathing room */
    .spa-report-section-title,
    .spa-table-wrap,
    .spa-mep-card,
    .spa-report-notes,
    .legend,
    section {
        margin-left: 10px;
        margin-right: 10px;
    }

}

/* ============================================================
   STEP 6 – MAIN WRAPPER & BASE LAYOUT
============================================================ */
#spa-step6-wrapper {
  margin: 30px auto !important;
  background: #fff !important;
  border-radius: 8px !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
  padding: 30px 40px !important;
  font-family: "Open Sans", Arial, sans-serif !important;
  color: #222 !important;
  line-height: 1.5 !important;
}

.spa-assessment-id {
  text-align: center;
  margin-bottom: 20px;
  font-weight: 600;
  color: #444;
}




@media (max-width: 768px) {
    #spa-step6-wrapper {
        margin: 0 !important;
        background: transparent !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        padding: 15px !important;
    }
}


/* ============================================================
   SECTION HEADINGS
============================================================ */
h2.spa-title {
  text-align: center;
  font-weight: 700;
  margin: 0 0 4px;
  color: #111;
}

h3.spa-step-title {
  text-align: center;
  margin: 0 0 18px;
  color: #002b6f;
  font-weight: 600;
}

#spa-step6-wrapper h3,
#spa-step6-wrapper h4 {
  text-align: center !important;
  margin-bottom: 10px !important;
  color: #003366 !important;
}

h5.sub-title6 {
  color: #333 !important;
  padding-bottom: 10px;
  line-height: 1em;
  font-weight: 700;
  text-align: left !important;
}


/* ============================================================
   INTRO BOX / FIRST SECTION PANEL
============================================================ */
#spa-step6-wrapper section:first-of-type {
  background: #f9f9ff !important;
  border-left: 5px solid #007bff !important;
  border-radius: 8px !important;
  padding: 20px !important;
  margin-bottom: 20px !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05) !important;
}


/* ============================================================
   LEGENDS / INFO BOXES
============================================================ */
#spa-step6-wrapper .legend {
  background: #eef6ff !important;
  border-left: 5px solid #007bff !important;
  border-radius: 6px !important;
  padding: 10px 15px !important;
  margin-bottom: 25px !important;
  font-size: 14px !important;
}


/* ============================================================
   TABLE STYLES
============================================================ */
.spa-table-wrap {
  overflow-x: auto;
}

.spa-check-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.spa-check-table th,
.spa-check-table td {
  border: 1px solid #ccc;
  text-align: center;
  padding: 8px;
  background-color: #001f5b;
}

.entry-content thead th,
.entry-content tr th {
  color: #fff;
  font-weight: 700;
  padding: 9px 24px;
}

.spa-check-table tbody th {
  background: #CC5500;
  color: #fff;
  text-align: left;
}

.spa-check-table tbody td {
  background: #fff;
}

table.spa-check-table input[type="radio"] {
  transform: scale(1.8) !important;
}


/* =====================
   Buttons
===================== */
.spa-btn,
.spa-btn-light {
    background: #CC5500 !important;
    color: #fff !important;
    border: none !important;
    border-radius: 4px !important;
    padding: 10px 25px !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    margin-top: 15px !important;
    cursor: pointer !important;
    transition: background 0.3s ease !important;
}

.spa-btn:hover,
.spa-btn-light:hover {
    background: #AE0000 !important;
}

#spa-step6-wrapper button:hover {
  background: #0036a0 !important;
}

.spa-step-buttons {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  width: 100% !important;
}

.spa-delete-existing button {
position: absolute !important;
top: 5px !important;
right: 5px !important;
width: 26px !important;
height: 26px !important;
border-radius: 50% !important;
background: #c0392b !important;
color: #fff !important;
border: none !important;
font-size: 18px !important;
font-weight: bold !important;
cursor: pointer !important;
}

/* ============================================================
   DELETE BUTTONS (Floating Red Round X)
============================================================ */
#spa-step6-wrapper .remove-btn {
  position: absolute !important;
  top: 2px !important;
  right: 2px !important;
  background: #d9534f !important;
  color: #fff !important;
  border: none !important;
  border-radius: 50% !important;
  width: 20px !important;
  height: 20px !important;
  font-size: 13px !important;
  cursor: pointer !important;
}

/* Final override for proper red circular delete button */
#spa-step6-wrapper .spa-remove-existing.remove-btn {
  background: #d9534f !important;
  color: #fff !important;
  border-radius: 50% !important;
  width: 20px !important;
  height: 20px !important;
  padding: 0 !important;
  line-height: 20px !important;
  border: none !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-shadow: 0 1px 3px rgba(0,0,0,0.25) !important;
}


/* ============================================================
   FILE INPUTS & TEXTAREAS
============================================================ */
input[type="file"] {
  display: none !important;
}

#spa-step6-wrapper .spa-textarea {
  width: 100% !important;
  min-height: 130px !important;
  padding: 10px 12px !important;
  border: 1px solid #ccc !important;
  border-radius: 4px !important;
  font-size: 14px !important;
  font-family: "Open Sans", Arial, sans-serif !important;
  box-sizing: border-box !important;
  resize: vertical !important;
  background: #fafafa !important;
}


/* ============================================================
   IMAGE PREVIEW GRID
============================================================ */
#spa-step6-wrapper .preview-item {
  display: inline-block !important;
  position: relative !important;
  margin: 6px !important;
  border: 1px solid #ccc !important;
  border-radius: 6px !important;
  padding: 5px !important;
  background: #fafafa !important;
}

#spa-step6-wrapper .preview-item img {
  max-width: 140px !important;
  max-height: 100px !important;
  border-radius: 4px !important;
}



/* ============================================================
   ERROR TEXT
============================================================ */
#spa-step6-wrapper .error {
  color: #c00 !important;
  font-weight: bold !important;
  font-size: 12px !important;
}


/* ============================================================
   RESPONSIVE FIXES
============================================================ */
@media (max-width: 768px) {
  #spa-step6-wrapper table th,
  #spa-step6-wrapper table td {
    font-size: 13px !important;
  }
}


/* ============================================================
   SECTION TITLE BAR
============================================================ */
.spa-report-section-title {
  background: #001f5b;
  border-left: 4px solid #CC5500;
  padding: 8px 12px;
  margin: 30px 0 12px;
  font-size: 18px;
  font-weight: !important;
  color: #fff !important;
  border-radius: 6px;
}

.spa-label {
  font-weight: 700;
  color: #111;
  display: block;
  margin-bottom: 4px;
}

/* ======================================================
   GLOBAL – MOBILE FLATTEN spa-form-wrap
   No padding / no shadow
   ====================================================== */
@media (max-width: 767px) {
    body .spa-form-wrap {
        padding: 0 !important;
        margin: 0 !important;
        box-shadow: none !important;
        border-radius: 0 !important;
        background: transparent !important;
    }
}

/* ========== step7-style.css ========== */

/* ============================================================
   STEP 7 – BASE WRAPPER & GLOBAL STYLES
============================================================ */
.spa-form-wrap {
  margin: 30px auto;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
  padding: 25px 30px;
  font-family: "Segoe UI", Arial, sans-serif;
  color: #222;
}

.spa-assessment-id {
  text-align: center;
  margin-bottom: 20px;
  font-weight: 600;
  color: #444;
}


/* ============================================================
   PAGE TITLES
============================================================ */
h2.spa-title {
  text-align: center;
  font-weight: 700;
  margin: 0 0 4px;
  color: #111;
}

h3.spa-step-title {
  text-align: center;
  margin: 0 0 18px;
  color: #002b6f;
  font-weight: 600;
}

.spa-report-section-title {
    background: #001f5b;
    border-left: 4px solid #CC5500;
    padding: 8px 12px;
    margin: 30px 0 12px;
    font-size: 18px;
    font-weight: !important;
    color: #fff !important;
	border-radius: 6px;
}


/* ============================================================
   CARD / BOX WRAPPERS
============================================================ */
.spa-card {
  background: #fdfdfd;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 20px 25px;
  margin-bottom: 25px;
}


/* ============================================================
   YELLOW INSTRUCTION BOX
============================================================ */
.spa-instructions-card {
  background: #fff8e1;
  border-left: 6px solid #CC5500;
}

.spa-instructions-card h3 {
  font-weight: 700;
  font-size: 16px;
  margin-top: 0;
  color: #111;
}

.spa-instructions-card strong {
  color: #000;
}


/* ============================================================
   EXAMPLE IMAGE GRID
============================================================ */
.spa-example-images {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 10px 0 15px;
}

.spa-example-images img {
  width: 250px;
  height: auto;
  border-radius: 6px;
  border: 1px solid #ccc;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}


/* ============================================================
   BLUE SECTION HEADER BLOCK
============================================================ */
.spa-section-head {
  border-left: 5px solid #1976d2;
  background: #f5f9ff;
  padding: 12px 15px;
  margin-bottom: 20px;
  border-radius: 4px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.spa-section-head img {
  width: 48px;
  height: auto;
}

.spa-section-title {
  margin: 0;
  font-weight: 700;
  color: #0b245b;
}

.spa-section-desc {
  font-size: 14px;
  color: #333;
  margin-top: 6px;
}


/* ============================================================
   FORM LABELS & INPUT BLOCKS
============================================================ */
.spa-field-block {
  margin-top: 15px;
}

.spa-label {
  font-weight: 700;
  color: #111;
  display: block;
  margin-bottom: 4px;
}

.spa-label-hint {
  font-weight: normal;
  color: #777;
  font-size: 12px;
  display: block;
  margin-top: 2px;
}

.spa-hidden-file-input {
  display: none;
}

.spa-textarea {
  width: 100%;
  border-radius: 5px;
  border: 1px solid #ccc;
  padding: 8px;
  resize: vertical;
  font-family: inherit;
}


/* ============================================================
   TABLE STYLES
============================================================ */
.spa-table-wrap {
  overflow-x: auto;
}

.spa-check-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.spa-check-table th,
.spa-check-table td {
  border: 1px solid #ccc;
  text-align: center;
  padding: 8px;
}

.spa-check-table th:first-child {
  text-align: left;
  background: #f5f5f5;
}

.spa-check-table tbody th {
  background: #ffa726;
  color: #000;
  text-align: left;
}

.spa-check-table tbody td {
  background: #fff;
}

table.spa-check-table input[type="radio"] {
  transform: scale(1.8) !important;
}


/* =====================
   Buttons
===================== */
.spa-btn,
.spa-btn-light {
    background: #CC5500 !important;
    color: #fff !important;
    border: none !important;
    border-radius: 4px !important;
    padding: 10px 25px !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    margin-top: 15px !important;
    cursor: pointer !important;
    transition: background 0.3s ease !important;
}

.spa-btn:hover,
.spa-btn-light:hover {
    background: #AE0000 !important;
}

.spa-btn-light:hover {
  background: #ddd;
}

.spa-step-buttons {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 25px;
}

.spa-response-msg {
  margin-top: 15px;
  font-size: 14px;
  font-weight: 600;
  color: #333;
}


/* ============================================================
   LEGEND BOX (Blue Info Box)
============================================================ */
.legend {
  background-color: #eef6ff;
  border-left: 4px solid #007bff;
  padding: 1rem;
  margin-bottom: 1rem;
  font-size: 0.95rem;
  margin-top: 1rem;
}

/* ======================================================
   GLOBAL – MOBILE FLATTEN spa-form-wrap
   No padding / no shadow
   ====================================================== */
@media (max-width: 767px) {
    body .spa-form-wrap {
        padding: 0 !important;
        margin: 0 !important;
        box-shadow: none !important;
        border-radius: 0 !important;
        background: transparent !important;
    }
}

/* ========== step8-style.css ========== */

/* =========================================================
   STEP 8 — LIFE SAFETY SYSTEMS
   Form + Image Upload Only
   ========================================================= */

/* ---------------------------------------------------------
   PAGE WRAPPER
--------------------------------------------------------- */
#spa-step8 {
    max-width: 900px;
    margin: 30px auto;
    background: #ffffff;
    border-radius: 10px;
    padding: 25px 30px;
    box-shadow: 0 5px 18px rgba(0,0,0,0.08);
}

/* ---------------------------------------------------------
   TITLES
--------------------------------------------------------- */
.spa-title {
    text-align: center;
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 6px;
    color: #111;
}

.spa-assessment-id {
    text-align: center;
    font-size: 14px;
    color: #555;
    margin-bottom: 20px;
}

/* ---------------------------------------------------------
   SECTION HEADERS
--------------------------------------------------------- */
.spa-report-section-title {
    background: #001f5b;
    border-left: 4px solid #f8931d;
    color: #fff;
    padding: 10px 14px;
    font-size: 17px;
    font-weight: 600;
    margin: 30px 0 18px;
    border-radius: 6px;
}

/* ---------------------------------------------------------
   FIELD BLOCKS
--------------------------------------------------------- */
.spa-field-block {
    margin-bottom: 22px;
}

.spa-field-block label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    color: #222;
}

.spa-textarea {
    width: 100%;
    min-height: 70px;
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 14px;
    line-height: 1.4;
    resize: vertical;
    background: #fff;
}

.spa-textarea:focus {
    outline: none;
    border-color: #002b6f;
}

/* ---------------------------------------------------------
   IMAGE UPLOAD SECTION
--------------------------------------------------------- */
.spa-preview-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}

.spa-preview-box {
    position: relative;
    width: 140px;
    background: #fafafa;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 8px;
    box-sizing: border-box;
}

.spa-preview-box img {
    width: 100%;
    border-radius: 5px;
    display: block;
}

.spa-preview-box textarea {
    width: 100%;
    height: 60px;
    margin-top: 6px;
    padding: 6px;
    font-size: 12px;
    border-radius: 5px;
    border: 1px solid #ccc;
    resize: none;
}

/* Delete button */
.spa-delete-existing {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #c0392b;
    color: #fff;
    border: none;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
}

.spa-delete-existing:hover {
    background: #a93226;
}

/* ---------------------------------------------------------
   BUTTONS
--------------------------------------------------------- */
.spa-step-buttons {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 30px;
}

/* =====================
   Buttons
===================== */
.spa-btn,
.spa-btn-light {
    background: #CC5500 !important;
    color: #fff !important;
    border: none !important;
    border-radius: 4px !important;
    padding: 10px 25px !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    margin-top: 15px !important;
    cursor: pointer !important;
    transition: background 0.3s ease !important;
}

.spa-btn:hover,
.spa-btn-light:hover {
    background: #AE0000 !important;
}

/* Primary */
.spa-btn {
    background: #002b6f;
    color: #fff;
    border: none;
}

.spa-btn:hover {
    background: #0045b5;
}

/* Secondary */
.spa-btn-light {
    background: #001f5b;
    color: #fff;
    border: 1px solid #001f5b;
}

.spa-btn-light:hover {
    background: #0045b5;
}

/* ---------------------------------------------------------
   RESPONSE MESSAGES
--------------------------------------------------------- */
.spa-response-msg {
    margin-top: 12px;
    font-weight: 600;
}

.spa-success {
    color: #1e7e34;
}

.spa-error {
    color: #b30000;
}

/* ---------------------------------------------------------
   MOBILE
--------------------------------------------------------- */
@media (max-width: 600px) {

    #spa-step8 {
        padding: 20px;
    }

    .spa-preview-box {
        width: 100%;
    }

    .spa-step-buttons {
        flex-direction: column;
    }
}

/* ======================================================
   GLOBAL – MOBILE FLATTEN spa-form-wrap
   No padding / no shadow
   ====================================================== */
@media (max-width: 767px) {
    body .spa-form-wrap {
        padding: 0 !important;
        margin: 0 !important;
        box-shadow: none !important;
        border-radius: 0 !important;
        background: transparent !important;
    }
}

/* ========== step9-style.css ========== */

/* =========================================================
   STEP 9 — FULL REPORT PREVIEW
   Matches on-screen + mPDF output
   ========================================================= */

/* =========================================================
   LAYOUT WRAPPERS
   ========================================================= */

#spa-step8-preview {
    max-width: 900px;
    margin: 20px auto;
    padding: 25px;
    background: #fff;
    border-radius: 8px;
}

.spa-report-wrapper {
    max-width: 900px;
    margin: 0 auto;
}

.spa-table-wrap {
    overflow-x: auto;
}

/* =========================================================
   HEADER / TITLES
   ========================================================= */

.spa-report-logo {
    text-align: center;
    margin-bottom: 10px;
}

.spa-report-logo img {
    max-height: 127px;
}

.spa-report-logo-row {
    text-align: center;
    margin-bottom: 10px;
}

.spa-report-logo-pair {
    margin: 0 auto;
    border-collapse: collapse;
}

.spa-report-logo-pair td {
    vertical-align: middle;
}

img.spa-astm-seal-img {
    display: block;
    max-height: 127px;
    width: auto;
}

.spa-report-title {
    text-align: center;
    font-size: 22px;
    margin: 0 0 15px;
    font-weight: bold;
}

.spa-report-subtitle {
    text-align: center;
    font-size: 14px;
    margin-bottom: 25px;
    color: #666;
}

/* =========================================================
   SECTION HEADERS
   ========================================================= */

.spa-report-section-title {
    background: #001f5b;
    border-left: 4px solid #CC5500;
    padding: 8px 12px;
    margin: 30px 0 12px;
    font-size: 18px;
    color: #fff !important;
    border-radius: 6px !important;
}

/* =========================================================
   TABLES — GENERAL REPORT TABLES (NON-CHECK TABLES)
   ========================================================= */

.spa-report-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 18px;
    font-size: 14px;
}

.spa-report-table th,
.spa-report-table td {
    border: 1px solid #ddd;
    padding: 10px;
    vertical-align: top;
}

.spa-report-table th {
    background: #CC5500;
    font-weight: bold;
    width: 40%;
    color: #fff;
}

/* =========================================================
   DEFICIENCY / NOTES BLOCKS
   ========================================================= */

.spa-report-notes {
    border: 1px solid #ddd;
    padding: 12px;
    background: #fcfcfc;
    margin-bottom: 20px;
    font-size: 14px;
    border-radius: 6px;
}

/* =========================================================
   IMAGE GRID (PDF MATCH)
   ========================================================= */

.spa-report-image-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 5px 0 20px;
}

.spa-report-image-grid-item {
    width: 48%;
    flex: 0 0 48%;
    border: 1px solid #eee;
    border-radius: 4px;
    background: #fff;
    padding: 6px;
    text-align: center;
    box-sizing: border-box;
}

@media (max-width: 600px) {
    .spa-report-image-grid-item {
        width: 100%;
        flex: 0 0 100%;
    }
}

.spa-report-image-grid-item img {
    max-width: 100%;
    border-radius: 3px;
    display: block;
}

.spa-report-image-caption {
    margin-top: 6px;
    font-size: 12px;
    color: #444;
}

/* =========================================================
   BUTTONS / ACTIONS
   ========================================================= */

.spa-step8-actions {
    margin-top: 25px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.spa-btn,
.spa-btn-light {
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    font-weight: 600;
}

.spa-btn {
    background: #002b6f;
    color: #fff;
    border: none;
}

.spa-btn:hover {
    background: #0045b5;
}

.spa-btn-light {
    background: #eee;
    color: #222;
    border: 1px solid #ccc;
}

.spa-btn-light:hover {
    background: #ddd;
}

/* =========================================================
   EMAIL PANEL
   ========================================================= */

#spa_step8_email_panel {
    border: 1px solid #ddd;
    padding: 15px;
    border-radius: 6px;
    background: #fafafa;
}

.spa-field-block label {
    font-weight: 600;
}

.spa-response-msg {
    margin-top: 10px;
    font-weight: 600;
}

.spa-error {
    color: #b30000;
}

.spa-success {
    color: #007200;
}

/* =========================================================
   LEGEND / INFO BOX
   ========================================================= */

.legend {
    background-color: #eef6ff;
    border-left: 4px solid #007bff;
    padding: 1rem;
    margin: 1rem 0;
    font-size: 0.95rem;
    border-radius: 6px !important;
}

/* =========================================================
   CHECK TABLES — STEP 9 (FIXED & SAFE)
   ========================================================= */

.spa-check-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    font-size: 14px;
}

.spa-check-table th,
.spa-check-table td {
    border: 1px solid #ccc;
    padding: 8px;
    box-sizing: border-box;
}

/* Header row */
.spa-check-table thead th {
    background-color: #001f5b;
    color: #fff;
    text-align: center;
    font-weight: bold;
}

/* LEFT COLUMN — Elements */
.spa-check-table tbody th {
    background-color: #CC5500;
    color: #fff;
    text-align: left;
    width: 55%;
}

/* RIGHT COLUMN — Condition */
.spa-check-table tbody td {
    background: #fff;
    text-align: center;
    width: 45%;
}

/* Zebra striping */
.spa-check-table tbody tr:nth-child(even) td {
    background-color: #fafafa;
}

/* Radio buttons */
.spa-check-table input[type="radio"] {
    transform: scale(1.6);
}

/* Secondary check table */
.spa-check-table2 tbody th {
    background: #CC5500 !important;
    color: #fff !important;
    text-align: left !important;
}

.entry-content table.spa-check-table2 th,
.entry-content table.spa-check-table2 td {
    border: 1px solid #ccc !important;
}

/* =========================================================
   MEP READ-ONLY CARD LAYOUT
   ========================================================= */

.spa-mep-card {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 10px;
    padding: 25px;
    margin: 25px 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.spa-mep-title {
    margin: 0 0 18px;
    font-size: 20px;
    font-weight: 600;
}

.spa-mep-row {
    margin-bottom: 20px;
}

.spa-mep-label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
}

.spa-mep-value {
    background: #f5f5f5;
    border: 1px solid #ccc;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 14px;
    line-height: 1.4;
    white-space: pre-wrap;
    min-height: 40px;
}

/* =========================================================
   ADDITIONAL NOTES
   ========================================================= */

.spa-review-label {
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 4px;
    display: block;
}

/* ======================================================
   GLOBAL – MOBILE FLATTEN spa-form-wrap
   No padding / no shadow
   ====================================================== */
@media (max-width: 767px) {
    body .spa-form-wrap {
        padding: 0 !important;
        margin: 0 !important;
        box-shadow: none !important;
        border-radius: 0 !important;
        background: transparent !important;
    }
}

/* ========== savvy-login.css ========== */

/* ===== Savvy Login Page ===== */

.savvy-login-wrap {
    min-height: 100vh;
    position: relative;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    color: #fff;
}

.savvy-login-bg {
    position: fixed;
    inset: 0;
    background: url('/wp-content/uploads/login-bg.jpg') center / cover no-repeat;
    z-index: -1;
}

.savvy-login-container {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    min-height: 100vh;
    padding: 130px 60px 60px;
    gap: 60px;
}

.savvy-login-card {
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(14px);
    border: 1px solid rgba(255,255,255,0.25);
    border-radius: 16px;
    padding: 40px;
    width: 360px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.25);
}

.savvy-login-title {
    margin-bottom: 30px;
    font-size: 22px;
    font-weight: 900;
    color: #fff;
}

.savvy-login-field {
    margin-bottom: 18px;
}

.savvy-login-field label {
    font-size: 13px;
    opacity: 0.85;
}

.savvy-login-field input {
    width: 100%;
    padding: 10px 12px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.4);
    border-radius: 6px;
    color: #ffffff;
    caret-color: #ffffff;
}

.savvy-login-field input::placeholder {
    color: rgba(255,255,255,0.7);
}

/* ===== FORCE WHITE TEXT (focus / typing / blur) ===== */

.savvy-login-field input,
.savvy-login-field input:focus,
.savvy-login-field input:active {
    color: #ffffff !important;
    caret-color: #ffffff;
    outline: none;
}

/* ===== CHROME AUTOFILL FIX ===== */

.savvy-login-field input:-webkit-autofill,
.savvy-login-field input:-webkit-autofill:hover,
.savvy-login-field input:-webkit-autofill:focus,
.savvy-login-field input:-webkit-autofill:active {
    -webkit-text-fill-color: #ffffff !important;
    caret-color: #ffffff;
    transition: background-color 9999s ease-in-out 0s;
}

/* ===== Remember / Button / Links ===== */

.savvy-login-remember {
    font-size: 13px;
    margin-bottom: 20px;
}

.savvy-login-button {
    width: 100%;
    padding: 12px;
    border-radius: 6px;
    background: #ffffff;
    color: #2c3e2f;
    font-weight: 600;
    border: none;
    cursor: pointer;
}

.savvy-login-button:hover {
    background: #e6f0e8;
}

.savvy-login-links {
    margin-top: 16px;
    text-align: center;
    font-size: 13px;
}

.savvy-login-links a {
    color: #ffffff;
    text-decoration: none;
    opacity: 0.9;
}

.savvy-login-links span {
    margin: 0 8px;
    opacity: 0.6;
}

/* ===== Right-side message ===== */

.savvy-login-message {
    max-width: 520px;
    color: #fff;
}

.savvy-login-message h1 {
    font-size: 38px;
    line-height: 1.2;
    font-weight: 700;
    color: #fff;
}

.savvy-login-divider {
    width: 120px;
    height: 3px;
    background: #ffffff;
    margin-top: 20px;
}

/* ===== Mobile ===== */

@media (max-width: 900px) {
    .savvy-login-container {
        flex-direction: column;
        justify-content: center;
        padding: 40px;
    }

    .savvy-login-message {
        display: none;
    }
}

/* ===== Card Form Switcher ===== */

.savvy-form {
    display: none;
    animation: savvyFade 0.3s ease;
}

.savvy-form.active {
    display: block;
}

@keyframes savvyFade {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== Inline Views ===== */

.savvy-view {
    display: none;
}

.savvy-view.active {
    display: block;
}

/* ===== Alerts ===== */

.savvy-login-alert {
    border-radius: 10px;
    padding: 10px 12px;
    margin-bottom: 16px;
    font-size: 13px;
}

.savvy-login-alert.info {
    background: rgba(160, 0, 0, 0.18);
    border: 1px solid rgba(255, 120, 120, 0.35);
}

.savvy-login-alert.success {
    background: rgba(0, 255, 140, 0.14);
    border: 1px solid rgba(0, 255, 140, 0.25);
}

.savvy-login-alert.error {
    background: rgba(255, 80, 80, 0.16);
    border: 1px solid rgba(255, 80, 80, 0.30);
}

/* Final override: prevent left-right horizontal scrollbar on desktop */
.spa-table-wrap {
  overflow-x: hidden !important;
}

/* Allow it on mobile (if needed) */
@media (max-width: 767px) {
  .spa-table-wrap {
    overflow-x: auto !important;
  }
}

/* ============================================================
   Step 9 report tables (spa-pdf wrapper) — enforce spacing
   Step 9 injects inline <style> rules with !important, so we
   override with higher-specificity selectors here.
============================================================ */
div.spa-report-wrapper.spa-pdf table th,
div.spa-report-wrapper.spa-pdf table td {
  padding: 4pt 6pt !important;
  line-height: 1.15 !important;
  vertical-align: top !important;
}

div.spa-report-wrapper.spa-pdf .spa-check-table th,
div.spa-report-wrapper.spa-pdf .spa-check-table td {
  /* Keep the check grid compact */
  padding: 4pt 6pt !important;
  line-height: 1.1 !important;
}

/* Step 9 inline styles force % widths; override with fixed widths. */
div.spa-report-wrapper.spa-pdf .spa-check-table:has(input[type="radio"]) th:first-child,
div.spa-report-wrapper.spa-pdf .spa-check-table:has(input[type="radio"]) td:first-child {
  width: 280px !important;
  min-width: 280px !important;
}

div.spa-report-wrapper.spa-pdf .spa-check-table:has(input[type="radio"]) thead th:not(:first-child),
div.spa-report-wrapper.spa-pdf .spa-check-table:has(input[type="radio"]) tbody td:not(:first-child) {
  width: 44px !important;
  min-width: 44px !important;
  white-space: nowrap !important;
}


/* =====================================================
   AI SPLIT-BUTTON: caret + floating menu (Mode + Action)
===================================================== */

.spa-form-wrap .spa-ai-wrapper:not(.spa-ai-wrapper--inline) .spa-ai-caret,
.spa-step-container .spa-ai-wrapper:not(.spa-ai-wrapper--inline) .spa-ai-caret {
    position: absolute;
    top: auto;
    right: 48px;
    bottom: 8px;
    width: 22px;
    height: 36px;
    padding: 0;
    margin: 0;
    border: none;
    border-radius: 8px 0 0 8px;
    background: #4478e8;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 4;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
    line-height: 0;
    border-right: 1px solid rgba(255, 255, 255, 0.25);
}

.spa-form-wrap .spa-ai-wrapper:not(.spa-ai-wrapper--inline) .spa-ai-caret:hover,
.spa-step-container .spa-ai-wrapper:not(.spa-ai-wrapper--inline) .spa-ai-caret:hover {
    background: #3a6cd8;
}

.spa-form-wrap .spa-ai-wrapper:not(.spa-ai-wrapper--inline) .spa-ai-caret + .spa-ai-trigger,
.spa-step-container .spa-ai-wrapper:not(.spa-ai-wrapper--inline) .spa-ai-caret + .spa-ai-trigger {
    border-radius: 0 8px 8px 0;
}

.spa-form-wrap .spa-ai-wrapper:not(.spa-ai-wrapper--inline) .spa-ai-textarea {
    /* extra room for caret + trigger combo */
    padding-right: 78px;
}

/* Inline variant (single-line text inputs) */
.spa-form-wrap .spa-ai-wrapper--inline .spa-ai-caret,
.spa-step-container .spa-ai-wrapper--inline .spa-ai-caret {
    position: static;
    flex: 0 0 22px;
    width: 22px;
    height: 36px;
    padding: 0;
    margin: 0;
    border: none;
    border-radius: 8px 0 0 8px;
    background: #4478e8;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    align-self: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
    line-height: 0;
    border-right: 1px solid rgba(255, 255, 255, 0.25);
}

.spa-form-wrap .spa-ai-wrapper--inline .spa-ai-caret:hover,
.spa-step-container .spa-ai-wrapper--inline .spa-ai-caret:hover {
    background: #3a6cd8;
}

.spa-form-wrap .spa-ai-wrapper--inline .spa-ai-caret + .spa-ai-trigger,
.spa-step-container .spa-ai-wrapper--inline .spa-ai-caret + .spa-ai-trigger {
    border-radius: 0 8px 8px 0;
    margin-left: -1px;
}

/* Floating menu */
.spa-ai-menu {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 99999;
    min-width: 240px;
    max-width: 320px;
    background: #ffffff;
    border: 1px solid #d9dde3;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.15), 0 2px 4px rgba(15, 23, 42, 0.06);
    padding: 6px;
    visibility: hidden;
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity 120ms ease, transform 120ms ease, visibility 0s linear 120ms;
    font-size: 13px;
    color: #1f2937;
}

.spa-ai-menu.is-open {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
    transition: opacity 120ms ease, transform 120ms ease, visibility 0s linear 0s;
}

.spa-ai-menu__section + .spa-ai-menu__section {
    margin-top: 4px;
    padding-top: 6px;
    border-top: 1px solid #eef0f3;
}

.spa-ai-menu__title {
    padding: 6px 10px 4px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #6b7280;
}

.spa-ai-menu__item {
    width: 100%;
    text-align: left;
    background: transparent;
    border: 0;
    padding: 7px 10px 7px 32px;
    border-radius: 6px;
    cursor: pointer;
    display: block;
    position: relative;
    color: inherit;
    font: inherit;
}

.spa-ai-menu__item:hover,
.spa-ai-menu__item:focus {
    background: #f3f5f9;
    outline: none;
}

.spa-ai-menu__item.is-selected {
    background: #eaf1ff;
}

.spa-ai-menu__check {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 14px;
    color: #2271b1;
    visibility: hidden;
    font-size: 12px;
    line-height: 1;
}

.spa-ai-menu__item.is-selected .spa-ai-menu__check {
    visibility: visible;
}

.spa-ai-menu__item--action {
    padding-left: 12px;
}

.spa-ai-menu__label {
    display: block;
    font-weight: 600;
}

.spa-ai-menu__desc {
    display: block;
    margin-top: 2px;
    color: #6b7280;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.35;
}

/* =====================================================
   AI UNDO BUTTON  (small, sits left of caret)
===================================================== */

.spa-form-wrap .spa-ai-wrapper:not(.spa-ai-wrapper--inline) .spa-ai-undo,
.spa-step-container .spa-ai-wrapper:not(.spa-ai-wrapper--inline) .spa-ai-undo {
    position: absolute;
    top: auto;
    right: 70px;
    bottom: 8px;
    width: 28px;
    height: 36px;
    padding: 0;
    margin: 0;
    border: 1px solid #d9dde3;
    border-radius: 8px;
    background: #ffffff;
    color: #475569;
    cursor: pointer;
    z-index: 4;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
    line-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.spa-form-wrap .spa-ai-wrapper:not(.spa-ai-wrapper--inline) .spa-ai-undo:hover,
.spa-step-container .spa-ai-wrapper:not(.spa-ai-wrapper--inline) .spa-ai-undo:hover {
    background: #f3f5f9;
    color: #1f2937;
}

.spa-form-wrap .spa-ai-wrapper:not(.spa-ai-wrapper--inline) .spa-ai-undo:disabled,
.spa-step-container .spa-ai-wrapper:not(.spa-ai-wrapper--inline) .spa-ai-undo:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* When undo is visible, give the textarea a bit more right padding */
.spa-form-wrap .spa-ai-wrapper:not(.spa-ai-wrapper--inline):has(.spa-ai-undo:not([style*="display: none"])) .spa-ai-textarea,
.spa-step-container .spa-ai-wrapper:not(.spa-ai-wrapper--inline):has(.spa-ai-undo:not([style*="display: none"])) .spa-ai-textarea {
    padding-right: 110px;
}

.spa-form-wrap .spa-ai-wrapper--inline .spa-ai-undo,
.spa-step-container .spa-ai-wrapper--inline .spa-ai-undo {
    flex: 0 0 28px;
    width: 28px;
    height: 36px;
    padding: 0;
    margin: 0 4px 0 0;
    border: 1px solid #d9dde3;
    border-radius: 8px;
    background: #ffffff;
    color: #475569;
    cursor: pointer;
    align-self: center;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
    line-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.spa-form-wrap .spa-ai-wrapper--inline .spa-ai-undo:hover,
.spa-step-container .spa-ai-wrapper--inline .spa-ai-undo:hover {
    background: #f3f5f9;
    color: #1f2937;
}

.spa-form-wrap .spa-ai-wrapper--inline .spa-ai-undo:disabled,
.spa-step-container .spa-ai-wrapper--inline .spa-ai-undo:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Menu utility section (Compare / Undo) */
.spa-ai-menu__section--utility .spa-ai-menu__item--util {
    padding-left: 12px;
}

.spa-ai-menu__item.is-disabled,
.spa-ai-menu__item:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.spa-ai-menu__item.is-disabled:hover,
.spa-ai-menu__item:disabled:hover {
    background: transparent;
}

/* =====================================================
   AI COMPARE MODAL
===================================================== */

.spa-ai-compare-modal {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: none;
}

.spa-ai-compare-modal.is-open {
    display: block;
}

.spa-ai-compare-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(2px);
}

.spa-ai-compare-modal__dialog {
    position: relative;
    margin: 5vh auto;
    width: min(960px, 92vw);
    max-height: 88vh;
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.spa-ai-compare-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-bottom: 1px solid #eef0f3;
}

.spa-ai-compare-modal__header h3 {
    margin: 0;
    font-size: 16px;
    color: #1f2937;
}

.spa-ai-compare-modal__close {
    background: transparent;
    border: 0;
    font-size: 22px;
    line-height: 1;
    color: #64748b;
    cursor: pointer;
    padding: 4px 8px;
}

.spa-ai-compare-modal__close:hover {
    color: #1f2937;
}

.spa-ai-compare-modal__body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    padding: 16px 20px;
    overflow: auto;
}

@media (max-width: 720px) {
    .spa-ai-compare-modal__body {
        grid-template-columns: 1fr;
    }
}

.spa-ai-compare__col {
    display: flex;
    flex-direction: column;
    min-height: 200px;
}

.spa-ai-compare__hdr {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #6b7280;
    margin-bottom: 6px;
}

.spa-ai-compare__pre {
    flex: 1 1 auto;
    margin: 0;
    padding: 12px 14px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-family: Consolas, "SF Mono", Monaco, monospace;
    font-size: 13px;
    line-height: 1.5;
    color: #1f2937;
    white-space: pre-wrap;
    word-wrap: break-word;
    max-height: 60vh;
    overflow: auto;
}

.spa-ai-compare-modal__footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 12px 20px;
    border-top: 1px solid #eef0f3;
    background: #fafbfc;
}

/* =====================================================
   AI BULK PROCESSING — launcher + modal
===================================================== */

.spa-ai-bulk-launch {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    margin: 12px 0 18px;
    background: linear-gradient(180deg, #5b8df5 0%, #4478e8 100%);
    color: #ffffff;
    border: 0;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(68, 120, 232, 0.25);
    transition: transform 100ms ease, box-shadow 100ms ease;
}

.spa-ai-bulk-launch:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(68, 120, 232, 0.32);
}

.spa-ai-bulk-launch:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(68, 120, 232, 0.25);
}

.spa-ai-bulk-launch svg {
    flex-shrink: 0;
}

.spa-ai-bulk-launch__count {
    opacity: 0.85;
    font-weight: 500;
}

/* Modal */
.spa-ai-bulk-modal {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: none;
}

.spa-ai-bulk-modal.is-open {
    display: block;
}

.spa-ai-bulk-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(2px);
}

.spa-ai-bulk-modal__dialog {
    position: relative;
    margin: 4vh auto;
    width: min(820px, 94vw);
    max-height: 92vh;
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.spa-ai-bulk-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-bottom: 1px solid #eef0f3;
}

.spa-ai-bulk-modal__header h3 {
    margin: 0;
    font-size: 16px;
    color: #1f2937;
}

.spa-ai-bulk-modal__close {
    background: transparent;
    border: 0;
    font-size: 22px;
    line-height: 1;
    color: #64748b;
    cursor: pointer;
    padding: 4px 8px;
}

.spa-ai-bulk-modal__close:hover {
    color: #1f2937;
}

.spa-ai-bulk-modal__controls {
    display: flex;
    gap: 14px;
    align-items: center;
    flex-wrap: wrap;
    padding: 12px 20px;
    border-bottom: 1px solid #eef0f3;
    background: #fafbfc;
}

.spa-ai-bulk-modal__controls label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #1f2937;
}

.spa-ai-bulk-modal__controls select {
    min-width: 160px;
}

.spa-ai-bulk-modal__select-all {
    margin-left: auto;
}

.spa-ai-bulk-modal__list {
    flex: 1 1 auto;
    overflow: auto;
    padding: 6px 0;
}

.spa-ai-bulk-modal__empty {
    padding: 24px;
    text-align: center;
    color: #64748b;
}

.spa-ai-bulk-row {
    display: grid;
    grid-template-columns: 28px 1fr 110px;
    gap: 12px;
    align-items: start;
    padding: 10px 20px;
    border-bottom: 1px solid #f1f3f6;
}

.spa-ai-bulk-row:last-child {
    border-bottom: 0;
}

.spa-ai-bulk-row__check {
    margin-top: 4px;
}

.spa-ai-bulk-row__label {
    font-weight: 600;
    font-size: 13px;
    color: #1f2937;
    margin-bottom: 2px;
}

.spa-ai-bulk-row__preview {
    font-size: 12px;
    color: #64748b;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.spa-ai-bulk-row__status {
    text-align: right;
    font-size: 12px;
    color: #64748b;
    white-space: nowrap;
}

.spa-ai-bulk-row__status.is-ok {
    color: #1e6b2a;
    font-weight: 600;
}

.spa-ai-bulk-row__status.is-error {
    color: #b91c1c;
    font-weight: 600;
}

.spa-ai-bulk-modal__progress {
    padding: 10px 20px;
    border-top: 1px solid #eef0f3;
    background: #fafbfc;
    color: #475569;
    font-size: 13px;
}

.spa-ai-bulk-modal__footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 12px 20px;
    border-top: 1px solid #eef0f3;
    background: #fafbfc;
}

/* =====================================================
   IMAGE GRID — 3 across (applies to all step pages)
   Step 1 has its own #spa-step1 rules with higher specificity.
===================================================== */

.spa-images-section .spa-preview-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-top: 12px;
    align-items: start;
}

.spa-images-section .spa-preview-box {
    max-width: none;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    display: block;
    margin: 0;
}

.spa-images-section .spa-preview-box > img,
.spa-images-section .spa-preview-box .spa-preview-img {
    width: 100% !important;
    max-width: 100%;
    height: auto;
    max-height: 220px;
    object-fit: cover;
    border-radius: 6px;
    display: block;
}

.spa-images-section .spa-preview-box textarea {
    width: 100%;
    min-height: 110px;
    margin-top: 10px;
    box-sizing: border-box;
    font-size: 14px;
    line-height: 1.4;
    resize: vertical;
}

@media (max-width: 1100px) {
    .spa-images-section .spa-preview-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .spa-images-section .spa-preview-grid {
        grid-template-columns: 1fr;
    }
}


/* =====================================================
   AI Deficiencies modal — preview pane
===================================================== */

.spa-ai-def-preview-wrap {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px dashed #d9dde3;
}

.spa-ai-def-preview-hint {
    font-weight: 400;
    color: #6b7280;
    font-size: 12px;
    margin-left: 6px;
}

.spa-ai-def-modal__preview {
    width: 100%;
    min-height: 200px;
    box-sizing: border-box;
    padding: 12px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #fdfdfd;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.5;
    color: #1f2937;
    resize: vertical;
}

.spa-ai-def-modal__preview:focus {
    outline: none;
    border-color: #558bf6;
    box-shadow: 0 0 0 3px rgba(85, 139, 246, 0.15);
}

/* Side-by-side: editable Markdown source + live rendered preview */
.spa-ai-def-preview-cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    align-items: stretch;
}

.spa-ai-def-preview-col {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.spa-ai-def-preview-col .spa-ai-def-modal__preview {
    flex: 1 1 auto;
    min-height: 280px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
    font-size: 13px;
}

.spa-ai-def-modal__rendered {
    flex: 1 1 auto;
    min-height: 280px;
    box-sizing: border-box;
    padding: 12px 16px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #ffffff;
    color: #1f2937;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.55;
    overflow-y: auto;
    max-height: 60vh;
}

.spa-ai-def-modal__rendered:empty::before {
    content: "Rendered output will appear here.";
    color: #9ca3af;
    font-style: italic;
}

.spa-ai-def-modal__rendered h1,
.spa-ai-def-modal__rendered h2,
.spa-ai-def-modal__rendered h3,
.spa-ai-def-modal__rendered h4,
.spa-ai-def-modal__rendered h5,
.spa-ai-def-modal__rendered h6 {
    margin: 16px 0 6px;
    font-weight: 700;
    color: #111827;
    line-height: 1.25;
}

.spa-ai-def-modal__rendered h1 { font-size: 20px; }
.spa-ai-def-modal__rendered h2 { font-size: 18px; }
.spa-ai-def-modal__rendered h3 { font-size: 16px; }
.spa-ai-def-modal__rendered h4 { font-size: 15px; }
.spa-ai-def-modal__rendered h5,
.spa-ai-def-modal__rendered h6 { font-size: 14px; }

.spa-ai-def-modal__rendered :first-child {
    margin-top: 0;
}

.spa-ai-def-modal__rendered p {
    margin: 0 0 10px;
}

.spa-ai-def-modal__rendered strong {
    font-weight: 700;
    color: #111827;
}

.spa-ai-def-modal__rendered em {
    font-style: italic;
}

.spa-ai-def-modal__rendered ul,
.spa-ai-def-modal__rendered ol {
    margin: 6px 0 12px;
    padding-left: 22px;
}

.spa-ai-def-modal__rendered li {
    margin: 2px 0;
}

.spa-ai-def-modal__rendered code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
    font-size: 0.9em;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 3px;
    padding: 1px 5px;
}

@media (max-width: 900px) {
    .spa-ai-def-preview-cols {
        grid-template-columns: 1fr;
    }
    .spa-ai-def-preview-col .spa-ai-def-modal__preview,
    .spa-ai-def-modal__rendered {
        min-height: 200px;
    }
}
