:root {
  --bg: #f7f6f3;
  --surface: #ffffff;
  --border: #e5e3dc;
  --text: #1a1a18;
  --muted: #888780;
  --accent: #2563eb;
  --accent-bg: #eff6ff;
  --success: #16a34a;
  --success-bg: #f0fdf4;
  --warning-bg: #fefce8;
  --radius: 8px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
}

.navbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: .75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 10;
}

.logo { font-size: 16px; font-weight: 600; }

.nav-tabs { display: flex; gap: 4px; }

.tab {
  padding: 6px 14px;
  border: none;
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  cursor: pointer;
  transition: all .15s;
}
.tab:hover { background: var(--bg); color: var(--text); }
.tab.active { background: var(--accent-bg); color: var(--accent); font-weight: 500; }

main { max-width: 780px; margin: 0 auto; padding: 1.5rem 1rem; }

/* ── stats row ── */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; margin-bottom: 1.5rem; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .75rem 1rem; }
.stat-label { font-size: 12px; color: var(--muted); margin-bottom: 2px; }
.stat-val { font-size: 22px; font-weight: 600; }

/* ── today card ── */
.today-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1rem;
}
.today-date {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: .5rem;
}
.today-badge {
  display: inline-block;
  background: var(--accent-bg);
  color: var(--accent);
  font-size: 11px;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 20px;
  margin-bottom: 1rem;
}
.quote-text {
  font-size: 17px;
  line-height: 1.8;
  margin-bottom: 1rem;
  font-style: italic;
  color: var(--text);
}
.attribution {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 1.25rem;
}

/* ── post preview ── */
.post-preview {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  font-size: 13px;
  white-space: pre-wrap;
  direction: rtl;
  margin-bottom: 1rem;
  font-family: monospace;
  color: var(--text);
}

/* ── buttons ── */
.btn {
  padding: 8px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all .15s;
  font-family: inherit;
}
.btn:hover { background: var(--bg); }
.btn:disabled { opacity: .4; cursor: default; }
.btn-primary { background: var(--accent); color: #fff; border-color: transparent; }
.btn-primary:hover { opacity: .9; background: var(--accent); }
.btn-success { background: var(--success); color: #fff; border-color: transparent; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }

/* ── queue list ── */
.queue-filters { display: flex; gap: 8px; margin-bottom: 1rem; flex-wrap: wrap; align-items: center; justify-content: space-between; }
.filter-tabs { display: flex; gap: 4px; }
.filter-tab { padding: 5px 12px; border-radius: 20px; border: 1px solid var(--border); background: var(--surface); color: var(--muted); font-size: 13px; cursor: pointer; }
.filter-tab.active { background: var(--text); color: #fff; border-color: var(--text); }

.quote-row {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  margin-bottom: .625rem;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: .75rem;
  align-items: start;
}
.quote-row.published { opacity: .55; }
.quote-row-meta { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: .5rem; align-items: center; }
.badge { font-size: 11px; padding: 2px 8px; border-radius: 20px; font-weight: 500; }
.badge-book { background: var(--accent-bg); color: var(--accent); }
.badge-date { background: var(--bg); color: var(--muted); border: 1px solid var(--border); }
.badge-pub { background: var(--success-bg); color: var(--success); }
.badge-today { background: #fef9c3; color: #854d0e; }
.quote-snippet { font-size: 14px; color: var(--text); line-height: 1.6; }
.quote-actions-col { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }

/* ── tags ── */
.tags-wrap { display: flex; flex-wrap: wrap; gap: 5px; margin-top: .5rem; }
.tag { font-size: 11px; background: var(--bg); border: 1px solid var(--border); color: var(--muted); padding: 2px 8px; border-radius: 20px; }

/* ── upload view ── */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: 12px;
  padding: 3rem;
  text-align: center;
  cursor: pointer;
  background: var(--surface);
  transition: border-color .2s;
  margin-bottom: 1.5rem;
}
.upload-zone:hover { border-color: var(--accent); }
.upload-zone input { display: none; }
.upload-icon { font-size: 40px; margin-bottom: .75rem; }
.upload-title { font-size: 16px; font-weight: 500; margin-bottom: .25rem; }
.upload-sub { font-size: 13px; color: var(--muted); }

.import-result {
  background: var(--success-bg);
  border: 1px solid #bbf7d0;
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-top: 1rem;
  font-size: 14px;
}

/* ── no-post ── */
.empty { text-align: center; padding: 3rem 1rem; color: var(--muted); }
.empty-icon { font-size: 48px; margin-bottom: 1rem; }

/* ── toast ── */
.toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--text);
  color: #fff;
  padding: 10px 20px;
  border-radius: 20px;
  font-size: 14px;
  transition: transform .25s;
  z-index: 100;
  white-space: nowrap;
}
.toast.show { transform: translateX(-50%) translateY(0); }

/* ── progress ── */
.progress-bar { height: 3px; background: var(--border); border-radius: 2px; margin-bottom: 1.5rem; overflow: hidden; }
.progress-fill { height: 100%; background: var(--accent); border-radius: 2px; transition: width .3s; }

@media (max-width: 520px) {
  .quote-row { grid-template-columns: 1fr; }
  .quote-actions-col { flex-direction: row; align-items: flex-start; }
}
