.keyword-main {
  max-width: 1080px !important;
}

.keyword-shell [hidden] {
  display: none !important;
}

.keyword-search-card {
  margin-bottom: 28px;
}

.keyword-search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: end;
}

.keyword-search-row .field {
  min-width: 0;
}

.keyword-search-row button {
  min-height: 48px;
  padding-inline: 24px;
}

.keyword-secondary-actions {
  margin-top: 12px;
  align-items: center;
}

.keyword-results {
  display: grid;
  gap: 20px;
}

.keyword-result-heading,
.keyword-panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.keyword-result-heading {
  padding: 8px 2px;
}

.keyword-result-heading h2 {
  margin: 4px 0 0;
  font-size: clamp(1.55rem, 4vw, 2.15rem);
  color: #101a2d;
  letter-spacing: -.035em;
  word-break: break-word;
}

.provider-status {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}

.provider-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border: 1px solid #dfe5ef;
  border-radius: 999px;
  background: #fff;
  color: #647188;
  font-size: .76rem;
  font-weight: 800;
}

.provider-badge::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #a6afbd;
}

.provider-badge.ok::before {
  background: #18a567;
}

.provider-badge.error::before {
  background: #d56c56;
}

.keyword-summary-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.keyword-summary-grid article,
.keyword-panel {
  border: 1px solid #e4e9f2;
  background: rgba(255, 255, 255, .985);
  box-shadow: 0 18px 48px rgba(20, 37, 68, .07);
}

.keyword-summary-grid article {
  min-height: 128px;
  padding: 20px;
  border-radius: 18px;
}

.keyword-summary-grid span {
  display: block;
  margin-bottom: 12px;
  color: #738096;
  font-size: .82rem;
  font-weight: 800;
}

.keyword-summary-grid strong {
  display: inline-block;
  color: #111b2e;
  font-size: clamp(1.6rem, 4vw, 2.15rem);
  letter-spacing: -.04em;
}

.keyword-summary-grid small {
  margin-left: 4px;
  color: #8d97a9;
}

.volume-card {
  background:
    radial-gradient(circle at 0 0, rgba(63, 115, 255, .12), transparent 58%),
    #fff !important;
}

.volume-card small {
  display: block;
  margin: 8px 0 0 !important;
  line-height: 1.35;
}

.score-card {
  background:
    radial-gradient(circle at 100% 0, rgba(63, 115, 255, .12), transparent 55%),
    #fff !important;
}

.keyword-panel {
  padding: clamp(19px, 4vw, 28px);
  border-radius: 20px;
  overflow: hidden;
}

.keyword-panel-title {
  margin-bottom: 20px;
}

.keyword-panel-title h3 {
  margin: 0;
  color: #172136;
  font-size: 1.08rem;
}

.keyword-source-label {
  color: #8894a7;
  font-size: .69rem;
  font-weight: 900;
  letter-spacing: .1em;
}

.keyword-trend {
  display: grid;
  grid-template-columns: repeat(12, minmax(18px, 1fr));
  align-items: end;
  gap: 7px;
  min-height: 220px;
  padding-top: 16px;
  border-bottom: 1px solid #e5eaf2;
}

.trend-column {
  min-width: 0;
  text-align: center;
}

.trend-bar-wrap {
  display: flex;
  align-items: end;
  justify-content: center;
  height: 170px;
}

.trend-bar {
  width: min(72%, 34px);
  min-height: 3px;
  border-radius: 7px 7px 2px 2px;
  background: linear-gradient(180deg, #7458f6, #3f73ff);
}

.trend-column span {
  display: block;
  margin-top: 8px;
  color: #8b96a8;
  font-size: .66rem;
  white-space: nowrap;
}

.keyword-table-wrap {
  overflow-x: auto;
}

.keyword-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 650px;
}

.keyword-table th,
.keyword-table td {
  padding: 13px 12px;
  border-bottom: 1px solid #edf0f5;
  text-align: start;
  vertical-align: middle;
}

.keyword-table th {
  color: #778399;
  font-size: .75rem;
  font-weight: 900;
}

.keyword-table td {
  color: #253047;
  font-size: .9rem;
}

.keyword-table .keyword-cell button {
  padding: 0;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  color: #315fc5;
  font: inherit;
  font-weight: 800;
  text-align: start;
  cursor: pointer;
}

.keyword-ideas {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.keyword-idea {
  border: 1px solid #dfe5ef !important;
  border-radius: 999px !important;
  background: #f7f9fd !important;
  box-shadow: none !important;
  color: #315fc5 !important;
  padding: 9px 13px !important;
  font-size: .82rem;
  cursor: pointer;
}

.realtime-panel {
  margin-bottom: 20px;
}

.realtime-panel .keyword-panel-title {
  align-items: flex-end;
}

.realtime-panel h2 {
  margin: 4px 0 0;
  color: #172136;
  font-size: clamp(1.35rem, 3.5vw, 1.85rem);
  letter-spacing: -.035em;
}

.realtime-lead {
  margin: 7px 0 0;
  color: #738096;
  line-height: 1.6;
  font-size: .88rem;
}

.realtime-refresh {
  flex: 0 0 auto;
  border: 1px solid #dfe5ef !important;
  border-radius: 10px !important;
  background: #fff !important;
  box-shadow: none !important;
  padding: 9px 12px !important;
  color: #53627a !important;
}

.realtime-table-wrap {
  overflow-x: auto;
}

.realtime-table {
  min-width: 600px;
}

.realtime-rank {
  width: 48px;
  color: #8a95a7 !important;
  font-weight: 900;
}

.realtime-volume {
  color: #315fc5 !important;
  font-weight: 900;
  white-space: nowrap;
}

.realtime-source {
  margin: 14px 0 0;
  text-align: end;
  font-size: .76rem;
}

.realtime-source a {
  color: #70809a;
  text-decoration: none;
}

.realtime-source a:hover {
  color: #315fc5;
}

.keyword-empty {
  margin: 8px 0 0;
  color: #7a879c;
  line-height: 1.65;
}

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

@media (max-width: 760px) {
  .keyword-search-row {
    grid-template-columns: 1fr;
  }

  .keyword-search-row button {
    width: 100%;
  }

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

  .keyword-result-heading,
  .keyword-panel-title {
    align-items: flex-start;
    flex-direction: column;
  }

  .provider-status {
    justify-content: flex-start;
  }

  .keyword-trend {
    gap: 4px;
    min-height: 190px;
  }

  .trend-bar-wrap {
    height: 140px;
  }

  .trend-column span {
    font-size: .59rem;
    transform: rotate(-45deg);
    transform-origin: center;
    margin-top: 14px;
  }
}

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

  .keyword-summary-grid article {
    min-height: 112px;
    padding: 16px;
  }
}

#keyword-sort { max-width: 100%; padding: .6rem; border-radius: .5rem; border: 1px solid #cbd5e1; background: #fff; color: #172033; }
@media (max-width: 600px) {
  .realtime-table { min-width: 0; width: 100%; }
  .realtime-table th, .realtime-table td { padding: 10px 6px; overflow-wrap: anywhere; }
  .realtime-table th:last-child, .realtime-table td:last-child { display: none; }
}
