/* Orbit Ads · Yandex Direct Pro Modules CSS */

.yd-auction-cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 170px;
}

.yd-auction-tiers {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.yd-tier-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  background: var(--bg-soft, #f1f5f9);
  color: var(--text, #0f172a);
  border: 1px solid var(--border, #e2e8f0);
  white-space: nowrap;
}

.yd-tier-chip .tv {
  color: var(--muted, #64748b);
  font-weight: 500;
}

.yd-tier-chip.hit {
  background: rgba(22, 163, 74, 0.12);
  border-color: rgba(22, 163, 74, 0.35);
  color: #15803d;
}

.yd-tier-warn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  background: rgba(220, 38, 38, 0.1);
  color: #b91c1c;
  width: fit-content;
}

.yd-funds-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
}

.yd-funds-badge.ok {
  background: rgba(22, 163, 74, 0.12);
  color: #15803d;
}

.yd-funds-badge.blocked {
  background: rgba(220, 38, 38, 0.14);
  color: #b91c1c;
}

.yd-preview-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 10px 0;
}

.yd-preview-stat {
  background: var(--bg-soft, #f8fafc);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 10px;
  padding: 8px 10px;
}

.yd-preview-stat .lbl {
  font-size: 11px;
  color: var(--muted, #64748b);
  display: block;
}

.yd-preview-stat .val {
  font-size: 14px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  margin-top: 2px;
}

.yd-diff-table-wrap {
  max-height: 240px;
  overflow: auto;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 10px;
  margin-top: 8px;
}

.yd-diff-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.yd-diff-table th,
.yd-diff-table td {
  padding: 6px 8px;
  border-bottom: 1px solid var(--border, #e2e8f0);
  text-align: left;
}

.yd-diff-table th {
  position: sticky;
  top: 0;
  background: var(--bg-soft, #f8fafc);
  font-size: 11px;
  color: var(--muted, #64748b);
}

.yd-warn-box {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.45);
  color: #92400e;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 12px;
  line-height: 1.45;
}

.yd-danger-box {
  background: rgba(220, 38, 38, 0.08);
  border: 1px solid rgba(220, 38, 38, 0.35);
  color: #991b1b;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 12px;
  line-height: 1.45;
}

/* Yandex SERP live preview card (Release 2) */
.yd-serp-card {
  background: #ffffff;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 12px;
  padding: 14px 16px;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.yd-serp-title {
  color: #0b57d0;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.3;
  word-break: break-word;
}

.yd-serp-url-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 3px;
  font-size: 12px;
  color: #16a34a;
}

.yd-serp-ad-badge {
  font-size: 10px;
  font-weight: 700;
  color: #475569;
  background: #f1f5f9;
  padding: 1px 5px;
  border-radius: 4px;
}

.yd-serp-text {
  margin-top: 6px;
  font-size: 13px;
  line-height: 1.45;
  color: #1e293b;
  word-break: break-word;
}

.yd-serp-sitelinks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: 8px;
}

.yd-serp-sitelink {
  font-size: 12px;
  color: #0b57d0;
  text-decoration: none;
}

.yd-serp-callouts {
  margin-top: 6px;
  font-size: 12px;
  color: #64748b;
}

/* Chips & presets (Release 2 & 3) */
.yd-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.yd-preset-chip {
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid var(--border, #cbd5e1);
  background: var(--surface, #fff);
  color: var(--text, #0f172a);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}

.yd-preset-chip.active,
.yd-preset-chip:hover {
  border-color: var(--dark, #0f172a);
  background: var(--bg-soft, #f1f5f9);
}

.yd-char-meter {
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  color: var(--muted, #64748b);
}

.yd-char-meter.over {
  color: #dc2626;
  font-weight: 700;
}

@media (max-width: 720px) {
  .yd-preview-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Direct & Search Queries High-Density Table Classes */
.yd-col-check { width: 36px; }
.yd-col-act { width: 48px; }
.yd-title { font-weight: 700; color: var(--text); }
.yd-sub { font-size: 11px; }
.yd-sub-600 { font-weight: 600; font-size: 12px; }
.yd-mono { font-weight: 700; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.yd-pill-sm { font-size: 11px; }
.yd-pill-xs { font-size: 10px; padding: 1px 6px; }
.yd-btn-sm { padding: 4px 8px; }
.yd-btn-gap { padding: 4px 7px; margin-right: 4px; }
.yd-cell-nowrap { white-space: nowrap; }
.yd-ad-col { max-width: 420px; }
.yd-ad-text { font-size: 12px; margin-top: 2px; }
.yd-ad-link-wrap { margin-top: 4px; font-size: 11px; }
.yd-ad-link { color: var(--dark); text-decoration: underline; }
.yd-flex-gap4 { display: flex; gap: 4px; flex-wrap: wrap; }
.yd-mt2 { margin-top: 2px; }
.yd-mt3 { margin-top: 3px; }
.yd-auto-hint { font-size: 10px; }
.yd-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  font-size: 12px;
  color: var(--muted);
  flex-wrap: wrap;
  gap: 10px;
}
.yd-footer-nav { gap: 8px; align-items: center; }
.yd-page-btn { padding: 4px 10px; font-size: 12px; }
.yd-sq-filter-card { padding: 12px 14px; margin-bottom: 10px; }
.yd-sq-filter-row { gap: 8px; flex-wrap: wrap; align-items: center; }
.yd-sq-filter-row2 { gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 10px; }
.yd-sq-camp-sel { max-width: 220px; }
.yd-sq-date { width: 140px; }
.yd-sq-search { max-width: 220px; }
.yd-sq-totals { font-size: 12px; }
.yd-sq-waste { color: #b91c1c; }
.yd-sq-empty { text-align: center; padding: 12px; }
.yd-sq-s2s-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid #86efac;
  background: #f0fdf4;
  color: #166534;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  vertical-align: middle;
  transition: background .12s ease, border-color .12s ease, transform .12s ease;
}
.yd-sq-s2s-pill:hover {
  background: #dcfce7;
  border-color: #22c55e;
  color: #14532d;
}
.yd-sq-s2s-pill .money-cell-tabular { display: inline-flex; align-items: center; }
.yd-sq-s2s-arrow { font-size: 11px; opacity: .75; }
.yd-s2s-kw-btn {
  background: none;
  border: 0;
  padding: 0;
  text-align: left;
  cursor: pointer;
  color: #0b57d0;
  font: inherit;
}
.yd-s2s-kw-btn:hover code {
  text-decoration: underline;
  color: #111111;
}

.analytics-filter-bar {
  margin: 0 24px 12px 24px;
  padding: 10px 14px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
}
.analytics-filter-input {
  max-width: 190px;
  font-size: 12px;
  padding: 5px 9px;
}
.analytics-min-spent {
  max-width: 120px;
  font-size: 12px;
  padding: 5px 9px;
}
.analytics-bulk-bar {
  margin: 0 24px 12px 24px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
}
.analytics-status-btn {
  border: 0;
  cursor: pointer;
  transition: opacity .12s ease, transform .12s ease;
}
.analytics-status-btn:hover:not(:disabled) {
  opacity: .82;
}
.analytics-status-btn:disabled {
  cursor: default;
  opacity: .65;
}
.analytics-inline-val-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 7px;
  padding: 3px 6px;
  cursor: pointer;
  font: inherit;
  color: inherit;
  transition: background .12s ease, border-color .12s ease;
}
.analytics-inline-val-btn:hover:not(:disabled) {
  background: #f1f5f9;
  border-color: #cbd5e1;
}
.analytics-inline-val-btn .edit-hint {
  opacity: .4;
  display: inline-flex;
}
.analytics-inline-val-btn:hover .edit-hint {
  opacity: .95;
}
.analytics-diff-table th,
.analytics-diff-table td {
  padding: 6px 8px;
  font-size: 12px;
}
#analytics-grid-card table,
#direct-table-card table,
#yd-sq-grid-card table {
  table-layout: auto;
  width: 100%;
}

#yd-sq-grid-card th, #yd-sq-grid-card td { padding: 8px 10px; }
.yd-sq-query-col { max-width: 340px; min-width: 220px; white-space: normal; word-break: break-word; }
.yd-sq-query-col .yd-sub-600 { word-break: break-word; }

/* Compact Keyword Negative Words & Cascade Chips */
th.yd-kw-col,
td.yd-kw-col {
  width: 320px;
  max-width: 360px;
  min-width: 210px;
  white-space: normal;
  word-break: break-word;
  vertical-align: top;
}

.yd-kw-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: 350px;
}

.yd-kw-head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px;
}

.yd-kw-base {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
  word-break: break-word;
}

.yd-kw-neg-btn {
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  font-size: 11px;
  font-weight: 700;
  border-radius: 999px;
  border: 1px solid var(--border, #cbd5e1);
  background: var(--bg-soft, #f8fafc);
  color: var(--muted, #475569);
  cursor: pointer;
  line-height: 1.35;
  white-space: nowrap;
}

.yd-kw-neg-btn:hover,
.yd-kw-neg-btn.active {
  border-color: var(--dark, #111111);
  background: var(--accent, #d8ff06);
  color: #111111;
}

.yd-kw-neg-list {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin-top: 2px;
  max-width: 340px;
}

.yd-filter-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.yd-cascade-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid var(--dark, #111111);
  background: #ffffff;
  color: var(--text, #111111);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.yd-cascade-chip:hover {
  background: #fef2f2;
  border-color: #dc2626;
  color: #991b1b;
}

.yd-sq-cascade-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  margin-bottom: 10px;
  background: #f8fafc;
  border: 1px solid var(--border, #cbd5e1);
  border-radius: 10px;
  font-size: 12px;
}

.sem-col-direct {
  width: 230px;
}

.sem-direct-cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-start;
}

.sem-direct-jump {
  background: none;
  border: 0;
  padding: 0;
  color: #0b57d0;
  font-size: 11px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  text-decoration: underline;
}

.sem-direct-jump:hover {
  color: #111111;
}

/* Universal Table Columns Gear & Drawer (OrbitTableColumns) */
.otc-gear-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 32px;
  padding: 0 10px;
  font-size: 12px;
  white-space: nowrap;
}
.otc-gear-btn.is-custom {
  border-color: #111111;
  background: #f8fafc;
}
.otc-gear-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(17, 17, 17, 0.08);
  color: #334155;
  font-variant-numeric: tabular-nums;
}
.otc-drawer-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 8px;
}
.otc-section-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted, #64748b);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 6px;
}
.otc-presets-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.otc-preset-pill {
  cursor: pointer;
  padding: 4px 10px;
  font-size: 11px;
}
.otc-user-preset-wrap {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}
.otc-preset-del {
  border: none;
  background: transparent;
  color: #dc2626;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 0 4px;
}
.otc-save-preset-row {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}
.otc-save-preset-row input {
  flex: 1;
  min-width: 0;
  height: 30px;
  font-size: 12px;
}
.otc-save-preset-row button {
  height: 30px;
  padding: 0 10px;
  font-size: 11px;
  white-space: nowrap;
}
.otc-controls-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.otc-controls-row input {
  flex: 1;
  min-width: 0;
  height: 32px;
  font-size: 12px;
}
.otc-pin-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  cursor: pointer;
  user-select: none;
}
.otc-col-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  max-height: 46vh;
  overflow-y: auto;
  padding-right: 2px;
}
.otc-col-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border: 1px solid var(--line, #e2e8f0);
  border-radius: 8px;
  background: #fafafa;
  opacity: 0.72;
  transition: background 0.12s ease, opacity 0.12s ease;
}
.otc-col-row.is-on {
  background: #ffffff;
  opacity: 1;
}
.otc-col-check-label {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
  cursor: pointer;
  margin: 0;
}
.otc-col-title {
  font-size: 12px;
  font-weight: 600;
  color: #111111;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.otc-col-group {
  font-size: 10px;
  color: #64748b;
  background: #f1f5f9;
  padding: 2px 6px;
  border-radius: 999px;
  white-space: nowrap;
}
.otc-drawer-actions {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 4px;
}
.otc-table-pin-first th.otc-first-col,
.otc-table-pin-first td.otc-first-col {
  position: sticky;
  left: 0;
  z-index: 2;
  background: #ffffff;
  box-shadow: 2px 0 6px -2px rgba(15, 23, 42, 0.08);
}
.otc-table-pin-first thead th.otc-first-col {
  z-index: 4;
  background: #f8fafc;
}

/* Analytics Cascade Chips & Scope Badge */
.analytics-cascade-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 24px 10px 24px;
}
.analytics-scope-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: #d8ff06;
  color: #111111;
  border: 1px solid #111111;
}
.analytics-jump-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 26px;
  padding: 0 10px;
  font-size: 11px;
  font-weight: 600;
}

.analytics-ad-title-row {
  display: flex;
  align-items: flex-start;
  gap: 6px;
}

.analytics-ad-edit-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border-radius: 6px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted, #64748b);
  cursor: pointer;
  flex-shrink: 0;
  transition: background .12s ease, color .12s ease, border-color .12s ease;
}

.analytics-ad-edit-btn:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #111111;
}

/* Pro Ad Editor Drawer (Stage 2) */
.drawer.yd-pro-drawer {
  width: min(760px, 100%);
  padding: 24px 26px;
  gap: 16px;
}

.yd-pro-ad-meta-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.yd-vp-btn {
  border: 0;
  background: transparent;
  padding: 4px 10px;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted, #64748b);
  cursor: pointer;
}

.yd-vp-btn.active {
  background: #111111;
  color: #d8ff06;
}

.yd-serp-card.is-mobile {
  max-width: 380px;
  border-radius: 16px;
  border-color: #cbd5e1;
}

.yd-serp-price-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 6px;
  font-variant-numeric: tabular-nums;
}

.yd-serp-price-main {
  font-size: 14px;
  font-weight: 700;
  color: #111111;
}

.yd-serp-price-old {
  font-size: 12px;
  color: #94a3b8;
  text-decoration: line-through;
}

.yd-serp-price-disc {
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 999px;
  background: #dcfce7;
  color: #15803d;
}

.yd-serp-sitelinks-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 14px;
  margin-top: 8px;
}

.yd-serp-sl-item {
  min-width: 0;
}

.yd-serp-sl-desc {
  font-size: 11px;
  color: #64748b;
  line-height: 1.35;
  margin-top: 1px;
  word-break: break-word;
}

.yd-serp-sitelinks.is-mobile {
  flex-wrap: nowrap;
  overflow-x: auto;
  gap: 6px;
  padding-bottom: 2px;
}

.yd-serp-sitelinks.is-mobile .yd-serp-sitelink {
  padding: 3px 9px;
  border-radius: 999px;
  background: #f1f5f9;
  white-space: nowrap;
  font-size: 11px;
}

.yd-pro-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  border-bottom: 1px solid var(--border, #e2e8f0);
  padding-bottom: 10px;
}

.yd-pro-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border, #cbd5e1);
  background: #ffffff;
  color: var(--text, #0f172a);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.yd-pro-tab.active {
  background: #d8ff06;
  border-color: #111111;
  color: #111111;
}

.yd-pro-tab-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.08);
  font-variant-numeric: tabular-nums;
}

.yd-field-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.yd-link-btn {
  border: 0;
  background: transparent;
  padding: 0;
  color: #0b57d0;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}

.yd-link-btn:hover {
  text-decoration: underline;
}

.yd-utm-box {
  background: var(--bg-subtle, #f8fafc);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 10px;
  padding: 10px 12px;
}

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

.yd-sl-card {
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 10px;
  padding: 10px;
  background: #ffffff;
}

.yd-sl-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.yd-sl-num {
  font-size: 12px;
  font-weight: 700;
}

.yd-sl-act {
  padding: 2px 7px !important;
  font-size: 11px !important;
  height: 24px !important;
}

.yd-sl-inputs {
  display: grid;
  grid-template-columns: 1fr 1.35fr;
  gap: 6px;
}

.yd-co-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.yd-co-chip {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--border, #cbd5e1);
  background: #ffffff;
  color: var(--text, #0f172a);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background .12s ease, border-color .12s ease;
}

.yd-co-chip:hover:not(:disabled) {
  border-color: #111111;
}

.yd-co-chip.active {
  background: #d8ff06;
  border-color: #111111;
  color: #111111;
}

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

.yd-mod-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
}

.yd-mod-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 4px 0;
  border-bottom: 1px dashed var(--border, #e2e8f0);
}

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

.yd-empty-dashed {
  border: 1px dashed var(--border, #cbd5e1);
  border-radius: 10px;
  padding: 16px;
  text-align: center;
  font-size: 13px;
  background: #fafafa;
}

.yd-pro-ad-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--border, #e2e8f0);
  position: sticky;
  bottom: 0;
  background: #ffffff;
}

.yd-ad-dirty-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  background: #fef9c3;
  border: 1px solid #facc15;
  color: #854d0e;
  font-size: 11px;
  font-weight: 600;
}

@media (max-width: 640px) {
  .yd-utm-grid,
  .yd-sl-inputs,
  .yd-price-grid,
  .yd-serp-sitelinks-grid {
    grid-template-columns: 1fr;
  }
}

/* Stage 3: Media Library, VCards, SERP Thumbnail & Bulk Ad Editor */
.yd-serp-main-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.yd-serp-body {
  flex: 1;
  min-width: 0;
}

.yd-serp-thumb {
  width: 82px;
  height: 82px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--border, #e2e8f0);
  flex-shrink: 0;
}

.yd-serp-vcard {
  margin-top: 6px;
  font-size: 11px;
  color: #475569;
  padding-top: 5px;
  border-top: 1px dashed var(--border, #e2e8f0);
}

.yd-media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
}

.yd-media-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border, #cbd5e1);
  border-radius: 10px;
  background: #ffffff;
  overflow: hidden;
  padding: 0;
  text-align: left;
  cursor: pointer;
  transition: border-color .12s ease, box-shadow .12s ease;
}

.yd-media-card.is-static {
  cursor: default;
}

.yd-media-card.active {
  border-color: #111111;
  box-shadow: 0 0 0 2px #d8ff06;
}

.yd-media-thumb-wrap {
  width: 100%;
  height: 88px;
  background: #f1f5f9;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.yd-media-thumb-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.yd-media-meta {
  padding: 6px 8px;
}

.yd-media-name {
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.yd-upload-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.yd-upload-row input[type="file"] {
  flex: 1;
  min-width: 180px;
  font-size: 12px !important;
}

.yd-inline-chk {
  display: inline-flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  margin: 0;
}

.yd-inline-chk input[type="checkbox"] {
  width: auto !important;
  margin: 0;
}

/* Single-line Search Query Criteria & Bidirectional Lineage Navigation */
.yd-sq-meta-wrap {
  margin-top: 3px;
  max-width: 340px;
}

.yd-sq-meta-line {
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  overflow: hidden;
  font-size: 11px;
  line-height: 1.3;
  color: var(--muted, #64748b);
}

.yd-sq-crit-text {
  display: inline-block;
  max-width: 175px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-weight: 600;
  color: var(--text, #0f172a);
  vertical-align: bottom;
}

.yd-sq-exact-tag {
  display: inline-flex;
  align-items: center;
  padding: 0 5px;
  border-radius: 4px;
  background: #f1f5f9;
  color: #475569;
  font-size: 10px;
  font-weight: 600;
  flex-shrink: 0;
}

.yd-sq-sep {
  opacity: 0.55;
  flex-shrink: 0;
}

.yd-sq-camp-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 130px;
}

.yd-entity-link {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  color: var(--muted, #64748b);
  font: inherit;
  font-size: 11px;
  cursor: pointer;
  text-align: left;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color .12s ease;
}

.yd-entity-link.yd-sub-600 {
  font-size: 12px;
  font-weight: 600;
  color: var(--text, #0f172a);
}

.yd-entity-link:hover {
  color: #0b57d0;
  text-decoration: underline;
}

.yd-peek-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1px 6px;
  border-radius: 6px;
  border: 1px solid var(--border, #cbd5e1);
  background: #f8fafc;
  color: #334155;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
  flex-shrink: 0;
  transition: background .12s ease, border-color .12s ease, color .12s ease;
}

.yd-peek-btn:hover {
  background: #d8ff06;
  border-color: #111111;
  color: #111111;
}

.yd-sub-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 6px;
  margin-top: 2px;
  font-size: 11px;
  color: var(--muted, #64748b);
}

.yd-lineage-section {
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 12px;
  padding: 10px 12px;
  background: #ffffff;
}

.yd-lineage-section.is-focus {
  border-color: #111111;
  box-shadow: 0 0 0 2px rgba(216, 255, 6, 0.55);
}

.yd-lineage-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.yd-lineage-step {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted, #64748b);
}

.yd-lineage-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 220px;
  overflow-y: auto;
}

.yd-lineage-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 9px;
  border-radius: 8px;
  border: 1px solid var(--border, #e2e8f0);
  background: #f8fafc;
  font-size: 12px;
}

.yd-lineage-item.is-focus {
  background: #fefce8;
  border-color: #eab308;
}

/* ── v54: MSK Timezone Badge, Date Presets, ResponsiveAd Variants & Fill Quality ── */
.yd-date-presets {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  background: var(--bg-subtle, #f8fafc);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 10px;
  padding: 3px 6px;
}
.yd-tz-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 999px;
  background: #e0f2fe;
  color: #0369a1;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.yd-date-preset-btn {
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink-muted, #475569);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 7px;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.yd-date-preset-btn:hover {
  background: #ffffff;
  color: var(--ink, #0f172a);
  border-color: var(--border, #cbd5e1);
}
.yd-date-preset-btn.active {
  background: var(--ink, #0f172a);
  color: #ffffff;
}

.yd-fq-card {
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 12px;
  padding: 10px 12px;
  background: var(--bg-subtle, #f8fafc);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.yd-fq-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.yd-fq-bar-track {
  height: 7px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}
.yd-fq-bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width .2s ease, background-color .2s ease;
}
.yd-fq-bar-fill.low { background: #dc2626; }
.yd-fq-bar-fill.medium { background: #d97706; }
.yd-fq-bar-fill.high { background: #16a34a; }
.yd-fq-label.low { color: #b91c1c; font-weight: 700; }
.yd-fq-label.medium { color: #b45309; font-weight: 700; }
.yd-fq-label.high { color: #15803d; font-weight: 700; }
.yd-fq-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 6px;
  border-top: 1px dashed var(--border, #cbd5e1);
}
.yd-fq-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
}
.yd-fq-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  flex-shrink: 0;
}
.yd-fq-dot.low { background: #dc2626; }
.yd-fq-dot.medium { background: #d97706; }
.yd-fq-dot.high { background: #16a34a; }
.yd-fq-mini {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--ink-muted, #64748b);
  margin-top: 2px;
}

.yd-variant-card {
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 10px;
  padding: 9px 10px;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.yd-variant-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
}
.yd-comb-nav {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  background: var(--bg-subtle, #f1f5f9);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 8px;
  padding: 2px 6px;
}
.yd-comb-btn {
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 1px 5px;
  border-radius: 5px;
  font-weight: 700;
  color: var(--ink, #0f172a);
}
.yd-comb-btn:hover { background: #e2e8f0; }
.yd-media-card .yd-media-check {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: #16a34a;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}
.yd-media-card { position: relative; }
