:root {
  --blue: #2563eb;
  --blue-dark: #1d4ed8;
  --blue-soft: #eaf1ff;
  --navy: #0e1b39;
  --navy-2: #16264c;
  /* CyBehave accents (approximate brand green + orange) */
  --green: #1aa64b;
  --green-soft: #e7f6ec;
  --orange: #f08a24;
  --orange-soft: #fdf0e1;
  --bg: #f6f8fc;
  --ink: #16223b;
  --muted: #6a7589;
  --line: #e6ebf3;
  --white: #fff;
  --danger: #b42318;
  --ok: #1a7f37;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 30, 60, 0.04), 0 8px 24px rgba(16, 30, 60, 0.06);
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}
* {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
}
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}
button {
  font: inherit;
  cursor: pointer;
}
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
.hidden {
  display: none !important;
}

/* Floating "Claude is having problems" pill (top-right), opens status page. */
.llm-pill {
  position: fixed;
  top: 14px;
  right: 16px;
  z-index: 1200;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 0;
  border-radius: 999px;
  background: #f08a24;
  color: #fff;
  font-weight: 650;
  font-size: 13px;
  box-shadow: 0 6px 18px rgba(16, 30, 60, 0.18);
}
.llm-pill.crit {
  background: #d3392c;
}
.llm-pill:hover {
  filter: brightness(0.96);
}
.llm-pill .llm-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.3);
}
.llm-pill .llm-arrow {
  opacity: 0.85;
}

/* ---------- Demo role switcher (demo org only) ---------- */
.demo-switch {
  position: fixed;
  bottom: 16px;
  right: 16px;
  z-index: 1300;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  font-family: var(--font);
}
.demo-switch-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid var(--orange);
  border-radius: 999px;
  background: var(--white);
  color: var(--ink);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(16, 30, 60, 0.18);
}
.demo-switch-toggle:hover {
  border-color: var(--blue);
}
.demo-switch-tag {
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--orange);
  color: var(--white);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.demo-switch-caret {
  color: var(--muted);
}
.demo-switch-menu {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 6px;
  min-width: 220px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.demo-switch-menu.hidden {
  display: none;
}
.demo-switch-opt {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  padding: 8px 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}
.demo-switch-opt:hover:not(:disabled) {
  background: var(--blue-soft);
}
.demo-switch-opt.active {
  background: var(--orange-soft);
  cursor: default;
}
.demo-switch-role {
  font-weight: 600;
  font-size: 13px;
}
.demo-switch-email {
  font-size: 11px;
  color: var(--muted);
}
.demo-switch-err {
  padding: 6px 10px;
  color: var(--danger);
  font-size: 12px;
}
.demo-switch-err.hidden {
  display: none;
}

a {
  cursor: pointer;
}

/* ---------- Brand / buttons ---------- */
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.logo {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: linear-gradient(150deg, #3b82f6, #1e3a8a);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 20px;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
  flex: none;
}
.brand-name {
  font-weight: 800;
  font-size: 19px;
  letter-spacing: -0.01em;
}
.brand-by {
  font-size: 12px;
  color: var(--muted);
}

.btn {
  border: 0;
  border-radius: 10px;
  font-weight: 650;
  padding: 11px 16px;
  transition:
    background 0.12s,
    transform 0.04s,
    box-shadow 0.12s;
}
.btn:active {
  transform: translateY(1px);
}
.btn-primary {
  background: var(--blue);
  color: #fff;
}
.btn-primary:hover {
  background: var(--blue-dark);
}
.btn-ghost {
  background: #fff;
  border: 1px solid var(--line);
  color: var(--ink);
}
.btn-ghost:hover {
  border-color: var(--blue);
  color: var(--blue-dark);
}
.btn-sm {
  padding: 5px 11px;
  font-size: 13px;
  font-weight: 600;
}
.btn-block {
  width: 100%;
}
.btn-danger {
  background: #fdecec;
  color: var(--danger);
}

.btn-lg {
  padding: 14px 26px;
  font-size: 15px;
  border-radius: 12px;
}

/* ---------- Landing ---------- */
.landing {
  min-height: 100vh;
  background: radial-gradient(900px 420px at 50% -8%, #eaf1ff 0%, transparent 62%), var(--bg);
}
.landing-nav {
  max-width: 1080px;
  margin: 0 auto;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.nav-link-text {
  cursor: pointer;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
}
.nav-link-text:hover {
  color: var(--blue);
}
.landing-more {
  margin-top: 18px;
}
/* ---------- About / How it works ---------- */
.about {
  max-width: 760px;
  margin: 0 auto;
  padding: 8px 24px 64px;
}
.about h1 {
  font-size: 30px;
  margin: 18px 0 10px;
}
.about h2 {
  font-size: 19px;
  margin: 30px 0 8px;
}
.about p,
.about-list li {
  line-height: 1.65;
  color: #33405c;
}
.about-lead {
  font-size: 18px;
  color: var(--muted);
}
.about-list {
  padding-left: 20px;
}
.about-list li {
  margin: 8px 0;
}
.about .landing-cta {
  margin-top: 32px;
}
.about a {
  color: var(--blue);
  font-weight: 600;
  text-decoration: none;
}
.about a:hover {
  text-decoration: underline;
}
.learn-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin: 14px 0 10px;
}
.version-entry {
  border-left: 3px solid var(--blue);
  padding: 4px 0 4px 18px;
  margin-top: 8px;
}
.version-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}
.version-tag {
  font-weight: 800;
  font-size: 18px;
  color: var(--ink);
}
.version-when {
  font-size: 13px;
  color: var(--muted);
}
.compare-wrap {
  overflow-x: auto;
  margin: 14px 0 10px;
}
.compare {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  min-width: 460px;
}
.compare th,
.compare td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}
.compare thead th {
  font-size: 15px;
  font-weight: 750;
  color: var(--ink);
  border-bottom: 2px solid var(--line);
  vertical-align: top;
}
.compare thead th:not(:first-child),
.compare tbody td:not(:first-child) {
  text-align: center;
  width: 26%;
}
.compare-sub {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  margin-top: 3px;
}
.compare td.yes {
  color: var(--green);
  font-weight: 800;
}
.compare td.no {
  color: #c2cad8;
  font-weight: 700;
}
.landing-nav-actions {
  display: flex;
  gap: 10px;
}
.landing-hero {
  max-width: 760px;
  margin: 0 auto;
  padding: 40px 24px 10px;
  text-align: center;
}
.landing-logo {
  max-width: 440px;
  width: 100%;
  height: auto;
  margin: 0 auto 26px;
  display: block;
}
.landing-hero h1 {
  font-size: 40px;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0 0 16px;
}
.landing-lead {
  font-size: 17px;
  line-height: 1.6;
  color: var(--muted);
  max-width: 620px;
  margin: 0 auto 28px;
}
.landing-cta {
  display: flex;
  gap: 12px;
  justify-content: center;
}
.landing-features {
  max-width: 1000px;
  margin: 56px auto 0;
  padding: 0 24px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
}
.feat {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
}
.feat-ic {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--blue-soft);
  color: var(--blue);
  display: grid;
  place-items: center;
  margin-bottom: 14px;
}
.feat-ic svg {
  width: 22px;
  height: 22px;
}
.feat h3 {
  margin: 0 0 6px;
  font-size: 16px;
}
.feat p {
  margin: 0;
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.55;
}
.landing-foot {
  max-width: 1000px;
  margin: 56px auto 0;
  padding: 28px 24px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  border-top: 1px solid var(--line);
}
.landing-foot a {
  color: var(--blue);
  font-weight: 600;
  text-decoration: none;
}
.foot-dot {
  font-weight: 900;
  color: var(--ink);
  padding: 0 2px;
}
.landing-foot a:hover {
  text-decoration: underline;
}

/* ---------- Auth ---------- */
.auth-back {
  display: inline-block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 14px;
}
.auth-back:hover {
  color: var(--blue);
}
.auth-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: radial-gradient(1200px 500px at 50% -10%, #eaf1ff 0%, transparent 60%), var(--bg);
}
.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 34px;
  box-shadow: var(--shadow);
}
.auth-title {
  font-size: 22px;
  margin: 22px 0 4px;
}
.auth-sub {
  color: var(--muted);
  margin: 0 0 20px;
  font-size: 14px;
}
label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin: 16px 0 6px;
}
.field {
  width: 100%;
  padding: 12px 13px;
  border: 1px solid #cdd6e4;
  border-radius: 10px;
  background: #fff;
  transition:
    border 0.12s,
    box-shadow 0.12s;
}
.field::placeholder {
  color: #9aa6ba;
}
.field:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
  background: #fff;
}
.seg {
  display: flex;
  gap: 6px;
  background: #eef2f8;
  padding: 4px;
  border-radius: 10px;
}
.seg-opt {
  flex: 1;
  border: 0;
  background: transparent;
  padding: 8px;
  border-radius: 7px;
  font-weight: 600;
  color: var(--muted);
}
.seg-opt.active {
  background: #fff;
  color: var(--blue-dark);
  box-shadow: var(--shadow);
}
.btn-primary.btn-block {
  margin-top: 22px;
  padding: 13px;
}
.form-err {
  color: var(--danger);
  font-size: 13px;
  margin-top: 12px;
  min-height: 16px;
}
.auth-toggle {
  text-align: center;
  margin-top: 18px;
  font-size: 14px;
  color: var(--muted);
}
.auth-toggle a {
  color: var(--blue);
  font-weight: 600;
}

/* ---------- Shell ---------- */
.shell {
  display: grid;
  grid-template-columns: 288px 1fr;
  height: 100vh;
  /* The shell owns the viewport; the page itself never scrolls. Each column
     manages its own vertical overflow, so the menu bar always spans the full
     height and stays put while the main panel scrolls. */
  overflow: hidden;
}
.sidebar {
  background: linear-gradient(180deg, var(--navy) 0%, var(--navy-2) 100%);
  color: #c7d2e8;
  display: flex;
  flex-direction: column;
  padding: 20px 16px;
  height: 100vh;
  min-height: 0;
  overflow-y: auto;
}
.sidebar-brand {
  margin: -20px -16px 6px;
}
.menu-logo {
  width: 100%;
  display: block;
}
.btn-new {
  margin: 20px 0 8px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn-new .ic {
  font-size: 18px;
  line-height: 1;
}
.nav-section {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.nav-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #8294b8;
  margin: 12px 4px 6px;
}
.nav-add {
  background: none;
  border: 0;
  color: #8aa3d6;
  font-size: 11px;
  letter-spacing: 0;
  text-transform: none;
}
.nav-add:hover {
  color: #fff;
}
.convos {
  flex: 1;
  overflow-y: auto;
  margin-right: -6px;
  padding-right: 6px;
}
.projhead {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 12px 4px 4px;
  font-size: 12px;
  font-weight: 700;
  color: #93a4c7;
}
.projhead-name {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.proj-act {
  flex: none;
  width: 20px;
  height: 20px;
  line-height: 1;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: inherit;
  font-size: 12px;
  cursor: pointer;
  opacity: 0;
  transition:
    opacity 0.1s,
    background 0.1s;
}
.projhead:hover .proj-act {
  opacity: 0.7;
}
.proj-act:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.18);
}
.projhead.renaming .proj-act {
  display: none;
}
.proj-rename {
  flex: 1;
  min-width: 0;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 6px;
  color: #fff;
  padding: 2px 6px;
  font-size: 12px;
  font-weight: 600;
}
@media (hover: none) {
  .proj-act {
    opacity: 0.6;
  }
}
.convo {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 11px;
  border-radius: 9px;
  font-size: 14px;
  cursor: pointer;
  color: #d4ddef;
  transition: background 0.1s;
}
.convo .convo-title {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.convo:hover {
  background: rgba(255, 255, 255, 0.07);
}
.convo.active {
  background: var(--blue);
  color: #fff;
}
.convo-del {
  flex: none;
  width: 22px;
  height: 22px;
  line-height: 1;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: inherit;
  font-size: 17px;
  cursor: pointer;
  opacity: 0;
  transition:
    opacity 0.1s,
    background 0.1s;
}
/* Rename / move actions, revealed on hover like the delete button. */
.convo-act {
  flex: none;
  width: 22px;
  height: 22px;
  line-height: 1;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: inherit;
  font-size: 13px;
  cursor: pointer;
  opacity: 0;
  transition:
    opacity 0.1s,
    background 0.1s;
}
/* Reveal on row hover; always available on touch where there is no hover. */
.convo:hover .convo-del,
.convo.active .convo-del,
.convo:hover .convo-act,
.convo.active .convo-act {
  opacity: 0.65;
}
.convo-del:hover,
.convo-act:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.18);
}
/* While renaming, the inline input takes over and the row buttons hide. */
.convo.renaming .convo-act,
.convo.renaming .convo-del {
  display: none;
}
.convo-rename {
  flex: 1;
  min-width: 0;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 6px;
  color: #fff;
  padding: 3px 6px;
  font-size: 14px;
}
@media (hover: none) {
  .convo-del,
  .convo-act {
    opacity: 0.6;
  }
}
/* Move-to-project picker (modal). */
.move-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 6px 0 4px;
}
.move-opt {
  text-align: left;
}
.move-opt.current {
  border-color: var(--blue);
  color: var(--blue-dark);
  font-weight: 700;
}
.nav-links {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  background: none;
  border: 0;
  color: #c7d2e8;
  padding: 9px 11px;
  border-radius: 9px;
  font-size: 14px;
}
.nav-link:hover {
  background: rgba(255, 255, 255, 0.07);
}
.nav-link.active {
  background: rgba(37, 99, 235, 0.28);
  color: #fff;
}
.nav-ic {
  width: 18px;
  text-align: center;
  opacity: 0.85;
}
.sidebar-foot {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.user-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13px;
  color: #c7d2e8;
  text-transform: capitalize;
}
.avatar-sm {
  position: relative;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
}
.avatar-sm::after {
  content: '';
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--green);
  border: 2px solid var(--navy-2);
}
.linkbtn {
  background: none;
  border: 0;
  color: #93a4c7;
  font-size: 13px;
}
.linkbtn:hover {
  color: #fff;
}

/* ---------- Main ---------- */
.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  height: 100vh;
  background: var(--bg);
  position: relative;
}
/* Subtle CyBehave brand accent strip. */
.main::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--blue), var(--green) 58%, var(--orange));
  z-index: 3;
}
.topbar {
  height: 64px;
  display: flex;
  align-items: center;
  padding: 0 28px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar-title {
  font-weight: 750;
  font-size: 17px;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.topbar-title > span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pill {
  font-size: 12px;
  color: var(--blue-dark);
  background: var(--blue-soft);
  border-radius: 999px;
  padding: 3px 11px;
  font-weight: 600;
  flex: none;
}
.movesel {
  margin-left: auto;
  font-size: 13px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  font-weight: 500;
}
.topbtn {
  margin-left: 8px;
  font-size: 13px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  font-weight: 600;
  color: var(--ink);
}
.topbtn:hover {
  border-color: var(--blue);
  color: var(--blue-dark);
}
.content {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 28px;
}

/* ---------- Welcome ---------- */
.welcome {
  max-width: 880px;
  margin: 0 auto;
}
.welcome-head {
  text-align: center;
  margin: 10px 0 28px;
}
.header-img {
  max-width: 460px;
  width: 100%;
  height: auto;
  display: block;
  margin: 4px auto 18px;
}
.welcome-sub {
  font-size: 19px;
  font-weight: 650;
  color: var(--ink);
  margin: 0;
}
.role-chip {
  display: inline-block;
  margin-bottom: 10px;
  padding: 3px 12px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}
.section-h {
  font-size: 15px;
  font-weight: 700;
  margin: 26px 2px 14px;
}
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
}
.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  cursor: pointer;
  transition:
    transform 0.12s,
    box-shadow 0.12s,
    border-color 0.12s;
  box-shadow: var(--shadow);
  text-align: left;
  display: flex;
  flex-direction: column;
}
.card:hover {
  transform: translateY(-3px);
  border-color: #cdd9f5;
  box-shadow: 0 10px 28px rgba(37, 99, 235, 0.12);
}
.card .ci {
  width: 42px;
  height: 42px;
  border-radius: 11px;
  background: var(--blue-soft);
  color: var(--blue);
  display: grid;
  place-items: center;
  margin-bottom: 14px;
}
.card .ci svg {
  width: 22px;
  height: 22px;
}
/* Image icons (uploaded) carry their own background, show them clean. */
.card .ci.img {
  width: 54px;
  height: 54px;
  background: none;
  padding: 0;
  border-radius: 13px;
  overflow: hidden;
}
.card .ci.img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.card h3 {
  margin: 0 0 5px;
  font-size: 15.5px;
}
.card p {
  margin: 0;
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.5;
}
.blank-row {
  margin-top: 18px;
}
.dim {
  color: var(--muted);
}

/* ---------- Chat ---------- */
.msgs {
  max-width: 800px;
  margin: 0 auto;
}
/* "How to get the best results" guidance shown in an empty conversation. */
.guide {
  border: 1px solid var(--line);
  background: var(--blue-soft);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin: 6px 0;
}
.guide h3 {
  margin: 0 0 6px;
  font-size: 15.5px;
  color: var(--ink);
}
.guide p {
  margin: 0 0 10px;
  color: var(--ink);
  line-height: 1.5;
}
.guide ul {
  margin: 0 0 12px;
  padding-left: 20px;
  color: var(--ink);
}
.guide li {
  margin: 4px 0;
  line-height: 1.45;
}
.guide .guide-ex {
  margin: 0;
  padding-top: 10px;
  border-top: 1px solid rgba(16, 30, 60, 0.08);
  color: var(--muted);
  font-style: italic;
}
.guide .guide-ex span {
  display: block;
  font-style: normal;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 2px;
}
.msg {
  display: flex;
  gap: 14px;
  margin-bottom: 22px;
}
.msg .who {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  font-weight: 700;
  flex: none;
  font-size: 12px;
}
.msg.user .who {
  background: #e7ecf6;
  color: #46546f;
}
.msg.assistant .who {
  background: linear-gradient(150deg, #3b82f6, #1e3a8a);
  color: #fff;
}
.msg .who.athena {
  width: 44px;
  height: 44px;
  background: #fff;
  border: 1px solid var(--line);
  padding: 0;
  overflow: hidden;
  border-radius: 50%;
}
.msg .who.athena img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.msg .body {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 13px;
  border-top-left-radius: 4px;
  padding: 13px 16px;
  font-size: 14.5px;
  line-height: 1.6;
  white-space: pre-wrap;
  box-shadow: var(--shadow);
}
.msg.user .body {
  background: var(--blue);
  color: #fff;
  border-color: transparent;
  border-top-left-radius: 13px;
  border-top-right-radius: 4px;
}
.msg.user {
  flex-direction: row-reverse;
}
/* ---------- Settings sub-tabs ---------- */
.subtabs {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--line);
  margin-bottom: 22px;
}
.subtab {
  border: 0;
  background: none;
  padding: 10px 14px;
  font-weight: 600;
  font-size: 14px;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.subtab:hover {
  color: var(--ink);
}
.subtab.active {
  color: var(--blue);
  border-bottom-color: var(--blue);
}

/* ---------- Plan page ---------- */
.plan-page {
  max-width: 760px;
}
.plan-hero {
  display: flex;
  gap: 20px;
  align-items: center;
  background: linear-gradient(135deg, #eef3ff, #f7f9fe);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin-bottom: 18px;
}
.plan-score {
  --score: 0;
  --pct: calc(var(--score) / 4 * 100%);
  width: 116px;
  height: 116px;
  flex: none;
  border-radius: 50%;
  /* Gradient progress arc (blue -> green) up to the score, soft track beyond. */
  background: conic-gradient(
    from -90deg,
    var(--blue) 0,
    var(--green) var(--pct),
    #e3eaf6 var(--pct) 100%
  );
  display: grid;
  place-items: center;
  box-shadow:
    0 8px 20px rgba(37, 99, 235, 0.18),
    inset 0 0 0 1px rgba(255, 255, 255, 0.6);
}
.plan-score-in {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 38%, #ffffff, #f3f7ff);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  box-shadow: inset 0 1px 3px rgba(16, 30, 60, 0.12);
}
.plan-score-num {
  font-size: 38px;
  font-weight: 800;
  color: var(--blue-dark);
  line-height: 1;
  letter-spacing: -0.5px;
}
.plan-score-den {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}
.plan-score-cap {
  font-size: 9.5px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--blue);
  font-weight: 700;
  margin-top: 2px;
}
.plan-hero-body {
  min-width: 0;
}
.plan-hero-body h1 {
  font-size: 24px;
  margin: 0 0 8px;
}
.plan-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}
.meta-chip {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 3px 11px;
}
.plan-refine {
  display: flex;
  gap: 8px;
  font-size: 13.5px;
  color: #33405c;
  line-height: 1.5;
}
.plan-refine-ic {
  flex: none;
}
.plan-actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
  flex-wrap: wrap;
}
.plan-ref {
  margin-top: 22px;
  background: var(--panel, #fff);
  border: 1px solid var(--border, #e2e6ee);
  border-radius: 12px;
  padding: 14px 18px;
}
.plan-ref > summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--ink, #1f2733);
}
.plan-ref[open] > summary {
  margin-bottom: 12px;
}
.plan-edit {
  width: 100%;
  min-height: 320px;
  font: inherit;
  line-height: 1.5;
  padding: 14px;
  border: 1px solid var(--border, #e2e6ee);
  border-radius: 10px;
  resize: vertical;
  box-sizing: border-box;
}
.plan-empty {
  text-align: center;
  padding: 40px 28px;
}
.plan-empty-ic {
  font-size: 32px;
  color: var(--blue);
  margin-bottom: 8px;
}
.plan-empty .btn {
  margin-top: 18px;
}
/* Plan section headings (promoted from the model's bold leads). */
.plan h3 {
  font-size: 16px;
  margin: 22px 0 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
}
.plan h3:first-child,
.plan > :first-child {
  margin-top: 0;
}
.plan h4 {
  font-size: 14.5px;
  margin: 16px 0 6px;
}

/* ---------- Coaching ---------- */
.coaching {
  max-width: 760px;
}
/* Space the "Add goal" button off the input row above it. */
.coaching .row + .btn {
  margin-top: 14px;
}
.nudge {
  background: var(--orange-soft);
  color: #8a4b00;
  border: 1px solid #f5d9b8;
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 16px;
  font-weight: 600;
}
.trend {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  height: 80px;
  padding: 8px 0;
}
.trend-pt {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.trend-bar {
  width: 22px;
  background: linear-gradient(180deg, #3b82f6, #1e3a8a);
  border-radius: 5px 5px 0 0;
}
.trend-v {
  font-size: 11px;
  color: var(--muted);
}
.goal {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 10px;
}
.goal-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.goal-meta {
  font-size: 12.5px;
  margin: 4px 0 8px;
}
.goal-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.goal-actions .go-note {
  flex: 1;
  min-width: 160px;
}
.badge-due {
  background: var(--orange-soft);
  color: #8a4b00;
  border-radius: 6px;
  padding: 2px 8px;
  font-size: 11.5px;
  font-weight: 700;
}
.btn-sm.danger {
  color: var(--danger);
}

/* ---------- Maturity stepped Q&A ---------- */
.mat-q {
  max-width: 640px;
}
.mat-progress {
  font-size: 12.5px;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}
.mat-q .qtext {
  margin: 0 0 16px;
  font-size: 18px;
}
.qopts {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.qopts .opt {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 14px;
  cursor: pointer;
  transition:
    border-color 0.1s,
    background 0.1s;
}
.qopts .opt:hover {
  border-color: var(--blue);
}
.qopts .opt:has(input:checked) {
  border-color: var(--blue);
  background: var(--blue-soft);
}
.mat-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
}

/* ---------- Context page ---------- */
.ctx-page {
  max-width: 760px;
}
.ctx-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.ctx-head h3 {
  margin: 0;
}
.ctx-good {
  font-size: 13px;
  color: var(--muted);
  background: var(--bg);
  border-left: 3px solid var(--line);
  padding: 8px 12px;
  border-radius: 0 8px 8px 0;
  margin: 8px 0 12px;
}
.ctx-input {
  width: 100%;
  resize: vertical;
}
.ctx-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
}
.ctx-ro {
  white-space: pre-wrap;
  line-height: 1.6;
  font-size: 14px;
}
.ctx-done {
  color: var(--green);
  font-weight: 700;
  font-size: 13px;
}
.ctx-todo {
  color: var(--muted);
  font-size: 13px;
}

/* ---------- Onboarding ---------- */
.onboard {
  max-width: 720px;
}
.onboard-chat {
  max-width: 680px;
  margin: 0 auto;
}
.ob-top {
  display: block;
  max-width: 520px;
  width: 100%;
  height: auto;
  margin: 4px auto 18px;
}
.ob-msgs {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}
.ob-form {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}
.ob-form textarea {
  flex: 1;
  resize: none;
  border: 1.5px solid #8ed1a6;
  border-radius: 12px;
  padding: 11px 14px;
  font: inherit;
  line-height: 1.5;
  max-height: 140px;
  background: #fff;
}
.ob-form textarea:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(26, 166, 75, 0.15);
}
.ob-foot {
  margin-top: 10px;
  text-align: center;
}
.ob-actions {
  display: flex;
  gap: 10px;
  margin: 4px 0;
}
.mq-opts {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.mq-opts .mq-opt {
  text-align: left;
  justify-content: flex-start;
  font-weight: 500;
}
.mq-step {
  display: block;
  font-size: 11.5px;
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}
.ob-bubble {
  max-width: 80%;
  padding: 11px 15px;
  border-radius: 14px;
  line-height: 1.5;
  font-size: 14.5px;
}
.ob-bubble.athena {
  align-self: flex-start;
  background: #fff;
  border: 1px solid var(--line);
  border-top-left-radius: 4px;
  box-shadow: var(--shadow);
}
.ob-bubble.user {
  align-self: flex-end;
  background: var(--blue);
  color: #fff;
  border-top-right-radius: 4px;
}
.ob-chip {
  margin: 0 6px 6px 0;
}
.nudge-act {
  color: #8a4b00;
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
}
.onboard textarea {
  margin-bottom: 10px;
}
.onboard-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}
#obExtractMsg {
  margin-left: 10px;
  font-size: 13px;
}

/* ---------- Billing ---------- */
.bill {
  max-width: 760px;
}
/* Billing field rows: lay fields out side by side and give the action button
   room to breathe below them. */
.bill .row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin: 4px 0 2px;
}
.bill .row > div {
  flex: 1 1 180px;
  min-width: 0;
}
.bill .row .field {
  width: 100%;
  margin-top: 5px;
}
.bill .row + .btn {
  margin-top: 18px;
}
.billhead-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.billhead-row h3 {
  margin: 0;
}
.billhead-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.bill-balance {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}
.bill-amt {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.bill-balance.low .bill-amt {
  color: var(--orange);
}
.bill-balance.neg .bill-amt {
  color: var(--danger);
}
.bill-warn {
  color: var(--orange);
  font-weight: 600;
  margin: 8px 0 0;
}
.bill-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.bill-grid > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.bill-grid .lbl {
  font-size: 12px;
  color: var(--muted);
}
.bill .tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.bill .tbl th,
.bill .tbl td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
}
.bill .tbl thead th {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}
.field-inline {
  width: 110px;
  display: inline-block;
}
/* The team-usage window selector needs room for "Last NN days" + the arrow. */
#tuDays {
  width: auto;
  min-width: 150px;
}
.sub-h {
  margin: 18px 0 8px;
  font-size: 14px;
}

/* Rendered Markdown in Athena's replies (and the maturity plan). */
.msg.assistant .body {
  white-space: normal;
}
.typing {
  color: var(--muted);
  animation: typing-blink 1s steps(2, start) infinite;
}
.typing-dots {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  padding: 2px 0;
}
.typing-dots span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted);
  display: inline-block;
  animation: typing-bounce 1.2s infinite ease-in-out;
}
.typing-dots span:nth-child(2) {
  animation-delay: 0.15s;
}
.typing-dots span:nth-child(3) {
  animation-delay: 0.3s;
}
@keyframes typing-bounce {
  0%,
  60%,
  100% {
    transform: translateY(0);
    opacity: 0.4;
  }
  30% {
    transform: translateY(-4px);
    opacity: 1;
  }
}
@keyframes typing-blink {
  to {
    opacity: 0.3;
  }
}
.md-body h1,
.md-body h2,
.md-body h3,
.md-body h4,
.msg.assistant .body h1,
.msg.assistant .body h2,
.msg.assistant .body h3,
.msg.assistant .body h4 {
  line-height: 1.3;
  margin: 14px 0 8px;
  font-weight: 700;
}
.msg.assistant .body h1 {
  font-size: 19px;
}
.msg.assistant .body h2 {
  font-size: 17px;
}
.msg.assistant .body h3 {
  font-size: 15.5px;
}
.msg.assistant .body h4 {
  font-size: 14.5px;
}
.msg.assistant .body > :first-child,
.plan > :first-child {
  margin-top: 0;
}
.msg.assistant .body p,
.plan p {
  margin: 0 0 10px;
}
.msg.assistant .body ul,
.msg.assistant .body ol,
.plan ul,
.plan ol {
  margin: 0 0 10px;
  padding-left: 22px;
}
.msg.assistant .body li,
.plan li {
  margin: 3px 0;
}
.msg.assistant .body code,
.plan code {
  background: #eef1f7;
  border-radius: 5px;
  padding: 1px 5px;
  font-size: 0.9em;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.msg.assistant .body pre,
.plan pre {
  background: #0e1b39;
  color: #e8eefc;
  border-radius: 10px;
  padding: 12px 14px;
  overflow-x: auto;
  margin: 0 0 10px;
}
.msg.assistant .body pre code,
.plan pre code {
  background: none;
  padding: 0;
  color: inherit;
}
.msg.assistant .body blockquote,
.plan blockquote {
  margin: 0 0 10px;
  padding: 2px 12px;
  border-left: 3px solid var(--line);
  color: var(--muted);
}
.msg.assistant .body hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 14px 0;
}
.md-table {
  border-collapse: collapse;
  width: 100%;
  margin: 4px 0 12px;
  font-size: 13.5px;
  display: block;
  overflow-x: auto;
}
.md-table th,
.md-table td {
  border: 1px solid var(--line);
  padding: 7px 10px;
  text-align: left;
  vertical-align: top;
}
.md-table thead th {
  background: var(--bg);
  font-weight: 700;
}
/* Thumbs up/down feedback under a reply. */
.fb {
  display: flex;
  gap: 4px;
  margin-top: 10px;
}
.fb-btn {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  padding: 2px 8px;
  font-size: 14px;
  line-height: 1.4;
  opacity: 0.55;
  transition:
    opacity 0.1s,
    border-color 0.1s;
}
.fb-btn:hover {
  opacity: 1;
  border-color: var(--blue);
}
.fb-btn.active {
  opacity: 1;
  border-color: var(--blue);
  background: var(--blue-soft);
}

/* Reply action row: feedback + copy. */
.msg-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}
.msg-actions .fb {
  margin-top: 0;
}
.copy-btn {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  padding: 2px 10px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  line-height: 1.4;
  opacity: 0.7;
  transition:
    opacity 0.1s,
    border-color 0.1s,
    color 0.1s;
}
.copy-btn:hover {
  opacity: 1;
  border-color: var(--blue);
  color: var(--blue-dark);
}
.copy-btn.copied {
  opacity: 1;
  border-color: var(--green);
  color: var(--green);
  background: var(--green-soft);
}
.retry-btn {
  border: 1px solid var(--blue);
  background: var(--blue-soft);
  color: var(--blue-dark);
  border-radius: 8px;
  padding: 4px 12px;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
}
.retry-btn:hover {
  background: #dce8ff;
}
.retry-btn:disabled {
  opacity: 0.6;
  cursor: default;
}

/* Citations ("Sources") under a grounded reply. */
.sources {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  font-size: 13px;
}
.sources-h {
  display: block;
  font-weight: 700;
  color: var(--muted);
  font-size: 11.5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.sources ol {
  margin: 0;
  padding: 0;
  list-style: none;
}
.sources li {
  margin: 3px 0;
  line-height: 1.4;
}
.sources .src-n {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.sources a {
  color: var(--blue);
  text-decoration: none;
}
.sources a:hover {
  text-decoration: underline;
}

/* ---------- Composer ---------- */
.composer {
  border-top: 1px solid var(--line);
  background: #fff;
  padding: 14px 28px 18px;
}
.composer-form {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  gap: 10px;
  /* Vertically centre the textarea, attach and send controls. */
  align-items: center;
  background: #fff;
  /* Light brand-green border around the input box. */
  border: 1.5px solid #8ed1a6;
  border-radius: 14px;
  padding: 8px;
  box-shadow: var(--shadow);
}
.composer-form:focus-within {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(26, 166, 75, 0.15);
}
.composer textarea {
  flex: 1;
  resize: none;
  border: 0;
  outline: none;
  padding: 9px 6px;
  max-height: 160px;
  background: transparent;
  font-size: 14.5px;
  line-height: 1.5;
}
.attachbtn {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  color: var(--muted);
  cursor: pointer;
}
.attachbtn:hover {
  background: #f1f4fa;
  color: var(--blue);
}
.btn-send {
  width: 40px;
  height: 40px;
  padding: 0;
  display: grid;
  place-items: center;
  border-radius: 10px;
}
.attachstrip {
  max-width: 800px;
  margin: 0 auto 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.chip {
  font-size: 12px;
  background: #eef2f8;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 6px 4px 11px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.chip.flagged {
  background: var(--orange-soft);
  border-color: #f3d4ad;
  color: #b25b08;
}
.chip em {
  font-style: normal;
  font-weight: 600;
}
.chip button {
  border: 0;
  background: none;
  cursor: pointer;
  color: inherit;
  font-size: 15px;
  line-height: 1;
}

/* ---------- Panels / settings / maturity ---------- */
.settings {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 30px;
}
.settings-section {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.settings-section + .settings-section {
  border-top: 1px solid var(--line);
  padding-top: 28px;
}
.section-head h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 750;
  color: var(--ink);
}
.section-head p {
  margin: 4px 0 0;
  font-size: 13.5px;
  color: var(--muted);
}
.panels {
  max-width: 800px;
  margin: 0 auto;
  display: grid;
  gap: 18px;
}
.settings .panels {
  max-width: none;
  margin: 0;
}
.panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 24px;
  box-shadow: var(--shadow);
}
.panel h3 {
  margin: 0 0 10px;
  font-size: 16px;
}
.panel p {
  margin: 4px 0;
}
table.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
table.tbl th {
  text-align: left;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 8px;
  border-bottom: 1px solid var(--line);
}
table.tbl td {
  padding: 10px 8px;
  border-bottom: 1px solid #f0f3f9;
  vertical-align: middle;
}
/* Per-row action buttons wrap neatly instead of squashing into the column. */
td.row-actions-cell {
  white-space: normal;
}
.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}
.row-actions .btn-sm {
  white-space: nowrap;
}
/* Let wide tables (e.g. Team members + actions) scroll on small screens. */
.tbl-wrap {
  overflow-x: auto;
}
.tag-pill {
  font-size: 12px;
  background: var(--blue-soft);
  color: var(--blue-dark);
  border-radius: 999px;
  padding: 2px 10px;
  text-transform: capitalize;
}
.tag-pill.warn {
  background: var(--orange-soft);
  color: #8a4b00;
}

/* Team member cards (Settings > Team). */
.member-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.member {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  background: #fff;
}
.member {
  transition:
    background 0.1s,
    border-color 0.1s,
    box-shadow 0.1s;
}
.member.is-suspended {
  background: #fafbfd;
}
.member:hover {
  border-color: #c7d3e6;
  background: var(--blue-soft);
  box-shadow: var(--shadow);
}
.member-id {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1 1 220px;
}
.member-text {
  min-width: 0;
}
.member-email {
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.member-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 5px;
}
.you-chip {
  display: inline-block;
  margin-left: 8px;
  font-size: 11px;
  font-weight: 700;
  background: var(--green-soft);
  color: var(--green);
  border-radius: 999px;
  padding: 1px 8px;
  vertical-align: middle;
}
.member-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}
.icon-btn {
  width: 34px;
  height: 34px;
  flex: none;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--muted);
  cursor: pointer;
  transition:
    background 0.1s,
    border-color 0.1s,
    color 0.1s;
}
.icon-btn:hover {
  border-color: var(--blue);
  color: var(--blue-dark);
  background: var(--blue-soft);
}
.icon-btn.danger:hover {
  border-color: var(--danger);
  color: var(--danger);
  background: #fdecec;
}
.icon-btn svg {
  display: block;
}
@media (max-width: 560px) {
  .member-actions {
    justify-content: flex-start;
  }
}
.inviterow {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.sec-sub {
  margin: 6px 0;
}
.sec-sub strong {
  display: block;
  margin-bottom: 4px;
}
.sec-hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 18px 0;
}
.ok-msg {
  color: var(--green);
  font-size: 13px;
  min-height: 16px;
}
.mfa-on {
  color: var(--green);
  font-weight: 600;
}
.mfa-qr {
  width: 180px;
  height: 180px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 6px;
  background: #fff;
}
.mfa-key {
  background: #eef2f8;
  border-radius: 6px;
  padding: 2px 7px;
  font-family: ui-monospace, Menlo, monospace;
  font-size: 13px;
  word-break: break-all;
}

/* ---------- Segmented code input (OTP) ---------- */
.otp {
  display: flex;
  gap: 8px;
  margin: 10px 0 4px;
}
.otp-box {
  width: 100%;
  max-width: 52px;
  height: 56px;
  text-align: center;
  font-size: 24px;
  font-weight: 700;
  color: var(--ink);
  border: 1.5px solid #cdd6e4;
  border-radius: 12px;
  background: #fff;
  transition:
    border 0.12s,
    box-shadow 0.12s;
}
.otp-box:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.16);
}

/* ---------- MFA enrolment screen ---------- */
.enroll-intro {
  color: var(--muted);
  font-size: 14px;
  margin: 4px 0 16px;
}
.enroll-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 18px;
}
.enroll-steps li {
  display: flex;
  gap: 12px;
  font-size: 14px;
  line-height: 1.5;
}
.step-n {
  flex: 0 0 26px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--blue-soft, #eaf0ff);
  color: var(--blue);
  font-weight: 800;
  font-size: 13px;
  display: grid;
  place-items: center;
  margin-top: 1px;
}
.qr-frame {
  display: inline-flex;
  margin: 12px 0 6px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--shadow);
}
.qr-frame .mfa-qr {
  border: 0;
  padding: 0;
}
.key-toggle {
  display: inline-block;
  background: none;
  border: 0;
  padding: 0;
  color: var(--blue);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
}
.enroll-key {
  margin: 8px 0 0;
}
.enroll .btn {
  margin-top: 22px;
}
.inviterow .field {
  flex: 1;
  min-width: 150px;
}
.qblock {
  margin: 16px 0;
  padding-bottom: 14px;
  border-bottom: 1px solid #f0f3f9;
}
.qtext {
  font-weight: 600;
  margin-bottom: 9px;
}
.opt {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 14px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  margin: 5px 0;
  cursor: pointer;
}
.opt:hover {
  border-color: #cdd9f5;
}
.opt input {
  accent-color: var(--blue);
}
.plan {
  font-size: 14.5px;
  line-height: 1.65;
}
.plan strong {
  display: inline-block;
  margin-top: 10px;
  color: var(--navy);
}
.scorebar {
  display: flex;
  align-items: center;
  gap: 10px;
}
.scorebar .track {
  flex: 1;
  height: 8px;
  border-radius: 999px;
  background: #eef2f8;
  overflow: hidden;
}
.scorebar .fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--blue), var(--green));
}

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(14, 27, 57, 0.45);
  backdrop-filter: blur(2px);
  display: grid;
  place-items: center;
  z-index: 100;
  animation: fade 0.12s ease;
}
.modal {
  background: #fff;
  border-radius: 16px;
  width: 100%;
  max-width: 420px;
  padding: 24px;
  box-shadow: 0 20px 60px rgba(14, 27, 57, 0.3);
  animation: pop 0.12s ease;
}
.modal h3 {
  margin: 0 0 6px;
  font-size: 18px;
}
.modal p {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 14px;
  white-space: pre-line;
  word-break: break-word;
}
.modal .field {
  margin-bottom: 6px;
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}
.modal-err {
  color: var(--danger);
  font-size: 13px;
  min-height: 16px;
}
@keyframes fade {
  from {
    opacity: 0;
  }
}
@keyframes pop {
  from {
    transform: translateY(8px) scale(0.98);
    opacity: 0;
  }
}

@media (max-width: 720px) {
  .shell {
    grid-template-columns: 1fr;
  }
  .sidebar {
    display: none;
  }
}

/* ---------- Business context form ---------- */
.fld-label {
  display: block;
  margin: 14px 0 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}
.fld-label .dim {
  font-weight: 400;
}
.ctx-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 16px;
}
.ctx-grid .fld-label {
  margin-top: 4px;
}
.checks {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 8px 14px;
  margin-top: 2px;
}
.check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  color: var(--ink);
  cursor: pointer;
}
.check input {
  width: 15px;
  height: 15px;
  accent-color: var(--blue);
  flex: 0 0 auto;
}
.ctx-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 18px;
}
.ctx-actions .form-err,
.ctx-actions .ok-msg {
  min-height: 0;
}
@media (max-width: 720px) {
  .ctx-grid {
    grid-template-columns: 1fr;
  }
}

/* Settings > AI Provider (BYO Anthropic key). */
.tag-pill.ok {
  background: var(--green-soft);
  color: var(--ok);
}
.ai-banner {
  background: var(--orange-soft);
  color: #8a4b00;
  border: 1px solid #f3cf9e;
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 14px;
  font-size: 14px;
}
.ai-opt {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-top: 10px;
  cursor: pointer;
}
.ai-opt input {
  margin-top: 3px;
}
.ai-opt:has(input:checked) {
  border-color: var(--blue);
  background: var(--blue-soft);
}
.ai-actions {
  display: flex;
  gap: 10px;
  margin: 10px 0;
}
#ai-key-form {
  margin-top: 12px;
}
.ai-benefits {
  margin: 6px 0 0;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 14px;
}
.ai-benefits li {
  line-height: 1.45;
}
.ai-benefits li strong {
  color: var(--ink);
}
.ai-intro {
  margin: 0 0 14px;
}
.ai-benefits-note {
  margin-top: 14px;
}
