.autoreply-layout {
  padding-top: calc(var(--topbar-h) + var(--safe-top) + var(--page-offset-with-filters) + 58px);
}

body.filters-hidden .layout.autoreply-layout {
  padding-top: calc(var(--topbar-h) + var(--safe-top) + var(--page-offset-no-filters) + 58px);
}

.autoreply-workspace {
  padding: 14px 16px 18px;
}

.autoreply-marketbar {
  position: fixed;
  top: calc(var(--topbar-h) + var(--safe-top) + var(--page-offset-with-filters));
  left: 0;
  right: 0;
  z-index: 88;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 9px 16px;
  background: linear-gradient(to bottom, #000, #1b1b1b);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}

body.filters-hidden .autoreply-marketbar {
  top: calc(var(--topbar-h) + var(--safe-top) + var(--page-offset-no-filters));
}

.autoreply-usage-card {
  width: 100%;
  min-height: 138px;
  padding: 28px 34px 34px;
  border-radius: 28px;
  background: rgba(28, 28, 30, 0.90);
  box-shadow: 0 18px 55px rgba(0, 0, 0, 0.24);
}

.autoreply-usage-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.autoreply-usage-card__title {
  margin: 0;
  color: rgba(235, 235, 245, 0.72);
  font-size: 26px;
  font-weight: 650;
  line-height: 1.2;
}

.autoreply-usage-card__label {
  color: rgba(235, 235, 245, 0.72);
  font-size: 24px;
  font-weight: 600;
  white-space: nowrap;
}

.autoreply-usage-card__track {
  width: 100%;
  height: 16px;
  margin-top: 18px;
  overflow: hidden;
  border-radius: 999px;
  background: #2C2C2E;
}

.autoreply-usage-card__bar {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: #0A84FF;
  transition: width .3s ease, background-color .3s ease;
}

.autoreply-usage-card__bar--normal {
  background: #0A84FF;
}

.autoreply-usage-card__bar--warn {
  background: #FF9F0A;
}

.autoreply-usage-card__bar--danger {
  background: #FF453A;
}

.autoreply-usage-card__bar--success {
  background: #22c55e;
}

.autoreply-usage-card__actions {
  display: flex;
  justify-content: flex-end;
  padding-top: 20px;
}

.autoreply-usage-card__btn {
  appearance: none;
  -webkit-appearance: none;
  min-height: 64px;
  padding: 0 22px;
  border: 0;
  border-radius: 18px;
  background: rgba(58, 58, 60, 0.74);
  color: rgba(245, 245, 247, 0.96);
  font-size: 22px;
  font-weight: 750;
  cursor: pointer;
}

.autoreply-market-switch {
  position: relative;
  display: flex;
  align-items: center;
  gap: 2px;
  width: 46vw;
  min-width: 234px;
  max-width: 760px;
  height: 24px;
  padding: 2px;
  border-radius: 10px;
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .10);
  -webkit-backdrop-filter: blur(14px) saturate(1.25);
  backdrop-filter: blur(14px) saturate(1.25);
  overflow: hidden;
}

.autoreply-market-switch::before {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: calc(50% - 1px);
  height: calc(100% - 4px);
  border-radius: 8px;
  background: rgba(245, 245, 247, .86);
  border: 1px solid rgba(255, 255, 255, .55);
  box-shadow:
    0 10px 22px rgba(0, 0, 0, .28),
    0 1px 0 rgba(255, 255, 255, .55) inset;
  transform: translateX(calc(var(--seg-index, 0) * 100%));
  transition: transform 220ms cubic-bezier(.22, 1, .36, 1);
}

.autoreply-market-switch__btn {
  position: relative;
  z-index: 1;
  flex: 1 1 0;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-width: 0;
  border: 0;
  background: transparent;
  color: rgba(229, 231, 235, .78);
  font-size: 11px;
  line-height: 1;
  font-weight: 500;
  text-align: center;
  padding: 0;
  cursor: pointer;
  user-select: none;
  transition: color 140ms ease, transform 80ms ease;
}

.autoreply-market-switch__btn:hover {
  color: rgba(245, 245, 247, .92);
}

.autoreply-market-switch__btn:active {
  transform: scale(.98);
}

.autoreply-market-switch__btn[aria-selected="true"] {
  color: rgba(17, 24, 39, .95);
  font-weight: 600;
}

.autoreply-kpis {
  max-width: min(360px, 42vw);
}

.autoreply-page {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
}

.autoreply-menubar {
  z-index: 89;
}

.autoreply-menubar .page-menubar-left,
.autoreply-menubar .page-menubar-right {
  min-width: 0;
}

#refresh-menudrop .menudrop-popover {
  min-width: 230px;
}

.topbar-user-area.userpop--open {
  z-index: 400;
}

.topbar-user-area.userpop--open::before {
  content: "";
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.18);
  z-index: 205;
  pointer-events: none;
}

.topbar-user-area.userpop--open .user-popover {
  z-index: 410;
}

#user-cabinet-drop .menudrop-popover {
  max-height: 320px;
  overflow-y: auto;
}

.autoreply-cabinet-option {
  display: inline-flex;
  align-items: center;
  flex-direction: row;
  gap: 6px;
  min-width: 0;
}

.autoreply-cabinet-option__name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.autoreply-cabinet-option__meta {
  color: rgba(161, 161, 170, 0.82);
  font-size: 13px;
  white-space: nowrap;
}

.autoreply-board {
  min-height: 0;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(28, 28, 30, 0.78);
  box-shadow: 0 18px 55px rgba(0, 0, 0, 0.26);
  overflow: hidden;
}

.autoreply-board__head {
  min-height: 68px;
  padding: 16px 18px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.autoreply-board__title {
  margin: 0;
  color: rgba(245, 245, 247, 0.96);
  font-size: 18px;
  font-weight: 650;
  line-height: 1.2;
}

.autoreply-board__subtitle {
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 12px;
}

.autoreply-table-wrap {
  overflow-x: auto;
}

.autoreply-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.autoreply-table th,
.autoreply-table td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  text-align: left;
  vertical-align: top;
  color: rgba(245, 245, 247, 0.90);
  font-size: 13px;
  line-height: 1.35;
}

.autoreply-table th {
  color: rgba(161, 161, 170, 0.92);
  background: rgba(255, 255, 255, 0.035);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

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

.autoreply-table__marketplace {
  width: 120px;
}

.autoreply-table__article {
  width: 150px;
}

.autoreply-table__status {
  width: 118px;
}

.autoreply-table__usage {
  width: 150px;
}

.autoreply-product {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.autoreply-product__name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: rgba(245, 245, 247, 0.96);
  font-weight: 600;
}

.autoreply-product__instruction {
  max-height: 32px;
  overflow: hidden;
  color: rgba(161, 161, 170, 0.86);
  font-size: 12px;
}

.ar-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}

.ar-badge--wb {
  background: rgba(168, 85, 247, 0.18);
  color: rgba(216, 180, 254, 0.98);
}

.ar-badge--ozon {
  background: rgba(59, 130, 246, 0.18);
  color: rgba(147, 197, 253, 0.98);
}

.ar-badge--enabled {
  background: rgba(34, 197, 94, 0.16);
  color: rgba(134, 239, 172, 0.98);
}

.ar-badge--disabled {
  background: rgba(246, 41, 43, 0.16);
  color: rgba(252, 165, 165, 0.98);
}

.autoreply-empty,
.autoreply-error,
.autoreply-login {
  padding: 32px 18px;
  color: var(--text-muted);
}

.autoreply-error {
  color: rgba(252, 165, 165, 0.98);
}

.autoreply-login {
  max-width: 420px;
  margin: 64px auto 0;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(28, 28, 30, 0.86);
  box-shadow: 0 18px 55px rgba(0, 0, 0, 0.28);
}

.autoreply-login__title {
  color: rgba(245, 245, 247, 0.96);
  font-size: 18px;
  font-weight: 650;
}

.autoreply-login__text {
  margin: 8px 0 16px;
  color: var(--text-muted);
  font-size: 13px;
}

.autoreply-popover-login {
  width: 100%;
}

.ar-btn {
  appearance: none;
  -webkit-appearance: none;
  min-height: 34px;
  padding: 0 14px;
  border-radius: var(--btn-radius);
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: var(--btn-bg);
  color: var(--btn-text);
  cursor: pointer;
  font-size: var(--btn-font-size);
}

.ar-btn--primary {
  border-color: transparent;
  background: var(--btn-primary-bg);
  color: var(--btn-primary-text);
}

@media (max-width: 760px) {
  .autoreply-market-switch {
    width: min(320px, calc(100vw - 32px));
    max-width: calc(100vw - 32px);
  }

  .autoreply-usage-card {
    min-height: 112px;
    padding: 18px 18px 20px;
    border-radius: 18px;
  }

  .autoreply-usage-card__title,
  .autoreply-usage-card__label {
    font-size: 15px;
  }

  .autoreply-usage-card__track {
    height: 10px;
    margin-top: 12px;
  }

  .autoreply-usage-card__actions {
    padding-top: 14px;
  }

  .autoreply-usage-card__btn {
    min-height: 38px;
    padding: 0 14px;
    border-radius: 12px;
    font-size: 14px;
  }

  .autoreply-kpis {
    display: none !important;
  }

  .autoreply-board__head {
    min-height: 60px;
    padding: 14px;
  }
}
