/* ============================================================
   Minimal Board — hoja de estilos
   Cero dependencias. Tokens → layout → componentes → responsive.
   ============================================================ */

/* ---------- 1. Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html, body { height: 100%; }
img, svg { display: block; max-width: 100%; }
button, input, textarea, select { font: inherit; color: inherit; background: none; border: none; }
button { cursor: pointer; }
ul, ol { list-style: none; }

/* ---------- 2. Tokens ---------- */
:root {
  --bg:        #f4f4f5;
  --surface:   #ffffff;
  --surface-2: #fafafa;
  --surface-3: #f1f1f2;
  --border:    #e4e4e7;
  --border-2:  #d4d4d8;
  --text:      #18181b;
  --text-2:    #52525b;
  --muted:     #8b8b93;
  --accent:    #4f46e5;
  --accent-2:  #6366f1;
  --accent-bg: #eef2ff;
  --danger:    #dc2626;
  --danger-bg: #fef2f2;
  --ok:        #059669;
  --warn:      #d97706;
  --shadow:    0 1px 2px rgba(0,0,0,.05), 0 4px 12px rgba(0,0,0,.06);
  --shadow-lg: 0 8px 32px rgba(0,0,0,.14);
  --r-sm: 6px;
  --r:    9px;
  --r-lg: 14px;
  --list-w: 292px;
  --panel-w: 384px;
  --ease: cubic-bezier(.22,.61,.36,1);
  --fast: 120ms;
}

[data-theme="dark"] {
  --bg:        #0c0c0e;
  --surface:   #17171a;
  --surface-2: #1c1c20;
  --surface-3: #232329;
  --border:    #2a2a31;
  --border-2:  #3a3a43;
  --text:      #f4f4f5;
  --text-2:    #b4b4bd;
  --muted:     #7c7c86;
  --accent:    #818cf8;
  --accent-2:  #a5b4fc;
  --accent-bg: #1e1b3a;
  --danger:    #f87171;
  --danger-bg: #2a1414;
  --ok:        #34d399;
  --warn:      #fbbf24;
  --shadow:    0 1px 2px rgba(0,0,0,.4), 0 4px 12px rgba(0,0,0,.3);
  --shadow-lg: 0 8px 32px rgba(0,0,0,.55);
}

/* ---------- 3. Base ---------- */
body {
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI",
               Inter, Roboto, "Helvetica Neue", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow: hidden;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

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

/* scrollbars discretas */
* { scrollbar-width: thin; scrollbar-color: var(--border-2) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: var(--border-2);
  border: 3px solid transparent;
  border-radius: 8px;
  background-clip: content-box;
}
*::-webkit-scrollbar-thumb:hover { background: var(--muted); background-clip: content-box; }

/* ---------- 4. App shell ---------- */
.app {
  display: grid;
  grid-template-rows: auto auto 1fr;
  height: 100dvh;
}

/* ---------- 5. Topbar ---------- */
.topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  min-height: 56px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 650;
  letter-spacing: -.01em;
  white-space: nowrap;
}
.brand-mark {
  width: 22px; height: 22px;
  border-radius: 6px;
  object-fit: contain;
  flex-shrink: 0;
}
.brand-name {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--text);
}

.board-picker { position: relative; }
.board-picker-btn {
  display: flex; align-items: center; gap: 7px;
  padding: 6px 10px;
  border-radius: var(--r-sm);
  font-weight: 600;
  color: var(--text);
  max-width: 260px;
  transition: background var(--fast) var(--ease);
}
.board-picker-btn:hover { background: var(--surface-3); }
.board-picker-btn .name {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.caret { color: var(--muted); font-size: 10px; flex-shrink: 0; }

.menu {
  position: absolute;
  top: calc(100% + 6px); left: 0;
  min-width: 264px;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  box-shadow: var(--shadow-lg);
  z-index: 60;
}
.menu-item {
  display: flex; align-items: center; gap: 9px;
  width: 100%;
  padding: 7px 9px;
  border-radius: var(--r-sm);
  text-align: left;
  color: var(--text-2);
  transition: background var(--fast) var(--ease), color var(--fast) var(--ease);
}
.menu-item:hover { background: var(--surface-3); color: var(--text); }
.menu-item.is-active { color: var(--accent); font-weight: 600; }
.menu-item .tick { width: 14px; flex-shrink: 0; }
.menu-item .label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-sep { height: 1px; background: var(--border); margin: 5px 3px; }
.menu-head {
  padding: 7px 9px 4px;
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em;
  color: var(--muted);
}

.search-wrap { position: relative; flex: 1; max-width: 440px; margin: 0 auto; }
.search {
  width: 100%;
  padding: 7px 12px 7px 32px;
  background: var(--surface-3);
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  transition: border-color var(--fast) var(--ease), background var(--fast) var(--ease);
}
.search::placeholder { color: var(--muted); }
.search:focus {
  background: var(--surface);
  border-color: var(--accent);
  outline: none;
}
.search-icon {
  position: absolute; left: 10px; top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
  font-size: 13px;
}
.search-clear {
  position: absolute; right: 6px; top: 50%;
  transform: translateY(-50%);
  width: 20px; height: 20px;
  display: grid; place-items: center;
  border-radius: 50%;
  color: var(--muted);
  font-size: 14px;
}
.search-clear:hover { background: var(--border); color: var(--text); }

.icon-btn {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border-radius: var(--r-sm);
  color: var(--text-2);
  font-size: 15px;
  flex-shrink: 0;
  transition: background var(--fast) var(--ease), color var(--fast) var(--ease);
}
.icon-btn:hover { background: var(--surface-3); color: var(--text); }

.kbd-hint {
  font-size: 11px; font-weight: 600;
  color: var(--muted);
  padding: 2px 6px;
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: 5px;
  white-space: nowrap;
}

/* selector de idioma */
.lang-select {
  appearance: none;
  -webkit-appearance: none;
  padding: 5px 22px 5px 9px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--text-2);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%238b8b93' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 7px center;
  background-size: 9px;
  transition: border-color var(--fast) var(--ease), color var(--fast) var(--ease);
}
.lang-select:hover { border-color: var(--border-2); color: var(--text); }
.lang-select:focus { border-color: var(--accent); outline: none; }
.lang-select option { background: var(--surface); color: var(--text); }

/* ---------- 6. Filtros ---------- */
.filterbar {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 16px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  min-height: 42px;
  overflow-x: auto;
}
.filter-group { display: flex; align-items: center; gap: 5px; flex-shrink: 0; }
.filter-label {
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .05em;
  color: var(--muted);
  margin-right: 2px;
}
.chip {
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  font-size: 12px; font-weight: 550;
  white-space: nowrap;
  transition: all var(--fast) var(--ease);
}
.chip:hover { border-color: var(--border-2); color: var(--text); }
.chip.is-on {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.chip-dot {
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  margin-right: 5px;
  vertical-align: 0;
}
.filter-count {
  margin-left: auto;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  padding-left: 12px;
  flex-shrink: 0;
}
.filter-count b { color: var(--text); font-weight: 650; }

/* ---------- 7. Board ---------- */
.board {
  display: flex;
  gap: 12px;
  padding: 16px;
  overflow-x: auto;
  overflow-y: hidden;
  align-items: flex-start;
  scroll-behavior: smooth;
}

.list {
  width: var(--list-w);
  flex-shrink: 0;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  transition: border-color var(--fast) var(--ease), background var(--fast) var(--ease);
}
.list.is-over {
  border-color: var(--accent);
  background: var(--accent-bg);
}

.list-head {
  display: flex; align-items: center; gap: 7px;
  padding: 11px 11px 8px;
  flex-shrink: 0;
}
.list-title {
  flex: 1;
  font-size: 13px; font-weight: 650;
  letter-spacing: -.005em;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.list-count {
  font-size: 11px; font-weight: 650;
  color: var(--muted);
  background: var(--surface-3);
  padding: 1px 7px;
  border-radius: 999px;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}
.list.is-over-wip .list-count {
  background: var(--danger-bg); color: var(--danger);
}
.list-menu-btn {
  width: 22px; height: 22px;
  display: grid; place-items: center;
  border-radius: 5px;
  color: var(--muted);
  font-size: 14px;
  opacity: 0;
  transition: opacity var(--fast) var(--ease), background var(--fast) var(--ease);
}
.list:hover .list-menu-btn, .list-menu-btn:focus-visible { opacity: 1; }
.list-menu-btn:hover { background: var(--surface-3); color: var(--text); }

.list-body {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 0 8px 8px;
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 44px;
  flex: 1;
}

.list-foot { padding: 0 8px 8px; flex-shrink: 0; }

.add-card-btn, .add-list-btn {
  display: flex; align-items: center; gap: 6px;
  width: 100%;
  padding: 7px 9px;
  border-radius: var(--r-sm);
  color: var(--muted);
  font-size: 13px;
  text-align: left;
  transition: background var(--fast) var(--ease), color var(--fast) var(--ease);
}
.add-card-btn:hover, .add-list-btn:hover {
  background: var(--surface-3);
  color: var(--text);
}

/* ---------- 8. Tarjeta ---------- */
.card {
  position: relative;
  padding: 9px 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  cursor: grab;
  user-select: none;
  transition: border-color var(--fast) var(--ease), box-shadow var(--fast) var(--ease),
              transform var(--fast) var(--ease), opacity var(--fast) var(--ease);
}
.card:hover { border-color: var(--border-2); box-shadow: var(--shadow); }
.card:active { cursor: grabbing; }
.card.is-selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}
.card.is-dragging { opacity: .35; }
.card.is-hidden { display: none; }

.card-title {
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.4;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.card.is-done .card-title {
  color: var(--muted);
  text-decoration: line-through;
}

.card-desc {
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}

.card-meta {
  display: flex; align-items: center; gap: 6px;
  flex-wrap: wrap;
  margin-top: 7px;
}
.card-meta:empty { display: none; }

.badge {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 11px; font-weight: 600;
  padding: 1px 6px;
  border-radius: 5px;
  background: var(--surface-3);
  color: var(--text-2);
  white-space: nowrap;
}
.badge-due.is-overdue { background: var(--danger-bg); color: var(--danger); }
.badge-due.is-today { background: #fef3c7; color: #b45309; }
[data-theme="dark"] .badge-due.is-today { background: #3a2c0a; color: var(--warn); }
.badge-check.is-complete { background: color-mix(in srgb, var(--ok) 15%, transparent); color: var(--ok); }
.badge-desc { color: var(--muted); }

.card-labels {
  display: flex; gap: 4px; flex-wrap: wrap;
  margin-bottom: 6px;
}
.card-labels:empty { display: none; }
.label-pill {
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .03em;
  padding: 2px 7px;
  border-radius: 4px;
}

.card-checkbar {
  height: 3px;
  border-radius: 2px;
  background: var(--surface-3);
  overflow: hidden;
  margin-top: 7px;
}
.card-checkbar-fill {
  height: 100%;
  background: var(--ok);
  border-radius: 2px;
  transition: width var(--fast) var(--ease);
}

/* ---------- 9. Drag & drop ---------- */
.drag-ghost {
  position: fixed;
  z-index: 999;
  pointer-events: none;
  width: var(--list-w);
  max-width: 320px;
  opacity: .96;
  transform-origin: top left;
  box-shadow: var(--shadow-lg);
  border-color: var(--accent);
  cursor: grabbing;
  will-change: transform;
}
.drag-placeholder {
  border: 1.5px dashed var(--accent);
  background: var(--accent-bg);
  border-radius: var(--r);
  min-height: 40px;
}
.drag-hint {
  position: fixed;
  z-index: 1000;
  padding: 4px 9px;
  background: var(--text);
  color: var(--surface);
  font-size: 11px; font-weight: 600;
  border-radius: 6px;
  pointer-events: none;
  white-space: nowrap;
  box-shadow: var(--shadow);
}

/* ---------- 10. Panel de detalle ---------- */
.panel {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: var(--panel-w);
  max-width: 100vw;
  background: var(--surface);
  border-left: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  transform: translateX(100%);
  transition: transform 220ms var(--ease);
  z-index: 80;
  display: flex;
  flex-direction: column;
}
.panel.is-open { transform: translateX(0); }

.panel-head {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.panel-breadcrumb {
  flex: 1;
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .05em;
  color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

.panel-title {
  font-size: 17px; font-weight: 650;
  line-height: 1.35;
  letter-spacing: -.01em;
  word-break: break-word;
  margin-bottom: 10px;
}

.field { margin-bottom: 18px; }
.field-label {
  display: block;
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .05em;
  color: var(--muted);
  margin-bottom: 6px;
}

.desc-editor {
  width: 100%;
  min-height: 84px;
  padding: 9px 11px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  resize: vertical;
  line-height: 1.55;
  transition: border-color var(--fast) var(--ease);
}
.desc-editor:focus { border-color: var(--accent); outline: none; background: var(--surface); }
.desc-editor::placeholder { color: var(--muted); }

.input {
  width: 100%;
  padding: 7px 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  transition: border-color var(--fast) var(--ease);
}
.input:focus { border-color: var(--accent); outline: none; background: var(--surface); }

.select-row { display: flex; gap: 6px; }
.select-row .select { flex: 1; }

/* listas / checklists */
.checklist { margin-bottom: 10px; }
.checklist-head {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 650;
  margin-bottom: 5px;
}
.checklist-head .pct {
  margin-left: auto;
  font-size: 11px; color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.check-item {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 4px 6px;
  border-radius: 5px;
  transition: background var(--fast) var(--ease);
}
.check-item:hover { background: var(--surface-2); }
.check-box {
  width: 15px; height: 15px;
  flex-shrink: 0;
  margin-top: 2px;
  border: 1.5px solid var(--border-2);
  border-radius: 4px;
  display: grid; place-items: center;
  color: transparent;
  font-size: 10px;
  font-weight: 800;
  transition: all var(--fast) var(--ease);
}
.check-box:hover { border-color: var(--accent); }
.check-box.is-done {
  background: var(--ok);
  border-color: var(--ok);
  color: #fff;
}
.check-text {
  flex: 1;
  font-size: 13px;
  line-height: 1.45;
  word-break: break-word;
}
.check-item.is-done .check-text { color: var(--muted); text-decoration: line-through; }
.check-del {
  opacity: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1;
  padding: 0 2px;
  flex-shrink: 0;
  transition: opacity var(--fast) var(--ease);
}
.check-item:hover .check-del { opacity: 1; }
.check-del:hover { color: var(--danger); }

/* selector de etiquetas */
.label-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.label-toggle {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .03em;
  border: 1.5px solid transparent;
  opacity: .45;
  transition: all var(--fast) var(--ease);
}
.label-toggle:hover { opacity: .75; }
.label-toggle.is-on { opacity: 1; border-color: currentColor; }

.panel-foot {
  display: flex; gap: 7px;
  padding: 11px 14px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  flex-wrap: wrap;
}

.btn {
  padding: 6px 11px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  font-size: 12.5px; font-weight: 600;
  transition: all var(--fast) var(--ease);
}
.btn:hover { border-color: var(--border-2); color: var(--text); background: var(--surface-2); }
.btn-primary {
  background: var(--accent); border-color: var(--accent); color: #fff;
}
.btn-primary:hover { background: var(--accent-2); border-color: var(--accent-2); color: #fff; }
.btn-danger:hover { background: var(--danger-bg); border-color: var(--danger); color: var(--danger); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: var(--surface-3); }

/* ---------- 11. Compositor inline ---------- */
.composer {
  background: var(--surface);
  border: 1px solid var(--accent);
  border-radius: var(--r);
  box-shadow: 0 0 0 1px var(--accent);
  padding: 9px 10px;
  cursor: default;
}
.composer-input {
  width: 100%;
  font-size: 13.5px;
  line-height: 1.4;
  resize: none;
  overflow: hidden;
}
.composer-input:focus { outline: none; }
.composer-hint {
  margin-top: 6px;
  font-size: 11px;
  color: var(--muted);
  display: flex; gap: 8px; flex-wrap: wrap;
}
.composer-hint kbd {
  font-family: inherit;
  font-size: 10px; font-weight: 700;
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0 4px;
}

.inline-input {
  width: 100%;
  font-size: 13.5px;
  font-weight: 650;
  background: var(--surface-2);
  border: 1px solid var(--accent);
  border-radius: var(--r-sm);
  padding: 3px 6px;
  margin: -4px -6px;
}
.inline-input:focus { outline: none; background: var(--surface); }

/* ---------- 12. Overlay (paleta / ayuda) ---------- */
.overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.42);
  backdrop-filter: blur(2px);
  z-index: 200;
  display: grid;
  place-items: start center;
  padding-top: 12vh;
  animation: fade var(--fast) var(--ease);
}
.overlay[hidden] { display: none; }
@keyframes fade { from { opacity: 0 } to { opacity: 1 } }

.palette {
  width: min(560px, 92vw);
  max-height: 66vh;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column;
  overflow: hidden;
  animation: pop 160ms var(--ease);
}
@keyframes pop { from { transform: translateY(-8px) scale(.985); opacity: 0 } to { transform: none; opacity: 1 } }

.palette-input {
  width: 100%;
  padding: 15px 18px;
  font-size: 15px;
  border-bottom: 1px solid var(--border);
}
.palette-input:focus { outline: none; }
.palette-list { overflow-y: auto; padding: 6px; }
.palette-group {
  padding: 8px 10px 4px;
  font-size: 10.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em;
  color: var(--muted);
}
.palette-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%;
  padding: 9px 11px;
  border-radius: var(--r-sm);
  text-align: left;
  color: var(--text-2);
}
.palette-item.is-active {
  background: var(--accent-bg);
  color: var(--accent);
}
.palette-item .ico {
  width: 17px; text-align: center;
  flex-shrink: 0;
  font-size: 14px;
}
.palette-item .txt { flex: 1; font-weight: 550; }
.palette-item .sc {
  font-size: 11px; color: var(--muted);
  font-weight: 650;
  flex-shrink: 0;
}
.palette-empty { padding: 26px; text-align: center; color: var(--muted); }

/* ayuda */
.help {
  width: min(660px, 94vw);
  max-height: 74vh;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  padding: 22px 24px;
  animation: pop 160ms var(--ease);
}
.help h2 { font-size: 16px; margin-bottom: 3px; letter-spacing: -.01em; }
.help .sub { color: var(--muted); font-size: 12.5px; margin-bottom: 18px; }
.help h3 {
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em;
  color: var(--muted);
  margin: 18px 0 8px;
}
.help-row {
  display: flex; align-items: baseline; gap: 12px;
  padding: 4px 0;
  border-bottom: 1px solid var(--border);
}
.help-row:last-child { border-bottom: none; }
.help-row .d { flex: 1; font-size: 13px; color: var(--text-2); }
.help-row k {
  font-size: 11px; font-weight: 650;
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 5px;
  padding: 1px 6px;
  white-space: nowrap;
  color: var(--text);
}

/* ---------- 13. Calendario emergente ---------- */
.date-row { display: flex; gap: 6px; align-items: stretch; }
.date-row .input { flex: 1; min-width: 0; }
.cal-btn {
  width: 36px;
  flex-shrink: 0;
  display: grid; place-items: center;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  font-size: 14px;
  transition: all var(--fast) var(--ease);
}
.cal-btn:hover { border-color: var(--accent); background: var(--accent-bg); }

.cal-pop {
  position: fixed;
  z-index: 150;
  width: 268px;
  padding: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  box-shadow: var(--shadow-lg);
  animation: pop 130ms var(--ease);
}
.cal-pop[hidden] { display: none; }

.cal-head {
  display: flex; align-items: center; gap: 4px;
  margin-bottom: 8px;
}
.cal-month {
  flex: 1;
  text-align: center;
  font-size: 12.5px; font-weight: 650;
}
.cal-nav {
  width: 26px; height: 26px;
  display: grid; place-items: center;
  border-radius: 6px;
  color: var(--muted);
  font-size: 17px; line-height: 1;
  transition: background var(--fast) var(--ease), color var(--fast) var(--ease);
}
.cal-nav:hover { background: var(--surface-3); color: var(--text); }

.cal-week, .cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}
.cal-week { margin-bottom: 4px; }
.cal-week span {
  text-align: center;
  font-size: 10px; font-weight: 700;
  color: var(--muted);
  padding: 2px 0;
}

.cal-day {
  height: 30px;
  display: grid; place-items: center;
  border-radius: 6px;
  font-size: 12px; font-weight: 550;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
  transition: background var(--fast) var(--ease), color var(--fast) var(--ease);
}
.cal-day:hover { background: var(--surface-3); color: var(--text); }
.cal-day.is-blank { pointer-events: none; }
.cal-day.is-today {
  box-shadow: inset 0 0 0 1.5px var(--accent);
  color: var(--accent);
  font-weight: 700;
}
.cal-day.is-range {
  background: var(--accent-bg);
  color: var(--accent);
  border-radius: 0;
}
.cal-day.is-sel {
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  box-shadow: none;
}

.cal-quick {
  display: flex; gap: 4px;
  margin-top: 9px;
  padding-top: 9px;
  border-top: 1px solid var(--border);
}
.cal-qbtn {
  flex: 1;
  padding: 5px 4px;
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 11px; font-weight: 600;
  white-space: nowrap;
  transition: all var(--fast) var(--ease);
}
.cal-qbtn:hover { background: var(--surface-3); color: var(--text); }
.cal-qbtn.is-danger:hover { background: var(--danger-bg); color: var(--danger); }

.cal-input {
  width: 100%;
  margin-top: 8px;
  padding: 6px 9px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 12px;
}
.cal-input:focus { border-color: var(--accent); outline: none; background: var(--surface); }

.cal-dur {
  margin-top: 6px;
  text-align: center;
  font-size: 11px;
  font-weight: 650;
  color: var(--muted);
  min-height: 14px;
}

/* ---------- 14. Estados vacíos ---------- */
.empty-list {
  padding: 14px 10px;
  text-align: center;
  color: var(--muted);
  font-size: 12.5px;
  border: 1.5px dashed var(--border);
  border-radius: var(--r);
}
.board-empty {
  position: absolute;
  inset: 0;
  display: grid; place-items: center;
  pointer-events: none;
}
.board-empty-inner {
  text-align: center;
  color: var(--muted);
  padding: 40px;
  pointer-events: auto;
}
.board-empty-inner h3 { font-size: 15px; color: var(--text); margin-bottom: 5px; }

.add-list {
  width: var(--list-w);
  flex-shrink: 0;
  padding: 10px;
  background: var(--surface-2);
  border: 1px dashed var(--border-2);
  border-radius: var(--r-lg);
}
.add-list:hover { border-color: var(--accent); background: var(--accent-bg); }
.add-list-input { width: 100%; font-size: 13.5px; }

/* ---------- 14. Toast ---------- */
.toasts {
  position: fixed;
  left: 50%; bottom: 22px;
  transform: translateX(-50%);
  display: flex; flex-direction: column; gap: 8px;
  align-items: center;
  z-index: 300;
  pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 14px;
  background: var(--text);
  color: var(--surface);
  border-radius: 999px;
  font-size: 13px; font-weight: 550;
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
  animation: toastIn 200ms var(--ease);
  max-width: 90vw;
}
.toast button {
  color: var(--surface);
  opacity: .7;
  font-size: 12px; font-weight: 700;
  text-decoration: underline;
  white-space: nowrap;
}
.toast button:hover { opacity: 1; }
@keyframes toastIn { from { transform: translateY(10px); opacity: 0 } to { transform: none; opacity: 1 } }

/* ---------- 15. Panel abierto: reserva espacio ---------- */
/* En pantallas anchas el tablero se encoge para que la barra superior y el
   propio tablero sigan siendo utilizables con el panel abierto. */
@media (min-width: 1100px) {
  body.panel-open .app { padding-right: var(--panel-w); }
  body.panel-open .board { overflow-x: auto; }
}

/* ---------- 16. Responsive ---------- */
@media (max-width: 720px) {
  .search-wrap { max-width: none; }
  .kbd-hint { display: none; }
  .panel { width: 100vw; }
  .board { padding: 12px; gap: 10px; scroll-snap-type: x proximity; }
  .list, .add-list { scroll-snap-align: start; }
  :root { --list-w: 84vw; }
  .filterbar { padding: 7px 12px; }
  .topbar { padding: 9px 12px; gap: 7px; }
  .board-picker-btn { max-width: 140px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}