/* ============================================================
   PEZWEB — Main Stylesheet
   Design DNA: dark/light contrast, minimal type, physics animation
   Base: rgb(10,10,10) dark | rgb(255,255,255) light
   Fonts: Roboto (primary), Helvetica (fallback)
   ============================================================ */

/* ─── Reset ──────────────────────────────────────────────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ─── Layout Tokens ──────────────────────────────────────────────────────── */
:root {
    /* ── Spacing ── */
    --side-pad:       2.4rem;   /* horizontal gutter — all content pages */
    --content-top:    2.4rem;   /* gap between header bottom and content — document pages only */
    --section-pad-b:  8rem;     /* bottom padding — all document pages */
    --gap-xxs:        0.6rem;
    --gap-xs:         1.2rem;
    --gap-sm:         2rem;
    --gap-md:         2.4rem;
    --gap-lg:         4rem;
    --gap-xl:         4.8rem;
    --gap-xxl:        8rem;
    --space-btn:      0.6rem 1rem;

    /* ── Header ── */
    --header-h:       56px;     /* fallback — JS overrides this at runtime via ResizeObserver */

    /* ── Color ── */
    --color-dark:     #0a0a0a;
    --color-surface:  #111111;
}

html {
    font-size: 10px; /* base: matches current site */
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    background-color: #0a0a0a;
    color: #fafafa;
    font-family: 'Roboto', Helvetica, Verdana, Arial, sans-serif;
    font-size: 1.2rem;
    line-height: 1.8;
    font-weight: 400;
    letter-spacing: 0.03em;
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
    transition: opacity 0.2s ease;
}

a:hover {
    opacity: 0.6;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}


/* ─── Typography Scale ───────────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Roboto', Helvetica, sans-serif;
    font-weight: 700;
    letter-spacing: 0.03em;
    line-height: 1.2;
}

h1 { font-size: 4.8rem; }
h2 { font-size: 3.2rem; text-transform: uppercase; color: #6d6d6d; padding-top: 2.4rem; margin-top: 2.4rem; }
.archive-wrap h2:first-of-type,
.page-wrap h2:first-of-type { padding-top: 0; margin-top: 0; }
h3 { font-size: 2.4rem; }
h4 { font-size: 1.8rem; }

p {
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    line-height: 1.8rem;
}

.label {
    font-size: 1rem;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #6d6d6d;
}


/* ─── Navigation ─────────────────────────────────────────────────────────── */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    mix-blend-mode: normal;
}

/* Default: document pages */
.site-main {
    padding-top:    calc(var(--header-h) + var(--content-top));
    padding-bottom: var(--section-pad-b);
}

/* Immersive pages: body class set in functions.php */
.layout-immersive .site-main {
    padding-top:    var(--header-h);
    padding-bottom: 0;
}

.site-nav {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 2rem var(--side-pad);
    background-color: #111111;
}

.nav-logo {
    font-family: 'Roboto', Helvetica, sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #ffffff;
    position: relative;
    display: inline-block;
    padding-top: 3px;
    line-height: 1;
}

.nav-logo::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 4px;
    width: 5px;
    height: 5px;
    background: #dd0000;
    animation: ticker 0.4s ease-in-out infinite;
}

@keyframes ticker {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.2; }
}

.nav-menu {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 5px;
}

.nav-row {
    display: flex;
    gap: 5px;
}

.nav-item {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #333333;
    padding: 5px 16px 5px 8px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: #ffffff;
    white-space: nowrap;
    cursor: pointer;
    line-height: 1;
    transition: background 0.15s ease;
}

.nav-row--primary .nav-item {
    padding-top: 8px;
    padding-bottom: 8px;
}

.nav-row--secondary .nav-item {
    padding-top: 8px;
    padding-bottom: 8px;
}

.nav-item:hover {
    background: #111111;
}

.nav-item--symbolic {
    padding-left: 7px;
    padding-right: 14px;
    font-style: italic;
    font-size: 13px;
    font-weight: 700;
    min-width: 28px;
}


/* ─── Hero Section ───────────────────────────────────────────────────────── */
.hero {
    position: relative;
    width: 100%;
    min-height: 100vh;
    background-color: #0a0a0a;
    overflow: hidden;
}

.hero-title {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: clamp(3rem, 8vw, 6rem);
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #ffffff;
    white-space: nowrap;
    cursor: pointer;
    z-index: 1;
}

#splashCanvas {
    position: relative;
    z-index: 2;
    touch-action: pan-y !important;
    -ms-touch-action: pan-y !important;
    width: 100%;
    height: 100vh;
    display: block;
    cursor: grabbing;
}


/* ─── Page Templates ─────────────────────────────────────────────────────── */
.page-wrap {
    padding:   0 var(--side-pad) var(--section-pad-b);
    max-width: 80rem;
}

/* Servicios + Servicios Mapping: full-width (override .page-wrap max-width + gutters) */
.page-wrap.servicios-wrap {
    padding: 1.2rem;
    max-width: none;
}
.page-wrap.servicios-mapping-wrap {
    max-width: none;
}

.page-header {
    padding-bottom: 4rem;
}

.page-content {
    font-size: 1.4rem;
    line-height: 2.2rem;
    color: #fafafa;
}

.page-content p + p {
    margin-top: 2rem;
}


/* ─── Single Post ────────────────────────────────────────────────────────── */
.single-post {
    padding: 0;
    background: #0a0a0a;
    min-height: 100vh;
}

.single-post__back {
    padding-top: var(--gap-md);
    text-align: left;
}
.single-post__back-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--gap-xxs);
}

.single-post__back a {
    display: inline-block;
    background: #333333;
    padding: 8px 1rem;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #ffffff;
    text-decoration: none;
    line-height: 1;
    transition: background 0.15s ease;
}

.single-post__back a:hover {
    background: #111111;
}

.pz-breadcrumb {
    font-size: 1rem;
    color: var(--color-muted, #6d6d6d);
    letter-spacing: 0.04em;
    margin-bottom: var(--gap-md);
}
.pz-breadcrumb > a,
.pz-breadcrumb > span {
    display: inline-block;
}
.pz-breadcrumb__segment {
    display: inline-block;
    min-height: 1.5em;
    vertical-align: top;
}
.pz-breadcrumb a {
    color: #fafafa;
    text-decoration: none;
}
.pz-breadcrumb a:hover {
    text-decoration: underline;
}
.pz-breadcrumb.ele-link a:hover {
    text-decoration: none;
}
.pz-breadcrumb [aria-hidden="true"] {
    margin-inline: 0.5em;
}

/* Animated underline: single post/servicio content + breadcrumbs only */
.ele-link a {
    color: #fafafa;
    text-decoration: none;
    position: relative;
    transition: color 0.3s ease;
}
.ele-link a::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 0;
    width: 0;
    height: 1px;
    background-color: #fafafa;
    transition: width 0.3s ease, left 0.3s ease;
}
.ele-link a:hover {
    color: #fafafa;
}
.ele-link a:hover::after {
    width: 100%;
    left: 0;
}


/* Date sits just below the title’s border; spacing matches .pz-page-title (2.4rem) */
.single-post__meta {
    font-size:      1rem;
    color:          #6d6d6d;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom:  1.2rem;
    font-weight: 500;
}

.single-post__content {
    font-size: 1.3rem;
    line-height: 1.9;
    color: #fafafa;
    max-width: 54rem;
}

.single-post__content p {
    margin-bottom: var(--gap-sm);
    font-size: 1.1rem;
}

.single-post__content p:last-child {
    margin-bottom: 0;
}


/* ─── Footer ─────────────────────────────────────────────────────────────── */
.site-footer {
    background: #111111;
    padding: 4.8rem 0;
}

.site-footer__inner {
    padding-inline: var(--side-pad);
}

.footer-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.footer-menu li {
    margin: 0;
}

.footer-menu li a {
    display: inline-block;
    background: #333333;
    padding: 5px 8px;
    font-size: 10px;
    font-weight: 400;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #ffffff;
    white-space: nowrap;
    cursor: pointer;
    line-height: 1;
    transition: background 0.15s ease;
}

.footer-menu li a:hover {
    background: #444444;
}

.footer-squares {
    margin-top: var(--gap-xxs);
}

.footer-squares__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.footer-squares__list li {
    margin: 0;
}

.footer-squares__list li a {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #333333;
    padding: 5px 8px;
    min-width: 28px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #ffffff;
    white-space: nowrap;
    cursor: pointer;
    line-height: 1;
    transition: background 0.15s ease;
}

.footer-squares__list li a:hover {
    background: #444444;
}

/* ABST + animation templates */
@import url("./abst.css");

/* ─── Utility Classes ────────────────────────────────────────────────────── */
.u-light-section {
    background: #ffffff;
    color: #0a0a0a;
}

.u-dark-section {
    background: #0a0a0a;
    color: #fafafa;
}

.u-full-height {
    min-height: 100vh;
}

.u-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.u-uppercase {
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.u-muted {
    color: #6d6d6d;
}


/* ─── Design Language Components ────────────────────────────────────────── */

/* Canonical page/archive/post title — use .archive-header > .pz-page-title everywhere */
.pz-page-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--gap-xs);
    flex-wrap: nowrap;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.8;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: #fafafa;
    border-bottom: 1px solid #1c1c1c;
    padding-bottom: 2.4rem;
    margin-bottom: 2.4rem;
}
.pz-page-title__text {
    flex: 1 1 auto;
    min-width: 0;
}
.pz-page-title__meta {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    white-space: nowrap;
}
/* Level badge */
.pz-level-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.1rem 0.5rem;
    font-size: 1em;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: #a5a5a5;
    border: 1px solid #303030;
    border-radius: 2px;
}
.pz-pts-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.1rem 0.5rem;
    font-size: 1em;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: #a5a5a5;
    border: 1px solid #303030;
    border-radius: 2px;
}
[data-pts-count] {
    margin-right: 0.25em;
}

/* Section title — dim uppercase label with optional red accent (e.g. back link) */
/* Usage: <h2 class="pz-section-title">Label <span>/ subtitle</span></h2> */
.pz-section-title {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.8;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: #6d6d6d;
    border-bottom: 1px solid #1c1c1c;
    padding-bottom: 2.4rem;
    margin-bottom: 2.4rem;
}
.pz-section-title + * {
    padding-top: 0rem;
}
.pz-section-title span {
    color: #dd0000;
}

/* Data grid — 3-col token/table layout */
/* Usage: <div class="pz-grid"> <div class="pz-row"> <div class="pz-col-key">name</div> <div class="pz-col-desc">desc</div> <div class="pz-col-val">value</div> </div> </div> */
.pz-grid {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 0;
    border: 1px solid #1c1c1c;
}
.pz-row {
    display: contents;
}
.pz-row > * {
    padding: 7px 10px;
    font-size: 9px;
    letter-spacing: 0.08em;
    border-bottom: 1px solid #161616;
}
.pz-row:last-child > * {
    border-bottom: none;
}
.pz-col-key {
    color: #dd0000;
    font-weight: 700;
    font-family: 'Courier New', monospace;
    background: #0d0d0d;
    white-space: nowrap;
}
.pz-col-desc {
    color: #555555;
    background: #0a0a0a;
}
.pz-col-val {
    color: #aaaaaa;
    font-weight: 700;
    text-align: right;
    background: #0d0d0d;
    font-family: 'Courier New', monospace;
    white-space: nowrap;
}

/* Numbered list — indexed rows with bold label and dim body text */
/* Usage: <div class="pz-list"> <div class="pz-list-item"> <div class="pz-list-num">01</div> <div class="pz-list-text"><strong>Title</strong> body text here</div> </div> </div> */
.pz-list {
    display: flex;
    flex-direction: column;
    border: 1px solid #1c1c1c;
}
.pz-list-item {
    display: grid;
    grid-template-columns: 18px 1fr;
    gap: 10px;
    padding: 8px 10px;
    border-bottom: 1px solid #161616;
    align-items: start;
}
.pz-list-item:last-child {
    border-bottom: none;
}
.pz-list-num {
    font-size: 8px;
    font-weight: 700;
    color: #dd0000;
    letter-spacing: 0.05em;
    margin-top: 1px;
    font-family: 'Courier New', monospace;
}
.pz-list-text {
    font-size: 9px;
    color: #777777;
    letter-spacing: 0.06em;
    line-height: 1.6;
    text-transform: uppercase;
}
.pz-list-text strong {
    color: #bbbbbb;
    font-weight: 700;
}
a.pz-list-item {
    text-decoration: none;
    color: inherit;
    display: grid;
    transition: background 0.15s ease;
}
a.pz-list-item:hover {
    background: rgba(255, 255, 255, 0.03);
}

/* Code block — monospace dark block with syntax colour classes */
/* Usage: <pre class="pz-code"><span class="pz-k">keyword</span> <span class="pz-v">value</span></pre> */
/* Colour classes: pz-k (red, key), pz-v (light, value), pz-c (dim green, comment), pz-m (muted, base) */
.pz-code {
    background: #0d0d0d;
    border: 1px solid #1c1c1c;
    padding: 8px 10px;
    font-family: 'Courier New', monospace;
    font-size: 9px;
    color: #555555;
    letter-spacing: 0.04em;
    line-height: 1.7;
    white-space: pre-wrap;
    word-break: break-word;
    overflow-x: auto;
}
.pz-k { color: #dd0000; }
.pz-v { color: #aaaaaa; }
.pz-c { color: #336644; }
.pz-m { color: #555555; }


/* ─── Animations ─────────────────────────────────────────────────────────── */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(2rem);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.anim-fade-up {
    animation: fadeUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.anim-fade-in {
    animation: fadeIn 0.6s ease forwards;
}

/* Scroll-triggered: add .is-visible via JS IntersectionObserver */
.reveal {
    opacity: 0;
    transform: translateY(3rem);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
    .reveal {
        transition: none;
        opacity: 1;
        transform: none;
    }
    .anim-fade-up,
    .anim-fade-in {
        animation: none;
        opacity: 1;
        transform: none;
    }
}


/* ─── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
    html { font-size: 9px; }

    .site-nav {
        padding: 2.4rem;
    }

    .nav-row--primary .nav-item {
        padding-top: 10px;
        padding-bottom: 10px;
        font-size: 9px;
    }

    .nav-row--secondary .nav-item {
        padding-top: 5px;
        padding-bottom: 5px;
        font-size: 9px;
    }

    .nav-item--symbolic {
        min-width: 22px;
        font-size: 11px;
    }

    h1 { font-size: 3.2rem; }
    h2 { font-size: 2.4rem; }

    .page-wrap {
        padding: 0 1.6rem 6rem;
    }
}

.archive-wrap {
    padding: 0 var(--side-pad) var(--section-pad-b);
    background: var(--color-dark);
    min-height: 100vh;
}
.archive-rule {
    border: none;
    border-top: 1px solid rgba(255,255,255,0.1);
    margin: 15px 0;
}
.archive-list {
    display: flex;
    flex-direction: column;
}
.archive-row {
    display:          flex;
    justify-content:  space-between;
    align-items:      center;
    padding:          0;
    text-decoration:  none;
    background-color: #0F0F0F;
    margin-bottom:    5px;
}
.archive-title {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.3px;
    text-transform: none;
    color: rgb(255, 255, 255);
}
.archive-title-cliente {
    color: #6d6d6d;
}
.archive-row:hover .archive-title-cliente {
    color: #6d6d6d;
}
.archive-date {
    font-size: 10px;
    color: rgb(109, 109, 109);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
    margin-left: 24px;
}

.archive-pagination {
    margin-top: 2.4rem;
    padding-top: 1.6rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.archive-pagination .nav-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    gap: 0.4rem;
}

.archive-pagination a,
.archive-pagination span {
    display: inline-block;
    padding: 6px 10px;
    font-size: 10px;
    font-weight: 400;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #ffffff;
    text-decoration: none;
    background: #333333;
    transition: background 0.15s ease;
}

.archive-pagination a:hover {
    background: #444444;
}

.archive-pagination .current {
    background: #555555;
    cursor: default;
}


/* ── Servicios page ── */
.servicios-wrap {
    padding:    0;
    background: #000000;
    min-height: 70vh;
    display:    flex;
    flex-direction: column;
}
.servicios-treemap-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
}
.servicios-treemap-container #pztm-root {
  flex: 1;
  width: 100%;
  height: 100%;
  min-height: 400px;
}
.servicios-list-section {
  padding-top: 2.4rem;
  padding-bottom: 2.4rem;
  padding-left: 1.2rem;
  padding-right: 1.2rem;
}
.servicios-list-section .archive-header {
  margin-bottom: 0;
}

/* ── Servicios Mapping page ── */
.servicios-mapping-wrap {
    padding:    0;
    background: var(--color-dark);
    min-height: 100vh;
    height:     100vh;
    display:    flex;
    flex-direction: column;
    box-sizing: border-box;
}
.servicios-mapping-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
}
.servicios-mapping-container #patent-graph-container {
  flex: 1;
  width: 100%;
  height: 100%;
  min-height: 400px;
  display: block;
}

/* ── Servicios Mapping (patent graph) ── */
.servicios-mapping-wrap .node { transition: opacity 0.5s ease; }
.servicios-mapping-wrap .link { transition: opacity 0.5s ease; }
.servicios-mapping-wrap .node.faded { opacity: 0.085; }
.servicios-mapping-wrap .link.faded { opacity: 0.085; }

#patent-graph-container {
  position: relative;
  overflow: hidden;
}

#patent-graph {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 400px;
}

#patent-graph svg {
  width: 100%;
  height: 100%;
  font: 10px 'Roboto', sans-serif;
  font-weight: 600;
  text-transform: uppercase;
  color: #ffffff;
}

#patent-graph-container .link {
  fill: none;
  stroke: #7a7a7a49;
  stroke-width: 1px;
}
#patent-graph-container .link.licensing { stroke: rgba(255,0,0,0.7); stroke-dasharray: 6; }
#patent-graph-container .link.resolved  { stroke: rgba(0,255,0,0.08); stroke-dasharray: 3; }
#patent-graph-container .link.suit     { stroke: rgba(255,255,255,0.2); stroke-dasharray: 10; }
#patent-graph-container .link.ghost    { stroke: rgba(255,255,255,0.1); stroke-dasharray: 0; }

#patent-graph-container .node circle,
#patent-graph-container .node a circle {
  fill: #ff0000;
  stroke: #ff0000;
  stroke-width: 1.5px;
  cursor: pointer;
  touch-action: none;
}

#patent-graph-container .node.pinned circle {
  stroke: #ffffff;
  stroke-width: 2px;
}

#patent-graph-container text {
  fill: #ffffff;
  pointer-events: none;
  font: 10px 'Roboto', sans-serif;
  font-weight: 600;
  text-transform: uppercase;
}

#pg-search-wrap {
  position: absolute;
  top: 2.4rem;
  left: 2.4rem;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 0;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(0, 0, 0, 0.85);
}

#pg-search-wrap:focus-within {
  border-color: rgba(255, 0, 0, 0.8);
}

#pg-search {
  background: transparent;
  border: none;
  outline: none;
  color: #ffffff;
  font-family: 'Roboto', monospace;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 7px 10px;
  width: 160px;
  caret-color: #ff0000;
}

#pg-search::placeholder {
  color: rgba(255, 255, 255, 0.2);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

#pg-search-clear {
  background: transparent;
  border: none;
  border-left: 1px solid rgba(255, 255, 0, 0.1);
  color: rgba(255, 255, 255, 0.25);
  font-size: 10px;
  padding: 5px;
  cursor: pointer;
  line-height: 1;
  transition: color 0.4s;
  display: none;
}

#pg-search-clear:hover {
  color: rgba(255, 0, 0, 0.8);
}

#pg-legend {
  position: absolute;
  bottom: 2.4rem;
  left: 2.4rem;
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 7px;
  background: rgba(0, 0, 0, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.07);
  padding: 15px;
  pointer-events: none;
}

.pg-leg-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pg-leg-row span {
  font-family: 'Roboto', monospace;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.7);
}


/* ── Servicios Treemap ── */
#pztm-root {
  --pztm-bar-h: 56px;
  --pztm-bg: #0a0a0a;
  --pztm-header-bg: #222222;
  --pztm-header-border: #000000;
  --pztm-color-parent: #1c1c1c;
  --pztm-color-leaf: #252525;
  --pztm-color-text: #e8e8e8;
  --pztm-color-value: #999;
  --pztm-color-anc: #cccccc;
  --pztm-color-sep: #cccccc;
  --pztm-color-cur: #ffffff;
  --pztm-color-meta: #cccccc;
  --pztm-color-badge-bg: #FF0000;
  --pztm-color-badge-text: #FFFFFF;
  --pztm-font: 'Roboto', 'Courier New', monospace;

  width: 100%;
  height: clamp(400px, 60vh, 860px);   /* FIX 1: fallback first */
  height: clamp(400px, 60dvh, 860px);  /* FIX 1: override if supported */
  position: relative;
  overflow: hidden;
  background: var(--pztm-bg);
  display: block;
  box-sizing: border-box;
}
#pztm-root *, #pztm-root *::before, #pztm-root *::after {
  box-sizing: border-box;
}
/* ── Skeleton loader ─────────────────────────────────────────────────────── */
@keyframes pztm-shimmer {
  0%   { background-position: -600px 0; }
  100% { background-position:  600px 0; }
}
#pztm-skeleton {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  background: var(--pztm-bg);
}
#pztm-skeleton.is-hidden { display: none; }
.pztm-sk-header {
  height: var(--pztm-bar-h);
  background: var(--pztm-header-bg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  flex-shrink: 0;
}
.pztm-sk-bar {
  height: 11px;
  border-radius: 2px;
  background: linear-gradient(90deg, #2e2e2e 25%, #3a3a3a 50%, #2e2e2e 75%);
  background-size: 1200px 100%;
  animation: pztm-shimmer 1.6s infinite linear;
}
.pztm-sk-title { width: 110px; }
.pztm-sk-pts   { width: 55px; }
.pztm-sk-grid {
  flex: 1;
  display: flex;
  flex-direction: row;
  gap: 1px;
  background: #000;
  overflow: hidden;
}
.pztm-sk-col {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.pztm-sk-cell {
  background: linear-gradient(90deg, #181818 25%, #222 50%, #181818 75%);
  background-size: 1200px 100%;
  animation: pztm-shimmer 1.6s infinite linear;
}
.pztm-sk-cell:nth-child(1) { animation-delay: 0s; }
.pztm-sk-cell:nth-child(2) { animation-delay: 0.12s; }
.pztm-sk-col:nth-child(3) .pztm-sk-cell:nth-child(1) { animation-delay: 0.08s; }
.pztm-sk-col:nth-child(3) .pztm-sk-cell:nth-child(2) { animation-delay: 0.20s; }
.pztm-sk-col:nth-child(4) .pztm-sk-cell:nth-child(1) { animation-delay: 0.16s; }
.pztm-sk-col:nth-child(4) .pztm-sk-cell:nth-child(2) { animation-delay: 0.28s; }
.pztm-sk-col:nth-child(5) .pztm-sk-cell:nth-child(1) { animation-delay: 0.24s; }
.pztm-sk-col:nth-child(5) .pztm-sk-cell:nth-child(2) { animation-delay: 0.36s; }

/* ── Header ── */
#pztm-root .pztm-header {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: var(--pztm-bar-h);
  background: var(--pztm-header-bg);
  border-bottom: 0px solid var(--pztm-header-border);
  display: flex;
  align-items: center;
  padding: 0 10px;
  gap: 10px;
  z-index: 10;
  cursor: default;
  user-select: none;
  overflow: hidden;
  transition: background 750ms ease;
}
#pztm-root .pztm-header.is-clickable { cursor: pointer; }
#pztm-root .pztm-header.is-clickable:hover { background: #161616; }
#pztm-root .pztm-badge {
  flex: 0 0 auto;
  font-family: var(--pztm-font);
  font-size: 10px; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase;
  padding: 3px 6px; border-radius: 0px;
  background: var(--pztm-color-badge-bg);
  color: var(--pztm-color-badge-text);
  line-height: 1;
}
#pztm-root .pztm-crumbs {
  flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-family: var(--pztm-font);
  font-size: 10px; font-weight: 600; letter-spacing: .04em;
}
#pztm-root .pztm-crumbs .sep { color: var(--pztm-color-sep); padding: 0 6px; text-transform: uppercase}
#pztm-root .pztm-crumbs .anc { color: var(--pztm-color-anc); text-transform: uppercase}
#pztm-root .pztm-crumbs .cur { color: var(--pztm-color-cur); text-transform: uppercase}
#pztm-root .pztm-meta {
  flex: 0 0 auto;
  font-family: var(--pztm-font);
  font-size: 9px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--pztm-color-meta); white-space: nowrap;
}

/* ── Canvas ── */
#pztm-root .pztm-canvas {
  position: absolute;
  top: var(--pztm-bar-h);
  left: 0; right: 0; bottom: 0;
  overflow: hidden;
}
#pztm-root .pztm-canvas svg {
  display: block; width: 100%; height: 100%;
}

/* ── Cell labels ── */
#pztm-root .pztm-fo {
  width: 100%; height: 100%;
  overflow: hidden; pointer-events: none; user-select: none;
}
#pztm-root .pztm-label {
  width: 100%; height: 100%;
  display: flex; flex-direction: column;
  justify-content: flex-start; align-items: flex-start;
  padding: 10px 10px; overflow: hidden; gap: 3px;
}
#pztm-root .pztm-name {
  color: var(--pztm-color-text);
  font-family: var(--pztm-font);
  font-size: 10px; font-weight: 600;
  letter-spacing: .04em; line-height: 13px;
  text-transform: uppercase;
  display: -webkit-box;
  -webkit-box-orient: vertical; -webkit-line-clamp: 3;
  overflow: hidden; word-break: break-word; hyphens: auto;
  margin: 0; padding: 0;
}
#pztm-root .pztm-val {
  color: var(--pztm-color-value);
  font-family: var(--pztm-font);
  font-size: 9px; letter-spacing: .06em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin: 0; padding: 0;
}

/* ── Modal ── */
#pztm-root .pztm-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease;
}
#pztm-root .pztm-modal-backdrop.is-open {
  opacity: 1;
  pointer-events: all;
}
#pztm-root .pztm-modal {
  background: #141414;
  border: 1px solid #222;
  border-radius: 4px;
  padding: 24px;
  min-width: 240px;
  max-width: min(360px, calc(100% - 32px));
  display: flex;
  flex-direction: column;
  gap: 16px;
  transform: translateY(8px);
  transition: transform 200ms ease;
}
#pztm-root .pztm-modal-backdrop.is-open .pztm-modal {
  transform: translateY(0);
}
#pztm-root .pztm-modal-path {
  font-family: var(--pztm-font);
  font-size: 10px; letter-spacing: .1em; text-transform: uppercase;
  color: #444; line-height: 16px;
}
#pztm-root .pztm-modal-path .sep { color: #2a2a2a; padding: 0 5px; }
#pztm-root .pztm-modal-name {
  font-family: var(--pztm-font);
  font-size: 14px; font-weight: 700;
  letter-spacing: .04em; text-transform: uppercase;
  color: #e8e8e8; line-height: 1.3; word-break: break-word;
}
#pztm-root .pztm-modal-value {
  font-family: var(--pztm-font);
  font-size: 12px; letter-spacing: .08em; color: #cccccc;
}

#pztm-root .pztm-modal-desc {
  font-family: var(--pztm-font);
  font-size: 11px;
  letter-spacing: .04em;
  color: #888;
  line-height: 1.6;
}

#pztm-root .pztm-modal-actions {
  display: flex; gap: 8px; flex-wrap: wrap;
}
#pztm-root .pztm-modal-btn {
  font-family: var(--pztm-font);
  font-size: 9px; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase;
  padding: 7px 12px; border-radius: 2px;
  border: none; cursor: pointer;
  transition: background 150ms; line-height: 1;
}
#pztm-root .pztm-modal-btn.primary {
  background: #2a2a2a; color: #e8e8e8;
}
#pztm-root .pztm-modal-btn.primary:hover { background: #333; }
#pztm-root .pztm-modal-btn.secondary {
  background: transparent; color: #555;
  border: 1px solid #222;
}
#pztm-root .pztm-modal-btn.secondary:hover { color: #888; border-color: #333; }
#pztm-root .pztm-modal-actions a.pztm-modal-btn {
  text-decoration: none;
  display: inline-block;
  box-sizing: border-box;
}
