/* ---- lot N1: the economic calendar (cal.js): a tab of the bottom panel and one quiet line in the chart's bar ----
   No blue here (the order's key keeps the one blue of the screen), no green nor violet: the impact in warm marks, ember
   for high and gold for medium, always with its word. Hover only where a pointer hovers. */
.cal { --cal-high: var(--ind-3); --cal-medium: var(--ind-6); display: flex; flex-direction: column; min-height: 100%; font-size: var(--fs-s); }

/* the filters: impact (two keys) and the countries (one key each, pressed = shown) */
.cal-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 6px 14px; border-bottom: 1px solid var(--hair); }
.cal-seg .seg-b { min-height: 24px; padding: 0 8px; font-size: 11.5px; }
.cal-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.cal-chip { min-width: 30px; height: 24px; padding: 0 6px; border: 0; border-radius: var(--r-sm); background: none; box-shadow: inset 0 0 0 1px var(--hair);
  color: var(--dim); font-size: 11px; cursor: pointer; transition: color var(--t-fast) var(--ease), background var(--t-fast) var(--ease); }
.cal-chip[aria-pressed="true"] { background: var(--surface-4); box-shadow: inset 0 0 0 1px var(--hair-2); color: var(--text); }
.cal-chip:focus-visible, .cal a:focus-visible, .cal-next:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }

/* the days and their events: time (UTC) and countdown, country, name and source, impact */
.cal-note { margin: 0; padding: 6px 14px; color: var(--mute); font-size: var(--fs-s); line-height: 1.45; }
.cal-note[data-tone="warn"] { color: var(--warn); }
.cal-days, .cal-ev { margin: 0; padding: 0; list-style: none; }
.cal-dh { position: sticky; top: 0; z-index: 1; margin: 0; padding: 5px 14px; background: var(--surface); color: var(--dim); font-size: var(--fs-xs);
  font-weight: 600; letter-spacing: 0.02em; }
.cal-e { display: grid; grid-template-columns: minmax(46px, auto) 30px minmax(0, 1fr) auto; column-gap: 10px; align-items: baseline; padding: 6px 14px;
  border-top: 1px solid var(--hair); color: var(--mute); }
.cal-t { color: var(--text); white-space: nowrap; }
.cal-unk { color: var(--dim); font-size: var(--fs-xs); white-space: normal; max-width: 9ch; line-height: 1.25; }
.cal-c { color: var(--dim); font-size: var(--fs-xs); }
.cal-n { min-width: 0; overflow-wrap: anywhere; }
.cal-name { color: var(--text); font-weight: 600; text-decoration: none; }
.cal-cd { margin-inline-start: 8px; color: var(--dim); font-size: var(--fs-xs); white-space: nowrap; }
.cal-i { display: inline-flex; align-items: center; gap: 5px; color: var(--dim); font-size: var(--fs-xs); white-space: nowrap; }
.cal-i .cal-dot { width: 7px; height: 7px; border-radius: 2px; background: var(--cal-medium); }
.cal-i[data-impact="high"] .cal-dot { width: 9px; height: 9px; background: var(--cal-high); }
.cal-i[data-impact="high"] { color: var(--silver); }
.cal-x { grid-column: 3 / -1; display: flex; flex-wrap: wrap; gap: 2px 12px; margin-top: 2px; color: var(--dim); font-size: var(--fs-xs); }
.cal-fig b { color: var(--mute); font-weight: 500; }
.cal-src a, .cal-foot a { color: var(--mute); text-decoration: underline; text-decoration-color: var(--hair-3); text-underline-offset: 2px; }
.cal-none { margin: 12px auto; }
.cal-foot { margin: auto 0 0; padding: 8px 14px 10px; border-top: 1px solid var(--hair); color: var(--dim); font-size: var(--fs-xs); line-height: 1.5; }
@media (hover: hover) {
  .cal-chip:hover { color: var(--text); }
  .cal-name:hover, .cal-src a:hover, .cal-foot a:hover { color: var(--text); text-decoration-color: currentColor; }
  .cal-next:hover { color: var(--text); }
}

/* in Arabic the calendar reads right to left (lot R1's way); its times, codes and figures stay left to right */
:root[lang="ar"] .cal { direction: rtl; }
:root[lang="ar"] .cal :is(.num, .cal-t, .cal-c, .cal-fig b) { direction: ltr; unicode-bidi: isolate; }
:root[lang="ar"] .cal :is(.cal-name, .cal-src, .cal-note, .cal-foot, .cal-dh) { unicode-bidi: plaintext; }

/* the line in the chart's bar: it takes only the room the bar's keys leave (never a key moved, never a row added) */
.cal-next { flex: 1 1 0; min-width: 0; height: 24px; padding: 0 2px; border: 0; background: none; color: var(--mute); font: inherit; font-size: var(--fs-xs);
  text-align: end; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.cal-next[hidden] { display: none; }
.cal-next[data-cut="1"] { visibility: hidden; }
:root[lang="ar"] .cal-next { unicode-bidi: plaintext; }
/* not where the bar is a column or a scrolled row: the focus's column and rail (G2c), a phone (the tab says it there) */
.term[data-fkeys] .cal-next, .term[data-form="phone"] .cal-next { display: none; }

/* a phone: the panel under Positions; keys a thumb can press */
.term[data-form="phone"] .cal-bar { padding: 6px 10px; }
.term[data-form="phone"] :is(.cal-chip, .cal-seg .seg-b) { min-height: 44px; min-width: 44px; }
.term[data-form="phone"] .cal-e { grid-template-columns: minmax(42px, auto) 26px minmax(0, 1fr) auto; column-gap: 8px; padding: 8px 10px; }
.term[data-form="phone"] .cal-dh, .term[data-form="phone"] .cal-note, .term[data-form="phone"] .cal-foot { padding-inline: 10px; }
