/* =============================================================================
   Visitor Assistance — Command Center integration
   =============================================================================

   DESIGN RATIONALE (every choice here has a reason; none of it is ornament):

   The Office of the Secretary of the Sanggunian IS a records cabinet. So the
   3D in this block is the metaphor made literal, not a gradient effect bolted
   on top:

   · The tabs are physical FOLDER TABS. The active one is raised on the Z axis
     and its bottom border is erased so it visually fuses with the panel below
     — exactly how a card sticks out of a drawer. Inactive tabs sit recessed
     and desaturated, as if pushed back into the file.
   · The heading is ENGRAVED BRASS. Layered shadows extrude the letterform the
     way the plaques on a Philippine city hall are cast — gold on navy, lit
     from top-left. It is the same gold already in the SP palette, so it reads
     as this institution rather than as a web trend.
   · Buttons have a real UNDERSIDE. Pressing collapses the shadow and drops the
     face by exactly that distance, so the travel is physically honest.

   Everything degrades: no 3D under prefers-reduced-motion, no colour-only
   status anywhere, and the whole block still works with JS disabled.

   Depends on the tokens already defined in sppag-command-center.css
   (--sp-navy, --sp-gold, --sp-blue …). It adds NO new palette.
   ========================================================================== */

.spcc-visitor {
  --vcc-face:     #132340;
  --vcc-face-2:   #0E1B31;
  --vcc-edge:     #24395C;
  --vcc-lip:      #071021;
  --vcc-gold:     var(--sp-gold, #D8B368);
  --vcc-gold-dk:  var(--sp-gold-dark, #B98A2C);
  --vcc-ink:      #E8EFF8;
  --vcc-dim:      #93A6C2;
  --vcc-depth:    6px;
  --vcc-ease:     cubic-bezier(.22, .61, .36, 1);

  position: relative;
  margin-top: 1.4rem;
  padding: 0;
  border-radius: 18px;
  background:
    radial-gradient(120% 140% at 12% 0%, #17294A 0%, transparent 58%),
    linear-gradient(168deg, var(--sp-navy, #0C1526) 0%, #0A1628 40%, #08111F 100%);
  background-color: var(--sp-navy, #0C1526);
  border: 1px solid var(--vcc-edge);
  box-shadow:
    0 28px 70px rgba(6, 12, 24, .38),
    inset 0 1px 0 rgba(255, 255, 255, .06);
  overflow: hidden;
}

/* A single hairline of gold along the top edge — the same device used on the
   masthead, so this block reads as part of the same system. */
.spcc-visitor::before {
  content: "";
  position: absolute; inset: 0 0 auto 0; height: 3px;
  background: linear-gradient(90deg, transparent, var(--vcc-gold) 22%, var(--vcc-gold-dk) 55%, transparent);
  opacity: .85;
}

/* ---------- header ------------------------------------------------------ */
.spcc-visitor__head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 1.2rem; flex-wrap: wrap;
  padding: 1.5rem 1.6rem .2rem;
}

.spcc-visitor__eyebrow {
  display: inline-flex; align-items: center; gap: .5rem;
  font-size: .74rem; font-weight: 700; letter-spacing: .18em; text-transform: uppercase;
  color: var(--vcc-gold);
  margin-bottom: .55rem;
}
.spcc-visitor__eyebrow::before {
  content: ""; width: 26px; height: 2px; background: var(--vcc-gold-dk); display: inline-block;
}

/* ---- ENGRAVED BRASS TITLE --------------------------------------------
   Cast metal reads as: a dark bevel below-right, a bright catch-light above-
   left, and a soft ambient glow. Six stacked shadows is what produces depth
   that survives at small sizes — a single text-shadow just looks blurry. */
.spcc-visitor__title {
  margin: 0;
  font-size: clamp(1.55rem, 1.05rem + 1.9vw, 2.45rem);
  font-weight: 800;
  letter-spacing: -.015em;
  line-height: 1.08;
  color: #F2DFAE;
  background: linear-gradient(174deg, #FBEFD2 4%, var(--vcc-gold) 42%, #A97C22 96%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter:
    drop-shadow(0 1px 0 rgba(255, 255, 255, .22))
    drop-shadow(0 2px 0 #6B4E13)
    drop-shadow(0 3px 1px rgba(0, 0, 0, .55))
    drop-shadow(0 10px 22px rgba(216, 179, 104, .18));
  transform: perspective(700px) rotateX(7deg);
  transform-origin: 50% 100%;
}
/* Browsers without background-clip:text still get solid gold, not invisible text. */
@supports not ((-webkit-background-clip: text) or (background-clip: text)) {
  .spcc-visitor__title { color: var(--vcc-gold); -webkit-text-fill-color: currentColor; }
}

.spcc-visitor__sub {
  color: var(--vcc-dim);
  margin: .6rem 0 0;
  max-width: 54ch;
  font-size: .98rem;
  line-height: 1.55;
}

.spcc-visitor__badge {
  align-self: flex-start;
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .4rem .8rem; border-radius: 999px;
  background: rgba(216, 179, 104, .1);
  border: 1px dashed rgba(216, 179, 104, .55);
  color: #EBD9AE; font-size: .78rem; font-weight: 700;
  letter-spacing: .05em; text-transform: uppercase;
  white-space: nowrap;
}

/* ---------- 3D FOLDER TABS --------------------------------------------- */
.spcc-visitor__tabs {
  display: flex; gap: .42rem; align-items: flex-end;
  padding: 1.15rem 1.6rem 0;
  margin-bottom: -1px;               /* the active tab fuses with the panel */
  perspective: 900px;
  /* Folder tabs must stay on ONE row -- a wrapped folder tab is meaningless,
     and scrolling hid "Kiosk & Display" behind an invisible scrollbar. Four of
     them need ~1100px; below that the container query hands over to a 2x2
     segmented control instead of wrapping or clipping. */
  flex-wrap: nowrap;
}

.spcc-vtab {
  position: relative;
  flex: 0 0 auto;
  display: inline-flex; align-items: center; gap: .55rem;
  padding: .74rem .95rem .8rem;
  min-height: 48px;
  font: inherit; font-size: .95rem; font-weight: 650;
  color: var(--vcc-dim);
  cursor: pointer;
  border: 1px solid var(--vcc-edge);
  border-bottom-color: transparent;
  border-radius: 12px 12px 0 0;
  background: linear-gradient(180deg, var(--vcc-face-2), #0A1526);
  transform-origin: 50% 100%;
  transform: perspective(900px) rotateX(9deg) translateZ(-8px);
  transition:
    transform .34s var(--vcc-ease),
    color .2s ease,
    background .28s ease,
    box-shadow .3s var(--vcc-ease);
  white-space: nowrap;
}
.spcc-vtab:hover {
  color: var(--vcc-ink);
  transform: perspective(900px) rotateX(5deg) translateZ(-2px);
  background: linear-gradient(180deg, #16294A, #0C1830);
}

/* The raised, in-focus folder card. */
.spcc-vtab[aria-selected="true"] {
  color: #FFF8E7;
  background: linear-gradient(180deg, #1B3057 0%, var(--vcc-face) 100%);
  border-color: var(--vcc-edge);
  transform: perspective(900px) rotateX(0deg) translateZ(0) translateY(1px);
  box-shadow:
    0 -10px 26px rgba(216, 179, 104, .12),
    inset 0 1px 0 rgba(255, 255, 255, .1);
  z-index: 2;
}
/* Gold index-strip along the top of the active tab, like a coloured file label. */
.spcc-vtab[aria-selected="true"]::before {
  content: "";
  position: absolute; top: -1px; left: 12px; right: 12px; height: 3px;
  background: linear-gradient(90deg, var(--vcc-gold-dk), var(--vcc-gold), var(--vcc-gold-dk));
  border-radius: 0 0 3px 3px;
}
/* Erase the seam so the tab and the panel are one continuous surface. */
.spcc-vtab[aria-selected="true"]::after {
  content: "";
  position: absolute; left: 1px; right: 1px; bottom: -2px; height: 4px;
  background: var(--vcc-face);
}

.spcc-vtab__icon { font-size: 1.05rem; line-height: 1; }
.spcc-vtab__count {
  display: inline-block; min-width: 1.4rem; padding: .06rem .38rem;
  border-radius: 999px; font-size: .74rem; font-weight: 800;
  background: rgba(216, 179, 104, .16); color: var(--vcc-gold);
  border: 1px solid rgba(216, 179, 104, .3);
  font-variant-numeric: tabular-nums;
}

.spcc-vtab:focus-visible {
  outline: 3px solid var(--vcc-gold);
  outline-offset: 3px;
  z-index: 3;
}

/* ---------- panel ------------------------------------------------------- */
.spcc-visitor__panels {
  position: relative;
  background: var(--vcc-face);
  border-top: 1px solid var(--vcc-edge);
  padding: 1.5rem 1.6rem 1.6rem;
}

.spcc-vpanel[hidden] { display: none; }
.spcc-vpanel {
  animation: vcc-rise .42s var(--vcc-ease) both;
}
@keyframes vcc-rise {
  from { opacity: 0; transform: translateY(10px) scale(.994); }
  to   { opacity: 1; transform: none; }
}

.spcc-vpanel__lede {
  color: var(--vcc-ink);
  font-size: 1.02rem; line-height: 1.6;
  margin: 0 0 1.15rem; max-width: 62ch;
}
.spcc-vpanel__lede strong { color: #FFF3D6; }

/* ---------- step ladder -------------------------------------------------- */
.vcc-steps {
  list-style: none; margin: 0 0 1.3rem; padding: 0;
  counter-reset: vcc;
  display: grid; gap: .6rem;
  /* auto-fit, NOT repeat(4): with the sidebar open the panel is ~740-920px, and
     forcing four columns squeezed each card to 177px, which broke headings like
     "Get a reference & QR" across three ragged lines. It now falls back to 2x2
     and only goes four-across when there is genuinely room. */
  /* Fallback for engines without container queries. */
  grid-template-columns: repeat(auto-fit, minmax(228px, 1fr));
}

/* The panel's width depends on whether the command-center sidebar is open, so
   a VIEWPORT breakpoint is the wrong instrument — it produced a 3-column grid
   with a single orphaned fourth card. A container query measures the thing
   that actually varies, and only ever yields 1, 2 or 4 columns. */
.spcc-visitor__panels { container-type: inline-size; container-name: vpanel; }

@supports (container-type: inline-size) {
  .vcc-steps { grid-template-columns: repeat(2, 1fr); }
  @container vpanel (max-width: 520px) {
    .vcc-steps { grid-template-columns: 1fr; }
  }
  @container vpanel (min-width: 1000px) {
    .vcc-steps { grid-template-columns: repeat(4, 1fr); }
  }
  /* Live figures follow the same rule: 2 across, 4 only when there is room. */
  .vcc-live { grid-template-columns: repeat(2, 1fr); }
  @container vpanel (max-width: 460px) { .vcc-live { grid-template-columns: 1fr; } }
  @container vpanel (min-width: 860px)  { .vcc-live { grid-template-columns: repeat(4, 1fr); } }
}

.vcc-steps li {
  counter-increment: vcc;
  position: relative;
  padding: .85rem .85rem .9rem 2.75rem;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .045), rgba(255, 255, 255, .015));
  border: 1px solid var(--vcc-edge);
  color: var(--vcc-ink);
  font-size: .93rem; line-height: 1.45;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05);
}
.vcc-steps li::before {
  content: counter(vcc);
  position: absolute; left: .85rem; top: .9rem;
  width: 1.55rem; height: 1.55rem; border-radius: 50%;
  display: grid; place-items: center;
  font-weight: 800; font-size: .82rem;
  color: #241A05;
  background: linear-gradient(160deg, #F0D89C, var(--vcc-gold-dk));
  box-shadow: 0 2px 0 #6B4E13, 0 4px 8px rgba(0, 0, 0, .4);
}
.vcc-steps b {
  display: block; color: #FFF3D6; font-weight: 700; margin-bottom: .15rem;
  font-size: .96rem; line-height: 1.3;
  /* If it must wrap, wrap evenly rather than leaving one word stranded. */
  text-wrap: balance;
  hyphens: none;
}
.vcc-steps li { text-wrap: pretty; }

/* ---------- 3D BUTTONS --------------------------------------------------
   A real underside: the face sits --vcc-depth above a darker lip. Pressing
   moves the face down by exactly the shadow height, so the travel is honest
   rather than a fake scale. */
.vcc-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  min-height: 50px; padding: .8rem 1.35rem;
  font: inherit; font-size: 1rem; font-weight: 750;
  border: 0; border-radius: 13px; cursor: pointer;
  text-decoration: none;
  color: #231904;
  position: relative;
  text-align: center;
  line-height: 1.25;
  text-wrap: balance;      /* "What is your / concern?" instead of a stranded word */
  transition: transform .13s var(--vcc-ease), box-shadow .13s var(--vcc-ease), filter .2s ease;
  will-change: transform;
}

.vcc-btn--gold {
  color: #231904;
  background: linear-gradient(180deg, #F0D89C 0%, var(--vcc-gold) 48%, #C99A3B 100%);
  box-shadow:
    0 var(--vcc-depth) 0 #7E5A16,
    0 calc(var(--vcc-depth) + 8px) 20px rgba(0, 0, 0, .42),
    inset 0 1px 0 rgba(255, 255, 255, .55);
}
.vcc-btn--gold:hover { filter: brightness(1.06); }

.vcc-btn--ghost {
  color: var(--vcc-ink);
  background: linear-gradient(180deg, #1B2F52, #142441);
  box-shadow:
    0 var(--vcc-depth) 0 #060D1A,
    0 calc(var(--vcc-depth) + 8px) 18px rgba(0, 0, 0, .38),
    inset 0 1px 0 rgba(255, 255, 255, .08);
}
.vcc-btn--ghost:hover { background: linear-gradient(180deg, #21395F, #17294A); }

.vcc-btn:active {
  transform: translateY(var(--vcc-depth));
  box-shadow: 0 0 0 rgba(0, 0, 0, 0), inset 0 2px 6px rgba(0, 0, 0, .32);
}
.vcc-btn:focus-visible { outline: 3px solid var(--vcc-gold); outline-offset: 4px; }

.vcc-actions { display: flex; gap: .7rem; flex-wrap: wrap; align-items: center; }

/* ---------- live strip --------------------------------------------------- */
.vcc-live {
  display: grid; gap: .7rem; margin-bottom: 1.2rem;
  grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
}
.vcc-live__cell {
  padding: .85rem .95rem; border-radius: 12px;
  background: linear-gradient(180deg, #0F1D36, #0B1729);
  border: 1px solid var(--vcc-edge);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05);
}
.vcc-live__k {
  display: block; font-size: .72rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--vcc-dim); margin-bottom: .3rem;
}
.vcc-live__v {
  display: block; font-size: 1.7rem; font-weight: 800; line-height: 1;
  color: var(--vcc-gold); font-variant-numeric: tabular-nums;
  font-family: Consolas, "SF Mono", ui-monospace, monospace;
}
.vcc-live__v[data-state="loading"] { color: var(--vcc-dim); font-size: 1rem; font-family: inherit; font-weight: 600; }
.vcc-live__n { display: block; font-size: .78rem; color: var(--vcc-dim); margin-top: .25rem; }

/* ---------- inline notice ------------------------------------------------ */
.vcc-note {
  border-left: 3px solid var(--vcc-gold-dk);
  background: rgba(216, 179, 104, .08);
  padding: .8rem 1rem; border-radius: 0 10px 10px 0;
  color: #EEDFBB; font-size: .92rem; margin: 1.1rem 0 0;
}
.vcc-note--stop { border-left-color: #C4606A; background: rgba(196, 96, 106, .1); color: #F3D2D5; }

/* ---------- reduced motion / forced colours ------------------------------ */
@media (prefers-reduced-motion: reduce) {
  .spcc-visitor__title { transform: none; }
  .spcc-vtab,
  .spcc-vtab:hover,
  .spcc-vtab[aria-selected="true"] { transform: none; transition: color .01ms, background .01ms; }
  .spcc-vpanel { animation: none; }
  .vcc-btn { transition: none; }
  .vcc-btn:active { transform: none; }
}

@media (forced-colors: active) {
  .spcc-visitor__title { -webkit-text-fill-color: CanvasText; color: CanvasText; filter: none; }
  .spcc-vtab, .vcc-btn, .vcc-live__cell, .vcc-steps li { border: 1px solid CanvasText; }
  .spcc-vtab[aria-selected="true"] { outline: 2px solid Highlight; }
}

/* ---------- narrow screens ------------------------------------------------ */
@media (max-width: 640px) {
  .spcc-visitor__head { padding: 1.15rem 1.05rem .2rem; }
  .spcc-visitor__tabs { padding: .9rem 1.05rem 0; }
  .spcc-visitor__panels { padding: 1.15rem 1.05rem 1.3rem; }
  .spcc-vtab { padding: .7rem .85rem .78rem; font-size: .89rem; }
  /* On a phone the 3D tilt costs legibility for no benefit — flatten it. */
  .spcc-vtab, .spcc-vtab[aria-selected="true"] { transform: none; }
  .spcc-visitor__title { transform: none; }
  .vcc-btn { width: 100%; }
}

@media print {
  .spcc-visitor { break-inside: avoid; }
  .spcc-visitor__tabs, .vcc-actions { display: none; }
  .spcc-vpanel[hidden] { display: block !important; }
}

/* =============================================================================
   COLOUR CODING + MOTION
   -----------------------------------------------------------------------------
   Each folder tab carries its own accent, reusing the command center's existing
   data-tone vocabulary so this reads as the same product rather than a new one.
   Colour is an ADDITIONAL cue only — every tab still has its own icon and its
   own word, so nothing here depends on being able to distinguish hues.
   ========================================================================== */

.spcc-vtab[data-tone="gold"]   { --vt: #D8B368; --vt-dk: #B98A2C; }
.spcc-vtab[data-tone="cyan"]   { --vt: #38BDF8; --vt-dk: #0E7FB5; }
.spcc-vtab[data-tone="violet"] { --vt: #4E8DC4; --vt-dk: #6D4FD1; }
.spcc-vtab[data-tone="green"]  { --vt: #4ADE80; --vt-dk: #199A4C; }

/* The index strip and the raised glow take the tab's own colour. */
.spcc-vtab[aria-selected="true"]::before {
  background: linear-gradient(90deg, var(--vt-dk), var(--vt), var(--vt-dk));
  box-shadow: 0 0 14px color-mix(in srgb, var(--vt) 55%, transparent);
}
.spcc-vtab[aria-selected="true"] {
  box-shadow:
    0 -10px 26px color-mix(in srgb, var(--vt) 20%, transparent),
    inset 0 1px 0 rgba(255, 255, 255, .1);
}
.spcc-vtab[aria-selected="true"] .spcc-vtab__icon { filter: drop-shadow(0 0 6px var(--vt)); }
.spcc-vtab:hover .spcc-vtab__icon { transform: scale(1.12); }
.spcc-vtab__icon { transition: transform .22s var(--vcc-ease), filter .25s ease; }
.spcc-vtab:focus-visible { outline-color: var(--vt, var(--vcc-gold)); }

.spcc-vtab__count {
  background: color-mix(in srgb, var(--vt) 16%, transparent);
  color: var(--vt);
  border-color: color-mix(in srgb, var(--vt) 34%, transparent);
}

/* The panel inherits the active tab's accent, so the eye is carried downward. */
.spcc-vpanel[data-tone="gold"]   { --vp: #D8B368; }
.spcc-vpanel[data-tone="cyan"]   { --vp: #38BDF8; }
.spcc-vpanel[data-tone="violet"] { --vp: #4E8DC4; }
.spcc-vpanel[data-tone="green"]  { --vp: #4ADE80; }

.spcc-vpanel .vcc-steps li::before {
  background: linear-gradient(160deg,
    color-mix(in srgb, var(--vp, #D8B368) 75%, #FFFFFF),
    color-mix(in srgb, var(--vp, #D8B368) 70%, #000000));
  box-shadow: 0 2px 0 color-mix(in srgb, var(--vp, #D8B368) 45%, #000),
              0 4px 8px rgba(0, 0, 0, .4);
}
.spcc-vpanel .vcc-live__v { color: var(--vp, var(--vcc-gold)); }
.spcc-vpanel .vcc-note    { border-left-color: var(--vp, var(--vcc-gold-dk));
                            background: color-mix(in srgb, var(--vp, #D8B368) 8%, transparent); }
.spcc-vpanel .vcc-btn--gold {
  background: linear-gradient(180deg,
    color-mix(in srgb, var(--vp, #D8B368) 55%, #FFFFFF) 0%,
    var(--vp, #D8B368) 48%,
    color-mix(in srgb, var(--vp, #D8B368) 72%, #000000) 100%);
  box-shadow:
    0 var(--vcc-depth) 0 color-mix(in srgb, var(--vp, #D8B368) 42%, #000),
    0 calc(var(--vcc-depth) + 8px) 20px rgba(0, 0, 0, .42),
    inset 0 1px 0 rgba(255, 255, 255, .5);
}
/* Older engines that lack color-mix keep the base gold rules above. */

/* ---------- staggered entrance -------------------------------------------
   The steps deal themselves out like cards from a file, left to right. Six
   items max, so the whole sequence finishes in under 0.4s — informative
   sequencing, not a wait. */
.spcc-vpanel .vcc-steps li {
  animation: vcc-deal .38s var(--vcc-ease) both;
}
.spcc-vpanel .vcc-steps li:nth-child(1) { animation-delay: .04s; }
.spcc-vpanel .vcc-steps li:nth-child(2) { animation-delay: .10s; }
.spcc-vpanel .vcc-steps li:nth-child(3) { animation-delay: .16s; }
.spcc-vpanel .vcc-steps li:nth-child(4) { animation-delay: .22s; }
@keyframes vcc-deal {
  from { opacity: 0; transform: translateY(14px) rotateX(-12deg); }
  to   { opacity: 1; transform: none; }
}

.spcc-vpanel .vcc-live__cell { animation: vcc-deal .34s var(--vcc-ease) both; }
.spcc-vpanel .vcc-live__cell:nth-child(1) { animation-delay: .03s; }
.spcc-vpanel .vcc-live__cell:nth-child(2) { animation-delay: .09s; }
.spcc-vpanel .vcc-live__cell:nth-child(3) { animation-delay: .15s; }
.spcc-vpanel .vcc-live__cell:nth-child(4) { animation-delay: .21s; }

.spcc-vpanel .vcc-actions .vcc-btn { animation: vcc-deal .3s var(--vcc-ease) both .26s; }

/* ---------- live-value change flash ---------------------------------------
   When a figure actually changes we say so, briefly. Silent mutation of a
   number on screen is how people miss that they have been called. */
.vcc-live__v.is-changed { animation: vcc-flash .9s ease-out 1; }
@keyframes vcc-flash {
  0%   { transform: scale(1);    text-shadow: none; }
  22%  { transform: scale(1.16); text-shadow: 0 0 20px currentColor; }
  100% { transform: scale(1);    text-shadow: none; }
}

/* "Now serving" breathes only while a number is actually being called. */
.vcc-live__cell[data-live="calling"] {
  border-color: color-mix(in srgb, var(--vp, #38BDF8) 55%, transparent);
  animation: vcc-breathe 2.4s ease-in-out infinite;
}
@keyframes vcc-breathe {
  0%, 100% { box-shadow: inset 0 1px 0 rgba(255,255,255,.05), 0 0 0 rgba(56,189,248,0); }
  50%      { box-shadow: inset 0 1px 0 rgba(255,255,255,.05),
                         0 0 22px color-mix(in srgb, var(--vp, #38BDF8) 30%, transparent); }
}

/* A quiet sheen crossing the brass, once, when the block first appears. */
.spcc-visitor__title { position: relative; }
.spcc-visitor.is-revealed .spcc-visitor__title::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(105deg, transparent 38%, rgba(255,255,255,.45) 50%, transparent 62%);
  background-size: 260% 100%;
  -webkit-mask-image: linear-gradient(#000, #000);
  animation: vcc-sheen 1.5s ease-out 1 .25s;
  pointer-events: none;
}
@keyframes vcc-sheen {
  from { background-position: 190% 0; opacity: .9; }
  to   { background-position: -60% 0; opacity: 0; }
}

/* Everything above is decoration on top of a working page: turn it all off. */
@media (prefers-reduced-motion: reduce) {
  .spcc-vpanel .vcc-steps li,
  .spcc-vpanel .vcc-live__cell,
  .spcc-vpanel .vcc-actions .vcc-btn { animation: none; }
  .vcc-live__v.is-changed { animation: none; }
  .vcc-live__cell[data-live="calling"] { animation: none; }
  .spcc-visitor.is-revealed .spcc-visitor__title::after { animation: none; content: none; }
  .spcc-vtab:hover .spcc-vtab__icon { transform: none; }
}

/* =============================================================================
   NARROW-CONTAINER BEHAVIOUR (sidebar open)
   -----------------------------------------------------------------------------
   A folder tab only means anything in a SINGLE row. When four of them cannot
   fit, wrapping leaves a stray tab dangling under the others and the metaphor
   collapses. So below the threshold we stop pretending: the tabs become a 2x2
   segmented control — a different, honest affordance — and the 3D tilt is
   dropped with it.
   ========================================================================== */
@supports (container-type: inline-size) {
  .spcc-visitor { container-type: inline-size; container-name: vblock; }

  @container vblock (max-width: 1100px) {
    .spcc-visitor__tabs {
      display: grid;
      grid-template-columns: repeat(2, 1fr);
      gap: .5rem;
      padding: 1rem 1.25rem 1.1rem;
      margin-bottom: 0;
      perspective: none;
    }
    .spcc-vtab {
      justify-content: flex-start;
      border-radius: 11px;                 /* a chip, not a folder tab */
      border-bottom-color: var(--vcc-edge);
      transform: none;
      white-space: normal;
      min-height: 52px;
    }
    .spcc-vtab[aria-selected="true"] {
      transform: none;
      border-color: color-mix(in srgb, var(--vt, #D8B368) 60%, transparent);
      box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--vt, #D8B368) 35%, transparent),
                  0 6px 16px rgba(0, 0, 0, .35);
    }
    /* No index strip and no seam-eraser: there is no seam to erase. */
    .spcc-vtab[aria-selected="true"]::before {
      top: auto; bottom: 0; left: 10px; right: 10px; height: 3px;
      border-radius: 3px 3px 0 0;
    }
    .spcc-vtab[aria-selected="true"]::after { content: none; }
    .spcc-visitor__panels { border-top-color: var(--vcc-edge); }
  }

  /* Actions: share the row evenly instead of stranding the last button. */
  /* Three actions in a narrow panel: stack them. An auto-fit grid produced a
     2 + 1 split with the last button stranded on its own row. */
  @container vblock (max-width: 1100px) {
    .vcc-actions { display: grid; grid-template-columns: 1fr; gap: .55rem; }
    .vcc-actions .vcc-btn { width: 100%; }
  }
  @container vblock (min-width: 760px) and (max-width: 1100px) {
    .vcc-actions { grid-template-columns: repeat(3, 1fr); }
  }
  @container vblock (max-width: 470px) {
    .spcc-visitor__tabs { grid-template-columns: 1fr; }
    .vcc-actions { grid-template-columns: 1fr; }
  }
}

/* The one-time brass sheen must never paint a dark band: it is a highlight
   only, so it is composited with `screen` and clipped to the text itself. */
.spcc-visitor.is-revealed .spcc-visitor__title::after {
  mix-blend-mode: screen;
  background: linear-gradient(105deg,
    rgba(255,255,255,0) 40%, rgba(255,255,255,.38) 50%, rgba(255,255,255,0) 60%);
  background-size: 260% 100%;
  background-repeat: no-repeat;
}
