: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;
}
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-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;
}
.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);
}

/* ---------- 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 {
  margin: 12px 4px 4px;
  font-size: 12px;
  font-weight: 700;
  color: #93a4c7;
}
.convo {
  padding: 9px 11px;
  border-radius: 9px;
  font-size: 14px;
  cursor: pointer;
  color: #d4ddef;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background 0.1s;
}
.convo:hover {
  background: rgba(255, 255, 255, 0.07);
}
.convo.active {
  background: var(--blue);
  color: #fff;
}
.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;
}
.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;
}
.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;
}
.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 {
  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;
}

/* ---------- 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;
  align-items: flex-end;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 8px;
  box-shadow: var(--shadow);
}
.composer-form:focus-within {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
.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;
}
.tag-pill {
  font-size: 12px;
  background: var(--blue-soft);
  color: var(--blue-dark);
  border-radius: 999px;
  padding: 2px 10px;
  text-transform: capitalize;
}
.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;
}
.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;
}
.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;
  }
}
