:root {
  --bg: #0f1117;
  --bg2: #161923;
  --panel: #1b1f2b;
  --panel2: #222736;
  --line: #2c3242;
  --text: #e8ecf5;
  --muted: #99a2b8;
  --accent: #6c8cff;
  --accent2: #8f6cff;
  --good: #38d39f;
  --warn: #ffb454;
  --bad: #ff6b6b;
  --img: #4cc9f0;
  --aud: #f72585;
  --vid: #ffb703;
  --radius: 14px;
  --shadow: 0 10px 40px rgba(0,0,0,.35);
}

html[data-theme="light"] {
  --bg: #f4f6fb; --bg2: #eef1f8; --panel: #ffffff; --panel2: #f7f9ff;
  --line: #dde3ee; --text: #131722; --muted: #5c6578; --shadow: 0 10px 30px rgba(20,30,60,.1);
}
html[data-theme="game"] {
  --bg: #05070f; --bg2: #0a0f1f; --panel: #0d1526; --panel2: #111c33;
  --line: #1e3050; --text: #dfe9ff; --muted: #7f93b8; --accent: #ffcc00; --accent2: #00c2ff;
  --img: #00c2ff; --aud: #ff4fd8; --vid: #ffcc00;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background:
    radial-gradient(1200px 600px at 15% -10%, color-mix(in oklab, var(--accent) 12%, transparent), transparent 60%),
    radial-gradient(900px 500px at 100% 0%, color-mix(in oklab, var(--accent2) 10%, transparent), transparent 55%),
    var(--bg);
  color: var(--text);
  font: 15px/1.5 "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  min-height: 100vh;
}
a { color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
code { background: var(--panel2); padding: 1px 5px; border-radius: 5px; font-size: .9em; }
kbd { background: var(--panel2); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; padding: 1px 6px; font-size: .85em; }

/* ------------------------------------------------------------ topbar */
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 18px;
  padding: 10px 22px;
  background: color-mix(in oklab, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.logo {
  width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent2)); color: #fff;
  font-weight: 800; letter-spacing: -.5px; font-size: 13px;
}
.brandtext { font-weight: 700; font-size: 17px; line-height: 1.05; display: flex; flex-direction: column; }
.brandtext small { font-weight: 500; font-size: 11px; color: var(--muted); }
.tabs { display: flex; gap: 4px; margin-left: 12px; }
.tab {
  background: transparent; border: 1px solid transparent; color: var(--muted);
  padding: 8px 14px; border-radius: 10px; font-weight: 600; display: flex; gap: 7px; align-items: center;
}
.tab:hover { color: var(--text); background: var(--panel); }
.tab.active { color: var(--text); background: var(--panel); border-color: var(--line); }
.badge { background: var(--accent); color: #fff; border-radius: 999px; padding: 0 7px; font-size: 12px; min-width: 20px; text-align: center; }
.topright { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.jobs { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.dot.on { background: var(--good); box-shadow: 0 0 0 4px color-mix(in oklab, var(--good) 25%, transparent); animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { opacity: .55; } }

/* ------------------------------------------------------------ buttons */
.btn {
  border: 1px solid var(--line); background: var(--panel2); color: var(--text);
  padding: 9px 14px; border-radius: 10px; font-weight: 600; transition: .15s;
}
.btn:hover { border-color: color-mix(in oklab, var(--accent) 60%, var(--line)); transform: translateY(-1px); }
.btn.primary { background: linear-gradient(135deg, var(--accent), var(--accent2)); border-color: transparent; color: #fff; }
.btn.ghost { background: transparent; }
.btn.small { padding: 6px 10px; font-size: 13px; border-radius: 9px; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn.inpack { opacity: .85; border-color: color-mix(in oklab, var(--good) 55%, var(--line)); color: var(--good); }
.btn.picked { background: var(--accent); border-color: transparent; color: #fff; }
.check.inpack { border-color: var(--good); background: color-mix(in oklab, var(--good) 22%, var(--bg2)); color: var(--good); }
.check.on.inpack { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ------------------------------------------------------------ views */
main { padding: 0 22px 60px; max-width: 1560px; margin: 0 auto; }
.view { display: none; animation: fade .2s ease; }
.view.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } }

.hero { display: flex; gap: 30px; align-items: flex-end; padding: 34px 4px 20px; }
.hero h1 { margin: 0 0 8px; font-size: 34px; letter-spacing: -.8px; }
.hero p { margin: 0; color: var(--muted); max-width: 720px; }
.hero-stats { margin-left: auto; display: flex; gap: 10px; }
.hstat { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 10px 16px; text-align: center; min-width: 92px; }
.hstat b { display: block; font-size: 20px; }
.hstat span { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }

/* ------------------------------------------------------------ search */
.searchbar { display: flex; gap: 10px; align-items: stretch; margin-bottom: 16px; flex-wrap: wrap; }
.searchinput {
  flex: 1; min-width: 320px; display: flex; align-items: center; gap: 10px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 13px; padding: 0 12px;
}
.searchinput:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 18%, transparent); }
.searchinput svg { color: var(--muted); flex: none; }
.searchinput input { flex: 1; background: transparent; border: 0; outline: 0; padding: 14px 0; font-size: 16px; }
.clear { background: transparent; border: 0; font-size: 22px; color: var(--muted); padding: 0 6px; display: none; }
.searchinput input:not(:placeholder-shown) ~ .clear { display: block; }
.searchopts { display: flex; gap: 8px; align-items: center; }
select, input:not([type="checkbox"]):not([type="radio"]):not([type="file"]) {
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; outline: none;
  color: var(--text);
}
input::placeholder { color: var(--muted); opacity: .75; }
select:focus, input:focus { border-color: var(--accent); }
.chip {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted);
  background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 6px 10px; cursor: pointer; white-space: nowrap;
}
.chip input { accent-color: var(--accent); width: 15px; height: 15px; margin: 0; flex: none; }

/* ------------------------------------------------------------ layout */
.layout { display: grid; grid-template-columns: 290px 1fr; gap: 20px; align-items: start; }
.filters {
  position: sticky; top: 76px; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 6px 16px 16px; max-height: calc(100vh - 96px); overflow-y: auto;
}
.fgroup { padding: 14px 0; border-bottom: 1px solid var(--line); }
.fgroup:last-child { border-bottom: 0; }
.fgroup h3 { margin: 0 0 9px; font-size: 12px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); display: flex; justify-content: space-between; align-items: center; }
.hint { text-transform: none; letter-spacing: 0; font-weight: 400; font-size: 11px; opacity: .7; }
.fgroup > input, .fgroup > select, .fgroup .range input { width: 100%; margin-bottom: 8px; }
.fgroup input[type="checkbox"] { width: auto; margin: 0; flex: none; }
.tg span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.toggles { display: flex; flex-direction: column; gap: 6px; }
.tg {
  display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: 9px;
  border: 1px solid var(--line); cursor: pointer; font-size: 13.5px; transition: .12s;
  background: var(--panel2);
}
.tg input { margin: 0; accent-color: var(--accent); width: 16px; height: 16px; flex: none; }
.tg:hover { border-color: var(--muted); }
.tg:has(input:checked).img { border-color: var(--img); background: color-mix(in oklab, var(--img) 16%, var(--panel2)); }
.tg:has(input:checked).aud { border-color: var(--aud); background: color-mix(in oklab, var(--aud) 16%, var(--panel2)); }
.tg:has(input:checked).vid { border-color: var(--vid); background: color-mix(in oklab, var(--vid) 16%, var(--panel2)); }
.tg:has(input:checked).txt { border-color: var(--accent); background: color-mix(in oklab, var(--accent) 14%, var(--panel2)); }
.range { display: flex; gap: 8px; }
.range input { margin-bottom: 8px; }
.presets { display: flex; gap: 6px; }
.presets button { background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: 4px 9px; font-size: 12px; color: var(--muted); }
.presets button:hover { color: var(--text); border-color: var(--accent); }
.checkline { margin-top: 8px; }

/* ------------------------------------------------------------ results */
.resultshead { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; gap: 12px; flex-wrap: wrap; }
#resultcount { color: var(--muted); font-size: 14px; }
#resultcount b { color: var(--text); }
.actions { display: flex; gap: 8px; }
.viewswitch { display: flex; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.viewswitch button { background: var(--panel); border: 0; padding: 6px 10px; font-size: 12.5px; color: var(--muted); }
.viewswitch button.active { background: var(--accent); color: #fff; }
.fhint { font-size: 11.5px; color: var(--muted); margin: 8px 0 0; line-height: 1.35; }
.activefilters { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.af { background: var(--panel2); border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; font-size: 12px; display: flex; gap: 6px; align-items: center; }
.af button { background: none; border: 0; color: var(--muted); padding: 0; font-size: 15px; line-height: 1; }
.af button:hover { color: var(--bad); }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; }
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column; transition: .15s; position: relative;
}
.card:hover { border-color: color-mix(in oklab, var(--accent) 55%, var(--line)); transform: translateY(-2px); box-shadow: var(--shadow); }
.card.selected { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in oklab, var(--accent) 40%, transparent); }
.cardhead { display: flex; gap: 10px; padding: 12px 13px 8px; align-items: flex-start; }
.check {
  width: 22px; height: 22px; border-radius: 6px; border: 2px solid color-mix(in oklab, var(--muted) 65%, var(--line));
  background: var(--bg2);
  flex: none; margin-top: 2px; display: grid; place-items: center; color: transparent; font-size: 13px; font-weight: 700;
}
.check:hover { border-color: var(--accent); }
.trowhead .check { margin-top: 0; }
.check.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.cardtitle { font-weight: 700; font-size: 15.5px; line-height: 1.25; cursor: pointer; }
.cardtitle:hover { color: var(--accent); }
.cardmeta { font-size: 12px; color: var(--muted); margin-top: 3px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.pill { background: var(--panel2); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; font-size: 11px; }
.pill.fresh { border-color: var(--good); color: var(--good); font-weight: 700; }
.pill.pack { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mtoggles { display: flex; gap: 5px; margin-left: auto; flex: none; }
.mt { width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; font-size: 13px; background: var(--panel2); border: 1px solid var(--line); opacity: .3; }
.mt.on { opacity: 1; }
.mt.on.i { border-color: var(--img); background: color-mix(in oklab, var(--img) 22%, var(--panel2)); }
.mt.on.a { border-color: var(--aud); background: color-mix(in oklab, var(--aud) 22%, var(--panel2)); }
.mt.on.v { border-color: var(--vid); background: color-mix(in oklab, var(--vid) 22%, var(--panel2)); }
.cardsnip { padding: 0 13px 10px; font-size: 12.5px; color: var(--muted); max-height: 74px; overflow: hidden; position: relative; }
.cardsnip mark { background: color-mix(in oklab, var(--accent) 40%, transparent); color: var(--text); border-radius: 3px; padding: 0 2px; }
.cardsnip::after { content: ""; position: absolute; inset: auto 0 0 0; height: 22px; background: linear-gradient(transparent, var(--panel)); }
.cardsnip .qa { display: flex; gap: 6px; margin-bottom: 3px; }
.cardsnip .qa b { color: var(--good); flex: none; font-size: 11px; font-weight: 700; }
.cardsnip .qa span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cardsnip .qn { color: var(--text); opacity: .85; }
.cardfoot { margin-top: auto; border-top: 1px solid var(--line); display: flex; padding: 7px 8px; gap: 6px; align-items: center; }
.cardfoot .btn { flex: 1; padding: 6px; font-size: 12.5px; }
.qcount { font-size: 12px; color: var(--muted); white-space: nowrap; }

.pager { display: flex; gap: 6px; justify-content: center; margin: 22px 0; flex-wrap: wrap; }
.pager button { min-width: 38px; padding: 7px 10px; border-radius: 9px; border: 1px solid var(--line); background: var(--panel); }
.pager button.active { background: var(--accent); color: #fff; border-color: transparent; }
.skeleton { height: 190px; border-radius: var(--radius); background: linear-gradient(100deg, var(--panel) 30%, var(--panel2) 50%, var(--panel) 70%); background-size: 200% 100%; animation: sh 1.2s infinite; }
@keyframes sh { to { background-position: -200% 0; } }
.empty { text-align: center; padding: 60px 20px; color: var(--muted); }
.emptyart { font-size: 46px; }
.empty h2 { color: var(--text); margin: 8px 0 6px; }

/* ------------------------------------------------------------ modal */
.modal { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; }
.modal[hidden] { display: none; }
.modalbg { position: absolute; inset: 0; background: rgba(3,5,12,.72); backdrop-filter: blur(4px); }
.modalbox {
  position: relative; width: min(1200px, 96vw); max-height: 92vh; overflow: auto;
  background: var(--bg2); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow);
}
.modalclose { position: sticky; top: 10px; float: right; margin: 10px 12px; z-index: 3; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; width: 36px; height: 36px; font-size: 22px; }
.modalbody { padding: 20px 24px 28px; }
.mhead h2 { margin: 6px 0 6px; font-size: 24px; }
.mhead .cardmeta { font-size: 13px; }
.mround { margin-top: 22px; }
.mround h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0 0 10px; display: flex; gap: 10px; align-items: center; }
.qlist { display: flex; flex-direction: column; gap: 10px; }
.q {
  background: var(--panel); border: 1px solid var(--line); border-radius: 13px; padding: 12px;
  display: grid; grid-template-columns: 74px 1fr; gap: 12px;
}
.qprice { font-weight: 800; font-size: 15px; color: var(--accent); text-align: center; background: var(--panel2); border-radius: 10px; padding: 8px 4px; align-self: start; }
.qbody { min-width: 0; }
.qtext { white-space: pre-wrap; overflow-wrap: anywhere; }
.qans { margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line); color: var(--good); white-space: pre-wrap; overflow-wrap: anywhere; }
.qans b { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }
.qmedia { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.qmedia figure { margin: 0; background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; position: relative; width: fit-content; max-width: 100%; }
.qmedia img { display: block; max-width: 260px; max-height: 200px; object-fit: cover; cursor: zoom-in; }
.qmedia audio { display: block; width: 280px; padding: 6px; }
.qmedia video { display: block; max-width: 380px; max-height: 260px; border-radius: 10px; }
.qmedia figcaption { font-size: 11px; color: var(--muted); padding: 4px 8px; display: flex; justify-content: space-between; gap: 8px; }
.badge-ans { color: var(--good); font-size: 11px; border: 1px solid color-mix(in oklab, var(--good) 50%, transparent); border-radius: 5px; padding: 0 5px; }
.badge-miss { color: var(--bad); font-size: 11px; border: 1px solid var(--bad); border-radius: 5px; padding: 0 5px; }
.missingmedia { color: var(--bad); font-size: 12px; padding: 10px 12px; background: color-mix(in oklab, var(--bad) 10%, var(--panel2)); border: 1px dashed var(--bad); border-radius: 10px; }
.options { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.option { background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: 4px 9px; font-size: 12.5px; }
.themebar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; align-items: center; }

/* ------------------------------------------------------------ list layout */
.themelist { display: flex; flex-direction: column; gap: 14px; }
.trow {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  transition: .15s;
}
.trow:hover { border-color: color-mix(in oklab, var(--accent) 45%, var(--line)); }
.trow.selected { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in oklab, var(--accent) 35%, transparent); }
.trowhead { display: flex; gap: 11px; align-items: center; padding: 11px 14px; background: var(--panel2); }
.trowhead .title { font-weight: 700; font-size: 16px; cursor: pointer; }
.trowhead .title:hover { color: var(--accent); }
.trowhead .meta { font-size: 12px; color: var(--muted); display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.trowhead .grow { flex: 1; min-width: 0; }
.trowhead .acts { display: flex; gap: 6px; flex: none; }
.qtable { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.qtable tr { border-top: 1px solid var(--line); vertical-align: top; }
.qtable tr:first-child { border-top: 0; }
.qtable td { padding: 9px 12px; }
.qtable td.price { width: 74px; text-align: center; font-weight: 800; color: var(--accent); white-space: nowrap; }
.qtable td.mcol { width: 1%; white-space: nowrap; }
.qtable .qtext { white-space: pre-wrap; overflow-wrap: anywhere; }
.qtable .atext { color: var(--good); white-space: pre-wrap; overflow-wrap: anywhere; }
.qtable .atext b { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; font-weight: 600; margin-right: 5px; }
.qtable .qcomment { color: var(--muted); font-size: 12px; margin-top: 4px; }
.qtable .thumbs { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.qtable .thumbs img { width: 64px; height: 48px; object-fit: cover; border-radius: 7px; border: 1px solid var(--line); cursor: zoom-in; }
.qtable video { max-width: 240px; max-height: 150px; border-radius: 8px; display: block; }
.qtable audio { width: 220px; display: block; }
.mbadges { display: flex; gap: 3px; }
.mb { font-size: 12px; opacity: .3; filter: grayscale(1); }
.mb.on { opacity: 1; filter: none; }
.trow .why { font-size: 11px; color: var(--warn); }
.qtable tr:hover { background: color-mix(in oklab, var(--accent) 6%, transparent); }
.dim { opacity: .45; }

/* ------------------------------------------------------------ builder */
.builderbar { display: flex; gap: 8px; align-items: center; padding: 20px 0 8px; flex-wrap: wrap; }
.packname { font-size: 18px; font-weight: 700; min-width: 320px; }
.packauthor { width: 170px; }
.spacer { flex: 1; }
.builderhint { color: var(--muted); font-size: 13px; margin-bottom: 16px; }
.buildercontent { display: flex; flex-direction: column; gap: 16px; }
.round {
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); overflow: hidden;
}
.roundhead { display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line); background: var(--panel2); }
.roundhead input { font-weight: 700; background: transparent; border: 1px solid transparent; flex: 1; }
.roundhead input:hover, .roundhead input:focus { border-color: var(--line); background: var(--panel); }
.roundbody { padding: 12px; display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 12px; align-items: start; }
.btheme { border: 1px solid var(--line); border-radius: 12px; background: var(--bg2); overflow: hidden; min-width: 0; }
.btheme input, .btheme textarea { min-width: 0; }
.bthemehead { display: flex; gap: 8px; align-items: center; padding: 9px 11px; background: var(--panel2); }
.bthemehead input { flex: 1; font-weight: 600; background: transparent; border: 1px solid transparent; }
.bthemehead input:hover, .bthemehead input:focus { border-color: var(--line); background: var(--panel); }
.bq { border-top: 1px solid var(--line); padding: 9px 11px; font-size: 13px; }
.bqhead { display: flex; gap: 8px; align-items: center; }
.bqhead input.price { width: 74px; text-align: center; padding: 4px 6px; font-weight: 700; color: var(--accent); }
.bqhead .qtype { font-size: 11px; color: var(--muted); }
.bqhead .del { margin-left: auto; }
.bq .txt { display: block; width: 100%; box-sizing: border-box; margin-top: 6px; background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; resize: vertical; min-height: 54px; font-size: 12.5px; line-height: 1.4; font-family: inherit; color: var(--text); }
.bq { overflow: hidden; }
.bq * { min-width: 0; }
.bq .answerline { margin-top: 6px; display: flex; gap: 6px; align-items: stretch; }
.bq .answerline input { width: 100%; box-sizing: border-box; }
.bq .answerline input { flex: 1; background: color-mix(in oklab, var(--good) 8%, var(--panel2)); border: 1px solid color-mix(in oklab, var(--good) 30%, var(--line)); border-radius: 8px; padding: 5px 8px; font-size: 12.5px; }
.bqmedia { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.mchip { display: flex; align-items: center; gap: 6px; background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: 3px 4px 3px 6px; font-size: 11.5px; max-width: 100%; }
.mchip img { width: 44px; height: 33px; object-fit: cover; border-radius: 5px; }
.mchip span:first-of-type { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 150px; }
.mchip .x { background: transparent; border: 0; color: var(--muted); font-size: 14px; padding: 0 3px; }
.mchip .x:hover { color: var(--bad); }
.mchip.missing { border-color: var(--bad); color: var(--bad); }
.mtools { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.dropzone { border: 2px dashed var(--line); border-radius: 12px; padding: 14px; text-align: center; color: var(--muted); font-size: 13px; }
.dropzone.over { border-color: var(--accent); color: var(--accent); }

/* ------------------------------------------------------------ packs */
.packshero { padding: 28px 0 14px; }
.packshero h1 { margin: 0 0 6px; }
.packshero p { margin: 0 0 14px; color: var(--muted); }
.packstools { display: flex; gap: 8px; flex-wrap: wrap; }
.packstools input { min-width: 260px; }
.packslist { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 12px; }
.packcard { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 13px; display: flex; flex-direction: column; gap: 8px; }
.packcard h3 { margin: 0; font-size: 16px; }
.packcard .meta { font-size: 12px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px; }
.packcard .bar { height: 7px; border-radius: 5px; display: flex; overflow: hidden; background: var(--panel2); }
.packcard .bar i { display: block; height: 100%; }
.state { font-size: 11px; border-radius: 6px; padding: 1px 6px; border: 1px solid var(--line); }
.state.ok { color: var(--good); border-color: color-mix(in oklab, var(--good) 50%, transparent); }
.state.err { color: var(--bad); border-color: var(--bad); }
.state.q { color: var(--warn); border-color: var(--warn); }
.packcard .row { display: flex; gap: 6px; margin-top: auto; }

/* ------------------------------------------------------------ about */
.about { max-width: 900px; padding: 30px 0; }
.aboutgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin: 16px 0 26px; }
.aboutcard { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 16px; }
.aboutcard h3 { margin: 0 0 6px; color: var(--accent); }
.aboutcard p { margin: 0; color: var(--muted); font-size: 14px; }
.themepicker { display: flex; gap: 8px; margin-bottom: 20px; }
.themepicker button { background: var(--panel); border: 1px solid var(--line); padding: 9px 16px; border-radius: 10px; }
.themepicker button.active { border-color: var(--accent); color: var(--accent); }

/* ------------------------------------------------------------ toast */
.flash { animation: flash 1.6s ease; }
@keyframes flash {
  0% { box-shadow: 0 0 0 3px color-mix(in oklab, var(--good) 65%, transparent); }
  70% { box-shadow: 0 0 0 3px color-mix(in oklab, var(--good) 25%, transparent); }
  100% { box-shadow: none; }
}
.btheme.flash { animation: flashb 2.2s ease; }
@keyframes flashb {
  0%, 40% { box-shadow: 0 0 0 3px var(--good); }
  100% { box-shadow: none; }
}
.hintsep { opacity: .4; margin: 0 4px; }
#builderSummary b { color: var(--accent); }
#builderSummary { color: var(--text); font-weight: 500; }

.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 20px);
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 11px 18px;
  box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: .25s; z-index: 200; font-size: 14px;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { border-color: var(--bad); color: var(--bad); }
.toast.ok { border-color: var(--good); }

.spinner { width: 16px; height: 16px; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; vertical-align: -3px; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 1100px) {
  .layout { grid-template-columns: 1fr; }
  .filters { position: static; max-height: none; order: 2; }
  .results { order: 1; }
  .hero { flex-direction: column; align-items: flex-start; }
  .hero-stats { margin-left: 0; flex-wrap: wrap; }
  .tabs { overflow-x: auto; }
}
@media (max-width: 640px) {
  main { padding: 0 12px 40px; }
  .topbar { padding: 8px 12px; flex-wrap: wrap; }
  .cards { grid-template-columns: 1fr; }
  .q { grid-template-columns: 56px 1fr; }
}
