/* Portfolio v80 · unified mobile / desktop experience baseline */
:root {
  --v80-ease: cubic-bezier(.16, 1, .3, 1);
  --v80-content: 1240px;
  --v80-wide: 1400px;
  --v80-safe-left: max(16px, env(safe-area-inset-left));
  --v80-safe-right: max(16px, env(safe-area-inset-right));
}

html {
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
}

body.portfolio-v80-home,
body.portfolio-v80-detail,
body.portfolio-v80-zizbub {
  overflow-x: clip;
}

body.portfolio-v80-home :where(button, a, [role="button"], input, textarea, select),
body.portfolio-v80-detail :where(button, a, [role="button"], input, textarea, select),
body.portfolio-v80-zizbub :where(button, a, [role="button"], input, textarea, select) {
  -webkit-tap-highlight-color: transparent;
}

body.portfolio-v80-home :where(button, a, [role="button"]):focus-visible,
body.portfolio-v80-detail :where(button, a, [role="button"]):focus-visible,
body.portfolio-v80-zizbub :where(button, a, [role="button"]):focus-visible {
  outline: 3px solid color-mix(in srgb, var(--portfolio-case-accent, var(--accent, #8d74d8)) 52%, #fff);
  outline-offset: 3px;
}

body.portfolio-v80-detail :where(section[id], [id]),
body.portfolio-v80-zizbub :where(section[id], [id]) {
  scroll-margin-top: 88px;
}

/* ---------- Portfolio home · desktop ---------- */
@media (min-width: 921px) {
  body.portfolio-v80-home header {
    height: 78px;
    padding-inline: clamp(24px, 3.5vw, 56px);
    background: linear-gradient(180deg, rgba(3, 3, 6, .94), rgba(3, 3, 6, .58) 68%, transparent);
  }

  body.portfolio-v80-home header nav {
    gap: clamp(28px, 3vw, 48px);
    margin-left: clamp(38px, 5vw, 76px);
  }

  body.portfolio-v80-home .hero {
    padding-top: 102px;
    padding-bottom: 64px;
  }

  body.portfolio-v80-home .hero > .subtitle {
    max-width: 720px;
  }

  body.portfolio-v80-home .stage-wrap {
    height: clamp(535px, 58vw, 650px);
    min-height: 535px;
    max-width: 1680px;
    margin-inline: auto;
  }

  body.portfolio-v80-home .nav-arrow.prev {
    left: clamp(20px, 4vw, 68px);
  }

  body.portfolio-v80-home .nav-arrow.next {
    right: clamp(20px, 4vw, 68px);
  }

  body.portfolio-v80-home .carousel-meta {
    min-width: 360px;
  }

  body.portfolio-v80-home .section {
    width: min(var(--v80-content), calc(100% - 64px));
    max-width: var(--v80-content);
    padding: 82px 0 104px;
  }

  body.portfolio-v80-home .about-grid {
    gap: clamp(24px, 4vw, 54px);
  }

  body.portfolio-v80-home .panel {
    min-height: 100%;
    padding: clamp(28px, 3vw, 38px);
  }

  body.portfolio-v80-home .modal {
    padding: 24px;
  }

  body.portfolio-v80-home .modal-box {
    width: min(1080px, calc(100vw - 48px));
    height: min(720px, calc(100dvh - 48px));
    max-height: min(720px, calc(100dvh - 48px));
    grid-template-columns: minmax(390px, .92fr) minmax(0, 1.08fr);
    overflow: hidden;
  }

  body.portfolio-v80-home .modal-cover {
    position: relative;
    min-height: 0;
    height: 100%;
    isolation: isolate;
    overflow: hidden;
    background-color: #0d0a12 !important;
    background-position: center;
    background-repeat: no-repeat;
    background-size: contain;
  }

  body.portfolio-v80-home .modal-cover::before {
    content: "";
    position: absolute;
    pointer-events: none;
    background-image: var(--modal-cover-image);
    background-position: center;
    background-repeat: no-repeat;
  }

  body.portfolio-v80-home .modal-cover::before {
    z-index: 0;
    inset: -24px;
    background-size: cover;
    filter: blur(22px) brightness(.42) saturate(.8);
    opacity: .95;
    transform: scale(1.08);
  }

  body.portfolio-v80-home .modal-cover::after {
    content: none !important;
  }

  body.portfolio-v80-home .modal-cover-image {
    position: absolute;
    z-index: 1;
    top: 50%;
    left: 50%;
    display: block;
    width: auto;
    height: auto;
    max-width: calc(100% - 44px);
    max-height: calc(100% - 44px);
    border-radius: 7% / 5.5%;
    clip-path: inset(1px round 7% / 5.5%);
    object-fit: contain;
    transform: translate(-50%, -50%);
    box-shadow: 0 22px 34px rgba(0, 0, 0, .34);
  }

  body.portfolio-v80-home .modal-content {
    min-height: 0;
    padding: clamp(36px, 4vw, 52px);
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
  }

  body.portfolio-v80-home .modal-actions {
    position: sticky;
    z-index: 2;
    bottom: -1px;
    padding: 18px 0 2px;
    background: linear-gradient(180deg, transparent, #0b0910 28%);
  }

  body.portfolio-v80-detail .m30-scene--desktop {
    width: min(var(--v80-content), calc(100% - 56px));
    max-width: var(--v80-content);
    margin-block: clamp(56px, 6vw, 82px);
    grid-template-columns: minmax(0, 1.12fr) minmax(360px, .88fr);
  }

  body.portfolio-v80-detail .m30-scene--desktop .m30-scene-media,
  body.portfolio-v80-detail .m30-scene--desktop .m30-scene-media img {
    min-height: clamp(440px, 42vw, 540px);
  }

  body.portfolio-v80-detail .m30-scene--desktop .m30-scene-copy {
    padding: clamp(36px, 4.2vw, 62px);
  }

  body.portfolio-v80-detail .ggn-demo-shell {
    width: min(var(--v80-content), calc(100% - 48px));
    margin-inline: auto;
  }

  body.portfolio-v80-detail .ggn-frame {
    height: min(70dvh, 660px);
  }

  body.portfolio-v80-detail .portfolio-guide-trigger,
  body.portfolio-v80-detail .m30-scene-enter,
  body.portfolio-v80-detail .ta-button {
    transition-duration: .26s;
  }

  body.portfolio-v80-detail:is([data-portfolio-case="principal"], .principal-v80-detected) :where(
    .filter,
    .status,
    .status-text,
    .topic,
    .publish-check,
    .terminal-preview,
    .dashboard-card p,
    .heat-lightbox-nav button
  ) {
    font-size: max(12px, 1em);
    line-height: 1.55;
  }

  body.portfolio-v80-detail:is([data-portfolio-case="principal"], .principal-v80-detected) :where(
    .avatar-stage-card,
    .model-main > .model-card:last-child
  ) {
    position: relative !important;
    top: auto !important;
  }
}

/* ---------- Portfolio home · phone and compact tablet ---------- */
@media (max-width: 920px) {
  body.portfolio-v80-home {
    min-width: 0;
    padding-bottom: calc(82px + env(safe-area-inset-bottom));
  }

  body.portfolio-v80-home header,
  body.portfolio-v80-home header.scrolled {
    padding-inline: var(--v80-safe-left) var(--v80-safe-right);
  }

  body.portfolio-v80-home .hero {
    min-height: auto;
    padding-inline: 0;
  }

  body.portfolio-v80-home .hero h1 {
    text-wrap: balance;
  }

  body.portfolio-v80-home .stage-wrap {
    width: 100%;
    overflow: clip;
    touch-action: pan-y pinch-zoom !important;
  }

  body.portfolio-v80-home #stage,
  body.portfolio-v80-home .stage {
    touch-action: pan-y pinch-zoom !important;
  }

  body.portfolio-v80-home .card {
    touch-action: pan-y pinch-zoom !important;
  }

  body.portfolio-v80-home .nav-arrow {
    display: none;
  }

  body.portfolio-v80-home .carousel-meta {
    min-height: 42px;
  }

  body.portfolio-v80-home .section {
    width: 100%;
  }

  body.portfolio-v80-home .modal {
    padding: max(6px, env(safe-area-inset-top)) 6px max(6px, env(safe-area-inset-bottom));
  }

  body.portfolio-v80-home .modal-box {
    height: calc(100dvh - max(12px, env(safe-area-inset-top)));
    max-height: calc(100dvh - max(12px, env(safe-area-inset-top)));
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: clamp(170px, 27dvh, 224px) minmax(0, 1fr);
    border-radius: 24px 24px 17px 17px;
  }

  body.portfolio-v80-home .modal-cover {
    position: relative;
    min-height: 0;
    isolation: isolate;
    overflow: hidden;
    background-color: #0d0a12 !important;
    background-position: center;
    background-repeat: no-repeat;
    background-size: contain;
  }

  body.portfolio-v80-home .modal-cover::before {
    content: "";
    position: absolute;
    pointer-events: none;
    background-image: var(--modal-cover-image);
    background-position: center;
    background-repeat: no-repeat;
  }

  body.portfolio-v80-home .modal-cover::before {
    z-index: 0;
    inset: -18px;
    background-size: cover;
    filter: blur(18px) brightness(.46) saturate(.82);
    opacity: .94;
    transform: scale(1.08);
  }

  body.portfolio-v80-home .modal-cover::after {
    content: none !important;
  }

  body.portfolio-v80-home .modal-cover-image {
    position: absolute;
    z-index: 1;
    top: 50%;
    left: 50%;
    display: block;
    width: auto;
    height: auto;
    max-width: calc(100% - 28px);
    max-height: calc(100% - 20px);
    border-radius: 7% / 5.5%;
    clip-path: inset(1px round 7% / 5.5%);
    object-fit: contain;
    transform: translate(-50%, -50%);
    box-shadow: 0 14px 22px rgba(0, 0, 0, .3);
  }

  body.portfolio-v80-home .modal-content {
    padding: 17px 17px calc(86px + env(safe-area-inset-bottom));
  }

  body.portfolio-v80-home .modal-content h2 {
    font-size: clamp(27px, 8vw, 32px);
  }

  body.portfolio-v80-home .modal-content .lead,
  body.portfolio-v80-home .modal-content ul {
    font-size: 13px;
    line-height: 1.62;
  }

  body.portfolio-v80-home .modal-content h4 {
    margin-top: 15px;
    margin-bottom: 6px;
  }

  body.portfolio-v80-home .modal-actions {
    padding: 17px 13px calc(10px + env(safe-area-inset-bottom));
  }

  body.portfolio-v80-home .modal-actions .cta {
    min-height: 48px;
  }

  body.portfolio-v80-home .product-page-layer.show,
  body.portfolio-v80-home .product-page-layer.show .product-page-frame {
    overscroll-behavior-y: auto !important;
    touch-action: pan-y pinch-zoom !important;
  }

  body.portfolio-v80-home .product-page-frame {
    min-width: 0;
  }

  body.portfolio-v80-home .product-page-back,
  body.portfolio-v80-home .product-page-next,
  body.portfolio-v80-home .product-page-close {
    min-width: 44px;
    min-height: 44px;
  }
}

@media (max-width: 920px) and (orientation: landscape) {
  body.portfolio-v80-home .modal-box {
    grid-template-columns: minmax(220px, .84fr) minmax(0, 1.16fr);
    grid-template-rows: minmax(0, 1fr);
  }

  body.portfolio-v80-home .modal-cover {
    border-right: 1px solid rgba(255, 255, 255, .1);
  }

  body.portfolio-v80-home .modal-actions {
    left: 0;
  }
}

/* ---------- Shared product details · mobile ---------- */
@media (max-width: 920px) {
  body.portfolio-v80-detail {
    width: 100%;
    min-width: 0;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: auto;
  }

  body.portfolio-v80-detail.portfolio-embedded {
    --m78-appbar-h: 0px !important;
    --m78-header-offset: var(--m78-nav-h, 52px) !important;
  }

  body.portfolio-v80-detail.portfolio-embedded > .appbar {
    display: none !important;
  }

  body.portfolio-v80-detail.portfolio-embedded .mcv28-nav {
    top: 0 !important;
  }

  body.portfolio-v80-detail.portfolio-embedded .m78-scroll-progress {
    top: calc(var(--m78-nav-h, 52px) - 2px) !important;
  }

  body.portfolio-v80-detail.portfolio-embedded :where(
    .mcv28-section-target,
    .m29-core-section,
    .m29-collapsible,
    section[id],
    [id]
  ) {
    scroll-margin-top: calc(var(--m78-nav-h, 52px) + 10px) !important;
  }

  body.portfolio-v80-detail main.case {
    width: 100%;
    max-width: 760px;
    margin-inline: auto;
  }

  body.portfolio-v80-detail .hero {
    padding-inline: var(--v80-safe-left) var(--v80-safe-right);
  }

  body.portfolio-v80-detail .hero h1 {
    max-width: 12em;
    font-size: clamp(36px, 11.2vw, 56px);
    line-height: 1.02;
    letter-spacing: -.045em;
    text-wrap: balance;
  }

  body.portfolio-v80-detail .hero-sub {
    font-size: 12px;
    line-height: 1.5;
  }

  body.portfolio-v80-detail .hero-desc {
    max-width: 44em;
    font-size: 14px;
    line-height: 1.72;
  }

  body.portfolio-v80-detail .hero-media {
    width: 100%;
    max-height: none !important;
    border-radius: 23px;
  }

  body.portfolio-v80-detail .hero-media img {
    width: 100%;
    max-height: none !important;
    object-fit: cover;
  }

  body.portfolio-v80-detail .section {
    padding-inline: var(--v80-safe-left) var(--v80-safe-right);
  }

  body.portfolio-v80-detail .section h2 {
    font-size: clamp(28px, 8vw, 38px);
    line-height: 1.08;
    letter-spacing: -.04em;
    text-wrap: balance;
  }

  body.portfolio-v80-detail .section :where(p, li) {
    overflow-wrap: anywhere;
  }

  body.portfolio-v80-detail :where(.card, .role, .metric, figure) {
    min-width: 0;
  }

  body.portfolio-v80-detail .m29-journey,
  body.portfolio-v80-detail .m30-scene {
    margin-inline: 10px;
  }

  body.portfolio-v80-detail .m29-journey > p,
  body.portfolio-v80-detail .m30-scene-copy > p {
    font-size: 12px;
    line-height: 1.7;
  }

  body.portfolio-v80-detail .m29-step-grid button b {
    font-size: 11px;
  }

  body.portfolio-v80-detail .m29-step-grid button small {
    font-size: 8px;
  }

  body.portfolio-v80-detail .m29-dock {
    left: max(9px, env(safe-area-inset-left));
    right: max(9px, env(safe-area-inset-right));
    width: auto;
  }

  body.portfolio-v80-detail :where(
    .mcv28-nav,
    .demo-controls,
    [role="tablist"],
    .plv-view-tabs,
    .bn24-role-flow,
    .hm28-scenes,
    .hm28-tabs
  ) {
    scroll-padding-inline: 12px;
    overscroll-behavior-inline: contain;
  }

  body.portfolio-v80-detail :where(
    .mcv28-nav button,
    .demo-controls button,
    [role="tablist"] button,
    .plv-view-tabs button,
    .bn24-role-card,
    .hm28-scenes button,
    .hm28-tabs button
  ) {
    min-height: 44px !important;
  }

  body.portfolio-v80-detail :where(.bh23-flow, .bh23-specs) {
    display: flex !important;
    max-width: 100%;
    gap: 10px;
    padding-bottom: 6px;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
  }

  body.portfolio-v80-detail :where(.bh23-flow, .bh23-specs)::-webkit-scrollbar {
    display: none;
  }

  body.portfolio-v80-detail :where(.bh23-flow, .bh23-specs) > * {
    flex: 0 0 min(82vw, 300px);
    scroll-snap-align: start;
  }

  body.portfolio-v80-detail .bn24-device {
    max-height: none;
  }

  body.portfolio-v80-detail :where(.bn20-phone-content, .bn24-phone-content) {
    overscroll-behavior-y: auto !important;
    -webkit-overflow-scrolling: touch;
  }

  body.portfolio-v80-detail :where(
    .bn24-phone-content p,
    .bn24-phone-content li,
    .bn24-phone-content button,
    .hm28-stage p,
    .hm28-stage button
  ) {
    font-size: max(10px, 1em);
    line-height: 1.45;
  }

  body.portfolio-v80-detail .ggn-demo-shell {
    margin-inline: 10px;
    padding: 7px;
    border-radius: 24px;
  }

  body.portfolio-v80-detail .ggn-frame {
    position: relative;
    height: clamp(360px, 58svh, 540px) !important;
    border-radius: 18px;
    touch-action: pan-y pinch-zoom;
  }

  body.portfolio-v80-detail .ggn-demo-shell.v80-nest-gated .ggn-frame iframe {
    pointer-events: none;
  }

  body.portfolio-v80-detail .ggn-demo-shell.v80-nest-active .ggn-frame {
    touch-action: none;
  }

  body.portfolio-v80-detail .ggn-demo-shell.v80-nest-active .ggn-frame iframe {
    pointer-events: auto;
  }

  body.portfolio-v80-detail .v80-nest-gate {
    position: absolute;
    z-index: 5;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 18px;
    background: linear-gradient(180deg, rgba(17, 9, 30, .16), rgba(17, 9, 30, .78));
    color: #fff;
    text-align: center;
    backdrop-filter: blur(3px);
  }

  body.portfolio-v80-detail .v80-nest-gate > div {
    max-width: 280px;
    padding: 17px;
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 18px;
    background: rgba(22, 12, 40, .84);
    box-shadow: 0 18px 44px rgba(0, 0, 0, .3);
  }

  body.portfolio-v80-detail .v80-nest-gate b,
  body.portfolio-v80-detail .v80-nest-gate small {
    display: block;
  }

  body.portfolio-v80-detail .v80-nest-gate b {
    font-size: 14px;
  }

  body.portfolio-v80-detail .v80-nest-gate small {
    margin-top: 7px;
    color: rgba(255, 255, 255, .68);
    font-size: 10px;
    line-height: 1.55;
  }

  body.portfolio-v80-detail .v80-nest-gate button,
  body.portfolio-v80-detail .v80-nest-exit {
    min-height: 44px;
    border: 0;
    border-radius: 13px;
    font-weight: 850;
  }

  body.portfolio-v80-detail .v80-nest-gate button {
    width: 100%;
    margin-top: 13px;
    background: #fff;
    color: #2c1b44;
  }

  body.portfolio-v80-detail .v80-nest-exit {
    position: absolute;
    z-index: 7;
    right: 10px;
    top: 10px;
    display: none;
    padding-inline: 13px;
    border: 1px solid rgba(255, 255, 255, .18);
    background: rgba(18, 10, 31, .82);
    color: #fff;
    backdrop-filter: blur(10px);
  }

  body.portfolio-v80-detail .ggn-demo-shell.v80-nest-active .v80-nest-gate {
    display: none;
  }

  body.portfolio-v80-detail .ggn-demo-shell.v80-nest-active .v80-nest-exit {
    display: block;
  }

  body.portfolio-v80-detail .m30-lightbox,
  body.portfolio-v80-detail .psv-lightbox {
    overscroll-behavior: contain;
  }

  body.portfolio-v80-detail .m30-lightbox figure,
  body.portfolio-v80-detail .psv-lightbox figure {
    max-height: calc(100dvh - 82px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    overflow: auto;
  }

  body.portfolio-v80-detail.principal-mobile-v78 .heat-ranking {
    display: grid !important;
  }

  body.portfolio-v80-detail.principal-mobile-v78 :where(
    .heat-ranking,
    .topic,
    .terminal-preview,
    .publish-check,
    .dashboard-card p,
    .workspace-card p,
    .model-card p
  ) {
    font-size: max(11px, 1em);
    line-height: 1.5;
  }

  body.portfolio-v80-detail.principal-mobile-v78 :where(
    .avatar-stage-card,
    .model-main > .model-card:last-child
  ) {
    position: relative !important;
    top: auto !important;
  }

  body.portfolio-v80-detail.principal-mobile-v78 .device,
  body.portfolio-v80-detail.principal-mobile-v78 #terminal .device {
    height: min(690px, calc(100svh - 126px)) !important;
    min-height: 500px;
  }
}

@media (max-width: 430px) {
  body.portfolio-v80-detail .m29-step-grid {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 7px;
    margin-inline: 0;
    padding-inline: 0;
    overflow: visible;
  }

  body.portfolio-v80-detail .m29-step-grid button {
    width: 100%;
    min-height: 58px !important;
    grid-template-columns: 30px minmax(0, 1fr) 16px !important;
  }

  body.portfolio-v80-detail .m29-step-grid button b,
  body.portfolio-v80-detail .m29-step-grid button small {
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
  }

  body.portfolio-v80-detail .m29-step-grid button > em {
    display: block !important;
  }
}

@media (max-width: 920px) and (orientation: landscape) {
  body.portfolio-v80-detail.principal-mobile-v78 .stage,
  body.portfolio-v80-detail.principal-mobile-v78 #terminal .stage {
    grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
    gap: 12px;
  }

  body.portfolio-v80-detail.principal-mobile-v78 .device,
  body.portfolio-v80-detail.principal-mobile-v78 #terminal .device {
    height: calc(100dvh - 92px) !important;
    min-height: 320px !important;
    max-height: 560px;
  }

  body.portfolio-v80-detail .ggn-frame {
    height: min(72dvh, 430px) !important;
  }
}

@media (max-width: 640px) and (orientation: landscape) {
  body.portfolio-v80-detail.principal-mobile-v78 .stage,
  body.portfolio-v80-detail.principal-mobile-v78 #terminal .stage {
    grid-template-columns: minmax(0, 1fr);
  }

  body.portfolio-v80-detail.principal-mobile-v78 .device,
  body.portfolio-v80-detail.principal-mobile-v78 #terminal .device {
    height: 360px !important;
    min-height: 360px !important;
    max-height: none;
  }
}

/* ---------- Zizbub local pages ---------- */
body.portfolio-v80-zizbub .v84-portfolio-back {
  position: fixed !important;
  z-index: 2147482000 !important;
  top: max(74px, calc(env(safe-area-inset-top) + 66px)) !important;
  left: max(16px, env(safe-area-inset-left)) !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 7px !important;
  min-width: 116px !important;
  min-height: 42px !important;
  padding: 0 15px !important;
  border: 1px solid rgba(255, 255, 255, .2) !important;
  border-radius: 999px !important;
  color: #fff !important;
  background: rgba(15, 14, 24, .78) !important;
  box-shadow: 0 12px 30px rgba(13, 10, 24, .24) !important;
  -webkit-backdrop-filter: blur(18px) saturate(1.15) !important;
  backdrop-filter: blur(18px) saturate(1.15) !important;
  font: 700 13px/1 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "PingFang SC", sans-serif !important;
  letter-spacing: .01em !important;
  text-decoration: none !important;
  white-space: nowrap !important;
  transition: transform .22s var(--v80-ease), background-color .22s ease, border-color .22s ease !important;
}

body.portfolio-v80-zizbub .v84-portfolio-back > span {
  font-size: 17px !important;
  line-height: 1 !important;
}

body.portfolio-v80-zizbub .v84-portfolio-back:hover {
  border-color: rgba(255, 255, 255, .42) !important;
  background: rgba(25, 22, 40, .9) !important;
  transform: translateY(-2px) !important;
}

body.portfolio-v84-zizbub-story .logic-nav nav > .v84-portfolio-back {
  position: static !important;
  min-width: 92px !important;
  min-height: 44px !important;
  color: #fff9e7 !important;
  background: #315f56 !important;
  border-color: rgba(49, 95, 86, .12) !important;
  box-shadow: 0 8px 18px rgba(49, 95, 86, .14) !important;
  transform: none !important;
}

body.portfolio-v84-zizbub-planet .planet-brand > .v84-portfolio-back {
  position: static !important;
  width: 44px !important;
  min-width: 44px !important;
  height: 44px !important;
  min-height: 44px !important;
  padding: 0 !important;
  flex: 0 0 44px;
  color: #f5ecd8 !important;
  background: rgba(10, 16, 43, .72) !important;
  border-color: rgba(245, 236, 216, .22) !important;
  box-shadow: none !important;
  transform: none !important;
}

body.portfolio-v84-zizbub-planet .planet-brand > .v84-portfolio-back > b {
  display: none !important;
}

body.portfolio-v80-zizbub .logic-nav {
  width: min(var(--v80-wide), calc(100% - 32px));
  margin-inline: auto;
}

body.portfolio-v80-zizbub .logic-hero,
body.portfolio-v80-zizbub :where(
  .planet-wonders,
  .building-system,
  .dress-system,
  .through-eyes,
  .world-resonance,
  .logic-definition,
  .logic-how,
  .logic-summary
) {
  width: min(var(--v80-content), calc(100% - 36px));
  margin-inline: auto;
}

body.portfolio-v80-zizbub canvas {
  max-width: 100%;
}

@media (max-width: 920px) {
  body.portfolio-v80-zizbub .v84-portfolio-back {
    top: max(70px, calc(env(safe-area-inset-top) + 64px)) !important;
    left: max(12px, env(safe-area-inset-left)) !important;
    min-width: 106px !important;
    min-height: 44px !important;
    padding-inline: 13px !important;
    font-size: 12px !important;
    box-shadow: 0 8px 22px rgba(13, 10, 24, .22) !important;
  }

  body.portfolio-v84-zizbub-planet .v84-portfolio-back {
    width: 44px !important;
    min-width: 44px !important;
    height: 44px !important;
    min-height: 44px !important;
    padding: 0 !important;
    gap: 0 !important;
  }

  body.portfolio-v84-zizbub-planet .v84-portfolio-back > b {
    display: none !important;
  }

  body.portfolio-v80-zizbub .logic-nav {
    position: sticky;
    z-index: 80;
    top: 0;
    width: 100%;
    min-height: calc(58px + env(safe-area-inset-top));
    padding: env(safe-area-inset-top) var(--v80-safe-right) 0 var(--v80-safe-left);
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scrollbar-width: none;
  }

  body.portfolio-v80-zizbub .logic-nav::-webkit-scrollbar {
    display: none;
  }

  body.portfolio-v80-zizbub .logic-nav a {
    min-height: 44px;
    flex: 0 0 auto;
  }

  body.portfolio-v80-zizbub .logic-hero,
  body.portfolio-v80-zizbub :where(
    .planet-wonders,
    .building-system,
    .dress-system,
    .through-eyes,
    .world-resonance,
    .logic-definition,
    .logic-how,
    .logic-summary
  ) {
    width: min(100% - 24px, 720px);
  }

  body.portfolio-v80-zizbub .logic-hero {
    grid-template-columns: 1fr;
    gap: 24px;
    padding-top: 32px;
  }

  body.portfolio-v80-zizbub .logic-hero-copy h1 {
    font-size: clamp(38px, 12vw, 62px);
    line-height: .98;
    text-wrap: balance;
  }

  body.portfolio-v80-zizbub .logic-hero-image img {
    width: 100%;
    max-height: 70svh;
    object-fit: cover;
    border-radius: 24px;
  }

  body.portfolio-v80-zizbub .logic-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  body.portfolio-v80-zizbub .logic-actions a {
    min-height: 48px;
  }

  body.portfolio-v80-zizbub .planet-app {
    min-height: 100dvh;
    overflow: hidden;
  }

  body.portfolio-v80-zizbub .hud-top {
    top: max(8px, env(safe-area-inset-top));
    left: var(--v80-safe-left);
    right: var(--v80-safe-right);
    max-width: calc(100% - var(--v80-safe-left) - var(--v80-safe-right));
  }

  body.portfolio-v80-zizbub .dock {
    left: var(--v80-safe-left);
    right: var(--v80-safe-right);
    bottom: max(8px, env(safe-area-inset-bottom));
    max-width: none;
    overflow-x: auto;
    scrollbar-width: none;
  }

  body.portfolio-v80-zizbub .dock::-webkit-scrollbar {
    display: none;
  }

  body.portfolio-v80-zizbub .dock button,
  body.portfolio-v80-zizbub .scene-actions button {
    min-width: 44px;
    min-height: 44px;
  }
}

/* ---------- v84 · Zizbub mobile story rebuild ---------- */
@media (max-width: 720px) {
  body.portfolio-v84-zizbub-story,
  body.portfolio-v84-zizbub-story .logic-page {
    width: 100%;
    max-width: 100%;
    overflow-x: clip;
  }

  body.portfolio-v84-zizbub-story .logic-page {
    overflow-y: visible;
  }

  body.portfolio-v84-zizbub-story .logic-nav nav > a:last-child:not(.v84-portfolio-back) {
    display: none;
  }

  body.portfolio-v84-zizbub-story .logic-summary {
    box-sizing: border-box;
    width: calc(100% - 20px);
    min-height: 0;
    margin: 10px auto;
    padding: 72px 20px 76px;
    border-radius: 30px;
    grid-template-rows: auto;
    align-content: center;
    gap: 24px;
  }

  body.portfolio-v84-zizbub-story .logic-summary small {
    align-self: auto;
    font-size: 9px;
    line-height: 1.4;
  }

  body.portfolio-v84-zizbub-story .logic-summary h2 {
    width: 100%;
    max-width: 11.5em;
    margin: 0 auto;
    font-size: clamp(30px, 8.4vw, 36px);
    line-height: 1.16;
    letter-spacing: -.045em;
    text-wrap: balance;
    overflow-wrap: normal;
  }

  body.portfolio-v84-zizbub-story .logic-summary h2 br,
  body.portfolio-v84-zizbub-story .logic-how h2 br {
    display: none;
  }

  body.portfolio-v84-zizbub-story .logic-summary a {
    box-sizing: border-box;
    width: min(100%, 320px);
    min-height: 50px;
    margin: 4px auto 0;
    padding: 14px 18px;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
  }

  body.portfolio-v84-zizbub-story .logic-how {
    box-sizing: border-box;
    width: calc(100% - 20px);
    margin: 10px auto 0;
    padding: 74px 16px 64px;
    border-radius: 30px 30px 0 0;
  }

  body.portfolio-v84-zizbub-story .logic-how > header {
    max-width: none;
  }

  body.portfolio-v84-zizbub-story .logic-how h2 {
    margin: 14px 0 18px;
    font-size: clamp(32px, 8.8vw, 40px);
    line-height: 1.08;
    letter-spacing: -.055em;
    text-wrap: balance;
  }

  body.portfolio-v84-zizbub-story .logic-how > header p {
    max-width: none;
    font-size: 14px;
    line-height: 1.75;
  }

  body.portfolio-v84-zizbub-story .logic-how > div {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
    width: 100%;
    margin-top: 32px;
    overflow: visible;
  }

  body.portfolio-v84-zizbub-story .logic-how article {
    box-sizing: border-box;
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 10px;
    width: 100%;
    min-width: 0;
    min-height: 0;
    padding: 20px 18px 19px;
    border-radius: 22px;
  }

  body.portfolio-v84-zizbub-story .logic-how article > span {
    font-size: 18px;
  }

  body.portfolio-v84-zizbub-story .logic-how article > div,
  body.portfolio-v84-zizbub-story .logic-how article h3,
  body.portfolio-v84-zizbub-story .logic-how article p,
  body.portfolio-v84-zizbub-story .logic-how article b {
    min-width: 0;
    writing-mode: horizontal-tb;
    word-break: normal;
    white-space: normal;
  }

  body.portfolio-v84-zizbub-story .logic-how article small {
    font-size: 9px;
    line-height: 1.45;
  }

  body.portfolio-v84-zizbub-story .logic-how article h3 {
    margin: 18px 0 12px;
    font-size: 23px;
    line-height: 1.32;
    letter-spacing: -.035em;
  }

  body.portfolio-v84-zizbub-story .logic-how article p {
    font-size: 14px;
    line-height: 1.7;
  }

  body.portfolio-v84-zizbub-story .logic-how article b {
    margin-top: 22px;
    padding-top: 13px;
    font-size: 11px;
    line-height: 1.55;
  }

  body.portfolio-v84-zizbub-story .logic-how > aside {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    margin-top: 18px;
    padding: 16px;
    border-radius: 20px;
    font-size: 10px;
  }

  body.portfolio-v84-zizbub-story .logic-how > aside i {
    display: none;
  }

  body.portfolio-v84-zizbub-story .logic-planet {
    box-sizing: border-box;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 30px;
    width: calc(100% - 20px);
    min-height: 0;
    margin: 10px auto;
    padding: 14px 12px 62px;
    border-radius: 30px;
    overflow: hidden;
  }

  body.portfolio-v84-zizbub-story .logic-planet > figure {
    width: 100%;
    height: auto;
    min-height: 0;
    aspect-ratio: 3 / 2;
    border-width: 6px;
    border-radius: 24px 24px 64px;
  }

  body.portfolio-v84-zizbub-story .logic-planet > figure img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 50% 52%;
  }

  body.portfolio-v84-zizbub-story .logic-planet figcaption {
    left: 18px;
    right: 18px;
    bottom: 18px;
    font-size: 10px;
  }

  body.portfolio-v84-zizbub-story .logic-planet > div {
    padding: 0 6px;
  }

  body.portfolio-v84-zizbub-story .logic-planet h2 {
    margin: 12px 0 18px;
    font-size: clamp(34px, 9.5vw, 41px);
    line-height: 1.05;
  }

  body.portfolio-v84-zizbub-story .logic-planet .logic-lead {
    font-size: 13px;
    line-height: 1.72;
  }

  body.portfolio-v84-zizbub-story .logic-reason-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    margin-top: 26px;
  }

  body.portfolio-v84-zizbub-story .logic-reason-grid article {
    grid-template-columns: 30px minmax(0, 1fr);
    min-height: 0;
    padding: 17px;
    border-radius: 18px;
  }

  body.portfolio-v84-zizbub-story .logic-reason-grid strong {
    font-size: 13px;
  }

  body.portfolio-v84-zizbub-story .logic-reason-grid p {
    font-size: 11px;
    line-height: 1.65;
  }

  body.portfolio-v84-zizbub-story .logic-footer {
    grid-template-columns: 1fr auto;
    gap: 12px;
    min-height: 72px;
    padding: 22px 18px max(22px, env(safe-area-inset-bottom));
  }

  body.portfolio-v84-zizbub-story .logic-footer a {
    font-size: 11px;
  }

  body.portfolio-v84-zizbub-story .logic-footer small {
    max-width: 138px;
    text-align: right;
    line-height: 1.45;
  }
}

/* ---------- v84 · Zizbub planet mobile cockpit ---------- */
@media (max-width: 720px), (orientation: landscape) and (max-height: 520px) and (max-width: 1024px) {
  body.portfolio-v84-zizbub-planet {
    width: 100%;
    height: 100dvh;
    min-height: 100dvh;
    overflow: hidden;
    background: #080d24;
  }

  body.portfolio-v84-zizbub-planet .planet-app {
    width: 100%;
    height: 100dvh;
    min-height: 100dvh;
    overflow: hidden;
  }

  body.portfolio-v84-zizbub-planet .hud-top {
    box-sizing: border-box;
    grid-template-columns: auto 1fr;
    gap: 10px;
    width: 100%;
    max-width: none;
    height: 64px;
    min-height: 64px;
    top: 0;
    left: 0;
    right: 0;
    padding: max(7px, env(safe-area-inset-top)) 12px 7px;
    border-radius: 0;
  }

  body.portfolio-v84-zizbub-planet .planet-brand {
    gap: 8px;
  }

  body.portfolio-v84-zizbub-planet .brand-mark {
    display: none;
  }

  body.portfolio-v84-zizbub-planet .brand-mark::before {
    top: 13px;
  }

  body.portfolio-v84-zizbub-planet .brand-mark i {
    top: 9px;
  }

  body.portfolio-v84-zizbub-planet .planet-brand strong {
    font-size: 12px;
  }

  body.portfolio-v84-zizbub-planet .planet-brand small,
  body.portfolio-v84-zizbub-planet .day-chip,
  body.portfolio-v84-zizbub-planet .product-about-link {
    display: none;
  }

  body.portfolio-v84-zizbub-planet .hud-right {
    min-width: 0;
    justify-self: end;
  }

  body.portfolio-v84-zizbub-planet .resource-bar {
    display: grid;
    grid-template-columns: repeat(3, minmax(42px, 1fr));
    max-width: 168px;
    border-radius: 12px;
  }

  body.portfolio-v84-zizbub-planet .resource-bar > span {
    grid-template-columns: 16px auto;
    grid-template-rows: 1fr;
    min-width: 0;
    min-height: 36px;
    padding: 7px 8px;
    align-items: center;
  }

  body.portfolio-v84-zizbub-planet .resource-bar > span:nth-child(4),
  body.portfolio-v84-zizbub-planet .resource-bar small {
    display: none;
  }

  body.portfolio-v84-zizbub-planet .resource-bar i {
    grid-row: auto;
  }

  body.portfolio-v84-zizbub-planet .resource-bar strong {
    font-size: 11px;
  }

  body.portfolio-v84-zizbub-planet .v84-portfolio-back {
    position: static !important;
    width: 44px !important;
    min-width: 44px !important;
    height: 44px !important;
    min-height: 44px !important;
    padding: 0 !important;
    flex: 0 0 44px;
    color: #14192f !important;
    background: rgba(255, 249, 226, .92) !important;
    border-color: rgba(255, 255, 255, .68) !important;
  }

  body.portfolio-v84-zizbub-planet .v84-portfolio-back > b {
    display: none !important;
  }

  body.portfolio-v84-zizbub-planet .world-shell {
    box-sizing: border-box;
    display: block;
    width: 100%;
    height: 100dvh;
    min-height: 100dvh;
    padding: 70px 8px 70px;
  }

  body.portfolio-v84-zizbub-planet .world-frame {
    width: 100%;
    height: calc(100dvh - 140px);
    min-height: 0;
    max-height: none;
    aspect-ratio: auto;
    border-radius: 22px;
  }

  body.portfolio-v84-zizbub-planet .world-caption {
    box-sizing: border-box;
    width: calc(100% - 36px);
    top: 18px;
    left: 18px;
  }

  body.portfolio-v84-zizbub-planet .world-caption > span {
    margin-bottom: 7px;
    font-size: 7px;
  }

  body.portfolio-v84-zizbub-planet .world-caption h1 {
    font-size: clamp(28px, 8.4vw, 34px);
    line-height: .96;
  }

  body.portfolio-v84-zizbub-planet .world-caption p {
    display: -webkit-box;
    max-width: 250px;
    margin-top: 8px;
    font-size: 9px;
    line-height: 1.5;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
  }

  body.portfolio-v84-zizbub-planet .presence-line {
    display: none;
  }

  body.portfolio-v84-zizbub-planet .growth-card {
    box-sizing: border-box;
    width: calc(100% - 20px);
    top: auto;
    right: auto;
    bottom: 64px;
    left: 10px;
    padding: 10px 12px;
    border-radius: 14px;
  }

  body.portfolio-v84-zizbub-planet .growth-track {
    margin: 9px 0 7px;
  }

  body.portfolio-v84-zizbub-planet .energy-mini {
    display: none;
  }

  body.portfolio-v84-zizbub-planet .scene-actions {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 7px;
    top: auto;
    right: 10px;
    bottom: 10px;
    left: 10px;
  }

  body.portfolio-v84-zizbub-planet .scene-actions button {
    box-sizing: border-box;
    display: grid;
    grid-template-columns: 1fr;
    width: auto;
    min-width: 0;
    height: 44px;
    min-height: 44px;
    padding: 7px;
    place-items: center;
  }

  body.portfolio-v84-zizbub-planet .scene-actions button span {
    display: none;
  }

  body.portfolio-v84-zizbub-planet .scene-actions i {
    width: 26px;
    height: 26px;
  }

  body.portfolio-v84-zizbub-planet .scene-controls {
    display: none;
  }

  body.portfolio-v84-zizbub-planet .exploration-status {
    display: grid;
    width: calc(100% - 20px);
    max-width: none;
    right: 10px;
    bottom: 145px;
    left: 10px;
    transform: none;
  }

  body.portfolio-v84-zizbub-planet .speech {
    --speech-x: 10px;
    width: min(190px, 56%);
    padding: 10px 12px;
  }

  body.portfolio-v84-zizbub-planet .speech p {
    font-size: 9px;
  }

  body.portfolio-v84-zizbub-planet .dock {
    box-sizing: border-box;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 2px;
    width: auto;
    max-width: none;
    height: 58px;
    left: max(8px, env(safe-area-inset-left));
    right: max(8px, env(safe-area-inset-right));
    bottom: max(6px, env(safe-area-inset-bottom));
    padding: 4px;
    border-radius: 18px;
    transform: none;
    overflow: hidden;
  }

  body.portfolio-v84-zizbub-planet .dock button {
    box-sizing: border-box;
    grid-template-columns: 1fr;
    grid-template-rows: 18px 12px;
    place-items: center;
    min-width: 0;
    min-height: 48px;
    padding: 6px 2px;
  }

  body.portfolio-v84-zizbub-planet .dock i {
    grid-row: auto;
    font-size: 12px;
  }

  body.portfolio-v84-zizbub-planet .dock span {
    max-width: 100%;
    font-size: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  body.portfolio-v84-zizbub-planet .dock b {
    display: none;
  }

  body.portfolio-v84-zizbub-planet .drawer {
    width: auto;
    max-height: calc(100dvh - 94px);
    left: 8px;
    right: 8px;
    bottom: 70px;
    border-radius: 20px;
  }
}

@media (orientation: landscape) and (max-height: 520px) and (max-width: 1024px) {
  body.portfolio-v84-zizbub-planet .hud-top {
    height: 54px;
    min-height: 54px;
  }

  body.portfolio-v84-zizbub-planet .v84-portfolio-back {
    width: 40px !important;
    min-width: 40px !important;
    height: 40px !important;
    min-height: 40px !important;
    flex-basis: 40px;
  }

  body.portfolio-v84-zizbub-planet .world-shell {
    padding: 60px 8px 58px;
  }

  body.portfolio-v84-zizbub-planet .world-frame {
    height: calc(100dvh - 118px);
  }

  body.portfolio-v84-zizbub-planet .world-caption {
    width: 38%;
    left: 60px;
  }

  body.portfolio-v84-zizbub-planet .world-caption h1 {
    font-size: 28px;
  }

  body.portfolio-v84-zizbub-planet .world-caption p,
  body.portfolio-v84-zizbub-planet .energy-mini {
    display: none;
  }

  body.portfolio-v84-zizbub-planet .growth-card {
    width: min(260px, 42%);
    bottom: 10px;
    left: 10px;
  }

  body.portfolio-v84-zizbub-planet .scene-actions {
    grid-template-columns: repeat(5, 44px);
    right: 10px;
    bottom: 10px;
    left: auto;
  }

  body.portfolio-v84-zizbub-planet .exploration-status {
    width: min(280px, 45%);
    right: auto;
    bottom: 66px;
    left: 50%;
    transform: translateX(-50%);
  }

  body.portfolio-v84-zizbub-planet .dock {
    height: 54px;
    bottom: 4px;
  }

  body.portfolio-v84-zizbub-planet .dock button {
    min-height: 44px;
    grid-template-rows: 16px 11px;
  }
}

@media (max-width: 720px) and (max-height: 680px) {
  body.portfolio-v84-zizbub-planet .world-caption p,
  body.portfolio-v84-zizbub-planet .energy-mini {
    display: none;
  }

  body.portfolio-v84-zizbub-planet .growth-card {
    width: 176px;
    padding: 10px;
  }
}

/* Keep device shells still; animate the expression layer, not the hardware. */
body.portfolio-v80-detail[data-portfolio-case="gugu"] :where(
  .gg-device,
  .gugu-v26-device,
  .gugu-v75-device,
  .gugu-v75-shell,
  .gugu-emotion-device
) {
  animation: none !important;
  transform: none;
}

/* Tarena mobile scroll chain
   Keep the document as the only vertical scroller. Navigation centering is
   handled on each horizontal rail, so no child needs to move the viewport. */
@media (max-width: 920px) {
  html.tarena-scroll-safe {
    scroll-behavior: auto !important;
    overscroll-behavior-y: auto;
  }

  body.portfolio-v80-detail[data-portfolio-case="tarena"] {
    height: auto !important;
    min-height: 100%;
    overflow-y: visible !important;
    overscroll-behavior-y: auto !important;
    scroll-behavior: auto !important;
    touch-action: auto;
  }

  body.portfolio-v80-detail[data-portfolio-case="tarena"] :where(
    main.case,
    .ta-sim-body,
    .ta-sim-stage,
    .ta-sim-console,
    .ta-device
  ) {
    height: auto;
    max-height: none;
    overflow-y: visible;
    overscroll-behavior-y: auto !important;
    touch-action: auto;
  }

  body.portfolio-v80-detail[data-portfolio-case="tarena"] :where(
    .ta-shell,
    .ta-sim-card
  ) {
    overflow: clip !important;
    overscroll-behavior: auto !important;
    contain: none !important;
  }

  body.portfolio-v80-detail[data-portfolio-case="tarena"] :where(
    .ta-sim-progress,
    .ta-screen-actions
  ) {
    position: relative !important;
    top: auto !important;
    bottom: auto !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
  }

  body.portfolio-v80-detail[data-portfolio-case="tarena"] :where(
    .mcv28-nav,
    .ta-loop-steps,
    .ta-layer-grid,
    .ta-character-list,
    .m29-step-grid,
    .journey,
    .character-tabs,
    .demo-picker,
    .answer-tabs,
    [role="tablist"]
  ) {
    overflow-y: hidden !important;
    overscroll-behavior-inline: auto !important;
    overscroll-behavior-y: auto !important;
    scroll-snap-type: x proximity !important;
    touch-action: pan-x pan-y pinch-zoom !important;
    -webkit-overflow-scrolling: touch;
  }

  body.portfolio-v80-detail[data-portfolio-case="tarena"] :where(
    .ta-loop-step,
    .ta-character,
    .ta-choice,
    .ta-button,
    .m29-dock,
    .m29-dock button
  ) {
    overscroll-behavior-y: auto !important;
    touch-action: manipulation !important;
  }

  body.portfolio-v80-detail[data-portfolio-case="tarena"] #portfolio-case-guide {
    display: none !important;
  }

  body.portfolio-v80-detail[data-portfolio-case="tarena"] :where(
    .game-layout,
    .question-lab,
    .branch-lab,
    .answer-box,
    .branch-result
  ) {
    box-sizing: border-box;
    width: 100%;
    min-width: 0 !important;
    max-width: 100%;
  }

  body.portfolio-v80-detail[data-portfolio-case="tarena"] .game-layout {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  body.portfolio-v80-detail[data-portfolio-case="tarena"] .branch-options {
    grid-template-columns: minmax(0, 1fr) !important;
  }
}

/* Once the mobile iframe has loaded, discard the temporary entrance
   compositor layers. This avoids the fixed + transformed iframe combination
   that can freeze momentum scrolling in iOS Safari. */
@media (max-width: 920px) {
  body.portfolio-v80-home .product-page-layer.show.loaded {
    contain: none !important;
    transform: none !important;
    will-change: auto !important;
  }

  body.portfolio-v80-home .product-page-layer.show.loaded .product-page-frame {
    flex: 1 1 auto;
    height: auto !important;
    min-height: 0;
    transform: none !important;
    will-change: auto !important;
  }
}

/* Pocket Scope mobile scroll chain
   The document is the only vertical scroller. Interactive visuals are clipped
   without becoming scroll containers, and horizontal rails hand diagonal
   gestures back to the page. */
@media (max-width: 920px) {
  html.pocket-scroll-safe {
    scroll-behavior: auto !important;
    overscroll-behavior-y: auto !important;
  }

  body.portfolio-v80-detail[data-portfolio-case="pocket"] {
    height: auto !important;
    min-height: 100%;
    overflow-x: clip !important;
    overflow-y: visible !important;
    overscroll-behavior-y: auto !important;
    scroll-behavior: auto !important;
    touch-action: auto;
  }

  body.portfolio-v80-detail[data-portfolio-case="pocket"]:is(.psv-lock, .m30-lock) {
    overflow: hidden !important;
    overscroll-behavior: none !important;
  }

  body.portfolio-v80-detail[data-portfolio-case="pocket"] :where(
    main.case,
    .psv-section,
    .fgv-shell,
    .fgv-control,
    .fgv-stage,
    .plv-center,
    .plv-view
  ) {
    height: auto;
    max-height: none;
    overscroll-behavior-y: auto !important;
    touch-action: auto;
  }

  body.portfolio-v80-detail[data-portfolio-case="pocket"] :where(
    .psv-section,
    .psv-media-card,
    .psv-media-button,
    .fgv-shell,
    .fgv-visual,
    #plvChildView,
    #plvParentView,
    #plvLogicView
  ) {
    overflow: clip !important;
    overscroll-behavior: auto !important;
    contain: none !important;
  }

  body.portfolio-v80-detail[data-portfolio-case="pocket"] .fgv-task-card {
    position: relative !important;
    top: auto !important;
    bottom: auto !important;
    z-index: auto !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
  }

  body.portfolio-v80-detail[data-portfolio-case="pocket"] :where(
    .mcv28-nav,
    .m29-step-grid,
    .demo-controls,
    .psv-layer-rail,
    .psv-source-tabs,
    .fgv-env-tabs,
    .fgv-level-tabs,
    .plv-profile-ages,
    .plv-view-tabs,
    .capability-tabs,
    .zl-depth-rail,
    .zl-objects,
    .scenario-tabs,
    .anywhere-flow,
    .album-grid,
    .story-flow,
    .game-env-tabs,
    .game-level-tabs,
    [role="tablist"]
  ) {
    overflow-x: auto !important;
    overflow-y: hidden !important;
    overscroll-behavior-inline: auto !important;
    overscroll-behavior-y: auto !important;
    scroll-snap-type: x proximity !important;
    touch-action: pan-x pan-y pinch-zoom !important;
    -webkit-overflow-scrolling: touch;
  }

  body.portfolio-v80-detail[data-portfolio-case="pocket"] :where(
    .fgv-stage,
    .fgv-visual,
    .fgv-hotspots,
    .fgv-hotspot,
    .fgv-stage-bar,
    .fgv-scan,
    .fgv-scene-note,
    .psv-media-button,
    .plv-scene-grid button,
    .zl-detail-visual,
    .mag-stage,
    .game-stage,
    .m29-dock,
    .m29-dock button
  ) {
    overscroll-behavior-y: auto !important;
    touch-action: pan-y pinch-zoom !important;
  }

  body.portfolio-v80-detail[data-portfolio-case="pocket"] #portfolio-case-guide {
    display: none !important;
  }
}

@media (max-width: 560px) {
  /* Reserve the completed-state height from the start so the success panel
     does not grow the layout underneath an active finger. */
  body.portfolio-v80-detail[data-portfolio-case="pocket"] .fgv-visual,
  body.portfolio-v80-detail[data-portfolio-case="pocket"] .fgv-visual.success-mode {
    height: 390px !important;
    aspect-ratio: auto !important;
  }
}

/* v87 · one stable mobile header
   The old detail pages stacked two independent sticky layers: a blurred app
   bar and a horizontally scrolling, blurred section rail. The rail also
   changed height while the document was moving. On iOS that combination can
   promote two competing compositor scroll layers and leave the page unable
   to continue vertically. Keep only the app bar sticky; the section rail is
   now part of normal document flow and therefore hands every diagonal gesture
   back to the document. */
@media (max-width: 920px) {
  html.portfolio-v87-detail-safe,
  html.portfolio-v87-mobile-case,
  html.portfolio-v87-zizbub-story-safe {
    scroll-behavior: auto !important;
    overscroll-behavior-y: auto !important;
  }

  html.portfolio-v87-mobile-case {
    scroll-padding-top: calc(58px + env(safe-area-inset-top)) !important;
  }

  body.portfolio-v80-detail.portfolio-mobile-v28 {
    height: auto !important;
    min-height: 100%;
    overflow-x: clip !important;
    overflow-y: visible !important;
    overscroll-behavior-y: auto !important;
    scroll-behavior: auto !important;
    touch-action: auto;
  }

  body.portfolio-v80-detail.portfolio-mobile-v28.mobile-polish-v78,
  body.portfolio-v80-detail.portfolio-mobile-v28.mobile-polish-v78.m78-header-compact {
    --m78-appbar-h: 54px !important;
    --m78-nav-h: 0px !important;
    --m78-header-offset: calc(54px + env(safe-area-inset-top)) !important;
  }

  body.portfolio-v80-detail.portfolio-mobile-v28 > .appbar {
    position: sticky !important;
    z-index: 60 !important;
    top: 0 !important;
    height: calc(54px + env(safe-area-inset-top)) !important;
    min-height: calc(54px + env(safe-area-inset-top)) !important;
    padding-top: env(safe-area-inset-top) !important;
    background: rgba(255, 252, 249, .985) !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
    contain: none !important;
    transform: none !important;
    transition: none !important;
    will-change: auto !important;
  }

  body.portfolio-v80-detail.portfolio-mobile-v28 .mcv28-nav {
    position: relative !important;
    z-index: 20 !important;
    inset: auto !important;
    top: auto !important;
    bottom: auto !important;
    min-height: 54px !important;
    padding: 5px 12px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    background: rgba(250, 248, 255, .985) !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
    box-shadow: 0 8px 18px rgba(35, 27, 52, .045) !important;
    contain: none !important;
    overscroll-behavior-inline: auto !important;
    overscroll-behavior-y: auto !important;
    scroll-snap-type: x proximity !important;
    touch-action: pan-x pan-y pinch-zoom !important;
    transform: none !important;
    transition: none !important;
    will-change: auto !important;
    -webkit-overflow-scrolling: touch;
  }

  body.portfolio-v80-detail.portfolio-mobile-v28 .mcv28-nav button {
    min-height: 44px !important;
    touch-action: pan-x pan-y pinch-zoom !important;
    transition: background-color .18s ease, color .18s ease,
      border-color .18s ease, box-shadow .18s ease !important;
  }

  body.portfolio-v80-detail.portfolio-mobile-v28 :where(
    .mcv28-section-target,
    .m29-core-section,
    .m29-collapsible,
    section[id]
  ) {
    scroll-margin-top: calc(62px + env(safe-area-inset-top)) !important;
  }

  body.portfolio-v80-detail.portfolio-mobile-v28 .m78-scroll-progress {
    top: calc(54px + env(safe-area-inset-top) - 2px) !important;
    transition: none !important;
  }

  body.portfolio-v80-detail.portfolio-mobile-v28.portfolio-embedded .m78-scroll-progress {
    top: 0 !important;
  }

  body.portfolio-v80-detail.portfolio-mobile-v28 .m78-nav-edge {
    display: none !important;
  }

  body.portfolio-v80-detail.portfolio-mobile-v28 :where(
    .chips,
    .m29-step-grid,
    .m30-scene-tags,
    .demo-controls,
    [role="tablist"],
    .plv-view-tabs,
    .bn24-role-flow,
    .bn20-scenarios,
    .bn20-progress,
    .gm28-history,
    .gm28-moods,
    .ggn-tabs,
    .hm28-scenes,
    .hm28-tabs
  ) {
    overflow-y: hidden !important;
    overscroll-behavior-inline: auto !important;
    overscroll-behavior-y: auto !important;
    touch-action: pan-x pan-y pinch-zoom !important;
  }

  body.portfolio-v84-zizbub-story .logic-nav {
    overflow-x: auto !important;
    overflow-y: hidden !important;
    overscroll-behavior-inline: auto !important;
    overscroll-behavior-y: auto !important;
    touch-action: pan-x pan-y pinch-zoom !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
    background: rgba(255, 250, 238, .985) !important;
    transition: none !important;
    -webkit-overflow-scrolling: touch;
  }

  /* Principal terminal uses a different header implementation, but had the
     same geometry-changing compact state. Keep its header dimensions fixed
     and let the mode switcher pass diagonal gestures to the document. */
  body.portfolio-v80-detail.principal-mobile-v78 {
    --principal-v78-top: calc(58px + env(safe-area-inset-top)) !important;
  }

  body.portfolio-v80-detail.principal-mobile-v78 .top {
    grid-template-rows: 1fr !important;
    min-height: calc(58px + env(safe-area-inset-top)) !important;
    background: rgba(255, 255, 255, .985) !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
    contain: none !important;
    transform: none !important;
    transition: none !important;
    will-change: auto !important;
  }

  body.portfolio-v80-detail.principal-mobile-v78 .top > .switch {
    display: none !important;
  }

  body.portfolio-v80-detail.principal-mobile-v78 .principal-v78-modebar {
    opacity: 1 !important;
    pointer-events: auto !important;
    transform: none !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
    background: rgba(20, 50, 54, .985) !important;
    transition: none !important;
  }

  body.portfolio-v80-detail.principal-mobile-v78 .principal-v78-modebar,
  body.portfolio-v80-detail.principal-mobile-v78 .switch {
    overflow-x: auto !important;
    overflow-y: hidden !important;
    overscroll-behavior-inline: auto !important;
    overscroll-behavior-y: auto !important;
    touch-action: pan-x pan-y pinch-zoom !important;
    -webkit-overflow-scrolling: touch;
  }

  body.portfolio-v80-detail.principal-mobile-v78 .principal-mobile-back {
    display: none !important;
  }

  body.portfolio-v80-detail.principal-mobile-v78 .principal-v78-progress {
    top: calc(58px + env(safe-area-inset-top) - 2px) !important;
    transition: none !important;
  }
}

@media (max-width: 920px) and (orientation: landscape) {
  body.portfolio-v80-detail.principal-mobile-v78 {
    --principal-v78-top: calc(58px + env(safe-area-inset-top)) !important;
  }

  body.portfolio-v80-detail.principal-mobile-v78 .principal-v78-progress {
    top: calc(58px + env(safe-area-inset-top) - 2px) !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto !important;
  }

  body.portfolio-v80-home *,
  body.portfolio-v80-home *::before,
  body.portfolio-v80-home *::after,
  body.portfolio-v80-detail *,
  body.portfolio-v80-detail *::before,
  body.portfolio-v80-detail *::after,
  body.portfolio-v80-zizbub *,
  body.portfolio-v80-zizbub *::before,
  body.portfolio-v80-zizbub *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .001ms !important;
  }
}
