/* Kerangka aplikasi: viewport perangkat, tumpukan layar, navbar, tab bar, dan footer aksi. */
.app-body {
  display: flex;
  justify-content: center;
  background: var(--bg-deep);
}

.app {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 480px;
  height: 100dvh;
  /* clip (bukan hidden): kontainer tidak boleh ikut tergulir saat fokus atau scrollIntoView dari dalam. */
  overflow: clip;
  background: var(--bg);
  isolation: isolate;
}

/* Di dalam bingkai showcase, inset aman iPhone 17 Pro Max disimulasikan karena env() bernilai 0 di iframe. */
.is-framed {
  --safe-top: 62px;
  --safe-bottom: 34px;
}

@media (min-width: 560px) {
  .app-body:not(.is-framed) {
    align-items: center;
  }

  .app-body:not(.is-framed) .app {
    max-width: 440px;
    height: min(100dvh, 956px);
    border-radius: 36px;
    box-shadow: var(--shadow-float);
  }
}

.statusbar {
  position: absolute;
  inset: 0 0 auto;
  z-index: 60;
  display: none;
  align-items: center;
  justify-content: space-between;
  height: var(--safe-top);
  padding: 8px 34px 0;
  font-size: var(--fs-lg);
  font-weight: 700;
  color: var(--ink);
  pointer-events: none;
  transition: color var(--duration) var(--ease);
}

.is-framed .statusbar {
  display: flex;
}

.app[data-statusbar="light"] .statusbar {
  color: var(--on-onyx);
}

.statusbar__icons {
  display: flex;
  align-items: center;
  gap: 6px;
}

.statusbar__signal {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 12px;
}

.statusbar__signal i {
  width: 3px;
  border-radius: 1px;
  background: currentcolor;
}

.statusbar__signal i:nth-child(1) {
  height: 4px;
}

.statusbar__signal i:nth-child(2) {
  height: 6px;
}

.statusbar__signal i:nth-child(3) {
  height: 9px;
}

.statusbar__signal i:nth-child(4) {
  height: 12px;
}

.statusbar__network {
  font-size: var(--fs-sm);
  font-weight: 800;
}

.statusbar__battery {
  position: relative;
  width: 26px;
  height: 13px;
  padding: 1.5px;
  border: 1.5px solid currentcolor;
  border-radius: 4.5px;
  opacity: 0.9;
}

.statusbar__battery::after {
  position: absolute;
  top: 3px;
  right: -4px;
  width: 2px;
  height: 5px;
  border-radius: 0 2px 2px 0;
  background: currentcolor;
  content: "";
}

.statusbar__battery i {
  display: block;
  width: 82%;
  height: 100%;
  border-radius: 2px;
  background: currentcolor;
}

.stack {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: clip;
}

.screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  overflow: clip;
  background: var(--bg);
  transition: background-color var(--duration) var(--ease);
}

.screen[data-covered] {
  visibility: hidden;
}

.screen__shade {
  position: absolute;
  inset: 0;
  z-index: 30;
  background: #000;
  opacity: 0;
  pointer-events: none;
}

.navbar {
  position: absolute;
  inset: 0 0 auto;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(var(--tap), auto) minmax(0, 1fr) minmax(var(--tap), auto);
  align-items: center;
  gap: var(--space-2);
  height: calc(var(--navbar-height) + var(--safe-top));
  padding: var(--safe-top) var(--space-3) 0;
  border-bottom: 1px solid transparent;
  transition:
    background-color var(--duration-fast) var(--ease),
    border-color var(--duration-fast) var(--ease);
}

.navbar[data-scrolled],
.navbar--solid {
  border-bottom-color: var(--hairline);
  background: var(--glass);
  backdrop-filter: var(--blur);
}

.navbar__title {
  overflow: hidden;
  font-size: var(--fs-lg);
  font-weight: 800;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.navbar--transparent .navbar__title {
  opacity: 0;
  transition: opacity var(--duration-fast) var(--ease);
}

.navbar--transparent[data-scrolled] .navbar__title {
  opacity: 1;
}

.navbar__side {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.navbar__side--end {
  justify-content: flex-end;
}

.nav-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--tap);
  height: var(--tap);
  border-radius: var(--radius-pill);
  color: var(--ink);
  transition:
    transform var(--duration-fast) var(--ease),
    background-color var(--duration-fast) var(--ease);
}

.nav-btn:active {
  transform: scale(0.92);
  background: var(--hairline);
}

/* Di atas hero foto/gelap tombol navbar memakai kaca agar tetap terbaca. */
.navbar--transparent:not([data-scrolled]) .nav-btn {
  width: 40px;
  height: 40px;
  border: 1px solid var(--glass-border);
  background: var(--glass);
  backdrop-filter: var(--blur);
}

.nav-btn__dot {
  position: absolute;
  top: 9px;
  right: 9px;
  min-width: 9px;
  height: 9px;
  border: 2px solid var(--bg);
  border-radius: var(--radius-pill);
  background: var(--danger);
}

.nav-btn__count {
  position: absolute;
  top: 4px;
  right: 2px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: var(--radius-pill);
  font-size: var(--fs-2xs);
  font-weight: 800;
  line-height: 18px;
  color: #fff;
  text-align: center;
  background: var(--danger);
}

.screen__body {
  flex: 1;
  min-height: 0;
  overflow: hidden auto;
  overscroll-behavior-y: contain;
  padding: calc(var(--navbar-height) + var(--safe-top) + var(--space-3)) var(--gutter) var(--space-8);
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.screen__body::-webkit-scrollbar {
  display: none;
}

.screen--no-navbar .screen__body {
  padding-top: calc(var(--safe-top) + var(--space-4));
}

.screen--flush .screen__body {
  padding-top: 0;
  padding-inline: 0;
}

.screen--tabbed .screen__body {
  padding-bottom: calc(var(--tabbar-height) + var(--safe-bottom) + var(--space-10));
}

.screen__footer {
  position: relative;
  z-index: 15;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-3) var(--gutter) calc(var(--safe-bottom) + var(--space-3));
  border-top: 1px solid var(--hairline);
  background: var(--glass);
  backdrop-filter: var(--blur);
}

.screen__footer--row {
  flex-direction: row;
  align-items: center;
}

.tabbar {
  position: absolute;
  right: var(--space-3);
  bottom: max(var(--safe-bottom), var(--space-3));
  left: var(--space-3);
  z-index: 40;
  display: grid;
  grid-auto-columns: minmax(0, 1fr);
  grid-auto-flow: column;
  height: var(--tabbar-height);
  padding: 6px;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  background: var(--glass);
  box-shadow: var(--shadow-float);
  backdrop-filter: var(--blur);
  transition:
    transform var(--duration) var(--ease-ios),
    opacity var(--duration-fast) var(--ease);
}

.tabbar[data-hidden] {
  transform: translateY(140%);
  opacity: 0;
  pointer-events: none;
}

.tabbar__item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 0;
  border-radius: var(--radius-lg);
  font-size: var(--fs-2xs);
  font-weight: 700;
  color: var(--muted);
  transition:
    color var(--duration-fast) var(--ease),
    background-color var(--duration-fast) var(--ease),
    transform var(--duration-fast) var(--ease);
}

.tabbar__item:active {
  transform: scale(0.94);
}

.tabbar__item[aria-current="page"] {
  color: var(--gold);
  background: var(--gold-soft);
}

.tabbar__label {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tabbar__badge {
  position: absolute;
  top: 5px;
  left: calc(50% + 6px);
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: var(--radius-pill);
  font-size: 10px;
  font-weight: 800;
  line-height: 17px;
  color: #fff;
  text-align: center;
  background: var(--danger);
}

.overlay-root {
  position: absolute;
  inset: 0;
  z-index: 80;
  pointer-events: none;
}

.overlay-root > * {
  pointer-events: auto;
}
