/* ============================================================
   TIBIA WIKI — v2 Wowhead-style
   Schemat: ciemny szary + złoty akcent
   Layout: main (flex-1) + prawy sidebar (280px)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800&family=Playfair+Display:wght@700&display=swap');

/* === Zmienne === */
:root {
    /* Backgrounds */
    --bg:           #16181c;
    --bg2:          #1e2128;
    --bg3:          #252930;
    --bg4:          #2c3038;
    --bg5:          #333840;

    /* Borders */
    --bdr:          #2e333b;
    --bdr2:         #3a404a;
    --bdr3:         #484f5a;

    /* Gold */
    --gold:         #c8a03c;
    --gold-l:       #e8c060;
    --gold-d:       #8a6a20;
    --gold-bg:      rgba(200,160,60,0.08);
    --gold-bg2:     rgba(200,160,60,0.14);

    /* Text */
    --text:         #c2cad4;
    --text-s:       #8a95a3;
    --text-m:       #565e6a;
    --text-w:       #e8edf2;

    /* Semantic */
    --red:          #c0392b;
    --red-l:        #e05252;
    --blue:         #3a7bd5;
    --blue-l:       #5d9df5;
    --green:        #27ae60;
    --green-l:      #2ecc71;
    --orange:       #d35400;
    --purple:       #7d5cb8;

    /* Typography */
    --font-ui:      'Nunito', system-ui, sans-serif;
    --font-title:   'Playfair Display', Georgia, serif;
    --font-mono:    'Consolas', monospace;

    /* Layout */
    --sidebar-w:    280px;
    --max-w:        1340px;
    --header-h:     52px;
    --catnav-h:     40px;

    /* Effects */
    --radius:       4px;
    --radius-lg:    6px;
    --shadow:       0 2px 8px rgba(0,0,0,0.5);
    --shadow-lg:    0 4px 20px rgba(0,0,0,0.6);
    --transition:   all 0.18s ease;
}

/* === Reset === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 14px; overflow-x: hidden; }
body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-ui);
    font-size: 1rem;
    line-height: 1.65;
    min-height: 100vh;
    overflow-x: hidden;
}
a { color: var(--gold-l); text-decoration: none; transition: var(--transition); }
a:hover { color: #fff; text-decoration: none; }
img { max-width: 100%; height: auto; }
ul { list-style: none; }

/* ============================================================
   TOP NAVIGATION
   ============================================================ */
#site-header {
    background: #0f1114;
    border-bottom: 2px solid var(--gold);
    position: sticky;
    top: 0;
    z-index: 200;
    height: var(--header-h);
}
.header-inner {
    display: flex;
    align-items: center;
    gap: 0;
    padding: 0 20px;
    max-width: var(--max-w);
    margin: 0 auto;
    height: 100%;
}

/* Logo */
.site-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    padding-right: 20px;
    border-right: 1px solid var(--bdr);
    flex-shrink: 0;
}
.site-logo:hover { text-decoration: none; }
.logo-icon {
    font-size: 20px;
    line-height: 1;
}
.logo-text {
    font-family: var(--font-title);
    font-size: 1.25rem;
    color: var(--gold-l);
    line-height: 1;
}
.logo-sub { display: none; }

/* Header nav links */
.header-nav {
    display: flex;
    align-items: center;
    height: 100%;
    flex: 1;
    gap: 0;
    margin-left: 4px;
}
.header-nav a {
    display: flex;
    align-items: center;
    height: 100%;
    padding: 0 14px;
    color: var(--text-s);
    font-size: 13px;
    font-weight: 700;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    text-decoration: none;
    transition: var(--transition);
    white-space: nowrap;
}
.header-nav a:hover { color: var(--text-w); text-decoration: none; }
.header-nav a.active { color: var(--gold-l); border-bottom-color: var(--gold); }

/* Search */
.header-search {
    display: flex;
    background: var(--bg3);
    border: 1px solid var(--bdr2);
    border-radius: var(--radius);
    overflow: hidden;
    margin-left: 12px;
    flex-shrink: 0;
}
.search-form { display: flex; }
.search-form input {
    background: transparent;
    border: none;
    color: var(--text-w);
    padding: 7px 13px;
    font-family: var(--font-ui);
    font-size: 13px;
    outline: none;
    width: 220px;
}
.search-form input::placeholder { color: var(--text-m); }
.search-form button {
    background: var(--gold);
    border: none;
    color: #111;
    padding: 7px 13px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    transition: var(--transition);
    flex-shrink: 0;
}
.search-form button:hover { background: var(--gold-l); }

/* Auth buttons */
.header-auth {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 12px;
    flex-shrink: 0;
}
.btn-login {
    background: transparent;
    border: 1px solid var(--bdr2);
    color: var(--text-s);
    padding: 5px 12px;
    border-radius: var(--radius);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    font-family: var(--font-ui);
    text-decoration: none;
    transition: var(--transition);
}
.btn-login:hover { color: var(--text-w); border-color: var(--bdr3); text-decoration: none; }
.btn-register {
    background: var(--gold);
    border: none;
    color: #0f1114;
    padding: 5px 12px;
    border-radius: var(--radius);
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    font-family: var(--font-ui);
    text-decoration: none;
    transition: var(--transition);
}
.btn-register:hover { background: var(--gold-l); text-decoration: none; }

/* User dropdown */
.user-menu-wrap { position: relative; display: inline-block; }
.user-btn {
    background: var(--bg3);
    border: 1px solid var(--bdr2);
    color: var(--text-s);
    padding: 5px 12px;
    border-radius: var(--radius);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    font-family: var(--font-ui);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition);
}
.user-btn:hover { color: var(--text-w); background: var(--bg4); }
.user-points-badge {
    font-size: 10px;
    background: var(--gold-bg2);
    border: 1px solid rgba(200,160,60,0.25);
    color: var(--gold-l);
    padding: 1px 6px;
    border-radius: 10px;
    font-weight: 800;
}
#userDropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    background: var(--bg3);
    border: 1px solid var(--bdr2);
    border-radius: var(--radius-lg);
    min-width: 196px;
    z-index: 1000;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}
#userDropdown a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 14px;
    color: var(--text);
    font-size: 13px;
    font-weight: 600;
    border-bottom: 1px solid var(--bdr);
    transition: var(--transition);
    text-decoration: none;
}
#userDropdown a:last-child { border-bottom: none; }
#userDropdown a:hover { background: var(--bg4); color: var(--text-w); text-decoration: none; }

/* Hamburger */
#hamburger-btn {
    display: none;
    background: var(--bg3);
    border: 1px solid var(--bdr2);
    border-radius: var(--radius);
    padding: 7px 9px;
    cursor: pointer;
    flex-direction: column;
    gap: 4px;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    margin-left: 10px;
    flex-shrink: 0;
}
.ham-line {
    display: block;
    width: 18px;
    height: 2px;
    background: var(--text-s);
    border-radius: 2px;
    transition: 0.25s;
}

/* Mobile drawer */
#mobile-menu {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9998;
}
#mobile-drawer {
    position: absolute;
    top: 0; right: 0; bottom: 0;
    width: 280px;
    background: var(--bg2);
    border-left: 1px solid var(--bdr2);
    overflow-y: auto;
    transform: translateX(100%);
    transition: transform 0.28s ease;
    z-index: 9999;
}
.mobile-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--bdr);
    background: #0f1114;
}
.drawer-close {
    background: transparent;
    border: none;
    color: var(--text-m);
    font-size: 1.3rem;
    cursor: pointer;
    padding: 2px 6px;
    line-height: 1;
}
.mobile-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 16px;
    color: var(--text);
    font-size: 13px;
    font-weight: 600;
    border-bottom: 1px solid var(--bdr);
    transition: var(--transition);
    text-decoration: none;
}
.mobile-nav a:hover { background: var(--bg3); color: var(--text-w); text-decoration: none; }
.mobile-nav-section {
    padding: 10px 16px 3px;
    font-size: 10px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--text-m);
    font-weight: 800;
    margin-top: 6px;
}
.mobile-auth { padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; }
.mobile-auth a { display: block; text-align: center; padding: 10px; font-size: 13px; }
.mobile-menu-open #mobile-drawer { transform: translateX(0) !important; }

@media (max-width: 960px) {
    #hamburger-btn { display: inline-flex !important; }
    #desktop-nav { display: none !important; }
    .header-search { display: none; }
    .header-auth { display: none; }
}
@media (max-width: 480px) {
    .logo-text { font-size: 1.05rem; }
    .header-inner { padding: 0 14px; }
}

/* ============================================================
   STATS + TICKER BAR
   ============================================================ */
#stats-ticker-bar {
    background: #0f1114;
    border-bottom: 1px solid var(--bdr);
    padding: 0 20px;
}
.stats-ticker-inner {
    max-width: var(--max-w);
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 0;
    min-height: 34px;
}
.stats-group {
    display: flex;
    align-items: center;
    gap: 16px;
    padding-right: 16px;
    border-right: 1px solid var(--bdr);
    flex-shrink: 0;
}
.stat-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    color: var(--text-m);
    font-weight: 600;
    white-space: nowrap;
}
.stat-item strong { color: var(--gold-l); font-size: 12px; font-weight: 800; }

.ticker-lbl {
    background: var(--gold);
    color: #111;
    padding: 4px 10px;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    flex-shrink: 0;
    margin-left: 16px;
    border-radius: 2px;
}
.ticker-items {
    display: flex;
    flex: 1;
    overflow: hidden;
    margin-left: 10px;
    gap: 0;
}
.ticker-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-s);
    white-space: nowrap;
    padding-right: 20px;
}
.ticker-item::before { content: '·'; color: var(--text-m); margin-right: 14px; }
.ticker-item:first-child::before { display: none; margin: 0; }
.ticker-date { color: var(--text-m); font-size: 10px; font-weight: 700; }
.ticker-item strong { color: var(--text); font-weight: 600; }

@media (max-width: 760px) {
    .ticker-items { display: none; }
    .ticker-lbl { display: none; }
}


/* ============================================================
   CATEGORY NAV
   ============================================================ */
#category-nav {
    background: var(--bg2);
    border-bottom: 1px solid var(--bdr);
    padding: 0 20px;
    position: sticky;
    top: var(--header-h);
    z-index: 100;
}
.category-nav-inner {
    max-width: var(--max-w);
    margin: 0 auto;
    display: flex;
    overflow-x: auto;
    scrollbar-width: none;
}
.category-nav-inner::-webkit-scrollbar { display: none; }
.cat-nav-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 16px;
    height: var(--catnav-h);
    color: var(--text-m);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    text-decoration: none;
    transition: var(--transition);
    white-space: nowrap;
    flex-shrink: 0;
}
.cat-nav-item:hover,
.cat-nav-item.active {
    color: var(--gold-l);
    border-bottom-color: var(--gold);
    text-decoration: none;
}
.cat-nav-item .cat-icon { font-size: 14px; }


/* ============================================================
   PAGE WRAPPER & 2-COLUMN LAYOUT
   ============================================================ */
#main-content {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 18px 20px;
}

/* 2-col: main | sidebar */
.content-grid {
    display: grid;
    grid-template-columns: 1fr var(--sidebar-w);
    gap: 18px;
    align-items: start;
}
.main-col { min-width: 0; }
.sidebar  { min-width: 0; }

/* Sticky sidebar */
.sidebar {
    position: sticky;
    top: calc(var(--header-h) + var(--catnav-h) + 12px);
    max-height: calc(100vh - var(--header-h) - var(--catnav-h) - 24px);
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: var(--bdr2) transparent;
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--bdr2); border-radius: 4px; }

@media (max-width: 1000px) {
    .content-grid { grid-template-columns: 1fr; }
    .sidebar {
        position: static;
        max-height: none;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }
    .sidebar-widget { margin-bottom: 0 !important; }
}
@media (max-width: 600px) {
    .sidebar { grid-template-columns: 1fr; }
    #main-content { padding: 12px 14px; }
}


/* ============================================================
   SIDEBAR WIDGETS
   ============================================================ */
.sidebar-widget {
    background: var(--bg2);
    border: 1px solid var(--bdr);
    border-radius: var(--radius);
    margin-bottom: 14px;
    overflow: hidden;
}
.widget-title {
    background: var(--bg3);
    border-bottom: 1px solid var(--bdr);
    padding: 8px 12px;
    font-size: 11px;
    font-weight: 800;
    color: var(--gold);
    display: flex;
    align-items: center;
    gap: 6px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}
.widget-body { padding: 0; }
.widget-body ul li {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 7px 12px;
    border-bottom: 1px solid rgba(46,51,59,0.7);
    font-size: 13px;
    transition: var(--transition);
}
.widget-body ul li:last-child { border-bottom: none; }
.widget-body ul li:hover { background: rgba(255,255,255,0.02); }
.widget-body ul li a { color: var(--text); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.widget-body ul li a:hover { color: var(--gold-l); }
.widget-num {
    font-size: 11px;
    color: var(--text-m);
    margin-left: auto;
    flex-shrink: 0;
    font-weight: 600;
}
.widget-rank {
    font-size: 11px;
    color: var(--text-m);
    min-width: 20px;
    font-weight: 700;
    flex-shrink: 0;
}


/* ============================================================
   PANELS
   ============================================================ */
.panel {
    background: var(--bg2);
    border: 1px solid var(--bdr);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 16px;
}
.panel:last-child { margin-bottom: 0; }
.panel-header {
    background: var(--bg3);
    border-bottom: 1px solid var(--bdr);
    padding: 10px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.panel-title {
    font-size: 13px;
    font-weight: 800;
    color: var(--text-w);
    display: flex;
    align-items: center;
    gap: 7px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}
.panel-body { padding: 14px; }


/* ============================================================
   HERO
   ============================================================ */
.wiki-hero {
    background: linear-gradient(135deg, #0f1114 0%, #1a1d24 60%, #1e2128 100%);
    border: 1px solid var(--bdr2);
    border-top: 2px solid var(--gold);
    border-radius: var(--radius);
    padding: 30px 28px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}
.wiki-hero-left { flex: 1; min-width: 0; }
.wiki-hero h1 {
    font-family: var(--font-title);
    font-size: 1.7rem;
    color: var(--text-w);
    line-height: 1.2;
    margin-bottom: 6px;
}
.wiki-hero h1 span { color: var(--gold-l); }
.wiki-hero p {
    color: var(--text-s);
    font-size: 13px;
    line-height: 1.6;
    max-width: 480px;
}
.wiki-stats {
    display: flex;
    gap: 24px;
    margin-top: 18px;
    flex-wrap: wrap;
}
.wiki-stat {
    text-align: center;
    background: var(--bg3);
    border: 1px solid var(--bdr2);
    border-radius: var(--radius);
    padding: 10px 18px;
    min-width: 90px;
}
.wiki-stat .num {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--gold-l);
    display: block;
    line-height: 1;
}
.wiki-stat .label {
    font-size: 10px;
    color: var(--text-m);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 700;
    margin-top: 3px;
    display: block;
}
.wiki-hero-icon {
    font-size: 4rem;
    flex-shrink: 0;
    opacity: 0.7;
}

@media (max-width: 600px) {
    .wiki-hero { flex-direction: column; padding: 20px 16px; }
    .wiki-hero-icon { display: none; }
    .wiki-hero h1 { font-size: 1.3rem; }
    .wiki-stats { gap: 10px; }
}


/* ============================================================
   NEWS TICKER (page-level)
   ============================================================ */
.news-ticker-wrap {
    background: var(--bg2);
    border: 1px solid var(--bdr);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 16px;
}
.news-ticker-header {
    background: var(--bg3);
    padding: 7px 14px;
    font-size: 11px;
    font-weight: 800;
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid var(--bdr);
    display: flex;
    align-items: center;
    gap: 6px;
}
.news-ticker-item {
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding: 7px 14px;
    border-bottom: 1px solid var(--bdr);
    font-size: 12px;
    color: var(--text-s);
    transition: var(--transition);
}
.news-ticker-item:last-child { border-bottom: none; }
.news-ticker-item:hover { background: rgba(255,255,255,0.02); }
.news-ticker-icon { width: 15px; height: 15px; object-fit: contain; flex-shrink: 0; image-rendering: pixelated; }
.news-ticker-icon-default { font-size: 12px; flex-shrink: 0; }
.news-ticker-date { color: var(--text-m); font-size: 10px; font-weight: 700; white-space: nowrap; flex-shrink: 0; }
.news-ticker-text { color: var(--text); }
.news-ticker-text a { color: var(--gold-l); }
.news-ticker-text a:hover { color: #fff; }


/* ============================================================
   CATEGORY CARDS GRID
   ============================================================ */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 16px;
}
.category-card {
    background: var(--bg2);
    border: 1px solid var(--bdr);
    border-radius: var(--radius);
    padding: 14px 12px;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: var(--transition);
    border-left: 3px solid var(--cat-color, var(--bdr2));
}
.category-card:hover {
    background: var(--bg3);
    border-color: var(--bdr2);
    border-left-color: var(--cat-color, var(--gold));
    text-decoration: none;
}
.cat-icon-big { font-size: 1.6rem; flex-shrink: 0; }
.cat-name {
    font-size: 13px;
    font-weight: 800;
    color: var(--text-w);
    line-height: 1.2;
}
.cat-count { font-size: 11px; color: var(--text-m); font-weight: 600; margin-top: 1px; }

/* Kategorie — fix mobile */
.category-card {
    min-width: 0;
    overflow: hidden;
}
.category-card > div {
    min-width: 0;
}

@media (max-width: 900px) { .categories-grid { grid-template-columns: repeat(2, 1fr); } }

@media (max-width: 600px) {
    .categories-grid {
        grid-template-columns: 1fr !important;
    }
    .category-card {
        padding: 10px 12px;
    }
    .cat-icon-big img {
        width: 36px !important;
        height: 36px !important;
    }
    /* Ukryj opis i liczbę artykułów na mobile */
    .cat-description-mobile,
    .cat-count {
        display: none !important;
    }
    .cat-name { font-size: 14px; }
}


/* ============================================================
   ARTICLE CARDS GRID
   ============================================================ */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}
.article-card {
    background: var(--bg3);
    border: 1px solid var(--bdr);
    border-radius: var(--radius);
    overflow: hidden;
    text-decoration: none;
    display: block;
    transition: var(--transition);
}
.article-card:hover {
    background: var(--bg4);
    border-color: var(--bdr2);
    text-decoration: none;
}
.article-card-img {
    height: 90px;
    background: var(--bg4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    border-bottom: 1px solid var(--bdr);
    overflow: hidden;
}
.article-card-img img { width: 100%; height: 100%; object-fit: cover; }
.article-card-body { padding: 10px 12px; }
.article-card-cat {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--gold-d);
    margin-bottom: 3px;
}
.article-card-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-w);
    line-height: 1.3;
}
.article-card-excerpt { font-size: 12px; color: var(--text-s); margin-top: 3px; line-height: 1.4; }

@media (max-width: 480px) { .articles-grid { grid-template-columns: 1fr; } }


/* ============================================================
   ARTICLE LIST
   ============================================================ */
.articles-list {}
.article-list-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--bdr);
    text-decoration: none;
    transition: var(--transition);
}
.article-list-item:last-child { border-bottom: none; }
.article-list-item:hover { background: rgba(255,255,255,0.02); text-decoration: none; }
.article-list-thumb {
    width: 52px;
    height: 52px;
    background: var(--bg4);
    border: 1px solid var(--bdr);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    flex-shrink: 0;
    overflow: hidden;
}
.article-list-thumb img { width: 100%; height: 100%; object-fit: cover; }
.article-list-info { flex: 1; min-width: 0; }
.article-list-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--gold-l);
    display: block;
    margin-bottom: 2px;
    line-height: 1.3;
}
.article-list-title:hover { color: #fff; }
.article-list-excerpt { font-size: 12px; color: var(--text-s); line-height: 1.4; }
.article-list-meta {
    font-size: 11px;
    color: var(--text-m);
    margin-top: 4px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    font-weight: 600;
}


/* ============================================================
   ARTICLE PAGE CONTENT
   ============================================================ */
.article-breadcrumb {
    font-size: 12px;
    color: var(--text-m);
    margin-bottom: 12px;
    font-weight: 600;
}
.article-breadcrumb a { color: var(--text-s); }
.article-breadcrumb a:hover { color: var(--gold-l); }

.article-header {
    border-bottom: 1px solid var(--bdr);
    padding-bottom: 16px;
    margin-bottom: 20px;
}
.article-title {
    font-family: var(--font-title);
    font-size: 1.9rem;
    color: var(--text-w);
    line-height: 1.2;
    margin-bottom: 8px;
}
.article-meta {
    font-size: 12px;
    color: var(--text-m);
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    font-weight: 600;
    align-items: center;
}
.article-meta span { display: flex; align-items: center; gap: 4px; }
.article-meta a { color: var(--gold-d); }
.article-meta a:hover { color: var(--gold-l); }

/* Article typography */
.article-content {
    font-size: 14px;
    line-height: 1.8;
    color: var(--text);
}
.article-content h2 {
    font-family: var(--font-title);
    font-size: 1.2rem;
    color: var(--text-w);
    border-bottom: 1px solid var(--bdr);
    padding-bottom: 5px;
    margin: 22px 0 12px;
}
.article-content h3 {
    font-size: 1rem;
    font-weight: 800;
    color: var(--text-w);
    margin: 16px 0 8px;
}
.article-content p { margin-bottom: 12px; }
.article-content ul, .article-content ol { padding-left: 20px; margin-bottom: 12px; }
.article-content ul { list-style: disc; }
.article-content ol { list-style: decimal; }
.article-content li { margin-bottom: 4px; }
.article-content table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 16px;
    font-size: 13px;
}
.article-content table th {
    background: var(--bg3);
    border: 1px solid var(--bdr);
    padding: 7px 10px;
    color: var(--gold);
    font-weight: 800;
    font-size: 12px;
    text-align: left;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.article-content table td {
    border: 1px solid var(--bdr);
    padding: 7px 10px;
    color: var(--text);
}
.article-content table tr:nth-child(even) td { background: rgba(255,255,255,0.015); }
.article-content blockquote {
    border-left: 3px solid var(--gold-d);
    background: var(--gold-bg);
    padding: 10px 16px;
    margin: 14px 0;
    font-style: italic;
    color: var(--text-s);
    border-radius: 0 var(--radius) var(--radius) 0;
}

/* Infobox */
.infobox {
    float: right;
    background: var(--bg3);
    border: 1px solid var(--bdr2);
    border-radius: var(--radius);
    margin: 0 0 16px 20px;
    min-width: 230px;
    max-width: 270px;
    overflow: hidden;
    box-shadow: var(--shadow);
}
.infobox-title {
    background: var(--bg4);
    text-align: center;
    padding: 8px 12px;
    font-weight: 800;
    font-size: 12px;
    color: var(--gold);
    border-bottom: 1px solid var(--bdr2);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.infobox-image {
    text-align: center;
    padding: 12px;
    border-bottom: 1px solid var(--bdr);
    background: var(--bg);
}
.infobox-image img { max-height: 130px; object-fit: contain; }
.infobox table { width: 100%; font-size: 12px; }
.infobox table td {
    padding: 5px 10px;
    border-bottom: 1px solid rgba(46,51,59,0.7);
    vertical-align: top;
}
.infobox table td:first-child {
    color: var(--text-m);
    font-weight: 700;
    width: 40%;
    text-transform: uppercase;
    font-size: 10px;
    letter-spacing: 0.3px;
}
.infobox table td:last-child { color: var(--text); }

@media (max-width: 700px) {
    .infobox { float: none; max-width: 100%; margin: 0 0 16px 0; }
}


/* ============================================================
   SEARCH
   ============================================================ */
.search-results-header {
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--bdr);
}
.search-results-header h2 {
    font-family: var(--font-title);
    color: var(--text-w);
    font-size: 1.4rem;
}
.search-highlight {
    background: rgba(200,160,60,0.2);
    color: var(--gold-l);
    padding: 0 2px;
    border-radius: 2px;
}


/* ============================================================
   PAGINATION
   ============================================================ */
.pagination {
    display: flex;
    justify-content: center;
    gap: 4px;
    margin-top: 20px;
    flex-wrap: wrap;
}
.pagination a, .pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 8px;
    background: var(--bg3);
    border: 1px solid var(--bdr);
    border-radius: var(--radius);
    color: var(--text-s);
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    transition: var(--transition);
}
.pagination a:hover { border-color: var(--bdr2); color: var(--text-w); text-decoration: none; }
.pagination .current {
    background: var(--gold);
    border-color: var(--gold);
    color: #0f1114;
    font-weight: 800;
}


/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: var(--radius);
    font-family: var(--font-ui);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    border: none;
    transition: var(--transition);
    text-decoration: none;
}
.btn-gold {
    background: var(--gold);
    color: #0f1114;
    border: 1px solid var(--gold);
}
.btn-gold:hover { background: var(--gold-l); color: #0f1114; text-decoration: none; }
.btn-outline {
    background: transparent;
    color: var(--text-s);
    border: 1px solid var(--bdr2);
}
.btn-outline:hover { border-color: var(--bdr3); color: var(--text-w); text-decoration: none; }
.btn-sm { padding: 4px 10px; font-size: 11px; }


/* ============================================================
   ALERTS / BADGES
   ============================================================ */
.alert {
    padding: 10px 14px;
    border-radius: var(--radius);
    margin-bottom: 14px;
    font-size: 13px;
    font-weight: 600;
}
.alert-success { background: rgba(39,174,96,0.1); border: 1px solid rgba(39,174,96,0.3); color: var(--green-l); }
.alert-error   { background: rgba(192,57,43,0.1); border: 1px solid rgba(192,57,43,0.3); color: var(--red-l); }
.alert-info    { background: rgba(58,123,213,0.1); border: 1px solid rgba(58,123,213,0.3); color: var(--blue-l); }

.badge {
    display: inline-block;
    padding: 2px 7px;
    border-radius: 2px;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.badge-gold   { background: var(--gold-bg2); color: var(--gold-l); border: 1px solid rgba(200,160,60,0.3); }
.badge-red    { background: rgba(192,57,43,0.15); color: var(--red-l); border: 1px solid rgba(192,57,43,0.3); }
.badge-green  { background: rgba(39,174,96,0.15); color: var(--green-l); border: 1px solid rgba(39,174,96,0.3); }


/* ============================================================
   CATEGORY TAGS (article list)
   ============================================================ */
.cat-tag {
    display: inline-block;
    padding: 2px 7px;
    border-radius: 2px;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.cat-tag-creatures { background: rgba(192,57,43,0.2); color: #e05252; }
.cat-tag-items     { background: rgba(200,160,60,0.2); color: var(--gold-l); }
.cat-tag-quests    { background: rgba(58,123,213,0.2); color: var(--blue-l); }
.cat-tag-locations { background: rgba(39,174,96,0.2); color: var(--green-l); }
.cat-tag-npcs      { background: rgba(125,92,184,0.2); color: #a98de0; }
.cat-tag-vocations { background: rgba(211,84,0,0.2); color: #e67e22; }
.cat-tag-default   { background: rgba(138,149,163,0.15); color: var(--text-s); }


/* ============================================================
   FORMS
   ============================================================ */
.form-group { margin-bottom: 16px; }
.form-label {
    display: block;
    margin-bottom: 5px;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-m);
}
.form-control {
    width: 100%;
    background: var(--bg);
    border: 1px solid var(--bdr2);
    color: var(--text-w);
    padding: 8px 12px;
    font-family: var(--font-ui);
    font-size: 13px;
    border-radius: var(--radius);
    outline: none;
    transition: var(--transition);
}
.form-control:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 2px rgba(200,160,60,0.1);
}
.form-control::placeholder { color: var(--text-m); }
textarea.form-control { min-height: 160px; resize: vertical; line-height: 1.6; }
select.form-control option { background: var(--bg2); }


/* ============================================================
   FOOTER
   ============================================================ */
#site-footer {
    background: #0f1114;
    border-top: 1px solid var(--bdr);
    margin-top: 50px;
    padding: 36px 20px 18px;
}
.footer-inner { max-width: var(--max-w); margin: 0 auto; }
.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 28px;
    margin-bottom: 24px;
}
.footer-col h4 {
    font-size: 11px;
    font-weight: 800;
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
}
.footer-col p { font-size: 12px; color: var(--text-m); line-height: 1.65; }
.footer-col ul li { margin-bottom: 5px; }
.footer-col ul li a { color: var(--text-m); font-size: 12px; font-weight: 600; }
.footer-col ul li a:hover { color: var(--gold-l); }
.footer-bottom {
    border-top: 1px solid var(--bdr);
    padding-top: 14px;
    text-align: center;
    font-size: 11px;
    color: var(--text-m);
    font-weight: 600;
}
.footer-bottom a { color: var(--text-m); }
.footer-bottom a:hover { color: var(--gold-l); }

@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .footer-grid { grid-template-columns: 1fr; } }


/* ============================================================
   ADMIN PANEL
   ============================================================ */
.admin-layout { display: flex; min-height: 100vh; }
.admin-sidebar {
    width: 230px;
    background: #0f1114;
    border-right: 1px solid var(--bdr);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
}
.admin-sidebar-header { padding: 18px 16px; border-bottom: 1px solid var(--bdr); }
.admin-sidebar-header h2 { font-size: 14px; font-weight: 800; color: var(--gold); }
.admin-sidebar-header p { font-size: 11px; color: var(--text-m); margin-top: 2px; font-weight: 600; }
.admin-nav a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    color: var(--text-m);
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    border-left: 3px solid transparent;
    transition: var(--transition);
}
.admin-nav a:hover, .admin-nav a.active {
    background: var(--bg2);
    color: var(--gold-l);
    border-left-color: var(--gold);
    text-decoration: none;
}
.admin-nav .nav-section {
    padding: 10px 16px 3px;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-m);
    font-weight: 800;
    margin-top: 4px;
}
.admin-main { flex: 1; overflow: auto; }
.admin-topbar {
    background: #0f1114;
    border-bottom: 1px solid var(--bdr);
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.admin-topbar h1 { font-size: 1.2rem; font-weight: 800; color: var(--text-w); }
.admin-content { padding: 20px; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.admin-table th {
    background: var(--bg3);
    border: 1px solid var(--bdr);
    padding: 8px 12px;
    color: var(--gold);
    text-align: left;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.admin-table td { border: 1px solid var(--bdr); padding: 8px 12px; color: var(--text); vertical-align: middle; }
.admin-table tr:hover td { background: rgba(255,255,255,0.02); }

@media (max-width: 768px) {
    .admin-layout { flex-direction: column; }
    .admin-sidebar { width: 100%; }
}


/* ============================================================
   ITEM / NPC / CREATURE VIEW
   ============================================================ */
.item-layout { display: flex; gap: 20px; align-items: flex-start; }
@media (max-width: 860px) {
    .item-layout { flex-direction: column !important; }
    .item-layout > * { width: 100% !important; }
    .item-npc-grid { grid-template-columns: 1fr !important; }
}


/* ============================================================
   UTILS
   ============================================================ */
.wrapper { max-width: var(--max-w); margin: 0 auto; padding: 0 20px; }

/* Scrollbars global */
::-webkit-scrollbar { width: 7px; height: 7px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--bdr2); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--bdr3); }

/* Fade in */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}
.fade-up { animation: fadeUp 0.3s ease forwards; }

/* Override stare zmienne złota - kompatybilność z resztą PHP */
:root {
    --gold-light:  var(--gold-l);
    --gold-dim:    var(--gold-d);
    --border-gold: var(--gold);
    --border:      var(--bdr);
    --border-light:var(--bdr2);
    --bg-panel:    var(--bg2);
    --bg-card:     var(--bg3);
    --bg-card-hover: var(--bg4);
    --bg-dark:     var(--bg);
    --bg-main:     var(--bg2);
    --text-main:   var(--text);
    --text-light:  var(--text-w);
    --text-muted:  var(--text-m);
    --text-white:  var(--text-w);
    --font-body:   var(--font-ui);
    --red-light:   var(--red-l);
    --blue:        #3a7bd5;
    --green:       #27ae60;
    --purple:      #7d5cb8;
    --orange:      #d35400;
    --radius: 4px;
    --shadow: 0 2px 8px rgba(0,0,0,0.5);
    --shadow-gold: 0 0 20px rgba(200,160,60,0.1);
    --transition: all 0.18s ease;
}

/* ============================================================
   v3 ADDITIONS
   ============================================================ */

/* --- Usuń stary stats-ticker-bar (kompatybilność) --- */
#stats-ticker-bar { display: none !important; }

/* --- News Ticker Bar --- */
#news-ticker-bar {
    background: #0f1114;
    border-bottom: 1px solid var(--bdr);
    padding: 0 20px;
    overflow: hidden;
}
.news-ticker-bar-inner {
    max-width: var(--max-w);
    margin: 0 auto;
    display: flex;
    align-items: stretch;
    min-height: 34px;
}
.ticker-bar-lbl {
    background: var(--gold);
    color: #111;
    padding: 0 12px;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    display: flex;
    align-items: center;
    flex-shrink: 0;
    margin-right: 0;
}
.ticker-bar-items {
    display: flex;
    flex: 1;
    overflow: hidden;
    gap: 0;
}
.ticker-bar-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 16px;
    background: transparent;
    border: none;
    border-left: 1px solid var(--bdr);
    color: var(--text-s);
    font-family: var(--font-ui);
    font-size: 12px;
    cursor: pointer;
    text-align: left;
    min-width: 0;
    flex: 1;
    max-width: 380px;
    transition: var(--transition);
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.ticker-bar-item:first-child { border-left: none; }
.ticker-bar-item:hover { background: rgba(255,255,255,0.04); color: var(--text-w); }
.ticker-bar-date {
    color: var(--gold);
    font-weight: 700;
    font-size: 10px;
    flex-shrink: 0;
}
.ticker-bar-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 900px) {
    .ticker-bar-items { overflow-x: auto; scrollbar-width: none; }
    .ticker-bar-items::-webkit-scrollbar { display: none; }
    .ticker-bar-item { flex-shrink: 0; max-width: 260px; }
}
@media (max-width: 540px) {
    .ticker-bar-item:not(:first-child) { display: none; }
    .ticker-bar-item { max-width: none; flex: 1; }
}

/* --- News Modal --- */
#news-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.news-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.75);
    cursor: pointer;
}
.news-modal-box {
    position: relative;
    background: var(--bg2);
    border: 1px solid var(--bdr2);
    border-top: 2px solid var(--gold);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 600px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
    z-index: 1;
}
.news-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid var(--bdr);
    background: var(--bg3);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    flex-shrink: 0;
}
.news-modal-title {
    font-size: 14px;
    font-weight: 800;
    color: var(--gold-l);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.news-modal-close {
    background: transparent;
    border: none;
    color: var(--text-m);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 2px 6px;
    line-height: 1;
    border-radius: var(--radius);
    transition: var(--transition);
}
.news-modal-close:hover { color: var(--text-w); background: var(--bg4); }
.news-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}
.news-modal-tabs {
    display: flex;
    border-bottom: 1px solid var(--bdr);
    background: var(--bg3);
    padding: 0 16px;
    flex-wrap: wrap;
}
.news-modal-tab {
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-m);
    font-family: var(--font-ui);
    font-size: 12px;
    font-weight: 700;
    padding: 8px 14px;
    cursor: pointer;
    margin-bottom: -1px;
    transition: var(--transition);
}
.news-modal-tab:hover { color: var(--text); }
.news-modal-tab.active { color: var(--gold-l); border-bottom-color: var(--gold); }
.news-modal-content { display: none; padding: 20px 20px; }
.news-modal-content.active { display: block; }
.news-modal-meta {
    font-size: 11px;
    color: var(--text-m);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 14px;
}
.news-modal-text {
    font-size: 14px;
    color: var(--text);
    line-height: 1.8;
    white-space: pre-wrap;
}

/* --- Sidebar — NIE sticky, normalna pozycja --- */
.sidebar {
    position: static !important;
    max-height: none !important;
    overflow: visible !important;
}

/* --- Live Search Dropdown --- */
#header-search-wrap {
    position: relative;
}
.search-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: var(--bg2);
    border: 1px solid var(--bdr2);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    z-index: 9990;
    max-height: 420px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--bdr2) transparent;
    min-width: 320px;
}
.search-result-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-bottom: 1px solid var(--bdr);
    text-decoration: none;
    transition: var(--transition);
    color: var(--text);
}
.search-result-item:last-of-type { border-bottom: none; }
.search-result-item:hover,
.search-result-item:focus {
    background: var(--bg3);
    outline: none;
    text-decoration: none;
    color: var(--text-w);
}
.search-result-thumb {
    width: 42px;
    height: 42px;
    object-fit: cover;
    border-radius: var(--radius);
    border: 1px solid var(--bdr);
    flex-shrink: 0;
    background: var(--bg4);
    image-rendering: pixelated;
}
.search-result-thumb-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    background: var(--bg4);
}
.search-result-info { flex: 1; min-width: 0; }
.search-result-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-w);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}
.search-result-title mark {
    background: rgba(200,160,60,0.25);
    color: var(--gold-l);
    border-radius: 2px;
    padding: 0 1px;
}
.search-result-meta {
    display: flex;
    gap: 8px;
    align-items: center;
}
.search-result-cat {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gold-d);
    background: var(--gold-bg);
    padding: 1px 5px;
    border-radius: 2px;
}
.search-result-views {
    font-size: 11px;
    color: var(--text-m);
}
.search-no-results {
    padding: 16px 14px;
    font-size: 13px;
    color: var(--text-m);
    text-align: center;
}
.search-show-all {
    display: block;
    padding: 10px 14px;
    text-align: center;
    font-size: 12px;
    font-weight: 700;
    color: var(--gold);
    background: var(--bg3);
    border-top: 1px solid var(--bdr);
    text-decoration: none;
    transition: var(--transition);
}
.search-show-all:hover { color: var(--gold-l); background: var(--bg4); text-decoration: none; }


/* ═══════════════════════════════════════════════════════════
   RESPONSYWNOŚĆ FORMULARZY EDYCJI — mobile fix
   ═══════════════════════════════════════════════════════════ */

/* Główny layout formularza (lewy panel + prawy sidebar 320px) */
@media (max-width: 768px) {

    /* Główna siatka formularza: 1fr 320px → 1 kolumna */
    [style*="grid-template-columns:1fr 320px"],
    [style*="grid-template-columns: 1fr 320px"] {
        grid-template-columns: 1fr !important;
    }

    /* Siatki 2-kolumnowe → 1 kolumna */
    [style*="grid-template-columns:1fr 1fr"],
    [style*="grid-template-columns: 1fr 1fr"] {
        grid-template-columns: 1fr !important;
    }

    /* Siatki 3-kolumnowe → 1 kolumna */
    [style*="grid-template-columns:1fr 1fr 1fr"],
    [style*="grid-template-columns: 1fr 1fr 1fr"] {
        grid-template-columns: 1fr !important;
    }

    /* Wiersze NPC (1fr 100px 1fr 40px) → 2 kolumny */
    .npc-row[style*="grid-template-columns"] {
        grid-template-columns: 1fr 40px !important;
        row-gap: 6px !important;
    }
    .npc-row[style*="grid-template-columns"] > *:nth-child(2) {
        grid-column: 1;
    }
    .npc-row[style*="grid-template-columns"] > *:nth-child(3) {
        grid-column: 1;
    }
    .npc-row[style*="grid-template-columns"] > *:nth-child(4) {
        grid-column: 2;
        grid-row: 1;
        align-self: start;
    }

    /* Wiersze biegłości (80px 1fr 1fr 40px) → uproszczone */
    .prof-row[style*="grid-template-columns"] {
        grid-template-columns: 80px 1fr 40px !important;
    }
    .prof-row[style*="grid-template-columns"] > *:nth-child(3) {
        grid-column: 1 / 3;
    }

    /* Infobox wiersze */
    .ib-row[style*="display:flex"],
    .ib-row[style*="display: flex"] {
        flex-wrap: wrap !important;
    }
    .ib-row .form-control {
        flex: 1 1 100% !important;
        min-width: 0 !important;
    }

    /* Formularz edycji — panel treści i sidebar */
    #main-content .panel {
        margin-bottom: 12px !important;
    }

    /* Sticky sidebar wyłączony na mobile */
    .sidebar,
    [style*="position:sticky"],
    [style*="position: sticky"] {
        position: relative !important;
        top: auto !important;
    }

    /* Przyciski toolbara CKEditor — mniejsze */
    .ck-toolbar {
        flex-wrap: wrap !important;
    }

    /* Przyciski akcji w nagłówku (flex row) */
    [style*="display:flex"][style*="justify-content:space-between"] {
        flex-wrap: wrap !important;
        gap: 8px !important;
    }

    /* Formularz nagłówek z breadcrumb */
    .page-header-inner,
    [style*="display:flex;align-items:center;justify-content:space-between"] {
        flex-wrap: wrap !important;
        gap: 8px !important;
    }

    /* Textarea i input — pełna szerokość */
    textarea.form-control {
        min-height: 120px !important;
    }

    /* Obrazek preview w sidebarze */
    [style*="max-width:100%;border-radius"] img {
        max-width: 100% !important;
    }
}

/* Małe telefony */
@media (max-width: 480px) {

    /* Padding strony */
    #main-content {
        padding: 8px 10px !important;
    }

    .panel-header {
        flex-wrap: wrap !important;
        gap: 6px !important;
    }

    .panel-body {
        padding: 10px !important;
    }

    /* Przyciski */
    .btn {
        padding: 8px 12px !important;
        font-size: 13px !important;
    }

    /* Hero na stronie głównej */
    .wiki-hero {
        flex-direction: column !important;
        padding: 16px !important;
    }

    .wiki-stats {
        gap: 10px !important;
        justify-content: center !important;
    }

    .wiki-stat {
        padding: 8px 14px !important;
        min-width: 80px !important;
    }

    .wiki-completeness {
        flex-wrap: wrap !important;
        gap: 6px !important;
    }

    .wiki-completeness__bar {
        flex: 1 1 100% !important;
        order: 3 !important;
    }
}

/* Podkategorie — domyślnie 3 kolumny */
.categories-grid--sub {
    grid-template-columns: repeat(3, 1fr);
}
@media (max-width: 600px) {
    .categories-grid--sub {
        grid-template-columns: 1fr !important;
    }
}