/* CUWEditor site theme - ported 1:1 from the desktop app's own color palette (dark grey glass,
   blue accent, soft moving glows). Keep these values in sync with the app if its palette changes. */
:root {
    --bg-a: #323742;      /* gradient top-left */
    --bg-b: #15171c;      /* gradient bottom-right */
    --accent: #2563eb;    /* blue: primary buttons, selection, links */
    --accent-light: #86a6f2;
    --glow2: #1e46b4;     /* indigo glow */
    --glow3: #607dbe;     /* slate-blue glow */
    --ink: #fafbfd;       /* main text */
    --beige: #c6cfde;     /* secondary text */
    --mute: #98a3b4;
    --faint: #788395;
    --green: #62d696;
    --red: #f46a6a;
    --amber: #f7b84b;

    --glass-fill: rgba(255, 255, 255, 0.07);
    --glass-border: rgba(255, 255, 255, 0.15);
    --panel-fill: rgba(255, 255, 255, 0.04);
    --panel-border: rgba(255, 255, 255, 0.12);
    --well-fill: rgba(0, 0, 0, 0.27);
    --well-border: rgba(255, 255, 255, 0.09);

    --radius-card: 14px;
    --radius-panel: 10px;
    --radius-control: 8px;
    --font-ui: "Segoe UI", system-ui, -apple-system, sans-serif;
    --font-semi: "Segoe UI Semibold", "Segoe UI", system-ui, -apple-system, sans-serif;
    --font-mono: "Consolas", "SFMono-Regular", Menlo, monospace;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    min-height: 100%;
    font-family: var(--font-ui);
    color: var(--ink);
}
html { background: var(--bg-b); }
body { background: transparent; }

body {
    position: relative;
    overflow-x: hidden;
    display: flow-root; /* keeps the topbar's top margin inside body instead of collapsing out */
}

/* Backdrop: drawn by js/backdrop.js, a port of the app's own backdrop animation (diagonal gradient
   plus three drifting blue glows). The canvas is a tiny grid the browser scales up smoothly. The
   gradient here is only the fallback before the script runs or if it is blocked. */
.bg {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    display: block;
    background: linear-gradient(135deg, var(--bg-a) 0%, var(--bg-b) 70%);
}

a { color: var(--accent-light); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { font-family: var(--font-semi); color: var(--ink); margin: 0 0 12px; }
h1 { font-size: 30px; }
h2 { font-size: 20px; }
h3 { font-size: 15px; }
p { line-height: 1.55; color: var(--ink); margin: 0 0 12px; }
small, .mute { color: var(--mute); }
.faint { color: var(--faint); }
code, .mono { font-family: var(--font-mono); }

.wrap {
    max-width: 980px;
    margin: 0 auto;
    padding: 24px 16px 64px;
}

/* --- Top bar, styled like the app's own title card --- */
.topbar {
    max-width: 980px;
    margin: 16px auto 0;
    padding: 0 16px;
}
.topbar-card {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--glass-fill);
    backdrop-filter: blur(20px) saturate(140%);
    -webkit-backdrop-filter: blur(20px) saturate(140%);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-card);
    padding: 10px 16px;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.2) inset, 0 12px 32px rgba(0, 0, 0, 0.3);
}
.logo-mark {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: block;
    flex: none;
}
.brand { font-family: var(--font-semi); font-size: 18px; }
.nav {
    display: flex;
    gap: 6px;
    margin-left: 8px;
    flex-wrap: wrap;
}
.nav a {
    color: var(--beige);
    padding: 7px 12px;
    border-radius: var(--radius-control);
    font-size: 14px;
}
.nav a:hover { background: rgba(255, 255, 255, 0.08); text-decoration: none; }
.nav a.active { background: var(--accent); color: #fff; }
.topbar-spacer { flex: 1; }
/* Buy is a sibling of .nav, not one of its links - .nav sizes to its own content, so a
   margin-left: auto *inside* it has no room to push against. As a direct flex child of
   .topbar-card, margin-left: auto here consumes .topbar-card's real remaining space, landing Buy
   flush against the card's right edge. Styled as its own green glass-gradient accent rather than
   the plain accent-blue "active" treatment, so it reads as a distinct call-to-action. */
.buy-cta {
    margin-left: auto;
    flex: none;
    display: inline-block;
    padding: 7px 14px;
    border-radius: var(--radius-control);
    font-family: var(--font-semi);
    font-size: 14px;
    color: var(--ink);
    background: linear-gradient(135deg, rgba(98, 214, 150, 0.38), rgba(98, 214, 150, 0.14));
    border: 1px solid rgba(98, 214, 150, 0.45);
}
.buy-cta:hover { background: linear-gradient(135deg, rgba(98, 214, 150, 0.55), rgba(98, 214, 150, 0.22)); text-decoration: none; }
.buy-cta.active { background: linear-gradient(135deg, var(--green), rgba(98, 214, 150, 0.55)); border-color: var(--green); color: #0b2117; }

/* --- Cards / panels / wells, matching the app's own card/panel/well styling --- */
.card {
    background: var(--glass-fill);
    backdrop-filter: blur(20px) saturate(140%);
    -webkit-backdrop-filter: blur(20px) saturate(140%);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-card);
    padding: 22px 24px;
    margin-bottom: 20px;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.2) inset, 0 12px 32px rgba(0, 0, 0, 0.3);
}
.panel {
    background: var(--panel-fill);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--panel-border);
    border-radius: var(--radius-panel);
    padding: 14px 16px;
    margin-bottom: 14px;
}
.well {
    background: var(--well-fill);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--well-border);
    border-radius: var(--radius-panel);
    padding: 12px 14px;
    margin-bottom: 14px;
}
.sect {
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.06em;
    color: var(--faint);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 6px;
    margin: 18px 0 10px;
}
.sect:first-child { margin-top: 0; }

/* --- Buttons, matching the app's own button styling --- */
.btn {
    display: inline-block;
    font-family: var(--font-ui);
    font-size: 14px;
    padding: 8px 16px;
    border-radius: var(--radius-control);
    border: 1px solid var(--accent-light);
    background: rgba(37, 99, 235, 0.20);
    color: var(--ink);
    cursor: pointer;
}
.btn:hover { background: rgba(37, 99, 235, 0.36); text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); }
.btn.primary:hover { filter: brightness(1.12); }
.btn.danger { background: var(--red); border-color: var(--red); color: #241012; }
.btn.success { background: var(--green); border-color: var(--green); color: #0b2117; }
.btn.success:hover { filter: brightness(1.12); }

/* --- Notes / banners, matching the app's own banner styling --- */
.note {
    border-radius: var(--radius-panel);
    border: 1px solid;
    padding: 10px 14px;
    margin: 12px 0;
    font-size: 13.5px;
}
.note.amber { background: rgba(247, 184, 75, 0.12); border-color: rgba(247, 184, 75, 0.4); color: var(--amber); }
.note.red { background: rgba(244, 106, 106, 0.12); border-color: rgba(244, 106, 106, 0.4); color: var(--red); }
.note.green { background: rgba(98, 214, 150, 0.12); border-color: rgba(98, 214, 150, 0.4); color: var(--green); }

/* --- Tier badges, matching the Presets screen's STABLE / EXPERIMENTAL labels --- */
.tier {
    display: inline-block;
    font-family: var(--font-semi);
    font-size: 11px;
    letter-spacing: 0.06em;
    padding: 2px 8px;
    border-radius: 999px;
    margin-bottom: 8px;
}
.tier.stable { color: var(--ink); background: rgba(255, 255, 255, 0.1); }
.tier.experimental { color: var(--amber); background: rgba(247, 184, 75, 0.12); }

/* --- Misc layout --- */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 760px) {
    .grid2, .grid3 { grid-template-columns: 1fr; }
    h1 { font-size: 24px; }
}
@media (max-width: 560px) {
    .topbar-card { flex-wrap: wrap; row-gap: 8px; padding: 10px 14px; }
    .brand { font-size: 16px; }
    .nav { order: 3; width: 100%; margin-left: 0; justify-content: center; }
    .buy-cta { margin-left: auto; }
}
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid rgba(255,255,255,0.06); font-size: 13.5px; }
.kv:last-child { border-bottom: none; }
.kv .k { color: var(--faint); }
.kv .v { color: var(--ink); text-align: right; }

.shotgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.shot { border-radius: var(--radius-card); overflow: hidden; border: 1px solid var(--panel-border); background: var(--well-fill); }
.shot img { display: block; width: 100%; height: auto; }
.shot figcaption { padding: 8px 12px; font-size: 13px; color: var(--faint); }
.shot figcaption strong { color: var(--ink); font-family: var(--font-semi); }
.shot-cap { font-size: 12.5px; color: var(--mute); margin: 8px 0 18px; }

footer {
    max-width: 980px;
    margin: 20px auto 40px;
    padding: 0 16px;
    color: var(--faint);
    font-size: 12.5px;
    text-align: center;
}
