/* Animações da documentação de Interpretadores — paleta navy/ciano do Curator */

.di {
    --di-navy: #0D2142;
    --di-teal: #26C6DA;
    --di-ok: #00B5CC;
    --di-fail: #e57373;
    --di-warn: #ffb74d;
    background: #071018;
    border: 1px solid rgba(38, 198, 218, 0.28);
    border-radius: 16px;
    box-shadow: 0 18px 40px rgba(13, 33, 66, 0.16);
    padding: 12px 12px 10px;
    margin: 22px 0 8px;
    cursor: pointer;
    user-select: none;
    overflow-anchor: none;
    box-sizing: border-box;
}
.di__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
}
.di__top span {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--di-teal);
}
.di__cap {
    margin: 10px 0 0;
    min-height: 40px;
    font-size: 13px;
    line-height: 1.45;
    color: #bfd2e3;
    text-align: center;
    padding: 0 6px;
}
.di__hint {
    margin: 4px 0 0;
    font-size: 11px;
    color: #8aa3b8;
    text-align: center;
}

/* —— recipe / chain cards —— */
.di-toprow {
    display: flex;
    align-items: center;
    gap: 0;
    margin-bottom: 10px;
}
.di-doc {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px 7px 8px;
    border-radius: 999px;
    background: #10233c;
    border: 1px solid rgba(191, 210, 227, 0.18);
    color: #e8f1f8;
    font-size: 11px;
    font-weight: 700;
    max-width: 100%;
    transition: border-color 0.35s, box-shadow 0.35s, opacity 0.35s, transform 0.35s;
}
.di-doc.is-off {
    opacity: 0.4;
    transform: translateX(-6px);
}
.di-doc.is-in {
    opacity: 1;
    transform: none;
    border-color: var(--di-teal);
    box-shadow: 0 0 14px rgba(38, 198, 218, 0.3);
}
.di-doc__badge {
    flex-shrink: 0;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.08em;
    color: #071018;
    background: var(--di-teal);
    border-radius: 5px;
    padding: 3px 6px;
}
.di-pipe {
    flex: 1;
    height: 2px;
    margin-left: 4px;
    background: rgba(38, 198, 218, 0.15);
    position: relative;
    transition: background 0.35s;
}
.di-pipe.is-on {
    background: linear-gradient(90deg, #26C6DA, rgba(38, 198, 218, 0.15));
}
.di-pipe.is-on::after {
    content: "";
    position: absolute;
    right: 0;
    top: 50%;
    width: 7px;
    height: 7px;
    margin-top: -4px;
    border-right: 2px solid #26C6DA;
    border-top: 2px solid #26C6DA;
    transform: rotate(45deg);
}

.di-chain {
    display: flex;
    align-items: stretch;
    gap: 0;
    position: relative;
    margin-bottom: 10px;
}
.di-chain--arc {
    padding-top: 36px;
}
.di-card {
    position: relative;
    flex: 1 1 0;
    min-width: 0;
    background: #10233c;
    border: 1px solid rgba(191, 210, 227, 0.18);
    border-radius: 12px;
    padding: 10px 10px 12px;
    color: #e8f1f8;
    transition: border-color 0.3s, box-shadow 0.3s, opacity 0.3s;
}
.di-card.is-idle { opacity: 0.55; }
.di-card.is-busy {
    opacity: 1;
    border-color: var(--di-teal);
    box-shadow: 0 0 16px rgba(38, 198, 218, 0.28);
}
.di-card.is-done {
    opacity: 1;
    border-color: rgba(0, 181, 204, 0.55);
}
.di-card.is-fail {
    opacity: 1;
    border-color: var(--di-fail);
    box-shadow: 0 0 14px rgba(229, 115, 115, 0.25);
}
.di-card__num {
    position: absolute;
    top: -8px;
    left: 10px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--di-navy);
    border: 2px solid var(--di-teal);
    color: var(--di-teal);
    font-size: 11px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
}
.di-card__body {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 6px;
    min-height: 72px;
}
.di-card__title {
    font-size: 12px;
    font-weight: 700;
    line-height: 1.25;
}
.di-card__model {
    font-size: 10px;
    font-weight: 700;
    color: #8aa3b8;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.di-card__in {
    font-size: 10px;
    color: #bfd2e3;
    min-height: 14px;
}
.di-card__out {
    font-size: 10px;
    font-weight: 700;
    color: var(--di-ok);
    min-height: 14px;
}
.di-card__out.is-off { opacity: 0; }
.di-card__out.is-on { opacity: 1; }
.di-card__pulse {
    display: none;
    position: absolute;
    inset: 0;
    border-radius: 12px;
    pointer-events: none;
}
.di-card.is-busy .di-card__pulse {
    display: block;
    animation: di-shine 1.2s ease-in-out infinite;
    background: linear-gradient(105deg, transparent 40%, rgba(38, 198, 218, 0.12) 50%, transparent 60%);
    background-size: 200% 100%;
}

.di-link {
    width: 28px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    position: relative;
}
.di-link__line {
    display: block;
    width: 100%;
    height: 2px;
    background: rgba(38, 198, 218, 0.2);
    transition: background 0.3s;
}
.di-link.is-on .di-link__line {
    background: var(--di-teal);
}
.di-token {
    position: absolute;
    left: 0;
    top: 50%;
    width: 8px;
    height: 8px;
    margin-top: -4px;
    border-radius: 50%;
    background: var(--di-teal);
    opacity: 0;
}
.di-token.is-run {
    opacity: 1;
    animation: di-token 0.7s ease-out forwards;
}

.di-arc {
    position: absolute;
    top: 0;
    left: 8%;
    width: 84%;
    height: 48px;
    color: var(--di-teal);
    opacity: 0;
    transition: opacity 0.35s;
    pointer-events: none;
}
.di-arc.is-on { opacity: 1; }
.di-arc text {
    fill: var(--di-teal);
    font-size: 10px;
    font-weight: 700;
    font-family: inherit;
}

.di-result {
    background: #10233c;
    border: 1px solid rgba(191, 210, 227, 0.16);
    border-radius: 12px;
    padding: 10px 12px;
    transition: border-color 0.3s;
}
.di-result.is-ready {
    border-color: rgba(0, 181, 204, 0.5);
}
.di-result__head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}
.di-result__head strong {
    font-size: 12px;
    color: #e8f1f8;
}
.di-result__head span {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #8aa3b8;
}
.di-result.is-ready .di-result__head span { color: var(--di-ok); }
.di-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.di-chip {
    font-size: 11px;
    font-weight: 600;
    color: #e8f1f8;
    background: rgba(38, 198, 218, 0.12);
    border: 1px solid rgba(38, 198, 218, 0.28);
    border-radius: 999px;
    padding: 4px 10px;
    transition: opacity 0.3s, transform 0.3s;
}
.di-chip.is-off {
    opacity: 0;
    transform: translateY(4px);
    min-width: 40px;
    min-height: 24px;
}
.di-chip.is-on {
    opacity: 1;
    transform: none;
}

/* —— when —— */
.di-when {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.di-when__side {
    background: #10233c;
    border: 1px solid rgba(191, 210, 227, 0.16);
    border-radius: 12px;
    padding: 12px;
    transition: border-color 0.35s, box-shadow 0.35s, opacity 0.35s;
    opacity: 0.45;
}
.di-when__side.is-on {
    opacity: 1;
    border-color: var(--di-teal);
    box-shadow: 0 0 14px rgba(38, 198, 218, 0.22);
}
.di-when__side header {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--di-teal);
    margin-bottom: 10px;
}
.di-when__note {
    margin: 10px 0 0;
    font-size: 11px;
    color: #8aa3b8;
    min-height: 16px;
}
.di-sheet {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.di-sheet__row {
    display: grid;
    grid-template-columns: 36px 1fr;
    gap: 6px;
    font-size: 11px;
    color: #bfd2e3;
    background: #0a1829;
    border-radius: 6px;
    padding: 6px 8px;
    border: 1px solid transparent;
    transition: border-color 0.3s, background 0.3s;
}
.di-sheet__row.is-hit {
    border-color: var(--di-ok);
    background: rgba(0, 181, 204, 0.12);
    color: #e8f1f8;
    font-weight: 700;
}
.di-docs {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-height: 96px;
}
.di-mini-doc {
    font-size: 11px;
    font-weight: 700;
    color: #e8f1f8;
    background: #0a1829;
    border: 1px solid rgba(191, 210, 227, 0.16);
    border-radius: 8px;
    padding: 8px 10px;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.3s, transform 0.3s, border-color 0.3s;
}
.di-mini-doc.is-on {
    opacity: 1;
    transform: none;
}
.di-mini-doc.is-active {
    border-color: var(--di-teal);
    box-shadow: 0 0 10px rgba(38, 198, 218, 0.25);
}

/* —— parts —— */
.di-parts {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 6px;
}
.di-part {
    appearance: none;
    border: 1px solid rgba(191, 210, 227, 0.16);
    background: #10233c;
    border-radius: 10px;
    padding: 12px 8px;
    text-align: center;
    color: #e8f1f8;
    cursor: inherit;
    opacity: 0.35;
    transition: opacity 0.3s, border-color 0.3s, box-shadow 0.3s, transform 0.3s;
}
.di-part strong {
    display: block;
    font-size: 12px;
    margin-bottom: 4px;
}
.di-part span {
    display: block;
    font-size: 10px;
    color: #8aa3b8;
    line-height: 1.3;
}
.di-part.is-on {
    opacity: 1;
    border-color: var(--di-teal);
    box-shadow: 0 0 14px rgba(38, 198, 218, 0.25);
    transform: translateY(-2px);
}
.di-part.is-done {
    opacity: 0.85;
    border-color: rgba(0, 181, 204, 0.4);
}

/* —— fill —— */
.di-fill {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
}
.di-fill__prompt {
    background: #10233c;
    border: 1px solid rgba(191, 210, 227, 0.18);
    border-radius: 12px;
    padding: 14px 16px;
    font-size: 14px;
    line-height: 1.55;
    color: #e8f1f8;
}
.di-fill__slot {
    display: inline-block;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 13px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 6px;
    transition: background 0.35s, color 0.35s, border-color 0.35s;
}
.di-fill__slot.is-empty {
    background: rgba(38, 198, 218, 0.15);
    color: var(--di-teal);
    border: 1px dashed rgba(38, 198, 218, 0.55);
}
.di-fill__slot.is-filled {
    background: rgba(0, 181, 204, 0.18);
    color: #e8f1f8;
    border: 1px solid rgba(0, 181, 204, 0.45);
}
.di-fill__arrow {
    text-align: center;
    color: var(--di-teal);
    font-size: 18px;
    font-weight: 700;
    opacity: 0.5;
}
.di-fill__answer {
    background: #10233c;
    border: 1px solid rgba(191, 210, 227, 0.16);
    border-radius: 12px;
    padding: 12px 16px;
    text-align: center;
    transition: opacity 0.35s, border-color 0.35s, transform 0.35s;
}
.di-fill__answer.is-off {
    opacity: 0;
    transform: translateY(6px);
}
.di-fill__answer.is-on {
    opacity: 1;
    transform: none;
    border-color: rgba(0, 181, 204, 0.5);
}
.di-fill__answer code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 14px;
    font-weight: 700;
    color: var(--di-ok);
}

/* —— run —— */
.di-run {
    display: flex;
    align-items: stretch;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}
.di-run__box {
    flex: 1 1 100px;
    max-width: 160px;
    background: #10233c;
    border: 1px solid rgba(191, 210, 227, 0.18);
    border-radius: 12px;
    padding: 14px 12px;
    text-align: center;
    color: #e8f1f8;
    transition: border-color 0.3s, box-shadow 0.3s, opacity 0.3s;
    opacity: 0.5;
}
.di-run__box.is-busy {
    opacity: 1;
    border-color: var(--di-teal);
    box-shadow: 0 0 14px rgba(38, 198, 218, 0.28);
}
.di-run__box.is-done {
    opacity: 1;
    border-color: rgba(0, 181, 204, 0.55);
}
.di-run__box.is-fail {
    opacity: 1;
    border-color: var(--di-fail);
    box-shadow: 0 0 14px rgba(229, 115, 115, 0.3);
}
.di-run__n {
    display: inline-flex;
    width: 22px;
    height: 22px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 2px solid var(--di-teal);
    font-size: 11px;
    font-weight: 800;
    color: var(--di-teal);
    margin-bottom: 6px;
}
.di-run__box.is-fail .di-run__n {
    border-color: var(--di-fail);
    color: var(--di-fail);
}
.di-run__box strong {
    display: block;
    font-size: 13px;
    margin-bottom: 6px;
}
.di-run__st {
    display: block;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #8aa3b8;
    min-height: 14px;
}
.di-run__box.is-busy .di-run__st { color: var(--di-teal); }
.di-run__box.is-done .di-run__st { color: var(--di-ok); }
.di-run__box.is-fail .di-run__st { color: #ef9a9a; }
.di-run__arrow {
    align-self: center;
    color: #8aa3b8;
    font-weight: 700;
}

@keyframes di-shine {
    0% { background-position: 100% 0; }
    100% { background-position: -100% 0; }
}
@keyframes di-token {
    0% { left: 0; opacity: 1; }
    100% { left: calc(100% - 8px); opacity: 0.2; }
}

@media (max-width: 900px) {
    .di-parts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .di-chain {
        flex-wrap: wrap;
        gap: 8px;
    }
    .di-link { width: 100%; height: 16px; justify-content: center; }
    .di-link__line { width: 2px; height: 100%; }
    .di-token { display: none; }
    .di-arc { display: none; }
    .di-chain--arc { padding-top: 0; }
}
@media (max-width: 767px) {
    .di-when { grid-template-columns: 1fr; }
    .di-parts { grid-template-columns: 1fr 1fr; }
    .di-run__arrow { display: none; }
    .di-run__box { max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
    .di-card.is-busy .di-card__pulse { animation: none; }
    .di-token.is-run { animation: none; opacity: 1; left: 50%; }
}
