:root {
  color-scheme: light;
  --ink: #0c3542;
  --muted: #607a82;
  --line: #d6e7e9;
  --paper: #f2f8f8;
  --white: #ffffff;
  --forest: #07566d;
  --forest-2: #06465c;
  --mint: #2bc985;
  --mint-soft: #e5f8f0;
  --amber: #21b9a6;
  --red: #ca5b4c;
  --blue: #168db8;
  --gold: #6ce0b0;
  --gold-deep: #087b9e;
  --shadow: 0 10px 30px rgba(4, 77, 97, 0.065);
  --radius: 16px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

.referral-workbench {
  display: grid;
  gap: 22px;
}

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

.referral-metric-grid article,
.referral-card {
  border: 1px solid rgba(9, 118, 111, 0.16);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 12px 32px rgba(7, 65, 63, 0.06);
}

.referral-metric-grid article {
  display: grid;
  gap: 5px;
  padding: 16px;
}

.referral-metric-grid small,
.referral-metric-grid span {
  color: var(--muted);
}

.referral-metric-grid strong {
  color: var(--ink);
  font-size: clamp(1.45rem, 2.4vw, 2rem);
}

.referral-config-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 560px), 1fr));
  gap: 16px;
}

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

.referral-card {
  padding: 20px;
}

.pess-rule-form,
.pess-relation-form {
  align-content: start;
  display: grid;
  gap: 14px;
}

.pess-rule-form label:not(.enabled-toggle),
.pess-relation-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.pess-rule-form input,
.pess-rule-form select,
.pess-relation-form input,
.pess-relation-form select,
.pess-relation-form textarea {
  width: 100%;
}

.pess-lead-search-field {
  position: relative;
  min-width: 0;
  display: grid;
  gap: 7px;
}

.pess-lead-search-field > label {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.pess-lead-search-field input[aria-expanded="true"] {
  border-color: #42b9aa;
  box-shadow: 0 0 0 3px rgba(39, 170, 151, 0.12);
}

.pess-lead-search-results {
  max-height: 270px;
  overflow: auto;
  overscroll-behavior: contain;
  display: grid;
  gap: 5px;
  padding: 7px;
  border: 1px solid #bcdedb;
  border-radius: 13px;
  background: #f8fcfb;
  box-shadow: 0 12px 28px rgba(5, 79, 87, 0.1);
}

.pess-lead-search-results[hidden] { display: none; }

.pess-lead-search-option {
  width: 100%;
  min-height: 48px;
  appearance: none;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--ink);
  background: #fff;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.pess-lead-search-option > span {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.pess-lead-search-option strong,
.pess-lead-search-option small { overflow-wrap: anywhere; }
.pess-lead-search-option strong { color: var(--ink); font-size: 0.84rem; }
.pess-lead-search-option small { color: var(--muted); font-size: 0.72rem; }
.pess-lead-search-option em {
  padding: 4px 7px;
  border-radius: 999px;
  color: #116c68;
  background: #e8f7f4;
  font-size: 0.68rem;
  font-style: normal;
  font-weight: 800;
  white-space: nowrap;
}

.pess-lead-search-option:hover,
.pess-lead-search-option:focus-visible,
.pess-lead-search-option.is-active {
  border-color: #58c0b2;
  background: #eefaf7;
  outline: 0;
}

.pess-lead-search-status {
  color: #66848a;
  font-size: 0.73rem;
  font-weight: 650;
  line-height: 1.45;
}

.pess-lead-search-status[data-state="searching"] { color: #176b78; }
.pess-lead-search-status[data-state="ready"] { color: #146b64; }
.pess-lead-search-status[data-state="empty"] { color: #8a6028; }
.pess-lead-search-status[data-state="error"] { color: #9b4339; }
.pess-lead-search-status[data-state="selected"] { color: #08765c; font-weight: 800; }

.referral-level-points,
.pess-template-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 13px;
}

.referral-level-points legend,
.pess-template-grid legend {
  padding: 0 6px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.pess-direct-slot-rates {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.referral-level-points label[hidden] {
  display: none;
}

.pess-template-grid label {
  min-width: 0;
}

.pess-template-grid label > span {
  color: var(--muted);
  font-size: 0.78rem;
}

.pess-template-grid label input + input {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.78rem;
}

.pess-product-config {
  display: grid;
  gap: 11px;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(246, 252, 250, 0.78);
}

.pess-product-config-heading {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pess-product-config-heading {
  justify-content: space-between;
  flex-wrap: wrap;
}
.pess-product-config-heading small,
.pess-product-config-heading strong,
.pess-product-preview small,
.pess-product-preview strong,
.pess-legacy-product-note small,
.pess-legacy-product-note strong { display: block; }
.pess-product-rule-rows { display: grid; gap: 9px; min-width: 0; }
.pess-product-rule-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  min-width: 0;
  padding: 11px;
  border: 1px solid rgba(9, 118, 111, .16);
  border-radius: 12px;
  background: #fff;
}
.pess-product-rule-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 10px;
  min-width: 0;
}
.pess-product-rule-header label { min-width: 0; }
.pess-product-rule-header .icon-button { align-self: end; }
.pess-product-preview {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  min-width: 0;
  color: var(--muted);
}
.pess-product-preview-item {
  display: grid;
  align-content: start;
  gap: 5px;
  min-width: 0;
  padding: 10px 11px;
  border: 1px solid rgba(9, 118, 111, .1);
  border-radius: 10px;
  background: rgba(246, 252, 250, .86);
}
.pess-product-preview small {
  min-width: 0;
  line-height: 1.35;
}
.pess-product-preview strong {
  min-width: 0;
  color: var(--ink);
  text-align: left;
  line-height: 1.4;
  overflow-wrap: normal;
  word-break: normal;
}
.pess-product-preview-item:not(.pess-product-preview-rewards) strong { white-space: nowrap; }
.pess-product-preview-rewards strong { overflow-wrap: anywhere; }
.pess-legacy-product-note { padding: 12px; border-radius: 11px; background: rgba(255, 241, 226, .78); color: #8a4d27; }
.pess-legacy-product-note small { margin-top: 4px; line-height: 1.5; }
#pess-ledger-rows td small { display: block; margin-top: 3px; color: var(--muted); }

.referral-safety-note {
  margin: 0;
  padding: 12px 14px;
  border-radius: 13px;
  background: rgba(255, 241, 226, 0.78);
  color: #8a4d27;
  font-size: 0.83rem;
  line-height: 1.55;
}

.referral-table-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.referral-table-heading h3,
.referral-table-heading span {
  margin: 0;
}

.referral-table-heading span {
  color: var(--muted);
  font-size: 0.84rem;
}

#referral-relation-rows td small,
#referral-leader-rows td small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
}

@media (max-width: 1080px) {
  .referral-metric-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .referral-metric-grid,
  .referral-config-grid,
  .referral-table-grid { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .referral-level-points,
  .pess-template-grid { grid-template-columns: 1fr; }
  .referral-card { padding: 14px; }
  .pess-product-preview { grid-template-columns: 1fr; }
  .pess-product-rule-header .icon-button { justify-self: end; }
  .pess-lead-search-option { grid-template-columns: 1fr; gap: 6px; }
  .pess-lead-search-option em { width: max-content; }
}

/* Completed-customer points and redemptions */
.redemption-workbench { display: grid; gap: 18px; }
.redemption-heading-actions { display: flex; align-items: center; gap: 8px; }
.redemption-heading-actions select { min-width: 160px; }
.redemption-metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 11px; }
.redemption-metric-grid article,
.redemption-card { border: 1px solid rgba(9,118,111,.16); border-radius: 16px; background: rgba(255,255,255,.9); box-shadow: 0 12px 30px rgba(7,65,63,.055); }
.redemption-metric-grid article { min-width: 0; padding: 15px; display: grid; gap: 4px; }
.redemption-metric-grid small,
.redemption-metric-grid span { color: var(--muted); }
.redemption-metric-grid strong { color: var(--ink); font-size: clamp(1.35rem, 2.2vw, 1.85rem); }
.redemption-warning-card { background: linear-gradient(145deg, #fff9e8, #fff); }
.redemption-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.redemption-card { padding: 18px; }
.redemption-adjust-form,
.redemption-request-form { align-content: start; display: grid; gap: 12px; }
.redemption-adjust-form label,
.redemption-request-form label { min-width: 0; display: grid; gap: 6px; color: var(--muted); font-size: .82rem; font-weight: 750; }
.redemption-adjust-form input,
.redemption-adjust-form textarea,
.redemption-request-form input,
.redemption-request-form select,
.redemption-request-form textarea { width: 100%; }
.redemption-cash-fields,
.redemption-product-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.redemption-product-fields[hidden],
.redemption-cash-fields[hidden] { display: none; }
.redemption-safety-note { margin: 0; padding: 11px 13px; border: 1px solid #d5e9e3; border-radius: 12px; color: #176257; background: #effaf6; font-size: .8rem; line-height: 1.55; }
.redemption-table-heading { margin-bottom: 11px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.redemption-table-heading h3 { margin: 0; }
.redemption-table-heading small,
.redemption-table-heading span { color: var(--muted); font-size: .8rem; }
.redemption-table-heading > div { display: grid; gap: 3px; }
.redemption-table-heading input { width: min(320px, 46vw); }
#redemption-customer-rows td small,
#redemption-rows td small { display: block; margin-top: 3px; color: var(--muted); }
.redemption-status { display: inline-flex; align-items: center; min-height: 26px; padding: 4px 8px; border-radius: 999px; font-size: .74rem; font-weight: 850; white-space: nowrap; }
.redemption-status-pending { color: #8b6514; background: #fff5d8; }
.redemption-status-approved { color: #08718b; background: #e7f7fb; }
.redemption-status-fulfilled { color: #08745a; background: #e8f8f1; }
.redemption-status-rejected,
.redemption-status-cancelled { color: #9b4136; background: #fff0ed; }
.redemption-row-actions { display: flex; flex-wrap: wrap; gap: 5px; min-width: 185px; }
.redemption-row-actions button { min-height: 30px; padding: 5px 8px; font-size: .72rem; }
.redemption-row-actions .redemption-reject { color: #9b4136; border-color: #efc4bd; background: #fff8f6; }

@media (max-width: 940px) {
  .redemption-metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .redemption-form-grid { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .redemption-heading-actions { width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) auto; }
  .redemption-heading-actions select { min-width: 0; width: 100%; }
  .redemption-metric-grid { grid-template-columns: 1fr 1fr; gap: 6px; }
  .redemption-metric-grid article,
  .redemption-card { padding: 11px; border-radius: 12px; }
  .redemption-cash-fields,
  .redemption-product-fields { grid-template-columns: 1fr; }
  .redemption-table-heading { align-items: stretch; flex-direction: column; }
  .redemption-table-heading input { width: 100%; }
  .redemption-customers-card table { min-width: 720px; }
  .redemption-ledger-card table { min-width: 960px; }
}

/* Customer follow-up workbench */
.follow-up-heading { flex: 0 0 auto; }
.follow-up-heading .muted { margin: 4px 0 0; font-size: 11px; }
.follow-up-metrics { flex: 0 0 auto; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; margin: 12px 0; }
.follow-up-metrics button { min-width: 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 13px; color: var(--ink); background: linear-gradient(145deg, #fff, #f3faf9); text-align: left; cursor: pointer; }
.follow-up-metrics button:hover, .follow-up-metrics button.active { border-color: #78cfc3; box-shadow: 0 8px 18px rgba(4,77,97,.09); transform: translateY(-1px); }
.follow-up-metrics button:first-child { border-color: #f0c7bd; background: linear-gradient(145deg, #fff8f6, #fff); }
.follow-up-metrics span { display: block; color: var(--muted); font-size: 10px; font-weight: 750; }
.follow-up-metrics strong { display: block; margin-top: 4px; font-size: 22px; line-height: 1; }
.follow-up-toolbar { flex: 0 0 auto; display: grid; grid-template-columns: minmax(260px, 1.7fr) repeat(3, minmax(140px, .8fr)) auto; gap: 8px; align-items: end; padding: 10px; border: 1px solid var(--line); border-radius: 13px; background: linear-gradient(135deg, #f4fbfa, #edf8f7); }
.follow-up-toolbar label { min-width: 0; display: grid; gap: 4px; color: var(--muted); font-size: 10px; font-weight: 750; }
.follow-up-toolbar input, .follow-up-toolbar select { width: 100%; min-width: 0; min-height: 38px; padding: 7px 10px; border: 1px solid #c8dfe1; border-radius: 10px; color: var(--ink); background: #fff; font: inherit; font-size: 12px; font-weight: 700; }
.follow-up-toolbar > button { min-height: 38px; }
.follow-up-summary { flex: 0 0 auto; display: flex; justify-content: space-between; gap: 12px; padding: 9px 4px 7px; color: var(--muted); font-size: 11px; }
.follow-up-summary strong { color: var(--ink); }
.follow-up-scroll-region { min-height: 0; flex: 1 1 auto; overflow: auto; overscroll-behavior: contain; scrollbar-gutter: stable; }
.follow-up-table-wrap { margin-top: 0; }
.follow-up-table-wrap thead th { position: sticky; top: 0; z-index: 2; background: rgba(255,255,255,.98); box-shadow: inset 0 -1px #d9e8e9; }
.follow-up-customer-cell { display: grid; gap: 2px; }
.follow-up-customer-cell strong { font-size: 12px; }
.follow-up-customer-cell small, .follow-up-owner small, .follow-up-last small { color: var(--muted); font-size: 10px; }
.follow-up-due { display: inline-grid; gap: 2px; padding: 6px 8px; border-radius: 9px; background: #eef7f6; }
.follow-up-due.overdue { color: #a23c31; background: #fff0ed; }
.follow-up-due.today { color: #9a6812; background: #fff8df; }
.follow-up-due.upcoming { color: #08755f; background: #eaf9f3; }
.follow-up-due strong { font-size: 11px; }
.follow-up-due small { font-size: 9px; }
.follow-up-row-actions { display: flex; flex-wrap: wrap; gap: 5px; }
.follow-up-row-actions button { padding: 6px 8px; }
.follow-up-dialog { width: min(680px, calc(100vw - 24px)); max-height: min(860px, calc(100dvh - 24px)); padding: 0; border: 0; border-radius: 18px; box-shadow: 0 28px 80px rgba(1,45,58,.24); }
.follow-up-dialog::backdrop { background: rgba(0,31,41,.48); backdrop-filter: blur(4px); }
.follow-up-dialog form { display: grid; gap: 12px; padding: 20px; }
.follow-up-customer { display: grid; gap: 2px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 12px; background: #f4faf9; }
.follow-up-customer span, .follow-up-customer small { color: var(--muted); font-size: 10px; }
.follow-up-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.follow-up-dialog label { display: grid; gap: 5px; color: #49656a; font-size: 11px; font-weight: 750; }
.follow-up-dialog input, .follow-up-dialog select, .follow-up-dialog textarea { width: 100%; padding: 9px 10px; border: 1px solid #cbdfe1; border-radius: 10px; color: var(--ink); background: #fff; font: inherit; }
.follow-up-dialog .enabled-toggle { display: flex; }
.follow-up-history { min-height: 100px; max-height: 220px; overflow: auto; padding: 11px; border: 1px solid var(--line); border-radius: 12px; background: #fafcfc; }
.follow-up-history > div:first-child { display: flex; justify-content: space-between; margin-bottom: 8px; }
.follow-up-history > div:first-child small { color: var(--muted); }
.follow-up-history-list { display: grid; gap: 7px; }
.follow-up-history-item { padding: 9px; border: 1px solid #dce9e9; border-radius: 10px; background: #fff; }
.follow-up-history-item header { display: flex; justify-content: space-between; gap: 8px; }
.follow-up-history-item p { margin: 5px 0 0; color: #405e63; font-size: 11px; white-space: pre-wrap; }
.follow-up-history-item small { color: var(--muted); font-size: 9px; }

@media (max-width: 860px) {
  :root {
    --inbox-action-safe-bottom: env(safe-area-inset-bottom);
  }
  .follow-up-toolbar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .follow-up-search { grid-column: 1 / -1; }
  .follow-up-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 600px) {
  .content[data-workspace="follow-ups"] { padding: 2px 5px 12px; }
  .content[data-workspace="follow-ups"] #follow-ups { padding: 7px; border-radius: 14px; }
  .content[data-workspace="follow-ups"] .mobile-workbench-fixed { gap: 5px; padding: 6px; border: 1px solid #c9e1e3; border-radius: 12px; background: #f2faf9; box-shadow: none; }
  .content[data-workspace="follow-ups"] .mobile-workbench-scroll { padding-top: 4px; overflow-y: auto; }
  .follow-up-heading { align-items: center; gap: 6px; }
  .follow-up-heading .muted { display: none; }
  .follow-up-heading h2 { font-size: var(--mobile-title-size); }
  .follow-up-heading .eyebrow { font-size: 8px; }
  .follow-up-metrics { gap: 5px; margin: 0; }
  .follow-up-metrics button { min-height: 48px; padding: 7px 8px; border-radius: 9px; }
  .follow-up-metrics span { font-size: 8px; }
  .follow-up-metrics strong { font-size: 14px !important; }
  .follow-up-toolbar { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; padding: 6px; }
  .follow-up-toolbar .follow-up-search { grid-column: 1 / -1; }
  .follow-up-toolbar label > span { font-size: 8px; }
  .follow-up-toolbar input, .follow-up-toolbar select { min-height: 34px; padding: 5px 7px; font-size: 11px !important; }
  .follow-up-toolbar > button { min-height: 32px; font-size: 10px; }
  .follow-up-summary { padding: 6px 2px; font-size: 9px; }
  .follow-up-table-wrap table, .follow-up-table-wrap tbody, .follow-up-table-wrap tr, .follow-up-table-wrap td { display: block; width: 100%; }
  .follow-up-table-wrap thead { display: none; }
  .follow-up-table-wrap tbody { display: grid; gap: 7px; }
  .follow-up-table-wrap tr { padding: 9px; border: 1px solid #d7e7e7; border-radius: 12px; background: #fff; }
  .follow-up-table-wrap td { padding: 4px 0; border: 0; font-size: 11px; }
  .follow-up-row-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .follow-up-row-actions button { min-height: 34px; }
  .follow-up-dialog form { padding: 14px; }
  .follow-up-form-grid { grid-template-columns: 1fr; }
  .follow-up-history { max-height: 170px; }
}
.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0,0,0,0) !important; white-space: nowrap !important; border: 0 !important; }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
[id] { scroll-margin-top: 118px; }
body { margin: 0; color: var(--ink); background:
  radial-gradient(circle at 92% 2%, rgba(43,201,133,.11), transparent 24%),
  radial-gradient(circle at 72% 0%, rgba(22,141,184,.08), transparent 28%),
  var(--paper); }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 248px minmax(0, 1fr); transition: grid-template-columns .24s ease; }
.sidebar { position: sticky; top: 0; z-index: 40; height: 100vh; padding: 24px 18px 18px; display: flex; flex-direction: column; overflow-x: hidden; overflow-y: auto; color: white; scrollbar-width: none; background-color: #043e55; background-image:
  linear-gradient(90deg, rgba(2,42,59,.24) 0%, rgba(2,51,68,.08) 58%, rgba(3,61,76,.18) 100%),
  url("/static/assets/sidebar-bg-uhd.jpg?v=20260811.1");
  background-position: center, 70% center;
  background-repeat: no-repeat;
  background-size: cover;
  box-shadow: 8px 0 30px rgba(4,63,82,.12); transition: width .24s ease, padding .24s ease, transform .24s ease; }
.sidebar > * { position: relative; z-index: 1; }
.sidebar-head { display: flex; align-items: center; gap: 8px; }
.brand { min-width: 0; display: flex; gap: 12px; align-items: center; color: white; text-decoration: none; margin: 0 6px 22px; }
.brand-mark { width: 54px; height: 54px; flex: 0 0 auto; overflow: visible; display: grid; place-items: center; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.brand-mark img { width: 100%; height: 100%; object-fit: contain; display: block; filter: drop-shadow(0 3px 8px rgba(0,35,51,.28)); }
.brand-copy { min-width: 0; }
.brand strong, .brand small { display: block; }
.brand strong { color: #fff; font-size: 17px; letter-spacing: .025em; white-space: nowrap; }
.brand small { margin-top: 4px; color: var(--gold); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; white-space: nowrap; }
.sidebar-close { display: none; margin-left: auto; border: 0; color: white; background: transparent; font-size: 30px; cursor: pointer; }
.sidebar-collapse { width: 100%; margin: 0 0 16px; padding: 9px 12px; display: flex; align-items: center; gap: 10px; border: 1px solid rgba(255,255,255,.18); border-radius: 11px; color: rgba(255,255,255,.78); background: rgba(255,255,255,.07); font-size: 12px; cursor: pointer; }
.sidebar-collapse > span:first-child { color: var(--gold); font-size: 21px; line-height: 1; transition: transform .2s ease; }
.sidebar nav { display: grid; gap: 7px; }
.nav-order-button { flex: 0 0 auto; display: flex; align-items: center; justify-content: flex-end; gap: 7px; width: 100%; margin: 0 0 8px; padding: 6px 10px; border: 1px solid transparent; border-radius: 9px; color: #d4eee9; background: transparent; font: inherit; font-size: 12px; cursor: pointer; }
.nav-order-button:hover { color: #fff; background: rgba(255,255,255,.08); }
.nav-order-button > span:first-child { font-size: 19px; line-height: 1; }
.nav-order-button:focus-visible { outline: 2px solid #9df4d1; outline-offset: 2px; }
.sidebar-personal-controls { flex: 0 0 auto; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin: 0 0 12px; }
.sidebar-personal-controls > button { width: 100%; min-width: 0; min-height: 38px; margin: 0; padding: 7px 6px; justify-content: center; border: 1px solid rgba(255,255,255,.2); border-radius: 9px; color: #e6fff7; background: rgba(255,255,255,.07); font: inherit; font-size: 11px; line-height: 1.3; cursor: pointer; white-space: normal; }
.sidebar-personal-controls .notification-install-button.permission-granted { background: rgba(43,201,133,.24); }
.sidebar-personal-controls .notification-install-button.permission-blocked { color: #ffe9c8; border-color: rgba(255,190,92,.35); }
.sidebar-personal-controls .nav-order-button.hidden + .notification-install-button { grid-column: 1 / -1; }
.sidebar-personal-controls > button:focus-visible { outline: 2px solid #9df4d1; outline-offset: 2px; }
@media (min-width: 861px) {
  body.sidebar-collapsed .sidebar-personal-controls { gap: 3px; }
  body.sidebar-collapsed .sidebar-personal-controls > button { padding: 5px 1px; }
  body.sidebar-collapsed .sidebar-personal-controls .notification-install-button { font-size: 0; }
  body.sidebar-collapsed .sidebar-personal-controls .notification-install-button::before { content: "♪"; font-size: 17px; }
}
.nav-order-dialog { width: min(540px, calc(100vw - 28px)); max-height: calc(100dvh - 32px); padding: 22px; border: 1px solid var(--line); border-radius: 18px; color: var(--ink); background: #fff; box-shadow: 0 20px 70px rgba(4,63,82,.24); }
.nav-order-dialog[open] { display: flex; flex-direction: column; }
.nav-order-dialog::backdrop { background: rgba(2,32,43,.5); }
.nav-order-dialog .dialog-heading { flex: 0 0 auto; gap: 14px; }
.nav-order-dialog h2 { margin: 0; font-size: 21px; }
.nav-order-dialog .muted { flex: 0 0 auto; margin: 10px 0 14px; font-size: 13px; line-height: 1.55; }
.nav-order-list { min-height: 0; overflow-y: auto; overscroll-behavior: contain; margin: 0; padding: 0; list-style: none; counter-reset: nav-order; }
.nav-order-row { counter-increment: nav-order; display: flex; align-items: center; gap: 10px; padding: 9px 2px; border-bottom: 1px solid var(--line); }
.nav-order-row::before { content: counter(nav-order); flex: 0 0 22px; text-align: center; font-size: 12px; color: #68808a; font-variant-numeric: tabular-nums; }
.nav-order-label { flex: 1; min-width: 0; font-size: 14px; line-height: 1.4; overflow-wrap: anywhere; }
.nav-order-actions { display: flex; flex: 0 0 auto; gap: 5px; }
.nav-order-actions button { max-width: 110px; white-space: normal; min-width: 45px; min-height: 36px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: #f4faf9; font: inherit; font-size: 12px; cursor: pointer; }
.nav-order-actions button:disabled { opacity: .35; cursor: default; }
.nav-order-dialog button:focus-visible { outline: 2px solid #08738c; outline-offset: 2px; }
.nav-order-status { flex: 0 0 auto; min-height: 20px; margin: 10px 0; font-size: 12px; color: #526d76; }
.nav-order-footer { flex: 0 0 auto; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.nav-order-footer #nav-order-reset { margin-right: auto; }
@media (min-width: 861px) {
  body.sidebar-collapsed .nav-order-button { justify-content: center; padding-inline: 4px; }
  body.sidebar-collapsed .nav-order-button .nav-label { display: none; }
}
@media (max-width: 480px) {
  .nav-order-dialog { padding: 16px; }
  .nav-order-row { gap: 6px; }
  .nav-order-label { font-size: 13px; }
  .nav-order-actions { gap: 4px; flex-direction: column; width: 94px; }
  .nav-order-actions button { min-width: 40px; min-height: 42px; padding: 6px; }
}
.nav-link { display: flex; gap: 11px; align-items: center; padding: 10px 11px; border: 1px solid transparent; border-radius: 11px; color: rgba(255,255,255,.78); text-decoration: none; font-size: 14px; transition: .18s ease; }
.nav-link:hover { color: white; background: rgba(255,255,255,.08); }
.nav-link.active { color: #043f52; border-color: rgba(255,255,255,.65); background: linear-gradient(105deg, #eafbf4, #d9f5f1); box-shadow: 0 8px 22px rgba(1,45,58,.16); }
.nav-icon { width: 24px; height: 24px; flex: 0 0 auto; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.28); border-radius: 7px; color: #67e3b0; background: rgba(0,45,61,.18); transition: color .18s ease, border-color .18s ease, background .18s ease; }
.nav-icon svg { width: 15px; height: 15px; overflow: visible; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nav-link:hover .nav-icon { color: #9df4d1; border-color: rgba(255,255,255,.46); background: rgba(255,255,255,.08); }
.nav-link.active .nav-icon { color: #08738c; border-color: rgba(5,108,132,.25); background: rgba(255,255,255,.78); }
.sidebar-utility-panel { margin: 0 0 13px; padding: 6px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-auto-rows: minmax(38px, auto); gap: 5px; border: 1px solid rgba(255,255,255,.18); border-radius: 14px; background: rgba(0,48,64,.2); }
.sidebar-utility-panel > * { width: 100%; min-width: 0; min-height: 38px; margin: 0; overflow: hidden; border-radius: 9px !important; font-size: 11px; line-height: 1.15; text-align: center; }
.sidebar-utility-panel .sidebar-collapse { grid-column: 1; grid-row: 1; padding: 6px 8px; justify-content: center; gap: 6px; border-radius: 9px; }
.sidebar-utility-panel .sidebar-collapse > span:first-child { font-size: 18px; }
.sidebar-utility-panel .language-switcher { grid-column: 2; grid-row: 1; padding: 6px 24px 6px 8px; color: white; border: 1px solid rgba(255,255,255,.13); border-radius: 9px; background-color: rgba(255,255,255,.08); }
.sidebar-utility-panel .language-switcher option { color: var(--ink); background: white; }
.sidebar-utility-panel .user-button { display: none !important; }
.sidebar-utility-panel #logout-button { grid-column: 2; grid-row: 2; color: white; background: rgba(255,255,255,.1); }
.sidebar-utility-panel .alert-toggle { grid-column: 2; grid-row: 2; max-width: none; padding-inline: 7px; color: #d9fff0 !important; border-radius: 9px; background: rgba(43,201,133,.14) !important; }
.sidebar-utility-panel .install-app-button { grid-column: 1 / -1; grid-row: 3; padding: 6px 7px; border: 1px solid rgba(255,255,255,.2); color: #fff; background: rgba(255,255,255,.1); font: inherit; font-size: 10px; font-weight: 800; white-space: normal; cursor: pointer; }
.sidebar-utility-panel .notification-install-button { grid-column: 2; grid-row: 3; padding: 6px 7px; border: 1px solid rgba(75,232,189,.38); color: #e6fff7; background: rgba(43,201,133,.17); font: inherit; font-size: 10px; font-weight: 850; white-space: normal; cursor: pointer; }
.sidebar-utility-panel .notification-install-button.permission-granted { color: #d9fff0; background: rgba(43,201,133,.24); }
.sidebar-utility-panel .notification-install-button.permission-blocked { color: #ffe9c8; border-color: rgba(255,190,92,.35); background: rgba(255,160,55,.12); }
.sidebar-utility-panel .mode-pill { grid-column: 1; grid-row: 2; justify-content: center; padding-inline: 7px; color: #d9fff0; border-color: rgba(43,201,133,.25); background: rgba(43,201,133,.1); text-overflow: ellipsis; }
.sidebar-utility-panel .install-app-button.hidden + .notification-install-button { grid-column: 1 / -1; }
.sidebar-note { margin-top: 8px; padding: 10px; display: flex; gap: 10px; border: 1px solid rgba(255,255,255,.17); border-radius: 12px; background: rgba(0,48,64,.18); }
.sidebar-note strong { display: block; font-size: 14px; }
.sidebar-note p { margin: 5px 0 0; color: rgba(255,255,255,.53); font-size: 12px; line-height: 1.55; }
.live-dot { width: 8px; height: 8px; flex: 0 0 auto; margin-top: 3px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 0 5px rgba(188,240,113,.1); }
.sidebar-backdrop { display: none; }
body.sidebar-collapsed .app-shell { grid-template-columns: 80px minmax(0, 1fr); }
body.sidebar-collapsed .sidebar { padding-inline: 14px; }
body.sidebar-collapsed .brand { justify-content: center; margin-inline: 0; }
body.sidebar-collapsed .brand-mark { width: 54px; height: 54px; }
body.sidebar-collapsed .brand-copy,
body.sidebar-collapsed .sidebar-collapse .nav-label,
body.sidebar-collapsed .nav-link .nav-label,
body.sidebar-collapsed .sidebar-note { display: none; }
body.sidebar-collapsed .sidebar-utility-panel { grid-template-columns: 1fr; padding: 0; border-color: transparent; background: transparent; }
body.sidebar-collapsed .sidebar-utility-panel > :not(.sidebar-collapse) { display: none !important; }
body.sidebar-collapsed .sidebar-utility-panel .sidebar-collapse { grid-column: 1; width: 100%; padding-inline: 8px; }
body.sidebar-collapsed .sidebar-collapse,
body.sidebar-collapsed .nav-link { justify-content: center; padding-inline: 8px; }
body.sidebar-collapsed .sidebar-collapse > span:first-child { transform: rotate(180deg); }
body.sidebar-collapsed .nav-icon { width: 24px; }

main { min-width: 0; }
.topbar { min-height: 68px; padding: 10px; display: none; grid-template-columns: 1fr; align-items: center; gap: 16px; background:
  linear-gradient(115deg, rgba(255,255,255,.98) 0 70%, rgba(235,250,248,.96) 100%);
  border-bottom: 1px solid var(--line); box-shadow: 0 5px 20px rgba(4,77,97,.04); backdrop-filter: blur(15px); position: sticky; top: 0; z-index: 5; }
.topbar-title { min-width: 0; }
.topbar h1 { max-width: 720px; margin: 4px 0 0; font-size: clamp(19px, 1.55vw, 24px); letter-spacing: -.028em; line-height: 1.12; }
.eyebrow { margin: 0; color: var(--gold-deep); font-size: 12px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.menu-button { display: none; width: 42px; height: 42px; flex: 0 0 auto; padding: 11px; border: 1px solid var(--line); border-radius: 12px; background: white; cursor: pointer; }
.menu-button span { height: 2px; display: block; margin: 4px 0; border-radius: 999px; background: var(--forest); }
.top-actions { min-width: 0; display: flex; justify-content: flex-start; align-items: center; gap: 8px; }
.top-action-group { min-height: 46px; padding: 4px; display: flex; align-items: center; gap: 3px; border: 1px solid rgba(185,217,222,.8); border-radius: 14px; background: rgba(255,255,255,.72); box-shadow: 0 6px 18px rgba(4,77,97,.045); }
.top-action-group > * { min-height: 36px; }
.top-actions #logout-button { flex: 0 0 auto; white-space: nowrap; }
.language-switcher { width: auto; min-width: 104px; padding: 7px 28px 7px 10px; border: 0; border-radius: 10px; color: var(--ink); background-color: transparent; font-size: 12px; font-weight: 800; cursor: pointer; }
html[lang="ru"] .nav-link, html[lang="kk"] .nav-link { font-size: 13px; line-height: 1.25; }
html[lang="ru"] .topbar h1, html[lang="kk"] .topbar h1 { font-size: clamp(17px, 1.4vw, 21px); line-height: 1.12; }
html[lang="ru"] .topbar .eyebrow, html[lang="kk"] .topbar .eyebrow { font-size: 10px; }
html[lang="ru"] [id], html[lang="kk"] [id] { scroll-margin-top: 170px; }
.user-button { max-width: 150px; overflow: hidden; padding: 7px 10px; border: 0; border-radius: 10px; color: var(--ink); background: transparent; font-size: 12px; font-weight: 850; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.mode-pill, .subtle-badge { display: inline-flex; align-items: center; gap: 7px; padding: 8px 11px; border: 1px solid #bfe5dc; border-radius: 999px; color: #176d75; background: #effbf8; font-size: 12px; font-weight: 800; white-space: nowrap; }
.mode-pill { cursor: pointer; transition: transform .18s ease, background .18s ease, border-color .18s ease; }
.mode-pill:hover { border-color: #83d7c5; background: #e3f8f2; transform: translateY(-1px); }
.mode-pill:focus-visible { outline: 3px solid rgba(43,201,133,.25); outline-offset: 2px; }
.mode-pill:disabled { cursor: wait; opacity: .72; transform: none; }
.mode-pill i { width: 7px; height: 7px; border-radius: 50%; background: var(--amber); }
.primary-button, .small-button, .icon-button, .text-button { border: 0; cursor: pointer; transition: .18s ease; }
.primary-button { padding: 8px 13px; border-radius: 10px; color: white; background: linear-gradient(115deg, #087b9e, #14a9af 62%, #2bc985); font-weight: 800; font-size: 12px; box-shadow: 0 7px 18px rgba(7,110,137,.15); }
.primary-button:hover { background: linear-gradient(115deg, #066b8a, #0c979f 62%, #20b879); transform: translateY(-1px); }
button.is-click-feedback:not(:disabled) { animation: button-click-feedback .16s ease-out both; }
@keyframes button-click-feedback {
  0% { filter: brightness(1); }
  45% { transform: translateY(1px) scale(.97); filter: brightness(.94); }
  100% { filter: brightness(1); }
}
.icon-button { width: 37px; height: 37px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 11px; background: white; color: var(--ink); }
.icon-button:hover { border-color: #aab8ae; }
.small-button { padding: 7px 9px; border: 0; border-radius: 9px; color: #145b69; background: #edf7f7; font-size: 12px; font-weight: 800; }
.alert-toggle { max-width: 170px; min-height: 36px; overflow: hidden; border-color: transparent !important; color: #08755f !important; background: #edfbf4 !important; text-overflow: ellipsis; white-space: nowrap; }
.text-button { padding: 5px; color: var(--forest-2); background: transparent; text-decoration: none; font-size: 13px; font-weight: 800; }

.content { width: 100%; max-width: none; margin: 0; padding: 10px 10px 24px; }
.content > .hero-grid, .content > .flow-card, .main-grid > .panel, .customer-portal-panel { display: none; }
.content[data-workspace="overview"] { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 18px; align-items: start; }
.content[data-workspace="overview"] > .hero-grid { grid-column: 1 / -1; grid-row: 1; display: grid; }
.content[data-workspace="overview"] > .hero-grid {
  position: sticky;
  top: 0;
  z-index: 18;
  padding: 2px 0 10px;
  background: linear-gradient(180deg, rgba(242,248,248,.995) 0%, rgba(242,248,248,.97) 82%, rgba(242,248,248,0) 100%);
  filter: drop-shadow(0 8px 12px rgba(4,77,97,.045));
}
.content[data-workspace="overview"] > .flow-card { grid-column: 1 / -1; grid-row: 3; display: block; }
.content[data-workspace="overview"] > .main-grid { display: contents; }
.content[data-workspace="overview"] #campaigns,
.content[data-workspace="overview"] #operations,
.content[data-workspace="overview"] section[aria-labelledby="funnel-title"] { display: block; margin-top: 0; }
.content[data-workspace="overview"] section[aria-labelledby="funnel-title"] { grid-column: 1 / -1; grid-row: 2; }
.content[data-workspace="overview"] #campaigns { grid-column: 1 / -1; grid-row: 3; }
.content[data-workspace="overview"] > .flow-card { grid-row: 4; }
.content[data-workspace="overview"] #operations { grid-column: 1 / -1; grid-row: 5; }
.content[data-workspace="operations"] #operations,
.content[data-workspace="leads"] #leads,
.content[data-workspace="follow-ups"] #follow-ups,
.content[data-workspace="orders"] #orders,
.content[data-workspace="referrals"] #referrals,
.content[data-workspace="redemptions"] #redemptions,
.content[data-workspace="inventory"] #inventory,
.content[data-workspace="campaigns"] #campaigns,
.content[data-workspace="inbox"] #inbox,
.content[data-workspace="support-agents"] #support-agents,
.content[data-workspace="whatsapp-templates"] #whatsapp-templates,
.content[data-workspace="backups"] #backups,
.content[data-workspace="users"] #users,
.content[data-workspace="customer-portal"] #customer-portal { display: block; margin-top: 0; }
.content[data-workspace]:not([data-workspace="overview"]) .main-grid { display: block; }
.content[data-workspace="customer-portal"] .main-grid { display: none; }
.content[data-workspace="inbox"] { height: 100dvh; min-height: 640px; padding: 10px; overflow: hidden; }
.content[data-workspace="inbox"] .main-grid { height: 100%; min-height: 0; }
.content[data-workspace="follow-ups"] { height: 100dvh; max-height: 100dvh; overflow: hidden; }
.content[data-workspace="follow-ups"] > .main-grid,
.content[data-workspace="follow-ups"] #follow-ups { height: 100%; min-height: 0; max-height: 100%; }
.content[data-workspace="follow-ups"] #follow-ups { display: flex; flex-direction: column; overflow: hidden; }
.whatsapp-template-panel { min-height: calc(100dvh - 44px); padding: 18px; }
.whatsapp-template-heading { align-items: center; }
.workspace .section-heading.whatsapp-template-heading h2 { font-size: 16px; line-height: 1.25; }
.whatsapp-template-heading .eyebrow { font-size: 10px; letter-spacing: .09em; }
.whatsapp-template-sync { margin: 5px 0 0; color: var(--muted); font-size: 11px; font-weight: 700; }
.whatsapp-template-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; margin: 12px 0; }
.whatsapp-template-summary article { padding: 11px 13px; border: 1px solid var(--line); border-radius: 12px; background: #f8fbfb; }
.whatsapp-template-summary article.pending { border-color: #efd79c; background: #fff9eb; }
.whatsapp-template-summary article.approved { border-color: #b8e4d2; background: #effaf5; }
.whatsapp-template-summary article.eligible { border-color: #9eddd3; background: #eaf9f7; }
.whatsapp-template-summary span { display: block; color: var(--muted); font-size: 10px; font-weight: 750; }
.whatsapp-template-summary strong { display: block; margin-top: 3px; color: var(--ink); font-size: 20px; line-height: 1.1; }
.whatsapp-template-toolbar { display: grid; grid-template-columns: minmax(240px, 1.7fr) repeat(3, minmax(135px, .75fr)) auto; gap: 8px; align-items: end; margin-bottom: 8px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: linear-gradient(135deg,rgba(240,249,249,.96),rgba(247,252,251,.96)); }
.whatsapp-template-toolbar label { min-width: 0; }
.whatsapp-template-toolbar label > span { display: block; margin: 0 0 4px; color: var(--muted); font-size: 10px; font-weight: 800; }
.whatsapp-template-toolbar input,
.whatsapp-template-toolbar select { width: 100%; min-height: 36px; padding-top: 6px; padding-bottom: 6px; border-radius: 9px; background-color: rgba(255,255,255,.94); font-size: 11px; font-weight: 750; }
.whatsapp-template-toolbar .template-filter-clear { min-height: 36px; padding: 7px 11px; font-size: 11px; white-space: nowrap; }
.whatsapp-template-resultbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 0 2px 10px; color: var(--muted); font-size: 11px; }
.whatsapp-template-resultbar strong { color: #0a6477; }
.whatsapp-template-guardrail { display: flex; gap: 8px; align-items: center; margin-bottom: 11px; padding: 9px 11px; border-radius: 10px; color: #315f58; background: #edf8f3; font-size: 11px; }
.whatsapp-template-guardrail strong { flex: 0 0 auto; color: #087663; }
.whatsapp-template-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.whatsapp-template-card { overflow: hidden; padding: 13px; border: 1px solid #d6e6e7; border-radius: 13px; background: #fff; box-shadow: 0 7px 18px rgba(4,77,97,.05); }
.whatsapp-template-card.status-pending { border-color: #ecd599; background: linear-gradient(155deg,#fffdf7,#fff9e9); }
.whatsapp-template-card.status-approved { border-color: #b8e4d2; }
.whatsapp-template-card.status-rejected,
.whatsapp-template-card.status-disabled,
.whatsapp-template-card.status-paused { border-color: #efc1bb; background: #fff8f7; }
.whatsapp-template-card header { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.whatsapp-template-card header div { min-width: 0; }
.whatsapp-template-card header span { display: block; margin-bottom: 3px; color: #0782a3; font-size: 11px; font-weight: 850; letter-spacing: .05em; }
.whatsapp-template-card header strong { display: block; overflow-wrap: anywhere; font-size: 13px; line-height: 1.25; }
.whatsapp-template-card header em { flex: 0 0 auto; padding: 4px 8px; border-radius: 999px; color: #956200; background: #fff0c6; font-size: 10px; font-style: normal; font-weight: 850; }
.whatsapp-template-card.status-approved header em { color: #087663; background: #daf5e9; }
.whatsapp-template-card.status-rejected header em,
.whatsapp-template-card.status-disabled header em,
.whatsapp-template-card.status-paused header em { color: #a13e32; background: #fde2de; }
.whatsapp-template-card dl { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 9px 0 7px; }
.whatsapp-template-card dl div { padding: 6px 8px; border-radius: 8px; background: rgba(235,244,244,.72); }
.whatsapp-template-card dt { color: var(--muted); font-size: 10px; font-weight: 750; }
.whatsapp-template-card dd { margin: 2px 0 0; overflow-wrap: anywhere; color: var(--ink); font-size: 11px; font-weight: 800; }
.whatsapp-template-body { display: -webkit-box; min-height: 0; margin: 0; overflow: hidden; padding: 9px; border: 1px solid rgba(207,225,226,.8); border-radius: 9px; color: #355d67; background: rgba(255,255,255,.72); font-size: 13px; line-height: 1.45; white-space: pre-wrap; -webkit-box-orient: vertical; -webkit-line-clamp: 4; }
.whatsapp-template-body.expanded { display: block; overflow: visible; -webkit-line-clamp: unset; }
.template-body-toggle { display: block; margin: 5px 0 0 auto; padding: 3px 2px; border: 0; color: #087894; background: transparent; font-size: 10px; font-weight: 800; cursor: pointer; }
.template-rejection { margin: 10px 0 0; color: #a13e32; }
.whatsapp-template-card footer { margin-top: 8px; padding-top: 7px; border-top: 1px solid rgba(207,225,226,.8); font-size: 11px; font-weight: 800; }
.whatsapp-template-card footer.eligible { color: #087663; }
.whatsapp-template-card footer.protected { color: #986b0c; }
.whatsapp-template-empty { grid-column: 1 / -1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 190px; padding: 28px; border: 1px dashed #bdd5d7; border-radius: 16px; color: var(--muted); background: rgba(248,252,252,.86); text-align: center; }
.whatsapp-template-empty strong { color: var(--ink); font-size: 15px; }
.whatsapp-template-empty span { font-size: 12px; }
.whatsapp-template-empty.error { border-color: #efc1bb; background: #fff8f7; }
.whatsapp-template-empty.error strong { color: #a13e32; }
.hero-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.metric-period-toolbar { grid-column: 1 / -1; display: flex; align-items: center; justify-content: flex-end; gap: 9px; }
.metric-period-toolbar label { color: var(--muted); font-size: 12px; font-weight: 800; }
.metric-period-toolbar select { width: auto; min-width: 128px; min-height: 36px; padding: 7px 34px 7px 12px; border-color: var(--line); border-radius: 11px; background-color: rgba(255,255,255,.96); font-size: 12px; font-weight: 800; }
.metric-card { min-height: 142px; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(255,255,255,.94); box-shadow: var(--shadow); transition: transform .18s ease, box-shadow .18s ease; }
.metric-card:hover { transform: translateY(-2px); box-shadow: 0 16px 38px rgba(4,77,97,.09); }
.accent-card { color: white; border-color: #087894; background: linear-gradient(145deg, #07566d, #087b9e 60%, #21b9a6); }
.metric-heading { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 13px; font-weight: 750; }
.accent-card .metric-heading { color: rgba(255,255,255,.68); }
.metric-icon { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 9px; color: var(--forest); background: var(--mint-soft); font-size: 14px; }
.metric-value { display: block; margin-top: 12px; font-size: clamp(26px, 2.35vw, 34px); letter-spacing: -.045em; line-height: 1; }
.metric-value.is-status { margin-top: 18px; font-size: clamp(18px, 1.65vw, 23px); letter-spacing: -.02em; line-height: 1.15; }
.metric-card p { margin: 12px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.metric-card.metric-live-pulse { animation: metric-live-pulse .38s ease-out; }
@keyframes metric-live-pulse { from { box-shadow: 0 0 0 3px rgba(31,191,153,.2), var(--shadow); } to { box-shadow: var(--shadow); } }
.accent-card p { color: rgba(255,255,255,.58); }
.accent-card p b { color: var(--mint); }

.flow-card, .panel { margin-top: 17px; padding: 21px; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(255,255,255,.96); box-shadow: var(--shadow); }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.section-heading h2 { margin: 4px 0 0; font-size: 18px; letter-spacing: -.02em; }
.section-heading.compact { align-items: flex-start; }
.flow-track { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr auto 1fr auto 1fr; align-items: center; gap: 12px; margin-top: 25px; }
.flow-step { min-width: 0; display: flex; gap: 10px; align-items: center; }
.flow-step > div { min-width: 0; }
.flow-number { width: 33px; height: 33px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 10px; color: var(--forest); background: var(--mint-soft); font-size: 12px; font-weight: 900; }
.flow-step strong, .flow-step small { display: block; }
.flow-step strong { font-size: 14px; }
.flow-step small { overflow: hidden; margin-top: 3px; color: var(--muted); font-size: 11px; line-height: 1.35; text-overflow: ellipsis; white-space: normal; }
.flow-arrow { color: #b3bdb6; }

.content[data-workspace="overview"] .panel,
.content[data-workspace="overview"] .flow-card { margin-top: 0; }
.content[data-workspace="overview"] #operations { min-height: 100%; }
.operations-integrations-block { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.operations-integrations-block > .section-heading { margin-bottom: 14px; }
.content[data-workspace="overview"] section[aria-labelledby="funnel-title"] { min-height: 100%; background: linear-gradient(155deg, #ffffff, #f8fcfc); }
.content[data-workspace="overview"] #operations .operations-grid { grid-template-columns: minmax(420px, .8fr) minmax(520px, 1.2fr); align-items: start; }
.content[data-workspace="overview"] #operations .readiness-steps { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.main-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(290px, .8fr); gap: 0 17px; align-items: start; }
.panel { min-width: 0; }
.wide-panel { grid-row: span 1; }
.full-panel { grid-column: 1 / -1; }
.health-pill { display: inline-flex; align-items: center; gap: 7px; padding: 7px 10px; border-radius: 999px; color: #47633e; background: #edf8e4; font-size: 12px; font-weight: 800; }
.health-pill i { width: 7px; height: 7px; border-radius: 50%; background: #69a943; }
.health-pill.attention { color: #8c493d; background: #fff0ed; }
.health-pill.attention i { background: var(--red); }
.operations-heading-actions { display: flex; align-items: flex-end; justify-content: flex-end; gap: 10px; }
.queue-period-control { display: grid; gap: 4px; color: var(--muted); font-size: 10px; font-weight: 800; }
.queue-period-control select { min-width: 118px; min-height: 34px; padding: 6px 30px 6px 10px; border: 1px solid var(--line); border-radius: 10px; color: var(--forest); background-color: #fff; font-size: 11px; font-weight: 800; }
.operations-grid { display: grid; grid-template-columns: minmax(420px, .85fr) minmax(520px, 1.15fr); gap: 18px; margin-top: 18px; }
.queue-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(104px, 1fr)); gap: 8px; }
.queue-stats article { min-width: 0; padding: 12px; border: 1px solid #e6ebe7; border-radius: 12px; background: #fafbf9; }
.queue-stats span, .queue-stats strong { display: block; }
.queue-stats span { color: var(--muted); font-size: 11px; line-height: 1.25; overflow-wrap: anywhere; }
.queue-stats strong { margin-top: 5px; font-size: 20px; letter-spacing: -.03em; }
.alert-list { margin-top: 10px; display: grid; gap: 8px; }
.alert-item { padding: 10px 12px; display: grid; grid-template-columns: 8px 1fr; gap: 10px; border: 1px solid #e6ebe7; border-radius: 11px; }
.alert-item i { width: 8px; height: 8px; margin-top: 3px; border-radius: 50%; background: var(--amber); }
.alert-item.critical i { background: var(--red); }
.alert-item strong, .alert-item small { display: block; }
.alert-item strong { font-size: 12px; }
.alert-item small { margin-top: 3px; color: var(--muted); font-size: 11px; line-height: 1.45; }
.all-clear { padding: 11px 12px; border-radius: 11px; color: #45633d; background: #f1f9e9; font-size: 11px; }
.readiness-card { padding: 14px; border-radius: 15px; color: white; background: var(--forest); }
.readiness-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.readiness-head strong, .readiness-head small { display: block; }
.readiness-head strong { font-size: 13px; }
.readiness-head small { margin-top: 4px; color: rgba(255,255,255,.55); font-size: 11px; }
.readiness-head > span { color: var(--mint); font-size: 21px; font-weight: 900; letter-spacing: -.04em; }
.readiness-track { height: 5px; overflow: hidden; margin-top: 12px; border-radius: 999px; background: rgba(255,255,255,.13); }
.readiness-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--mint); transition: width .3s ease; }
.readiness-steps { margin-top: 12px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.readiness-step { display: grid; grid-template-columns: 17px 1fr auto; gap: 7px; align-items: center; padding: 7px 8px; border-radius: 9px; background: rgba(255,255,255,.055); }
.readiness-step i { width: 17px; height: 17px; display: grid; place-items: center; border-radius: 6px; color: var(--forest); background: var(--mint); font-style: normal; font-size: 10px; font-weight: 900; }
.readiness-step.pending i { color: rgba(255,255,255,.5); background: rgba(255,255,255,.11); }
.readiness-step span { font-size: 11px; }
.readiness-step small { color: rgba(255,255,255,.45); font-size: 10px; }
.night-monitor-console { margin-top: 16px; padding: 14px; border: 1px solid #cde3e5; border-radius: 15px; background: linear-gradient(135deg,#f8fcfc,#edf9f6); }
.night-monitor-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }.night-monitor-head h3 { margin: 3px 0; font-size: 16px; }.night-monitor-head small { color: var(--muted); font-size: 10px; }
.night-monitor-form { margin-top: 12px; display: grid; grid-template-columns: repeat(5,minmax(0,1fr)) auto; gap: 8px; align-items: end; }.night-monitor-form > label { display: grid; gap: 5px; color: var(--muted); font-size: 9px; font-weight: 800; }.night-monitor-form select { min-height: 38px; padding: 7px 9px; border: 1px solid #c8dde0; border-radius: 10px; background: white; }.night-monitor-form .enabled-toggle { min-height: 38px; padding: 7px 9px; display: flex; align-items: center; border: 1px solid #cfe2e0; border-radius: 10px; background: white; }.night-monitor-actions { display: flex; gap: 6px; }.night-monitor-actions button { min-height: 38px; white-space: nowrap; }
.night-monitor-guardrail { margin-top: 10px; padding: 9px 11px; border-radius: 10px; color: #536c72; background: #e8f2f3; font-size: 9px; line-height: 1.5; }
.night-monitor-runs { margin-top: 9px; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 7px; }.night-monitor-run { padding: 9px 10px; border: 1px solid #d6e7e6; border-radius: 10px; background: rgba(255,255,255,.9); }.night-monitor-run strong,.night-monitor-run small { display:block; }.night-monitor-run strong { font-size: 10px; }.night-monitor-run small { margin-top:3px;color:var(--muted);font-size:8px;line-height:1.4; }
@media(max-width:860px){.night-monitor-form{grid-template-columns:repeat(2,minmax(0,1fr))}.night-monitor-actions{grid-column:1/-1}.night-monitor-actions button{flex:1}.night-monitor-runs{grid-template-columns:1fr}.night-monitor-console{padding:10px}.night-monitor-head h3{font-size:13px}}
.table-wrap { overflow-x: auto; margin-top: 17px; }
.lead-workbench-toolbar { margin-top: 16px; padding: 10px; display: grid; grid-template-columns: minmax(260px, 1.7fr) repeat(3, minmax(145px, .72fr)) auto; gap: 8px; align-items: end; border: 1px solid #cfe5e7; border-radius: 14px; background: linear-gradient(120deg, #f8fcfc, #eefaf7); }
.lead-workbench-toolbar label { min-width: 0; display: grid; gap: 5px; }
.lead-workbench-toolbar label > span { color: var(--muted); font-size: 10px; font-weight: 850; letter-spacing: .03em; }
.lead-workbench-toolbar input, .lead-workbench-toolbar select { width: 100%; min-width: 0; min-height: 38px; padding: 8px 10px; border: 1px solid #c8dde0; border-radius: 10px; color: var(--ink); background: white; font-size: 12px; outline: 0; }
.lead-workbench-toolbar input:focus, .lead-workbench-toolbar select:focus { border-color: #31bba3; box-shadow: 0 0 0 3px rgba(43,201,133,.12); }
.lead-workbench-toolbar .lead-filter-clear { min-height: 38px; padding-inline: 12px; white-space: nowrap; }
.lead-phone-search-hint { color: #66848a; font-size: 9px; font-weight: 650; line-height: 1.35; }
.lead-workbench-summary { min-height: 32px; padding: 8px 3px 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 11px; }
.lead-workbench-summary strong { color: var(--ink); font-size: 12px; }
.lead-phone-search-feedback { margin-top: 6px; padding: 9px 11px; border: 1px solid #cce5e3; border-radius: 11px; background: #f3fbf9; color: #315f64; font-size: 11px; line-height: 1.45; }
.lead-phone-search-feedback[hidden] { display: none; }
.lead-phone-search-feedback.is-searching { border-color: #c7e3ed; background: #f1f9fc; color: #316676; }
.lead-phone-search-feedback.is-empty { border-color: #eadfc9; background: #fffaf0; color: #826231; }
.lead-phone-search-feedback.is-error { border-color: #efcfca; background: #fff5f3; color: #97483c; }
.lead-phone-search-feedback.is-suggestion { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.lead-phone-suggestion { min-height: 40px; appearance: none; padding: 7px 10px; border: 1px solid #9ed8cf; border-radius: 999px; background: white; color: #146b64; font: inherit; font-weight: 800; cursor: pointer; }
.lead-phone-suggestion:hover, .lead-phone-suggestion:focus-visible { border-color: #27aa97; box-shadow: 0 0 0 3px rgba(39,170,151,.12); outline: 0; }
.lead-scroll-region { display: contents; }
.mobile-workbench-fixed, .mobile-workbench-scroll { display: contents; }
.lead-heading-actions { display: flex; align-items: center; gap: 7px; }
.content[data-workspace="overview"] .lead-workbench-toolbar,
.content[data-workspace="overview"] .lead-workbench-summary,
.content[data-workspace="overview"] .lead-phone-search-feedback { display: none; }
.content[data-workspace="leads"] { height: 100dvh; max-height: 100dvh; overflow: hidden; }
.content[data-workspace="leads"] > .main-grid,
.content[data-workspace="leads"] #leads { height: 100%; min-height: 0; max-height: 100%; }
.content[data-workspace="leads"] #leads { display: flex; flex-direction: column; overflow: hidden; }
.content[data-workspace="leads"] #leads > .section-heading,
.content[data-workspace="leads"] #leads > .lead-workbench-toolbar,
.content[data-workspace="leads"] #leads > .lead-workbench-summary,
.content[data-workspace="leads"] #leads > .lead-phone-search-feedback { flex: 0 0 auto; }
.content[data-workspace="leads"] .lead-scroll-region { min-height: 0; flex: 1 1 auto; display: block; overflow: auto; overscroll-behavior: contain; scrollbar-gutter: stable; }
.content[data-workspace="leads"] .lead-scroll-region .table-wrap { margin-top: 2px; }
.content[data-workspace="leads"] .lead-scroll-region thead th { position: sticky; top: 0; z-index: 2; background: rgba(255,255,255,.98); box-shadow: inset 0 -1px #d9e8e9; }
.order-summary { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.order-summary span { padding: 8px 10px; border-radius: 10px; background: var(--mint-soft); color: var(--muted); font-size: 12px; }
.order-summary strong { margin-left: 4px; color: var(--forest); }
.order-workbench { padding: 0; overflow: hidden; border-color: #c9dfe2; }
.order-workbench-heading { min-height: 84px; padding: 18px 20px; border-bottom: 1px solid var(--line); background: linear-gradient(120deg, #fff 0 70%, #eaf9f6 100%); }
.order-heading-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.order-metric-grid { padding: 14px 18px; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 9px; background: #f4fafa; }
.order-metric-grid article { min-width: 0; padding: 13px 14px; display: grid; gap: 6px; border: 1px solid #d4e7e8; border-radius: 13px; background: white; box-shadow: 0 6px 16px rgba(4,77,97,.035); }
.order-metric-grid small { color: var(--muted); font-size: 10px; font-weight: 800; }
.order-metric-grid strong { overflow: hidden; color: #06465a; font-size: clamp(19px, 2vw, 28px); letter-spacing: -.04em; text-overflow: ellipsis; white-space: nowrap; }
.order-metric-grid span { color: #7c9297; font-size: 9px; }
.order-revenue-card { border-color: #aee2d4 !important; background: linear-gradient(145deg, #effcf7, #fff) !important; }
.order-workbench-toolbar { margin: 14px 18px 0; padding: 10px; display: grid; grid-template-columns: minmax(250px, 1.7fr) repeat(3, minmax(135px, .72fr)) auto; gap: 8px; align-items: end; border: 1px solid #cfe5e7; border-radius: 14px; background: linear-gradient(120deg, #f8fcfc, #eefaf7); }
.order-workbench-toolbar label { display: grid; gap: 5px; color: #60767b; font-size: 10px; font-weight: 850; }
.order-workbench-toolbar input, .order-workbench-toolbar select { min-height: 38px; padding: 8px 10px; border-color: #c8dde0; font-size: 12px; }
.order-filter-clear { min-height: 38px; }
.order-workbench-summary { margin: 10px 18px 0; padding: 9px 11px; display: flex; justify-content: space-between; gap: 12px; border-radius: 10px; color: #60767b; background: #edf7f6; font-size: 10px; }
.order-workbench-summary strong { color: #075c70; }
.order-table-wrap { padding: 8px 18px 18px; }
.order-number-button { padding: 0; border: 0; color: #087b9e; background: transparent; font: inherit; font-weight: 900; cursor: pointer; }
.order-number-button:hover { text-decoration: underline; }
.order-row-actions { display: flex; flex-wrap: wrap; gap: 5px; }
.order-customer-phone, .order-currency-code { margin-top: 3px; display: block; color: #849397; font-size: 9px; }
.stage-tag.order-paid, .stage-tag.order-fulfilled { color: #08755f; background: #e7f8ef; }
.stage-tag.order-cancelled, .stage-tag.order-refunded { color: #99443a; background: #fff0ed; }
.stage-tag.order-confirmed { color: #176d75; background: #e9f7f8; }
.order-editor-dialog, .order-detail-dialog { width: min(760px, calc(100vw - 30px)); }
.order-editor-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
.order-editor-dialog label { display: grid; gap: 5px; color: #53686c; font-size: 11px; font-weight: 800; }
.order-editor-note { margin: 0; padding: 10px 12px; border-radius: 11px; color: #566f73; background: #edf7f6; font-size: 10px; line-height: 1.55; }
.order-product-picker { margin: 13px 0; padding: 12px; border: 1px solid #c9e3df; border-radius: 14px; background: linear-gradient(135deg, #f6fcfb, #eaf9f4); }
.order-product-picker-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.order-product-picker-heading small, .order-product-picker-heading strong { display: block; }
.order-product-picker-heading small { color: #08728b; font-size: 9px; font-weight: 900; letter-spacing: .09em; text-transform: uppercase; }
.order-product-picker-heading strong { margin-top: 3px; color: #06465a; font-size: 12px; }
.order-product-picker-heading > span { color: #6c8589; font-size: 9px; }
.order-product-picker-controls { margin-top: 10px; display: grid; grid-template-columns: minmax(0, 1fr) 110px auto; gap: 8px; align-items: end; }
.order-product-picker-controls select, .order-product-picker-controls input { min-height: 38px; }
.order-product-picker-controls button { min-height: 38px; white-space: nowrap; }
.order-selected-products { margin-top: 10px; display: grid; gap: 6px; }
.order-selected-product { padding: 8px 9px; display: grid; grid-template-columns: minmax(0, 1fr) 72px 92px 70px minmax(100px, auto) 32px; gap: 8px; align-items: center; border: 1px solid #d3e7e5; border-radius: 10px; background: rgba(255,255,255,.88); }
.order-selected-product strong, .order-selected-product small { display: block; }
.order-selected-product strong { color: #073f51; font-size: 11px; }
.order-selected-product small { margin-top: 2px; color: #71888c; font-size: 8px; }
.order-selected-product label { gap: 2px; font-size: 8px; }
.order-selected-product input { min-height: 32px; padding: 5px 7px; font-size: 10px; }
.order-selected-product .order-line-total { color: #08728b; font-size: 10px; font-weight: 900; text-align: right; }
.order-selected-product .order-line-total small { color: #71888c; font-size: 7px; font-weight: 800; white-space: nowrap; }
.order-selected-product .icon-button { width: 32px; height: 32px; min-width: 32px; color: #9b3d32; }

.inventory-workbench { padding: 0; overflow: hidden; border-color: #c9dfe2; }
.inventory-workbench-heading { min-height: 88px; padding: 18px 20px; border-bottom: 1px solid var(--line); background: linear-gradient(120deg, #fff 0 68%, #e8faf5 100%); }
.inventory-workbench-heading .muted { max-width: 760px; margin-top: 5px; font-size: 9px; }
.inventory-heading-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.inventory-metric-grid { padding: 14px 18px; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 9px; background: #f4fafa; }
.inventory-metric-grid article { min-width: 0; padding: 12px 13px; display: grid; gap: 5px; border: 1px solid #d4e7e8; border-radius: 13px; background: white; }
.inventory-metric-grid small { color: var(--muted); font-size: 9px; font-weight: 850; }
.inventory-metric-grid strong { overflow: hidden; color: #06465a; font-size: clamp(18px, 2vw, 26px); letter-spacing: -.035em; text-overflow: ellipsis; white-space: nowrap; }
.inventory-metric-grid span { color: #7c9297; font-size: 8px; }
.inventory-warning-card { border-color: #ecd69c !important; background: #fffaf0 !important; }
.inventory-warning-card strong { color: #9c6816; }
.inventory-danger-card { border-color: #efc8c1 !important; background: #fff7f5 !important; }
.inventory-danger-card strong { color: #a94338; }
.inventory-sales-analysis { margin: 0 18px; padding: 13px; border: 1px solid #cae1e3; border-radius: 15px; background: linear-gradient(145deg, #fff, #f1faf8); }
.inventory-sales-heading { display: flex; align-items: end; justify-content: space-between; gap: 14px; }
.inventory-sales-heading h3 { margin: 2px 0 0; color: #063f50; font-size: 15px; }
.inventory-sales-heading label { min-width: 150px; display: grid; gap: 4px; color: #60767b; font-size: 8px; font-weight: 850; }
.inventory-sales-heading select { min-height: 36px; padding: 7px 32px 7px 10px; border: 1px solid #c8dde0; border-radius: 10px; color: #06465a; background: white; font-size: 10px; font-weight: 850; }
.inventory-sales-metrics { margin-top: 10px; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 7px; }
.inventory-sales-metrics article { min-width: 0; padding: 9px 10px; display: grid; gap: 4px; border: 1px solid #d5e6e7; border-radius: 11px; background: rgba(255,255,255,.94); }
.inventory-sales-metrics small { color: #667f84; font-size: 8px; font-weight: 850; }
.inventory-sales-metrics strong { overflow: hidden; color: #06465a; font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }
.inventory-sales-metrics span { color: #819397; font-size: 7px; line-height: 1.3; }
.inventory-discount-card { border-color: #efdcae !important; background: #fffaf1 !important; }
.inventory-discount-card strong, .inventory-discount-value { color: #a46a10; }
.inventory-profit-card { border-color: #bfe5d6 !important; background: #f1fbf6 !important; }
.inventory-profit-card strong, .inventory-positive-profit { color: #078265; }
.inventory-loss-card { border-color: #efcbc4 !important; background: #fff7f5 !important; }
.inventory-loss-card strong, .inventory-negative-profit { color: #ae4539; }
.inventory-sales-table-wrap { margin-top: 10px; }
.inventory-sales-table-wrap table { min-width: 980px; }
.inventory-sales-table-wrap th, .inventory-sales-table-wrap td { padding: 8px 9px; font-size: 9px; }
.inventory-sales-note { margin: 8px 2px 0; color: #71888c; font-size: 8px; line-height: 1.45; }
.inventory-toolbar { margin: 14px 18px 0; padding: 10px; display: grid; grid-template-columns: minmax(250px, 1.6fr) repeat(3, minmax(125px, .7fr)) auto; gap: 8px; align-items: end; border: 1px solid #cfe5e7; border-radius: 14px; background: linear-gradient(120deg, #f8fcfc, #eefaf7); }
.inventory-toolbar label { display: grid; gap: 5px; color: #60767b; font-size: 9px; font-weight: 850; }
.inventory-toolbar input, .inventory-toolbar select { min-width: 0; min-height: 38px; padding: 8px 10px; border: 1px solid #c8dde0; border-radius: 10px; color: var(--ink); background: white; font-size: 11px; }
.inventory-toolbar button { min-height: 38px; white-space: nowrap; }
.inventory-summary { margin: 10px 18px 0; padding: 9px 11px; display: flex; justify-content: space-between; gap: 12px; border-radius: 10px; color: #60767b; background: #edf7f6; font-size: 9px; }
.inventory-summary strong { color: #075c70; }
.inventory-content-grid { padding: 0 18px 18px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(265px, .34fr); gap: 14px; align-items: start; }
.inventory-table-wrap { min-width: 0; }
.inventory-table-wrap table { min-width: 920px; }
.inventory-product-name { display: grid; gap: 2px; }
.inventory-product-name strong { color: #06465a; font-size: 11px; }
.inventory-product-name small { color: #789095; font-size: 8px; }
.inventory-stock-value { color: #06465a; font-size: 12px; font-weight: 900; }
.inventory-stock-low { color: #a56c12; }
.inventory-stock-out { color: #a23c32; }
.inventory-discount-pill { display: inline-flex; min-width: 42px; justify-content: center; padding: 4px 7px; border-radius: 999px; color: #946215; background: #fff4d9; font-size: 9px; font-weight: 850; }
.inventory-row-actions { display: flex; gap: 5px; }
.inventory-ledger { margin-top: 17px; padding: 12px; border: 1px solid #d1e5e5; border-radius: 14px; background: #f7fbfb; }
.inventory-ledger-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.inventory-ledger-heading small, .inventory-ledger-heading strong { display: block; }
.inventory-ledger-heading small { color: #08728b; font-size: 8px; font-weight: 900; letter-spacing: .08em; }
.inventory-ledger-heading strong { margin-top: 3px; color: #06465a; font-size: 12px; }
.inventory-movement-list { max-height: 520px; margin-top: 10px; display: grid; gap: 7px; overflow: auto; }
.inventory-movement-item { padding: 8px 9px; border-radius: 10px; background: white; border: 1px solid #deebeb; }
.inventory-movement-item header { display: flex; justify-content: space-between; gap: 8px; }
.inventory-movement-item strong { color: #06465a; font-size: 9px; }
.inventory-movement-item b { font-size: 10px; }
.inventory-movement-item b.inbound { color: #0b8e69; }
.inventory-movement-item b.outbound { color: #b04437; }
.inventory-movement-item small { display: block; margin-top: 3px; color: #789095; font-size: 8px; line-height: 1.4; }
.product-editor-dialog, .inventory-movement-dialog { width: min(760px, calc(100vw - 30px)); }
.product-editor-grid, .inventory-movement-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.product-editor-dialog label, .inventory-movement-dialog label { display: grid; gap: 5px; color: #53686c; font-size: 10px; font-weight: 800; }
.product-active-toggle { align-self: end; min-height: 40px; padding: 9px 11px; border: 1px solid #d1e5e5; border-radius: 11px; background: #f5faf9; }
.inventory-movement-note { grid-column: 1 / -1; }
.inventory-current-stock { margin: 11px 0; padding: 9px 11px; border-radius: 10px; color: #075c70; background: #edf7f6; font-size: 10px; font-weight: 800; }
.order-detail-content { display: grid; gap: 12px; }
.order-detail-hero { padding: 15px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-radius: 14px; background: linear-gradient(135deg, #edf9f7, #f8fcfc); }
.order-detail-hero div { display: grid; gap: 4px; }.order-detail-hero small { color: var(--muted); font-size: 10px; }.order-detail-hero strong { color: #06465a; font-size: 28px; }
.order-detail-list { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }
.order-detail-list div { padding: 9px 0; display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px solid #edf1f1; font-size: 11px; }.order-detail-list dt { color: var(--muted); }.order-detail-list dd { margin: 0; max-width: 68%; overflow: hidden; font-weight: 800; text-align: right; text-overflow: ellipsis; white-space: nowrap; }
.order-detail-items { padding: 13px; border: 1px solid var(--line); border-radius: 13px; }.order-detail-items h3 { margin: 0 0 8px; font-size: 13px; }.order-detail-items > div { padding: 7px 0; display: flex; justify-content: space-between; gap: 12px; border-top: 1px solid #edf1f1; font-size: 11px; }
.order-print-sheet { display: none; }
table { width: 100%; border-collapse: collapse; }
th { padding: 10px 10px; color: #8a958d; border-bottom: 1px solid var(--line); font-size: 11px; letter-spacing: .07em; text-align: left; text-transform: uppercase; }
td { padding: 13px 10px; border-bottom: 1px solid #edf0ed; font-size: 13px; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
.customer-cell { display: flex; gap: 10px; align-items: center; }
.customer-chat-link { width: 100%; min-width: 0; padding: 5px 7px 5px 3px; border: 0; border-radius: 11px; color: inherit; background: transparent; text-align: left; cursor: pointer; transition: background .16s ease, box-shadow .16s ease; }
.customer-chat-link:hover, .customer-chat-link:focus-visible { outline: 0; background: #edf8f6; box-shadow: 0 0 0 2px rgba(18,169,143,.13); }
.customer-chat-link > span:nth-child(2) { min-width: 0; flex: 1; }
.customer-chat-link > i { flex: 0 0 auto; color: #159a88; font-size: 22px; font-style: normal; font-weight: 800; }
.customer-chat-link strong { transition: color .16s ease; }
@media (min-width: 601px) {
  .customer-chat-link { width: auto; padding: 0; border-radius: 0; background: transparent; box-shadow: none; }
  .customer-chat-link:hover, .customer-chat-link:focus-visible { background: transparent; box-shadow: none; }
  .customer-chat-link:hover strong, .customer-chat-link:focus-visible strong { color: #087b9e; }
  .customer-chat-link:focus-visible strong { text-decoration: underline; text-underline-offset: 3px; }
  .customer-chat-link > i { display: none; }
}
.avatar { width: 31px; height: 31px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 10px; color: var(--forest); background: #eef2ed; font-size: 12px; font-weight: 900; }
.customer-cell strong, .customer-cell small { display: block; }
.customer-cell small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.source-tag, .stage-tag { display: inline-flex; padding: 5px 8px; border-radius: 999px; background: #f0f3ef; color: #5e6a62; font-size: 11px; font-weight: 750; white-space: nowrap; }
.stage-qualified, .stage-appointment, .stage-proposal, .stage-won { color: var(--forest); background: var(--mint-soft); }
.score-cell { display: flex; gap: 7px; align-items: center; }
.score-ring { width: 33px; height: 33px; display: grid; place-items: center; border-radius: 50%; background: conic-gradient(var(--forest) calc(var(--score) * 1%), #e9ede9 0); position: relative; }
.score-ring::after { content: ""; position: absolute; inset: 4px; border-radius: 50%; background: white; }
.score-ring span { position: relative; z-index: 1; font-size: 10px; font-weight: 900; }
.loading-cell { padding: 34px; color: var(--muted); text-align: center; }

.funnel-list { margin-top: 20px; display: grid; gap: 12px; }
.funnel-row { display: grid; grid-template-columns: 68px 1fr 26px; gap: 9px; align-items: center; font-size: 12px; }
.funnel-row strong { font-size: 12px; text-align: right; }
.bar-track { height: 7px; overflow: hidden; border-radius: 999px; background: #edf1ed; }
.bar-fill { height: 100%; min-width: 4px; border-radius: inherit; background: var(--forest-2); }

.action-list { margin-top: 16px; display: grid; gap: 9px; }

@media (max-width: 1100px) {
  .campaign-policy-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .campaign-safety-banner { max-width: 100%; }
}

@media (max-width: 700px) {
  .content[data-workspace="campaigns"] #campaigns { padding: 12px; }
  .campaign-control-heading, .campaign-actions-heading, .campaign-toolbar { align-items: stretch; flex-direction: column; }
  .campaign-safety-banner { margin-top: 8px; }
  .campaign-heading-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .campaign-heading-actions .primary-button { grid-column: 1 / -1; }
  .campaign-platform-connections { grid-template-columns: 1fr; }
  .campaign-platform-connections article { padding: 8px 9px; }
  .campaign-control-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .campaign-policy-grid { grid-template-columns: 1fr; }
  .campaign-toolbar-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .campaign-toolbar-filters #campaign-search { grid-column: 1 / -1; }
  .campaign-toolbar-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .campaign-toolbar-actions span, .campaign-toolbar-actions small { grid-column: 1 / -1; }
  .campaign-actions-heading select { width: 100%; }
  .campaign-action-item { grid-template-columns: 28px minmax(0, 1fr); }
  .campaign-decision-buttons { grid-column: 2; max-width: none; width: 100%; justify-content: stretch; margin-top: 4px; }
  .campaign-decision-buttons .small-button { flex: 1 1 auto; min-height: 36px; }
}

@media (max-width: 980px) {
  .campaign-action-item { grid-template-columns: 28px minmax(0, 1fr); }
  .campaign-decision-buttons { grid-column: 2; max-width: none; width: 100%; justify-content: stretch; margin-top: 4px; }
  .campaign-decision-buttons .small-button { flex: 1 1 auto; min-height: 36px; }
}
.action-item { padding: 11px 12px; border: 1px solid #e7ece8; border-radius: 12px; background: #fafbf9; }
.action-item { display: grid; grid-template-columns: 28px 1fr; gap: 10px; }
.action-symbol { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 9px; color: var(--forest); background: var(--mint-soft); font-size: 13px; font-weight: 900; }
.action-item strong { display: block; font-size: 12px; }
.action-item p { margin: 4px 0 0; color: var(--muted); font-size: 11px; line-height: 1.45; }
.content[data-workspace="campaigns"] #campaigns { padding: 18px; }
.campaign-control-heading { align-items: flex-start; }
.campaign-control-heading .muted { margin: 5px 0 0; font-size: 12px; }
.campaign-heading-actions { display: flex; gap: 8px; }
.campaign-heading-actions button {
  position: relative;
  min-height: 40px;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  isolation: isolate;
  transform: translateZ(0);
  transition: transform .14s ease, box-shadow .18s ease, filter .18s ease, color .18s ease, background .18s ease;
}
.campaign-heading-actions button::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(115deg, transparent 15%, rgba(255,255,255,.42) 48%, transparent 78%);
  opacity: 0;
  transform: translateX(-105%);
  pointer-events: none;
}
.campaign-heading-actions button:hover { transform: translateY(-2px); filter: saturate(1.06); }
.campaign-heading-actions button:active,
.campaign-heading-actions button.is-action-active { transform: translateY(1px) scale(.97); box-shadow: inset 0 2px 7px rgba(3,70,84,.2); }
.campaign-heading-actions button.is-action-active::after { opacity: 1; animation: campaign-button-sheen .55s ease-out both; }
.campaign-heading-actions button.is-loading { cursor: progress; opacity: .9; }
.campaign-heading-actions button.is-loading::before {
  content: "";
  width: 13px;
  height: 13px;
  flex: 0 0 13px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: campaign-button-spin .7s linear infinite;
}
.campaign-heading-actions button.is-success { color: #075d4b; background: #dff8ed; box-shadow: 0 7px 18px rgba(8,137,101,.14); }
.campaign-heading-actions button.is-error { color: #9a332b; background: #fff0ee; box-shadow: 0 7px 18px rgba(170,61,50,.12); }
@keyframes campaign-button-spin { to { transform: rotate(360deg); } }
@keyframes campaign-button-sheen { to { transform: translateX(105%); } }
@media (prefers-reduced-motion: reduce) {
  button.is-click-feedback:not(:disabled),
  .campaign-heading-actions button,
  .campaign-heading-actions button::after { transition: none; animation: none !important; }
  .campaign-heading-actions button:hover,
  .campaign-heading-actions button:active,
  .campaign-heading-actions button.is-action-active { transform: none; }
}
.campaign-safety-banner { width: auto; max-width: min(100%, 480px); min-height: 34px; margin-top: 10px; padding: 6px 9px; display: inline-grid; grid-template-columns: 20px auto 16px; align-items: center; justify-content: start; gap: 6px; border-radius: 10px; font-family: inherit; font-size: 10px; text-align: left; cursor: pointer; box-shadow: 0 5px 14px rgba(6,64,74,.06); }
.campaign-safety-banner.safe-lock { color: #075f61; border: 1px solid #a5ded3; background: linear-gradient(110deg, #e9fbf7, #f4fcfb); }
.campaign-safety-banner.live-write { color: #7d4211; border: 1px solid #f1c27a; background: #fff7e8; }
.campaign-safety-banner i { width: 20px; height: 20px; display: grid; place-items: center; border-radius: 7px; background: rgba(255,255,255,.72); font-size: 11px; font-style: normal; }
.campaign-safety-banner strong { font-size: 11px; white-space: nowrap; }
.campaign-safety-banner b { opacity: .68; font-size: 12px; transition: transform .18s ease; }
.campaign-safety-banner span, .campaign-safety-banner small { display: none; grid-column: 1 / -1; opacity: .78; line-height: 1.45; }
.campaign-safety-banner[aria-expanded="true"] { grid-template-columns: 20px minmax(0, 1fr) 16px; }
.campaign-safety-banner[aria-expanded="true"] span, .campaign-safety-banner[aria-expanded="true"] small { display: block; }
.campaign-safety-banner[aria-expanded="true"] b { transform: rotate(180deg); }
.campaign-control-summary { margin-top: 12px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; }
.campaign-platform-connections { margin-top: 10px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.campaign-platform-connections article { min-width: 0; padding: 9px 11px; display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; align-items: center; gap: 9px; border: 1px solid #d7e8e8; border-radius: 12px; background: rgba(248,252,252,.86); }
.campaign-platform-connections article.ready { border-color: #bde4d8; background: #f1fbf7; }
.campaign-platform-connections article.waiting { border-color: #eadbb8; background: #fffaf0; }
.campaign-platform-connections article.error { border-color: #efc4bf; background: #fff5f3; }
.campaign-platform-connections div { min-width: 0; display: grid; gap: 2px; }
.campaign-platform-connections strong { font-size: 11px; }
.campaign-platform-connections small { color: var(--muted); font-size: 9px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.campaign-platform-connections b { padding: 3px 7px; border-radius: 99px; font-size: 9px; white-space: nowrap; }
.campaign-platform-connections .tiktok-connection-actions { display: flex; align-items: center; justify-content: flex-end; gap: 5px; }
.campaign-platform-connections .tiktok-connection-actions button { min-height: 25px; padding: 3px 7px; border-radius: 8px; font-size: 9px; white-space: nowrap; }
.campaign-platform-connections .status-ready { color: #08765c; background: #dcf6ec; }
.campaign-platform-connections .status-waiting { color: #8a5700; background: #fff0cf; }
.campaign-platform-connections .status-error { color: #9d3027; background: #fde6e3; }
.platform-mark { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px; color: white; font-size: 13px; font-weight: 900; }
.platform-mark.meta { background: #1778f2; }
.platform-mark.tiktok { background: linear-gradient(135deg, #111 45%, #25f4ee 46%, #fe2c55); }
.tiktok-sync-button { border-color: #bee7e5; }
.campaign-control-summary article { padding: 12px 13px; border: 1px solid #d8e7e7; border-radius: 13px; background: linear-gradient(150deg, #fff, #f6fbfb); }
.campaign-control-summary span, .campaign-control-summary strong { display: block; }
.campaign-control-summary span { color: var(--muted); font-size: 10px; font-weight: 800; }
.campaign-control-summary strong { margin-top: 6px; color: #063e4c; font-size: 22px; letter-spacing: -.03em; }
.campaign-policy-form { margin-top: 12px; padding: 13px; border: 1px solid #d8e7e7; border-radius: 14px; background: #fbfdfd; }
.campaign-policy-title, .campaign-actions-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.campaign-policy-title > div, .campaign-actions-heading > div { display: grid; gap: 3px; }
.campaign-policy-title small, .campaign-actions-heading small { color: var(--muted); font-size: 10px; }
.campaign-policy-grid { margin-top: 10px; display: grid; grid-template-columns: 1.15fr repeat(4, minmax(105px, 1fr)) auto; gap: 8px; align-items: end; }
.campaign-policy-grid label { display: grid; gap: 5px; color: var(--muted); font-size: 10px; font-weight: 800; }
.campaign-policy-grid input, .campaign-policy-grid select { min-width: 0; }
.campaign-toolbar { margin-top: 13px; display: grid; gap: 8px; }
.campaign-toolbar-filters { display: grid; grid-template-columns: 125px 125px minmax(220px, 1fr) auto; gap: 7px; }
.campaign-toolbar-actions { display: flex; align-items: center; justify-content: flex-end; gap: 7px; flex-wrap: wrap; }
.campaign-toolbar-actions span, .campaign-toolbar-actions small { color: var(--muted); font-size: 10px; white-space: nowrap; }
.campaign-toolbar-actions span { margin-right: auto; font-size: 11px; }
.campaign-anomaly-toggle[aria-pressed="true"] { color: #8a3a2f; border-color: #e6b1a9; background: #fff0ed; box-shadow: inset 0 0 0 1px rgba(176,62,45,.08); }
.campaign-table-wrap { margin-top: 8px; max-height: 420px; }
.campaign-table-wrap td:first-child strong, .campaign-table-wrap td:first-child small { display: block; }
.campaign-table-wrap td:first-child small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.campaign-row-abnormal { background: linear-gradient(90deg, rgba(255,242,235,.76), rgba(255,255,255,0) 46%); }
.campaign-health { margin-left: 5px; padding: 2px 5px; display: inline-flex; border-radius: 999px; font-size: 8px; font-style: normal; font-weight: 850; vertical-align: middle; }
.campaign-health.healthy { color: #08765c; background: #dcf6ec; }
.campaign-health.abnormal { color: #9d3e34; background: #fde8e4; }
.campaign-row-controls { display: grid; grid-template-columns: repeat(2, minmax(45px, 1fr)); gap: 4px; min-width: 118px; }
.campaign-row-controls button { padding: 5px 6px; border: 1px solid #cfe2e2; border-radius: 7px; color: #0a6471; background: #f1f9f8; font-size: 9px; font-weight: 800; }
.campaign-actions-heading { margin-top: 16px; padding-top: 13px; border-top: 1px solid #dbe8e7; }
.campaign-actions-heading select { width: 170px; }
.campaign-action-item { grid-template-columns: 28px minmax(0, 1fr) auto; align-items: start; }
.campaign-action-copy { min-width: 0; }
.campaign-action-copy > div { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.campaign-action-copy strong { min-width: 0; overflow-wrap: anywhere; }
.campaign-action-copy p { overflow-wrap: anywhere; }
.campaign-action-copy small { color: #72817d; font-size: 9px; overflow-wrap: anywhere; }
.campaign-decision-buttons { display: flex; flex-wrap: wrap; gap: 5px; justify-content: flex-end; max-width: 180px; }
.campaign-decision-buttons .small-button { white-space: normal; line-height: 1.2; text-align: center; }
.campaign-action-status { padding: 3px 6px; border-radius: 99px; color: #54625f; background: #e9efed; font-size: 9px; font-weight: 800; }
.campaign-action-status.status-pending { color: #8a5700; background: #fff0cf; }
.campaign-action-status.status-applied { color: #08765c; background: #dcf6ec; }
.campaign-action-status.status-apply_failed { color: #9d3027; background: #fde6e3; }
.campaign-action-status.status-needs_configuration { color: #6a3b9d; background: #f0e8fb; }
.campaign-action-status.status-superseded { color: #375f69; background: #e4f1f2; }
.campaign-action-status.status-verified_no_change { color: #08765c; background: #e2f5eb; }
.campaign-action-status.status-outcome_unknown { color: #8a5700; background: #fff0cf; }
.campaign-decision-buttons { display: flex; gap: 5px; }
.campaign-decision-buttons .approve { color: white; background: #087c72; }
.campaign-action-diagnostic { margin-top: 6px; display: grid; gap: 3px; }
.campaign-action-diagnostic strong { color: #713e91; font-size: 10px; }
.campaign-action-diagnostic span { color: #6d7774; font-size: 9px; line-height: 1.55; }
.campaign-repair-button { color: #fff !important; border-color: transparent !important; background: linear-gradient(135deg, #7550b8, #9a64cc) !important; }
.campaign-action-repair-dialog { width: min(700px, calc(100vw - 28px)); }
.campaign-action-repair-dialog form { display: grid; gap: 13px; }
.campaign-repair-summary { margin: 0; padding: 11px 13px; border-radius: 12px; color: #345b63; background: #eef7f7; font-size: 11px; line-height: 1.55; }
.campaign-repair-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.campaign-repair-fields label { display: grid; gap: 6px; color: #506a70; font-size: 10px; font-weight: 800; }
.campaign-repair-fields label:first-child { grid-column: 1 / -1; }
.campaign-repair-safety { padding: 12px 13px; display: grid; gap: 3px; border: 1px solid #d8e9e7; border-radius: 13px; background: #f9fcfb; }
.campaign-repair-safety strong { color: #0b615a; font-size: 10px; }
.campaign-repair-safety span { color: #64716e; font-size: 9px; line-height: 1.55; }
@media (max-width: 680px) {
  .campaign-repair-fields { grid-template-columns: 1fr; }
}
.direction { color: var(--forest-2); }
.direction.outbound { color: var(--blue); }
.reply-source { display: inline-flex; align-items: center; margin-left: 5px; padding: 1px 6px; border-radius: 999px; font-size: .72em; font-style: normal; font-weight: 700; line-height: 1.45; }
.reply-source.human { color: #08624f; background: #dff5ea; }
.reply-source.automatic { color: #17647b; background: #e2f3f7; }
.channel-badge { display: inline-flex; align-items: center; width: max-content; padding: 2px 6px; border-radius: 999px; color: #fff !important; background: #667085; font-size: 9px !important; font-weight: 850; letter-spacing: .02em; vertical-align: middle; }
.channel-whatsapp { background: #128c5e; }
.channel-instagram { background: linear-gradient(120deg, #833ab4, #e1306c, #f77737); }
.channel-facebook { background: #1877f2; }
.channel-threads { background: #161616; }
.muted { color: var(--muted); font-size: 12px; line-height: 1.6; }
.lead-owner-cell { min-width: 100px; display: grid; gap: 3px; }
.lead-owner-cell strong { color: #0a5364; font-size: 11px; }
.lead-owner-cell small { color: var(--muted); font-size: 9px; }
.lead-owner-change { min-width: 102px; white-space: nowrap; }
.lead-row-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.customer-delete-dialog { width: min(560px, calc(100vw - 28px)); padding: 0; border: 0; border-radius: 22px; box-shadow: 0 28px 90px rgba(1, 50, 66, .28); }
.customer-delete-dialog form { padding: 22px; display: grid; gap: 15px; }
.customer-delete-target { padding: 14px 16px; display: grid; gap: 4px; border: 1px solid #cfe3e4; border-radius: 15px; background: #f7fbfb; }
.customer-delete-target span, .customer-delete-target small { color: var(--muted); font-size: 10px; }
.customer-delete-target strong { color: #083f50; font-size: 17px; }
.customer-delete-warning { padding: 13px 15px; border: 1px solid #edc8c1; border-radius: 13px; color: #81372f; background: #fff6f3; font-size: 11px; line-height: 1.65; }

.content[data-workspace="inbox"] #inbox.inbox-panel { height: 100%; min-height: 0; padding: 0; display: flex; flex-direction: column; overflow: hidden; border-color: #c9dfe2; background: #fff; box-shadow: 0 18px 44px rgba(4,77,97,.08); }
.inbox-panel > .section-heading { min-height: 58px; padding: 6px 16px; border-bottom: 1px solid var(--line); background: linear-gradient(120deg, #fff 0 72%, #edf9f7 100%); }
.inbox-panel > .section-heading h2 { margin: 0; font-size: 18px; }
.inbox-filters, .chat-controls, .reply-actions { display: flex; align-items: center; gap: 8px; }
.inbox-filters { padding: 4px; border: 1px solid var(--line); border-radius: 13px; background: rgba(255,255,255,.86); }
.inbox-search-input { width: clamp(190px, 23vw, 310px); min-height: 36px; padding: 8px 11px; border: 0; border-radius: 10px; background: #f4faf9; font-size: 12px; color: var(--ink); }
.inbox-search-input::placeholder { color: #789094; }
.inbox-search-input:focus { outline: 2px solid rgba(15, 160, 151, .28); outline-offset: 0; background: #fff; }
.inbox-filters select { min-height: 36px; border: 0; background-color: transparent; font-size: 12px; }
.inbox-filters .small-button { min-height: 36px; padding-inline: 12px; background: #eaf7f5; }
.inbox-filters select, .chat-controls input, .chat-controls select { width: auto; min-width: 105px; padding: 8px 9px; }
.inbox-panel > .section-heading { flex: 0 0 auto; }
.inbox-layout { flex: 1 1 0; height: 0; min-height: 0; margin-top: 0; display: grid; grid-template-columns: 250px minmax(560px, 1fr) 280px; overflow: hidden; border: 0; border-radius: 0; background: #f7fbfb; }
.inbox-layout > * { min-height: 0; }
.conversation-list { height: 100%; min-height: 0; max-height: none; overflow-x: hidden; overflow-y: auto; overscroll-behavior-y: contain; border-right: 1px solid var(--line); background: #fbfdfd; scrollbar-gutter: stable; scrollbar-width: thin; scrollbar-color: #86b9c1 transparent; -webkit-overflow-scrolling: touch; }
.conversation-list-head, .customer-context-head { position: sticky; top: 0; z-index: 2; min-height: 62px; padding: 13px 15px; display: flex; align-items: center; justify-content: space-between; gap: 10px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.94); backdrop-filter: blur(12px); }
.conversation-list-head strong, .conversation-list-head small, .customer-context-head strong, .customer-context-head small { display: block; }
.conversation-list-head strong, .customer-context-head strong { font-size: 13px; }
.conversation-list-head small, .customer-context-head small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.conversation-list-head > span, .customer-context-head > span { min-width: 28px; height: 28px; padding: 0 8px; display: grid; place-items: center; border-radius: 9px; color: #08755f; background: var(--mint-soft); font-size: 11px; font-weight: 900; }
.conversation-item { position: relative; width: 100%; padding: 14px 13px; display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 10px; border: 0; border-bottom: 1px solid #e7efef; color: inherit; background: transparent; text-align: left; cursor: pointer; transition: background .18s ease, box-shadow .18s ease; }
.conversation-item::before { content: ""; position: absolute; inset: 7px auto 7px 0; width: 3px; border-radius: 0 4px 4px 0; background: transparent; transition: background .18s ease, width .18s ease; }
.conversation-item:hover { background: #f3f9f8; }
.conversation-item.awaiting-reply { background: linear-gradient(105deg, #fff3f1, #fffaf9); box-shadow: inset 0 0 0 1px rgba(217,102,87,.14); }
.conversation-item.awaiting-reply::before { width: 4px; background: #e27668; }
.conversation-item.awaiting-reply:hover { background: linear-gradient(105deg, #ffeae6, #fff6f4); }
.conversation-item.human-required { background: linear-gradient(105deg, #fff8ec, #fffdf8); box-shadow: inset 0 0 0 1px rgba(197,141,45,.11); }
.conversation-item.human-required::before { width: 4px; background: #c99338; }
.conversation-item.human-required:hover { background: linear-gradient(105deg, #fff1d8, #fff9ef); }
.conversation-item.replied { background: linear-gradient(105deg, #edf9f5, #f9fcfb); box-shadow: inset 0 0 0 1px rgba(29,157,121,.08); }
.conversation-item.replied::before { width: 3px; background: #28a984; }
.conversation-item.replied:hover { background: linear-gradient(105deg, #e5f6f0, #f4faf7); }
.conversation-item.manually-handled { background: linear-gradient(105deg, #f1f5f7, #fafcfd); box-shadow: inset 0 0 0 1px rgba(89,128,143,.1); }
.conversation-item.manually-handled::before { width: 4px; background: #6c93a1; }
.conversation-item.manually-handled:hover { background: linear-gradient(105deg, #e8f0f3, #f5f9fa); }
.conversation-item.delivery-failed { background: linear-gradient(105deg, #fff0ee, #fff9f8); box-shadow: inset 0 0 0 1px rgba(180,61,47,.15); }
.conversation-item.delivery-failed::before { width: 4px; background: #b94b40; }
.conversation-item.delivery-failed:hover { background: linear-gradient(105deg, #ffe7e3, #fff4f2); }
.conversation-item.active { z-index: 1; box-shadow: inset 0 0 0 2px rgba(5,105,124,.48), 0 7px 18px rgba(5,76,91,.08); }
.conversation-item:focus-visible { z-index: 2; outline: 2px solid #087b9e; outline-offset: -3px; }
.conversation-avatar { width: 40px; height: 40px; display: grid; place-items: center; border: 1px solid #dceaea; border-radius: 12px; color: #08627a; background: linear-gradient(145deg, #f1f8f8, #e3f0f0); font-size: 12px; font-weight: 900; }
.conversation-copy { min-width: 0; display: grid; gap: 3px; }
.conversation-copy strong, .conversation-copy small, .conversation-copy time, .conversation-copy em { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conversation-copy strong { display: flex; align-items: center; gap: 5px; font-size: 12px; }.conversation-copy small { color: #607a82; font-size: 11px; }.conversation-copy em { display: flex; align-items: center; gap: 5px; color: #86999e; font-size: 10px; font-style: normal; }
.conversation-received-time { display: block; color: #087b72; font-size: 9px; font-style: normal; font-weight: 800; letter-spacing: .01em; }
.reply-state { flex: 0 0 auto; padding: 2px 5px; border-radius: 999px; font-size: 9px; font-weight: 900; line-height: 1.25; }
.reply-state.awaiting-reply { color: #a3473c; background: #ffe3de; }
.reply-state.human-required { color: #79500a; background: #ffedbd; }
.reply-state.replied { color: #08755f; background: #dff5e9; }
.reply-state.manually-handled { color: #376b78; background: #e1eef2; }
.reply-state.delivery-failed { color: #9f3025; background: #ffe1dc; }
.unread-badge { min-width: 21px; height: 21px; padding: 0 6px; display: grid; place-items: center; border-radius: 999px; color: white; background: linear-gradient(135deg, #087b9e, #20b879); box-shadow: 0 4px 10px rgba(7,123,158,.2); font-size: 10px; }
.inbox-empty { padding: 20px; }
.chat-pane { min-width: 0; min-height: 0; display: flex; flex-direction: column; overflow: hidden; background: #f3f8f8; container-name: conversation-pane; container-type: inline-size; }
.chat-empty { min-height: 520px; display: grid; place-items: center; padding: 30px; color: var(--muted); font-size: 13px; text-align: center; }
.chat-active { height: 100%; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.chat-header { min-height: 64px; padding: 10px 12px; display: grid; grid-template-columns: minmax(150px, .75fr) minmax(330px, 1.25fr); align-items: center; gap: 10px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.96); }
.chat-header strong, .chat-header small { display: block; }.chat-header strong { font-size: 15px; }.chat-header small { margin-top: 4px; color: var(--muted); font-size: 10px; line-height: 1.4; }
.chat-identity { min-width: 0; display: flex; align-items: center; gap: 9px; }
.chat-identity > span { min-width: 0; flex: 1 1 auto; }
.chat-identity > span > strong, .chat-identity > span > small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-back-button { display: none; width: 38px; height: 38px; flex: 0 0 auto; border: 1px solid var(--line); border-radius: 12px; color: #07566d; background: #eef8f7; font-size: 28px; line-height: 1; cursor: pointer; }
.mobile-customer-profile-button, .mobile-context-close { display: none; }
.chat-controls { --chat-control-height: 40px; min-width: 0; width: 100%; display: flex; align-items: stretch; gap: 6px; }
.chat-controls #customer-voice-call,
.chat-controls #customer-reengage:not(.hidden) { min-width: 0; height: var(--chat-control-height); min-height: var(--chat-control-height); flex: 0 0 auto; padding-inline: 8px; align-self: stretch; white-space: nowrap; }
.chat-controls .chat-assignment-control { min-width: 150px; flex: 1 1 170px; }
.chat-assignment-control { min-width: 0; height: var(--chat-control-height, 40px); padding: 3px 4px 3px 9px; display: grid; grid-template-columns: minmax(0,1fr) auto; grid-template-rows: auto auto; align-items: center; column-gap: 6px; row-gap: 0; border: 1px solid var(--line); border-radius: 12px; background: #f8fcfb; }
.chat-assignment-control > span { grid-column: 1; grid-row: 1; min-width: 0; overflow: hidden; color: var(--muted); font-size: 8px; font-weight: 800; line-height: 1.1; text-overflow: ellipsis; white-space: nowrap; }
.chat-assignment-control > strong { grid-column: 1; grid-row: 2; min-width: 0; overflow: hidden; color: #064b5d; font-size: 11px; line-height: 1.15; text-overflow: ellipsis; white-space: nowrap; }
.chat-assignment-control .small-button { grid-column: 2; grid-row: 1 / 3; align-self: stretch; min-height: 0; padding: 4px 9px; white-space: nowrap; }
.chat-controls :is(button, .chat-assignment-control):focus-visible { outline: 2px solid #087b9e; outline-offset: 2px; }
.manual-handling-bar { width: max-content; max-width: calc(100% - 32px); margin: 6px 16px 0 auto; padding: 0; display: flex; align-items: center; justify-content: flex-end; border: 0; border-radius: 0; color: inherit; background: transparent; box-shadow: none; }
.manual-handling-bar .small-button { flex: 0 0 auto; min-height: 30px; padding: 5px 9px; color: #fff; border-color: #fff; background: linear-gradient(115deg,#087b9e,#14a9af 62%,#2bc985); box-shadow: 0 7px 18px rgba(7,110,137,.15); font-size: 9px; white-space: nowrap; }
.manual-handled-summary { margin: 6px 16px 0; padding: 7px 9px; display: flex; align-items: center; justify-content: flex-start; gap: 8px; border: 1px solid #b9d8df; border-radius: 11px; color: #17677a; background: linear-gradient(135deg,#eef8fa,#e5f2f5); }
.manual-handled-summary > div { min-width: 0; display: grid; gap: 2px; }
.manual-handled-summary strong { font-size: 10px; }
.manual-handled-summary small { color: #52737b; font-size: 8px; line-height: 1.3; overflow-wrap: anywhere; }
.manual-handled-summary > span { width: 26px; height: 26px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 999px; color: #fff; background: #4a899a; font-size: 13px; font-weight: 900; }
.opt-out-conversation-notice { margin: 5px 16px 0; padding: 6px 9px; display: flex; align-items: center; gap: 8px; border: 1px solid #e6c99f; border-radius: 10px; color: #795020; background: linear-gradient(135deg,#fff9ee,#fff3df); }
.opt-out-conversation-notice > span { width: 23px; height: 23px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 999px; color: #fff; background: #bd7b2b; font-size: 12px; font-weight: 900; }
.opt-out-conversation-notice > div { min-width: 0; display: grid; grid-template-columns: auto minmax(0,1fr); align-items: baseline; gap: 3px 8px; }
.opt-out-conversation-notice strong { font-size: 9px; white-space: nowrap; }
.opt-out-conversation-notice small { color: #795f3f; font-size: 8px; line-height: 1.35; overflow-wrap: anywhere; }
.opt-out-conversation-notice.service-reply-open { border-color: #b9ded2; color: #116a5b; background: linear-gradient(135deg,#effaf6,#e6f6f0); }
.opt-out-conversation-notice.service-reply-open > span { background: #168b73; }
.opt-out-conversation-notice.service-reply-open small { color: #426f66; }
.assignment-dialog { width: min(680px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); padding: 0; overflow-y: auto; border: 1px solid #cce1e1; border-radius: 20px; background: #fff; box-shadow: 0 24px 80px rgba(3,54,68,.24); }
.assignment-dialog::backdrop { background: rgba(3,34,44,.48); backdrop-filter: blur(4px); }
.assignment-dialog form { padding: 22px; display: grid; gap: 15px; }
.assignment-dialog label { display: grid; gap: 7px; color: #405b62; font-size: 11px; font-weight: 850; }
.assignment-dialog select, .assignment-dialog textarea { width: 100%; }
.assignment-customer, .assignment-preview { padding: 13px 15px; display: grid; gap: 4px; border: 1px solid #d8e9e7; border-radius: 14px; background: linear-gradient(135deg,#f4fbfa,#edf8f6); }
.assignment-preview { border-color: #cde7df; background: linear-gradient(135deg,#eefaf6,#e5f6f1); }
.assignment-customer span, .assignment-customer small, .assignment-preview span, .assignment-preview small { color: var(--muted); font-size: 10px; }
.assignment-customer strong, .assignment-preview strong { color: #063f4d; font-size: 15px; }
.assignment-account-compare { display: grid; grid-template-columns: 1fr 28px 1fr; align-items: stretch; gap: 8px; }
.assignment-account-compare article { min-width: 0; padding: 12px 13px; display: grid; gap: 4px; border: 1px solid #dce9e8; border-radius: 13px; background: #fbfdfd; }
.assignment-account-compare article span, .assignment-account-compare article small { overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.assignment-account-compare article strong { overflow: hidden; color: #0a5364; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.assignment-account-compare > i { display: grid; place-items: center; color: #18a786; font-size: 18px; font-style: normal; font-weight: 900; }
.assignment-reasons { margin: 0; padding: 8px 10px 10px; display: flex; gap: 6px; flex-wrap: wrap; border: 1px solid #dce9e8; border-radius: 12px; }
.assignment-reasons legend { padding: 0 5px; color: var(--muted); font-size: 9px; font-weight: 850; }
.assignment-reasons button { padding: 6px 9px; border: 1px solid #cee2df; border-radius: 999px; color: #27606a; background: #f4faf9; font-size: 9px; font-weight: 800; cursor: pointer; }
.assignment-reasons button.active { color: #fff; border-color: #098972; background: #098972; }
.assignment-scope { padding: 10px 12px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; border: 1px solid #dceae8; border-radius: 11px; background: #f8fbfb; }
.assignment-scope strong { margin-right: 3px; color: #31565e; font-size: 9px; }
.assignment-scope span { padding: 4px 7px; border-radius: 999px; color: #08715f; background: #e4f5f0; font-size: 8px; font-weight: 800; }
.assignment-confirm { padding: 11px 12px; grid-template-columns: auto 1fr !important; align-items: center; border: 1px solid #cfe4e0; border-radius: 11px; background: #f2faf7; }
.assignment-confirm input { width: 16px; height: 16px; }
.assignment-confirm span { color: #265b61; font-size: 10px; line-height: 1.45; }
.assignment-note { margin: 0; padding: 10px 12px; border-radius: 10px; color: #557078; background: #f4f8f8; font-size: 10px; line-height: 1.55; }
.manual-handle-dialog { width: min(560px, calc(100vw - 24px)); }
.manual-handle-safety { padding: 12px 14px; display: grid; gap: 5px; border: 1px solid #cfe4df; border-radius: 12px; color: #366169; background: #f1faf7; }
.manual-handle-safety strong { font-size: 11px; }
.manual-handle-safety span { font-size: 9px; line-height: 1.5; }
.assignment-history { display: grid; gap: 8px; }
.assignment-history > div:first-child { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.assignment-history > div:first-child strong { color: #234c56; font-size: 11px; }
.assignment-history > div:first-child small { color: var(--muted); font-size: 9px; }
#assignment-history-list { max-height: 150px; display: grid; gap: 6px; overflow-y: auto; }
#assignment-history-list article { padding: 9px 11px; border: 1px solid #e0eceb; border-radius: 10px; background: #fafdfd; }
#assignment-history-list article > div { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
#assignment-history-list article strong { color: #164956; font-size: 10px; }
#assignment-history-list article span, #assignment-history-list article small { color: var(--muted); font-size: 9px; }
#assignment-history-list article small { display: block; margin-top: 4px; }
@media (max-width: 620px) { .assignment-account-compare { grid-template-columns: 1fr; }.assignment-account-compare > i { transform: rotate(90deg); }.assignment-dialog form { padding: 16px; } }
.chat-messages { flex: 1 1 0; height: 0; min-height: 0; padding: 24px clamp(18px, 3vw, 34px); display: flex; flex-direction: column; gap: 13px; overflow-x: hidden; overflow-y: auto; overscroll-behavior-y: contain; background: radial-gradient(circle at 16px 16px, rgba(8,123,158,.035) 1px, transparent 1.5px) 0 0 / 32px 32px, linear-gradient(180deg,#f7fbfb,#f1f7f6); scrollbar-gutter: stable; scrollbar-width: thin; scrollbar-color: #86b9c1 transparent; -webkit-overflow-scrolling: touch; }
.chat-image-frame { width: min(310px, 68vw); min-height: 120px; margin: 0 0 7px; padding: 0; display: grid; place-items: center; overflow: hidden; border: 1px solid rgba(16,57,35,.12); border-radius: 13px; color: var(--muted); background: rgba(255,255,255,.7); cursor: zoom-in; }
.chat-image-frame img { width: 100%; max-height: 360px; display: block; object-fit: contain; background: #edf2ed; }
.chat-image-frame.media-error { min-height: 82px; padding: 14px; cursor: default; }
.chat-media-loading, .chat-image-frame.media-error span { font-size: 11px; font-weight: 750; }
.chat-media-card { width: min(360px, 68vw); min-height: 54px; margin: 0 0 7px; padding: 10px 12px; display: grid; align-items: center; overflow: visible; border: 1px solid rgba(8,123,158,.16); border-radius: 13px; color: var(--muted); background: rgba(255,255,255,.82); box-sizing: border-box; }
.chat-media-card.chat-media-audio { width: 100%; max-width: min(360px, 100%); overflow: visible; }
.chat-audio-shell { width: 100%; max-width: 100%; min-width: 0; box-sizing: border-box; display: grid; grid-template-columns: minmax(0, 1fr) 46px; gap: 8px; align-items: center; }
.chat-audio-player { width: 100%; min-width: 0; max-width: 100%; height: 42px; display: block; }
.chat-audio-speed { width: 46px; min-width: 46px; height: 34px; padding: 0; flex: 0 0 46px; justify-self: stretch; border: 1px solid rgba(8,123,158,.22); border-radius: 999px; color: #0a5f73; background: linear-gradient(180deg, #ffffff, #eef8f8); font-size: 12px; font-weight: 850; letter-spacing: -.02em; cursor: pointer; user-select: none; -webkit-tap-highlight-color: transparent; white-space: nowrap; }
.chat-audio-speed:hover { border-color: rgba(8,123,158,.4); background: #e7f5f5; }
.chat-audio-speed:active { transform: translateY(1px); }
.chat-bubble:has(.chat-audio-shell) { overflow: visible; }
.chat-video-player { width: min(430px, 68vw); max-height: 440px; display: block; border-radius: 10px; background: #071a20; object-fit: contain; }
.chat-document-link { min-height: 36px; display: flex; align-items: center; gap: 8px; color: #087b9e; font-size: 11px; font-weight: 800; text-decoration: none; overflow-wrap: anywhere; }
.chat-document-link::before { content: "↗"; width: 28px; height: 28px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 9px; color: white; background: linear-gradient(145deg,#087b9e,#13ad86); }
.chat-media-card.media-error, .chat-image-frame.media-error { min-height: 72px; grid-template-columns: minmax(0, 1fr) auto; gap: 9px; color: #963e33; background: #fff3f1; }
.media-error-copy { min-width: 0; font-size: 10px; font-weight: 750; line-height: 1.45; overflow-wrap: anywhere; }
.media-retry-button, .media-retry-label { min-height: 36px; padding: 7px 10px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid #e1aca5; border-radius: 9px; color: #8d3b32; background: #fff; font-size: 10px; font-weight: 850; white-space: nowrap; cursor: pointer; }
.chat-image-frame.media-retry-frame { cursor: pointer; }
.chat-image-frame.media-retry-frame:hover .media-retry-label, .media-retry-button:hover { border-color: #cc877d; background: #fff9f8; }
@media (max-width: 860px) {
  .media-retry-button, .media-retry-label { min-height: 44px; }
  .chat-audio-shell { width: 100%; max-width: 100%; gap: 6px; grid-template-columns: minmax(0, 1fr) 42px; }
  .chat-audio-player { height: 40px; }
  .chat-audio-speed { width: 42px; min-width: 42px; height: 32px; font-size: 11px; }
}
.image-viewer { width: min(1100px, calc(100vw - 28px)); max-width: none; max-height: calc(100vh - 28px); padding: 44px 14px 14px; overflow: auto; border-radius: 16px; background: #111a14; }
.image-viewer::backdrop { background: rgba(4,12,7,.82); backdrop-filter: blur(6px); }
.image-viewer img { width: auto; max-width: 100%; max-height: calc(100vh - 110px); margin: auto; display: block; object-fit: contain; }
.image-viewer p { margin: 10px 10px 0; color: white; font-size: 13px; line-height: 1.5; text-align: center; }
.image-viewer-close { position: absolute; top: 8px; right: 10px; width: 32px; height: 32px; border: 1px solid rgba(255,255,255,.25); border-radius: 999px; color: white; background: rgba(255,255,255,.1); font-size: 24px; cursor: pointer; }
.chat-bubble { max-width: 80%; padding: 14px 16px; border: 1px solid #e1ecec; border-radius: 18px 18px 18px 6px; background: white; box-shadow: 0 5px 16px rgba(4,77,97,.055); }
.chat-bubble.outbound { align-self: flex-end; border-color: #c4e9db; border-radius: 16px 16px 5px; background: linear-gradient(145deg, #e5f8ef, #d9f2e8); }
.chat-bubble p { margin: 0; font-size: 14px; line-height: 1.65; white-space: pre-wrap; }
.chat-bubble footer { margin-top: 7px; padding-top: 6px; display: flex; justify-content: space-between; gap: 12px; border-top: 1px solid rgba(96,122,130,.1); color: #7d9298; font-size: 9px; }
.delivery-failure-detail { margin-top: 6px; padding: 6px 8px; display: block; border-radius: 8px; color: #963e33; background: #fff0ed; font-size: 9px; line-height: 1.45; }
.chat-bubble.recalled { border-style: dashed; color: #71858a; background: #f3f7f7; box-shadow: none; }
.recalled-message { min-width: 220px; display: grid; grid-template-columns: 30px minmax(0,1fr); gap: 2px 8px; align-items: center; }
.recalled-message > span { width: 30px; height: 30px; grid-row: 1 / 3; display: grid; place-items: center; border-radius: 10px; color: #637b80; background: #e4ecec; font-size: 18px; }
.recalled-message strong { color: #506b71; font-size: 11px; }.recalled-message small { color: #7c9094; font-size: 8px; line-height: 1.35; }
.message-recall-button { margin: 7px 0 -3px auto; padding: 4px 7px; display: block; border: 0; border-radius: 8px; color: #6f858a; background: rgba(255,255,255,.62); font-size: 8px; font-weight: 800; cursor: pointer; }
.message-recall-button:hover { color: #8d3d35; background: #fff0ed; }
.chat-bubble .message-body,
.chat-bubble .message-translation-panel p,
.chat-bubble .message-transcription p { cursor: text; -webkit-user-select: text; user-select: text; }
.chat-bubble .message-body { overflow-wrap: anywhere; unicode-bidi: plaintext; }
.message-copy-button { min-height: 30px; margin: 7px 0 0 auto; padding: 4px 9px; display: block; border: 1px solid rgba(8,123,158,.18); border-radius: 9px; color: #34717d; background: rgba(255,255,255,.7); font-size: 9px; font-weight: 850; cursor: pointer; }
.message-copy-button:hover:not(:disabled) { border-color: #75bbb9; color: #075d6c; background: #f1faf8; }
.message-copy-button:focus-visible { outline: 3px solid rgba(8,123,158,.24); outline-offset: 2px; }
.message-copy-button:disabled { opacity: .72; cursor: default; }
@media (max-width: 860px) { .message-copy-button { min-height: 42px; padding-inline: 12px; } }
.message-translation-slot { margin-top: 8px; display: grid; justify-items: start; gap: 6px; min-width: 0; }
.message-translation-panel { width: 100%; min-width: 0; padding: 9px 10px; display: grid; gap: 6px; overflow: hidden; border: 1px solid #b9ddd8; border-radius: 11px; color: #164d59; background: #edf9f6; }
.message-translation-panel > div { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.message-translation-panel strong { font-size: 9px; letter-spacing: .08em; text-transform: uppercase; }
.message-translation-panel small { color: #567b81; font-size: 8px; font-weight: 750; }
.chat-bubble .message-translation-panel p { margin: 0; color: #123d48; font-size: 13px; line-height: 1.58; overflow-wrap: anywhere; white-space: pre-wrap; unicode-bidi: plaintext; }
.message-translate-button { min-height: 32px; padding: 5px 10px; border: 1px solid #b7dad6; border-radius: 10px; color: #087386; background: rgba(239,250,248,.92); font-size: 9px; font-weight: 850; cursor: pointer; }
.message-translate-button:hover:not(:disabled) { border-color: #73c3b7; color: #075b6d; background: #e5f7f3; }
.message-translate-button:focus-visible { outline: 3px solid rgba(8,123,158,.25); outline-offset: 2px; }
.message-translate-button:disabled { opacity: .7; cursor: wait; }
.message-translation-loading { min-height: 24px; display: inline-flex; align-items: center; gap: 7px; color: #557a80; font-size: 9px; font-weight: 750; }
.message-translation-loading i { width: 14px; height: 14px; border: 2px solid rgba(8,123,158,.18); border-top-color: #0d9b89; border-radius: 50%; animation: reply-media-spin .8s linear infinite; }
.message-translation-error, .message-translation-same { max-width: 100%; padding: 6px 8px; border-radius: 8px; font-size: 9px; line-height: 1.45; overflow-wrap: anywhere; }
.message-translation-error { color: #963e33; background: #fff0ed; }
.message-translation-same { color: #376c61; background: #eaf7f2; }
.message-transcription { margin: 8px 0; padding: 9px 10px; display: grid; gap: 5px; border: 1px solid #c6dfdc; border-radius: 11px; color: #174c57; background: #f2faf8; }
.message-transcription header { display: flex; align-items: baseline; justify-content: space-between; gap: 9px; }
.message-transcription strong { font-size: 9px; letter-spacing: .04em; }.message-transcription small { color: #627f84; font-size: 8px; }
.chat-bubble .message-transcription p { margin: 0; color: #173f49; font-size: 13px; line-height: 1.55; overflow-wrap: anywhere; white-space: pre-wrap; unicode-bidi: plaintext; }
.message-transcription.processing { grid-template-columns: 14px minmax(0,1fr); align-items: center; color: #5c7d83; font-size: 9px; font-weight: 750; }
.message-transcription.processing i { width: 13px; height: 13px; border: 2px solid rgba(8,123,158,.16); border-top-color: #0d9b89; border-radius: 50%; animation: reply-media-spin .8s linear infinite; }
.message-transcription.failed { color: #963e33; border-color: #efc4bd; background: #fff2ef; }
.reply-composer { flex: 0 0 auto; margin-top: auto; padding: 13px 16px 14px; border-top: 1px solid var(--line); background: rgba(255,255,255,.98); box-shadow: 0 -8px 25px rgba(4,77,97,.035); }
.ai-reply-suggestion { margin-bottom: 7px; padding: 6px 8px; display: grid; border: 1px solid #aedbd4; border-radius: 12px; color: #164d59; background: linear-gradient(145deg,#f0faf8,#e9f7f4); box-shadow: 0 4px 12px rgba(7,112,103,.06); }
.ai-reply-suggestion.hidden { display: none; }
.ai-reply-suggestion header { min-height: 34px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ai-reply-suggestion header > div:first-child { min-width: 0; display: grid; grid-template-columns: 9px auto minmax(0,1fr); align-items: center; gap: 5px 7px; }
.ai-reply-suggestion header strong { color: #075f71; font-size: 11px; white-space: nowrap; }.ai-reply-suggestion header small { min-width: 0; overflow: hidden; color: #557a80; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.ai-reply-suggestion-header-actions { display: flex; align-items: center; gap: 5px; flex: 0 0 auto; }
.ai-reply-suggestion-header-actions button { min-height: 32px; padding: 5px 9px; font-size: 9px; white-space: nowrap; }
.ai-reply-toggle.hidden { display: none; }
.ai-suggestion-dot { width: 8px; height: 8px; border-radius: 50%; background: #18b98f; box-shadow: 0 0 0 4px rgba(24,185,143,.12); }
.ai-reply-suggestion-body { margin-top: 6px; padding-top: 7px; display: grid; grid-template-columns: minmax(0,1fr) auto; grid-template-areas: "suggestion-text suggestion-actions" "suggestion-meta suggestion-meta"; gap: 6px 8px; border-top: 1px solid rgba(95,164,155,.24); }
.ai-reply-suggestion.is-collapsed .ai-reply-suggestion-body { display: none; }
.ai-reply-suggestion-body > p { grid-area: suggestion-text; margin: 0; max-height: 58px; padding: 7px 9px; overflow: auto; border-radius: 9px; color: #163f49; background: rgba(255,255,255,.82); font-size: 11px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; unicode-bidi: plaintext; }
.ai-reply-suggestion-meta { grid-area: suggestion-meta; max-height: 22px; display: flex; flex-wrap: wrap; gap: 4px; overflow: hidden; }
.ai-reply-suggestion-meta span { padding: 4px 7px; border-radius: 999px; color: #476d73; background: rgba(255,255,255,.72); font-size: 8px; font-weight: 750; }
.ai-reply-suggestion-actions { grid-area: suggestion-actions; display: flex; flex-direction: column; gap: 5px; align-self: start; }.ai-reply-suggestion-actions.hidden { display: none; }
.ai-reply-suggestion-actions button { min-height: 30px; padding: 5px 9px; font-size: 9px; white-space: nowrap; }
.reply-draft-translation-tools { margin-bottom: 7px; display: grid; grid-template-columns: auto minmax(105px,150px) auto minmax(0,1fr); gap: 7px; align-items: center; }
.reply-draft-translation-tools.hidden { display: none; }.reply-draft-translation-tools label { color: #55747a; font-size: 9px; font-weight: 850; }
.reply-draft-translation-tools select { min-height: 35px; padding: 6px 28px 6px 9px; font-size: 10px; }
.reply-draft-translation-tools button { min-height: 35px; padding: 6px 10px; }.reply-draft-translation-tools small { color: #768c91; font-size: 8px; }
.reply-translation-preview { margin-bottom: 8px; padding: 10px 11px; display: grid; gap: 7px; border: 1px solid #b8ddd8; border-radius: 13px; background: #f0faf8; }
.reply-translation-preview.hidden { display: none; }.reply-translation-preview header { display: flex; align-items: baseline; justify-content: space-between; gap: 9px; }
.reply-translation-preview header strong { color: #075f71; font-size: 10px; }.reply-translation-preview header small { color: #627f84; font-size: 8px; }
.reply-translation-preview > p { margin: 0; max-height: 100px; padding: 8px 9px; overflow: auto; border-radius: 9px; color: #173f49; background: white; font-size: 12px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; unicode-bidi: plaintext; }
.reply-translation-preview > div { display: flex; gap: 7px; }.reply-translation-preview button { min-height: 32px; padding: 5px 9px; font-size: 9px; }
.reply-composer textarea { min-height: 104px; padding: 14px 15px; border-radius: 14px; background: #fbfdfd; font-size: 14px; line-height: 1.6; }
.reply-template-control { margin-top: 8px; padding: 10px 12px; border: 1px solid #efc98b; border-radius: 13px; background: #fff8e9; display: grid; grid-template-columns: minmax(130px, .65fr) minmax(220px, 1.35fr); gap: 7px 10px; align-items: center; }
.reply-template-control label { color: #7d5414; font-size: 12px; font-weight: 800; }
.reply-template-control select { min-height: 42px; background: #fff; }
.reply-template-control small { grid-column: 1 / -1; color: #856f4d; font-size: 11px; line-height: 1.45; }
.reply-template-control .consent-record-button { grid-column: 1 / -1; justify-self: start; border-color: #9dcfc5; background: #eaf8f4; color: #075d5b; }
.reply-template-control.template-unavailable { border-color: #efb6ae; background: #fff1ef; }
.reply-template-control.template-unavailable label, .reply-template-control.template-unavailable small { color: #963c32; }
.reply-media-preview { margin-bottom: 9px; padding: 8px 10px; display: grid; grid-template-columns: 54px minmax(0,1fr) 32px; gap: 10px; align-items: center; border: 1px solid #bfe1dd; border-radius: 13px; background: #effaf7; }
.reply-media-preview.hidden { display: none; }
.reply-media-preview > div { width: 54px; height: 44px; display: grid; place-items: center; overflow: hidden; border-radius: 9px; color: #087b9e; background: #dff3ef; font-size: 22px; }
.reply-media-preview img, .reply-media-preview video { width: 100%; height: 100%; display: block; object-fit: cover; }
.reply-media-preview audio { width: 100%; height: 34px; display: block; }
.reply-media-preview:has(audio) { grid-template-columns: minmax(130px, 220px) minmax(0,1fr) 32px; }
.reply-media-preview:has(audio) > div { width: 100%; }
.reply-media-preview span { min-width: 0; display: grid; gap: 3px; }
.reply-media-preview strong, .reply-media-preview small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reply-media-preview strong { color: #164d59; font-size: 11px; }.reply-media-preview small { color: var(--muted); font-size: 9px; }
.reply-media-progress { position: relative; margin-bottom: 9px; padding: 9px 10px 13px; display: grid; grid-template-columns: 28px minmax(0,1fr) auto auto; gap: 8px; align-items: center; overflow: hidden; border: 1px solid #9ed8d0; border-radius: 13px; color: #075e70; background: linear-gradient(135deg,#effbf8,#e4f7f3); box-shadow: 0 6px 18px rgba(7,123,110,.09); }
.reply-media-progress.hidden { display: none; }
.reply-media-progress-spinner { width: 25px; height: 25px; border: 3px solid rgba(8,123,158,.16); border-top-color: #12a98c; border-radius: 50%; animation: reply-media-spin .8s linear infinite; }
.reply-media-progress-copy { min-width: 0; display: grid; gap: 2px; }
.reply-media-progress-copy strong, .reply-media-progress-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reply-media-progress-copy strong { font-size: 11px; }.reply-media-progress-copy small { color: #568087; font-size: 9px; }
.reply-media-progress-time { min-width: 42px; font-size: 12px; font-variant-numeric: tabular-nums; font-weight: 900; text-align: center; }
.reply-media-cancel { min-height: 30px; padding: 4px 9px; color: #8c4038; border-color: #efc5be; background: #fff7f5; font-size: 9px; }
.reply-media-progress-track { position: absolute; inset: auto 0 0; height: 4px; background: rgba(8,123,158,.1); }
.reply-media-progress-track i { width: 0; height: 100%; display: block; border-radius: inherit; background: linear-gradient(90deg,#087b9e,#22c987); transition: width .2s ease; }
@keyframes reply-media-spin { to { transform: rotate(360deg); } }
.reply-send-controls { display: flex; align-items: stretch; gap: 7px; }
.reply-media-button { min-height: 50px; padding: 6px 11px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid #b9dedd; border-radius: 15px; color: #08647a; background: linear-gradient(145deg,#f4fbfa,#e7f6f3); box-shadow: 0 7px 18px rgba(7,93,112,.08); cursor: pointer; white-space: nowrap; }
.reply-media-button span { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 10px; color: white; background: linear-gradient(135deg,#087b9e,#22bb8f); }
.reply-media-button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.reply-media-button strong { font-size: 10px; }.reply-media-button:hover { border-color: #78c9bd; transform: translateY(-1px); }.reply-media-button:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.reply-voice-button { min-height: 50px; padding: 6px 14px 6px 8px; display: inline-flex; align-items: center; justify-content: center; gap: 9px; overflow: hidden; border: 1px solid rgba(255,255,255,.34); border-radius: 15px; color: white; background: linear-gradient(135deg,#087b9e 0%,#0ca58f 56%,#22c987 100%); box-shadow: 0 9px 22px rgba(7,123,132,.2), inset 0 1px 0 rgba(255,255,255,.28); white-space: nowrap; cursor: pointer; transition: transform .18s ease, box-shadow .18s ease, filter .18s ease; }
.reply-voice-button:hover { filter: saturate(1.08) brightness(1.03); box-shadow: 0 11px 25px rgba(7,123,132,.25), inset 0 1px 0 rgba(255,255,255,.3); transform: translateY(-1px); }
.reply-voice-button:active { transform: translateY(0) scale(.98); }
.reply-voice-button:disabled { opacity: .58; cursor: wait; transform: none; }
.reply-voice-icon { width: 36px; height: 36px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 12px; color: white; background: rgba(255,255,255,.17); box-shadow: inset 0 0 0 1px rgba(255,255,255,.14); }
.reply-voice-icon svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.reply-voice-copy { min-width: 0; display: grid; gap: 1px; text-align: left; }
.reply-voice-copy strong { font-size: 11px; line-height: 1.15; }.reply-voice-copy small { color: rgba(255,255,255,.78); font-size: 8px; font-weight: 750; line-height: 1.15; }
.reply-voice-button.recording { border-color: #ffb5ae; background: linear-gradient(135deg,#b83d35,#ed5b4e); animation: voice-button-pulse 1.2s ease-in-out infinite; }
.voice-recorder { margin-bottom: 9px; padding: 9px 11px; display: grid; grid-template-columns: 12px minmax(0,1fr) auto auto auto; align-items: center; gap: 8px; border: 1px solid #e7aaa4; border-radius: 13px; color: #8d322c; background: linear-gradient(135deg,#fff3f1,#fff9f8); }
.voice-recorder.hidden { display: none; }
.voice-recording-dot { width: 9px; height: 9px; border-radius: 50%; background: #e34b42; box-shadow: 0 0 0 5px rgba(227,75,66,.12); animation: voice-dot-pulse 1s ease-in-out infinite; }
.voice-recorder strong { font-size: 11px; }.voice-recorder time { min-width: 42px; font-size: 12px; font-variant-numeric: tabular-nums; font-weight: 900; }
.voice-recorder .small-button { min-height: 30px; padding: 4px 9px; font-size: 9px; }
.voice-recorder-cancel { color: #8c4038; border-color: #efc5be; background: #fff7f5; }
.reply-media-dialog, .message-recall-dialog { width: min(560px, calc(100vw - 24px)); padding: 0; overflow: hidden; border: 1px solid #c8dfdf; border-radius: 20px; background: #fff; box-shadow: 0 28px 90px rgba(3,51,65,.28); }
.reply-media-dialog::backdrop, .message-recall-dialog::backdrop { background: rgba(3,35,45,.5); backdrop-filter: blur(5px); }
.reply-media-dialog form, .message-recall-dialog form { padding: 20px; display: grid; gap: 14px; }
.reply-media-dialog-note { margin: 0; padding: 10px 12px; border-radius: 11px; color: #587177; background: #f2f8f8; font-size: 10px; line-height: 1.55; }
.reply-media-source-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.reply-media-source-grid button { min-height: 112px; padding: 14px; display: grid; place-items: center; gap: 5px; border: 1px solid #c7e2df; border-radius: 16px; color: #075b70; background: linear-gradient(145deg,#f5fbfa,#e9f7f4); cursor: pointer; }
.reply-media-source-grid button:hover { border-color: #6fc8b8; box-shadow: 0 8px 22px rgba(5,109,112,.1); }
.reply-media-source-grid span { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 13px; color: white; background: linear-gradient(135deg,#087b9e,#24c68c); font-size: 23px; }
.reply-media-source-grid strong { font-size: 13px; }.reply-media-source-grid small { color: var(--muted); font-size: 9px; }
.reply-media-dialog-preview { min-height: 90px; padding: 10px; display: grid; grid-template-columns: 110px minmax(0,1fr); gap: 4px 12px; align-items: center; border: 1px solid #a9d8d2; border-radius: 14px; background: #eff9f7; }
.reply-media-dialog-preview.hidden { display: none; }.reply-media-dialog-preview > div { width: 110px; height: 80px; grid-row: 1 / 3; overflow: hidden; border-radius: 10px; background: #dceceb; }
.reply-media-dialog-preview img, .reply-media-dialog-preview video { width: 100%; height: 100%; object-fit: cover; }.reply-media-dialog-preview audio { width: 100%; }
.reply-media-document-thumb { width: 100%; height: 100%; display: grid; place-items: center; gap: 4px; color: #0b6b7a; background: linear-gradient(160deg,#e7f6f3,#d4efe9); font-size: 10px; font-weight: 800; text-align: center; }
.reply-media-document-thumb strong { font-size: 18px; letter-spacing: .04em; }
.reply-media-preview .reply-media-document-thumb { min-height: 52px; border-radius: 10px; }
.reply-media-dialog-preview strong { overflow: hidden; color: #164e59; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }.reply-media-dialog-preview small { color: var(--muted); font-size: 9px; }
.message-recall-dialog label { display: grid; gap: 7px; color: #405b62; font-size: 11px; font-weight: 800; }.message-recall-dialog select { width: 100%; }
.message-recall-warning { padding: 13px 14px; border: 1px solid #ecc4bd; border-radius: 13px; color: #853a32; background: #fff5f2; }.message-recall-warning strong { font-size: 12px; }.message-recall-warning p { margin: 5px 0 0; font-size: 10px; line-height: 1.6; }

@media (max-width: 620px) {
  .reply-media-dialog form, .message-recall-dialog form { padding: 15px; }
  .reply-media-source-grid { grid-template-columns: 1fr; }
  .reply-media-source-grid button { min-height: 92px; }
  .reply-media-dialog-preview { grid-template-columns: 84px minmax(0,1fr); }.reply-media-dialog-preview > div { width: 84px; height: 68px; }
  .reply-media-button { min-height: 44px; padding: 5px 8px; }.reply-media-button span { width: 28px; height: 28px; }.reply-media-button strong { font-size: 9px; }
  .recalled-message { min-width: 0; }
}
@keyframes voice-dot-pulse { 50% { opacity: .35; transform: scale(.75); } }
@keyframes voice-button-pulse { 50% { box-shadow: 0 0 0 4px rgba(227,75,66,.1); } }
.load-older-messages { align-self: center; padding: 8px 14px; border: 1px solid #c7dfe0; border-radius: 999px; color: #176875; background: rgba(255,255,255,.92); font-size: 11px; font-weight: 800; cursor: pointer; }
.conversation-loading { min-height: 240px; margin: auto; display: flex; align-items: center; justify-content: center; gap: 7px; color: var(--muted); }
.conversation-loading i { width: 8px; height: 8px; border-radius: 50%; background: #18a98f; animation: conversation-loading 1s infinite ease-in-out; }
.conversation-loading i:nth-child(2) { animation-delay: .12s; }.conversation-loading i:nth-child(3) { animation-delay: .24s; }.conversation-loading span { margin-left: 5px; font-size: 12px; }
@keyframes conversation-loading { 0%, 60%, 100% { opacity: .35; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-4px); } }
.reply-actions { margin-top: 9px; justify-content: flex-end; }
.reply-actions > #service-window-hint { display: none !important; }
.reply-actions span { font-size: 10px; }.window-active { color: #08755f; }.window-closed { color: var(--red); }
.customer-context { height: 100%; min-height: 0; max-height: none; padding: 0 13px 16px; overflow-x: hidden; overflow-y: auto; overscroll-behavior-y: contain; border-left: 1px solid var(--line); background: #f8fbfb; scrollbar-gutter: stable; scrollbar-width: thin; scrollbar-color: #86b9c1 transparent; -webkit-overflow-scrolling: touch; }
.conversation-list::-webkit-scrollbar, .chat-messages::-webkit-scrollbar, .customer-context::-webkit-scrollbar { width: 8px; }
.conversation-list::-webkit-scrollbar-thumb, .chat-messages::-webkit-scrollbar-thumb, .customer-context::-webkit-scrollbar-thumb { border: 2px solid transparent; border-radius: 999px; background: #86b9c1; background-clip: padding-box; }
.customer-context-head { margin: 0 -13px 13px; }
.context-card { padding: 14px; margin-bottom: 11px; border: 1px solid #d7e7e8; border-radius: 14px; background: #fff; box-shadow: 0 6px 18px rgba(4,77,97,.04); }.context-card h3 { margin: 5px 0 12px; font-size: 15px; }.context-card p { color: var(--muted); font-size: 11px; line-height: 1.55; }
.context-card-action-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.context-card-action-head h3 { margin-bottom: 10px; }
.context-create-order { flex: 0 0 auto; color: #fff; background: linear-gradient(135deg, #087b9e, #18a98f); box-shadow: 0 7px 16px rgba(8,123,158,.15); }
.context-create-order:hover { background: linear-gradient(135deg, #076d8b, #13977f); }
.context-card dl { margin: 0; }.context-card dl div { padding: 6px 0; display: flex; justify-content: space-between; gap: 8px; border-bottom: 1px solid #edf0ed; font-size: 11px; }.context-card dt { color: var(--muted); }.context-card dd { margin: 0; font-weight: 800; }
.patient-profile-card { border-color: #cfded4; background: #fbfdfb; }
.patient-profile-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.patient-profile-card-head h3 { margin-bottom: 8px; }.patient-profile-card-head .small-button { flex: 0 0 auto; }
.patient-summary { margin-top: 10px; padding-top: 9px; border-top: 1px solid #e6eee8; }.patient-summary strong { color: var(--forest); font-size: 11px; }.patient-summary p { max-height: 84px; margin: 5px 0 0; overflow: auto; white-space: pre-wrap; }
.patient-record-count { margin-top: 10px; padding: 8px 9px; border-radius: 9px; color: #52635a; background: #edf4ef; font-size: 10px; line-height: 1.5; }
.patient-profile-dialog { width: min(780px, calc(100vw - 28px)); max-width: none; max-height: calc(100vh - 28px); overflow-y: auto; }
.patient-profile-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.patient-address-row { min-width: 0; grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(150px, 190px); gap: 10px; align-items: start; }
.patient-mailing-address-field, .patient-postal-code-field { min-width: 0; }
.patient-postal-code-field input { min-height: 42px; resize: none; }
.patient-privacy-note { margin: 0; padding: 10px 12px; border: 1px solid #eed3a8; border-radius: 11px; color: #765018; background: #fff8e9; font-size: 11px; line-height: 1.55; }
.context-order { padding: 8px 0; display: grid; gap: 3px; border-bottom: 1px solid #edf0ed; }.context-order strong { font-size: 11px; }.context-order span { color: var(--muted); font-size: 10px; }

.support-agent-heading, .support-agent-actions { display: flex; align-items: center; gap: 9px; }
.support-agent-summary { margin-top: 17px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.support-agent-summary article { padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fafbf9; }
.support-agent-summary span, .support-agent-summary strong { display: block; }.support-agent-summary span { color: var(--muted); font-size: 11px; }.support-agent-summary strong { margin-top: 4px; font-size: 16px; }
.support-routing-settings { margin-top: 12px; padding: 14px; display: grid; gap: 12px; border: 1px solid #bcded9; border-radius: 14px; background: linear-gradient(135deg, #f3fbf9, #f8fbfd); }
.support-routing-heading, .support-routing-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.support-routing-heading h3 { margin: 3px 0 0; color: var(--forest); font-size: 15px; }
.support-routing-switch { flex: 0 0 auto; padding: 8px 11px; border: 1px solid #b9ddd5; border-radius: 999px; color: var(--forest); background: rgba(255,255,255,.82); }
.support-routing-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; }
.support-routing-grid article { padding: 10px 11px; border: 1px solid #d5e6e2; border-radius: 11px; background: rgba(255,255,255,.76); }
.support-routing-grid article span, .support-routing-grid article strong { display: block; }.support-routing-grid article span { color: var(--muted); font-size: 10px; }.support-routing-grid article strong { margin-top: 7px; color: var(--forest); font-size: 12px; line-height: 1.35; }
.support-routing-note { padding: 10px 12px; display: grid; grid-template-columns: auto 1fr; gap: 9px; border-radius: 11px; color: #4e607b; background: #eef5fb; font-size: 11px; line-height: 1.55; }
.support-routing-note strong { color: #355173; }
.support-routing-actions span { color: var(--muted); font-size: 11px; }
.operator-identity-note { margin-top: 10px; padding: 11px 13px; display: grid; grid-template-columns: auto 1fr; gap: 9px; border: 1px solid #d7e1f2; border-radius: 12px; color: #4e607b; background: #f3f7fd; font-size: 11px; line-height: 1.55; }
.operator-identity-note strong { color: #355173; }
.support-agent-unbound { margin-top: 10px; padding: 11px 13px; display: grid; gap: 8px; border: 1px solid #eed3a8; border-radius: 12px; color: #765018; background: #fff8e9; font-size: 11px; line-height: 1.5; }
.support-agent-unbound strong { color: #765018; }
.support-agent-unbound-list { display: flex; flex-wrap: wrap; gap: 7px; }
.support-agent-grid { margin-top: 14px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.support-agent-card { padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: #fbfcfa; }
.support-agent-inactive { opacity: .68; }
.support-agent-card-head { display: grid; grid-template-columns: 36px 1fr auto; gap: 9px; align-items: center; }
.support-agent-avatar { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 11px; color: var(--forest); background: var(--mint-soft); font-size: 12px; font-weight: 900; }
.support-agent-card h3 { margin: 0; font-size: 13px; }.support-agent-card-head p { margin: 3px 0 0; color: var(--muted); font-size: 10px; }
.agent-status { padding: 5px 7px; border-radius: 999px; color: #45633d; background: #edf8e4; font-size: 10px; font-weight: 850; }.agent-status.inactive { color: #7d625e; background: #f3edeb; }
.support-agent-card dl { margin: 12px 0 0; }.support-agent-card dl div { padding: 6px 0; display: flex; justify-content: space-between; gap: 9px; border-bottom: 1px solid #e9eeea; font-size: 10px; }.support-agent-card dt { color: var(--muted); }.support-agent-card dd { margin: 0; max-width: 65%; overflow: hidden; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.support-agent-metrics { margin-top: 10px; display: flex; gap: 6px; }.support-agent-metrics span { flex: 1; padding: 7px; border-radius: 9px; color: var(--muted); background: #edf2ed; font-size: 10px; text-align: center; }.support-agent-metrics b { color: var(--forest); }
.support-agent-card footer { margin-top: 10px; display: flex; justify-content: flex-end; gap: 6px; }
.support-agent-dialog { width: min(680px, calc(100vw - 28px)); max-width: none; max-height: calc(100vh - 28px); overflow-y: auto; }
.support-agent-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.danger-button { color: #9a4035; border-color: #edc8c1; background: #fff8f6; }
.support-agent-empty { grid-column: 1 / -1; padding: 28px; border: 1px dashed var(--line); border-radius: 13px; color: var(--muted); font-size: 12px; text-align: center; }
.enabled-toggle { display: flex; grid-template-columns: none; align-items: center; gap: 8px; }
.enabled-toggle input { width: 16px; height: 16px; accent-color: var(--forest); }
.reply-editor-warning { padding: 10px 12px; border: 1px solid #eed3a8; border-radius: 11px; color: #765018; background: #fff8e9; font-size: 11px; line-height: 1.5; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; }

.simulator-panel form { margin-top: 16px; display: grid; gap: 11px; }
label { display: grid; gap: 6px; color: #4f5d54; font-size: 12px; font-weight: 750; }
input, textarea, select { width: 100%; padding: 10px 11px; border: 1px solid var(--line); border-radius: 10px; outline: none; color: var(--ink); background: white; font-size: 13px; resize: vertical; }
input:focus, textarea:focus, select:focus { border-color: #25b79a; box-shadow: 0 0 0 3px rgba(37,183,154,.13); }
.form-row { display: grid; grid-template-columns: 1fr auto; gap: 9px; }
.simulation-result { margin-top: 13px; padding: 12px; border: 1px solid #cfe7ad; border-radius: 12px; background: #f3fae8; font-size: 12px; line-height: 1.55; }
.simulation-result strong { display: block; margin-bottom: 4px; }
.hidden { display: none !important; }

.integration-grid { margin-top: 18px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.integration-card { padding: 14px; border: 1px solid var(--line); border-radius: 14px; }
.integration-card-head { display: flex; align-items: center; justify-content: space-between; gap: 7px; }
.integration-card strong { font-size: 12px; }
.integration-card p { min-height: 30px; margin: 8px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.integration-backfill { width: 100%; margin-top: 10px; }
.integration-backfill:disabled { cursor: not-allowed; opacity: .48; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 0 4px rgba(230,162,57,.12); }
.status-ready { background: #69a943; box-shadow: 0 0 0 4px rgba(105,169,67,.12); }
.status-rules_fallback { background: var(--blue); box-shadow: 0 0 0 4px rgba(93,126,196,.12); }
.status-needs_configuration { background: var(--red); box-shadow: 0 0 0 4px rgba(202,91,76,.12); }
.status-needs_permissions { background: #df8b2d; box-shadow: 0 0 0 4px rgba(223,139,45,.14); }
.status-not_supported { background: #7b8494; box-shadow: 0 0 0 4px rgba(123,132,148,.14); }

dialog { width: min(430px, calc(100vw - 30px)); padding: 22px; border: 0; border-radius: 18px; box-shadow: 0 28px 90px rgba(15,35,24,.3); }
dialog::backdrop { background: rgba(13,31,21,.44); backdrop-filter: blur(4px); }
.dialog-heading { display: flex; align-items: flex-start; justify-content: space-between; }
.dialog-heading h2 { margin: 4px 0 0; font-size: 21px; }
dialog form { display: grid; gap: 15px; }
.full-button { width: 100%; }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 20; max-width: 360px; padding: 12px 15px; border-radius: 12px; color: white; background: var(--forest); box-shadow: 0 14px 40px rgba(21,63,45,.25); font-size: 13px; }
.toast.error { background: #923f34; }
.token-error { margin: 0; padding: 10px 12px; border-radius: 10px; color: #7b241c; background: #fff0ed; font-size: 14px; line-height: 1.5; }
.login-dialog { width: min(470px, calc(100vw - 28px)); }
.lead-export-dialog { width: min(680px, calc(100vw - 28px)); max-width: none; max-height: calc(100vh - 28px); overflow-y: auto; }
.lead-export-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.lead-export-fields { margin: 0; padding: 13px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; border: 1px solid var(--line); border-radius: 13px; }
.lead-export-fields legend { padding: 0 6px; color: var(--ink); font-size: 12px; font-weight: 850; }
.lead-export-fields label { min-width: 0; display: flex; grid-template-columns: none; align-items: center; gap: 7px; }
.lead-export-fields input { width: 15px; height: 15px; flex: 0 0 auto; accent-color: var(--forest); }
.lead-export-fields span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lead-export-private { padding: 10px 12px; border: 1px solid #eed3a8; border-radius: 11px; color: #765018; background: #fff8e9; line-height: 1.45; }
.lead-export-summary { padding: 10px 12px; border-radius: 11px; color: #145b69; background: #edf8f7; font-size: 12px; font-weight: 850; }
.backup-center-heading { align-items: flex-start; }
.backup-heading-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.backup-status-grid { margin-top: 17px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; }
.backup-status-grid article { padding: 13px 14px; border: 1px solid var(--line); border-radius: 13px; background: linear-gradient(145deg, #fff, #f2faf8); }
.backup-status-grid small, .backup-status-grid strong { display: block; }
.backup-status-grid small { color: var(--muted); font-size: 10px; }
.backup-status-grid strong { margin-top: 6px; font-size: 13px; }
.backup-settings-form { margin-top: 13px; display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.backup-schedule-card { padding: 15px; display: grid; gap: 11px; border: 1px solid var(--line); border-radius: 14px; background: #fbfdfd; }
.backup-schedule-card h3 { margin: 3px 0 0; font-size: 15px; }
.backup-schedule-card > p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.55; }
.backup-schedule-grid { display: grid; grid-template-columns: 1fr 1fr 1fr .7fr; gap: 8px; }
.backup-settings-actions { grid-column: 1 / -1; padding: 10px 12px; display: flex; align-items: center; justify-content: space-between; gap: 14px; border-radius: 12px; background: #edf8f7; }
.backup-settings-actions span { color: var(--muted); font-size: 10px; line-height: 1.5; }
.backup-list-heading { margin-top: 20px; padding-top: 16px; display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; border-top: 1px solid var(--line); }
.backup-list-heading h3 { margin: 3px 0 0; font-size: 15px; }
.backup-list-heading > span { color: var(--muted); font-size: 10px; }
.backup-list { margin-top: 10px; display: grid; gap: 8px; }
.backup-item { padding: 11px 12px; display: grid; grid-template-columns: minmax(220px, 1.3fr) minmax(190px, 1fr) auto; gap: 12px; align-items: center; border: 1px solid var(--line); border-radius: 12px; background: white; }
.backup-item-main strong, .backup-item-main small { display: block; }
.backup-item-main strong { font-size: 12px; }
.backup-item-main small, .backup-item-meta { margin-top: 4px; color: var(--muted); font-size: 10px; line-height: 1.45; }
.backup-type-badge { display: inline-flex; margin-right: 6px; padding: 3px 6px; border-radius: 999px; color: #11677a; background: #e7f7f5; font-size: 9px; font-weight: 900; }
.backup-type-system { color: #765018; background: #fff1d8; }
.backup-item-actions { display: flex; justify-content: flex-end; gap: 6px; }
.backup-empty { padding: 24px; border: 1px dashed var(--line); border-radius: 12px; color: var(--muted); text-align: center; }
.backup-restore-dialog { width: min(620px, calc(100vw - 28px)); max-width: none; }
.backup-restore-preview { padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: #f7fbfb; font-size: 11px; line-height: 1.65; }
.backup-restore-preview strong { display: block; margin-bottom: 4px; font-size: 13px; }
.danger-primary { background: linear-gradient(115deg, #8f3d34, #c45b4d); }
.login-brand { padding-bottom: 14px; display: flex; align-items: center; gap: 13px; border-bottom: 1px solid var(--line); }
.login-brand img { width: 62px; height: 62px; object-fit: contain; border: 1px solid var(--line); border-radius: 16px; }
.login-brand strong, .login-brand small { display: block; }
.login-brand strong { font-size: 20px; letter-spacing: .04em; }
.login-brand small { margin-top: 4px; color: var(--gold-deep); font-size: 11px; letter-spacing: .14em; }
.user-admin-layout { margin-top: 18px; display: grid; grid-template-columns: minmax(250px,.7fr) minmax(0,1.3fr); gap: 18px; }
.user-settings-column { display: grid; align-content: start; gap: 14px; }
.user-create-form { padding: 17px; display: grid; gap: 12px; border: 1px solid var(--line); border-radius: 15px; background: #f8fcfc; }
.user-create-form h3 { margin: 0; font-size: 16px; }
.field-help { color: var(--muted); font-size: 10px; font-weight: 650; line-height: 1.45; }
.security-settings-form { border-color: #b9dfdc; background: linear-gradient(145deg,#fbffff,#eef9f7); }
.password-policy-note { margin: -2px 0 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.password-change-status { margin: 0; padding: 10px 11px; border-radius: 10px; font-size: 12px; font-weight: 750; line-height: 1.5; }
.password-change-status.success { color: #245c35; background: #eaf7e8; }
.password-change-status.error { color: #7b241c; background: #fff0ed; }
.user-list { display: grid; align-content: start; gap: 9px; }
.user-row { padding: 13px 15px; display: grid; grid-template-columns: 1fr auto; gap: 7px 14px; align-items: center; border: 1px solid var(--line); border-radius: 13px; background: white; }
.user-row strong, .user-row small { display: block; }
.user-row small { margin-top: 4px; color: var(--muted); font-size: 11px; }
.user-role { align-self: start; padding: 5px 8px; border-radius: 999px; color: var(--forest); background: var(--mint-soft); font-size: 11px; font-weight: 850; }
.user-row-actions { display: flex; align-items: center; justify-content: flex-end; gap: 7px; }
.permission-fieldset { margin: 0; padding: 12px; border: 1px solid var(--line); border-radius: 12px; }
.permission-fieldset legend { padding: 0 6px; color: var(--forest); font-size: 12px; font-weight: 850; }
.permission-grid { display: grid; grid-template-columns: 1fr; gap: 8px; }
.permission-option { padding: 8px 9px; display: flex; align-items: flex-start; gap: 9px; border-radius: 9px; background: white; font-size: 12px; line-height: 1.35; }
.permission-option input { width: 17px; height: 17px; flex: 0 0 auto; accent-color: var(--teal); }
.permission-option small { display: block; margin-top: 2px; color: var(--muted); }
.permission-group-title { margin: 7px 0 0; color: var(--gold-deep); font-size: 10px; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.access-dialog { width: min(620px, calc(100vw - 28px)); }
.access-dialog form { display: grid; gap: 12px; }
.user-permission-summary { max-width: 520px; color: var(--muted); font-size: 11px; }
.password-reset-button { padding: 6px 8px; border: 1px solid var(--line); border-radius: 9px; color: var(--forest); background: white; font-size: 10px; font-weight: 850; cursor: pointer; }
.user-delete-button { padding: 6px 8px; border: 1px solid #edc8c1; border-radius: 9px; color: #9a4035; background: #fff8f6; font-size: 10px; font-weight: 850; cursor: pointer; }
.user-delete-button:hover:not(:disabled) { color: white; border-color: #a9473c; background: #a9473c; }
.user-delete-button:disabled { color: #879396; border-color: #dce5e5; background: #f4f7f7; cursor: not-allowed; }
.user-delete-dialog { width: min(560px, calc(100vw - 28px)); }
.customer-portal-content { margin-top: 20px; display: grid; gap: 15px; }
.customer-portal-heading-actions { display: flex; align-items: center; gap: 9px; }
.customer-profile-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; }
.customer-profile-grid article { padding: 15px; border: 1px solid var(--line); border-radius: 14px; background: #fbfaf6; }
.customer-profile-grid small, .customer-profile-grid strong { display: block; }
.customer-profile-grid small { color: var(--muted); font-size: 11px; }
.customer-profile-grid strong { margin-top: 6px; font-size: 15px; }
.customer-section { padding: 17px; border: 1px solid var(--line); border-radius: 15px; background: white; }
.customer-section h3 { margin: 0 0 12px; font-size: 16px; }
.customer-pess-section { background: linear-gradient(145deg, #f4fffb, #ffffff); border-color: #bfe9dc; }
.customer-pess-summary { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 10px; margin: 12px 0; }
.customer-pess-summary article { padding: 12px; border-radius: 12px; background: #fff; border: 1px solid #d8eee7; }
.customer-pess-summary small, .customer-pess-summary strong { display: block; }
.customer-pess-summary small { color: var(--muted); font-size: 11px; }
.customer-pess-summary strong { margin-top: 5px; }
.customer-pess-levels { display: flex; flex-wrap: wrap; gap: 7px; margin: 12px 0; }
.customer-pess-levels span { padding: 7px 10px; border-radius: 999px; background: #edf1f0; color: var(--muted); font-size: 12px; }
.customer-pess-levels span.is-unlocked { background: #d8f5e9; color: #087354; font-weight: 700; }
.customer-pess-ledger h4 { margin: 16px 0 8px; }
.negative-value { color: #b23a2b; }
@media (max-width: 760px) {
  .customer-pess-summary { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 440px) {
  .customer-pess-summary { grid-template-columns: 1fr; }
}
.customer-record { padding: 10px 0; border-top: 1px solid #eee8dc; font-size: 12px; line-height: 1.55; }
.customer-record:first-of-type { border-top: 0; }
.customer-record > strong:first-child, .customer-record > span:last-child { display: block; }
.customer-record > strong:first-child { margin-bottom: 3px; }
.customer-record > span:last-child { color: var(--muted); }
.customer-order-workbench { padding: 0; overflow: hidden; }
.customer-order-title { padding: 17px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); background: linear-gradient(125deg,#f7fcfc,#effaf7); }
.customer-order-title small { display: block; margin-bottom: 3px; color: var(--gold-deep); font-size: 10px; font-weight: 900; letter-spacing: .1em; }
.customer-order-title h3 { margin: 0; }
.customer-order-title > strong { padding: 6px 10px; border-radius: 999px; color: var(--forest); background: var(--mint-soft); font-size: 11px; }
.customer-order-toolbar { padding: 13px 17px; display: grid; grid-template-columns: minmax(220px,1.4fr) minmax(135px,.55fr) minmax(135px,.55fr) auto; gap: 9px; align-items: end; border-bottom: 1px solid var(--line); background: #fbfdfc; }
.customer-order-toolbar label { display: grid; gap: 5px; color: var(--muted); font-size: 10px; font-weight: 850; }
.customer-order-toolbar input, .customer-order-toolbar select { min-width: 0; }
.customer-order-list { padding: 14px 17px 17px; display: grid; gap: 10px; background: #f8fbfa; }
.customer-order-card { padding: 14px 15px; border: 1px solid #d6e7e4; border-radius: 14px; background: white; box-shadow: 0 8px 24px rgba(7,86,109,.05); }
.customer-order-card-main, .customer-order-card-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.customer-order-card-main small, .customer-order-card-main strong, .customer-order-card-footer small, .customer-order-card-footer strong { display: block; }
.customer-order-card-main small, .customer-order-card-footer small { color: var(--muted); font-size: 10px; }
.customer-order-card-main strong { margin-top: 3px; font-size: 13px; }
.customer-order-card p { margin: 11px 0; padding: 9px 11px; border-radius: 9px; color: #50686c; background: #f4f8f7; font-size: 11px; line-height: 1.5; }
.customer-order-card-footer > div:first-child > strong { margin-bottom: 3px; color: var(--forest); font-size: 17px; }
.customer-order-actions { display: flex; gap: 7px; }
.customer-order-empty { padding: 28px 15px; border: 1px dashed #bfd7d3; border-radius: 13px; color: var(--muted); background: white; text-align: center; font-size: 12px; }
.customer-order-dialog { width: min(640px,calc(100vw - 30px)); }
.customer-order-dialog form { display: grid; gap: 13px; }
.customer-order-total-preview { padding: 12px 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 1px solid #b9ded8; border-radius: 12px; color: var(--forest); background: #effaf7; }
.customer-order-total-preview span { font-size: 11px; font-weight: 800; }
.customer-order-total-preview strong { font-size: 20px; }
.alert-toggle { padding: 9px 11px; border: 1px solid var(--line); border-radius: 10px; color: var(--forest); background: white; font-size: 11px; font-weight: 850; cursor: pointer; }
.alert-toggle.enabled { border-color: #9fcf80; background: #eff9df; }
.incoming-alert { position: fixed; top: 22px; right: 22px; z-index: 30; width: min(430px, calc(100vw - 28px)); padding: 15px; display: grid; grid-template-columns: 38px 1fr auto; gap: 11px; align-items: center; border: 1px solid #b9daa2; border-radius: 16px; color: var(--ink); background: white; box-shadow: 0 20px 70px rgba(15,45,27,.25); animation: incoming-pop .25s ease-out; }
.incoming-alert-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; color: var(--forest); background: var(--mint-soft); font-size: 19px; }
.incoming-alert-copy { min-width: 0; }.incoming-alert-copy small, .incoming-alert-copy strong { display: block; }.incoming-alert-copy small { color: var(--forest-2); font-size: 10px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }.incoming-alert-copy strong { margin-top: 3px; font-size: 13px; }.incoming-alert-copy p { max-width: 260px; margin: 4px 0 0; overflow: hidden; color: var(--muted); font-size: 11px; line-height: 1.4; text-overflow: ellipsis; white-space: nowrap; }
.incoming-alert-open { padding: 9px 10px; border: 0; border-radius: 10px; color: white; background: var(--forest); font-size: 11px; font-weight: 850; cursor: pointer; }.incoming-alert-close { position: absolute; top: 4px; right: 7px; border: 0; color: var(--muted); background: transparent; font-size: 18px; cursor: pointer; }
@keyframes incoming-pop { from { opacity: 0; transform: translateY(-12px) scale(.98); } to { opacity: 1; transform: none; } }

@media (max-width: 1600px) {
  .topbar { grid-template-columns: 1fr; gap: 10px; }
  .top-actions { align-items: center; flex-direction: row; gap: 6px; }
  .top-action-group { min-height: 42px; justify-content: flex-end; }
  .top-action-group > * { min-height: 32px; }
  .alert-toggle { max-width: 220px; }
  .chat-header { grid-template-columns: minmax(160px, .58fr) minmax(360px, 1.42fr); align-items: center; gap: 10px; }
  .chat-controls { width: 100%; grid-template-columns: auto minmax(180px, 1fr); }
}

@media (max-width: 1320px) {
  .chat-controls { grid-template-columns: auto minmax(0, 1fr); }
}

@media (max-width: 1120px) {
  .order-metric-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .order-workbench-toolbar { grid-template-columns: repeat(2, minmax(0, 1fr)); }.order-search-field { grid-column: 1 / -1; }.order-filter-clear { width: 100%; }
  .topbar { grid-template-columns: 1fr; }
  .content[data-workspace="overview"] { grid-template-columns: 1fr; }
  .content[data-workspace="overview"] > .hero-grid,
  .content[data-workspace="overview"] section[aria-labelledby="funnel-title"],
  .content[data-workspace="overview"] #campaigns,
  .content[data-workspace="overview"] > .flow-card,
  .content[data-workspace="overview"] #operations { grid-column: 1; }
  .content[data-workspace="overview"] > .hero-grid { grid-row: 1; }
  .content[data-workspace="overview"] section[aria-labelledby="funnel-title"] { grid-row: 2; }
  .content[data-workspace="overview"] #campaigns { grid-row: 3; }
  .content[data-workspace="overview"] > .flow-card { grid-row: 4; }
  .content[data-workspace="overview"] #operations { grid-row: 5; }
  .hero-grid { grid-template-columns: repeat(2, 1fr); }
  .flow-track { grid-template-columns: 1fr; gap: 8px; }
  .flow-arrow { transform: rotate(90deg); justify-self: center; }
  .integration-grid { grid-template-columns: repeat(3, 1fr); }
  .operations-grid { grid-template-columns: 1fr; }
  .content[data-workspace="overview"] #operations .operations-grid { grid-template-columns: minmax(0, 1fr); }
  .content[data-workspace="overview"] #operations .operations-grid > * { min-width: 0; }
  .lead-workbench-toolbar { grid-template-columns: minmax(230px, 1.5fr) repeat(2, minmax(140px, 1fr)); }
  .lead-workbench-toolbar .lead-search-field { grid-column: span 2; }
  .content[data-workspace="inbox"] { height: auto; min-height: 0; overflow: visible; }
  .content[data-workspace="inbox"] .main-grid { height: auto; }
  .content[data-workspace="inbox"] #inbox.inbox-panel { height: auto; }
  .inbox-layout { flex: 0 0 auto; height: auto; grid-template-columns: 240px 1fr; overflow: visible; }.conversation-list { height: 760px; max-height: 760px; }.chat-pane, .chat-active { height: 760px; }.customer-context { grid-column: 1 / -1; height: auto; max-height: 520px; border-top: 1px solid var(--line); border-left: 0; }
  .chat-header { grid-template-columns: minmax(160px, .58fr) minmax(360px, 1.42fr); align-items: center; gap: 10px; }
}

@media (max-width: 860px) {
  html, body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    touch-action: pan-x pan-y;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
  }
  body { min-height: 100dvh; }
  .app-shell, .content, .workspace { width: 100%; max-width: 100%; min-width: 0; }
  input, textarea, select { font-size: 16px !important; }
  button, a, input, textarea, select, label { touch-action: manipulation; }
  .order-workbench-heading { align-items: flex-start; flex-direction: column; }.order-heading-actions { width: 100%; justify-content: flex-start; }
  [id] { scroll-margin-top: 18px; }
  .app-shell { grid-template-columns: 1fr; }
  body.sidebar-collapsed .app-shell { grid-template-columns: 1fr; }
  .sidebar,
  body.sidebar-collapsed .sidebar { position: fixed; inset: 0 auto 0 0; width: min(84vw, 320px); height: 100dvh; padding: 22px 18px; transform: translateX(-105%); overflow-y: auto; }
  body.nav-open { overflow: hidden; }
  body.nav-open .sidebar { transform: translateX(0); }
  .sidebar-head { align-items: flex-start; }
  .brand,
  body.sidebar-collapsed .brand { justify-content: flex-start; margin: 0 0 24px; }
  body.sidebar-collapsed .brand-copy { display: block; }
  .brand-mark,
  body.sidebar-collapsed .brand-mark { width: 58px; height: 58px; }
  .sidebar-close { display: block; }
  .sidebar-collapse { display: none; }
  .sidebar nav { display: grid; overflow: visible; }
  .nav-link,
  body.sidebar-collapsed .nav-link { justify-content: flex-start; padding: 12px 13px; }
  body.sidebar-collapsed .nav-link .nav-label { display: inline; }
  body.sidebar-collapsed .sidebar-utility-panel { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); padding: 6px; border-color: rgba(255,255,255,.18); background: rgba(0,48,64,.2); }
  body.sidebar-collapsed .sidebar-utility-panel .language-switcher { display: block !important; grid-column: 1; grid-row: 1; }
  body.sidebar-collapsed .sidebar-utility-panel .mode-pill { display: inline-flex !important; grid-column: 2; grid-row: 1; }
  body.sidebar-collapsed .sidebar-utility-panel .install-app-button:not(.hidden) { display: block !important; grid-column: 1; grid-row: 2; }
  body.sidebar-collapsed .sidebar-utility-panel .notification-install-button { display: block !important; grid-column: 2; grid-row: 2; }
  body.sidebar-collapsed .sidebar-utility-panel #logout-button:not(.hidden) { display: block !important; grid-column: 1 / -1; grid-row: 3; }
  .sidebar-utility-panel { margin: 0 0 18px; }
  .sidebar-note { display: flex; margin-top: 28px; }
  .sidebar-utility-panel + nav + .sidebar-note { margin-top: 8px; }
  .sidebar-backdrop { position: fixed; inset: 0; z-index: 35; display: block; border: 0; opacity: 0; pointer-events: none; background: rgba(10,9,6,.56); backdrop-filter: blur(2px); transition: opacity .2s ease; }
  body.nav-open .sidebar-backdrop { opacity: 1; pointer-events: auto; }
  .menu-button { display: block; }
  .topbar { position: sticky; display: flex; flex-wrap: wrap; padding-block: 16px; justify-content: flex-start; }
  .top-actions { flex: 1 1 calc(100% - 58px); margin-left: 0; flex-direction: row; }
  .top-action-group { flex: 1 1 auto; justify-content: flex-start; }
  .operation-actions { justify-content: flex-end; }
  .main-grid { grid-template-columns: 1fr; }
  .full-panel { grid-column: auto; }
  .queue-stats { grid-template-columns: repeat(auto-fit, minmax(104px, 1fr)); overflow: visible; }
  #operations > .section-heading { align-items: flex-start; }
  .operations-heading-actions { align-items: stretch; flex-direction: column; }
  .queue-period-control select { min-width: 132px; }
  .content[data-workspace="overview"] #operations .readiness-steps { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .content[data-workspace="overview"] #operations .readiness-step {
    grid-template-columns: 17px minmax(0, 1fr);
    align-content: center;
  }
  .content[data-workspace="overview"] #operations .readiness-step small {
    grid-column: 2;
  }
  .inbox-panel > .section-heading { align-items: flex-start; flex-direction: column; }
  .inbox-filters { width: 100%; }
  .inbox-search-input { flex: 1 1 230px; width: auto; min-width: 180px; }
  .inbox-filters select { flex: 1 1 auto; min-width: 0; }
  .inbox-layout { min-height: 0; grid-template-columns: 1fr; }.conversation-list { height: 320px; max-height: 320px; border-right: 0; }.chat-pane, .chat-active { height: 680px; min-height: 0; }.chat-controls { width: 100%; grid-template-columns: auto minmax(0, 1fr); }.customer-context { grid-column: auto; max-height: 520px; }
  .lead-workbench-toolbar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lead-workbench-toolbar .lead-search-field { grid-column: 1 / -1; }
  .lead-workbench-toolbar .lead-filter-clear { grid-column: 1 / -1; }
  .support-agent-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .support-routing-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .user-admin-layout { grid-template-columns: 1fr; }
  .backup-status-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .backup-settings-form { grid-template-columns: 1fr; }
  .backup-settings-actions { grid-column: auto; }
  .backup-item { grid-template-columns: 1fr auto; }
  .backup-item-meta { grid-column: 1; }
}

@media (max-width: 600px) {
  .order-workbench-heading { align-items: stretch; }.order-heading-actions { width: 100%; display: grid; grid-template-columns: 1fr 1fr; }.order-heading-actions .primary-button { grid-column: 1 / -1; }
  .order-metric-grid { padding: 11px; grid-template-columns: repeat(2, minmax(0, 1fr)); }.order-metric-grid article { padding: 11px; }.order-revenue-card { grid-column: 1 / -1; }
  .order-workbench-toolbar { margin: 11px 11px 0; grid-template-columns: 1fr; }.order-search-field { grid-column: auto; }.order-workbench-summary { margin-inline: 11px; display: grid; }.order-table-wrap { padding-inline: 11px; }
  .order-editor-grid, .order-detail-list { grid-template-columns: 1fr; }
  .customer-portal-heading { align-items: stretch; }
  .customer-portal-heading-actions { width: 100%; display: grid; grid-template-columns: 1fr; }
  .customer-order-toolbar { grid-template-columns: 1fr; }
  .customer-order-card-footer { align-items: stretch; flex-direction: column; }
  .customer-order-actions { display: grid; grid-template-columns: 1fr 1fr; }
  /* Unified mobile menu FAB: same glass control on every workspace.
     Inbox only nudges position to the reply-action baseline. */
  .topbar {
    position: fixed;
    inset: auto auto max(12px, calc(env(safe-area-inset-bottom) + 8px)) max(12px, env(safe-area-inset-left));
    z-index: 34;
    width: 48px;
    height: 48px;
    min-height: 0;
    padding: 0;
    display: block;
    overflow: visible;
    border: 0;
    background: transparent;
    box-shadow: none;
  }
  .topbar .menu-button {
    position: relative;
    isolation: isolate;
    width: 48px;
    height: 48px;
    padding: 11px 10px;
    overflow: hidden;
    border: 1px solid rgba(157, 220, 218, .72);
    border-radius: 15px;
    color: #075f70;
    background:
      radial-gradient(circle at 27% 15%, rgba(255,255,255,.84), transparent 37%),
      linear-gradient(145deg, rgba(236,255,252,.78), rgba(166,226,222,.52));
    box-shadow:
      0 10px 24px rgba(2,72,89,.18),
      inset 0 1px 0 rgba(255,255,255,.92),
      inset 0 -8px 16px rgba(21,139,147,.1);
    -webkit-backdrop-filter: blur(18px) saturate(1.35);
    backdrop-filter: blur(18px) saturate(1.35);
    transition: transform .16s ease, box-shadow .16s ease;
  }
  .topbar .menu-button::before { content: none; }
  .topbar .menu-button span {
    position: relative;
    height: 3px;
    margin: 3.5px 0;
    border-radius: 999px;
    background: rgba(5,91,108,.82);
    box-shadow: 0 1px 1px rgba(255,255,255,.68);
  }
  .topbar .menu-button:active {
    transform: translateY(2px) scale(.96);
    box-shadow: 0 6px 16px rgba(2,72,89,.2), inset 0 1px 0 rgba(255,255,255,.85);
  }
  .topbar-title { flex: 1 1 calc(100% - 58px); }
  .topbar h1 { font-size: 20px; }
  .topbar .eyebrow { overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
  .top-actions { width: 100%; margin-left: 0; display: grid; grid-template-columns: 1fr; gap: 7px; }
  .top-action-group { width: 100%; min-width: 0; justify-content: flex-start; }
  .account-actions .language-switcher { flex: 1 1 90px; min-width: 0; }
  .account-actions #token-button { flex: 1 1 auto; min-width: 0; }
  .operation-actions #alert-toggle { flex: 1 1 auto; max-width: none; min-width: 0; }
  .top-actions .mode-pill { display: none; }
  .content { padding: 8px 8px 20px; }
  .content[data-workspace="inbox"] { height: 100dvh; min-height: 540px; padding: 6px max(6px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(6px, env(safe-area-inset-left)); overflow: hidden; }
  .content[data-workspace="inbox"] .main-grid, .content[data-workspace="inbox"] #inbox.inbox-panel { height: 100%; min-height: 0; }
  .content[data-workspace="inbox"] .inbox-layout { flex: 1 1 0; height: 0; min-height: 0; overflow: hidden; }
  .inbox-panel > .section-heading { min-height: 0; padding: 8px; }
  .inbox-panel > .section-heading h2 { display: none; }
  .inbox-filters { width: 100%; padding: 3px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px; }
  .inbox-search-input { grid-column: 1 / -1; width: 100%; min-width: 0; min-height: 38px; padding: 7px 9px; font-size: 12px; }
  .inbox-filters select { min-height: 38px; padding-inline: 7px; }
  .inbox-filters .small-button { min-height: 38px; padding-inline: 9px; grid-column: auto; white-space: nowrap; }
  .conversation-list { height: 100%; max-height: none; }
  .chat-pane, .chat-active { height: 100%; min-height: 0; }
  .chat-back-button { display: grid; place-items: center; }
  body.mobile-conversation-open .conversation-list { display: none; }
  body:not(.mobile-conversation-open) .chat-pane,
  body:not(.mobile-conversation-open) .customer-context { display: none; }
  body.mobile-conversation-open .customer-context { display: none; }
  body.mobile-context-open { overflow: hidden; }
  body.mobile-context-open .customer-context { position: fixed; inset: 0; z-index: 48; display: block; width: 100%; height: 100dvh; max-height: none; padding-bottom: max(16px, env(safe-area-inset-bottom)); border: 0; background: #f5fafa; }
  .mobile-customer-profile-button { min-height: 34px; padding: 6px 9px; display: inline-flex; align-items: center; flex: 0 0 auto; color: #066277; background: #e8f6f4; font-size: 10px; white-space: nowrap; }
  .mobile-context-close { width: 36px; height: 36px; padding: 0; display: grid; place-items: center; flex: 0 0 auto; border: 1px solid var(--line); border-radius: 10px; color: #07566d; background: #eef8f7; font-size: 28px; line-height: 1; cursor: pointer; }
  .customer-context-head { padding-top: max(10px, env(safe-area-inset-top)); }
  .chat-header { padding: 14px; }
  .chat-controls { grid-template-columns: auto minmax(0, 1fr); }
  .chat-assignment-control { grid-column: 2; grid-row: 1; }
  .chat-messages { min-height: 0; padding: 18px 14px; }
  .chat-bubble { max-width: 88%; }
  .reply-composer { padding-inline: 12px; }
  .ai-reply-suggestion { padding: 6px 7px; }
  .ai-reply-suggestion header { align-items: flex-start; }
  .ai-reply-suggestion header > div:first-child { padding-block: 2px; grid-template-columns: 9px minmax(0,1fr); }
  .ai-reply-suggestion header small { grid-column: 2; }
  .ai-reply-suggestion-header-actions button { min-height: 42px; }
  .ai-reply-suggestion-body { grid-template-columns: minmax(0,1fr); grid-template-areas: "suggestion-text" "suggestion-actions" "suggestion-meta"; gap: 6px; }
  .ai-reply-suggestion-body > p { max-height: 56px; font-size: 12px; }
  .ai-reply-suggestion-actions { flex-direction: row; }
  .ai-reply-suggestion-actions button { min-height: 42px; }
  .reply-draft-translation-tools { grid-template-columns: auto minmax(0,1fr) auto; }
  .reply-draft-translation-tools small { grid-column: 1 / -1; }
  .reply-draft-translation-tools select, .reply-draft-translation-tools button { min-height: 42px; }
  .reply-translation-preview > p { max-height: 86px; font-size: 13px; }
  .message-transcription header { align-items: flex-start; flex-direction: column; gap: 2px; }
  .chat-bubble .message-transcription p { font-size: 14px; }
  .reply-composer textarea { height: 72px; min-height: 72px; }
  .reply-template-control { grid-template-columns: 1fr; padding: 8px 9px; }
  .reply-template-control small { grid-column: auto; }
  .reply-actions { padding-left: 42px; }
  .reply-actions { align-items: stretch; flex-direction: column; }
  /* Keep the fixed glass navigation button clear of the expired-window
     explanation and its first action row. */
  .reply-composer.reply-window-closed .reply-template-control { margin-left: 68px; }
  .reply-composer.reply-window-closed .reply-actions { padding-left: 68px; }
  .reply-send-controls { width: 100%; display: grid; grid-template-columns: minmax(0,1.25fr) minmax(0,1fr) minmax(0,.82fr); }
  .reply-send-controls button { min-width: 0; padding-inline: 7px; font-size: 10px; }
  .reply-voice-button { min-height: 48px; padding: 5px 8px; display: inline-flex; gap: 7px; }
  .reply-voice-icon { width: 34px; height: 34px; border-radius: 11px; }
  .reply-voice-icon svg { width: 20px; height: 20px; }
  .reply-voice-copy strong { font-size: 10px; }.reply-voice-copy small { font-size: 7px; }
  .voice-recorder { grid-template-columns: 10px minmax(0,1fr) auto auto auto; padding: 8px; gap: 5px; }
  .reply-media-preview { grid-template-columns: 46px minmax(0,1fr) 30px; }
  .reply-media-preview > div { width: 46px; height: 40px; }
  .reply-media-progress { grid-template-columns: 24px minmax(0,1fr) auto auto; gap: 6px; padding-inline: 8px; }
  .reply-media-progress-spinner { width: 21px; height: 21px; }
  .reply-media-progress-copy strong { font-size: 9px; }.reply-media-progress-copy small { font-size: 8px; }
  .reply-media-progress-time { min-width: 36px; font-size: 10px; }
  .hero-grid { grid-template-columns: 1fr; }
  .metric-card { min-height: 130px; }
  .flow-card, .panel { padding: 17px; border-radius: 16px; }
  .lead-workbench-toolbar { padding: 8px; grid-template-columns: 1fr; }
  .lead-workbench-toolbar .lead-search-field,
  .lead-workbench-toolbar .lead-filter-clear { grid-column: auto; }
  .lead-workbench-summary { align-items: flex-start; flex-direction: column; gap: 3px; }
  .lead-heading-actions { width: 100%; }
  .lead-heading-actions > * { flex: 1; }
  .lead-export-options, .lead-export-fields { grid-template-columns: 1fr; }
  .backup-center-heading, .backup-list-heading { align-items: flex-start; flex-direction: column; }
  .backup-heading-actions { width: 100%; display: grid; grid-template-columns: 1fr 1fr; }
  .backup-heading-actions #backup-reload { grid-column: 1 / -1; }
  .backup-status-grid, .backup-schedule-grid { grid-template-columns: 1fr; }
  .backup-settings-actions { align-items: flex-start; flex-direction: column; }
  .backup-settings-actions .primary-button { width: 100%; }
  .backup-item { grid-template-columns: 1fr; }
  .backup-item-meta, .backup-item-actions { grid-column: auto; }
  .backup-item-actions > * { flex: 1; }
  .integration-grid { grid-template-columns: 1fr; }
  .support-agent-summary, .support-agent-grid, .support-agent-form-grid, .support-routing-grid, .patient-profile-grid, .patient-address-row { grid-template-columns: 1fr; }
  .customer-profile-grid { grid-template-columns: 1fr; }
  .support-agent-heading { align-items: flex-start; flex-direction: column; }
  .support-routing-heading, .support-routing-actions { align-items: stretch; flex-direction: column; }
  .support-routing-switch { width: 100%; border-radius: 11px; }
  .support-routing-note { grid-template-columns: 1fr; }
  .support-routing-actions .primary-button { width: 100%; }
  .section-heading { align-items: flex-start; }
  .alert-toggle { flex: 1 1 100%; order: 3; }.incoming-alert { top: 10px; right: 14px; grid-template-columns: 34px 1fr; }.incoming-alert-open { grid-column: 1 / -1; }.incoming-alert-copy p { max-width: 230px; }
  th:nth-child(2), td:nth-child(2), th:nth-child(5), td:nth-child(5) { display: none; }
}

/* Compact mobile customer workspace.
   The page heading is intentionally removed on phones so search and customer
   records begin immediately below the browser chrome. */
@media (max-width: 600px) {
  .content[data-workspace="leads"] { padding: 2px 5px 14px; }
  .content[data-workspace="leads"] #leads { padding: 7px; border-radius: 14px; }
  .content[data-workspace="leads"] #leads > .section-heading { display: none; }
  .content[data-workspace="leads"] .lead-workbench-toolbar {
    margin-top: 0;
    padding: 6px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5px 6px;
    border-radius: 12px;
  }
  .content[data-workspace="leads"] .lead-workbench-toolbar .lead-search-field { grid-column: 1 / -1; }
  .content[data-workspace="leads"] .lead-workbench-toolbar .lead-filter-clear { grid-column: auto; }
  .content[data-workspace="leads"] .lead-workbench-toolbar label { gap: 2px; }
  .content[data-workspace="leads"] .lead-workbench-toolbar label > span { font-size: 8px; letter-spacing: 0; }
  .content[data-workspace="leads"] .lead-workbench-toolbar input,
  .content[data-workspace="leads"] .lead-workbench-toolbar select {
    min-height: 33px;
    padding: 5px 7px;
    border-radius: 8px;
    font-size: 11px !important;
  }
  .content[data-workspace="leads"] .lead-workbench-toolbar .lead-filter-clear {
    min-height: 33px;
    padding: 5px 7px;
    font-size: 10px;
  }
  .content[data-workspace="leads"] .lead-workbench-summary {
    min-height: 0;
    padding: 6px 2px 2px;
    gap: 1px;
    font-size: 8px;
    line-height: 1.3;
  }
  .content[data-workspace="leads"] .lead-workbench-summary strong { font-size: 10px; }
  .content[data-workspace="leads"] #leads .table-wrap { margin-top: 5px; }
  .content[data-workspace="leads"] #leads table { table-layout: fixed; }
  .content[data-workspace="leads"] #leads th { padding: 7px 4px; font-size: 8px; letter-spacing: .02em; }
  .content[data-workspace="leads"] #leads td { padding: 8px 4px; font-size: 10px; }
  .content[data-workspace="leads"] #leads th:nth-child(1),
  .content[data-workspace="leads"] #leads td:nth-child(1) { width: 46%; }
  .content[data-workspace="leads"] #leads th:nth-child(3),
  .content[data-workspace="leads"] #leads td:nth-child(3) { width: 16%; }
  .content[data-workspace="leads"] #leads th:nth-child(4),
  .content[data-workspace="leads"] #leads td:nth-child(4) { width: 18%; }
  .content[data-workspace="leads"] #leads th:nth-child(6),
  .content[data-workspace="leads"] #leads td:nth-child(6) { width: 20%; }
  .content[data-workspace="leads"] #leads .customer-chat-link { padding: 3px 2px; border-radius: 8px; }
  .content[data-workspace="leads"] #leads .customer-chat-link strong { font-size: 10px; }
  .content[data-workspace="leads"] #leads .customer-chat-link small { font-size: 8px; }
  .content[data-workspace="leads"] #leads .customer-chat-link > i { font-size: 15px; }
  .content[data-workspace="leads"] #leads .score-cell { gap: 3px; }
  .content[data-workspace="leads"] #leads .score-ring { width: 28px; height: 28px; }
  .content[data-workspace="leads"] #leads .score-ring span { font-size: 8px; }
  .content[data-workspace="leads"] #leads .lead-row-actions { gap: 3px; }
  .content[data-workspace="leads"] #leads .lead-row-actions button {
    width: 100%;
    min-width: 0;
    padding: 5px 3px;
    font-size: 8px;
    line-height: 1.15;
    white-space: normal;
  }
}

/* Russian mobile layout: keep the interface readable when labels are much
   longer than their Chinese counterparts. This is deliberately scoped to the
   selected UI language so the compact layouts for the other languages stay
   unchanged. */
@media (max-width: 600px) {
  html[lang="ru"] body { font-size: 14px; }
  html[lang="ru"] .sidebar,
  html[lang="ru"] body.sidebar-collapsed .sidebar { width: min(90vw, 340px); padding: 18px 14px; }
  html[lang="ru"] .brand,
  html[lang="ru"] body.sidebar-collapsed .brand { margin-bottom: 16px; }
  html[lang="ru"] .brand-copy strong { font-size: 20px; }
  html[lang="ru"] .brand-copy small { font-size: 10px; letter-spacing: .13em; }
  html[lang="ru"] .sidebar-utility-panel { gap: 5px; }
  html[lang="ru"] .sidebar-utility-panel button,
  html[lang="ru"] .sidebar-utility-panel select { min-width: 0; padding-inline: 7px; font-size: 12px; line-height: 1.18; white-space: normal; }
  html[lang="ru"] .nav-link,
  html[lang="ru"] body.sidebar-collapsed .nav-link { min-height: 44px; padding: 9px 10px; gap: 9px; }
  html[lang="ru"] .nav-icon { flex: 0 0 24px; }
  html[lang="ru"] .nav-label { min-width: 0; font-size: 13px; line-height: 1.22; overflow-wrap: anywhere; hyphens: auto; }
  html[lang="ru"] .sidebar-note { margin-top: 16px; }

  html[lang="ru"] .content { padding: 7px 7px 18px; }
  html[lang="ru"] .flow-card,
  html[lang="ru"] .panel { padding: 14px; }
  html[lang="ru"] .section-heading { gap: 8px; }
  html[lang="ru"] .section-heading h2,
  html[lang="ru"] .order-workbench-heading h2,
  html[lang="ru"] .customer-portal-heading h2 { font-size: 18px; line-height: 1.18; overflow-wrap: normal; word-break: normal; hyphens: none; }
  html[lang="ru"] .eyebrow { font-size: 9px; line-height: 1.25; letter-spacing: .08em; }
  html[lang="ru"] .subtle-badge,
  html[lang="ru"] .health-pill { max-width: 100%; white-space: normal; text-align: center; line-height: 1.2; }

  html[lang="ru"] button,
  html[lang="ru"] .primary-button,
  html[lang="ru"] .small-button,
  html[lang="ru"] .text-button { min-width: 0; font-size: 12px; line-height: 1.18; white-space: normal; overflow-wrap: normal; word-break: normal; hyphens: none; }
  html[lang="ru"] input,
  html[lang="ru"] select,
  html[lang="ru"] textarea { min-width: 0; }

  html[lang="ru"] .metric-card { min-height: 118px; padding: 15px; }
  html[lang="ru"] .metric-heading { align-items: flex-start; gap: 8px; }
  html[lang="ru"] .metric-heading > span:first-child { font-size: 12px; line-height: 1.25; overflow-wrap: anywhere; }
  html[lang="ru"] .metric-value { font-size: 38px; line-height: 1; }
  html[lang="ru"] .metric-card p { font-size: 11px; line-height: 1.35; }
  html[lang="ru"] .flow-step { align-items: flex-start; }
  html[lang="ru"] .flow-step strong { font-size: 13px; line-height: 1.25; }

  html[lang="ru"] .lead-heading-actions,
  html[lang="ru"] .order-heading-actions,
  html[lang="ru"] .backup-heading-actions { width: 100%; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  html[lang="ru"] .lead-heading-actions > *,
  html[lang="ru"] .order-heading-actions > *,
  html[lang="ru"] .backup-heading-actions > * { width: 100%; min-height: 38px; }
  html[lang="ru"] .content[data-workspace="leads"] #leads > .section-heading,
  html[lang="ru"] .content[data-workspace="backups"] .backup-center-heading { align-items: stretch; flex-direction: column; }
  html[lang="ru"] .lead-heading-actions > :last-child,
  html[lang="ru"] .order-heading-actions .primary-button,
  html[lang="ru"] .backup-heading-actions #backup-reload { grid-column: 1 / -1; }
  html[lang="ru"] .lead-workbench-toolbar,
  html[lang="ru"] .order-workbench-toolbar,
  html[lang="ru"] .customer-order-toolbar { gap: 7px; }
  html[lang="ru"] .lead-workbench-toolbar label > span,
  html[lang="ru"] .order-workbench-toolbar label,
  html[lang="ru"] .customer-order-toolbar label { font-size: 10px; line-height: 1.25; }

  html[lang="ru"] .content[data-workspace="leads"] #leads .table-wrap { overflow: visible; }
  html[lang="ru"] .content[data-workspace="leads"] #leads table,
  html[lang="ru"] .content[data-workspace="leads"] #leads tbody,
  html[lang="ru"] .content[data-workspace="leads"] #leads tr,
  html[lang="ru"] .content[data-workspace="leads"] #leads td { width: 100%; display: block; }
  html[lang="ru"] .content[data-workspace="leads"] #leads thead { display: none; }
  html[lang="ru"] .content[data-workspace="leads"] #leads tbody { display: grid; gap: 8px; }
  html[lang="ru"] .content[data-workspace="leads"] #leads tbody tr { padding: 11px; border: 1px solid #d7e7e7; border-radius: 13px; background: #fff; }
  html[lang="ru"] .content[data-workspace="leads"] #leads td { padding: 6px 0; border: 0; }
  html[lang="ru"] .content[data-workspace="leads"] #leads td:nth-child(2),
  html[lang="ru"] .content[data-workspace="leads"] #leads td:nth-child(5) { display: none; }
  html[lang="ru"] .content[data-workspace="leads"] #leads .score-cell { justify-content: flex-start; }
  html[lang="ru"] .content[data-workspace="leads"] #leads .customer-chat-link { min-height: 48px; }
  html[lang="ru"] .content[data-workspace="leads"] #leads .lead-row-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
  html[lang="ru"] .content[data-workspace="leads"] #leads .lead-row-actions button { width: 100%; min-width: 0; min-height: 40px; }

  html[lang="ru"] .content[data-workspace="campaigns"] #campaigns { padding: 12px; }
  html[lang="ru"] .campaign-control-heading,
  html[lang="ru"] .campaign-actions-heading,
  html[lang="ru"] .campaign-toolbar { align-items: stretch; flex-direction: column; }
  html[lang="ru"] .campaign-control-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  html[lang="ru"] .campaign-control-summary article { min-width: 0; padding: 10px; }
  html[lang="ru"] .campaign-control-summary span { line-height: 1.25; overflow-wrap: anywhere; hyphens: auto; }
  html[lang="ru"] .campaign-control-summary strong { font-size: 19px; overflow-wrap: anywhere; }
  html[lang="ru"] .campaign-policy-grid,
  html[lang="ru"] .campaign-toolbar-filters { width: 100%; grid-template-columns: minmax(0, 1fr); }
  html[lang="ru"] .campaign-policy-grid label { width: 100%; line-height: 1.25; }
  html[lang="ru"] .campaign-policy-grid .primary-button { width: 100%; min-height: 40px; }
  html[lang="ru"] .campaign-toolbar > span { white-space: normal; line-height: 1.3; }

  html[lang="ru"] .operations-grid { min-width: 0; grid-template-columns: minmax(0, 1fr); }
  html[lang="ru"] .operations-grid > * { min-width: 0; }
  html[lang="ru"] .queue-stats { grid-template-columns: repeat(auto-fit, minmax(104px, 1fr)); overflow: visible; }
  html[lang="ru"] .queue-stats span { white-space: normal; line-height: 1.2; overflow-wrap: anywhere; }

  html[lang="ru"] .inbox-panel > .section-heading { padding: 6px; }
  html[lang="ru"] .inbox-filters { grid-template-columns: minmax(0, 1fr) auto; }
  html[lang="ru"] .inbox-search-input { grid-column: 1 / -1; }
  html[lang="ru"] .inbox-filters .small-button { grid-column: 1 / -1; min-height: 34px; }
  html[lang="ru"] .inbox-filters select { width: 100%; font-size: 14px !important; }
  html[lang="ru"] .conversation-list-head,
  html[lang="ru"] .customer-context-head { min-height: 54px; padding: 10px 12px; }
  html[lang="ru"] .conversation-item { padding-inline: 11px; }
  html[lang="ru"] .conversation-item strong,
  html[lang="ru"] .chat-title strong { line-height: 1.2; overflow-wrap: anywhere; }
  html[lang="ru"] .chat-header { padding: 10px; gap: 8px; }
  html[lang="ru"] .chat-controls { grid-template-columns: auto minmax(0, 1fr); gap: 6px; }
  html[lang="ru"] .chat-assignment-control { grid-column: 2; grid-row: 1; }
  html[lang="ru"] .chat-assignment-control .small-button { min-height: 36px; }
  html[lang="ru"] .chat-messages { padding: 14px 10px; }
  html[lang="ru"] .chat-bubble { max-width: 94%; padding: 11px 12px; line-height: 1.42; }
  html[lang="ru"] .reply-composer { padding: 9px; }
  html[lang="ru"] .reply-actions { padding-left: 42px; gap: 6px; }
  html[lang="ru"] .reply-actions > * { flex: 1 1 0; min-height: 40px; }

  html[lang="ru"] .campaign-decision-buttons,
  html[lang="ru"] .backup-item-actions { width: 100%; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  html[lang="ru"] .campaign-decision-buttons > *,
  html[lang="ru"] .backup-item-actions > * { width: 100%; }
  html[lang="ru"] .support-agent-summary article,
  html[lang="ru"] .backup-status-grid article,
  html[lang="ru"] .order-metric-grid article { min-width: 0; }
  html[lang="ru"] table { font-size: 11px; }
  html[lang="ru"] th,
  html[lang="ru"] td { padding-inline: 7px; overflow-wrap: anywhere; }
}

/* Compact mobile conversation header.
   Row 1: customer identity. Row 2: call and assignee; reengagement uses a separate row only when required. */
@media (max-width: 600px) {
  .content[data-workspace="inbox"] { padding-top: 2px; }
  .inbox-panel > .section-heading { padding: 2px 3px 4px; gap: 0; }
  .inbox-panel > .section-heading > div:first-child { display: none; }
  .inbox-filters { border-radius: 11px; }

  .chat-header { min-height: 0; padding: 5px 7px 6px; gap: 4px; grid-template-columns: minmax(0, 1fr); }
  .chat-identity { min-height: 38px; gap: 7px; }
  .chat-back-button { width: 36px; height: 36px; border-radius: 10px; }
  .chat-header strong { font-size: 14px; }
  .chat-header small { margin-top: 2px; font-size: 9px; line-height: 1.25; }
  .chat-controls { --chat-control-height: 40px; width: 100%; display: grid; grid-template-columns: 82px minmax(0, 1fr); gap: 5px; }
  .chat-controls #customer-voice-call { height: var(--chat-control-height); min-height: var(--chat-control-height); padding: 4px 5px; font-size: 11px; line-height: 1.12; white-space: normal; }
  .chat-controls #customer-reengage:not(.hidden) { grid-column: 1 / -1; grid-row: 2; width: 100%; min-height: var(--chat-control-height); }
  .chat-assignment-control { grid-column: 2; grid-row: 1; min-width: 0; height: var(--chat-control-height); padding: 3px 4px 3px 7px; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto auto; column-gap: 3px; row-gap: 0; border-radius: 10px; }
  .chat-assignment-control > span { display: block; font-size: 7px; }
  .chat-assignment-control > strong { font-size: 10px; }
  .chat-assignment-control .small-button { min-height: 28px; padding: 3px 6px; font-size: 10px; line-height: 1.1; }
  .manual-handling-bar { max-width: calc(100% - 14px); margin: 3px 7px 0 auto; padding: 0; }
  .manual-handling-bar .small-button { min-height: 28px; max-width: none; padding: 3px 7px; border-radius: 8px; font-size: 8px; line-height: 1.15; white-space: nowrap; }
  .manual-handled-summary { margin: 3px 7px 0; padding: 4px 5px; gap: 5px; border-radius: 9px; }
  .manual-handled-summary > div { gap: 1px; }
  .manual-handled-summary strong { font-size: 9px; line-height: 1.2; }
  .manual-handled-summary small { font-size: 7px; line-height: 1.25; }
  .manual-handled-summary > span { width: 23px; height: 23px; }
  .opt-out-conversation-notice { margin: 3px 7px 0; padding: 4px 6px; gap: 5px; border-radius: 8px; }
  .opt-out-conversation-notice > span { width: 21px; height: 21px; }
  .opt-out-conversation-notice > div { grid-template-columns: 1fr; gap: 1px; }
  .opt-out-conversation-notice strong { font-size: 8px; }
  .opt-out-conversation-notice small { font-size: 7px; line-height: 1.25; }
  .message-translate-button { min-height: 44px; padding: 8px 12px; font-size: 11px; }
  .message-translation-panel { padding: 10px 11px; }
  .chat-bubble .message-translation-panel p { font-size: 14px; }

  html[lang="ru"] .inbox-panel > .section-heading { padding: 2px 3px 4px; }
  html[lang="ru"] .inbox-filters { grid-template-columns: minmax(0, 1fr) auto; }
  html[lang="ru"] .inbox-search-input { grid-column: 1 / -1; }
  html[lang="ru"] .inbox-filters .small-button { grid-column: auto; min-height: 36px; padding-inline: 6px; font-size: 10px; }
  html[lang="ru"] .chat-header { padding: 5px 7px 6px; gap: 4px; }
  html[lang="ru"] .chat-controls { grid-template-columns: 82px minmax(0, 1fr); gap: 4px; }
  html[lang="ru"] .chat-assignment-control { grid-column: 2; grid-row: 1; }
  html[lang="ru"] .chat-controls #customer-voice-call,
  html[lang="ru"] .chat-assignment-control .small-button { font-size: 9px; }
}

/* Use the actual conversation-pane width, not the browser width. Desktop
   windows can still have a narrow chat column beside the conversation list. */
@container conversation-pane (max-width: 559px) {
  .chat-header { min-height: 0; padding: 6px 7px; grid-template-columns: minmax(0, 1fr); gap: 5px; }
  .chat-identity { min-height: 40px; }
  .chat-controls { --chat-control-height: 40px; width: 100%; display: grid; grid-template-columns: 82px minmax(0, 1fr); gap: 5px; }
  .chat-controls #customer-voice-call { grid-column: 1; grid-row: 1; min-width: 0; padding-inline: 5px; white-space: normal; }
  .chat-controls .chat-assignment-control { grid-column: 2; grid-row: 1; min-width: 0; }
  .chat-controls #customer-reengage:not(.hidden) { grid-column: 1 / -1; grid-row: 2; width: 100%; min-height: var(--chat-control-height); }
}

@media (display-mode: standalone) and (max-width: 600px) {
  body { overscroll-behavior-y: none; }
  .content[data-workspace="inbox"] { height: 100dvh; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}

.call-button { white-space: nowrap; }
.call-console {
  margin: 0 18px 12px;
  padding: 14px 16px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px 16px;
  border: 1px solid #a7d9d3;
  border-radius: 16px;
  background: #eefaf8;
}
.call-console > div:first-child { display: grid; gap: 3px; }
.call-console span { color: #567276; font-size: .88rem; }
.call-console small { color: #6b8185; font-size: .78rem; }
.call-console .call-agent-ready { color: #087b68; }
.call-console-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.call-console-actions .primary-button { min-height: 36px; padding: 7px 12px; }
.call-history { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; }
.call-history-item {
  padding: 7px 10px;
  display: inline-grid;
  gap: 2px;
  border: 1px solid #c9e2df;
  border-radius: 11px;
  background: #fff;
}
.call-history-item strong { color: #123f49; font-size: .86rem; }
.call-history-item small { color: #6b8185; }
.call-status-blocked { color: #9d3e34 !important; font-weight: 750; }
.call-status-ready { color: #087b68 !important; font-weight: 750; }

@media (max-width: 600px) {
  .call-console { margin-inline: 12px; grid-template-columns: 1fr; }
  .call-console-actions { justify-content: flex-start; }
}

/* Unified mobile typography.
   Keep controls readable without triggering iOS form zoom, while preserving
   the compact workbench layouts on 360-430px screens. */
@media (max-width: 600px) {
  :root {
    --mobile-title-size: 15px;
    --mobile-card-title-size: 12px;
    --mobile-body-size: 13px;
    --mobile-control-size: 13px;
    --mobile-meta-size: 11px;
  }

  body { font-size: var(--mobile-body-size); line-height: 1.45; }

  .whatsapp-template-panel { padding: 8px; }
  .workspace .section-heading.whatsapp-template-heading h2 { font-size: 14px; }
  .whatsapp-template-heading .eyebrow { font-size: 9px; }
  .whatsapp-template-sync { margin-top: 3px; font-size: 9px; }
  .whatsapp-template-summary { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 5px; margin: 8px 0; }
  .whatsapp-template-summary article { padding: 8px; border-radius: 9px; }
  .whatsapp-template-summary span { font-size: 9px; }
  .whatsapp-template-summary strong { font-size: 13px; }
  .whatsapp-template-toolbar { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 5px; padding: 7px; border-radius: 10px; }
  .whatsapp-template-toolbar .template-search { grid-column: 1 / -1; }
  .whatsapp-template-toolbar .template-filter-clear { width: 100%; }
  .whatsapp-template-toolbar input,
  .whatsapp-template-toolbar select,
  .whatsapp-template-toolbar .template-filter-clear { min-height: 34px; font-size: 10px; }
  .whatsapp-template-toolbar label > span { font-size: 9px; }
  .whatsapp-template-resultbar { align-items: flex-start; margin-bottom: 7px; font-size: 9px; }
  .whatsapp-template-resultbar span { text-align: right; }
  .whatsapp-template-guardrail { align-items: flex-start; margin-bottom: 7px; padding: 7px; font-size: 9px; }
  .whatsapp-template-grid { grid-template-columns: 1fr; gap: 7px; }
  .whatsapp-template-card { padding: 10px; border-radius: 11px; }
  .whatsapp-template-card header span { font-size: 9px; }
  .whatsapp-template-card header strong { font-size: 11px; }
  .whatsapp-template-card header em { font-size: 9px; }
  .whatsapp-template-card dl { margin: 7px 0 6px; }
  .whatsapp-template-card dt { font-size: 9px; }
  .whatsapp-template-card dd { font-size: 10px; }
  .whatsapp-template-body { min-height: 0; padding: 8px; font-size: 11px; -webkit-line-clamp: 3; }
  .whatsapp-template-card footer { font-size: 10px; }

  .workspace .section-heading h2,
  .workspace .order-workbench-heading h2,
  .workspace .customer-portal-heading h2,
  .workspace .backup-center-heading h2,
  .workspace .support-agent-heading h2,
  .workspace .dialog-heading h2 { font-size: var(--mobile-title-size); line-height: 1.25; }

  .workspace h3,
  .workspace .context-card h3,
  .workspace .backup-schedule-card h3,
  .workspace .backup-list-heading h3,
  .workspace .customer-section h3,
  .workspace .user-create-form h3 { font-size: var(--mobile-card-title-size); line-height: 1.3; }

  .workspace button,
  .workspace .primary-button,
  .workspace .small-button,
  .workspace .text-button { font-size: var(--mobile-control-size); line-height: 1.25; }

  /* 16px is intentional: iOS Safari otherwise zooms when a field receives focus. */
  .workspace input,
  .workspace textarea,
  .workspace select { font-size: 16px !important; line-height: 1.35; }

  .workspace label,
  .workspace p,
  .workspace li,
  .workspace dd,
  .workspace dt,
  .workspace .muted,
  .workspace .reply-text,
  .workspace .integration-card p,
  .workspace .context-card p,
  .workspace .customer-record,
  .workspace .customer-order-card p,
  .workspace .simulation-result,
  .workspace .backup-restore-preview { font-size: var(--mobile-body-size); }

  .workspace small,
  .workspace .eyebrow,
  .workspace .subtle-badge,
  .workspace .health-pill,
  .workspace .channel-badge,
  .workspace .campaign-control-summary span,
  .workspace .campaign-policy-title small,
  .workspace .campaign-actions-heading small,
  .workspace .campaign-policy-grid label,
  .workspace .campaign-toolbar > span,
  .workspace .campaign-table-wrap td:first-child small,
  .workspace .campaign-row-controls button,
  .workspace .campaign-action-copy small,
  .workspace .campaign-action-status,
  .workspace .lead-owner-cell small,
  .workspace .customer-delete-target span,
  .workspace .customer-delete-target small,
  .workspace .assignment-customer span,
  .workspace .assignment-customer small,
  .workspace .assignment-preview span,
  .workspace .assignment-preview small,
  .workspace .assignment-account-compare article span,
  .workspace .assignment-account-compare article small,
  .workspace .assignment-reasons legend,
  .workspace .assignment-reasons button,
  .workspace .assignment-scope strong,
  .workspace .assignment-scope span,
  .workspace .assignment-history small,
  .workspace #assignment-history-list article span,
  .workspace #assignment-history-list article small,
  .workspace .backup-status-grid small,
  .workspace .backup-item-main small,
  .workspace .backup-item-meta,
  .workspace .backup-type-badge,
  .workspace .permission-group-title,
  .workspace .customer-order-toolbar label,
  .workspace .customer-order-card-main small,
  .workspace .customer-order-card-footer small { font-size: var(--mobile-meta-size); line-height: 1.35; }

  .workspace table { font-size: 12px; }
  .workspace th { font-size: 11px; line-height: 1.25; }
  .workspace td { font-size: 12px; line-height: 1.35; }

  .metric-heading > span:first-child { font-size: 13px; }
  .metric-value { font-size: clamp(36px, 11vw, 46px); }
  .metric-card p { font-size: 12px; }
  .flow-step strong { font-size: 14px; }
  .flow-step span { font-size: 12px; }
  .action-item strong { font-size: 13px; }
  .action-item p { font-size: 12px; }
  .campaign-control-summary strong { font-size: 21px; }
  .lead-owner-cell strong { font-size: 12px; }

  /* Customer table remains compact but no longer uses 8px text. */
  .content[data-workspace="leads"] .lead-workbench-toolbar label > span { font-size: 11px; }
  .content[data-workspace="leads"] .lead-workbench-toolbar input,
  .content[data-workspace="leads"] .lead-workbench-toolbar select { font-size: 16px !important; }
  .content[data-workspace="leads"] .lead-workbench-toolbar .lead-filter-clear { font-size: 12px; }
  .content[data-workspace="leads"] .lead-workbench-summary,
  .content[data-workspace="leads"] .lead-workbench-summary strong { font-size: 11px; }
  .content[data-workspace="leads"] #leads th { font-size: 10px; }
  .content[data-workspace="leads"] #leads td { font-size: 11px; }
  .content[data-workspace="leads"] #leads .customer-chat-link strong { font-size: 12px; }
  .content[data-workspace="leads"] #leads .customer-chat-link small,
  .content[data-workspace="leads"] #leads .score-ring span { font-size: 10px; }
  .content[data-workspace="leads"] #leads .lead-row-actions button { font-size: 10px; }

  /* Keep the compact call and assignee controls readable without the retired
     conversation-status selector. */
  .chat-header strong { font-size: 15px; }
  .chat-header small { font-size: 11px; }
  .chat-controls #customer-voice-call,
  .chat-assignment-control .small-button { font-size: 11px; }
  .chat-assignment-control > strong { font-size: 11px; }
  .conversation-copy strong { font-size: 13px; }
  .conversation-copy small { font-size: 12px; }
  .conversation-copy em { font-size: 11px; }
  .chat-bubble p { font-size: 15px; line-height: 1.55; }
  .chat-bubble footer { font-size: 11px; }
  .reply-composer textarea { font-size: 16px !important; }
  .reply-actions span { font-size: 11px; }

  html[lang="ru"] body { font-size: var(--mobile-body-size); }
  html[lang="ru"] .section-heading h2,
  html[lang="ru"] .order-workbench-heading h2,
  html[lang="ru"] .customer-portal-heading h2 { font-size: var(--mobile-title-size); }
  html[lang="ru"] .chat-header strong { font-size: 14px; }
  html[lang="ru"] .chat-header small { font-size: 10px; }
}

/* Compact mobile navigation masthead.
   This header is shared by every workspace, so reducing it here removes the
   oversized top band everywhere while retaining the iPhone safe-area inset. */
@media (max-width: 600px) {
  :root {
    /* Use the device's actual safe area; do not add an artificial top band. */
    --mobile-workspace-safe-top: max(3px, env(safe-area-inset-top, 0px));
  }

  /* Every mobile workbench starts below the system status bar. This final
     rule intentionally wins over older workspace-specific compact spacing. */
  .content[data-workspace] {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    min-height: 100dvh;
    padding-top: var(--mobile-workspace-safe-top) !important;
    padding-right: max(6px, env(safe-area-inset-right));
    padding-bottom: max(10px, env(safe-area-inset-bottom));
    padding-left: max(6px, env(safe-area-inset-left));
    overflow-x: hidden;
  }

  .content[data-workspace]:not([data-workspace="inbox"]):not([data-workspace="leads"]) {
    height: auto;
    overflow-y: visible;
  }

  .content[data-workspace] > *,
  .content[data-workspace] > .main-grid,
  .content[data-workspace] .workspace,
  .content[data-workspace] .panel,
  .content[data-workspace] .flow-card {
    min-width: 0;
    max-width: 100%;
  }

  /* The inbox is the only fixed-height workbench. The outer safe-area padding
     is included in 100dvh and the three inner columns keep their own scroll. */
  .content[data-workspace="inbox"] {
    height: 100dvh;
    max-height: 100dvh;
    min-height: 540px;
    overflow: hidden;
  }

  /* iOS moves the visual viewport upward when the software keyboard opens.
     Pin the inbox to that real visible rectangle so the composer ends exactly
     at the keyboard instead of leaving an empty band below the workbench. */
  body.mobile-keyboard-open {
    width: 100%;
    height: var(--mobile-visual-height);
    min-height: 0;
    overflow: hidden;
  }

  body.mobile-keyboard-open .content[data-workspace="inbox"] {
    position: fixed;
    inset: var(--mobile-visual-top, 0px) 0 auto;
    z-index: 20;
    width: 100%;
    height: var(--mobile-visual-height) !important;
    max-height: var(--mobile-visual-height) !important;
    min-height: 0 !important;
    padding-top: 3px !important;
    padding-bottom: max(3px, env(safe-area-inset-bottom));
  }

  body.mobile-keyboard-open .content[data-workspace="inbox"] .reply-composer {
    padding-bottom: 4px;
  }

  .content[data-workspace="inbox"] > .main-grid,
  .content[data-workspace="inbox"] #inbox.inbox-panel {
    height: 100%;
    min-height: 0;
    max-height: 100%;
  }

  .sidebar,
  body.sidebar-collapsed .sidebar {
    /* Align with the same actual safe area used by the workspaces. */
    padding-top: var(--mobile-workspace-safe-top);
    padding-right: 14px;
    padding-left: 14px;
    padding-bottom: max(12px, env(safe-area-inset-bottom));
  }

  .sidebar-head {
    min-height: 44px;
    align-items: center;
    gap: 6px;
  }

  .brand,
  body.sidebar-collapsed .brand,
  html[lang="ru"] .brand,
  html[lang="ru"] body.sidebar-collapsed .brand {
    min-height: 44px;
    margin: 0 0 9px;
    gap: 9px;
    align-items: center;
  }

  .brand-mark,
  body.sidebar-collapsed .brand-mark {
    width: 43px;
    height: 43px;
  }

  .brand strong,
  html[lang="ru"] .brand-copy strong {
    font-size: 16px;
    line-height: 1.05;
  }

  .brand small,
  html[lang="ru"] .brand-copy small {
    margin-top: 3px;
    font-size: 8px;
    line-height: 1.1;
    letter-spacing: .11em;
  }

  .sidebar-close {
    width: 36px;
    height: 36px;
    padding: 0;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    font-size: 27px;
    line-height: 1;
  }

  .sidebar-utility-panel {
    margin-top: 0;
  }

  /* Keep alerts aligned with the workspace safe area. */
  .incoming-alert {
    top: var(--mobile-workspace-safe-top);
  }

  /* Mobile customer workbench: keep a compact filter tray fixed at the top;
     scroll the result summary and customer records below it. */
  .content[data-workspace="leads"] {
    height: 100dvh;
    max-height: 100dvh;
    padding-right: max(5px, env(safe-area-inset-right));
    padding-bottom: max(6px, env(safe-area-inset-bottom));
    padding-left: max(5px, env(safe-area-inset-left));
    overflow: hidden;
  }

  .content[data-workspace="leads"] > .main-grid,
  .content[data-workspace="leads"] #leads {
    height: 100%;
    min-height: 0;
    max-height: 100%;
  }

  .content[data-workspace="leads"] #leads {
    margin: 0;
    padding: 5px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  .content[data-workspace="leads"] .lead-workbench-toolbar {
    position: relative;
    z-index: 3;
    flex: 0 0 auto;
    padding: 5px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
    border-radius: 11px;
    box-shadow: 0 5px 14px rgba(4,77,97,.06);
  }

  .content[data-workspace="leads"] .lead-workbench-toolbar .lead-search-field {
    grid-column: 1 / 3;
    grid-row: 1;
  }

  .content[data-workspace="leads"] .lead-workbench-toolbar .lead-filter-clear {
    grid-column: 3;
    grid-row: 1;
    align-self: end;
  }

  .content[data-workspace="leads"] .lead-workbench-toolbar label:not(.lead-search-field) {
    grid-row: 2;
  }

  .content[data-workspace="leads"] .lead-workbench-toolbar label {
    gap: 1px;
  }

  .content[data-workspace="leads"] .lead-workbench-toolbar label > span {
    min-height: 14px;
    font-size: 9px;
    line-height: 1.2;
  }

  .content[data-workspace="leads"] .lead-workbench-toolbar input,
  .content[data-workspace="leads"] .lead-workbench-toolbar select,
  .content[data-workspace="leads"] .lead-workbench-toolbar .lead-filter-clear {
    height: 34px;
    min-height: 34px;
    padding: 4px 6px;
    border-radius: 8px;
  }

  .content[data-workspace="leads"] .lead-workbench-toolbar .lead-filter-clear {
    font-size: 11px;
    line-height: 1.15;
  }

  .content[data-workspace="leads"] .lead-scroll-region {
    min-height: 0;
    flex: 1 1 auto;
    display: block;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-gutter: stable;
  }

  .content[data-workspace="leads"] .lead-workbench-summary {
    padding: 7px 3px 3px;
  }

  .content[data-workspace="leads"] .lead-phone-search-hint { font-size: 9px; }
  .content[data-workspace="leads"] .lead-phone-search-feedback {
    margin: 4px 2px;
    padding: 7px 8px;
    font-size: 10px;
  }

  .content[data-workspace="leads"] #leads .table-wrap {
    margin-top: 2px;
    overflow-x: auto;
    overflow-y: visible;
  }

  .content[data-workspace="leads"] #leads thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: rgba(255,255,255,.97);
    box-shadow: inset 0 -1px #d9e8e9;
  }

  /* Pin the lead search/filter tray. Counts, actions and customer records
     scroll below it; the customer table header stays sticky in that region. */
  .content[data-workspace="leads"] #leads.mobile-split-panel.mobile-workbench-active {
    padding: 6px;
  }

  .content[data-workspace="leads"] .mobile-workbench-fixed {
    position: sticky;
    top: 0;
    z-index: 14;
    flex: 0 0 auto;
    align-self: stretch;
    gap: 0;
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 6px 6px 9px;
    box-sizing: border-box;
    border: 1px solid #c9e1e3;
    border-radius: 12px 12px 7px 7px;
    background: #f2faf9;
    box-shadow: none;
  }

  .content[data-workspace="leads"] .mobile-workbench-fixed::after { content: none; }

  .content[data-workspace="leads"] .mobile-workbench-fixed > .lead-workbench-toolbar {
    order: 1;
    width: 100%;
    max-width: 100%;
    margin: 0;
    box-sizing: border-box;
  }

  .content[data-workspace="leads"] .mobile-workbench-fixed > .section-heading {
    order: 2;
    min-height: 0;
    padding: 5px 3px;
    display: flex;
    align-items: center;
    gap: 5px;
  }

  .content[data-workspace="leads"] .mobile-workbench-fixed > .section-heading > div:first-child {
    min-width: 0;
    flex: 1 1 auto;
  }

  .content[data-workspace="leads"] .mobile-workbench-fixed > .section-heading .eyebrow {
    margin: 0;
    font-size: 8px;
  }

  .content[data-workspace="leads"] .mobile-workbench-fixed > .section-heading h2 {
    margin-top: 1px;
    overflow: hidden;
    font-size: var(--mobile-title-size);
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .content[data-workspace="leads"] .mobile-workbench-fixed .lead-heading-actions {
    width: auto;
    flex: 0 0 auto;
    display: grid;
    grid-template-columns: repeat(3, auto);
    gap: 3px;
  }

  .content[data-workspace="leads"] .mobile-workbench-fixed .lead-heading-actions button {
    min-width: 0;
    min-height: 29px;
    padding: 4px 6px;
    font-size: 8px;
    white-space: nowrap;
  }

  .content[data-workspace="leads"] .mobile-workbench-fixed > .lead-workbench-summary {
    order: 3;
    margin: 0;
    padding: 5px 3px 2px;
  }

  .content[data-workspace="leads"] .mobile-workbench-scroll {
    width: 100%;
    max-width: 100%;
    padding-top: 2px;
    box-sizing: border-box;
    overflow-x: hidden;
    overflow-y: auto;
    background: #fff;
  }

  .content[data-workspace="leads"] .mobile-workbench-scroll > .section-heading {
    margin-top: 8px;
  }

  .content[data-workspace="leads"] .mobile-workbench-scroll > .lead-scroll-region {
    min-height: auto;
    flex: none;
    overflow: visible;
  }

  /* Shared split layout for all remaining mobile workbenches. The active
     panel owns the viewport: controls stay above and records scroll below. */
  .content[data-workspace]:not([data-workspace="overview"]):not([data-workspace="inbox"]):not([data-workspace="leads"]):not([data-workspace="customer-portal"]),
  .content[data-workspace="customer-portal"] {
    height: 100dvh;
    max-height: 100dvh;
    overflow: hidden;
  }

  .content[data-workspace]:not([data-workspace="overview"]):not([data-workspace="inbox"]):not([data-workspace="leads"]):not([data-workspace="customer-portal"]) > .main-grid {
    height: 100%;
    min-height: 0;
    max-height: 100%;
  }

  .content[data-workspace] .mobile-split-panel.mobile-workbench-active {
    height: 100%;
    min-height: 0;
    max-height: 100%;
    margin: 0;
    padding: 8px;
    display: flex !important;
    flex-direction: column;
    overflow: hidden;
  }

  .content[data-workspace] .mobile-workbench-fixed {
    position: relative;
    z-index: 4;
    flex: 0 0 auto;
    display: grid;
    gap: 6px;
    padding-bottom: 7px;
    border-bottom: 1px solid rgba(201,223,226,.9);
    background: rgba(255,255,255,.98);
  }

  .content[data-workspace] .mobile-workbench-scroll {
    min-height: 0;
    flex: 1 1 auto;
    display: block;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-gutter: stable;
  }

  .content[data-workspace] .mobile-workbench-fixed .section-heading,
  .content[data-workspace] .mobile-workbench-fixed .order-workbench-heading,
  .content[data-workspace] .mobile-workbench-fixed .support-agent-heading,
  .content[data-workspace] .mobile-workbench-fixed .backup-center-heading,
  .content[data-workspace] .mobile-workbench-fixed .customer-portal-heading {
    margin: 0;
  }

  .content[data-workspace] .mobile-workbench-fixed .order-workbench-toolbar,
  .content[data-workspace] .mobile-workbench-fixed .campaign-toolbar {
    margin: 0;
  }

  .content[data-workspace] .mobile-workbench-scroll > :first-child {
    margin-top: 8px;
  }

  /* Compact mobile growth overview. Metric values deliberately match the
     Sales funnel title size instead of using the former 36-46px display type. */
  .content[data-workspace="overview"] {
    height: 100dvh;
    max-height: 100dvh;
    gap: 8px;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;
    padding-right: max(6px, env(safe-area-inset-right));
    padding-bottom: max(12px, env(safe-area-inset-bottom));
    padding-left: max(6px, env(safe-area-inset-left));
  }

  .content[data-workspace="overview"] > .hero-grid {
    position: sticky;
    top: 0;
    z-index: 22;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
    padding: 8px;
    border: 1px solid rgba(164,205,211,.72);
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 10px 24px rgba(4,77,97,.12);
    filter: none;
    isolation: isolate;
  }

  .content[data-workspace="overview"] .metric-period-toolbar {
    min-height: 28px;
    gap: 6px;
  }

  .content[data-workspace="overview"] .metric-period-toolbar label {
    font-size: 9px;
  }

  .content[data-workspace="overview"] .metric-period-toolbar select {
    min-width: 102px;
    min-height: 28px;
    padding: 4px 27px 4px 9px;
    border-radius: 8px;
    font-size: 10px;
  }

  .content[data-workspace="overview"] > .hero-grid::after { content: none; }

  /* Final mobile fixed-bar alignment. The workspace already owns the iPhone
     safe-area padding, so a second top offset would push the fixed block down. */
  .content[data-workspace="overview"] {
    position: relative;
    background: #edf7f7;
  }

  .content[data-workspace="overview"] > .hero-grid {
    width: 100%;
    max-width: 100%;
    margin: 0;
    box-sizing: border-box;
    background: #f7fcfb;
    box-shadow: none;
  }

  .content[data-workspace="leads"] #leads.mobile-split-panel.mobile-workbench-active {
    background: #f7fcfb;
  }

  .content[data-workspace="leads"] .mobile-workbench-fixed {
    position: sticky;
    top: 0;
    z-index: 12;
    flex: 0 0 auto;
    align-self: stretch;
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 6px 6px 8px;
    box-sizing: border-box;
    border: 1px solid #c9e1e3;
    border-radius: 12px 12px 7px 7px;
    background: #f2faf9;
    box-shadow: none;
  }

  .content[data-workspace="leads"] .mobile-workbench-fixed::after { content: none; }

  .content[data-workspace="leads"] .mobile-workbench-scroll {
    min-height: 0;
    flex: 1 1 auto;
    width: 100%;
    max-width: 100%;
    padding-top: 2px;
    box-sizing: border-box;
    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;
    background: #fff;
  }

  .content[data-workspace="leads"] .mobile-workbench-scroll > .section-heading {
    margin-top: 4px;
  }


  .content[data-workspace="overview"] .metric-card {
    min-width: 0;
    min-height: 92px;
    padding: 10px;
    border-radius: 13px;
  }

  .content[data-workspace="overview"] .metric-heading {
    gap: 5px;
  }

  .content[data-workspace="overview"] .metric-heading > span:first-child {
    min-width: 0;
    overflow: hidden;
    font-size: 11px;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .content[data-workspace="overview"] .metric-icon {
    width: 24px;
    height: 24px;
    flex: 0 0 24px;
    border-radius: 7px;
    font-size: 12px;
  }

  .content[data-workspace="overview"] .metric-value,
  html[lang="ru"] .content[data-workspace="overview"] .metric-value {
    margin-top: 7px;
    overflow-wrap: anywhere;
    font-size: var(--mobile-title-size);
    line-height: 1.1;
    letter-spacing: -.02em;
  }

  .content[data-workspace="overview"] .metric-value.is-status {
    margin-top: 7px;
    font-size: var(--mobile-title-size);
    line-height: 1.1;
  }

  .content[data-workspace="overview"] .metric-card p {
    margin-top: 6px;
    overflow: hidden;
    font-size: 10px;
    line-height: 1.3;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .content[data-workspace="overview"] .panel,
  .content[data-workspace="overview"] .flow-card {
    padding: 12px;
    border-radius: 14px;
  }

  .content[data-workspace="overview"] .section-heading {
    gap: 8px;
  }

  .content[data-workspace="overview"] .section-heading h2 {
    margin-top: 2px;
    font-size: var(--mobile-title-size);
  }

  .content[data-workspace="overview"] .funnel-list,
  .content[data-workspace="overview"] .operations-grid,
  .content[data-workspace="overview"] .flow-track {
    margin-top: 10px;
  }

  .content[data-workspace="overview"] .funnel-list {
    gap: 7px;
  }

  .content[data-workspace="overview"] .funnel-row {
    grid-template-columns: 58px minmax(0, 1fr) 24px;
    gap: 6px;
    font-size: 11px;
  }

  .content[data-workspace="overview"] .funnel-row strong {
    font-size: 11px;
  }

  .content[data-workspace="overview"] .flow-track {
    gap: 6px;
  }

  .content[data-workspace="overview"] .flow-step {
    gap: 7px;
  }

  .content[data-workspace="overview"] .flow-number {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    font-size: 10px;
  }

  .content[data-workspace="overview"] .flow-step strong {
    font-size: 12px;
  }

  .content[data-workspace="overview"] .flow-step small {
    font-size: 10px;
  }

  /* Global mobile display-type ceiling. The effective-leads value on the
     overview is the reference size: no workbench statistic exceeds 19px. */
  .content[data-workspace] .metric-value,
  .content[data-workspace] .metric-value.is-status,
  .content[data-workspace] .queue-stats strong,
  .content[data-workspace] .readiness-head > span,
  .content[data-workspace] .order-metric-grid strong,
  .content[data-workspace] .order-detail-hero strong,
  .content[data-workspace] .campaign-control-summary strong,
  .content[data-workspace] .customer-order-total-preview strong,
  .content[data-workspace] .customer-order-card-footer > div:first-child > strong,
  .customer-order-dialog .customer-order-total-preview strong,
  .order-detail-dialog .order-detail-hero strong,
  html[lang="ru"] .content[data-workspace] .metric-value,
  html[lang="ru"] .content[data-workspace] .campaign-control-summary strong {
    max-width: 100%;
    font-size: var(--mobile-title-size) !important;
    line-height: 1.15;
    overflow-wrap: anywhere;
  }

  .dialog-heading h2,
  .workspace .dialog-heading h2 {
    font-size: var(--mobile-title-size);
  }

  /* Compact mobile orders header and filters. Search + clear form the first
     row; status, currency and period share the second row. */
  .content[data-workspace="orders"] .mobile-workbench-fixed {
    gap: 5px;
    padding-bottom: 6px;
  }

  .content[data-workspace="orders"] .order-workbench-heading {
    min-height: 0;
    padding: 7px;
    gap: 6px;
  }

  .content[data-workspace="orders"] .order-workbench-heading .eyebrow {
    font-size: 9px;
  }

  .content[data-workspace="orders"] .order-workbench-heading h2 {
    margin-top: 1px;
    font-size: var(--mobile-title-size);
  }

  .content[data-workspace="orders"] .order-heading-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
  }

  .content[data-workspace="orders"] .order-heading-actions .primary-button {
    grid-column: auto;
  }

  .content[data-workspace="orders"] .order-heading-actions > button {
    min-width: 0;
    min-height: 32px;
    padding: 5px 3px;
    font-size: 10px;
    white-space: nowrap;
  }

  .content[data-workspace="orders"] .order-workbench-toolbar {
    padding: 5px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
    align-items: end;
    border-radius: 11px;
  }

  .content[data-workspace="orders"] .order-search-field {
    grid-column: 1 / 3;
    grid-row: 1;
  }

  .content[data-workspace="orders"] .order-filter-clear {
    grid-column: 3;
    grid-row: 1;
  }

  .content[data-workspace="orders"] .order-workbench-toolbar label:not(.order-search-field) {
    grid-row: 2;
  }

  .content[data-workspace="orders"] .order-workbench-toolbar label {
    min-width: 0;
    gap: 1px;
    font-size: 9px;
    line-height: 1.2;
  }

  .content[data-workspace="orders"] .order-workbench-toolbar input,
  .content[data-workspace="orders"] .order-workbench-toolbar select,
  .content[data-workspace="orders"] .order-filter-clear {
    width: 100%;
    min-width: 0;
    height: 34px;
    min-height: 34px;
    padding: 4px 6px;
    border-radius: 8px;
  }

  .content[data-workspace="orders"] .order-filter-clear {
    font-size: 10px;
    line-height: 1.15;
  }

  .content[data-workspace="orders"] .order-metric-grid {
    padding: 7px;
    gap: 6px;
  }

  .content[data-workspace="orders"] .order-metric-grid article {
    padding: 8px;
    gap: 3px;
    border-radius: 10px;
  }

  .content[data-workspace="orders"] .order-workbench-summary {
    margin: 7px 0 0;
    padding: 7px;
  }

  .content[data-workspace="orders"] .order-table-wrap {
    padding: 6px 0 10px;
  }

  /* Final mobile control and title scale. Keep record text and conversations
     unchanged; only workbench selectors and first-level titles are reduced. */
  .content[data-workspace] input[type="search"],
  .content[data-workspace] select,
  .content[data-workspace] .lead-filter-clear,
  .content[data-workspace] .order-filter-clear,
  .content[data-workspace] .campaign-toolbar button,
  .content[data-workspace] .customer-order-toolbar button {
    font-size: 13px !important;
    line-height: 1.2;
  }

  .content[data-workspace] .section-heading h2,
  .content[data-workspace] .order-workbench-heading h2,
  .content[data-workspace] .customer-portal-heading h2,
  .content[data-workspace] .backup-center-heading h2,
  .content[data-workspace] .support-agent-heading h2,
  .content[data-workspace] .dialog-heading h2,
  html[lang="en"] .content[data-workspace] .section-heading h2,
  html[lang="ru"] .content[data-workspace] .section-heading h2,
  html[lang="kk"] .content[data-workspace] .section-heading h2 {
    font-size: 13.5px !important;
    line-height: 1.25;
  }

  /* Search text only: 20% smaller than the 13px mobile filter baseline.
     Selects, filter buttons, titles and all result content remain unchanged. */
  .content[data-workspace] input[type="search"] {
    font-size: 10.5px !important;
  }

  /* The four compact mobile workbenches shown in the review use one 12px
     ceiling for headings, prominent values, customer names and main actions. */
  .content[data-workspace="backups"] #backups h2,
  .content[data-workspace="backups"] #backups h3,
  .content[data-workspace="backups"] #backups strong,
  .content[data-workspace="backups"] #backups button,
  .content[data-workspace="backups"] #backups select,
  .content[data-workspace="support-agents"] #support-agents h2,
  .content[data-workspace="support-agents"] #support-agents h3,
  .content[data-workspace="support-agents"] #support-agents strong,
  .content[data-workspace="support-agents"] #support-agents button,
  .content[data-workspace="leads"] #leads h2,
  .content[data-workspace="leads"] #leads h3,
  .content[data-workspace="leads"] #leads strong,
  .content[data-workspace="leads"] #leads button,
  .content[data-workspace="leads"] #leads select {
    font-size: 12px !important;
    line-height: 1.25;
  }

  .content[data-workspace="backups"] #backups .backup-status-grid strong,
  .content[data-workspace="support-agents"] #support-agents .support-agent-summary strong,
  .content[data-workspace="leads"] #leads .customer-chat-link strong {
    font-size: 12px !important;
  }
}

/* WhatsApp template workbench typography intentionally stays compact even
   when the global workspace typography is enlarged elsewhere. */
.section-heading.whatsapp-template-heading h2 { font-size: 16px; }

body.session-expired .app-shell {
  pointer-events: none;
  user-select: none;
  filter: blur(1px) saturate(.72);
}
.manual-lead-open { min-height: 38px; padding-inline: 14px; white-space: nowrap; }
.manual-lead-dialog { width: min(720px, calc(100vw - 28px)); max-width: none; max-height: calc(100dvh - 28px); padding: 0; overflow-y: auto; }
.manual-lead-dialog form { padding: 22px; display: grid; gap: 14px; }
.manual-lead-dialog label { min-width: 0; display: grid; gap: 6px; color: #405b62; font-size: 11px; font-weight: 850; }
.manual-lead-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
.manual-lead-grid input, .manual-lead-grid select, .manual-lead-dialog textarea { width: 100%; }
.manual-lead-safety { padding: 11px 13px; border: 1px solid #cce9df; border-radius: 12px; color: #176257; background: #effaf6; font-size: 11px; font-weight: 750; line-height: 1.55; }
.manual-lead-consent-required { color: #8c3c31 !important; }
.manual-lead-consent-required input { border-color: #d38a7f; background: #fff8f6; }
.campaign-budget-dialog { width: min(560px, calc(100vw - 28px)); padding: 0; border: 0; border-radius: 20px; color: #093e4c; background: #fff; box-shadow: 0 28px 90px rgba(1,50,66,.28); }
.campaign-budget-dialog::backdrop { background: rgba(1,37,49,.42); backdrop-filter: blur(4px); }
.campaign-budget-dialog form { padding: 20px; display: grid; gap: 14px; }
.campaign-budget-dialog h3 { margin: 3px 0 0; }
.campaign-budget-dialog label { display: grid; gap: 6px; color: var(--muted); font-size: 11px; font-weight: 800; }
.campaign-budget-dialog .dialog-actions { display: flex; justify-content: flex-end; gap: 8px; }
@media (max-width: 600px) {
  .content[data-workspace="whatsapp-templates"] .section-heading.whatsapp-template-heading h2 { font-size: 12px !important; }
  .content[data-workspace="whatsapp-templates"] .whatsapp-template-toolbar input[type="search"],
  .content[data-workspace="whatsapp-templates"] .whatsapp-template-toolbar select,
  .content[data-workspace="whatsapp-templates"] .whatsapp-template-toolbar button { font-size: 10px !important; }
}

@media (max-width: 860px) {
  .inventory-metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .inventory-metric-grid article:last-child { grid-column: 1 / -1; }
  .inventory-sales-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .inventory-toolbar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .inventory-search-field { grid-column: 1 / -1; }
  .inventory-content-grid { grid-template-columns: 1fr; }
  .inventory-ledger { margin-top: 0; }
}

@media (max-width: 600px) {
  .content[data-workspace="inventory"] { height: 100dvh; max-height: 100dvh; overflow: hidden; }
  .content[data-workspace="inventory"] #inventory.mobile-workbench-active { height: 100%; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
  .content[data-workspace="inventory"] .mobile-workbench-fixed { flex: 0 0 auto; display: grid; gap: 6px; padding: 7px; border: 1px solid #c9e1e3; border-radius: 13px; background: rgba(244,250,250,.98); box-shadow: none; z-index: 6; }
  .content[data-workspace="inventory"] .mobile-workbench-scroll { min-height: 0; flex: 1 1 auto; display: block; overflow-y: auto; overscroll-behavior: contain; }
  .inventory-workbench-heading { min-height: 0; padding: 8px; display: grid; gap: 6px; border: 0; border-radius: 10px; }
  .inventory-workbench-heading h2 { font-size: 12px !important; }
  .inventory-workbench-heading .muted { display: none; }
  .inventory-heading-actions { width: 100%; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; }
  .inventory-heading-actions .primary-button { grid-column: 1 / -1; }
  .inventory-heading-actions button { min-height: 34px; padding: 6px 8px; font-size: 10px !important; }
  .inventory-toolbar { margin: 0; padding: 7px; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; }
  .inventory-toolbar label { gap: 3px; font-size: 8px; }
  .inventory-toolbar input, .inventory-toolbar select { min-height: 34px; padding: 6px 7px; font-size: 10px !important; }
  .inventory-toolbar button { min-height: 34px; font-size: 10px !important; }
  .inventory-metric-grid { padding: 8px; gap: 6px; }
  .inventory-metric-grid article { padding: 8px; border-radius: 10px; }
  .inventory-metric-grid strong { font-size: 15px; }
  .inventory-sales-analysis { margin: 0 8px; padding: 9px; border-radius: 11px; }
  .inventory-sales-heading h3 { font-size: 12px; }
  .inventory-sales-heading label { min-width: 118px; }
  .inventory-sales-heading select { min-height: 32px; padding: 5px 28px 5px 7px; font-size: 9px !important; }
  .inventory-sales-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; }
  .inventory-sales-metrics article { padding: 7px; }
  .inventory-sales-metrics strong { font-size: 12px; }
  .inventory-sales-table-wrap table { min-width: 860px; }
  .inventory-summary { margin: 6px 8px 0; font-size: 8px; }
  .inventory-content-grid { padding: 0 8px 12px; gap: 8px; }
  .inventory-table-wrap table { min-width: 760px; }
  .inventory-ledger { padding: 9px; }
  .product-editor-dialog, .inventory-movement-dialog, .order-editor-dialog { width: calc(100vw - 14px); max-height: calc(100dvh - 18px); padding: 12px; }
  .product-editor-grid, .inventory-movement-grid, .order-editor-grid { grid-template-columns: 1fr; gap: 7px; }
  .inventory-movement-note { grid-column: auto; }
  .order-product-picker { padding: 9px; }
  .order-product-picker-heading { display: grid; gap: 3px; }
  .order-product-picker-controls { grid-template-columns: minmax(0, 1fr) 70px; }
  .order-product-picker-controls button { grid-column: 1 / -1; }
  .order-selected-product { grid-template-columns: repeat(3, minmax(0, 1fr)) 32px; }
  .order-selected-product > div:first-child { grid-column: 1 / -1; }
  .order-selected-product .order-line-total { grid-column: 1 / 4; text-align: left; }
  .order-selected-product .icon-button { grid-column: 4; grid-row: 2; }
}

/* 20260829.8 conversation viewport compaction.
   Give the message history the majority of the screen while keeping every
   customer-facing action explicit and keeping phone touch targets usable. */
.chat-header {
  min-height: 54px;
  padding: 6px 8px;
  gap: 8px;
}
.chat-header small { margin-top: 2px; line-height: 1.3; }
.chat-identity { gap: 7px; }
.chat-controls { --chat-control-height: 38px; gap: 5px; }
.chat-controls #customer-voice-call,
.chat-controls #customer-reengage:not(.hidden) { padding-inline: 7px; }
.chat-assignment-control { padding: 2px 3px 2px 8px; border-radius: 10px; }
.chat-assignment-control .small-button { padding: 3px 7px; }
.chat-messages { padding: 12px clamp(12px, 2vw, 22px); gap: 9px; }
.reply-composer { padding: 7px 10px 8px; }
.ai-reply-suggestion { margin-bottom: 5px; padding: 4px 6px; border-radius: 10px; }
.ai-reply-suggestion header { min-height: 32px; gap: 6px; }
.ai-reply-suggestion-header-actions { gap: 4px; }
.ai-reply-suggestion-header-actions button { min-height: 30px; padding: 4px 7px; }
.ai-reply-suggestion-body { margin-top: 4px; padding-top: 5px; gap: 5px 7px; }
.ai-reply-suggestion-actions { gap: 4px; }
.ai-reply-suggestion-actions button { min-height: 30px; padding: 4px 7px; }
.reply-draft-translation-tools { margin-bottom: 5px; gap: 5px; }
.reply-draft-translation-tools select,
.reply-draft-translation-tools button { min-height: 32px; padding-block: 4px; }
.reply-composer textarea {
  height: 78px;
  min-height: 78px;
  padding: 9px 11px;
  border-radius: 11px;
  line-height: 1.45;
}
.reply-actions { margin-top: 5px; gap: 6px; }
.reply-send-controls { gap: 5px; }
.reply-send-controls > button,
.reply-media-button,
.reply-voice-button { min-height: 42px; }
.reply-media-button { padding: 4px 8px; gap: 5px; border-radius: 12px; }
.reply-media-button span { width: 28px; height: 28px; border-radius: 9px; }
.reply-voice-button { padding: 4px 10px 4px 6px; gap: 6px; border-radius: 12px; }
.reply-voice-icon { width: 30px; height: 30px; border-radius: 9px; }
.reply-voice-icon svg { width: 18px; height: 18px; }

/* A narrow desktop window and a tablet now use the same one-pane navigation
   model as a phone. This removes the former 320px list + 680px chat stack and
   makes the conversation fit the actual visible viewport. */
@media (min-width: 601px) and (max-width: 860px) {
  body:has(.content[data-workspace="inbox"]) {
    width: 100%;
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
  }
  .content[data-workspace="inbox"] {
    position: fixed;
    inset: 0;
    z-index: 1;
    width: 100%;
    height: 100dvh;
    max-height: 100dvh;
    min-height: 0;
    padding: 4px;
    overflow: hidden;
  }
  .content[data-workspace="inbox"] > .main-grid,
  .content[data-workspace="inbox"] #inbox.inbox-panel {
    height: 100%;
    max-height: 100%;
    min-height: 0;
  }
  .content[data-workspace="inbox"] .inbox-layout {
    flex: 1 1 0;
    height: 0;
    min-height: 0;
    grid-template-columns: minmax(0, 1fr);
    overflow: hidden;
  }
  .inbox-panel > .section-heading {
    min-height: 0;
    padding: 4px;
    gap: 0;
  }
  .inbox-panel > .section-heading > div:first-child { display: none; }
  .inbox-filters { width: 100%; padding: 3px; gap: 4px; }
  .inbox-search-input { flex: 1 1 280px; min-width: 0; min-height: 36px; }
  .inbox-filters select,
  .inbox-filters .small-button { min-height: 36px; }
  .conversation-list { height: 100%; max-height: none; border-right: 0; }
  .chat-pane,
  .chat-active { height: 100%; min-height: 0; }
  .chat-back-button { display: grid; place-items: center; }
  .mobile-customer-profile-button {
    min-height: 36px;
    padding: 5px 8px;
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    white-space: nowrap;
  }
  body.mobile-conversation-open .inbox-panel > .section-heading,
  body.mobile-conversation-open .conversation-list { display: none; }
  body:not(.mobile-conversation-open) .chat-pane,
  body:not(.mobile-conversation-open) .customer-context,
  body.mobile-conversation-open .customer-context { display: none; }
  body.mobile-context-open { overflow: hidden; }
  body.mobile-context-open .customer-context {
    position: fixed;
    inset: 0;
    z-index: 48;
    display: block;
    width: 100%;
    height: 100dvh;
    max-height: none;
    padding-bottom: 16px;
    border: 0;
    background: #f5fafa;
  }
  .mobile-context-close {
    width: 36px;
    height: 36px;
    padding: 0;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border: 1px solid var(--line);
    border-radius: 10px;
    color: #07566d;
    background: #eef8f7;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
  }
  /* superseded: inbox FAB now inherits unified glass styles */
  body:has(.content[data-workspace="inbox"]) .topbar-title,
  body:has(.content[data-workspace="inbox"]) .top-actions { display: none; }
  body.mobile-conversation-open .reply-actions { padding-left: 50px; }
  body.mobile-conversation-open .reply-draft-translation-tools small { display: none; }
}

@media (max-width: 600px) {
  body.mobile-conversation-open .inbox-panel > .section-heading { display: none; }
  .chat-header,
  html[lang="ru"] .chat-header {
    min-height: 0;
    padding: 2px 5px;
    gap: 2px;
  }
  .chat-identity { min-height: 40px; gap: 5px; }
  .chat-back-button { width: 38px; height: 38px; }
  .mobile-customer-profile-button { min-height: 36px; padding: 5px 7px; }
  .chat-header strong { font-size: 14px; }
  .chat-header small { margin-top: 1px; font-size: 10px; line-height: 1.2; }
  .chat-controls {
    --chat-control-height: 42px;
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 4px;
  }
  .chat-controls:has(#customer-reengage:not(.hidden)) {
    grid-template-columns: 72px minmax(0, 1fr) 74px;
  }
  .chat-controls #customer-voice-call {
    grid-column: 1;
    grid-row: 1;
    padding-inline: 4px;
    font-size: 10px;
  }
  .chat-controls .chat-assignment-control {
    grid-column: 2;
    grid-row: 1;
  }
  .chat-controls #customer-reengage:not(.hidden) {
    grid-column: 3;
    grid-row: 1;
    width: auto;
    min-width: 0;
    padding-inline: 4px;
    font-size: 9px;
    line-height: 1.12;
    white-space: normal;
  }
  html[lang="ru"] .chat-controls,
  html[lang="ru"] .chat-controls:has(#customer-reengage:not(.hidden)) {
    grid-template-columns: 72px minmax(0, 1fr) 74px;
    gap: 3px;
  }
  html[lang="ru"] .chat-controls:not(:has(#customer-reengage:not(.hidden))) {
    grid-template-columns: 72px minmax(0, 1fr);
  }
  .chat-messages { padding: 10px 8px; gap: 8px; }
  .reply-composer { padding: 6px 8px max(6px, env(safe-area-inset-bottom)); }
  .ai-reply-suggestion { margin-bottom: 4px; padding: 4px 5px; }
  .ai-reply-suggestion-header-actions button,
  .ai-reply-suggestion-actions button { min-height: 42px; }
  .reply-draft-translation-tools { margin-bottom: 4px; gap: 4px; }
  body.mobile-conversation-open .reply-draft-translation-tools small { display: none; }
  .reply-draft-translation-tools select,
  .reply-draft-translation-tools button { min-height: 42px; }
  .reply-composer textarea {
    height: 64px;
    min-height: 64px;
    padding: 8px 10px;
  }
  body.mobile-conversation-open .reply-actions { padding-left: 62px; }
  .reply-actions { margin-top: 4px; gap: 3px; }
  .reply-send-controls { gap: 4px; }
  .reply-send-controls > button,
  .reply-media-button,
  .reply-voice-button { min-height: 44px; }
  .reply-voice-icon,
  .reply-media-button span { width: 28px; height: 28px; }
  .reply-voice-copy small { display: none; }
}

/* Phone conversation finishing pass — FAB visual is shared globally;
   inbox only aligns it to the reply action baseline. */
@media (max-width: 860px) {
  .content[data-workspace="inbox"] {
    padding-bottom: 0 !important;
  }
  body.mobile-conversation-open #inbox.inbox-panel {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
  }
  body:has(.content[data-workspace="inbox"]) .topbar {
    inset: auto auto max(6px, var(--inbox-action-safe-bottom)) max(8px, env(safe-area-inset-left));
    width: 48px;
    height: 48px;
  }
  body:has(.content[data-workspace="inbox"]) .topbar .menu-button {
    width: 48px;
    height: 48px;
    padding: 11px 10px;
  }
  body:has(.content[data-workspace="inbox"]) .topbar-title,
  body:has(.content[data-workspace="inbox"]) .top-actions {
    display: none;
  }
  body.mobile-conversation-open .reply-actions,
  body.mobile-conversation-open .reply-composer.reply-window-closed .reply-actions {
    min-height: 48px;
    padding-left: 56px;
    align-items: stretch;
    justify-content: flex-end;
  }
  .reply-send-controls {
    width: 100%;
    margin-left: 0;
  }
  .reply-composer {
    padding-bottom: max(6px, var(--inbox-action-safe-bottom));
  }
  .reply-send-controls > button,
  .reply-media-button,
  .reply-voice-button {
    min-height: 44px;
  }
}

@media (min-width: 601px) and (max-width: 860px) {
  body:has(.content[data-workspace="inbox"]) .topbar {
    inset: auto auto max(9px, var(--inbox-action-safe-bottom)) max(8px, env(safe-area-inset-left));
  }
}

/* The phone header is one physical row: customer identity on the left and
   call/assignment/re-contact controls on the right. Full labels remain in the
   DOM for accessibility; only the tight visual treatment changes. */
@media (max-width: 600px) {
  .chat-header,
  html[lang="ru"] .chat-header {
    min-height: 46px;
    padding: 2px 5px;
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(146px, .92fr);
    grid-template-rows: 42px;
    align-items: center;
    gap: 4px;
  }
  .chat-identity {
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
    min-height: 42px;
    height: 42px;
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) 42px;
    align-items: center;
    gap: 4px;
  }
  .chat-identity > span {
    min-width: 0;
    overflow: hidden;
  }
  .chat-back-button {
    width: 34px;
    height: 38px;
    border-radius: 10px;
    font-size: 24px;
  }
  .mobile-customer-profile-button {
    width: 42px;
    max-width: 42px;
    min-height: 38px;
    padding: 3px 2px;
    overflow: hidden;
    font-size: 8px;
    line-height: 1.05;
    text-overflow: ellipsis;
    white-space: normal;
  }
  .chat-header strong { font-size: 11px; }
  .chat-header small { margin-top: 1px; font-size: 8px; line-height: 1.1; }
  .chat-controls,
  .chat-controls:has(#customer-reengage:not(.hidden)),
  html[lang="ru"] .chat-controls,
  html[lang="ru"] .chat-controls:has(#customer-reengage:not(.hidden)) {
    --chat-control-height: 42px;
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
    width: 100%;
    height: 42px;
    display: grid;
    grid-template-columns: 38px minmax(48px, 1fr) 44px;
    align-items: stretch;
    gap: 3px;
  }
  .chat-controls:not(:has(#customer-reengage:not(.hidden))),
  html[lang="ru"] .chat-controls:not(:has(#customer-reengage:not(.hidden))) {
    grid-template-columns: 38px minmax(0, 1fr);
  }
  .chat-controls #customer-voice-call {
    grid-column: 1;
    grid-row: 1;
    width: 38px;
    min-width: 38px;
    height: 42px;
    padding: 0;
    display: grid;
    place-items: center;
    overflow: hidden;
  }
  .chat-call-icon { font-size: 15px; line-height: 1; }
  .chat-call-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .chat-controls .chat-assignment-control {
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
    height: 42px;
    padding: 2px 2px 2px 5px;
    grid-template-columns: minmax(0, 1fr) 26px;
    grid-template-rows: 1fr;
    column-gap: 2px;
  }
  .chat-assignment-control > span { display: none; }
  .chat-assignment-control > strong {
    grid-column: 1;
    grid-row: 1;
    font-size: 9px;
    line-height: 1.1;
  }
  .chat-assignment-control .small-button {
    grid-column: 2;
    grid-row: 1;
    width: 26px;
    min-width: 26px;
    padding: 0;
    overflow: hidden;
    font-size: 0;
  }
  .chat-assignment-control .small-button::before {
    content: "✎";
    font-size: 13px;
    line-height: 1;
  }
  .chat-controls #customer-reengage:not(.hidden) {
    grid-column: 3;
    grid-row: 1;
    width: 44px;
    min-width: 44px;
    height: 42px;
    padding: 2px;
    overflow: hidden;
    font-size: 8px;
    line-height: 1.05;
    white-space: normal;
  }
}

@page { size: A4 portrait; margin: 12mm; }
@media print {
  html, body { width: 210mm; min-height: 297mm; margin: 0 !important; padding: 0 !important; color: #102f38 !important; background: #fff !important; }
  body > *:not(.order-print-sheet) { display: none !important; }
  .order-print-sheet { width: 100%; min-height: 270mm; display: flex !important; flex-direction: column; font-family: Inter, Arial, "Helvetica Neue", sans-serif; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .print-order-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
  .print-order-brand { display: flex; align-items: center; gap: 12px; }.print-order-brand img { width: 58px; height: 58px; object-fit: contain; border: 1px solid #d5e4e5; border-radius: 13px; }.print-order-brand div { display: grid; gap: 4px; }.print-order-brand strong { color: #075a70; font-size: 22px; letter-spacing: .03em; }.print-order-brand span { color: #658087; font-size: 9px; letter-spacing: .09em; }
  .print-order-title { text-align: right; }.print-order-title h1 { margin: 0; color: #063f50; font-size: 24px; }.print-order-title span { color: #2b9a8d; font-size: 10px; font-weight: 800; letter-spacing: .2em; }
  .print-order-rule { height: 4px; margin: 14px 0 18px; border-radius: 999px; background: linear-gradient(90deg, #067b9e, #20bd94); }
  .print-order-meta { display: grid; grid-template-columns: 1.3fr 1fr .8fr .55fr; gap: 8px; }.print-order-meta div { padding: 10px; display: grid; gap: 5px; border: 1px solid #d8e7e8; border-radius: 9px; background: #f6fbfa; }.print-order-meta small, .print-order-customer small, .print-order-source small { color: #71868b; font-size: 7.5px; font-weight: 800; letter-spacing: .04em; }.print-order-meta strong { font-size: 10px; }
  .print-order-customer { margin-top: 16px; }.print-order-customer h2, .print-order-detail h2 { margin: 0 0 8px; color: #087b91; font-size: 10px; letter-spacing: .08em; }.print-order-customer > div { padding: 11px 12px; display: grid; grid-template-columns: 1fr 1fr; gap: 20px; border: 1px solid #d8e7e8; border-radius: 9px; }.print-order-customer span, .print-order-source span { display: grid; gap: 5px; }.print-order-customer strong, .print-order-source strong { font-size: 10px; }
  .print-order-table { margin-top: 18px; border-collapse: separate; border-spacing: 0; border: 1px solid #cddfe1; border-radius: 9px; overflow: hidden; }.print-order-table th { padding: 9px 8px; color: #fff; border: 0; background: #086981; font-size: 7px; letter-spacing: .03em; }.print-order-table td { padding: 10px 8px; border-bottom: 1px solid #e2ebec; font-size: 9px; }.print-order-table tbody tr:last-child td { border-bottom: 0; }.print-order-table th:nth-child(1), .print-order-table td:nth-child(1) { width: 8%; text-align: center; }.print-order-table th:nth-child(3), .print-order-table td:nth-child(3) { width: 10%; text-align: center; }.print-order-table th:nth-child(4), .print-order-table td:nth-child(4), .print-order-table th:nth-child(5), .print-order-table td:nth-child(5) { width: 18%; text-align: right; }
  .print-order-total { display: flex; justify-content: flex-end; }.print-order-total div { width: 43%; padding: 13px 14px; display: flex; align-items: center; justify-content: space-between; color: #fff; border-radius: 0 0 9px 9px; background: #063f50; }.print-order-total span { font-size: 8px; font-weight: 800; }.print-order-total strong { font-size: 16px; }
  .print-order-source { margin-top: 16px; padding: 11px 12px; display: grid; grid-template-columns: .7fr 1.3fr; gap: 20px; border-radius: 9px; background: #f2f8f7; }
  .print-order-signatures { margin-top: 36px; display: grid; grid-template-columns: 1fr 1fr; gap: 50px; }.print-order-signatures div { height: 45px; display: flex; align-items: flex-end; border-bottom: 1px solid #8ca1a6; }.print-order-signatures span { padding-bottom: 5px; color: #71868b; font-size: 8px; }
  .print-order-footer { margin-top: auto; padding-top: 12px; display: flex; justify-content: space-between; color: #789096; border-top: 1px solid #dce7e8; font-size: 7.5px; }
}
