/* CommsDesk design system — TeamsPlus brand. Served at /style.css.
   Self-hosted fonts and images only; no external requests, no inline styles
   (strict CSP: default-src 'none', *-src 'self'). */
@font-face {
  font-family: "Satoshi";
  src: url("/brand/Satoshi-Regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Satoshi";
  src: url("/brand/Satoshi-Medium.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: "Satoshi";
  src: url("/brand/Satoshi-Bold.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

:root {
  --bg: #0a0a0f;
  --bg-2: #0f0f14;
  --surface: #1b1b24;
  --surface-2: #141019;
  --text: #f0f0f5;
  --muted: #9090a0;
  --muted-2: #7a7a88;
  --line: rgba(255, 255, 255, 0.07);
  --line-2: rgba(255, 255, 255, 0.12);
  --violet: #7c3aed;
  --violet-light: #c4b5fd;
  --cyan: #22d3ee;
  --blue: #528be8;
  --amber: #f0b429;
  --green: #34d399;
  --red: #fb7185;
  --grad: linear-gradient(135deg, var(--cyan), var(--violet));
  --font: "Satoshi", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --mono:
    "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --r: 16px;
  --r-sm: 10px;
  --r-pill: 999px;
  --max: 1180px;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.5), 0 12px 32px rgba(0, 0, 0, 0.4);
  --speed: 0.18s;
}

* {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 15.5px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  background-image:
    radial-gradient(
      70rem 50rem at 85% -15%,
      rgba(124, 58, 237, 0.13),
      transparent 60%
    ),
    radial-gradient(
      55rem 45rem at -15% -5%,
      rgba(34, 211, 238, 0.09),
      transparent 55%
    );
  background-attachment: fixed;
}
a {
  color: var(--violet-light);
  text-decoration: none;
}
a:hover {
  color: #fff;
}
.mono,
code,
time,
.tile-value {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}
h1 {
  font-size: clamp(1.55rem, 1.2rem + 1.4vw, 2.1rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  margin: 0;
}
h2 {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}
p {
  margin: 0.5rem 0;
}
.muted {
  color: var(--muted);
}
:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
  border-radius: 6px;
}
.skip {
  position: absolute;
  left: -999px;
}
.skip:focus {
  left: 1rem;
  top: 1rem;
  z-index: 30;
  background: var(--surface);
  padding: 0.6rem 1rem;
  border-radius: var(--r-sm);
}

/* ---- App shell ---- */
.topbar {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  padding: 0.85rem clamp(1rem, 4vw, 2.5rem);
  background: rgba(12, 12, 17, 0.82);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 20;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--text);
}
.brand:hover {
  color: var(--text);
}
.brand .mark {
  width: 40px;
  height: 40px;
}
.brand .product {
  font-weight: 700;
  font-size: 1.12rem;
  letter-spacing: -0.02em;
}
.brand .divider {
  width: 1px;
  height: 26px;
  background: var(--line-2);
}
.brand .wordmark {
  height: 24px;
  width: auto;
  opacity: 0.92;
}
.topnav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-left: auto;
  flex-wrap: wrap;
}
.topnav a,
.topnav .who {
  padding: 0.45rem 0.8rem;
  border-radius: var(--r-pill);
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 500;
}
.topnav a:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}
.topnav .who {
  color: var(--muted-2);
  font-size: 0.85rem;
}
.topnav form {
  display: inline;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
}
.menu-toggle {
  display: none;
  margin-left: auto;
  background: none;
  border: 1px solid var(--line-2);
  color: var(--text);
  border-radius: var(--r-sm);
  font-size: 0.95rem;
  padding: 0.45rem 0.8rem;
}
.demo-strip {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  font-size: 0.85rem;
  padding: 0.5rem clamp(1rem, 4vw, 2.5rem);
  background: rgba(240, 180, 41, 0.08);
  border-bottom: 1px solid rgba(240, 180, 41, 0.22);
  color: var(--amber);
}
.demo-strip a {
  color: var(--amber);
  text-decoration: underline;
}
.demo-badge {
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-size: 0.68rem;
  padding: 0.15rem 0.55rem;
  border: 1px solid currentColor;
  border-radius: var(--r-pill);
}
.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(1.25rem, 3vw, 2rem) clamp(1rem, 4vw, 2.5rem) 5rem;
}
.foot {
  max-width: var(--max);
  margin: 0 auto;
  padding: 2rem clamp(1rem, 4vw, 2.5rem);
  color: var(--muted-2);
  font-size: 0.85rem;
  border-top: 1px solid var(--line);
}

/* ---- Page header band ---- */
.pagehead {
  position: relative;
  display: flex;
  align-items: flex-end;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 1.4rem 0 1.5rem;
  margin-bottom: 0.5rem;
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}
.pagehead::before {
  content: "";
  position: absolute;
  top: -60%;
  left: -10%;
  width: 45%;
  height: 220%;
  background: radial-gradient(
    closest-side,
    rgba(124, 58, 237, 0.18),
    transparent
  );
  pointer-events: none;
}
.pagehead-text {
  position: relative;
}
.pagehead .subtitle {
  color: var(--muted);
  margin: 0.35rem 0 0;
  font-size: 0.98rem;
}
.pagehead-action {
  position: relative;
  margin-left: auto;
}

/* ---- Buttons ---- */
button,
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.6rem 1.15rem;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
  background: var(--grad);
  border: 0;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition:
    filter var(--speed),
    transform var(--speed),
    box-shadow var(--speed);
}
button:hover,
.btn:hover {
  filter: brightness(1.08);
  box-shadow: 0 8px 24px rgba(124, 58, 237, 0.35);
  color: #fff;
}
button:active,
.btn:active {
  transform: translateY(1px);
}
button.secondary,
.btn.secondary {
  background: transparent;
  border: 1px solid var(--line-2);
  color: var(--text);
}
button.secondary:hover,
.btn.secondary:hover {
  background: rgba(255, 255, 255, 0.05);
  box-shadow: none;
}
.actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  align-items: center;
  margin: 1rem 0;
}

/* ---- Stat tiles ---- */
/* Flex (not grid) so the last tile grows to fill a row rather than leaving a
   hole — at any width, including the odd tile in the 2-up phone layout. */
.tiles {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 0 0 1.5rem;
}
.tile {
  flex: 1 1 150px;
  position: relative;
  padding: 1.1rem 1.2rem;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent),
    var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
}
.tile::after {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  background: var(--grad);
  opacity: 0.7;
}
.tile-label {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 500;
}
.tile-value {
  display: block;
  font-size: 2rem;
  font-weight: 700;
  margin-top: 0.3rem;
  letter-spacing: -0.02em;
}
.tile-sub {
  color: var(--muted-2);
  font-size: 0.78rem;
}

/* ---- Cards / panels ---- */
.panel {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent),
    var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 1.25rem 1.4rem;
  margin: 1rem 0;
  box-shadow: var(--shadow);
}

/* ---- Lists ---- */
.list {
  display: grid;
  gap: 10px;
}
.row {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.4rem 1rem;
  align-items: center;
  padding: 1rem 1.25rem 1rem 1.4rem;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent),
    var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  transition:
    transform var(--speed),
    border-color var(--speed),
    box-shadow var(--speed);
}
.row::before {
  content: "";
  position: absolute;
  left: 0;
  top: 12px;
  bottom: 12px;
  width: 3px;
  border-radius: 3px;
  background: var(--muted-2);
}
.row.s-open::before {
  background: var(--cyan);
}
.row.s-in_progress::before {
  background: var(--violet);
}
.row.s-waiting_on_client::before {
  background: var(--amber);
}
.row.s-resolved::before {
  background: var(--green);
}
.row.s-closed::before {
  background: var(--muted-2);
}
.row:hover {
  transform: translateY(-2px);
  border-color: var(--line-2);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}
.row .title {
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--text);
  letter-spacing: -0.01em;
}
.row .title:hover {
  color: var(--violet-light);
}
.row .num {
  color: var(--muted-2);
  font-weight: 500;
}
.row .excerpt {
  grid-column: 1;
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 60ch;
}
.row .who {
  grid-column: 1;
  color: var(--muted-2);
  font-size: 0.82rem;
}
.row .side {
  grid-column: 2;
  grid-row: 1 / span 3;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.4rem;
  text-align: right;
}
.row .side .chips {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.row time {
  color: var(--muted-2);
  font-size: 0.8rem;
}

/* ---- Pills / chips ---- */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.65rem;
  border-radius: var(--r-pill);
  font-size: 0.76rem;
  font-weight: 600;
  border: 1px solid transparent;
  white-space: nowrap;
}
.pill::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}
.s-open {
  color: var(--cyan);
  background: rgba(34, 211, 238, 0.1);
  border-color: rgba(34, 211, 238, 0.3);
}
.s-in_progress {
  color: var(--violet-light);
  background: rgba(124, 58, 237, 0.14);
  border-color: rgba(124, 58, 237, 0.35);
}
.s-waiting_on_client {
  color: var(--amber);
  background: rgba(240, 180, 41, 0.1);
  border-color: rgba(240, 180, 41, 0.3);
}
.s-resolved {
  color: var(--green);
  background: rgba(52, 211, 153, 0.1);
  border-color: rgba(52, 211, 153, 0.3);
}
.s-closed {
  color: var(--muted);
  background: rgba(144, 144, 160, 0.08);
  border-color: var(--line);
}
.chip {
  display: inline-flex;
  align-items: center;
  padding: 0.16rem 0.6rem;
  border-radius: var(--r-pill);
  font-size: 0.76rem;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
}
.chip.urgent {
  color: var(--red);
  border-color: rgba(251, 113, 133, 0.4);
  background: rgba(251, 113, 133, 0.08);
}
.unread {
  color: var(--cyan);
  font-size: 0.72rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}
.unread::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 8px var(--cyan);
}

/* ---- Forms ---- */
label {
  display: block;
  margin: 0.9rem 0 0.3rem;
  font-weight: 500;
  font-size: 0.92rem;
}
.hint {
  color: var(--muted);
  font-size: 0.85rem;
  margin: 0.2rem 0 0;
}
input,
select,
textarea {
  width: 100%;
  max-width: 100%;
  font-family: inherit;
  font-size: 1rem;
  padding: 0.7rem 0.85rem;
  color: var(--text);
  background: var(--bg-2);
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
}
input:hover,
select:hover,
textarea:hover {
  border-color: rgba(255, 255, 255, 0.2);
}
input:focus,
select:focus,
textarea:focus {
  border-color: var(--violet);
  outline: none;
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.3);
}
textarea {
  min-height: 130px;
  resize: vertical;
}
select {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position:
    calc(100% - 20px) 55%,
    calc(100% - 15px) 55%;
  background-size:
    5px 5px,
    5px 5px;
  background-repeat: no-repeat;
  padding-right: 2.2rem;
}
form {
  margin: 1rem 0;
}
.field-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}
.field-row > label {
  flex: 1 1 12rem;
}
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: end;
}
.filters input,
.filters select {
  width: auto;
  min-width: 9rem;
  flex: 1 1 9rem;
}

/* ---- Category tiles (new request / sales) ---- */
.cat-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin: 0.4rem 0 0.5rem;
}
.cat-tile {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.85rem 1rem;
  margin: 0;
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  background: var(--bg-2);
  cursor: pointer;
  font-weight: 500;
  transition:
    border-color var(--speed),
    background var(--speed);
}
.cat-tile input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.cat-tile svg {
  width: 20px;
  height: 20px;
  color: var(--muted);
  flex: none;
}
.cat-tile:hover {
  border-color: rgba(255, 255, 255, 0.25);
}
.cat-tile:has(input:checked) {
  border-color: var(--violet);
  background: rgba(124, 58, 237, 0.12);
}
.cat-tile:has(input:checked) svg {
  color: var(--violet-light);
}
.cat-tile:has(input:focus-visible) {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

/* ---- Thread (client/staff ticket) ---- */
.thread-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 1.5rem;
  align-items: start;
}
.conversation {
  display: grid;
  gap: 1rem;
  min-width: 0;
}
.daysep {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  color: var(--muted-2);
  font-size: 0.78rem;
  margin: 0.3rem 0;
}
.daysep::before,
.daysep::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}
.msg-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.8rem;
  align-items: start;
}
.avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.82rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #2b2b3a, #1b1b24);
  border: 1px solid var(--line-2);
  flex: none;
}
.avatar.helix {
  background: var(--grad);
  padding: 7px;
}
.avatar.helix img {
  width: 100%;
  height: 100%;
}
.avatar.note {
  background: rgba(240, 180, 41, 0.18);
  color: var(--amber);
  border-color: rgba(240, 180, 41, 0.4);
}
.bubble {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent),
    var(--surface);
  border: 1px solid var(--line);
  border-radius: 4px 14px 14px 14px;
  padding: 0.8rem 1rem;
  min-width: 0;
}
.msg-row.published .bubble {
  border-color: rgba(124, 58, 237, 0.4);
  background: linear-gradient(
    180deg,
    rgba(124, 58, 237, 0.14),
    rgba(34, 211, 238, 0.05)
  );
}
.msg-row.note .bubble {
  border: 1px dashed rgba(240, 180, 41, 0.6);
  background: rgba(240, 180, 41, 0.06);
}
.msg-row.draft .bubble {
  border-style: dashed;
}
.msg-head {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  margin-bottom: 0.3rem;
}
.msg-head strong {
  font-size: 0.9rem;
  font-weight: 700;
}
.msg-row.published .msg-head strong {
  color: var(--violet-light);
}
.msg-head time,
.msg-head .lock {
  color: var(--muted-2);
  font-size: 0.76rem;
  font-weight: 500;
}
.body {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  margin: 0;
}
.details {
  position: sticky;
  top: 86px;
  padding: 1.1rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
}
.details h2 {
  margin: 0 0 0.8rem;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted-2);
}
.details dl {
  margin: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.7rem;
}
.details .pair {
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
  font-size: 0.88rem;
}
.details dt {
  color: var(--muted);
}
.details dd {
  margin: 0;
  text-align: right;
  color: var(--text);
}
.files {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1.2rem 0;
}
.filechip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.85rem;
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  font-size: 0.9rem;
}
.filechip svg {
  width: 16px;
  height: 16px;
  color: var(--muted);
}
.composer {
  position: sticky;
  bottom: 0;
  background: linear-gradient(180deg, transparent, var(--bg) 30%);
  padding-top: 0.6rem;
  margin-top: 1.2rem;
}
.composer .panel {
  margin: 0;
}
.closed {
  padding: 1.1rem 1.3rem;
  border: 1px solid rgba(240, 180, 41, 0.3);
  background: rgba(240, 180, 41, 0.06);
  border-radius: var(--r);
  color: var(--amber);
  margin-top: 1rem;
}

/* ---- Sales chat ---- */
.chat {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
  display: grid;
  gap: 0.8rem;
}
.msg {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 0.8rem 1.05rem;
}
.msg strong {
  font-size: 0.88rem;
}
/* Two-sided conversation (owner 2026-10-05): the TeamsPlus team on the left in a neutral bubble with a cyan edge,
   Helix Support replies on the right in a stronger violet/cyan fill. Notes stay full width. */
.chat > .msg.staff,
.chat > .msg.published,
.chat > .msg.draft {
  max-width: min(46rem, 88%);
}
.msg.staff {
  justify-self: start;
  border-left: 3px solid var(--cyan);
  border-radius: 4px var(--r) var(--r) var(--r);
  background:
    linear-gradient(90deg, rgba(34, 211, 238, 0.07), transparent 60%),
    var(--surface);
}
.msg.staff strong {
  color: #a5f3fc;
}
.msg.published {
  justify-self: end;
  border: 1px solid rgba(124, 58, 237, 0.6);
  border-radius: var(--r) 4px var(--r) var(--r);
  background: linear-gradient(
    135deg,
    rgba(124, 58, 237, 0.32),
    rgba(34, 211, 238, 0.12)
  );
  box-shadow: 0 8px 24px rgba(124, 58, 237, 0.2);
}
.msg.draft {
  justify-self: end;
  border-radius: var(--r) 4px var(--r) var(--r);
}
.msg.published strong {
  color: var(--violet-light);
}
.msg.published strong::before {
  content: "✦ ";
}
.msg.note {
  border: 1px dashed rgba(240, 180, 41, 0.6);
  background: rgba(240, 180, 41, 0.06);
}
.msg.note strong::before {
  content: "🔒 staff-only · ";
  color: var(--amber);
}
.msg.draft {
  border-style: dashed;
}
.msg span.muted {
  font-size: 0.78rem;
  margin-left: 0.4rem;
}

/* ---- Callout (duplicate sales hint) ---- */
.callout,
.notice {
  border: 1px solid rgba(34, 211, 238, 0.3);
  background: rgba(34, 211, 238, 0.07);
  border-radius: var(--r);
  padding: 1.1rem 1.3rem;
}
.notice.error {
  border-color: rgba(248, 113, 113, 0.45);
  background: rgba(248, 113, 113, 0.09);
  color: #fecaca;
  margin: 0 0 1rem;
}
.match {
  border: 1px solid var(--line);
  border-left: 3px solid var(--cyan);
  border-radius: var(--r);
  padding: 1rem 1.2rem;
  margin: 0.8rem 0;
}
button.primary {
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.25);
}

/* ---- Empty states ---- */
.empty {
  text-align: center;
  padding: 3.5rem 1.5rem;
  color: var(--muted);
  border: 1px dashed var(--line-2);
  border-radius: var(--r);
  background: var(--surface-2);
}
.empty svg {
  width: 64px;
  height: 64px;
  margin-bottom: 1rem;
}
.empty h2 {
  color: var(--text);
  margin: 0 0 0.3rem;
}

/* ---- Auth: split-screen hero ---- */
body.auth {
  background-image:
    radial-gradient(
      45rem 35rem at 25% -5%,
      rgba(124, 58, 237, 0.2),
      transparent 60%
    ),
    radial-gradient(
      35rem 28rem at 10% 110%,
      rgba(34, 211, 238, 0.14),
      transparent 60%
    );
}
.auth-split {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 55fr 45fr;
}
.auth-hero {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  padding: clamp(2rem, 5vw, 5rem);
  border-right: 1px solid var(--line);
}
.hero-visual {
  position: absolute;
  inset: 0;
  z-index: 0;
  opacity: 0.55;
}
.hero-visual svg {
  width: 100%;
  height: 100%;
}
.hero-visual .wave {
  fill: none;
  stroke-width: 1.5;
  opacity: 0.6;
  animation: drift 14s ease-in-out infinite;
}
.hero-visual .wave:nth-child(2) {
  animation-delay: -3s;
}
.hero-visual .wave:nth-child(3) {
  animation-delay: -6s;
}
.hero-visual .wave:nth-child(4) {
  animation-delay: -9s;
}
@keyframes drift {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-18px);
  }
}
.hero-content {
  position: relative;
  z-index: 1;
  max-width: 460px;
}
.hero-content .wordmark {
  height: clamp(40px, 6vw, 64px);
  width: auto;
  margin-bottom: 2rem;
}
.hero-headline {
  font-size: clamp(1.8rem, 1.3rem + 2vw, 2.9rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin: 0 0 1.5rem;
}
.benefits {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.9rem;
}
.benefits li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--muted);
  font-size: 1rem;
}
.benefits svg {
  width: 22px;
  height: 22px;
  color: var(--cyan);
  flex: none;
}
.auth-form {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: clamp(1.5rem, 4vw, 3rem);
}
.auth-panel {
  width: 100%;
  max-width: 400px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent),
    var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--r);
  padding: 2rem;
  box-shadow:
    0 0 0 1px rgba(124, 58, 237, 0.1),
    0 24px 60px rgba(0, 0, 0, 0.5);
}
.auth-panel h1 {
  font-size: 1.5rem;
}
.auth-panel .lead {
  color: var(--muted);
  margin: 0.4rem 0 1.2rem;
}
.auth-panel button {
  width: 100%;
  margin-top: 0.4rem;
}
.auth-foot {
  margin-top: 1.5rem;
  font-size: 0.8rem;
  color: var(--muted-2);
  text-align: center;
}
.auth-form .demo-strip {
  margin-top: 1.5rem;
  border: 1px solid rgba(240, 180, 41, 0.22);
  border-radius: var(--r-sm);
}
.reassure {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--green);
}
.reassure .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 10px var(--green);
  flex: none;
}

/* ---- Sales chat files ---- */
.chat .msg .files {
  margin: 0.6rem 0 0;
}
.chat .msg .filechip {
  background: rgba(255, 255, 255, 0.04);
}
.composer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  flex-wrap: wrap;
  margin-top: 0.6rem;
}
.composer .attach {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0;
  padding: 0.5rem 0.85rem;
  border: 1px dashed var(--line-2);
  border-radius: var(--r-sm);
  color: var(--muted);
  font-weight: 500;
  cursor: pointer;
}
.composer .attach:hover {
  border-color: var(--cyan);
  color: var(--text);
}
.composer .attach svg {
  width: 16px;
  height: 16px;
}
.composer .attach input[type="file"] {
  width: auto;
  max-width: 14rem;
  padding: 0;
  border: 0;
  background: none;
  font-size: 0.85rem;
  color: var(--muted);
}

/* ---- Helix-only marker ---- */
.only-you {
  display: inline-flex;
  align-items: center;
  margin: 0 0.5rem;
  padding: 0.08rem 0.5rem;
  border-radius: var(--r-pill);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--amber);
  background: rgba(240, 180, 41, 0.1);
  border: 1px solid rgba(240, 180, 41, 0.35);
  white-space: nowrap;
}

/* ---- Staff accounts ---- */
.page-lead {
  max-width: 62ch;
  margin: 0 0 1.25rem;
}
.panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}
.panel-head h2 {
  margin: 0;
}
.people {
  padding-bottom: 0.6rem;
}
.people-head,
.person-row {
  display: grid;
  grid-template-columns: minmax(0, 2.4fr) 6rem 7.5rem minmax(0, 1.3fr) 3.5rem;
  gap: 1rem;
  align-items: center;
}
.people-head {
  padding: 0 0.75rem 0.5rem;
  border-bottom: 1px solid var(--line);
  color: var(--muted-2);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.person {
  border-bottom: 1px solid var(--line);
}
.person:last-child {
  border-bottom: 0;
}
.person-row {
  list-style: none;
  padding: 0.75rem;
  border-radius: var(--r-sm);
  cursor: pointer;
}
.person-row::-webkit-details-marker {
  display: none;
}
.person-row:hover,
.person[open] .person-row {
  background: rgba(255, 255, 255, 0.035);
}
.person-who {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}
.person-who .avatar {
  flex: none;
}
.person-name {
  display: grid;
  min-width: 0;
}
.person-name strong,
.person-name .muted {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.person-name .muted {
  font-size: 0.85rem;
}
.person.off .person-name strong {
  color: var(--muted);
}
.you {
  margin-left: 0.35rem;
  padding: 0.05rem 0.45rem;
  border-radius: var(--r-pill);
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--cyan);
  background: rgba(34, 211, 238, 0.1);
}
.person-row .pill,
.role {
  justify-self: start;
  font-size: 0.85rem;
  font-weight: 600;
}
.role-admin {
  color: var(--violet-light);
}
.person-seen {
  font-size: 0.85rem;
}
.person-edit {
  justify-self: end;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--cyan);
}
.person[open] .person-edit {
  color: var(--muted);
}
.person-form {
  margin: 0 0.75rem 1rem;
  padding: 0.25rem 1rem 1rem;
  border-left: 2px solid var(--violet);
}
.person-form .field-row > label {
  max-width: 22rem;
}
label.check {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  cursor: pointer;
}
label.check input {
  width: 1.1rem;
  height: 1.1rem;
  padding: 0;
  accent-color: var(--violet);
}
.add-person > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  list-style: none;
  cursor: pointer;
}
.add-person > summary::-webkit-details-marker {
  display: none;
}
.add-title {
  font-weight: 700;
  font-size: 1.1rem;
}
.add-person[open] > summary .btn {
  display: none;
}
.add-person form .field-row > label {
  max-width: 24rem;
}
@media (max-width: 760px) {
  .people-head {
    display: none;
  }
  .person-row {
    grid-template-columns: auto auto minmax(0, 1fr) auto;
    gap: 0.45rem 0.75rem;
  }
  .person-who,
  .person-seen {
    grid-column: 1 / -1;
  }
  .person-edit {
    grid-column: 4;
    grid-row: 2;
  }
}

/* ---- Tables ---- */
table {
  width: 100%;
  border-collapse: collapse;
}
td,
th {
  text-align: left;
  padding: 0.5rem;
  border-bottom: 1px solid var(--line);
}

/* ---- Responsive ---- */
@media (max-width: 1023px) {
  .thread-layout {
    grid-template-columns: 1fr;
  }
  .details {
    position: static;
    order: -1;
  }
  .auth-split {
    grid-template-columns: 1fr;
  }
  .auth-hero {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 2.5rem 1.5rem;
  }
  .benefits {
    display: none;
  }
}
@media (max-width: 720px) {
  .menu-toggle {
    display: inline-flex;
  }
  .brand .wordmark,
  .brand .divider {
    display: none;
  }
  .topnav {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    margin-top: 0.6rem;
  }
  .topnav.open {
    display: flex;
  }
  .topbar {
    flex-wrap: wrap;
  }
  .tile {
    flex-basis: 140px;
  }
  .row .side {
    grid-row: auto;
    grid-column: 1;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: wrap;
  }
  .pagehead-action {
    margin-left: 0;
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  .hero-visual .wave {
    transition: none !important;
    animation: none !important;
    scroll-behavior: auto !important;
  }
}

/* ---- Voice section (FRG-0394) ---- */
/* Tooltip: a "?" button beside every field and action. CSS-only (the CSP allows no inline script or style): it opens
   on hover, on keyboard focus, and on tap (a tap focuses the button). The text is linked to its control with
   aria-describedby, so screen readers read it too. */
.tipwrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
}
button.tip {
  width: 1.45rem;
  height: 1.45rem;
  min-width: 1.45rem;
  padding: 0;
  margin-left: 0.35rem;
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1;
  color: var(--violet-light);
  background: rgba(124, 58, 237, 0.14);
  border: 1px solid rgba(124, 58, 237, 0.4);
  border-radius: 50%;
}
button.tip:hover,
button.tip:focus-visible {
  filter: none;
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.3);
  outline: none;
}
.tip-text {
  display: none;
  position: absolute;
  z-index: 20;
  left: 0;
  top: calc(100% + 6px);
  width: max-content;
  max-width: min(22rem, 80vw);
  padding: 0.65rem 0.8rem;
  font-size: 0.86rem;
  font-weight: 400;
  line-height: 1.45;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  box-shadow: var(--shadow);
  white-space: normal;
}
.tipwrap:hover .tip-text,
.tipwrap:focus-within .tip-text {
  display: block;
}
.vfield {
  margin: 0.9rem 0 0;
  flex: 1 1 14rem;
}
.vlabel {
  display: flex;
  align-items: center;
  margin: 0 0 0.3rem;
}
.vlabel label {
  margin: 0;
}
.vcheck {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.vcheck input {
  width: auto;
}
.vcheck label {
  margin: 0;
}
.vcheck .hint {
  flex-basis: 100%;
}
.vbtn {
  display: inline-flex;
  align-items: center;
}
.vrow-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}
.vrow-actions form {
  margin: 0;
}
.vtable-wrap {
  overflow-x: auto;
  margin: 0.5rem 0 1rem;
}
.vtable {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}
.vtable th,
.vtable td {
  text-align: left;
  padding: 0.55rem 0.6rem;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.vtable th {
  color: var(--muted);
  font-weight: 500;
  font-size: 0.82rem;
}
.vurl {
  max-width: 18rem;
  overflow-wrap: anywhere;
}
.vdl {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr));
  gap: 0.6rem 1.2rem;
  margin: 0.5rem 0 1rem;
}
.vdl dt {
  color: var(--muted);
  font-size: 0.82rem;
}
.vdl dd {
  margin: 0.15rem 0 0;
  overflow-wrap: anywhere;
}
.vcards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 0 1rem;
}
.vguide-list,
.vguide-index {
  margin: 0.5rem 0 0;
  padding-left: 1.2rem;
}
.vguide-index li {
  margin: 0 0 0.9rem;
}
.vsteps {
  padding-left: 1.3rem;
}
.vsteps li {
  margin: 0 0 0.8rem;
}
.vsteps li p {
  margin: 0.15rem 0;
}
.notice.warn {
  border-color: rgba(240, 180, 41, 0.45);
  background: rgba(240, 180, 41, 0.09);
  margin: 0 0 1rem;
}
.secret-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}
.secret-row input {
  flex: 1 1 auto;
}
/* The docs link sits in narrow cards too: address on its own row, buttons below. */
.doc-row {
  flex-wrap: wrap;
}
.doc-row input {
  flex: 1 1 100%;
  min-width: 0;
}
.vbtn button,
.vbtn .btn {
  white-space: nowrap;
}
/* The docs card takes a whole row of the overview cards, so the address is readable. */
.vcards .vwide {
  grid-column: 1 / -1;
}
.vwide .doc-row input {
  flex: 1 1 24rem;
}
/* FRG-0394 #9712: "No inbound (forwarded elsewhere)" hides the Voice URL and fallback while it is ticked. */
.vroute:has(input[name="no_inbound"]:checked) .vinbound {
  display: none;
}
.vforward .vsteps {
  margin-top: 0.75rem;
}
/* A disabled button looks disabled (the forwarding-target Copy while it's the placeholder, Forge #9719). */
button:disabled,
button[aria-disabled="true"] {
  opacity: 0.45;
  cursor: not-allowed;
}
/* Tips at the right end of a copy row open leftwards so they aren't cut off at the page edge. */
.secret-row .tip-text {
  left: auto;
  right: 0;
}
/* FRG-0394 #9712 item 3: the rate fields sit in a responsive grid. */
.vrates {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 0 1rem;
}
/* FRG-0394 #9712 item 6: code samples on the customer quick start. */
.vcode {
  overflow-x: auto;
  padding: 0.75rem 1rem;
  margin: 0.5rem 0 0.75rem;
  background: var(--surface-2);
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  font-size: 0.86rem;
  line-height: 1.5;
}
.vquick > li h2 {
  font-size: 1.05rem;
  margin: 0 0 0.4rem;
}
