  :root {
    --bg: #0a0a0f;
    --surface: #111118;
    --surface2: #1a1a24;
    --border: #2a2a3a;
    --accent: #e63946;
    --text: #f0eff4;
    --text2: #9898b0;
    --card-bg: #13131e;
  }

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

  body {
    background: var(--bg);
    color: var(--text);
    font-family: 'DM Sans', sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
  }

  body::before {
    content: '';
    position: fixed; inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
    pointer-events: none; z-index: 9999; opacity: 0.4;
  }

  /* ── HEADER ── */
  header {
    position: sticky; top: 0; z-index: 200;
    background: rgba(10,10,15,0.96);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    padding-top: env(safe-area-inset-top, 0px);
  }
  .header-inner {
    max-width: 1220px; margin: 0 auto;
    padding: 0 2rem;
    display: flex; align-items: center; justify-content: space-between;
    height: 62px;
  }
  .logo {
    font-family: 'Inter', sans-serif;
    font-size: 1.55rem; font-weight: 900; letter-spacing: -0.02em;
    color: var(--text);
    display: flex; align-items: center; gap: 0.55rem; flex-shrink: 0;
  }
  .logo-dot {
    width: 8px; height: 8px; background: var(--accent);
    border-radius: 50%; flex-shrink: 0; animation: pulse 2s infinite;
  }
  @keyframes pulse {
    0%,100% { opacity:1; transform:scale(1); }
    50%      { opacity:.4; transform:scale(.75); }
  }
  .logo-slash { color: var(--accent); font-weight: 900; }
  .logo-text { letter-spacing: -0.02em; font-weight: 900; }
  .news-counter { font-size: 0.72rem; color: var(--text2); font-weight: 500; }

  /* ── FILTER BAR ── */
  .filter-bar {
    border-bottom: 1px solid var(--border);
    background: rgba(10,10,15,0.96);
    backdrop-filter: blur(20px);
  }
  .filter-bar-inner {
    max-width: 1220px; margin: 0 auto;
    padding: 0 2rem;
    display: flex; align-items: center; gap: 1rem;
    height: 50px;
  }
  .filter-toggle {
    display: flex; align-items: center; gap: 0.4rem;
    padding: 0.3rem 0.85rem;
    background: none;
    border: 1px solid var(--border); border-radius: 6px;
    color: var(--text2);
    font-family: inherit; font-size: 0.72rem; font-weight: 600;
    letter-spacing: 0.06em; text-transform: uppercase;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
    flex-shrink: 0;
  }
  .filter-toggle:hover, .filter-toggle.open {
    color: var(--text); border-color: rgba(230,57,70,0.5);
  }
  .filter-toggle svg { width: 13px; height: 13px; transition: transform 0.25s ease; }
  .filter-toggle.open svg { transform: rotate(180deg); }

  /* small info text next to button */
  .filter-info {
    font-size: 0.7rem; color: var(--text2); font-weight: 500;
  }
  .filter-info em { font-style: normal; color: var(--accent); font-weight: 700; }
  @media (max-width: 900px) {
    .filter-info { font-size: 0.65rem; line-height: 1.45; }
  }

  /* expanded panel – only rendered when open */
  .filter-panel {
    display: none;
    max-width: 1220px; margin: 0 auto;
    padding: 1.1rem 2rem 1.4rem;
    flex-wrap: wrap; gap: 0.5rem;
  }
  .filter-panel.open { display: flex; }

  /* filter sections */
  .filter-section {
    display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem;
    width: 100%;
  }
  .filter-section-header {
    display: flex; align-items: center; justify-content: space-between;
    width: 100%; margin-bottom: 0.5rem;
  }
  .filter-section-label {
    font-size: 0.6rem; font-weight: 700; letter-spacing: 0.12em;
    text-transform: uppercase; color: var(--text2);
    white-space: nowrap;
  }
  .filter-select-all {
    font-size: 0.6rem; font-weight: 600; letter-spacing: 0.06em;
    text-transform: uppercase; color: var(--text2);
    background: none; border: none; cursor: pointer;
    padding: 0; font-family: inherit;
    transition: color 0.15s;
    white-space: nowrap;
  }
  .filter-select-all:hover { color: var(--accent); }
  .filter-divider {
    width: 100%; height: 1px; background: var(--border);
    margin: 0.65rem 0;
  }

  /* serwis pill – solid colored */
  .filter-pill-feed {
    font-weight: 700 !important;
    letter-spacing: 0.04em;
    border: 1px solid transparent;
  }
  .filter-pill-feed:not(.active) {
    background: transparent !important;
  }

  /* toggle sekcji kategorii */
  .cats-section-toggle {
    display: inline-flex; align-items: center; gap: 0.35rem;
    flex: 1;
    background: none; border: none; padding: 0;
    color: var(--text2); font-family: inherit;
    font-size: 0.68rem; font-weight: 600; letter-spacing: 0.06em;
    text-transform: uppercase; cursor: pointer; text-align: left;
    transition: color 0.15s;
  }
  .cats-section-toggle:hover { color: var(--text); }
  .cats-section-toggle svg {
    width: 12px; height: 12px; flex-shrink: 0;
    transition: transform 0.2s ease;
  }
  .cats-section-toggle.open svg { transform: rotate(180deg); }
  .cats-all-list { display: none; width: 100%; }
  .cats-all-list.open { display: contents; }

  /* category pill – standard */
  .filter-pill-cat.dimmed { display: none; }

  /* pill */
  .filter-pill {
    display: inline-flex; align-items: center; gap: 0.3rem;
    padding: 0.25rem 0.75rem; border-radius: 20px;
    border: 1px solid var(--border); background: var(--surface);
    color: var(--text2); font-size: 0.7rem; font-weight: 600;
    letter-spacing: 0.04em; cursor: pointer;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
    white-space: nowrap; user-select: none;
  }
  .filter-pill:hover { border-color: rgba(230,57,70,0.4); color: var(--text); }
  .filter-pill.active {
    border-color: var(--accent);
    background: rgba(230,57,70,0.12);
    color: var(--text);
  }
  .filter-pill .pill-dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: currentColor; opacity: 0.7;
  }

  .filter-search {
    width: 100%; box-sizing: border-box;
    margin: 0.45rem 0 0.5rem;
    padding: 0.32rem 0.65rem;
    background: var(--surface2); border: 1px solid var(--border); border-radius: 8px;
    color: var(--text); font-family: inherit; font-size: 0.74rem; outline: none;
    transition: border-color 0.15s;
  }
  .filter-search:focus { border-color: var(--accent); }
  .filter-search::placeholder { color: var(--text2); opacity: 0.7; }

  /* ── MAIN ── */
  main { max-width: 1220px; margin: 0 auto; padding: 2.5rem 2rem 5rem; }

  .news-list {
    display: flex; flex-direction: column; gap: 1.25rem;
    opacity: 0; transform: translateY(12px);
    transition: opacity 0.35s ease, transform 0.35s ease;
  }
  .news-list.visible { opacity: 1; transform: translateY(0); }

  /* Wraps each card — clips horizontal swipe animation */
  .card-swipe-wrap {
    overflow: hidden;
    border-radius: 12px;
    height: 100%;
  }

  /* date-separator spans full grid width */
  .date-separator { grid-column: 1 / -1; }

  /* ── DESKTOP 3-COL GRID ── */
  @media (min-width: 901px) {
    .news-list {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      align-items: stretch;
      gap: 1.25rem;
    }
    .card-swipe-wrap { height: 100%; }
    .date-separator,
    .error-state { grid-column: 1 / -1; }
  }

  /* ── DATE SEPARATOR ── */
  .date-separator {
    display: flex; align-items: center; gap: 1rem;
    margin: 2rem 0 0.25rem;
  }
  .date-separator:first-child { margin-top: 0; }
  .date-sep-label {
    font-size: 0.7rem; font-weight: 700; letter-spacing: 0.12em;
    text-transform: uppercase; color: var(--text2); white-space: nowrap;
  }
  .date-sep-line { flex: 1; height: 1px; background: var(--border); }

  /* ── CARD BASE (featured – large) ── */
  .news-card {
    background: var(--card-bg);
    border: 1px solid var(--border); border-radius: 12px;
    position: relative;
    text-decoration: none; color: inherit;
    display: flex; flex-direction: column;
    height: 100%;
    transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
    animation: cardIn 0.4s ease both;
  }
  @keyframes cardIn {
    from { opacity:0; transform:translateY(14px); }
    to   { opacity:1; transform:translateY(0); }
  }
  .news-card:hover {
    transform: translateY(-3px);
    border-color: rgba(230,57,70,0.35);
    box-shadow: 0 16px 50px rgba(0,0,0,.5), 0 0 0 1px rgba(230,57,70,.12);
  }

  /* Featured image – large */
  .card-img-wrap {
    position: relative; width: 100%; height: 200px; flex-shrink: 0;
    overflow: hidden; background: var(--surface2);
    border-radius: 12px 12px 0 0;
  }
  .card-img-wrap img {
    width: 100%; height: 100%; object-fit: cover; display: block;
    transition: transform 0.5s ease;
  }
  .news-card:hover .card-img-wrap img { transform: scale(1.04); }
  .card-img-placeholder {
    width: 100%; height: 100%; min-height: 200px;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg,#1a1a28 0%,#0d0d18 100%);
    font-size: 2.5rem; color: var(--border);
  }
  .card-img-placeholder--logo {
    font-family: 'Inter', sans-serif;
    font-size: 1.25rem; font-weight: 900; letter-spacing: -0.02em;
    color: #2a2a3a; user-select: none;
    background: linear-gradient(135deg,#141420 0%,#0d0d16 100%);
  }
  .card-img-placeholder--logo span { color: #1e1e2e; }

  /* ── COMPACT CARD ── */
  /*
    Layout:
      [thumb] [meta + title     ]
      [      full-width bottom  ]  ← tags + lead
  */
  .news-card.compact {
    flex-direction: column;  /* outer card stacks: top-row + bottom */
  }
  /* top row: thumb left, meta+title right */
  .compact-top {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 0;
  }
  .news-card.compact .card-img-wrap {
    width: clamp(100px, 28%, 160px);
    flex-shrink: 0;
    align-self: stretch;
    border-radius: 0;
    /* top-left radius from card */
    border-bottom-left-radius: 0;
  }
  .news-card.compact .card-img-placeholder { min-height: 110px; font-size: 1.6rem; }
  /* top-right: meta + title */
  .compact-header {
    padding: 1rem 1.25rem 0.75rem;
    display: flex; flex-direction: column; justify-content: center;
    flex: 1; min-width: 0;
  }
  .compact-header .card-title { font-size: 1.17rem; line-height: 1.35; margin-bottom: 0; }
  /* bottom: tags + lead, full width */
  .compact-bottom {
    padding: 0.75rem 1.25rem 1rem;
    border-top: 1px solid var(--border);
    display: flex; flex-direction: column; flex: 1;
  }
  .compact-tags {
    display: flex; align-items: flex-end; gap: 0.5rem;
    margin-top: auto;
    padding-top: 1rem;
  }
  .compact-bottom .card-lead { font-size: 0.9rem; }

  /* ── TAGS BOTTOM (featured card body) ── */
  .card-tags-bottom {
    display: flex; align-items: flex-end; gap: 0.5rem;
    margin-top: 1.25rem;
  }
  .tags-wrap {
    display: flex; flex-wrap: wrap; gap: 4px; flex: 1;
  }
  .card-domain {
    font-size: 0.6rem; color: var(--text2); opacity: 0.5;
    white-space: nowrap; padding-bottom: 1px; flex-shrink: 0;
  }
  .tag {
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 0.58rem; font-weight: 700; letter-spacing: 0.09em;
    text-transform: uppercase; padding: 2px 7px; border-radius: 3px;
    color: #fff; line-height: 1;
  }
  /* serwis tag colours – assigned dynamically via data-feed attribute */
  .tag-serwis { background: #555; }
  .tag-rss {
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255,255,255,0.2);
  }

  /* ── DIVIDER ── */
  .card-divider {
    height: 1px;
    background: var(--border);
    margin: 0.85rem 0;
  }

  /* ── CARD BODY ── */
  .card-body {
    padding: 1.4rem 1.6rem;
    display: flex; flex-direction: column; flex: 1; min-width: 0;
  }
  .card-meta {
    display: flex;
    flex-direction: row;
    align-items: center;
    flex-wrap: nowrap;
    margin-bottom: 0.65rem;
  }
  .card-meta-left {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-shrink: 0;
  }
  .card-date { font-size: 0.72rem; color: var(--text2); font-weight: 500; line-height: 1; }
  .meta-sep  { width: 3px; height: 3px; background: var(--border); border-radius: 50%; flex-shrink: 0; }
  .card-time { font-size: 0.72rem; color: var(--accent); font-weight: 600; line-height: 1; }
  .meta-spacer { display: none; }
  .new-badge {
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 0.58rem; font-weight: 800; letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #fff; background: var(--accent);
    padding: 2px 6px; border-radius: 3px;
    line-height: 1; white-space: nowrap; flex-shrink: 0;
  }
  .card-title {
    font-family: 'Inter', sans-serif;
    font-size: 1.3rem; font-weight: 700; line-height: 1.35;
    margin-bottom: 0.8rem; color: var(--text);
  }
  .card-lead { font-size: 0.9rem; color: var(--text2); line-height: 1.65; flex: 1; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
  .card-lead-spacer { flex: 1; }

  /* ── SKELETONS ── */
  .skeleton-card {
    background: var(--card-bg); border: 1px solid var(--border);
    border-radius: 12px; overflow: hidden; display: flex; height: 170px;
  }
  .skeleton-img {
    width: 280px; flex-shrink: 0;
    background: var(--surface2); position: relative; overflow: hidden;
  }
  .skeleton-body-wrap {
    padding: 1.4rem 1.6rem; flex: 1;
    display: flex; flex-direction: column; gap: 10px;
  }
  .skeleton-line {
    height: 12px; background: var(--surface2);
    border-radius: 6px; position: relative; overflow: hidden;
  }
  .skeleton-line.short  { width: 35%; }
  .skeleton-line.medium { width: 60%; }
  .skeleton-line.full   { width: 100%; }
  .skeleton-line.title  { height: 20px; margin-bottom: 4px; }
  .skeleton-line::after, .skeleton-img::after {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,.04) 50%, transparent 100%);
    animation: shimmer 1.5s infinite;
  }
  @keyframes shimmer { 0%{transform:translateX(-100%)} 100%{transform:translateX(100%)} }



  /* ── NEW BADGE ── */
  .new-badge {
    display: inline-flex;
    align-items: center;
    font-size: 0.58rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #fff;
    background: var(--accent);
    padding: 2px 6px;
    border-radius: 3px;
    animation: newPulse 2s ease infinite;
    flex-shrink: 0;
  }
  @keyframes newPulse {
    0%,100% { box-shadow: 0 0 0 0 rgba(230,57,70,0.5); }
    50%      { box-shadow: 0 0 0 5px rgba(230,57,70,0); }
  }
  /* Subtle left border on new cards */
  .news-card.is-new {
    border-left: 3px solid var(--accent);
  }

  /* ── PROGRESS BAR ── */
  .fetch-progress {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 9998;
    height: 3px;
    background: var(--surface2);
  }
  .fetch-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), #ff6b6b);
    transition: width 0.3s ease;
    border-radius: 0 2px 2px 0;
  }
  .progress-dots {
    display: inline-block;
    overflow: hidden;
    width: 0;
    vertical-align: bottom;
    animation: progress-dots 1.5s steps(4, end) infinite;
  }
  @keyframes progress-dots {
    to { width: 1.1em; }
  }

  /* ── ERROR ── */
  .error-state { text-align:center; padding:4rem 2rem; color:var(--text2); }
  .error-icon  { font-size:3rem; margin-bottom:1rem; }
  .btn-retry {
    margin-top:1rem; padding:.55rem 1.4rem;
    background:var(--accent); color:#fff; border:none; border-radius:6px;
    cursor:pointer; font-family:inherit; font-size:.85rem; font-weight:600;
  }

  /* ── FOOTER ── */
  footer {
    border-top: 1px solid var(--border);
    padding: 1.5rem 2rem 2rem;
    max-width: 1220px; margin: 0 auto;
  }
  .footer-inner { max-width: 1220px; margin: 0 auto; }
  .footer-label {
    font-size: 0.62rem; font-weight: 700; letter-spacing: 0.12em;
    text-transform: uppercase; color: var(--text2);
    margin-bottom: 0.75rem;
  }
  .footer-label-toggle {
    cursor: pointer; display: inline-flex; align-items: center; gap: 0.4rem;
    user-select: none;
  }
  .footer-label-toggle:hover { color: var(--text); }
  .footer-toggle-icon {
    font-size: 0.55rem; display: inline-block;
    transition: transform 0.2s ease;
  }
  .footer-label-toggle.open .footer-toggle-icon { transform: rotate(90deg); }
  .footer-sources {
    display: none; flex-wrap: wrap; gap: 0.5rem 1.25rem;
  }
  .footer-sources.open { display: flex; }
  .footer-sources a {
    font-size: 0.78rem; font-weight: 500;
    color: var(--text); text-decoration: none;
    display: flex; align-items: center; gap: 0.35rem;
    transition: color 0.15s;
  }
  .footer-sources a:hover { color: var(--accent); }
  .footer-sources a span {
    font-size: 0.68rem; color: var(--text2); font-weight: 400;
  }
  .footer-stats {
    margin-top: 1.25rem; padding-top: 1rem;
    border-top: 1px solid var(--border);
    display: grid; grid-template-columns: repeat(2, minmax(0, 155px)); gap: 0.35rem 1.5rem;
  }
  .stats-row {
    display: flex; justify-content: space-between; align-items: baseline; gap: 0.5rem;
    font-size: 0.72rem;
  }
  .stats-row span { color: var(--text2); }
  .stats-row strong { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
  .footer-bottom {
    margin-top: 1rem; padding-top: 1rem;
    border-top: 1px solid var(--border);
    display: flex; flex-direction: column; gap: 0.5rem;
  }
  .footer-disclaimer {
    font-size: 0.7rem; color: var(--text2); line-height: 1.5;
  }
  .footer-meta {
    display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap;
    font-size: 0.7rem; color: var(--text2);
  }
  .footer-meta .sep { opacity: 0.4; }
  .footer-privacy-btn {
    background: none; border: none; padding: 0; cursor: pointer;
    font-size: 0.7rem; color: var(--text2); text-decoration: underline;
    text-underline-offset: 2px; font-family: inherit;
  }
  .footer-privacy-btn:hover { color: var(--text); }
  .footer-author {
    color: var(--text2); text-decoration: none;
  }
  .footer-author:hover { color: var(--text); }
  .footer-version-row {
    display: flex; align-items: center; justify-content: space-between; margin-top: 0.25rem;
  }
  .footer-version {
    font-size: 0.62rem; color: var(--text2); opacity: 0.45;
  }
  .footer-info-btn {
    width: 1.4rem; height: 1.4rem; border-radius: 50%;
    border: 1px solid var(--border); background: none; cursor: pointer;
    font-size: 0.65rem; font-style: italic; font-family: serif; font-weight: 700;
    color: var(--text2); display: flex; align-items: center; justify-content: center;
    opacity: 0.55; transition: opacity 0.15s;
  }
  .footer-info-btn:hover { opacity: 1; border-color: var(--text2); }

  /* ── SCORE MODAL ── */
  #score-modal {
    position: fixed; inset: 0; z-index: 1100;
    background: rgba(0,0,0,0.75); backdrop-filter: blur(6px);
    display: flex; align-items: center; justify-content: center; padding: 1rem;
  }
  #score-modal.hidden { display: none; }
  .score-box {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 16px; padding: 1.5rem;
    max-width: 480px; width: 100%; max-height: 82vh;
    display: flex; flex-direction: column; position: relative;
  }
  .score-box h2 { font-size: 1rem; font-weight: 700; margin-bottom: 1rem; }
  .score-list {
    overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: 0.2rem;
  }
  .score-section-label {
    font-size: 0.6rem; font-weight: 700; letter-spacing: 0.1em;
    text-transform: uppercase; color: var(--text2); margin: 0.6rem 0 0.2rem;
  }
  .score-item {
    display: flex; align-items: center; gap: 0.5rem;
    font-size: 0.78rem; padding: 0.25rem 0;
  }
  .score-item-name { flex: 1; color: var(--text); }
  .score-item-bar-wrap { width: 80px; height: 4px; background: var(--border); border-radius: 2px; }
  .score-item-bar { height: 4px; background: var(--accent); border-radius: 2px; }
  .score-item-val { font-size: 0.7rem; color: var(--text2); min-width: 2.5rem; text-align: right; font-variant-numeric: tabular-nums; }
  .score-reset-btn {
    margin-top: 1rem; padding: 0.55rem 1rem;
    background: rgba(230,57,70,0.12); border: 1px solid rgba(230,57,70,0.35);
    border-radius: 8px; color: var(--accent); cursor: pointer;
    font-size: 0.78rem; font-family: inherit; font-weight: 600;
    transition: background 0.15s;
  }
  .score-reset-btn:hover { background: rgba(230,57,70,0.22); }

  /* ── PRIVACY MODAL ── */
  #privacy-modal {
    position: fixed; inset: 0; z-index: 1100;
    background: rgba(0,0,0,0.75); backdrop-filter: blur(6px);
    display: flex; align-items: center; justify-content: center;
    padding: 1rem;
  }
  #privacy-modal.hidden { display: none; }
  .privacy-box {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 16px; padding: 2rem;
    max-width: 520px; width: 100%; max-height: 80vh; overflow-y: auto;
    position: relative;
  }
  .privacy-box h2 {
    font-size: 1.1rem; font-weight: 700; margin-bottom: 1rem; color: var(--text);
  }
  .privacy-box h3 {
    font-size: 0.78rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.08em; color: var(--text2); margin: 1rem 0 0.35rem;
  }
  .privacy-box p {
    font-size: 0.82rem; color: var(--text2); line-height: 1.65; margin-bottom: 0.5rem;
  }
  .privacy-box p strong { color: var(--text); font-weight: 600; }
  .privacy-close {
    position: absolute; top: 1rem; right: 1rem;
    background: none; border: 1px solid var(--border);
    border-radius: 8px; width: 2rem; height: 2rem; cursor: pointer;
    font-size: 1rem; color: var(--text2); display: flex;
    align-items: center; justify-content: center;
  }
  .privacy-close:hover { color: var(--text); border-color: var(--text2); }

  /* ── MOBILE COMPACT (compact-top is row, card stays column) ── */
  @media (max-width: 900px) {
    .news-card.compact {
      flex-direction: column;
      height: auto !important;
    }
    /* compact-top: thumb left, meta+title right */
    .news-card.compact .compact-top {
      display: flex;
      flex-direction: row;
      align-items: flex-start;
    }
    .news-card.compact .card-img-wrap {
      width: clamp(100px, 28%, 160px) !important;
      height: auto !important;
      min-height: 110px;
      flex-shrink: 0;
    }
  }

  /* ── RESPONSIVE ── */
  @media (max-width: 700px) {
    .header-inner, .filter-bar-inner, .filter-panel { padding-left:1rem; padding-right:1rem; }
    main { padding: 1.5rem 1rem 3rem; }

    /* Compact on mobile: shrink thumb */
    .news-card.compact .card-img-wrap { width: 90px !important; height: auto !important; min-height: 90px; }

    .card-body { padding: 1.1rem 1.2rem; }
    .card-title { font-size: 1.3rem; line-height: 1.35; }

    .skeleton-card { flex-direction:column; height:auto; }
    .skeleton-img  { width:100%; height:180px; }
  }

  /* ── SWIPE HINT ── */
  .swipe-hint {
    font-size: 0.62rem; color: var(--text2); opacity: 0.5;
    padding: 0.35rem 2rem 0.4rem;
    text-align: center;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  @media (min-width: 901px) { .swipe-hint { display: none; } }

  /* ── SWIPE VISUAL ── */
  .news-card { will-change: transform; }
  @media (max-width: 900px) {
    .card-swipe-wrap { touch-action: pan-y; }
    .news-card { touch-action: pan-y; }
  }

  .swipe-overlay {
    position: absolute; top: 0; bottom: 0;
    display: flex; align-items: center; justify-content: center;
    gap: 0.4rem;
    font-size: 0.75rem; font-weight: 700; letter-spacing: 0.05em;
    text-transform: uppercase; color: #fff;
    opacity: 0; pointer-events: none;
    transition: opacity 0.1s ease;
    border-radius: 12px;
    z-index: 2;
  }
  .swipe-overlay span { font-size: 1.1rem; }
  .swipe-overlay-right {
    left: 0; right: 0;
    background: rgba(15,15,20,0.82);
  }
  .swipe-overlay-left {
    left: 0; right: 0;
    background: rgba(230,57,70,0.85);
  }

  /* ── TOAST ── */
  .toast {
    position: fixed; bottom: 1.5rem; left: 50%; transform: translateX(-50%);
    z-index: 8000;
    background: #1e1e2e; border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.75rem 1rem;
    display: flex; align-items: center; gap: 0.75rem;
    font-size: 0.78rem; color: var(--text);
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
    width: calc(100vw - 2rem);
    max-width: 480px;
    transition: opacity 0.3s ease, transform 0.3s ease;
  }
  #toast-msg {
    flex: 1; min-width: 0;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .toast.hidden { display: none; }
  .toast.fading { opacity: 0; transform: translateX(-50%) translateY(8px); }
  .toast button {
    background: var(--accent); color: #fff; border: none;
    border-radius: 5px; padding: 3px 10px;
    font-family: inherit; font-size: 0.72rem; font-weight: 700;
    cursor: pointer; flex-shrink: 0;
  }

  /* ── CUSTOM FEEDS ── */
  .custom-feeds-section {
    width: 100%;
    margin-top: 0.25rem;
  }
  .custom-feeds-form {
    display: flex; gap: 0.5rem; width: 100%;
    margin-top: 0.6rem;
  }
  .custom-feeds-form input {
    flex: 1; min-width: 0;
    background: var(--surface2);
    border: 1px solid var(--border); border-radius: 6px;
    color: var(--text); font-family: inherit; font-size: 0.75rem;
    padding: 0.4rem 0.7rem;
    outline: none;
  }
  .custom-feeds-form input:focus { border-color: var(--accent); }
  .custom-feeds-form input::placeholder { color: var(--text2); }
  .custom-feeds-form button {
    background: var(--accent); color: #fff; border: none;
    border-radius: 6px; padding: 0.4rem 0.85rem;
    font-family: inherit; font-size: 0.72rem; font-weight: 700;
    cursor: pointer; white-space: nowrap; flex-shrink: 0;
  }
  .custom-feeds-form button:disabled { opacity: 0.5; cursor: default; }
  .custom-feed-item {
    display: flex; align-items: center; justify-content: space-between;
    gap: 0.5rem; padding: 0.3rem 0; font-size: 0.75rem; color: var(--text2);
  }
  .custom-feed-item span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .custom-feed-remove {
    background: none; border: none; color: var(--text2);
    cursor: pointer; font-size: 0.9rem; padding: 0 0.2rem; flex-shrink: 0;
    line-height: 1;
  }
  .custom-feed-remove:hover { color: var(--accent); }
  .custom-feeds-error { font-size: 0.68rem; color: var(--accent); margin-top: 0.3rem; min-height: 1em; }

  /* ── PIN MODAL ── */
  #pin-modal {
    position: fixed; inset: 0; z-index: 99000;
    background: var(--bg);
    display: flex; align-items: center; justify-content: center;
  }
  #pin-modal.hidden { display: none; }
  .pin-box {
    display: flex; flex-direction: column; align-items: center;
    gap: 1.75rem; padding: 2.5rem 2rem;
    background: var(--card-bg);
    border: 1px solid var(--border); border-radius: 20px;
    width: min(340px, 92%);
  }
  .pin-logo {
    font-family: 'Inter', sans-serif;
    font-size: 1.3rem; font-weight: 900; letter-spacing: -0.02em; color: var(--text);
  }
  .pin-logo .pin-slash { color: var(--accent); }
  .pin-title { font-size: 0.85rem; color: var(--text2); }
  .pin-dots {
    display: flex; gap: 0.9rem;
  }
  .pin-dot {
    width: 14px; height: 14px; border-radius: 50%;
    background: var(--border); border: 2px solid var(--border);
    transition: background 0.15s, border-color 0.15s;
  }
  .pin-dot.filled { background: var(--accent); border-color: var(--accent); }
  .pin-error {
    font-size: 0.78rem; color: var(--accent); min-height: 1em;
    animation: pin-shake 0.35s ease;
  }
  @keyframes pin-shake {
    0%,100% { transform: translateX(0); }
    20% { transform: translateX(-6px); }
    40% { transform: translateX(6px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
  }
  .pin-numpad {
    display: grid; grid-template-columns: repeat(3, 1fr);
    gap: 0.6rem; width: 100%;
  }
  .pin-key {
    aspect-ratio: 1; display: flex; align-items: center; justify-content: center;
    background: var(--surface2); border: 1px solid var(--border); border-radius: 12px;
    font-size: 1.4rem; font-weight: 600; color: var(--text);
    cursor: pointer; user-select: none;
    transition: background 0.1s, transform 0.1s;
  }
  .pin-key:active { background: var(--border); transform: scale(0.94); }
  .pin-key.pin-zero { grid-column: 2; }
  .pin-key.pin-del { font-size: 1rem; color: var(--text2); }
  .pin-locked-view { display: flex; flex-direction: column; align-items: center; gap: 0.6rem; padding: 0.5rem 0; }
  .pin-locked-view.hidden { display: none; }
  .pin-lock-icon { font-size: 2.5rem; line-height: 1; }
  .pin-lock-title { font-size: 1rem; font-weight: 700; color: var(--accent); }
  .pin-lock-sub { font-size: 0.78rem; color: var(--text2); text-align: center; line-height: 1.5; }

  /* ── TOPICS MODAL ── */
  #topics-modal {
    position: fixed; inset: 0; z-index: 9000;
    background: var(--bg);
    display: flex; align-items: center; justify-content: center;
    padding: 1rem;
  }
  #topics-modal.hidden { display: none; }
  .topics-box {
    display: flex; flex-direction: column;
    gap: 0.6rem; padding: 1.1rem 1.25rem 0;
    background: var(--card-bg);
    border: 1px solid var(--border); border-radius: 16px;
    width: min(520px, 100%);
    max-height: min(620px, 90vh); overflow: hidden;
  }
  .topics-logo {
    font-family: 'Inter', sans-serif;
    font-size: 1.3rem; font-weight: 900; letter-spacing: -0.02em;
    color: var(--text);
  }
  .topics-logo span { color: var(--accent); }
  .topics-title {
    font-size: 0.95rem; font-weight: 700; color: var(--text);
    margin-top: 0.3rem; line-height: 1.3;
  }
  .topics-subtitle {
    font-size: 0.72rem; color: var(--text2); margin-top: 0.1rem; line-height: 1.4;
  }
  .topics-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: 82px;
    gap: 0.5rem;
    flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden;
    padding-bottom: 0.4rem;
  }
  @media (max-width: 360px) {
    .topics-grid { grid-template-columns: repeat(2, 1fr); }
  }
  .topic-card {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 0.3rem; padding: 0.5rem 0.4rem;
    background: var(--surface2);
    border: 2px solid var(--border); border-radius: 12px;
    cursor: pointer; position: relative;
    transition: border-color 0.15s, background 0.15s;
    user-select: none; -webkit-tap-highlight-color: transparent;
    height: 100%; box-sizing: border-box;
    overflow: hidden; min-width: 0;
  }
  .topic-card:hover { border-color: rgba(230,57,70,0.4); }
  .topic-card.selected {
    border-color: var(--accent);
    background: rgba(230,57,70,0.1);
  }
  .topic-card.selected::after {
    content: '✓';
    position: absolute; top: 5px; right: 8px;
    font-size: 0.65rem; font-weight: 900; color: var(--accent);
  }
  .topic-icon { font-size: 1.65rem; line-height: 1; }
  .topic-label {
    font-size: 0.67rem; font-weight: 600; color: var(--text2);
    text-align: center; line-height: 1.3;
    width: 100%; padding: 0 0.25rem; box-sizing: border-box;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .topic-card.selected .topic-label { color: var(--text); }
  .topics-hint {
    min-height: 1.2rem;
    font-size: 0.75rem; color: var(--text2);
    text-align: center; padding: 0 0 0.25rem;
    transition: opacity 0.2s;
  }
  .topics-hint.all-mode { color: var(--accent); }
  .topics-actions {
    display: flex; align-items: center; justify-content: space-between;
    gap: 0.75rem; padding: 0.9rem 0 1.1rem; border-top: 1px solid var(--border);
  }
  .topics-actions-btns { display: flex; gap: 0.75rem; }
  .topics-lang-label {
    display: flex; align-items: center; gap: 0.45rem; cursor: pointer;
  }
  .topics-lang-label span {
    font-size: 0.72rem; color: var(--text2); white-space: nowrap; user-select: none;
  }
  .topics-btn-skip {
    background: none; border: 1px solid var(--border);
    border-radius: 8px; color: var(--text2);
    font-family: inherit; font-size: 0.82rem; font-weight: 600;
    padding: 0.55rem 1.1rem; cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
  }
  .topics-btn-skip:hover { color: var(--text); border-color: rgba(230,57,70,0.4); }
  .topics-btn-confirm {
    background: var(--accent); border: none;
    border-radius: 8px; color: #fff;
    font-family: inherit; font-size: 0.82rem; font-weight: 700;
    padding: 0.55rem 1.4rem; cursor: pointer;
    transition: opacity 0.15s;
  }
  .topics-btn-confirm:hover { opacity: 0.88; }

  /* ── TEMATY NAV BUTTON ── */
  .topics-nav-btn {
    margin-left: auto; flex-shrink: 0;
    display: flex; align-items: center; gap: 0.4rem;
    padding: 0.3rem 0.85rem;
    background: none;
    border: 1px solid var(--border); border-radius: 6px;
    color: var(--text2);
    font-family: inherit; font-size: 0.72rem; font-weight: 600;
    letter-spacing: 0.06em; text-transform: uppercase;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
  }
  .topics-nav-btn:hover, .topics-nav-btn.active {
    color: var(--text); border-color: rgba(230,57,70,0.5);
  }
  .topics-nav-btn.topics-active {
    color: var(--text); border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent);
  }
  .topics-nav-btn svg { width: 13px; height: 13px; }

  /* ── BOOKMARK BUTTON (inline in card-meta) ── */
  .card-meta-fill { flex: 1; }
  .bookmark-btn {
    background: none; border: none;
    cursor: pointer; padding: 3px 4px; color: var(--text2); margin-left: 0.4rem;
    transition: color 0.15s; line-height: 0; flex-shrink: 0;
  }
  .bookmark-btn:hover { color: var(--text); }
  .bookmark-btn.saved { color: var(--accent); }
  .bookmark-btn svg { width: 16px; height: 16px; }

  .share-btn {
    background: none; border: none;
    cursor: pointer; padding: 3px 4px; color: var(--text2); margin-left: 0.4rem;
    transition: color 0.15s; line-height: 0; flex-shrink: 0;
  }
  .share-btn:hover { color: var(--text); }
  .share-btn.copied { color: #2a9d8f; }
  .share-btn svg { width: 16px; height: 16px; }

  /* ── HEADER BOOKMARK ICON ── */
  .header-bookmark-btn {
    background: none; border: 1px solid rgba(255,255,255,0.18); border-radius: 6px;
    cursor: pointer; color: var(--text2); padding: 5px 6px; margin-left: 0.75rem;
    display: flex; align-items: center; justify-content: center;
    transition: border-color 0.15s, color 0.15s; flex-shrink: 0;
  }
  .header-bookmark-btn:hover { border-color: rgba(255,255,255,0.45); color: var(--text); }
  .header-bookmark-btn svg { width: 19px; height: 19px; }

  /* ── NEWS COUNT BAR ── */
  .news-count-bar { border-top: 1px solid var(--border); }
  .news-count-inner {
    max-width: 1220px; margin: 0 auto;
    padding: 0.3rem 2rem;
    font-size: 0.68rem; color: var(--text2); opacity: 0.6;
  }
  @media (max-width: 700px) { .news-count-inner { padding-left: 1rem; padding-right: 1rem; } }

  /* ── SETTINGS MODAL ── */
  #settings-modal {
    position: fixed; inset: 0; z-index: 9000;
    background: rgba(0,0,0,0.65);
    backdrop-filter: blur(6px);
    display: flex; align-items: center; justify-content: center;
    padding: 1rem;
  }
  #settings-modal.hidden { display: none; }
  .settings-box {
    display: flex; flex-direction: column; gap: 1.25rem;
    padding: 1.75rem;
    background: var(--card-bg);
    border: 1px solid var(--border); border-radius: 16px;
    width: min(480px, 100%);
    max-height: 90vh; overflow-y: auto;
  }
  .settings-title {
    font-size: 1rem; font-weight: 700; color: var(--text); letter-spacing: -0.01em;
  }
  .settings-row {
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  }
  .settings-label {
    font-size: 0.82rem; color: var(--text); font-weight: 600; line-height: 1.35;
  }
  .settings-sublabel {
    font-size: 0.7rem; color: var(--text2); margin-top: 0.2rem; line-height: 1.4;
  }
  /* Toggle switch */
  .s-toggle {
    position: relative; display: inline-block;
    width: 40px; height: 22px; flex-shrink: 0; margin-top: 1px;
  }
  .s-toggle input { opacity: 0; width: 0; height: 0; position: absolute; }
  .s-toggle-track {
    position: absolute; inset: 0;
    background: var(--border); border-radius: 22px;
    transition: background 0.2s; cursor: pointer;
  }
  .s-toggle input:checked + .s-toggle-track { background: var(--accent); }
  .s-toggle-thumb {
    position: absolute; top: 3px; left: 3px;
    width: 16px; height: 16px;
    background: #fff; border-radius: 50%;
    transition: transform 0.2s; pointer-events: none;
  }
  .s-toggle input:checked ~ .s-toggle-thumb { transform: translateX(18px); }
  /* Slider */
  .settings-slider-wrap { display: flex; flex-direction: column; gap: 0.5rem; }
  .settings-slider-label-row {
    display: flex; align-items: center; justify-content: space-between;
  }
  .settings-slider-value {
    font-size: 0.8rem; font-weight: 700; color: var(--accent);
  }
  .s-slider {
    -webkit-appearance: none; appearance: none;
    width: 100%; height: 4px;
    background: var(--border); border-radius: 4px;
    outline: none; cursor: pointer;
  }
  .s-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px; height: 18px; border-radius: 50%;
    background: var(--accent); cursor: pointer;
    border: 2px solid var(--bg);
  }
  .s-slider::-moz-range-thumb {
    width: 18px; height: 18px; border-radius: 50%;
    background: var(--accent); cursor: pointer;
    border: 2px solid var(--bg);
  }
  .s-slider:disabled { opacity: 0.4; cursor: not-allowed; }
  .settings-ticks {
    display: flex; justify-content: space-between;
    font-size: 0.6rem; color: var(--text2);
    padding: 0 1px;
  }
  .settings-sep { border: none; border-top: 1px solid var(--border); margin: 0.1rem 0; }
  .settings-actions {
    display: flex; justify-content: flex-end; padding-top: 0.25rem;
  }
  .settings-btn-close {
    background: var(--accent); border: none;
    border-radius: 8px; color: #fff;
    font-family: inherit; font-size: 0.82rem; font-weight: 700;
    padding: 0.55rem 1.4rem; cursor: pointer; transition: opacity 0.15s;
  }
  .settings-btn-close:hover { opacity: 0.88; }

  /* ── SAVED VIEW ── */
  #saved-view {
    position: fixed; inset: 0; z-index: 500;
    background: var(--bg); overflow-y: auto; -webkit-overflow-scrolling: touch;
  }
  #saved-view.hidden { display: none; }
  .saved-header {
    position: sticky; top: 0; z-index: 10;
    background: rgba(10,10,15,0.96); backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    padding-top: env(safe-area-inset-top, 0px);
  }
  .saved-header-inner {
    max-width: 1220px; margin: 0 auto;
    padding: 0 1.5rem;
    display: flex; align-items: center; gap: 0.75rem;
    height: 62px;
  }
  .saved-back-btn {
    background: none; border: none; cursor: pointer;
    color: var(--text2); padding: 6px; display: flex; align-items: center;
    transition: color 0.15s; flex-shrink: 0;
  }
  .saved-back-btn:hover { color: var(--text); }
  .saved-back-btn svg { width: 22px; height: 22px; }
  .saved-count { font-size: 0.8rem; color: var(--text2); margin-left: auto; }
  .saved-main { max-width: 1220px; margin: 0 auto; padding: 2.5rem 2rem 5rem; }
  @media (max-width: 700px) { .saved-main { padding: 1.5rem 1rem 3rem; } }
  .saved-footer-info {
    text-align: center; font-size: 0.7rem; color: var(--text2);
    opacity: 0.4; padding: 1.5rem 0 0;
  }
  /* ── PWA INSTALL BANNER ── */
  #pwa-banner {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 600;
    background: var(--card-bg); border-top: 1px solid var(--border);
    padding: env(safe-area-inset-bottom, 0px) 0 0;
    animation: bannerIn 0.3s ease both;
  }
  #pwa-banner.hidden { display: none; }
  @keyframes bannerIn { from { transform: translateY(100%); } to { transform: translateY(0); } }
  .pwa-banner-inner {
    max-width: 1220px; margin: 0 auto;
    padding: 0.85rem 1.25rem;
    display: flex; align-items: center; gap: 0.85rem;
  }
  .pwa-banner-icon { font-size: 1.4rem; flex-shrink: 0; line-height: 1; }
  .pwa-banner-text { flex: 1; min-width: 0; }
  .pwa-banner-title { font-size: 0.82rem; font-weight: 700; color: var(--text); }
  .pwa-banner-sub { font-size: 0.72rem; color: var(--text2); margin-top: 0.15rem; line-height: 1.4; }
  .pwa-banner-actions { display: flex; align-items: center; gap: 0.5rem; flex-shrink: 0; }
  .pwa-install-btn {
    background: var(--accent); color: #fff; border: none; border-radius: 6px;
    padding: 0.42rem 0.9rem; font-size: 0.78rem; font-weight: 700; cursor: pointer;
    white-space: nowrap; transition: opacity 0.15s;
  }
  .pwa-install-btn:hover { opacity: 0.85; }
  .pwa-dismiss-btn {
    background: none; border: none; cursor: pointer;
    color: var(--text2); padding: 6px; font-size: 1.1rem; line-height: 1;
    opacity: 0.5; transition: opacity 0.15s;
  }
  .pwa-dismiss-btn:hover { opacity: 1; }


/* ── COOKIE CONSENT BANNER ── */
.cookie-banner {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 10001;
  background: var(--surface2);
  border-top: 1px solid var(--border);
  padding: 1rem 1.25rem;
  animation: slideUpBanner 0.25s ease;
}
.cookie-banner.hidden { display: none; }
@keyframes slideUpBanner {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}
.cookie-banner-inner {
  max-width: 1220px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.cookie-banner-text {
  flex: 1;
  min-width: 200px;
  font-size: 0.83rem;
  color: var(--text2);
  line-height: 1.5;
}
.cookie-policy-link {
  background: none;
  border: none;
  color: var(--accent);
  font-size: inherit;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.cookie-banner-btns {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}
.cookie-btn {
  padding: 0.45rem 1.1rem;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--border);
  transition: opacity 0.15s, border-color 0.15s, color 0.15s;
}
.cookie-btn-accept {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.cookie-btn-accept:hover { opacity: 0.85; }
.cookie-btn-reject {
  background: transparent;
  color: var(--text2);
}
.cookie-btn-reject:hover { color: var(--text); border-color: var(--text2); }
