/* SLC Drawing Analyzer — Styles v1.49 */

.slc-da {
    max-width: 820px;
    margin: 0 auto 3rem;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    color: #1a1a1a;
    font-size: 15px;
    line-height: 1.5;
}

/* ── Header ─────────────────────────────────────────────── */
.da-header { margin-bottom: 1.5rem; }
.da-header h2 { font-size: 1.5rem; font-weight: 700; color: #1B3A5C; margin: 0 0 .4rem; }
.da-header p  { color: #555; margin: 0; }

/* ── Upload zone ─────────────────────────────────────────── */
.da-upload-zone {
    border: 2px dashed #A2C3E2;
    border-radius: 10px;
    padding: 2rem 1rem;
    text-align: center;
    cursor: pointer;
    background: #f8fbff;
    transition: border-color .2s, background .2s;
    margin-bottom: .75rem;
}
.da-upload-zone:hover, .da-upload-zone.da-dragover {
    border-color: #1B3A5C;
    background: #edf4fb;
}
.da-upload-icon { font-size: 2.2rem; margin-bottom: .5rem; }
.da-upload-zone p { margin: .2rem 0; color: #444; }
.da-sub { color: #888 !important; font-size: .85em; }

.da-file-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f0f6ff;
    border: 1px solid #c8dff5;
    border-radius: 6px;
    padding: .5em .75em;
    margin-bottom: .4em;
    font-size: .9em;
}
.da-file-name { color: #1B3A5C; font-weight: 500; }
.da-file-size { color: #888; font-weight: 400; font-size: .9em; }
.da-remove-file {
    background: none; border: none; cursor: pointer;
    color: #999; font-size: 1.2em; line-height: 1; padding: 0 .25em;
}
.da-remove-file:hover { color: #c0392b; }

/* ── Textarea ────────────────────────────────────────────── */
.da-desc-field { margin-bottom: 1rem; }
.da-optional   { color: #999; font-weight: 400; }
.slc-da textarea {
    width: 100%; box-sizing: border-box;
    border: 1px solid #ccd9e8; border-radius: 6px;
    padding: .6em .75em; font-family: inherit; font-size: .95em;
    resize: vertical; color: #1a1a1a;
}
.slc-da textarea:focus { outline: 2px solid #A2C3E2; border-color: transparent; }

/* ── Buttons ─────────────────────────────────────────────── */
/* Buttons. Hover INVERTS the normal colors (white bg + accent text +
   accent border) per the project rule — never wash out to white-on-white.
   A 1px border lives in the base state (matching the fill color so it's
   invisible) so the invert on hover doesn't shift layout. Hover rules are
   scoped under .slc-da and flagged !important so the host theme's own
   button:hover / a:hover rules can't override them. */
.slc-da .da-btn {
    display: inline-block;
    background: #1B3A5C;
    color: #fff;
    border: 1px solid #1B3A5C; border-radius: 8px;
    padding: .65em 1.5em;
    font-size: .95em; font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background .15s, color .15s, border-color .15s, transform .1s;
}
.slc-da .da-btn:hover {
    background: #fff !important;
    color: #1B3A5C !important;
    border-color: #1B3A5C !important;
    transform: translateY(-1px);
}

.slc-da .da-btn-generate {
    background: #1B3A5C;
    padding: .75em 2em;
    font-size: 1em;
}
/* generate inherits .da-btn:hover invert — no separate hover needed */

.slc-da .da-btn-sec {
    background: #fff;
    color: #1B3A5C;
    border: 1px solid #1B3A5C;
}
/* secondary is already light; invert to filled-blue + white text on hover */
.slc-da .da-btn-sec:hover {
    background: #1B3A5C !important;
    color: #fff !important;
    border-color: #1B3A5C !important;
}

.slc-da .da-btn-sheet {
    background: #1B3A5C;
    font-size: .95em;
    padding: .65em 1.4em;
    color: #fff;
    border: 1px solid #1B3A5C;
}
.slc-da .da-btn-sheet:hover {
    background: #fff !important;
    color: #1B3A5C !important;
    border-color: #1B3A5C !important;
}

.slc-da .da-btn-sm {
    background: #fff; border: 1px solid #A2C3E2;
    border-radius: 6px; color: #1B3A5C;
    padding: .3em .9em; font-size: .85em;
    cursor: pointer;
}
.slc-da .da-btn-sm:hover {
    background: #1B3A5C !important;
    color: #fff !important;
    border-color: #1B3A5C !important;
}

.da-actions { display: flex; gap: .75rem; flex-wrap: wrap; margin-top: 1.5rem; }
.da-submit-hint { color: #888; font-size: .85em; margin: .4em 0 0; }

/* ── Loading ─────────────────────────────────────────────── */
.da-loading-box { text-align: center; padding: 3rem 1rem; }
.da-spinner {
    width: 44px; height: 44px;
    border: 4px solid #e0eaf5;
    border-top-color: #1B3A5C;
    border-radius: 50%;
    animation: da-spin .8s linear infinite;
    margin: 0 auto 1rem;
}
@keyframes da-spin { to { transform: rotate(360deg); } }

/* ── Error ───────────────────────────────────────────────── */
.da-error {
    background: #fff5f5; border: 1px solid #fca5a5;
    border-radius: 10px; padding: 1.25rem 1.5rem;
    margin-bottom: 1rem;
}
.da-error h3 { color: #c0392b; margin: 0 0 .5rem; }

/* ── Notes / advisories ──────────────────────────────────── */
.da-notes {
    background: #fffbeb; border-left: 4px solid #f59e0b;
    padding: .75rem 1rem; border-radius: 0 6px 6px 0;
    font-size: .9em; color: #555;
    margin-bottom: 1.25rem;
}

/* ── Step 2 fields ───────────────────────────────────────── */
.da-section-head {
    font-size: .8em; font-weight: 700; letter-spacing: .07em;
    text-transform: uppercase; color: #1B3A5C;
    border-bottom: 2px solid #A2C3E2;
    padding-bottom: .35rem; margin: 1.75rem 0 1rem;
}
.da-section-note {
    font-weight: 400; text-transform: none;
    letter-spacing: 0; font-size: 1em; color: #888;
}
.da-fields { margin-top: .5rem; }

.da-field       { display: flex; flex-direction: column; gap: .3em; margin-bottom: 1rem; }
.da-field-row   { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 0; }
@media (max-width: 560px) { .da-field-row { grid-template-columns: 1fr; } }

.da-field label {
    font-size: .88em; font-weight: 600; color: #333;
}
.da-field input,
.da-field select {
    width: 100%; box-sizing: border-box;
    border: 1px solid #ccd9e8; border-radius: 6px;
    padding: .5em .7em; font-family: inherit; font-size: .95em;
    color: #1a1a1a; background: #fff;
    transition: border-color .15s;
}
.da-field input:focus,
.da-field select:focus { outline: 2px solid #A2C3E2; border-color: transparent; }

.da-scope-hint {
    font-size: .82em; color: #1B3A5C; font-weight: 600;
    min-height: 1.2em;
    display: none;
}
.da-field-hint { font-size: .82em; color: #888; margin-top: .1em; }

/* ── Step 3 Results ──────────────────────────────────────── */
.da-results { max-width: 680px; }

.da-results-hero {
    background: linear-gradient(135deg, #1B3A5C 0%, #2a5486 100%);
    color: #fff;
    border-radius: 12px;
    padding: 1.5rem 1.75rem;
    margin-bottom: 1.25rem;
}
.da-results-meta   { font-size: .88em; opacity: .8; margin-bottom: .25rem; }
.da-results-total  { font-size: 2.4rem; font-weight: 800; line-height: 1.1; margin-bottom: .15rem; }
.da-results-psf    { font-size: 1.05rem; opacity: .85; margin-bottom: .6rem; }
.da-results-range-badge {
    display: inline-block;
    padding: .25em .8em;
    border-radius: 20px;
    font-size: .8em; font-weight: 600;
    color: #fff;
}

.da-results-table {
    width: 100%; border-collapse: collapse;
    font-size: .93em; margin-bottom: 1.5rem;
}
.da-results-table td { padding: .5em .25em; border-bottom: 1px solid #eee; }
.da-results-table td:last-child { text-align: right; font-weight: 600; }

.da-results-divhead {
    font-size: .8em; font-weight: 700; letter-spacing: .07em;
    text-transform: uppercase; color: #1B3A5C;
    border-bottom: 2px solid #A2C3E2;
    padding-bottom: .35rem; margin: 0 0 .75rem;
}

.da-div-table {
    width: 100%; border-collapse: collapse;
    font-size: .9em; margin-bottom: 1.5rem;
}
.da-div-table thead tr { background: #f0f4f8; }
.da-div-table th {
    text-align: left; padding: .45em .6em;
    font-size: .78em; font-weight: 700;
    text-transform: uppercase; letter-spacing: .05em; color: #555;
}
.da-div-table td { padding: .4em .6em; border-bottom: 1px solid #f0f0f0; }
.da-div-code { color: #888; font-size: .85em; font-weight: 600; white-space: nowrap; }
.da-div-name { color: #333; }
.da-div-amt  { text-align: right; font-weight: 600; color: #1B3A5C; }

.da-advisories {
    background: #fffbeb; border-left: 4px solid #f59e0b;
    padding: .75rem 1rem; border-radius: 0 6px 6px 0;
    font-size: .88em; margin-bottom: 1.25rem;
}
.da-advisories ul { margin: .4em 0 0 1.2em; padding: 0; }
.da-advisories li { margin-bottom: .25em; color: #555; }

.da-results-actions { display: flex; gap: .75rem; flex-wrap: wrap; margin-top: 1rem; }

/* ── v1.47: Estimate-type toggle ─────────────────────────────── */
.da-mode-toggle { display: flex; gap: .75rem; flex-wrap: wrap; }
.da-mode-opt {
    flex: 1 1 240px;
    border: 2px solid #ccd9e8; border-radius: 8px;
    padding: .8rem 1rem; cursor: pointer; display: block; background: #fff;
    transition: border-color .15s, background .15s, box-shadow .15s;
    /* v1.47.1 — without this, clicking the label TEXT starts a text-selection
       gesture instead of forwarding the click to the hidden radio, so the
       toggle needed two clicks to activate. Kill selection on the whole card. */
    -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none;
}
.da-mode-opt input { position: absolute; opacity: 0; width: 0; height: 0; }
.da-mode-opt .da-mode-title { display: block; font-weight: 700; color: #1B3A5C; margin-bottom: .15rem; }
.da-mode-opt .da-mode-sub   { display: block; font-size: .82em; color: #777; line-height: 1.35; }
.da-mode-opt:hover { border-color: #A2C3E2; }
.da-mode-opt.da-mode-active {
    border-color: #1B3A5C; background: #f3f8fd;
    box-shadow: 0 0 0 1px #1B3A5C inset;
}
.da-mode-opt.da-mode-active:hover { border-color: #1B3A5C; }

/* ── v1.47: Rough order-of-magnitude result ──────────────────── */
.da-rough-banner {
    display: inline-block; background: #f59e0b; color: #1a1a1a;
    font-size: .72em; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
    padding: .35em .9em; border-radius: 6px; margin-bottom: .9rem;
}
.da-rough-rangelabel {
    font-size: .8em; text-transform: uppercase; letter-spacing: .08em;
    opacity: .75; margin-bottom: .25rem;
}
.da-rough-band { font-size: 2.4rem; font-weight: 800; line-height: 1.1; }
.da-rough-psf  { font-size: 1.1rem; opacity: .9; margin-top: .2rem; }
.da-rough-mid  { font-size: .9em; opacity: .7; margin-top: .5rem; }
.da-rough-note { font-size: .9em; color: #444; line-height: 1.5; margin-bottom: 1.1rem; }
.da-rough-note p { margin: 0 0 .6rem; }
.da-rough-excl { color: #666; font-size: .95em; }
/* v1.47.1 — the "Switch to a Detailed Proposal" action now reuses the shared
   .da-btn / .da-btn-sec button family (see the Buttons section above) instead
   of the old one-off .da-link-btn. That makes it visually consistent with the
   other action buttons AND inherits the proven .da-btn:hover invert (scoped
   under .slc-da + !important), so it can no longer wash out to white-on-white
   the way the .da-link-btn-specific hover did on the live theme. */
.da-rough-switch { font-size: .9em; color: #555; margin-top: .9rem; }
.da-rough-switch-q { display: block; margin-bottom: .55rem; }
/* fixed rem size so it doesn't shrink from the .9em parent context */
.slc-da .da-rough-switch-btn { font-size: .95rem; }

/* ── Required marker ─────────────────────────────────────────*/
.da-required { color: #c0392b; font-weight: 700; }

/* ── Textarea inside scope fields ────────────────────────────*/
.da-field textarea {
    width: 100%; box-sizing: border-box;
    border: 1px solid #ccd9e8; border-radius: 6px;
    padding: .5em .7em; font-family: inherit; font-size: .95em;
    color: #1a1a1a; resize: vertical;
    transition: border-color .15s;
}
.da-field textarea:focus { outline: 2px solid #A2C3E2; border-color: transparent; }

/* ── Contact section top border ──────────────────────────────*/
#da-step2 .da-fields .da-section-head:first-child { margin-top: 0; }

/* ── v1.44: LOW-confidence field highlight ──────────────────────────────── */
/* AI applies .da-conf-low to inputs/selects whose fieldConfidence is "low",
   so the user knows which fields need verification before submitting. */
.da-field input.da-conf-low,
.da-field select.da-conf-low {
    border-left: 4px solid #f59e0b;
    background: #fffbeb;
}
.da-field input.da-conf-low:focus,
.da-field select.da-conf-low:focus {
    outline: 2px solid #f59e0b;
}

/* ── v1.44: AI Add Alt suggestion banner ────────────────────────────────── */
.da-aa-banner {
    background: #ecfdf5;
    border-left: 4px solid #10b981;
    padding: .55rem .85rem;
    border-radius: 0 6px 6px 0;
    font-size: .88em;
    color: #065f46;
    margin-bottom: .25rem;
}

/* ── Google Sheets button ─────────────────────────────────────────────────── */
.da-btn-sheet-gs {
    background: #0F9D58;
    font-size: .95em;
    padding: .65em 1.4em;
    color: #fff;
    display: inline-block;
    border: 1px solid #0F9D58;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: background .15s, color .15s, border-color .15s, transform .1s;
}
.da-btn-sheet-gs:hover {
    background: #fff !important;
    color: #0F9D58 !important;
    border-color: #0F9D58 !important;
    transform: translateY(-1px);
}

/* ── v1.46 Gated Access ─────────────────────────────────────────────── */
.slc-da-gate { max-width: 640px; margin: 0 auto; }
.slc-da-gate-welcome { margin-bottom: 1.2em; }
.slc-da-gate-welcome h2 { margin: 0 0 .4em; }
.slc-da-gate-card {
    background: #fff;
    border: 1px solid #e1e4e8;
    border-radius: 8px;
    padding: 1.4em 1.6em;
    box-shadow: 0 1px 2px rgba(0,0,0,.04);
}
.slc-da-gate-card h3 { font-size: 1.1em; }
.slc-da-gate-success {
    padding: 1em 1.2em;
    background: #ecfdf5;
    border: 1px solid #34d399;
    border-radius: 6px;
    color: #065f46;
}
.slc-da-gate-msg {
    max-width: 640px;
    margin: 0 auto;
    padding: 2em 1.6em;
    text-align: center;
}

/* ── v1.49 Guided Intake Wizard ─────────────────────────────────────────── */
/* Entry banner on Step 1 */
.da-guide-entry {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    background: #f0f6ff;
    border: 1px solid #c8dff5;
    border-radius: 8px;
    padding: .75rem 1rem;
    margin-bottom: 1rem;
}
.da-guide-entry-copy { font-size: .9em; color: #444; }
.da-guide-entry-copy strong { color: #1B3A5C; display: block; }
.da-guide-btn { white-space: nowrap; flex-shrink: 0; }

/* Wizard shell */
#da-wizard { animation: da-wiz-fade .2s ease; }
@keyframes da-wiz-fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.da-wiz-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}
.da-wiz-progress { display: flex; gap: .5rem; }
.da-wiz-dot {
    width: 28px; height: 6px; border-radius: 3px;
    background: #e0eaf5; transition: background .2s;
}
.da-wiz-dot.da-wiz-dot-done   { background: #A2C3E2; }
.da-wiz-dot.da-wiz-dot-active { background: #1B3A5C; }
.da-wiz-stepcount { font-size: .8em; font-weight: 600; color: #888; letter-spacing: .04em; }

.da-wiz-panel { min-height: 220px; }
.da-wiz-q {
    font-size: 1.25rem; font-weight: 700; color: #1B3A5C;
    margin: 0 0 .35rem;
}
.da-wiz-sub { color: #777; font-size: .9em; margin: 0 0 1.1rem; }
.da-wiz-subhead {
    font-size: .8em; font-weight: 700; letter-spacing: .06em;
    text-transform: uppercase; color: #1B3A5C;
    margin: 1.4rem 0 .8rem;
}

/* Selectable option cards (JS toggles .da-wiz-opt-selected, mirroring the
   Step 2 estimate-mode toggle pattern; user-select:none avoids the v1.47.1
   two-click bug where clicking option TEXT started a selection gesture). */
.da-wiz-opts { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.da-wiz-opts-compact { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
@media (max-width: 560px) { .da-wiz-opts { grid-template-columns: 1fr; } }

.da-wiz-opt {
    position: relative;
    display: block;
    border: 1.5px solid #d6e2f0;
    border-radius: 8px;
    padding: .7rem .9rem;
    cursor: pointer;
    background: #fff;
    transition: border-color .15s, background .15s, box-shadow .15s;
    -webkit-user-select: none; user-select: none;
}
.da-wiz-opt:hover { border-color: #A2C3E2; background: #f8fbff; }
.da-wiz-opt input { position: absolute; opacity: 0; width: 0; height: 0; }
.da-wiz-opt-title { display: block; font-weight: 600; color: #1a1a1a; font-size: .95em; }
.da-wiz-opt-sub   { display: block; color: #888; font-size: .82em; margin-top: .15em; }
.da-wiz-opt-selected {
    border-color: #1B3A5C;
    background: #eef4fb;
    box-shadow: inset 0 0 0 1px #1B3A5C;
}
.da-wiz-opt-selected .da-wiz-opt-title { color: #1B3A5C; }

/* Inputs/selects inside the wizard reuse the Step 2 field look */
#da-wizard .da-field select,
#da-wizard .da-field input {
    width: 100%; box-sizing: border-box;
    border: 1px solid #ccd9e8; border-radius: 6px;
    padding: .55em .7em; font-family: inherit; font-size: .95em;
    color: #1a1a1a; background: #fff;
}
#da-wizard .da-field select:focus,
#da-wizard .da-field input:focus { outline: 2px solid #A2C3E2; border-color: transparent; }
#da-wizard .da-field-row { margin-top: .6rem; }

/* Navigation */
.da-wiz-nav {
    display: flex; align-items: center; justify-content: space-between;
    gap: .75rem; margin-top: 1.75rem;
    border-top: 1px solid #eef2f7; padding-top: 1.1rem;
}
.da-wiz-nav-right { display: flex; gap: .6rem; flex-wrap: wrap; }
.da-wiz-exit { text-align: center; margin: .9rem 0 0; }
.da-wiz-exit a { color: #999; font-size: .82em; text-decoration: underline; }
.da-wiz-exit a:hover { color: #1B3A5C; }
.da-wiz-error { color: #c0392b; font-size: .85em; margin: .5rem 0 0; }

/* ── v1.50 Requestor header bar ──────────────────────────────────────────── */
.da-requestor-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    background: #1B3A5C;
    color: #fff;
    border-radius: 8px;
    padding: .6rem 1rem;
    margin-bottom: 1.25rem;
}
.da-rq-id strong { display: block; font-size: .95em; }
.da-rq-email { font-size: .82em; color: #c8ddf5; }
.da-rq-quota { text-align: right; }
.da-rq-count { display: block; font-weight: 700; font-size: .95em; }
.da-rq-count #da-quotes-left { font-size: 1.15em; }
.da-rq-type { font-size: .78em; color: #c8ddf5; text-transform: uppercase; letter-spacing: .04em; }
@media (max-width: 480px) {
    .da-requestor-bar { flex-direction: column; align-items: flex-start; }
    .da-rq-quota { text-align: left; }
}
