/**
 * AI Handoff Styles — Document Checker
 *
 * Scoped namespace: .docac-aih
 * Matches Web Checker design. Uses !important on text colors to defeat
 * inherited global CSS that may bleach contrast.
 *
 * @version 1.0.0
 */

/* ============================================================================
   HOST (placeholder until JS hydrates)
   ============================================================================ */
.docac-aih[hidden] { display: none; }
.docac-aih {
    margin: 24px 0;
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: #ffffff !important;
    opacity: 1 !important;
}
.docac-aih * {
    /* Defeat any inherited text-shadow / filter from host report CSS */
    text-shadow: none !important;
    filter: none !important;
}

/* ============================================================================
   CARD — Dark Inside
   ============================================================================ */
.docac-aih__card {
    background: #1a2234 !important;
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: 8px;
    border-top: 4px solid #dc2626;
    padding: 28px;
    box-shadow: 0 12px 32px rgba(0,0,0,0.25), 0 4px 8px rgba(0,0,0,0.12);
    color: #ffffff !important;
}

/* ============================================================================
   HEADER
   ============================================================================ */
.docac-aih__head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 22px;
}
.docac-aih__head-left {
    flex: 1;
    min-width: 240px;
}

.docac-aih__badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 100px;
    background: rgba(220, 38, 38, 0.22) !important;
    color: #fecaca !important;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 12px;
    border: 1px solid rgba(220, 38, 38, 0.45);
}
.docac-aih__badge--in-modal {
    margin-bottom: 14px;
}
.docac-aih__badge svg {
    color: currentColor;
}

.docac-aih__title {
    font-size: 22px !important;
    font-weight: 700 !important;
    margin: 0 0 8px !important;
    letter-spacing: -0.01em;
    color: #ffffff !important;
    line-height: 1.25 !important;
    opacity: 1 !important;
}
.docac-aih__sub {
    font-size: 14px !important;
    line-height: 1.55 !important;
    color: rgba(255,255,255,0.85) !important;
    margin: 0 !important;
    opacity: 1 !important;
}

.docac-aih__info {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 40px;
    padding: 0 14px;
    border: 1px solid rgba(255,255,255,0.22);
    border-radius: 10px;
    background: rgba(255,255,255,0.06);
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: #ffffff !important;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}
.docac-aih__info:hover {
    border-color: rgba(255,255,255,0.45);
    background: rgba(255,255,255,0.12);
}
.docac-aih__info:focus-visible {
    outline: 3px solid #dc2626;
    outline-offset: 2px;
}

/* ============================================================================
   CONTROLS
   ============================================================================ */
.docac-aih__controls {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 18px;
}
.docac-aih__control {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.docac-aih__control-label {
    font-size: 11px !important;
    font-weight: 700 !important;
    color: rgba(255,255,255,0.75) !important;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    opacity: 1 !important;
}
.docac-aih__select,
.docac-aih__input {
    min-height: 44px;
    padding: 0 12px;
    padding-right: 32px;
    border: 1px solid rgba(255,255,255,0.22);
    border-radius: 10px;
    background: rgba(0,0,0,0.32) !important;
    color: #ffffff !important;
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 14px;
    appearance: none;
    -webkit-appearance: none;
    opacity: 1 !important;
}
.docac-aih__select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8' fill='none' stroke='%23ffffff' stroke-width='2'%3E%3Cpolyline points='1,1 6,6 11,1'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 10px 8px;
}
.docac-aih__input {
    padding-right: 12px;
}
.docac-aih__select:focus-visible,
.docac-aih__input:focus-visible {
    outline: 3px solid #dc2626;
    outline-offset: 2px;
    border-color: rgba(255,255,255,0.4);
}
.docac-aih__select option {
    color: #1a2234;
    background: #fff;
}

.docac-aih__meta-wrap {
    display: flex;
    align-items: flex-end;
}
.docac-aih__meta {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 12px;
    font-size: 12px;
    color: rgba(255,255,255,0.88) !important;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.14);
    border-radius: 10px;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}

/* ============================================================================
   PREVIEW
   ============================================================================ */
.docac-aih__preview {
    background: rgba(0,0,0,0.32);
    border: 1px solid rgba(255,255,255,0.14);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 18px;
}
.docac-aih__preview summary {
    cursor: pointer;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 600;
    color: #ffffff !important;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 44px;
    gap: 14px;
}
.docac-aih__preview summary::-webkit-details-marker {
    display: none;
}
.docac-aih__preview summary::after {
    content: "+";
    font-size: 20px;
    color: rgba(255,255,255,0.85);
    flex-shrink: 0;
    transition: transform 0.2s ease;
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
.docac-aih__preview[open] summary::after {
    transform: rotate(45deg);
}
.docac-aih__preview summary:focus-visible {
    outline: 3px solid #dc2626;
    outline-offset: -3px;
}
.docac-aih__preview-hint {
    font-weight: 400;
    color: rgba(255,255,255,0.7) !important;
    font-size: 12px;
}
.docac-aih__preview-body {
    padding: 0 14px 14px;
}
.docac-aih__pre {
    margin: 0;
    padding: 14px;
    background: #0b1120;
    color: #ffffff !important;
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: 6px;
    font-family: 'Space Mono', monospace;
    font-size: 12.5px;
    line-height: 1.55;
    overflow: auto;
    max-height: 280px;
    white-space: pre-wrap;
    word-break: break-word;
}

/* ============================================================================
   ACTIONS
   ============================================================================ */
.docac-aih__actions {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 14px;
}
.docac-aih__sep {
    font-size: 13px;
    color: rgba(255,255,255,0.75) !important;
}
.docac-aih__spacer {
    flex: 1 1 auto;
    min-width: 0;
}

.docac-aih__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 20px;
    border: none;
    border-radius: 10px;
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
    color: #ffffff !important;
}
.docac-aih__btn--primary {
    background: linear-gradient(135deg, #dc2626, #ef4444) !important;
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.35);
}
.docac-aih__btn--primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(220, 38, 38, 0.45);
}
.docac-aih__btn--primary:active {
    transform: translateY(0);
}

.docac-aih__btn--pdf {
    background: linear-gradient(135deg, #1e5f99, #2563eb) !important;
    box-shadow: 0 2px 8px rgba(30, 95, 153, 0.35);
}
.docac-aih__btn--pdf:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(30, 95, 153, 0.45);
}
.docac-aih__btn--pdf:active {
    transform: translateY(0);
}

.docac-aih__btn:focus-visible {
    outline: 3px solid #fff;
    outline-offset: 3px;
}

.docac-aih__providers {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.docac-aih__provider {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 14px;
    border: 1px solid rgba(255,255,255,0.24);
    border-radius: 10px;
    background: rgba(255,255,255,0.06);
    color: #ffffff !important;
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}
.docac-aih__provider:hover {
    border-color: rgba(255,255,255,0.5);
    background: rgba(255,255,255,0.12);
    transform: translateY(-1px);
}
.docac-aih__provider:focus-visible {
    outline: 3px solid #dc2626;
    outline-offset: 2px;
}
.docac-aih__provider-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 0 0 2px rgba(255,255,255,0.08);
}
.docac-aih__provider-dot--chatgpt {
    background: #10a37f;
}
.docac-aih__provider-dot--claude {
    background: #d97757;
}
.docac-aih__provider-dot--gemini {
    background: #4285f4;
}
.docac-aih__provider-dot--perplexity {
    background: #20808d;
}

/* ============================================================================
   STATUS + TIP
   ============================================================================ */
.docac-aih__status {
    font-size: 13px;
    color: rgba(255,255,255,0.85) !important;
    margin-bottom: 14px;
    padding: 6px 0;
    min-height: 22px;
    font-weight: 500;
}
.docac-aih__status[data-state="copied"] {
    color: #86efac !important;
    font-weight: 600;
}

.docac-aih__tip {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 12px 14px;
    background: rgba(30, 95, 153, 0.22);
    border-left: 3px solid #2563eb;
    border-radius: 10px;
}
.docac-aih__tip-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #93c5fd;
}
.docac-aih__tip p {
    margin: 0 !important;
    font-size: 13px !important;
    line-height: 1.55 !important;
    color: rgba(255,255,255,0.92) !important;
    opacity: 1 !important;
}
.docac-aih__tip strong {
    color: #ffffff !important;
    font-weight: 700;
}

/* ============================================================================
   MODAL
   ============================================================================ */
.docac-aih__modal[hidden] {
    display: none;
}
.docac-aih__modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.docac-aih__modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    cursor: pointer;
}
.docac-aih__modal-body {
    position: relative;
    z-index: 1;
    background: #1a2234;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 12px;
    padding: 32px;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
}
.docac-aih__modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: rgba(255,255,255,0.7);
    cursor: pointer;
    transition: all 0.2s ease;
}
.docac-aih__modal-close:hover {
    color: #ffffff;
}
.docac-aih__modal-close:focus-visible {
    outline: 3px solid #dc2626;
    outline-offset: 2px;
}

.docac-aih__modal-title {
    font-size: 24px !important;
    font-weight: 700 !important;
    margin: 0 0 12px !important;
    color: #ffffff !important;
    line-height: 1.25 !important;
}
.docac-aih__modal-desc {
    font-size: 15px !important;
    line-height: 1.6 !important;
    color: rgba(255,255,255,0.85) !important;
    margin: 0 0 20px !important;
}

.docac-aih__steps {
    list-style: none;
    margin: 0 0 20px !important;
    padding: 0 !important;
}
.docac-aih__steps li {
    display: flex;
    gap: 14px;
    margin-bottom: 18px;
}
.docac-aih__steps li:last-child {
    margin-bottom: 0;
}
.docac-aih__step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    min-height: 32px;
    background: rgba(220, 38, 38, 0.2);
    border: 1px solid rgba(220, 38, 38, 0.4);
    border-radius: 50%;
    color: #fecaca;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
}
.docac-aih__steps h4 {
    font-size: 16px !important;
    font-weight: 700 !important;
    margin: 0 0 6px !important;
    color: #ffffff !important;
}
.docac-aih__steps p {
    font-size: 14px !important;
    line-height: 1.55 !important;
    color: rgba(255,255,255,0.85) !important;
    margin: 0 !important;
}

.docac-aih__divider {
    height: 1px;
    background: rgba(255,255,255,0.1);
    margin: 20px 0;
}

.docac-aih__modal-subhead {
    font-size: 16px !important;
    font-weight: 700 !important;
    margin: 0 0 12px !important;
    color: #ffffff !important;
}
.docac-aih__modal-list {
    list-style: none;
    margin: 0 0 20px !important;
    padding: 0 !important;
}
.docac-aih__modal-list li {
    font-size: 14px !important;
    line-height: 1.6 !important;
    color: rgba(255,255,255,0.85) !important;
    margin-bottom: 10px;
    padding-left: 24px !important;
    position: relative;
}
.docac-aih__modal-list li:before {
    content: "•";
    position: absolute;
    left: 0;
    color: #fecaca;
    font-weight: 700;
}

.docac-aih__privacy {
    font-size: 13px !important;
    line-height: 1.55 !important;
    color: rgba(255,255,255,0.75) !important;
    margin: 0 0 20px !important;
    font-style: italic;
}

.docac-aih__modal-foot {
    display: flex;
    gap: 12px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

/* ============================================================================
   Responsive
   ============================================================================ */
@media (max-width: 768px) {
    .docac-aih__controls {
        grid-template-columns: repeat(2, 1fr);
    }
    .docac-aih__modal-body {
        padding: 24px;
        max-width: calc(100vw - 48px);
    }
}

@media (max-width: 640px) {
    .docac-aih__card {
        padding: 20px;
    }
    .docac-aih__head {
        flex-direction: column;
        gap: 12px;
    }
    .docac-aih__controls {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    .docac-aih__actions {
        flex-direction: column;
    }
    .docac-aih__btn,
    .docac-aih__provider {
        width: 100%;
    }
    .docac-aih__providers {
        justify-content: stretch;
    }
}