:root {
  --bg: #F5F3ED;
  --bg-soft: #ECE9DF;
  --card: #FFFFFF;
  --border: #E3DFD1;
  --text: #24312C;
  --text-muted: #5E6D66;
  --primary: #2F6259;
  --primary-strong: #204A42;
  --on-primary: #F5F3ED;
  --mint: #C3E6D9;
  --mint-text: #1F4E42;
  --lavender: #DAD7F2;
  --lavender-text: #423F73;
  --peach: #F6D9AF;
  --peach-text: #7A4E17;
  --gold: #F0E3A8;
  --gold-text: #7A6A17;
  --danger-text: #B5544A;
  --shadow: 0 2px 10px rgba(36,49,44,0.07), 0 1px 2px rgba(36,49,44,0.05);
  --radius-lg: 22px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

[data-theme="dark"] {
  --bg: #0D1210;
  --bg-soft: #151F1B;
  --card: #1A2620;
  --border: #2A3D35;
  --text: #ECEBE2;
  --text-muted: #9FB0A8;
  --primary: #7FCEB7;
  --primary-strong: #9EDFC9;
  --on-primary: #0D1210;
  --mint: #1E3A2E;
  --mint-text: #9BE0C8;
  --lavender: #252345;
  --lavender-text: #C7C4EF;
  --peach: #3D3018;
  --peach-text: #EFC482;
  --gold: #3D3718;
  --gold-text: #EFDD82;
  --danger-text: #E39A90;
  --shadow: 0 2px 14px rgba(0,0,0,0.4);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.5;
  transition: background .25s ease, color .25s ease;
  padding-bottom: 80px;
}

a { color: var(--primary-strong); text-decoration: underline; text-underline-offset: 2px; }

button { font-family: inherit; cursor: pointer; background: none; border: none; color: inherit; }

input, select, textarea { font-family: inherit; }

::selection { background: var(--primary); color: var(--on-primary); }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

.wrap { max-width: 800px; margin: 0 auto; padding: 16px 16px 4px; }

/* --- Topbar --- */
.topbar { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.eyebrow { font-family: var(--font-mono); font-size: 11px; letter-spacing: .07em; text-transform: uppercase; color: var(--primary-strong); font-weight: 500; }
h1 { font-family: var(--font-display); font-size: clamp(24px, 5vw, 32px); line-height: 1.15; margin: 6px 0 4px; font-weight: 700; letter-spacing: -0.01em; }
.sub { color: var(--text-muted); font-size: 14px; margin: 0 0 4px; max-width: 52ch; }
.hero-stats { font-family: var(--font-mono); font-size: 12px; color: var(--primary-strong); margin: 0 0 12px; }
.iconbtn {
  background: var(--card); border: 1.5px solid var(--border); border-radius: 999px;
  width: 36px; height: 36px; min-width: 36px; display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 15px; color: var(--text);
}
.iconbtn:hover { border-color: var(--primary); }
.topbar-actions { display: flex; gap: 6px; }

/* --- Save error banner --- */
.save-error { display: none; font-family: var(--font-mono); font-size: 12px; border: 1px solid var(--danger-text); border-radius: var(--radius-sm); padding: 8px 12px; margin-bottom: 10px; color: var(--danger-text); background: var(--card); }
.save-error:not([hidden]) { display: block; }

/* --- Tabs --- */
.tabbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; gap: 4px; background: var(--bg);
  padding: 8px 16px; border-bottom: 1px solid var(--border);
  max-width: 800px; margin: 0 auto;
  overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.tabbar::-webkit-scrollbar { display: none; }
.tab {
  flex: 0 0 auto; text-align: center; padding: 8px 12px; border-radius: 999px;
  font-family: var(--font-display); font-weight: 600; font-size: 12.5px; white-space: nowrap;
  background: transparent; border: 1.5px solid transparent; color: var(--text-muted);
  transition: all .15s ease;
}
.tab.active { background: var(--card); border-color: var(--border); color: var(--primary-strong); box-shadow: var(--shadow); }
.tab:hover:not(.active) { color: var(--text); }
.tab[aria-selected="true"] { background: var(--card); border-color: var(--border); color: var(--primary-strong); box-shadow: var(--shadow); }

.panel { display: none; padding: 16px; max-width: 800px; margin: 0 auto; }
.panel.active { display: block; }
.panel[hidden] { display: none; }
.panel:not([hidden]) { display: block; }

.panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.panel-head h2 { font-family: var(--font-display); font-size: 16px; margin: 0; }

/* --- Board (Kanban) --- */
.board-scroll { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 10px; -webkit-overflow-scrolling: touch; }
.board-col { flex: 0 0 220px; background: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 10px; display: flex; flex-direction: column; max-height: 68vh; }
.board-col-head { display: flex; justify-content: space-between; align-items: center; font-family: var(--font-display); font-weight: 700; font-size: 13px; padding: 2px 4px 8px; }
.col-count { font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); background: var(--card); border-radius: 999px; padding: 1px 8px; }
.board-col-body { display: flex; flex-direction: column; gap: 7px; overflow-y: auto; flex: 1; min-height: 0; }
.board-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 10px 12px; box-shadow: var(--shadow); cursor: pointer; transition: border-color .15s; }
.board-card:hover { border-color: var(--primary); }
.card-empresa { font-weight: 700; font-size: 13px; margin: 0 0 2px; }
.card-cargo { font-size: 12px; color: var(--text-muted); margin: 0 0 4px; }
.card-pills { display: flex; gap: 4px; flex-wrap: wrap; }
.mini-pill { font-family: var(--font-mono); font-size: 10px; background: var(--bg-soft); border: 1px solid var(--border); border-radius: 999px; padding: 2px 7px; color: var(--text-muted); }
.due-flag { display: inline-block; margin-top: 4px; font-size: 11px; color: var(--peach-text); }
.add-card-btn { background: none; border: 1px dashed var(--border); border-radius: var(--radius-md); padding: 8px; font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); cursor: pointer; margin-top: 2px; transition: border-color .15s; }
.add-card-btn:hover { border-color: var(--primary); }
.empty-hint { font-size: 12px; color: var(--text-muted); text-align: center; padding: 8px 0; }

/* --- Contacts --- */
.contact-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 12px 14px; margin-bottom: 8px; box-shadow: var(--shadow); cursor: pointer; transition: border-color .15s; }
.contact-card:hover { border-color: var(--primary); }
.contact-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.contact-name { font-weight: 700; font-size: 14px; }
.contact-meta { font-size: 12px; color: var(--text-muted); margin: 2px 0 4px; }
.contact-notes { font-size: 12px; color: var(--text-muted); margin: 4px 0 0; }

/* --- Modal --- */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(20,26,23,0.5); z-index: 100; align-items: flex-end; justify-content: center; }
.modal-overlay.open { display: flex; }
.modal { background: var(--card); width: 100%; max-width: 480px; max-height: 88vh; overflow-y: auto; border-radius: 24px 24px 0 0; box-shadow: var(--shadow); }
@media (min-width: 640px) { .modal-overlay { align-items: center; } .modal { border-radius: var(--radius-lg); } }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--card); z-index: 1; }
.modal-head h3 { font-family: var(--font-display); font-size: 16px; margin: 0; }
.modal-body { padding: 12px 16px 4px; display: flex; flex-direction: column; }
.form-label { font-family: var(--font-mono); font-size: 10px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); margin: 8px 0 3px; display: block; }
.form-input { width: 100%; background: var(--bg-soft); border: 1.5px solid var(--border); border-radius: var(--radius-sm); padding: 8px 10px; font-family: var(--font-body); font-size: 14px; color: var(--text); }
.form-input:focus { border-color: var(--primary); outline: none; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.modal-foot { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--border); position: sticky; bottom: 0; background: var(--card); }
.primary-btn { background: var(--primary); color: var(--on-primary); border: none; border-radius: 999px; padding: 9px 16px; font-family: var(--font-display); font-weight: 600; font-size: 13px; cursor: pointer; }
.ghost-btn { background: none; border: 1.5px solid var(--border); color: var(--text); border-radius: 999px; padding: 9px 14px; font-family: var(--font-display); font-weight: 600; font-size: 13px; cursor: pointer; }
.danger-btn { background: none; border: none; color: var(--danger-text); font-family: var(--font-body); font-size: 13px; cursor: pointer; padding: 9px 4px; }

/* --- Tracker nodes --- */
.tracker { display: flex; align-items: center; gap: 8px; margin: 2px 0 14px; flex-wrap: wrap; }
.nodes { display: flex; gap: 5px; }
.node {
  width: 26px; height: 26px; border-radius: 7px;
  background: var(--bg-soft); border: 1.5px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 10px; color: var(--text-muted);
  transition: all .2s ease;
}
.node.done { background: var(--primary); border-color: var(--primary); color: var(--on-primary); font-weight: 600; }
.tracker-label { font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); }

/* --- Day cards --- */
.day-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); margin-bottom: 10px; box-shadow: var(--shadow); overflow: hidden; }
.day-head {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 13px 15px; background: transparent; border: none; cursor: pointer; text-align: left;
  font-family: var(--font-body); color: var(--text);
}
.day-head-left { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.day-name { font-family: var(--font-display); font-weight: 700; font-size: 15px; }
.day-tag { font-family: var(--font-mono); font-size: 10px; background: var(--mint); color: var(--mint-text); padding: 2px 8px; border-radius: 999px; }
.day-head-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.day-progress { font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); }
.chev { display: inline-block; transition: transform .2s ease; color: var(--text-muted); font-size: 12px; }
.day-card.open .chev { transform: rotate(180deg); }
.day-body { display: none; padding: 0 15px 13px; }
.day-card.open .day-body { display: block; }

.block { display: flex; gap: 10px; padding: 10px 0; border-top: 1px solid var(--border); }
.block:first-child { border-top: none; }
.block input[type=checkbox] { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--primary); flex-shrink: 0; cursor: pointer; }
label.block-label-wrap { flex: 1; cursor: pointer; }
.block-label { display: flex; align-items: baseline; gap: 7px; flex-wrap: wrap; margin-bottom: 2px; }
.block-name { font-weight: 600; font-size: 14px; }
.block-time { font-family: var(--font-mono); font-size: 10px; padding: 2px 7px; border-radius: 999px; white-space: nowrap; }
.block-text { font-size: 13px; color: var(--text-muted); margin: 0; }
.block-text a { color: var(--primary-strong); }
.block.checked .block-name { text-decoration: line-through; opacity: .5; }
.block.checked .block-text { opacity: .5; }

/* --- Week selector --- */
.week-selector { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 6px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.week-selector::-webkit-scrollbar { display: none; }
.week-pill { flex: 0 0 auto; font-family: var(--font-display); font-weight: 600; font-size: 12px; background: var(--bg-soft); border: 1.5px solid var(--border); color: var(--text-muted); border-radius: 999px; padding: 7px 13px; cursor: pointer; white-space: nowrap; transition: all .15s; }
.week-pill.active { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.current-dot { font-size: 8px; margin-left: 4px; vertical-align: middle; color: var(--peach-text); }
.week-pill.active .current-dot { color: var(--on-primary); }
.week-caption { font-family: var(--font-mono); font-size: 12px; color: var(--text-muted); margin: 0 0 12px; }

/* --- Lecciones --- */
.leccion { margin-top: 6px; border-top: 1px dashed var(--border); padding-top: 2px; }
.leccion-head { width: 100%; display: flex; justify-content: space-between; align-items: center; background: none; border: none; padding: 8px 2px; cursor: pointer; font-family: var(--font-display); font-weight: 600; font-size: 13px; color: var(--primary-strong); }
.leccion-body { display: none; padding: 2px 2px 6px; }
.leccion.open .leccion-body { display: block; }
.leccion.open .chev { transform: rotate(180deg); }
.leccion-concepto { font-size: 13px; color: var(--text); line-height: 1.55; margin: 0 0 8px; }
.code-block { background: #1B2420; border-radius: var(--radius-md); overflow: hidden; margin-bottom: 8px; }
[data-theme="dark"] .code-block { background: #0A0F0C; }
.code-head { display: flex; justify-content: space-between; align-items: center; padding: 6px 10px; background: rgba(255,255,255,0.06); }
.code-head span { font-family: var(--font-mono); font-size: 10px; color: #9FE0C8; text-transform: uppercase; letter-spacing: .05em; }
.copy-btn { background: none; border: 1px solid rgba(255,255,255,0.2); color: #D8E6E1; font-family: var(--font-mono); font-size: 10px; padding: 2px 8px; border-radius: 999px; cursor: pointer; }
.copy-btn:hover { border-color: #7FCEB7; }
.code-block pre { margin: 0; padding: 10px 12px; overflow-x: auto; }
.code-block code { font-family: var(--font-mono); font-size: 11.5px; line-height: 1.6; color: #E7EFEC; white-space: pre; }
.leccion-practica { font-size: 12px; color: var(--text-muted); background: var(--bg-soft); border-radius: var(--radius-md); padding: 8px 10px; margin: 0; }

/* --- Questions --- */
.cat-title { font-family: var(--font-display); font-weight: 700; font-size: 14px; margin: 18px 0 8px; color: var(--primary-strong); }
.cat-title:first-child { margin-top: 0; }
.q-item { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-md); margin-bottom: 7px; box-shadow: var(--shadow); overflow: hidden; }
.q-head { width: 100%; text-align: left; background: none; border: none; padding: 11px 13px; display: flex; justify-content: space-between; gap: 8px; align-items: center; cursor: pointer; font-family: var(--font-body); font-weight: 600; font-size: 13px; color: var(--text); }
.q-body { display: none; padding: 0 13px 12px; }
.q-body p { font-size: 13px; color: var(--text-muted); margin: 0; line-height: 1.55; }
.q-item.open .q-body { display: block; }
.q-item.open .chev { transform: rotate(180deg); }

/* --- Strategy --- */
.strat-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 13px 15px; margin-bottom: 8px; box-shadow: var(--shadow); }
.strat-title { font-family: var(--font-display); font-weight: 700; font-size: 14px; margin: 0 0 4px; color: var(--primary-strong); }
.strat-text { font-size: 13px; color: var(--text-muted); margin: 0; }

/* --- Directory --- */
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.stat-card { border: 1px solid var(--border); border-radius: 12px; padding: 10px; background: var(--card); }
.stat-value { font-family: var(--font-mono); font-size: 17px; font-weight: 700; line-height: 1; }
.stat-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); margin-top: 4px; }

.search-wrap { position: relative; margin-bottom: 10px; }
.search-wrap input { width: 100%; padding: 10px 34px; border-radius: 12px; border: 1px solid var(--border); background: var(--card); color: var(--text); font-size: 14px; outline: none; }
.search-wrap input::placeholder { color: var(--text-muted); }
.search-wrap input:focus { border-color: var(--primary); }
.search-icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--text-muted); pointer-events: none; }
.search-icon svg { width: 15px; height: 15px; }
.clear-btn { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); color: var(--text-muted); display: none; background: none; border: none; cursor: pointer; }
.clear-btn svg { width: 15px; height: 15px; display: block; }

.chips { display: flex; gap: 5px; overflow-x: auto; margin: 0 -16px 8px; padding: 0 16px 2px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex-shrink: 0; white-space: nowrap; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border); font-size: 12px; color: var(--text); background: var(--card); transition: all .15s; }
.chip.is-active { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }

.hide-row { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--text-muted); margin-bottom: 14px; user-select: none; }
.hide-row input { width: 14px; height: 14px; accent-color: var(--primary); }

.category-block { border: 1px solid var(--border); border-radius: 14px; overflow: hidden; margin-bottom: 8px; }
.category-header { width: 100%; display: flex; align-items: center; justify-content: space-between; padding: 11px 14px; background: var(--card); text-align: left; cursor: pointer; }
.category-header:hover { background: var(--bg-soft); }
.category-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.category-meta { display: flex; align-items: center; gap: 5px; font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); }
.category-meta svg { width: 13px; height: 13px; }

.entity-row { display: flex; align-items: center; gap: 8px; padding: 9px 13px; border-top: 1px solid var(--border); }
.entity-info { flex: 1; min-width: 0; }
.entity-name-row { display: flex; align-items: center; gap: 6px; }
.entity-name { font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.entity-meta { font-family: var(--font-mono); font-size: 10px; color: var(--text-muted); margin-top: 1px; }

.link-dot { flex-shrink: 0; width: 7px; height: 7px; border-radius: 999px; }
.link-dot.is-real { background: var(--primary); }
.link-dot.is-generic { background: transparent; border: 1.5px solid var(--text-muted); }

.stamp { flex-shrink: 0; width: 30px; height: 30px; border-radius: 999px; border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; color: var(--text-muted); transition: all .15s ease; }
.stamp svg { width: 14px; height: 14px; }
.stamp.is-active { border-color: var(--primary); background: var(--primary); color: var(--on-primary); transform: rotate(-6deg); }
.stamp:active { transform: scale(0.88) rotate(-4deg); }
.stamp.is-active:active { transform: scale(0.88) rotate(-10deg); }
.open-link { flex-shrink: 0; width: 30px; height: 30px; border-radius: 999px; border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; color: var(--text); text-decoration: none; }
.open-link svg { width: 13px; height: 13px; }

.empty-state { text-align: center; font-size: 13px; color: var(--text-muted); padding: 36px 0; }

/* --- Progress calendar --- */
.progress-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 18px; }
.progress-grid .stat-value { font-size: 20px; }
.calendar-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 8px; }
.calendar-weekdays { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; font-family: var(--font-mono); font-size: 10px; color: var(--text-muted); margin-bottom: 5px; text-align: center; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.cal-cell { aspect-ratio: 1; border-radius: 7px; border: 1px solid var(--border); display: flex; flex-direction: column; align-items: center; justify-content: center; font-family: var(--font-mono); }
.cal-cell.is-today { border-width: 1.5px; border-color: var(--primary); }
.cal-cell.has-activity { background: var(--primary); color: var(--on-primary); }
.cal-day { font-size: 10px; line-height: 1; }
.cal-count { font-size: 9px; line-height: 1; margin-top: 2px; }

.footnote { font-family: var(--font-mono); font-size: 10px; line-height: 1.7; color: var(--text-muted); margin-top: 14px; display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.footnote .link-dot { margin-left: 2px; }

/* --- Help panel --- */
.help-panel p { font-size: 13px; color: var(--text-muted); background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 9px 12px; margin: 0 0 6px; }
.reminder-toggle { width: 100%; display: flex; justify-content: space-between; align-items: center; background: var(--peach); color: var(--peach-text); border: none; border-radius: var(--radius-md); padding: 9px 13px; font-family: var(--font-display); font-weight: 600; font-size: 12px; cursor: pointer; margin-bottom: 8px; }
.reminder-list { list-style: none; margin: 0 0 8px; padding: 9px 13px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-md); font-size: 12px; color: var(--text-muted); }
.reminder-list li { padding: 3px 0; }

.reset-row { display: flex; justify-content: center; margin: 16px 0 4px; }
.reset-btn { font-family: var(--font-mono); font-size: 11px; background: none; border: 1px dashed var(--border); color: var(--text-muted); padding: 7px 14px; border-radius: 999px; cursor: pointer; }
.reset-btn:hover { border-color: var(--primary); color: var(--primary-strong); }
.footer-note { text-align: center; font-size: 12px; color: var(--text-muted); padding: 4px 20px; }

/* --- Tracks --- */
.track-note { font-size: 12px; color: var(--text-muted); background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 8px 10px; margin-bottom: 12px; }

/* --- How-to modal --- */
.howto-row { display: flex; gap: 10px; margin-bottom: 16px; }
.howto-row:last-child { margin-bottom: 0; }
.howto-icon { flex-shrink: 0; width: 28px; height: 28px; border-radius: 999px; border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; color: var(--text); }
.howto-icon svg { width: 13px; height: 13px; }
.howto-text h3 { font-size: 13px; font-weight: 700; margin: 0 0 2px; }
.howto-text p { font-size: 13px; line-height: 1.5; color: var(--text-muted); margin: 0; }

/* --- Mobile bottom nav --- */
.mobile-nav {
  display: none; position: fixed; bottom: 0; left: 0; right: 0; z-index: 30;
  background: var(--card); border-top: 1px solid var(--border);
  padding: 6px 4px env(safe-area-inset-bottom, 0);
  justify-content: space-around;
}
@media (max-width: 600px) {
  .mobile-nav { display: flex; }
  body { padding-bottom: 72px; }
  .tabbar { display: none; }
  .tab.mobile-tab { display: flex; }
  .tab { display: none; }
}
.mobile-tab {
  flex-direction: column; gap: 2px; font-size: 10px; padding: 6px 8px;
  font-family: var(--font-mono); color: var(--text-muted); min-width: 0;
}
.mobile-tab.active { color: var(--primary-strong); }
.mobile-tab svg { width: 18px; height: 18px; }

@media (min-width: 601px) {
  .mobile-tab { display: none !important; }
}

/* --- Puerta de acceso --- */
body.locked { overflow: hidden; }
.lock-overlay {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg); padding: 20px;
}
.lock-overlay[hidden] { display: none; }
.lock-card {
  width: 100%; max-width: 340px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow);
  padding: 28px 24px; text-align: center;
}
.lock-icon { font-size: 34px; }
.lock-title { font-family: var(--font-display); font-size: 20px; margin: 10px 0 4px; }
.lock-sub { font-size: 13px; color: var(--text-muted); margin: 0 0 14px; }
.lock-input { text-align: center; margin-bottom: 6px; }
.lock-error { font-size: 12px; color: var(--danger-text); margin: 4px 0 0; }
.lock-error[hidden] { display: none; }
.lock-btn { width: 100%; margin-top: 10px; }
@keyframes lock-shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-7px); }
  40%, 80% { transform: translateX(7px); }
}
.lock-card.shake { animation: lock-shake .35s ease; }