@font-face { font-family: "MDT Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("chrome-extension://__MSG_@@extension_id__/vendor/fonts/inter.woff2") format("woff2"), url("../vendor/fonts/inter.woff2") format("woff2"); }
@font-face { font-family: "MDT Inter"; font-style: italic; font-weight: 100 900; font-display: swap;
  src: url("chrome-extension://__MSG_@@extension_id__/vendor/fonts/inter-italic.woff2") format("woff2"), url("../vendor/fonts/inter-italic.woff2") format("woff2"); }
/* SharpMD. Todo cuelga de .lmd-root para no tocar páginas donde la extensión no actúa. */
.lmd-root {
  --lmd-side-w: 300px;
  --lmd-content-w: 1040px;
  --lmd-font-size: 16px;
  --lmd-line-height: 1.65;
  --lmd-font: "MDT Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif;
  --lmd-mono: ui-monospace, SFMono-Regular, "Cascadia Code", Consolas, "Liberation Mono", Menlo, monospace;
  /* "only light": con un tema claro el navegador no oscurece la página por su cuenta. "light" queda para el que no entiende "only". */
  color-scheme: light;
  color-scheme: only light;
}
.lmd-root.lmd-light {
  --bg: #fbfaf7;
  --bg-side: #f2f0ea;
  --bg-soft: #f1efe9;
  --bg-code: #f1efe9;
  --fg: #1d2026;
  --fg-muted: #5c6370;
  --fg-faint: #646b78;
  --line: #dedbd2;
  --accent: #3f6a0a;
  --accent-fill: var(--accent);
  --accent-fg: #ffffff;
  --accent-soft: rgba(101, 163, 13, 0.16);
  --link: #1a5fd0;
  --hit: #ffe08a;
  --hit-current: #ff9f43;
  --shadow: 0 10px 40px rgba(20, 22, 28, 0.18);
}
.lmd-root.lmd-dark {
  color-scheme: dark;
  --bg: #121418;
  --bg-side: #0c0d10;
  --bg-soft: #1a1d23;
  --bg-code: #181b21;
  --fg: #e6e8ec;
  --fg-muted: #a0a7b4;
  --fg-faint: #828999;
  --line: #2a2e37;
  --accent: #bef264;
  --accent-fill: var(--accent);
  --accent-fg: #14161a;
  --accent-soft: rgba(190, 242, 100, 0.14);
  --link: #7aa7ff;
  --hit: #6b5a10;
  --hit-current: #b45309;
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.55);
}

.lmd-root, .lmd-body { margin: 0; padding: 0; background: var(--bg); }
.lmd-body {
  color: var(--fg);
  font-family: var(--lmd-font);
  font-size: var(--lmd-font-size);
  line-height: var(--lmd-line-height);
  -webkit-font-smoothing: antialiased;
}
.lmd-body *, .lmd-body *::before, .lmd-body *::after { box-sizing: border-box; }
.lmd-body [hidden] { display: none !important; }
.lmd-body svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------- Barra lateral ---------- */
.lmd-sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--lmd-side-w);
  background: var(--bg-side); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; z-index: 20;
  font-size: 13.5px; line-height: 1.45;
  transition: transform 0.18s ease;
}
.lmd-side-hidden .lmd-sidebar { transform: translateX(-100%); }
.lmd-icon-btn {
  width: 32px; height: 32px; border: 0; border-radius: 7px; background: transparent; color: var(--fg-muted);
  display: grid; place-items: center; cursor: pointer; flex: none;
}
.lmd-icon-btn:hover { background: var(--bg-soft); color: var(--fg); }

.lmd-search { display: flex; align-items: center; gap: 6px; padding: 10px 10px 8px; position: relative; }
.lmd-search-ico { position: absolute; left: 19px; top: 17px; color: var(--fg-faint); pointer-events: none; }
.lmd-search-ico svg { width: 15px; height: 15px; }
.lmd-search input { padding-left: 30px !important; }
.lmd-search-count:empty { display: none; }
.lmd-search input {
  flex: 1; min-width: 0; height: 30px; padding: 0 9px; border: 1px solid var(--line); border-radius: 7px;
  background: var(--bg); color: var(--fg); font: inherit;
}
.lmd-search input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.lmd-search-count { color: var(--fg-faint); font-size: 12px; white-space: nowrap; min-width: 34px; text-align: right; }

.lmd-pane { flex: 1; overflow: auto; padding: 4px 6px 24px; overscroll-behavior: contain; }
.lmd-empty { color: var(--fg-faint); padding: 10px; margin: 0; }

.lmd-pane-outline { padding: 0 0 24px; }
.lmd-o-head { position: sticky; top: 0; z-index: 2; padding: 10px 14px 12px; margin-bottom: 6px; background: var(--bg-side); border-bottom: 1px solid var(--line); }
.lmd-o-title { display: block; color: var(--fg); font-size: 15px; font-weight: 700; line-height: 1.3; letter-spacing: -0.01em; text-decoration: none; overflow-wrap: anywhere; }
.lmd-o-title:hover { color: var(--accent); }
.lmd-o-meta { margin-top: 5px; color: var(--fg-faint); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.lmd-o-progress { display: flex; align-items: center; gap: 8px; margin-top: 9px; }
.lmd-o-bar { flex: 1; height: 4px; border-radius: 2px; background: var(--bg-soft); overflow: hidden; }
.lmd-o-bar span { display: block; height: 100%; width: 0; border-radius: 2px; background: var(--accent-fill); transition: width 0.12s linear; }
.lmd-o-pct { min-width: 34px; color: var(--fg-faint); font-size: 11px; text-align: right; font-variant-numeric: tabular-nums; }
.lmd-o-tree { padding: 0 8px 0 6px; }
.lmd-o-row { display: flex; align-items: flex-start; gap: 2px; border-radius: 6px; position: relative; }
.lmd-o-row:hover { background: var(--bg-soft); }
.lmd-o-link { flex: 1; min-width: 0; padding: 5px 8px 5px 2px; color: var(--fg-muted); text-decoration: none; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.lmd-o-row:hover .lmd-o-link { color: var(--fg); }
.lmd-o-l1 > .lmd-o-link { color: var(--fg); font-weight: 600; }
.lmd-o-l3 > .lmd-o-link, .lmd-o-l4 > .lmd-o-link { font-size: 12.8px; }
.lmd-o-tog, .lmd-o-dot { flex: none; width: 20px; height: 29px; display: grid; place-items: center; }
.lmd-o-tog { border: 0; padding: 0; background: transparent; color: var(--fg-faint); cursor: pointer; border-radius: 4px; }
.lmd-o-tog:hover { color: var(--fg); }
.lmd-o-tog svg { width: 13px; height: 13px; transform: rotate(90deg); transition: transform 0.12s ease; }
.lmd-o-shut > .lmd-o-row .lmd-o-tog svg { transform: none; }
.lmd-o-dot::before { content: ""; width: 4px; height: 4px; border-radius: 50%; background: var(--line); }
.lmd-o-kids { margin-left: 9px; padding-left: 6px; border-left: 1px solid var(--line); }
.lmd-o-shut > .lmd-o-kids { display: none; }
.lmd-o-row.lmd-o-path > .lmd-o-link { color: var(--fg); }
.lmd-o-row.lmd-active { background: var(--accent-soft); }
.lmd-o-row.lmd-active > .lmd-o-link { color: var(--accent); font-weight: 600; }
.lmd-o-row.lmd-active .lmd-o-dot::before { background: var(--accent-fill); }
.lmd-o-row.lmd-active::before { content: ""; position: absolute; left: -6px; top: 5px; bottom: 5px; width: 3px; border-radius: 2px; background: var(--accent-fill); }
.lmd-o-kids .lmd-o-row.lmd-active::before { left: -8px; }

.lmd-tree-head { display: flex; align-items: center; gap: 6px; padding: 2px 4px 8px; color: var(--fg-muted); }
.lmd-tree-up { width: 26px; height: 26px; border: 1px solid var(--line); border-radius: 6px; background: transparent; color: inherit; display: grid; place-items: center; cursor: pointer; }
.lmd-tree-up:hover { color: var(--fg); background: var(--bg-soft); }
.lmd-tree-up svg { width: 15px; height: 15px; }
.lmd-tree-path { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lmd-node {
  display: flex; align-items: flex-start; gap: 6px; width: 100%; padding: 4px 8px 4px 10px;
  border: 0; border-radius: 6px; background: transparent; color: var(--fg-muted);
  font: inherit; text-align: left; text-decoration: none; cursor: pointer;
}
.lmd-node:hover { background: var(--bg-soft); color: var(--fg); }
.lmd-node.lmd-active { color: var(--accent); background: var(--accent-soft); font-weight: 600; }
.lmd-node svg { width: 15px; height: 15px; margin-top: 2px; }
.lmd-node-chev svg { transition: transform 0.12s ease; }
.lmd-node.lmd-open .lmd-node-chev svg { transform: rotate(90deg); }
.lmd-node-name { overflow-wrap: anywhere; }
.lmd-node-dir { color: var(--fg); }
/* Arrastrar un archivo: el que se lleva se atenúa y el destino queda marcado. */
.lmd-node.lmd-dragging { opacity: 0.45; }
.lmd-node.lmd-drop, .lmd-xroot.lmd-drop { outline: 2px dashed var(--accent-fill); outline-offset: -2px; border-radius: 6px; background: var(--accent-soft); }

.lmd-update { flex: none; display: flex; align-items: center; gap: 10px; min-height: 30px; padding: 0 6px 0 12px; border-top: 1px solid var(--line); font-size: 12px; color: var(--fg-muted); white-space: nowrap; }
.lmd-update[hidden] { display: none; }
.lmd-update-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.lmd-update .lmd-link { flex: none; padding: 0; font-size: 12px; color: var(--accent); text-decoration: none; }
.lmd-update .lmd-link:hover { text-decoration: underline; }
.lmd-update-x { flex: none; display: grid; place-items: center; width: 24px; height: 24px; padding: 0; border: 0; border-radius: 6px; background: transparent; color: var(--fg-muted); cursor: pointer; }
.lmd-update-x:hover { background: var(--accent-soft); color: var(--fg); }
.lmd-update-x svg { width: 13px; height: 13px; }
.lmd-update-msg { margin: -4px 0 8px; padding: 8px 10px; border-radius: 7px; background: var(--bg-soft); color: var(--fg-muted); font-size: 13px; }
.lmd-update-msg[hidden] { display: none; }
.lmd-update-msg.lmd-ok { color: #16a34a; }
.lmd-update-msg.lmd-error { color: #dc2626; }
.lmd-update-msg.lmd-new { border: 1px solid var(--accent-fill); color: var(--fg); }
.lmd-update-msg a { color: var(--accent); }
.lmd-update-msg .lmd-link { padding: 0; color: var(--accent); font-size: inherit; }
.lmd-link { border: 0; background: none; padding: 5px 4px; color: var(--fg-faint); font: inherit; font-size: 12.5px; cursor: pointer; }
.lmd-link:hover { color: var(--fg); text-decoration: underline; }
.lmd-pane { padding-bottom: 12px; }
.lmd-resizer { position: absolute; top: 0; right: -3px; width: 6px; height: 100%; cursor: col-resize; }
.lmd-resizer:hover, .lmd-resizing .lmd-resizer { background: var(--accent-soft); }
.lmd-resizing { user-select: none; cursor: col-resize; }
.lmd-resizing .lmd-sidebar, .lmd-resizing .lmd-main { transition: none; }

/* ---------- Contenido ---------- */
.lmd-main { margin-left: var(--lmd-side-w); min-height: 100vh; transition: margin-left 0.18s ease; }
.lmd-side-hidden .lmd-main { margin-left: 0; }
.lmd-topbar {
  position: sticky; top: 0; z-index: 10; display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 14px; height: 49px;
  padding: 0 16px 0 12px; border-bottom: 1px solid var(--line); background: var(--bg); background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(8px);
}
.lmd-docname { flex: 1; min-width: 0; font-size: 13.5px; font-weight: 600; color: var(--fg-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lmd-dirty .lmd-docname::after { content: " •"; color: var(--accent); }
.lmd-docname-edit { cursor: text; }
.lmd-docname-input { width: min(100%, 340px); height: 28px; padding: 0 8px; border: 1px solid var(--accent-fill); border-radius: 6px; background: var(--bg); color: var(--fg); font: inherit; outline: none; }
.lmd-foot {
  position: fixed; left: var(--lmd-side-w); right: 0; bottom: 0; z-index: 12; display: flex; align-items: center; gap: 16px; height: 30px;
  padding: 0 16px; border-top: 1px solid var(--line); background: var(--bg-side); font-size: 12px; color: var(--fg-faint); transition: left 0.18s ease;
}
.lmd-side-hidden .lmd-foot { left: 0; }
.lmd-savestate { white-space: nowrap; }
.lmd-dirty .lmd-savestate { color: var(--accent); font-weight: 600; }
.lmd-status { flex: 1; min-width: 0; min-height: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lmd-status.lmd-flash { color: var(--accent); font-weight: 600; }
.lmd-status.lmd-error, .lmd-status.lmd-warn { flex: 0 1 auto; margin-right: auto; padding: 2px 10px; border-radius: 6px; font-weight: 600; }
.lmd-status.lmd-error { color: #fff; background: #dc2626; }
.lmd-status.lmd-warn { color: #1d2026; background: #f5b83d; }
.lmd-save { position: relative; }
.lmd-dirty .lmd-save { color: var(--accent); }
.lmd-dirty .lmd-save::after { content: ""; position: absolute; top: 5px; right: 5px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent-fill); }
.lmd-editing .lmd-editable { border-radius: 4px; outline: 1px dashed transparent; outline-offset: 3px; cursor: text; }
.lmd-editing .lmd-editable:hover { outline-color: var(--line); transition: outline-color 0.12s; }
.lmd-editing .lmd-editable:focus { outline: 2px solid var(--accent-fill); background: var(--accent-soft); }
.lmd-editing td.lmd-editable, .lmd-editing th.lmd-editable { outline-offset: -2px; border-radius: 0; }
.lmd-editing .lmd-li-text { display: inline-block; min-width: 2em; }
.lmd-editing .lmd-noedit { cursor: not-allowed; }
.lmd-editing .lmd-code { cursor: pointer; }
.lmd-src, .lmd-raw-edit { display: block; width: 100%; font-family: var(--lmd-mono); font-size: 0.86em; line-height: 1.5; color: var(--fg); background: var(--bg-code); border: 2px solid var(--accent-fill); border-radius: 9px; padding: 14px 16px; resize: vertical; }
.lmd-raw-edit { min-height: calc(100vh - 96px); border-width: 1px; border-color: var(--line); margin-bottom: 16px; }
.lmd-raw-edit:focus, .lmd-src:focus { outline: none; border-color: var(--accent-fill); }
.lmd-format, .lmd-tablebar { position: fixed; z-index: 40; display: flex; gap: 2px; padding: 4px; background: var(--bg-soft); border: 1px solid var(--line); border-radius: 9px; box-shadow: var(--shadow); }
.lmd-format button, .lmd-tablebar button { min-width: 30px; height: 30px; padding: 0 8px; border: 0; border-radius: 6px; background: transparent; color: var(--fg); font: inherit; font-size: 13.5px; cursor: pointer; display: grid; place-items: center; }
.lmd-format button:hover, .lmd-tablebar button:hover { background: var(--accent-soft); color: var(--accent); }
.lmd-format svg { width: 15px; height: 15px; }
.lmd-tablebar button { font-size: 12.5px; white-space: nowrap; }
.lmd-count { white-space: nowrap; font-variant-numeric: tabular-nums; }
.lmd-count.lmd-count-sel { color: var(--accent); font-weight: 600; }
.markdown-body a.lmd-wiki { text-decoration: none; border-bottom: 1px dashed currentColor; }
.markdown-body a.lmd-wiki-missing { color: var(--fg-faint); cursor: help; }
@media (max-width: 1100px) { .lmd-sep { margin: 0 2px; } }
@media (max-width: 900px) { .lmd-docname { display: none; } .lmd-topbar { gap: 6px; } }
.lmd-top-right { display: flex; align-items: center; justify-content: flex-end; gap: 4px; min-width: 0; }
.lmd-top-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.lmd-top-mid { display: flex; align-items: center; gap: 6px; }
.lmd-sep { width: 1px; height: 22px; margin: 0 6px; background: var(--line); flex: none; }
.lmd-modeseg { display: flex; padding: 3px; gap: 2px; background: var(--bg-soft); border: 1px solid var(--line); border-radius: 999px; }
.lmd-modeseg button { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 28px; padding: 0; border: 0; border-radius: 999px; background: transparent; color: var(--fg-muted); font: inherit; font-size: 13px; font-weight: 600; white-space: nowrap; cursor: pointer; }
.lmd-modeseg button:hover { color: var(--fg); }
.lmd-modeseg button.lmd-on { background: var(--accent-fill); color: var(--accent-fg); cursor: default; }
.lmd-modeseg svg { width: 16px; height: 16px; }
.lmd-view { display: flex; padding: 3px; gap: 2px; margin-right: 6px; background: var(--bg-soft); border: 1px solid var(--line); border-radius: 999px; }
.lmd-view button { width: 36px; height: 26px; border: 0; border-radius: 999px; background: transparent; color: var(--fg-muted); display: grid; place-items: center; cursor: pointer; }
.lmd-view button:hover { color: var(--fg); }
.lmd-view button.lmd-on { background: var(--accent-fill); color: var(--accent-fg); }
.lmd-view svg { width: 16px; height: 16px; }
.lmd-icon-btn.lmd-ok { color: var(--accent); }
.lmd-results-sum { margin: 2px 6px 10px; color: var(--fg-faint); font-size: 12.5px; }
.lmd-res { margin-bottom: 10px; }
.lmd-res-file { display: flex; align-items: flex-start; gap: 6px; padding: 4px 8px; border-radius: 6px; color: var(--fg); font-weight: 600; text-decoration: none; }
.lmd-res-file:hover { background: var(--bg-soft); }
.lmd-res-file svg { width: 15px; height: 15px; margin-top: 2px; }
.lmd-res-here .lmd-res-file { color: var(--accent); }
.lmd-res-name { flex: 1; overflow-wrap: anywhere; }
.lmd-res-count { flex: none; min-width: 20px; padding: 0 6px; border-radius: 10px; background: var(--bg-soft); color: var(--fg-muted); font-size: 11.5px; font-weight: 600; text-align: center; }
.lmd-res-hit { display: block; margin-left: 20px; padding: 3px 8px; border-radius: 6px; color: var(--fg-muted); font-size: 12.5px; text-decoration: none; overflow-wrap: anywhere; }
.lmd-res-hit:hover { background: var(--bg-soft); color: var(--fg); }
.lmd-res-hit mark { background: var(--hit); color: var(--fg); border-radius: 2px; }
.lmd-res-more { display: block; margin-left: 28px; color: var(--fg-faint); font-size: 12px; }

.lmd-article, .lmd-raw { padding: 30px 48px 140px; max-width: none; }
.lmd-centered .lmd-article, .lmd-centered .lmd-raw { max-width: calc(var(--lmd-content-w) + 96px); margin: 0 auto; }
.lmd-raw { font-family: var(--lmd-mono); font-size: 0.875em; white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 0; }

.markdown-body > :first-child { margin-top: 0; }
.markdown-body h1, .markdown-body h2, .markdown-body h3, .markdown-body h4, .markdown-body h5, .markdown-body h6 {
  margin: 1.6em 0 0.6em; line-height: 1.25; font-weight: 650; scroll-margin-top: 64px; position: relative;
}
.markdown-body h1 { font-size: 2em; }
.markdown-body h2 { font-size: 1.5em; padding-bottom: 0.3em; border-bottom: 1px solid var(--line); }
.markdown-body h3 { font-size: 1.25em; }
.markdown-body h4 { font-size: 1.05em; }
.markdown-body h5 { font-size: 0.95em; }
.markdown-body h6 { font-size: 0.9em; color: var(--fg-muted); }
/* Lo que la app pone dentro de un título y no es texto de la nota (el control de plegado, el dictado en curso). */
.lmd-anchor { margin-left: 0.4em; color: var(--fg-faint); text-decoration: none; opacity: 0; font-weight: 400; }
.markdown-body p, .markdown-body ul, .markdown-body ol, .markdown-body dl, .markdown-body blockquote,
.markdown-body .lmd-table, .markdown-body .lmd-code, .markdown-body .lmd-diagram { margin: 0 0 1em; }
.markdown-body a { color: var(--link); text-underline-offset: 2px; }
.markdown-body a:hover { text-decoration-thickness: 2px; }
.markdown-body strong { font-weight: 650; }
.markdown-body hr { border: 0; border-top: 1px solid var(--line); margin: 2em 0; }
.markdown-body img { max-width: 100%; height: auto; border-radius: 6px; }
.markdown-body img.lmd-zoomable { cursor: zoom-in; }
.markdown-body ul, .markdown-body ol { padding-left: 1.7em; }
.markdown-body li { margin: 0.25em 0; }
/* El estilo de cada nivel de una lista numerada, como en un procesador de textos: 1, a, i y de nuevo 1. En el
   archivo todas llevan números (Markdown no tiene otra marca). Las viñetas ya van con disco, círculo y cuadrado:
   es lo que hace el navegador por su cuenta. */
.markdown-body ol, .markdown-body ol ol ol ol { list-style-type: decimal; }
.markdown-body ol ol, .markdown-body ol ol ol ol ol { list-style-type: lower-alpha; }
.markdown-body ol ol ol, .markdown-body ol ol ol ol ol ol { list-style-type: lower-roman; }
.markdown-body li > p { margin-bottom: 0.5em; }
/* solo los ítems con casilla pierden la viñeta: una lista común pegada a una de tareas la conserva */
.markdown-body li.lmd-task-item { list-style: none; margin-left: -1.3em; }
.markdown-body .lmd-task { margin: 0 0.5em 0 0; transform: translateY(1px); accent-color: var(--accent); }
.markdown-body blockquote { margin-left: 0; padding: 0.2em 1em; border-left: 3px solid var(--line); color: var(--fg-muted); }
.markdown-body blockquote > :last-child { margin-bottom: 0; }
.markdown-body mark { background: var(--hit); color: inherit; padding: 0 0.15em; border-radius: 3px; }
.markdown-body kbd { font-family: var(--lmd-mono); font-size: 0.85em; padding: 0.15em 0.4em; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; background: var(--bg-soft); }
.markdown-body abbr[title] { text-decoration: underline dotted; cursor: help; }
.markdown-body dt { font-weight: 650; }
.markdown-body dd { margin: 0 0 0.6em 1.4em; }
.markdown-body .footnotes { color: var(--fg-muted); font-size: 0.9em; }
.markdown-body .footnotes-sep { margin-bottom: 1em; }

.markdown-body code { font-family: var(--lmd-mono); font-size: 0.875em; background: var(--bg-code); padding: 0.15em 0.4em; border-radius: 5px; }
.lmd-code { position: relative; }
.lmd-code pre { margin: 0; padding: 14px 16px; background: var(--bg-code); border: 1px solid var(--line); border-radius: 9px; overflow: auto; line-height: 1.5; }
.lmd-code pre code, .lmd-code pre code.hljs { background: transparent; padding: 0; font-size: 0.86em; white-space: pre; }
.lmd-wrap .lmd-code pre code, .lmd-wrap .lmd-code pre code.hljs { white-space: pre-wrap; overflow-wrap: anywhere; }
.lmd-code-lang { position: absolute; top: 6px; right: 44px; color: var(--fg-faint); font-size: 11.5px; font-family: var(--lmd-mono); opacity: 0; transition: opacity 0.15s; }
.lmd-code-copy {
  position: absolute; top: 6px; right: 6px; width: 30px; height: 30px; border: 1px solid var(--line); border-radius: 7px;
  background: var(--bg); color: var(--fg-muted); display: grid; place-items: center; cursor: pointer; opacity: 0; transition: opacity 0.15s;
}
.lmd-code:hover .lmd-code-copy, .lmd-code:hover .lmd-code-lang, .lmd-code-copy:focus-visible { opacity: 1; }
.lmd-code-copy:hover { color: var(--fg); }
.lmd-code-copy.lmd-ok { color: var(--accent); opacity: 1; }
.lmd-code-copy svg { width: 15px; height: 15px; }

.lmd-table { overflow-x: auto; }
.markdown-body table { border-collapse: collapse; width: max-content; max-width: 100%; }
.markdown-body th, .markdown-body td { padding: 8px 14px; border: 1px solid var(--line); vertical-align: top; }
.markdown-body th { font-weight: 650; background: var(--bg-soft); text-align: left; }
.markdown-body tr:nth-child(even) td { background: color-mix(in srgb, var(--bg-soft) 55%, transparent); }

.lmd-alert { border-left-width: 4px; border-radius: 0 8px 8px 0; padding: 0.7em 1em; color: var(--fg); background: var(--bg-soft); }
.lmd-alert-title { font-weight: 650; margin: 0 0 0.3em !important; }
.lmd-alert-note { border-left-color: #3b82f6; } .lmd-alert-note .lmd-alert-title { color: #3b82f6; }
.lmd-alert-tip { border-left-color: #22a35a; } .lmd-alert-tip .lmd-alert-title { color: #22a35a; }
.lmd-alert-important { border-left-color: #8b5cf6; } .lmd-alert-important .lmd-alert-title { color: #8b5cf6; }
.lmd-alert-warning { border-left-color: #d97706; } .lmd-alert-warning .lmd-alert-title { color: #d97706; }
.lmd-alert-caution { border-left-color: #dc2626; } .lmd-alert-caution .lmd-alert-title { color: #dc2626; }
/* Los títulos de los avisos, con contraste suficiente sobre el fondo de cada tema. */
.lmd-light .lmd-alert-note .lmd-alert-title { color: #1d64d8; } .lmd-light .lmd-alert-tip .lmd-alert-title { color: #167a41; }
.lmd-light .lmd-alert-important .lmd-alert-title { color: #6d3fe0; } .lmd-light .lmd-alert-warning .lmd-alert-title { color: #a35903; } .lmd-light .lmd-alert-caution .lmd-alert-title { color: #c81e1e; }
.lmd-dark .lmd-alert-important .lmd-alert-title { color: #a585f8; } .lmd-dark .lmd-alert-caution .lmd-alert-title { color: #f06060; }

.lmd-box { margin: 0 0 1em; padding: 0.7em 1em; border: 1px solid var(--line); border-left: 4px solid var(--fg-faint); border-radius: 0 8px 8px 0; background: var(--bg-soft); }
.lmd-box > :last-child { margin-bottom: 0; }
.lmd-box-title { font-weight: 650; margin: 0 0 0.3em !important; }
.lmd-box summary { font-weight: 650; cursor: pointer; }
.lmd-box-tip { border-left-color: #22a35a; } .lmd-box-tip .lmd-box-title { color: #22a35a; }
.lmd-box-info, .lmd-box-note { border-left-color: #3b82f6; } .lmd-box-info .lmd-box-title, .lmd-box-note .lmd-box-title { color: #3b82f6; }
.lmd-box-warning { border-left-color: #d97706; } .lmd-box-warning .lmd-box-title { color: #d97706; }
.lmd-box-danger { border-left-color: #dc2626; } .lmd-box-danger .lmd-box-title { color: #dc2626; }
/* Secciones desplegables (fold.js): el título se escribe en el lugar, y una vacía ofrece dónde empezar. */
details.lmd-box > summary { border-radius: 4px; }
details.lmd-box > summary:focus-visible { outline: 2px solid var(--accent-fill); outline-offset: 3px; }
details.lmd-box[open] > summary { margin-bottom: 0.5em; }
details.lmd-box[open] > summary:last-child { margin-bottom: 0; }
.lmd-editing .lmd-sum-title { display: inline-block; min-width: 4em; vertical-align: top; }
.lmd-editing .lmd-sum-title:empty::before { content: attr(data-ph); color: var(--fg-faint); pointer-events: none; }
.lmd-box-empty { min-height: 1.65em; margin: 0; border-radius: 4px; color: var(--fg-faint); cursor: text; }
.lmd-box-empty::before { content: attr(data-label); }
.lmd-box-empty:focus-visible { outline: 2px solid var(--accent-fill); outline-offset: 3px; }
.lmd-draft + .lmd-box-empty { display: none; }
/* Al imprimir, una sección cerrada muestra igual lo que tiene adentro. */
@media print { .lmd-box-empty { display: none !important; } details.lmd-box::details-content { display: block; content-visibility: visible; } }
/* Plegado por títulos (fold.js): un chevron en el margen, a la izquierda del título, donde no corre el texto.
   Tenue siempre, pleno al pasar por el título, con el foco o si la sección está plegada. */
.lmd-foldable .lmd-article > :is(h1, h2, h3, h4, h5, h6) { position: relative; }
.lmd-fold-tog { position: absolute; left: -25px; top: calc(0.625em - 11px); width: 22px; height: 22px; margin: 0; display: grid; place-items: center; border-radius: 6px; opacity: 0.45; cursor: pointer; user-select: none; -webkit-user-select: none; transition: opacity 0.12s ease; }
.lmd-fold-tog[hidden] { display: none; }
.lmd-article .lmd-fold-tog { color: var(--fg-muted); }
.lmd-fold-tog svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transform: rotate(90deg); transition: transform 0.12s ease; }
.lmd-fold-shut > .lmd-fold-tog svg { transform: none; }
.lmd-article .lmd-fold-tog:hover { background: var(--bg-soft); color: var(--fg); }
.lmd-fold-tog:focus-visible { opacity: 1; outline: 2px solid var(--accent-fill); outline-offset: 1px; }
.lmd-fold-shut > .lmd-fold-tog, .lmd-article > :is(h1, h2, h3, h4, h5, h6):is(:hover, :focus) > .lmd-fold-tog { opacity: 1; }
/* Editando con mouse, ese lugar es de la manija del bloque: el chevron va un paso más a la izquierda. */
@media (hover: hover) and (min-width: 821px) { .lmd-editing .lmd-fold-tog { left: -53px; width: 18px; } }
/* Con el dedo o en una ventana angosta no hay margen: va a la derecha del título, siempre a la vista. */
@media (hover: none), (max-width: 820px) {
  .lmd-foldable .lmd-article > :is(h1, h2, h3, h4, h5, h6) { padding-right: 34px; }
  .lmd-fold-tog { left: auto; right: 0; width: 26px; height: 26px; top: calc(0.625em - 13px); }
}
@media (hover: none) { .lmd-fold-tog { width: 32px; height: 32px; top: calc(0.625em - 16px); opacity: 0.8; } }
@media not print {
  .lmd-article > .lmd-fold-away { display: none !important; }
  .lmd-article > .lmd-fold-shut::after { content: "\2026\00a0" attr(data-fold-n); margin-left: 0.7em; padding: 1px 8px; border: 1px solid var(--line); border-radius: 999px; background: var(--bg-soft); color: var(--fg-muted); font-size: 12px; font-weight: 500; letter-spacing: 0; vertical-align: middle; white-space: nowrap; }
}
@media print { .lmd-foldable .lmd-article > :is(h1, h2, h3, h4, h5, h6) { padding-right: 0; } }
.lmd-front { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; margin: 0 0 1.5em; padding: 12px 16px; border: 1px solid var(--line); border-radius: 9px; background: var(--bg-soft); font-size: 0.9em; }
.lmd-front dt { color: var(--fg-muted); font-weight: 600; font-family: var(--lmd-mono); font-size: 0.92em; }
.lmd-front dd { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.lmd-diagram-dot svg text { fill: var(--fg); }
.lmd-dark .lmd-diagram-dot svg :is(path, ellipse, polygon)[stroke="black"] { stroke: var(--fg-muted); }
.lmd-dark .lmd-diagram-dot svg polygon[fill="black"] { fill: var(--fg-muted); }
.lmd-dark .lmd-diagram-dot svg polygon[fill="white"] { fill: transparent; }
pre.lmd-graphviz { font-family: var(--lmd-mono); font-size: 0.86em; padding: 14px 16px; background: var(--bg-code); border: 1px solid var(--line); border-radius: 9px; overflow: auto; }
.lmd-toc { display: flex; flex-direction: column; gap: 2px; padding: 12px 16px; margin: 0 0 1em; border: 1px solid var(--line); border-radius: 9px; background: var(--bg-soft); }
.lmd-toc a { text-decoration: none; }
.lmd-toc a:hover { text-decoration: underline; }
.lmd-toc-l2 { padding-left: 14px; } .lmd-toc-l3 { padding-left: 28px; } .lmd-toc-l4 { padding-left: 42px; }
.lmd-toc-l5 { padding-left: 56px; } .lmd-toc-l6 { padding-left: 70px; }

.lmd-math-block { display: block; overflow-x: auto; margin: 0 0 1em; text-align: center; }
.lmd-diagram { text-align: center; overflow-x: auto; }
.lmd-diagram svg { width: auto; height: auto; max-width: 100%; stroke: initial; fill: initial; stroke-width: initial; }
pre.lmd-mermaid { font-family: var(--lmd-mono); font-size: 0.86em; padding: 14px 16px; background: var(--bg-code); border: 1px solid var(--line); border-radius: 9px; overflow: auto; }
pre.lmd-mermaid-error { border-color: #dc2626; }

::highlight(lmd-hit) { background-color: var(--hit); color: inherit; }
::highlight(lmd-hit-current) { background-color: var(--hit-current); color: #fff; }

/* ---------- Flotantes ---------- */
.lmd-to-top {
  position: fixed; right: 22px; bottom: 48px; width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 50%;
  background: var(--bg-soft); color: var(--fg-muted); display: grid; place-items: center; cursor: pointer; z-index: 15; box-shadow: var(--shadow);
}
.lmd-to-top:hover { color: var(--fg); }
.lmd-viewer { position: fixed; inset: 0; z-index: 60; background: rgba(0, 0, 0, 0.86); display: grid; place-items: center; cursor: zoom-out; padding: 24px; }
.lmd-viewer img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 6px; }

.lmd-panel { position: fixed; inset: 0; z-index: 50; background: rgba(0, 0, 0, 0.5); display: grid; place-items: center; padding: 20px; }
.lmd-panel[hidden] { display: none; }
.lmd-panel-card { width: min(900px, 100%); height: min(680px, 100%); background: var(--bg); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; display: grid; grid-template-columns: 210px minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); box-shadow: var(--shadow); font-size: 14px; line-height: 1.45; }
.lmd-panel-card header { grid-column: 1 / -1; }
.lmd-panel-card header { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.lmd-panel-card h2 { margin: 0; font-size: 17px; }
.lmd-panel-body { overflow: auto; padding: 6px 26px 28px; }
.lmd-panel-body section { padding: 14px 0; border-bottom: 1px solid var(--line); }
.lmd-panel-body section:last-child { border-bottom: 0; }
.lmd-panel-body h3 { margin: 0 0 10px; font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--fg-faint); }
.lmd-row { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.lmd-row > span { display: flex; justify-content: space-between; color: var(--fg-muted); }
.lmd-row output { color: var(--fg); font-variant-numeric: tabular-nums; }
.lmd-row select, .lmd-row input[type=text], .lmd-panel textarea {
  width: 100%; padding: 7px 9px; border: 1px solid var(--line); border-radius: 7px; background: var(--bg-soft); color: var(--fg); font: inherit;
}
.lmd-row input[type=range] { width: 100%; accent-color: var(--accent-fill); }
.lmd-seg { display: flex; padding: 3px; gap: 3px; background: var(--bg-soft); border: 1px solid var(--line); border-radius: 999px; }
.lmd-seg button { flex: 1; height: 30px; border: 0; border-radius: 999px; background: transparent; color: var(--fg-muted); font: inherit; cursor: pointer; }
.lmd-seg button:hover { color: var(--fg); }
.lmd-seg button.lmd-on { background: var(--accent-fill); color: var(--accent-fg); font-weight: 600; }
.lmd-swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.lmd-tag { margin-left: 6px; padding: 1px 7px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); font-size: 10.5px; font-style: normal; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; vertical-align: 1px; }
.lmd-row > span:has(.lmd-tag) { justify-content: flex-start; }
.lmd-panel input:disabled, .lmd-panel textarea:disabled { opacity: 0.45; cursor: not-allowed; }
.lmd-swatches.lmd-locked { opacity: 0.38; pointer-events: none; filter: grayscale(0.6); }
.lmd-extra { margin-top: 10px; padding: 12px 14px; border: 1px dashed var(--line); border-radius: 10px; background: var(--bg-soft); }
.lmd-extra p { margin: 0 0 10px; color: var(--fg-muted); font-size: 13px; }
.lmd-extra-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.lmd-extra-actions .lmd-btn { text-decoration: none; display: inline-flex; align-items: center; }
.lmd-swatch { width: 28px; height: 28px; padding: 0; border: 2px solid transparent; border-radius: 50%; background: var(--sw, transparent); cursor: pointer; position: relative; outline: 1px solid var(--line); outline-offset: -1px; }
.lmd-swatch.lmd-on { border-color: var(--bg); outline: 2px solid var(--fg); outline-offset: 0; }
.lmd-swatch-auto { background: linear-gradient(135deg, #bef264 50%, #3f6a0a 50%); }
.lmd-swatch-custom { background: conic-gradient(#ef4444, #eab308, #22c55e, #06b6d4, #6366f1, #ec4899, #ef4444); overflow: hidden; }
.lmd-swatch-custom input { position: absolute; inset: -6px; width: 44px; height: 44px; opacity: 0; cursor: pointer; }
.lmd-check { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 8px; cursor: pointer; }
.lmd-check input { margin-top: 3px; accent-color: var(--accent-fill); }
.lmd-grid { display: grid; grid-template-columns: 1fr 1fr; column-gap: 12px; }
.lmd-panel textarea { min-height: 150px; font-family: var(--lmd-mono); font-size: 12.5px; resize: vertical; }
.lmd-hint { color: var(--fg-faint); font-size: 12.5px; margin: 6px 0 0; }
.lmd-btn { padding: 7px 12px; border: 1px solid var(--line); border-radius: 7px; background: var(--bg-soft); color: var(--fg); font: inherit; cursor: pointer; }
.lmd-btn:hover { border-color: var(--fg-faint); }
.lmd-btn-fill { background: var(--accent-fill); border-color: var(--accent-fill); color: var(--accent-fg); font-weight: 600; }
.lmd-orphan { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 80; display: flex; align-items: center; gap: 14px; max-width: min(720px, calc(100vw - 32px)); padding: 12px 14px 12px 18px; border: 1px solid var(--accent-fill); border-radius: 12px; background: var(--bg); color: var(--fg); box-shadow: var(--shadow); font-size: 13.5px; line-height: 1.4; }
.lmd-orphan button { flex: none; height: 34px; padding: 0 14px; border: 0; border-radius: 8px; background: var(--accent-fill); color: var(--accent-fg); font: inherit; font-weight: 600; cursor: pointer; }
/* El aviso de versión nueva de la web: el mismo cartel, con una cruz para dejarlo para después. */
.lmd-fresh, .lmd-room { gap: 10px; padding-right: 10px; }
.lmd-fresh ~ .lmd-room, .lmd-room ~ .lmd-fresh { bottom: 84px; }
.lmd-fresh button:disabled { opacity: .6; cursor: default; }
.lmd-fresh .lmd-update-x, .lmd-room .lmd-update-x { width: 30px; height: 30px; padding: 0; background: transparent; color: var(--fg-muted); }
.lmd-fresh .lmd-update-x:hover, .lmd-room .lmd-update-x:hover { background: var(--accent-soft); color: var(--fg); }
.lmd-fresh .lmd-update-x svg, .lmd-room .lmd-update-x svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.lmd-ask { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 20px; background: rgba(0, 0, 0, 0.5); }
.lmd-ask-card { width: min(480px, 100%); padding: 22px 24px; background: var(--bg); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); font-size: 14.5px; line-height: 1.5; }
.lmd-ask-card h3 { margin: 0 0 8px; font-size: 17px; }
.lmd-ask-card p { margin: 0 0 18px; color: var(--fg-muted); }
.lmd-ask-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.lmd-body :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Pantallas chicas e impresión ---------- */
@media (max-width: 820px) {
  .lmd-main { margin-left: 0; }
  .lmd-sidebar { box-shadow: var(--shadow); width: min(var(--lmd-side-w), 86vw); }
  .lmd-article, .lmd-raw { padding: 20px 18px 110px; }
  .lmd-foot { left: 0; }
  .lmd-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .lmd-sidebar, .lmd-main, .lmd-node-chev svg { transition: none; }
}
@media print {
  .lmd-sidebar, .lmd-topbar, .lmd-foot, .lmd-to-top, .lmd-panel, .lmd-viewer, .lmd-format, .lmd-tablebar, .lmd-ask, .lmd-orphan, .lmd-code-copy, .lmd-code-lang, .lmd-anchor { display: none !important; }
  .lmd-main { margin: 0 !important; }
  .lmd-article { padding: 0 !important; max-width: none !important; }
  .lmd-root, .lmd-body { background: #fff !important; }
  .lmd-code pre { white-space: pre-wrap; }
  .lmd-code pre code { white-space: pre-wrap !important; }
}

/* ---------- Pantalla de inicio de la app ---------- */
.lmd-tree-path { flex: 1; min-width: 0; }
.lmd-tree-open { flex: none; }
.lmd-home * { box-sizing: border-box; }
/* El inicio: el logo, una línea y las acciones, al centro de lo que queda al lado de la barra lateral. Arriba y
   abajo quedan dos franjas iguales, y en la de abajo van los enlaces del pie: así el bloque no se corre del centro. */
.lmd-home { min-height: calc(100vh - 49px); display: grid; grid-template-rows: minmax(0, 1fr) auto minmax(0, 1fr); justify-items: center; padding: 28px 20px 22px; background: var(--bg); color: var(--fg); font: 15px/1.5 var(--lmd-font); box-sizing: border-box; }
.lmd-home-card { grid-row: 2; width: min(508px, 100%); padding: 26px 26px 22px; border: 1px dashed transparent; border-radius: 18px; text-align: center; transition: border-color .15s, background-color .15s; }
.lmd-home.lmd-drop .lmd-home-card { background: var(--accent-soft); }
.lmd-home-logo { display: block; width: 72px; height: 72px; margin: 0 auto; border-radius: 16px; }
.lmd-home-sub { margin: 18px 0 24px; color: var(--fg); font-size: 17px; line-height: 1.4; letter-spacing: -0.01em; text-wrap: balance; }
.lmd-home-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.lmd-home-actions .lmd-btn { flex: 1 1 auto; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-width: 0; padding: 9px 12px; border-radius: 10px; background: transparent; color: var(--fg-muted); font-size: 13.5px; white-space: nowrap; transition: border-color .12s, color .12s, background-color .12s; }
.lmd-home-actions .lmd-btn:hover { color: var(--fg); background: var(--bg-soft); }
.lmd-home-actions .lmd-btn-fill, .lmd-home-actions .lmd-btn-fill:hover { flex: 1 0 100%; padding: 13px 16px; border-radius: 12px; background: var(--accent-fill); color: var(--accent-fg); font-size: 15.5px; }
.lmd-home-actions .lmd-btn-fill:hover { filter: brightness(1.06); }
.lmd-home-actions .lmd-btn:active { transform: translateY(1px); }
.lmd-home-more { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); display: grid; gap: 5px; color: var(--fg-faint); font-size: 12.5px; line-height: 1.5; }
.lmd-home-more:empty { display: none; }
.lmd-home-hint, .lmd-home-notes { margin: 0; }
.lmd-home-notes b { color: var(--fg-muted); font-weight: 600; }
.lmd-home-notes .lmd-link { color: var(--accent); font-size: 12.5px; padding: 0; }
.lmd-home-foot { grid-row: 3; align-self: end; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 22px; }
@media (prefers-reduced-motion: reduce) { .lmd-home-actions .lmd-btn, .lmd-home-card { transition: none; } .lmd-home-actions .lmd-btn:active { transform: none; } }

/* La cuenta, fija al pie de la barra lateral: quién entró y su plan, con las acciones en un menú; sin sesión, la
   invitación a entrar. Conserva los nombres de cuando vivía en la tarjeta del inicio (lmd-home-cloud, lmd-home-acct). */
.lmd-side-acct { flex: none; position: relative; padding: 6px; border-top: 1px solid var(--line); font-size: 13px; color: var(--fg-muted); }
.lmd-side-acct[hidden] { display: none; }
.lmd-side-acct * { box-sizing: border-box; }
.lmd-home-acct { display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 6px 7px 8px; border: 0; border-radius: 9px; background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.lmd-home-acct:hover, .lmd-home-acct[aria-expanded=true] { background: var(--accent-soft); }
.lmd-home-acct:focus-visible { outline: 2px solid var(--accent-fill); outline-offset: -2px; }
.lmd-home-acct-ico { flex: none; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: var(--accent-soft); color: var(--accent); }
.lmd-home-acct-ask .lmd-home-acct-ico { background: transparent; border: 1px dashed var(--fg-faint); color: var(--fg-muted); }
.lmd-side-acct svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.lmd-home-acct-who { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.lmd-home-acct-who b { color: var(--fg); font-size: 13px; font-weight: 600; line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lmd-home-acct-who small { font-size: 11.5px; line-height: 1.35; color: var(--fg-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lmd-home-acct-ask .lmd-home-acct-who small { white-space: normal; }
.lmd-home-acct-more { flex: none; display: grid; place-items: center; width: 22px; height: 22px; color: var(--fg-faint); }
.lmd-home-acct-more svg circle { fill: currentColor; stroke: none; }
.lmd-home-acct:hover .lmd-home-acct-more, .lmd-home-acct[aria-expanded=true] .lmd-home-acct-more { color: var(--fg); }
/* Cuánto del plan gratis está usado: una línea fina sobre el borde del pie. */
.lmd-acct-meter { position: absolute; left: 0; top: -1px; height: 2px; max-width: 100%; border-radius: 0 2px 2px 0; background: var(--accent-fill); opacity: .75; }
.lmd-side-acct .lmd-menu { position: absolute; left: 6px; right: 6px; bottom: calc(100% + 6px); width: auto; }
.lmd-side-acct .lmd-signin { padding: 8px 6px 6px; }
.lmd-side-acct .lmd-signin p { margin: 0 0 8px; overflow-wrap: anywhere; }
.lmd-side-acct .lmd-home-cloud-row { flex-direction: column; align-items: stretch; gap: 6px; }
.lmd-side-acct .lmd-home-cloud-row .lmd-btn { border-radius: 8px; padding: 7px 12px; }
.lmd-side-acct input { flex: none; width: 100%; height: 34px; padding: 0 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--fg); font: inherit; outline: none; }
.lmd-side-acct input:focus, .lmd-body .lmd-side-acct input:focus-visible { border-color: var(--accent-fill); outline: none; }
.lmd-side-acct .lmd-home-cloud-err { margin: 6px 4px 2px; font-size: 12.5px; line-height: 1.4; }
.lmd-side-acct .lmd-signin .lmd-home-cloud-err { margin: 6px 0 0; }
.lmd-side-acct .lmd-signin-back { margin: 6px 0 0; text-align: left; }
.lmd-home.lmd-drop .lmd-home-card { border-color: var(--accent-fill); border-style: dashed; }
.lmd-home h1 { margin: 14px 0 6px; font-size: 24px; border: 0; padding: 0; overflow-wrap: anywhere; }
.lmd-home svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.lmd-home-msg { margin: 14px 0 0; padding: 9px 12px; border-radius: 8px; border: 1px solid #dc2626; color: #dc2626; font-size: 13.5px; }
.lmd-home-msg[hidden] { display: none; }
.lmd-home-coffee { display: inline-flex; align-items: center; gap: 8px; color: var(--fg-muted); font-size: 13.5px; text-decoration: none; }
.lmd-home-coffee:hover { color: var(--accent); }

/* ---------- Escribir contenido nuevo ---------- */
.lmd-insert { display: none; }
.lmd-editing .lmd-insert { display: grid; }
.lmd-editing .lmd-draft { min-height: 1.6em; outline: 1px dashed var(--line); outline-offset: 3px; border-radius: 4px; }
.lmd-editing .lmd-draft:empty::before, .lmd-editing .lmd-li-text[data-ph]:empty::before { content: attr(data-ph); color: var(--fg-faint); pointer-events: none; }
.lmd-editing .lmd-li-text[data-ph]:empty { display: inline-block; min-width: 9em; }
.lmd-editing p.lmd-draft-h1 { font-size: 2em; font-weight: 700; }
.lmd-editing p.lmd-draft-h2 { font-size: 1.5em; font-weight: 700; }
.lmd-editing p.lmd-draft-h3 { font-size: 1.25em; font-weight: 700; }
.lmd-editing p.lmd-draft-h4 { font-size: 1.05em; font-weight: 700; }
.lmd-editing p.lmd-draft-ul, .lmd-editing p.lmd-draft-ol, .lmd-editing p.lmd-draft-task { display: list-item; margin-left: 1.6em; }
.lmd-editing p.lmd-draft-ol { list-style: decimal; }
.lmd-editing p.lmd-draft-task { list-style: square; }
.lmd-editing p.lmd-draft-quote { padding-left: 1em; border-left: 3px solid var(--line); color: var(--fg-muted); }
.lmd-editing .lmd-pending { opacity: 0.75; }
.lmd-add { margin: 22px 0 60px; padding: 10px 12px; border: 1px dashed var(--line); border-radius: 8px; color: var(--fg-faint); font-size: 14px; cursor: text; }
.lmd-add::before { content: '+  ' attr(data-label); }
.lmd-add:hover { border-color: var(--accent-fill); color: var(--accent); }
.lmd-menu { position: fixed; z-index: 60; width: 300px; padding: 8px; background: var(--bg-soft); border: 1px solid var(--line); border-radius: 11px; box-shadow: var(--shadow); font: 13.5px/1.3 var(--lmd-font); color: var(--fg); }
.lmd-menu-label { margin: 6px 6px 4px; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--fg-faint); }
.lmd-menu-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; }
.lmd-menu button { padding: 7px 9px; border: 0; border-radius: 6px; background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.lmd-menu button:hover { background: var(--accent-soft); color: var(--accent); }
.lmd-menu button.lmd-menu-danger:hover { background: color-mix(in srgb, #dc2626 16%, transparent); color: #dc2626; }
@media print { .lmd-add, .lmd-menu, .lmd-draft:empty { display: none !important; } }

/* ---------- Diagramas ---------- */
.lmd-diagram { position: relative; }
.lmd-editing .lmd-diagram, .lmd-editing pre.lmd-mermaid, .lmd-editing pre.lmd-graphviz { cursor: pointer; border-radius: 8px; outline: 1px dashed transparent; outline-offset: 3px; }
.lmd-editing .lmd-diagram:hover, .lmd-editing pre.lmd-mermaid:hover, .lmd-editing pre.lmd-graphviz:hover { outline-color: var(--accent-fill); }
.lmd-dgm-tools { position: absolute; top: 4px; right: 4px; display: flex; gap: 2px; padding: 3px; background: var(--bg-soft); border: 1px solid var(--line); border-radius: 8px; opacity: 0; transition: opacity .12s; }
.lmd-diagram:hover .lmd-dgm-tools { opacity: 1; }
.lmd-dgm-tools button { width: 28px; height: 28px; border: 0; border-radius: 6px; background: transparent; color: var(--fg-muted); display: grid; place-items: center; cursor: pointer; }
.lmd-dgm-tools button:hover { background: var(--accent-soft); color: var(--accent); }
.lmd-dgm-tools svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.lmd-viewer-svg { max-width: 94vw; max-height: 92vh; overflow: auto; padding: 24px; background: var(--bg); border-radius: 12px; }
.lmd-viewer-svg svg { width: min(88vw, 1400px); height: auto; max-height: 84vh; }
.lmd-dgm { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 20px; background: rgba(0, 0, 0, 0.5); font: 14px/1.45 var(--lmd-font); color: var(--fg); }
.lmd-dgm-card { width: min(1180px, 100%); height: min(720px, 100%); display: flex; flex-direction: column; background: var(--bg); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; }
.lmd-dgm-card header { padding: 14px 18px 10px; border-bottom: 1px solid var(--line); }
.lmd-dgm-card h3 { margin: 0 0 8px; padding: 0; border: 0; font-size: 16px; }
.lmd-dgm-card h3 small { margin-left: 6px; font-weight: 500; font-size: 12px; color: var(--fg-faint); }
.lmd-dgm-tpl { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.lmd-dgm-tpl span { margin-right: 4px; font-size: 12px; color: var(--fg-faint); }
.lmd-dgm-tpl button { padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--bg-soft); color: var(--fg-muted); font: inherit; font-size: 12.5px; cursor: pointer; }
.lmd-dgm-tpl button:hover { border-color: var(--accent-fill); color: var(--accent); }
.lmd-dgm-body { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); }
.lmd-dgm-body textarea { resize: none; border: 0; border-right: 1px solid var(--line); padding: 14px 16px; background: var(--bg-code); color: var(--fg); font: 13.5px/1.55 var(--lmd-mono); outline: none; tab-size: 2; }
.lmd-dgm-view { min-width: 0; display: flex; flex-direction: column; overflow: auto; }
.lmd-dgm-svg { flex: 1; display: grid; place-items: center; padding: 18px; transition: opacity .12s; }
.lmd-dgm-svg.lmd-dgm-stale { opacity: 0.35; }
.lmd-dgm-err { margin: 0; padding: 10px 16px; border-top: 1px solid #dc2626; color: #dc2626; font: 12.5px/1.45 var(--lmd-mono); white-space: pre-wrap; }
.lmd-dgm-card footer { display: flex; align-items: center; gap: 8px; padding: 10px 18px; border-top: 1px solid var(--line); }
.lmd-dgm-card footer span { flex: 1; }
.lmd-dgm-card footer a { color: var(--accent); font-size: 13px; }
.lmd-dgm-card kbd { margin-left: 6px; font: 11px var(--lmd-mono); opacity: 0.75; }
@media (max-width: 760px) { .lmd-dgm-body { grid-template-columns: 1fr; grid-template-rows: 1fr 1fr; } .lmd-dgm-body textarea { border-right: 0; border-bottom: 1px solid var(--line); } }
@media print { .lmd-dgm-tools, .lmd-dgm { display: none !important; } }

/* ---------- Reemplazar, árbol, foco ---------- */
.lmd-replace { display: none; gap: 5px; margin: -2px 10px 8px; }
.lmd-editing.lmd-searching:not(.lmd-nodoc) .lmd-replace { display: flex; }
.lmd-replace input { flex: 1; min-width: 0; height: 30px; padding: 0 10px; border: 1px solid var(--line); border-radius: 7px; background: var(--bg); color: var(--fg); font: inherit; font-size: 13px; outline: none; }
.lmd-replace input:focus { border-color: var(--accent-fill); }
.lmd-replace button { height: 30px; padding: 0 9px; border: 1px solid var(--line); border-radius: 7px; background: var(--bg-soft); color: var(--fg-muted); font: inherit; font-size: 12.5px; cursor: pointer; }
.lmd-replace button:hover { border-color: var(--accent-fill); color: var(--accent); }
.lmd-menu-narrow { width: 200px; }
.lmd-menu-list { display: grid; gap: 2px; }
.lmd-tree-new svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.lmd-editing.lmd-focus .lmd-article:focus-within > *:not(:focus-within) { opacity: 0.3; transition: opacity .18s; }
.lmd-editing.lmd-focus .lmd-article:focus-within > *:not(:focus-within):hover { opacity: 0.75; }
.lmd-editing.lmd-typewriter .lmd-article { padding-bottom: 50vh; }
@media print { .lmd-replace { display: none !important; } }

/* ---------- Ajustes de aire ---------- */
.lmd-search input { border-color: transparent !important; background: var(--bg-soft) !important; }
.lmd-search input:focus { border-color: var(--accent-fill) !important; outline: none; }
.lmd-editing .lmd-draft { padding: 4px 8px; margin: 0 -8px 1em; }
.lmd-editing .lmd-draft:focus { outline-offset: 0; }

/* ---------- Tipografía ---------- */
.lmd-root { -webkit-font-smoothing: antialiased; }
.markdown-body { letter-spacing: -0.006em; }
.markdown-body h1, .markdown-body h2, .markdown-body h3 { letter-spacing: -0.021em; font-weight: 680; }
.markdown-body h1 { font-size: 2.1em; }
.markdown-body strong { font-weight: 650; }
.markdown-body code, .markdown-body pre, .lmd-raw, .lmd-src { font-feature-settings: normal; letter-spacing: 0; }

/* ---------- Manija de bloque ---------- */
.lmd-handle { position: fixed; z-index: 30; width: 26px; height: 28px; padding: 0; border: 0; border-radius: 7px; background: transparent; color: var(--fg-faint); display: grid; place-items: center; cursor: pointer; }
.lmd-handle[hidden] { display: none; }
.lmd-handle:hover { background: var(--bg-soft); color: var(--fg); }
.lmd-handle svg { width: 17px; height: 17px; fill: currentColor; stroke: none; }
.lmd-dgm-del { display: none !important; }
.lmd-editing .lmd-dgm-del { display: grid !important; }
.lmd-dgm-del:hover, .lmd-dgm-remove:hover { color: #dc2626 !important; }
.lmd-dgm-remove:hover { border-color: #dc2626; }
@media print { .lmd-handle { display: none !important; } }

/* ---------- Tareas, tableros y cuentas ---------- */
.markdown-body .lmd-task { cursor: pointer; }
.markdown-body li.lmd-task-item:has(> input.lmd-task:checked), .markdown-body li.lmd-task-item:has(> p > input.lmd-task:checked) > p,
.markdown-body li.lmd-task-item:has(> input.lmd-task:checked) > .lmd-li-text { color: var(--fg-faint); text-decoration: line-through; }
/* la sublista de una tarea hecha no hereda el tachado */
.markdown-body li.lmd-task-item > ul, .markdown-body li.lmd-task-item > ol { display: inline-block; width: 100%; color: var(--fg); }
.markdown-body td.lmd-calc, .markdown-body th.lmd-calc { font-weight: 650; font-variant-numeric: tabular-nums; background: var(--bg-soft); }
.lmd-board { display: flex; align-items: flex-start; gap: 12px; margin: 0 0 1.2em; padding-bottom: 6px; overflow-x: auto; }
.lmd-col { flex: 0 0 250px; display: flex; flex-direction: column; gap: 8px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-soft); transition: border-color .12s; }
.lmd-col.lmd-drop-here { border-color: var(--accent-fill); }
.lmd-col-head { display: flex; align-items: center; gap: 7px; padding: 2px 4px; font-size: 0.88em; font-weight: 700; }
.lmd-col-title { min-width: 2em; border-radius: 4px; outline: none; }
.lmd-col-title[contenteditable="plaintext-only"], .lmd-card-text[contenteditable="plaintext-only"] { box-shadow: 0 0 0 2px var(--accent-fill); cursor: text; }
.lmd-col-n { margin-right: auto; padding: 0 7px; border-radius: 999px; background: var(--bg); color: var(--fg-faint); font-size: 0.85em; font-weight: 600; }
.lmd-cards { display: flex; flex-direction: column; gap: 6px; min-height: 26px; }
.lmd-card { display: flex; align-items: flex-start; gap: 8px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--bg); font-size: 0.92em; line-height: 1.4; cursor: grab; }
.lmd-card.lmd-dragging { opacity: 0.4; }
.lmd-card-check { margin: 3px 0 0; accent-color: var(--accent); cursor: pointer; flex: none; }
.lmd-card-text { flex: 1; min-width: 0; overflow-wrap: anywhere; border-radius: 4px; outline: none; }
.lmd-card-done .lmd-card-text { color: var(--fg-faint); text-decoration: line-through; }
.lmd-board-edit { display: none; }
.lmd-editing .lmd-board-edit { display: inline-grid; place-items: center; }
.lmd-card-del, .lmd-col-del { width: 20px; height: 20px; padding: 0; border: 0; border-radius: 5px; background: transparent; color: var(--fg-faint); cursor: pointer; flex: none; opacity: 0; }
.lmd-card:hover .lmd-card-del, .lmd-col-head:hover .lmd-col-del { opacity: 1; }
.lmd-card-del:hover, .lmd-col-del:hover { background: var(--bg-soft); color: #dc2626; }
.lmd-card-del svg, .lmd-col-del svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.lmd-card-add, .lmd-col-add { padding: 7px 10px; border: 1px dashed var(--line); border-radius: 9px; background: transparent; color: var(--fg-faint); font: inherit; font-size: 0.88em; cursor: pointer; }
.lmd-col-add { flex: 0 0 auto; align-self: flex-start; white-space: nowrap; }
.lmd-card-add:hover, .lmd-col-add:hover { border-color: var(--accent-fill); color: var(--accent); }
@media print { .lmd-board-edit { display: none !important; } .lmd-board { flex-wrap: wrap; overflow: visible; } }

/* ---------- Cuenta y nube ---------- */
.lmd-home-cloud[hidden] { display: none; }
.lmd-home-cloud-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.lmd-home-cloud-row .lmd-btn { padding: 6px 13px; font-size: 13px; border-radius: 999px; }
.lmd-home-cloud-err { color: #dc2626; }

/* ---------- Íconos del menú, imágenes, color del código, forma de los diagramas ---------- */
.lmd-menu button { display: flex; align-items: center; gap: 9px; }
.lmd-menu button svg { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; opacity: 0.8; }
.lmd-menu button svg circle { fill: currentColor; stroke: none; }
.lmd-menu button span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lmd-menu { width: 330px; }
.lmd-img-card .lmd-row input { width: 100%; }
.lmd-img-pick { display: flex; align-items: center; gap: 10px; margin: -2px 0 12px; color: var(--fg-muted); font-size: 13px; }
.lmd-img-pick .lmd-btn { display: inline-flex; align-items: center; gap: 8px; }
.lmd-img-pick svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.lmd-img-err { margin: 0 0 12px !important; color: #dc2626 !important; font-size: 13px; }
.lmd-ask-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.lmd-editing .lmd-editable img { cursor: pointer; border-radius: 6px; }
.lmd-editing .lmd-editable img:hover { outline: 2px solid var(--accent-fill); outline-offset: 2px; }
.lmd-imgbar .lmd-menu-danger:hover { color: #dc2626; }
.markdown-body img[width] { height: auto; }
.lmd-swatch[data-code-color]:not(.lmd-swatch-auto) { background: var(--sw); }
.lmd-code pre { background: var(--bg-code); background: color-mix(in srgb, var(--code-tint, transparent) 9%, var(--bg-code)); border-color: color-mix(in srgb, var(--code-tint, transparent) 40%, var(--line)); border-left: 3px solid color-mix(in srgb, var(--code-tint, var(--line)) 80%, var(--line)); }
.markdown-body :not(pre) > code { background: var(--bg-code); background: color-mix(in srgb, var(--code-tint, transparent) 13%, var(--bg-code)); }
.lmd-dgm-round .lmd-diagram svg .node rect, .lmd-dgm-round .lmd-dgm-svg svg .node rect { rx: 12px; ry: 12px; }

/* ---------- Pestañas de ajustes, sincronización, historial ---------- */
.lmd-ptabs { display: flex; flex-direction: column; gap: 3px; padding: 14px 10px; border-right: 1px solid var(--line); background: var(--bg-side); overflow: auto; }
.lmd-ptabs button { display: flex; align-items: center; gap: 10px; height: 38px; padding: 0 12px; border: 0; border-radius: 9px; background: transparent; color: var(--fg-muted); font: inherit; font-size: 13.5px; font-weight: 600; text-align: left; cursor: pointer; }
.lmd-ptabs button svg { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.lmd-ptabs button:hover { color: var(--fg); background: var(--bg-soft); }
.lmd-ptabs button.lmd-on { background: var(--accent-soft); color: var(--accent); }
.lmd-panel-body > section[hidden] { display: none; }
.lmd-sync { width: 28px; height: 28px; }
.lmd-sync svg { width: 17px; height: 17px; }
.lmd-sync-ok { color: var(--accent); }
.lmd-sync-off { color: var(--fg-faint); }
.lmd-sync-err { color: #dc2626; }
.lmd-sync-busy svg { animation: lmd-pulse 1s ease-in-out infinite; }
@keyframes lmd-pulse { 50% { opacity: 0.35; } }
.lmd-menu .lmd-locked { color: var(--fg-faint); text-decoration: line-through; }
.lmd-hist { width: min(820px, 100%); }
.lmd-hist-body { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 12px; height: min(420px, 60vh); margin-bottom: 16px; }
.lmd-hist-body ul { margin: 0; padding: 0; list-style: none; overflow: auto; }
.lmd-hist-body li button { display: flex; justify-content: space-between; gap: 8px; width: 100%; padding: 8px 10px; border: 0; border-radius: 7px; background: transparent; color: var(--fg); font: inherit; font-size: 13px; text-align: left; cursor: pointer; }
.lmd-hist-body li button:hover, .lmd-hist-body li button.lmd-on { background: var(--accent-soft); color: var(--accent); }
.lmd-hist-body small { color: var(--fg-faint); }
.lmd-hist-body pre { margin: 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 9px; background: var(--bg-code); font: 12.5px/1.5 var(--lmd-mono); white-space: pre-wrap; overflow: auto; }

/* ---------- Compartir y presencia ---------- */
.lmd-sync { position: relative; }
.lmd-sync-n { position: absolute; right: -4px; top: -3px; min-width: 15px; height: 15px; padding: 0 4px; border-radius: 999px; background: var(--accent-fill); color: var(--accent-fg); font: 700 10px/15px var(--lmd-font); text-align: center; }
.lmd-readonly .lmd-modeseg [data-act=mode-edit], .lmd-readonly .lmd-insert, .lmd-readonly .lmd-save { opacity: 0.35; }
.lmd-share { width: min(560px, 100%); }
.lmd-share h4 { margin: 16px 0 8px; font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--fg-faint); }
.lmd-share-row { display: flex; gap: 8px; margin-bottom: 8px; }
.lmd-share input[type=email], .lmd-share input[type=text], .lmd-share select { flex: 1; min-width: 0; height: 36px; padding: 0 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg-soft); color: var(--fg); font: inherit; font-size: 14px; outline: none; }
.lmd-share select { flex: 0 0 auto; }
.lmd-share input:focus { border-color: var(--accent-fill); }
.lmd-share ul { margin: 0 0 4px; padding: 0; list-style: none; }
.lmd-share li { display: flex; align-items: center; gap: 8px; padding: 5px 0; font-size: 13.5px; color: var(--fg-muted); }
.lmd-share li span, .lmd-share li input { flex: 1; min-width: 0; }
.lmd-share li button { border: 0; background: none; color: var(--fg-faint); font: inherit; font-size: 12.5px; cursor: pointer; }
.lmd-share li button:hover { color: #dc2626; }

/* ---------- Ajustes: muestras, interruptores, cuenta ---------- */
.lmd-prev-code { margin: -4px 0 14px; padding: 11px 14px; border: 1px solid color-mix(in srgb, var(--code-tint, transparent) 40%, var(--line)); border-left: 3px solid color-mix(in srgb, var(--code-tint, var(--line)) 80%, var(--line)); border-radius: 9px; background: color-mix(in srgb, var(--code-tint, transparent) 9%, var(--bg-code)); font: 12.5px/1.5 var(--lmd-mono); overflow: hidden; }
.lmd-prev-code .k { color: #d7417a; } .lmd-prev-code .f { color: #8250df; } .lmd-prev-code .n { color: #0a7ea4; }
.lmd-dark .lmd-prev-code .k { color: #ff7b72; } .lmd-dark .lmd-prev-code .f { color: #d2a8ff; } .lmd-dark .lmd-prev-code .n { color: #79c0ff; }
.lmd-prev-dgm { display: block; width: min(300px, 100%); height: auto; margin: -2px 0 6px; }
.lmd-prev-dgm .node { fill: var(--bg-soft); stroke: var(--fg-muted); stroke-width: 1.4; rx: 0; }
.lmd-dgm-round .lmd-prev-dgm .node { rx: 10px; }
.lmd-prev-dgm .curve, .lmd-prev-dgm .line { fill: none; stroke: var(--fg-muted); stroke-width: 1.4; }
.lmd-prev-dgm .curve { display: none; } .lmd-dgm-round .lmd-prev-dgm .curve { display: inline; } .lmd-dgm-round .lmd-prev-dgm .line { display: none; }
.lmd-prev-dgm .tip { fill: var(--fg-muted); } .lmd-prev-dgm text { fill: var(--fg); font: 600 13px var(--lmd-font); text-anchor: middle; }
.lmd-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 18px; }
.lmd-switch { position: relative; display: flex; align-items: center; gap: 10px; padding: 6px 0; cursor: pointer; }
.lmd-switch input { position: absolute; opacity: 0; pointer-events: none; }
.lmd-switch i { flex: none; width: 34px; height: 20px; border-radius: 999px; background: var(--line); position: relative; transition: background .15s; }
.lmd-switch i::after { content: ""; position: absolute; left: 2px; top: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--bg); box-shadow: 0 1px 2px rgba(0, 0, 0, .3); transition: transform .15s; }
.lmd-switch input:checked + i { background: var(--accent-fill); box-shadow: inset 0 0 0 1.5px var(--accent-edge, transparent); }
.lmd-switch input:checked + i::after { transform: translateX(14px); background: var(--accent-knob, var(--bg)); }
.lmd-switch input:focus-visible + i { outline: 2px solid var(--accent-fill); outline-offset: 2px; }
.lmd-switch[data-tip]:not([data-tip=""])::after { content: attr(data-tip); position: absolute; left: 0; bottom: calc(100% + 4px); z-index: 5; width: max-content; max-width: 280px; padding: 8px 11px; border: 1px solid var(--line); border-radius: 9px; background: var(--bg-soft); color: var(--fg); font-size: 12.5px; line-height: 1.4; box-shadow: var(--shadow); opacity: 0; transform: translateY(4px); pointer-events: none; transition: opacity .14s, transform .14s; }
.lmd-switch[data-tip]:hover::after { opacity: 1; transform: none; transition-delay: .25s; }
.lmd-acct-row { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line); color: var(--fg-muted); }
.lmd-acct-row b { color: var(--fg); font-weight: 600; }
.lmd-plans { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 16px 0; }
.lmd-plan { padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; }
.lmd-plan-on { border-color: var(--accent-fill); background: var(--accent-soft); }
.lmd-plan h4 { margin: 0 0 8px; font-size: 15px; } .lmd-plan h4 small { font-weight: 500; color: var(--fg-muted); }
.lmd-plan ul { margin: 0; padding-left: 1.1em; color: var(--fg-muted); font-size: 13px; line-height: 1.6; }
.lmd-plan-buy { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; } .lmd-plan-buy .lmd-btn { padding: 6px 11px; font-size: 12.5px; text-decoration: none; }
/* Plan de equipo: la tercera columna, y debajo la gestión (miembros, invitaciones, lugares). */
.lmd-plans-3 { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.lmd-team h4 { margin: 18px 0 6px; font-size: 14px; } .lmd-team h4 small { font-weight: 500; color: var(--fg-muted); overflow-wrap: anywhere; }
.lmd-team-list { max-height: 190px; }
.lmd-team-list li > span:first-child { min-width: 0; overflow-wrap: anywhere; }
.lmd-team-acts { display: flex; flex: none; gap: 12px; }
.lmd-team-invite { margin: 12px 0 4px; }
.lmd-team-invite input { flex: 1; min-width: 0; height: 36px; padding: 0 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg-soft); color: var(--fg); font: inherit; font-size: 14px; outline: none; }
.lmd-team-invite input:focus { border-color: var(--accent-fill); }
.lmd-team-seats { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 10px 0 4px; }
.lmd-team-seats [data-t=less], .lmd-team-seats [data-t=more] { flex: none; width: 36px; padding-left: 0; padding-right: 0; justify-content: center; }
.lmd-team-seats b { min-width: 2ch; text-align: center; }
.lmd-team-cost { flex: 1 1 150px; color: var(--fg-muted); font-size: 13px; }
.lmd-team .lmd-acct-actions a.lmd-btn { text-decoration: none; }
.lmd-acct .lmd-team-solo a { color: inherit; }
.lmd-btn:disabled { opacity: 0.55; cursor: default; }

.lmd-panel-body { display: flex; flex-direction: column; }

/* ---------- Ajustes: dos columnas, cada pestaña entra sin scroll ---------- */
.lmd-panel-card { width: min(1000px, 100%); height: min(740px, 100%); }
.lmd-panel-body { padding: 2px 28px 18px; scrollbar-width: thin; }
.lmd-panel-body section { padding: 16px 0; }
.lmd-row > span { font-size: 13px; }
.lmd-two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px 28px; align-items: start; }
.lmd-two > h3, .lmd-two > .lmd-hint, .lmd-two > .lmd-update-msg { grid-column: 1 / -1; margin: 0; }
.lmd-two .lmd-row, .lmd-two .lmd-check { margin-bottom: 0; }
.lmd-row-line { flex-direction: row; align-items: center; justify-content: space-between; gap: 12px; align-self: end; min-height: 38px; }
:is(.lmd-panel-body, .lmd-tl-side) .lmd-check { align-items: center; gap: 10px; min-height: 30px; align-self: center; }
:is(.lmd-panel-body, .lmd-tl-side) .lmd-check input { appearance: none; flex: none; position: relative; width: 34px; height: 20px; margin: 0; border-radius: 999px; background: var(--line); cursor: pointer; transition: background .15s; }
:is(.lmd-panel-body, .lmd-tl-side) .lmd-check input::after { content: ""; position: absolute; left: 2px; top: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--bg); box-shadow: 0 1px 2px rgba(0, 0, 0, .3); transition: transform .15s; }
:is(.lmd-panel-body, .lmd-tl-side) .lmd-check input:checked { background: var(--accent-fill); }
:is(.lmd-panel-body, .lmd-tl-side) .lmd-check input:checked::after { transform: translateX(14px); }
:is(.lmd-panel-body, .lmd-tl-side) .lmd-check input:focus-visible { outline: 2px solid var(--accent-fill); outline-offset: 2px; }
.lmd-grid { gap: 0 28px; }
.lmd-grid .lmd-switch { padding: 5px 0; font-size: 13.5px; }
.lmd-panel textarea { min-height: 92px; }
.lmd-plans { margin: 12px 0 14px; }
.lmd-panel-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.lmd-panel-foot .lmd-hint { flex: 1; min-width: 200px; margin: 0; }
.lmd-two > .lmd-extra { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin: 0; }
.lmd-two > .lmd-extra p { flex: 1; min-width: 240px; margin: 0; }
.lmd-panel-body section { border-bottom: 0; }
.lmd-panel-body > section:not([hidden]) ~ section:not([hidden]) { border-top: 1px solid var(--line); }
.lmd-pcol { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.lmd-preview { display: flex; flex-direction: column; gap: 16px; align-self: stretch; min-width: 0; padding: 14px 18px 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-soft); overflow: hidden; }
.lmd-preview > small { font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--fg-faint); }
.lmd-prev-text { height: 112px; overflow: hidden; font-family: var(--lmd-font); font-size: var(--lmd-font-size); line-height: var(--lmd-line-height); color: var(--fg); }
.lmd-prev-text b { display: block; margin-bottom: 0.25em; font-size: 1.15em; letter-spacing: -0.015em; }
.lmd-prev-text p { margin: 0; color: var(--fg-muted); }
.lmd-preview .lmd-prev-code { margin: 0; padding: 12px 14px; line-height: 1.6; white-space: pre; }
.lmd-preview .lmd-prev-dgm { flex: none; align-self: center; width: 132px; height: 116px; margin: 0; }
.lmd-preview .lmd-prev-dgm .node { fill: var(--bg); }
.lmd-pcol .lmd-swatches { gap: 6px; }

/* ---------- Emojis al escribir ":" ---------- */
.lmd-emoji { position: fixed; z-index: 70; min-width: 220px; max-width: 300px; padding: 5px; border: 1px solid var(--line); border-radius: 11px; background: var(--bg-soft); box-shadow: var(--shadow); font: 13.5px/1.3 var(--lmd-font); color: var(--fg); }
.lmd-emoji[hidden] { display: none; }
.lmd-emoji button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px 9px; border: 0; border-radius: 7px; background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.lmd-emoji button span { flex: none; width: 22px; font-size: 17px; text-align: center; }
.lmd-emoji button small { color: var(--fg-muted); font: 12.5px var(--lmd-mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lmd-emoji button.lmd-on, .lmd-emoji button:hover { background: var(--accent-soft); }
.lmd-emoji button.lmd-on small { color: var(--accent); }
@media print { .lmd-emoji { display: none !important; } }

/* ---------- Enlaces: selector, marcar en el documento y lista de [[ ---------- */
.lmd-lk-card { width: min(540px, 100%); }
.lmd-lk-card h3 { margin-bottom: 12px; }
.lmd-ask-card p.lmd-lk-now { margin: -4px 0 12px; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lmd-lk-now code { font: 12.5px var(--lmd-mono); color: var(--fg); }
.lmd-lk-q { display: block; width: 100%; box-sizing: border-box; height: 36px; margin: 12px 0 8px; padding: 0 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg-soft); color: var(--fg); font: inherit; outline: none; }
.lmd-lk-q:focus { border-color: var(--accent-fill); }
.lmd-lk-list { height: min(300px, 42vh); overflow-y: auto; margin-bottom: 14px; padding: 4px; border: 1px solid var(--line); border-radius: 9px; }
.lmd-lk-list[hidden] { display: none; }
.lmd-ask-card .lmd-lk-list p.lmd-empty { margin: 0; padding: 9px 10px; font-size: 13.5px; }
.lmd-lk-row { display: flex; align-items: center; gap: 9px; width: 100%; min-width: 0; padding: 6px 9px; border: 0; border-radius: 7px; background: transparent; color: var(--fg-muted); font: inherit; font-size: 13.8px; text-align: left; cursor: pointer; }
.lmd-lk-row span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lmd-lk-row small { margin-left: auto; padding-left: 10px; flex: none; max-width: 45%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--fg-faint); font-size: 12px; }
.lmd-lk-row svg, .lmd-lk-tog svg, .lmd-lk-mark svg { width: 15px; height: 15px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.lmd-lk-row i { flex: none; width: 5px; height: 5px; border-radius: 50%; background: var(--fg-faint); }
.lmd-lk-row:hover, .lmd-lk-row.lmd-on { background: var(--accent-soft); color: var(--fg); }
.lmd-lk-row.lmd-on { color: var(--accent); }
.lmd-lk-row.lmd-on i { background: var(--accent-fill); }
.lmd-lk-l1 { color: var(--fg); font-weight: 600; }
.lmd-lk-l2 { padding-left: 25px; }
.lmd-lk-l3 { padding-left: 41px; font-size: 13px; }
.lmd-lk-l4 { padding-left: 57px; font-size: 13px; }
.lmd-lk-file { display: flex; align-items: center; gap: 2px; }
.lmd-lk-file .lmd-lk-row { flex: 1; color: var(--fg); }
.lmd-lk-tog { flex: none; width: 26px; height: 28px; padding: 0; border: 0; border-radius: 6px; background: transparent; color: var(--fg-faint); display: grid; place-items: center; cursor: pointer; }
.lmd-lk-tog:hover { background: var(--bg-soft); color: var(--fg); }
.lmd-lk-tog svg { transition: transform 0.12s ease; }
.lmd-lk-file.lmd-open .lmd-lk-tog svg { transform: rotate(90deg); }
.lmd-lk-sub { margin-left: 28px; width: calc(100% - 28px); font-weight: 400; }
.lmd-ask-card .lmd-lk-list p.lmd-lk-sub { padding-left: 9px; }
.lmd-lk-actions { align-items: center; justify-content: flex-start; }
.lmd-lk-gap { flex: 1; }
.lmd-lk-mark { display: inline-flex; align-items: center; gap: 8px; }
.lmd-lk-mark[hidden] { display: none; }
.lmd-lk-actions .lmd-lk-remove { color: #dc2626; font-size: 13.5px; }
.lmd-format-label { display: none; }
.lmd-format-link button:not([data-fmt=link]) { display: none; }
.lmd-format-link button { display: flex; align-items: center; gap: 7px; padding: 0 10px; }
.lmd-format-link .lmd-format-label { display: inline; font-size: 13px; }
/* Marcar en el documento: los títulos quedan resaltados y lo demás se apaga. */
.lmd-pickbar { position: fixed; left: 50%; bottom: 52px; transform: translateX(-50%); z-index: 65; display: flex; align-items: center; gap: 14px; max-width: calc(100vw - 32px); padding: 9px 10px 9px 16px; border: 1px solid var(--accent-fill); border-radius: 12px; background: var(--bg); color: var(--fg); box-shadow: var(--shadow); font: 13.5px/1.4 var(--lmd-font); }
.lmd-pickbar .lmd-btn { padding: 5px 11px; font-size: 13px; }
.lmd-picking .lmd-article > *:not(h1, h2, h3, h4, h5, h6) { opacity: 0.4; }
.lmd-picking .lmd-article :is(h1, h2, h3, h4, h5, h6) { cursor: pointer; border-radius: 6px; outline: 1.5px dashed var(--accent-fill); outline-offset: 5px; }
.lmd-picking .lmd-article :is(h1, h2, h3, h4, h5, h6):hover { background: var(--accent-soft); outline-style: solid; }
.lmd-picking .lmd-handle, .lmd-picking .lmd-add, .lmd-picking .lmd-format { display: none !important; }
.lmd-wikibox button svg { width: 15px; height: 15px; vertical-align: -2px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.lmd-wikibox button span { font-size: 13px; color: var(--fg-faint); }
.lmd-wikibox button em { flex: 1; min-width: 0; font-style: normal; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lmd-wikibox button small { font-family: inherit; font-size: 12px; }
@media print { .lmd-pickbar, .lmd-lk { display: none !important; } }
.lmd-menu.lmd-menu-read { width: 262px; }
.lmd-menu-read button svg circle { fill: none; stroke: currentColor; }

/* ---------- Cuenta: qué anda sin ella, y el formulario para entrar ---------- */
.lmd-perks { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0 0 12px; font-size: 13px; line-height: 1.45; }
.lmd-perks dt { color: var(--fg); font-weight: 600; white-space: nowrap; }
.lmd-perks dd { margin: 0; color: var(--fg-muted); }
.lmd-signin p { margin: 0 0 9px; }
.lmd-acct .lmd-signin { margin-top: 14px; font-size: 13.5px; color: var(--fg-muted); }
.lmd-acct .lmd-signin input { flex: 1; min-width: 0; height: 34px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg-soft); color: var(--fg); font: inherit; outline: none; }
.lmd-acct .lmd-signin input:focus { border-color: var(--accent-fill); }
.lmd-acct .lmd-signin input[aria-invalid=true] { border-color: #dc2626; }
.lmd-acct .lmd-signin .lmd-home-cloud-err { margin: 8px 0 0; font-size: 13px; }

/* ---------- Editor de diagramas: piezas y volver atrás ---------- */
.lmd-dgm-add { margin-top: 6px; }
.lmd-dgm-add[hidden], .lmd-dgm-back[hidden] { display: none; }
.lmd-dgm-tpl .lmd-dgm-back { margin-left: 8px; border-color: var(--accent-fill); color: var(--accent); }
/* ---------- Ajustes: Nube, IA, Plan y Avanzado. Comentarios. Cuenta en el inicio ---------- */
.lmd-ptabs .lmd-ptabs-foot { margin-top: auto; color: var(--fg-faint); font-weight: 500; }
.lmd-row[hidden] { display: none; }
.lmd-two > .lmd-server-url { grid-column: 1 / -1; }
.lmd-acct-row span { flex: none; }
.lmd-acct-row b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lmd-acct-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.lmd-acct > .lmd-hint { margin: 0 0 10px; font-size: 13.5px; color: var(--fg-muted); }
.lmd-acct > .lmd-acct-msg { margin: 10px 0 0; color: #dc2626; }
.lmd-acct > h4 { margin: 18px 0 4px; font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--fg-faint); }
.lmd-acct a:not(.lmd-btn), .lmd-fb a { color: var(--accent); }
.lmd-field { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.lmd-field span { flex: 0 0 86px; font-size: 12.5px; color: var(--fg-muted); }
.lmd-field input { flex: 1; min-width: 0; box-sizing: border-box; height: 34px; padding: 0 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg-soft); color: var(--fg); font: 12px var(--lmd-mono); outline: none; }
.lmd-field input:focus, .lmd-field textarea:focus { border-color: var(--accent-fill); }
.lmd-field-long { align-items: flex-start; }
.lmd-field-long span { padding-top: 9px; }
.lmd-field textarea { flex: 1; min-width: 0; box-sizing: border-box; padding: 8px 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg-soft); color: var(--fg); font: 12px/1.5 var(--lmd-mono); outline: none; resize: none; white-space: pre-wrap; overflow-wrap: anywhere; field-sizing: content; scrollbar-width: thin; }
.lmd-field .lmd-link { flex: none; min-width: 58px; padding: 5px 0; color: var(--accent); text-align: right; }
.lmd-acct .lmd-ai-new { margin: 16px 0 0; color: var(--fg); font-size: 13px; }
.lmd-tokens { margin: 0; padding: 0; list-style: none; max-height: 132px; overflow: auto; scrollbar-width: thin; }
.lmd-tokens li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 13px; color: var(--fg-muted); }
.lmd-tokens li button { border: 0; background: none; color: var(--fg-faint); font: inherit; font-size: 12.5px; cursor: pointer; }
.lmd-tokens li button:hover { color: #dc2626; }
.lmd-acct .lmd-paywait { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg-soft); color: var(--fg); font-size: 13.5px; }
.lmd-paywait span { flex: 1; }
.lmd-paywait::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--accent-fill); }
.lmd-paywait-wait::before { animation: lmd-pulse 1s ease-in-out infinite; }
.lmd-paywait-late::before { background: #d97706; }
.lmd-acct .lmd-paywait-done { border-color: var(--accent-fill); background: var(--accent-soft); }
.lmd-paywait .lmd-link { flex: none; padding: 0; color: var(--accent); font-size: 13px; }
.lmd-plan .lmd-hint { margin-top: 10px; }
.lmd-ask { font-family: var(--lmd-font); color: var(--fg); }
.lmd-acct-card { width: min(620px, 100%); box-sizing: border-box; }
.lmd-acct-card .lmd-acct { margin: 8px 0 18px; }
.lmd-acct-card .lmd-plans { margin-bottom: 0; }
.lmd-fb { box-sizing: border-box; }
.lmd-fb textarea, .lmd-fb input[type=email] { display: block; box-sizing: border-box; width: 100%; margin: 0 0 10px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--bg-soft); color: var(--fg); font: inherit; font-size: 14px; outline: none; }
.lmd-fb textarea { min-height: 130px; margin-top: 6px; resize: vertical; }
.lmd-fb textarea:focus, .lmd-fb input[type=email]:focus { border-color: var(--accent-fill); }
.lmd-fb .lmd-fb-ok { display: flex; align-items: center; gap: 10px; margin: 8px 0 2px; color: var(--fg); font-weight: 600; }
.lmd-fb-ok svg { width: 20px; height: 20px; flex: none; fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.lmd-home-cloud .lmd-home-cloud-err { margin: 8px 0 0; font-size: 13px; }
.lmd-home-cloud-err[hidden] { display: none; }
.lmd-share-new input { flex: 1; min-width: 0; }
.lmd-share li.lmd-share-new .lmd-link, .lmd-share li.lmd-share-new .lmd-link:hover { flex: none; padding: 0 4px; color: var(--accent); font-size: 13px; }
.lmd-share .lmd-hint { margin: 2px 0 10px; }
.lmd-signin-back { display: block; margin: 8px auto 0; padding: 2px 0; font-size: 12.5px; }
.lmd-home-cloud input[aria-invalid=true] { border-color: #dc2626; }
button.lmd-home-coffee { border: 0; background: none; padding: 0; font: inherit; font-size: 13.5px; cursor: pointer; }

/* ---------- Comentarios para la IA ---------- */
.lmd-main { position: relative; }
.lmd-cm-layer { position: absolute; left: 0; top: 0; z-index: 5; }
.lmd-cm-layer[hidden] { display: none; }
.lmd-cm-mark { position: absolute; display: flex; align-items: center; justify-content: center; gap: 3px; min-width: 26px; height: 24px; padding: 0 6px; border: 0; border-radius: 7px; background: var(--accent-soft); color: var(--accent); font: 700 11px/1 var(--lmd-font); cursor: pointer; }
.lmd-cm-mark svg, .lmd-cm-pop h4 svg { width: 14px; height: 14px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.lmd-cm-mark:hover { background: var(--accent-fill); color: var(--accent-fg); }
.lmd-cm-pop { position: absolute; z-index: 62; box-sizing: border-box; width: 340px; max-width: calc(100vw - 16px); padding: 12px; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); font: 13.5px/1.45 var(--lmd-font); color: var(--fg); }
.lmd-cm-pop h4 { display: flex; align-items: center; gap: 7px; margin: 0 0 9px; font-size: 12px; font-weight: 600; color: var(--fg-muted); }
.lmd-cm-pop blockquote, .lmd-cm-quote { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; margin: 0 0 9px; padding: 0 0 0 10px; border: 0; border-left: 2px solid var(--line); background: none; color: var(--fg-muted); font: inherit; font-size: 12.5px; line-height: 1.45; text-align: left; overflow-wrap: anywhere; }
.lmd-cm-pop textarea { display: block; box-sizing: border-box; width: 100%; min-height: 76px; margin: 0 0 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg-soft); color: var(--fg); font: inherit; outline: none; resize: vertical; }
.lmd-cm-pop textarea:focus { border-color: var(--accent-fill); outline: none; }
.lmd-cm-actions { display: flex; justify-content: flex-end; gap: 8px; }
.lmd-cm-item + .lmd-cm-item { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.lmd-cm-text { margin: 0; color: var(--fg); white-space: pre-wrap; overflow-wrap: anywhere; }
.lmd-cm-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 4px; }
.lmd-cm-meta small { color: var(--fg-faint); font-size: 12px; }
.lmd-cm-meta .lmd-link { flex: none; padding: 2px 0; }
.lmd-cm-meta .lmd-link:hover { color: #dc2626; }
.lmd-cm-foot { margin-top: 8px; padding-top: 6px; border-top: 1px solid var(--line); }
.lmd-cm-foot .lmd-link { padding: 2px 0; color: var(--accent); }
.lmd-cm-card { width: min(560px, 100%); }
.lmd-ask-card.lmd-cm-card > .lmd-hint { margin: 0 0 14px; }
.lmd-cm-list { max-height: min(440px, 58vh); margin: 0 -6px 16px 0; padding-right: 6px; overflow: auto; scrollbar-width: thin; }
.lmd-cm-list h4 { margin: 0 0 8px; font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--fg-faint); }
.lmd-cm-list h4 small { margin-left: 4px; font-size: 12px; letter-spacing: 0; color: var(--fg-faint); font-weight: 500; }
.lmd-cm-list ul { margin: 0 0 18px; padding: 0; list-style: none; }
.lmd-cm-list ul:last-child { margin-bottom: 0; }
.lmd-cm-list li { padding: 11px 13px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg-soft); }
.lmd-cm-list li + li { margin-top: 8px; padding-top: 11px; }
.lmd-cm-list .lmd-cm-quote { width: 100%; margin-bottom: 7px; }
button.lmd-cm-quote { cursor: pointer; }
button.lmd-cm-quote:hover { border-left-color: var(--accent-fill); color: var(--fg); }
.lmd-ask-card p.lmd-cm-text { margin: 0; color: var(--fg); }
.lmd-ask-card p.lmd-cm-reply { margin: 8px 0 0; padding: 8px 10px; border-radius: 8px; background: var(--accent-soft); color: var(--fg); font-size: 13.5px; white-space: pre-wrap; overflow-wrap: anywhere; }
.lmd-cm-reply b { display: block; margin-bottom: 2px; font-size: 11px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--accent); }
.lmd-ask-card p.lmd-cm-none { margin: 0; }
.lmd-cm-here { border-radius: 6px; outline: 2px solid var(--accent-fill); outline-offset: 6px; }
.lmd-menu-grid .lmd-menu-wide { grid-column: 1 / -1; }
.lmd-menu-n { flex: none; margin-left: auto; min-width: 17px; padding: 0 5px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font: 700 11px/17px var(--lmd-font); text-align: center; }
@media print { .lmd-cm-layer, .lmd-cm-pop { display: none !important; } }
/* Ajustes: carpeta del token, por qué se llegó a Plan, y el pie de la barra de pestañas */
.lmd-pick { display: flex; align-items: center; gap: 10px; margin-top: 14px; }
.lmd-pick span { flex: 0 0 86px; font-size: 12.5px; color: var(--fg-muted); }
.lmd-pick select { flex: 0 1 300px; min-width: 0; height: 34px; padding: 0 9px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg-soft); color: var(--fg); font: inherit; font-size: 13px; outline: none; }
.lmd-pick select:focus { border-color: var(--accent-fill); }
.lmd-acct .lmd-plan-why { margin: 0 0 12px; padding: 10px 14px; border: 1px solid var(--accent-fill); border-radius: 10px; background: var(--accent-soft); color: var(--fg); font-size: 13.5px; }
.lmd-ptabs .lmd-ptabs-link { display: flex; align-items: center; gap: 10px; height: 34px; padding: 0 12px; border-radius: 9px; color: var(--fg-faint); font-size: 13.5px; font-weight: 500; text-decoration: none; }
.lmd-ptabs-link svg { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.lmd-ptabs .lmd-ptabs-link:hover { color: var(--accent); background: var(--bg-soft); }
.lmd-ptabs-ver { padding: 8px 12px 0; color: var(--fg-faint); font-size: 11.5px; white-space: nowrap; }

/* ---------- Antes de dibujar ---------- */
/* Al abrir o recargar un .md, el navegador muestra el texto crudo hasta que el lector lo reemplaza.
   Se oculta ese instante. Si el lector no llegara a arrancar, a los dos segundos vuelve a verse. */
html:not(.lmd-root) { color-scheme: light dark; background: Canvas; }
html:not(.lmd-root) > body > pre:first-child { visibility: hidden; animation: lmd-raw-back 0s linear 2s forwards; }
@keyframes lmd-raw-back { to { visibility: visible; } }

/* ---------- Una sola pantalla: sin nota abierta, el centro muestra el estado vacío ---------- */
.lmd-nodoc .lmd-doc-only, .lmd-nodoc .lmd-article, .lmd-nodoc .lmd-to-top { display: none !important; }
/* ---------- Diálogos propios: un campo o una confirmación ---------- */
.lmd-dlg-card { width: min(420px, 100%); }
.lmd-dlg-card h3 { margin-bottom: 12px; overflow-wrap: anywhere; }
.lmd-dlg-field { display: block; margin: 0 0 14px; }
.lmd-dlg-field span { display: block; margin-bottom: 6px; font-size: 13px; color: var(--fg-muted); }
.lmd-dlg-field input { display: block; width: 100%; height: 36px; padding: 0 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg-soft); color: var(--fg); font: inherit; outline: none; }
.lmd-dlg-field input:focus { border-color: var(--accent-fill); }
.lmd-dlg-field input[aria-invalid=true] { border-color: #dc2626; }
.lmd-ask-card p.lmd-dlg-err { margin: -6px 0 14px; color: #dc2626; font-size: 13px; }
.lmd-btn-danger { background: #dc2626; border-color: #dc2626; color: #fff; font-weight: 600; }
.lmd-btn-danger:hover { background: #b91c1c; border-color: #b91c1c; }
.lmd-topbar > .lmd-top-right { grid-column: 3; }
/* ---------- Barra lateral: el índice arriba y el explorador abajo, los dos a la vista ---------- */
.lmd-zones { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.lmd-zone { flex: 1 1 0px; min-height: 0; display: flex; flex-direction: column; }
.lmd-zone.lmd-shut { flex: 0 0 auto; }
.lmd-zone.lmd-shut > .lmd-pane { display: none; }
.lmd-zone-head { flex: none; display: flex; align-items: center; gap: 2px; height: 30px; padding: 0 6px 0 4px; border-top: 1px solid var(--line); color: var(--fg-faint); }
.lmd-zone-tog { flex: 1; min-width: 0; display: flex; align-items: center; gap: 4px; height: 100%; padding: 0 4px; border: 0; background: none; color: inherit; font: inherit; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; text-align: left; cursor: pointer; }
.lmd-zone-tog:hover { color: var(--fg); }
.lmd-zone-tog svg, .lmd-root-tog .lmd-node-chev svg { width: 14px; height: 14px; transition: transform 0.12s ease; }
.lmd-zone-tog[aria-expanded=true] svg, .lmd-root-tog[aria-expanded=true] .lmd-node-chev svg { transform: rotate(90deg); }
.lmd-zone-btn { flex: none; width: 24px; height: 24px; border: 0; border-radius: 6px; background: transparent; color: inherit; display: grid; place-items: center; cursor: pointer; }
.lmd-zone-btn:hover { background: var(--bg-soft); color: var(--fg); }
.lmd-zone-btn svg { width: 15px; height: 15px; }
.lmd-split { flex: none; height: 7px; margin: -3px 0 -4px; position: relative; z-index: 3; cursor: row-resize; }
.lmd-split:hover, .lmd-splitting .lmd-split { background: var(--accent-soft); }
.lmd-zones.lmd-one .lmd-split, .lmd-nodoc .lmd-split, .lmd-nodoc .lmd-zone-outline { display: none; }
.lmd-splitting { cursor: row-resize; user-select: none; }
.lmd-zone .lmd-pane { padding-top: 0; }
.lmd-zone-files .lmd-pane { padding-top: 2px; }
/* Buscando, el explorador muestra los resultados aunque esté plegado. */
.lmd-searching .lmd-zone-files.lmd-shut { flex: 1 1 0px; }
.lmd-searching .lmd-zone-files.lmd-shut > .lmd-pane { display: block; }
/* Raíces del explorador */
.lmd-xroot { margin-bottom: 4px; border-radius: 6px; }
.lmd-xroot .lmd-tree-head { gap: 2px; padding: 0 2px 0 0; }
.lmd-root-tog { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; height: 28px; padding: 0 6px 0 4px; border: 0; border-radius: 6px; background: transparent; color: var(--fg); font: inherit; text-align: left; cursor: pointer; }
.lmd-root-tog:hover { background: var(--bg-soft); }
.lmd-root-ico { display: grid; place-items: center; color: var(--fg-muted); }
.lmd-root-ico svg { width: 15px; height: 15px; }
.lmd-xroot .lmd-tree-up { flex: none; width: 24px; height: 24px; border: 0; color: var(--fg-faint); }
.lmd-xroot.lmd-shut > .lmd-tree { display: none; }
.lmd-xroot .lmd-tree { padding-left: 6px; }
.lmd-xroot .lmd-empty { padding: 4px 10px 6px; font-size: 12.5px; }
.lmd-root-hint { display: block; padding: 3px 10px 6px; color: var(--accent); text-align: left; }
.lmd-node-name { flex: 1; min-width: 0; }
.lmd-node-where { flex: none; margin-left: 4px; color: var(--fg-faint); opacity: 0.75; }
.lmd-node-where svg { width: 13px; height: 13px; margin-top: 3px; }
.lmd-node.lmd-active .lmd-node-where { color: inherit; }
.lmd-recent { display: flex; align-items: center; gap: 2px; }
.lmd-recent .lmd-node { flex: 1; min-width: 0; }
.lmd-recent .lmd-node-name { flex: 0 1 auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lmd-node-sub { flex: 1; min-width: 0; color: var(--fg-faint); font-size: 12px; text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lmd-node-x { flex: none; width: 22px; height: 22px; border: 0; border-radius: 6px; background: transparent; color: var(--fg-faint); display: grid; place-items: center; cursor: pointer; opacity: 0; }
.lmd-recent:hover .lmd-node-x, .lmd-node-x:focus-visible { opacity: 1; }
.lmd-node-x:hover { background: var(--bg-soft); color: var(--fg); }
.lmd-node-x svg { width: 13px; height: 13px; }
/* Resultados: primero la nota abierta, después cada raíz con su nombre */
.lmd-res-doc { display: flex; align-items: center; gap: 6px; width: 100%; margin: 2px 0 8px; padding: 5px 8px; border: 0; border-radius: 6px; background: var(--bg-soft); color: var(--fg); font: inherit; font-weight: 600; text-align: left; cursor: pointer; }
.lmd-res-doc:hover { color: var(--accent); }
.lmd-res-doc svg { width: 15px; height: 15px; }
.lmd-res-root { display: flex; align-items: center; gap: 6px; margin: 10px 6px 4px; color: var(--fg-faint); font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
/* Estado vacío: liviano, sin título */
/* ---------- Desde una plantilla: la lista por grupos y cómo queda la elegida ---------- */
.lmd-tpl-card { width: min(900px, 100%); }
.lmd-tpl-card h3 { margin-bottom: 12px; }
.lmd-tpl-body { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 14px; height: min(470px, 62vh); margin-bottom: 16px; }
.lmd-tpl-side { display: flex; flex-direction: column; min-height: 0; }
.lmd-tpl-side .lmd-lk-q { margin: 0 0 8px; flex: none; }
.lmd-tpl-list { flex: 1; min-height: 0; overflow-y: auto; padding: 4px; border: 1px solid var(--line); border-radius: 9px; }
.lmd-tpl-list .lmd-menu-label { margin: 8px 9px 3px; }
.lmd-tpl-list .lmd-menu-label:first-child { margin-top: 4px; }
.lmd-ask-card .lmd-tpl-list p.lmd-empty { margin: 0; padding: 9px 10px; font-size: 13.5px; }
.lmd-tpl-prev { min-width: 0; overflow: auto; padding: 16px 22px; border: 1px solid var(--line); border-radius: 9px; background: var(--bg-soft); font-size: 13.5px; line-height: 1.55; }
.lmd-tpl-prev > :first-child { margin-top: 0; }
.lmd-tpl-prev h1 { font-size: 1.55em; } .lmd-tpl-prev h2 { font-size: 1.25em; } .lmd-tpl-prev h3 { font-size: 1.1em; }
.lmd-ask-card .lmd-tpl-prev p { margin: 0 0 0.8em; color: inherit; }
.lmd-tpl-list, .lmd-tpl-prev { scrollbar-width: thin; }
.lmd-tpl-side .lmd-lk-q:focus-visible { outline: none; }
.lmd-nodoc .lmd-sync { display: none !important; }
.lmd-zone .lmd-pane { scrollbar-width: thin; }

/* ---------- Pantalla chica y táctil ---------- */
/* Áreas seguras: con viewport-fit=cover la página llega hasta los bordes del teléfono, y las barras dejan libre
   la muesca y la franja de gestos. En una pantalla común estos valores son cero y nada cambia. */
.lmd-topbar { height: calc(49px + env(safe-area-inset-top, 0px)); padding-top: env(safe-area-inset-top, 0px); padding-left: max(12px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.lmd-foot { height: calc(30px + env(safe-area-inset-bottom, 0px)); padding-bottom: env(safe-area-inset-bottom, 0px); padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.lmd-sidebar { padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); padding-left: env(safe-area-inset-left, 0px); }
.lmd-to-top { bottom: calc(48px + env(safe-area-inset-bottom, 0px)); }
/* El menú "más" y el fondo oscurecido son de la pantalla chica. */
.lmd-scrim, .lmd-more { display: none; }
.lmd-more svg { fill: currentColor; stroke: none; }
.lmd-menu.lmd-menu-more { width: 272px; }
/* Teclado en pantalla: el final del texto se puede subir por encima del teclado, y el pie no se monta sobre lo que se escribe. */
.lmd-kb .lmd-article, .lmd-kb .lmd-raw-edit { padding-bottom: calc(150px + var(--lmd-kb, 0px)); }
.lmd-kb .lmd-raw-edit { margin-bottom: var(--lmd-kb, 0px); }
.lmd-kb .lmd-foot, .lmd-kb .lmd-to-top { display: none; }

/* Pantalla chica: hasta 720 px de ancho, o un teléfono acostado (táctil y de poca altura). La misma condición está en touch.js. */
@media (max-width: 720px), (max-height: 500px) and (pointer: coarse) {
  /* La barra lateral es un panel: arranca cerrada, entra desde la izquierda encima del contenido y no lo corre. */
  .lmd-sidebar { width: min(320px, 86vw); z-index: 45; font-size: 15px; box-shadow: none; transform: translateX(-100%); visibility: hidden; transition: transform 0.2s ease, visibility 0s linear 0.2s; }
  .lmd-side-open .lmd-sidebar { transform: none; visibility: visible; box-shadow: var(--shadow); transition: transform 0.2s ease; }
  .lmd-side-open .lmd-scrim { display: block; position: fixed; inset: 0; z-index: 44; background: rgba(0, 0, 0, 0.5); touch-action: none; }
  .lmd-root.lmd-side-open { overflow: hidden; }
  .lmd-resizer { display: none; }
  .lmd-main { margin-left: 0; min-height: 100dvh; }
  .lmd-foot { left: 0; gap: 10px; }

  /* Barra de arriba: abrir la barra lateral, el nombre, leer o editar y guardar. El resto va al menú "más". */
  .lmd-topbar { grid-template-columns: minmax(0, 1fr) auto auto; gap: 6px; padding-left: max(6px, env(safe-area-inset-left, 0px)); padding-right: max(6px, env(safe-area-inset-right, 0px)); }
  .lmd-top-left { gap: 4px; }
  .lmd-docname { display: block; font-size: 14.5px; color: var(--fg); }
  .lmd-top-left .lmd-sync, .lmd-topbar .lmd-insert, .lmd-top-right > * { display: none; }
  .lmd-top-right > .lmd-more, .lmd-nodoc .lmd-top-right > [data-act=settings], .lmd-nodoc .lmd-top-right > [data-act=theme-flip] { display: grid; }
  .lmd-icon-btn { width: 40px; height: 40px; }
  .lmd-modeseg button { height: 34px; }

  /* El documento */
  .lmd-article, .lmd-raw { padding: 18px 16px 110px; }
  .lmd-home { min-height: calc(100dvh - 49px - env(safe-area-inset-top, 0px)); }
  .markdown-body { overflow-wrap: break-word; }
  .markdown-body h1 { font-size: 1.75em; }
  .markdown-body h2 { font-size: 1.36em; }
  .markdown-body h3 { font-size: 1.16em; }
  .markdown-body ul, .markdown-body ol { padding-left: 1.45em; }
  /* Una tabla ancha se desliza dentro de su bloque en vez de apretar las columnas o ensanchar la página. */
  .markdown-body table { max-width: max(100%, 560px); }
  .markdown-body th, .markdown-body td { padding: 7px 10px; }
  .lmd-front { grid-template-columns: minmax(0, max-content) minmax(0, 1fr); }
  .lmd-to-top { right: 14px; }
  /* El bloque con comentarios le deja lugar a su marca, que acá no tiene margen donde ir. */
  .markdown-body > .lmd-cm-has { padding-right: 30px; }
  .lmd-pickbar { bottom: calc(44px + env(safe-area-inset-bottom, 0px)); }
  .lmd-orphan { flex-wrap: wrap; }

  /* Tamaños para el dedo: 40 px de alto como mínimo en lo que se toca. */
  .lmd-search input { height: 40px; font-size: 16px; padding-left: 34px !important; }
  .lmd-search-ico { left: 21px; top: 22px; }
  .lmd-replace { flex-wrap: wrap; }
  .lmd-replace input { flex: 1 1 100%; height: 40px; font-size: 16px; }
  .lmd-replace button { flex: 1; height: 40px; }
  .lmd-zone-head { height: 40px; }
  .lmd-zone-tog { font-size: 12px; }
  .lmd-zone-btn { width: 40px; height: 36px; }
  .lmd-zone-btn svg { width: 17px; height: 17px; }
  .lmd-root-tog { height: 40px; }
  .lmd-xroot .lmd-tree-up { width: 40px; height: 36px; }
  .lmd-node { align-items: center; min-height: 40px; padding: 6px 8px 6px 10px; }
  .lmd-node svg, .lmd-node-where svg { margin-top: 0; }
  .lmd-node-x { width: 40px; height: 40px; }
  .lmd-o-link { padding: 10px 8px 10px 2px; }
  .lmd-o-tog, .lmd-o-dot { width: 26px; height: 42px; }
  .lmd-o-l3 > .lmd-o-link, .lmd-o-l4 > .lmd-o-link { font-size: 14px; }
  .lmd-o-row.lmd-active::before { top: 8px; bottom: 8px; }
  .lmd-res-file, .lmd-res-hit { padding-top: 10px; padding-bottom: 10px; }
  .lmd-res-hit { font-size: 14px; }
  .lmd-res-doc { min-height: 40px; }
  .lmd-root-hint { padding: 10px; }
  .lmd-btn { min-height: 40px; }
  .lmd-seg button { flex: 1 1 auto; height: 36px; padding: 0 8px; white-space: nowrap; }
  .lmd-switch, :is(.lmd-panel-body, .lmd-tl-side) .lmd-check { min-height: 40px; }
  .lmd-swatches, .lmd-pcol .lmd-swatches { gap: 9px; }
  .lmd-swatch { width: 36px; height: 36px; }
  .lmd-row select, .lmd-row input[type=text] { min-height: 40px; font-size: 16px; }
  .lmd-dlg-field input, .lmd-lk-q, .lmd-share input[type=email], .lmd-share input[type=text], .lmd-share select, .lmd-home-cloud input, .lmd-acct .lmd-signin input, .lmd-pick select { height: 40px; font-size: 16px; }
  .lmd-field input { height: 40px; }
  /* El comando largo usa todo el ancho, debajo de su nombre y su botón de copiar. */
  .lmd-field-long { flex-wrap: wrap; }
  .lmd-field-long span { flex: 1; padding-top: 0; }
  .lmd-field-long textarea { order: 3; flex: 1 1 100%; }
  .lmd-fb textarea, .lmd-fb input[type=email], .lmd-cm-pop textarea, .lmd-docname-input { font-size: 16px; }
  .lmd-docname-input { height: 36px; }
  .lmd-share li button, .lmd-tokens li button, .lmd-cm-meta .lmd-link, .lmd-cm-foot .lmd-link, .lmd-field .lmd-link, .lmd-home-acct .lmd-link { min-height: 40px; }
  .lmd-lk-row, .lmd-emoji button { min-height: 40px; }
  .lmd-lk-tog { width: 36px; height: 40px; }
  .lmd-hist-body li button { align-items: center; min-height: 40px; }
  .lmd-home-coffee { min-height: 40px; }

  /* Menús: un renglón cómodo cada acción, y nunca más grandes que la pantalla. */
  .lmd-menu { max-width: calc(100vw - 16px); max-height: calc(100dvh - 16px); overflow-y: auto; overscroll-behavior: contain; font-size: 14.5px; }
  .lmd-menu button { min-height: 42px; }
  .lmd-menu-narrow { width: 256px; }
  .lmd-menu.lmd-menu-read { width: 280px; }
  .lmd-format, .lmd-tablebar { max-width: calc(100vw - 16px); overflow-x: auto; }

  /* Estado vacío: las acciones en dos columnas y la cuenta a lo ancho. */
  .lmd-home { padding: 16px 14px calc(18px + env(safe-area-inset-bottom, 0px)); }
  .lmd-home-card { padding: 18px 4px 14px; }
  .lmd-home-sub { margin: 16px 0 20px; }
  .lmd-home-actions .lmd-btn, .lmd-home-actions .lmd-btn-fill, .lmd-home-actions .lmd-btn-fill:hover { font-size: 14.5px; border-radius: 11px; }
  .lmd-home-acct { min-height: 48px; }
  .lmd-side-acct .lmd-menu button { min-height: 44px; }
  .lmd-home-logo { width: 56px; height: 56px; }
  .lmd-home-actions { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
  .lmd-home-actions .lmd-btn { justify-content: center; gap: 7px; min-height: 46px; padding: 8px 6px; font-size: 14.5px; }
  .lmd-home-actions .lmd-btn:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .lmd-perks { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .lmd-perks dd { margin-bottom: 8px; }

  /* Ajustes: toda la pantalla, las pestañas arriba en una fila que se desliza, y cada pestaña en una columna. */
  .lmd-panel { padding: 0; bottom: var(--lmd-kb, 0px); }
  .lmd-panel-card { width: 100%; height: 100%; border: 0; border-radius: 0; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto minmax(0, 1fr);
    padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) 0 env(safe-area-inset-left, 0px); }
  .lmd-panel-card header { padding: 8px 8px 8px 16px; }
  .lmd-ptabs { flex-direction: row; align-items: center; gap: 4px; padding: 8px 10px; border-right: 0; border-bottom: 1px solid var(--line); overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain; scrollbar-width: none; }
  .lmd-ptabs button, .lmd-ptabs .lmd-ptabs-link { flex: none; height: 40px; white-space: nowrap; }
  .lmd-ptabs .lmd-ptabs-foot { margin-top: 0; }
  .lmd-ptabs-ver { flex: none; padding: 0 8px; }
  .lmd-panel-body { padding: 2px 16px calc(22px + env(safe-area-inset-bottom, 0px)); }
  .lmd-two, .lmd-grid, .lmd-plans { grid-template-columns: minmax(0, 1fr); }
  .lmd-two > .lmd-extra p, .lmd-panel-foot .lmd-hint { min-width: 0; }
  .lmd-switch[data-tip]::after { display: none; }
  .lmd-acct-row, .lmd-tokens li { align-items: center; min-height: 40px; }
  .lmd-pick { flex-wrap: wrap; }
  .lmd-pick select { flex: 1 1 100%; }
  .lmd-team-invite input { flex: 1 1 100%; height: 40px; font-size: 16px; }
  .lmd-team-invite .lmd-btn, .lmd-team-seats .lmd-btn { min-height: 40px; }
  .lmd-team-seats [data-t=less], .lmd-team-seats [data-t=more] { width: 44px; }
  .lmd-team-seats [data-t=seats] { flex: 1 1 100%; }
  .lmd-team-list li button { min-height: 40px; }

  /* Diálogos y selectores: arriba, donde el teclado no los tapa, y nunca más altos que lo que se ve. */
  .lmd-ask { align-items: start; padding: max(12px, 5vh, env(safe-area-inset-top, 0px)) max(12px, env(safe-area-inset-right, 0px)) max(12px, env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-left, 0px)); bottom: var(--lmd-kb, 0px); }
  .lmd-ask-card { max-height: 100%; padding: 18px 16px 16px; overflow-y: auto; overscroll-behavior: contain; }
  .lmd-ask-actions .lmd-btn { flex: 1 1 auto; }
  .lmd-lk-actions .lmd-lk-gap { display: none; }
  .lmd-lk-list { height: min(300px, 36vh); }
  .lmd-lk-card .lmd-seg button { padding: 0 4px; font-size: 13px; }
  .lmd-share-row { flex-wrap: wrap; }
  .lmd-share .lmd-share-row input[type=email] { flex: 1 1 100%; }
  .lmd-share-row select { flex: 1 1 auto; }
  .lmd-cm-list { max-height: calc(100dvh - 270px); }
  /* Plantillas e historial: la lista arriba y, debajo, cómo queda lo elegido. */
  .lmd-tpl-body { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 2fr) minmax(0, 3fr); height: calc(100dvh - 5vh - 190px); min-height: 280px; }
  .lmd-tpl-prev { padding: 12px 14px; }
  .lmd-hist-body { grid-template-columns: minmax(0, 1fr); grid-template-rows: fit-content(38%) minmax(0, 1fr); height: calc(100dvh - 5vh - 190px); min-height: 280px; }
  .lmd-dgm { padding: 0; }
  .lmd-dgm-card { height: 100%; border: 0; border-radius: 0; padding: env(safe-area-inset-top, 0px) 0 env(safe-area-inset-bottom, 0px); }
}
/* Con el dedo: lo que con mouse aparece al pasar por encima queda a la vista, y las barras flotantes son más altas. */
@media (hover: none) {
  .lmd-code-copy, .lmd-code-lang, .lmd-node-x, .lmd-card-del, .lmd-col-del, .lmd-dgm-tools { opacity: 1; }
}
@media (pointer: coarse) {
  .lmd-handle { width: 28px; height: 36px; border: 1px solid var(--line); background: var(--bg-soft); color: var(--fg-muted); }
  .lmd-format button, .lmd-tablebar button { min-width: 40px; height: 40px; }
  .lmd-docked { max-width: calc(100vw - 16px); overflow-x: auto; }
}
/* Editando en un teléfono, el margen izquierdo hace lugar a la manija del bloque. */
@media (max-width: 720px) and (pointer: coarse), (max-height: 500px) and (pointer: coarse) {
  .lmd-editing .lmd-article { padding-left: 44px; }
}
/* Teléfono acostado: no hay alto para dos zonas con su propio scroll. El índice y el explorador van uno debajo del otro y se desliza el panel entero. */
@media (max-height: 500px) and (pointer: coarse) {
  .lmd-zones { display: block; overflow-y: auto; overscroll-behavior: contain; }
  .lmd-zone, .lmd-searching .lmd-zone-files.lmd-shut { display: block; }
  .lmd-zone .lmd-pane { overflow: visible; }
  .lmd-o-head { position: static; }
  .lmd-split { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .lmd-sidebar, .lmd-side-open .lmd-sidebar { transition: none; }
}
@media print { .lmd-scrim { display: none !important; } }

/* ---------- Carpetas con contraseña ---------- */
/* En el explorador: el candado al lado de la carpeta y, si está abierta para la IA, un renglón que lo dice. */
.lmd-node-lock { flex: none; display: inline-flex; color: var(--accent); }
.lmd-vault-shut .lmd-node-lock { color: var(--fg-faint); }
.lmd-node-lock svg { width: 14px; height: 14px; }
.lmd-vault-line { display: flex; align-items: center; flex-wrap: wrap; gap: 2px 6px; padding: 0 8px 4px 32px; font-size: 12px; line-height: 1.35; color: var(--accent); }
.lmd-vault-ico { flex: none; display: inline-flex; }
.lmd-vault-ico svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.lmd-vault-state { min-width: 0; overflow-wrap: anywhere; }
.lmd-vault-line .lmd-link { padding: 1px 2px; font-size: 12px; text-decoration: underline; }
/* Las ventanas: proteger, desbloquear, clave de respaldo, abrir para la IA. */
.lmd-vault-card { width: min(460px, 100%); }
.lmd-vault-card h3 { margin-bottom: 12px; overflow-wrap: anywhere; }
.lmd-vault-body > p { margin: 0 0 12px; }
.lmd-ask-card p.lmd-vault-warn { padding: 10px 12px; border: 1px solid color-mix(in srgb, #dc2626 45%, var(--line)); border-radius: 9px; background: color-mix(in srgb, #dc2626 9%, transparent); color: var(--fg); font-weight: 600; }
.lmd-vault-notes { margin: 0 0 16px; padding-left: 18px; font-size: 13px; color: var(--fg-muted); }
.lmd-vault-notes li { margin: 0 0 4px; }
.lmd-vault .lmd-dlg-field { margin-bottom: 12px; }
.lmd-vault .lmd-dlg-field textarea { display: block; width: 100%; padding: 8px 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg-soft); color: var(--fg); font: 13.5px/1.5 ui-monospace, Consolas, Menlo, monospace; letter-spacing: .04em; resize: vertical; outline: none; }
.lmd-vault .lmd-dlg-field textarea:focus { border-color: var(--accent-fill); }
.lmd-vault .lmd-dlg-field textarea[aria-invalid=true] { border-color: #dc2626; }
.lmd-vault .lmd-check { margin: 0 0 6px; font-size: 13.5px; color: var(--fg-muted); }
.lmd-vault .lmd-link { padding-left: 0; }
.lmd-vault .lmd-hint { margin: 0 0 14px; }
.lmd-vault .lmd-ask-actions { margin-top: 16px; }
.lmd-ask-card.lmd-vault-card p.lmd-dlg-err { margin: 6px 0 0; }
/* Fortaleza de la contraseña: tres tramos que se van llenando. */
.lmd-vault-meter { display: flex; align-items: center; gap: 4px; height: 16px; margin: -4px 0 12px; }
.lmd-vault-meter i { flex: 0 0 34px; height: 4px; border-radius: 2px; background: var(--line); }
.lmd-vault-meter span { margin-left: 6px; font-size: 12px; color: var(--fg-faint); }
.lmd-vault-meter[data-s="0"] span { color: #dc2626; }
.lmd-vault-meter[data-s="1"] i:nth-child(1) { background: #dc2626; }
.lmd-vault-meter[data-s="2"] i:nth-child(-n+2) { background: #d97706; }
.lmd-vault-meter[data-s="3"] i { background: var(--accent-fill); }
/* La clave de respaldo: en grupos de cuatro, que bajan de renglón enteros. */
.lmd-vault-key { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 14px; margin: 0 0 12px; padding: 14px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg-soft); color: var(--fg); font: 600 15px/1.4 ui-monospace, Consolas, Menlo, monospace; letter-spacing: .06em; user-select: all; }
.lmd-vault-keyacts { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 10px; }
.lmd-vault-keyacts .lmd-btn { display: inline-flex; align-items: center; gap: 6px; }
.lmd-vault-keyacts svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.lmd-ask-card p.lmd-vault-step { margin: 0 0 8px; color: var(--fg); }
.lmd-vault-bar { height: 6px; margin: 0 0 4px; border-radius: 3px; background: var(--line); overflow: hidden; }
.lmd-vault-bar i { display: block; width: 0; height: 100%; background: var(--accent-fill); transition: width .2s ease; }
.lmd-vault-time { margin: 0 0 14px; }
.lmd-vault-time > span { display: block; margin-bottom: 6px; font-size: 13px; color: var(--fg-muted); }
.lmd-vault-time .lmd-seg { flex-wrap: wrap; border-radius: 12px; }
.lmd-vault-time .lmd-seg button { flex: 1 1 auto; padding: 0 12px; white-space: nowrap; border-radius: 9px; }
/* En el menú de la nube de una nota protegida, y en Ajustes → IA. */
.lmd-menu-note { display: flex; gap: 8px; max-width: 260px; margin: 6px 6px 4px; font-size: 12.5px; line-height: 1.4; color: var(--fg-muted); }
.lmd-menu-note svg { flex: none; width: 14px; height: 14px; margin-top: 2px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.lmd-acct .lmd-vault-list { max-height: none; }
.lmd-vault-list li span { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 6px; min-width: 0; overflow-wrap: anywhere; }
.lmd-vault-list li svg { flex: none; width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.lmd-vault-list li b { color: var(--fg); font-weight: 600; }
.lmd-vault-list li.lmd-vault-on span { color: var(--accent); }
.lmd-vault-list li button { flex: none; color: var(--fg-muted); text-decoration: underline; }
.lmd-vault-list li button:hover { color: var(--fg); }
.lmd-acct .lmd-vault-tokens { margin: 10px 0 0; }
@media (max-width: 720px), (max-height: 500px) and (pointer: coarse) {
  .lmd-vault-line { padding-bottom: 6px; font-size: 12.5px; }
  .lmd-vault-line .lmd-link { min-height: 32px; padding: 4px 6px; }
  .lmd-vault .lmd-dlg-field textarea { font-size: 16px; }
  .lmd-vault-key { font-size: 14px; letter-spacing: .03em; }
  .lmd-vault-keyacts .lmd-btn { flex: 1 1 auto; justify-content: center; }
  .lmd-vault-time .lmd-seg button { flex: 1 1 40%; }
  .lmd-vault .lmd-link { min-height: 40px; }
  .lmd-vault-list li { flex-wrap: wrap; }
}
@media print { .lmd-vault-line { display: none !important; } }

/* ---------- Sesión en vivo ---------- */
/* Arriba: que la nota está en vivo y quiénes están. El color de cada persona llega en --lmd-live. */
.lmd-live-chip { display: inline-flex; align-items: center; gap: 7px; flex: none; height: 30px; padding: 0 8px 0 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--bg-soft); color: var(--fg); font: 600 12.5px/1 var(--lmd-font); cursor: pointer; }
.lmd-live-chip[hidden] { display: none; }
.lmd-live-chip:hover { border-color: var(--fg-faint); }
.lmd-live-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: #30a46c; box-shadow: 0 0 0 3px color-mix(in srgb, #30a46c 25%, transparent); }
.lmd-live-avs { display: inline-flex; }
.lmd-live-av { display: inline-grid; place-items: center; flex: none; width: 22px; height: 22px; margin-left: -6px; border: 2px solid var(--bg-soft); border-radius: 50%; background: var(--lmd-live, var(--fg-faint)); color: #fff; font: 700 10px/1 var(--lmd-font); }
.lmd-live-avs .lmd-live-av:first-child { margin-left: 0; }
.lmd-live-av.lmd-live-more { background: var(--line); color: var(--fg); }
.lmd-live-n { display: none; }
/* Para el invitado: de quién es la sesión, cuánta gente hay, si se cortó, y cómo salir. */
.lmd-live-bar { position: sticky; top: calc(49px + env(safe-area-inset-top, 0px)); z-index: 9; display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 5px 16px; border-bottom: 1px solid var(--line); background: var(--bg-side); color: var(--fg-muted); font-size: 13px; line-height: 1.35; }
.lmd-live-msg { flex: 1; min-width: 0; }
.lmd-live-bar .lmd-btn { flex: none; padding: 4px 11px; font-size: 12.5px; }
.lmd-live-down, .lmd-live-over { color: var(--fg); }
.lmd-live-down .lmd-live-dot { background: #f5b83d; box-shadow: 0 0 0 3px color-mix(in srgb, #f5b83d 25%, transparent); }
.lmd-live-over .lmd-live-dot { background: var(--fg-faint); box-shadow: none; }
/* Quien entró por el enlace ve solo la nota: sin explorador ni cuenta. */
.lmd-guest .lmd-zone-files, .lmd-guest .lmd-split, .lmd-guest .lmd-update { display: none !important; }
.lmd-guest .lmd-zone-outline { flex: 1 1 auto !important; height: auto !important; }
/* Al margen de cada bloque, quién está ahí. Tocar la marca muestra el nombre. */
.lmd-live-layer { position: absolute; left: 0; top: 0; z-index: 4; }
.lmd-live-layer[hidden] { display: none; }
.lmd-live-mark { position: absolute; width: 13px; padding: 0; border: 0; background: none; cursor: pointer; }
.lmd-live-mark::before { content: ""; position: absolute; left: 5px; top: 1px; bottom: 1px; width: 3px; border-radius: 2px; background: var(--lmd-live); }
.lmd-live-tag { position: absolute; left: 5px; bottom: 100%; max-width: min(60vw, 320px); margin-bottom: 1px; padding: 2px 7px; overflow: hidden; border-radius: 6px 6px 6px 0; background: var(--lmd-live); color: #fff; font: 600 11px/1.35 var(--lmd-font); white-space: nowrap; text-overflow: ellipsis; opacity: 0; pointer-events: none; transition: opacity 0.12s ease; }
.lmd-live-mark:hover .lmd-live-tag, .lmd-live-mark:focus-visible .lmd-live-tag, .lmd-live-show .lmd-live-tag, .lmd-live-editing .lmd-live-tag { opacity: 1; }
.lmd-live-mark:hover, .lmd-live-show { z-index: 1; }
/* El bloque que otro está escribiendo: no se entra a editarlo hasta que lo suelte. */
.lmd-live-held { border-radius: 3px; outline: 1.5px solid color-mix(in srgb, var(--lmd-live) 65%, transparent); outline-offset: 3px; cursor: not-allowed; }
/* Llegó un cambio de otra persona: el bloque se enciende un momento con su color. */
.lmd-live-flash { animation: lmd-live-flash 1.4s ease-out; }
@keyframes lmd-live-flash {
  from { background-color: color-mix(in srgb, var(--lmd-live) 28%, transparent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--lmd-live) 28%, transparent); }
  to { background-color: transparent; box-shadow: 0 0 0 4px transparent; }
}
@media (prefers-reduced-motion: reduce) { .lmd-live-flash { animation-duration: 0.01s; } }
/* Dos tocaron lo mismo: el aviso con lo propio para copiar. */
.lmd-live-note { position: fixed; left: 50%; bottom: 46px; z-index: 70; display: flex; align-items: center; gap: 12px; width: max-content; max-width: min(640px, calc(100vw - 24px)); padding: 10px 8px 10px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); color: var(--fg); box-shadow: var(--shadow); font-size: 13.5px; line-height: 1.4; transform: translateX(-50%); }
.lmd-live-note p { flex: 1; min-width: 0; margin: 0; }
.lmd-live-note .lmd-btn { flex: none; }
.lmd-live-x { display: grid; place-items: center; flex: none; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 8px; background: none; color: var(--fg-faint); cursor: pointer; }
.lmd-live-x:hover { background: var(--bg-soft); color: var(--fg); }
.lmd-live-x svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
/* El cuadro de la sesión y el de entrada. */
.lmd-live-card { width: min(520px, 100%); }
.lmd-ask-card.lmd-live-card p { margin: 0 0 14px; }
.lmd-ask-card.lmd-live-card p.lmd-hint { margin: 6px 0 12px; color: var(--fg-faint); }
.lmd-ask-card.lmd-live-card p.lmd-live-lead { color: var(--fg); overflow-wrap: anywhere; }
.lmd-ask-card.lmd-live-card p.lmd-dlg-err { margin: 0 0 12px; }
.lmd-live-card .lmd-dlg-field { margin-bottom: 4px; }
.lmd-live-card h4 { margin: 16px 0 6px; font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--fg-faint); }
.lmd-live-link { margin-top: 0; }
.lmd-live-link span { flex-basis: auto; }
.lmd-live-people { max-height: 232px; margin: 0 0 14px; padding: 0; overflow: auto; list-style: none; }
.lmd-live-people li { display: flex; align-items: center; gap: 10px; padding: 5px 0; font-size: 14px; }
.lmd-live-people .lmd-live-av { width: 26px; height: 26px; margin-left: 0; border: 0; font-size: 11px; }
.lmd-live-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lmd-live-people li button { flex: none; padding: 6px 4px; border: 0; background: none; color: var(--fg-faint); font: inherit; font-size: 12.5px; cursor: pointer; }
.lmd-live-people li button:hover { color: #dc2626; }
@media (max-width: 720px), (max-height: 500px) and (pointer: coarse) {
  /* Arriba queda el punto con cuántos son; los nombres están en el cuadro de la sesión. */
  .lmd-live-chip { height: 34px; padding: 0 9px; gap: 6px; }
  .lmd-live-word, .lmd-live-avs { display: none; }
  .lmd-live-n { display: inline; }
  .lmd-live-bar { flex-wrap: wrap; gap: 6px 8px; padding: 6px max(12px, env(safe-area-inset-right, 0px)) 6px max(12px, env(safe-area-inset-left, 0px)); }
  .lmd-live-msg { flex: 1 1 calc(100% - 24px); }
  .lmd-live-bar .lmd-btn { flex: 1 1 0; min-height: 40px; }
  .lmd-live-mark { width: 16px; }
  .lmd-live-note { bottom: calc(40px + env(safe-area-inset-bottom, 0px)); flex-wrap: wrap; width: auto; }
  .lmd-live-note p { flex: 1 1 100%; }
  .lmd-live-note .lmd-btn { flex: 1; min-height: 40px; }
  .lmd-live-x { width: 40px; height: 40px; }
  .lmd-live-card .lmd-ask-actions .lmd-btn { flex: 1 1 auto; min-height: 40px; }
  .lmd-live-people li button { min-height: 40px; padding: 6px 8px; }
  .lmd-live-card .lmd-dlg-field input, .lmd-live-link input { height: 40px; font-size: 16px; }
}
@media print { .lmd-live-layer, .lmd-live-bar, .lmd-live-note, .lmd-live-chip { display: none !important; } .lmd-live-held { outline: 0; } }

/* Enlace público: solo lectura, sin las acciones de edición. */
.lmd-public .lmd-modeseg, .lmd-public .lmd-insert, .lmd-public .lmd-save { display: none !important; }

/* Papelera de la nube: la entrada al pie de la raíz y la ventana con lo eliminado. */
.lmd-trash-link { display: flex; align-items: center; gap: 6px; width: 100%; margin: 2px 0 4px; padding: 4px 10px 4px 16px; font-size: 12.5px; text-align: left; }
.lmd-trash-link svg { flex: none; width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.lmd-trash-link:hover { text-decoration: none; }
.lmd-xroot.lmd-shut > .lmd-trash-link { display: none; }
.lmd-trash { width: min(560px, 100%); }
.lmd-trash-list { margin: 0 0 16px; padding: 0; list-style: none; max-height: min(360px, 50vh); overflow: auto; scrollbar-width: thin; }
.lmd-trash-list li { display: flex; align-items: center; justify-content: space-between; gap: 6px 12px; flex-wrap: wrap; padding: 8px 0; border-bottom: 1px solid var(--line); }
.lmd-trash-name { display: flex; align-items: baseline; gap: 6px 8px; flex-wrap: wrap; flex: 1 1 200px; min-width: 0; font-size: 13.5px; }
.lmd-trash-name svg { flex: none; align-self: center; width: 13px; height: 13px; fill: none; stroke: var(--fg-faint); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.lmd-trash-name b { min-width: 0; font-weight: 600; color: var(--fg); overflow-wrap: anywhere; }
.lmd-trash-name small { color: var(--fg-faint); font-size: 12px; white-space: nowrap; }
.lmd-trash-acts { display: flex; flex: none; gap: 4px; }
.lmd-trash-acts .lmd-link { color: var(--accent); }
.lmd-trash-acts .lmd-trash-del { color: var(--fg-faint); }
.lmd-trash-acts .lmd-trash-del:hover { color: #dc2626; }
.lmd-ask-card p.lmd-trash-none { margin: 4px 0 18px; }
.lmd-ask-card.lmd-trash p.lmd-dlg-err { margin: 0 0 12px; }
.lmd-ask-card p.lmd-dlg-text { margin: 0 0 14px; }
.lmd-ask-card p.lmd-dlg-link { margin: -8px 0 18px; }
.lmd-dlg-link .lmd-link { padding: 0; color: var(--accent); font-size: 13.5px; text-decoration: underline; }
.lmd-acct-del { margin: 16px 0 0; }
.lmd-acct-del .lmd-link { padding-left: 0; }
.lmd-acct-del .lmd-link:hover { color: #dc2626; }
/* Dónde cae un archivo del explorador al soltarlo en la nota: en el texto, o en un renglón propio. */
.lmd-drop-caret { position: fixed; z-index: 60; width: 2px; border-radius: 2px; background: var(--accent-fill); pointer-events: none; }
.lmd-drop-caret.lmd-drop-line { height: 3px; }
@media (max-width: 720px), (max-height: 500px) and (pointer: coarse) {
  .lmd-trash-link { min-height: 40px; font-size: 14px; }
  .lmd-trash-acts .lmd-link, .lmd-acct-del .lmd-link { min-height: 40px; padding: 0 8px; }
  .lmd-acct-del .lmd-link { padding-left: 0; }
  .lmd-trash-list { max-height: calc(100dvh - 260px); }
}
@media print { .lmd-trash-link, .lmd-drop-caret { display: none !important; } }

/* Dentro de la app de la tienda (Android) no se ofrece comprar, cambiar el cobro ni donar: el plan se ve, no se vende. */
.lmd-store-app [data-cloud=plan], .lmd-store-app .lmd-plan-buy, .lmd-store-app [data-pay], .lmd-store-app .lmd-ptabs-link, .lmd-store-app .lmd-plan h4 small, .lmd-store-app .lmd-price, .lmd-store-app .lmd-team-seats, .lmd-store-app .lmd-team-cost,
.lmd-store-app .lmd-plan a[target="_blank"], .lmd-store-app .lmd-team a[target="_blank"], .lmd-store-app .lmd-team-solo a, .lmd-store-app .lmd-paywait { display: none !important; }

/* Ajustes > IA: cada token lleva dos acciones (copiar las instrucciones y revocar) y, al crearlo, el permiso de compartir. */
.lmd-tokens li span { flex: 1; min-width: 0; }
.lmd-tokens li button { flex: none; }
.lmd-tokens li .lmd-tok-brief { color: var(--accent); }
.lmd-tokens li .lmd-tok-brief:hover { color: var(--accent); text-decoration: underline; }
.lmd-acct .lmd-tok-share { margin: 10px 0 0; font-size: 13px; color: var(--fg); }
.lmd-acct > .lmd-acct-msg.lmd-acct-done { color: var(--fg-muted); }
/* ---------- Menús contextuales compactos ---------- */
/* El peligro (eliminar) tiene su color en cada tema. */
.lmd-root.lmd-light { --danger: #c62020; }
.lmd-root.lmd-dark { --danger: #f87171; }
/* Los menús de lista (explorador, lectura, nube, "más"): el ancho de lo que dicen, renglones bajos. */
.lmd-menu.lmd-menu-narrow, .lmd-menu.lmd-menu-read, .lmd-menu.lmd-menu-more { width: max-content; min-width: 168px; max-width: min(320px, calc(100vw - 16px)); padding: 5px; border-radius: 9px; font-size: 13px; }
.lmd-menu-list { gap: 1px; }
/* El menú de la cuenta: igual de compacto, con Salir aparte. */
.lmd-menu.lmd-menu-acct { padding: 5px; border-radius: 9px; font-size: 13px; }
.lmd-menu-list .lmd-menu-sep { height: 0; margin: 4px 3px; border: 0; border-top: 1px solid var(--line); }
.lmd-menu-list button { gap: 8px; padding: 5px 10px 5px 8px; }
.lmd-menu-list button svg { width: 15px; height: 15px; }
.lmd-menu button.lmd-menu-danger, .lmd-menu button.lmd-menu-danger svg { color: var(--danger, #dc2626); opacity: 1; }
.lmd-menu button.lmd-menu-danger:hover { background: color-mix(in srgb, var(--danger, #dc2626) 14%, transparent); color: var(--danger, #dc2626); }
/* La Papelera, mientras se arrastra algo encima. */
.lmd-trash-link.lmd-drop { outline: 2px dashed var(--danger, #dc2626); outline-offset: -2px; border-radius: 6px; background: color-mix(in srgb, var(--danger, #dc2626) 12%, transparent); color: var(--danger, #dc2626); }
/* Con el dedo, cada renglón conserva su alto. */
@media (max-width: 720px), (pointer: coarse) {
  .lmd-menu.lmd-menu-narrow, .lmd-menu.lmd-menu-read, .lmd-menu.lmd-menu-more { min-width: 200px; font-size: 14.5px; }
  .lmd-menu.lmd-menu-acct { font-size: 14.5px; }
  .lmd-menu button { min-height: 42px; }
  .lmd-menu-list button { padding: 7px 12px 7px 10px; }
  .lmd-menu-list button svg { width: 17px; height: 17px; }
}
/* Sin conexión: una marca chica en la barra de arriba, que se va al volver la red. */
.lmd-offline { display: inline-flex; align-items: center; gap: 5px; flex: none; height: 24px; padding: 0 8px; border: 1px solid var(--line); border-radius: 999px; color: var(--fg-muted); font-size: 12px; white-space: nowrap; }
.lmd-offline[hidden] { display: none; }
.lmd-offline svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
@media (max-width: 700px) { .lmd-offline { padding: 0 5px; } .lmd-offline span { display: none; } }
@media print { .lmd-offline { display: none !important; } }

/* Recientes: una carpeta abierta desde el otro lado (la web o la extensión), que acá falta reconectar. */
.lmd-node-ghost .lmd-node-ico, .lmd-node-ghost .lmd-node-name { opacity: .6; }
.lmd-node-ghost .lmd-node-sub { color: var(--accent); }

/* Ajustes > Instalar. */
.lmd-inst > h4:first-child { margin-top: 0; }
.lmd-inst-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; }
.lmd-inst-row p { flex: 1 1 240px; min-width: 0; margin: 0; font-size: 13.5px; color: var(--fg-muted); }
.lmd-inst-row .lmd-btn { flex: none; }
.lmd-inst-open { display: flex; flex-direction: column; gap: 6px; }
.lmd-inst-files { margin: 6px 0 10px; padding: 0; list-style: none; font: 12.5px/1.5 var(--lmd-mono, ui-monospace, monospace); color: var(--fg-muted); overflow-wrap: anywhere; }
.lmd-inst-opt { display: flex; align-items: flex-start; gap: 10px; font-size: 13.5px; color: var(--fg); cursor: pointer; }
.lmd-inst-opt input { flex: none; margin: 3px 0 0; accent-color: var(--accent-fill); }
.lmd-inst-opt span { min-width: 0; }
.lmd-inst-steps { margin: 0; padding-left: 20px; font-size: 13.5px; color: var(--fg-muted); }
.lmd-inst-steps li { margin: 0 0 4px; }
.lmd-inst-links { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-top: 8px; font-size: 13.5px; }

/* Barra de arriba: los menús de copiar y exportar, y recargar solo para lo que vive en el disco. */
.lmd-noreload .lmd-reload { display: none !important; }
.lmd-menu-list button kbd { margin-left: auto; padding-left: 14px; font: 11px var(--lmd-mono); color: var(--fg-faint); white-space: nowrap; }
.lmd-menu-list button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
@media print { .lmd-menu-top { display: none !important; } }

/* Explorador: cuántas notas tiene cada carpeta, chico y en gris a la derecha del nombre. */
.lmd-node-n { flex: none; align-self: center; min-width: 14px; margin-left: 4px; font-size: 11px; font-weight: 400; line-height: 1; text-align: right; color: var(--fg-faint); font-variant-numeric: tabular-nums; pointer-events: none; }
.lmd-node-n::after { content: attr(data-n); }
.lmd-node-n[hidden] { display: none; }
/* Un archivo que apareció en la carpeta mientras estaba abierta: un punto y un fondo tenue, unos segundos. */
.lmd-node.lmd-node-new { background: var(--accent-soft); }
.lmd-node.lmd-node-new .lmd-node-name::after { content: ''; display: inline-block; width: 6px; height: 6px; margin-left: 6px; border-radius: 50%; background: var(--accent-fill); vertical-align: middle; }
@media (max-width: 700px) { .lmd-node-n { font-size: 12.5px; margin-right: 2px; } }

/* Entrar a la cuenta: el formulario en la tarjeta del inicio, debajo de los botones, o en su ventana si hay una nota abierta. */
.lmd-login { text-align: left; font-size: 13.5px; color: var(--fg-muted); }
.lmd-login-home { margin-top: 18px; padding: 16px 16px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-soft); }
.lmd-ask-card.lmd-login { width: min(400px, 100%); }
.lmd-login h3 { margin: 0 0 4px; font-size: 15px; font-weight: 650; color: var(--fg); }
.lmd-login-sub { margin: 0 0 12px; font-size: 12.5px; line-height: 1.45; }
.lmd-login .lmd-signin p { margin: 0 0 8px; color: var(--fg); overflow-wrap: anywhere; }
.lmd-login .lmd-home-cloud-row { flex-wrap: nowrap; }
.lmd-login input { flex: 1; min-width: 0; height: 36px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--fg); font: inherit; outline: none; }
.lmd-login input:focus, .lmd-body .lmd-login input:focus-visible { border-color: var(--accent-fill); outline: none; }
.lmd-login input[aria-invalid=true] { border-color: #dc2626; }
.lmd-login input[data-field=code] { letter-spacing: 0.18em; font-variant-numeric: tabular-nums; }
.lmd-login .lmd-home-cloud-row .lmd-btn { flex: none; height: 36px; padding: 0 14px; border-radius: 8px; }
.lmd-login .lmd-home-cloud-err { margin: 8px 0 0; font-size: 12.5px; line-height: 1.4; }
.lmd-login .lmd-signin-back { margin: 8px 0 0; text-align: left; }
.lmd-login-cancel { display: block; margin: 10px 0 0 auto; padding: 2px 0; font-size: 12.5px; }
@media (max-width: 700px) {
  .lmd-login-home { padding: 14px 12px 10px; }
  .lmd-login .lmd-home-cloud-row { flex-wrap: wrap; }
  .lmd-login input { flex: 1 1 100%; height: 42px; font-size: 16px; }
  .lmd-login .lmd-home-cloud-row .lmd-btn { flex: 1 1 100%; height: 42px; }
  .lmd-login-cancel, .lmd-login .lmd-signin-back { min-height: 40px; }
}

/* Barra de arriba: tres grupos en una grilla que nunca los superpone. El de la derecha ocupa siempre lo que mide, el
   del centro también, y el de la izquierda cede: su piso son sus botones, y el nombre se acorta con puntos
   suspensivos. Con lugar de sobra los costados miden lo mismo y el centro queda centrado. Qué se guarda en el menú
   "más" cuando no entra todo lo decide fitBar (content.js) con las clases lmd-bar-tight y lmd-bar-min. */
.lmd-topbar { grid-template-columns: minmax(min-content, 1fr) auto minmax(max-content, 1fr); }
.lmd-top-mid, .lmd-top-right { flex: none; }
.lmd-top-right > *, .lmd-top-mid > *, .lmd-top-left > .lmd-icon-btn { flex: none; }
.lmd-docname { display: block; width: 0; flex: 1 1 0; }
.lmd-bar-tight .lmd-top-left .lmd-sync, .lmd-bar-tight .lmd-topbar .lmd-insert, .lmd-bar-tight .lmd-top-right > :not(.lmd-view):not(.lmd-more) { display: none; }
.lmd-bar-tight .lmd-top-right > .lmd-more, .lmd-bar-tight.lmd-nodoc .lmd-top-right > [data-act=settings], .lmd-bar-tight.lmd-nodoc .lmd-top-right > [data-act=theme-flip] { display: grid; }
/* Un archivo abierto directo: la franja que dice dónde está la cuenta, arriba de las pestañas que la piden. */
.lmd-direct { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin: 12px 0 4px; padding: 12px 14px; border: 1px solid var(--accent-fill); border-radius: 10px; background: var(--accent-soft); color: var(--fg); font-size: 13.5px; line-height: 1.45; }
.lmd-direct[hidden] { display: none; }
.lmd-direct p { flex: 1 1 260px; min-width: 0; margin: 0; }
.lmd-direct .lmd-btn { flex: none; }
.lmd-row-mode .lmd-mode-hint { margin-left: 6px; color: var(--fg-faint); font-size: 12.5px; font-style: normal; }
.lmd-bar-tight .lmd-topbar { gap: 6px; }
.lmd-bar-tight .lmd-view { margin-right: 0; }
.lmd-bar-min .lmd-top-right > .lmd-view, .lmd-bar-min .lmd-docname { display: none; }
@media (max-width: 720px), (max-height: 500px) and (pointer: coarse) { .lmd-topbar { grid-template-columns: minmax(0, 1fr) auto auto; } .lmd-docname { width: auto; } }
/* Entre 721 y 820 px la barra lateral abierta quedaba encima del contenido y tapaba el arranque de la barra de arriba,
   con su propio botón debajo. Fuera de la pantalla chica (ahí es un panel con su fondo) corre el contenido, como en
   cualquier otro ancho de escritorio. */
@media (min-width: 721px) and (max-width: 820px) and (min-height: 501px), (min-width: 721px) and (max-width: 820px) and (pointer: fine), (min-width: 721px) and (max-width: 820px) and (pointer: none) {
  .lmd-main { margin-left: var(--lmd-side-w); }
  .lmd-side-hidden .lmd-main { margin-left: 0; }
  .lmd-foot { left: var(--lmd-side-w); }
  .lmd-side-hidden .lmd-foot { left: 0; }
  .lmd-sidebar { box-shadow: none; }
}

/* Denunciar una nota ajena: un enlace chico al pie; en pantalla chica va en el menú "más". */
.lmd-foot .lmd-report { flex: none; padding: 0; font-size: 12px; color: var(--fg-faint); white-space: nowrap; }
.lmd-foot .lmd-report:hover { color: var(--fg); }
.lmd-foot .lmd-report[hidden] { display: none; }
.lmd-report-card textarea { min-height: 84px; }
@media (max-width: 720px), (max-height: 500px) and (pointer: coarse) { .lmd-foot .lmd-report { display: none; } }

/* Ajustes > Herramientas: una tarjeta por herramienta, con su interruptor y sus opciones. */
.lmd-tl-lead { margin: 0 0 12px; }
.lmd-tl-list { display: flex; flex-direction: column; gap: 10px; }
.lmd-tl-list[hidden] { display: none; }
.lmd-tl-card { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; align-items: center; gap: 4px 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-soft); }
.lmd-tl-ico { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; background: var(--bg); color: var(--accent); }
.lmd-tl-ico svg, .lmd-dct-mic svg, .lmd-dct-stop svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.lmd-tl-main { min-width: 0; }
.lmd-tl-main b { display: block; font-size: 14px; font-weight: 600; color: var(--fg); }
.lmd-tl-main p { margin: 2px 0 0; font-size: 13px; line-height: 1.4; color: var(--fg-muted); }
.lmd-tl-main p.lmd-tl-why, .lmd-tl-opts p.lmd-tl-why { color: var(--fg-faint); font-size: 12.5px; }
.lmd-tl-card .lmd-switch { padding: 0; }
.lmd-tl-card .lmd-tag { margin: 0; }
.lmd-tl-off .lmd-tl-ico { color: var(--fg-faint); }
.lmd-tl-off .lmd-switch { opacity: .5; cursor: default; }
.lmd-tl-acts { grid-column: 2 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 4px; }
.lmd-tl-acts[hidden], .lmd-tl-more[hidden], .lmd-tl-opts[hidden], .lmd-tl-need[hidden] { display: none; }
.lmd-tl-more { display: inline-flex; align-items: center; gap: 4px; padding: 4px 8px 4px 11px; background: var(--bg); font-size: 13px; }
.lmd-tl-more svg, .lmd-tl-back svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
/* Una tarjeta con las opciones abiertas se distingue: borde con el acento, y su botón también. */
.lmd-tl-card { transition: opacity .15s; }
.lmd-tl-card.lmd-tl-now { border-color: var(--accent-fill); box-shadow: 0 0 0 1px var(--accent-fill); }
.lmd-tl-cfg .lmd-tl-card:not(.lmd-tl-now) { opacity: .4; }
.lmd-tl-more[aria-expanded=true] { border-color: var(--accent-fill); color: var(--accent); }
.lmd-tl-need { padding: 4px 10px; border: 0; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.lmd-tl-need:hover { text-decoration: underline; }
.lmd-tl-side:focus { outline: none; }
.lmd-tl-need:focus-visible { outline: 2px solid var(--accent-fill); outline-offset: 2px; }
.lmd-tl-opts .lmd-row { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; }
.lmd-tl-opts .lmd-row > span { flex: 1 1 120px; min-width: 0; font-size: 13.5px; }
.lmd-tl-opts .lmd-row select { flex: 1 1 160px; min-width: 0; width: auto; }
/* Las opciones de una herramienta: un panel al costado, dentro de los Ajustes. Ocupa la misma celda que la zona de
   contenido (la última de la grilla, en escritorio y en teléfono) y queda encima de su mitad derecha, justo sobre la
   segunda columna de tarjetas: la grilla de atrás no se mueve ni cambia de alto. Lo que no entra se desliza adentro. */
.lmd-panel-card > .lmd-panel-body, .lmd-tl-side { grid-column: -2 / -1; grid-row: -2 / -1; }
.lmd-tl-side { justify-self: end; z-index: 2; box-sizing: border-box; display: flex; flex-direction: column; width: 50%; min-width: 0; min-height: 0; border-left: 1px solid var(--line); background: var(--bg); box-shadow: -16px 0 28px -20px rgba(0, 0, 0, .45); animation: lmd-tl-side-in .16s ease-out; }
.lmd-tl-side[hidden] { display: none; }
@keyframes lmd-tl-side-in { from { opacity: 0; transform: translateX(14px); } }
.lmd-tl-side-head { flex: none; display: flex; align-items: center; gap: 10px; min-height: 38px; padding: 9px 10px 9px 16px; border-bottom: 1px solid var(--line); }
.lmd-tl-side-head h4 { flex: 1; min-width: 0; margin: 0; font-size: 14px; font-weight: 600; line-height: 1.3; color: var(--fg); overflow-wrap: anywhere; }
.lmd-tl-side-head .lmd-tl-ico { flex: none; width: 32px; height: 32px; background: var(--bg-soft); }
.lmd-tl-side-head .lmd-switch { flex: none; padding: 0; }
/* Safari cuenta como desborde el texto de un select más largo que su caja: de costado no se desliza nunca. */
.lmd-tl-side-body { flex: 1; min-height: 0; overflow: hidden auto; padding: 14px 16px 18px; overscroll-behavior: contain; scrollbar-width: thin; -webkit-overflow-scrolling: touch; }
.lmd-tl-back { display: none; flex: none; align-items: center; gap: 2px; padding: 4px 11px 4px 6px; background: var(--bg); font-size: 13px; }
.lmd-tl-back svg { transform: rotate(180deg); }
/* Sin lugar al costado (ventana angosta o teléfono) el panel tapa toda la zona de contenido, con Volver en vez de la cruz. */
@media (max-width: 960px), (max-height: 500px) and (pointer: coarse) {
  .lmd-tl-side { width: 100%; border-left: 0; box-shadow: none; }
  .lmd-tl-back { display: inline-flex; }
  .lmd-tl-x { display: none; }
  .lmd-tl-side-head { padding-left: 10px; }
}
@media (prefers-reduced-motion: reduce) { .lmd-tl-card { transition: none; } .lmd-tl-side { animation: none; } }
@media print { .lmd-tl-side { display: none; } }
.lmd-tl-opts .lmd-row:last-child { margin-bottom: 0; }
.lmd-tl-opts .lmd-btn { flex: none; }

/* La vista flotante de una herramienta (tools.js): una escena de 232 x 146 dibujada con cajitas y líneas, con los
   colores del tema y su acento. No recibe el cursor ni el foco. Cada escena deja a la vista su estado final: sin
   animación (movimiento reducido) se entiende igual. */
.lmd-peek { --pk-ink: color-mix(in srgb, var(--fg-faint) 42%, var(--bg)); position: fixed; left: 0; top: 0; z-index: 62; box-sizing: border-box; width: 232px; height: 146px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); box-shadow: var(--shadow); overflow: hidden; pointer-events: none; opacity: 0; visibility: hidden; transition: opacity .14s, visibility 0s .14s; font: 11px/1.4 var(--lmd-mono); color: var(--fg); }
.lmd-peek.lmd-on { opacity: 1; visibility: visible; transition-delay: 0s; }
.lmd-peek * { box-sizing: border-box; }
.lmd-peek i, .lmd-peek b { display: block; font-style: normal; font-weight: 400; }
.lmd-pk { position: relative; height: 100%; }
.lmd-pk .l { height: 7px; margin-bottom: 9px; border-radius: 4px; background: var(--pk-ink); transform-origin: 0 50%; }
.lmd-pk .l:nth-child(2n) { width: 82%; } .lmd-pk .l:nth-child(3n) { width: 58%; }
.lmd-pk .bx { border: 1px solid var(--line); border-radius: 7px; background: var(--bg-soft); }
.lmd-pk .a { animation: lmd-pk-a 4s steps(1) infinite; } .lmd-pk .b { animation: lmd-pk-b 4s steps(1) infinite; }
.lmd-pk .hd { display: flex; align-items: center; gap: 9px; height: 20px; margin-bottom: 16px; }
.lmd-pk .eq { display: flex; align-items: center; gap: 3px; height: 18px; }
.lmd-pk .eq i { width: 3px; height: 100%; border-radius: 2px; background: var(--accent-fill); animation: lmd-pk-eq .8s ease-in-out infinite alternate; }
.lmd-pk .eq i:nth-child(2n) { height: 55%; animation-delay: -.3s; } .lmd-pk .eq i:nth-child(3n) { height: 80%; animation-delay: -.55s; }
@keyframes lmd-pk-a { 0% { opacity: 1; } 50%, 100% { opacity: 0; } }
@keyframes lmd-pk-b { 0% { opacity: 0; } 50%, 100% { opacity: 1; } }
@keyframes lmd-pk-eq { from { transform: scaleY(.25); } to { transform: none; } }
@keyframes lmd-pk-in { 0%, 38% { opacity: 0; transform: translateY(4px); } 52%, 100% { opacity: 1; transform: none; } }
@keyframes lmd-pk-w1 { 0% { transform: scaleX(0); } 28%, 100% { transform: none; } }
@keyframes lmd-pk-w2 { 0%, 28% { transform: scaleX(0); } 54%, 100% { transform: none; } }
@keyframes lmd-pk-w3 { 0%, 54% { transform: scaleX(0); } 78%, 100% { transform: none; } }
@keyframes lmd-pk-w4 { 0%, 66% { transform: scaleX(0); } 88%, 100% { transform: none; } }
@keyframes lmd-pk-pulse { 0%, 100% { transform: none; } 50% { transform: scale(1.3); } }
/* leer en voz alta: la marca avanza por el texto */
.lmd-pk-speak .pl { width: 0; height: 0; border: 7px solid transparent; border-left: 11px solid var(--accent-fill); border-right: 0; }
.lmd-pk-speak .tx { position: relative; }
.lmd-pk-speak .tx .l { width: 100%; margin-bottom: 11px; } .lmd-pk-speak .tx .l:last-child { width: 64%; }
.lmd-pk-speak .hl { position: absolute; left: -3px; top: -4px; width: 48px; height: 15px; border-radius: 4px; background: color-mix(in srgb, var(--accent-fill) 34%, transparent); box-shadow: inset 0 -2px 0 var(--accent-fill); animation: lmd-pk-read 4.2s steps(1) infinite; }
@keyframes lmd-pk-read { 0% { transform: none; } 16% { transform: translate(51px, 0); } 33% { transform: translate(102px, 0); } 50% { transform: translate(153px, 0); } 66% { transform: translate(0, 18px); } 83% { transform: translate(51px, 18px); } }
/* dictado: se habla y los renglones se escriben */
.lmd-pk-dictate .mc { width: 10px; height: 17px; border-radius: 5px; background: var(--accent-fill); }
.lmd-pk-dictate > .l:nth-child(2) { animation: lmd-pk-w1 3.6s linear infinite; } .lmd-pk-dictate > .l:nth-child(3) { animation: lmd-pk-w2 3.6s linear infinite; } .lmd-pk-dictate > .l:nth-child(4) { animation: lmd-pk-w3 3.6s linear infinite; }
/* tablero: una tarjeta pasa de columna */
.lmd-pk-board { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.lmd-pk-board .bx { padding: 6px; }
.lmd-pk-board .bx > i:first-child { height: 5px; width: 60%; margin: 2px 0 8px; border-radius: 3px; background: var(--pk-ink); }
.lmd-pk-board .cd { height: 22px; margin-bottom: 6px; border: 1px solid var(--line); border-radius: 5px; background: var(--bg); }
.lmd-pk-board .mv { position: relative; border-color: var(--accent-fill); animation: lmd-pk-move 3.2s ease-in-out infinite; }
@keyframes lmd-pk-move { 0%, 20% { transform: none; } 35% { transform: translate(55%, 6px) rotate(4deg); } 50%, 100% { transform: translate(calc(100% + 22px), 28px); } }
/* presentación: una diapositiva y la que sigue */
.lmd-pk-present .bx { position: relative; width: 152px; height: 88px; margin: 0 auto 11px; }
.lmd-pk-present .s { position: absolute; inset: 15px 16px 0; }
.lmd-pk-present .s .l:first-child { height: 10px; width: 64%; margin-bottom: 14px; background: var(--accent-fill); }
.lmd-pk-present .b .l:first-child { width: 42%; } .lmd-pk-present .b .l:last-child { width: 76%; }
.lmd-pk-present .dt { position: relative; display: flex; gap: 6px; width: 30px; margin: 0 auto; }
.lmd-pk-present .dt i { width: 6px; height: 6px; border-radius: 50%; background: var(--pk-ink); }
.lmd-pk-present .dt .on { position: absolute; left: 0; top: 0; background: var(--accent-fill); animation: lmd-pk-next 4s steps(1) infinite; }
@keyframes lmd-pk-next { 0% { transform: none; } 50%, 100% { transform: translateX(12px); } }
/* nota diaria: el día de hoy en el mes, y su nota */
.lmd-pk-daily { display: flex; gap: 14px; }
.lmd-pk-daily .cal { flex: none; display: grid; grid-template-columns: repeat(7, 10px); grid-auto-rows: 10px; gap: 6px 5px; padding-top: 18px; }
.lmd-pk-daily .cal i { border-radius: 3px; background: var(--pk-ink); opacity: .6; }
.lmd-pk-daily .cal .t { background: var(--accent-fill); opacity: 1; animation: lmd-pk-pulse 1.8s ease-in-out infinite; }
.lmd-pk-daily .bx { flex: 1; min-width: 0; padding: 12px 9px 0; animation: lmd-pk-in 3.6s infinite; }
.lmd-pk-daily .bx .l:first-child { width: 60%; margin-bottom: 13px; background: var(--accent-fill); }
/* exportar a Word e importar: de un formato a otro */
.lmd-pk-conv { display: flex; align-items: center; }
.lmd-pk-conv .bx { flex: none; width: 72px; height: 98px; padding: 9px 9px 0; }
.lmd-pk-conv b { margin-bottom: 10px; color: var(--fg-muted); }
.lmd-pk-conv .to { border-color: var(--accent-fill); animation: lmd-pk-in 3.6s infinite; }
.lmd-pk-conv .to b { color: var(--accent); font-weight: 600; }
.lmd-pk-conv .ar { position: relative; flex: 1; height: 2px; margin: 0 11px 0 9px; border-radius: 1px; background: var(--pk-ink); }
.lmd-pk-conv .ar::after { content: ""; position: absolute; right: -2px; top: -3px; width: 8px; height: 8px; border: solid var(--pk-ink); border-width: 2px 2px 0 0; transform: rotate(45deg); }
.lmd-pk-conv .st { flex: none; display: grid; gap: 8px; width: 72px; }
.lmd-pk-conv .st b { margin: 0; padding: 4px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg-soft); animation: lmd-pk-pick 3.6s steps(1) infinite; }
.lmd-pk-conv .st b:nth-child(2) { animation-delay: 1.2s; } .lmd-pk-conv .st b:nth-child(3) { animation-delay: 2.4s; }
@keyframes lmd-pk-pick { 0% { border-color: var(--accent-fill); color: var(--fg); } 33%, 100% { border-color: var(--line); color: var(--fg-muted); } }
/* mapa de enlaces: dos notas llegan a la que está abierta */
.lmd-pk-map i { position: absolute; }
.lmd-pk-map .n { width: 14px; height: 14px; border: 2px solid var(--pk-ink); border-radius: 50%; background: var(--bg); }
.lmd-pk-map .n1 { left: 14px; top: 12px; } .lmd-pk-map .n2 { left: 160px; top: 6px; }
.lmd-pk-map .n3 { left: 92px; top: 84px; border-color: var(--accent-fill); background: var(--accent-fill); animation: lmd-pk-pulse 1.8s ease-in-out infinite; }
.lmd-pk-map .e { height: 2px; border-radius: 1px; background: var(--pk-ink); transform-origin: 0 50%; }
.lmd-pk-map .e1 { left: 21px; top: 18px; width: 146px; transform: rotate(-2.4deg); }
.lmd-pk-map .e2 { left: 21px; top: 18px; width: 106px; transform: rotate(42.7deg); }
.lmd-pk-map .e3 { left: 167px; top: 12px; width: 103px; transform: rotate(131.1deg); }
.lmd-pk-map .e2, .lmd-pk-map .e3 { background: var(--accent-fill); animation: lmd-pk-grow 3.6s ease-out infinite; }
@keyframes lmd-pk-grow { 0%, 12% { width: 0; } 55% { width: 104px; } }
/* JSON y YAML: un árbol que se pliega */
.lmd-pk-json .r { display: flex; align-items: center; gap: 7px; height: 19px; overflow: hidden; }
.lmd-pk-json .in { padding-left: 16px; } .lmd-pk-json .in2 { padding-left: 32px; }
.lmd-pk-json .r > i:first-child:not(.ct) { margin-left: 15px; }
.lmd-pk-json .v { color: var(--accent); }
.lmd-pk-json .ct { width: 8px; height: 5px; border: 4px solid transparent; border-top: 5px solid var(--fg-muted); border-bottom: 0; }
.lmd-pk-json .tg { animation: lmd-pk-turn 4.4s steps(1) infinite; } .lmd-pk-json .kid { animation: lmd-pk-fold 4.4s steps(1) infinite; }
@keyframes lmd-pk-turn { 0%, 78%, 100% { transform: none; } 45% { transform: rotate(-90deg); } }
@keyframes lmd-pk-fold { 0%, 78%, 100% { height: 19px; } 45% { height: 0; } }
/* asistente: se le pide algo y contesta */
.lmd-pk-ai .bx { display: flex; align-items: center; gap: 9px; height: 30px; margin-bottom: 16px; padding: 0 11px; }
.lmd-pk-ai .sp { flex: none; width: 8px; height: 8px; border-radius: 2px; background: var(--accent-fill); transform: rotate(45deg); }
.lmd-pk-ai .bx .l { width: 96px; margin: 0; animation: lmd-pk-w1 3.6s linear infinite; }
.lmd-pk-ai > .l { background: color-mix(in srgb, var(--accent-fill) 55%, var(--bg)); }
.lmd-pk-ai > .l:nth-child(2) { animation: lmd-pk-w2 3.6s linear infinite; } .lmd-pk-ai > .l:nth-child(3) { animation: lmd-pk-w3 3.6s linear infinite; } .lmd-pk-ai > .l:nth-child(4) { animation: lmd-pk-w4 3.6s linear infinite; }
@media (prefers-reduced-motion: reduce) { .lmd-peek { transition: none; } .lmd-peek *, .lmd-peek *::after { animation: none !important; } .lmd-pk .b { display: none; } }
@media print { .lmd-peek { display: none; } }

/* Leer en voz alta: el bloque que se está leyendo y los controles, abajo al centro. */
.lmd-article .lmd-speaking { background: var(--accent-soft); box-shadow: 0 0 0 5px var(--accent-soft); border-radius: 3px; transition: background-color .15s, box-shadow .15s; }
.lmd-article tr.lmd-speaking { box-shadow: none; }
/* Dentro del bloque marcado, el fragmento que suena ahora (speak.js lo pone como resalte, sin tocar la nota). */
::highlight(lmd-speaking) { background-color: var(--accent-fill); color: var(--accent-fg); }
.lmd-spk { position: fixed; left: 50%; bottom: 44px; transform: translateX(-50%); z-index: 42; display: flex; align-items: center; gap: 6px; max-width: calc(100vw - 16px); padding: 6px 8px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); color: var(--fg); box-shadow: var(--shadow); font: 13px/1.3 var(--lmd-font); }
.lmd-spk select { min-width: 0; max-width: 150px; height: 30px; padding: 0 6px; border: 1px solid var(--line); border-radius: 7px; background: var(--bg-soft); color: var(--fg); font: inherit; }
.lmd-spk select[data-spk=rate] { flex: none; }
.lmd-spk .lmd-icon-btn { flex: none; }
.lmd-spk [data-spk=play] svg { fill: currentColor; }
.lmd-spk-paused { border-color: var(--accent-fill); }

/* Dictado: el botón del micrófono, lo provisorio en el lugar y la franja fija mientras escucha. */
.lmd-dct-mic { position: fixed; z-index: 31; width: 34px; height: 34px; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: var(--bg-soft); color: var(--fg-muted); display: grid; place-items: center; cursor: pointer; box-shadow: var(--shadow); }
.lmd-dct-mic[hidden] { display: none; }
.lmd-dct-mic:hover { color: var(--fg); }
.lmd-dct-mic.lmd-busy { opacity: .6; }
.lmd-dct-mic.lmd-on { border-color: var(--danger, #dc2626); background: var(--danger, #dc2626); color: #fff; }
.lmd-dct-mic.lmd-docked { width: 44px; height: 44px; z-index: 41; }
.lmd-editable .lmd-anchor.lmd-voice-ghost { margin: 0; opacity: .5; color: inherit; font-weight: inherit; font-style: italic; }
.lmd-dct-bar { position: fixed; left: 50%; top: calc(57px + env(safe-area-inset-top, 0px)); transform: translateX(-50%); z-index: 43; width: max-content; min-width: min(360px, calc(100vw - 16px)); max-width: min(640px, calc(100vw - 16px)); padding: 6px 6px 6px 14px; border: 1px solid var(--danger, #dc2626); border-radius: 14px; background: var(--bg); color: var(--fg); box-shadow: var(--shadow); font: 13.5px/1.35 var(--lmd-font); }
.lmd-dct-row { display: flex; align-items: center; gap: 9px; min-width: 0; }
.lmd-dct-dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--danger, #dc2626); animation: lmd-dct-pulse 1.3s ease-in-out infinite; }
@keyframes lmd-dct-pulse { 50% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) { .lmd-dct-dot { animation: none; } }
.lmd-dct-label { flex: none; font-weight: 600; }
.lmd-dct-where { flex: none; color: var(--fg-faint); font-size: 12px; }
.lmd-dct-where:empty { display: none; }
.lmd-dct-said { flex: 1 1 auto; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; direction: rtl; text-align: left; color: var(--fg-muted); font-style: italic; }
.lmd-dct-bar .lmd-icon-btn { flex: none; }
.lmd-dct-stop { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border-color: var(--danger, #dc2626); color: var(--danger, #dc2626); background: transparent; }
.lmd-dct-stop svg { width: 15px; height: 15px; fill: currentColor; }
.lmd-dct-pane { margin: 8px 8px 4px 0; padding-top: 8px; border-top: 1px solid var(--line); }
.lmd-dct-pane[hidden] { display: none; }
.lmd-dct-view { max-height: min(46vh, 380px); overflow: auto; text-align: center; color: var(--fg); }
.lmd-dct-view svg { max-width: 100%; height: auto; }
.lmd-dct-empty .lmd-dct-view { padding: 10px 0; color: var(--fg-faint); font-size: 13px; }
.lmd-dct-pane code { display: block; margin-top: 6px; max-height: 64px; overflow: auto; white-space: pre-wrap; word-break: break-word; font: 12px/1.4 ui-monospace, Consolas, monospace; color: var(--fg-faint); }
.lmd-dct-empty code { display: none; }
.lmd-dct-help .lmd-ask-card { width: min(620px, 100%); max-height: calc(100vh - 40px - var(--lmd-kb, 0px)); display: flex; flex-direction: column; }
.lmd-dct-help h3 { margin: 0 0 12px; }
.lmd-dct-help .lmd-seg { align-self: flex-start; }
.lmd-dct-sheet { flex: 1 1 auto; min-height: 0; overflow: auto; margin: 6px 0 14px; }
.lmd-dct-sheet h4 { margin: 14px 0 6px; font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--fg-faint); }
.lmd-dct-sheet dl { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 5px 14px; margin: 0; font-size: 13.5px; }
.lmd-dct-sheet dt { color: var(--fg); }
.lmd-dct-sheet dd { margin: 0; color: var(--fg-muted); }
@media (max-width: 720px), (max-height: 500px) and (pointer: coarse) {
  .lmd-tl-card { grid-template-columns: 34px minmax(0, 1fr) auto; padding: 12px; }
  .lmd-tl-ico { width: 34px; height: 34px; }
  .lmd-tl-more, .lmd-tl-need, .lmd-tl-back { min-height: 36px; }
  .lmd-tl-side-body { padding: 14px 16px calc(22px + env(safe-area-inset-bottom, 0px)); }
  .lmd-spk { bottom: calc(46px + env(safe-area-inset-bottom, 0px)); flex-wrap: wrap; justify-content: center; }
  .lmd-spk select { max-width: 120px; height: 36px; }
  .lmd-dct-bar { min-width: 0; width: calc(100vw - 16px); }
  .lmd-dct-where { display: none; }
  .lmd-dct-help .lmd-ask-card { max-height: calc(100vh - 14vh - 24px - var(--lmd-kb, 0px)); }
  .lmd-dct-sheet dl { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .lmd-dct-sheet dd { margin: 0 0 8px; }
}
@media print { .lmd-spk, .lmd-dct-mic, .lmd-dct-bar, .lmd-voice-ghost { display: none !important; } .lmd-article .lmd-speaking { background: none; box-shadow: none; } }
/* ---------- Comunidad: la galería de aportes en Ajustes > Herramientas (gallery.js) ---------- */
.lmd-gal { margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--line); }
.lmd-gal-title, .lmd-gal-mine h4 { margin: 0 0 4px; font-size: 15px; font-weight: 650; color: var(--fg); }
.lmd-gal .lmd-gal-lead { margin: 0 0 12px; font-size: 13.5px; color: var(--fg-muted); }
.lmd-gal-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 12px; }
.lmd-gal-bar .lmd-seg { flex: none; }
.lmd-gal-bar .lmd-gal-q { flex: 1 1 160px; width: auto; min-width: 0; margin: 0; }
.lmd-gal-bar .lmd-btn { flex: none; }
.lmd-gal-theme { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin: 0 0 12px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg-soft); font-size: 13.5px; }
.lmd-gal-theme[hidden], .lmd-gal-note[hidden], .lmd-gal-mine[hidden], .lmd-gal-colors[hidden] { display: none; }
.lmd-gal-theme span { flex: 1 1 200px; min-width: 0; overflow-wrap: anywhere; }
.lmd-gal .lmd-gal-note { margin: 0 0 12px; font-size: 13px; }
.lmd-gal-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
.lmd-gal-list .lmd-empty { grid-column: 1 / -1; }
.lmd-gal-card { display: flex; flex-direction: column; gap: 6px; min-width: 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-soft); }
.lmd-gal-head { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.lmd-gal-head b { min-width: 0; font-size: 14px; font-weight: 600; color: var(--fg); overflow-wrap: anywhere; }
.lmd-gal-head .lmd-tag, .lmd-gal-my .lmd-tag, .lmd-gal-dlg h3 .lmd-tag, .lmd-gal-prev-head .lmd-tag { flex: none; margin-left: 0; }
.lmd-gal-about { margin: 0; font-size: 13px; line-height: 1.4; color: var(--fg-muted); overflow-wrap: anywhere; }
.lmd-gal-by { margin: 0; font-size: 12.5px; color: var(--fg-faint); overflow-wrap: anywhere; }
.lmd-gal-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: auto; padding-top: 6px; }
.lmd-gal-acts .lmd-btn { padding: 0 12px; height: 32px; font-size: 13px; }
.lmd-gal-report { margin-left: auto; font-size: 12.5px; color: var(--fg-faint); }
.lmd-gal > [data-gal=more] { display: block; margin: 12px auto 0; color: var(--accent); }
.lmd-gal > [data-gal=more][hidden] { display: none; }
.lmd-gal-pal { display: flex; align-items: center; margin: 2px 0; }
.lmd-gal-pal i { display: grid; place-items: center; width: 44px; height: 30px; border: 1.5px solid; border-radius: 7px; font-size: 12px; font-style: normal; font-weight: 600; }
.lmd-gal-pal span { width: 18px; height: 2px; }
.lmd-gal-sample { padding: 16px 18px; border: 1px solid var(--line); border-radius: 10px; }
.lmd-gal-sample b { display: block; font-size: 17px; }
.lmd-gal-sample p { margin: 6px 0 10px; font-size: 14px; }
.lmd-gal-sample-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.lmd-gal-sample code { padding: 3px 8px; border: 1px solid currentColor; border-radius: 6px; font: 12.5px/1.4 var(--lmd-mono); background: none; }
.lmd-gal-sample i { padding: 5px 14px; border-radius: 999px; font-size: 12.5px; font-style: normal; font-weight: 600; }
.lmd-gal-vals { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 10px 0 0; padding: 0; list-style: none; font-size: 12.5px; color: var(--fg-muted); }
.lmd-gal-vals li { display: flex; align-items: center; gap: 6px; }
.lmd-gal-vals i { width: 13px; height: 13px; border: 1px solid var(--line); border-radius: 4px; }
.lmd-gal-dlg .lmd-ask-card { display: flex; flex-direction: column; width: min(560px, 100%); max-height: calc(100vh - 40px - var(--lmd-kb, 0px)); overflow-y: auto; }
.lmd-gal-dlg h3 { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; margin: 0 0 6px; overflow-wrap: anywhere; }
.lmd-gal-prev { margin: 10px 0 14px; min-width: 0; }
.lmd-gal-md { max-height: 44vh; overflow: auto; padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; font-size: 14px; }
.lmd-gal-share .lmd-gal-md { max-height: 26vh; }
.lmd-gal-prev-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; margin: 0 0 4px; }
.lmd-gal-prev-head b { overflow-wrap: anywhere; }
.lmd-gal-share .lmd-gal-prev { padding: 12px 14px; border: 1px dashed var(--line); border-radius: 10px; }
.lmd-gal-kind { display: flex; flex-direction: column; gap: 4px; margin: 4px 0 12px; }
.lmd-gal-kind .lmd-check { margin: 0; }
.lmd-gal-kind input:disabled + span { color: var(--fg-faint); }
.lmd-gal-share .lmd-dlg-field { margin-bottom: 10px; }
.lmd-gal-share .lmd-dlg-field select { display: block; width: 100%; box-sizing: border-box; height: 36px; padding: 0 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg-soft); color: var(--fg); font: inherit; }
.lmd-gal-two { display: grid; grid-template-columns: minmax(0, 1fr) 130px; gap: 10px; }
.lmd-gal-colors { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 10px; margin-bottom: 10px; }
.lmd-gal-colors label { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 13px; color: var(--fg-muted); }
.lmd-gal-colors input { flex: none; width: 34px; height: 30px; padding: 0; border: 1px solid var(--line); border-radius: 7px; background: none; }
.lmd-gal-sub { margin: 4px 0 0; font-size: 12.5px; font-weight: 600; letter-spacing: 0.03em; text-transform: uppercase; color: var(--fg-faint); }
.lmd-gal-mine { margin-top: 22px; }
.lmd-gal-mylist { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.lmd-gal-my { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; }
.lmd-gal-my > div { display: flex; flex: 1; flex-wrap: wrap; align-items: baseline; gap: 6px 8px; min-width: 0; }
.lmd-gal-my b { font-size: 13.5px; font-weight: 600; overflow-wrap: anywhere; }
.lmd-gal-my .lmd-link { flex: none; color: var(--accent); }
.lmd-gal-st-pending { background: var(--bg-soft); color: var(--fg-muted); }
.lmd-gal-st-rejected, .lmd-gal-st-removed { background: rgba(220, 38, 38, 0.12); color: #dc2626; }
.lmd-gal-why { flex-basis: 100%; margin: 0; font-size: 12.5px; color: var(--fg-muted); overflow-wrap: anywhere; }
.lmd-tpl-rm { margin-right: auto; color: var(--fg-muted); }
.lmd-tpl-rm[hidden] { display: none; }
@media (max-width: 640px) {
  .lmd-gal-bar .lmd-seg { flex: 1 1 100%; overflow-x: auto; }
  .lmd-gal-bar .lmd-seg button { flex: 1 0 auto; }
  .lmd-gal-bar .lmd-btn { flex: 1 1 100%; }
  .lmd-gal-list { grid-template-columns: minmax(0, 1fr); }
  .lmd-gal-two { grid-template-columns: minmax(0, 1fr); }
  .lmd-gal-colors { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lmd-gal-dlg { padding: 10px; }
  .lmd-gal-dlg .lmd-ask-card { padding: 18px 16px; max-height: calc(100vh - 20px - var(--lmd-kb, 0px)); }
  .lmd-gal-acts .lmd-btn { height: 36px; }
}
/* Herramienta JSON y YAML (jsonyaml.js): un bloque json o yaml como árbol. El árbol va antes del <pre>, que se
   esconde mientras el árbol está a la vista; al imprimir o exportar queda el bloque de código de siempre. */
.lmd-jy { margin: 0; border: 1px solid var(--line); border-radius: 9px; background: var(--bg-code); color: var(--fg); font: 13px/1.5 var(--lmd-mono); overflow: hidden; }
.lmd-jy[hidden] { display: none; }
.lmd-jy.lmd-jy-text { margin: 0 0 6px; }
.lmd-jy.lmd-jy-bad { margin: 6px 0 0; border: 0; background: transparent; }
.lmd-jy-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 4px; padding: 4px 6px 4px 12px; border-bottom: 1px solid var(--line); font: 12px/1.3 var(--lmd-font); color: var(--fg-faint); }
.lmd-jy-text .lmd-jy-bar { border-bottom: 0; }
.lmd-jy-lang { margin-right: auto; font-weight: 600; letter-spacing: .05em; }
.lmd-jy .lmd-jy-note { flex: 1 1 100%; margin: 0; padding: 0 0 3px; font: 12px/1.35 var(--lmd-font); color: var(--fg-muted); }
.lmd-jy-bad .lmd-jy-note { padding: 0; color: var(--danger, #dc2626); }
.lmd-jy-btn { display: inline-flex; align-items: center; justify-content: center; min-width: 28px; height: 28px; padding: 0 8px; border: 0; border-radius: 6px; background: transparent; color: var(--fg-muted); font: inherit; cursor: pointer; }
.lmd-jy-btn:hover { background: var(--accent-soft); color: var(--accent); }
.lmd-jy-btn[disabled] { opacity: .4; cursor: default; background: transparent; color: var(--fg-muted); }
.lmd-jy-btn[hidden] { display: none; }
.lmd-jy svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.lmd-jy-more svg circle { fill: currentColor; stroke: none; }
.markdown-body .lmd-jy-tree, .markdown-body .lmd-jy-tree ul { list-style: none; margin: 0; padding: 0; }
.markdown-body .lmd-jy-tree { max-height: 72vh; padding: 6px 4px; overflow: auto; overscroll-behavior: contain; }
.lmd-jy-tree[hidden] { display: none; }
.markdown-body .lmd-jy-tree li { margin: 0; outline: none; }
.lmd-jy-row { display: flex; align-items: baseline; gap: 5px; min-height: 26px; padding: 1px 4px 1px calc(4px + var(--jy-d, 0) * 16px); border-radius: 6px; }
.lmd-jy-row:hover { background: color-mix(in srgb, var(--fg) 6%, transparent); }
.lmd-jy-item[aria-selected="true"] > .lmd-jy-row { background: var(--accent-soft); }
.lmd-jy-item:focus-visible > .lmd-jy-row { outline: 2px solid var(--accent-fill); outline-offset: -2px; }
.lmd-jy-tw { flex: none; align-self: center; display: inline-grid; place-items: center; width: 16px; height: 16px; color: var(--fg-faint); cursor: pointer; transition: transform .12s; }
.lmd-jy-item[aria-expanded="true"] > .lmd-jy-row > .lmd-jy-tw { transform: rotate(90deg); }
.lmd-jy-k { flex: none; max-width: 60%; font-weight: 600; overflow-wrap: anywhere; white-space: pre-wrap; }
.lmd-jy-item[aria-expanded] > .lmd-jy-row > .lmd-jy-k, .lmd-jy-item[aria-expanded] > .lmd-jy-row > .lmd-jy-i, .lmd-jy-n { cursor: pointer; }
.lmd-jy-i, .lmd-jy-sep, .lmd-jy-n { flex: none; color: var(--fg-faint); }
.lmd-jy-sep { margin-left: -4px; }
.lmd-jy-v { min-width: 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.lmd-jy-string { color: var(--accent); }
.lmd-jy-number { color: var(--link); }
.lmd-jy-boolean { color: color-mix(in srgb, var(--danger, #dc2626) 72%, var(--fg)); }
.lmd-jy-null, .lmd-jy-alias { color: var(--fg-faint); font-style: italic; }
.lmd-jy-more { flex: none; align-self: center; display: inline-grid; place-items: center; width: 24px; height: 24px; margin-left: auto; padding: 0; border: 0; border-radius: 6px; background: transparent; color: var(--fg-faint); opacity: .3; cursor: pointer; }
.lmd-jy-row:hover > .lmd-jy-more, .lmd-jy-item[aria-selected="true"] > .lmd-jy-row > .lmd-jy-more, .lmd-jy-more:focus-visible { opacity: 1; }
.lmd-jy-more:hover { background: var(--accent-soft); color: var(--accent); }
.lmd-jy-in { flex: 1 1 auto; min-width: 0; max-width: 100%; margin: -2px 0; padding: 2px 6px; border: 1px solid var(--accent-fill); border-radius: 5px; background: var(--bg); color: var(--fg); font: inherit; outline: none; }
select.lmd-jy-in { flex: none; }
textarea.lmd-jy-in { resize: vertical; }
.lmd-jy-rest { padding-left: calc(24px + var(--jy-d, 0) * 16px); }
.lmd-jy-menu { position: fixed; z-index: 60; display: flex; flex-direction: column; min-width: 190px; max-width: calc(100vw - 16px); max-height: calc(100dvh - 16px); padding: 6px; overflow-y: auto; border: 1px solid var(--line); border-radius: 11px; background: var(--bg-soft); color: var(--fg); box-shadow: var(--shadow); font: 13.5px/1.3 var(--lmd-font); }
.lmd-jy-menu button { padding: 7px 9px; border: 0; border-radius: 6px; background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.lmd-jy-menu button:hover, .lmd-jy-menu button:focus-visible { background: var(--accent-soft); color: var(--accent); outline: none; }
.lmd-jy-menu button[aria-checked="true"] { font-weight: 600; color: var(--accent); }
.lmd-jy-menu button.lmd-jy-danger { color: var(--danger, #dc2626); }
.lmd-jy-menu button.lmd-jy-danger:hover, .lmd-jy-menu button.lmd-jy-danger:focus-visible { background: color-mix(in srgb, var(--danger, #dc2626) 14%, transparent); color: var(--danger, #dc2626); }
.lmd-jy-menu-label { margin: 6px 9px 2px; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--fg-faint); }
@media screen {
  .lmd-jy:not(.lmd-jy-text) ~ pre, .lmd-jy:not(.lmd-jy-text) ~ .lmd-src { display: none; }
  .lmd-jy:not(.lmd-jy-bad) ~ .lmd-code-copy, .lmd-jy:not(.lmd-jy-bad) ~ .lmd-code-lang { display: none; }
}
@media (pointer: coarse) {
  .lmd-jy-row { min-height: 36px; align-items: center; }
  .lmd-jy-btn { min-width: 36px; height: 36px; }
  .lmd-jy-more { width: 36px; height: 36px; opacity: .6; }
  .lmd-jy-menu button { min-height: 42px; }
  .lmd-jy-in { font-size: 16px; }
}
@media print { .lmd-jy, .lmd-jy-menu { display: none !important; } }
/* Un .txt: texto plano, tal cual está en el archivo. */
.markdown-body .lmd-plain { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; tab-size: 4; }
.lmd-kanban-off { display: block; margin: 6px 0 0; padding: 0; font-size: 12.5px; color: var(--fg-faint); text-align: left; }
.lmd-kanban-off:hover { color: var(--accent); }
@media print { .lmd-kanban-off { display: none; } }
/* Seguridad de la nube, en Ajustes → Nube: un hecho por renglón, con el dato técnico en chico. */
.lmd-sec { margin: 18px 0 0; padding-top: 14px; border-top: 1px solid var(--line); }
.lmd-sec h4 { margin: 0 0 10px; font-size: 14px; }
.lmd-sec ul { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 20px; margin: 0; padding: 0; list-style: none; }
.lmd-sec li { display: flex; gap: 10px; min-width: 0; }
.lmd-sec li > div { min-width: 0; }
.lmd-sec-ico { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--accent-soft); color: var(--accent); }
.lmd-sec-ico svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.lmd-sec li b { display: block; font-size: 13.5px; font-weight: 600; color: var(--fg); }
.lmd-sec li p { margin: 2px 0 0; font-size: 13px; line-height: 1.45; color: var(--fg-muted); overflow-wrap: anywhere; }
.lmd-sec li small { display: block; margin-top: 4px; font-size: 11.5px; color: var(--fg-faint); overflow-wrap: anywhere; }
.lmd-sec li p.lmd-sec-count { color: var(--fg); font-weight: 600; }
.lmd-sec-act .lmd-link, .lmd-dlg-more .lmd-link { padding: 0; color: var(--accent); font-size: 13px; text-decoration: underline; }
.lmd-sec-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 6px 0 0; font-size: 12.5px; color: var(--fg-muted); }
.lmd-sec-pick > span { flex: 1 0 100%; }
.lmd-sec-pick .lmd-btn { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 5px 10px; font-size: 12.5px; }
.lmd-sec-pick .lmd-btn span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lmd-sec-pick .lmd-btn svg { flex: none; width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.lmd-sec-foot { margin: 12px 0 0; font-size: 12.5px; color: var(--fg-faint); }
.lmd-sec-foot a { color: var(--accent); }
.lmd-ask-card p.lmd-dlg-more { margin: -8px 0 18px; font-size: 13px; color: var(--fg-muted); }
@media (max-width: 720px), (max-height: 500px) and (pointer: coarse) {
  .lmd-sec ul { grid-template-columns: minmax(0, 1fr); }
  .lmd-sec-act .lmd-link { min-height: 40px; }
  .lmd-sec-pick .lmd-btn { min-height: 40px; }
}

/* Espacio del equipo protegido con contraseña: su renglón en el explorador y su bloque en Ajustes, Plan. */
.lmd-team-lock { padding: 2px 8px 6px 30px; }
.lmd-team-lock.lmd-team-shut { color: var(--fg-muted); }
.lmd-team-lock .lmd-vault-ico svg { width: 14px; height: 14px; }
.lmd-team-lock .lmd-team-more { display: inline-flex; align-items: center; text-decoration: none; padding: 1px 4px; }
.lmd-team-lock .lmd-team-more svg { width: 15px; height: 15px; }
.lmd-team-lock .lmd-team-ai { display: inline-flex; align-items: center; gap: 4px; flex-basis: 100%; color: var(--accent); }
.lmd-team-lock .lmd-team-ai svg { width: 13px; height: 13px; flex: none; }
.lmd-team-gone { margin: 6px 0 12px; padding: 10px 12px; border: 1px solid var(--line); border-left: 3px solid var(--accent-fill); border-radius: 8px; background: var(--bg-soft); }
.lmd-team-gone p { margin: 0 0 6px; }
.lmd-team-gone .lmd-acct-actions { margin-top: 8px; flex-wrap: wrap; align-items: center; }
.lmd-team .lmd-team-ai { margin: 10px 0 4px; }
.lmd-team .lmd-team-vault { flex-wrap: wrap; }
.lmd-team .lmd-team-lost { display: block; margin: 10px 0 0; padding: 0; font-size: 13px; color: var(--fg-muted); text-align: left; }
.lmd-team .lmd-team-lost:hover { color: var(--accent); }
@media (max-width: 720px) {
  .lmd-team-lock { padding-bottom: 8px; font-size: 12.5px; }
  .lmd-team-lock .lmd-team-more { min-width: 32px; min-height: 32px; justify-content: center; }
  .lmd-team .lmd-team-vault .lmd-btn, .lmd-team-gone .lmd-btn { flex: 1 1 100%; min-height: 40px; }
  .lmd-team .lmd-team-lost { min-height: 40px; }
}
@media print { .lmd-team-lock { display: none !important; } }
/* ---------- Herramienta: modo presentación (present.js) ---------- */
.lmd-pres { position: fixed; inset: 0; z-index: 90; background: var(--bg); color: var(--fg); font-family: var(--lmd-font); overflow: hidden; outline: none; touch-action: pan-y; }
.lmd-pres * { box-sizing: border-box; }
.lmd-presenting, .lmd-presenting body { overflow: hidden !important; }
.lmd-pres-stage { position: absolute; inset: 0; overflow: hidden; }
.lmd-pres-slide { position: absolute; left: 50%; top: 50%; display: flex; flex-direction: column; justify-content: center; padding: 56px 72px; font-size: 26px; line-height: 1.45; transform-origin: center; color: var(--fg); text-align: left; }
.lmd-pres-slide > * { flex: none; max-width: 100%; }
.lmd-pres-slide > :first-child { margin-top: 0; } .lmd-pres-slide > :last-child { margin-bottom: 0; }
.lmd-pres-slide h1 { font-size: 2em; border: 0; padding: 0; margin: 0 0 0.5em; }
.lmd-pres-slide h2 { font-size: 1.6em; border: 0; padding: 0; margin: 0 0 0.6em; }
.lmd-pres-slide img { max-height: calc(var(--lmd-pres-h, 630px) * 0.7); width: auto; object-fit: contain; }
.lmd-pres-slide svg { max-width: 100%; height: auto; }
.lmd-pres-slide table { width: auto; max-width: 100%; }
.lmd-pres-slide pre { font-size: 0.72em; }
.lmd-pres-cover { align-items: center; text-align: center; }
.lmd-pres-cover h1 { font-size: 2.7em; } .lmd-pres-cover h2 { font-size: 2.1em; }
.lmd-pres-cover p { color: var(--fg-muted); }
.lmd-pres-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: transparent; pointer-events: none; }
.lmd-pres-progress i { display: block; height: 100%; background: var(--accent-fill, var(--accent)); opacity: 0.75; transition: width .18s ease-out; }
.lmd-pres-bar { position: absolute; right: 14px; bottom: 14px; display: flex; align-items: center; gap: 2px; padding: 4px 6px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-soft); box-shadow: var(--shadow); transition: opacity .2s; }
.lmd-pres-bar .lmd-icon-btn[aria-pressed=true] { background: var(--accent-soft); color: var(--accent); }
.lmd-pres-bar .lmd-icon-btn:disabled { opacity: 0.35; cursor: default; }
.lmd-pres-bar [data-pres=notes]:not(.lmd-pres-has) { opacity: 0.45; }
.lmd-pres-count { min-width: 54px; text-align: center; font-size: 12.5px; color: var(--fg-muted); font-variant-numeric: tabular-nums; }
.lmd-pres-gap { width: 1px; height: 18px; margin: 0 4px; background: var(--line); }
@media (hover: hover) and (pointer: fine) { .lmd-pres-idle .lmd-pres-bar:not(:hover):not(:focus-within) { opacity: 0; } .lmd-pres-idle { cursor: none; } }
.lmd-pres-notes { position: absolute; left: 14px; bottom: 14px; max-width: min(46vw, 560px); max-height: 30vh; overflow: auto; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-soft); color: var(--fg); font-size: 14px; line-height: 1.5; white-space: pre-wrap; box-shadow: var(--shadow); }
.lmd-pres-notes[hidden], .lmd-pres-grid[hidden], .lmd-pres-laser[hidden] { display: none; }
.lmd-pres-laser { position: absolute; left: -9px; top: -9px; width: 18px; height: 18px; border-radius: 50%; background: #ff2d2d; box-shadow: 0 0 0 4px rgba(255, 45, 45, 0.28), 0 0 18px 6px rgba(255, 45, 45, 0.5); pointer-events: none; z-index: 3; }
.lmd-pres-lasing, .lmd-pres-lasing .lmd-pres-stage * { cursor: none; }
.lmd-pres-grid { position: absolute; inset: 0; z-index: 2; overflow: auto; padding: 28px 28px 84px; background: var(--bg-side); display: flex; flex-wrap: wrap; align-content: flex-start; justify-content: center; gap: 18px; }
.lmd-pres-thumb { position: relative; padding: 0; border: 2px solid var(--line); border-radius: 10px; background: var(--bg); overflow: hidden; cursor: pointer; font: inherit; color: inherit; }
.lmd-pres-thumb.lmd-on { border-color: var(--accent); }
.lmd-pres-thumb:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.lmd-pres-thumb-win { position: relative; display: block; overflow: hidden; pointer-events: none; }
.lmd-pres-thumb-n { position: absolute; left: 6px; bottom: 5px; padding: 0 6px; border-radius: 6px; background: var(--bg-soft); color: var(--fg-muted); font-size: 11.5px; line-height: 18px; }
.lmd-pres-over .lmd-pres-bar { z-index: 4; opacity: 1; }
@media (max-width: 760px) {
  .lmd-pres-slide { padding: 34px 30px; font-size: 24px; }
  .lmd-pres-bar { left: 8px; right: 8px; bottom: max(8px, env(safe-area-inset-bottom, 0px)); justify-content: space-between; gap: 0; }
  .lmd-pres-bar [data-pres=laser], .lmd-pres-gap { display: none; }
  .lmd-pres-notes { left: 8px; right: 8px; bottom: 64px; max-width: none; }
  .lmd-pres-grid { padding: 14px 10px 84px; gap: 10px; }
}
/* El PDF de las diapositivas: fuera de la impresión la copia se mide pero no se ve. */
.lmd-pres-print { position: absolute; left: 0; top: 0; width: 1280px; visibility: hidden; pointer-events: none; z-index: -1; }
.lmd-pres-page { position: relative; width: 1280px; height: 720px; overflow: hidden; background: var(--bg); }
@media print {
  .lmd-pres { display: none !important; }
  .lmd-pres-printing body > :not(.lmd-pres-print) { display: none !important; }
  .lmd-pres-printing .lmd-pres-print { position: static; visibility: visible; }
  .lmd-pres-printing, .lmd-pres-printing body { background: var(--bg) !important; margin: 0 !important; padding: 0 !important; overflow: visible !important; height: auto !important; }
  .lmd-pres-page { break-after: page; page-break-after: always; break-inside: avoid; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .lmd-pres-page:last-child { break-after: auto; page-break-after: auto; }
}
@media not print { .lmd-pres-print { height: 0; overflow: hidden; } }

/* ---------- Herramienta: nota diaria (daily.js) ---------- */
.lmd-daily-nav { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 48px 0; font: 13px/1.3 var(--lmd-font); color: var(--fg-muted); }
.lmd-centered .lmd-daily-nav { max-width: calc(var(--lmd-content-w) + 96px); margin: 0 auto; }
.lmd-daily-nav + .lmd-article { padding-top: 16px; }
.lmd-daily-nav .lmd-link { display: inline-flex; align-items: center; gap: 4px; padding: 4px 6px; border-radius: 7px; color: var(--fg-muted); text-decoration: none; }
.lmd-daily-nav .lmd-link:hover { background: var(--bg-soft); color: var(--fg); }
.lmd-daily-nav svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.lmd-daily-nav .lmd-daily-now { color: var(--fg); font-weight: 600; gap: 6px; }
.lmd-nodoc .lmd-daily-nav { display: none; }
.lmd-daily-cal .lmd-ask-card { width: min(340px, 100%); }
.lmd-daily-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.lmd-daily-head h3 { margin: 0; font-size: 15.5px; }
.lmd-daily-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; margin-bottom: 16px; touch-action: pan-y; }
.lmd-daily-wd { padding: 4px 0; text-align: center; font-size: 11.5px; color: var(--fg-faint); }
.lmd-daily-day { position: relative; aspect-ratio: 1; min-height: 36px; padding: 0; border: 1px solid transparent; border-radius: 9px; background: transparent; color: var(--fg); font: inherit; font-size: 13.5px; font-variant-numeric: tabular-nums; cursor: pointer; }
.lmd-daily-day:hover { background: var(--bg-soft); }
.lmd-daily-day:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.lmd-daily-day.lmd-has::after { content: ""; position: absolute; left: 50%; bottom: 4px; width: 5px; height: 5px; margin-left: -2.5px; border-radius: 50%; background: var(--accent-fill, var(--accent)); }
.lmd-daily-day.lmd-has { font-weight: 650; }
.lmd-daily-day.lmd-today { border-color: var(--line); }
.lmd-daily-day.lmd-on { background: var(--accent-soft); border-color: var(--accent); }
.lmd-home-actions .lmd-btn[data-daily] svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
@media (max-width: 760px) { .lmd-daily-nav { padding: 10px 16px 0; } }
@media print { .lmd-daily-nav { display: none !important; } }

/* ---------- Herramienta: mapa de enlaces (linkmap.js) ---------- */
.lmd-zone-btn.lmd-daily-btn svg, .lmd-zone-btn.lmd-map-btn svg { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.lmd-map .lmd-ask-card.lmd-map-card { display: flex; flex-direction: column; width: min(1180px, 100%); height: min(820px, 100%); max-height: 100%; padding: 0; overflow: hidden; }
.lmd-map { padding: 20px; align-items: center; }
.lmd-map-head { display: flex; align-items: center; gap: 10px; padding: 12px 12px 12px 18px; border-bottom: 1px solid var(--line); }
.lmd-map-head h3 { margin: 0 auto 0 0; font-size: 15.5px; white-space: nowrap; }
.lmd-map-head .lmd-map-q { flex: 0 1 220px; min-width: 90px; margin: 0; }
.lmd-map-head select { flex: 0 1 190px; min-width: 0; width: auto; }
.lmd-map-lone { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--fg-muted); white-space: nowrap; cursor: pointer; }
.lmd-map-body { position: relative; flex: 1; min-height: 0; background: var(--bg-soft); }
.lmd-map-canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; outline: none; }
.lmd-ask-card p.lmd-map-empty { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; padding: 20px; text-align: center; color: var(--fg-muted); pointer-events: none; }
.lmd-ask-card p.lmd-map-empty[hidden] { display: none; }
.lmd-map-zoom { position: absolute; right: 10px; bottom: 10px; display: flex; flex-direction: column; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); }
.lmd-map-zoom svg, .lmd-map-head .lmd-icon-btn svg { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.lmd-map-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 18px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--fg-muted); }
.lmd-map-tip { text-align: right; }
@media (max-width: 760px) {
  .lmd-map { padding: 0; }
  .lmd-map .lmd-ask-card.lmd-map-card { width: 100%; height: 100%; border: 0; border-radius: 0; padding-top: env(safe-area-inset-top, 0px); }
  .lmd-map-head { flex-wrap: wrap; gap: 8px; padding: 10px 8px 10px 14px; }
  .lmd-map-head h3 { order: 0; } .lmd-map-head [data-map=close] { order: 1; }
  .lmd-map-head .lmd-map-q { order: 2; flex: 1 1 100%; }
  .lmd-map-head select { order: 3; flex: 1 1 45%; }
  .lmd-map-lone { order: 4; }
  .lmd-map-tip { display: none; }
  .lmd-map-foot { padding-bottom: max(8px, env(safe-area-inset-bottom, 0px)); }
}
/* "Enlaces a esta nota": bajo la nota abierta, que le cede su margen de abajo. */
.lmd-article:has(+ .lmd-back) { padding-bottom: 28px; }
.lmd-back { padding: 0 48px 120px; font: 14px/1.5 var(--lmd-font); color: var(--fg); }
.lmd-centered .lmd-back { max-width: calc(var(--lmd-content-w) + 96px); margin: 0 auto; }
.lmd-article[hidden] + .lmd-back, .lmd-nodoc .lmd-back { display: none; }
.lmd-back summary { padding: 10px 0; border-top: 1px solid var(--line); color: var(--fg-muted); font-size: 13px; font-weight: 600; cursor: pointer; }
.lmd-back-n { margin-left: 4px; padding: 1px 7px; border-radius: 9px; background: var(--bg-soft); font-weight: 500; font-variant-numeric: tabular-nums; }
.lmd-back ul { margin: 2px 0 0; padding: 0; list-style: none; }
.lmd-back li { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 4px 0; }
.lmd-back li a { color: var(--link); text-decoration: none; overflow-wrap: anywhere; }
.lmd-back li a:hover { text-decoration: underline; }
.lmd-back li span { flex: none; max-width: 45%; color: var(--fg-faint); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 760px) { .lmd-back { padding: 0 16px 100px; } }
@media print { .lmd-back, .lmd-map { display: none !important; } }

/* Con más herramientas, las tarjetas van de a dos en pantalla ancha. */
@media (min-width: 761px) {
  .lmd-tl-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
  .lmd-tl-list { gap: 6px; } .lmd-tl-lead { margin-bottom: 8px; }
  .lmd-tl-list .lmd-tl-main p { font-size: 12.5px; line-height: 1.35; margin-top: 1px; }
  .lmd-tl-list .lmd-tl-card { height: 100%; align-content: start; padding: 7px 12px; grid-template-columns: 32px minmax(0, 1fr) auto; gap: 4px 10px; }
}

/* Equipo: papeles, ajustes que decide quien administra, tokens del equipo y registro de actividad. */
.lmd-scope { color: var(--fg-faint); }
.lmd-two > .lmd-scope { margin-top: -10px; font-size: 12.5px; line-height: 1.35; }
.lmd-plans-guest { grid-template-columns: minmax(0, 1fr); }
.lmd-plans-guest .lmd-plan .lmd-hint { margin: 0; }
.lmd-managed { display: flex; align-items: center; gap: 6px; margin: 0 0 8px; font-size: 12.5px; color: var(--fg-muted); }
.lmd-managed::before { content: ''; flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--fg-faint); }
.lmd-team-locked .lmd-check, .lmd-team-locked .lmd-pick { cursor: default; opacity: 0.7; }
.lmd-team select, .lmd-tlog select, .lmd-tlog input[type=date], .lmd-team-pol input[type=text], .lmd-team-tok input { height: 34px; min-width: 0; padding: 0 9px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg-soft); color: var(--fg); font: inherit; font-size: 13px; outline: none; }
.lmd-team select:focus, .lmd-tlog select:focus, .lmd-tlog input[type=date]:focus, .lmd-team-pol input[type=text]:focus, .lmd-team-tok input:focus { border-color: var(--accent-fill); }
.lmd-team select:disabled, .lmd-team-pol input:disabled { cursor: default; }
.lmd-team-acts { align-items: center; }
.lmd-team-acts select { height: 30px; font-size: 12.5px; }
.lmd-team-invite select { flex: none; height: 36px; }
.lmd-team-pol .lmd-check { margin-bottom: 4px; }
.lmd-team-pol .lmd-pick { margin-top: 10px; }
.lmd-team-pol .lmd-pick span { flex: 0 0 190px; }
.lmd-team-pol .lmd-pick select, .lmd-team-pol .lmd-pick input { flex: 0 1 220px; }
.lmd-team-tpl b { font-weight: 600; font-size: 13px; }
.lmd-team-tpl .lmd-btn { margin-left: auto; }
.lmd-team-tok { margin-top: 10px; }
.lmd-team-tok input { flex: 1 1 0; height: 36px; }
.lmd-team .lmd-field { margin-top: 8px; }
.lmd-team-tpl-ask .lmd-ask-card { width: min(620px, 100%); }
.lmd-team-tpl-text { display: block; width: 100%; box-sizing: border-box; margin: 0 0 16px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg-soft); color: var(--fg); font: 13px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; resize: vertical; outline: none; }
.lmd-team-tpl-text:focus { border-color: var(--accent-fill); }
.lmd-ask-card.lmd-tlog { width: min(860px, 100%); display: flex; flex-direction: column; max-height: min(680px, 100%); }
.lmd-tlog-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 10px; }
.lmd-tlog-filters select { flex: 1 1 160px; }
.lmd-tlog-filters label { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--fg-muted); }
.lmd-tlog-list { flex: 1 1 auto; min-height: 120px; margin: 0 0 10px; padding: 0; list-style: none; overflow: auto; scrollbar-width: thin; border-top: 1px solid var(--line); }
.lmd-tlog-list li { display: grid; grid-template-columns: 150px minmax(0, 1.1fr) minmax(0, 0.9fr) minmax(0, 1.6fr); gap: 4px 12px; align-items: baseline; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.lmd-tlog-list time, .lmd-tlog-list small { color: var(--fg-muted); font-size: 12.5px; }
.lmd-tlog-list b { font-weight: 600; }
.lmd-tlog-list b, .lmd-tlog-list small { min-width: 0; overflow-wrap: anywhere; }
.lmd-tlog-list li.lmd-tlog-none { display: block; padding: 18px 0; color: var(--fg-muted); }
.lmd-ask-card.lmd-tlog p.lmd-hint { margin: 0 0 12px; font-size: 12.5px; }
.lmd-tlog .lmd-ask-actions { flex-wrap: wrap; }
@media (max-width: 720px) {
  .lmd-team-list li { flex-wrap: wrap; }
  .lmd-team-acts select, .lmd-team-invite select { height: 40px; font-size: 16px; }
  .lmd-team-invite select { flex: 1 1 auto; }
  .lmd-team-pol .lmd-pick { flex-wrap: wrap; gap: 6px; }
  .lmd-team-pol .lmd-pick span { flex: 1 1 100%; }
  .lmd-team-pol .lmd-pick select, .lmd-team-pol .lmd-pick input { flex: 1 1 100%; height: 40px; font-size: 16px; }
  .lmd-team-tok { flex-wrap: wrap; }
  .lmd-team-tok input { flex: 1 1 100%; height: 40px; font-size: 16px; }
  .lmd-team-tpl-text { font-size: 16px; }
  .lmd-tlog-filters select, .lmd-tlog-filters label { flex: 1 1 100%; }
  .lmd-tlog-filters select, .lmd-tlog-filters input[type=date] { height: 40px; font-size: 16px; }
  .lmd-tlog-filters label input { flex: 1; }
  .lmd-tlog-list li { grid-template-columns: minmax(0, 1fr); gap: 1px; }
  .lmd-tlog .lmd-ask-actions .lmd-btn { flex: 1 1 auto; min-height: 40px; }
}
/* ---------- Tableros: atributos de las tarjetas, detalle y ancho ---------- */
/* El tablero se desliza de costado con una barra fina del color del tema; los bordes se desvanecen donde hay más. */
.lmd-board { box-sizing: border-box; max-width: none; scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--accent-fill) 55%, transparent) transparent; overscroll-behavior-x: contain; }
.lmd-board::-webkit-scrollbar { height: 6px; }
.lmd-board::-webkit-scrollbar-track { background: transparent; }
.lmd-board::-webkit-scrollbar-thumb { border-radius: 999px; background: color-mix(in srgb, var(--accent-fill) 55%, transparent); }
.lmd-board.lmd-more-r { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 34px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 34px), transparent); }
.lmd-board.lmd-more-l { -webkit-mask-image: linear-gradient(to left, #000 calc(100% - 34px), transparent); mask-image: linear-gradient(to left, #000 calc(100% - 34px), transparent); }
.lmd-board.lmd-more-l.lmd-more-r { -webkit-mask-image: linear-gradient(to right, transparent, #000 34px, #000 calc(100% - 34px), transparent); mask-image: linear-gradient(to right, transparent, #000 34px, #000 calc(100% - 34px), transparent); }
.lmd-board.lmd-panning { cursor: grabbing; user-select: none; }
.lmd-table { scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--accent-fill) 55%, transparent) transparent; }
.lmd-board-end { flex: 0 0 auto; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.lmd-board-menu, .lmd-card-open { display: inline-grid; place-items: center; width: 26px; height: 26px; padding: 0; border: 0; border-radius: 6px; background: transparent; color: var(--fg-faint); cursor: pointer; flex: none; }
.lmd-board-menu:hover, .lmd-card-open:hover { background: var(--bg-soft); color: var(--accent); }
.lmd-board-menu svg, .lmd-card-open svg { width: 15px; height: 15px; fill: currentColor; stroke: none; }
.lmd-readonly .lmd-board-menu { display: none; }
.lmd-card { cursor: pointer; }
.lmd-card-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.lmd-card-open { width: 20px; height: 20px; margin: 0 -2px 0 0; opacity: 0; }
.lmd-card:hover .lmd-card-open, .lmd-card-open:focus-visible { opacity: 1; }
.lmd-card-meta { display: flex; flex-wrap: wrap; gap: 4px; }
.lmd-chip { display: inline-block; max-width: 100%; padding: 1px 7px; border: 1px solid var(--line); border-radius: 999px; background: var(--bg-soft); color: var(--fg-muted); font: inherit; font-size: 0.82em; line-height: 1.5; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lmd-chip-late { border-color: color-mix(in srgb, #dc2626 45%, var(--line)); color: #dc2626; }
.lmd-chip-add { cursor: pointer; }
.lmd-chip-add:hover { border-color: var(--accent-fill); color: var(--accent); }
.lmd-cd-card { width: min(480px, 100%); max-height: calc(100dvh - 40px); overflow: auto; }
.lmd-cd select, .lmd-au select, .lmd-cd-attr input, .lmd-cd-new input { box-sizing: border-box; height: 36px; padding: 0 9px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg-soft); color: var(--fg); font: inherit; outline: none; }
.lmd-cd select:focus, .lmd-au select:focus, .lmd-cd-attr input:focus, .lmd-cd-new input:focus { border-color: var(--accent-fill); }
.lmd-cd-row { display: flex; align-items: flex-end; gap: 14px; }
.lmd-cd-row .lmd-dlg-field { flex: 1; min-width: 0; }
.lmd-cd-row select { display: block; width: 100%; }
.lmd-cd-done { margin: 0 0 14px; min-height: 36px; align-items: center; }
.lmd-cd-attrs { display: grid; gap: 8px; margin-bottom: 10px; }
.lmd-cd-attr { display: grid; grid-template-columns: minmax(70px, 34%) minmax(0, 1fr) auto auto; align-items: center; gap: 8px; }
.lmd-cd-key { font-size: 13px; color: var(--fg-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lmd-cd-attr input, .lmd-cd-attr select { width: 100%; min-width: 0; }
.lmd-cd-see { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 6px; color: var(--fg-faint); cursor: pointer; }
.lmd-cd-see input { position: absolute; opacity: 0; pointer-events: none; }
.lmd-cd-see svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; opacity: 0.45; }
.lmd-cd-see input:checked + span svg { opacity: 1; color: var(--accent); }
.lmd-cd-see input:focus-visible + span { outline: 2px solid var(--accent-fill); outline-offset: 2px; border-radius: 4px; }
.lmd-cd-see span { display: grid; }
.lmd-cd-rm { display: inline-grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 6px; background: transparent; color: var(--fg-faint); cursor: pointer; }
.lmd-cd-rm:hover { background: var(--bg-soft); color: #dc2626; }
.lmd-cd-rm svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.lmd-cd-sug { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 12px; font-size: 13px; color: var(--fg-muted); }
.lmd-cd-new { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.lmd-cd-new[hidden] { display: none; }
.lmd-cd-new input { flex: 1 1 130px; min-width: 0; }
.lmd-ask-card p.lmd-cd-dates { margin: 0 0 16px; font-size: 12.5px; color: var(--fg-faint); }
.lmd-cd .lmd-ask-actions .lmd-cd-del { margin-right: auto; color: #dc2626; }
.lmd-cd-pick { display: grid; gap: 4px; margin-bottom: 14px; }

/* ---------- Ajustes de la página ---------- */
.lmd-pw-wide { --lmd-content-w: var(--lmd-page-wide, 1500px) !important; }
.lmd-pw-full .lmd-article, .lmd-pw-full .lmd-raw { max-width: none; }
/* Los tres anchos se distinguen siempre. Donde el ancho normal ya llenaría la zona de lectura (una ventana angosta,
   o la barra lateral abierta), la normal y la ancha dejan margen a los lados y la completa va de borde a borde. */
@media (min-width: 821px) {
  .lmd-centered .lmd-article, .lmd-centered .lmd-raw, .lmd-centered .lmd-daily-nav, .lmd-centered .lmd-back { max-width: min(calc(var(--lmd-content-w) + 96px), 84%); }
  .lmd-centered.lmd-pw-wide .lmd-article, .lmd-centered.lmd-pw-wide .lmd-raw, .lmd-centered.lmd-pw-wide .lmd-daily-nav, .lmd-centered.lmd-pw-wide .lmd-back { max-width: min(calc(var(--lmd-content-w) + 96px), 92%); }
  .lmd-centered.lmd-pw-full .lmd-article, .lmd-centered.lmd-pw-full .lmd-raw, .lmd-centered.lmd-pw-full .lmd-daily-nav, .lmd-centered.lmd-pw-full .lmd-back { max-width: none; }
}
/* El número de un título numerado: texto de verdad (se elige y se copia), que no se edita ni se guarda. */
.lmd-hnum { color: var(--fg-faint); font-weight: 500; }
.lmd-ask-card p.lmd-pg-note { margin: -6px 0 14px; font-size: 13px; }
.lmd-page-btn svg { fill: none; }
.lmd-ask-card p.lmd-pg-lead { margin: 0 0 14px; font-size: 13px; }
.lmd-pg-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 0 0 14px; }
.lmd-pg-row > span { font-size: 14px; }
.lmd-pg-seg { display: inline-flex; padding: 2px; border: 1px solid var(--line); border-radius: 9px; background: var(--bg-soft); }
.lmd-pg-seg button { min-height: 30px; padding: 0 12px; border: 0; border-radius: 7px; background: transparent; color: var(--fg-muted); font: inherit; font-size: 13px; cursor: pointer; }
.lmd-pg-seg button[aria-checked="true"] { background: var(--bg); color: var(--fg); box-shadow: 0 1px 2px rgba(0, 0, 0, .18); }
.lmd-pg-seg button:disabled { cursor: default; opacity: 0.6; }
.lmd-pg label.lmd-pg-row { cursor: pointer; }
.lmd-pg label.lmd-pg-row input { width: 18px; height: 18px; margin: 0; accent-color: var(--accent-fill); }
.lmd-page-nudge { position: fixed; left: 50%; bottom: 52px; transform: translateX(-50%); z-index: 55; display: flex; align-items: center; gap: 12px; max-width: calc(100vw - 24px); padding: 8px 10px 8px 14px; border: 1px solid var(--line); border-radius: 11px; background: var(--bg); box-shadow: var(--shadow); font: 13.5px/1.35 var(--lmd-font); color: var(--fg); }
.lmd-page-nudge .lmd-btn { padding: 5px 11px; font-size: 13px; white-space: nowrap; }
.lmd-page-nudge .lmd-link { white-space: nowrap; }

/* ---------- Automatizaciones ---------- */
.lmd-au-list { margin: 0; padding: 0; list-style: none; }
.lmd-au-item { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.lmd-au-item > div:first-child { display: grid; gap: 2px; min-width: 0; color: var(--fg-muted); }
.lmd-au-item b { color: var(--fg); font-weight: 600; overflow-wrap: anywhere; }
.lmd-au-item span { overflow-wrap: anywhere; }
.lmd-au-dest { font: 12px var(--lmd-mono); color: var(--fg-faint); }
.lmd-au-off b { color: var(--fg-muted); }
.lmd-au-warn { color: #b45309; }
.lmd-au-acts { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 2px 10px; flex: 0 0 auto; max-width: 46%; }
.lmd-au-acts button { padding: 2px 0; border: 0; background: none; color: var(--fg-muted); font: inherit; font-size: 12.5px; cursor: pointer; }
.lmd-au-acts button:hover { color: var(--accent); }
.lmd-au-acts button[data-ha=rm]:hover, .lmd-au-acts button[data-ia=rm]:hover { color: #dc2626; }
.lmd-au-docs { text-decoration: none; display: inline-flex; align-items: center; }
.lmd-au-space { margin: 0 0 6px; }
.lmd-au .lmd-dlg-card { width: min(500px, 100%); max-height: calc(100dvh - 40px); overflow: auto; }
.lmd-au-log .lmd-dlg-card { width: min(620px, 100%); }
.lmd-ask-card p.lmd-au-step { margin: -4px 0 14px; font-size: 13px; color: var(--fg-faint); }
.lmd-ask-card p.lmd-au-tip { margin: -6px 0 14px; font-size: 13px; }
.lmd-ask-card p.lmd-au-result { margin: 12px 0 0; font-size: 13px; color: #dc2626; }
.lmd-ask-card p.lmd-au-result.lmd-acct-done { color: var(--accent); }
.lmd-au-body { margin-bottom: 14px; }
.lmd-au-opt { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; min-height: 40px; padding: 4px 0; cursor: pointer; }
.lmd-au-opt input[type=radio] { margin: 0; accent-color: var(--accent-fill); }
.lmd-au-opt select { flex: 1 1 180px; min-width: 0; }
.lmd-au-group { margin: 0 0 12px; padding: 0; border: 0; }
.lmd-au-group legend { padding: 0; margin-bottom: 6px; font-size: 12.5px; font-weight: 600; color: var(--fg-muted); }
.lmd-au-group .lmd-check { margin-bottom: 6px; }
.lmd-au-fmt { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.lmd-au-fmt button { min-height: 34px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg-soft); color: var(--fg-muted); font: inherit; font-size: 13px; cursor: pointer; }
.lmd-au-fmt button[aria-checked="true"] { border-color: var(--accent-fill); background: var(--accent-soft); color: var(--accent); }
.lmd-au .lmd-dlg-field select { display: block; width: 100%; }
.lmd-au .lmd-ask-actions [hidden] { display: none; }
.lmd-au-rows { max-height: 50vh; overflow: auto; margin-bottom: 16px; scrollbar-width: thin; }
.lmd-au-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.lmd-au-table th, .lmd-au-table td { padding: 6px 8px 6px 0; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.lmd-au-table th { color: var(--fg-faint); font-weight: 600; }
.lmd-au-failed td:nth-child(3) { color: #dc2626; }
@media (max-width: 720px), (max-height: 500px) and (pointer: coarse) {
  /* Con el dedo: las columnas encajan al deslizar, y los botones chicos se ven siempre. */
  .lmd-board { scroll-snap-type: x mandatory; scroll-padding-left: 2px; }
  .lmd-col { flex-basis: min(82vw, 300px); scroll-snap-align: start; }
  .lmd-card-open, .lmd-board-menu { opacity: 1; width: 32px; height: 32px; }
  .lmd-cd-attr { grid-template-columns: minmax(0, 1fr) auto auto; }
  .lmd-cd-key { grid-column: 1 / -1; }
  .lmd-cd-row { flex-direction: column; align-items: stretch; gap: 0; }
  .lmd-cd select, .lmd-au select, .lmd-cd-attr input, .lmd-cd-new input { height: 42px; font-size: 16px; }
  .lmd-cd-see, .lmd-cd-rm { width: 40px; height: 40px; }
  .lmd-chip-add { min-height: 34px; padding: 0 12px; }
  .lmd-au-item { flex-direction: column; }
  .lmd-au-acts { max-width: none; justify-content: flex-start; gap: 4px 16px; }
  .lmd-au-acts button { min-height: 36px; }
  .lmd-au-opt { min-height: 44px; }
  .lmd-au-fmt button, .lmd-pg-seg button { min-height: 40px; }
  .lmd-pg-row { flex-wrap: wrap; }
  .lmd-page-nudge { bottom: calc(64px + env(safe-area-inset-bottom, 0px)); flex-wrap: wrap; justify-content: flex-end; }
  .lmd-page-nudge span { flex: 1 1 100%; }
}
@media print { .lmd-board-menu, .lmd-card-open, .lmd-page-nudge { display: none !important; } .lmd-board { width: auto !important; margin-left: 0 !important; -webkit-mask-image: none !important; mask-image: none !important; } }

/* Permiso para guardar: la carpeta del archivo, para pegarla en la ventana del navegador. */
.lmd-ask-path { display: flex; align-items: center; gap: 8px; margin: 10px 0 4px; }
.lmd-ask-path code { flex: 1 1 auto; min-width: 0; padding: 7px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg-soft); font-size: 12.5px; overflow-wrap: anywhere; user-select: all; }
.lmd-ask-path .lmd-btn { flex: none; }
.lmd-ask-path-hint { margin: 0 0 12px; }
/* ---------- Temas incluidos (theme.js) ---------- */
/* Un tema incluido pinta las variables de color desde su tabla y deja la clase lmd-themed en <html>.
   Acá va lo que no era una variable: la selección, la sintaxis del código y la impresión. */
.lmd-themed ::selection { background: var(--sel); color: var(--fg); }
html.lmd-themed .hljs, html.lmd-themed .hljs .hljs-subst, html.lmd-themed .hljs .hljs-emphasis, html.lmd-themed .hljs .hljs-strong { color: var(--fg); }
html.lmd-themed .hljs .hljs-doctag, html.lmd-themed .hljs .hljs-keyword, html.lmd-themed .hljs .hljs-template-tag, html.lmd-themed .hljs .hljs-template-variable, html.lmd-themed .hljs .hljs-type, html.lmd-themed .hljs .hljs-variable.language_ { color: var(--syn-k); }
html.lmd-themed .hljs .hljs-title, html.lmd-themed .hljs .hljs-title.class_, html.lmd-themed .hljs .hljs-title.class_.inherited__, html.lmd-themed .hljs .hljs-title.function_ { color: var(--syn-f); }
html.lmd-themed .hljs .hljs-attr, html.lmd-themed .hljs .hljs-attribute, html.lmd-themed .hljs .hljs-literal, html.lmd-themed .hljs .hljs-meta, html.lmd-themed .hljs .hljs-number, html.lmd-themed .hljs .hljs-operator,
html.lmd-themed .hljs .hljs-selector-attr, html.lmd-themed .hljs .hljs-selector-class, html.lmd-themed .hljs .hljs-selector-id, html.lmd-themed .hljs .hljs-variable, html.lmd-themed .hljs .hljs-section { color: var(--syn-n); }
html.lmd-themed .hljs .hljs-string, html.lmd-themed .hljs .hljs-regexp, html.lmd-themed .hljs .hljs-meta .hljs-string { color: var(--syn-s); }
html.lmd-themed .hljs .hljs-built_in, html.lmd-themed .hljs .hljs-symbol, html.lmd-themed .hljs .hljs-bullet { color: var(--syn-b); }
html.lmd-themed .hljs .hljs-comment, html.lmd-themed .hljs .hljs-code, html.lmd-themed .hljs .hljs-formula { color: var(--syn-c); }
html.lmd-themed .hljs .hljs-name, html.lmd-themed .hljs .hljs-quote, html.lmd-themed .hljs .hljs-selector-pseudo, html.lmd-themed .hljs .hljs-selector-tag { color: var(--syn-t); }
html.lmd-themed .hljs .hljs-addition, html.lmd-themed .hljs .hljs-deletion { color: var(--fg); background: var(--bg-soft); }
html.lmd-themed .lmd-prev-code .k { color: var(--syn-k); } html.lmd-themed .lmd-prev-code .f { color: var(--syn-f); } html.lmd-themed .lmd-prev-code .n { color: var(--syn-n); }
/* Graphviz dibuja en negro sobre blanco: con un tema, el trazo y el relleno siguen sus colores. */
.lmd-themed .lmd-diagram-dot svg :is(path, ellipse, polygon)[stroke="black"] { stroke: var(--fg-muted); }
.lmd-themed .lmd-diagram-dot svg polygon[fill="black"] { fill: var(--fg-muted); }
.lmd-themed .lmd-diagram-dot svg polygon[fill="white"] { fill: transparent; }
/* Los dos temas de siempre: cuatro colores de sintaxis no llegaban a 4.5 de contraste sobre el bloque de código. */
html.lmd-light:not(.lmd-themed) .hljs .hljs-doctag, html.lmd-light:not(.lmd-themed) .hljs .hljs-keyword, html.lmd-light:not(.lmd-themed) .hljs .hljs-template-tag, html.lmd-light:not(.lmd-themed) .hljs .hljs-template-variable,
html.lmd-light:not(.lmd-themed) .hljs .hljs-type, html.lmd-light:not(.lmd-themed) .hljs .hljs-variable.language_ { color: #c5303f; }
html.lmd-light:not(.lmd-themed) .hljs .hljs-built_in, html.lmd-light:not(.lmd-themed) .hljs .hljs-symbol { color: #a84a00; }
html.lmd-light:not(.lmd-themed) .hljs .hljs-comment, html.lmd-light:not(.lmd-themed) .hljs .hljs-code, html.lmd-light:not(.lmd-themed) .hljs .hljs-formula { color: #646b78; }
html.lmd-light:not(.lmd-themed) .hljs .hljs-name, html.lmd-light:not(.lmd-themed) .hljs .hljs-quote, html.lmd-light:not(.lmd-themed) .hljs .hljs-selector-pseudo, html.lmd-light:not(.lmd-themed) .hljs .hljs-selector-tag { color: #1d7a33; }
html.lmd-dark:not(.lmd-themed) .hljs .hljs-section { color: #58a6ff; }
/* Un documento con tema se imprime con su papel y sus colores. */
@media print {
  .lmd-root.lmd-themed, .lmd-themed .lmd-body { background: var(--bg) !important; }
  .lmd-themed .lmd-body { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* Ajustes > Apariencia: la grilla de temas. Cada miniatura es una página chica con los colores del tema. */
.lmd-look-side { gap: 12px; }
.lmd-themes { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.lmd-themes-head { display: flex; align-items: center; gap: 8px; min-height: 28px; font-size: 13px; color: var(--fg-muted); }
.lmd-th-custom { flex: none; padding: 1px 7px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); font-size: 10.5px; font-style: normal; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; }
.lmd-themes-head [hidden] { display: none; }
.lmd-th-note { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; color: var(--fg); }
.lmd-themes-head .lmd-btn { flex: none; height: 28px; padding: 0 12px; font-size: 12.5px; }
.lmd-th-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.lmd-th { position: relative; display: block; min-width: 0; padding: 0; border: 0; border-radius: 8px; background: none; font: inherit; cursor: pointer; outline: 2px solid transparent; outline-offset: 2px; -webkit-tap-highlight-color: transparent; }
.lmd-th.lmd-th-picked { outline: 2px dashed var(--fg-muted); }
.lmd-th.lmd-on, .lmd-th:focus-visible { outline: 2px solid var(--accent-fill); }
.lmd-th-page { display: flex; flex-direction: column; gap: 3px; box-sizing: border-box; height: 50px; padding: 6px 7px; border: 1px solid; border-radius: 7px; overflow: hidden; text-align: left; }
.lmd-th-page b { flex: none; font: 650 10.5px/1.15 var(--lmd-font); letter-spacing: -0.01em; white-space: nowrap; }
.lmd-th-page > i { display: block; flex: none; height: 2px; border-radius: 2px; opacity: 0.7; }
.lmd-th-row { display: flex; align-items: center; gap: 4px; margin-top: auto; }
.lmd-th-code { display: flex; align-items: center; gap: 2px; flex: 1; min-width: 0; height: 9px; padding: 0 3px; border: 1px solid; border-radius: 3px; box-sizing: border-box; }
.lmd-th-code i { display: block; height: 2px; border-radius: 2px; }
.lmd-th-row u { flex: none; width: 10px; height: 2px; border-radius: 2px; text-decoration: none; }
.lmd-th-row em { flex: none; width: 15px; height: 8px; border-radius: 999px; }
/* Con la grilla al lado, la vista previa se achica: el texto arriba, y el código y el diagrama en un renglón. */
.lmd-look-side .lmd-preview { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px 12px; padding: 10px 14px 12px; }
.lmd-look-side .lmd-preview > small, .lmd-look-side .lmd-prev-text { grid-column: 1 / -1; }
.lmd-look-side .lmd-prev-text { height: 56px; }
.lmd-look-side .lmd-preview .lmd-prev-code { padding: 9px 12px; font-size: 12px; overflow: hidden; }
.lmd-look-side .lmd-preview .lmd-prev-dgm { width: 92px; height: 82px; align-self: center; }
@media (max-width: 720px), (max-height: 500px) and (pointer: coarse) {
  .lmd-th-page { height: 54px; }
  .lmd-themes-head .lmd-btn { height: 36px; }
  .lmd-th-grid { gap: 10px; }
}
/* Los temas incluidos, en la galería de la comunidad. */
.lmd-gal-card .lmd-th-page { height: 62px; margin: 2px 0; }
.lmd-gal-view .lmd-th-page { height: 120px; padding: 14px 16px; gap: 8px; }
.lmd-gal-view .lmd-th-page b { font-size: 17px; } .lmd-gal-view .lmd-th-page > i { height: 4px; }
.lmd-gal-view .lmd-th-code { height: 20px; padding: 0 6px; gap: 4px; } .lmd-gal-view .lmd-th-code i { height: 4px; }
.lmd-gal-view .lmd-th-row u { width: 26px; height: 3px; } .lmd-gal-view .lmd-th-row em { width: 44px; height: 18px; }

/* ---------- iPhone, iPad y Mac (Safari) ---------- */
/* touch.js deja en <html> las clases lmd-ios, lmd-mac y lmd-standalone (la app instalada). */
.lmd-root { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
/* Sin el destello gris al tocar y sin el zoom del doble toque sobre los controles. */
.lmd-root button, .lmd-root a, .lmd-root label, .lmd-root summary, .lmd-root select, .lmd-root [role=button], .lmd-root [role=tab], .lmd-root [role=radio], .lmd-root [role=menuitem] { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
/* Safari agranda la página al enfocar un campo con letra de menos de 16 px. */
html.lmd-ios input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]):not([type=file]), html.lmd-ios select, html.lmd-ios textarea { font-size: max(16px, 1em); }
/* La página no rebota al arrastrar más allá del borde; las listas largas conservan su inercia. */
html.lmd-ios, html.lmd-ios .lmd-body, html.lmd-standalone, html.lmd-standalone .lmd-body { overscroll-behavior-y: none; }
.lmd-pane, .lmd-panel-body, .lmd-ask-card, .lmd-menu, .lmd-ptabs { -webkit-overflow-scrolling: touch; }
.lmd-panel-body, .lmd-ptabs { overscroll-behavior: contain; }
/* Áreas seguras donde faltaban: los diálogos y Ajustes en pantalla grande (un iPad acostado), y las barras flotantes. */
html.lmd-ios .lmd-ask, html.lmd-ios .lmd-panel { padding: max(20px, env(safe-area-inset-top, 0px)) max(20px, env(safe-area-inset-right, 0px)) max(20px, env(safe-area-inset-bottom, 0px)) max(20px, env(safe-area-inset-left, 0px)); }
.lmd-docked { max-width: calc(100vw - 16px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px)); }
@media (max-width: 720px), (max-height: 500px) and (pointer: coarse) {
  html.lmd-ios .lmd-ask { padding: max(12px, 5vh, env(safe-area-inset-top, 0px)) max(12px, env(safe-area-inset-right, 0px)) max(12px, env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-left, 0px)); }
  html.lmd-ios .lmd-panel { padding: 0; }
  /* En iPhone el teclado no achica la página: el diálogo se corre para quedar arriba de él. */
  html.lmd-ios.lmd-kb .lmd-ask { padding-bottom: calc(12px + var(--lmd-kb, 0px)); }
}
/* El alto de la ventana sin contar las barras de Safari, donde el navegador lo sabe medir. */
@supports (height: 100dvh) {
  .lmd-main { min-height: 100dvh; }
  .lmd-raw-edit { min-height: calc(100dvh - 96px); }
  .lmd-home { min-height: calc(100dvh - 49px - env(safe-area-inset-top, 0px)); }
  .lmd-dct-help .lmd-ask-card, .lmd-gal-dlg .lmd-ask-card { max-height: calc(100dvh - 40px - var(--lmd-kb, 0px)); }
  @media (max-width: 720px), (max-height: 500px) and (pointer: coarse) {
    .lmd-dct-help .lmd-ask-card { max-height: calc(100dvh - 14vh - 24px - var(--lmd-kb, 0px)); }
    .lmd-gal-dlg .lmd-ask-card { max-height: calc(100dvh - 20px - var(--lmd-kb, 0px)); }
  }
}
/* Ajustes > Instalar: los pasos de iPhone, iPad y Mac, con el ícono de compartir dibujado. */
.lmd-inst-steps .lmd-inst-ico { display: inline-flex; vertical-align: -4px; margin: 0 2px; color: var(--accent); }
.lmd-inst-steps .lmd-inst-ico svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.lmd-inst-keep { margin: 8px 0 0; font-size: 12.5px; color: var(--fg-faint); }
/* En pantalla chica Apariencia es una sola columna: la grilla de temas va arriba, debajo del modo claro u oscuro. */
@media (max-width: 720px), (max-height: 500px) and (pointer: coarse) {
  .lmd-two > .lmd-pcol:not(.lmd-look-side) { order: 2; }
  .lmd-two > .lmd-extra { order: 3; }
}
/* ---------- Publicar una carpeta como sitio (publish.js) ---------- */
.lmd-site { width: min(560px, 100%); max-height: calc(100vh - 40px); max-height: calc(100dvh - 40px); display: flex; flex-direction: column; }
.lmd-site-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; margin: 0 -6px 14px; padding: 2px 6px; overscroll-behavior: contain; }
.lmd-ask-card.lmd-site p { margin: 0 0 12px; }
.lmd-site .lmd-hint { margin: 0 0 12px; }
.lmd-site-field { display: block; margin: 0 0 12px; }
.lmd-site-field > span { display: block; margin: 0 0 5px; font-size: 12.5px; color: var(--fg-muted); }
.lmd-site-field input, .lmd-site-field select { width: 100%; min-width: 0; height: 36px; padding: 0 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg-soft); color: var(--fg); font: inherit; font-size: 14px; outline: none; }
.lmd-site-field input:focus, .lmd-site-field select:focus { border-color: var(--accent-fill); }
.lmd-site-addr { display: flex; align-items: center; min-width: 0; border: 1px solid var(--line); border-radius: 8px; background: var(--bg-soft); }
.lmd-site-addr:focus-within { border-color: var(--accent-fill); }
.lmd-site-addr small { flex: 0 1 auto; min-width: 0; padding-left: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; color: var(--fg-faint); }
.lmd-site-addr input { flex: 1 1 110px; border: 0; background: none; padding-left: 2px; }
.lmd-site-two { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.lmd-ask-card.lmd-site p.lmd-site-err { margin: -6px 0 12px; font-size: 12.5px; color: #dc2626; }
.lmd-ask-card.lmd-site p.lmd-site-folder { display: flex; align-items: center; gap: 8px; color: var(--fg); font-weight: 600; overflow-wrap: anywhere; }
.lmd-site-folder svg { flex: none; width: 16px; height: 16px; color: var(--fg-faint); }
.lmd-ask-card.lmd-site p.lmd-site-url { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.lmd-site-url a { min-width: 0; padding: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--accent); font-size: 14px; }
.lmd-site-url button { flex: none; padding: 0; }
.lmd-site-state { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--fg-muted); }
.lmd-site-state::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--fg-faint); }
.lmd-site-ok::before { background: #16a34a; } .lmd-site-warn::before { background: #d97706; } .lmd-site-bad::before { background: #dc2626; }
.lmd-site-pend { margin: 0 0 12px; padding: 10px 12px; list-style: none; border: 1px solid var(--line); border-radius: 9px; font-size: 13px; color: var(--fg-muted); overflow-wrap: anywhere; }
.lmd-site-pend b { color: var(--fg); font-weight: 600; }
.lmd-site-more { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.lmd-site-more .lmd-link { padding: 4px 0; color: var(--accent); }
.lmd-site-more .lmd-site-rm { color: #dc2626; }
.lmd-ask-card.lmd-site p.lmd-site-step { margin: 0 0 10px; font-size: 13px; color: var(--fg-muted); }
.lmd-site-pick { display: flex; flex-direction: column; gap: 6px; }
.lmd-site-pick .lmd-btn { display: flex; align-items: center; gap: 8px; text-align: left; }
.lmd-site-pick svg { flex: none; width: 16px; height: 16px; }
.lmd-site-pick span { min-width: 0; overflow-wrap: anywhere; }
.lmd-site-sec { margin-top: 18px; }
.lmd-site-sec h4 { margin: 0 0 8px; font-size: 14px; }
.lmd-site-row { display: flex; align-items: center; gap: 12px; padding: 8px 0; }
.lmd-site-row > div { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.lmd-site-row a { padding: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--accent); }
.lmd-site-row .lmd-btn { flex: none; }
@media (max-width: 720px) {
  .lmd-site-two { grid-template-columns: 1fr; }
  .lmd-site-field input, .lmd-site-field select { height: 42px; font-size: 16px; }
  .lmd-site-more .lmd-link, .lmd-site-url button { min-height: 40px; }
  .lmd-site-row { flex-wrap: wrap; }
}
/* ---------- Tablero: tarjetas que se abren con un clic, columna de hechas y campos por tipo ---------- */
.lmd-card { display: block; cursor: pointer; transition: border-color .12s, box-shadow .12s; }
.lmd-card:hover { border-color: color-mix(in srgb, var(--accent-fill) 55%, var(--line)); }
.lmd-card:focus-visible { outline: 2px solid var(--accent-fill); outline-offset: 1px; }
.lmd-card-done { opacity: 0.62; }
.lmd-card-done .lmd-card-text { color: var(--fg-muted); text-decoration: none; }
.lmd-col-mark { display: inline-grid; place-items: center; width: 16px; height: 16px; color: var(--fg-faint); flex: none; }
.lmd-col-mark svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.lmd-col-menu { display: inline-grid; place-items: center; width: 24px; height: 24px; padding: 0; border: 0; border-radius: 6px; background: transparent; color: var(--fg-faint); cursor: pointer; flex: none; opacity: 0; }
.lmd-col-head:hover .lmd-col-menu, .lmd-col-menu:focus-visible { opacity: 1; }
.lmd-col-menu:hover { background: var(--bg); color: var(--accent); }
.lmd-col-menu svg { width: 15px; height: 15px; fill: currentColor; stroke: none; }
.lmd-readonly .lmd-col-menu { display: none; }
.lmd-card-meta { align-items: center; gap: 4px 8px; }
.lmd-chip { padding: 0; border: 0; border-radius: 0; background: transparent; color: var(--fg-muted); font-size: 0.82em; line-height: 1.5; }
.lmd-chip-late { color: #c2410c; font-weight: 600; }
.lmd-chip-prio { display: inline-flex; align-items: center; gap: 5px; }
.lmd-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--fg-faint); flex: none; }
.lmd-prio-high { background: #dc2626; }
.lmd-prio-mid { background: #d97706; }
.lmd-prio-low { background: #16a34a; }
.lmd-chip-people { display: inline-flex; overflow: visible; }
.lmd-avatar { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--accent-soft, var(--bg-soft)); color: var(--accent); border: 1px solid var(--bg); font-size: 9.5px; font-weight: 700; letter-spacing: 0.02em; line-height: 1; flex: none; }
.lmd-chip-people .lmd-avatar + .lmd-avatar { margin-left: -3px; }
.lmd-chip-link { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; color: var(--fg-muted); }
.lmd-chip-link:hover { background: var(--bg-soft); color: var(--accent); }
.lmd-chip-link svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.lmd-ktag { --tg: #6b7280; display: inline-block; max-width: 100%; padding: 0 7px; border: 1px solid color-mix(in srgb, var(--tg) 35%, transparent); border-radius: 999px; background: color-mix(in srgb, var(--tg) 14%, var(--bg)); color: color-mix(in srgb, var(--tg) 72%, var(--fg)); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lmd-ktag-red { --tg: #dc2626; } .lmd-ktag-orange { --tg: #ea580c; } .lmd-ktag-yellow { --tg: #ca8a04; } .lmd-ktag-green { --tg: #16a34a; } .lmd-ktag-teal { --tg: #0d9488; } .lmd-ktag-blue { --tg: #2563eb; } .lmd-ktag-purple { --tg: #7c3aed; } .lmd-ktag-pink { --tg: #db2777; }

.lmd-cd-card { width: min(540px, 100%); max-height: calc(100dvh - 40px - var(--lmd-kb, 0px)); overflow: auto; }
.lmd-cd-title { display: block; box-sizing: border-box; width: 100%; margin: 0 0 14px; padding: 6px 8px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--fg); font: inherit; font-size: 20px; font-weight: 700; line-height: 1.3; outline: none; }
.lmd-cd-title:hover:not(:disabled) { border-color: var(--line); }
.lmd-cd-title:focus { border-color: var(--accent-fill); background: var(--bg-soft); }
.lmd-cd-state { display: grid; grid-template-columns: minmax(90px, 30%) minmax(0, 1fr); align-items: center; gap: 8px; margin: 0 0 14px; padding: 0 8px; }
.lmd-cd-state > span { font-size: 13px; color: var(--fg-muted); }
.lmd-cd-state select { width: 100%; }
.lmd-cd-attrs { display: grid; gap: 8px; margin: 0 0 10px; padding: 12px 8px 0; border-top: 1px solid var(--line); }
.lmd-cd-attr, .lmd-cd-new { display: grid; grid-template-columns: 18px minmax(64px, 26%) minmax(0, 1fr) auto auto; align-items: center; gap: 8px; min-height: 36px; }
.lmd-cd-ico { display: inline-grid; place-items: center; width: 18px; height: 18px; color: var(--fg-faint); }
.lmd-cd-ico svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.lmd-cd-attr input:not([type=checkbox]), .lmd-cd-new input, .lmd-cd-attr select, .lmd-cd-new select { box-sizing: border-box; width: 100%; min-width: 0; height: 36px; padding: 0 9px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg-soft); color: var(--fg); font: inherit; outline: none; }
.lmd-cd-attr input:not([type=checkbox]):focus, .lmd-cd-new input:focus, .lmd-cd-attr select:focus, .lmd-cd-new select:focus { border-color: var(--accent-fill); }
.lmd-cd-attr input.lmd-cd-switch, .lmd-cd-switch { padding: 0; border: 0; appearance: none; -webkit-appearance: none; position: relative; width: 30px; height: 18px; margin: 0; border-radius: 999px; background: var(--line); cursor: pointer; flex: none; transition: background .15s; }
.lmd-cd-switch::after { content: ""; position: absolute; left: 2px; top: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--bg); box-shadow: 0 1px 2px rgba(0, 0, 0, .3); transition: transform .15s; }
.lmd-cd-attr input.lmd-cd-switch:checked { background: var(--accent-fill); }
.lmd-cd-switch:checked::after { transform: translateX(12px); }
.lmd-cd-switch:focus-visible, .lmd-cd-rm:focus-visible, .lmd-cd-pop:focus-visible, .lmd-cd-edit:focus-visible, .lmd-cd-type:focus-visible, .lmd-cd-add-open:focus-visible, .lmd-cd-pill-name:focus-visible, .lmd-cd-swatch:focus-visible, .lmd-cd-me:focus-visible, .lmd-cd-del:focus-visible { outline: 2px solid var(--accent-fill); outline-offset: 2px; }
.lmd-cd-switch:disabled { opacity: 0.5; cursor: default; }
.lmd-cd-rm, .lmd-cd-edit { opacity: 0.55; }
.lmd-cd-attr:hover .lmd-cd-rm, .lmd-cd-rm:focus-visible, .lmd-cd-edit:hover, .lmd-cd-edit:focus-visible, .lmd-cd-new .lmd-cd-rm { opacity: 1; }
.lmd-cd-rm svg, .lmd-cd-pop svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.lmd-cd-edit { display: inline-grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 6px; background: transparent; color: var(--fg-faint); cursor: pointer; flex: none; }
.lmd-cd-edit:hover { background: var(--bg-soft); color: var(--accent); }
.lmd-cd-edit svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.lmd-cd-link { display: flex; align-items: center; gap: 6px; min-width: 0; min-height: 36px; }
.lmd-cd-url { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lmd-cd-multi { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; }
.lmd-cd-multi .lmd-cd-multi-in { flex: 1 1 80px; width: auto; }
.lmd-cd-pill { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; padding: 2px 4px 2px 8px; border: 1px solid var(--line); border-radius: 999px; background: var(--bg-soft); font-size: 13px; line-height: 1.5; }
.lmd-cd-multi[data-kind=person] .lmd-cd-pill { padding-left: 3px; }
.lmd-cd-pill.lmd-ktag { overflow: visible; }
.lmd-cd-pill-name { padding: 0; border: 0; background: transparent; color: inherit; font: inherit; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
button.lmd-cd-pill-name { cursor: pointer; border-radius: 4px; }
.lmd-cd-pop { display: inline-grid; place-items: center; width: 18px; height: 18px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: inherit; cursor: pointer; opacity: 0.6; flex: none; }
.lmd-cd-pop:hover { opacity: 1; background: color-mix(in srgb, currentColor 14%, transparent); }
.lmd-cd-me { padding: 2px 9px; border: 1px dashed var(--line); border-radius: 999px; background: transparent; color: var(--fg-muted); font: inherit; font-size: 13px; cursor: pointer; }
.lmd-cd-me:hover { border-color: var(--accent-fill); color: var(--accent); }
.lmd-cd-swatches { display: flex; flex-wrap: wrap; gap: 6px; flex-basis: 100%; }
.lmd-cd-swatch { width: 22px; height: 22px; padding: 0; border-radius: 50%; background: color-mix(in srgb, var(--tg) 60%, var(--bg)); cursor: pointer; }
.lmd-cd-swatch[aria-checked=true] { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--tg); }
.lmd-cd-undo { display: flex; align-items: center; gap: 10px; margin: 0 0 10px; padding: 7px 10px; border-radius: 8px; background: var(--bg-soft); color: var(--fg-muted); font-size: 13px; }
.lmd-cd-undo[hidden], .lmd-cd-attrs[hidden] { display: none; }
.lmd-cd-add { margin: 0 0 12px; padding: 0 8px; }
.lmd-cd-add-open { display: block; width: 100%; padding: 8px 10px; border: 1px dashed var(--line); border-radius: 8px; background: transparent; color: var(--fg-muted); font: inherit; font-size: 13.5px; text-align: left; cursor: pointer; }
.lmd-cd-add-open:hover { border-color: var(--accent-fill); color: var(--accent); }
.lmd-cd-chooser { padding: 10px; border: 1px solid var(--line); border-radius: 10px; }
.lmd-ask-card p.lmd-cd-sub { margin: 0 0 6px; font-size: 12px; color: var(--fg-faint); }
.lmd-cd-types { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; }
.lmd-cd-type { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg-soft); color: var(--fg); font: inherit; font-size: 13.5px; cursor: pointer; }
.lmd-cd-type:hover { border-color: var(--accent-fill); color: var(--accent); }
.lmd-cd-type svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.lmd-cd-back { font-size: 13px; }
.lmd-cd-new { grid-template-columns: 18px minmax(0, 1fr) auto; padding: 8px; border: 1px solid var(--line); border-radius: 10px; }
.lmd-cd-new > .lmd-cd-key, .lmd-cd-new > [data-cd=name] { grid-column: 2 / -1; }
.lmd-cd-new > [data-cd=opts], .lmd-cd-new > .lmd-cd-newval { grid-column: 2 / -1; }
.lmd-cd-new > .lmd-btn { grid-column: 2 / 3; justify-self: start; }
.lmd-cd-new > .lmd-cd-rm { justify-self: end; }
.lmd-ask-card p.lmd-cd-dates { margin: 0 0 14px; padding: 0 8px; font-size: 12px; color: var(--fg-faint); }
.lmd-cd-actions { align-items: center; }
.lmd-cd .lmd-cd-actions .lmd-cd-del { margin-right: auto; padding: 6px 8px; border: 0; border-radius: 6px; background: transparent; color: var(--fg-muted); font: inherit; font-size: 13.5px; cursor: pointer; }
.lmd-cd .lmd-cd-actions .lmd-cd-del:hover { color: #dc2626; background: var(--bg-soft); }
@media (max-width: 720px), (max-height: 500px) and (pointer: coarse) {
  .lmd-col-menu { opacity: 1; width: 32px; height: 32px; }
  .lmd-cd-card { width: 100%; padding: 16px 14px; max-height: calc(100dvh - 24px - var(--lmd-kb, 0px)); }
  .lmd-cd-state { grid-template-columns: 1fr; gap: 4px; }
  .lmd-cd-attr { grid-template-columns: 18px minmax(0, 1fr) auto auto; gap: 6px 8px; }
  .lmd-cd-attr > .lmd-cd-key { grid-column: 2 / 3; }
  .lmd-cd-attr > .lmd-cd-switch { grid-column: 3 / 4; grid-row: 1; }
  .lmd-cd-attr > .lmd-cd-rm { grid-column: 4 / 5; grid-row: 1; }
  .lmd-cd-attr > :nth-child(3) { grid-column: 1 / -1; grid-row: 2; }
  .lmd-cd-attr input:not([type=checkbox]), .lmd-cd-new input, .lmd-cd-attr select, .lmd-cd-new select, .lmd-cd-state select { height: 44px; font-size: 16px; }
  .lmd-cd-title { font-size: 19px; min-height: 44px; }
  .lmd-cd-attr input.lmd-cd-switch { width: 40px; height: 24px; }
  .lmd-cd-switch::after { width: 20px; height: 20px; }
  .lmd-cd-switch:checked::after { transform: translateX(16px); }
  .lmd-cd-rm, .lmd-cd-edit { width: 36px; height: 36px; opacity: 1; }
  .lmd-cd-link { min-height: 44px; }
  .lmd-cd-pop { width: 26px; height: 26px; }
  .lmd-cd-pill { font-size: 14px; }
  .lmd-cd-type, .lmd-cd-add-open, .lmd-cd-me { min-height: 40px; }
  .lmd-cd-swatch { width: 32px; height: 32px; }
  .lmd-cd-del { min-height: 40px; }
  .lmd-cd-actions .lmd-btn { min-height: 40px; }
}
@media print { .lmd-col-menu { display: none !important; } .lmd-card-done { opacity: 1; } }
@media (max-width: 720px), (max-height: 500px) and (pointer: coarse) {
  .lmd-cd-pop { width: 32px; height: 32px; }
  .lmd-cd-pill { padding: 0 2px 0 10px; }
  .lmd-cd-pill-name { min-height: 32px; line-height: 32px; }
}

/* ---------- El nombre visible de la cuenta ---------- */
.lmd-acct-name { align-items: center; }
.lmd-acct-name b { flex: 1; text-align: right; }
.lmd-acct-name .lmd-link, .lmd-acct-name .lmd-btn { flex: none; }
.lmd-acct-name input { flex: 1; min-width: 0; height: 32px; padding: 0 9px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg-soft); color: var(--fg); font: inherit; outline: none; }
.lmd-acct-name input:focus { border-color: var(--accent-fill); }
.lmd-acct-name input[aria-invalid=true] { border-color: #dc2626; }
.lmd-acct-row.lmd-acct-name { border-bottom: 0; padding-bottom: 0; }
.lmd-acct > .lmd-hint.lmd-acct-name-hint { margin: 0; padding: 0 0 5px; border-bottom: 1px solid var(--line); font-size: 11.5px; line-height: 1.3; color: var(--fg-faint); }
.lmd-acct > .lmd-hint.lmd-acct-name-bad { color: #dc2626; }
.lmd-team-name { font-weight: 600; color: var(--fg); }
@media (max-width: 720px), (max-height: 500px) and (pointer: coarse) {
  .lmd-acct-name { flex-wrap: wrap; }
  .lmd-acct-name input { flex-basis: 100%; height: 44px; font-size: 16px; }
}

/* ---------- Listas de tareas: contador, renglón de agregar, manija y quitar los hechos ---------- */
.lmd-cl-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; margin: 0 0 4px; font-size: 12.5px; color: var(--fg-faint); user-select: none; }
.lmd-cl-count { font-variant-numeric: tabular-nums; }
.lmd-cl-bar .lmd-link { padding: 0; font-size: 12.5px; color: var(--fg-muted); }
/* Las acciones de la lista y el renglón de agregar son para editar. Leyendo no están a la vista ni se pueden tocar: en
   escritorio aparecen al pasar el mouse por la lista o al llegar con el teclado, y se quedan un instante para alcanzarlas. */
.lmd-cl-bar .lmd-link, .lmd-cl-add { opacity: 0; visibility: hidden; transition: opacity .12s, visibility 0s linear .35s; }
.lmd-editing .lmd-cl-bar .lmd-link, .lmd-editing .lmd-cl-add, .lmd-cl-bar .lmd-cl-more[aria-expanded=true],
.lmd-cl-bar:has(:focus-visible) .lmd-link, .lmd-cl-bar:has(+ .lmd-cl :focus-visible) .lmd-link, .lmd-cl-bar:has(+ .lmd-cl + .lmd-cl-add:focus-visible) .lmd-link,
.lmd-cl:has(:focus-visible) + .lmd-cl-add, .lmd-cl-add:focus-visible, .lmd-cl-bar:has(:focus-visible) + .lmd-cl + .lmd-cl-add { opacity: 1; visibility: visible; transition-delay: 0s; }
@media (hover: hover) {
  .lmd-cl-bar:hover .lmd-link, .lmd-cl-bar:has(+ .lmd-cl:hover) .lmd-link, .lmd-cl-bar:has(+ .lmd-cl + .lmd-cl-add:hover) .lmd-link,
  .lmd-cl:hover + .lmd-cl-add, .lmd-cl-add:hover, .lmd-cl-bar:hover + .lmd-cl + .lmd-cl-add { opacity: 1; visibility: visible; transition-delay: 0s; }
}
@media (prefers-reduced-motion: reduce) { .lmd-cl-bar .lmd-link, .lmd-cl-add { transition: none; } }
/* Ocultar las hechas: lo único a la vista junto al contador. Es de la vista y solo en pantalla: al imprimir va la lista
   entera, y lo que se copia o exporta sale sin la barra, así que tampoco oculta nada. Una tarea a la que lleva un ancla
   o un comentario se ve igual. */
.lmd-cl-toggle { padding: 0; border: 0; border-radius: 3px; background: transparent; color: var(--fg-muted); font: inherit; font-size: 12.5px; cursor: pointer; }
.lmd-cl-toggle:hover, .lmd-cl-toggle[aria-pressed=true] { color: var(--accent); }
.lmd-cl-toggle:focus-visible { outline: 2px solid var(--accent-fill); outline-offset: 2px; }
@media screen {
  .lmd-cl-bar.lmd-cl-hiding + ul.lmd-cl > li.lmd-task-item:has(> input.lmd-task:checked, > .lmd-li-text > input.lmd-task:checked, > p > input.lmd-task:checked):not(:has(.lmd-cm-here, :target)):not(.lmd-cm-here):not(:target) { display: none; }
}
/* Una lista corta no lleva contador: su barra no ocupa renglón y las acciones quedan arriba a la derecha. */
.lmd-cl-bar.lmd-cl-bare { flex-wrap: nowrap; justify-content: flex-end; align-items: flex-end; height: 0; margin: 0; }
.lmd-cl-bare .lmd-link { line-height: 16px; }
.lmd-cl-bar.lmd-cl-bare .lmd-cl-more { height: 16px; }
.lmd-cl-bar .lmd-link:hover { color: var(--accent); }
.lmd-cl-bar .lmd-cl-more { display: inline-grid; place-items: center; width: 26px; height: 22px; border-radius: 5px; }
.lmd-cl-bar .lmd-cl-more[aria-expanded=true] { opacity: 1; background: var(--bg-soft); color: var(--accent); }
.lmd-cl-more svg { width: 15px; height: 15px; fill: currentColor; stroke: none; transform: rotate(90deg); pointer-events: none; }
.lmd-menu button:disabled { opacity: .45; cursor: default; }
.lmd-menu button:disabled:hover { background: transparent; color: inherit; }
.markdown-body ul.lmd-cl { margin-bottom: 4px; }
.markdown-body ul.lmd-cl > li { position: relative; }
.markdown-body ul.lmd-cl > li.lmd-task-item:has(> input.lmd-task:checked, > .lmd-li-text > input.lmd-task:checked, > p > input.lmd-task:checked) { color: var(--fg-faint); }
.lmd-cl-grip { float: right; margin: 1px 0 0 8px; display: inline-grid; place-items: center; width: 20px; height: 24px; padding: 0; border: 0; border-radius: 5px; background: transparent; color: var(--fg-faint); cursor: grab; opacity: 0; touch-action: none; }
/* Gana a la regla general de los botones (touch-action: manipulation): con el dedo, la manija arrastra en vez de deslizar la página. */
.lmd-root button.lmd-cl-grip { touch-action: none; }
.lmd-cl > li:hover > .lmd-cl-grip, .lmd-cl-grip:focus-visible { opacity: 1; }
.lmd-cl-grip:focus-visible { outline: 2px solid var(--accent-fill); outline-offset: 1px; }
.lmd-cl-grip:hover { background: var(--bg-soft); color: var(--accent); }
.lmd-cl-grip svg { width: 14px; height: 14px; fill: currentColor; stroke: none; pointer-events: none; }
.lmd-cl > li.lmd-cl-moving { opacity: 0.45; }
.lmd-cl > li.lmd-cl-before { box-shadow: 0 -2px 0 var(--accent-fill); }
.lmd-cl.lmd-cl-end > li:last-child { box-shadow: 0 2px 0 var(--accent-fill); }
.lmd-cl-add { display: block; margin: 0 0 1em; padding: 3px 8px; border: 0; border-radius: 6px; background: transparent; color: var(--fg-faint); font: inherit; font-size: 0.92em; cursor: pointer; user-select: none; }
/* Leyendo, el renglón de agregar cabe en el espacio que la lista ya deja debajo: no suma alto ni mueve la página al aparecer. */
html:not(.lmd-editing) .markdown-body ul.lmd-cl { margin-bottom: 0; }
html:not(.lmd-editing) .lmd-cl-add { height: 1.25em; margin: 0; padding: 0 8px; font-size: 0.8em; line-height: 1.25em; }
.lmd-cl-add:hover { background: var(--bg-soft); color: var(--accent); }
.lmd-cl-add:focus-visible { outline: 2px solid var(--accent-fill); outline-offset: 1px; }
.lmd-cl-toast { position: fixed; left: 50%; bottom: calc(22px + var(--lmd-kb, 0px)); transform: translateX(-50%); z-index: 60; display: flex; align-items: center; gap: 14px; max-width: calc(100vw - 24px); padding: 9px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--fg); box-shadow: var(--shadow); font-family: var(--lmd-font); font-size: 13.5px; }
.lmd-cl-toast .lmd-link { padding: 0; color: var(--accent); font-weight: 600; }
/* Unir en vez de pisar (merge.js): la pregunta cuando los dos cambiaron lo mismo, y el guardado en pausa. */
.lmd-mrg-card { width: min(720px, 100%); }
.lmd-mrg-list { display: grid; gap: 10px; max-height: min(52vh, 460px); margin: 0 0 18px; overflow-y: auto; overscroll-behavior: contain; }
.lmd-mrg-hunk { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.lmd-mrg-side { min-width: 0; padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--bg-soft); }
.lmd-mrg-label { display: block; margin-bottom: 4px; font-size: 12px; font-weight: 600; color: var(--fg-muted); }
.lmd-mrg-text { margin: 0; font: 12.5px/1.5 var(--lmd-mono, ui-monospace, monospace); color: var(--fg); white-space: pre-wrap; overflow-wrap: anywhere; }
.lmd-ask-card p.lmd-mrg-more { margin: 0; font-size: 13px; }
.lmd-held .lmd-savestate { color: #d97706; font-weight: 600; }
@media (max-width: 640px) { .lmd-mrg-hunk { grid-template-columns: 1fr; } }
@media (max-width: 720px), (max-height: 500px) and (pointer: coarse) {
  .lmd-cl-bar .lmd-link, .lmd-cl-toggle { min-height: 32px; }
  .lmd-editing .lmd-cl-bar.lmd-cl-bare { height: auto; margin: 0 0 4px; }
  .lmd-cl-bar .lmd-cl-more, .lmd-cl-bar.lmd-cl-bare .lmd-cl-more { width: 40px; height: 32px; }
  .lmd-cl-grip { width: 36px; height: 32px; margin: -4px -6px 0 4px; opacity: 0.7; }
  .lmd-editing .lmd-cl-add { min-height: 40px; padding: 6px 10px; }
  .lmd-cl-toast .lmd-link { min-height: 32px; }
}
@media print { .lmd-cl-bar, .lmd-cl-add, .lmd-cl-grip, .lmd-cl-toast { display: none !important; } }

/* Abrir un archivo del disco por enlace: la ruta dentro de la pregunta. */
.lmd-ask-card .lmd-dlg-path { margin: 0 0 18px; }
.lmd-ask-card p + .lmd-dlg-path { margin-top: -6px; }
/* Lo que hay que hacer en el selector de archivos, a la vista mientras está abierto. */
.lmd-ask-card p.lmd-dlg-note { margin: -6px 0 18px; padding: 9px 12px; border: 1px solid var(--accent-fill); border-radius: 9px; background: var(--accent-soft); color: var(--fg); font-size: 13.5px; line-height: 1.45; }
.lmd-ask-card p.lmd-dlg-note[hidden] { display: none; }
/* ---------- Asistente de IA con clave propia (assistant.js) ---------- */
.lmd-format [data-ai-fmt] { color: var(--accent); }
.lmd-format [data-ai-fmt] svg, .lmd-ai-head > svg, .lmd-ai-btn svg { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.lmd-ai-at { box-shadow: -3px 0 0 var(--accent-fill); }
.lmd-ai-menu { width: 270px; }
.lmd-ai-menu button { width: 100%; }
.lmd-ai-menu .lmd-ai-arrow { margin-left: auto; display: grid; opacity: 0.6; }
.lmd-ai-menu .lmd-ai-arrow svg { width: 14px; height: 14px; }
.lmd-ai-free { display: flex; gap: 4px; margin: 6px 0 0; padding: 6px 0 0; border-top: 1px solid var(--line); }
.lmd-ai-free input { flex: 1; min-width: 0; padding: 6px 9px; border: 1px solid var(--line); border-radius: 7px; background: var(--bg); color: var(--fg); font: inherit; outline: none; }
.lmd-ai-free input:focus { border-color: var(--accent-fill); }
.lmd-ai-menu .lmd-ai-free button { width: 32px; flex: none; justify-content: center; padding: 0; color: var(--accent); }

.lmd-ai-card { position: fixed; z-index: 45; left: 50%; bottom: 44px; transform: translateX(-50%); box-sizing: border-box; width: min(860px, calc(100vw - 24px)); max-height: min(62vh, 560px); display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; background: var(--bg); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); font: 13.5px/1.5 var(--lmd-font); color: var(--fg); }
.lmd-ai-card.lmd-ai-solo { width: min(620px, calc(100vw - 24px)); }
.lmd-ai-head { display: flex; align-items: center; gap: 8px; min-height: 28px; }
.lmd-ai-head > svg { width: 17px; height: 17px; flex: none; color: var(--accent); }
.lmd-ai-head b { font-size: 13.5px; }
.lmd-ai-head small { color: var(--fg-faint); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.lmd-ai-x { margin-left: auto; width: 28px; height: 28px; flex: none; display: grid; place-items: center; border: 0; border-radius: 6px; background: transparent; color: var(--fg-muted); cursor: pointer; }
.lmd-ai-x + .lmd-ai-x { margin-left: 0; }
.lmd-ai-x:hover { background: var(--accent-soft); color: var(--accent); }
.lmd-ai-x svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.lmd-ai-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; min-height: 0; flex: 1; overflow: hidden; }
.lmd-ai-solo .lmd-ai-cols { grid-template-columns: 1fr; }
.lmd-ai-col { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.lmd-ai-col h5 { margin: 0 0 4px; font-size: 11.5px; font-weight: 600; color: var(--fg-faint); text-transform: uppercase; letter-spacing: 0.04em; }
.lmd-ai-text { flex: 1; min-height: 54px; overflow: auto; padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px; background: var(--bg-soft); white-space: pre-wrap; overflow-wrap: anywhere; }
.lmd-ai-text.markdown-body { white-space: normal; font-size: 13.5px; }
.lmd-ai-text.markdown-body > :first-child { margin-top: 0; }
.lmd-ai-text.markdown-body > :last-child { margin-bottom: 0; }
.lmd-ai-text del { background: color-mix(in srgb, #dc2626 18%, transparent); color: inherit; text-decoration: line-through; border-radius: 3px; }
.lmd-ai-text ins { background: color-mix(in srgb, #16a34a 24%, transparent); color: inherit; text-decoration: none; border-radius: 3px; }
.lmd-ai-busy .lmd-ai-new::after { content: ""; display: inline-block; width: 7px; height: 14px; margin-left: 2px; vertical-align: -2px; background: var(--accent-fill); animation: lmd-ai-blink 1s steps(1, end) infinite; }
@keyframes lmd-ai-blink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .lmd-ai-busy .lmd-ai-new::after { animation: none; } }
.lmd-ai-err { margin: 0; padding: 7px 10px; border-radius: 8px; background: color-mix(in srgb, #dc2626 12%, transparent); color: var(--fg); font-size: 13px; }
.lmd-ai-meta { margin: 0; color: var(--fg-faint); font-size: 12px; min-height: 16px; }
.lmd-ai-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.lmd-ai-side { margin-left: auto; display: flex; gap: 14px; }

.lmd-ai-gen textarea, .lmd-ai-field textarea, .lmd-ai-field input, .lmd-ai-field select, .lmd-ai-pick input[type=search] { display: block; box-sizing: border-box; width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg-soft); color: var(--fg); font: inherit; outline: none; }
.lmd-ai-gen textarea:focus, .lmd-ai-field textarea:focus, .lmd-ai-field input:focus, .lmd-ai-field select:focus, .lmd-ai-pick input[type=search]:focus { border-color: var(--accent-fill); }
.lmd-ai-gen textarea { min-height: 84px; resize: vertical; margin: 0 0 10px; }
.lmd-ai-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; }
.lmd-ai-chip { padding: 5px 11px; border: 1px solid var(--line); border-radius: 999px; background: var(--bg-soft); color: var(--fg); font: inherit; font-size: 13px; cursor: pointer; }
.lmd-ai-chip:hover:not(:disabled) { border-color: var(--fg-faint); }
.lmd-ai-chip[aria-pressed=true] { background: var(--accent-soft); border-color: var(--accent-fill); color: var(--accent); }
.lmd-ai-chip:disabled { opacity: 0.5; cursor: default; }
.lmd-ask-card p.lmd-ai-sub { margin: 4px 0 6px; font-size: 12.5px; color: var(--fg-faint); }
.lmd-ai-check { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font-size: 13.5px; cursor: pointer; }
.lmd-ask-card p.lmd-ai-size { margin: 0 0 12px; }
.lmd-ai-files { display: grid; gap: 2px; max-height: 44vh; overflow: auto; margin: 10px 0; }
.lmd-ai-files button { display: flex; align-items: center; gap: 8px; padding: 7px 9px; border: 0; border-radius: 6px; background: transparent; color: var(--fg); font: inherit; text-align: left; cursor: pointer; }
.lmd-ai-files button:hover:not(:disabled) { background: var(--accent-soft); color: var(--accent); }
.lmd-ai-files button:disabled { opacity: 0.5; cursor: default; }
.lmd-ai-files button svg { width: 15px; height: 15px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; }
.lmd-ai-files button span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lmd-ask-card p.lmd-ai-none, .lmd-ai-none { margin: 0; padding: 10px; color: var(--fg-faint); font-size: 13px; }

.lmd-ai-set { display: grid; gap: 8px; margin: 10px 0; }
.lmd-ai-field { display: grid; gap: 4px; margin-top: 6px; font-size: 13px; }
.lmd-ai-field > span { color: var(--fg-muted); }
.lmd-ai-tail { margin-left: 6px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.lmd-tl-opts .lmd-ai-note { margin: 0; }
/* El buscador de proveedores se ve arriba del selector; en el orden del teclado va después. */
.lmd-ai-prov > span { order: -2; }
.lmd-ai-prov input[type=search] { order: -1; }
.lmd-tl-opts p.lmd-ai-where, .lmd-tl-opts p.lmd-ai-base { margin: 0; }
.lmd-ai-base code { overflow-wrap: anywhere; }
.lmd-ai-links { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 0; font-size: 12.5px; }
.lmd-ai-links[hidden], .lmd-ai-links a[hidden] { display: none; }
.lmd-ai-links a { color: var(--accent); }

.lmd-ai-panel { position: fixed; z-index: 44; top: 0; right: 0; bottom: 0; box-sizing: border-box; width: min(380px, 100vw); display: flex; flex-direction: column; gap: 8px; padding: 12px 12px calc(10px + env(safe-area-inset-bottom, 0px)); background: var(--bg); border-left: 1px solid var(--line); box-shadow: var(--shadow); font: 13.5px/1.5 var(--lmd-font); color: var(--fg); }
html.lmd-ai-open .lmd-main { margin-right: min(380px, 100vw); }
html.lmd-ai-open .lmd-ai-card { left: calc(50% - 190px); width: min(860px, calc(100vw - 404px)); }
.lmd-ai-ctx { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12.5px; }
.lmd-ai-ctx small { flex-basis: 100%; color: var(--fg-faint); }
.lmd-ai-tag { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; padding: 2px 8px; border: 1px solid var(--line); border-radius: 999px; background: var(--bg-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lmd-ai-tag button { display: grid; place-items: center; width: 16px; height: 16px; padding: 0; border: 0; background: transparent; color: var(--fg-muted); cursor: pointer; }
.lmd-ai-tag button svg { width: 11px; height: 11px; fill: none; stroke: currentColor; stroke-width: 2; }
.lmd-ai-msgs { flex: 1; min-height: 0; overflow: auto; display: flex; flex-direction: column; gap: 10px; padding: 2px; }
.lmd-ai-msg { max-width: 100%; overflow-wrap: anywhere; }
.lmd-ai-me { align-self: flex-end; max-width: 88%; padding: 7px 11px; border-radius: 12px 12px 3px 12px; background: var(--accent-soft); white-space: pre-wrap; }
.lmd-ai-bot .lmd-ai-out { font-size: 13.5px; padding: 0; background: none; }
.lmd-ai-bot .lmd-ai-out > :first-child { margin-top: 0; }
.lmd-ai-bot .lmd-ai-out > :last-child { margin-bottom: 0; }
.lmd-ai-bot .lmd-ai-out pre, .lmd-ai-bot .lmd-ai-out table { max-width: 100%; overflow: auto; }
.lmd-ai-tools { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; margin-top: 6px; }
.lmd-ai-tools small { flex-basis: 100%; color: var(--fg-faint); font-size: 11.5px; }
.lmd-ai-ask { display: flex; gap: 6px; align-items: flex-end; margin: 0; }
.lmd-ai-ask textarea { flex: 1; min-width: 0; min-height: 40px; max-height: 30vh; box-sizing: border-box; padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--bg-soft); color: var(--fg); font: inherit; outline: none; resize: none; }
.lmd-ai-ask textarea:focus { border-color: var(--accent-fill); }
.lmd-ai-ask button { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border: 0; border-radius: 9px; background: var(--accent-fill); color: var(--accent-fg); cursor: pointer; }
.lmd-ai-ask button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.lmd-ai-ask button.lmd-ai-halt svg { fill: currentColor; stroke: none; }
.lmd-ai-foot { margin: 0; min-height: 15px; color: var(--fg-faint); font-size: 11.5px; }
@media (max-width: 900px) {
  html.lmd-ai-open .lmd-main { margin-right: 0; }
  html.lmd-ai-open .lmd-ai-card { left: 50%; width: min(860px, calc(100vw - 24px)); z-index: 46; }
  .lmd-ai-panel { width: 100vw; border-left: 0; }
}
@media (max-width: 720px) {
  .lmd-ai-card { bottom: calc(8px + env(safe-area-inset-bottom, 0px)); max-height: 76vh; padding: 10px; }
  .lmd-ai-cols { grid-template-columns: 1fr; overflow: auto; }
  .lmd-ai-text { max-height: 26vh; }
  .lmd-ai-actions .lmd-btn { min-height: 38px; }
  .lmd-ai-side { margin-left: 0; flex-basis: 100%; }
  .lmd-ai-menu button { min-height: 38px; }
  .lmd-ai-ask textarea, .lmd-ai-free input, .lmd-ai-gen textarea, .lmd-ai-field input, .lmd-ai-field textarea, .lmd-ai-field select { font-size: 16px; }
}
@media print { .lmd-ai-card, .lmd-ai-panel, .lmd-ai-menu { display: none !important; } .lmd-ai-at { box-shadow: none; } html.lmd-ai-open .lmd-main { margin-right: 0; } }

/* ---------- Imágenes adjuntas: almacenamiento en Ajustes y lista de adjuntos (images.js) ---------- */
.lmd-st-host { position: relative; }
.lmd-st-slot { position: absolute; top: 10px; right: 0; display: flex; align-items: center; gap: 10px; max-width: calc(100% - 120px); height: 24px; font-size: 13px; color: var(--fg-muted); white-space: nowrap; }
.lmd-st-slot[hidden] { display: none; }
.lmd-st-name { flex: none; color: var(--fg); font-weight: 600; }
.lmd-st-num { flex: none; }
.lmd-st-see { flex: none; padding: 0; border: 0; background: none; font: inherit; color: var(--accent, inherit); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.lmd-st-see:hover { color: var(--fg); }
.lmd-st-bar { display: block; flex: 0 1 90px; min-width: 40px; height: 8px; border: 0; border-radius: 999px; overflow: hidden; background: var(--line); accent-color: var(--accent-fill); appearance: none; -webkit-appearance: none; }
.lmd-st-card > .lmd-st-bar { flex: none; width: 100%; margin: 2px 0 10px; }
.lmd-st-spaces { align-self: flex-start; margin-bottom: 10px; }
.lmd-st-bar::-webkit-progress-bar { background: var(--line); border-radius: 999px; }
.lmd-st-bar::-webkit-progress-value { background: var(--accent-fill); border-radius: 999px; }
.lmd-st-bar::-moz-progress-bar { background: var(--accent-fill); border-radius: 999px; }
.lmd-st-over .lmd-st-bar::-webkit-progress-value { background: var(--danger, #dc2626); }
.lmd-st-over .lmd-st-bar::-moz-progress-bar { background: var(--danger, #dc2626); }
.lmd-ask-card p.lmd-st-warn { margin: 0 0 10px; color: var(--danger, #dc2626); }
.lmd-ask-card.lmd-st-card { width: min(560px, 100%); max-height: min(640px, calc(100dvh - 40px)); display: flex; flex-direction: column; }
.lmd-st-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; color: var(--fg-muted); font-size: 13.5px; }
.lmd-st-list { flex: 1 1 auto; min-height: 80px; overflow-y: auto; border: 1px solid var(--line); border-radius: 10px; }
.lmd-st-row { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.lmd-st-row:last-child { border-bottom: 0; }
.lmd-st-thumb { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 8px; overflow: hidden; background: var(--line); color: var(--fg-muted); }
.lmd-st-thumb img { width: 100%; height: 100%; object-fit: cover; }
.lmd-st-thumb svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.lmd-st-info { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; font-size: 13.5px; color: var(--fg-muted); }
.lmd-st-info b { color: var(--fg); font-weight: 600; }
.lmd-st-del { flex: none; display: inline-grid; place-items: center; min-width: 36px; min-height: 36px; padding: 0; }
.lmd-st-del svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.lmd-st-del:hover { color: var(--danger, #dc2626); border-color: var(--danger, #dc2626); }
.lmd-ask-card .lmd-st-list p.lmd-st-empty { margin: 0; padding: 18px 12px; text-align: center; }
.lmd-ask-card p.lmd-st-note { margin: 10px 0 14px; font-size: 13px; }
.markdown-body img.lmd-img-wait { min-width: 48px; min-height: 48px; border-radius: 8px; background: var(--line); }
.markdown-body img.lmd-img-locked { outline: 1px dashed var(--fg-muted); outline-offset: -1px; }
.lmd-img-pick { flex-wrap: wrap; }
@media (max-width: 640px) {
  .lmd-st-slot { position: static; max-width: none; height: auto; flex-wrap: wrap; margin-bottom: 8px; white-space: normal; }
  .lmd-st-see { min-height: 32px; }
  .lmd-ask-card.lmd-st-card { max-height: calc(100dvh - 24px); padding: 18px 16px; }
  .lmd-st-del { min-width: 44px; min-height: 44px; }
  .lmd-st-head .lmd-seg button { min-height: 38px; }
}
@media print { .lmd-st-dlg { display: none !important; } }
/* Sesión en vivo sobre una nota del equipo: la línea que lo dice, arriba del cuadro. */
.lmd-ask-card.lmd-live-card p.lmd-live-team { margin: 0 0 12px; color: var(--fg); overflow-wrap: anywhere; }
/* Tarjeta de un tablero, campo Enlace: el botón para elegir otra nota, al lado del campo. */
.lmd-cd-link .lmd-cd-note { flex: none; min-height: 32px; white-space: nowrap; }
@media (pointer: coarse) { .lmd-cd-link .lmd-cd-note { min-height: 44px; } }
/* Quiénes tienen abierta la nota, personas e IA: una tira de avatares junto a la nube, con el cuadrito de la última edición. */
.lmd-here { position: relative; display: inline-flex; align-items: center; flex: none; height: 30px; padding: 0 4px; border: 0; border-radius: 999px; background: none; color: var(--fg); font: inherit; cursor: default; }
.lmd-here[hidden] { display: none; }
.lmd-here:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.lmd-here .lmd-live-av { border-color: var(--bg); }
.lmd-here-ai { background: var(--bg-soft); color: var(--accent); border-color: var(--line); }
.lmd-here .lmd-here-ai { border-color: var(--line); }
.lmd-here-ai svg { width: 13px; height: 13px; fill: currentColor; stroke: none; }
.lmd-here-busy svg { animation: lmd-here-pulse 1.4s ease-in-out infinite; }
@keyframes lmd-here-pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.45; transform: scale(0.82); } }
@media (prefers-reduced-motion: reduce) { .lmd-here-busy svg { animation: none; opacity: 0.7; } }
.lmd-here-more-s { display: none; }
.lmd-here-tip { position: absolute; top: calc(100% + 6px); right: 0; z-index: 60; display: none; flex-direction: column; gap: 3px; width: max-content; max-width: min(320px, calc(100vw - 24px)); padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--fg-muted); font: 400 12.5px/1.4 var(--lmd-font); text-align: left; white-space: normal; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.16); }
.lmd-here-tip b { color: var(--fg); font-weight: 600; }
.lmd-here:hover .lmd-here-tip, .lmd-here:focus-visible .lmd-here-tip, .lmd-here.lmd-on .lmd-here-tip { display: flex; }
.lmd-ask-card.lmd-live-card p.lmd-live-last { margin: 10px 0 0; }
@media (max-width: 720px), (max-height: 500px) and (pointer: coarse) {
  /* Entran dos avatares y la cuenta de los demás. */
  .lmd-here { height: 34px; }
  .lmd-here .lmd-live-avs > .lmd-live-av:nth-child(n+3) { display: none; }
  .lmd-here .lmd-live-avs > .lmd-live-av.lmd-here-more-s:nth-child(n) { display: inline-grid; }
}
@media print { .lmd-here { display: none !important; } }

/* ---------- Atajos de teclado (shortcuts.js) ---------- */
/* El botón: chico y apagado, abajo a la derecha, sobre el de volver arriba cuando ese está. Solo con teclado físico. */
.lmd-keys-btn {
  position: fixed; right: 27px; bottom: calc(52px + env(safe-area-inset-bottom, 0px)); width: 30px; height: 30px; padding: 0; border: 1px solid var(--line); border-radius: 8px;
  background: var(--bg-soft); color: var(--fg-muted); display: grid; place-items: center; cursor: pointer; z-index: 15; opacity: 0.55; transition: opacity 0.15s;
}
.lmd-keys-btn:hover, .lmd-keys-btn:focus-visible { opacity: 1; color: var(--fg); }
.lmd-keys-btn svg { width: 17px; height: 17px; }
.lmd-to-top:not([hidden]) + .lmd-keys-btn { bottom: calc(98px + env(safe-area-inset-bottom, 0px)); }
.lmd-nodoc .lmd-to-top + .lmd-keys-btn { bottom: calc(52px + env(safe-area-inset-bottom, 0px)); }
@media (hover: none), (pointer: coarse) { .lmd-keys-btn { display: none; } }
@media print { .lmd-keys-btn { display: none !important; } }
/* La hoja. */
.lmd-ask-card.lmd-keys-card { width: min(1060px, 100%); max-height: 100%; padding: 18px 20px 12px; display: flex; flex-direction: column; overflow: hidden; box-sizing: border-box; }
.lmd-keys-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 10px; }
.lmd-keys-head h3 { margin: 0; }
.lmd-keys-q { width: 100%; box-sizing: border-box; margin: 0 0 12px; padding: 8px 11px; border: 1px solid var(--line); border-radius: 9px; background: var(--bg-soft); color: var(--fg); font: inherit; flex: none; }
.lmd-keys-q:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.lmd-keys-body { flex: 1 1 auto; min-height: 0; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; padding-right: 4px; outline: none; }
.lmd-keys-cols { column-width: 290px; column-gap: 32px; }
.lmd-keys-group { break-inside: avoid; margin: 0 0 16px; }
.lmd-keys-group h4 { margin: 0 0 4px; font-size: 12px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--fg-faint); }
.lmd-keys-group ul { list-style: none; margin: 0; padding: 0; }
.lmd-keys-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 5px 0; border-top: 1px solid color-mix(in srgb, var(--line) 55%, transparent); font-size: 13.5px; line-height: 1.35; }
.lmd-keys-row[hidden], .lmd-keys-group[hidden] { display: none; }
.lmd-keys-what { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; overflow-wrap: anywhere; }
.lmd-keys-what small { font-size: 12px; color: var(--fg-faint); }
.lmd-keys-what [hidden] { display: none; }
.lmd-keys-what .lmd-link { font-size: 12px; text-align: left; }
.lmd-keys-set { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 4px; flex: none; max-width: 58%; }
.lmd-keys-set i { font-style: normal; color: var(--fg-faint); font-size: 12px; }
.lmd-keys-combo { display: inline-flex; gap: 3px; }
.lmd-keys kbd { display: inline-block; min-width: 12px; padding: 2px 6px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px; background: var(--bg-soft); color: var(--fg); font: 600 12px/1.3 var(--lmd-font); text-align: center; white-space: nowrap; }
.lmd-keys-off .lmd-keys-what > span, .lmd-keys-off .lmd-keys-set { opacity: 0.45; }
.lmd-ask-card p.lmd-keys-none { margin: 8px 0 16px; }
.lmd-ask-card p.lmd-keys-foot { flex: none; margin: 10px 0 0; padding-top: 10px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--fg-faint); }
@media (max-width: 720px) { .lmd-keys-q { font-size: 16px; } .lmd-ask-card.lmd-keys-card { padding: 14px 14px 10px; } }

/* Ajustes > IA (MCP): el interruptor de las instrucciones del espacio de proyecto, junto al botón que copia el mensaje. */
.lmd-acct .lmd-ai-ws { margin: 6px 0 0; font-size: 13px; color: var(--fg); }

/* Ajustes > Nube, bloque Seguridad: de la clave de IA guardada, el proveedor y sus últimos caracteres. */
.lmd-sec li p.lmd-sec-key { color: var(--fg); font-weight: 600; }
.lmd-sec li small .lmd-link { padding: 0; color: var(--accent); font-size: inherit; text-decoration: underline; }
@media (max-width: 720px), (max-height: 500px) and (pointer: coarse) {
  .lmd-sec li small .lmd-link { display: inline-flex; align-items: center; min-height: 40px; }
}
/* Importar a Markdown (import.js): el diálogo con sus dos etapas */
.lmd-imp-card { width: min(460px, 100%); }
.lmd-imp-card h3 { margin-bottom: 4px; }
.lmd-ask-card p.lmd-imp-name { margin: 0 0 16px; font-size: 13.5px; overflow-wrap: anywhere; }
.lmd-imp-stage { margin: 0 0 14px; }
.lmd-imp-stage[hidden], .lmd-imp-out[hidden], .lmd-imp-warn[hidden], .lmd-imp-file { display: none; }
.lmd-imp-row { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 6px; font-size: 13.5px; }
.lmd-imp-n { color: var(--fg-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.lmd-imp-bar { height: 6px; border-radius: 3px; background: var(--bg-soft); box-shadow: inset 0 0 0 1px var(--line); overflow: hidden; }
.lmd-imp-bar i { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--accent); transition: width 0.15s linear; }
.lmd-ask-card p.lmd-imp-live { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.lmd-ask-card p.lmd-imp-sum { margin: 2px 0 8px; color: var(--fg); font-weight: 600; }
.lmd-imp-warn { margin: 0 0 6px; padding-left: 18px; color: var(--fg-muted); font-size: 13.5px; }
.lmd-imp-warn li { margin: 2px 0; }
.lmd-ask-card p.lmd-imp-err { margin: 0 0 16px; }
.lmd-imp-card .lmd-ask-actions { margin-top: 16px; justify-content: flex-end; }
@media (prefers-reduced-motion: reduce) { .lmd-imp-bar i { transition: none; } }

/* ---------- Varios bloques a la vez (blocks.js) ---------- */
.lmd-article > .lmd-bsel { background: var(--accent-soft); box-shadow: 0 0 0 5px var(--accent-soft); outline: 1.5px solid color-mix(in srgb, var(--accent) 62%, transparent); outline-offset: 5px; border-radius: 3px; }
.lmd-article li.lmd-bsel { background: var(--accent-soft); box-shadow: 0 0 0 3px var(--accent-soft); outline: 1.5px solid color-mix(in srgb, var(--accent) 62%, transparent); outline-offset: 3px; border-radius: 3px; }
.lmd-bsel-moving .lmd-article li.lmd-bsel { opacity: 0.55; }
.lmd-bsel-bar { position: fixed; z-index: 45; display: flex; align-items: center; gap: 2px; padding: 4px; background: var(--bg-soft); border: 1px solid var(--line); border-radius: 9px; box-shadow: var(--shadow); font: 13px/1.2 var(--lmd-font); color: var(--fg); }
.lmd-bsel-bar[hidden], .lmd-bsel-bar button[hidden], .lmd-bsel-drop[hidden] { display: none; }
.lmd-bsel-n { padding: 0 8px 0 7px; color: var(--fg-muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.lmd-bsel-bar button { min-width: 30px; height: 30px; padding: 0 7px; border: 0; border-radius: 6px; background: transparent; color: var(--fg); font: inherit; cursor: pointer; display: grid; place-items: center; }
.lmd-bsel-bar button:hover { background: var(--accent-soft); color: var(--accent); }
.lmd-bsel-bar button[data-bs=del]:hover { background: color-mix(in srgb, #dc2626 16%, transparent); color: #dc2626; }
.lmd-bsel-bar button[data-bs=grip] { cursor: grab; color: var(--fg-muted); touch-action: none; }
.lmd-bsel-bar svg { width: 16px; height: 16px; }
.lmd-bsel-bar [data-bs=grip] svg, .lmd-bsel-bar [data-bs=more] svg { fill: currentColor; stroke: none; }
.lmd-bsel-bar .lmd-bsel-done { padding: 0 11px; color: var(--accent); font-weight: 600; }
.lmd-bsel-bar.lmd-bsel-dock { left: 50%; top: auto; bottom: calc(14px + var(--lmd-kb, 0px)); transform: translateX(-50%); max-width: calc(100vw - 16px); overflow-x: auto; }
.lmd-bsel-drop { position: fixed; z-index: 44; height: 3px; border-radius: 2px; background: var(--accent-fill); pointer-events: none; }
.lmd-bsel-moving .lmd-article > .lmd-bsel { opacity: 0.55; }
.lmd-bsel-moving, .lmd-bsel-moving * { cursor: grabbing !important; }
.lmd-bsel-ranging, .lmd-bsel-moving { user-select: none; -webkit-user-select: none; }
@media (pointer: coarse) { .lmd-bsel-bar button { min-width: 40px; height: 40px; } }
@media print { .lmd-bsel-bar, .lmd-bsel-drop { display: none !important; } .lmd-article > .lmd-bsel, .lmd-article li.lmd-bsel { background: none; box-shadow: none; outline: 0; } }
/* ---------- Ajustes: el mismo aire en todas las pestañas ---------- */
/* Entre un grupo y el siguiente hay 20 px o más, y los títulos de grupo llevan todos el mismo estilo. */
/* En Apariencia cada renglón es un grupo con su nombre (Tema, Color de acento, Tipografía...): van más separados.
   Para que la pestaña siga entrando sin scroll, la línea de arriba y el aviso del plan pago ocupan un poco menos. */
.lmd-two[data-tab=look] { gap: 20px 28px; padding-bottom: 12px; }
.lmd-two[data-tab=look] > .lmd-scope { margin: -14px 0 -8px; }
.lmd-two[data-tab=look] > .lmd-extra { padding: 9px 14px; }
.lmd-pcol { gap: 20px; }
.lmd-look-side { gap: 14px; }
.lmd-acct > h4, .lmd-sec h4, .lmd-site-sec h4, .lmd-plug-group h4 { margin: 24px 0 8px; font-size: 12px; font-weight: 700; line-height: 1.45; letter-spacing: 0.06em; text-transform: uppercase; color: var(--fg-faint); }
.lmd-acct > h4:first-child, .lmd-sec h4, .lmd-site-sec h4 { margin-top: 0; }
.lmd-acct > .lmd-pick, .lmd-acct > .lmd-field { margin-top: 12px; }
.lmd-acct > .lmd-acct-actions { margin-top: 16px; }
.lmd-acct > .lmd-field + .lmd-hint, .lmd-acct > .lmd-field + .lmd-tokens { margin-top: 12px; }
.lmd-site-sec { margin-top: 24px; }
.lmd-panel-foot .lmd-btn { display: inline-flex; align-items: center; gap: 8px; }
/* Plugins: bloques con subtítulo en dos columnas parejas, y cada interruptor en un renglón de 40 px. */
.lmd-plug { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 40px; align-items: start; }
.lmd-plug-col { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.lmd-plug-group { min-width: 0; }
.lmd-plug-group h4 { margin: 0 0 2px; }
.lmd-plug .lmd-switch { min-height: 40px; padding: 0; font-size: 13.5px; }
.lmd-plug .lmd-switch span { min-width: 0; overflow-wrap: anywhere; }
/* Herramientas: dos sub-pestañas, las de la app y lo que comparte la comunidad. */
.lmd-subtabs { display: flex; gap: 4px; margin: 0 0 18px; border-bottom: 1px solid var(--line); }
.lmd-subtabs button { position: relative; height: 38px; padding: 0 14px; border: 0; border-radius: 8px 8px 0 0; background: none; color: var(--fg-muted); font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; }
.lmd-subtabs button:hover { color: var(--fg); background: var(--bg-soft); }
.lmd-subtabs button.lmd-on { color: var(--accent); }
.lmd-subtabs button.lmd-on::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--accent-fill); }
.lmd-subtabs button:focus-visible { outline: 2px solid var(--accent-fill); outline-offset: -2px; }
.lmd-subpane[hidden] { display: none; }
.lmd-subpane > .lmd-gal { margin-top: 0; padding-top: 0; border-top: 0; }
.lmd-gal .lmd-gal-lead { margin-bottom: 16px; }
.lmd-gal-bar { margin-bottom: 16px; }
/* Nube, bloque Seguridad: una tarjeta por hecho, en dos columnas del mismo alto por fila. Arriba el ícono y el
   título, después el párrafo, y al pie la línea técnica como etiqueta. Con cinco, la última va a lo ancho. */
[data-acct=cloud] .lmd-acct-actions { margin-top: 16px; }
.lmd-sec { margin: 28px 0 0; padding: 24px 0 4px; border-top: 1px solid var(--line); }
.lmd-sec h4 { margin-bottom: 14px; }
.lmd-sec ul { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin: 0; padding: 0; list-style: none; }
.lmd-sec li { display: flex; flex-direction: column; gap: 8px; min-width: 0; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-soft); }
.lmd-sec li:last-child:nth-child(odd) { grid-column: 1 / -1; }
.lmd-sec-head { display: flex; align-items: center; gap: 10px; min-width: 0; }
.lmd-sec-ico { width: 30px; height: 30px; }
.lmd-sec li b { min-width: 0; font-size: 14px; }
.lmd-sec li p { margin: 0; line-height: 1.5; }
.lmd-sec li small.lmd-sec-tech { align-self: flex-start; max-width: 100%; margin-top: auto; padding: 4px 9px; border: 1px solid var(--line); border-radius: 7px; background: var(--bg); font-size: 11.5px; line-height: 1.4; color: var(--fg-muted); }
.lmd-sec li > :nth-last-child(2) { margin-bottom: 4px; }
.lmd-sec-pick { margin-top: 0; }
.lmd-sec-foot { margin-top: 16px; }
[data-acct=cloud] .lmd-acct-del { margin-top: 12px; }
/* Protección de extremo a extremo: el estado en una línea, arriba del bloque de seguridad, con su botón. */
.lmd-e2e { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px; margin: 28px 0 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-soft); }
.lmd-e2e + .lmd-sec { margin-top: 20px; }
.lmd-e2e p { display: flex; align-items: center; gap: 8px; flex: 1 1 220px; min-width: 0; margin: 0; font-size: 13.5px; color: var(--fg-muted); overflow-wrap: anywhere; }
.lmd-e2e p b { color: var(--fg); font-weight: 600; }
.lmd-e2e-ico { flex: none; display: inline-flex; color: var(--accent); }
.lmd-e2e[data-e2e=off] .lmd-e2e-ico { color: var(--fg-faint); }
.lmd-e2e-ico svg, .lmd-e2e-more svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.lmd-e2e-acts { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.lmd-e2e-more { display: inline-flex; align-items: center; padding: 7px 8px; }
.lmd-sec-act { display: flex; flex-wrap: wrap; gap: 4px 16px; }
/* El aviso de la primera nota en la nube: una tarjeta chica en una esquina, que no tapa la nota ni frena nada. */
.lmd-protect-hint { position: fixed; right: 22px; bottom: 48px; z-index: 46; box-sizing: border-box; width: min(380px, calc(100vw - 32px)); padding: 16px 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg); color: var(--fg); box-shadow: var(--shadow); font: 14px/1.5 var(--lmd-font); }
.lmd-protect-hint b { display: block; margin: 0 0 6px; font-size: 15px; }
.lmd-protect-hint p { margin: 0 0 14px; font-size: 13.5px; color: var(--fg-muted); }
.lmd-protect-acts { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.lmd-protect-acts .lmd-link { margin-left: auto; padding: 5px 2px; color: var(--accent); font-size: 13px; text-decoration: underline; }
@media (max-width: 860px), (max-height: 500px) and (pointer: coarse) {
  .lmd-sec ul { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 720px), (max-height: 500px) and (pointer: coarse) {
  .lmd-protect-hint { left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom, 0px) + var(--lmd-kb, 0px)); width: auto; max-height: calc(100dvh - 24px); overflow: auto; }
  .lmd-protect-acts .lmd-btn { min-height: 44px; flex: 1 1 auto; }
  .lmd-protect-acts .lmd-link { min-height: 44px; margin-left: 0; flex-basis: 100%; text-align: left; }
  .lmd-e2e-acts .lmd-btn { min-height: 44px; }
}
@media print { .lmd-protect-hint { display: none !important; } }
@media (max-width: 720px), (max-height: 500px) and (pointer: coarse) {
  .lmd-plug { grid-template-columns: minmax(0, 1fr); }
  .lmd-subtabs button { height: 42px; flex: 1 1 0; }
  .lmd-sec li { padding: 14px; }
}
/* ---------- Tablero: columnas parejas y campos que cortan línea ---------- */
/* Todas las columnas miden lo mismo: se reparten el ancho que haya, con un mínimo de 240 px, y si no entran el
   tablero desliza de costado. El mínimo es fijo: lo que hay adentro de una tarjeta nunca ensancha su columna. */
.lmd-col { flex: 1 0 240px; min-width: 240px; max-width: 420px; box-sizing: border-box; }
.lmd-cards, .lmd-card, .lmd-card-main { min-width: 0; }
.lmd-card-text a { overflow-wrap: anywhere; word-break: break-word; }
.lmd-chip { white-space: normal; overflow-wrap: anywhere; text-overflow: clip; }
/* Un campo de texto en la tarjeta: hasta tres renglones, y después puntos suspensivos. */
.lmd-chip-text { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden; }
.lmd-chip-long { flex: 1 1 100%; }
/* El detalle de una tarjeta: el título y los campos de texto son áreas que crecen con lo escrito. */
/* El lugar de la barra de scroll queda reservado: si apareciera al crecer un campo, el texto cortaría distinto. */
.lmd-cd-card { width: min(560px, 100%); scrollbar-gutter: stable; scrollbar-width: thin; }
.lmd-cd-grow { display: block; box-sizing: border-box; width: 100%; min-width: 0; margin: 0; resize: none; overflow-x: hidden; overflow-y: auto; overflow-wrap: anywhere; white-space: pre-wrap; font: inherit; line-height: 1.45; scrollbar-width: thin; }
textarea.lmd-cd-title { min-height: 40px; max-height: 40vh; margin: 0 0 14px; font-size: 20px; font-weight: 700; line-height: 1.3; }
.lmd-cd-short, .lmd-cd-long { min-height: 36px; max-height: calc(8 * 1.45em + 16px); padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg-soft); color: var(--fg); outline: none; }
.lmd-cd-short:focus, .lmd-cd-long:focus { border-color: var(--accent-fill); }
.lmd-cd-short:disabled, .lmd-cd-long:disabled { opacity: 0.7; }
.lmd-cd-long { min-height: calc(3 * 1.45em + 16px); padding-right: 36px; }
.lmd-cd-longbox { position: relative; min-width: 0; }
.lmd-cd-open .lmd-cd-long { max-height: 60vh; }
.lmd-cd-expand { position: absolute; right: 6px; bottom: 6px; display: grid; place-items: center; width: 24px; height: 24px; padding: 0; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--fg-muted); cursor: pointer; }
.lmd-cd-expand[hidden] { display: none; }
.lmd-cd-expand:hover, .lmd-cd-expand:focus-visible { color: var(--accent); border-color: var(--accent-fill); }
.lmd-cd-expand svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transform: rotate(90deg); }
.lmd-cd-open .lmd-cd-expand svg { transform: rotate(-90deg); }
/* El nombre del campo queda arriba cuando su valor ocupa varios renglones. */
.lmd-cd-attr { align-items: start; }
.lmd-cd-attr > .lmd-cd-ico, .lmd-cd-attr > .lmd-cd-key, .lmd-cd-attr > .lmd-cd-switch, .lmd-cd-attr > .lmd-cd-rm { align-self: start; margin-top: 9px; }
.lmd-cd-attr > .lmd-cd-rm { margin-top: 5px; }
@media (max-width: 720px), (max-height: 500px) and (pointer: coarse) {
  .lmd-col { flex: 0 0 min(82vw, 300px); min-width: 0; max-width: none; }
  .lmd-cd-short, .lmd-cd-long { min-height: 44px; padding: 10px 9px; font-size: 16px; }
  .lmd-cd-long { min-height: calc(3 * 1.45em + 22px); }
  .lmd-cd-expand { width: 32px; height: 32px; }
  .lmd-cd-attr > .lmd-cd-ico, .lmd-cd-attr > .lmd-cd-key, .lmd-cd-attr > .lmd-cd-switch, .lmd-cd-attr > .lmd-cd-rm { margin-top: 0; align-self: center; }
}
@media print { .lmd-col { flex: 1 1 240px; } }

/* ---------- Avisos: cada tipo con su ícono, y el tipo se elige tocando el título ---------- */
/* Un aviso se distingue de una cita también sin color: lleva ícono y rótulo. El ícono es una máscara pintada con el color del título. */
/* La regla de la cita (.markdown-body blockquote) pesa más que .lmd-alert: sin esto el aviso salía con la barra gris y el texto tenue de una cita. */
/* Un color por tipo y por modo, el mismo para la barra, el título y su ícono: 4.5:1 o más sobre el panel y el fondo de los doce temas (tests/themes.mjs). */
.lmd-alert-note { --lmd-alert-c: #1a56c4; } .lmd-alert-tip { --lmd-alert-c: #116a37; } .lmd-alert-important { --lmd-alert-c: #6535d9; } .lmd-alert-warning { --lmd-alert-c: #8f4d00; } .lmd-alert-caution { --lmd-alert-c: #b91c1c; }
.lmd-dark .lmd-alert-note { --lmd-alert-c: #6ea8ff; } .lmd-dark .lmd-alert-tip { --lmd-alert-c: #4ccb80; } .lmd-dark .lmd-alert-important { --lmd-alert-c: #b39bfa; } .lmd-dark .lmd-alert-warning { --lmd-alert-c: #f0a23a; } .lmd-dark .lmd-alert-caution { --lmd-alert-c: #ff7b7b; }
.markdown-body blockquote.lmd-alert { padding: 0.7em 1em; border-left-width: 4px; border-left-color: var(--lmd-alert-c, var(--fg-faint)); color: var(--fg); }
.markdown-body blockquote.lmd-alert .lmd-alert-title { color: var(--lmd-alert-c, var(--fg)); }
.lmd-alert-title { display: flex; align-items: center; gap: 0.45em; }
.lmd-alert-title::before { content: ""; flex: none; width: 1.1em; height: 1.1em; background: currentColor; -webkit-mask: var(--lmd-alert-ico) center / contain no-repeat; mask: var(--lmd-alert-ico) center / contain no-repeat; }
.lmd-alert-note { --lmd-alert-ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 11v5.500M12 7.500v.200'/%3E%3C/svg%3E"); }
.lmd-alert-tip { --lmd-alert-ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 17.500h6M10 21h4M8.500 14.500a6 6 0 1 1 7 0c-.600.500-1 1.200-1 2v1h-5v-1c0-.800-.400-1.500-1-2z'/%3E%3C/svg%3E"); }
.lmd-alert-important { --lmd-alert-ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 5h16v11h-8l-4.500 4v-4H4z'/%3E%3Cpath d='M12 8v3.500M12 13.800v.200'/%3E%3C/svg%3E"); }
.lmd-alert-warning { --lmd-alert-ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3.500l9.500 16.500h-19z'/%3E%3Cpath d='M12 10v4.500M12 17v.200'/%3E%3C/svg%3E"); }
.lmd-alert-caution { --lmd-alert-ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8.300 3h7.400L21 8.300v7.400L15.700 21H8.300L3 15.700V8.300z'/%3E%3Cpath d='M12 7.500v5M12 16v.200'/%3E%3C/svg%3E"); }
/* Editando, el título es un botón: abre los cinco tipos. */
.lmd-editing .lmd-alert-title { width: fit-content; min-height: 28px; padding-right: 4px; border-radius: 6px; cursor: pointer; }
.lmd-editing .lmd-alert-title::after { content: ""; flex: none; width: 0.42em; height: 0.42em; margin: -0.2em 0 0 0.1em; border-right: 2px solid; border-bottom: 2px solid; transform: rotate(45deg); opacity: 0.65; }
.lmd-editing .lmd-alert-title:hover { background: var(--bg); }
.lmd-alert-dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--lmd-alert-c, var(--fg-faint)); }
.lmd-menu-alert button[aria-checked=true] { font-weight: 650; color: var(--accent); }
@media (pointer: coarse) { .lmd-editing .lmd-alert-title { min-height: 40px; } }
@media print { .lmd-alert-title::after { display: none; } }

/* ---------- Explorador con el dedo: el renglón levantado, lo que viaja con el dedo y el diálogo "Mover a…" ---------- */
/* Mantener apretado levanta el renglón. Al moverlo, una etiqueta con su nombre sigue al dedo y el panel no se desliza. */
.lmd-node.lmd-lifted { position: relative; z-index: 1; border-radius: 6px; background: var(--accent-soft); color: var(--fg); box-shadow: inset 0 0 0 2px var(--accent-fill), var(--shadow); transform: scale(1.02); transition: transform 0.12s ease; }
.lmd-drag-ghost { position: fixed; left: 0; top: 0; z-index: 90; display: flex; align-items: center; gap: 8px; max-width: min(280px, 72vw); padding: 9px 12px; border: 1px solid var(--accent-fill); border-radius: 10px; background: var(--bg); color: var(--fg); box-shadow: var(--shadow); font: 600 14px/1.3 var(--lmd-font); pointer-events: none; }
.lmd-drag-ghost svg, .lmd-mv-list svg { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.lmd-drag-ghost svg { flex: none; width: 16px; height: 16px; }
.lmd-drag-ghost span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lmd-tree-drag .lmd-pane, .lmd-tree-drag .lmd-zones { overflow: hidden; }
@media (pointer: coarse) {
  /* Con el dedo, mantener apretado es de la app: ni el menú del enlace, ni seleccionar el nombre, ni el arrastre del navegador. */
  .lmd-tree-box .lmd-node, .lmd-trash-link { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; -webkit-user-drag: none; }
  /* El menú de un renglón del explorador ("Mover a…" entre ellos): renglones altos para el dedo. */
  .lmd-menu-narrow .lmd-menu-list button { min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) { .lmd-node.lmd-lifted { transform: none; transition: none; } }
.lmd-mv-card { display: flex; flex-direction: column; max-height: min(560px, 100%); }
.lmd-mv-card h3 { overflow-wrap: anywhere; }
.lmd-mv-list { flex: 1 1 auto; min-height: 0; margin: 4px 0 14px; padding: 0; list-style: none; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.lmd-mv-list button { display: flex; align-items: center; gap: 9px; width: 100%; min-height: 44px; padding: 6px 10px; border: 0; border-radius: 8px; background: transparent; color: var(--fg); font: inherit; text-align: left; cursor: pointer; }
.lmd-mv-list button:hover, .lmd-mv-list button:focus-visible { background: var(--bg-soft); }
.lmd-mv-list button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.lmd-mv-list button:disabled { color: var(--fg-faint); background: transparent; cursor: default; }
.lmd-mv-list svg { flex: none; width: 17px; height: 17px; }
.lmd-mv-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lmd-mv-list small { margin-left: auto; padding-left: 10px; font-size: 12px; color: var(--fg-faint); white-space: nowrap; }
.lmd-mv .lmd-ask-actions { justify-content: flex-end; }
.lmd-mv .lmd-ask-actions .lmd-btn { min-height: 44px; }
@media print { .lmd-drag-ghost { display: none !important; } }

/* ---------- Teléfono: menús en hoja, avisos a la vista con el teclado abierto y filas que avisan que siguen ---------- */
/* Una opción filtrada del menú de insertar se va de verdad (los botones del menú son flex). */
.lmd-menu [hidden] { display: none !important; }
/* La hoja: touch.js la pega abajo de la zona visible (arriba del teclado) y le pone el alto máximo. */
.lmd-menu.lmd-sheet { left: 8px !important; right: 8px; width: auto !important; max-width: none !important; padding: 8px; border-radius: 14px; overflow-y: auto; overscroll-behavior: contain; }
.lmd-menu.lmd-sheet .lmd-menu-note { max-width: none; }
/* En la hoja, lo del bloque (mover, duplicar, eliminar) va primero: es por lo que se abrió desde la manija, y abajo quedaría fuera de la vista. */
.lmd-menu-ins.lmd-sheet { display: flex; flex-direction: column; }
.lmd-menu-ins.lmd-sheet > * { flex: none; }
.lmd-menu-ins.lmd-sheet > :nth-last-child(-n+2) { order: -1; }
/* Y se desvanece abajo mientras quede algo por deslizar. */
.lmd-menu.lmd-sheet::after { content: ""; position: sticky; bottom: -8px; display: block; flex: none; height: 20px; margin-top: -20px; background: linear-gradient(to bottom, transparent, var(--bg-soft)); pointer-events: none; }
/* El aviso de una advertencia o un error cuando el teclado tapa el pie: arriba, debajo de la barra. */
.lmd-flash-top { position: fixed; z-index: 62; left: 8px; right: 8px; top: calc(62px + env(safe-area-inset-top, 0px)); max-width: 520px; margin: 0 auto; padding: 10px 14px; border: 1px solid var(--line); border-left: 3px solid var(--accent-fill); border-radius: 10px; background: var(--bg); color: var(--fg); box-shadow: var(--shadow); font: 13.5px/1.4 var(--lmd-font); }
.lmd-flash-top.lmd-error { border-left-color: var(--danger, #dc2626); }
/* El aviso del oscurecido forzado: el texto arriba y las dos salidas abajo, a lo ancho. */
.lmd-cl-toast.lmd-forced-toast { left: 8px; right: 8px; transform: none; flex-wrap: wrap; gap: 4px 18px; justify-content: flex-end; max-width: 520px; margin: 0 auto; padding: 12px 14px 6px; bottom: calc(46px + env(safe-area-inset-bottom, 0px) + var(--lmd-kb, 0px)); line-height: 1.45; }
.lmd-forced-toast > span { flex: 1 1 100%; }
.lmd-forced-toast .lmd-link { min-height: 40px; white-space: nowrap; }
/* La etiqueta que presenta el micrófono la primera vez. */
.lmd-dct-hint { position: fixed; z-index: 41; padding: 7px 11px; border-radius: 9px; background: var(--fg); color: var(--bg); font: 600 13px/1.2 var(--lmd-font); white-space: nowrap; box-shadow: var(--shadow); pointer-events: none; }
.lmd-dct-hint[hidden] { display: none; }
/* Una fila que se desliza de costado se desvanece del lado donde queda algo por ver. */
.lmd-more-r { -webkit-mask-image: linear-gradient(to left, transparent 0, #000 44px); mask-image: linear-gradient(to left, transparent 0, #000 44px); }
.lmd-more-l { -webkit-mask-image: linear-gradient(to right, transparent 0, #000 44px); mask-image: linear-gradient(to right, transparent 0, #000 44px); }
.lmd-more-l.lmd-more-r { -webkit-mask-image: linear-gradient(to right, transparent 0, #000 44px, #000 calc(100% - 44px), transparent 100%); mask-image: linear-gradient(to right, transparent 0, #000 44px, #000 calc(100% - 44px), transparent 100%); }
@media (pointer: coarse) {
  /* La manija del bloque: angosta para entrar en el margen, con una zona de toque de 44 px alrededor. */
  .lmd-handle { width: 26px; height: 32px; }
  .lmd-handle::before { content: ""; position: absolute; inset: -7px -10px; }
  /* Botones chicos de la nota y del panel: se ven igual, y la zona de toque sobresale hasta unos 44 px. */
  .lmd-view button, .lmd-cl-more, .lmd-cl-grip, .lmd-col-menu, .lmd-zone-btn, .lmd-xroot .lmd-tree-up { position: relative; }
  .lmd-view button::after { content: ""; position: absolute; inset: -9px 0; }
  .lmd-fold-tog::after, .lmd-cl-more::after, .lmd-cl-grip::after, .lmd-col-menu::after, .lmd-code-copy::after { content: ""; position: absolute; inset: -7px; }
  .lmd-zone-btn::after, .lmd-xroot .lmd-tree-up::after { content: ""; position: absolute; inset: -4px -2px; }
  .markdown-body .lmd-task::after { content: ""; position: absolute; inset: -14px; }
}
@media (max-width: 720px), (max-height: 500px) and (pointer: coarse) {
  .lmd-dgm-add > div { padding-right: 4px; }
  .lmd-dgm-add button { min-height: 40px; }
  .lmd-fx-tabs button { min-height: 40px; padding: 3px 12px; }
  .lmd-subtabs button { height: 44px; }
  .lmd-seg button { height: 40px; }
  .lmd-card-add { min-height: 44px; }
  .lmd-tl-more, .lmd-tl-back, .lmd-tl-opts .lmd-btn { min-height: 40px; }
  /* La barra de la lectura: a lo ancho, los cuatro botones y la velocidad arriba, idioma y voz abajo. */
  .lmd-spk { left: 8px; right: 8px; transform: none; max-width: 520px; margin: 0 auto; }
  .lmd-spk .lmd-icon-btn { width: 44px; height: 44px; }
  .lmd-spk select { flex: 1 1 96px; max-width: none; height: 44px; }
  .lmd-spk select[data-spk=rate] { flex: 0 0 76px; }
}
@media print { .lmd-flash-top, .lmd-forced-toast, .lmd-dct-hint { display: none !important; } }
