/* Interfaz v2. Los controles clínicos conservan su propia hoja de estilos. */
:root {
  color-scheme: light;
  --background: #eaf0f3; --surface: rgb(255 255 255 / 68%); --surface-alt: rgb(235 241 244 / 78%);
  --text: #1b2b3b; --text-secondary: #586b7a; --border: rgb(44 66 83 / 10%);
  --navy: #20394c; --accent: #a63d43; --accent-soft: rgb(166 61 67 / 10%);
  --favorite-star: #ffd500;
  --focus: #176bb5; --shadow: 0 12px 36px rgb(34 55 71 / 8%), 0 2px 8px rgb(34 55 71 / 4%);
  --glass-shadow: 0 18px 48px rgb(31 51 67 / 12%), inset 0 1px 0 rgb(255 255 255 / 78%);
  --radius: 22px; --bottom-space: calc(108px + env(safe-area-inset-bottom, 0px));
  font-family: 'DM Sans', Verdana, 'Segoe UI', system-ui, sans-serif; font-size: 16px;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --background: #101923; --surface: rgb(31 47 62 / 76%); --surface-alt: rgb(41 58 73 / 82%);
  --text: #edf2f5; --text-secondary: #b2c0ca; --border: rgb(222 235 244 / 10%);
  --navy: #162633; --accent: #e18b88; --accent-soft: rgb(225 139 136 / 14%);
  --focus: #84c6ff; --shadow: 0 16px 42px rgb(0 0 0 / 22%), 0 2px 8px rgb(0 0 0 / 12%);
  --glass-shadow: 0 18px 48px rgb(0 0 0 / 28%), inset 0 1px 0 rgb(255 255 255 / 8%);
}
*, *::before, *::after { box-sizing: border-box; }
html { min-height: 100%; scroll-padding-top: 1rem; }
body { margin: 0; min-width: 0; background: radial-gradient(ellipse at 12% -8%, rgb(181 205 216 / 44%), transparent 38rem), radial-gradient(ellipse at 100% 72%, rgb(199 214 219 / 26%), transparent 34rem), var(--background); color: var(--text); line-height: 1.55; }
:root[data-theme="dark"] body { background: radial-gradient(ellipse at 12% -8%, rgb(73 105 124 / 24%), transparent 38rem), radial-gradient(ellipse at 100% 72%, rgb(72 87 104 / 18%), transparent 34rem), var(--background); }
[hidden] { display: none !important; }
img, svg { max-width: 100%; }
img { height: auto; }
a { color: var(--accent); text-underline-offset: .2em; overflow-wrap: anywhere; }
a:hover { text-decoration-thickness: 2px; }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea, summary { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .6; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
h1, h2, h3 { line-height: 1.25; text-wrap: balance; }
p { margin-block: .7rem; }
.sr-only, .visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.skip-link { position: fixed; top: -10rem; left: 1rem; z-index: 4000; padding: .75rem; background: var(--surface); }
.skip-link:focus { top: 1rem; }
.site-header { background: rgb(242 247 249 / 72%); color: var(--text); padding: .7rem max(1rem, calc((100vw - 1120px) / 2)); padding-inline-end: calc(max(1rem, (100vw - 1120px) / 2) + 60px); display: flex; align-items: center; gap: .85rem; box-shadow: 0 1px 0 rgb(48 69 84 / 7%), 0 8px 28px rgb(36 57 73 / 5%); backdrop-filter: blur(22px) saturate(155%); -webkit-backdrop-filter: blur(22px) saturate(155%); }
.site-header-gradient { position: sticky; top: 0; z-index: 1100; height: 5px; margin-top: -5px; background: linear-gradient(var(--guardia-gradient-angle, 0deg), #F58220 0%, #F58220 33.333%, #FFB52E 44%, #FFD500 56%, #FFD500 100%); background-size: 360% 320%; background-position: 0% 50%; animation: guardia-header-gradient 36s linear infinite; pointer-events: none; }
@property --guardia-gradient-angle { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
@keyframes guardia-header-gradient {
  0% { --guardia-gradient-angle: 0deg; background-position: 0% 50%; background-size: 360% 320%; }
  25% { --guardia-gradient-angle: 90deg; background-position: 100% 50%; background-size: 320% 400%; }
  50% { --guardia-gradient-angle: 180deg; background-position: 100% 100%; background-size: 240% 560%; }
  75% { --guardia-gradient-angle: 270deg; background-position: 0% 100%; background-size: 420% 360%; }
  100% { --guardia-gradient-angle: 360deg; background-position: 0% 50%; background-size: 360% 320%; }
}
:root[data-theme="dark"] .site-header { background: rgb(20 32 43 / 76%); box-shadow: 0 1px 0 rgb(230 240 246 / 7%), 0 8px 28px rgb(0 0 0 / 12%); }
.site-header a { color: inherit; text-decoration: none; display: inline-flex; align-items: center; gap: .75rem; }
.site-header .site-brand-icon { position: relative; display: block; width: 46px; height: 46px; flex: 0 0 46px; overflow: hidden; border-radius: 21%; background: linear-gradient(var(--guardia-gradient-angle, 0deg), #F58220 0%, #F58220 33.333%, #FFB52E 44%, #FFD500 56%, #FFD500 100%); background-size: 360% 320%; background-position: 0% 50%; animation: guardia-header-gradient 36s linear infinite; }
.site-header .site-brand-icon::before, .site-header .site-brand-icon::after { content: ""; position: absolute; top: 50%; left: 50%; display: block; background: #fff; border-radius: 999px; transform: translate(-50%, -50%); }
.site-header .site-brand-icon::before { width: 19%; height: 53%; }
.site-header .site-brand-icon::after { width: 53%; height: 19%; }
.site-header :is(.title, .site-title, strong) { font-size: 1.1rem; letter-spacing: -.035em; }
:is(#theme-toggle, #favorite-toggle) { position: fixed; top: calc(.7rem + 1px); right: max(1rem, calc((100vw - 1120px) / 2)); z-index: 1101; display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0; background: var(--surface-alt); border: 0; border-radius: 50%; color: var(--text); box-shadow: var(--shadow), inset 0 1px 0 rgb(255 255 255 / 62%); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
#favorite-toggle { right: calc(max(1rem, (100vw - 1120px) / 2) + 52px); }
#favorite-toggle svg { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linejoin: round; }
#favorite-toggle[aria-pressed="true"] { color: var(--favorite-star); background: var(--surface-alt); }
#favorite-toggle[aria-pressed="true"] svg { fill: currentColor; }
html[data-favoritable] .site-header { padding-inline-end: calc(max(1rem, (100vw - 1120px) / 2) + 112px); }
html[data-favoritable] .site-header a { min-width: 0; }
html[data-favoritable] .site-title { min-width: 0; }
#contenido { width: min(100%, 1120px); margin-inline: auto; padding: clamp(1rem, 4vw, 2.25rem) clamp(1rem, 3vw, 2rem) var(--bottom-space); }
.page-title { position: relative; z-index: 31; font-size: clamp(1.45rem, 4.5vw, 2.2rem); letter-spacing: -.055em; margin: .2rem 0 1.6rem; }
.page-title::before { content: none; }
.page-content, #tool { min-width: 0; }
.page-content > section + section { margin-top: 2rem; }
#theme-toggle img { width: 22px; height: 22px; }
#theme-toggle img.icon[src$="/sun.svg"] { display: none; }
:root[data-theme="dark"] #theme-toggle img.icon[src$="/moon.svg"] { display: none; }
:root[data-theme="dark"] #theme-toggle img.icon[src$="/sun.svg"] { display: inline; }
[data-theme="dark"] :is(.tool-grid, .bottom-nav) img.icon { filter: invert(1); }
.home-grid, .tool-grid, .cards, .card-grid, .tools-grid, .directory-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 255px), 1fr)); gap: 1rem; }
.home-grid > a, .tool-grid > a, .card-grid > a, .tools-grid > a, .directory-grid > a, a.tool-card, a.home-card, a.card { display: flex; align-items: center; gap: 1rem; min-height: 100px; padding: 1.3rem; border: 0; border-radius: var(--radius); background: var(--surface); color: var(--text); text-decoration: none; box-shadow: var(--glass-shadow); backdrop-filter: blur(18px) saturate(145%); -webkit-backdrop-filter: blur(18px) saturate(145%); transition: background-color .18s ease, box-shadow .18s ease, transform .18s ease; }
:is(.home-grid, .tool-grid, .card-grid, .tools-grid, .directory-grid) > a:hover, a.tool-card:hover, a.home-card:hover, a.card:hover { background: color-mix(in srgb, var(--surface) 78%, white 22%); box-shadow: 0 18px 42px rgb(34 55 71 / 13%), inset 0 1px 0 rgb(255 255 255 / 86%); transform: translateY(-2px); }
:is(.home-grid, .tool-grid, .card-grid, .tools-grid, .directory-grid, .tool-card, .home-card) :is(svg, img, .icon) { width: 32px; height: 32px; flex: 0 0 32px; }
.bottom-nav { position: fixed; z-index: 1200; bottom: max(.75rem, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); display: flex; align-items: stretch; justify-content: space-around; gap: .2rem; width: max-content; max-width: calc(100% - 1.5rem); padding: .4rem; border: 0; border-radius: 24px; box-shadow: var(--glass-shadow); background: rgb(247 250 251 / 76%); backdrop-filter: blur(26px) saturate(170%); -webkit-backdrop-filter: blur(26px) saturate(170%); }
:root[data-theme="dark"] .bottom-nav { background: rgb(29 44 58 / 82%); }
.bottom-nav :is(a, button) { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .25rem; padding: .55rem 10px; min-width: 44px; min-height: 48px; border: 0; border-radius: 14px; background: transparent; color: var(--text); text-decoration: none; font-size: .75rem; }
.bottom-nav :is(a, button):hover, .bottom-nav [aria-current="page"] { background: var(--accent-soft); color: var(--accent); }
.bottom-nav :is(svg, img, .icon) { width: 22px; height: 22px; }
.bottom-nav { overflow-x: auto; overscroll-behavior-x: contain; justify-content: flex-start; scrollbar-width: thin; }
.bottom-nav :is(a, button) { flex-shrink: 0; }
.bottom-nav a[data-favorite] span { display: block; white-space: nowrap; text-align: center; }
:is(.tool-grid, .bottom-nav) > a[data-favorite] { position: relative; }
.favorite-badge { position: absolute; top: .55rem; right: .55rem; color: var(--favorite-star); fill: currentColor; pointer-events: none; filter: drop-shadow(0 1px 1px rgb(92 69 0 / 35%)); }
.tool-grid > a .favorite-badge { width: 18px; height: 18px; }
.bottom-nav a .favorite-badge { top: .2rem; right: .2rem; width: 12px; height: 12px; }
.favorites-empty-hint { display: flex; align-items: center; min-height: 100px; padding: 1.3rem; border: 1px dashed var(--text-secondary); border-radius: var(--radius); background: var(--surface); color: var(--text-secondary); box-shadow: var(--shadow); font-size: .9rem; cursor: default; }
[data-favorite] { cursor: grab; -webkit-user-drag: none; -webkit-touch-callout: none; user-select: none; -webkit-user-select: none; }
.favorites-sorting, .favorites-sorting * { cursor: grabbing !important; user-select: none !important; -webkit-user-select: none !important; }
.favorites-sort-active > a, .favorites-sort-active > a:hover { transform: none; transition: none; }
.favorites-sort-active > a[data-favorite]:not(.favorite-placeholder) { animation: favorite-wiggle .28s ease-in-out infinite alternate; transform-origin: 50% 60%; }
.favorites-sort-active > a[data-favorite]:nth-child(even):not(.favorite-placeholder) { animation-delay: -.14s; }
@keyframes favorite-wiggle { from { rotate: -.7deg; } to { rotate: .7deg; } }
.favorites-sort-active > a.favorite-placeholder { opacity: .22; outline: 2px dashed var(--favorite-star); outline-offset: -3px; transform: none; }
.favorite-drag-ghost { position: fixed; z-index: 4500; display: flex; align-items: center; justify-content: center; pointer-events: none; margin: 0; text-decoration: none; transform: scale(1.05) rotate(-2deg); background: var(--surface-alt) !important; box-shadow: 0 20px 50px #0005 !important; will-change: left, top; }
.favorite-drag-ghost > img { width: var(--drag-icon-size); height: var(--drag-icon-size); flex: 0 0 var(--drag-icon-size); }
.favorite-drag-ghost .favorite-badge { width: 14px; height: 14px; }
[data-theme="dark"] .favorite-drag-ghost > img { filter: invert(1); }
@media (prefers-reduced-motion: reduce) { .favorite-drag-ghost { transform: none; } }
.tool-search { position: sticky; top: 68px; z-index: 30; padding-block: .6rem .8rem; margin-bottom: .7rem; background: color-mix(in srgb, var(--background) 78%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
#tool.code-catalog > .tool-search { border-radius: 16px; transition: border-radius .22s ease; background: var(--background); backdrop-filter: none; -webkit-backdrop-filter: none; }
#tool.code-catalog > .tool-search > .field { width: min(100%, 640px); margin-inline: auto; }
/* Hermana del buscador: filtra solo el contenido que pasa por detrás. */
@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .catalog-backdrop-blur { position: fixed; top: 0; z-index: 10; pointer-events: none; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); mask-image: linear-gradient(to top, transparent 0, rgb(0 0 0 / 12%) 10px, rgb(0 0 0 / 50%) 24px, rgb(0 0 0 / 90%) 38px, #000 48px); -webkit-mask-image: linear-gradient(to top, transparent 0, rgb(0 0 0 / 12%) 10px, rgb(0 0 0 / 50%) 24px, rgb(0 0 0 / 90%) 38px, #000 48px); }
}
@media (prefers-reduced-transparency: reduce), print { .catalog-backdrop-blur { display: none; } }
#tool.code-catalog > .tool-search.sticky-content-passing { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.tool-search label { font-size: .85rem; font-weight: 700; }
#tool :is(input, select, textarea), .admin-panel :is(input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]), select, textarea) { display: block; width: 100%; min-width: 0; min-height: 48px; margin-top: .35rem; padding: .7rem .85rem; border: 0; border-radius: 14px; background: var(--surface-alt); color: var(--text); box-shadow: inset 0 1px 3px rgb(35 54 68 / 8%), inset 0 0 0 1px var(--border); }
#tool :is(input, textarea)::placeholder, .admin-panel :is(input, textarea)::placeholder { color: var(--text-secondary); opacity: 1; }
#tool input[aria-invalid="true"] { border-color: var(--accent); }
.tool-form { display: grid; gap: 1rem; padding: 1.1rem; background: var(--surface); border: 0; border-radius: var(--radius); box-shadow: var(--shadow); backdrop-filter: blur(16px) saturate(140%); -webkit-backdrop-filter: blur(16px) saturate(140%); margin-bottom: .75rem; }
.field { display: block; min-width: 0; font-size: .88rem; font-weight: 700; }
.field-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: .85rem; }
.button, #tool button:where(:not(.suggestion):not(.location-button)), .admin-panel button, #install-button, dialog button[data-close] { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 46px; padding: .7rem 1rem; border: 0; border-radius: 14px; background: var(--surface-alt); color: var(--text); text-decoration: none; font-weight: 650; font-size: .85rem; box-shadow: inset 0 1px 0 rgb(255 255 255 / 48%); }
#install-button { display: flex; width: min(100%, 390px); margin: 1.75rem auto 0; padding: 1rem 1.2rem; gap: .9rem; border-radius: 20px; background: linear-gradient(120deg, #f58220, #ffd500); color: #202b35; text-align: left; box-shadow: 0 10px 24px rgb(191 104 17 / 25%), inset 0 1px 0 rgb(255 255 255 / 55%); transition: transform .18s ease, box-shadow .18s ease; }
#install-button:hover { transform: translateY(-2px); box-shadow: 0 15px 28px rgb(191 104 17 / 32%), inset 0 1px 0 rgb(255 255 255 / 55%); }
#install-button:active { transform: translateY(0); }
.install-icon { flex: 0 0 48px; width: 48px; height: 48px; padding: 11px; border-radius: 15px; background: rgb(255 255 255 / 38%); }
.install-copy { display: grid; min-width: 0; gap: .12rem; }
.install-title { font-size: 1rem; font-weight: 750; line-height: 1.25; }
.install-subtitle { font-size: .78rem; font-weight: 600; line-height: 1.35; }
@media (prefers-reduced-motion: reduce) { #install-button { transition: none; } #install-button:hover, #install-button:active { transform: none; } }
#tool button[type="submit"], .button.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
[data-theme="dark"] #tool button[type="submit"], [data-theme="dark"] .button.primary { color: #24151c; }
.mode-switch { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem; }
#tool .mode-switch [aria-pressed="true"] { background: var(--navy); color: #fff; border-color: var(--navy); }
.query-status, .result-count, .catalog-meta { font-size: .82rem; color: var(--text-secondary); }
.query-status { min-height: 0; margin-block: .35rem; }
.query-status:empty { margin: 0; }
.query-status[data-state="resultado"] { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.query-status[data-state="error"], .query-status[data-state="no_disponible"] { color: var(--accent); }
.results { display: grid; gap: 1rem; margin-top: .65rem; }
.results:empty { margin-top: 0; }
.results[aria-busy="true"] { opacity: .65; }
.results-auto-scroll:has(.result-card) { min-height: 100vh; min-height: 100dvh; align-content: start; }
.result-card, .catalog-group, .location-card { min-width: 0; padding: 1.1rem; border: 0; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); backdrop-filter: blur(16px) saturate(140%); -webkit-backdrop-filter: blur(16px) saturate(140%); overflow-wrap: anywhere; }
.result-card h2, .location-card h2 { font-size: 1.1rem; margin: .2rem 0 .75rem; }
.result-card h2.tunnel-pk-marker { display: inline-flex; align-items: center; gap: .35rem; min-height: 2.6rem; font-size: 1.15rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tunnel-pk-circle { display: inline-flex; flex: 0 0 2.6rem; align-items: center; justify-content: center; width: 2.6rem; height: 2.6rem; border-radius: 50%; background: var(--tunnel-pk-color); color: var(--tunnel-pk-foreground, #fff); font-size: 1.05rem; font-weight: 750; line-height: 1; box-shadow: inset 0 0 0 1px rgb(0 0 0 / 12%); }
.result-card h3, .location-card h3 { font-size: 1rem; }
.location-card { display: flex; flex-direction: column; align-items: stretch; gap: .3rem; }
.location-card p { margin: .25rem 0; }
.badge-row { display: flex; flex-wrap: wrap; gap: .45rem; margin-bottom: .4rem; }
.badge { display: inline-flex; align-items: center; padding: .2rem .6rem; border-radius: 6px; background: var(--accent-soft); color: var(--accent); font-size: .85rem; font-weight: 700; }
.location-button { background: transparent; border: 0; color: var(--accent); text-align: left; text-decoration: underline; text-underline-offset: .2em; padding: .6rem 0; min-height: 44px; }
.coordinates { font-variant-numeric: tabular-nums; font-size: .85rem; overflow-wrap: anywhere; }
.actions { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; margin-block: .7rem; }
.copy-control { position: relative; display: inline-flex; align-items: center; }
#tool .actions button.copy-coordinates { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 44px; width: 44px; min-width: 44px; min-height: 44px; padding: 0; border: 0; border-radius: 12px; background: transparent; color: var(--accent); box-shadow: none; cursor: pointer; }
#tool .actions .copy-coordinates:hover { background: var(--accent-soft); }
#tool .actions .copy-coordinates:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.copy-coordinates svg { display: block; }
.copy-tooltip { position: absolute; z-index: 5; left: 50%; bottom: calc(100% + .35rem); width: max-content; max-width: min(18rem, 75vw); margin: 0; padding: .45rem .65rem; border-radius: 8px; background: var(--navy); color: #fff; box-shadow: 0 4px 14px rgb(0 0 0 / 20%); font-size: .78rem; line-height: 1.35; white-space: normal; opacity: 0; visibility: hidden; pointer-events: none; transform: translate(-50%, .2rem); transition: opacity .2s ease, transform .2s ease, visibility .2s; }
.copy-tooltip.is-visible { opacity: 1; visibility: visible; transform: translate(-50%, 0); }
.map-options { display: flex; flex-wrap: wrap; align-items: flex-start; gap: .65rem; }
.map-options a { display: block; flex: 0 1 5rem; width: 5rem; aspect-ratio: 1; min-width: 0; padding: 0; border: 0; border-radius: 14px; overflow: hidden; background: var(--surface-alt); }
.map-options img { display: block; width: 100%; height: 100%; object-fit: cover; }
.catalog-group { padding: 0; overflow: hidden; border-top: 0; margin-bottom: 1rem; }
.catalog-group h2, .catalog-group > summary { margin: 0; padding: 1rem; font-size: .95rem; font-weight: 700; }
.catalog-group > summary { cursor: pointer; min-height: 48px; }
.catalog-group > .cards { padding: 0 1rem 1rem; }
#tool.code-catalog > .tool-search { top: var(--catalog-header-height, 68px); }
.catalog-group.code-group { overflow: visible; }
.code-group > h2 { position: sticky; top: calc(var(--catalog-header-height, 68px) + var(--catalog-search-height, 90px)); z-index: 1; background: var(--group-color, var(--surface-alt)); color: var(--group-foreground, var(--text)); border-radius: var(--radius) var(--radius) 0 0; transition: border-radius .22s ease; }
.code-group > h2.sticky-attached { border-top-left-radius: 0; border-top-right-radius: 0; }
.code-group > h2 mark { color: inherit; background: transparent; text-decoration: underline; }
.catalog-group.code-group > h2 { padding: 0; }
.code-group > h2:has([aria-expanded="false"]) { border-radius: var(--radius); }
#tool button.code-group-toggle { display: flex; justify-content: space-between; width: 100%; padding: 1rem; border: 0; border-radius: inherit; background: transparent; color: inherit; font: inherit; text-align: left; box-shadow: none; }
.code-group-toggle::after { content: ''; flex: 0 0 .5rem; width: .5rem; height: .5rem; margin-inline: .5rem; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); }
.code-group-toggle[aria-expanded="true"]::after { transform: rotate(225deg); }
.code-list { display: grid; grid-template-columns: max-content minmax(0, 1fr); column-gap: .6rem; list-style: none; margin: 0; padding: 0; }
.code-list li { display: grid; grid-column: 1 / -1; grid-template-columns: subgrid; padding: .8rem 1rem; border-top: 1px solid var(--border); font-size: .9rem; }
.code-list .code { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.code-list li:nth-child(even) { background: color-mix(in srgb, var(--surface-alt) 55%, transparent); }
mark { background: var(--accent-soft); color: var(--text); font-weight: 700; border-radius: 2px; padding: 0; }
.point-image { width: 100%; max-height: 250px; object-fit: contain; border: 1px solid var(--border); border-radius: 8px; margin-top: .6rem; }
.catalog-meta { padding: .8rem 0; overflow-wrap: anywhere; }
.catalog-meta summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; text-decoration: underline; }
.catalog-meta dl { display: grid; grid-template-columns: minmax(6rem, 1fr) minmax(0, 3fr); gap: .4rem .75rem; margin: .4rem 0; }
dt { font-weight: 700; } dd { margin: 0; overflow-wrap: anywhere; }
.stale-warning, .notice { padding: .8rem 1rem; border: 1px solid var(--border); border-inline-start: 4px solid var(--accent); border-radius: 8px; background: var(--surface-alt); font-size: .85rem; }
.autocomplete { position: relative; min-width: 0; }
.suggestions { position: absolute; top: 100%; left: 0; right: 0; z-index: 100; max-height: min(340px, 45vh); overflow-y: auto; overscroll-behavior: contain; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 10px 24px #0003; list-style: none; padding: .25rem; margin: .25rem 0 0; }
.suggestions [role="option"] { min-height: 48px; padding: .75rem; border-radius: 7px; cursor: pointer; font-size: .85rem; font-weight: 400; }
.suggestions [aria-selected="true"], .suggestions [role="option"]:hover { background: var(--accent-soft); }
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .4rem; list-style: none; padding: 0; margin: 0 0 1rem; counter-reset: step; font-size: .75rem; }
.steps li { counter-increment: step; color: var(--text-secondary); padding: .65rem .4rem; border-bottom: 3px solid var(--border); }
.steps li::before { content: counter(step) '. '; font-weight: 700; }
.steps [aria-current="step"] { border-color: var(--accent); color: var(--text); font-weight: 700; }
.anillo-map { width: 100%; height: clamp(320px, 65vh, 720px); border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-alt); z-index: 0; }
.anillo-map .leaflet-popup-content-wrapper, .anillo-map .leaflet-popup-tip { background: var(--surface); color: var(--text); }
.anillo-map .leaflet-popup-content { width: min(250px, 65vw) !important; font-family: Verdana, sans-serif; }
.anillo-map .leaflet-popup-content p { margin: .6rem 0; }
.anillo-map .leaflet-control-attribution { max-width: 100%; font-size: 10px; overflow-wrap: anywhere; }
[data-theme="dark"] .anillo-map .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) saturate(.65) brightness(.85); }
.anillo-map .leaflet-interactive:focus-visible { outline: none; stroke: var(--focus); stroke-width: 6; }
dialog { color: var(--text); background: color-mix(in srgb, var(--surface) 88%, var(--background)); border: 0; border-radius: 24px; box-shadow: 0 24px 80px rgb(7 20 30 / 28%), inset 0 1px 0 rgb(255 255 255 / 38%); backdrop-filter: blur(28px) saturate(160%); -webkit-backdrop-filter: blur(28px) saturate(160%); padding: 1.3rem; width: min(460px, calc(100% - 2rem)); max-height: calc(100dvh - 2rem); overflow-y: auto; }
dialog::backdrop { background: #0b192bb3; backdrop-filter: blur(4px); }
dialog h2 { margin-top: .2rem; font-size: 1.2rem; }
dialog button[data-close] { margin-top: 1rem; width: 100%; }
#network-status { margin: 0; padding: .6rem 1rem; text-align: center; background: var(--accent-soft); color: var(--text); font-size: .8rem; }
#navigation-loading { position: fixed; inset: 0; z-index: 3000; display: grid; place-items: center; background: #13243855; backdrop-filter: blur(5px); pointer-events: none; }
.spinner { width: 48px; height: 48px; border: 4px solid #ffffff99; border-top-color: #d64046; border-radius: 50%; animation: guardia-spin .8s linear infinite; }
@keyframes guardia-spin { to { transform: rotate(360deg); } }
.welcome { position: fixed; z-index: 1400; top: 1rem; left: 50%; transform: translateX(-50%); width: max-content; max-width: calc(100% - 2rem); padding: .8rem 1.4rem; border-radius: 16px; background: var(--navy); color: #fff; box-shadow: 0 12px 36px rgb(0 0 0 / 20%); font-size: .9rem; pointer-events: none; }
.admin-panel { min-width: 0; overflow-wrap: anywhere; --admin-ink: #17364b; --admin-ink-contrast: #fff; --admin-highlight: #df6b51; }
:root[data-theme="dark"] .admin-panel { --admin-ink: #dceaf2; --admin-ink-contrast: #17364b; --admin-highlight: #f0987c; }
.admin-panel > :is(section, form) { margin-block: 1rem; padding: clamp(1rem, 3vw, 1.5rem); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); backdrop-filter: blur(16px) saturate(140%); -webkit-backdrop-filter: blur(16px) saturate(140%); }
.admin-panel form { display: grid; gap: .85rem; }
.admin-panel label { display: block; font-size: .9rem; font-weight: 650; }
.admin-panel textarea { min-height: 240px; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; line-height: 1.55; }
.admin-panel .admin-nav { display: flex; align-items: center; gap: .5rem; margin-block: 0 1.25rem; padding: .55rem; background: #17364b; color: #fff; border: 0; border-radius: 18px; box-shadow: var(--shadow); }
.admin-nav ul { display: flex; flex: 1; flex-wrap: wrap; align-items: center; list-style: none; gap: .25rem; padding: 0; margin: 0; }
.admin-nav a { display: inline-flex; align-items: center; min-height: 42px; padding: .55rem .85rem; border-radius: 11px; color: #e8f0f4; text-decoration: none; font-size: .82rem; font-weight: 650; }
.admin-nav a:hover, .admin-nav a[aria-current="page"] { background: rgb(255 255 255 / 15%); color: #fff; }
.admin-panel .admin-nav .admin-form { display: block; flex: 0 0 auto; margin: 0; padding: 0; background: transparent; border: 0; border-radius: 0; box-shadow: none; backdrop-filter: none; }
.admin-nav .admin-form button { min-height: 40px; padding: .5rem .75rem; background: rgb(255 255 255 / 10%); color: white; font-size: .78rem; }
.admin-intro { margin-block: 0 1.25rem !important; }
.admin-intro h2, .admin-section-heading h2 { margin: .15rem 0 .45rem; color: var(--admin-ink); font-size: clamp(1.3rem, 3vw, 1.75rem); letter-spacing: -.035em; }
.admin-intro p:last-child { max-width: 72ch; margin-bottom: 0; color: var(--text-secondary); }
.admin-eyebrow { margin: 0 0 .3rem; color: var(--admin-highlight) !important; font-size: .7rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.admin-hero { position: relative; overflow: hidden; min-height: 230px; padding: clamp(1.5rem, 5vw, 2.5rem) !important; border: 0 !important; background: linear-gradient(125deg, #17364b, #25576b 66%, #337a83) !important; color: white; }
.admin-hero::after { position: absolute; right: -3rem; bottom: -8rem; width: 22rem; height: 22rem; border: 1px solid rgb(255 255 255 / 18%); border-radius: 50%; box-shadow: 0 0 0 2.2rem rgb(255 255 255 / 4%), 0 0 0 4.5rem rgb(255 255 255 / 4%); content: ""; }
.admin-hero .admin-eyebrow { color: #ffd1bd !important; }
.admin-hero h2 { position: relative; z-index: 1; max-width: 680px; margin: .25rem 0 .6rem; color: white; font-size: clamp(1.7rem, 5vw, 2.6rem); letter-spacing: -.05em; }
.admin-hero > p:not(.admin-eyebrow) { position: relative; z-index: 1; max-width: 58ch; color: #e1edf1; }
.admin-primary-link { position: relative; z-index: 1; display: inline-flex; align-items: center; gap: .8rem; min-height: 46px; margin-top: .6rem; padding: .65rem 1rem; border-radius: 12px; background: var(--admin-highlight); color: #211b19; text-decoration: none; font-weight: 800; }
.admin-section-heading { display: flex; align-items: end; justify-content: space-between; margin-bottom: .85rem; }
.admin-section-heading h2 { margin-bottom: 0; }
.admin-card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 245px), 1fr)); gap: .8rem; }
.admin-link-card { display: flex; align-items: center; gap: .9rem; min-width: 0; min-height: 104px; padding: 1rem; border: 1px solid var(--border); border-radius: 17px; background: var(--surface); color: var(--text); text-decoration: none; box-shadow: var(--shadow); transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease; }
.admin-link-card:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--admin-highlight) 48%, var(--border)); box-shadow: 0 14px 30px rgb(22 46 62 / 12%); }
.admin-link-card__icon, .admin-status-card__icon { display: grid; flex: 0 0 44px; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: color-mix(in srgb, var(--admin-highlight) 15%, var(--surface)); color: var(--admin-ink); font-size: 1.1rem; font-weight: 800; }
.admin-link-card__content { display: grid; flex: 1; min-width: 0; gap: .22rem; }
.admin-link-card__content strong { color: var(--admin-ink); font-size: .96rem; }
.admin-link-card__content > span { color: var(--text-secondary); font-size: .78rem; line-height: 1.4; }
.admin-link-card__content small { color: var(--text-secondary); font-size: .72rem; }
.admin-link-card__arrow { color: var(--admin-highlight); font-size: 1.2rem; font-weight: 800; }
.admin-status-section, .admin-quick-section { padding-inline: 0 !important; background: transparent !important; border: 0 !important; box-shadow: none !important; backdrop-filter: none !important; }
.admin-status-card { margin: 0 !important; padding: 1rem !important; }
.admin-status-card__heading { display: flex; align-items: center; gap: .75rem; }
.admin-status-card__heading h3 { margin: 0; color: var(--admin-ink); font-size: 1rem; }
.admin-status-card__state { display: inline-flex; margin: .8rem 0 .5rem; padding: .25rem .6rem; border-radius: 999px; background: var(--surface-alt); color: var(--admin-ink); font-size: .8rem; font-weight: 750; }
.admin-status-card dl { display: grid; grid-template-columns: 1fr auto; gap: .3rem .6rem; margin: .5rem 0; font-size: .78rem; }
.admin-status-card dt { color: var(--text-secondary); }
.admin-status-card dd { font-variant-numeric: tabular-nums; font-weight: 700; }
.admin-status-card [data-message] { color: var(--text-secondary); font-size: .8rem; }
.admin-catalog-grid { margin-block: 1rem 2rem; }
.admin-db-list { display: flex; flex-wrap: wrap; gap: .6rem; padding: 0; list-style: none; }
.admin-db-list a { display: block; padding: .6rem .85rem; border-radius: 10px; background: var(--surface-alt); }
.admin-panel table { display: block; max-width: 100%; overflow: auto; border-collapse: collapse; font-size: .8rem; }
.admin-panel th, .admin-panel td { padding: .6rem; text-align: left; border: 1px solid var(--border); min-width: 90px; max-width: 360px; }
.admin-panel th { background: var(--surface-alt); }
.admin-panel pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.admin-panel .catalog-editor { display: grid; gap: .75rem; min-width: 0; }
.catalog-editor__toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; }
.catalog-editor__toolbar [aria-pressed="true"] { background: var(--admin-ink); color: var(--admin-ink-contrast); }
.catalog-editor__toolbar [data-catalog-summary] { margin-left: auto; color: var(--text-secondary); font-size: .8rem; }
.catalog-editor__help, .catalog-empty { margin: 0; color: var(--text-secondary); font-size: .83rem; }
.catalog-editor__error { margin: 0; padding: .7rem .85rem; border-inline-start: 4px solid var(--accent); border-radius: 8px; background: var(--accent-soft); color: var(--text); font-size: .85rem; }
.catalog-table-view { min-width: 0; }
.catalog-table-scroll { max-width: 100%; overflow: auto; border: 1px solid var(--border); border-radius: 12px; }
.admin-panel table.catalog-data-table { display: table; width: 100%; max-width: none; overflow: visible; border-collapse: separate; border-spacing: 0; font-size: .82rem; }
.catalog-data-table th { position: sticky; top: 0; z-index: 1; min-width: 120px; background: var(--admin-ink); color: var(--admin-ink-contrast); font-size: .75rem; }
.catalog-data-table th:first-child { border-top-left-radius: 10px; }
.catalog-data-table th:last-child { border-top-right-radius: 10px; }
.catalog-data-table td { min-width: 150px; max-width: 380px; vertical-align: top; }
.catalog-data-table tbody tr:nth-child(even) { background: color-mix(in srgb, var(--surface-alt) 52%, transparent); }
.catalog-data-table .catalog-row-number { min-width: 45px; color: var(--text-secondary); text-align: center; }
.catalog-property-name, .catalog-property-key { display: block; }
.catalog-property-name { color: var(--admin-ink); }
.catalog-property-key { margin-top: .2rem; color: var(--text-secondary); font-family: ui-monospace, monospace; font-size: .72rem; }
.catalog-data-table :is(input.catalog-cell-control, select.catalog-cell-control) { min-width: 110px; min-height: 40px; margin: 0; padding: .45rem .55rem; border-radius: 9px; font-size: .8rem; }
.catalog-data-table .catalog-cell-details summary { min-height: 38px; color: var(--accent); cursor: pointer; font-size: .78rem; font-weight: 700; }
.catalog-data-table textarea.catalog-cell-json { width: min(390px, 62vw); min-height: 76px; margin: .35rem 0 0; padding: .55rem; font-size: .75rem; }
.catalog-row-actions { min-width: 100px !important; }
.catalog-pagination { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .75rem; margin-block: .7rem; color: var(--text-secondary); font-size: .8rem; }
.admin-panel .catalog-pagination button { min-height: 38px; padding: .45rem .75rem; }
.admin-panel button.catalog-row-remove { min-height: 36px; padding: .4rem .6rem; color: var(--accent); font-size: .75rem; }
.admin-panel button.catalog-row-add { justify-self: start; background: var(--surface-alt); }
.catalog-editor__actions { display: flex; flex-wrap: wrap; align-items: center; gap: .8rem; }
.catalog-editor__actions > a { padding: .5rem; }
.admin-panel button.admin-primary { background: var(--admin-ink); color: var(--admin-ink-contrast); }
.admin-panel .catalog-json-view textarea { margin-top: .5rem; }
.admin-panel .admin-form { align-items: start; }
@media (max-width: 640px) {
  .admin-panel .admin-nav { align-items: stretch; flex-direction: column; }
  .admin-nav ul { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-nav a { justify-content: center; padding-inline: .5rem; }
  .admin-panel .admin-nav .admin-form { display: flex; justify-content: flex-end; }
  .admin-nav .admin-form button { width: auto; }
  .catalog-editor__toolbar [data-catalog-summary] { flex-basis: 100%; margin-left: 0; }
}
@media (min-width: 700px) { .tool-form { padding: 1.5rem; max-width: 760px; } .location-card { padding: 1.3rem; } }
@media (max-width: 380px) { .bottom-nav :is(a, button) { padding-inline: 10px; font-size: .68rem; } .code-list li { padding-inline: .75rem; } }
@media (max-height: 500px) { .tool-search { position: static; } .code-group > h2 { top: var(--catalog-header-height, 68px); } .bottom-nav :is(a, button) { flex-direction: row; min-height: 40px; } .anillo-map { height: 70vh; min-height: 240px; } }
@media (prefers-reduced-transparency: reduce) { .site-header, .bottom-nav, .home-grid > a, .tool-grid > a, .card-grid > a, .tools-grid > a, .directory-grid > a, .tool-form, .result-card, .catalog-group, .location-card, dialog { backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--surface); } }
@media (max-width: 600px) { .site-header { padding-block: .55rem; } :is(#theme-toggle, #favorite-toggle) { top: calc(.55rem + 1px); } .tool-search { top: 58px; } }
@media (prefers-reduced-motion: reduce) { .home-grid > a, .tool-grid > a, .card-grid > a, .tools-grid > a, .directory-grid > a { transition: none; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; } }
@media print { .site-header, .site-header-gradient, #theme-toggle, #favorite-toggle, .bottom-nav, #install-button, .tool-search, .tool-form, .map-options, .actions, #network-status { display: none !important; } #contenido { padding: 0; width: 100%; } body { background: #fff; color: #000; } .result-card, .location-card { break-inside: avoid; box-shadow: none; } }