/* Shared destination names and local icons; mobile uses a bottom navigation. */
:root {
  --preview-bottom-height: 0px;
}
.nav-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.sidebar .nav {
  gap: var(--space-3);
}
.sidebar .nav > .nav-label {
  display: inline;
  width: auto;
  flex: 1;
  font-size: 13px;
  line-height: 1.4;
  color: inherit;
  text-align: left;
}
#previewMobileNav {
  display: none;
}
@media (max-width: 760px) {
  :root {
    --preview-bottom-height: calc(64px + env(safe-area-inset-bottom, 0px));
  }
  body.connected .sidebar {
    display: none;
  }
  body.connected .main {
    padding-bottom: var(--preview-bottom-height);
  }
  #previewMobileNav {
    position: fixed;
    inset: auto 0 0;
    z-index: 35;
    display: flex;
    align-items: stretch;
    gap: 2px;
    height: var(--preview-bottom-height);
    padding: 3px 4px calc(3px + env(safe-area-inset-bottom, 0px));
    background: var(--surface);
    color: var(--ink);
    border-top: 1px solid var(--line);
  }
  #previewMobileNav > .mobile-nav-item,
  #previewMobileNav > .preview-menu {
    flex: 1;
    min-width: 0;
  }
  #previewMobileNav .mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-height: 56px;
    width: 100%;
    padding: 4px 2px;
    border: 0;
    border-top: 2px solid transparent;
    border-radius: 7px;
    background: transparent;
    color: var(--muted);
  }
  #previewMobileNav .nav-label {
    font-size: 11px;
    line-height: 14px;
    white-space: nowrap;
  }
  #previewMobileNav .mobile-nav-item.active {
    background: var(--accent-soft);
    color: var(--accent-ink);
    border-top-color: var(--accent-ink);
    font-weight: 650;
  }
  #previewMobileNav .preview-menu-panel {
    top: auto;
    bottom: calc(100% + var(--space-2));
    min-width: 220px;
  }
  #previewMobileNav .preview-menu-panel .mobile-nav-item {
    flex-direction: row;
    justify-content: flex-start;
    gap: var(--space-3);
    padding: var(--space-2) var(--space-3);
    min-height: 44px;
    text-align: left;
  }
  #previewMobileNav .preview-menu-panel .nav-label {
    font-size: 14px;
    line-height: 21px;
  }
  #previewMobileNav .mobile-nav-item:hover {
    background: var(--surface-hover);
    color: var(--ink);
  }
  #content :is(button, input, select, textarea, summary) {
    scroll-margin-bottom: calc(var(--preview-bottom-height) + var(--space-2));
  }
  #toast {
    bottom: calc(var(--preview-bottom-height) + var(--space-4));
  }
  .hall-mode #previewMobileNav {
    display: none;
  }
  .hall-mode.connected .main {
    padding-bottom: 0;
  }
}
#previewMobileActions {
  display: none;
}
#previewMobileTheme {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-2);
  margin-top: var(--space-1);
  padding-top: var(--space-2);
  border-top: 1px solid var(--line);
}
#previewMobileTheme .preview-menu-heading {
  grid-column: 1/-1;
  padding-inline: var(--space-2);
  font-size: 12px;
  color: var(--muted);
}
#previewMobileTheme button {
  display: flex;
  align-items: center;
  justify-content: center;
  justify-self: center;
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  padding: var(--space-2);
}
@media (max-width: 760px) {
  .preview-page-head .topbar {
    flex-wrap: nowrap;
    min-height: 56px;
    padding: var(--space-2) var(--space-4);
  }
  .preview-page-head .topbar > div:first-child {
    flex: 1 1 auto;
    flex-wrap: nowrap;
    gap: var(--space-2);
    min-width: 0;
  }
  .preview-page-head h1 {
    font-size: 20px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
  }
  #previewSaveStatus {
    flex-shrink: 0;
  }
  #previewSaveStatus .preview-save-label {
    display: none;
  }
  #previewMobileActions {
    display: flex;
    position: fixed;
    right: var(--space-4);
    bottom: calc(var(--preview-bottom-height) + var(--space-3));
    z-index: 36;
  }
  #previewMobileActions :is(#previewCreate, #previewPageAction) {
    min-height: 48px;
    padding: var(--space-3) var(--space-4);
    border-radius: 24px;
    box-shadow: 0 4px 16px #0003;
  }
  #previewMobileActions .preview-menu-panel {
    top: auto;
    bottom: calc(100% + var(--space-2));
  }
  body.has-mobile-action .main {
    padding-bottom: calc(var(--preview-bottom-height) + 72px);
  }
  body.has-mobile-action #toast {
    bottom: calc(var(--preview-bottom-height) + 76px);
  }
  body:has(#previewMore[aria-expanded='true'], #mobileMore[aria-expanded='true'], dialog[open])
    #previewMobileActions {
    visibility: hidden;
    pointer-events: none;
  }
}
