/**
 * Fold Reader CSS Design System
 * News/RSS reader with newspaper editorial design
 * Single CSS file, no framework dependencies
 */

/* =========================================================================
   1. FONT IMPORTS
   ========================================================================= */

@import url('https://fonts.googleapis.com/css2?family=Newsreader:ital,wght@0,400;0,600;0,700;1,400;1,600;1,700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&display=swap');

/* =========================================================================
   2. RESET & BASE
   ========================================================================= */

* {
  box-sizing: border-box;
}

html,
body,
div,
span,
applet,
object,
iframe,
h1,
h2,
h3,
h4,
h5,
h6,
p,
blockquote,
pre,
a,
abbr,
acronym,
address,
big,
cite,
code,
del,
dfn,
em,
img,
ins,
kbd,
q,
s,
samp,
small,
strike,
strong,
sub,
sup,
tt,
var,
b,
u,
i,
center,
dl,
dt,
dd,
ol,
ul,
li,
fieldset,
form,
label,
legend,
table,
caption,
tbody,
tfoot,
thead,
tr,
th,
td,
article,
aside,
canvas,
details,
embed,
figure,
figcaption,
footer,
header,
hgroup,
main,
mark,
meter,
nav,
output,
progress,
section,
summary,
time,
video {
  margin: 0;
  padding: 0;
  border: 0;
  font-size: 100%;
  font: inherit;
  vertical-align: baseline;
}

article,
aside,
details,
figcaption,
figure,
footer,
header,
hgroup,
main,
menu,
nav,
section {
  display: block;
}

body {
  line-height: 1;
}

ol,
ul {
  list-style: none;
}

blockquote,
q {
  quotes: none;
}

blockquote:before,
blockquote:after,
q:before,
q:after {
  content: '';
  content: none;
}

table {
  border-collapse: collapse;
  border-spacing: 0;
}

a {
  text-decoration: none;
  color: inherit;
}

button {
  border: none;
  cursor: pointer;
  font-family: inherit;
  background: none;
}

input,
textarea,
select {
  font-family: inherit;
}

/* =========================================================================
   3. CUSTOM PROPERTIES (DESIGN TOKENS)
   ========================================================================= */

:root {
  /* Colors - Background */
  --bg: #FAF9F7;
  --bg2: #F3F4F1;
  --bg3: #EDEEEB;
  --bg4: #E6E9E6;

  /* Colors - Text/Ink */
  --ink: #2F3331;
  --ink2: #5C605D;
  --ink3: #777C79;
  --ink4: #AFB3B0;

  /* Colors - Brand & Semantic */
  --primary: #4E6073;
  --primary-dim: #425467;
  --primary-light: #D1E4FB;
  --tertiary: #4E6454;
  --tertiary-light: #E1FAE4;
  --error: #9F403D;

  /* Typography - Font Families */
  --font-serif: 'Newsreader', serif;
  --font-sans: 'Inter', sans-serif;
  --font-mono: 'Courier New', monospace;

  /* Spacing Scale */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 12px;
  --space-base: 16px;
  --space-lg: 20px;
  --space-xl: 24px;
  --space-2xl: 32px;
  --space-3xl: 36px;
  --space-4xl: 48px;
  --space-5xl: 60px;
  --space-6xl: 80px;

  /* Layout Dimensions */
  --layout-max-width: 1440px;
  --layout-frame-radius: 10px;
  --layout-top-bar-height: 52px;
  --layout-sidebar-width: 200px;
  --layout-reading-panel-width: 420px;
  --layout-min-height: 820px;
  --layout-mobile-breakpoint: 768px;

  /* Shadows */
  --shadow-frame: 0 8px 48px rgba(0, 0, 0, 0.18), 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-card: 2px 4px 12px rgba(0, 0, 0, 0.1);
  --shadow-card-mobile: 2px 3px 8px rgba(0, 0, 0, 0.1);

  /* Border Radius */
  --radius-sm: 2px;
  --radius-md: 4px;
  --radius-full: 8px;
  --radius-circle: 50%;

  /* Transitions */
  --transition-fast: 0.12s ease-out;
  --transition-base: 0.2s ease-out;

  /* Z-Index Scale */
  --z-bottom: -1;
  --z-base: 0;
  --z-dropdown: 10;
  --z-sticky: 20;
  --z-modal: 100;
  --z-tooltip: 110;
}

/* =========================================================================
   3.5. CSS VARIABLE ALIASES
   (Maps template variant names to design system variables)
   ========================================================================= */

:root {
  /* Feed/Article template aliases */
  --bg-primary: var(--bg);
  --bg-2: var(--bg2);
  --bg-3: var(--bg3);
  --ink-primary: var(--ink);
  --ink-2: var(--ink2);
  --ink-3: var(--ink3);
  --ink-4: var(--ink4);
  --accent-primary: var(--primary);

  /* Reading panel template aliases */
  --bg0: var(--bg);
  --ink0: var(--ink);
  --ink1: var(--ink);
  --ink-divider: var(--bg4);

  /* Auth template aliases */
  --color-bg: var(--bg);
  --color-bg-surface: #FFFFFF;
  --color-bg3: var(--bg2);
  --color-primary: var(--primary);
  --color-primary-dark: var(--primary-dim);
  --color-primary-darker: #374a5c;
  --color-ink1: var(--ink);
  --color-ink2: var(--ink2);
  --color-ink3: var(--ink3);
  --color-border: var(--bg4);
  --color-error: var(--error);
  --color-success: var(--tertiary);
}

/* =========================================================================
   4. GLOBAL TYPOGRAPHY
   ========================================================================= */

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-serif);
  font-size: 14px;
  line-height: 1.75;
  color: var(--ink);
  background-color: var(--bg);
}

/* Headings */

h1,
.h1 {
  font-family: var(--font-serif);
  font-size: 36px;
  font-weight: 700;
  font-style: italic;
  line-height: 1.2;
  color: var(--ink);
}

h2,
.h2 {
  font-family: var(--font-serif);
  font-size: 28px;
  font-weight: 700;
  font-style: italic;
  line-height: 1.25;
  color: var(--ink);
}

h3,
.h3 {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 600;
  font-style: italic;
  line-height: 1.3;
  color: var(--ink);
}

h4,
.h4 {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--ink);
}

h5,
.h5 {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--ink);
}

h6,
.h6 {
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--ink);
}

p {
  font-family: var(--font-serif);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.75;
  color: var(--ink2);
  margin-bottom: var(--space-lg);
}

/* UI Labels */

.label,
.label-sm,
label {
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 300;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink3);
}

.label-md {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 300;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink3);
}

.label-lg {
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink3);
}

/* Metadata & Timestamps */

.meta,
.metadata {
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 300;
  color: var(--ink3);
}

.timestamp {
  font-family: var(--font-sans);
  font-size: 9px;
  font-weight: 300;
  color: var(--ink4);
}

/* Code */

code,
pre {
  font-family: var(--font-mono);
  font-size: 13px;
  background-color: var(--bg3);
  color: var(--ink);
}

code {
  padding: 2px 6px;
  border-radius: var(--radius-sm);
}

pre {
  padding: var(--space-lg);
  border-radius: var(--radius-md);
  overflow-x: auto;
  margin-bottom: var(--space-lg);
}

pre code {
  padding: 0;
  background: none;
}

/* Inline elements */

strong,
b {
  font-weight: 600;
}

em,
i {
  font-style: italic;
}

/* Links */

a {
  color: var(--primary);
  text-decoration: underline;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--primary-dim);
}

a:active {
  color: var(--primary-dim);
}

/* Utility Classes */

.uppercase-label {
  font-family: var(--font-sans);
  font-size: 9px;
  font-weight: 300;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink3);
}

.text-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* =========================================================================
   5. LAYOUT
   ========================================================================= */

.app-frame {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: var(--layout-max-width);
  min-height: var(--layout-min-height);
  margin: 0 auto;
  background-color: var(--bg);
  border-radius: var(--layout-frame-radius);
  box-shadow: var(--shadow-frame);
  overflow: hidden;
}

.app-container {
  display: flex;
  flex: 1;
  overflow: hidden;
}

.top-bar {
  height: var(--layout-top-bar-height);
  background-color: var(--bg);
  border-bottom: 1px solid var(--bg4);
  flex-shrink: 0;
  z-index: var(--z-sticky);
}

.sidebar {
  width: var(--layout-sidebar-width);
  background-color: var(--bg);
  border-right: 1px solid var(--bg4);
  overflow-y: auto;
  overflow-x: hidden;
  flex-shrink: 0;
}

.main-content {
  flex: 1;
  display: flex;
  overflow: hidden;
}

.feed-panel {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  background-color: var(--bg);
}

.reading-panel {
  width: var(--layout-reading-panel-width);
  background-color: var(--bg);
  border-left: 1px solid var(--bg4);
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  z-index: var(--z-dropdown);
}

/* Scrollbar Styling */

.sidebar::-webkit-scrollbar,
.feed-panel::-webkit-scrollbar,
.reading-panel::-webkit-scrollbar {
  width: 4px;
}

.sidebar::-webkit-scrollbar-track,
.feed-panel::-webkit-scrollbar-track,
.reading-panel::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar::-webkit-scrollbar-thumb,
.feed-panel::-webkit-scrollbar-thumb,
.reading-panel::-webkit-scrollbar-thumb {
  background-color: var(--bg4);
  border-radius: 2px;
}

.sidebar::-webkit-scrollbar-thumb:hover,
.feed-panel::-webkit-scrollbar-thumb:hover,
.reading-panel::-webkit-scrollbar-thumb:hover {
  background-color: var(--ink4);
}

/* =========================================================================
   6. TOP BAR
   ========================================================================= */

.top-bar {
  display: flex;
  align-items: center;
  padding: 0 var(--space-3xl);
  gap: var(--space-2xl);
}

/* Traffic Light Dots */

.traffic-lights {
  display: flex;
  gap: 8px;
  align-items: center;
}

.traffic-light {
  width: 11px;
  height: 11px;
  border-radius: var(--radius-circle);
}

.traffic-light.red {
  background-color: #ff5f57;
}

.traffic-light.amber {
  background-color: #febc2e;
}

.traffic-light.green {
  background-color: #28c840;
}

/* Wordmark */

.wordmark {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 700;
  font-style: italic;
  color: var(--primary);
  line-height: 1;
}

/* Domain Label */

.domain-label {
  font-family: var(--font-sans);
  font-size: 9px;
  font-weight: 300;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink4);
}

/* Navigation Tabs */

.nav-tabs {
  display: flex;
  gap: var(--space-2xl);
  margin-left: auto;
  margin-right: var(--space-2xl);
}

.nav-tab {
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 300;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink3);
  padding-bottom: 2px;
  border-bottom: 2px solid transparent;
  transition: color var(--transition-fast), border-color var(--transition-fast);
  cursor: pointer;
}

.nav-tab:hover {
  color: var(--ink2);
}

.nav-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* Search Bar */

.search-bar {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: 8px 12px;
  background-color: var(--bg2);
  border-radius: var(--radius-md);
  margin-right: var(--space-lg);
  flex: 0 0 200px;
}

.search-input {
  flex: 1;
  border: none;
  background: none;
  font-family: var(--font-serif);
  font-size: 14px;
  color: var(--ink);
  outline: none;
}

.search-input::placeholder {
  color: var(--ink4);
}

/* Avatar */

.avatar {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-circle);
  background-color: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  flex-shrink: 0;
  cursor: pointer;
  transition: background-color var(--transition-fast);
}

.avatar:hover {
  background-color: var(--primary-dim);
}

/* =========================================================================
   7. SIDEBAR
   ========================================================================= */

.sidebar-section {
  margin-bottom: var(--space-2xl);
}

.sidebar-section-label {
  font-family: var(--font-sans);
  font-size: 9px;
  font-weight: 300;
  text-transform: uppercase;
  letter-spacing: 0.20em;
  color: var(--ink4);
  padding: var(--space-lg) var(--space-xl);
  padding-bottom: var(--space-md);
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 34px;
  padding: 8px 20px;
  cursor: pointer;
  transition: background-color var(--transition-fast);
}

.sidebar-item:hover {
  background-color: var(--bg2);
}

.sidebar-item.active {
  background-color: var(--bg2);
}

.source-dot {
  width: 6px;
  height: 6px;
  border-radius: var(--radius-circle);
  flex-shrink: 0;
}

.sidebar-item-label {
  flex: 1;
  font-family: var(--font-serif);
  font-size: 14px;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-item-count {
  font-family: var(--font-sans);
  font-size: 8px;
  font-weight: 500;
  background-color: var(--primary);
  color: white;
  padding: 1px 6px;
  border-radius: 8px;
  min-width: 20px;
  text-align: center;
  flex-shrink: 0;
}

.add-source-link {
  display: block;
  padding: var(--space-base) var(--space-xl);
  font-family: var(--font-sans);
  font-size: 9px;
  font-weight: 300;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--primary);
  cursor: pointer;
  transition: color var(--transition-fast);
  margin-left: var(--space-xl);
  margin-right: var(--space-xl);
}

.add-source-link:hover {
  color: var(--primary-dim);
}

/* =========================================================================
   8. ARTICLE ROW (DESKTOP)
   ========================================================================= */

.article-row {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: var(--space-lg);
  padding: var(--space-2xl) var(--space-3xl);
  border-bottom: 0.5px solid rgba(175, 179, 176, 0.14);
  cursor: pointer;
  transition: background-color var(--transition-fast);
}

.article-row:hover {
  background-color: var(--bg2);
}

/* Unread Indicator */

.article-unread-dot {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 5px;
  height: 5px;
  border-radius: var(--radius-circle);
  background-color: var(--primary);
  flex-shrink: 0;
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.article-row.unread .article-unread-dot {
  opacity: 1;
}

/* Article Content */

.article-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.article-meta {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}

.article-source-dot {
  width: 7px;
  height: 7px;
  border-radius: var(--radius-circle);
  flex-shrink: 0;
}

.article-source {
  font-family: var(--font-sans);
  font-size: 9px;
  font-weight: 300;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink3);
}

.article-timestamp {
  font-family: var(--font-sans);
  font-size: 9px;
  font-weight: 300;
  color: var(--ink4);
  margin-left: auto;
}

.article-title {
  font-family: var(--font-serif);
  font-size: 19px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--ink);
  max-width: 560px;
}

.article-excerpt {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--ink2);
  max-width: 540px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Article Thumbnail */

.article-thumbnail {
  width: 72px;
  height: 54px;
  border-radius: var(--radius-sm);
  background-color: var(--bg3);
  flex-shrink: 0;
  object-fit: cover;
}

/* =========================================================================
   9. ARTICLE ROW (MOBILE)
   ========================================================================= */

@media (max-width: 767px) {
  .article-row {
    padding: 16px 20px;
    gap: var(--space-md);
  }

  .article-unread-dot {
    left: 8px;
    width: 4px;
    height: 4px;
  }

  .article-meta {
    gap: var(--space-md);
  }

  .article-source-dot {
    width: 6px;
    height: 6px;
  }

  .article-source {
    font-size: 9px;
    letter-spacing: 0.12em;
  }

  .article-title {
    font-size: 16px;
    line-height: 1.3;
  }

  .article-excerpt {
    font-family: var(--font-sans);
    font-size: 11px;
    color: var(--ink3);
    margin-top: 5px;
  }

  .article-thumbnail {
    width: 60px;
    height: 46px;
  }
}

/* =========================================================================
   10. DATE DIVIDER
   ========================================================================= */

.date-divider {
  position: sticky;
  top: 0;
  padding: var(--space-lg) var(--space-3xl);
  background-color: var(--bg2);
  font-family: var(--font-sans);
  font-size: 9px;
  font-weight: 300;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink4);
  border-bottom: 0.5px solid var(--bg4);
  z-index: var(--z-sticky);
}

@media (max-width: 767px) {
  .date-divider {
    padding: var(--space-md) var(--space-lg);
  }
}

/* =========================================================================
   11. READING PANEL (DESKTOP)
   ========================================================================= */

.reading-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-lg) var(--space-xl);
  border-bottom: 1px solid var(--bg4);
  gap: var(--space-md);
  flex-shrink: 0;
  background-color: var(--bg);
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
}

.reading-panel-actions {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.reading-panel-action {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background-color var(--transition-fast);
  font-size: 16px;
}

.reading-panel-action:hover {
  background-color: var(--bg2);
}

.reading-panel-progress {
  position: absolute;
  left: 0;
  top: 0;
  height: 2px;
  background-color: var(--tertiary);
  opacity: 0.4;
}

.reading-panel-content {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-xl);
}

.article-headline {
  font-family: var(--font-serif);
  font-size: 26px;
  font-weight: 700;
  line-height: 1.25;
  color: var(--ink);
  margin-bottom: var(--space-lg);
}

.article-deck {
  font-family: var(--font-serif);
  font-size: 15px;
  font-style: italic;
  line-height: 1.5;
  color: var(--ink2);
  border-left: 2px solid var(--primary-light);
  padding-left: var(--space-md);
  margin-bottom: var(--space-xl);
}

.featured-image {
  width: 100%;
  height: 150px;
  border-radius: var(--radius-sm);
  background-color: var(--bg3);
  object-fit: cover;
  margin-bottom: var(--space-xl);
}

.article-body {
  font-family: var(--font-serif);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.75;
  color: var(--ink2);
}

.article-body p {
  margin-bottom: var(--space-lg);
}

.article-body p:first-child::first-letter {
  font-size: 48px;
  float: left;
  line-height: 1;
  padding-right: 8px;
  color: var(--primary);
}

.pullquote {
  border-left: 3px solid var(--primary);
  background-color: var(--bg2);
  padding: var(--space-lg);
  margin: var(--space-xl) 0;
  font-family: var(--font-serif);
  font-size: 18px;
  font-style: italic;
  line-height: 1.5;
  color: var(--ink);
}

.pullquote-cite {
  font-family: var(--font-sans);
  font-size: 9px;
  font-weight: 300;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink3);
  margin-top: var(--space-md);
}

/* =========================================================================
   12. READING VIEW (MOBILE)
   ========================================================================= */

@media (max-width: 767px) {
  .reading-panel {
    width: 100%;
    height: 100%;
    position: fixed;
    top: 0;
    left: 0;
    z-index: var(--z-modal);
  }

  .reading-panel-header {
    padding: var(--space-lg) var(--space-lg);
  }

  .reading-panel-content {
    padding: var(--space-lg) var(--space-lg) var(--space-5xl) var(--space-lg);
  }

  .article-headline {
    font-size: 24px;
    line-height: 1.25;
  }

  .article-deck {
    font-size: 14px;
    border-left: 2px solid var(--primary-light);
    padding-left: var(--space-md);
  }

  .featured-image {
    height: 130px;
  }

  .article-body {
    font-size: 15px;
    color: var(--ink2);
  }

  .pullquote {
    font-size: 17px;
  }
}

/* =========================================================================
   13. DISCOVER PAGE
   ========================================================================= */

.discover-container {
  display: grid;
  grid-template-columns: 4fr 8fr;
  gap: var(--space-2xl);
  padding: var(--space-3xl);
}

.discover-sidebar {
  position: sticky;
  top: var(--space-3xl);
  height: fit-content;
}

.discover-category-name {
  font-family: var(--font-serif);
  font-size: 28px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--ink);
  margin-bottom: var(--space-lg);
}

.discover-category-description {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 400;
  line-height: 1.6;
  color: var(--ink3);
}

.discover-sources-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2xl);
}

.source-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-lg);
}

.source-logo {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background-color: var(--bg3);
  flex-shrink: 0;
  object-fit: cover;
}

.source-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.source-name {
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--ink);
}

.source-meta {
  font-family: var(--font-sans);
  font-size: 9px;
  font-weight: 300;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink3);
}

.follow-button {
  padding: 6px 18px;
  font-family: var(--font-sans);
  font-size: 9px;
  font-weight: 300;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--primary);
  background-color: transparent;
  border: 1px solid var(--primary);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.follow-button:hover {
  background-color: var(--primary);
  color: white;
}

.follow-button.following {
  background-color: var(--tertiary-light);
  color: var(--tertiary);
  border-color: var(--tertiary-light);
}

.follow-button.following:hover {
  background-color: transparent;
  color: var(--tertiary);
}

/* Mobile Discover */

@media (max-width: 767px) {
  .discover-container {
    grid-template-columns: 1fr;
    gap: var(--space-base);
    padding: var(--space-lg);
  }

  .discover-sidebar {
    position: static;
  }

  .search-discover {
    width: 100%;
    padding: 12px 16px;
    background-color: var(--bg2);
    border: 1px solid var(--bg4);
    border-radius: var(--radius-md);
    font-family: var(--font-serif);
    font-size: 14px;
    font-style: italic;
    color: var(--ink);
    margin-bottom: var(--space-lg);
  }

  .search-discover::placeholder {
    color: var(--ink4);
  }

  .category-pills {
    display: flex;
    gap: var(--space-md);
    overflow-x: auto;
    padding: var(--space-lg) 0;
    margin-bottom: var(--space-lg);
  }

  .category-pill {
    padding: 8px 16px;
    background-color: var(--bg2);
    border: none;
    border-radius: 20px;
    font-family: var(--font-sans);
    font-size: 9px;
    font-weight: 300;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--ink3);
    white-space: nowrap;
    cursor: pointer;
    transition: all var(--transition-fast);
    flex-shrink: 0;
  }

  .category-pill.active {
    background-color: var(--ink);
    color: white;
  }

  .source-item {
    padding: var(--space-base) 0;
    border-bottom: 0.5px solid var(--bg4);
  }

  .source-logo {
    width: 40px;
    height: 40px;
  }

  .source-name {
    font-size: 16px;
  }

  .follow-button {
    padding: 5px 12px;
    font-size: 8px;
  }
}

/* =========================================================================
   14. LIBRARY PAGE
   ========================================================================= */

.library-container {
  padding: var(--space-3xl);
}

.library-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, 110px);
  gap: var(--space-2xl);
}

.book-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  box-shadow: var(--shadow-card);
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.book-card:hover {
  transform: translateY(-4px);
  box-shadow: 2px 6px 16px rgba(0, 0, 0, 0.12);
}

.book-cover {
  position: relative;
  width: 110px;
  aspect-ratio: 3 / 4;
  background-color: var(--bg3);
  object-fit: cover;
}

.book-cover::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 12px;
  height: 100%;
  background: linear-gradient(90deg, rgba(47, 51, 49, 0.08) 0%, transparent 100%);
  pointer-events: none;
}

.book-card-content {
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.book-source-badge {
  display: inline-block;
  background-color: var(--tertiary-light);
  color: var(--tertiary);
  font-family: var(--font-sans);
  font-size: 9px;
  font-weight: 300;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 2px 6px;
  border-radius: var(--radius-full);
  width: fit-content;
}

.book-title {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--ink);
}

.book-date-saved {
  font-family: var(--font-sans);
  font-size: 9px;
  font-weight: 300;
  font-style: italic;
  color: var(--ink3);
}

.book-excerpt {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 400;
  line-height: 1.4;
  color: var(--ink3);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Mobile Library */

@media (max-width: 767px) {
  .library-container {
    padding: var(--space-lg);
  }

  .library-grid {
    grid-template-columns: repeat(auto-fill, 72px);
    gap: var(--space-lg);
  }

  .book-cover {
    width: 72px;
  }

  .book-cover::before {
    width: 8px;
    background: linear-gradient(90deg, rgba(47, 51, 49, 0.07) 0%, transparent 100%);
  }

  .book-source-badge {
    font-size: 8px;
    padding: 1px 4px;
  }

  .book-title {
    font-size: 14px;
  }

  .book-date-saved {
    font-size: 9px;
  }

  .book-excerpt {
    font-size: 9px;
  }

  .offline-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background-color: var(--tertiary-light);
    color: var(--tertiary);
    font-family: var(--font-sans);
    font-size: 8px;
    font-weight: 300;
    text-transform: uppercase;
    padding: 2px 6px;
    border-radius: var(--radius-full);
    width: fit-content;
  }

  .read-time {
    font-family: var(--font-sans);
    font-size: 9px;
    font-weight: 300;
    color: var(--ink4);
  }
}

/* =========================================================================
   15. SOURCES PAGE
   ========================================================================= */

.sources-container {
  padding: var(--space-3xl);
}

.sources-table {
  width: 100%;
  border-collapse: collapse;
}

.sources-table-header {
  display: grid;
  grid-template-columns: 40px 1fr 100px 80px 80px;
  gap: var(--space-lg);
  padding: var(--space-lg) 0;
  border-bottom: 1px solid var(--bg4);
  align-items: center;
}

.sources-table-header-cell {
  font-family: var(--font-sans);
  font-size: 9px;
  font-weight: 300;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink4);
}

.sources-table-row {
  display: grid;
  grid-template-columns: 40px 1fr 100px 80px 80px;
  gap: var(--space-lg);
  padding: var(--space-lg) 0;
  border-bottom: 0.5px solid var(--bg4);
  align-items: center;
  cursor: pointer;
  transition: background-color var(--transition-fast);
}

.sources-table-row:hover {
  background-color: var(--bg2);
}

.source-number {
  font-family: var(--font-serif);
  font-size: 28px;
  font-weight: 400;
  font-style: italic;
  color: var(--ink4);
  text-align: right;
  padding-right: var(--space-md);
}

.source-info-col {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.source-status-dot {
  width: 4px;
  height: 4px;
  border-radius: var(--radius-circle);
  flex-shrink: 0;
}

.source-status-dot.live {
  background-color: #28c840;
}

.source-status-dot.slow {
  background-color: #febc2e;
}

.source-status-dot.offline {
  background-color: var(--error);
}

.source-info-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.source-name-table {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--ink);
}

.source-frequency {
  font-family: var(--font-sans);
  font-size: 9px;
  font-weight: 300;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink3);
}

.source-last-published {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 300;
  color: var(--ink3);
  text-align: right;
}

.source-new-count {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 400;
  color: var(--primary);
  text-align: center;
}

.source-new-count.zero {
  color: var(--ink4);
}

.unfollow-button {
  padding: 6px 12px;
  font-family: var(--font-sans);
  font-size: 9px;
  font-weight: 300;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink4);
  background-color: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: center;
}

.unfollow-button:hover {
  color: var(--error);
}

/* Mobile Sources */

@media (max-width: 767px) {
  .sources-container {
    padding: var(--space-lg);
  }

  .sources-table {
    display: flex;
    flex-direction: column;
    gap: 0;
  }

  .sources-table-header {
    display: none;
  }

  .sources-table-row {
    grid-template-columns: 1fr;
    padding: var(--space-lg) 0;
    display: flex;
    flex-direction: column;
  }

  .source-number {
    display: none;
  }

  .source-info-col {
    flex-direction: column;
    gap: var(--space-sm);
    align-items: flex-start;
  }

  .source-info-text {
    width: 100%;
  }

  .source-name-table {
    font-size: 16px;
    font-weight: 700;
  }

  .source-status-dot {
    width: 4px;
    height: 4px;
  }

  .source-frequency {
    font-size: 9px;
  }

  .source-last-published {
    display: none;
  }

  .source-new-count {
    font-size: 10px;
  }

  .unfollow-button {
    padding: 6px 12px;
    font-size: 10px;
  }
}

/* =========================================================================
   16. BOTTOM NAVIGATION (MOBILE)
   ========================================================================= */

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background-color: rgba(250, 249, 247, 0.85);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--bg4);
  display: none;
  z-index: var(--z-sticky);
}

@media (max-width: 767px) {
  .bottom-nav {
    display: flex;
  }

  .app-container {
    padding-bottom: 60px;
  }
}

.bottom-nav-items {
  display: flex;
  width: 100%;
  height: 100%;
}

.bottom-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  transition: color var(--transition-fast);
  position: relative;
  color: var(--ink4);
}

.bottom-nav-item.active {
  color: var(--primary);
}

.bottom-nav-item.active::after {
  content: '';
  position: absolute;
  bottom: 8px;
  width: 3px;
  height: 3px;
  background-color: var(--primary);
  border-radius: var(--radius-circle);
}

.bottom-nav-icon {
  font-size: 20px;
}

.bottom-nav-label {
  font-family: var(--font-sans);
  font-size: 9px;
  font-weight: 300;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

/* =========================================================================
   17. HTMX STATES & LOADING
   ========================================================================= */

.htmx-request .htmx-indicator {
  display: inline-block;
}

.htmx-indicator {
  display: none;
  width: 20px;
  height: 20px;
  border: 2px solid var(--bg4);
  border-top-color: var(--primary);
  border-radius: var(--radius-circle);
  animation: spin 0.8s linear infinite;
}

.htmx-request.htmx-swapping .htmx-indicator {
  display: inline-block;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.htmx-settling {
  opacity: 1;
  transition: opacity var(--transition-fast);
}

/* =========================================================================
   18. ANIMATIONS
   ========================================================================= */

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.article-row {
  animation: fade-up 0.3s ease-out;
}

/* =========================================================================
   19. RESPONSIVE UTILITIES
   ========================================================================= */

@media (max-width: 1024px) {
  .reading-panel {
    width: 360px;
  }

  .discover-container {
    grid-template-columns: 1fr;
  }

  .discover-sidebar {
    position: static;
  }
}

@media (max-width: 768px) {
  .app-frame {
    border-radius: 0;
  }

  .sidebar {
    display: none;
  }

  .main-content {
    flex-direction: column;
  }

  .reading-panel {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    border-left: none;
    z-index: var(--z-modal);
  }

  .reading-panel.closed {
    display: none;
  }

  .feed-panel {
    width: 100%;
    position: relative;
  }

  .top-bar {
    padding: 0 var(--space-lg);
  }

  .traffic-lights {
    display: none;
  }

  .nav-tabs,
  .top-nav {
    display: none;
  }

  .search-bar {
    flex: 1;
    margin-right: 0;
  }

  .avatar {
    display: none;
  }

  .library-grid {
    grid-template-columns: repeat(auto-fill, 72px);
    gap: var(--space-lg);
  }
}

/* =========================================================================
   19. TEMPLATE CLASS ALIASES
   (Maps template HTML class names to design system styles)
   ========================================================================= */

/* Mobile navigation aliases */
.mobile-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background-color: rgba(250, 249, 247, 0.85);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--bg4);
  z-index: var(--z-sticky);
}

@media (max-width: 767px) {
  .mobile-nav {
    display: flex;
  }
}

.mobile-nav-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  padding: var(--space-sm);
  cursor: pointer;
  color: var(--ink2);
  text-align: center;
  flex: 1;
  border: none;
  background: none;
  font-family: var(--font-sans);
  font-size: 11px;
  transition: color var(--transition-base);
}

.mobile-nav-tab:hover {
  color: var(--primary);
}

.mobile-nav-tab.active {
  color: var(--primary);
}

.mobile-nav-label {
  font-size: 11px;
  font-weight: 500;
  text-align: center;
}

/* Status indicator aliases (traffic lights) */
.dot {
  width: 11px;
  height: 11px;
  border-radius: var(--radius-circle);
  display: inline-block;
}

.dot-red {
  background-color: #ff5f57;
}

.dot-amber {
  background-color: #febc2e;
}

.dot-green {
  background-color: #28c840;
}

/* Top navigation aliases */
.top-nav {
  display: flex;
  align-items: center;
  gap: var(--space-2xl);
  margin-left: auto;
  margin-right: var(--space-2xl);
}

.top-nav-item {
  padding: var(--space-sm) var(--space-md);
  color: var(--ink2);
  cursor: pointer;
  transition: color var(--transition-base);
}

.top-nav-item:hover {
  color: var(--primary);
}

.top-nav-item.active {
  color: var(--primary);
  border-bottom: 2px solid var(--primary);
}

/* App container alias */
.body-container {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* Sidebar aliases */
.sidebar-title {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--ink3);
  padding: var(--space-base) var(--space-base);
  margin-top: var(--space-md);
}

.sidebar-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  padding: var(--space-sm) var(--space-base);
  color: var(--ink);
  cursor: pointer;
  transition: background-color var(--transition-base), color var(--transition-base);
  border-left: 3px solid transparent;
}

.sidebar-link:hover {
  background-color: var(--bg2);
  color: var(--primary);
}

.sidebar-link.active {
  background-color: var(--primary-light);
  color: var(--primary);
  border-left-color: var(--primary);
}

.unread-badge {
  min-width: 20px;
  height: 20px;
  padding: 0 var(--space-sm);
  border-radius: var(--radius-circle);
  background-color: var(--error);
  color: #FFFFFF;
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* User avatar alias */
.user-avatar {
  width: 32px;
  height: 32px;
  min-width: 32px;
  border-radius: var(--radius-circle);
  background-color: var(--bg3);
  border: 1px solid var(--bg4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  transition: background-color var(--transition-base), border-color var(--transition-base);
}

.user-avatar:hover {
  background-color: var(--bg4);
  border-color: var(--ink3);
}

/* Top bar layout aliases */
.top-bar-left {
  display: flex;
  align-items: center;
  gap: var(--space-base);
  flex: 1;
}

.top-bar-right {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-left: auto;
}

/* Search icon */
.search-icon {
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink2);
  font-size: 18px;
}

/* =========================================================================
   21. DISCOVER PAGE (BEM)
   ========================================================================= */

.discover {
  padding: var(--space-3xl);
}

.discover__mobile-search {
  display: none;
}

.discover__mobile-categories {
  display: none;
}

.discover__desktop-container {
  display: grid;
  grid-template-columns: 4fr 8fr;
  gap: var(--space-2xl);
}

.discover__sidebar {
  position: sticky;
  top: var(--space-3xl);
  height: fit-content;
}

.discover__category-section {
  margin-bottom: var(--space-2xl);
}

.discover__category-title {
  font-family: var(--font-serif);
  font-size: 28px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--ink);
  margin-bottom: var(--space-lg);
}

.discover__category-description {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 400;
  line-height: 1.6;
  color: var(--ink3);
  margin-bottom: 0;
}

.discover__main {
  min-width: 0;
}

.discover__source-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2xl);
}

.discover__empty-state {
  padding: var(--space-4xl);
  text-align: center;
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--ink3);
}

.discover__search-input-wrapper {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: 12px 16px;
  background-color: var(--bg2);
  border: 1px solid var(--bg4);
  border-radius: var(--radius-md);
}

.discover__search-icon {
  color: var(--ink4);
  font-size: 18px;
}

.discover__search-input {
  flex: 1;
  border: none;
  background: none;
  font-family: var(--font-serif);
  font-size: 14px;
  font-style: italic;
  color: var(--ink);
  outline: none;
}

.discover__search-input::placeholder {
  color: var(--ink4);
}

.discover__pill-container {
  display: flex;
  gap: var(--space-md);
  overflow-x: auto;
  padding-bottom: var(--space-sm);
}

.discover__pill {
  padding: 8px 16px;
  background-color: var(--bg2);
  border: none;
  border-radius: 20px;
  font-family: var(--font-sans);
  font-size: 9px;
  font-weight: 300;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink3);
  white-space: nowrap;
  cursor: pointer;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.discover__pill--active,
.discover__pill.discover__pill--active {
  background-color: var(--ink);
  color: white;
}

@media (max-width: 767px) {
  .discover {
    padding: var(--space-lg);
  }

  .discover__mobile-search {
    display: block;
    margin-bottom: var(--space-lg);
  }

  .discover__mobile-categories {
    display: block;
    margin-bottom: var(--space-lg);
  }

  .discover__desktop-container {
    grid-template-columns: 1fr;
    gap: var(--space-base);
  }

  .discover__sidebar {
    display: none;
  }
}

/* =========================================================================
   22. LIBRARY PAGE (BEM)
   ========================================================================= */

.library {
  padding: var(--space-3xl);
}

.library__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-2xl);
}

.library__title {
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 700;
  font-style: italic;
  color: var(--ink);
  margin: 0;
}

.library__filters {
  display: flex;
  gap: var(--space-md);
  overflow-x: auto;
}

.library__filter-tab {
  padding: 6px 14px;
  background-color: var(--bg2);
  border: none;
  border-radius: 20px;
  font-family: var(--font-sans);
  font-size: 9px;
  font-weight: 300;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink3);
  white-space: nowrap;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.library__filter-tab--active,
.library__filter-tab.library__filter-tab--active {
  background-color: var(--ink);
  color: white;
}

.library__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, 110px);
  gap: var(--space-2xl);
}

.library__empty-state {
  grid-column: 1 / -1;
  padding: var(--space-4xl);
  text-align: center;
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--ink3);
}

.library__empty-state p {
  margin: 0;
  color: var(--ink3);
}

@media (max-width: 767px) {
  .library {
    padding: var(--space-lg);
  }

  .library__header {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-base);
  }

  .library__grid {
    grid-template-columns: repeat(auto-fill, 72px);
    gap: var(--space-lg);
  }
}

/* =========================================================================
   23. SOURCES PAGE (BEM)
   ========================================================================= */

.sources {
  padding: var(--space-3xl);
}

.sources__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-2xl);
}

.sources__header-left {
  display: flex;
  align-items: baseline;
  gap: var(--space-lg);
}

.sources__title {
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 700;
  font-style: italic;
  color: var(--ink);
  margin: 0;
}

.sources__count {
  font-family: var(--font-sans);
  font-size: 9px;
  font-weight: 300;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink4);
}

.sources__add-button {
  padding: 8px 18px;
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: white;
  background-color: var(--primary);
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background-color var(--transition-fast);
  text-decoration: none;
  display: inline-block;
}

.sources__add-button:hover {
  background-color: var(--primary-dim);
  color: white;
}

.sources__desktop-wrapper {
  display: block;
}

.sources__mobile-wrapper {
  display: none;
}

.sources__table {
  width: 100%;
  border-collapse: collapse;
}

.sources__row {
  border-bottom: 0.5px solid var(--bg4);
  transition: background-color var(--transition-fast);
}

.sources__row:hover {
  background-color: var(--bg2);
}

.sources__number {
  font-family: var(--font-serif);
  font-size: 28px;
  font-weight: 400;
  font-style: italic;
  color: var(--ink4);
  text-align: right;
  padding: var(--space-lg) var(--space-md) var(--space-lg) 0;
  width: 50px;
  vertical-align: middle;
}

.sources__info {
  padding: var(--space-lg) var(--space-md);
  vertical-align: middle;
}

.sources__info-content {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.sources__source-name {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
  margin: 0;
}

.sources__status-wrapper {
  display: flex;
  align-items: center;
  gap: 6px;
}

.sources__status-dot {
  width: 4px;
  height: 4px;
  border-radius: var(--radius-circle);
  flex-shrink: 0;
}

.sources__status-dot--live { background-color: #28c840; }
.sources__status-dot--slow { background-color: #febc2e; }
.sources__status-dot--error,
.sources__status-dot--offline { background-color: var(--error); }

.sources__status-dot--small {
  width: 3px;
  height: 3px;
}

.sources__status-label {
  font-family: var(--font-sans);
  font-size: 9px;
  font-weight: 300;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink3);
}

.sources__frequency {
  font-family: var(--font-sans);
  font-size: 9px;
  font-weight: 300;
  color: var(--ink4);
  margin-left: var(--space-md);
}

.sources__last-published {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 300;
  color: var(--ink3);
  text-align: right;
  padding: var(--space-lg) var(--space-md);
  vertical-align: middle;
}

.sources__new-count {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 400;
  color: var(--ink4);
  text-align: center;
  padding: var(--space-lg) var(--space-md);
  vertical-align: middle;
}

.sources__new-count--unread {
  color: var(--primary);
  font-weight: 600;
}

.sources__actions {
  text-align: right;
  padding: var(--space-lg) 0 var(--space-lg) var(--space-md);
  vertical-align: middle;
}

.sources__unfollow-button {
  padding: 6px 12px;
  font-family: var(--font-sans);
  font-size: 9px;
  font-weight: 300;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink4);
  background-color: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.sources__unfollow-button:hover {
  color: var(--error);
  border-color: var(--error);
}

.sources__empty-state {
  padding: var(--space-4xl);
  text-align: center;
}

.sources__empty-state p {
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--ink3);
  margin-bottom: var(--space-base);
}

.sources__discover-link {
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--primary);
}

/* Mobile sources */
.sources__mobile-list {
  display: flex;
  flex-direction: column;
}

.sources__mobile-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-base) 0;
  border-bottom: 0.5px solid var(--bg4);
}

.sources__mobile-number {
  font-family: var(--font-serif);
  font-size: 16px;
  font-style: italic;
  color: var(--ink4);
  width: 32px;
  text-align: right;
  flex-shrink: 0;
}

.sources__mobile-info {
  flex: 1;
  min-width: 0;
}

.sources__mobile-source-name {
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  margin: 0;
}

.sources__mobile-status {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
}

.sources__mobile-frequency {
  font-family: var(--font-sans);
  font-size: 9px;
  font-weight: 300;
  color: var(--ink4);
}

.sources__mobile-new-count {
  font-family: var(--font-sans);
  font-size: 11px;
  color: var(--ink4);
  flex-shrink: 0;
}

.sources__mobile-unfollow-button {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--ink4);
  background: none;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  flex-shrink: 0;
  transition: color var(--transition-fast);
}

.sources__mobile-unfollow-button:hover {
  color: var(--error);
}

@media (max-width: 767px) {
  .sources {
    padding: var(--space-lg);
  }

  .sources__header {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-base);
  }

  .sources__desktop-wrapper {
    display: none;
  }

  .sources__mobile-wrapper {
    display: block;
  }
}

/* =========================================================================
   24. SOURCE ITEM (BEM)
   ========================================================================= */

.source-item__desktop {
  display: flex;
  align-items: flex-start;
  gap: var(--space-lg);
}

.source-item__mobile {
  display: none;
}

.source-item__logo-wrapper {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  position: relative;
}

.source-item__logo {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  object-fit: cover;
}

.source-item__logo-placeholder {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background-color: var(--bg3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 600;
  color: var(--ink3);
}

.source-item__content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.source-item__name {
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--ink);
  margin: 0;
}

.source-item__meta {
  font-family: var(--font-sans);
  font-size: 9px;
  font-weight: 300;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink3);
  margin: 0;
}

.source-item__description {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--ink2);
  margin: 4px 0 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.source-item__button {
  padding: 6px 18px;
  font-family: var(--font-sans);
  font-size: 9px;
  font-weight: 300;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--primary);
  background-color: transparent;
  border: 1px solid var(--primary);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
  flex-shrink: 0;
  align-self: flex-start;
}

.source-item__button:hover {
  background-color: var(--primary);
  color: white;
}

.source-item__button--following {
  background-color: var(--tertiary-light);
  color: var(--tertiary);
  border-color: var(--tertiary-light);
}

.source-item__button--following:hover {
  background-color: transparent;
  color: var(--tertiary);
  border-color: var(--tertiary);
}

/* Mobile source item */
.source-item__mobile-header {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.source-item__logo-wrapper-mobile {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
}

.source-item__logo-mobile {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  object-fit: cover;
}

.source-item__logo-placeholder-mobile {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background-color: var(--bg3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 600;
  color: var(--ink3);
}

.source-item__mobile-info {
  flex: 1;
  min-width: 0;
}

.source-item__name-mobile {
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  margin: 0;
}

.source-item__frequency-mobile {
  font-family: var(--font-sans);
  font-size: 9px;
  font-weight: 300;
  color: var(--ink4);
  margin: 2px 0 0;
}

.source-item__button-mobile {
  padding: 5px 12px;
  font-family: var(--font-sans);
  font-size: 8px;
  font-weight: 300;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--primary);
  background-color: transparent;
  border: 1px solid var(--primary);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
  flex-shrink: 0;
}

.source-item__button-mobile--following {
  background-color: var(--tertiary-light);
  color: var(--tertiary);
  border-color: var(--tertiary-light);
}

.source-item__description-mobile {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--ink2);
  margin: 8px 0 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

@media (max-width: 767px) {
  .source-item__desktop {
    display: none;
  }

  .source-item__mobile {
    display: block;
    padding: var(--space-base) 0;
    border-bottom: 0.5px solid var(--bg4);
  }
}

/* =========================================================================
   25. BOOK CARD (BEM)
   ========================================================================= */

.book-card__desktop {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.book-card__mobile {
  display: none;
}

.book-card__cover-wrapper {
  position: relative;
  width: 110px;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  border-radius: var(--radius-sm);
}

.book-card__cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.book-card__cover--placeholder {
  width: 100%;
  height: 100%;
  background-color: var(--bg3);
}

.book-card__spine {
  position: absolute;
  top: 0;
  left: 0;
  width: 12px;
  height: 100%;
  background: linear-gradient(90deg, rgba(47, 51, 49, 0.08) 0%, transparent 100%);
  pointer-events: none;
}

.book-card__content {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.book-card__badge {
  display: inline-block;
  background-color: var(--tertiary-light);
  color: var(--tertiary);
  font-family: var(--font-sans);
  font-size: 9px;
  font-weight: 300;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 2px 6px;
  border-radius: var(--radius-full);
  width: fit-content;
}

.book-card__title {
  font-family: var(--font-serif);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--ink);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.book-card__date {
  font-family: var(--font-sans);
  font-size: 9px;
  font-weight: 300;
  font-style: italic;
  color: var(--ink3);
  margin: 0;
}

.book-card__excerpt {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 400;
  line-height: 1.4;
  color: var(--ink3);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0;
}

.book-card__footer {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-top: 4px;
}

.book-card__offline-badge {
  font-family: var(--font-sans);
  font-size: 8px;
  font-weight: 300;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--tertiary);
  background-color: var(--tertiary-light);
  padding: 2px 6px;
  border-radius: var(--radius-full);
}

.book-card__read-time {
  font-family: var(--font-sans);
  font-size: 9px;
  font-weight: 300;
  color: var(--ink4);
}

/* Mobile book card */
.book-card__mobile-cover-wrapper {
  position: relative;
  width: 72px;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  border-radius: var(--radius-sm);
}

.book-card__cover-mobile {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.book-card__cover-mobile--placeholder {
  width: 100%;
  height: 100%;
  background-color: var(--bg3);
}

.book-card__spine-mobile {
  position: absolute;
  top: 0;
  left: 0;
  width: 8px;
  height: 100%;
  background: linear-gradient(90deg, rgba(47, 51, 49, 0.07) 0%, transparent 100%);
  pointer-events: none;
}

.book-card__mobile-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.book-card__badge-mobile {
  display: inline-block;
  background-color: var(--tertiary-light);
  color: var(--tertiary);
  font-family: var(--font-sans);
  font-size: 8px;
  font-weight: 300;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 1px 4px;
  border-radius: var(--radius-full);
  width: fit-content;
}

.book-card__title-mobile {
  font-family: var(--font-serif);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--ink);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.book-card__excerpt-mobile {
  font-family: var(--font-sans);
  font-size: 9px;
  font-weight: 400;
  line-height: 1.4;
  color: var(--ink3);
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0;
}

.book-card__footer-mobile {
  margin-top: 2px;
}

.book-card__read-time-mobile {
  font-family: var(--font-sans);
  font-size: 9px;
  font-weight: 300;
  color: var(--ink4);
}

@media (max-width: 767px) {
  .book-card__desktop {
    display: none;
  }

  .book-card__mobile {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
  }
}

/* =========================================================================
   26. SHARED UI SURFACES
   ========================================================================= */

.flash-stack {
  display: grid;
  gap: 12px;
  padding: 20px 24px 0;
}

.alert {
  border-radius: 12px;
  border: 1px solid var(--bg4);
  padding: 12px 14px;
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink);
  background-color: rgba(255, 255, 255, 0.82);
}

.alert-success {
  background-color: rgba(225, 250, 228, 0.92);
  border-color: rgba(78, 100, 84, 0.22);
  color: var(--tertiary);
}

.alert-error {
  background-color: rgba(253, 236, 236, 0.95);
  border-color: rgba(159, 64, 61, 0.2);
  color: var(--error);
}

.alert-warning {
  background-color: rgba(255, 244, 229, 0.95);
  border-color: rgba(212, 160, 65, 0.2);
  color: #855d17;
}

.page-shell {
  width: 100%;
  overflow-y: auto;
  padding: var(--space-3xl);
}

.page-shell--narrow {
  padding-inline: clamp(20px, 4vw, 48px);
}

.page-shell--centered {
  display: flex;
  justify-content: center;
}

.page-section {
  width: min(100%, 760px);
}

.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-lg);
  margin-bottom: var(--space-2xl);
}

.page-header__copy {
  display: grid;
  gap: 8px;
}

.page-header__eyebrow {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink4);
}

.page-header__title {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 30px;
  font-weight: 700;
  font-style: italic;
  line-height: 1.15;
  color: var(--ink);
}

.page-header__subtitle {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink3);
}

.page-header__actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.surface-card {
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(175, 179, 176, 0.28);
  border-radius: 18px;
  box-shadow: 0 18px 40px rgba(47, 51, 49, 0.08);
  backdrop-filter: blur(12px);
}

.surface-card--soft {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(243, 244, 241, 0.98) 100%);
}

.button,
.button:visited {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 16px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.2;
  text-decoration: none;
  transition: background-color var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast), transform var(--transition-fast);
  white-space: nowrap;
}

button.button {
  background: none;
}

.button:hover {
  transform: translateY(-1px);
}

.button--primary,
.button--primary:visited {
  background-color: var(--primary);
  border-color: var(--primary);
  color: white;
}

.button--primary:hover {
  background-color: var(--primary-dim);
  border-color: var(--primary-dim);
  color: white;
}

.button--secondary,
.button--secondary:visited {
  background-color: rgba(255, 255, 255, 0.92);
  border-color: var(--bg4);
  color: var(--ink);
}

.button--secondary:hover {
  background-color: var(--bg2);
  color: var(--ink);
}

.button--ghost,
.button--ghost:visited {
  background-color: var(--bg2);
  border-color: transparent;
  color: var(--ink2);
}

.button--ghost:hover {
  background-color: var(--bg3);
  color: var(--ink);
}

.button--block {
  width: 100%;
}

.button--square {
  border-radius: 12px;
}

.link-secondary,
.link-secondary:visited {
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--ink3);
  text-decoration: none;
}

.link-secondary:hover {
  color: var(--ink);
}

.link-primary,
.link-primary:visited {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  color: var(--primary);
  text-decoration: none;
}

.link-primary:hover {
  color: var(--primary-dim);
}

.icon-sm {
  width: 14px;
  height: 14px;
}

.form-group {
  display: grid;
  gap: 6px;
}

.form-label {
  display: block;
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink3);
}

.form-input,
.form-select,
.form-textarea,
.settings-input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid rgba(175, 179, 176, 0.38);
  border-radius: 12px;
  background-color: rgba(255, 255, 255, 0.9);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.4;
  box-sizing: border-box;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background-color var(--transition-fast);
}

.form-textarea {
  min-height: 120px;
  resize: vertical;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus,
.settings-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(78, 96, 115, 0.12);
  background-color: #FFFFFF;
}

.form-error {
  display: block;
  margin-top: 2px;
  font-family: var(--font-sans);
  font-size: 12px;
  line-height: 1.4;
  color: var(--error);
}

.form-note {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 12px;
  line-height: 1.5;
  color: var(--ink3);
}

.form-checkbox-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 18px;
  border: 1px solid rgba(175, 179, 176, 0.32);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94) 0%, rgba(243, 244, 241, 0.92) 100%);
}

.form-checkbox-card input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  accent-color: var(--primary);
}

.form-checkbox-copy {
  display: grid;
  gap: 4px;
}

.form-checkbox-copy strong {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}

.form-checkbox-copy span {
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink3);
}

.auth-wrapper {
  width: 100%;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: clamp(28px, 6vw, 72px) 24px;
  position: relative;
}

.auth-wrapper::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at top left, rgba(78, 96, 115, 0.12), transparent 34%),
    radial-gradient(circle at bottom right, rgba(78, 100, 84, 0.11), transparent 30%);
  pointer-events: none;
}

.auth-shell {
  position: relative;
  z-index: 1;
  width: min(100%, 420px);
  display: grid;
  gap: 18px;
}

.auth-card {
  position: relative;
  z-index: 1;
  width: 100%;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(175, 179, 176, 0.3);
  border-radius: 24px;
  padding: clamp(28px, 4vw, 40px);
  box-shadow: 0 24px 56px rgba(47, 51, 49, 0.1);
  backdrop-filter: blur(16px);
}

.auth-header {
  display: grid;
  gap: 10px;
  text-align: center;
  margin-bottom: 28px;
}

.auth-wordmark {
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(34px, 5vw, 42px);
  font-weight: 700;
  font-style: italic;
  line-height: 1;
  color: var(--primary);
}

.auth-title {
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(30px, 4.5vw, 38px);
  font-weight: 700;
  font-style: italic;
  line-height: 1.1;
  color: var(--ink);
}

.auth-tagline {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 12px;
  line-height: 1.6;
  letter-spacing: 0.04em;
  color: var(--ink3);
}

.auth-form {
  display: grid;
  gap: 16px;
}

.auth-divider {
  position: relative;
  margin: 22px 0;
  text-align: center;
}

.auth-divider::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: rgba(175, 179, 176, 0.42);
}

.auth-divider span {
  position: relative;
  display: inline-block;
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.96);
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink4);
}

.btn-google,
.btn-google:visited {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px 16px;
  border: 1px solid rgba(175, 179, 176, 0.42);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.95);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: border-color var(--transition-fast), background-color var(--transition-fast), transform var(--transition-fast);
}

.btn-google:hover {
  background: var(--bg2);
  border-color: var(--primary);
  color: var(--ink);
  transform: translateY(-1px);
}

.btn-google-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(78, 96, 115, 0.12);
  color: var(--primary);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.auth-links {
  display: flex;
  justify-content: center;
  margin-top: 18px;
}

.auth-cta {
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid rgba(175, 179, 176, 0.32);
  display: grid;
  gap: 8px;
  justify-items: center;
}

.auth-cta-text {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink3);
}

.auth-footnote {
  position: relative;
  z-index: 1;
  max-width: 420px;
  margin: 0 auto;
  text-align: center;
}

.auth-footnote p {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 12px;
  line-height: 1.6;
  color: var(--ink3);
}

body.auth-layout {
  background:
    linear-gradient(180deg, rgba(243, 244, 241, 0.94) 0%, rgba(250, 249, 247, 1) 100%);
}

body.auth-layout .top-bar,
body.auth-layout .sidebar,
body.auth-layout .mobile-nav {
  display: none;
}

body.auth-layout .app-frame {
  max-width: none;
  min-height: 100vh;
  margin: 0;
  border-radius: 0;
  box-shadow: none;
}

body.auth-layout .body-container {
  display: block;
  min-height: 100vh;
}

body.auth-layout .main-content {
  display: block;
  min-height: 100vh;
  overflow: visible;
}

body.auth-layout .reading-panel {
  display: none !important;
}

.feed-container {
  width: 100%;
  overflow-y: auto;
  padding: var(--space-3xl);
}

.feed-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-lg);
  margin-bottom: var(--space-2xl);
}

.feed-title {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 30px;
  font-weight: 700;
  font-style: italic;
  line-height: 1.1;
  color: var(--ink);
}

.feed-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.unread-count {
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink4);
}

.btn-mark-all-read {
  padding: 10px 16px;
  border: 1px solid rgba(175, 179, 176, 0.5);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  transition: background-color var(--transition-fast), border-color var(--transition-fast), transform var(--transition-fast);
}

.btn-mark-all-read:hover {
  background: var(--bg2);
  border-color: var(--primary);
  transform: translateY(-1px);
}

.source-filter-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: var(--space-2xl);
  overflow-x: auto;
  padding-bottom: 8px;
  scrollbar-width: thin;
}

.filter-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border: 1px solid rgba(175, 179, 176, 0.44);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--ink3);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast), transform var(--transition-fast);
}

.filter-tab:hover {
  background: var(--bg2);
  border-color: var(--primary);
  color: var(--ink);
  transform: translateY(-1px);
}

.filter-tab.active {
  background: var(--ink);
  border-color: var(--ink);
  color: white;
}

.filter-source-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.search-kicker {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink4);
}

.search-clear-link,
.search-clear-link:visited {
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--ink3);
  text-decoration: none;
}

.search-clear-link:hover {
  color: var(--ink);
}

.loading-indicator {
  font-family: var(--font-sans);
  font-size: 12px;
}

.empty-state {
  text-align: center;
  padding: 3rem 2rem;
  color: var(--ink4);
  font-family: var(--font-sans);
}

.empty-state p {
  margin: 0;
  font-size: 14px;
  color: inherit;
}

.sources__header-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.sources__add-button--secondary,
.sources__add-button--secondary:visited {
  background-color: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(175, 179, 176, 0.44);
  color: var(--ink);
}

.sources__add-button--secondary:hover {
  background-color: var(--bg2);
  border-color: var(--primary);
  color: var(--ink);
}

.account-page {
  width: min(100%, 760px);
  display: grid;
  gap: var(--space-xl);
}

.account-card {
  padding: clamp(24px, 4vw, 36px);
  display: grid;
  gap: 24px;
}

.account-identity {
  display: grid;
  gap: 8px;
}

.account-name {
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(30px, 4vw, 38px);
  font-weight: 700;
  font-style: italic;
  line-height: 1.1;
  color: var(--ink);
}

.account-email {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink3);
}

.account-form {
  display: grid;
  gap: 18px;
}

.account-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.account-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.account-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.account-stat {
  padding: 16px 18px;
  border-radius: 16px;
  border: 1px solid rgba(175, 179, 176, 0.3);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95) 0%, rgba(243, 244, 241, 0.92) 100%);
}

.account-stat--warning {
  background: linear-gradient(180deg, rgba(253, 239, 229, 0.96) 0%, rgba(250, 244, 235, 0.98) 100%);
  border-color: rgba(212, 160, 65, 0.22);
}

.account-stat__label {
  display: block;
  margin-bottom: 6px;
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink4);
}

.account-stat__value {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink2);
}

@media (max-width: 767px) {
  .flash-stack {
    padding: 16px 16px 0;
  }

  .page-shell,
  .feed-container,
  .sources,
  .discover,
  .library {
    padding: var(--space-lg);
  }

  .page-header,
  .feed-header,
  .sources__header {
    flex-direction: column;
    align-items: flex-start;
  }

  .page-header__actions,
  .feed-header-right,
  .sources__header-actions,
  .account-actions {
    width: 100%;
  }

  .button--block-mobile {
    width: 100%;
  }

  .auth-shell {
    width: 100%;
  }

  .auth-card {
    border-radius: 20px;
  }

  .account-form-grid {
    grid-template-columns: 1fr;
  }
}

/* =========================================================================
   27. PRINT STYLES
   ========================================================================= */

@media print {
  .top-bar,
  .sidebar,
  .reading-panel-header,
  .bottom-nav,
  .search-bar {
    display: none;
  }

  .article-body {
    color: black;
    font-family: 'Georgia', serif;
  }

  a {
    color: black;
    text-decoration: none;
  }

  a[href]::after {
    content: ' (' attr(href) ')';
  }

  .pullquote {
    page-break-inside: avoid;
    border-left: none;
    padding-left: 0;
  }
}
