:root {
  color-scheme: light;
  --office-bg: #ffffff;
  --office-surface: #ffffff;
  --office-surface-soft: #f7fbff;
  --office-ink: #20242c;
  --office-muted: #5f7286;
  --office-muted-2: #74879b;
  --office-line: #d8e5f0;
  --office-line-soft: #eaf2f7;
  --office-blue: #aac8e0;
  --office-blue-strong: #8fbdda;
  --office-control: #2f617f;
  --office-control-soft: #eef7fd;
  --office-control-line: #bdd9ea;
  --office-dark: #101114;
  --office-dark-2: #22242b;
  --office-green: #2f813a;
  --office-green-soft: #edf8f1;
  --office-red: #c52b22;
  --office-red-soft: #fff0ed;
  --office-warning: #b46b10;
  --office-shadow: 0 18px 42px rgba(31, 64, 92, 0.12);
  --office-shadow-tight: 0 12px 30px rgba(18, 24, 35, 0.08);
  --office-page-max: 1220px;
  --office-page-gutter: 48px;
  --office-page: min(
    var(--office-page-max),
    calc(100vw - var(--office-page-gutter))
  );
  --office-radius: 8px;
  --office-topbar-height: 90px;
  --font-main:
    -apple-system, BlinkMacSystemFont, "Segoe UI", "SF Pro Text", system-ui,
    sans-serif;

  --accent-blue: var(--office-control);
  --accent-blue-rgb: 47, 97, 127;
  --accent-blue-soft: var(--office-control-soft);
  --accent-blue-fill: var(--office-blue-strong);
  --panel-bg: var(--office-surface);
  --panel-bg-soft: var(--office-surface-soft);
  --panel-border: var(--office-line);
  --panel-line: var(--office-line-soft);
  --text-soft: var(--office-muted);
  --text-faint: var(--office-muted-2);
  --page-bg: var(--office-bg);
  --page-bg-soft: var(--office-bg);
  --danger: var(--office-red);
}

html,
body {
  min-height: 100%;
  background: var(--office-bg) !important;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--office-ink) !important;
  font-family: var(--font-main) !important;
  letter-spacing: 0 !important;
}

body *,
body *::before,
body *::after {
  font-family: inherit;
  letter-spacing: 0;
}

/* Shared Office header */
.top-menu-wrapper,
.login-topbar {
  position: relative !important;
  top: auto !important;
  z-index: 100;
  min-height: var(--office-topbar-height);
  border: 0 !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04) !important;
  background:
    radial-gradient(
      ellipse at 50% -42px,
      rgba(94, 99, 112, 0.64) 0%,
      rgba(42, 45, 53, 0.58) 44%,
      transparent 72%
    ),
    linear-gradient(180deg, #1c1e24 0%, #15171b 100%) !important;
  color: #fff;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.035),
    0 2px 10px rgba(0, 0, 0, 0.1) !important;
}

.top-menu,
.login-topbar-inner {
  width: var(--office-page) !important;
  max-width: none !important;
  min-height: var(--office-topbar-height) !important;
  margin: 0 auto !important;
  padding: 0 !important;
}

.top-menu {
  display: grid !important;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center !important;
  gap: 24px !important;
}

.top-brand,
.login-topbar-inner {
  display: flex;
  align-items: center;
}

.top-brand {
  min-width: max-content !important;
  gap: 12px !important;
}

.top-brand img,
.login-topbar img {
  display: block !important;
  width: clamp(142px, 12vw, 166px) !important;
  height: auto !important;
  flex: 0 0 auto !important;
  object-fit: contain;
}

.top-brand-text,
.login-topbar-text {
  color: #b8bdc7 !important;
  font-size: clamp(14px, 1.05vw, 17px) !important;
  font-weight: 600 !important;
  line-height: 1 !important;
  transform: translateY(2px);
}

.top-menu-nav {
  min-width: 0;
  overflow-x: auto !important;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}

.top-menu-nav::-webkit-scrollbar {
  display: none;
}

.menu-items {
  display: flex !important;
  align-items: center;
  gap: 4px !important;
  min-width: max-content;
}

.menu-items li,
.menu-items li.menu-link-item > a {
  min-height: 44px;
  padding: 0 10px !important;
  border: 1px solid transparent !important;
  border-radius: var(--office-radius) !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 7px;
  background: transparent !important;
  color: rgba(247, 250, 253, 0.82) !important;
  font-size: 12px !important;
  font-weight: 720 !important;
  line-height: 1 !important;
  text-decoration: none;
  text-transform: uppercase;
  white-space: nowrap;
  transition:
    background 0.16s ease,
    border-color 0.16s ease,
    color 0.16s ease,
    box-shadow 0.16s ease !important;
}

.menu-items li:hover,
.menu-items li.menu-link-item > a:hover {
  background: rgba(255, 255, 255, 0.055) !important;
  color: #fff !important;
}

.menu-items li.active,
html.app-preload[data-initial-section="parser"]
  .menu-items
  li[data-section="parser"],
html.app-preload[data-initial-section="userbots"]
  .menu-items
  li[data-section="userbots"],
html.app-preload[data-initial-section="interaction_bots"]
  .menu-items
  li[data-section="interaction_bots"],
html.app-preload[data-initial-section="api"] .menu-items li[data-section="api"],
html.app-preload[data-initial-section="sell_bot"]
  .menu-items
  li[data-section="sell_bot"],
html.app-preload[data-initial-section="link_bot"]
  .menu-items
  li[data-section="link_bot"],
html.app-preload[data-initial-section="ai_manager"]
  .menu-items
  li[data-section="ai_manager"],
html.app-preload[data-initial-section="supplier_permissions"]
  .menu-items
  li[data-section="supplier_permissions"],
html.app-preload[data-initial-section="excel"]
  .menu-items
  li[data-section="excel"],
html.app-preload[data-initial-section="admin"]
  .menu-items
  li[data-section="admin"],
html.app-preload[data-initial-section="profile"]
  .menu-items
  li[data-section="profile"] {
  border-color: rgba(213, 229, 242, 0.32) !important;
  background:
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.14),
      rgba(255, 255, 255, 0.075)
    ),
    rgba(255, 255, 255, 0.08) !important;
  color: #fff !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 10px 22px rgba(0, 0, 0, 0.16) !important;
}

.engine-nav-icon,
.engine-mobile-nav svg,
.engine-more-sheet svg,
.engine-desktop-more-menu svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.menu-items li.engine-desktop-more-trigger,
.engine-desktop-more-menu {
  display: none !important;
}

.engine-desktop-more-menu {
  position: fixed;
  z-index: 1500;
  width: min(290px, calc(100vw - 24px));
  padding: 8px;
  border: 1px solid var(--office-line);
  border-radius: var(--office-radius);
  background: rgba(255, 255, 255, 0.99);
  box-shadow: 0 22px 54px rgba(18, 24, 35, 0.18);
}

.engine-desktop-more-menu.is-open {
  display: grid !important;
  gap: 5px;
}

.engine-desktop-more-menu button {
  width: 100%;
  min-height: 46px;
  padding: 8px 10px;
  border: 1px solid transparent !important;
  border-radius: var(--office-radius) !important;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  background: transparent !important;
  color: var(--office-ink) !important;
  text-align: left;
  font-size: 13px !important;
}

.engine-desktop-more-menu button:hover,
.engine-desktop-more-menu button.is-active {
  border-color: var(--office-control-line) !important;
  background: var(--office-control-soft) !important;
  color: var(--office-control) !important;
}

.engine-desktop-more-menu button svg {
  width: 30px;
  height: 30px;
  padding: 7px;
  border-radius: 7px;
  background: var(--office-control-soft);
  color: var(--office-control);
}

.menu-items .engine-nav-icon {
  color: rgba(197, 221, 240, 0.84);
}

.logout-btn {
  width: auto !important;
  height: 44px !important;
  min-width: 104px;
  padding: 0 18px !important;
  border: 1px solid rgba(213, 229, 242, 0.2) !important;
  border-radius: var(--office-radius) !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.045) !important;
  color: rgba(247, 250, 253, 0.9) !important;
  font-size: 12px !important;
  font-weight: 720 !important;
  text-transform: uppercase;
}

.logout-btn:hover {
  border-color: rgba(213, 229, 242, 0.4) !important;
  background: rgba(255, 255, 255, 0.09) !important;
  color: #fff !important;
}

.logout-btn svg {
  width: 20px !important;
  height: 20px !important;
  color: var(--office-blue) !important;
}

.menu-items li.engine-profile-origin {
  display: none !important;
}

.engine-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: max-content;
}

.engine-profile-button {
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid rgba(213, 229, 242, 0.2) !important;
  border-radius: var(--office-radius) !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  background: rgba(255, 255, 255, 0.045) !important;
  color: rgba(247, 250, 253, 0.9) !important;
  font-size: 12px !important;
  font-weight: 720 !important;
  text-transform: uppercase;
  box-shadow: none !important;
}

.engine-profile-button svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: var(--office-blue);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.engine-profile-button:hover,
.engine-profile-button.is-active {
  border-color: rgba(213, 229, 242, 0.4) !important;
  background: rgba(255, 255, 255, 0.09) !important;
  color: #fff !important;
}

/* Page structure */
.content-area {
  flex: 1 0 auto;
  width: var(--office-page) !important;
  max-width: none !important;
  margin: 0 auto !important;
  padding: 28px 0 44px !important;
  gap: 18px !important;
  background: var(--office-bg) !important;
}

.sidebar,
.main-content,
.main-content-inner,
.workspace-panel,
#folder-catalog-section.workspace-panel {
  border: 1px solid var(--office-line) !important;
  border-radius: var(--office-radius) !important;
  background: var(--office-surface) !important;
  color: var(--office-ink) !important;
  box-shadow: none !important;
}

.sidebar {
  width: 300px !important;
  flex: 0 0 300px !important;
  padding: 18px !important;
}

.main-content {
  padding: 0 !important;
  overflow: hidden;
}

.main-content.products-layout,
#parser-section.workspace-panel {
  border: 0 !important;
  background: transparent !important;
  overflow: visible;
}

.products-main-panel,
.main-content-inner {
  padding: 22px !important;
}

.products-main-panel {
  overflow: hidden;
}

.workspace-panel {
  padding: 22px !important;
}

.workspace-panel-header,
.products-page-header,
.modal-header,
.product-editor-header,
.linkbot-panel-head,
.sellbot-panel-head,
.ai-manager-panel-head {
  border-bottom-color: var(--office-line-soft) !important;
}

.workspace-panel-header {
  margin: -22px -22px 18px !important;
  padding: 22px !important;
}

#folder-catalog-section .workspace-panel-header {
  padding: 22px !important;
  border-bottom: 1px solid var(--office-line-soft) !important;
}

.sidebar h2,
.sidebar h3,
.main-content h1,
.main-content h2,
.main-content h3,
.main-content h4,
.main-content-inner h1,
.main-content-inner h2,
.main-content-inner h3,
.main-content-inner h4,
.workspace-panel h1,
.workspace-panel h2,
.workspace-panel h3,
.workspace-panel h4,
#products-main-title,
#selected-product-folder-title,
#fc-title {
  color: var(--office-ink) !important;
  font-weight: 760 !important;
}

.products-page-title,
.workspace-panel-header h2 {
  font-size: clamp(24px, 2.2vw, 32px) !important;
  line-height: 1.08 !important;
}

.products-page-subtitle,
.workspace-panel-header p,
.muted,
.helper-text,
.field-hint,
.sellbot-muted,
.ai-manager-muted {
  color: var(--office-muted) !important;
}

.sidebar-browser-header {
  min-height: 44px;
  margin-bottom: 12px;
}

.sidebar-browser-title-btn,
.sidebar-manage-btn {
  border-radius: var(--office-radius) !important;
  color: var(--office-ink) !important;
}

.sidebar-browser-title-btn h3 {
  color: var(--office-ink) !important;
}

.sidebar-manage-btn {
  border: 1px solid var(--office-line) !important;
  background: var(--office-surface) !important;
}

.sidebar-manage-btn:hover,
.sidebar-manage-btn.active {
  border-color: var(--office-control-line) !important;
  background: var(--office-control-soft) !important;
  color: var(--office-control) !important;
}

.folder-tree li > div,
.products-folder-row,
.products-folder-tree li > div {
  border-color: transparent !important;
  border-radius: var(--office-radius) !important;
  background: transparent !important;
  color: var(--office-ink) !important;
}

.folder-tree li > div:hover,
.products-folder-row:hover,
.products-folder-tree li > div:hover {
  background: var(--office-surface-soft) !important;
}

.folder-tree li.active > div,
.folder-tree li.active > div .folder-name,
.products-folder-row.active,
.products-folder-row.is-active {
  border-color: var(--office-control-line) !important;
  background: var(--office-control-soft) !important;
  color: var(--office-control) !important;
}

.folder-name,
.products-folder-name,
.products-folder-count {
  color: inherit !important;
}

.product-status-legend,
.parser-filter-card,
.fc-toolbar-panel,
.products-bulk-actions,
.pager-shell,
.filter-panel,
.settings-panel,
.linkbot-panel,
.sellbot-panel,
.ai-manager-panel,
.publication-settings-panel,
.publication-markups-panel,
.card {
  border: 1px solid var(--office-line) !important;
  border-radius: var(--office-radius) !important;
  background: var(--office-surface) !important;
  color: var(--office-ink) !important;
  box-shadow: none !important;
}

.product-status-legend,
.products-bulk-actions,
.fc-toolbar-panel,
.pager-shell {
  background: var(--office-surface-soft) !important;
}

.product-status-legend-title,
.product-status-legend-item,
.fc-toolbar-label,
.products-selection-status,
.pager-label,
.pager-status,
.pager-total {
  color: var(--office-ink) !important;
}

/* Controls */
input,
textarea,
select,
.products-search-input,
.sidebar-search-input,
.fc-toolbar-select,
.product-editor-input,
.product-editor-textarea,
.product-editor-select,
.sellbot-inline-input {
  min-height: 44px;
  border: 1px solid var(--office-line) !important;
  border-radius: var(--office-radius) !important;
  background: var(--office-surface) !important;
  color: var(--office-ink) !important;
  font: inherit;
  font-size: 14px !important;
  outline: none !important;
  box-shadow: none !important;
  color-scheme: light !important;
}

textarea,
.product-editor-textarea {
  min-height: 112px;
  line-height: 1.5;
}

input::placeholder,
textarea::placeholder,
.products-search-input::placeholder,
.sidebar-search-input::placeholder {
  color: var(--office-muted-2) !important;
  opacity: 1;
}

input:focus,
textarea:focus,
select:focus,
.products-search-input:focus,
.sidebar-search-input:focus,
.fc-toolbar-select:focus,
.product-editor-input:focus,
.product-editor-textarea:focus,
.product-editor-select:focus {
  border-color: var(--office-control-line) !important;
  box-shadow: 0 0 0 3px rgba(143, 189, 218, 0.18) !important;
}

select,
.fc-toolbar-select,
.product-editor-select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 34px !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 18 18'%3E%3Cpath d='M4.5 6.75L9 11.25L13.5 6.75' stroke='%23718399' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round' fill='none'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: calc(100% - 10px) center !important;
  background-size: 15px !important;
}

button,
.btn,
.flat-action-btn,
.mini-action-btn,
.products-icon-btn,
.pager-btn,
.save-btn,
.parser-export-btn,
.product-editor-close,
.product-editor-synonym-suggestion,
.sellbot-btn,
.sellbot-icon-btn,
.linkbot-btn {
  border-radius: var(--office-radius) !important;
  font-weight: 700 !important;
  letter-spacing: 0 !important;
}

.primary,
.btn-primary,
.save-btn,
.parser-filter-card-submit,
.product-editor-footer .save-btn,
.sellbot-btn.primary,
.linkbot-btn.primary,
button[type="submit"] {
  min-height: 44px;
  border: 1px solid var(--office-dark) !important;
  background: linear-gradient(180deg, #202228, #15171b) !important;
  color: #fff !important;
  box-shadow: 0 10px 20px rgba(18, 24, 35, 0.12) !important;
}

.primary:hover,
.btn-primary:hover,
.save-btn:hover,
.parser-filter-card-submit:hover,
button[type="submit"]:hover {
  background: #292c33 !important;
  transform: translateY(-1px);
}

.secondary,
.btn-secondary,
.flat-action-btn,
.pager-btn,
.mini-action-btn,
.products-icon-btn,
.sidebar-manage-btn,
.product-editor-close,
.sellbot-icon-btn {
  min-height: 42px;
  border: 1px solid var(--office-line) !important;
  background: var(--office-surface) !important;
  color: var(--office-control) !important;
  box-shadow: none !important;
}

.secondary:hover,
.btn-secondary:hover,
.flat-action-btn:hover,
.pager-btn:hover,
.mini-action-btn:hover,
.products-icon-btn:hover,
.product-editor-close:hover {
  border-color: var(--office-control-line) !important;
  background: var(--office-control-soft) !important;
  color: var(--office-control) !important;
}

button:disabled,
.btn:disabled,
.pager-btn:disabled {
  opacity: 0.46 !important;
  transform: none !important;
  cursor: not-allowed !important;
}

.pager-btn:disabled {
  opacity: 1 !important;
  border-color: var(--office-line) !important;
  background: #f2f6f9 !important;
  color: #52677b !important;
}

.danger,
.btn-danger,
.message-delete-btn,
.product-photo-card-quick-remove {
  border-color: #f1b8b3 !important;
  background: var(--office-red-soft) !important;
  color: var(--office-red) !important;
}

/* Tables and dense working lists */
.products-table-wrap,
.fc-reports-table-wrap,
.product-binding-table-scroll,
.table-wrap,
.messages-table-wrap,
.engine-table-scroll {
  border: 1px solid var(--office-line) !important;
  border-radius: var(--office-radius) !important;
  background: var(--office-surface) !important;
  overflow: auto;
  box-shadow: none !important;
}

.engine-table-scroll {
  width: 100%;
  max-width: 100%;
  border: 0 !important;
  overscroll-behavior-inline: contain;
}

.engine-table-scroll > table {
  min-width: 860px;
}

table,
table.simple-table,
.products-catalog-table,
.messages-table,
.fc-reports-table,
.product-binding-confirmed-table,
.product-binding-proposed-table {
  background: var(--office-surface) !important;
  color: var(--office-ink) !important;
  border-collapse: collapse;
}

table th,
table.simple-table th,
.products-catalog-table th,
.messages-table th,
.fc-reports-table th {
  border-bottom: 1px solid var(--office-line) !important;
  background: var(--office-surface-soft) !important;
  color: var(--office-muted) !important;
  font-size: 12px !important;
  font-weight: 760 !important;
  text-transform: uppercase;
}

table td,
table.simple-table td,
.products-catalog-table td,
.messages-table td,
.fc-reports-table td {
  border-bottom: 1px solid var(--office-line-soft) !important;
  background: transparent;
  color: var(--office-ink) !important;
}

table tr:hover td,
.products-catalog-table tbody tr:hover td,
.messages-table tbody tr:hover td {
  background: #fbfdff !important;
}

.products-product-name,
.products-cell-text,
.message-sender-line,
.message-text-box,
.fc-report-product-name {
  color: var(--office-ink) !important;
  max-width: 100%;
  overflow-wrap: anywhere !important;
  white-space: normal !important;
}

.products-product-meta,
.products-product-path,
.message-date-cell,
.message-source-note,
.fc-report-product-id,
.fc-report-suppliers-meta {
  color: var(--office-muted) !important;
}

.products-product-badge,
.message-type-badge,
.sellbot-chip,
.sellbot-price-badge,
.pub-source-chip,
.pub-fit-badge,
.header-pill,
.badge {
  border: 1px solid var(--office-control-line) !important;
  border-radius: 999px !important;
  background: var(--office-control-soft) !important;
  color: var(--office-control) !important;
  box-shadow: none !important;
}

.products-catalog-table tr.bound,
.products-catalog-table tr.is-bound,
.products-catalog-table tr.confirmed,
.fc-report-row.is-expanded {
  box-shadow: inset 4px 0 0 #61a76a !important;
}

.products-catalog-table tr.bound td,
.products-catalog-table tr.is-bound td,
.products-catalog-table tr.confirmed td {
  background: var(--office-green-soft) !important;
}

.products-catalog-table tr.unbound,
.products-catalog-table tr.missing,
.products-catalog-table tr.not-bound {
  box-shadow: inset 4px 0 0 #e46f65 !important;
}

.products-catalog-table tr.unbound td,
.products-catalog-table tr.missing td,
.products-catalog-table tr.not-bound td {
  background: var(--office-red-soft) !important;
}

.products-catalog-table tr.partial,
.products-catalog-table tr.proposed {
  box-shadow: inset 4px 0 0 #d9a41b !important;
}

.products-catalog-table tr.partial td,
.products-catalog-table tr.proposed td {
  background: #fff9e8 !important;
}

.product-row-checkbox,
.message-select-checkbox,
input[type="checkbox"] {
  accent-color: var(--office-control);
}

/* Feature panels */
.linkbot-panel,
.sellbot-panel,
.ai-manager-panel,
.publication-settings-panel,
.publication-markups-panel,
.sellbot-markup-card,
.sellbot-engine-source-card,
.sellbot-price-section-panel,
.ai-manager-card,
.api-client-card,
.publication-channel-card {
  background: var(--office-surface) !important;
  border-color: var(--office-line) !important;
  color: var(--office-ink) !important;
  box-shadow: none !important;
}

.linkbot-panel-head,
.sellbot-panel-head,
.ai-manager-panel-head,
.publication-settings-section,
.sellbot-price-section-head {
  border-color: var(--office-line-soft) !important;
  background: var(--office-surface-soft) !important;
}

.sellbot-price-row,
.sellbot-rule-row,
.sellbot-access-row,
.linkbot-client-row,
.publication-row,
.pub-leaf-row,
.ai-manager-inbox-row {
  border-color: var(--office-line-soft) !important;
  background: var(--office-surface) !important;
  color: var(--office-ink) !important;
}

.sellbot-price-row:hover,
.sellbot-rule-row:hover,
.linkbot-client-row:hover,
.publication-row:hover,
.pub-leaf-row:hover,
.ai-manager-inbox-row:hover {
  background: var(--office-surface-soft) !important;
}

.messengers-window,
.message-text-cell,
.message-text-wrap,
.message-text-box,
.product-binding-dock,
.product-binding-section {
  border-color: var(--office-line) !important;
  background: var(--office-surface) !important;
  color: var(--office-ink) !important;
}

/* Contrast bridge for modules that were authored for the former dark workspace */
.content-area button:disabled,
.content-area input:disabled,
.content-area textarea:disabled,
.content-area select:disabled {
  opacity: 1 !important;
  border-color: var(--office-line) !important;
  background: #f2f6f9 !important;
  color: #52677b !important;
  box-shadow: none !important;
  cursor: not-allowed !important;
}

.content-area input[readonly],
.content-area textarea[readonly] {
  border-color: var(--office-line) !important;
  background: var(--office-surface-soft) !important;
  color: var(--office-ink) !important;
}

#userbots-section,
#interaction_bots-section,
#excel-section,
#api-section,
#sell_bot-section,
#ai_manager-section,
#supplier_permissions-section,
#admin-section,
#profile-section {
  color: var(--office-ink) !important;
}

#userbots-section > h2,
#userbots-section > h3,
#userbots-section .card h3,
#interaction_bots-section > h2,
#interaction_bots-section .card h3 {
  color: var(--office-ink) !important;
}

#userbots-section hr {
  border-color: var(--office-line-soft) !important;
}

#userbots-section .card,
#userbots-section .simple-table,
#userbots-section .simple-table td,
#userbots-section .simple-table th,
#userbots-section #userbot-list table,
#userbots-section #userbot-list td,
#userbots-section #userbot-list th,
#interaction_bots-section .card,
#interaction_bots-section .simple-table,
#interaction_bots-section .simple-table td,
#interaction_bots-section .simple-table th {
  border-color: var(--office-line) !important;
  background: var(--office-surface) !important;
  color: var(--office-ink) !important;
  box-shadow: none !important;
}

#userbots-section #userbot-list th,
#userbots-section .simple-table th,
#interaction_bots-section .simple-table th {
  border-bottom-color: var(--office-line) !important;
  background: var(--office-surface-soft) !important;
  color: var(--office-muted) !important;
}

#userbots-section #userbot-list td,
#userbots-section .simple-table td,
#interaction_bots-section .simple-table td {
  border-bottom-color: var(--office-line-soft) !important;
  color: var(--office-ink) !important;
}

#userbots-section input,
#userbots-section select,
#interaction_bots-section input,
#interaction_bots-section select {
  border-color: var(--office-line) !important;
  background-color: var(--office-surface) !important;
  background-image: none !important;
  color: var(--office-ink) !important;
  box-shadow: none !important;
  color-scheme: light !important;
}

#interaction_bots-section select {
  padding-right: 34px !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 18 18'%3E%3Cpath d='M4.5 6.75L9 11.25L13.5 6.75' stroke='%23596f87' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round' fill='none'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: calc(100% - 10px) center !important;
  background-size: 15px !important;
}

#userbots-section input::placeholder,
#interaction_bots-section input::placeholder {
  color: var(--office-muted-2) !important;
}

#interaction_bots-section .form-group label,
#interaction_bots-section .field-hint,
#userbots-section p {
  color: var(--office-muted) !important;
}

#userbots-section #userbot-list > div,
#userbots-section .tracked-chat-item {
  border: 1px solid var(--office-line) !important;
  border-radius: var(--office-radius) !important;
  background: var(--office-surface) !important;
  box-shadow: none !important;
}

#userbots-section .tracked-chat-info,
#userbots-section .tracked-chat-info strong,
#userbots-section .tracked-chat-info a,
#userbots-section #userbot-list .bot-status {
  color: var(--office-ink) !important;
}

#userbots-section .tracked-chat-info span,
#userbots-section #userbot-list span[style],
#userbots-section #userbot-list small {
  color: var(--office-muted) !important;
}

#userbots-section #userbot-list strong[style] {
  color: var(--office-control) !important;
}

#excel-section > h2 {
  margin: 0 0 18px !important;
  color: var(--office-ink) !important;
  font-size: clamp(24px, 2.2vw, 32px) !important;
  line-height: 1.08 !important;
}

#excel-section .excel-source-grid {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 12px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

#excel-section .excel-setup-card,
#excel-section .excel-settings-card,
#excel-section #gs-preview-card,
#excel-section #pdf-preview-card,
#excel-section #excel-preview-card {
  border: 1px solid var(--office-line) !important;
  border-radius: var(--office-radius) !important;
  background: var(--office-surface) !important;
  color: var(--office-ink) !important;
  box-shadow: none !important;
}

#excel-section .excel-setup-card {
  min-height: 292px !important;
  padding: 18px !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 14px !important;
}

#excel-section .excel-setup-card h3,
#excel-section .excel-settings-card h3 {
  margin: 0 !important;
  color: var(--office-ink) !important;
  font-size: 16px !important;
  font-weight: 760 !important;
  line-height: 1.3 !important;
}

#excel-section .excel-setup-fields {
  display: grid !important;
  gap: 12px !important;
  align-content: start;
  flex: 1 1 auto;
}

#excel-section .excel-field {
  display: grid !important;
  gap: 6px !important;
}

#excel-section .excel-field label {
  margin: 0 !important;
  color: var(--office-muted) !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  line-height: 1.35 !important;
}

#excel-section .workspace-input,
#excel-section .workspace-select,
#excel-section .workspace-number,
#excel-section .workspace-file-input {
  width: 100% !important;
  min-width: 0 !important;
  min-height: 42px !important;
  margin: 0 !important;
  padding: 0 12px !important;
  border: 1px solid var(--office-line) !important;
  border-radius: var(--office-radius) !important;
  background: var(--office-surface) !important;
  color: var(--office-ink) !important;
  box-shadow: none !important;
  color-scheme: light !important;
}

#excel-section .workspace-file-input {
  padding: 6px 8px !important;
}

#excel-section .workspace-input::placeholder,
#excel-section .workspace-number::placeholder {
  color: var(--office-muted-2) !important;
}

#excel-section .workspace-file-input::file-selector-button {
  min-height: 30px !important;
  margin-right: 10px !important;
  padding: 0 10px !important;
  border: 1px solid var(--office-control-line) !important;
  border-radius: 7px !important;
  background: var(--office-control-soft) !important;
  color: var(--office-control) !important;
  font-size: 12px !important;
  font-weight: 750 !important;
}

#excel-section .excel-card-action {
  width: auto !important;
  min-width: 0 !important;
  min-height: 40px !important;
  margin: 0 !important;
  padding: 0 14px !important;
  align-self: flex-start !important;
  border: 1px solid #20242c !important;
  border-radius: var(--office-radius) !important;
  background: linear-gradient(180deg, #2a2d34, #17191e) !important;
  color: #fff !important;
  box-shadow: 0 8px 18px rgba(18, 24, 35, 0.12) !important;
  font-size: 12px !important;
  font-weight: 750 !important;
}

#excel-section .excel-card-action:hover {
  border-color: #101114 !important;
  background: linear-gradient(180deg, #353942, #202329) !important;
  color: #fff !important;
}

#excel-section .excel-settings-card {
  margin-top: 16px !important;
  padding: 0 !important;
  overflow: hidden !important;
}

#excel-section .excel-settings-card h3 {
  padding: 16px 18px !important;
  border-bottom: 1px solid var(--office-line-soft) !important;
  background: var(--office-surface) !important;
}

#excel-section .excel-configs-wrap {
  min-height: 168px !important;
  overflow-x: auto !important;
  border: 0 !important;
  background: var(--office-surface) !important;
}

#excel-section .excel-configs-table,
#excel-section .excel-configs-table tbody,
#excel-section .excel-configs-table tr,
#excel-section .excel-configs-table td {
  background: var(--office-surface) !important;
  color: var(--office-ink) !important;
}

#excel-section .excel-configs-table thead tr,
#excel-section .excel-configs-table th {
  background: var(--office-surface-soft) !important;
  color: var(--office-muted) !important;
  box-shadow: none !important;
}

#excel-section .excel-configs-table th {
  padding: 12px 14px !important;
  border-bottom: 1px solid var(--office-line) !important;
  font-size: 11px !important;
  font-weight: 800 !important;
  text-transform: uppercase;
}

#excel-section .excel-configs-table td {
  padding: 14px !important;
  border-bottom: 1px solid var(--office-line-soft) !important;
}

#excel-section .excel-config-chat,
#excel-section .excel-config-folder,
#excel-section .excel-config-columns,
#excel-section .excel-config-link,
#excel-section .excel-config-columns b,
#excel-section .excel-config-db-line code {
  color: var(--office-ink) !important;
}

#excel-section .excel-config-interval,
#excel-section .excel-config-db-line,
#excel-section .excel-config-sheet-note.is-single,
#excel-section .excel-config-link span {
  color: var(--office-muted) !important;
}

#excel-section .excel-config-sheet-note.is-multi {
  color: #9a5a00 !important;
}

#excel-section .excel-config-link a {
  color: var(--office-control) !important;
  border-bottom-color: var(--office-control-line) !important;
}

#api-section > .card:last-child {
  border: 1px solid var(--office-line) !important;
  border-left: 1px solid var(--office-line) !important;
  background: var(--office-surface) !important;
}

#api-section > .card:last-child p {
  color: var(--office-muted) !important;
}

#api-section > .card:last-child code {
  border: 1px solid var(--office-line) !important;
  background: var(--office-surface-soft) !important;
  color: var(--office-control) !important;
}

#admin-section .admin-grid .card,
#admin-section > .card,
#admin-section .admin-user-item {
  border-color: var(--office-line) !important;
  background: var(--office-surface) !important;
  color: var(--office-ink) !important;
  box-shadow: none !important;
}

#admin-section > .card:last-child {
  border-left: 4px solid #e46f65 !important;
}

#admin-section .admin-user-login {
  color: var(--office-ink) !important;
}

#admin-section .admin-user-role,
#admin-section p,
#admin-section label,
#profile-section p,
#profile-section label {
  color: var(--office-muted) !important;
}

/* Catalog search uses the Office control surface instead of the retired dark shell. */
.products-search-field {
  border-color: #314253 !important;
  background: var(--office-surface) !important;
  background-image: none !important;
  box-shadow: 0 8px 22px rgba(33, 65, 91, 0.1) !important;
}

.products-search-field::before,
.products-search-field::after {
  display: none !important;
}

.products-search-shell.is-active .products-search-field {
  border-color: var(--office-control-line) !important;
  background: var(--office-surface) !important;
  box-shadow: 0 0 0 3px rgba(143, 189, 218, 0.18) !important;
  transform: none !important;
}

/* Userbots forms were still using fixed flex widths from the dark layout. */
#userbots-section .userbots-chat-form {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  align-items: stretch;
  gap: 8px !important;
  width: 100%;
  min-width: 0;
}

#userbots-section .userbots-chat-form > * {
  width: 100% !important;
  min-width: 0 !important;
}

#userbots-section .section-title-with-icon > span:last-child,
#userbots-section .card h3,
#userbots-section .card h4 {
  color: var(--office-ink) !important;
}

#userbots-section .card p {
  color: var(--office-muted) !important;
}

#sell_bot-section .sellbot-titlebar h2,
#sell_bot-section .sellbot-panel-head h3,
#sell_bot-section .sellbot-markup-title strong,
#sell_bot-section .sellbot-price-refresh-head,
#sell_bot-section .sellbot-price-file,
#sell_bot-section .sellbot-field-label,
#sell_bot-section .sellbot-toggle,
#sell_bot-section .sellbot-markup-round {
  color: var(--office-ink) !important;
}

#sell_bot-section .sellbot-status,
#supplier_permissions-section .sellbot-status,
#ai_manager-section .sellbot-status {
  border-color: var(--office-line) !important;
  background: var(--office-surface-soft) !important;
  color: var(--office-muted) !important;
}

#sell_bot-section .sellbot-btn:not(.primary):not(.danger),
#supplier_permissions-section .sellbot-btn:not(.primary):not(.danger),
#ai_manager-section .sellbot-btn:not(.primary):not(.danger) {
  border-color: var(--office-line) !important;
  background: var(--office-surface) !important;
  color: var(--office-control) !important;
}

#sell_bot-section .sellbot-module-btn {
  border-color: var(--office-line) !important;
  background: var(--office-surface) !important;
  color: var(--office-ink) !important;
  box-shadow: none !important;
}

#sell_bot-section .sellbot-module-btn:hover,
#sell_bot-section .sellbot-module-btn.is-active {
  border-color: var(--office-control-line) !important;
  background: var(--office-control-soft) !important;
  color: var(--office-control) !important;
  box-shadow: none !important;
}

#sell_bot-section .sellbot-module-count,
#sell_bot-section .sellbot-price-section-chev {
  border-color: var(--office-control-line) !important;
  background: var(--office-control-soft) !important;
  color: var(--office-control) !important;
}

#sell_bot-section .sellbot-panel,
#sell_bot-section .sellbot-markup-card,
#sell_bot-section .sellbot-engine-source-card,
#sell_bot-section .sellbot-price-section-panel,
#sell_bot-section .sellbot-price-refresh-box {
  border-color: var(--office-line) !important;
  background: var(--office-surface) !important;
  color: var(--office-ink) !important;
  box-shadow: none !important;
}

#sell_bot-section .sellbot-panel-head,
#sell_bot-section .sellbot-price-section-head {
  border-color: var(--office-line-soft) !important;
  background: var(--office-surface-soft) !important;
}

#sell_bot-section .sellbot-table th,
#sell_bot-section .sellbot-table td {
  border-bottom-color: var(--office-line-soft) !important;
}

#sell_bot-section .sellbot-table th,
#sell_bot-section .sellbot-markup-title span,
#sell_bot-section .sellbot-markup-stats,
#sell_bot-section .sellbot-muted,
#sell_bot-section .sellbot-search-name span,
#sell_bot-section .sellbot-field-label > span {
  color: var(--office-muted) !important;
}

#sell_bot-section .sellbot-table td,
#sell_bot-section .sellbot-search-price,
#sell_bot-section .sellbot-price-row-text,
#sell_bot-section .sellbot-price-row-price {
  color: var(--office-ink) !important;
}

#sell_bot-section .sellbot-markup-mode {
  border-color: var(--office-line) !important;
  background: var(--office-surface-soft) !important;
}

#sell_bot-section .sellbot-markup-mode button {
  color: var(--office-muted) !important;
}

#sell_bot-section .sellbot-markup-mode button.is-active {
  background: #c9e3f4 !important;
  color: #1d4e6c !important;
}

#sell_bot-section .sellbot-price-row {
  border-color: var(--office-line-soft) !important;
  background: var(--office-surface) !important;
  color: var(--office-ink) !important;
}

#sell_bot-section .sellbot-price-row.is-accepted {
  border-color: #a9d8b2 !important;
  background: var(--office-green-soft) !important;
  color: var(--office-green) !important;
}

#sell_bot-section .sellbot-price-row.is-unclear {
  border-color: #e5c983 !important;
  background: #fff9e8 !important;
  color: #76500e !important;
}

/* Loaded Sell-bot states must not inherit the retired dark workspace. */
#sell_bot-section .sellbot-price-search,
#sell_bot-section .sellbot-price-compose,
#sell_bot-section .sellbot-search-result,
#sell_bot-section .sellbot-price-section,
#sell_bot-section .sellbot-account-picker,
#sell_bot-section .sellbot-chat-row,
#sell_bot-section .sellbot-spam-group {
  border-color: var(--office-line) !important;
  background: var(--office-surface) !important;
  background-image: none !important;
  color: var(--office-ink) !important;
  box-shadow: none !important;
}

#sell_bot-section .sellbot-price-search,
#sell_bot-section .sellbot-price-compose {
  background: var(--office-surface-soft) !important;
}

#sell_bot-section .sellbot-price-section.is-open {
  border-color: var(--office-control-line) !important;
  background: var(--office-surface) !important;
}

#sell_bot-section .sellbot-price-section.is-owner-missing,
#sell_bot-section .sellbot-price-section.is-owner-missing.is-open {
  border-color: #e5c983 !important;
  background: #fff9e8 !important;
  box-shadow: none !important;
}

#sell_bot-section .sellbot-price-search-title strong,
#sell_bot-section .sellbot-search-query,
#sell_bot-section .sellbot-engine-source-title strong,
#sell_bot-section .sellbot-price-section-title strong,
#sell_bot-section .sellbot-access-title,
#sell_bot-section .sellbot-chat-title strong,
#sell_bot-section .sellbot-spam-summary strong,
#sell_bot-section .sellbot-spam-user-row {
  color: var(--office-ink) !important;
}

#sell_bot-section .sellbot-price-search-title span,
#sell_bot-section .sellbot-search-summary,
#sell_bot-section .sellbot-search-name span,
#sell_bot-section .sellbot-search-empty,
#sell_bot-section .sellbot-engine-source-card.is-empty,
#sell_bot-section .sellbot-engine-source-title span,
#sell_bot-section .sellbot-price-source-note,
#sell_bot-section .sellbot-chat-meta,
#sell_bot-section .sellbot-spam-summary .sellbot-muted {
  color: var(--office-muted) !important;
}

#sell_bot-section .sellbot-search-result-head,
#sell_bot-section .sellbot-search-match,
#sell_bot-section .sellbot-spam-user-row {
  border-color: var(--office-line-soft) !important;
}

#sell_bot-section .sellbot-search-match {
  color: var(--office-ink) !important;
}

#sell_bot-section .sellbot-search-badge,
#sell_bot-section .sellbot-price-section-pill,
#sell_bot-section .sellbot-spam-count {
  border: 1px solid var(--office-control-line) !important;
  background: var(--office-control-soft) !important;
  color: var(--office-control) !important;
}

#sell_bot-section .sellbot-price-section-pill.is-muted,
#sell_bot-section .sellbot-spam-chevron {
  border-color: var(--office-line) !important;
  background: var(--office-surface-soft) !important;
  color: var(--office-muted) !important;
}

#sell_bot-section .sellbot-price-owner-status,
#sell_bot-section .sellbot-chat-state {
  border-color: var(--office-control-line) !important;
  background: var(--office-control-soft) !important;
  color: var(--office-control) !important;
}

#sell_bot-section .sellbot-price-owner-status.is-connected,
#sell_bot-section .sellbot-chat-state.is-on,
#sell_bot-section .sellbot-account-option.is-selected,
#sell_bot-section .sellbot-engine-source-state.is-loaded {
  border-color: #a9d8b2 !important;
  background: var(--office-green-soft) !important;
  color: var(--office-green) !important;
}

#sell_bot-section .sellbot-price-owner-status.is-missing,
#sell_bot-section .sellbot-account-option.is-missing,
#sell_bot-section .sellbot-chat-state.is-off,
#sell_bot-section .sellbot-engine-source-state:not(.is-loaded) {
  border-color: #e5c983 !important;
  background: #fff9e8 !important;
  color: #76500e !important;
}

#sell_bot-section .sellbot-account-option {
  border-color: var(--office-line) !important;
  background: var(--office-surface) !important;
  color: var(--office-control) !important;
}

#sell_bot-section .sellbot-account-option:hover,
#sell_bot-section .sellbot-price-section-toggle:hover,
#sell_bot-section .sellbot-spam-toggle:hover {
  background: var(--office-control-soft) !important;
}

#sell_bot-section .sellbot-price-file input,
#sell_bot-section .sellbot-price-refresh-file input {
  border-color: var(--office-line) !important;
  background: var(--office-surface) !important;
  color: var(--office-ink) !important;
}

#sell_bot-section .sellbot-spam-toggle {
  color: var(--office-ink) !important;
}

/* Loaded Link-bot states use the same readable Office surfaces. */
#link_bot-section .linkbot-summary-card span,
#link_bot-section .channel-health-check,
#link_bot-section .channel-health-foot,
#link_bot-section .channel-health-label span,
#link_bot-section .linkbot-company-meta,
#link_bot-section .linkbot-date,
#link_bot-section .linkbot-card-markup-summary span,
#link_bot-section .linkbot-card-markup-summary em,
#link_bot-section .linkbot-client-page-size,
#link_bot-section .linkbot-client-page-status,
#link_bot-section .linkbot-admin-identity span,
#link_bot-section .linkbot-admin-note,
#link_bot-section .sellbot-field-label > span,
#link_bot-section .lst-hint,
#link_bot-section .lp-chip,
#link_bot-section .linkbot-profile-supplier-summary,
#link_bot-section #linkbot-manual-state-label {
  color: var(--office-muted) !important;
  opacity: 1 !important;
}

#link_bot-section .linkbot-profile-card,
#link_bot-section .linkbot-admin-row {
  border-color: var(--office-line) !important;
  background: var(--office-surface) !important;
  color: var(--office-ink) !important;
  box-shadow: none !important;
}

#link_bot-section .linkbot-profile-card .lp-name,
#link_bot-section .linkbot-admin-identity strong,
#link_bot-section .linkbot-check {
  color: var(--office-ink) !important;
}

#link_bot-section .linkbot-profile-card .lp-chip,
#link_bot-section .linkbot-state {
  border-color: var(--office-control-line) !important;
  background: var(--office-control-soft) !important;
  color: var(--office-control) !important;
}

#link_bot-section .linkbot-state.is-active {
  border-color: #a9d8b2 !important;
  background: var(--office-green-soft) !important;
  color: var(--office-green) !important;
}

#link_bot-section .linkbot-state.is-pending {
  border-color: #e5c983 !important;
  background: #fff9e8 !important;
  color: #76500e !important;
}

#link_bot-section .linkbot-empty {
  border-color: var(--office-line) !important;
  background: var(--office-surface-soft) !important;
  color: var(--office-muted) !important;
}

#link_bot-section .linkbot-smart-search,
#link_bot-section .linkbot-list-toolbar-note,
#link_bot-section .linkbot-smart-search-control button {
  color: var(--office-muted) !important;
}

#link_bot-section .linkbot-smart-search-control input::placeholder {
  color: var(--office-muted-2) !important;
  opacity: 1 !important;
}

#sell_bot-section .sellbot-status,
#link_bot-section .sellbot-status,
#supplier_permissions-section .sellbot-status,
#ai_manager-section .sellbot-status {
  color: var(--office-muted) !important;
}

#sell_bot-section .danger,
#link_bot-section .danger,
#supplier_permissions-section .danger,
#ai_manager-section .danger {
  color: var(--office-red) !important;
}

@media (max-width: 1240px) {
  #sell_bot-section .sellbot-price-layout {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  #sell_bot-section .sellbot-price-compose,
  #sell_bot-section .sellbot-price-section-stack {
    width: 100% !important;
    min-width: 0 !important;
  }
}

@media (max-width: 1320px) and (min-width: 721px) {
  #link_bot-section .linkbot-modulebar {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  }

  #link_bot-section .linkbot-modulebar .sellbot-module-btn {
    width: 100% !important;
    min-width: 0 !important;
    min-height: 56px !important;
    height: auto !important;
  }

  #link_bot-section .linkbot-modulebar .sellbot-module-btn strong {
    white-space: normal !important;
    overflow-wrap: normal !important;
    word-break: normal !important;
  }

  #link_bot-section .linkbot-account-row {
    grid-template-columns: minmax(170px, 1fr) minmax(150px, 0.9fr) auto auto !important;
  }

  #link_bot-section .linkbot-account-actions {
    grid-column: 1 / -1 !important;
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: flex-end !important;
    width: 100% !important;
    min-width: 0 !important;
  }

  #link_bot-section .linkbot-account-actions .sellbot-btn {
    flex: 0 0 auto !important;
    width: auto !important;
    min-width: max-content !important;
  }

  #link_bot-section .linkbot-date {
    min-width: 0 !important;
  }
}

@media (max-width: 980px) {
  #link_bot-section .linkbot-modulebar {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }

  #link_bot-section .linkbot-modulebar .sellbot-module-btn {
    width: 100% !important;
    min-width: 0 !important;
    min-height: 50px !important;
    height: auto !important;
  }

  #link_bot-section .linkbot-modulebar .sellbot-module-btn strong {
    white-space: normal !important;
    overflow-wrap: normal !important;
    word-break: normal !important;
  }
}

@media (max-width: 700px) {
  #link_bot-section .linkbot-modulebar {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  #link_bot-section .linkbot-modulebar [data-linkbot-module-trigger="admins"] {
    grid-column: 1 / -1 !important;
  }

  #userbots-section .userbots-chat-form {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  #userbots-section .userbots-chat-form #add-chat-btn {
    width: 100% !important;
  }

  #admin-section .admin-grid {
    flex-direction: column !important;
    gap: 12px !important;
  }

  #admin-section .admin-grid > .card {
    width: 100% !important;
    min-width: 0 !important;
    flex: none !important;
  }

  #admin-section .admin-user-item {
    align-items: stretch !important;
    flex-direction: column !important;
  }

  #admin-section .admin-user-actions {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    width: 100% !important;
    min-width: 0 !important;
  }

  #admin-section .admin-user-actions .mini-action-btn {
    width: 100% !important;
    min-width: 0 !important;
  }
}

@media (max-width: 390px) {
  #link_bot-section .linkbot-account-actions {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  #link_bot-section .linkbot-account-actions .sellbot-btn {
    width: 100% !important;
    min-width: 0 !important;
  }

  #link_bot-section .linkbot-account-actions .linkbot-company-bind-btn {
    grid-column: auto !important;
  }
}

@media (max-width: 340px) {
  #link_bot-section .linkbot-account-actions .linkbot-company-bind-btn {
    height: auto !important;
    min-height: 42px !important;
    white-space: normal !important;
    line-height: 1.2 !important;
  }

  #link_bot-section .linkbot-client-pagination {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  #link_bot-section .linkbot-client-page-status,
  #link_bot-section .linkbot-client-page-size,
  #link_bot-section .linkbot-client-page-buttons {
    grid-column: 1 !important;
    width: 100% !important;
    min-width: 0 !important;
  }

  #link_bot-section .linkbot-client-page-status {
    grid-row: 1 !important;
  }

  #link_bot-section .linkbot-client-page-size {
    grid-row: 2 !important;
    justify-content: space-between !important;
  }

  #link_bot-section .linkbot-client-page-buttons {
    grid-row: 3 !important;
    justify-content: space-between !important;
  }

  #link_bot-section .linkbot-client-page-button {
    flex: 1 1 0 !important;
  }
}

#sell_bot-section .sellbot-price-compose {
  grid-template-columns: minmax(0, 1fr) !important;
}

#sell_bot-section .sellbot-price-compose > *,
#sell_bot-section .sellbot-price-compose input,
#sell_bot-section .sellbot-price-compose textarea,
#sell_bot-section .sellbot-price-compose select {
  min-width: 0 !important;
  max-width: 100% !important;
}

@media (max-width: 900px) {
  #ai_manager-section .ai-manager-grid,
  #ai_manager-section .ai-manager-two,
  #ai_manager-section .ai-manager-metrics {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  #ai_manager-section .ai-manager-card,
  #ai_manager-section .ai-manager-field,
  #ai_manager-section .ai-manager-input,
  #ai_manager-section .ai-manager-textarea {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }
}

#ai_manager-section .ai-manager-card,
#ai_manager-section .ai-manager-item,
#ai_manager-section .ai-manager-queue-card,
#ai_manager-section .ai-manager-thread,
#ai_manager-section .ai-manager-bubble,
#ai_manager-section .ai-manager-metric {
  border-color: var(--office-line) !important;
  background: var(--office-surface) !important;
  color: var(--office-ink) !important;
  box-shadow: none !important;
}

#ai_manager-section .ai-manager-item,
#ai_manager-section .ai-manager-queue-card,
#ai_manager-section .ai-manager-metric {
  background: var(--office-surface-soft) !important;
}

#ai_manager-section .ai-manager-bubble.is-manager,
#ai_manager-section .ai-manager-effective {
  border-color: var(--office-control-line) !important;
  background: var(--office-control-soft) !important;
  color: var(--office-ink) !important;
}

#ai_manager-section .ai-manager-field,
#ai_manager-section .ai-manager-bubble-meta,
#ai_manager-section .ai-manager-metric span,
#ai_manager-section .sellbot-muted {
  color: var(--office-muted) !important;
}

#ai_manager-section .ai-manager-card h3,
#ai_manager-section .ai-manager-section-head h3,
#ai_manager-section .ai-manager-draft,
#ai_manager-section .ai-manager-metric strong {
  color: var(--office-ink) !important;
}

#ai_manager-section .ai-manager-input,
#ai_manager-section .ai-manager-textarea {
  border-color: var(--office-line) !important;
  background: var(--office-surface) !important;
  color: var(--office-ink) !important;
}

#ai_manager-section .ai-manager-pill {
  border-color: var(--office-control-line) !important;
  background: var(--office-control-soft) !important;
  color: var(--office-control) !important;
}

#ai_manager-section .ai-manager-pill.low,
#ai_manager-section .ai-manager-pill.client {
  border-color: #a9d8b2 !important;
  background: var(--office-green-soft) !important;
  color: var(--office-green) !important;
}

#ai_manager-section .ai-manager-pill.medium,
#ai_manager-section .ai-manager-pill.supplier {
  border-color: #e5c983 !important;
  background: #fff9e8 !important;
  color: #76500e !important;
}

#ai_manager-section .ai-manager-pill.high,
#ai_manager-section .ai-manager-pill.internal,
#ai_manager-section .ai-manager-pill.other {
  border-color: #f1b8b3 !important;
  background: var(--office-red-soft) !important;
  color: var(--office-red) !important;
}

#supplier_permissions-section .supplier-permission-row {
  border-color: var(--office-line) !important;
  background: var(--office-surface) !important;
  color: var(--office-ink) !important;
  box-shadow: none !important;
}

#supplier_permissions-section .supplier-permission-title {
  color: var(--office-ink) !important;
}

#supplier_permissions-section .supplier-permission-meta,
#supplier_permissions-section .supplier-permission-field span {
  color: var(--office-muted) !important;
}

#supplier_permissions-section .supplier-permission-input {
  border-color: var(--office-line) !important;
  background: var(--office-surface) !important;
  color: var(--office-ink) !important;
}

#supplier_permissions-section .supplier-permission-switch {
  border-color: var(--office-line) !important;
  background: var(--office-surface-soft) !important;
  color: var(--office-ink) !important;
}

#supplier_permissions-section .supplier-permission-switch:not(.is-off) {
  border-color: #a9d8b2 !important;
  background: var(--office-green-soft) !important;
  color: var(--office-green) !important;
}

#supplier_permissions-section .supplier-permission-switch.is-off {
  border-color: #f1b8b3 !important;
  background: var(--office-red-soft) !important;
  color: var(--office-red) !important;
}

#link_bot-section .linkbot-subtitle,
#link_bot-section .linkbot-company-meta,
#link_bot-section .linkbot-date,
#link_bot-section .channel-health-check,
#link_bot-section #linkbot-health-footnote,
#link_bot-section #linkbot-health-max-detail,
#link_bot-section #linkbot-health-telegram-detail,
#link_bot-section p,
#link_bot-section em {
  color: var(--office-muted) !important;
}

#link_bot-section .linkbot-state.is-pending,
#link_bot-section .linkbot-list-head-badge {
  border-color: #e5c983 !important;
  background: #fff9e8 !important;
  color: #76500e !important;
}

.api-token-chip,
#api-section code {
  border: 1px solid var(--office-control-line) !important;
  background: var(--office-control-soft) !important;
  color: #24516d !important;
}

.api-mode-chip,
.binding-status-badge.actual,
.source-badge.google {
  border-color: #a9d8b2 !important;
  background: var(--office-green-soft) !important;
  color: var(--office-green) !important;
}

.fc-report-price,
.fc-report-delta.down {
  color: var(--office-green) !important;
}

.fc-report-date,
.fc-report-old-price,
.fc-report-summary-col--id,
.fc-report-suppliers-meta,
.folder-count,
.products-search-hint-text {
  color: var(--office-muted) !important;
}

/* Modals */
.product-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1390;
  display: none;
  background: rgba(17, 22, 31, 0.58);
  backdrop-filter: blur(5px);
  overscroll-behavior: contain;
  touch-action: none;
}

.product-modal-backdrop.is-open {
  display: block;
}

body.engine-product-modal-open {
  overflow: hidden !important;
}

.modal,
.modal-overlay,
.product-editor-modal,
.engine-admin-modal,
.message-line-binding-modal {
  backdrop-filter: blur(5px);
}

.modal-content,
.modal-card,
.product-editor-body,
.product-editor-modal > div,
.engine-admin-modal > div,
.message-line-binding-modal > div,
[role="dialog"] {
  border: 1px solid var(--office-line) !important;
  border-radius: 10px !important;
  background: var(--office-surface) !important;
  color: var(--office-ink) !important;
  box-shadow: 0 28px 80px rgba(18, 24, 35, 0.2) !important;
}

.modal-header,
.modal-footer,
.product-editor-header,
.product-editor-footer {
  border-color: var(--office-line-soft) !important;
  background: var(--office-surface) !important;
}

.product-editor-section,
.product-photo-gallery-shell,
.product-editor-synonym-helper,
.product-modal-folder-picker,
.product-rich-preview {
  border-color: var(--office-line) !important;
  border-radius: var(--office-radius) !important;
  background: var(--office-surface-soft) !important;
  color: var(--office-ink) !important;
}

.product-photo-card,
.product-photo-upload-tile {
  border-color: var(--office-line) !important;
  border-radius: var(--office-radius) !important;
  background: var(--office-surface) !important;
}

/* Active light surfaces for legacy reports and dialogs */
.fc-report-expanded {
  border: 1px solid var(--office-line) !important;
  border-radius: var(--office-radius) !important;
  background: var(--office-surface) !important;
  box-shadow: var(--office-shadow-tight) !important;
}

.fc-report-expanded-table,
.fc-report-expanded-table tbody,
.fc-report-expanded-table tr,
.fc-report-expanded-table td {
  background: var(--office-surface) !important;
  color: var(--office-ink) !important;
}

.fc-report-expanded-table th {
  border-bottom: 1px solid var(--office-line) !important;
  background: var(--office-surface-soft) !important;
  color: var(--office-muted) !important;
}

.fc-report-expanded-table td {
  border-bottom-color: var(--office-line-soft) !important;
}

.fc-report-expanded-table tbody tr:hover,
.fc-report-expanded-table tbody tr:hover td {
  background: var(--office-surface-soft) !important;
}

.fc-report-expanded-table .binding-position-text,
.fc-report-expanded-table .binding-position-cell {
  color: var(--office-ink) !important;
}

.fc-report-expanded-source a,
.fc-report-source-link {
  color: var(--office-control) !important;
}

.fc-report-expanded-table .binding-price-value {
  border-color: #a9d8b2 !important;
  background: var(--office-green-soft) !important;
  color: var(--office-green) !important;
}

.fc-report-expanded-table .fc-report-date {
  color: var(--office-muted) !important;
}

.ui-modal,
.api-client-settings-modal,
.sellbot-source-dialog,
.linkbot-bind-modal,
.line-binding-modal,
#product-modal.product-editor-modal {
  border: 1px solid var(--office-line) !important;
  border-radius: 10px !important;
  background: var(--office-surface) !important;
  color: var(--office-ink) !important;
  box-shadow: 0 28px 80px rgba(18, 24, 35, 0.2) !important;
}

#product-modal.product-editor-modal {
  overflow: hidden !important;
}

.product-editor-header {
  flex: 0 0 auto;
  border-bottom: 1px solid var(--office-line-soft) !important;
}

.product-editor-body {
  max-height: calc(90vh - 64px);
  overflow-y: auto;
  background: var(--office-surface) !important;
  color: var(--office-ink) !important;
  box-shadow: none !important;
}

.product-editor-footer {
  position: sticky;
  bottom: -16px;
  z-index: 3;
  margin: 20px -16px -16px !important;
  padding: 14px 16px !important;
  border-top: 1px solid var(--office-line) !important;
  background: rgba(255, 255, 255, 0.98) !important;
}

.product-editor-close,
.product-editor-synonym-remove {
  border-color: var(--office-line) !important;
  background: var(--office-surface) !important;
  color: var(--office-muted) !important;
}

.product-editor-close:hover,
.product-editor-synonym-remove:hover {
  border-color: var(--office-control-line) !important;
  background: var(--office-control-soft) !important;
  color: var(--office-control) !important;
}

.product-editor-label,
.product-editor-media-description,
.product-editor-specs-caption,
.product-editor-synonyms-caption,
.product-photo-summary-label,
.product-modal-folder-status-label,
.product-editor-synonym-suggestion-meta,
.product-editor-synonym-suggestion-empty {
  color: var(--office-muted) !important;
}

.product-editor-section-title,
.product-editor-media-heading,
.product-photo-summary-value,
.product-modal-folder-status-value,
.product-editor-synonym-helper-title,
.product-editor-synonym-suggestion-line,
.product-photo-upload-title {
  color: var(--office-ink) !important;
}

.product-editor-input,
.product-editor-textarea,
.product-editor-select,
.product-modal-folder-hidden-select {
  border-color: var(--office-line) !important;
  background: var(--office-surface) !important;
  color: var(--office-ink) !important;
  box-shadow: none !important;
  color-scheme: light !important;
}

.product-editor-input::placeholder,
.product-editor-textarea::placeholder,
.line-binding-search-input::placeholder,
.sellbot-source-dialog input::placeholder,
.linkbot-bind-modal input::placeholder {
  color: var(--office-muted-2) !important;
}

.product-editor-input:focus,
.product-editor-textarea:focus,
.product-editor-select:focus {
  border-color: var(--office-control) !important;
  outline: 3px solid rgba(47, 97, 127, 0.12) !important;
}

.product-photo-upload-visual,
.product-photo-summary-icon {
  border-color: var(--office-control-line) !important;
  background: var(--office-control-soft) !important;
  color: var(--office-control) !important;
}

.ui-modal-header,
.api-client-modal-header,
.sellbot-source-modal-head,
.line-binding-modal-head {
  border-bottom-color: var(--office-line-soft) !important;
  background: var(--office-surface) !important;
}

.ui-modal-actions,
.api-client-modal-footer,
.line-binding-modal-foot {
  border-top-color: var(--office-line-soft) !important;
  background: var(--office-surface) !important;
}

.ui-modal-title,
.ui-modal-message,
.api-client-modal-title,
.api-client-section-title,
.sellbot-source-modal-title strong,
.linkbot-bind-head h3,
.line-binding-modal-title {
  color: var(--office-ink) !important;
}

.ui-modal-subtitle,
.api-client-modal-kicker,
.api-client-modal-subtitle,
.api-client-section-note,
.sellbot-source-modal-title span,
.sellbot-source-count,
.linkbot-bind-head p,
.line-binding-modal-subtitle,
.line-binding-label,
.line-binding-results-head,
.line-binding-results-count,
.line-binding-empty {
  color: var(--office-muted) !important;
}

.ui-modal-input,
.api-client-settings-modal input,
.api-client-settings-modal textarea,
.api-client-settings-modal select,
.sellbot-source-dialog input,
.linkbot-bind-modal input,
.line-binding-search-input {
  border-color: var(--office-line) !important;
  background: var(--office-surface) !important;
  color: var(--office-ink) !important;
  box-shadow: none !important;
  color-scheme: light !important;
}

.api-client-modal-tabs,
.sellbot-source-tools {
  border-color: var(--office-line-soft) !important;
  background: var(--office-surface-soft) !important;
}

.api-client-settings-section,
.markup-folder-browser,
.markup-folder-tree-shell,
.linkbot-supplier-scope-editor,
.linkbot-supplier-scope-rules {
  border-color: var(--office-line) !important;
  background: var(--office-surface-soft) !important;
  color: var(--office-ink) !important;
  box-shadow: none !important;
}

.api-client-tab-btn,
.linkbot-profile-card,
.linkbot-profile-card .lp-chip {
  border-color: var(--office-line) !important;
  background: var(--office-surface) !important;
  color: var(--office-muted) !important;
}

.api-client-tab-btn.is-active {
  border-color: var(--office-control-line) !important;
  background: var(--office-control-soft) !important;
  color: var(--office-control) !important;
}

.linkbot-profile-card .lp-name,
.linkbot-supplier-scope-head strong,
.linkbot-supplier-scope-rules h4 {
  color: var(--office-ink) !important;
}

.linkbot-supplier-scope-head span,
.linkbot-supplier-scope-head small,
.linkbot-supplier-scope-rules p,
.linkbot-supplier-scope-actions .scope-action-hint {
  color: var(--office-muted) !important;
}

.sellbot-source-option {
  color: var(--office-ink) !important;
}

.sellbot-source-option:hover,
.sellbot-source-option.is-selected {
  border-color: var(--office-control-line) !important;
  background: var(--office-control-soft) !important;
}

.sellbot-source-option-name {
  color: var(--office-ink) !important;
}

.sellbot-source-option-meta,
.sellbot-source-empty {
  color: var(--office-muted) !important;
}

.sellbot-source-option-badge {
  background: var(--office-control-soft) !important;
  color: var(--office-control) !important;
}

.line-binding-modal {
  overflow: hidden;
}

.line-binding-source-line,
.line-binding-folder-picker {
  border-color: var(--office-line) !important;
  background: var(--office-surface-soft) !important;
  color: var(--office-ink) !important;
}

.line-binding-current-card,
.line-binding-result-btn,
.line-binding-folder-option {
  border-color: var(--office-line) !important;
  background: var(--office-surface) !important;
  color: var(--office-ink) !important;
}

.line-binding-result-btn:hover,
.line-binding-result-btn.selected,
.line-binding-folder-option:hover,
.line-binding-folder-option.active {
  border-color: var(--office-control-line) !important;
  background: var(--office-control-soft) !important;
}

.line-binding-product-id {
  color: var(--office-control) !important;
}

.line-binding-product-path,
.line-binding-current-path,
.line-binding-folder-option small {
  color: var(--office-muted) !important;
}

.line-binding-folder-option span,
.line-binding-product-price {
  color: var(--office-green) !important;
}

.line-binding-mini-btn,
.line-binding-modal-close {
  border-color: var(--office-line) !important;
  background: var(--office-surface) !important;
  color: var(--office-control) !important;
}

.line-binding-mini-btn:hover,
.line-binding-modal-close:hover {
  border-color: var(--office-control-line) !important;
  background: var(--office-control-soft) !important;
}

.line-binding-mini-btn.danger {
  border-color: #f1b8b3 !important;
  background: var(--office-red-soft) !important;
  color: var(--office-red) !important;
}

.line-binding-duplicates-wrap {
  border-bottom-color: var(--office-line-soft) !important;
}

/* Footer */
footer,
.footer,
.login-footer {
  margin-top: auto;
  min-height: 132px;
  border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
  background:
    radial-gradient(
      ellipse at 50% -52px,
      rgba(74, 79, 91, 0.3),
      transparent 64%
    ),
    linear-gradient(180deg, #101114, #15171a) !important;
  color: #aeb4bd !important;
  box-shadow: none !important;
}

.app-footer,
.login-footer {
  padding: 0 !important;
}

.app-footer-inner,
.login-footer-inner {
  width: var(--office-page) !important;
  max-width: none !important;
  min-height: 132px !important;
  margin: 0 auto !important;
  padding: 0 !important;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #aeb4bd !important;
  font-size: 12px !important;
  font-weight: 650 !important;
  text-align: center;
}

.app-footer-copy {
  color: #aeb4bd !important;
  font-size: 12px !important;
  font-weight: 650 !important;
}

@media (max-width: 900px) {
  #excel-section .excel-source-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  #excel-section .excel-setup-card {
    min-height: 0 !important;
    padding: 16px !important;
  }

  #excel-section .excel-card-action {
    width: 100% !important;
  }

  #folder-catalog-section .fc-reports-table {
    display: table !important;
    width: 100% !important;
    min-width: 0 !important;
    table-layout: fixed !important;
    white-space: normal !important;
  }

  #folder-catalog-section .fc-reports-table > thead {
    display: none !important;
  }

  #folder-catalog-section .fc-reports-table > tbody {
    display: table-row-group !important;
    min-width: 0 !important;
  }

  #folder-catalog-section .fc-reports-table > tbody > tr {
    display: table-row !important;
    min-width: 0 !important;
  }

  #folder-catalog-section .fc-reports-table > tbody > tr > td {
    display: table-cell !important;
    width: auto !important;
    min-width: 0 !important;
  }

  .fc-report-summary-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .fc-report-summary-col--id {
    text-align: left !important;
  }

  .fc-report-product-summary,
  .fc-report-product-meta,
  .fc-report-product-name {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }

  .fc-report-product-name {
    overflow: visible !important;
    white-space: normal !important;
  }

  .fc-report-expanded {
    padding: 8px !important;
  }

  .fc-report-expanded-table-wrap {
    overflow: visible !important;
  }

  .fc-report-expanded-table {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    table-layout: auto !important;
    white-space: normal !important;
  }

  .fc-report-expanded-table thead {
    display: none !important;
  }

  .fc-report-expanded-table tbody {
    display: grid !important;
    gap: 8px;
    width: 100% !important;
    min-width: 0 !important;
  }

  .fc-report-expanded-table tbody tr {
    display: grid !important;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 9px 12px;
    width: 100% !important;
    min-width: 0 !important;
    padding: 10px !important;
    border: 1px solid var(--office-line-soft) !important;
    border-radius: 7px;
    background: var(--office-surface) !important;
  }

  .fc-report-expanded-table tbody td {
    display: block !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    padding: 0 !important;
    border: 0 !important;
    text-align: left !important;
    white-space: normal !important;
  }

  .fc-report-expanded-table tbody td:nth-child(2) {
    justify-self: end;
    text-align: right !important;
  }

  .fc-report-expanded-table tbody td:nth-child(3) {
    grid-column: 1 / -1;
    padding: 9px 10px !important;
    border: 1px solid var(--office-line-soft) !important;
    border-radius: 7px;
    background: var(--office-surface-soft) !important;
  }

  .fc-report-expanded-table tbody td:nth-child(4) {
    color: var(--office-green) !important;
    font-weight: 800;
  }

  .fc-report-expanded-table tbody td:nth-child(5) {
    justify-self: end;
    text-align: right !important;
  }

  .fc-report-expanded-table .binding-position-cell {
    padding-left: 10px !important;
    padding-right: 10px !important;
  }

  .fc-report-expanded-table .binding-position-text,
  .fc-report-expanded-table .fc-report-date {
    min-height: 0 !important;
    justify-content: flex-start !important;
    white-space: normal !important;
  }
}

/* Login uses the same product frame as Office */
.login-shell {
  width: 100%;
  min-height: calc(100vh - var(--office-topbar-height) - 132px) !important;
  padding: 72px 24px !important;
  background: var(--office-bg) !important;
}

.login-box {
  width: min(100%, 476px) !important;
  max-width: 476px !important;
  padding: 42px !important;
  border: 1px solid var(--office-line) !important;
  border-radius: var(--office-radius) !important;
  background: var(--office-surface) !important;
  color: var(--office-ink) !important;
  box-shadow: var(--office-shadow) !important;
}

.login-box::before {
  content: "РАБОЧИЙ КАБИНЕТ";
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  margin-bottom: 18px;
  padding: 0 12px;
  border: 1px solid var(--office-control-line);
  border-radius: 999px;
  background: var(--office-control-soft);
  color: var(--office-control);
  font-size: 12px;
  font-weight: 760;
}

.login-box h2 {
  margin: 0 0 10px !important;
  color: var(--office-ink) !important;
  font-size: clamp(32px, 4vw, 42px) !important;
  font-weight: 760 !important;
  line-height: 1.05;
  text-align: left !important;
}

.login-subtitle {
  margin-bottom: 26px !important;
  color: var(--office-muted) !important;
  font-size: 16px !important;
  font-weight: 500 !important;
  line-height: 1.5;
  text-align: left !important;
}

.login-box label,
.login-field > span {
  color: var(--office-muted) !important;
  font-size: 13px;
  font-weight: 700;
}

.login-field {
  display: grid;
  gap: 7px;
}

.login-box input {
  margin: 7px 0 16px !important;
  padding: 0 14px !important;
}

.login-box button[type="submit"] {
  width: 100%;
  margin-top: 0 !important;
}

.login-error,
.login-box .error {
  border: 1px solid #f1b8b3 !important;
  border-radius: var(--office-radius) !important;
  background: var(--office-red-soft) !important;
  color: var(--office-red) !important;
}

.login-box .toggle-password {
  position: absolute;
  right: 8px;
  top: 50%;
  width: 34px !important;
  height: 34px !important;
  min-height: 34px !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 7px !important;
  background-color: transparent !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23718399' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 12s3.5-7 10-7 10 7 10 7-3.5 7-10 7S2 12 2 12Z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: center !important;
  box-shadow: none !important;
  transform: translateY(-50%) !important;
}

.login-box .toggle-password.is-visible {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23718399' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m2 2 20 20'/%3E%3Cpath d='M6.7 6.7C3.8 8.5 2 12 2 12s3.5 7 10 7c1.8 0 3.3-.5 4.7-1.2M10.7 5.1A10 10 0 0 1 12 5c6.5 0 10 7 10 7a15 15 0 0 1-2.1 3.1M14.1 14.1A3 3 0 0 1 9.9 9.9'/%3E%3C/svg%3E") !important;
}

.login-footer-inner {
  color: rgba(247, 250, 253, 0.72) !important;
}

/* Mobile navigation created by engine-office.js */
.engine-mobile-nav,
.engine-more-backdrop,
.engine-more-sheet {
  display: none;
}

@media (max-width: 1600px) {
  .top-menu-nav {
    overflow: visible !important;
  }

  .menu-items {
    position: relative;
  }

  .menu-items li.engine-condensed-nav-item {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    min-height: 1px !important;
    margin: -1px !important;
    padding: 0 !important;
    overflow: hidden;
    clip-path: inset(50%);
    opacity: 0;
    pointer-events: none;
  }

  .menu-items li.engine-desktop-more-trigger {
    display: inline-flex !important;
  }

  .menu-items li.engine-desktop-more-trigger.is-open,
  .menu-items li.engine-desktop-more-trigger.is-active {
    border-color: rgba(213, 229, 242, 0.36) !important;
    background: rgba(255, 255, 255, 0.1) !important;
    color: #fff !important;
  }
}

@media (max-width: 1180px) {
  :root {
    --office-page-gutter: 32px;
  }

  .top-menu {
    gap: 16px !important;
  }

  .top-brand img {
    width: 142px !important;
  }

  .top-brand-text {
    font-size: 14px !important;
  }

  .top-menu-nav {
    overflow: visible !important;
  }

  .menu-items {
    position: relative;
  }

  .menu-items li.engine-condensed-nav-item {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    min-height: 1px !important;
    margin: -1px !important;
    padding: 0 !important;
    overflow: hidden !important;
    clip-path: inset(50%);
    opacity: 0;
    pointer-events: none;
  }

  .menu-items li.engine-desktop-more-trigger {
    display: inline-flex !important;
  }

  .menu-items li.engine-desktop-more-trigger.is-open,
  .menu-items li.engine-desktop-more-trigger.is-active {
    border-color: rgba(213, 229, 242, 0.36) !important;
    background: rgba(255, 255, 255, 0.1) !important;
    color: #fff !important;
  }

  .menu-items li,
  .menu-items li.menu-link-item > a {
    padding: 0 8px !important;
    font-size: 11px !important;
  }

  .sidebar {
    width: 270px !important;
    flex-basis: 270px !important;
  }

  .engine-profile-button {
    width: 44px;
    padding: 0;
  }

  .engine-profile-button span {
    display: none;
  }
}

@media (max-width: 820px) {
  :root {
    --office-page-gutter: 24px;
    --office-topbar-height: 68px;
  }

  .top-menu-wrapper,
  .login-topbar {
    min-height: var(--office-topbar-height) !important;
  }

  .top-menu,
  .login-topbar-inner {
    min-height: var(--office-topbar-height) !important;
  }

  .top-menu {
    display: flex !important;
    justify-content: space-between !important;
    gap: 12px !important;
  }

  .top-brand img,
  .login-topbar img {
    width: 132px !important;
  }

  .top-brand-text,
  .login-topbar-text {
    font-size: 13px !important;
  }

  .top-menu-nav {
    display: none !important;
  }

  .engine-desktop-more-menu,
  .engine-desktop-more-menu.is-open {
    display: none !important;
  }

  .logout-btn {
    width: 42px !important;
    height: 42px !important;
  }

  .content-area {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 14px !important;
    padding: 16px 0 calc(96px + env(safe-area-inset-bottom, 0px)) !important;
  }

  .sidebar,
  .main-content,
  .main-content-inner,
  .workspace-panel,
  #folder-catalog-section.workspace-panel {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }

  .sidebar {
    padding: 16px !important;
  }

  .products-main-panel,
  .main-content-inner,
  .workspace-panel {
    padding: 18px !important;
  }

  .workspace-panel-header {
    margin: -18px -18px 16px !important;
    padding: 18px !important;
  }

  .products-page-header,
  .workspace-panel-header {
    align-items: stretch !important;
  }

  .products-page-header,
  .products-bulk-actions,
  .fc-toolbar-row,
  .header-info {
    gap: 10px !important;
  }

  .products-page-header > *,
  .products-page-header button,
  .workspace-panel-header button,
  .products-bulk-actions > *,
  .fc-toolbar-group {
    max-width: 100% !important;
  }

  .products-bulk-actions {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    align-items: stretch !important;
    gap: 10px !important;
  }

  .products-bulk-actions-left,
  .products-bulk-actions-right {
    width: 100% !important;
    min-width: 0 !important;
  }

  .products-bulk-actions-left {
    display: grid !important;
    grid-template-columns: auto minmax(0, 1fr) !important;
  }

  .products-bulk-actions-right {
    display: block !important;
  }

  .products-merge-target-select,
  .products-merge-btn {
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
  }

  .products-search-shell {
    margin-inline: 0 !important;
  }

  .products-catalog-table tbody tr {
    border-bottom: 1px solid var(--office-line) !important;
  }

  .products-catalog-table tbody tr td {
    color: var(--office-ink) !important;
  }

  .products-catalog-table {
    width: 100% !important;
    table-layout: fixed !important;
  }

  .products-catalog-table th:first-child,
  .products-catalog-table td:first-child {
    width: 44px !important;
  }

  .products-catalog-table th:nth-child(2),
  .products-catalog-table td:nth-child(2) {
    width: auto !important;
    min-width: 0 !important;
  }

  .products-product-cell,
  .products-product-meta,
  .products-product-name {
    min-width: 0 !important;
    max-width: 100% !important;
  }

  .products-product-name {
    display: block !important;
    overflow: hidden !important;
    overflow-wrap: anywhere !important;
    white-space: normal !important;
    text-overflow: clip !important;
  }

  .products-catalog-table tr.bound,
  .products-catalog-table tr.is-bound,
  .products-catalog-table tr.confirmed,
  .products-catalog-table tr.unbound,
  .products-catalog-table tr.missing,
  .products-catalog-table tr.not-bound,
  .products-catalog-table tr.partial,
  .products-catalog-table tr.proposed {
    box-shadow: none !important;
  }

  .pager-shell {
    padding: 14px !important;
  }

  .engine-mobile-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1200;
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    min-height: calc(70px + env(safe-area-inset-bottom, 0px));
    padding: 7px max(5px, env(safe-area-inset-right, 0px))
      env(safe-area-inset-bottom, 0px) max(5px, env(safe-area-inset-left, 0px));
    border-top: 1px solid rgba(213, 229, 242, 0.24);
    background:
      radial-gradient(
        ellipse at 50% -30px,
        rgba(94, 99, 112, 0.56) 0%,
        rgba(42, 45, 53, 0.44) 46%,
        transparent 76%
      ),
      linear-gradient(180deg, #1c1e24 0%, #15171b 100%);
    box-shadow: 0 -12px 28px rgba(18, 24, 35, 0.18);
  }

  .engine-mobile-nav button {
    min-width: 0;
    min-height: 54px;
    padding: 5px 2px;
    border: 0 !important;
    border-radius: 7px !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    background: transparent !important;
    color: rgba(247, 250, 253, 0.68) !important;
    font-size: 10px !important;
    font-weight: 700 !important;
    line-height: 1;
  }

  .engine-mobile-nav button svg {
    width: 19px;
    height: 19px;
  }

  .engine-mobile-nav button.is-active {
    background: rgba(255, 255, 255, 0.1) !important;
    color: #fff !important;
  }

  .engine-mobile-nav button.is-active svg {
    color: var(--office-blue);
  }

  .engine-more-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1290;
    display: block;
    background: rgba(16, 17, 20, 0.42);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease;
  }

  .engine-more-sheet {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: calc(82px + env(safe-area-inset-bottom, 0px));
    z-index: 1300;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    max-height: min(70vh, 620px);
    padding: 12px;
    overflow: auto;
    border: 1px solid var(--office-line);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 28px 80px rgba(18, 24, 35, 0.24);
    transform: translateY(18px);
    opacity: 0;
    pointer-events: none;
    transition:
      transform 0.18s ease,
      opacity 0.18s ease;
  }

  .engine-more-sheet.is-open,
  .engine-more-sheet.is-open + .engine-more-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  .engine-more-sheet.is-open {
    transform: translateY(0);
  }

  .engine-more-sheet button {
    min-height: 58px;
    padding: 10px 12px;
    border: 1px solid var(--office-line) !important;
    border-radius: var(--office-radius) !important;
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr);
    align-items: center;
    gap: 9px;
    background: var(--office-surface) !important;
    color: var(--office-ink) !important;
    text-align: left;
    font-size: 12px !important;
  }

  .engine-more-sheet button svg {
    width: 32px;
    height: 32px;
    padding: 7px;
    border-radius: 7px;
    background: var(--office-control-soft);
    color: var(--office-control);
  }

  .engine-more-sheet button.is-active {
    border-color: var(--office-control-line) !important;
    background: var(--office-control-soft) !important;
  }

  .login-shell {
    min-height: calc(100vh - var(--office-topbar-height)) !important;
    padding: 18px 0 48px !important;
    align-items: flex-start !important;
  }

  .login-box {
    width: var(--office-page) !important;
    padding: 22px !important;
  }

  .login-box h2 {
    font-size: 32px !important;
  }

  .login-footer {
    display: none !important;
  }
}

@media (max-width: 420px) {
  :root {
    --office-page-gutter: 20px;
  }

  .top-brand img,
  .login-topbar img {
    width: 124px !important;
  }

  .top-brand-text,
  .login-topbar-text {
    font-size: 12px !important;
  }

  .engine-profile-button span,
  .logout-btn span {
    display: none !important;
  }

  .products-page-title,
  .workspace-panel-header h2 {
    font-size: 27px !important;
  }

  .engine-mobile-nav button {
    font-size: 9px !important;
  }

  .engine-more-sheet {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ========================================================================== 
   Engine Office v21 — complete light workspace rebuild
   A calm operations canvas, stronger information hierarchy and durable reflow.
   ========================================================================== */

:root {
  --office-bg: #eef3f6;
  --office-surface: #ffffff;
  --office-surface-soft: #f4f7f9;
  --office-surface-tint: #e8f1f5;
  --office-ink: #172536;
  --office-ink-strong: #0d1b2a;
  --office-muted: #526579;
  --office-muted-2: #6f8192;
  --office-line: #ccd9e1;
  --office-line-soft: #e3ebef;
  --office-blue: #9dc8dd;
  --office-blue-strong: #67a9c5;
  --office-control: #245f7a;
  --office-control-hover: #184b64;
  --office-control-soft: #e6f2f7;
  --office-control-line: #a9cedd;
  --office-dark: #121a24;
  --office-dark-2: #1c2733;
  --office-green: #24713d;
  --office-green-soft: #eaf6ee;
  --office-red: #b52a2f;
  --office-red-soft: #fff0f0;
  --office-warning: #956009;
  --office-warning-soft: #fff6dc;
  --office-shadow: 0 24px 64px rgba(21, 48, 69, 0.12);
  --office-shadow-tight: 0 10px 28px rgba(21, 48, 69, 0.09);
  --office-shadow-card:
    0 1px 2px rgba(21, 48, 69, 0.04), 0 12px 28px rgba(21, 48, 69, 0.055);
  --office-page-max: 1480px;
  --office-page-gutter: 48px;
  --office-radius: 14px;
  --office-radius-small: 10px;
  --office-topbar-height: 78px;
  --font-main:
    "Avenir Next", "SF Pro Text", "Segoe UI Variable", -apple-system,
    BlinkMacSystemFont, sans-serif;
}

html.engine-office-theme {
  scroll-behavior: smooth;
  background: var(--office-bg) !important;
}

body {
  background:
    radial-gradient(
      circle at 8% 0%,
      rgba(157, 200, 221, 0.2),
      transparent 30rem
    ),
    radial-gradient(
      circle at 94% 18%,
      rgba(208, 224, 232, 0.24),
      transparent 34rem
    ),
    var(--office-bg) !important;
  color: var(--office-ink) !important;
  font-feature-settings:
    "tnum" 1,
    "kern" 1;
  line-height: 1.5;
}

body *,
body *::before,
body *::after {
  box-sizing: border-box;
}

::selection {
  background: #c9e4ef;
  color: var(--office-ink-strong);
}

a {
  color: var(--office-control);
}

a:hover {
  color: var(--office-control-hover);
}

:where(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: 3px solid rgba(36, 95, 122, 0.34) !important;
  outline-offset: 2px !important;
  box-shadow: 0 0 0 5px rgba(255, 255, 255, 0.92) !important;
}

.engine-skip-link {
  position: fixed;
  top: 10px;
  left: 14px;
  z-index: 3000;
  padding: 10px 14px;
  border: 1px solid var(--office-control-line);
  border-radius: var(--office-radius-small);
  background: var(--office-surface);
  color: var(--office-control);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
  box-shadow: var(--office-shadow-tight);
  transform: translateY(-160%);
  transition: transform 0.16s ease;
}

.engine-skip-link:focus {
  transform: translateY(0);
}

/* Header: compact, stable and visually separate from the working canvas. */
.top-menu-wrapper,
.login-topbar {
  position: sticky !important;
  top: 0 !important;
  min-height: var(--office-topbar-height) !important;
  background:
    radial-gradient(
      ellipse at 42% -70px,
      rgba(115, 143, 163, 0.34),
      transparent 66%
    ),
    linear-gradient(135deg, #17212c 0%, #10171f 62%, #0d141b 100%) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
  box-shadow: 0 10px 30px rgba(12, 25, 36, 0.12) !important;
}

.top-menu,
.login-topbar-inner {
  min-height: var(--office-topbar-height) !important;
}

.top-menu {
  gap: 22px !important;
}

.top-brand img,
.login-topbar img {
  width: clamp(138px, 11vw, 158px) !important;
}

.top-brand-text,
.login-topbar-text {
  color: #c0ccd4 !important;
  font-size: 14px !important;
  font-weight: 650 !important;
}

.menu-items {
  gap: 6px !important;
}

.menu-items li,
.menu-items li.menu-link-item > a,
.engine-profile-button,
.logout-btn {
  min-height: 42px !important;
  border-radius: 11px !important;
  font-size: 11px !important;
  letter-spacing: 0.025em !important;
}

.menu-items li.active,
html.app-preload[data-initial-section] .menu-items li.active,
.engine-profile-button.is-active {
  border-color: rgba(177, 209, 224, 0.4) !important;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.15),
    rgba(255, 255, 255, 0.075)
  ) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.13),
    0 8px 22px rgba(0, 0, 0, 0.16) !important;
}

.engine-desktop-more-menu {
  padding: 9px;
  border-color: var(--office-line) !important;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 24px 70px rgba(17, 41, 60, 0.2);
  backdrop-filter: blur(16px);
}

/* App frame */
.content-area {
  align-items: flex-start !important;
  gap: 20px !important;
  padding: 26px 0 48px !important;
  background: transparent !important;
}

.sidebar {
  position: sticky;
  top: calc(var(--office-topbar-height) + 20px);
  width: 270px !important;
  flex: 0 0 270px !important;
  padding: 18px !important;
  border-color: rgba(188, 205, 215, 0.92) !important;
  border-radius: var(--office-radius) !important;
  background: rgba(255, 255, 255, 0.9) !important;
  box-shadow: var(--office-shadow-card) !important;
  backdrop-filter: blur(14px);
}

.main-content {
  min-width: 0 !important;
  flex: 1 1 auto !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  overflow: visible !important;
}

.main-content-inner {
  min-width: 0 !important;
  padding: 24px !important;
  border: 1px solid var(--office-line) !important;
  border-radius: var(--office-radius) !important;
  background: rgba(255, 255, 255, 0.96) !important;
  box-shadow: var(--office-shadow-card) !important;
}

.main-content.products-layout,
.main-content.products-layout .main-content-inner {
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.workspace-panel,
#folder-catalog-section.workspace-panel,
#parser-section.workspace-panel,
#link_bot-section.workspace-panel,
#ai_manager-section.workspace-panel {
  min-width: 0 !important;
  padding: 24px !important;
  border: 1px solid var(--office-line) !important;
  border-radius: var(--office-radius) !important;
  background: rgba(255, 255, 255, 0.97) !important;
  box-shadow: var(--office-shadow-card) !important;
}

#userbots-section,
#interaction_bots-section,
#excel-section,
#api-section,
#sell_bot-section,
#telegram-section,
#reports-section,
#admin-section,
#profile-section,
#office-section,
#orders-section,
#contractors-section,
#charts-section,
#cash-section {
  min-width: 0;
  padding: 24px !important;
  border: 1px solid var(--office-line) !important;
  border-radius: var(--office-radius) !important;
  background: rgba(255, 255, 255, 0.97) !important;
  color: var(--office-ink) !important;
  box-shadow: var(--office-shadow-card) !important;
}

.workspace-panel-header {
  margin: -24px -24px 20px !important;
  padding: 22px 24px 18px !important;
  border-bottom: 1px solid var(--office-line-soft) !important;
  background: linear-gradient(180deg, #fff 0%, #fbfcfd 100%) !important;
  border-radius: var(--office-radius) var(--office-radius) 0 0;
}

.workspace-panel-header h2,
.products-page-title,
#userbots-section > h2,
#interaction_bots-section > h2,
#excel-section > h2,
#api-section > h2,
#admin-section > h2,
#profile-section > h2,
.sellbot-titlebar h2,
.linkbot-title-main,
.ai-manager-shell h2 {
  color: var(--office-ink-strong) !important;
  font-size: clamp(25px, 2.1vw, 34px) !important;
  font-weight: 760 !important;
  letter-spacing: -0.035em !important;
  line-height: 1.08 !important;
}

.workspace-panel-subtitle,
.products-page-subtitle,
.linkbot-subtitle,
.sellbot-muted,
.ai-manager-muted {
  color: var(--office-muted) !important;
  font-size: 13px !important;
  font-weight: 550 !important;
}

.sidebar-browser-header {
  margin-bottom: 14px;
}

.sidebar-search-input {
  min-height: 46px !important;
  background: #f8fafb !important;
}

.folder-tree li > div,
.products-folder-row,
.products-folder-tree li > div {
  min-height: 44px;
  border-radius: 11px !important;
}

.folder-tree li.active > div,
.products-folder-row.active,
.products-folder-row.is-active {
  border-color: #9cc8da !important;
  background: linear-gradient(135deg, #edf7fa, #e2f0f5) !important;
  box-shadow: inset 3px 0 0 var(--office-control) !important;
}

/* Shared cards and panels */
.card,
.filter-panel,
.filters-panel,
.settings-panel,
.linkbot-panel,
.sellbot-panel,
.ai-manager-panel,
.ai-manager-card,
.publication-settings-panel,
.publication-markups-panel,
.api-client-card,
.excel-setup-card,
.excel-settings-card,
.channel-health-panel,
.channel-control-panel,
.market-alert-settings-card,
.market-delivery-panel {
  border: 1px solid var(--office-line) !important;
  border-radius: 13px !important;
  background: var(--office-surface) !important;
  color: var(--office-ink) !important;
  box-shadow: 0 1px 2px rgba(21, 48, 69, 0.035) !important;
}

.card h2,
.card h3,
.card h4,
.linkbot-panel h2,
.linkbot-panel h3,
.sellbot-panel h2,
.sellbot-panel h3,
.ai-manager-card h2,
.ai-manager-card h3 {
  color: var(--office-ink-strong) !important;
}

.card p,
.card small,
.card label,
.linkbot-panel p,
.sellbot-panel p,
.ai-manager-card p {
  color: var(--office-muted) !important;
}

hr {
  border: 0 !important;
  border-top: 1px solid var(--office-line-soft) !important;
}

code,
pre {
  border: 1px solid var(--office-line-soft) !important;
  border-radius: 9px !important;
  background: #f3f7f9 !important;
  color: #174d66 !important;
}

/* Form system */
input,
textarea,
select,
.workspace-input,
.workspace-select,
.workspace-number,
.workspace-time,
.workspace-file-input,
.sellbot-inline-input,
.ai-manager-input,
.ai-manager-textarea {
  min-width: 0;
  min-height: 44px !important;
  border: 1px solid #c5d3dc !important;
  border-radius: 10px !important;
  background-color: #fff !important;
  color: var(--office-ink) !important;
  font-size: 14px !important;
  box-shadow: inset 0 1px 1px rgba(22, 48, 68, 0.02) !important;
}

input:hover,
textarea:hover,
select:hover {
  border-color: #aebfca !important;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--office-control) !important;
  outline: 0 !important;
  box-shadow: 0 0 0 4px rgba(36, 95, 122, 0.11) !important;
}

input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid var(--office-control) !important;
  outline-offset: 2px !important;
  box-shadow: 0 0 0 5px #fff !important;
}

input::placeholder,
textarea::placeholder {
  color: #7c8d9d !important;
  opacity: 1 !important;
}

.form-group label,
.filter-group label,
.excel-field label,
.sellbot-field-label > span,
.ai-manager-field > span {
  color: #44596d !important;
  font-size: 12px !important;
  font-weight: 750 !important;
}

.toggle-password {
  min-width: 36px;
  min-height: 36px;
  border-radius: 9px;
  color: var(--office-muted) !important;
  cursor: pointer;
}

/* Buttons: one action language across all modules. */
.graphite-btn,
#userbots-section .graphite-btn,
#interaction_bots-section .graphite-btn,
#excel-section .graphite-btn,
#api-section .graphite-btn,
#telegram-section .graphite-btn,
#admin-section .graphite-btn,
#profile-section .graphite-btn,
.primary,
.btn-primary,
.save-btn,
.apply-btn,
.sellbot-btn.primary,
.linkbot-btn.primary,
button[type="submit"] {
  min-height: 42px !important;
  border: 1px solid var(--office-control) !important;
  border-radius: 10px !important;
  background: linear-gradient(180deg, #2e718e 0%, #245f7a 100%) !important;
  color: #fff !important;
  font-weight: 760 !important;
  box-shadow: 0 7px 16px rgba(36, 95, 122, 0.17) !important;
}

.graphite-btn:hover,
#userbots-section .graphite-btn:hover,
#interaction_bots-section .graphite-btn:hover,
#excel-section .graphite-btn:hover,
#api-section .graphite-btn:hover,
#telegram-section .graphite-btn:hover,
#admin-section .graphite-btn:hover,
#profile-section .graphite-btn:hover,
.primary:hover,
.btn-primary:hover,
.save-btn:hover,
.apply-btn:hover,
.sellbot-btn.primary:hover,
.linkbot-btn.primary:hover,
button[type="submit"]:hover {
  border-color: var(--office-control-hover) !important;
  background: linear-gradient(180deg, #276984 0%, #184b64 100%) !important;
  color: #fff !important;
  transform: translateY(-1px);
}

.secondary,
.btn-secondary,
.flat-action-btn,
.mini-action-btn,
.pager-btn,
.products-icon-btn,
.sellbot-btn,
.linkbot-btn,
.sellbot-icon-btn,
.api-client-tab-btn {
  min-height: 40px !important;
  border: 1px solid var(--office-line) !important;
  border-radius: 10px !important;
  background: #fff !important;
  color: var(--office-control) !important;
  font-weight: 720 !important;
  box-shadow: none !important;
}

.secondary:hover,
.btn-secondary:hover,
.flat-action-btn:hover,
.mini-action-btn:hover,
.pager-btn:hover,
.products-icon-btn:hover,
.sellbot-btn:hover,
.linkbot-btn:hover,
.sellbot-icon-btn:hover,
.api-client-tab-btn:hover,
.api-client-tab-btn.is-active {
  border-color: var(--office-control-line) !important;
  background: var(--office-control-soft) !important;
  color: var(--office-control-hover) !important;
}

.danger,
.btn-danger,
.message-delete-btn,
.graphite-btn.danger,
#userbots-section .graphite-btn.danger,
#interaction_bots-section .graphite-btn.danger,
#excel-section .graphite-btn.danger,
#api-section .graphite-btn.danger,
#telegram-section .graphite-btn.danger,
#admin-section .graphite-btn.danger,
#profile-section .graphite-btn.danger,
.sellbot-btn.danger,
.linkbot-btn.danger {
  border-color: #e6b4b7 !important;
  background: var(--office-red-soft) !important;
  color: var(--office-red) !important;
  box-shadow: none !important;
}

/* Prices: the old dark island is rebuilt as a readable light command bar. */
#parser-section .filters-panel.parser-filters-panel {
  margin-bottom: 18px !important;
  padding: 14px !important;
  border: 1px solid #bfd1db !important;
  border-radius: 14px !important;
  background:
    radial-gradient(
      circle at 100% 0%,
      rgba(157, 200, 221, 0.25),
      transparent 24rem
    ),
    linear-gradient(135deg, #f8fbfc 0%, #edf4f7 100%) !important;
  box-shadow:
    inset 0 1px 0 #fff,
    0 10px 24px rgba(21, 48, 69, 0.07) !important;
}

#parser-section .parser-search-field input {
  min-height: 48px !important;
  padding: 0 72px 0 16px !important;
  border-color: #b9cad4 !important;
  border-radius: 11px !important;
  background: #fff !important;
  color: var(--office-ink) !important;
  font-size: 14px !important;
  font-weight: 650 !important;
  box-shadow: 0 3px 12px rgba(21, 48, 69, 0.045) !important;
}

#parser-section .parser-search-field input::placeholder {
  color: #748697 !important;
}

#parser-section .parser-search-clear {
  background: #eaf1f4 !important;
  color: var(--office-muted) !important;
}

#parser-section .parser-search-icon {
  color: var(--office-control) !important;
}

#parser-section .parser-filters-grid {
  grid-template-columns:
    minmax(150px, 0.85fr) minmax(170px, 0.95fr) minmax(250px, 1.35fr)
    minmax(164px, auto) !important;
  gap: 10px !important;
}

#parser-section .filter-group.parser-filter-card,
#parser-section .parser-filter-card-submit {
  min-width: 0 !important;
  padding: 10px 11px !important;
  border: 1px solid #ccdbe3 !important;
  border-radius: 11px !important;
  background: rgba(255, 255, 255, 0.88) !important;
  color: var(--office-ink) !important;
  box-shadow: none !important;
}

#parser-section .parser-filter-card label {
  color: #44596d !important;
}

#parser-section .parser-filter-card input,
#parser-section .parser-filter-card select {
  min-height: 42px !important;
  height: 42px !important;
  border-color: #c3d1d9 !important;
  border-radius: 9px !important;
  background-color: #fff !important;
  color: var(--office-ink) !important;
  font-weight: 600 !important;
}

#parser-section .parser-filter-card select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 18 18'%3E%3Cpath d='M4.5 6.75L9 11.25L13.5 6.75' stroke='%23526579' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round' fill='none'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: calc(100% - 10px) center !important;
  background-size: 15px !important;
}

#parser-section .parser-filter-card-submit {
  align-self: stretch;
  display: flex !important;
  align-items: center !important;
}

#parser-section .parser-filter-actions {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 8px !important;
}

#parser-section .parser-filter-card-submit .apply-btn,
#parser-section .parser-export-btn {
  width: 100% !important;
  min-width: 0 !important;
  min-height: 39px !important;
  height: auto !important;
  padding: 8px 14px !important;
  border-radius: 9px !important;
  white-space: normal !important;
}

#parser-section .parser-export-btn {
  border-color: #9fc6d7 !important;
  background: #e8f3f7 !important;
  color: #1d5872 !important;
  box-shadow: none !important;
}

.tag,
.tags-container .tag {
  border: 1px solid var(--office-control-line) !important;
  background: var(--office-control-soft) !important;
  color: var(--office-control) !important;
}

/* Data tables */
.workspace-table-wrap,
.table-wrap,
.products-table-wrap,
.fc-reports-table-wrap,
.sellbot-table-wrap,
.excel-configs-wrap,
.engine-table-scroll {
  width: 100%;
  max-width: 100%;
  border: 1px solid var(--office-line) !important;
  border-radius: 13px !important;
  background: #fff !important;
  overflow: auto !important;
  box-shadow: 0 6px 18px rgba(21, 48, 69, 0.045) !important;
}

table,
table.simple-table,
.messages-table,
.sellbot-table,
.products-catalog-table,
.fc-reports-table {
  border-collapse: separate !important;
  border-spacing: 0 !important;
  background: #fff !important;
  color: var(--office-ink) !important;
}

table th,
table.simple-table th,
.messages-table th,
.sellbot-table th,
.products-catalog-table th,
.fc-reports-table th {
  padding: 12px 14px !important;
  border-bottom: 1px solid var(--office-line) !important;
  background: #f0f5f7 !important;
  color: #526579 !important;
  font-size: 11px !important;
  font-weight: 800 !important;
  line-height: 1.25 !important;
  letter-spacing: 0.025em !important;
  text-transform: uppercase !important;
}

table td,
table.simple-table td,
.messages-table td,
.sellbot-table td,
.products-catalog-table td,
.fc-reports-table td {
  padding: 13px 14px !important;
  border-bottom: 1px solid var(--office-line-soft) !important;
  background: #fff !important;
  color: var(--office-ink) !important;
  line-height: 1.45 !important;
  vertical-align: top !important;
}

table tbody tr:last-child td {
  border-bottom: 0 !important;
}

table tbody tr:hover td,
.messages-table tbody tr:hover td {
  background: #f8fbfc !important;
}

#parser-section .messages-table {
  width: 100% !important;
  min-width: 900px;
  table-layout: fixed !important;
  overflow: visible !important;
}

#parser-section .messages-table th:nth-child(1),
#parser-section .messages-table td:nth-child(1) {
  width: 42px !important;
}
#parser-section .messages-table th:nth-child(2),
#parser-section .messages-table td:nth-child(2) {
  width: 86px !important;
}
#parser-section .messages-table th:nth-child(3),
#parser-section .messages-table td:nth-child(3) {
  width: 150px !important;
}
#parser-section .messages-table th:nth-child(5),
#parser-section .messages-table td:nth-child(5) {
  width: 150px !important;
}
#parser-section .messages-table th:nth-child(6),
#parser-section .messages-table td:nth-child(6) {
  width: 118px !important;
}

#parser-section .messages-table tr.message-row,
#parser-section .messages-table tr.message-row td {
  height: auto !important;
  min-height: 0 !important;
  overflow: visible !important;
}

#parser-section .message-text-cell {
  min-width: 0 !important;
  max-width: none !important;
  font-size: 14px !important;
  line-height: 1.5 !important;
}

#parser-section .message-text-wrap,
#parser-section .message-text-box {
  width: 100%;
  min-width: 0;
  max-width: 100% !important;
  background: transparent !important;
  color: var(--office-ink) !important;
}

#parser-section .message-text-box {
  max-height: 154px !important;
  overflow: hidden !important;
  white-space: pre-wrap !important;
  overflow-wrap: anywhere !important;
  word-break: break-word !important;
}

#parser-section .message-text-wrap.is-collapsible:not(.expanded)::after {
  bottom: 32px !important;
  height: 44px !important;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0),
    #fff 88%
  ) !important;
}

#parser-section
  tr:hover
  .message-text-wrap.is-collapsible:not(.expanded)::after {
  background: linear-gradient(
    180deg,
    rgba(248, 251, 252, 0),
    #f8fbfc 88%
  ) !important;
}

#parser-section .message-text-wrap.expanded .message-text-box {
  max-height: none !important;
  overflow: visible !important;
}

.message-source-title,
.binding-source-title,
.message-sender-line,
.message-source-static {
  color: var(--office-ink) !important;
}

.message-source-note,
.message-date-cell,
.message-sender-line small {
  color: var(--office-muted) !important;
}

.message-source-link,
.message-text-toggle {
  color: var(--office-control) !important;
}

.message-text-toggle {
  min-height: 32px !important;
  margin-top: 8px !important;
  border: 1px solid var(--office-control-line) !important;
  border-radius: 8px !important;
  background: var(--office-control-soft) !important;
}

.message-linked-price-line,
.message-linked-price-line.is-stale {
  background: #e7f7ec !important;
  color: #1f7a3d !important;
  box-shadow: inset 3px 0 0 #57a96d !important;
}
/* ASTORE-SITE-ONLY-GREEN-20260722: привязка к карточке НЕ с сайта не подсвечивается */
.message-linked-price-line.is-offsite:not(.is-discount) {
    background: transparent !important;
    color: inherit !important;
    box-shadow: none !important;
    font-weight: inherit !important;
    padding: 0 !important;
    margin-left: 0 !important;
    border-radius: 0 !important;
}


.message-suggested-price-line {
  background: #e7f2fb !important;
  color: #245f7a !important;
  box-shadow: inset 3px 0 0 #67a9c5 !important;
}

.message-linked-price-line.is-discount,
.message-discount-line {
  background: #fff2df !important;
  color: #9a5408 !important;
  box-shadow: inset 3px 0 0 #d7953f !important;
}

.message-missing-price-line {
  background: #fff0f0 !important;
  color: #a92830 !important;
  box-shadow: inset 3px 0 0 #d75b62 !important;
}

.message-line-comment {
  border-color: #c7d5dd !important;
  background: #edf2f5 !important;
  color: #53677a !important;
}

.pager-shell,
.api-list-pager,
.products-pagination-bar {
  border: 1px solid var(--office-line) !important;
  border-radius: 12px !important;
  background: #f3f7f9 !important;
  color: var(--office-ink) !important;
}

/* Catalog search and results */
.products-search-shell,
.fc-search-shell {
  margin-bottom: 14px !important;
}

.products-search-field {
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
}

.products-search-input {
  min-height: 50px !important;
  padding-left: 16px !important;
  border: 1px solid #afc0ca !important;
  border-radius: 11px !important;
  background: #fff !important;
  box-shadow: 0 5px 18px rgba(21, 48, 69, 0.05) !important;
}

.products-search-icon {
  color: var(--office-control) !important;
}

.fc-toolbar-panel {
  padding: 12px !important;
  border-color: var(--office-line) !important;
  border-radius: 12px !important;
  background: #f4f8fa !important;
}

/* Bot, API, files and administration modules */
.userbots-toolbar,
.sellbot-titlebar,
.linkbot-titlebar,
.ai-manager-section-head,
.linkbot-list-panel-head {
  gap: 14px !important;
  padding-bottom: 16px !important;
  border-bottom: 1px solid var(--office-line-soft) !important;
}

.userbots-chat-form,
#api-source-form,
.admin-grid,
.excel-source-grid,
.sellbot-mini-form,
.linkbot-form-grid {
  gap: 12px !important;
}

#userbots-section .card,
#interaction_bots-section .card,
#excel-section .card,
#api-section .card,
#admin-section .card,
#profile-section .card {
  padding: 18px !important;
  border-left: 1px solid var(--office-line) !important;
  background: #fff !important;
}

#profile-section > .card {
  max-width: 560px !important;
}

#profile-section .card .card {
  max-width: none !important;
  margin-top: 14px !important;
  background: #f7fafb !important;
}

.excel-source-grid {
  align-items: stretch !important;
}

.excel-setup-card,
.excel-settings-card {
  padding: 20px !important;
}

#api-section .api-clients-card {
  overflow: hidden;
}

#api-section .simple-table td:last-child {
  min-width: 250px;
}

#api-section .simple-table td code {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sellbot-shell,
.ai-manager-shell,
.linkbot-main-body {
  color: var(--office-ink) !important;
}

.sellbot-modulebar,
.linkbot-modulebar {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)) !important;
  gap: 8px !important;
  padding: 9px !important;
  border: 1px solid var(--office-line) !important;
  border-radius: 13px !important;
  background: #eef4f6 !important;
}

.sellbot-module-btn,
.linkbot-modulebar .sellbot-module-btn {
  width: 100% !important;
  min-width: 0 !important;
  min-height: 58px !important;
  border: 1px solid #d1dde4 !important;
  border-radius: 10px !important;
  background: #fff !important;
  color: var(--office-ink) !important;
  box-shadow: none !important;
}

.sellbot-module-btn:hover,
.sellbot-module-btn.is-active,
.linkbot-modulebar .sellbot-module-btn.is-active {
  border-color: #8fc0d3 !important;
  background: #e8f3f7 !important;
  color: var(--office-ink-strong) !important;
  box-shadow: inset 0 -3px 0 var(--office-control) !important;
}

.sellbot-module-count {
  border: 1px solid var(--office-line) !important;
  background: #edf3f6 !important;
  color: #3f566a !important;
}

.sellbot-panel,
.linkbot-panel,
.ai-manager-card {
  overflow: hidden;
}

.sellbot-panel-head,
.linkbot-panel-head,
.ai-manager-panel-head,
.sellbot-price-section-head {
  padding: 16px 18px !important;
  border-bottom: 1px solid var(--office-line-soft) !important;
  background: #f4f7f9 !important;
}

.sellbot-panel-body,
.linkbot-panel-body {
  padding: 18px !important;
}

.sellbot-price-row,
.sellbot-rule-row,
.sellbot-access-row,
.linkbot-client-row,
.publication-row,
.pub-leaf-row,
.ai-manager-inbox-row,
.ai-manager-item,
.ai-manager-queue-card,
.ai-manager-thread,
.ai-manager-bubble {
  border-color: var(--office-line-soft) !important;
  background: #fff !important;
  color: var(--office-ink) !important;
}

.linkbot-summary-grid,
.channel-health-grid,
.ai-manager-metrics {
  gap: 10px !important;
}

.linkbot-summary-card,
.channel-health-row,
.ai-manager-metric {
  border: 1px solid var(--office-line) !important;
  border-radius: 11px !important;
  background: #f8fafb !important;
  color: var(--office-ink) !important;
}

.linkbot-two-col,
.ai-manager-grid,
.ai-manager-two,
.publication-editor-layout {
  gap: 16px !important;
}

.ai-manager-example,
.ai-manager-draft,
.ai-manager-queue {
  border-color: var(--office-line) !important;
  background: #f7fafb !important;
  color: var(--office-ink) !important;
}

.ai-manager-pill,
.sellbot-chip,
.pub-source-chip,
.badge,
.header-pill {
  border-color: var(--office-control-line) !important;
  background: var(--office-control-soft) !important;
  color: var(--office-control) !important;
}

/* Native choice controls must not inherit text-input geometry. */
input[type="checkbox"],
input[type="radio"],
.ui-checkbox,
.api-client-schedule-toggle input,
.linkbot-check input,
.market-alert-switch input,
.market-delivery-toggle input {
  width: 18px !important;
  min-width: 18px !important;
  max-width: 18px !important;
  height: 18px !important;
  min-height: 18px !important;
  max-height: 18px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 1px solid #aebfca !important;
  border-radius: 5px !important;
  background: #fff !important;
  box-shadow: none !important;
  flex: 0 0 18px !important;
  accent-color: var(--office-control) !important;
}

input[type="radio"] {
  border-radius: 50% !important;
}

#userbots-section select {
  padding-right: 34px !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 18 18'%3E%3Cpath d='M4.5 6.75L9 11.25L13.5 6.75' stroke='%23526579' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round' fill='none'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: calc(100% - 10px) center !important;
  background-size: 15px !important;
}

.api-price-profile-option,
.sellbot-product,
.sellbot-source-open {
  border: 1px solid var(--office-line) !important;
  border-radius: 11px !important;
  background: #fff !important;
  color: var(--office-ink) !important;
  box-shadow: none !important;
}

.api-price-profile-option:hover,
.api-price-profile-option.is-selected,
.sellbot-source-open:hover {
  border-color: var(--office-control-line) !important;
  background: var(--office-control-soft) !important;
}

.api-price-profile-option strong,
.sellbot-product strong,
.sellbot-source-open-title {
  color: var(--office-ink-strong) !important;
}

.api-price-profile-option small,
.sellbot-product small,
.sellbot-source-open-meta {
  color: var(--office-muted) !important;
}

.api-list-toolbar {
  gap: 10px !important;
}

.engine-mobile-nav {
  grid-template-columns: repeat(auto-fit, minmax(54px, 1fr)) !important;
}

/* Modal and floating surfaces */
.modal,
.modal-overlay,
.api-client-modal-backdrop,
.linkbot-bind-backdrop,
.product-modal-backdrop {
  background-color: rgba(13, 27, 42, 0.55) !important;
  backdrop-filter: blur(8px) !important;
}

.ui-modal,
.api-client-settings-modal,
.sellbot-source-dialog,
.linkbot-bind-modal,
.line-binding-modal,
.modal-content,
.modal-card,
#product-modal.product-editor-modal,
[role="dialog"] {
  border: 1px solid #bfcfd8 !important;
  border-radius: 16px !important;
  background: #fff !important;
  color: var(--office-ink) !important;
  box-shadow: 0 36px 100px rgba(10, 29, 45, 0.28) !important;
}

.ui-modal-header,
.api-client-modal-header,
.sellbot-source-modal-head,
.line-binding-modal-head,
.product-editor-header {
  background: #f7fafb !important;
}

.ui-modal-actions,
.api-client-modal-footer,
.line-binding-modal-foot,
.product-editor-footer {
  background: #fbfcfd !important;
}

.bot-form-container,
.qr-container {
  border-color: var(--office-line) !important;
  background: #fff !important;
  color: var(--office-ink) !important;
  box-shadow: var(--office-shadow) !important;
}

/* Footer belongs to the frame, not a large dark content block. */
footer,
.footer,
.login-footer {
  min-height: 82px !important;
  border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
  background: linear-gradient(135deg, #17212c, #0f171f) !important;
}

.app-footer-inner,
.login-footer-inner {
  min-height: 82px !important;
  color: #c0cad1 !important;
}

.app-footer-copy {
  color: #c0cad1 !important;
  letter-spacing: 0.01em !important;
}

.login-shell {
  background:
    radial-gradient(
      circle at 50% 0%,
      rgba(157, 200, 221, 0.26),
      transparent 31rem
    ),
    var(--office-bg) !important;
}

.login-box {
  border-radius: 18px !important;
  box-shadow: var(--office-shadow) !important;
}

/* Tablet */
@media (max-width: 1180px) {
  :root {
    --office-page-gutter: 30px;
  }

  .sidebar {
    width: 244px !important;
    flex-basis: 244px !important;
  }

  #parser-section .parser-filters-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  #parser-section .parser-filter-card-submit {
    grid-column: 1 / -1;
  }

  #parser-section .parser-filter-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  #api-section .simple-table {
    min-width: 980px;
  }
}

@media (max-width: 920px) {
  :root {
    --office-page-gutter: 24px;
  }

  .content-area {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 14px !important;
  }

  .sidebar {
    position: static;
    width: 100% !important;
    max-width: 100% !important;
    flex-basis: auto !important;
  }

  .main-content,
  .main-content-inner,
  .workspace-panel,
  #userbots-section,
  #interaction_bots-section,
  #excel-section,
  #api-section,
  #sell_bot-section,
  #link_bot-section,
  #ai_manager-section,
  #telegram-section,
  #reports-section,
  #admin-section,
  #profile-section {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }

  .admin-grid,
  .excel-source-grid,
  .linkbot-two-col,
  .ai-manager-grid,
  .ai-manager-two,
  .publication-editor-layout {
    grid-template-columns: minmax(0, 1fr) !important;
    flex-direction: column !important;
  }

  #api-section .simple-table,
  #parser-section .messages-table {
    min-width: 900px;
  }
}

/* Mobile: dense tables become readable task cards, with no horizontal page drift. */
@media (max-width: 820px) {
  :root {
    --office-page-gutter: 20px;
    --office-topbar-height: 64px;
  }

  .top-menu-wrapper,
  .login-topbar {
    position: sticky !important;
  }

  .top-brand img,
  .login-topbar img {
    width: 126px !important;
  }

  .top-brand-text,
  .login-topbar-text {
    font-size: 12px !important;
  }

  .content-area {
    padding-top: 14px !important;
    padding-bottom: calc(92px + env(safe-area-inset-bottom, 0px)) !important;
  }

  .main-content-inner,
  .workspace-panel,
  #folder-catalog-section.workspace-panel,
  #parser-section.workspace-panel,
  #link_bot-section.workspace-panel,
  #ai_manager-section.workspace-panel,
  #userbots-section,
  #interaction_bots-section,
  #excel-section,
  #api-section,
  #sell_bot-section,
  #telegram-section,
  #reports-section,
  #admin-section,
  #profile-section {
    padding: 16px !important;
    border-radius: 13px !important;
  }

  #profile-section > .card {
    width: 100% !important;
    max-width: none !important;
  }

  .workspace-panel-header {
    margin: -16px -16px 16px !important;
    padding: 18px 16px 15px !important;
  }

  .workspace-panel-header h2,
  .products-page-title,
  #userbots-section > h2,
  #interaction_bots-section > h2,
  #excel-section > h2,
  #api-section > h2,
  #admin-section > h2,
  #profile-section > h2,
  .sellbot-titlebar h2,
  .linkbot-title-main,
  .ai-manager-shell h2 {
    font-size: 27px !important;
  }

  #parser-section .parser-filters-grid,
  #parser-section .parser-filter-actions,
  .sellbot-modulebar,
  #link_bot-section .linkbot-modulebar,
  .linkbot-summary-grid,
  .channel-health-grid,
  .ai-manager-metrics {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  #parser-section .workspace-table-wrap {
    border: 0 !important;
    background: transparent !important;
    overflow: visible !important;
    box-shadow: none !important;
  }

  #parser-section .messages-table,
  #parser-section .messages-table tbody,
  #parser-section .messages-table tr,
  #parser-section .messages-table td {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }

  #parser-section .messages-table {
    min-width: 0 !important;
    border: 0 !important;
    background: transparent !important;
  }

  #parser-section .messages-table thead {
    display: none !important;
  }

  #parser-section .messages-table tr.message-row {
    margin-bottom: 12px !important;
    border: 1px solid var(--office-line) !important;
    border-radius: 12px !important;
    background: #fff !important;
    overflow: hidden !important;
    box-shadow: 0 8px 20px rgba(21, 48, 69, 0.06) !important;
  }

  #parser-section .messages-table tr.message-row td {
    padding: 11px 12px !important;
    border-bottom: 1px solid var(--office-line-soft) !important;
    background: #fff !important;
  }

  #parser-section .messages-table tr.message-row td[data-label]::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 6px;
    color: #607487;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.055em;
    line-height: 1.2;
    text-transform: uppercase;
  }

  #parser-section .messages-table tr.message-row td:last-child {
    border-bottom: 0 !important;
  }

  #parser-section .message-select-cell,
  #parser-section .message-type-cell,
  #parser-section .message-actions-cell,
  #parser-section .message-date-cell {
    width: auto !important;
    text-align: left !important;
  }

  #parser-section .message-text-box {
    max-height: 190px !important;
  }

  #parser-section .message-actions-stack,
  #parser-section .message-actions-cell .message-delete-btn {
    width: 100% !important;
  }

  #folder-catalog-section .fc-reports-table-wrap {
    overflow: visible !important;
    border: 1px solid var(--office-line) !important;
    background: #fff !important;
  }

  #folder-catalog-section .fc-reports-table {
    display: table !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    table-layout: fixed !important;
    box-sizing: border-box !important;
    white-space: normal !important;
  }

  #folder-catalog-section .fc-reports-table > thead {
    display: none !important;
  }

  #folder-catalog-section .fc-reports-table > tbody {
    display: table-row-group !important;
    min-width: 0 !important;
  }

  #folder-catalog-section .fc-reports-table > tbody > tr {
    display: table-row !important;
    min-width: 0 !important;
  }

  #folder-catalog-section .fc-reports-table > tbody > tr > td {
    display: table-cell !important;
    width: auto !important;
    min-width: 0 !important;
  }

  #api-section .api-list-toolbar {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
  }

  #api-section .api-list-toolbar > *,
  #api-section .api-list-toolbar button {
    width: 100% !important;
    min-width: 0 !important;
  }

  #api-section .api-clients-card .engine-table-scroll,
  #userbot-list .engine-table-scroll {
    overflow: visible !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
  }

  #api-section .api-clients-card table.simple-table,
  #api-section .api-clients-card table.simple-table tbody,
  #api-section .api-clients-card table.simple-table tr,
  #api-section .api-clients-card table.simple-table td,
  #userbot-list table,
  #userbot-list table tbody,
  #userbot-list table tr,
  #userbot-list table td {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }

  #api-section .api-clients-card table.simple-table,
  #userbot-list table {
    min-width: 0 !important;
    overflow: visible !important;
    border: 0 !important;
    background: transparent !important;
  }

  #api-section .api-clients-card table.simple-table thead,
  #userbot-list table tr:first-child {
    display: none !important;
  }

  #api-section .api-clients-card table.simple-table tbody tr,
  #userbot-list table tr:not(:first-child) {
    margin-bottom: 12px !important;
    border: 1px solid var(--office-line) !important;
    border-radius: 12px !important;
    background: #fff !important;
    overflow: hidden !important;
    box-shadow: 0 7px 18px rgba(21, 48, 69, 0.05) !important;
  }

  #api-section .api-clients-card table.simple-table td,
  #userbot-list table td {
    padding: 11px 12px !important;
    border-bottom: 1px solid var(--office-line-soft) !important;
    background: #fff !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
  }

  #api-section .api-clients-card table.simple-table td:last-child,
  #userbot-list table td:last-child {
    border-bottom: 0 !important;
  }

  #api-section .api-clients-card table.simple-table td::before,
  #userbot-list table td::before {
    display: block;
    margin-bottom: 5px;
    color: var(--office-muted);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }

  #api-section .api-clients-card table.simple-table td:nth-child(1)::before {
    content: "Клиент";
  }

  #api-section .api-clients-card table.simple-table td:nth-child(2)::before {
    content: "Токен";
  }

  #api-section .api-clients-card table.simple-table td:nth-child(3)::before {
    content: "Прайс";
  }

  #api-section .api-clients-card table.simple-table td:nth-child(4)::before {
    content: "Режим работы";
  }

  #api-section .api-clients-card table.simple-table td:nth-child(5)::before {
    content: "Действия";
  }

  #userbot-list table td:nth-child(1)::before {
    content: "Аккаунт";
  }

  #userbot-list table td:nth-child(2)::before {
    content: "Статус";
  }

  #userbot-list table td:nth-child(3)::before {
    content: "Расписание";
  }

  #userbot-list table td:nth-child(4)::before {
    content: "Действия";
  }

  #userbot-list table td:nth-child(3) > div {
    width: 100% !important;
    flex-wrap: wrap !important;
  }

  #userbot-list table td:nth-child(3) input[type="time"] {
    flex: 1 1 104px !important;
    min-width: 104px !important;
  }

  #userbot-list table td:nth-child(4) {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
  }

  #userbot-list table td:nth-child(4)::before {
    grid-column: 1 / -1;
  }

  #userbot-list table td:nth-child(4) button {
    width: 100% !important;
    min-width: 0 !important;
  }

  .engine-mobile-nav {
    border-top: 1px solid rgba(188, 205, 215, 0.92) !important;
    background: rgba(255, 255, 255, 0.96) !important;
    box-shadow: 0 -12px 30px rgba(21, 48, 69, 0.12) !important;
    backdrop-filter: blur(18px);
  }

  .engine-mobile-nav button {
    color: #617487 !important;
  }

  .engine-mobile-nav button.is-active {
    background: var(--office-control-soft) !important;
    color: var(--office-control) !important;
  }

  .engine-more-sheet {
    border-color: var(--office-line) !important;
    background: rgba(255, 255, 255, 0.98) !important;
  }

  footer,
  .footer,
  .login-footer {
    min-height: 68px !important;
  }

  .app-footer-inner,
  .login-footer-inner {
    min-height: 68px !important;
  }
}

@media (max-width: 520px) {
  :root {
    --office-page-gutter: 14px;
  }

  .engine-header-actions {
    gap: 5px;
  }

  .engine-profile-button,
  .logout-btn {
    width: 40px !important;
    min-width: 40px !important;
    height: 40px !important;
    padding: 0 !important;
  }

  .workspace-panel-header h2,
  .products-page-title,
  #userbots-section > h2,
  #interaction_bots-section > h2,
  #excel-section > h2,
  #api-section > h2,
  #admin-section > h2,
  #profile-section > h2,
  .sellbot-titlebar h2,
  .linkbot-title-main,
  .ai-manager-shell h2 {
    font-size: 24px !important;
  }

  .userbots-toolbar,
  .sellbot-titlebar,
  .linkbot-titlebar,
  .ai-manager-section-head,
  .products-page-header,
  .workspace-panel-header {
    align-items: stretch !important;
    flex-direction: column !important;
  }

  .userbots-toolbar > button,
  .sellbot-actions > button,
  .products-page-header > button,
  .workspace-panel-header > button {
    width: 100% !important;
  }

  .engine-more-sheet {
    grid-template-columns: minmax(0, 1fr) !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  html.engine-office-theme {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
