/* Каркас приложения: шапка (компьютер), вкладки снизу (телефон), область экрана. */

.shell { min-height: 100dvh; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 32px;
  height: 60px;
  padding: 0 max(24px, (100vw - 1280px) / 2 + 24px);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--display);
  font-weight: 600;
  font-size: 16px;
  white-space: nowrap;
  text-decoration: none;
}
.brand-mark { width: 32px; height: 32px; border-radius: 8px; }

.topnav { display: flex; gap: 4px; }
.topnav-item {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 12px;
  border-radius: var(--r-nav);
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
  white-space: nowrap;
}
.topnav-item:hover { color: var(--ink); }
.topnav-item[aria-current="page"] { color: #fff; background: var(--active); }

.whoami {
  margin-left: auto;
  padding: 6px 10px;
  border-radius: var(--r-nav);
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
}
.whoami:hover { color: var(--ink); background: var(--raised); }
.whoami[aria-current="page"] { color: var(--ink); font-weight: 500; }

.screen {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px 48px;
}
.screen-narrow { max-width: 960px; }

.screen-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 16px;
  padding: 24px 0 16px;
}
.screen-title {
  margin-right: auto;
  font-family: var(--display);
  font-weight: 600;
  font-size: 28px;
  line-height: 36px;
}
.screen-sub { color: var(--muted); }
.block-title { font-family: var(--display); font-weight: 600; font-size: 18px; line-height: 26px; }
.stack { display: flex; flex-direction: column; gap: 16px; }

/* вкладки снизу — только на телефоне */
.tabbar { display: none; }

@media (max-width: 767px) {
  .topbar { display: none; }
  .screen { padding: 0 16px calc(88px + env(safe-area-inset-bottom)); }
  .screen-head { padding-top: 16px; }
  .screen-title { font-size: 24px; line-height: 32px; }

  .tabbar {
    position: fixed;
    inset: auto 0 0 0;
    z-index: 10;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    padding: 4px 4px env(safe-area-inset-bottom);
    background: var(--surface);
    border-top: 1px solid var(--line);
  }
  .tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-height: 56px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
  }
  .tab .icon { width: 22px; height: 22px; }
  .tab:hover { color: var(--ink); }
  .tab[aria-current="page"] { color: var(--active); }
  .toast { bottom: calc(88px + env(safe-area-inset-bottom)); }
}

/* ---------- профиль ---------- */

.facts { display: grid; grid-template-columns: max-content 1fr; gap: 10px 20px; margin: 4px 0 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.profile-name { font-family: var(--display); font-size: 22px; line-height: 30px; font-weight: 600; }
.out { display: flex; gap: 8px; flex-wrap: wrap; }

.card-links { gap: 0; padding-bottom: 8px; }
.card-links .block-title { margin-bottom: 8px; }
.link-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  border-top: 1px solid var(--line-soft);
  text-decoration: none;
  font-weight: 500;
}
.link-row .icon { color: var(--muted); }
@media (min-width: 768px) { .card-links { display: none; } }
