/* Layout */
.site-main {
    --page-top: 1.25rem;
}

.tool-grid {
    margin-top: 1rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 900px) {
    .tool-grid {
        grid-template-columns: 1fr;
    }
}

.panel {
    background: var(--card);
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 14px;
    padding: 1rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
}

.hero {
    background: radial-gradient(600px 300px at 10% -10%, rgba(14, 118, 188, .25), transparent 60%), radial-gradient(500px 260px at 90% -20%, rgba(247, 148, 30, .18), transparent 60%);
    border: 1px solid rgba(255, 255, 255, .06);
    background-color: rgba(255, 255, 255, .02);
    border-radius: 18px;
    padding: 1.25rem 1.4rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .3);
}

.hero h1 {
    margin: .1rem 0 .4rem;
    font-size: 1.7rem;
}

.hero p {
    margin: 0;
    color: var(--muted);
}


/* Controls */
.row {
    display: flex;
    gap: .75rem;
    align-items: center;
    margin: .6rem 0;
    flex-wrap: wrap;
}

.row label {
    min-width: 120px;
    color: #d7e2ee;
    font-weight: 600;
}

.row .grow {
    flex: 1 1 240px;
}

.input,
.select {
    width: 100%;
    padding: .65rem .7rem;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 10px;
    background: #0c101a;
    color: #e8ebf1;
    outline: none;
}

.input:focus,
.select:focus {
    border-color: var(--ring);
    box-shadow: 0 0 0 4px rgba(14, 118, 188, .15);
}

.toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem .5rem;
}

.btn {
    appearance: none;
    border: 1px solid rgba(255, 255, 255, .16);
    background: #0f1320;
    color: #e8ebf1;
    border-radius: 10px;
    padding: .5rem .65rem;
    font-weight: 700;
    cursor: pointer;
}

.btn:hover {
    filter: brightness(1.06);
}

.btn.ghost {
    background: transparent;
}

.btn[disabled] {
    opacity: .5;
    cursor: not-allowed;
}

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin: .25rem 0 .5rem;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .35rem .6rem;
    border-radius: 999px;
    background: #0c101a;
    border: 1px solid rgba(255, 255, 255, .1);
    color: #e8ebf1;
    font-size: .9rem;
    cursor: pointer;
}

.chip.active {
    outline: 2px solid #f7941e;
    /* orange instead of blue */
    box-shadow: 0 0 6px #f7941e66;
}


/* Preview */
.preview-frame {
    position: relative;
    background: #0c101a;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 10px;
    padding: 1rem;
    min-height: 320px;
    overflow: hidden;
}

#stageWrap {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 260px;
}

#stage {
    display: none;
    max-width: 100%;
    height: auto;
    image-rendering: auto;
}

#svgImg {
    display: none;
    max-width: 100%;
    height: auto;
}

#hintNoFile {
    position: absolute;
    inset: auto 1rem 1rem auto;
}


/* Frame presets */
.preview-frame[data-bg="header"] {
    background: linear-gradient(180deg, rgba(0, 0, 0, .5), rgba(0, 0, 0, .3)), url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"1200\" height=\"300\"><rect width=\"1200\" height=\"300\" fill=\"%230c101a\"/><rect width=\"1200\" height=\"60\" fill=\"%230e76bc\"/></svg>') center/cover no-repeat;
}

.preview-frame[data-bg="slide"] {
    background: linear-gradient(180deg, rgba(0, 0, 0, .4), rgba(0, 0, 0, .4)), url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"1200\" height=\"675\"><rect width=\"1200\" height=\"675\" fill=\"%230c101a\"/><rect y=\"0\" width=\"1200\" height=\"100\" fill=\"%23f7941e\"/></svg>') center/cover no-repeat;
}

.preview-frame[data-bg="lowerthird"] {
    background: linear-gradient(180deg, rgba(0, 0, 0, .3), rgba(0, 0, 0, .6)), url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"1920\" height=\"1080\"><rect width=\"1920\" height=\"1080\" fill=\"%230c101a\"/><rect y=\"880\" width=\"1920\" height=\"120\" fill=\"%230e76bc\"/></svg>') center/cover no-repeat;
}


/* Stats */
.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: .5rem .75rem;
    margin-top: .75rem;
}

.stats .ok {
    color: #72ffa6;
}

.stats .mid {
    color: #ffe072;
}

.stats .warn {
    color: #ffd072;
}

.stats .bad {
    color: #ff8b8b;
}


/* Misc */
.hidden {
    display: none !important;
}

.preview-frame.drag {
    outline: 2px dashed var(--ring);
    outline-offset: 6px;
}

/* Custom bg colour (used when bg="custom") */
.preview-frame[data-bg="custom"] {
    background: var(--pp-bg, #0c101a);
}

/* Transparency checkerboard (toggled on the inner stage area) */
.checkerboard {
    background:
        conic-gradient(#0000 90deg, rgba(255, 255, 255, .08) 0) 0 0/20px 20px,
        conic-gradient(#0000 90deg, rgba(0, 0, 0, .15) 0) 10px 10px/20px 20px;
}

.btn.danger {
    border-color: #ff6b6b;
    background: rgba(255, 107, 107, .12);
    color: #ffb3b3;
}

.btn.danger:hover {
    filter: none;
    background: rgba(255, 107, 107, .18);
}

.select.narrow {
    width: auto;
    min-width: 180px;
}

.helpbox {
    padding: .6rem .8rem;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 10px;
    background: #0c101a;
    color: #cfd7e3;
    margin-top: -.4rem;
}

.btn.toggled {
    outline: 2px solid #f7941e;
    box-shadow: 0 0 6px #f7941e66;
}

.btn.danger {
    border-color: #ff6b6b;
    background: rgba(255, 107, 107, .12);
    color: #ffb3b3;
}

.btn.danger:hover {
    background: rgba(255, 107, 107, .18);
    filter: none;
}

/* Custom bg colour when backdrop='custom' */
.preview-frame[data-bg="custom"] {
    background: var(--pp-bg, #0c101a);
}

/* Transparency checkerboard */
.checkerboard {
    background:
        conic-gradient(#0000 90deg, rgba(255, 255, 255, .08) 0) 0 0/20px 20px,
        conic-gradient(#0000 90deg, rgba(0, 0, 0, .15) 0) 10px 10px/20px 20px;
}

.chip.active { outline: 2px solid #f7941e; box-shadow: 0 0 6px #f7941e66; }
.btn.toggled { outline: 2px solid #f7941e; box-shadow: 0 0 6px #f7941e66; }
