/* Ark Reader - High-Density Professional RSS & Longform Reading System */
@import url("https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=Noto+Serif+SC:wght@400;500;600;700&display=swap");

:root {
  /* Editorial Paper Theme (Default Light) */
  --bg-app: #f4f1eb;
  --bg-sidebar: #ebe5dc;
  --bg-list: #fcfbf9;
  --bg-reader: #f7f5ef;
  --bg-surface: #ffffff;
  --bg-hover: #ece6dc;
  --bg-active: #e2dbce;
  --bg-selected-row: #f0eade;
  --bg-code: #1c211e;
  --text-code: #e5ede8;

  --text-primary: #181b1a;
  --text-secondary: #56615b;
  --text-tertiary: #839089;
  --text-muted: #9ba8a2;

  --border: #d6cebf;
  --border-subtle: #e6dfd2;
  --border-focus: #b83e23;

  --accent: #b83e23;
  --accent-hover: #9c331a;
  --accent-subtle: #faebe7;
  --accent-soft: #f4dcd6;

  --forest: #274b3a;
  --forest-subtle: #e6f0eb;
  --star: #d97706;
  --star-subtle: #fef3c7;
  --unread-dot: #b83e23;

  --sidebar-width: 240px;
  --list-width: 420px;
  --reader-max-width: 780px;
  --font-size-reader: 18px;

  --font-sans: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", Georgia, Cambria, serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Code", "Consolas", Menlo, monospace;

  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 12px 32px rgba(24, 27, 26, 0.12);

  --header-height: 44px;
}

/* Dark Night Theme */
html[data-theme="night"],
html[data-theme="system"] {
  @media (prefers-color-scheme: dark) {
    --bg-app: #121513;
    --bg-sidebar: #171b19;
    --bg-list: #1a1e1b;
    --bg-reader: #151816;
    --bg-surface: #202622;
    --bg-hover: #242b26;
    --bg-active: #2c352f;
    --bg-selected-row: #28302b;
    --bg-code: #0d100e;
    --text-code: #d8e2dc;

    --text-primary: #e6eae7;
    --text-secondary: #9da7a1;
    --text-tertiary: #6e7972;
    --text-muted: #535d57;

    --border: #2d3530;
    --border-subtle: #232a25;
    --border-focus: #e2674f;

    --accent: #e2674f;
    --accent-hover: #ed7861;
    --accent-subtle: #3a221d;
    --accent-soft: #4a2c26;

    --forest: #6ea388;
    --forest-subtle: #1e2c24;
    --star: #f59e0b;
    --star-subtle: #3b2a0c;
    --unread-dot: #e2674f;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.5);
    color-scheme: dark;
  }
}

html[data-theme="night"] {
  --bg-app: #121513;
  --bg-sidebar: #171b19;
  --bg-list: #1a1e1b;
  --bg-reader: #151816;
  --bg-surface: #202622;
  --bg-hover: #242b26;
  --bg-active: #2c352f;
  --bg-selected-row: #28302b;
  --bg-code: #0d100e;
  --text-code: #d8e2dc;

  --text-primary: #e6eae7;
  --text-secondary: #9da7a1;
  --text-tertiary: #6e7972;
  --text-muted: #535d57;

  --border: #2d3530;
  --border-subtle: #232a25;
  --border-focus: #e2674f;

  --accent: #e2674f;
  --accent-hover: #ed7861;
  --accent-subtle: #3a221d;
  --accent-soft: #4a2c26;

  --forest: #6ea388;
  --forest-subtle: #1e2c24;
  --star: #f59e0b;
  --star-subtle: #3b2a0c;
  --unread-dot: #e2674f;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.5);
  color-scheme: dark;
}

/* Global Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.4;
  color: var(--text-primary);
  background-color: var(--bg-app);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button, input, textarea, select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
}

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

kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: var(--radius-xs);
  padding: 1px 5px;
  min-width: 16px;
  line-height: 1.2;
}

.hidden {
  display: none !important;
}

.mobile-only {
  display: none !important;
}

/* Icons */
.svg-icon {
  width: 16px;
  height: 16px;
  fill: currentColor;
  flex-shrink: 0;
}

.svg-icon-sm {
  width: 14px;
  height: 14px;
  fill: currentColor;
  flex-shrink: 0;
}

.svg-icon-xs {
  width: 12px;
  height: 12px;
  fill: currentColor;
  flex-shrink: 0;
}

.text-accent { color: var(--accent) !important; }
.text-star { color: var(--star) !important; }
.text-forest { color: var(--forest) !important; }

/* 3-Pane App Layout */
.app-layout {
  display: grid;
  grid-template-columns: var(--sidebar-width) var(--list-width) minmax(400px, 1fr);
  height: 100dvh;
  width: 100vw;
  overflow: hidden;
  background-color: var(--bg-app);
}

.pane {
  height: 100%;
  display: flex;
  flex-direction: column;
  min-width: 0;
  position: relative;
  overflow: hidden;
}

/* ==========================================================================
   PANE 1: Subscriptions Sidebar
   ========================================================================== */
.pane-sidebar {
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  user-select: none;
}

.sidebar-header {
  height: var(--header-height);
  padding: 0 10px 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

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

.brand-badge {
  background-color: var(--text-primary);
  color: var(--bg-sidebar);
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.05em;
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  line-height: 1.1;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.12em;
  line-height: 1;
}

.brand-sub {
  font-size: 9px;
  color: var(--text-tertiary);
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
  margin-top: 2px;
}

.sidebar-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Smart Navigation */
.smart-views {
  padding: 8px 8px 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex-shrink: 0;
  border-bottom: 1px solid var(--border-subtle);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  height: 30px;
  padding: 0 9px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 12.5px;
  font-weight: 500;
  transition: background-color 0.12s ease, color 0.12s ease;
}

.nav-item:hover {
  background-color: var(--bg-hover);
  color: var(--text-primary);
}

.nav-item.active {
  background-color: var(--bg-active);
  color: var(--text-primary);
  font-weight: 600;
}

.nav-icon {
  width: 15px;
  height: 15px;
  color: var(--text-tertiary);
  flex-shrink: 0;
}

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

.nav-label {
  flex: 1;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.badge {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-tertiary);
  padding: 1px 5px;
  border-radius: 10px;
  background: transparent;
  line-height: 1.1;
}

.badge-accent {
  color: var(--accent);
  background-color: var(--accent-subtle);
}

/* Section Header */
.sidebar-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px 4px 14px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  flex-shrink: 0;
}

/* Feeds Tree */
.feed-tree-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 4px 6px 12px;
}

.feed-folder {
  margin-bottom: 2px;
}

.folder-row {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 8px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.1s ease;
}

.folder-row:hover {
  background-color: var(--bg-hover);
  color: var(--text-primary);
}

.folder-chevron {
  width: 12px;
  height: 12px;
  color: var(--text-tertiary);
  transition: transform 0.15s ease;
  flex-shrink: 0;
}

.feed-folder.collapsed .folder-chevron {
  transform: rotate(-90deg);
}

.feed-folder.collapsed .folder-feeds {
  display: none;
}

.folder-icon {
  width: 14px;
  height: 14px;
  color: var(--forest);
  flex-shrink: 0;
}

.folder-name {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: left;
}

.folder-feeds {
  padding-left: 14px;
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin-top: 1px;
}

.feed-item {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 28px;
  padding: 0 8px 0 6px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 400;
  position: relative;
  transition: background-color 0.1s ease, color 0.1s ease;
  cursor: pointer;
}

.feed-item:hover {
  background-color: var(--bg-hover);
  color: var(--text-primary);
}

.feed-item.active {
  background-color: var(--bg-active);
  color: var(--text-primary);
  font-weight: 600;
}

.feed-monogram {
  width: 16px;
  height: 16px;
  border-radius: 3px;
  background-color: var(--forest-subtle);
  color: var(--forest);
  font-size: 9px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  text-transform: uppercase;
  flex-shrink: 0;
}

.feed-title {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: left;
}

.feed-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-tertiary);
  font-weight: 500;
}

.feed-badge.has-unread {
  color: var(--accent);
  font-weight: 700;
}

.feed-item-more {
  display: none;
  width: 18px;
  height: 18px;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-xs);
  color: var(--text-tertiary);
  flex-shrink: 0;
}

.feed-item:hover .feed-item-more {
  display: flex;
}

.feed-item-more:hover {
  background-color: var(--bg-surface);
  color: var(--text-primary);
}

/* Sidebar Footer */
.sidebar-footer {
  height: var(--header-height);
  border-top: 1px solid var(--border);
  padding: 0 8px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  align-items: center;
  background-color: var(--bg-sidebar);
  flex-shrink: 0;
}

.footer-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 28px;
  padding: 0 4px;
  border-radius: var(--radius-xs);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 500;
  transition: background-color 0.1s ease, color 0.1s ease;
}

.footer-btn:hover {
  background-color: var(--bg-hover);
  color: var(--text-primary);
}

/* ==========================================================================
   PANE 2: High-Density Article List
   ========================================================================== */
.pane-list {
  background-color: var(--bg-list);
  border-right: 1px solid var(--border);
}

.list-header {
  border-bottom: 1px solid var(--border);
  background-color: var(--bg-list);
  flex-shrink: 0;
}

.list-header-top {
  height: var(--header-height);
  padding: 0 12px 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.scope-info {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.scope-title {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-primary);
}

.scope-badge {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text-tertiary);
  background-color: var(--bg-hover);
  padding: 1px 6px;
  border-radius: 10px;
  white-space: nowrap;
}

.list-header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Search Box */
.search-container {
  margin: 0 12px 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 30px;
  padding: 0 8px;
  background-color: var(--bg-app);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.search-container:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-subtle);
  background-color: var(--bg-surface);
}

.search-icon {
  width: 14px;
  height: 14px;
  color: var(--text-tertiary);
  flex-shrink: 0;
}

.search-input {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  font-size: 12px;
  padding: 0;
  color: var(--text-primary);
}

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

.search-clear {
  color: var(--text-tertiary);
  padding: 2px;
  display: flex;
  align-items: center;
}

.search-clear:hover {
  color: var(--text-primary);
}

.kbd-shortcut {
  font-size: 9px;
  padding: 0 4px;
  color: var(--text-tertiary);
  background: var(--bg-surface);
}

/* Secondary Filter & Density Bar */
.list-controls-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px 6px;
}

.filter-pills {
  display: flex;
  align-items: center;
  gap: 2px;
  background-color: var(--bg-hover);
  padding: 2px;
  border-radius: var(--radius-sm);
}

.pill-btn {
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 500;
  border-radius: var(--radius-xs);
  color: var(--text-secondary);
  transition: all 0.12s ease;
}

.pill-btn:hover {
  color: var(--text-primary);
}

.pill-btn.active {
  background-color: var(--bg-surface);
  color: var(--text-primary);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

.density-and-tools {
  display: flex;
  align-items: center;
  gap: 4px;
}

.density-group {
  display: flex;
  align-items: center;
  background-color: var(--bg-hover);
  padding: 2px;
  border-radius: var(--radius-sm);
}

.density-btn {
  width: 22px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-xs);
  color: var(--text-tertiary);
  transition: all 0.12s ease;
}

.density-btn:hover {
  color: var(--text-primary);
}

.density-btn.active {
  background-color: var(--bg-surface);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}

/* Bulk Bar */
.bulk-bar {
  background-color: var(--accent-subtle);
  border-bottom: 1px solid var(--border);
  padding: 6px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-shrink: 0;
  animation: slideDown 0.15s ease-out;
}

@keyframes slideDown {
  from { transform: translateY(-100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.bulk-count {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--accent);
}

.bulk-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.btn-bulk {
  background-color: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 2px 7px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-primary);
  transition: background-color 0.1s ease;
}

.btn-bulk:hover {
  background-color: var(--bg-hover);
}

.btn-bulk-secondary {
  border-radius: var(--radius-xs);
  padding: 2px 6px;
  font-size: 11px;
  color: var(--text-secondary);
}

.btn-bulk-secondary:hover {
  color: var(--text-primary);
}

.btn-bulk-ghost {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: var(--radius-xs);
  color: var(--text-secondary);
}

.btn-bulk-ghost:hover {
  background-color: var(--bg-surface);
  color: var(--text-primary);
}

/* Search Banner */
.search-banner {
  background-color: var(--forest-subtle);
  border-bottom: 1px solid var(--border);
  padding: 6px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--forest);
  flex-shrink: 0;
}

.btn-link {
  color: var(--accent);
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
}

/* Continuous Article List */
.article-list-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
}

.article-list {
  display: flex;
  flex-direction: column;
}

/* Article Row Base */
.article-row {
  display: grid;
  align-items: center;
  border-bottom: 1px solid var(--border-subtle);
  background-color: var(--bg-list);
  cursor: pointer;
  position: relative;
  user-select: none;
  transition: background-color 0.1s ease;
}

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

.article-row.active {
  background-color: var(--bg-selected-row);
}

.article-row.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background-color: var(--accent);
  z-index: 2;
}

/* Compact Mode Row (~42px) */
.article-list.compact .article-row {
  height: 42px;
  grid-template-columns: 24px 1fr auto auto;
  gap: 8px;
  padding: 0 12px 0 8px;
}

.article-list.compact .row-left {
  display: flex;
  align-items: center;
  justify-content: center;
}

.article-list.compact .row-center {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.article-list.compact .row-source {
  font-size: 11px;
  font-weight: 600;
  color: var(--forest);
  white-space: nowrap;
  max-width: 90px;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 0;
}

.article-list.compact .row-title {
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  color: var(--text-secondary);
}

.article-row.unread .row-title {
  color: var(--text-primary);
  font-weight: 600;
}

.article-list.compact .row-summary {
  display: none;
}

.article-list.compact .row-time {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text-tertiary);
  white-space: nowrap;
  flex-shrink: 0;
}

.article-list.compact .row-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  opacity: 0;
  transition: opacity 0.1s ease;
}

.article-row:hover .row-actions,
.article-row.is-starred .row-actions,
.article-row.active .row-actions {
  opacity: 1;
}

/* Comfortable Mode Row (~70px) */
.article-list.comfortable .article-row {
  min-height: 70px;
  grid-template-columns: 24px 1fr auto;
  gap: 8px;
  padding: 8px 12px 8px 8px;
  align-items: flex-start;
}

.article-list.comfortable .row-left {
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 3px;
}

.article-list.comfortable .row-center {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.article-list.comfortable .row-meta-line {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
}

.article-list.comfortable .row-source {
  font-weight: 600;
  color: var(--forest);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.article-list.comfortable .row-time {
  font-family: var(--font-mono);
  color: var(--text-tertiary);
}

.article-list.comfortable .row-title {
  font-family: var(--font-serif);
  font-size: 13.5px;
  line-height: 1.35;
  color: var(--text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.article-row.unread .row-title {
  color: var(--text-primary);
  font-weight: 700;
}

.article-list.comfortable .row-summary {
  font-size: 11.5px;
  color: var(--text-tertiary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}

.article-list.comfortable .row-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding-top: 2px;
  opacity: 0;
  transition: opacity 0.1s ease;
}

.article-row:hover .row-actions,
.article-row.is-starred .row-actions,
.article-row.active .row-actions {
  opacity: 1;
}

/* Indicators & Controls in Rows */
.row-unread-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: transparent;
  flex-shrink: 0;
  transition: background-color 0.1s ease;
}

.article-row.unread .row-unread-dot {
  background-color: var(--unread-dot);
}

.row-checkbox {
  width: 15px;
  height: 15px;
  accent-color: var(--accent);
  cursor: pointer;
}

.btn-row-action {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-xs);
  color: var(--text-tertiary);
  transition: all 0.1s ease;
}

.btn-row-action:hover {
  background-color: var(--bg-hover);
  color: var(--text-primary);
}

.article-row.is-starred .btn-row-star,
.btn-row-star.starred {
  color: var(--star) !important;
  opacity: 1 !important;
}

/* Empty List State */
.empty-list-view {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 24px;
  text-align: center;
  color: var(--text-secondary);
}

.empty-list-view h3 {
  margin: 8px 0 4px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.empty-list-view p {
  margin: 0;
  font-size: 12px;
  color: var(--text-tertiary);
}

/* ==========================================================================
   PANE 3: Calm Reading Pane
   ========================================================================== */
.pane-reader {
  background-color: var(--bg-reader);
}

/* Sticky Toolbar */
.reader-toolbar {
  height: var(--header-height);
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  background-color: var(--bg-reader);
  position: sticky;
  top: 0;
  z-index: 10;
  flex-shrink: 0;
}

.reader-toolbar-left,
.reader-toolbar-right {
  display: flex;
  align-items: center;
  gap: 4px;
}

.article-nav-group {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-right: 6px;
}

.reader-source-tag {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--forest);
  text-transform: uppercase;
  max-width: 220px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-reader-tool {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 28px;
  padding: 0 8px;
  border-radius: var(--radius-sm);
  background-color: var(--bg-surface);
  border: 1px solid var(--border);
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.12s ease;
}

.btn-reader-tool:hover {
  background-color: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--border-focus);
}

.btn-reader-tool.active {
  background-color: var(--accent-subtle);
  color: var(--accent);
  border-color: var(--accent);
  font-weight: 600;
}

.toolbar-divider {
  width: 1px;
  height: 18px;
  background-color: var(--border);
  margin: 0 4px;
}

/* Reading Progress Bar */
.reading-progress-track {
  height: 2px;
  width: 100%;
  background-color: transparent;
  position: sticky;
  top: var(--header-height);
  z-index: 11;
}

.reading-progress-fill {
  height: 100%;
  width: 0%;
  background-color: var(--accent);
  transition: width 0.08s ease-out;
}

/* Scroll Area */
.reader-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
}

/* Empty Desk State */
.reader-empty {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}

.empty-desk-card {
  max-width: 480px;
  text-align: center;
}

.desk-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background-color: var(--bg-hover);
  color: var(--accent);
  margin-bottom: 16px;
}

.desk-logo {
  width: 28px;
  height: 28px;
}

.empty-title {
  margin: 0 0 8px;
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
}

.empty-desc {
  margin: 0 0 24px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-secondary);
}

.shortcuts-cheatsheet {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 16px;
  text-align: left;
  background-color: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 20px;
}

.shortcut-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  color: var(--text-secondary);
}

/* Loading Skeletons */
.reader-loading {
  max-width: var(--reader-max-width);
  margin: 0 auto;
  padding: 40px 32px;
}

.skeleton {
  border-radius: var(--radius-xs);
  background: linear-gradient(90deg, var(--bg-hover) 25%, var(--bg-active) 50%, var(--bg-hover) 75%);
  background-size: 200% 100%;
  animation: skeletonPulse 1.5s infinite;
  margin-bottom: 16px;
}

@keyframes skeletonPulse {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-title { height: 36px; width: 75%; }
.skeleton-meta { height: 16px; width: 45%; margin-bottom: 32px; }
.skeleton-para { height: 16px; width: 100%; }

/* Article Document */
.reader-document {
  max-width: var(--reader-max-width);
  margin: 0 auto;
  padding: 36px 36px 90px;
}

/* Job Banners */
.job-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  background-color: var(--forest-subtle);
  border: 1px solid var(--forest);
  color: var(--forest);
  font-size: 12px;
  font-weight: 500;
  margin-bottom: 24px;
}

.spinner {
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
  flex-shrink: 0;
}

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

/* Header */
.doc-header {
  margin-bottom: 28px;
}

.doc-kicker-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 12px;
  color: var(--text-tertiary);
  margin-bottom: 12px;
}

.doc-source {
  font-weight: 700;
  color: var(--forest);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.doc-author {
  color: var(--text-secondary);
  font-weight: 500;
}

.doc-badge {
  font-size: 10px;
  font-family: var(--font-mono);
  background-color: var(--bg-hover);
  color: var(--text-secondary);
  border-radius: var(--radius-xs);
  padding: 1px 6px;
}

.doc-title {
  margin: 0 0 16px;
  font-family: var(--font-serif);
  font-size: clamp(26px, 3.2vw, 36px);
  font-weight: 700;
  line-height: 1.25;
  color: var(--text-primary);
}

.doc-summary-box {
  background-color: var(--bg-hover);
  border-left: 3px solid var(--forest);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 12px 16px;
  margin-top: 14px;
}

.doc-summary {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 15px;
  line-height: 1.6;
  color: var(--forest);
  font-weight: 500;
}

/* Document Body & Blocks */
.doc-body {
  font-family: var(--font-serif);
  font-size: var(--font-size-reader);
  line-height: 1.85;
  color: var(--text-primary);
}

.block {
  margin: 0 0 1.4em;
}

.block-heading {
  font-family: var(--font-serif);
  font-size: 1.35em;
  font-weight: 700;
  line-height: 1.35;
  margin: 1.8em 0 0.8em;
  color: var(--text-primary);
}

.block-quote {
  border-left: 3px solid var(--accent);
  padding: 6px 0 6px 18px;
  margin: 1.5em 0;
  color: var(--text-secondary);
  font-style: italic;
}

.block-list {
  padding-left: 1.6em;
  margin: 1em 0;
}

.block-list li {
  margin-bottom: 0.5em;
}

.block-code {
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6;
  background-color: var(--bg-code);
  color: var(--text-code);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  overflow-x: auto;
  margin: 1.5em 0;
}

.block-code code {
  font-family: inherit;
}

.block-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2.2em 0;
}

.block-image {
  margin: 2em 0;
  text-align: center;
}

.block-image img {
  max-width: 100%;
  max-height: 72vh;
  object-fit: contain;
  border-radius: var(--radius-sm);
  background-color: var(--bg-hover);
  box-shadow: var(--shadow-sm);
}

.block-image figcaption {
  margin-top: 8px;
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--text-tertiary);
}

/* Translation styling */
.block-translation {
  margin-top: 0.6em;
  padding: 6px 12px;
  border-left: 2px solid var(--forest);
  background-color: var(--forest-subtle);
  border-radius: 0 var(--radius-xs) var(--radius-xs) 0;
  color: var(--text-secondary);
  font-size: 0.95em;
  line-height: 1.7;
}

.focus-mark {
  background: color-mix(in srgb, var(--star) 24%, transparent);
  color: inherit;
  border-radius: 2px;
  padding: 0 1px;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.row-tag-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: var(--forest-subtle);
  color: var(--forest);
  font: 600 9px/1 var(--font-mono);
  flex-shrink: 0;
}

.row-tags,
.doc-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.row-tags span,
.doc-tags span {
  display: inline-flex;
  align-items: center;
  height: 17px;
  padding: 0 6px;
  border: 1px solid var(--border);
  border-radius: 2px;
  background: var(--bg-surface);
  color: var(--text-secondary);
  font: 600 9px/1 var(--font-sans);
}

.row-tags {
  margin-top: 2px;
}

.doc-tags {
  margin: 10px 0 0;
}

/* ==========================================================================
   Common Reusable Components & Buttons
   ========================================================================== */
.btn-icon {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  transition: all 0.12s ease;
  flex-shrink: 0;
}

.btn-icon:hover {
  background-color: var(--bg-hover);
  color: var(--text-primary);
}

.btn-icon:active {
  background-color: var(--bg-active);
}

.btn-icon-subtle {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-xs);
  color: var(--text-tertiary);
  transition: all 0.12s ease;
}

.btn-icon-subtle:hover {
  background-color: var(--bg-hover);
  color: var(--text-primary);
}

.btn-primary {
  background-color: var(--text-primary);
  color: var(--bg-surface);
  border-radius: var(--radius-sm);
  padding: 7px 14px;
  font-size: 12.5px;
  font-weight: 600;
  transition: opacity 0.12s ease;
}

.btn-primary:hover {
  opacity: 0.9;
}

.btn-secondary {
  background-color: var(--bg-hover);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 7px 14px;
  font-size: 12.5px;
  font-weight: 500;
  transition: background-color 0.12s ease;
}

.btn-secondary:hover {
  background-color: var(--bg-active);
}

.btn-danger {
  background-color: var(--accent);
  color: #ffffff;
  border-radius: var(--radius-sm);
  padding: 7px 14px;
  font-size: 12.5px;
  font-weight: 600;
  transition: opacity 0.12s ease;
}

.btn-danger:hover {
  opacity: 0.9;
}

.btn-danger-outline {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background-color: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  transition: all 0.12s ease;
}

.btn-danger-outline:hover {
  background-color: var(--accent-subtle);
}

.btn-subtle-action {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background-color: var(--bg-hover);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
}

.btn-subtle-action:hover {
  background-color: var(--bg-active);
}

.w-full { width: 100%; }

/* Dropdown Menus */
.dropdown-wrapper {
  position: relative;
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  z-index: 50;
  min-width: 170px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  padding: 4px;
  display: flex;
  flex-direction: column;
}

.dropdown-item {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 6px 10px;
  border-radius: var(--radius-xs);
  font-size: 12px;
  color: var(--text-primary);
  text-align: left;
  transition: background-color 0.1s ease;
}

.dropdown-item:hover {
  background-color: var(--bg-hover);
}

.dropdown-item.active {
  background-color: var(--bg-active);
  font-weight: 600;
}

.dropdown-divider {
  border: none;
  border-top: 1px solid var(--border-subtle);
  margin: 4px 0;
}

/* Modals & Dialogs */
.modal-dialog {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background-color: var(--bg-surface);
  color: var(--text-primary);
  box-shadow: var(--shadow-lg);
  padding: 0;
  width: min(500px, calc(100vw - 32px));
  outline: none;
}

.modal-dialog::backdrop {
  background-color: rgba(18, 21, 19, 0.45);
  backdrop-filter: blur(2px);
}

.modal-form {
  padding: 24px;
  display: flex;
  flex-direction: column;
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 14px;
}

.modal-eyebrow {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--accent);
  text-transform: uppercase;
}

.modal-header h2 {
  margin: 4px 0 0;
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 700;
}

.modal-intro {
  margin: 0 0 18px;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--text-secondary);
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.form-field label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

.field-hint {
  font-weight: 400;
  color: var(--text-tertiary);
}

.form-input, .form-textarea, .form-select {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background-color: var(--bg-app);
  color: var(--text-primary);
  padding: 8px 10px;
  font-size: 12.5px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-input:focus, .form-textarea:focus, .form-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-subtle);
  background-color: var(--bg-surface);
}

.form-field-check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px 0;
  font-size: 12.5px;
  user-select: none;
}

.form-checkbox {
  accent-color: var(--accent);
  width: 16px;
  height: 16px;
}

.form-range {
  accent-color: var(--accent);
  height: 6px;
}

.modal-divider {
  border: none;
  border-top: 1px solid var(--border-subtle);
  margin: 16px 0;
}

.danger-zone {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px;
  background-color: var(--accent-subtle);
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
}

.danger-zone-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 11.5px;
  color: var(--text-secondary);
}

.danger-zone-info strong {
  color: var(--accent);
}

.form-error {
  background-color: var(--accent-subtle);
  border: 1px solid var(--accent);
  border-radius: var(--radius-xs);
  padding: 8px 12px;
  color: var(--accent);
  font-size: 12px;
  margin-bottom: 14px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 8px;
}

/* Dialog Tabs */
.dialog-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}

.dialog-tab {
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-tertiary);
  border-bottom: 2px solid transparent;
  transition: all 0.12s ease;
}

.dialog-tab:hover {
  color: var(--text-primary);
}

.dialog-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  font-weight: 600;
}

/* Drop Zone */
.drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-md);
  padding: 32px 20px;
  text-align: center;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.drop-zone.dragover {
  border-color: var(--accent);
  background-color: var(--accent-subtle);
}

.drop-icon {
  width: 32px;
  height: 32px;
  color: var(--forest);
}

.file-upload-label {
  cursor: pointer;
  display: inline-block;
}

.opml-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background-color: var(--forest-subtle);
  border-radius: var(--radius-sm);
  color: var(--forest);
  font-size: 12px;
  font-weight: 500;
  margin-bottom: 14px;
}

/* Shortcuts Dialog */
.shortcuts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 18px;
}

.shortcut-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-secondary);
}

/* Feed Action Dialog Meta */
.feed-action-meta {
  background-color: var(--bg-hover);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text-primary);
}

.feed-action-buttons {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

/* Management Center */
.management-dialog {
  width: min(1040px, calc(100vw - 36px));
  height: min(760px, calc(100dvh - 36px));
  max-width: none;
}

.management-shell {
  display: grid;
  grid-template-rows: 58px 1fr;
  height: 100%;
  min-height: 0;
}

.management-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 18px 0 22px;
  border-bottom: 1px solid var(--border);
}

.management-header h2 {
  margin: 2px 0 0;
  font: 700 20px/1.1 var(--font-serif);
}

.management-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.management-workspace {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  min-height: 0;
}

.management-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 8px;
  border-right: 1px solid var(--border);
  background: var(--bg-sidebar);
}

.management-nav-item {
  width: 100%;
  padding: 7px 10px;
  border-radius: var(--radius-xs);
  color: var(--text-secondary);
  font-size: 12px;
  text-align: left;
}

.management-nav-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.management-nav-item.active {
  background: var(--bg-active);
  color: var(--text-primary);
  font-weight: 700;
}

.management-content {
  min-width: 0;
  overflow: auto;
  padding: 20px 22px 36px;
}

.management-loading,
.management-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 90px;
  color: var(--text-tertiary);
  font-size: 12px;
}

.management-empty {
  flex-direction: column;
}

.management-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.management-section-head h3 {
  margin: 0 0 4px;
  font: 700 18px/1.2 var(--font-serif);
}

.management-section-head p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 12px;
}

.management-inline-form,
.management-rule-form,
.management-digest-form {
  display: grid;
  gap: 8px;
  padding: 12px;
  margin-bottom: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-app);
}

.management-inline-form {
  grid-template-columns: minmax(180px, 1fr) 40px auto;
}

.management-rule-form {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.management-digest-form {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.management-span-2 {
  grid-column: span 2;
}

.management-form-grid {
  display: grid;
  grid-template-columns: 1fr 160px;
  gap: 10px;
}

.color-input {
  width: 40px;
  min-height: 32px;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
}

.compact-check {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  font-size: 11px;
}

.management-table {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.management-table-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 80px 80px 72px;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 6px 10px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 11px;
}

.management-table-row:last-child {
  border-bottom: 0;
}

.management-table-labels {
  min-height: 28px;
  background: var(--bg-hover);
  color: var(--text-tertiary);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.management-table-row-3 {
  grid-template-columns: minmax(180px, 1fr) 120px 60px;
}

.management-rule-row {
  grid-template-columns: 30px minmax(190px, 1.4fr) minmax(120px, 1fr) 60px 54px;
}

.management-opml-row,
.management-digest-row {
  grid-template-columns: minmax(220px, 1.5fr) minmax(120px, .8fr) 90px 54px 54px;
}

.management-table-row strong,
.management-table-row div {
  min-width: 0;
}

.management-table-row div > span {
  display: block;
  margin-top: 2px;
  overflow: hidden;
  color: var(--text-tertiary);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table-input {
  min-width: 0;
  border: 1px solid transparent;
  border-radius: var(--radius-xs);
  background: transparent;
  padding: 5px 6px;
  outline: 0;
}

.table-input:focus {
  border-color: var(--accent);
  background: var(--bg-surface);
}

.table-action {
  justify-self: start;
  color: var(--forest);
  font-size: 11px;
  font-weight: 700;
}

.table-action:hover {
  text-decoration: underline;
}

.table-action.danger,
.status-text.danger {
  color: var(--accent);
}

.management-name {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-primary);
  font-weight: 600;
}

.color-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--dot);
  flex-shrink: 0;
}

.status-switch {
  position: relative;
  width: 26px;
  height: 14px;
  border-radius: 8px;
  background: var(--border);
}

.status-switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--bg-surface);
  box-shadow: var(--shadow-sm);
  transition: transform .15s ease;
}

.status-switch.on {
  background: var(--forest);
}

.status-switch.on::after {
  transform: translateX(12px);
}

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.report-list {
  display: grid;
  gap: 8px;
}

.report-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-app);
}

.report-item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 12px;
  cursor: pointer;
}

.report-item summary span:first-child {
  display: grid;
  gap: 2px;
}

.report-item small {
  color: var(--text-tertiary);
  font-weight: 400;
}

.report-articles {
  display: grid;
  border-top: 1px solid var(--border);
}

.report-articles a {
  display: grid;
  grid-template-columns: 120px minmax(180px, 1fr);
  gap: 2px 12px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--border-subtle);
}

.report-articles a:hover {
  background: var(--bg-hover);
}

.report-articles a > span {
  grid-row: span 2;
  color: var(--forest);
  font-size: 10px;
  font-weight: 700;
}

.report-articles a > small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.article-tag-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  max-height: 260px;
  margin-bottom: 16px;
  overflow: auto;
}

.article-tag-option {
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  align-items: center;
  gap: 7px;
  padding: 7px 8px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  font-size: 11px;
}

.article-tag-option small {
  color: var(--text-tertiary);
}

/* Toast Notifications */
.toast-center {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  background-color: var(--text-primary);
  color: var(--bg-surface);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 500;
  box-shadow: var(--shadow-md);
  animation: toastFadeIn 0.2s ease-out;
  display: flex;
  align-items: center;
  gap: 8px;
}

.toast-error {
  background-color: var(--accent);
  color: #ffffff;
}

.toast-success {
  background-color: var(--forest);
  color: #ffffff;
}

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

/* ==========================================================================
   Responsive Adaptations
   ========================================================================== */

/* Compact Desktop (1024px) */
@media (max-width: 1024px) {
  :root {
    --sidebar-width: 210px;
    --list-width: 360px;
  }
  .tool-label {
    display: none;
  }
  .reader-source-tag {
    max-width: 140px;
  }
}

/* Tablet (768px - 1023px) */
@media (max-width: 860px) {
  .mobile-only {
    display: inline-flex !important;
  }

  .app-layout {
    grid-template-columns: var(--list-width) 1fr;
  }

  .pane-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 270px;
    z-index: 40;
    box-shadow: var(--shadow-lg);
    transform: translateX(-100%);
    transition: transform 0.2s ease-in-out;
  }

  body.mobile-sidebar-open .pane-sidebar {
    transform: translateX(0);
  }

  body.mobile-sidebar-open::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 35;
    background-color: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(2px);
  }

  .tool-label {
    display: none;
  }

  .reader-source-tag {
    max-width: 120px;
  }

  .mobile-back-text {
    display: none;
  }
}

/* Mobile Screens (<= 767px, e.g. 390px) */
@media (max-width: 767px) {
  .app-layout {
    display: block;
    height: 100dvh;
    width: 100vw;
    position: relative;
  }

  .pane {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    transition: transform 0.22s ease-in-out;
  }

  /* In mobile, panes are active one at a time */
  .pane-sidebar {
    transform: translateX(-100%);
    z-index: 40;
  }

  .pane-list {
    transform: translateX(0);
    z-index: 10;
  }

  .pane-reader {
    transform: translateX(100%);
    z-index: 20;
  }

  /* States */
  body.mobile-sidebar-open .pane-sidebar {
    transform: translateX(0);
  }

  body.mobile-reader-open .pane-reader {
    transform: translateX(0);
  }

  .reader-empty {
    display: none;
  }

  .reader-toolbar {
    padding: 0 8px;
  }

  .reader-source-tag {
    display: none;
  }

  .tool-label {
    display: none;
  }

  .mobile-back-text {
    display: none;
  }

  .reader-document {
    padding: 20px 18px 80px;
  }

  .doc-title {
    font-size: 24px;
  }

  .management-dialog {
    width: calc(100vw - 16px);
    height: calc(100dvh - 16px);
  }

  .management-workspace {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }

  .management-nav {
    flex-direction: row;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .management-nav-item {
    width: auto;
    white-space: nowrap;
  }

  .management-content {
    padding: 14px;
  }

  .management-rule-form,
  .management-digest-form,
  .management-inline-form,
  .management-form-grid {
    grid-template-columns: 1fr;
  }

  .management-span-2 {
    grid-column: auto;
  }

  .management-table-row,
  .management-table-row-3,
  .management-rule-row,
  .management-opml-row,
  .management-digest-row {
    grid-template-columns: 1fr auto;
  }

  .management-table-labels {
    display: none;
  }

  .article-tag-options {
    grid-template-columns: 1fr;
  }
}

/* Accessibility: Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* =============================================================================
   GitHub Radar (mode switch, repo rows, inline 析, detail, sparkline)
   ============================================================================= */

.content-mode-switch {
  display: inline-flex;
  align-items: center;
  background: var(--bg-hover);
  padding: 2px;
  border-radius: var(--radius-sm);
}

.mode-btn {
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  letter-spacing: 0.02em;
}

.mode-btn.active {
  background: var(--bg-surface);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}

.radar-controls .board-btn {
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: var(--radius-xs);
  cursor: pointer;
}

.radar-controls .board-btn.active {
  background: var(--bg-surface);
  color: var(--accent);
  box-shadow: var(--shadow-sm);
}

.radar-category-select {
  background: var(--bg-surface);
  color: var(--text-primary);
  border: 1px solid var(--bg-hover);
  border-radius: var(--radius-xs);
  font-size: 11px;
  padding: 3px 6px;
  cursor: pointer;
}

.radar-status-banner {
  margin: 8px 12px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: var(--accent-subtle);
  color: var(--accent);
  font-size: 12px;
}

/* Repo rows: high-density, one-liner as visual headline */
.radar-list .repo-row {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 8px 12px 7px;
  border-bottom: 1px solid var(--bg-hover);
  border-left: 3px solid transparent;
  cursor: pointer;
  position: relative;
}

.radar-list .repo-row:hover {
  background: var(--bg-hover);
}

.radar-list .repo-row.active {
  background: var(--bg-active);
  border-left-color: var(--accent);
}

.repo-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.repo-row-name {
  font-size: 11px;
  color: var(--text-tertiary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: var(--font-mono);
}

.repo-row .row-actions {
  display: inline-flex;
  gap: 2px;
  opacity: 0;
  transition: opacity 0.12s ease;
}

.repo-row:hover .row-actions,
.repo-row:focus-within .row-actions,
.repo-row.expanded .row-actions,
.repo-row.active .row-actions {
  opacity: 1;
}

.repo-btn-expand {
  font-weight: 700;
  color: var(--accent);
  font-size: 12px;
}

.repo-row-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  line-height: 1.35;
}

.repo-row.unread .repo-row-title {
  color: var(--text-primary);
  font-weight: 700;
}

.repo-row-metrics {
  display: flex;
  gap: 12px;
  font-size: 11px;
  color: var(--text-tertiary);
  font-family: var(--font-mono);
}

.repo-row-metrics strong {
  color: var(--text-secondary);
  font-weight: 600;
}

.repo-row.unread .repo-row-metrics strong {
  color: var(--accent);
}

.repo-row-meta {
  font-size: 10.5px;
  color: var(--text-tertiary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.repo-flag {
  display: inline-block;
  padding: 0 5px;
  border-radius: 8px;
  background: var(--accent-subtle);
  color: var(--accent);
  font-size: 10px;
  font-weight: 600;
  line-height: 16px;
}

.repo-expand {
  margin-top: 4px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  border: 1px solid var(--bg-hover);
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.repo-expand p {
  margin: 0 0 4px;
}

.repo-expand strong {
  color: var(--accent);
  margin-right: 6px;
}

.repo-expand-list {
  margin: 0 0 4px;
  padding-left: 18px;
}

.repo-expand-release {
  display: inline-block;
  margin-left: 8px;
  color: var(--text-tertiary);
  font-size: 11px;
}

.repo-expand-pending {
  color: var(--text-tertiary);
  margin: 0;
}

.radar-group-header {
  padding: 8px 12px 4px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

/* Detail pane */
.radar-document {
  padding: 24px 32px 48px;
  max-width: var(--reader-max-width, 780px);
  margin: 0 auto;
}

.radar-detail-title {
  font-size: 22px;
  margin: 0 0 2px;
  font-family: var(--font-mono);
}

.radar-detail-title a {
  color: var(--text-primary);
  text-decoration: none;
}

.radar-detail-title a:hover {
  color: var(--accent);
}

.radar-detail-sub {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-bottom: 10px;
}

.radar-detail-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 13px;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  padding: 10px 12px;
  background: var(--bg-surface);
  border-radius: var(--radius-sm);
  border: 1px solid var(--bg-hover);
}

.radar-detail-metrics strong {
  color: var(--accent);
}

.radar-detail-quality {
  color: var(--text-tertiary);
  font-size: 11px;
  align-self: center;
}

.radar-detail-section {
  margin-top: 18px;
}

.radar-detail-section h3 {
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--accent);
  margin: 0 0 6px;
  text-transform: uppercase;
}

.radar-detail-section p {
  margin: 0;
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-primary);
  white-space: pre-line;
}

.radar-detail-list {
  margin: 0;
  padding-left: 20px;
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-primary);
}

.radar-trend-note {
  margin-top: 4px !important;
  font-size: 11.5px !important;
  color: var(--text-tertiary) !important;
}

.radar-chart {
  width: 100%;
  height: auto;
  background: var(--bg-surface);
  border: 1px solid var(--bg-hover);
  border-radius: var(--radius-sm);
}

.radar-chart-empty {
  padding: 16px;
  font-size: 12.5px;
  color: var(--text-tertiary);
  background: var(--bg-surface);
  border: 1px dashed var(--bg-hover);
  border-radius: var(--radius-sm);
}

.radar-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 26px;
  padding-top: 16px;
  border-top: 1px solid var(--bg-hover);
}

.radar-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  font-size: 12.5px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid var(--bg-hover);
  background: var(--bg-surface);
  color: var(--text-secondary);
  cursor: pointer;
  text-decoration: none;
}

.radar-action-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.radar-action-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.radar-action-primary:hover {
  color: #fff;
  opacity: 0.92;
}

/* In radar mode, article-only toolbar actions stay out of the way */
body[data-content-mode="radar"] #btn-mark-all-read,
body[data-content-mode="radar"] #btn-toggle-multi {
  display: none;
}
