.trends-page, .trends-page * { box-sizing: border-box; min-width: 0; letter-spacing: 0; }
.trends-page [hidden] { display: none !important; }
.trends-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 22px 24px; border: 1px solid #dfe4ea; border-radius: 8px; background: #fff; box-shadow: 0 8px 24px rgba(31, 41, 55, .06); }
.trends-toolbar h2 { color: #202734; }
.trends-eyebrow { display: block; margin-bottom: 4px; color: #2563a9; font-size: .72rem; font-weight: 750; text-transform: uppercase; }
.trends-usage { width: min(250px, 100%); padding: 12px 14px; border: 1px solid #dce3ea; border-radius: 7px; background: #f4f6f8; }
.trends-usage > span, .trends-usage > small { display: block; color: #667382; font-size: .75rem; }
.trends-usage strong { display: block; margin: 2px 0 8px; color: #202734; font-size: 1rem; }
.trends-usage .progress { height: 5px; margin-bottom: 6px; background: #dfe5eb; }
.trends-usage .progress-bar { background: #f59e0b; }
.trends-query-panel { display: grid; grid-template-columns: minmax(260px, 1.7fr) repeat(3, minmax(145px, .7fr)) auto; align-items: end; gap: 14px; padding: 20px; border: 1px solid #dfe4ea; border-radius: 8px; background: #fff; }
.trends-query-panel label { margin: 0; color: #394554; font-size: .79rem; font-weight: 700; }
.trends-query-panel label > span { color: #7b8794; font-size: .72rem; font-weight: 500; }
.trends-query-panel .form-select, .trends-input-wrap { margin-top: 7px; }
.trends-input-wrap { position: relative; }
.trends-input-wrap i { position: absolute; z-index: 1; top: 50%; left: 13px; color: #6b7785; transform: translateY(-50%); }
.trends-input-wrap input { min-height: 44px; padding-left: 38px; }
.trends-query-panel .form-select { min-height: 44px; }
.trends-submit { display: inline-flex; min-height: 44px; align-items: center; justify-content: center; gap: 8px; white-space: nowrap; }
.trends-empty { display: flex; min-height: 210px; align-items: center; justify-content: center; gap: 20px; padding: 40px; border: 1px dashed #cfd7e0; border-radius: 8px; background: #f7f8fa; text-align: left; }
.trends-empty h3 { margin: 0 0 7px; color: #202734; font-size: 1.1rem; }
.trends-empty p { max-width: 620px; }
.trends-empty-icon { display: inline-flex; width: 58px; height: 58px; flex: 0 0 58px; align-items: center; justify-content: center; border-radius: 8px; color: #1f68ad; background: #e8f1fa; font-size: 1.8rem; }
.trends-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.trends-summary article { padding: 17px 18px; border: 1px solid #dfe4ea; border-radius: 8px; background: #fff; }
.trends-summary span, .trends-summary small { display: block; color: #6b7785; }
.trends-summary span { font-size: .76rem; font-weight: 700; text-transform: uppercase; }
.trends-summary strong { display: block; overflow: hidden; margin: 8px 0 3px; color: #202734; font-size: 1.22rem; text-overflow: ellipsis; white-space: nowrap; }
.trends-summary small { font-size: .74rem; }
.trends-chart-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(300px, .8fr); gap: 16px; }
.trends-chart-card, .trends-related { border: 1px solid #dfe4ea; border-radius: 8px; box-shadow: none; }
.trends-chart-card .card-header, .trends-related .card-header { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 17px 19px; background: #fff; }
.trends-chart-card .card-body, .trends-related .card-body { background: #fff; }
.trends-scale { padding: 5px 8px; border-radius: 5px; color: #536170; background: #eef2f6; font-size: .72rem; font-weight: 650; }
.trends-chart { min-height: 320px; }
.trends-region-chart { min-height: 320px; }
.trends-chart-empty { margin: 80px 0; color: #718096; text-align: center; }
.trends-related-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; }
.trends-related h6 { margin-bottom: 12px; }
.trends-related ol { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; counter-reset: trends; }
.trends-related li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border: 1px solid #e1e6eb; border-radius: 6px; background: #f6f8fa; counter-increment: trends; }
.trends-related li::before { content: counter(trends); color: #f59e0b; font-size: .75rem; font-weight: 800; }
.trends-related li span:first-child { flex: 1; overflow-wrap: anywhere; }
.trends-related li span:last-child { color: #647182; font-size: .78rem; }
.trends-page button:focus-visible, .trends-page input:focus-visible, .trends-page select:focus-visible { outline: 2px solid #f59e0b; outline-offset: 2px; }
[data-pc-theme="dark"] .trends-toolbar, [data-pc-theme="dark"] .trends-query-panel, [data-pc-theme="dark"] .trends-summary article, [data-pc-theme="dark"] .trends-chart-card .card-header, [data-pc-theme="dark"] .trends-chart-card .card-body, [data-pc-theme="dark"] .trends-related .card-header, [data-pc-theme="dark"] .trends-related .card-body { border-color: #394553; background: #202731; }
[data-pc-theme="dark"] .trends-toolbar h2, [data-pc-theme="dark"] .trends-usage strong, [data-pc-theme="dark"] .trends-query-panel label, [data-pc-theme="dark"] .trends-empty h3, [data-pc-theme="dark"] .trends-summary strong { color: #f2f5f8; }
[data-pc-theme="dark"] .trends-usage, [data-pc-theme="dark"] .trends-empty, [data-pc-theme="dark"] .trends-related li { border-color: #3a4654; background: #29323d; }
[data-pc-theme="dark"] .trends-empty-icon { color: #7eb5e8; background: #25394d; }
[data-pc-theme="dark"] .trends-scale { color: #c4ced8; background: #303a46; }
@media (max-width: 1199px) { .trends-query-panel { grid-template-columns: repeat(3, 1fr); } .trends-keyword-field { grid-column: span 2; } .trends-submit { width: 100%; } .trends-chart-grid { grid-template-columns: 1fr; } }
@media (max-width: 767px) { .trends-toolbar { align-items: stretch; flex-direction: column; padding: 18px; } .trends-usage { width: 100%; } .trends-query-panel { grid-template-columns: 1fr; padding: 16px; } .trends-keyword-field { grid-column: auto; } .trends-summary { grid-template-columns: repeat(2, 1fr); } .trends-empty { align-items: flex-start; flex-direction: column; padding: 26px 20px; } .trends-related-grid { grid-template-columns: 1fr; } .trends-chart { min-height: 280px; } }
@media (max-width: 420px) { .trends-summary { grid-template-columns: 1fr; } .trends-chart-card .card-header, .trends-related .card-header { align-items: flex-start; flex-direction: column; } }
@media (prefers-reduced-motion: reduce) { .trends-page *, .trends-page *::before, .trends-page *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; } }

.trends-history, .trends-keyword-stats { overflow: visible; border-color: #dfe4ea; background: #fff; }
.trends-history-header { display: flex; align-items: center; justify-content: space-between; gap: 18px; background: #fff; }
.trends-history-search { position: relative; display: flex; width: min(360px, 100%); gap: 8px; }
.trends-history-search > i { position: absolute; top: 50%; left: 13px; color: #687687; transform: translateY(-50%); }
.trends-history-search input { min-height: 44px; padding-left: 38px; }
.trends-history-search button { width: 44px; min-width: 44px; min-height: 44px; padding: 0; }
.trends-history-loading { display: flex; min-height: 120px; align-items: center; justify-content: center; gap: 10px; color: #687687; }
.trends-history-table { width: 100%; overflow-x: auto; }
.trends-history-table table { width: 100%; min-width: 720px; border-collapse: collapse; }
.trends-history-table th { padding: 10px 12px; border-bottom: 1px solid #dfe4ea; color: #697687; font-size: .72rem; font-weight: 750; text-align: left; text-transform: uppercase; }
.trends-history-table td { padding: 14px 12px; border-bottom: 1px solid #e7ebef; color: #495667; vertical-align: middle; }
.trends-history-table tbody tr:last-child td { border-bottom: 0; }
.trends-history-table strong { display: block; max-width: 360px; overflow: hidden; color: #222b37; text-overflow: ellipsis; white-space: nowrap; }
.trends-status { display: inline-flex; min-height: 28px; align-items: center; padding: 4px 9px; border-radius: 999px; font-size: .72rem; font-weight: 750; }
.trends-status.is-completed { color: #146d4c; background: #e4f5ed; }
.trends-status.is-failed { color: #a63c48; background: #fde9eb; }
.trends-status.is-running { color: #8c6200; background: #fff2cf; }
.trends-open-query { display: inline-flex; min-height: 38px; align-items: center; justify-content: center; gap: 6px; padding: 6px 10px; border: 1px solid #cfd7df; border-radius: 6px; color: #255f96; background: #f7f9fb; font-weight: 700; }
.trends-open-query:hover { color: #164c7d; background: #edf3f8; }
.trends-pagination { display: flex; align-items: center; justify-content: center; gap: 16px; padding-top: 18px; border-top: 1px solid #e5e9ee; }
.trends-pagination button { display: inline-flex; min-height: 40px; align-items: center; gap: 6px; }
.trends-pagination > span { color: #687687; font-size: .82rem; font-weight: 700; }
.trends-history-empty { min-height: 160px; padding: 24px; }
.trends-detail-loading { display: flex; min-height: 280px; align-items: center; justify-content: center; gap: 16px; border: 1px solid #dfe4ea; border-radius: 8px; background: #fff; }
.trends-detail-loading div, .trends-detail-loading span { display: block; }
.trends-detail-loading div > span { margin-top: 4px; color: #687687; }
.trends-detail-hero { display: flex; align-items: center; justify-content: space-between; gap: 22px; padding: 22px 24px; border: 1px solid #dfe4ea; border-radius: 8px; background: #fff; }
.trends-detail-hero h2 { margin: 0; color: #202734; overflow-wrap: anywhere; }
.trends-detail-hero p { margin: 6px 0 0; color: #687687; text-transform: capitalize; }
.trends-detail-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.trends-detail-actions a { display: inline-flex; min-height: 44px; align-items: center; justify-content: center; gap: 8px; }
.trends-detail-state { margin-top: 14px; padding: 12px 14px; border-left: 4px solid #8290a0; border-radius: 4px; color: #4b5867; background: #f1f4f7; }
.trends-detail-state.is-completed { border-left-color: #16865a; color: #155e45; background: #eaf7f1; }
.trends-detail-state.is-failed { border-left-color: #c94f5c; color: #8c3440; background: #fdf0f1; }
.trends-keyword-stats .card-header, .trends-keyword-stats .card-body { background: #fff; }
.trends-keyword-stats td.is-keyword { color: #202734; font-weight: 750; }
.trends-keyword-stats td.is-positive { color: #16865a; font-weight: 750; }
.trends-keyword-stats td.is-negative { color: #bd4552; font-weight: 750; }
.trends-discovery-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.trends-dimension-note { display: flex; align-items: center; gap: 14px; padding: 15px 17px; border: 1px solid #dbe2e9; border-radius: 7px; background: #f6f8fa; }
.trends-dimension-note > i { color: #607184; font-size: 1.55rem; }
.trends-dimension-note strong, .trends-dimension-note span { display: block; }
.trends-dimension-note strong { color: #303b48; }
.trends-dimension-note span { margin-top: 3px; color: #6b7887; }
.trends-related li.is-empty { justify-content: flex-start; color: #6b7887; }
.trends-related li.is-empty::before { display: none; }
.trends-page a:focus-visible { outline: 2px solid #f59e0b; outline-offset: 2px; }
[data-pc-theme="dark"] .trends-history, [data-pc-theme="dark"] .trends-history-header, [data-pc-theme="dark"] .trends-detail-loading, [data-pc-theme="dark"] .trends-detail-hero, [data-pc-theme="dark"] .trends-keyword-stats, [data-pc-theme="dark"] .trends-keyword-stats .card-header, [data-pc-theme="dark"] .trends-keyword-stats .card-body { border-color: #394553; background: #202731; }
[data-pc-theme="dark"] .trends-history-table th, [data-pc-theme="dark"] .trends-history-table td, [data-pc-theme="dark"] .trends-pagination { border-color: #394553; }
[data-pc-theme="dark"] .trends-history-table td { color: #c3ccd6; }
[data-pc-theme="dark"] .trends-history-table strong, [data-pc-theme="dark"] .trends-detail-hero h2, [data-pc-theme="dark"] .trends-keyword-stats td.is-keyword { color: #f2f5f8; }
[data-pc-theme="dark"] .trends-open-query { border-color: #485564; color: #8fc1ed; background: #2b3541; }
[data-pc-theme="dark"] .trends-detail-state { color: #c5ced7; background: #2a3440; }
[data-pc-theme="dark"] .trends-detail-state.is-completed { border-left-color: #30b780; color: #9de1c4; background: #223b34; }
[data-pc-theme="dark"] .trends-detail-state.is-failed { border-left-color: #e16b78; color: #f1afb6; background: #402a30; }
[data-pc-theme="dark"] .trends-dimension-note { border-color: #3a4654; background: #29323d; }
[data-pc-theme="dark"] .trends-dimension-note strong { color: #f0f3f6; }
@media (max-width: 767px) {
  .trends-history-header, .trends-detail-hero { align-items: stretch; flex-direction: column; }
  .trends-history-search { width: 100%; }
  .trends-history-table table { min-width: 0; }
  .trends-history-table thead { display: none; }
  .trends-history-table tbody, .trends-history-table tr, .trends-history-table td { display: block; width: 100%; }
  .trends-history-table tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 14px 0; border-bottom: 1px solid #e2e7ec; }
  .trends-history-table td { padding: 0 12px; border: 0; }
  .trends-history-table td::before { display: block; margin-bottom: 3px; color: #788493; content: attr(data-label); font-size: .66rem; font-weight: 750; text-transform: uppercase; }
  .trends-history-table td:first-child, .trends-history-table td:last-child { grid-column: 1 / -1; }
  .trends-open-query { width: 100%; min-height: 44px; }
  .trends-detail-actions { display: grid; grid-template-columns: 1fr; }
  .trends-discovery-grid { grid-template-columns: 1fr; }
}

.trends-compare-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 13px 18px; border-top: 1px solid #e4e8ed; border-bottom: 1px solid #e4e8ed; background: #f7f9fb; }
.trends-compare-copy { display: flex; align-items: center; gap: 12px; }
.trends-compare-copy strong, .trends-compare-copy span { display: block; }
.trends-compare-copy strong { color: #26313e; font-size: .86rem; }
.trends-compare-copy div > span { margin-top: 2px; color: #687687; font-size: .76rem; }
.trends-compare-icon { display: inline-flex; width: 38px; height: 38px; flex: 0 0 38px; align-items: center; justify-content: center; border: 1px solid #cdddeb; border-radius: 7px; color: #2563a9; background: #eaf2f9; font-size: 1.25rem; }
.trends-compare-actions { display: flex; align-items: center; gap: 8px; }
.trends-compare-actions .btn { display: inline-flex; min-height: 40px; align-items: center; justify-content: center; gap: 7px; }
.trends-compare-clear { color: #5e6b79; text-decoration: none; }
.trends-select-column, .trends-select-cell { width: 50px; text-align: center !important; }
.trends-select-cell { padding-right: 4px !important; }
.trends-select-input { width: 19px; height: 19px; margin: 0; cursor: pointer; border-color: #aeb9c5; }
.trends-select-input:checked { border-color: #f59e0b; background-color: #f59e0b; }
.trends-select-input:disabled { cursor: not-allowed; opacity: .42; }
.trends-history-table tbody tr { transition: background-color .16s ease, box-shadow .16s ease; }
.trends-history-table tbody tr.is-selected { background: #fff8e8; box-shadow: inset 3px 0 #f59e0b; }

.trends-comparison-notes { display: grid; gap: 10px; }
.trends-comparison-note { display: flex; align-items: flex-start; gap: 13px; padding: 14px 16px; border: 1px solid #d8e1e9; border-left-width: 4px; border-radius: 6px; background: #fff; }
.trends-comparison-note > i { flex: 0 0 auto; margin-top: 1px; font-size: 1.4rem; }
.trends-comparison-note strong, .trends-comparison-note span { display: block; }
.trends-comparison-note strong { color: #2d3946; font-size: .87rem; }
.trends-comparison-note span { margin-top: 3px; color: #647282; font-size: .8rem; line-height: 1.55; }
.trends-comparison-note.is-information { border-left-color: #2563a9; background: #f3f8fc; }
.trends-comparison-note.is-information > i { color: #2563a9; }
.trends-comparison-note.is-warning { border-color: #f0d294; border-left-color: #db8b08; background: #fff8e9; }
.trends-comparison-note.is-warning > i { color: #c87b00; }
.trends-comparison-note.is-context { border-left-color: #7c5ac7; background: #f8f5fc; }
.trends-comparison-note.is-context > i { color: #7c5ac7; }
.trends-compare-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.trends-compare-summary article { min-height: 116px; padding: 17px 18px; border: 1px solid #dfe4ea; border-radius: 8px; background: #fff; }
.trends-compare-summary span, .trends-compare-summary small { display: block; color: #6b7785; }
.trends-compare-summary span { font-size: .72rem; font-weight: 750; text-transform: uppercase; }
.trends-compare-summary strong { display: block; margin: 9px 0 4px; color: #202734; font-size: 1.02rem; overflow-wrap: anywhere; }
.trends-compare-summary small { font-size: .72rem; }
.trends-compare-sources { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.trends-compare-source { position: relative; display: flex; min-height: 154px; flex-direction: column; padding: 15px 16px; border: 1px solid #dfe4ea; border-top: 3px solid var(--trends-source-color); border-radius: 8px; background: #fff; }
.trends-compare-source-heading { display: flex; align-items: flex-start; gap: 9px; }
.trends-compare-source-marker { width: 10px; height: 10px; flex: 0 0 10px; margin-top: 5px; border-radius: 50%; background: var(--trends-source-color); box-shadow: 0 0 0 3px color-mix(in srgb, var(--trends-source-color), transparent 80%); }
.trends-compare-source-heading span:not(.trends-compare-source-marker) { display: block; color: #778392; font-size: .67rem; font-weight: 750; text-transform: uppercase; }
.trends-compare-source-heading strong { display: block; margin-top: 2px; color: #27313e; font-size: .88rem; overflow-wrap: anywhere; }
.trends-compare-source p { margin: 10px 0 13px; color: #697687; font-size: .74rem; line-height: 1.5; }
.trends-compare-source-link { display: inline-flex; min-height: 34px; align-items: center; gap: 5px; margin-top: auto; color: #255f96; font-size: .75rem; font-weight: 750; }
.trends-compare-chart-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(310px, .75fr); gap: 16px; }
.trends-compare-timeline, .trends-compare-timeline-card .trends-chart { min-height: 390px; }
.trends-compare-average, .trends-compare-momentum { min-height: 330px; }
.trends-compare-table table { min-width: 1040px; }
.trends-compare-table td.is-research { position: relative; padding-left: 23px; color: #202734; font-weight: 750; }
.trends-compare-table td.is-research::after { position: absolute; top: 50%; left: 8px; width: 7px; height: 7px; border-radius: 50%; background: var(--trends-source-color); content: ""; transform: translateY(-50%); }
.trends-compare-table td.is-positive { color: #16865a; font-weight: 750; }
.trends-compare-table td.is-negative { color: #bd4552; font-weight: 750; }
.trends-compare-hero p { text-transform: none; }

[data-pc-theme="dark"] .trends-compare-toolbar { border-color: #394553; background: #28313c; }
[data-pc-theme="dark"] .trends-compare-copy strong, [data-pc-theme="dark"] .trends-compare-summary strong, [data-pc-theme="dark"] .trends-compare-source-heading strong, [data-pc-theme="dark"] .trends-compare-table td.is-research { color: #f2f5f8; }
[data-pc-theme="dark"] .trends-compare-icon { border-color: #36516b; color: #8fc1ed; background: #263a4d; }
[data-pc-theme="dark"] .trends-history-table tbody tr.is-selected { background: #3a3324; box-shadow: inset 3px 0 #f5a91d; }
[data-pc-theme="dark"] .trends-comparison-note, [data-pc-theme="dark"] .trends-compare-summary article, [data-pc-theme="dark"] .trends-compare-source { border-color: #394553; background: #202731; }
[data-pc-theme="dark"] .trends-comparison-note strong { color: #f1f4f7; }
[data-pc-theme="dark"] .trends-comparison-note span { color: #c1cbd5; }
[data-pc-theme="dark"] .trends-comparison-note.is-information { border-left-color: #64a8e3; background: #223342; }
[data-pc-theme="dark"] .trends-comparison-note.is-warning { border-color: #5b4b2e; border-left-color: #f0a62c; background: #3a3223; }
[data-pc-theme="dark"] .trends-comparison-note.is-context { border-left-color: #aa8ae8; background: #302b40; }
[data-pc-theme="dark"] .trends-detail-actions .btn-outline-secondary { border-color: #5b6877; color: #e1e7ed; background: #27313c; }
[data-pc-theme="dark"] .trends-detail-actions .btn-outline-secondary:hover { border-color: #748496; color: #fff; background: #313c48; }

@media (max-width: 1199px) {
  .trends-compare-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .trends-compare-chart-grid { grid-template-columns: 1fr; }
}
@media (max-width: 767px) {
  .trends-compare-toolbar { align-items: stretch; flex-direction: column; padding: 14px; }
  .trends-compare-actions { display: grid; grid-template-columns: minmax(0, .55fr) minmax(0, 1.45fr); }
  .trends-compare-actions .btn { min-height: 44px; }
  .trends-history .trends-history-table td:first-child { grid-column: auto; }
  .trends-history .trends-history-table td:nth-child(2) { grid-column: 1 / -1; }
  .trends-select-cell { display: flex !important; min-height: 44px; align-items: center; gap: 8px; padding: 0 12px !important; }
  .trends-select-cell::before { margin: 0 !important; }
  .trends-compare-summary { grid-template-columns: 1fr 1fr; }
  .trends-compare-sources { grid-template-columns: 1fr; }
  .trends-compare-source-link { min-height: 44px; }
  .trends-compare-table table { min-width: 0; }
  .trends-compare-table td.is-research { padding-left: 26px; }
  .trends-compare-table td.is-research::after { left: 12px; }
}
@media (max-width: 420px) {
  .trends-compare-summary { grid-template-columns: 1fr; }
  .trends-compare-actions { grid-template-columns: 1fr; }
  .trends-comparison-note { padding: 13px 14px; }
}
