@keyframes aipTypingDot {
    0%, 80%, 100% { opacity: 0.28; transform: translateY(0); }
    40% { opacity: 1; transform: translateY(-2px); }
}
@keyframes aipScrollCue {
    0%, 100% { transform: translateX(0); opacity: 0.75; }
    50% { transform: translateX(4px); opacity: 1; }
}
.aip-typing-dot {
    width: 6px;
    height: 6px;
    border-radius: 9999px;
    background: #737373;
    display: inline-block;
    animation: aipTypingDot 1.05s infinite ease-in-out;
}
.aip-typing-dot:nth-child(2) { animation-delay: 0.15s; }
.aip-typing-dot:nth-child(3) { animation-delay: 0.3s; }

.aip-sort-ghost {
    background: #f5f5f5;
    opacity: 0.8;
}
.aip-sheet {
    border: 1px solid #d4d4d4;
    border-radius: 1rem;
    background: #fff;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}

.aip-answer table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0 2rem;
    font-size: 0.875rem;
}
.aip-answer[data-answer-source]:not([data-aip-answer-hydrated="Y"]) {
    visibility: hidden;
}
.aip-answer .aip-table-shell {
    position: relative;
    margin: 1rem 0 2rem;
}
.aip-answer .aip-table-scroll {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.aip-answer .aip-table-scroll > table {
    margin: 0;
    width: max-content;
    min-width: 100%;
}
.aip-answer .aip-table-shell.aip-scrollable::after {
    right: 0;
    content: '\203A';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 40px;
    pointer-events: none;
    z-index: 2;
    opacity: 0;
    transition: opacity 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 8px;
    font-size: 26px;
    line-height: 1;
    font-weight: 700;
    color: rgba(31, 41, 55, 0.9);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
    box-shadow: inset 1px 0 0 rgba(17, 24, 39, 0.14);
    background:
        linear-gradient(to left, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0.72) 58%, rgba(255, 255, 255, 0));
}
.aip-answer .aip-table-shell.aip-scrollable.aip-can-right.aip-cue-active::after {
    animation: aipScrollCue 0.95s ease-in-out infinite;
}
.aip-answer .aip-table-shell.aip-scrollable.aip-can-right::after {
    opacity: 1;
}
.aip-answer :is(h3, h4, h5, h6) {
    margin-top: 2rem;
    margin-bottom: 0.9rem;
}
.aip-answer p {
    margin: 0.9rem 0;
    line-height: 2.05;
}
.aip-answer ul,
.aip-answer ol {
    margin: 0.9rem 0 1.15rem;
}
.aip-answer li + li {
    margin-top: 0.45rem;
}
.aip-answer blockquote {
    margin: 1.25rem 0;
}
.aip-answer hr {
    margin: 1.5rem 0;
}
.aip-answer pre {
    margin: 1.25rem 0;
}
.aip-answer th,
.aip-answer td {
    border: 1px solid #e5e5e5;
    padding: 0.5rem 0.75rem;
    vertical-align: top;
}
.aip-answer thead th {
    background: #fafafa;
    color: #262626;
    font-weight: 600;
}
.aip-answer .mermaid {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 1rem 0;
    padding: 1rem;
    border: 1px solid #e5e5e5;
    border-radius: 0.75rem;
    background: #fff;
    overflow-x: auto;
}
.aip-answer img {
    max-width: 100%;
    width: 100%;
    height: auto;
    border-radius: 0.5rem;
}
@media (min-width: 768px) {
    .aip-answer .aip-table-scroll {
        overflow-x: visible;
    }
    .aip-answer .aip-table-scroll > table {
        width: 100%;
        min-width: 0;
    }
    .aip-answer .aip-table-shell.aip-scrollable::after {
        display: none;
    }
}
@media (max-width: 767.98px) {
    .aip-answer .aip-table-scroll > table {
        font-size: 0.9rem;
    }
}
@media (prefers-reduced-motion: reduce) {
    .aip-answer .aip-table-shell.aip-scrollable::after {
        animation: none;
    }
}
.aip-print-document {
    max-width: 960px;
    margin: 0 auto;
    padding: 48px 24px 64px;
    background: #fff;
    color: #111827;
}

.aip-print-sheet {
    margin: 0;
}

.aip-print-title {
    margin: 0 0 1.5rem;
    color: #111827;
    font-weight: 700;
    line-height: 1.25;
}

.aip-print-sheet h1.aip-print-title {
    font-size: 20pt;
}

.aip-print-sheet h2.aip-print-title {
    font-size: 16pt;
}

.aip-print-body {
    font-size: 11pt;
    line-height: 1.8;
    color: #111827;
}

.aip-print-body .aip-table-shell {
    margin: 1rem 0 2rem;
}

.aip-print-body .aip-table-scroll {
    overflow: visible;
}

.aip-print-body .aip-table-scroll > table {
    width: 100%;
    min-width: 0;
}

.aip-print-body .aip-table-shell.aip-scrollable::after {
    display: none !important;
}

.aip-print-body th,
.aip-print-body td {
    white-space: normal;
    word-break: break-word;
}

.aip-print-empty {
    padding: 3rem 1rem;
    text-align: center;
    color: #6b7280;
}

@media print {
    @page {
        margin: 14mm 12mm;
    }

    html,
    body {
        background: #fff !important;
        margin: 0 !important;
        padding: 0 !important;
        font-size: 13px;
    }

    .aip-print-document {
        max-width: none;
        margin: 0;
        padding: 0;
        font-size: 13px;
    }

    .aip-print-title {
        page-break-after: avoid;
    }

    .aip-print-sheet h1.aip-print-title {
        text-align: center;
        text-decoration: underline;
        font-size: 24px;
        line-height: 1.2;
    }

    .aip-print-sheet h2.aip-print-title {
        font-size: 18px;
        line-height: 1.3;
    }

    .aip-print-body {
        font-size: 13px;
        line-height: 1.5;
    }

    .aip-print-body p,
    .aip-print-body ul,
    .aip-print-body ol,
    .aip-print-body blockquote,
    .aip-print-body pre,
    .aip-print-body table,
    .aip-print-body img,
    .aip-print-body .mermaid {
        page-break-inside: avoid;
        break-inside: avoid;
    }

    .aip-print-body p,
    .aip-print-body li,
    .aip-print-body th,
    .aip-print-body td,
    .aip-print-body blockquote,
    .aip-print-body pre,
    .aip-print-body code {
        font-size: 13px;
        line-height: 1.5;
    }

    .aip-print-body h2 {
        font-size: 18px;
        line-height: 1.3;
    }

    .aip-print-body h3 {
        font-size: 16px;
        line-height: 1.35;
    }

    .aip-print-body h4,
    .aip-print-body h5 {
        font-size: 15px;
        line-height: 1.4;
    }

    .aip-print-body h6 {
        font-size: 14px;
        line-height: 1.45;
    }

    .aip-print-body ul {
        list-style: disc;
        padding-left: 1.5rem;
        margin: 0.5rem 0 0.9rem;
    }

    .aip-print-body ol {
        list-style: decimal;
        padding-left: 1.5rem;
        margin: 0.5rem 0 0.9rem;
    }

    .aip-print-body li + li {
        margin-top: 0.35rem;
    }

    .aip-print-body hr {
        margin: 1.25rem 0;
        border: 0;
        border-top: 1px solid #d6d3d1;
    }

    .aip-print-body blockquote {
        position: relative;
        margin: 0.5rem 0;
        padding: 0 1rem 0 2.5rem;
        color: #44403c;
    }

    .aip-print-body blockquote::before {
        content: '';
        position: absolute;
        left: 0.5rem;
        top: 0.4rem;
        bottom: 0.4rem;
        width: 0.375rem;
        border-radius: 9999px;
        background: #a8a29e;
    }

    .aip-print-body pre {
        margin: 0.5rem 0;
        padding: 1rem;
        border: 1px solid #e7e5e4;
        border-radius: 2px;
        background: #f4f3ef !important;
        white-space: pre-wrap;
        word-break: break-word;
        overflow: visible;
    }

    .aip-print-body pre code {
        display: block;
        width: 100%;
        padding: 0;
        background: transparent;
        color: #44403c;
        white-space: pre-wrap;
        word-break: break-word;
    }

    .aip-print-body p code,
    .aip-print-body li code,
    .aip-print-body blockquote code {
        padding: 0.12rem 0.35rem;
        border-radius: 2px;
        background: #f4f3ef;
        color: #44403c;
    }

    .aip-print-body table {
        width: 100%;
        border-collapse: collapse;
        margin: 1rem 0 1.5rem;
    }

    .aip-print-body th,
    .aip-print-body td {
        padding: 0.5rem 0.75rem;
        border: 1px solid #e7e5e4;
        vertical-align: top;
    }

    .aip-print-body thead th {
        background: #fafaf9 !important;
        color: #44403c;
        font-weight: 600;
    }

    .aip-print-body .aip-table-scroll {
        overflow: visible !important;
    }

    .aip-print-body .aip-table-scroll > table {
        width: 100% !important;
        min-width: 0 !important;
    }

    .aip-print-body a {
        color: inherit;
        text-decoration: none;
    }

    .aip-print-body img {
        max-width: 100% !important;
        height: auto !important;
    }
}
