:root {
  --canvas: #faf9f6;
  --rail: #f2f1ec;
  --ink: #272923;
  --quiet: #686d62;
  --line: #e3e3da;
  --moss: #4d5e46;
  --wash: #e8ebe2;
  --error: #a44336;
  --surface: #fff;
  --primary-bg: #272923;
  --primary-fg: #fff;
  --primary-hover: #4d5e46;
  --border-hover: #b9bdb0;
  --control-border: #d8dacf;
  --input-border: #d4d7cb;
  --focus-border: #929c85;
  --soft-ink: #5b6053;
  --suggestion-ink: #575c50;
  --row-ink: #69705f;
  --separator: #bcbdb3;
  --status-idle: #aaad9d;
  --composer-shadow: #27292303;
  --dialog-shadow: #27292326;
  --backdrop: #2729234d;
  color-scheme: light;
  --control: 6px;
  --composer: 12px;
  --dialog: 16px;
  font-family:
    Inter,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  font-size: 15px;
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
}
:root[data-theme="dark"] {
  --canvas: #1c201b;
  --rail: #181b17;
  --ink: #e5e7df;
  --quiet: #a5ab9f;
  --line: #363d32;
  --moss: #bdcaaa;
  --wash: #2b3426;
  --error: #f0a59b;
  --surface: #242922;
  --primary-bg: #d6dfc9;
  --primary-fg: #1c2417;
  --primary-hover: #bfcead;
  --border-hover: #66715c;
  --control-border: #46503d;
  --input-border: #46503d;
  --focus-border: #9caf87;
  --soft-ink: #b7bfad;
  --suggestion-ink: #b7bfad;
  --row-ink: #aab59d;
  --separator: #67715e;
  --status-idle: #8d9980;
  --composer-shadow: #00000014;
  --dialog-shadow: #00000066;
  --backdrop: #00000099;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
button,
a,
input,
textarea,
summary {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
  font-weight: 400;
}
button:disabled {
  cursor: wait;
  opacity: 0.55;
}
a {
  color: inherit;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--moss);
  outline-offset: 4px;
}
button svg {
  flex-shrink: 0;
}
[hidden] {
  display: none !important;
}
.icon-library {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}
.icon {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 1.6;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}
.muted {
  color: var(--quiet);
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}
.shell {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  height: 100dvh;
  min-height: 560px;
}
.wordmark {
  font-size: 20px;
  letter-spacing: -0.6px;
  text-decoration: none;
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 0 8px;
}
.brand-mark {
  font-size: 29px;
  color: var(--moss);
  line-height: 1;
}
.team-label {
  font-size: 11px;
  letter-spacing: 0.2px;
  color: var(--quiet);
  margin: 62px 12px 16px;
}
.colleague {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 8px;
  margin-bottom: 24px;
}
.colleague img {
  width: 43px;
  height: 43px;
}
.colleague > span {
  font-size: 15px;
}
.colleague small {
  display: block;
  font-size: 12px;
  color: var(--quiet);
  margin-top: 3px;
}
.colleague .colleague-mark {
  margin-left: auto;
  color: var(--moss);
  font-size: 20px;
}
.nav-link {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 42px;
  padding: 0 12px;
  font-size: 14px;
  text-decoration: none;
  color: var(--quiet);
  border-radius: var(--control);
  margin-bottom: 5px;
}
.nav-link:hover {
  background: var(--wash);
}
.nav-link.active {
  background: var(--wash);
  color: var(--ink);
}
.rail-footer {
  margin-top: auto;
}
.rail-thought {
  font-family: Georgia, serif;
  font-size: 16px;
  line-height: 1.55;
  color: var(--quiet);
  padding: 0 12px;
  margin: 30px 0;
}
.quiet,
.secondary,
.primary {
  min-height: 40px;
  border-radius: var(--control);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 13px;
  text-decoration: none;
  font-size: 13px;
  border: 1px solid transparent;
  background: transparent;
}
.quiet {
  color: var(--quiet);
}
.quiet:hover {
  background: var(--wash);
  color: var(--ink);
}
.secondary {
  border-color: var(--line);
  color: var(--ink);
  background: transparent;
}
.secondary:hover {
  border-color: var(--border-hover);
  background: var(--rail);
}
.primary {
  color: var(--primary-fg);
  background: var(--primary-bg);
}
.primary:hover {
  background: var(--primary-hover);
}
.rail-footer > .quiet {
  justify-content: flex-start;
  width: 100%;
  gap: 11px;
}
.workspace {
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.topbar {
  height: 82px;
  padding: 0 40px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  font-size: 13px;
}
.header-separator {
  color: var(--separator);
  margin: 0 12px;
}
.topbar .secondary {
  font-size: 13px;
}
.conversation-view {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}
.conversation-scroll {
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  scroll-behavior: smooth;
}
.welcome {
  max-width: 760px;
  margin: 0 auto;
  padding: 56px 36px 28px;
  position: relative;
}
.welcome-avatar {
  width: 150px;
  height: 150px;
  display: block;
  margin-bottom: 19px;
}
.eyebrow {
  font-size: 12px;
  letter-spacing: 0.2px;
  text-transform: none;
  color: var(--moss);
  margin: 0 0 17px;
}
.welcome h1 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 56px;
  letter-spacing: -2.2px;
  line-height: 1.08;
  font-weight: 400;
  margin: 0 0 21px;
}
.welcome-copy {
  color: var(--quiet);
  line-height: 1.7;
  margin: 0 0 29px;
  font-size: 15px;
}
.suggestions {
  max-width: 360px;
}
.suggestions button {
  border: 0;
  width: 100%;
  min-height: 45px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-align: left;
  background: none;
  font-size: 13px;
  padding: 8px 0;
  color: var(--suggestion-ink);
}
.suggestions button:hover {
  color: var(--ink);
}
.suggestions .icon {
  width: 16px;
  height: 16px;
  color: var(--quiet);
}
.composer-area {
  max-width: 760px;
  width: 100%;
  margin: 0 auto;
  padding: 16px 36px 24px;
  flex-shrink: 0;
}
.connection-notice {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: var(--quiet);
  margin: 0 0 12px;
  flex-wrap: wrap;
}
.status-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--status-idle);
  flex-shrink: 0;
}
.connected .status-dot {
  background: var(--moss);
}
.text-link {
  border: 0;
  background: none;
  color: var(--moss);
  text-decoration: underline;
  text-underline-offset: 3px;
  padding: 3px 0;
  font-size: 12px;
  min-height: 26px;
}
.composer {
  background: var(--surface);
  border: 1px solid var(--control-border);
  border-radius: var(--composer);
  padding: 17px 17px 12px;
  box-shadow: 0 3px 8px var(--composer-shadow);
}
.composer:focus-within {
  border-color: var(--focus-border);
}
.composer textarea {
  background: none;
  width: 100%;
  border: 0;
  resize: none;
  outline: none;
  box-shadow: none;
  display: block;
  min-height: 28px;
  max-height: 150px;
  line-height: 1.65;
  padding: 0;
  font-size: 15px;
}
.composer textarea:focus-visible {
  outline: none;
}
.composer textarea::placeholder {
  color: var(--quiet);
}
.composer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 14px;
  gap: 10px;
}
.composer-bottom > span {
  font-size: 11px;
  color: var(--quiet);
}
.send-button {
  width: 36px;
  min-height: 36px;
  padding: 0;
  border-radius: 6px;
}
.send-button .icon {
  width: 18px;
  height: 18px;
}
.composer-footnote {
  text-align: center;
  font-size: 11px;
  color: var(--quiet);
  margin-top: 12px;
}
.messages {
  max-width: 760px;
  margin: 0 auto;
  padding: 32px 36px 10px;
}
.message {
  margin: 0 0 34px;
  animation: arrive 0.15s ease-out;
}
.message-byline {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--quiet);
  margin-bottom: 10px;
}
.message-byline img {
  height: 23px;
  width: 23px;
}
.message-body {
  white-space: pre-wrap;
  line-height: 1.8;
  overflow-wrap: anywhere;
  font-size: 15px;
}
.message.user .message-body {
  color: var(--soft-ink);
}
.message.pending .message-byline {
  display: none;
}
.message.pending .message-body {
  color: var(--quiet);
  background: transparent;
  border: 0;
  padding: 0;
  font-size: 13px;
}
.message.failed .message-body {
  color: var(--error);
}
.message .quiet {
  padding-left: 0;
  font-size: 12px;
}
.notes-view {
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr);
  flex: 1;
  min-height: 0;
}
.notes-list {
  border-right: 1px solid var(--line);
  padding: 25px 20px;
  overflow: auto;
}
.notes-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: var(--quiet);
  gap: 12px;
  margin-bottom: 12px;
}
.compact {
  font-size: 11px;
  padding: 5px;
  min-height: 30px;
}
.search {
  width: 100%;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  padding: 12px 4px;
  font-size: 13px;
  margin-bottom: 16px;
  outline: none;
}
.note-row {
  width: 100%;
  background: none;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  display: block;
  text-align: left;
  padding: 16px 10px;
  color: var(--row-ink);
}
.note-row:hover {
  background: var(--rail);
}
.note-row.selected {
  background: var(--wash);
  color: var(--ink);
}
.note-row-title {
  font-size: 13px;
  line-height: 1.5;
  display: block;
}
.note-row-time {
  color: var(--quiet);
  font-size: 11px;
  display: block;
  margin-top: 6px;
}
.list-state {
  color: var(--quiet);
  font-size: 13px;
  line-height: 1.65;
  margin: 20px 4px;
}
.note-pane {
  min-width: 0;
  padding: 40px;
  overflow: auto;
}
.note-pane h1 {
  font-size: 25px;
  font-weight: 600;
  letter-spacing: -0.7px;
  margin: 0 0 10px;
}
.note-meta {
  color: var(--quiet);
  font-size: 12px;
  margin: 0 0 30px;
}
.note-content {
  font-size: 15px;
  line-height: 1.8;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-width: 640px;
}
.note-pane details {
  color: var(--quiet);
  font-size: 13px;
  margin-top: 32px;
  max-width: 640px;
}
.note-pane summary {
  cursor: pointer;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}
.source-row {
  font-size: 13px;
  line-height: 1.7;
  overflow-wrap: anywhere;
  border-bottom: 1px solid var(--line);
  padding: 12px 0;
}
.pane-placeholder {
  color: var(--quiet);
  font: inherit;
  line-height: 1.65;
  max-width: 360px;
  margin-top: 18vh;
}
.mobile-back {
  display: none;
}
.dialog {
  color: var(--ink);
  background: var(--canvas);
  border: 1px solid var(--line);
  border-radius: var(--dialog);
  width: min(480px, calc(100vw - 32px));
  padding: 28px;
  box-shadow: 0 24px 90px var(--dialog-shadow);
  max-height: 90dvh;
  overflow: auto;
}
.suggestions-dialog { width: min(840px, calc(100vw - 32px)); }
.suggestions-toolbar { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
.suggestions-toolbar .form-state { margin: 0; }
.suggestions-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 24px; }
.suggestion-row { display: block; width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; padding: 12px; color: var(--quiet); cursor: pointer; }
.suggestion-row:hover { background: var(--rail); }
.suggestion-row[aria-pressed="true"] { background: var(--surface); color: var(--ink); }
.suggestion-row span { display: block; }
.suggestion-row span:first-child { font-weight: 500; color: var(--ink); }
.suggestion-row span:last-child { font-size: 13px; margin-top: 4px; color: var(--quiet); }
.suggestion-detail { min-width: 0; }
.suggestion-detail h3 { margin: 0; font-size: 20px; font-weight: 500; }
.suggestion-detail details { border-top: 1px solid var(--line); padding: 12px 0; }
.suggestion-detail summary { color: var(--quiet); cursor: pointer; min-height: 40px; }
.suggestion-source { border-bottom: 1px solid var(--line); padding: 8px 0; overflow-wrap: anywhere; }
.suggestion-source p { white-space: pre-wrap; }
.suggestion-choice { position: sticky; bottom: 0; background: var(--canvas); padding: 8px 0; border-top: 1px solid var(--line); }
.suggestion-choice label { display: block; }
.suggestion-choice .select-host { display: block; width: 100%; }
.suggestion-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.suggestion-detail .suggestion-brief h1, .suggestion-detail .suggestion-brief h2, .suggestion-detail .suggestion-brief h3 { font-size: 17px; font-weight: 500; }
@media (max-width: 650px) {
  .suggestions-layout { display: block; }
  .suggestions-layout.has-selection .suggestions-list { display: none; }
  .suggestion-detail .mobile-back { display: block; margin-bottom: 16px; }
  .suggestions-toolbar { align-items: flex-start; flex-direction: column; gap: 8px; }
  .suggestion-row { min-height: 44px; }
}
.dialog::backdrop {
  background: var(--backdrop);
  backdrop-filter: blur(3px);
}
.dialog-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
}
.dialog h2 {
  font-weight: 600;
  font-size: 23px;
  letter-spacing: -0.5px;
  margin: 0;
}
.icon-button {
  width: 40px;
  padding: 0;
}
.dialog label {
  font-size: 14px;
}
.field-help {
  font-size: 13px;
  line-height: 1.65;
  color: var(--quiet);
  margin: 9px 0 16px;
}
.dialog input,
.inline-people input[type="search"] {
  width: 100%;
  border: 1px solid var(--input-border);
  border-radius: var(--control);
  background: var(--surface);
  padding: 13px;
  margin-bottom: 16px;
  font-size: 14px;
}
.dialog form > .primary {
  width: 100%;
}
.form-state {
  font-size: 13px;
  line-height: 1.65;
  margin: 14px 0 0;
  overflow-wrap: anywhere;
}
.form-state.error {
  color: var(--error);
}
.connection-list {
  margin-top: 32px;
  border-top: 1px solid var(--line);
  padding-top: 24px;
}
.connection-list h3 {
  font-size: 13px;
  font-weight: 500;
  margin: 0 0 16px;
}
.connection-list > div {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  font-size: 13px;
  border-bottom: 1px solid var(--line);
  padding: 13px 0;
}
.connection-list > div > span:last-child {
  color: var(--quiet);
  text-align: right;
}
.setup-help {
  font-size: 13px;
  color: var(--quiet);
  line-height: 1.65;
}
.call-dialog {
  text-align: center;
}
.call-avatar {
  width: 135px;
  display: block;
  margin: 0 auto 20px;
}
.call-intro {
  font:
    25px Georgia,
    serif;
  letter-spacing: -0.5px;
}
.call-dialog .dialog-heading {
  margin-bottom: 8px;
}
.call-dialog details {
  text-align: left;
  margin: 24px 0;
  font-size: 13px;
  color: var(--quiet);
}
.call-dialog summary {
  cursor: pointer;
  min-height: 35px;
}
.call-dialog input {
  margin-top: 10px;
}
.call-link {
  display: block;
  background: var(--wash);
  color: var(--moss);
  padding: 12px;
  margin-top: 20px;
  border-radius: var(--control);
  font-size: 14px;
  text-decoration: none;
}
.call-dialog #endCall {
  display: block;
  margin: 8px auto 0;
}
.error {
  color: var(--error);
}
@keyframes arrive {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@media (min-height: 950px) {
  .welcome {
    padding-top: 82px;
  }
  .welcome-avatar {
    width: 170px;
    height: 170px;
  }
}
@media (max-width: 1050px) {
  .shell {
    grid-template-columns: 200px minmax(0, 1fr);
  }
  .notes-view {
    grid-template-columns: 260px minmax(0, 1fr);
  }
  .note-pane {
    padding: 28px;
  }
  .welcome h1 {
    font-size: 50px;
  }
}
@media (max-width: 900px) {
  .shell {
    display: flex;
    flex-direction: column;
    height: 100dvh;
    min-height: 0;
  }
  .wordmark {
    font-size: 16px;
    padding: 0;
    gap: 6px;
  }
  .brand-mark {
    font-size: 24px;
  }
  .team-label,
  .colleague,
  .rail-thought {
    display: none;
  }
  .nav-link {
    width: 44px;
    height: 44px;
    padding: 0;
    justify-content: center;
    font-size: 0;
    margin: 0;
  }
  .nav-link .icon {
    width: 19px;
    height: 19px;
  }
  .rail-footer {
    margin: 0;
  }
  .rail-footer > .quiet {
    width: 44px;
    font-size: 0;
    padding: 0;
    justify-content: center;
  }
  .rail-footer .icon {
    width: 19px;
    height: 19px;
  }
  .workspace {
    flex: 1;
    min-height: 0;
  }
  .topbar {
    height: 62px;
    padding: 0 22px;
  }
  .topbar .secondary {
    min-height: 44px;
    padding: 6px 10px;
  }
  .welcome {
    padding: 24px 27px;
  }
  .welcome-avatar {
    width: 113px;
    height: 113px;
    margin-bottom: 16px;
  }
  .welcome h1 {
    font-size: 42px;
    letter-spacing: -1.5px;
    margin-bottom: 15px;
  }
  .eyebrow {
    font-size: 12px;
    margin-bottom: 12px;
  }
  .welcome-copy {
    font-size: 14px;
    margin-bottom: 20px;
  }
  .suggestions button {
    min-height: 44px;
    font-size: 12px;
  }
  .composer-area {
    padding: 10px 20px 16px;
  }
  .composer {
    padding: 14px 14px 10px;
  }
  .composer-footnote {
    font-size: 11px;
    margin-top: 9px;
  }
  .connection-notice {
    font-size: 11px;
    gap: 5px;
    margin-bottom: 9px;
  }
  .connection-notice .text-link {
    font-size: 11px;
    min-height: 28px;
  }
  .composer-bottom > span {
    font-size: 11px;
  }
  .send-button {
    width: 44px;
    min-height: 44px;
  }
  .messages {
    padding: 24px 25px;
  }
  .message-body {
    font-size: 14px;
  }
  .notes-view {
    display: block;
    overflow: hidden;
  }
  .notes-list {
    height: 100%;
    border-right: 0;
    padding: 20px;
  }
  .note-pane {
    display: none;
    height: 100%;
    padding: 22px;
  }
  .notes-view.detail-open .notes-list {
    display: none;
  }
  .notes-view.detail-open .note-pane {
    display: block;
  }
  .mobile-back {
    display: flex;
    padding-left: 0;
    margin-bottom: 24px;
  }
  .pane-placeholder {
    margin-top: 40px;
  }
  .dialog {
    padding: 24px;
  }
  .quiet,
  .primary,
  .secondary {
    min-height: 44px;
  }
  .dialog-heading .icon-button {
    width: 44px;
  }
  .note-row {
    padding: 17px 10px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
/* Native radios preserve keyboard behaviour; labels share the existing control scale. */
.appearance {
  border: 0;
  border-bottom: 1px solid var(--line);
  padding: 0 0 24px;
  margin: 0 0 24px;
  min-width: 0;
}
.appearance legend {
  font-size: 14px;
  padding: 0;
  margin-bottom: 14px;
}
.theme-options {
  display: flex;
  padding: 3px;
  gap: 3px;
  border-radius: var(--control);
  background: var(--rail);
  border: 1px solid var(--line);
}
.theme-options label {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border-radius: 4px;
  cursor: pointer;
  color: var(--quiet);
  position: relative;
  font-size: 13px;
}
.theme-options input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
  padding: 0;
}
.theme-options label:has(input:checked) {
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 1px 3px var(--composer-shadow);
}
.theme-options label:has(input:focus-visible) {
  outline: 2px solid var(--moss);
  outline-offset: 2px;
}
.appearance .field-help {
  margin: 12px 0 0;
}
@media (max-width: 900px) {
  .theme-options label {
    min-height: 44px;
  }
}

input::placeholder {
  color: var(--quiet);
  opacity: 1;
}

/* Character editing uses the existing dialog and form primitives. */
.topbar > div {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 6px;
}
#colleagueSelect {
  color: var(--ink);
  background: transparent;
  border: 0;
  max-width: 150px;
  min-height: 40px;
  font: inherit;
}
#colleagueSelect option {
  background: var(--surface);
}
.dialog textarea,
.dialog select,
.call-actions select {
  width: 100%;
  color: var(--ink);
  border: 1px solid var(--input-border);
  border-radius: var(--control);
  background: var(--surface);
  padding: 13px;
  margin: 8px 0 16px;
  font: inherit;
}
.dialog textarea {
  resize: vertical;
}
#railWork {
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
@media (max-width: 900px) {
  .topbar {
    padding: 0 12px;
    gap: 4px;
  }
  #colleagueSelect {
    max-width: 100px;
  }
  .topbar #viewTitle,
  .topbar .header-separator {
    display: none;
  }
  #editColleague,
  #createColleague {
    min-width: 40px;
  }
  #callButtonName {
    max-width: 112px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

#previewVoice {
  margin: -4px 0 16px;
}
#profileVoiceAudio {
  width: 100%;
  margin: 0 0 16px;
}

/* Conversations are the working surface, with a compact saved-thread list. */
.shell {
  grid-template-columns: 280px minmax(0, 1fr);
}
/* Chat list and conversation pane: the user's requested messaging model. */
.workspace {
  min-height: 0;
}
.shell {
  grid-template-columns: 360px minmax(0, 1fr);
  min-height: 0;
}
.chat-search {
  display: block;
  padding: 0 20px 16px;
}
.chat-search input {
  width: 100%;
  border: 0;
  border-radius: 8px;
  padding: 11px 14px;
  background: var(--wash);
  color: var(--ink);
  font: inherit;
}
.thread-list {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
  margin: 0;
}
.thread-rows {
  overflow-y: auto;
  min-height: 0;
}
.thread-row {
  display: flex;
  gap: 12px;
  align-items: center;
  width: 100%;
  min-height: 92px;
  padding: 14px 20px;
  background: transparent;
  border: 0;
  border-radius: 0;
  text-align: left;
  color: var(--ink);
}
.thread-row:hover,
.thread-row.selected {
  background: var(--wash);
}
.chat-avatar {
  width: 44px;
  height: 44px;
  flex: none;
  object-fit: contain;
  border-radius: 50%;
  background: var(--surface);
}
.call-avatars {
  position: relative;
  width: 44px;
  height: 44px;
  flex: none;
}
.participant-avatar {
  position: absolute;
  top: 0;
  left: 0;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 2px solid var(--rail);
  border-radius: 50%;
  background: var(--surface);
  color: var(--quiet);
  object-fit: contain;
  font-size: 10px;
  line-height: 1;
}
.thread-row:hover .participant-avatar,
.thread-row.selected .participant-avatar { border-color: var(--wash); }
.participant-avatar:nth-child(2) { left: auto; right: 0; }
.participant-avatar:nth-child(3) { top: auto; bottom: 0; }
.participant-avatar:nth-child(4) { top: auto; left: auto; right: 0; bottom: 0; }
.call-avatars[data-count="1"] .participant-avatar { width: 44px; height: 44px; font-size: 15px; }
.call-avatars[data-count="2"] .participant-avatar { width: 32px; height: 32px; font-size: 12px; }
.call-avatars[data-count="2"] .participant-avatar:nth-child(2) { top: auto; bottom: 0; }
.call-thread .thread-heading { align-items: flex-start; }
.call-thread .thread-heading > span:first-child {
  white-space: normal;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow-wrap: anywhere;
  line-height: 1.4;
}
.thread-copy {
  display: block;
  flex: 1;
  min-width: 0;
}
.thread-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.thread-heading > span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 15px;
  font-weight: 500;
}
.thread-heading time {
  font-size: 11px;
  color: var(--quiet);
  white-space: nowrap;
}
.thread-topic,
.thread-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  line-height: 1.6;
}
.thread-topic {
  color: var(--quiet);
  margin-top: 3px;
}
.thread-copy small {
  color: var(--quiet);
}
.thread-list .list-state {
  padding: 0 20px;
}
.topbar {
  height: 76px;
  padding: 0 24px;
  background: var(--rail);
}
.topbar > div {
  gap: 10px;
  min-width: 0;
}
.chat-identity {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
#colleagueSelect {
  padding: 0 22px 0 0;
  font-size: 16px;
  font-weight: 500;
  max-width: 180px;
  min-height: 26px;
}
#headerWork {
  font-size: 12px;
  color: var(--quiet);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  max-width: 280px;
}
#openNavigation {
  display: none;
}
.welcome {
  padding: 48px 32px 24px;
  max-width: 720px;
  width: 100%;
}
.welcome-avatar {
  position: static;
  width: 72px;
  height: 72px;
  margin: 0 0 20px;
}
.welcome h1 {
  font-size: 30px;
  letter-spacing: -0.7px;
  max-width: none;
}
.welcome .eyebrow {
  display: none;
}
.messages {
  max-width: 840px;
  width: 100%;
  padding: 24px 32px 8px;
}
.message {
  max-width: 90%;
  margin: 0 0 20px;
}
.message.user {
  margin-left: auto;
  max-width: 80%;
  width: fit-content;
}
.message-byline {
  margin-bottom: 5px;
  font-size: 11px;
}
.message.user .message-byline {
  justify-content: flex-end;
}
.message-byline img {
  display: none;
}
.message-body {
  background: var(--surface);
  border-radius: 0 12px 12px 12px;
  padding: 14px 18px;
  line-height: 1.65;
  white-space: normal;
}
.message.user .message-body {
  background: var(--wash);
  border-radius: 12px 0 12px 12px;
  white-space: pre-wrap;
  color: var(--ink);
}
.message-body > :first-child,
.note-content > :first-child {
  margin-top: 0;
}
.message-body > :last-child,
.note-content > :last-child {
  margin-bottom: 0;
}
.message-body p,
.note-content p {
  margin: 0 0 12px;
}
.message-body ul,
.message-body ol,
.note-content ul,
.note-content ol {
  padding-left: 24px;
  margin: 12px 0;
}
.message-body li,
.note-content li {
  margin: 5px 0;
}
.message-body li > p {
  margin-bottom: 6px;
}
.message-body strong,
.note-content strong {
  font-weight: 600;
}
.message-body h1,
.message-body h2,
.message-body h3,
.note-content h1,
.note-content h2,
.note-content h3 {
  font-family: inherit;
  font-size: 17px;
  line-height: 1.4;
  margin: 20px 0 10px;
}
.message-body pre,
.note-content pre {
  overflow: auto;
  padding: 12px;
  background: var(--rail);
  border-radius: 6px;
  white-space: pre;
  max-width: 100%;
}
.message-body code,
.note-content code {
  font-size: 13px;
  background: var(--rail);
  padding: 2px 4px;
  border-radius: 3px;
}
.message-body pre code,
.note-content pre code {
  padding: 0;
}
.message-body blockquote,
.note-content blockquote {
  border-left: 2px solid var(--moss);
  margin: 12px 0;
  padding-left: 16px;
  color: var(--quiet);
}
.message-body a,
.note-content a {
  color: var(--moss);
  text-decoration: underline;
}
.message-body table,
.note-content table {
  display: block;
  overflow-x: auto;
  border-collapse: collapse;
  max-width: 100%;
}
.message-body td,
.message-body th,
.note-content td,
.note-content th {
  padding: 8px 12px;
  border: 1px solid var(--line);
}
.note-content {
  white-space: normal;
}
.composer-area {
  max-width: 840px;
  padding: 12px 32px 16px;
}
.composer-bottom > span {
  display: none;
}
.composer {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  padding: 10px 12px 10px 16px;
}
.composer textarea {
  flex: 1;
  padding: 4px 0;
  min-height: 32px;
}
.composer-bottom {
  padding: 0;
  margin-top: 0;
}
.composer-footnote {
  font-size: 12px;
  line-height: 1.5;
  margin-top: 8px;
}
@media (max-width: 1050px) and (min-width: 901px) {
  .shell {
    grid-template-columns: 320px minmax(0, 1fr);
  }
  #headerWork {
    max-width: 170px;
  }
}
@media (max-width: 900px) {
  .shell {
    display: block;
    min-height: 0;
  }
  .shell.show-chats > .workspace {
    display: none;
  }
  .workspace {
    height: 100dvh;
  }
  .topbar {
    height: 68px;
    padding: 0 12px;
  }
  #openNavigation {
    display: inline-flex;
  }
  .topbar > div {
    gap: 6px;
  }
  .topbar .chat-avatar {
    width: 36px;
    height: 36px;
  }
  #headerWork {
    max-width: 100px;
  }
  #colleagueSelect {
    max-width: 100px;
    font-size: 15px;
  }
  #editColleague {
    display: inline-flex;
  }
  .topbar #createColleague {
    display: none;
  }
  .topbar .secondary {
    padding: 8px;
    font-size: 12px;
  }
  .topbar .secondary .icon {
    display: block;
  }
  .topbar .secondary #callButtonName {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
  }
  .welcome {
    padding: 32px 24px 20px;
  }
  .welcome h1 {
    font-size: 28px;
  }
  .messages {
    padding: 20px 16px 8px;
  }
  .message {
    max-width: 95%;
  }
  .message-body {
    padding: 12px 14px;
    font-size: 14px;
  }
  .composer-area {
    padding: 10px 16px 12px;
  }
}

/* Workspace navigation owns page switching; each page owns one list and pane. */
.shell {
  grid-template-columns: minmax(0, 1fr);
}
.shell > .app-sidebar {
  display: none;
}
.app-sidebar {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 24px 12px 12px;
  background: var(--rail);
  border-right: 1px solid var(--line);
}
.app-sidebar .wordmark {
  font-size: 18px;
  min-height: 40px;
  padding: 0 12px;
  gap: 8px;
}
.app-sidebar .brand-mark {
  font-size: 24px;
}
.app-sidebar nav {
  margin-top: 24px;
}
.app-sidebar .nav-link {
  margin-bottom: 4px;
  font-size: 14px;
  padding: 0 12px;
  min-height: 40px;
  color: var(--quiet);
  font-weight: 400;
}
.app-sidebar .nav-link.active,
.app-sidebar .nav-link:hover {
  color: var(--ink);
}
.app-sidebar .rail-footer {
  margin-top: auto;
  display: grid;
  gap: 8px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}
.app-sidebar .rail-footer button {
  width: 100%;
  justify-content: flex-start;
  gap: 10px;
  padding: 8px 12px;
  color: var(--ink);
  font-size: 14px;
  white-space: normal;
  line-height: 1.4;
}
.app-sidebar .rail-footer .settings-trigger {
  color: var(--quiet);
}
.view-container {
  min-width: 0;
  min-height: 0;
  height: 100dvh;
}
.chats-layout {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  height: 100%;
  min-height: 0;
}
.chat-panel {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--line);
  background: var(--canvas);
}
.collection-header {
  display: flex;
  align-items: center;
  height: 76px;
  padding: 0 20px;
  gap: 8px;
  flex: none;
}
.collection-header h1 {
  margin: 0;
  line-height: 1.3;
  font-family: inherit;
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.5px;
}
.list-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}
.list-actions #newConversation {
  padding: 8px 12px;
  font-size: 13px;
}
.thread-row {
  padding: 14px 20px;
}
.chat-search {
  padding-bottom: 16px;
}
.notes-view {
  height: 100%;
  grid-template-columns: 320px minmax(0, 1fr);
}
.notes-list {
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 0;
  overflow: hidden;
}
.collection-count {
  margin-left: auto;
  color: var(--quiet);
  font-size: 13px;
  white-space: nowrap;
}
.notes-tools {
  padding: 0 20px;
  justify-content: flex-start;
  gap: 8px;
}
.notes-tools .secondary {
  min-height: 40px;
}
@media (max-width: 900px) {
  .notes-tools .secondary { min-height: 44px; }
}
.notes-list .search {
  width: calc(100% - 40px);
  margin: 0 20px 16px;
  background: var(--wash);
  border: 0;
  border-radius: 8px;
  padding: 11px 14px;
  font-size: 15px;
}
.note-rows {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}
.note-row {
  padding: 16px 20px;
}
.note-row-title {
  font-size: 14px;
}
.notes-list .list-state {
  padding: 0 20px;
}
.note-pane {
  padding: 32px;
}
.workspace-menu {
  display: inline-flex;
}
.workspace-drawer {
  position: fixed;
  inset: 0 auto 0 0;
  margin: 0;
  width: min(280px, 90vw);
  height: 100dvh;
  max-height: none;
  padding: 0;
  border: 0;
  background: var(--rail);
  color: var(--ink);
}
.workspace-drawer::backdrop {
  background: rgb(0 0 0 / 25%);
}
.workspace-drawer .app-sidebar {
  height: 100%;
  border: 0;
  padding-top: 32px;
}
#closeWorkspaceNavigation {
  position: absolute;
  top: 18px;
  right: 12px;
}
@media (min-width: 901px) and (max-width: 1100px) {
  .chats-layout, .notes-view { grid-template-columns: 280px minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .shell {
    display: block;
  }
  .shell > .app-sidebar {
    display: none;
  }
  .view-container,
  .chats-layout {
    height: 100dvh;
  }
  .chats-layout {
    display: block;
  }
  .chats-layout > .chat-panel {
    display: none;
  }
  .chats-layout.show-chats > .chat-panel {
    display: flex;
    height: 100dvh;
    width: 100%;
    border: 0;
  }
  .chats-layout.show-chats > .workspace {
    display: none;
  }
  .workspace-menu {
    display: inline-flex;
  }
  .collection-header {
    height: 68px;
    padding: 0 12px;
  }
  .collection-header h1 {
    font-size: 21px;
  }
  .notes-view {
    display: block;
  }
  .notes-list {
    height: 100%;
  }
  .notes-view.detail-open .notes-list {
    display: none;
  }
  .notes-view:not(.detail-open) .note-pane {
    display: none;
  }
  .notes-view.detail-open .note-pane {
    display: block;
    height: 100%;
    padding: 20px;
  }
  .workspace-drawer .app-sidebar {
    display: flex;
    width: 100%;
  }
  .workspace-drawer .nav-link {
    min-height: 44px;
  }
}

/* Calls share the chat list and transcript pane; colour always has a label. */
.live-indicator {
  color: var(--ink);
  white-space: nowrap;
}
.live-indicator::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--moss);
  vertical-align: middle;
}
.thread-heading .live-indicator {
  flex-shrink: 0;
  font-size: 12px;
  color: var(--quiet);
}
.call-controls {
  padding: 10px 24px;
  border-bottom: 1px solid var(--line);
}
.call-summary, .call-status-line, .call-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.call-summary { justify-content: space-between; }
.call-status-line { min-width: 0; flex: 1; }
.call-status { color: var(--quiet); font-size: 13px; white-space: nowrap; }
.call-status::before { content: ""; display: inline-block; width: 7px; height: 7px; border: 1px solid currentColor; border-radius: 50%; margin-right: 6px; }
.call-status[data-state="live"] { color: var(--moss); }
.call-status[data-state="live"]::before { background: currentColor; }
.call-status[data-state="failed"] { color: var(--error); }
.call-status-line .field-help { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.call-status-line .field-help:empty { display: none; }
.call-actions { flex-shrink: 0; gap: 2px; }
.call-actions button, .call-actions a { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; text-decoration: none; white-space: nowrap; }
.call-actions .call-remove { color: var(--error); }
.call-people { display: flex; gap: 4px; overflow-x: auto; }
.call-people:empty { display: none; }
.call-people button { flex-shrink: 0; font-size: 12px; white-space: nowrap; }
.call-controls .form-state:empty { display: none; }
@media (max-width: 900px) {
  .call-controls { padding: 8px 16px; }
  .call-actions button, .call-actions a { min-height: 44px; }
  .call-action-label { display: none; }
  .call-actions button { width: 44px; padding: 0; }
  .call-actions a { padding: 8px; }
}

/* Radix Select: shared keyboard, focus and popup behaviour for every selector. */
.select-host {
  display: inline-flex;
  min-width: 0;
}
.select-host:has(#colleagueVoice-trigger),
.select-host:has(#agentKeyColleague-trigger) {
  width: 100%;
}
.select-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 40px;
  width: 100%;
  padding: 8px 12px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  font: inherit;
  text-align: left;
}
.select-trigger:disabled {
  opacity: 0.5;
  cursor: default;
}
.select-trigger:focus-visible {
  outline: 2px solid var(--moss);
  outline-offset: 2px;
}
.select-content {
  z-index: 1000;
  min-width: var(--radix-select-trigger-width);
  max-height: var(--radix-select-content-available-height);
  overflow: hidden;
  padding: 4px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: 0 8px 24px #0002;
  font-size: 14px;
}
.select-item {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 8px 36px 8px 12px;
  border-radius: 4px;
  outline: none;
  cursor: default;
}
.select-item[data-highlighted] {
  background: var(--rail);
}
.select-item[data-disabled] {
  opacity: 0.5;
}
.select-check {
  position: absolute;
  right: 12px;
  color: var(--moss);
}
.select-scroll {
  text-align: center;
}
.workspace-switcher {
  min-width: 0;
  margin: 8px 0 0;
}
.workspace-switcher:empty {
  display: none;
}
.agent-key-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
}
#agentKeySettings {
  margin: 24px 0;
}
#agentKeyForm {
  display: grid;
  gap: 8px;
}
@media (max-width: 900px) {
  .select-trigger,
  .select-item {
    min-height: 44px;
  }
}

#colleagueSelect-trigger {
  border: 0;
  background: transparent;
  width: auto;
  max-width: 150px;
  padding: 0;
}
#colleagueSelect-trigger > span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dialog .select-host {
  margin: 8px 0 16px;
}
#workspaceSelect-trigger {
  background: var(--surface);
  width: 100%;
  padding: 8px 12px;
  font-size: 13px;
  gap: 8px;
}
#workspaceSelect-trigger .icon { width: 18px; height: 18px; flex-shrink: 0; }
.select-trigger > span:last-child { flex-shrink: 0; }
#workspaceSelect-trigger > span:first-of-type {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.workspace-switcher .select-host {
  width: 100%;
}
.account-button {
  padding: 0 12px;
  text-align: left;
  font-size: 14px;
}
@media (max-width: 900px) {
  #colleagueSelect-trigger {
    max-width: 100px;
  }
}
@media (max-width: 900px) {
  .workspace-drawer .nav-link {
    width: 100%;
    height: auto;
    min-height: 44px;
    justify-content: flex-start;
    white-space: nowrap;
  }
}

/* Local agent setup reuses dialog, form and disclosure primitives. */
.setup-details {
  margin: 24px 0;
  border-block: 1px solid var(--line);
  padding: 12px 0;
}
.setup-details summary {
  cursor: pointer;
  color: var(--quiet);
}
#agentSetupDialog h3 {
  font-size: 15px;
  font-weight: 500;
  margin: 24px 0 8px;
}
#agentWorkspace {
  overflow-wrap: anywhere;
}
#agentSetupDialog code {
  overflow-wrap: anywhere;
}

#agentCreateStep summary {
  cursor: pointer;
  font-size: 15px;
  font-weight: 500;
}
/* Recent work is a short, focused setup flow, with one main action per state. */
.import-dialog { width: min(600px, calc(100vw - 32px)); padding: 0; }
.import-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 28px 32px 0; }
.import-heading .icon-button { flex: 0 0 40px; margin: -4px -8px 0 0; }
.import-eyebrow { margin: 0 0 8px; color: var(--quiet); font-size: 13px; overflow-wrap: anywhere; }
.import-body { padding: 16px 32px 0; }
.import-intro { margin: 0 0 28px; color: var(--quiet); font-size: 15px; line-height: 1.65; }
.import-dialog .form-state { margin: 0 0 20px; }
.import-dialog .form-state:empty { display: none; }
.import-field { margin: 0 0 24px; }
.import-field label { display: block; margin-bottom: 8px; }
.import-dialog .import-field textarea { display: block; width: 100%; margin: 0; padding: 12px; min-height: 104px; resize: vertical; }
.import-field .field-help { margin: 8px 0 0; }
.import-dialog .import-field .select-host { display: block; width: 100%; margin: 0; }
.import-dialog .import-field .select-trigger { width: 100%; }
.import-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; border-top: 1px solid var(--line); padding: 20px 0; margin-top: 28px; }
.import-footer > .field-help { margin: 0; }
.import-dialog .import-footer .primary { width: auto; flex-shrink: 0; }
.import-main-action { display: flex; align-items: center; gap: 12px; }
#importCopyState { margin: 0; }
.import-secondary-actions { display: flex; gap: 8px; }
.import-secondary-actions .quiet { padding: 8px 0; }
.import-context { display: flex; gap: 16px; font-size: 14px; margin-bottom: 16px; }
.import-context-label { flex: 0 0 72px; color: var(--quiet); }
#importScope { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
#importProgress { margin: 0 0 20px; }
.import-summary { margin: 0 0 24px; font-size: 15px; overflow-wrap: anywhere; }
.import-disclosure { margin-top: 16px; }
.import-disclosure summary { color: var(--quiet); cursor: pointer; font-size: 13px; padding: 8px 0; }
.import-prompt { white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; font-size: 14px; line-height: 1.65; color: var(--ink); margin: 12px 0; padding-block: 16px; border-block: 1px solid var(--line); }
.import-sources { list-style: none; padding: 0; margin: 8px 0; }
.import-sources li { padding: 12px 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; font-size: 14px; }
.import-sources li span { display: block; }
.import-sources .field-help { margin: 4px 0 0; }
.import-connection { margin: 0; padding: 0 0 24px; font-size: 13px; }
.import-connection .quiet { font-size: inherit; min-height: 40px; padding: 4px; color: var(--moss); }
@media (max-width: 900px) {
  .import-dialog { padding: 0; }
  .import-heading { padding: 24px 24px 0; }
  .import-body { padding: 16px 24px 0; }
  .import-footer { align-items: flex-start; flex-direction: column; gap: 16px; }
  .import-main-action { width: 100%; justify-content: flex-end; }
  .import-footer .primary { width: 100%; }
  .import-secondary-actions { gap: 24px; }
  .import-connection { padding-bottom: 16px; }
}

.import-dialog .import-footer { position: sticky; bottom: 0; background: var(--canvas); }
#importCopyState:empty { display: none; }
@media (max-width: 900px) {
  .import-dialog .import-footer .primary { width: 100%; }
  .import-main-action { flex-direction: column; align-items: stretch; }
}

.import-summary > :first-child { margin-top: 0; }
.import-summary > :last-child { margin-bottom: 0; }
.import-summary pre { overflow-x: auto; }
.import-summary table { display: block; max-width: 100%; overflow-x: auto; }

/* Terminal setup carries defaults; the browser only hands off and shows progress. */
.setup-command { white-space: pre-wrap; overflow-wrap: anywhere; font: 14px/1.65 ui-monospace, monospace; color: var(--ink); padding: 16px 0; margin: 16px 0; border-block: 1px solid var(--line); }
#agentSetupDialog { width: min(560px, calc(100vw - 32px)); }
#agentSetupDialog .setup-details { margin-top: 24px; }
#agentSetupDialog > .primary { width: auto; }
@media(max-width:900px) { #agentSetupDialog > .primary { width:100%; } }

/* Source-backed memory search uses the same library rows and reading pane. */
.note-row-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.note-row-preview {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--quiet);
  font-size: 13px;
  line-height: 1.5;
  margin-top: 8px;
}
.memory-recall {
  border-bottom: 1px solid var(--line);
  margin-bottom: 24px;
  padding-bottom: 16px;
}
.memory-recall p {
  margin: 0 0 8px;
}

/* Optional profile detail stays out of the identity and voice decisions. */
.profile-illustration { margin: 8px 0 16px; padding-block: 12px; border-block: 1px solid var(--line); }
.profile-illustration summary { color: var(--quiet); cursor: pointer; min-height: 40px; padding: 8px 0; }
@media (max-width: 900px) {
  .profile-illustration summary { min-height: 44px; }
  .icon-button { width: 44px; min-width: 44px; }
}

.topic-content { max-width: 760px; }
.topic-evidence { margin: 0 0 28px; color: var(--quiet); font-size: 13px; }
.topic-evidence summary { cursor: pointer; min-height: 40px; display: flex; align-items: center; }
.topic-evidence[open] { border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.topic-source { display: block; text-align: left; width: 100%; border-radius: 0; border-top: 1px solid var(--line); padding: 12px 0; font-size: 15px; }
.topic-source .note-meta { display: block; margin: 4px 0 0; }
.topic-return { margin: 0 0 20px; }

@media (max-width: 900px) { .topic-evidence summary { min-height: 44px; } }

/* Quiet rows earn their affordance from a verb, arrow, hover and focus. */
.utility-action { width:100%; justify-content:space-between; padding:8px 12px; text-align:left; gap:12px; }
.utility-action .icon { width:16px; height:16px; color:var(--quiet); }
.collection-footer { flex:none; padding:12px 8px; border-top:1px solid var(--line); }
.collection-footer #createColleague { width:100%; font-size:13px; padding:8px 12px; }
.app-sidebar .rail-footer { gap:4px; border:0; }
.app-sidebar .rail-footer .account-button { border:0; background:none; color:var(--quiet); }
.settings-sharing { margin:24px 0; }
.settings-sharing h3 { margin:0 0 8px; font-size:15px; font-weight:500; }
/* Settings text shares one edge; row hit areas extend around that edge. */
#settingsDialog .utility-action {
  width: calc(100% + 24px);
  margin-inline: -12px;
  padding-inline: 11px;
  min-height: 44px;
}
#settingsDialog .dialog-heading .icon-button { margin-right: -12px; }
#settingsDialog #organisationActions { display: grid; gap: 4px; }
#settingsDialog #organisationActions[hidden] { display: none; }
#settingsDialog #openWorkConnections { margin-bottom: 24px; }
#settingsDialog .settings-sharing { margin: 24px 0; }
#settingsDialog h3 { font-size: 14px; font-weight: 500; }
#settingsDialog #settingsState:empty { display: none; }
#settingsDialog #disconnect { margin-top: 16px; }
.topbar #openCall { flex-shrink:0; }
@media(max-width:900px) { .collection-footer #createColleague { min-width:44px; } .topbar #openCall { min-width:44px; } .topbar #openCall #callButtonName { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0,0,0,0); } }

/* Direct work-sharing shortcuts stay visible without competing with chats. */
.app-sidebar .rail-footer .sharing-shortcut { color: var(--quiet); }
.app-sidebar .rail-footer .sharing-shortcut:hover { color: var(--ink); }

/* Work tool setup reuses the existing dialog and quiet connection rows. */
#workConnectionsDialog { max-height: min(88dvh, 780px); overflow-y: auto; }
#workConnectionsDialog .dialog-heading { display:flex; align-items:center; justify-content:space-between; }
#workConnectionsDialog .dialog-heading h2 { margin:0; }
#workConnectionsDialog .connection-list { margin:16px 0 24px; }
#workConnectionsDialog .connection-list button { width:100%; justify-content:space-between; }
#workConnectionsDialog .connection-list span { color:var(--quiet); font-size:13px; }
.connection-option { display:flex; align-items:flex-start; gap:12px; margin:16px 0 8px; line-height:1.65; cursor:pointer; }
.connection-option input[type="checkbox"] { width:18px; height:18px; flex:none; margin:3px 0 0; accent-color:var(--moss); }
.work-channel-list { max-height:40dvh; overflow-y:auto; margin:16px 0; }
#workConnectionsDialog form { display:block; }
#workConnectionsDialog input[type="password"] { width:100%; margin:8px 0; }
#workConnectionsDialog footer { margin-top:16px; }
#automaticColleagues .utility-action { width:100%; }

/* A recognisable portrait at chat-list scale, shared with the call character. */
.brand-mark svg {width:24px;height:24px;display:block}

.profile-avatar {width:80px;height:80px;border-radius:50%;object-fit:cover;display:block;margin:0 auto 24px}

.profile-portrait {display:flex;align-items:center;gap:16px;margin-bottom:12px}
.profile-portrait .profile-avatar {margin:0;flex-shrink:0}
.profile-portrait button {text-align:left}

/* Private sources and drafts reuse the connection rows and chat working area. */
.private-drafts:empty{display:none}.private-drafts{padding:0 24px;max-height:35vh;overflow:auto}.private-drafts details{border-top:1px solid var(--border);padding:12px 0}.email-draft-body{white-space:pre-wrap;overflow-wrap:anywhere}.private-drafts a{display:inline-block;margin-left:12px}#privateChatLabel{overflow-wrap:anywhere}#privateKnowledge{margin:16px 0}#privateOriginal{max-height:300px;overflow:auto;overflow-wrap:anywhere}

#privateChatLabel{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%;line-height:20px}#privateChatLabel[hidden]{display:none}

#personalGmailPane .connection-list{margin:12px 0}#personalGmailPane .connection-list button{display:flex;width:100%;justify-content:space-between}#personalGmailPane .connection-list button>span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}#personalGmailPane .connection-list small{color:var(--quiet);flex-shrink:0}#personalRows .utility-action{flex-direction:column;align-items:flex-start;gap:4px}#personalRows small{max-width:100%;overflow-wrap:anywhere;white-space:normal}

#gmailCharacterChoice { margin:16px 0; }
#gmailCharacterChoice label { display:block; margin-bottom:8px; }
#gmailCharacterChoice .select-host { display:block; }
#gmailCharacterChoice .select-trigger { width:100%; }
.integration-automation { margin-top:24px; color:var(--quiet); }
.integration-automation summary { cursor:pointer; }
#workConnectionsWorkspace:empty { display:none; }

#workConnectionsHome .connection-list button { border-radius:0; border-bottom:1px solid var(--line); min-height:48px; }
#workConnectionsHome .connection-list .integration-name { color:var(--ink); font-size:15px; }

/* Colleague picker: one disclosed person's actions, optional group selection. */
.people-dialog { width: min(480px, calc(100vw - 32px)); }
#peopleRows { max-height: min(50vh, 440px); overflow-y: auto; margin-top: 16px; }
.person-item { display: grid; grid-template-columns: minmax(0, 1fr) 44px; border-bottom: 1px solid var(--line); }
.person-row { display: flex; width: 100%; gap: 12px; text-align: left; align-items: center; padding: 12px 0; }
.person-row > span { min-width: 0; display: grid; }
.person-row small { color: var(--quiet); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person-row:hover { background: var(--rail); }
.person-select { display: grid; place-items: center; margin: 0; }
.person-select input { width: 18px; height: 18px; margin: 0; accent-color: var(--moss); }
.person-actions { grid-column: 1 / -1; padding: 0 0 12px 52px; display: flex; gap: 16px; }
.person-actions[hidden] { display: none; }
.people-actions { display: flex; gap: 12px; margin-top: 16px; }
.people-actions button { min-height: 44px; }
.call-selected-people { color: var(--quiet); margin: 12px 0; }
#groupChatTitle { font-weight: 500; max-width: 100%; overflow-wrap: anywhere; }
#callPeopleState { display: flex; flex-wrap: wrap; gap: 8px; }
#callPeopleState button[aria-pressed="true"] { color: var(--ink); background: var(--rail); }

.person-row { justify-content: flex-start; }
.person-row > span > span { color: var(--ink); }
.chat-identity.group-identity .select-host { display: none; }

.message-byline time { margin-left: .6rem; color: var(--quiet); font-size: .75rem; font-weight: 400; }

.message.call-message .message-byline { color: var(--ink); font-size: .875rem; }
.message.call-message.assistant .message-byline img { display:block; border-radius:50%; object-fit:cover; }

/* Starting a chat stays in the conversation pane; only group choice discloses. */
.inline-people { width: 100%; max-width: 640px; padding: 32px; margin: 0 auto; }
.inline-people #peopleRows { max-height: none; }
.inline-people .dialog-heading { margin-bottom: 16px; }
.inline-people .dialog-heading h2 { margin: 0; font-size: 20px; font-weight: 500; }
#chooseGroup { margin-top: 20px; color: var(--quiet); }
#openCall { border-left: 1px solid var(--line); border-radius: 0; padding-left: 16px; }
@media (max-width: 900px) { .inline-people { padding: 24px 20px; } #openCall { padding-left: 12px; } }

/* A new conversation chooses a recipient; established threads show identity. */
#newChatTitle { display: none; font-size: 15px; }
.workspace.new-chat .topbar #headerAvatar,
.workspace.new-chat .topbar .chat-identity,
.workspace.new-chat .topbar #headerProfileAction,
.workspace.new-chat .topbar #openCall { display: none; }
.workspace.new-chat #newChatTitle { display: inline; }
.character-choice { margin: 24px 0; }
.character-choice > label { display: block; font-size: 13px; color: var(--quiet); margin-bottom: 8px; }
#chatRecipient { display: flex; gap: 8px; align-items: center; }
#chatRecipient .select-host { flex: 1; min-width: 0; }
#chatRecipient #colleagueSelect-trigger { width: 100%; max-width: none; min-height: 44px; border: 1px solid var(--input-border); border-radius: var(--control); background: var(--surface); padding: 10px 12px; }
#headerName { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.group-identity #headerName { display: none; }
.call-choice-section { border-top: 1px solid var(--line); margin-top: 24px; padding-top: 24px; }
.call-choice-section h2 { color: var(--quiet); font-size: 14px; font-weight: 400; margin: 0 0 12px; }
.call-choice { width: 100%; display: flex; justify-content: flex-start; gap: 12px; min-height: 56px; text-align: left; padding: 8px 0; }
.call-choice span { color: var(--ink); flex: 1; min-width: 0; overflow-wrap: anywhere; }
.call-choice .icon { color: var(--quiet); flex-shrink: 0; }
.workspace.new-chat .welcome { padding-top: 32px; }

.workspace:not(.new-chat) .character-choice,
.workspace:not(.new-chat) #chooseGroup,
.workspace:not(.new-chat) .call-choice-section { display: none; }

/* One participant selection serves text and call actions. */
.participants { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 12px; }
.participant { position: relative; width: 88px; display: grid; justify-items: center; gap: 8px; padding: 8px 4px; border: 1px solid transparent; min-height: 100px; }
.participant img { width: 56px; height: 56px; border-radius: 50%; }
.participant > span:last-child { width: 100%; font-size: 13px; color: var(--quiet); overflow-wrap: anywhere; }
.participant[aria-pressed="true"] { border-color: var(--moss); background: var(--rail); }
.participant[aria-pressed="true"] > span:last-child { color: var(--ink); }
.participant-check { position: absolute; top: 5px; right: 5px; color: var(--moss); font-size: 13px; visibility: hidden; }
.participant[aria-pressed="true"] .participant-check { visibility: visible; }
.participant-actions { margin-top: 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.participant-actions .field-help { margin: 0; }
#chatRecipient { justify-content: flex-end; }
#participantsState:empty { display: none; }

#participantsLabel { display: flex; align-items: center; justify-content: space-between; }
.participants { flex-wrap: nowrap; overflow-x: auto; padding: 4px; margin: -4px; }
.participant { flex: 0 0 88px; }
.participant > span:last-child { line-height: 1.35; height: 2.7em; overflow: hidden; }

.calendar-invite-row { display: flex; flex-direction: column; align-items: flex-start; text-align: left; width: 100%; gap: 4px; padding: 12px 0; border-bottom: 1px solid var(--line); }
#calendarInviteAddresses p { margin: 4px 0; overflow-wrap: anywhere; }
#calendarInviteDetail h3 { font-size: 16px; font-weight: 500; }

.calendar-invite-row > span:first-child { color: var(--ink); }
