:root {
  color: #171717;
  background: #ececea;
  font-family: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  --ink: #171717;
  --muted: #777774;
  --soft: #f1f1ef;
  --panel: #ffffff;
  --line: #dededb;
  --blue: #2667f4;
  --green: #1d9c68;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
}

body {
  min-width: 320px;
  min-height: 100%;
  overflow: hidden;
  background: #ececea;
  -webkit-font-smoothing: antialiased;
}

button,
input,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

.workspace {
  display: grid;
  grid-template-columns: 248px minmax(460px, 1fr) minmax(340px, 40%);
  width: calc(100vw - 24px);
  height: calc(100vh - 24px);
  margin: 12px;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid #d7d7d4;
  border-radius: 18px;
  box-shadow: 0 12px 40px rgb(0 0 0 / 8%);
}

.sidebar,
.conversation,
.agent-panel {
  min-width: 0;
  min-height: 0;
}

.sidebar {
  display: flex;
  flex-direction: column;
  padding: 14px 10px 12px;
  background: #f7f7f5;
  border-right: 1px solid var(--line);
}

.window-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 24px;
  padding: 0 4px 0 2px;
  margin-bottom: 12px;
}

.window-dots {
  display: flex;
  gap: 7px;
}

.window-dot {
  width: 11px;
  height: 11px;
  border-radius: 999px;
}

.window-dot.red { background: #ff5f57; }
.window-dot.yellow { background: #febc2e; }
.window-dot.green { background: #28c840; }

.icon-button {
  display: inline-grid;
  width: 32px;
  height: 32px;
  place-items: center;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}

.icon-button:hover,
.icon-button:focus-visible {
  background: #ebebe8;
  outline: none;
}

.icon-button i {
  font-size: 18px;
}

.search-wrap {
  position: relative;
  margin-bottom: 10px;
}

.search-wrap i {
  position: absolute;
  left: 10px;
  top: 50%;
  color: #8d8d89;
  font-size: 15px;
  transform: translateY(-50%);
  pointer-events: none;
}

.search-wrap input {
  width: 100%;
  height: 34px;
  padding: 0 10px 0 32px;
  color: var(--ink);
  background: #ebebe9;
  border: 1px solid #e2e2df;
  border-radius: 8px;
  outline: none;
}

.search-wrap input:focus {
  background: #fff;
  border-color: #b9b9b4;
  box-shadow: 0 0 0 3px rgb(0 0 0 / 5%);
}

.agent-list {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
}

.agent-row {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 8px;
  gap: 9px;
  align-items: center;
  width: 100%;
  min-height: 57px;
  padding: 7px 8px;
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: 9px;
  cursor: pointer;
}

.agent-row:hover,
.agent-row:focus-visible {
  background: #ededeb;
  outline: none;
}

.agent-row.is-active {
  background: #e5e5e2;
}

.agent-avatar {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  color: #fff;
  background: var(--avatar);
  border-radius: 11px;
}

.agent-avatar i {
  font-size: 21px;
}

.agent-copy {
  min-width: 0;
}

.agent-name-row {
  display: flex;
  gap: 6px;
  align-items: baseline;
  justify-content: space-between;
}

.agent-name {
  overflow: hidden;
  font-size: 14px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agent-time {
  flex: none;
  color: #94948f;
  font-size: 11px;
}

.agent-preview {
  margin-top: 2px;
  overflow: hidden;
  color: #7f7f7a;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.unread-dot {
  width: 7px;
  height: 7px;
  background: var(--blue);
  border-radius: 999px;
}

.sidebar-footer {
  display: grid;
  gap: 5px;
  padding-top: 10px;
  border-top: 1px solid #e7e7e4;
}

.footer-button,
.profile-row {
  display: flex;
  gap: 9px;
  align-items: center;
  width: 100%;
  min-height: 39px;
  padding: 6px 8px;
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: 8px;
}

button.profile-row {
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  text-align: left;
}

button.profile-row:hover {
  background: var(--surface-muted);
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px;
  background: #f6f6f4;
}

.auth-brand {
  position: fixed;
  top: 28px;
  left: 32px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
}

.auth-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: white;
  background: #ef4d5a;
}

.auth-card {
  width: min(100%, 420px);
  text-align: center;
}

.auth-card h1 {
  margin: 0 0 8px;
  font-size: 28px;
}

.auth-card > p {
  margin: 0 0 24px;
  color: #666;
}

#clerk-sign-in {
  display: flex;
  justify-content: center;
}

.footer-button {
  cursor: pointer;
}

.footer-button:hover,
.footer-button:focus-visible {
  background: #ebebe8;
  outline: none;
}

.footer-button i {
  font-size: 18px;
}

.profile-avatar {
  display: grid;
  width: 25px;
  height: 25px;
  place-items: center;
  color: #173b26;
  background: #a8dcb7;
  border-radius: 999px;
}

.profile-avatar i {
  font-size: 14px;
}

.footer-label {
  font-size: 13px;
  font-weight: 500;
}

.conversation {
  display: flex;
  flex-direction: column;
  background: #fff;
  border-right: 1px solid var(--line);
}

.conversation-header,
.panel-header {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: space-between;
  min-height: 50px;
  padding: 0 16px;
  border-bottom: 1px solid #ecece9;
}

.conversation-title {
  display: flex;
  gap: 9px;
  align-items: center;
  min-width: 0;
}

.header-avatar {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  color: white;
  background: var(--avatar);
  border-radius: 7px;
}

.header-avatar i {
  font-size: 14px;
}

.conversation-title strong {
  overflow: hidden;
  font-size: 14px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.online-dot {
  width: 7px;
  height: 7px;
  background: var(--green);
  border: 2px solid #fff;
  border-radius: 999px;
  box-shadow: 0 0 0 1px rgb(0 0 0 / 10%);
}

.header-actions {
  display: flex;
  gap: 2px;
}

.mobile-sidebar-button {
  display: none;
}

.messages {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
  padding: 24px 16px 18px;
  overflow-y: auto;
  scroll-behavior: smooth;
}

.day-divider {
  align-self: center;
  padding: 5px 0 3px;
  color: #8c8c88;
  font-size: 11px;
}

.message {
  max-width: min(72%, 620px);
  padding: 9px 12px;
  font-size: 14px;
  line-height: 1.42;
  white-space: pre-wrap;
}

.message.agent {
  align-self: flex-start;
  background: #eeeeec;
  border-radius: 8px 14px 14px 14px;
}

.message.user {
  align-self: flex-end;
  color: #fff;
  background: #111;
  border-radius: 14px 8px 14px 14px;
}

.message.error {
  align-self: flex-start;
  color: #8a2d35;
  background: #fff0f1;
  border: 1px solid #f1cfd2;
  border-radius: 8px 14px 14px 14px;
}

.message.is-streaming::after {
  margin-left: 4px;
  color: #8e8e89;
  content: "●";
  font-size: 7px;
  animation: typing 1s infinite ease-in-out;
}

.message.pending {
  display: flex;
  gap: 5px;
  width: 48px;
  justify-content: center;
}

.typing-dot {
  width: 5px;
  height: 5px;
  background: #8e8e89;
  border-radius: 999px;
  animation: typing 1s infinite ease-in-out;
}

.typing-dot:nth-child(2) { animation-delay: 120ms; }
.typing-dot:nth-child(3) { animation-delay: 240ms; }

@keyframes typing {
  0%, 60%, 100% { opacity: 0.35; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-2px); }
}

.composer-wrap {
  flex: none;
  padding: 0 14px 14px;
}

.composer {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 34px;
  gap: 6px;
  align-items: end;
  min-height: 45px;
  padding: 5px 6px;
  background: #fff;
  border: 1px solid #d6d6d2;
  border-radius: 14px;
  box-shadow: 0 2px 8px rgb(0 0 0 / 4%);
}

.composer:focus-within {
  border-color: #adada8;
  box-shadow: 0 0 0 3px rgb(0 0 0 / 5%);
}

.composer textarea {
  width: 100%;
  max-height: 110px;
  min-height: 32px;
  padding: 7px 2px 5px;
  resize: none;
  color: var(--ink);
  background: transparent;
  border: 0;
  outline: 0;
  line-height: 1.35;
}

.composer textarea::placeholder {
  color: #aaa9a5;
}

.composer button:disabled,
.composer textarea:disabled {
  cursor: default;
}

.send-button {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  color: #fff;
  background: #111;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
}

.send-button:disabled {
  color: #adada9;
  background: #eeeeeb;
  cursor: default;
}

.send-button i {
  font-size: 16px;
}

.agent-panel {
  display: flex;
  flex-direction: column;
  padding: 0 15px 16px;
  overflow-y: auto;
  background: #fafaf8;
}

.panel-header {
  margin: 0 -15px 14px;
  background: #fff;
}

.panel-header strong {
  font-size: 13px;
  font-weight: 600;
}

.live-screen {
  flex: none;
  height: clamp(230px, 43vh, 390px);
  overflow: hidden;
  background: #d4d6d5;
  border: 1px solid #d8d8d4;
  border-radius: 8px;
}

.live-screen img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.screen-caption {
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: center;
  margin: 10px 0 17px;
  color: #767671;
  font-size: 12px;
}

.screen-caption .status-pulse {
  width: 7px;
  height: 7px;
  background: var(--green);
  border-radius: 999px;
  box-shadow: 0 0 0 4px rgb(29 156 104 / 11%);
}

.routine-section {
  padding: 0 3px;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 5px;
}

.section-heading span {
  color: #777772;
  font-size: 12px;
  font-weight: 500;
}

.routine-list {
  display: grid;
  gap: 2px;
}

.routine-row {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) 30px;
  gap: 8px;
  align-items: center;
  min-height: 52px;
  padding: 7px 4px;
  border-radius: 8px;
}

.routine-row:hover {
  background: #f1f1ef;
}

.routine-icon {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  color: var(--green);
  border: 1px solid #d7d7d3;
  border-radius: 999px;
}

.routine-icon i {
  font-size: 13px;
}

.routine-copy {
  min-width: 0;
}

.routine-name {
  overflow: hidden;
  font-size: 12px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.routine-detail {
  margin-top: 2px;
  overflow: hidden;
  color: #90908a;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.switch {
  position: relative;
  width: 28px;
  height: 17px;
  padding: 0;
  background: #d2d2ce;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
}

.switch::after {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 13px;
  height: 13px;
  content: "";
  background: #fff;
  border-radius: 999px;
  box-shadow: 0 1px 2px rgb(0 0 0 / 20%);
  transition: transform 140ms ease;
}

.switch[aria-checked="true"] {
  background: var(--green);
}

.switch[aria-checked="true"]::after {
  transform: translateX(11px);
}

.drawer-backdrop,
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgb(22 22 20 / 24%);
  backdrop-filter: blur(3px);
}

.modal {
  width: min(100%, 430px);
  padding: 20px;
  background: #fff;
  border: 1px solid #dcdcd8;
  border-radius: 14px;
  box-shadow: 0 24px 70px rgb(0 0 0 / 18%);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.modal-header h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.template-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.template-card {
  display: flex;
  gap: 10px;
  align-items: center;
  min-height: 65px;
  padding: 10px;
  text-align: left;
  background: #f6f6f4;
  border: 1px solid #e5e5e1;
  border-radius: 10px;
  cursor: pointer;
}

.template-card:hover,
.template-card:focus-visible {
  background: #efefec;
  border-color: #c9c9c4;
  outline: none;
}

.template-card i {
  font-size: 21px;
}

.template-card strong,
.template-card small {
  display: block;
}

.template-card strong {
  font-size: 13px;
}

.template-card small {
  margin-top: 2px;
  color: #858580;
  font-size: 11px;
}

.settings-sheet {
  width: min(100%, 420px);
  padding: 20px;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 24px 70px rgb(0 0 0 / 18%);
}

.settings-sheet h2 {
  margin: 0 0 5px;
  font-size: 18px;
}

.settings-sheet p {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.settings-field {
  padding: 12px 0;
  border-top: 1px solid #ecece8;
}

.settings-field strong,
.settings-field span {
  display: block;
}

.settings-field strong {
  font-size: 12px;
}

.settings-field span {
  margin-top: 3px;
  color: #7f7f7a;
  font-size: 12px;
}

.settings-control {
  display: grid;
  gap: 6px;
  margin-bottom: 14px;
}

.settings-control > span {
  font-size: 12px;
  font-weight: 600;
}

.settings-control input,
.settings-control textarea {
  width: 100%;
  padding: 9px 10px;
  color: var(--ink);
  background: #fafaf8;
  border: 1px solid #dcdcd7;
  border-radius: 8px;
  outline: none;
  line-height: 1.4;
}

.settings-control textarea {
  resize: vertical;
}

.settings-control input:focus,
.settings-control textarea:focus {
  background: #fff;
  border-color: #9c9c96;
  box-shadow: 0 0 0 3px rgb(0 0 0 / 5%);
}

.settings-control small {
  color: #8b8b86;
  font-size: 11px;
  line-height: 1.35;
}

.settings-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  padding-top: 16px;
}

.primary-button,
.secondary-button {
  min-height: 36px;
  padding: 0 14px;
  border-radius: 8px;
  cursor: pointer;
}

.primary-button {
  color: #fff;
  background: #111;
  border: 1px solid #111;
}

.secondary-button {
  background: #fff;
  border: 1px solid #d6d6d1;
}

.primary-button:hover,
.primary-button:focus-visible {
  background: #30302e;
  outline: none;
}

.secondary-button:hover,
.secondary-button:focus-visible {
  background: #f1f1ee;
  outline: none;
}

/* Interaction review mockups */

.contents {
  display: contents;
}

.contents[hidden] {
  display: none;
}

.review-workspace {
  --review-blue: #3f67d8;
  --review-violet: #7655bd;
  --review-amber: #b36b16;
  --review-green: #2c8560;
}

.review-header {
  background: rgb(255 255 255 / 92%);
  backdrop-filter: blur(12px);
}

.concept-chip,
.attention-pill,
.status-pill,
.queue-count,
.live-pill {
  display: inline-flex;
  flex: none;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 999px;
}

.concept-chip {
  color: #5f5f5a;
  background: #f0f0ed;
  border: 1px solid #e2e2dd;
}

.attention-pill {
  color: #8f5312;
  background: #fff3df;
  border: 1px solid #efd7b0;
}

.status-pill {
  color: #267052;
  background: #e9f6ef;
  border: 1px solid #cce9da;
}

.queue-count {
  color: #8f5312;
  background: #fff3df;
}

.live-pill {
  gap: 5px;
  color: #176c68;
  background: #e5f7f5;
  border: 1px solid #c3e9e5;
}

.live-pill > span {
  width: 6px;
  height: 6px;
  background: #1e978f;
  border-radius: 999px;
  box-shadow: 0 0 0 3px rgb(30 151 143 / 12%);
}

.review-scroll {
  flex: 1;
  min-height: 0;
  padding: 24px clamp(16px, 3.4vw, 44px) 30px;
  overflow-y: auto;
}

.review-intro,
.canvas-title-row,
.queue-title-row {
  width: min(100%, 760px);
  margin: 0 auto 22px;
}

.review-intro h1,
.canvas-title-row h1,
.queue-title-row h1 {
  margin: 4px 0 6px;
  font-size: clamp(22px, 2.4vw, 30px);
  font-weight: 600;
  letter-spacing: -0.03em;
}

.review-intro p,
.canvas-title-row p,
.queue-title-row p {
  max-width: 620px;
  margin: 0;
  color: #777772;
  font-size: 13px;
  line-height: 1.5;
}

.eyebrow,
.interaction-kind {
  display: block;
  color: #85857f;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  line-height: 1.3;
  text-transform: uppercase;
}

.inline-concept {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}

.inline-concept .review-intro {
  align-self: center;
}

.inline-concept .day-divider {
  align-self: center;
}

.inline-concept .message {
  max-width: min(72%, 580px);
}

.interaction-card,
.task-summary-band,
.queue-list,
.context-card {
  background: #fff;
  border: 1px solid #deded9;
  border-radius: 13px;
  box-shadow: 0 1px 2px rgb(0 0 0 / 3%);
}

.interaction-card {
  width: min(92%, 640px);
  padding: 15px;
}

.inline-concept .interaction-card {
  align-self: flex-start;
}

.interaction-card p {
  margin: 11px 0 13px;
  color: #565651;
  font-size: 12px;
  line-height: 1.5;
}

.interaction-heading {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.interaction-heading > span:nth-child(2) {
  min-width: 0;
}

.interaction-heading strong {
  display: block;
  margin-top: 2px;
  overflow: hidden;
  font-size: 13px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.interaction-icon {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 9px;
}

.interaction-icon i {
  font-size: 17px;
}

.interaction-icon.amber { color: var(--review-amber); background: #fff1dd; }
.interaction-icon.blue { color: var(--review-blue); background: #edf1ff; }
.interaction-icon.violet { color: var(--review-violet); background: #f2edff; }
.interaction-icon.green { color: var(--review-green); background: #eaf6f0; }
.interaction-icon.cyan { color: #137c78; background: #e6f6f4; }
.interaction-icon.coral { color: #b33f4c; background: #fff0f1; }
.interaction-icon.neutral { color: #555550; background: #efefec; }

.handoff-wait {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  padding: 4px 7px;
  color: #98404a;
  background: #fff0f1;
  border-radius: 999px;
  font-size: 9px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  white-space: nowrap;
}

.handoff-wait > span {
  width: 6px;
  height: 6px;
  background: #d1515f;
  border-radius: 999px;
}

.handoff-card .interaction-heading strong {
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
}

.handoff-summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 3px 9px;
  align-items: center;
  padding: 10px;
  margin: 12px 0;
  background: #faf8f6;
  border: 1px solid rgb(23 23 23 / 7%);
  border-radius: 9px;
}

.handoff-channel {
  grid-row: 1 / span 2;
  display: inline-flex;
  gap: 4px;
  align-items: center;
  align-self: stretch;
  padding-right: 10px;
  color: #6f514e;
  border-right: 1px solid rgb(23 23 23 / 8%);
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
}

.handoff-summary > strong,
.handoff-summary > small {
  display: block;
  min-width: 0;
}

.handoff-summary > strong {
  font-size: 11px;
  font-weight: 600;
}

.handoff-summary > small {
  color: #85857f;
  font-size: 10px;
}

.handoff-queue-item {
  background: #fffafa;
}

.browser-preview {
  position: relative;
  min-height: 156px;
  margin: 12px 0;
  overflow: hidden;
  background: #f5f7f8;
  border: 1px solid #d9dfdf;
  border-radius: 10px;
}

.browser-toolbar {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 20px;
  gap: 7px;
  align-items: center;
  min-height: 32px;
  padding: 0 9px;
  color: #767d7c;
  background: #ecefed;
  border-bottom: 1px solid #d9dfdd;
  font-size: 9px;
}

.browser-dots {
  display: flex;
  gap: 4px;
}

.browser-dots i {
  width: 6px;
  height: 6px;
  background: #c5cac8;
  border-radius: 999px;
}

.browser-address {
  overflow: hidden;
  padding: 4px 8px;
  background: #fff;
  border: 1px solid #dfe3e2;
  border-radius: 5px;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.browser-lock {
  text-align: right;
}

.browser-page {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: center;
  min-height: 122px;
  padding: 24px;
  background: linear-gradient(135deg, #fff 0%, #f2f8fb 100%);
}

.salesforce-mark {
  display: grid;
  width: 42px;
  height: 34px;
  place-items: center;
  color: #fff;
  background: #1b96ff;
  border-radius: 50%;
  font-size: 18px;
  font-weight: 700;
}

.browser-page strong,
.browser-page small {
  display: block;
}

.browser-page strong {
  font-size: 12px;
}

.browser-page small {
  margin-top: 3px;
  color: #818783;
  font-size: 9px;
}

.agent-paused {
  position: absolute;
  right: 8px;
  bottom: 8px;
  display: inline-flex;
  gap: 4px;
  align-items: center;
  padding: 5px 7px;
  color: #64521d;
  background: rgb(255 246 211 / 94%);
  border: 1px solid #eadb9e;
  border-radius: 6px;
  font-size: 9px;
  font-weight: 600;
}

.browser-handoff {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin: -2px 0 13px;
  color: #73736e;
  font-size: 9px;
}

.browser-handoff span {
  display: inline-flex;
  gap: 4px;
  align-items: center;
}

.browser-queue-item {
  background: #f8fcfb;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 14px;
}

.detail-grid div {
  padding: 9px 10px;
  background: #f7f7f5;
  border-radius: 8px;
}

.detail-grid dt {
  color: #888882;
  font-size: 10px;
}

.detail-grid dd {
  margin: 2px 0 0;
  font-size: 12px;
  font-weight: 500;
}

.interaction-actions,
.interaction-footer,
.footer-actions {
  display: flex;
  gap: 7px;
  align-items: center;
}

.interaction-actions {
  flex-wrap: wrap;
}

.interaction-actions.end {
  justify-content: flex-end;
}

.button {
  min-height: 32px;
  padding: 0 11px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
}

.button.primary {
  margin-left: auto;
  color: #fff;
  background: #171717;
  border: 1px solid #171717;
}

.button.primary:hover,
.button.primary:focus-visible {
  background: #353532;
  outline: none;
}

.button.ghost {
  background: #fff;
  border: 1px solid #d9d9d4;
}

.button.ghost:hover,
.button.ghost:focus-visible {
  background: #f4f4f1;
  outline: none;
}

.button.danger {
  color: #9b3e44;
}

.step-progress {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  margin: 15px 0 8px;
}

.step-progress span {
  height: 4px;
  background: #e7e7e3;
  border-radius: 999px;
}

.step-progress span.done {
  background: var(--review-green);
}

.interaction-footer {
  justify-content: space-between;
  color: #868680;
  font-size: 10px;
}

.text-button {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  padding: 2px;
  color: #4f4f4a;
  background: transparent;
  border: 0;
  cursor: pointer;
  font-size: 10px;
  font-weight: 600;
}

.text-button:hover,
.text-button:focus-visible {
  color: #111;
  text-decoration: underline;
  outline: none;
}

.choice-list {
  display: grid;
  gap: 6px;
  margin: 12px 0;
}

.choice-list label {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  padding: 9px;
  background: #fafaf8;
  border: 1px solid #e7e7e2;
  border-radius: 8px;
  cursor: pointer;
}

.choice-list label:has(input:checked) {
  background: #f4f1fb;
  border-color: #cfc1ed;
}

.choice-list input {
  margin: 0;
  accent-color: var(--review-violet);
}

.choice-list strong,
.choice-list small,
.artifact-preview strong,
.artifact-preview small {
  display: block;
}

.choice-list strong {
  font-size: 11px;
}

.choice-list small,
.artifact-preview small {
  margin-top: 2px;
  color: #888882;
  font-size: 10px;
}

.artifact-preview {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 11px;
  margin: 12px 0;
  background: #f5f4f0;
  border-radius: 9px;
}

.report-mark {
  display: grid;
  width: 42px;
  height: 50px;
  place-items: center;
  color: #fff;
  background: #283849;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 600;
}

.artifact-preview strong {
  font-size: 12px;
}

.review-composer {
  align-items: center;
}

.review-composer > span {
  padding-left: 2px;
  color: #aaa9a5;
  font-size: 13px;
}

.review-context {
  gap: 13px;
}

.review-context .panel-header {
  margin-bottom: 1px;
}

.context-card {
  padding: 16px;
}

.context-card h2 {
  margin: 5px 0 7px;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.context-card p {
  margin: 0;
  color: #74746f;
  font-size: 11px;
  line-height: 1.5;
}

.context-progress,
.large-progress {
  overflow: hidden;
  background: #e9e9e5;
  border-radius: 999px;
}

.context-progress {
  height: 5px;
  margin: 16px 0 6px;
}

.context-progress span,
.large-progress span {
  display: block;
  height: 100%;
  background: #20201f;
  border-radius: inherit;
}

.context-meta {
  display: flex;
  justify-content: space-between;
  color: #85857f;
  font-size: 10px;
}

.context-section {
  padding: 14px 3px 2px;
  border-top: 1px solid #e4e4e0;
}

.participant-row,
.channel-row {
  display: grid;
  grid-template-columns: 31px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  padding: 8px 0;
}

.participant-row strong,
.participant-row small,
.channel-row strong,
.channel-row small {
  display: block;
}

.participant-row strong,
.channel-row strong {
  font-size: 11px;
}

.participant-row small,
.channel-row small {
  margin-top: 2px;
  color: #8a8a84;
  font-size: 10px;
}

.mini-avatar {
  display: grid;
  width: 29px;
  height: 29px;
  place-items: center;
  color: #fff;
  border-radius: 8px;
}

.mini-avatar.coral { background: #ef4d5a; }
.mini-avatar.ochre { background: #a87435; }

.channel-row > i {
  padding-left: 5px;
  font-size: 19px;
}

.connected-dot {
  width: 7px;
  height: 7px;
  background: var(--green);
  border-radius: 999px;
}

.canvas-title-row,
.queue-title-row {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  justify-content: space-between;
}

.task-summary-band,
.canvas-grid,
.canvas-section-title,
.canvas-concept > .interaction-card,
.queue-concept > .interaction-card,
.queue-list {
  width: min(100%, 760px);
  margin-right: auto;
  margin-left: auto;
}

.task-summary-band {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(130px, 30%);
  gap: 22px;
  align-items: center;
  padding: 15px;
  margin-bottom: 12px;
}

.task-summary-band strong,
.task-summary-band small {
  display: block;
}

.task-summary-band strong {
  margin-top: 3px;
  font-size: 14px;
}

.task-summary-band small {
  margin-top: 4px;
  color: #85857f;
  font-size: 10px;
}

.large-progress {
  height: 7px;
}

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

.canvas-grid .interaction-card,
.canvas-concept > .interaction-card,
.queue-concept > .interaction-card {
  width: 100%;
}

.interaction-card.is-compact {
  padding: 13px;
}

.interaction-card.is-compact p {
  margin: 9px 0 11px;
}

.canvas-section-title {
  display: flex;
  justify-content: space-between;
  padding: 18px 2px 7px;
  color: #85857f;
  font-size: 10px;
}

.canvas-section-title span:first-child {
  color: #484844;
  font-weight: 600;
}

.queue-title-row {
  margin-bottom: 16px;
}

.queue-list {
  margin-top: 10px;
  margin-bottom: 10px;
  overflow: hidden;
}

.queue-item {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  gap: 11px;
  align-items: center;
  min-height: 68px;
  padding: 11px 13px;
  border-bottom: 1px solid #e8e8e4;
}

.queue-item:last-child {
  border-bottom: 0;
}

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

.queue-item strong {
  margin-top: 2px;
  font-size: 12px;
}

.queue-item small {
  margin-top: 3px;
  color: #85857f;
  font-size: 10px;
}

.mobile-scrim {
  display: none;
}

.empty-search {
  padding: 22px 10px;
  color: #888883;
  font-size: 12px;
  text-align: center;
}

@media (max-width: 1080px) {
  .workspace {
    grid-template-columns: 228px minmax(460px, 1fr);
  }

  .agent-panel {
    display: none;
  }
}

@media (max-width: 760px) {
  body {
    overflow: hidden;
  }

  .workspace {
    display: block;
    width: 100vw;
    height: 100vh;
    margin: 0;
    border: 0;
    border-radius: 0;
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 20;
    width: min(82vw, 280px);
    transform: translateX(-102%);
    transition: transform 170ms ease;
  }

  .workspace.sidebar-open .sidebar {
    transform: translateX(0);
  }

  .conversation {
    height: 100%;
    border-right: 0;
  }

  .mobile-sidebar-button {
    display: inline-grid;
  }

  .mobile-scrim {
    position: fixed;
    inset: 0;
    z-index: 15;
    background: rgb(0 0 0 / 24%);
  }

  .workspace.sidebar-open .mobile-scrim {
    display: block;
  }

  .message {
    max-width: 86%;
  }

  .review-scroll {
    padding: 20px 14px 24px;
  }

  .concept-chip {
    display: none;
  }

  .inline-concept .message,
  .interaction-card {
    width: 100%;
    max-width: 100%;
  }

  .canvas-grid {
    grid-template-columns: 1fr;
  }

  .task-summary-band {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .canvas-title-row,
  .queue-title-row {
    display: block;
  }

  .canvas-title-row > .status-pill,
  .queue-title-row > .queue-count {
    margin-top: 11px;
  }

  .interaction-heading {
    grid-template-columns: 32px minmax(0, 1fr);
  }

  .interaction-heading > :last-child:not(span:nth-child(2)) {
    grid-column: 2;
    justify-self: start;
  }

  .handoff-summary {
    grid-template-columns: 1fr;
  }

  .handoff-channel {
    grid-row: auto;
    padding-right: 0;
    padding-bottom: 7px;
    border-right: 0;
    border-bottom: 1px solid rgb(23 23 23 / 8%);
  }

  .interaction-actions .button.primary {
    width: 100%;
    margin-left: 0;
  }

  .queue-item {
    grid-template-columns: 32px minmax(0, 1fr);
  }

  .queue-item > :last-child:not(span:nth-child(2)) {
    grid-column: 2;
    justify-self: start;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
