/* sm-shell.css (next wave, item 4). The frame for the family pages, drawn to
   match the console's Direction C rail (css/console-c.css): the brand block
   at the top with a switcher, the menu, and Help at the bottom. Loaded after
   css/console-c.css, which supplies the tokens (--c-*, --brand*) and the
   shared pieces (.c-teamblock, .c-band, .c-btn, .c-chip). Scoped to
   body.sm-shell so the consoles never change. */

body.sm-shell { margin: 0; font-size: 17px; line-height: 1.5; font-family: var(--sys, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif); -webkit-font-smoothing: antialiased; }
body.sm-shell * { box-sizing: border-box; }
body.sm-shell .sm-app { display: grid; grid-template-columns: 268px minmax(0, 1fr); min-height: 100vh; background: linear-gradient(to right, var(--c-side) 267px, var(--c-line) 267px, var(--c-line) 268px, transparent 268px); }

/* Rail */
body.sm-shell .sm-rail { position: sticky; top: 0; height: 100vh; overflow-y: auto; overscroll-behavior: contain; background: var(--c-side); border-right: 1px solid var(--c-line); z-index: 45; }
body.sm-shell .sm-rail-in { display: flex; flex-direction: column; min-height: 100%; padding-bottom: 14px; }
body.sm-shell .sm-tb { width: 100%; border: 0; border-radius: 0; text-align: left; font: inherit; cursor: pointer; height: auto; }
body.sm-shell .sm-tb[tabindex="-1"] { cursor: default; }
body.sm-shell .sm-tb:hover { filter: brightness(1.04); }
body.sm-shell .c-teamblock { min-height: 86px; }
body.sm-shell .sm-switch { margin: -4px 12px 10px; border: 1px solid var(--c-line2); border-radius: 14px; background: var(--c-surface); padding: 8px; box-shadow: 0 18px 40px rgba(0,0,0,.35); }
body.sm-shell .sm-sw-label { font-size: 15px; color: var(--c-ink3); padding: 8px 10px 4px; }
body.sm-shell .sm-sw-item { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 52px; height: auto; padding: 8px 10px; border: 0; border-radius: 10px; background: transparent; color: var(--c-ink); text-align: left; cursor: pointer; font-weight: 600; }
body.sm-shell .sm-sw-item:hover, body.sm-shell .sm-sw-item.on { background: var(--c-hover); }
body.sm-shell .sm-sw-item svg { margin-left: auto; color: var(--brand-ink); }
body.sm-shell .sm-sw-dot { width: 14px; height: 14px; border-radius: 99px; flex: none; }
body.sm-shell .sm-sw-text b { display: block; font-size: 16px; font-weight: 700; }
body.sm-shell .sm-sw-text small { display: block; font-size: 15px; font-weight: 500; color: var(--c-ink3); }

body.sm-shell .sm-nav { display: flex; flex-direction: column; gap: 2px; padding: 0 12px; }
body.sm-shell .sm-label { font-size: 15px; color: var(--c-ink3); padding: 14px 12px 6px; }
body.sm-shell .sm-item { position: relative; display: flex; align-items: center; gap: 12px; min-height: 46px; padding: 0 12px; border-radius: 10px; color: var(--c-ink2); text-decoration: none; font-size: 17px; font-weight: 500; border: 0; background: transparent; width: 100%; text-align: left; cursor: pointer; }
body.sm-shell .sm-item svg { color: var(--c-ink3); }
body.sm-shell .sm-item:hover { background: var(--c-hover); color: var(--c-ink); }
body.sm-shell .sm-item.on { background: var(--brand-band); color: var(--c-ink); font-weight: 700; }
body.sm-shell .sm-item.on::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 4px; border-radius: 0 4px 4px 0; background: var(--brand); }
:root.c-brand-light body.sm-shell .sm-item.on::before { background: var(--brand-deep); }
body.sm-shell .sm-item.on svg { color: var(--brand-ink); }
body.sm-shell .sm-badge { margin-left: auto; width: 10px; height: 10px; border-radius: 99px; background: var(--c-need); }

body.sm-shell .sm-foot { margin-top: auto; padding: 18px 12px 0; display: grid; gap: 8px; border-top: 1px solid var(--c-line); }
body.sm-shell .sm-me { display: flex; align-items: center; gap: 12px; padding: 6px 12px; }
body.sm-shell .sm-me .c-av { width: 40px; height: 40px; }
body.sm-shell .sm-me-t { min-width: 0; flex: 1; }
body.sm-shell .sm-me-t b { display: block; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.sm-shell .sm-me-t small { display: block; font-size: 15px; color: var(--c-ink3); }
body.sm-shell .sm-out { width: 42px; min-width: 42px; height: 42px; min-height: 42px; padding: 0; display: grid; place-items: center; border-radius: 10px; border: 1px solid var(--c-line2); background: transparent; color: var(--c-ink2); cursor: pointer; }
body.sm-shell .sm-out:hover { background: var(--c-hover); color: var(--c-ink); }

body.sm-shell .sm-scrim { display: none; }

/* Main column */
body.sm-shell .sm-main { min-width: 0; display: flex; flex-direction: column; }
body.sm-shell .sm-top { height: 64px; display: flex; align-items: center; gap: 12px; padding: 0 40px; position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--c-bg) 92%, transparent); backdrop-filter: blur(8px); }
body.sm-shell .sm-menu-btn, body.sm-shell .sm-top-brand { display: none; }
body.sm-shell .sm-top-r { margin-left: auto; display: flex; align-items: center; gap: 10px; }
body.sm-shell .sm-top-r .sm-theme-btn { position: static !important; width: 42px; height: 42px; border-radius: 99px; border: 1px solid var(--c-line2); background: transparent; color: var(--c-ink2); display: grid; place-items: center; padding: 0; min-height: 0; }
body.sm-shell .sm-page { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 40px 90px; }

/* Help panel */
body.sm-shell .sm-help { position: fixed; inset: 0; z-index: 80; background: rgba(0,0,0,.55); display: grid; place-items: center; padding: 20px; }
body.sm-shell .sm-help[hidden] { display: none; }
body.sm-shell .sm-help-in { width: 100%; max-width: 560px; background: var(--c-surface); border: 1px solid var(--c-line2); border-radius: 20px; padding: 24px 26px 26px; box-shadow: 0 30px 80px rgba(0,0,0,.5); }
body.sm-shell .sm-help-h { display: flex; align-items: center; gap: 12px; }
body.sm-shell .sm-help-h h2 { margin: 0; font-size: 26px; line-height: 1.2; font-weight: 800; }
body.sm-shell .sm-x { margin-left: auto; width: 44px; height: 44px; min-height: 44px; padding: 0; display: grid; place-items: center; border-radius: 99px; border: 1px solid var(--c-line2); background: transparent; color: var(--c-ink2); cursor: pointer; }
body.sm-shell .sm-help-in p { font-size: 17px; color: var(--c-ink2); margin: 12px 0 20px; }
body.sm-shell .sm-help-links { display: flex; flex-wrap: wrap; gap: 10px; }
body.sm-shell .sm-help-links a { text-decoration: none; }

/* Phones: the rail becomes a bottom sheet behind a Menu button. */
@media (max-width: 900px) {
  body.sm-shell .sm-app { grid-template-columns: minmax(0, 1fr); background: none; }
  body.sm-shell .sm-rail { position: fixed; left: 0; right: 0; bottom: 0; top: auto; height: auto; max-height: 86vh; border-right: 0; border-radius: 22px 22px 0 0; transform: translateY(105%); visibility: hidden; transition: transform .22s ease, visibility 0s linear .22s; box-shadow: 0 -20px 60px rgba(0,0,0,.45); z-index: 70; overflow: hidden auto; }
  body.sm-shell.sm-sheet-open .sm-rail { transform: none; visibility: visible; transition: transform .22s ease, visibility 0s; }
  body.sm-shell .sm-scrim { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 60; display: none; }
  body.sm-shell.sm-sheet-open .sm-scrim { display: block; }
  body.sm-shell .c-teamblock { border-radius: 22px 22px 0 0; }
  body.sm-shell .sm-top { padding: 0 16px; height: 62px; border-bottom: 1px solid var(--c-line); }
  body.sm-shell .sm-menu-btn { display: inline-flex; align-items: center; gap: 8px; height: 44px; min-height: 44px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--c-line2); background: transparent; color: var(--c-ink); font-size: 16px; font-weight: 650; cursor: pointer; }
  body.sm-shell .sm-top-brand { display: flex; align-items: center; gap: 10px; min-width: 0; font-size: 16px; }
  body.sm-shell .sm-top-brand b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  body.sm-shell .sm-top-logo { width: 32px; height: 32px; border-radius: 9px; object-fit: contain; flex: none; background: var(--brand); color: var(--on-brand); font-size: 13px; }
  body.sm-shell .sm-page { padding: 0 16px 80px; }
}
@media (prefers-reduced-motion: reduce) { body.sm-shell .sm-rail { transition: none; } }
