* {
  box-sizing: border-box;
}
/* Every font-size in the dashboard is expressed in rem against this root, so the
   whole interface scales from one place. The dense 9-12px type the screens shipped
   with was hard to read for long operational sessions; 20px root renders it at
   11-15px while keeping the type hierarchy exactly as designed. */
html {
  font-size: 20px;
}
[hidden] {
  display: none !important;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}
html[dir="ltr"] {
  font-family: var(--font-dashboard);
}
button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
}
.hidden {
  display: none !important;
}
.muted {
  color: var(--muted);
}
.danger {
  color: var(--red) !important;
}
.positive {
  color: var(--green) !important;
}
.rtl {
  direction: rtl;
  text-align: right;
}
.nowrap {
  white-space: nowrap;
}
.grow {
  flex: 1;
}
.row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.stack {
  display: grid;
  gap: 10px;
}
.icon-svg {
  display: block;
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.icon {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  flex: 0 0 22px;
}
[dir="rtl"] .nav button,
[dir="rtl"] th,
[dir="rtl"] .threaditem,
[dir="rtl"] .multi-trigger,
[dir="rtl"] .sort-button {
  text-align: right;
}
[dir="rtl"] .kpi:before {
  inset: 0 0 0 auto;
}
[dir="rtl"] .note {
  border-left: 0;
  border-right: 3px solid var(--green);
  border-radius: var(--r-sm) 0 0 var(--r-sm);
}
[dir="rtl"] .top-actions .btn + .btn {
  margin-left: 0;
  margin-right: 6px;
}
[dir="rtl"] .top-actions .btn + .btn:before {
  left: auto;
  right: -8px;
}
.app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 244px minmax(0, 1fr);
  transition: grid-template-columns 0.18s ease;
}
.side {
  position: sticky;
  top: 0;
  height: 100vh;
  background: linear-gradient(180deg, var(--nav) 0%, var(--nav2) 100%);
  color: var(--navink);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
}
.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 2px 8px 18px;
}
.logo {
  width: 68px;
  height: 46px;
  border-radius: var(--r-md);
  display: grid;
  place-items: center;
  overflow: hidden;
  background: var(--card);
  box-shadow: 0 7px 20px rgba(15, 23, 42, 0.34);
}
.logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.brand b {
  font-size: 1.125rem;
  letter-spacing: -0.02em;
}
.brand small {
  display: block;
  color: var(--navmuted);
  margin-top: 2px;
}
.nav {
  display: grid;
  gap: 4px;
}
.nav button {
  border: 0;
  border-bottom: 1px solid var(--navline);
  background: transparent;
  color: var(--navmuted);
  padding: 12px 13px;
  text-align: right;
  border-radius: var(--r-sm);
  font-weight: 720;
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 48px;
  transition:
    background 0.15s,
    color 0.15s,
    transform 0.1s;
}
.nav button:hover {
  background: rgba(217, 249, 157, 0.08);
  color: #fff;
}
.nav button.active {
  background: linear-gradient(
    120deg,
    rgba(217, 249, 157, 0.22),
    rgba(217, 249, 157, 0.08)
  );
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(217, 249, 157, 0.28);
}
.nav button:active {
  transform: scale(0.98);
}
.sidefoot {
  margin-top: auto;
  border-top: 1px solid var(--navline);
  padding: 15px 9px 0;
  font-size: 0.75rem;
  color: var(--navmuted);
}
.sidefoot b {
  display: block;
  color: var(--navink);
  margin-bottom: 4px;
}
/* Desktop sidebar states live in shell.css, keyed on the data attributes that
   sidebar.mjs writes onto .app. */
.main {
  min-width: 0;
  padding: 27px 30px 60px;
}
.top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 15px;
  margin-bottom: 22px;
}
.eyebrow {
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--green);
  font-weight: 850;
}
.top h1 {
  margin: 5px 0 2px;
  font-size: 1.875rem;
  letter-spacing: -0.04em;
}
.top-actions {
  display: flex;
  gap: 8px;
}
.top-actions .btn + .btn {
  position: relative;
  margin-left: 6px;
}
.top-actions .btn + .btn:before {
  content: "";
  position: absolute;
  left: -8px;
  top: 7px;
  bottom: 7px;
  width: 1px;
  background: var(--line-strong);
}
.btn {
  border: 1px solid var(--line-strong);
  background: var(--card);
  color: var(--ink);
  padding: 9px 13px;
  border-radius: var(--r-sm);
  font-weight: 750;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  transition:
    border-color 0.15s,
    background 0.15s,
    box-shadow 0.15s,
    transform 0.1s;
}
.btn:hover {
  border-color: var(--green);
  box-shadow: var(--shadow);
}
.btn:active {
  transform: scale(0.98);
}
.btn:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}
.btn.primary {
  background: linear-gradient(135deg, var(--green), var(--green2));
  border-color: transparent;
  color: var(--action-primary-text);
  box-shadow: 0 6px 16px var(--greenglow);
}
.btn.primary:hover {
  filter: brightness(1.06);
}
.btn.small {
  font-size: 0.75rem;
  padding: 7px 9px;
}
.btn.small .icon-svg {
  width: 16px;
  height: 16px;
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}
.card {
  background: var(--card);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-lg);
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--line) 34%, transparent),
    var(--shadow);
}
.pad {
  padding: 18px;
}
.cardhead {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}
.cardhead h2,
.section h2 {
  margin: 0;
  font-size: 1.1875rem;
  letter-spacing: -0.02em;
}
.cardhead p,
.section p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.8125rem;
}
.kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 13px;
  margin-bottom: 14px;
}
.kpi {
  padding: 18px;
  position: relative;
  overflow: hidden;
}
.kpi:before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(180deg, var(--green), transparent);
}
.kpi span {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 650;
}
.kpi strong {
  display: block;
  margin-top: 8px;
  font-size: 1.75rem;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.section {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-end;
  margin-bottom: 14px;
}
.status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--card2);
  color: var(--muted);
  font-weight: 800;
  font-size: 0.625rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.status:before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.9;
}
.status.created,
.status.ready,
.status.open,
.status.order_confirmed,
.status.confirmed,
.status.active,
.status.delivered,
.status.delivery_in_progress,
.status.pending_shipping_company,
.status.sent {
  background: var(--mint);
  color: var(--green);
  border: 1px solid color-mix(in srgb, var(--green) 45%, transparent);
}
.status.new,
.status.waiting_customer,
.status.submitting,
.status.cancelling,
.status.paused,
.status.campaign_paused,
.status.adset_paused {
  background: var(--amberbg);
  color: var(--amber);
  border: 1px solid color-mix(in srgb, var(--amber) 45%, transparent);
}
.status.archived,
.status.inactive,
.status.completed {
  background: var(--card2);
  color: var(--muted);
  border: 1px solid var(--line-strong);
}
.status.needs_human,
.status.rejected,
.status.submission_unknown,
.status.cancel_unknown,
.status.failed,
.status.unavailable,
.status.with_issues,
.status.deleted,
.status.disapproved {
  background: var(--redbg);
  color: var(--red);
  border: 1px solid color-mix(in srgb, var(--red) 45%, transparent);
}
.field {
  display: grid;
  gap: 5px;
}
.field label {
  font-size: 0.6875rem;
  color: var(--muted);
  font-weight: 750;
}
.input,
.field input,
.field textarea,
.field select {
  width: 100%;
  border: 1px solid var(--line-strong);
  background: var(--card2);
  border-radius: var(--r-sm);
  padding: 9px 11px;
  color: var(--ink);
  outline: none;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}
.field textarea {
  resize: vertical;
  min-height: 70px;
}
.input:focus,
.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: var(--green);
  box-shadow: var(--focus);
}
.field input[readonly] {
  opacity: 0.72;
  cursor: not-allowed;
}
.profit-field input {
  font-size: 1.125rem;
  font-weight: 900;
  border-width: 2px;
}
.formgrid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 11px;
}
.wide {
  grid-column: 1/-1;
}
.actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}
.note {
  padding: 11px 13px;
  background: var(--mint);
  border-left: 3px solid var(--green);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  color: var(--ink);
  font-size: 0.75rem;
  line-height: 1.55;
  opacity: 0.92;
}
.delivery-mode {
  border: 0;
  padding: 0;
  margin: 3px 0 2px;
}
.delivery-mode legend {
  font-size: 0.75rem;
  font-weight: 850;
  margin-bottom: 8px;
}
.mode-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.mode-card {
  position: relative;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line-strong);
  background: var(--card2);
  border-radius: var(--r-md);
  cursor: pointer;
  transition:
    border-color 0.15s,
    background 0.15s,
    box-shadow 0.15s,
    transform 0.1s;
}
.mode-card:hover {
  border-color: var(--green);
}
.mode-card.active {
  border-color: var(--green);
  background: var(--mint);
  box-shadow: var(--focus);
}
.mode-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.mode-symbol {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--card);
  border: 1px solid var(--line);
  font-size: 1.1875rem;
}
.mode-card strong {
  display: block;
  font-size: 0.8125rem;
}
.mode-card small {
  display: block;
  color: var(--muted);
  font-size: 0.6875rem;
  line-height: 1.45;
  margin-top: 3px;
}
.pricing-panel {
  padding: 14px;
  border: 1px solid var(--line-strong);
  background: var(--card2);
  border-radius: var(--r-md);
}
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 11px;
}
.pricing-panel .field input {
  background: var(--card);
}
.pricing-panel .field input.pricing-input {
  border-color: color-mix(in srgb, var(--green) 58%, var(--line));
  box-shadow: inset 0 0 0 1px var(--mint);
  font-weight: 800;
}
.pricing-panel .note {
  margin-top: 11px;
}
.price-mode {
  font-size: 0.625rem;
  color: var(--green);
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 9px;
}
.date-filter {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 14px;
  margin-bottom: 14px;
}
.date-filter-copy {
  min-width: 150px;
}
.date-filter-copy b {
  display: block;
  font-size: 0.8125rem;
}
.date-filter-copy span {
  display: block;
  color: var(--muted);
  font-size: 0.625rem;
  margin-top: 3px;
}
.date-pills {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}
.date-pill {
  border: 1px solid var(--line-strong);
  background: var(--card2);
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 0.6875rem;
  font-weight: 780;
  color: var(--muted);
}
.date-pill:hover,
.date-pill.active {
  border-color: var(--green);
  background: var(--mint);
  color: var(--green);
}
.custom-range {
  display: flex;
  align-items: center;
  gap: 6px;
}
.custom-range input {
  width: 135px;
  padding: 6px 8px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: var(--card2);
  font-size: 0.6875rem;
}
.staffid {
  display: flex;
  align-items: center;
  gap: 10px;
}
.staffavatar {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: var(--mint);
  color: var(--green);
  display: grid;
  place-items: center;
  font-weight: 900;
}
.staffactions {
  display: flex;
  align-items: center;
  gap: 7px;
}
.tablewrap {
  overflow: auto;
}
.tablecard {
  overflow: hidden;
}
table {
  width: 100%;
  border-collapse: collapse;
}
th {
  background: var(--card2);
  color: var(--muted);
  font-size: 0.625rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  text-align: left;
  padding: 11px 14px;
  position: sticky;
  top: 0;
  z-index: 1;
}
td {
  border-top: 1px solid var(--line);
  padding: 12px 14px;
  font-size: 0.8125rem;
  vertical-align: middle;
}
tbody tr {
  transition:
    background 0.12s,
    color 0.12s;
}
tbody tr:hover {
  background: var(--interaction-hover-bg);
  color: var(--interaction-hover-text);
}
tbody tr:hover td,
tbody tr:hover a,
tbody tr:hover button:not(.primary):not(.danger) {
  color: inherit !important;
}
tbody tr:hover td :not(.status):not(.status *) {
  color: inherit !important;
}
.cellmain {
  font-weight: 760;
}
.cellsub {
  font-size: 0.6875rem;
  color: var(--muted);
  margin-top: 3px;
  max-width: 340px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.empty {
  padding: 35px !important;
  text-align: center;
  color: var(--muted);
}
.inbox {
  height: calc(100vh - 135px);
  min-height: 570px;
  display: grid;
  overflow: hidden;
}
.threadlist {
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.inboxfilters {
  padding: 13px;
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 8px;
}
.threaditems {
  overflow: auto;
}
.threaditem {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: var(--card);
  padding: 13px;
  text-align: left;
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 10px;
  transition: background 0.12s;
}
.threaditem:hover {
  background: var(--card2);
}
.threaditem.active {
  background: var(--mint);
}
.avatar {
  width: 42px;
  height: 42px;
  border-radius: var(--r-md);
  background: linear-gradient(145deg, var(--mint), var(--card2));
  color: var(--green);
  display: grid;
  place-items: center;
  font-weight: 900;
  overflow: hidden;
}
.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.threadmeta {
  min-width: 0;
}
.threadtop {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.threadtop b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.threadtop time {
  font-size: 0.625rem;
  color: var(--muted);
}
.preview {
  font-size: 0.75rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 4px;
}
/* The inbox unread-count pill. This was called `.unread`, which also matches the
   `unread` state modifier on `.notification-item`, so every unread operational alert
   was rendered as an 18px-tall centred pill and clipped its own title and body. The
   badge keeps its own name so a state modifier can never inherit badge geometry. */
.unread-count {
  display: inline-grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  background: var(--green);
  color: #fff;
  font-size: 0.625rem;
  padding: 0 5px;
  box-shadow: 0 2px 8px var(--greenglow);
}
.chat {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: var(--bg);
}
.chatactive {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}
.chathead {
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--card);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}
.chathead .grow {
  min-width: 0;
}
.chathead .grow b {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chathead .grow .muted {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.botstate {
  white-space: nowrap;
}
.messages {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.bubble {
  max-width: 78%;
  padding: 10px 13px;
  border-radius: 16px;
  border-bottom-left-radius: 6px;
  background: var(--card);
  border: 1px solid var(--line);
  align-self: flex-start;
  line-height: 1.55;
  font-size: 0.875rem;
  box-shadow: var(--shadow);
}
.bubble.out {
  align-self: flex-end;
  background: linear-gradient(135deg, var(--green), var(--green2));
  color: #fff;
  border-color: transparent;
  border-bottom-left-radius: 16px;
  border-bottom-right-radius: 6px;
}
.bubble.agent {
  background: linear-gradient(135deg, #1d4530, #12331f);
  border-color: transparent;
  color: #eaf6ee;
}
.bubble.internal {
  align-self: center;
  background: var(--amberbg);
  color: var(--amber);
  border-color: transparent;
}
.bubble small {
  display: block;
  opacity: 0.7;
  font-size: 0.5625rem;
  margin-top: 5px;
}
.message-media {
  display: grid;
  gap: 6px;
  margin-top: 6px;
}
.message-image,
.message-video {
  display: block;
  max-width: min(360px, 100%);
  max-height: 360px;
  border-radius: 10px;
  object-fit: contain;
  background: rgba(0, 0, 0, 0.08);
}
.message-audio {
  display: block;
  width: min(320px, 100%);
}
.message-file {
  display: inline-flex;
  color: inherit;
  text-decoration: underline;
  word-break: break-all;
}
.composer {
  padding: 10px 12px 12px;
  border-top: 1px solid var(--line);
  background: var(--card);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px 8px;
  flex: 0 0 auto;
  position: sticky;
  bottom: 0;
  z-index: 3;
}
.composerlabel {
  grid-column: 1/-1;
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 0.6875rem;
  font-weight: 750;
}
.composer-media {
  grid-column: 1/-1;
  display: grid;
  grid-template-columns: 145px minmax(0, 1fr);
  gap: 7px;
}
.composerhint {
  grid-column: 1/-1;
  color: var(--muted);
  font-size: 0.625rem;
}
.composer textarea {
  min-width: 0;
  min-height: 48px;
  max-height: 110px;
  resize: none;
}
.composer .btn {
  align-self: stretch;
  min-width: 96px;
}
.customer {
  border-left: 1px solid var(--line);
  padding: 15px;
  background: var(--card);
  overflow: auto;
  min-height: 0;
}
.customer h3 {
  margin: 14px 0 13px;
}
.customer .field {
  margin-bottom: 9px;
}
.socialcard {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 10px;
  background: var(--card2);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
}
.socialavatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--mint);
}
.socialfallback {
  display: grid;
  place-items: center;
  color: var(--green);
  font-weight: 900;
}
.socialcard b,
.socialcard span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.socialcard span {
  font-size: 0.625rem;
  color: var(--muted);
  margin-top: 2px;
}
.facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 12px 0;
}
.fact {
  background: var(--card2);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 9px;
}
.fact span {
  font-size: 0.5625rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.fact b {
  display: block;
  font-size: 0.75rem;
  margin-top: 3px;
  word-break: break-word;
}
.placeholder {
  height: 100%;
  display: grid;
  place-items: center;
  color: var(--muted);
  text-align: center;
  padding: 30px;
}
.composer {
  display: block;
  padding: 10px 12px 12px;
}
.composer-shell {
  border: 1px solid var(--line);
  background: var(--card2);
  border-radius: 18px;
  padding: 9px;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}
.composer-shell:focus-within {
  border-color: var(--green);
  box-shadow: var(--focus);
}
.composer textarea {
  width: 100%;
  min-height: 54px;
  max-height: 128px;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: 6px 8px;
  resize: none;
}
.composerbar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-top: 6px;
}
.composerbar .tool {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 12px;
  flex: 0 0 36px;
}
.composerbar .primary {
  margin-left: auto;
  min-width: 90px;
  height: 38px;
}
.composerhint {
  margin: 6px 5px 0;
  min-height: 15px;
}
.filechip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 3px 3px 7px;
  padding: 8px 10px;
  border-radius: 11px;
  background: var(--mint);
  font-size: 0.6875rem;
}
.filechip button {
  border: 0;
  background: transparent;
  color: var(--red);
  font-weight: 900;
}
.dialect-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.6875rem;
  color: var(--muted);
  font-weight: 750;
  margin-left: 3px;
  white-space: nowrap;
}
.dialect-toggle input {
  accent-color: var(--green);
}
.advanced-media {
  display: grid;
  grid-template-columns: 125px 1fr;
  gap: 6px;
  margin: 5px 3px 7px;
}
.rewrite-preview {
  margin: 0 0 8px;
  border: 1px solid var(--green);
  background: var(--mint);
  border-radius: 14px;
  padding: 10px;
}
.rewrite-preview b {
  font-size: 0.6875rem;
}
.rewrite-preview p {
  margin: 6px 0;
  line-height: 1.55;
  font-size: 0.8125rem;
  white-space: pre-wrap;
}
.recording {
  color: var(--red) !important;
  background: var(--redbg) !important;
  border-color: var(--red) !important;
  animation: pulse 1.1s infinite;
}
@keyframes pulse {
  50% {
    opacity: 0.65;
  }
}
.sales-builder {
  border: 1px solid var(--line);
  background: var(--card2);
  border-radius: var(--r-md);
  padding: 14px;
}
.sales-builder h3 {
  margin: 0 0 4px;
  font-size: 0.875rem;
}
.sales-builder p {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.6875rem;
}
.notification-destinations {
  display: grid;
  gap: 9px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--card2);
}
.notification-destinations .row {
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
}
.notification-destinations input {
  accent-color: var(--green);
}
.rule-row {
  display: grid;
  grid-template-columns: 1.1fr 1fr 1fr auto;
  gap: 7px;
  align-items: end;
  margin-top: 7px;
}
.rule-row .btn {
  height: 39px;
}
.chip-options {
  display: grid;
  gap: 7px;
}
.product-chip {
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 8px;
  background: var(--card);
  display: flex;
  gap: 6px;
  align-items: center;
  font-size: 0.6875rem;
}
.product-chip input {
  accent-color: var(--green);
}
.cross-option {
  display: grid;
  grid-template-columns: auto minmax(130px, 1fr) minmax(115px, 0.55fr) minmax(
      150px,
      1fr
    );
  gap: 8px;
}
.cross-option input[type="number"],
.cross-option input[type="text"] {
  width: 100%;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card2);
  color: var(--ink);
}
.importbox {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 9px;
}
.previewgrid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.productpick {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 11px;
  display: grid;
  gap: 6px;
  background: var(--card2);
}
.productpick img {
  width: 100%;
  height: 120px;
  object-fit: contain;
  background: var(--card);
  border-radius: 8px;
}
.productpick label {
  font-size: 0.8125rem;
  font-weight: 750;
}
.analytics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 13px;
}
.metric {
  padding: 16px;
}
.metric span {
  font-size: 0.6875rem;
  color: var(--muted);
  font-weight: 650;
}
.metric strong {
  display: block;
  font-size: 1.4375rem;
  margin-top: 7px;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.growth-layout {
  display: grid;
  grid-template-columns: 1.35fr 0.65fr;
  gap: 14px;
  margin-top: 14px;
}
.chart {
  min-height: 260px;
  display: flex;
  align-items: flex-end;
  gap: 7px;
  padding: 18px 8px 8px;
  overflow-x: auto;
}
.chart-day {
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 7px;
  min-width: 38px;
  height: 220px;
  text-align: center;
  color: var(--muted);
  font-size: 0.5625rem;
}
.chart-bars {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 3px;
  height: 190px;
  border-bottom: 1px solid var(--line);
}
.chart-bar {
  width: 8px;
  min-height: 2px;
  border-radius: 5px 5px 1px 1px;
  background: var(--green);
}
.chart-bar.spend {
  background: var(--amber);
}
.chart-bar.profit {
  background: var(--status-info);
}
.chart-legend {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.625rem;
}
.chart-legend i {
  width: 8px;
  height: 8px;
  display: inline-block;
  border-radius: 3px;
  margin-right: 4px;
}
.funnel-list {
  display: grid;
  gap: 9px;
  margin-top: 14px;
}
.funnel-row {
  display: grid;
  grid-template-columns: 105px 1fr 45px;
  align-items: center;
  gap: 8px;
  font-size: 0.6875rem;
}
.funnel-track {
  height: 12px;
  border-radius: 999px;
  background: var(--card2);
  overflow: hidden;
}
.funnel-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--green2), var(--green));
  min-width: 2px;
}
.growth-status {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.growth-status .fact {
  background: var(--card2);
  padding: 12px;
  border-radius: var(--r-sm);
}
.growth-status .fact span {
  display: block;
  color: var(--muted);
  font-size: 0.625rem;
}
.growth-status .fact b {
  display: block;
  margin-top: 5px;
}
.settingsgrid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.ai-route-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 11px;
}
.ai-route {
  padding: 14px;
  border: 1px solid var(--line);
  background: var(--card2);
  border-radius: var(--r-md);
}
.ai-route h3 {
  font-size: 0.875rem;
  margin: 0;
}
.ai-route .route-meta {
  font-size: 0.625rem;
  color: var(--green);
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 3px 0 11px;
}
.ai-route .field input {
  background: var(--card);
}
.staffrow {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}
body.auth-locked .app,
body.auth-locked .mobilebar {
  display: none !important;
}
.gate {
  position: fixed;
  inset: 0;
  z-index: 30;
  background:
    radial-gradient(circle at 18% 8%, var(--greenglow), transparent 32%),
    linear-gradient(145deg, var(--bg), var(--card2));
  display: grid;
  place-items: center;
  padding: 24px;
  overflow: auto;
}
.gatecard {
  width: min(430px, 100%);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 32px;
  box-shadow: var(--shadow-lg);
}
.gatecard .logo {
  width: 48px;
  height: 48px;
}
.gatecard h1 {
  margin: 18px 0 7px;
  font-size: 1.875rem;
  letter-spacing: -0.04em;
}
.login-kicker {
  margin-top: 16px;
  color: var(--green);
  font-size: 0.625rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.13em;
}
.login-copy {
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 0.8125rem;
  line-height: 1.55;
}
.gatecard .field label {
  font-size: 0.75rem;
}
.gatecard .field input {
  min-height: 48px;
  font-size: 0.9375rem;
}
.gatecard form .primary {
  width: 100%;
  min-height: 47px;
  margin-top: 4px;
}
.error {
  color: var(--red);
  font-size: 0.75rem;
  margin-top: 10px;
  min-height: 18px;
}
.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  background: var(--nav2);
  color: #fff;
  padding: 11px 15px;
  border-radius: var(--r-sm);
  z-index: 50;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.toast.bad {
  background: #8f302b;
}
.theme-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}
.theme-choice {
  border: 1px solid var(--line);
  background: var(--card2);
  color: var(--ink);
  border-radius: var(--r-md);
  padding: 11px;
  text-align: left;
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 9px;
  align-items: center;
}
.theme-choice:hover,
.theme-choice.active {
  border-color: var(--green);
  box-shadow: var(--focus);
}
.theme-choice.active {
  background: var(--mint);
}
.theme-preview {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: inset 0 0 0 8px var(--preview-card);
}
.theme-choice b {
  display: block;
  font-size: 0.75rem;
}
.theme-choice small {
  display: block;
  color: var(--muted);
  font-size: 0.5625rem;
  margin-top: 2px;
  line-height: 1.3;
}
.notification-button {
  position: relative;
}
.notification-count {
  position: absolute;
  right: -5px;
  top: -6px;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  background: var(--red);
  color: #fff;
  font-size: 0.5625rem;
  display: grid;
  place-items: center;
  padding: 0 4px;
}
.notification-panel {
  position: absolute;
  z-index: 25;
  right: 30px;
  top: 78px;
  width: min(390px, calc(100vw - 24px));
  max-height: 70vh;
  overflow: auto;
  padding: 12px;
}
/* On a phone the desktop top bar is display:none, so the 30px inset the panel was
   anchored with no longer had a control to hang off and pushed the card six pixels
   past the left edge. Below the mobile header, the panel is measured from both
   edges instead, and it sits above it so a tap never lands behind the header. */
@media (max-width: 760px) {
  .notification-panel {
    position: fixed;
    top: 64px;
    right: 12px;
    left: 12px;
    width: auto;
    max-height: calc(100dvh - 140px);
    z-index: 39;
  }
}
.notification-tabs {
  display: flex;
  gap: 6px;
  margin-top: 10px;
}
.notification-tabs button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 0.6875rem;
  font-weight: 800;
  padding: 5px 8px;
  border-radius: 8px;
}
.notification-tabs button.active {
  background: var(--mint);
  color: var(--green);
}
.notification-item {
  padding: 11px;
  border-radius: 12px;
  background: var(--card2);
  border: 1px solid var(--line);
  margin-top: 8px;
}
.notification-item.unread {
  box-shadow: inset 3px 0 var(--green);
}
.notification-item.resolved {
  opacity: 0.68;
}
.notification-item b {
  font-size: 0.75rem;
}
.notification-item p {
  font-size: 0.6875rem;
  color: var(--muted);
  margin: 4px 0;
}
.notification-recency {
  display: block;
  margin-top: 2px;
  font-size: 0.625rem;
  color: var(--muted);
}
.notification-incident {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px;
  margin-top: 8px;
  background: var(--card2);
}
.notification-incident-head {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 2px 3px 8px;
}
.notification-incident-head b {
  font-size: 0.75rem;
}
.notification-incident .notification-item {
  background: var(--card);
}
.notif-pref-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
}
.notif-pref-table th,
.notif-pref-table td {
  padding: 6px 8px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}
.notif-pref-table th {
  color: var(--muted);
  font-weight: 600;
}
.alert-health-telegram {
  margin-top: 12px;
}
.alert-health-subhead {
  font-size: 0.8125rem;
  margin: 0 0 6px;
}
.alert-health-failrow {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px 0;
  border-top: 1px solid var(--line);
  font-size: 0.75rem;
}
.alert-health-failrow span {
  color: var(--muted);
}
.notification-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 9px;
}
.mobilebar {
  display: none;
}
.catalog-controls {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 160px 160px;
  gap: 9px;
  margin: 0 0 14px;
}
.product-cell {
  display: flex;
  gap: 10px;
  align-items: center;
  min-width: 220px;
}
.product-thumb {
  width: 42px;
  height: 42px;
  object-fit: contain;
  background: var(--card2);
  border: 1px solid var(--line);
  border-radius: 10px;
  flex: 0 0 42px;
}
.product-thumb.empty {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 1.125rem;
}
.product-cell .cellmain {
  max-width: 250px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.editor-shell {
  margin-top: 14px;
}
.editor-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}
.editor-header h2 {
  margin: 0;
  font-size: 1.4375rem;
  letter-spacing: -0.03em;
}
.editor-header p {
  margin: 5px 0 0;
  font-size: 0.75rem;
  color: var(--muted);
}
.editor-tabs {
  display: flex;
  gap: 6px;
  overflow: auto;
  padding: 3px 0 12px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 16px;
}
.editor-tab {
  border: 0;
  background: transparent;
  border-radius: 9px;
  padding: 8px 10px;
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--muted);
  white-space: nowrap;
}
.editor-tab:hover,
.editor-tab.active {
  background: var(--mint);
  color: var(--green);
}
.editor-panel {
  display: none;
}
.editor-panel.active {
  display: grid;
  gap: 14px;
}
.editor-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
  gap: 14px;
}
.gallery-main {
  height: 300px;
  border: 1px dashed var(--line);
  border-radius: var(--r-md);
  display: grid;
  place-items: center;
  overflow: hidden;
  background: var(--card2);
  color: var(--muted);
}
.gallery-main img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: var(--card);
}
.gallery-strip {
  display: flex;
  gap: 8px;
  overflow: auto;
  padding: 9px 0;
}
.media-card {
  position: relative;
  flex: 0 0 94px;
  border: 1px solid var(--line);
  border-radius: 11px;
  overflow: hidden;
  background: var(--card2);
}
.media-card.active {
  border-color: var(--green);
  box-shadow: var(--focus);
}
.media-card img {
  display: block;
  width: 92px;
  height: 72px;
  object-fit: contain;
  background: var(--card);
}
.media-card .media-actions {
  display: flex;
  gap: 1px;
  border-top: 1px solid var(--line);
}
.media-card button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-weight: 900;
  font-size: 0.6875rem;
  min-width: 30px;
  padding: 5px;
}
.media-card button:hover {
  color: var(--green);
  background: var(--mint);
}
.offer-list,
.flow-builder {
  display: grid;
  gap: 9px;
}
.offer-card,
.flow-card {
  border: 1px solid var(--line);
  background: var(--card2);
  border-radius: var(--r-md);
  padding: 12px;
}
.offer-card {
  display: grid;
  grid-template-columns:
    88px minmax(105px, 1fr) minmax(105px, 1fr) minmax(0, 1.5fr)
    auto;
  gap: 8px;
  align-items: end;
}
.offer-card .field input {
  background: var(--card);
}
.offer-card .profit-summary {
  font-size: 0.6875rem;
  color: var(--green);
  font-weight: 800;
}
.flow-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
}
.flow-card .field {
  min-width: 0;
}
.flow-card .field input,
.flow-card .field textarea,
.flow-card .field select {
  background: var(--card);
}
.flow-tools {
  display: flex;
  gap: 4px;
  align-items: center;
}
.flow-tools .btn {
  padding: 6px 8px;
}
.flow-explanation {
  line-height: 1.7;
}
.cross-sell-studio {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.65fr);
  gap: 12px;
  align-items: start;
}
.cross-sell-catalog {
  display: grid;
  gap: 9px;
}
.cross-product {
  display: block;
  padding: 0;
  border: 1px solid var(--line-strong);
  overflow: hidden;
}
.cross-product.selected {
  border-color: var(--green);
  box-shadow: var(--focus);
}
.cross-product-head {
  display: grid;
  grid-template-columns: auto 48px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 11px;
  background: var(--card);
}
.cross-product-head input {
  width: 18px;
  height: 18px;
  accent-color: var(--green);
}
.cross-product-head .cellsub {
  display: block;
  margin-top: 2px;
  overflow-wrap: anywhere;
}
.cross-product img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  background: var(--card2);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.cross-product-fields {
  display: none;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  padding: 12px;
  border-top: 1px solid var(--line);
  background: var(--card2);
}
.cross-product.selected .cross-product-fields {
  display: grid;
}
.cross-product-fields .wide {
  grid-column: 1/-1;
}
.cross-product-fields input,
.cross-product-fields select,
.cross-product-fields textarea {
  width: 100%;
  padding: 8px;
  border: 1px solid var(--line-strong);
  background: var(--card);
  border-radius: 9px;
  color: var(--ink);
}
.cross-product-fields textarea {
  min-height: 64px;
  resize: vertical;
}
.cross-product-safety {
  grid-column: 1/-1;
  padding: 8px 10px;
  border-radius: 9px;
  background: var(--mint);
  color: var(--green);
  font-size: 0.625rem;
  font-weight: 800;
}
.cross-product-safety.unsafe {
  background: var(--redbg);
  color: var(--red);
}
.cross-billing-preview {
  position: sticky;
  top: 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  background: var(--card);
  padding: 13px;
  box-shadow: var(--shadow-sm);
}
.cross-preview-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.cross-preview-eye {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--mint);
  color: var(--green);
  font-size: 1.0625rem;
}
.cross-preview-lines {
  display: grid;
  gap: 7px;
  margin: 10px 0;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.cross-preview-line {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.6875rem;
}
.cross-preview-line span {
  color: var(--muted);
}
.cross-preview-line.total {
  font-size: 0.8125rem;
  font-weight: 900;
}
.cross-preview-line.profit b {
  color: var(--green);
}
.cross-preview-line.profit.unsafe b {
  color: var(--red);
}
.cross-preview-copy {
  padding: 10px;
  border-radius: 10px;
  background: var(--mint);
  font-size: 0.6875rem;
  line-height: 1.65;
}
.cross-preview-steps {
  margin: 11px 0 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 0.625rem;
  line-height: 1.55;
}
.switchline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--card2);
}
.switchline input {
  accent-color: var(--green);
  width: 18px;
  height: 18px;
}
.editor-savebar {
  position: sticky;
  bottom: 10px;
  z-index: 3;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 11px 13px;
  background: color-mix(in srgb, var(--card) 92%, transparent);
  backdrop-filter: blur(10px);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
}
.editor-savebar .dirty {
  font-size: 0.6875rem;
  color: var(--amber);
  font-weight: 800;
}
.hidden-input {
  display: none !important;
}
html,
body {
  max-width: 100%;
  overflow-x: hidden;
}
.logo {
  background: var(--card);
  overflow: hidden;
}
.logo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.inbox {
}
.threadlist,
.threaditems,
.chat,
.chatactive,
.messages,
.customer {
  min-width: 0;
}
.inboxfilterrow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 7px;
}
.inboxfilterrow .btn {
  padding-inline: 9px;
}
.bubble {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.bubble > div {
  max-width: 100%;
  overflow-wrap: anywhere;
}
.bubble > div:first-child:not(.message-media) {
  white-space: pre-wrap;
}
.message-media,
.message-image,
.message-video,
.message-audio {
  min-width: 0;
  max-width: 100%;
}
.platform-badge {
  display: inline-flex;
  align-items: center;
  width: max-content;
  max-width: 100%;
  margin-top: 4px;
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--mint);
  color: var(--green);
  font-size: 0.5625rem;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.socialcard {
  min-width: 0;
}
.socialcard > div:last-child {
  min-width: 0;
}
.chathead > * {
  min-width: 0;
}
.app {
  background: linear-gradient(90deg, var(--nav2) 0 244px, var(--bg) 244px);
}

.side {
  min-height: 100dvh;
}
.main {
  background: var(--bg);
}
.custom-order-panel {
  margin-bottom: 14px;
}
.custom-order-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: 14px;
}
.custom-order-products,
.custom-order-customer {
  display: grid;
  gap: 12px;
}
.custom-product-picker {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  max-height: 280px;
  overflow: auto;
  padding: 2px;
}
.custom-product-option {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  padding: 9px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  background: var(--card2);
}
.custom-product-option img {
  width: 42px;
  height: 42px;
  object-fit: contain;
  border-radius: 9px;
  background: var(--card);
}
.custom-product-option b {
  display: block;
  font-size: 0.75rem;
}
.custom-order-lines {
  display: grid;
  gap: 8px;
}
.custom-order-line {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) 82px 130px 110px auto;
  gap: 8px;
  align-items: end;
  padding: 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  background: var(--card2);
}
.custom-order-line .field {
  min-width: 0;
}
.custom-order-line .field:first-child {
  align-self: center;
}
.custom-order-line .field:first-child b {
  font-size: 0.75rem;
}
.custom-order-line .btn {
  height: 39px;
}
.custom-order-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.custom-order-summary .fact {
  padding: 11px;
}
.custom-order-summary .unsafe {
  color: var(--red);
}
.custom-order-summary .safe {
  color: var(--green);
}
.custom-order-confirm {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 11px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  background: var(--amberbg);
  font-size: 0.6875rem;
  line-height: 1.5;
}
.custom-order-confirm input {
  margin-top: 2px;
  accent-color: var(--green);
}
@media (max-width: 1500px) {
  /* The customer context used to disappear below 1500px with no way back. It is
     a collapsible pane now, so the operator decides. See inbox.css. */
}
@media (max-width: 1150px) {
  .kpis {
    grid-template-columns: repeat(2, 1fr);
  }
  .settingsgrid {
    grid-template-columns: 1fr;
  }
  .previewgrid {
    grid-template-columns: repeat(2, 1fr);
  }
  .custom-order-grid,
  .cross-sell-studio {
    grid-template-columns: 1fr;
  }
  .cross-billing-preview {
    position: static;
  }
  .custom-product-picker {
    grid-template-columns: 1fr;
  }
  .custom-order-line {
    grid-template-columns: minmax(150px, 1fr) 76px 120px 100px auto;
  }
}
@media (max-width: 760px) {
  .app {
    display: block;
  }
  .side {
    display: none;
  }
  .main {
    padding: 18px 12px 86px;
  }
  .top h1 {
    font-size: 1.5625rem;
  }
  .mobilebar {
    display: grid;
    position: fixed;
    z-index: 20;
    bottom: 8px;
    left: 8px;
    right: 8px;
    grid-template-columns: repeat(6, 1fr);
    background: rgba(10, 26, 17, 0.92);
    backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 5px;
    box-shadow: var(--shadow-lg);
  }
  .mobilebar button {
    border: 0;
    background: transparent;
    color: #9fb4a7;
    padding: 7px 2px;
    border-radius: 10px;
    font-size: 0.5625rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
  }
  .mobilebar .icon-svg {
    width: 18px;
    height: 18px;
  }
  .mobilebar button.active {
    background: rgba(84, 212, 136, 0.2);
    color: #fff;
  }
  .kpis,
  .grid2,
  .analytics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .kpi strong {
    font-size: 1.375rem;
  }
  .date-filter {
    align-items: flex-start;
    flex-direction: column;
  }
  .date-pills {
    width: 100%;
  }
  .custom-range {
    width: 100%;
    flex-wrap: wrap;
  }
  .custom-range input {
    flex: 1;
    min-width: 120px;
  }
  .inbox {
    height: calc(100dvh - 125px);
    min-height: 430px;
  }
  .threadlist {
    border: 0;
  }
  .chat {
    display: none;
  }
  .inbox.chatopen .threadlist {
    display: none;
  }
  .inbox.chatopen .chat {
    display: flex;
  }
  .chathead {
    padding: 9px;
    flex-wrap: wrap;
  }
  .chathead .grow {
    min-width: 120px;
  }
  .chathead .input {
    width: 145px !important;
  }
  .composer .btn {
    min-width: 76px;
  }
  .formgrid,
  .mode-options,
  .pricing-grid,
  .theme-options,
  .cross-product-fields {
    grid-template-columns: 1fr;
  }
  .cross-product-fields .wide {
    grid-column: auto;
  }
  .wide {
    grid-column: auto;
  }
  .previewgrid {
    grid-template-columns: 1fr;
  }
  .hidephone {
    display: none;
  }
  .top-actions .btn:first-child {
    display: none;
  }
  .gate {
    padding: 15px;
  }
  .gatecard {
    padding: 24px;
  }
}
@media (max-width: 760px) {
  .composerbar {
    flex-wrap: wrap;
  }
  .dialect-toggle {
    order: 5;
    width: 100%;
    margin-top: 3px;
  }
  .advanced-media,
  .rule-row,
  .cross-option {
    grid-template-columns: 1fr;
  }
  .composerbar .primary {
    min-width: 74px;
  }
  .sales-builder {
    padding: 11px;
  }
}
.composerbar {
  flex-wrap: wrap;
}
.composerbar .primary {
  margin-left: 0;
}
.dialect-toggle {
  flex: 1 1 145px;
  min-width: 145px;
}
@media (max-width: 760px) {
  .dialect-toggle {
    flex-basis: 100%;
    min-width: 100%;
  }
  .mobilebar {
    grid-template-columns: repeat(7, 1fr) !important;
  }
  .growth-layout {
    grid-template-columns: 1fr;
  }
  .growth-status {
    grid-template-columns: 1fr;
  }
  .funnel-row {
    grid-template-columns: 90px 1fr 40px;
  }
}
.customer-orders {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.customer-orders-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.customer-orders-head h3 {
  margin: 0;
}
.customer-orders-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.625rem;
  line-height: 1.45;
}
.order-history {
  display: grid;
  gap: 8px;
  margin-top: 11px;
}
.history-order {
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--card2);
}
.history-order-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
.history-order b {
  font-size: 0.75rem;
}
.history-order-lines {
  margin-top: 7px;
  font-size: 0.6875rem;
  line-height: 1.5;
}
.history-order-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.5625rem;
}
.customer-orders {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.customer-orders-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.customer-orders-head h3 {
  margin: 0;
}
.customer-orders-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.625rem;
  line-height: 1.45;
}
.order-history {
  display: grid;
  gap: 8px;
  margin-top: 11px;
}
.history-order {
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--card2);
}
.history-order-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
.history-order b {
  font-size: 0.75rem;
}
.history-order-lines {
  margin-top: 7px;
  font-size: 0.6875rem;
  line-height: 1.5;
}
.history-order-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.5625rem;
}
.performance-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}
.performance-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}
.performance-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 9px 0;
  border-top: 1px solid var(--line);
}
.performance-row:first-child {
  border-top: 0;
}
.performance-row b {
  font-size: 0.75rem;
}
.performance-row span {
  color: var(--muted);
  font-size: 0.625rem;
}
.performance-meter {
  height: 7px;
  background: var(--card2);
  border-radius: 99px;
  overflow: hidden;
  margin-top: 5px;
}
.performance-meter i {
  display: block;
  height: 100%;
  background: var(--green);
  border-radius: 99px;
}
.live-pulse {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  margin-right: 5px;
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--green) 16%, transparent);
}
.inboxsegmentrow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 7px;
}
.customer-tag-editor {
  display: grid;
  gap: 8px;
}
.customer-tag-presets,
.customer-tag-list,
.thread-customer-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.customer-tag-preset,
.customer-tag-chip,
.thread-customer-chip {
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--card2);
  color: var(--muted);
  padding: 5px 8px;
  font-size: 0.625rem;
  font-weight: 800;
}
.customer-tag-preset {
  cursor: pointer;
}
.customer-tag-preset:hover,
.customer-tag-preset.active {
  border-color: var(--green);
  background: var(--mint);
  color: var(--green);
}
.customer-tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--ink);
}
.customer-tag-chip button {
  border: 0;
  background: transparent;
  color: var(--red);
  padding: 0;
  font-weight: 900;
}
.customer-tag-add {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
}
.customer-summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  margin: 11px 0;
}
.customer-stat {
  padding: 9px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  background: var(--card2);
}
.customer-stat span {
  display: block;
  color: var(--muted);
  font-size: 0.5625rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.customer-stat b {
  display: block;
  margin-top: 3px;
  font-size: 0.75rem;
}
.customer-stat.tier {
  grid-column: 1/-1;
  background: var(--mint);
  border-color: color-mix(in srgb, var(--green) 45%, var(--line));
}
.thread-customer-meta {
  margin-top: 5px;
}
.thread-customer-chip {
  padding: 2px 6px;
  font-size: 0.5rem;
}
.thread-customer-chip.tier {
  background: var(--mint);
  color: var(--green);
  border-color: transparent;
}
@media (max-width: 760px) {
  .performance-grid {
    grid-template-columns: 1fr;
  }
  .app {
    background: var(--bg);
  }
  .custom-order-line {
    grid-template-columns: 1fr 1fr;
  }
  .custom-order-line .field:first-child {
    grid-column: 1/-1;
  }
  .custom-order-line .btn {
    width: 100%;
  }
  .custom-order-summary {
    grid-template-columns: 1fr 1fr;
  }
}
.settings-categories {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  padding: 8px;
}
.settings-category {
  border: 1px solid var(--line-strong);
  background: var(--card2);
  color: var(--muted);
  border-radius: 999px;
  padding: 9px 13px;
  font-size: 0.75rem;
  font-weight: 800;
}
.settings-category.active {
  border-color: var(--green);
  background: var(--mint);
  color: var(--green);
}
.settingsgrid > [data-settings-category].hidden {
  display: none !important;
}
.integration-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}
.integration-link {
  padding: 13px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  background: var(--card2);
  text-decoration: none;
}
.integration-link b,
.integration-link small {
  display: block;
}
.integration-link small {
  color: var(--muted);
  margin-top: 4px;
}
.test-profile {
  margin: 12px 0;
  padding: 11px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  background: var(--amberbg);
}
.ai-breakdown {
  margin-top: 14px;
}
.ai-daily {
  height: 150px;
  display: flex;
  align-items: flex-end;
  gap: 6px;
  padding: 12px 2px 20px;
  border-bottom: 1px solid var(--line-strong);
}
.ai-day {
  flex: 1;
  min-width: 18px;
  background: linear-gradient(180deg, var(--green), var(--green2));
  border-radius: 6px 6px 2px 2px;
  position: relative;
}
.ai-day span {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translate(-50%, 5px);
  font-size: 0.5rem;
  color: var(--muted);
}
.insight-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0;
}
.insight-block {
  padding: 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  background: var(--card);
}
.insight-block b {
  display: block;
  margin-bottom: 7px;
}
.insight-block li {
  margin: 5px 0;
}
.landing-command {
  margin-top: 13px;
  padding: 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  background: var(--card2);
}
.landing-command textarea {
  width: 100%;
  min-height: 80px;
  margin-top: 9px;
}
.landing-html-studio {
  display: grid;
  gap: 12px;
}
.landing-html-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.landing-html-code {
  width: 100%;
  min-height: 460px;
  padding: 14px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: #101712;
  color: #e9fff0;
  /* Raw HTML source: monospace earns its place here. */
  font-family: var(--font-technical);
  font-size: 0.6rem;
  font-weight: 500;
  line-height: 1.65;
  tab-size: 2;
  resize: vertical;
}
.landing-html-code:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: var(--focus);
}
.landing-html-preview {
  width: 100%;
  min-height: 520px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--card);
}
.landing-token-list {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.landing-token-list code {
  padding: 5px 7px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--card);
  font-size: 0.625rem;
}
.landing-revisions {
  font-size: 0.625rem;
  color: var(--muted);
}
.signal-state {
  display: block;
  margin-top: 5px;
  font-size: 0.625rem;
  font-weight: 750;
}
.signal-state.sent {
  color: var(--green);
}
.signal-state.failed,
.signal-state.suppressed_test_profile {
  color: var(--amber);
}
.system-status-summary {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  padding: 14px;
  margin: 2px 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  background: var(--card2);
}
.system-status-summary b {
  display: block;
  font-size: 0.9375rem;
}
.system-status-summary p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.6875rem;
  line-height: 1.55;
}
.system-status-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px;
}
.system-check {
  padding: 14px;
  border: 1px solid var(--line-strong);
  border-left: 4px solid var(--green);
  border-radius: var(--r-md);
  background: var(--card2);
}
.system-check.attention {
  border-left-color: var(--amber);
}
.system-check.critical {
  border-left-color: var(--red);
}
.system-check-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}
.system-check-head small {
  display: block;
  color: var(--muted);
  font-size: 0.5625rem;
  font-weight: 850;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.system-check h3 {
  margin: 0;
  font-size: 0.875rem;
}
.system-check-summary {
  margin: 9px 0 11px;
  color: var(--muted);
  font-size: 0.6875rem;
  line-height: 1.55;
}
.system-check-evidence {
  display: grid;
  gap: 6px;
}
.system-check-evidence .fact {
  padding: 8px 9px;
  background: var(--card);
  border-radius: 9px;
}
.system-check-evidence .fact span {
  font-size: 0.5625rem;
}
.system-check-evidence .fact b {
  font-size: 0.6875rem;
  overflow-wrap: anywhere;
}
.system-check-action {
  margin-top: 10px;
  padding: 9px;
  border-radius: 9px;
  background: var(--amberbg);
  font-size: 0.625rem;
  line-height: 1.5;
}
.system-check-verified {
  display: block;
  margin-top: 9px;
  color: var(--muted);
  font-size: 0.5625rem;
}
.log-export-actions {
  display: flex;
  gap: 7px;
  align-items: center;
  flex-wrap: wrap;
}
.meta-control {
  margin-top: 14px;
}
.meta-summary {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 12px 0;
}
.meta-builder {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(180px, 0.55fr) auto;
  gap: 9px;
  align-items: end;
  padding: 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  background: var(--card2);
}
.meta-assets-grid {
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: 12px;
  margin-top: 12px;
}
.meta-asset-list {
  display: grid;
  gap: 8px;
  max-height: 520px;
  overflow: auto;
}
.meta-asset {
  padding: 11px;
  border: 1px solid var(--line-strong);
  border-left-width: 4px;
  border-radius: var(--r-sm);
  background: var(--card2);
}
.meta-asset.state-active {
  border-left-color: var(--green);
}
.meta-asset.state-paused {
  border-left-color: var(--amber);
}
.meta-asset.state-problem {
  border-left-color: var(--red);
}
.meta-asset.state-inactive {
  border-left-color: var(--line-strong);
}
.meta-asset-with-thumb {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}
.meta-ad-thumb {
  width: 68px;
  height: 68px;
  object-fit: cover;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--card);
}
.meta-asset-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: flex-start;
}
.meta-asset-actions {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin-top: 9px;
  padding-top: 9px;
  border-top: 1px solid var(--line);
}
.meta-product-select {
  min-width: 180px;
  max-width: 100%;
  border: 1px solid var(--line-strong);
  background: var(--card);
  color: var(--text);
  border-radius: 8px;
  padding: 8px;
}
.meta-unmapped {
  color: var(--amber);
  font-weight: 800;
}
.asset-filterbar {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(130px, 0.55fr);
  gap: 7px;
  margin: 9px 0;
}
.asset-filterbar-ads {
  grid-template-columns: minmax(220px, 1.25fr) repeat(3, minmax(130px, 0.55fr));
}
.asset-filterbar .input {
  min-height: 42px;
  width: 100%;
}
.asset-id {
  font-family: var(--font-technical);
  font-size: 0.625rem;
  overflow-wrap: anywhere;
}
.mapping-source {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 5px;
  padding: 4px 7px;
  border-radius: 999px;
  background: var(--mint);
  color: var(--green);
  font-size: 0.5625rem;
  font-weight: 850;
}
.mapping-source.suggested {
  background: var(--amberbg);
  color: var(--amber);
}
.mapping-confidence {
  font-variant-numeric: tabular-nums;
}
.mapping-row-actions {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto;
  gap: 7px;
  align-items: center;
}
.asset-empty-help {
  display: grid;
  gap: 6px;
}
.asset-empty-help b {
  font-size: 0.8125rem;
}
/* Status tones come from design-tokens.css, so a badge, a status tab and the legend
   entry for the same outcome can never drift apart, and a new theme restates tokens
   instead of re-listing every status class. */
.status.pending,
.status.pending_confirmation,
.status.order_received,
.status.pending_shipping_company {
  background: var(--tone-pending-bg);
  color: var(--tone-pending-text);
  border-color: var(--tone-pending-border);
}
.status.confirmed,
.status.created,
.status.processing {
  background: var(--tone-confirmed-bg);
  color: var(--tone-confirmed-text);
  border-color: var(--tone-confirmed-border);
}
.status.pending_delivery,
.status.delivery_in_progress,
.status.shipped,
.status.out_for_delivery {
  background: var(--tone-transit-bg);
  color: var(--tone-transit-text);
  border-color: var(--tone-transit-border);
}
.status.delivered,
.status.completed {
  background: var(--tone-delivered-bg);
  color: var(--tone-delivered-text);
  border-color: var(--tone-delivered-border);
}
.status.suspended {
  background: var(--tone-suspended-bg);
  color: var(--tone-suspended-text);
  border-color: var(--tone-suspended-border);
}
.status.returned_to_seller,
.status.returned,
.status.returning {
  background: var(--tone-returned-bg);
  color: var(--tone-returned-text);
  border-color: var(--tone-returned-border);
}
.status.returned_after_delivery {
  background: var(--tone-returned-late-bg);
  color: var(--tone-returned-late-text);
  border-color: var(--tone-returned-late-border);
}
.status.cancelled,
.status.taager_cancelled,
.status.delivery_cancelled,
.status.customer_rejected,
.status.rejected {
  background: var(--tone-cancelled-bg);
  color: var(--tone-cancelled-text);
  border-color: var(--tone-cancelled-border);
}
.status.delivered,
.status.delivery_in_progress,
.status.pending_shipping_company,
.status.suspended,
.status.returned_to_seller,
.status.returned_after_delivery,
.status.cancelled {
  border-width: 1px;
}
.order-status-legend { position: relative; }
.order-status-legend > summary {
  min-height: 38px;
  padding: 9px 11px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  background: var(--card);
  color: var(--muted);
  font-size: 0.6875rem;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
  white-space: nowrap;
}
.order-status-legend-popover {
  position: absolute;
  z-index: 30;
  inset-block-start: calc(100% + 6px);
  inset-inline-end: 0;
  width: min(360px, calc(100vw - 32px));
  padding: 10px;
  display: grid;
  gap: 8px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  background: var(--card);
  box-shadow: var(--shadow-lg);
}
.order-status-legend-popover > div {
  display: grid;
  grid-template-columns: minmax(118px, auto) 1fr;
  align-items: center;
  gap: 9px;
}
.order-status-legend-popover small { color: var(--muted); line-height: 1.35; }
.sync-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.sync-meta span {
  padding: 6px 9px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--card2);
  font-size: 0.6875rem;
  color: var(--muted);
}
.currency-filter {
  display: flex;
  align-items: center;
  gap: 6px;
  border-left: 1px solid var(--line-strong);
  padding-left: 10px;
  color: var(--muted);
  font-size: 0.6875rem;
  font-weight: 800;
}
.currency-filter select {
  border: 1px solid var(--line-strong);
  background: var(--card2);
  border-radius: 999px;
  padding: 7px 25px 7px 10px;
  min-width: 82px;
  color: var(--ink);
  font-weight: 850;
}

@media (max-width: 900px) {
  .meta-assets-grid,
  .meta-builder,
  .asset-filterbar-ads,
  .system-status-grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 760px) {
  .settings-categories,
  .integration-links,
  .insight-grid,
  .asset-filterbar,
  .mapping-row-actions {
    grid-template-columns: 1fr;
  }
  .settings-categories {
    display: grid;
  }
  .system-status-summary {
    flex-direction: column;
  }

  .sidebar-toggle {
    display: none;
  }
}
.inboxsegmentrow {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}
.inboxsegmentrow .btn {
  grid-column: 1/-1;
}
@media (min-width: 761px) {
  .side {
    position: fixed;
    inset: 0 auto 0 0;
    width: 244px;
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
    overscroll-behavior: contain;
    z-index: 20;
    transition: width 0.18s ease;
  }

  .side .nav {
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
  }
  .main {
    grid-column: 2;
  }
  html.inbox-mode,
  body.inbox-mode {
    height: 100dvh;
    max-height: 100dvh;
    overflow: hidden;
    overscroll-behavior: none;
  }
  body.inbox-mode .app {
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
  }
  body.inbox-mode .main {
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding-bottom: 24px;
  }
  body.inbox-mode .top {
    flex: 0 0 auto;
  }
  body.inbox-mode #view-conversations {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
  }
  body.inbox-mode .inbox {
    height: 100%;
    min-height: 0;
  }
  body.inbox-mode .threaditems,
  body.inbox-mode .messages,
  body.inbox-mode .customer {
    overscroll-behavior: contain;
  }
}
/* Reliability redesign: every wide surface owns its scrolling. The document never
       grows sideways, and each grid child is allowed to shrink inside the viewport. */
html,
body,
.app,
.main,
.view,
.card,
.section {
  min-width: 0;
  max-width: 100%;
}
body {
  overflow-x: clip;
}
.main {
  width: 100%;
  overflow-x: clip;
}
.tablewrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-gutter: stable;
}
.tablewrap table {
  min-width: 760px;
}
.inbox {
  width: 100%;
  max-width: 100%;
}
.threadlist,
.chat,
.customer {
  min-width: 0;
}
.sr-only {
  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;
}
.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 100;
  transform: translateY(-160%);
  padding: 11px 14px;
  border: 2px solid var(--green);
  border-radius: 10px;
  background: var(--card);
  color: var(--green);
  font-size: 0.75rem;
  font-weight: 900;
  box-shadow: var(--shadow-lg);
  transition: transform 0.18s ease;
}
.skip-link:focus {
  transform: translateY(0);
  outline: none;
  box-shadow: var(--focus), var(--shadow-lg);
}
.global-currency {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 7px 5px 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  background: var(--card);
  color: var(--muted);
  font-size: 0.6875rem;
  font-weight: 800;
  transition:
    border-color 0.2s,
    box-shadow 0.2s,
    background 0.2s;
}
.global-currency:hover,
.global-currency:focus-within {
  border-color: var(--green);
  box-shadow: var(--focus);
}
.global-currency .icon-svg {
  width: 17px;
  height: 17px;
  color: var(--green);
}
.global-currency select {
  min-width: 70px;
  border: 0;
  background: var(--card2);
  border-radius: 8px;
  padding: 6px 24px 6px 8px;
  color: var(--ink);
  font-weight: 900;
  outline: none;
  cursor: pointer;
}
.global-currency select:disabled {
  cursor: wait;
  opacity: 0.65;
}
.global-currency small {
  white-space: nowrap;
}
.performance-filters,
.order-filters {
  padding: 16px;
  margin-bottom: 14px;
}
.performance-filters {
  position: relative;
  z-index: 8;
  overflow: visible;
}
.performance-filters.loading {
  opacity: 0.72;
}
.performance-filter-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 13px;
}
.performance-filter-head h3 {
  margin: 0;
  font-size: 0.9375rem;
}
.performance-filter-head p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.6875rem;
}
.performance-filter-head-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}
.mapping-coverage {
  font-size: 0.625rem;
  font-weight: 850;
  color: var(--muted);
}
.mapping-coverage.ready {
  color: var(--green);
}
.mapping-coverage.warning {
  color: var(--amber);
}
.filter-grid {
  display: grid;
  grid-template-columns:
    minmax(210px, 1fr) minmax(210px, 1fr) minmax(210px, 1fr)
    minmax(180px, 0.65fr) auto;
  gap: 10px;
  align-items: end;
}
.order-filters .filter-grid {
  grid-template-columns:
    minmax(220px, 1fr) repeat(3, minmax(150px, 0.65fr))
    auto;
}
.filter-grid .field select {
  min-height: 44px;
}
.filter-summary {
  font-size: 0.6875rem;
  color: var(--muted);
  margin-top: 10px;
  line-height: 1.5;
}
.filter-summary.warning {
  padding: 9px 11px;
  border: 1px solid color-mix(in srgb, var(--amber) 48%, var(--line));
  border-radius: 10px;
  background: var(--amberbg);
  color: var(--ink);
}
.scope-card {
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: var(--card2);
}
.scope-card .icon-svg {
  width: 18px;
  height: 18px;
  color: var(--green);
}
.scope-card b {
  display: block;
  font-size: 0.6875rem;
}
.scope-card small {
  display: block;
  color: var(--muted);
  font-size: 0.5625rem;
  margin-top: 2px;
}
.filter-actions {
  display: flex;
  gap: 7px;
  min-height: 48px;
  align-items: stretch;
}
.filter-actions .btn {
  min-height: 44px;
}
.multi-filter {
  position: relative;
  min-width: 0;
}
.multi-filter-label {
  display: block;
  margin: 0 0 5px;
  font-size: 0.6875rem;
  color: var(--muted);
  font-weight: 780;
}
.multi-trigger {
  width: 100%;
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: var(--card2);
  color: var(--ink);
  text-align: left;
  transition:
    border-color 0.2s,
    box-shadow 0.2s,
    background 0.2s;
}
.multi-trigger:hover,
.multi-trigger[aria-expanded="true"] {
  border-color: var(--green);
  background: color-mix(in srgb, var(--mint) 55%, var(--card2));
  box-shadow: var(--focus);
}
.multi-trigger:focus-visible {
  outline: none;
  border-color: var(--green);
  box-shadow: var(--focus);
}
.multi-trigger-copy {
  min-width: 0;
  flex: 1;
}
.multi-trigger-copy b {
  display: block;
  font-size: 0.75rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.multi-trigger-copy small {
  display: block;
  color: var(--muted);
  font-size: 0.5625rem;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.multi-count {
  min-width: 24px;
  height: 24px;
  padding: 0 7px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: var(--mint);
  color: var(--green);
  font-size: 0.625rem;
  font-weight: 900;
}
.multi-count.zero {
  background: var(--card);
  color: var(--muted);
  padding: 0 7px;
}
.multi-chevron {
  width: 16px;
  height: 16px;
  transition: transform 0.2s ease;
}
.multi-trigger[aria-expanded="true"] .multi-chevron {
  transform: rotate(180deg);
}
.multi-popover {
  position: absolute;
  z-index: 60;
  top: calc(100% + 7px);
  left: 0;
  width: min(410px, calc(100vw - 48px));
  padding: 10px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: var(--card);
  box-shadow: var(--shadow-lg);
  animation: filterIn 0.18s ease-out;
}
.multi-filter:nth-child(3) .multi-popover {
  left: auto;
  right: 0;
}
@keyframes filterIn {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.multi-search {
  position: relative;
}
.multi-search .icon-svg {
  position: absolute;
  left: 11px;
  top: 12px;
  width: 17px;
  height: 17px;
  color: var(--muted);
  pointer-events: none;
}
.multi-search input {
  width: 100%;
  min-height: 42px;
  padding: 9px 10px 9px 36px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--card2);
  outline: none;
}
.multi-search input:focus {
  border-color: var(--green);
  box-shadow: var(--focus);
}
.multi-tools {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 8px 2px 6px;
}
.multi-tools span {
  font-size: 0.625rem;
  color: var(--muted);
}
.multi-tools div {
  display: flex;
  gap: 5px;
}
.multi-tool {
  min-height: 34px;
  border: 0;
  background: transparent;
  color: var(--green);
  font-size: 0.625rem;
  font-weight: 850;
  padding: 5px 7px;
  border-radius: 7px;
}
.multi-tool:hover,
.multi-tool:focus-visible {
  background: var(--mint);
  outline: none;
}
.multi-options {
  max-height: 286px;
  overflow: auto;
  display: grid;
  gap: 4px;
  overscroll-behavior: contain;
}
.multi-option {
  min-height: 48px;
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 7px 9px;
  border: 1px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  transition:
    background 0.15s,
    border-color 0.15s;
}
.multi-option:hover,
.multi-option:focus-within {
  background: var(--card2);
  border-color: var(--line);
}
.multi-option.selected {
  background: var(--mint);
  border-color: color-mix(in srgb, var(--green) 45%, var(--line));
}
.multi-option input {
  width: 17px;
  height: 17px;
  accent-color: var(--green);
}
.multi-option b {
  display: block;
  font-size: 0.6875rem;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.multi-option small {
  display: block;
  color: var(--muted);
  font-size: 0.5625rem;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.multi-status {
  font-size: 0.5rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.filter-chip-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.filter-chip {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 7px 5px 9px;
  border: 1px solid color-mix(in srgb, var(--green) 42%, var(--line));
  border-radius: 999px;
  background: var(--mint);
  color: var(--ink);
  font-size: 0.625rem;
}
.filter-chip button {
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 50%;
  background: var(--card);
  color: var(--muted);
  font-weight: 900;
  padding: 0;
}
.filter-chip button:hover,
.filter-chip button:focus-visible {
  color: var(--red);
  outline: none;
  box-shadow: var(--focus);
}
.performance-mapping-panel {
  padding: 16px;
  margin: -2px 0 14px;
  border-color: color-mix(in srgb, var(--green) 35%, var(--line-strong));
}
.mapping-toolbar {
  display: grid;
  grid-template-columns:
    minmax(220px, 1.3fr) repeat(3, minmax(150px, 0.7fr))
    auto;
  gap: 10px;
  margin: 12px 0;
  align-items: center;
}
.mapping-toolbar input,
.mapping-toolbar select {
  min-height: 44px;
}
.performance-mapping-list {
  display: grid;
  gap: 8px;
  max-height: 520px;
  overflow: auto;
  overscroll-behavior: contain;
}
.mapping-row {
  display: grid;
  grid-template-columns: minmax(260px, 1.3fr) minmax(240px, 1fr);
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--amber);
  border-radius: 12px;
  background: var(--card2);
}
.mapping-row.mapped {
  border-left-color: var(--green);
}
.mapping-row.unmapped {
  border-left-color: var(--line-strong);
}
.mapping-row-main {
  min-width: 0;
}
.mapping-row-main b,
.mapping-row-main small {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mapping-row-main small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.625rem;
}
.mapping-select {
  min-height: 44px;
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--card);
  padding: 8px 10px;
  outline: none;
}
.mapping-select:focus {
  border-color: var(--green);
  box-shadow: var(--focus);
}
.mapping-note {
  font-size: 0.625rem;
  color: var(--muted);
  line-height: 1.5;
}
.marketing-options {
  display: grid;
  gap: 9px;
  margin-top: 12px;
}
.marketing-option {
  min-height: 68px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 11px;
  align-items: center;
  padding: 11px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--card2);
  cursor: pointer;
}
.marketing-option:hover,
.marketing-option:focus-within {
  border-color: var(--green);
  box-shadow: var(--focus);
}
.marketing-option input {
  width: 18px;
  height: 18px;
  accent-color: var(--green);
}
.marketing-option b {
  display: block;
  font-size: 0.75rem;
}
.marketing-option small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.625rem;
  line-height: 1.45;
}
.option-tag {
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--card);
  color: var(--muted);
  font-size: 0.5625rem;
  font-weight: 900;
  text-transform: uppercase;
}
.option-tag.recommended {
  background: var(--mint);
  color: var(--green);
}
.metric-label {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.metric-info {
  min-height: 44px;
  padding: 8px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--card2);
  color: var(--muted);
  font-family: var(--font-dashboard);
  font-size: 0.6875rem;
  font-weight: 800;
  line-height: 1.2;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  cursor: help;
}
.metric-info .metric-info-mark {
  width: 18px;
  height: 18px;
  display: block;
  flex: 0 0 18px;
  color: currentColor;
}
.metric-info b {
  font: inherit;
}
.metric-info:hover,
.metric-info:focus-visible,
.metric-info[aria-expanded="true"] {
  border-color: var(--green);
  color: var(--green);
  outline: none;
  box-shadow: var(--focus);
}
.stage-card .metric-info,
.sortable .metric-info {
  width: 44px;
  min-width: 44px;
  min-height: 44px;
  padding: 8px;
  justify-content: center;
}
.stage-card .metric-info b,
.sortable .metric-info b {
  display: none;
}
.metric-help-popover {
  position: fixed;
  z-index: 100;
  width: min(380px, calc(100vw - 24px));
  padding: 14px 16px;
  border: 1px solid color-mix(in srgb, var(--green) 42%, var(--line-strong));
  border-radius: 12px;
  background: var(--nav2);
  color: #fff;
  text-transform: none;
  letter-spacing: 0;
  font-family: var(--font-dashboard);
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.6;
  box-shadow: var(--shadow-lg);
  white-space: normal;
  overflow-wrap: anywhere;
  pointer-events: none;
}
.metric-comparison {
  display: inline-flex;
  align-items: center;
  width: max-content;
  max-width: 100%;
  padding: 3px 7px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-weight: 850;
  line-height: 1.25;
}
.metric-comparison.positive {
  background: var(--mint);
  border-color: color-mix(in srgb, var(--green) 36%, transparent);
}
.metric-comparison.danger {
  background: var(--redbg);
  border-color: color-mix(in srgb, var(--red) 36%, transparent);
}
.metric-comparison.neutral {
  background: var(--card2);
  border-color: var(--line);
  color: var(--muted);
}
.stage-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 14px;
}
.stage-card {
  padding: 14px;
  border-top: 3px solid #65a5ff;
}
.stage-card b {
  display: block;
  font-size: 1.375rem;
  margin: 6px 0 2px;
  font-variant-numeric: tabular-nums;
}
.stage-card small {
  color: var(--muted);
}
.report-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.report-tab {
  min-height: 44px;
  border: 1px solid var(--line-strong);
  background: var(--card2);
  color: var(--muted);
  border-radius: 9px;
  padding: 8px 11px;
  font-weight: 800;
  font-size: 0.6875rem;
}
.report-tab.active,
.report-tab[aria-expanded="true"] {
  background: var(--mint);
  color: var(--green);
  border-color: var(--green);
}
.column-panel {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin: 0 14px 12px;
  padding: 12px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: var(--card2);
}
.column-panel > div:first-child b,
.column-panel > div:first-child span {
  display: block;
}
.column-panel > div:first-child span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.625rem;
}
.column-list {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.column-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 6px 5px 9px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--card);
  font-size: 0.625rem;
  font-weight: 800;
}
.column-item button {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 8px;
  background: var(--card2);
  color: var(--ink);
  font-weight: 900;
}
.column-item button:hover,
.column-item button:focus-visible {
  background: var(--mint);
  color: var(--green);
  outline: none;
  box-shadow: var(--focus);
}
.sortable {
  padding: 6px;
  user-select: none;
}
.sort-button {
  width: 100%;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: inherit;
  padding: 5px 7px;
  font: inherit;
  text-align: left;
}
.sort-button:hover,
.sort-button:focus-visible {
  border-color: var(--line-strong);
  background: var(--card2);
  color: var(--green);
  outline: none;
}
.sort-button.active {
  border-color: color-mix(in srgb, var(--green) 42%, var(--line));
  background: var(--mint);
  color: var(--green);
}
.sort-direction {
  display: inline-grid;
  place-items: center;
  min-width: 24px;
  height: 24px;
  border-radius: 7px;
  background: var(--card);
  font-size: 0.8125rem;
  font-weight: 900;
}
tfoot .report-total td {
  position: sticky;
  bottom: 0;
  background: var(--card2);
  border-top: 2px solid var(--green);
  font-weight: 900;
  box-shadow: 0 -4px 10px rgba(0, 0, 0, 0.04);
}
.order-test-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  font-size: 0.625rem;
  color: var(--muted);
  white-space: normal;
}
.order-test-toggle input {
  accent-color: var(--amber);
}
.assistant-fab {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 42;
  min-width: 142px;
  height: 56px;
  padding: 0 16px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 18px;
  background: linear-gradient(135deg, var(--green), var(--green2));
  color: #fff;
  box-shadow: 0 16px 42px var(--greenglow);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  font-size: 0.75rem;
  font-weight: 900;
  transition:
    filter 0.2s,
    box-shadow 0.2s,
    opacity 0.2s;
}
.assistant-fab:hover {
  filter: brightness(1.07);
  box-shadow: 0 20px 48px var(--greenglow);
}
.assistant-fab:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 4px var(--bg),
    var(--focus),
    0 20px 48px var(--greenglow);
}
.assistant-fab .icon-svg {
  width: 21px;
  height: 21px;
}
.assistant-fab-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--card);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.16);
}
.assistant-panel {
  position: fixed;
  right: 22px;
  bottom: 90px;
  z-index: 41;
  width: min(500px, calc(100vw - 24px));
  height: min(700px, calc(100dvh - 122px));
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  border-color: color-mix(in srgb, var(--green) 28%, var(--line-strong));
  box-shadow: var(--shadow-lg);
  animation: assistantIn 0.22s ease-out;
}
@keyframes assistantIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.assistant-head {
  padding: 15px 16px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--mint) 72%, var(--card)),
    var(--card)
  );
}
.assistant-identity {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-width: 0;
}
.assistant-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--green), var(--green2));
  color: #fff;
  box-shadow: 0 7px 18px var(--greenglow);
}
.assistant-mark .icon-svg {
  width: 20px;
  height: 20px;
}
.assistant-title-line {
  display: flex;
  align-items: center;
  gap: 7px;
}
.assistant-title-line b {
  font-size: 0.8125rem;
}
.assistant-live {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--green);
  font-size: 0.5625rem;
  font-weight: 900;
  text-transform: uppercase;
}
.assistant-live:before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
}
.assistant-head-actions {
  display: flex;
  gap: 6px;
}
.assistant-head-actions .btn {
  min-width: 38px;
  min-height: 38px;
}
.assistant-context {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  padding: 8px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--card2);
  font-size: 0.5625rem;
  color: var(--muted);
}
.assistant-context span {
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
}
.assistant-messages {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 15px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scroll-behavior: smooth;
}
.assistant-welcome {
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(
    135deg,
    var(--card2),
    color-mix(in srgb, var(--mint) 42%, var(--card2))
  );
}
.assistant-welcome b {
  font-size: 0.8125rem;
}
.assistant-welcome p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.6875rem;
  line-height: 1.55;
}
.assistant-message-row {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}
.assistant-message-row.user {
  justify-content: flex-end;
}
.assistant-avatar {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: var(--mint);
  color: var(--green);
  font-size: 0.5625rem;
  font-weight: 900;
}
.assistant-message-row.user .assistant-avatar {
  order: 2;
  background: var(--card2);
  color: var(--ink);
}
.assistant-proposal {
  margin-top: 10px;
}
.assistant-proposal .actions {
  margin-top: 10px;
  justify-content: flex-start;
}
.assistant-message {
  max-width: 86%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 13px 13px 13px 5px;
  background: var(--card2);
  font-size: 0.8125rem;
  line-height: 1.62;
  white-space: pre-wrap;
}
.assistant-message h4 {
  margin: 0 0 7px;
  color: var(--ink);
  font-size: 0.95rem;
  line-height: 1.35;
}
.assistant-message p {
  margin: 0 0 9px;
}
.assistant-message p:last-child,
.assistant-message ul:last-child {
  margin-bottom: 0;
}
.assistant-message ul {
  margin: 0 0 9px;
  padding-inline-start: 18px;
}
.assistant-message li {
  margin: 3px 0;
}
.assistant-message strong {
  font-weight: 800;
}
.assistant-message-row.user .assistant-message {
  border-radius: 13px 13px 5px 13px;
  background: var(--mint);
  border-color: color-mix(in srgb, var(--green) 35%, var(--line));
}
.assistant-message-meta {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.5rem;
}
.assistant-thinking {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
}
.assistant-dots {
  display: flex;
  gap: 4px;
}
.assistant-dots i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  animation: assistantDot 1s infinite ease-in-out;
}
.assistant-dots i:nth-child(2) {
  animation-delay: 0.15s;
}
.assistant-dots i:nth-child(3) {
  animation-delay: 0.3s;
}
@keyframes assistantDot {
  0%,
  80%,
  100% {
    opacity: 0.25;
    transform: translateY(0);
  }
  40% {
    opacity: 1;
    transform: translateY(-3px);
  }
}
.assistant-suggestions {
  display: grid;
  grid-auto-flow: column;
  grid-template-rows: repeat(2, minmax(44px, auto));
  grid-auto-columns: minmax(220px, max-content);
  gap: 7px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  padding: 0 14px 11px;
  scroll-snap-type: inline proximity;
  scrollbar-width: thin;
}
.assistant-suggestions button {
  max-width: 320px;
  min-height: 44px;
  white-space: normal;
  text-align: left;
  line-height: 1.35;
  scroll-snap-align: start;
}
[dir="rtl"] .assistant-suggestions button {
  text-align: right;
}
.assistant-compose {
  padding: 12px 14px calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: var(--card);
}
.assistant-compose-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  padding: 7px;
  background: var(--card2);
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
}
.assistant-compose-shell:focus-within {
  border-color: var(--green);
  box-shadow: var(--focus);
}
.assistant-compose textarea {
  width: 100%;
  min-height: 48px;
  max-height: 124px;
  resize: none;
  border: 0;
  background: transparent;
  padding: 7px;
  outline: none;
  line-height: 1.5;
}
.assistant-send {
  min-width: 84px;
  min-height: 44px;
}
.assistant-compose-hint {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin: 6px 4px 0;
  color: var(--muted);
  font-size: 0.5rem;
}
.assistant-status {
  min-height: 12px;
}
.assistant-message.danger {
  border-color: var(--red);
  background: var(--redbg);
}
.editor-tab,
.multi-tool,
.assistant-head-actions .btn,
.assistant-suggestions button {
  min-height: 44px;
}
.multi-search input {
  min-height: 44px;
}
.notification-tabs button {
  min-height: 44px;
}
.filter-chip button {
  width: 44px;
  height: 44px;
}
.filter-chip {
  min-height: 44px;
}
.toast[role="status"] {
  max-width: min(420px, calc(100vw - 24px));
}
@media (max-width: 1100px) {
  .filter-grid,
  .order-filters .filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .filter-grid .filter-actions {
    grid-column: 1/-1;
  }
  .stage-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .global-currency small {
    display: none;
  }
}
@media (max-width: 760px) {
  .filter-grid,
  .order-filters .filter-grid,
  .stage-grid,
  .mapping-row,
  .mapping-toolbar {
    grid-template-columns: 1fr;
  }
  .performance-filter-head,
  .column-panel {
    align-items: stretch;
    flex-direction: column;
  }
  .performance-filter-head-actions,
  .column-list {
    justify-content: flex-start;
  }
  .multi-filter:nth-child(3) .multi-popover {
    left: 0;
    right: auto;
  }
  .multi-popover {
    position: fixed;
    left: 12px !important;
    right: 12px !important;
    top: auto;
    bottom: 82px;
    width: auto;
    max-height: 70dvh;
  }
  .multi-options {
    max-height: 45dvh;
  }
  .tablewrap table {
    min-width: 680px;
  }
  .assistant-fab {
    right: 12px;
    bottom: 82px;
    width: 56px;
    min-width: 56px;
    padding: 0;
  }
  .assistant-fab span:not(.assistant-fab-dot) {
    display: none;
  }
  .assistant-fab-dot {
    position: absolute;
    right: 8px;
    top: 8px;
    width: 6px;
    height: 6px;
  }
  .assistant-panel {
    right: 8px;
    bottom: 145px;
    width: calc(100vw - 16px);
    height: min(680px, calc(100dvh - 156px));
  }
  .assistant-message {
    max-width: 90%;
  }
  .global-currency {
    padding-left: 7px;
  }
  .global-currency > .icon-svg {
    display: none;
  }
  .global-currency select {
    min-width: 62px;
  }
  .marketing-option {
    grid-template-columns: auto minmax(0, 1fr);
  }
  .marketing-option .option-tag {
    grid-column: 2;
  }
}
/* Stitch control-room system: quiet density, flat hierarchy, persistent tools. */
.top {
  position: sticky;
  top: 0;
  z-index: 30;
  margin: -27px -30px 20px;
  padding: 20px 30px 16px;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}
.card {
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.035);
}
.kpi {
  min-height: 126px;
}
.kpi strong {
  font-size: 2rem;
}
.side {
  padding-top: 20px;
}
.nav button {
  border-bottom-color: transparent;
}
.sidefoot {
  line-height: 1.55;
}
.main {
  max-width: 1720px;
  width: 100%;
  margin-inline: auto;
}
.ops-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 14px;
}
.ops-tile {
  padding: 14px 15px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  background: var(--card);
  display: grid;
  gap: 7px;
  min-height: 104px;
}
.ops-tile-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}
.ops-tile small {
  color: var(--muted);
  line-height: 1.5;
}
.ops-tile strong {
  font-size: 1.4375rem;
  font-variant-numeric: tabular-nums;
}
.ops-tile.attention {
  border-color: color-mix(in srgb, var(--amber) 45%, var(--line));
  background: color-mix(in srgb, var(--amberbg) 45%, var(--card));
}
.ops-tile.critical {
  border-color: color-mix(in srgb, var(--red) 45%, var(--line));
  background: color-mix(in srgb, var(--redbg) 48%, var(--card));
}
.decision-room {
  margin: 0 0 14px;
}
.decision-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 12px;
}
.decision-list {
  display: grid;
  gap: 8px;
}
.decision-item {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card2);
}
.decision-mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--mint);
  color: var(--green);
  font-weight: 950;
}
.decision-item b,
.decision-item small {
  display: block;
}
.decision-item small {
  color: var(--muted);
  margin-top: 3px;
}
.coverage-meter {
  height: 8px;
  background: var(--card2);
  border-radius: 999px;
  overflow: hidden;
}
.coverage-meter i {
  display: block;
  height: 100%;
  background: var(--green);
  border-radius: inherit;
}
.catalog-search {
  margin-bottom: 14px;
}
.catalog-search-bar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 8px;
}
.catalog-search-results {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  margin-top: 12px;
}
.search-product {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card2);
  text-align: start;
}
.search-product:hover {
  border-color: var(--green);
  background: var(--mint);
}
.search-product img,
.search-product .image-fallback {
  width: 52px;
  height: 52px;
  object-fit: contain;
  background: var(--card);
  border-radius: 10px;
}
.search-product b,
.search-product small {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.search-product small {
  color: var(--muted);
  margin-top: 3px;
}
.market-summary {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.market-pill {
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card2);
  font-size: 0.625rem;
  font-weight: 850;
}
.intelligence-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}
.intelligence-card {
  min-height: 220px;
}
.intelligence-list {
  display: grid;
  gap: 8px;
}
.intelligence-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-top: 1px solid var(--line);
}
.intelligence-row:first-child {
  border-top: 0;
}
.intelligence-row span {
  color: var(--muted);
  font-size: 0.6875rem;
}
.empty-state {
  padding: 24px;
  text-align: center;
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  color: var(--muted);
  background: var(--card2);
}
.global-search {
  position: relative;
  min-width: min(390px, 34vw);
}
.global-search .input {
  height: 42px;
  padding-inline-start: 38px;
  background: var(--card);
}
.global-search > .icon-svg {
  position: absolute;
  inset-inline-start: 12px;
  top: 11px;
  color: var(--muted);
  z-index: 2;
}
.global-search-results {
  position: absolute;
  z-index: 60;
  inset-inline: 0;
  top: 48px;
  max-height: 62vh;
  overflow: auto;
  padding: 9px;
}
.operation-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.metric-table {
  font-variant-numeric: tabular-nums;
}
.metric-table td:first-child {
  font-weight: 800;
}
.goals-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.integration-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.integration-card {
  min-height: 190px;
}
.integration-card .facts {
  margin-top: 10px;
}
.more-sheet {
  position: fixed;
  z-index: 70;
  inset-inline: 8px;
  bottom: 78px;
  padding: 10px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.more-sheet button {
  min-height: 52px;
}
.mobile-only {
  display: none;
}
@media (max-width: 1100px) {
  .ops-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .catalog-search-results {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .decision-grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 760px) {
  .top {
    position: relative;
    margin: -18px -16px 14px;
    padding: 16px;
    flex-direction: column;
  }
  .top-actions {
    width: 100%;
    overflow: auto;
  }
  .global-search {
    order: -1;
    min-width: 100%;
    width: 100%;
  }
  .ops-strip,
  .catalog-search-results,
  .intelligence-grid,
  .operation-grid,
  .integration-grid,
  .goals-grid {
    grid-template-columns: 1fr;
  }
  .catalog-search-bar {
    grid-template-columns: 1fr;
  }
  .kpi {
    min-height: 108px;
  }
  .kpi strong {
    font-size: 1.6875rem;
  }
  .mobile-only {
    display: block;
  }
  .mobilebar {
    grid-template-columns: repeat(5, 1fr) !important;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *:before,
  *:after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .multi-chevron {
    transform: none !important;
  }
}

/* Stitch production shell: mirrored fixed navigation, fluid workspace, flat density. */
body {
  font-size: 0.875rem;
  background: var(--bg);
}
.app{
  display: block;
  background: var(--bg) !important;
  min-height: 100dvh;
}
.side {
  position: fixed;
  inset: 0 auto 0 0;
  width: 240px;
  height: 100dvh;
  min-height: 0;
  overflow-y: auto;
  padding: 20px 16px;
  background: var(--nav) !important;
  border-inline-end: 1px solid rgba(255, 255, 255, 0.08);
  z-index: 40;
  transition: width 0.18s ease;
}
[dir="rtl"] .side {
  left: auto;
  right: 0;
}
.main {
  width: auto;
  max-width: none;
  min-height: 100dvh;
  margin: 0 0 0 240px;
  padding: 24px 24px 64px;
  background: var(--bg);
  overflow-x: clip;
}
[dir="rtl"] .main {
  margin: 0 240px 0 0;
}
/* Collapsed geometry is owned by the canonical shell rules in shell.css. */
.brand {
  padding: 0 4px 30px;
  gap: 10px;
}
.brand .logo {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  box-shadow: none;
  flex: 0 0 40px;
}
.brand b {
  font-size: 1.0625rem;
  color: #fff;
}
.brand small {
  font-size: 0.625rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #94a3b8;
}
.sidebar-toggle {
  min-height: 40px;
  margin-bottom: 14px;
  border-radius: 6px !important;
}
.nav {
  gap: 3px;
}
.nav button {
  min-height: 44px;
  padding: 10px 12px;
  border: 0 !important;
  border-radius: 6px;
  background: transparent;
  color: #aab7cd;
  font-size: 0.875rem;
  font-weight: 650;
  box-shadow: none;
  transform: none;
}
.nav button:hover {
  background: #172033;
  color: #fff;
}
.nav button.active {
  background: #3d5a0f;
  color: #fff;
  box-shadow: none;
}
.sidefoot {
  padding: 14px 8px 0;
  font-size: 0.625rem;
  border-top-color: rgba(255, 255, 255, 0.1);
}
.top {
  position: sticky;
  top: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: minmax(280px, 1fr) auto;
  align-items: center;
  gap: 16px;
  margin: -24px -24px 30px;
  padding: 16px 24px 22px;
  background: color-mix(in srgb, var(--bg) 96%, transparent);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}
.top > div:first-child {
  grid-column: 1/-1;
  grid-row: 2;
  margin-top: 12px;
}
.top .global-search {
  grid-column: 1;
  grid-row: 1;
  width: min(480px, 42vw);
  min-width: 280px;
}
.top .top-actions {
  grid-column: 2;
  grid-row: 1;
  justify-self: end;
  display: flex;
  gap: 8px;
  align-items: center;
}
.top-actions .btn + .btn {
  margin: 0;
}
.top-actions .btn + .btn:before {
  display: none;
}
.eyebrow {
  font-size: 0.625rem;
  color: var(--green);
  letter-spacing: 0.12em;
}
.top h1 {
  margin: 5px 0 2px;
  font-size: 1.875rem;
  line-height: 38px;
  letter-spacing: -0.02em;
}
.top .muted {
  font-size: 0.875rem;
}
.btn {
  min-height: 40px;
  padding: 8px 13px;
  border-color: var(--line-strong);
  border-radius: 6px;
  background: var(--card);
  font-weight: 650;
  box-shadow: none;
}
.btn:hover {
  border-color: var(--green);
  background: var(--card2);
  box-shadow: none;
}
.btn.primary {
  background: var(--green);
  border-color: var(--green);
  color: var(--action-primary-text);
  box-shadow: none;
}
.btn.primary:hover {
  background: var(--green2);
  filter: none;
}
.global-search .input {
  height: 40px;
  border-radius: 6px;
  background: var(--card2);
}
.card,
.ops-tile,
.search-product,
.decision-item,
.empty-state {
  border-color: var(--line);
  border-radius: 8px;
  box-shadow: none;
  background: var(--card);
}
.card:hover {
  box-shadow: none;
}
.pad {
  padding: 20px;
}
.cardhead {
  margin-bottom: 16px;
}
.cardhead h2,
.section h2 {
  font-size: 1.125rem;
  line-height: 24px;
}
.cardhead p,
.section p {
  font-size: 0.8125rem;
  line-height: 20px;
}
.kpis {
  gap: 16px;
  margin-bottom: 16px;
}
.kpi {
  min-height: 142px;
  padding: 20px;
  border-radius: 8px;
}
.kpi:before {
  display: none;
}
.kpi span {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
}
.kpi strong {
  margin-top: 18px;
  font-size: 1.8125rem;
  line-height: 36px;
}
.date-filter {
  padding: 14px 16px;
  margin-bottom: 16px;
  border-radius: 8px;
}
.date-pill {
  min-height: 36px;
  border-radius: 6px;
}
.date-pill:hover,
.date-pill.active {
  background: var(--interaction-selected-bg);
  border-color: var(--green);
  color: var(--interaction-selected-text);
}
.grid2,
.operation-grid,
.intelligence-grid,
.integration-grid {
  gap: 16px;
}
.section {
  margin-bottom: 18px;
}
.tablecard {
  border-radius: 8px;
}
th {
  height: 44px;
  background: var(--card2);
  font-size: 0.6875rem;
  color: var(--muted);
}
td {
  padding: 13px 14px;
}
.status,
.market-pill,
.filter-chip,
.customer-tag-preset,
.customer-tag-chip,
.thread-customer-chip {
  border-radius: 999px;
}
.gate {
  background: var(--bg);
  padding: 24px;
}
.gatecard {
  width: min(520px, 100%);
  padding: 40px;
  border-radius: 8px;
  border-color: var(--line);
  box-shadow: none;
}
.gatecard .logo {
  border-radius: 6px;
  box-shadow: none;
}
.notification-panel,
.more-sheet,
.assistant-panel {
  box-shadow: var(--shadow-lg);
}
.assistant-fab {
  border-radius: 8px;
  /* Was hardcoded to the default green, so the button kept the stock accent on
     every other theme. Read the token like every other primary action. */
  background: var(--green);
  color: var(--action-primary-text);
  box-shadow: none;
}
.assistant-fab:hover {
  box-shadow: none;
}
[dir="rtl"] .assistant-fab,
[dir="rtl"] .assistant-panel {
  right: auto;
  left: 22px;
}
.order-drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 105;
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(2px);
}
.order-drawer {
  position: fixed;
  z-index: 106;
  top: 0;
  bottom: 0;
  right: 0;
  width: min(620px, 92vw);
  padding: 20px;
  background: var(--bg);
  border-left: 1px solid var(--line);
  box-shadow: -24px 0 64px rgba(15, 23, 42, 0.18);
  overflow: auto;
}
[dir="rtl"] .order-drawer {
  right: auto;
  left: 0;
  border-left: 0;
  border-right: 1px solid var(--line);
  box-shadow: 24px 0 64px rgba(15, 23, 42, 0.18);
}
.drawer-head {
  position: sticky;
  top: -20px;
  z-index: 2;
  margin: -20px -20px 16px;
  padding: 18px 20px;
  background: color-mix(in srgb, var(--bg) 94%, transparent);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}
.drawer-head h2 {
  margin: 0;
}
.drawer-section {
  margin-top: 12px;
}
.order-timeline {
  display: grid;
  gap: 0;
  margin-top: 12px;
}
.timeline-item {
  position: relative;
  padding: 0 28px 18px;
}
.timeline-item:before {
  content: "";
  position: absolute;
  inset-inline-start: 7px;
  top: 14px;
  bottom: -2px;
  width: 1px;
  background: var(--line);
}
.timeline-item:last-child:before {
  display: none;
}
.timeline-item:after {
  content: "";
  position: absolute;
  inset-inline-start: 2px;
  top: 4px;
  width: 10px;
  height: 10px;
  border: 3px solid var(--card);
  border-radius: 50%;
  background: var(--green);
}
.sync-counter {
  max-width: 320px;
  white-space: normal;
  word-break: break-word;
}
.attribution-warning {
  margin: 0 0 14px;
  padding: 14px 16px;
  border-color: #e6b86a;
  background: var(--amberbg);
}
.attribution-warning.ready {
  border-color: #b7d983;
  background: var(--mint);
}
.project-json {
  font-family: var(--font-technical);
  min-height: 90px;
  font-size: 0.75rem;
}
.security-secret {
  font-family: var(--font-technical);
  word-break: break-all;
  padding: 10px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: var(--soft);
}
@media (max-width: 760px) {
  .side {
    display: none;
  }
  .main,
[dir="rtl"] .main{
    margin: 0;
    padding: 20px 16px 96px;
  }
  .top {
    position: relative;
    display: flex;
    align-items: stretch;
    flex-direction: column;
    margin: -20px -16px 24px;
    padding: 16px;
    gap: 12px;
    background: var(--bg);
  }
  .top > div:first-child {
    order: 1;
    margin: 0;
  }
  .top .global-search {
    order: 3;
    width: 100%;
    min-width: 0;
  }
  .top .top-actions {
    order: 2;
    width: 100%;
    justify-content: flex-start;
    overflow: auto;
  }
  .top h1 {
    font-size: 1.875rem;
    line-height: 38px;
  }
  .top .muted {
    font-size: 1rem;
  }
  .eyebrow {
    display: none;
  }
  #global-currency-control,
  #refresh,
  #theme,
  #logout {
    display: none;
  }
  .top-actions .btn:first-child {
    display: inline-flex;
  }
  .mobilebar {
    display: grid !important;
    position: fixed;
    z-index: 80;
    left: 0;
    right: 0;
    bottom: 0;
    height: 78px;
    grid-template-columns: repeat(5, 1fr) !important;
    gap: 0;
    padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
    background: var(--card);
    border: 0;
    border-top: 1px solid var(--line);
    border-radius: 0;
    box-shadow: none;
    backdrop-filter: none;
  }
  .mobilebar button {
    min-height: 58px;
    padding: 6px 3px;
    border-radius: 8px;
    color: var(--muted);
    font-size: 0.6875rem;
    font-weight: 650;
    gap: 4px;
  }
  .mobilebar .icon-svg {
    width: 22px;
    height: 22px;
  }
  .mobilebar button.active {
    background: var(--interaction-selected-bg);
    color: var(--interaction-selected-text);
  }
  .more-sheet {
    left: 8px;
    right: 8px;
    bottom: 84px;
    border-radius: 8px;
  }
  .kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
  .kpi:first-child {
    grid-column: 1/-1;
  }
  .kpi {
    min-height: 136px;
    padding: 18px;
  }
  .kpi strong {
    font-size: 1.6875rem;
  }
  .grid2,
  .analytics,
  .performance-grid,
  .operation-grid,
  .intelligence-grid,
  .integration-grid,
  .goals-grid {
    grid-template-columns: 1fr;
  }
  .card,
  .ops-tile,
  .search-product,
  .decision-item,
  .empty-state {
    border-radius: 8px;
  }
  .pad {
    padding: 18px;
  }
  .date-filter {
    align-items: stretch;
  }
  .date-pills {
    overflow: auto;
    flex-wrap: nowrap;
  }
  .date-pill {
    white-space: nowrap;
    min-height: 44px;
  }
  .gatecard {
    padding: 28px 24px;
  }
  .assistant-fab,
  [dir="rtl"] .assistant-fab {
    right: 12px;
    left: auto;
    bottom: 88px;
  }
  .assistant-panel,
  [dir="rtl"] .assistant-panel {
    right: 8px;
    left: auto;
    bottom: 152px;
  }
  .order-drawer,
  [dir="rtl"] .order-drawer {
    inset: 0;
    width: 100%;
    padding: 16px;
    border: 0;
  }
  .drawer-head {
    top: -16px;
    margin: -16px -16px 14px;
    padding: 14px 16px;
  }
  .order-drawer .facts {
    grid-template-columns: 1fr;
  }
  .order-drawer .actions {
    position: sticky;
    bottom: 0;
    padding: 10px;
    background: var(--bg);
    border-top: 1px solid var(--line);
  }
  #view-orders .tablewrap {
    overflow: visible;
  }
  #view-orders table,
  #view-orders tbody {
    display: block;
  }
  #view-orders thead {
    display: none;
  }
  #order-rows {
    display: grid;
    gap: 12px;
  }
  #order-rows tr {
    display: block;
    padding: 14px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
  }
  #order-rows td {
    display: grid;
    grid-template-columns: minmax(88px, 0.35fr) minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    padding: 9px 0;
    border: 0;
    border-bottom: 1px solid var(--line);
    white-space: normal;
  }
  #order-rows td[data-column="actions"] {
    border-bottom: 0;
    display: flex;
    flex-wrap: wrap;
  }
  #order-rows td:before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 0.6875rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
  }
  #order-rows td[data-column="actions"]:before {
    width: 100%;
  }
}

/* Google Stitch production system: the source layouts, not the legacy shell. */
.sr-only {
  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;
}
.mobile-stitch-head {
  display: none;
}
html {
  background: var(--bg);
}
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-arabic);
}
html[dir="ltr"] body {
  font-family: var(--font-dashboard);
}
.app {
  display: block;
  min-height: 100vh;
}
.side {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 50;
  width: 240px;
  height: 100dvh;
  padding: 16px;
  background: var(--nav);
  color: var(--navink);
  overflow-y: auto;
}
[dir="rtl"] .side {
  inset: 0 0 0 auto;
}
.brand {
  height: auto;
  padding: 8px 16px 34px;
  gap: 12px;
  align-items: center;
  white-space: nowrap;
  overflow: hidden;
}
.brand > div:last-child {
  min-width: 0;
  flex: 1 1 auto;
  direction: ltr;
  text-align: left;
}
.brand .logo {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  border-radius: 50%;
  border: 0;
  background: #c8f169;
  box-shadow: none;
}
.brand b {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1.294;
  color: #fff;
  letter-spacing: -0.01em;
}
.brand small {
  display: block;
  margin-top: 4px;
  color: #94a3b8;
  font-family: inherit;
  font-size: 0.45rem;
  font-weight: 600;
  line-height: 1.333;
  font-variant-numeric: tabular-nums lining-nums;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}
.sidebar-toggle {
  display: none !important;
}
.nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.nav button {
  min-height: 48px;
  padding: 12px 16px;
  border: 0 !important;
  border-radius: 8px;
  background: transparent;
  color: #a7b4c9;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 650;
  line-height: 1.333;
  box-shadow: none;
}
.nav button:hover {
  background: #1e293b;
  color: #fff;
}
.nav button.active {
  background: #3d5a0f;
  color: #fff;
  box-shadow: none;
}
.nav .icon,
.nav .icon-svg {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
}
.sidefoot {
  margin-top: 28px;
  padding: 16px 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.09);
  font-family: inherit;
  font-size: 0.5rem;
  font-weight: 500;
  line-height: 1.5;
  font-variant-numeric: tabular-nums lining-nums;
  color: #94a3b8;
}
.sidefoot b {
  color: #fff;
}
.main,
[dir="rtl"] .main {
  width: auto;
  min-height: 100dvh;
  margin: 0 0 0 240px;
  padding: 0 24px 64px;
  background: var(--bg);
  overflow-x: clip;
}
[dir="rtl"] .main {
  margin: 0 240px 0 0;
}

.top {
  position: sticky;
  top: 0;
  z-index: 40;
  height: 64px;
  margin: 0 -24px;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  background: var(--card);
  border-bottom: 1px solid var(--line);
  backdrop-filter: none;
}
[dir="rtl"] .top {
  flex-direction: row-reverse;
}
.top .global-search {
  position: relative;
  display: flex;
  align-items: center;
  width: 384px;
  min-width: 280px;
  height: 40px;
  margin: 0;
  padding-inline: 12px;
  gap: 8px;
  border: 0;
  border-radius: 8px;
  background: var(--card2);
}
.top .global-search .input {
  height: 40px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  font-size: 0.875rem;
}
.top .global-search .icon-svg {
  color: var(--muted);
}
.top .top-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  white-space: nowrap;
}
.top-actions .btn + .btn {
  margin: 0;
}
.top-actions .btn + .btn:before {
  display: none;
}
.top .btn {
  height: 40px;
  min-height: 40px;
  border-radius: 8px;
  box-shadow: none;
}
.top .btn.primary {
  padding-inline: 18px;
  background: var(--green);
  border-color: var(--green);
  color: var(--action-primary-text);
}
.top .compact-action {
  width: 40px;
  padding: 0;
  border-color: transparent;
  background: transparent;
}
.top .compact-action:hover {
  border-color: transparent;
  background: var(--card2);
}
.top #language-toggle {
  width: auto;
  padding-inline: 10px;
  border-color: var(--line);
  background: var(--card);
}
.global-currency {
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
}
.page-heading {
  margin: 34px auto 36px;
  width: 100%;
  max-width: 1240px;
}
.page-heading .eyebrow {
  display: none;
}
.page-heading h1 {
  margin: 0;
  color: var(--ink);
  font-family: inherit;
  font-size: 1.8rem;
  font-weight: 700;
  line-height: 1.222;
  letter-spacing: -0.035em;
}
.page-heading .muted {
  margin-top: 4px;
  color: var(--muted);
  font-size: 1.0625rem;
  line-height: 24px;
}
.view {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
}
.card,
.ops-tile,
.search-product,
.decision-item,
.empty-state {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  box-shadow: none;
}
.card:hover {
  box-shadow: none;
}
.pad {
  padding: 24px;
}
.cardhead h2,
.section h2 {
  color: var(--ink);
  font-family: inherit;
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.273;
  letter-spacing: -0.02em;
}
.cardhead p,
.section p {
  color: var(--muted);
}
.btn {
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--card);
  color: var(--ink);
  box-shadow: none;
}
.btn:hover {
  border-color: var(--green);
  background: var(--card2);
  box-shadow: none;
}
.btn.primary {
  background: var(--green);
  border-color: var(--green);
  color: var(--action-primary-text);
  box-shadow: none;
}
.btn.primary:hover {
  background: var(--green2);
  filter: none;
}
.date-filter {
  margin-bottom: 24px;
  padding: 12px 16px;
  border-radius: 8px;
}
.date-pill {
  border-radius: 5px;
  background: var(--card2);
  color: var(--muted);
}
.date-pill.active {
  background: var(--green);
  border-color: var(--green);
  color: var(--action-primary-text);
}
.kpis {
  gap: 16px;
  margin-bottom: 24px;
}
.kpi {
  min-height: 178px;
  padding: 24px;
  border-radius: 12px;
}
.kpi:before {
  display: none;
}
.kpi-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.kpi-head span,
.kpi > span {
  color: var(--ink);
  font-family: inherit;
  font-size: 0.6rem;
  font-weight: 700;
  line-height: 1.333;
  font-variant-numeric: tabular-nums lining-nums;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.kpi-head i {
  color: var(--green);
  font-style: normal;
}
.kpi-head .icon-svg {
  width: 22px;
  height: 22px;
}
.kpi strong {
  margin-top: 30px;
  color: var(--ink);
  font-family: inherit;
  font-size: 1.4rem;
  font-weight: 500;
  line-height: 1.214;
  font-variant-numeric: tabular-nums lining-nums;
  letter-spacing: -0.04em;
}
.metric-delta {
  display: block;
  margin-top: 12px;
  font-family: inherit;
  font-size: 0.65rem;
  font-weight: 500;
  line-height: 1.385;
  font-variant-numeric: tabular-nums lining-nums;
}
.metric-delta.positive {
  color: #00a63e !important;
}
.metric-delta.danger {
  color: #ef2424 !important;
}
.overview-primary-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
  gap: 24px;
  align-items: stretch;
}
.profit-trajectory {
  min-height: 480px;
}
.profit-trajectory .cardhead {
  align-items: center;
}
.chart-periods {
  display: flex;
  gap: 8px;
}
.chart-periods button {
  min-width: 44px;
  padding: 6px 10px;
  border: 0;
  border-radius: 4px;
  background: var(--card2);
  color: var(--ink);
  font-family: inherit;
  font-size: 0.5rem;
  font-weight: 700;
  line-height: 1.4;
  font-variant-numeric: tabular-nums lining-nums;
}
.chart-periods button.active {
  background: var(--green);
  color: var(--action-primary-text);
}
.overview-profit-chart {
  height: 370px;
  padding: 28px 10px 32px;
  border-bottom: 1px solid var(--line);
  background: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent calc(33.333% - 1px),
    var(--line) 33.333%
  );
  overflow: hidden;
}
.overview-profit-bars {
  display: flex;
  height: 100%;
  align-items: flex-end;
  justify-content: space-around;
  gap: 10px;
}
.overview-bar-wrap {
  display: flex;
  min-width: 0;
  height: 100%;
  flex: 1;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  gap: 9px;
}
.overview-bar {
  width: 100%;
  max-width: 72px;
  min-height: 4px;
  border-radius: 3px 3px 0 0;
  background: #c8f169;
}
.overview-bar.current {
  background: var(--green);
}
.overview-bar.negative {
  background: var(--redbg);
}
.overview-bar-label {
  font-family: inherit;
  font-size: 0.5rem;
  font-weight: 500;
  line-height: 1.4;
  font-variant-numeric: tabular-nums lining-nums;
  color: var(--muted);
  white-space: nowrap;
}
.critical-panel {
  overflow: hidden;
}
.critical-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 22px 20px;
  border-bottom: 1px solid var(--line-strong);
  background: var(--redbg);
  color: var(--red);
}
.critical-head h2 {
  margin: 0;
  font-family: inherit;
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.273;
}
.critical-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px;
}
.critical-item {
  position: relative;
  padding: 16px 16px 16px 42px;
  border: 1px solid var(--red);
  border-radius: 8px;
  background: var(--card);
}
.critical-item.warning {
  border-color: var(--amber);
}
.critical-item.ok {
  border-color: #cbd5e1;
}
.critical-item:before {
  content: "";
  position: absolute;
  left: 16px;
  top: 20px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--red);
}
.critical-item.warning:before {
  background: var(--amber);
}
.critical-item.ok:before {
  background: #94a3b8;
}
.critical-item b {
  display: block;
  color: var(--ink);
  font-size: 0.9375rem;
}
.critical-item p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.8125rem;
  line-height: 20px;
}
.critical-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 12px;
  color: var(--muted);
  font-family: inherit;
  font-size: 0.5rem;
  font-weight: 500;
  line-height: 1.4;
  font-variant-numeric: tabular-nums lining-nums;
}
.overview-secondary {
  margin-top: 24px;
}
.stitch-overview > .ops-strip:empty {
  display: none;
}
.tablecard {
  border-radius: 12px;
}
th {
  height: 44px;
  background: var(--card2);
  color: var(--muted);
  font-family: inherit;
  font-size: 0.5rem;
  font-weight: 600;
  line-height: 1.4;
  font-variant-numeric: tabular-nums lining-nums;
  letter-spacing: 0.06em;
}
td {
  font-size: 0.8125rem;
}
.cellmain,
td b {
  color: var(--ink);
}
.cellsub {
  color: var(--muted);
}
#view-conversations {
  max-width: none;
  margin-inline: -8px;
}
.inbox {
  height: calc(100dvh - 188px);
  border-radius: 12px;
}
.threadlist {
  background: var(--card);
}
.chathead {
  height: 66px;
}
.customer {
  background: var(--card);
}

#view-growth .kpis,
#view-analytics .analytics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.growth-layout {
  gap: 24px;
}
.integration-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.operation-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.settingsgrid {
  gap: 16px;
}
.gate {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: #0e1a2b;
}
.gatecard {
  width: min(430px, 100%);
  padding: 40px;
  border: 1px solid #334155;
  border-radius: 12px;
  background: #111827;
  color: #f8fafc;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.35);
}
.gatecard .logo {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  margin-inline: auto;
  background: #c8f169;
}
.gatecard h1 {
  text-align: center;
  color: #fff;
}
.gatecard .login-kicker,
.gatecard .login-copy {
  text-align: center;
}
.gatecard .field label {
  color: #cbd5e1;
}
.gatecard .field input {
  min-height: 44px;
  border-color: #475569;
  background: #0e1a2b;
  color: #fff;
}
.gatecard .btn.primary {
  min-height: 46px;
  background: #c8f169;
  border-color: #c8f169;
  color: #0e1a2b;
}
.gatecard > #gate-language {
  display: flex;
  margin-inline: auto;
}
@media (min-width: 761px) {
  .order-drawer-backdrop {
    display: none !important;
  }
  .order-drawer {
    top: 64px;
    width: min(620px, 45vw);
    padding: 24px;
    background: var(--card);
    border-color: var(--line);
    box-shadow: -12px 0 34px rgba(15, 23, 42, 0.1);
  }
  [dir="rtl"] .order-drawer {
    box-shadow: 12px 0 34px rgba(15, 23, 42, 0.1);
  }
  .drawer-head {
    top: -24px;
    margin: -24px -24px 20px;
    padding: 18px 24px;
    background: var(--card);
    backdrop-filter: none;
  }
  .order-drawer .card {
    background: var(--card2);
  }
}
@media (max-width: 1000px) and (min-width: 761px) {
  .top .global-search {
    width: 300px;
  }
  .top #global-currency-control {
    display: none;
  }
  .overview-primary-grid {
    grid-template-columns: 1fr;
  }
  .side {
    width: 220px;
  }
  .main,
  [dir="rtl"] .main {
    margin-left: 220px;
  }
  [dir="rtl"] .main {
    margin-left: 0;
    margin-right: 220px;
  }

}
@media (max-width: 760px) {
  .side {
    display: none;
  }
  .main,
[dir="rtl"] .main{
    margin: 0;
    padding: 0 16px 104px;
    background: var(--card2);
  }
  .mobile-stitch-head {
    height: 72px;
    margin: 0 -16px;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--card2);
    border-bottom: 1px solid var(--line);
  }
  .mobile-stitch-head b {
    flex: 1;
    color: var(--ink);
    font-family: inherit;
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.273;
  }
  .mobile-stitch-head button {
    width: 44px;
    height: 44px;
    border: 0;
    background: transparent;
  }
  .mobile-avatar {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: #0e1a2b;
    color: #fff;
    display: grid;
    place-items: center;
    font-weight: 800;
  }
  .top {
    position: relative;
    height: auto;
    margin: 0 -16px;
    padding: 0 16px;
    border: 0;
    background: var(--card2);
  }
  .top .global-search {
    display: none;
  }
  .top .top-actions {
    display: none;
  }
  .page-heading {
    margin: 34px 14px 40px;
  }
  .page-heading h1 {
    font-size: 2.25rem;
    line-height: 43px;
  }
  .page-heading .muted {
    font-size: 1.125rem;
    line-height: 26px;
  }
  .view {
    max-width: none;
  }
  .date-filter {
    /* The header period button was removed, so this is the only period control
       a phone has. Let it wrap and scroll its pills instead of hiding it. */
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .date-filter .date-pills {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
  }
  .date-filter .date-pill,
  .date-filter .reporting-ignore-days button {
    min-height: 44px;
  }
  .kpis.stitch-kpis {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
  }
  .stitch-kpis .hero-kpi {
    grid-column: 1/-1;
    min-height: 190px;
  }
  .stitch-kpis .kpi:nth-child(4) {
    grid-column: 1/-1;
    min-height: 144px;
  }
  .kpi {
    min-height: 160px;
    padding: 24px;
  }
  .kpi strong {
    margin-top: 28px;
    font-size: 1.6875rem;
  }
  .metric-delta {
    font-size: 0.75rem;
  }
  .overview-primary-grid {
    display: flex;
    flex-direction: column;
    gap: 28px;
  }
  .profit-trajectory {
    min-height: 420px;
  }
  .overview-profit-chart {
    height: 320px;
    padding-inline: 0;
  }
  .overview-profit-bars {
    gap: 6px;
  }
  .overview-bar-label {
    font-size: 0.5625rem;
  }
  .critical-panel {
    border: 0;
    background: transparent;
  }
  .critical-head {
    padding: 16px 0;
    border: 0;
    background: transparent;
    color: var(--ink);
  }
  .critical-list {
    padding: 0;
  }
  .critical-item {
    background: var(--card);
  }
  .overview-secondary {
    grid-template-columns: 1fr;
  }
  .stitch-overview > .tablecard {
    display: none;
  }
  .mobilebar {
    display: grid !important;
    position: fixed;
    z-index: 80;
    left: 0;
    right: 0;
    bottom: 0;
    height: 86px;
    grid-template-columns: repeat(4, 1fr) !important;
    padding: 8px 16px calc(8px + env(safe-area-inset-bottom));
    background: var(--card);
    border-top: 1px solid var(--line);
    box-shadow: none;
  }
  .mobilebar button {
    min-height: 62px;
    border-radius: 12px;
  }
  .mobilebar button.active {
    background: #c8f169;
    color: #0e1a2b;
  }
  .more-sheet {
    bottom: 92px;
  }
  #view-conversations {
    margin: 0;
  }
  .inbox {
    height: calc(100dvh - 190px);
  }

  .order-drawer,
  [dir="rtl"] .order-drawer {
    top: 0;
  }
  .integration-grid,
  #view-growth .kpis,
  #view-analytics .analytics {
    grid-template-columns: 1fr;
  }
  .operation-grid {
    grid-template-columns: 1fr;
  }
  .gatecard {
    padding: 30px 22px;
  }
}

/* Stitch catalog, orders workspace, and navigation hierarchy. */
.side {
  display: flex;
  flex-direction: column;
}
.side .nav {
  flex: 1;
}
.nav button[data-nav-mode="attribution"] {
  margin-top: 0;
}
.nav button[data-tab="settings"] {
  margin-top: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.09) !important;
  border-radius: 0;
  padding-top: 18px;
}
.brand small {
  color: #c8f169;
}
#view-orders > .section,
#view-products > .section {
  align-items: center;
  margin: 34px 0 28px;
}
#view-orders > .section h2,
#view-products > .section h2 {
  font-size: 2.25rem;
  line-height: 44px;
}
.orders-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
@media (max-width: 1100px) {
  .orders-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.orders-kpi {
  min-height: 160px;
  padding: 24px;
}
.orders-kpi-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--ink);
  font-family: inherit;
  font-size: 0.55rem;
  font-weight: 700;
  line-height: 1.455;
  font-variant-numeric: tabular-nums lining-nums;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}
.orders-kpi-head .icon-svg {
  width: 22px;
  height: 22px;
  color: var(--green);
}
.orders-kpi strong {
  display: block;
  margin-top: 24px;
  color: var(--ink);
  /* KPI readings follow the font chosen in settings like every other figure. The
     shorthand here also hardcoded a px size, which sidestepped the rem type scale. */
  font-family: inherit;
  font-size: 1.5rem;
  font-weight: 500;
  line-height: 1.27;
  font-variant-numeric: tabular-nums lining-nums;
}
.orders-kpi small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.75rem;
}
#order-filters {
  padding: 16px;
  margin-bottom: 0;
  border-radius: 12px 12px 0 0;
  border-bottom: 0;
}
.order-stitch-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
}
.order-stitch-search {
  position: relative;
  flex: 1;
}
.order-stitch-search .icon-svg {
  position: absolute;
  inset-inline-start: 14px;
  top: 12px;
  color: var(--muted);
}
.order-stitch-search input {
  height: 44px;
  padding-inline-start: 44px;
  background: var(--card);
}
.order-status-tabs {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card2);
  overflow: auto;
}
.order-status-tab {
  min-height: 34px;
  padding: 7px 16px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  font-weight: 650;
  white-space: nowrap;
}
.order-status-tab.active {
  background: var(--green);
  color: var(--action-primary-text);
}
.order-filter-toggle {
  width: 44px;
  height: 44px;
  padding: 0;
}
.order-filter-toggle .icon-svg {
  width: 20px;
  height: 20px;
}
#order-filters > .filter-grid {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #e2e8f0;
}
.order-filters:not(.filters-open) > .filter-grid {
  display: none;
}
.order-filters:not(.filters-open) > #order-bulk-actions {
  margin-top: 10px;
}
#view-orders > .tablecard {
  border-radius: 0 0 12px 12px;
}
.order-row-selected {
  background: #f2f5ff;
}
.order-pager {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  flex-wrap: wrap;
}
.order-page-size {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-inline-start: auto;
  color: var(--muted);
  font-size: 0.8125rem;
}
.order-page-size select {
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  padding: 0 8px;
}
.order-open {
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.order-campaign {
  overflow-wrap: anywhere;
}
.order-sortable {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
.order-sortable:after {
  content: "";
  color: var(--muted);
}
.order-sortable[data-sort-state="asc"]:after {
  content: " \2191";
}
.order-sortable[data-sort-state="desc"]:after {
  content: " \2193";
}
#view-products > .section > .btn {
  display: none;
}
.stitch-catalog-actions {
  margin: 0;
  align-items: center;
}
.stitch-catalog-actions .btn {
  height: 44px;
}
#product-list-card {
  overflow: visible;
  border: 0;
  background: transparent;
}
#product-list-card .catalog-controls {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) 180px 180px;
  gap: 12px;
  margin-bottom: 18px;
  padding: 0;
}
#product-list-card .catalog-controls .input {
  height: 44px;
  background: var(--card);
}
#product-list-card .tablewrap,
#product-list-card table,
#product-list-card tbody {
  display: block;
  overflow: visible;
}
#product-list-card thead {
  display: none;
}
#product-list-card #product-rows {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
}
#product-rows tr {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 370px;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  transition:
    border-color 0.15s,
    transform 0.15s;
}
#product-rows tr:hover {
  border-color: var(--green);
  transform: translateY(-2px);
}
#product-rows td {
  display: block;
  padding: 0 20px;
  border: 0;
}
#product-rows td:first-child {
  padding: 0;
}
#product-rows .product-cell {
  display: block;
}
.product-card-media {
  position: relative;
  height: 180px;
  background: var(--card2);
  overflow: hidden;
}
.product-card-media .product-thumb {
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 0;
  object-fit: contain;
  background: var(--card2);
}
.product-card-media .product-thumb.empty {
  display: grid;
  place-items: center;
  font-size: 2rem;
  color: var(--muted);
}
.product-card-stock {
  display: none !important;
}
.product-card-stock.low {
  background: var(--amber);
}
.product-card-stock.out {
  background: var(--red);
}
.product-type-tag {
  position: absolute;
  bottom: 12px;
  inset-inline-start: 12px;
  border-radius: 3px;
  padding: 5px 9px;
  background: rgba(15, 23, 42, 0.84);
  color: #fff;
  font-family: inherit;
  font-size: 0.625rem;
  font-weight: 700;
  line-height: 1.3;
}
.product-card-copy {
  padding: 16px 20px 10px;
}
.product-card-copy .cellmain {
  display: -webkit-box;
  overflow: hidden;
  color: var(--ink);
  font-size: 1rem;
  line-height: 22px;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.product-card-copy .cellsub {
  margin-top: 7px;
  font-family: inherit;
  font-variant-numeric: tabular-nums lining-nums;
}
#product-rows td:nth-child(2) {
  color: var(--muted);
  font-size: 0.75rem;
}
#product-rows td:nth-child(3) {
  margin-top: auto;
  padding-top: 12px;
}
#product-rows td:nth-child(4),
#product-rows td:nth-child(5) {
  display: none;
}
#product-rows td:last-child {
  padding: 16px 20px 20px;
}
#product-rows td:last-child .btn {
  width: 100%;
  background: var(--green);
  border-color: var(--green);
  color: var(--action-primary-text);
}

@media (max-width: 1100px) and (min-width: 761px) {
  #product-list-card #product-rows {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .orders-kpis {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 760px) {
  #view-orders > .section,
  #view-products > .section {
    margin: 20px 4px 16px;
    align-items: flex-start;
  }
  #view-orders > .section h2,
  #view-products > .section h2 {
    font-size: 1.75rem;
    line-height: 36px;
  }
  #view-orders > .section p,
  #view-products > .section p {
    display: none;
  }
  #view-orders > .section .actions {
    margin: 0;
  }
  #view-orders > .section .actions .btn:not(.primary) {
    display: none;
  }
  .orders-kpis {
    display: none;
  }
  .order-stitch-toolbar {
    align-items: stretch;
    flex-wrap: wrap;
  }
  .order-stitch-search {
    flex-basis: calc(100% - 56px);
    order: 1;
  }
  .order-filter-toggle {
    order: 2;
  }
  .order-status-tabs {
    order: 3;
    width: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    gap: 10px;
    overflow: auto;
  }
  .order-status-tab {
    min-height: 48px;
    padding: 10px 18px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--card);
  }
  .order-status-tab.active {
    background: var(--green);
    border-color: var(--green);
    color: var(--action-primary-text);
  }
  #order-filters {
    padding: 0 4px 20px;
    border: 0;
    background: transparent;
  }
  #order-filters > #order-bulk-actions,
  #order-filter-count {
    display: none;
  }
  #order-filters > .filter-grid {
    padding: 14px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 10px;
  }
  #view-orders > .tablecard {
    border: 0;
    background: transparent;
  }
  #order-rows {
    gap: 16px !important;
  }
  #order-rows tr {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    gap: 8px 14px;
    padding: 20px !important;
    border-radius: 12px !important;
  }
  #order-rows td {
    display: block !important;
    padding: 0 !important;
    border: 0 !important;
  }
  #order-rows td:before {
    display: none !important;
  }
  /* Keyed by data-column, never by nth-child: adding the Campaign column shifted
     every index and silently rearranged this card. */
  #order-rows td[data-column="order"] {
    grid-column: 1;
    grid-row: 1;
  }
  #order-rows td[data-column="customer"] {
    grid-column: 1;
    grid-row: 2;
    padding-top: 14px !important;
    border-top: 1px solid #e2e8f0 !important;
  }
  #order-rows td[data-column="governorate"],
  #order-rows td[data-column="campaign"],
  #order-rows td[data-column="profit"] {
    display: none !important;
  }
  #order-rows td[data-column="status"] {
    grid-column: 2;
    grid-row: 1;
    text-align: end;
  }
  #order-rows td[data-column="status"] .cellsub,
  #order-rows td[data-column="status"] .signal-state {
    display: none;
  }
  #order-rows td[data-column="total"] {
    grid-column: 2;
    grid-row: 2;
    padding-top: 14px !important;
    border-top: 1px solid #e2e8f0 !important;
    font-family: inherit;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.467;
    font-variant-numeric: tabular-nums lining-nums;
  }
  #order-rows td[data-column="actions"] {
    grid-column: 1/-1;
    grid-row: 3;
    margin-top: 8px;
  }
  #order-rows td[data-column="actions"] .btn:not(.primary),
  #order-rows td[data-column="actions"] label {
    display: none;
  }
  #order-rows td[data-column="actions"] .btn.primary {
    width: 100%;
  }
  #product-list-card .catalog-controls {
    grid-template-columns: minmax(0, 1fr) 52px;
    margin: 0 4px 16px;
  }
  #product-list-card .catalog-controls select {
    display: none;
  }
  #product-list-card #product-rows {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 0 4px;
  }
  #product-rows tr {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr) auto;
    min-height: 112px;
    border-radius: 0;
    transform: none !important;
  }
  #product-rows td:first-child {
    grid-column: 1/3;
    grid-row: 1;
  }
  #product-rows .product-cell {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr);
  }
  .product-card-media {
    height: 110px;
  }
  .product-card-copy {
    padding: 16px 14px;
  }
  .product-card-copy .cellmain {
    font-size: 0.875rem;
    line-height: 20px;
  }
  .product-card-copy .cellsub {
    font-size: 0.625rem;
  }
  #product-rows td:nth-child(2),
  #product-rows td:nth-child(3),
  #product-rows td:nth-child(4),
  #product-rows td:nth-child(5) {
    display: none;
  }
  #product-rows td:last-child {
    grid-column: 3;
    grid-row: 1;
    padding: 34px 12px;
  }
  #product-rows td:last-child .btn {
    width: 40px;
    height: 40px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--muted);
    font-size: 0;
  }
  #product-rows td:last-child .btn:after {
    content: "✎";
    font-size: 1.375rem;
  }
  .product-card-stock {
    display: none !important;
  }
  .product-card-stock.low {
    color: var(--amber);
  }
  .product-card-stock.out {
    color: var(--red);
  }
  .product-type-tag {
    bottom: 12px;
    inset-inline-start: 12px;
  }
  .stitch-catalog-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
  }
  .stitch-catalog-actions .btn {
    width: 100%;
  }

}

/* Stitch parity for the remaining operating surfaces and their nested views. */
.workspace-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0 0 20px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card2);
  overflow: auto;
}
.workspace-tab {
  min-height: 36px;
  padding: 8px 16px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 0.55rem;
  font-weight: 700;
  line-height: 1.455;
  font-variant-numeric: tabular-nums lining-nums;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.workspace-tab.active {
  background: var(--green);
  color: var(--action-primary-text);
}
.workspace-panel-hidden {
  display: none !important;
}
#view-growth > .section,
#view-decision > .section,
#view-analytics > .section,
#view-integrations > .section,
#view-settings > .section {
  margin: 34px 0 28px;
  align-items: center;
}
#view-growth > .section h2,
#view-decision > .section h2,
#view-analytics > .section h2,
#view-integrations > .section h2,
#view-settings > .section h2 {
  font-size: 2.25rem;
  line-height: 44px;
}

.inbox {
  height: calc(100dvh - 220px);
  min-height: 580px;
  border: 1px solid var(--border-default);
  border-radius: var(--r-lg);
}
.inbox-stitch-head {
  padding: 24px 20px 14px;
  border-bottom: 1px solid var(--border-default);
  background: var(--surface-raised);
}
.inbox-stitch-brand {
  color: var(--green);
  font-family: inherit;
  font-size: 0.5rem;
  font-weight: 700;
  line-height: 1.4;
  font-variant-numeric: tabular-nums lining-nums;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.inbox-stitch-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 6px;
}
.inbox-stitch-title h2 {
  margin: 0;
  color: var(--text-primary);
  font-size: 1.875rem;
  line-height: 38px;
}
.inbox-stitch-title button {
  width: 40px;
  height: 40px;
  padding: 0;
}
.inbox-status-tabs {
  display: flex;
  gap: 20px;
  margin-top: 18px;
}
.inbox-status-tab {
  position: relative;
  padding: 8px 0;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font-weight: 700;
}
.inbox-status-tab.active {
  color: var(--text-primary);
}
.inbox-status-tab.active:after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -15px;
  height: 2px;
  background: var(--text-primary);
}
.inboxfilters {
  padding: 16px 20px;
  background: var(--surface-raised);
}
.inboxfilters > .row {
  display: none;
}
.inboxfilters .input {
  height: 44px;
  border-radius: 8px;
  background: var(--surface-subtle);
  color: var(--text-primary);
}
.threaditem {
  padding: 16px 20px;
  border-inline-start: 3px solid transparent;
}
.threaditem.active {
  border-inline-start-color: var(--green);
  background: var(--interaction-selected-bg);
}
.threaditem.active .avatar {
  background: var(--nav);
  color: var(--navink);
}
.thread-customer-meta {
  margin-top: 8px;
}
.unread-count {
  background: var(--nav);
  box-shadow: none;
}
.chat {
  background: var(--surface-canvas);
}
.chathead {
  height: 78px;
  padding: 14px 20px;
  background: var(--surface-raised);
}
.messages {
  padding: 24px;
}
.bubble.out {
  background: var(--nav);
  color: var(--navink);
}
.bubble.out small {
  color: var(--navmuted);
}
.composer {
  padding: 16px 20px;
  background: var(--surface-raised);
}
.composer-shell {
  border-color: var(--border-strong);
  border-radius: 10px;
  background: var(--surface-raised);
  color: var(--text-primary);
}
.customer {
  padding: 0 20px 24px;
  border-inline-start: 1px solid var(--border-default);
}
.inbox-ltv-card {
  margin: 20px 0;
  padding: 20px;
  border-radius: 10px;
  background: #0e1a2b;
  color: #fff;
}
.inbox-ltv-card small {
  display: block;
  color: #cbd5e1;
  font-family: inherit;
  font-size: 0.5rem;
  font-weight: 600;
  line-height: 1.4;
  font-variant-numeric: tabular-nums lining-nums;
  text-transform: uppercase;
}
.inbox-ltv-card strong {
  display: block;
  margin-top: 8px;
  font-family: inherit;
  font-size: 1.4rem;
  font-weight: 600;
  line-height: 1.286;
  font-variant-numeric: tabular-nums lining-nums;
}
.inbox-ltv-card span {
  display: block;
  margin-top: 8px;
  color: #c8f169;
  font-size: 0.75rem;
}
.customer .socialcard {
  margin: 0 -20px 20px;
  padding: 20px;
  border-bottom: 1px solid var(--border-default);
}
.mobile-auto-replies {
  display: none;
}

.performance-primary {
  display: grid;
  grid-template-columns: minmax(270px, 0.72fr) minmax(0, 1.28fr);
  gap: 24px;
  margin-bottom: 24px;
}
.spend-distribution {
  min-height: 330px;
}
.spend-ring-wrap {
  display: grid;
  grid-template-columns: 154px 1fr;
  gap: 22px;
  align-items: center;
  margin-top: 28px;
}
.spend-ring {
  width: 154px;
  height: 154px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: conic-gradient(
    #0e1a2b 0 var(--spend-a, 60%),
    #c8f169 var(--spend-a, 60%) calc(var(--spend-a, 60%) + var(--spend-b, 25%)),
    #94a3b8 0
  );
}
.spend-ring:after {
  content: "";
  width: 92px;
  height: 92px;
  border-radius: 50%;
  background: var(--card);
}
.spend-legend {
  display: grid;
  gap: 13px;
}
.spend-legend-row {
  display: grid;
  grid-template-columns: 10px 1fr auto;
  gap: 8px;
  align-items: center;
  font-size: 0.75rem;
}
.spend-legend-row i {
  width: 9px;
  height: 9px;
  border-radius: 2px;
}
.spend-legend-row span {
  color: var(--muted);
}
.spend-legend-row b {
  font-family: inherit;
  font-variant-numeric: tabular-nums lining-nums;
}
.performance-highlight {
  min-height: 330px;
}
.performance-highlight .chart {
  height: 224px;
}
.performance-kpis {
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
}
.performance-kpis .kpi {
  min-height: 150px;
}
.performance-kpis .kpi:nth-child(n + 5) {
  display: none;
}
.performance-kpis .kpi strong {
  margin-top: 24px;
}

.decision-layout {
  display: grid;
  grid-template-columns: minmax(260px, 0.3fr) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}
.decision-recommendation-rail {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
.decision-recommendation-rail > .card {
  padding: 18px;
}
.decision-recommendation-rail .cardhead {
  margin-bottom: 10px;
}
.decision-recommendation-rail .cardhead h2 {
  font-size: 1.0625rem;
}
.decision-main {
  display: grid;
  gap: 20px;
}
.decision-main .ops-strip {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.decision-main .ops-tile {
  min-height: 150px;
  padding: 22px;
}
.decision-main .ops-tile:nth-child(n + 3) {
  display: none;
}
.decision-main .ops-tile strong {
  font-family: inherit;
  font-size: 1.4rem;
  font-weight: 600;
  line-height: 1.286;
  font-variant-numeric: tabular-nums lining-nums;
}
.decision-roi-card {
  overflow: hidden;
  width: 100%;
}
.decision-roi-card > .cardhead {
  padding: 24px;
}
.decision-critical-mobile {
  display: none;
}

.ai-budget-alert {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  padding: 16px 20px;
  border: 1px solid var(--amber);
  border-radius: 10px;
  background: var(--amberbg);
}
.ai-budget-alert .alert-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--amber);
  color: #fff;
  font-weight: 900;
}
.ai-budget-alert b {
  display: block;
  color: #7c2d12;
}
.ai-budget-alert span {
  display: block;
  margin-top: 3px;
  color: #92400e;
  font-size: 0.75rem;
}
.ai-primary-metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
}
.ai-primary-metrics > .metric {
  min-height: 160px;
  padding: 24px;
}
.ai-primary-metrics > .metric:nth-child(n + 5) {
  display: none;
}
.ai-primary-metrics > .metric strong {
  font-family: inherit;
  font-variant-numeric: tabular-nums lining-nums;
}
.ai-cost-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  gap: 24px;
}
.ai-cost-layout > .card {
  min-height: 330px;
}
.ai-daily {
  height: 240px;
}
.ai-model-matrix {
  margin-top: 24px;
}
.ai-cache-panel {
  margin-top: 24px !important;
}

.integration-health-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.integration-health-kpi {
  min-height: 142px;
  padding: 20px;
}
.integration-health-kpi small {
  color: var(--muted);
  font-family: inherit;
  font-size: 0.5rem;
  font-weight: 700;
  line-height: 1.5;
  font-variant-numeric: tabular-nums lining-nums;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.integration-health-kpi strong {
  display: block;
  margin-top: 22px;
  color: var(--ink);
  font-family: inherit;
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.28;
  font-variant-numeric: tabular-nums lining-nums;
}
.integration-health-kpi span {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 0.6875rem;
}
.integration-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.integration-card {
  min-height: 260px;
  padding: 0 !important;
  overflow: hidden;
}
.integration-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px;
  border-bottom: 1px solid var(--line);
}
.integration-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.integration-logo {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #0e1a2b;
  color: #c8f169;
  font-weight: 900;
}
.integration-card-body {
  padding: 20px;
}
.integration-card-body p {
  min-height: 42px;
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 19px;
}
.integration-card .facts {
  gap: 0;
}
.integration-card .fact {
  padding: 10px 0;
  border-bottom: 1px solid #e2e8f0;
  background: transparent;
}
.integration-card .fact:last-child {
  border: 0;
}
.integration-card .btn {
  width: 100%;
  margin-top: 16px;
}

.settings-categories {
  position: sticky;
  top: 64px;
  z-index: 8;
  display: flex !important;
  gap: 0;
  flex-wrap: nowrap;
  margin-bottom: 24px;
  padding: 0;
  border-radius: 8px;
  background: var(--card);
  overflow: auto;
}
.settings-category {
  min-height: 48px;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: var(--card);
  padding: 13px 18px;
}
.settings-category.active {
  border-bottom-color: var(--green);
  background: var(--card);
  color: var(--ink);
}
.system-status-summary {
  padding: 20px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--mint);
}
.system-status-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 20px;
}
.system-check {
  border-radius: 10px;
  background: var(--card);
}
.system-command-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
  gap: 20px;
}
.system-command-grid .system-status-grid {
  grid-template-columns: 1fr;
}
.system-command-side {
  display: grid;
  gap: 20px;
}
.backup-schedule-card,
.operator-card,
.audit-preview-card {
  padding: 20px;
}
.backup-schedule-card .fact,
.operator-card .staffrow {
  padding: 11px 0;
  background: transparent;
  border-bottom: 1px solid #e2e8f0;
}
.audit-preview-card {
  grid-column: 1/-1;
  background: #0e1a2b;
  color: #f8fafc;
}
.audit-preview-card .cardhead h2,
.audit-preview-card .cardhead p {
  color: #f8fafc;
}
.audit-lines {
  font-family: inherit;
  font-size: 0.55rem;
  font-weight: 500;
  line-height: 1.818;
  font-variant-numeric: tabular-nums lining-nums;
  color: #cbd5e1;
}
.audit-line {
  display: grid;
  grid-template-columns: 150px 100px 1fr;
  gap: 12px;
  padding: 7px 0;
  border-bottom: 1px solid #273449;
}
.audit-line b {
  color: #c8f169;
}

.gatecard > .logo {
  display: none;
}
.login-security-mark {
  width: 66px;
  height: 66px;
  display: grid;
  place-items: center;
  margin: 0 auto 18px;
  border: 1px solid #475569;
  border-radius: 50%;
  background: #0e1a2b;
  color: #c8f169;
  font-size: 1.75rem;
}
.login-security-copy {
  text-align: center;
  margin: 18px 0 0;
  color: #94a3b8;
  font-size: 0.6875rem;
}
.gatecard .login-kicker {
  color: #c8f169;
}
.gatecard form {
  margin-top: 24px;
}
.editor-tabs {
  position: sticky;
  top: -30px;
  z-index: 5;
  margin: 0 -30px 22px;
  padding: 10px 30px;
  border-block: 1px solid var(--line);
  background: var(--card);
}
.editor-tab {
  border-radius: 5px;
}
.editor-tab.active {
  background: var(--green);
  color: var(--action-primary-text);
}
.editor-savebar {
  bottom: -20px;
  margin: 0 -10px -10px;
  border-radius: 8px;
  background: var(--card);
  backdrop-filter: none;
}
.order-timeline {
  position: relative;
  padding-inline-start: 24px;
}
.order-timeline:before {
  content: "";
  position: absolute;
  inset-inline-start: 7px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--line);
}
.order-timeline-item {
  position: relative;
  padding: 0 0 20px;
}
.order-timeline-item:before {
  content: "";
  position: absolute;
  inset-inline-start: -21px;
  top: 4px;
  width: 10px;
  height: 10px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #0e1a2b;
  box-shadow: 0 0 0 2px #0e1a2b;
}

@media (max-width: 1100px) and (min-width: 761px) {
  /* Pane sizing and visibility are operator controls now. See inbox.css. */
  .performance-primary,
  .decision-layout,
  .ai-cost-layout,
  .system-command-grid {
    grid-template-columns: 1fr;
  }
  .integration-health-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 760px) {
  .inbox {
    height: calc(100dvh - 190px);
    min-height: 0;
    display: block;
  }
  .inbox-stitch-head {
    padding: 18px 20px 14px;
  }
  .inbox-stitch-brand {
    display: none;
  }
  .inbox-stitch-title h2 {
    font-size: 1.75rem;
  }
  .inbox-status-tabs {
    margin-top: 10px;
  }
  .inbox-status-tab.active:after {
    bottom: -15px;
  }
  .inboxfilters {
    padding: 16px 20px 10px;
  }
  .mobile-auto-replies {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 8px 20px 12px;
    padding: 14px;
    border: 1px solid var(--border-default);
    border-radius: 10px;
    background: var(--surface-raised);
  }
  .mobile-auto-replies span {
    display: block;
    color: var(--text-muted);
    font-size: 0.6875rem;
  }
  .mobile-auto-replies input {
    width: 38px;
    height: 20px;
    accent-color: var(--green);
  }
  .threaditem {
    min-height: 92px;
    padding: 15px 20px;
  }
  .inbox.chatopen {
    height: 100dvh;
  }
  .inbox.chatopen .chat {
    height: 100dvh;
  }
  .chathead {
    height: auto;
    min-height: 72px;
  }
  .customer {
    display: none;
  }
  #view-growth > .section,
  #view-decision > .section,
  #view-analytics > .section,
  #view-integrations > .section,
  #view-settings > .section {
    margin: 20px 4px 16px;
    align-items: flex-start;
  }
  #view-growth > .section h2,
  #view-decision > .section h2,
  #view-analytics > .section h2,
  #view-integrations > .section h2,
  #view-settings > .section h2 {
    font-size: 1.75rem;
    line-height: 36px;
  }
  #view-growth > .section p,
  #view-decision > .section p,
  #view-analytics > .section p,
  #view-integrations > .section p,
  #view-settings > .section p {
    display: none;
  }
  .workspace-tabs {
    margin: 0 4px 16px;
    border: 0;
    background: transparent;
    gap: 10px;
    padding: 0;
  }
  .workspace-tab {
    min-height: 44px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--card);
  }
  .workspace-tab.active {
    border-color: var(--green);
    background: var(--green);
  }
  .performance-kpis,
  .ai-primary-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 12px;
  }
  .performance-kpis .kpi,
  .ai-primary-metrics > .metric {
    display: block !important;
    min-height: 138px;
    padding: 18px;
  }
  .performance-kpis .kpi:nth-child(n + 5),
  .ai-primary-metrics > .metric:nth-child(n + 5) {
    display: none !important;
  }
  .performance-primary,
  .decision-layout,
  .ai-cost-layout,
  .system-command-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .spend-distribution {
    min-height: auto;
  }
  .spend-ring-wrap {
    grid-template-columns: 120px 1fr;
    gap: 14px;
  }
  .spend-ring {
    width: 120px;
    height: 120px;
  }
  .spend-ring:after {
    width: 72px;
    height: 72px;
  }
  .performance-highlight {
    display: none;
  }
  .decision-critical-mobile {
    display: flex;
    gap: 12px;
    margin: 0 4px 16px;
    padding: 14px;
    border: 1px solid var(--red);
    border-radius: 10px;
    background: #fff1f2;
    color: #991b1b;
  }
  .decision-recommendation-rail {
    order: 2;
  }
  .decision-main {
    order: 1;
  }
  .decision-main .ops-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
  .decision-main .ops-tile {
    min-height: 126px;
    padding: 18px;
  }
  .decision-main .ops-tile strong {
    font-size: 1.375rem;
  }
  .decision-roi-card {
    display: none;
  }
  .ai-budget-alert {
    margin: 0 4px 16px;
  }
  .ai-cost-layout > .card {
    min-height: auto;
  }
  .ai-daily {
    height: 210px;
  }
  .ai-model-matrix {
    margin-top: 16px;
  }
  .integration-health-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
  .integration-health-kpi {
    min-height: 124px;
    padding: 16px;
  }
  .integration-health-kpi strong {
    font-size: 1.25rem;
  }
  .integration-grid {
    grid-template-columns: 1fr;
  }
  .integration-card {
    min-height: auto;
  }
  .settings-categories {
    position: static;
    margin: 0 4px 18px;
    display: flex !important;
  }
  .settings-category {
    white-space: nowrap;
  }
  .system-status-grid {
    grid-template-columns: 1fr;
  }
  .system-command-side {
    gap: 16px;
  }
  .audit-preview-card {
    grid-column: auto;
  }
  .audit-line {
    grid-template-columns: 1fr;
    gap: 2px;
  }
  .gate {
    align-items: start;
    padding: 80px 20px 30px;
    background: var(--card2);
  }
  .gatecard {
    padding: 0;
    border: 0;
    background: transparent;
    color: #0e1a2b;
    box-shadow: none;
  }
  .gatecard h1 {
    color: #0e1a2b;
  }
  .gatecard .login-copy,
  .gatecard .field label {
    color: #64748b;
  }
  .gatecard .field input {
    border-color: #cbd5e1;
    background: var(--card);
    color: #0e1a2b;
  }
  .gatecard .btn.primary {
    background: var(--green);
    border-color: var(--green);
    color: var(--action-primary-text);
  }
  .login-security-mark {
    border-color: var(--line);
    background: var(--card);
    color: #0e1a2b;
  }
  .login-security-copy {
    color: #64748b;
  }
  .editor-tabs {
    top: 0;
    margin: 0 -4px 18px;
    padding: 8px 4px;
  }
  .editor-savebar {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 92px;
    margin: 0;
    box-shadow: 0 8px 28px rgba(15, 23, 42, 0.14);
  }
}

/* Mobile shell acceptance contract: one header and a dismissible navigation drawer. */
@media (max-width: 760px) {
  .top {
    display: none !important;
  }
  .page-heading {
    display: none;
  }
  #view-orders > .section h2,
  #view-products > .section h2,
  #view-growth > .section h2,
  #view-decision > .section h2,
  #view-analytics > .section h2,
  #view-integrations > .section h2,
  #view-settings > .section h2 {
    font-size: 1.375rem;
    line-height: 28px;
  }
  .stitch-catalog-actions {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .stitch-catalog-actions .btn {
    height: 44px;
    padding: 8px 10px;
    font-size: 0.8125rem;
  }
  #product-editor .cardhead {
    margin: 0 -12px;
    padding: 14px 12px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    background: var(--surface-raised);
    border-bottom: 1px solid var(--border-default);
  }
  #product-editor .cardhead > div {
    min-width: 0;
  }
  #product-editor .cardhead h2 {
    margin: 0;
    font-size: 1.25rem;
    line-height: 26px;
    overflow-wrap: anywhere;
  }
  #product-editor .cardhead p {
    margin-top: 3px;
    color: var(--text-muted);
    font-size: 0.6875rem;
    line-height: 16px;
  }
  #product-editor #close-product {
    max-width: 92px;
    padding: 7px 9px;
    font-size: 0.6875rem;
    white-space: normal;
  }
  #product-editor .editor-tabs {
    margin-inline: -12px;
    padding-inline: 12px;
    border-block-color: var(--border-default);
    background: var(--surface-raised);
  }
  #product-editor .editor-tab {
    color: var(--text-muted);
  }
  #product-editor .editor-tab.active {
    background: var(--nav);
    color: var(--navink);
  }
  #product-editor .editor-savebar {
    border: 1px solid var(--border-default);
    background: var(--surface-raised);
    color: var(--text-primary);
  }
  .main,
  [dir="rtl"] .main {
    background: var(--surface-canvas);
  }
  .mobile-stitch-head {
    background: var(--surface-raised);
    border-bottom-color: var(--border-default);
  }
  .mobile-stitch-head b,
  .mobile-stitch-head button {
    color: var(--text-primary);
  }
  .side {
    display: flex;
    width: 86vw;
    max-width: 320px;
    transform: translateX(-105%);
    transition: transform 180ms ease;
    box-shadow: var(--shadow-lg);
  }
  [dir="rtl"] .side {
    transform: translateX(105%);
  }
  body.mobile-nav-open {
    overflow: hidden;
  }
  body.mobile-nav-open .side,
  [dir="rtl"] body.mobile-nav-open .side {
    transform: translateX(0);
  }
  body.mobile-nav-open::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 45;
    background: rgba(2, 6, 23, 0.56);
    backdrop-filter: blur(2px);
  }
  .side {
    z-index: 50;
  }
}

/* Orders on a phone. The Stitch card sizes its second column with `auto`, so a
   long status pill such as "Awaiting shipping company" took 240px of a 358px
   card and starved the first column to 62px - which is why an order id printed
   one or two characters per line. A proportional split cannot starve either
   side, and the pill wraps instead of pushing. Profit was hidden outright; a
   merchant reading orders on a phone needs it more than anything else on the
   card. */
@media (max-width: 767px) {
  #order-rows tr {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr) !important;
  }
  #order-rows td[data-column="order"] .cellmain {
    overflow-wrap: normal;
    word-break: normal;
    font-variant-numeric: tabular-nums lining-nums;
  }
  #order-rows td[data-column="order"] .cellsub {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
  }
  #order-rows td[data-column="status"] .status,
  #order-rows td[data-column="status"] .badge {
    display: inline-block;
    max-width: 100%;
    white-space: normal;
    text-align: center;
    line-height: 1.3;
  }
  /* Profit belongs on the card, stacked under the total it came out of. */
  #order-rows td[data-column="profit"] {
    display: block !important;
    grid-column: 2;
    grid-row: 3;
    text-align: end;
    font-size: 0.75rem;
    font-weight: 700;
  }
  #order-rows td[data-column="profit"]::before {
    display: inline !important;
    content: attr(data-label) " ";
    color: var(--muted);
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }
  #order-rows td[data-column="actions"] {
    grid-row: 4;
  }
  /* The separators were a hardcoded light grey, which glowed on a dark theme. */
  #order-rows td[data-column="customer"],
  #order-rows td[data-column="total"] {
    border-top-color: var(--line) !important;
  }
  /* The header action wrapped onto three lines inside a 92px box. */
  #view-orders > .section {
    flex-wrap: wrap;
    gap: 10px;
  }
  #view-orders > .section > .actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 8px;
    width: 100%;
  }
  #view-orders > .section > .actions > .btn {
    width: 100%;
    min-height: 44px;
    white-space: nowrap;
  }
  /* Clear the bottom navigation and the floating assistant button. */
  #view-orders > .tablecard { padding-bottom: 76px; }
}
/* The orders table keeps the desktop min-width it needs for seven columns, which
   the proportional card columns then resolve against - so the card measured
   638px inside a 390px screen and the wrapper scrolled sideways. On a phone the
   rows are cards, not a table, so neither needs that width. */
@media (max-width: 767px) {
  #view-orders > .tablecard > .tablewrap {
    overflow-x: hidden;
    max-width: 100%;
  }
  #view-orders > .tablecard table {
    display: block;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100%;
  }
  #order-rows { max-width: 100%; }
  #order-rows tr { max-width: 100%; }
}

/* The order status tabs and the filter divider were built with literal light
   colours, so on any dark theme the strip rendered as a white bar with a black
   active pill. Reading them from tokens makes them follow whatever theme is set,
   including the two Taager palettes. */
.order-status-tabs {
  border-color: var(--line);
  background: var(--card2);
}
.order-status-tab { color: var(--muted); }
.order-status-tab.active {
  background: var(--green);
  color: var(--action-primary-text);
}
/* The selected tab wears the tone of the outcome it filters to, so the strip and
   the badges in the rows below it agree on what each status looks like. */
.order-status-tab.status-tone-pending_confirmation.active {
  background: var(--tone-pending-bg);
  color: var(--tone-pending-text);
  box-shadow: inset 0 0 0 1px var(--tone-pending-border);
}
.order-status-tab.status-tone-confirmed.active {
  background: var(--tone-confirmed-bg);
  color: var(--tone-confirmed-text);
  box-shadow: inset 0 0 0 1px var(--tone-confirmed-border);
}
.order-status-tab.status-tone-delivery_in_progress.active {
  background: var(--tone-transit-bg);
  color: var(--tone-transit-text);
  box-shadow: inset 0 0 0 1px var(--tone-transit-border);
}
.order-status-tab.status-tone-delivered.active {
  background: var(--tone-delivered-bg);
  color: var(--tone-delivered-text);
  box-shadow: inset 0 0 0 1px var(--tone-delivered-border);
}
.order-status-tab.status-tone-suspended.active {
  background: var(--tone-suspended-bg);
  color: var(--tone-suspended-text);
  box-shadow: inset 0 0 0 1px var(--tone-suspended-border);
}
.order-status-tab.status-tone-returned_to_seller.active {
  background: var(--tone-returned-bg);
  color: var(--tone-returned-text);
  box-shadow: inset 0 0 0 1px var(--tone-returned-border);
}
.order-status-tab.status-tone-cancelled.active {
  background: var(--tone-cancelled-bg);
  color: var(--tone-cancelled-text);
  box-shadow: inset 0 0 0 1px var(--tone-cancelled-border);
}
/* The count is the point of the tab strip: it says what is waiting without
   clicking through each one. */
.order-status-tab-count {
  margin-inline-start: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(127, 140, 158, 0.18);
  font-size: 0.6875rem;
  font-variant-numeric: tabular-nums lining-nums;
}
.order-status-tab.active .order-status-tab-count {
  background: rgba(0, 0, 0, 0.14);
}
#order-filters > .filter-grid { border-top-color: var(--line); }

/* Two actions side by side left 171px each, which clipped "Create custom order"
   because the phone rule also stops it wrapping. Stack them instead. */
@media (max-width: 767px) {
  #view-orders > .section > .actions {
    grid-template-columns: minmax(0, 1fr);
  }
}
/* The phone block restates the tab colours with its own literals, and it sits
   after the themed rules above, so the strip went white again below 768px. */
@media (max-width: 767px) {
  .order-status-tab {
    border-color: var(--line);
    background: var(--card);
    color: var(--muted);
  }
  .order-status-tab.active {
    background: var(--green);
    border-color: var(--green);
    color: var(--action-primary-text);
  }
}

/* The assistant on a phone. It was a floating desktop popover pinned 152px off
   the bottom and sized `min(680px, calc(100dvh - 156px))`. Two things then went
   wrong the moment the merchant tapped the box to type. First, `dvh` collapses
   to the visual viewport when the on-screen keyboard opens, so the panel
   measured 274px on a 390x844 phone while its head, context, suggestions and
   compose still needed 328px. Second, only `.assistant-messages` carried
   `flex: 1`, and nothing else declared `flex-shrink: 0`, so the deficit was
   taken out of the compose row: it overflowed past `overflow: hidden` and the
   Ask button was clipped off the sheet - which is exactly what the phone
   screenshots show. Below 768px it is a full-screen sheet measured from
   `--assistant-vh` (the visual viewport, so the keyboard is subtracted rather
   than guessed), the compose is the one row that can never shrink, and the
   suggestion carousel folds away while the keyboard is up. */
@media (max-width: 767px) {
  .assistant-panel,
  [dir="rtl"] .assistant-panel {
    top: var(--assistant-top, 0px);
    right: 0;
    bottom: auto;
    left: 0;
    width: 100%;
    height: var(--assistant-vh, 100dvh);
    max-height: var(--assistant-vh, 100dvh);
    /* Above `.mobilebar`, which is z-index 80. */
    z-index: 90;
    border: 0;
    border-radius: 0;
    animation: none;
  }
  /* The compose row is the contract: it is the only thing the merchant needs to
     reach with the keyboard up, so every other row is fixed and the message
     list absorbs whatever height is left. */
  .assistant-head,
  .assistant-context,
  .assistant-suggestions,
  .assistant-compose {
    flex: 0 0 auto;
  }
  .assistant-messages {
    flex: 1 1 auto;
    min-height: 0;
    padding: 12px 12px 16px;
  }
  /* The head crammed a 38px mark, a wrapping title, the INTENT AWARE badge and
     two 38px buttons into 372px, so the title broke over two lines and the
     subtitle ellipsized to "Reads live data only when n...". The subtitle is
     decorative; the title and the badge are not. */
  .assistant-head {
    padding: 10px 12px;
    gap: 8px;
  }
  .assistant-identity {
    grid-template-columns: 32px minmax(0, 1fr);
    gap: 8px;
  }
  .assistant-mark {
    width: 32px;
    height: 32px;
    border-radius: 10px;
  }
  .assistant-mark .icon-svg {
    width: 17px;
    height: 17px;
  }
  .assistant-identity .cellsub {
    display: none;
  }
  .assistant-title-line {
    flex-wrap: wrap;
    gap: 3px 6px;
  }
  .assistant-title-line b,
  .assistant-live {
    white-space: nowrap;
  }
  .assistant-head-actions .btn {
    min-width: 40px;
    min-height: 40px;
  }
  /* Six context chips wrapped onto two rows and cost 71px of a sheet that has
     none to spare. One nowrap row that scrolls costs 31px. */
  .assistant-context {
    flex-wrap: nowrap;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scrollbar-width: none;
    padding: 7px 12px;
  }
  .assistant-context::-webkit-scrollbar {
    display: none;
  }
  .assistant-context span {
    flex: 0 0 auto;
    white-space: nowrap;
  }
  /* 220px columns inside a 372px panel cut every second card mid-word ("Which
     ad set has", "delivered the highes"). A column just under the viewport
     shows one card whole and peeks the next, which is what the snap points
     were already written for. */
  /* A fixed track, not a `minmax()`. With a zero minimum the six tracks
     collapse to share the 390px container instead of overflowing it, and the
     cards then print on top of each other. */
  .assistant-suggestions {
    grid-auto-columns: 76vw;
    padding: 0 12px 10px;
    scroll-padding-inline: 12px;
  }
  .assistant-suggestions button {
    max-width: none;
  }
  .assistant-compose {
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  }
  /* iOS zooms the page on focus for any font that computes under 16px, which
     shifts the whole sheet sideways before a single character is typed. Written
     in rem because the stylesheets keep type on the root scale knob, and 0.8rem
     is exactly 16px against the 20px root; a smaller root would need this
     revisited. */
  .assistant-compose textarea {
    font-size: 0.8rem;
    min-height: 44px;
    max-height: 96px;
  }
  /* There is no Shift + Enter on a touch keyboard, and the hint wrapped onto
     two lines to say so. */
  .assistant-compose-hint {
    justify-content: flex-end;
    font-size: 0.625rem;
  }
  .assistant-compose-hint > span:first-child {
    display: none;
  }
  .assistant-message {
    max-width: 86%;
  }
  /* The sheet owns the screen while it is open: the page behind it must not
     scroll under the keyboard, and the FAB and the tab bar must not sit on top
     of the conversation. */
  body.assistant-open {
    overflow: hidden;
  }
  body.assistant-open .assistant-fab,
  body.assistant-open .mobilebar {
    display: none !important;
  }
}
/* With the keyboard up there is no room for a two-row carousel, and the
   suggestions are the one row that can be spent. `.composing` covers the focus
   case; the height query covers a keyboard that opens without a focus event. */
@media (max-width: 767px) {
  .assistant-panel.composing .assistant-suggestions {
    display: none;
  }
}
@media (max-width: 767px) and (max-height: 620px) {
  .assistant-suggestions {
    display: none;
  }
}

/* Overview data is intentionally denser than the other workspaces: each card
   supports a daily operating decision, while the phone layout keeps it readable. */
.stitch-kpis {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.stitch-kpis .hero-kpi {
  grid-column: auto;
}
.kpi-definition {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.6875rem;
  line-height: 1.45;
}
.metric-delta.positive {
  color: #16713f !important;
}
.metric-delta.danger {
  color: #b42318 !important;
}
.metric-delta.context {
  color: var(--muted) !important;
}
.profit-trajectory {
  min-height: 420px;
}
.chart-range-label {
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  font-size: 0.6875rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.overview-profit-chart {
  height: 310px;
  padding: 18px 8px 20px;
  border-bottom: 0;
  background: none;
  overflow-x: auto;
}
.overview-profit-bars {
  position: relative;
  min-width: min(720px, 100%);
  height: 100%;
  align-items: stretch;
  gap: 6px;
}
.overview-profit-bars::after {
  content: "";
  position: absolute;
  z-index: 0;
  top: calc(50% - 10px);
  right: 0;
  left: 0;
  border-top: 1px solid #64748b;
}
.overview-bar-wrap {
  position: relative;
  z-index: 1;
  min-width: 34px;
  gap: 5px;
  justify-content: flex-start;
}
.overview-bar-value {
  height: 16px;
  color: var(--muted);
  font-size: 0.5625rem;
  line-height: 16px;
  font-variant-numeric: tabular-nums;
}
.overview-bar-track {
  position: relative;
  width: 100%;
  height: calc(100% - 38px);
}
.overview-bar {
  position: absolute;
  left: 12%;
  width: 76%;
  max-width: none;
  min-height: 3px;
  border-radius: 3px;
  background: var(--line-strong);
}
.overview-bar.positive {
  bottom: 50%;
  height: var(--bar-size);
  border-radius: 3px 3px 0 0;
}
.overview-bar.negative {
  top: 50%;
  height: var(--bar-size);
  border-radius: 0 0 3px 3px;
  background: #d84a3f;
}
.overview-bar.current {
  background: #3d5a0f;
  box-shadow: 0 0 0 2px #fff, 0 0 0 3px #3d5a0f;
}
.critical-panel.is-ok .critical-head {
  border-bottom-color: var(--line-strong);
  background: var(--mint);
  color: var(--green);
}
.critical-panel.has-alerts .critical-head {
  border-bottom-color: var(--line-strong);
  background: var(--redbg);
  color: var(--red);
}
.critical-panel.is-ok .critical-item.ok {
  border-color: var(--line-strong);
  background: var(--mint);
}
.critical-panel.is-ok .critical-item.ok::before {
  background: #3d5a0f;
}
.critical-meta button {
  min-height: 32px;
  padding: 4px 8px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--card);
  color: var(--muted);
  font: inherit;
  cursor: pointer;
}
.overview-funnel {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.automation-summary {
  margin: 14px 0 0;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.75rem;
}
.overview-pulse {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}
.overview-pulse > div {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card2);
}
.overview-pulse span,
.overview-pulse b {
  display: block;
}
.overview-pulse span {
  color: var(--muted);
  font-size: 0.6875rem;
}
.overview-pulse b {
  margin-top: 4px;
  overflow: hidden;
  color: var(--ink);
  font-size: 0.8125rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

@media (max-width: 760px) {
  .main,
  [dir="rtl"] .main {
    padding-bottom: calc(132px + env(safe-area-inset-bottom));
  }
  .date-filter .date-pills {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: visible;
    gap: 8px;
  }
  .date-filter .date-pill {
    width: 100%;
    white-space: normal;
  }
  .date-filter .reporting-ignore-days,
  .date-filter .custom-range {
    grid-column: 1 / -1;
  }
  .date-filter .reporting-ignore-days {
    justify-content: center;
  }
  .date-filter .custom-range {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 8px;
    align-items: center;
  }
  .date-filter .custom-range .btn {
    grid-column: 1 / -1;
  }
  .date-filter .custom-range.hidden {
    display: none;
  }
  .kpis.stitch-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .stitch-kpis .hero-kpi,
  .stitch-kpis .kpi:nth-child(4) {
    grid-column: auto;
    min-height: 172px;
  }
  .stitch-kpis .kpi {
    min-height: 172px;
    padding: 18px;
  }
  .stitch-kpis .kpi strong {
    font-size: 1.35rem;
  }
  .profit-trajectory {
    min-height: 360px;
  }
  .profit-trajectory .cardhead {
    align-items: flex-start;
    flex-direction: column;
  }
  .overview-profit-chart {
    height: 265px;
  }
  .overview-profit-bars {
    min-width: 620px;
  }
  .overview-funnel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .stitch-overview > .tablecard {
    display: block;
  }
  .stitch-overview > .tablecard .tablewrap {
    overflow-x: auto;
  }
  .stitch-overview > .tablecard table {
    min-width: 720px;
  }
  .assistant-fab,
  [dir="rtl"] .assistant-fab {
    bottom: calc(102px + env(safe-area-inset-bottom));
  }
}

/* Decision Room ---------------------------------------------------------- */

/* Whether the numbers can be trusted, stated above the numbers. A verdict read
   off stale spend or thin attribution coverage is a coin flip, and the operator
   could not see either from this tab before. */
.decision-trust {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}
.decision-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card2);
  color: var(--muted);
  font-size: 0.6875rem;
}
.decision-chip b {
  color: var(--ink);
  font-weight: 600;
}
.decision-chip.warn {
  border-color: var(--amber);
  background: var(--amberbg);
  color: var(--amber);
}
.decision-chip.warn b {
  color: var(--amber);
}
.decision-chip.danger {
  border-color: var(--red);
  background: var(--redbg);
  color: var(--red);
}
.decision-chip.danger b {
  color: var(--red);
}
.decision-head-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.decision-maturity {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card2);
  color: var(--muted);
  font-size: 0.6875rem;
}
.decision-maturity b {
  min-width: 14px;
  text-align: center;
  color: var(--ink);
}
.decision-maturity .btn.small {
  padding: 0 8px;
  min-height: 24px;
  line-height: 1;
}
.decision-delta {
  display: block;
  margin-top: 2px;
  font-size: 0.625rem;
  font-style: normal;
  color: var(--muted);
}
.decision-delta.positive {
  color: var(--green);
}
.decision-delta.negative {
  color: var(--red);
}
/* The sample a verdict stands on. "Small sample" beside a verdict is the
   difference between a decision and a guess. */
.decision-confidence {
  display: inline-block;
  margin-inline-start: 6px;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 0.625rem;
  border: 1px solid var(--line-strong);
  color: var(--muted);
  background: var(--card2);
  white-space: nowrap;
}
.decision-confidence.low {
  border-color: var(--amber);
  background: var(--amberbg);
  color: var(--amber);
}
.decision-confidence.high {
  border-color: var(--green);
  color: var(--green);
}
.decision-why {
  margin-top: 4px;
  max-width: 34ch;
}
button.decision-row {
  width: 100%;
  text-align: inherit;
  background: none;
  border-inline: 0;
  border-bottom: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
}
button.decision-row:hover {
  background: var(--card2);
}
button.decision-row:focus-visible {
  outline: none;
  box-shadow: var(--focus);
  border-radius: var(--r-md);
}
/* Headroom is the number that turns a verdict into a budget move, so it reads as
   a bar against its own ceiling rather than as one more figure in a row. */
.headroom {
  display: grid;
  gap: 2px;
  min-width: 120px;
}
.headroom-bar {
  height: 5px;
  border-radius: 999px;
  background: var(--line);
  overflow: hidden;
}
.headroom-bar i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--green);
}
.headroom-bar i.danger {
  background: var(--red);
}
.headroom small {
  color: var(--muted);
  font-size: 0.625rem;
}
.decision-watchtower th[data-decision-sort] {
  cursor: pointer;
  user-select: none;
}
.decision-watchtower th[data-decision-sort]:hover {
  color: var(--ink);
  text-decoration: underline;
}
.decision-watchtower tbody tr {
  cursor: pointer;
}
.decision-watchtower tbody tr:hover {
  background: var(--card2);
}
.decision-goal-progress {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}
.goal-progress-row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(80px, 2fr) auto;
  align-items: center;
  gap: 10px;
  font-size: 0.75rem;
}
.goal-progress-bar {
  height: 6px;
  border-radius: 999px;
  background: var(--line);
  overflow: hidden;
}
.goal-progress-bar i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--green);
}
.goal-progress-bar i.warn {
  background: var(--amber);
}
@media (max-width: 760px) {
  .goal-progress-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }
  .decision-why {
    max-width: none;
  }
}

/* The ranked queue and the ledger ---------------------------------------- */

/* A decision room whose first screen is a full table asks the operator to do the
   ranking. This does it for them and stops at five, because a queue nobody
   finishes is a list. */
.decision-queue {
  display: grid;
  gap: 10px;
}
.decision-card {
  border: 1px solid var(--line);
  border-inline-start: 3px solid var(--line-strong);
  border-radius: var(--r-md);
  padding: 12px 14px;
  background: var(--card);
  display: grid;
  gap: 8px;
}
.decision-card.critical {
  border-inline-start-color: var(--red);
}
.decision-card.attention {
  border-inline-start-color: var(--amber);
}
.decision-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.decision-card-head > b {
  font-size: 0.9375rem;
  white-space: nowrap;
}
.decision-card-why {
  margin: 0;
  color: var(--muted);
  font-size: 0.75rem;
}
.decision-card-evidence {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  padding-top: 6px;
  border-top: 1px solid var(--line);
}
.decision-card-evidence span {
  display: grid;
  gap: 1px;
}
.decision-card-evidence small {
  color: var(--muted);
  font-size: 0.625rem;
}
.decision-card-actions,
.decision-card-decided {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.decision-card-decided {
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.6875rem;
}
.decision-ledger {
  display: grid;
  gap: 8px;
}
.decision-ledger-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}
.decision-ledger-row:first-child {
  border-top: 0;
}
.decision-ledger-note {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.6875rem;
  max-width: 52ch;
}
.decision-ledger-outcomes {
  display: grid;
  gap: 4px;
  justify-items: end;
}
/* Whether the call worked, in the one unit that settles it. */
.decision-outcome {
  font-size: 0.6875rem;
  white-space: nowrap;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  color: var(--muted);
}
.decision-outcome.positive {
  border-color: var(--green);
  color: var(--green);
}
.decision-outcome.danger {
  border-color: var(--red);
  color: var(--red);
}
.decision-dialog {
  border: 1px solid var(--line-strong);
  border-radius: var(--r-lg);
  padding: 20px;
  max-width: min(460px, 92vw);
  background: var(--card);
  color: var(--ink);
  box-shadow: var(--shadow-lg);
}
.decision-dialog::backdrop {
  background: rgba(15, 23, 42, 0.45);
}
.decision-dialog h3 {
  margin: 0 0 4px;
}
.decision-dialog .field {
  margin-top: 12px;
}
.decision-dialog select,
.decision-dialog textarea {
  width: 100%;
}
@media (max-width: 760px) {
  .decision-ledger-row {
    flex-direction: column;
    gap: 8px;
  }
  .decision-ledger-outcomes {
    justify-items: start;
  }
}

/* Pausing stops someone's spend, so it is never implied by the verdict: the
   operator picks the action and ticks each campaign by name. */
.decision-campaigns {
  margin-top: 12px;
  display: grid;
  gap: 6px;
}
.decision-campaign {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--card2);
  cursor: pointer;
}
.decision-campaign span {
  display: grid;
  gap: 1px;
  min-width: 0;
}
.decision-campaign b {
  font-size: 0.75rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.decision-campaign small {
  color: var(--muted);
  font-size: 0.625rem;
}

/* Own fulfillment mode (html[data-fulfillment="own"], set from the server's
   fulfillmentMode): surfaces that only exist while Taager fulfils orders are
   hidden, and the neutral wording that replaces them is shown. */
.own-only {
  display: none;
}
html[data-fulfillment="own"] .taager-only {
  display: none !important;
}
html[data-fulfillment="own"] .own-only {
  display: revert;
}
