/* /tools/earnings-monitor/ — em- prefix to namespace from other pages. */

.em-page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 16px 64px;
  color: #e9eef5;
}

.em-hero {
  margin-bottom: 16px;
}

.em-kicker {
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #9aa4b2;
  margin-bottom: 6px;
}

.em-sub {
  font-size: 14px;
  color: #9aa4b2;
  max-width: 720px;
  margin-bottom: 14px;
  line-height: 1.5;
}

.em-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.em-zone-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  background: rgba(148, 163, 184, 0.10);
  border: 1px solid rgba(148, 163, 184, 0.32);
  color: #cbd5e1;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.em-zone-chip::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex: 0 0 auto;
}
.em-zone-chip[data-zone="open"] {
  background: rgba(52, 211, 153, 0.12);
  border-color: rgba(52, 211, 153, 0.42);
  color: #6ee7b7;
}
.em-zone-chip[data-zone="open"]::before {
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.18);
  animation: em-zone-pulse 2s ease-out infinite;
}
.em-zone-chip[data-zone="pre"] {
  background: rgba(251, 191, 36, 0.10);
  border-color: rgba(251, 191, 36, 0.38);
  color: #fcd34d;
}
.em-zone-chip[data-zone="post"] {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.18), rgba(99, 102, 241, 0.06));
  border-color: rgba(99, 102, 241, 0.40);
  color: #c7d2fe;
}
.em-zone-chip[data-zone="closed"] {
  background: rgba(148, 163, 184, 0.06);
  border-color: rgba(148, 163, 184, 0.22);
  color: #94a3b8;
}
@keyframes em-zone-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.45); }
  70%  { box-shadow: 0 0 0 6px rgba(52, 211, 153, 0); }
  100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .em-zone-chip[data-zone="open"]::before { animation: none; }
}

.em-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  transition: background 0.15s, border-color 0.15s;
}
.em-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.22);
}
.em-btn--ghost {
  background: transparent;
  color: #94a3b8;
}

.em-meta {
  font-size: 12px;
  color: #6b7280;
  margin-left: auto;
}

.em-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 14px;
  height: calc(100vh - 220px);
  min-height: 580px;
}

@media (max-width: 820px) {
  .em-grid {
    grid-template-columns: 1fr;
    grid-template-rows: repeat(4, minmax(280px, 1fr));
    height: auto;
  }
}

.em-cell {
  position: relative;
  background: rgba(15, 18, 26, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 12px 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.em-cell:hover .em-cell__close {
  opacity: 1;
}

.em-cell__close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.5);
  color: #f87171;
  border: 1px solid rgba(248, 113, 113, 0.3);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
}
.em-cell__close:hover {
  background: rgba(248, 113, 113, 0.18);
}

.em-cell__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.em-cell__ticker {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.em-cell__pill {
  margin-left: 6px;
  font-size: 11px;
  font-weight: 500;
  color: #9aa4b2;
  background: rgba(255, 255, 255, 0.04);
  padding: 1px 7px;
  border-radius: 999px;
}

.em-cell__chgwrap {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
  line-height: 1.15;
}
.em-cell__chg {
  font-variant-numeric: tabular-nums;
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.em-cell__chg--primary { font-size: 15px; font-weight: 700; }
.em-cell__chg--secondary { font-size: 11px; font-weight: 500; opacity: 0.72; }
.em-cell__chg-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #9ca3af;
}
.em-cell__chg--secondary .em-cell__chg-label { font-size: 9px; }
.em-cell__chg--up { color: #34d399; }
.em-cell__chg--dn { color: #f87171; }

.em-cell__meta {
  font-size: 11px;
  color: #6b7280;
  display: flex;
  gap: 10px;
  margin-bottom: 8px;
}

.em-cell__meta b { color: #cbd5e1; font-weight: 500; }

.em-cell__chart {
  flex: 1;
  min-height: 180px;
  position: relative;
}


/* Empty / add-tile slot */
.em-add {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  border: 1.5px dashed rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  padding: 18px;
  background: rgba(15, 18, 26, 0.4);
}
.em-add__title {
  font-size: 13px;
  color: #cbd5e1;
  font-weight: 600;
  margin-bottom: 10px;
}
.em-add__form {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
  width: 100%;
  max-width: 280px;
}
.em-add__input {
  flex: 1;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #e9eef5;
  padding: 7px 10px;
  border-radius: 6px;
  font-family: inherit;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.em-add__hint {
  font-size: 11px;
  color: #6b7280;
}
.em-add__error {
  font-size: 11px;
  color: #f87171;
  margin-top: 6px;
  min-height: 14px;
}

.em-foot {
  margin-top: 14px;
  font-size: 11px;
  color: #4b5563;
  text-align: center;
}

/* ─── Earnings calendar sidebar (Layout A) ─── */

.em-page-grid {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 16px;
  height: calc(100vh - 220px);
  min-height: 580px;
}

.em-page-grid[data-collapsed="true"] {
  grid-template-columns: 1fr 36px;
}

.em-page-grid .em-grid {
  height: auto;
  min-height: 0;
}

@media (max-width: 1024px) {
  .em-page-grid { grid-template-columns: 1fr 240px; }
}
@media (max-width: 900px) {
  .em-page-grid {
    grid-template-columns: 1fr;
    height: auto;
  }
}

.em-sidebar {
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(15, 18, 26, 0.7);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}

.em-sidebar__head {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}
.em-sidebar__head-left {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}
.em-sidebar__title {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #e9eef5;
  font-weight: 700;
}
.em-sidebar__date {
  font-size: 11px;
  color: #94a3b8;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.em-sidebar__date:not(:empty)::before {
  content: "·";
  margin-right: 8px;
  color: rgba(148, 163, 184, 0.5);
}
.em-sidebar__toggle {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #94a3b8;
  width: 22px; height: 22px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
}
.em-sidebar__toggle:hover { background: rgba(255, 255, 255, 0.06); color: #e9eef5; }

.em-sidebar__body {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}

.em-sidebar__rail {
  display: none;
  flex: 1;
  align-items: center;
  justify-content: center;
}
.em-page-grid[data-collapsed="true"] .em-sidebar__head { display: none; }
.em-page-grid[data-collapsed="true"] .em-sidebar__body { display: none; }
.em-page-grid[data-collapsed="true"] .em-sidebar__rail { display: flex; }
.em-sidebar__rail-label {
  writing-mode: vertical-rl;
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #6b7280;
  cursor: pointer;
}

/* sticky section header per BMO/AMC group */
.em-cal-section__head {
  padding: 8px 12px 4px;
  color: #FF8C00;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  background: rgba(15, 18, 26, 0.92);
  position: sticky;
  top: 0;
  z-index: 1;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
.em-cal-section__count {
  color: #6b7280;
  font-size: 10px;
  letter-spacing: 0;
  text-transform: none;
}

.em-cal-row {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  align-items: baseline;
  gap: 6px;
  padding: 6px 12px;
  font-size: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  cursor: grab;
  user-select: none;
  position: relative;
  transition: background 0.1s;
}
.em-cal-row:hover { background: rgba(255, 140, 0, 0.06); }
.em-cal-row:active { cursor: grabbing; }
.em-cal-row.dragging { opacity: 0.4; }

.em-cal-row__tk { color: #e9eef5; font-weight: 700; letter-spacing: 0.02em; }
.em-cal-row__nm {
  color: #cbd5e1;
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.em-cal-row__mcap {
  color: #fcd34d;
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  background: rgba(252, 211, 77, 0.08);
  border: 1px solid rgba(252, 211, 77, 0.25);
  padding: 1px 6px;
  border-radius: 3px;
}

.em-cal-row.is-watching {
  background: rgba(52, 211, 153, 0.07);
}
.em-cal-row.is-watching .em-cal-row__tk::after {
  content: '●';
  color: #34d399;
  font-size: 9px;
  margin-left: 6px;
  vertical-align: middle;
}

/* drop affordance on monitor cells when dragging from sidebar */
.em-cell.em-cell--drop-target {
  border-color: #FF8C00;
  background: rgba(255, 140, 0, 0.08);
}

.em-cal-empty,
.em-cal-error {
  padding: 14px 12px;
  color: #6b7280;
  font-size: 11px;
  text-align: center;
  line-height: 1.5;
}
.em-cal-error { color: #f87171; }

.em-cal-stale {
  padding: 6px 12px;
  background: rgba(252, 211, 77, 0.08);
  border-bottom: 1px solid rgba(252, 211, 77, 0.2);
  color: #fcd34d;
  font-size: 10px;
  letter-spacing: 0.04em;
}

.em-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 18, 26, 0.95);
  border: 1px solid rgba(252, 211, 77, 0.4);
  color: #fcd34d;
  padding: 8px 16px;
  font-size: 12px;
  border-radius: 6px;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.em-toast--visible { opacity: 1; }
