/* ========================================
   LENNOX DIARY — Editorial Design System
   ======================================== */

@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;600;700&family=JetBrains+Mono:wght@400;500&family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
  /* --- Color Palette: Warm Ink --- */
  --bg-primary: #faf8f5;
  --bg-secondary: #f2efe9;
  --bg-card: #ffffff;
  --text-primary: #1a1814;
  --text-secondary: #5c564d;
  --text-muted: #8a8379;
  --accent: #c45d3e;
  --accent-light: #f0d4cb;
  --accent-hover: #a84a2f;
  --border: #e5e0d8;
  --border-light: #eeebe5;
  --tag-bg: #f0ece5;
  --tag-text: #6b6459;
  --shadow-sm: 0 1px 3px rgba(26,24,20,0.04);
  --shadow-md: 0 4px 12px rgba(26,24,20,0.06);
  --shadow-lg: 0 8px 30px rgba(26,24,20,0.08);
  --code-bg: #f5f2ec;
  --blockquote-border: #c45d3e;
  --blockquote-bg: #fdf6f3;

  /* --- Typography --- */
  --font-display: 'Outfit', sans-serif;
  --font-body: 'Noto Serif SC', 'Georgia', serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* --- Spacing --- */
  --content-width: 740px;
  --page-width: 960px;
}

/* --- Dark Mode --- */
@media (prefers-color-scheme: dark) {
  :root {
    --bg-primary: #161412;
    --bg-secondary: #1e1b18;
    --bg-card: #211e1a;
    --text-primary: #e8e4dd;
    --text-secondary: #a9a29a;
    --text-muted: #7a746c;
    --accent: #e07558;
    --accent-light: #3d2820;
    --accent-hover: #f08b70;
    --border: #2e2a25;
    --border-light: #262320;
    --tag-bg: #2a2622;
    --tag-text: #b0a99f;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.2);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.3);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.4);
    --code-bg: #1e1b17;
    --blockquote-bg: #1f1714;
  }
}

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

html {
  font-size: 17px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  scrollbar-width: none;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar,
.editor-textarea::-webkit-scrollbar,
.batch-queue-list::-webkit-scrollbar {
  display: none;
}

body {
  font-family: var(--font-body);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.8;
  min-height: 100vh;
  scrollbar-width: none;
}

/* ======== LAYOUT ======== */
.site-header {
  border-bottom: 1px solid var(--border);
  padding: 1.5rem 2rem;
  background: var(--bg-card);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
  background: color-mix(in srgb, var(--bg-card) 85%, transparent);
}

.site-header .inner {
  max-width: var(--page-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.3rem;
  color: var(--text-primary);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.site-title span {
  color: var(--accent);
}

.site-nav a {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  margin-left: 1.5rem;
  transition: color 0.2s;
}
.site-nav a:hover { color: var(--accent); }
.site-nav a.active { color: var(--accent); }

.content-wrapper {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 3rem 1.5rem 5rem;
}

/* ======== INDEX PAGE ======== */
.page-heading {
  font-family: var(--font-display);
  font-size: 2.4rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 0.3rem;
  color: var(--text-primary);
}

.page-subtitle {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 3rem;
  line-height: 1.6;
}

.index-toolbar {
  margin-bottom: 1.5rem;
}

.index-toolbar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  margin-bottom: 0.8rem;
}

.toolbar-icon-group {
  display: inline-flex;
  gap: 0.45rem;
  padding: 0.18rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: color-mix(in srgb, var(--bg-card) 78%, var(--bg-secondary));
  box-shadow: var(--shadow-sm);
}

.toolbar-icon-btn {
  width: 2rem;
  height: 2rem;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: var(--shadow-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.toolbar-icon-btn:hover,
.toolbar-icon-btn[aria-expanded="true"] {
  background: var(--bg-card);
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 22%, var(--border));
  box-shadow: var(--shadow-sm);
}

.toolbar-icon {
  width: 0.95rem;
  height: 0.95rem;
}

.sort-control {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: color-mix(in srgb, var(--bg-card) 62%, var(--bg-secondary));
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.22rem;
  box-shadow: var(--shadow-sm);
}

.sort-label,
.search-label,
.toolbar-status {
  font-family: var(--font-display);
  font-size: 0.78rem;
  color: var(--text-muted);
}

.sort-select,
.search-input {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-card);
  color: var(--text-primary);
  padding: 0.5rem 0.9rem;
  font-family: var(--font-display);
  font-size: 0.82rem;
  outline: none;
}

.search-input:focus {
  border-color: var(--accent);
}

.sort-chip {
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--text-muted);
  padding: 0.42rem 0.9rem;
  font-family: var(--font-display);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
}

.sort-chip.is-active {
  background: var(--bg-card);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}

.search-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0.9rem 1rem 1rem;
  margin-bottom: 0.8rem;
  box-shadow: var(--shadow-sm);
}

.search-panel[hidden],
.date-range-panel[hidden],
.calendar-panel[hidden],
.article-search-panel[hidden] {
  display: none !important;
}

.search-label {
  display: block;
  margin-bottom: 0.55rem;
}

.search-row {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.search-input {
  flex: 1 1 auto;
  font-family: var(--font-body);
  border-radius: 10px;
}

.search-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  flex-wrap: wrap;
  margin-top: 0.8rem;
}

.toggle-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--font-display);
  font-size: 0.8rem;
  color: var(--text-secondary);
  cursor: pointer;
}

.toggle-chip input {
  accent-color: var(--accent);
}

.search-submit-btn,
.search-clear-btn {
  flex: 0 0 auto;
}

.date-range-panel {
  display: flex;
  align-items: flex-end;
  gap: 0.8rem;
  flex-wrap: wrap;
  margin-bottom: 0.8rem;
  padding: 0.95rem 1rem 1rem;
  background: linear-gradient(180deg, color-mix(in srgb, var(--bg-card) 76%, var(--bg-secondary)) 0%, var(--bg-card) 100%);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
}

.date-input-group {
  min-width: 140px;
}

.date-input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-card);
  color: var(--text-primary);
  padding: 0.55rem 0.8rem;
  font-family: var(--font-display);
  font-size: 0.82rem;
  outline: none;
}

.date-input:focus {
  border-color: var(--accent);
}

.calendar-panel {
  background:
    radial-gradient(circle at top left, color-mix(in srgb, var(--accent-light) 58%, transparent) 0%, transparent 42%),
    linear-gradient(180deg, color-mix(in srgb, var(--bg-card) 85%, var(--bg-secondary)) 0%, var(--bg-card) 100%);
  border: 1px solid color-mix(in srgb, var(--accent) 10%, var(--border));
  border-radius: 18px;
  padding: 1rem 1rem 1.05rem;
  margin-bottom: 0.8rem;
  box-shadow: var(--shadow-md);
}

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

.calendar-nav-btn {
  width: 1.85rem;
  height: 1.85rem;
}

.calendar-month {
  font-family: var(--font-display);
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.45rem;
  margin-bottom: 0.8rem;
}

.calendar-weekday {
  text-align: center;
  font-family: var(--font-display);
  font-size: 0.72rem;
  color: var(--text-muted);
  padding-bottom: 0.15rem;
}

.calendar-day {
  min-height: 2.7rem;
  border: 1px solid color-mix(in srgb, var(--border-light) 88%, transparent);
  border-radius: 14px;
  background: color-mix(in srgb, var(--bg-card) 90%, var(--bg-secondary));
  color: var(--text-secondary);
  padding: 0.35rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.14rem;
  font-family: var(--font-display);
  font-size: 0.78rem;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.18);
  transition: all 0.2s;
  cursor: pointer;
}

.calendar-day:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--accent) 22%, var(--border));
}

.calendar-day.has-entry {
  border-color: color-mix(in srgb, var(--accent) 28%, var(--border));
  background: color-mix(in srgb, var(--accent-light) 16%, var(--bg-card));
  color: var(--text-primary);
}

.calendar-day.has-entry i {
  font-style: normal;
  font-size: 0.64rem;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent-light) 72%, var(--bg-card));
  border-radius: 999px;
  padding: 0.02rem 0.35rem;
  min-width: 1.1rem;
}

.calendar-day.is-empty {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  cursor: default;
}

.calendar-day.is-selected {
  background: color-mix(in srgb, var(--accent-light) 60%, var(--bg-card));
  border-color: color-mix(in srgb, var(--accent) 42%, var(--border));
  color: var(--accent);
}

.calendar-day.is-selected span {
  font-weight: 700;
}

.calendar-day.is-today:not(.is-selected) {
  border-style: dashed;
  border-color: color-mix(in srgb, var(--accent) 24%, var(--border));
}

.calendar-day-panel {
  border-top: 1px solid color-mix(in srgb, var(--accent) 10%, var(--border));
  padding-top: 0.85rem;
}

.calendar-day-panel-title {
  font-family: var(--font-display);
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-bottom: 0.6rem;
}

.calendar-day-panel-list {
  list-style: none;
  display: grid;
  gap: 0.55rem;
}

.calendar-day-link {
  display: block;
  text-decoration: none;
  color: inherit;
  background: color-mix(in srgb, var(--bg-card) 86%, var(--bg-secondary));
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.7rem 0.8rem;
  transition: all 0.2s;
}

.calendar-day-link:hover {
  border-color: color-mix(in srgb, var(--accent) 22%, var(--border));
}

.calendar-day-link-title {
  font-family: var(--font-display);
  font-size: 0.82rem;
  color: var(--text-primary);
  line-height: 1.45;
}

.calendar-day-link-meta {
  font-size: 0.74rem;
  color: var(--text-muted);
  margin-top: 0.12rem;
}

.entry-list {
  list-style: none;
}

.entry-item {
  border-bottom: 1px solid var(--border-light);
  padding: 1.6rem 0;
  transition: background 0.2s;
}
.entry-item:first-child { padding-top: 0; }

.entry-item a {
  text-decoration: none;
  display: block;
}

.entry-date {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
  letter-spacing: 0.03em;
  margin-bottom: 0.4rem;
}

.entry-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
  margin-bottom: 0.5rem;
  transition: color 0.2s;
}
.entry-item a:hover .entry-title { color: var(--accent); }

.timeline-note-item {
  position: relative;
}

.timeline-note-item::before {
  content: "";
  position: absolute;
  left: -0.8rem;
  top: 1.9rem;
  width: 0.3rem;
  height: calc(100% - 3.2rem);
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent-light) 72%, var(--bg-card));
}

.entry-empty-state {
  color: var(--text-muted);
  font-size: 0.9rem;
  padding: 1rem 0;
}

.entry-summary {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.65;
  margin-bottom: 0.6rem;
}

.entry-summary mark,
.entry-title mark,
.tag mark {
  background: color-mix(in srgb, var(--accent-light) 80%, transparent);
  color: var(--text-primary);
  padding: 0 0.12rem;
  border-radius: 3px;
}

.entry-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.tag {
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 500;
  padding: 0.15rem 0.55rem;
  background: var(--tag-bg);
  color: var(--tag-text);
  border-radius: 3px;
  letter-spacing: 0.01em;
}

/* ======== ARTICLE PAGE ======== */
.article-header {
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.article-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 0.8rem;
}

.timeline-note-header {
  border-bottom-style: dashed;
}

.timeline-note-body {
  background: linear-gradient(180deg, color-mix(in srgb, var(--bg-card) 82%, var(--bg-secondary)) 0%, var(--bg-card) 100%);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 1.35rem 1.4rem;
}

.article-search-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.9rem 1rem 1rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-sm);
}

.article-search-nav {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.article-search-hit {
  background: color-mix(in srgb, var(--accent-light) 88%, transparent);
  padding: 0 0.12rem;
  border-radius: 3px;
}

.article-search-hit.is-active {
  background: var(--accent);
  color: #fff;
}

.article-header .entry-date {
  margin-bottom: 0.6rem;
}

.article-title {
  font-family: var(--font-display);
  font-size: 1.9rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.3;
  margin-bottom: 1rem;
}

.article-meta-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.8rem;
}

.article-body h2 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 600;
  margin: 2.2rem 0 0.8rem;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.article-body h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  margin: 1.8rem 0 0.6rem;
  color: var(--text-primary);
}

.article-body p {
  margin-bottom: 1.2rem;
}

.article-body ul, .article-body ol {
  margin: 0.8rem 0 1.2rem 1.5rem;
}

.article-body li {
  margin-bottom: 0.4rem;
}

.article-body blockquote {
  border-left: 3px solid var(--blockquote-border);
  background: var(--blockquote-bg);
  padding: 1rem 1.2rem;
  margin: 1.5rem 0;
  border-radius: 0 6px 6px 0;
  font-size: 0.92rem;
  color: var(--text-secondary);
}

.article-body blockquote p {
  margin-bottom: 0.5rem;
}
.article-body blockquote p:last-child {
  margin-bottom: 0;
}

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

.article-body .insight-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.2rem 1.4rem;
  margin: 1.5rem 0;
  box-shadow: var(--shadow-sm);
}

.insight-card h3 {
  margin-top: 0 !important;
  font-size: 1rem;
  color: var(--accent);
}

.insight-card .structure,
.insight-card .key-point,
.insight-card .conclusion {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
}

.insight-card .conclusion {
  font-weight: 600;
  color: var(--text-primary);
}

/* Section dividers */
.section-divider {
  text-align: center;
  margin: 2.5rem 0;
  color: var(--text-muted);
  font-size: 0.8rem;
  letter-spacing: 0.3em;
}

/* Back link */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-display);
  font-size: 0.85rem;
  color: var(--text-muted);
  text-decoration: none;
  margin-bottom: 2rem;
  transition: color 0.2s;
}
.back-link:hover { color: var(--accent); }

/* ======== EDITOR PAGE ======== */
.editor-container {
  max-width: var(--page-width);
  margin: 0 auto;
  padding: 2rem 1.5rem 5rem;
}

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

.editor-section label {
  display: block;
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  letter-spacing: 0.02em;
}

.editor-input,
.editor-textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: 0.95rem;
  padding: 0.8rem 1rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-card);
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.2s;
}
.editor-input:focus,
.editor-textarea:focus {
  border-color: var(--accent);
}

.editor-textarea {
  min-height: 400px;
  resize: vertical;
  line-height: 1.7;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  scrollbar-width: none;
}

.editor-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.dropzone {
  border: 1px dashed var(--border);
  border-radius: 10px;
  background: color-mix(in srgb, var(--bg-card) 72%, var(--bg-secondary));
  padding: 1.1rem 1.2rem;
  margin-bottom: 1rem;
  transition: border-color 0.2s, background 0.2s, transform 0.2s;
}

.dropzone.is-dragover {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent-light) 55%, var(--bg-card));
  transform: translateY(-1px);
}

.dropzone-title {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.dropzone-icon {
  width: 1rem;
  height: 1rem;
  color: var(--accent);
  flex: 0 0 auto;
}

.dropzone-text {
  font-size: 0.84rem;
  color: var(--text-secondary);
  margin-bottom: 0.7rem;
}

.dropzone-actions {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.dropzone-note {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.batch-queue {
  display: none;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem 1.1rem;
  margin-bottom: 1.2rem;
  box-shadow: var(--shadow-sm);
}

.batch-queue.is-visible {
  display: block;
}

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

.batch-queue-title {
  font-family: var(--font-display);
  font-size: 0.92rem;
  font-weight: 600;
}

.batch-queue-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.batch-queue-actions {
  display: flex;
  gap: 0.7rem;
  flex-wrap: wrap;
}

.batch-queue-list {
  list-style: none;
  max-height: 260px;
  overflow: auto;
  scrollbar-width: none;
}

.batch-queue-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 0;
  border-top: 1px solid var(--border-light);
  cursor: pointer;
}

.batch-queue-item:first-child {
  border-top: none;
  padding-top: 0.15rem;
}

.batch-queue-main {
  min-width: 0;
  flex: 1 1 auto;
}

.batch-queue-name {
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.4;
}

.batch-queue-item.is-selected .batch-queue-name {
  color: var(--accent);
}

.batch-queue-subtitle {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.batch-queue-state {
  align-self: flex-start;
  font-family: var(--font-display);
  font-size: 0.72rem;
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
  background: var(--tag-bg);
  color: var(--tag-text);
  white-space: nowrap;
}

.batch-queue-side {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  flex: 0 0 auto;
}

.queue-delete-btn {
  width: 1.7rem;
  height: 1.7rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: transparent;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.queue-delete-btn:hover {
  color: #c62828;
  border-color: color-mix(in srgb, #c62828 30%, var(--border));
  background: color-mix(in srgb, #fbe9e7 65%, transparent);
}

.queue-delete-btn svg {
  width: 0.8rem;
  height: 0.8rem;
}

.batch-queue-state.is-publishing {
  background: var(--accent-light);
  color: var(--accent);
}

.batch-queue-state.is-success {
  background: #e8f5e9;
  color: #2e7d32;
}

.batch-queue-state.is-error {
  background: #fbe9e7;
  color: #c62828;
}

.btn {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.7rem 1.8rem;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

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

.btn-secondary {
  background: var(--bg-secondary);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--border-light); }

.btn-group {
  display: flex;
  gap: 0.8rem;
  margin-top: 1rem;
}

.preview-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 2rem;
  margin-top: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.status-msg {
  font-family: var(--font-display);
  font-size: 0.85rem;
  padding: 0.6rem 1rem;
  border-radius: 6px;
  margin-top: 1rem;
  display: none;
}
.status-msg.success {
  display: block;
  background: #e8f5e9;
  color: #2e7d32;
}
.status-msg.error {
  display: block;
  background: #fbe9e7;
  color: #c62828;
}
.status-msg.info {
  display: block;
  background: var(--accent-light);
  color: var(--accent);
}

/* Settings panel */
.settings-panel {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.settings-panel summary {
  font-family: var(--font-display);
  font-weight: 600;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.settings-panel .settings-inner {
  margin-top: 1rem;
}

.settings-panel .editor-section {
  margin-bottom: 1rem;
}

/* ======== FOOTER ======== */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 2rem;
  text-align: center;
  font-family: var(--font-display);
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* ======== RESPONSIVE ======== */
@media (max-width: 640px) {
  html { font-size: 16px; }
  .page-heading { font-size: 1.8rem; }
  .article-title { font-size: 1.5rem; }
  .editor-row { grid-template-columns: 1fr; }
  .content-wrapper { padding: 2rem 1rem 4rem; }
  .site-header { padding: 1rem; }
  .index-toolbar-row { align-items: stretch; }
  .sort-control { margin-left: auto; }
  .search-row { flex-direction: column; align-items: stretch; }
  .date-range-panel { align-items: stretch; }
  .dropzone { padding: 1rem; }
  .batch-queue-header { align-items: flex-start; flex-direction: column; }
}
