/* Workspace shell: dark sidebar, sticky header, main column. */
.shell { min-height: 100vh; display: flex; }
.sidebar { width: 232px; background: linear-gradient(180deg, var(--sidebar-from) 0%, var(--sidebar-to) 100%); display: flex; flex-direction: column; flex-shrink: 0; padding: 22px 14px 16px; gap: 22px; position: sticky; top: 0; left: 0; height: 100vh; overflow-y: auto; overflow-x: hidden; transition: transform 0.2s ease; isolation: isolate; }
/* The large faint & behind the navigation, as on the logo. */
.sidebar::after { content: "&"; position: absolute; left: -18px; bottom: 40px; z-index: -1; font-family: var(--serif); font-style: italic; font-weight: 500; font-size: 300px; line-height: 1; color: var(--sidebar-mark); pointer-events: none; }
.sidebar .brand { padding: 2px 10px; display: flex; align-items: baseline; }
/* Sized and placed as the design's logo, measured against Screenshot.png: the & is 1.3x the D's height, its top a little
   above the D and its foot a little below the baseline, a third of the D's height away from it. */
.sidebar .brand .amp { font-size: 27px; color: var(--sidebar-amp); margin-right: 4px; position: relative; top: 1.5px; }
.sidebar .brand-word { font-size: 22px; font-weight: 700; color: var(--on-navy); letter-spacing: -0.02em; }
/* The logo keeps its colours on hover: base.css's `.brand:hover .brand-word` (the page's ink) would otherwise win here. */
.sidebar .brand:hover .brand-word { color: var(--on-navy); }
.sidebar .brand:hover .amp { color: var(--sidebar-amp); }
.ws-card { display: flex; align-items: center; gap: 10px; border: 1px solid var(--on-navy-edge); background: var(--on-navy-wash); border-radius: 9px; padding: 9px 11px; }
.ws-mark { width: 26px; height: 26px; border-radius: 7px; background: var(--accent-solid); color: var(--text-on-primary); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; flex-shrink: 0; }
.ws-name { font-size: 12.5px; font-weight: 600; color: var(--on-navy); }
.ws-meta { font-family: var(--mono); font-size: 10px; color: var(--sky-text); }
.nav-group { display: flex; flex-direction: column; gap: 1px; margin-bottom: 14px; }
.nav-title { font-family: var(--mono); font-size: 10px; color: var(--on-navy-faint); letter-spacing: 0.14em; padding: 0 10px; margin: 2px 0 5px; }
.nav-item { display: flex; align-items: center; gap: 10px; font-size: 13.5px; font-weight: 500; padding: 7px 10px; border-radius: 7px; color: var(--sky-text); text-decoration: none; }
.nav-item:hover { background: var(--on-navy-hover); color: var(--on-navy); }
.nav-item { border: 1px solid transparent; }
.nav-item.is-active { background: var(--on-navy-active); border-color: var(--on-navy-edge); color: var(--on-navy); }
.nav-item svg { flex-shrink: 0; opacity: 0.85; }
.nav-badge { margin-left: auto; font-family: var(--mono); font-size: 10px; background: rgba(255, 196, 92, 0.2); color: var(--on-navy-warn); padding: 2px 7px; border-radius: 999px; }
/* "Connect your assistant", on its own at the foot of the sidebar. */
.connect-cta { margin-top: auto; display: flex; align-items: center; gap: 11px; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--on-navy-edge); background: var(--on-navy-wash); color: var(--on-navy); text-decoration: none; backdrop-filter: blur(4px); }
.connect-cta:hover, .connect-cta.is-active { background: var(--on-navy-hover); border-color: var(--sky); }
.connect-cta svg { flex-shrink: 0; opacity: 0.85; }
.connect-cta-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; background: var(--on-navy-warn); }
.connect-cta.is-connected .connect-cta-dot { background: var(--on-navy-ok); }
.connect-cta-title { font-size: 13.5px; font-weight: 600; line-height: 1.3; }
.connect-cta-note { font-size: 11.5px; color: var(--sky-text); }

.shell-main { flex: 1; display: flex; flex-direction: column; min-width: 0; background: var(--bg); }
.shell-header { display: flex; align-items: center; gap: 12px; padding: 14px 28px; border-bottom: 1px solid var(--divider); position: sticky; top: 0; background: var(--header-bg); backdrop-filter: blur(8px); z-index: 5; }
.shell-header .search { flex: 1; max-width: 420px; padding: 9px 14px; }
.shell-header .menu-btn, .shell-header .mobile-brand { display: none; }
.menu-btn { width: 40px; height: 40px; flex: none; border: 1px solid var(--border); background: var(--surface); border-radius: 9px; align-items: center; justify-content: center; color: var(--ink); }
.me { width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(150deg, var(--avatar-from), var(--avatar-to)); color: var(--on-navy); display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; }
.shell-content { padding: 36px 44px 96px; display: flex; flex-direction: column; gap: 28px; max-width: 1200px; width: 100%; }
/* Pages that list a lot side by side use the whole width of the screen. */
.shell-content.is-wide { max-width: none; }
.nav-scrim { position: fixed; inset: 0; background: var(--scrim); z-index: 44; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-title { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; }
.page-sub { font-size: 14px; color: var(--muted); line-height: 1.55; max-width: 680px; }
.page-meta { font-family: var(--mono); font-size: 12.5px; color: var(--subtle); }
.section-title { font-size: 17px; font-weight: 600; }
.breadcrumb { font-size: 13.5px; color: var(--muted); display: flex; gap: 8px; }

/* Two-column page grids that collapse on narrow screens */
.cols-home { display: grid; grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr); gap: 24px; align-items: start; }
.cols-setup { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 24px; align-items: start; }
.cols-side { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(260px, 1fr); gap: 24px; align-items: start; }
.cols-db { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 16px; align-items: start; }

@media (max-width: 899px) {
  .sidebar { position: fixed; z-index: 45; transform: translateX(-100%); }
  .shell.nav-open .sidebar { transform: none; }
  .shell-header .menu-btn { display: flex; }
  .shell-header .mobile-brand { display: inline-flex; }
  .shell-header .mobile-brand .amp { font-size: 19px; }
  .shell-header .mobile-brand .brand-word { font-size: 17px; }
  .shell-content { padding: 28px 24px 96px; }
  .cols-home, .cols-setup, .cols-side, .cols-db { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 599px) {
  .shell-header { padding: 10px 14px; }
  .shell-header .search { display: none; }
  .shell-content { padding: 20px 14px 96px; }
}

/* Theme switch (shared/_theme_switch), in the account menu. */
.theme-switch { flex-wrap: nowrap; align-self: flex-start; }
.theme-switch .seg-item { padding: 4px 9px; font-size: 12px; }

/* The account menu, top right (shared/_account_menu). */
.account-menu { position: relative; }
.account-menu > summary { list-style: none; cursor: pointer; }
.account-menu > summary::-webkit-details-marker { display: none; }
.account-menu > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.account-menu[open] > summary { box-shadow: 0 0 0 3px var(--accent-soft); }
.account-pop { position: absolute; right: 0; top: calc(100% + 10px); width: 300px; max-width: calc(100vw - 28px); background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-pop); z-index: 30; display: flex; flex-direction: column; overflow: hidden; }
.account-who { display: flex; align-items: center; gap: 12px; padding: 16px; }
.me.me-lg { width: 40px; height: 40px; font-size: 14px; flex-shrink: 0; }
.account-role { display: flex; flex-direction: column; gap: 6px; padding: 12px 16px; border-top: 1px solid var(--row); background: var(--tint-2); }
.account-links { display: flex; flex-direction: column; padding: 6px; border-top: 1px solid var(--row); }
.account-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: 8px; font: inherit; font-size: 13.5px; color: var(--ink); text-decoration: none; background: none; border: 0; cursor: pointer; text-align: left; }
.account-item:hover { background: var(--row); }
.account-item svg { flex-shrink: 0; color: var(--muted); }
.account-theme { padding: 10px 16px; border-top: 1px solid var(--row); align-items: center; }
.account-pop form { margin: 0; padding: 6px; border-top: 1px solid var(--row); }

/* The admin area on phones and tablets (layouts/staff, .is-staff). Nothing here changes a customer page. */
/* Long emails, paths and ids wrap instead of pushing the page sideways. */
.is-staff .page-title, .is-staff .page-sub { overflow-wrap: anywhere; }
.is-staff .shell-content :not(.table-row) > span.mono { overflow-wrap: anywhere; }
/* A row of buttons wraps onto the next line. */
.is-staff .row:has(> .btn, > form.button_to, > a.btn) { flex-wrap: wrap; }
/* Tables keep room for their columns and scroll inside their box, instead of crushing columns into each other. */
@media (max-width: 599px) {
  .is-staff .table-head, .is-staff .table-row { min-width: var(--minw, 480px); }
}
