/* The app shell: a single thumb-reachable column on a phone, a sidebar on a
   wide screen. Both are the same markup — only the nav changes shape. */

.shell {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

.shell__main {
  flex-grow: 1;
  padding: 18px 20px 12px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.brand__word {
  font-family: var(--display);
  font-size: 16px;
  font-weight: 800;
  color: var(--forest-deep);
}
.brand__mark { flex-shrink: 0; position: relative; top: 4px; }

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
}
.page-header--center { align-items: center; }
.page-header__lead { min-width: 0; }
.page-header__subtitle { font-size: 15px; color: var(--ink2); }

/* Bottom tab bar, phone only. */
.tabs {
  display: flex;
  margin: 0 12px 12px;
  padding: 6px;
  background: var(--paper);
  border-radius: 28px;
  position: sticky;
  bottom: 0;
  margin-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
}
.tabs__tab {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-height: 48px;
  font-size: 11px;
  font-weight: 500;
  color: var(--ink2);
}
.tabs__tab[aria-current] { font-weight: 700; color: var(--forest-deep); }
.tabs__icon {
  width: 52px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 15px;
}
.tabs__tab[aria-current] .tabs__icon { background: var(--forest-soft); }

.sidebar { display: none; }

/* Segmented sub-navigation, used by the More screens and toggles. */
.segmented {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--track);
  border-radius: 22px;
}
.segmented__item {
  flex: 1 1 0;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 18px;
  background: transparent;
  color: var(--ink2);
  font-size: 15px;
  font-weight: 600;
}
.segmented__item[aria-current], .segmented__item[aria-pressed="true"] {
  background: var(--paper);
  color: var(--ink);
  font-weight: 700;
}

@media (min-width: 900px) {
  .shell { flex-direction: row; }

  .shell > .tabs { display: none; }

  .sidebar {
    display: flex;
    flex-direction: column;
    gap: 28px;
    position: relative;
    overflow: hidden;
    width: 248px;
    flex-shrink: 0;
    padding: 28px 16px;
  }
  .sidebar .brand { padding: 0 10px; }
  .sidebar__nav { display: flex; flex-direction: column; gap: 4px; position: relative; }
  .sidebar__link {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 44px;
    padding: 0 14px;
    border-radius: 22px;
    color: var(--ink2);
    font-size: 15px;
    font-weight: 600;
  }
  .sidebar__link[aria-current] {
    background: var(--forest-soft);
    color: var(--forest-deep);
    font-weight: 700;
  }
  .sidebar__rule { height: 1px; margin: 10px 14px; background: var(--line); }
  .sidebar__hills { position: absolute; left: 0; bottom: 0; width: 100%; }

  .shell__main {
    padding: 40px 56px 40px 32px;
    gap: 28px;
    max-width: 1100px;
  }
  .shell__main > .brand { display: none; }

  h1 { font-size: 44px; letter-spacing: -1px; }

  .columns {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 32px;
    align-items: start;
  }
  .columns > * { min-width: 0; }
}

/* The More section is a phone-only grouping; the sidebar lists its screens
   directly. */
@media (min-width: 900px) {
  .more-nav { display: none; }
}
