/* ---------- phone navigation (phone_nav.go) ----------
   rastrillo/fiesta's phone shell, in amadan's paint. Below 800px a
   page is an index (an area's sections as a list, at a real URL) or a
   page (one section, with a back control to that index), and the
   server says which in data-phone-view. No hamburger, no sideways tab
   bar: the repo tab bar and the settings sidebars are desktop's
   navigation, and here the index and the back control do their job.
   Above 800px nothing in this block applies. */
.phone-back, .phone-index, .phone-index[hidden] { display: none; }
@media (max-width: 800px) {
  .phone-back { display: block; margin: -0.25rem 0 0.25rem; }
  .phone-back a { display: inline-flex; align-items: center; gap: 0.15rem; min-height: 2.75rem; margin-left: -0.4rem; padding-right: 0.75rem; font-weight: 600; }
  .phone-back a:hover { text-decoration: none; }
  .phone-back .icon { width: 1.35em; height: 1.35em; }

  .repo-body > .tabs { display: none; }
  [data-phone-view="page"] .settings-nav { display: none; }

  /* An index is its list: the content beside it on desktop hides. A
     repo's index keeps its header, About and README; the file browser
     is the Code page's. */
  [data-phone-view="index"].settings-page > .settings-content,
  [data-phone-view="index"] .settings-page > .settings-content,
  [data-phone-view="index"] .settings-page > .settings,
  [data-phone-view="index"] .code-toolbar,
  [data-phone-view="index"] .file-table,
  [data-phone-view="index"] .panel-files .repo-main { display: none; }

  /* Index rows: a repo's sections, and a settings sidebar on its own
     index. One bordered list, hairlines between rows, a drawn chevron
     at the end of each; rows are 3rem, past the tap floor. */
  .phone-index,
  [data-phone-view="index"] .settings-nav {
    display: flex;
    flex: none;
    flex-direction: column;
    flex-wrap: nowrap;
    gap: 0;
    position: static;
    width: 100%;
    margin: 0.75rem 0 1.5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
  }
  .phone-index > * + *,
  [data-phone-view="index"] .settings-nav > * + * { border-top: 1px solid var(--border); }
  .phone-index[hidden] { display: none; }
  .phone-index a,
  [data-phone-view="index"] .settings-nav a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-height: 3rem;
    padding: 0 1rem;
    border-radius: 0;
    background: none;
    color: var(--fg);
    font-size: 1rem;
    font-weight: 500;
  }
  .phone-index a::after,
  [data-phone-view="index"] .settings-nav a::after {
    content: "";
    flex: none;
    margin-left: auto;
    width: 0.45rem;
    height: 0.45rem;
    border-top: 2px solid var(--fg-muted);
    border-right: 2px solid var(--fg-muted);
    transform: rotate(45deg);
  }
  .phone-index a:hover,
  [data-phone-view="index"] .settings-nav a:hover { background: none; text-decoration: none; }
  .phone-index a:active,
  [data-phone-view="index"] .settings-nav a:active { background: var(--accent-wash); }
  .phone-index .icon { width: 1.15em; height: 1.15em; color: var(--fg-muted); }
  /* A settings page is the whole width now, so its wide parts scroll
     or wrap inside it instead of pushing the page sideways. */
  .settings-page > .settings-content { align-self: stretch; min-width: 0; }
  .settings-content pre,
  .settings-content table { display: block; max-width: 100%; overflow-x: auto; }
  .settings-content .row { flex-wrap: wrap; }
  .settings-content select,
  .settings-content input { max-width: 100%; }

  /* Nothing is "current" on an index: no section is open beside it. */
  [data-phone-view="index"] .settings-nav a.active { color: var(--fg); font-weight: 500; }
  /* The account settings list keeps its groups, as quiet bands. */
  [data-phone-view="index"] .settings-nav-group {
    display: block;
    margin: 0;
    padding: 0.55rem 1rem 0.35rem;
    background: var(--bg-inset);
  }
}
