:root {
  --bg0: #1d2840;
  --bg1: #253152;
  --bg2: #2f3e64;
  --card: rgba(255,255,255,.04);
  --card-hi: rgba(255,255,255,.07);
  --stroke: rgba(255,255,255,.10);
  --stroke-hi: rgba(255,255,255,.18);
  --text: #eaf2ff;
  --muted: #94a3c2;
  --brand: #3aa7ff;
  --brand-hi: #5fb8ff;
  --good: #3ef0c3;
  --warn: #ffc857;
  --danger: #ff6b6b;
  --urgent: #ff4d8d;
  --shadow: 0 18px 60px rgba(0,0,0,.55);
  --radius: 16px;
  --radius-sm: 10px;
  --topbar-bg-1: rgba(29,40,64,.85);
  --topbar-bg-2: rgba(29,40,64,.55);
  --tabs-bg: rgba(37,49,82,.80);
}

:root[data-theme="light"] {
  --bg0: #f1f5fb;
  --bg1: #ffffff;
  --bg2: #eaf0f8;
  --card: rgba(0,0,0,.025);
  --card-hi: rgba(0,0,0,.055);
  --stroke: rgba(0,0,0,.10);
  --stroke-hi: rgba(0,0,0,.20);
  --text: #1d2840;
  --muted: #5b6685;
  --shadow: 0 8px 28px rgba(20, 30, 60, .10);
  --topbar-bg-1: rgba(255,255,255,.95);
  --topbar-bg-2: rgba(255,255,255,.70);
  --tabs-bg: rgba(255,255,255,.92);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, system-ui, sans-serif;
  background:
    radial-gradient(1200px 800px at 80% -10%, rgba(58,167,255,.16), transparent 50%),
    radial-gradient(900px 600px at -10% 110%, rgba(62,240,195,.08), transparent 50%),
    linear-gradient(180deg, var(--bg0) 0%, var(--bg1) 100%);
  background-attachment: fixed;
  color: var(--text);
  min-height: 100vh;
  padding-bottom: 100px;
  -webkit-font-smoothing: antialiased;
}

/* Topbar */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px 10px;
  position: sticky; top: 0; z-index: 5;
  backdrop-filter: blur(14px);
  background: linear-gradient(180deg, var(--topbar-bg-1), var(--topbar-bg-2));
  border-bottom: 1px solid var(--stroke);
}
.brand { display:flex; gap:10px; align-items:center; font-weight:700; letter-spacing:.2px; }
.brand .logo {
  width: 28px; height: 28px; border-radius: 8px;
  background: linear-gradient(135deg, var(--brand), #1e6bff);
  box-shadow: 0 8px 24px rgba(58,167,255,.45);
  display: inline-flex; align-items: center; justify-content: center;
  color: white; font-weight: 900; font-size: 18px;
}
.brand-name { font-size: 17px; }

.topbar-right { display:flex; align-items:center; gap: 8px; }

.install-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px;
  font-size: 13px; font-weight: 600;
  text-decoration: none;
  color: white;
  background: linear-gradient(135deg, var(--brand), #1e6bff);
  border: 1px solid rgba(58,167,255,.4);
  border-radius: 999px;
  box-shadow: 0 6px 20px rgba(58,167,255,.30);
  transition: transform .15s, box-shadow .15s;
}
.install-btn:hover { transform: translateY(-1px); box-shadow: 0 8px 24px rgba(58,167,255,.40); }
.install-btn[hidden] { display: none !important; }

.user-chip {
  display:flex; align-items:center; gap:8px;
  padding: 6px 12px;
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: 999px;
  font-size: 13px;
}
.user-chip .dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--c, var(--brand));
  box-shadow: 0 0 0 2px rgba(0,0,0,.25), 0 0 12px var(--c, var(--brand));
}

/* Tabs (mobile-first bottom nav) */
.tabs {
  position: fixed; bottom: 14px; left: 14px; right: 14px;
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  gap: 6px;
  background: var(--tabs-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--stroke);
  border-radius: 18px;
  padding: 6px;
  box-shadow: var(--shadow);
  z-index: 10;
}
.tab {
  text-decoration: none; color: var(--muted);
  display:flex; flex-direction:column; align-items:center; gap:2px;
  padding: 10px 4px;
  border-radius: 12px;
  font-size: 11px;
  transition: background .18s, color .18s, transform .18s;
}
.tab svg { opacity: .85; }
.tab.active {
  color: var(--text);
  background: linear-gradient(180deg, rgba(58,167,255,.20), rgba(58,167,255,.05));
  box-shadow: inset 0 0 0 1px rgba(58,167,255,.3);
}
.tab.active svg { opacity: 1; color: var(--brand); }

.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 16px;
}

/* Page head */
.page-head {
  display:flex; align-items:center; justify-content:space-between; gap:10px;
  margin: 8px 0 14px;
}
.page-head h1 { font-size: 22px; margin: 0; letter-spacing: .2px; }
.section-title { font-size: 14px; color: var(--muted); margin: 22px 6px 8px; text-transform: uppercase; letter-spacing: 1.2px; }
.section-sub { color: var(--muted); font-size: 12px; padding: 14px 8px 4px; text-transform: uppercase; letter-spacing: 1.1px; }

/* Cards */
.card {
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 14px;
  box-shadow: 0 4px 24px rgba(0,0,0,.18);
}
.card.link-card { display:block; text-decoration: none; color: inherit; }
.card.link-card:hover { background: var(--card-hi); border-color: var(--stroke-hi); }
.collapsible > summary {
  list-style: none;
  cursor: pointer;
  display:flex; align-items:center; gap:10px;
  font-weight: 600;
  user-select: none;
}
.collapsible > summary::-webkit-details-marker { display:none; }
.collapsible[open] > summary { margin-bottom: 12px; }
.plus {
  width: 26px; height: 26px;
  background: linear-gradient(135deg, var(--brand), #1e6bff);
  border-radius: 8px;
  position: relative;
  display: inline-block;
  flex-shrink: 0;
  text-indent: -9999px; /* esconde el "+" del HTML */
  overflow: hidden;
}
.plus::before,
.plus::after {
  content: "";
  position: absolute;
  background: #fff;
  border-radius: 1px;
  top: 50%; left: 50%;
}
.plus::before { width: 12px; height: 2.5px; transform: translate(-50%, -50%); }
.plus::after  { width: 2.5px; height: 12px; transform: translate(-50%, -50%); }

/* Forms */
.stack { display:flex; flex-direction:column; gap: 10px; }
.row { display:flex; gap: 10px; align-items: end; }
.row.between { justify-content: space-between; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
label { display:flex; flex-direction:column; gap:6px; font-size: 13px; color: var(--muted); }
label.checkbox { flex-direction: row; align-items:center; gap: 8px; color: var(--text); }
input, select, textarea {
  width: 100%;
  background: var(--bg2);
  border: 1px solid var(--stroke);
  color: var(--text);
  padding: 12px 12px;
  border-radius: var(--radius-sm);
  font: inherit;
  outline: none;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(58,167,255,.18);
}
input[type=color] { padding: 4px; height: 42px; width: 56px; cursor: pointer; }
input[type=file] { padding: 9px; }

/* Buttons */
.btn {
  display:inline-flex; align-items:center; justify-content:center; gap:6px;
  background: var(--card-hi);
  color: var(--text);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-sm);
  padding: 11px 16px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: transform .15s, background .15s, border-color .15s;
}
.btn:hover, .btn:focus, .btn:active, .btn:visited { text-decoration: none; }
.btn:hover { background: rgba(255,255,255,.10); border-color: var(--stroke-hi); }
.btn:active { transform: translateY(1px); }
.btn.primary {
  background: linear-gradient(180deg, var(--brand), #1e6bff);
  border-color: rgba(58,167,255,.4);
  color: white;
  box-shadow: 0 6px 20px rgba(58,167,255,.30);
}
.btn.primary:hover { background: linear-gradient(180deg, var(--brand-hi), #2a78ff); }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--danger); border-color: rgba(255,107,107,.3); }
.btn.danger:hover { background: rgba(255,107,107,.12); }
.btn.small { padding: 6px 10px; font-size: 12px; }
.btn.icon { width: 36px; height: 36px; padding: 0; font-size: 18px; line-height: 1; }
.btn.block { width: 100%; }
.link {
  background: none; border: none; color: var(--brand); cursor: pointer; font: inherit;
  text-decoration: none;
}
.link:hover { color: var(--brand-hi); text-decoration: underline; }

/* Filters / chips */
.filters {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin: 10px 0 14px;
}
.chip {
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 13px;
  background: var(--card);
  border: 1px solid var(--stroke);
  color: var(--muted);
}
.chip.on {
  color: var(--text);
  background: rgba(58,167,255,.18);
  border-color: rgba(58,167,255,.4);
}
.chip.cat { position: relative; padding-left: 22px; }
.chip.cat::before {
  content: "";
  position: absolute; left: 8px; top: 50%; transform: translateY(-50%);
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--c, var(--brand));
}
.filters .sep { flex-basis: 100%; height: 0; }

/* Lists */
.list { list-style: none; padding: 0; margin: 0; display:flex; flex-direction:column; gap: 8px; }
.empty {
  text-align: center; color: var(--muted); padding: 26px 10px;
  background: var(--card); border: 1px dashed var(--stroke); border-radius: var(--radius);
}

/* Task / item rows */
.task, .item, .job, .user-row, .cat-row, .hist-item {
  display:flex; align-items:center; gap: 10px;
  padding: 12px;
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  transition: background .15s, border-color .15s;
}
.task:hover, .item:hover, .job:hover { background: var(--card-hi); }
.task.done .task-title, .item.bought .task-title { text-decoration: line-through; color: var(--muted); }
.task-body { flex: 1; min-width: 0; }
.task-title { font-weight: 600; word-break: break-word; }
.task-notes { color: var(--muted); font-size: 13px; margin-top: 2px; }
.task-meta { display:flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }

.check-form { margin: 0; }
.check {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 2px solid var(--stroke-hi);
  background: transparent;
  cursor: pointer;
  position: relative;
  transition: background .15s, border-color .15s, transform .15s;
}
.check:hover { border-color: var(--brand); }
.check.on {
  background: linear-gradient(135deg, var(--good), #1ec39b);
  border-color: transparent;
}
.check.on::after {
  content: "";
  position: absolute; left: 8px; top: 4px;
  width: 8px; height: 13px;
  border: solid #002820;
  border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg);
}

/* Tags */
.tag {
  display:inline-flex; align-items:center; gap:6px;
  padding: 3px 9px;
  font-size: 11px; font-weight: 600;
  border-radius: 999px;
  background: rgba(255,255,255,.06);
  border: 1px solid var(--stroke);
  color: var(--text);
}
.tag::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%;
  background: var(--c, var(--brand));
}
.tag.prio { color: var(--warn); border-color: rgba(255,200,87,.3); }
.tag.prio::before { background: var(--warn); }
.tag.urgent { color: var(--urgent); border-color: rgba(255,77,141,.4); background: rgba(255,77,141,.10); }
.tag.urgent::before { background: var(--urgent); }
.tag.date::before { display: none; }
.tag.status { background: rgba(58,167,255,.10); border-color: rgba(58,167,255,.3); }

/* Priority bars */
.prio-1 { box-shadow: inset 3px 0 0 0 var(--warn); }
.prio-2 { box-shadow: inset 3px 0 0 0 var(--urgent); }

/* Print job statuses */
.status-imprimiendo { box-shadow: inset 3px 0 0 0 var(--brand); }
.status-hecho { opacity: .68; }
.status-cancelado { opacity: .55; text-decoration: line-through; }
.job-actions { display:flex; gap: 6px; align-items: center; }
.job-actions select { width: auto; padding: 8px 10px; }

/* Cat row */
.cat-row { gap: 12px; }
.cat-row .dot { width: 14px; height: 14px; border-radius: 50%; background: var(--c, var(--brand)); box-shadow: 0 0 14px var(--c, var(--brand)); }
.cat-name { flex: 1; font-weight: 600; }

/* User row */
.user-row { gap: 12px; }
.user-row .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--c, var(--brand)); }
.inline-form { position: relative; }
.inline-form > summary { list-style: none; }
.inline-form > summary::-webkit-details-marker { display: none; }
.inline-form[open] form {
  position: absolute; right: 0; top: 110%;
  background: var(--bg2); border: 1px solid var(--stroke-hi);
  padding: 10px; border-radius: var(--radius-sm);
  display: flex; gap: 6px; min-width: 240px; z-index: 5;
  box-shadow: var(--shadow);
}

/* Prominent label (used on "Nueva lista" form) */
.big-label { font-size: 15px; color: var(--text); gap: 8px; }
.big-label > input {
  font-size: 18px;
  padding: 16px 14px;
  border-color: var(--stroke-hi);
}
.big-label > input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(58,167,255,.22);
}

/* Botón "atrás" suave */
.back-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px 6px 10px;
  font-size: 13px; font-weight: 500;
  text-decoration: none;
  color: var(--muted);
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: 999px;
  transition: color .15s, background .15s, border-color .15s, transform .15s;
}
.back-btn:hover {
  color: var(--text);
  background: var(--card-hi);
  border-color: var(--stroke-hi);
}
.back-btn svg { transition: transform .15s; flex-shrink: 0; }
.back-btn:hover svg { transform: translateX(-3px); }

/* Pill que lleva a otra sección (flecha al final) */
.fwd-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px 6px 12px;
  font-size: 13px; font-weight: 500;
  text-decoration: none;
  color: var(--muted);
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: 999px;
  transition: color .15s, background .15s, border-color .15s;
}
.fwd-btn:hover {
  color: var(--text);
  background: var(--card-hi);
  border-color: var(--stroke-hi);
}
.fwd-btn svg { transition: transform .15s; flex-shrink: 0; }
.fwd-btn:hover svg { transform: translateX(3px); }

/* Pasos de instalación */
.install-steps {
  margin: 8px 0 4px 18px;
  padding: 0;
  display: flex; flex-direction: column; gap: 6px;
  color: var(--text);
}
.install-steps li { line-height: 1.5; }
.install-steps strong { color: var(--text); }

/* Notas rápidas en grid con tinte por nota */
.notes-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 4px;
}
@media (min-width: 640px) { .notes-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1020px) { .notes-grid { grid-template-columns: repeat(3, 1fr); } }

.note {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  border-radius: var(--radius);
  background: hsl(var(--note-hue, 220) 45% 28% / 0.65);
  border: 1px solid hsl(var(--note-hue, 220) 60% 65% / 0.40);
  box-shadow: 0 4px 14px rgba(0,0,0,.22);
  transition: transform .15s, box-shadow .15s, border-color .15s;
  min-width: 0;
}
.note:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(0,0,0,.30); }
.note-body { width: 100%; min-width: 0; }
.note-content {
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.5;
  font-size: 14.5px;
}
.note-foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid hsl(var(--note-hue, 220) 50% 60% / 0.22);
}
.note-meta { margin: 0; }
.note-actions { display: flex; gap: 4px; }

[data-theme="light"] .note {
  background: hsl(var(--note-hue, 220) 85% 94% / 1);
  border: 1px solid hsl(var(--note-hue, 220) 55% 55% / 0.35);
  box-shadow: 0 2px 8px rgba(0,0,0,.07);
}
[data-theme="light"] .note-foot {
  border-top-color: hsl(var(--note-hue, 220) 50% 55% / 0.25);
}

/* Manuales: cuadros bien delimitados */
.manual {
  background: rgba(255,255,255,.06);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  margin-bottom: 10px;
  overflow: hidden;
  transition: transform .15s, background .15s, border-color .15s, box-shadow .15s;
}
.manual:hover {
  transform: translateY(-1px);
  background: var(--card-hi);
  border-color: var(--brand);
  box-shadow: 0 6px 18px rgba(0,0,0,.22);
}
[data-theme="light"] .manual { background: #ffffff; border-color: rgba(0,0,0,.10); }
[data-theme="light"] .manual:hover { background: #f7faff; }

/* Manuales */
.manual-link {
  display: block;
  padding: 14px 16px;
  text-decoration: none;
  color: inherit;
}
.manual-title { font-weight: 600; font-size: 16px; word-break: break-word; }
.manual-meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 6px; }
.manual-detail-title { margin: 0; font-size: 22px; word-break: break-word; }
.manual-content {
  line-height: 1.6;
  font-size: 15px;
  max-width: 100%;
  overflow-wrap: anywhere;
}
.manual-content.rich { white-space: normal; word-break: normal; }
.manual-content.rich p { margin: 0 0 12px; }
.manual-content.rich h1,
.manual-content.rich h2,
.manual-content.rich h3,
.manual-content.rich h4 { margin: 18px 0 8px; line-height: 1.3; }
.manual-content.rich h1 { font-size: 22px; }
.manual-content.rich h2 { font-size: 18px; }
.manual-content.rich h3 { font-size: 16px; }
.manual-content.rich ul, .manual-content.rich ol { margin: 0 0 12px; padding-left: 22px; }
.manual-content.rich li { margin: 4px 0; }
.manual-content.rich a { color: var(--brand); text-decoration: underline; }
.manual-content.rich code {
  background: rgba(255,255,255,.07);
  padding: 1px 6px; border-radius: 4px;
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .92em;
  color: #ffb3d9;
}
.manual-content.rich pre {
  background: rgba(0,0,0,.30);
  border: 1px solid var(--stroke);
  padding: 12px 14px; border-radius: var(--radius-sm);
  overflow-x: auto;
  white-space: pre;
}
.manual-content.rich pre code { background: transparent; padding: 0; color: var(--text); }
.manual-content.rich blockquote {
  border-left: 3px solid var(--brand);
  margin: 12px 0; padding: 4px 14px;
  color: var(--muted);
  background: rgba(58,167,255,.06);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.manual-content.rich hr {
  border: none; height: 1px;
  background: var(--stroke);
  margin: 18px 0;
}
.manual-content.rich img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
  margin: 8px 0;
  border: 1px solid var(--stroke);
}

/* Toolbar del editor Markdown */
.editor-toolbar {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-bottom: -4px;
}
.editor-toolbar .btn.small { padding: 5px 10px; font-size: 13px; min-width: 36px; }
.editor-toolbar code { font-size: 12px; }
.md-upload-btn { cursor: pointer; }
.md-help summary { cursor: pointer; padding: 4px 0; }
.md-help ul { margin: 6px 0 0 18px; padding: 0; }
.md-help li { line-height: 1.6; }
.md-help code {
  background: rgba(255,255,255,.07);
  padding: 1px 5px; border-radius: 4px;
  font-family: ui-monospace, monospace; font-size: .92em;
}
textarea.drag, #manual-content.drag {
  outline: 2px dashed var(--brand);
  outline-offset: -2px;
  background: rgba(58,167,255,.06);
}

/* Lista de adjuntos */
.attachments-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.attachment {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px;
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-sm);
}
.attachment svg { color: var(--brand); flex-shrink: 0; }
.attachment-name { color: var(--text); text-decoration: none; font-weight: 500; flex: 1; word-break: break-all; }
.attachment-name:hover { color: var(--brand); text-decoration: underline; }
.attachment .del-form { margin-left: auto; }

/* Toggle de tema (segment control) */
.theme-switch {
  display: inline-flex;
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: 999px;
  padding: 4px;
  gap: 2px;
}
.theme-switch button {
  background: transparent;
  border: none;
  color: var(--muted);
  padding: 7px 14px;
  font-size: 13px; font-weight: 600;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
  transition: background .15s, color .15s;
}
.theme-switch button:hover { color: var(--text); }
.theme-switch button.active {
  background: linear-gradient(180deg, var(--brand), #1e6bff);
  color: white;
  box-shadow: 0 3px 10px rgba(58,167,255,.30);
}
.theme-switch svg { width: 16px; height: 16px; }

/* Backup OK banner */
.backup-ok {
  border: 1px solid rgba(62,240,195,.4);
  background: rgba(62,240,195,.10);
  color: var(--good);
}
.backup-ok strong { color: var(--good); }

/* Login */
.login-wrap { min-height: 70vh; display:flex; align-items:center; justify-content:center; padding: 20px; }
.login { width: 100%; max-width: 360px; }
.login h1 { margin: 0 0 4px; }
.alert { padding: 10px 12px; border-radius: var(--radius-sm); background: rgba(255,107,107,.10); border: 1px solid rgba(255,107,107,.4); color: var(--danger); }

/* Misc */
.muted { color: var(--muted); }
.small { font-size: 12px; }
.big { font-size: 18px; font-weight: 600; }
.badge { padding: 4px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; letter-spacing: .5px; }
.badge.open { background: rgba(62,240,195,.14); color: var(--good); border: 1px solid rgba(62,240,195,.4); }
.badge.closed { background: rgba(255,255,255,.05); color: var(--muted); border: 1px solid var(--stroke); }
.thumb { width: 56px; height: 56px; object-fit: cover; border-radius: var(--radius-sm); border: 1px solid var(--stroke); }
.ticket { width: 100%; max-width: 320px; border-radius: var(--radius-sm); margin-top: 8px; }
.logout-form { text-align: center; margin: 20px; }
.del-form { margin: 0; }

/* Tablet+ */
@media (min-width: 720px) {
  .tabs {
    position: sticky; top: 60px; bottom: auto;
    margin: 12px 16px 0; max-width: 720px; margin-left: auto; margin-right: auto;
    grid-auto-columns: minmax(80px, 1fr);
  }
  .tab { flex-direction: row; gap: 8px; padding: 10px 14px; font-size: 13px; }
  body { padding-bottom: 30px; }
}

/* ── Sin conexión (28-sep-2026) ─────────────────────────────────────────── */
.estado-red {
  position: sticky; top: 58px; z-index: 4;
  margin: 0 12px 10px; padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--card-hi); border: 1px solid var(--stroke-hi);
  font-size: 14px; line-height: 1.4;
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.estado-red[hidden], .estado-red [hidden] { display: none !important; }
.estado-red.sin-red { border-color: var(--warn); }
.estado-red.con-error { border-color: var(--danger); }
.estado-red-texto { flex: 1 1 200px; }
.estado-red-ver, .estado-red-quitar {
  background: transparent; color: var(--brand); border: 1px solid var(--stroke-hi);
  border-radius: 999px; padding: 4px 12px; font: inherit; font-size: 13px; cursor: pointer;
  min-height: 32px;
}
.estado-red-lista { list-style: none; margin: 4px 0 0; padding: 0; width: 100%; }
.estado-red-lista li {
  display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center;
  padding: 8px 0; border-top: 1px solid var(--stroke);
}
.estado-red-desc { flex: 1 1 180px; word-break: break-word; }
.estado-red-hora { color: var(--muted); font-size: 12px; }
.estado-red-error { color: var(--danger); font-size: 12px; width: 100%; }
.pendiente { border-style: dashed !important; opacity: .85; }
.pendiente.se-borra .task-title, .pendiente.se-borra .note-content { text-decoration: line-through; }
.pendiente.se-borra { opacity: .5; }
.badge-pendiente {
  display: inline-block; font-size: 11px; font-weight: 600; letter-spacing: .02em;
  padding: 2px 8px; border-radius: 999px;
  color: var(--warn); border: 1px solid var(--warn);
}
.toast-red {
  position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%);
  max-width: min(92vw, 420px); z-index: 50;
  background: var(--bg2); color: var(--text); border: 1px solid var(--stroke-hi);
  border-radius: var(--radius-sm); padding: 10px 14px; font-size: 14px;
  box-shadow: var(--shadow); transition: opacity .6s;
}
.toast-red.fuera { opacity: 0; }
.sin-red-pagina h1 { margin-top: 0; }
.sin-red-enlaces { display: flex; flex-wrap: wrap; gap: 8px; }
@media (prefers-reduced-motion: reduce) { .toast-red { transition: none; } }
