.xkw-center {
  --xkw-accent: #2563eb;
  --xkw-accent-strong: #1d4ed8;
  --xkw-accent-soft: #eff6ff;
  --xkw-text: #172033;
  --xkw-text-secondary: #475569;
  --xkw-muted: #7b8798;
  --xkw-line: #dde5ef;
  --xkw-line-soft: #edf1f6;
  --xkw-surface: #ffffff;
  --xkw-surface-soft: #f8fafc;
  --xkw-selected: #f2f7ff;
  width: 100%;
  min-width: 0;
  color: var(--xkw-text);
  font-family: inherit;
  font-size: 13px;
  line-height: 1.5;
}

.xkw-center *,
.xkw-center *::before,
.xkw-center *::after {
  box-sizing: border-box;
}

.xkw-center button,
.xkw-center input,
.xkw-center textarea {
  font: inherit;
}

.xkw-summary-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 14px;
}

.xkw-summary-card {
  position: relative;
  min-width: 0;
  min-height: 74px;
  padding: 12px 14px;
  overflow: hidden;
  border: 1px solid var(--xkw-line);
  border-radius: 10px;
  background: var(--xkw-surface);
  color: var(--xkw-text);
  text-align: left;
  cursor: pointer;
  transition: border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.xkw-summary-card::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 3px;
  background: transparent;
}

.xkw-summary-card:hover {
  border-color: #b8c8de;
  background: #fbfdff;
  transform: translateY(-1px);
}

.xkw-summary-card:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.16);
  outline-offset: 2px;
}

.xkw-summary-card.is-active {
  border-color: #9eb9f7;
  background: var(--xkw-accent-soft);
  box-shadow: 0 7px 20px rgba(37, 99, 235, 0.08);
}

.xkw-summary-card.is-active::after {
  background: var(--xkw-accent);
}

.xkw-summary-card > span,
.xkw-summary-card > strong {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.xkw-summary-card > span {
  color: var(--xkw-muted);
  font-size: 12px;
  font-weight: 650;
}

.xkw-summary-card > strong {
  margin-top: 5px;
  color: #24344d;
  font-size: 22px;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.xkw-summary-card.is-active > span,
.xkw-summary-card.is-active > strong {
  color: var(--xkw-accent-strong);
}

.xkw-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 58px;
  padding: 10px 12px;
  border: 1px solid var(--xkw-line);
  border-bottom: 0;
  border-radius: 11px 11px 0 0;
  background: var(--xkw-surface);
}

.xkw-filters {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  padding: 3px;
  overflow-x: auto;
  border-radius: 8px;
  background: #f2f5f9;
  scrollbar-width: none;
}

.xkw-filters::-webkit-scrollbar {
  display: none;
}

.xkw-filters button {
  flex: 0 0 auto;
  height: 32px;
  padding: 0 12px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #5e6b7d;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  transition: color 150ms ease, background-color 150ms ease, box-shadow 150ms ease;
}

.xkw-filters button:hover {
  color: #26364d;
  background: rgba(255, 255, 255, 0.65);
}

.xkw-filters button.is-active {
  color: var(--xkw-accent-strong);
  background: var(--xkw-surface);
  box-shadow: 0 1px 4px rgba(29, 45, 72, 0.12);
}

.xkw-filters button:focus-visible {
  outline: 2px solid rgba(37, 99, 235, 0.26);
  outline-offset: 1px;
}

.xkw-search {
  display: flex;
  align-items: center;
  flex: 0 1 310px;
  gap: 8px;
  min-width: 210px;
  height: 38px;
  padding: 0 11px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: var(--xkw-surface);
  color: #8a97a8;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.xkw-search:focus-within {
  border-color: #85a7f4;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.xkw-search > i {
  flex: 0 0 auto;
  font-size: 12px;
}

.xkw-search input {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  min-height: 0;
  height: 100%;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--xkw-text);
  box-shadow: none;
  font-size: 12.5px;
}

.xkw-search input::placeholder {
  color: #99a5b4;
}

.xkw-toolbar-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex: 0 1 440px;
  gap: 8px;
  min-width: 0;
}

.xkw-add-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  gap: 6px;
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid #a9bce5;
  border-radius: 8px;
  background: #fff;
  color: var(--xkw-accent-strong);
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
}

.xkw-add-toggle:hover:not(:disabled),
.xkw-add-toggle.is-active {
  border-color: #7d9feb;
  background: var(--xkw-accent-soft);
}

.xkw-add-toggle:disabled {
  cursor: not-allowed;
  opacity: .58;
}

.xkw-add-panel {
  display: grid;
  grid-template-columns: minmax(220px, .72fr) minmax(320px, 1.28fr);
  gap: 12px 18px;
  margin: 0 0 14px;
  padding: 14px;
  border: 1px solid #b8c9ee;
  border-radius: 10px;
  background: #f7faff;
  box-shadow: 0 8px 24px rgba(37, 99, 235, .06);
}

.xkw-add-copy {
  align-self: start;
}

.xkw-add-copy strong,
.xkw-add-copy span {
  display: block;
}

.xkw-add-copy strong {
  color: #24344d;
  font-size: 14px;
}

.xkw-add-copy span {
  margin-top: 5px;
  color: var(--xkw-muted);
  font-size: 11.5px;
  line-height: 1.65;
}

.xkw-add-panel textarea {
  width: 100%;
  min-height: 94px;
  padding: 10px 12px;
  resize: vertical;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  outline: 0;
  background: var(--xkw-surface);
  color: var(--xkw-text);
  font-size: 12.5px;
  line-height: 1.6;
}

.xkw-add-panel textarea:focus {
  border-color: #85a7f4;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .1);
}

.xkw-add-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  grid-column: 1 / -1;
  gap: 12px;
  padding-top: 10px;
  border-top: 1px solid #dce6f8;
}

.xkw-add-actions small {
  color: var(--xkw-muted);
  font-size: 11px;
}

.xkw-add-actions > div {
  display: flex;
  gap: 8px;
}

.xkw-add-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: var(--xkw-surface);
  color: #475569;
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
}

.xkw-add-actions button.is-primary {
  border-color: var(--xkw-accent);
  background: var(--xkw-accent);
  color: #fff;
}

.xkw-add-actions button:disabled {
  cursor: wait;
  opacity: .62;
}

.xkw-table-shell {
  width: 100%;
  max-height: min(58vh, 680px);
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--xkw-line);
  background: var(--xkw-surface);
  scrollbar-gutter: stable;
  -webkit-overflow-scrolling: touch;
}

.xkw-table {
  width: 100%;
  min-width: 1120px;
  border: 0;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  background: var(--xkw-surface);
  color: var(--xkw-text-secondary);
  font-size: 12px;
}

.xkw-table th,
.xkw-table td {
  min-width: 0;
  padding: 11px 12px;
  border: 0;
  border-bottom: 1px solid var(--xkw-line-soft);
  text-align: left;
  vertical-align: middle;
}

.xkw-table th {
  position: sticky;
  z-index: 2;
  top: 0;
  height: 42px;
  padding-top: 9px;
  padding-bottom: 9px;
  background: #f7f9fc;
  color: #5d6a7b;
  box-shadow: inset 0 -1px var(--xkw-line);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.xkw-table tbody tr {
  background: var(--xkw-surface);
  transition: background-color 140ms ease;
}

.xkw-table tbody tr:hover {
  background: #fafcff;
}

.xkw-table tbody tr.is-selected,
.xkw-table tbody tr.is-selected:hover {
  background: var(--xkw-selected);
}

.xkw-table tbody tr.is-selected td {
  border-bottom-color: #d8e5fb;
}

.xkw-table tbody tr.is-selected td:first-child {
  box-shadow: inset 3px 0 var(--xkw-accent);
}

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

.xkw-table th:nth-child(1),
.xkw-table td:nth-child(1) {
  width: 46px;
}

.xkw-table th:nth-child(2),
.xkw-table td:nth-child(2) {
  width: 180px;
}

.xkw-table th:nth-child(3),
.xkw-table td:nth-child(3) {
  width: 185px;
}

.xkw-table th:nth-child(4),
.xkw-table td:nth-child(4) {
  width: 300px;
}

.xkw-table th:nth-child(5),
.xkw-table td:nth-child(5) {
  width: 175px;
}

.xkw-table th:nth-child(6),
.xkw-table td:nth-child(6) {
  width: 170px;
}

.xkw-table th:nth-child(7),
.xkw-table td:nth-child(7) {
  width: 90px;
}

.xkw-check-cell {
  text-align: center;
}

.xkw-check-cell input[type="checkbox"] {
  display: inline-block;
  width: 15px;
  height: 15px;
  min-width: 15px;
  min-height: 15px;
  margin: 0;
  padding: 0;
  border: 0;
  vertical-align: middle;
  accent-color: var(--xkw-accent);
  cursor: pointer;
}

.xkw-check-cell input[type="checkbox"]:disabled {
  cursor: not-allowed;
  opacity: 0.4;
}

.xkw-check-cell input[type="checkbox"]:focus-visible {
  outline: 2px solid rgba(37, 99, 235, 0.3);
  outline-offset: 2px;
}

.xkw-term,
.xkw-stack {
  min-width: 0;
}

.xkw-term > strong,
.xkw-term > small,
.xkw-stack > strong,
.xkw-stack > span,
.xkw-stack > small {
  display: block;
  min-width: 0;
}

.xkw-term > strong,
.xkw-stack > strong {
  overflow: hidden;
  color: #25344b;
  text-overflow: ellipsis;
}

.xkw-term > strong {
  font-size: 12.5px;
  font-weight: 780;
  line-height: 1.45;
}

.xkw-term > small,
.xkw-stack > small,
.xkw-ranks {
  margin-top: 4px;
  overflow: hidden;
  color: var(--xkw-muted);
  font-size: 10px;
  line-height: 1.45;
  text-overflow: ellipsis;
}

.xkw-stack > strong,
.xkw-stack > span {
  font-size: 11.5px;
  font-weight: 720;
  line-height: 1.45;
}

.xkw-listing-use > strong {
  color: #08795b;
  white-space: normal;
}

.xkw-listing-use > small {
  white-space: normal;
}

.xkw-muted {
  color: #9aa5b4;
  font-weight: 600;
}

.xkw-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
  min-width: 0;
}

.xkw-metrics > span {
  display: block;
  min-width: 0;
  padding: 5px 6px;
  border-radius: 6px;
  background: var(--xkw-surface-soft);
  text-align: center;
}

.xkw-metrics b,
.xkw-metrics small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.xkw-metrics b {
  color: #2f3e55;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
}

.xkw-metrics small {
  margin-top: 1px;
  color: #8b96a5;
  font-size: 9px;
}

.xkw-ranks {
  display: block;
  white-space: nowrap;
}

.xkw-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 56px;
  min-height: 24px;
  padding: 3px 8px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
}

.xkw-status.is-suggested {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
}

.xkw-status.is-prepared {
  border-color: #fed7aa;
  background: #fff7ed;
  color: #c2410c;
}

.xkw-status.is-active {
  border-color: #a7f3d0;
  background: #ecfdf5;
  color: #047857;
}

.xkw-status.is-paused {
  border-color: #d8dee8;
  background: #f3f5f8;
  color: #5d6878;
}

.xkw-status.is-linked,
.xkw-status.is-pending,
.xkw-status.is-unsupported {
  border-color: #d9e0ea;
  background: #f3f5f8;
  color: #596579;
}

.xkw-status.is-negative {
  border-color: #ddd6fe;
  background: #f5f3ff;
  color: #6d28d9;
}

.xkw-status.is-excluded {
  border-color: #fecaca;
  background: #fef2f2;
  color: #b42318;
}

.xkw-status.is-none {
  border-color: #e2e8f0;
  background: #f8fafc;
  color: #64748b;
}

.xkw-empty {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  min-height: 190px;
  padding: 28px;
  color: #8a97a8;
  text-align: center;
}

.xkw-empty > i {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #f1f5f9;
  color: #7d8da2;
  font-size: 18px;
}

.xkw-empty > strong {
  max-width: 36rem;
  color: #657287;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.7;
}

.xkw-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
  padding: 10px 12px 10px 14px;
  border: 1px solid var(--xkw-line);
  border-top: 0;
  border-radius: 0 0 11px 11px;
  background: var(--xkw-surface);
  color: var(--xkw-muted);
  font-size: 11px;
}

.xkw-footer > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.xkw-footer > div {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
}

.xkw-footer > div > small {
  color: #8490a1;
  font-size: 10px;
  white-space: nowrap;
}

.xkw-footer-actions {
  flex-wrap: wrap;
}

.xkw-pagination {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.xkw-pagination > button {
  display: inline-grid;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid var(--xkw-line);
  border-radius: 8px;
  background: var(--xkw-surface);
  color: var(--xkw-text);
  cursor: pointer;
  place-items: center;
}

.xkw-pagination > button:hover:not(:disabled) {
  border-color: var(--xkw-accent);
  color: var(--xkw-accent);
}

.xkw-pagination > button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.xkw-pagination > span {
  min-width: 42px;
  color: var(--xkw-muted);
  text-align: center;
}

.xkw-prepare-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  gap: 7px;
  min-width: 134px;
  min-height: 38px;
  padding: 8px 14px;
  border: 1px solid var(--xkw-accent);
  border-radius: 8px;
  background: var(--xkw-accent);
  color: #ffffff;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 5px 14px rgba(37, 99, 235, 0.15);
  transition: border-color 150ms ease, background-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.xkw-prepare-btn:hover:not(:disabled) {
  border-color: var(--xkw-accent-strong);
  background: var(--xkw-accent-strong);
  box-shadow: 0 7px 18px rgba(37, 99, 235, 0.2);
  transform: translateY(-1px);
}

.xkw-prepare-btn:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.2);
  outline-offset: 2px;
}

.xkw-prepare-btn:disabled {
  border-color: #cfd7e3;
  background: #e7ebf1;
  color: #8995a5;
  cursor: not-allowed;
  box-shadow: none;
}

.dw-product-keyword-summary,
.finished-list-keyword-summary {
  display: flex;
  align-items: center;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  color: #6f7d90;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dw-product-keyword-summary {
  margin-top: 4px;
  font-size: 11px;
  line-height: 16px;
}

.finished-list-keyword-summary {
  margin-top: 3px;
  color: #718096;
  font-size: 9.5px;
  line-height: 14px;
}

.dw-product-keyword-summary > span,
.finished-list-keyword-summary > span {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dw-product-keyword-summary > span + span::before,
.finished-list-keyword-summary > span + span::before {
  content: "\00b7";
  margin: 0 5px;
  color: #b0bac7;
}

body.theme-dark .xkw-center {
  --xkw-text: #e5eaf2;
  --xkw-text-secondary: #c7d0dc;
  --xkw-muted: #94a3b8;
  --xkw-line: #354156;
  --xkw-line-soft: #2d384b;
  --xkw-surface: #1b2535;
  --xkw-surface-soft: #222d3e;
  --xkw-selected: #1d3151;
  --xkw-accent-soft: #1c3154;
}

body.theme-dark .xkw-summary-card > strong,
body.theme-dark .xkw-term > strong,
body.theme-dark .xkw-stack > strong,
body.theme-dark .xkw-metrics b {
  color: #e5eaf2;
}

body.theme-dark .xkw-summary-card:hover,
body.theme-dark .xkw-table tbody tr:hover {
  background: #202c3d;
}

body.theme-dark .xkw-filters,
body.theme-dark .xkw-table th,
body.theme-dark .xkw-empty > i {
  background: #222d3e;
}

body.theme-dark .xkw-filters button:hover,
body.theme-dark .xkw-filters button.is-active {
  background: #2b374a;
  color: #dbeafe;
}

body.theme-dark .xkw-search {
  border-color: #445168;
}

body.theme-dark .xkw-add-panel {
  border-color: #42547a;
  background: #1d2a3e;
}

body.theme-dark .xkw-add-toggle,
body.theme-dark .xkw-add-actions button {
  background: #222d3e;
  color: #dbeafe;
}

body.theme-dark .xkw-add-panel textarea {
  border-color: #445168;
  background: #1b2535;
  color: #e5eaf2;
}

body.theme-dark .xkw-search input {
  color: #e5eaf2;
}

body.theme-dark .dw-product-keyword-summary,
body.theme-dark .finished-list-keyword-summary {
  color: #9aa8ba;
}

@media (max-width: 1180px) {
  .xkw-summary-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .xkw-toolbar {
    align-items: stretch;
    flex-wrap: wrap;
  }

  .xkw-filters {
    flex: 1 1 520px;
  }

  .xkw-search {
    flex: 1 1 260px;
  }

  .xkw-toolbar-right {
    flex: 1 1 360px;
  }
}

@media (max-width: 760px) {
  .xkw-center {
    font-size: 12px;
  }

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

  .xkw-summary-card {
    min-height: 66px;
    padding: 10px 12px;
  }

  .xkw-summary-card > strong {
    font-size: 19px;
  }

  .xkw-toolbar {
    gap: 8px;
    padding: 9px;
  }

  .xkw-filters,
  .xkw-search,
  .xkw-toolbar-right {
    flex-basis: 100%;
    width: 100%;
    min-width: 0;
  }

  .xkw-toolbar-right {
    align-items: stretch;
    flex-direction: column;
  }

  .xkw-add-toggle {
    width: 100%;
  }

  .xkw-add-panel {
    grid-template-columns: 1fr;
  }

  .xkw-add-actions {
    align-items: stretch;
    flex-direction: column;
    grid-column: auto;
  }

  .xkw-add-actions > div,
  .xkw-add-actions button {
    width: 100%;
  }

  .xkw-table-shell {
    max-height: 62vh;
    scrollbar-gutter: auto;
  }

  .xkw-table {
    min-width: 1040px;
  }

  .xkw-footer {
    align-items: stretch;
    flex-direction: column;
    gap: 8px;
    padding: 11px;
  }

  .xkw-footer > span {
    white-space: normal;
  }

  .xkw-footer > div {
    align-items: stretch;
    flex-direction: column;
    gap: 7px;
  }

  .xkw-footer > div > small {
    white-space: normal;
  }

  .xkw-prepare-btn {
    width: 100%;
  }
}

@media (max-width: 430px) {
  .xkw-summary-grid {
    grid-template-columns: 1fr;
  }

  .xkw-summary-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    min-height: 52px;
    gap: 10px;
  }

  .xkw-summary-card > strong {
    margin-top: 0;
    font-size: 18px;
  }

  .xkw-filters button {
    height: 30px;
    padding: 0 10px;
    font-size: 11px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .xkw-summary-card,
  .xkw-filters button,
  .xkw-prepare-btn,
  .xkw-table tbody tr {
    transition: none;
  }

  .xkw-summary-card:hover,
  .xkw-prepare-btn:hover:not(:disabled) {
    transform: none;
  }
}

/* Keyword detail compact toolbar and sticky table · 2026-07-24 */
.xkw-detail-dialog.xkw-kp-shell {
  grid-template-rows: auto auto minmax(0, 1fr) auto;
}

.xkw-kp-shell .kp-tabs {
  min-width: 0;
  flex-wrap: nowrap;
  gap: 14px;
}

.xkw-kp-shell .kp-tablist {
  flex: 0 0 auto;
}

.xkw-kp-shell .kp-tabs .kp-status {
  min-width: 0;
  flex: 1 1 auto;
  flex-wrap: nowrap;
  justify-content: center;
  gap: 9px;
  padding: 0;
  overflow: hidden;
  border: 0;
  color: var(--kp-muted-foreground);
  background: transparent;
  font-size: 12px;
  white-space: nowrap;
}

.xkw-kp-shell .kp-tabs .kp-status-main,
.xkw-kp-shell .kp-tabs .kp-status-time {
  min-width: 0;
  flex: 0 1 auto;
  gap: 8px;
  white-space: nowrap;
}

.xkw-kp-shell .kp-tabs .kp-status-main > i:first-child {
  color: color-mix(in srgb, var(--kp-foreground) 74%, transparent);
}

.xkw-kp-shell .kp-status-separator {
  width: 1px;
  height: 12px;
  flex: 0 0 1px;
  background: var(--kp-input);
}

.xkw-kp-shell .kp-body {
  display: flex;
  min-height: 0;
  flex-direction: column;
  overflow: hidden;
}

.xkw-kp-shell .kp-compactbar {
  display: flex;
  min-width: 0;
  min-height: 48px;
  flex: 0 0 auto;
  align-items: center;
  gap: 9px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--kp-border);
  background: var(--kp-background);
}

.xkw-kp-shell .kp-compactbar .kp-result-title {
  width: 160px;
  flex: 0 0 160px;
  white-space: nowrap;
}

.xkw-kp-shell .kp-compactbar .kp-filters {
  min-width: 0;
  flex: 1 1 auto;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
}

.xkw-kp-shell .kp-compactbar .kp-search {
  width: 340px;
  min-width: 240px;
  max-width: 360px;
  flex: 0 1 340px;
}

.xkw-kp-shell .kp-compactbar .kp-select {
  width: 140px;
  min-width: 0;
  flex: 0 0 140px;
}

.xkw-kp-shell .kp-compactbar .kp-listing-select {
  width: 166px;
  flex-basis: 166px;
}

.xkw-kp-shell .kp-compactbar .kp-form-control,
.xkw-kp-shell .kp-compactbar .kp-form-select,
.xkw-kp-shell .kp-compactbar .kp-btn {
  min-height: 30px;
  border-radius: 8px;
}

.xkw-kp-shell .kp-ranking-note {
  flex: 0 0 auto;
  gap: 5px;
  color: var(--kp-muted-foreground);
  cursor: help;
}

.xkw-kp-shell .kp-table-wrap {
  min-height: 0;
  flex: 1 1 auto;
  overflow: auto;
  overscroll-behavior: contain;
}

.xkw-kp-shell .kp-table {
  border-collapse: separate;
  border-spacing: 0;
}

/* Keep Listing and advertising toolbars as compact as the keyword toolbar. */
.xkw-kp-shell .kp-section-toolbar .kp-result-title {
  width: 178px;
  flex: 0 0 178px;
}

.xkw-kp-shell .kp-section-toolbar .kp-search {
  width: 300px;
  min-width: 210px;
  max-width: 340px;
  flex: 0 1 300px;
}

.xkw-kp-shell .kp-section-toolbar .kp-toolbar-aside {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: flex-end;
  white-space: nowrap;
}

.xkw-kp-shell .kp-section-toolbar .kp-toolbar-note {
  color: var(--kp-muted-foreground);
  font-size: 12px;
  line-height: 16px;
}

.xkw-kp-shell .kp-section-toolbar.is-ads .kp-toolbar-aside .kp-btn {
  min-height: 30px;
  gap: 6px;
  border-radius: 8px;
}

@media (max-width: 1180px) {
  .xkw-kp-shell .kp-section-toolbar .kp-result-title {
    width: 148px;
    flex-basis: 148px;
  }

  .xkw-kp-shell .kp-section-toolbar.is-listing .kp-toolbar-aside {
    display: none;
  }
}

@media (max-width: 760px) {
  .xkw-kp-shell .kp-section-toolbar .kp-toolbar-aside {
    width: 100%;
    justify-content: flex-start;
  }
}

/* Metric explanations work on both hover and click/focus without opening a drawer. */
.xkw-kp-shell .kp-tooltip-trigger {
  position: relative;
}

.xkw-kp-shell .kp-tooltip-trigger[data-tooltip]::after {
  position: absolute;
  z-index: 80;
  top: calc(100% + 7px);
  left: 50%;
  width: max-content;
  max-width: 260px;
  padding: 8px 10px;
  transform: translate(-50%, -2px);
  border: 1px solid var(--kp-border);
  border-radius: 8px;
  background: var(--kp-background);
  box-shadow: 0 10px 24px rgb(15 23 42 / 16%);
  color: var(--kp-foreground);
  content: attr(data-tooltip);
  font-size: 12px;
  font-weight: 400;
  line-height: 18px;
  opacity: 0;
  pointer-events: none;
  text-align: left;
  white-space: normal;
  visibility: hidden;
}

.xkw-kp-shell .kp-tooltip-trigger[data-tooltip]:hover::after,
.xkw-kp-shell .kp-tooltip-trigger[data-tooltip]:focus::after {
  transform: translate(-50%, 0);
  opacity: 1;
  visibility: visible;
}

.xkw-kp-shell .kp-info-btn:hover,
.xkw-kp-shell .kp-info-btn:focus-visible {
  color: var(--kp-foreground);
}

.xkw-kp-shell .kp-ranking-note[data-tooltip]::after {
  right: 0;
  left: auto;
  transform: translateY(-2px);
}

.xkw-kp-shell .kp-ranking-note[data-tooltip]:hover::after,
.xkw-kp-shell .kp-ranking-note[data-tooltip]:focus::after {
  transform: translateY(0);
}

.xkw-kp-shell .kp-detail-source-meta {
  display: block;
  margin-top: 4px;
  color: var(--kp-muted-foreground);
  font-size: 11px;
  font-weight: 400;
  line-height: 16px;
  overflow-wrap: anywhere;
}

.xkw-kp-shell .kp-detail-source-asin {
  color: #2563eb;
  font-weight: 600;
  text-decoration: none;
  text-underline-offset: 2px;
}

.xkw-kp-shell .kp-detail-source-asin:hover,
.xkw-kp-shell .kp-detail-source-asin:focus-visible {
  color: #1d4ed8;
  text-decoration: underline;
}

.xkw-kp-shell .kp-detail-source-asin:focus-visible {
  border-radius: 2px;
  outline: 2px solid rgba(37, 99, 235, 0.28);
  outline-offset: 1px;
}

.xkw-kp-shell .kp-detail-source-separator {
  color: var(--kp-muted-foreground);
}

.xkw-kp-shell .kp-table thead {
  position: sticky;
  z-index: 4;
  top: 0;
}

.xkw-kp-shell .kp-table th {
  box-shadow: 0 1px 0 var(--kp-border);
}

.xkw-kp-shell .kp-filterbar,
.xkw-kp-shell .kp-resultbar,
.xkw-kp-shell .kp-view-footer {
  flex: 0 0 auto;
}

.xkw-detail-dialog.xkw-kp-shell input.kp-check-input {
  appearance: auto !important;
  -webkit-appearance: checkbox !important;
  box-sizing: border-box !important;
  display: inline-block !important;
  width: 16px !important;
  min-width: 16px !important;
  max-width: 16px !important;
  height: 16px !important;
  min-height: 16px !important;
  max-height: 16px !important;
  flex: 0 0 16px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: initial !important;
  border-radius: 3px;
  background: initial !important;
  box-shadow: none !important;
  accent-color: var(--kp-primary);
  vertical-align: middle;
}

.xkw-detail-dialog.xkw-kp-shell input.kp-check-input:disabled {
  cursor: not-allowed;
  opacity: .42;
}

@media (max-width: 1180px) {
  .xkw-kp-shell .kp-tabs .kp-status-time,
  .xkw-kp-shell .kp-tabs .kp-status > .kp-status-separator,
  .xkw-kp-shell .kp-ranking-note {
    display: none;
  }

  .xkw-kp-shell .kp-compactbar .kp-result-title {
    width: 132px;
    flex-basis: 132px;
  }

  .xkw-kp-shell .kp-compactbar .kp-search {
    min-width: 180px;
  }
}

@media (max-width: 760px) {
  .xkw-kp-shell .kp-tabs,
  .xkw-kp-shell .kp-tabs .kp-status,
  .xkw-kp-shell .kp-compactbar,
  .xkw-kp-shell .kp-compactbar .kp-filters {
    align-items: stretch;
    flex-direction: column;
  }

  .xkw-kp-shell .kp-compactbar .kp-result-title,
  .xkw-kp-shell .kp-compactbar .kp-search,
  .xkw-kp-shell .kp-compactbar .kp-select,
  .xkw-kp-shell .kp-compactbar .kp-listing-select {
    width: 100%;
    min-width: 0;
    max-width: none;
    flex-basis: auto;
  }
}

/* Keyword detail: faithful implementation of the approved preview. */
.xkw-detail-backdrop {
  padding: 16px;
  background: rgba(26, 28, 31, .24);
}

.xkw-detail-dialog.xkw-kp-shell {
  --kp-background: #f5f5f5;
  --kp-foreground: #1a1c1f;
  --kp-card: rgba(26, 28, 31, .05);
  --kp-popover: #fff;
  --kp-primary: #339cff;
  --kp-primary-foreground: #fff;
  --kp-secondary: rgba(255, 255, 255, .96);
  --kp-muted: rgba(26, 28, 31, .10);
  --kp-muted-foreground: rgba(26, 28, 31, .50);
  --kp-accent: #e5f2ff;
  --kp-accent-foreground: #339cff;
  --kp-destructive: #e25507;
  --kp-border: rgba(26, 28, 31, .08);
  --kp-input: rgba(26, 28, 31, .12);
  --kp-ring: #339cff;
  position: relative;
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
  width: min(96vw, 1480px);
  height: min(96vh, 960px);
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--kp-border);
  border-radius: 14px;
  color: var(--kp-foreground);
  background: var(--kp-background);
  box-shadow: 0 24px 70px rgba(20, 30, 50, .18);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  font-weight: 430;
  line-height: 1.5;
  outline: none;
}

.xkw-kp-shell button,
.xkw-kp-shell input,
.xkw-kp-shell select {
  font: inherit;
}

.xkw-kp-shell .kp-header,
.xkw-kp-shell .kp-tabs,
.xkw-kp-shell .kp-status,
.xkw-kp-shell .kp-filterbar,
.xkw-kp-shell .kp-resultbar,
.xkw-kp-shell .kp-view-footer {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
}

.xkw-kp-shell .kp-header {
  justify-content: space-between;
  border-bottom: 1px solid var(--kp-border);
  background: var(--kp-background);
}

.xkw-kp-shell .kp-heading {
  min-width: 0;
}

.xkw-kp-shell .kp-heading h2 {
  margin: 0;
  color: var(--kp-foreground);
  font-size: 20px;
  font-weight: 500;
  line-height: 1.25;
}

.xkw-kp-shell .kp-heading p {
  margin: 4px 0 0;
  overflow: hidden;
  color: var(--kp-muted-foreground);
  font-size: 12px;
  line-height: 16px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.xkw-kp-shell .kp-actions,
.xkw-kp-shell .kp-tablist,
.xkw-kp-shell .kp-filters,
.xkw-kp-shell .kp-result-actions,
.xkw-kp-shell .kp-pagination,
.xkw-kp-shell .kp-tags,
.xkw-kp-shell .kp-cell-stack,
.xkw-kp-shell .kp-batch-actions,
.xkw-kp-shell .kp-row-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.xkw-kp-shell .kp-actions,
.xkw-kp-shell .kp-result-actions,
.xkw-kp-shell .kp-pagination {
  flex-shrink: 0;
}

.xkw-kp-shell .kp-btn {
  appearance: button;
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  min-height: 28px;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin: 0;
  padding: 0 8px;
  border: 1px solid var(--kp-input);
  border-radius: 10px;
  color: var(--kp-foreground);
  background: var(--kp-secondary);
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
}

.xkw-kp-shell .kp-btn:not(:disabled):hover {
  background: color-mix(in srgb, var(--kp-foreground) 6%, var(--kp-secondary));
}

.xkw-kp-shell .kp-btn-primary {
  border-color: transparent;
  color: var(--kp-primary-foreground);
  background: var(--kp-foreground);
}

.xkw-kp-shell .kp-btn-primary:not(:disabled):hover {
  background: color-mix(in srgb, var(--kp-foreground) 80%, transparent);
}

.xkw-kp-shell .kp-btn-ghost {
  border-color: transparent;
  color: var(--kp-muted-foreground);
  background: transparent;
}

.xkw-kp-shell .kp-btn-ghost:not(:disabled):hover {
  color: var(--kp-foreground);
  background: color-mix(in srgb, var(--kp-foreground) 6%, var(--kp-secondary));
}

.xkw-kp-shell .kp-btn:disabled {
  cursor: not-allowed;
  opacity: .4;
}

.xkw-kp-shell .kp-icon-btn {
  width: 28px;
  padding: 0;
}

.xkw-kp-shell .kp-tabs {
  justify-content: space-between;
  padding-block: 8px;
  border-bottom: 1px solid var(--kp-border);
  background: var(--kp-background);
}

.xkw-kp-shell .kp-tablist {
  flex-wrap: wrap;
}

.xkw-kp-shell .kp-tab[aria-selected="true"] {
  border-color: transparent;
  color: var(--kp-primary-foreground);
  background: var(--kp-primary);
}

.xkw-kp-shell .kp-status {
  flex-wrap: wrap;
  justify-content: space-between;
  border-bottom: 1px solid var(--kp-border);
  background: color-mix(in srgb, var(--kp-accent) 55%, transparent);
}

.xkw-kp-shell .kp-status-main,
.xkw-kp-shell .kp-status-time {
  display: flex;
  align-items: center;
  gap: 8px;
}

.xkw-kp-shell .kp-status-time {
  color: var(--kp-muted-foreground);
  font-size: 12px;
}

.xkw-kp-shell .kp-body {
  min-height: 0;
  overflow: auto;
  background: var(--kp-background);
  overscroll-behavior: contain;
}

.xkw-kp-shell .kp-filterbar {
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--kp-border);
}

.xkw-kp-shell .kp-filters {
  flex: 1;
  flex-wrap: wrap;
  align-items: flex-end;
}

.xkw-kp-shell .kp-search {
  flex: 1 1 220px;
  min-width: 180px;
}

.xkw-kp-shell .kp-select {
  flex: 0 1 150px;
  min-width: 130px;
}

.xkw-kp-shell .kp-field-label {
  display: block;
  margin-bottom: 4px;
  color: var(--kp-muted-foreground);
  font-size: 12px;
  line-height: 16px;
}

.xkw-kp-shell .kp-form-control,
.xkw-kp-shell .kp-form-select {
  display: block;
  width: 100%;
  min-height: 28px;
  margin: 0;
  outline: 0;
  border: 1px solid var(--kp-input);
  border-radius: 10px;
  color: var(--kp-foreground);
  background-color: var(--kp-secondary);
}

.xkw-kp-shell .kp-form-control {
  padding: 0 8px;
}

.xkw-kp-shell .kp-form-control::placeholder {
  color: var(--kp-muted-foreground);
}

.xkw-kp-shell .kp-form-select {
  appearance: none;
  padding: 0 32px 0 8px;
  background-image: linear-gradient(45deg, transparent 50%, var(--kp-muted-foreground) 50%), linear-gradient(135deg, var(--kp-muted-foreground) 50%, transparent 50%);
  background-position: calc(100% - 14px) 50%, calc(100% - 10px) 50%;
  background-repeat: no-repeat;
  background-size: 4px 4px;
}

.xkw-kp-shell .kp-form-control:focus-visible,
.xkw-kp-shell .kp-form-select:focus-visible {
  border-color: var(--kp-ring);
  box-shadow: inset 0 0 0 1px var(--kp-ring);
}

.xkw-kp-shell .kp-resultbar {
  justify-content: space-between;
  flex-wrap: wrap;
  min-height: 48px;
}

.xkw-kp-shell .kp-result-title {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.xkw-kp-shell .kp-result-title strong,
.xkw-kp-shell .kp-keyword {
  color: var(--kp-foreground);
  font-weight: 500;
}

.xkw-kp-shell .kp-result-title span,
.xkw-kp-shell .kp-result-actions,
.xkw-kp-shell .kp-view-footer,
.xkw-kp-shell .kp-cell-stack small {
  color: var(--kp-muted-foreground);
  font-size: 12px;
  line-height: 16px;
}

.xkw-kp-shell .kp-table-wrap {
  width: 100%;
  overflow: auto;
  border-top: 1px solid var(--kp-border);
  scrollbar-width: thin;
}

.xkw-kp-shell .kp-table {
  width: 100%;
  min-width: 1040px;
  margin: 0;
  border: 0;
  border-collapse: collapse;
  table-layout: auto;
  color: var(--kp-foreground);
  background: var(--kp-background);
  font: inherit;
  font-size: 14px;
  text-align: start;
}

.xkw-kp-shell .kp-table.is-ads {
  min-width: 1240px;
}

.xkw-kp-shell .kp-table th,
.xkw-kp-shell .kp-table td {
  padding: 6px 16px 6px 0;
  overflow-wrap: break-word;
  border: 0;
  border-bottom: 1px solid var(--kp-border);
  text-align: start;
  vertical-align: middle;
}

.xkw-kp-shell .kp-table th:first-child,
.xkw-kp-shell .kp-table td:first-child {
  padding-left: 16px;
}

.xkw-kp-shell .kp-table th:last-child,
.xkw-kp-shell .kp-table td:last-child {
  padding-right: 16px;
}

.xkw-kp-shell .kp-table th {
  height: 36px;
  color: var(--kp-muted-foreground);
  background: #e7e7e7;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.xkw-kp-shell .kp-table tbody tr:hover {
  background: color-mix(in srgb, var(--kp-accent) 40%, transparent);
}

.xkw-kp-shell .kp-table tbody tr.is-selected {
  background: color-mix(in srgb, var(--kp-accent) 68%, transparent);
}

.xkw-kp-shell .kp-check {
  width: 42px;
  text-align: center;
}

.xkw-kp-shell .kp-check-input {
  appearance: none;
  width: 14px;
  height: 14px;
  margin: 0;
  border: 1px solid var(--kp-input);
  border-radius: 3px;
  background: transparent;
  cursor: pointer;
}

.xkw-kp-shell .kp-check-input:checked {
  border-color: var(--kp-primary);
  background: var(--kp-primary);
  box-shadow: inset 0 0 0 3px var(--kp-primary), inset 0 0 0 4px #fff;
}

.xkw-kp-shell .kp-number {
  text-align: end !important;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.xkw-kp-shell .kp-date {
  white-space: nowrap;
}

.xkw-kp-shell .kp-th-label,
.xkw-kp-shell .kp-info-btn,
.xkw-kp-shell .kp-detail-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.xkw-kp-shell .kp-info-btn {
  min-height: 0;
  padding: 2px;
  border: 0;
  color: var(--kp-muted-foreground);
  background: transparent;
  cursor: help;
}

.xkw-kp-shell .kp-cell-stack {
  align-items: flex-start;
  flex-direction: column;
  gap: 3px;
  min-width: 112px;
}

.xkw-kp-shell .kp-tags {
  flex-wrap: wrap;
  gap: 4px;
}

.xkw-kp-shell .kp-tag,
.xkw-kp-shell .kp-status-pill,
.xkw-kp-shell .kp-match-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 12px;
  line-height: 16px;
  white-space: nowrap;
}

.xkw-kp-shell .kp-tag-primary,
.xkw-kp-shell .kp-match-exact,
.xkw-kp-shell .kp-status-draft {
  border-color: color-mix(in srgb, var(--kp-primary) 28%, transparent);
  color: var(--kp-foreground);
  background: color-mix(in srgb, var(--kp-primary) 14%, transparent);
}

.xkw-kp-shell .kp-tag-accent,
.xkw-kp-shell .kp-status-suggestion {
  border-color: color-mix(in srgb, var(--kp-accent-foreground) 16%, transparent);
  color: var(--kp-accent-foreground);
  background: color-mix(in srgb, var(--kp-accent) 72%, transparent);
}

.xkw-kp-shell .kp-tag-muted,
.xkw-kp-shell .kp-status-paused,
.xkw-kp-shell .kp-status-none {
  border-color: var(--kp-border);
  color: var(--kp-muted-foreground);
  background: var(--kp-muted);
}

.xkw-kp-shell .kp-status-running,
.xkw-kp-shell .kp-listing-used,
.xkw-kp-shell .kp-match-broad {
  border-color: rgba(243, 136, 59, .30);
  color: var(--kp-foreground);
  background: rgba(243, 136, 59, .14);
}

.xkw-kp-shell .kp-status-negative {
  border-color: rgba(226, 85, 7, .30);
  color: var(--kp-foreground);
  background: rgba(226, 85, 7, .13);
}

.xkw-kp-shell .kp-listing-unused,
.xkw-kp-shell .kp-match-phrase {
  border-color: rgba(93, 201, 119, .30);
  color: var(--kp-foreground);
  background: rgba(93, 201, 119, .14);
}

.xkw-kp-shell .kp-trend-up {
  color: var(--kp-foreground);
  font-weight: 500;
}

.xkw-kp-shell .kp-rank-missing {
  color: var(--kp-muted-foreground);
}

.xkw-kp-shell .kp-row-actions {
  gap: 2px;
  white-space: nowrap;
}

.xkw-kp-shell .kp-quiet-draft {
  width: 28px;
  padding: 0;
  opacity: .46;
}

.xkw-kp-shell tr:hover .kp-quiet-draft,
.xkw-kp-shell .kp-quiet-draft:focus-visible {
  opacity: 1;
}

.xkw-kp-shell .kp-empty {
  padding: 28px 16px !important;
  color: var(--kp-muted-foreground);
  text-align: center !important;
}

.xkw-kp-shell .kp-view-footer {
  justify-content: space-between;
  flex-wrap: wrap;
  border-top: 1px solid var(--kp-border);
}

.xkw-kp-shell .kp-batchbar {
  z-index: 8;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  border-top: 1px solid var(--kp-border);
  background: color-mix(in srgb, var(--kp-accent) 50%, var(--kp-background));
}

.xkw-kp-shell .kp-drawer-backdrop {
  position: absolute;
  z-index: 20;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: color-mix(in srgb, var(--kp-foreground) 24%, transparent);
  cursor: default;
}

.xkw-kp-shell .kp-drawer {
  position: absolute;
  z-index: 21;
  inset: 0 0 0 auto;
  display: block;
  width: min(82%, 480px);
  min-height: 100%;
  padding: 18px;
  overflow: auto;
  border-left: 1px solid var(--kp-border);
  color: var(--kp-foreground);
  background: var(--kp-popover);
  box-shadow: -12px 0 28px rgba(26, 28, 31, .12);
}

.xkw-kp-shell .kp-drawer-head,
.xkw-kp-shell .kp-drawer-title,
.xkw-kp-shell .kp-detail-grid,
.xkw-kp-shell .kp-detail-section-head {
  display: flex;
  gap: 10px;
}

.xkw-kp-shell .kp-drawer-head,
.xkw-kp-shell .kp-detail-section-head {
  align-items: center;
  justify-content: space-between;
}

.xkw-kp-shell .kp-drawer-title {
  min-width: 0;
  flex-direction: column;
  gap: 3px;
}

.xkw-kp-shell .kp-drawer-title span,
.xkw-kp-shell .kp-detail-section-head > span,
.xkw-kp-shell .kp-detail-item > span,
.xkw-kp-shell .kp-note {
  color: var(--kp-muted-foreground);
  font-size: 12px;
}

.xkw-kp-shell .kp-drawer h3,
.xkw-kp-shell .kp-drawer h4 {
  margin: 0;
  color: var(--kp-foreground);
  font-size: 18px;
  font-weight: 500;
}

.xkw-kp-shell .kp-drawer h4 {
  font-size: 16px;
}

.xkw-kp-shell .kp-drawer p {
  margin: 8px 0 0;
}

.xkw-kp-shell .kp-detail-section {
  padding-block: 16px;
  border-bottom: 1px solid var(--kp-border);
}

.xkw-kp-shell .kp-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 16px;
  margin-top: 10px;
}

.xkw-kp-shell .kp-detail-item {
  min-width: 0;
}

.xkw-kp-shell .kp-detail-item span,
.xkw-kp-shell .kp-detail-item strong {
  display: block;
}

.xkw-kp-shell .kp-detail-item strong {
  margin-top: 3px;
  font-weight: 500;
}

.xkw-kp-shell .kp-snippet {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--kp-foreground);
  background: var(--kp-muted);
}

.xkw-kp-shell .kp-dialog-backdrop {
  position: absolute;
  z-index: 30;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: rgba(26, 28, 31, .28);
  cursor: default;
}

.xkw-kp-shell .kp-dialog-card {
  position: absolute;
  z-index: 31;
  top: 50%;
  left: 50%;
  display: flex;
  width: min(92%, 460px);
  padding: 16px;
  border: 1px solid var(--kp-border);
  border-radius: 20px;
  color: var(--kp-foreground);
  background: var(--kp-popover);
  box-shadow: 0 18px 48px rgba(26, 28, 31, .18);
  transform: translate(-50%, -50%);
  flex-direction: column;
  gap: 14px;
}

.xkw-kp-shell .kp-dialog-head,
.xkw-kp-shell .kp-dialog-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.xkw-kp-shell .kp-dialog-head h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 500;
}

.xkw-kp-shell .kp-dialog-fields {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.xkw-kp-shell .kp-dialog-fields p {
  margin: 0;
  color: var(--kp-muted-foreground);
  font-size: 12px;
}

.xkw-kp-shell .kp-dialog-actions {
  justify-content: flex-end;
}

@media (max-width: 760px) {
  .xkw-detail-backdrop {
    padding: 0;
  }

  .xkw-detail-dialog.xkw-kp-shell {
    width: 100vw;
    height: 100vh;
    border-radius: 0;
  }

  .xkw-kp-shell .kp-header,
  .xkw-kp-shell .kp-tabs,
  .xkw-kp-shell .kp-status,
  .xkw-kp-shell .kp-filterbar,
  .xkw-kp-shell .kp-resultbar,
  .xkw-kp-shell .kp-view-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .xkw-kp-shell .kp-actions,
  .xkw-kp-shell .kp-result-actions,
  .xkw-kp-shell .kp-pagination {
    justify-content: space-between;
  }

  .xkw-kp-shell .kp-drawer {
    width: 100%;
  }

  .xkw-kp-shell .kp-detail-grid {
    grid-template-columns: 1fr;
  }
}

/* Keyword detail table refresh · 2026-07-24 */
.xkw-detail-dialog {
  width: min(97vw, 1600px);
}

.xkw-detail-tabmeta,
.xkw-detail-guide-head,
.xkw-detail-row-actions,
.xkw-detail-th-label {
  display: flex;
  align-items: center;
}

.xkw-detail-tabmeta {
  gap: 12px;
}

.xkw-detail-tabmeta > span {
  color: #8b95a7;
  font-size: 11px;
}

.xkw-detail-tabbar .xkw-detail-guide-btn {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  gap: 6px;
  padding: 4px 8px;
  color: #4566a8;
  font-size: 11px;
  font-weight: 700;
}

.xkw-detail-tabbar .xkw-detail-guide-btn:hover,
.xkw-detail-tabbar .xkw-detail-guide-btn[aria-expanded="true"] {
  background: #edf3ff;
  color: #2454d9;
}

.xkw-detail-guide {
  padding: 13px 15px;
  border: 1px solid #d8e4fb;
  border-radius: 10px;
  background: #f7f9ff;
}

.xkw-detail-guide-head {
  justify-content: space-between;
  margin-bottom: 10px;
}

.xkw-detail-guide-head strong {
  color: var(--xkw-text);
  font-size: 12px;
}

.xkw-detail-guide-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px 18px;
}

.xkw-detail-guide-grid > div {
  display: grid;
  gap: 3px;
}

.xkw-detail-guide-grid strong {
  color: #344054;
  font-size: 10.5px;
}

.xkw-detail-guide-grid span {
  color: #667085;
  font-size: 10px;
  line-height: 1.55;
}

.xkw-detail-table.is-keywords {
  min-width: 1132px;
}

.xkw-detail-table.is-keywords th:nth-child(1) { width: 42px; }
.xkw-detail-table.is-keywords th:nth-child(2) { width: 158px; }
.xkw-detail-table.is-keywords th:nth-child(3) { width: 150px; }
.xkw-detail-table.is-keywords th:nth-child(4) { width: 84px; text-align: right; }
.xkw-detail-table.is-keywords th:nth-child(5) { width: 78px; text-align: right; }
.xkw-detail-table.is-keywords th:nth-child(6) { width: 80px; text-align: right; }
.xkw-detail-table.is-keywords th:nth-child(7) { width: 86px; text-align: right; }
.xkw-detail-table.is-keywords th:nth-child(8) { width: 86px; text-align: right; }
.xkw-detail-table.is-keywords th:nth-child(9) { width: 96px; }
.xkw-detail-table.is-keywords th:nth-child(10) { width: 96px; }
.xkw-detail-table.is-keywords th:nth-child(11) { width: 108px; }
.xkw-detail-table.is-keywords th:nth-child(12) { width: 68px; }

.xkw-detail-th-label {
  justify-content: inherit;
  gap: 4px;
  white-space: nowrap;
}

.xkw-detail-info {
  display: inline-grid;
  width: 20px;
  height: 20px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #93a1b4;
  cursor: help;
  place-items: center;
}

.xkw-detail-info:hover,
.xkw-detail-info:focus-visible {
  background: #edf3ff;
  color: #2454d9;
}

.xkw-detail-number {
  color: #344054;
  font-variant-numeric: tabular-nums;
  text-align: right !important;
  white-space: nowrap;
}

.xkw-detail-number.is-positive {
  color: #087f6d;
}

.xkw-detail-date {
  color: #667085;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.xkw-detail-row-actions {
  justify-content: center;
  gap: 2px;
}

.xkw-detail-row-draft {
  display: inline-grid;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #2454d9;
  cursor: pointer;
  opacity: .22;
  place-items: center;
}

.xkw-detail-table tbody tr:hover .xkw-detail-row-draft,
.xkw-detail-row-draft:hover,
.xkw-detail-row-draft:focus-visible {
  background: #edf3ff;
  opacity: 1;
}

.xkw-detail-primary-inline {
  min-height: 28px;
  padding: 5px 9px;
  border: 1px solid #bcd0fb;
  border-radius: 7px;
  background: #edf3ff;
  color: #2454d9;
  font-size: 10.5px;
  font-weight: 750;
  white-space: nowrap;
  cursor: pointer;
}

.xkw-detail-primary-inline:hover {
  border-color: #8fb0f7;
  background: #e4edff;
}

.xkw-detail-muted-action {
  color: #7a8699;
  font-size: 10px;
  white-space: nowrap;
}

.xkw-detail-simple-table.is-listing {
  min-width: 1040px;
}

.xkw-detail-simple-table.is-listing th:nth-child(1) { width: 190px; }
.xkw-detail-simple-table.is-listing th:nth-child(2) { width: 170px; }
.xkw-detail-simple-table.is-listing th:nth-child(3) { width: 190px; }
.xkw-detail-simple-table.is-listing th:nth-child(4) { width: 190px; }
.xkw-detail-simple-table.is-listing th:nth-child(5) { width: 105px; }
.xkw-detail-simple-table.is-listing th:nth-child(6) { width: 140px; }
.xkw-detail-simple-table.is-listing th:nth-child(7) { width: 70px; }

.xkw-detail-simple-table.is-ads {
  min-width: 1480px;
}

.xkw-detail-simple-table.is-ads th:nth-child(1) { width: 45px; }
.xkw-detail-simple-table.is-ads th:nth-child(2) { width: 180px; }
.xkw-detail-simple-table.is-ads th:nth-child(3) { width: 170px; }
.xkw-detail-simple-table.is-ads th:nth-child(4) { width: 96px; text-align: right; }
.xkw-detail-simple-table.is-ads th:nth-child(5) { width: 112px; text-align: right; }
.xkw-detail-simple-table.is-ads th:nth-child(6) { width: 104px; }
.xkw-detail-simple-table.is-ads th:nth-child(7) { width: 150px; }
.xkw-detail-simple-table.is-ads th:nth-child(8) { width: 86px; text-align: right; }
.xkw-detail-simple-table.is-ads th:nth-child(9) { width: 185px; }
.xkw-detail-simple-table.is-ads th:nth-child(10) { width: 112px; }
.xkw-detail-simple-table.is-ads th:nth-child(11) { width: 120px; }
.xkw-detail-simple-table.is-ads th:nth-child(12) { width: 70px; }

.xkw-detail-filters.is-ads .xkw-detail-search {
  flex: 0 1 340px;
}

.xkw-detail-listing-note {
  display: grid;
  gap: 5px;
  padding: 13px 18px;
  color: #667085;
}

.xkw-detail-listing-note strong {
  color: #344054;
  font-size: 11px;
}

.xkw-detail-listing-note span,
.xkw-detail-listing-note small {
  font-size: 10px;
  line-height: 1.55;
}

body.theme-dark .xkw-detail-guide,
body.theme-dark .xkw-detail-tabbar .xkw-detail-guide-btn:hover,
body.theme-dark .xkw-detail-tabbar .xkw-detail-guide-btn[aria-expanded="true"],
body.theme-dark .xkw-detail-info:hover,
body.theme-dark .xkw-detail-row-draft:hover,
body.theme-dark .xkw-detail-row-draft:focus-visible,
body.theme-dark .xkw-detail-primary-inline {
  background: var(--xkw-surface-soft);
}

body.theme-dark .xkw-detail-guide-grid strong,
body.theme-dark .xkw-detail-number,
body.theme-dark .xkw-detail-listing-note strong {
  color: var(--xkw-text);
}

body.theme-dark .xkw-detail-guide-grid span,
body.theme-dark .xkw-detail-listing-note,
body.theme-dark .xkw-detail-date {
  color: var(--xkw-text-secondary);
}

@media (max-width: 760px) {
  .xkw-detail-tabmeta > span {
    display: none;
  }

  .xkw-detail-guide-grid {
    grid-template-columns: 1fr;
  }
}

@media (forced-colors: active) {
  .xkw-summary-card.is-active,
  .xkw-table tbody tr.is-selected td,
  .xkw-status,
  .xkw-prepare-btn {
    forced-color-adjust: auto;
  }
}

body.xkw-detail-open {
  overflow: hidden;
}

.xkw-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.xkw-detail-backdrop {
  position: fixed;
  z-index: 10050;
  inset: 0;
  display: grid;
  width: 100vw;
  height: 100vh;
  padding: 16px;
  background: rgba(22, 31, 49, .54);
  place-items: center;
}

.xkw-detail-dialog {
  position: relative;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  width: min(94vw, 1480px);
  height: min(94vh, 960px);
  min-height: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .72);
  border-radius: 14px;
  background: var(--xkw-surface);
  box-shadow: 0 24px 70px rgba(20, 30, 50, .24);
}

.xkw-detail-header,
.xkw-detail-tabbar,
.xkw-detail-footer {
  position: relative;
  z-index: 5;
  background: var(--xkw-surface);
}

.xkw-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 78px;
  gap: 20px;
  padding: 15px 20px;
  border-bottom: 1px solid var(--xkw-line);
}

.xkw-detail-header > div:first-child {
  min-width: 0;
}

.xkw-detail-header h2 {
  margin: 0 0 7px;
  color: var(--xkw-text);
  font-size: 20px;
  font-weight: 780;
  letter-spacing: -.01em;
  line-height: 1.2;
}

.xkw-detail-header p {
  max-width: min(75vw, 980px);
  margin: 0;
  overflow: hidden;
  color: var(--xkw-text-secondary);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.xkw-detail-header > div:last-child {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 8px;
}

.xkw-detail-primary-btn,
.xkw-detail-secondary-btn,
.xkw-detail-quiet-btn,
.xkw-detail-filter-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  gap: 7px;
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
}

.xkw-detail-primary-btn {
  border: 1px solid var(--xkw-accent);
  background: var(--xkw-accent);
  color: #fff;
  box-shadow: 0 5px 14px rgba(37, 99, 235, .15);
}

.xkw-detail-primary-btn:hover:not(:disabled) {
  border-color: var(--xkw-accent-strong);
  background: var(--xkw-accent-strong);
}

.xkw-detail-secondary-btn,
.xkw-detail-filter-btn {
  border: 1px solid #ccd6e4;
  background: var(--xkw-surface);
  color: #334158;
}

.xkw-detail-secondary-btn:hover:not(:disabled),
.xkw-detail-filter-btn:hover:not(:disabled),
.xkw-detail-filter-btn.is-active {
  border-color: #9bb8fa;
  background: var(--xkw-accent-soft);
  color: var(--xkw-accent-strong);
}

.xkw-detail-quiet-btn {
  border: 1px solid transparent;
  background: transparent;
  color: #5f6b7c;
}

.xkw-detail-quiet-btn:hover:not(:disabled) {
  background: var(--xkw-surface-soft);
}

.xkw-detail-primary-btn:disabled,
.xkw-detail-secondary-btn:disabled,
.xkw-detail-quiet-btn:disabled {
  cursor: wait;
  opacity: .58;
}

.xkw-detail-primary-btn:focus-visible,
.xkw-detail-secondary-btn:focus-visible,
.xkw-detail-quiet-btn:focus-visible,
.xkw-detail-filter-btn:focus-visible,
.xkw-detail-link:focus-visible,
.xkw-detail-tabbar button:focus-visible {
  outline: 3px solid rgba(37, 99, 235, .2);
  outline-offset: 2px;
}

.xkw-detail-tabbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 58px;
  gap: 16px;
  padding: 10px 20px;
  border-bottom: 1px solid var(--xkw-line);
  background: #fbfcfe;
}

.xkw-detail-tabbar nav {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--xkw-line);
  border-radius: 8px;
  background: var(--xkw-surface);
}

.xkw-detail-tabbar button {
  min-height: 32px;
  padding: 6px 15px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #4d596b;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.xkw-detail-tabbar button.is-active {
  background: #eaf1ff;
  color: #2454d9;
}

.xkw-detail-tabbar > span {
  color: #8b95a7;
  font-size: 11px;
}

.xkw-detail-body {
  min-height: 0;
  overflow: auto;
  padding: 16px 20px 92px;
  background: #f5f7fa;
  scrollbar-gutter: stable;
  overscroll-behavior: contain;
}

.xkw-detail-body > * + * {
  margin-top: 14px;
}

.xkw-detail-metric-strip,
.xkw-detail-compact-summary {
  display: grid;
  overflow: hidden;
  border: 1px solid var(--xkw-line);
  border-radius: 10px;
  background: var(--xkw-surface);
}

.xkw-detail-metric-strip {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.xkw-detail-metric {
  min-width: 0;
  min-height: 94px;
  padding: 14px 16px;
  border: 0;
  border-right: 1px solid var(--xkw-line);
  background: transparent;
  color: var(--xkw-text);
  text-align: left;
  cursor: pointer;
}

.xkw-detail-metric:last-child {
  border-right: 0;
}

.xkw-detail-metric:hover {
  background: #fbfdff;
}

.xkw-detail-metric > span,
.xkw-detail-metric > strong,
.xkw-detail-metric > small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.xkw-detail-metric > span {
  color: var(--xkw-text-secondary);
  font-size: 11px;
}

.xkw-detail-metric > strong {
  margin: 5px 0 2px;
  color: #26334a;
  font-size: 25px;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  line-height: 1;
}

.xkw-detail-metric > small {
  color: var(--xkw-muted);
  font-size: 10px;
}

.xkw-detail-metric.is-core-big > strong,
.xkw-detail-metric.is-rank > strong {
  color: #2454d9;
}

.xkw-detail-metric.is-longtail > strong {
  color: #087f91;
}

.xkw-detail-metric.is-uncovered > strong {
  color: #b35c00;
}

.xkw-detail-metric.is-ad > strong {
  color: #078a67;
}

.xkw-detail-reading {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(280px, 1fr);
  align-items: center;
  gap: 24px;
  padding: 13px 16px;
  border: 1px solid #d8e4fb;
  border-radius: 10px;
  background: #f5f8ff;
}

.xkw-detail-reading > div {
  display: grid;
  gap: 5px;
}

.xkw-detail-reading span {
  color: #4566a8;
  font-size: 10px;
  font-weight: 800;
}

.xkw-detail-reading strong {
  color: #26334a;
  font-size: 12.5px;
  line-height: 1.7;
}

.xkw-detail-reading p {
  margin: 0;
  color: #5d6c83;
  font-size: 11px;
  line-height: 1.7;
}

.xkw-detail-filters {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
  padding: 11px;
  border: 1px solid var(--xkw-line);
  border-radius: 10px;
  background: var(--xkw-surface);
}

.xkw-detail-filters.is-simple {
  justify-content: flex-start;
}

.xkw-detail-filters select,
.xkw-detail-more-filters select {
  height: 36px;
  min-width: 132px;
  padding: 0 30px 0 10px;
  border: 1px solid #ccd6e4;
  border-radius: 7px;
  outline: 0;
  background: var(--xkw-surface);
  color: #344054;
  font-size: 12px;
}

.xkw-detail-filters select:focus,
.xkw-detail-more-filters select:focus {
  border-color: #85a7f4;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .1);
}

.xkw-detail-search {
  display: flex;
  align-items: center;
  width: 270px;
  height: 36px;
  gap: 8px;
  padding: 0 11px;
  border: 1px solid #ccd6e4;
  border-radius: 7px;
  background: var(--xkw-surface);
  color: #8a97a8;
}

.xkw-detail-search:focus-within {
  border-color: #85a7f4;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .1);
}

.xkw-detail-search input {
  width: 100%;
  height: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--xkw-text);
  font-size: 12px;
}

.xkw-detail-filter-btn {
  min-height: 36px;
}

.xkw-detail-link {
  padding: 4px 6px;
  border: 0;
  background: transparent;
  color: #2454d9;
  font-size: 11px;
  font-weight: 750;
  white-space: nowrap;
  cursor: pointer;
}

.xkw-detail-link:hover {
  text-decoration: underline;
}

.xkw-detail-reset {
  margin-left: auto;
}

.xkw-detail-more-filters {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  padding: 12px 15px;
  border: 1px solid var(--xkw-line);
  border-radius: 10px;
  background: var(--xkw-surface);
}

.xkw-detail-more-filters label {
  display: grid;
  gap: 5px;
  color: var(--xkw-text-secondary);
  font-size: 10px;
}

.xkw-detail-more-filters p {
  margin: 0 0 3px auto;
  color: #5b6e8e;
  font-size: 10px;
  line-height: 1.55;
}

.xkw-detail-result-heading,
.xkw-detail-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 1px 2px 0;
}

.xkw-detail-result-heading {
  color: var(--xkw-muted);
  font-size: 10px;
}

.xkw-detail-result-heading > div {
  display: flex;
  align-items: baseline;
  gap: 9px;
}

.xkw-detail-result-heading strong,
.xkw-detail-section-heading strong {
  color: var(--xkw-text);
  font-size: 14px;
}

.xkw-detail-section-heading > div {
  display: grid;
  gap: 4px;
}

.xkw-detail-section-heading span {
  color: var(--xkw-muted);
  font-size: 10px;
}

.xkw-detail-table-wrap {
  width: 100%;
  overflow: auto;
  border: 1px solid var(--xkw-line);
  border-radius: 10px;
  background: var(--xkw-surface);
  -webkit-overflow-scrolling: touch;
}

.xkw-detail-table,
.xkw-detail-simple-table {
  width: 100%;
  min-width: 1210px;
  border: 0;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  background: var(--xkw-surface);
  color: var(--xkw-text-secondary);
  font-size: 11px;
}

.xkw-detail-table th,
.xkw-detail-table td,
.xkw-detail-simple-table th,
.xkw-detail-simple-table td {
  padding: 12px;
  border: 0;
  border-bottom: 1px solid var(--xkw-line-soft);
  text-align: left;
  vertical-align: middle;
}

.xkw-detail-table th,
.xkw-detail-simple-table th {
  position: sticky;
  z-index: 2;
  top: 0;
  height: 42px;
  padding-top: 9px;
  padding-bottom: 9px;
  background: #f8fafc;
  color: #657185;
  box-shadow: inset 0 -1px var(--xkw-line);
  font-size: 10.5px;
  font-weight: 800;
  white-space: nowrap;
}

.xkw-detail-table tbody tr:not(.xkw-detail-expanded-row):hover,
.xkw-detail-simple-table tbody tr:hover {
  background: #fbfcff;
}

.xkw-detail-table tbody tr.is-selected,
.xkw-detail-simple-table tbody tr.is-selected {
  background: var(--xkw-selected);
}

.xkw-detail-table tbody tr.is-selected td:first-child,
.xkw-detail-simple-table tbody tr.is-selected td:first-child {
  box-shadow: inset 3px 0 var(--xkw-accent);
}

.xkw-detail-table tbody tr:last-child td,
.xkw-detail-simple-table tbody tr:last-child td {
  border-bottom: 0;
}

.xkw-detail-table th:nth-child(1) { width: 44px; }
.xkw-detail-table th:nth-child(2) { width: 190px; }
.xkw-detail-table th:nth-child(3) { width: 150px; }
.xkw-detail-table th:nth-child(4) { width: 190px; }
.xkw-detail-table th:nth-child(5) { width: 175px; }
.xkw-detail-table th:nth-child(6) { width: 220px; }
.xkw-detail-table th:nth-child(7) { width: 160px; }
.xkw-detail-table th:nth-child(8) { width: 62px; }

.xkw-detail-simple-table th:first-child { width: 205px; }
.xkw-detail-simple-table.is-ads th:nth-child(1) { width: 50px; }
.xkw-detail-simple-table.is-ads th:nth-child(2) { width: 190px; }
.xkw-detail-simple-table.is-ads th:nth-child(3) { width: 180px; }
.xkw-detail-simple-table.is-ads th:nth-child(4) { width: 190px; }
.xkw-detail-simple-table.is-ads th:nth-child(5) { width: 180px; }
.xkw-detail-simple-table.is-ads th:nth-child(6) { width: 230px; }
.xkw-detail-simple-table.is-ads th:nth-child(7) { width: 95px; }

.xkw-detail-check,
.xkw-detail-action {
  text-align: center !important;
}

.xkw-detail-check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  min-width: 16px;
  min-height: 16px;
  margin: 0;
  accent-color: var(--xkw-accent);
}

.xkw-detail-term strong,
.xkw-detail-term small,
.xkw-detail-cell strong,
.xkw-detail-cell span,
.xkw-detail-cell small {
  display: block;
  min-width: 0;
}

.xkw-detail-term strong {
  overflow: hidden;
  color: var(--xkw-text);
  font-size: 12.5px;
  font-weight: 780;
  line-height: 1.45;
  text-overflow: ellipsis;
}

.xkw-detail-term small,
.xkw-detail-cell small,
.xkw-detail-source {
  margin-top: 3px;
  color: var(--xkw-muted);
  font-size: 9.5px;
  line-height: 1.45;
}

.xkw-detail-cell strong {
  color: #344054;
  font-size: 11.5px;
  font-weight: 750;
  line-height: 1.45;
}

.xkw-detail-cell span {
  margin-top: 3px;
  color: var(--xkw-text-secondary);
  font-size: 10.5px;
  line-height: 1.45;
}

.xkw-detail-cell .xkw-detail-tags {
  margin-top: 6px;
}

.xkw-detail-tags {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
}

.xkw-detail-tag {
  display: inline-flex;
  align-items: center;
  min-height: 21px;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 9.5px;
  font-weight: 750;
  line-height: 1.2;
  white-space: nowrap;
}

.xkw-detail-tag.is-blue { background: #eaf1ff; color: #2454d9; }
.xkw-detail-tag.is-blue-soft { background: #f1f5fb; color: #4566a8; }
.xkw-detail-tag.is-teal { background: #e7f7f8; color: #087f91; }
.xkw-detail-tag.is-orange { background: #fff0dc; color: #a95400; }
.xkw-detail-tag.is-green { background: #e8f8f1; color: #067c5d; }
.xkw-detail-tag.is-violet { background: #f5f3ff; color: #6d28d9; }
.xkw-detail-tag.is-red { background: #fef2f2; color: #b42318; }
.xkw-detail-tag.is-slate { background: #eef1f5; color: #5f6b7c; }

.xkw-detail-action-copy {
  color: #344b77;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.5;
}

.xkw-detail-expanded-row > td {
  padding: 0;
  background: #f7f9fc;
}

.xkw-detail-expansion {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 14px 16px 16px 54px;
}

.xkw-detail-expansion > section {
  min-height: 132px;
  padding: 12px;
  border: 1px solid var(--xkw-line);
  border-radius: 8px;
  background: var(--xkw-surface);
}

.xkw-detail-expansion > section > strong {
  display: block;
  margin-bottom: 9px;
  color: var(--xkw-text);
  font-size: 11.5px;
}

.xkw-detail-expansion dl {
  display: grid;
  gap: 7px;
  margin: 0;
}

.xkw-detail-expansion dl > div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.xkw-detail-expansion dt,
.xkw-detail-expansion dd,
.xkw-detail-expansion p,
.xkw-detail-expansion > small {
  color: var(--xkw-muted);
  font-size: 9.5px;
  line-height: 1.55;
}

.xkw-detail-expansion dd {
  margin: 0;
  color: var(--xkw-text-secondary);
  font-weight: 700;
  text-align: right;
}

.xkw-detail-expansion p {
  margin: 0 0 7px;
}

.xkw-detail-expansion > small {
  grid-column: 1 / -1;
}

.xkw-detail-empty {
  display: grid;
  min-height: 210px;
  gap: 6px;
  padding: 30px;
  color: var(--xkw-muted);
  place-content: center;
  text-align: center;
}

.xkw-detail-empty strong {
  color: var(--xkw-text-secondary);
  font-size: 13px;
}

.xkw-detail-pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  color: var(--xkw-muted);
  font-size: 10px;
}

.xkw-detail-pagination button {
  display: inline-grid;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid var(--xkw-line);
  border-radius: 8px;
  background: var(--xkw-surface);
  color: var(--xkw-text-secondary);
  cursor: pointer;
  place-items: center;
}

.xkw-detail-pagination button:hover:not(:disabled) {
  border-color: var(--xkw-accent);
  color: var(--xkw-accent);
}

.xkw-detail-pagination button:disabled {
  cursor: not-allowed;
  opacity: .4;
}

.xkw-detail-pagination span {
  min-width: 86px;
  text-align: center;
}

.xkw-detail-compact-summary {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.xkw-detail-compact-summary > div {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: baseline;
  min-width: 0;
  gap: 10px;
  padding: 17px;
  border-right: 1px solid var(--xkw-line);
}

.xkw-detail-compact-summary > div:last-child {
  border-right: 0;
}

.xkw-detail-compact-summary strong {
  overflow: hidden;
  color: #2454d9;
  font-size: 22px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.xkw-detail-compact-summary span {
  color: var(--xkw-text-secondary);
  font-size: 11px;
}

.xkw-detail-integrity,
.xkw-detail-safety-note {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px 14px;
  border: 1px solid #d8e4fb;
  border-radius: 10px;
  background: #f5f8ff;
  color: #4566a8;
}

.xkw-detail-integrity.is-danger {
  border-color: #f1caca;
  background: #fff7f7;
  color: #b42318;
}

.xkw-detail-safety-note {
  border-color: #cce9df;
  background: #f2fbf7;
  color: #067c5d;
}

.xkw-detail-integrity > div,
.xkw-detail-safety-note > div {
  display: grid;
  gap: 3px;
}

.xkw-detail-integrity strong,
.xkw-detail-safety-note strong {
  font-size: 11.5px;
}

.xkw-detail-integrity span,
.xkw-detail-safety-note span {
  color: var(--xkw-text-secondary);
  font-size: 10px;
}

.xkw-detail-selection {
  position: absolute;
  z-index: 8;
  right: 18px;
  bottom: 62px;
  left: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  gap: 14px;
  padding: 10px 12px 10px 16px;
  border: 1px solid #aac3f8;
  border-radius: 10px;
  background: var(--xkw-surface);
  box-shadow: 0 14px 34px rgba(33, 55, 95, .16);
}

.xkw-detail-selection > div:first-child {
  display: grid;
  gap: 4px;
}

.xkw-detail-selection > div:last-child {
  display: flex;
  gap: 8px;
}

.xkw-detail-selection strong {
  color: var(--xkw-text);
  font-size: 12.5px;
}

.xkw-detail-selection span {
  color: var(--xkw-muted);
  font-size: 10.5px;
}

.xkw-detail-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 58px;
  gap: 16px;
  padding: 9px 16px;
  border-top: 1px solid var(--xkw-line);
}

.xkw-detail-footer > div {
  display: flex;
  align-items: baseline;
  min-width: 0;
  gap: 9px;
}

.xkw-detail-footer strong {
  color: var(--xkw-text);
  font-size: 11px;
}

.xkw-detail-footer span {
  overflow: hidden;
  color: var(--xkw-muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.theme-dark .xkw-detail-dialog,
body.theme-dark .xkw-detail-header,
body.theme-dark .xkw-detail-tabbar,
body.theme-dark .xkw-detail-footer,
body.theme-dark .xkw-detail-metric-strip,
body.theme-dark .xkw-detail-compact-summary,
body.theme-dark .xkw-detail-filters,
body.theme-dark .xkw-detail-more-filters,
body.theme-dark .xkw-detail-table-wrap,
body.theme-dark .xkw-detail-table,
body.theme-dark .xkw-detail-simple-table,
body.theme-dark .xkw-detail-selection,
body.theme-dark .xkw-detail-expansion > section {
  background: var(--xkw-surface);
}

body.theme-dark .xkw-detail-body,
body.theme-dark .xkw-detail-expanded-row > td {
  background: #151e2c;
}

body.theme-dark .xkw-detail-tabbar {
  background: #182334;
}

body.theme-dark .xkw-detail-tabbar button,
body.theme-dark .xkw-detail-secondary-btn,
body.theme-dark .xkw-detail-filter-btn,
body.theme-dark .xkw-detail-quiet-btn,
body.theme-dark .xkw-detail-filters select,
body.theme-dark .xkw-detail-more-filters select,
body.theme-dark .xkw-detail-cell strong,
body.theme-dark .xkw-detail-metric > strong,
body.theme-dark .xkw-detail-reading strong {
  color: #e5eaf2;
}

body.theme-dark .xkw-detail-tabbar button.is-active {
  background: #1d3151;
  color: #bfdbfe;
}

body.theme-dark .xkw-detail-reading,
body.theme-dark .xkw-detail-integrity {
  border-color: #42547a;
  background: #1d2a3e;
}

body.theme-dark .xkw-detail-safety-note {
  border-color: #315c50;
  background: #18332d;
}

body.theme-dark .xkw-detail-table th,
body.theme-dark .xkw-detail-simple-table th {
  background: #222d3e;
  color: #aeb9c8;
}

body.theme-dark .xkw-detail-table tbody tr:not(.xkw-detail-expanded-row):hover,
body.theme-dark .xkw-detail-simple-table tbody tr:hover,
body.theme-dark .xkw-detail-metric:hover {
  background: #202c3d;
}

body.theme-dark .xkw-detail-search,
body.theme-dark .xkw-detail-filters select,
body.theme-dark .xkw-detail-more-filters select,
body.theme-dark .xkw-detail-secondary-btn,
body.theme-dark .xkw-detail-filter-btn {
  border-color: #445168;
  background: #1b2535;
}

body.theme-dark .xkw-detail-search input {
  color: #e5eaf2;
}

@media (max-width: 1180px) {
  .xkw-detail-backdrop {
    padding: 10px;
  }

  .xkw-detail-dialog {
    width: calc(100vw - 20px);
    height: calc(100vh - 20px);
  }

  .xkw-detail-metric-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .xkw-detail-metric:nth-child(3) {
    border-right: 0;
  }

  .xkw-detail-metric:nth-child(-n+3) {
    border-bottom: 1px solid var(--xkw-line);
  }

  .xkw-detail-expansion {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .xkw-detail-backdrop {
    padding: 0;
  }

  .xkw-detail-dialog {
    width: 100vw;
    height: 100dvh;
    border: 0;
    border-radius: 0;
  }

  .xkw-detail-header {
    min-height: 70px;
    padding: 12px 14px;
  }

  .xkw-detail-header h2 {
    font-size: 18px;
  }

  .xkw-detail-header .xkw-detail-quiet-btn {
    display: none;
  }

  .xkw-detail-header .xkw-detail-secondary-btn {
    padding-inline: 10px;
  }

  .xkw-detail-tabbar {
    padding: 8px 12px;
  }

  .xkw-detail-tabbar nav {
    width: 100%;
  }

  .xkw-detail-tabbar button {
    flex: 1 1 0;
    padding-inline: 7px;
  }

  .xkw-detail-tabbar > span {
    display: none;
  }

  .xkw-detail-body {
    padding: 12px 12px 100px;
    scrollbar-gutter: auto;
  }

  .xkw-detail-metric-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .xkw-detail-metric {
    min-height: 82px;
  }

  .xkw-detail-metric:nth-child(odd) {
    border-right: 1px solid var(--xkw-line);
  }

  .xkw-detail-metric:nth-child(even) {
    border-right: 0;
  }

  .xkw-detail-metric:nth-child(-n+4) {
    border-bottom: 1px solid var(--xkw-line);
  }

  .xkw-detail-reading {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .xkw-detail-filters,
  .xkw-detail-more-filters {
    align-items: stretch;
    flex-direction: column;
  }

  .xkw-detail-search,
  .xkw-detail-filters label,
  .xkw-detail-filters select,
  .xkw-detail-more-filters label,
  .xkw-detail-more-filters select,
  .xkw-detail-filter-btn {
    width: 100%;
    min-width: 0;
  }

  .xkw-detail-reset,
  .xkw-detail-more-filters p {
    margin-left: 0;
  }

  .xkw-detail-result-heading > span {
    display: none;
  }

  .xkw-detail-expansion {
    grid-template-columns: 1fr;
    padding-left: 14px;
  }

  .xkw-detail-compact-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .xkw-detail-compact-summary > div:nth-child(2) {
    border-right: 0;
  }

  .xkw-detail-compact-summary > div:nth-child(-n+2) {
    border-bottom: 1px solid var(--xkw-line);
  }

  .xkw-detail-selection {
    align-items: stretch;
    flex-direction: column;
    gap: 8px;
  }

  .xkw-detail-selection > div:last-child,
  .xkw-detail-selection button {
    width: 100%;
  }

  .xkw-detail-footer > div {
    display: none;
  }

  .xkw-detail-footer {
    justify-content: flex-end;
  }
}

@media (prefers-reduced-motion: reduce) {
  .xkw-detail-backdrop *,
  .xkw-detail-backdrop *::before,
  .xkw-detail-backdrop *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}

/* Keep compact layout rules after legacy keyword-detail declarations. */
.xkw-detail-dialog.xkw-kp-shell {
  grid-template-rows: auto auto minmax(0, 1fr) auto;
}

.xkw-kp-shell .kp-body {
  overflow: hidden;
}

.xkw-kp-shell .kp-table {
  border-collapse: separate;
  border-spacing: 0;
}
