/* ============================================================
   lista-tareas-navegador · 1000HW · styles.css · v1
   Cache-bust: ?v=1

   Vanilla CSS con variables CSS + metodología BEM.
   Dark theme (#050505 + #CCFF00), responsive mobile-first.
   Sin Tailwind, sin frameworks.

   Secciones:
     §1 — Reset & base
     §2 — Tokens (variables CSS)
     §3 — Layout: nav, hero, panels, footer
     §4 — Components: btn, tag-chip, modal, callout, faq
     §5 — Tasks panel: workspace header, kanban, list
     §6 — Notes panel: sidebar + preview
     §7 — Markdown body (preview rendered)
     §8 — AdSense, offline banner, donation toast
     §9 — Accessibility (focus, sr-only, reduced-motion)
   ============================================================ */

/* ============================================================
   §1 — RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background-color: var(--bg);
  background-image: radial-gradient(var(--dot) 1px, transparent 1px);
  background-size: 40px 40px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
h1, h2, h3, h4, h5, h6 { margin: 0 0 .5em 0; font-weight: 700; line-height: 1.2; letter-spacing: -0.02em; }
h1 { font-size: clamp(2.4rem, 5vw, 4rem); }
h2 { font-size: clamp(1.7rem, 3vw, 2.3rem); margin-top: 2.2em; }
h3 { font-size: 1.25rem; margin-top: 1.5em; }
p { margin: 0 0 1em 0; }
a { color: var(--accent); text-decoration: none; }
a:hover, a:focus-visible { text-decoration: underline; }
ul, ol { padding-left: 1.4em; margin: 0 0 1em 0; }
li { margin-bottom: .35em; }
code, pre, kbd {
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.9em;
}
kbd {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: .78em;
  color: var(--muted);
}
img, svg { max-width: 100%; display: block; }
button { font: inherit; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }

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

/* ============================================================
   §2 — TOKENS (CSS variables)
   ============================================================ */
:root {
  --bg: #050505;
  --surface: #0a0a0a;
  --surface-2: #0f0f0f;
  --surface-3: #161616;
  --border: #333;
  --border-strong: #4a4a4a;
  --text: #e0e0e0;
  --muted: #888;
  --muted-2: #5a5a5a;
  --accent: #CCFF00;
  --accent-dim: #99bb00;
  --accent-soft: rgba(204, 255, 0, .12);
  --dot: #1a1a1a;

  --prio-low: #5a5a5a;
  --prio-medium: #4a9eff;
  --prio-high: #ff9d3d;
  --prio-urgent: #ff4d4d;

  --status-pending: #888;
  --status-progress: #4a9eff;
  --status-done: #3dd17a;

  --danger: #ff4d4d;
  --danger-soft: rgba(255, 77, 77, .12);

  --radius: 10px;
  --radius-sm: 6px;
  --radius-lg: 18px;

  --gap: 1rem;
  --gap-lg: 2rem;

  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
  --font-body: 'Inter', system-ui, sans-serif;

  --header-h: 64px;
  --maxw: 1240px;
}

/* ============================================================
   §3 — LAYOUT: nav, hero, panels, footer
   ============================================================ */
.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.nav {
  border-bottom: 1px solid var(--border);
  background: rgba(5, 5, 5, .92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 40;
}
.nav-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.nav-back {
  font-family: var(--font-mono);
  font-size: .82rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .12em;
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  transition: color .2s;
}
.nav-back:hover { color: var(--accent); text-decoration: none; }
.nav-brand {
  font-weight: 800;
  font-size: 1.4rem;
  letter-spacing: -.04em;
  color: var(--text);
}
.brand-acid { color: var(--accent); }

.nav-toggles { display: flex; gap: 4px; }
.lang-toggle {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px 10px;
  font-family: var(--font-mono);
  font-size: .78rem;
  letter-spacing: .12em;
  transition: all .15s;
}
.lang-toggle:hover { color: var(--text); border-color: var(--border-strong); }
.lang-toggle.active {
  color: var(--bg);
  background: var(--accent);
  border-color: var(--accent);
  font-weight: 700;
}

.nav-settings-btn {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: all .15s;
}
.nav-settings-btn:hover { color: var(--accent); border-color: var(--accent); }

main { flex: 1 1 auto; padding: 2.5rem 0 0 0; position: relative; z-index: 0; }

.hero { padding: 1rem 0 2.5rem 0; }
.hero-tags { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.5rem; }
.tag {
  font-family: var(--font-mono);
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--muted);
}
.tag-acid {
  color: var(--accent);
  border-color: var(--accent-dim);
  background: var(--accent-soft);
}
.tag-priv {
  color: var(--muted-2);
  border-color: var(--border);
}
.hero h1 { margin-bottom: 1rem; }
.hero h1 .accent { color: var(--accent); }
.hero-lede {
  font-size: 1.2rem;
  color: var(--muted);
  max-width: 60ch;
  margin-bottom: 1.5rem;
}
.hero-disclaimer {
  max-width: 60ch;
  background: var(--surface-2);
  border-left: 3px solid var(--accent);
  padding: 1rem 1.25rem;
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--muted);
  font-size: .95rem;
}
.hero-disclaimer strong { color: var(--text); }
.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  margin-top: 2rem;
}

.site-footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0 3rem 0;
  text-align: center;
  font-family: var(--font-mono);
  font-size: .78rem;
  color: var(--muted);
}
.footer-brand { color: var(--text); font-weight: 700; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--accent); }
.footer-meta { margin-top: .35rem; color: var(--muted-2); font-size: .72rem; }

/* ============================================================
   §4 — COMPONENTS: btn, tag-chip, modal, callout, faq
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4em;
  padding: .65em 1.2em;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: .85rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  font-weight: 600;
  transition: all .15s ease;
  text-decoration: none;
}
.btn:hover { border-color: var(--border-strong); text-decoration: none; }
.btn-sm { padding: .45em .9em; font-size: .78rem; }
.btn-block { display: flex; width: 100%; }
.btn-primary {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
  font-weight: 700;
}
.btn-primary:hover { background: var(--accent-dim); border-color: var(--accent-dim); }
.btn-secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--border-strong);
}
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }
.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--muted);
}
.btn-ghost:hover { color: var(--text); }
.btn-danger {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: var(--danger);
}
.btn-danger:hover { background: var(--danger); color: var(--bg); }

.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: .25em;
  padding: 4px 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: .76rem;
  border-radius: 999px;
  cursor: pointer;
  transition: all .15s;
}
.tag-chip:hover { color: var(--text); border-color: var(--border-strong); }
.tag-chip.active {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
  font-weight: 700;
}
.tag-chip-all { border-color: var(--border-strong); }
.tag-chip-clear {
  border-color: var(--danger);
  color: var(--danger);
  background: var(--danger-soft);
}
.tag-chip-sm { padding: 2px 8px; font-size: .7rem; }

.callout {
  background: var(--surface-2);
  border-left: 4px solid var(--accent);
  padding: 1.25rem 1.5rem;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin: 2rem 0;
}
.callout h3 { margin-top: 0; }
.callout-warn { border-left-color: var(--prio-high); }
.callout-warn h3 { color: var(--prio-high); }

.faq-list { margin: 1rem 0 2rem 0; }
.faq-item {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: .75rem;
  overflow: hidden;
}
.faq-item summary {
  padding: 1rem 1.25rem;
  cursor: pointer;
  font-weight: 600;
  color: var(--text);
  list-style: none;
  position: relative;
  padding-right: 3rem;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: '+';
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--accent);
  font-size: 1.4rem;
  font-weight: 300;
}
.faq-item[open] summary::after { content: '−'; }
.faq-item summary:hover { color: var(--accent); }
.faq-item p {
  padding: 0 1.25rem 1rem 1.25rem;
  color: var(--muted);
  margin: 0;
}

.content-list { padding-left: 1.4em; }
.content-list li { margin-bottom: .55em; color: var(--muted); }
.content-list li strong { color: var(--text); }

.glossary { margin: 1rem 0; }
.glossary dt {
  font-weight: 700;
  color: var(--accent);
  margin-top: 1rem;
  font-family: var(--font-mono);
}
.glossary dd { color: var(--muted); margin: .25rem 0 0 0; }

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 1rem;
  backdrop-filter: blur(4px);
}
.modal-overlay[hidden] { display: none; }

/* Honor [hidden] attribute on elements that otherwise have explicit display rules */
.tasks-view-kanban[hidden],
.tasks-view-list[hidden],
.offline-banner[hidden],
.donation-toast[hidden],
.ad-section[hidden] { display: none; }
.modal-window {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 560px;
  max-height: calc(100vh - 2rem);
  display: flex;
  flex-direction: column;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .6);
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
}
.modal-title { margin: 0; font-size: 1.25rem; }
.modal-close {
  background: transparent;
  border: 0;
  color: var(--muted);
  font-size: 1.6rem;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all .15s;
}
.modal-close:hover { background: var(--surface-2); color: var(--text); }
.modal-body {
  padding: 1.25rem 1.5rem 1.5rem 1.5rem;
  overflow-y: auto;
}
.modal-form { display: flex; flex-direction: column; gap: 1rem; }
.modal-form-wide { max-width: 100%; }
.field-label { display: flex; flex-direction: column; gap: .35rem; }
.field-label > span {
  font-family: var(--font-mono);
  font-size: .78rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .08em;
}
.field-label input,
.field-label select,
.field-label textarea,
.settings-body input,
.settings-body select,
.note-editor-pane textarea,
.note-editor-pane input {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: .65rem .8rem;
  border-radius: var(--radius-sm);
  font-size: .95rem;
  width: 100%;
  font-family: inherit;
  transition: border-color .15s, background .15s;
}
.field-label textarea { resize: vertical; min-height: 60px; }
.field-label input:focus,
.field-label select:focus,
.field-label textarea:focus,
.settings-body input:focus,
.settings-body select:focus,
.note-editor-pane textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface);
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 480px) { .field-row { grid-template-columns: 1fr; } }
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: .75rem;
  padding-top: .5rem;
  border-top: 1px solid var(--border);
  margin-top: .5rem;
  padding-top: 1rem;
}

.confirm-body p { margin-bottom: 1rem; color: var(--muted); }

/* ============================================================
   §5 — TASKS PANEL: workspace header, kanban, list
   ============================================================ */
.tool-section { padding: 1rem 0 3rem 0; }

.workspace-header {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.ws-name-label {
  font-family: var(--font-mono);
  font-size: .72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .1em;
}
.ws-name-input {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: .45rem .8rem;
  font-size: 1rem;
  font-weight: 600;
  min-width: 240px;
  flex: 1 1 240px;
  max-width: 360px;
}
.ws-name-input:focus { outline: none; border-color: var(--accent); }
.ws-status {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  font-family: var(--font-mono);
  font-size: .78rem;
  color: var(--muted);
}
.ws-status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
  transition: background .15s;
}
.ws-status-dot.saving { background: var(--prio-high); animation: pulse 1.2s infinite; }
.ws-status-dot.saved { background: var(--status-done); }
.ws-status-dot.error { background: var(--danger); }
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .4; }
}
.ws-storage {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: .76rem;
  color: var(--muted-2);
}

.search-bar {
  position: relative;
  margin-bottom: 1rem;
}
.search-input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  padding: .75rem 7rem .75rem 1rem;
  font-size: 1rem;
  transition: border-color .15s;
}
.search-input:focus { outline: none; border-color: var(--accent); }
.search-input::placeholder { color: var(--muted-2); }
.search-shortcut {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted-2);
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}
.panel-header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .75rem 1rem;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}
.panel-title {
  font-size: 1.5rem;
  font-weight: 800;
  margin: 0;
  letter-spacing: -.02em;
}
.panel-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .6rem;
  margin-left: auto;
}
.panel-empty {
  text-align: center;
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: .9rem;
  padding: 2rem 1rem;
  margin: 0;
}

.view-toggle {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.view-toggle-btn {
  background: transparent;
  border: 0;
  color: var(--muted);
  padding: .4em .9em;
  font-family: var(--font-mono);
  font-size: .76rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  cursor: pointer;
  transition: all .15s;
}
.view-toggle-btn:hover { color: var(--text); }
.view-toggle-btn.active {
  background: var(--accent);
  color: var(--bg);
  font-weight: 700;
}

.sort-label {
  font-family: var(--font-mono);
  font-size: .72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .08em;
}
.sort-select {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: .35em .8em;
  font-family: var(--font-mono);
  font-size: .8rem;
}

.tag-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  margin-bottom: 1rem;
  min-height: 28px;
}

/* ---------- KANBAN ---------- */
.tasks-view-kanban {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 1rem;
}
@media (max-width: 880px) {
  .tasks-view-kanban { grid-template-columns: 1fr; }
}
.kanban-col {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  min-height: 240px;
  display: flex;
  flex-direction: column;
}
.kanban-col-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: .75rem;
  padding-bottom: .5rem;
  border-bottom: 1px solid var(--border);
}
.kanban-col-title {
  font-family: var(--font-mono);
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--muted);
  font-weight: 700;
}
.kanban-col[data-status="pending"] .kanban-col-title { color: var(--status-pending); }
.kanban-col[data-status="progress"] .kanban-col-title { color: var(--status-progress); }
.kanban-col[data-status="done"] .kanban-col-title { color: var(--status-done); }
.kanban-col-count {
  font-family: var(--font-mono);
  font-size: .72rem;
  color: var(--muted-2);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 1px 8px;
  border-radius: 999px;
}
.kanban-col-body {
  display: flex;
  flex-direction: column;
  gap: .6rem;
  min-height: 100px;
  flex: 1;
}
.kanban-col-body.drop-target {
  background: var(--accent-soft);
  outline: 1px dashed var(--accent);
  outline-offset: -4px;
  border-radius: var(--radius-sm);
}

.kanban-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .75rem .85rem;
  cursor: grab;
  transition: border-color .15s, transform .15s;
  display: flex;
  flex-direction: column;
  gap: .35rem;
  position: relative;
}
.kanban-card:hover { border-color: var(--border-strong); }
.kanban-card.dragging { opacity: .4; cursor: grabbing; }
.kanban-card.status-done .kanban-card-title {
  text-decoration: line-through;
  color: var(--muted);
}
.kanban-card.prio-urgent { border-left: 3px solid var(--prio-urgent); }
.kanban-card.prio-high { border-left: 3px solid var(--prio-high); }
.kanban-card.prio-medium { border-left: 3px solid var(--prio-medium); }
.kanban-card.prio-low { border-left: 3px solid var(--prio-low); }
.kanban-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
}
.task-status-toggle {
  background: transparent;
  border: 0;
  color: var(--accent);
  font-size: 1.3rem;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}
.task-status-toggle:hover { color: var(--text); }
.prio-pill {
  font-family: var(--font-mono);
  font-size: .68rem;
  padding: 2px 7px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: .08em;
  background: var(--surface-3);
  color: var(--muted);
}
.prio-pill.prio-low { color: var(--prio-low); }
.prio-pill.prio-medium { color: var(--prio-medium); }
.prio-pill.prio-high { color: var(--prio-high); background: rgba(255, 157, 61, .1); }
.prio-pill.prio-urgent { color: var(--prio-urgent); background: rgba(255, 77, 77, .15); }
.kanban-card-title {
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
  word-wrap: break-word;
}
.kanban-card-desc {
  font-size: .85rem;
  color: var(--muted);
  margin: 0;
  line-height: 1.4;
}
.kanban-card-footer {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .4rem;
  font-family: var(--font-mono);
  font-size: .72rem;
  color: var(--muted-2);
}
.kanban-card-due { color: var(--muted); }
.due-badge {
  padding: 2px 7px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  font-weight: 700;
}
.due-overdue { background: rgba(255, 77, 77, .15); color: var(--danger); }
.due-today { background: rgba(255, 157, 61, .15); color: var(--prio-high); }
.due-soon { background: var(--accent-soft); color: var(--accent); }
.kanban-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: .25rem;
  margin-top: .2rem;
}
.kanban-card-actions {
  position: absolute;
  top: .5rem;
  right: .5rem;
  display: flex;
  gap: 2px;
  opacity: 0;
  transition: opacity .15s;
}
.kanban-card:hover .kanban-card-actions,
.task-list-item:hover .task-list-actions {
  opacity: 1;
}
.card-action {
  background: transparent;
  border: 0;
  color: var(--muted);
  font-size: .9rem;
  padding: 2px 6px;
  border-radius: 4px;
  cursor: pointer;
}
.card-action:hover { color: var(--accent); background: var(--surface-3); }
.card-action.delete-btn:hover { color: var(--danger); }

/* ---------- LIST view ---------- */
.tasks-view-list {
  margin-top: 1rem;
}
.task-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: .5rem;
}
.task-list-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .75rem .85rem;
  display: flex;
  align-items: flex-start;
  gap: .65rem;
  cursor: pointer;
  transition: border-color .15s;
  position: relative;
}
.task-list-item:hover { border-color: var(--border-strong); }
.task-list-item.prio-urgent { border-left: 3px solid var(--prio-urgent); }
.task-list-item.prio-high { border-left: 3px solid var(--prio-high); }
.task-list-item.prio-medium { border-left: 3px solid var(--prio-medium); }
.task-list-item.prio-low { border-left: 3px solid var(--prio-low); }
.task-list-item.status-done .task-list-title { text-decoration: line-through; color: var(--muted); }
.task-list-handle {
  color: var(--muted-2);
  cursor: grab;
  padding: 4px 2px;
  user-select: none;
  font-size: 1.1rem;
}
.task-list-handle:hover { color: var(--accent); }
.task-list-body { flex: 1 1 auto; min-width: 0; }
.task-list-line1 {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
}
.task-list-title {
  font-weight: 600;
  font-size: 1rem;
  word-wrap: break-word;
}
.task-list-desc {
  font-size: .85rem;
  color: var(--muted);
  margin: .25rem 0 .35rem 0;
}
.task-list-line2 {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  font-family: var(--font-mono);
  font-size: .72rem;
  color: var(--muted-2);
  align-items: center;
}
.task-list-due { color: var(--muted); }
.task-list-tags { display: flex; flex-wrap: wrap; gap: .25rem; }
.task-list-actions {
  display: flex;
  gap: 2px;
  opacity: 0;
  transition: opacity .15s;
}

/* SortableJS classes */
.sortable-ghost { opacity: .35; }
.sortable-chosen { border-color: var(--accent) !important; }
.sortable-drag { opacity: .9; }

/* ============================================================
   §6 — NOTES PANEL: sidebar + preview
   ============================================================ */
.notes-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 1rem;
  margin-top: 1rem;
  min-height: 380px;
}
@media (max-width: 720px) {
  .notes-grid { grid-template-columns: 1fr; }
}
.notes-sidebar {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  max-height: 600px;
  overflow-y: auto;
}
.notes-sidebar-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.notes-sidebar-item {
  padding: .85rem 1rem;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background .15s;
}
.notes-sidebar-item:last-child { border-bottom: 0; }
.notes-sidebar-item:hover { background: var(--surface-3); }
.notes-sidebar-item.active {
  background: var(--accent-soft);
  border-left: 3px solid var(--accent);
  padding-left: calc(1rem - 3px);
}
.notes-sidebar-title {
  font-size: .95rem;
  font-weight: 600;
  margin: 0 0 .25rem 0;
  word-wrap: break-word;
}
.notes-sidebar-excerpt {
  font-size: .82rem;
  color: var(--muted);
  margin: 0;
  line-height: 1.4;
}
.notes-sidebar-tags {
  display: flex;
  flex-wrap: wrap;
  gap: .25rem;
  margin-top: .35rem;
}

.notes-preview {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 1.75rem;
  min-height: 380px;
  overflow-y: auto;
  max-height: 600px;
}
.notes-preview-empty {
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: .9rem;
  text-align: center;
  padding: 3rem 1rem;
  margin: 0;
}
.notes-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: .75rem;
  padding-bottom: .75rem;
  border-bottom: 1px solid var(--border);
}
.notes-preview-title {
  font-size: 1.6rem;
  font-weight: 800;
  margin: 0;
  word-wrap: break-word;
  letter-spacing: -.02em;
}
.notes-preview-actions { display: flex; gap: .35rem; flex-wrap: wrap; }
.notes-preview-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  font-family: var(--font-mono);
  font-size: .72rem;
  color: var(--muted-2);
  margin-bottom: 1rem;
}
.notes-preview-tags { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: 1rem; }
.notes-preview-body { font-size: 1rem; line-height: 1.7; }

/* ============================================================
   §7 — NOTE EDITOR (split view inside modal)
   ============================================================ */
.note-editor-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
@media (max-width: 720px) {
  .note-editor-split { grid-template-columns: 1fr; }
}
.note-editor-pane, .note-preview-pane {
  display: flex;
  flex-direction: column;
  gap: .35rem;
}
.note-editor-pane textarea {
  min-height: 280px;
  resize: vertical;
  font-family: var(--font-mono);
  font-size: .9rem;
  line-height: 1.5;
}
.pane-label {
  font-family: var(--font-mono);
  font-size: .72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .08em;
}
.note-preview-live {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .85rem 1rem;
  min-height: 280px;
  max-height: 400px;
  overflow-y: auto;
  font-size: .9rem;
  line-height: 1.6;
}

/* ============================================================
   §7 — MARKDOWN BODY (preview rendered)
   ============================================================ */
.markdown-body {
  color: var(--text);
  word-wrap: break-word;
  line-height: 1.7;
}
.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4,
.markdown-body h5,
.markdown-body h6 {
  margin-top: 1.5em;
  margin-bottom: .5em;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -.02em;
}
.markdown-body h1 { font-size: 1.8rem; color: var(--accent); }
.markdown-body h2 { font-size: 1.4rem; color: var(--accent); margin-top: 1.7em; }
.markdown-body h3 { font-size: 1.15rem; color: var(--text); }
.markdown-body h4 { font-size: 1rem; }
.markdown-body h1:first-child,
.markdown-body h2:first-child,
.markdown-body h3:first-child { margin-top: 0; }
.markdown-body p { margin: 0 0 1em 0; }
.markdown-body a { color: var(--accent); text-decoration: underline; }
.markdown-body strong { color: var(--text); font-weight: 700; }
.markdown-body em { font-style: italic; }
.markdown-body ul,
.markdown-body ol { margin: 0 0 1em 0; padding-left: 1.5em; }
.markdown-body li { margin-bottom: .3em; }
.markdown-body code {
  background: var(--surface-3);
  border: 1px solid var(--border);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: .88em;
  color: var(--accent);
}
.markdown-body pre {
  background: var(--surface-3);
  border: 1px solid var(--border);
  padding: 1rem;
  border-radius: var(--radius-sm);
  overflow-x: auto;
  margin: 0 0 1em 0;
}
.markdown-body pre code {
  background: transparent;
  border: 0;
  padding: 0;
  color: var(--text);
  font-size: .85em;
}
.markdown-body blockquote {
  border-left: 3px solid var(--accent);
  background: var(--surface-2);
  padding: .75rem 1rem;
  margin: 1em 0;
  color: var(--muted);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.markdown-body blockquote p:last-child { margin-bottom: 0; }
.markdown-body hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 2em 0;
}
.markdown-body input[type="checkbox"] {
  margin-right: .5em;
  accent-color: var(--accent);
}

/* ============================================================
   §8 — ADSENSE, OFFLINE BANNER, DONATION TOAST, TOAST-MESSAGE
   ============================================================ */
.ad-section {
  margin: 2rem 0;
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-align: center;
  min-height: 100px;
}
.ad-section ins { display: block; }

.offline-banner {
  position: fixed;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface);
  border: 1px solid var(--accent);
  border-radius: 999px;
  padding: .55rem 1rem;
  display: flex;
  align-items: center;
  gap: .75rem;
  font-size: .85rem;
  color: var(--text);
  z-index: 50;
  max-width: calc(100vw - 2rem);
  box-shadow: 0 8px 20px rgba(0, 0, 0, .5);
}
.offline-banner-icon {
  color: var(--accent);
  font-weight: 700;
}
.offline-banner-text { color: var(--muted); }
.offline-banner-close {
  background: transparent;
  border: 0;
  color: var(--muted);
  cursor: pointer;
  font-size: 1.1rem;
  padding: 0 .25rem;
}
.offline-banner-close:hover { color: var(--text); }

.donation-toast {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: .9rem;
  max-width: 380px;
  z-index: 60;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .5);
}
.donation-toast-icon { font-size: 1.5rem; }
.donation-toast-content { flex: 1; min-width: 0; }
.donation-toast-title { margin: 0; font-size: .9rem; font-weight: 700; }
.donation-toast-subtitle {
  margin: .15rem 0 0 0;
  font-size: .76rem;
  color: var(--muted);
  line-height: 1.4;
}
.donation-toast-btn {
  background: var(--accent);
  color: var(--bg);
  padding: .5em 1em;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  white-space: nowrap;
}
.donation-toast-btn:hover { background: var(--accent-dim); text-decoration: none; }
.donation-toast-close {
  background: transparent;
  border: 0;
  color: var(--muted);
  cursor: pointer;
  font-size: 1.2rem;
}
@media (max-width: 540px) {
  .donation-toast { left: 1rem; right: 1rem; max-width: none; }
}

.toast-message {
  position: fixed;
  bottom: 5.5rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface);
  border: 1px solid var(--accent);
  color: var(--accent);
  padding: .6rem 1.2rem;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: .82rem;
  z-index: 70;
  box-shadow: 0 8px 20px rgba(0, 0, 0, .5);
}
.toast-message.error { border-color: var(--danger); color: var(--danger); }

/* ============================================================
   §9 — ACCESSIBILITY (focus, sr-only, reduced-motion)
   ============================================================ */
.skip-link {
  position: absolute;
  top: -100px;
  left: 1rem;
  background: var(--accent);
  color: var(--bg);
  padding: .65rem 1rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: .85rem;
  font-weight: 700;
  text-decoration: none;
  z-index: 200;
  transition: top .2s;
}
.skip-link:focus-visible {
  top: 1rem;
  text-decoration: none;
}
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
*:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}
button:focus-visible,
.btn:focus-visible,
.lang-toggle:focus-visible {
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .ws-status-dot.saving { animation: none; }
}

/* Settings body */
.settings-body { display: flex; flex-direction: column; gap: 1.25rem; }
.settings-section h3 {
  font-size: .82rem;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--muted);
  margin: 0 0 .65rem 0;
}
.settings-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .65rem;
  margin-bottom: .65rem;
}
.settings-storage-info {
  font-family: var(--font-mono);
  font-size: .78rem;
  color: var(--muted-2);
  margin: 0;
}
.settings-select {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: .55rem .8rem;
  font-size: .95rem;
  width: 100%;
  max-width: 260px;
}

/* ============================================================
   §10 — RESPONSIVE TWEAKS
   ============================================================ */
@media (max-width: 720px) {
  .container { padding: 0 1rem; }
  .nav-inner { padding: .85rem 1rem; }
  .panel { padding: 1rem; }
  .hero { padding: .5rem 0 2rem 0; }
  .hero-cta { gap: .5rem; }
  .panel-controls { width: 100%; margin-left: 0; }
  .view-toggle-btn { padding: .35em .65em; }
  .search-input { padding-right: 1rem; }
  .search-shortcut { display: none; }
  .modal-window { max-height: calc(100vh - 1rem); }
  .modal-body { padding: 1rem; }
  .ws-storage { margin-left: 0; }
}