/* --------------------------------------------------------------------------
   Payloads, arvores e linha do tempo legada
   -------------------------------------------------------------------------- */

.json-block {
    margin: 0;
    padding: 0.85rem 1rem;
    border-radius: var(--radius-sm);
    background: #0f1b26;
    color: #e6edf3;
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    line-height: 1.55;
    white-space: pre-wrap;
    word-break: break-word;
    overflow-wrap: anywhere;
    max-width: 100%;
    max-height: 34rem;
    overflow: auto;
}

.json-block-soft {
    min-height: 3.5rem;
}

.json-tree {
    padding: 0.75rem 0.9rem;
    border: 1px solid var(--rule);
    border-radius: var(--radius-sm);
    background: var(--sheet-2);
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
    max-height: 34rem;
    overflow: auto;
}

.json-node {
    margin-left: 0.35rem;
}

.json-children {
    margin-left: 1rem;
    padding-left: 0.65rem;
    border-left: 1px dashed var(--rule-strong);
}

.json-leaf {
    padding: 0.15rem 0;
    white-space: pre-wrap;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.content-viewer {
    display: grid;
    gap: 0.6rem;
}

.viewer-shell,
.viewer-body {
    min-width: 0;
}

.viewer-mode-active {
    border-color: var(--omie);
    box-shadow: inset 0 0 0 1px var(--omie);
    color: var(--omie-ink);
}

.viewer-fallback {
    margin-top: 0.6rem;
}

.artifact-actions,
.event-header,
.viewer-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem;
}

.artifact-actions {
    margin-top: 0.6rem;
}

.event-header {
    justify-content: space-between;
    margin-top: 0.3rem;
}

.artifact-path,
.event-note {
    margin-top: 0.4rem;
    white-space: pre-wrap;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.timeline {
    display: grid;
    gap: 0.6rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.timeline li {
    padding: 0.8rem 0.9rem;
    border: 1px solid var(--rule);
    border-radius: var(--radius-sm);
    background: var(--sheet);
    overflow: hidden;
}

.timeline span {
    display: block;
    margin-top: 0.2rem;
    font-weight: 650;
}

.timeline p {
    margin: 0.3rem 0 0;
    white-space: pre-wrap;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.event-error-card {
    border-color: #efc2be !important;
    background: var(--fail-soft) !important;
}

.event-block {
    margin-top: 0.75rem;
}

.event-block h4 {
    margin: 0 0 0.4rem;
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--ink-2);
}

.event-summary {
    margin-top: 0.75rem;
    padding: 0.7rem 0.9rem;
    border: 1px solid #bcdcf0;
    border-radius: var(--radius-sm);
    background: var(--omie-soft);
}

.event-summary strong {
    display: block;
    margin-bottom: 0.2rem;
}

/* --------------------------------------------------------------------------
   Paginacao
   -------------------------------------------------------------------------- */

.pagination,
.pagination-pages {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
}

.pagination {
    justify-content: space-between;
    margin-top: 0.9rem;
    color: var(--muted);
    font-size: 0.8125rem;
}

.pagination-link {
    min-width: 2rem;
    min-height: 2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.2rem 0.55rem;
    border: 1px solid var(--rule-strong);
    border-radius: var(--radius-sm);
    background: var(--sheet);
    color: var(--ink);
    font-size: 0.8125rem;
    font-weight: 600;
}

.pagination-link:hover {
    background: var(--sheet-2);
}

.pagination-link-active:hover {
    background: var(--omie-ink);
}

.pagination-link-active {
    border-color: var(--omie-action);
    background: var(--omie-action);
    color: #ffffff;
}

/* --------------------------------------------------------------------------
   Atualizacao automatica
   -------------------------------------------------------------------------- */

.live-region-shell {
    display: grid;
    gap: 1rem;
}

.realtime-controls {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.35rem 0.7rem;
    padding: 0.2rem 0.25rem 0.2rem 0.6rem;
    border: 1px solid var(--rule);
    border-radius: 999px;
    background: var(--sheet);
}

.live-pill,
.live-meta {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.75rem;
    font-weight: 650;
}

.live-pill::before {
    content: "";
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 999px;
    background: currentColor;
}

.live-meta {
    color: var(--muted);
    font-weight: 500;
}

.live-pill-active { color: var(--done-ink); }
.live-pill-refreshing { color: var(--omie-ink); }
.live-pill-paused { color: var(--warn); }
.live-pill-error { color: var(--fail-ink); }

.live-pill-refreshing::before {
    animation: live-pulse 0.9s ease-in-out infinite;
}

.is-loading {
    opacity: 0.72;
    pointer-events: none;
}

.button-loading::after {
    content: "";
    width: 0.8rem;
    height: 0.8rem;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: currentColor;
    border-radius: 999px;
    animation: spin 0.7s linear infinite;
}

.button-secondary.button-loading::after,
.button-danger.button-loading::after {
    border-color: rgba(20, 33, 43, 0.15);
    border-top-color: currentColor;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes live-pulse {
    50% {
        opacity: 0.35;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* --------------------------------------------------------------------------
   Login e pagina publica
   -------------------------------------------------------------------------- */

.auth-shell {
    min-height: calc(100vh - 12rem);
    display: grid;
    place-items: center;
}

.auth-card {
    width: min(100%, 440px);
}

.auth-brand {
    display: grid;
    gap: 0.8rem;
    margin-bottom: 0.6rem;
}

.auth-logo {
    width: min(100%, 15rem);
    height: auto;
}
