/* CYP Digital Project Viewer · shared by Control Center, Portal Cliente and the public website. */
.pv {
    --pv-ink: #16324A;
    --pv-text-2: #4D6275;
    --pv-text-3: #7A8C9C;
    --pv-line: #D7DFE6;
    --pv-line-2: #C2CDD7;
    --pv-blue: #2878D4;
    --pv-blue-ink: #1A5FAF;
    --pv-blue-soft: #EDF4FC;
    --pv-amber: #D3931F;
    --pv-amber-ink: #7A5410;
    --pv-amber-soft: #FBF3E4;
    --pv-panel: rgba(255, 255, 255, .94);
    --pv-ease: cubic-bezier(.2, .7, .2, 1);
    container: pv / inline-size;
    position: relative;
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid var(--pv-line);
    border-radius: 8px;
    color: var(--pv-ink);
    font-size: 13px;
    line-height: 1.35;
    min-width: 0;
}
.pv:not(.is-mounted) { min-height: 620px; background: #F1F4F7; }
.pv [hidden] { display: none !important; }
.pv button { font-family: inherit; }

/* Toolbar */
.pv-bar {
    position: relative; z-index: 8;
    display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 12px;
    padding: 8px 10px 8px 14px; border-bottom: 1px solid var(--pv-line); background: #fff; border-radius: 8px 8px 0 0;
}
.pv-bar__id { display: flex; align-items: baseline; gap: 8px; min-width: 0; white-space: nowrap; overflow: hidden; }
.pv-bar__id strong { font-size: 13px; font-weight: 600; letter-spacing: .01em; }
.pv-bar__id span { font-size: 10.5px; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; color: var(--pv-text-3); overflow: hidden; text-overflow: ellipsis; }
.pv-bar__id span::before { content: "·"; margin-right: 8px; }
.pv-bar__actions { justify-self: end; display: flex; align-items: center; gap: 6px; }

.pv-seg { display: inline-flex; gap: 2px; padding: 2px; border: 1px solid var(--pv-line-2); border-radius: 6px; background: #F5F7F9; }
.pv-seg button {
    height: 28px; padding: 0 12px; border: 0; border-radius: 4px; background: transparent; cursor: pointer;
    font-size: 12.5px; font-weight: 500; line-height: 1; color: var(--pv-text-2); white-space: nowrap;
    transition: background-color .15s var(--pv-ease), color .15s var(--pv-ease), box-shadow .15s var(--pv-ease);
}
.pv-seg button:hover { color: var(--pv-ink); background: #EAEFF3; }
.pv-seg button.is-active { background: #fff; color: var(--pv-blue-ink); box-shadow: 0 0 0 1px var(--pv-line-2), 0 1px 2px rgba(22, 50, 74, .08); }
.pv-seg--sm button { height: 26px; padding: 0 9px; font-size: 12px; }

.pv-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 32px; padding: 0 11px;
    border: 1px solid var(--pv-line-2); border-radius: 6px; background: #fff; color: var(--pv-ink); cursor: pointer;
    font-size: 12.5px; font-weight: 500; line-height: 1; text-decoration: none; white-space: nowrap;
    transition: border-color .15s var(--pv-ease), background-color .15s var(--pv-ease), color .15s var(--pv-ease);
}
.pv-btn:hover { border-color: #9EAFBE; background: #F5F7F9; }
.pv-btn.is-active { border-color: var(--pv-blue); color: var(--pv-blue-ink); background: var(--pv-blue-soft); }
.pv-btn:focus-visible, .pv-seg button:focus-visible, .pv-chip:focus-visible, .pv-tl__btn:focus-visible, .pv-hs:focus-visible { outline: 2px solid var(--pv-blue); outline-offset: 1px; }
.pv-btn--icon { width: 32px; padding: 0; }
.pv-btn--sm { height: 28px; padding: 0 9px; font-size: 12px; }
.pv-btn--ghost { border-color: transparent; background: transparent; }
.pv-btn--solid { background: var(--pv-blue); border-color: var(--pv-blue); color: #fff; }
.pv-btn--solid:hover { background: var(--pv-blue-ink); border-color: var(--pv-blue-ink); }
.pv-btn--block { width: 100%; }
.pv-icon { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.pv-btn--sm .pv-icon { width: 14px; height: 14px; }
.pv-more { display: none; }

/* Viewport */
.pv-body { position: relative; display: flex; min-height: 0; }
.pv-viewport {
    position: relative; flex: 1; min-width: 0; overflow: hidden; isolation: isolate;
    height: var(--pv-h, clamp(460px, calc(var(--vh, 1vh) * 64), 740px));
    background:
        linear-gradient(rgba(22, 50, 74, .04) 1px, transparent 1px) 0 0 / 32px 32px,
        linear-gradient(90deg, rgba(22, 50, 74, .04) 1px, transparent 1px) 0 0 / 32px 32px,
        linear-gradient(180deg, #F3F6F8 0%, #E7EDF1 100%);
}
.pv-canvas-host { position: absolute; inset: 0; }
.pv-canvas { position: absolute; inset: 0; display: block; width: 100% !important; height: 100% !important; outline: none; }
.pv-poster { position: absolute; inset: 8% 6%; width: 88%; height: 84%; object-fit: contain; opacity: .85; pointer-events: none; transition: opacity .3s var(--pv-ease); }
.pv.is-3d .pv-poster { opacity: 0; }
.pv-overlay { position: absolute; inset: 0; z-index: 2; pointer-events: none; }

.pv-top { position: absolute; top: 10px; left: 10px; right: 10px; z-index: 4; display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 8px 10px; pointer-events: none; }
.pv-views { margin-left: auto; }
.pv-top > * { pointer-events: auto; }
.pv-layers { display: flex; flex-wrap: wrap; gap: 2px; padding: 3px; border: 1px solid var(--pv-line); border-radius: 6px; background: var(--pv-panel); }
.pv-chip {
    position: relative; display: inline-flex; align-items: center; gap: 7px; height: 28px; padding: 0 10px;
    border: 0; border-radius: 4px; background: transparent; color: var(--pv-ink); cursor: pointer;
    font-size: 12.5px; font-weight: 500; line-height: 1; white-space: nowrap;
    transition: background-color .15s var(--pv-ease), color .15s var(--pv-ease);
}
.pv-chip:hover { background: #EDF1F4; }
.pv-swatch { width: 10px; height: 10px; flex: none; border-radius: 2px; background: var(--c); transition: background-color .15s var(--pv-ease); }
.pv-chip.is-off { color: var(--pv-text-3); }
.pv-chip.is-off .pv-swatch { background: transparent; box-shadow: inset 0 0 0 1.5px var(--c); }
.pv-chip.is-isolated { background: var(--pv-amber-soft); color: var(--pv-amber-ink); }
.pv-chip.is-isolated::after { content: ""; position: absolute; left: 8px; right: 8px; bottom: 2px; height: 2px; border-radius: 1px; background: var(--pv-amber); }
.pv-chip--mode { margin-left: 3px; color: var(--pv-text-2); }
.pv-chip--mode::before { content: ""; position: absolute; left: -3px; top: 6px; bottom: 6px; width: 1px; background: var(--pv-line); }
.pv-chip--mode.is-active { background: var(--pv-amber-soft); color: var(--pv-amber-ink); }
.pv-chip--xs { height: 24px; padding: 0 8px; font-size: 11.5px; border: 1px solid var(--pv-line); background: #fff; }
.pv-chip--xs.is-active { border-color: var(--pv-blue); color: var(--pv-blue-ink); background: var(--pv-blue-soft); }
.pv-views { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 6px; }
.pv-views .pv-seg, .pv-views .pv-btn { background: var(--pv-panel); }

/* Advanced tools */
.pv-tools { position: absolute; left: 10px; bottom: 10px; z-index: 4; display: flex; flex-direction: column; gap: 8px; width: min(300px, calc(100% - 20px)); }
.pv-tool { padding: 9px 11px 10px; border: 1px solid var(--pv-line); border-radius: 6px; background: rgba(255, 255, 255, .96); }
.pv-tool__head { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 6px; font-size: 10.5px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--pv-text-2); }
.pv-tool__head output { color: var(--pv-ink); letter-spacing: .04em; font-variant-numeric: tabular-nums; }
.pv-tool input[type="range"] { width: 100%; margin: 2px 0 0; accent-color: var(--pv-blue); }
.pv-levels { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }

.pv-flag { position: absolute; left: 50%; top: 56px; z-index: 4; transform: translateX(-50%); padding: 5px 9px; border: 1px solid #EACD95; border-radius: 4px; background: var(--pv-amber-soft); color: var(--pv-amber-ink); font-size: 10.5px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; white-space: nowrap; }
.pv-badge { display: none; position: absolute; right: 12px; bottom: 10px; z-index: 3; font-size: 10px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--pv-text-3); pointer-events: none; }
.pv-loading { position: absolute; left: 50%; top: 50%; z-index: 5; transform: translate(-50%, -50%); padding: 7px 12px; border: 1px solid var(--pv-line); border-radius: 6px; background: #fff; font-size: 12px; color: var(--pv-text-2); }
.pv-fallback { position: absolute; left: 50%; bottom: 40px; z-index: 5; transform: translateX(-50%); display: grid; gap: 2px; width: max-content; max-width: calc(100% - 24px); padding: 10px 14px; border: 1px solid var(--pv-line); border-radius: 6px; background: #fff; text-align: center; font-size: 12.5px; }
.pv-fallback span { color: var(--pv-text-2); font-size: 12px; }
.pv-load { position: absolute; left: 50%; bottom: 46px; z-index: 5; transform: translateX(-50%); height: 36px; padding: 0 14px; }
.pv-empty { position: absolute; inset: 0; z-index: 6; display: grid; place-content: center; justify-items: center; gap: 8px; padding: 24px; background: rgba(240, 244, 247, .9); text-align: center; }
.pv-empty__kicker { font-size: 10.5px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--pv-text-3); }
.pv-empty p { margin: 0 0 6px; max-width: 34ch; font-size: 14px; color: var(--pv-ink); }
.pv.is-empty .pv-top, .pv.is-empty .pv-badge, .pv.is-empty .pv-poster { display: none; }

/* Hotspots */
.pv-hs-layer { position: absolute; inset: 0; pointer-events: none; }
.pv-hs {
    position: absolute; left: 0; top: 0; width: 14px; height: 14px; margin: -7px 0 0 -7px; padding: 0;
    border: 0; background: transparent; cursor: pointer; pointer-events: auto; color: var(--pv-ink);
    transition: opacity .15s var(--pv-ease);
}
.pv-hs__dot { position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--pv-blue); background: #fff; box-shadow: 0 0 0 3px rgba(40, 120, 212, .16); transition: transform .15s var(--pv-ease); }
.pv-hs.is-done .pv-hs__dot { background: var(--pv-blue); }
.pv-hs.is-current .pv-hs__dot { border-color: var(--pv-amber); box-shadow: 0 0 0 3px rgba(211, 147, 31, .22); }
.pv-hs.is-pending .pv-hs__dot { border-color: #8597A7; box-shadow: none; }
.pv-hs__label {
    position: absolute; left: 20px; top: 50%; transform: translateY(-50%); max-width: 190px; padding: 4px 7px;
    border: 1px solid var(--pv-line); border-radius: 4px; background: var(--pv-panel);
    font-size: 11.5px; font-weight: 500; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pv-hs.is-left .pv-hs__label { left: auto; right: 20px; }
.pv-hs:hover .pv-hs__dot, .pv-hs.is-selected .pv-hs__dot { transform: scale(1.18); }
.pv-hs.is-selected .pv-hs__label { border-color: var(--pv-blue); color: var(--pv-blue-ink); }
.pv-hs.is-hidden { opacity: 0; pointer-events: none; }
.pv-hs-card { position: absolute; left: 0; top: 0; z-index: 7; width: 232px; padding: 10px 12px 11px; border: 1px solid var(--pv-line-2); border-radius: 6px; background: #fff; box-shadow: 0 8px 22px rgba(22, 50, 74, .12); pointer-events: auto; }
.pv-hs-card__head { position: relative; display: grid; gap: 3px; padding-right: 22px; }
.pv-hs-card__head strong { font-size: 13px; font-weight: 600; }
.pv-hs-card__type { font-size: 10px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--pv-text-3); }
.pv-hs-card__close { position: absolute; right: -4px; top: -4px; width: 24px; height: 24px; border: 0; border-radius: 4px; background: transparent; color: var(--pv-text-3); font-size: 17px; line-height: 1; cursor: pointer; }
.pv-hs-card__close:hover { background: #EDF1F4; color: var(--pv-ink); }

/* Technical annotations */
.pv-ann { position: absolute; inset: 0; pointer-events: none; transition: opacity .2s var(--pv-ease); }
.pv-ann.is-hidden { opacity: 0; }
.pv-chain { position: absolute; inset: 0; overflow: visible; }
.pv-chain__spine, .pv-chain__tick { stroke: #536A7F; stroke-width: 1; }
.pv-chain__leader { stroke: #8A9DAE; stroke-width: 1; stroke-dasharray: 2 3; }
.pv-chain text {
    fill: #34495C; font-size: 10.5px; font-weight: 500; letter-spacing: .05em; font-variant-numeric: tabular-nums;
    paint-order: stroke; stroke: rgba(240, 244, 247, .92); stroke-width: 3px; stroke-linejoin: round;
}
.pv-chain__mark { transition: opacity .2s var(--pv-ease); }
.pv-chain__mark.is-cut { opacity: .3; }
.pv-gizmo { position: absolute; right: 14px; bottom: 14px; width: 58px; height: 58px; overflow: visible; }
.pv-gizmo line { stroke-width: 2; stroke-linecap: round; }
.pv-gizmo text { font-size: 12px; font-weight: 600; }
.pv-gizmo__origin { fill: #fff; stroke: #7A8C9C; stroke-width: 1.2; }

.pv-kv { display: grid; gap: 7px; margin: 9px 0 0; font-size: 12.5px; }
.pv-kv div { display: flex; justify-content: space-between; gap: 12px; }
.pv-kv dt { color: var(--pv-text-2); }
.pv-kv dd { margin: 0; font-weight: 600; text-align: right; min-width: 0; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }

/* Information panel */
.pv-info { flex: none; box-sizing: border-box; width: 284px; padding: 12px 14px 14px; border-left: 1px solid var(--pv-line); background: #fff; overflow: hidden auto; }
.pv-info .pv-btn { box-sizing: border-box; max-width: 100%; }
.pv-info__head { display: flex; align-items: center; justify-content: space-between; margin: -2px -6px 8px 0; font-size: 10.5px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--pv-text-2); }
.pv-progress { height: 4px; margin: 2px 0 4px; border-radius: 2px; background: #E2E8ED; overflow: hidden; }
.pv-progress i { display: block; height: 100%; background: var(--pv-blue); }
.pv-info__note { margin: 14px 0 12px; font-size: 11.5px; color: var(--pv-text-3); }

/* Timeline and status */
.pv-foot { display: grid; gap: 8px; padding: 8px 14px 10px; border-top: 1px solid var(--pv-line); background: #fff; border-radius: 0 0 8px 8px; }
.pv-tl { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0; padding: 0; list-style: none; }
.pv-tl__step { position: relative; }
.pv-tl__step::before { content: ""; position: absolute; left: 0; right: 0; top: 12px; height: 2px; background: #DCE3E9; }
.pv-tl__step:first-child::before { left: 50%; }
.pv-tl__step:last-child::before { right: 50%; }
.pv-tl__step.is-done::before { background: var(--pv-blue); }
.pv-tl__step.is-current::before { background: linear-gradient(90deg, var(--pv-blue) 50%, #DCE3E9 50%); }
.pv-tl__step.is-current:first-child::before { background: #DCE3E9; }
.pv-tl__btn {
    position: relative; display: grid; justify-items: center; gap: 6px; width: 100%; padding: 6px 4px 5px;
    border: 0; border-radius: 4px; background: transparent; cursor: pointer;
    font-size: 10.5px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; line-height: 1.2; color: var(--pv-text-3);
    transition: color .15s var(--pv-ease), background-color .15s var(--pv-ease);
}
.pv-tl__btn:hover { background: #F3F6F8; }
.pv-tl__mark { position: relative; z-index: 1; width: 12px; height: 12px; border: 2px solid #C2CDD7; border-radius: 50%; background: #fff; }
.is-done .pv-tl__btn { color: var(--pv-text-2); }
.is-done .pv-tl__mark { border-color: var(--pv-blue); background: var(--pv-blue); }
.is-current .pv-tl__btn { color: var(--pv-blue-ink); }
.is-current .pv-tl__mark { border-color: var(--pv-blue); box-shadow: 0 0 0 3px rgba(40, 120, 212, .18); }
.is-current .pv-tl__mark::after { content: ""; position: absolute; inset: 2px; border-radius: 50%; background: var(--pv-blue); }
.pv-tl__btn.is-selected { background: var(--pv-amber-soft); color: var(--pv-amber-ink); }

.pv-status { display: flex; flex-wrap: wrap; row-gap: 6px; margin: 0; padding-top: 8px; border-top: 1px solid #EDF1F4; }
.pv-status__item { display: flex; align-items: baseline; gap: 8px; padding: 0 16px; border-left: 1px solid var(--pv-line); }
.pv-status__item:first-child { padding-left: 0; border-left: 0; }
.pv-status dt { font-size: 10px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--pv-text-3); }
.pv-status dd { margin: 0; font-size: 12.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; font-variant-numeric: tabular-nums; }
.pv-status__cut dd { color: var(--pv-blue-ink); }
.pv-note { margin: 0; font-size: 11px; color: var(--pv-text-3); }

/* Compact menu */
.pv-menu { position: absolute; right: 10px; top: calc(100% + 6px); z-index: 20; display: grid; gap: 10px; width: min(300px, calc(100% - 20px)); padding: 10px; border: 1px solid var(--pv-line-2); border-radius: 8px; background: #fff; box-shadow: 0 10px 28px rgba(22, 50, 74, .14); }
.pv-menu__group > span { display: block; margin-bottom: 6px; font-size: 10px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--pv-text-3); }
.pv-menu__row { display: flex; flex-wrap: wrap; gap: 4px; }
.pv-menu .pv-chip { border: 1px solid var(--pv-line); }
.pv-menu .pv-chip.is-active { border-color: var(--pv-blue); background: var(--pv-blue-soft); color: var(--pv-blue-ink); }

/* Fullscreen */
.pv:fullscreen { width: 100%; height: 100%; border: 0; border-radius: 0; }
.pv.is-expanded { position: fixed; inset: 0; z-index: 1000; border: 0; border-radius: 0; height: 100%; }
.pv.is-full .pv-body, .pv.is-expanded .pv-body { flex: 1; }
.pv.is-full .pv-viewport, .pv.is-expanded .pv-viewport { height: auto; }
.pv.is-full .pv-bar, .pv.is-expanded .pv-bar, .pv.is-full .pv-foot, .pv.is-expanded .pv-foot { border-radius: 0; }

/* Decorative variant: model only, no controls, does not capture pointer or scroll */
.pv--bare { border: 0; border-radius: 0; background: transparent; }
.pv--bare .pv-viewport { background: none; }
.pv--bare .pv-canvas {
    pointer-events: none;
    -webkit-mask-image: linear-gradient(to bottom, #000 72%, transparent 98%), linear-gradient(to right, transparent 1%, #000 16%, #000 84%, transparent 99%);
    -webkit-mask-composite: source-in;
    mask-image: linear-gradient(to bottom, #000 72%, transparent 98%), linear-gradient(to right, transparent 1%, #000 16%, #000 84%, transparent 99%);
    mask-composite: intersect;
}
.pv--bare .pv-top, .pv--bare .pv-tools, .pv--bare .pv-badge, .pv--bare .pv-load, .pv--bare .pv-fallback, .pv--bare .pv-loading, .pv--bare .pv-poster { display: none !important; }

/* Narrow containers: secondary tools move to "Más" */
@container pv (max-width: 900px) {
    .pv-info { position: absolute; top: 0; right: 0; bottom: 0; z-index: 9; box-shadow: -10px 0 24px rgba(22, 50, 74, .1); }
}
@container pv (max-width: 620px) {
    .pv-bar { grid-template-columns: minmax(0, 1fr) auto; gap: 8px; padding: 6px 8px 6px 12px; }
    .pv-bar__modes, .pv-views { display: none; }
    .pv-bar__id span { display: none; }
    .pv-bar__actions .pv-btn span { display: none; }
    .pv-bar__actions .pv-btn { width: 32px; padding: 0; }
    .pv-bar__actions .pv-more { display: inline-flex; width: auto; padding: 0 10px; }
    .pv-bar__actions .pv-more span { display: inline; }
    .pv-viewport { height: var(--pv-h-sm, clamp(340px, calc(var(--vh, 1vh) * 58), 540px)); }
    .pv-top { left: 8px; right: 8px; top: 8px; }
    .pv-layers { flex-wrap: nowrap; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
    .pv-chip { padding: 0 9px; }
    .pv-hs__label { display: none; }
    .pv-flag { top: 48px; }
    .pv-tools { left: 8px; bottom: 8px; width: calc(100% - 16px); }
    .pv-badge { display: block; right: auto; left: 10px; bottom: 8px; }
    .pv-chain text { display: none; }
    .pv-gizmo { right: 8px; bottom: 8px; width: 46px; height: 46px; }
    .pv-foot { padding: 8px 10px 10px; }
    .pv-tl__btn { font-size: 9.5px; letter-spacing: .06em; }
    .pv-status__item { padding: 0 10px; gap: 6px; }
    .pv-status dt { font-size: 9.5px; letter-spacing: .08em; }
    .pv-status dd { font-size: 12px; }
}
@media (max-width: 760px) {
    .pv:not(.is-mounted) { min-height: 520px; }
}
@media (prefers-reduced-motion: reduce) {
    .pv *, .pv *::before, .pv *::after { transition: none !important; }
}
