.artifact-preview-page {
    padding-bottom: 24px;
}

.artifact-preview-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.artifact-preview-tabs {
    border-bottom: 1px solid #d0d7de;
    display: flex;
    gap: 4px;
    margin-bottom: 12px;
}

.artifact-preview-tab {
    border: 1px solid transparent;
    border-bottom: 2px solid transparent;
    color: #3d3d3d;
    padding: 6px 14px;
    text-decoration: none;
}

.artifact-preview-tab:hover,
.artifact-preview-tab:focus {
    background: #f2f5f8;
    text-decoration: none;
}

.artifact-preview-tab-active {
    border-bottom-color: #337ab7;
    color: #1b4f7e;
    font-weight: 600;
}

.artifact-preview-status {
    color: #57606a;
    margin: 8px 0;
}

.artifact-preview-error {
    background: #fff4f4;
    border: 1px solid #e6b8b8;
    border-left: 4px solid #b42318;
    border-radius: 4px;
    color: #6e1b16;
    margin: 10px 0;
    padding: 10px 12px;
}

.artifact-preview-metadata {
    display: grid;
    gap: 4px 18px;
    grid-template-columns: max-content minmax(0, 1fr);
    margin: 14px 0;
}

.artifact-preview-metadata dt {
    color: #57606a;
    font-weight: 600;
}

.artifact-preview-metadata dd {
    margin: 0;
    overflow-wrap: anywhere;
}

/* dotLottie */

.lottie-preview-layout {
    display: grid;
    gap: 14px;
    grid-template-columns: minmax(280px, 1fr) minmax(230px, 320px);
}

.lottie-stage {
    align-items: center;
    aspect-ratio: 1 / 1;
    border: 1px solid #c7cdd5;
    border-radius: 5px;
    display: flex;
    justify-content: center;
    max-height: 68vh;
    min-height: 280px;
    overflow: hidden;
    position: relative;
}

.lottie-stage canvas {
    display: block;
    height: 100%;
    max-height: 68vh;
    max-width: 100%;
    width: 100%;
}

.lottie-bg-transparent {
    background: transparent;
}

.lottie-bg-checker {
    background-color: #fff;
    background-image:
        linear-gradient(45deg, #d9dde3 25%, transparent 25%),
        linear-gradient(-45deg, #d9dde3 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #d9dde3 75%),
        linear-gradient(-45deg, transparent 75%, #d9dde3 75%);
    background-position: 0 0, 0 10px, 10px -10px, -10px 0;
    background-size: 20px 20px;
}

.lottie-bg-light { background: #fff; }
.lottie-bg-dark { background: #181a1f; }

.lottie-controls {
    background: #f6f8fa;
    border: 1px solid #d0d7de;
    border-radius: 5px;
    padding: 12px;
}

.lottie-button-row,
.lottie-backgrounds {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.lottie-control {
    display: block;
    font-size: 13px;
    margin-bottom: 11px;
}

.lottie-control > input[type="range"],
.lottie-control > select {
    display: block;
    margin-top: 4px;
    width: 100%;
}

.lottie-control output {
    color: #57606a;
    display: block;
    font-size: 12px;
    margin-top: 2px;
}

.lottie-background-button.active {
    background: #337ab7;
    border-color: #2e6da4;
    color: #fff;
}

/* NBT */

.nbt-toolbar {
    align-items: center;
    background: #f6f8fa;
    border: 1px solid #d0d7de;
    border-bottom: 0;
    border-radius: 5px 5px 0 0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px;
}

.nbt-toolbar label {
    font-size: 13px;
    margin: 0;
}

.nbt-toolbar input[type="search"] {
    border: 1px solid #b8c1ce;
    border-radius: 3px;
    min-width: 170px;
    padding: 4px 7px;
}

.nbt-toolbar-gap { flex: 1 1 auto; }

.nbt-preview [hidden] { display: none !important; }
.nbt-view-tabs { display: flex; gap: 4px; border-bottom: 1px solid #b8c1ce; margin-bottom: 12px; }
.nbt-view-tabs [hidden] { display: none !important; }
.nbt-view-tabs > * {
    background: #f6f8fa; color: #38424e; border: 1px solid #b8c1ce;
    border-bottom: 0; border-radius: 5px 5px 0 0; padding: 9px 16px;
    font: inherit; line-height: 1.4; white-space: nowrap; text-decoration: none;
}
.nbt-view-tabs > [aria-selected="true"], .nbt-view-tabs > [aria-current="page"] { background: #1463a2; color: white; border-color: #1463a2; }
.nbt-view-tabs > :focus-visible { outline: 3px solid #398cd2; outline-offset: 2px; }
.nbt-view-tabs button:disabled { color: #687580; cursor: not-allowed; }
.nbt-preview button:focus-visible, .nbt-preview canvas:focus-visible,
.nbt-preview input:focus-visible, .nbt-preview select:focus-visible { outline: 3px solid #398cd2; outline-offset: 2px; }
.nbt-structure-stage { height: min(65vh, 650px); min-height: 300px; background: #131821; border-radius: 5px; overflow: hidden; }
.nbt-structure-stage canvas { display: block; width: 100%; height: 100%; touch-action: none; }
.nbt-structure-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 8px 0; }
.nbt-structure-toolbar button, .nbt-structure-toolbar select {
    background: #fff; color: #24292f; border: 1px solid #b8c1ce; border-radius: 4px; padding: 5px 10px;
}
.nbt-structure-toolbar label { margin: 0; }
.nbt-structure-toolbar input[type="range"] { flex: 1 1 100px; width: auto; max-width: 240px; }
.nbt-structure-toolbar output { padding: 0; min-width: 95px; }
.nbt-structure-help { color: #57606a; font-size: 12px; }
.nbt-structure-notice, .nbt-unknown-blocks { background: #f5f0fa; border: 1px solid #d8c7e9; border-radius: 4px; padding: 10px 12px; margin-bottom: 10px; }
.nbt-unknown-blocks summary { cursor: pointer; display: list-item; margin-left: 1em; }
.nbt-unknown-blocks p { margin-top: 10px; }
.nbt-unknown-blocks ul { max-height: 180px; overflow: auto; overflow-wrap: anywhere; }

.nbt-match-count,
.nbt-copy-status {
    color: #57606a;
    font-size: 12px;
    min-width: 68px;
}

.nbt-tree {
    border: 1px solid #d0d7de;
    border-radius: 0 0 5px 5px;
    font-family: Menlo, Consolas, "Liberation Mono", monospace;
    font-size: 12.5px;
    line-height: 1.55;
    max-height: 70vh;
    min-height: 220px;
    overflow: auto;
    padding: 5px 0;
}

.nbt-tree-row {
    align-items: baseline;
    cursor: default;
    display: flex;
    gap: 7px;
    min-height: 22px;
    padding-right: 8px;
    white-space: pre-wrap;
    word-break: break-word;
}

.nbt-tree-row:hover { background: #f6f8fa; }
.nbt-tree-selected { background: #ddeaf6; }

.nbt-tree-toggle {
    background: transparent;
    border: 0;
    color: #57606a;
    flex: 0 0 18px;
    font-size: 10px;
    padding: 2px;
    width: 18px;
}

.nbt-tree-toggle-spacer {
    flex: 0 0 18px;
    width: 18px;
}

.nbt-tree-key {
    color: #0b5394;
    flex: 0 0 auto;
    font-weight: 600;
}

.nbt-tree-type {
    color: #8250df;
    flex: 0 0 auto;
    font-size: 11.5px;
}

.nbt-tree-value {
    color: #0a7c42;
    min-width: 0;
    overflow-wrap: anywhere;
}

.nbt-tree-pager {
    align-items: center;
    color: #57606a;
    display: flex;
    gap: 8px;
    padding: 4px 8px 4px 36px;
}

.nbt-tree-pager button,
.nbt-toolbar button {
    background: #fff;
    border: 1px solid #b8c1ce;
    border-radius: 3px;
    color: #24292f;
    font-size: 12px;
    padding: 3px 8px;
}

.nbt-tree-pager button:disabled,
.nbt-toolbar button:disabled {
    color: #98a2ae;
}

@media (max-width: 800px) {
    .lottie-preview-layout { grid-template-columns: 1fr; }
    .lottie-stage { min-height: 240px; }
    .artifact-preview-metadata { grid-template-columns: 1fr; }
    .artifact-preview-metadata dt { margin-top: 5px; }
}

@media (prefers-reduced-motion: reduce) {
    .lottie-stage canvas { scroll-behavior: auto; }
}

.nbt-build-metadata { overflow-wrap: anywhere; color: #57606a; }
.nbt-materials-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.nbt-materials-table th, .nbt-materials-table td { padding: 8px; border-bottom: 1px solid #d8dee6; text-align: left; overflow-wrap: anywhere; }
.nbt-materials-table th:last-child, .nbt-materials-table td:last-child { width: 100px; text-align: right; }
.nbt-materials-table details div { padding: 5px 12px; font-size: 12px; color: #57606a; }
.nbt-materials-table summary { cursor: pointer; }
#nbtRegion { max-width: min(450px, 70vw); }
@media (max-width: 600px) {
    .nbt-view-tabs { gap: 2px; }
    .nbt-view-tabs > * { padding: 8px 6px; font-size: 12px; white-space: normal; }
}
