/* ui/calendar.css — the Regulatory Calendar. W26.
 *
 * Loop IQ chrome: card #FFF, 0.67px #E5E7EB, 12px radius, 24px pad. Pills 9999px.
 * Primary filled #271257. Electric indigo #4330F5. Depth #271257 / #1A0B3D.
 * Onest display, Poppins body. Sleek. Few words.
 */

.cal {
  --ink: #1A0B3D;
  --ink-2: #271257;
  --indigo: #4330F5;
  --line: #E5E7EB;
  --muted: #6B7280;
  --card: #FFFFFF;

  /* THE BANDS. Colour-separated and unmistakable — this is not decoration.
     A mocked figure that can leave the building looking real is a legal problem. */
  --band-published: #271257;   /* real government data. Depth. Solid. */
  --band-inflight: #4330F5;    /* this quarter. Electric. Still moving. */
  --band-projected: #A5B4FC;   /* rules-derived. Pale. Not a measurement. */
  --band-unsourced: #9CA3AF;   /* we could not source it. Grey. Deliberately inert. */

  font-family: 'Poppins', system-ui, sans-serif;
  color: var(--ink);
  padding-bottom: 40px;
}

.cal h1, .cal h2, .cal h3, .cal .disp { font-family: var(--font-head, 'Sansation', 'Poppins', sans-serif); }

.cal-card {
  background: var(--card);
  border: 0.67px solid var(--line);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 16px;
}

/* ---------- THE VERDICT. Lead with this, not the grid. ---------------------- */
.cal-verdict {
  background: linear-gradient(135deg, #1A0B3D 0%, #271257 58%, #35207a 100%);
  border: none;
  color: #fff;
  position: relative;
  overflow: hidden;
}
.cal-verdict::after {
  content: ""; position: absolute; right: -70px; top: -70px;
  width: 240px; height: 240px; border-radius: 50%;
  background: radial-gradient(circle, rgba(67,48,245,.5), transparent 68%);
  pointer-events: none;
}
.cal-lead-tag {
  display: inline-block; border-radius: 9999px; padding: 5px 12px;
  font-size: 10px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase;
  background: rgba(67,48,245,.35); color: #C7D2FE;
  border: 0.67px solid rgba(167,180,252,.35); margin-bottom: 14px;
}
.cal-verdict h2 {
  font-size: 30px; line-height: 1.22; font-weight: 800;
  margin: 0 0 10px; letter-spacing: -0.025em; max-width: 24ch;
}
.cal-verdict h2 em { font-style: normal; color: #A5B4FC; }
.cal-lead-kick {
  font-size: 15px; line-height: 1.5; font-weight: 600; color: #A5B4FC;
  margin: 0 0 14px; max-width: 44ch;
}
.cal-lead-steer {
  font-size: 13.5px; line-height: 1.5; margin: 0 0 16px; max-width: 50ch;
  color: rgba(255,255,255,.72); padding-left: 13px;
  border-left: 2px solid rgba(255,255,255,.18);
}
.cal-lead-steer.is-open {
  color: #fff; font-weight: 600; border-left-color: #4330F5;
}
.cal-lead-edge {
  font-size: 11.5px; line-height: 1.6; color: rgba(255,255,255,.55);
  margin: 18px 0 0; max-width: 66ch; padding-top: 14px;
  border-top: 0.67px solid rgba(255,255,255,.13);
}
.cal-lead-src {
  font-size: 10.5px; color: rgba(255,255,255,.42); margin: 7px 0 0;
  letter-spacing: .01em;
}
.cal-vlines { display: flex; flex-direction: column; gap: 7px; margin: 0; padding: 0; list-style: none; }
.cal-vlines li {
  font-size: 13.5px; line-height: 1.5; color: rgba(255,255,255,.82);
  padding-left: 16px; position: relative;
}
.cal-vlines li::before {
  content: ""; position: absolute; left: 0; top: 8px;
  width: 5px; height: 5px; border-radius: 50%; background: #4330F5;
}
.cal-vlines li b { color: #fff; font-weight: 600; }

.cal-vmeta { display: flex; gap: 10px; margin-top: 20px; flex-wrap: wrap; }
.cal-chip {
  display: inline-flex; align-items: center; gap: 7px;
  border-radius: 9999px; padding: 6px 13px;
  font-size: 11.5px; font-weight: 600; letter-spacing: .01em;
  background: rgba(255,255,255,.10); color: #fff;
  border: 0.67px solid rgba(255,255,255,.20);
}
.cal-chip b { font-weight: 700; color: #A5B4FC; }

/* ---------- THE SCRUBBER. Acting gets harder every day — make it visceral. --- */
.cal-scrub-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 16px; margin-bottom: 4px; flex-wrap: wrap;
}
.cal-scrub-head h3 { font-size: 15px; font-weight: 700; margin: 0; }
.cal-scrub-date {
  font-size: 13px; font-weight: 600; color: var(--indigo);
  font-variant-numeric: tabular-nums;
}
.cal-scrub-hint { font-size: 11.5px; color: var(--muted); margin: 2px 0 16px; }

.cal-slider { width: 100%; margin: 0 0 18px; -webkit-appearance: none; appearance: none;
  height: 4px; border-radius: 9999px; background: var(--line); outline: none; }
.cal-slider::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--ink-2); border: 3px solid #fff; cursor: grab;
  box-shadow: 0 1px 6px rgba(26,11,61,.32);
}
.cal-slider::-webkit-slider-thumb:active { cursor: grabbing; }
.cal-slider::-moz-range-thumb {
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--ink-2); border: 3px solid #fff; cursor: grab;
}

/* The narrowing. This is the point of the whole scrubber. */
.cal-narrow { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.cal-narrow-cell {
  border: 0.67px solid var(--line); border-radius: 12px; padding: 14px 16px;
}
.cal-narrow-lab {
  font-size: 10.5px; font-weight: 700; letter-spacing: .07em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 8px;
}
.cal-narrow-val {
  font-family: var(--font-head, 'Sansation', 'Poppins', sans-serif); font-size: 25px; font-weight: 800;
  line-height: 1; letter-spacing: -0.02em; font-variant-numeric: tabular-nums;
}
.cal-narrow-val.is-open { color: var(--indigo); }
.cal-narrow-val.is-shut { color: #9CA3AF; }
.cal-narrow-sub { font-size: 11.5px; color: var(--muted); margin-top: 7px; line-height: 1.45; }
.cal-narrow-bar {
  height: 6px; border-radius: 9999px; background: #F3F4F6;
  margin-top: 11px; overflow: hidden;
}
.cal-narrow-fill {
  height: 100%; border-radius: 9999px; background: var(--indigo);
  transition: width .18s ease, background .18s ease;
}
.cal-narrow-fill.is-shut { background: #D1D5DB; }

/* ---------- THE LANES. Five clocks, stacked, on one time axis. -------------- */
.cal-lanes { position: relative; }
.cal-lane {
  display: grid; grid-template-columns: 132px 1fr; align-items: center;
  gap: 14px; padding: 11px 0; border-bottom: 0.67px solid var(--line);
}
.cal-lane:last-child { border-bottom: none; }
.cal-lane-name {
  font-size: 11px; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; color: var(--ink-2); line-height: 1.35;
}
.cal-lane-name span { display: block; font-size: 10px; font-weight: 500;
  text-transform: none; letter-spacing: 0; color: var(--muted); margin-top: 2px; }
.cal-track {
  position: relative; height: 30px; border-radius: 9999px;
  background: #F9FAFB; border: 0.67px solid var(--line);
}

/* a span (quarter, reference window, payment quarter) */
.cal-span {
  position: absolute; top: 5px; height: 18px; border-radius: 9999px;
  display: flex; align-items: center; padding: 0 9px;
  font-size: 10px; font-weight: 600; color: #fff; white-space: nowrap;
  overflow: hidden; cursor: pointer;
}
.cal-span.b-published { background: var(--band-published); }
.cal-span.b-inflight  { background: var(--band-inflight); }
.cal-span.b-projected { background: var(--band-projected); color: var(--ink-2); }
.cal-span.b-unsourced { background: var(--band-unsourced); }
.cal-span.hollow {
  background: transparent; border: 1px dashed var(--band-projected);
  color: var(--muted);
}
/* the elapsed fill inside the live quarter — the bar that fills as the quarter runs out */
.cal-span-fill {
  position: absolute; left: 0; top: 0; bottom: 0;
  background: rgba(255,255,255,.28); border-radius: 9999px;
  transition: width .18s ease;
}
.cal-span-txt { position: relative; z-index: 1; }

/* a point event (a deadline, a lock, a month end) */
.cal-pt {
  position: absolute; top: 50%; width: 13px; height: 13px;
  margin-left: -6.5px; margin-top: -6.5px;
  border-radius: 3px; transform: rotate(45deg);
  border: 1.5px solid #fff; cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease;
}
.cal-pt:hover, .cal-pt.on { transform: rotate(45deg) scale(1.34); box-shadow: 0 0 0 3px rgba(67,48,245,.18); }
.cal-pt.b-published { background: var(--band-published); }
.cal-pt.b-inflight  { background: var(--band-inflight); }
.cal-pt.b-projected { background: var(--band-projected); }
.cal-pt.b-unsourced { background: var(--band-unsourced); }
.cal-pt.past { opacity: .32; }

/* TODAY. Dynamic. Never a hard-coded position. */
.cal-today {
  position: absolute; top: -6px; bottom: -6px; width: 2px;
  background: var(--indigo); z-index: 4; pointer-events: none;
  transition: left .18s ease;
}
.cal-today::before {
  content: ""; position: absolute; top: -4px; left: -3px;
  width: 8px; height: 8px; border-radius: 50%; background: var(--indigo);
}
.cal-todaywrap { position: absolute; inset: 0; pointer-events: none; z-index: 4; }
.cal-todaywrap .cal-today { top: 0; bottom: 0; }
.cal-todaylab {
  position: absolute; top: -20px; transform: translateX(-50%);
  font-size: 9.5px; font-weight: 700; letter-spacing: .06em;
  color: var(--indigo); white-space: nowrap; z-index: 5;
  transition: left .18s ease;
}

/* month ruler */
.cal-ruler {
  display: grid; grid-template-columns: 132px 1fr; gap: 14px;
  margin-bottom: 2px;
}
.cal-ruler-track { position: relative; height: 16px; }
.cal-ruler-m {
  position: absolute; top: 0; font-size: 9.5px; font-weight: 600;
  color: var(--muted); transform: translateX(-50%); white-space: nowrap;
}

/* ---------- THE DETAIL. Click a deadline: what it needs, where it's made. ---- */
.cal-detail { border-left: 3px solid var(--indigo); }
.cal-detail.b-published { border-left-color: var(--band-published); }
.cal-detail.b-inflight  { border-left-color: var(--band-inflight); }
.cal-detail.b-projected { border-left-color: var(--band-projected); }
.cal-detail.b-unsourced { border-left-color: var(--band-unsourced); }

.cal-dt-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.cal-dt-title { font-family: var(--font-head, 'Sansation', 'Poppins', sans-serif); font-size: 18px; font-weight: 700;
  letter-spacing: -0.01em; margin: 0 0 4px; }
.cal-dt-when { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.cal-dt-when b { color: var(--ink); font-weight: 600; }
.cal-dt-count {
  font-family: var(--font-head, 'Sansation', 'Poppins', sans-serif); font-size: 30px; font-weight: 800;
  letter-spacing: -0.03em; line-height: 1; white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.cal-dt-count small { display: block; font-size: 10px; font-weight: 600;
  letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-top: 5px; }
.cal-dt-count.past { color: #9CA3AF; }

.cal-rows { margin-top: 18px; display: flex; flex-direction: column; gap: 12px; }
.cal-row { display: grid; grid-template-columns: 96px 1fr; gap: 14px; align-items: start; }
.cal-row-k {
  font-size: 10.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
  color: var(--muted); padding-top: 2px;
}
.cal-row-v { font-size: 13px; line-height: 1.6; }
.cal-row.risk .cal-row-k { color: #B91C1C; }
.cal-row.risk .cal-row-v { color: #7F1D1D; }

.cal-src {
  margin-top: 18px; padding-top: 14px; border-top: 0.67px solid var(--line);
  font-size: 11.5px; color: var(--muted); line-height: 1.6;
}
.cal-src b { color: var(--ink-2); font-weight: 600; }
.cal-src q { font-style: italic; display: block; margin-top: 6px; color: #4B5563; }
.cal-src a { color: var(--indigo); text-decoration: none; }
.cal-src a:hover { text-decoration: underline; }

/* ---------- BANDS legend + the mock disclosure. --------------------------- */
.cal-bands { display: flex; gap: 8px; flex-wrap: wrap; }
.cal-band {
  display: inline-flex; align-items: center; gap: 7px;
  border-radius: 9999px; padding: 6px 13px 6px 9px;
  font-size: 11.5px; font-weight: 600;
  border: 0.67px solid var(--line); background: #fff; cursor: default;
}
.cal-band i { width: 9px; height: 9px; border-radius: 2px; transform: rotate(45deg); display: block; }
.cal-band.b-published i { background: var(--band-published); }
.cal-band.b-inflight  i { background: var(--band-inflight); }
.cal-band.b-projected i { background: var(--band-projected); }
.cal-band.b-unsourced i { background: var(--band-unsourced); }
.cal-band span { color: var(--muted); font-weight: 500; }

.cal-mock {
  margin-top: 14px; border-radius: 12px; padding: 12px 16px;
  background: #FFFBEB; border: 0.67px solid #FDE68A;
  font-size: 12px; line-height: 1.55; color: #78350F;
}
.cal-mock b { font-weight: 700; }

/* ---------- THE 91/92 CONTRADICTION, SAID OUT LOUD. ----------------------- */
.cal-basis { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.cal-basis-cell { border: 0.67px solid var(--line); border-radius: 12px; padding: 16px; }
.cal-basis-cell.fact { border-color: #C7D2FE; background: #F5F3FF; }
.cal-basis-n {
  font-family: var(--font-head, 'Sansation', 'Poppins', sans-serif); font-size: 34px; font-weight: 800;
  line-height: 1; letter-spacing: -0.03em;
}
.cal-basis-cell.fact .cal-basis-n { color: var(--indigo); }
.cal-basis-cell.conv .cal-basis-n { color: var(--muted); }
.cal-basis-k {
  font-size: 10.5px; font-weight: 700; letter-spacing: .07em;
  text-transform: uppercase; color: var(--muted); margin: 9px 0 7px;
}
.cal-basis-t { font-size: 12px; line-height: 1.55; color: #4B5563; }
.cal-note { font-size: 12px; color: var(--muted); line-height: 1.6; margin-top: 14px; }
.cal-note b { color: var(--ink-2); }

.cal-h {
  font-family: var(--font-head, 'Sansation', 'Poppins', sans-serif); font-size: 15px; font-weight: 700;
  margin: 0 0 4px; letter-spacing: -0.01em;
}
.cal-sub { font-size: 12px; color: var(--muted); margin: 0 0 18px; line-height: 1.5; }

.cal-err {
  border-radius: 12px; padding: 16px; background: #FEF2F2;
  border: 0.67px solid #FECACA; color: #7F1D1D; font-size: 13px;
}

@media (max-width: 820px) {
  .cal-lane, .cal-ruler { grid-template-columns: 1fr; }
  .cal-lane-name { margin-bottom: 4px; }
  .cal-narrow, .cal-basis { grid-template-columns: 1fr; }
  .cal-row { grid-template-columns: 1fr; gap: 3px; }
  .cal-verdict h2 { font-size: 22px; }
}
