/* Feed landing page: a Feed that describes Feed. Soft Dark with the Quiet Paper lavender by default. */
:root {
  --bg: #191b21; --panel: #1e2128; --raised: #242833; --line: #2d313c; --selected: #272b37;
  --text: #ece8df; --heading: #f6f3ec; --muted: #9c9da8; --faint: #6d6f7b;
  --accent: #c4bcf1; --accent-strong: #ada3f2; --accent-ink: #1b1a2e;
  --code-bg: #14161b; --shadow: 0 30px 80px -30px rgba(0,0,0,.7);
  --serif: "Instrument Serif", Georgia, serif; --sans: "Figtree", -apple-system, BlinkMacSystemFont, sans-serif; --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f3f0e9; --panel: #faf8f3; --raised: #ffffff; --line: #e2ded4; --selected: #ebe7f8;
  --text: #24252b; --heading: #171821; --muted: #6e6f7a; --faint: #a0a1ab;
  --accent: #7e73d8; --accent-strong: #6a5fd0; --accent-ink: #ffffff;
  --code-bg: #eeebe3; --shadow: 0 30px 80px -30px rgba(40,30,90,.25);
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font: 15px/1.55 var(--sans); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; overflow: hidden; position: relative; }
body::before { content: ""; position: fixed; inset: 0; pointer-events: none; opacity: .045; z-index: 0; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E"); }
button { color: inherit; cursor: pointer; border: 0; background: none; font: inherit; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
[hidden] { display: none !important; }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--accent); color: var(--accent-ink); padding: 8px 12px; border-radius: 8px; z-index: 100; }
.skip-link:focus { left: 8px; }
.icon-button { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 9px; color: var(--muted); transition: background .15s, color .15s; }
.icon-button:hover { background: var(--selected); color: var(--text); }
.icon-button.small { width: 30px; height: 30px; }
.icon-button[aria-pressed="true"] { color: var(--accent); }

/* three columns */
.feed-app { position: relative; z-index: 1; display: grid; grid-template-columns: 228px 372px minmax(0, 1fr); height: 100vh; height: 100dvh; }
.sidebar, .feed-list, .reader { min-height: 0; display: flex; flex-direction: column; }
.sidebar { background: var(--panel); border-right: 1px solid var(--line); padding: 18px 14px 16px; overflow: hidden; }
.feed-list { border-right: 1px solid var(--line); background: var(--bg); }
.reader { background: var(--bg); }

/* sidebar */
.sidebar-top { display: flex; align-items: center; justify-content: space-between; padding: 4px 10px 18px; }
.brand { display: inline-flex; align-items: center; gap: 9px; font-family: var(--serif); font-size: 1.35rem; color: var(--heading); letter-spacing: .005em; }
.brand img { border-radius: 6px; }
.close-sidebar { display: none; }
.nav-item { display: flex; align-items: center; gap: 11px; width: 100%; text-align: left; padding: 0 12px; min-height: 40px; border-radius: 10px; font-size: .9rem; color: var(--text); transition: background .15s; }
.nav-item:hover { background: var(--selected); }
.nav-item.active { background: var(--selected); color: var(--heading); font-weight: 600; }
.nav-item .navigation-symbol { display: inline-flex; width: 20px; justify-content: center; color: var(--muted); }
.nav-item.active .navigation-symbol { color: var(--accent); }
.nav-item small { margin-left: auto; font-size: .74rem; color: var(--muted); font-weight: 500; }
.source-section { margin-top: 22px; flex: 1; min-height: 0; display: flex; flex-direction: column; }
.source-section nav { overflow-y: auto; min-height: 0; padding-bottom: 6px; mask-image: linear-gradient(to bottom, #000 calc(100% - 28px), transparent); -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 28px), transparent); }
.nav-section-label { display: flex; align-items: center; justify-content: space-between; font-size: .76rem; color: var(--muted); margin: 0 12px 8px; letter-spacing: .02em; }
.section-hint { color: var(--faint); display: inline-flex; }
.source-item .agent-icon { width: 20px; height: 20px; }
.source-item.quiet { color: var(--muted); }
.source-item.quiet .agent-icon { opacity: .55; filter: saturate(.6); }
.agent-icon.maker { border-radius: 6px; background: transparent; }
.agent-icon.maker img { border-radius: 5px; }
.agent-icon.glyph { background: var(--selected); color: var(--accent); }
.article .hero-icon { width: 84px; height: 84px; border-radius: 20px; display: block; margin: 0 0 22px; box-shadow: var(--shadow); }
.sidebar-bottom { margin-top: auto; padding-top: 16px; }
.sidebar-bottom .nav-item { font-size: .86rem; color: var(--muted); }

/* agent icons */
.agent-icon { display: inline-flex; width: 20px; height: 20px; flex: 0 0 20px; align-items: center; justify-content: center; overflow: hidden; border-radius: 5px; background: #fff; }
.agent-icon img { width: 100%; height: 100%; object-fit: contain; }
.agent-icon.plain { background: transparent; }
.agent-icon .icon-dark { display: none; }
:root[data-theme="soft-dark"] .agent-icon .icon-light { display: none; }
:root[data-theme="soft-dark"] .agent-icon .icon-dark { display: block; }
.row-meta .agent-icon, .toolbar-source .agent-icon { width: 16px; height: 16px; flex-basis: 16px; }

/* list */
.list-header { display: flex; align-items: center; gap: 10px; padding: 22px 20px 6px; }
.list-header h1 { margin: 0; flex: 1; font-family: var(--serif); font-weight: 400; font-size: 1.85rem; color: var(--heading); letter-spacing: -.005em; }
.menu-button { display: none; }
.get-feed { display: inline-flex; align-items: center; height: 32px; padding: 0 13px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-size: .8rem; font-weight: 600; letter-spacing: .01em; transition: transform .15s, background .15s; }
.get-feed:hover { text-decoration: none; background: var(--accent-strong); transform: translateY(-1px); }
.list-filters { display: flex; align-items: center; justify-content: space-between; padding: 8px 20px 10px; color: var(--muted); font-size: .84rem; }
.routine-filter { display: inline-flex; align-items: center; gap: 8px; }
.refresh-icon { transition: transform .5s; }
.is-spinning { animation: spin .55s linear; }
@keyframes spin { to { transform: rotate(360deg); } }
.report-rows { flex: 1; overflow-y: auto; padding: 0 12px 12px; }
.date-heading { font-size: .8rem; font-weight: 600; color: var(--muted); margin: 8px 8px 6px; letter-spacing: .02em; }
.report-row { display: grid; grid-template-columns: 14px minmax(0, 1fr); gap: 8px; width: 100%; text-align: left; padding: 13px 10px 14px 8px; border-radius: 12px; border-bottom: 1px solid var(--line); transition: background .15s; animation: rise .5s cubic-bezier(.2,.7,.2,1) both; animation-delay: calc(var(--i, 0) * 45ms); }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.report-row:hover { background: var(--selected); }
.report-row.selected { background: var(--selected); border-bottom-color: transparent; }
.unread-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); margin-top: 7px; justify-self: center; transition: transform .2s, opacity .2s; }
.unread-dot.read { opacity: 0; transform: scale(.4); }
.row-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: .78rem; color: var(--muted); }
.row-meta > span { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.row-routine { color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.report-row h3 { margin: 5px 0 4px; font-size: 1.02rem; line-height: 1.3; color: var(--heading); font-weight: 600; }
.report-row.is-read h3 { font-weight: 500; color: var(--text); }
.read-label { font-size: .66rem; color: var(--faint); margin-left: 6px; font-weight: 400; }
.report-row p { margin: 0; font-size: .86rem; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.row-star { grid-column: 2; justify-self: end; color: var(--accent); margin-top: -18px; }
.list-empty { padding: 60px 24px; text-align: center; color: var(--muted); }
.list-empty h2 { font-family: var(--serif); font-weight: 400; font-size: 1.5rem; color: var(--heading); margin: 12px 0 6px; }
.list-empty p { margin: 0 auto; max-width: 30ch; font-size: .9rem; }
.list-footer { display: flex; justify-content: space-between; padding: 12px 20px 16px; font-size: .78rem; color: var(--muted); border-top: 1px solid var(--line); }

/* reader */
.reader-toolbar { display: flex; align-items: center; gap: 10px; padding: 18px 26px 10px; }
.back-button { display: none; align-items: center; gap: 6px; color: var(--muted); font-size: .9rem; padding: 6px 8px 6px 4px; border-radius: 8px; }
.toolbar-source { flex: 1; min-width: 0; display: inline-flex; align-items: center; justify-content: center; gap: 7px; font-size: .86rem; color: var(--muted); white-space: nowrap; }
.toolbar-source span { overflow: hidden; text-overflow: ellipsis; }
.toolbar-source b { color: var(--accent); font-weight: 600; }
.toolbar-actions { display: inline-flex; gap: 2px; }
.reader-scroll { flex: 1; overflow-y: auto; }
.article { max-width: 720px; margin: 0 auto; padding: 22px 40px 90px; animation: settle .45s cubic-bezier(.2,.7,.2,1) both; }
@keyframes settle { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.article h1 { font-family: var(--serif); font-weight: 400; font-size: clamp(2.2rem, 3.4vw, 3rem); line-height: 1.05; letter-spacing: -.01em; color: var(--heading); margin: 6px 0 14px; }
.article h1 em { font-style: italic; color: var(--accent); }
.article .article-meta { color: var(--muted); font-size: .88rem; margin-bottom: 30px; display: flex; gap: 10px; }
.article h2 { font-family: var(--serif); font-weight: 400; font-size: 1.65rem; color: var(--heading); margin: 40px 0 12px; letter-spacing: -.005em; }
.article p, .article li { font-size: 1.02rem; line-height: 1.65; }
.article p { margin: 0 0 16px; }
.article ul, .article ol { padding-left: 22px; margin: 0 0 18px; }
.article li { margin-bottom: 8px; }
.article li::marker { color: var(--accent); }
.article strong { color: var(--heading); font-weight: 600; }
.article code { font-family: var(--mono); font-size: .84em; background: var(--code-bg); padding: 2px 6px; border-radius: 6px; color: var(--text); }
.article pre { background: var(--code-bg); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; overflow-x: auto; margin: 0 0 20px; font-size: .84rem; line-height: 1.55; }
.article pre code { background: none; padding: 0; font-size: inherit; }
.article table { width: 100%; border-collapse: collapse; margin: 0 0 22px; font-size: .94rem; }
.article th, .article td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.article th { color: var(--muted); font-weight: 500; font-size: .8rem; letter-spacing: .02em; }
.article figure { margin: 26px 0 30px; }
.article figure img { width: 100%; height: auto; display: block; border-radius: 14px; border: 1px solid var(--line); box-shadow: var(--shadow); }
.article figcaption { font-size: .8rem; color: var(--muted); margin-top: 10px; text-align: center; }
.article blockquote { margin: 26px 0; padding: 4px 0 4px 20px; border-left: 2px solid var(--accent); color: var(--muted); font-family: var(--serif); font-size: 1.35rem; line-height: 1.35; font-style: italic; }
.article blockquote p { font-size: inherit; margin: 0 0 6px; }
.article .callout { display: flex; gap: 12px; align-items: flex-start; background: var(--raised); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin: 0 0 22px; font-size: .95rem; }
.article .callout .agent-icon { margin-top: 3px; }
.article .actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 24px 0 8px; }
.article .actions a { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 999px; border: 1px solid var(--line); color: var(--text); font-weight: 500; font-size: .92rem; transition: border-color .15s, background .15s; }
.article .actions a:hover { text-decoration: none; border-color: var(--accent); background: var(--selected); }
.article .actions a.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.article .actions a.primary:hover { background: var(--accent-strong); }
.article .sources-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; margin: 0 0 22px; }
.article .sources-grid span { display: inline-flex; align-items: center; gap: 8px; font-size: .88rem; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; }
.comment-box { margin-top: 36px; padding-top: 26px; border-top: 1px solid var(--line); }
.comment-box h2 { font-size: .9rem; font-family: var(--sans); font-weight: 600; color: var(--muted); margin: 0 0 14px; }
.comment-box .comment { display: flex; gap: 12px; align-items: flex-start; }
.comment-box .avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--selected); color: var(--muted); display: inline-flex; align-items: center; justify-content: center; font-size: .75rem; font-weight: 600; flex: 0 0 30px; }
.comment-box .bubble { flex: 1; background: var(--raised); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; font-size: .94rem; color: var(--muted); }

/* toast */
.toast { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); background: var(--heading); color: var(--bg); padding: 10px 16px; border-radius: 999px; font-size: .86rem; font-weight: 500; box-shadow: var(--shadow); z-index: 60; animation: rise .3s both; }

/* modal */
.modal-scrim { position: fixed; inset: 0; background: rgba(10,10,14,.55); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); display: grid; place-items: center; padding: 20px; z-index: 50; }
.modal { width: min(560px, 100%); max-height: 92vh; overflow-y: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 24px 28px 28px; box-shadow: var(--shadow); animation: settle .3s both; }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.modal-head h2 { margin: 0; font-size: 1.15rem; font-weight: 600; color: var(--heading); }
.settings-tabs { display: flex; gap: 20px; border-bottom: 1px solid var(--line); margin-bottom: 26px; }
.settings-tabs button { padding: 9px 0 13px; font-size: .86rem; color: var(--muted); border-bottom: 2px solid transparent; }
.settings-tabs button.selected { color: var(--text); border-bottom-color: var(--accent); }
.modal h3 { margin: 0 0 6px; font-size: 1.05rem; color: var(--heading); }
.muted { color: var(--muted); margin: 0 0 18px; font-size: .92rem; }
.theme-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.theme-option { display: flex; flex-direction: column; gap: 10px; padding: 8px; border: 1px solid var(--line); border-radius: 12px; text-align: left; font-size: .86rem; }
.theme-option.chosen { border-color: var(--accent); background: var(--selected); }
.theme-preview { display: grid; grid-template-columns: 22% 32% 1fr; gap: 3px; height: 74px; border-radius: 8px; padding: 6px; overflow: hidden; }
.theme-preview span { border-radius: 4px; }
.preview-light { background: #f3f0e9; } .preview-light .preview-nav { background: #e6e2d9; } .preview-light .preview-list i, .preview-light .preview-article i { background: #d9d5cc; } .preview-light .preview-article b { background: #7e73d8; }
.preview-soft-dark { background: #191b21; } .preview-soft-dark .preview-nav { background: #262a34; } .preview-soft-dark .preview-list i, .preview-soft-dark .preview-article i { background: #3a3f4c; } .preview-soft-dark .preview-article b { background: #c4bcf1; }
.preview-system { background: linear-gradient(90deg, #f3f0e9 50%, #191b21 50%); } .preview-system .preview-nav { background: #e6e2d9; } .preview-system .preview-list i { background: #d9d5cc; } .preview-system .preview-article i { background: #3a3f4c; } .preview-system .preview-article b { background: #c4bcf1; }
.preview-list, .preview-article { display: flex; flex-direction: column; gap: 4px; padding: 3px 0; }
.preview-list i, .preview-article i { display: block; height: 6px; } .preview-article b { display: block; height: 9px; }
.theme-caption { padding: 0 4px 2px; }
.settings-note { margin: 16px 0 0; font-size: .8rem; color: var(--muted); }
.tab-about { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 10px 0 4px; }
.about-icon { width: 76px; height: 76px; }
.tab-about h3 { margin: 18px 0 6px; font-size: 1.15rem; display: flex; align-items: baseline; gap: 8px; }
.about-version { font-size: .78rem; font-weight: 400; color: var(--muted); }
.about-line { margin: 0; color: var(--muted); font-size: .92rem; }
.about-links { display: flex; gap: 12px; margin: 26px 0 0; }
.about-links a { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 50%; color: var(--text); transition: border-color .15s, background .15s; }
.about-links a:hover { border-color: var(--accent); background: var(--selected); text-decoration: none; }
.about-sign { margin: 30px 0 0; font-size: .8rem; color: var(--muted); }

/* responsive, like the app */
@media (max-width: 1080px) { .feed-app { grid-template-columns: 200px 320px minmax(0, 1fr); } .article { padding: 22px 28px 80px; } }
@media (max-width: 980px) {
  .feed-app { grid-template-columns: 340px minmax(0, 1fr); }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 250px; z-index: 55; transform: translateX(-100%); transition: transform .25s cubic-bezier(.2,.7,.2,1); box-shadow: none; }
  .sidebar-open .sidebar { transform: none; box-shadow: var(--shadow); }
  .sidebar-scrim { position: fixed; inset: 0; background: rgba(10,10,14,.4); z-index: 54; }
  .close-sidebar, .menu-button { display: inline-flex; }
}
@media (max-width: 760px) {
  .feed-app { grid-template-columns: minmax(0, 1fr); }
  .reader { display: none; }
  .has-selection .reader { display: flex; }
  .has-selection .feed-list { display: none; }
  .back-button { display: inline-flex; }
  .reader-toolbar { padding: 14px 12px 6px; }
  .toolbar-source span { display: none; }
  .article { padding: 14px 20px 70px; }
  .article h1 { font-size: 2.1rem; }
  .theme-options { grid-template-columns: 1fr; }
  .list-header { padding: 18px 12px 4px; } .list-filters, .list-footer { padding-left: 14px; padding-right: 14px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
