.ai-topbar-button {
  background: linear-gradient(135deg, #fff4c7, #f2ddff);
  border-color: #e7c8ff;
  color: #6f2da8;
  font-size: 20px;
}

.telegram-ai-button {
  flex: 0 0 auto;
  border: 1px solid #d8b7ff;
  background: linear-gradient(135deg, #fff5c4, #f3dcff);
  color: #6b299f;
  border-radius: 999px;
  min-height: 38px;
  padding: 0 14px;
  font-weight: 900;
  cursor: pointer;
}

.ai-hub-backdrop {
  z-index: 1600;
}

.ai-hub-sheet {
  width: min(980px, calc(100vw - 32px));
  max-width: 980px;
  height: min(860px, calc(100vh - 32px));
  border-radius: 26px;
  overflow: hidden;
  background: #f8fbf9;
  box-shadow: 0 28px 80px rgba(31, 65, 47, .28);
}

.ai-hub-header {
  background: linear-gradient(125deg, #fff6c7 0%, #f1dcff 48%, #d7f8e5 100%);
  border-bottom: 1px solid rgba(88, 46, 127, .14);
}

.ai-hub-header strong {
  color: #45205f;
  font-size: 22px;
}

.ai-hub-body {
  min-height: 0;
  height: calc(100% - 74px);
  overflow: auto;
  padding: 18px;
}

.ai-status-banner {
  border: 1px solid #c9e9d7;
  background: #eaf9f0;
  color: #155f38;
  border-radius: 15px;
  padding: 12px 15px;
  font-weight: 800;
  line-height: 1.35;
}

.ai-status-banner.warning {
  border-color: #ffd38f;
  background: #fff6df;
  color: #744100;
}

.ai-status-banner.error {
  border-color: #ffb8b8;
  background: #fff0f0;
  color: #8f2020;
}

.ai-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 14px 0;
  padding: 6px;
  border-radius: 18px;
  background: #eaf0ed;
}

.ai-tabs button {
  border: 0;
  border-radius: 13px;
  padding: 11px 12px;
  background: transparent;
  color: #486055;
  font-weight: 900;
  cursor: pointer;
}

.ai-tabs button.active {
  background: #ffffff;
  color: #0f7a42;
  box-shadow: 0 5px 18px rgba(25, 90, 55, .12);
}

.ai-panel {
  display: grid;
  gap: 14px;
}

.ai-empty,
.ai-assistant-intro {
  padding: 22px;
  border: 1px dashed #b7cec1;
  border-radius: 18px;
  background: #ffffff;
  color: #52665b;
  text-align: center;
}

.ai-assistant-intro {
  text-align: left;
  display: grid;
  gap: 7px;
  border-style: solid;
  background: linear-gradient(135deg, #eaf9f0, #f9f4ff);
}

.ai-context-card {
  border: 1px solid #d7e6dc;
  background: #ffffff;
  border-radius: 20px;
  padding: 17px;
  box-shadow: 0 12px 28px rgba(30, 70, 48, .08);
}

.ai-context-card > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.ai-context-card > header div {
  display: grid;
  gap: 4px;
}

.ai-context-card > header small,
.ai-result small,
.ai-next-action small {
  color: #72857a;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.ai-context-card > header strong {
  font-size: 18px;
  color: #203a2d;
}

.ai-context-card select,
.ai-settings-form select,
.ai-settings-form textarea,
.ai-assistant-form textarea,
.ai-draft-field textarea,
.phone-chat-body textarea {
  width: 100%;
  border: 1px solid #c9d9cf;
  border-radius: 13px;
  background: #ffffff;
  color: #1f3027;
  padding: 11px 12px;
  font: inherit;
  resize: vertical;
}

.ai-context-card select {
  width: auto;
  min-width: 175px;
}

.ai-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.ai-action-row button,
.ai-context-card > header button,
.ai-result > button,
.ai-assistant-form button,
.ai-settings-form > button {
  border: 1px solid #bad0c2;
  background: #f4f8f5;
  color: #244b35;
  border-radius: 13px;
  padding: 11px 15px;
  font-weight: 900;
  cursor: pointer;
}

.ai-primary,
.ai-action-row .ai-primary,
.ai-settings-form > .ai-primary,
.ai-assistant-form .ai-primary {
  border-color: #088647;
  background: linear-gradient(135deg, #0ca55a, #087a42);
  color: #ffffff;
}

.ai-action-row button:disabled,
.ai-context-card button:disabled,
.ai-assistant-form button:disabled,
.ai-settings-form button:disabled {
  opacity: .55;
  cursor: wait;
}

.ai-result {
  display: grid;
  gap: 13px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid #e0e9e3;
}

.ai-result-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 12px;
}

.ai-result-grid > div,
.ai-next-action {
  border-radius: 14px;
  padding: 13px;
  background: #f3f8f5;
}

.ai-result p {
  margin: 4px 0 0;
  white-space: pre-wrap;
  line-height: 1.45;
}

.ai-warning {
  padding: 12px 14px;
  border: 1px solid #ffbd86;
  border-radius: 14px;
  background: #fff1e5;
  color: #7a3700;
  font-weight: 800;
}

.ai-order-draft {
  display: grid;
  gap: 8px;
  border: 1px solid #c8b3f1;
  border-radius: 15px;
  background: #f7f1ff;
  padding: 13px;
}

.ai-order-draft.ready {
  border-color: #79d9a4;
  background: #e9faef;
}

.ai-order-draft-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid rgba(80, 50, 110, .1);
}

.ai-order-draft-item:last-child {
  border-bottom: 0;
}

.ai-order-draft-item small {
  text-transform: none;
  letter-spacing: 0;
}

.ai-draft-field,
.ai-settings-form > label,
.phone-chat-body > label {
  display: grid;
  gap: 7px;
  color: #31473a;
  font-weight: 800;
}

.ai-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.ai-chip {
  display: inline-flex;
  padding: 7px 10px;
  border-radius: 999px;
  background: #fff0dc;
  color: #7b4400;
  font-size: 13px;
  font-weight: 800;
}

.ai-assistant-form,
.ai-settings-form {
  display: grid;
  gap: 14px;
}

.ai-assistant-form button {
  justify-self: start;
}

.ai-suggested-actions {
  display: grid;
  gap: 8px;
}

.ai-suggested-actions div {
  border-left: 4px solid #8c49bd;
  background: #f8f0ff;
  border-radius: 0 12px 12px 0;
  padding: 10px 12px;
}

.ai-settings-form fieldset {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  border: 1px solid #d4e2d9;
  border-radius: 15px;
  padding: 13px;
}

.ai-settings-form legend {
  padding: 0 7px;
  font-weight: 900;
}

.ai-settings-form fieldset label {
  display: inline-flex;
  gap: 7px;
  align-items: center;
}

.ai-toggle {
  display: flex !important;
  align-items: flex-start;
  gap: 11px;
  border: 1px solid #d9e5dd;
  border-radius: 15px;
  background: #ffffff;
  padding: 12px 13px;
}

.ai-toggle input {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  margin-top: 2px;
}

.ai-toggle span {
  display: grid;
  gap: 3px;
}

.ai-toggle small {
  color: #68786f;
  font-weight: 500;
  line-height: 1.35;
}

.phone-chat-sheet {
  width: min(560px, calc(100vw - 24px));
  max-width: 560px;
  border-radius: 24px;
  overflow: hidden;
}

.phone-chat-body {
  display: grid;
  gap: 15px;
  padding: 18px;
}

.phone-chat-number {
  display: grid;
  gap: 4px;
  border: 1px solid #c8e2d2;
  border-radius: 16px;
  background: #eefaf3;
  padding: 14px;
}

.phone-chat-number small {
  color: #658072;
}

.phone-chat-number strong {
  font-size: 18px;
}

.phone-chat-number span {
  font-size: 16px;
  font-weight: 800;
  color: #087a42;
}

.phone-chat-hint {
  margin: 0;
  color: #65776d;
  font-size: 13px;
  line-height: 1.4;
}

.order-ai-button,
.order-phone-chat-button {
  border: 0;
  border-radius: 13px;
  min-height: 42px;
  padding: 0 14px;
  font-weight: 900;
  cursor: pointer;
}

.order-ai-button {
  background: linear-gradient(135deg, #fff4bd, #ead7ff);
  color: #61238d;
}

.order-phone-chat-button.telegram {
  background: #dff2ff;
  color: #076a9c;
}

.order-phone-chat-button.viber {
  background: #eee4ff;
  color: #62309a;
}

.order-contact-tools {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

@media (max-width: 760px) {
  .ai-hub-sheet {
    width: 100vw;
    max-width: none;
    height: 100dvh;
    border-radius: 0;
  }

  .ai-hub-body {
    padding: 12px;
  }

  .ai-tabs {
    grid-template-columns: 1fr;
  }

  .ai-tabs button {
    padding: 9px;
  }

  .ai-result-grid {
    grid-template-columns: 1fr;
  }

  .ai-context-card > header {
    align-items: stretch;
    flex-direction: column;
  }

  .ai-context-card select {
    width: 100%;
  }

  .telegram-ai-button {
    min-height: 34px;
    padding: 0 10px;
    font-size: 12px;
  }

  .order-contact-tools {
    justify-content: flex-start;
  }
}

/* v8.8.8 — shared feedback and order phone actions */
.toast.warning {
  background: #a75d00;
  color: #fff;
}
.customer-contact-actions {
  flex-wrap: wrap;
}
