:root {
  --navy: #0b1736;
  --muted: #667085;
  --blue: #0066ff;
  --blue-dark: #004dcc;
  --line: #e6ebf2;
  --surface: #ffffff;
  --soft: #f5f8fc;
  --green: #13a86b;
  --amber: #cc7a00;
  --red: #d92d20;
  --shadow: 0 12px 30px rgba(11, 23, 54, 0.07);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--soft);
  color: var(--navy);
}

a {
  color: var(--blue);
  text-decoration: none;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(0, 102, 255, 0.22);
  outline-offset: 2px;
}

input,
select,
textarea,
button {
  font: inherit;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  color: var(--navy);
  background: #fff;
}

textarea {
  resize: vertical;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
}

code {
  background: #eef4ff;
  border-radius: 6px;
  padding: 3px 6px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(180px, auto) minmax(500px, 1fr) max-content;
  align-items: center;
  gap: clamp(14px, 2vw, 28px);
  padding: 10px clamp(16px, 3vw, 36px);
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.topbar-left,
.topbar-utilities {
  min-width: 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  color: var(--navy);
}

.brand-mark {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border: 1px solid #dfe8ff;
  border-radius: 999px;
  background: #fff;
  color: #fff;
  font-weight: 900;
  overflow: hidden;
  padding: 3px;
}

.brand-mark img {
  width: 100%;
  height: 100%;
  border-radius: 999px;
  object-fit: contain;
}

.brand small {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.2;
}

.brand strong {
  white-space: nowrap;
}

.nav {
  display: flex;
  align-items: center;
  gap: clamp(8px, 1.1vw, 16px);
}

.primary-nav {
  justify-content: center;
}

.nav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 2px 10px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 850;
  line-height: 1;
  white-space: nowrap;
}

.nav a:hover,
.nav a.is-active {
  color: var(--navy);
}

.nav a.is-active::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 3px;
  height: 2px;
  border-radius: 999px;
  background: var(--blue);
}

.topbar-utilities {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: nowrap;
  min-width: max-content;
}

.account-area {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: max-content;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 8px 6px 12px;
  background: #fff;
}

.account-area form {
  margin: 0;
}

.account-area::before {
  content: "";
  display: none;
}

.account-name {
  max-width: 132px;
  overflow: hidden;
  color: var(--navy);
  font-weight: 850;
  font-size: 0.86rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-security-link {
  text-decoration: none;
}

.account-security-link:hover,
.account-security-link:focus-visible {
  color: var(--blue);
}

.staff-security-panel {
  grid-column: 2;
}

.panel-divider {
  height: 1px;
  margin: 18px 0;
  background: var(--line);
}

.staff-presence {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: max-content;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 9px;
  background: #f8fbff;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.staff-presence .presence-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #98a2b3;
}

.staff-presence.is-online {
  border-color: #b7ebcf;
  background: #ecfdf3;
  color: #067647;
}

.staff-presence.is-online .presence-dot {
  background: #12b76a;
}

.staff-status-list {
  display: grid;
  gap: 10px;
}

.staff-status-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}

.staff-status-item:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.staff-status-item strong,
.staff-status-item small {
  display: block;
}

.link-button {
  border: 0;
  background: transparent;
  color: var(--navy);
  font-weight: 800;
  cursor: pointer;
}

.notify-button {
  border: 1px solid #cfe0ff;
  border-radius: 999px;
  background: #eef4ff;
  color: var(--blue);
  padding: 7px 10px;
  font-size: 0.82rem;
  font-weight: 900;
  line-height: 1.1;
  white-space: nowrap;
  cursor: pointer;
}

.notify-button-secondary {
  background: #fff;
  color: var(--muted);
}

.notify-button.is-enabled {
  border-color: #b7ebd2;
  background: #e8fff5;
  color: #067647;
}

.logout-button {
  color: var(--muted);
  font-size: 0.84rem;
  white-space: nowrap;
  border-left: 1px solid var(--line);
  padding-left: 8px;
}

.logout-button:hover {
  color: var(--red);
}

.nav-toggle {
  display: none;
}

.shell {
  width: min(1240px, calc(100% - 32px));
  margin: 28px auto 48px;
}

.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-card,
.panel,
.metric-card,
.conversation-meta,
.chat-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.auth-card {
  width: min(420px, 100%);
  padding: 28px;
}

.staff-register-card {
  width: min(520px, 100%);
}

.auth-brand {
  margin-bottom: 24px;
}

.page-heading,
.panel-header,
.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.page-heading {
  margin-bottom: 20px;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 6px;
  font-size: clamp(1.65rem, 2.4vw, 2.2rem);
}

h2 {
  font-size: 1.15rem;
}

p {
  color: var(--muted);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 10px 15px;
  background: #fff;
  color: var(--navy);
  border-color: var(--line);
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
}

.button:disabled {
  opacity: 0.6;
  cursor: wait;
}

.button-primary {
  background: var(--blue);
  color: #fff;
}

.button-primary:hover {
  background: var(--blue-dark);
}

.button-secondary {
  background: #fff;
  color: var(--blue);
  border-color: #cfe0ff;
}

.button-secondary:hover {
  background: #eef4ff;
}

.button-danger {
  background: #fff1f0;
  color: var(--red);
  border-color: #ffd6d2;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.metric-card {
  min-height: 108px;
  padding: 16px;
}

.metric-card span {
  color: var(--muted);
  font-weight: 800;
}

.metric-card strong {
  display: block;
  margin-top: auto;
  font-size: 2.05rem;
  line-height: 1;
}

.metric-link {
  display: flex;
  flex-direction: column;
  gap: 14px;
  color: var(--navy);
}

.metric-link:hover {
  border-color: #cfe0ff;
  background: #f8fbff;
}

.muted,
.eyebrow {
  color: var(--muted);
}

.eyebrow {
  margin: 0 0 6px;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.command-heading {
  align-items: center;
  padding: 2px 0 0;
}

.quick-actions,
.quick-action-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.command-heading .quick-actions .button {
  min-width: 142px;
}

.command-metric-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.command-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 18px;
}

.command-panel {
  min-width: 0;
}

.command-panel > .empty {
  display: grid;
  min-height: 84px;
  place-items: center;
  border: 1px dashed #d9e3f3;
  border-radius: 8px;
  background: #fbfdff;
  padding: 16px;
}

.command-panel-wide {
  grid-column: span 2;
}

.pipeline-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  gap: 10px;
}

.pipeline-command-content {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 280px);
  gap: 18px;
  align-items: start;
}

.pipeline-stage-summary {
  display: block;
  min-width: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbff;
  color: var(--navy);
  overflow: hidden;
}

.pipeline-stage-summary .status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 8px;
  min-height: 46px;
  border-radius: 0;
  padding: 10px 12px;
  text-transform: none;
}

.pipeline-stage-summary strong {
  font-size: 1.2rem;
  line-height: 1;
  color: inherit;
}

.pipeline-value-box,
.work-list,
.attention-list,
.compact-activity-list {
  display: grid;
  gap: 10px;
}

.pipeline-value-box {
  align-self: stretch;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fbfdff;
}

.pipeline-value-box h3 {
  margin: 0;
  font-size: 1rem;
}

.currency-total,
.work-item,
.attention-item,
.activity-item {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfdff;
}

.currency-total {
  grid-template-columns: 1fr;
  gap: 4px;
}

.currency-total strong {
  color: var(--navy);
  font-size: 1.12rem;
}

.currency-total span,
.currency-total small,
.work-item span,
.attention-item small,
.attention-meta,
.activity-item p,
.activity-item small,
.activity-item time {
  color: var(--muted);
}

.work-item,
.attention-item {
  color: var(--navy);
}

.work-list {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.work-item {
  min-height: 82px;
  align-content: space-between;
}

.work-item strong {
  color: var(--navy);
  font-size: 1.55rem;
  line-height: 1;
}

.attention-item {
  grid-template-columns: minmax(0, 1fr) minmax(240px, auto);
  align-items: start;
}

.attention-item.is-high-priority {
  border-color: #ffd6d2;
}

.attention-item.is-overdue {
  background: #fffafa;
}

.attention-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  text-align: right;
}

.activity-item {
  grid-template-columns: minmax(0, 1fr) auto;
  position: relative;
  border-left: 3px solid #dbe8ff;
  padding-left: 14px;
}

.activity-item p {
  margin: 4px 0 0;
}

.activity-item time {
  white-space: nowrap;
}

.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.section-heading h2 {
  margin: 0 0 4px;
  font-size: 1.08rem;
}

.section-heading p {
  margin-bottom: 0;
  font-size: 0.94rem;
}

.section-heading > a {
  flex: 0 0 auto;
  font-weight: 850;
}

.command-table-wrap table {
  min-width: 820px;
}

.quick-action-grid {
  gap: 8px;
}

.quick-action-grid .button {
  min-height: 40px;
}

.panel {
  padding: 20px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

th,
td {
  padding: 13px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.conversation-row {
  transition: background-color 0.2s ease;
}

.conversation-row--attention {
  background: #f8fbff;
}

.conversation-row--attention .conversation-visitor-name {
  color: var(--navy);
  font-weight: 950;
}

.conversation-visitor-cell {
  min-width: 180px;
}

.conversation-visitor-main {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.conversation-visitor-name {
  min-width: 0;
  max-width: 170px;
  overflow: hidden;
  color: var(--navy);
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

th {
  color: var(--muted);
  font-size: 0.82rem;
  text-transform: uppercase;
}

.empty {
  color: var(--muted);
  text-align: center;
}

.empty-state {
  max-width: 620px;
  margin: 80px auto;
  text-align: center;
}

.badge,
.online-dot {
  display: inline-grid;
  place-items: center;
  margin-left: 6px;
}

.badge {
  min-width: 20px;
  height: 20px;
  border-radius: 999px;
  background: var(--blue);
  color: #fff;
  font-size: 0.75rem;
}

.badge-muted,
.nav-unread-badge {
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: #eaf2ff;
  color: var(--blue-dark);
  font-weight: 950;
  line-height: 1;
}

.badge-muted {
  width: auto;
  min-width: 0;
  padding: 0 8px;
}

.nav-unread-badge {
  min-width: 18px;
  height: 18px;
  padding: 0 6px;
  font-size: 0.7rem;
}

.conversation-attention-badge {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  min-width: 21px;
  height: 21px;
  border: 1px solid #bdd7ff;
  border-radius: 999px;
  padding: 0 6px;
  background: #eaf2ff;
  color: var(--blue-dark);
  font-size: 0.72rem;
  font-weight: 950;
  line-height: 1;
}

.online-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #98a2b3;
}

.online-dot.is-online {
  background: var(--green);
}

.online-dot.is-offline {
  background: #98a2b3;
}

.conversation-presence-dot {
  flex: 0 0 auto;
  margin-left: 0;
  box-shadow: 0 0 0 3px rgba(152, 162, 179, 0.14);
}

.conversation-presence-dot.is-online {
  box-shadow: 0 0 0 3px rgba(19, 168, 107, 0.15);
}

[hidden] {
  display: none !important;
}

.visitor-presence.is-online {
  color: #067647;
  font-weight: 800;
}

.visitor-presence.is-offline {
  color: var(--muted);
}

.status {
  display: inline-flex;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 0.8rem;
  font-weight: 900;
  text-transform: capitalize;
}

.status-open {
  background: #e8fff5;
  color: #067647;
}

.status-lead {
  background: #eef4ff;
  color: var(--blue);
}

.status-new,
.status-discovery {
  background: #eef4ff;
  color: var(--blue);
}

.status-qualified,
.status-client,
.status-won {
  background: #e8fff5;
  color: #067647;
}

.status-opportunity,
.status-proposal,
.status-negotiation {
  background: #fff7e6;
  color: var(--amber);
}

.status-inactive,
.status-lost {
  background: #eef1f6;
  color: #475467;
}

.status-pending {
  background: #fff7e6;
  color: var(--amber);
}

.status-overdue {
  background: #fff1f0;
  color: var(--red);
}

.status-completed {
  background: #e8fff5;
  color: #067647;
}

.status-cancelled {
  background: #eef1f6;
  color: #475467;
}

.status-closed {
  background: #eef1f6;
  color: #475467;
}

.handling-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 0.8rem;
  font-weight: 900;
  white-space: nowrap;
}

.handling-human {
  background: #eef1f6;
  color: #475467;
}

.handling-ai {
  background: #eef4ff;
  color: var(--blue);
}

.handling-handoff {
  background: #fff1f0;
  color: var(--red);
}

[data-assigned-to-cell],
[data-handoff-reason-cell] {
  max-width: 150px;
  color: #475467;
  font-size: 0.88rem;
  font-weight: 800;
}

[data-handoff-reason-cell] {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.handoff-callout {
  display: grid;
  gap: 5px;
  margin-bottom: 14px;
  border: 1px solid #fecaca;
  border-radius: 8px;
  padding: 12px;
  background: #fff7f7;
  color: #7f1d1d;
}

.handoff-callout strong {
  color: var(--red);
}

.takeover-form {
  margin-bottom: 14px;
}

.attention-item.is-handoff {
  border-color: #fecaca;
  background: #fffafa;
}

.last-message-preview {
  max-width: 360px;
  overflow: hidden;
  line-height: 1.35;
  color: #475467;
  overflow-wrap: anywhere;
}

.last-message-preview [data-last-message-preview-text] {
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.priority {
  display: inline-flex;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 0.8rem;
  font-weight: 900;
  text-transform: capitalize;
}

.priority-low {
  background: #eef1f6;
  color: #475467;
}

.priority-normal {
  background: #eef4ff;
  color: var(--blue);
}

.priority-high {
  background: #fff1f0;
  color: var(--red);
}

.filters {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  align-items: end;
  gap: 14px;
  margin-bottom: 18px;
}

.conversation-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.conversation-filters > label {
  flex: 1 1 145px;
  min-width: 135px;
}

.conversation-filters .conversation-search-control {
  flex: 2 1 310px;
  min-width: min(100%, 260px);
}

.field-help {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 600;
}

.conversation-filter-actions {
  display: flex;
  flex: 0 1 auto;
  align-items: center;
  gap: 8px;
}

.conversation-queue-panel {
  display: grid;
  gap: 12px;
}

.bulk-selection-bar,
.conversation-bulk-toolbar,
.bulk-action-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.bulk-selection-bar {
  min-height: 38px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.bulk-select-all-label {
  display: inline-flex;
  grid-template-columns: none;
  align-items: center;
  gap: 8px;
  color: var(--navy);
}

.bulk-select-all-label input,
.conversation-select-column input {
  width: 16px;
  height: 16px;
  margin: 0;
}

.bulk-selection-count {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
}

.bulk-clear-selection {
  min-height: 34px;
  padding: 7px 10px;
}

.conversation-bulk-toolbar {
  border: 1px solid #d8e6f8;
  border-radius: 8px;
  padding: 10px;
  background: #f8fbff;
}

.conversation-bulk-toolbar[hidden],
.bulk-action-result[hidden],
.bulk-clear-selection[hidden] {
  display: none !important;
}

.bulk-action-group {
  padding-left: 8px;
  border-left: 1px solid var(--line);
}

.bulk-action-group select,
.bulk-action-group input {
  min-width: 150px;
  padding-block: 9px;
}

.bulk-resolve-group input {
  min-width: 210px;
}

.conversation-bulk-toolbar .button {
  min-height: 38px;
  padding: 8px 12px;
}

.bulk-action-result {
  border: 1px solid #cfe0ff;
  border-radius: 8px;
  padding: 10px 12px;
  background: #f5f9ff;
  color: var(--navy);
  font-size: 0.88rem;
}

.bulk-action-result.is-error {
  border-color: #ffd6d2;
  background: #fff7f7;
  color: var(--red);
}

.bulk-action-result ul {
  margin: 7px 0 0;
  padding-left: 20px;
}

.conversation-select-column {
  width: 34px;
  min-width: 34px;
  padding-inline: 6px;
  text-align: center;
}

.conversation-tags-cell {
  width: 190px;
  max-width: 190px;
}

.conversation-list-tags,
.conversation-detail-tags {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.conversation-tag-chip,
.conversation-tag-more {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-height: 25px;
  border: 1px solid #cfe0ff;
  border-radius: 999px;
  padding: 3px 8px;
  background: #f4f8ff;
  color: #174ea6;
  font-size: 0.76rem;
  font-weight: 850;
  line-height: 1.2;
}

.conversation-tag-chip > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversation-tag-more {
  border-color: #d8dee8;
  background: #f8fafc;
  color: var(--muted);
}

.conversation-tags-none,
.conversation-tags-empty {
  color: var(--muted);
  font-size: 0.82rem;
}

.followup-filters {
  grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
  margin-bottom: 0;
}

.form-stack {
  display: grid;
  gap: 15px;
}

.registration-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.registration-summary input[readonly] {
  background: #f8fbff;
  color: var(--navy);
  cursor: default;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 15px;
}

.pipeline-board {
  display: grid;
  grid-template-columns: repeat(7, minmax(220px, 1fr));
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.pipeline-column {
  min-width: 220px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.pipeline-column-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 13px;
  border-bottom: 1px solid var(--line);
}

.pipeline-column-header h2 {
  margin: 0;
}

.pipeline-stack {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.deal-card {
  display: grid;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #f8fbff;
  color: var(--navy);
}

.deal-card:hover {
  border-color: #cfe0ff;
  background: #eef4ff;
}

.deal-card span,
.deal-card small,
.pipeline-empty {
  color: var(--muted);
}

.pipeline-empty {
  padding: 12px;
  text-align: center;
}

.followup-board {
  display: grid;
  gap: 18px;
  margin-top: 18px;
}

.followup-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.followup-section-overdue {
  border-color: #ffd6d2;
}

.followup-list {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.followup-card {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #f8fbff;
  color: var(--navy);
}

.followup-card:hover {
  border-color: #cfe0ff;
  background: #eef4ff;
}

.followup-card.is-high-priority {
  border-color: #ffd6d2;
}

.followup-card.is-completed {
  background: #fbfdfc;
}

.followup-card-head,
.followup-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.followup-card-head {
  justify-content: space-between;
}

.followup-card small,
.followup-meta {
  color: var(--muted);
}

.staff-safety-panel,
.invitation-result {
  display: grid;
  gap: 14px;
  margin-bottom: 18px;
}

.staff-safety-panel {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  border-color: #cfe0ff;
  background: #f8fbff;
}

.permission-groups {
  display: grid;
  gap: 16px;
}

.permission-group {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fbfdff;
}

.permission-group h3 {
  margin: 0;
  font-size: 1rem;
}

.permission-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(230px, auto) minmax(190px, 240px);
  gap: 12px;
  align-items: center;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.permission-row:first-of-type {
  border-top: 0;
}

.permission-row small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

.site-grid,
.conversation-layout {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.check-row {
  grid-template-columns: auto 1fr;
  align-items: center;
  color: var(--navy);
}

.check-row input {
  width: auto;
}

.actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.actions form {
  margin: 0;
}

.conversation-meta {
  padding: 20px;
}

.conversation-meta dl {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 11px;
}

.conversation-meta dt {
  color: var(--muted);
  font-weight: 800;
}

.conversation-meta dd {
  margin: 0;
}

.detail-list {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 12px;
  margin: 12px 0 0;
}

.detail-list dt {
  color: var(--muted);
  font-weight: 800;
}

.detail-list dd {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
}

.linked-section-header {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.back-link {
  display: inline-block;
  margin-bottom: 18px;
  font-weight: 900;
}

.status-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  margin-top: 18px;
}

.handling-control {
  display: grid;
  gap: 10px;
  margin-top: 18px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.conversation-coordination {
  display: grid;
  gap: 7px;
  margin-top: 18px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.conversation-tags-panel {
  display: grid;
  gap: 10px;
  margin-top: 18px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.conversation-tags-panel h2 {
  margin: 0;
  font-size: 1rem;
}

.conversation-detail-tags {
  min-height: 27px;
}

.conversation-tag-chip--removable {
  gap: 3px;
  padding-right: 3px;
}

.conversation-tag-chip--removable form {
  display: inline-flex;
  margin: 0;
}

.conversation-tag-chip--removable button {
  display: inline-grid;
  width: 21px;
  height: 21px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  padding: 0;
  background: transparent;
  color: #476487;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
}

.conversation-tag-chip--removable button:hover {
  background: #e2edff;
  color: var(--blue-dark);
}

.conversation-tag-apply-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.conversation-tag-apply-form .button {
  min-height: 41px;
  padding-inline: 11px;
}

.conversation-tag-create {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.conversation-tag-create summary {
  width: fit-content;
  color: var(--blue);
  cursor: pointer;
}

.conversation-tag-create form {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.conversation-tag-create .button {
  justify-self: start;
}

.conversation-tag-error {
  margin: 0;
  border: 1px solid #ffd6d2;
  border-radius: 8px;
  padding: 8px 10px;
  background: #fff7f7;
  color: var(--red);
  font-size: 0.82rem;
  font-weight: 800;
}

.conversation-coordination h2 {
  margin: 0;
  font-size: 1rem;
}

.conversation-coordination p {
  margin: 0;
  border: 1px solid #dbe8ff;
  border-radius: 8px;
  padding: 8px 10px;
  background: #f8fbff;
  color: #475467;
  font-size: 0.88rem;
  font-weight: 800;
  line-height: 1.35;
}

[data-conversation-typing] {
  border-color: #cfe0ff;
  color: var(--blue);
}

.handling-control h2 {
  margin: 0;
  font-size: 1rem;
}

.handling-control form {
  display: grid;
  gap: 10px;
}

.handling-control label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-weight: 800;
}

.resolution-control {
  display: grid;
  gap: 10px;
  margin-top: 18px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.resolution-control h2 {
  margin: 0;
  font-size: 1rem;
}

.resolution-control form {
  display: grid;
  gap: 10px;
}

.resolution-control label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-weight: 800;
}

.resolution-summary {
  display: grid;
  gap: 5px;
  border: 1px solid #d8dee8;
  border-radius: 8px;
  padding: 12px;
  background: #f8fafc;
  color: #475467;
  font-size: 0.9rem;
}

.resolution-summary strong {
  color: var(--ink);
}

.resolution-summary p {
  margin: 4px 0 0;
  line-height: 1.45;
}

.danger-zone {
  display: grid;
  gap: 10px;
  margin-top: 18px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.danger-zone h2 {
  margin: 0;
  color: var(--red);
}

.chat-panel {
  display: grid;
  grid-template-rows: auto minmax(320px, 52vh) auto auto auto auto;
  min-height: 620px;
  overflow: hidden;
}

.chat-header {
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.message-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
  overflow-y: auto;
}

.message {
  max-width: min(680px, 88%);
}

.message-admin {
  align-self: flex-end;
}

.message-ai {
  align-self: flex-start;
}

.message-system {
  align-self: center;
  max-width: min(620px, 92%);
}

.message-body {
  padding: 12px 14px;
  border-radius: 8px;
  background: #f0f4f9;
  line-height: 1.45;
  white-space: pre-wrap;
}

.message-admin .message-body {
  background: var(--blue);
  color: #fff;
}

.message-ai .message-body {
  background: #eef4ff;
  border: 1px solid #cfe0ff;
  color: #0b1736;
}

.message-system .message-body {
  background: #f5fbff;
  border: 1px solid #cfe0ff;
  color: #344054;
}

.message-sender-badge {
  display: inline-flex;
  margin-bottom: 5px;
  border-radius: 999px;
  padding: 3px 7px;
  background: #eef4ff;
  color: var(--blue);
  font-size: 0.72rem;
  font-weight: 900;
}

.message time {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.78rem;
}

.message-admin time {
  text-align: right;
}

.message-attachments {
  display: grid;
  gap: 7px;
  margin-top: 7px;
}

.message-attachment {
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(360px, 100%);
  border: 1px solid #cfddf0;
  border-radius: 8px;
  padding: 9px;
  background: #fff;
  color: #0b1736;
  text-decoration: none;
  overflow: hidden;
}

.message-admin .message-attachment { margin-left: auto; }
.message-attachment:hover { border-color: #8dbbff; }
.message-attachment img { width: 88px; height: 64px; border-radius: 6px; object-fit: cover; background: #eef3f8; }
.attachment-file-icon { flex: 0 0 42px; display: grid; place-items: center; height: 42px; border-radius: 7px; background: #eef4ff; color: var(--blue); font-size: .65rem; font-weight: 900; }
.attachment-details { min-width: 0; display: grid; gap: 3px; }
.attachment-details strong { overflow-wrap: anywhere; font-size: .88rem; }
.attachment-details small { color: var(--muted); font-size: .76rem; }

.conversation-reply-section {
  display: grid;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding: 16px;
  background: #fff;
  box-sizing: border-box;
}

.conversation-reply-section[hidden],
.conversation-state-footer[hidden],
.internal-note-composer[hidden],
.internal-notes-panel[hidden],
.internal-note-form[hidden],
.internal-note-readonly[hidden] {
  display: none !important;
}

.conversation-reply-section .reply-form {
  border-top: 0;
  padding: 0;
}

.conversation-state-footer {
  display: block;
  margin: 0;
  border-top: 1px solid var(--line);
  padding: 15px 20px;
  background: #fff;
  color: #667085;
  font-weight: 900;
  line-height: 1.45;
}

.internal-note-composer,
.internal-notes-panel {
  display: grid;
  border-top: 1px solid var(--line);
  background: #fbfdff;
  box-sizing: border-box;
}

.internal-note-composer {
  gap: 10px;
  padding: 20px 24px 18px;
}

.internal-notes-panel {
  gap: 14px;
  padding: 18px 24px 20px;
}

.internal-notes-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.internal-notes-heading h2 {
  margin: 0 0 6px;
  color: var(--navy);
  font-size: 1.08rem;
  line-height: 1.2;
}

.internal-notes-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 0.93rem;
  line-height: 1.4;
}

.internal-notes-list {
  display: grid;
  gap: 12px;
  margin-top: 2px;
  max-height: 390px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 6px;
  scrollbar-gutter: stable;
}

.internal-notes-list::-webkit-scrollbar {
  width: 8px;
}

.internal-notes-list::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: #c8d7ec;
}

.internal-notes-list::-webkit-scrollbar-track {
  background: transparent;
}

.internal-note-card {
  display: grid;
  gap: 12px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  border: 1px solid #d8e6f8;
  border-left: 3px solid #8bbcff;
  border-radius: 12px;
  padding: 14px 16px 15px;
  background: #f8fbff;
  box-shadow: 0 1px 2px rgba(16, 38, 76, 0.04);
}

.internal-note-label-row {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.internal-note-icon {
  display: block;
  width: 15px;
  min-width: 15px;
  max-width: 15px;
  height: 15px;
  min-height: 15px;
  max-height: 15px;
  flex: 0 0 15px;
  color: var(--blue);
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  overflow: visible;
}

.internal-note-meta {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 3px 14px;
  align-items: start;
  color: var(--muted);
  font-size: 0.84rem;
  min-width: 0;
}

.internal-note-author {
  color: var(--navy);
  font-weight: 900;
  min-width: 0;
  overflow-wrap: anywhere;
}

.internal-note-label {
  display: inline-flex;
  align-items: center;
  color: var(--blue-dark);
  font-size: 0.72rem;
  font-weight: 950;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.internal-note-time,
.internal-note-date {
  color: var(--muted);
  line-height: 1.3;
}

.internal-note-time {
  justify-self: end;
  white-space: nowrap;
}

.internal-note-date {
  grid-column: 1 / -1;
}

.internal-note-body {
  color: #344054;
  font-size: 0.95rem;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.internal-note-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 0;
  border-top: 0;
  padding-top: 0;
}

.internal-note-composer-heading {
  display: grid;
  gap: 4px;
}

.internal-note-composer-heading label {
  color: var(--navy);
  font-weight: 900;
}

.internal-note-composer-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.internal-note-textarea-label {
  display: grid;
  gap: 0;
}

.internal-note-form textarea {
  width: 100%;
  min-height: 118px;
  box-sizing: border-box;
  border: 1px solid #d7e1ef;
  border-radius: 10px;
  padding: 12px 14px;
  color: var(--ink);
  font: inherit;
  line-height: 1.45;
  resize: vertical;
}

.internal-note-form textarea:focus {
  border-color: #8bbcff;
  outline: 3px solid rgba(47, 111, 237, 0.12);
}

.internal-note-form .button {
  justify-self: start;
  min-width: 116px;
}

.internal-note-error {
  margin: 0;
  border: 1px solid #ffd6d2;
  border-radius: 8px;
  padding: 9px 10px;
  background: #fff7f7;
  color: var(--red);
  font-size: 0.88rem;
  font-weight: 800;
}

.internal-notes-empty,
.internal-note-readonly {
  margin: 0;
}

.internal-note-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.reply-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  padding: 16px;
  border-top: 1px solid var(--line);
}

.reply-form-note {
  display: block;
  margin: 0;
  border: 1px solid #d8e6f8;
  border-radius: 10px;
  padding: 12px 14px;
  background: #f8fbff;
  color: var(--muted);
  font-weight: 800;
  line-height: 1.45;
}

.saved-replies-control {
  position: relative;
  display: flex;
  grid-column: 1 / -1;
  align-items: center;
}

.chat-attachment-control {
  display: flex;
  grid-column: 1 / -1;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.chat-attachment-control[hidden] { display: none !important; }
.attachment-input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.attachment-picker-button { min-height: 36px; padding: 8px 12px; font-size: .86rem; }
.attachment-picker-button svg { flex: 0 0 16px; width: 16px; height: 16px; }
.attachment-help { color: var(--muted); font-size: .78rem; }
.selected-attachments { display: flex; flex: 1 0 100%; flex-wrap: wrap; gap: 6px; }
.selected-attachment {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  border: 1px solid #d8e3f0;
  border-radius: 7px;
  padding: 5px 7px;
  background: #f7faff;
  color: #344054;
  font-size: .78rem;
}
.selected-attachment span { overflow-wrap: anywhere; }
.selected-attachment button { border: 0; background: transparent; color: #667085; cursor: pointer; padding: 0 2px; font: 900 1rem/1 sans-serif; }

.saved-replies-control[hidden],
.saved-replies-picker[hidden] {
  display: none !important;
}

.saved-replies-toggle {
  min-height: 36px;
  padding: 8px 12px;
  font-size: 0.88rem;
}

.saved-replies-picker {
  position: absolute;
  z-index: 12;
  top: calc(100% + 7px);
  left: 0;
  display: grid;
  width: min(620px, calc(100vw - 48px));
  max-height: 430px;
  border: 1px solid #cfe0ff;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 16px 36px rgba(11, 23, 54, 0.16);
  overflow: hidden;
}

.saved-replies-picker-heading {
  display: grid;
  gap: 3px;
  padding: 13px 14px 10px;
  border-bottom: 1px solid var(--line);
}

.saved-replies-picker-heading span,
.saved-reply-option-heading span,
.saved-reply-table-preview {
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.35;
}

.saved-replies-picker-filters {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(150px, 0.45fr);
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
}

.saved-replies-picker-filters input,
.saved-replies-picker-filters select {
  padding-block: 9px;
}

.saved-replies-results {
  display: grid;
  max-height: 265px;
  overflow-y: auto;
}

.saved-reply-option {
  display: grid;
  gap: 6px;
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--line);
  padding: 11px 14px;
  background: #fff;
  color: var(--navy);
  text-align: left;
  cursor: pointer;
}

.saved-reply-option:hover,
.saved-reply-option:focus-visible {
  background: #f5f9ff;
}

.saved-reply-option-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.saved-reply-option-preview {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  white-space: pre-wrap;
}

.saved-replies-empty {
  margin: 0;
  padding: 18px 14px;
}

.saved-replies-manage-link {
  border-top: 1px solid var(--line);
  padding: 10px 14px;
  font-size: 0.84rem;
  font-weight: 800;
}

.saved-reply-filters {
  grid-template-columns: minmax(220px, 1fr) minmax(170px, 0.55fr) minmax(140px, 0.4fr) auto;
}

.saved-reply-management-grid {
  display: grid;
  grid-template-columns: minmax(300px, 390px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.saved-reply-form-options {
  grid-template-columns: minmax(0, 1fr) 110px;
}

.saved-reply-list-panel {
  min-width: 0;
}

.saved-reply-table-preview {
  display: block;
  max-width: 360px;
  margin-top: 5px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.alert {
  margin-bottom: 16px;
  border-radius: 8px;
  padding: 12px 14px;
  font-weight: 800;
}

.alert-success {
  background: #e8fff5;
  color: #067647;
}

.alert-error {
  background: #fff1f0;
  color: var(--red);
}

.alert-warning {
  background: #fff7e6;
  color: #8a4b00;
}

.row-highlight {
  background: #eef6ff;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 50;
  width: min(360px, calc(100vw - 36px));
  border-radius: 8px;
  padding: 13px 15px;
  background: var(--navy);
  color: #fff;
  box-shadow: var(--shadow);
}

.toast-error {
  background: var(--red);
}

@media (max-width: 1399px) {
  .topbar {
    grid-template-columns: minmax(168px, auto) minmax(450px, 1fr) max-content;
    gap: 14px;
  }

  .nav {
    gap: 10px;
  }

  .nav a {
    font-size: 0.88rem;
  }

  .notify-button,
  .logout-button {
    font-size: 0.8rem;
  }

  .account-name {
    max-width: 110px;
  }

  .command-metric-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1120px) {
  .topbar {
    grid-template-columns: auto auto;
  }

  .topbar-left {
    min-width: 0;
  }

  .nav-toggle {
    justify-self: end;
  }

  .topbar-utilities {
    grid-column: 1 / -1;
    justify-content: flex-start;
    overflow-x: auto;
    padding-top: 8px;
  }

  .account-area {
    margin-left: auto;
  }

  .nav-toggle {
    display: inline-flex;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    padding: 8px 10px;
    color: var(--navy);
    font-weight: 900;
  }

  .nav {
    display: none;
    position: absolute;
    left: 16px;
    right: 16px;
    top: 124px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: var(--shadow);
  }

  .nav.is-open {
    display: grid;
    gap: 6px;
  }

  .nav a {
    padding: 11px 12px;
  }

  .page-heading,
  .panel-header,
  .section-heading,
  .chat-header,
  .staff-safety-panel,
  .permission-row,
  .reply-form,
  .internal-note-form,
  .detail-list,
  .form-grid,
  .registration-summary,
  .filters,
  .followup-filters,
  .site-grid,
  .conversation-layout {
    grid-template-columns: 1fr;
  }

  .saved-reply-management-grid {
    grid-template-columns: 1fr;
  }

  .page-heading,
  .section-heading,
  .panel-header,
  .chat-header {
    align-items: flex-start;
  }

  .metric-grid,
  .command-metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .command-grid,
  .pipeline-command-content,
  .currency-total,
  .attention-item,
  .activity-item {
    grid-template-columns: 1fr;
  }

  .pipeline-summary,
  .work-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .command-panel-wide {
    grid-column: auto;
  }

  .attention-meta {
    justify-content: flex-start;
    text-align: left;
  }

  .conversation-visitor-name {
    max-width: 138px;
  }

  .last-message-preview {
    max-width: 280px;
  }

  .chat-panel {
    min-height: 560px;
  }

  .staff-security-panel {
    grid-column: auto;
  }
}

@media (max-width: 520px) {
  .bulk-action-group,
  .conversation-bulk-toolbar {
    align-items: stretch;
  }

  .bulk-action-group {
    width: 100%;
    padding-top: 8px;
    padding-left: 0;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .bulk-action-group label,
  .bulk-action-group select,
  .bulk-action-group input {
    width: 100%;
  }

  .saved-replies-picker {
    position: fixed;
    right: 10px;
    bottom: 10px;
    left: 10px;
    top: auto;
    width: auto;
    max-height: min(72vh, 430px);
  }

  .saved-replies-picker-filters,
  .saved-reply-form-options {
    grid-template-columns: 1fr;
  }

  .saved-reply-option-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }

  .conversation-filters > label,
  .conversation-filters .conversation-search-control,
  .conversation-filter-actions {
    flex-basis: 100%;
    width: 100%;
  }

  .conversation-filter-actions .button {
    flex: 1 1 0;
  }

  .conversation-tag-apply-form {
    grid-template-columns: 1fr;
  }

  .conversation-tag-apply-form .button {
    justify-self: start;
  }

  .metric-grid,
  .command-metric-grid {
    grid-template-columns: 1fr;
  }

  .pipeline-summary,
  .work-list {
    grid-template-columns: 1fr;
  }

  .shell {
    width: min(100% - 20px, 1180px);
  }

  .topbar {
    padding-inline: 12px;
  }

  .topbar-utilities {
    gap: 8px;
  }

  .account-area {
    width: 100%;
    justify-content: space-between;
    margin-left: 0;
    padding-left: 0;
    border-left: 0;
  }

  .internal-note-composer,
  .internal-notes-panel {
    padding-inline: 16px;
  }

  .internal-notes-list {
    max-height: 320px;
  }

  .internal-note-meta {
    grid-template-columns: 1fr;
  }

  .internal-note-time {
    justify-self: start;
  }
}

.ai-panel {
  display: grid;
  gap: 16px;
  margin-bottom: 18px;
}

.ai-status-list {
  margin-top: 0;
}

.ai-test-form {
  display: flex;
  justify-content: flex-start;
}

.ai-playground-form {
  display: grid;
  gap: 16px;
}

.ai-playground-form .form-wide {
  grid-column: 1 / -1;
}

.ai-response-text {
  white-space: pre-wrap;
}
