/* MaxFeeder styles. Extracted from the inline <style> blocks in index.html so the page can
   run under a Content-Security-Policy without 'unsafe-inline' for scripts, and so the markup
   is readable. Concatenated in original document order — cascade order is preserved. */

/* Dark theme (default) */
      :root,
      :root[data-theme="dark"] {
        --bg: #0e1116;
        --header-bg: rgba(14, 17, 22, 0.9);
        --col-head-bg: rgba(23, 27, 34, 0.95);
        --card: #171b22;
        --border: #262c36;
        --border-hover: #3a4453;
        --text: #e6e9ee;
        --muted: #8b94a3;
        --accent: #4c9aff;
      }
      /* Light theme */
      :root[data-theme="light"] {
        --bg: #f4f6f9;
        --header-bg: rgba(244, 246, 249, 0.9);
        --col-head-bg: rgba(255, 255, 255, 0.95);
        --card: #ffffff;
        --border: #e1e5ea;
        --border-hover: #c3ccd6;
        --text: #1a1f26;
        --muted: #67707c;
        --accent: #1a6fd6;
      }
      * { box-sizing: border-box; }
      html, body { height: 100%; }
      body {
        margin: 0;
        font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
        background: var(--bg);
        color: var(--text);
        line-height: 1.45;
        /* Fill the viewport; individual columns scroll, not the page. */
        display: flex;
        flex-direction: column;
        overflow: hidden;
      }
      header {
        flex: 0 0 auto;
        /* Belt and braces: the menu above is what keeps this to one line, but a long account email
           or a narrow window should wrap rather than push buttons off the edge. */
        flex-wrap: wrap;
        row-gap: 8px;
        z-index: 5;
        background: var(--header-bg);
        backdrop-filter: blur(8px);
        border-bottom: 1px solid var(--border);
        padding: 14px 20px;
        display: flex;
        align-items: baseline;
        gap: 14px;
      }
      header h1 { margin: 0; font-size: 18px; letter-spacing: 0.3px; display: inline-flex; align-items: center; gap: 7px; }
      header h1 .logo { width: 24px; height: 24px; display: block; }
      header .status { color: var(--muted); font-size: 13px; }
      header .spacer { flex: 1; }
      #theme-toggle, .hbtn {
        align-self: center;
        background: var(--card);
        color: var(--text);
        border: 1px solid var(--border);
        border-radius: 8px;
        padding: 6px 10px;
        font-size: 13px;
        cursor: pointer;
        line-height: 1;
      }
      #theme-toggle:hover, .hbtn:hover { border-color: var(--border-hover); }
      .hbtn.live-on { border-color: #3fb950; color: #3fb950; }
      /* Generic "this toggle is engaged" state. Distinct from .live-on: two green buttons
         side by side in the header would say the same thing about different features. */
      .hbtn.on { border-color: var(--accent); color: var(--accent); }
      /* Signed-out "Go Pro" pitch: the one header button meant to catch the eye. */
      .hbtn.pro-cta { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
      .hbtn.pro-cta:hover { filter: brightness(1.08); border-color: var(--accent); }

      /* Narrower windows: tighten the chrome before resorting to a second row. The buttons keep
         their labels — an icon-only header is unreadable to anyone who hasn't memorised it. */
      @media (max-width: 1150px) {
        header { gap: 8px; padding: 10px 12px; }
        header h1 { font-size: 16px; }
        #theme-toggle, .hbtn { padding: 5px 8px; font-size: 12.5px; }
      }

      /* "More" menu — the header's once-a-session buttons. Matches #share-pop. */
      #more-pop {
        position: fixed;
        top: 56px;
        right: 16px;
        z-index: 30;
        display: none;
        min-width: 190px;
        background: var(--card);
        border: 1px solid var(--border);
        border-radius: 10px;
        padding: 6px;
        box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
      }
      #more-pop.open { display: block; }
      /* The buttons keep .hbtn (and its listeners); inside the menu they read as rows, not chips. */
      #more-pop .hbtn {
        display: block;
        width: 100%;
        text-align: left;
        background: none;
        border: 0;
        padding: 8px 10px;
        border-radius: 7px;
        font-size: 14px;
      }
      #more-pop .hbtn:hover { background: var(--border); }
      #more-pop .hbtn[hidden] { display: none; }

      /* Background palette picker */
      #palette-pop {
        position: fixed;
        top: 56px;
        right: 16px;
        z-index: 30;
        display: none;
        background: var(--card);
        border: 1px solid var(--border);
        border-radius: 10px;
        padding: 12px;
        box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
      }
      #palette-pop.open { display: block; }

      /* Share menu — anchored to the reader's ↗ button. Matches #palette-pop / #emoji-pop. */
      #share-pop {
        position: fixed;
        /* Must beat .reader-overlay, which is also 60 — and #share-pop appears EARLIER in the DOM,
           so an equal z-index would put the menu behind the reader that opened it. */
        z-index: 70;
        display: none;
        min-width: 190px;
        background: var(--card);
        border: 1px solid var(--border);
        border-radius: 10px;
        padding: 6px;
        box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
      }
      #share-pop.open { display: block; }
      #share-pop button {
        display: flex; align-items: center; gap: 10px; width: 100%;
        background: none; border: 0; color: var(--text);
        padding: 8px 10px; border-radius: 7px; font-size: 14px; text-align: left; cursor: pointer;
      }
      #share-pop button:hover { background: var(--border); }
      #share-pop .sp-ico { width: 18px; text-align: center; flex: none; }
      #share-pop hr { border: 0; border-top: 1px solid var(--border); margin: 6px 4px; }

      #emoji-pop {
        position: fixed;
        z-index: 40;
        display: none;
        width: 300px;
        max-height: 280px;
        overflow-y: auto;
        background: var(--card);
        border: 1px solid var(--border);
        border-radius: 10px;
        padding: 8px;
        box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
      }
      #emoji-pop.open { display: block; }
      .emoji-cat { font-size: 10px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--muted); margin: 6px 4px 4px; }
      .emoji-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; }
      .emoji-btn {
        border: none;
        background: none;
        font-size: 20px;
        line-height: 1;
        padding: 5px 0;
        border-radius: 6px;
        cursor: pointer;
      }
      .emoji-btn:hover { background: var(--bg); }
      .pal-title { font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--muted); margin-bottom: 8px; }
      .pal-swatches { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
      .pal-swatch {
        width: 44px;
        height: 44px;
        border-radius: 8px;
        border: 2px solid var(--border);
        cursor: pointer;
        padding: 0;
      }
      .pal-swatch:hover { border-color: var(--border-hover); }
      .pal-swatch.sel { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent) inset; }
      .pal-custom {
        width: 44px;
        height: 44px;
        padding: 0;
        border: 2px solid var(--border);
        border-radius: 8px;
        cursor: pointer;
        background: none;
      }
      .pal-custom:hover { border-color: var(--border-hover); }
      .pal-custom.sel { border-color: var(--accent); }
      .pal-custom::-webkit-color-swatch-wrapper { padding: 2px; }
      .pal-custom::-webkit-color-swatch { border: none; border-radius: 6px; }
      .pal-custom::-moz-color-swatch { border: none; border-radius: 6px; }

      /* Link preview popover (hover to unfurl the destination) */
      #link-preview {
        position: fixed;
        z-index: 35;
        width: 360px;
        max-width: 92vw;
        background: var(--card);
        border: 1px solid var(--border);
        border-radius: 10px;
        box-shadow: 0 14px 44px rgba(0, 0, 0, 0.45);
        overflow: hidden;
        display: none;
        pointer-events: none;
      }
      #link-preview.open { display: block; }
      #link-preview .lp-img { width: 100%; height: 160px; object-fit: cover; background: var(--border); display: block; }
      #link-preview .lp-body { padding: 10px 12px; }
      #link-preview .lp-site { font-size: 11px; text-transform: uppercase; letter-spacing: 0.4px; color: var(--muted); margin-bottom: 4px; }
      #link-preview .lp-title { font-weight: 700; font-size: 14px; line-height: 1.3; margin-bottom: 5px;
        display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
      #link-preview .lp-desc { color: var(--muted); font-size: 12.5px; line-height: 1.45;
        display: -webkit-box; -webkit-line-clamp: 10; -webkit-box-orient: vertical; overflow: hidden; }
      #link-preview .lp-loading { padding: 14px; color: var(--muted); font-size: 13px; }

      /* Reader view modal — in-app article instead of leaving to the browser */
      .reader-overlay {
        position: fixed; inset: 0; z-index: 60;
        background: rgba(0, 0, 0, 0.55);
        display: flex; align-items: flex-start; justify-content: center;
        padding: 4vh 16px; overflow-y: auto;
      }
      .reader-overlay[hidden] { display: none; }
      .reader-modal {
        background: var(--card); color: var(--text);
        width: 100%; max-width: 720px; border-radius: 14px;
        border: 1px solid var(--border);
        box-shadow: 0 24px 70px rgba(0, 0, 0, 0.5);
        margin: auto 0;
      }
      .reader-head {
        display: flex; align-items: center; justify-content: space-between; gap: 12px;
        padding: 10px 14px; border-bottom: 1px solid var(--border);
        position: sticky; top: 0; background: var(--card); border-radius: 14px 14px 0 0; z-index: 1;
      }
      .reader-open { font-size: 13px; color: var(--accent); text-decoration: none; font-weight: 600; white-space: nowrap; }
      .reader-open:hover { text-decoration: underline; }
      .reader-close {
        background: none; border: 1px solid var(--border); color: var(--muted);
        width: 30px; height: 30px; border-radius: 8px; cursor: pointer; font-size: 15px; line-height: 1; flex-shrink: 0;
      }
      .reader-close:hover { border-color: var(--border-hover); color: var(--text); }
      .reader-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
      .reader-abtn {
        background: none; border: 1px solid var(--border); color: var(--muted);
        border-radius: 6px; padding: 3px 8px; font-size: 13px; line-height: 1.2; cursor: pointer;
      }
      .reader-abtn:hover { border-color: var(--border-hover); color: var(--text); }
      /* The share button holds an SVG rather than text. `display:block` drops the inline baseline
         gap that would otherwise make it sit a pixel low next to the emoji buttons; stroke is
         currentColor, so it inherits hover and .on states for free. */
      .reader-abtn svg { display: block; }
      .reader-abtn.on { color: var(--accent); border-color: var(--accent); }
      .reader-content { padding: 20px 26px 34px; }
      .reader-loading, .reader-error { color: var(--muted); font-size: 14px; padding: 24px 4px; }
      .reader-lead { width: 100%; max-height: 320px; object-fit: cover; border-radius: 10px; margin-bottom: 16px; display: block; }
      .reader-content h1 { font-size: 24px; line-height: 1.25; margin: 0 0 8px; }
      .reader-meta { color: var(--muted); font-size: 13px; margin-bottom: 18px; }
      .reader-body { font-size: var(--reader-fs, 16px); line-height: 1.65; }
      .reader-body p { margin: 0 0 15px; }
      .reader-body h3 { font-size: 18px; line-height: 1.3; margin: 22px 0 8px; }
      .reader-body ul { margin: 0 0 15px; padding-left: 22px; }
      .reader-body li { margin: 0 0 6px; }
      .reader-body blockquote {
        margin: 0 0 15px; padding: 4px 0 4px 16px; border-left: 3px solid var(--border);
        color: var(--muted); font-style: italic;
      }
      .reader-body img { max-width: 100%; height: auto; border-radius: 8px; margin: 8px 0 16px; display: block; }

      /* Editor modal */
      .overlay {
        position: fixed;
        inset: 0;
        z-index: 20;
        background: rgba(0, 0, 0, 0.55);
        display: none;
        align-items: flex-start;
        justify-content: center;
        padding: 40px 16px;
        overflow-y: auto;
      }
      .overlay.open { display: flex; }
      .modal {
        width: 100%;
        max-width: 720px;
        background: var(--bg);
        border: 1px solid var(--border);
        border-radius: 12px;
        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
      }
      .modal-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 16px 18px;
        border-bottom: 1px solid var(--border);
        position: sticky;
        top: 0;
        background: var(--bg);
        border-radius: 12px 12px 0 0;
      }
      .modal-head h2 { margin: 0; font-size: 16px; }
      .modal-body { padding: 16px 18px; }
      .modal-foot {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 14px 18px;
        border-top: 1px solid var(--border);
        position: sticky;
        bottom: 0;
        background: var(--bg);
        border-radius: 0 0 12px 12px;
      }
      .modal-foot .spacer { flex: 1; }
      #editor-error { color: #ff6b6b; font-size: 13px; }

      .ed-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
      .ed-row input {
        background: var(--card);
        color: var(--text);
        border: 1px solid var(--border);
        border-radius: 7px;
        padding: 7px 9px;
        font-size: 13.5px;
        min-width: 0;
      }
      .ed-row input:focus { outline: none; border-color: var(--accent); }
      .ed-move {
        background: var(--card);
        color: var(--muted);
        border: 1px solid var(--border);
        border-radius: 7px;
        padding: 5px 6px;
        font-size: 12px;
        max-width: 160px;
        flex: 0 0 auto;
      }
      .ed-move:focus { outline: none; border-color: var(--accent); }

      .ed-tab {
        border: 1px solid var(--border);
        border-radius: 10px;
        padding: 12px;
        margin-bottom: 14px;
        background: var(--card);
      }
      .ed-tab > .ed-row .ed-tab-name { flex: 1; font-weight: 700; font-size: 14.5px; }
      .ed-topic {
        border: 1px solid var(--border);
        border-radius: 9px;
        padding: 10px;
        margin: 10px 0;
        background: var(--bg);
      }
      .ed-topic-icon { width: 52px; text-align: center; }
      .ed-topic-name { flex: 1; font-weight: 600; }
      .ed-feeds { margin: 8px 0 6px; }
      .ed-feed-name { flex: 0 0 30%; }
      .ed-feed-url { flex: 1; }
      .ed-feed-status {
        flex: 0 0 auto;
        width: 22px;
        text-align: center;
        font-size: 14px;
        cursor: pointer;
        color: var(--muted);
        user-select: none;
      }
      .ed-feed-status.ok { color: #3fb950; }
      .ed-feed-status.bad { color: #ff6b6b; }
      .ed-feed-status.checking { color: var(--muted); }

      .ed-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--muted); margin: 4px 0; }
      .btn {
        background: var(--card);
        color: var(--text);
        border: 1px solid var(--border);
        border-radius: 7px;
        padding: 6px 10px;
        font-size: 13px;
        cursor: pointer;
        line-height: 1;
      }
      .btn:hover { border-color: var(--border-hover); }
      .btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
      .btn-primary:hover { filter: brightness(1.08); }
      .btn-add { color: var(--accent); }
      .btn-del {
        flex: 0 0 auto;
        border: none;
        background: transparent;
        color: var(--muted);
        cursor: pointer;
        font-size: 16px;
        padding: 4px 6px;
        line-height: 1;
      }
      .btn-del:hover { color: #ff6b6b; }

      /* Suggested-feeds catalog */
      #catalog-overlay { z-index: 25; }
      #social-overlay { z-index: 25; }
      #social-input {
        background: var(--card);
        color: var(--text);
        border: 1px solid var(--border);
        border-radius: 7px;
        padding: 8px 9px;
        font-size: 13.5px;
      }

      #onboard-overlay { z-index: 50; }
      #feedback-overlay { z-index: 55; }
      .fb-form { display: flex; flex-direction: column; gap: 4px; }
      .fb-form select, .fb-form textarea, .fb-form input {
        background: var(--card); color: var(--text); border: 1px solid var(--border); border-radius: 7px;
        padding: 8px 10px; font: inherit; font-size: 14px; margin-bottom: 8px; width: 100%; box-sizing: border-box;
      }
      .fb-form textarea { resize: vertical; min-height: 120px; }
      .fb-form select:focus, .fb-form textarea:focus, .fb-form input:focus { outline: none; border-color: var(--accent); }
      .fb-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
      .fb-msg { font-size: 13px; min-height: 18px; color: var(--muted); }
      .fb-msg.err { color: #f85149; }
      .fb-alt { font-size: 12px; color: var(--muted); }
      .ob-lead { font-size: 14px; color: var(--muted); margin: 0 0 16px; line-height: 1.55; }
      .ob-lead b { color: var(--text); }
      .ob-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
      .ob-list li { display: flex; gap: 12px; align-items: flex-start; }
      .ob-ico { font-size: 20px; line-height: 1.2; flex: 0 0 auto; }
      .ob-list b { display: block; font-size: 14px; margin-bottom: 1px; }
      .ob-list span { color: var(--muted); font-size: 12.5px; line-height: 1.4; }
      .ob-list span b { display: inline; color: var(--text); font-weight: 600; } /* keep inline in the sentence */

      .wf { width: 100%; height: auto; display: block; margin: 2px 0 18px; }
      .wf-tab-on { fill: var(--accent); }
      .wf-tab { fill: var(--border); }
      .wf-col { fill: var(--card); stroke: var(--border); stroke-width: 1; }
      .wf-title { fill: var(--accent); opacity: 0.85; }
      .wf-thumb { fill: var(--border); }
      .wf-line { fill: var(--muted); opacity: 0.6; }
      .wf-line2 { fill: var(--muted); opacity: 0.32; }

      #admin-overlay { z-index: 50; }
      .ad-tabs { display: flex; gap: 8px; margin-bottom: 10px; }
      .ad-tab {
        background: none; border: 1px solid var(--border); color: var(--muted);
        border-radius: 999px; padding: 5px 12px; font-size: 12.5px; cursor: pointer;
      }
      .ad-tab.active { border-color: var(--accent); color: var(--accent); }
      .ad-table { width: 100%; border-collapse: collapse; font-size: 13px; }
      .ad-table th {
        text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: 0.4px;
        color: var(--muted); padding: 6px 8px; border-bottom: 1px solid var(--border);
      }
      .ad-table td { padding: 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
      .ad-stat-group { font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); margin: 14px 0 8px; }
      .ad-stat-group:first-child { margin-top: 0; }
      .ad-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
      .ad-stat { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; }
      .ad-stat-val { font-size: 24px; font-weight: 700; color: var(--text); line-height: 1.1; }
      .ad-stat-lbl { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
      .ad-stat-sub { font-size: 11px; color: var(--muted); margin-top: 3px; opacity: 0.85; }
      .ad-email { font-weight: 600; word-break: break-all; }
      .ad-sub { color: var(--muted); font-size: 11.5px; }
      .ad-badge {
        display: inline-block; font-size: 10.5px; padding: 1px 7px; border-radius: 999px;
        border: 1px solid var(--border); color: var(--muted); margin: 3px 4px 0 0;
      }
      .ad-badge.admin { border-color: var(--accent); color: var(--accent); }
      .ad-badge.locked { border-color: #ff6b6b; color: #ff6b6b; }
      .ad-actions { display: flex; flex-wrap: wrap; gap: 6px; }
      .ad-actions .btn { padding: 4px 8px; font-size: 12px; }
      .ad-danger { color: #ff6b6b; }
      .cat-group { margin-bottom: 14px; }
      .cat-feed { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--border); }
      .cat-feed:last-child { border-bottom: 0; }
      .cat-info { min-width: 0; }
      .cat-name { font-weight: 600; font-size: 14px; }
      .cat-url { font-size: 12px; color: var(--muted); }
      .cat-add { flex: 0 0 auto; }
      .cat-add.added { color: var(--muted); }
      .cat-topic {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
        text-align: left;
        background: var(--card);
        border: 1px solid var(--border);
        border-radius: 9px;
        padding: 13px 14px;
        margin-bottom: 8px;
        cursor: pointer;
        color: var(--text);
        font-size: 15px;
        font-weight: 600;
      }
      .cat-topic:hover { border-color: var(--border-hover); }
      .cat-count { color: var(--muted); font-weight: 400; font-size: 12.5px; }
      .cat-back { margin-bottom: 12px; }

      /* Tab bar */
      nav.tabs {
        flex: 0 0 auto;
        display: flex;
        gap: 6px;
        padding: 8px 20px 0;
        background: var(--header-bg);
        border-bottom: 1px solid var(--border);
        overflow-x: auto;
      }
      nav.tabs button {
        background: transparent;
        color: var(--muted);
        border: 1px solid transparent;
        border-bottom: none;
        border-radius: 8px 8px 0 0;
        padding: 8px 14px;
        font-size: 14px;
        font-weight: 600;
        cursor: pointer;
        white-space: nowrap;
      }
      nav.tabs button:hover { color: var(--text); }
      nav.tabs button.active {
        color: var(--text);
        background: var(--card);
        border-color: var(--border);
      }

      /* Columns: one per topic, side by side, each scrolls independently. */
      main {
        flex: 1 1 auto;
        min-height: 0;
        padding: 20px;
        overflow: hidden;
      }
      .columns {
        height: 100%;
        display: grid;
        grid-auto-flow: column;
        grid-auto-columns: minmax(320px, 1fr);
        gap: 18px;
        align-items: stretch;
      }
      .column {
        min-width: 0;
        min-height: 0;
        background: transparent;
        /* Own scroll region. */
        overflow-y: auto;
        padding-right: 4px;
      }
      .column-head {
        position: sticky;
        top: 0;
        z-index: 2;
        background: var(--col-head-bg);
        backdrop-filter: blur(8px);
        border-bottom: 1px solid var(--border);
        padding: 8px 4px;
        margin-bottom: 12px;
        display: flex;
        align-items: baseline;
        justify-content: space-between;
        gap: 8px;
      }
      .column-head h2 { margin: 0; font-size: 15px; letter-spacing: 0.3px; }
      .column-head .topic-icon { font-size: 16px; margin-right: 6px; }
      .column-head .count { color: var(--muted); font-size: 12px; }
      .column-head .unread-badge {
        display: inline-block;
        background: var(--accent);
        color: #fff;
        font-size: 11px;
        font-weight: 700;
        border-radius: 999px;
        padding: 1px 7px;
        margin-left: 6px;
        vertical-align: middle;
      }
      .column-head .unread-badge.hidden { display: none; }
      .column-head .col-meta { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
      .col-read-all {
        background: none; border: 1px solid var(--border); color: var(--muted);
        font-size: 11px; border-radius: 6px; padding: 2px 7px; cursor: pointer; white-space: nowrap;
      }
      .col-read-all:hover { border-color: var(--border-hover); color: var(--text); }
      .col-read-all.hidden { display: none; }
      /* Keyboard-navigation selection highlight */
      .item.kb-selected { outline: 2px solid var(--accent); outline-offset: 1px; border-radius: 8px; }

      .item {
        background: var(--card);
        border: 1px solid var(--border);
        border-radius: 10px;
        padding: 12px 14px;
        margin-bottom: 10px;
        transition: border-color 0.15s, opacity 0.15s;
        /* Text on the left, thumbnail on the right. */
        display: flex;
        gap: 12px;
        align-items: flex-start;
      }
      .item:hover { border-color: var(--border-hover); }
      .item.visited { opacity: 0.45; }
      .item.visited:hover { opacity: 0.7; }
      .item-body { flex: 1 1 auto; min-width: 0; }
      .thumb-link { flex: 0 0 auto; line-height: 0; }
      .thumb {
        display: block;
        width: 84px;
        height: 84px;
        object-fit: cover;
        border-radius: 8px;
        background: var(--border);
      }
      .item a.title-link { color: var(--text); text-decoration: none; font-weight: 600; font-size: 15px; }
      .site-icon { width: 14px; height: 14px; border-radius: 3px; vertical-align: -3px; margin-right: 5px; object-fit: contain; }
      .avatar-icon { width: 16px; height: 16px; border-radius: 50%; vertical-align: -4px; margin-right: 5px; object-fit: cover; }
      .item a:hover { color: var(--accent); }
      .meta { margin-top: 6px; font-size: 12px; color: var(--muted); display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
      .source { color: var(--accent); font-weight: 600; }
      /* Mark-as-unread: only shown once an item has been read (dimmed). */
      .mark-unread {
        display: none;
        background: none;
        border: none;
        color: var(--accent);
        cursor: pointer;
        font: inherit;
        font-size: 12px;
        padding: 0;
      }
      .mark-unread:hover { text-decoration: underline; }
      .item.visited .mark-unread { display: inline; }
      /* Save buttons: subtle chip when off, colored tint when on. */
      .save-btn {
        background: rgba(128, 128, 128, 0.14);
        border: 1px solid var(--border);
        border-radius: 6px;
        cursor: pointer;
        font-size: 13px;
        padding: 2px 7px;
        line-height: 1;
        opacity: 0.85;
        filter: grayscale(0.5);
      }
      .save-btn:hover { opacity: 1; filter: none; border-color: var(--border-hover); }
      .save-btn.on { opacity: 1; filter: none; }
      .readlater-toggle.on { background: rgba(76, 154, 255, 0.18); border-color: var(--accent); }
      .bookmark-toggle.on { background: rgba(245, 197, 24, 0.22); border-color: #f5c518; }
      #rl-count, #bm-count { opacity: 0.7; }

      /* Saved-items panel (Read Later / Bookmarks) */
      .saved-item { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--border); }
      .saved-item:last-child { border-bottom: 0; }
      .saved-thumb { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; flex: 0 0 auto; background: var(--border); }
      .saved-main { flex: 1 1 auto; min-width: 0; }
      .saved-remove { align-self: center; }
      .snippet { margin-top: 8px; color: var(--muted); font-size: 13.5px; }
      .empty { color: var(--muted); text-align: center; padding: 60px 0; }
      .col-empty { color: var(--muted); font-size: 13px; padding: 12px 4px; }

      /* Stack columns on narrow screens and let the whole page scroll. */
      @media (max-width: 720px) {
        body { overflow: auto; }
        main { overflow: visible; flex: 0 0 auto; }
        .columns { height: auto; grid-auto-flow: row; grid-auto-columns: auto; }
        .column { overflow-y: visible; }
      }
      /* Gamification */
      header { flex-wrap: wrap; row-gap: 8px; }
      .stats-chips { display: flex; gap: 6px; align-items: center; cursor: pointer; }
      .chip {
        display: inline-flex;
        align-items: center;
        gap: 4px;
        font-size: 13px;
        background: var(--card);
        border: 1px solid var(--border);
        border-radius: 999px;
        padding: 4px 10px;
        color: var(--text);
        white-space: nowrap;
      }
      .stats-chips:hover .chip { border-color: var(--border-hover); }
      .chip.streak-hot { border-color: #ff8c42; color: #ff8c42; }
      .chip .chip-ico { font-size: 14px; }

      .toasts {
        position: fixed;
        right: 16px;
        bottom: 16px;
        z-index: 40;
        display: flex;
        flex-direction: column;
        gap: 8px;
      }
      .toast {
        display: flex;
        gap: 10px;
        align-items: center;
        max-width: 300px;
        background: var(--card);
        border: 1px solid var(--border);
        border-left: 3px solid var(--accent);
        border-radius: 10px;
        padding: 10px 14px;
        box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
        animation: toastin 0.25s ease;
      }
      .toast .t-ico { font-size: 22px; }
      .toast .t-name { font-weight: 700; font-size: 14px; }
      .toast .t-desc { font-size: 12px; color: var(--muted); }
      .toast .t-close {
        margin-left: auto;
        align-self: flex-start;
        background: none;
        border: none;
        color: var(--muted);
        cursor: pointer;
        font-size: 15px;
        line-height: 1;
        padding: 0 2px;
      }
      .toast .t-close:hover { color: var(--text); }
      @keyframes toastin { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

      .stat-block { margin-bottom: 16px; }
      .level-bar { height: 8px; background: var(--border); border-radius: 999px; overflow: hidden; margin-top: 6px; }
      .level-bar > div { height: 100%; background: var(--accent); transition: width 0.3s; }
      .stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
      .stat-cell { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 12px; text-align: center; }
      .stat-cell .big { font-size: 22px; font-weight: 800; }
      .stat-cell .lbl { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; }
      .ach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin-top: 8px; }
      .ach { display: flex; gap: 8px; align-items: center; background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 10px; opacity: 0.4; }
      .ach.on { opacity: 1; border-color: var(--accent); }
      .ach .a-ico { font-size: 20px; }
      .ach .a-name { font-weight: 700; font-size: 13px; }
      .ach .a-desc { font-size: 11px; color: var(--muted); }
      #goal-input { background: var(--card); color: var(--text); border: 1px solid var(--border); border-radius: 7px; padding: 6px 8px; }

      .seo-hero { max-width: 820px; margin: 34px auto 6px; padding: 0 20px; text-align: center; }
      .seo-hero h1 { font-size: 30px; line-height: 1.2; margin: 0 0 12px; color: var(--text); }
      .seo-hero .seo-lede { color: var(--muted); font-size: 15.5px; line-height: 1.6; margin: 0 auto 16px; max-width: 680px; }
      .seo-features { list-style: none; padding: 0; margin: 16px auto; max-width: 620px; text-align: left; display: grid; gap: 9px; }
      .seo-features li { color: var(--text); font-size: 14.5px; line-height: 1.5; padding-left: 22px; position: relative; }
      .seo-features li::before { content: "›"; position: absolute; left: 6px; color: var(--accent); font-weight: 700; }
      .seo-cta { color: var(--muted); font-size: 14px; margin-top: 4px; }

      .plan-picker { display: flex; gap: 10px; margin-top: 12px; }
      .plan-card { flex: 1; text-align: left; background: var(--card); border: 1.5px solid var(--border); border-radius: 12px; padding: 12px 14px; cursor: pointer; color: var(--text); transition: border-color 0.15s, box-shadow 0.15s; }
      .plan-card:hover { border-color: var(--accent); }
      .plan-card.sel { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
      .plan-card .pc-name { font-size: 13px; color: var(--muted); }
      .plan-card .pc-price { font-size: 22px; font-weight: 700; margin-top: 2px; }
      .plan-card .pc-price span { font-size: 13px; font-weight: 500; color: var(--muted); }
      .plan-card .pc-sub { font-size: 12px; color: var(--accent); margin-top: 3px; }
      .pro-reason { margin: 0 0 12px; padding: 8px 12px; border-radius: 8px; border: 1px solid var(--accent); color: var(--text); font-size: 13px; }
      .pro-benefits { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
      .pro-benefits li { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; }
      .pro-benefits .pb-ico { font-size: 18px; line-height: 1.2; width: 22px; text-align: center; flex: none; }
      .pro-benefits .pb-detail { color: var(--muted); font-size: 12.5px; margin-top: 1px; }
      .sub-badge { display: inline-block; background: var(--accent); color: #fff; font-weight: 600; font-size: 13px; padding: 4px 10px; border-radius: 999px; margin-bottom: 8px; }
