/* Nawaa tool UI · Trend radar & occasions (v3/nawaa-tools-ui/trends.js). Builds on nawaa-tools.css (.nt-trend, .nt-col, .nt-ride, .nt-fit…).
   Logical properties only, so Arabic mirrors itself. Fit colours: good #34d399, stretch #f5b041, avoid #f87171. */
.nt-radar-bar { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: flex-end; }
.nt-radar-bar .nt-today { flex: 1 1 320px; min-width: 0; }
.nt-radar-bar > .nt-field { flex: 0 1 260px; min-width: 200px; }
.nt-geo { padding-block: 8px; }
.nt-radar-tabs { display: none; }
.nt-form:has(#nt-trends) { border-bottom: 0; padding-bottom: 0; }
/* kit fix, scoped to this tool (reported): a History row is a grid item, so without min-width: 0 a long title widens it past the panel at 390 px */
#tools[data-tool="trends"] .nt-history-list > .nt-hrow { min-width: 0; } /* the radar is the whole panel: one separator (the History's) is enough */

/* the brand-fit bar above the trend list */
.nt-fitbar { display: grid; gap: 8px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: linear-gradient(135deg, rgba(52,211,153,.06), rgba(139,92,246,.06)); }
.nt-fitbar > .nt-hint { margin: 0; }
.nt-fit-run { justify-self: start; }
.nt-fit-sum { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; }
.nt-fitchip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; color: var(--fc, var(--muted)); background: color-mix(in srgb, var(--fc, #8b8b9a) 14%, transparent); border: 1px solid color-mix(in srgb, var(--fc, #8b8b9a) 35%, transparent); white-space: nowrap; }
.nt-fitchip i { width: 7px; height: 7px; border-radius: 50%; background: var(--fc, #8b8b9a); flex: none; }
.nt-fitchip.good { --fc: #34d399; } .nt-fitchip.stretch { --fc: #f5b041; } .nt-fitchip.avoid { --fc: #f87171; } .nt-fitchip.none { --fc: #8b8b9a; }
.nt-fitbar .nt-tip { margin: 0; overflow-wrap: anywhere; }
.nt-fit-ctl { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.nt-fit-ctl > .nt-field { gap: 4px; }
.nt-fitbar .nt-res-foot { gap: 6px; }
.nt-rescore { margin-inline-start: auto; }
.nt-trend.fit-good { border-inline-start: 3px solid #34d399; } .nt-trend.fit-stretch { border-inline-start: 3px solid #f5b041; } .nt-trend.fit-avoid { border-inline-start: 3px solid #f87171; }
.nt-trend.fit-avoid .nt-trend-title strong { color: var(--muted); }
.nt-fitrow { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.nt-safety { font-size: 11.5px; color: #fca5a5; }
.nt-rule { font-size: 11px; color: var(--dim); padding: 1px 8px; border-radius: 999px; border: 1px dashed rgba(248,113,113,.45); }
.nt-angle { margin: 0; font-size: 13px; line-height: 1.55; color: var(--ink); overflow-wrap: anywhere; }
.nt-fit-gone { font-size: 12px; }
.nt-fit-gone li { margin-block: 2px; }

/* the occasions column: filters, horizon, export */
.nt-occ-ctl { display: grid; gap: 8px; }
.nt-occ-exp { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.nt-horizon { width: auto; min-width: 150px; padding: 6px 10px; font-size: 12px; border-radius: 999px; }
.nt-occ-exp .ghost { padding: 6px 11px; font-size: 11.5px; }
.nt-cats .nw-chip { padding: 6px 10px; }
.nt-tags-row { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 3px; }
.nt-cat { display: inline-flex; align-items: center; padding: 1px 8px; border-radius: 999px; font-size: 10.5px; line-height: 1.6; color: var(--cc, var(--muted)); border: 1px solid color-mix(in srgb, var(--cc, #8b8b9a) 40%, transparent); background: color-mix(in srgb, var(--cc, #8b8b9a) 10%, transparent); white-space: nowrap; }
.nt-cat.national { --cc: #34d399; } .nt-cat.religious { --cc: #c4b5fd; } .nt-cat.retail { --cc: #f472b6; } .nt-cat.global { --cc: #67e8f9; } .nt-cat.seasons { --cc: #fbbf24; } .nt-cat.custom { --cc: #a5b4fc; }
.nt-cat.approx { border-style: dashed; --cc: #fde68a; } .nt-cat.basis { --cc: #a5b4fc; } .nt-cat.geo { --cc: #e5e7eb; }
.nt-prep { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; font-size: 12px; color: var(--muted); }
.nt-prep > span { min-width: 0; }
.nt-prep small { color: var(--dim); font-size: 11px; }
.nt-prep-bar { position: relative; flex: 1 1 70px; min-width: 60px; max-width: 160px; height: 4px; border-radius: 4px; background: rgba(255,255,255,.08); overflow: hidden; }
.nt-prep-bar b { position: absolute; inset-block: 0; inset-inline-start: 0; border-radius: inherit; background: linear-gradient(90deg, #8b5cf6, #22d3ee); }
[dir="rtl"] .nt-prep-bar b { background: linear-gradient(270deg, #8b5cf6, #22d3ee); }
.nt-occ.prep { border-color: rgba(34,211,238,.35); }
.nt-occ.prep .nt-prep > span { color: #a5f3fc; font-weight: 600; }
.nt-occ.prep .nt-days { color: #cffafe; background: rgba(34,211,238,.16); border-color: rgba(34,211,238,.45); }
.nt-occ.now .nt-prep > span { color: #a7f3d0; font-weight: 600; }
.nt-occ .nt-hint { margin: 0; }
.nt-occ-basis { font-size: 11.5px; }
.nt-occ-note { font-style: italic; }
.nt-more { justify-self: center; padding: 7px 14px; font-size: 12px; }

/* the countdown: the form inside an occasion card, then the dated plan full width below both columns (in the occasions tab below 1100 px) */
.nt-cd { display: grid; gap: 10px; }
.nt-cd:empty, .nt-cd-wide:empty { display: none; }
.nt-cd-wide { margin-top: 16px; scroll-margin-top: 12px; }
.nt-cd-main { padding: 14px; border-radius: 14px; border: 1px solid rgba(139,92,246,.35); background: rgba(139,92,246,.05); scroll-margin-top: 12px; animation: panelIn .25s var(--ease) both; }
.nt-cd-close { margin-inline-start: auto; }
.nt-cd-form { display: grid; gap: 10px; padding: 12px; border-radius: 12px; border: 1px dashed var(--line-2); background: rgba(255,255,255,.02); animation: panelIn .25s var(--ease) both; }
.nt-cd-plats .nw-chip[aria-pressed="true"] { color: #fff; border-color: rgba(34,211,238,.7); background: linear-gradient(180deg, rgba(34,211,238,.22), rgba(99,102,241,.14)); box-shadow: 0 0 12px rgba(34,211,238,.18); }
.nt-cd-plats .nw-chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--pc, #8b5cf6); flex: none; }
.nt-cd-run { justify-self: start; }
.nt-cd.nt-ride-history { padding: 14px; border-radius: 14px; border: 1px solid rgba(139,92,246,.35); background: rgba(139,92,246,.06); }
.nt-cd-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.nt-cd-titles { display: grid; gap: 2px; min-width: 0; }
.nt-cd-titles strong { font-family: var(--display); font-size: 14.5px; }
.nt-cd-titles small { color: var(--dim); font-size: 11.5px; }
.nt-cd-theme { margin: 0; font-size: 13px; color: #c4b5fd; line-height: 1.55; }
.nt-cd-pick { max-width: 360px; }
.nt-cd-pick .nt-hint { margin: 4px 0 0; }
.nt-cd-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.nt-cd-post { display: grid; grid-template-columns: 86px minmax(0, 1fr); gap: 10px; align-items: start; }
.nt-cd-post.past { opacity: .5; }
.nt-cd-when { position: sticky; top: 8px; display: grid; gap: 2px; justify-items: center; text-align: center; padding: 8px 4px; border-radius: 12px; background: rgba(139,92,246,.12); border: 1px solid rgba(139,92,246,.3); }
.nt-cd-when strong { font-family: var(--mono); font-size: 13px; color: #e9d5ff; }
.nt-cd-when small { color: var(--dim); font-size: 10.5px; line-height: 1.3; }
[dir="rtl"] .nt-cd-when strong { font-family: var(--arabic); font-size: 12px; }
.nt-cd-body { display: grid; gap: 6px; min-width: 0; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); border-top: 3px solid var(--pc, #8b5cf6); background: rgba(10,10,16,.45); }
.nt-cd-body .nt-text { font-size: 13.5px; }
.nt-cd-capwrap { display: grid; gap: 2px; }
.nt-cd-vis { background: rgba(250,204,21,.14); color: inherit; border-radius: 3px; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.nt-cd-rest { color: var(--muted); }
.nt-cd-more { margin: 0; }
.nt-cd-line { margin: 0; display: flex; flex-wrap: wrap; gap: 2px 8px; align-items: baseline; font-size: 13px; line-height: 1.5; }
.nt-cd-line small { color: var(--dim); font-size: 11px; }
.nt-cd-line strong, .nt-cd-line span { overflow-wrap: anywhere; min-width: 0; }
.nt-cd-cta span { color: #e9d5ff; font-weight: 600; }
.nt-hint.warn { color: #fcd34d; }
.nt-cd-fixed { color: #fca5a5; font-size: 11px; }
.nt-cd-tags { margin: 0; display: flex; flex-wrap: wrap; gap: 2px 8px; font-size: 12.5px; color: #a5f3fc; }
.nt-cd-tags bdi { overflow-wrap: anywhere; }
.nt-cd-brief { display: grid; gap: 1px; font-size: 12px; color: var(--dim); line-height: 1.5; }
.nt-cd-brief strong { color: var(--muted); font-weight: 600; font-size: 11px; }
.nt-cd-brief span { text-align: left; overflow-wrap: anywhere; }
.nt-cd-bar { gap: 8px; }
.nt-cd-prog { font-size: 12px; color: var(--muted); }

@media (min-width: 1101px) {
  .nt-cd-main .nt-cd-list, .nt-cd.nt-ride-history .nt-cd-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1100px) {
  .nt-radar-tabs { display: flex; }
  .nt-trends[data-tab="trends"] .nt-col-occ, .nt-trends[data-tab="occasions"] .nt-col-trends, .nt-trends[data-tab="trends"] .nt-cd-wide { display: none; }
}
@media (max-width: 480px) {
  .nt-radar-bar > .nt-field { flex: 1 1 100%; }
  .nt-cd-post { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .nt-cd-when { position: static; display: flex; justify-content: flex-start; gap: 8px; padding: 6px 10px; justify-items: start; }
  .nt-fit-ctl .nt-seg .nw-chip, .nt-cats .nw-chip { padding: 6px 9px; font-size: 11.5px; }
  .nt-rescore { margin-inline-start: 0; }
  .nt-horizon { flex: 1 1 100%; }
}
@media (prefers-reduced-motion: reduce) { .nt-cd-form, .nt-cd-main { animation: none !important; } }
