:root {
  --bg: #f5f7fb;
  --panel: #ffffff;
  --panel-soft: #f8fafc;
  --ink: #141c2b;
  --muted: #66758a;
  --line: #dde5ee;
  --line-strong: #c6d2df;
  --teal: #0b746d;
  --blue: #2d5bd6;
  --amber: #b96c07;
  --red: #b42318;
  --green: #087a42;
  --slate: #2f3c4f;
  --soft-teal: #e6f4f1;
  --soft-blue: #edf3ff;
  --soft-amber: #fff6e7;
  --soft-red: #fff0ed;
  --sidebar: #101a26;
  --sidebar-soft: #182638;
  --sidebar-rail-width: 72px;
  --sidebar-expanded-width: 264px;
  --shadow: 0 18px 46px rgba(25, 39, 62, 0.1);
  --shadow-soft: 0 8px 22px rgba(25, 39, 62, 0.07);
  --ring: 0 0 0 4px rgba(11, 116, 109, 0.12);
  --radius: 8px;
  --radius-sm: 6px;
}

.account-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(340px, 0.85fr);
  gap: 18px;
  align-items: start;
}

.account-panel {
  overflow: hidden;
}

.account-panel:first-child {
  grid-column: 1 / -1;
}

.account-kicker {
  display: inline-flex;
  margin-bottom: 7px;
  color: var(--teal);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.account-grid {
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(340px, 1.1fr);
  gap: 28px;
  align-items: start;
}

.account-explainer {
  padding: 20px;
  color: #dbeafe;
  background: linear-gradient(145deg, #10233b, #123c45);
  border: 1px solid rgba(45, 212, 191, 0.2);
  border-radius: 14px;
  box-shadow: 0 16px 38px rgba(15, 23, 42, 0.14);
}

.account-explainer strong {
  display: block;
  color: #fff;
  font-size: 17px;
}

.account-explainer ol {
  display: grid;
  gap: 11px;
  margin: 18px 0;
  padding-left: 22px;
}

.account-explainer p {
  margin: 0;
  color: rgba(219, 234, 254, 0.76);
  font-size: 12px;
  line-height: 1.7;
}

.account-form {
  display: grid;
  gap: 14px;
  max-width: 620px;
}

.account-form label {
  display: grid;
  gap: 7px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
}

.account-form .btn {
  justify-self: start;
  min-width: 210px;
}

.account-login-body {
  display: grid;
  place-items: center;
  min-height: 360px;
}

.account-login-body .account-form {
  width: min(460px, 100%);
  padding: 24px;
  background: #f8fbff;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.account-form-status {
  min-height: 18px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

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

.account-connection-grid article {
  display: grid;
  gap: 6px;
  padding: 16px;
  background: #f8fbff;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.account-connection-grid span,
.account-connection-grid small,
.account-device-card span {
  color: var(--muted);
  font-size: 12px;
}

.account-connection-grid strong {
  color: var(--teal);
  font-size: 18px;
}

.account-actions {
  margin-top: 14px;
}

.account-device-list {
  display: grid;
  gap: 10px;
}

.account-device-disclosure {
  overflow: hidden;
  background: #f8fbff;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.account-device-disclosure > summary {
  display: flex;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  padding: 14px 16px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.account-device-disclosure > summary::-webkit-details-marker {
  display: none;
}

.account-device-summary-copy {
  display: grid;
  gap: 5px;
}

.account-device-summary-copy small,
.account-device-group-title span {
  color: var(--muted);
  font-size: 12px;
}

.account-device-summary-action::after {
  display: inline-flex;
  align-items: center;
  min-width: 76px;
  justify-content: center;
  padding: 7px 12px;
  color: var(--teal);
  font-size: 13px;
  font-weight: 700;
  content: '展开管理';
  background: #ffffff;
  border: 1px solid #b9ded9;
  border-radius: 999px;
}

.account-device-disclosure[open] .account-device-summary-action::after {
  content: '收起';
}

.account-device-scroll {
  display: grid;
  gap: 18px;
  max-height: 390px;
  padding: 14px 16px 16px;
  overflow: auto;
  border-top: 1px solid var(--line);
  scrollbar-gutter: stable;
}

.account-device-group {
  display: grid;
  gap: 10px;
}

.account-device-group-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.account-device-card {
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  padding: 13px 15px;
  background: #f8fbff;
  border: 1px solid var(--line);
  border-radius: 11px;
}

.account-device-card > div {
  display: grid;
  gap: 5px;
}

.account-device-card.revoked {
  opacity: 0.62;
}

@media (max-width: 980px) {
  .account-layout,
  .account-grid,
  .account-connection-grid {
    grid-template-columns: 1fr;
  }

  .account-device-scroll {
    max-height: 330px;
  }
}

[hidden] {
  display: none !important;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(180deg, #f9fbff 0%, var(--bg) 320px, #eef3f8 100%);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  line-height: 1.45;
}

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

button {
  cursor: pointer;
}

button,
a,
input,
select,
textarea {
  transition: border-color 160ms ease, background-color 160ms ease, color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 0;
  box-shadow: var(--ring);
}

.app {
  display: grid;
  grid-template-columns: var(--sidebar-rail-width) minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  z-index: 30;
  width: var(--sidebar-rail-width);
  height: 100vh;
  overflow: hidden;
  padding: 20px 14px;
  color: #eef6f8;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), transparent 220px),
    linear-gradient(180deg, var(--sidebar), #0d1722 100%);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.04);
  transition: width 190ms ease, box-shadow 190ms ease;
}

.sidebar:hover,
.sidebar.is-expanded {
  width: var(--sidebar-expanded-width);
  box-shadow: 18px 0 36px rgba(11, 20, 31, 0.2), inset -1px 0 0 rgba(255, 255, 255, 0.04);
}

.brand {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  width: calc(var(--sidebar-expanded-width) - 28px);
  padding: 12px 6px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.brand-monogram {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  overflow: visible;
  background: transparent;
  border: 0;
}

.brand-monogram img {
  display: block;
  width: 40px;
  height: 40px;
  object-fit: contain;
  filter:
    brightness(1.4)
    saturate(1.08)
    drop-shadow(0 0 1px rgba(255, 255, 255, 1))
    drop-shadow(0 0 5px rgba(255, 255, 255, 0.32))
    drop-shadow(0 2px 5px rgba(0, 0, 0, 0.24));
}

.brand-copy {
  display: grid;
  gap: 5px;
  min-width: 0;
  white-space: nowrap;
}

.brand-copy strong {
  font-size: 19px;
  line-height: 1.2;
  letter-spacing: 0;
}

.brand-copy span {
  color: rgba(238, 246, 248, 0.66);
  font-size: 12px;
}

.nav {
  display: grid;
  grid-auto-rows: 44px;
  gap: 7px;
  margin-top: 20px;
}

.nav button,
.home-link {
  display: grid;
  grid-template-columns: 28px 0 0;
  align-items: center;
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0 10px;
  overflow: hidden;
  color: rgba(238, 246, 248, 0.78);
  text-align: left;
  text-decoration: none;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-weight: 720;
}

.sidebar:hover .nav button,
.sidebar.is-expanded .nav button,
.sidebar:hover .home-link,
.sidebar.is-expanded .home-link {
  grid-template-columns: 28px minmax(0, 1fr) auto;
  width: 100%;
  padding: 0 11px;
  overflow: visible;
}

.brand-copy,
.nav button > span:not(.mark),
.home-link > span:not(.mark),
.sidebar-footer {
  opacity: 0;
  pointer-events: none;
  white-space: nowrap;
  transform: translateX(-7px);
  transition: opacity 120ms ease, transform 160ms ease;
}

.sidebar:hover .brand-copy,
.sidebar.is-expanded .brand-copy,
.sidebar:hover .nav button > span:not(.mark),
.sidebar.is-expanded .nav button > span:not(.mark),
.sidebar:hover .home-link > span:not(.mark),
.sidebar.is-expanded .home-link > span:not(.mark),
.sidebar:hover .sidebar-footer,
.sidebar.is-expanded .sidebar-footer {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
  transition-delay: 45ms;
}

.nav button:hover,
.home-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.075);
  border-color: rgba(255, 255, 255, 0.08);
}

.nav button.active {
  color: #fff;
  background: linear-gradient(135deg, rgba(20, 184, 166, 0.18), rgba(45, 91, 214, 0.14));
  border-color: rgba(148, 163, 184, 0.2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.nav .mark {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  color: #b9fff3;
  font-size: 12px;
  font-weight: 800;
  background: rgba(15, 118, 110, 0.24);
  border: 1px solid rgba(185, 255, 243, 0.22);
  border-radius: var(--radius-sm);
}

.count-pill {
  min-width: 24px;
  padding: 2px 7px;
  color: #0c1723;
  font-size: 12px;
  font-weight: 800;
  text-align: center;
  background: #c7f9e9;
  border-radius: 999px;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

.sidebar-footer {
  position: absolute;
  right: 14px;
  bottom: 14px;
  left: 14px;
  display: grid;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.sidebar-footer button {
  min-height: 38px;
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius);
  font-weight: 800;
}

.sidebar-footer button:hover {
  background: rgba(255, 255, 255, 0.1);
}

.main {
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 20px 28px;
  background: rgba(248, 251, 255, 0.88);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.72), 0 10px 28px rgba(31, 45, 70, 0.05);
}

.title-block h1 {
  margin: 0;
  font-size: 25px;
  line-height: 1.2;
  letter-spacing: 0;
}

.title-block p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.health-text.ok {
  color: var(--green);
  font-weight: 800;
}

.health-text.bad {
  color: var(--red);
  font-weight: 800;
}

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

.connect-channel-menu {
  position: relative;
}

.connect-channel-menu summary {
  list-style: none;
  cursor: pointer;
}

.connect-channel-menu summary::-webkit-details-marker {
  display: none;
}

.connect-channel-menu summary::after {
  content: "⌄";
  font-size: 13px;
  line-height: 1;
}

.connect-channel-menu[open] summary {
  border-color: rgba(11, 116, 109, 0.42);
  box-shadow: var(--ring);
}

.connect-channel-options {
  position: absolute;
  z-index: 100;
  top: calc(100% + 6px);
  right: 0;
  display: grid;
  width: 218px;
  padding: 6px;
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.16);
}

.connect-channel-options button {
  min-height: 36px;
  padding: 0 10px;
  color: var(--slate);
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: 6px;
  font-weight: 900;
}

.connect-channel-options button:hover {
  color: var(--teal);
  background: var(--soft-teal);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 14px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 1px 1px rgba(15, 23, 42, 0.03);
  font-weight: 800;
  text-decoration: none;
}

.btn:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-soft);
  transform: translateY(-1px);
}

.btn.primary {
  color: #fff;
  background: linear-gradient(135deg, var(--teal), #0e8f83);
  border-color: var(--teal);
  box-shadow: 0 10px 24px rgba(11, 116, 109, 0.22);
}

.btn.blue {
  color: #fff;
  background: linear-gradient(135deg, var(--blue), #315ee8);
  border-color: var(--blue);
  box-shadow: 0 10px 24px rgba(45, 91, 214, 0.2);
}

.btn.danger {
  color: var(--red);
  background: #fff;
  border-color: #f0c2bc;
  box-shadow: none;
}

.btn.small {
  min-height: 30px;
  padding: 0 10px;
  font-size: 12px;
}

.btn.tiny {
  min-height: 30px;
  padding: 0 9px;
  font-size: 12px;
  white-space: nowrap;
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.48;
  transform: none;
  box-shadow: none;
}

.content {
  padding: 24px 28px 42px;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.inbox-search-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  width: min(640px, calc(100% - 16px));
  min-height: 42px;
  margin: 0 0 12px 16px;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 4px 14px rgba(25, 39, 62, 0.05);
}

.inbox-search-toolbar:focus-within {
  border-color: rgba(11, 116, 109, 0.55);
  box-shadow: var(--ring);
}

.inbox-search-toolbar input {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  padding: 0 14px;
  color: var(--ink);
  background: transparent;
  border: 0;
  outline: 0;
}

.inbox-search-toolbar input::placeholder {
  color: #7a8798;
}

.inbox-search-toolbar output {
  padding: 0 13px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.inbox-search-empty {
  display: grid;
  gap: 6px;
}

.inbox-search-empty strong {
  color: var(--slate);
  font-size: 14px;
}

.inbox-search-empty span {
  color: var(--muted);
  font-size: 12px;
}

.inbox-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.inbox-type-filter {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.inbox-type-filter select {
  min-width: 170px;
  min-height: 34px;
  padding: 0 34px 0 12px;
  color: var(--slate);
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  outline: 0;
  font: inherit;
  font-size: 12px;
  font-weight: 850;
  cursor: pointer;
}

.inbox-type-filter select:hover {
  border-color: #9fb6c8;
  background: #f8fbfd;
}

.inbox-type-filter select:focus-visible {
  border-color: rgba(11, 116, 109, 0.65);
  box-shadow: var(--ring);
}

.grid {
  display: grid;
  gap: 16px;
}

.metrics {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.sales-metrics {
  grid-template-columns: repeat(8, minmax(126px, 1fr));
  gap: 12px;
}

.sales-metrics .metric {
  min-height: 116px;
  padding: 16px 14px;
}

.sales-metrics .metric strong {
  font-size: 29px;
}

.dashboard-switch {
  display: inline-flex;
  gap: 5px;
  margin-bottom: 18px;
  padding: 5px;
  background: rgba(229, 236, 244, 0.86);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.74);
}

.dashboard-switch button {
  min-height: 36px;
  padding: 0 18px;
  color: var(--slate);
  background: transparent;
  border: 0;
  border-radius: var(--radius-sm);
  font-weight: 900;
}

.dashboard-switch button.active {
  color: #fff;
  background: linear-gradient(135deg, var(--teal), #116f9b);
  box-shadow: 0 10px 22px rgba(11, 116, 109, 0.22);
}

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

.metric {
  position: relative;
  min-height: 124px;
  overflow: hidden;
  padding: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 251, 253, 0.96));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.metric::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--teal), var(--blue));
  opacity: 0.9;
}

.metric span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.02em;
}

.metric strong {
  display: block;
  margin-top: 12px;
  color: #0f172a;
  font-size: 32px;
  line-height: 1;
  letter-spacing: 0;
}

.metric small {
  display: block;
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.board {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(360px, 0.9fr);
  gap: 16px;
  margin-top: 16px;
}

.board.single-board {
  grid-template-columns: minmax(0, 1fr);
}

.sales-priority-board {
  grid-template-columns: minmax(0, 1.3fr) minmax(330px, 0.7fr);
}

.dashboard-follow-panel .panel-body {
  padding: 12px;
}

.dashboard-follow-toolbar,
.dashboard-follow-pagination {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.dashboard-follow-toolbar {
  min-height: 38px;
  margin-bottom: 9px;
  padding: 6px 8px;
  color: var(--muted);
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 9px;
  font-size: 11px;
}

.dashboard-follow-page-state {
  margin-left: auto;
}

.dashboard-follow-pagination {
  justify-content: flex-end;
  margin-top: 9px;
}

.table-wrap.dashboard-follow-table {
  overflow-x: scroll;
  overflow-y: hidden;
  padding-bottom: 9px;
  scrollbar-color: #7893a3 #e8eef4;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
}

.table-wrap.dashboard-follow-table::-webkit-scrollbar {
  height: 14px;
}

.table-wrap.dashboard-follow-table::-webkit-scrollbar-track {
  background: #e8eef4;
  border-radius: 999px;
}

.table-wrap.dashboard-follow-table::-webkit-scrollbar-thumb {
  background: #7893a3;
  border: 3px solid #e8eef4;
  border-radius: 999px;
}

.table-wrap.dashboard-follow-table::-webkit-scrollbar-thumb:hover {
  background: #557282;
}

.dashboard-follow-scrollbar-row {
  margin-top: 7px;
  padding: 0 10px;
}

.dashboard-follow-scrollbar {
  display: block;
  width: 100%;
  height: 18px;
  margin: 0;
  appearance: none;
  background: transparent;
  cursor: ew-resize;
}

.dashboard-follow-scrollbar:focus {
  outline: none;
}

.dashboard-follow-scrollbar:focus-visible::-webkit-slider-thumb {
  box-shadow: 0 0 0 3px rgba(11, 116, 109, 0.18);
}

.dashboard-follow-scrollbar::-webkit-slider-runnable-track {
  height: 12px;
  background: #e8eef4;
  border: 1px solid #dbe6ee;
  border-radius: 999px;
}

.dashboard-follow-scrollbar::-webkit-slider-thumb {
  width: 118px;
  height: 12px;
  margin-top: -1px;
  appearance: none;
  background: linear-gradient(90deg, #0f8f86, #2f5fed);
  border: 0;
  border-radius: 999px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.14);
}

.dashboard-follow-scrollbar::-moz-range-track {
  height: 12px;
  background: #e8eef4;
  border: 1px solid #dbe6ee;
  border-radius: 999px;
}

.dashboard-follow-scrollbar::-moz-range-thumb {
  width: 118px;
  height: 12px;
  background: linear-gradient(90deg, #0f8f86, #2f5fed);
  border: 0;
  border-radius: 999px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.14);
}

.dashboard-follow-scrollbar.is-disabled {
  cursor: default;
  opacity: 0.45;
}

.dashboard-follow-table table {
  width: 1260px;
  min-width: 1260px;
  max-width: none;
  table-layout: fixed;
}

.dashboard-follow-table th,
.dashboard-follow-table td {
  padding: 9px 10px;
  vertical-align: middle;
}

.dashboard-follow-table th:nth-child(1) { width: 38px; }
.dashboard-follow-table th:nth-child(2) { width: 18%; }
.dashboard-follow-table th:nth-child(3) { width: 7%; }
.dashboard-follow-table th:nth-child(4) { width: 11%; }
.dashboard-follow-table th:nth-child(5) { width: 11%; }
.dashboard-follow-table th:nth-child(6) { width: 13%; }
.dashboard-follow-table th:nth-child(7) { width: 26%; }
.dashboard-follow-table th:nth-child(8) { width: 14%; }

.dashboard-follow-select-cell {
  text-align: center;
}

.dashboard-follow-select-cell input {
  width: 16px;
  height: 16px;
  accent-color: var(--teal);
}

.dashboard-next-action {
  width: 100%;
  min-height: 32px;
  padding: 5px 7px;
  color: var(--ink);
  background: #fff;
  border: 1px solid transparent;
  border-radius: 7px;
  font: inherit;
  line-height: 1.35;
}

.dashboard-next-action:hover,
.dashboard-next-action:focus {
  outline: 0;
  border-color: var(--line-strong);
  box-shadow: var(--ring);
}

.dashboard-next-action.is-saving {
  color: var(--teal);
  background: #eef8f6;
}

.dashboard-follow-table .customer-name strong {
  font-size: 13px;
}

.dashboard-follow-table .customer-name span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-followup-content {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
}

.dashboard-followup-content > span {
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
  color: var(--ink);
  font-size: 11px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-followup-content .btn {
  flex: 0 0 auto;
  min-height: 27px;
  padding: 4px 7px;
  font-size: 10px;
}

.followup-overview {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 7px;
}

.followup-overview button {
  padding: 3px 7px;
  color: #526174;
  background: #f3f7fa;
  border: 1px solid #dfe8ef;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 850;
  cursor: pointer;
}

.followup-overview button:hover,
.followup-overview button.active {
  color: var(--teal);
  background: #e8f7f4;
  border-color: #8fcfc4;
}

.followup-overview button.clear {
  color: var(--blue);
  background: #edf3ff;
  border-color: #b8cafb;
}

.mail-delivery {
  display: inline-grid;
  grid-template-columns: 19px minmax(0, 1fr);
  align-items: center;
  gap: 5px;
  max-width: 100%;
  color: var(--muted);
}

.mail-delivery .mail-mark {
  display: inline-grid;
  width: 19px;
  height: 19px;
  place-items: center;
  border: 1px solid #cbd5df;
  border-radius: 50%;
  color: #748396;
  background: #f8fafc;
  font-size: 11px;
  font-weight: 950;
}

.mail-delivery.sent .mail-mark {
  color: #087a42;
  background: #eaf8ef;
  border-color: #95d5ae;
}

.mail-delivery.failed .mail-mark {
  color: #b42318;
  background: #fff0ed;
  border-color: #efb3aa;
}

.mail-delivery small {
  display: block;
  overflow: hidden;
  font-size: 10px;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mail-delivery.failed small {
  color: #b42318;
}

.funnel-list {
  display: grid;
  gap: 15px;
}

.funnel-item,
.stage-card {
  display: grid;
  gap: 8px;
}

.funnel-meta,
.stage-card > div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.funnel-meta strong,
.stage-card strong {
  color: #1b2738;
  font-size: 13px;
  font-weight: 900;
}

.funnel-meta span,
.stage-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.funnel-track {
  height: 11px;
  overflow: hidden;
  background: #ecf1f6;
  border: 1px solid #dfe7ee;
  border-radius: 999px;
}

.funnel-track span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--teal), #2d8fb8, var(--blue));
  border-radius: inherit;
  box-shadow: 0 0 18px rgba(11, 116, 109, 0.18);
}

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

.alert-card,
.ops-insight-list article,
.portrait-group,
.compact-message {
  border: 1px solid var(--line);
  border-radius: 8px;
}

.alert-card {
  padding: 13px 14px;
  background: var(--panel-soft);
}

.alert-card strong {
  display: block;
  font-size: 13px;
  font-weight: 900;
}

.alert-card p,
.ops-insight-list p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.alert-card.ok {
  background: #effaf4;
  border-color: #c8e7d0;
}

.alert-card.warn {
  background: #fff7e8;
  border-color: #f0d6a8;
}

.alert-card.bad {
  background: #fff0ee;
  border-color: #f1c0ba;
}

.stage-grid {
  display: grid;
  gap: 12px;
}

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

.portrait-group {
  padding: 14px;
  background: var(--panel-soft);
}

.portrait-group h3 {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 900;
}

.ops-insight-list {
  display: grid;
  gap: 12px;
}

.ops-insight-list article {
  padding: 15px;
  background: var(--panel-soft);
}

.ops-insight-list span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.ops-insight-list strong {
  display: block;
  margin-top: 6px;
  color: #0f172a;
  font-size: 22px;
  line-height: 1.2;
}

.compact-empty {
  padding: 12px;
  min-height: 48px;
}

.compact-message {
  padding: 12px;
  box-shadow: none;
  background: var(--panel-soft);
}

.panel {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 62px;
  padding: 0 18px;
  background: linear-gradient(180deg, #fff, #fbfdff);
  border-bottom: 1px solid var(--line);
}

.panel-head h2,
.panel-head h3 {
  margin: 0;
  font-size: 16px;
  line-height: 1.2;
  letter-spacing: 0;
}

.panel-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.panel-body {
  padding: 16px 18px 18px;
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) repeat(3, minmax(132px, 180px)) minmax(138px, 160px);
  gap: 11px;
  margin-bottom: 16px;
}

.customer-list-panel,
.customer-list-panel .panel-body,
.customer-table-wrap {
  min-width: 0;
}

.customer-toolbar {
  display: block;
}

.customer-toolbar #searchInput {
  width: min(520px, 100%);
}

.toolbar-action {
  min-height: 40px;
  white-space: nowrap;
}

.customer-bulk-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  min-height: 42px;
  margin: -6px 0 10px;
  padding: 7px 9px;
  color: var(--muted);
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 800;
}

.customer-bulk-toolbar.has-selection {
  color: #7a281f;
  background: var(--soft-red);
  border-color: #efc7c1;
}

.customer-bulk-toolbar strong {
  color: inherit;
  font-size: 14px;
}

.customer-bulk-toolbar .btn:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.field {
  width: 100%;
  min-height: 40px;
  padding: 0 12px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.02);
}

.field:hover {
  border-color: var(--line-strong);
}

.field:focus {
  outline: 0;
  border-color: rgba(11, 116, 109, 0.55);
  box-shadow: var(--ring);
}

.field:disabled {
  cursor: not-allowed;
  color: var(--muted);
  background: #f8fafc;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.customer-table-wrap {
  scrollbar-gutter: stable;
  overscroll-behavior-inline: contain;
}

table {
  width: 100%;
  min-width: 1180px;
  border-collapse: collapse;
  font-size: 13px;
}

.customer-table {
  min-width: 2665px;
  table-layout: fixed;
}

.customer-table th,
.customer-table td {
  padding-right: 9px;
  padding-left: 9px;
}

.customer-table th:nth-child(1) { width: 42px; }
.customer-table th:nth-child(2) { width: 58px; }
.customer-table th:nth-child(3) { width: 140px; }
.customer-table th:nth-child(4) { width: 105px; }
.customer-table th:nth-child(5) { width: 124px; }
.customer-table th:nth-child(6) { width: 116px; }
.customer-table th:nth-child(7) { width: 135px; }
.customer-table th:nth-child(8) { width: 138px; }
.customer-table th:nth-child(9) { width: 150px; }
.customer-table th:nth-child(10) { width: 138px; }
.customer-table th:nth-child(11) { width: 118px; }
.customer-table th:nth-child(12) { width: 128px; }
.customer-table th:nth-child(13) { width: 190px; }
.customer-table th:nth-child(14) { width: 150px; }
.customer-table th:nth-child(15) { width: 175px; }
.customer-table th:nth-child(16) { width: 200px; }
.customer-table th:nth-child(17) { width: 145px; }
.customer-table th:nth-child(18) { width: 132px; }
.customer-table th:nth-child(19) { width: 110px; }
.customer-table th:nth-child(20) { width: 110px; }
.customer-table th:nth-child(21) { width: 100px; }

.customer-column-static,
.system-account-cell {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  max-width: 100%;
  padding: 3px 8px;
  color: #0f625a;
  background: #e7f6f2;
  border: 1px solid #b9e2d8;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.system-account-assignment {
  width: 100%;
  min-width: 116px;
  min-height: 34px;
  padding: 5px 28px 5px 10px;
  color: #0f766e;
  background: #effcf8;
  border: 1px solid #b9e7dc;
  border-radius: 999px;
  font: inherit;
  font-weight: 850;
  cursor: pointer;
}

.system-account-assignment:hover {
  border-color: #75cdbd;
}

.system-account-assignment:focus {
  outline: 0;
  border-color: #0f8d80;
  box-shadow: 0 0 0 3px rgba(15, 141, 128, 0.14);
}

.system-account-assignment:disabled {
  cursor: wait;
  opacity: 0.62;
}

.followup-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #475569;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.followup-status::before {
  content: "";
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #94a3b8;
  box-shadow: 0 0 0 2px rgba(148, 163, 184, 0.12);
}

.followup-status.pending::before {
  background: #f5a524;
  box-shadow: 0 0 0 2px rgba(245, 165, 36, 0.15);
}

.followup-status.done::before {
  background: #30a46c;
  box-shadow: 0 0 0 2px rgba(48, 164, 108, 0.15);
}

.followup-status.overdue::before {
  background: #e5484d;
  box-shadow: 0 0 0 2px rgba(229, 72, 77, 0.15);
}

.customer-table thead th {
  position: sticky;
  z-index: 2;
}

.customer-table .customer-filter-row th {
  top: 0;
  height: 44px;
  padding: 7px 5px;
  vertical-align: middle;
  background: #fbfdff;
  border-bottom-color: #e8eef4;
}

.customer-table .customer-heading-row th {
  top: 44px;
  height: 38px;
  padding-top: 9px;
  padding-bottom: 9px;
  vertical-align: middle;
  box-shadow: 0 1px 0 rgba(148, 163, 184, 0.12);
}

.customer-column-filter {
  width: 100%;
  min-width: 0;
  height: 30px;
  padding: 0 23px 0 7px;
  color: var(--slate);
  background: #fff;
  border: 1px solid #d7e0e9;
  border-radius: 7px;
  font-family: inherit;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
  text-overflow: ellipsis;
}

.customer-column-query {
  padding-right: 7px;
}

.customer-column-query[type="date"] {
  padding-right: 2px;
  font-size: 9px;
}

.customer-column-filter:hover {
  border-color: var(--line-strong);
}

.customer-column-filter:focus {
  outline: 0;
  border-color: rgba(11, 116, 109, 0.55);
  box-shadow: var(--ring);
}

.customer-column-filter:disabled {
  cursor: not-allowed;
  color: var(--muted);
  background: #f4f7fa;
}

.customer-filter-inline {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.customer-filter-inline > * {
  flex: 1 1 0;
  min-width: 0;
}

.customer-filter-country .customer-column-filter {
  flex-basis: 58%;
}

.customer-filter-country .customer-column-action {
  flex-basis: 42%;
}

.customer-filter-tags .customer-column-filter {
  font-size: 9.5px;
  padding-right: 17px;
}

.customer-column-action {
  width: auto;
  min-height: 30px;
  padding: 0 5px;
  color: #0f665f;
  background: #edf9f6;
  border: 1px solid #c1e2dc;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
  cursor: pointer;
}

@media (max-width: 1180px) {
  .sales-metrics {
    grid-template-columns: repeat(4, minmax(150px, 1fr));
  }
}

.customer-column-action:hover {
  color: #084f49;
  background: #ddf3ee;
  border-color: #8dc9be;
}

.customer-table th:first-child,
.customer-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  background: #fff;
}

.customer-table th:nth-child(2),
.customer-table td:nth-child(2) {
  position: sticky;
  left: 42px;
  z-index: 1;
  background: #fff;
}

.customer-table th:nth-child(3),
.customer-table td:nth-child(3) {
  position: sticky;
  left: 100px;
  z-index: 1;
  background: #fff;
}

.customer-table thead th:first-child {
  z-index: 3;
}

.customer-table thead th:nth-child(2) {
  z-index: 3;
}

.customer-table thead th:nth-child(3) {
  z-index: 3;
}

.customer-table tr.selectable:hover td:first-child,
.customer-table tr.selected td:first-child,
.customer-table tr.selectable:hover td:nth-child(2),
.customer-table tr.selected td:nth-child(2),
.customer-table tr.selectable:hover td:nth-child(3),
.customer-table tr.selected td:nth-child(3) {
  background: #eef8f6;
}

.customer-select-column,
.customer-select-cell {
  padding-right: 7px !important;
  padding-left: 7px !important;
  text-align: center;
  vertical-align: middle;
}

.customer-select-column input,
.customer-select-cell input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--teal);
  cursor: pointer;
}

th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-align: left;
  background: #f6f9fc;
  white-space: nowrap;
}

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

tbody tr:hover {
  background: #f7fbfb;
}

tr:last-child td {
  border-bottom: 0;
}

tr.selectable {
  cursor: pointer;
}

tr.selectable:hover,
tr.selected {
  background: #eef8f6;
}

.customer-name {
  display: grid;
  gap: 3px;
}

.customer-name strong {
  font-size: 14px;
  line-height: 1.25;
}

.customer-name span {
  color: var(--muted);
  font-size: 12px;
}

.contact-cell {
  display: block;
  max-width: 100%;
  overflow: hidden;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.contact-value-list {
  display: grid;
  gap: 3px;
  max-width: 100%;
}

.contact-value-list span {
  display: block;
  overflow: hidden;
  color: var(--slate);
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.customer-inline-editor {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 30px;
  padding: 5px 7px;
  color: var(--ink);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 7px;
  font: inherit;
  font-weight: 800;
  line-height: 1.35;
  transition: border-color 140ms ease, background-color 140ms ease, box-shadow 140ms ease;
}

.customer-inline-editor:hover {
  background: rgba(255, 255, 255, 0.76);
  border-color: var(--line);
}

.customer-inline-editor:focus {
  outline: 0;
  background: #fff;
  border-color: rgba(11, 116, 109, 0.55);
  box-shadow: var(--ring);
}

.customer-inline-editor.is-empty {
  color: var(--muted);
  font-weight: 700;
}

.customer-inline-editor.is-saving {
  color: var(--teal);
  background: #eef8f6;
}

.customer-inline-select {
  cursor: pointer;
}

.customer-grade-select {
  border-color: currentColor;
  font-weight: 950;
  text-align: center;
}

.grade-unset,
.grade-unset-label {
  color: var(--muted);
  background: #f8fafc;
  border-color: #cbd5df;
}

.grade-unset-label {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 8px;
  border: 1px solid #cbd5df;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 850;
}

.grade-select-a {
  color: #087a42;
  background: #eaf8ef;
}

.grade-select-b {
  color: #244fb9;
  background: #edf3ff;
}

.grade-select-c {
  color: #9a5804;
  background: #fff4dc;
}

.grade-select-d {
  color: #a62218;
  background: #fff0ed;
}

.customer-inline-stack {
  display: grid;
  gap: 2px;
}

.customer-inline-stack small {
  padding: 0 7px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.25;
}

.customer-avatar {
  display: block;
  width: 38px;
  height: 38px;
  object-fit: cover;
  background: #eef3f6;
  border: 1px solid var(--line);
  border-radius: 50%;
}

.customer-avatar.hero-avatar {
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
}

.customer-avatar-empty {
  display: inline-block;
  max-width: 42px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
}

.badge-row,
.tag-row,
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.badge,
.tag,
.chip {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 2px 9px;
  white-space: nowrap;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  border: 1px solid transparent;
}

.badge {
  color: var(--slate);
  background: #eef3f8;
  border-color: #d8e2ed;
}

.badge.chat-type-group {
  color: #17635e;
  background: #e8f8f4;
  border-color: #b9e1d8;
}

.badge.chat-type-individual {
  color: #3d5871;
  background: #f0f6fb;
  border-color: #d3e1ed;
}

.badge.chat-type-other {
  color: #775a17;
  background: #fff8e7;
  border-color: #f0d899;
}

.owner-cell {
  display: inline-block;
  max-width: 96px;
  overflow-wrap: anywhere;
  font-weight: 900;
}

.owner-cell.muted {
  color: var(--muted);
  font-weight: 800;
}

.country-cell {
  display: inline-block;
  max-width: 92px;
  overflow-wrap: anywhere;
  color: var(--slate);
  font-weight: 900;
}

.country-cell.muted {
  color: var(--muted);
  font-weight: 800;
}

.source-cell {
  display: grid;
  gap: 3px;
  min-width: 118px;
  max-width: 170px;
}

.source-cell strong,
.source-cell span,
.source-cell small {
  overflow-wrap: anywhere;
}

.source-cell strong {
  color: var(--slate);
  font-size: 12px;
  font-weight: 900;
}

.source-cell strong.muted {
  color: var(--muted);
  font-weight: 800;
}

.source-cell span {
  color: var(--slate);
  font-size: 12px;
  font-weight: 800;
}

.source-cell span.muted {
  color: var(--muted);
}

.source-cell small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.time-cell,
.duration-cell {
  display: inline-block;
  min-width: 82px;
  color: var(--slate);
  font-weight: 800;
  line-height: 1.35;
}

.duration-cell {
  min-width: 64px;
  color: #0f5d55;
}

.tag {
  color: #0f5d55;
  background: var(--soft-teal);
  border-color: #bddfd9;
}

.tag.pending {
  color: #875008;
  background: var(--soft-amber);
  border-color: #f0cf9a;
}

.chip {
  color: #24438f;
  background: var(--soft-blue);
  border-color: #c5d6ff;
}

.grade {
  display: inline-grid;
  place-items: center;
  width: 31px;
  height: 31px;
  color: #fff;
  font-size: 14px;
  font-weight: 900;
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 16px rgba(15, 23, 42, 0.12);
}

.grade-a {
  background: var(--green);
}

.grade-b {
  background: var(--blue);
}

.grade-c {
  background: var(--amber);
}

.grade-d {
  background: var(--red);
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 27px;
  padding: 2px 10px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  border-radius: 999px;
  border: 1px solid transparent;
}

.status::before {
  content: "";
  display: block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.status.ok {
  color: var(--green);
  background: #eef9f2;
  border-color: #cfeada;
}

.status.warn {
  color: var(--amber);
  background: #fff7e8;
  border-color: #f2d8a7;
}

.status.bad {
  color: var(--red);
  background: #fff0ee;
  border-color: #f0c5bf;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  gap: 16px;
}

.customer-split {
  grid-template-columns: minmax(0, 1fr) 330px;
}

.customer-detail-panel {
  position: sticky;
  top: 136px;
  align-self: start;
  display: flex;
  flex-direction: column;
  min-width: 0;
  max-height: calc(100vh - 152px);
}

.customer-detail-panel > .panel-head {
  flex: 0 0 auto;
}

.customer-detail-panel > .panel-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: scroll;
  overscroll-behavior-y: contain;
  scrollbar-color: #8ba7b6 #eef3f6;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
}

.customer-detail-panel > .panel-body::-webkit-scrollbar {
  width: 9px;
}

.customer-detail-panel > .panel-body::-webkit-scrollbar-track {
  background: #eef3f6;
  border-left: 1px solid #e1e8ee;
}

.customer-detail-panel > .panel-body::-webkit-scrollbar-thumb {
  background: #8ba7b6;
  border: 2px solid #eef3f6;
  border-radius: 999px;
}

.customer-detail-panel > .panel-body::-webkit-scrollbar-thumb:hover {
  background: var(--teal);
}

.profile {
  display: grid;
  gap: 14px;
}

.profile-hero {
  display: grid;
  gap: 10px;
}

.channel-editor {
  display: grid;
  gap: 6px;
}

.channel-editor span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.channel-editor select {
  font-weight: 800;
}

.managed-dropdown {
  position: relative;
  min-width: 0;
}

.managed-dropdown-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
  font-weight: 800;
  list-style-position: inside;
  cursor: pointer;
}

.managed-dropdown-trigger span {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: inherit;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.managed-dropdown-trigger::-webkit-details-marker {
  display: none;
}

.managed-dropdown[open] .managed-dropdown-trigger {
  border-color: rgba(11, 116, 109, 0.55);
  box-shadow: var(--ring);
}

.managed-dropdown-menu {
  position: absolute;
  z-index: 80;
  top: calc(100% + 5px);
  right: 0;
  left: 0;
  display: grid;
  max-height: 248px;
  padding: 5px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  box-shadow: 0 16px 38px rgba(15, 23, 42, 0.18);
}

.managed-dropdown-option {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 30px;
  gap: 3px;
  align-items: center;
  min-height: 34px;
  border-radius: 5px;
}

.managed-dropdown-option:hover,
.managed-dropdown-option.selected {
  background: var(--soft-teal);
}

.managed-option-value,
.managed-option-create {
  min-width: 0;
  min-height: 32px;
  padding: 5px 8px;
  overflow: hidden;
  color: var(--slate);
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: transparent;
  border: 0;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 850;
}

.managed-option-create {
  margin-top: 4px;
  color: var(--teal);
  border-top: 1px solid var(--line);
  border-radius: 0;
}

.managed-option-remove,
.option-pill-remove {
  display: inline-grid;
  place-items: center;
  width: 25px;
  height: 25px;
  padding: 0;
  color: var(--red);
  background: #fff;
  border: 1px solid #f0c2bc;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 900;
  line-height: 1;
}

.managed-option-remove:hover,
.option-pill-remove:hover {
  color: #fff;
  background: var(--red);
  border-color: var(--red);
}

.managed-dropdown-empty {
  padding: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.managed-dropdown.is-disabled {
  pointer-events: none;
  opacity: 0.62;
}

.inline-managed-dropdown,
.inline-tag-dropdown {
  width: 100%;
}

.inline-managed-dropdown .managed-dropdown-trigger,
.inline-tag-summary {
  min-height: 30px;
  padding: 5px 7px;
  background: transparent;
  border-color: transparent;
}

.inline-managed-dropdown .managed-dropdown-trigger:hover,
.inline-tag-summary:hover {
  background: rgba(255, 255, 255, 0.76);
  border-color: var(--line);
}

.inline-managed-menu {
  right: auto;
  left: 0;
  width: 170px;
}

.inline-tag-control {
  position: relative;
  min-width: 0;
}

.inline-tag-menu {
  right: auto;
  left: 0;
  width: min(420px, calc(100vw - 48px));
  max-height: 334px;
  gap: 8px;
  padding: 8px;
}

.inline-tag-grid {
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
}

.inline-tag-menu .tag-level-dropdown .managed-dropdown-menu {
  right: auto;
  left: 0;
  min-width: 170px;
}

.inline-selected-tag-list {
  max-height: 86px;
  overflow-y: auto;
}

.inline-custom-tag-editor {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
}

.editable-meta {
  display: grid;
  gap: 8px;
  align-content: start;
}

.compact-field {
  width: 100%;
  min-height: 34px;
  padding: 7px 10px;
  font-weight: 800;
}

.compact-action-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
}

.multi-contact-card {
  gap: 8px;
}

.multi-contact-list {
  display: grid;
  gap: 6px;
}

.multi-contact-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
}

.multi-contact-actions {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.auto-save-hint {
  color: var(--teal) !important;
  font-size: 11px !important;
  font-weight: 800 !important;
}

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

.country-action-field .field {
  grid-column: 1 / -1;
}

.country-action-field .btn {
  width: 100%;
}

.source-material-card {
  align-content: start;
}

.source-material-card .field {
  width: 100%;
}

.source-material-card .btn {
  justify-self: end;
}

.material-dropzone {
  display: grid;
  gap: 4px;
  min-height: 88px;
  padding: 14px 12px;
  color: var(--slate);
  text-align: center;
  background: #fff;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.material-dropzone:hover,
.material-dropzone:focus-visible,
.material-dropzone.is-dragging,
.material-dropzone.is-paste-ready {
  color: var(--teal);
  background: var(--soft-teal);
  border-color: var(--teal);
  outline: 0;
  box-shadow: var(--ring);
}

.material-dropzone strong {
  align-self: end;
  font-size: 12px;
  line-height: 1.35;
}

.material-dropzone span,
.source-material-card .material-dropzone span {
  display: block;
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.4;
}

.material-file-list {
  display: grid;
  gap: 6px;
}

.material-file-empty {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.material-file-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-width: 0;
  padding: 8px 9px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.material-file-item.pending {
  background: var(--soft-amber);
  border-color: #efd6ac;
}

.material-file-item.has-thumbnail {
  grid-template-columns: 52px minmax(0, 1fr) auto;
}

.material-thumbnail {
  width: 52px;
  height: 52px;
  padding: 0;
  overflow: hidden;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 7px;
  cursor: zoom-in;
}

.material-thumbnail:hover,
.material-thumbnail:focus-visible {
  border-color: var(--teal);
  outline: 0;
  box-shadow: var(--ring);
}

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

.material-file-item a,
.material-file-item > div {
  display: grid;
  gap: 2px;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.material-file-item a:hover strong {
  color: var(--teal);
}

.material-file-item strong {
  overflow: hidden;
  color: var(--slate);
  font-size: 11px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.material-file-item span,
.source-material-card .material-file-item span {
  display: block;
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.3;
}

.material-file-remove {
  padding: 4px 5px;
  color: var(--red);
  font-size: 10px;
  font-weight: 800;
  background: transparent;
  border: 0;
  border-radius: 4px;
}

.material-file-remove:hover {
  background: var(--soft-red);
}

body.material-preview-open {
  overflow: hidden;
}

.material-preview-backdrop {
  position: fixed;
  z-index: 1200;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgb(15 23 42 / 86%);
}

.material-preview-dialog {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(1180px, calc(100vw - 48px));
  height: min(860px, calc(100vh - 48px));
  overflow: hidden;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 24px 80px rgb(0 0 0 / 35%);
}

.material-preview-head {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.material-preview-head strong {
  overflow: hidden;
  color: var(--slate);
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.material-preview-stage {
  display: grid;
  min-width: 0;
  min-height: 0;
  place-items: center;
  padding: 16px;
  overflow: auto;
  background:
    linear-gradient(45deg, #eef2f7 25%, transparent 25%),
    linear-gradient(-45deg, #eef2f7 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #eef2f7 75%),
    linear-gradient(-45deg, transparent 75%, #eef2f7 75%);
  background-color: #f8fafc;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
  background-size: 16px 16px;
}

.material-preview-image {
  display: block;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  box-shadow: 0 10px 30px rgb(15 23 42 / 16%);
}

.profile-hero h2 {
  margin: 0;
  color: #0f172a;
  font-size: 22px;
  line-height: 1.2;
}

.profile-meta {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.meta-item {
  min-height: auto;
  padding: 10px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.meta-item span {
  display: block;
  margin-bottom: 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  line-height: 1.3;
}

.meta-item strong {
  display: block;
  margin-top: 5px;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.grade-control {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.grade-control button {
  min-height: 38px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-weight: 900;
}

.grade-control button:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-soft);
}

.grade-control button.active {
  color: #fff;
  border-color: transparent;
}

.grade-control button[data-grade="A"].active {
  background: var(--green);
}

.grade-control button[data-grade="B"].active {
  background: var(--blue);
}

.grade-control button[data-grade="C"].active {
  background: var(--amber);
}

.grade-control button[data-grade="D"].active {
  background: var(--red);
}

.profile-summary-strip {
  display: grid;
  gap: 10px;
  padding: 12px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.profile-note-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.profile-tag-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.tag-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.tag-card-head h3 {
  margin: 0;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.2;
}

.note-card-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.note-card-head h3 {
  margin: 0;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.2;
}

.note-card-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.note-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.summary-textarea {
  min-height: 126px;
  line-height: 1.55;
}

.note-context-row {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
}

.note-context-row > span {
  padding-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.tag-selector-panel {
  display: grid;
  gap: 10px;
}

.tag-dropdown-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: 8px;
}

.tag-link-hint {
  margin: -2px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

.tag-level-dropdown .managed-dropdown-menu {
  min-width: 150px;
}

.custom-tag-editor {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr) auto;
  gap: 8px;
}

.selected-tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.selected-tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  max-width: 100%;
  padding: 3px 7px 3px 9px;
  color: #0f5d55;
  background: var(--soft-teal);
  border: 1px solid #bddfd9;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.selected-tag-pill span {
  overflow-wrap: anywhere;
}

.selected-tag-pill.grade-tag {
  color: #875008;
  background: var(--soft-amber);
  border-color: #f0cf9a;
}

.selected-tag-pill button {
  min-height: 21px;
  padding: 0 6px;
  color: var(--red);
  background: #fff;
  border: 1px solid #f0c2bc;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
  cursor: pointer;
}

.tag-choice-group {
  display: grid;
  gap: 6px;
}

.tag-choice-group > strong {
  color: var(--slate);
  font-size: 12px;
}

.tag-choice-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag-choice {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 29px;
  padding: 3px 9px;
  color: var(--slate);
  background: #fff;
  border: 1px solid #d8e2ed;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.tag-choice input {
  width: 13px;
  height: 13px;
  margin: 0;
  accent-color: var(--teal);
}

.tag-choice.selected {
  color: #0f5d55;
  background: var(--soft-teal);
  border-color: #bddfd9;
}

.tag-library-layout {
  display: grid;
  gap: 16px;
}

.option-library-section {
  display: grid;
  gap: 12px;
  padding: 14px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.option-library-section .tag-library-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.option-library-groups {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.option-library-group {
  display: grid;
  align-content: start;
  gap: 8px;
  min-width: 0;
  padding: 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.option-library-group > strong {
  color: var(--slate);
  font-size: 12px;
}

.tag-library-form {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(180px, 1.2fr) auto;
  gap: 12px;
  align-items: end;
  padding: 14px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.tag-library-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.tag-library-bulk-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 46px;
  padding: 10px 12px;
  color: var(--muted);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 850;
}

.tag-library-bulk-toolbar.has-selection {
  color: #7a281f;
  background: var(--soft-red);
  border-color: #efc7c1;
}

.tag-library-bulk-toolbar strong {
  color: inherit;
  font-size: 14px;
}

.tag-type-select-all {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--slate);
  cursor: pointer;
}

.tag-type-select-all input,
.tag-group-checkbox input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--teal);
  cursor: pointer;
}

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

.tag-library-group {
  position: relative;
  display: grid;
  gap: 10px;
  padding: 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.tag-library-group.is-selected {
  background: #eef8f6;
  border-color: rgba(11, 116, 109, 0.32);
  box-shadow: var(--ring);
}

.tag-group-checkbox {
  position: absolute;
  top: 12px;
  left: 12px;
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  cursor: pointer;
}

.tag-library-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-left: 28px;
}

.tag-library-head h3 {
  margin: 0;
  color: var(--ink);
  font-size: 15px;
}

.tag-library-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.tag-library-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(156px, 1fr));
  gap: 8px;
}

.tag-library-pill {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  justify-content: stretch;
  gap: 7px;
  width: 100%;
  min-height: 42px;
  padding: 5px 8px;
  color: var(--slate);
  background: #f8fbfd;
  border: 1px solid #d8e2ed;
  border-radius: 18px;
  font-size: 12px;
  font-weight: 900;
}

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

.tag-library-pill small {
  color: var(--muted);
  font-weight: 800;
  white-space: nowrap;
}

.tag-library-pill button {
  min-height: 22px;
  padding: 0 7px;
  color: var(--red);
  background: #fff;
  border: 1px solid #f0c2bc;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
}

.summary-line {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
}

.summary-label {
  padding-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.chip-row.compact,
.tag-row.compact,
.pending-compact {
  gap: 6px;
  min-width: 0;
}

.pending-compact {
  display: flex;
  flex-wrap: wrap;
}

.pending-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  padding: 3px;
  background: #fff;
  border: 1px solid #ecd8b4;
  border-radius: 999px;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.02);
}

.pending-pill .tag {
  max-width: min(260px, 52vw);
  overflow: hidden;
  text-overflow: ellipsis;
}

.chip-action {
  min-height: 22px;
  padding: 0 7px;
  color: var(--slate);
  background: #f3f7fa;
  border: 1px solid #d8e1e8;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
}

.chip-action.confirm {
  color: #fff;
  background: var(--teal);
  border-color: var(--teal);
}

.conversation-panel {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.conversation-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.conversation-head h3 {
  margin: 0;
  font-size: 15px;
}

.conversation-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.conversation-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.followup-record-list {
  display: grid;
  gap: 8px;
  max-height: 190px;
  overflow: auto;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fbfd;
}

.followup-record {
  display: grid;
  gap: 6px;
  padding: 10px;
  border: 1px solid #d8e2ed;
  border-radius: 8px;
  background: #fff;
}

.followup-record.legacy {
  border-color: #c8d9ea;
  background: #fbfdff;
}

.followup-record-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.followup-record-head strong {
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
}

.followup-record-head time {
  white-space: nowrap;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.followup-record p {
  margin: 0;
  color: var(--slate);
  font-size: 13px;
  line-height: 1.55;
  max-height: 92px;
  overflow: auto;
  white-space: pre-wrap;
}

.timeline {
  display: grid;
  gap: 10px;
}

.chat-thread {
  display: flex;
  flex-direction: column;
  gap: 4px;
  height: clamp(360px, 56vh, 580px);
  overflow: auto;
  padding: 18px 24px;
  border: 1px solid #eadfce;
  border-radius: var(--radius);
  background:
    linear-gradient(rgba(250, 247, 240, 0.92), rgba(250, 247, 240, 0.92)),
    radial-gradient(circle at 20px 20px, rgba(160, 121, 72, 0.08) 1.4px, transparent 2.2px),
    radial-gradient(circle at 8px 9px, rgba(109, 142, 112, 0.06) 1.2px, transparent 2px);
  background-color: #efe7db;
  background-size: auto, 34px 34px, 27px 27px;
}

.chat-date-separator {
  display: flex;
  justify-content: center;
  margin: 14px 0 10px;
}

.chat-date-separator span {
  padding: 4px 12px;
  color: #6b7280;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(115, 125, 134, 0.14);
  border-radius: 7px;
  font-size: 12px;
  font-weight: 800;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.09);
}

.chat-row {
  display: flex;
  align-items: flex-end;
  width: 100%;
  margin: 1px 0;
}

.chat-row.inbound {
  justify-content: flex-start;
}

.chat-row.outbound {
  justify-content: flex-end;
}

.chat-row.system {
  justify-content: center;
}

.chat-bubble {
  position: relative;
  width: fit-content;
  min-width: 190px;
  max-width: min(72%, 720px);
  padding: 7px 9px 5px;
  border: 0;
  border-radius: 7.5px;
  box-shadow: 0 1px 1px rgba(15, 23, 42, 0.12);
}

.chat-row.inbound .chat-bubble {
  color: #111b21;
  background: #fff;
  border-top-left-radius: 2px;
}

.chat-row.outbound .chat-bubble {
  color: #111b21;
  background: #d9fdd3;
  border-top-right-radius: 2px;
  min-width: 210px;
}

.chat-row.system .chat-bubble {
  max-width: 72%;
  color: #667781;
  background: rgba(255, 255, 255, 0.86);
  text-align: center;
}

.chat-meta {
  display: none;
}

.chat-meta time {
  white-space: nowrap;
}

.chat-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 14.2px;
  line-height: 1.38;
}

.chat-row.deleted .chat-text {
  color: #667781;
  font-style: italic;
}

.chat-translation {
  display: block;
  width: fit-content;
  max-width: min(560px, 100%);
  min-width: min(148px, 100%);
  margin: 6px 0 2px;
  padding: 7px 9px 7px 11px;
  color: #2f80ed;
  background: rgba(255, 255, 255, 0.7);
  border-left: 3px solid #4facfe;
  border-radius: 8px;
  white-space: normal;
  overflow-wrap: anywhere;
  font-size: 13px;
  line-height: 1.45;
  font-weight: 400;
}

.chat-row.outbound .chat-translation {
  background: rgba(222, 255, 219, 0.72);
}

.chat-translation strong {
  display: block;
  margin-bottom: 3px;
  color: #64748b;
  font-size: 11px;
  white-space: nowrap;
}

.chat-translation-text {
  display: block;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.chat-translation.pending {
  color: #667781;
  font-style: italic;
}

.chat-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  min-height: 15px;
  margin-top: 2px;
  color: #667781;
  font-size: 11px;
  line-height: 1;
  text-align: right;
}

.chat-row.outbound .chat-footer {
  color: #4f7f57;
}

.chat-status {
  color: #53bdeb;
  font-size: 12px;
  letter-spacing: -2px;
}

.chat-channel {
  display: none;
  margin-top: 4px;
  color: #7a857f;
  font-size: 10px;
  text-align: right;
}

.event {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.event:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.event time {
  color: var(--muted);
  font-size: 12px;
}

.event strong {
  display: block;
  margin-bottom: 3px;
  font-size: 13px;
}

.event p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.inbox-list,
.duplicate-list,
.integration-list {
  display: grid;
  gap: 10px;
}

.message,
.duplicate,
.integration {
  display: grid;
  gap: 11px;
  padding: 15px;
  background:
    linear-gradient(180deg, #fff, #fbfdff);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.02);
}

.message:hover,
.duplicate:hover,
.integration:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-soft);
}

.message-head,
.duplicate-head,
.integration-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.message h3,
.duplicate h3,
.integration h3 {
  margin: 0;
  font-size: 15px;
  line-height: 1.25;
}

.message p,
.duplicate p,
.integration p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.email-sender-overview + .email-sender-form-panel {
  margin-top: 16px;
}

.email-delivery-summary {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 18px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-left: 4px solid var(--line-strong);
  border-radius: var(--radius);
}

.email-delivery-summary.is-ready {
  background: linear-gradient(135deg, #f2fbf8, #fbfffd);
  border-color: #b9dfd6;
  border-left-color: var(--teal);
}

.email-delivery-summary.is-blocked {
  background: linear-gradient(135deg, #fff7f4, #fffdfc);
  border-color: #f0c9c2;
  border-left-color: var(--red);
}

.email-delivery-summary > div {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.email-summary-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.05em;
}

.email-delivery-summary strong {
  overflow-wrap: anywhere;
  font-size: 17px;
}

.email-delivery-summary p,
.email-security-warning p,
.email-sender-empty p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.email-security-warning {
  display: grid;
  gap: 4px;
  margin-top: 12px;
  padding: 13px 15px;
  color: #7a281f;
  background: var(--soft-red);
  border: 1px solid #efc7c1;
  border-radius: var(--radius);
}

.email-security-warning p {
  color: #8d4c44;
}

.email-sender-notes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0 16px;
}

.email-sender-notes span {
  min-width: 0;
  padding: 9px 11px;
  color: #315f5a;
  background: var(--soft-teal);
  border: 1px solid #c7e4dd;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 800;
}

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

.email-account-card {
  display: grid;
  gap: 13px;
  min-width: 0;
  padding: 16px;
  background: linear-gradient(180deg, #fff, #fbfdff);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.email-account-card.is-active {
  background: linear-gradient(180deg, #f5fcfa, #fff);
  border-color: #7fc4b7;
  box-shadow: 0 10px 28px rgba(11, 116, 109, 0.1);
}

.email-account-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.email-account-head > div {
  min-width: 0;
}

.email-account-title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.email-account-title-row h3 {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 15px;
}

.email-account-head p {
  margin: 4px 0 0;
  color: var(--muted);
  overflow-wrap: anywhere;
  font-size: 12px;
}

.email-current-badge {
  padding: 3px 7px;
  color: var(--teal);
  background: var(--soft-teal);
  border: 1px solid #a8d8ce;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 900;
}

.email-account-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px 16px;
  margin: 0;
}

.email-account-meta div {
  min-width: 0;
}

.email-account-meta dt {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
}

.email-account-meta dd {
  margin: 2px 0 0;
  overflow-wrap: anywhere;
  color: var(--slate);
  font-size: 12px;
  font-weight: 800;
}

.email-account-error {
  margin: 0;
  padding: 9px 10px;
  color: #8d352b;
  background: var(--soft-red);
  border-radius: var(--radius-sm);
  font-size: 11px;
  overflow-wrap: anywhere;
}

.email-account-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 2px;
}

.email-sender-empty {
  display: grid;
  justify-items: start;
  gap: 8px;
  grid-column: 1 / -1;
  min-height: 180px;
  padding: 32px;
  align-content: center;
  background: var(--panel-soft);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
}

.email-sender-form {
  display: grid;
  gap: 16px;
}

.email-secure-field {
  align-content: start;
}

.email-checkbox {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 40px;
  padding: 0 12px;
  color: var(--slate);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-weight: 800;
}

.email-checkbox input {
  width: 16px;
  height: 16px;
  accent-color: var(--teal);
}

.email-sender-form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.email-sender-form-actions p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.message-body {
  padding: 13px;
  color: var(--slate);
  background: #f7fafc;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  white-space: pre-wrap;
}

.inbox-chat-preview {
  display: block;
  width: 100%;
  min-height: 48px;
  text-align: left;
  font-weight: 500;
}

.inbox-chat-preview:hover {
  border-color: #9fb6c8;
  background: #f1f7fa;
}

.inbox-chat-type-control {
  display: inline-flex;
  align-items: center;
}

.inbox-chat-type-control select {
  min-width: 132px;
  min-height: 34px;
  padding: 0 32px 0 12px;
  color: var(--ink);
  background-color: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.inbox-chat-type-control select:hover {
  border-color: var(--line-strong);
}

.inbox-chat-type-control select:focus-visible {
  outline: 3px solid rgba(20, 184, 166, 0.2);
  outline-offset: 1px;
  border-color: var(--teal);
}

.inbox-chat-type-control select:disabled {
  cursor: wait;
  opacity: 0.6;
}

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

.duplicate-side {
  padding: 12px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.duplicate-side strong {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
}

.setup-panel {
  margin-top: 14px;
}

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

.setup-grid div {
  display: grid;
  gap: 6px;
}

label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

code {
  display: block;
  overflow: auto;
  padding: 11px 12px;
  color: #e8fff9;
  background: #101a26;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
}

.empty {
  display: grid;
  place-items: center;
  min-height: 160px;
  color: var(--muted);
  text-align: center;
  border: 1px dashed #b7c4d1;
  border-radius: var(--radius);
  background: var(--panel-soft);
}

body.modal-open {
  overflow: hidden;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 25;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(17, 27, 33, 0.56);
  backdrop-filter: blur(8px);
}

.chat-modal {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  width: min(940px, calc(100vw - 56px));
  max-height: min(760px, calc(100vh - 56px));
  min-height: min(620px, calc(100vh - 56px));
  overflow: hidden;
  background: #fff;
  border: 1px solid rgba(209, 216, 220, 0.96);
  border-radius: 8px;
  box-shadow: 0 34px 90px rgba(9, 16, 28, 0.38);
}

.manual-customer-modal {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(780px, calc(100vw - 56px));
  max-height: min(760px, calc(100vh - 56px));
  overflow: hidden;
  background: #fff;
  border: 1px solid rgba(209, 216, 220, 0.96);
  border-radius: 8px;
  box-shadow: 0 34px 90px rgba(9, 16, 28, 0.38);
}

.chat-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 16px;
  background: #f0f2f5;
  border-bottom: 1px solid #d8dee4;
}

.chat-modal-head h2 {
  margin: 0;
  color: #111b21;
  font-size: 17px;
  line-height: 1.2;
}

.chat-modal-head p {
  margin: 4px 0 0;
  color: #667781;
  font-size: 12px;
}

.chat-modal-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.translation-select {
  width: auto;
  min-width: 132px;
  min-height: 34px;
  padding: 0 8px;
  font-size: 12px;
}

.manual-customer-form {
  display: grid;
  gap: 14px;
  min-height: 0;
  overflow: auto;
  padding: 18px 22px 20px;
  background: #fff;
}

.manual-customer-form label {
  display: grid;
  gap: 6px;
  color: var(--slate);
  font-size: 12px;
  font-weight: 900;
}

.manual-field-label {
  color: var(--slate);
  font-size: 12px;
  font-weight: 900;
}

.manual-avatar-field,
.manual-field-group {
  display: grid;
  gap: 8px;
}

.manual-avatar-upload {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px;
  background: #f8fafb;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.manual-avatar-preview {
  flex: 0 0 auto;
  display: grid;
  width: 64px;
  height: 64px;
  place-items: center;
  overflow: hidden;
  color: var(--muted);
  background: #eef3f6;
  border: 1px dashed var(--line-strong);
  border-radius: 50%;
  font-size: 10px;
  font-weight: 800;
  text-align: center;
}

.manual-avatar-preview.has-image {
  border-style: solid;
}

.manual-avatar-preview img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.manual-avatar-copy {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.manual-avatar-copy > strong {
  overflow: hidden;
  color: var(--slate);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.manual-avatar-copy > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.manual-upload-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.manual-customer-form .manual-file-button {
  display: inline-flex;
  width: auto;
  align-items: center;
  justify-content: center;
  color: var(--slate);
  font-size: 11px;
  font-weight: 900;
  cursor: pointer;
}

.manual-tag-picker {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto auto;
  align-items: end;
  gap: 8px;
}

.manual-tag-picker .btn {
  min-height: 38px;
  white-space: nowrap;
}

.manual-selected-tags {
  min-height: 30px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.manual-selected-tags .muted {
  font-size: 11px;
}

.manual-material-dropzone {
  min-height: 92px;
}

.manual-material-file-list {
  max-height: 188px;
  overflow: auto;
}

.manual-customer-wide {
  grid-column: 1 / -1;
}

.inline-fields {
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr);
  gap: 8px;
}

.manual-customer-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 4px;
  border-top: 1px solid var(--line);
}

.modal-close {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  color: #54656f;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 24px;
  line-height: 1;
}

.modal-close:hover {
  color: #111b21;
  background: #e2e7eb;
}

.remark-editor {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  padding: 9px 16px;
  border-bottom: 1px solid #e2e8ee;
  background: #fbfcfd;
}

.modal-chat-thread {
  height: auto;
  min-height: 0;
  border: 0;
  border-radius: 0;
  padding: 18px 24px;
}

.chat-history-control {
  display: flex;
  justify-content: center;
  min-height: 34px;
  color: #667781;
  font-size: 12px;
  font-weight: 800;
}

.chat-history-control span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 10px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(115, 125, 134, 0.12);
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 30;
  display: none;
  max-width: min(420px, calc(100vw - 44px));
  padding: 13px 15px;
  color: #fff;
  background: #111c29;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  box-shadow: 0 18px 46px rgba(15, 23, 42, 0.28);
}

.toast.show {
  display: block;
}

.activation-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(360px, 0.85fr);
  gap: 16px;
  align-items: start;
}

.activation-side {
  display: grid;
  gap: 16px;
}

.activation-detail-panel {
  margin-top: 16px;
}

.activation-form {
  display: grid;
  gap: 14px;
}

.form-grid {
  display: grid;
  gap: 12px;
}

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

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

.form-grid label,
.activation-form > label,
.rule-box label {
  display: grid;
  gap: 6px;
  color: var(--slate);
  font-size: 12px;
  font-weight: 900;
}

.textarea {
  min-height: 86px;
  padding-top: 10px;
  resize: vertical;
}

.small-textarea {
  min-height: 64px;
}

.field-note {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.multi {
  min-height: 112px;
  padding: 8px;
}

.rule-box {
  display: grid;
  gap: 12px;
  padding: 14px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.rule-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.rule-title strong {
  font-size: 14px;
  font-weight: 900;
}

.rule-title span,
.muted {
  color: var(--muted);
  font-size: 12px;
}

.check-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.check-pill,
.toggle-line {
  display: inline-flex !important;
  grid-template-columns: none !important;
  align-items: center;
  gap: 7px !important;
  width: fit-content;
  min-height: 32px;
  padding: 0 10px;
  color: var(--ink) !important;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.activation-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.activation-summary article {
  min-height: 76px;
  padding: 12px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.activation-summary span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.activation-summary strong {
  display: block;
  margin-top: 8px;
  font-size: 24px;
  line-height: 1;
}

.activation-preview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
}

.activation-preview-grid h3 {
  margin: 0 0 10px;
  font-size: 14px;
  font-weight: 900;
}

.mini-list {
  display: grid;
  gap: 8px;
}

.mini-row {
  display: grid;
  gap: 4px;
  padding: 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.mini-row strong {
  font-size: 13px;
}

.mini-row span,
.campaign-row small {
  color: var(--muted);
  font-size: 12px;
}

.muted-row {
  background: #f7f9fc;
}

.campaign-list {
  display: grid;
  gap: 8px;
}

.campaign-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px 10px;
  align-items: center;
  width: 100%;
  padding: 12px;
  text-align: left;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.campaign-row.active,
.campaign-row:hover {
  background: #eef8f6;
  border-color: #b6d8d1;
}

.campaign-row strong,
.activation-detail-head h3 {
  display: block;
  margin: 0;
  font-size: 14px;
  font-weight: 900;
}

.campaign-row small:last-child {
  grid-column: 1 / -1;
}

.activation-detail-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.activation-detail-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.activation-actions {
  justify-content: start;
  margin-bottom: 14px;
}

.compact-table table {
  min-width: 760px;
}

.publisher-segments {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.publisher-segment {
  display: grid !important;
  gap: 5px !important;
  min-height: 82px;
  padding: 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
}

.publisher-segment input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.publisher-segment strong {
  font-size: 14px;
  font-weight: 900;
}

.publisher-segment span,
.publisher-safety span,
.mini-row p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.publisher-segment.active,
.publisher-segment:has(input:checked) {
  background: #eef8f6;
  border-color: #9dd1c9;
  box-shadow: inset 0 0 0 1px rgba(11, 116, 109, 0.18);
}

.compact-multi {
  min-height: 78px;
}

.publisher-message {
  min-height: 132px;
}

.publisher-safety {
  display: grid;
  align-content: center;
  gap: 5px;
  min-height: 40px;
  padding: 10px 12px;
  background: #effaf4;
  border: 1px solid #c8e7d0;
  border-radius: var(--radius-sm);
}

.publisher-safety strong {
  color: var(--green);
  font-size: 13px;
  font-weight: 900;
}

.publisher-progress {
  margin-bottom: 14px;
}

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

  .board,
  .split,
  .activation-layout,
  .activation-preview-grid,
  .email-account-list {
    grid-template-columns: 1fr;
  }

  .toolbar,
  .setup-grid,
  .form-grid.three,
  .publisher-segments {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .customer-split {
    grid-template-columns: minmax(0, 1fr) 320px;
  }
}

@media (max-width: 980px) {
  .customer-split {
    grid-template-columns: minmax(0, 1fr);
  }

  .customer-detail-panel {
    position: static;
    width: 100%;
    max-height: none;
  }

  .customer-detail-panel > .panel-body {
    overflow-y: visible;
    scrollbar-gutter: auto;
  }
}

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

  .sidebar {
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    padding: 14px;
    transition: none;
  }

  .sidebar:hover,
  .sidebar.is-expanded {
    width: auto;
    box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.04);
  }

  .brand {
    width: 100%;
  }

  .brand-copy,
  .nav button > span:not(.mark),
  .home-link > span:not(.mark),
  .sidebar-footer {
    opacity: 1;
    pointer-events: auto;
    transform: none;
    transition: none;
  }

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

  .nav button,
  .home-link {
    grid-template-columns: 28px minmax(0, 1fr) auto;
    width: 100%;
    min-width: 0;
    height: auto;
    min-height: 42px;
    padding: 0 11px;
    overflow: visible;
  }

  .sidebar-footer {
    position: static;
  }

  .topbar {
    grid-template-columns: 1fr;
    padding: 16px;
  }

  .top-actions {
    justify-content: start;
  }

  .dashboard-switch {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
  }

  .dashboard-switch button {
    padding: 0 8px;
  }

  .content {
    padding: 16px;
  }

  .inbox-search-toolbar {
    width: 100%;
    margin-left: 0;
  }

  .inbox-title-row {
    align-items: stretch;
    flex-direction: column;
  }

  .inbox-type-filter,
  .inbox-type-filter select {
    width: 100%;
  }

  .metrics,
  .toolbar,
  .profile-meta,
  .summary-line,
  .duplicate-grid,
  .setup-grid,
  .portrait-grid,
  .form-grid.two,
	  .form-grid.three,
	  .activation-summary,
	  .publisher-segments,
	  .tag-library-form,
	  .tag-library-groups,
	  .option-library-groups,
    .email-sender-notes,
    .email-account-meta {
	    grid-template-columns: 1fr;
	  }

  .email-delivery-summary,
  .email-sender-form-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .email-sender-form-actions .btn {
    width: 100%;
  }

  .customer-bulk-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .customer-bulk-toolbar .btn {
    width: 100%;
  }

  .assignment-actions {
    align-items: stretch;
    flex-direction: column;
    width: 100%;
  }

  .assignment-actions .field,
  .assignment-actions .btn {
    width: 100%;
    min-width: 0;
  }

  .tag-library-bulk-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .tag-library-bulk-toolbar .btn {
    width: 100%;
  }

  .inline-tag-menu {
    width: min(360px, calc(100vw - 32px));
  }

  .inline-tag-grid,
  .inline-custom-tag-editor {
    grid-template-columns: 1fr;
  }

  .summary-label {
    padding-top: 0;
  }

  .note-card-head {
    align-items: stretch;
    flex-direction: column;
  }

  .note-card-head .btn {
    width: 100%;
  }

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

  .compact-action-field {
    grid-template-columns: 1fr;
  }

  .tag-dropdown-grid {
    grid-template-columns: 1fr;
  }

  .custom-tag-editor,
  .multi-contact-row {
    grid-template-columns: 1fr;
  }

  .customer-toolbar #searchInput {
    grid-column: auto;
  }

  .pending-pill {
    border-radius: 8px;
  }

  .pending-pill .tag {
    max-width: 100%;
    white-space: normal;
  }

  .conversation-head {
    align-items: start;
    flex-direction: column;
  }

  .conversation-actions {
    justify-content: start;
    flex-wrap: wrap;
  }

  .chat-thread {
    height: min(560px, 68vh);
    min-height: 320px;
    padding: 12px;
  }

  .chat-bubble {
    min-width: 0;
    max-width: 88%;
  }

  .chat-meta {
    flex-wrap: wrap;
  }

  .modal-backdrop {
    padding: 10px;
  }

  .chat-modal {
    width: calc(100vw - 20px);
    min-height: calc(100vh - 20px);
    max-height: calc(100vh - 20px);
  }

  .manual-customer-modal {
    width: calc(100vw - 20px);
    max-height: calc(100vh - 20px);
  }

  .chat-modal-head {
    align-items: stretch;
    flex-direction: column;
    padding: 14px 12px 11px;
  }

  .chat-modal-tools {
    justify-content: start;
    flex-wrap: wrap;
  }

  .translation-select {
    width: min(180px, 100%);
  }

  .manual-customer-form {
    padding: 14px 12px 16px;
  }

  .manual-avatar-upload {
    align-items: flex-start;
  }

  .manual-tag-picker {
    grid-template-columns: 1fr;
  }

  .manual-tag-picker .btn {
    width: 100%;
  }

  .inline-fields,
  .manual-customer-actions {
    grid-template-columns: 1fr;
  }

  .manual-customer-actions {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .remark-editor {
    grid-template-columns: 1fr;
    padding: 10px 12px;
  }

  .modal-chat-thread {
    height: auto;
  }
}
/* Multi-account scope and owner-managed subaccounts. */
.topbar-actions { display: flex; align-items: flex-end; justify-content: flex-end; gap: 12px; flex-wrap: wrap; }
.system-account-filter { display: grid; gap: 5px; min-width: 220px; color: #64748b; font-size: 12px; }
.system-account-filter select { min-height: 40px; max-width: 420px; border: 1px solid #d8e0ea; border-radius: 10px; padding: 0 34px 0 12px; background: #fff; color: #172033; }
.assignment-actions { display: flex; align-items: center; gap: 8px; }
.assignment-actions .field { min-width: 240px; height: 40px; min-height: 40px; padding-block: 0; }
.assignment-actions .btn,
.customer-bulk-toolbar > .btn { height: 40px; min-height: 40px; padding-inline: 14px; font-size: 12px; line-height: 1; white-space: nowrap; }
.assignment-actions [data-preview-assignment] { min-width: 132px; }
.customer-bulk-toolbar [data-delete-selected-customers] { min-width: 112px; }
.member-admin-panel { grid-column: 1 / -1; }
.member-create-form { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr) minmax(180px, 1fr) auto; gap: 12px; align-items: end; padding-bottom: 18px; border-bottom: 1px solid #e8edf3; }
.member-create-form label, .member-account-edit label, .member-password-reset label, .member-grant-row label { display: grid; gap: 6px; color: #536174; font-size: 12px; }
.member-account-list { display: grid; gap: 16px; margin-top: 18px; }
.member-account-card { border: 1px solid #dfe6ee; border-radius: 14px; padding: 16px; background: #fff; }
.member-account-card.is-disabled { background: #f8fafc; }
.member-account-head, .member-grant-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.member-account-head > div { display: grid; gap: 4px; }
.member-account-head span, .member-grant-head span { color: #718096; font-size: 12px; }
.member-account-edit { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(230px, auto) auto; gap: 12px; align-items: end; margin-top: 14px; }
.member-account-capabilities { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; min-height: 40px; padding: 7px 10px; background: #f7fafc; border: 1px solid #dfe6ee; border-radius: 10px; }
.member-account-capabilities .check-row { display: flex; align-items: center; gap: 6px; color: #334155; white-space: nowrap; }
.member-password-reset { display: grid; grid-template-columns: minmax(240px, 1fr) auto; gap: 12px; align-items: end; margin-top: 12px; }
.member-grant-matrix { display: grid; gap: 10px; margin-top: 16px; padding-top: 14px; border-top: 1px dashed #dfe6ee; }
.member-grant-row { display: grid; grid-template-columns: minmax(150px, 1fr) minmax(130px, .7fr) minmax(130px, .7fr) auto; gap: 10px; align-items: end; }
.permission-disabled { opacity: .58; cursor: not-allowed !important; pointer-events: none; }
body[data-customer-access="none"] .customer-select-column,
body[data-customer-access="none"] .customer-select-cell,
body[data-customer-access="none"] [data-customer-bulk-toolbar] { display: none !important; }
@media (max-width: 900px) {
  .topbar-actions, .member-create-form, .member-account-edit, .member-password-reset, .member-grant-row { grid-template-columns: 1fr; width: 100%; }
  .topbar-actions { display: grid; }
  .system-account-filter { width: 100%; }
}
@media (max-width: 780px) {
  .assignment-actions { align-items: stretch; flex-direction: column; width: 100%; }
  .assignment-actions .field,
  .assignment-actions .btn { width: 100%; min-width: 0; }
}
