/* ============================================================
   CSS Variables — Gruvbox Dark palette
   ============================================================ */
:root {
  --bg:         #1d2021;
  --bg-surface: #282828;
  --bg-hover:   #3c3836;
  --bg-active:  #504945;
  --border:     #3c3836;
  --text:       #ebdbb2;
  --text-muted: #a89984;
  --text-dim:   #7c6f64;
  --accent:     #83a598;
  --accent-dim: #458588;
  --red:        #fb4934;
  --green:      #b8bb26;
  --yellow:     #fabd2f;
  --orange:     #fe8019;

  --font-sans:  -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono:  "SF Mono", "Fira Code", "Fira Mono", Menlo, Consolas, monospace;

  --sidebar-w:  280px;
  --header-h:   52px;
  --content-max: 720px;

  --radius:     4px;
  --transition: 150ms ease;
}

/* ============================================================
   Reset & Base
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow: hidden;
  height: 100vh;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

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

input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.5rem 0.75rem;
  outline: none;
  transition: border-color var(--transition);
}

input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
}

::selection {
  background: var(--accent-dim);
  color: var(--text);
}

[hidden] {
  display: none !important;
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  background: var(--bg-hover);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--bg-active);
}

/* ============================================================
   Login Screen
   ============================================================ */
.login-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  padding: 1rem;
}

.login-box {
  width: 100%;
  max-width: 380px;
}

.login-box h1 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.login-subtitle {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
}

.login-box label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.login-box input {
  width: 100%;
  margin-bottom: 1rem;
}

.login-box button {
  width: 100%;
  padding: 0.6rem 1rem;
  background: var(--accent-dim);
  color: var(--text);
  border-radius: var(--radius);
  font-weight: 500;
  transition: background var(--transition);
}

.login-box button:hover {
  background: var(--accent);
  color: var(--bg);
}

.login-advanced-toggle {
  display: block;
  width: 100%;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-top: 0.5rem;
  padding: 0.3rem;
}

.login-advanced-toggle:hover {
  color: var(--text-muted);
}

.login-advanced {
  margin-bottom: 0.5rem;
}

.login-error {
  margin-top: 0.75rem;
  color: var(--red);
  font-size: 0.85rem;
}

/* ============================================================
   App Layout
   ============================================================ */
.app {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

/* Header */
.header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  height: var(--header-h);
  padding: 0 1rem;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  z-index: 20;
}

.header-title {
  font-size: 1rem;
  font-weight: 600;
  white-space: nowrap;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
}

.sidebar-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  color: var(--text-muted);
  transition: background var(--transition), color var(--transition);
}

.sidebar-toggle:hover {
  background: var(--bg-hover);
  color: var(--text);
}

.search-wrapper {
  position: relative;
}

.search-input {
  width: 220px;
  padding-left: 0.75rem;
  padding-right: 0.75rem;
  font-size: 0.85rem;
  height: 34px;
  background: var(--bg);
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.5rem;
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: 0.8rem;
  transition: background var(--transition), color var(--transition);
  white-space: nowrap;
}

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

/* Layout: sidebar + main */
.layout {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* ============================================================
   Sidebar
   ============================================================ */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.sidebar-nav {
  padding: 0.5rem 0;
  flex: 1;
}

.sidebar-section {
  padding: 0.25rem 0;
}

.sidebar-section + .sidebar-section {
  border-top: 1px solid var(--border);
}

.feed-group-label {
  display: block;
  padding: 0.5rem 1rem 0.25rem;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  user-select: none;
}

.feed-item {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 0.4rem 1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: left;
  transition: background var(--transition), color var(--transition);
  gap: 0.5rem;
}

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

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

.feed-item-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.feed-item-count {
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
  min-width: 1.2em;
  text-align: right;
}

.feed-item-count:empty,
.feed-item-count[data-count="0"] {
  display: none;
}

/* Add Feed */
.feed-item--add {
  color: var(--accent);
}

.add-feed-form {
  padding: 0.5rem 1rem;
  border-bottom: 1px solid var(--border);
}

.add-feed-input {
  width: 100%;
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
}

.add-feed-actions {
  display: flex;
  gap: 0.5rem;
}

.add-feed-submit {
  padding: 0.3rem 0.75rem;
  background: var(--accent-dim);
  color: var(--text);
  border-radius: var(--radius);
  font-size: 0.8rem;
  transition: background var(--transition);
}

.add-feed-submit:hover {
  background: var(--accent);
  color: var(--bg);
}

.add-feed-cancel {
  padding: 0.3rem 0.75rem;
  color: var(--text-muted);
  font-size: 0.8rem;
  border-radius: var(--radius);
  transition: background var(--transition);
}

.add-feed-cancel:hover {
  background: var(--bg-hover);
}

.add-feed-error {
  margin-top: 0.5rem;
  color: var(--red);
  font-size: 0.8rem;
}

/* ============================================================
   Main Content Area
   ============================================================ */
.main {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* Entry List */
.entry-list-pane {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.entry-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.entry-list-filters {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.entry-list-title {
  font-size: 0.95rem;
  font-weight: 600;
}

.status-filter {
  font-size: 0.8rem;
  height: 30px;
  padding: 0 0.5rem;
  background: var(--bg-surface);
}

.entry-list {
  flex: 1;
  overflow-y: auto;
}

.entry-card {
  display: block;
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background var(--transition);
}

.entry-card:hover {
  background: var(--bg-hover);
}

.entry-card.active {
  background: var(--bg-hover);
  border-left: 3px solid var(--accent);
  padding-left: calc(1.25rem - 3px);
}

.entry-card.is-read .entry-card-title {
  color: var(--text-muted);
  font-weight: 400;
}

.entry-card-title {
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.4;
  margin-bottom: 0.3rem;
  color: var(--text);
}

.entry-card-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--text-dim);
  flex-wrap: wrap;
}

.entry-card-feed {
  color: var(--text-muted);
}

.entry-card-star {
  color: var(--yellow);
}

.entry-card-snippet {
  margin-top: 0.35rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.load-more-btn {
  display: block;
  width: 100%;
  padding: 0.75rem;
  font-size: 0.85rem;
  color: var(--accent);
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  transition: background var(--transition);
}

.load-more-btn:hover {
  background: var(--bg-hover);
}

.loading, .empty-state {
  padding: 2rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ============================================================
   Entry Reading Pane
   ============================================================ */
.entry-reading-pane {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.reading-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 1.25rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  gap: 0.5rem;
}

.back-btn {
  font-size: 0.85rem;
  color: var(--text-muted);
  padding: 0.35rem 0.5rem;
  border-radius: var(--radius);
  transition: background var(--transition), color var(--transition);
}

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

.reading-actions {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

/* Article content */
.entry-content {
  flex: 1;
  overflow-y: auto;
  padding: 2rem 1.5rem 4rem;
}

.entry-content-inner {
  max-width: var(--content-max);
  margin: 0 auto;
}

.entry-header {
  margin-bottom: 2rem;
}

.entry-header h1 {
  font-size: 1.6rem;
  font-weight: 600;
  line-height: 1.35;
  margin-bottom: 0.75rem;
}

.entry-header-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.entry-header-meta a {
  color: var(--accent);
}

/* Article typography */
.entry-body {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--text);
}

.entry-body h1, .entry-body h2, .entry-body h3,
.entry-body h4, .entry-body h5, .entry-body h6 {
  margin-top: 1.8em;
  margin-bottom: 0.6em;
  font-weight: 600;
  line-height: 1.3;
}

.entry-body h1 { font-size: 1.4rem; }
.entry-body h2 { font-size: 1.25rem; }
.entry-body h3 { font-size: 1.1rem; }
.entry-body h4, .entry-body h5, .entry-body h6 { font-size: 1rem; }

.entry-body p {
  margin-bottom: 1.2em;
}

.entry-body ul, .entry-body ol {
  margin-bottom: 1.2em;
  padding-left: 1.5em;
}

.entry-body li {
  margin-bottom: 0.3em;
}

.entry-body blockquote {
  border-left: 3px solid var(--accent-dim);
  padding-left: 1em;
  margin: 1.2em 0;
  color: var(--text-muted);
  font-style: italic;
}

.entry-body pre {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  overflow-x: auto;
  margin-bottom: 1.2em;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.5;
}

.entry-body code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--bg);
  padding: 0.15em 0.35em;
  border-radius: 3px;
}

.entry-body pre code {
  background: none;
  padding: 0;
  font-size: inherit;
}

.entry-body img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
  margin: 1em 0;
}

.entry-body a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.entry-body a:hover {
  color: var(--text);
}

.entry-body table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.2em;
  font-size: 0.9rem;
}

.entry-body th, .entry-body td {
  border: 1px solid var(--border);
  padding: 0.5rem 0.75rem;
  text-align: left;
}

.entry-body th {
  background: var(--bg-hover);
  font-weight: 600;
}

.entry-body hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2em 0;
}

.entry-body figure {
  margin: 1.2em 0;
}

.entry-body figcaption {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
  text-align: center;
}

.entry-body iframe, .entry-body video {
  max-width: 100%;
  margin: 1em 0;
}

/* ============================================================
   Keyboard Shortcuts Overlay
   ============================================================ */
.shortcuts-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.shortcuts-box {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem 2rem;
  max-width: 420px;
  width: 90%;
}

.shortcuts-box h2 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.shortcuts-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.5rem 1rem;
  align-items: center;
  margin-bottom: 1.25rem;
}

kbd {
  display: inline-block;
  padding: 0.15rem 0.45rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
  min-width: 1.6em;
  text-align: center;
}

.shortcuts-grid span {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.close-shortcuts-btn {
  display: block;
  margin: 0 auto;
  padding: 0.4rem 1.5rem;
  border-radius: var(--radius);
  background: var(--bg-hover);
  color: var(--text);
  font-size: 0.85rem;
  transition: background var(--transition);
}

.close-shortcuts-btn:hover {
  background: var(--bg-active);
}

/* ============================================================
   Notes Section (in reading pane)
   ============================================================ */
.entry-notes {
  max-width: var(--content-max);
  margin: 2rem auto 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.notes-section {
  margin-bottom: 2rem;
}

.notes-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.notes-header h3 {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.notes-placeholder {
  font-size: 0.85rem;
  color: var(--text-dim);
  font-style: italic;
}

.notes-content {
  font-size: 0.9rem;
  line-height: 1.7;
}

.notes-textarea {
  width: 100%;
  min-height: 150px;
  resize: vertical;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.6;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem;
}

.notes-textarea:focus {
  border-color: var(--accent);
  outline: none;
}

.notes-editor-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
  align-items: center;
}

.notes-preview {
  margin-top: 0.75rem;
  padding: 0.75rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

/* ============================================================
   Starred state
   ============================================================ */
.star-filled {
  fill: var(--yellow);
  stroke: var(--yellow);
}

/* ============================================================
   Feed gear icon (sidebar)
   ============================================================ */
.feed-item-gear {
  display: none;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: var(--radius);
  color: var(--text-dim);
  flex-shrink: 0;
  transition: color var(--transition), background var(--transition);
}

.feed-item:hover .feed-item-gear {
  display: inline-flex;
}

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

/* ============================================================
   Category collapsible groups (sidebar)
   ============================================================ */
.category-group-header {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 0.5rem 1rem 0.25rem;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  user-select: none;
  cursor: pointer;
  gap: 0.35rem;
  transition: color var(--transition);
}

.category-group-header:hover {
  color: var(--text-muted);
}

.category-group-header .category-arrow {
  transition: transform var(--transition);
  font-size: 0.6rem;
}

.category-group-header.collapsed .category-arrow {
  transform: rotate(-90deg);
}

.category-group-feeds {
  overflow: hidden;
  transition: max-height 200ms ease;
}

.category-group-feeds.collapsed {
  max-height: 0 !important;
  overflow: hidden;
}

.category-group-count {
  margin-left: auto;
  font-size: 0.65rem;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.category-group-count:empty,
.category-group-count[data-count="0"] {
  display: none;
}

/* ============================================================
   Context Menu
   ============================================================ */
.context-menu {
  position: fixed;
  z-index: 200;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  min-width: 150px;
  padding: 0.25rem 0;
}

.context-menu-item {
  display: block;
  width: 100%;
  padding: 0.5rem 1rem;
  text-align: left;
  font-size: 0.85rem;
  color: var(--text);
  transition: background var(--transition);
}

.context-menu-item:hover {
  background: var(--bg-hover);
}

.context-menu-item--danger {
  color: var(--red);
}

.context-menu-item--danger:hover {
  background: rgba(251, 73, 52, 0.1);
}

/* ============================================================
   Modal Overlay (shared)
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.modal-box {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  width: 90%;
  max-width: 480px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
}

.modal-box--small {
  max-width: 360px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
}

.modal-header h2 {
  font-size: 1.05rem;
  font-weight: 600;
}

.modal-close-btn {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: var(--text-muted);
  border-radius: var(--radius);
  transition: background var(--transition), color var(--transition);
}

.modal-close-btn:hover {
  background: var(--bg-hover);
  color: var(--text);
}

.modal-body {
  padding: 1.25rem;
  overflow-y: auto;
}

.modal-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.modal-label + .modal-label {
  margin-top: 0.75rem;
}

.modal-input {
  width: 100%;
  margin-bottom: 0.75rem;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  border-top: 1px solid var(--border);
}

/* ============================================================
   Buttons (shared)
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.4rem 0.9rem;
  font-size: 0.85rem;
  font-weight: 500;
  border-radius: var(--radius);
  cursor: pointer;
  border: none;
  transition: background var(--transition), color var(--transition);
  white-space: nowrap;
}

.btn--primary {
  background: var(--accent-dim);
  color: var(--text);
}

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

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

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

.btn--danger {
  background: rgba(251, 73, 52, 0.15);
  color: var(--red);
}

.btn--danger:hover {
  background: rgba(251, 73, 52, 0.3);
}

/* ============================================================
   Settings Panel
   ============================================================ */
#settings-overlay {
  justify-content: flex-end;
}

.settings-panel {
  background: var(--bg-surface);
  border-left: 1px solid var(--border);
  width: 380px;
  max-width: 90%;
  height: 100%;
  display: flex;
  flex-direction: column;
  animation: slide-in-right 200ms ease;
}

@keyframes slide-in-right {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

.settings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
}

.settings-header h2 {
  font-size: 1.1rem;
  font-weight: 600;
}

.settings-body {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.25rem;
}

.settings-section {
  margin-bottom: 1.5rem;
}

.settings-section h3 {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.settings-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

.settings-input {
  flex: 1;
  font-size: 0.85rem;
  min-width: 0;
}

.settings-status {
  margin-top: 0.5rem;
  font-size: 0.8rem;
  color: var(--green);
}

.settings-status.error {
  color: var(--red);
}

.opml-import-label {
  cursor: pointer;
}

/* ============================================================
   Category List (in settings)
   ============================================================ */
.category-list {
  margin-bottom: 0.75rem;
}

.category-list-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--border);
}

.category-list-item:last-child {
  border-bottom: none;
}

.category-list-name {
  flex: 1;
  font-size: 0.85rem;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.category-list-name input {
  width: 100%;
  font-size: 0.85rem;
  padding: 0.2rem 0.5rem;
}

.category-list-actions {
  display: flex;
  gap: 0.25rem;
}

.category-list-actions button {
  padding: 0.2rem 0.4rem;
  font-size: 0.75rem;
  border-radius: var(--radius);
  color: var(--text-muted);
  transition: background var(--transition), color var(--transition);
}

.category-list-actions button:hover {
  background: var(--bg-hover);
  color: var(--text);
}

.category-list-actions button.cat-delete:hover {
  color: var(--red);
}

/* ============================================================
   Feed Discovery
   ============================================================ */
.discover-list {
  padding: 0.5rem 0;
}

.discover-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid var(--border);
  gap: 0.75rem;
}

.discover-item:last-child {
  border-bottom: none;
}

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

.discover-item-title {
  font-size: 0.9rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.discover-item-url {
  font-size: 0.75rem;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ============================================================
   Add feed category select
   ============================================================ */
.add-feed-category {
  width: 100%;
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
  height: 32px;
  padding: 0 0.5rem;
  background: var(--bg);
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 768px) {
  .sidebar-toggle {
    display: flex;
  }

  .sidebar {
    position: fixed;
    top: var(--header-h);
    left: 0;
    bottom: 0;
    z-index: 30;
    transform: translateX(-100%);
    transition: transform 200ms ease;
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.3);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    top: var(--header-h);
    background: rgba(0, 0, 0, 0.4);
    z-index: 25;
  }

  .search-input {
    width: 140px;
  }

  .entry-content {
    padding: 1.25rem 1rem 3rem;
  }

  .entry-header h1 {
    font-size: 1.3rem;
  }

  .reading-actions .icon-btn span {
    display: none;
  }
}

@media (max-width: 480px) {
  .search-input {
    width: 110px;
  }

  .header-title {
    display: none;
  }
}
