/* ==========================================================================
   [sic] Erat Scriptum — Standalone Stylesheet
   Light professional theme matching sic.reflectai.systems mode
   ========================================================================== */

:root {
    --sic-bg: #f0f2f5;
    --sic-surface: #f8fafc;
    --sic-surface-2: #f1f5f9;
    --sic-border: #d1d5db;
    --sic-text: #1f2937;
    --sic-text-dim: #4e5b6e;
    --sic-text-muted: #707c8e;
    --sic-accent: #4e5b6e;
    --sic-accent-dim: #333f50;
    --sic-red: #dc2626;
    --sic-danger: #A85951;
    --sic-danger-hover: #925046;
    --sic-orange: #d97706;
    --sic-radius: 6px;
    --sic-max-width: 900px;
}

/* -- Reset & Base -------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }

body {
    margin: 0;
    padding: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--sic-bg);
    color: var(--sic-text);
    line-height: 1.6;
    font-size: 15px;
}

a { color: var(--sic-accent); text-decoration: none; }
a:hover { text-decoration: underline; }

code {
    font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
    font-size: 0.9em;
    background: var(--sic-surface-2);
    padding: 2px 6px;
    border-radius: 3px;
    color: var(--sic-accent-dim);
}

/* -- Container ----------------------------------------------------------- */

.sic-container {
    max-width: var(--sic-max-width);
    margin: 0 auto;
    padding: 40px 24px;
}

/* -- Header -------------------------------------------------------------- */

.sic-header {
    text-align: center;
    margin-bottom: 40px;
}

.sic-header-compact {
    margin-bottom: 24px;
    text-align: left;
}

.sic-logo-img {
    height: 140px;
    width: auto;
}

.sic-logo-img-sm {
    height: 80px;
    width: auto;
}

.sic-logo-link { text-decoration: none !important; }

.sic-tagline {
    color: var(--sic-text-dim);
    font-size: 14px;
    margin-top: 8px;
}

/* -- Landing page intro animation (scoped to .sic-landing) --------------- */

@keyframes sicFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.sic-landing .sic-logo-img {
    opacity: 0;
    animation: sicFadeIn 0.8s ease-in forwards;
}

.sic-landing .sic-tagline {
    opacity: 0;
    transition: opacity 1s ease-in;
}

.sic-landing .sic-learn-more-toggle {
    opacity: 0;
    transition: opacity 0.6s ease-in;
}

.sic-landing .sic-main-content,
.sic-landing .sic-footer {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

.sic-landing .sic-main-content.sic-visible,
.sic-landing .sic-footer.sic-visible {
    opacity: 1;
    transform: translateY(0);
}

/* -- Learn More (expandable) --------------------------------------------- */

.sic-learn-more-toggle {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    color: var(--sic-accent);
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
    padding: 0;
    margin-top: 6px;
}
.sic-learn-more-toggle:hover { text-decoration: underline; }

.sic-learn-more-arrow {
    font-size: 10px;
    transition: transform 0.2s;
}
.sic-learn-more-toggle.expanded .sic-learn-more-arrow {
    transform: rotate(180deg);
}

.sic-learn-more {
    background: #ffffff;
    border: 1px solid var(--sic-border);
    border-radius: 8px;
    padding: 24px 28px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    margin-bottom: 24px;
}

.sic-learn-more-inner p {
    font-size: 14px;
    color: var(--sic-text-dim);
    line-height: 1.7;
    margin: 0 0 12px;
}

.sic-learn-more-inner h3 {
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--sic-text-muted);
    margin: 20px 0 12px;
}

.sic-learn-more-inner ol {
    list-style: none;
    padding: 0;
    margin: 0;
    counter-reset: steps;
}
.sic-learn-more-inner ol li {
    font-size: 14px;
    color: var(--sic-text-dim);
    line-height: 1.7;
    margin-bottom: 10px;
    padding-left: 28px;
    position: relative;
}
.sic-learn-more-inner ol li::before {
    counter-increment: steps;
    content: counter(steps);
    position: absolute;
    left: 0;
    font-weight: 600;
    color: var(--sic-text-muted);
}
.sic-learn-more-inner ol li strong {
    color: var(--sic-text);
}

/* -- Landing card -------------------------------------------------------- */

.sic-landing #sic-form {
    background: #ffffff;
    border: 1px solid var(--sic-border);
    border-radius: 8px;
    padding: 28px 28px 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.sic-landing .sic-pricing {
    background: #ffffff;
    border: 1px solid var(--sic-border);
    border-radius: 8px;
    padding: 24px 28px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

/* -- Form ---------------------------------------------------------------- */

.sic-label {
    display: block;
    color: var(--sic-text-dim);
    font-size: 13px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.sic-input-section { margin-bottom: 20px; }

.sic-textarea-wrap { position: relative; }

#sic-text {
    width: 100%;
    min-height: 200px;
    padding: 14px;
    background: #ffffff;
    border: 1px solid var(--sic-border);
    border-radius: var(--sic-radius);
    color: var(--sic-text);
    font-size: 14px;
    font-family: inherit;
    line-height: 1.6;
    resize: vertical;
}

#sic-text:focus {
    outline: none;
    border-color: var(--sic-accent);
    box-shadow: 0 0 0 2px rgba(78, 91, 110, 0.15);
}

#sic-text::placeholder { color: var(--sic-text-muted); }

.sic-word-count {
    position: absolute;
    bottom: 10px;
    right: 14px;
    font-size: 12px;
    color: var(--sic-text-muted);
}

/* -- Upload Zone --------------------------------------------------------- */

.sic-upload-section { margin-bottom: 20px; }

.sic-upload-zone {
    border: 2px dashed var(--sic-border);
    border-radius: var(--sic-radius);
    padding: 20px;
    text-align: center;
    transition: border-color 0.2s;
    cursor: pointer;
}

.sic-upload-zone:hover,
.sic-upload-zone.sic-drag-over {
    border-color: var(--sic-accent);
}

.sic-upload-prompt {
    color: var(--sic-text-dim);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.sic-upload-prompt svg { opacity: 0.5; }

.sic-upload-btn {
    background: none;
    border: none;
    color: var(--sic-accent);
    cursor: pointer;
    font-size: inherit;
    text-decoration: underline;
    padding: 0;
}

.sic-upload-formats {
    font-size: 12px;
    color: var(--sic-text-muted);
}

.sic-upload-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 4px;
}

.sic-upload-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: #ffffff;
    border: 1px solid var(--sic-border);
    border-radius: 4px;
    font-size: 14px;
    color: var(--sic-text);
    cursor: default;
    transition: box-shadow 0.15s;
}

.sic-upload-item.sic-dragging {
    opacity: 0.4;
}

.sic-upload-item.sic-drag-above {
    box-shadow: 0 -2px 0 0 var(--sic-accent);
}

.sic-upload-item.sic-drag-below {
    box-shadow: 0 2px 0 0 var(--sic-accent);
}

.sic-upload-drag-handle {
    cursor: grab;
    color: var(--sic-text-muted);
    font-size: 14px;
    user-select: none;
    padding: 0 2px;
}

.sic-upload-drag-handle:active { cursor: grabbing; }

.sic-upload-item-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sic-upload-item-words {
    color: var(--sic-text-muted);
    font-size: 13px;
}

.sic-upload-remove {
    background: none;
    border: none;
    color: var(--sic-text-dim);
    font-size: 18px;
    cursor: pointer;
    padding: 0 4px;
    flex-shrink: 0;
}

.sic-upload-add-more {
    background: none;
    border: 1px dashed var(--sic-border);
    border-radius: 4px;
    padding: 6px 12px;
    font-size: 13px;
    color: var(--sic-text-muted);
    cursor: pointer;
    font-family: inherit;
    transition: border-color 0.2s, color 0.2s;
}

.sic-upload-add-more:hover {
    border-color: var(--sic-accent);
    color: var(--sic-accent);
}

.sic-upload-progress {
    height: 3px;
    background: var(--sic-surface-2);
    border-radius: 2px;
    margin-top: 8px;
    overflow: hidden;
}

.sic-upload-progress-bar {
    height: 100%;
    background: var(--sic-accent);
    transition: width 0.3s;
    width: 0;
}

/* -- Code Input ---------------------------------------------------------- */

.sic-code-section { margin-bottom: 24px; }

#sic-code {
    width: 100%;
    padding: 10px 14px;
    background: #ffffff;
    border: 1px solid var(--sic-border);
    border-radius: var(--sic-radius);
    color: var(--sic-text);
    font-size: 14px;
    font-family: 'SF Mono', 'Fira Code', monospace;
}

#sic-code:focus {
    outline: none;
    border-color: var(--sic-accent);
    box-shadow: 0 0 0 2px rgba(78, 91, 110, 0.15);
}

#sic-code::placeholder { color: var(--sic-text-muted); }

/* -- Submit -------------------------------------------------------------- */

.sic-submit-section { margin-bottom: 32px; }

.sic-submit-btn {
    width: 100%;
    padding: 14px;
    background: var(--sic-accent);
    color: #ffffff;
    border: none;
    border-radius: var(--sic-radius);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.sic-submit-btn:hover { background: var(--sic-accent-dim); }
.sic-submit-btn:disabled { opacity: 0.4; cursor: default; }

.sic-submit-error {
    color: var(--sic-red);
    font-size: 14px;
    margin-top: 10px;
    text-align: center;
}

/* -- Error --------------------------------------------------------------- */

.sic-error {
    background: rgba(220, 38, 38, 0.06);
    border: 1px solid var(--sic-red);
    border-radius: var(--sic-radius);
    padding: 14px 18px;
    color: var(--sic-red);
    margin-bottom: 20px;
}

/* -- Progress ------------------------------------------------------------ */

.sic-progress {
    text-align: center;
    padding: 40px 0;
}

.sic-progress-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 8px;
}

.sic-progress-subtitle {
    color: var(--sic-text-dim);
    font-size: 14px;
    margin-bottom: 32px;
}

.sic-stages {
    display: flex;
    justify-content: center;
    gap: 32px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.sic-stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--sic-text-muted);
    transition: color 0.3s;
}

.sic-stage-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--sic-surface-2);
    border: 2px solid var(--sic-border);
    transition: all 0.3s;
}

.sic-stage.active .sic-stage-dot {
    background: var(--sic-accent);
    border-color: var(--sic-accent);
    box-shadow: 0 0 8px rgba(78, 91, 110, 0.4);
    animation: sic-pulse 1.5s ease-in-out infinite;
}

.sic-stage.active { color: var(--sic-text); }

.sic-stage.done .sic-stage-dot {
    background: #829696;
    border-color: #829696;
}

.sic-stage.done { color: var(--sic-text-dim); }

@keyframes sic-pulse {
    0%, 100% {
        box-shadow: 0 0 4px rgba(78, 91, 110, 0.25);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 14px rgba(78, 91, 110, 0.5);
        transform: scale(1.3);
    }
}

.sic-progress-message {
    color: var(--sic-text-dim);
    font-size: 14px;
    min-height: 20px;
}

.sic-progress-timer {
    color: var(--sic-text-muted);
    font-size: 13px;
    font-variant-numeric: tabular-nums;
    margin-top: 8px;
    letter-spacing: 0.5px;
}

.sic-progress-estimate {
    color: var(--sic-text-muted);
    font-size: 13px;
    margin-top: 6px;
}

/* -- Stop Button --------------------------------------------------------- */

.sic-stop-btn {
    margin-top: 20px;
    padding: 8px 20px;
    background: none;
    border: 1px solid var(--sic-border);
    border-radius: var(--sic-radius);
    color: var(--sic-text-dim);
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s;
}

.sic-stop-btn:hover {
    border-color: var(--sic-danger);
    color: var(--sic-danger);
}

.sic-stop-btn:disabled {
    opacity: 0.5;
    cursor: default;
}

/* -- Stop Confirmation Modal --------------------------------------------- */

.sic-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}
.sic-modal-backdrop[hidden] { display: none; }

.sic-modal {
    background: #ffffff;
    border: 1px solid var(--sic-border);
    border-radius: var(--sic-radius);
    padding: 28px 32px 24px;
    max-width: 420px;
    width: 90%;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.sic-modal h3 {
    margin: 0 0 12px;
    font-size: 17px;
    font-weight: 600;
}

.sic-modal-body {
    font-size: 14px;
    color: var(--sic-text-dim);
    line-height: 1.6;
    margin: 0 0 24px;
}

.sic-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.sic-modal-cancel {
    padding: 8px 18px;
    font-size: 14px;
    border: 1px solid var(--sic-border);
    border-radius: var(--sic-radius);
    background: #ffffff;
    color: var(--sic-text-dim);
    cursor: pointer;
}
.sic-modal-cancel:hover {
    border-color: var(--sic-accent);
    color: var(--sic-text);
}

.sic-modal-confirm {
    padding: 8px 18px;
    font-size: 14px;
    border: 1px solid var(--sic-danger);
    border-radius: var(--sic-radius);
    background: var(--sic-danger);
    color: #ffffff;
    cursor: pointer;
    font-weight: 500;
}
.sic-modal-confirm:hover {
    background: var(--sic-danger-hover);
    border-color: var(--sic-danger-hover);
}

/* -- Stopped Section ----------------------------------------------------- */

.sic-stopped-section[hidden] {
    display: none;
}
.sic-stopped-section {
    display: flex;
    justify-content: center;
    padding: 40px 0;
}

.sic-stopped-card {
    background: #ffffff;
    border: 1px solid var(--sic-border);
    border-radius: 8px;
    padding: 36px 32px;
    max-width: 460px;
    width: 100%;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.sic-stopped-card h2 {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 12px;
    color: var(--sic-text);
}

.sic-stopped-desc {
    font-size: 14px;
    color: var(--sic-text-dim);
    line-height: 1.6;
    margin: 0 0 20px;
}

.sic-credit-box {
    background: var(--sic-surface);
    border: 1px solid var(--sic-border);
    border-radius: var(--sic-radius);
    padding: 20px;
    margin-bottom: 4px;
}

.sic-credit-label {
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--sic-text-muted);
    margin-bottom: 8px;
}

.sic-credit-code {
    font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
    font-size: 22px;
    font-weight: 600;
    color: var(--sic-text);
    letter-spacing: 1px;
    margin-bottom: 4px;
    user-select: all;
}

.sic-credit-amount {
    font-size: 14px;
    color: var(--sic-text-dim);
    margin-bottom: 12px;
}

.sic-credit-copy {
    padding: 6px 16px;
    background: none;
    border: 1px solid var(--sic-border);
    border-radius: var(--sic-radius);
    color: var(--sic-text-dim);
    font-size: 12px;
    font-family: inherit;
    cursor: pointer;
    transition: border-color 0.2s;
}

.sic-credit-copy:hover {
    border-color: var(--sic-accent);
    color: var(--sic-accent);
}

/* -- Results ------------------------------------------------------------- */

.sic-result { margin-bottom: 32px; }

/* -- Report (R1-R4 narrative) ------------------------------------------- */

.sic-report-title {
    font-size: 22px;
    font-weight: 600;
    line-height: 1.4;
    color: var(--sic-text);
    margin: 0 0 28px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--sic-border);
}

.sic-report-section {
    margin-bottom: 8px;
    border: 1px solid var(--sic-border);
    border-radius: var(--sic-radius);
    background: #ffffff;
    overflow: hidden;
}

.sic-report-section-title {
    font-size: 16px;
    font-weight: 600;
    padding: 14px 18px;
    margin: 0;
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--sic-text);
}

.sic-report-section-title::before {
    content: '\25BE';
    font-size: 12px;
    color: var(--sic-text-dim);
    transition: transform 0.2s;
}

.sic-report-section.collapsed .sic-report-section-title::before {
    transform: rotate(-90deg);
}

.sic-report-section-body {
    padding: 0 20px 20px;
}

.sic-report-section.collapsed .sic-report-section-body {
    display: none;
}

.sic-report-narrative {
    font-size: 15px;
    line-height: 1.75;
    color: var(--sic-text);
}

.sic-report-narrative p {
    margin: 0 0 14px;
}

.sic-report-narrative p:last-child {
    margin-bottom: 0;
}

.sic-report-narrative strong {
    font-weight: 600;
}

.sic-seg-ref {
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 0.85em;
    color: var(--sic-text-muted);
    cursor: pointer;
    border-bottom: 1px dotted var(--sic-text-muted);
    transition: color 0.15s;
}

.sic-seg-ref:hover,
.sic-seg-ref-active {
    color: var(--sic-accent);
    border-bottom-color: var(--sic-accent);
}

/* -- Segment Popover ----------------------------------------------------- */

.sic-popover {
    position: fixed;
    z-index: 1000;
    max-width: 440px;
    min-width: 260px;
    background: #ffffff;
    border: 1px solid var(--sic-border);
    border-radius: var(--sic-radius);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
    padding: 14px 16px;
    animation: sic-popover-in 0.15s ease-out;
}

@keyframes sic-popover-in {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}

.sic-popover-seg + .sic-popover-seg {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--sic-border);
}

.sic-popover-text {
    font-size: 14px;
    line-height: 1.6;
    color: var(--sic-text);
    white-space: pre-line;
}

.sic-popover-pinned {
    box-shadow: 0 6px 28px rgba(0, 0, 0, 0.18);
    border-color: var(--sic-accent);
}

.sic-popover-actions {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid var(--sic-border);
    text-align: center;
}

.sic-popover-context-btn {
    font-size: 12px;
    color: var(--sic-accent);
    background: none;
    border: none;
    cursor: pointer;
    font-weight: 500;
    padding: 0;
}

.sic-popover-context-btn:hover {
    text-decoration: underline;
}

/* Close button: hidden on desktop, visible on mobile */
.sic-popover-close {
    display: none;
}

/* Mobile: full-screen citation modal */
.sic-popover-backdrop {
    display: none;
}

@media (max-width: 600px) {
    .sic-popover-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 999;
        background: rgba(0, 0, 0, 0.4);
    }
    .sic-popover {
        position: fixed;
        inset: 0;
        max-width: none;
        min-width: 0;
        border-radius: 0;
        border: none;
        box-shadow: none;
        padding: 20px;
        padding-top: 48px;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        animation: sic-popover-slide-up 0.2s ease-out;
    }
    @keyframes sic-popover-slide-up {
        from { transform: translateY(100%); }
        to   { transform: translateY(0); }
    }
    .sic-popover-close {
        display: block;
        position: absolute;
        top: 12px;
        right: 16px;
        width: 32px;
        height: 32px;
        font-size: 22px;
        line-height: 32px;
        text-align: center;
        background: none;
        border: none;
        color: var(--sic-text-dim);
        cursor: pointer;
        padding: 0;
    }
    .sic-popover-text {
        font-size: 15px;
        line-height: 1.7;
    }
    .sic-popover-context-btn {
        font-size: 14px;
        padding: 10px 0;
    }
}

.sic-report-subsection {
    margin-top: 20px;
}

.sic-report-subsection:first-child {
    margin-top: 0;
}

.sic-report-sub-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--sic-accent-dim);
    margin: 0 0 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(209, 213, 219, 0.5);
}

.sic-disclaimer {
    background: var(--sic-surface);
    border-left: 3px solid var(--sic-border);
    padding: 12px 16px;
    font-size: 12px;
    color: var(--sic-text-dim);
    margin-top: 32px;
    margin-bottom: 8px;
    border-radius: 0 var(--sic-radius) var(--sic-radius) 0;
    line-height: 1.6;
}

/* -- Floating Back Button ------------------------------------------------ */

.sic-float-back[hidden] {
    display: none;
}
.sic-float-back {
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 900;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: #ffffff;
    border: 1px solid var(--sic-border);
    border-radius: 20px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 16px;
    font-weight: 500;
    color: var(--sic-text);
    text-decoration: none;
    transition: opacity 0.2s, transform 0.2s;
    animation: sic-float-in 0.2s ease-out;
}
.sic-float-back:hover {
    box-shadow: 0 3px 16px rgba(0, 0, 0, 0.15);
}
@keyframes sic-float-in {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* -- Dim Text ------------------------------------------------------------ */

.sic-dim { color: var(--sic-text-dim); font-size: 13px; }

/* -- Buttons ------------------------------------------------------------- */

.sic-btn {
    display: inline-block;
    padding: 10px 24px;
    background: #ffffff;
    border: 1px solid var(--sic-border);
    border-radius: var(--sic-radius);
    color: var(--sic-text);
    font-size: 14px;
    cursor: pointer;
    text-decoration: none !important;
    transition: border-color 0.2s;
}

.sic-btn:hover { border-color: var(--sic-accent); }
.sic-btn-secondary { opacity: 0.5; font-size: 13px; }
.sic-btn-secondary:hover { opacity: 0.8; }

/* -- Error Section ------------------------------------------------------- */

.sic-error-section {
    text-align: center;
    padding: 40px 0;
}

.sic-error-section .sic-error {
    display: inline-block;
    margin-bottom: 20px;
}
.sic-error-contact {
    margin-top: 16px;
    font-size: 13px;
    color: var(--sic-muted);
}
.sic-error-contact a { color: var(--sic-muted); }

/* -- Another ------------------------------------------------------------- */

.sic-another {
    text-align: center;
    padding: 24px 0;
    border-top: 1px solid var(--sic-border);
    margin-top: 24px;
}

/* -- Footer -------------------------------------------------------------- */

/* -- Legal Pages --------------------------------------------------------- */

.sic-header-compact {
    text-align: center;
    padding: 24px 0 16px;
}

.sic-legal-home {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 28px;
    font-weight: 500;
    color: var(--sic-text);
    text-decoration: none;
}

.sic-legal-home:hover {
    opacity: 0.7;
}

.sic-legal {
    max-width: 680px;
    margin: 0 auto;
    padding: 0 0 40px;
}

.sic-legal h2 {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 28px;
    font-weight: 500;
    margin: 0 0 4px;
    color: var(--sic-text);
}

.sic-legal-updated {
    font-size: 13px;
    color: var(--sic-text-muted);
    margin: 0 0 32px;
}

.sic-legal h3 {
    font-size: 15px;
    font-weight: 600;
    margin: 28px 0 8px;
    color: var(--sic-text);
}

.sic-legal p {
    font-size: 14px;
    line-height: 1.7;
    color: var(--sic-text-dim);
    margin: 0 0 12px;
}

.sic-legal ul {
    margin: 0 0 12px;
    padding-left: 20px;
}

.sic-legal li {
    font-size: 14px;
    line-height: 1.7;
    color: var(--sic-text-dim);
    margin-bottom: 4px;
}

.sic-legal a {
    color: var(--sic-accent);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.sic-legal a:hover {
    color: var(--sic-text);
}

/* -- Footer -------------------------------------------------------------- */

.sic-footer {
    text-align: center;
    padding-top: 32px;
    color: var(--sic-text-muted);
    font-size: 13px;
}

.sic-footer a {
    color: var(--sic-text-muted);
    text-decoration: none;
}

.sic-footer a:hover {
    color: var(--sic-text-dim);
}

/* -- Responsive ---------------------------------------------------------- */

@media (max-width: 640px) {
    .sic-container { padding: 24px 16px; }
    .sic-logo-img { height: 100px; }
    .sic-stages { gap: 16px; }
    .sic-stage { font-size: 12px; }

}

/* -- Pricing ------------------------------------------------------------- */

.sic-pricing {
    border-top: 1px solid var(--sic-border);
    margin-top: 24px;
    padding-top: 24px;
}

.sic-pricing h2 {
    text-align: center;
    font-size: 16px;
    font-weight: 600;
    color: var(--sic-text-dim);
    margin: 0 0 16px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sic-tiers {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.sic-tier {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid rgba(209, 213, 219, 0.5);
    font-size: 14px;
}

.sic-tier:last-child { border-bottom: none; }

.sic-tier-label { color: var(--sic-text-dim); }

.sic-tier-price {
    color: var(--sic-accent-dim);
    font-weight: 600;
}

.sic-pricing-note {
    font-size: 12px;
    color: var(--sic-text-muted);
    text-align: center;
    margin-top: 12px;
}

/* -- Email Input --------------------------------------------------------- */

.sic-email-section { margin-bottom: 20px; }

#sic-email {
    width: 100%;
    padding: 10px 14px;
    background: #ffffff;
    border: 1px solid var(--sic-border);
    border-radius: var(--sic-radius);
    color: var(--sic-text);
    font-size: 14px;
    font-family: inherit;
}

#sic-email:focus {
    outline: none;
    border-color: var(--sic-accent);
    box-shadow: 0 0 0 2px rgba(78, 91, 110, 0.15);
}

#sic-email::placeholder { color: var(--sic-text-muted); }

.sic-label-note {
    font-weight: 400;
    color: var(--sic-text-muted);
    text-transform: none;
    letter-spacing: 0;
}

/* -- Submit price -------------------------------------------------------- */

#sic-submit-price {
    margin-left: 6px;
}

/* -- Cancelled message --------------------------------------------------- */

.sic-info {
    background: rgba(78, 91, 110, 0.06);
    border: 1px solid var(--sic-border);
    border-radius: var(--sic-radius);
    padding: 14px 18px;
    color: var(--sic-text-dim);
    margin-bottom: 20px;
    text-align: center;
    font-size: 14px;
}

/* -- Auth Gate ----------------------------------------------------------- */

.sic-auth-gate {
    display: flex;
    justify-content: center;
    padding: 60px 0 40px;
}

.sic-gate-card {
    background: #ffffff;
    border: 1px solid var(--sic-border);
    border-radius: 8px;
    padding: 36px 32px;
    max-width: 420px;
    width: 100%;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.sic-gate-icon {
    color: var(--sic-text-muted);
    margin-bottom: 16px;
}

.sic-gate-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 8px;
    color: var(--sic-text);
}

.sic-gate-meta {
    font-size: 13px;
    color: var(--sic-text-muted);
    margin-bottom: 20px;
}

.sic-gate-desc {
    font-size: 14px;
    color: var(--sic-text-dim);
    line-height: 1.6;
    margin: 0 0 24px;
}

.sic-gate-input {
    width: 100%;
    padding: 12px 14px;
    background: #ffffff;
    border: 1px solid var(--sic-border);
    border-radius: var(--sic-radius);
    color: var(--sic-text);
    font-size: 14px;
    font-family: inherit;
    margin-bottom: 12px;
}

.sic-gate-input:focus {
    outline: none;
    border-color: var(--sic-accent);
    box-shadow: 0 0 0 2px rgba(78, 91, 110, 0.15);
}

.sic-gate-input::placeholder { color: var(--sic-text-muted); }

.sic-gate-input:disabled {
    background: var(--sic-surface-2);
    color: var(--sic-text-muted);
}

.sic-gate-btn {
    width: 100%;
    padding: 12px;
    background: var(--sic-accent);
    color: #ffffff;
    border: none;
    border-radius: var(--sic-radius);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.sic-gate-btn:hover { background: var(--sic-accent-dim); }
.sic-gate-btn:disabled { opacity: 0.5; cursor: default; }

.sic-gate-status {
    margin-top: 16px;
    font-size: 14px;
    line-height: 1.5;
    padding: 10px 14px;
    border-radius: var(--sic-radius);
}

.sic-gate-status-ok {
    color: #15803d;
    background: rgba(21, 128, 61, 0.06);
    border: 1px solid rgba(21, 128, 61, 0.2);
}

.sic-gate-status-err {
    color: var(--sic-red);
    background: rgba(220, 38, 38, 0.06);
    border: 1px solid rgba(220, 38, 38, 0.2);
}

@media (max-width: 640px) {
    .sic-auth-gate { padding: 32px 0 24px; }
    .sic-gate-card { padding: 28px 20px; }
}

/* -- Split-pane Citation Viewer ------------------------------------------ */

.sic-results:has(.sic-split-view) {
    max-width: 100%;
    padding: 40px 32px;
}

.sic-split-view {
    display: flex;
    height: calc(100vh - 80px);
    gap: 1px;
}

.sic-split-view .sic-report-pane {
    flex: 1;
    overflow-y: auto;
    border-right: 1px solid var(--sic-border);
    padding-right: 24px;
    min-width: 0;
}

.sic-split-view .sic-text-pane {
    flex: 1;
    overflow-y: auto;
    min-width: 0;
}

/* -- Text Pane ----------------------------------------------------------- */

.sic-text-pane-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--sic-border);
    font-weight: 600;
    font-size: 14px;
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 1;
    flex-shrink: 0;
}

.sic-text-pane-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--sic-text-dim);
    padding: 0 4px;
    line-height: 1;
}

.sic-text-pane-close:hover {
    color: var(--sic-text);
}

.sic-text-pane-body {
    padding: 16px;
    font-size: 16px;
    line-height: 1.7;
    white-space: pre-line;
}

/* -- Segment Highlighting in Text Pane ----------------------------------- */

.sic-text-seg {
    display: block;
    border-left: 3px solid transparent;
    padding: 4px 0 4px 12px;
    margin: 2px 0;
    transition: background 0.2s, border-color 0.2s;
    cursor: default;
}

.sic-text-seg-active {
    background: rgba(143, 176, 130, 0.15);
    border-left-color: #8fb082;
}

/* -- Mobile Text Modal --------------------------------------------------- */

.sic-text-modal {
    position: fixed;
    inset: 0;
    z-index: 1001;
    background: #fff;
    display: flex;
    flex-direction: column;
}

.sic-text-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--sic-border);
    font-weight: 600;
    font-size: 14px;
    position: sticky;
    top: 0;
    background: #fff;
    flex-shrink: 0;
}

.sic-text-modal-close {
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: var(--sic-text-dim);
    padding: 0 4px;
    line-height: 1;
}

.sic-text-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    font-size: 14px;
    line-height: 1.7;
    white-space: pre-line;
}

@media (max-width: 768px) {
    .sic-split-view {
        display: block;
        height: auto;
    }
    .sic-split-view .sic-report-pane {
        border-right: none;
        padding-right: 0;
    }
}

/* -- Exemplar Tiles (Landing Page) --------------------------------------- */

.sic-exemplars {
    border-top: 1px solid var(--sic-border);
    margin-top: 24px;
    padding-top: 24px;
}

.sic-exemplars h2 {
    text-align: center;
    font-size: 16px;
    font-weight: 600;
    color: var(--sic-text-dim);
    margin: 0 0 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sic-exemplars-intro {
    text-align: center;
    font-size: 14px;
    color: var(--sic-text-muted);
    margin: 0 0 20px;
}

.sic-exemplar-tiles {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sic-exemplar-tile {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 20px 24px;
    background: #ffffff;
    border: 1px solid var(--sic-border);
    border-radius: var(--sic-radius);
    text-decoration: none !important;
    color: var(--sic-text);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.sic-exemplar-tile:hover {
    border-color: var(--sic-accent);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.sic-exemplar-category {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--sic-text-muted);
}

.sic-exemplar-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--sic-text);
}

.sic-exemplar-desc {
    font-size: 14px;
    color: var(--sic-text-dim);
    line-height: 1.5;
}

.sic-exemplar-intro {
    font-size: 13px;
    color: var(--sic-text-dim);
    line-height: 1.6;
    border-top: 1px solid var(--sic-border);
    padding-top: 10px;
    margin-top: 4px;
}

.sic-exemplar-cta {
    font-size: 13px;
    font-weight: 500;
    color: var(--sic-accent);
    margin-top: 4px;
}

/* -- Coming Soon + Waitlist (Landing Page) ------------------------------- */

.sic-coming-soon-section {
    border-top: 1px solid var(--sic-border);
    margin-top: 24px;
    padding-top: 24px;
    text-align: center;
    max-width: 560px;
    margin-left: auto;
    margin-right: auto;
}

.sic-coming-soon-section h2 {
    font-size: 16px;
    font-weight: 600;
    color: var(--sic-text-dim);
    margin: 0 0 16px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sic-coming-soon-section p {
    font-size: 14px;
    color: var(--sic-text-dim);
    line-height: 1.7;
    margin: 0 0 12px;
}

.sic-coming-soon-section p:last-of-type {
    margin-bottom: 24px;
}

.sic-waitlist-form {
    display: flex;
    gap: 10px;
    max-width: 420px;
    margin: 0 auto;
}

.sic-waitlist-input {
    flex: 1;
    padding: 12px 14px;
    background: #ffffff;
    border: 1px solid var(--sic-border);
    border-radius: var(--sic-radius);
    color: var(--sic-text);
    font-size: 14px;
    font-family: inherit;
}

.sic-waitlist-input:focus {
    outline: none;
    border-color: var(--sic-accent);
    box-shadow: 0 0 0 2px rgba(78, 91, 110, 0.15);
}

.sic-waitlist-input::placeholder { color: var(--sic-text-muted); }

.sic-waitlist-btn {
    padding: 12px 20px;
    background: var(--sic-accent);
    color: #ffffff;
    border: none;
    border-radius: var(--sic-radius);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
}

.sic-waitlist-btn:hover { background: var(--sic-accent-dim); }
.sic-waitlist-btn:disabled { opacity: 0.5; cursor: default; }

.sic-waitlist-success {
    font-size: 14px;
    color: #15803d;
    background: rgba(21, 128, 61, 0.06);
    border: 1px solid rgba(21, 128, 61, 0.2);
    border-radius: var(--sic-radius);
    padding: 12px 16px;
    max-width: 420px;
    margin: 0 auto;
}

.sic-waitlist-error {
    font-size: 13px;
    color: var(--sic-red);
    margin-top: 10px;
}

@media (max-width: 640px) {
    .sic-coming-soon-section p { font-size: 16px; }
    .sic-waitlist-form { flex-direction: column; }
    .sic-waitlist-input { font-size: 16px; }
    .sic-waitlist-btn { font-size: 16px; padding: 14px; }
}

/* -- Tour Guide Banner (Analysis Page) ----------------------------------- */

.sic-tour-guide {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: rgba(78, 91, 110, 0.06);
    border: 1px solid rgba(78, 91, 110, 0.2);
    border-radius: var(--sic-radius);
    padding: 16px 20px;
    margin-bottom: 20px;
}

.sic-tour-content {
    flex: 1;
    font-size: 14px;
    line-height: 1.6;
    color: var(--sic-text-dim);
}

.sic-tour-content strong {
    display: block;
    color: var(--sic-text);
    margin-bottom: 4px;
    font-size: 14px;
}

.sic-tour-content p {
    margin: 0;
}

.sic-tour-example {
    font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
    font-size: 0.9em;
    color: var(--sic-accent);
    border-bottom: 1px dotted var(--sic-accent);
}

.sic-tour-dismiss {
    background: none;
    border: none;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    color: var(--sic-text-muted);
    padding: 0 4px;
    flex-shrink: 0;
}

.sic-tour-dismiss:hover {
    color: var(--sic-text);
}

/* -- Print (PDF download) ------------------------------------------------ */

@media print {
    /* Hide all chrome */
    .sic-header,
    .sic-footer,
    .sic-float-back,
    .sic-progress,
    .sic-another,
    .sic-tour-guide,
    .sic-text-pane,
    .sic-stop-btn,
    .sic-stopped-section,
    .sic-popover,
    .sic-popover-backdrop {
        display: none !important;
    }

    /* Reset layout */
    body {
        background: #fff;
        font-size: 11pt;
        line-height: 1.6;
        color: #000;
    }

    .sic-container {
        max-width: none;
        padding: 0;
        margin: 0;
    }

    .sic-results:has(.sic-split-view) {
        padding: 0;
    }

    .sic-split-view {
        display: block;
        height: auto;
    }

    .sic-split-view .sic-report-pane {
        border-right: none;
        padding-right: 0;
    }

    /* Expand all collapsed sections */
    .sic-report-section.collapsed .sic-report-section-body {
        display: block !important;
    }

    .sic-report-section.collapsed .sic-report-section-title::before {
        transform: none;
    }

    /* Remove interactive affordances */
    .sic-report-section-title {
        cursor: default;
    }

    .sic-seg-ref {
        cursor: default;
        border-bottom: none;
        color: #666;
    }

    /* Report styling for print */
    .sic-report-title {
        font-size: 18pt;
        border-bottom: 1px solid #999;
        padding-bottom: 10pt;
        margin-bottom: 16pt;
    }

    .sic-report-section {
        border: none;
        break-inside: avoid-page;
        margin-bottom: 12pt;
    }

    .sic-report-section-title {
        font-size: 13pt;
        padding: 0 0 4pt;
        border-bottom: 1px solid #ccc;
        margin-bottom: 8pt;
    }

    .sic-report-section-body {
        padding: 0;
    }

    .sic-report-narrative {
        font-size: 11pt;
        line-height: 1.6;
    }

    .sic-report-sub-title {
        font-size: 11pt;
        border-bottom-color: #ddd;
    }

    .sic-disclaimer {
        border-left: 2px solid #999;
        font-size: 9pt;
        margin-top: 24pt;
        page-break-inside: avoid;
    }

    /* Print header: show [sic] branding */
    .sic-result::before {
        content: '[sic] — Forensic Document Analysis';
        display: block;
        font-family: 'Cormorant Garamond', Georgia, serif;
        font-size: 10pt;
        color: #999;
        text-align: center;
        margin-bottom: 20pt;
        padding-bottom: 8pt;
        border-bottom: 1px solid #ddd;
    }
}

/* -- Mobile: +2px font boost (MUST be last to win cascade) --------------- */

@media (max-width: 640px) {
    .sic-tagline { font-size: 16px; }
    .sic-learn-more-inner p { font-size: 16px; }
    .sic-learn-more-inner ol li { font-size: 16px; }
    .sic-learn-more-toggle { font-size: 15px; }
    .sic-report-narrative { font-size: 17px; }
    .sic-report-sub-title { font-size: 17px; }
    .sic-exemplar-title { font-size: 18px; }
    .sic-exemplar-desc { font-size: 16px; }
    .sic-exemplar-intro { font-size: 15px; }
    .sic-exemplar-cta { font-size: 15px; }
    .sic-tier { font-size: 16px; }
    .sic-dim { font-size: 15px; }
    #sic-email, #sic-code, #sic-text { font-size: 16px; }
    .sic-label { font-size: 16px; }
    .sic-popover-text { font-size: 16px; }
    .sic-submit-btn { font-size: 16px; }
}
