/* ============================================================
   BuildersChest — Midnight theme (modern dark)
   Adapted from /mc template; integrated with app components.
   ============================================================ */

:root {
    --bg: #08070d;
    --bg-elev: #100e1a;
    --bg-elev-2: #161324;
    --surface: #14111f;
    --surface-hi: #1c192c;
    --line: #2a263f;
    --line-hi: #3e3858;
    --ink: #f4f0ff;
    --ink-2: #c8c0e8;
    --muted: #7e7798;
    --muted-2: #4f4a66;
    --accent: #ff3060;
    --accent-2: #d8104a;
    --accent-deep: #6a0820;
    --accent-glow: rgba(255, 48, 96, .18);
    --accent-ring: rgba(255, 48, 96, .4);
    --redstone: #ff3060;
    --gold: #ffe040;
    --diamond: #6ad4ff;
    --shadow-soft: 0 1px 2px rgba(0,0,0,.6), 0 8px 24px rgba(60,8,30,.4);
    --shadow-pop: 0 1px 0 rgba(255,80,140,.08) inset, 0 12px 32px rgba(60,8,30,.55);
    --radius: 10px;
    --radius-sm: 7px;
    --radius-lg: 14px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    background: var(--bg);
    color: var(--ink);
    font-family: 'Geist', system-ui, -apple-system, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
    letter-spacing: -0.005em;
}
body::before {
    content: "";
    position: fixed; inset: 0; pointer-events: none; z-index: 0;
    background:
        radial-gradient(60vw 50vh at 80% -10%, var(--accent-glow), transparent 70%),
        radial-gradient(50vw 40vh at 0% 20%, rgba(90, 215, 224, 0.08), transparent 70%);
}

a { color: var(--ink-2); text-decoration: none; }
a:hover { color: var(--ink); }

.text-muted { color: var(--muted) !important; }
.mono, code { font-family: 'Geist Mono', ui-monospace, monospace; letter-spacing: 0; }
.eyebrow {
    font-family: 'Geist Mono', monospace;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: var(--muted);
    font-weight: 500;
    display: inline-block;
}
.display {
    font-family: 'Instrument Serif', 'Geist', serif;
    font-weight: 400;
    letter-spacing: -0.02em;
    line-height: 1.05;
}

/* ───── Topbar ───── */
.topbar {
    position: sticky; top: 0; z-index: 50;
    background: color-mix(in oklab, var(--bg) 100%, transparent 20%);
    backdrop-filter: saturate(160%) blur(18px);
    -webkit-backdrop-filter: saturate(160%) blur(18px);
    border-bottom: 1px solid var(--line);
}
.topbar-inner {
    max-width: 1240px;
    margin: 0 auto;
    padding: 8px 28px;
    display: flex;
    align-items: center;
    gap: 24px;
}
.brand {
    display: flex; align-items: center;
    color: var(--ink) !important; text-decoration: none !important;
    line-height: 0;
}
.brand:hover { opacity: 0.9; }
.brand-logo { height: 64px; width: auto; display: block; }
@media (max-width: 720px) {
    .brand-logo { height: 48px; }
}

.nav { display: flex; align-items: center; gap: 4px; margin-left: 12px; }
.nav a {
    color: var(--ink-2);
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 500;
    border-radius: var(--radius-sm);
    transition: background .15s, color .15s;
}
.nav a:hover { background: var(--surface); color: var(--ink); }
.nav a.active { background: var(--surface-hi); color: var(--ink); }

.topbar-end { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.user-pill {
    display: flex; align-items: center; gap: 8px;
    padding: 4px 10px 4px 4px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 999px;
    font-size: 13px;
    color: var(--ink-2);
    transition: background .15s;
}
.user-pill:hover { background: var(--surface-hi); color: var(--ink); }
.user-pill .avatar {
    width: 22px; height: 22px;
    border-radius: 999px;
    background: conic-gradient(from 200deg, #5865f2 0%, #7c8ef5 30%, #5865f2 60%, #404eed 100%);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.15);
    flex-shrink: 0;
    position: relative;
}
.user-pill .avatar::after {
    content: "";
    position: absolute; right: -1px; bottom: -1px;
    width: 8px; height: 8px;
    border-radius: 999px;
    background: var(--accent);
    border: 2px solid var(--bg);
}
.user-pill form { margin: 0; display: inline; }
.user-pill button.logout {
    background: transparent; border: 0; color: var(--muted);
    font: inherit; font-size: 12px; cursor: pointer;
    padding: 0 0 0 6px; border-left: 1px solid var(--line);
    margin-left: 2px;
}
.user-pill button.logout:hover { color: var(--ink); }

/* ───── Buttons ───── */
.btn {
    appearance: none; cursor: pointer;
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    padding: 7px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line-hi);
    background: var(--surface);
    color: var(--ink) !important;
    display: inline-flex; align-items: center; gap: 6px;
    transition: background .15s, border-color .15s, transform .08s;
    letter-spacing: -.005em;
    white-space: nowrap;
    text-decoration: none !important;
}
.btn:hover { background: var(--surface-hi); border-color: var(--muted-2); }
.btn:active { transform: translateY(1px); }
.btn-primary {
    background: var(--accent);
    color: #1a0608 !important;
    border-color: var(--accent-2);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.18), 0 1px 2px rgba(0,0,0,.5), 0 0 0 0 var(--accent-ring);
    font-weight: 600;
    transition: box-shadow .2s, background .15s, transform .08s;
}
.btn-primary:hover {
    background: color-mix(in oklab, var(--accent) 100%, white 8%);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 1px 2px rgba(0,0,0,.4), 0 0 0 4px var(--accent-glow);
}
.btn-ghost {
    background: transparent;
    border-color: var(--line);
    color: var(--ink-2) !important;
}
.btn-ghost:hover { background: var(--surface); color: var(--ink) !important; }
.btn-icon { padding: 7px 8px; }
.btn-discord {
    background: #5865f2;
    color: #fff !important;
    border-color: #4752c4;
    font-weight: 500;
}
.btn-discord:hover { background: #6975ff; }
.btn-danger {
    background: var(--redstone);
    color: #1a0808 !important;
    border-color: rgba(255, 80, 80, 0.55);
    font-weight: 600;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.18), 0 1px 2px rgba(0,0,0,.4);
}
.btn-danger:hover { background: color-mix(in oklab, var(--redstone) 100%, white 8%); }

/* ───── Main ───── */
.app { position: relative; z-index: 1; min-height: 100vh; display: flex; flex-direction: column; }
main.bc-main {
    max-width: 1240px;
    width: 100%;
    margin: 0 auto;
    padding: 28px 28px 60px;
    flex: 1;
    background: transparent;
    border: 0;
    box-shadow: none;
}

/* ───── Hero ───── */
.hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 32px;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--line);
}
.hero-stats {
    display: flex;
    gap: 28px;
    margin-top: 18px;
    align-items: end;
}
.hero-emblem {
    width: 140px;
    height: 140px;
    object-fit: contain;
    filter: drop-shadow(0 8px 24px var(--accent-glow));
    animation: bc-emblem-float 6s ease-in-out infinite;
    align-self: center;
}
@keyframes bc-emblem-float {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-6px); }
}
@media (max-width: 720px) {
    .hero { grid-template-columns: 1fr; }
    .hero-emblem { width: 96px; height: 96px; justify-self: end; }
}
@media (max-width: 480px) {
    .hero-emblem { display: none; }
}
.hero-h {
    font-size: 40px;
    line-height: 1;
    margin: 8px 0 0;
    letter-spacing: -.025em;
    font-weight: 500;
    font-family: 'Geist', system-ui, sans-serif;
    color: var(--ink);
}
.hero-h em {
    font-family: 'Instrument Serif', serif;
    font-style: italic;
    font-weight: 400;
    color: var(--accent);
    letter-spacing: -.01em;
}
.hero-sub {
    color: var(--muted);
    font-size: 14px;
    margin-top: 10px;
    max-width: 460px;
}
.hero-stats { display: flex; gap: 28px; align-items: end; }
.hero-stat .n {
    font-family: 'Instrument Serif', serif;
    font-size: 32px;
    line-height: 1;
    color: var(--ink);
    letter-spacing: -.01em;
}
.hero-stat .l {
    display: block;
    font-family: 'Geist Mono', monospace;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--muted);
    margin-top: 6px;
}

/* ───── Layout shell ───── */
.layout-shell {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 36px;
    align-items: start;
}
@media (max-width: 920px) { .layout-shell { grid-template-columns: 1fr; } }

.sidebar { display: flex; flex-direction: column; gap: 24px; position: sticky; top: 80px; }
.side-section .side-title {
    font-family: 'Geist Mono', monospace;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--muted);
    margin: 0 6px 8px;
    font-weight: 500;
}
.side-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 1px; }
.side-list li { display: contents; }
.side-list a, .side-list button {
    appearance: none; border: 0; cursor: pointer;
    font: inherit;
    background: transparent;
    text-align: left;
    display: flex; align-items: center; gap: 10px;
    padding: 7px 10px;
    border-radius: var(--radius-sm);
    color: var(--ink-2);
    font-size: 13px;
    font-weight: 500;
    transition: background .12s, color .12s;
    text-decoration: none;
    width: 100%;
}
.side-list a:hover, .side-list button:hover { background: var(--surface); color: var(--ink); }
.side-list a.active, .side-list button.active { background: var(--surface-hi); color: var(--ink); }
.side-list .dot {
    width: 8px; height: 8px;
    border-radius: 2px;
    flex-shrink: 0;
    background: var(--muted-2);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.18);
}
.side-list .ct {
    margin-left: auto;
    font-family: 'Geist Mono', monospace;
    font-size: 11px;
    color: var(--muted);
    font-weight: 400;
}

/* ───── Search row ───── */
.search-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    margin-bottom: 14px;
    align-items: center;
}
.search-wrap { position: relative; }
.search-input, .form-control, .form-select, .bc-tag-input {
    appearance: none; outline: none;
    width: 100%;
    padding: 11px 14px;
    font: inherit;
    font-size: 14px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    color: var(--ink);
    transition: border-color .15s, box-shadow .15s, background .15s;
}
.search-input { padding-left: 38px; padding-right: 50px; }
.search-input::placeholder, .form-control::placeholder { color: var(--muted); }
.search-input:focus, .form-control:focus, .form-select:focus, .bc-tag-input:focus-within {
    border-color: var(--accent-ring) !important;
    box-shadow: 0 0 0 4px var(--accent-glow) !important;
    background: var(--surface-hi);
}
.search-icon {
    position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
    width: 16px; height: 16px;
    color: var(--muted);
    pointer-events: none;
}
.search-kbd {
    position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
    font-family: 'Geist Mono', monospace;
    font-size: 11px;
    color: var(--muted);
    background: var(--bg-elev-2);
    border: 1px solid var(--line);
    border-radius: 5px;
    padding: 1px 6px;
}

/* form labels */
.form-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--ink-2);
    margin-bottom: 6px;
    letter-spacing: -.005em;
}
.form-text { color: var(--muted); font-size: 12px; margin-top: 4px; }
textarea.form-control { line-height: 1.5; }

/* ───── Filter chips ───── */
.chip-row {
    display: flex; flex-wrap: wrap; gap: 6px;
    margin-bottom: 22px;
    align-items: center;
}
.chip {
    appearance: none; cursor: pointer;
    font: inherit; font-size: 12px; font-weight: 500;
    padding: 5px 10px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: transparent;
    color: var(--ink-2) !important;
    display: inline-flex; align-items: center; gap: 5px;
    transition: background .12s, border-color .12s, color .12s;
    text-decoration: none !important;
}
.chip:hover { background: var(--surface); color: var(--ink) !important; border-color: var(--line-hi); }
.chip.active { background: var(--ink); color: var(--bg) !important; border-color: var(--ink); }
.chip .ct { font-family: 'Geist Mono', monospace; font-size: 10px; color: var(--muted); }
.chip.active .ct { color: var(--muted-2); }

.chip-fav .heart-glyph { color: var(--redstone); margin-right: 1px; }
.chip-fav.active { background: var(--redstone); border-color: var(--redstone); color: #1a0808 !important; }
.chip-fav.active .heart-glyph { color: #1a0808; }

.chip-x { font-size: 13px; opacity: .8; margin-left: 2px; }

.bc-active-tags {
    display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
    margin-bottom: 12px;
    padding: 8px 12px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}
.bc-active-tags-label {
    font-family: 'Geist Mono', monospace;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--muted);
    margin-right: 4px;
}

/* tag-more details/summary */
.bc-tag-more { display: inline-block; }
.bc-tag-more summary {
    cursor: pointer;
    list-style: none;
    user-select: none;
    color: var(--muted);
}
.bc-tag-more summary::-webkit-details-marker { display: none; }
.bc-tag-more[open] > summary { color: var(--ink); }
.bc-tag-more-list {
    display: flex; flex-wrap: wrap; gap: 6px;
    margin-top: 10px; padding-top: 10px;
    border-top: 1px dashed var(--line);
    width: 100%;
}

/* ───── Results header ───── */
.results-hd {
    display: flex; align-items: baseline; justify-content: space-between;
    margin-bottom: 14px;
    gap: 16px;
}
.results-hd h2 {
    font-size: 13px; font-weight: 600;
    margin: 0; color: var(--ink);
}
.results-hd .count {
    font-family: 'Geist Mono', monospace;
    font-size: 12px;
    color: var(--muted);
    margin-left: 10px;
}

/* ───── Card feed ───── */
.feed {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
}

.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    display: grid;
    grid-template-columns: 140px 1fr;
    overflow: hidden;
    position: relative;
    transition: border-color .18s, transform .18s, box-shadow .18s, background .18s;
    color: var(--ink) !important;
    text-decoration: none !important;
}
.card::after {
    content: "";
    position: absolute; inset: 0;
    border-radius: inherit;
    pointer-events: none;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
}
.card:hover {
    border-color: var(--line-hi);
    transform: translateY(-1px);
    background: var(--surface-hi);
    box-shadow: var(--shadow-soft);
}

.thumb {
    position: relative;
    overflow: hidden;
    min-height: 130px;
    background: var(--bg-elev-2) center/cover no-repeat;
    border-right: 1px solid var(--line);
}
.thumb-bg {
    position: absolute; inset: 0;
    background-size: 8px 8px;
    background-image:
        linear-gradient(rgba(255,255,255,.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.03) 1px, transparent 1px);
}
.thumb-glow {
    position: absolute; inset: 0;
    background: radial-gradient(ellipse at 50% 30%, var(--thumb-tint, var(--accent-glow)), transparent 70%);
    pointer-events: none;
}
.thumb[data-source="reddit"]    { --thumb-tint: rgba(255, 86, 0,  .25); }
.thumb[data-source="youtube"]   { --thumb-tint: rgba(255, 60, 60, .25); }
.thumb[data-source="imgur"]     { --thumb-tint: rgba(110, 200, 90, .22); }
.thumb[data-source="schematic"] { --thumb-tint: rgba(224, 166, 74, .28); }
.thumb[data-source="generic"]   { --thumb-tint: rgba(120, 130, 160, .25); }
.thumb img.thumb-img {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    z-index: 1;
}

.card-body {
    padding: 14px 16px;
    display: flex; flex-direction: column;
    gap: 4px;
    min-width: 0;
    position: relative;
}
.card-row1 {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    margin-bottom: 6px;
}
.card-title {
    font-size: 16px; font-weight: 600;
    color: var(--ink); margin: 0;
    line-height: 1.25;
    letter-spacing: -.01em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.card-author { font-size: 12.5px; color: var(--ink-2); margin-top: 4px; }
.card-author b { color: var(--ink); font-weight: 500; }
.card-author .sub { color: var(--muted); }
.card-meta-line {
    font-family: 'Geist Mono', monospace;
    font-size: 11px;
    color: var(--muted);
    margin-top: 8px;
    display: flex; align-items: center; gap: 8px;
}
.card-meta-line .sep { color: var(--muted-2); }
.card-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 10px; }
.tag {
    font-family: 'Geist Mono', monospace;
    font-size: 11px;
    color: var(--muted);
    background: var(--bg-elev-2);
    border: 1px solid var(--line);
    padding: 1px 7px;
    border-radius: 5px;
    transition: color .12s, border-color .12s;
    text-decoration: none;
}
.tag:hover { color: var(--ink-2); border-color: var(--line-hi); }

/* ───── Source badge — DOT style ───── */
.badge {
    font-family: 'Geist Mono', monospace;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
    display: inline-flex; align-items: center; gap: 6px;
    flex-shrink: 0; white-space: nowrap;
    padding: 0;
    background: transparent;
    border: 0;
    color: var(--muted);
}
.badge::before {
    content: "";
    width: 6px; height: 6px;
    border-radius: 999px;
    background: currentColor;
    flex-shrink: 0;
}
.badge[data-source="reddit"]    { color: #ff7a3a; }
.badge[data-source="youtube"]   { color: #ff5a5a; }
.badge[data-source="imgur"]     { color: #6cc878; }
.badge[data-source="schematic"] { color: #e0a64a; }
.badge[data-source="generic"]   { color: #9fa8c0; }

/* ───── Favorite (heart) ───── */
.fav {
    position: absolute;
    top: 12px; right: 12px;
    width: 30px; height: 30px;
    border-radius: 8px;
    background: color-mix(in oklab, var(--bg) 100%, transparent 30%);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--line);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    z-index: 3; padding: 0;
    transition: background .15s, border-color .15s, transform .15s;
}
.fav:hover { background: var(--surface-hi); border-color: var(--line-hi); transform: scale(1.06); }
.fav-heart { width: 14px; height: 14px; transition: fill .2s, transform .25s cubic-bezier(.4, 1.6, .6, 1); }
.fav-heart path { fill: none; stroke: var(--muted); stroke-width: 2; transition: stroke .2s, fill .2s; }
.fav.on .fav-heart path { fill: var(--redstone); stroke: var(--redstone); }
.fav.pop .fav-heart { animation: bc-fav-pop .45s cubic-bezier(.4, 1.6, .6, 1); }
@keyframes bc-fav-pop {
    0%   { transform: scale(.85); }
    35%  { transform: scale(1.35); }
    70%  { transform: scale(.95); }
    100% { transform: scale(1); }
}
.fav-burst {
    position: absolute; inset: 0;
    pointer-events: none;
    display: flex; align-items: center; justify-content: center;
}
.fav-burst span {
    position: absolute;
    width: 4px; height: 4px;
    border-radius: 999px;
    background: var(--redstone);
    opacity: 0;
}
.fav.pop .fav-burst span { animation: bc-fav-burst .55s ease-out forwards; }
.fav.pop .fav-burst span:nth-child(1) { --tx:  16px; --ty: -16px; }
.fav.pop .fav-burst span:nth-child(2) { --tx: -18px; --ty: -12px; animation-delay: .03s; }
.fav.pop .fav-burst span:nth-child(3) { --tx:  20px; --ty:   8px; animation-delay: .06s; }
.fav.pop .fav-burst span:nth-child(4) { --tx: -20px; --ty:  12px; animation-delay: .04s; }
.fav.pop .fav-burst span:nth-child(5) { --tx:   2px; --ty: -22px; animation-delay: .02s; }
@keyframes bc-fav-burst {
    0%   { transform: translate(0,0) scale(1); opacity: 1; }
    100% { transform: translate(var(--tx), var(--ty)) scale(.4); opacity: 0; }
}
.fav-lg {
    position: static;
    width: 38px; height: 38px;
    border-radius: 9px;
    flex-shrink: 0;
}
.fav-lg .fav-heart { width: 16px; height: 16px; }

/* ───── Load more ───── */
.bc-load-more-wrap {
    display: flex;
    justify-content: center;
    padding: 24px 0 8px;
}
.bc-load-more {
    min-width: 180px;
    justify-content: center;
}
.bc-load-more[data-busy="1"] { opacity: .65; pointer-events: none; }

/* ───── Empty state ───── */
.empty {
    text-align: center;
    padding: 64px 20px;
    border: 1px dashed var(--line-hi);
    border-radius: var(--radius-lg);
    background: var(--surface);
    color: var(--muted);
}
.empty h3 {
    font-size: 18px; font-weight: 600;
    color: var(--ink); margin: 16px 0 6px;
    letter-spacing: -.01em;
}
.empty p { font-size: 13px; max-width: 360px; margin: 0 auto; }
.empty-glyph { display: inline-block; width: 56px; height: 56px; margin-bottom: 4px; }

/* ───── Footer ───── */
footer.app-footer {
    border-top: 1px solid var(--line);
    margin-top: auto;
    padding: 24px 28px;
    color: var(--muted);
    font-size: 12px;
}
.footer-inner {
    max-width: 1240px; margin: 0 auto;
    display: flex; align-items: center; gap: 14px;
    font-family: 'Geist Mono', monospace;
}
.footer-inner .dot { width: 4px; height: 4px; border-radius: 999px; background: var(--muted-2); }
.footer-inner b { font-family: 'Geist', sans-serif; color: var(--ink-2); font-weight: 600; }

/* ───── Headings used on detail/edit pages ───── */
h1.page-h, h1 {
    font-size: 26px;
    font-weight: 500;
    letter-spacing: -.02em;
    color: var(--ink);
    margin: 0 0 10px;
    font-family: 'Geist', sans-serif;
}
h1 em { font-family: 'Instrument Serif', serif; font-style: italic; color: var(--accent); }
h2 { font-size: 18px; font-weight: 600; color: var(--ink); margin: 0 0 8px; }
h3 { font-size: 16px; font-weight: 600; color: var(--ink); margin: 0 0 8px; }
h5 {
    font-family: 'Geist Mono', monospace;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: var(--muted);
    font-weight: 500;
    margin: 18px 0 8px;
}

/* ───── Detail page ───── */
.bc-title-row {
    display: flex; align-items: flex-start; gap: 12px;
    justify-content: space-between;
    flex-wrap: wrap;
    margin: 8px 0 14px;
}
.bc-title-row h1 { flex: 1; min-width: 0; margin: 0; }
.bc-title-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.bc-title-actions form { margin: 0; }

.bc-credit {
    background: var(--surface);
    border: 1px solid var(--line);
    border-left: 3px solid var(--accent);
    border-radius: var(--radius);
    padding: 12px 16px;
    margin: 0 0 16px;
    font-size: 13.5px;
    color: var(--ink-2);
    box-shadow: var(--shadow-soft);
}
.bc-credit > div { line-height: 1.5; }
.bc-credit > div + div { margin-top: 4px; }
.bc-credit-label {
    display: inline-block;
    min-width: 110px;
    font-family: 'Geist Mono', monospace;
    color: var(--muted);
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: .1em;
    margin-right: 8px;
}
.bc-credit a { color: var(--accent); text-decoration: none; }
.bc-credit a:hover { color: var(--accent-2); text-decoration: underline; }
.bc-credit strong { color: var(--ink); font-weight: 500; }

.bc-detail-embed {
    background: #000;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-soft);
    margin-bottom: 14px;
}
.bc-detail-embed video,
.bc-detail-embed iframe,
.bc-detail-embed > img {
    display: block;
    width: 100%;
    max-height: 75vh;
    object-fit: contain;
    background: #000;
}
.bc-detail-embed iframe { aspect-ratio: 16 / 9; max-height: none; }

.bc-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 4px;
    padding: 4px;
    background: #000;
}
.bc-gallery > a, .bc-gallery > video {
    display: block;
    border-radius: 6px;
    overflow: hidden;
    background: var(--bg-elev-2);
    aspect-ratio: 1;
    position: relative;
    transition: transform .15s ease;
}
.bc-gallery > a:hover { transform: scale(1.02); z-index: 1; }
.bc-gallery img, .bc-gallery video {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
}
.bc-gallery img { cursor: zoom-in; }
.bc-album-footer {
    background: #0d0d0d;
    color: var(--muted);
    padding: 10px 16px;
    text-align: center;
    font-size: 12px;
    border-top: 1px solid var(--line);
    font-family: 'Geist Mono', monospace;
}
.bc-album-footer a { color: var(--accent); }
.bc-album-footer a:hover { color: var(--accent-2); text-decoration: underline; }

.bc-source-body, .bc-description {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 12px 16px;
    white-space: pre-wrap;
    font-size: 13.5px;
    line-height: 1.6;
    color: var(--ink-2);
    box-shadow: var(--shadow-soft);
}
.bc-source-body { border-left: 3px solid var(--diamond); }

.bc-link-fallback {
    background: var(--surface);
    padding: 18px 20px;
    display: flex; flex-direction: column; align-items: flex-start;
    gap: 10px;
}
.bc-link-fallback a { word-break: break-all; color: var(--accent); }

/* ── Schematic card ── */
.bc-schematic {
    display: grid;
    grid-template-columns: 200px 1fr;
    background: var(--surface);
    color: var(--ink);
    min-height: 200px;
}
.bc-schematic-thumb {
    width: 100%; height: 100%;
    object-fit: cover;
    border-right: 1px solid var(--line);
    background: var(--bg-elev-2);
    cursor: zoom-in;
}
.bc-schematic-thumb-empty {
    display: flex; align-items: center; justify-content: center;
    background:
        radial-gradient(circle at 50% 40%, rgba(224, 166, 74, .18), transparent 70%),
        var(--bg-elev-2);
    border-right: 1px solid var(--line);
}
.bc-schematic-thumb-empty svg { width: 60%; height: auto; opacity: .85; }
.bc-schematic-body {
    padding: 18px 20px;
    display: flex; flex-direction: column; gap: 10px; align-items: flex-start;
    justify-content: center;
}
.bc-schematic-desc {
    color: var(--ink-2);
    font-size: 13.5px;
    line-height: 1.5;
    margin: 0;
    white-space: pre-wrap;
    display: -webkit-box;
    -webkit-line-clamp: 6;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.bc-schematic-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.bc-extra-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; margin-top: -6px; }
@media (max-width: 720px) {
    .bc-schematic { grid-template-columns: 1fr; }
    .bc-schematic-thumb, .bc-schematic-thumb-empty { aspect-ratio: 16/9; height: auto; border-right: 0; border-bottom: 1px solid var(--line); }
}

.bc-tags { display: flex; flex-wrap: wrap; gap: 5px; }

/* ───── Tag chip-input (form) ───── */
.bc-tag-input {
    display: flex; flex-wrap: wrap; gap: 6px;
    align-items: center;
    padding: 6px 8px;
    min-height: 44px;
    cursor: text;
}
.bc-tag-input-field {
    flex: 1;
    min-width: 140px;
    border: 0; outline: 0;
    background: transparent;
    color: var(--ink);
    font: inherit;
    padding: 4px 4px;
}
.bc-tag-input-field::placeholder { color: var(--muted); }
.bc-chip {
    display: inline-flex; align-items: center; gap: 4px;
    background: var(--accent);
    color: #051a06;
    border-radius: 999px;
    padding: 3px 4px 3px 10px;
    font-size: 12.5px;
    line-height: 1.3;
    font-weight: 500;
    user-select: none;
    animation: bc-chip-in .15s ease;
}
.bc-chip-label::before { content: "#"; opacity: .6; margin-right: 1px; }
.bc-chip-x {
    background: rgba(0,0,0,.2);
    color: #051a06;
    border: 0;
    border-radius: 999px;
    width: 18px; height: 18px;
    line-height: 1;
    font-size: 1rem;
    cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    padding: 0;
}
.bc-chip-x:hover { background: rgba(0,0,0,.4); }
@keyframes bc-chip-in {
    from { transform: scale(.7); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.bc-tag-suggest {
    margin-top: 10px;
    padding: 12px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}
.bc-tag-suggest-label {
    font-family: 'Geist Mono', monospace;
    font-size: 11px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .08em;
    margin-bottom: 8px;
}
.bc-tag-suggest-list {
    display: flex; flex-wrap: wrap; gap: 5px;
    max-height: 180px;
    overflow-y: auto;
}
.bc-tag-suggest-item {
    appearance: none; cursor: pointer;
    font: inherit;
    font-family: 'Geist Mono', monospace;
    font-size: 11px;
    color: var(--muted);
    background: var(--bg-elev-2);
    border: 1px solid var(--line);
    padding: 2px 8px;
    border-radius: 5px;
    display: inline-flex; align-items: center; gap: 5px;
    transition: color .12s, border-color .12s, background .12s;
}
.bc-tag-suggest-item:hover { color: var(--ink-2); border-color: var(--line-hi); }
.bc-tag-suggest-item.active {
    background: var(--accent);
    color: #051a06;
    border-color: var(--accent-2);
}
.bc-tag-suggest-item .bc-tag-count { color: inherit; opacity: .6; }
.bc-tag-count { font-family: 'Geist Mono', monospace; font-size: 10px; }

/* ───── Form layout helper ───── */
.bc-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-width: 720px;
}
.bc-form-row { display: flex; flex-direction: column; }
.bc-form-actions { display: flex; gap: 8px; margin-top: 4px; }

/* Collection header */
.bc-collection-hd {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    margin-bottom: 16px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
}
.bc-collection-hd-info { display: flex; gap: 12px; align-items: center; min-width: 0; flex: 1; }
.bc-collection-swatch {
    width: 32px; height: 32px; border-radius: 8px;
    background: var(--diamond);
    flex-shrink: 0;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.18);
}
.bc-collection-name {
    font-size: 18px; font-weight: 600; color: var(--ink);
    letter-spacing: -.01em;
}
.bc-collection-desc {
    font-size: 12.5px; color: var(--muted);
    margin-top: 2px;
}
.bc-collection-hd-actions { display: flex; gap: 6px; flex-shrink: 0; }

/* Sidebar add button */
.bc-add-collection-btn {
    appearance: none;
    background: transparent;
    border: 1px solid var(--line);
    color: var(--muted);
    width: 22px; height: 22px;
    border-radius: 5px;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    transition: background .12s, border-color .12s, color .12s;
}
.bc-add-collection-btn:hover { background: var(--surface); color: var(--ink); border-color: var(--line-hi); }

/* Color swatch picker (used in modals/popovers) */
.bc-color-picker { display: flex; gap: 6px; flex-wrap: wrap; }
.bc-color-swatch {
    appearance: none;
    width: 26px; height: 26px;
    border-radius: 6px;
    border: 2px solid transparent;
    cursor: pointer;
    padding: 0;
    transition: transform .1s, border-color .12s;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.18);
}
.bc-color-swatch:hover { transform: scale(1.1); }
.bc-color-swatch.active { border-color: var(--ink); }

/* Collection picker popover (idea detail) */
.bc-popover {
    position: absolute;
    top: 100%; right: 0;
    margin-top: 6px;
    width: 280px;
    background: var(--bg-elev);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-pop);
    padding: 10px;
    z-index: 100;
    display: none;
}
.bc-popover.open { display: block; }
.bc-popover-anchor { position: relative; }
.bc-popover-header {
    font-family: 'Geist Mono', monospace;
    font-size: 11px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .08em;
    padding: 4px 6px 8px;
}
.bc-popover-list {
    display: flex; flex-direction: column; gap: 1px;
    max-height: 220px;
    overflow-y: auto;
}
.bc-popover-item {
    appearance: none;
    background: transparent;
    border: 0;
    color: var(--ink-2);
    text-align: left;
    cursor: pointer;
    font: inherit;
    font-size: 13px;
    padding: 6px 8px;
    border-radius: 6px;
    display: flex; align-items: center; gap: 8px;
    transition: background .12s, color .12s;
}
.bc-popover-item:hover { background: var(--surface); color: var(--ink); }
.bc-popover-item .check {
    width: 14px; height: 14px;
    border: 1px solid var(--line-hi);
    border-radius: 3px;
    flex-shrink: 0;
    background: var(--bg-elev-2);
}
.bc-popover-item.contained .check {
    background: var(--accent);
    border-color: var(--accent-2);
    position: relative;
}
.bc-popover-item.contained .check::after {
    content: "✓";
    position: absolute;
    inset: 0;
    color: #1a0608;
    font-size: 11px;
    font-weight: 800;
    text-align: center;
    line-height: 12px;
}
.bc-popover-item .swatch {
    width: 8px; height: 8px;
    border-radius: 2px;
    flex-shrink: 0;
    background: var(--muted-2);
}
.bc-popover-item .name { flex: 1; min-width: 0; }
.bc-popover-divider { height: 1px; background: var(--line); margin: 8px 0; }
.bc-popover-create {
    display: flex; flex-direction: column; gap: 6px;
    padding: 4px 6px;
}
.bc-popover-create input {
    appearance: none;
    background: var(--bg-elev-2);
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--ink);
    font: inherit;
    font-size: 13px;
    padding: 6px 8px;
}
.bc-popover-create input:focus { outline: none; border-color: var(--accent-ring); box-shadow: 0 0 0 3px var(--accent-glow); }
.bc-popover-create-row { display: flex; gap: 6px; align-items: center; }
.bc-popover-error { color: var(--redstone); font-size: 11px; padding: 0 6px; }

/* ======================================================
   Create / Edit page — 2-col layout with live preview
   ====================================================== */

.create-page-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--line);
}
.create-page-head .page-h {
    font-size: 36px;
    font-weight: 500;
    margin: 8px 0 0;
    letter-spacing: -.025em;
    line-height: 1.05;
    font-family: 'Geist', sans-serif;
}
.create-page-head .page-h em {
    font-family: 'Instrument Serif', serif;
    font-style: italic; font-weight: 400;
    color: var(--accent);
}
.create-page-head .page-sub { color: var(--muted); margin-top: 8px; max-width: 480px; }

.create-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 380px;
    gap: 36px;
    align-items: start;
}
@media (max-width: 920px) { .create-grid { grid-template-columns: 1fr; } }

.create-form { display: flex; flex-direction: column; gap: 22px; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field-row {
    display: flex; align-items: baseline; justify-content: space-between;
    gap: 10px;
}
.field-label { font-size: 13px; font-weight: 600; color: var(--ink); letter-spacing: -.005em; }
.field-help { font-size: 12px; color: var(--muted); font-weight: 400; }

.input, .textarea {
    appearance: none; outline: none;
    width: 100%;
    padding: 11px 14px;
    font: inherit; font-size: 14px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 10px;
    color: var(--ink);
    transition: border-color .15s, box-shadow .15s, background .15s;
}
.input::placeholder, .textarea::placeholder { color: var(--muted); }
.input:focus, .textarea:focus {
    border-color: var(--accent-ring);
    box-shadow: 0 0 0 4px var(--accent-glow);
    background: var(--surface-hi);
}
.textarea { resize: vertical; min-height: 90px; line-height: 1.5; }

/* URL field with icon + paste */
.url-field { position: relative; }
.url-field .input { padding-left: 40px; padding-right: 90px; font-family: 'Geist Mono', monospace; font-size: 13px; }
.url-field .url-ico {
    position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
    width: 18px; height: 18px; color: var(--muted);
    transition: color .15s;
    pointer-events: none;
}
.url-field .input:focus ~ .url-ico,
.url-field.has-source .url-ico { color: var(--accent); }
.url-field .url-action {
    position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
    font-family: 'Geist Mono', monospace; font-size: 11px; font-weight: 600;
    padding: 5px 9px; border-radius: 6px;
    background: var(--bg-elev-2); border: 1px solid var(--line);
    color: var(--ink-2); cursor: pointer;
    transition: background .12s, color .12s;
}
.url-field .url-action:hover { background: var(--surface-hi); color: var(--ink); }

.url-detected {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 12px; color: var(--muted);
    margin-top: 4px;
}
.url-detected .badge-mini {
    font-family: 'Geist Mono', monospace; font-size: 10.5px; font-weight: 600;
    text-transform: uppercase; letter-spacing: .04em;
    padding: 2px 7px; border-radius: 999px;
}
.url-detected .badge-mini[data-src="reddit"]    { color: #ff7a3a; border: 1px solid rgba(255, 122, 58, .35); background: rgba(255, 122, 58, .08); }
.url-detected .badge-mini[data-src="youtube"]   { color: #ff5a5a; border: 1px solid rgba(255, 90, 90, .35); background: rgba(255, 90, 90, .08); }
.url-detected .badge-mini[data-src="imgur"]     { color: #6cc878; border: 1px solid rgba(108, 200, 120, .35); background: rgba(108, 200, 120, .08); }
.url-detected .badge-mini[data-src="schematic"] { color: #e0a64a; border: 1px solid rgba(224, 166, 74, .35); background: rgba(224, 166, 74, .1); }
.url-detected .badge-mini[data-src="generic"]   { color: #9fa8c0; border: 1px solid rgba(159, 168, 192, .35); background: rgba(159, 168, 192, .08); }
.url-detected .check {
    width: 14px; height: 14px; border-radius: 999px;
    background: var(--accent); color: #1a0608;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 9px; font-weight: 700;
}

/* OR divider */
.or {
    display: flex; align-items: center; gap: 10px;
    color: var(--muted-2);
    font-family: 'Geist Mono', monospace;
    font-size: 11px; text-transform: uppercase; letter-spacing: .15em;
    margin: -4px 0;
}
.or::before, .or::after {
    content: ""; flex: 1; height: 1px; background: var(--line);
}

/* Dropzone */
.dropzone {
    border: 1.5px dashed var(--line-hi);
    border-radius: 12px;
    padding: 22px 18px;
    background: color-mix(in oklab, var(--surface) 100%, transparent 50%);
    text-align: center;
    cursor: pointer;
    transition: border-color .15s, background .15s;
    position: relative;
}
.dropzone:hover, .dropzone.drag {
    border-color: var(--accent-ring);
    background: var(--accent-glow);
}
.dropzone-ico { width: 32px; height: 32px; margin: 0 auto 8px; color: var(--muted); transition: color .15s; }
.dropzone:hover .dropzone-ico, .dropzone.drag .dropzone-ico { color: var(--accent); }
.dropzone-h { font-size: 14px; color: var(--ink); font-weight: 500; margin: 0 0 2px; }
.dropzone-h u { color: var(--accent); text-decoration: none; border-bottom: 1px solid var(--accent-ring); }
.dropzone-sub { font-size: 12px; color: var(--muted); }

.dropzone.has-file {
    border-style: solid;
    border-color: var(--accent-ring);
    background: var(--accent-glow);
    padding: 12px;
    text-align: left;
    display: flex; align-items: center; gap: 12px;
}
.dropzone .file-thumb {
    width: 56px; height: 56px;
    border-radius: 8px;
    background: var(--bg-elev-2);
    border: 1px solid var(--line);
    flex-shrink: 0;
    background-size: cover; background-position: center;
}
.dropzone .file-info { flex: 1; min-width: 0; }
.dropzone .file-info b { display: block; color: var(--ink); font-size: 13px; font-weight: 500; }
.dropzone .file-info span { color: var(--muted); font-size: 11.5px; font-family: 'Geist Mono', monospace; }

/* Tag input — match new template look (re-uses .bc-tag-input internals) */
.tags-input {
    display: flex; flex-wrap: wrap;
    gap: 6px;
    padding: 8px 10px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 10px;
    transition: border-color .15s, box-shadow .15s;
    cursor: text;
    min-height: auto;
}
.tags-input:focus-within {
    border-color: var(--accent-ring);
    box-shadow: 0 0 0 4px var(--accent-glow);
    background: var(--surface-hi);
}
.tags-input input.bc-tag-input-field {
    flex: 1; min-width: 100px;
    appearance: none; outline: none; border: 0;
    background: transparent; color: var(--ink);
    font: inherit; font-size: 13px;
    padding: 4px 2px;
}
.tags-input .bc-chip {
    display: inline-flex; align-items: center; gap: 5px;
    font-family: 'Geist Mono', monospace; font-size: 12px;
    color: var(--ink);
    background: var(--bg-elev-2);
    border: 1px solid var(--line-hi);
    padding: 3px 4px 3px 9px;
    border-radius: 6px;
    box-shadow: none;
    font-weight: normal;
}
.tags-input .bc-chip-label::before { color: var(--muted); }
.tags-input .bc-chip-x {
    background: transparent; color: var(--muted); width: 16px; height: 16px;
    border-radius: 4px;
}
.tags-input .bc-chip-x:hover { background: var(--surface-hi); color: var(--redstone); }

.tag-suggest {
    display: flex; flex-wrap: wrap; gap: 5px;
    margin-top: 6px;
    align-items: center;
}
.tag-suggest .label {
    font-family: 'Geist Mono', monospace;
    font-size: 10.5px; text-transform: uppercase;
    letter-spacing: .08em; color: var(--muted-2);
    margin-right: 4px;
}
.tag-suggest button {
    appearance: none; cursor: pointer;
    font-family: 'Geist Mono', monospace;
    font-size: 11.5px; font-weight: 500;
    padding: 3px 9px;
    background: transparent;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--muted);
    display: inline-flex; align-items: center; gap: 4px;
    transition: background .12s, color .12s, border-color .12s;
}
.tag-suggest button:hover { background: var(--surface); color: var(--ink); border-color: var(--line-hi); }
.tag-suggest button.active {
    background: var(--surface-hi);
    color: var(--ink);
    border-color: var(--line-hi);
}
.tag-suggest button .ct { font-size: 10px; color: var(--muted-2); }

/* Form actions */
.form-actions {
    display: flex; align-items: center; gap: 10px;
    margin-top: 8px;
    padding-top: 22px;
    border-top: 1px solid var(--line);
}
.form-actions .spacer { flex: 1; }
.form-actions .save-hint {
    font-family: 'Geist Mono', monospace;
    font-size: 11px; color: var(--muted);
    display: flex; align-items: center; gap: 6px;
}
.btn-lg { padding: 10px 16px; font-size: 14px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; pointer-events: none; }
.kbd {
    font-family: 'Geist Mono', monospace; font-size: 10px;
    padding: 1px 5px; background: var(--bg-elev-2);
    border: 1px solid var(--line); border-radius: 4px;
    color: var(--muted);
}

/* Live preview pane */
.preview {
    position: sticky; top: 80px;
    display: flex; flex-direction: column; gap: 12px;
}
.preview-h {
    display: flex; align-items: center; justify-content: space-between;
    font-family: 'Geist Mono', monospace;
    font-size: 11px; text-transform: uppercase; letter-spacing: .1em;
    color: var(--muted);
    font-weight: 500;
    padding: 0 4px;
}
.preview-h .live-dot { display: inline-flex; align-items: center; gap: 6px; }
.preview-h .live-dot::before {
    content: ""; width: 6px; height: 6px;
    border-radius: 999px; background: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
    animation: bc-pulse 1.6s ease-in-out infinite;
}
@keyframes bc-pulse { 0%, 100% { opacity: .6; } 50% { opacity: 1; } }

.pcard {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow: hidden;
    position: relative;
}
.pcard-thumb {
    height: 180px; position: relative;
    background: var(--bg-elev-2);
    border-bottom: 1px solid var(--line);
    overflow: hidden;
}
.pcard-thumb-bg {
    position: absolute; inset: 0;
    background-size: 8px 8px;
    background-image:
        linear-gradient(rgba(255,255,255,.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.03) 1px, transparent 1px);
}
.pcard-thumb[data-src="reddit"]    { background-image: radial-gradient(ellipse at 50% 30%, rgba(255, 86, 0,  .25), transparent 70%); }
.pcard-thumb[data-src="youtube"]   { background-image: radial-gradient(ellipse at 50% 30%, rgba(255, 60, 60, .25), transparent 70%); }
.pcard-thumb[data-src="imgur"]     { background-image: radial-gradient(ellipse at 50% 30%, rgba(110, 200, 90, .22), transparent 70%); }
.pcard-thumb[data-src="schematic"] { background-image: radial-gradient(ellipse at 50% 30%, rgba(224, 166, 74, .28), transparent 70%); }
.pcard-thumb[data-src="generic"]   { background-image: radial-gradient(ellipse at 50% 30%, rgba(120, 130, 160, .25), transparent 70%); }
.pcard-thumb img {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    object-fit: cover;
}
.pcard-empty {
    position: absolute; inset: 0;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 6px;
    color: var(--muted);
    font-family: 'Geist Mono', monospace;
    font-size: 11px;
    text-transform: uppercase; letter-spacing: .12em;
}
.pcard-fav {
    position: absolute; top: 12px; right: 12px;
    width: 30px; height: 30px;
    border-radius: 8px;
    background: color-mix(in oklab, var(--bg) 100%, transparent 30%);
    backdrop-filter: blur(8px);
    border: 1px solid var(--line);
    display: flex; align-items: center; justify-content: center;
}
.pcard-fav svg path { fill: none; stroke: var(--muted); stroke-width: 2; }
.pcard-body { padding: 14px 16px 16px; }
.pcard-row1 { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.pcard-badge {
    font-family: 'Geist Mono', monospace;
    font-size: 10.5px; font-weight: 600;
    letter-spacing: .04em; text-transform: uppercase;
    padding: 3px 9px; border-radius: 999px;
}
.pcard-badge[data-src="reddit"]    { color: #ff7a3a; border: 1px solid rgba(255, 122, 58, .35); background: rgba(255, 122, 58, .08); }
.pcard-badge[data-src="youtube"]   { color: #ff5a5a; border: 1px solid rgba(255, 90, 90, .35); background: rgba(255, 90, 90, .08); }
.pcard-badge[data-src="imgur"]     { color: #6cc878; border: 1px solid rgba(108, 200, 120, .35); background: rgba(108, 200, 120, .08); }
.pcard-badge[data-src="schematic"] { color: #e0a64a; border: 1px solid rgba(224, 166, 74, .35); background: rgba(224, 166, 74, .1); }
.pcard-badge[data-src="generic"]   { color: #9fa8c0; border: 1px solid rgba(159, 168, 192, .35); background: rgba(159, 168, 192, .08); }
.pcard-title {
    font-size: 16px; font-weight: 600; color: var(--ink);
    margin: 0; line-height: 1.25; letter-spacing: -.01em;
}
.pcard-title.placeholder { color: var(--muted-2); font-style: italic; font-weight: 400; }
.pcard-author { font-size: 12.5px; color: var(--ink-2); margin-top: 4px; }
.pcard-author .sub { color: var(--muted); }
.pcard-meta {
    font-family: 'Geist Mono', monospace;
    font-size: 11px; color: var(--muted);
    margin-top: 8px;
}
.pcard-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 10px; }
.pcard-tags .tag {
    font-family: 'Geist Mono', monospace;
    font-size: 11px; color: var(--muted);
    background: var(--bg-elev-2);
    border: 1px solid var(--line);
    padding: 1px 7px; border-radius: 5px;
}

.preview-meta {
    font-family: 'Geist Mono', monospace;
    font-size: 11px; color: var(--muted);
    line-height: 1.5;
    padding: 12px 14px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 10px;
}
.preview-meta strong { color: var(--ink-2); font-weight: 500; }
.preview-meta .row { display: flex; justify-content: space-between; gap: 10px; }
.preview-meta .row + .row { margin-top: 4px; }

@media (max-width: 920px) { .preview { position: static; } }

/* URL preview card on Create */
.bc-preview-card {
    display: flex;
    gap: 14px;
    padding: 10px;
    margin-top: 10px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}
.bc-preview-card img {
    width: 120px; height: 90px;
    object-fit: cover;
    border-radius: 6px;
    background: var(--bg-elev-2);
    flex-shrink: 0;
}
.bc-preview-kind {
    font-family: 'Geist Mono', monospace;
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--muted);
    margin-bottom: 4px;
}
.bc-preview-title {
    font-weight: 600;
    color: var(--ink);
    font-size: 14px;
    line-height: 1.3;
}
.bc-preview-author {
    font-size: 12.5px;
    color: var(--ink-2);
    margin-top: 4px;
}
.bc-preview-author a { color: var(--accent); }
.bc-preview-body {
    font-size: 12.5px;
    color: var(--muted);
    margin-top: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ───── Confirm modal ───── */
.bc-modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0, 0, 0, 0.65);
    display: flex; align-items: center; justify-content: center;
    z-index: 9500;
    padding: 1rem;
    opacity: 0;
    transition: opacity .12s ease;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}
.bc-modal-overlay.open { opacity: 1; }
.bc-modal {
    background: var(--bg-elev);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-pop);
    max-width: 440px; width: 100%;
    padding: 20px 22px 16px;
    transform: translateY(8px) scale(.98);
    transition: transform .18s ease;
}
.bc-modal-overlay.open .bc-modal { transform: translateY(0) scale(1); }
.bc-modal-title { font-weight: 600; font-size: 16px; color: var(--ink); margin-bottom: 6px; }
.bc-modal-body { color: var(--ink-2); font-size: 13.5px; line-height: 1.55; margin-bottom: 18px; }
.bc-modal-actions { display: flex; justify-content: flex-end; gap: 8px; }

/* ───── Lightbox ───── */
.bc-lightbox {
    position: fixed; inset: 0;
    background: rgba(0, 0, 0, .96);
    display: none;
    z-index: 9999;
    user-select: none;
}
.bc-lightbox.open { display: block; }
.bc-lb-stage {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
    cursor: zoom-in;
}
.bc-lightbox.zoomed .bc-lb-stage { cursor: grab; }
.bc-lightbox.dragging .bc-lb-stage,
.bc-lightbox.dragging .bc-lb-img { cursor: grabbing; }
.bc-lb-img {
    max-width: 95vw; max-height: 90vh;
    transform-origin: center center;
    transition: transform 0.06s linear;
    user-select: none;
    -webkit-user-drag: none;
    border-radius: 4px;
    box-shadow: 0 20px 60px rgba(0,0,0,.5);
}
.bc-lb-btn {
    position: absolute;
    background: rgba(255,255,255,.06);
    color: white;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 999px;
    width: 40px; height: 40px;
    font-size: 1.4rem; line-height: 1;
    cursor: pointer; z-index: 2;
    backdrop-filter: blur(8px);
    transition: background .15s ease, border-color .15s ease;
    display: flex; align-items: center; justify-content: center;
}
.bc-lb-btn:hover { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.25); }
.bc-lb-close { top: 16px; right: 16px; }
.bc-lb-prev { top: 50%; left: 16px; transform: translateY(-50%); width: 48px; height: 48px; }
.bc-lb-next { top: 50%; right: 16px; transform: translateY(-50%); width: 48px; height: 48px; }
.bc-lb-counter {
    position: absolute;
    top: 18px; left: 50%; transform: translateX(-50%);
    background: rgba(255,255,255,.06);
    color: white;
    padding: 5px 12px;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 999px;
    font-family: 'Geist Mono', monospace;
    font-size: 12px;
    backdrop-filter: blur(8px);
}
.bc-lb-caption {
    position: absolute;
    bottom: 56px; left: 0; right: 0;
    text-align: center;
    color: white;
    font-size: 14px;
    text-shadow: 0 1px 2px rgba(0,0,0,.7);
    padding: 0 5rem;
}
.bc-lb-hint {
    position: absolute;
    bottom: 18px; left: 0; right: 0;
    text-align: center;
    color: rgba(255,255,255,.4);
    font-family: 'Geist Mono', monospace;
    font-size: 11px;
    pointer-events: none;
    letter-spacing: .04em;
}
[data-lightbox] { cursor: zoom-in; }

/* ───── Alerts ───── */
.alert {
    border-radius: var(--radius);
    padding: 10px 14px;
    font-size: 13.5px;
    border: 1px solid;
}
.alert-danger {
    background: rgba(255, 90, 95, .08);
    border-color: rgba(255, 90, 95, .35);
    color: #ffb5b5;
}
.text-danger { color: var(--redstone) !important; }

/* ───── About page ───── */
.about-head {
    max-width: 760px;
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--line);
}
.about-head .page-h {
    font-size: 36px;
    font-weight: 500;
    margin: 8px 0 0;
    letter-spacing: -.025em;
    line-height: 1.05;
}
.about-head .page-h em {
    font-family: 'Instrument Serif', serif;
    font-style: italic;
    font-weight: 400;
    color: var(--accent);
}
.about-head .page-sub {
    color: var(--ink-2);
    font-size: 15px;
    line-height: 1.65;
    margin-top: 12px;
}

.about-section { margin-bottom: 40px; }
.about-section h2 {
    font-size: 18px;
    font-weight: 600;
    color: var(--ink);
    margin: 0 0 6px;
    letter-spacing: -.01em;
}
.about-section-sub {
    color: var(--muted);
    font-size: 13.5px;
    margin: 0 0 14px;
    max-width: 720px;
    line-height: 1.55;
}

/* "How it works" steps */
.about-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
    margin-top: 18px;
}
.about-step {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 18px 18px 16px;
}
.about-step-n {
    display: inline-flex;
    align-items: center; justify-content: center;
    width: 26px; height: 26px;
    border-radius: 999px;
    background: var(--accent);
    color: #1a0608;
    font-family: 'Geist Mono', monospace;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 10px;
}
.about-step h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--ink);
    margin: 0 0 6px;
}
.about-step p {
    color: var(--ink-2);
    font-size: 13px;
    line-height: 1.55;
    margin: 0;
}

/* Sources table */
.about-table {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--surface);
}
.about-table-row {
    display: grid;
    grid-template-columns: 220px 1fr 180px;
    gap: 16px;
    padding: 12px 16px;
    border-top: 1px solid var(--line);
    font-size: 13.5px;
    color: var(--ink-2);
    line-height: 1.5;
    align-items: center;
}
.about-table-row:first-child { border-top: 0; }
.about-table-head {
    background: var(--bg-elev-2);
    color: var(--muted);
    font-family: 'Geist Mono', monospace;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .08em;
    font-weight: 500;
}
.about-table-section {
    background: var(--bg-elev);
    font-family: 'Geist Mono', monospace;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--muted);
}
.about-table-row strong { color: var(--ink); font-weight: 500; }
.about-table-row a { color: var(--muted); margin-left: 4px; font-size: 11px; }
.about-table-row a:hover { color: var(--accent); }
.about-table-cell-right {
    text-align: right;
    font-family: 'Geist Mono', monospace;
    font-size: 12px;
    color: var(--muted);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
}
.about-table-cell-right .check {
    color: #1a0608;
    background: var(--accent);
    width: 16px; height: 16px;
    border-radius: 999px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 10px;
    font-weight: 700;
}
.about-table-cell-right .dot-warn { color: var(--gold); font-size: 14px; line-height: 1; }
.about-table-cell-right .dot-cold { color: var(--muted-2); font-size: 14px; line-height: 1; }
@media (max-width: 720px) {
    .about-table-row {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    .about-table-cell-right { justify-content: flex-start; }
    .about-table-section, .about-table-head { font-size: 11px; }
}

.about-ext-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 6px;
}
.about-ext-list code {
    background: var(--bg-elev-2);
    border: 1px solid var(--line);
    border-radius: 5px;
    padding: 4px 10px;
    font-size: 12px;
    color: var(--ink-2);
}

.about-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.about-list li {
    background: var(--surface);
    border: 1px solid var(--line);
    border-left: 3px solid var(--accent);
    border-radius: var(--radius);
    padding: 12px 16px;
    font-size: 13.5px;
    color: var(--ink-2);
    line-height: 1.55;
}
.about-list strong { color: var(--ink); font-weight: 500; }

/* ───── Tools section ───── */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    margin-top: 8px;
}
.tool-card {
    display: block;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 22px 22px 20px;
    color: var(--ink) !important;
    text-decoration: none !important;
    transition: border-color .18s, transform .18s, background .18s, box-shadow .18s;
}
.tool-card:hover {
    border-color: var(--accent-ring);
    background: var(--surface-hi);
    transform: translateY(-2px);
    box-shadow: var(--shadow-soft);
}
.tool-card-icon {
    width: 60px; height: 60px;
    margin-bottom: 14px;
    color: var(--accent);
    display: flex; align-items: center; justify-content: center;
    background: var(--accent-glow);
    border-radius: 12px;
}
.tool-card-icon svg { width: 70%; height: 70%; }
.tool-card h3 { margin: 0 0 6px; font-size: 16px; font-weight: 600; }
.tool-card p { margin: 0; color: var(--ink-2); font-size: 13px; line-height: 1.5; }

.tool-page-head {
    max-width: 760px;
    margin: 12px 0 24px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--line);
}
.tool-page-head .page-h {
    font-size: 30px;
    font-weight: 500;
    margin: 8px 0 0;
    letter-spacing: -.02em;
}
.tool-page-head .page-h em {
    font-family: 'Instrument Serif', serif;
    font-style: italic; font-weight: 400;
    color: var(--accent);
}
.tool-page-head .page-sub { color: var(--muted); margin-top: 8px; max-width: 520px; }

.tool-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 28px;
    align-items: start;
}
@media (max-width: 920px) { .tool-layout { grid-template-columns: 1fr; } }

.tool-controls {
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 18px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    position: sticky;
    top: 88px;
}
.tool-controls .field { display: flex; flex-direction: column; gap: 6px; }
.tool-controls input[type="range"] {
    width: 100%;
    accent-color: var(--accent);
}
.tool-controls .seg {
    display: flex;
    background: var(--bg-elev-2);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 2px;
    width: 100%;
}
.tool-controls .seg button {
    flex: 1;
    appearance: none; border: 0; cursor: pointer;
    background: transparent;
    color: var(--muted);
    font: inherit; font-size: 12px; font-weight: 500;
    padding: 6px 9px;
    border-radius: 6px;
    transition: background .12s, color .12s;
}
.tool-controls .seg button.active {
    background: var(--surface-hi);
    color: var(--ink);
}
.tool-toggle {
    display: flex; align-items: center; gap: 8px;
    color: var(--ink-2);
    font-size: 13px;
    cursor: pointer;
    user-select: none;
}
.tool-toggle input { accent-color: var(--accent); }

.tool-lock {
    appearance: none;
    background: transparent;
    border: 1px dashed var(--line-hi);
    color: var(--muted);
    font: inherit;
    font-family: 'Geist Mono', monospace;
    font-size: 11px;
    padding: 6px 10px;
    border-radius: 8px;
    cursor: pointer;
    display: flex; align-items: center; gap: 8px;
    transition: color .12s, border-color .12s, background .12s;
    margin: -8px 0;
    align-self: center;
}
.tool-lock:hover { color: var(--ink-2); border-color: var(--muted-2); }
.tool-lock.active { color: var(--accent); border-color: var(--accent-ring); border-style: solid; background: var(--accent-glow); }
.tool-lock svg { width: 14px; height: 14px; flex-shrink: 0; }

.tool-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.tool-actions .btn {
    flex: 1 1 130px;
    justify-content: center;
}

.layer-nav {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
    margin-top: 8px;
}
.layer-nav .btn {
    justify-content: center;
    padding: 6px 0;
    font-size: 12px;
    min-width: 0;
}

.two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

/* Gradient tool */
.grad-pickers {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 8px;
}
.grad-picker {
    display: flex; flex-direction: column; align-items: stretch;
    gap: 4px;
    cursor: pointer;
}
.grad-picker input[type="color"] {
    appearance: none;
    -webkit-appearance: none;
    width: 100%;
    height: 36px;
    border: 1px solid var(--line-hi);
    border-radius: 6px;
    background: transparent;
    cursor: pointer;
    padding: 0;
}
.grad-picker input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.grad-picker input[type="color"]::-webkit-color-swatch { border: 0; border-radius: 5px; }
.grad-picker input[type="color"]::-moz-color-swatch { border: 0; border-radius: 5px; }
.grad-picker-name {
    font-family: 'Geist Mono', monospace;
    font-size: 10.5px;
    color: var(--ink-2);
    text-align: center;
    line-height: 1.2;
    word-break: break-word;
    min-height: 14px;
}
.grad-arrow {
    color: var(--accent);
    font-size: 16px;
    text-align: center;
}

.grad-palette {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 3px;
    margin-top: 8px;
}
.grad-swatch {
    appearance: none;
    width: 100%;
    aspect-ratio: 1;
    border: 1px solid var(--line);
    border-radius: 4px;
    cursor: pointer;
    padding: 0;
    transition: transform .08s ease, border-color .12s;
    image-rendering: pixelated;
}
.grad-swatch:hover { transform: scale(1.12); border-color: var(--ink-2); z-index: 1; position: relative; }

/* Endpoint cards (click to open picker) */
.grad-endpoints {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 8px;
    align-items: stretch;
}
.grad-endpoint {
    appearance: none;
    background: var(--surface);
    border: 1px solid var(--line-hi);
    border-radius: 8px;
    padding: 10px;
    color: var(--ink);
    font: inherit;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: stretch;
    text-align: center;
    transition: border-color .15s, background .12s, transform .08s;
}
.grad-endpoint:hover { border-color: var(--accent-ring); background: var(--surface-hi); }
.grad-endpoint:active { transform: translateY(1px); }
.grad-endpoint-label {
    font-family: 'Geist Mono', monospace;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--muted);
}
.grad-endpoint-tex {
    display: block;
    width: 100%;
    aspect-ratio: 1;
    max-height: 64px;
    border-radius: 4px;
    background-size: 100% 100%;
    image-rendering: pixelated;
    border: 1px solid var(--line);
    margin: 0 auto;
    background-color: var(--bg-elev-2);
}
.grad-endpoint-name {
    font-size: 12px;
    font-weight: 500;
    color: var(--ink-2);
    line-height: 1.2;
}
.grad-endpoint-cta {
    font-family: 'Geist Mono', monospace;
    font-size: 10px;
    color: var(--accent);
    letter-spacing: .04em;
}
.grad-endpoint-arrow {
    align-self: center;
    color: var(--muted);
    font-size: 18px;
}

/* Block picker modal */
.grad-picker-modal {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.65);
    z-index: 9000;
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}
.grad-picker-modal[hidden] { display: none !important; }
.grad-picker-modal-inner {
    background: var(--bg-elev);
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: var(--shadow-pop);
    width: 100%;
    max-width: 720px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    padding: 16px 16px 14px;
    gap: 12px;
}
.grad-picker-header {
    display: flex; align-items: center; justify-content: space-between;
}
.grad-picker-close {
    appearance: none;
    background: transparent;
    color: var(--muted);
    border: 0;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    padding: 0 6px;
    border-radius: 4px;
}
.grad-picker-close:hover { color: var(--ink); }
.grad-picker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(76px, 1fr));
    gap: 6px;
    overflow-y: auto;
    padding: 4px 4px 8px;
    flex: 1;
}
.grad-pick-cell {
    appearance: none;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 4px;
    cursor: pointer;
    color: var(--ink-2);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    transition: border-color .12s, transform .08s, background .12s;
}
.grad-pick-cell:hover {
    border-color: var(--accent-ring);
    background: var(--surface-hi);
    transform: translateY(-1px);
}
.grad-pick-cell-tex {
    width: 100%;
    aspect-ratio: 1;
    background-size: 100% 100%;
    image-rendering: pixelated;
    border: 1px solid var(--line);
    border-radius: 4px;
    background-color: var(--bg-elev-2);
}
.grad-pick-cell-name {
    font-size: 10.5px;
    line-height: 1.15;
    text-align: center;
    color: var(--ink-2);
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.grad-picker-empty {
    text-align: center;
    color: var(--muted);
    padding: 30px 10px;
}

/* Multi-stop UI */
.grad-stops {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.grad-stop {
    appearance: none;
    background: var(--bg-elev-2);
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 6px 8px;
    cursor: pointer;
    color: var(--ink-2);
    font: inherit;
    font-size: 12.5px;
    display: grid;
    grid-template-columns: 22px 1fr auto;
    align-items: center;
    gap: 8px;
    text-align: left;
    transition: border-color .12s, background .12s;
}
.grad-stop:hover { border-color: var(--line-hi); background: var(--surface); }
.grad-stop.active {
    border-color: var(--accent-ring);
    background: color-mix(in oklab, var(--accent) 100%, transparent 88%);
    color: var(--ink);
}
.grad-stop-swatch {
    width: 22px; height: 22px;
    border-radius: 4px;
    background-size: 100% 100%;
    image-rendering: pixelated;
    border: 1px solid var(--line-hi);
}
.grad-stop-name {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.grad-stop-pos {
    font-family: 'Geist Mono', monospace;
    font-size: 11px;
    color: var(--muted);
}
.grad-stop.active .grad-stop-pos { color: var(--ink-2); }

.auto-stops-row {
    display: flex;
    gap: 8px;
    align-items: center;
}
.auto-stops-row input { flex: 1; }
.auto-stops-row .btn { flex-shrink: 0; }
.micro-label {
    display: block;
    font-family: 'Geist Mono', monospace;
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--muted);
    margin-bottom: 3px;
}

.tool-stat {
    background: var(--bg-elev-2);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.tool-stat-row {
    display: flex; justify-content: space-between; gap: 8px;
    font-family: 'Geist Mono', monospace;
    font-size: 12px;
    color: var(--muted);
}
.tool-stat-row strong { color: var(--ink); font-weight: 500; }

.tool-canvas-wrap {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 18px;
    position: relative;
    overflow: auto;
    min-height: 300px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
}
.tool-canvas {
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    display: block;
    cursor: crosshair;
}
.tool-side-view {
    position: absolute;
    top: 14px; right: 14px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 8px 8px 6px;
    z-index: 2;
    box-shadow: var(--shadow-soft);
}
.tool-side-view-label {
    font-family: 'Geist Mono', monospace;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--muted);
    margin-bottom: 4px;
    text-align: center;
    line-height: 1.2;
}
.tool-side-view-label small {
    display: block;
    font-size: 9px;
    color: var(--muted-2);
    margin-top: 1px;
    letter-spacing: .04em;
}
.tool-side-canvas {
    display: block;
    image-rendering: pixelated;
    border-radius: 4px;
    margin: 0 auto;
}
@media (max-width: 720px) {
    .tool-side-view { position: static; margin: 8px auto 0; max-width: 200px; }
}

.tool-hover {
    position: absolute;
    bottom: 10px; right: 14px;
    font-family: 'Geist Mono', monospace;
    font-size: 12px;
    color: var(--muted);
    background: var(--bg-elev);
    border: 1px solid var(--line);
    padding: 4px 10px;
    border-radius: 6px;
    pointer-events: none;
    min-height: 16px;
    min-width: 100px;
    text-align: right;
}

/* ───── Responsive ───── */
@media (max-width: 720px) {
    .topbar-inner { padding: 12px 16px; gap: 10px; }
    .nav { display: none; }
    main.bc-main { padding: 24px 16px 60px; }
    .hero { grid-template-columns: 1fr; gap: 16px; }
    .hero-h { font-size: 30px; }
    .card { grid-template-columns: 1fr; }
    .thumb { border-right: 0; border-bottom: 1px solid var(--line); min-height: 160px; }
}
