/* ===================================================================
   shell.css — sh- namespace
   App frame: sidebar, header, mode menu.

   Includes the overrides needed because main.css targets unscoped
   selectors (body, .platform-button) and reaches into this layout.
   Load this AFTER main.css.
   =================================================================== */

:root, [data-theme="light"] {
  --sh-bg:#F8F8F6; --sh-rail:#F1EFE9; --sh-surface:#FFFFFF; --sh-surface2:#F0EDE5;
  --sh-ink:#1A1815; --sh-ink2:rgba(26,24,21,.74); --sh-ink3:rgba(26,24,21,.56);
  --sh-line:rgba(26,24,21,.12); --sh-line2:rgba(26,24,21,.24);
  --sh-accent:#8B6A2E; --sh-ok:#3B6D33;
  --sh-sel:rgba(26,24,21,.06);
}
[data-theme="dark"] {
  --sh-bg:#1C1A17; --sh-rail:#171512; --sh-surface:#252320; --sh-surface2:#2E2B27;
  --sh-ink:#F4F1E8; --sh-ink2:rgba(244,241,232,.78); --sh-ink3:rgba(244,241,232,.58);
  --sh-line:rgba(244,241,232,.12); --sh-line2:rgba(244,241,232,.24);
  --sh-accent:#C99B4D; --sh-ok:#9CBF86;
  --sh-sel:rgba(244,241,232,.08);
}

/* Every panel is in the HTML at load, so without this the browser
   paints all of them — the old form, every screen — before shell.js
   runs and picks one. */
body:not(.sh-body) .tab-content { display:none !important; }
body:not(.sh-ready) .sh-scroll { visibility:hidden; }

/* ---------- layout ---------- */
/* main.css puts padding on body, which pushed the whole grid inward
   and made the sidebar look like it wasn't attached to the edge. */
html, body.sh-body { margin:0 !important; padding:0 !important; }

body.sh-body {
  background:var(--sh-bg); color:var(--sh-ink);
  font-family:'Inter', system-ui, -apple-system, sans-serif;
  font-size:15px; line-height:1.55; -webkit-font-smoothing:antialiased;
}
body.sh-body .sh-app { display:grid; grid-template-columns:232px 1fr; min-height:100vh; }
body.sh-body.sh-mini .sh-app { grid-template-columns:60px 1fr; }

/* ---------- sidebar ---------- */
.sh-rail {
  background:var(--sh-rail); border-right:1px solid var(--sh-line);
  display:flex; flex-direction:column; padding:16px 0;
  position:sticky; top:0; height:100vh; overflow-y:auto; overflow-x:hidden;
}
.sh-logo { display:flex; align-items:center; gap:10px; padding:0 16px 16px; }
.sh-logo-mark {
  width:28px; height:28px; border-radius:6px; flex-shrink:0;
  background:var(--sh-ink); color:var(--sh-bg);
  display:flex; align-items:center; justify-content:center;
  font-family:'Newsreader',Georgia,serif; font-weight:500; font-size:15px;
}
.sh-logo-name {
  font-family:'Newsreader',Georgia,serif; font-weight:500; font-size:16px;
  letter-spacing:-.01em; white-space:nowrap; color:var(--sh-ink);
}

.sh-brandpick {
  margin:0 12px 24px; padding:9px 11px; width:calc(100% - 24px);
  display:flex; align-items:center; gap:9px; text-align:left; cursor:default;
  background:var(--sh-surface); border:1px solid var(--sh-line); border-radius:8px;
  font-family:inherit;
}
.sh-bdot { width:7px; height:7px; border-radius:50%; background:var(--sh-ok); flex-shrink:0; }
.sh-bname {
  flex:1; min-width:0; font-size:13.5px; font-weight:500; color:var(--sh-ink);
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}

.sh-group { margin-bottom:24px; }
.sh-grouphead {
  font-size:10.5px; font-weight:600; text-transform:uppercase; letter-spacing:.12em;
  color:var(--sh-ink3); padding:0 16px 8px; white-space:nowrap;
}
.sh-nav {
  display:flex; align-items:center; gap:11px; width:calc(100% - 24px);
  margin:1px 12px; padding:9px 11px; text-align:left; cursor:pointer;
  background:transparent; border:none; border-radius:7px;
  font-family:inherit; font-size:14px; color:var(--sh-ink2); text-decoration:none;
}
.sh-nav:hover { background:var(--sh-sel); color:var(--sh-ink); }
.sh-nav.on { background:var(--sh-sel); color:var(--sh-ink); font-weight:500; }
.sh-nav svg { width:17px; height:17px; flex-shrink:0; opacity:.85; }
.sh-navtx { white-space:nowrap; overflow:hidden; }
.sh-soon {
  margin-left:auto; font-size:9.5px; font-weight:600; letter-spacing:.08em;
  text-transform:uppercase; color:var(--sh-ink3);
}
.sh-foot { margin-top:auto; padding-top:16px; border-top:1px solid var(--sh-line); }

/* collapsed rail */
body.sh-body.sh-mini .sh-logo-name,
body.sh-body.sh-mini .sh-navtx,
body.sh-body.sh-mini .sh-bname,
body.sh-body.sh-mini .sh-soon { display:none; }
body.sh-body.sh-mini .sh-nav { justify-content:center; padding:10px 0; gap:0; }
body.sh-body.sh-mini .sh-brandpick { justify-content:center; padding:9px 0; }
body.sh-body.sh-mini .sh-logo { justify-content:center; padding:0 0 16px; }
body.sh-body.sh-mini .sh-grouphead {
  height:1px; padding:0; margin:0 12px 8px; overflow:hidden;
  text-indent:-999px; background:var(--sh-line);
}

/* ---------- main column ---------- */
.sh-main { display:flex; flex-direction:column; min-width:0; }
.sh-head {
  display:flex; align-items:center; justify-content:space-between; gap:16px;
  padding:16px 24px; border-bottom:1px solid var(--sh-line);
  background:var(--sh-bg); position:sticky; top:0; z-index:30;
}
.sh-head-left { display:flex; align-items:center; gap:12px; min-width:0; }
.sh-burger {
  width:34px; height:34px; border-radius:7px; cursor:pointer; flex-shrink:0;
  background:transparent; border:1px solid var(--sh-line2); color:var(--sh-ink2);
  display:inline-flex; align-items:center; justify-content:center;
}
.sh-burger:hover { background:var(--sh-surface2); color:var(--sh-ink); }
.sh-htitle {
  font-family:'Newsreader',Georgia,serif; font-weight:500; font-size:21px;
  letter-spacing:-.01em; color:var(--sh-ink); margin:0;
}
.sh-hsub { font-size:13px; color:var(--sh-ink3); margin-top:1px; }

/* position:relative anchors the mode menu below the pill */
.sh-head-right { display:flex; align-items:center; gap:12px; position:relative; }

.sh-avatar {
  width:34px; height:34px; border-radius:50%; cursor:pointer; flex-shrink:0;
  background:var(--sh-accent); color:var(--sh-bg); border:none;
  font-family:inherit; font-size:13px; font-weight:600;
}

/* main.css styles .platform-button with a neon look that doesn't belong
   in this header. The login button carries that class for main.js. */
.sh-head-right #authButton {
  display:inline-flex; align-items:center; gap:7px;
  padding:9px 16px; border-radius:7px; cursor:pointer;
  background:var(--sh-ink); color:var(--sh-bg);
  border:none; box-shadow:none; text-shadow:none;
  font-family:inherit; font-size:13.5px; font-weight:500;
}
.sh-head-right #authButton:hover { opacity:.88; }
.sh-head-right #authButton i { width:15px; height:15px; }

/* ---------- scroll area ---------- */
/* Column flex keeps the footer at the bottom instead of floating to the
   top when a screen is empty. */
.sh-scroll {
  flex:1; overflow-y:auto; padding:24px;
  display:flex; flex-direction:column;
}
.sh-page { max-width:860px; margin:0 auto; width:100%; flex:1 0 auto; }
.sh-scroll > .social-links { margin-top:48px; }
.sh-scroll > .footer-links { padding-bottom:24px; }

/* screens — reuses the existing .tab-content markup */
body.sh-body .tab-content { display:none; }
body.sh-body .tab-content.active { display:block; }

.sh-empty {
  padding:64px 40px; text-align:center;
  background:var(--sh-surface); border:1px solid var(--sh-line); border-radius:10px;
}
.sh-empty h3 {
  font-family:'Newsreader',Georgia,serif; font-weight:500; font-size:22px;
  margin:0 0 10px; color:var(--sh-ink);
}
.sh-empty p {
  font-size:14.5px; color:var(--sh-ink3); max-width:440px;
  margin:0 auto; line-height:1.6;
}
.sh-etag {
  display:inline-block; font-size:11px; font-weight:600; letter-spacing:.1em;
  text-transform:uppercase; color:var(--sh-ink3);
  padding:4px 10px; border:1px solid var(--sh-line2); border-radius:999px; margin-bottom:16px;
}

/* ---------- mode pill + menu ---------- */
.sh-mode {
  display:inline-flex; align-items:center; gap:8px; padding:8px 14px;
  border-radius:999px; border:1px solid var(--sh-line2); background:transparent;
  font-family:inherit; font-size:13.5px; color:var(--sh-ink); cursor:pointer;
}
.sh-mode:hover { background:var(--sh-surface2); }
.sh-mdot { width:7px; height:7px; border-radius:50%; background:var(--sh-ok); }
.sh-mnote { color:var(--sh-ink3); font-size:12.5px; }

.sh-modemenu {
  position:absolute; top:calc(100% + 10px); right:0; z-index:200;
  width:320px; padding:6px;
  background:var(--sh-bg); border:1px solid var(--sh-line2);
  border-radius:10px; box-shadow:0 10px 30px rgba(0,0,0,.16);
}
[data-theme="dark"] .sh-modemenu { box-shadow:0 10px 30px rgba(0,0,0,.5); }

.sh-modemenu-head {
  font-size:10.5px; font-weight:600; letter-spacing:.12em; text-transform:uppercase;
  color:var(--sh-ink3); padding:10px 12px 8px;
}
.sh-modeopt {
  display:block; width:100%; text-align:left; cursor:pointer;
  padding:11px 12px; border:none; border-radius:7px; background:transparent;
  font-family:inherit; color:var(--sh-ink);
}
.sh-modeopt:hover, .sh-modeopt.on { background:var(--sh-sel); }
.sh-modeopt-top {
  display:flex; align-items:baseline; justify-content:space-between; gap:10px;
  margin-bottom:3px;
}
.sh-modeopt-name { font-size:14.5px; font-weight:500; }
.sh-modeopt-now {
  font-size:10px; font-weight:600; letter-spacing:.08em; text-transform:uppercase;
  color:var(--sh-ok);
}
.sh-modeopt-blurb { display:block; font-size:12.5px; line-height:1.5; color:var(--sh-ink3); }
.sh-modemenu-foot { font-size:12.5px; color:var(--sh-ink3); padding:0 12px; }
.sh-modemenu-foot:not(:empty) { padding:8px 12px 10px; }

@media (max-width:640px) {
  .sh-scroll { padding:16px; }
  .sh-mnote { display:none; }
  .sh-modemenu { width:min(320px, calc(100vw - 32px)); }
}

/* A screen can claim the viewport instead of flowing into the scroll area */
body.sh-body .sh-scroll:has(> .sh-page > .tab-content.active > .ib-app) {
  overflow:hidden; padding:0;
}
.sh-page.sh-wide { max-width:none; height:100%; }
.sh-page.sh-wide > .tab-content.active { height:100%; display:flex; flex-direction:column; }


.sh-main { display:flex; flex-direction:column; min-width:0; height:100vh; min-height:0; }
.sh-scroll { flex:1 1 auto; overflow-y:auto; padding:24px; min-height:0; }



/* main.css sizes the avatar for the old header; the initial ends up
   clipped by the circle */
.sh-head-right .sh-avatar,
.sh-head-right .avatar-button {
  width:34px !important; height:34px !important;
  padding:0 !important; border-radius:50% !important;
  display:inline-flex !important; align-items:center !important;
  justify-content:center !important;
  background:var(--sh-accent) !important; color:var(--sh-bg) !important;
  border:none !important; box-shadow:none !important; overflow:hidden;
  font-family:'Inter', system-ui, sans-serif !important;
  font-size:13px !important; font-weight:600 !important; line-height:1 !important;
}
.sh-head-right .sh-avatar .avatar,
.sh-head-right .avatar-button .avatar {
  width:auto !important; height:auto !important;
  background:none !important; border-radius:0 !important;
  display:contents !important;
}