/* ── Tools Hub — one quiet card; title accent = color + underline ─ */
.tools-hero {
  position: relative;
  margin-bottom: 18px;
  padding: 10px 12px 11px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(148, 163, 184, 0.14);
  background:
    linear-gradient(
      180deg,
      rgba(52, 211, 153, 0.04) 0%,
      rgba(255, 255, 255, 0.03) 22%,
      rgba(15, 23, 42, 0.35) 100%
    );
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 8px 24px rgba(0, 0, 0, 0.18);
  overflow: hidden;
  isolation: isolate;
}

.tools-hero::before {
  display: none;
}

.tools-hero-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Title zone — same surface as chips; no full-bleed band */
.tools-hero-header {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  padding: 1px 2px 0;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}

.tools-hero-header::before {
  display: none;
}

.tools-hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  align-self: flex-start;
  padding: 0;
  margin: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted, rgba(148, 163, 184, 0.78));
}

.tools-hero-eyebrow-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 12px;
  height: 12px;
  border-radius: 0;
  background: transparent;
  opacity: 0.75;
}

.tools-hero-eyebrow-icon svg {
  width: 9px;
  height: 9px;
  color: rgba(134, 239, 172, 0.7);
}

.tools-hero-title-wrap {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
  max-width: 100%;
  /* Soft mint wash only behind the title word — not full card width */
  padding: 1px 7px 2px 6px;
  margin-left: -6px;
  border-radius: 6px;
  background: rgba(52, 211, 153, 0.07);
}

.tools-hero-title {
  margin: 0;
  display: inline-block;
  padding: 0;
  font-size: 1.32rem;
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.2;
  color: #bbf7d0;
  background: transparent;
  text-shadow: none;
}

/* Thin accent underline under “Công Cụ” */
.tools-hero-title-wrap::after {
  content: "";
  display: block;
  width: 1.85em;
  max-width: 100%;
  height: 2px;
  margin-top: 4px;
  margin-left: 0;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    rgba(167, 243, 208, 0.9) 0%,
    rgba(52, 211, 153, 0.55) 60%,
    rgba(134, 239, 172, 0.05) 100%
  );
}

.tools-hero-lead {
  margin: 1px 0 0;
  max-width: 62ch;
  color: var(--text-secondary, rgba(203, 213, 225, 0.82));
  font-size: 0.78rem;
  font-weight: 400;
  line-height: 1.45;
}

/* Chips share the same card surface — soft divider only */
.tools-hero-chips-wrap {
  position: relative;
  padding: 8px 2px 2px;
  border-top: 1px solid rgba(148, 163, 184, 0.1);
}

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

.tools-hero-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 8px;
  font: inherit;
  font-size: 0.6875rem;
  font-weight: 575;
  letter-spacing: 0.005em;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-secondary);
  transition:
    border-color 0.15s ease,
    background 0.15s ease,
    color 0.15s ease,
    box-shadow 0.15s ease;
  user-select: none;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

/* Author display:* must not defeat HTML [hidden] (admin-only tools stay invisible). */
.tools-hero-chip[hidden],
.tools-nav-btn[hidden],
.tools-panel[hidden],
.tools-panel.is-active[hidden] {
  display: none !important;
}

button.tools-hero-chip {
  appearance: none;
  -webkit-appearance: none;
}

.tools-hero-chip.is-active {
  box-shadow: 0 0 0 1px rgba(134, 239, 172, 0.28);
}

.tools-hero-chip:not(.tools-hero-chip--soon):hover {
  border-color: rgba(134, 239, 172, 0.28);
  background: rgba(134, 239, 172, 0.05);
}

.tools-hero-chip--yt.is-active {
  border-color: rgba(239, 68, 68, 0.28);
  background: rgba(239, 68, 68, 0.07);
  color: rgba(252, 165, 165, 0.92);
}

.tools-hero-chip--yt.is-active:hover {
  box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.22);
}

.tools-hero-chip--kw.is-active {
  border-color: rgba(103, 232, 249, 0.28);
  background: rgba(103, 232, 249, 0.07);
  color: rgba(165, 243, 252, 0.92);
}

.tools-hero-chip--kw.is-active:hover {
  box-shadow: 0 0 0 1px rgba(103, 232, 249, 0.22);
}

.tools-hero-chip--cl.is-active {
  border-color: rgba(52, 211, 153, 0.32);
  background: rgba(52, 211, 153, 0.08);
  color: rgba(167, 243, 208, 0.95);
}

.tools-hero-chip--cl.is-active:hover {
  box-shadow: 0 0 0 1px rgba(52, 211, 153, 0.22);
}

.tools-hero-chip--soon {
  opacity: 0.55;
}

.tools-hero-chip-icon {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  font-size: 0.58rem;
  line-height: 1;
  opacity: 0.9;
}

@media (min-width: 769px) {
  .tools-hero {
    padding: 10px 12px 11px;
    margin-bottom: 16px;
  }

  .tools-hero-content {
    gap: 7px;
  }

  .tools-hero-header {
    padding: 1px 2px 0;
  }

  .tools-hero-title {
    font-size: 1.28rem;
  }

  .tools-hero-title-wrap {
    padding: 1px 6px 2px 5px;
    margin-left: -5px;
  }

  .tools-hero-title-wrap::after {
    width: 1.75em;
    margin-top: 3px;
  }

  .tools-hero-lead {
    font-size: 0.76rem;
  }

  .tools-hero-chips-wrap {
    padding: 7px 2px 1px;
  }

  .tools-hero-chips {
    gap: 5px;
  }

  .tools-hero-chip {
    padding: 3px 9px;
    font-size: 0.66rem;
    gap: 4px;
  }
}

/* ── Light theme overrides ── */
html[data-theme="light"] .tools-hero {
  border-color: rgba(100, 116, 139, 0.18);
  background: linear-gradient(
    180deg,
    rgba(21, 128, 61, 0.035) 0%,
    #f8fafc 28%,
    #f1f5f9 100%
  );
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    0 6px 18px rgba(15, 23, 42, 0.05);
}

html[data-theme="light"] .tools-hero-header {
  border: none;
  background: transparent;
  box-shadow: none;
}

html[data-theme="light"] .tools-hero-header::before {
  display: none;
}

html[data-theme="light"] .tools-hero-eyebrow {
  border: none;
  background: transparent;
  color: var(--text-muted, rgba(100, 116, 139, 0.85));
}

html[data-theme="light"] .tools-hero-eyebrow-icon {
  background: transparent;
}

html[data-theme="light"] .tools-hero-eyebrow-icon svg {
  color: rgba(21, 128, 61, 0.55);
}

html[data-theme="light"] .tools-hero-title-wrap {
  background: rgba(21, 128, 61, 0.06);
}

html[data-theme="light"] .tools-hero-title {
  color: #166534;
  background: transparent;
  text-shadow: none;
}

html[data-theme="light"] .tools-hero-title-wrap::after {
  background: linear-gradient(
    90deg,
    rgba(22, 101, 52, 0.75) 0%,
    rgba(22, 101, 52, 0.4) 55%,
    rgba(22, 101, 52, 0.05) 100%
  );
}

html[data-theme="light"] .tools-hero-lead {
  color: var(--text-secondary, rgba(71, 85, 105, 0.88));
}

html[data-theme="light"] .tools-hero-chips-wrap {
  border-top-color: rgba(100, 116, 139, 0.12);
}

html[data-theme="light"] .tools-hero-chip:not(.tools-hero-chip--soon):hover {
  border-color: rgba(61, 122, 74, 0.28);
  background: rgba(61, 122, 74, 0.05);
}

html[data-theme="light"] .tools-hero-chip--yt.is-active {
  border-color: rgba(220, 38, 38, 0.28);
  background: rgba(220, 38, 38, 0.06);
  color: rgba(185, 28, 28, 0.88);
}

html[data-theme="light"] .tools-hero-chip--kw.is-active {
  border-color: rgba(14, 116, 144, 0.28);
  background: rgba(14, 116, 144, 0.06);
  color: rgba(14, 116, 144, 0.9);
}

html[data-theme="light"] .tools-hero-chip--cl.is-active {
  border-color: rgba(21, 128, 61, 0.28);
  background: rgba(21, 128, 61, 0.06);
  color: rgba(21, 128, 61, 0.92);
}

/* ── Link Checklist ─────────────────────────────────────────── */

.checklist-section .trending-section-lead {
  max-width: 42rem;
  margin-top: 0.35rem;
  color: var(--text-muted, rgba(255, 255, 255, 0.62));
  font-size: 0.95rem;
  line-height: 1.55;
}

.checklist-sticky-toolbar {
  position: sticky;
  top: calc(var(--nav-height, 64px) + 0.5rem);
  z-index: 12;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.45rem 0.65rem;
  padding: 0.5rem 0.7rem;
  margin-bottom: 0.65rem;
  border: 1px solid rgba(34, 211, 238, 0.14);
  transition: box-shadow var(--dur-fast, 220ms) ease, border-color var(--dur-fast, 220ms) ease;
}

.checklist-sticky-toolbar:hover {
  border-color: rgba(34, 211, 238, 0.28);
  box-shadow: 0 8px 28px rgba(34, 211, 238, 0.08), 0 4px 16px rgba(167, 139, 250, 0.06);
}

.checklist-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem;
  margin-left: auto;
}

.checklist-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  padding: 0.32rem 0.62rem;
  min-height: 1.75rem;
  border-radius: 999px;
  font-family: var(--font);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  border: 1px solid transparent;
  background: transparent;
  transition:
    transform var(--dur-fast, 220ms) cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow var(--dur-fast, 220ms) ease,
    border-color var(--dur-fast, 220ms) ease,
    background var(--dur-fast, 220ms) ease,
    color var(--dur-fast, 220ms) ease,
    opacity var(--dur-fast, 220ms) ease;
}

.checklist-btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1;
  opacity: 0.9;
}

.checklist-btn--primary {
  color: rgba(207, 250, 254, 0.96);
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.18), rgba(167, 139, 250, 0.22));
  border-color: rgba(34, 211, 238, 0.42);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 2px 10px rgba(34, 211, 238, 0.12);
}

.checklist-btn--primary:hover:not(:disabled) {
  transform: none;
  border-color: rgba(103, 232, 249, 0.65);
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.28), rgba(167, 139, 250, 0.32));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 4px 18px rgba(34, 211, 238, 0.32),
    0 0 20px rgba(34, 211, 238, 0.18);
}

.checklist-btn--secondary {
  color: rgba(196, 181, 253, 0.92);
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(167, 139, 250, 0.32);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.checklist-btn--secondary:hover:not(:disabled) {
  transform: none;
  color: rgba(221, 214, 254, 0.98);
  border-color: rgba(167, 139, 250, 0.55);
  background: rgba(167, 139, 250, 0.1);
  box-shadow:
    0 4px 16px rgba(167, 139, 250, 0.2),
    0 0 14px rgba(167, 139, 250, 0.12);
}

.checklist-btn:disabled {
  opacity: 0.38;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.checklist-btn:focus-visible {
  outline: 2px solid rgba(34, 211, 238, 0.55);
  outline-offset: 2px;
}

html[data-theme="light"] .checklist-btn--primary {
  color: #0e7490;
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.14), rgba(167, 139, 250, 0.12));
  border-color: rgba(14, 116, 144, 0.35);
}

html[data-theme="light"] .checklist-btn--secondary {
  color: #6d28d9;
  background: rgba(255, 255, 255, 0.72);
  border-color: rgba(109, 40, 217, 0.28);
}

.checklist-progress-wrap {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.45rem 0.75rem;
  margin-bottom: 0.65rem;
  border: 1px solid rgba(167, 139, 250, 0.14);
}

.checklist-progress-track {
  flex: 1;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.checklist-progress-bar {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, #22d3ee, #a78bfa);
  transition: width 480ms cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: 0 0 12px rgba(34, 211, 238, 0.45);
}

.checklist-progress-text {
  flex-shrink: 0;
  font-weight: 600;
  color: rgba(165, 243, 252, 0.9);
  font-size: 0.76rem;
  min-width: 5.5rem;
  text-align: right;
}

.checklist-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-height: 2rem;
}

.checklist-item {
  display: grid;
  grid-template-columns: auto auto auto 1fr auto;
  align-items: center;
  gap: 0.25rem 0.45rem;
  padding: 0.4rem 0.55rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: transform var(--dur-fast, 220ms) ease, border-color var(--dur-fast, 220ms) ease, box-shadow var(--dur-fast, 220ms) ease, opacity var(--dur-fast, 220ms) ease;
  animation: motionFadeUp var(--dur-normal, 380ms) var(--ease-out-expo, cubic-bezier(0.16, 1, 0.3, 1)) both;
}

.checklist-item:hover {
  border-color: rgba(34, 211, 238, 0.22);
  box-shadow: 0 0 0 1px rgba(34, 211, 238, 0.14), 0 8px 24px rgba(34, 211, 238, 0.1);
  transform: none;
}

.checklist-item.has-link {
  cursor: pointer;
}

.checklist-item.has-link:hover {
  border-color: rgba(34, 211, 238, 0.38);
  box-shadow: 0 8px 28px rgba(34, 211, 238, 0.14), 0 4px 14px rgba(167, 139, 250, 0.1);
}

.checklist-item.has-link:focus-visible {
  outline: 2px solid rgba(34, 211, 238, 0.55);
  outline-offset: 2px;
}

.checklist-item.is-done {
  opacity: 0.62;
}

.checklist-item.is-done .checklist-item-title,
.checklist-item.is-done .checklist-item-title-display {
  text-decoration: line-through;
  color: rgba(255, 255, 255, 0.45);
}

.checklist-item-grip {
  display: grid;
  grid-template-columns: repeat(2, 3px);
  gap: 2px;
  align-self: center;
  opacity: 0.35;
}

.checklist-item-grip-dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: currentColor;
}

.checklist-item-check {
  position: relative;
  display: flex;
  align-items: center;
  align-self: center;
  cursor: pointer;
}

.checklist-item-cb {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.checklist-item-check-ui {
  width: 1rem;
  height: 1rem;
  border-radius: 0.28rem;
  border: 2px solid rgba(34, 211, 238, 0.45);
  background: rgba(34, 211, 238, 0.06);
  transition: background var(--dur-fast, 220ms) ease, border-color var(--dur-fast, 220ms) ease, box-shadow var(--dur-fast, 220ms) ease;
}

.checklist-item-cb:checked + .checklist-item-check-ui {
  background: linear-gradient(135deg, #22d3ee, #a78bfa);
  border-color: transparent;
  box-shadow: 0 0 10px rgba(34, 211, 238, 0.4);
}

.checklist-item-cb:checked + .checklist-item-check-ui::after {
  content: "";
  display: block;
  width: 0.35rem;
  height: 0.6rem;
  margin: 0.05rem auto 0;
  border: solid #0a0e17;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.checklist-item-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  min-width: 1.65rem;
  height: 1.65rem;
  padding: 0 0.15rem;
  border-radius: 0.35rem;
  background: rgba(167, 139, 250, 0.1);
  border: 1px solid rgba(167, 139, 250, 0.2);
  font-size: 0.95rem;
  line-height: 1;
  outline: none;
}

.checklist-item-icon:focus {
  border-color: rgba(34, 211, 238, 0.5);
  box-shadow: 0 0 0 2px rgba(34, 211, 238, 0.15);
}

.checklist-item-fields {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.checklist-item-title-row {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  min-width: 0;
}

.checklist-item-title,
.checklist-item-url,
.checklist-item-category {
  padding: 0.28rem 0.45rem;
  border-radius: 0.35rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.18);
  color: inherit;
  font: inherit;
  font-size: 0.8rem;
  line-height: 1.25;
  transition: border-color var(--dur-fast, 220ms) ease, box-shadow var(--dur-fast, 220ms) ease;
}

.checklist-item-title-display {
  flex: 1;
  min-width: 0;
  font-weight: 600;
  font-size: 0.8rem;
  line-height: 1.25;
  padding: 0.28rem 0.1rem;
}

.checklist-item-placeholder {
  color: rgba(255, 255, 255, 0.35);
  font-weight: 500;
}

.checklist-item-category-display {
  flex: 0 0 auto;
  max-width: 5rem;
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.55);
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
  background: rgba(167, 139, 250, 0.12);
  border: 1px solid rgba(167, 139, 250, 0.2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.checklist-item-clickable {
  cursor: inherit;
}

.checklist-item-title:focus,
.checklist-item-url:focus,
.checklist-item-category:focus {
  outline: none;
  border-color: rgba(34, 211, 238, 0.45);
  box-shadow: 0 0 0 2px rgba(34, 211, 238, 0.12);
}

.checklist-item-title {
  flex: 1;
  min-width: 0;
  font-weight: 600;
}

.checklist-item-category {
  flex: 0 0 5rem;
  width: 5rem;
  max-width: 5rem;
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.55);
  padding: 0.28rem 0.35rem;
}

.checklist-item-url-row {
  display: none;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.3rem;
}

.checklist-item.is-editing .checklist-item-url-row {
  display: flex;
}

.checklist-item-url {
  flex: 1;
  min-width: 0;
  font-size: 0.75rem;
  color: rgba(165, 243, 252, 0.85);
}

.checklist-item-actions {
  display: flex;
  flex-direction: row;
  align-items: center;
  align-self: center;
  gap: 0.15rem;
}

.checklist-item-move,
.checklist-item-edit,
.checklist-item-delete {
  min-width: 1.5rem;
  width: 1.5rem;
  height: 1.5rem;
  padding: 0;
  font-size: 0.78rem;
  line-height: 1;
}

.checklist-item-edit {
  color: rgba(165, 243, 252, 0.85);
}

.checklist-item-edit[aria-pressed="true"] {
  color: rgba(34, 211, 238, 0.95);
  background: rgba(34, 211, 238, 0.12);
}

.checklist-item-delete {
  color: rgba(248, 113, 113, 0.9);
}

html[data-theme="light"] .checklist-item-title,
html[data-theme="light"] .checklist-item-url,
html[data-theme="light"] .checklist-item-category {
  background: rgba(255, 255, 255, 0.7);
  border-color: rgba(15, 23, 42, 0.12);
}

html[data-theme="light"] .checklist-progress-text {
  color: rgba(8, 145, 178, 0.95);
}

html[data-theme="light"] .checklist-item.is-done .checklist-item-title,
html[data-theme="light"] .checklist-item.is-done .checklist-item-title-display {
  color: rgba(15, 23, 42, 0.4);
}

html[data-theme="light"] .checklist-item-placeholder {
  color: rgba(15, 23, 42, 0.35);
}

html[data-theme="light"] .checklist-item-category-display {
  color: rgba(15, 23, 42, 0.55);
  background: rgba(167, 139, 250, 0.1);
  border-color: rgba(167, 139, 250, 0.18);
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  .tools-hero-chip:not(.tools-hero-chip--soon):hover {
    transform: none;
  }

  .checklist-item {
    animation: none !important;
  }

  .checklist-item:hover {
    transform: none;
  }
}

/* ── Mobile hero (compact) — see also 768px tools polish at file end ── */
@media (max-width: 640px) {
  .tools-hero {
    padding: 9px 10px 10px;
    margin-bottom: 14px;
  }

  .tools-hero-header {
    padding: 1px 1px 0;
  }

  .tools-hero-title {
    font-size: 1.2rem;
  }

  .tools-hero-title-wrap {
    padding: 1px 6px 2px 5px;
    margin-left: -5px;
  }

  .tools-hero-title-wrap::after {
    width: 1.7em;
    height: 2px;
    margin-top: 3px;
  }

  .tools-hero-lead {
    font-size: 0.74rem;
  }
}

/* Tools hub layout */
.tools-layout {
  display: grid;
  grid-template-columns: minmax(200px, 240px) 1fr;
  gap: 24px;
  align-items: start;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.tools-sidebar {
  position: sticky;
  top: calc(var(--nav-h) + 12px);
  padding: 10px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  min-width: 0;
  grid-column: 1;
  align-self: start;
}

.tools-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* translateY on .reveal breaks position:sticky — use opacity-only here */
.tools-layout.reveal {
  transform: none;
  transition: opacity 0.8s var(--ease);
}

.tools-layout.reveal.show {
  transform: none;
}

/* Tools hub — phone only: stack sidebar as horizontal tabs */
@media (max-width: 768px) {
  .tools-layout {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .tools-sidebar {
    position: static;
    grid-column: 1;
    z-index: 2;
  }

  .tools-content {
    grid-column: 1;
    grid-row: 2;
  }

  .tools-nav {
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 6px;
    padding-bottom: 2px;
  }

  .tools-nav::-webkit-scrollbar {
    display: none;
  }

  .tools-nav-btn {
    flex: 0 0 auto;
    white-space: nowrap;
    min-height: 40px;
    padding: 8px 11px;
    touch-action: manipulation;
  }
}

.tools-nav-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text-secondary);
  font: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.tools-nav-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
}

.tools-nav-btn.is-active {
  background: rgba(134, 239, 172, 0.1);
  border-color: var(--accent-border, rgba(134, 239, 172, 0.35));
  color: var(--text-primary);
}

.tools-nav-btn.is-disabled,
.tools-nav-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.tools-nav-icon {
  flex-shrink: 0;
  width: 1.25em;
  text-align: center;
  font-size: 0.78rem;
  opacity: 0.75;
}

.tools-nav-icon svg {
  display: block;
  width: 1.15em;
  height: 1.15em;
  margin: 0 auto;
}

.tools-content {
  min-width: 0;
  grid-column: 2;
  padding-top: 10px;
}

.tools-panel {
  display: none;
}

.tools-panel.is-active {
  display: block;
}

.trending-section {
  margin-top: 0;
}

.trending-section-head {
  margin-bottom: 20px;
}

.trending-section-head h2 {
  margin: 0 0 8px;
  font-size: clamp(1.25rem, 2.5vw, 1.6rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.trending-section-head p {
  margin: 0;
  max-width: 62ch;
  color: var(--text-secondary);
  font-size: 0.88rem;
}

.trending-hero {
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.trending-hero h1 {
  margin: 0 0 8px;
  font-size: clamp(1.6rem, 3.5vw, 2.25rem);
  font-weight: 800;
  letter-spacing: -0.03em;
}

.trending-hero p {
  margin: 0;
  max-width: 62ch;
  color: var(--text-secondary);
  font-size: 0.92rem;
}

.trending-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 20px;
  margin-bottom: 20px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}

/* glass-card sets overflow:hidden — release when region or period menu is open */
.trending-toolbar.glass-card.has-region-open,
.trending-toolbar.glass-card:has(.trending-region-select.is-open),
.trending-toolbar.glass-card.has-period-open,
.trending-toolbar.glass-card:has(.trending-period-select.is-open) {
  overflow: visible;
  z-index: 200;
  isolation: isolate;
}

.trending-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.trending-region-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 200px;
}

.trending-region-label-text {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.trending-region-select {
  position: relative;
  z-index: 20;
}

.trending-region-select.is-open {
  z-index: 1200;
}

.trending-region-field:has(.trending-region-select.is-open) {
  position: relative;
  z-index: 1200;
}

.trending-region-trigger {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-width: 200px;
  min-height: 40px;
  padding: 9px 36px 9px 12px;
  border-radius: var(--radius-sm, 10px);
  border: 1px solid var(--border-strong, rgba(255, 255, 255, 0.12));
  background: rgba(255, 255, 255, 0.045);
  color: var(--text-primary, var(--text));
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    background 0.2s ease,
    color 0.2s ease;
}

.trending-region-trigger:hover,
.trending-region-select.is-open .trending-region-trigger {
  border-color: rgba(103, 232, 249, 0.4);
  background: rgba(103, 232, 249, 0.08);
  box-shadow: 0 0 0 1px rgba(103, 232, 249, 0.1);
}

.trending-region-trigger:focus-visible {
  outline: none;
  border-color: rgba(103, 232, 249, 0.55);
  box-shadow: 0 0 0 3px rgba(103, 232, 249, 0.14);
}

.trending-region-trigger::after {
  content: "";
  position: absolute;
  right: 14px;
  top: 50%;
  width: 0;
  height: 0;
  margin-top: -2px;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid var(--text-secondary);
  pointer-events: none;
  transition: transform 0.2s ease, border-top-color 0.2s ease;
}

.trending-region-select.is-open .trending-region-trigger::after {
  transform: rotate(180deg);
  margin-top: -4px;
  border-top-color: var(--accent-cyan, #67e8f9);
}

.trending-region-trigger-inner {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.trending-region-flag {
  flex-shrink: 0;
  font-size: 1rem;
  line-height: 1;
}

.trending-region-code {
  flex-shrink: 0;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
}

.trending-region-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trending-region-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 1200;
  margin: 0;
  padding: 6px;
  list-style: none;
  border-radius: 14px;
  border: 1px solid rgba(103, 232, 249, 0.2);
  background: rgba(12, 18, 32, 0.97);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  isolation: isolate;
  box-shadow:
    0 16px 48px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(255, 255, 255, 0.04);
  max-height: 280px;
  overflow-x: hidden;
  overflow-y: auto;
  color-scheme: dark;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.22) transparent;
  animation: trending-drop-in 0.2s var(--ease, cubic-bezier(0.22, 1, 0.36, 1));
  transform-origin: top center;
}

@keyframes trending-drop-in {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.trending-region-menu::-webkit-scrollbar {
  width: 6px;
}

.trending-region-menu::-webkit-scrollbar-button {
  display: none;
  width: 0;
  height: 0;
}

.trending-region-menu::-webkit-scrollbar-track {
  background: transparent;
}

.trending-region-menu::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.18);
  border-radius: 999px;
}

.trending-region-menu:hover::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.28);
}

.trending-region-menu::-webkit-scrollbar-thumb:hover {
  background: rgba(134, 239, 172, 0.45);
}

.trending-region-menu[hidden] {
  display: none !important;
}

html[data-theme="light"] .trending-region-menu {
  background: rgba(255, 255, 255, 0.98);
  border-color: rgba(61, 122, 74, 0.28);
  box-shadow:
    0 16px 40px rgba(45, 90, 76, 0.14),
    0 0 0 1px rgba(61, 122, 74, 0.08);
  color-scheme: light;
  scrollbar-color: rgba(84, 115, 152, 0.35) transparent;
}

html[data-theme="light"] .trending-region-menu::-webkit-scrollbar-thumb {
  background: rgba(84, 115, 152, 0.28);
}

html[data-theme="light"] .trending-region-menu:hover::-webkit-scrollbar-thumb {
  background: rgba(84, 115, 152, 0.42);
}

html[data-theme="light"] .trending-region-menu::-webkit-scrollbar-thumb:hover {
  background: rgba(61, 122, 74, 0.5);
}

.trending-region-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-secondary, var(--text));
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.trending-region-option:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary, var(--text));
}

.trending-region-option.is-selected {
  background: rgba(103, 232, 249, 0.12);
  color: var(--accent-cyan, #67e8f9);
  font-weight: 700;
}

.trending-region-option.is-selected::after {
  content: "✓";
  margin-left: auto;
  font-size: 0.75rem;
  color: var(--accent-cyan, #67e8f9);
}

html[data-theme="light"] .trending-region-option:hover {
  background: rgba(61, 122, 74, 0.1);
}

html[data-theme="light"] .trending-region-option.is-selected {
  background: rgba(61, 122, 74, 0.14);
  color: #2d5a4c;
}

html[data-theme="light"] .trending-region-option.is-selected::after {
  color: #2d5a4c;
}

.trending-search-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1 1 200px;
  min-width: 0;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.trending-search-field--channel {
  flex: 1 1 220px;
}

.trending-search-input {
  width: 100%;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-primary);
  font: inherit;
  font-size: 0.88rem;
  transition: border-color var(--dur-fast, 220ms) var(--ease), box-shadow var(--dur-fast, 220ms) var(--ease), background var(--dur-fast, 220ms) var(--ease);
}

.trending-search-input:focus {
  outline: none;
  border-color: var(--field-border-cyan, rgba(103, 232, 249, 0.45));
  background: rgba(103, 232, 249, 0.06);
  box-shadow: 0 0 0 1px rgba(103, 232, 249, 0.1), 0 0 20px var(--field-glow-cyan, rgba(103, 232, 249, 0.08));
}

.trending-search-input::placeholder {
  color: var(--text-muted, var(--text-secondary));
  opacity: 0.75;
}

.trending-filters {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px 20px;
  margin-bottom: 12px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}

.trending-filters-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 16px 20px;
}

.trending-filters-row.is-shorts-filter .trending-duration-fieldset,
.trending-filters-row.is-live-filter .trending-duration-fieldset {
  display: none;
}

.trending-filter-fieldset {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
  flex: 0 1 auto;
}

.trending-filter-fieldset legend {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  padding: 0;
}

.trending-filter-type-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.trending-filter-radio {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.trending-filter-radio:has(input:checked) {
  border-color: var(--accent-border, rgba(134, 239, 172, 0.35));
  background: rgba(134, 239, 172, 0.08);
  color: var(--text-primary);
}

.trending-filter-radio input {
  accent-color: var(--accent, #86efac);
}

.trending-filter-duration {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.trending-filter-input {
  width: 120px;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-primary);
  font: inherit;
  font-size: 0.88rem;
  transition: border-color var(--dur-fast, 220ms) var(--ease), box-shadow var(--dur-fast, 220ms) var(--ease), background var(--dur-fast, 220ms) var(--ease);
}

.trending-filter-input:focus {
  outline: none;
  border-color: var(--field-border-cyan, rgba(103, 232, 249, 0.45));
  background: rgba(103, 232, 249, 0.06);
  box-shadow: 0 0 0 1px rgba(103, 232, 249, 0.1), 0 0 20px var(--field-glow-cyan, rgba(103, 232, 249, 0.08));
}

.trending-filter-count {
  margin: 0 0 16px;
  font-size: 0.82rem;
  color: var(--text-muted, var(--text-secondary));
}

.trending-gate {
  padding: 28px 24px;
  text-align: center;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  margin-bottom: 20px;
}

.trending-gate p {
  margin: 0 0 16px;
  color: var(--text-secondary);
}

/* Always visible — not tied to scroll-reveal opacity */
.trending-feedback {
  opacity: 1;
  transform: none;
}

.trending-error-banner {
  padding: 16px 18px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(239, 68, 68, 0.4);
  background: rgba(239, 68, 68, 0.1);
  color: #fca5a5;
  font-size: 0.88rem;
  margin-bottom: 16px;
}

.trending-error-banner.is-ok {
  border-color: rgba(34, 197, 94, 0.45);
  background: rgba(34, 197, 94, 0.12);
  color: #86efac;
}

.trending-error-banner strong {
  display: block;
  color: #f87171;
  font-weight: 700;
  margin-bottom: 4px;
}

.trending-error-hint {
  margin: 8px 0 0;
  color: var(--text-secondary);
  font-size: 0.82rem;
  line-height: 1.5;
}

.trending-status {
  padding: 14px 18px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-secondary);
  font-size: 0.88rem;
  margin-bottom: 20px;
}

.trending-status.is-error {
  border-color: rgba(239, 68, 68, 0.35);
  color: #f87171;
  background: rgba(239, 68, 68, 0.08);
}

/* ── Premium loading state ───────────────────────────────── */
.trending-status.is-loading {
  padding: 0;
  overflow: hidden;
  border-color: transparent;
  background: transparent;
  position: relative;
}

/* Animated gradient border ring */
.trending-status.is-loading::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius-md);
  padding: 1.5px;
  background: linear-gradient(
    120deg,
    rgba(167, 139, 250, 0.55),
    rgba(103, 232, 249, 0.65),
    rgba(139, 191, 149, 0.55),
    rgba(167, 139, 250, 0.55)
  );
  background-size: 300% 300%;
  animation: tlBorderSpin 3s linear infinite;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

html[data-theme="light"] .trending-status.is-loading::before {
  background: linear-gradient(
    120deg,
    rgba(61, 122, 74, 0.6),
    rgba(95, 195, 198, 0.7),
    rgba(139, 191, 149, 0.5),
    rgba(61, 122, 74, 0.6)
  );
  background-size: 300% 300%;
}

@keyframes tlBorderSpin {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Shimmer scan bar */
.tl-load-bar {
  position: relative;
  height: 3px;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  background: var(--surface-2);
  overflow: hidden;
}

.tl-load-bar-fill {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(167, 139, 250, 0.7) 30%,
    rgba(103, 232, 249, 0.9) 50%,
    rgba(167, 139, 250, 0.7) 70%,
    transparent 100%
  );
  animation: tlBarSweep 1.8s ease-in-out infinite;
}

html[data-theme="light"] .tl-load-bar-fill {
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(61, 122, 74, 0.6) 30%,
    rgba(95, 195, 198, 0.85) 50%,
    rgba(61, 122, 74, 0.6) 70%,
    transparent 100%
  );
}

@keyframes tlBarSweep {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(200%); }
}

/* Inner body */
.tl-load-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 24px 20px 20px;
  background: var(--surface);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
}

html[data-theme="light"] .tl-load-body {
  background: rgba(232, 245, 233, 0.7);
}

/* YouTube icon */
.tl-load-icon {
  color: var(--accent-cyan);
  animation: tlIconPulse 2s ease-in-out infinite;
  filter: drop-shadow(0 0 12px rgba(103, 232, 249, 0.5));
}

html[data-theme="light"] .tl-load-icon {
  color: var(--accent-violet);
  filter: drop-shadow(0 0 10px rgba(61, 122, 74, 0.35));
}

@keyframes tlIconPulse {
  0%, 100% { transform: scale(1);    opacity: 0.9; }
  50%       { transform: scale(1.12); opacity: 1;   }
}

/* Loading text */
.tl-load-text {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-align: center;
  letter-spacing: 0.01em;
  animation: tlTextFade 2.5s ease-in-out infinite;
}

@keyframes tlTextFade {
  0%, 100% { opacity: 0.7; }
  50%       { opacity: 1; }
}

/* Pulsing dots */
.tl-load-dots {
  display: flex;
  gap: 6px;
  align-items: center;
}

.tl-load-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-cyan);
  animation: tlDotBounce 1.2s ease-in-out infinite both;
}

html[data-theme="light"] .tl-load-dots span {
  background: var(--accent-violet);
}

.tl-load-dots span:nth-child(1) { animation-delay: 0s; }
.tl-load-dots span:nth-child(2) { animation-delay: 0.18s; }
.tl-load-dots span:nth-child(3) { animation-delay: 0.36s; }

@keyframes tlDotBounce {
  0%, 80%, 100% { transform: scale(0.55); opacity: 0.35; }
  40%           { transform: scale(1.1);  opacity: 1; }
}

.trending-status.is-loading.is-paginating {
  border-color: transparent;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .trending-status.is-loading::before,
  .tl-load-bar-fill,
  .tl-load-icon,
  .tl-load-text,
  .tl-load-dots span {
    animation: none !important;
  }
}

.trending-max-results-wrap {
  min-width: 0;
  align-self: flex-start;
}

.trending-max-results-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
}

.trending-max-results-row .trending-filter-input {
  flex: 1 1 72px;
  min-width: 72px;
  max-width: 120px;
}

.trending-unlimited-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
}

.trending-unlimited-cb {
  width: 15px;
  height: 15px;
  accent-color: var(--accent, #6366f1);
  cursor: pointer;
}

.trending-filter-input:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.trending-status.is-empty {
  border-style: dashed;
  text-align: center;
}

.trending-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px;
}

.trending-card {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.04) 0%, rgba(255, 255, 255, 0.01) 100%);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.trending-card:hover {
  transform: none;
  border-color: var(--accent-border, rgba(134, 239, 172, 0.35));
  box-shadow: 0 0 0 1px rgba(103, 232, 249, 0.12), var(--shadow-md);
}

.trending-card-thumb {
  position: relative;
  background: rgba(0, 0, 0, 0.25);
  overflow: hidden;
}

.trending-card--long .trending-card-thumb {
  aspect-ratio: 16 / 9;
}

.trending-card--short .trending-card-thumb {
  aspect-ratio: 9 / 16;
}

.trending-card--short {
  max-width: 240px;
  justify-self: center;
}

.trending-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.trending-card-rank {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
}

.trending-card-duration {
  position: absolute;
  bottom: 8px;
  right: 8px;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  font-variant-numeric: tabular-nums;
}

.trending-card--live .trending-card-thumb {
  aspect-ratio: 16 / 9;
}

.trending-card--live .trending-card-duration {
  background: rgba(220, 38, 38, 0.88);
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.trending-card-body {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.trending-card-title {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.trending-card-channel {
  margin: 0;
  font-size: 0.78rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.trending-card-meta {
  margin-top: auto;
  padding-top: 8px;
  font-size: 0.72rem;
  color: var(--text-muted, var(--text-secondary));
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.trending-card-trend {
  color: var(--accent, #22c55e);
  font-weight: 600;
}

.trending-card-growth {
  color: var(--accent-cyan, #06b6d4);
  font-weight: 600;
}

/* Period filter (keyword search only) */
.search-period-field {
  min-width: 160px;
}

.search-period-field .trending-region-trigger {
  min-width: 160px;
}

.trending-period-select {
  position: relative;
  z-index: 20;
}

.trending-period-select.is-open {
  z-index: 1200;
}

.trending-region-field:has(.trending-period-select.is-open) {
  position: relative;
  z-index: 1200;
}

.trending-period-option {
  display: flex;
  align-items: center;
  padding: 8px 10px;
  border-radius: calc(var(--radius-md) - 2px);
  font-size: 0.86rem;
  color: var(--text-secondary, var(--text));
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}

.trending-period-option:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary, var(--text));
}

.trending-period-option.is-selected {
  background: rgba(134, 239, 172, 0.18);
  color: var(--text-primary, var(--text));
  font-weight: 600;
}

html[data-theme="light"] .trending-period-option:hover {
  background: rgba(61, 122, 74, 0.1);
}

html[data-theme="light"] .trending-period-option.is-selected {
  background: rgba(61, 122, 74, 0.16);
}

/* ── Filter panel collapse toggle ───────────────────────── */
.trending-filters-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.trending-filters-title {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  user-select: none;
}

.trending-filters-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  padding: 0;
  border-radius: var(--radius-sm, 6px);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.trending-filters-toggle:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: var(--border);
  color: var(--text-primary);
}

html[data-theme="light"] .trending-filters-toggle:hover {
  background: rgba(0, 0, 0, 0.05);
}

.trending-filters-chevron {
  width: 14px;
  height: 14px;
  pointer-events: none;
  transition: transform 0.25s ease;
}

.trending-filters.is-collapsed .trending-filters-chevron {
  transform: rotate(180deg);
}

.trending-filters-body {
  display: grid;
  grid-template-rows: 1fr;
  opacity: 1;
  transition: grid-template-rows 0.28s ease, opacity 0.22s ease, margin-top 0.22s ease;
}

.trending-filters.is-collapsed .trending-filters-body {
  grid-template-rows: 0fr;
  opacity: 0;
  margin-top: -10px; /* cancel flex gap so header sits flush */
}

.trending-filters-body > .trending-filters-row {
  min-height: 0;
  overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
  .trending-filters-chevron,
  .trending-filters-body {
    transition: none !important;
  }
}

@media (max-width: 640px) {
  .tools-sidebar {
    margin-inline: -2px;
  }

  .trending-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .trending-card--short {
    max-width: none;
    justify-self: stretch;
  }

  .trending-filter-type-group {
    flex-wrap: wrap;
    gap: 6px;
  }

  .trending-filter-radio {
    flex: 1 1 calc(50% - 4px);
    min-width: 0;
  }

  .trending-toolbar-actions {
    width: 100%;
  }

  .trending-filters-row {
    flex-direction: column;
    align-items: stretch;
  }

  .trending-filter-input {
    width: 100%;
  }

  .trending-region-field,
  .trending-region-trigger {
    width: 100%;
    min-width: 0;
  }

  .trending-max-results-row {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
}

@media (max-width: 768px) and (min-width: 641px) {
  .trending-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  }

  .trending-toolbar:not(:has(.trending-search-field)) {
    flex-direction: column;
    align-items: stretch;
  }

  .trending-toolbar-actions {
    width: 100%;
  }

  .trending-toolbar-actions .btn {
    min-height: 40px;
  }

  .checklist-sticky-toolbar {
    top: 0.35rem;
    justify-content: flex-end;
  }

  .checklist-toolbar-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .checklist-btn {
    min-height: 2rem;
    padding: 0.36rem 0.7rem;
    font-size: 0.76rem;
  }

  .checklist-item-title-row {
    flex-wrap: wrap;
  }

  .checklist-item-category {
    flex: 1 1 4.5rem;
    max-width: none;
    width: auto;
  }

  .checklist-item {
    grid-template-columns: auto auto 1fr;
    grid-template-areas:
      "check icon fields"
      ". actions actions";
  }

  .checklist-item-grip {
    display: none;
  }

  .checklist-item-check {
    grid-area: check;
  }

  .checklist-item-icon {
    grid-area: icon;
  }

  .checklist-item-fields {
    grid-area: fields;
  }

  .checklist-item-actions {
    grid-area: actions;
    flex-direction: row;
    justify-content: flex-end;
    padding-top: 0.15rem;
  }
}

/* ── Keyword Analysis tool ───────────────────────────────────────── */
.tools-hero-chip--ka.is-active {
  border-color: rgba(52, 211, 153, 0.3);
  background: rgba(52, 211, 153, 0.08);
  color: rgba(110, 231, 183, 0.95);
}

.tools-hero-chip--locked,
.tools-nav-btn--locked {
  opacity: 0.58;
  cursor: pointer;
  filter: grayscale(0.25);
}

.tools-hero-chip--locked .tools-plan-badge::after,
.tools-nav-btn--locked .tools-plan-badge::after {
  content: " 🔒";
}

.tools-plan-badge {
  margin-left: 0.35rem;
  font-size: 0.62rem;
  padding: 0.12rem 0.42rem;
  vertical-align: middle;
}

.tools-nav-btn .tools-plan-badge {
  margin-left: auto;
}

.trending-gate-title {
  margin: 0 0 0.35rem;
  font-weight: 600;
}

.kw-analysis-section .trending-section-lead {
  margin: 0.35rem 0 0;
  color: rgba(226, 232, 240, 0.72);
  font-size: 0.92rem;
  line-height: 1.55;
  max-width: 52rem;
}

.kw-analysis-key-setup {
  margin-bottom: 0.75rem;
  padding: 0.85rem 1rem;
  border: 1px solid rgba(52, 211, 153, 0.16);
}

.kw-analysis-key-lead {
  margin: 0 0 0.65rem;
  font-size: 0.88rem;
  line-height: 1.5;
  color: rgba(226, 232, 240, 0.78);
}

.kw-analysis-key-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem 1rem;
}

.kw-analysis-key-field {
  flex: 1 1 16rem;
  min-width: 0;
}

.kw-analysis-key-input-wrap {
  display: flex;
  align-items: stretch;
  gap: 0.35rem;
}

.kw-analysis-key-input-wrap .kw-analysis-input {
  flex: 1 1 auto;
  min-width: 0;
}

.kw-analysis-key-toggle {
  flex-shrink: 0;
  min-width: 2.25rem;
  padding-inline: 0.45rem;
  line-height: 1;
}

.kw-analysis-key-actions {
  flex-shrink: 0;
  display: flex;
  align-items: flex-end;
}

.kw-analysis-key-status {
  margin: 0.55rem 0 0;
  font-size: 0.84rem;
  line-height: 1.45;
}

.kw-analysis-key-status.is-saved {
  color: rgba(110, 231, 183, 0.95);
}

.kw-analysis-key-status.is-missing {
  color: rgba(251, 191, 36, 0.95);
}

.kw-analysis-key-status.is-admin {
  color: rgba(147, 197, 253, 0.95);
}

.kw-analysis-key-status.is-error {
  color: rgba(252, 165, 165, 0.95);
}

.kw-analysis-key-status.is-loading {
  color: rgba(226, 232, 240, 0.65);
}

.kw-analysis-key-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 1rem;
  margin: 0.5rem 0 0;
  font-size: 0.8rem;
  line-height: 1.45;
  color: rgba(226, 232, 240, 0.58);
}

.kw-analysis-key-storage-hint {
  flex: 1 1 auto;
}

.kw-analysis-key-link {
  color: rgba(110, 231, 183, 0.92);
  text-decoration: none;
}

.kw-analysis-key-link:hover {
  text-decoration: underline;
}

.kw-analysis-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 0.75rem 1rem;
  padding: 0.85rem 1rem;
  margin-bottom: 0.75rem;
  border: 1px solid rgba(52, 211, 153, 0.16);
}

.kw-analysis-field {
  flex: 1 1 14rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}

.kw-analysis-field .kw-analysis-input {
  margin-top: auto;
}

.kw-analysis-label {
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(167, 243, 208, 0.88);
}

.kw-analysis-input {
  width: 100%;
  padding: 0.62rem 0.8rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.22);
  color: inherit;
  font: inherit;
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

.kw-analysis-input:focus {
  outline: none;
  border-color: var(--field-border-cyan, rgba(103, 232, 249, 0.5));
  box-shadow: 0 0 0 1px rgba(103, 232, 249, 0.1), 0 0 20px var(--field-glow-cyan, rgba(103, 232, 249, 0.1));
}

.kw-analysis-toolbar-actions {
  flex-shrink: 0;
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.kw-analysis-toolbar[hidden] {
  display: none !important;
}

.kw-analysis-btn-analyze[hidden] {
  display: none !important;
}

.kw-analysis-confirm-overlay[hidden] {
  display: none !important;
}

.kw-analysis-history-panel {
  margin-top: 0.55rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid rgba(52, 211, 153, 0.14);
}

.kw-analysis-history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.55rem;
}

.kw-analysis-history-title {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: rgba(110, 231, 183, 0.92);
}

.kw-analysis-history-empty {
  margin: 0;
  font-size: 0.86rem;
  color: rgba(165, 243, 252, 0.65);
}

.kw-analysis-history-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-height: 14rem;
  overflow-y: auto;
}

.kw-analysis-history-row {
  display: flex;
  align-items: stretch;
  gap: 0.25rem;
}

.kw-analysis-history-item {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
  padding: 0.5rem 0.65rem;
  border: 1px solid rgba(52, 211, 153, 0.12);
  border-radius: 0.55rem;
  background: rgba(15, 23, 42, 0.35);
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.kw-analysis-history-item:hover {
  border-color: rgba(52, 211, 153, 0.28);
  background: rgba(15, 23, 42, 0.5);
}

.kw-analysis-history-item.is-active {
  border-color: rgba(52, 211, 153, 0.55);
  background: rgba(16, 185, 129, 0.12);
  box-shadow: 0 0 0 1px rgba(52, 211, 153, 0.2);
}

.kw-analysis-history-keyword {
  font-size: 0.9rem;
  font-weight: 600;
  color: rgba(236, 253, 245, 0.95);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.kw-analysis-history-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.6rem;
  font-size: 0.76rem;
  color: rgba(165, 243, 252, 0.7);
}

.kw-analysis-history-channel {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 12rem;
}

.kw-analysis-history-delete {
  flex-shrink: 0;
  align-self: center;
  width: 1.75rem;
  height: 1.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(248, 113, 113, 0.2);
  border-radius: 0.4rem;
  background: rgba(15, 23, 42, 0.35);
  color: rgba(252, 165, 165, 0.85);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.kw-analysis-history-delete:hover {
  border-color: rgba(248, 113, 113, 0.45);
  background: rgba(127, 29, 29, 0.25);
  color: rgba(254, 202, 202, 0.95);
}

.kw-analysis-status {
  margin-bottom: 0.65rem;
}

.kw-analysis-results {
  margin-top: 0.5rem;
}

.kw-analysis-results-stack {
  display: grid;
  gap: 0.9rem;
}

.kw-analysis-results-main,
.kw-analysis-results-extra {
  min-width: 0;
}

.kw-analysis-context-hint {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  margin: 0 0 0.75rem;
  padding: 0.5rem 0.7rem;
  border-radius: 8px;
  font-size: 0.8rem;
  line-height: 1.5;
  color: rgba(148, 163, 184, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.03);
}

.kw-analysis-context-hint::before {
  content: "ℹ";
  flex-shrink: 0;
  width: 1rem;
  height: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 0.58rem;
  font-weight: 600;
  color: rgba(103, 232, 249, 0.75);
  background: rgba(34, 211, 238, 0.08);
}

.kw-analysis-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 0.9rem;
  align-items: start;
}

.kw-analysis-card {
  grid-column: span 4;
  display: flex;
  flex-direction: column;
  align-self: stretch;
  height: 100%;
  min-height: 0;
  padding: 0;
  margin: 0;
}

.kw-analysis-card[data-kw-layout="wide"] {
  grid-column: span 6;
}

.kw-analysis-card-head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.85rem 1rem 0.65rem;
  min-height: 3.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.kw-analysis-card-icon {
  flex-shrink: 0;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 6px;
  background: rgba(34, 211, 238, 0.08);
  position: relative;
}

.kw-analysis-card-icon::before {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 1px;
  background: rgba(103, 232, 249, 0.55);
}

.kw-analysis-card-title {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1.4;
  color: rgba(103, 232, 249, 0.88);
}

.kw-analysis-card-body {
  flex: 1;
  padding: 0.75rem 1rem 0.9rem;
  font-size: 0.9rem;
  line-height: 1.55;
  color: rgba(241, 245, 249, 0.92);
}

.kw-analysis-text {
  margin: 0;
  color: rgba(226, 232, 240, 0.9);
}

.kw-analysis-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.kw-analysis-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  padding: 0.1rem 0;
}

.kw-analysis-list-text {
  flex: 1;
  min-width: 0;
}

.kw-analysis-list:not(.kw-analysis-list--numbered):not(.kw-analysis-list--chips) > li::before {
  content: "";
  flex-shrink: 0;
  width: 0.3rem;
  height: 0.3rem;
  margin-top: 0.55rem;
  border-radius: 50%;
  background: rgba(148, 163, 184, 0.45);
}

.kw-analysis-list--numbered {
  counter-reset: kw-item;
  gap: 0;
}

.kw-analysis-list--numbered > li {
  align-items: flex-start;
  padding: 0.45rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.kw-analysis-list--numbered > li:last-child {
  border-bottom: none;
}

.kw-analysis-num {
  flex-shrink: 0;
  min-width: 1.2rem;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.5;
  color: rgba(103, 232, 249, 0.6);
}

.kw-analysis-list--chips {
  flex-direction: column;
  gap: 0.35rem;
}

.kw-analysis-list--chips > li {
  display: block;
}

.kw-analysis-chip {
  display: block;
  max-width: 100%;
  padding: 0.45rem 0.65rem;
  border-radius: 8px;
  font-size: 0.88rem;
  line-height: 1.5;
  color: rgba(241, 245, 249, 0.92);
  background: rgba(255, 255, 255, 0.04);
  word-break: break-word;
}

html[data-theme="light"] .kw-analysis-toolbar {
  border-color: rgba(5, 150, 105, 0.22);
  background: linear-gradient(165deg, #ffffff 0%, #f0fdf4 100%);
}

html[data-theme="light"] .kw-analysis-label {
  color: #047857;
}

html[data-theme="light"] .kw-analysis-input {
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(15, 118, 110, 0.22);
  color: var(--text-primary, #1e293b);
}

html[data-theme="light"] .kw-analysis-input::placeholder {
  color: rgba(30, 41, 59, 0.42);
}

html[data-theme="light"] .kw-analysis-card-head {
  border-bottom-color: rgba(15, 118, 110, 0.08);
}

html[data-theme="light"] .kw-analysis-card-title {
  color: #0e7490;
}

html[data-theme="light"] .kw-analysis-card-body,
html[data-theme="light"] .kw-analysis-text,
html[data-theme="light"] .kw-analysis-list,
html[data-theme="light"] .kw-analysis-list-text {
  color: var(--text-primary, #1e293b);
}

html[data-theme="light"] .kw-analysis-context-hint {
  color: rgba(71, 85, 105, 0.92);
  border-color: rgba(15, 118, 110, 0.1);
  background: rgba(15, 118, 110, 0.04);
}

html[data-theme="light"] .kw-analysis-context-hint::before {
  color: #0e7490;
  background: rgba(14, 116, 144, 0.08);
}

html[data-theme="light"] .kw-analysis-list--numbered > li {
  border-bottom-color: rgba(15, 118, 110, 0.08);
}

html[data-theme="light"] .kw-analysis-num {
  color: rgba(14, 116, 144, 0.7);
}

html[data-theme="light"] .kw-analysis-chip {
  color: var(--text-primary, #1e293b);
  background: rgba(15, 118, 110, 0.05);
}

html[data-theme="light"] .kw-analysis-history-panel {
  border-color: rgba(5, 150, 105, 0.2);
  background: linear-gradient(165deg, #ffffff 0%, #f4fbf6 100%);
}

html[data-theme="light"] .kw-analysis-history-title {
  color: #047857;
}

html[data-theme="light"] .kw-analysis-history-empty,
html[data-theme="light"] .kw-analysis-history-meta {
  color: rgba(30, 41, 59, 0.72);
}

html[data-theme="light"] .kw-analysis-history-keyword {
  color: var(--text-primary, #1e293b);
}

html[data-theme="light"] .kw-analysis-history-item {
  border-color: rgba(5, 150, 105, 0.18);
  background: rgba(255, 255, 255, 0.85);
}

html[data-theme="light"] .kw-analysis-history-item:hover {
  border-color: rgba(5, 150, 105, 0.32);
  background: rgba(240, 253, 244, 0.95);
}

html[data-theme="light"] .kw-analysis-history-item.is-active {
  border-color: rgba(5, 150, 105, 0.5);
  background: rgba(209, 250, 229, 0.65);
  box-shadow: 0 0 0 1px rgba(5, 150, 105, 0.15);
}

html[data-theme="light"] .kw-analysis-history-delete {
  border-color: rgba(220, 38, 38, 0.2);
  background: rgba(255, 255, 255, 0.9);
  color: #b91c1c;
}

html[data-theme="light"] .kw-analysis-history-delete:hover {
  border-color: rgba(220, 38, 38, 0.4);
  background: rgba(254, 226, 226, 0.85);
  color: #991b1b;
}

html[data-theme="light"] .kw-analysis-section .trending-section-lead {
  color: rgba(30, 41, 59, 0.78);
}

html[data-theme="light"] .kw-analysis-key-setup {
  border-color: rgba(16, 185, 129, 0.22);
  background: rgba(255, 255, 255, 0.72);
}

html[data-theme="light"] .kw-analysis-key-lead {
  color: rgba(30, 41, 59, 0.78);
}

html[data-theme="light"] .kw-analysis-key-foot {
  color: rgba(71, 85, 105, 0.82);
}

html[data-theme="light"] .kw-analysis-key-link {
  color: rgba(5, 150, 105, 0.95);
}

html[data-theme="light"] .kw-analysis-key-status.is-saved {
  color: rgba(5, 150, 105, 0.95);
}

html[data-theme="light"] .kw-analysis-key-status.is-missing {
  color: rgba(180, 83, 9, 0.95);
}

html[data-theme="light"] .kw-analysis-key-status.is-admin {
  color: rgba(37, 99, 235, 0.92);
}

html[data-theme="light"] .kw-analysis-key-status.is-error {
  color: rgba(220, 38, 38, 0.92);
}

html[data-theme="light"] .kw-analysis-channels-block {
  border-top-color: rgba(15, 118, 110, 0.1);
}

html[data-theme="light"] .kw-analysis-channels-heading {
  color: #0e7490;
}

html[data-theme="light"] .kw-analysis-channels-icon {
  background: rgba(14, 116, 144, 0.08);
}

html[data-theme="light"] .kw-analysis-channel-card {
  border-color: rgba(15, 118, 110, 0.12);
  background: rgba(255, 255, 255, 0.85);
}

html[data-theme="light"] .kw-analysis-channel-card:hover {
  border-color: rgba(14, 116, 144, 0.22);
  box-shadow: none;
}

html[data-theme="light"] .kw-analysis-channel-head {
  border-bottom-color: rgba(15, 118, 110, 0.08);
}

html[data-theme="light"] .kw-analysis-channel-actions {
  border-top-color: rgba(15, 118, 110, 0.08);
}

html[data-theme="light"] .kw-analysis-channel-name,
html[data-theme="light"] .kw-analysis-channel-name a,
html[data-theme="light"] .kw-analysis-channel-name-link {
  color: #0e7490;
}

html[data-theme="light"] .kw-analysis-channel-name a:hover,
html[data-theme="light"] .kw-analysis-channel-name-link:hover {
  color: #0891b2;
}

html[data-theme="light"] .kw-analysis-channel-subs,
html[data-theme="light"] .kw-analysis-channel-field,
html[data-theme="light"] .kw-analysis-channel-field-label,
html[data-theme="light"] .kw-analysis-channel-body {
  color: rgba(30, 41, 59, 0.78);
}

html[data-theme="light"] .kw-analysis-channel-link {
  color: #0e7490;
}

html[data-theme="light"] .kw-analysis-channel-link:hover {
  color: #0891b2;
}

html[data-theme="light"] .kw-analysis-channel-badge {
  color: #047857;
  background: rgba(16, 185, 129, 0.1);
}

.kw-analysis-channels-block {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.kw-analysis-channels-head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.75rem;
}

.kw-analysis-channels-icon {
  flex-shrink: 0;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 6px;
  background: rgba(34, 211, 238, 0.08);
  position: relative;
}

.kw-analysis-channels-icon::before {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 1px;
  background: rgba(103, 232, 249, 0.55);
}

.kw-analysis-channels-heading {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(103, 232, 249, 0.88);
}

.kw-analysis-channel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
  gap: 0.75rem;
  align-items: start;
}

.kw-analysis-channel-card {
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(15, 23, 42, 0.35);
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow: hidden;
  transition: border-color 0.2s ease;
}

.kw-analysis-channel-card:hover {
  border-color: rgba(34, 211, 238, 0.2);
}

.kw-analysis-channel-head {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-width: 0;
  padding: 0.85rem 0.95rem 0.7rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.kw-analysis-channel-thumb {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.15);
}

.kw-analysis-channel-meta {
  min-width: 0;
  flex: 1;
}

.kw-analysis-channel-name {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.3;
  color: rgba(241, 245, 249, 0.95);
}

.kw-analysis-channel-name a,
.kw-analysis-channel-name-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  max-width: 100%;
  color: rgba(34, 211, 238, 0.96);
  text-decoration: none;
}

.kw-analysis-channel-name a:hover,
.kw-analysis-channel-name-link:hover {
  color: rgba(103, 232, 249, 1);
  text-decoration: underline;
}

.kw-analysis-channel-name a:focus-visible,
.kw-analysis-channel-name-link:focus-visible,
.kw-analysis-channel-link:focus-visible {
  outline: 2px solid rgba(34, 211, 238, 0.85);
  outline-offset: 2px;
  border-radius: 0.2rem;
}

.kw-analysis-channel-subs {
  margin: 0.2rem 0 0;
  font-size: 0.78rem;
  color: rgba(226, 232, 240, 0.68);
}

.kw-analysis-channel-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.35rem;
}

.kw-analysis-channel-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: rgba(167, 243, 208, 0.9);
  background: rgba(16, 185, 129, 0.1);
}

.kw-analysis-channel-body {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.7rem 0.95rem;
  font-size: 0.86rem;
  line-height: 1.55;
  color: rgba(241, 245, 249, 0.9);
}

.kw-analysis-channel-field {
  margin: 0;
  color: rgba(241, 245, 249, 0.88);
}

.kw-analysis-channel-field-label {
  display: block;
  margin-bottom: 0.2rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: rgba(148, 163, 184, 0.85);
}

.kw-analysis-channel-actions {
  margin-top: auto;
  padding: 0.55rem 0.95rem 0.85rem;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.kw-analysis-channel-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: rgba(34, 211, 238, 0.96);
  text-decoration: none;
}

.kw-analysis-channel-link:hover {
  color: rgba(103, 232, 249, 1);
  text-decoration: underline;
}

.kw-analysis-channel-link-icon {
  flex-shrink: 0;
  opacity: 0.88;
}

@media (max-width: 1100px) {
  .kw-analysis-card[data-kw-layout="wide"] {
    grid-column: span 12;
  }

  .kw-analysis-card {
    grid-column: span 6;
  }
}

/* ── Tools page — premium mobile polish (≤768px) ─────────────── */
@media (max-width: 768px) {
  .tools-hero {
    margin-bottom: 12px;
    padding: 9px 10px 10px;
    border-radius: var(--radius-md);
  }

  .tools-hero-header {
    padding: 1px 1px 0;
    gap: 3px;
  }

  .tools-hero-header::before {
    display: none;
  }

  .tools-hero-content {
    gap: 7px;
  }

  .tools-hero-eyebrow {
    padding: 0;
    font-size: 0.54rem;
    gap: 3px;
  }

  .tools-hero-eyebrow-icon {
    width: 11px;
    height: 11px;
  }

  .tools-hero-eyebrow-icon svg {
    width: 8px;
    height: 8px;
  }

  .tools-hero-title {
    font-size: 1.18rem;
    line-height: 1.2;
  }

  .tools-hero-title-wrap {
    padding: 1px 6px 1px 5px;
    margin-left: -5px;
  }

  .tools-hero-title-wrap::after {
    width: 1.7em;
    height: 2px;
    margin-top: 3px;
  }

  .tools-hero-lead {
    font-size: 0.72rem;
    line-height: 1.4;
  }

  .tools-hero-chips-wrap {
    padding: 7px 1px 0;
  }

  /* Dense wrap — keep chips compact, no tall empty grid cells */
  .tools-hero-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    align-items: center;
  }

  .tools-hero-chip {
    width: auto;
    min-height: 0;
    padding: 5px 9px;
    font-size: 0.64rem;
    gap: 4px;
    line-height: 1.2;
    white-space: nowrap;
    text-align: left;
    justify-content: flex-start;
    flex-wrap: nowrap;
    border-radius: 8px;
  }

  .tools-hero-chip-icon {
    font-size: 0.55rem;
  }

  .tools-hero-chip-icon svg {
    width: 9px;
    height: 9px;
  }

  /* Mini Pro/Ultra badges inside chips & sidebar tabs */
  .tools-hero-chip .tools-plan-badge,
  .tools-nav-btn .tools-plan-badge {
    margin-left: 0.15rem;
    padding: 1px 4px;
    font-size: 0.52rem;
    letter-spacing: 0.03em;
    min-width: 0;
    min-height: 0;
    line-height: 1.3;
  }

  .tools-sidebar {
    padding: 6px;
    border-radius: var(--radius-md);
  }

  .tools-nav {
    gap: 5px;
  }

  .tools-nav-btn {
    min-height: 40px;
    padding: 7px 10px;
    font-size: 0.74rem;
    gap: 7px;
    border-radius: calc(var(--radius-md) - 2px);
  }

  .tools-nav-icon {
    font-size: 0.72rem;
  }

  .tools-nav-icon svg {
    width: 1em;
    height: 1em;
  }

  .tools-layout {
    gap: 12px;
  }

  .tools-content {
    padding-top: 0;
  }

  .trending-toolbar {
    padding: 10px 12px;
    gap: 10px;
    margin-bottom: 10px;
    border-radius: var(--radius-md);
    align-items: stretch;
  }

  /* Trending tab — simple stacked form */
  .trending-toolbar:not(:has(.trending-search-field)) {
    display: flex;
    flex-direction: column;
  }

  /* Keyword search — compact grid: full-width rows + region/time 2-col */
  .trending-toolbar:has(.trending-search-field) {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: end;
    gap: 10px;
  }

  .trending-toolbar:has(.trending-search-field) > .trending-search-field,
  .trending-toolbar:has(.trending-search-field) > .btn {
    grid-column: 1 / -1;
  }

  .trending-toolbar-actions {
    width: 100%;
    display: flex;
    gap: 8px;
  }

  .trending-toolbar > .btn,
  .trending-toolbar-actions .btn {
    flex: 1 1 auto;
    width: 100%;
    justify-content: center;
    min-height: 40px;
    padding: 6px 12px;
    font-size: 0.78rem;
  }

  .trending-search-field {
    flex: 0 0 auto;
    width: 100%;
    min-width: 0;
    font-size: 0.7rem;
    gap: 4px;
  }

  .trending-search-field > span:first-child,
  .trending-region-label-text {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: rgba(103, 232, 249, 0.82);
  }

  .trending-region-field {
    flex: 0 0 auto;
    min-width: 0;
    gap: 4px;
  }

  .trending-search-input,
  .trending-filter-input {
    height: 40px;
    min-height: 40px;
    padding: 0 10px;
    font-size: 0.84rem;
    line-height: 1.25;
    border-radius: calc(var(--radius-md) - 2px);
  }

  .trending-region-trigger {
    height: 40px;
    min-height: 40px;
    min-width: 0;
    padding: 0 28px 0 10px;
    font-size: 0.84rem;
    border-radius: calc(var(--radius-md) - 2px);
  }

  .search-period-field,
  .search-period-field .trending-region-trigger {
    min-width: 0;
  }

  .trending-region-flag {
    font-size: 0.9rem;
  }

  .trending-section-head {
    margin-bottom: 12px;
  }

  .trending-section-head h2 {
    font-size: 1.08rem;
    margin-bottom: 4px;
    letter-spacing: -0.02em;
  }

  .trending-section-head p,
  .trending-section .trending-section-lead,
  .kw-analysis-section .trending-section-lead {
    font-size: 0.8rem;
    line-height: 1.5;
  }

  .trending-section .eyebrow {
    margin-bottom: 10px;
    padding: 4px 9px 4px 6px;
    font-size: 0.62rem;
    gap: 6px;
  }

  .trending-section .eyebrow::before {
    width: 5px;
    height: 5px;
  }

  .trending-filters {
    padding: 10px 12px;
    margin-bottom: 8px;
    gap: 8px;
  }

  .trending-filters-row {
    gap: 12px;
  }

  html[data-theme="light"] .trending-search-field > span:first-child,
  html[data-theme="light"] .trending-region-label-text {
    color: rgba(21, 128, 140, 0.88);
  }

  .trending-filter-radio {
    min-height: 36px;
    padding: 5px 10px;
    font-size: 0.76rem;
  }

  .trending-filter-fieldset legend {
    font-size: 0.72rem;
    margin-bottom: 5px;
  }

  .kw-analysis-toolbar {
    flex-direction: column;
    align-items: stretch;
    padding: 10px 12px;
    gap: 10px;
    margin-bottom: 10px;
    border-radius: var(--radius-md);
  }

  .kw-analysis-field {
    flex: 0 0 auto;
    width: 100%;
    gap: 4px;
  }

  .kw-analysis-label {
    font-size: 0.68rem;
    letter-spacing: 0.04em;
  }

  .kw-analysis-input {
    height: 40px;
    min-height: 40px;
    padding: 0 10px;
    font-size: 0.84rem;
    line-height: 1.25;
    border-radius: 10px;
  }

  .kw-analysis-toolbar-actions {
    width: 100%;
    gap: 8px;
    align-items: stretch;
  }

  .kw-analysis-toolbar-actions .btn {
    flex: 1 1 auto;
    min-height: 40px;
    padding: 6px 12px;
    font-size: 0.78rem;
  }

  .tools-content {
    min-width: 0;
  }

  .trending-section {
    margin-top: 4px;
  }

  .kw-analysis-key-setup {
    padding: 0.7rem 0.85rem;
  }

  .kw-analysis-key-lead {
    font-size: 0.82rem;
  }

  .kw-analysis-results {
    margin-top: 0.2rem;
  }

  .kw-analysis-results-stack {
    gap: 0.5rem;
  }

  .kw-analysis-context-hint {
    margin-bottom: 0.5rem;
    padding: 0.45rem 0.6rem;
    font-size: 0.76rem;
  }

  .kw-analysis-grid {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }

  .kw-analysis-card,
  .kw-analysis-card[data-kw-layout="wide"] {
    grid-column: span 1;
  }

  .kw-analysis-card-head {
    padding: 0.65rem 0.75rem 0.5rem;
    gap: 0.5rem;
    min-height: 2.65rem;
  }

  .kw-analysis-card-icon {
    width: 1.35rem;
    height: 1.35rem;
    border-radius: 5px;
  }

  .kw-analysis-card-icon::before {
    width: 0.35rem;
    height: 0.35rem;
  }

  .kw-analysis-card-title {
    font-size: 0.72rem;
    letter-spacing: 0.05em;
  }

  .kw-analysis-card-body {
    padding: 0.55rem 0.75rem 0.75rem;
    font-size: 0.86rem;
    line-height: 1.5;
  }

  .kw-analysis-list {
    gap: 0.38rem;
  }

  .kw-analysis-list--numbered > li {
    padding: 0.4rem 0;
  }

  .kw-analysis-num {
    min-width: 1.1rem;
    font-size: 0.72rem;
  }

  .kw-analysis-chip {
    font-size: 0.84rem;
    padding: 0.4rem 0.55rem;
  }

  .kw-analysis-channels-block {
    margin-top: 0.75rem;
    padding-top: 0.65rem;
  }

  .kw-analysis-channels-head {
    margin-bottom: 0.5rem;
    gap: 0.45rem;
  }

  .kw-analysis-channels-icon {
    width: 1.35rem;
    height: 1.35rem;
  }

  .kw-analysis-channels-heading {
    font-size: 0.74rem;
  }

  .kw-analysis-channel-grid {
    gap: 0.5rem;
  }

  .kw-analysis-channel-head {
    padding: 0.65rem 0.75rem 0.55rem;
    gap: 0.55rem;
  }

  .kw-analysis-channel-body {
    padding: 0.55rem 0.75rem;
  }

  .kw-analysis-channel-actions {
    padding: 0.45rem 0.75rem 0.65rem;
  }

  .kw-analysis-channel-card:hover {
    transform: none;
  }
}

@media (max-width: 480px) {
  .tools-hero {
    padding: 8px 9px 9px;
  }

  .tools-hero-header {
    padding: 0;
  }

  .tools-hero-title {
    font-size: 1.12rem;
  }

  .tools-hero-title-wrap {
    padding: 0 5px 1px 4px;
    margin-left: -4px;
    border-radius: 5px;
  }

  .tools-hero-title-wrap::after {
    width: 1.55em;
    margin-top: 3px;
  }

  .tools-hero-lead {
    font-size: 0.7rem;
  }

  .tools-hero-chip {
    min-height: 0;
    padding: 4px 8px;
    font-size: 0.6rem;
    gap: 3px;
  }

  .trending-section-head h2 {
    font-size: 1rem;
  }

  .trending-toolbar {
    padding: 9px 10px;
    gap: 9px;
  }
}

/* Very narrow phones — stack region/time */
@media (max-width: 360px) {
  .trending-toolbar:has(.trending-search-field) {
    grid-template-columns: 1fr;
  }

  .trending-toolbar:has(.trending-search-field) > .trending-region-field {
    grid-column: 1 / -1;
  }
}

/* ── Keyword Analysis redesign (premium minimal) ─────────────────────────── */
.kw-analysis-section {
  --kw-accent: #63b3ff;
  --kw-accent-soft: rgba(99, 179, 255, 0.14);
  --kw-border: rgba(148, 163, 184, 0.16);
  --kw-divider: rgba(148, 163, 184, 0.12);
  --kw-text-primary: rgba(226, 232, 240, 0.9);
  --kw-text-secondary: rgba(148, 163, 184, 0.9);
  --kw-card-bg: rgba(15, 23, 42, 0.36);
}

.kw-analysis-section .trending-section-head h2 {
  font-size: clamp(1.34rem, 2.2vw, 1.72rem);
  letter-spacing: -0.02em;
}

.kw-analysis-section .trending-section-lead {
  color: rgba(226, 232, 240, 0.72);
  font-size: 0.92rem;
  line-height: 1.6;
  max-width: 64ch;
}

.kw-analysis-toolbar,
.kw-analysis-history-panel {
  border: 1px solid var(--kw-border);
  background: var(--kw-card-bg);
  border-radius: 12px;
}

.kw-analysis-toolbar {
  gap: 12px 16px;
  padding: 16px;
  margin-bottom: 12px;
}

.kw-analysis-label {
  font-size: 0.74rem;
  line-height: 1.35;
  letter-spacing: 0.045em;
  color: var(--kw-text-secondary);
}

.kw-analysis-input {
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(2, 6, 23, 0.42);
  border-radius: 10px;
  font-size: 0.9rem;
  line-height: 1.4;
}

.kw-analysis-input:focus {
  border-color: var(--field-border-cyan, rgba(103, 232, 249, 0.5));
  box-shadow: 0 0 0 1px rgba(103, 232, 249, 0.1), 0 0 20px var(--field-glow-cyan, rgba(103, 232, 249, 0.1));
}

.kw-analysis-status {
  margin-bottom: 12px;
}

.kw-analysis-status.trending-feedback.is-loading {
  border: 1px solid var(--kw-border);
  background: var(--surface-2);
  border-radius: 12px;
  overflow: hidden;
}

.kw-analysis-status .tl-load-body {
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  padding: 0.7rem 0.95rem;
  background: transparent;
  border-radius: 0;
}

.kw-analysis-status .tl-load-icon svg {
  width: 26px;
  height: 26px;
}

.kw-analysis-status .tl-load-text {
  font-size: 0.86rem;
  color: var(--text-secondary);
  text-align: left;
}

.kw-analysis-results-stack {
  gap: 16px;
}

.kw-analysis-results-main {
  display: grid;
  gap: 16px;
}

.kw-analysis-results-section {
  display: grid;
  gap: 12px;
}

.kw-analysis-results-section + .kw-analysis-results-section {
  padding-top: 12px;
  border-top: 1px solid var(--kw-divider);
}

.kw-analysis-grid--summary .kw-analysis-card[data-kw-layout="wide"] {
  grid-column: span 2;
}

.kw-analysis-grid--actions .kw-analysis-card[data-kw-layout="wide"] {
  grid-column: span 2;
}

.kw-analysis-context-hint {
  margin: 0;
  padding: 12px;
  border: 1px solid var(--kw-border);
  border-radius: 10px;
  background: rgba(2, 6, 23, 0.28);
  color: var(--kw-text-secondary);
  font-size: 0.82rem;
  line-height: 1.55;
  max-width: 86ch;
}

.kw-analysis-context-hint::before {
  color: var(--kw-accent);
  background: var(--kw-accent-soft);
}

.kw-analysis-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.kw-analysis-card,
.kw-analysis-channel-card {
  border: 1px solid var(--kw-border);
  border-radius: 12px;
  background: var(--kw-card-bg);
  box-shadow: none;
}

.kw-analysis-card {
  grid-column: span 1;
}

.kw-analysis-card[data-kw-layout="wide"] {
  grid-column: span 2;
}

.kw-analysis-card-head,
.kw-analysis-channels-head,
.kw-analysis-channel-head {
  min-height: 44px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--kw-divider);
}

.kw-analysis-channels-head {
  display: flex;
  align-items: center;
  margin-bottom: 0;
}

.kw-analysis-card-title,
.kw-analysis-channels-heading {
  margin: 0;
  font-size: 0.73rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--kw-text-secondary);
}

.kw-analysis-card-body {
  padding: 12px 14px 14px;
  font-size: 0.9rem;
  line-height: 1.58;
  max-width: 82ch;
}

.kw-analysis-text,
.kw-analysis-list-text {
  color: var(--kw-text-primary);
}

.kw-analysis-list {
  gap: 0;
  max-width: 82ch;
}

.kw-analysis-list > li {
  padding: 8px 0;
  border-bottom: 1px solid var(--kw-divider);
}

.kw-analysis-list > li:last-child {
  border-bottom: none;
}

.kw-analysis-list--numbered > li {
  border-bottom-color: var(--kw-divider);
}

.kw-analysis-num {
  color: var(--kw-text-secondary);
  min-width: 1.3rem;
}

.kw-analysis-list--chips {
  gap: 0;
}

.kw-analysis-list--chips > li {
  padding: 8px 0;
}

.kw-analysis-chip {
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: var(--kw-text-primary);
  line-height: 1.55;
}

.kw-analysis-channels-block {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.kw-analysis-channel-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.kw-analysis-channel-head {
  gap: 0.62rem;
}

.kw-analysis-channel-thumb {
  width: 2.5rem;
  height: 2.5rem;
  border-color: rgba(148, 163, 184, 0.22);
}

.kw-analysis-channel-name {
  font-size: 0.92rem;
  font-weight: 650;
  line-height: 1.35;
  max-width: 34ch;
}

.kw-analysis-channel-name a,
.kw-analysis-channel-name-link,
.kw-analysis-channel-link {
  color: var(--kw-accent);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 2px;
}

.kw-analysis-channel-name a:hover,
.kw-analysis-channel-name-link:hover,
.kw-analysis-channel-link:hover {
  color: #8ac6ff;
  text-decoration: underline;
}

.kw-analysis-channel-subs {
  color: var(--kw-text-secondary);
}

.kw-analysis-channel-badge {
  padding: 0.1rem 0.42rem;
  border-radius: 999px;
  color: rgba(191, 219, 254, 0.95);
  background: rgba(59, 130, 246, 0.16);
}

.kw-analysis-channel-body {
  gap: 8px;
  padding: 12px 14px;
  font-size: 0.86rem;
  line-height: 1.55;
}

.kw-analysis-channel-field {
  color: var(--kw-text-primary);
  max-width: 76ch;
}

.kw-analysis-channel-field-label {
  margin-bottom: 4px;
  font-size: 0.66rem;
  letter-spacing: 0.05em;
  color: var(--kw-text-secondary);
}

.kw-analysis-channel-actions {
  padding: 10px 14px 12px;
  border-top: 1px solid var(--kw-divider);
}

.kw-analysis-channel-link {
  font-size: 0.8rem;
  font-weight: 620;
}

.kw-analysis-channel-name a:focus-visible,
.kw-analysis-channel-name-link:focus-visible,
.kw-analysis-channel-link:focus-visible,
.kw-analysis-history-item:focus-visible,
.kw-analysis-history-delete:focus-visible {
  outline: 2px solid var(--kw-accent);
  outline-offset: 2px;
}

.kw-analysis-history-panel {
  margin-top: 8px;
  padding: 12px;
}

.kw-analysis-history-title {
  font-size: 0.74rem;
  letter-spacing: 0.05em;
  color: rgba(203, 213, 225, 0.9);
}

.kw-analysis-history-list {
  gap: 8px;
}

.kw-analysis-history-item {
  padding: 10px 12px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(2, 6, 23, 0.32);
  border-radius: 10px;
}

.kw-analysis-history-item:hover {
  border-color: rgba(99, 179, 255, 0.34);
  background: rgba(15, 23, 42, 0.52);
}

.kw-analysis-history-item.is-active {
  border-color: rgba(99, 179, 255, 0.72);
  background: rgba(30, 41, 59, 0.7);
  box-shadow: inset 0 0 0 1px rgba(99, 179, 255, 0.16);
}

.kw-analysis-history-keyword {
  font-size: 0.86rem;
  color: var(--kw-text-primary);
  line-height: 1.45;
}

.kw-analysis-history-meta {
  font-size: 0.74rem;
  color: var(--kw-text-secondary);
}

.kw-analysis-history-delete {
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(2, 6, 23, 0.32);
  color: rgba(248, 113, 113, 0.86);
}

.kw-analysis-history-delete:hover {
  border-color: rgba(248, 113, 113, 0.5);
  background: rgba(127, 29, 29, 0.24);
}

.kw-analysis-history-head {
  align-items: center;
  margin-bottom: 10px;
}

.kw-analysis-history-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.kw-analysis-history-title-text {
  white-space: nowrap;
}

.kw-analysis-history-count {
  min-width: 1.5rem;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  color: rgba(191, 219, 254, 0.95);
  border: 1px solid rgba(99, 179, 255, 0.35);
  background: rgba(59, 130, 246, 0.14);
  text-align: center;
}

.kw-analysis-history-clear.btn {
  border-color: rgba(248, 113, 113, 0.3);
  color: rgba(254, 202, 202, 0.95);
}

.kw-analysis-history-clear.btn:hover:not(:disabled) {
  border-color: rgba(248, 113, 113, 0.55);
  background: rgba(127, 29, 29, 0.25);
}

.kw-analysis-history-list {
  max-height: min(23rem, 58vh);
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.35) transparent;
}

.kw-analysis-history-list::-webkit-scrollbar {
  width: 7px;
}

.kw-analysis-history-list::-webkit-scrollbar-track {
  background: transparent;
}

.kw-analysis-history-list::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.28);
  border-radius: 999px;
}

.kw-analysis-history-list::-webkit-scrollbar-thumb:hover {
  background: rgba(99, 179, 255, 0.45);
}

.kw-analysis-history-row {
  gap: 8px;
  align-items: stretch;
}

.kw-analysis-history-item {
  gap: 6px;
}

.kw-analysis-history-main {
  display: grid;
  gap: 3px;
  width: 100%;
}

.kw-analysis-history-keyword {
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.kw-analysis-history-date {
  font-size: 0.73rem;
  color: rgba(148, 163, 184, 0.9);
}

.kw-analysis-history-meta {
  display: block;
  font-size: 0.76rem;
}

.kw-analysis-history-channel {
  display: block;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.kw-analysis-history-channel.is-empty {
  color: rgba(148, 163, 184, 0.6);
}

.kw-analysis-history-empty {
  margin: 4px 0 0;
  padding: 12px;
  border: 1px dashed rgba(148, 163, 184, 0.28);
  border-radius: 10px;
  background: rgba(2, 6, 23, 0.24);
}

.kw-analysis-toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 1300;
  max-width: min(92vw, 360px);
  padding: 0.62rem 0.82rem;
  border-radius: 10px;
  border: 1px solid rgba(16, 185, 129, 0.36);
  background: rgba(3, 12, 24, 0.92);
  color: rgba(209, 250, 229, 0.98);
  font-size: 0.82rem;
  font-weight: 600;
  box-shadow: 0 14px 40px rgba(2, 6, 23, 0.58);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.kw-analysis-toast.is-show {
  opacity: 1;
  transform: translateY(0);
}

.kw-analysis-toast.is-error {
  border-color: rgba(248, 113, 113, 0.45);
  color: rgba(254, 226, 226, 0.96);
}

.kw-analysis-confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 1250;
  display: grid;
  place-items: center;
  padding: 16px;
}

.kw-analysis-confirm-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, 0.66);
  backdrop-filter: blur(3px);
}

.kw-analysis-confirm-dialog {
  position: relative;
  z-index: 1;
  width: min(100%, 430px);
  padding: 16px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.96);
}

.kw-analysis-confirm-title {
  margin: 0 0 8px;
  min-height: 1.3em;
  font-size: 1rem;
  line-height: 1.35;
  opacity: 1;
  color: rgba(241, 245, 249, 0.98);
}

.kw-analysis-confirm-message {
  margin: 0 0 14px;
  min-height: 2.6em;
  font-size: 0.86rem;
  line-height: 1.55;
  opacity: 1;
  color: rgba(148, 163, 184, 0.95);
}

.kw-analysis-confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.kw-analysis-confirm-actions .btn-danger {
  border-color: rgba(248, 113, 113, 0.45);
  color: rgba(254, 226, 226, 0.98);
  background: rgba(127, 29, 29, 0.3);
}

.kw-analysis-confirm-actions .btn-danger:hover:not(:disabled) {
  border-color: rgba(248, 113, 113, 0.65);
  background: rgba(127, 29, 29, 0.45);
}

body.kw-analysis-modal-open {
  overflow: hidden;
}

html[data-theme="light"] .kw-analysis-toolbar,
html[data-theme="light"] .kw-analysis-history-panel,
html[data-theme="light"] .kw-analysis-card,
html[data-theme="light"] .kw-analysis-channel-card {
  background: rgba(255, 255, 255, 0.94);
  border-color: rgba(100, 116, 139, 0.2);
}

html[data-theme="light"] .kw-analysis-section .trending-section-lead,
html[data-theme="light"] .kw-analysis-label,
html[data-theme="light"] .kw-analysis-history-meta,
html[data-theme="light"] .kw-analysis-channel-subs,
html[data-theme="light"] .kw-analysis-channel-field-label {
  color: rgba(71, 85, 105, 0.9);
}

html[data-theme="light"] .kw-analysis-input {
  background: #fff;
  border-color: rgba(100, 116, 139, 0.28);
  color: rgba(15, 23, 42, 0.95);
}

html[data-theme="light"] .kw-analysis-card-head,
html[data-theme="light"] .kw-analysis-channels-head,
html[data-theme="light"] .kw-analysis-channel-head,
html[data-theme="light"] .kw-analysis-channel-actions {
  border-bottom-color: rgba(100, 116, 139, 0.16);
}

html[data-theme="light"] .kw-analysis-card-title,
html[data-theme="light"] .kw-analysis-channels-heading {
  color: rgba(51, 65, 85, 0.95);
}

html[data-theme="light"] .kw-analysis-text,
html[data-theme="light"] .kw-analysis-list-text,
html[data-theme="light"] .kw-analysis-channel-field,
html[data-theme="light"] .kw-analysis-history-keyword {
  color: rgba(15, 23, 42, 0.92);
}

html[data-theme="light"] .kw-analysis-list > li,
html[data-theme="light"] .kw-analysis-list--numbered > li {
  border-bottom-color: rgba(100, 116, 139, 0.14);
}

html[data-theme="light"] .kw-analysis-context-hint {
  background: rgba(248, 250, 252, 0.95);
  border-color: rgba(100, 116, 139, 0.22);
  color: rgba(51, 65, 85, 0.9);
}

html[data-theme="light"] .kw-analysis-history-item {
  background: rgba(248, 250, 252, 0.95);
  border-color: rgba(100, 116, 139, 0.24);
}

html[data-theme="light"] .kw-analysis-history-item:hover {
  border-color: rgba(59, 130, 246, 0.42);
  background: #fff;
}

html[data-theme="light"] .kw-analysis-history-item.is-active {
  border-color: rgba(59, 130, 246, 0.7);
  background: rgba(239, 246, 255, 0.95);
}

html[data-theme="light"] .kw-analysis-history-count {
  color: rgba(30, 64, 175, 0.92);
  border-color: rgba(59, 130, 246, 0.35);
  background: rgba(219, 234, 254, 0.95);
}

html[data-theme="light"] .kw-analysis-history-clear.btn {
  color: rgba(153, 27, 27, 0.95);
  border-color: rgba(220, 38, 38, 0.32);
}

html[data-theme="light"] .kw-analysis-history-empty {
  border-color: rgba(100, 116, 139, 0.26);
  background: rgba(248, 250, 252, 0.95);
}

html[data-theme="light"] .kw-analysis-toast {
  border-color: rgba(5, 150, 105, 0.35);
  background: rgba(255, 255, 255, 0.98);
  color: rgba(5, 150, 105, 0.95);
}

html[data-theme="light"] .kw-analysis-toast.is-error {
  border-color: rgba(220, 38, 38, 0.42);
  color: rgba(153, 27, 27, 0.95);
}

html[data-theme="light"] .kw-analysis-confirm-backdrop {
  background: rgba(15, 23, 42, 0.42);
}

html[data-theme="light"] .kw-analysis-confirm-dialog {
  background: rgba(255, 255, 255, 0.98);
  border-color: rgba(100, 116, 139, 0.28);
}

html[data-theme="light"] .kw-analysis-confirm-title {
  opacity: 1;
  color: rgba(15, 23, 42, 0.95);
}

html[data-theme="light"] .kw-analysis-confirm-message {
  opacity: 1;
  color: rgba(71, 85, 105, 0.92);
}

@media (max-width: 768px) {
  .kw-analysis-toolbar {
    padding: 12px;
    gap: 8px 12px;
  }

  .kw-analysis-input {
    height: 2.35rem;
    min-height: 2.35rem;
    padding: 0 0.7rem;
    font-size: 0.84rem;
  }

  .kw-analysis-results-stack {
    gap: 12px;
  }

  .kw-analysis-grid,
  .kw-analysis-channel-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .kw-analysis-card,
  .kw-analysis-card[data-kw-layout="wide"] {
    grid-column: span 1;
  }

  .kw-analysis-card-head,
  .kw-analysis-channels-head,
  .kw-analysis-channel-head {
    min-height: 40px;
    padding: 10px 12px;
  }

  .kw-analysis-card-body {
    padding: 10px 12px 12px;
    font-size: 0.85rem;
    max-width: 100%;
  }

  .kw-analysis-channel-thumb {
    width: 2.3rem;
    height: 2.3rem;
  }

  .kw-analysis-channel-body {
    padding: 10px 12px 12px;
    font-size: 0.82rem;
  }

  .kw-analysis-channel-actions {
    padding: 8px 12px 10px;
  }

  .kw-analysis-history-panel {
    padding: 10px;
  }

  .kw-analysis-history-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .kw-analysis-history-head .kw-analysis-history-clear {
    align-self: stretch;
  }

  .kw-analysis-history-list {
    max-height: 16.5rem;
    padding-right: 2px;
  }

  .kw-analysis-history-row {
    gap: 6px;
  }

  .kw-analysis-history-item {
    padding: 9px 10px;
  }

  .kw-analysis-history-delete {
    width: 2rem;
    height: 2rem;
  }

  .kw-analysis-toast {
    left: 10px;
    right: 10px;
    bottom: 10px;
    max-width: none;
  }

  .kw-analysis-confirm-dialog {
    width: min(100%, 460px);
    padding: 14px;
  }

  .kw-analysis-confirm-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .kw-analysis-results-section + .kw-analysis-results-section {
    padding-top: 10px;
  }
}

/* ===== Troll Image tool (root-admin demo) ===== */
.troll-content {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.troll-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 20px;
  border-radius: var(--radius-lg, 22px);
}

.troll-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.troll-field-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

.troll-upload {
  position: relative;
  display: block;
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius-md, 16px);
  background: var(--surface);
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
  overflow: hidden;
}

.troll-upload:hover {
  border-color: var(--accent-violet);
  background: var(--surface-2);
}

.troll-upload-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
}

.troll-upload-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 32px 16px;
  text-align: center;
  color: var(--text-secondary);
  pointer-events: none;
}

.troll-upload-icon {
  color: var(--accent-violet);
  display: inline-flex;
}

.troll-upload-cta {
  font-weight: 600;
  color: var(--text);
}

.troll-upload-hint {
  font-size: 12px;
  color: var(--text-tertiary);
}

.troll-upload-preview {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 14px;
  pointer-events: none;
}

.troll-preview-img {
  max-width: 100%;
  max-height: 320px;
  border-radius: var(--radius-sm, 10px);
  object-fit: contain;
}

.troll-remove-btn {
  align-self: flex-start;
}

.troll-textarea {
  width: 100%;
  resize: vertical;
  min-height: 74px;
  padding: 12px 14px;
  border-radius: var(--radius-md, 16px);
  border: 1px solid var(--field-border-violet, rgba(167, 139, 250, 0.35));
  background: var(--surface);
  color: var(--text);
  font: inherit;
  line-height: 1.5;
  transition: border-color var(--dur-fast, 220ms) var(--ease), box-shadow var(--dur-fast, 220ms) var(--ease), background var(--dur-fast, 220ms) var(--ease);
}

.troll-textarea:focus {
  outline: none;
  border-color: var(--field-border-cyan, rgba(103, 232, 249, 0.5));
  background: var(--surface-2);
  box-shadow: 0 0 0 1px rgba(103, 232, 249, 0.12), 0 0 24px var(--field-glow-cyan, rgba(103, 232, 249, 0.1));
}

.troll-field--count {
  max-width: 220px;
}

.troll-field .jr-select {
  display: flex;
  width: 100%;
}

.troll-field .jr-select .jr-select-trigger {
  border-color: var(--field-border-violet, rgba(167, 139, 250, 0.35));
  background: var(--surface);
  border-radius: var(--radius-md, 16px);
}

.troll-field .jr-select .jr-select-trigger:hover,
.troll-field .jr-select.is-open .jr-select-trigger {
  border-color: var(--field-border-cyan, rgba(103, 232, 249, 0.5));
  background: rgba(103, 232, 249, 0.06);
  box-shadow: 0 0 0 1px rgba(103, 232, 249, 0.12), 0 0 20px var(--field-glow-cyan, rgba(103, 232, 249, 0.08));
}

.troll-field .jr-select .jr-select-trigger:focus-visible {
  border-color: var(--field-border-cyan, rgba(103, 232, 249, 0.55));
  box-shadow: 0 0 0 3px var(--field-glow-cyan, rgba(103, 232, 249, 0.14));
}

.troll-select {
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--radius-md, 16px);
  border: 1px solid var(--field-border-violet, rgba(167, 139, 250, 0.35));
  background: var(--surface);
  color: var(--text);
  font: inherit;
  cursor: pointer;
}

.troll-select:focus {
  outline: none;
  border-color: var(--field-border-cyan, rgba(103, 232, 249, 0.5));
  box-shadow: 0 0 0 1px rgba(103, 232, 249, 0.12), 0 0 20px var(--field-glow-cyan, rgba(103, 232, 249, 0.08));
}

.troll-field-hint {
  display: block;
  margin-top: 6px;
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--text-muted, rgba(255, 255, 255, 0.55));
}

.troll-actions {
  display: flex;
  gap: 12px;
}

.troll-generate-btn.is-loading {
  opacity: 0.7;
  pointer-events: none;
}

.troll-usage {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 16px;
  border-radius: var(--radius-md, 16px);
  background: var(--surface);
  border: 1px solid var(--border, var(--border-strong));
}

.troll-usage-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px 14px;
}

.troll-usage-text {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.troll-usage-hint {
  font-size: 11px;
  color: var(--text-tertiary);
}

.troll-usage-bar {
  position: relative;
  height: 8px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
}

.troll-usage-bar-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent-violet), var(--accent-pink, var(--accent-violet)));
  transition: width 0.35s ease;
}

.troll-usage.is-warn .troll-usage-bar-fill {
  background: linear-gradient(90deg, #f59e0b, #f97316);
}

.troll-usage.is-limit .troll-usage-bar-fill {
  background: linear-gradient(90deg, #ef4444, #dc2626);
}

.troll-usage.is-limit .troll-usage-text {
  color: var(--danger, #ef4444);
}

.troll-results {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.troll-result-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  border-radius: var(--radius-md, 16px);
}

.troll-result-img {
  width: 100%;
  height: auto;
  border-radius: var(--radius-sm, 10px);
  background: var(--surface-2);
  object-fit: contain;
}

.troll-download-btn {
  align-self: stretch;
  text-align: center;
  text-decoration: none;
}

@media (max-width: 640px) {
  .troll-results {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }
}

html[data-theme="light"] .troll-textarea {
  border-color: rgba(61, 122, 74, 0.28);
  background: rgba(255, 255, 255, 0.82);
}

html[data-theme="light"] .troll-textarea:focus {
  border-color: rgba(61, 122, 74, 0.45);
  box-shadow: 0 0 0 3px rgba(61, 122, 74, 0.12);
}

html[data-theme="light"] .troll-field .jr-select .jr-select-trigger {
  border-color: rgba(61, 122, 74, 0.28);
  background: rgba(255, 255, 255, 0.82);
}

html[data-theme="light"] .troll-field .jr-select .jr-select-trigger:hover,
html[data-theme="light"] .troll-field .jr-select.is-open .jr-select-trigger {
  border-color: rgba(61, 122, 74, 0.45);
  background: rgba(61, 122, 74, 0.08);
  box-shadow: 0 0 0 1px rgba(61, 122, 74, 0.12);
}

html[data-theme="light"] .trending-search-input:focus,
html[data-theme="light"] .trending-filter-input:focus {
  border-color: rgba(61, 122, 74, 0.45);
  background: rgba(61, 122, 74, 0.06);
  box-shadow: 0 0 0 3px rgba(61, 122, 74, 0.12);
}

html[data-theme="light"] .kw-analysis-input:focus {
  border-color: rgba(61, 122, 74, 0.45);
  box-shadow: 0 0 0 3px rgba(61, 122, 74, 0.12);
}

/* Channel brand check tool */
.brand-check-section .trending-section-lead {
  max-width: 52ch;
}

.brand-check-toolbar {
  display: grid;
  gap: 14px;
  margin-bottom: 16px;
}

.brand-check-summary {
  margin-bottom: 16px;
}

.brand-check-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

.brand-check-stat-card {
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-check-stat-card--warn {
  border-color: rgba(255, 170, 60, 0.35);
  background: rgba(255, 170, 60, 0.08);
}

.brand-check-stat-label {
  display: block;
  font-size: 0.78rem;
  opacity: 0.75;
  margin-bottom: 6px;
}

.brand-check-stat-value {
  font-size: 1.45rem;
  line-height: 1.1;
}

.brand-check-channels-block,
.brand-check-analysis-block,
.brand-check-suggestions-block {
  margin-bottom: 16px;
  padding: 18px;
}

.brand-check-block-title {
  margin: 0 0 8px;
  font-size: 1.05rem;
}

.brand-check-block-lead {
  margin: 0 0 14px;
  font-size: 0.86rem;
  opacity: 0.8;
}

.brand-check-channel-list {
  display: grid;
  gap: 12px;
}

.brand-check-channel-card {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 12px;
  padding: 12px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.15);
}

.brand-check-channel-card.brand-check-match--exact {
  border-color: rgba(255, 90, 90, 0.45);
}

.brand-check-channel-card.brand-check-match--partial {
  border-color: rgba(255, 170, 60, 0.4);
}

.brand-check-channel-thumb {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
}

.brand-check-channel-thumb--placeholder {
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.5);
}

.brand-check-channel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.brand-check-channel-name {
  margin: 0;
  font-size: 0.98rem;
}

.brand-check-channel-name a {
  color: inherit;
  text-decoration: none;
}

.brand-check-channel-name a:hover {
  text-decoration: underline;
}

.brand-check-match-badge {
  font-size: 0.72rem;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
}

.brand-check-match--exact .brand-check-match-badge {
  background: rgba(255, 90, 90, 0.2);
}

.brand-check-match--partial .brand-check-match-badge {
  background: rgba(255, 170, 60, 0.2);
}

.brand-check-channel-desc {
  margin: 0 0 8px;
  font-size: 0.82rem;
  opacity: 0.85;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.brand-check-channel-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.78rem;
  opacity: 0.9;
}

.brand-check-score-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.brand-check-score-pill {
  font-size: 0.82rem;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.brand-check-text {
  margin: 0 0 10px;
  font-size: 0.9rem;
  line-height: 1.55;
}

.brand-check-verdict {
  font-weight: 600;
}

.brand-check-suggestions-list {
  display: grid;
  gap: 12px;
}

.brand-check-suggestion-card {
  padding: 14px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.12);
}

.brand-check-suggestion-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.brand-check-suggestion-index {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.78rem;
  background: rgba(255, 255, 255, 0.1);
}

.brand-check-suggestion-name {
  margin: 0;
  flex: 1;
  min-width: 160px;
  font-size: 1rem;
}

.brand-check-suggestion-scores {
  display: flex;
  gap: 10px;
  font-size: 0.76rem;
  opacity: 0.85;
}

.brand-check-suggestion-why,
.brand-check-suggestion-uniq {
  margin: 0 0 6px;
  font-size: 0.86rem;
  line-height: 1.5;
}

.brand-check-empty {
  margin: 0;
  opacity: 0.75;
  font-size: 0.88rem;
}

/* ── Brand check premium loader ─────────────────────────── */
.bc-loader {
  position: relative;
  margin: 0 0 18px;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(103, 232, 249, 0.18);
  isolation: isolate;
}

.bc-loader[hidden] {
  display: none !important;
}

.bc-loader-glow {
  position: absolute;
  inset: -40% -20% auto;
  height: 70%;
  background:
    radial-gradient(ellipse at 30% 40%, rgba(103, 232, 249, 0.22), transparent 55%),
    radial-gradient(ellipse at 70% 30%, rgba(167, 139, 250, 0.18), transparent 50%);
  animation: bcGlowDrift 5.5s ease-in-out infinite alternate;
  pointer-events: none;
  z-index: 0;
}

.bc-loader-bar {
  position: relative;
  height: 3px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
  z-index: 1;
}

.bc-loader-bar-fill {
  position: absolute;
  inset: 0;
  width: 42%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(103, 232, 249, 0.95),
    rgba(167, 139, 250, 0.9),
    transparent
  );
  animation: bcBarSweep 1.65s ease-in-out infinite;
}

.bc-loader-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 28px 22px 24px;
  text-align: center;
}

.bc-loader-orb {
  position: relative;
  width: 88px;
  height: 88px;
  display: grid;
  place-items: center;
  margin-bottom: 4px;
}

.bc-loader-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1.5px solid transparent;
  pointer-events: none;
}

.bc-loader-ring--outer {
  border-top-color: rgba(103, 232, 249, 0.85);
  border-right-color: rgba(103, 232, 249, 0.25);
  animation: bcSpin 1.8s linear infinite;
}

.bc-loader-ring--mid {
  inset: 10px;
  border-bottom-color: rgba(167, 139, 250, 0.8);
  border-left-color: rgba(167, 139, 250, 0.2);
  animation: bcSpinReverse 2.4s linear infinite;
}

.bc-loader-core {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  color: rgba(103, 232, 249, 0.98);
  background:
    linear-gradient(145deg, rgba(103, 232, 249, 0.18), rgba(167, 139, 250, 0.12));
  box-shadow:
    0 0 0 1px rgba(103, 232, 249, 0.25),
    0 0 28px rgba(103, 232, 249, 0.35);
  animation: bcCorePulse 2.2s ease-in-out infinite;
}

.bc-loader-spark {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(103, 232, 249, 0.95);
  box-shadow: 0 0 10px rgba(103, 232, 249, 0.8);
  animation: bcSparkOrbit 3.2s linear infinite;
}

.bc-loader-spark--1 { offset-path: path("M44,4 A40,40 0 1,1 43.9,4"); animation-delay: 0s; }
.bc-loader-spark--2 {
  background: rgba(167, 139, 250, 0.95);
  box-shadow: 0 0 10px rgba(167, 139, 250, 0.75);
  offset-path: path("M44,4 A40,40 0 1,1 43.9,4");
  animation-duration: 4s;
  animation-delay: -1.2s;
}
.bc-loader-spark--3 {
  width: 4px;
  height: 4px;
  offset-path: path("M44,14 A30,30 0 1,1 43.9,14");
  animation-duration: 2.6s;
  animation-delay: -0.6s;
}

.bc-loader-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 650;
  letter-spacing: 0.01em;
  color: var(--text-primary, #f4f7fb);
  animation: bcTextBreath 2.8s ease-in-out infinite;
}

.bc-loader-sub {
  margin: 0;
  max-width: 42ch;
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--text-secondary, rgba(226, 232, 240, 0.72));
  min-height: 2.6em;
  transition: opacity 0.35s ease;
}

.bc-loader-steps {
  list-style: none;
  margin: 6px 0 0;
  padding: 0;
  width: min(100%, 420px);
  display: grid;
  gap: 8px;
  text-align: left;
}

.bc-loader-step {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(255, 255, 255, 0.025);
  color: rgba(226, 232, 240, 0.55);
  font-size: 0.82rem;
  line-height: 1.35;
  transition: border-color 0.35s ease, background 0.35s ease, color 0.35s ease, transform 0.35s ease;
}

.bc-loader-step-dot {
  width: 10px;
  height: 10px;
  margin: 0 auto;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.28);
  background: transparent;
  position: relative;
}

.bc-loader-step.is-active {
  color: rgba(248, 250, 252, 0.95);
  border-color: rgba(103, 232, 249, 0.35);
  background: rgba(103, 232, 249, 0.08);
  transform: translateY(-1px);
}

.bc-loader-step.is-active .bc-loader-step-dot {
  border-color: transparent;
  background: rgba(103, 232, 249, 0.95);
  box-shadow: 0 0 12px rgba(103, 232, 249, 0.65);
  animation: bcDotPulse 1.2s ease-in-out infinite;
}

.bc-loader-step.is-done {
  color: rgba(167, 243, 208, 0.92);
  border-color: rgba(52, 211, 153, 0.28);
  background: rgba(52, 211, 153, 0.07);
}

.bc-loader-step.is-done .bc-loader-step-dot {
  border-color: transparent;
  background: #34d399;
  box-shadow: none;
}

.bc-loader-step.is-done .bc-loader-step-dot::after {
  content: "";
  position: absolute;
  left: 2.5px;
  top: 1px;
  width: 4px;
  height: 7px;
  border: solid #06281c;
  border-width: 0 1.6px 1.6px 0;
  transform: rotate(45deg);
}

.bc-loader-dots {
  display: flex;
  gap: 6px;
  margin-top: 2px;
}

.bc-loader-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(103, 232, 249, 0.9);
  animation: bcDotBounce 1.25s ease-in-out infinite both;
}

.bc-loader-dots span:nth-child(2) { animation-delay: 0.16s; }
.bc-loader-dots span:nth-child(3) { animation-delay: 0.32s; }

.brand-check-toolbar.is-busy,
.brand-check-channels-block.is-dimmed {
  opacity: 0.55;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.brand-check-channel-list.is-skeleton .brand-check-skel {
  height: 72px;
  border-radius: 14px;
  margin-bottom: 10px;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.04) 0%,
    rgba(103, 232, 249, 0.1) 45%,
    rgba(255, 255, 255, 0.04) 100%
  );
  background-size: 200% 100%;
  animation: bcSkelSweep 1.4s ease-in-out infinite;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

@keyframes bcGlowDrift {
  from { transform: translate3d(-4%, 0, 0) scale(1); opacity: 0.7; }
  to   { transform: translate3d(6%, 4%, 0) scale(1.08); opacity: 1; }
}

@keyframes bcBarSweep {
  0%   { transform: translateX(-120%); }
  100% { transform: translateX(280%); }
}

@keyframes bcSpin {
  to { transform: rotate(360deg); }
}

@keyframes bcSpinReverse {
  to { transform: rotate(-360deg); }
}

@keyframes bcCorePulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 1px rgba(103, 232, 249, 0.25), 0 0 22px rgba(103, 232, 249, 0.28); }
  50%      { transform: scale(1.06); box-shadow: 0 0 0 1px rgba(103, 232, 249, 0.4), 0 0 34px rgba(103, 232, 249, 0.5); }
}

@keyframes bcSparkOrbit {
  0%   { offset-distance: 0%; opacity: 0.35; }
  30%  { opacity: 1; }
  100% { offset-distance: 100%; opacity: 0.35; }
}

@keyframes bcTextBreath {
  0%, 100% { opacity: 0.82; }
  50%      { opacity: 1; }
}

@keyframes bcDotPulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.25); }
}

@keyframes bcDotBounce {
  0%, 80%, 100% { transform: scale(0.5); opacity: 0.35; }
  40%           { transform: scale(1.15); opacity: 1; }
}

@keyframes bcSkelSweep {
  0%   { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

html[data-theme="light"] .bc-loader {
  border-color: rgba(61, 122, 74, 0.22);
  background: rgba(232, 245, 233, 0.65);
}

html[data-theme="light"] .bc-loader-glow {
  background:
    radial-gradient(ellipse at 30% 40%, rgba(61, 122, 74, 0.18), transparent 55%),
    radial-gradient(ellipse at 70% 30%, rgba(95, 195, 198, 0.16), transparent 50%);
}

html[data-theme="light"] .bc-loader-bar {
  background: rgba(61, 122, 74, 0.08);
}

html[data-theme="light"] .bc-loader-bar-fill {
  background: linear-gradient(90deg, transparent, rgba(61, 122, 74, 0.8), rgba(95, 195, 198, 0.85), transparent);
}

html[data-theme="light"] .bc-loader-ring--outer {
  border-top-color: rgba(61, 122, 74, 0.85);
  border-right-color: rgba(61, 122, 74, 0.2);
}

html[data-theme="light"] .bc-loader-ring--mid {
  border-bottom-color: rgba(95, 195, 198, 0.85);
  border-left-color: rgba(95, 195, 198, 0.2);
}

html[data-theme="light"] .bc-loader-core {
  color: #2f6b3c;
  background: linear-gradient(145deg, rgba(61, 122, 74, 0.16), rgba(95, 195, 198, 0.12));
  box-shadow: 0 0 0 1px rgba(61, 122, 74, 0.22), 0 0 22px rgba(61, 122, 74, 0.22);
}

html[data-theme="light"] .bc-loader-title {
  color: #1f2933;
}

html[data-theme="light"] .bc-loader-sub {
  color: rgba(55, 65, 81, 0.78);
}

html[data-theme="light"] .bc-loader-step {
  background: rgba(255, 255, 255, 0.55);
  border-color: rgba(61, 122, 74, 0.12);
  color: rgba(55, 65, 81, 0.55);
}

html[data-theme="light"] .bc-loader-step.is-active {
  color: #1f2933;
  border-color: rgba(61, 122, 74, 0.35);
  background: rgba(61, 122, 74, 0.08);
}

html[data-theme="light"] .bc-loader-step.is-active .bc-loader-step-dot {
  background: #3d7a4a;
  box-shadow: 0 0 10px rgba(61, 122, 74, 0.45);
}

html[data-theme="light"] .bc-loader-dots span {
  background: #3d7a4a;
}

@media (prefers-reduced-motion: reduce) {
  .bc-loader-glow,
  .bc-loader-bar-fill,
  .bc-loader-ring--outer,
  .bc-loader-ring--mid,
  .bc-loader-core,
  .bc-loader-spark,
  .bc-loader-title,
  .bc-loader-step.is-active .bc-loader-step-dot,
  .bc-loader-dots span,
  .brand-check-channel-list.is-skeleton .brand-check-skel {
    animation: none !important;
  }
}

.tools-hero-chip--brand.is-active {
  border-color: rgba(201, 162, 39, 0.32);
  background: rgba(201, 162, 39, 0.08);
  color: rgba(250, 204, 21, 0.92);
}

.tools-hero-chip--troll.is-active {
  border-color: rgba(244, 114, 182, 0.28);
  background: rgba(244, 114, 182, 0.08);
  color: rgba(251, 207, 232, 0.92);
}

.tools-hero-chip--smm.is-active {
  border-color: rgba(45, 122, 94, 0.48);
  background: rgba(45, 122, 94, 0.16);
  color: #9fd4bd;
  font-weight: 650;
}

.tools-hero-chip--smm.is-active:hover {
  box-shadow: 0 0 0 1px rgba(45, 122, 94, 0.28);
}

html[data-theme="light"] .tools-hero-chip--smm.is-active {
  border-color: rgba(31, 92, 70, 0.38);
  background: rgba(45, 122, 94, 0.1);
  color: #1f5c46;
}
/* SMM Order tool — dark-first (matches site.css :root); light overrides below.
   Avoids white FOUC when the panel opens: surfaces are already dark on first paint. */
.smm-section,
.smm-modal-backdrop {
  color-scheme: dark;
  --smm-bg: transparent;
  --smm-surface: rgba(15, 23, 42, 0.92);
  --smm-surface-2: rgba(255, 255, 255, 0.045);
  --smm-ink: rgba(241, 245, 249, 0.94);
  --smm-muted: rgba(148, 163, 184, 0.88);
  --smm-line: rgba(255, 255, 255, 0.1);
  --smm-line-soft: rgba(255, 255, 255, 0.06);
  --smm-accent: #4ade80;
  --smm-accent-deep: #86efac;
  --smm-accent-soft: rgba(45, 122, 94, 0.28);
  --smm-accent-mid: rgba(74, 222, 128, 0.38);
  --smm-warn: #fbbf24;
  --smm-danger: #f87171;
  --smm-ok: #4ade80;
  --smm-form-grad: linear-gradient(180deg, rgba(255, 255, 255, 0.04) 0%, rgba(45, 122, 94, 0.08) 100%);
  --smm-cat-hover: rgba(45, 122, 94, 0.22);
  --smm-chip-provider-bg: rgba(45, 122, 94, 0.2);
  --smm-chip-provider-border: rgba(74, 222, 128, 0.28);
  --smm-ok-soft: rgba(74, 222, 128, 0.18);
  --smm-ok-box-bg: rgba(74, 222, 128, 0.12);
  --smm-ok-box-border: rgba(134, 239, 172, 0.45);
  --smm-warn-soft: rgba(251, 191, 36, 0.16);
  --smm-warn-box-bg: rgba(251, 191, 36, 0.1);
  --smm-warn-box-border: rgba(252, 211, 77, 0.4);
  --smm-bad-soft: rgba(248, 113, 113, 0.16);
  --smm-pending-bg: rgba(148, 163, 184, 0.18);
  --smm-pending-ink: rgba(203, 213, 225, 0.92);
  --smm-shadow: rgba(0, 0, 0, 0.28);
  --smm-shadow-lg: rgba(0, 0, 0, 0.55);
  --smm-focus-ring: rgba(74, 222, 128, 0.22);
  --smm-radius: 16px;
  --smm-radius-sm: 12px;
}

/* Light theme — soft mint / sage */
html[data-theme="light"] .smm-section,
html[data-theme="light"] .smm-modal-backdrop {
  color-scheme: light;
  --smm-bg: #f3f7f4;
  --smm-surface: #ffffff;
  --smm-surface-2: #f7fbf8;
  --smm-ink: #1e2b24;
  --smm-muted: #5f7268;
  --smm-line: #d5e4db;
  --smm-line-soft: #e8f0eb;
  --smm-accent: #2d7a5e;
  --smm-accent-deep: #1f5c46;
  --smm-accent-soft: #e6f3ec;
  --smm-accent-mid: #b8dcc9;
  --smm-warn: #b45309;
  --smm-danger: #dc2626;
  --smm-ok: #15803d;
  --smm-form-grad: linear-gradient(180deg, #f8fcf9 0%, #f3f8f5 100%);
  --smm-cat-hover: #dff0e6;
  --smm-chip-provider-bg: #f0f7f3;
  --smm-chip-provider-border: #c7ddd2;
  --smm-ok-soft: #dcfce7;
  --smm-ok-box-bg: #f0fdf4;
  --smm-ok-box-border: #86efac;
  --smm-warn-soft: #fef3c7;
  --smm-warn-box-bg: #fffbeb;
  --smm-warn-box-border: #fcd34d;
  --smm-bad-soft: #fee2e2;
  --smm-pending-bg: #e2e8f0;
  --smm-pending-ink: #475569;
  --smm-shadow: rgba(30, 43, 36, 0.05);
  --smm-shadow-lg: rgba(30, 43, 36, 0.2);
  --smm-focus-ring: rgba(45, 122, 94, 0.15);
}
/* SMM panel intro — quiet slate/sage (not Tools title mint band) */
.smm-section .smm-section-intro {
  position: relative;
  margin-bottom: 14px;
  padding: 12px 14px 11px;
  border-radius: var(--smm-radius-sm, 12px);
  border: 1px solid var(--smm-line);
  background:
    linear-gradient(
      165deg,
      var(--smm-surface-2) 0%,
      rgba(255, 255, 255, 0.02) 100%
    );
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 6px 18px var(--smm-shadow);
  overflow: hidden;
  isolation: isolate;
}

.smm-section .smm-section-intro::before {
  content: "";
  position: absolute;
  top: 0;
  left: 10px;
  right: 10px;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--smm-accent-mid) 40%,
    var(--smm-accent-mid) 60%,
    transparent
  );
  pointer-events: none;
  opacity: 0.65;
}

.smm-section .smm-section-intro__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  margin: 0 0 6px;
  border-radius: 6px;
  border: 1px solid var(--smm-accent-mid);
  background: var(--smm-accent-soft);
  font-size: 0.62rem;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--smm-accent-deep);
  line-height: 1.3;
}

.smm-section .smm-section-intro__title {
  margin: 0 0 4px;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: var(--smm-ink);
}

.smm-section .smm-section-intro__lead {
  margin: 0;
  max-width: 58ch;
  color: var(--smm-muted);
  font-size: 0.8rem;
  font-weight: 400;
  line-height: 1.45;
}

html[data-theme="light"] .smm-section .smm-section-intro {
  /* Cool slate — stays quieter than Tools title mint band */
  background: linear-gradient(165deg, #ffffff 0%, #f4f6f5 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 4px 14px var(--smm-shadow);
}

html[data-theme="light"] .smm-section .smm-section-intro::before {
  opacity: 0.85;
}

@media (max-width: 768px) {
  .smm-section .smm-section-intro {
    margin-bottom: 12px;
    padding: 10px 12px 10px;
  }

  .smm-section .smm-section-intro__title {
    font-size: 0.98rem;
  }

  .smm-section .smm-section-intro__lead {
    font-size: 0.76rem;
  }
}

.smm-content { display: flex; flex-direction: column; gap: 1rem; color: var(--smm-ink); }

.smm-order-card {
  background: var(--smm-surface);
  border: 1px solid var(--smm-line);
  border-radius: var(--smm-radius);
  padding: 1.15rem 1.2rem;
  display: flex; flex-direction: column; gap: 1rem;
  box-shadow: 0 8px 28px var(--smm-shadow);
  /* Never interpolate surface from light→dark on open */
  transition: none;
}
.smm-stat,
.smm-order-form,
.smm-suggest,
.smm-queue,
.smm-browse,
.smm-orders-list,
.smm-service-list,
.smm-service-card,
.smm-order-item {
  transition: none;
}
.smm-order-card__head {
  display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap;
}
.smm-order-card__title { margin: 0; font-size: 1.15rem; font-weight: 800; color: var(--smm-ink); }
.smm-order-card__badges { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.smm-chip {
  display: inline-flex; align-items: center; gap: 0.35rem;
  padding: 0.35rem 0.7rem; border-radius: 999px; font-size: 0.76rem;
  border: 1px solid var(--smm-accent-mid); background: var(--smm-accent-soft); color: var(--smm-accent-deep);
}
.smm-chip strong { font-weight: 800; }
.smm-chip--provider { border-color: var(--smm-chip-provider-border); background: var(--smm-chip-provider-bg); }

.smm-cascade { display: flex; flex-direction: column; gap: 0.75rem; }
.smm-cascade__row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.smm-field { display: flex; flex-direction: column; gap: 0.35rem; min-width: 0; }
.smm-field--full { width: 100%; }
.smm-field-label { font-size: 0.78rem; font-weight: 700; color: var(--smm-muted); }
.smm-field-hint { font-size: 0.74rem; color: var(--smm-muted); }
.smm-input, .smm-select {
  width: 100%; min-width: 0; border-radius: 12px;
  border: 1px solid var(--smm-line);
  background: var(--smm-surface-2);
  color: var(--smm-ink);
  padding: 0.6rem 0.8rem;
  font: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}
/* Native select popup follows theme (dark/light), not forced white */
.smm-select {
  color-scheme: dark;
}
html[data-theme="light"] .smm-section .smm-select {
  color-scheme: light;
}
.smm-select option,
.smm-select optgroup {
  color: #e2e8f0;
  background-color: #0f172a;
  font-weight: 500;
}
html[data-theme="light"] .smm-section .smm-select option,
html[data-theme="light"] .smm-section .smm-select optgroup {
  color: #1e293b;
  background-color: #ffffff;
  font-weight: 500;
}
.smm-select option:disabled {
  color: #94a3b8;
  background-color: #1e293b;
}
html[data-theme="light"] .smm-section .smm-select option:disabled {
  color: #94a3b8;
  background-color: #f8fafc;
}
.smm-input:focus, .smm-select:focus {
  outline: none;
  border-color: var(--smm-accent);
  box-shadow: 0 0 0 3px var(--smm-focus-ring);
  background: var(--smm-surface);
}
.smm-select-wrap { position: relative; display: flex; align-items: center; }
.smm-select-icon {
  position: absolute; left: 0.7rem; z-index: 1; font-size: 0.85rem;
  color: var(--smm-accent); pointer-events: none;
}
.smm-select-wrap .smm-select { padding-left: 2.1rem; }
/* JrSelect hides native select — drop duplicate left icon to avoid 👍 👍 */
.smm-select-wrap:has(.jr-select) .smm-select-icon {
  display: none;
}

/* JrSelect for SMM service / quick-search / category — match SMM theme + rich option hierarchy */
.smm-section .jr-select--smm {
  display: flex;
  width: 100%;
}
.smm-section .jr-select--smm .jr-select-trigger {
  min-height: 0;
  padding: 0.55rem 2rem 0.55rem 0.75rem;
  border-radius: 12px;
  border: 1px solid var(--smm-line);
  background: var(--smm-surface-2);
  color: var(--smm-ink);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  box-shadow: none;
}
.smm-section .jr-select--smm .jr-select-trigger:hover,
.smm-section .jr-select--smm.is-open .jr-select-trigger {
  border-color: var(--smm-accent);
  background: var(--smm-surface);
  box-shadow: 0 0 0 3px var(--smm-focus-ring);
}
.smm-section .jr-select--smm .jr-select-trigger:focus-visible {
  outline: none;
  border-color: var(--smm-accent);
  box-shadow: 0 0 0 3px var(--smm-focus-ring);
}
.smm-section .jr-select--smm .jr-select-label {
  color: var(--smm-ink);
  font-weight: 600;
  display: flex;
  align-items: baseline;
  gap: 0;
  min-width: 0;
}
.smm-section .jr-select--smm .jr-select-caret {
  color: var(--smm-muted);
}
.jr-select-option--rich .jr-select-option-id {
  color: var(--smm-ink, var(--text));
}
.jr-select-option--rich .jr-select-option-price {
  color: var(--smm-accent-deep, var(--accent-cyan, #67e8f9));
}
.jr-select-option--rich .jr-select-option-desc {
  color: var(--smm-muted, var(--text-tertiary));
}
html[data-theme="light"] .jr-select-option--rich .jr-select-option-id {
  color: #1e2b24;
}
html[data-theme="light"] .jr-select-option--rich .jr-select-option-price {
  color: #1b5e45;
  font-weight: 800;
}
html[data-theme="light"] .jr-select-option--rich .jr-select-option-desc {
  color: #5b6b63;
}

/* Portaled SMM menus (body) — mint/sage catalog, quieter rows */
.jr-select-menu--smm {
  padding: 5px;
  border-radius: 12px;
  border: 1px solid rgba(74, 222, 128, 0.16);
  background: rgba(10, 16, 22, 0.98);
  box-shadow:
    0 18px 44px rgba(0, 0, 0, 0.52),
    0 0 0 1px rgba(255, 255, 255, 0.035);
  scrollbar-color: rgba(74, 222, 128, 0.32) transparent;
  max-width: min(420px, calc(100vw - 24px));
}
.jr-select-menu--smm .jr-select-option {
  gap: 8px;
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 500;
  color: rgba(226, 232, 240, 0.9);
  line-height: 1.35;
}
.jr-select-menu--smm .jr-select-option-name {
  display: flex;
  align-items: baseline;
  flex-wrap: nowrap;
  gap: 0;
  min-width: 0;
}
.jr-select-menu--smm .jr-select-option-emoji {
  flex-shrink: 0;
  opacity: 0.68;
  font-size: 0.92em;
  filter: saturate(0.85);
}
.jr-select-menu--smm .jr-select-option-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.jr-select-menu--smm .jr-select-option-count {
  margin-left: 0.35em;
  flex-shrink: 0;
  font-size: 0.9em;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: rgba(148, 163, 184, 0.72);
}
.jr-select-menu--smm .jr-select-option-check {
  color: #4ade80;
  font-size: 0.7rem;
}
.jr-select-menu--smm .jr-select-option--rich .jr-select-option-name {
  flex-direction: column;
  align-items: stretch;
  gap: 0.12rem;
}
.jr-select-menu--smm .jr-select-option--rich .jr-select-option-id {
  color: #e8f5ef;
  font-weight: 700;
  letter-spacing: 0.01em;
  font-size: 0.8rem;
}
.jr-select-menu--smm .jr-select-option--rich .jr-select-option-price {
  color: #5eead4;
  font-weight: 700;
  font-size: 0.78rem;
}
.jr-select-menu--smm .jr-select-option--rich .jr-select-option-desc {
  color: #94a3b8;
  font-size: 0.72rem;
}
.jr-select-menu--smm .jr-select-option.is-selected,
.jr-select-menu--smm .jr-select-option.is-focused,
.jr-select-menu--smm .jr-select-option:hover {
  background: rgba(45, 122, 94, 0.2);
  color: #ecfdf5;
}
.jr-select-menu--smm .jr-select-option.is-selected {
  background: rgba(45, 122, 94, 0.28);
  color: #d1fae5;
}
.jr-select-menu--smm .jr-select-option.is-selected .jr-select-option-count,
.jr-select-menu--smm .jr-select-option.is-focused .jr-select-option-count,
.jr-select-menu--smm .jr-select-option:hover .jr-select-option-count {
  color: rgba(167, 243, 208, 0.7);
}
.jr-select-menu--smm .jr-select-option.is-selected .jr-select-option-emoji,
.jr-select-menu--smm .jr-select-option.is-focused .jr-select-option-emoji,
.jr-select-menu--smm .jr-select-option:hover .jr-select-option-emoji {
  opacity: 0.85;
}

html[data-theme="light"] .jr-select-menu--smm {
  background: rgba(255, 255, 255, 0.98);
  border-color: rgba(45, 122, 94, 0.22);
  box-shadow: 0 16px 40px rgba(45, 90, 76, 0.12);
}
html[data-theme="light"] .jr-select-menu--smm .jr-select-option {
  color: #33453c;
}
html[data-theme="light"] .jr-select-menu--smm .jr-select-option-count {
  color: #7a8f84;
}
html[data-theme="light"] .jr-select-menu--smm .jr-select-option-emoji {
  opacity: 0.78;
}
html[data-theme="light"] .jr-select-menu--smm .jr-select-option-check {
  color: #2d7a5e;
}
html[data-theme="light"] .jr-select-menu--smm .jr-select-option--rich .jr-select-option-id {
  color: #1e2b24;
}
html[data-theme="light"] .jr-select-menu--smm .jr-select-option--rich .jr-select-option-price {
  color: #147a54;
}
html[data-theme="light"] .jr-select-menu--smm .jr-select-option--rich .jr-select-option-desc {
  color: #5b6b63;
}
html[data-theme="light"] .jr-select-menu--smm .jr-select-option.is-selected,
html[data-theme="light"] .jr-select-menu--smm .jr-select-option.is-focused,
html[data-theme="light"] .jr-select-menu--smm .jr-select-option:hover {
  background: rgba(45, 122, 94, 0.11);
  color: #1e2b24;
}
html[data-theme="light"] .jr-select-menu--smm .jr-select-option.is-selected {
  background: rgba(45, 122, 94, 0.16);
}
html[data-theme="light"] .jr-select-menu--smm .jr-select-option.is-selected .jr-select-option-count,
html[data-theme="light"] .jr-select-menu--smm .jr-select-option.is-focused .jr-select-option-count,
html[data-theme="light"] .jr-select-menu--smm .jr-select-option:hover .jr-select-option-count {
  color: #6b8176;
}

/* Trigger label count / emoji (closed) */
.smm-section .jr-select--smm .jr-select-option-emoji {
  opacity: 0.75;
  margin-right: 0.15em;
}
.smm-section .jr-select--smm .jr-select-option-count {
  font-weight: 500;
  color: var(--smm-muted);
  margin-left: 0.3em;
}
html[data-theme="light"] .smm-section .jr-select--smm .jr-select-option-count {
  color: #6b8176;
}

.smm-order-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(250px, 320px);
  gap: 0.85rem;
  align-items: start;
}
.smm-order-form {
  padding: 1rem;
  border-radius: var(--smm-radius-sm);
  border: 1px solid var(--smm-line-soft);
  background: var(--smm-form-grad);
  display: flex; flex-direction: column; gap: 0.75rem;
}
.smm-link-row { display: flex; gap: 0.45rem; align-items: center; }
.smm-paste-btn, .smm-ghost-btn {
  border: 1px solid var(--smm-line);
  background: var(--smm-surface);
  color: var(--smm-accent-deep);
  border-radius: 10px;
  padding: 0.45rem 0.75rem;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.smm-paste-btn:hover, .smm-ghost-btn:hover {
  border-color: var(--smm-accent-mid);
  background: var(--smm-accent-soft);
}
.smm-qty-row { display: flex; gap: 0.5rem; align-items: center; }
.smm-qty-row .smm-input { flex: 1; }
.smm-qty-price {
  min-width: 7.5rem; text-align: right; font-weight: 800; font-size: 0.86rem;
  color: var(--smm-accent-deep);
  padding: 0.5rem 0.65rem; border-radius: 10px;
  background: var(--smm-accent-soft); border: 1px solid var(--smm-accent-mid);
  white-space: nowrap;
  line-height: 1.2;
}
.smm-price-fee-hint {
  display: block;
  margin-top: 0.2rem;
  opacity: 0.72;
  font-size: 0.72rem;
}
.smm-qty-presets { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.smm-presets-with-custom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.45rem;
  margin-top: 0.35rem;
}
.smm-custom-chips-outer:empty,
.smm-custom-chips-outer[hidden] {
  display: none;
}
.smm-custom-open-btn {
  border: 1px dashed var(--smm-accent-mid, var(--smm-line));
  background: var(--smm-accent-soft);
  color: var(--smm-accent-deep);
  border-radius: 999px;
  padding: 0.28rem 0.7rem;
  font: inherit;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.smm-custom-open-btn:hover {
  border-style: solid;
  border-color: var(--smm-accent);
  background: var(--smm-accent-soft);
  color: var(--smm-accent-deep);
}
.smm-schedule-enable {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0.35rem 0 0.15rem;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text, #0f172a);
  cursor: pointer;
  user-select: none;
}
.smm-schedule-enable input {
  width: 1.05rem;
  height: 1.05rem;
  accent-color: #16a34a;
  cursor: pointer;
}
.smm-schedule-panel {
  margin-top: 0.35rem;
}
.smm-schedule-panel[hidden] {
  display: none !important;
}
.smm-schedule-presets, .smm-schedule-hours {
  display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: center;
}
.smm-qty-preset, .smm-recent-chip {
  border: 1px solid var(--smm-line);
  background: var(--smm-surface);
  color: var(--smm-ink);
  border-radius: 999px;
  padding: 0.28rem 0.65rem;
  font-size: 0.76rem;
  cursor: pointer;
}
.smm-qty-preset:hover, .smm-recent-chip:hover {
  border-color: var(--smm-accent);
  background: var(--smm-accent-soft);
  color: var(--smm-accent-deep);
}
.smm-qty-preset.is-active {
  border-color: var(--smm-accent);
  background: var(--smm-accent-soft);
  color: var(--smm-accent-deep);
  font-weight: 700;
}
.smm-qty-preset.is-out-of-range {
  opacity: 0.55;
}
.smm-schedule-custom {
  margin-top: 0.45rem;
  padding: 0.7rem 0.75rem;
  border-radius: 12px;
  border: 1px dashed var(--smm-line);
  background: var(--smm-surface-2, var(--smm-surface));
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.smm-schedule-custom__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.smm-schedule-custom__title {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--smm-ink);
}
.smm-schedule-custom__note {
  font-size: 0.7rem;
  color: var(--smm-muted);
  font-weight: 600;
}
.smm-schedule-custom-add {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}
.smm-schedule-custom-time {
  display: inline-flex; align-items: center; gap: 0.35rem;
  font-size: 0.74rem; color: var(--smm-muted); font-weight: 600;
}
.smm-schedule-custom-time__input {
  width: auto; min-width: 7rem; padding: 0.28rem 0.5rem; font-size: 0.78rem;
}
.smm-hour-chip {
  display: inline-flex;
  align-items: stretch;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--smm-line);
  background: var(--smm-surface);
}
.smm-hour-chip.is-active {
  border-color: var(--smm-accent);
  background: var(--smm-accent-soft);
}
.smm-hour-chip__pick {
  border: 0;
  background: transparent;
  color: inherit;
  border-radius: 0;
  padding: 0.28rem 0.55rem;
  font-size: 0.76rem;
  cursor: pointer;
  font-weight: 600;
}
.smm-hour-chip.is-active .smm-hour-chip__pick {
  color: var(--smm-accent-deep);
  font-weight: 800;
}
.smm-hour-chip__del {
  border: 0;
  border-left: 1px solid var(--smm-line-soft, var(--smm-line));
  background: transparent;
  color: var(--smm-muted);
  padding: 0 0.45rem;
  font-size: 0.85rem;
  line-height: 1;
  cursor: pointer;
}
.smm-hour-chip__del:hover {
  color: var(--smm-danger, #c0392b);
  background: rgba(192, 57, 43, 0.08);
}
.smm-qty-custom {
  margin-top: 0.5rem;
}
.smm-qty-custom__input {
  min-width: 6.5rem;
  width: 7.5rem;
}
.smm-hour-chip.is-out-of-range {
  opacity: 0.55;
}
.smm-hour-chip.is-out-of-range .smm-hour-chip__pick {
  text-decoration: line-through;
}
.smm-afford { margin: 0; font-size: 0.78rem; }
.smm-afford--ok { color: var(--smm-ok); }
.smm-afford--bad { color: var(--smm-danger); }
.smm-submit-btn {
  width: 100%;
  border: 0;
  border-radius: 12px;
  padding: 0.9rem 1rem;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: #fff;
  background: linear-gradient(180deg, #35936f 0%, var(--smm-accent) 100%);
  box-shadow: 0 8px 18px rgba(45, 122, 94, 0.28);
  cursor: pointer;
  margin-top: 0.15rem;
}
.smm-submit-btn:hover:not(:disabled) { background: linear-gradient(180deg, #2d7a5e 0%, var(--smm-accent-deep) 100%); }
.smm-submit-btn:disabled { opacity: 0.45; cursor: not-allowed; box-shadow: none; }
.smm-submit-btn--inline { flex: 1; }
.smm-submit-btn--sm { width: auto; padding: 0.65rem 1.1rem; font-size: 0.82rem; }
.smm-form-actions { display: flex; gap: 0.5rem; align-items: stretch; }

.smm-suggest {
  background: var(--smm-surface);
  border: 1px solid var(--smm-line);
  border-radius: var(--smm-radius);
  padding: 1rem 1.1rem;
  display: flex; flex-direction: column; gap: 0.65rem;
}
.smm-suggest__head { display: flex; align-items: baseline; justify-content: space-between; gap: 0.5rem; flex-wrap: wrap; }
.smm-suggest__title { margin: 0; font-size: 0.95rem; font-weight: 800; }
.smm-suggest__hint { font-size: 0.74rem; color: var(--smm-muted); }
.smm-suggest__list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0.5rem; }
.smm-suggest-card {
  padding: 0.75rem; border-radius: 12px; border: 1px solid var(--smm-line);
  background: var(--smm-surface-2); display: flex; flex-direction: column; gap: 0.4rem;
}
.smm-suggest-card__head { font-size: 0.82rem; }
.smm-suggest-card__meta { font-size: 0.74rem; color: var(--smm-muted); }
.smm-suggest-card__actions { display: flex; gap: 0.35rem; flex-wrap: wrap; }
.smm-ghost-btn--accent { border-color: var(--smm-accent-mid); color: var(--smm-accent-deep); background: var(--smm-accent-soft); }

.smm-queue {
  background: var(--smm-surface);
  border: 1px solid var(--smm-line);
  border-radius: var(--smm-radius);
  padding: 1rem 1.1rem;
  display: flex; flex-direction: column; gap: 0.65rem;
}
.smm-queue__head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.smm-queue__title { margin: 0; font-size: 0.95rem; font-weight: 800; }
.smm-queue__meta { font-size: 0.76rem; color: var(--smm-muted); font-weight: 700; }
.smm-queue__list { display: flex; flex-direction: column; gap: 0.5rem; }
.smm-queue__foot { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap; padding-top: 0.35rem; border-top: 1px dashed var(--smm-line); }
.smm-queue__total { display: flex; flex-direction: column; gap: 0.1rem; font-size: 0.78rem; color: var(--smm-muted); }
.smm-queue__total strong { font-size: 1rem; color: var(--smm-accent-deep); }
.smm-queue-item {
  padding: 0.75rem; border-radius: 12px; border: 1px solid var(--smm-line);
  background: var(--smm-surface); display: flex; flex-direction: column; gap: 0.35rem;
}
.smm-queue-item--due { border-color: var(--smm-accent); background: var(--smm-accent-soft); }
.smm-queue-item__head { display: flex; justify-content: space-between; align-items: start; gap: 0.5rem; font-size: 0.82rem; }
.smm-queue-item__remove {
  border: 0; background: transparent; color: var(--smm-muted); font-size: 1.1rem; line-height: 1; cursor: pointer; padding: 0 0.25rem;
}
.smm-queue-item__meta { font-size: 0.74rem; color: var(--smm-muted); }
.smm-queue-item__link { font-size: 0.74rem; color: var(--smm-accent-deep); word-break: break-all; }
.smm-queue-item__actions { display: flex; gap: 0.4rem; align-items: center; flex-wrap: wrap; }
.smm-queue-item__time { flex: 1; min-width: 160px; font-size: 0.78rem; padding: 0.4rem 0.55rem; }
.smm-queue-item__now { font-size: 0.74rem; }

.smm-details {
  padding: 1rem;
  border-radius: var(--smm-radius-sm);
  border: 1px solid var(--smm-line);
  background: var(--smm-surface);
  display: flex; flex-direction: column; gap: 0.7rem;
  min-height: 260px;
}
.smm-details__empty { font-size: 0.86rem; color: var(--smm-muted); text-align: center; padding: 2.2rem 0.5rem; }
.smm-details__head { display: flex; flex-direction: column; gap: 0.3rem; }
.smm-details__id {
  display: inline-flex; align-self: flex-start; font-size: 0.7rem; font-weight: 800;
  padding: 0.15rem 0.5rem; border-radius: 999px;
  background: var(--smm-accent-soft); color: var(--smm-accent-deep);
}
.smm-details__head h4 { margin: 0; font-size: 0.86rem; line-height: 1.45; font-weight: 650; color: var(--smm-ink); }
.smm-details__promo { margin: 0; font-size: 0.78rem; color: var(--smm-danger); font-weight: 650; }
.smm-avg { display: flex; flex-direction: column; gap: 0.3rem; }
.smm-avg__label { font-size: 0.76rem; font-weight: 700; color: var(--smm-muted); }
.smm-avg__box {
  padding: 0.55rem 0.75rem; border-radius: 10px; font-weight: 800; font-size: 0.9rem;
  border: 1px dashed var(--smm-line); background: var(--smm-surface-2); text-align: center;
}
.smm-avg__box--live { border-color: var(--smm-ok-box-border); color: var(--smm-ok); background: var(--smm-ok-box-bg); }
.smm-avg__box--est { border-color: var(--smm-warn-box-border); color: var(--smm-warn); background: var(--smm-warn-box-bg); }
.smm-avg__hint { margin: 0; font-size: 0.7rem; color: var(--smm-muted); line-height: 1.4; }
.smm-specs {
  display: flex; flex-direction: column; gap: 0.4rem; padding: 0.7rem;
  border-radius: 12px; border: 1px dashed var(--smm-line); background: var(--smm-surface-2);
}
.smm-spec { display: grid; grid-template-columns: 1.3rem 1fr auto; gap: 0.3rem; align-items: start; font-size: 0.78rem; }
.smm-spec__icon { text-align: center; }
.smm-spec__label { color: var(--smm-muted); }
.smm-spec__value { font-weight: 700; text-align: right; word-break: break-word; color: var(--smm-ink); }

.smm-browse {
  background: var(--smm-surface);
  border: 1px solid var(--smm-line);
  border-radius: var(--smm-radius);
  padding: 1rem 1.1rem;
  display: flex; flex-direction: column; gap: 0.75rem;
  box-shadow: 0 4px 16px var(--smm-shadow);
}
.smm-browse__head, .smm-history-section .smm-browse__head {
  display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap;
}
.smm-browse__title { margin: 0; font-size: 1rem; font-weight: 800; color: var(--smm-ink); }
.smm-browse__meta { font-size: 0.78rem; color: var(--smm-muted); }
.smm-browse__toolbar { display: flex; gap: 0.5rem; align-items: center; }
.smm-recent { display: flex; flex-direction: column; gap: 0.3rem; }
.smm-recent__label { font-size: 0.7rem; color: var(--smm-muted); text-transform: uppercase; letter-spacing: 0.05em; font-weight: 700; }
.smm-recent__list { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.smm-empty { padding: 1rem; text-align: center; color: var(--smm-muted); }
.smm-service-list { display: flex; flex-direction: column; gap: 0.55rem; max-height: 52vh; overflow: auto; padding-right: 0.1rem; }

.smm-cat-block {
  border: 1px solid var(--smm-line-soft);
  border-radius: 14px;
  overflow: hidden;
  background: var(--smm-surface-2);
}
.smm-cat-block__head {
  width: 100%; display: flex; align-items: center; gap: 0.5rem;
  padding: 0.7rem 0.85rem; border: 0;
  background: linear-gradient(90deg, var(--smm-accent-soft), transparent);
  color: var(--smm-ink); font: inherit; cursor: pointer; text-align: left;
  border-left: 3px solid var(--smm-accent);
}
.smm-cat-block__head:hover { background: var(--smm-cat-hover); }
.smm-cat-block__icon {
  width: 1.7rem; height: 1.7rem; border-radius: 8px; display: grid; place-items: center;
  background: var(--smm-surface); border: 1px solid var(--smm-line); font-size: 0.82rem;
}
.smm-cat-block__title { flex: 1; font-weight: 750; font-size: 0.88rem; }
.smm-cat-block__meta {
  font-size: 0.72rem; font-weight: 700; color: var(--smm-accent-deep);
  background: var(--smm-surface); border: 1px solid var(--smm-line); border-radius: 999px; padding: 0.1rem 0.45rem;
}
.smm-cat-block__chevron { color: var(--smm-muted); transition: transform 0.2s ease; }
.smm-cat-block.is-open .smm-cat-block__chevron { transform: rotate(180deg); }
.smm-cat-block__body { display: none; padding: 0.6rem; gap: 0.45rem; }
.smm-cat-block.is-open .smm-cat-block__body {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 0.45rem;
}
.smm-service-card {
  display: flex; flex-direction: column; gap: 0.22rem; text-align: left; width: 100%;
  padding: 0.7rem 0.75rem; border-radius: 12px;
  border: 1px solid var(--smm-line); background: var(--smm-surface);
  color: var(--smm-ink); cursor: pointer; font: inherit;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
.smm-service-card:hover {
  transform: translateY(-1px);
  border-color: var(--smm-accent-mid);
  box-shadow: 0 6px 14px var(--smm-shadow);
}
.smm-service-card.is-active {
  border-color: var(--smm-accent);
  background: var(--smm-accent-soft);
  box-shadow: 0 0 0 1px var(--smm-focus-ring) inset;
}
.smm-service-card__name { font-weight: 650; font-size: 0.82rem; line-height: 1.35; }
.smm-service-card__row {
  display: flex; justify-content: space-between; gap: 0.35rem; align-items: center;
  font-size: 0.7rem; color: var(--smm-muted);
}
.smm-service-card__price { font-size: 0.8rem; font-weight: 800; color: var(--smm-accent-deep); margin-top: 0.05rem; }
.smm-service-card__price small { font-weight: 600; opacity: 0.7; }
.smm-service-card__badge {
  font-size: 0.62rem; padding: 0.1rem 0.35rem; border-radius: 999px;
  background: var(--smm-ok-soft); color: var(--smm-ok); font-weight: 700;
}

.smm-history-section { display: flex; flex-direction: column; gap: 0.7rem; }
.smm-orders-list { display: grid; gap: 0.6rem; }
.smm-order-item {
  padding: 0.85rem 1rem; border-radius: 14px;
  border: 1px solid var(--smm-line); background: var(--smm-surface);
  display: flex; flex-direction: column; gap: 0.4rem;
}
.smm-order-item__head { display: flex; justify-content: space-between; gap: 0.5rem; align-items: center; flex-wrap: wrap; color: var(--smm-ink); }
.smm-order-item__link { font-size: 0.78rem; color: var(--smm-accent-deep); word-break: break-all; }
.smm-order-item__note { font-size: 0.75rem; color: var(--smm-accent-deep); font-weight: 600; }
.smm-order-item__meta { display: flex; justify-content: space-between; gap: 0.5rem; font-size: 0.76rem; color: var(--smm-muted); flex-wrap: wrap; }
.smm-order-item__foot { display: flex; justify-content: space-between; gap: 0.5rem; align-items: center; font-size: 0.74rem; color: var(--smm-muted); flex-wrap: wrap; }
.smm-progress { height: 6px; border-radius: 999px; background: var(--smm-line-soft); overflow: hidden; }
.smm-progress__bar { height: 100%; border-radius: inherit; background: linear-gradient(90deg, #4aa882, var(--smm-accent)); transition: width 0.35s ease; }
.smm-status { display: inline-block; padding: 0.15rem 0.45rem; border-radius: 999px; font-size: 0.7rem; font-weight: 700; }
.smm-status--ok { background: var(--smm-ok-soft); color: var(--smm-ok); }
.smm-status--run { background: var(--smm-accent-soft); color: var(--smm-accent-deep); }
.smm-status--warn { background: var(--smm-warn-soft); color: var(--smm-warn); }
.smm-status--bad { background: var(--smm-bad-soft); color: var(--smm-danger); }
.smm-status--pending { background: var(--smm-pending-bg); color: var(--smm-pending-ink); }

body.smm-modal-open { overflow: hidden; }
.smm-modal-backdrop[hidden] { display: none !important; }
.smm-modal-backdrop:not([hidden]) {
  position: fixed; inset: 0; z-index: 1200; background: rgba(2, 8, 18, 0.62);
  backdrop-filter: blur(6px); display: grid; place-items: center; padding: 1rem;
  animation: smmFadeIn 0.2s ease;
}
@keyframes smmFadeIn { from { opacity: 0; } to { opacity: 1; } }
.smm-modal {
  width: min(460px, 100%); padding: 1.25rem 1.25rem 1rem;
  display: flex; flex-direction: column; gap: 0.65rem; position: relative;
  /* Opaque dark by default so fade-in never reveals a white surface */
  background: rgba(15, 23, 42, 0.96);
  color: var(--smm-ink);
  border: 1px solid var(--smm-line); border-radius: var(--smm-radius);
  box-shadow: 0 24px 60px var(--smm-shadow-lg);
  animation: smmSlideUp 0.25s ease;
  transition: none;
}
html[data-theme="light"] .smm-modal {
  background: var(--smm-surface);
}
@keyframes smmSlideUp { from { transform: translateY(12px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.smm-modal-close {
  position: absolute; top: 0.55rem; right: 0.65rem; width: 2rem; height: 2rem; border: 0; border-radius: 999px;
  background: var(--smm-surface-2); color: var(--smm-muted); font-size: 1.25rem; line-height: 1; cursor: pointer;
}
.smm-modal-icon {
  font-size: 1.5rem; width: 2.5rem; height: 2.5rem; border-radius: 12px; display: grid; place-items: center;
  background: var(--smm-accent-soft);
}
.smm-modal-lead { margin: 0; font-size: 0.86rem; color: var(--smm-muted); }
.smm-confirm-dl {
  margin: 0; display: grid; gap: 0.5rem; font-size: 0.86rem; padding: 0.7rem;
  border-radius: 12px; background: var(--smm-surface-2); border: 1px solid var(--smm-line-soft);
}
.smm-confirm-dl div { display: grid; grid-template-columns: 100px 1fr; gap: 0.5rem; align-items: start; }
.smm-confirm-dl dt { color: var(--smm-muted); font-size: 0.76rem; }
.smm-confirm-dl dd { margin: 0; word-break: break-word; font-weight: 700; }
.smm-modal-actions { display: flex; justify-content: flex-end; gap: 0.5rem; margin-top: 0.25rem; }
.smm-modal--custom {
  width: min(420px, 100%);
  gap: 0.75rem;
}
.smm-modal--custom .smm-schedule-custom__head {
  padding-right: 2rem;
}
.smm-modal--custom .smm-schedule-hours {
  min-height: 2rem;
}
.smm-modal--custom .smm-schedule-custom__input {
  flex: 1;
  min-width: 8rem;
}

@media (max-width: 960px) {
  .smm-order-body { grid-template-columns: 1fr; }
  .smm-cascade__row { grid-template-columns: 1fr; }
  .smm-service-list { max-height: none; }
}

@media (max-width: 640px) {
  .brand-check-channel-card {
    grid-template-columns: 56px 1fr;
  }
  .brand-check-channel-thumb {
    width: 56px;
    height: 56px;
  }
}

/* ---- Title Score tool ---- */
.tools-hero-chip--title.is-active {
  border-color: rgba(56, 189, 248, 0.35);
  background: rgba(56, 189, 248, 0.1);
  color: rgba(186, 230, 253, 0.95);
}
.title-score-toolbar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 14px;
  padding: 16px;
  margin-bottom: 14px;
}
.title-score-field--full,
.title-score-advanced,
.title-score-toolbar .kw-analysis-toolbar-actions {
  grid-column: 1 / -1;
}
.title-score-textarea {
  min-height: 64px;
  resize: vertical;
  line-height: 1.45;
}
.title-score-advanced {
  border-top: 1px solid rgba(148, 163, 184, 0.18);
  padding-top: 8px;
}
.title-score-advanced summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: rgba(186, 230, 253, 0.9);
  margin-bottom: 10px;
}
.title-score-results { display: grid; gap: 14px; }
.title-score-hero {
  display: flex;
  gap: 16px;
  align-items: center;
  padding: 16px 18px;
}
.title-score-ring {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.08), transparent 55%),
    rgba(15, 23, 42, 0.55);
  border: 2px solid rgba(148, 163, 184, 0.35);
}
.title-score-hero--high .title-score-ring { border-color: rgba(52, 211, 153, 0.55); color: #6ee7b7; }
.title-score-hero--mid .title-score-ring { border-color: rgba(251, 191, 36, 0.55); color: #fcd34d; }
.title-score-hero--low .title-score-ring { border-color: rgba(248, 113, 113, 0.55); color: #fca5a5; }
.title-score-ring span { font-size: 28px; font-weight: 750; line-height: 1; }
.title-score-ring small { font-size: 12px; opacity: 0.75; }
.title-score-original { margin: 0 0 6px; line-height: 1.45; }
.title-score-meta { margin: 0; font-size: 12px; opacity: 0.75; }
.title-score-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.title-score-card,
.title-score-best {
  padding: 14px 16px;
}
.title-score-card h3,
.title-score-best h3 {
  margin: 0 0 10px;
  font-size: 15px;
}
.title-score-card p { margin: 0 0 8px; font-size: 13px; line-height: 1.45; }
.title-score-card .is-warn { color: #fca5a5; }
.title-score-card .is-mid { color: #fcd34d; }
.title-score-card .is-ok { color: #86efac; }
.title-score-crits { display: grid; gap: 10px; }
.title-score-crit-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  margin-bottom: 4px;
}
.title-score-crit-bar {
  height: 6px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.18);
  overflow: hidden;
}
.title-score-crit-bar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #38bdf8, #34d399);
}
.title-score-crit-note {
  margin: 4px 0 0;
  font-size: 12px;
  opacity: 0.8;
  line-height: 1.4;
}
.title-score-list {
  margin: 0;
  padding-left: 18px;
  font-size: 13px;
  line-height: 1.45;
}
.title-score-empty { margin: 0; opacity: 0.65; font-size: 13px; }
.title-score-alts {
  display: grid;
  gap: 10px;
}
.title-score-alts article {
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.35);
  border: 1px solid rgba(148, 163, 184, 0.14);
}
.title-score-alts span {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.7;
  margin-bottom: 4px;
}
.title-score-alts p { margin: 0; font-size: 14px; line-height: 1.4; }
.title-score-best-text {
  margin: 0 0 8px;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.4;
  color: #7dd3fc;
}
.title-score-best-reason {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  opacity: 0.85;
}
@media (max-width: 860px) {
  .title-score-toolbar,
  .title-score-grid { grid-template-columns: 1fr; }
  .title-score-hero { flex-direction: column; align-items: flex-start; }
}

/* Title Score — light mode contrast */
html[data-theme="light"] .tools-hero-chip--title.is-active {
  border-color: rgba(14, 116, 144, 0.28);
  background: rgba(14, 116, 144, 0.08);
  color: rgba(14, 116, 144, 0.95);
}
html[data-theme="light"] .title-score-advanced {
  border-top-color: rgba(139, 191, 149, 0.45);
}
html[data-theme="light"] .title-score-advanced summary {
  color: #0e7490;
}
html[data-theme="light"] .title-score-ring {
  background:
    radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.85), transparent 55%),
    rgba(232, 245, 233, 0.95);
  border-color: rgba(139, 191, 149, 0.55);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}
html[data-theme="light"] .title-score-hero--high .title-score-ring {
  border-color: rgba(21, 128, 61, 0.45);
  color: #15803d;
  background:
    radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.9), transparent 55%),
    rgba(220, 252, 231, 0.95);
}
html[data-theme="light"] .title-score-hero--mid .title-score-ring {
  border-color: rgba(180, 83, 9, 0.45);
  color: #b45309;
  background:
    radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.9), transparent 55%),
    rgba(254, 243, 199, 0.95);
}
html[data-theme="light"] .title-score-hero--low .title-score-ring {
  border-color: rgba(185, 28, 28, 0.45);
  color: #b91c1c;
  background:
    radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.9), transparent 55%),
    rgba(254, 226, 226, 0.95);
}
html[data-theme="light"] .title-score-original,
html[data-theme="light"] .title-score-card p,
html[data-theme="light"] .title-score-list,
html[data-theme="light"] .title-score-crit-head,
html[data-theme="light"] .title-score-best-reason {
  color: var(--text);
}
html[data-theme="light"] .title-score-meta,
html[data-theme="light"] .title-score-crit-note,
html[data-theme="light"] .title-score-empty {
  color: var(--text-secondary);
  opacity: 1;
}
html[data-theme="light"] .title-score-card h3,
html[data-theme="light"] .title-score-best h3 {
  color: var(--text);
}
html[data-theme="light"] .title-score-card .is-warn { color: #b91c1c; }
html[data-theme="light"] .title-score-card .is-mid { color: #b45309; }
html[data-theme="light"] .title-score-card .is-ok { color: #15803d; }
html[data-theme="light"] .title-score-crit-bar {
  background: rgba(139, 191, 149, 0.28);
}
html[data-theme="light"] .title-score-crit-bar span {
  background: linear-gradient(90deg, #0e7490, #15803d);
}
html[data-theme="light"] .title-score-alts article {
  background: rgba(255, 255, 255, 0.72);
  border-color: rgba(139, 191, 149, 0.42);
  box-shadow: 0 1px 3px rgba(40, 80, 50, 0.05);
}
html[data-theme="light"] .title-score-alts span {
  color: #0e7490;
  opacity: 1;
}
html[data-theme="light"] .title-score-alts p {
  color: var(--text);
}
html[data-theme="light"] .title-score-best-text {
  color: #0e7490;
}

/* ── AI Chat tool ─────────────────────────────────────────── */
.tools-hero-chip--chat {
  --chip-accent: #2f6b4f;
}
.ai-chat-section .trending-section-head {
  margin-bottom: 0.7rem;
}
.ai-chat-section .trending-section-head h2 {
  font-size: clamp(1.15rem, 1.8vw, 1.35rem);
  letter-spacing: -0.02em;
}
.ai-chat-section .trending-section-lead {
  font-size: 0.82rem;
  line-height: 1.45;
  max-width: 40rem;
  opacity: 0.82;
}
.ai-chat-shell {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 0.85rem 0.95rem 0.95rem;
  min-height: min(68vh, 640px);
  font-size: 0.86rem;
}
.ai-chat-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
  flex-wrap: wrap;
}
.ai-chat-toolbar__left,
.ai-chat-toolbar__right {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}
.ai-chat-toolbar__link {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: rgba(167, 214, 180, 0.92);
  text-decoration: none;
}
.ai-chat-toolbar__link:hover { text-decoration: underline; }
.ai-chat-toolbar .btn-sm {
  font-size: 0.72rem;
  padding: 0.28rem 0.6rem;
}
.ai-chat-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.16rem 0.45rem;
  border-radius: 999px;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #d7efe2;
  background: rgba(47, 107, 79, 0.28);
  border: 1px solid rgba(167, 214, 180, 0.28);
}
.ai-chat-quota {
  font-size: 0.72rem;
  color: rgba(232, 245, 236, 0.68);
}
.ai-chat-modes {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.18rem;
  border-radius: 999px;
  background: rgba(8, 18, 14, 0.35);
  border: 1px solid rgba(167, 214, 180, 0.16);
  width: fit-content;
}
.ai-chat-mode {
  border: 0;
  background: transparent;
  color: rgba(232, 245, 236, 0.72);
  font: inherit;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  padding: 0.28rem 0.7rem;
  border-radius: 999px;
  cursor: pointer;
}
.ai-chat-mode.is-active,
.ai-chat-mode[aria-pressed="true"] {
  background: rgba(47, 107, 79, 0.42);
  color: #e8f5ec;
}
.ai-chat-context {
  margin: 0;
  font-size: 0.7rem;
  color: rgba(232, 245, 236, 0.58);
}
.ai-chat-composer__input {
  width: 100%;
  border-radius: 10px;
  border: 1px solid rgba(167, 214, 180, 0.22);
  background: rgba(8, 18, 14, 0.45);
  color: #e8f5ec;
  padding: 0.55rem 0.7rem;
  font: inherit;
  font-size: 0.84rem;
  line-height: 1.4;
  resize: vertical;
}
.ai-chat-composer__input:focus {
  outline: none;
  border-color: rgba(167, 214, 180, 0.55);
  box-shadow: 0 0 0 3px rgba(47, 107, 79, 0.18);
}
.ai-chat-empty {
  flex: 1;
  display: grid;
  place-content: center;
  gap: 0.7rem;
  text-align: center;
  color: rgba(232, 245, 236, 0.68);
  padding: 1.1rem 0.4rem;
}
.ai-chat-empty p {
  margin: 0;
  max-width: 32rem;
  font-size: 0.84rem;
  line-height: 1.45;
}
.ai-chat-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  justify-content: center;
}
.ai-chat-suggest {
  border: 1px solid rgba(167, 214, 180, 0.22);
  background: rgba(47, 107, 79, 0.12);
  color: #e8f5ec;
  border-radius: 999px;
  padding: 0.32rem 0.65rem;
  font-size: 0.72rem;
  line-height: 1.3;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.ai-chat-suggest:hover {
  background: rgba(47, 107, 79, 0.24);
  border-color: rgba(167, 214, 180, 0.4);
}
.ai-chat-messages {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  overflow: auto;
  max-height: min(52vh, 520px);
  padding-right: 0.15rem;
}
.ai-chat-msg { display: grid; gap: 0.18rem; max-width: min(92%, 620px); }
.ai-chat-msg--user { margin-left: auto; text-align: right; }
.ai-chat-msg--assistant { margin-right: auto; }
.ai-chat-msg__meta {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: rgba(232, 245, 236, 0.5);
}
.ai-chat-msg__bubble {
  padding: 0.55rem 0.72rem;
  border-radius: 11px;
  font-size: 0.84rem;
  line-height: 1.42;
  white-space: normal;
  word-break: break-word;
}
.ai-chat-msg__bubble strong {
  font-weight: 650;
}
.ai-chat-msg--user .ai-chat-msg__bubble {
  background: linear-gradient(180deg, rgba(74, 140, 98, 0.5), rgba(47, 107, 79, 0.38));
  border: 1px solid rgba(167, 214, 180, 0.24);
}
.ai-chat-msg--assistant .ai-chat-msg__bubble {
  background: rgba(12, 28, 20, 0.5);
  border: 1px solid rgba(167, 214, 180, 0.14);
}
.ai-chat-thinking {
  font-size: 0.74rem;
  color: rgba(232, 245, 236, 0.65);
}
.ai-chat-error-hint {
  font-size: 0.74rem;
  color: rgba(232, 245, 236, 0.65);
}
.ai-chat-error-hint a { color: #a7d6b4; }
.ai-chat-composer {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.45rem;
  align-items: end;
}
.ai-chat-composer__input { min-height: 52px; max-height: 140px; }
.ai-chat-composer .btn-sm {
  font-size: 0.78rem;
  padding: 0.45rem 0.85rem;
}
html[data-theme="light"] .ai-chat-badge {
  color: #163024;
  background: rgba(176, 212, 184, 0.35);
  border-color: rgba(40, 80, 50, 0.22);
}
html[data-theme="light"] .ai-chat-quota,
html[data-theme="light"] .ai-chat-empty,
html[data-theme="light"] .ai-chat-thinking,
html[data-theme="light"] .ai-chat-error-hint,
html[data-theme="light"] .ai-chat-msg__meta,
html[data-theme="light"] .ai-chat-context { color: rgba(22, 48, 36, 0.7); }
html[data-theme="light"] .ai-chat-modes {
  background: rgba(255, 255, 255, 0.7);
  border-color: rgba(40, 80, 50, 0.14);
}
html[data-theme="light"] .ai-chat-mode { color: rgba(22, 48, 36, 0.7); }
html[data-theme="light"] .ai-chat-mode.is-active,
html[data-theme="light"] .ai-chat-mode[aria-pressed="true"] {
  background: rgba(176, 212, 184, 0.55);
  color: #163024;
}
html[data-theme="light"] .ai-chat-toolbar__link { color: #2f6b4f; }
html[data-theme="light"] .ai-chat-composer__input {
  background: rgba(255, 255, 255, 0.82);
  color: #163024;
  border-color: rgba(40, 80, 50, 0.18);
}
html[data-theme="light"] .ai-chat-msg--user .ai-chat-msg__bubble {
  background: rgba(176, 212, 184, 0.5);
  color: #163024;
}
html[data-theme="light"] .ai-chat-msg--assistant .ai-chat-msg__bubble {
  background: rgba(255, 255, 255, 0.86);
  color: #163024;
  border-color: rgba(40, 80, 50, 0.12);
}
html[data-theme="light"] .ai-chat-suggest {
  color: #163024;
  background: rgba(176, 212, 184, 0.24);
  border-color: rgba(40, 80, 50, 0.16);
}
@media (max-width: 720px) {
  .ai-chat-composer { grid-template-columns: 1fr; }
}
