/* ============================================================
   AGENT SOLO — App shell layout (rail + sidebar + topbar)
   Pairs with shell.js. Builds on brand.css + kit.css.
   ============================================================ */
html, body { height: 100%; }
body { display: flex; overflow: hidden; margin: 0; }
.ico { width: 20px; height: 20px; display: block; } .ico.sm { width: 16px; height: 16px; } .ico.xs { width: 14px; height: 14px; } .ico.lg { width: 24px; height: 24px; }

.rail { width: 64px; flex: none; background: var(--bg-inset); border-right: 1px solid var(--border-subtle); display: flex; flex-direction: column; align-items: center; padding: 12px 0; gap: 6px; z-index: 40; }
.rail .logo { width: 40px; height: 40px; display: grid; place-items: center; margin-bottom: 6px; }
.railbtn { width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center; color: var(--text-muted); background: transparent; border: 1px solid transparent; cursor: pointer; position: relative; transition: background .15s, color .15s; }
.railbtn:hover { background: var(--bg-overlay); color: var(--text-secondary); }
.railbtn.active { background: var(--accent-surf); color: var(--accent); border-color: var(--accent-border); }
.railbtn .tip { position: absolute; left: 54px; top: 50%; transform: translateY(-50%) translateX(-4px); background: var(--bg-overlay); border: 1px solid var(--border-strong); color: var(--text-primary); font-size: 12px; font-weight: 600; padding: 5px 9px; border-radius: 7px; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .12s, transform .12s; box-shadow: var(--shadow-overlay); z-index: 60; }
.railbtn:hover .tip { opacity: 1; transform: translateY(-50%) translateX(0); }
.rail .spacer { flex: 1; }
.rail .avatar { width: 34px; height: 34px; border-radius: 10px; background: var(--bg-overlay); border: 1px solid var(--border-strong); display: grid; place-items: center; font-family: "Space Grotesk"; font-weight: 600; font-size: 13px; cursor: pointer; }

.sidebar { width: 226px; flex: none; background: var(--bg-base); border-right: 1px solid var(--border-subtle); display: flex; flex-direction: column; z-index: 39; }
.side-h { height: 60px; box-sizing: border-box; padding: 0 16px; display: flex; align-items: center; gap: 11px; border-bottom: 1px solid var(--border-subtle); }
.side-h .ai { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-surf); border: 1px solid var(--accent-border); color: var(--accent); flex: none; }
.side-h .an { font-family: "Space Grotesk"; font-weight: 600; font-size: 14.5px; }
.side-h .as { font-size: 11px; color: var(--text-muted); }
.sidenav { padding: 10px; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; flex: 1; }

.main { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; height: 100vh; }
.topbar { height: 60px; flex: none; border-bottom: 1px solid var(--border-subtle); display: flex; align-items: center; justify-content: space-between; padding: 0 18px; gap: 12px; background: var(--bg-base); }
.hamburger { display: none; width: 38px; height: 38px; border-radius: 9px; border: 1px solid var(--border-subtle); background: var(--bg-raised); color: var(--text-secondary); cursor: pointer; place-items: center; }
.siteswitch { position: relative; }
.siteswitch > button { display: flex; align-items: center; gap: 10px; background: transparent; border: 1px solid transparent; border-radius: 10px; padding: 5px 9px 5px 6px; cursor: pointer; }
.siteswitch > button:hover { background: var(--bg-raised); border-color: var(--border-subtle); }
.sitelogo { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; font-family: "Space Grotesk"; font-weight: 600; background: var(--accent-surf); color: var(--accent); border: 1px solid var(--accent-border); font-size: 13px; flex: none; }
.siteswitch .nm { font-family: "Space Grotesk"; font-weight: 600; font-size: 14px; line-height: 1.05; text-align: left; }
.siteswitch .dm { font-family: "JetBrains Mono"; font-size: 10px; color: var(--text-muted); }
.dropdown { position: absolute; top: 50px; left: 0; z-index: 70; display: none; } .dropdown.open { display: block; }
.site-item { gap: 11px !important; padding: 8px !important; }
.site-item .sl { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; font-family: "Space Grotesk"; font-weight: 600; font-size: 13px; flex: none; }
.site-item .nn { font-size: 13.5px; font-weight: 600; } .site-item .dd { font-family: "JetBrains Mono"; font-size: 10.5px; color: var(--text-muted); }
.topright { display: flex; align-items: center; gap: 9px; }
.acct { position: relative; }
.kbd { font-family: "JetBrains Mono"; font-size: 10.5px; color: var(--text-muted); border: 1px solid var(--border-strong); border-radius: 5px; padding: 1px 5px; line-height: 1.4; }

/* command / search palette (shared across all app pages) */
.searchpal { position: fixed; inset: 0; background: rgba(2,4,8,.55); backdrop-filter: blur(3px); display: none; justify-content: center; align-items: flex-start; padding-top: 12vh; z-index: 96; }
.searchpal.open { display: flex; }
.searchpal .pal { width: min(560px, 92vw); background: var(--bg-raised); border: 1px solid var(--border-strong); border-radius: 14px; box-shadow: var(--shadow-overlay); overflow: hidden; }
.searchpal .pal-in { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border-subtle); color: var(--text-muted); }
.searchpal .pal-in input { flex: 1; background: transparent; border: 0; outline: 0; color: var(--text-primary); font-family: inherit; font-size: 15px; }
.searchpal .pal-list { max-height: 326px; overflow-y: auto; padding: 8px; }
.searchpal .pal-item { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 9px; cursor: pointer; color: var(--text-secondary); font-size: 14px; }
.searchpal .pal-item > svg { flex: none; }
.searchpal .pal-item > span:first-of-type { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.searchpal .pal-item.sel { background: var(--bg-inset); color: var(--text-primary); }
.searchpal .pal-item .k { margin-left: auto; font-family: "JetBrains Mono"; font-size: 10.5px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em; }
.searchpal .pal-empty { padding: 22px; text-align: center; color: var(--text-muted); font-size: 13.5px; }

.scroll { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 26px 30px 60px; }
.page { max-width: 1180px; margin: 0 auto; }
@media (max-width: 700px){ .scroll { padding: 18px 16px 50px; } }

.phead { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.phead h1 { font-size: 27px; letter-spacing: -0.02em; margin: 0; }
.phead .psub { color: var(--text-muted); font-size: 13.5px; margin-top: 5px; }
.phead .pacts { display: flex; gap: 9px; flex-wrap: wrap; }
.blockhead { display: flex; align-items: center; justify-content: space-between; margin: 26px 0 13px; }
.blockhead .eyebrow { margin: 0; }
.blockhead a { font-size: 12.5px; display: inline-flex; align-items: center; gap: 5px; }

.scrim2 { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 88; }
@media (max-width: 900px){
  .rail { display: none; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; transform: translateX(-100%); transition: transform .25s cubic-bezier(.4,0,.2,1); box-shadow: var(--shadow-overlay); }
  .sidebar.open { transform: none; } .scrim2.open { display: block; } .hamburger { display: grid; }
}
@media (max-width: 700px){
  .topbar { padding: 0 12px; gap: 8px; }
  .topright { gap: 6px; }
  .topbar .lbl, .topbar .kbd { display: none; }
  .siteswitch > button { padding: 5px 6px; }
  .siteswitch .dm { display: none; }
}

/* shell modals (add site, enable app) */
.mscrim { position: fixed; inset: 0; background: rgba(2,4,8,.6); backdrop-filter: blur(3px); display: none; place-items: center; z-index: 95; padding: 20px; }
.mscrim.open { display: grid; }
.mmodal { background: var(--bg-raised); border: 1px solid var(--border-strong); border-radius: 16px; box-shadow: var(--shadow-overlay); width: min(460px,100%); }
.mmodal .mh { padding: 18px 20px; border-bottom: 1px solid var(--border-subtle); display: flex; justify-content: space-between; align-items: center; }
.mmodal .mb { padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.mmodal .mf { padding: 14px 20px; border-top: 1px solid var(--border-subtle); display: flex; justify-content: flex-end; gap: 9px; }
