/* BOB OBJ — основной сайт */
:root {
  --bg: #0b0d14; --bg2: #11141e; --panel: #151926; --panel2: #1b2030; --line: #242a3b; --line2: #323a52;
  --text: #eef1f8; --muted: #8b93a9; --dim: #5d6680;
  --a1: #7c5cff; --a2: #1ed6c9; --grad: linear-gradient(135deg, var(--a1), var(--a2));
  --star: #ffc53d; --bad: #ff5d73; --ok: #2fd27a;
  --tile: radial-gradient(130% 110% at 50% 10%, #3a4259 0%, #272d3f 60%, #1e2333 100%);
  --r: 18px; --shadow: 0 20px 50px -20px rgba(0,0,0,.65);
  --ease: cubic-bezier(.2,.8,.2,1);
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f4f6fb; --bg2: #ffffff; --panel: #ffffff; --panel2: #f2f4fa; --line: #e3e7f0; --line2: #d2d8e6;
  --text: #121624; --muted: #5f6880; --dim: #98a0b6;
  --tile: radial-gradient(120% 100% at 50% 0%, #ffffff 0%, #eef1f8 75%);
  --shadow: 0 18px 40px -22px rgba(30,40,80,.35);
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.45 Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif; -webkit-font-smoothing: antialiased; }
body { min-height: 100vh; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
svg { width: 18px; height: 18px; flex: none; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--a1); outline-offset: 2px; border-radius: 10px; }

/* ---------- шапка ---------- */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 18px; padding: 14px 24px; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(18px) saturate(1.4); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); flex: none; }
.brand-mark { width: 38px; height: 38px; filter: drop-shadow(0 6px 16px rgba(124,92,255,.45)); }
.brand-name { font: 800 20px/1 Unbounded, Inter, sans-serif; letter-spacing: .02em; }
.brand-name b { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; margin-left: 4px; }
.search { flex: 1; max-width: 720px; margin: 0 auto; display: flex; align-items: center; gap: 10px; height: 46px; padding: 0 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; transition: border-color .2s, box-shadow .2s; }
.search:focus-within { border-color: color-mix(in srgb, var(--a1) 70%, transparent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--a1) 18%, transparent); }
.search svg { color: var(--muted); }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font-size: 15px; }
.search input::-webkit-search-cancel-button { filter: grayscale(1); }
.search kbd { font: 600 12px Inter; color: var(--dim); border: 1px solid var(--line2); border-radius: 6px; padding: 1px 7px; }
.top-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.icon-btn { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; color: var(--muted); transition: background .2s, color .2s; }
.icon-btn:hover { background: var(--panel2); color: var(--text); }
.icon-btn.sm { width: 32px; height: 32px; }
.btn-ghost { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); font-weight: 600; transition: border-color .2s, background .2s; }
.btn-ghost:hover { border-color: var(--line2); background: var(--panel2); }
.btn-ghost.wide { width: 100%; justify-content: center; height: 46px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px; padding: 0 18px; border-radius: 12px; background: var(--grad); color: #fff; font-weight: 700; box-shadow: 0 10px 24px -12px var(--a1); transition: transform .15s var(--ease), filter .2s; }
.btn:hover { filter: brightness(1.08); } .btn:active { transform: scale(.97); }
.btn.wide { width: 100%; height: 48px; }
.btn[disabled] { opacity: .6; pointer-events: none; }
.user { position: relative; }
.ava { width: 26px; height: 26px; border-radius: 9px; display: grid; place-items: center; background: var(--grad); color: #fff; font-weight: 800; font-size: 13px; }
.menu { position: absolute; right: 0; top: 48px; min-width: 210px; padding: 6px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); animation: pop .18s var(--ease); }
.menu button { width: 100%; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; text-align: left; }
.menu button:hover { background: var(--panel2); }

/* ---------- вкладки ---------- */
.tabs { display: flex; gap: 6px; padding: 12px 24px 0; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 12px; color: var(--muted); font-weight: 600; white-space: nowrap; transition: background .2s, color .2s; }
.tab:hover { color: var(--text); background: var(--panel); }
.tab.on { color: var(--text); background: var(--panel); box-shadow: inset 0 0 0 1px var(--line); }
.tab.on svg { color: var(--a1); }
.cnt { font-size: 12px; color: var(--dim); font-weight: 600; }
.tab.on .cnt { color: var(--muted); }

/* ---------- раскладка ---------- */
.layout { display: grid; grid-template-columns: 270px 1fr; gap: 22px; padding: 14px 24px 40px; align-items: start; }
.side { position: sticky; top: 86px; max-height: calc(100vh - 100px); overflow: auto; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 10px; scrollbar-width: thin; }
.side-head { display: flex; align-items: center; justify-content: space-between; padding: 6px 10px 10px; }
.side-head b { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.cat { width: 100%; display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; text-align: left; color: var(--text); transition: background .15s; }
.cat:hover { background: var(--panel2); }
.cat.on { background: color-mix(in srgb, var(--a1) 16%, transparent); }
.cat.on .cat-n { color: var(--text); }
.cat-ic { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; font-size: 14px; background: var(--panel2); flex: none; }
.cat-t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat-n { font-size: 12px; color: var(--dim); font-variant-numeric: tabular-nums; }
.content { min-width: 0; }
.bar { display: flex; align-items: center; gap: 12px; min-height: 44px; }
.crumbs { flex: 1; min-width: 0; font: 700 22px/1.2 Unbounded, Inter, sans-serif; letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crumbs small { font: 500 14px Inter; color: var(--muted); margin-left: 8px; letter-spacing: 0; }
.bar-right { display: flex; align-items: center; gap: 10px; }
.found { color: var(--muted); font-size: 13px; white-space: nowrap; }
select { height: 38px; padding: 0 12px; border-radius: 11px; border: 1px solid var(--line); background: var(--panel); outline: 0; }
.subs { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0 14px; }
.subs:empty { margin: 4px 0 8px; }
.sub { padding: 7px 13px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); font-size: 13px; font-weight: 600; color: var(--muted); transition: all .15s; }
.sub:hover { color: var(--text); border-color: var(--line2); }
.sub.on { color: #fff; background: var(--grad); border-color: transparent; }
.sub i { font-style: normal; opacity: .65; margin-left: 4px; font-weight: 500; }

/* ---------- сетка (виртуальная) ---------- */
.grid-wrap { position: relative; }
.grid { position: relative; }
.card { position: absolute; top: 0; left: 0; display: flex; flex-direction: column; border-radius: var(--r); background: var(--panel); border: 1px solid var(--line); overflow: hidden; cursor: pointer; transition: transform .25s var(--ease), border-color .2s, box-shadow .25s; }
.card:hover { transform: translateY(-4px); border-color: var(--line2); box-shadow: var(--shadow); z-index: 1; }
.pic { position: relative; aspect-ratio: 1; background: var(--tile); display: grid; place-items: center; overflow: hidden; }
.pic img { width: 88%; height: 88%; object-fit: contain; transition: transform .35s var(--ease); filter: drop-shadow(0 10px 14px rgba(0,0,0,.28)); }
.card:hover .pic img { transform: scale(1.06); }
.pic .gid { position: absolute; left: 10px; top: 10px; padding: 3px 8px; border-radius: 8px; font: 700 11.5px Inter; background: color-mix(in srgb, var(--bg) 70%, transparent); backdrop-filter: blur(8px); color: var(--muted); font-variant-numeric: tabular-nums; }
.pic .is-new { position: absolute; left: 10px; bottom: 10px; padding: 3px 8px; border-radius: 8px; font: 800 10.5px Inter; letter-spacing: .06em; background: var(--grad); color: #fff; }
.fav-btn { position: absolute; right: 8px; top: 8px; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 11px; color: var(--muted); background: color-mix(in srgb, var(--bg) 60%, transparent); backdrop-filter: blur(8px); opacity: 0; transform: scale(.85); transition: opacity .2s, transform .2s var(--ease), color .2s; }
.card:hover .fav-btn, .fav-btn.on { opacity: 1; transform: none; }
.fav-btn.on { color: var(--star); }
.fav-btn:hover { color: var(--star); transform: scale(1.1); }
.cap { padding: 10px 12px 12px; border-top: 1px solid var(--line); }
.cap b { display: block; font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cap span { display: block; font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.empty { padding: 70px 20px; text-align: center; color: var(--muted); }
.empty b { display: block; font: 700 20px Unbounded, Inter; color: var(--text); margin-bottom: 8px; }
.empty .btn { margin-top: 16px; }
.skeleton { background: linear-gradient(90deg, var(--panel) 0%, var(--panel2) 50%, var(--panel) 100%); background-size: 200% 100%; animation: shimmer 1.3s infinite linear; }

/* ---------- карточка объекта ---------- */
dialog { border: 0; padding: 0; color: var(--text); background: transparent; }
dialog::backdrop { background: rgba(5,7,12,.62); backdrop-filter: blur(6px); }
.detail[open] { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(320px, .9fr); width: min(1120px, calc(100vw - 32px)); height: min(720px, calc(100vh - 32px)); background: var(--panel); border: 1px solid var(--line); border-radius: 24px; overflow: hidden; box-shadow: 0 40px 100px -30px rgba(0,0,0,.8); animation: pop .25s var(--ease); }
.d-stage { position: relative; background: var(--tile); display: grid; place-items: center; overflow: hidden; touch-action: none; }
.d-stage img { width: 86%; height: 86%; object-fit: contain; filter: drop-shadow(0 22px 26px rgba(0,0,0,.32)); }
.d-stage canvas { width: 100%; height: 100%; cursor: grab; display: block; }
.d-stage canvas:active { cursor: grabbing; }
.d-tools { position: absolute; left: 16px; bottom: 16px; display: flex; gap: 8px; }
.chip-btn { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border-radius: 12px; font-weight: 600; background: color-mix(in srgb, var(--bg) 72%, transparent); border: 1px solid var(--line2); backdrop-filter: blur(10px); transition: background .2s; }
.chip-btn:hover { background: var(--panel2); }
.d-hint { position: absolute; top: 16px; left: 50%; transform: translateX(-50%); font-size: 12.5px; color: var(--muted); background: color-mix(in srgb, var(--bg) 70%, transparent); padding: 6px 12px; border-radius: 999px; white-space: nowrap; pointer-events: none; }
.d-load { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 12px; color: var(--muted); background: color-mix(in srgb, var(--panel) 40%, transparent); }
.d-load i { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--line2); border-top-color: var(--a1); animation: spin .8s linear infinite; }
.d-info { position: relative; padding: 28px 26px 22px; overflow: auto; display: flex; flex-direction: column; gap: 14px; border-left: 1px solid var(--line); }
.detail .d-close { position: absolute; right: 14px; top: 14px; z-index: 3; background: color-mix(in srgb, var(--panel) 80%, transparent); backdrop-filter: blur(8px); }
.auth .d-close { position: absolute; right: 12px; top: 10px; }
.detail[open] { position: relative; }
.d-kicker { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--a2); padding-right: 40px; }
.d-info h2 { margin: -6px 0 0; font: 700 26px/1.2 Unbounded, Inter, sans-serif; letter-spacing: -.01em; padding-right: 30px; }
.d-desc { margin: 0; color: var(--muted); font-size: 15px; }
.d-desc:first-letter { text-transform: uppercase; }
.d-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.d-tags button { padding: 5px 11px; border-radius: 999px; font-size: 12.5px; background: var(--panel2); border: 1px solid var(--line); color: var(--muted); }
.d-tags button:hover { color: var(--text); border-color: var(--line2); }
.d-id { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-radius: 16px; background: var(--panel2); border: 1px solid var(--line); }
.d-id small { display: block; color: var(--muted); font-size: 12px; }
.d-id b { font: 800 28px/1.1 Unbounded, Inter; font-variant-numeric: tabular-nums; }
.d-meta { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin: 0; font-size: 13.5px; }
.d-meta dt { color: var(--muted); }
.d-meta dd { margin: 0; word-break: break-word; font-family: ui-monospace, Consolas, monospace; font-size: 13px; }
.d-fav { margin-top: auto; display: flex; flex-direction: column; gap: 8px; }
.d-fav .on { color: var(--star); border-color: color-mix(in srgb, var(--star) 50%, transparent); }
.d-fav select { width: 100%; height: 42px; }

/* ---------- вход ---------- */
.auth[open] { width: min(420px, calc(100vw - 32px)); padding: 54px 26px 26px; background: var(--panel); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow); animation: pop .22s var(--ease); position: relative; }
.auth h3 { margin: -30px 44px 16px 0; font: 700 20px Unbounded, Inter; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; background: var(--panel2); border-radius: 14px; margin: 0 0 14px; }
.auth-tabs button { height: 38px; border-radius: 10px; font-weight: 700; color: var(--muted); }
.auth-tabs button.on { background: var(--panel); color: var(--text); box-shadow: 0 2px 8px rgba(0,0,0,.15); }
.auth-note { margin: 0 0 16px; color: var(--muted); font-size: 13.5px; }
.auth form { display: flex; flex-direction: column; gap: 12px; }
.auth label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.auth input { height: 46px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg2); outline: 0; font-size: 15px; color: var(--text); }
.auth input:focus { border-color: var(--a1); box-shadow: 0 0 0 4px color-mix(in srgb, var(--a1) 18%, transparent); }
.auth-err { min-height: 18px; color: var(--bad); font-size: 13px; }

/* ---------- куки, тосты ---------- */
.cookie { position: fixed; z-index: 40; left: 50%; bottom: 20px; transform: translateX(-50%); width: min(760px, calc(100vw - 24px)); display: flex; align-items: center; gap: 16px; padding: 14px 16px 14px 20px; background: var(--panel); border: 1px solid var(--line2); border-radius: 18px; box-shadow: var(--shadow); animation: up .35s var(--ease); }
.cookie p { margin: 0; flex: 1; font-size: 13.5px; color: var(--muted); }
.toast { position: fixed; z-index: 50; left: 50%; bottom: 24px; transform: translate(-50%, 30px); padding: 12px 18px; border-radius: 14px; background: var(--text); color: var(--bg); font-weight: 600; opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s var(--ease); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@keyframes pop { from { opacity: 0; transform: scale(.97) translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes up { from { opacity: 0; transform: translate(-50%, 20px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { to { background-position: -200% 0; } }

.only-mobile { display: none !important; }
@media (max-width: 980px) {
  .layout { grid-template-columns: 1fr; padding: 10px 14px 30px; }
  .side { position: fixed; z-index: 30; inset: 0 auto 0 0; top: 0; width: min(320px, 86vw); max-height: none; border-radius: 0 20px 20px 0; transform: translateX(-105%); transition: transform .3s var(--ease); box-shadow: var(--shadow); }
  .side.open { transform: none; }
  .only-mobile { display: inline-flex !important; }
  .detail[open] { grid-template-columns: 1fr; grid-template-rows: 46% 1fr; height: calc(100vh - 20px); width: calc(100vw - 20px); }
  .d-info { border-left: 0; border-top: 1px solid var(--line); padding: 20px 18px; }
}
@media (max-width: 640px) {
  .top { gap: 10px; padding: 10px 12px; flex-wrap: wrap; }
  .brand-name { font-size: 17px; }
  .search { order: 3; flex-basis: 100%; height: 44px; }
  .search kbd { display: none; }
  .top-actions { margin-left: auto; }
  #login-btn span, #user-name { display: none; }
  .tabs { padding: 8px 12px 0; }
  .bar { flex-wrap: wrap; }
  .crumbs { font-size: 18px; order: -1; flex-basis: 100%; }
  .bar-right { margin-left: auto; }
  .found { display: none; }
  .cookie { flex-direction: column; align-items: stretch; bottom: 10px; }
  .d-info h2 { font-size: 21px; }
  .d-id b { font-size: 24px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
