/* sketchfab.css force display:inline-block sur .button, ce qui neutralise [hidden] */
[hidden] {
    display: none !important;
}

.app {
    max-width: 1100px;
    margin: 0 auto;
    padding: 30px;
}

.step {
    margin-bottom: 28px;
    padding: 20px 24px;
    background: var(--mip-surface);
    border: 1px solid var(--mip-border);
    border-radius: 6px;
}
.step-title {
    margin: 0 0 14px;
    font-family: "Titillium Web", sans-serif;
    font-size: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--mip-muted);
}

.hint {
    font-size: 13px;
    color: var(--mip-muted);
    line-height: 1.6;
}
.hint code {
    padding: 1px 5px;
    border-radius: 3px;
    background: var(--mip-surface-2);
}

.field-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin: 12px 0;
}
.text {
    box-sizing: border-box;
    flex: 1 1 220px;
    min-width: 0;
    height: 38px;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 14px;
}
.text.small {
    flex: 0 0 90px;
    height: 32px;
}
select.text {
    flex: 1 1 200px;
}
.button {
    flex: 0 0 auto;
    height: 38px;
    padding: 0 16px;
    border: 0;
    border-radius: 4px;
    cursor: pointer;
    font-family: "Titillium Web", sans-serif;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 13px;
}

.status-ok { color: #4cc38a; }
.status-error { color: #f0736a; }
.status-ok .button { margin-left: 12px; }

/* réglages */
.settings {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
    gap: 14px 20px;
    margin-bottom: 18px;
}
.settings .field {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 8px;
}
.settings .field-label {
    flex: 0 0 auto;
    font-size: 13px;
}
.settings .field-control {
    display: flex;
    align-items: center;
    gap: 6px;
}
.settings small {
    color: var(--mip-muted);
    white-space: nowrap;
}

.toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 0;
    border-top: 1px solid var(--mip-border);
}
.toolbar .spacer { flex: 1 1 auto; }

/* liste des modèles */
.models {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}
.model {
    border: 1px solid var(--mip-border);
    border-radius: 4px;
    overflow: hidden;
    opacity: .45;
    transition: opacity .15s, border-color .15s;
}
.model.is-selected {
    opacity: 1;
    border-color: var(--mip-accent);
}
.model label {
    display: block;
    cursor: pointer;
    position: relative;
}
.model input {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 1;
}
.model img,
.model .no-thumb {
    display: block;
    width: 100%;
    height: 110px;
    object-fit: cover;
    background: var(--mip-bg);
}
.model-name {
    display: block;
    padding: 8px 10px;
    font-size: 12px;
    line-height: 1.3;
    word-break: break-word;
}

/* progression */
.progress {
    height: 6px;
    margin-bottom: 10px;
    border-radius: 3px;
    background: var(--mip-surface-2);
    overflow: hidden;
}
.progress-bar {
    width: 0;
    height: 100%;
    background: var(--mip-accent);
    transition: width .3s;
}

.viewer-stage {
    height: 260px;
    margin: 14px 0;
    border-radius: 4px;
    background: var(--mip-bg);
    overflow: hidden;
}
.viewer-stage iframe {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

.results {
    max-height: 220px;
    margin: 10px 0;
    padding: 0;
    list-style: none;
    overflow-y: auto;
    font-size: 13px;
}
.results li { padding: 3px 0; }
.results .ok { color: #4cc38a; }
.results .ko { color: #f0736a; }

.model-folder {
    display: block;
    padding: 0 10px 8px;
    font-size: 11px;
    color: var(--mip-muted);
    word-break: break-word;
}
.models .loading {
    grid-column: 1 / -1;
    padding: 10px;
    color: var(--mip-muted);
}

.model-vis {
    position: absolute;
    top: 6px;
    right: 6px;
    padding: 1px 7px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    background: rgba(0, 0, 0, .65);
    color: #e0a13e;
}

.notice {
    margin: 0 0 16px;
    padding: 14px 16px;
    border: 1px solid #6b4a1e;
    border-left: 3px solid #e0a13e;
    border-radius: 4px;
    background: rgba(224, 161, 62, .07);
}
.notice p { margin: 0 0 8px; }
.notice p:last-child { margin-bottom: 0; }

/* options de fond */
.bg-options {
    margin: -4px 0 14px;
    padding: 12px 14px;
    border: 1px solid var(--mip-border);
    border-radius: 4px;
    background: var(--mip-surface-2);
}
.bg-options .field-row {
    margin: 0;
}
.bg-options .field-label {
    flex: 0 0 auto;
}
input[type="color"] {
    width: 44px;
    height: 32px;
    padding: 2px;
    border: 1px solid var(--mip-border);
    border-radius: 4px;
    background: var(--mip-surface);
    cursor: pointer;
}
#bg-color-hex {
    flex: 0 0 92px;
    text-transform: lowercase;
}
input[type="file"] {
    flex: 1 1 220px;
    min-width: 0;
    font-size: 13px;
    color: var(--mip-muted);
}

.swatches {
    display: inline-flex;
    gap: 6px;
}
.swatch {
    width: 26px;
    height: 26px;
    padding: 0;
    border: 1px solid var(--mip-border);
    border-radius: 4px;
    cursor: pointer;
}
.swatch:hover {
    border-color: var(--mip-accent);
}

.bg-preview {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
    font-size: 12px;
    color: var(--mip-muted);
}
.bg-preview img {
    width: 96px;
    height: 54px;
    object-fit: cover;
    border: 1px solid var(--mip-border);
    border-radius: 3px;
    background: var(--mip-bg);
}

/* ces listes ont des libellés longs : elles ne doivent pas être tronquées */
#bg-fit,
#format,
#views {
    flex: 0 1 auto;
    width: auto;
    min-width: 150px;
}
