/* Keep the original phone, ink background and calculator styling. */
body.app-phone-page { --app-nav-height: 66px; }
body.app-phone-page .phone-frame {
  height: calc(100vh - 48px);
  height: calc(100dvh - 48px);
  /* A short desktop window scrolls outside the phone instead of squashing it. */
  min-height: 760px;
  max-height: none;
}
/* Only the outer phone clips rounded corners; the scroll area meets the nav flat. */
body.app-phone-page .page-ink-bg,
body.app-phone-page .page-ink-bg-image,
body.app-phone-page .page-ink-bg-overlay {
  border-radius: 0;
}
.app-bottom-nav {
  display: flex;
  position: relative;
  flex: 0 0 var(--app-nav-height, 66px);
  min-height: var(--app-nav-height, 66px);
  width: 100%;
  z-index: 20;
  border-top: 1px solid var(--card-border);
  background: #faf7f2;
  padding: 4px 8px 7px;
}
body.app-phone-page .app-bottom-nav a {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.35;
  text-decoration: none;
  border-radius: 6px;
}
.app-bottom-nav svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.35;
  stroke-linecap: round;
  stroke-linejoin: round;
}
body.app-phone-page .app-bottom-nav a.active { color: var(--primary-dark); font-weight: 600; }
body.app-phone-page .app-bottom-nav a.active svg { color: #9c7d45; }
body.app-phone-page .app-bottom-nav a:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
body.modal-open .app-bottom-nav { visibility: hidden; pointer-events: none; }
@media (min-width: 431px) and (max-width: 1199px) {
  body.app-phone-page .phone-frame {
    height: calc(100vh - 32px);
    height: calc(100dvh - 32px);
    max-height: none;
    min-height: 760px;
  }
}
@media (max-width: 430px) {
  body.app-phone-page .phone-frame { height: auto; max-height: none; min-height: 100vh; min-height: 100dvh; }
  body.app-phone-page .page-ink-bg { padding-bottom: calc(var(--app-nav-height) + env(safe-area-inset-bottom, 0px)); }
  .app-bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: calc(var(--app-nav-height, 66px) + env(safe-area-inset-bottom, 0px));
    padding-bottom: calc(7px + env(safe-area-inset-bottom, 0px));
  }
  body.app-keyboard-open .app-bottom-nav { visibility: hidden; pointer-events: none; }
}
