:root {
    --bg: #0f1724; /* deep night */
    --card: #0b1220;
    --muted: #9aa4b2;
    --accent: #7c3aed;
    --glass: rgba(255, 255, 255, 0.04);
    --success: #10b981;
}
* {
    box-sizing: border-box;
}
html,
body {
    height: 100%;
}
body {
    margin: 0;
    font-family: Inter, system-ui, Segoe UI, Roboto,
        "Helvetica Neue", Arial;
    background: linear-gradient(
        180deg,
        #071226 0%,
        #071229 60%,
        #07122f 100%
    );
    color: #e6eef8;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    padding: 32px;
}
.app {
    max-width: 1100px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 420px 1fr;
    gap: 28px;
}
.card {
    background: linear-gradient(
        180deg,
        rgba(255, 255, 255, 0.02),
        rgba(255, 255, 255, 0.01)
    );
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 6px 30px rgba(2, 6, 23, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.03);
}
header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 14px;
}
.logo {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--accent), #4f46e5);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 20px;
    color: white;
    box-shadow: 0 6px 20px rgba(124, 58, 237, 0.18);
}
h1 {
    font-size: 18px;
    margin: 0;
}
p.lead {
    margin: 6px 0 18px;
    color: var(--muted);
    font-size: 13px;
}

/* Left panel */
.uploader {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.dropzone {
    height: 220px;
    border-radius: 12px;
    border: 2px dashed rgba(255, 255, 255, 0.04);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 12px;
    background: linear-gradient(
        180deg,
        rgba(255, 255, 255, 0.01),
        rgba(255, 255, 255, 0)
    );
    cursor: pointer;
    transition: transform 0.18s ease;
    position: relative;
    overflow: hidden;
}
.dropzone.drag {
    transform: scale(1.01);
    border-color: rgba(124, 58, 237, 0.6);
}
.dropzone input {
    display: none;
}
.dz-note {
    color: var(--muted);
    font-size: 13px;
}
.controls {
    display: flex;
    gap: 8px;
}
.btn {
    background: var(--glass);
    border: 1px solid rgba(255, 255, 255, 0.03);
    padding: 10px 12px;
    border-radius: 10px;
    color: inherit;
    cursor: pointer;
}
.btn.primary {
    background: linear-gradient(90deg, var(--accent), #4f46e5);
    border: none;
    color: white;
    font-weight: 600;
}
.small {
    font-size: 12px;
    padding: 8px 10px;
}

label.range {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.range input {
    width: 100%;
}
.preset-list {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.preset {
    background: rgba(255, 255, 255, 0.02);
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 13px;
    border: 1px solid rgba(255, 255, 255, 0.02);
    cursor: pointer;
}

/* Right panel */
.viewer {
    display: flex;
    flex-direction: column;
    height: 100%;
    gap: 12px;
}
.canvas-wrap {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    align-items: start;
}
.preview {
    background: linear-gradient(
        180deg,
        rgba(255, 255, 255, 0.01),
        rgba(255, 255, 255, 0.02)
    );
    border-radius: 12px;
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, 0.02);
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
    justify-content: center;
    min-height: 320px;
    position: relative;
}
.preview img {
    max-width: 100%;
    max-height: 480px;
    border-radius: 10px;
}
.preview canvas {
    max-width: 100%;
    max-height: 277px;
    border-radius: 10px;
}
.toolbar {
    display: flex;
    gap: 8px;
    align-items: center;
}
.info {
    color: var(--muted);
    font-size: 13px;
}

footer.actions {
    display: flex;
    gap: 8px;
    align-items: center;
}
.badge {
    background: rgba(255, 255, 255, 0.03);
    padding: 6px 8px;
    border-radius: 999px;
    font-size: 12px;
    color: var(--muted);
    border: 1px solid rgba(255, 255, 255, 0.02);
}

.help {
    font-size: 13px;
    color: var(--muted);
    line-height: 1.4;
}

/* small responsive */
@media (max-width: 980px) {
    .app {
        grid-template-columns: 1fr;
    }
    .canvas-wrap {
        grid-template-columns: 1fr;
    }
}