/* Craft Hub: night-sky slate with a torch-amber accent. Signature touches: chunky "block"
   buttons with a pressed bottom edge, pixelated art everywhere, and a monospace pixel wordmark. */
:root, :root:not([data-theme="light"]) {
  --accent: #f5a524;
  --accent-ink: #1a1206;
  --accent-soft: color-mix(in srgb, #f5a524 16%, transparent);
  --emerald: #46d483;
  --bg: #12141a;
  --surface: #1b1e27;
  --surface-2: #252935;
  --surface-3: #2e3342;
  --ink: #eef0f5;
  --ink-2: #9aa1b2;
  --line: rgb(255 255 255 / 8%);
  --good: #46d483;
  --bad: #ff6b5e;
  --radius: 8px;
  --radius-sm: 6px;
  --shadow: 0 2px 0 rgb(0 0 0 / 35%), 0 10px 24px rgb(0 0 0 / 25%);
  --font-display: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  --max: 1180px;
  color-scheme: dark;
}
body {
  background:
    radial-gradient(1200px 500px at 85% -10%, rgb(245 165 36 / 7%), transparent 60%),
    radial-gradient(900px 400px at -10% 10%, rgb(70 212 131 / 5%), transparent 60%),
    var(--bg);
  background-attachment: fixed;
}
img { image-rendering: pixelated; }
a { color: var(--accent); }
h1, h2, h3 { letter-spacing: -0.01em; }
.grow { flex: 1; min-width: 0; }
.center { justify-content: center; text-align: center; }
.row-between { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.bad-text { color: var(--bad); }
.bad-text:empty { display: none; }

/* ---------- Header ---------- */
.app-header { background: color-mix(in srgb, var(--bg) 88%, transparent); gap: 14px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); min-height: var(--tap); }
.brand img { width: 34px; height: 34px; border-radius: 6px; box-shadow: 0 2px 0 rgb(0 0 0 / 50%); }
.wordmark { font: 800 1.15rem/1 var(--font-display); letter-spacing: .08em; text-shadow: 2px 2px 0 #000; }
.wordmark span { color: var(--accent); margin-left: .35em; }
.header-search { flex: 0 1 380px; }
.header-search input { min-height: 40px; }
.lang-btn { font-family: var(--font-display); letter-spacing: .06em; min-width: 52px; }
@media (max-width: 720px) { .header-search { display: none; } }

/* ---------- Block controls ---------- */
.btn {
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface-2);
  box-shadow: inset 0 -3px 0 rgb(0 0 0 / 35%), inset 0 1px 0 rgb(255 255 255 / 6%);
  transition: transform .06s ease, box-shadow .06s ease, background .15s ease;
}
.btn:active { transform: translateY(2px); box-shadow: inset 0 -1px 0 rgb(0 0 0 / 35%); }
.btn.primary { background: var(--accent); color: var(--accent-ink); box-shadow: inset 0 -3px 0 #b06e00, inset 0 1px 0 rgb(255 255 255 / 35%); }
.btn.ghost { box-shadow: none; background: transparent; }
.btn.danger { color: var(--bad); }
.btn:disabled { opacity: .5; }
.chip { border-radius: var(--radius-sm); background: var(--surface-2); text-decoration: none; min-height: 38px; }
.chip[aria-pressed="true"], .chip[aria-current="page"], .chip.active { background: var(--accent); color: var(--accent-ink); }
.chip .muted { color: inherit; opacity: .65; }
.chips.wrap { flex-wrap: wrap; overflow: visible; }
.chip-wrap { display: flex; flex-wrap: wrap; gap: 6px; }
.badge { border-radius: 4px; background: color-mix(in srgb, var(--cat, var(--accent)) 20%, transparent); color: var(--cat, var(--accent)); text-transform: uppercase; letter-spacing: .05em; font-family: var(--font-display); }
.tag { display: inline-block; padding: 2px 8px; border-radius: 4px; background: var(--surface-2); color: var(--ink-2); font-size: .78rem; }
.tag-row { display: inline-flex; flex-wrap: wrap; gap: 4px; }
input, select, textarea { background: var(--surface-2); border-color: var(--line); border-radius: var(--radius-sm); }
select { appearance: none; -webkit-appearance: none; padding-right: 32px; background-image: linear-gradient(45deg, transparent 50%, var(--ink-2) 50%), linear-gradient(135deg, var(--ink-2) 50%, transparent 50%); background-position: calc(100% - 16px) 52%, calc(100% - 11px) 52%; background-size: 5px 5px; background-repeat: no-repeat; width: auto; }
.search input { border-radius: var(--radius-sm); }
.check { display: inline-flex; align-items: center; gap: 8px; min-height: var(--tap); cursor: pointer; }
.card { border: 1px solid var(--line); }
.notice { border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); }
.eyebrow { font: 700 .78rem/1 var(--font-display); text-transform: uppercase; letter-spacing: .14em; color: var(--accent); margin-bottom: 10px; }
.pixel-title { font: 800 clamp(1.8rem, 4.5vw, 3rem)/1.05 var(--font-display); letter-spacing: -.01em; text-shadow: 3px 3px 0 #000; text-transform: uppercase; }
.pixel-title.small-title { font-size: clamp(1.5rem, 3.5vw, 2.1rem); margin-bottom: 4px; }
.page-head { margin: 8px 0 16px; }
.disclaimer { margin: 32px auto 8px; max-width: 720px; text-align: center; }
.section-title a { font-size: .9rem; text-decoration: none; }

/* ---------- Tabbar ---------- */
.tabbar { background: color-mix(in srgb, #0d0f14 92%, transparent); }
.tabbar a { font-weight: 600; }
.tabbar .icon { width: 24px; height: 24px; border-radius: 4px; }
.tabbar .count { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent); color: var(--accent-ink); font-size: .7rem; line-height: 18px; }

/* ---------- Home ---------- */
.hero { position: relative; border-radius: 12px; overflow: hidden; min-height: 340px; display: flex; align-items: flex-end; box-shadow: var(--shadow); border: 1px solid var(--line); }
.hero-art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 70%; }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgb(18 20 26 / 0%) 0%, rgb(18 20 26 / 55%) 45%, rgb(18 20 26 / 94%) 100%); }
.hero-copy { position: relative; z-index: 1; padding: 28px; max-width: 720px; }
.hero-sub { color: #d8dbe4; max-width: 60ch; }
.hero-search { display: flex; gap: 8px; margin-top: 14px; }
.hero-search input { flex: 1; min-height: 50px; font-size: 17px; background: rgb(18 20 26 / 85%); }
.hero-search .btn { min-height: 50px; }

.cat-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
@media (min-width: 1000px) { .cat-grid { grid-template-columns: repeat(7, 1fr); } }
.cat-tile { display: flex; flex-direction: column; gap: 4px; padding: 14px; text-decoration: none; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: inset 0 -4px 0 color-mix(in srgb, var(--cat) 55%, #000); transition: transform .1s ease; }
.cat-tile img { width: 44px; height: 44px; border-radius: 6px; margin-bottom: 6px; }
.cat-tile:hover { transform: translateY(-2px); }
.cat-tile:active { transform: translateY(1px); }

.feature-row { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(260px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 8px; scroll-snap-type: x mandatory; }
.feature-card { scroll-snap-align: start; display: flex; flex-direction: column; text-decoration: none; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.feature-art { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.feature-body { display: flex; gap: 12px; padding: 12px; align-items: flex-start; }
.feature-body > span { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }

.two-col { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); }
.rank-list { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.rank-list li + li { border-top: 1px solid var(--line); }
.rank-list a { display: flex; align-items: center; gap: 12px; padding: 10px 14px; text-decoration: none; color: var(--ink); min-height: 56px; }
.rank-list a > img { width: 36px; height: 36px; border-radius: 6px; }
.rank-list .grow { display: flex; flex-direction: column; }
.rank { font: 800 1.1rem var(--font-display); color: var(--accent); width: 1.4em; text-align: center; }

.server-strip { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.server-mini { position: relative; display: block; border-radius: var(--radius); overflow: hidden; text-decoration: none; color: var(--ink); border: 1px solid var(--line); background: var(--surface); }
.smini-art { width: 100%; height: 90px; object-fit: cover; }
.smini-body { display: flex; gap: 10px; padding: 10px 12px 12px; }
.smini-body > span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.smini-body .picon { width: 40px; height: 40px; margin-top: -26px; border: 2px solid var(--surface); }

.spotlight { display: grid; grid-template-columns: 1.1fr 1fr; gap: 20px; align-items: center; margin-top: 28px; padding: 22px; border-radius: 12px; border: 1px solid var(--line);
  background: linear-gradient(135deg, color-mix(in srgb, #ff9ad5 10%, var(--surface)), var(--surface)); }
@media (max-width: 720px) { .spotlight { grid-template-columns: 1fr; } }

/* ---------- Browse ---------- */
.cat-chips { margin-bottom: 14px; }
.browse { display: grid; grid-template-columns: 260px 1fr; gap: 18px; align-items: start; }
.filters { position: sticky; top: 76px; }
.filters-toggle { display: none; }
@media (max-width: 900px) {
  .browse { grid-template-columns: 1fr; }
  .browse > .filters { display: none; }
  .filters-toggle { display: inline-flex; }
}
.filter-group { margin-bottom: 16px; }
.filter-label { display: block; font: 700 .75rem var(--font-display); text-transform: uppercase; letter-spacing: .1em; color: var(--ink-2); margin-bottom: 8px; }
.filter-group select { width: 100%; }
.results-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.results-bar .search { min-width: 200px; }
.active-filters { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.active-filters:empty { display: none; }

.plist { display: flex; flex-direction: column; gap: 10px; }
.pcard { position: relative; display: grid; grid-template-columns: 64px 1fr auto; gap: 14px; align-items: start; padding: 14px; padding-right: 56px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: inset 3px 0 0 var(--cat, transparent); }
.pcard:hover { background: color-mix(in srgb, var(--surface) 92%, #fff); }
.picon { width: 64px; height: 64px; border-radius: 8px; box-shadow: 0 2px 0 rgb(0 0 0 / 45%); flex: none; }
.picon.big { width: 96px; height: 96px; border-radius: 10px; }
.picon.skin-face { object-fit: contain; background: var(--surface-2); }
.pcard h3 { margin: 0 0 4px; font-family: var(--font); font-size: 1.1rem; }
.pcard h3 a { color: var(--ink); text-decoration: none; }
.pcard .by { font-weight: 400; font-size: .85rem; margin-left: 6px; }
.pcard .summary { margin: 0 0 8px; color: var(--ink-2); }
.pcard .meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.pcard-stats { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; text-align: right; white-space: nowrap; }
.pcard-stats .fit { color: var(--emerald); font-weight: 700; }
.stretched::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.fav-btn, .pcard .copy-btn { position: relative; z-index: 2; }
.pcard > .fav-btn { position: absolute; top: 10px; right: 10px; }
@media (max-width: 640px) {
  .pcard { grid-template-columns: 48px 1fr; }
  .pcard .picon { width: 48px; height: 48px; }
  .pcard-stats { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 4px 12px; white-space: normal; }
}
.fav-btn { width: var(--tap); height: var(--tap); border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface-2); color: var(--ink-2); font-size: 1.35rem; line-height: 1; cursor: pointer; box-shadow: inset 0 -3px 0 rgb(0 0 0 / 35%); }
.fav-btn[aria-pressed="true"] { color: #ff6b8b; background: color-mix(in srgb, #ff6b8b 16%, var(--surface-2)); }
.fav-btn:active { transform: translateY(2px); }

/* ---------- Project page ---------- */
.back-link { display: inline-flex; align-items: center; min-height: var(--tap); text-decoration: none; font-weight: 600; }
.phead { position: relative; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: var(--surface); }
.phead-art { width: 100%; aspect-ratio: 320 / 72; max-height: 220px; min-height: 120px; object-fit: cover; object-position: center bottom; }
.phead-main { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "icon info" "actions actions"; gap: 12px 16px; align-items: end; padding: 0 20px 18px; margin-top: -48px; position: relative; }
.phead-main > .picon { grid-area: icon; }
.phead-main > .grow { grid-area: info; }
.phead-main > .phead-actions { grid-area: actions; justify-content: flex-start; }
.phead-main > .phead-actions .small { text-align: left; }
@media (min-width: 1100px) {
  .phead-main { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "icon info actions"; }
  .phead-main > .phead-actions { justify-content: flex-end; max-width: 460px; }
  .phead-main > .phead-actions .small { text-align: right; }
}
.phead-main > .picon.big { border: 3px solid var(--surface); }
.phead-main h1 { margin: 6px 0 2px; font-size: clamp(1.5rem, 3.5vw, 2.1rem); }
.phead-main p { margin: 0 0 6px; }
.stats { display: flex; flex-wrap: wrap; gap: 4px 16px; color: var(--ink-2); font-size: .9rem; }
.stats strong { color: var(--ink); }
.phead-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: flex-end; max-width: 100%; }
.phead-actions .small { flex-basis: 100%; text-align: right; }
.dl-pickers { display: flex; gap: 6px; }
.dl-pickers select { min-height: var(--tap); }

.btn.dl-btn { min-height: 52px; font-size: 1.05rem; padding: 0 22px; background: var(--emerald); color: #062313; box-shadow: inset 0 -3px 0 #23955a, inset 0 1px 0 rgb(255 255 255 / 30%); }
.tabs { display: flex; gap: 4px; margin: 16px 0; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs [role="tab"] { min-height: var(--tap); padding: 0 16px; border: 0; background: none; color: var(--ink-2); font: inherit; font-weight: 600; cursor: pointer; border-bottom: 3px solid transparent; white-space: nowrap; }
.tabs [aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }
.pbody { display: grid; grid-template-columns: 1fr 300px; gap: 20px; align-items: start; }
@media (max-width: 900px) { .pbody { grid-template-columns: 1fr; } }
.prose p { color: #d6d9e2; max-width: 70ch; }
.highlights { padding-left: 1.2em; }
.highlights li { margin-bottom: 6px; }
.highlights li::marker { color: var(--accent); }
.mini-list { list-style: none; padding: 0; margin: 0 0 16px; display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }
.mini-link { display: flex; gap: 10px; align-items: center; padding: 10px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.mini-link img { width: 40px; height: 40px; border-radius: 6px; }
.mini-link span { display: flex; flex-direction: column; min-width: 0; }
.details { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; margin: 0; font-size: .92rem; }
.details dt { color: var(--ink-2); }
.details dd { margin: 0; }
.gallery { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }
.gallery figure { margin: 0; }
.shot { display: block; padding: 0; border: 0; width: 100%; cursor: zoom-in; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); background: none; }
.shot img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.gallery figcaption { margin-top: 6px; }
dialog.sheet.wide { width: min(100%, 980px); }
.lb-img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--radius); }
.lb-caption { margin-top: 10px; }
.vfilters { margin-bottom: 10px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
table.versions { width: 100%; border-collapse: collapse; font-size: .92rem; }
.versions th { text-align: left; font: 700 .72rem var(--font-display); text-transform: uppercase; letter-spacing: .08em; color: var(--ink-2); padding: 10px 12px; background: var(--surface-2); }
.versions td { padding: 10px 12px; border-top: 1px solid var(--line); vertical-align: top; }
.versions td:last-child { text-align: right; }
.channel { display: inline-block; font-size: .7rem; font-weight: 700; padding: 1px 6px; border-radius: 4px; text-transform: uppercase; }
.channel.release { background: color-mix(in srgb, var(--emerald) 18%, transparent); color: var(--emerald); }
.channel.beta { background: color-mix(in srgb, #ffb84d 18%, transparent); color: #ffb84d; }

/* ---------- Servers ---------- */
.live-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.status { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.status .dot { width: 10px; height: 10px; border-radius: 2px; background: var(--ink-2); }
.status.online { color: var(--emerald); }
.status.online .dot { background: var(--emerald); box-shadow: 0 0 0 3px color-mix(in srgb, var(--emerald) 25%, transparent); animation: pulse 2s ease-in-out infinite; }
.status.offline { color: var(--bad); }
.status.offline .dot { background: var(--bad); }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--emerald) 0%, transparent); } }
.ping { display: inline-flex; align-items: flex-end; gap: 2px; margin-left: 8px; }
.ping i { display: inline-block; width: 4px; background: var(--surface-3); }
.ping i:nth-child(1) { height: 5px; } .ping i:nth-child(2) { height: 8px; } .ping i:nth-child(3) { height: 11px; } .ping i:nth-child(4) { height: 14px; }
.ping i.on { background: var(--emerald); }
.ping .small { margin-left: 6px; }
.slist { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; }
.srow { position: relative; display: grid; grid-template-columns: 200px 1fr auto; gap: 16px; padding: 12px; padding-right: 60px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); align-items: center; }
.srow-art { width: 200px; height: 100px; object-fit: cover; border-radius: var(--radius-sm); }
.srow-main { display: flex; gap: 12px; align-items: flex-start; min-width: 0; }
.srow-main .picon { width: 48px; height: 48px; }
.srow h3 { margin: 0 0 2px; }
.srow h3 a { color: var(--ink); text-decoration: none; }
.motd { margin: 0 0 6px; color: #d6d9e2; font-family: var(--font-display); font-size: .88rem; }
.srow-side { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.srow > .fav-btn { position: absolute; top: 10px; right: 10px; }
.addr { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.addr code { font-family: var(--font-mono); font-size: .88rem; padding: 6px 10px; background: #0d0f14; border: 1px solid var(--line); border-radius: var(--radius-sm); color: #cfe9ff; }
.addr.big code { font-size: 1.05rem; padding: 10px 14px; }
.copy-btn.done { background: var(--emerald); color: #062313; }
@media (max-width: 900px) {
  .srow { grid-template-columns: 1fr; padding-right: 12px; }
  .srow-art { width: 100%; height: 110px; }
  .srow-side { align-items: flex-start; }
}
.join-card h2 { margin-bottom: 12px; }
.steps { padding-left: 1.3em; margin: 12px 0; }

/* ---------- Skins ---------- */
.seg { display: inline-flex; padding: 4px; gap: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 14px; }
.seg a { min-height: 40px; display: inline-flex; align-items: center; padding: 0 16px; border-radius: var(--radius-sm); text-decoration: none; color: var(--ink-2); font-weight: 600; }
.seg [aria-selected="true"] { background: var(--surface-3); color: var(--ink); }
.skin-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); margin-top: 12px; }
.skin-card { position: relative; padding: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); text-align: center; }
.skin-card h3 { margin: 10px 0 2px; font-family: var(--font); font-size: 1rem; }
.skin-card p { margin: 0; }
.skin-card .row { justify-content: center; margin-top: 8px; }
.skin-card > .fav-btn { position: absolute; top: 8px; right: 8px; }
.skin-thumb { display: block; padding: 14px 0 10px; border-radius: var(--radius-sm); background: radial-gradient(circle at 50% 85%, rgb(255 255 255 / 10%), transparent 55%), linear-gradient(180deg, #23283a, #171a22); }
.skin-thumb img { height: 150px; width: auto; margin: 0 auto; filter: drop-shadow(0 6px 0 rgb(0 0 0 / 35%)); }
.skin-detail { display: grid; grid-template-columns: minmax(280px, 1fr) 1fr; gap: 20px; align-items: start; }
@media (max-width: 760px) { .skin-detail { grid-template-columns: 1fr; } }
.viewer-card .row { margin-top: 8px; }
.texture { width: 256px; height: 256px; background: repeating-conic-gradient(#2a2e3a 0% 25%, #22252f 0% 50%) 0 0 / 16px 16px; border-radius: 4px; }

/* 3D viewer */
.sv-stage { position: relative; display: grid; place-items: center; perspective: 900px; cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; border-radius: var(--radius);
  background: radial-gradient(circle at 50% 88%, rgb(255 255 255 / 12%), transparent 40%), linear-gradient(180deg, #252a3b, #14161d); }
.sv-stage:active { cursor: grabbing; }
.sv-model { position: relative; width: 0; height: 0; transform-style: preserve-3d; }
.sv-box { position: absolute; transform-style: preserve-3d; }
.sv-face { position: absolute; background-image: var(--skin); background-repeat: no-repeat; image-rendering: pixelated; backface-visibility: hidden; }
.sv-outer .sv-face { backface-visibility: visible; }
.sv-no-outer .sv-outer { display: none; }
.spot-viewer .sv-stage { border: 1px solid var(--line); }

/* Editor */
.editor { display: flex; flex-direction: column; gap: 12px; }
.ed-top { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.ed-top input { font-weight: 700; }
.ed-main { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(280px, 1fr); gap: 16px; align-items: start; }
@media (max-width: 860px) { .ed-main { grid-template-columns: 1fr; } }
.ed-tools { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.tool { display: inline-flex; align-items: center; gap: 6px; min-height: var(--tap); padding: 0 12px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); font: inherit; font-weight: 600; cursor: pointer; box-shadow: inset 0 -3px 0 rgb(0 0 0 / 35%); }
.tool[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.ed-canvas-wrap { position: relative; width: min(100%, 560px); aspect-ratio: 1; border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--line);
  background: repeating-conic-gradient(#2a2e3a 0% 25%, #22252f 0% 50%) 0 0 / 12.5% 12.5%; }
.ed-canvas-wrap canvas { position: absolute; inset: 0; width: 100%; height: 100%; image-rendering: pixelated; }
#ed-canvas { touch-action: none; cursor: crosshair; z-index: 1; }
#ed-overlay { pointer-events: none; z-index: 2; }
.swatches { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.swatch { width: 36px; height: 36px; border-radius: 6px; border: 2px solid rgb(255 255 255 / 15%); background: var(--c); cursor: pointer; box-shadow: inset 0 -3px 0 rgb(0 0 0 / 25%); }
input[type="color"] { width: 56px; height: 44px; padding: 2px; }
.gen summary { cursor: pointer; font-weight: 700; min-height: var(--tap); display: flex; align-items: center; }
.gen-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 0 10px; align-items: end; }
.gen-grid select { width: 100%; }
.color-field input { width: 100%; }

/* Saved */
.history li { display: flex; gap: 12px; align-items: center; }
.history .picon { width: 40px; height: 40px; object-fit: contain; }
.danger-zone { margin-top: 36px; padding-top: 16px; border-top: 1px solid var(--line); text-align: center; }

.empty-state .art { font-size: 2.4rem; }
@media (prefers-reduced-motion: reduce) { .status.online .dot { animation: none; } }

.phead .badge { background: #12141a; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--cat, var(--accent)) 40%, transparent); }
