:root {
  color-scheme: light;
  --bg: #f3f6fa;
  --panel: #ffffff;
  --panel-soft: #f8fbff;
  --text: #06152d;
  --muted: #607092;
  --line: #d9e3f0;
  --line-soft: #e9eef6;
  --blue: #1f66ff;
  --blue-soft: #eef5ff;
  --green: #09a66d;
  --green-soft: #e9f8f1;
  --red: #f04438;
  --red-soft: #fff0ef;
  --orange: #f79009;
  --shadow: 0 18px 45px rgba(28, 45, 74, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, Segoe UI, Arial, sans-serif;
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: #f4f7fb;
  padding: 24px;
}

.login-card {
  width: min(420px, 100%);
  display: grid;
  gap: 16px;
  border: 1px solid #dfe6ef;
  border-radius: 16px;
  background: #ffffff;
  padding: 28px;
  box-shadow: 0 18px 46px rgba(24, 33, 47, 0.1);
}

.login-card h1 {
  margin-top: 8px;
  color: #101827;
  font-size: 28px;
  line-height: 1.15;
}

.login-eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #66758d;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.login-eyebrow img {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  object-fit: cover;
  box-shadow: 0 2px 7px rgba(24, 33, 47, 0.14);
}

.login-card label {
  display: grid;
  gap: 7px;
  color: #52627a;
  font-size: 13px;
  font-weight: 500;
}

.login-card input {
  width: 100%;
  min-height: 44px;
  border: 1px solid #d5deec;
  border-radius: 10px;
  background: #ffffff;
  color: #101827;
  padding: 0 12px;
  font: inherit;
  outline: none;
}

.login-card input:focus {
  border-color: #b8cdf8;
  box-shadow: 0 0 0 3px rgba(47, 107, 255, 0.1);
}

.login-card p {
  margin: 0;
  border: 1px solid rgba(240, 68, 56, 0.18);
  border-radius: 9px;
  background: rgba(240, 68, 56, 0.08);
  color: #b42318;
  padding: 9px 10px;
  font-size: 13px;
}

.login-card button {
  min-height: 44px;
  border: 1px solid #1f5fea;
  border-radius: 10px;
  background: #1f5fea;
  color: #ffffff;
  cursor: pointer;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  box-shadow: none;
}

.login-card button:not(:disabled):hover,
.login-card button:not(:disabled):focus-visible {
  border-color: #1557df;
  background: #1557df;
  outline: none;
}

.login-card button:disabled {
  border-color: #6f98ee;
  background: #6f98ee;
  color: #ffffff;
  cursor: default;
}

.session-chip {
  display: grid;
  grid-template-rows: 26px 1px 25px;
  align-content: center;
  gap: 0;
  min-width: 190px;
  max-width: 270px;
  min-height: 52px;
  border: 1px solid #cfd8e6;
  border-radius: 8px;
  border-color: #cfd8e6;
  background: #ffffff;
  color: #344054;
  padding: 0;
  overflow: hidden;
  box-shadow: 0 1px 0 rgba(6, 21, 45, 0.03);
}

.session-login,
.session-logout {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  line-height: 1;
}

.session-login {
  color: #07111f;
  font-size: 14px;
  font-weight: 600;
}

.session-logout {
  width: 100%;
  min-height: 25px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #52627a;
  padding: 0;
  font-size: 13px;
  font-weight: 400;
  box-shadow: none;
  transition: background 160ms ease, color 160ms ease;
}

.session-divider {
  height: 1px;
  margin: 0 10px;
  background: #edf1f6;
}

.session-logout:hover,
.session-logout:focus-visible {
  background: #f8fbff;
  color: #155eef;
  outline: none;
}

.shell {
  width: min(1780px, 100%);
  margin: 0 auto;
  padding: 24px 32px 36px;
}

.appHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}

.brand {
  min-width: 0;
}

.brandLogo {
  display: block;
  width: 41px;
  height: 41px;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 999px;
  object-fit: cover;
  object-position: center;
  box-shadow: 0 2px 7px rgba(24, 33, 47, 0.16);
}

.kicker {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #586780;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  margin-top: 6px;
  font-size: 30px;
  line-height: 1.15;
}

h2 {
  font-size: 20px;
  line-height: 1.2;
}

p,
label,
td,
th,
.logMeta,
.chip {
  font-size: 14px;
}

p,
label,
.logMeta {
  color: var(--muted);
}

.actions,
.chips,
.switchRow {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

button,
input,
select,
textarea {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  font: inherit;
}

button {
  cursor: pointer;
  padding: 0 14px;
  color: #2d4165;
  font-weight: 700;
  box-shadow: 0 1px 0 rgba(6, 21, 45, 0.03);
}

button:hover {
  border-color: #b8c8dd;
  background: var(--panel-soft);
}

button.primary {
  border-color: #7da2ff;
  background: var(--blue-soft);
  color: #0757ff;
}

.addAdBtn {
  font-weight: 400;
}

.addAdBtn:disabled {
  border-color: #d8e0eb;
  background: #f6f8fb;
  color: #9aa8ba;
  cursor: default;
  opacity: 1;
}

input,
select,
textarea {
  width: 100%;
  padding: 7px 10px;
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #7da2ff;
  box-shadow: 0 0 0 3px rgba(31, 102, 255, 0.1);
}

textarea {
  resize: vertical;
  min-height: 88px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.sectionTitle,
.panelHead {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pulse {
  flex: 0 0 auto;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 5px var(--green-soft);
}

.headerStatus.api-missing .pulse {
  animation: apiPulseWarning 1.15s ease-in-out infinite;
  background: #f59e0b;
  box-shadow: 0 0 0 5px rgba(245, 158, 11, 0.14);
}

.headerStatus.api-error .pulse,
.headerStatus.api-guard .pulse {
  background: #f04438;
  box-shadow: 0 0 0 5px rgba(240, 68, 56, 0.12);
}

@keyframes apiPulseWarning {
  0%,
  100% {
    box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.14);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(245, 158, 11, 0.24);
    transform: scale(1.08);
  }
}

.headerRight {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
  margin-left: auto;
}

.headerStatus {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  max-width: 420px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.headerStatus > div {
  min-width: 0;
}

.headerStatus strong {
  display: block;
  font-size: 14px;
}

.headerStatus p {
  overflow: hidden;
  max-width: 300px;
  color: #66758d;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.accountStatus {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 30px;
  align-content: center;
  align-items: center;
  gap: 8px;
  min-width: 190px;
  max-width: 270px;
  min-height: 52px;
  padding: 8px 8px 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.accountStatus[hidden] {
  display: none;
}

.accountLabel,
.accountUid {
  overflow: hidden;
  color: #66758d;
  font-size: 12px;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.accountMerchant {
  max-width: 100%;
}

.accountMerchant .merchant-link,
.accountMerchant strong {
  flex: 0 1 auto;
  min-width: 0;
}

.accountMerchant .auth-badge {
  flex: 0 0 16px;
}

.account-settings-menu {
  justify-self: end;
}

.account-settings-button {
  display: grid;
  place-items: center;
  width: 28px;
  min-height: 28px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #66758d;
  padding: 0;
  box-shadow: none;
}

.account-settings-button svg {
  width: 17px;
  height: 17px;
}

.account-settings-button:hover,
.account-settings-button:focus-visible,
.account-settings-button.active {
  background: #eef6ff;
  color: #155eef;
  outline: none;
}

.account-settings-popover {
  display: grid;
  gap: 10px;
  width: min(320px, calc(100vw - 32px));
}

.account-settings-popover[hidden] {
  display: none;
}

.account-connect-button,
.account-unlink-button {
  width: 100%;
  min-height: 34px;
  font-size: 14px;
  font-weight: 400;
}

.account-settings-popover input {
  font-size: 13px;
  font-weight: 400;
}

.account-connect-button {
  border-color: #9dbcf7;
  background: #eaf1ff;
  color: #155eef;
}

.account-settings-popover input:disabled,
.account-connect-button:disabled {
  border-color: #d8e0eb;
  background: #f3f6fa;
  color: #9aa8ba;
  cursor: default;
}

.account-settings-popover input:disabled::placeholder {
  color: #9aa8ba;
}

.account-unlink-button {
  border-color: #f7b5af;
  background: #fff0ef;
  color: #b42318;
}

.account-unlink-button:disabled {
  border-color: #d8e0eb;
  background: #f6f8fb;
  color: #9aa8ba;
  cursor: default;
}

.iconBox {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 0;
  background: transparent;
  color: #111827;
  font-weight: 900;
  box-shadow: none;
}

.panel {
  padding: 18px;
}

.settingsPanel {
  margin-bottom: 14px;
}

.sectionTitle {
  margin-bottom: 14px;
}

.settingsTop,
.miniPanelHead {
  display: flex;
  align-items: center;
  gap: 12px;
}

.settingsTop {
  justify-content: space-between;
  margin-bottom: 14px;
}

.settingsTop .sectionTitle {
  margin-bottom: 0;
}

.settingsActions {
  display: flex;
  align-items: end;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
}

.sectionTitle.compact {
  margin-top: 2px;
}

.sectionTitle h2,
.panelHead h2 {
  font-size: 20px;
}

.sectionDivider {
  height: 1px;
  margin: 8px 0 16px;
  background: var(--line-soft);
}

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

.adIdField {
  min-width: 0;
  width: 300px;
}

.ownAdBlock {
  container-type: inline-size;
  width: 100%;
  max-width: none;
  margin-top: 14px;
  overflow: visible;
  border: 1px solid #e7edf5;
  border-radius: 8px;
  background: #ffffff;
}

.miniPanelHead {
  justify-content: space-between;
  min-height: 54px;
  padding: 10px 14px;
  border-bottom: 1px solid #e7edf5;
}

.terminalIcon {
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
}

.terminalIcon svg,
.terminalIcon img {
  width: 32px;
  height: 32px;
  opacity: 0.74;
}

.terminalIcon img {
  display: block;
}

.miniPanelHead h3 {
  font-size: 17px;
  font-weight: 600;
}

.miniPanelHead p {
  margin-top: 3px;
  font-size: 13px;
}

.own-ad-list {
  display: grid;
  gap: 10px;
  padding: 10px;
  background: #f8fbff;
  overflow: visible;
}

.own-ad-card {
  position: relative;
  overflow: visible;
  border: 1px solid #e7edf5;
  border-radius: 8px;
  background: #ffffff;
}

.own-ad-id-chip {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 3;
  max-width: 245px;
  overflow: hidden;
  padding: 7px 28px 7px 14px;
  border-radius: 8px 0 22px 0;
  background: linear-gradient(135deg, #f7f9fc 0%, #eef2f7 100%);
  color: #66758d;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.2;
  box-shadow: inset -1px -1px 0 rgba(255, 255, 255, 0.74);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.own-ad-id-chip::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 20px;
  height: 18px;
  border-radius: 0 0 0 18px;
  background: rgba(255, 255, 255, 0.68);
  opacity: 0.72;
}

.own-ad-card-deleted {
  border-color: #d9e1ec;
  background: #f3f6fa;
}

.own-ad-card-deleted .own-ad-row > *:not(.own-ad-remove) {
  opacity: 0.68;
}

.own-ad-card-deleted .watch-card-remove {
  opacity: 1;
  filter: none;
}

.own-ad-card-deleted .card-filter-button,
.own-ad-card-deleted .bot-toggle {
  cursor: default;
}

.own-ad-card-deleted .card-filter-button {
  opacity: 0.55;
}

.own-ad-card:has(.ad-filter-popover:not([hidden])) {
  z-index: 60;
}

.bot-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #344054;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
}

.bot-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.bot-toggle span {
  position: relative;
  width: 36px;
  height: 20px;
  border-radius: 999px;
  background: #d5dbe6;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(102, 117, 141, 0.12);
  transition: background 220ms ease, box-shadow 220ms ease, transform 160ms ease;
}

.bot-toggle input:disabled + span,
.bot-toggle:has(input:disabled) {
  cursor: default;
}

.bot-toggle span::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(24, 33, 47, 0.24);
  transition: transform 220ms cubic-bezier(0.22, 1, 0.36, 1), box-shadow 220ms ease;
}

.bot-toggle:active span {
  transform: scale(0.96);
}

.bot-toggle input:checked + span {
  background: #155eef;
  box-shadow: inset 0 0 0 1px rgba(21, 94, 239, 0.18), 0 0 0 3px rgba(21, 94, 239, 0.08);
}

.bot-toggle input:checked + span::before {
  transform: translateX(16px);
  box-shadow: 0 2px 6px rgba(21, 94, 239, 0.28);
}

.bot-toggle b {
  font-weight: 600;
}

.own-ad-direction strong {
  font-size: 15px;
}

.own-ad-direction em {
  overflow: hidden;
  color: #66758d;
  font-size: 12px;
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ad-telemetry {
  display: grid;
  gap: 2px;
  margin-top: 6px;
  color: #66758d;
  font-size: 11px;
  line-height: 1.25;
}

.ad-telemetry span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.own-ad-telemetry-cell .ad-telemetry {
  margin-top: 0;
  font-size: 12px;
  gap: 3px;
}

.watch-card-remove {
  position: absolute;
  top: -1px;
  right: -1px;
  width: 43px;
  height: 43px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 0 14px 0 26px;
  background: transparent;
  color: #66758d;
  cursor: pointer;
  overflow: hidden;
  transition: color 180ms ease, transform 180ms ease;
}

.watch-card-remove::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, #eef1f7 0%, #e4e8f1 100%);
  opacity: 0.72;
  transform: translate(13px, -13px) scale(0.94);
  transform-origin: top right;
  transition: opacity 180ms ease, transform 220ms ease, box-shadow 220ms ease;
}

.watch-card-remove::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 18px;
  height: 18px;
  border-radius: 0 14px 0 18px;
  background: rgba(255, 255, 255, 0.55);
  opacity: 0;
  transition: opacity 180ms ease, transform 220ms ease;
}

.watch-card-remove svg {
  position: relative;
  z-index: 1;
  width: 16px;
  height: 16px;
  opacity: 0;
  transform: translate(8px, -8px) rotate(-35deg) scale(0.72);
  transition: opacity 160ms ease, transform 220ms ease;
}

.watch-card-remove:hover,
.watch-card-remove:focus-visible {
  color: #344054;
  transform: translateY(-1px);
  outline: none;
}

.watch-card-remove:hover::before,
.watch-card-remove:focus-visible::before {
  opacity: 1;
  transform: translate(0, 0) scale(1);
  box-shadow: -10px 12px 24px rgba(24, 33, 47, 0.11);
}

.watch-card-remove:hover::after,
.watch-card-remove:focus-visible::after {
  opacity: 0;
  transform: translate(6px, -6px);
}

.watch-card-remove:hover svg,
.watch-card-remove:focus-visible svg {
  opacity: 1;
  transform: translate(0, 0) rotate(0deg) scale(1);
}

.own-info-cell {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.own-info-cell span {
  color: #66758d;
  font-size: 12px;
}

.own-info-cell strong {
  overflow: hidden;
  color: #66758d;
  font-size: 13px;
  font-weight: 400;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.own-info-cell .status-listed {
  color: #067647;
}

.own-info-cell .status-hidden {
  color: #66758d;
}

.own-info-cell .status-deleted {
  color: #66758d;
}

.own-toggle-cell {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
}

.own-filter-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
}

.own-empty {
  padding: 13px 14px;
}

.own-ad-card > .own-empty {
  min-height: 58px;
  padding: 34px 48px 13px 14px;
}

.filterMenu {
  position: relative;
}

.filter-disabled-fieldset {
  display: contents;
  border: 0;
  margin: 0;
  padding: 0;
}

.ad-filter-menu {
  z-index: 40;
}

.filter-button.open {
  border-color: #b9ceff;
  background: #eef5ff;
  color: #0757ff;
}

.filter-button.card-filter-button {
  width: 26px;
  min-height: 26px;
  border: 0;
  background: transparent;
  color: #18212f;
  padding: 0;
  transition: transform 150ms ease, border-color 150ms ease, background 150ms ease, color 150ms ease;
}

.filter-button.card-filter-button:hover,
.filter-button.card-filter-button:focus-visible {
  transform: translateY(-1px) scale(1.04);
  background: #eef6ff;
  color: #155eef;
  outline: none;
}

.filter-button.card-filter-button:active {
  transform: translateY(0) scale(0.98);
}

.filter-button.card-filter-button.active {
  background: #eef6ff;
  color: #155eef;
}

.filter-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 30;
  width: min(560px, calc(100vw - 64px));
  border: 1px solid #d8e0eb;
  border-radius: 8px;
  background: #ffffff;
  padding: 10px;
  box-shadow: 0 18px 45px rgba(28, 45, 74, 0.14);
}

.ad-filter-popover {
  width: min(560px, calc(100vw - 64px));
}

.ad-filter-field {
  color: #66758d;
  font-size: 12px;
  font-weight: 500;
}

.ad-filter-field + .ad-filter-field,
.ad-filter-checks,
.ad-filter-checks + .competitorBox {
  margin-top: 10px;
}

.ad-filter-field select,
.ad-filter-field input {
  min-height: 34px;
  color: #18212f;
  font-size: 13px;
}

.ad-filter-checks {
  display: grid;
  gap: 8px;
  margin-inline: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
}

.ad-filter-checks legend {
  padding: 0 5px;
  color: #66758d;
  font-size: 12px;
}

.price-follow-checks {
  background: #f8fbff;
}

.price-mode-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  justify-self: start;
  min-height: 25px;
  border-radius: 999px;
  background: #edf4ff;
  color: #155eef;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
}

.price-mode-pill.floating {
  background: #fff4e5;
  color: #7a3b00;
}

.mini-check {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #26364d;
  font-size: 12px;
  font-weight: 500;
}

.mini-check input {
  width: auto;
  min-height: auto;
}

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

.filterItem {
  display: grid;
  align-content: center;
  gap: 5px;
  min-height: 58px;
  padding: 9px 10px;
  border: 1px solid #dce6f2;
  border-radius: 8px;
  background: #ffffff;
}

.filterItem span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.2;
}

.filterItem strong {
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.25;
  text-overflow: ellipsis;
}

.checkGroup {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
}

.checkGroup legend {
  padding: 0 6px;
  color: var(--muted);
  font-size: 14px;
}

.competitorBox {
  margin-top: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
}

.competitorPicker {
  display: grid;
  gap: 8px;
}

.competitorPicker > span {
  color: #52627a;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.15;
}

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

.competitorAddRow input {
  min-height: 34px;
  border: 1px solid #d5deec;
  border-radius: 8px;
  background: #ffffff;
  color: #101827;
  padding: 0 10px;
  font-size: 13px;
  font-weight: 400;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.competitorAddRow input:focus {
  border-color: #b8cdf8;
  box-shadow: 0 0 0 3px rgba(47, 107, 255, 0.1);
}

.competitorAddRow input::placeholder {
  color: #6b778c;
  font-size: 13px;
  font-weight: 400;
}

.filter-button.competitor-add-button {
  width: 100%;
  min-height: 34px;
  border: 1px solid #b8cdf8;
  border-radius: 8px;
  background: rgba(47, 107, 255, 0.06);
  color: #155eef;
  padding: 0 9px;
  font-size: 12px;
  font-weight: 500;
  justify-content: center;
}

.filter-button.competitor-add-button:disabled {
  border-color: #d8e0eb;
  background: #f6f8fb;
  color: #9aa8ba;
  cursor: default;
  opacity: 1;
}

.competitorChipList {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.competitor-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 24px;
  border: 1px solid #dfe6ef;
  border-radius: 999px;
  background: #f8fbff;
  color: #26364d;
  padding: 3px 5px 3px 9px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.2;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.competitor-chip:hover {
  border-color: #b8cdf8;
  background: #eef6ff;
  color: #155eef;
}

.competitor-chip button {
  display: grid;
  place-items: center;
  width: 18px;
  min-height: 18px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #66758d;
  padding: 0;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.competitor-chip button:hover,
.competitor-chip button:focus-visible {
  background: #ffffff;
  color: #155eef;
  transform: scale(1.06);
  outline: none;
}

.competitor-chip svg {
  width: 12px;
  height: 12px;
}

.merchant-tags .price-type-tag {
  color: #155eef;
  background: #edf4ff;
}

.merchant-tags .price-type-tag.floating {
  color: #7a3b00;
  background: #fff4e5;
}

.premium-line {
  display: block;
  flex-basis: 100%;
  margin-top: 2px;
  color: #66758d;
  font-size: 11px;
  font-style: normal;
  font-weight: 400;
  white-space: nowrap;
}

.filter-button.filter-apply-button {
  justify-content: center;
  width: 100%;
  min-height: 34px;
  margin-top: 10px;
  border: 1px solid #9dbcf7;
  border-radius: 8px;
  background: #eaf1ff;
  color: #155eef;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 700;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.filter-button.filter-apply-button:hover,
.filter-button.filter-apply-button:focus-visible {
  border-color: #7da2ff;
  background: #ddeaff;
  transform: translateY(-1px);
  outline: none;
}

.filter-button.filter-apply-button:disabled {
  border-color: #d8e0eb;
  background: #f6f8fb;
  color: #9aa8ba;
  cursor: default;
  opacity: 1;
  transform: none;
}

label {
  display: grid;
  gap: 6px;
  margin: 0;
}

.autoMarket {
  display: grid;
  align-content: center;
  gap: 5px;
  min-height: 62px;
  padding: 10px 12px;
  border: 1px solid #bdebd8;
  border-radius: 8px;
  background: #f6fffb;
}

.autoMarket span {
  color: var(--muted);
  font-size: 13px;
}

.autoMarket strong {
  color: #0b4f39;
  font-size: 14px;
}

.switchRow {
  margin-top: 14px;
}

.switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-soft);
  color: #2d4165;
  font-weight: 700;
}

.switch input {
  width: auto;
  min-height: auto;
}

.workspaceGrid {
  display: grid;
  grid-template-columns: minmax(360px, 650px) minmax(500px, 500px);
  gap: 14px;
  align-items: start;
}

.panelHead {
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.orderbookPanel {
  justify-self: start;
  width: 100%;
  max-width: 650px;
  overflow: hidden;
  padding: 0;
  border-radius: 8px;
  box-shadow: none;
}

.logsPanel {
  justify-self: start;
  width: 500px;
  max-width: 100%;
  overflow: hidden;
  padding: 0;
  border-color: #dfe6ef;
  border-radius: 8px;
  box-shadow: none;
}

.orderbookPanel .panelHead {
  margin-bottom: 0;
  border-bottom: 1px solid #e7edf5;
  padding: 13px 14px;
}

.logsPanel .panelHead {
  margin-bottom: 0;
  border-bottom: 1px solid #e7edf5;
  padding: 13px 14px;
}

.logsPanel .panelHead > div {
  order: 1;
}

.logsPanel .logs-update-label {
  order: 3;
}

.logsPanel .panelHead p {
  display: none;
}

.orderbookHead h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-right: auto;
}

.book-request-label,
.book-change-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #66758d;
  font-size: 13px;
}

.filters {
  display: grid;
  gap: 12px;
  align-items: end;
}

.book-settings {
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  padding: 8px 10px;
  border-bottom: 1px solid #edf1f6;
}

.book-ad-filter {
  display: grid;
  gap: 4px;
  color: #66758d;
  font-size: 12px;
  font-weight: 500;
}

.book-select-wrap {
  position: relative;
  display: block;
}

.book-ad-filter select {
  width: 100%;
  min-height: 30px;
  appearance: none;
  -webkit-appearance: none;
  color: #18212f;
  font-size: 12px;
  padding-right: 34px;
}

.book-select-arrow {
  position: absolute;
  top: 50%;
  right: 9px;
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
  color: #18212f;
  pointer-events: none;
  transform: translateY(-50%) rotate(-90deg);
  transition: transform 180ms ease, color 180ms ease;
}

.book-select-wrap.select-open .book-select-arrow {
  color: #155eef;
  transform: translateY(-50%) rotate(0deg);
}

.settings-pills {
  display: flex;
  align-items: end;
  gap: 5px;
  min-width: 0;
}

.settings-pills .pill {
  min-height: 30px;
  padding: 0 8px;
  font-size: 12px;
  white-space: nowrap;
}

.settings-pills .mode-pill {
  min-height: 30px;
  max-width: 42%;
  overflow: hidden;
  padding: 0 7px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mode-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 7px;
  background: #eef6ff;
  color: #155eef;
  padding: 0 6px;
  font-size: 11px;
  font-weight: 500;
}

.panel-menu-wrap {
  position: relative;
  z-index: 20;
}

.filter-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 30px;
  border: 1px solid #cfd8e6;
  border-radius: 8px;
  background: #ffffff;
  color: #18212f;
  cursor: pointer;
  padding: 0 8px;
  font-size: 12px;
  font-weight: 700;
}

.chip,
.counter {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 8px;
  background: var(--blue-soft);
  color: #0757ff;
  font-weight: 700;
}

.chip.danger {
  background: var(--red-soft);
  color: var(--red);
}

.chip.active {
  border: 1px solid #b9ceff;
}

.counter {
  border-radius: 10px;
}

.orderbook-list {
  display: grid;
  max-height: min(calc(100vh - 245px), 1500px);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.orderbook-list,
.logs {
  scrollbar-width: thin;
  scrollbar-color: transparent transparent;
}

.log-empty {
  padding: 14px;
}

.orderbook-list::-webkit-scrollbar,
.logs::-webkit-scrollbar {
  width: 4px;
}

.orderbook-list::-webkit-scrollbar-track,
.logs::-webkit-scrollbar-track {
  background: transparent;
}

.orderbook-list::-webkit-scrollbar-thumb,
.logs::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgb(174 185 200 / 0%);
  transition: background 180ms ease;
}

.orderbook-list:hover,
.logs:hover {
  scrollbar-color: #aeb9c8 transparent;
}

.orderbook-list:hover::-webkit-scrollbar-thumb,
.logs:hover::-webkit-scrollbar-thumb {
  background: rgb(174 185 200 / 92%);
}

.region-note {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px 14px 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: #f1f4f8;
  color: #18212f;
  font-size: 13px;
}

.region-note svg {
  flex: 0 0 auto;
}

.orderbook-empty {
  display: grid;
  place-items: center;
  min-height: 112px;
  margin: 0;
  color: #66758d;
  font-size: 13px;
  text-align: center;
}

.ad-row {
  display: grid;
  grid-template-columns: minmax(220px, 1.2fr) minmax(110px, 0.55fr) minmax(210px, 1fr) minmax(190px, 0.95fr) 74px;
  gap: 14px;
  align-items: center;
  min-height: 86px;
  padding: 13px 14px;
  border-bottom: 1px solid #edf1f6;
  text-align: left;
}

.ad-row.watched {
  background: #fffaf0;
}

.ad-row:last-child {
  border-bottom: 0;
}

.merchant-cell,
.amount-cell,
.payment-cell,
.action-cell {
  min-width: 0;
}

.merchant-line {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.merchant-line strong,
.merchant-link {
  overflow: hidden;
  color: #07111f;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.merchant-link:hover {
  color: #07111f;
  text-decoration: underline;
  text-decoration-color: currentColor;
  text-underline-offset: 3px;
}

.online-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: #18b26b;
  box-shadow: 0 0 0 2px #e8fff3;
}

.auth-badge {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  display: block;
  object-fit: contain;
}

.merchant-stats {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  color: #66758d;
  font-size: 12px;
}

.merchant-stats i {
  width: 1px;
  height: 11px;
  background: #b8c2d2;
}

.merchant-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.merchant-tags span {
  border-radius: 3px;
  background: #fff0f0;
  color: #f04455;
  padding: 2px 5px;
  font-size: 11px;
  font-weight: 500;
}

.price-cell {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 7px;
}

.price-main-line {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: baseline;
  gap: 7px;
  white-space: nowrap;
}

.price-cell strong {
  color: #07111f;
  font-size: 22px;
  font-weight: 600;
  line-height: 1;
}

.price-cell span {
  color: #07111f;
  font-size: 13px;
}

.amount-cell {
  display: grid;
  gap: 7px;
}

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

.amount-cell strong {
  color: #07111f;
  font-weight: 500;
  font-size: 13px;
}

.amount-cell span {
  color: #07111f;
  font-size: 13px;
}

.payment-cell {
  display: grid;
  gap: 6px;
}

.payment-line {
  position: relative;
  color: #07111f;
  font-size: 13px;
  line-height: 1.2;
  padding-left: 10px;
}

.payment-line::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.2em;
  width: 2px;
  height: 0.9em;
  background: #ff9f2d;
}

.payment-line.color-1::before {
  background: #12b76a;
}

.payment-line.color-2::before {
  background: #f04455;
}

.action-cell {
  display: grid;
  justify-items: center;
  align-items: center;
}

.pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 7px;
  font-size: 11px;
  font-weight: 600;
}

.side-0 {
  color: #067647;
  background: #ecfdf3;
}

.side-1 {
  color: #b42318;
  background: #fef3f2;
}

.orderbookPanel .ad-row {
  grid-template-columns: minmax(170px, 1fr) minmax(128px, 0.62fr) minmax(168px, 0.86fr);
  gap: 14px;
  min-height: 72px;
  padding: 10px 12px;
}

.ownAdBlock .own-ad-row {
  grid-template-columns:
    minmax(112px, 0.58fr)
    minmax(254px, 1.08fr)
    minmax(200px, 0.9fr)
    minmax(136px, 0.64fr)
    minmax(148px, 0.76fr)
    minmax(98px, 0.48fr)
    minmax(112px, 0.5fr)
    34px
    42px;
  gap: 13px;
  min-height: 82px;
  padding: 32px 48px 12px 14px;
}

.orderbookPanel .payment-cell,
.orderbookPanel .action-cell,
.ownAdBlock .action-cell {
  display: none;
}

.orderbookPanel .price-cell,
.ownAdBlock .price-cell {
  min-width: 0;
  justify-content: flex-end;
}

.ownAdBlock .price-cell {
  justify-self: end;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 4px;
}

.ownAdBlock .premium-line {
  flex-basis: auto;
  margin-top: 0;
}

.ownAdBlock .amount-cell {
  padding-left: 10px;
}

.ownAdBlock .own-ad-status-cell strong {
  overflow: visible;
  text-overflow: clip;
}

.ownAdBlock .merchant-tags {
  flex-wrap: nowrap;
  overflow: visible;
}

.ownAdBlock .merchant-tags span {
  flex: 0 0 auto;
  white-space: nowrap;
}

@container (max-width: 1320px) {
  .ownAdBlock .own-ad-row {
    grid-template-areas:
      "direction telemetry merchant price filter toggle"
      "direction amount payment status filter toggle";
    grid-template-columns:
      minmax(106px, 0.74fr)
      minmax(240px, 1.28fr)
      minmax(184px, 0.94fr)
      minmax(132px, 0.7fr)
      34px
      42px;
    gap: 8px 14px;
    align-items: center;
    padding-right: 46px;
  }

  .ownAdBlock .own-ad-direction {
    grid-area: direction;
  }

  .ownAdBlock .own-ad-telemetry-cell {
    grid-area: telemetry;
  }

  .ownAdBlock .merchant-cell {
    grid-area: merchant;
  }

  .ownAdBlock .price-cell {
    grid-area: price;
  }

  .ownAdBlock .amount-cell {
    grid-area: amount;
    padding-left: 0;
  }

  .ownAdBlock .payment-cell {
    grid-area: payment;
  }

  .ownAdBlock .own-ad-status-cell {
    grid-area: status;
  }

  .ownAdBlock .own-filter-cell {
    grid-area: filter;
  }

  .ownAdBlock .own-toggle-cell {
    grid-area: toggle;
  }
}

.orderbookPanel .price-cell strong,
.ownAdBlock .price-cell strong {
  font-size: 17px;
  white-space: nowrap;
}

.orderbookPanel .amount-cell strong,
.orderbookPanel .amount-cell span,
.ownAdBlock .amount-cell strong,
.ownAdBlock .amount-cell span {
  font-size: 12px;
  white-space: normal;
  overflow-wrap: anywhere;
}

.ownAdBlock .merchant-stats,
.ownAdBlock .merchant-tags,
.ownAdBlock .payment-cell,
.ownAdBlock .own-info-cell {
  overflow: hidden;
}

.logs {
  display: grid;
  gap: 12px;
  min-width: 0;
  max-height: min(1120px, calc(100vh - 260px));
  padding: 12px 10px 14px 14px;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.log {
  display: grid;
  gap: 9px;
  min-width: 0;
  max-width: 100%;
  padding: 14px 16px;
  border: 1px solid #dfe6ef;
  border-radius: 15px;
  background: #ffffff;
  box-shadow: 0 8px 18px rgba(24, 33, 47, 0.04);
  overflow-wrap: anywhere;
  word-break: break-word;
}

.log > div {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.log::before {
  content: "Завершена";
  width: fit-content;
  padding: 3px 8px;
  border-radius: 7px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 12px;
  font-weight: 400;
}

.log.fail::before {
  content: "Ошибка";
  background: var(--red-soft);
  color: var(--red);
}

.logMeta {
  padding-top: 6px;
  border-top: 1px solid var(--line-soft);
}

.logsPanel .panelHead h2 {
  font-weight: 400;
}

@media (max-width: 1050px) {
  .workspaceGrid,
  .filterSummaryGrid {
    grid-template-columns: 1fr;
  }

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

  .settingsActions {
    justify-content: flex-start;
    flex-wrap: wrap;
    width: 100%;
  }

  .adIdField {
    width: min(300px, 100%);
  }

  .ad-row,
  .orderbookPanel .ad-row,
  .ownAdBlock .ad-row {
    grid-template-areas: none;
    grid-template-columns: 1fr;
    align-items: start;
  }

  .ownAdBlock .own-ad-row > * {
    grid-area: auto;
  }

  .price-cell,
  .orderbookPanel .price-cell,
  .ownAdBlock .price-cell,
  .amount-cell,
  .payment-cell {
    grid-column: auto;
    justify-content: flex-start;
  }
}

@media (max-width: 760px) {
  .shell {
    padding: 14px;
  }

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

  .headerRight {
    flex-wrap: wrap;
    width: 100%;
    margin-left: 0;
  }

  .headerStatus,
  .accountStatus {
    flex: 1 1 260px;
    max-width: none;
  }

  h1 {
    font-size: 26px;
  }

}
