:root {
  --bg: #090514;
  --bg-secondary: #10071F;
  --card: #170A2D;
  --card-hover: #241044;

  --primary: #7900FF;
  --primary-hover: #982FFF;
  --pink: #F000E9;
  --gold: #FFD000;
  --orange: #FF7900;

  --text: #F7F2FF;
  --text-muted: #A99ABE;
  --border: #402063;

  --gradient-brand: linear-gradient(135deg, #7900FF, #F000E9, #FF7900);
  --gradient-gold: linear-gradient(135deg, #FFD000, #FF7900);

  --ok: #3ddc97;
  --danger: #ff4d6d;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .45);
  --glow: 0 0 0 1px rgba(152, 47, 255, .55), 0 8px 28px rgba(121, 0, 255, .35);
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; }
body {
  min-height: 100dvh; display: flex; flex-direction: column;
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(240, 0, 233, .10), transparent 60%),
    radial-gradient(900px 500px at -10% 10%, rgba(121, 0, 255, .16), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font: 15px/1.5 "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--primary-hover); outline-offset: 2px; }
.muted { color: var(--text-muted); }
.icon { width: 18px; height: 18px; flex: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- header ---------- */
.top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 18px;
  padding: 10px max(20px, env(safe-area-inset-right)) 10px max(20px, env(safe-area-inset-left));
  padding-top: max(10px, env(safe-area-inset-top));
  background: rgba(9, 5, 20, .78); backdrop-filter: blur(14px) saturate(140%); -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid rgba(64, 32, 99, .7);
}
.top::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; background: var(--gradient-brand); opacity: .55; }
.brand { display: flex; align-items: center; flex: none; }
.brand img { height: 42px; width: auto; filter: drop-shadow(0 0 10px rgba(240, 0, 233, .25)); transition: filter .25s var(--ease); }
.brand:hover img { filter: drop-shadow(0 0 16px rgba(240, 0, 233, .5)); }
.tabs { display: flex; gap: 2px; overflow-x: auto; flex: 1; scrollbar-width: none; mask-image: linear-gradient(90deg, #000 92%, transparent); }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  position: relative; padding: 8px 12px; border-radius: 9px; color: var(--text-muted);
  white-space: nowrap; font-weight: 600; font-size: 14px; transition: color .2s, background .2s;
}
.tab:hover { color: var(--text); background: rgba(121, 0, 255, .12); }
.tab.on { color: var(--text); }
.tab.on::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: 2px; height: 2px; border-radius: 2px; background: var(--gradient-brand); }
.tab.mine { color: var(--gold); }
.account { display: flex; align-items: center; gap: 10px; flex: none; }
.me-chip {
  display: flex; align-items: center; gap: 9px; padding: 4px 12px 4px 4px; border-radius: 999px;
  background: var(--card); border: 1px solid var(--border); transition: border-color .2s, box-shadow .2s;
}
.me-chip:hover { border-color: var(--primary-hover); box-shadow: var(--glow); }
.avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; background: var(--bg-secondary); flex: none; }
.me-name { font-weight: 600; font-size: 14px; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 16px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--card); font-weight: 600; white-space: nowrap; font-size: 14px;
  transition: transform .15s var(--ease), border-color .2s, background .2s, box-shadow .2s;
}
.btn:hover { border-color: var(--primary-hover); background: var(--card-hover); }
.btn:active { transform: translateY(1px); }
.btn.primary { border: 0; background: var(--primary); color: #fff; box-shadow: 0 6px 20px rgba(121, 0, 255, .35); }
.btn.primary:hover { background: var(--primary-hover); box-shadow: 0 8px 26px rgba(152, 47, 255, .5); }
.btn.brand { border: 0; background: var(--gradient-brand); color: #fff; }
.btn.brand:hover { filter: brightness(1.1); box-shadow: 0 8px 26px rgba(240, 0, 233, .35); }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--danger); }
.btn.danger:hover { border-color: var(--danger); background: rgba(255, 77, 109, .08); }
.btn.small { padding: 6px 11px; font-size: 13px; }
.btn.icon-only { padding: 7px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.steam-btn { background: #171a21; border-color: #2a475e; color: #c7d5e0; }
.steam-btn:hover { background: #1b2838; border-color: #66c0f4; }
.steam-btn svg { width: 18px; height: 18px; }

/* switch */
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; font-size: 14px; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch .track { width: 40px; height: 22px; border-radius: 999px; background: #2b1a45; border: 1px solid var(--border); position: relative; transition: background .2s; flex: none; }
.switch .track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--text-muted); transition: transform .2s var(--ease), background .2s; }
.switch input:checked + .track { background: var(--primary); border-color: var(--primary-hover); }
.switch input:checked + .track::after { transform: translateX(18px); background: #fff; }
.switch input:focus-visible + .track { outline: 2px solid var(--primary-hover); outline-offset: 2px; }

/* segmented */
.seg { display: inline-flex; padding: 3px; border-radius: 11px; background: var(--bg-secondary); border: 1px solid var(--border); }
.seg button { border: 0; background: none; padding: 6px 12px; border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--text-muted); }
.seg button.on { background: var(--primary); color: #fff; }

/* ---------- layout ---------- */
.view { width: 100%; max-width: 1360px; margin: 0 auto; padding: 22px 20px 48px; flex: 1; animation: fade .3s var(--ease); }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 18px; }
.bar h1 { font-size: 24px; margin: 0 auto 0 0; letter-spacing: .2px; }
.bar h1 .muted { font-size: 15px; font-weight: 500; }
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--text-muted); font-weight: 600; font-size: 14px; }
.back:hover { color: var(--text); }
.field-input, .search, .select {
  padding: 9px 12px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--bg-secondary);
  transition: border-color .2s, box-shadow .2s;
}
.search { flex: 1 1 240px; max-width: 380px; padding-left: 36px;
  background: var(--bg-secondary) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23A99ABE' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") no-repeat 11px center / 17px; }
.field-input:focus, .search:focus, .select:focus { outline: none; border-color: var(--primary-hover); box-shadow: 0 0 0 3px rgba(121, 0, 255, .25); }
.chip-check { display: inline-flex; align-items: center; gap: 7px; padding: 8px 12px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--bg-secondary); font-size: 14px; cursor: pointer; color: var(--text-muted); }
.chip-check:has(input:checked) { color: var(--text); border-color: var(--orange); background: rgba(255, 121, 0, .1); }
.chip-check input { accent-color: var(--orange); }
.count { color: var(--text-muted); font-size: 14px; margin: -6px 0 14px; }

/* ---------- hero ---------- */
.hero {
  position: relative; overflow: hidden; border-radius: 22px; padding: 44px 40px;
  background: linear-gradient(140deg, rgba(121, 0, 255, .22), rgba(240, 0, 233, .08) 55%, rgba(255, 121, 0, .10)), var(--bg-secondary);
  border: 1px solid var(--border); display: grid; grid-template-columns: 1.2fr 1fr; gap: 24px; align-items: center;
}
.hero::before { content: ""; position: absolute; inset: auto -20% -60% 40%; height: 120%; background: radial-gradient(closest-side, rgba(240, 0, 233, .22), transparent); pointer-events: none; }
.hero h1 { margin: 0 0 12px; font-size: clamp(28px, 4vw, 44px); line-height: 1.1; letter-spacing: -.5px; }
.grad { background: var(--gradient-brand); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { margin: 0 0 22px; color: var(--text-muted); font-size: 16px; max-width: 520px; }
.hero .cta { display: flex; gap: 10px; flex-wrap: wrap; }
.hero-logo { justify-self: center; width: min(420px, 100%); filter: drop-shadow(0 0 40px rgba(121, 0, 255, .45)); animation: float 6s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-8px); } }
.stats { display: flex; gap: 22px; margin-top: 24px; flex-wrap: wrap; }
.stat b { display: block; font-size: 22px; background: var(--gradient-gold); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat span { font-size: 13px; color: var(--text-muted); }

.section-title { display: flex; align-items: center; gap: 10px; margin: 30px 0 14px; font-size: 13px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1.2px; font-weight: 700; }
.section-title::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--border), transparent); }

.cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.cat {
  position: relative; display: flex; flex-direction: column; justify-content: flex-end; gap: 2px; min-height: 140px; overflow: hidden;
  padding: 14px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--border);
  transition: transform .25s var(--ease), border-color .25s, box-shadow .25s, background .25s;
}
.cat img { position: absolute; right: -6%; top: 8px; width: 74%; height: 62%; object-fit: contain; opacity: .9; transition: transform .35s var(--ease); }
.cat b { position: relative; font-size: 16px; }
.cat span { position: relative; font-size: 13px; color: var(--text-muted); }
.cat:hover { transform: translateY(-3px); border-color: var(--primary-hover); box-shadow: var(--glow); background: var(--card-hover); }
.cat:hover img { transform: scale(1.06) rotate(-2deg); }

/* ---------- cards ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.card {
  position: relative; display: flex; flex-direction: column; gap: 4px; overflow: hidden;
  padding: 10px 12px 14px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--border);
  text-align: left; color: var(--text); transition: transform .22s var(--ease), border-color .22s, box-shadow .22s, background .22s;
}
.card::before { content: ""; position: absolute; inset: 0; background: radial-gradient(120% 70% at 50% 0%, var(--rc, rgba(121, 0, 255, .25)), transparent 60%); opacity: .35; transition: opacity .25s; pointer-events: none; }
.card:hover { transform: translateY(-3px); border-color: var(--primary-hover); background: var(--card-hover); box-shadow: var(--glow); }
.card:hover::before { opacity: .6; }
.card .img { position: relative; aspect-ratio: 4 / 3; display: grid; place-items: center; margin-bottom: 4px; }
.card .img img { max-height: 100%; object-fit: contain; filter: drop-shadow(0 8px 12px rgba(0, 0, 0, .5)); transition: transform .3s var(--ease); }
.card:hover .img img { transform: scale(1.06); }
.card .name { position: relative; font-weight: 650; font-size: 14px; line-height: 1.25; }
.card .sub { position: relative; color: var(--text-muted); font-size: 12px; }
.card .rar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; }
.card.selected { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold) inset, 0 8px 24px rgba(255, 208, 0, .12); }
.badges { position: absolute; top: 8px; left: 8px; right: 8px; display: flex; gap: 5px; justify-content: space-between; z-index: 1; pointer-events: none; }
.badge { font-size: 10.5px; font-weight: 800; letter-spacing: .3px; padding: 2px 7px; border-radius: 6px; text-transform: uppercase; }
.badge.sel { background: var(--gradient-gold); color: #1a0d00; margin-left: auto; }
.badge.st { background: rgba(255, 121, 0, .18); color: #ffb26b; border: 1px solid rgba(255, 121, 0, .4); }
.empty { padding: 40px 20px; text-align: center; color: var(--text-muted); border: 1px dashed var(--border); border-radius: var(--radius); }

/* ---------- modal / editor ---------- */
.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; background: rgba(5, 2, 12, .72); backdrop-filter: blur(6px); animation: fadeIn .2s; }
.modal[hidden] { display: none; }
@keyframes fadeIn { from { opacity: 0; } }
.modal-box {
  position: relative; width: min(1000px, 100%); max-height: calc(100dvh - 32px); overflow: auto;
  background: linear-gradient(180deg, var(--card), var(--bg-secondary)); border: 1px solid var(--border); border-radius: 20px; padding: 22px;
  box-shadow: var(--shadow), 0 0 60px rgba(121, 0, 255, .18); animation: pop .25s var(--ease);
}
.modal-box.narrow { width: min(440px, 100%); }
@keyframes pop { from { transform: translateY(12px) scale(.98); opacity: 0; } }
.close { position: absolute; top: 12px; right: 12px; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: transparent; border: 1px solid transparent; color: var(--text-muted); }
.close:hover { color: var(--text); border-color: var(--border); background: var(--card-hover); }
.editor { display: grid; grid-template-columns: 1.1fr 1fr; gap: 24px; }
.preview { position: relative; border-radius: 16px; background: radial-gradient(ellipse at center, #2a1150 0%, #0e0620 75%); border: 1px solid var(--border); padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.preview .main-img { aspect-ratio: 4 / 3; display: grid; place-items: center; }
.preview .main-img img { max-height: 100%; object-fit: contain; filter: drop-shadow(0 16px 22px rgba(0, 0, 0, .6)); }
.preview .tag { font-style: italic; color: var(--gold); text-align: center; min-height: 1.4em; }
.extras { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.extras img { width: 46px; height: 46px; object-fit: contain; background: rgba(255, 255, 255, .04); border-radius: 8px; }
.meta h2 { margin: 0 0 4px; font-size: 21px; padding-right: 36px; }
.rarity { font-size: 13px; font-weight: 700; }
.field { margin-top: 16px; }
.field label, .field .lbl { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13px; color: var(--text-muted); margin-bottom: 7px; }
.field input[type=range] { width: 100%; accent-color: var(--pink); }
.field .field-input { width: 100%; }
.row { display: flex; gap: 8px; align-items: center; }
.wear-scale { display: grid; grid-template-columns: 7fr 8fr 23fr 7fr 55fr; height: 5px; border-radius: 3px; overflow: hidden; margin-top: 6px; }
.wear-scale span:nth-child(1) { background: #3ddc97; } .wear-scale span:nth-child(2) { background: #9ad94a; }
.wear-scale span:nth-child(3) { background: var(--gold); } .wear-scale span:nth-child(4) { background: var(--orange); }
.wear-scale span:nth-child(5) { background: var(--danger); }
.slots { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.slot { aspect-ratio: 1; border-radius: 10px; border: 1px dashed var(--border); background: var(--bg-secondary); display: grid; place-items: center; color: var(--text-muted); overflow: hidden; transition: border-color .2s, background .2s; }
.slot img { width: 88%; height: 88%; object-fit: contain; }
.slot:hover { border-color: var(--pink); background: var(--card-hover); }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 20px; }
.actions .grow { flex: 1; }
.note { font-size: 12px; color: var(--text-muted); margin-top: 12px; }
.picker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 8px; margin-top: 12px; }
.picker-grid .card { padding: 6px 6px 10px; }
.picker-grid .card .name { font-size: 11px; font-weight: 500; }

/* ---------- profile / my loadout ---------- */
.profile {
  position: relative; overflow: hidden; display: grid; grid-template-columns: auto 1fr auto; gap: 18px; align-items: center;
  padding: 20px; border-radius: 20px; border: 1px solid var(--border);
  background: linear-gradient(120deg, rgba(121, 0, 255, .18), rgba(240, 0, 233, .06) 60%, transparent), var(--card);
}
.profile .pic { width: 84px; height: 84px; border-radius: 18px; object-fit: cover; border: 2px solid transparent; background: var(--gradient-brand) border-box; box-shadow: 0 0 24px rgba(240, 0, 233, .3); }
.profile h1 { margin: 0; font-size: 22px; line-height: 1.2; word-break: break-word; }
.sid { display: inline-flex; align-items: center; gap: 6px; margin-top: 4px; font: 13px/1.4 ui-monospace, "Cascadia Mono", Consolas, monospace; color: var(--text-muted); }
.sid button { border: 0; background: none; color: var(--text-muted); padding: 2px; border-radius: 6px; display: inline-grid; }
.sid button:hover { color: var(--text); }
.profile .side { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.status { display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px; border-radius: 999px; font-size: 13px; font-weight: 600; border: 1px solid var(--border); background: var(--bg-secondary); color: var(--text-muted); white-space: nowrap; }
.status i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }
.status.saved { color: #c7b8de; }
.status.pending { color: var(--gold); border-color: rgba(255, 208, 0, .35); }
.status.pending i { animation: pulse 1.2s ease-in-out infinite; }
.status.applied { color: var(--ok); border-color: rgba(61, 220, 151, .35); }
@keyframes pulse { 50% { opacity: .3; } }
.status-wrap { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }

.items { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.item {
  display: grid; grid-template-columns: 96px 1fr; gap: 12px; align-items: center; padding: 10px 12px; border-radius: var(--radius);
  background: var(--card); border: 1px solid var(--border); transition: border-color .2s, opacity .2s, background .2s;
}
.item:hover { border-color: var(--primary-hover); background: var(--card-hover); }
.item.off { opacity: .55; }
.item .thumb { height: 72px; display: grid; place-items: center; border-radius: 10px; background: radial-gradient(ellipse at center, #2a1150, transparent 75%); position: relative; }
.item .thumb img { max-height: 100%; object-fit: contain; }
.item .thumb .rar { position: absolute; left: 14px; right: 14px; bottom: 0; height: 2px; border-radius: 2px; }
.item .t { font-weight: 650; font-size: 14px; line-height: 1.25; }
.item .d { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.item .ctl { display: flex; align-items: center; gap: 6px; margin-top: 8px; }
.item .ctl .switch { margin-right: auto; font-size: 13px; color: var(--text-muted); }
.pill { display: inline-block; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 6px; background: rgba(121, 0, 255, .2); color: #cfa8ff; margin-left: 4px; vertical-align: 1px; }
.pill.t { background: rgba(255, 121, 0, .16); color: #ffb26b; }
.pill.ct { background: rgba(80, 150, 255, .16); color: #93c0ff; }

details.hist { margin-top: 26px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); }
details.hist summary { cursor: pointer; padding: 12px 16px; font-weight: 600; color: var(--text-muted); list-style: none; display: flex; justify-content: space-between; }
details.hist summary::-webkit-details-marker { display: none; }
details.hist[open] summary { border-bottom: 1px solid var(--border); }
.history { display: grid; gap: 2px; padding: 8px; max-height: 360px; overflow: auto; }
.history .h { display: flex; gap: 12px; padding: 7px 8px; border-radius: 8px; font-size: 13.5px; }
.history .h:hover { background: var(--card-hover); }
.history time { color: var(--text-muted); white-space: nowrap; font-variant-numeric: tabular-nums; }

.login-card { max-width: 520px; margin: 30px auto; padding: 30px; border-radius: 20px; text-align: center; background: var(--card); border: 1px solid var(--border); }
.login-card img { width: 200px; margin: 0 auto 16px; }
.login-card h1 { margin: 0 0 8px; font-size: 24px; }
.login-card p { color: var(--text-muted); margin: 0 0 20px; }

/* about */
.about { max-width: 760px; }
.about section { padding: 18px 20px; margin-bottom: 12px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--border); }
.about h2 { margin: 0 0 8px; font-size: 16px; }
.about p, .about li { color: var(--text-muted); font-size: 14px; margin: 6px 0; }
.about a { color: var(--primary-hover); }
code { font: 13px ui-monospace, Consolas, monospace; background: var(--bg-secondary); border: 1px solid var(--border); padding: 1px 6px; border-radius: 6px; color: var(--text); }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: max(22px, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 70;
  display: flex; align-items: center; gap: 9px; max-width: calc(100vw - 32px);
  background: var(--card-hover); border: 1px solid var(--border); padding: 11px 16px; border-radius: 12px; box-shadow: var(--shadow);
  animation: toastIn .25s var(--ease);
}
.toast::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); flex: none; }
.toast.err { border-color: var(--danger); }
.toast.err::before { background: var(--danger); }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 10px); } }

/* footer */
.foot {
  display: flex; flex-wrap: wrap; gap: 6px 16px; justify-content: center; align-items: center;
  padding: 18px 20px calc(18px + env(safe-area-inset-bottom)); color: var(--text-muted); font-size: 12.5px; border-top: 1px solid rgba(64, 32, 99, .6);
}
.foot a:hover { color: var(--text); }

.skeleton { height: 220px; border-radius: var(--radius); background: linear-gradient(90deg, var(--card) 0%, var(--card-hover) 50%, var(--card) 100%); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; padding: 28px 22px; }
  .hero-logo { order: -1; width: min(300px, 80%); }
  .editor { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .top { flex-wrap: wrap; gap: 8px 12px; padding: 8px 12px; padding-top: max(8px, env(safe-area-inset-top)); }
  .brand img { height: 34px; }
  .tabs { order: 3; flex-basis: 100%; margin: 0 -12px; padding: 0 8px; }
  .account { margin-left: auto; }
  .me-name { display: none; }
  .me-chip { padding: 3px; }
  .view { padding: 14px 12px 36px; }
  .bar h1 { font-size: 20px; flex-basis: 100%; }
  .search { max-width: none; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
  .cats { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .cat { min-height: 116px; }
  .modal { padding: 0; place-items: end stretch; }
  .modal-box { max-height: 94dvh; border-radius: 20px 20px 0 0; padding: 18px 14px calc(18px + env(safe-area-inset-bottom)); }
  .modal-box.narrow { width: 100%; }
  .profile { grid-template-columns: auto 1fr; padding: 16px; }
  .profile .pic { width: 64px; height: 64px; border-radius: 14px; }
  .profile .side { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; }
  .items { grid-template-columns: 1fr; }
  .item { grid-template-columns: 80px 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* fixes after visual check */
.toast[hidden] { display: none; }
.preview { align-self: start; }
.field .switch { justify-content: flex-start; color: var(--text); margin: 0; }
.badge.sel .pill { background: rgba(26, 13, 0, .22); color: #1a0d00; }
@media (max-width: 760px) {
  .hero-logo { width: min(220px, 62%); }
  .hero { gap: 12px; }
  .preview { padding: 12px; }
  .preview .main-img { aspect-ratio: 16 / 9; }
}
.hero > picture { display: block; justify-self: center; width: min(420px, 100%); }
.hero > picture .hero-logo { width: 100%; height: auto; }
@media (max-width: 900px) { .hero > picture { order: -1; width: min(280px, 70%); } }
@media (max-width: 760px) { .hero > picture { width: 180px; } }
code { white-space: nowrap; }

/* side switcher in "Мой набор" */
.side-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin: 18px 0 4px; }
.side-bar .seg { max-width: 100%; overflow-x: auto; }
.side-bar .seg button { white-space: nowrap; }
.side-hint { margin: 0; font-size: 13px; flex: 1 1 260px; }
