.shell { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100dvh; }

/* ---------- side rail (right side in RTL) ---------- */
.side { position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; gap: 4px; padding: 16px 12px;
  background: var(--bg-2); border-inline-end: 1px solid var(--line); overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 16px; }
.brand-mark { width: 36px; height: 36px; flex: none; }
.brand b { display: block; font-size: 14.5px; letter-spacing: -0.01em; }
.brand span { display: block; font-size: 11.5px; color: var(--text-3); }
.nav-group { margin-top: 10px; padding: 0 10px 4px; font-size: 11.5px; color: var(--text-3); font-weight: 500; }
.nav a { position: relative; display: flex; align-items: center; gap: 11px; height: 40px; padding: 0 11px; border-radius: 11px;
  color: var(--text-2); font-weight: 500; text-decoration: none; transition: background var(--t-fast), color var(--t-fast); }
.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav a.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-1); }
.nav a.on::before { content: ''; position: absolute; inset-inline-start: -12px; top: 10px; bottom: 10px; width: 3px; border-radius: 3px;
  background: var(--accent); }
.nav a .count { margin-inline-start: auto; }
.nav a .ch-dots { margin-inline-start: auto; display: flex; gap: 3px; }
.side-foot { margin-top: auto; padding: 12px 6px 0; }
.engine { display: flex; align-items: center; gap: 9px; padding: 10px 12px; border-radius: 12px; background: var(--surface);
  border: 1px solid var(--line); font-size: 12.5px; color: var(--text-2); }

/* ---------- top bar ---------- */
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; height: var(--top-h); display: flex; align-items: center; gap: 12px; padding: 0 28px;
  background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%); border-bottom: 1px solid var(--line); }
.topbar h1 { font-size: 18px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar .crumb { color: var(--text-3); font-weight: 400; }
.top-actions { display: flex; align-items: center; gap: 8px; }
.autonomy-pill { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 12px; border-radius: var(--r-pill);
  border: 1px solid var(--line-2); background: var(--surface); font-size: 12.5px; color: var(--text-2); cursor: pointer; }
.autonomy-pill b { color: var(--text); font-weight: 600; }
.icon-btn { position: relative; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; border: 0;
  background: transparent; color: var(--text-2); cursor: pointer; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn .count { position: absolute; top: 1px; inset-inline-end: 0; min-width: 17px; height: 17px; font-size: 10px; padding: 0 4px; }
.avatar { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--accent-soft);
  color: var(--accent-text); font-weight: 700; font-size: 13px; border: 0; cursor: pointer; }
.page { padding: 24px 28px 48px; max-width: 1480px; width: 100%; margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head .grow p { color: var(--text-2); margin-top: 4px; max-width: 70ch; }

.notif-panel { position: absolute; top: calc(var(--top-h) - 6px); inset-inline-end: 20px; z-index: 30; width: min(400px, calc(100vw - 24px));
  max-height: 70dvh; overflow-y: auto; padding: 8px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line-2);
  box-shadow: var(--shadow-2); animation: pop-up var(--t-fast) var(--ease); }
.notif { display: flex; gap: 10px; padding: 10px; border-radius: 12px; cursor: pointer; }
.notif:hover { background: var(--surface-2); }
.notif.unread { background: var(--accent-soft); }
.notif .mark { width: 30px; height: 30px; border-radius: 9px; }

/* ---------- phones ---------- */
.tabbar { display: none; }
@media (max-width: 980px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { display: none; }
  .topbar { padding: 0 16px; gap: 8px; }
  .topbar h1 { font-size: 16px; }
  .top-actions { gap: 4px; }
  .page { padding: 16px 16px 96px; }
  .autonomy-pill .lbl { display: none; }
  .tabbar { position: fixed; z-index: 25; bottom: 0; left: 0; right: 0; display: grid; grid-template-columns: repeat(5, 1fr);
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--surface) 92%, transparent);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--line); }
  .tabbar a, .tabbar button { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0;
    border: 0; background: none; color: var(--text-3); font-size: 11px; font-weight: 500; text-decoration: none; cursor: pointer; }
  .tabbar .on { color: var(--accent-text); }
  .tabbar .count { position: absolute; top: 0; left: calc(50% + 6px); min-width: 16px; height: 16px; font-size: 10px; padding: 0 4px; }
  .more-sheet { position: fixed; z-index: 41; left: 0; right: 0; bottom: 0; padding: 12px 12px calc(76px + env(safe-area-inset-bottom));
    border-radius: 22px 22px 0 0; background: var(--surface); box-shadow: var(--shadow-2); animation: pop-up var(--t-med) var(--ease); }
  .more-sheet .nav a { height: 46px; }
}

/* ---------- auth ---------- */
.auth { min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); }
.auth-form { display: flex; flex-direction: column; justify-content: center; padding: 48px clamp(24px, 6vw, 88px); gap: 22px; }
.auth-form form { display: flex; flex-direction: column; gap: 14px; max-width: 420px; }
.auth-form h1 { font-size: 28px; }
.auth-art { position: relative; overflow: hidden; background: var(--map-bg); border-inline-start: 1px solid var(--line); }
.auth-art svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.auth-art .caption { position: absolute; bottom: 36px; inset-inline: 40px; max-width: 46ch; }
.auth-art .caption b { display: block; font-size: 20px; margin-bottom: 6px; }
.auth-art .caption p { color: var(--text-2); }
@media (max-width: 900px) { .auth { grid-template-columns: minmax(0, 1fr); } .auth-art { display: none; } }
