/**
 * Findex News Runtime Pro — Economic Calendar v2 styles
 * ────────────────────────────────────────────────────────────────────────────
 * Reuses the plugin's existing :root design tokens (--bg, --surface, --accent,
 * --up, --down, --warn, --text, --border …) so it matches the site with zero
 * extra theming. Everything is namespaced .fn-ec2-* to avoid colliding with the
 * old .fn-econ-* rules, which can be left in place or deleted.
 *
 * The heatmap colours intentionally match the original (blue/amber/red) so the
 * view you liked looks identical.
 */

/* fallback tokens in case the module is loaded without frontend.css */
.fn-ec2-strip, .fn-ec2-overlay {
  --ec2-accent: var(--accent, #4dd4ac);
  --ec2-bg:      var(--bg, #0a0e15);
  --ec2-surface: var(--surface, #121823);
  --ec2-surface2:var(--surface-2, #1a2030);
  --ec2-border:  var(--border, rgba(255,255,255,.06));
  --ec2-border2: var(--border-2, rgba(255,255,255,.10));
  --ec2-text:    var(--text, #e3e9f2);
  --ec2-text2:   var(--text-2, #b3bdce);
  --ec2-muted:   var(--muted, #8c98ad);
  --ec2-high:    var(--down, #f87171);
  --ec2-med:     var(--warn, #fbbf24);
  --ec2-low:     #4493f8;
  --ec2-up:      var(--up, #4ade80);
  --ec2-down:    var(--down, #f87171);
  --ec2-mono:    var(--mono, 'JetBrains Mono', ui-monospace, monospace);
  --ec2-font:    var(--sans, 'Inter', system-ui, sans-serif);
}
.fn-ec2-overlay[dir="rtl"], .fn-ec2-strip[dir="rtl"] { --ec2-font: var(--sans-ar, 'IBM Plex Sans Arabic', system-ui, sans-serif); }

/* ════════════════════════════ STRIP (compact, clean) ════════════════════════════ */
.fn-ec2-strip {
  display: flex; align-items: stretch; gap: 12px; padding: 12px 14px; margin: 8px 0;
  background: linear-gradient(180deg, var(--ec2-bg2, #0e1320), var(--ec2-bg));
  border: 1px solid var(--ec2-border); border-radius: 12px;
  font-family: var(--ec2-font); color: var(--ec2-text);
  box-shadow: 0 1px 0 rgba(255,255,255,.02) inset, 0 16px 40px -28px rgba(0,0,0,.8);
}
@keyframes fn-ec2-pulse { 0%{box-shadow:0 0 0 0 rgba(77,212,172,.45);} 70%{box-shadow:0 0 0 6px rgba(77,212,172,0);} 100%{box-shadow:0 0 0 0 rgba(77,212,172,0);} }

/* Identity + weekly digest */
.fn-ec2-id { display: flex; flex-direction: column; justify-content: center; gap: 5px;
  min-width: 248px; padding-inline-end: 14px; border-inline-end: 1px solid var(--ec2-border); }
.fn-ec2-id-top { display: flex; align-items: center; gap: 9px; }
.fn-ec2-glyph { width: 28px; height: 28px; border-radius: 8px; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(180deg, rgba(77,212,172,.16), rgba(77,212,172,.05)); border: 1px solid rgba(77,212,172,.22); color: var(--ec2-accent); }
.fn-ec2-name { font-size: 13px; font-weight: 600; letter-spacing: .2px; }
.fn-ec2-live { width: 6px; height: 6px; border-radius: 50%; background: var(--ec2-accent);
  box-shadow: 0 0 0 0 rgba(77,212,172,.5); animation: fn-ec2-pulse 2.6s infinite; margin-inline-start: 2px; }
.fn-ec2-summary { font-size: 11.5px; color: var(--ec2-text2); line-height: 1.4; }
.fn-ec2-summary .hi { color: var(--ec2-high); font-weight: 600; }
.fn-ec2-summary .k  { color: var(--ec2-text); font-weight: 500; }

/* Day rail — individual rounded cards, intensity by background weight (no bars) */
.fn-ec2-rail { display: flex; gap: 7px; flex: 1; min-width: 0; }
.fn-ec2-day {
  position: relative; flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  padding: 8px 6px; background: var(--ec2-surface); border: 1px solid var(--ec2-border); border-radius: 9px; cursor: pointer;
  transition: transform .16s ease, border-color .16s ease, background .16s ease, opacity .16s ease; color: var(--ec2-text2);
}
.fn-ec2-day:hover { transform: translateY(-1px); border-color: var(--ec2-border2); }
.fn-ec2-day.is-skel { opacity: .4; pointer-events: none; }
.fn-ec2-day-dow { font-size: 9px; font-weight: 600; letter-spacing: 1.3px; color: var(--ec2-muted); text-transform: uppercase; }
.fn-ec2-day-num { font-size: 19px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--ec2-text2); line-height: 1.05; }
.fn-ec2-day-cnt { font-size: 10px; font-family: var(--ec2-mono); color: var(--ec2-muted2, var(--ec2-muted)); display: flex; align-items: center; gap: 5px; white-space: nowrap; }
.fn-ec2-day-cnt .hi { color: var(--ec2-high); font-weight: 600; display: inline-flex; align-items: center; gap: 3px; }
.fn-ec2-day-cnt .hi .dot { width: 5px; height: 5px; border-radius: 50%; background: var(--ec2-high); }
.fn-ec2-day.heavy { background: linear-gradient(180deg, rgba(255,255,255,.035), var(--ec2-surface)); }
.fn-ec2-day.quiet { opacity: .66; }
.fn-ec2-day.quiet:hover { opacity: 1; }
.fn-ec2-day.today { border-color: rgba(77,212,172,.4); background: linear-gradient(180deg, rgba(77,212,172,.08), var(--ec2-surface)); }
.fn-ec2-day.today .fn-ec2-day-num { color: var(--ec2-accent); }
.fn-ec2-day.today .fn-ec2-day-dow { color: var(--ec2-accent-2, var(--ec2-accent)); }

/* Focal point: next event + open CTA */
.fn-ec2-focus { display: flex; align-items: center; gap: 12px; padding-inline-start: 14px; border-inline-start: 1px solid var(--ec2-border); }
.fn-ec2-nx { display: flex; flex-direction: column; gap: 3px; min-width: 150px; cursor: pointer; }
.fn-ec2-nx-top { display: flex; align-items: center; gap: 7px; }
.fn-ec2-nx-badge { font-size: 8.5px; font-weight: 700; letter-spacing: 1px; color: var(--ec2-accent); text-transform: uppercase; }
.fn-ec2-nx-cur { font-size: 10px; font-family: var(--ec2-mono); font-weight: 700; padding: 2px 6px; background: var(--ec2-surface2); border-radius: 4px; }
.fn-ec2-nx-imp { font-size: 8.5px; font-weight: 700; display: flex; align-items: center; gap: 3px; text-transform: uppercase; color: var(--ec2-muted); }
.fn-ec2-nx-imp .d { width: 4px; height: 4px; border-radius: 50%; background: var(--ec2-muted); }
.fn-ec2-nx-imp--high { color: var(--ec2-high); } .fn-ec2-nx-imp--high .d { background: var(--ec2-high); }
.fn-ec2-nx-imp--medium { color: var(--ec2-med); } .fn-ec2-nx-imp--medium .d { background: var(--ec2-med); }
.fn-ec2-nx-imp--low { color: var(--ec2-low); } .fn-ec2-nx-imp--low .d { background: var(--ec2-low); }
.fn-ec2-nx-evt { font-size: 12.5px; color: var(--ec2-text); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 200px; }
.fn-ec2-nx-cd { font-family: var(--ec2-mono); font-size: 12px; color: var(--ec2-accent); display: flex; align-items: center; gap: 5px; }
.fn-ec2-nx-cd .d { width: 5px; height: 5px; border-radius: 50%; background: var(--ec2-accent); }
.fn-ec2-nx-cd.is-live { color: var(--ec2-high); font-weight: 600; }
.fn-ec2-nx-cd.is-live .d { background: var(--ec2-high); }
.fn-ec2-open {
  display: inline-flex; align-items: center; gap: 6px; padding: 9px 16px; background: transparent; color: var(--ec2-accent);
  border: 1px solid rgba(77,212,172,.42); border-radius: 9px; font-family: var(--ec2-font); font-size: 12px; font-weight: 600; cursor: pointer; transition: .16s; white-space: nowrap;
}
.fn-ec2-open:hover { background: var(--ec2-accent); color: #04130d; }
.fn-ec2-open svg { transition: transform .16s; }
.fn-ec2-open:hover svg { transform: translateX(2px); }
.fn-ec2-strip[dir="rtl"] .fn-ec2-open:hover svg { transform: translateX(-2px); }

/* Responsive strip */
@media (max-width: 980px) {
  .fn-ec2-strip { flex-wrap: wrap; }
  .fn-ec2-id { min-width: 100%; border-inline-end: 0; border-bottom: 1px solid var(--ec2-border); padding-inline-end: 0; padding-bottom: 10px; }
  .fn-ec2-rail { order: 3; flex-basis: 100%; }
  .fn-ec2-focus { min-width: 100%; order: 2; border-inline-start: 0; border-bottom: 1px solid var(--ec2-border); padding-inline-start: 0; padding-bottom: 10px; justify-content: space-between; }
}


/* ════════════════════════════ MODAL ════════════════════════════ */
.fn-ec2-overlay {
  position: fixed; inset: 0; z-index: 100000; display: flex; align-items: center; justify-content: center;
  background: rgba(4,7,12,.66); backdrop-filter: blur(6px); padding: 20px;
  opacity: 0; transition: opacity .2s ease; font-family: var(--ec2-font);
}
.fn-ec2-overlay.is-open { opacity: 1; }
.fn-ec2-sheet {
  width: 100%; max-width: 1080px; height: 86vh; max-height: 880px; display: flex; flex-direction: column;
  background: var(--ec2-bg); border: 1px solid var(--ec2-border2); border-radius: 14px; overflow: hidden;
  box-shadow: 0 30px 80px rgba(0,0,0,.5); transform: translateY(10px) scale(.99); transition: transform .22s ease; color: var(--ec2-text);
}
.fn-ec2-overlay.is-open .fn-ec2-sheet { transform: none; }

.fn-ec2-hd { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--ec2-border); }
.fn-ec2-hd-title { font-size: 15px; font-weight: 700; display: flex; align-items: center; }
.fn-ec2-hd-mark { color: var(--ec2-accent); margin-inline-end: 2px; }
.fn-ec2-views { display: flex; gap: 4px; margin-inline-start: 8px; background: var(--ec2-surface); padding: 3px; border-radius: 9px; }
.fn-ec2-view-btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border: 0; border-radius: 7px;
  background: transparent; color: var(--ec2-muted); font-family: var(--ec2-font); font-size: 12px; font-weight: 500; cursor: pointer; transition: .15s;
}
.fn-ec2-view-btn:hover { color: var(--ec2-text2); }
.fn-ec2-view-btn.is-active { background: var(--ec2-surface2); color: var(--ec2-text); }
.fn-ec2-view-ic { display: inline-flex; }
.fn-ec2-refresh, .fn-ec2-close {
  margin-inline-start: auto; width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center;
  background: var(--ec2-surface); border: 1px solid var(--ec2-border); border-radius: 8px; color: var(--ec2-text2); cursor: pointer; transition: .15s;
}
.fn-ec2-close { margin-inline-start: 0; font-size: 20px; line-height: 1; }
.fn-ec2-refresh:hover, .fn-ec2-close:hover { border-color: var(--ec2-border2); color: var(--ec2-text); }
.fn-ec2-refresh:active svg { animation: fn-ec2-spin .5s ease; }
@keyframes fn-ec2-spin { to { transform: rotate(360deg); } }

/* Filters */
.fn-ec2-filters { padding: 12px 16px; border-bottom: 1px solid var(--ec2-border); display: flex; flex-direction: column; gap: 10px; }
.fn-ec2-frow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.fn-ec2-search {
  flex: 1; min-width: 180px; padding: 9px 12px; background: var(--ec2-surface); border: 1px solid var(--ec2-border);
  border-radius: 8px; color: var(--ec2-text); font-family: var(--ec2-font); font-size: 13px;
}
.fn-ec2-search:focus { outline: none; border-color: var(--ec2-accent); }
.fn-ec2-chips { display: flex; gap: 5px; }
.fn-ec2-chip {
  padding: 7px 12px; background: var(--ec2-surface); border: 1px solid var(--ec2-border); border-radius: 7px;
  color: var(--ec2-text2); font-family: var(--ec2-font); font-size: 12px; cursor: pointer; transition: .15s; white-space: nowrap;
}
.fn-ec2-chip:hover { border-color: var(--ec2-border2); }
.fn-ec2-chip.is-active { background: var(--ec2-accent); color: #04130d; border-color: var(--ec2-accent); font-weight: 600; }
.fn-ec2-chip--high.is-active { background: var(--ec2-high); border-color: var(--ec2-high); color: #1a0506; }
.fn-ec2-chip--medium.is-active { background: var(--ec2-med); border-color: var(--ec2-med); color: #1c1402; }
.fn-ec2-tz {
  padding: 8px 10px; background: var(--ec2-surface); border: 1px solid var(--ec2-border); border-radius: 8px;
  color: var(--ec2-text2); font-family: var(--ec2-font); font-size: 12px; cursor: pointer; margin-inline-start: auto;
}
.fn-ec2-frow--cur { gap: 5px; }
.fn-ec2-cur {
  padding: 6px 11px; background: var(--ec2-surface); border: 1px solid var(--ec2-border); border-radius: 20px;
  color: var(--ec2-text2); font-family: var(--ec2-mono); font-size: 11px; font-weight: 600; cursor: pointer; transition: .15s; letter-spacing: .3px;
}
.fn-ec2-cur:hover { border-color: var(--ec2-border2); }
.fn-ec2-cur.is-active { background: var(--ec2-accent); color: #04130d; border-color: var(--ec2-accent); }

/* Reset filters (v11.29.0) */
.fn-ec2-frow--reset { justify-content: flex-end; }
.fn-ec2-reset {
  padding: 6px 14px; background: transparent; border: 1px solid var(--ec2-border);
  border-radius: 20px; color: var(--ec2-text2); font-family: var(--ec2-mono);
  font-size: 11px; font-weight: 600; cursor: pointer; transition: .15s; letter-spacing: .3px;
}
.fn-ec2-reset:hover { border-color: var(--ec2-border2); color: var(--ec2-text); }

/* Body layout */
.fn-ec2-bodywrap { flex: 1; display: flex; min-height: 0; }
.fn-ec2-list { flex: 1; overflow-y: auto; padding: 8px 10px 24px; scroll-behavior: smooth; }
.fn-ec2-list.is-heatmap { padding: 18px; }
.fn-ec2-side {
  width: 220px; flex-shrink: 0; border-inline-start: 1px solid var(--ec2-border); padding: 16px; overflow-y: auto;
  background: linear-gradient(180deg, var(--ec2-bg), var(--ec2-surface));
}
.fn-ec2-side-title { font-size: 12px; font-weight: 700; margin-bottom: 3px; }
.fn-ec2-side-sub { font-size: 10px; color: var(--ec2-muted); margin-bottom: 14px; line-height: 1.4; }
.fn-ec2-side-empty { font-size: 11px; color: var(--ec2-muted); }
.fn-ec2-str-row { display: flex; align-items: center; gap: 8px; margin-bottom: 9px; }
.fn-ec2-str-code { width: 34px; font-family: var(--ec2-mono); font-size: 11px; font-weight: 600; }
.fn-ec2-str-bar { flex: 1; height: 6px; background: rgba(255,255,255,.05); border-radius: 4px; overflow: hidden; }
.fn-ec2-str-fill { height: 100%; background: linear-gradient(90deg, var(--ec2-accent), var(--ec2-low)); border-radius: 4px; transition: width .3s; }
.fn-ec2-str-num { width: 18px; text-align: end; font-family: var(--ec2-mono); font-size: 11px; color: var(--ec2-muted); }

/* Day groups + rows */
.fn-ec2-day-hd { display: flex; align-items: center; justify-content: space-between; padding: 12px 8px 7px; position: sticky; top: -8px; background: var(--ec2-bg); z-index: 2; }
.fn-ec2-day.is-today .fn-ec2-day-label { color: var(--ec2-accent); }
.fn-ec2-day-label { font-size: 12px; font-weight: 600; color: var(--ec2-text2); }
.fn-ec2-day-count { font-size: 10px; color: var(--ec2-muted); background: var(--ec2-surface); padding: 2px 8px; border-radius: 10px; font-family: var(--ec2-mono); }

.fn-ec2-row { background: var(--ec2-surface); border: 1px solid var(--ec2-border); border-radius: 9px; margin-bottom: 5px; overflow: hidden; transition: border-color .15s; }
.fn-ec2-row:hover { border-color: var(--ec2-border2); }
.fn-ec2-row-head { display: grid; grid-template-columns: 28px 52px 46px 1fr auto 8px 26px; align-items: center; gap: 8px; padding: 10px 10px; cursor: pointer; }
.fn-ec2-star { background: none; border: 0; color: var(--ec2-muted); font-size: 15px; cursor: pointer; padding: 0; line-height: 1; }
.fn-ec2-star.is-starred { color: var(--ec2-med); }
.fn-ec2-row-time { font-family: var(--ec2-mono); font-size: 12px; color: var(--ec2-text2); }
.fn-ec2-cc { font-family: var(--ec2-mono); font-size: 11px; font-weight: 700; padding: 3px 7px; background: var(--ec2-surface2); border-radius: 5px; letter-spacing: .3px; }
.fn-ec2-row-name { font-size: 13px; font-weight: 500; line-height: 1.25; }
.fn-ec2-row-country { font-size: 10px; color: var(--ec2-muted); margin-top: 1px; }
.fn-ec2-row-vals { display: flex; gap: 14px; }
.fn-ec2-val { text-align: center; min-width: 44px; }
.fn-ec2-val-lbl { font-size: 8px; color: var(--ec2-muted); text-transform: uppercase; letter-spacing: .4px; }
.fn-ec2-val-num { font-family: var(--ec2-mono); font-size: 12px; font-weight: 600; color: var(--ec2-text2); margin-top: 1px; }
.fn-ec2-val-num.is-released { color: var(--ec2-accent); }
.fn-ec2-val-num.is-pending { color: var(--ec2-muted); }
.fn-ec2-row-imp { width: 8px; height: 8px; border-radius: 50%; }
.fn-ec2-row-imp.high { background: var(--ec2-high); }
.fn-ec2-row-imp.medium { background: var(--ec2-med); }
.fn-ec2-row-imp.low { background: var(--ec2-low); }
.fn-ec2-expand { background: none; border: 0; color: var(--ec2-muted); cursor: pointer; padding: 4px; transition: transform .2s; display: inline-flex; }
.fn-ec2-row.is-expanded .fn-ec2-expand { transform: rotate(180deg); }
.fn-ec2-row--high { border-inline-start: 2px solid var(--ec2-high); }
.fn-ec2-row--medium { border-inline-start: 2px solid var(--ec2-med); }

/* Detail */
.fn-ec2-row-detail:not(:empty) { padding: 0 12px 12px; border-top: 1px solid var(--ec2-border); margin-top: 2px; }
.fn-ec2-edu { font-size: 12px; color: var(--ec2-text2); line-height: 1.55; padding: 10px 0; }
.fn-ec2-affected-lbl { font-size: 10px; color: var(--ec2-muted); text-transform: uppercase; letter-spacing: .4px; margin-bottom: 6px; }
.fn-ec2-pairs { display: flex; flex-wrap: wrap; gap: 6px; }
.fn-ec2-pair { display: inline-flex; align-items: center; gap: 6px; padding: 5px 9px; background: var(--ec2-surface2); border-radius: 7px; }
.fn-ec2-pair-name { font-family: var(--ec2-mono); font-size: 11px; font-weight: 600; }
.fn-ec2-pair-bias.up { color: var(--up, #4ade80); }
.fn-ec2-pair-bias.down { color: var(--ec2-high); }
.fn-ec2-pair-vol { width: 40px; height: 4px; background: rgba(255,255,255,.07); border-radius: 3px; overflow: hidden; }
.fn-ec2-pair-vol > span { display: block; height: 100%; background: var(--ec2-med); }
.fn-ec2-bias { margin-top: 10px; font-size: 11px; padding: 6px 10px; border-radius: 7px; display: inline-block; }
.fn-ec2-bias--bullish_on_beat { background: rgba(74,222,128,.1); color: var(--up, #4ade80); }
.fn-ec2-bias--bearish_on_beat { background: rgba(248,113,113,.1); color: var(--ec2-high); }
.fn-ec2-bias--neutral { background: var(--ec2-surface2); color: var(--ec2-text2); }

/* Empty / loading / skeleton */
.fn-ec2-empty, .fn-ec2-loading { text-align: center; color: var(--ec2-muted); padding: 60px 20px; font-size: 13px; }
.fn-ec2-empty-mark { font-size: 28px; opacity: .4; margin-bottom: 6px; }
.fn-ec2-skel { padding: 8px; }
.fn-ec2-skel-row { display: grid; grid-template-columns: 52px 46px 1fr 120px; gap: 10px; padding: 12px 10px; margin-bottom: 5px; background: var(--ec2-surface); border-radius: 9px; }
.fn-ec2-skel-row > div { height: 14px; border-radius: 4px; background: linear-gradient(90deg, var(--ec2-surface2) 25%, rgba(255,255,255,.06) 50%, var(--ec2-surface2) 75%); background-size: 200% 100%; animation: fn-ec2-shimmer 1.3s infinite; }
@keyframes fn-ec2-shimmer { 0%{background-position:200% 0;} 100%{background-position:-200% 0;} }

/* Toast */
.fn-ec2-toast { position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--ec2-surface2); border: 1px solid var(--ec2-border2); color: var(--ec2-text); padding: 9px 16px; border-radius: 9px; font-size: 12px; opacity: 0; pointer-events: none; transition: .2s; }
.fn-ec2-toast.is-visible { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ════════════════════════════ HEATMAP (preserved look) ════════════════════════════ */
.fn-ec2-heat { display: grid; grid-template-columns: 70px repeat(6, 1fr); gap: 4px; }
.fn-ec2-heat-corner {}
.fn-ec2-heat-hbucket { font-family: var(--ec2-mono); font-size: 10px; color: var(--ec2-muted); text-align: center; padding-bottom: 4px; }
.fn-ec2-heat-hday { font-size: 11px; color: var(--ec2-text2); display: flex; align-items: center; justify-content: flex-end; padding-inline-end: 8px; }
.fn-ec2-heat-hday.is-today { color: var(--ec2-accent); font-weight: 600; }
.fn-ec2-heat-cell {
  --cell: 0; position: relative; min-height: 46px; border: 1px solid var(--ec2-border); border-radius: 7px;
  background: var(--ec2-surface); cursor: pointer; transition: transform .12s; display: flex; align-items: center; justify-content: center;
}
.fn-ec2-heat-cell:hover { transform: scale(1.05); z-index: 1; }
.fn-ec2-heat-cell.is-empty { background: rgba(255,255,255,.015); cursor: default; }
.fn-ec2-heat-cell.is-empty:hover { transform: none; }
.fn-ec2-heat-cell.is-low { background: rgba(68,147,248, calc(.12 + var(--cell) * .25)); border-color: rgba(68,147,248,.2); }
.fn-ec2-heat-cell.is-medium { background: rgba(245,176,66, calc(.15 + var(--cell) * .4)); border-color: rgba(245,176,66,.25); }
.fn-ec2-heat-cell.is-high { background: rgba(255,93,108, calc(.18 + var(--cell) * .55)); border-color: rgba(255,93,108,.3); }
.fn-ec2-heat-count { font-family: var(--ec2-mono); font-size: 12px; font-weight: 600; color: var(--ec2-text); }
.fn-ec2-heat-legend { display: flex; align-items: center; gap: 6px; margin-top: 16px; font-size: 11px; color: var(--ec2-muted); justify-content: center; }
.fn-ec2-leg { width: 11px; height: 11px; border-radius: 3px; margin-inline-start: 10px; }
.fn-ec2-leg.is-low { background: rgba(68,147,248,.5); }
.fn-ec2-leg.is-medium { background: rgba(245,176,66,.55); }
.fn-ec2-leg.is-high { background: rgba(255,93,108,.6); }

/* ════════════════════════════ RESPONSIVE ════════════════════════════ */
@media (max-width: 760px) {
  .fn-ec2-sheet { height: 94vh; max-height: none; border-radius: 14px 14px 0 0; align-self: flex-end; }
  .fn-ec2-overlay { padding: 0; align-items: flex-end; }
  .fn-ec2-side { display: none; }
  .fn-ec2-row-head { grid-template-columns: 24px 46px 40px 1fr 8px 22px; }
  .fn-ec2-row-vals { display: none; }
  .fn-ec2-row.is-expanded .fn-ec2-row-vals { display: flex; grid-column: 1 / -1; padding-top: 6px; justify-content: flex-start; }
  .fn-ec2-tz { display: none; }
  .fn-ec2-heat { grid-template-columns: 44px repeat(6, 1fr); gap: 3px; }
  .fn-ec2-heat-cell { min-height: 38px; }
  .fn-ec2-heat-hbucket { font-size: 9px; }
}

/* ════════════════════ NEW FEATURES (v2.1) ════════════════════ */

/* ── Country select (mirrors the timezone select) ── */
.fn-ec2-country {
  height: 28px; padding: 0 8px; border-radius: 7px; cursor: pointer;
  background: var(--ec2-surface); border: 1px solid var(--ec2-border);
  color: var(--ec2-text2); font-size: 11px; font-family: var(--ec2-font); max-width: 150px;
}
.fn-ec2-country:hover { border-color: var(--ec2-border2); }

/* ── Category chip row (horizontal scroll if it overflows) ── */
.fn-ec2-frow--cat { gap: 5px; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 2px; scrollbar-width: thin; }
.fn-ec2-frow--cat::-webkit-scrollbar { height: 4px; }
.fn-ec2-frow--cat::-webkit-scrollbar-thumb { background: var(--ec2-border2); border-radius: 4px; }
.fn-ec2-chip--cat { white-space: nowrap; flex: 0 0 auto; }

/* ── Tools row: collapse · 12/24 · alerts · export ── */
.fn-ec2-tools { gap: 7px; }
.fn-ec2-tools-spacer { flex: 1 1 auto; }
.fn-ec2-toggle {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 11px;
  border-radius: 7px; cursor: pointer; font-size: 11px; font-weight: 500; font-family: var(--ec2-font);
  background: var(--ec2-surface); border: 1px solid var(--ec2-border); color: var(--ec2-text2);
  transition: border-color .15s, background .15s, color .15s;
}
.fn-ec2-toggle:hover { border-color: var(--ec2-border2); }
.fn-ec2-toggle-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--ec2-muted);
  border: 1px solid var(--ec2-border2); transition: background .15s, box-shadow .15s;
}
.fn-ec2-toggle.is-on { color: var(--ec2-text); border-color: rgba(77,212,172,.4); background: rgba(77,212,172,.08); }
.fn-ec2-toggle.is-on .fn-ec2-toggle-dot { background: var(--ec2-accent); box-shadow: 0 0 0 3px rgba(77,212,172,.18); }
.fn-ec2-toggle--hour { font-family: var(--ec2-mono); min-width: 50px; justify-content: center; }
.fn-ec2-toggle--alert.is-on { border-color: rgba(251,191,36,.4); background: rgba(251,191,36,.08); }
.fn-ec2-toggle--alert.is-on .fn-ec2-toggle-dot { background: var(--ec2-med); box-shadow: 0 0 0 3px rgba(251,191,36,.18); }
.fn-ec2-exp {
  height: 28px; padding: 0 10px; border-radius: 7px; cursor: pointer; font-size: 11px; font-weight: 600;
  font-family: var(--ec2-mono); letter-spacing: .3px;
  background: var(--ec2-surface); border: 1px solid var(--ec2-border); color: var(--ec2-text2);
  transition: border-color .15s, color .15s;
}
.fn-ec2-exp:hover { border-color: var(--ec2-accent); color: var(--ec2-accent); }

/* ── Surprise indicator on the Actual value ── */
.fn-ec2-val--actual { position: relative; min-width: 52px; }
.fn-ec2-val-num.is-up   { color: var(--ec2-up); }
.fn-ec2-val-num.is-down { color: var(--ec2-down); }
.fn-ec2-val-num.is-neutral { color: var(--ec2-accent); }
.fn-ec2-arrow { font-size: 8px; margin-inline-end: 3px; vertical-align: middle; }
.fn-ec2-arrow--up { color: var(--ec2-up); }
.fn-ec2-arrow--down { color: var(--ec2-down); }
.fn-ec2-arrow--neutral { color: var(--ec2-muted); }
.fn-ec2-dev {
  margin-top: 2px; font-size: 8.5px; font-weight: 600; font-family: var(--ec2-mono);
  line-height: 1.3; border-radius: 4px; padding: 1px 4px; display: inline-block; white-space: nowrap;
}
.fn-ec2-dev--up   { color: var(--ec2-up);   background: rgba(74,222,128,.12); }
.fn-ec2-dev--down { color: var(--ec2-down); background: rgba(248,113,113,.12); }
.fn-ec2-dev--neutral { color: var(--ec2-muted); background: rgba(255,255,255,.05); }

/* ── "Now" divider line in the timeline ── */
.fn-ec2-nowline {
  display: flex; align-items: center; gap: 8px; margin: 7px 2px; padding: 0 4px;
  color: var(--ec2-accent); font-size: 10px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase;
}
.fn-ec2-nowline::after {
  content: ""; flex: 1; height: 1px;
  background: linear-gradient(90deg, var(--ec2-accent), transparent);
}
.fn-ec2-strip[dir="rtl"] .fn-ec2-nowline::after,
.fn-ec2-overlay[dir="rtl"] .fn-ec2-nowline::after { background: linear-gradient(270deg, var(--ec2-accent), transparent); }
.fn-ec2-nowline-dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--ec2-accent);
  box-shadow: 0 0 0 3px rgba(77,212,172,.2); animation: fn-ec2-pulse 2.6s infinite;
}

/* ── Collapsed low-impact group toggle ── */
.fn-ec2-lowgroup {
  display: flex; align-items: center; gap: 7px; width: 100%; margin-bottom: 5px;
  padding: 7px 12px; border-radius: 8px; cursor: pointer; text-align: start;
  background: transparent; border: 1px dashed var(--ec2-border2); color: var(--ec2-muted);
  font-size: 11px; font-family: var(--ec2-font); transition: border-color .15s, color .15s, background .15s;
}
.fn-ec2-lowgroup:hover { color: var(--ec2-text2); border-color: var(--ec2-border2); background: rgba(255,255,255,.02); }
.fn-ec2-lowgroup-ic { transition: transform .18s ease; flex: 0 0 auto; }
.fn-ec2-lowgroup.is-open .fn-ec2-lowgroup-ic { transform: rotate(180deg); }

/* ── Responsive: keep the surprise badge visible on mobile ── */
@media (max-width: 760px) {
  .fn-ec2-country { display: none; }
  .fn-ec2-tools { flex-wrap: wrap; }
  .fn-ec2-tools-spacer { display: none; }
  .fn-ec2-row.is-expanded .fn-ec2-val--actual { min-width: 64px; }
}
