:root {
  color-scheme: light;
  --bg: #f5f6f4;
  --rail: #121b17;
  --rail-soft: #1b2923;
  --surface: #ffffff;
  --surface-soft: #f0f4f1;
  --surface-tint: #f8faf8;
  --line: #d8e0da;
  --line-strong: #aebdb4;
  --text: #17211c;
  --muted: #66736c;
  --muted-strong: #44534b;
  --green: #23845f;
  --green-dark: #15543f;
  --blue: #315b9f;
  --amber: #b96e20;
  --red: #b13f34;
  --violet: #6854a3;
  --shadow: 0 18px 42px rgba(32, 43, 37, 0.11);
  --small-shadow: 0 8px 22px rgba(32, 43, 37, 0.08);
  --radius: 8px;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  margin: 0;
  min-width: 320px;
  background:
    linear-gradient(180deg, rgba(21, 84, 63, 0.06), transparent 360px),
    var(--bg);
  color: var(--text);
  font-family: var(--font);
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

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

h1 {
  margin-bottom: 0;
  color: #f6fbf8;
  font-size: 1.08rem;
  line-height: 1.15;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(1.55rem, 2vw, 2.25rem);
  line-height: 1.08;
}

h3 {
  margin-bottom: 0;
  font-size: 1.02rem;
  line-height: 1.22;
}

h4 {
  margin-bottom: 0;
  font-size: 0.88rem;
  line-height: 1.25;
}

.app-shell {
  display: grid;
  grid-template-columns: 306px minmax(0, 1fr);
  min-height: 100vh;
}

.brand-rail {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
  padding: 22px 18px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(35, 132, 95, 0.16), transparent 44%),
    var(--rail);
  color: #d6e5dd;
}

.brand-lockup,
.workspace-header,
.staff-toolbar,
.pane-title-row,
.conversation-header,
.context-heading,
.website-content,
.composer-row,
.header-actions,
.inbox-mainline,
.inbox-tags,
.rail-panel-header,
.command-strip,
.ops-header,
.agent-presence {
  display: flex;
  align-items: center;
}

.brand-lockup {
  gap: 12px;
  min-height: 48px;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius);
  background: #fff;
  color: var(--green-dark);
  font-weight: 850;
}

.brand-mark img {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.microcopy {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

.brand-rail .microcopy {
  color: #9fb8ab;
}

.brand-list {
  display: grid;
  gap: 7px;
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.brand-button {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  padding: 10px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: #dce8e1;
  text-align: left;
}

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

.brand-button:hover,
.brand-button.active {
  border-color: rgba(255, 255, 255, 0.13);
  background: rgba(255, 255, 255, 0.08);
}

.brand-logo,
.brand-mini,
.brand-chip-logo,
.chat-avatar {
  display: grid;
  overflow: hidden;
  place-items: center;
  border: 1px solid rgba(17, 59, 41, 0.12);
  background: #fff;
}

.brand-logo {
  width: 34px;
  height: 34px;
  border-radius: 7px;
}

.brand-mini {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  border-radius: 6px;
}

.brand-asset img {
  width: 100%;
  height: 100%;
  padding: 3px;
  object-fit: contain;
}

.brand-asset[data-brand-logo="meals2door"] {
  background-color: #fff;
  background-image: url("./assets/brands/meals2door.png");
  background-repeat: no-repeat;
  background-position: -7px center;
  background-size: 515% auto;
}

.brand-asset[data-brand-logo="meals2door"] img {
  opacity: 0;
}

.brand-asset-fallback {
  display: none;
  width: 100%;
  height: 100%;
  place-items: center;
  background: var(--brand-color);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 900;
}

.brand-asset.logo-missing img {
  display: none;
}

.brand-asset.logo-missing .brand-asset-fallback {
  display: grid;
}

.brand-name,
.brand-domain,
.ops-item strong,
.ops-item span,
.attachment-name,
.dossier-file strong,
.dossier-file small {
  display: block;
  min-width: 0;
}

.brand-name {
  overflow: hidden;
  font-size: 0.88rem;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-domain {
  overflow: hidden;
  margin-top: 2px;
  color: #9fb8ab;
  font-size: 0.72rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-count {
  min-width: 25px;
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: #f4fff8;
  font-size: 0.72rem;
  font-weight: 900;
  text-align: center;
}

.rail-panel {
  margin-top: auto;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.07);
}

.rail-panel-header {
  gap: 8px;
  margin-bottom: 10px;
  color: #ecf6f0;
  font-size: 0.78rem;
  font-weight: 850;
}

.rail-checks {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 12px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.73rem;
}

.rail-checks span {
  color: #a9beb3;
}

.rail-checks strong {
  color: #fff;
  font-size: 0.73rem;
}

.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--muted);
}

.status-dot.live {
  background: #36c285;
  box-shadow: 0 0 0 4px rgba(54, 194, 133, 0.14);
}

code {
  display: block;
  overflow-wrap: anywhere;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  background: rgba(4, 11, 8, 0.45);
  color: #cdeede;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.68rem;
  line-height: 1.5;
}

.workspace {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
  padding: 22px;
}

.workspace-header,
.staff-toolbar,
.pane-title-row,
.context-heading,
.ops-header {
  justify-content: space-between;
  gap: 14px;
}

.workspace-header {
  align-items: flex-start;
  padding: 2px 2px 0;
}

.header-copy {
  max-width: 820px;
  margin: 8px 0 0;
  color: var(--muted-strong);
  font-size: 0.92rem;
  line-height: 1.45;
}

.header-actions {
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.agent-presence {
  gap: 8px;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--small-shadow);
  color: var(--muted-strong);
  font-size: 0.78rem;
  font-weight: 850;
}

.agent-presence strong {
  color: var(--text);
  font-size: 0.78rem;
}

.agent-presence.local-environment {
  border-color: #e6c77e;
  background: #fff9eb;
}

.agent-presence.local-environment .status-dot { background: #d09015; }

.online-inbox-link {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  border: 1px solid #1e7658;
  border-radius: var(--radius);
  background: #fff;
  color: #165c45;
  font-size: 0.78rem;
  font-weight: 850;
  padding: 0 12px;
  text-decoration: none;
}

.online-inbox-link:hover { background: #eff8f4; }
.online-inbox-link[hidden] { display: none; }

.primary-button,
.icon-button,
.send-button,
.attach-button,
.text-button,
.segmented-control button,
.quick-reply,
.chat-send,
.chat-attach,
.chat-topic,
.status-action {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
}

.primary-button {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  min-height: 40px;
  padding: 0 13px;
  border-color: #1d7657;
  background: var(--green);
  color: #fff;
  font-size: 0.84rem;
  font-weight: 850;
}

.primary-button svg,
.icon-button svg,
.send-button svg,
.attach-button svg,
.chat-send svg,
.chat-attach svg,
.search-box svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.icon-button,
.send-button,
.attach-button {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
}

.icon-button:hover,
.attach-button:hover,
.text-button:hover,
.quick-reply:hover,
.chat-topic:hover,
.status-action:hover,
.chat-attach:hover {
  border-color: var(--line-strong);
  background: var(--surface-soft);
}

.metrics-band {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 9px;
}

.metric {
  min-width: 0;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--small-shadow);
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
}

.metric strong {
  display: block;
  margin-top: 8px;
  color: var(--text);
  font-size: 1.42rem;
  line-height: 1;
}

.metric small {
  display: block;
  margin-top: 7px;
  color: var(--muted-strong);
  font-size: 0.7rem;
  line-height: 1.25;
}

.command-strip {
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--small-shadow);
}

.search-box {
  display: flex;
  flex: 1;
  align-items: center;
  min-width: 240px;
  gap: 10px;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-tint);
  color: var(--muted);
}

.search-box input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 0.84rem;
}

.ops-tabs,
.composer-mode {
  display: flex;
  gap: 4px;
  max-width: 100%;
  overflow-x: auto;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.ops-tabs span,
.composer-mode span {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  padding: 0 10px;
  border-radius: 6px;
  color: var(--muted-strong);
  font-size: 0.73rem;
  font-weight: 850;
  white-space: nowrap;
}

.ops-tabs .active,
.composer-mode .active {
  background: #fff;
  color: var(--text);
  box-shadow: var(--small-shadow);
}

.product-grid {
  display: grid;
  grid-template-columns: minmax(330px, 0.52fr) minmax(0, 1.48fr);
  gap: 14px;
  min-height: 0;
}

.visitor-pane,
.staff-pane,
.ops-panel,
.bot-studio-panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.visitor-pane {
  padding: 15px;
}

.language-chip,
.mini-status,
#priorityBadge,
.fact-pill,
.tag {
  flex: 0 0 auto;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 900;
}

.language-chip,
.mini-status,
#priorityBadge,
.fact-pill {
  padding: 5px 8px;
  background: var(--surface-soft);
  color: var(--muted-strong);
}

.website-frame {
  position: relative;
  overflow: hidden;
  min-height: 662px;
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, #fff, #f8fbf8 52%, #eef5f0);
}

.website-topbar {
  display: flex;
  gap: 7px;
  height: 34px;
  align-items: center;
  padding: 0 12px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.website-topbar span {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #cbd7d0;
}

.website-content {
  align-items: flex-start;
  gap: 16px;
  padding: 22px;
}

.website-content .website-brand-logo {
  width: 122px;
  height: 82px;
  padding: 10px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.website-content h4 {
  margin-bottom: 8px;
  font-size: 1.12rem;
}

.website-content p:last-child {
  margin-bottom: 0;
  color: var(--muted-strong);
  font-size: 0.86rem;
  line-height: 1.5;
}

.chat-widget {
  position: absolute;
  right: 16px;
  bottom: 16px;
  display: block;
  width: min(364px, calc(100% - 32px));
  min-height: 470px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 24px 58px rgba(32, 43, 37, 0.22);
}

.chat-widget-frame {
  display: grid;
  min-height: 470px;
}

.chat-widget-frame.launch-mode {
  min-height: 558px;
}

.chat-header {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 13px;
  color: #fff;
}

.chat-header strong,
.chat-header span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-header strong {
  display: block;
  font-size: 0.9rem;
}

.chat-header span span {
  display: block;
  margin-top: 2px;
  font-size: 0.72rem;
  opacity: 0.88;
}

.chat-avatar {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 7px;
  background: #fff;
}

.chat-avatar img {
  padding: 4px;
}

.chat-header .brand-asset-fallback {
  display: none;
  margin: 0;
  opacity: 1;
}

.chat-header .brand-asset.logo-missing .brand-asset-fallback {
  display: grid;
}

.chat-status {
  padding: 4px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  font-size: 0.68rem;
  font-weight: 900;
}

.care-intake-card {
  display: grid;
  gap: 8px;
  padding: 11px 13px;
  border-bottom: 1px solid var(--line);
  background: #f5faf7;
}

.care-intake-card strong {
  color: var(--text);
  font-size: 0.78rem;
}

.care-intake-card span {
  color: var(--muted-strong);
  font-size: 0.71rem;
  line-height: 1.32;
}

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

.intake-field-grid span {
  min-width: 0;
  padding: 5px 7px;
  border: 1px solid #d8e7de;
  border-radius: 6px;
  background: #fff;
  color: var(--green-dark);
  font-size: 0.66rem;
  font-weight: 900;
  white-space: nowrap;
}

.chat-body {
  display: flex;
  height: 298px;
  flex-direction: column;
  gap: 10px;
  padding: 13px;
  overflow-y: auto;
  background: #f8faf8;
}

.chat-widget-frame.launch-mode .chat-body {
  height: 198px;
}

.chat-message,
.thread-message {
  max-width: 86%;
  padding: 10px 11px;
  border-radius: 8px;
  font-size: 0.82rem;
  line-height: 1.45;
}

.chat-message.bot,
.thread-message.bot {
  align-self: flex-start;
  background: #eaf3ee;
  color: #20382e;
}

.chat-message.visitor,
.thread-message.visitor {
  align-self: flex-end;
  background: #1d2f28;
  color: #fff;
}

.thread-message.staff {
  align-self: flex-start;
  background: #eef0fa;
  color: #25305e;
}

.thread-message.system {
  align-self: center;
  max-width: 100%;
  padding: 6px 8px;
  background: transparent;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
}

.message-meta {
  display: block;
  margin-bottom: 4px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.66rem;
  font-weight: 850;
}

.thread-message.bot .message-meta,
.thread-message.staff .message-meta {
  color: rgba(31, 52, 42, 0.62);
}

.message-text {
  overflow-wrap: anywhere;
}

.attachment-list {
  display: grid;
  gap: 7px;
  margin-top: 8px;
}

.attachment-card {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  min-width: 0;
  padding: 8px;
  border: 1px solid rgba(31, 52, 42, 0.15);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--text);
}

.chat-message.visitor .attachment-card,
.thread-message.visitor .attachment-card {
  border-color: rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.attachment-icon {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 6px;
  background: rgba(35, 132, 95, 0.13);
  color: var(--green-dark);
  font-size: 0.66rem;
  font-weight: 900;
}

.chat-message.visitor .attachment-icon,
.thread-message.visitor .attachment-icon {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.attachment-name {
  overflow: hidden;
  font-size: 0.74rem;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-meta {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 800;
}

.chat-message.visitor .attachment-meta,
.thread-message.visitor .attachment-meta {
  color: rgba(255, 255, 255, 0.72);
}

.attachment-status,
.attachment-action {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted-strong);
  font-size: 0.64rem;
  font-weight: 900;
  text-decoration: none;
}

.attachment-status {
  padding: 3px 6px;
}

.attachment-action {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  padding: 0 7px;
}

.attachment-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.attachment-action:hover,
.dossier-actions a:hover {
  border-color: var(--line-strong);
  background: var(--surface-soft);
}

.chat-message .attachment-card,
.thread-message .attachment-card {
  grid-template-columns: 28px minmax(0, 1fr);
}

.chat-message .attachment-status {
  grid-column: 2;
  justify-self: start;
  margin-top: 2px;
}

.thread-message .attachment-actions {
  grid-column: 1 / -1;
  justify-content: flex-start;
  margin-top: 2px;
}

.chat-topics {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 0 13px 10px;
  background: #f8faf8;
}

.chat-privacy-note {
  display: grid;
  gap: 3px;
  padding: 9px 13px 10px;
  border-top: 1px solid var(--line);
  background: #fffdf8;
}

.chat-privacy-note strong {
  color: var(--amber);
  font-size: 0.66rem;
  font-weight: 900;
  text-transform: uppercase;
}

.chat-privacy-note span {
  color: var(--muted-strong);
  font-size: 0.68rem;
  line-height: 1.32;
}

.chat-topic {
  padding: 7px 9px;
  color: var(--muted-strong);
  font-size: 0.74rem;
  font-weight: 850;
}

.chat-input-row {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 38px;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--line);
}

.chat-input-row input,
.composer-row input {
  min-width: 0;
  height: 38px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  outline: none;
  font-size: 0.82rem;
}

.chat-input-row input:focus,
.composer-row input:focus,
.search-box:focus-within {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(35, 132, 95, 0.12);
}

.chat-send {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  background: var(--green);
  color: #fff;
}

.chat-attach {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  color: var(--muted-strong);
}

.file-input {
  display: none;
}

.staff-pane {
  display: flex;
  min-height: 760px;
  flex-direction: column;
}

.staff-toolbar {
  padding: 15px 16px;
  border-bottom: 1px solid var(--line);
}

.segmented-control {
  display: flex;
  gap: 4px;
  max-width: 100%;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.segmented-control button {
  min-height: 30px;
  padding: 0 10px;
  border-color: transparent;
  background: transparent;
  color: var(--muted-strong);
  font-size: 0.75rem;
  font-weight: 900;
  white-space: nowrap;
}

.segmented-control button.active {
  border-color: var(--line);
  background: #fff;
  color: var(--text);
  box-shadow: var(--small-shadow);
}

.staff-layout {
  display: grid;
  grid-template-columns: 258px minmax(0, 1fr) 276px;
  min-height: 0;
  flex: 1;
}

.inbox-list {
  min-width: 0;
  overflow-y: auto;
  border-right: 1px solid var(--line);
  background: #fbfcfb;
}

.inbox-item {
  display: grid;
  gap: 8px;
  width: 100%;
  padding: 13px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  text-align: left;
}

.inbox-item:hover,
.inbox-item.active {
  background: #edf5f0;
}

.inbox-mainline,
.inbox-tags {
  gap: 7px;
}

.inbox-mainline {
  justify-content: space-between;
}

.inbox-item strong {
  min-width: 0;
  overflow: hidden;
  font-size: 0.84rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inbox-item p {
  display: -webkit-box;
  overflow: hidden;
  margin: 0;
  color: var(--muted-strong);
  font-size: 0.76rem;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.inbox-tags {
  flex-wrap: wrap;
}

.tag {
  padding: 3px 6px;
  background: var(--surface-soft);
  color: var(--muted-strong);
}

.tag.needs-human,
.sla-warning {
  background: #fff4e8;
  color: var(--amber);
}

.tag.bot-handled,
.sla-success {
  background: #e7f4ec;
  color: var(--green-dark);
}

.tag.resolved {
  background: #edf0f4;
  color: var(--muted-strong);
}

.sla-danger,
.priority-high {
  background: #fff0ed;
  color: var(--red);
}

.sla-neutral,
.priority-normal {
  background: #eef2f7;
  color: var(--blue);
}

.conversation-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-width: 0;
}

.conversation-header {
  align-items: flex-start;
  flex-wrap: wrap;
  min-width: 0;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.conversation-title {
  min-width: 230px;
  flex: 1;
}

.brand-chip {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  margin-bottom: 7px;
  color: var(--muted-strong);
  font-size: 0.72rem;
  font-weight: 900;
}

.brand-chip-logo {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 6px;
  background: #fff;
}

.conversation-header h3 {
  font-size: 1.08rem;
}

.conversation-header p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  overflow-wrap: anywhere;
}

.ticket-facts {
  display: flex;
  max-width: 360px;
  flex-wrap: wrap;
  gap: 7px;
  justify-content: flex-end;
}

.status-actions {
  display: flex;
  flex-basis: 100%;
  gap: 7px;
  flex-wrap: wrap;
}

.status-action {
  min-height: 32px;
  padding: 0 10px;
  color: var(--muted-strong);
  font-size: 0.74rem;
  font-weight: 900;
}

.status-action.active {
  border-color: var(--green);
  background: #e7f4ec;
  color: var(--green-dark);
}

.message-thread {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  min-height: 0;
  padding: 16px;
  overflow-y: auto;
  background:
    linear-gradient(180deg, rgba(240, 244, 241, 0.72), rgba(255, 255, 255, 0.96)),
    #fff;
}

.composer {
  min-width: 0;
  padding: 12px;
  border-top: 1px solid var(--line);
  background: #fff;
}

.composer-mode {
  width: fit-content;
  margin-bottom: 9px;
}

.quick-replies {
  display: flex;
  gap: 7px;
  min-width: 0;
  margin-bottom: 9px;
  overflow-x: auto;
}

.quick-reply {
  flex: 0 0 auto;
  max-width: 260px;
  overflow: hidden;
  padding: 7px 9px;
  color: var(--muted-strong);
  font-size: 0.74rem;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.composer-row {
  gap: 8px;
  min-width: 0;
}

.composer-row input {
  flex: 1;
}

.send-button {
  border-color: #1f312a;
  background: #1f312a;
  color: #fff;
}

.attach-button {
  flex: 0 0 auto;
  color: var(--muted-strong);
}

.context-panel {
  display: grid;
  align-content: start;
  gap: 14px;
  min-width: 0;
  overflow-y: auto;
  padding: 14px;
  border-left: 1px solid var(--line);
  background: #fbfcfb;
}

.context-panel section {
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.context-panel section:last-child {
  border-bottom: 0;
}

.action-stack,
.attachment-dossier,
.bot-guidance {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.action-card,
.guidance-row,
.dossier-file,
.ops-item,
.empty-state {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.action-card strong,
.action-card span,
.guidance-row strong,
.guidance-row span {
  display: block;
}

.action-card strong,
.guidance-row strong {
  color: var(--text);
  font-size: 0.78rem;
}

.action-card span,
.guidance-row,
.empty-state span {
  margin-top: 4px;
  color: var(--muted-strong);
  font-size: 0.73rem;
  line-height: 1.38;
}

.empty-state {
  color: var(--muted-strong);
  font-size: 0.78rem;
}

.empty-state.compact {
  padding: 9px;
}

.dossier-file {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
}

.dossier-file strong {
  overflow: hidden;
  color: var(--text);
  font-size: 0.76rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dossier-file small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.68rem;
  line-height: 1.25;
}

.dossier-actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.dossier-actions a {
  display: inline-flex;
  min-height: 25px;
  align-items: center;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--green-dark);
  font-size: 0.66rem;
  font-weight: 900;
  text-decoration: none;
}

dl {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 9px 10px;
  margin: 12px 0 0;
}

dt {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
}

dd {
  min-width: 0;
  margin: 0;
  color: var(--text);
  font-size: 0.77rem;
  font-weight: 750;
  overflow-wrap: anywhere;
}

.ops-panel {
  overflow: hidden;
}

.bot-studio-panel {
  overflow: hidden;
}

.ops-header {
  padding: 15px 16px;
  border-bottom: 1px solid var(--line);
}

.ops-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.bot-studio-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
}

.bot-studio-card {
  min-width: 0;
  padding: 15px;
  border-right: 1px solid var(--line);
}

.bot-studio-card:last-child {
  border-right: 0;
}

.bot-test-box,
.faq-editor {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.bot-test-box textarea,
.faq-editor textarea,
.faq-editor input,
.faq-editor select {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  outline: none;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-size: 0.82rem;
}

.bot-test-box textarea,
.faq-editor textarea {
  resize: vertical;
  padding: 10px 11px;
  line-height: 1.42;
}

.faq-editor input,
.faq-editor select {
  height: 38px;
  padding: 0 11px;
}

.bot-test-box textarea:focus,
.faq-editor textarea:focus,
.faq-editor input:focus,
.faq-editor select:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(35, 132, 95, 0.12);
}

.faq-editor label {
  display: grid;
  gap: 6px;
  color: var(--muted-strong);
  font-size: 0.75rem;
  font-weight: 900;
}

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

.bot-test-result {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.bot-answer-preview {
  display: grid;
  gap: 5px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfb;
}

.bot-answer-preview strong {
  color: var(--text);
  font-size: 0.78rem;
}

.bot-answer-preview span {
  color: var(--muted-strong);
  font-size: 0.78rem;
  line-height: 1.45;
}

.ops-grid article {
  min-width: 0;
  padding: 15px;
  border-right: 1px solid var(--line);
}

.ops-grid article:last-child {
  border-right: 0;
}

.ops-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.ops-item {
  background: #fbfcfb;
}

.ops-item strong {
  overflow: hidden;
  color: var(--text);
  font-size: 0.78rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ops-item span {
  margin-top: 4px;
  color: var(--muted-strong);
  font-size: 0.71rem;
  line-height: 1.35;
}

.ops-item.done {
  border-color: #c8dfd2;
  background: #f3fbf6;
}

.ops-item.partial {
  border-color: #ead7b9;
  background: #fffaf2;
}

.ops-item.todo,
.ops-item.risk {
  border-color: #e8c8c4;
  background: #fff7f6;
}

.text-button {
  min-height: 28px;
  padding: 0 8px;
  color: var(--green-dark);
  font-size: 0.72rem;
  font-weight: 900;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 20;
  max-width: min(420px, calc(100vw - 40px));
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #17241e;
  color: #fff;
  box-shadow: var(--shadow);
  font-size: 0.84rem;
  opacity: 0;
  transform: translateY(10px);
  transition: 180ms ease;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.login-screen {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(35, 132, 95, 0.16), transparent 38%),
    rgba(245, 246, 244, 0.94);
  backdrop-filter: blur(14px);
}

.login-screen[hidden] {
  display: none;
}

.login-card {
  display: grid;
  gap: 16px;
  width: min(430px, 100%);
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
}

.login-card h2 {
  font-size: 1.45rem;
}

.login-copy {
  margin-bottom: 0;
  color: var(--muted-strong);
  line-height: 1.5;
}

.login-card label {
  display: grid;
  gap: 7px;
  color: var(--muted-strong);
  font-size: 0.82rem;
  font-weight: 900;
}

.login-card input {
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  outline: none;
}

.login-card input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(35, 132, 95, 0.12);
}

.login-error {
  min-height: 18px;
  margin-bottom: 0;
  color: var(--red);
  font-size: 0.78rem;
  font-weight: 850;
}

@media (max-width: 1460px) {
  .metrics-band {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

  .visitor-pane {
    order: 2;
  }

  .staff-pane {
    order: 1;
  }
}

@media (max-width: 1320px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .brand-rail {
    position: sticky;
    top: 0;
    z-index: 10;
    display: grid;
    grid-template-columns: minmax(220px, 0.68fr) minmax(0, 1.32fr);
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  }

  .brand-list {
    grid-template-columns: repeat(5, minmax(145px, 1fr));
    overflow-x: auto;
  }

  .rail-panel {
    display: none;
  }

  .staff-layout {
    grid-template-columns: 250px minmax(360px, 1fr);
  }

  .context-panel {
    grid-column: 1 / -1;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border-top: 1px solid var(--line);
    border-left: 0;
  }

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

  .bot-studio-grid {
    grid-template-columns: 1fr;
  }

  .bot-studio-card {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .bot-studio-card:last-child {
    border-bottom: 0;
  }

  .ops-grid article:nth-child(2n) {
    border-right: 0;
  }

  .ops-grid article {
    border-bottom: 1px solid var(--line);
  }
}

@media (max-width: 860px) {
  .workspace,
  .brand-rail {
    padding: 14px;
  }

  .brand-rail {
    position: static;
    grid-template-columns: 1fr;
  }

  .brand-list {
    grid-template-columns: repeat(5, 162px);
  }

  .workspace-header,
  .staff-toolbar,
  .pane-title-row,
  .command-strip {
    align-items: flex-start;
    flex-direction: column;
  }

  .header-actions,
  .command-strip,
  .search-box,
  .ops-tabs {
    width: 100%;
  }

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

  .website-frame {
    min-height: 650px;
  }

  .website-content {
    flex-direction: column;
  }

  .chat-widget {
    right: 12px;
    bottom: 12px;
    width: calc(100% - 24px);
  }

  .staff-layout {
    grid-template-columns: 1fr;
  }

  .inbox-list {
    max-height: 290px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .context-panel {
    grid-template-columns: 1fr;
  }

  .segmented-control,
  .ops-tabs {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
  }

  .segmented-control button {
    flex: 1 0 auto;
  }

  .ticket-facts {
    justify-content: flex-start;
  }

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

  .ops-grid article {
    border-right: 0;
  }
}

@media (max-width: 480px) {
  .metrics-band {
    grid-template-columns: 1fr;
  }

  .chat-header {
    grid-template-columns: 34px minmax(0, 1fr) auto;
    gap: 8px;
    padding: 10px 12px;
  }

  .chat-header > span:nth-child(2) > span {
    display: none;
  }

  .chat-header strong {
    line-height: 1.15;
  }

  .chat-status {
    grid-column: auto;
    justify-self: start;
  }

  .composer-mode {
    width: 100%;
    overflow-x: auto;
  }
}

/* 2026-07-11 mature service desk workspace */
body {
  background: #f3f5f3;
}

.app-shell-v2 {
  grid-template-columns: 244px minmax(0, 1fr);
  height: 100vh;
  min-height: 680px;
  overflow: hidden;
}

.app-sidebar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  grid-template-columns: none;
  flex-direction: column;
  gap: 16px;
  padding: 18px 14px 14px;
  border-bottom: 0;
  background: #14211b;
}

.app-sidebar .brand-lockup {
  padding: 0 6px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.app-sidebar h1 {
  font-size: 0.98rem;
}

.module-nav {
  display: grid;
  gap: 3px;
}

.module-button {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-height: 38px;
  padding: 7px 9px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #b9c9c0;
  font-size: 0.82rem;
  font-weight: 780;
  text-align: left;
}

.module-button:hover,
.module-button.active {
  background: rgba(255, 255, 255, 0.09);
  color: #fff;
}

.module-button.active {
  box-shadow: inset 2px 0 0 #71c59f;
}

.module-icon {
  color: #779086;
  font-size: 0.62rem;
  font-weight: 900;
}

.module-button strong,
.module-button i {
  min-width: 20px;
  padding: 2px 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.09);
  color: #dce8e1;
  font-size: 0.66rem;
  font-style: normal;
  text-align: center;
}

.module-button i:empty {
  display: none;
}

.sidebar-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 8px 0;
  color: #7f988c;
  font-size: 0.66rem;
  font-weight: 900;
  text-transform: uppercase;
}

.app-sidebar .brand-list {
  grid-template-columns: 1fr;
  gap: 3px;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
}

.app-sidebar .brand-button {
  grid-template-columns: 30px minmax(0, 1fr) auto;
  min-height: 44px;
  padding: 6px 8px;
  border-radius: 6px;
}

.app-sidebar .brand-logo {
  width: 30px;
  height: 30px;
  border-radius: 5px;
  font-size: 0.68rem;
}

.app-sidebar .brand-name {
  font-size: 0.76rem;
}

.app-sidebar .brand-domain {
  margin-top: 1px;
  font-size: 0.61rem;
}

.sidebar-account {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) 30px;
  gap: 9px;
  align-items: center;
  margin-top: auto;
  padding: 10px 8px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.account-avatar {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 50%;
  background: #2d5d49;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 900;
}

.sidebar-account strong,
.sidebar-account small {
  display: block;
}

.sidebar-account strong {
  color: #fff;
  font-size: 0.72rem;
}

.sidebar-account small {
  margin-top: 2px;
  color: #829a8f;
  font-size: 0.62rem;
}

.sidebar-account .icon-button {
  width: 30px;
  height: 30px;
  min-width: 30px;
  color: #cbd8d1;
}

.workspace-v2 {
  min-width: 0;
  height: 100vh;
  padding: 0;
  overflow: auto;
}

.workspace-header-v2 {
  position: sticky;
  top: 0;
  z-index: 9;
  min-height: 82px;
  padding: 16px 24px;
  border-bottom: 1px solid #dfe5e0;
  background: rgba(248, 250, 248, 0.96);
  backdrop-filter: blur(14px);
}

.workspace-header-v2 h2 {
  font-size: 1.38rem;
  letter-spacing: 0;
}

.workspace-header-v2 .header-copy {
  max-width: 720px;
  margin: 4px 0 0;
  font-size: 0.78rem;
}

.workspace-header-v2 .agent-presence {
  min-height: 36px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  font-size: 0.72rem;
}

.module-panel,
.bot-section {
  display: none;
}

.module-panel.active,
.bot-section.active {
  display: block;
}

[hidden],
.bot-publish-header {
  display: none !important;
}

.module-panel {
  padding: 16px 24px 24px;
}

.primary-button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
  filter: saturate(0.35);
}

.metrics-band-v2 {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.metrics-band-v2 .metric {
  min-height: 66px;
  padding: 10px 12px;
  border-radius: 6px;
  box-shadow: none;
}

.metrics-band-v2 .metric span {
  font-size: 0.66rem;
}

.metrics-band-v2 .metric strong {
  margin-top: 1px;
  font-size: 1.18rem;
}

.metrics-band-v2 .metric small {
  margin-top: 1px;
  font-size: 0.62rem;
}

.command-strip-v2 {
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 10px;
  padding: 8px;
  border-radius: 6px;
  box-shadow: none;
}

.command-strip-v2 .search-box {
  flex: 1 1 520px;
  height: 36px;
  padding: 0 10px;
}

.command-strip-v2 .segmented-control {
  flex: 0 1 auto;
}

.staff-pane-v2 {
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  overflow: hidden;
  box-shadow: 0 8px 22px rgba(24, 40, 31, 0.05);
}

.staff-layout-v2 {
  grid-template-columns: 280px minmax(420px, 1fr) 288px;
  height: calc(100vh - 278px);
  min-height: 520px;
}

.staff-layout-v2 .inbox-list,
.staff-layout-v2 .conversation-panel,
.staff-layout-v2 .context-panel {
  min-height: 0;
  overflow: auto;
}

.staff-layout-v2 .conversation-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.staff-layout-v2 .message-thread {
  min-height: 0;
  overflow: auto;
}

.composer-mode button {
  padding: 0 0 7px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
}

.composer-mode button.active {
  border-bottom-color: var(--green);
  color: var(--green-dark);
}

.composer.note-mode {
  background: #fffaf0;
}

.composer.note-mode .composer-row input {
  border-color: #d9b574;
  background: #fffdf8;
}

.thread-message.note {
  margin-right: auto;
  border: 1px solid #e5c98c;
  background: #fff8e8;
  color: #5b451b;
}

.thread-message.note .message-meta {
  color: #8a671c;
}

.composer-row .send-button {
  width: auto;
  min-width: 60px;
  padding: 0 14px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 850;
}

.composer-row .attach-button {
  display: grid;
  place-items: center;
  font-size: 1.05rem;
  font-weight: 500;
}

.bot-commandbar,
.bot-subnav,
.section-heading,
.panel-actions,
.bot-studio-actions {
  display: flex;
  align-items: center;
}

.bot-commandbar {
  justify-content: space-between;
  min-height: 58px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 6px 6px 0 0;
  background: #fff;
}

.bot-commandbar > div {
  display: flex;
  gap: 10px;
  align-items: center;
}

.bot-commandbar > div > strong {
  color: var(--amber);
  font-size: 0.74rem;
}

.bot-commandbar > div > span:last-child {
  color: var(--muted);
  font-size: 0.7rem;
}

.bot-subnav {
  gap: 18px;
  min-height: 48px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-top: 0;
  background: #fff;
}

.bot-subnav button {
  align-self: stretch;
  padding: 0 2px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 850;
}

.bot-subnav button.active {
  border-bottom-color: var(--green);
  color: var(--green-dark);
}

.bot-section {
  padding-top: 12px;
}

.bot-kpi-row,
.report-band {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.bot-kpi,
.report-metric {
  min-height: 82px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.bot-kpi span,
.report-metric span {
  display: block;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
}

.bot-kpi strong,
.report-metric strong {
  display: block;
  margin-top: 4px;
  font-size: 1.25rem;
}

.bot-kpi small,
.report-metric small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.64rem;
}

.bot-overview-grid {
  display: grid;
  grid-template-columns: minmax(520px, 1.2fr) minmax(360px, 0.8fr);
  gap: 12px;
}

.surface-panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  overflow: hidden;
}

.section-heading {
  justify-content: space-between;
  min-height: 58px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}

.section-heading h3 {
  font-size: 0.94rem;
}

.settings-form,
.faq-editor {
  display: grid;
  gap: 13px;
  padding: 16px;
}

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

.settings-form label,
.faq-editor label {
  display: grid;
  gap: 6px;
  color: var(--muted-strong);
  font-size: 0.7rem;
  font-weight: 850;
}

.settings-form input:not([type="checkbox"]),
.settings-form select,
.settings-form textarea,
.faq-editor input:not([type="checkbox"]),
.faq-editor select,
.faq-editor textarea,
.bot-test-console textarea {
  width: 100%;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fff;
  color: var(--text);
  font: inherit;
  outline: none;
  resize: vertical;
}

.settings-form input:focus,
.settings-form select:focus,
.settings-form textarea:focus,
.faq-editor input:focus,
.faq-editor select:focus,
.faq-editor textarea:focus,
.bot-test-console textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(35, 132, 95, 0.1);
}

.full-field {
  grid-column: 1 / -1;
}

.toggle-row {
  display: flex !important;
  grid-column: 1 / -1;
  grid-template-columns: none !important;
  gap: 8px !important;
  align-items: center;
}

.toggle-row input {
  width: 16px;
  height: 16px;
  accent-color: var(--green);
}

.faq-editor small {
  color: var(--muted);
  font-weight: 500;
  line-height: 1.4;
}

.panel-actions {
  gap: 12px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  background: #fafbfa;
}

.panel-actions span {
  color: var(--muted);
  font-size: 0.66rem;
}

.decision-flow {
  display: grid;
  gap: 0;
  padding: 8px 16px 16px;
}

.flow-step {
  position: relative;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 62px;
  border-bottom: 1px solid var(--line);
}

.flow-step:last-child {
  border-bottom: 0;
}

.flow-step-number {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border-radius: 50%;
  background: #e7f3ed;
  color: var(--green-dark);
  font-size: 0.66rem;
  font-weight: 900;
}

.flow-step strong,
.flow-step span {
  display: block;
}

.flow-step strong {
  font-size: 0.76rem;
}

.flow-step span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.66rem;
  line-height: 1.35;
}

.flow-step em {
  color: var(--green-dark);
  font-size: 0.62rem;
  font-style: normal;
  font-weight: 850;
}

.split-workspace,
.widget-workspace,
.bot-test-layout {
  display: grid;
  grid-template-columns: minmax(300px, 0.78fr) minmax(480px, 1.22fr);
  gap: 12px;
}

.split-workspace-knowledge {
  grid-template-columns: minmax(320px, 0.72fr) minmax(520px, 1.28fr);
}

.rule-library,
.release-list {
  display: grid;
  max-height: calc(100vh - 260px);
  overflow: auto;
}

.rule-row,
.release-row {
  display: grid;
  gap: 5px;
  padding: 12px 16px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  text-align: left;
}

button.rule-row:hover,
button.rule-row.active {
  background: #f1f7f3;
}

.rule-row strong,
.release-row strong {
  font-size: 0.76rem;
}

.rule-row span,
.release-row span {
  color: var(--muted);
  font-size: 0.66rem;
  line-height: 1.4;
}

.bot-test-layout {
  grid-template-columns: minmax(360px, 0.8fr) minmax(500px, 1.2fr);
}

.bot-test-console textarea {
  width: calc(100% - 32px);
  margin: 16px;
}

.bot-studio-actions {
  gap: 8px;
  padding: 0 16px 16px;
}

.bot-test-result {
  padding: 16px;
}

.bot-trace {
  display: grid;
  gap: 0;
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 5px;
}

.trace-row {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 8px;
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
}

.trace-row:last-child {
  border-bottom: 0;
}

.trace-row i {
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
  border-radius: 50%;
  background: #e9f4ee;
  color: var(--green-dark);
  font-size: 0.58rem;
  font-style: normal;
  font-weight: 900;
}

.trace-row.handoff i {
  background: #fff0e4;
  color: #9a5617;
}

.trace-row strong,
.trace-row span {
  display: block;
}

.trace-row strong {
  font-size: 0.68rem;
}

.trace-row span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.64rem;
}

.widget-workspace {
  grid-template-columns: minmax(640px, 1fr) 320px;
}

.widget-workspace .visitor-pane {
  order: initial;
  padding: 16px;
}

.widget-config-panel code {
  display: block;
  margin: 16px;
  padding: 12px;
  overflow-wrap: anywhere;
  border-radius: 5px;
  background: #17251f;
  color: #d8eee2;
  font-size: 0.68rem;
  line-height: 1.5;
}

.setting-help {
  margin: 14px 16px 0;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.5;
}

.readiness-summary,
.stack-list {
  display: grid;
  padding: 4px 16px 16px;
}

.readiness-summary > div,
.stack-list > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.7rem;
}

.readiness-summary span,
.stack-list span {
  color: var(--muted);
}

.risk-text {
  color: var(--red);
}

.reports-grid,
.launch-grid {
  align-items: start;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.audit-list,
.readiness-list,
.reports-grid .ops-list,
.launch-grid .ops-list {
  max-height: none;
}

.launch-header-band {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
  margin-bottom: 12px;
  padding: 18px 20px;
  border: 1px solid #d7ded8;
  border-left: 4px solid var(--amber);
  border-radius: 6px;
  background: #fff;
}

.launch-header-band h3 {
  font-size: 1.08rem;
}

.launch-header-band p:last-child {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.74rem;
}

.launch-header-band > strong {
  color: var(--red);
  font-size: 0.76rem;
}

@media (max-width: 1240px) {
  .app-shell-v2 {
    grid-template-columns: 216px minmax(0, 1fr);
  }

  .staff-layout-v2 {
    grid-template-columns: 248px minmax(390px, 1fr);
  }

  .staff-layout-v2 .context-panel {
    grid-column: 1 / -1;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .context-brand-section {
    display: none;
  }

  .metrics-band-v2 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .staff-layout-v2 {
    height: auto;
    min-height: 680px;
  }

  .bot-overview-grid,
  .widget-workspace {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  body {
    overflow: auto;
  }

  .app-shell-v2 {
    display: block;
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }

  .app-sidebar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: grid;
    grid-template-columns: 176px minmax(0, 1fr);
    gap: 7px 10px;
    padding: 9px 10px;
  }

  .app-sidebar .brand-lockup {
    padding: 0;
    border-bottom: 0;
  }

  .app-sidebar .brand-mark {
    width: 34px;
    height: 34px;
  }

  .app-sidebar .microcopy,
  .app-sidebar h1 {
    white-space: nowrap;
  }

  .module-nav {
    display: flex;
    gap: 3px;
    overflow-x: auto;
  }

  .module-button {
    display: flex;
    flex: 0 0 auto;
    min-height: 36px;
    padding: 6px 9px;
  }

  .module-button .module-icon,
  .module-button strong,
  .module-button i {
    display: none;
  }

  .sidebar-section-heading,
  .sidebar-account {
    display: none;
  }

  .app-sidebar .brand-list {
    grid-column: 1 / -1;
    display: flex;
    gap: 5px;
    overflow-x: auto;
  }

  .app-sidebar .brand-button {
    flex: 0 0 145px;
    min-height: 40px;
  }

  .workspace-v2 {
    height: auto;
    overflow: visible;
  }

  .workspace-header-v2 {
    position: static;
    min-height: 0;
    padding: 14px;
  }

  .workspace-header-v2,
  .workspace-header-v2 .header-actions {
    align-items: flex-start;
  }

  .workspace-header-v2 .header-actions {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
  }

  .workspace-header-v2 .agent-presence {
    width: auto;
  }

  .module-panel {
    padding: 10px;
  }

  .metrics-band-v2 {
    display: flex;
    gap: 7px;
    overflow-x: auto;
  }

  .metrics-band-v2 .metric {
    flex: 0 0 126px;
    min-height: 62px;
  }

  .command-strip-v2 {
    align-items: stretch;
  }

  .command-strip-v2 .search-box,
  .command-strip-v2 .segmented-control {
    width: 100%;
    flex: auto;
  }

  .staff-layout-v2 {
    display: grid;
    grid-template-columns: 1fr;
    height: auto;
    min-height: 0;
  }

  .staff-layout-v2 .inbox-list {
    max-height: 260px;
  }

  .staff-layout-v2 .conversation-panel {
    min-height: 620px;
  }

  .staff-layout-v2 .context-panel {
    grid-column: auto;
    grid-template-columns: 1fr;
  }

  .bot-commandbar,
  .bot-commandbar > div,
  .launch-header-band {
    align-items: flex-start;
    flex-direction: column;
  }

  .bot-subnav {
    gap: 15px;
    overflow-x: auto;
  }

  .bot-subnav button {
    flex: 0 0 auto;
    min-height: 44px;
  }

  .bot-kpi-row,
  .report-band {
    display: flex;
    overflow-x: auto;
  }

  .bot-kpi,
  .report-metric {
    flex: 0 0 154px;
  }

  .bot-overview-grid,
  .split-workspace,
  .split-workspace-knowledge,
  .bot-test-layout,
  .widget-workspace,
  .reports-grid,
  .launch-grid {
    grid-template-columns: 1fr;
  }

  .settings-form {
    grid-template-columns: 1fr;
  }

  .full-field,
  .toggle-row {
    grid-column: auto;
  }

  .rule-library,
  .release-list {
    max-height: 360px;
  }

  .website-frame {
    min-height: 790px;
  }
}

@media (max-width: 480px) {
  .app-sidebar {
    grid-template-columns: 176px minmax(0, 1fr);
  }

  .module-button {
    padding-inline: 8px;
    font-size: 0.72rem;
  }

  .app-sidebar .brand-button {
    flex-basis: 132px;
  }

  .app-sidebar .brand-domain,
  .app-sidebar .brand-count {
    display: none;
  }

  .workspace-header-v2 h2 {
    font-size: 1.18rem;
  }

  .workspace-header-v2 .header-copy {
    font-size: 0.72rem;
  }

  .workspace-header-v2 .agent-presence strong {
    display: none;
  }

  .conversation-header {
    padding: 12px;
  }

  .ticket-facts {
    gap: 5px;
  }

  .message-thread,
  .composer,
  .context-panel section {
    padding-inline: 12px;
  }

  .bot-commandbar > div {
    gap: 4px;
  }

  .bot-commandbar .brand-chip {
    margin-bottom: 4px;
  }

  .panel-actions {
    align-items: flex-start;
    flex-direction: column;
  }
}
