*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

:root {
  --accent:      #f47218;
  --accent-light:#fff3e8;
  --accent-dark: #c45c10;
  --paper:       #faf8f5;
  --ink:         #2d2a26;
  --muted:       #78716c;
  --border:      #e7e5e4;
  --white:       #ffffff;
  --unread-dot:  #f47218;
  --radius:      8px;
  --font-sans:   'Inter', system-ui, sans-serif;
  --font-serif:  Georgia, Cambria, serif;
}

html, body { height: 100%; }
body {
  font-family: var(--font-sans);
  background: var(--paper);
  color: var(--ink);
  font-size: 14px;
  /* Empêche iOS d'agrandir le texte en paysage */
  -webkit-text-size-adjust: 100%;
}
/* Hauteur réelle du viewport (100dvh sur les navigateurs modernes, fallback 100vh) */
#app {
  height: 100vh;
  height: 100dvh;
}

/* ── Layout ─────────────────────────────────────────────────────────────── */
#app {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

.panel { display: flex; flex-direction: column; overflow: hidden; }

.panel-sidebar {
  flex: 0 0 240px;
  background: var(--white);
  border-right: 1px solid var(--border);
  min-height: 0;
}
.panel-list {
  flex: 0 0 300px;
  background: var(--paper);
  border-right: 1px solid var(--border);
}
.panel-reader {
  flex: 1;
  min-width: 0;
  background: var(--paper);
}

/* ── Sidebar ─────────────────────────────────────────────────────────────── */
.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}
.logo { font-weight: 700; font-size: 15px; color: var(--accent); letter-spacing: -0.3px; }

#sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  margin: 0 4px;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 13px;
  color: #57534e;
  user-select: none;
  transition: background 0.1s;
}
.nav-item:hover  { background: #f5f4f2; }
.nav-item.active { background: var(--accent-light); color: var(--accent-dark); font-weight: 500; }
.nav-icon { font-size: 15px; flex: none; }
.nav-label { flex: 1; truncate: ellipsis; white-space: nowrap; overflow: hidden; }

/* Feed item */
.feed-item {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  margin: 0 4px;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 13px;
  color: #57534e;
  user-select: none;
  transition: background 0.1s;
  position: relative;
}
.feed-item:hover  { background: #f5f4f2; }
.feed-item.active { background: var(--accent-light); color: var(--accent-dark); }
.feed-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.feed-favicon { width: 16px; height: 16px; border-radius: 2px; object-fit: contain; flex: none; }
.feed-title { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.feed-delete {
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  color: #a8a29e;
  transition: opacity 0.15s;
  flex: none;
  line-height: 1;
}
.feed-item:hover .feed-delete { opacity: 1; }
.feed-delete:hover { color: #ef4444; }

/* Folder */
.folder-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  margin: 0 4px;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: #44403c;
  user-select: none;
  transition: background 0.1s;
}
.folder-header:hover  { background: #f5f4f2; }
.folder-header.active { background: var(--accent-light); color: var(--accent-dark); }
.folder-toggle { font-size: 20px; line-height: 1; color: #a8a29e; flex: none; width: 16px; }
.folder-name   { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.folder-actions { display: flex; gap: 4px; opacity: 0; transition: opacity 0.15s; }
.folder-header:hover .folder-actions { opacity: 1; }
.folder-act-btn { font-size: 11px; color: #a8a29e; line-height: 1; }
.folder-act-btn:hover { color: var(--accent); }
.folder-act-btn.del:hover { color: #ef4444; }
.folder-children { padding-left: 8px; }
.feed-item { margin-left: 12px; }

/* Drag-over highlight */
.drag-over { outline: 2px dashed var(--accent); outline-offset: -2px; border-radius: var(--radius); }

.divider { border: none; border-top: 1px solid var(--border); margin: 6px 12px; }

.sidebar-footer {
  border-top: 1px solid var(--border);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.footer-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 12px;
  color: var(--muted);
  text-align: left;
  padding: 2px 0;
  font-family: var(--font-sans);
}
.footer-btn:hover { color: var(--accent); }

/* inline add-feed form */
.add-feed-form {
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.add-feed-row { display: flex; gap: 4px; }
.add-feed-form input {
  flex: 1; min-width: 0;
  font-size: 11px;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 8px;
  outline: none;
  font-family: var(--font-sans);
}
.add-feed-form input:focus { border-color: var(--accent); }
.add-feed-error { font-size: 11px; color: #ef4444; }

.btn-ok {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 11px;
  cursor: pointer;
  white-space: nowrap;
  font-family: var(--font-sans);
}
.btn-ok:disabled { opacity: 0.5; }
.btn-cancel { background: none; border: none; cursor: pointer; font-size: 13px; color: #a8a29e; }
.btn-cancel:hover { color: #57534e; }

/* ── Badge / counts ─────────────────────────────────────────────────────── */
.badge {
  font-size: 10px;
  font-weight: 600;
  background: var(--accent);
  color: #fff;
  border-radius: 99px;
  padding: 1px 5px;
  line-height: 16px;
  flex: none;
}

/* ── Article list ───────────────────────────────────────────────────────── */
.list-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--white);
}
.list-header h2 { flex: 1; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.text-btn {
  background: none; border: none; cursor: pointer;
  font-size: 11px; color: var(--muted); white-space: nowrap;
  font-family: var(--font-sans);
}
.text-btn:hover { color: var(--accent); }
.text-btn:disabled { opacity: 0.5; cursor: default; }
.text-btn:disabled:hover { color: var(--muted); }

.list-controls {
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  border-bottom: 1px solid var(--border);
  background: var(--white);
}
#search-input {
  width: 100%;
  font-size: 12px;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 5px 12px;
  outline: none;
  font-family: var(--font-sans);
  background: var(--paper);
}
#search-input:focus { border-color: var(--accent); }

.toggle-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
}
.toggle {
  width: 32px; height: 17px;
  background: #d6d3d1;
  border-radius: 99px;
  position: relative;
  transition: background 0.2s;
  flex: none;
}
.toggle.on { background: var(--accent); }
.toggle-thumb {
  width: 13px; height: 13px;
  background: #fff;
  border-radius: 50%;
  position: absolute;
  top: 2px; left: 2px;
  transition: left 0.2s;
  box-shadow: 0 1px 2px rgba(0,0,0,.2);
}
.toggle.on .toggle-thumb { left: 17px; }

#article-list { flex: 1; overflow-y: auto; }

.article-item {
  padding: 12px;
  border-bottom: 1px solid #f0eeec;
  cursor: pointer;
  transition: background 0.1s;
}
.article-item:hover  { background: #f5f4f2; }
.article-item.active { background: var(--accent-light); border-left: 3px solid var(--accent); padding-left: 9px; }
.article-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}
.article-feed { font-size: 11px; color: var(--muted); flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.article-date { font-size: 11px; color: #a8a29e; flex: none; }
.article-title {
  font-size: 13px;
  line-height: 1.4;
  color: var(--ink);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 4px;
}
.article-title.unread { font-weight: 600; }
.unread-dot {
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  margin-right: 5px;
  vertical-align: middle;
  flex: none;
}
.article-excerpt {
  font-size: 11px;
  color: #a8a29e;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.5;
}

.list-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 48px 16px;
  color: #a8a29e;
  gap: 8px;
}
.list-empty .icon { font-size: 40px; }
.list-empty p { font-size: 13px; }

/* ── Reader ─────────────────────────────────────────────────────────────── */
.reader-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  background: rgba(250,248,245,.85);
  backdrop-filter: blur(6px);
  position: sticky;
  top: 0;
  z-index: 10;
}
.reader-feed-name { font-size: 12px; color: var(--muted); flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#reader-feed-dot { width: 16px; height: 16px; border-radius: 2px; flex: none; display: flex; align-items: center; justify-content: center; }

.star-btn {
  background: none; border: none; cursor: pointer;
  font-size: 20px; line-height: 1;
  color: #d6d3d1;
  transition: color 0.15s, transform 0.1s;
}
.star-btn:hover    { color: #fbbf24; transform: scale(1.1); }
.star-btn.starred  { color: #f59e0b; }

.ext-link { color: var(--muted); text-decoration: none; }
.ext-link:hover { color: var(--accent); }

/* Bouton marquer non lu */
#btn-mark-unread { color: #d6d3d1; transition: color 0.15s; }
#btn-mark-unread:hover { color: var(--accent); }
#btn-mark-unread.is-unread { color: var(--accent); }

/* Toast */
.app-toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(16px);
  background: #1c1917;
  color: #fafaf9;
  padding: 10px 20px;
  border-radius: 24px;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 9999;
}
.app-toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.app-toast.clickable {
  pointer-events: auto;
  cursor: pointer;
  text-decoration: underline;
}


.reader-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #a8a29e;
  gap: 8px;
}
.empty-icon { font-size: 52px; }
.reader-empty p { font-size: 14px; }
.empty-sub { font-size: 12px; color: #c4bfba; }

.reader-content {
  flex: 1;
  overflow-y: auto;
  padding: 0 0 80px;
}
.reader-inner { max-width: 680px; margin: 0 auto; padding: 32px 24px; }

.reader-title {
  font-family: var(--font-sans);
  font-size: 24px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--ink);
  margin-bottom: 12px;
}
.reader-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 13px;
  color: var(--muted);
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}
.reader-meta a { color: var(--accent); text-decoration: none; }
.reader-meta a:hover { text-decoration: underline; }

/* Article body */
.article-body {
  font-family: var(--font-serif);
  font-size: 16px;
  line-height: 1.75;
  color: var(--ink);
}
.article-body h1,.article-body h2,.article-body h3 { font-family: var(--font-sans); font-weight: 600; margin: 24px 0 8px; }
.article-body h1 { font-size: 22px; }
.article-body h2 { font-size: 18px; }
.article-body h3 { font-size: 16px; }
.article-body p  { margin-bottom: 16px; }
.article-body a  { color: var(--accent); }
.article-body a:hover { color: var(--accent-dark); }
.article-body img { max-width: 100%; border-radius: 6px; margin: 16px 0; }
.article-body pre { background: #f5f4f2; padding: 12px; border-radius: 6px; overflow-x: auto; font-size: 13px; margin: 16px 0; }
.article-body code { background: #f5f4f2; padding: 1px 5px; border-radius: 4px; font-size: 13px; }
.article-body pre code { background: transparent; padding: 0; }
.article-body blockquote { border-left: 3px solid #fcd9b3; padding-left: 16px; color: var(--muted); font-style: italic; margin: 16px 0; }
.article-body ul { list-style: disc; padding-left: 24px; margin-bottom: 16px; }
.article-body ol { list-style: decimal; padding-left: 24px; margin-bottom: 16px; }
.article-body li { margin-bottom: 4px; }
.article-body figure { margin: 16px 0; }
.article-body figcaption { font-size: 12px; color: var(--muted); font-family: var(--font-sans); margin-top: 6px; }
.article-body table { border-collapse: collapse; width: 100%; margin: 16px 0; font-size: 14px; }
.article-body th,.article-body td { border: 1px solid var(--border); padding: 8px 12px; text-align: left; }
.article-body th { background: #f5f4f2; font-family: var(--font-sans); font-weight: 600; }

/* ── Embeds (image à la une / podcast / vidéo) ──────────────────────────── */
.featured-image {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  border-radius: var(--radius);
  margin: 0 0 16px;
  display: block;
}
.podcast-player { width: 100%; margin: 0 0 16px; }
.video-embed {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  margin: 0 0 16px;
  border-radius: var(--radius);
  overflow: hidden;
  background: #000;
}
.video-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* ── Gestion des flux ────────────────────────────────────────────────────── */
#feeds-manager  { height: 100vh; height: 100dvh; overflow-y: auto; background: var(--paper); }
#admin-panel    { height: 100vh; height: 100dvh; overflow-y: auto; background: var(--paper); }
.feeds-manager-header {
  display: flex; align-items: center; gap: 8px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0;
  background: var(--paper);
}
.feeds-manager-header h2 { font-size: 16px; font-weight: 600; }
.feeds-manager-toolbar {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  padding: 10px 20px;
  border-bottom: 1px solid var(--border);
}
#feeds-manager-list { max-width: 760px; margin: 0 auto; padding: 16px 20px 60px; }
.feeds-manager-row {
  display: flex; flex-direction: column; gap: 10px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 10px;
  background: var(--white);
}
.fm-main { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.fm-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.fm-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.feeds-manager-colors { display: flex; gap: 4px; flex: none; }
.color-swatch {
  width: 16px; height: 16px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  padding: 0;
}
.color-swatch.active { border-color: var(--ink); }
.fm-title { flex: 1 1 160px; min-width: 0; }
.fm-url   { flex: 2 1 240px; min-width: 0; }
.fm-title, .fm-url, .fm-folder {
  font-size: 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px 8px;
  outline: none;
  font-family: var(--font-sans);
}
.fm-title:focus, .fm-url:focus, .fm-folder:focus { border-color: var(--accent); }
.feeds-manager-row .fm-delete {
  display: inline-flex;
  opacity: 1;
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 12px;
  font-family: var(--font-sans);
  color: var(--muted);
}
.feeds-manager-row .fm-delete:hover { border-color: #ef4444; color: #ef4444; background: #fef2f2; }
.fm-error { flex-basis: 100%; }

.fm-health {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  flex: none;
}
.fm-health-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  flex: none;
  background: var(--muted);
}
.fm-health-ok      .fm-health-dot { background: #10b981; }
.fm-health-warn    .fm-health-dot { background: #f59e0b; }
.fm-health-bad     .fm-health-dot { background: #ef4444; }
.fm-health-unknown .fm-health-dot { background: #a8a29e; }

/* ── Admin ───────────────────────────────────────────────────────────────── */
#admin-panel-content { max-width: 760px; margin: 0 auto; padding: 20px 20px 60px; }
.admin-loading { color: var(--muted); font-size: 13px; }
.admin-error   { color: #ef4444; font-size: 13px; }
.admin-global-actions { margin-bottom: 20px; }
.admin-section { margin-bottom: 24px; }
.admin-section h3 { font-size: 14px; font-weight: 600; margin-bottom: 12px; }
.admin-discover-url-cell {
  max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--muted); font-size: 12px;
}
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.admin-table th {
  text-align: left;
  padding: 8px 12px;
  border-bottom: 2px solid var(--border);
  font-weight: 600;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.admin-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.admin-table tr:last-child td { border-bottom: none; }
.admin-btn-cache {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 11px;
  cursor: pointer;
  color: var(--muted);
  font-family: var(--font-sans);
}
.admin-btn-cache:hover { border-color: #ef4444; color: #ef4444; }
.admin-btn-cache:disabled { opacity: 0.4; cursor: default; }
.admin-btn-danger {
  background: none;
  border: 1px solid #ef4444;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 12px;
  cursor: pointer;
  color: #ef4444;
  font-family: var(--font-sans);
}
.admin-btn-danger:hover { background: #fef2f2; }

.admin-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}
.admin-tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 8px 4px 10px;
  margin-right: 20px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  font-family: var(--font-sans);
}
.admin-tab:hover { color: var(--ink); }
.admin-tab.active { color: var(--accent); border-bottom-color: var(--accent); }

.admin-cron-table td { vertical-align: top; }
.admin-cron-status {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.admin-cron-status-ok      { background: #ecfdf5; color: #059669; }
.admin-cron-status-partial { background: #fffbeb; color: #b45309; }
.admin-cron-status-fatal   { background: #fef2f2; color: #ef4444; }
.admin-cron-status-running { background: var(--accent-light); color: var(--accent-dark); }
.admin-cron-errors {
  font-size: 12px;
  color: #ef4444;
  margin-bottom: 8px;
  white-space: pre-wrap;
}
.admin-cron-output {
  font-family: monospace;
  font-size: 11px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 12px;
  max-height: 320px;
  overflow-y: auto;
}

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.icon-btn {
  background: none; border: none; cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  color: var(--muted);
  display: flex; align-items: center;
  transition: background 0.1s, color 0.1s;
}
.icon-btn:hover { background: #f5f4f2; color: var(--accent); }

.back-btn {
  background: none; border: none; cursor: pointer;
  font-size: 20px; color: var(--muted); padding: 0 4px; line-height: 1;
}
.back-btn:hover { color: var(--accent); }

/* ── Modal ───────────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.35);
  display: flex; align-items: center; justify-content: center;
  z-index: 100;
}
.modal {
  background: var(--white);
  border-radius: 12px;
  padding: 24px;
  width: 360px;
  max-width: 90vw;
  box-shadow: 0 20px 60px rgba(0,0,0,.2);
}
.modal h3 { font-size: 15px; font-weight: 600; margin-bottom: 12px; }
.modal-hint { font-size: 12px; color: var(--muted); margin-bottom: 10px; line-height: 1.5; }
.modal-hint a { color: var(--accent); }
.modal input[type="text"], .modal input[type="url"], .modal textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  font-family: var(--font-sans);
  outline: none;
  margin-bottom: 8px;
}
.modal textarea { resize: vertical; }
.modal input:focus, .modal textarea:focus { border-color: var(--accent); }
.modal-error { font-size: 12px; color: #ef4444; margin-bottom: 8px; min-height: 16px; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 4px; }
.btn-primary {
  background: var(--accent); color: #fff; border: none;
  padding: 7px 16px; border-radius: 8px; font-size: 13px;
  cursor: pointer; font-family: var(--font-sans); font-weight: 500;
}
.btn-primary:disabled { opacity: 0.5; cursor: default; }
.btn-secondary {
  background: none; border: 1px solid var(--border); color: var(--muted);
  padding: 7px 16px; border-radius: 8px; font-size: 13px;
  cursor: pointer; font-family: var(--font-sans);
}
.btn-secondary:hover { border-color: var(--muted); color: var(--ink); }

/* ── Partage (X / Facebook / LinkedIn / Mail) ────────────────────────────── */
.share-grid {
  display: flex;
  justify-content: space-around;
  gap: 8px;
  margin: 4px 0 8px;
}
.share-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  color: var(--ink);
  font-size: 11px;
  font-family: var(--font-sans);
}
.share-icon {
  width: 44px; height: 44px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: #f5f4f2;
  transition: background .15s, color .15s;
}
.share-btn:hover .share-icon { background: var(--accent-light); color: var(--accent-dark); }

/* ── Cron code block ─────────────────────────────────────────────────────── */
.cron-code {
  background: #f5f4f2;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
  font-family: monospace;
  font-size: 11px;
  color: var(--ink);
  word-break: break-all;
  line-height: 1.5;
  transition: background .15s;
}
.cron-code:hover { background: #eeecea; }

/* ── Spinner ─────────────────────────────────────────────────────────────── */
@keyframes spin { to { transform: rotate(360deg); } }
.spinning { animation: spin 0.8s linear infinite; }

/* ── Scrollbar ───────────────────────────────────────────────────────────── */
::-webkit-scrollbar        { width: 5px; height: 5px; }
::-webkit-scrollbar-track  { background: transparent; }
::-webkit-scrollbar-thumb  { background: #d6d3d1; border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: #a8a29e; }

/* ── Responsive mobile ───────────────────────────────────────────────────── */
@media (max-width: 768px) {
  /* Chaque panel prend tout l'écran */
  #app {
    position: relative;
    flex-direction: column;
  }

  .panel {
    position: absolute;
    top: 0; left: 0; right: 0;
    /* Laisser la place à la barre de nav du bas */
    bottom: 56px;
    width: 100%;
    background: var(--paper);
    transition: transform 0.28s cubic-bezier(.4,0,.2,1);
    will-change: transform;
  }

  .panel-sidebar { z-index: 3; transform: translateX(0);    background: var(--white); }
  .panel-list    { z-index: 2; transform: translateX(100%); background: var(--paper); }
  .panel-reader  { z-index: 1; transform: translateX(100%); background: var(--paper); }

  .panel-list.visible   { transform: translateX(0); }
  .panel-reader.visible { transform: translateX(0); }

  /* Reader content doit scroller librement au-dessus de la barre */
  #reader-content { padding-bottom: 0; }

  /* Cache le bouton retour "‹" dans la list-header (on utilise la bottom nav) —
     scopé à cet id précis : #back-to-list (reader-toolbar) partage la classe
     .back-btn et doit lui rester visible, c'est le retour "reader → liste". */
  #back-to-sidebar { display: none; }

  /* Inputs : font-size 16px minimum pour éviter le zoom iOS */
  input, textarea, select {
    font-size: 16px !important;
  }

  /* Touch targets plus grands */
  .icon-btn, .nav-item, .feed-item, .folder-header, .footer-btn {
    min-height: 44px;
  }
  .nav-item, .feed-item { padding: 10px 12px; }
  .folder-header        { padding: 10px 12px; }

  /* Sidebar footer : deux colonnes */
  .sidebar-footer {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 8px;
    padding: 10px 12px;
    padding-bottom: max(10px, env(safe-area-inset-bottom));
  }
  .sidebar-footer .footer-btn { min-height: 36px; }
  .sidebar-footer .divider    { grid-column: 1 / -1; }

  /* Extension Chrome : sans intérêt sur mobile (rien à installer côté navigateur) */
  #btn-extension-token { display: none; }

  /* Article list */
  .article-item { padding: 14px 12px; }
  .article-title { font-size: 14px; }

  /* Reader inner : padding réduit */
  .reader-inner { padding: 20px 16px 60px; }
  .reader-title { font-size: 20px; }
  .article-body { font-size: 15px; }


  /* Modal pleine largeur sur mobile */
  .modal {
    width: 100%;
    max-width: 100%;
    border-radius: 16px 16px 0 0;
    position: fixed;
    bottom: 0;
    left: 0;
    margin: 0;
    padding-bottom: max(24px, env(safe-area-inset-bottom));
  }
  .modal-overlay { align-items: flex-end; }

  /* Auth screen : centré verticalement, pas de carte flottante */
  .auth-screen {
    padding: 16px;
    align-items: center;
  }
  .auth-card {
    max-width: 100%;
    border-radius: 16px;
    padding: 36px 24px 28px;
    margin: 0 auto;
  }
}

@media (min-width: 769px) {
  .md-hidden { display: none !important; }
  #app { flex-direction: row; }
  .panel { position: static; transform: none !important; flex: initial; }
  .panel-sidebar { flex: 0 0 240px; overflow: hidden; transition: flex 0.25s ease, width 0.25s ease; }
  .panel-list    { flex: 0 0 300px; }
  .panel-reader  { flex: 1; }
  /* Masquer la bottom nav sur desktop */
  #mobile-nav { display: none !important; }
  /* Sidebar collapsée */
  #app.sidebar-collapsed .panel-sidebar { flex: 0 0 0; width: 0; }
  /* Bouton expand uniquement sur desktop */
  .md-only { display: inline-flex !important; }
  /* [hidden] et .md-only ont la même spécificité (0,1,0) : sans ce sélecteur plus
     spécifique, .md-only gagne systématiquement le conflit (déclaré après [hidden]
     dans la feuille de style), donc #btn-sidebar-expand restait visible même avec
     l'attribut hidden posé — c'est ce qui causait le bug. */
  .md-only[hidden] { display: none !important; }
}
@media (max-width: 768px) {
  .md-only { display: none !important; }
}

/* ── Barre de navigation mobile (bas d'écran) ────────────────────────────── */
#mobile-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: 56px;
  background: var(--white);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  /* Respect de l'encoche/safe area (iPhone X+) */
  padding-bottom: env(safe-area-inset-bottom);
  z-index: 10;
}
.mobile-nav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px 0;
  color: #a8a29e;
  font-size: 10px;
  font-family: var(--font-sans);
  font-weight: 500;
  transition: color .15s;
  /* Touch target */
  min-height: 44px;
  -webkit-tap-highlight-color: transparent;
}
.mobile-nav-btn svg { transition: stroke .15s; }
.mobile-nav-btn.active    { color: var(--accent); }
.mobile-nav-btn .nav-badge {
  position: absolute;
  top: 6px;
  font-size: 9px;
  background: var(--accent);
  color: #fff;
  border-radius: 99px;
  padding: 1px 4px;
  line-height: 14px;
  min-width: 14px;
  text-align: center;
}

/* ── Auth screen ─────────────────────────────────────────────────────────── */
.auth-screen {
  position: fixed; inset: 0;
  background: var(--paper);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow-y: auto;
  z-index: 200;
  padding: 40px 16px;
}
.auth-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 40px 36px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 8px 32px rgba(0,0,0,.08);
  display: flex;
  flex-direction: column;
  align-items: center;
  /* garantit que la carte n'est jamais coupée */
  margin: auto;
}
.auth-logo     { font-size: 40px; margin-bottom: 8px; }
.auth-title    { font-size: 22px; font-weight: 700; color: var(--accent); margin-bottom: 4px; }
.auth-subtitle { font-size: 13px; color: var(--muted); margin-bottom: 20px; text-align: center; }
.auth-pitch {
  list-style: none;
  width: 100%;
  margin: -8px 0 20px;
  padding: 14px 16px;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.auth-pitch li { font-size: 12.5px; color: var(--muted); line-height: 1.4; }
.auth-card input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 14px;
  font-family: var(--font-sans);
  outline: none;
  margin-bottom: 10px;
  transition: border-color .15s;
}
.auth-card input:focus { border-color: var(--accent); }
.auth-error {
  font-size: 12px; color: #ef4444;
  min-height: 18px; margin-bottom: 8px;
  text-align: center; width: 100%;
}
.auth-btn {
  width: 100%;
  background: var(--accent); color: #fff;
  border: none; border-radius: 8px;
  padding: 11px; font-size: 14px; font-weight: 600;
  cursor: pointer; font-family: var(--font-sans);
  transition: background .15s;
}
.auth-btn:hover    { background: var(--accent-dark); }
.auth-btn:disabled { opacity: .55; cursor: default; }

/* Champ code OTP */
#setup-code {
  text-align: center;
  font-size: 28px !important;
  font-weight: 700;
  letter-spacing: 10px;
  padding: 12px 8px !important;
}

/* Lien secondaire (renvoyer / retour) */
.auth-link {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 13px;
  color: var(--muted);
  font-family: var(--font-sans);
  margin-top: 8px;
  padding: 6px 0;
  text-decoration: underline;
  text-underline-offset: 3px;
  width: 100%;
  text-align: center;
}
.auth-link:hover    { color: var(--accent); }
.auth-link:disabled { opacity: .5; cursor: default; }

/* ── Sidebar header actions ──────────────────────────────────────────────── */
.header-actions { display: flex; align-items: center; gap: 2px; }

/* Inline folder rename */
.folder-name-input {
  flex: 1; font-size: 13px; font-weight: 500;
  border: none; border-bottom: 1px solid var(--accent);
  background: transparent; outline: none; font-family: var(--font-sans);
}
