.wkse {
  --wkse-bg: #070707;
  --wkse-surface: rgba(12, 12, 12, 0.64);
  --wkse-surface-soft: rgba(255, 255, 255, 0.04);
  --wkse-border: rgba(255, 255, 255, 0.12);
  --wkse-border-soft: rgba(255, 255, 255, 0.08);
  --wkse-text: #d7d8dc;
  --wkse-text-muted: #9aa0a8;
  --wkse-text-soft: #b8bcc4;
  --wkse-accent: #ff9f1a;
  --wkse-accent-secondary: #38bdf8;
  --wkse-accent-bg: rgba(255, 159, 26, 0.12);
  --wkse-accent-bg-hover: rgba(255, 159, 26, 0.2);
  --wkse-danger: #f87171;
  --wkse-success: #4ade80;
  --wkse-warning: #facc15;
  background:
    radial-gradient(1200px 640px at 10% 0%, rgba(255, 159, 26, 0.14), transparent 56%),
    radial-gradient(900px 520px at 90% 15%, rgba(56, 189, 248, 0.14), transparent 58%),
    var(--wkse-bg);
  color: var(--wkse-text);
  min-height: 100vh;
  padding: 28px 0 84px;
}

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

.wkse-container {
  width: min(94vw, 1220px);
  margin: 0 auto;
  padding: 0 20px;
}

.wkse-header {
  text-align: center;
  margin-bottom: 28px;
}

.wkse-header h1 {
  margin: 18px 0 10px;
  font-size: 2.22em;
  color: var(--wkse-accent);
  font-weight: 760;
  letter-spacing: -0.01em;
}

.wkse-subtitle {
  margin: 0 0 10px;
  color: var(--wkse-text-soft);
  font-size: 1.14em;
  font-weight: 620;
}

.wkse-description {
  margin: 0 auto 26px;
  max-width: 760px;
  color: var(--wkse-text-muted);
  line-height: 1.62;
}

.wkse-form {
  max-width: 980px;
  margin: 0 auto;
}

.wkse-input-row {
  display: grid;
  grid-template-columns: minmax(260px, 2fr) minmax(130px, 1fr) minmax(130px, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.wkse-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.wkse-field-grow {
  min-width: 0;
}

.wkse-field label {
  font-size: 0.84em;
  color: var(--wkse-text-soft);
  text-align: left;
  font-weight: 620;
}

.wkse-field input,
.wkse-field select {
  width: 100%;
  height: 46px;
  border-radius: 12px;
  border: 1px solid var(--wkse-border);
  background: rgba(255, 255, 255, 0.05);
  color: #eef0f4;
  padding: 0 14px;
  font-size: 0.98rem;
  outline: none;
}

.wkse-field select,
#wkse-sort {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, #d7d8dc 50%),
    linear-gradient(135deg, #d7d8dc 50%, transparent 50%);
  background-position:
    calc(100% - 18px) calc(50% + 1px),
    calc(100% - 12px) calc(50% + 1px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 34px;
  color: #eef0f4 !important;
  background-color: rgba(22, 24, 30, 0.94) !important;
}

.wkse-field select option,
#wkse-sort option {
  color: #eef0f4 !important;
  background: #101216 !important;
}

.wkse-field select:focus,
#wkse-sort:focus {
  color: #ffffff !important;
  background-color: rgba(22, 24, 30, 0.98) !important;
}

.wkse-field input:focus,
.wkse-field select:focus {
  border-color: var(--wkse-accent);
  box-shadow: 0 0 0 2px rgba(255, 159, 26, 0.18);
}

.wkse-field input::placeholder {
  color: #7d8591;
}

#wkse-submit {
  height: 46px;
  border-radius: 12px;
  border: 1px solid var(--wkse-accent);
  background: var(--wkse-accent-bg);
  color: var(--wkse-accent);
  padding: 0 20px;
  font-weight: 720;
  font-size: 0.98rem;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease, border-color 0.2s ease;
}

#wkse-submit:hover {
  background: var(--wkse-accent-bg-hover);
  transform: translateY(-1px);
}

#wkse-submit:disabled {
  opacity: 0.56;
  cursor: not-allowed;
  transform: none;
}

.wkse-spinner,
.wkse-spinner-lg {
  display: inline-block;
  border-radius: 50%;
  animation: wkse-spin 0.7s linear infinite;
}

.wkse-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.24);
  border-top-color: var(--wkse-accent);
  vertical-align: middle;
}

.wkse-spinner-lg {
  width: 44px;
  height: 44px;
  border: 3px solid rgba(255, 255, 255, 0.18);
  border-top-color: var(--wkse-accent);
  margin-bottom: 14px;
}

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

.wkse-error {
  margin-top: 12px;
  color: var(--wkse-danger);
  font-size: 0.92em;
}

.wkse-help,
.wkse-loading,
.wkse-section {
  background: var(--wkse-surface);
  border: 1px solid var(--wkse-border-soft);
  border-radius: 18px;
  backdrop-filter: blur(10px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
}

.wkse-help {
  padding: 14px 20px;
  margin-bottom: 18px;
}

.wkse-help summary {
  cursor: pointer;
  color: var(--wkse-accent-secondary);
  font-weight: 700;
  user-select: none;
  list-style: none;
}

.wkse-help summary::-webkit-details-marker {
  display: none;
}

.wkse-help summary::after {
  content: " +";
  color: var(--wkse-text-soft);
  font-weight: 600;
}

.wkse-help[open] summary::after {
  content: " -";
}

.wkse-help ul {
  margin: 12px 0 4px 18px;
  color: var(--wkse-text-muted);
  line-height: 1.58;
}

.wkse-loading {
  margin: 22px 0 24px;
  padding: 30px 24px;
  text-align: center;
}

.wkse-loading p {
  margin: 4px 0;
}

.wkse-progress-text {
  color: var(--wkse-text-muted);
  font-size: 0.92em;
}

.wkse-section {
  padding: 26px 24px;
  margin-bottom: 20px;
}

.wkse-section h2 {
  margin: 0 0 10px;
  color: var(--wkse-accent);
  font-size: 1.34em;
}

.wkse-section-desc {
  margin: 0 0 14px;
  color: var(--wkse-text-muted);
  font-size: 0.95em;
}

.wkse-source-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  color: var(--wkse-text-soft);
  font-size: 0.94em;
}

.wkse-page-overview {
  display: grid;
  grid-template-columns: minmax(140px, 220px) 1fr;
  gap: 16px;
  margin-bottom: 16px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--wkse-border-soft);
  background: rgba(255, 255, 255, 0.03);
}

.wkse-page-image-wrap {
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--wkse-border-soft);
  background: rgba(255, 255, 255, 0.02);
  min-height: 120px;
}

.wkse-page-image-wrap img {
  width: 100%;
  height: 100%;
  max-height: 200px;
  object-fit: cover;
  display: block;
}

.wkse-page-overview-content h3 {
  margin: 0 0 6px;
  color: #f2f4f8;
  font-size: 1.15em;
}

.wkse-page-kicker {
  margin: 0 0 8px;
  color: var(--wkse-accent-secondary);
  font-size: 0.8em;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 650;
}

.wkse-page-description {
  margin: 0 0 8px;
  color: #cfd4dd;
  font-size: 0.92em;
  font-weight: 620;
}

.wkse-page-summary {
  margin: 0 0 10px;
  color: var(--wkse-text-muted);
  line-height: 1.58;
  font-size: 0.95em;
}

.wkse-page-title-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.wkse-page-metrics {
  margin: 0 0 10px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.wkse-page-metrics-label {
  color: var(--wkse-text-soft);
  font-size: 0.9em;
}

.wkse-source-trend-btn {
  border: 1px solid rgba(56, 189, 248, 0.45);
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.14);
  color: #9be4ff;
  padding: 4px 12px;
  font-size: 0.88em;
  font-weight: 640;
  cursor: pointer;
  transition: transform 0.14s ease, background 0.2s ease, filter 0.2s ease;
}

.wkse-source-trend-btn:hover {
  transform: translateY(-1px);
  background: rgba(56, 189, 248, 0.2);
  filter: brightness(1.06);
}

.wkse-source-trend-btn:disabled {
  cursor: default;
  opacity: 0.6;
  transform: none;
}

.wkse-link {
  color: var(--wkse-accent-secondary);
  text-decoration: none;
}

.wkse-link:hover {
  text-decoration: underline;
}

.wkse-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 14px;
}

.wkse-card {
  background: var(--wkse-surface-soft);
  border: 1px solid var(--wkse-border-soft);
  border-radius: 14px;
  padding: 18px 14px;
  text-align: center;
  transition: transform 0.16s ease, border-color 0.2s ease;
}

.wkse-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.18);
}

.wkse-card-value {
  display: block;
  margin-bottom: 6px;
  color: var(--wkse-accent);
  font-size: 1.76em;
  font-weight: 760;
}

.wkse-card-label {
  display: block;
  color: var(--wkse-text-soft);
  font-size: 0.84em;
  font-weight: 620;
}

.wkse-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 2fr) minmax(180px, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.wkse-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--wkse-text-soft);
  font-size: 0.92em;
  white-space: nowrap;
  align-self: center;
  min-height: 44px;
}

.wkse-toggle input {
  width: 18px;
  height: 18px;
  accent-color: var(--wkse-accent);
}

.wkse-actions {
  margin-top: 14px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.wkse-btn {
  padding: 10px 18px;
  border-radius: 10px;
  border: 1px solid var(--wkse-border);
  background: rgba(255, 255, 255, 0.05);
  color: var(--wkse-text-soft);
  font-weight: 620;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease;
}

.wkse-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #f2f3f5;
  transform: translateY(-1px);
}

.wkse-btn:disabled {
  opacity: 0.58;
  cursor: not-allowed;
  transform: none;
}

.wkse-btn-primary {
  border-color: var(--wkse-accent);
  color: var(--wkse-accent);
  background: var(--wkse-accent-bg);
}

.wkse-btn-primary:hover {
  background: var(--wkse-accent-bg-hover);
}

.wkse-displayed-count {
  color: var(--wkse-text-muted);
  font-size: 0.9em;
  margin-left: auto;
}

.wkse-table-wrap {
  overflow: auto;
  max-height: 620px;
  border-radius: 12px;
  border: 1px solid var(--wkse-border-soft);
}

.wkse .wkse-table,
.wkse .wkse-table thead,
.wkse .wkse-table tbody,
.wkse .wkse-table tr {
  background: transparent !important;
}

.wkse .wkse-table {
  width: 100% !important;
  border-collapse: collapse !important;
  border: none !important;
  font-size: 0.92em;
}

.wkse .wkse-table th,
.wkse .wkse-table td {
  padding: 10px 12px !important;
  text-align: left !important;
  border: none !important;
  border-bottom: 1px solid var(--wkse-border-soft) !important;
  color: #e1e3e8 !important;
  background: transparent !important;
  vertical-align: middle;
}

.wkse .wkse-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: rgba(11, 11, 11, 0.96) !important;
  color: var(--wkse-accent) !important;
  font-size: 0.8em;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.wkse .wkse-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.04) !important;
}

.wkse-muted {
  color: var(--wkse-text-muted) !important;
}

.wkse-keyword {
  color: #e8eaf0;
  font-weight: 600;
}

.wkse-anchor {
  color: var(--wkse-text-muted);
  font-size: 0.92em;
}

.wkse-views {
  color: var(--wkse-accent);
  font-weight: 700;
}

.wkse-yoy {
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 4px 10px;
  font-weight: 670;
  background: rgba(255, 255, 255, 0.08);
  color: var(--wkse-text-soft);
  cursor: pointer;
  transition: transform 0.14s ease, filter 0.2s ease;
}

.wkse-yoy:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
}

.wkse-yoy:disabled {
  cursor: default;
  opacity: 0.62;
  transform: none;
}

.wkse-yoy-positive {
  color: var(--wkse-success);
  background: rgba(74, 222, 128, 0.14);
  border-color: rgba(74, 222, 128, 0.26);
}

.wkse-yoy-negative {
  color: var(--wkse-danger);
  background: rgba(248, 113, 113, 0.14);
  border-color: rgba(248, 113, 113, 0.26);
}

.wkse-yoy-neutral {
  color: var(--wkse-warning);
  background: rgba(250, 204, 21, 0.12);
  border-color: rgba(250, 204, 21, 0.24);
}

.wkse-empty-row td {
  text-align: center !important;
  color: var(--wkse-text-muted) !important;
  padding: 28px 12px !important;
}

.wkse-load-more {
  margin-top: 16px;
  padding: 14px;
  border: 1px dashed var(--wkse-border);
  border-radius: 12px;
  text-align: center;
  background: rgba(255, 255, 255, 0.03);
}

.wkse-load-more-progress {
  margin: 10px 0 0;
  color: var(--wkse-text-muted);
  font-size: 0.9em;
}

.wkse-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
  z-index: 10000;
  padding: 22px;
  align-items: center;
  justify-content: center;
}

.wkse-modal-content {
  width: min(1000px, 96vw);
  margin: 0;
  max-height: min(92vh, 860px);
  overflow: auto;
  background: #101113;
  border: 1px solid var(--wkse-border-soft);
  border-radius: 16px;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.45);
  padding: 22px;
}

.wkse-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--wkse-border-soft);
  margin-bottom: 14px;
  padding-bottom: 12px;
}

.wkse-modal-head h2 {
  margin: 0;
  color: var(--wkse-accent);
  font-size: 1.26em;
}

.wkse-modal-close {
  border: 1px solid var(--wkse-border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--wkse-text-soft);
  width: 36px;
  height: 36px;
  cursor: pointer;
  font-size: 1.05rem;
  line-height: 1;
}

.wkse-modal-close:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.12);
}

.wkse-chart-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.wkse-chart-stat {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--wkse-border-soft);
  border-radius: 12px;
  padding: 12px 10px;
  text-align: center;
}

.wkse-chart-stat-label {
  display: block;
  color: var(--wkse-text-muted);
  font-size: 0.82em;
  margin-bottom: 4px;
}

.wkse-chart-stat-value {
  color: #f2f4f8;
  font-size: 1.3em;
  font-weight: 740;
}

.wkse-chart-wrap {
  position: relative;
  height: 420px;
}

@media (max-width: 960px) {
  .wkse-input-row {
    grid-template-columns: 1fr 1fr;
  }

  #wkse-submit {
    grid-column: 1 / -1;
  }

  .wkse-toolbar {
    grid-template-columns: 1fr 1fr;
  }

  .wkse-toggle {
    grid-column: 1 / -1;
    min-height: auto;
  }
}

@media (max-width: 640px) {
  .wkse {
    padding: 18px 0 66px;
  }

  .wkse-container {
    padding: 0 14px;
  }

  .wkse-header h1 {
    font-size: 1.62em;
  }

  .wkse-subtitle {
    font-size: 1.02em;
  }

  .wkse-input-row,
  .wkse-toolbar {
    grid-template-columns: 1fr;
  }

  #wkse-submit {
    grid-column: auto;
    width: 100%;
  }

  .wkse-section {
    padding: 20px 14px;
  }

  .wkse-summary-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .wkse-page-overview {
    grid-template-columns: 1fr;
  }

  .wkse-page-image-wrap img {
    max-height: 220px;
  }

  .wkse-actions {
    gap: 8px;
  }

  .wkse-displayed-count {
    margin-left: 0;
    width: 100%;
  }

  .wkse-chart-wrap {
    height: 320px;
  }

  .wkse-modal {
    padding: 10px;
  }

  .wkse-modal-content {
    padding: 16px;
  }

  .wkse .wkse-table {
    font-size: 0.82em;
  }

  .wkse .wkse-table th,
  .wkse .wkse-table td {
    padding: 8px 8px !important;
  }
}
