/* Excel Security Systems — reference-site section styles.
   Layouts adapted from diyalarm.netqom.com (crosshair headings, video cards,
   image grid, Alarm.com app band) in Excel's navy/gold palette.
   All classes are rs- prefixed so they never collide with the inline page styles. */

/* Catamaran carries the reference site's light, open heading voice.
   Archivo stays the face for the rest of the Excel site. */

:root {
  --rs-navy: #14213a;
  --rs-navy-deep: #0f1d38;
  --rs-gold: #c8901a;
  --rs-gold-lift: #f0a500;
  --rs-orange-a: #fe9923;
  --rs-orange-b: #e9ab53;
  --rs-blue: #0045b7;
  --rs-cyan: #00a3eb;
  --rs-ink: #1a1a1a;
  --rs-muted: #6b7280;
  --rs-paper: #fbfaf7;
  --rs-line: #e7e2d8;
}

.rs-section { padding: 84px 5%; background: #fff; }
.rs-section.paper { background: var(--rs-paper); }
.rs-wrap { max-width: 1180px; margin: 0 auto; }

/* ---- Crosshair heading -------------------------------------------------
   The reference mark is a 1px cross: a full-height vertical rule crossed by a
   full-width horizontal rule near the top. Rebuilt here rather than shipped as
   an image so it scales and takes the Excel palette. */
.rs-head { text-align: center; margin-bottom: 48px; }
.rs-h2 {
  position: relative; display: inline-block;
  font-family: var(--font-display);
  font-weight: 500; font-size: clamp(27px, 3.6vw, 42px); line-height: 1.16;
  letter-spacing: -0.01em; color: var(--rs-ink); text-wrap: balance;
}
.rs-h2::before {   /* vertical rule */
  content: ''; position: absolute; left: -22px; top: -16px;
  width: 1px; height: 64px; background: var(--rs-navy);
}
.rs-h2::after {    /* horizontal rule, navy fading to cyan like the reference */
  content: ''; position: absolute; left: -22px; top: -2px;
  width: 66px; height: 1px;
  background: linear-gradient(90deg, var(--rs-navy) 0%, var(--rs-cyan) 100%);
}
.rs-head p {
  margin: 20px auto 0; max-width: 660px;
  font-size: 17px; line-height: 1.68; color: var(--rs-muted);
}
.rs-head.left { text-align: left; }
.rs-head.left p { margin-left: 0; }

/* ---- Video cards ------------------------------------------------------- */
.rs-videos { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 32px; }
.rs-video { display: flex; flex-direction: column; }
.rs-poster {
  position: relative; display: block; width: 100%;
  border-radius: 10px; overflow: hidden; background: #eceae4;
  aspect-ratio: 452 / 255; border: 0; padding: 0;
}
.rs-poster img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rs-play {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 56px; height: 56px; border-radius: 50%;
  background: linear-gradient(145deg, #1f8fe8 0%, #0d5fc4 100%);
  box-shadow: 0 6px 20px rgba(13, 60, 120, 0.42);
  display: grid; place-items: center; pointer-events: none;
}
.rs-play::before {
  content: ''; width: 0; height: 0; margin-left: 4px;
  border-left: 15px solid #fff;
  border-top: 9.5px solid transparent;
  border-bottom: 9.5px solid transparent;
}
.rs-time {
  position: absolute; right: 12px; bottom: 12px;
  background: rgba(0,0,0,0.68); color: #fff;
  font-size: 12px; font-weight: 600; letter-spacing: 0.3px;
  padding: 2px 7px; border-radius: 4px; font-variant-numeric: tabular-nums;
}
.rs-vmeta { display: flex; gap: 11px; align-items: flex-start; padding-top: 15px; }
.rs-avatar {
  width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
  object-fit: cover; border: 1px solid var(--rs-line); background: #fff;
}
.rs-vtitle {
  font-family: var(--font-display);
  font-size: 14.5px; font-weight: 700; line-height: 1.42; color: var(--rs-ink);
}
.rs-vsub { font-size: 12.5px; color: var(--rs-muted); margin-top: 3px; }

/* A card becomes clickable once a file is wired to data-video or a YouTube id
   to data-yt. Where the embed is unavailable the card renders as a link rather
   than a button, so both elements need the same treatment. */
button.rs-poster, a.rs-poster {
  cursor: pointer; display: block; text-decoration: none; color: inherit;
}
button.rs-poster:hover .rs-play,
a.rs-poster:hover .rs-play { transform: translate(-50%, -50%) scale(1.07); }
.rs-play { transition: transform 0.18s ease; }
.rs-pending {
  position: absolute; left: 12px; bottom: 12px;
  background: rgba(255,255,255,0.92); color: #55504a;
  font-size: 10.5px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase;
  padding: 3px 8px; border-radius: 4px;
}

/* ---- Alarm.com app band ------------------------------------------------ */
.rs-app {
  position: relative;
  background: url('media/mobile-app-bg.png') center center / cover no-repeat, 
              linear-gradient(90deg, #0045b7 0%, #00a3eb 100%);
  padding: 0 5%;
  margin: 118px 0;
}
.rs-app-inner {
  max-width: 1180px; margin: 0 auto;
  display: grid; grid-template-columns: 5.6fr 6.4fr; gap: 36px; align-items: center;
}
.rs-app-copy { padding: 64px 0; }
.rs-app .rs-h2 { color: #fff; }
.rs-app .rs-h2::before { background: rgba(255,255,255,0.85); }
.rs-app .rs-h2::after { background: linear-gradient(90deg, rgba(255,255,255,0.9) 0%, rgba(255,255,255,0.15) 100%); }
.rs-app-sub {
  font-family: var(--font-display);
  font-size: 25px; font-weight: 300; color: #fff; margin-top: 4px; letter-spacing: -0.01em;
}
.rs-app p {
  color: rgba(255,255,255,0.93); font-size: 16px; line-height: 1.72;
  margin: 20px 0 30px; max-width: 52ch;
}
.rs-app-media { display: flex; justify-content: center; align-items: center; }
.rs-app-media img {
  width: 100%; max-width: 660px; height: auto; display: block;
  margin-block: -52px;   /* overhang above and below the band, as on the reference */
  filter: drop-shadow(0 26px 40px rgba(6, 30, 70, 0.28));
}

/* Pill button with the circular arrow, as on the reference */
.rs-pill {
  display: inline-flex; align-items: center; gap: 14px;
  background: transparent; color: #fff;
  border: 1px solid rgba(255,255,255,0.65); border-radius: 40px;
  padding: 7px 7px 7px 26px; text-decoration: none;
  font-size: 15px; font-weight: 600; letter-spacing: 0.2px;
  transition: background 0.2s, border-color 0.2s;
}
.rs-pill:hover { background: rgba(255,255,255,0.12); border-color: #fff; }
.rs-pill .circ {
  width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--rs-orange-a) 0%, var(--rs-orange-b) 100%);
  color: #fff; font-size: 13px;
}

/* ---- Image grid ("More than just a Security System") ------------------- */
.rs-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 56px 48px; }
.rs-tile { display: flex; flex-direction: column; }
.rs-tile h3 { flex: 1; }
.rs-tile .rs-btn-orange { align-self: flex-start; }
.rs-tile img {
  width: 100%; aspect-ratio: 631 / 395; object-fit: cover;
  border-radius: 20px; display: block; background: #eceae4;
}
.rs-eyebrow {
  font-family: var(--font-display);
  text-transform: uppercase; letter-spacing: 0.6px;
  font-size: 15.5px; font-weight: 700; color: #f09a2b; margin-top: 20px;
}
.rs-tile h3 {
  font-family: var(--font-display);
  font-size: clamp(20px, 2.1vw, 26px); font-weight: 600; line-height: 1.3;
  color: var(--rs-ink); margin: 9px 0 20px; text-wrap: balance;
}
.rs-btn-orange {
  display: inline-block; text-decoration: none;
  background: linear-gradient(90deg, var(--rs-orange-a) 0%, var(--rs-orange-b) 51%);
  color: #fff; font-size: 14px; font-weight: 600;
  padding: 9px 22px; border-radius: 40px;
  border: 1px solid transparent; transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.rs-btn-orange:hover { background: none; color: var(--rs-ink); border-color: var(--rs-ink); }

/* ---- Footer link row under a reference section ------------------------- */
.rs-more { text-align: center; margin-top: 44px; }
.rs-more a {
  color: var(--rs-navy); text-decoration: none; font-weight: 700; font-size: 15px;
  border-bottom: 2px solid var(--rs-gold); padding-bottom: 3px; transition: color 0.2s;
}
.rs-more a:hover { color: var(--rs-gold); }

.rs-poster:focus-visible, .rs-btn-orange:focus-visible, .rs-pill:focus-visible,
.rs-more a:focus-visible { outline: 2px solid var(--rs-gold); outline-offset: 3px; }

@media (max-width: 900px) {
  .rs-app-inner { grid-template-columns: 1fr; gap: 0; }
  .rs-app-copy { padding: 54px 0 10px; text-align: center; }
  .rs-app p { margin-left: auto; margin-right: auto; }
  .rs-app .rs-h2 { padding-left: 22px; }
  .rs-app-media { padding-bottom: 20px; }
  .rs-app-media img { margin-block: -30px; max-width: 460px; }
  .rs-grid { grid-template-columns: 1fr; gap: 44px; }
}
@media (max-width: 768px) {
  .rs-section { padding: 58px 5%; }
  .rs-videos { gap: 26px; }
  .rs-app { margin: 48px 0; }
}
@media (prefers-reduced-motion: reduce) {
  .rs-play, .rs-btn-orange, .rs-pill, .rs-more a { transition: none !important; }
}

/* ---- Panel page: stat banner, PowerG row, automation chips -------------
   Patterned on the reference IQ Panel 4 page's "Panel Security",
   "Unlocking the powers of PowerG" and "Panel Automation" blocks. */

.rs-statband {
  background: var(--rs-navy-deep); color: #fff;
  border-radius: 16px; padding: 44px 48px;
  display: grid; grid-template-columns: auto 1fr; gap: 48px; align-items: center;
}
.rs-statband .figs { display: flex; gap: 40px; }
.rs-statband .fig b {
  display: block; font-family: var(--font-display);
  font-size: 52px; font-weight: 700; line-height: 1; color: var(--rs-gold-lift);
  letter-spacing: -0.02em;
}
.rs-statband .fig span {
  display: block; margin-top: 8px; font-size: 13px; color: #94a3b8;
  line-height: 1.45; max-width: 120px;
}
.rs-statband h3 {
  font-family: var(--font-display);
  font-size: 23px; font-weight: 600; margin-bottom: 10px; color: #fff;
}
.rs-statband p { color: #cbd5e1; font-size: 15.5px; line-height: 1.7; max-width: 62ch; }

.rs-powerg { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 56px; align-items: start; }
.rs-powerg .body p { font-size: 16px; line-height: 1.75; color: #4b5563; }
.rs-powerg .body p + p { margin-top: 18px; }
.rs-figrow { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.rs-fig {
  border: 1px solid var(--rs-line); border-radius: 12px; padding: 24px;
  background: #fff;
}
.rs-fig b {
  display: block; font-family: var(--font-display);
  font-size: 30px; font-weight: 700; color: var(--rs-navy); line-height: 1; letter-spacing: -0.01em;
}
.rs-fig span { display: block; margin-top: 9px; font-size: 13.5px; color: var(--rs-muted); line-height: 1.5; }

.rs-chips { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.rs-chip {
  display: inline-flex; align-items: center; gap: 9px;
  border: 1px solid var(--rs-line); background: #fff;
  border-radius: 40px; padding: 11px 20px;
  font-size: 14.5px; font-weight: 600; color: var(--rs-navy);
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}
.rs-chip i { color: var(--rs-gold); font-size: 14px; }
.rs-chip:hover { border-color: var(--rs-gold); box-shadow: 0 8px 20px rgba(20,33,58,0.08); transform: translateY(-2px); }

@media (max-width: 900px) {
  .rs-statband { grid-template-columns: 1fr; gap: 28px; padding: 32px; }
  .rs-statband .figs { gap: 28px; }
  .rs-statband .fig b { font-size: 40px; }
  .rs-powerg { grid-template-columns: 1fr; gap: 34px; }
}
@media (max-width: 560px) {
  .rs-figrow { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { .rs-chip { transition: none !important; } }

/* Crosshair heading on dark grounds (CTA bands, featured blocks) */
.cta-section .rs-h2, .rs-app .rs-h2, .featured .rs-h2 { color: #fff; }
.cta-section .rs-h2::before, .featured .rs-h2::before { background: rgba(255,255,255,0.85); }
.cta-section .rs-h2::after, .featured .rs-h2::after {
  background: linear-gradient(90deg, rgba(255,255,255,0.9) 0%, rgba(255,255,255,0.15) 100%);
}
.cta-section .rs-head p { color: #94a3b8; }
/* The heading sits inside the existing .section-header rhythm */
.rs-head { margin-bottom: 44px; }
.rs-head .section-label { margin-bottom: 14px; }
.rs-head.left p { max-width: 70ch; margin-top: 18px; }
/* .section-sub keeps its own styling inside a crosshair header */
.rs-head .section-sub { font-size: 17px; line-height: 1.68; color: var(--rs-muted); }
.rs-head:not(.left) .section-sub { margin-left: auto; margin-right: auto; }
.cta-section .rs-head .section-sub { color: #94a3b8; }

/* Phone: keep the crosshair inside the gutter */
@media (max-width: 768px) {
  .rs-h2::before { left: -9px; height: 54px; top: -13px; }
  .rs-h2::after { left: -9px; width: 52px; top: -1px; }
  .rs-app .rs-h2 { padding-left: 0; }
}

/* The dark "Why Excel Security" block used to separate the last reference
   section from the promo band. With it gone, both are the same off-white,
   so give the seam a hairline. */
.rs-section.paper + #promo { border-top: 1px solid var(--rs-line); }

/* ---- Capability cards -------------------------------------------------
   3x3 grid of image cards with a captioned bar across the bottom. Patterned
   on the reference's Alarm.com grid, in the site's navy with the gold arrow
   that the rest of the buttons now use. */

.ac-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; }
.ac-card {
  display: flex; flex-direction: column;
  border-radius: 12px; overflow: hidden; background: #fff;
  border: 1px solid var(--rs-line);
  text-decoration: none; color: inherit;
  box-shadow: 0 10px 28px rgba(20, 33, 58, 0.10);
  transition: transform 0.2s, box-shadow 0.2s;
}
.ac-card:hover { transform: translateY(-4px); box-shadow: 0 18px 40px rgba(20, 33, 58, 0.18); }
.ac-media { aspect-ratio: 16 / 11; background: #eceae4; overflow: hidden; }
.ac-media img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.35s; }
.ac-card:hover .ac-media img { transform: scale(1.04); }
.ac-cap {
  display: flex; align-items: center; justify-content: center; text-align: center;
  padding: 16px 18px; background: #fff; min-height: 64px; margin-top: auto;
  border-top: 1px solid var(--rs-line);
}
.ac-cap p {
  margin: 0; color: var(--rs-ink); font-size: 16px; font-weight: 600; line-height: 1.35;
  font-family: var(--font-display);
}
.ac-arrow {
  width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
  background: var(--rs-gold-lift); color: var(--rs-navy);
  display: grid; place-items: center; font-size: 13px;
  transition: background 0.2s, transform 0.2s;
}
.ac-card:hover .ac-arrow { background: #ffb61f; transform: translateX(2px); }
.ac-foot { display: flex; justify-content: center; margin-top: 46px; }

@media (max-width: 900px) { .ac-grid { grid-template-columns: repeat(2, 1fr); gap: 20px; } }
@media (max-width: 580px) { .ac-grid { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) {
  .ac-card, .ac-media img, .ac-arrow { transition: none !important; transform: none !important; }
}

/* ---- Capability detail blocks (Alarm.com page) ------------------------- */
.cap-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 36px 30px; }
.cap-block { scroll-margin-top: 90px; display: flex; flex-direction: column; }
.cap-block img {
  width: 100%; aspect-ratio: 16 / 11; object-fit: cover;
  border-radius: 12px; display: block; background: #eceae4;
}
.cap-block h3 {
  font-family: var(--font-display);
  font-size: 19px; font-weight: 700; color: var(--rs-navy);
  margin: 18px 0 8px; line-height: 1.3;
}
.cap-block p { font-size: 14.5px; line-height: 1.68; color: var(--rs-muted); }
.cap-block ul { list-style: none; margin-top: 12px; display: grid; gap: 8px; }
.cap-block li { display: flex; gap: 9px; font-size: 13.5px; color: #4b5563; line-height: 1.55; }
.cap-block li i { color: var(--rs-gold); font-size: 12px; margin-top: 4px; flex-shrink: 0; }
/* the block the visitor jumped to gets a brief gold rule */
.cap-block:target h3 { box-shadow: inset 0 -2px 0 var(--rs-gold-lift); }

@media (max-width: 900px) { .cap-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 580px) { .cap-grid { grid-template-columns: 1fr; } }

/* ---- Brand marquee ----------------------------------------------------
   Logos of the manufacturers whose equipment goes on these systems.
   Two tracks scroll in one continuous loop; the second is aria-hidden so a
   screen reader reads each name once. Pauses on hover and for reduced motion. */

.rs-brands { padding: 58px 0 58px; background: #fff; border-top: 1px solid var(--rs-line); overflow: hidden; }
.rs-brands .rs-head { margin-bottom: 36px; padding-inline: 5%; }
.brand-marquee { position: relative; display: flex; overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent); mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent); }
.brand-track { display: flex; align-items: center; gap: 56px; padding-right: 56px; flex-shrink: 0; animation: brand-scroll 46s linear infinite; }
/* rows run opposite ways at slightly different speeds, so the wall never
   looks like one block sliding past */
.brand-marquee + .brand-marquee { margin-top: 26px; }
.brand-marquee.rev .brand-track { animation-direction: reverse; animation-duration: 54s; }
.brand-marquee.row3 { display: none; }
.brand-marquee.row3 .brand-track { animation-duration: 50s; }
.brand-marquee:hover .brand-track { animation-play-state: paused; }
.brand-track img {
  height: 34px; width: auto; max-width: 128px; object-fit: contain; display: block;
  filter: grayscale(1); opacity: 0.55; transition: filter 0.25s, opacity 0.25s;
}
.brand-track img:hover { filter: grayscale(0); opacity: 1; }
@keyframes brand-scroll { from { transform: translateX(0); } to { transform: translateX(-100%); } }

@media (max-width: 768px) {
  /* A third row fits only if the band gives the height back: padding and the
     heading margin come down by exactly the 42px the extra row and gap cost,
     so the section stays 331px tall and nothing below it moves. */
  .rs-brands { padding: 36px 0 38px; }
  .rs-brands .rs-head { margin-bottom: 24px; }
  .brand-track { gap: 38px; padding-right: 38px; }
  .brand-track img { height: 28px; max-width: 104px; }
  .brand-marquee + .brand-marquee { margin-top: 20px; }
  .brand-marquee.row3 { display: flex; }
}
@media (prefers-reduced-motion: reduce) {
  .brand-track { animation: none; }
  .brand-marquee { overflow-x: auto; -webkit-mask-image: none; mask-image: none; }
}

/* ---- Category page: comparison table & split rows --------------------- */
.cmp-wrap { overflow-x: auto; border: 1px solid var(--rs-line); border-radius: 12px; }
table.cmp { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 760px; }
table.cmp th { text-align: left; font-family: var(--font-display); font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1.6px; color: #8a6a1f; background: var(--rs-paper);
  padding: 16px 18px; border-bottom: 1px solid var(--rs-line); vertical-align: bottom; }
table.cmp th:first-child { width: 160px; }
table.cmp td { padding: 15px 18px; border-bottom: 1px solid var(--rs-line); color: #4b5563;
  line-height: 1.55; vertical-align: top; }
table.cmp tr:last-child td { border-bottom: 0; }
table.cmp td:first-child { font-weight: 700; color: var(--rs-navy); }
table.cmp tr:nth-child(even) td { background: #fcfbf9; }

/* Alternating image/text rows */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 54px; align-items: center; }
.split + .split { margin-top: 64px; }
.split img { width: 100%; border-radius: 12px; display: block; background: #eceae4; }
.split h3 { font-family: var(--font-display); font-size: clamp(21px, 2.3vw, 27px); font-weight: 800;
  letter-spacing: -0.01em; color: var(--rs-navy); margin-bottom: 14px; line-height: 1.2; }
.split p { font-size: 16px; line-height: 1.72; color: #4b5563; }
.split p + p { margin-top: 14px; }
.split.flip > :first-child { order: 2; }

/* Three tiles with a caption under each */
.tiles3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.tiles3 a { text-decoration: none; color: inherit; display: block; }
.tiles3 img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 12px; display: block;
  transition: transform 0.25s; }
.tiles3 a:hover img { transform: translateY(-4px); }
.tiles3 .cap { margin-top: 14px; text-align: center; font-family: var(--font-display);
  font-size: 18px; font-weight: 700; color: var(--rs-navy); }

/* Hero with the word set over the picture, as in the Figma */
.pic-hero { position: relative; border-radius: 14px; overflow: hidden; }
.pic-hero img { width: 100%; aspect-ratio: 1512/689; object-fit: cover; display: block; }
.pic-hero span { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  background: rgba(20,33,58,0.62); color: #fff; font-family: var(--font-display);
  font-size: clamp(22px, 3.4vw, 40px); font-weight: 700; letter-spacing: -0.01em;
  padding: 12px 28px; border-radius: 6px; white-space: nowrap; }

@media (max-width: 900px) {
  .split { grid-template-columns: 1fr; gap: 26px; }
  .split.flip > :first-child { order: 0; }
  .split + .split { margin-top: 44px; }
  .tiles3 { grid-template-columns: 1fr; gap: 22px; }
}
.cat-block { scroll-margin-top: 92px; }

/* Small product shot inside a detail block (e.g. the ADC-S40-T sensor). */
.rs-powerg .shot {
  float: right; width: 152px; margin: 0 0 18px 24px;
  background: #fff; border: 1px solid var(--rs-line); border-radius: 10px; padding: 14px;
}
.rs-powerg .shot img { width: 100%; height: auto; display: block; }
@media (max-width: 720px) {
  .rs-powerg .shot { float: none; width: 132px; margin: 0 0 16px; }
}

/* VIDEO LIGHTBOX ---------------------------------------------------------
   Clicking a poster opens the clip over the page. The frame is 80% of the
   viewport width, falling back to a height-derived width on short screens so
   a 16:9 box always fits without the page scrolling. */
.vb {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  padding: max(20px, env(safe-area-inset-top, 0px)) max(20px, env(safe-area-inset-right, 0px))
           max(20px, env(safe-area-inset-bottom, 0px)) max(20px, env(safe-area-inset-left, 0px));
  background: rgba(8, 16, 34, 0.88);
  opacity: 0; transition: opacity 0.18s ease;
}
.vb.open { opacity: 1; }
.vb-frame {
  position: relative;
  width: min(80vw, calc((100vh - 56px) * 16 / 9));
  aspect-ratio: 16 / 9;
  max-width: 100%;
  background: #000; border-radius: 12px; overflow: hidden;
  box-shadow: 0 34px 90px rgba(0, 0, 0, 0.6);
  transform: scale(0.975); transition: transform 0.18s ease;
}
.vb.open .vb-frame { transform: scale(1); }
.vb-frame video,
.vb-frame iframe { width: 100%; height: 100%; display: block; border: 0; background: #000; }
.vb-close {
  position: absolute; top: 12px; right: 12px; z-index: 2;
  width: 40px; height: 40px; padding: 0; border: 0; border-radius: 50%;
  background: rgba(12, 20, 38, 0.66); color: #fff;
  font-size: 17px; line-height: 40px; text-align: center; cursor: pointer;
  transition: background 0.18s ease;
}
.vb-close:hover, .vb-close:focus-visible { background: rgba(12, 20, 38, 0.92); outline: none; }
body.vb-lock { overflow: hidden; }
@media (max-width: 720px) {
  .vb-frame { width: min(94vw, calc((100vh - 40px) * 16 / 9)); }
  .vb-close { top: 8px; right: 8px; width: 34px; height: 34px; font-size: 15px; line-height: 34px; }
}
@media (prefers-reduced-motion: reduce) {
  .vb, .vb-frame { transition: none; }
}
