/* Mobile navigation and viewport layout. Desktop nodes are restored by mobile-layout.mjs. */
.mobile-only {
  display: none;
}
[hidden] {
  display: none !important;
}
@media (max-width: 760px) {
  body {
    --mobile-nav-height: 64px;
    --mobile-scene-height: clamp(
      80px,
      calc(
        var(--app-window-height, 100dvh) - var(--app-safe-top) -
          var(--app-safe-bottom) - 510px
      ),
      250px
    );
  }
  .mobile-only {
    display: block;
  }
  main {
    padding: 0 12px
      calc(var(--mobile-nav-height) + var(--app-safe-bottom) + 4px);
  }
  header {
    height: 48px;
  }
  .header-actions {
    gap: 4px;
    margin-left: auto;
  }
  .header-actions > button {
    width: 44px;
    height: 44px;
    min-height: 44px;
    padding: 5px;
  }
  #sound-toggle,
  #menu-open {
    font-size: 0;
  }
  #sound-toggle::before {
    content: "♫";
    font-size: 19px;
  }
  #sound-toggle[aria-pressed="false"]::before {
    content: "♪";
    color: var(--muted);
  }
  #menu-open::before {
    content: "☰";
    font-size: 19px;
  }
  .header-actions .daily-button {
    order: -1;
    font-size: 18px;
  }
  .header-actions .daily-button span {
    display: none;
  }
  .telegram-connected .account-banner {
    left: 12px;
    right: 154px;
    top: 7px;
  }
  .telegram-connected .account-banner strong {
    font-size: 11px;
  }
  .telegram-connected .account-banner span {
    font-size: 10px;
  }
  .page-heading {
    display: none;
  }
  .stats {
    margin: 8px 0;
    gap: 5px;
  }
  .stats article {
    padding: 6px 7px;
  }
  .stats article > span::before {
    font-size: 10px;
  }
  .stats strong {
    font-size: 20px;
    margin-top: 2px;
  }
  .strategy-strip {
    margin-bottom: 8px;
    padding: 5px 9px;
    gap: 8px;
  }
  .strategy-strip > div {
    width: 110px;
  }
  .strategy-strip > div > span,
  .strategy-strip > .text-button {
    font-size: 11px;
  }
  #build-summary {
    display: none;
  }
  body:not([data-view="game"]) .stats {
    grid-template-columns: 1fr;
  }
  body:not([data-view="game"]) .stats article:not(:first-child) {
    display: none;
  }
  body:not([data-view="game"]) .stats article:first-child {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
  body:not([data-view="game"]) .strategy-strip {
    display: none;
  }
  .play-layout {
    display: block;
  }
  .arena {
    padding: 10px 12px;
  }
  .arena-top {
    display: none;
  }
  .career {
    margin-top: 0;
  }
  .career > span {
    font-size: 10px;
    letter-spacing: 0.3px;
  }
  .career h2 {
    font-size: 19px;
    line-height: 1.2;
    margin: 4px 0;
  }
  .career p {
    display: none;
  }
  .scene {
    height: var(--mobile-scene-height);
  }
  .scene .mascot.mascot-rig {
    height: var(--mobile-scene-height);
    max-height: var(--mobile-scene-height);
    width: auto;
    max-width: 100%;
  }
  .scene .ai-bubble {
    font-size: 10px;
    max-width: 145px;
    line-height: 1.3;
  }
  .scene-note,
  .desk-terminal {
    display: none;
  }
  .arena .tap-button {
    min-height: 52px;
    padding: 12px 8px;
    font-size: 14px;
    gap: 8px;
  }
  .arena .tap-button span {
    font-size: 10px;
    padding-left: 8px;
  }
  .tap-hint {
    font-size: 10px;
    margin: 5px 0;
  }
  .energy {
    margin-top: 7px;
    font-size: 11px;
  }
  .energy-track {
    margin-top: 5px;
  }
  .level-progress {
    margin: 7px 0 4px;
    font-size: 10px;
  }
  .mobile-shortcuts {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    height: auto;
    margin: 8px 0 0;
  }
  .mobile-shortcuts button {
    min-height: 54px;
    background: var(--panel);
    border: 1px solid #435335;
    border-radius: 9px;
    font-size: 13px;
    padding: 7px 3px;
  }
  .mobile-shortcuts small {
    display: block;
    color: var(--muted);
    font-size: 10px;
    margin-top: 2px;
  }
  #game-view > .upgrades-section,
  .right-column > .story-teaser,
  .right-column > .disclaimer {
    display: none;
  }
  footer {
    display: none;
  }
  .sidebar {
    height: calc(var(--mobile-nav-height) + var(--app-safe-bottom));
  }
  .sidebar nav {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
  .sidebar .nav {
    width: auto;
    min-width: 0;
    min-height: 48px;
    font-size: 20px;
    gap: 1px;
    display: flex;
  }
  .sidebar .nav span {
    font-size: 11px;
    white-space: nowrap;
  }
  .sidebar .nav[data-tab="tasks"],
  .sidebar .nav[data-tab="achievements"],
  .sidebar .nav[data-tab="company"],
  .sidebar .nav[data-tab="feedback"] {
    display: none;
  }
  .mobile-view-title {
    font-size: 22px;
    margin: 12px 0 10px;
  }
  .office-sections {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    margin: 0 0 10px;
    height: auto;
  }
  .office-sections button {
    min-height: 44px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--panel);
    font-size: 13px;
  }
  .office-sections button[aria-pressed="true"] {
    color: var(--lime);
    border-color: #839f54;
    background: #2b371f;
  }
  .right-column {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }
  #office-panels[data-section="activities"]
    > [data-office-group]:not([data-office-group="activities"]),
  #office-panels[data-section="kitchen"]
    > [data-office-group]:not([data-office-group="kitchen"]),
  #office-panels[data-section="pulse"]
    > [data-office-group]:not([data-office-group="pulse"]) {
    display: none;
  }
  .right-column > .office-props {
    order: -1;
  }
  .right-column > .panel {
    padding: 14px;
  }
  .right-column .panel h3 {
    font-size: 19px;
    margin: 6px 0;
  }
  .right-column .panel p {
    font-size: 13px;
    margin: 8px 0;
  }
  .right-column .outline-button {
    min-height: 44px;
    font-size: 13px;
    margin-top: 10px;
  }
  .office-props .office-prop-feedback {
    min-height: 4.8em;
    margin: 10px 0;
  }
  .office-prop-buttons button {
    font-size: 13px;
    min-height: 48px;
  }
  .menu-links {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    margin: 14px 0;
  }
  .menu-links button {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px;
    min-height: 48px;
    font-size: 12px;
  }
  .menu-links .mobile-only {
    display: block;
  }
  dialog {
    max-height: calc(
      var(--app-window-height, 100dvh) - var(--app-safe-top) -
        var(--app-safe-bottom) - 20px
    );
  }
}
@media (max-width: 760px) and (max-height: 620px) {
  .tap-hint {
    display: none;
  }
  .career h2 {
    font-size: 17px;
  }
  .mobile-shortcuts button {
    min-height: 48px;
  }
}

@media (max-width: 760px) {
  .app {
    min-height: calc(var(--app-window-height, 100dvh) - var(--app-safe-top));
  }
  .header-actions .daily-button {
    font-size: 0;
  }
  .header-actions .daily-button::before {
    content: "🎁";
    font-size: 19px;
  }
  .scene {
    height: var(--mobile-scene-height);
  }
}
@media (max-width: 760px) {
  body {
    --app-bottom-offset: max(
      0px,
      calc(100dvh - var(--app-window-height, 100dvh))
    );
  }
  .sidebar {
    bottom: var(--app-bottom-offset);
  }
  dialog {
    position: fixed;
    inset-block: calc(var(--app-safe-top) + 10px)
      calc(var(--app-bottom-offset) + var(--app-safe-bottom) + 10px);
    margin-block: auto;
    height: fit-content;
  }
  #toast {
    bottom: calc(
      var(--app-bottom-offset) + var(--mobile-nav-height) +
        var(--app-safe-bottom) + 12px
    );
  }
}

@media (max-width: 760px) {
  .career > span,
  .career h2 {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  #incident-open {
    color: var(--orange);
    border-color: #9e713e;
  }
  #incident-dialog .incident-event {
    margin: 12px 0 0;
    padding: 14px;
  }
  #incident-dialog .incident-choice {
    min-height: 48px;
    font-size: 13px;
  }
}
@media (max-width: 760px) {
  .scene .ai-bubble,
  .scene .character-emote {
    pointer-events: none;
  }
}
