/* Twitter Advanced Search Builder - tool-specific styles. Composes the
 * shared primitives in tools.css (form card, buttons, toasts); the X
 * blue accent is shared by every twitter-* tool. */

:root {
    --tas-accent: #1d9bf0;
    --tas-accent-dark: #0c7abf;
    --tas-accent-tint: #eaf6fe;
    --tas-border: #e6e8eb;
}

.page-hero h1 .tas-hero-mark { width: 1em; height: 1em; vertical-align: -0.12em; margin-right: 0.4rem; color: var(--tas-accent); }

/* ---- Presets ---- */
.tas-presets { margin-bottom: 16px; padding-bottom: 14px; border-bottom: 1px solid #eef0f4; }
.tas-presets-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.tas-presets-label { font-weight: 600; font-size: 0.88rem; color: #334155; }
.tas-clear-top { font-size: 0.82rem; padding: 5px 12px; flex: 0 0 auto; }
.tas-presets-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.tas-preset {
    font: inherit; font-size: 0.82rem; font-weight: 600; padding: 5px 12px;
    border: 1px solid #e2e8f0; border-radius: 999px; background: #fff; color: #475569; cursor: pointer;
    transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.tas-preset:hover { border-color: var(--tas-accent); color: var(--tas-accent-dark); }
.tas-preset.is-active { background: var(--tas-accent); border-color: var(--tas-accent); color: #fff; }

/* ---- Field groups ---- */
.tas-group { border: 0; padding: 0; margin: 0 0 16px; min-width: 0; }
.tas-legend { font-weight: 700; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--tas-accent-dark); margin-bottom: 10px; padding: 0; }
.tas-legend-summary { cursor: pointer; list-style: none; display: inline-flex; align-items: center; gap: 6px; }
.tas-legend-summary::-webkit-details-marker { display: none; }
.tas-legend-summary::before { content: ''; width: 0; height: 0; border-left: 5px solid transparent; border-right: 5px solid transparent; border-top: 6px solid var(--tas-accent-dark); transform: rotate(-90deg); transition: transform 0.12s; }
.tas-more[open] > .tas-legend-summary::before { transform: rotate(0); }
/* The six essentials sit in the open; everything else collapses under
 * "More filters" (2026-09-03, operator: the full form was overwhelming
 * and pushed the query panel below the fold). The summary line carries a
 * count badge (JS) so a preset that set a hidden filter stays visible. */
.tas-more { border-top: 1px solid #eef0f4; padding-top: 12px; margin-bottom: -6px; }
.tas-more > .tas-legend-summary { margin-bottom: 0; flex-wrap: wrap; }
.tas-more[open] > .tas-legend-summary { margin-bottom: 14px; }
.tas-more-badge { font-size: 0.72rem; padding: 1px 8px; border-radius: 999px; background: var(--tas-accent); color: #fff; letter-spacing: 0; }
.tas-more-hint { font-weight: 500; text-transform: none; letter-spacing: 0; color: #94a3b8; font-size: 0.8rem; }
.tas-more[open] > .tas-legend-summary .tas-more-hint { display: none; }
.tas-more .tas-group:last-child { margin-bottom: 4px; }
.tas-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.tas-grid-3 { grid-template-columns: 1fr 1fr 1fr; }
.tas-grid-4 { grid-template-columns: repeat(4, 1fr); }
.tas-essentials .tas-field:nth-last-child(-n+3) { margin-bottom: 4px; }
.tas-field { display: flex; flex-direction: column; margin-bottom: 12px; min-width: 0; }
.tas-label { font-weight: 600; font-size: 0.88rem; color: #334155; margin-bottom: 5px; display: block; }
/* flex:0 0 auto guards the shared .text-input flex-basis-as-height trap. */
.tas-input, .tas-select { width: 100%; box-sizing: border-box; flex: 0 0 auto; font-size: 0.95rem; }
.tas-select { max-width: 100%; }
.tas-hint { margin-top: 5px; font-size: 0.78rem; color: #94a3b8; }
.tas-hint code { background: #f1f5f9; border-radius: 4px; padding: 0 4px; font-size: 0.92em; }

.tas-filters { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: flex-start; }
.tas-filter { display: flex; flex-direction: column; min-width: 0; }
.tas-select-sm { width: auto; min-width: 200px; }
.tas-filter-checks { display: flex; flex-direction: column; gap: 8px; padding-top: 24px; }
.tas-check { font-size: 0.88rem; color: #334155; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.tas-pills { display: inline-flex; border: 1px solid #d7dbe0; border-radius: 999px; overflow: hidden; background: #fff; }
.tas-pill { font: inherit; font-size: 0.84rem; padding: 6px 13px; border: 0; background: transparent; color: #475569; cursor: pointer; }
.tas-pill + .tas-pill { border-left: 1px solid #d7dbe0; }
.tas-pill.is-active { background: var(--tas-accent); color: #fff; }
.tas-pill:focus-visible { outline: 2px solid var(--tas-accent); outline-offset: -2px; }

/* ---- Result card ---- */
.tas-result-card {
    margin-top: 18px;
    border: 1px solid #bfe0fa;
    background: linear-gradient(180deg, #eef7fe, #fff 70%);
    border-radius: 14px;
    padding: 18px 20px;
}
.tas-result-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.tas-result-label { font-weight: 700; font-size: 0.9rem; color: var(--tas-accent-dark); }
.tas-output {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.95rem; line-height: 1.55; color: #1f2937;
    background: #fff; border: 1px solid #d3e9fa; border-radius: 8px;
    padding: 12px 14px; word-break: break-word; min-height: 1.5em;
}
.tas-output.is-warn { border-color: #fcd34d; }
.tas-output-empty { color: #94a3b8; font-family: inherit; font-style: italic; }
.tas-actions { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.tas-open-btn { text-decoration: none; display: inline-flex; align-items: center; }
.tas-open-btn.is-disabled { opacity: 0.5; cursor: not-allowed; }
.tas-note { margin: 12px 0 0; font-size: 0.84rem; color: #64748b; }
.tas-note.is-warn { color: #b45309; }

/* ---- Operator cheat-sheet ---- */
.tas-ops { margin: 18px 0 4px; background: #fff; border: 1px solid var(--tas-border); border-radius: 14px; padding: 18px 20px 14px; scroll-margin-top: 16px; }
.tas-ops-title { margin: 0 0 6px; font-size: 1.05rem; font-weight: 700; color: #1f2937; }
.tas-ops-lead { margin: 0 0 12px; font-size: 0.9rem; color: #475569; }
.tas-ops-wrap { overflow-x: auto; }
.tas-ops-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; min-width: 640px; }
.tas-ops-table th, .tas-ops-table td { padding: 8px 10px; border-bottom: 1px solid #eef0f3; text-align: left; vertical-align: top; }
.tas-ops-table th { font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.04em; color: #64748b; }
.tas-ops-table tbody tr:last-child td { border-bottom: 0; }
.tas-ops-table tr:target td { background: var(--tas-accent-tint); }
.tas-ops-table code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.86em; white-space: nowrap; }
.tas-ops-table .tas-op { color: var(--tas-accent-dark); font-weight: 600; }
.tas-ops-status { color: #475569; font-size: 0.84rem; }
.tas-ops-table tr.is-dead td { color: #94a3b8; }
.tas-ops-table tr.is-dead .tas-op { color: #94a3b8; text-decoration: line-through; }
.tas-ops-table tr.is-dead .tas-ops-status { color: #b45309; }
.tas-ops-foot { margin: 10px 0 0; font-size: 0.82rem; color: #64748b; }

@media (max-width: 820px) {
    .tas-grid-4 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
    .tas-grid, .tas-grid-3, .tas-grid-4 { grid-template-columns: 1fr; }
    .tas-essentials .tas-field:nth-last-child(-n+3) { margin-bottom: 12px; }
    .tas-more-hint { display: none; }
    .tas-filter-checks { padding-top: 0; }
    .tas-select-sm { width: 100%; }
    .tas-actions .primary-btn, .tas-actions .ghost-btn { width: 100%; justify-content: center; }
    .tas-ops-table .tas-ops-example { display: none; }
    .tas-ops-table { min-width: 0; }
    .tas-ops-table code { white-space: normal; }
}
