/* The shell: a bottom tab bar on phones, a sidebar from 768px; the sign-in gate; sheets (dialogs). */
.mark { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 11px;
  background: var(--accent); color: var(--awning); flex: none; }
.mark .icon { width: 22px; height: 22px; stroke-width: 2.1; }
.mark--big { width: 52px; height: 52px; border-radius: 16px; }
.mark--big .icon { width: 30px; height: 30px; }

.shell { min-height: 100vh; min-height: 100dvh; }
.shell__body { min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px;
  padding: calc(8px + env(safe-area-inset-top)) var(--pad) 8px; background: var(--bg); border-bottom: 1px solid var(--line); }
.topbar__title { font-weight: 750; font-size: 17px; flex: 1; min-width: 0; }
.topbar__net { font-size: 13px; color: var(--hot-text); font-weight: 600; }
.topbar__net:empty { display: none; }
.main { padding: 16px var(--pad) calc(var(--bar) + 28px + env(safe-area-inset-bottom)); max-width: 1320px; margin: 0 auto;
  min-width: 0; }
.main:focus { outline: none; }

/* bottom bar (phones) */
.nav { position: fixed; inset-inline: 0; bottom: 0; z-index: 30; background: var(--card); box-shadow: var(--shadow-up);
  padding-bottom: env(safe-area-inset-bottom); }
.nav__brand, .nav__me { display: none; }
.nav__list { list-style: none; display: flex; justify-content: space-around; }
.nav__list li { flex: 1; min-width: 0; }
.nav__link { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: var(--bar); padding: 6px 4px; color: var(--muted); text-decoration: none; font-size: 13px; font-weight: 650; }
.nav__link .icon { width: 24px; height: 24px; }
.nav__link[aria-current="page"] { color: var(--accent-text); }
.nav__link[aria-current="page"] .icon { stroke-width: 2.3; }
.nav__text { text-align: center; }
.nav__badge { position: absolute; top: 6px; inset-inline-start: calc(50% + 6px); min-width: 22px; height: 22px; padding: 0 6px;
  border-radius: 99px; background: var(--hot); color: var(--hot-ink); font-size: 13px; font-weight: 750;
  display: grid; place-items: center; }

@media (min-width: 768px) {
  .shell { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); }
  .topbar { display: none; }
  .main { padding: 28px clamp(18px, 3vw, 36px) 40px; }
  .nav { position: sticky; top: 0; height: 100vh; height: 100dvh; display: flex; flex-direction: column; gap: 6px;
    padding: 18px 12px; box-shadow: none; border-inline-end: 1px solid var(--line); }
  .nav__brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 16px; }
  .nav__title { font-weight: 750; font-size: 17px; }
  .nav__list { flex-direction: column; gap: 4px; }
  .nav__link { flex-direction: row; justify-content: flex-start; gap: 12px; min-height: 46px; padding: 8px 12px;
    border-radius: var(--r-sm); font-size: 16px; color: var(--muted); }
  .nav__link .icon { width: 22px; height: 22px; }
  .nav__link[aria-current="page"] { background: var(--accent-soft); color: var(--accent-text); }
  .nav__badge { position: static; margin-inline-start: auto; }
  .nav__me { display: grid; margin-top: auto; padding: 12px; border-top: 1px solid var(--line); gap: 2px; }
  .nav__name { font-weight: 650; }
  .nav__role { color: var(--muted); font-size: 14px; }
}

/* ---------------------------------------------------------------- the gate (sign-in, setup, terms) */
.gate { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center;
  padding: calc(24px + env(safe-area-inset-top)) var(--pad) 32px; }
.gate__box { width: min(420px, 100%); background: var(--card); border-radius: var(--r-lg); padding: 24px 20px;
  box-shadow: var(--shadow); display: grid; gap: 12px; min-width: 0; }
.gate__top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.gate__title { font-size: 23px; font-weight: 750; line-height: 1.3; }
.gate__sub { color: var(--muted); }
.langflip { min-width: 96px; }
.terms { max-height: 46vh; overflow-y: auto; padding: 12px; border: 1px solid var(--line); border-radius: var(--r-sm);
  display: grid; gap: 10px; font-size: 15px; }

/* ---------------------------------------------------------------- sheets */
.sheet { border: 0; padding: 0; margin: 0; width: 100%; max-width: 100%; height: 100%; max-height: 100%;
  background: var(--bg); color: var(--ink); }
.sheet::backdrop { background: var(--scrim); }
.sheet[open] { display: flex; flex-direction: column; }
.sheet__head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 10px;
  padding: calc(10px + env(safe-area-inset-top)) var(--pad) 10px; background: var(--card); border-bottom: 1px solid var(--line); }
.sheet__title { flex: 1; min-width: 0; font-size: 19px; font-weight: 750; overflow-wrap: anywhere; }
.sheet__body { flex: 1; overflow-y: auto; padding: 16px var(--pad) calc(28px + env(safe-area-inset-bottom)); }
.sheet--ask { height: auto; margin-top: auto; border-radius: var(--r-lg) var(--r-lg) 0 0; }
.sheet--ask .sheet__head { border-radius: var(--r-lg) var(--r-lg) 0 0; }
.sheet--ask .sheet__title { font-size: 17px; font-weight: 650; line-height: 1.5; }
@media (min-width: 768px) {
  .sheet { width: min(560px, calc(100% - 48px)); height: auto; max-height: calc(100% - 64px); margin: auto;
    border-radius: var(--r-lg); overflow: hidden; }
  .sheet--wide { width: min(760px, calc(100% - 48px)); }
  .sheet--order { margin-inline-end: 24px; height: calc(100% - 48px); max-height: none; }
  .sheet--ask { margin: auto; border-radius: var(--r-lg); }
}
