.date-stat { font-size: 14px !important; }
.pill { padding: 3px 7px; border-radius: 999px; background: #f2f4f7; font-size: 12px; }
.up { color: #067647; font-weight: 700; }
.down { color: #d92d20; font-weight: 700; }
.spinner { display: inline-block; width: 14px; height: 14px; border: 2px solid #a8c7fa; border-top-color: #175cd3; border-radius: 50%; animation: spin .8s linear infinite; vertical-align: -2px; margin-right: 7px; }
.job-errors { margin-top: 6px; font-size: 13px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Széles, kompakt projekt- és kulcsszónézet */
.shell { max-width: 1540px; padding-top: 22px; }
.top { margin-bottom: 18px; }
.project-picker { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.project-picker label { color: var(--muted); font-size: 12px; font-weight: 750; letter-spacing: .04em; text-transform: uppercase; }
.project-picker select { width: min(520px, 100%); background: #fff; }
.project-picker #report-project { margin-left: auto; }
.content { padding: 22px; }
.table-hint { font-size: 12px; }
.keyword-table { height: 360px; min-height: 190px; max-height: 70vh; resize: vertical; overflow: auto; }
.keyword-table table { min-width: 1050px; }
.keyword-table th, .keyword-table td { padding: 7px 9px; white-space: nowrap; }
.keyword-table th { position: sticky; top: 0; z-index: 2; font-size: 11px; }
.sort-button { display: inline-flex; align-items: center; gap: 5px; width: 100%; padding: 0; border: 0; border-radius: 0; background: transparent; color: inherit; font-size: inherit; font-weight: 750; letter-spacing: inherit; text-align: left; text-transform: inherit; }
.sort-button:hover, .sort-button:focus-visible, .sort-button.active { color: #1849a9; }
.sort-button span { color: #98a2b3; font-size: 9px; }
.sort-button.active span { color: #2563eb; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.keyword-row { cursor: pointer; }
.keyword-row:hover td, .keyword-row.selected td { background: #f5f8ff; }
.keyword-row.selected .keyword-name { box-shadow: inset 3px 0 #2563eb; color: #1849a9; font-weight: 700; }
.keyword-name { max-width: 300px; overflow: hidden; text-overflow: ellipsis; }
.row-actions { display: flex; gap: 5px; }
.keyword-workspace { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 16px; align-items: start; }
.keyword-workspace-main { min-width: 0; }
.keyword-groups-panel { min-height: 360px; border: 1px solid var(--line); border-radius: 12px; background: #fff; overflow: hidden; }
.groups-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 15px 14px 12px; border-bottom: 1px solid var(--line); }
.groups-head h2 { margin: 1px 0 0; font-size: 17px; }
.group-add { width: 34px; height: 34px; padding: 0; border-color: #b2ccff; color: #1849a9; font-size: 21px; line-height: 1; }
.group-list { padding: 8px; }
.group-item { display: flex; justify-content: space-between; gap: 8px; width: 100%; padding: 9px 10px; border: 0; border-radius: 8px; text-align: left; }
.group-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.group-item b { color: var(--muted); font-size: 12px; }
.group-item:hover, .group-item.active { background: #eff4ff; color: #1849a9; }
.group-item.drag-over { outline: 2px dashed #2563eb; outline-offset: -2px; background: #dbeafe; }
.custom-group { display: grid; grid-template-columns: minmax(0,1fr) 28px; align-items: center; }
.delete-group { padding: 2px; border: 0; background: transparent; color: #98a2b3; font-size: 18px; }
.delete-group:hover { color: var(--red); }
.group-help { margin: 8px 14px 15px; color: var(--muted); font-size: 11px; }
.keyword-row.dragging { opacity: .45; }

/* Kiválasztott kulcsszó historikus nézete */
.history-panel { border: 1px solid var(--line); border-radius: 12px; margin-top: 16px; min-height: 190px; overflow: hidden; }
.history-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.history-head h2 { margin: 2px 0 0; font-size: 20px; }
.eyebrow { color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .08em; }
.view-switch { display: flex; background: #f2f4f7; border-radius: 9px; padding: 3px; }
.view-switch button { border: 0; background: transparent; padding: 6px 12px; font-size: 13px; }
.view-switch button.active { background: #fff; color: #1849a9; box-shadow: 0 1px 3px #1018281a; }
.compact-empty { padding: 50px 18px; }
.history-table { max-height: 360px; overflow: auto; }
.history-table table { min-width: 760px; }
.history-table th, .history-table td { white-space: nowrap; }
.history-table th { position: sticky; top: 0; z-index: 2; }
.chart-wrap { height: 310px; padding: 10px 14px 0; overflow-x: auto; position: relative; }
.chart-wrap canvas { width: 100%; min-width: 500px; height: 300px; display: block; }
.chart-tooltip { position: absolute; z-index: 5; transform: translate(-50%, calc(-100% - 10px)); min-width: 138px; padding: 8px 10px; border-radius: 8px; background: #101828; color: #fff; box-shadow: 0 6px 16px #10182835; pointer-events: none; text-align: center; white-space: nowrap; }
.chart-tooltip.below { transform: translate(-50%, 12px); }
.chart-tooltip strong, .chart-tooltip small { display: block; }
.chart-tooltip strong { font-size: 13px; }
.chart-tooltip small { margin-top: 2px; color: #d0d5dd; font-size: 11px; }
.chart-legend { display: flex; justify-content: space-between; gap: 15px; padding: 8px 22px 16px; color: var(--muted); }
.chart-legend span { font-size: 12px; font-weight: 650; }
.chart-legend i { display: inline-block; width: 9px; height: 9px; background: #2563eb; border-radius: 50%; margin-right: 5px; }
.chart-legend small { font-size: 11px; }
.report-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin-top: 18px; }
.report-form-grid label { display: grid; gap: 5px; font-weight: 650; }
.report-help { margin-top: 18px; padding: 13px 15px; border: 1px solid #d1e0ff; border-radius: 10px; background: #f5f8ff; }
.report-help p { margin: 4px 0 0; color: var(--muted); }
#report-status:empty { display: none; }

@media (max-width: 800px) {
  .summary { overflow: auto; }
  .table-hint { display: none; }
  .keyword-workspace { grid-template-columns: 1fr; }
  .keyword-groups-panel { grid-row: 1; min-height: 0; }
}
@media (max-width: 560px) {
  .project-picker, .history-head, .chart-legend { align-items: stretch; flex-direction: column; }
  .project-picker select { width: 100%; }
  .project-picker #report-project { margin-left: 0; }
  .report-form-grid { grid-template-columns: 1fr; }
}
