:root {
    --bg: #eef2f7;
    --surface: #ffffff;
    --surface-2: #f6f8fc;
    --border: #e2e8f0;
    --text: #0f172a;
    --muted: #64748b;
    --navy: #0b1220;
    --navy-2: #111c33;
    --red: #e11d48;
    --orange: #f97316;
    --blue: #3b82f6;
    --green: #10b981;
    --shadow: 0 1px 3px rgba(15,23,42,.06), 0 8px 24px rgba(15,23,42,.07);
    --shadow-lg: 0 12px 40px rgba(15,23,42,.16);
    --radius: 16px;
    --grad-primary: linear-gradient(135deg, #e11d48, #f97316);
    --grad-dark: linear-gradient(135deg, #0b1220, #16213e);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.55;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--blue); text-decoration: none; transition: color .15s; }
a:hover { color: #1d4ed8; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; width: 100%; }

/* ===== Topbar ===== */
.topbar { background: linear-gradient(90deg, #0b1220, #14203a 55%, #0b1220); color: #94a3b8; font-size: 13px; border-bottom: 1px solid rgba(255,255,255,.06); }
.topbar__inner { display: flex; align-items: center; justify-content: space-between; min-height: 40px; gap: 16px; flex-wrap: wrap; }
.topbar__brand { display: flex; align-items: center; gap: 9px; }
.topbar__brand strong { color: #fff; letter-spacing: .5px; }
.logo-accent { color: #fb923c; }
.topbar__slogan { color: #64748b; }
.topbar__nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.topbar__nav a {
    color: #cbd5e1; padding: 5px 10px; border-radius: 8px; display: inline-flex; align-items: center; gap: 6px; font-weight: 500;
}
.topbar__nav a:hover { color: #fff; background: rgba(255,255,255,.08); }
.topbar__nav .icon { display: inline-flex; }
.topbar__sep { width: 1px; height: 16px; background: #334155; margin: 0 4px; }
.topbar__user { color: #fbbf24; font-weight: 700; }

/* ===== Header ===== */
.header { background: var(--surface); border-bottom: 1px solid var(--border); }
.header__grid { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 18px 0; flex-wrap: wrap; }
.logo { display: flex; align-items: center; gap: 12px; }
.logo__mark {
    width: 46px; height: 46px; border-radius: 14px; background: var(--grad-primary);
    display: flex; align-items: center; justify-content: center; color: #fff;
    box-shadow: 0 6px 18px rgba(225,29,72,.4);
}
.logo__text { font-weight: 900; letter-spacing: 1px; font-size: 24px; line-height: 1; }
.logo__text span { color: var(--red); }
.header__subtitle { color: var(--muted); font-size: 12px; margin-top: 3px; letter-spacing: .3px; }

.search-form { display: flex; gap: 8px; flex: 1; max-width: 560px; }
.search-form__input {
    flex: 1; border: 1px solid var(--border); border-radius: 12px; padding: 12px 16px;
    font-size: 14px; outline: none; transition: border .2s, box-shadow .2s; background: var(--surface-2);
}
.search-form__input:focus { border-color: var(--red); box-shadow: 0 0 0 4px rgba(225,29,72,.12); background: #fff; }
.search-form__mode { border: 1px solid var(--border); border-radius: 12px; padding: 0 8px; background: #fff; }

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    border: none; cursor: pointer; font-size: 14px; font-weight: 600;
    padding: 11px 18px; border-radius: 12px; transition: transform .12s, box-shadow .12s, background .15s;
}
.btn:hover { transform: translateY(-1px); }
.btn--accent { background: var(--grad-primary); color: #fff; box-shadow: 0 6px 16px rgba(225,29,72,.3); }
.btn--accent:hover { box-shadow: 0 8px 22px rgba(225,29,72,.4); }
.btn--dark { background: var(--grad-dark); color: #fff; }
.btn--ghost { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }
.btn--ghost:hover { background: #eef2f7; }
.btn--sm { padding: 8px 14px; font-size: 13px; border-radius: 10px; }
.btn--lg { padding: 14px 26px; font-size: 16px; border-radius: 14px; }
.btn--danger { background: #fee2e2; color: #b91c1c; }
.btn--danger:hover { background: #fecaca; }
.btn--success { background: #dcfce7; color: #15803d; }
.btn--success:hover { background: #bbf7d0; }

/* ===== Nav ===== */
.main-nav { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 60; box-shadow: 0 2px 10px rgba(15,23,42,.04); }
.main-nav__inner { display: flex; flex-wrap: wrap; gap: 2px 6px; padding: 0 20px; }
.main-nav__link {
    padding: 12px 13px; color: var(--muted); font-size: 14px; white-space: nowrap; font-weight: 600;
    border-radius: 9px 9px 0 0; display: inline-flex; align-items: center; gap: 7px;
    position: relative; transition: color .15s, background .15s;
}
.main-nav__link .icon { display: inline-flex; opacity: .7; }
.main-nav__link:hover { color: var(--text); background: var(--surface-2); }
.main-nav__link.is-active { color: var(--red); background: linear-gradient(180deg, rgba(225,29,72,.07), transparent); }
.main-nav__link.is-active::after { content: ""; position: absolute; left: 13px; right: 13px; bottom: 0; height: 3px; border-radius: 3px 3px 0 0; background: var(--grad-primary); }

.main { flex: 1; padding: 24px 20px 52px; }

/* ===== Alerts ===== */
.alert { margin: 16px 0 0; padding: 13px 18px; border-radius: 12px; font-size: 14px; border: 1px solid transparent; }
.alert--good { background: #dcfce7; color: #15803d; border-color: #bbf7d0; }
.alert--bad, .alert--error { background: #fee2e2; color: #b91c1c; border-color: #fecaca; }

/* ===== Hero ===== */
.hero {
    background: var(--grad-dark);
    color: #fff; border-radius: 22px; padding: 40px 44px; margin-bottom: 28px;
    position: relative; overflow: hidden; box-shadow: var(--shadow-lg);
}
.hero::before {
    content: ""; position: absolute; right: -80px; top: -80px; width: 360px; height: 360px;
    background: radial-gradient(circle, rgba(249,115,22,.35), transparent 60%);
}
.hero::after {
    content: ""; position: absolute; right: 140px; bottom: -120px; width: 320px; height: 320px;
    background: radial-gradient(circle, rgba(59,130,246,.3), transparent 60%);
}
.hero__inner { position: relative; z-index: 2; display: grid; grid-template-columns: 1.3fr 1fr; gap: 28px; align-items: center; }
.hero__badge { display: inline-flex; align-items: center; gap: 8px; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.18); padding: 6px 14px; border-radius: 30px; font-size: 12.5px; color: #fde68a; font-weight: 600; margin-bottom: 16px; }
.hero__title { font-size: 34px; font-weight: 900; line-height: 1.15; letter-spacing: -.5px; }
.hero__title span { background: linear-gradient(90deg, #fb923c, #f43f5e); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero__text { color: #94a3b8; margin-top: 12px; font-size: 15px; max-width: 480px; }
.hero__cta { margin-top: 22px; display: flex; gap: 12px; flex-wrap: wrap; }
.hero__art { display: flex; justify-content: center; }
.hero__car { width: 100%; max-width: 380px; filter: drop-shadow(0 18px 30px rgba(0,0,0,.4)); }
@media (max-width: 860px) {
    .hero__inner { grid-template-columns: 1fr; }
    .hero__title { font-size: 26px; }
    .hero__art { display: none; }
}

/* ===== Cards ===== */
.page-head { margin-bottom: 20px; }
.page-head h1 { font-size: 27px; font-weight: 800; letter-spacing: -.3px; }
.page-head p { color: var(--muted); margin-top: 4px; }

.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; margin-bottom: 26px; }
.stat-card {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 18px 20px; box-shadow: var(--shadow); display: flex; align-items: center; gap: 16px; position: relative; overflow: hidden;
}
.stat-card__icon { width: 46px; height: 46px; border-radius: 12px; display: flex; align-items: center; justify-content: center; color: #fff; flex-shrink: 0; }
.stat-card__value { font-size: 28px; font-weight: 800; line-height: 1.1; }
.stat-card__label { color: var(--muted); font-size: 13px; margin-top: 2px; }

.grid-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 24px; }
@media (max-width: 900px) { .grid-2col { grid-template-columns: 1fr; } }

.card {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: var(--shadow); overflow: hidden;
}
.card__head {
    padding: 14px 18px; font-weight: 700; font-size: 15px; border-bottom: 1px solid var(--border);
    background: linear-gradient(90deg, #0b1220, #1a2744); color: #fff;
    display: flex; justify-content: space-between; align-items: center; gap: 10px;
}
.card__head .icon { display: inline-flex; }
.card__body { padding: 18px; }

/* Sections grid */
.sections-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.section-tile {
    border-radius: var(--radius); padding: 20px; color: #fff; position: relative; overflow: hidden;
    box-shadow: var(--shadow); transition: transform .15s, box-shadow .15s; display: block; min-height: 108px;
    background: linear-gradient(135deg, #6366f1, #4338ca);
}
.section-tile::after {
    content: ""; position: absolute; right: -30px; bottom: -40px; width: 140px; height: 140px;
    background: rgba(255,255,255,.12); border-radius: 50%;
}
.section-tile:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); color: #fff; }
.section-tile__icon { position: absolute; right: 16px; top: 16px; opacity: .9; filter: drop-shadow(0 2px 6px rgba(0,0,0,.2)); }
.section-tile__name { font-size: 17px; font-weight: 800; position: relative; z-index: 2; line-height: 1.3; }
.section-tile__descr { font-size: 12.5px; margin-top: 6px; opacity: .85; position: relative; z-index: 2; line-height: 1.45; max-width: 82%; }
.section-tile__count { font-size: 13px; margin-top: 8px; opacity: .92; position: relative; z-index: 2; }
.section-tile__count b { font-size: 15px; }

/* ===== Section page ===== */
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.section-head h1 { font-size: 25px; font-weight: 800; letter-spacing: -.3px; }
.breadcrumbs { color: var(--muted); font-size: 13px; margin-bottom: 8px; }
.breadcrumbs a { color: var(--muted); }
.breadcrumbs a:hover { color: var(--red); }

.filters { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 18px; }
.filters__group { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; }
.filters__legend { font-size: 11px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .8px; margin-bottom: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
    padding: 5px 12px; border-radius: 20px; border: 1px solid var(--border); background: var(--surface-2);
    font-size: 13px; color: var(--text); cursor: pointer; transition: all .15s;
}
.chip:hover { border-color: var(--red); color: var(--red); }
.chip.is-active { background: var(--grad-primary); color: #fff; border-color: transparent; font-weight: 600; box-shadow: 0 3px 10px rgba(225,29,72,.3); }
.chip__reset { background: #fef3c7; border-color: #fde68a; color: #92400e; }

.layout { display: grid; grid-template-columns: 268px 1fr; gap: 20px; align-items: start; }
@media (max-width: 860px) { .layout { grid-template-columns: 1fr; } }
.sidebar { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 62px; }

/* Site card */
.site-card {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: var(--shadow); padding: 18px 18px 14px; margin-bottom: 14px; display: grid;
    grid-template-columns: 78px 1fr; gap: 16px; position: relative; transition: border-color .2s, box-shadow .2s;
}
.site-card:hover { box-shadow: var(--shadow-lg); }
.site-card.is-active { border-color: var(--red); box-shadow: 0 0 0 4px rgba(225,29,72,.14); }
.site-card.flash-highlight { animation: site-flash 2.6s ease; }
@keyframes site-flash {
    0%, 60% { box-shadow: 0 0 0 4px rgba(251,146,60,.6), 0 12px 40px rgba(225,29,72,.25); border-color: var(--orange); }
    100% { box-shadow: var(--shadow); }
}
.site-card__place { text-align: center; align-self: start; }
.place-badge {
    width: 58px; height: 62px; border-radius: 14px; display: flex; flex-direction: column; align-items: center; justify-content: center;
    background: var(--grad-dark); color: #fff; font-weight: 900; font-size: 20px; line-height: 1.05;
    box-shadow: 0 6px 16px rgba(15,23,42,.25);
}
.place-badge small { font-size: 9px; font-weight: 600; color: #94a3b8; letter-spacing: .3px; }
.site-card__rank { color: var(--muted); font-size: 11.5px; margin-top: 7px; font-weight: 600; }
.site-card__clicks { color: var(--muted); font-size: 12px; margin-top: 2px; }

.site-card__name { font-size: 17px; font-weight: 700; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.site-card__name a { color: var(--text); }
.site-card__name a:hover { color: var(--red); }
.letter-avatar {
    display: inline-flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; border-radius: 11px; flex-shrink: 0;
    font-weight: 800; font-size: 17px; color: #fff;
    background: linear-gradient(135deg, hsl(calc(60 * var(--av)) 70% 48%), hsl(calc(60 * var(--av)) 70% 32%));
    box-shadow: 0 4px 10px hsla(calc(60 * var(--av)), 70%, 40%, .3);
}
.site-card__descr { color: var(--muted); font-size: 14px; margin-top: 6px; }
.site-card__tags { margin-top: 8px; }
.site-card__actions { margin-top: 11px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tag-link { font-size: 12px; color: #1d4ed8; background: #eff6ff; padding: 2px 9px; border-radius: 6px; font-weight: 600; }
.tag-link:hover { background: #dbeafe; color: #1e40af; }

.vote-btn {
    display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700;
    padding: 7px 14px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); cursor: pointer;
    transition: all .15s;
}
.vote-btn .icon { display: inline-flex; }
.vote-btn--up:hover { border-color: var(--green); color: var(--green); background: #f0fdf4; }
.vote-btn--down { color: var(--muted); }
.vote-btn--down:hover { border-color: var(--red); color: var(--red); background: #fef2f2; }
.vote-btn.is-voted { pointer-events: none; opacity: .55; }
.vote-btn .arrow { font-size: 11px; }

.small-link { font-size: 13px; color: var(--muted); }
.small-link:hover { color: var(--red); }

.found { background: #fef08a; padding: 0 2px; border-radius: 3px; color: inherit; }

/* Hotlist */
.hotlist-item { display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px dashed var(--border); font-size: 14px; }
.hotlist-item:last-child { border-bottom: none; }
.hotlist-item__rank { color: var(--red); font-weight: 800; min-width: 22px; }
.hotlist-item__name a { color: var(--text); font-weight: 600; }
.hotlist-item__name a:hover { color: var(--red); }
.hotlist-item__descr { color: var(--muted); font-size: 13px; }

.fresh-item { padding: 9px 0; border-bottom: 1px dashed var(--border); font-size: 14px; }
.fresh-item:last-child { border-bottom: none; }
.fresh-item a { color: var(--text); font-weight: 600; }
.fresh-item a:hover { color: var(--red); }

/* Top 10 */
.top-list { counter-reset: top; }
.top-item { display: flex; align-items: flex-start; gap: 12px; padding: 11px 0; border-bottom: 1px dashed var(--border); }
.top-item:last-child { border-bottom: none; }
.top-item__num {
    font-weight: 900; font-size: 20px; min-width: 30px; text-align: center;
    background: var(--grad-primary); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.top-item__name { font-weight: 600; }
.top-item__name a { color: var(--text); }
.top-item__name a:hover { color: var(--red); }
.top-item__clicks { color: var(--muted); font-size: 13px; }
.top-item__links { font-size: 13px; margin-top: 4px; }

/* ===== Новости на главной ===== */
.news-tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (max-width: 480px) { .news-tiles { grid-template-columns: 1fr; } }
.news-tile {
    display: block; background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
    overflow: hidden; box-shadow: var(--shadow); transition: transform .15s, box-shadow .15s;
}
.news-tile:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.news-tile__img { display: block; height: 92px; background: var(--surface-2); overflow: hidden; }
.news-tile__img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.news-tile__body { display: block; padding: 10px 12px 12px; }
.news-tile__title { display: block; font-size: 13px; font-weight: 700; line-height: 1.35; color: var(--text); }
.news-tile:hover .news-tile__title { color: var(--red); }
.news-tile__meta { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 7px; color: var(--muted); font-size: 11.5px; }

/* ===== Forum index ===== */
.forum-section-link { color: #fff; display: inline-flex; align-items: center; gap: 8px; }
.forum-section-link:hover { color: #fde68a; }
.forum-topics { display: flex; flex-direction: column; }
.forum-topic-row {
    display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
    padding: 9px 4px; border-bottom: 1px dashed var(--border);
}
.forum-topic-row:last-child { border-bottom: none; }
.forum-topic-row__title { font-size: 15px; font-weight: 600; color: var(--text); flex: 1; min-width: 200px; }
.forum-topic-row__title:hover { color: var(--red); }
.forum-topic-row__meta { display: flex; gap: 12px; font-size: 12.5px; color: var(--muted); align-items: center; white-space: nowrap; }

/* ===== Pagination ===== */
.pagination { display: flex; justify-content: center; align-items: center; gap: 6px; margin-top: 24px; flex-wrap: wrap; }
.page-link {
    padding: 9px 15px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface);
    color: var(--text); font-size: 13px; font-weight: 700; transition: all .15s;
}
.page-link:hover { border-color: var(--red); color: var(--red); transform: translateY(-1px); }
.page-link.is-active { background: var(--grad-primary); border-color: transparent; color: #fff; box-shadow: 0 4px 12px rgba(225,29,72,.3); }
.page-total { color: var(--muted); font-size: 13px; margin-left: 8px; }

/* ===== Forms ===== */
.form-card { max-width: 640px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 28px; }
.form-card--wide { max-width: 960px; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 6px; color: #334155; }
.form-control {
    width: 100%; border: 1px solid var(--border); border-radius: 11px; padding: 11px 14px; font-size: 14px;
    background: var(--surface-2); outline: none; transition: border .2s, box-shadow .2s;
}
.form-control:focus { border-color: var(--red); box-shadow: 0 0 0 4px rgba(225,29,72,.12); background: #fff; }
textarea.form-control { resize: vertical; min-height: 90px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 640px) { .form-row { grid-template-columns: 1fr; } }
.form-hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.captcha-row { display: flex; gap: 12px; align-items: center; }
.captcha-row img { border: 1px solid var(--border); border-radius: 11px; height: 50px; }

.alert-msg { padding: 13px 16px; border-radius: 12px; margin-bottom: 16px; font-size: 14px; border: 1px solid transparent; }
.alert-msg.bad { background: #fee2e2; color: #b91c1c; border-color: #fecaca; }
.alert-msg.good { background: #dcfce7; color: #15803d; border-color: #bbf7d0; }

/* ===== Account ===== */
.account-grid { display: grid; grid-template-columns: 310px 1fr; gap: 20px; align-items: start; }
@media (max-width: 900px) { .account-grid { grid-template-columns: 1fr; } }
.account-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.balance { font-size: 30px; font-weight: 900; background: var(--grad-primary); -webkit-background-clip: text; background-clip: text; color: transparent; }

.my-site-item { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 0; border-bottom: 1px dashed var(--border); }
.my-site-item:last-child { border-bottom: none; }

/* Table */
.table { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.table th { text-align: left; padding: 12px 14px; background: linear-gradient(90deg, #0b1220, #1a2744); color: #fff; font-size: 13px; }
.table td { padding: 10px 14px; border-bottom: 1px solid var(--border); font-size: 14px; }
.table tr:nth-child(even) { background: var(--surface-2); }
.table tr:hover { background: #f1f5f9; }

.status { padding: 3px 11px; border-radius: 20px; font-size: 12px; font-weight: 700; }
.status--0 { background: #dcfce7; color: #15803d; }
.status--1 { background: #fef9c3; color: #854d0e; }
.status--2 { background: #e0e7ff; color: #3730a3; }
.status--3 { background: #fee2e2; color: #b91c1c; }

/* Chart */
.chart { position: relative; height: 220px; display: flex; align-items: flex-end; gap: 8px; padding-top: 20px; }
.chart__bar { flex: 1; background: var(--grad-primary); border-radius: 6px 6px 0 0; min-width: 8px; transition: height .4s; }
.chart__bar:hover { filter: brightness(1.15); }
.chart__label { position: absolute; bottom: -22px; font-size: 10px; color: var(--muted); text-align: center; }
.chart-wrap { padding-bottom: 40px; }

/* Stats grid */
.stats-grid { display: grid; grid-template-columns: 1fr; gap: 20px; }
.stats-grid--2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 860px) { .stats-grid--2 { grid-template-columns: 1fr; } }

/* ===== Footer ===== */
.footer { background: var(--grad-dark); color: #94a3b8; margin-top: auto; padding: 26px 0; font-size: 13px; border-top: 3px solid var(--red); }
.footer__inner { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.footer strong { color: #fff; }
.footer__links { display: flex; gap: 18px; }
.footer__links a { color: #94a3b8; display: inline-flex; align-items: center; gap: 6px; }
.footer__links a:hover { color: #fff; }

/* 404 */
.notfound { text-align: center; padding: 80px 20px; }
.notfound h1 { font-size: 80px; background: var(--grad-primary); -webkit-background-clip: text; background-clip: text; color: transparent; font-weight: 900; }
.notfound p { color: var(--muted); margin-top: 8px; }

/* ===== Энциклопедия ===== */
.ency-body { font-size: 15px; line-height: 1.75; overflow-wrap: break-word; }
.ency-body p { margin-bottom: 10px; }
.ency-img { border-radius: 10px; border: 1px solid var(--border); margin: 4px 10px 8px 0; max-width: 100%; height: auto; }
.ency-float-left { float: left; }
.ency-float-right { float: right; }
.ency-table { border-collapse: collapse; margin: 12px 0; width: 100%; background: var(--surface); }
.ency-table td, .ency-table th { border: 1px solid var(--border); padding: 7px 12px; font-size: 14px; }
.ency-table th { background: #0f172a; color: #fff; text-align: center; }
.ency-table tr:nth-child(even) { background: var(--surface-2); }
.ency-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.ency-gallery .ency-img { width: 100%; height: 130px; object-fit: cover; margin: 0; }
.ency-body a.urlextern, .ency-body a { color: #2563eb; }
.ency-body a:hover { text-decoration: underline; }

/* ===== Экзотика: картинки без растягивания ===== */
.sketch-frame {
    display: flex; align-items: center; justify-content: center;
    background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px;
    overflow: hidden; min-height: 60px;
}
.sketch-frame--sm { height: 90px; }
.sketch-frame--card { height: 160px; }
.sketch-img {
    display: block; max-width: 100%; max-height: 100%; height: auto; width: auto;
    object-fit: contain; border-radius: 0;
}
.sketch-img--main { max-height: 520px; margin: 0 auto; }

/* Лайтбокс для изображений */
.lightbox {
    position: fixed; inset: 0; z-index: 200; display: none;
    align-items: center; justify-content: center; background: rgba(8, 12, 22, .88);
    padding: 24px; cursor: zoom-out;
}
.lightbox.is-open { display: flex; }
.lightbox__img { max-width: 92vw; max-height: 88vh; border-radius: 10px; box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.lightbox__caption { position: absolute; left: 0; right: 0; bottom: 16px; text-align: center; color: #cbd5e1; font-size: 14px; }
.lightbox__close {
    position: absolute; top: 14px; right: 20px; color: #fff; font-size: 30px; line-height: 1;
    cursor: pointer; opacity: .8; background: none; border: none;
}
.lightbox__close:hover { opacity: 1; }

.muted { color: var(--muted); }
.mt-1 { margin-top: 6px; } .mt-2 { margin-top: 12px; } .mt-3 { margin-top: 20px; } .mb-2 { margin-bottom: 12px; } .mb-3 { margin-bottom: 20px; }
.flex { display: flex; gap: 10px; align-items: center; } .flex-between { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
