@font-face {
  font-family: "IBM Plex Sans";
  src: url("fonts/ibm-plex-sans-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Sans";
  src: url("fonts/ibm-plex-sans-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  font-family: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  overscroll-behavior-y: contain;
  transition: background .25s ease, color .25s ease;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
.detail-text, .reform-note, .note-card p { -webkit-user-select: text; user-select: text; -webkit-touch-callout: default; }

/* ---------- THEME: DARK (negro y rojo vino) ---------- */
body[data-theme="dark"] {
  --bg: #0d0d0d;
  --bg-alt: #161616;
  --surface: #1a1a1a;
  --surface-2: #212121;
  --border: #2b2b2b;
  --text: #f5f5f0;
  --text-dim: #a8a8a0;
  --accent: #d8536a;
  --accent-grad: #d8536a;
  --accent-text: #180608;
  --accent-soft: rgba(216, 83, 106, .14);
  --danger: #e05a4e;
  --shadow: 0 8px 24px rgba(0,0,0,.45);
  --header-bg: linear-gradient(120deg, #8a2438 0%, #6e1c2c 45%, #4a1420 80%, #2e0d15 100%);
  --nav-bg: #121212;
}

/* ---------- THEME: LIGHT (blanco y vino) ---------- */
body[data-theme="light"] {
  --bg: #fbf3f2;
  --bg-alt: #ffffff;
  --surface: #ffffff;
  --surface-2: #fbeef0;
  --border: #ecd8db;
  --text: #2b1418;
  --text-dim: #7d5b60;
  --accent: #7a1f2b;
  --accent-grad: linear-gradient(135deg, #b23a4e, #7a1f2b 55%, #4a1420);
  --accent-text: #ffffff;
  --accent-soft: rgba(122, 31, 43, .12);
  --danger: #d1483a;
  --shadow: 0 8px 24px rgba(122,31,43,.14);
  --header-bg: linear-gradient(120deg, #b23a4e 0%, #8a2438 45%, #6e1c2c 80%, #4a1420 100%);
  --nav-bg: #ffffff;
}
body[data-theme="light"] #app {
  background:
    radial-gradient(620px 420px at 112% -8%, rgba(178, 58, 78, .18), transparent 68%),
    radial-gradient(520px 400px at -12% 18%, rgba(122, 31, 43, .10), transparent 70%),
    linear-gradient(180deg, #fbeef0 0%, #fdf6f6 28%, #ffffff 64%);
  background-attachment: fixed;
}
body[data-theme="light"] .bottom-nav, body[data-theme="light"] .modal {
  background: rgba(255,255,255,.92); backdrop-filter: blur(10px);
}
body[data-theme="light"] .side-menu { background: linear-gradient(180deg, #fbeef0 0%, #ffffff 70px); }

#app { min-height: 100vh; display: flex; flex-direction: column; max-width: 560px; margin: 0 auto; position: relative; }

/* ---------- TOPBAR ---------- */
.topbar { display: flex; align-items: center; gap: 12px; padding: 14px 16px calc(14px + env(safe-area-inset-top,0px)); background: var(--header-bg); position: sticky; top: 0; z-index: 20; }
.topbar-title { flex: 1; }
.topbar-title h1 { font-size: 19px; font-weight: 800; color: #fff; }
.topbar-title p { font-size: 12px; color: rgba(255,255,255,.8); margin-top: 1px; }
.icon-btn { width: 36px; height: 36px; border-radius: 10px; border: none; background: rgba(255,255,255,.18); color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.icon-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- SIDE MENU ---------- */
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 40; }
.overlay.hidden { display: none; }
.side-menu { position: fixed; top: 0; left: 0; bottom: 0; width: 280px; z-index: 50; background: linear-gradient(180deg, #2e0d15 0%, var(--bg-alt) 70px); border-right: 1px solid var(--border); padding: 20px 14px; display: flex; flex-direction: column; gap: 2px; transition: transform .2s ease; overflow-y: auto; }
.side-menu.hidden { transform: translateX(-110%); display: flex; }
.side-menu-title { font-weight: 800; font-size: 18px; padding: 4px 6px 18px; color: var(--accent); }
.side-item { display: flex; align-items: center; gap: 14px; padding: 10px 10px; border: none; background: transparent; color: var(--text-dim); font-size: 15px; font-weight: 600; text-align: left; cursor: pointer; border-radius: 16px; border-bottom: 1px solid var(--border); }
.side-item:last-child { border-bottom: none; }
.side-item .si-icon { width: 44px; height: 44px; flex-shrink: 0; border-radius: 50%; background: var(--accent-grad); display: flex; align-items: center; justify-content: center; }
.side-item .si-icon svg { width: 18px; height: 18px; fill: none; stroke: var(--accent-text); stroke-width: 1.8; flex-shrink: 0; }
.side-item.active { background: var(--accent-grad); color: var(--accent-text); border-bottom-color: transparent; box-shadow: var(--shadow); }
.side-item.active .si-icon { box-shadow: 0 0 0 2px rgba(0,0,0,.12); }

/* ---------- MAIN / VIEWS ---------- */
main { flex: 1; padding: 16px 16px 90px; }
.view.hidden { display: none; }

.search-bar { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 12px 14px; cursor: pointer; box-shadow: var(--shadow); }
.search-bar svg { width: 18px; height: 18px; fill: none; stroke: var(--text-dim); stroke-width: 2; flex-shrink: 0; }
.search-placeholder { color: var(--text-dim); font-size: 14.5px; }
.search-bar input { border: none; outline: none; background: transparent; color: var(--text); font-size: 14.5px; width: 100%; font-family: inherit; }
.search-bar input::placeholder { color: var(--text-dim); }
.search-bar.hidden { display: none; }

.code-cards { display: grid; grid-template-columns: 1fr; gap: 12px; margin-top: 16px; }
.code-card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 18px 12px; display: flex; flex-direction: row; align-items: center; gap: 14px; cursor: pointer; font-size: 14.5px; font-weight: 700; color: var(--text); text-align: left; box-shadow: var(--shadow); }
.code-card-icon { width: 50px; height: 50px; border-radius: 16px; background: var(--accent-grad); display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow); flex-shrink: 0; }
.code-card-icon svg.icon-filled { color: var(--accent-text); width: 26px; height: 26px; fill: currentColor; stroke: none; }
.si-icon svg.icon-filled, .quick-btn svg.icon-filled, .nav-item svg.icon-filled { fill: currentColor; stroke: none; }
.si-icon svg.icon-filled { color: var(--accent-text); width: 24px; height: 24px; }
.quick-btn svg.icon-filled { color: var(--accent); width: 22px; height: 22px; }

.quick-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px; }
.quick-btn { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 14px 4px; display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 11.5px; color: var(--text-dim); cursor: pointer; }
.quick-btn svg { width: 20px; height: 20px; fill: none; stroke: var(--accent); stroke-width: 1.8; }

.section-head { display: flex; justify-content: space-between; align-items: center; margin: 22px 0 10px; }
.section-head h2 { font-size: 15px; font-weight: 700; }
.link-btn { background: none; border: none; color: var(--accent); font-size: 12.5px; font-weight: 600; cursor: pointer; }

.recent-list { display: flex; flex-direction: column; gap: 8px; }
.recent-item { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 11px 12px; cursor: pointer; }
.recent-item .ri-icon { width: 30px; height: 30px; border-radius: 9px; background: var(--accent-grad); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.recent-item .ri-icon svg { width: 15px; height: 15px; fill: none; stroke: var(--accent-text); stroke-width: 2; }
.recent-item .ri-main { flex: 1; min-width: 0; }
.recent-item .ri-main .ri-title { font-size: 13.5px; font-weight: 600; }
.recent-item .ri-main .ri-sub { font-size: 11.5px; color: var(--text-dim); }
.recent-item .chev { color: var(--text-dim); }

/* ---------- LIST VIEW ---------- */
.list-title { font-size: 17px; font-weight: 800; margin: 16px 0 10px; }
.list-title-row { display: flex; justify-content: space-between; align-items: center; }
.list-title-row .list-title { margin: 16px 0 10px; }
.icon-link-btn {
  background: none; border: none; padding: 6px; border-radius: 8px;
  color: var(--accent); display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.icon-link-btn svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.criterios-intro { font-size: 12.5px; color: var(--text-dim); margin: -4px 0 14px; line-height: 1.5; }

.article-list { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.article-list.hidden { display: none; }
.article-row { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px 13px; cursor: pointer; display: flex; flex-direction: column; gap: 3px; }
.article-row .ar-num { font-size: 13px; font-weight: 700; color: var(--accent); }
.article-row .ar-epigrafe { font-size: 12.5px; font-weight: 600; color: var(--text); }
.article-row .ar-badge-reforma { align-self: flex-start; font-size: 10px; font-weight: 800; letter-spacing: .03em; color: var(--accent-text); background: var(--accent-grad); border-radius: 20px; padding: 2px 9px; text-transform: uppercase; }
.article-row .ar-snippet { font-size: 12px; color: var(--text-dim); line-height: 1.4; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

.load-more { display: block; margin: 14px auto 0; padding: 10px 22px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--accent); font-weight: 700; cursor: pointer; }
.load-more.hidden { display: none; }

.mode-toggle { display: flex; gap: 4px; padding: 4px; margin-bottom: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; }
.mode-btn { flex: 1; padding: 8px 0; border: none; border-radius: 10px; background: transparent; color: var(--text-dim); font-size: 13px; font-weight: 700; cursor: pointer; }
.mode-btn.active { background: var(--accent-grad); color: var(--accent-text); }

/* ---------- ÍNDICE ---------- */
.idx-tree.hidden { display: none; }
.idx-lb, .idx-ti { border: 1px solid var(--border); border-radius: 12px; margin-bottom: 8px; padding: 6px 12px; background: var(--surface); }
.idx-lb > summary, .idx-ti > summary { padding: 8px 2px; cursor: pointer; font-weight: 700; font-size: 13.5px; color: var(--text); }
.idx-ti > summary { font-size: 12.5px; font-weight: 600; color: var(--text-dim); }
.idx-cp { font-size: 11.5px; font-weight: 700; color: var(--accent); margin: 8px 0 4px; text-transform: uppercase; letter-spacing: .03em; }
.idx-arts { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.idx-art-chip { padding: 4px 10px; border-radius: 20px; border: none; cursor: pointer; background: var(--accent-soft); color: var(--accent); font-size: 11.5px; font-weight: 700; font-family: inherit; }

/* ---------- DETAIL ---------- */
.back-btn { display: flex; align-items: center; gap: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px; color: var(--text); font-size: 13.5px; font-weight: 600; cursor: pointer; margin-bottom: 12px; }
.back-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.4; }

.detail-article { position: relative; }
.detail-breadcrumb { font-size: 11.5px; line-height: 1.5; color: var(--text-dim); margin-bottom: 8px; font-weight: 600; }
.detail-breadcrumb .db-sep { opacity: .5; margin: 0 1px; }
.detail-article h1 { font-size: 22px; font-weight: 800; color: var(--accent); margin-bottom: 10px; }
.chip { display: inline-block; font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 20px; vertical-align: middle; margin-left: 6px; }
.chip-nuevo { background: #2e6b46; color: #d9f7e2; }
.detail-epigrafe { font-size: 14.5px; font-weight: 700; margin-bottom: 10px; color: var(--text); }
.detail-text { font-size: 15px; line-height: 1.4; color: var(--text); text-align: justify; text-justify: inter-word; hyphens: auto; }
.detail-text p { margin-bottom: 10px; }
.detail-text p:last-child { margin-bottom: 0; }
.detail-text strong { color: var(--text); font-weight: 700; }
.detail-text .txt-numeral { padding-left: 22px; text-indent: -22px; }
.detail-text .txt-numeral-nested { padding-left: 38px; text-indent: -16px; }
.detail-text .txt-inciso { padding-left: 38px; text-indent: -16px; }
.detail-text .txt-romano { padding-left: 54px; text-indent: -16px; }

.detail-text.jur-texto { line-height: 1.22; }
.detail-text.jur-texto p { margin-bottom: 6px; }

.reform-note { margin-top: 16px; padding: 14px 16px; border-radius: 12px; background: var(--surface-2); border-left: 3px solid var(--accent); }
.reform-note strong { display: block; font-size: 11.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--accent); margin-bottom: 10px; }
.reform-entry { padding: 8px 0; border-top: 1px solid var(--border); }
.reform-entry:first-of-type { border-top: none; padding-top: 0; }
.reform-ley { font-size: 13px; font-weight: 700; color: var(--text); }
.reform-gaceta { font-size: 12px; color: var(--text-dim); }
.reform-nota { font-size: 12.5px; line-height: 1.5; color: var(--text-dim); margin-top: 4px; font-style: italic; }

.const-note { margin-top: 16px; padding: 14px 16px; border-radius: 12px; background: var(--surface-2); border-left: 3px solid var(--danger); }
.const-note strong { display: block; font-size: 11.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--danger); margin-bottom: 6px; }
.const-note p { font-size: 12.5px; line-height: 1.5; color: var(--text-dim); }

.concordancia-note { margin-top: 18px; }
.concordancia-note .cn-label {
  font-size: 11.5px; font-weight: 700; color: var(--text-dim);
  text-transform: uppercase; letter-spacing: .04em; margin-bottom: 8px; display: block;
}
.concordancia-note .recent-list { margin-top: 0; }
.concordancia-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.concordancia-chip {
  padding: 5px 11px; border-radius: 20px; border: 1px solid var(--border);
  background: var(--surface); color: var(--accent); font-size: 12px; font-weight: 700;
  font-style: italic; cursor: pointer; font-family: inherit;
}
.concordancia-chip:hover { background: var(--accent-soft); }

.detail-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.action-btn { flex: 1 1 calc(50% - 5px); min-width: 0; display: flex; align-items: center; justify-content: center; gap: 7px; padding: 12px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font-size: 13px; font-weight: 700; cursor: pointer; }
.action-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; }
.action-btn.is-fav { color: var(--danger); border-color: var(--danger); }
.action-btn.is-fav svg { fill: var(--danger); }
.action-btn.primary { background: var(--accent-grad); color: var(--accent-text); border-color: var(--accent); }

.detail-section-head { display: flex; justify-content: space-between; align-items: center; margin: 26px 0 10px; }
.detail-section-head h3 { font-size: 14.5px; font-weight: 700; }
.empty-state { font-size: 12.5px; color: var(--text-dim); text-align: center; padding: 20px 10px; }
.empty-state.hidden { display: none; }

/* ---------- NOTES ---------- */
.note-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px; margin-bottom: 8px; }
.note-card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.note-card-date { font-size: 11px; color: var(--text-dim); }
.note-card-title { font-size: 12.5px; font-weight: 700; color: var(--text); }
.note-card p { font-size: 13.5px; line-height: 1.5; white-space: pre-wrap; }
.note-card audio { display: block; width: 100%; margin-top: 4px; }
.note-card-actions { display: flex; gap: 6px; }
.icon-btn-sm { width: 26px; height: 26px; border-radius: 8px; border: none; background: var(--surface-2); color: var(--text-dim); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.icon-btn-sm svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; }
.notas-list { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.notas-list .note-card { cursor: pointer; }

/* ---------- REFORMAS filtro ---------- */
.crit-filter-col { display: flex; flex-direction: column; gap: 7px; margin-bottom: 18px; }
.crit-filter-item { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 13px 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; text-align: left; font-family: inherit; }
.crit-filter-item-text { display: flex; flex-direction: column; gap: 2px; }
.crit-filter-item-text strong { font-size: 13.5px; }
.crit-filter-item-text span { font-size: 11.5px; color: var(--text-dim); }
.settings-link-chevron { width: 16px; height: 16px; fill: none; stroke: var(--text-dim); stroke-width: 2.2; flex-shrink: 0; }
.settings-card-link {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  text-align: left; cursor: pointer; font: inherit; color: inherit;
}
.settings-row-text { display: flex; flex-direction: column; gap: 2px; }
.settings-row-sub { font-size: 11.5px; font-weight: 500; color: var(--text-dim); }
.sug-label { display: block; font-size: 12px; font-weight: 700; color: var(--text-dim); margin: 14px 0 6px; }
.sug-label:first-child { margin-top: 0; }
.sug-field {
  width: 100%; padding: 11px 12px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text); font-size: 13.5px; font-family: inherit;
}
.sug-textarea { resize: vertical; }
.suggestion-cta {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%;
  margin-top: 16px; padding: 12px; border-radius: 12px; border: 1px dashed var(--border);
  background: var(--surface-2); color: var(--text-dim); font-size: 12.5px; font-weight: 600;
  cursor: pointer; font-family: inherit;
}
.suggestion-cta svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; flex-shrink: 0; }
.suggestion-cta:hover { color: var(--text); border-color: var(--accent); }

/* ---------- AJUSTES ---------- */
@font-face {
  font-family: "IBM Plex Serif";
  src: url("fonts/ibm-plex-serif-700italic.woff2") format("woff2");
  font-weight: 700;
  font-style: italic;
  font-display: swap;
}
.ajustes-cabecera {
  position: relative; overflow: hidden; display: flex; align-items: flex-end;
  height: 150px; border-radius: 16px; padding: 0 16px 14px; margin-bottom: 16px;
  background: var(--header-bg);
}
.ajustes-foto {
  position: absolute; right: 0; bottom: 0; height: 100%; width: auto;
  object-fit: contain; object-position: bottom right;
  opacity: .32;
  -webkit-mask-image: linear-gradient(to left, rgba(0,0,0,1) 35%, rgba(0,0,0,0) 92%);
  mask-image: linear-gradient(to left, rgba(0,0,0,1) 35%, rgba(0,0,0,0) 92%);
  pointer-events: none;
}
.ajustes-cabecera-texto { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 4px; max-width: 100%; min-width: 0; }
.ajustes-cabecera-texto strong {
  display: block; font-family: "IBM Plex Serif", Georgia, "Times New Roman", serif; font-style: italic; font-weight: 700;
  font-size: clamp(14px, 4.2vw, 17px); color: #fff;
}
.ajustes-cabecera-texto span { font-size: 12px; font-weight: 600; color: rgba(255,255,255,.85); }
.settings-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 16px; margin-bottom: 12px; }
.settings-card h3 { font-size: 14px; font-weight: 700; margin-bottom: 10px; }
.settings-row { display: flex; justify-content: space-between; align-items: center; }
.settings-note { font-size: 12px; line-height: 1.55; color: var(--text-dim); }
.settings-list { margin-left: 18px; font-size: 12px; line-height: 1.6; color: var(--text-dim); }
.settings-list a { color: var(--accent); }
.theme-switch { display: flex; background: var(--surface-2); border-radius: 10px; padding: 3px; gap: 3px; }
.theme-opt { padding: 7px 14px; border-radius: 8px; border: none; background: transparent; color: var(--text-dim); font-size: 12.5px; font-weight: 700; cursor: pointer; }
.theme-opt.active { background: var(--accent-grad); color: var(--accent-text); }

/* ---------- BOTTOM NAV ---------- */
.bottom-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; max-width: 560px; margin: 0 auto; display: flex; background: var(--nav-bg); border-top: 1px solid var(--border); padding: 8px 4px calc(8px + env(safe-area-inset-bottom,0px)); }
.nav-item { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; background: none; border: none; color: var(--text-dim); font-size: 10.5px; cursor: pointer; padding: 4px; }
.nav-item svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.9; }
.nav-item.active { color: var(--accent); }

/* ---------- MODAL ---------- */
.modal { position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 60; max-width: 536px; margin: 0 auto; background: var(--surface); border-radius: 18px; padding: 16px; box-shadow: var(--shadow); }
.modal.hidden { display: none; }
.modal-header { display: flex; justify-content: space-between; align-items: center; font-weight: 700; font-size: 15px; margin-bottom: 12px; }
.modal-body textarea { width: 100%; min-height: 110px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); padding: 12px; font-size: 14px; font-family: inherit; resize: vertical; }
.modal-footer { margin-top: 12px; }
.modal-tabs { display: flex; gap: 8px; margin-bottom: 12px; }
.modal-tab {
  flex: 1; padding: 9px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2);
  color: var(--text-dim); font-size: 12.5px; font-weight: 700; cursor: pointer; font-family: inherit;
}
.modal-tab.active { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.note-panel.hidden { display: none; }
#noteText.hidden { display: none; }
#audioPreview.hidden { display: none; }
.record-btn {
  padding: 10px 18px; border-radius: 10px; border: none; background: var(--danger); color: #fff;
  font-weight: 700; cursor: pointer; margin-right: 10px; font-family: inherit;
}
.record-btn.recording { animation: pulse 1s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .55; } }
#audioTimer { font-size: 13px; color: var(--text-dim); font-variant-numeric: tabular-nums; }
.note-panel audio { display: block; width: 100%; margin-top: 12px; border-radius: 10px; }
.primary-btn { width: 100%; padding: 12px; border-radius: 10px; border: none; background: var(--accent-grad); color: var(--accent-text); font-weight: 700; font-size: 14px; cursor: pointer; }
.secondary-btn { width: 100%; padding: 12px; border-radius: 10px; border: 1px solid var(--border); background: transparent; color: var(--text); font-weight: 700; font-size: 14px; cursor: pointer; }

/* ---------- JURISPRUDENCIA ---------- */
.detail-body h2 { font-size: 13.5px; color: var(--text-dim); font-weight: 600; margin-bottom: 2px; }
.detail-body h1 { font-size: 22px; font-weight: 800; color: var(--accent); margin-bottom: 14px; }
.jur-subtitle { font-size: 12px; color: var(--text-dim); margin: -6px 0 14px; }
.jur-loading { text-align: center; padding: 40px 20px; color: var(--text-dim); font-size: 13.5px; }
.jur-loading.hidden { display: none; }
#jurApp.hidden { display: none; }
.jur-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.jur-filters input, .jur-filters select {
  flex: 1 1 calc(50% - 4px); min-width: 0; padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); font-size: 13px;
  font-family: inherit;
}
.jur-actions { display: flex; gap: 10px; margin-top: 10px; }
.jur-actions .primary-btn, .jur-actions .secondary-btn { flex: 1; margin-top: 0; }
.jur-info { font-size: 11.5px; color: var(--text-dim); margin: 14px 0 8px; text-transform: uppercase; letter-spacing: .03em; }
.jur-card .jur-meta { font-size: 11px; color: var(--text-dim); margin-bottom: 3px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.jur-card .jur-tipo-tag {
  display: inline-block; padding: 1px 8px; border-radius: 20px; border: 1px solid var(--accent);
  color: var(--accent); font-size: 10px; font-weight: 700; text-transform: uppercase;
}
.jur-pagination { display: flex; gap: 8px; justify-content: center; margin-top: 18px; }
.jur-pagination button {
  padding: 8px 16px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface);
  color: var(--text); font-weight: 700; cursor: pointer; font-size: 13px;
}
.jur-pagination button:disabled { opacity: .35; cursor: default; }
.jur-pagination button.current { background: var(--accent-grad); color: var(--accent-text); border-color: var(--accent); }
.jur-meta-grid { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 12px; color: var(--text-dim); margin: 10px 0 16px; }
.jur-meta-grid b { color: var(--text); }
.jur-resumen { font-size: 13.5px; font-style: italic; color: var(--text-dim); margin-bottom: 14px; line-height: 1.5; }

/* ---------- TOAST ---------- */
.toast { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%); z-index: 70; background: var(--surface); border: 1px solid var(--border); color: var(--text); font-size: 13px; font-weight: 600; padding: 10px 18px; border-radius: 20px; box-shadow: var(--shadow); }
.toast.hidden { display: none; }

@media (min-width: 640px) {
  #app { border-left: 1px solid var(--border); border-right: 1px solid var(--border); }
}

@media print {
  .topbar, .side-menu, .overlay, .bottom-nav, .back-btn, .detail-actions, .detail-section-head, #detailNotes { display: none !important; }
  body { background: #fff !important; color: #000 !important; }
  .detail-text { color: #000 !important; }
}
