/* Side panel for wide screens (Components/Layout/SidePanel.razor; HOMEBASE globals.css "Side panel").
   Under 1700px it is not a panel at all: .side-panel becomes display:contents and everything in it
   is hidden except Norti, whose floating launcher and panel behave exactly as before. */

/* ── Narrow: no panel, Norti floats ── */
.side-panel { display: contents; }
.sp-tabs, .sp-expand, .sp-pane-todos, .sp-pane-recent { display: none; }
.sp-body, .sp-pane-norti { display: contents; }
@media (max-width: 1699px) {
  .side-panel .sa-panel.is-closed { display: none; }
}

/* ── Wide: a third column with tabs ── */
@media (min-width: 1700px) {
  .shell { grid-template-columns: 240px minmax(0, 1fr) clamp(360px, 24vw, 520px); }
  .shell:has(.side-panel.is-collapsed) { grid-template-columns: 240px minmax(0, 1fr) 44px; }
  .side-panel { display: flex; flex-direction: column; position: sticky; top: 16px; align-self: start; height: calc(100vh - 32px); margin: 16px 16px 16px 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
  .side-panel.is-collapsed { border-radius: 10px; }
  .sp-tabs { display: flex; align-items: stretch; gap: 2px; padding: 6px 6px 0; border-bottom: 1px solid var(--border); background: var(--bg); flex-shrink: 0; }
  .sp-tab { background: transparent; border: none; border-bottom: 2px solid transparent; padding: 9px 12px 8px; font-size: 13px; font-weight: 600; color: var(--text-muted); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; font-family: inherit; }
  .sp-tab:hover { color: var(--text); }
  .sp-tab.is-active { color: var(--accent); border-bottom-color: var(--accent); }
  .sp-badge { background: var(--accent); color: #fff; border-radius: 999px; font-size: 10.5px; font-weight: 700; padding: 1px 7px; }
  .sp-collapse { margin-left: auto; background: transparent; border: none; color: var(--text-muted); font-size: 16px; cursor: pointer; padding: 0 10px; }
  .sp-collapse:hover { color: var(--accent); }
  .sp-body { display: block; flex: 1; min-height: 0; overflow-y: auto; padding: 14px; }
  .sp-body.is-hidden { display: none; }
  .sp-body:has(> .sp-pane-norti:not(.is-off)) { padding: 0; overflow: hidden; }
  .sp-pane-norti { display: block; height: 100%; }
  .sp-pane-norti.is-off { display: none; }
  .sp-pane-todos, .sp-pane-recent { display: block; }
  .sp-expand { display: flex; width: 100%; height: 100%; background: transparent; border: none; cursor: pointer; color: var(--text-muted); flex-direction: column; align-items: center; gap: 12px; padding: 12px 0; font-family: inherit; }
  .sp-expand:hover { color: var(--accent); }
  .sp-expand-label { writing-mode: vertical-rl; font-size: 12px; font-weight: 600; letter-spacing: .3px; }

  /* Norti docked in the panel: same chat, no floating chrome. */
  .side-panel .sa-panel { position: static; width: 100%; height: 100%; max-height: none; border: none; border-radius: 0; box-shadow: none; }
  .side-panel .sa-launcher, .side-panel .sa-x { display: none; }
}
