/*
 * The job pages (the core portal) in the product's one visual system. Everything else (page head, cards,
 * tables, KPI tiles, the filter row, buttons, presets, the pager, blanks) comes from the product's own
 * stylesheets, which the page chrome links first (jobtrends/shell.py). This file only adds the marks the
 * activity pages do not have: a change (+12, coloured), a status tag, the strength bar, a change in hiring,
 * the bars of a breakdown, the posting diff, the long-text description and the owner's form pages.
 *
 * Rules (tests/test_portal_design.py): every selector starts with `.jts`, colours and sizes come from the
 * tokens (var(--…)), nothing is sticky, text wraps (no ellipsis, no line clamp).
 */

/* chart colours for jobtrends.js (it reads --jt-*): the product's chart tokens */
.jts {
  --jt-cat-1: var(--c-accent); --jt-cat-2: var(--c-neg); --jt-cat-3: var(--c-neutral); --jt-cat-4: var(--c-soft);
  --jt-cat-5: var(--c-ink-3); --jt-cat-6: var(--c-ink-2); --jt-accent: var(--c-accent); --jt-neutral: var(--c-neutral);
  --jt-up: var(--up); --jt-down: var(--down); --jt-text-2: var(--c-ink-2); --jt-grid: var(--c-grid);
  --jt-layer: var(--c-surface); --jt-font: var(--font);
}

/* page: one link above the title, actions under the notice, spacing between blocks */
.jts .jt-crumb { font-size: var(--fs-sm); margin-bottom: 4px; }
.jts .jt-crumb a { color: var(--text-3); font-weight: 600; text-decoration: none; }
.jts .jt-crumb a:hover { color: var(--accent-text); text-decoration: underline; }
.jts .jt-head-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.jts .jt-card, .jts .jt-sect { margin-bottom: var(--s4); }
.jts .jt-results { margin-bottom: var(--s4); }
.jts .jts-support { margin-bottom: var(--s4); }
.jts .jt-card-foot { margin-top: var(--s2); font-size: var(--fs-sm); }
.jts .jt-h3 { font-size: var(--fs-md); font-weight: 650; margin: var(--s3) 0 6px; }
.jts .jt-twrap { overflow-x: auto; }
.jts .jt-tall { max-height: 520px; overflow-y: auto; }
.jts .jts-table td { overflow-wrap: break-word; }
.jts .jt-sub-link { font-size: var(--fs-xs); margin-left: 4px; }
.jts .jt-csv { font-size: var(--fs-sm); font-weight: 600; }
.jts .jt-kpi-link { color: inherit; text-decoration: none; }
.jts .jt-kpi-link:hover { color: var(--accent-text); text-decoration: underline; }
.jts .jt-links li { font-size: var(--fs-md); }
.jts .jt-presets, .jts .jt-scope { margin: 0; align-items: center; }
.jts .jt-scope { margin-bottom: var(--s3); }
.jts .jts-presets { list-style: none; padding: 0; }
.jts .jts-preset .jts-tk { margin-left: 5px; }
.jts .jt-kw-detail { margin-top: var(--s3); }

/* filter row: the product's fields; Reset next to the button; a note under a field */
.jts .jt-filter .jts-sfield select[multiple] { height: auto; padding: 4px 6px; }
.jts .jt-filter .jts-morepanel .jts-sfield input, .jts .jt-filter .jts-morepanel .jts-sfield select { width: 100%; max-width: none; }
.jts .jt-filter .jts-morepanel .jts-sfield { display: grid; }
.jts .jt-reset { font-size: var(--fs-sm); font-weight: 600; color: var(--text-3); }
.jts .jt-field-note { flex-basis: 100%; color: var(--down-text); font-size: var(--fs-sm); margin: 0; }
.jts .jts-pager .jt-off { color: var(--text-4); }

/* a change: +12 (+4.5%); a blank percent is the product's pale dash (.jts-none) */
.jts .jt-chg { font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 600; }
.jts .jt-chg.is-up { color: var(--up-text); }
.jts .jt-chg.is-down { color: var(--down-text); }
.jts .jt-chg.is-flat { color: var(--text-3); }
.jts .jts-none[title] { cursor: help; }

/* status tags (Open, Closed, Read fine, Failed ...) */
.jts .jt-tags { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.jts .jt-tag { display: inline-block; padding: 0 7px; border-radius: 999px; font-size: var(--fs-xs); font-weight: 650; line-height: 20px; background: var(--raised); color: var(--text-2); }
.jts .jt-tag.is-ok { background: var(--accent-soft); color: var(--accent-text); }
.jts .jt-tag.is-accent, .jts .jt-tag.is-info { background: var(--up-soft); color: var(--up-text); }
.jts .jt-tag.is-warn, .jts .jt-tag.is-error { background: var(--down-soft); color: var(--down-text); }
.jts .jt-tag.is-error { font-weight: 750; }
.jts .jt-tag[title] { cursor: help; }

/* strength of a change, 0 to 100 */
.jts .jt-score { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-xs); color: var(--text-3); }
.jts .jt-score-bar { width: 48px; height: 6px; }
.jts .jt-score-track { fill: var(--line-soft); }
.jts .jt-score-fill { fill: var(--accent); }

/* a change in hiring (one stored signal) */
.jts .jt-changes { display: grid; gap: 0; }
.jts .jt-changes > li { border-top: 1px solid var(--line-soft); padding: 10px 0; }
.jts .jt-changes > li:first-child { border-top: 0; padding-top: 0; }
.jts .jt-change-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: var(--fs-sm); color: var(--text-3); }
.jts .jt-change-kind { font-weight: 650; color: var(--text-2); }
.jts .jt-change-title { font-size: var(--fs-md); font-weight: 650; margin: 2px 0; }
.jts .jt-change-links { display: flex; flex-wrap: wrap; gap: 2px 12px; font-size: var(--fs-sm); }
.jts .jt-change.is-dismissed { opacity: .6; }
.jts .jt-change-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.jts .jt-inline-form { display: inline; margin: 0; }

/* breakdown bars (open postings by role, place ...) */
.jts .jt-bars { display: grid; gap: 6px; }
.jts .jt-bars li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; font-size: var(--fs-sm); }
.jts .jt-bars-label { overflow-wrap: anywhere; }
.jts .jt-bars-value { text-align: right; font-variant-numeric: tabular-nums; }
.jts .jt-bars-bar { grid-column: 1 / -1; width: 100%; height: 4px; }
.jts .jt-bars-track { fill: var(--line-soft); }
.jts .jt-bars-fill { fill: var(--c-accent); }

/* charts drawn by jobtrends.js inside the product's chart box */
.jts .jt-chart-figure { margin: 0; }
.jts .jt-cbox-md { height: 240px; }
.jts .jt-cbox-sm { height: 160px; }

/* a posting: the description keeps its line breaks; the changes between versions */
.jts .jt-desc { white-space: pre-wrap; overflow-wrap: anywhere; font-size: var(--fs-md); line-height: 1.55; max-width: 90ch; }
.jts .jt-code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: var(--fs-xs); overflow-wrap: anywhere; white-space: pre-wrap; }
.jts .jt-diff-entry { border-top: 1px solid var(--line-soft); padding: var(--s3) 0; }
.jts .jt-diff { display: grid; gap: 2px; font-size: var(--fs-sm); }
.jts .jt-diff li { display: grid; grid-template-columns: 16px minmax(0, 1fr); white-space: pre-wrap; overflow-wrap: anywhere; }
.jts .jt-diff li.is-insert { background: var(--up-soft); }
.jts .jt-diff li.is-delete { background: var(--down-soft); }
.jts .jt-diff li.is-skip { color: var(--text-3); }
.jts .jt-diff-mark { color: var(--text-3); text-align: center; }
.jts .jt-del, .jts .jt-diff del { color: var(--down-text); }
.jts .jt-ins, .jts .jt-diff ins { color: var(--up-text); text-decoration: none; }

/* the owner's form pages (add a company, a theme): label over control, one column */
.jts .jt-form { display: grid; gap: var(--s3); max-width: 820px; }
.jts .jt-field { display: grid; gap: 4px; min-width: 0; border: 0; padding: 0; margin: 0; }
.jts .jt-field > label, .jts .jt-field__label { font-size: var(--fs-sm); font-weight: 650; color: var(--text-2); }
.jts .jt-field input[type="text"], .jts .jt-field input[type="url"], .jts .jt-field input[type="search"], .jts .jt-field input:not([type]),
.jts .jt-field select, .jts .jt-field textarea { width: 100%; max-width: 640px; min-height: 34px; padding: 6px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--card); color: var(--text); font: inherit; font-size: var(--fs-sm); }
.jts .jt-field textarea { min-height: 120px; }
.jts .jt-field__help { font-size: var(--fs-xs); color: var(--text-3); max-width: 90ch; }
.jts .jt-field__error { font-size: var(--fs-sm); color: var(--down-text); }
.jts .jt-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.jts .jt-checklist { max-height: 280px; overflow-y: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 6px 10px; background: var(--card); }
.jts .jt-checklist li, .jts .jt-choices li { padding: 2px 0; font-size: var(--fs-sm); }
.jts .jt-choices { display: grid; gap: 4px; }
.jts .jt-choice { display: grid; gap: 2px; }
.jts .jt-choice__extra { margin-left: 24px; }
.jts .jt-steps { list-style: decimal; padding-left: 20px; font-size: var(--fs-sm); color: var(--text-2); }
.jts .jt-stack { display: grid; gap: var(--s3); }
.jts .jt-busy { display: none; font-size: var(--fs-sm); color: var(--text-3); }
.jts .jt-busy.htmx-request { display: inline-flex; align-items: center; gap: 6px; }
.jts .jt-busy__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
