/* Site-owned. Ported 2026-09-19 from the Claude Design handoff
 * (design_handoff_cognatype_system). Every visual value on the personal-interface routes comes from here. */

/* ============================================================
   CognaType signed-in shell
   Depends on design-system.css for all tokens.
   ============================================================ */

.ct-skip {
  position: absolute;
  left: var(--ct-space-4);
  top: -60px;
  z-index: 60;
  padding: var(--ct-space-2) var(--ct-space-4);
  background: var(--ct-bg-surface);
  border-radius: var(--ct-radius-sm);
  font-weight: var(--ct-weight-semibold);
  transition: top var(--ct-motion-fast) var(--ct-motion-ease);
}
.ct-skip:focus { top: var(--ct-space-2); }

/* ---------- Top bar ---------- */

.ct-topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: var(--ct-space-4);
  min-height: var(--ct-topbar-height);
  padding: 0 var(--ct-space-6);
  background: var(--ct-bg-topbar);
  color: var(--ct-text-inverse);
}

.ct-wordmark {
  display: inline-flex;
  align-items: baseline;
  gap: var(--ct-space-2);
  color: var(--ct-text-inverse);
  text-decoration: none;
  font-family: var(--ct-font-display);
  font-size: var(--ct-text-xl);
  font-weight: var(--ct-weight-regular);
  letter-spacing: var(--ct-tracking-tight);
}
.ct-wordmark span {
  font-family: var(--ct-font-body);
  font-size: var(--ct-text-2xs);
  font-weight: var(--ct-weight-bold);
  letter-spacing: var(--ct-tracking-eyebrow);
  color: var(--ct-text-inverse-muted);
}
.ct-wordmark:hover { color: var(--ct-text-inverse); }
.ct-wordmark:hover span { color: var(--ct-text-inverse-muted); }

.ct-topnav { display: flex; align-items: center; gap: var(--ct-space-5); justify-self: center; position: relative; }
.ct-topnav a,
.ct-topnav button {
  display: inline-flex;
  align-items: center;
  gap: var(--ct-space-1);
  min-height: 44px;
  padding: 0 var(--ct-space-1);
  border: 0;
  background: none;
  color: var(--ct-text-inverse);
  font: inherit;
  font-size: var(--ct-text-base);
  text-decoration: none;
  cursor: pointer;
  border-bottom: var(--ct-border-width-thick) solid transparent;
}
.ct-topnav a:hover,
.ct-topnav button:hover { color: var(--ct-text-inverse); border-bottom-color: var(--ct-text-inverse-muted); }
.ct-topnav a[aria-current="page"] { border-bottom-color: var(--ct-text-inverse); font-weight: var(--ct-weight-semibold); }
.ct-topnav :focus-visible { outline-color: var(--ct-text-inverse); }

.ct-topbar-right { display: flex; align-items: center; gap: var(--ct-space-3); justify-self: end; }

/* Header coherence fix item 3 (Jody, 2026-09-21): .ct-topbar-right's two children (the search
   box and the signed-in name/menu trigger) both default to flex-shrink: 1, so a narrow row
   shrinks both -- which wrapped the name onto two lines long before the search box had given
   up any real space. [data-ct-auth] is the flex item that actually holds the trigger
   (chrome.js's renderMemberAuth replaces its innerHTML in place; the span itself never
   changes), so pinning it here keeps the whole control at its natural width and pushes all the
   shrinking onto .chrome-search below. There is room for this: the topnav here is only
   Dashboard and Explore, nothing like the public header's four-plus-CTA row. */
[data-ct-auth] { flex-shrink: 0; }

/* Reused chrome-search (T-196 item 4, 2026-09-21). cms.css owns this class's rules on the
   public pages, but cms.css is vendored and not loaded here, so the member routes need their
   own copy: sizing plus the same JS-off-honesty gate cms.css uses (hidden until search.js
   stamps data-cms-bound). .ms maps to Material Symbols here too, since personal-interface.css
   is forbidden from styling .ms (the retired icon-face shim; see its own test).
   max-width (Header coherence fix item 3) bounds it to the same 220px its flex-basis already
   prefers, so it never grows past that, and lets it shrink first per the [data-ct-auth] rule
   above. */
.chrome-search {
  position: relative;
  display: none;
  flex: 0 1 220px;
  max-width: 220px;
  min-width: 0;
}
.chrome-search[data-cms-bound="1"] { display: flex; align-items: center; }
.chrome-search .ms {
  font-family: 'Material Symbols Rounded';
  font-weight: normal;
  font-style: normal;
  line-height: 1;
  position: absolute;
  left: var(--ct-space-3);
  top: 50%;
  transform: translateY(-50%);
  font-size: 18px;
  color: var(--ct-text-inverse-muted);
  pointer-events: none;
}
.chrome-search input {
  width: 100%;
  background: var(--ct-bg-topbar);
  border: var(--ct-border-width) solid var(--ct-border-inverse, var(--ct-text-inverse-muted));
  color: var(--ct-text-inverse);
  border-radius: var(--ct-radius-sm);
  padding: var(--ct-space-2) var(--ct-space-3) var(--ct-space-2) var(--ct-space-7);
  font-family: var(--ct-font-body);
  font-size: var(--ct-text-sm);
}
.chrome-search-drop {
  position: absolute;
  top: calc(100% + var(--ct-space-2));
  left: 0;
  right: 0;
  background: var(--ct-bg-surface);
  color: var(--ct-text-primary);
  border: var(--ct-border-width) solid var(--ct-border-subtle);
  border-radius: var(--ct-radius-md);
  box-shadow: var(--ct-shadow-pop, 0 8px 24px rgba(0, 0, 0, 0.22));
  overflow: hidden;
  z-index: 60;
}
.chrome-search-row {
  display: grid;
  grid-template-columns: 4px 1fr auto;
  align-items: center;
  gap: var(--ct-space-3);
  padding: var(--ct-space-3);
  text-decoration: none;
  color: var(--ct-text-primary);
  border-bottom: var(--ct-border-width) solid var(--ct-border-subtle);
}
.chrome-search-bar { width: 4px; height: 26px; border-radius: 2px; background: var(--ct-border-strong); }
.chrome-search-txt { display: grid; gap: 2px; min-width: 0; }
.chrome-search-title { font-weight: var(--ct-weight-semibold); }
.chrome-search-desc { font-size: var(--ct-text-xs); color: var(--ct-text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chrome-search-pill { font-size: var(--ct-text-2xs); text-transform: uppercase; letter-spacing: var(--ct-tracking-eyebrow); color: var(--ct-text-secondary); border: var(--ct-border-width) solid var(--ct-border-subtle); border-radius: var(--ct-radius-pill); padding: 2px var(--ct-space-3); }
.chrome-search-none { padding: var(--ct-space-4); font-size: var(--ct-text-sm); color: var(--ct-text-secondary); }

.ct-iconbtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px; height: 44px;
  border: 0;
  border-radius: var(--ct-radius-pill);
  background: none;
  color: var(--ct-text-inverse);
  cursor: pointer;
}
.ct-iconbtn:hover { background: rgba(255, 255, 255, 0.12); }
.ct-iconbtn:focus-visible { outline-color: var(--ct-text-inverse); }

.ct-search { display: flex; align-items: center; gap: var(--ct-space-2); }
.ct-search input {
  width: 0;
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: var(--ct-radius-pill);
  background: rgba(255, 255, 255, 0.12);
  color: var(--ct-text-inverse);
  font: inherit;
  font-size: var(--ct-text-sm);
  opacity: 0;
  transition: width var(--ct-motion-base) var(--ct-motion-ease), opacity var(--ct-motion-base) var(--ct-motion-ease);
}
.ct-search input::placeholder { color: var(--ct-text-inverse-muted); }
.ct-search[data-open="true"] input {
  width: 190px;
  padding: var(--ct-space-2) var(--ct-space-4);
  opacity: 1;
}

.ct-usermenu {
  display: inline-flex;
  align-items: center;
  gap: var(--ct-space-2);
  min-height: 44px;
  padding: 0 var(--ct-space-2);
  border: 0;
  border-radius: var(--ct-radius-pill);
  background: none;
  color: var(--ct-text-inverse);
  font: inherit;
  cursor: pointer;
  /* Header coherence fix item 3 (Jody, 2026-09-21): pairs with [data-ct-auth]'s
     flex-shrink: 0 above so the signed-in name never wraps onto a second line. */
  white-space: nowrap;
}
.ct-usermenu:hover { background: rgba(255, 255, 255, 0.12); }
.ct-usermenu:focus-visible { outline-color: var(--ct-text-inverse); }
.ct-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px; height: 32px;
  border-radius: 50%;
  /* White disc, navy initial, in BOTH modes: it sits on the navy bar. Tokens that flip
     with the mode (bg-surface, text-primary) put a dark disc on the dark bar. */
  background: var(--ct-text-inverse);
  color: var(--ct-bg-topbar);
  font-weight: var(--ct-weight-bold);
  font-size: var(--ct-text-base);
}

/* Dropdown menus */
.ct-menu {
  position: absolute;
  top: calc(100% - 4px);
  min-width: 220px;
  padding: var(--ct-space-2);
  border: var(--ct-border-width) solid var(--ct-border-subtle);
  border-radius: var(--ct-radius-md);
  background: var(--ct-bg-surface);
  box-shadow: var(--ct-shadow-3);
  z-index: 50;
}
.ct-menu[hidden] { display: none; }
.ct-menu a {
  display: flex;
  align-items: center;
  gap: var(--ct-space-3);
  padding: var(--ct-space-2) var(--ct-space-3);
  border-radius: var(--ct-radius-sm);
  color: var(--ct-text-primary);
  text-decoration: none;
  font-size: var(--ct-text-base);
}
.ct-menu a:hover { background: var(--ct-bg-hover); color: var(--ct-text-link); }
.ct-menu--explore { left: 50%; transform: translateX(-30%); }
.ct-menu--user { right: var(--ct-space-6); top: calc(var(--ct-topbar-height) - 4px); }

/* ---------- Body grid ---------- */

.ct-body-grid {
  display: grid;
  grid-template-columns: var(--ct-rail-width) minmax(0, 1fr) var(--ct-context-width);
  align-items: start;
  min-height: calc(100vh - var(--ct-topbar-height));
}

/* Pages without a right rail (Account) */
.ct-body-grid--wide { grid-template-columns: var(--ct-rail-width) minmax(0, 1fr); }
.ct-body-grid--wide .ct-content-inner { max-width: 1180px; }

/* ---------- Left rail ---------- */

.ct-rail {
  position: sticky;
  top: var(--ct-topbar-height);
  display: flex;
  flex-direction: column;
  gap: var(--ct-space-1);
  height: calc(100vh - var(--ct-topbar-height));
  padding: var(--ct-space-4) var(--ct-space-3);
  background: var(--ct-bg-rail);
  border-right: var(--ct-border-width) solid var(--ct-border-subtle);
}
.ct-rail a {
  display: flex;
  align-items: center;
  gap: var(--ct-space-3);
  min-height: 44px;
  padding: 0 var(--ct-space-3);
  border-radius: var(--ct-radius-md);
  color: var(--ct-text-primary);
  text-decoration: none;
  font-size: var(--ct-text-base);
}
.ct-rail a:hover { background: var(--ct-bg-hover); }
/* Widened from a[aria-current="page"] (review I1, T-201): a rail can carry both a real page
   link (aria-current="page") and, on /admin/, in-page view links marked aria-current="true"
   (admin/index.html's own showView loop) -- one nav landmark must not claim two current PAGES,
   but both kinds are still "the current thing in this list" and both should keep the
   highlight. Any aria-current value lights this rule; there is nothing else in the repo that
   relies on the narrower, page-only selector. */
.ct-rail a[aria-current] {
  background: var(--ct-bg-selected);
  font-weight: var(--ct-weight-semibold);
}
.ct-rail .material-symbols-rounded { font-size: 22px; color: var(--ct-text-secondary); }
.ct-rail a[aria-current] .material-symbols-rounded { color: var(--ct-text-link); }

.ct-tagline {
  margin-top: auto;
  padding: var(--ct-space-3);
  color: var(--ct-text-secondary);
  font-size: var(--ct-text-sm);
  line-height: var(--ct-leading-snug);
}
.ct-tagline .material-symbols-rounded {
  display: block;
  margin-bottom: var(--ct-space-2);
  font-size: 30px;
  color: var(--ct-accent-blue);
}

/* ---------- Content column ---------- */

.ct-content {
  min-width: 0;
  padding: var(--ct-space-6) var(--ct-space-7) var(--ct-space-9);
}
.ct-content-inner { max-width: var(--ct-content-max); }

/* Hero: page title block on the left, photo slot at the top right */
.ct-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--ct-space-6);
  align-items: stretch;
  margin-bottom: var(--ct-space-6);
}
.ct-hero-media { display: flex; }
.ct-hero-media > .ct-image-slot { flex: 1; aspect-ratio: auto; min-height: 200px; }
.ct-hero-copy { display: flex; flex-direction: column; gap: var(--ct-space-3); padding-top: var(--ct-space-1); }
.ct-hero-copy .ct-page-title { margin-top: var(--ct-space-1); }

.ct-section { padding: var(--ct-space-7) 0; border-top: var(--ct-border-width) solid var(--ct-border-default); }
.ct-section:first-of-type { border-top: 0; }

/* One rhythm for every symbol + heading + text head: a 32px symbol column,
   16px to the text, 4px between heading and subtitle, 20px to the content. */
.ct-section-head {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  gap: var(--ct-space-4);
  align-items: start;
  margin-bottom: var(--ct-space-5);
}
.ct-section-head > .material-symbols-rounded { font-size: 26px; color: var(--ct-text-primary); margin-top: 2px; }
.ct-section-head > .ct-glyph { margin-top: 2px; }
.ct-section-head > .ct-icon-circle { margin-top: 0; }
.ct-section-head-text > p { margin: var(--ct-space-1) 0 0; }
.ct-section-head > :last-child:not(.ct-section-head-text) { justify-self: end; }
.ct-section-head .ct-btn .material-symbols-rounded,
.ct-section-head a .material-symbols-rounded {
  display: inline-block;
  font-size: 1.15em;
  color: inherit;
  text-decoration: none;
}
.ct-section-head-text { min-width: 0; }
.ct-section-head-text p { font-size: var(--ct-text-sm); color: var(--ct-text-secondary); }

/* ---------- Right rail slot ---------- */

.ct-context {
  position: sticky;
  top: var(--ct-topbar-height);
  padding: var(--ct-space-6) var(--ct-space-5);
  border-left: var(--ct-border-width) solid var(--ct-border-subtle);
}
.ct-context-title {
  margin: 0 0 var(--ct-space-3);
  padding-bottom: var(--ct-space-2);
  border-bottom: var(--ct-border-width) solid var(--ct-border-default);
  font-size: var(--ct-text-2xs);
  font-weight: var(--ct-weight-bold);
  letter-spacing: var(--ct-tracking-eyebrow);
  text-transform: uppercase;
  color: var(--ct-text-link);
}
.ct-context-item {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: var(--ct-space-3);
  padding: var(--ct-space-3) 0;
  border-bottom: var(--ct-border-width) solid var(--ct-border-subtle);
}
.ct-context-item:last-of-type { border-bottom: 0; }
.ct-context-item .material-symbols-rounded { font-size: 24px; color: var(--ct-text-secondary); }
.ct-context-item b { display: block; font-size: var(--ct-text-base); font-weight: var(--ct-weight-semibold); }
.ct-context-item span { display: block; font-size: var(--ct-text-sm); color: var(--ct-text-secondary); }

/* ---------- Responsive ---------- */

@media (max-width: 1180px) {
  .ct-body-grid { grid-template-columns: var(--ct-rail-width) minmax(0, 1fr); }
  .ct-context {
    grid-column: 2;
    position: static;
    max-width: var(--ct-content-max);
    margin: 0 var(--ct-space-6);
    padding: var(--ct-space-6) 0;
    border-left: 0;
    border-top: var(--ct-border-width) solid var(--ct-border-default);
  }
  .ct-content { padding: var(--ct-space-6) var(--ct-space-6) var(--ct-space-8); }
}

@media (max-width: 860px) {
  .ct-topbar { grid-template-columns: minmax(0, 1fr) auto; padding: 0 var(--ct-gutter); gap: var(--ct-space-2); }
  .ct-topnav { display: none; }
  .ct-menu--user { right: var(--ct-gutter); }

  .ct-body-grid { grid-template-columns: minmax(0, 1fr); }
  /* The 1180px block pins the right rail to column 2; left in force here it creates an
     implicit second column beside the collapsed left rail (seen 2026-09-19 on every route
     that has an aside). Both rails span the single column. */
  .ct-rail, .ct-context { grid-column: 1 / -1; }

  /* Left rail collapses to a horizontal strip */
  .ct-rail {
    position: static;
    flex-direction: row;
    align-items: center;
    gap: var(--ct-space-2);
    height: auto;
    padding: var(--ct-space-2) var(--ct-gutter);
    overflow-x: auto;
    border-right: 0;
    border-bottom: var(--ct-border-width) solid var(--ct-border-subtle);
  }
  .ct-rail a { white-space: nowrap; }
  .ct-tagline { display: none; }
  .ct-tagline--footer { display: block; margin-top: var(--ct-space-7); }

  .ct-content { padding: var(--ct-space-5) var(--ct-gutter) var(--ct-space-8); }
  .ct-context { padding: var(--ct-space-5) var(--ct-gutter); }

  .ct-hero { grid-template-columns: minmax(0, 1fr); }
  .ct-hero-media { order: -1; }
  .ct-hero-media > .ct-image-slot { aspect-ratio: var(--ct-hero-ratio); min-height: 0; }
  .ct-page-title { font-size: var(--ct-text-3xl); }

  .ct-row { grid-template-columns: 32px minmax(0, 1fr); gap: var(--ct-space-3); }
  .ct-row-body { grid-column: 1 / -1; }
  .ct-row-action { grid-column: 1 / -1; justify-self: start; flex-wrap: wrap; }

  .ct-windows { grid-template-columns: repeat(2, 1fr); }
  .ct-windows-scale { display: none; }
}

.ct-tagline--footer { display: none; }
