/* Placeholder Image Gen — style.css */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
    --bg: #0f1117;
    --bg2: #181c27;
    --bg3: #1e2435;
    --border: #252c3d;
    --border2: rgba(255, 255, 255, 0.05);
    --text: #e8eaf6;
    --text2: #8f9bc5;
    --text3: #3d4669;
    --accent: #6366f1;
    --accent2: #818cf8;
    --radius: 10px;
    --t: all 0.18s ease;
}

@media(prefers-color-scheme:light) {
    :root {
        --bg: #f8f9fc;
        --bg2: #ffffff;
        --bg3: #f1f3f9;
        --border: #e2e5f0;
        --border2: rgba(0, 0, 0, 0.05);
        --text: #1a1e2e;
        --text2: #4a5480;
        --text3: #9ba4c7;
    }
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 18px 20px;
}

/* Header */
header {
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--accent), #a855f7);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.brand-name {
    font-size: 15px;
    font-weight: 700;
}

h1.brand-name {
    display: inline;
}

.brand-sub {
    font-size: 11px;
    color: var(--text3);
}

/* Grid */
.main-grid {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 16px;
    align-items: start;
}

/* Controls panel */
.controls-panel {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.section {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border2);
}

.section:last-child {
    border-bottom: none;
}

.section-title {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text3);
    margin-bottom: 10px;
}

/* Fields */
.field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.field-row {
    display: flex;
    align-items: flex-end;
    gap: 8px;
}

.label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text2);
}

.label-hint {
    font-weight: 400;
    color: var(--text3);
}

.inp {
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    padding: 6px 10px;
    font-size: 12px;
    font-family: 'Inter', sans-serif;
    outline: none;
    transition: var(--t);
    width: 100%;
}

.inp:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

.inp::placeholder {
    color: var(--text3);
}

select.inp {
    cursor: pointer;
}

.mono {
    font-family: 'JetBrains Mono', monospace;
}

.dimen-sep {
    font-size: 14px;
    font-weight: 700;
    color: var(--text3);
    padding-bottom: 6px;
}

/* Color rows */
.color-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.color-swatch {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: 2px solid var(--border);
    padding: 0;
    cursor: pointer;
    background: none;
    flex-shrink: 0;
}

/* Presets */
.presets {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 8px;
}

.preset {
    padding: 3px 8px;
    font-size: 10px;
    font-weight: 500;
    border-radius: 5px;
    border: 1px solid var(--border);
    background: var(--bg3);
    color: var(--text2);
    cursor: pointer;
    transition: var(--t);
    font-family: 'Inter', sans-serif;
}

.preset:hover,
.preset.active {
    border-color: var(--accent);
    color: var(--accent2);
    background: rgba(99, 102, 241, 0.08);
}

/* Color palettes */
.color-palettes {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 8px;
}

.palette-chip {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 5px;
    border: 1px solid var(--border2);
    background: var(--bg3);
    cursor: pointer;
    transition: var(--t);
}

.palette-chip:hover {
    border-color: var(--accent);
}

.palette-dot {
    width: 10px;
    height: 10px;
    border-radius: 2px;
}

.palette-label {
    font-size: 10px;
    color: var(--text2);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 7px 12px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg3);
    color: var(--text);
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--t);
    white-space: nowrap;
}

.btn:hover {
    border-color: var(--accent);
    color: var(--accent2);
}

.btn-primary {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    font-weight: 700;
    font-size: 12px;
}

.btn-primary:hover {
    background: #4f46e5;
    border-color: #4f46e5;
}

.btn-xs {
    padding: 3px 6px;
    font-size: 10px;
    border-radius: 5px;
}

.export-row {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 8px;
}

/* Preview panel */
.preview-panel {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.preview-header {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border2);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.preview-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text2);
}

.preview-dims {
    font-size: 12px;
    font-family: 'JetBrains Mono', monospace;
    color: var(--accent2);
}

.canvas-wrap {
    padding: 14px;
    background: repeating-conic-gradient(var(--bg3) 0% 25%, transparent 0% 50%) 0 0 / 16px 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
}

#canvas {
    max-width: 100%;
    max-height: 450px;
    display: block;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    border-radius: 2px;
}

.url-display {
    padding: 8px 14px;
    border-top: 1px solid var(--border2);
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg3);
    font-size: 11px;
}

.url-label {
    color: var(--text3);
    flex-shrink: 0;
}

.url-value {
    color: var(--accent2);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 11px;
}

.history-strip {
    padding: 10px 14px;
    border-top: 1px solid var(--border2);
    display: flex;
    gap: 8px;
    overflow-x: auto;
}

.history-thumb {
    width: 60px;
    height: 40px;
    border-radius: 6px;
    border: 1px solid var(--border);
    flex-shrink: 0;
    cursor: pointer;
    overflow: hidden;
    transition: var(--t);
}

.history-thumb:hover {
    border-color: var(--accent);
}

.history-thumb canvas {
    width: 100%;
    height: 100%;
    display: block;
}

/* Toast */
.toast-wrap {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 6px;
    pointer-events: none;
}

.toast {
    background: var(--bg2);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 10px;
    padding: 8px 14px;
    font-size: 12px;
    color: var(--text);
    transform: translateX(20px);
    opacity: 0;
    transition: all 0.22s ease;
    pointer-events: all;
}

.toast.show {
    transform: none;
    opacity: 1;
}

::-webkit-scrollbar {
    width: 4px;
    height: 4px
}

::-webkit-scrollbar-track {
    background: transparent
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 2px
}

@media(max-width:768px) {
    .main-grid {
        grid-template-columns: 1fr;
    }
}