/* Seasonality checker. Series colours = validated dataviz categorical slots 1 (blue) and 2 (orange). */
:root {
    --season-google: #2a78d6;
    --season-yandex: #eb6834;
    --season-grid: #e6e6e3;
    --season-axis: #6b6b68;
    --season-ink: #1f1f1e;
}

.seasonality__engines .custom-control-label small { color: #6c757d; }
.seasonality__settings { display: flex; flex-wrap: wrap; gap: 0 1rem; }
.seasonality__settings .form-group { flex: 1 1 220px; min-width: 0; }

.seasonality-card + .seasonality-card { margin-top: 1rem; }
.seasonality-card__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: .5rem; margin-bottom: .75rem; }
.seasonality-card__title { display: flex; align-items: center; gap: .5rem; margin: 0; }
.seasonality-card__note { margin-bottom: .75rem; }

.seasonality-stats { display: flex; flex-wrap: wrap; gap: .75rem; margin-bottom: 1rem; }
.seasonality-stat { flex: 1 1 150px; min-width: 0; padding: .625rem .75rem; border: 1px solid #ececec; border-radius: 8px; }
.seasonality-stat__label { display: block; font-size: .8125rem; color: #6c757d; }
.seasonality-stat__value { display: block; font-size: 1.25rem; font-weight: 600; color: var(--season-ink); overflow-wrap: anywhere; }
.seasonality-stat__hint { display: block; font-size: .75rem; color: #6c757d; }

.seasonality-legend { display: flex; flex-wrap: wrap; gap: .25rem 1rem; margin-bottom: .5rem; font-size: .875rem; color: #495057; }

.season-chart { position: relative; width: 100%; }
.season-chart--compact { max-width: 216px; margin-bottom: .25rem; }
.season-svg { display: block; width: 100%; height: auto; overflow: visible; }
.season-grid { stroke: var(--season-grid); stroke-width: 1; }
.season-axis { fill: var(--season-axis); font-size: 11px; }
.season-line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.season-line--google { stroke: var(--season-google); }
.season-line--yandex { stroke: var(--season-yandex); }
.season-line--partial { stroke-dasharray: 4 4; }
.season-dot { stroke: #fff; stroke-width: 2; }
.season-dot--google { fill: var(--season-google); }
.season-dot--yandex { fill: var(--season-yandex); }
.season-cross { stroke: #9a9a96; stroke-width: 1; }
.season-hit { fill: transparent; cursor: crosshair; }
.season-bar--google { fill: var(--season-google); }
.season-bar--yandex { fill: var(--season-yandex); }

.season-swatch { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: .375rem; vertical-align: -1px; }
.season-swatch--google { background: var(--season-google); }
.season-swatch--yandex { background: var(--season-yandex); }

.season-tip { position: absolute; z-index: 5; pointer-events: none; padding: .375rem .5rem; background: #fff; border: 1px solid #dcdcd8; border-radius: 6px; box-shadow: 0 2px 8px rgba(0, 0, 0, .12); font-size: .8125rem; color: var(--season-ink); white-space: nowrap; }
.season-tip__title { font-weight: 600; margin-bottom: .125rem; }

.seasonality-table { font-size: .875rem; }
.seasonality-table td, .seasonality-table th { white-space: nowrap; }

@media (max-width: 575.98px) {
    .seasonality-stat { flex-basis: calc(50% - .375rem); }
    .season-axis { font-size: 13px; }
}

/* Searchable location picker */
.season-picker { position: relative; min-width: 0; }
.season-picker__dropdown { position: absolute; top: calc(100% + .25rem); left: 0; right: 0; z-index: 30; padding: .375rem; background: #fff; border: 1px solid #d7d7d7; border-radius: .375rem; box-shadow: 0 .5rem 1.25rem rgba(22, 22, 22, .12); }
.season-picker__list { max-height: 16rem; overflow-y: auto; }
.season-picker__option { display: block; width: 100%; padding: .4375rem .625rem; border: 0; border-radius: .25rem; background: transparent; color: #161616; text-align: start; cursor: pointer; }
.season-picker__option:hover, .season-picker__option.is-active { background: #f2edff; }
.season-picker__option.is-current { font-weight: 600; }
.season-picker__message { padding: .625rem; font-size: .8125rem; color: #5f5f5f; }

/* Bulk results: month heatmap. Sequential single-hue ramp (light -> dark = weaker -> stronger month). */
.season-heat { --heat-0: #f4f0ff; --heat-1: #ddcdff; --heat-2: #b99aff; --heat-3: #7d4fe6; --heat-4: #5b2fc4; }
.tool-bulk-seasonality-table { font-size: .875rem; border-collapse: separate; border-spacing: 0; }
.tool-bulk-seasonality-table th, .tool-bulk-seasonality-table td { padding: .5rem .5rem; vertical-align: middle; border-top: 0; border-bottom: 1px solid #ececec; }
.tool-bulk-seasonality-table thead th { position: sticky; top: 0; z-index: 1; background: #fafafa; font-size: .75rem; font-weight: 600; color: #5f5f5f; white-space: nowrap; border-bottom: 1px solid #e2e2e2; }
.tool-bulk-seasonality-table .season-col-phrase { min-width: 180px; max-width: 260px; padding-left: 1.25rem; }
.tool-bulk-seasonality-table .season-col-month { width: 34px; padding: .25rem 1px; text-align: center; }
.tool-bulk-seasonality-table tbody tr.season-group-start td { border-top: 1px solid #dcdcdc; }
.season-phrase { font-weight: 600; color: #1f1f1e; overflow-wrap: anywhere; }
.season-phrase-link { display: inline-block; margin-top: .25rem; font-size: .75rem; }
.season-engine { display: inline-flex; align-items: center; gap: .375rem; white-space: nowrap; color: #495057; }
.season-cell { display: block; min-width: 30px; height: 28px; line-height: 28px; border-radius: 4px; font-size: .6875rem; font-variant-numeric: tabular-nums; text-align: center; color: #1f1f1e; }
.season-cell--0 { background: var(--heat-0); }
.season-cell--1 { background: var(--heat-1); }
.season-cell--2 { background: var(--heat-2); }
.season-cell--3 { background: var(--heat-3); color: #fff; }
.season-cell--4 { background: var(--heat-4); color: #fff; font-weight: 600; }
.season-row-note { font-size: .8125rem; color: #5f5f5f; white-space: normal; }
.season-strength { display: inline-block; padding: .125rem .5rem; border-radius: 999px; font-size: .75rem; white-space: nowrap; background: #f1f1ef; color: #1f1f1e; }
.season-num { font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; }
.season-heat-legend { display: flex; flex-wrap: wrap; align-items: center; gap: .375rem 1rem; padding: .75rem 1.25rem; font-size: .8125rem; color: #5f5f5f; border-top: 1px solid #ececec; }
.season-heat-legend__ramp { display: inline-flex; gap: 2px; align-items: center; }
.season-heat-legend__ramp span { width: 22px; height: 12px; border-radius: 2px; }

.seasonality-empty { padding: 1rem 1.125rem; border: 1px dashed #d7d7d7; border-radius: 8px; background: #fafafa; }
.seasonality-table-wrap { max-height: 22rem; overflow-y: auto; }
.seasonality-table thead th { position: sticky; top: 0; background: #fff; }

/* Override the generic fixed 5-column .tool-bulk-table layout (and its mobile card mode) for the 17-column heatmap. */
#tool-bulk-app .tool-bulk-seasonality-table { table-layout: auto; min-width: 1000px; width: 100%; }
#tool-bulk-app .tool-bulk-seasonality-table th { width: auto; }
#tool-bulk-app .tool-bulk-seasonality-table td { vertical-align: middle; overflow-wrap: normal; }
#tool-bulk-app .tool-bulk-seasonality-table th.season-col-phrase { width: 220px; }
#tool-bulk-app .tool-bulk-seasonality-table th.season-col-month { width: 36px; }
#tool-bulk-app .tool-bulk-seasonality-table td.season-row-peak { min-width: 130px; white-space: nowrap; }
#tool-bulk-app .tool-bulk-seasonality-table td.season-row-note { white-space: normal; }
#tool-bulk-app .tool-bulk-seasonality-table .season-col-phrase { position: sticky; left: 0; z-index: 2; background: #fff; box-shadow: 1px 0 0 #ececec; }
#tool-bulk-app .tool-bulk-seasonality-table thead .season-col-phrase { z-index: 3; background: #fafafa; }
@media (max-width: 575.98px) {
    #tool-bulk-app .tool-bulk-seasonality-table-wrap, #tool-bulk-app .tool-bulk-table-wrap:has(.tool-bulk-seasonality-table) { overflow-x: auto; max-height: none; }
    #tool-bulk-app .tool-bulk-seasonality-table { display: table; min-width: 1000px; }
    #tool-bulk-app .tool-bulk-seasonality-table thead { display: table-header-group; }
    #tool-bulk-app .tool-bulk-seasonality-table tbody { display: table-row-group; }
    #tool-bulk-app .tool-bulk-seasonality-table tr { display: table-row; padding: 0; border: 0; }
    #tool-bulk-app .tool-bulk-seasonality-table td { display: table-cell; padding: .5rem; border-bottom: 1px solid #ececec; }
    #tool-bulk-app .tool-bulk-seasonality-table td.season-col-month { padding: .25rem 1px; }
    #tool-bulk-app .tool-bulk-seasonality-table td::before { content: none; }
    #tool-bulk-app .tool-bulk-seasonality-table .season-col-phrase { min-width: 150px; max-width: 150px; padding-left: .75rem; }
}
/* Results receive programmatic focus after a check; keep it for screen readers, not as a frame. */
#seasonality-results { scroll-margin-top: 90px; }
#seasonality-results:focus { outline: none; }

/* Bulk result tabs + raw data table */
.season-tabs { display: flex; gap: .25rem; padding: 0 1.25rem; border-bottom: 1px solid #e2e2e2; }
.season-tab { padding: .625rem .875rem; border: 0; border-bottom: 2px solid transparent; background: none; color: #5f5f5f; font-weight: 500; }
.season-tab.is-active { color: #1f1f1e; border-bottom-color: #8f5aff; }
.season-raw-toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .25rem 1.5rem; padding: .875rem 1.5rem .5rem; }
.season-raw-block { padding: .5rem 1.5rem 1.5rem; }
.season-raw-block + .season-raw-block { border-top: 1px solid #ececec; padding-top: 1.25rem; }
.season-raw-block__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .5rem; margin-bottom: .625rem; }
.season-raw-block__title { display: flex; align-items: center; margin: 0; font-size: 1rem; font-weight: 600; }
.season-raw-block__unit { font-weight: 400; color: #6c757d; margin-left: .25rem; }
/* The scroll box owns the overflow: the table never pushes the card wider than the page. */
.season-raw-scroll { max-width: 100%; overflow: auto; max-height: 560px; border: 1px solid #e6e6e3; border-radius: 8px; }
.season-raw-scroll:focus-visible { outline: 2px solid #8f5aff; outline-offset: 2px; }
.season-raw-table { border-collapse: separate; border-spacing: 0; font-size: .8125rem; font-variant-numeric: tabular-nums; margin: 0; }
.season-raw-table th, .season-raw-table td { padding: .4375rem .625rem; border-bottom: 1px solid #f0f0ee; white-space: nowrap; }
.season-raw-table thead th { position: sticky; background: #fafafa; color: #5f5f5f; font-weight: 600; z-index: 2; }
.season-raw-table thead tr:first-child th { top: 0; height: 30px; }
.season-raw-table thead tr:last-child th { top: 30px; font-weight: 500; text-transform: lowercase; border-bottom: 1px solid #e2e2e2; }
.season-raw-year { text-align: left; border-left: 1px solid #e2e2e2; }
.season-raw-month, .season-raw-val { text-align: right; }
.season-raw-table--yandex .season-raw-val, .season-raw-table--yandex .season-raw-month { min-width: 78px; }
.season-raw-table--google .season-raw-val, .season-raw-table--google .season-raw-month { min-width: 46px; }
.season-raw-yearstart { border-left: 1px solid #e2e2e2; }
.season-raw-phrase { position: sticky; left: 0; z-index: 1; min-width: 200px; max-width: 260px; white-space: normal !important; text-align: left; font-weight: 500; color: #1f1f1e; background: #fff; box-shadow: 1px 0 0 #e2e2e2; }
.season-raw-table thead .season-raw-phrase { z-index: 3; background: #fafafa; vertical-align: bottom; }
.season-raw-table tbody tr:hover th, .season-raw-table tbody tr:hover td { background: #f7f4ff; }
.season-raw-na { color: #a0a09c; }
.season-raw-note { color: #6c757d; font-style: italic; text-align: left !important; }
.season-raw-key { display: inline-block; min-width: 1.75rem; margin: 0 .375rem 0 .75rem; padding: 0 .375rem; border: 1px solid #e2e2e2; border-radius: 4px; text-align: center; font-variant-numeric: tabular-nums; color: #1f1f1e; background: #fff; }
.season-raw-key:first-child { margin-left: 0; }
.season-raw-key.season-raw-na { color: #a0a09c; }
@media (max-width: 575.98px) {
    .season-raw-toolbar, .season-raw-block { padding-left: 1rem; padding-right: 1rem; }
    .season-raw-phrase { min-width: 130px; max-width: 150px; }
}
/* Stays visible next to the sticky phrase column while a long row is scrolled horizontally. */
.season-raw-sticky-text { position: sticky; left: calc(200px + .75rem); display: inline-block; }
@media (max-width: 575.98px) { .season-raw-sticky-text { left: calc(130px + .75rem); } }

/* Check history: single checks and bulk batches in one list. */
.season-history .season-history__item { display: flex; justify-content: space-between; align-items: flex-start; gap: .25rem 1rem; padding-left: .75rem; padding-right: .75rem; border-radius: .375rem; }
.season-history__item.is-current { background: #f7f4ff; }
.season-history__main { display: flex; flex-direction: column; min-width: 0; }
.season-history__title { font-weight: 600; color: #1f1f1e; overflow-wrap: anywhere; }
.season-history__kind { font-weight: 500; color: #6c757d; }
.season-history__phrases { font-size: .8125rem; color: #5f5f5f; overflow-wrap: anywhere; }
.season-history__engines { display: flex; flex-wrap: wrap; gap: .125rem .875rem; font-size: .8125rem; color: #6c757d; margin-top: .125rem; }
.season-history__engine { display: inline-flex; align-items: center; }
.season-history__meta { display: flex; align-items: center; gap: .5rem; flex-shrink: 0; font-size: .8125rem; color: #6c757d; white-space: nowrap; }
@media (max-width: 575.98px) {
    .season-history .season-history__item { flex-direction: column; }
}
.season-picker__note { border-top: 1px solid #ececec; margin-top: .25rem; padding-bottom: .25rem; }
.season-picker__note:first-child { border-top: 0; margin-top: 0; }
