/* SEO Tasks — page-specific pieces on top of audit-theme.css. */
.st-body { --page-max: 1520px; }

.st-layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 18px; align-items: start; }
@media (max-width: 960px) { .st-layout { grid-template-columns: 1fr; } }

/* ---- endpoint picker ---- */
.st-picker { padding: 14px 12px; position: sticky; top: calc(var(--shell-top, 56px) + 20px); max-height: calc(100vh - var(--shell-top, 56px) - 40px); overflow-y: auto; margin-bottom: 0; }
@media (max-width: 1120px) { .st-picker { max-height: calc(100vh - var(--shell-top) - 36px); } }
@media (max-width: 960px) { .st-picker { position: static; max-height: 340px; } }
.st-search { display: flex; align-items: center; gap: 8px; background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 7px 10px; margin-bottom: 10px; }
.st-search:focus-within { border-color: var(--accent); }
.st-search svg { width: 15px; height: 15px; color: var(--text-muted); flex-shrink: 0; }
.st-search input { background: none; border: none; outline: none; color: var(--text); font-family: var(--sans); font-size: 13px; width: 100%; }
.st-search input::placeholder { color: var(--text-muted); }
.st-group + .st-group { margin-top: 12px; }
.st-group-lbl { font-size: 12px; font-weight: 600; letter-spacing: 0; color: var(--text-muted); padding: 4px 8px 6px; }
.st-endpoint {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; text-align: left; cursor: pointer;
  background: none; border: 1px solid transparent; border-radius: var(--radius-md); padding: 7px 9px; font-family: var(--sans); font-size: 13px; color: var(--text-2); transition: .12s;
}
.st-endpoint:hover { background: var(--row-hover); color: var(--text); border-color: var(--border-soft); }
.st-endpoint.is-active { background: var(--accent-dim); color: var(--text); border-color: var(--accent-border); font-weight: 600; }
.st-endpoint:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.st-endpoint-cost { font-size: 11px; font-weight: 600; color: var(--text-muted); white-space: nowrap; }

/* ---- form ---- */
.st-work { min-width: 0; }
.st-form-head h2 { margin: 0 0 4px; font-size: 18px; line-height: 26px; font-weight: 600; letter-spacing: -.005em; }
.st-form-head p { margin: 0 0 18px; color: var(--text-2); font-size: 13px; max-width: 760px; }
.st-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px 16px; }
.st-field { min-width: 0; }
.st-field[hidden] { display: none; }
.st-field--wide { grid-column: 1 / -1; }
.st-field .panel-lbl { display: block; }
.st-input {
  width: 100%; background: var(--bg-input); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 9px 11px; font-family: var(--sans); font-size: 13px; outline: none;
}
.st-input:focus { border-color: var(--accent); }
.st-input::placeholder { color: var(--text-muted); }
.st-textarea { min-height: 110px; resize: vertical; line-height: 1.5; }
.st-count { font-weight: 600; letter-spacing: .04em; text-transform: none; color: var(--text-muted); margin-left: 4px; }
.st-count.is-over { color: var(--danger-strong); }
.st-hint { font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--text-muted); margin-left: 6px; }
.st-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.st-chip { font-family: var(--sans); font-size: 12px; color: var(--text-2); background: var(--bg-input); border: 1px solid var(--border); border-radius: 8px; padding: 5px 9px; cursor: pointer; transition: .12s; }
.st-chip:hover { border-color: var(--border-hover); }
.st-chip.is-on { color: var(--text); background: var(--accent-dim); border-color: var(--accent-border); }
.st-chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.st-run-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 18px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border-soft); }
.st-key { flex: 1; min-width: 240px; max-width: 420px; }
.st-run { display: flex; align-items: center; gap: 14px; margin-left: auto; }
.st-run .btn { height: 40px; padding: 0 24px; }
.st-cost { font-size: 12px; color: var(--text-muted); text-align: right; }
.st-cost b { color: var(--text); }
.st-progress { display: flex; align-items: center; gap: 12px; color: var(--text-2); }

/* ---- results ---- */
.st-section-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; margin: 26px 0 12px; }
.st-section-head h2 { margin: 0; font-size: 15px; line-height: 22px; font-weight: 600; letter-spacing: -.005em; }
.st-meta { color: var(--text-muted); font-size: 13px; }
.st-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.st-search--table { margin: 0; width: 280px; max-width: 100%; }
.st-table th, .st-table td { padding: 10px 12px; white-space: nowrap; }
.st-table td { font-size: 13px; }
.st-table .st-text, .st-table .st-link, .st-table .st-error-text { display: inline-block; max-width: 420px; overflow: hidden; text-overflow: ellipsis; vertical-align: bottom; }
.st-link { color: var(--text-2); text-decoration: none; font-family: var(--mono); font-size: 12px; }
.st-link:hover { color: var(--accent); }
.st-error-text { color: var(--danger); font-family: var(--sans); }
.st-table tr.is-error td { background: var(--danger-bg); }
.st-sort { background: none; border: none; padding: 0; font: inherit; color: inherit; cursor: pointer; white-space: nowrap; }
.st-sort:hover { color: var(--text); }
.st-sort:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
.st-pager { display: flex; align-items: center; justify-content: flex-end; gap: 12px; padding: 12px 14px; border-top: 1px solid var(--border-soft); }
.st-pager:empty { display: none; }

@media (max-width: 640px) {
  /* The last-run time and export buttons drop under the title instead of pushing the page wide. */
  .pg-head { flex-wrap: wrap; }
  .head-right { flex-wrap: wrap; gap: 10px 14px; flex-shrink: 1; min-width: 0; }
  .st-key { min-width: 0; max-width: none; flex-basis: 100%; }
  .st-run { margin-left: 0; width: 100%; justify-content: space-between; }
}

/* Wide result tables scroll sideways; a fade on the right edge says there are more columns. */
#st-results .tbl-wrap { position: relative; }
#st-results .panel { position: relative; }
#st-results .tbl-wrap.has-more { mask-image: linear-gradient(to right, #000 calc(100% - 56px), transparent); -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 56px), transparent); }

/* ---- Table / JSON view ---- */
.st-view { display: inline-flex; padding: 3px; gap: 3px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--bg-input); }
.st-view-btn { font-family: var(--sans); font-size: 12px; font-weight: 600; color: var(--text-muted); background: none; border: none; border-radius: var(--radius-sm); padding: 5px 12px; cursor: pointer; }
.st-view-btn:hover { color: var(--text-2); }
.st-view-btn.is-active { background: var(--bg-panel); color: var(--text); box-shadow: 0 0 0 1px var(--border); }
.st-view-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.st-toolbar { justify-content: flex-start; }
.st-toolbar-end { margin-left: auto; }
.st-toolbar-end[hidden] { display: none; }
.st-json-note { margin: 0; padding: 12px 16px 0; font-size: 12px; color: var(--text-muted); }
.st-json {
  margin: 10px 16px 16px; padding: 14px 16px; max-height: 620px; overflow: auto; border-radius: var(--radius-md);
  background: var(--bg-input); border: 1px solid var(--border-soft); color: var(--text-2);
  font-family: var(--mono); font-size: 12px; line-height: 1.55; white-space: pre; tab-size: 2;
}
.st-json:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Keyword overview: one keyword as a strip of its metrics; every field stays a click away. */
.st-kpis { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); margin-bottom: 10px; }
@media (min-width: 1100px) { .st-kpis { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.st-kpis .val { text-transform: capitalize; }
.st-overview-all { margin-bottom: 24px; }
.st-overview-all > summary { cursor: pointer; font-size: 13px; color: var(--text-muted); margin-bottom: 10px; width: max-content; }
.st-overview-all > summary:hover { color: var(--text); }
.st-overview-all > summary[hidden] { display: none; }
.st-section-head h2 { font-size: 16px; line-height: 24px; }
