:root {
    --bg: #090d16;
    --bg2: #0f172a;
    --card: #1e293b;
    --border: #334155;
    --text: #f8fafc;
    --muted: #94a3b8;
    --accent: #f43f5e; /* Rose / Vibrant palette accent */
    --accent-hover: #e11d48;
    --cyan: #06b6d4;
    --purple: #a855f7;
    --amber: #f59e0b;
    --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { background: var(--bg); color: var(--text); font-family: var(--sans); line-height: 1.5; -webkit-font-smoothing: antialiased; }

/* Navbar */
.navbar { background: rgba(15,23,42,.85); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 100; }
.nav-container { max-width: 1240px; margin: 0 auto; padding: 12px 20px; display: flex; justify-content: space-between; align-items: center; }
.logo { display: flex; align-items: center; gap: 10px; }
.logo-icon { font-size: 22px; }
.logo-text { font-size: 18px; font-weight: 800; }
.accent { color: var(--accent); }
.badge { font-size: 11px; background: rgba(244,63,94,.15); color: #fb7185; padding: 2px 8px; border-radius: 999px; font-weight: 600; border: 1px solid rgba(244,63,94,.3); }
.nav-right { display: flex; align-items: center; gap: 14px; }
.privacy-chip { font-size: 12px; background: rgba(16,185,129,.1); border: 1px solid rgba(16,185,129,.3); color: #34d399; padding: 4px 10px; border-radius: 999px; }
.nav-link { color: var(--muted); text-decoration: none; font-size: 13px; }
.nav-link:hover { color: var(--text); }

/* Container */
.container { max-width: 1240px; margin: 0 auto; padding: 0 20px; }

/* Hero */
.hero { text-align: center; padding: 36px 0 20px; }
.hero h1 { font-size: 34px; font-weight: 800; letter-spacing: -1px; margin-bottom: 10px; }
.gradient-text { background: linear-gradient(135deg, #f43f5e, #fb923c, #facc15, #06b6d4); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.subtitle { color: var(--muted); font-size: 15px; max-width: 680px; margin: 0 auto; }

/* Upload Section */
.upload-section { margin-bottom: 24px; }
.dropzone {
    background: var(--card);
    border: 2px dashed var(--border);
    border-radius: 12px;
    padding: 36px 20px;
    text-align: center;
    cursor: pointer;
    transition: all .2s;
    position: relative;
}
.dropzone:hover, .dropzone.dragover {
    border-color: var(--accent);
    background: rgba(244,63,94,.04);
}
.file-input { display: none; }
.drop-icon { font-size: 38px; margin-bottom: 8px; }
.drop-text { font-size: 15px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.browse-link { color: var(--accent); text-decoration: underline; cursor: pointer; }
.drop-hint { font-size: 12px; color: var(--muted); }

/* Samples Bar */
.samples-bar { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; margin-top: 14px; font-size: 13px; }
.sample-label { color: var(--muted); font-weight: 500; }
.btn-sample {
    background: var(--bg2);
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 12px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all .2s;
}
.btn-sample:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* Workspace Grid */
.workspace-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}
@media (max-width: 960px) { .workspace-grid { grid-template-columns: 1fr; } }

.panel {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    flex-wrap: wrap;
    gap: 8px;
}
.panel-title { font-size: 15px; font-weight: 700; color: var(--text); }
.eyedropper-hint { font-size: 11px; color: var(--muted); }

/* Canvas Viewport */
.canvas-wrapper {
    position: relative;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 280px;
    max-height: 420px;
    cursor: crosshair;
}
#imageCanvas {
    max-width: 100%;
    max-height: 420px;
    object-fit: contain;
    display: block;
}

/* Eyedropper Loupe */
.loupe {
    position: absolute;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 4px 14px rgba(0,0,0,.6);
    pointer-events: none;
    transform: translate(-50%, -120%);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    z-index: 10;
}
.loupe-preview { width: 100%; height: 100%; position: absolute; top: 0; left: 0; z-index: -1; }
.loupe-text {
    font-family: var(--mono);
    font-size: 10px;
    font-weight: 800;
    color: #fff;
    background: rgba(0,0,0,.7);
    padding: 2px 4px;
    border-radius: 3px;
}

/* Controls Bar */
.controls-bar {
    display: flex;
    gap: 16px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid rgba(51,65,85,.5);
}
.control-group { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.select-control {
    background: var(--bg2);
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 12px;
    padding: 5px 8px;
    border-radius: 6px;
    outline: none;
}

/* Swatches Grid */
.swatches-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}
.swatch-card {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: transform .2s, box-shadow .2s;
    display: flex;
    flex-direction: column;
}
.swatch-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 16px rgba(0,0,0,.4);
}
.swatch-color {
    height: 75px;
    width: 100%;
    position: relative;
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    padding: 6px;
}
.swatch-copy-hint {
    background: rgba(0,0,0,.6);
    color: #fff;
    font-size: 10px;
    padding: 2px 5px;
    border-radius: 3px;
    opacity: 0;
    transition: opacity .2s;
}
.swatch-card:hover .swatch-copy-hint { opacity: 1; }
.swatch-meta {
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.swatch-hex { font-family: var(--mono); font-size: 13px; font-weight: 700; color: var(--text); }
.swatch-rgb { font-family: var(--mono); font-size: 10px; color: var(--muted); }
.swatch-pct { font-size: 10px; color: #64748b; font-weight: 500; }

/* Export Box */
.export-box {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.export-tabs {
    display: flex;
    background: rgba(15,23,42,.8);
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
}
.export-tab {
    background: none;
    border: none;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    padding: 8px 12px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all .2s;
    white-space: nowrap;
}
.export-tab:hover { color: var(--text); }
.export-tab.active { color: var(--accent); border-bottom-color: var(--accent); background: rgba(244,63,94,.05); }

.export-content { position: relative; padding: 12px; }
.export-content pre { margin: 0; max-height: 140px; overflow-y: auto; }
.export-content code {
    font-family: var(--mono);
    font-size: 11px;
    color: #38bdf8;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-all;
}
.btn-copy-code {
    position: absolute;
    top: 8px;
    right: 8px;
    background: #0284c7;
    border: none;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 4px;
    cursor: pointer;
    transition: background .2s;
}
.btn-copy-code:hover { background: #0369a1; }

.btn-action {
    background: var(--bg2);
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 12px;
    font-weight: 600;
    padding: 5px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: all .2s;
}
.btn-action:hover { border-color: var(--accent); color: var(--accent); }

/* Tool Suite Links */
.tool-matrix { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 20px; margin-bottom: 24px; text-align: center; }
.matrix-title { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; display: block; margin-bottom: 14px; }
.matrix-links { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.matrix-badge { background: var(--bg2); border: 1px solid var(--border); color: var(--text); text-decoration: none; font-size: 12px; padding: 7px 14px; border-radius: 8px; transition: all .2s; display: inline-flex; align-items: center; gap: 6px; }
.matrix-badge:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }
.matrix-badge.active { border-color: var(--accent); background: rgba(244,63,94,.1); }

/* Ad Wrapper */
.ad-wrapper { margin: 20px 0; text-align: center; }
.ad-container { display: inline-block; min-height: 90px; background: rgba(15,23,42,.6); border: 1px solid var(--border); border-radius: 8px; padding: 4px; max-width: 100%; overflow-x: auto; }
.ad-caption { font-size: 11px; color: #475569; margin-top: 6px; }

/* Donation Bar */
.donation-bar { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; padding: 12px 16px; background: rgba(245,158,11,.08); border: 1px solid rgba(245,158,11,.25); border-radius: 10px; margin-bottom: 30px; font-size: 13px; color: #f8fafc; }
.amazon-link { color: #fbbf24; text-decoration: none; font-weight: 700; }
.amazon-link:hover { text-decoration: underline; }
.btn-copy-email { background: none; border: 1px dashed rgba(251,191,36,.4); color: #fbbf24; font-size: 12px; font-family: var(--mono); padding: 3px 10px; border-radius: 5px; cursor: pointer; transition: all .2s; }
.btn-copy-email:hover { background: rgba(251,191,36,.1); }

/* Footer */
.footer { text-align: center; padding: 24px 20px; border-top: 1px solid var(--border); color: var(--muted); font-size: 13px; }

/* Toast */
.toast { position: fixed; bottom: 24px; right: 24px; background: var(--accent); color: #fff; padding: 10px 20px; border-radius: 8px; font-size: 13px; font-weight: 700; box-shadow: 0 8px 24px rgba(0,0,0,.4); opacity: 0; transform: translateY(10px); transition: all .2s; pointer-events: none; z-index: 9999; }
.toast.show { opacity: 1; transform: translateY(0); }
