/* ============================================
   Watchlist Public Page Styles
   Extends design_tokens.css
   ============================================ */

/* ── Page Layout ── */
.watchlist-page {
  min-height: 100vh;
  background: var(--bg-base);
  font-family: var(--font-sans);
  color: var(--ink-900);
  padding-bottom: 60px;
}

.watchlist-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ── Top Nav ── */
.wl-topnav {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  padding: 12px 0;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow-sm);
}

.wl-topnav .watchlist-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.wl-logo {
  font-size: 18px;
  font-weight: 800;
  color: var(--accent);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.wl-logo:hover { opacity: 0.85; }

.wl-nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}

.wl-nav-link {
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-500);
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}
.wl-nav-link:hover { background: var(--bg-hover); color: var(--ink-900); }
.wl-nav-link.active { background: var(--accent-muted); color: var(--accent); }

.wl-nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ── Countdown Timer Bar ── */
.wl-timer-bar {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.06), rgba(99, 102, 241, 0.02));
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 20px;
  margin: 16px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.wl-timer-group {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.wl-timer-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.wl-timer-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

.wl-timer-icon.price {
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  color: #fff;
}

.wl-timer-icon.reason {
  background: linear-gradient(135deg, #8b5cf6, #7c3aed);
  color: #fff;
}

.wl-timer-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--ink-500);
  line-height: 1.2;
}

.wl-timer-value {
  font-size: 16px;
  font-weight: 800;
  color: var(--ink-900);
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.wl-timer-value.running {
  color: var(--accent);
  animation: pulse-timer 1.5s ease-in-out infinite;
}

@keyframes pulse-timer {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.wl-market-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.wl-market-badge.open {
  background: var(--green-muted);
  color: var(--green);
  border: 1px solid rgba(22, 163, 74, 0.2);
}

.wl-market-badge.closed {
  background: var(--red-muted);
  color: var(--red);
  border: 1px solid rgba(220, 38, 38, 0.2);
}

/* ── Stats Row ── */
.wl-stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.wl-stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  text-align: center;
  transition: all 0.25s;
}

.wl-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.wl-stat-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--ink-500);
  margin-bottom: 4px;
}

.wl-stat-value {
  font-size: 22px;
  font-weight: 800;
  color: var(--ink-900);
}

.wl-stat-value.accent { color: var(--accent); }

/* ── Controls Bar ── */
.wl-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

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

.wl-controls-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.wl-search-input {
  padding: 8px 14px 8px 36px;
  font-size: 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  color: var(--ink-900);
  width: 240px;
  transition: border-color 0.2s, box-shadow 0.2s;
  font-family: var(--font-sans);
}

.wl-search-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-muted);
}

.wl-search-wrap {
  position: relative;
}

.wl-search-wrap i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-400);
  font-size: 12px;
  pointer-events: none;
}

.wl-select {
  padding: 7px 28px 7px 12px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  color: var(--ink-900);
  cursor: pointer;
  font-family: var(--font-sans);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='5' viewBox='0 0 8 5'%3E%3Cpath d='M0 0l4 5 4-5z' fill='%2394a3b8'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}

.wl-view-toggle {
  display: flex;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.wl-view-btn {
  padding: 7px 14px;
  font-size: 12px;
  background: var(--bg-surface);
  color: var(--ink-500);
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 4px;
}

.wl-view-btn:not(:last-child) {
  border-right: 1px solid var(--border);
}

.wl-view-btn.active {
  background: var(--accent);
  color: #fff;
}

.wl-view-btn:hover:not(.active) {
  background: var(--bg-hover);
}

/* ── Sector Tabs ── */
.wl-sector-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.wl-sector-tab {
  padding: 6px 14px;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  background: var(--bg-surface);
  color: var(--ink-700);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.wl-sector-tab:hover {
  background: var(--bg-hover);
  border-color: var(--ink-400);
}

.wl-sector-tab.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.wl-sector-tab .count {
  font-size: 10px;
  font-weight: 800;
  margin-left: 4px;
  opacity: 0.7;
}

/* ── Table View ── */
.wl-table-container {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.wl-table-scroll {
  overflow-x: auto;
  max-height: calc(100vh - 300px);
  overflow-y: auto;
}

.wl-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 800px;
}

.wl-table thead {
  position: sticky;
  top: 0;
  z-index: 5;
}

.wl-table th {
  background: var(--bg-elevated);
  padding: 10px 14px;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--ink-500);
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  transition: color 0.2s;
}

.wl-table th:hover { color: var(--accent); }

.wl-table th.sorted { color: var(--accent); }

.wl-table th .sort-icon {
  font-size: 9px;
  margin-left: 4px;
  opacity: 0.5;
}

.wl-table th.sorted .sort-icon { opacity: 1; }

.wl-table td {
  padding: 12px 14px;
  font-size: 13px;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
  transition: background-color 0.15s;
}

.wl-table tr:hover td {
  background: var(--bg-elevated);
}

.wl-table .company-col {
  position: sticky;
  left: 0;
  background: var(--bg-surface);
  z-index: 2;
  min-width: 180px;
}

.wl-table tr:hover .company-col {
  background: var(--bg-elevated);
}

.wl-table .company-symbol {
  font-weight: 700;
  color: var(--accent);
  font-size: 14px;
  line-height: 1.2;
}

.wl-table .company-name {
  font-size: 11px;
  color: var(--ink-500);
  line-height: 1.3;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wl-table .price-cell {
  text-align: right;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  font-size: 14px;
}

.wl-table .change-cell {
  text-align: right;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  font-size: 13px;
}

.wl-table .change-cell.pos { color: var(--green); }
.wl-table .change-cell.neg { color: var(--red); }

.wl-table .reason-cell {
  text-align: left;
  font-size: 12px;
  line-height: 1.5;
  color: var(--ink-700);
  max-width: 450px;
}

.wl-table .reason-text {
  max-height: 60px;
  overflow: hidden;
  position: relative;
  transition: max-height 0.3s ease;
}

.wl-table .reason-text.expanded {
  max-height: 600px;
}

.wl-table .reason-toggle {
  font-size: 10px;
  color: var(--accent);
  cursor: pointer;
  font-weight: 700;
  margin-top: 4px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  border: none;
  background: none;
  padding: 2px 0;
}

.wl-table .reason-toggle:hover { text-decoration: underline; }

.wl-table .timestamp-cell {
  text-align: right;
  font-size: 10px;
  color: var(--ink-400);
  white-space: nowrap;
}

/* ── Card View ── */
.wl-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 14px;
}

.wl-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px;
  transition: all 0.25s;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 220px;
  position: relative;
  overflow: hidden;
}

.wl-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--accent-gradient);
  opacity: 0;
  transition: opacity 0.25s;
}

.wl-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent);
}

.wl-card:hover::before { opacity: 1; }

.wl-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.wl-card-symbol {
  font-size: 16px;
  font-weight: 800;
  color: var(--accent);
}

.wl-card-name {
  font-size: 11px;
  color: var(--ink-500);
  margin-top: 2px;
}

.wl-card-price-group {
  text-align: right;
}

.wl-card-price {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink-900);
}

.wl-card-change {
  font-size: 14px;
  font-weight: 800;
}

.wl-card-change.pos { color: var(--green); }
.wl-card-change.neg { color: var(--red); }

.wl-card-reason {
  flex: 1;
  font-size: 12px;
  line-height: 1.5;
  color: var(--ink-700);
  border-top: 1px dashed var(--border);
  padding-top: 10px;
  margin-top: 6px;
  max-height: 120px;
  overflow-y: auto;
}

.wl-card-reason::-webkit-scrollbar {
  width: 3px;
}

.wl-card-reason::-webkit-scrollbar-thumb {
  background: var(--ink-300);
  border-radius: 3px;
}

.wl-card-reason-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--accent);
  margin-bottom: 6px;
}

.wl-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--border-subtle);
}

.wl-card-timestamp {
  font-size: 9.5px;
  color: var(--ink-400);
  line-height: 1.4;
}

.wl-card-sector-badge {
  font-size: 9px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: var(--accent-muted);
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

/* ── Stale Badge ── */
.wl-stale-badge {
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: var(--radius-full);
  background: var(--yellow-muted);
  color: var(--yellow);
  margin-left: 6px;
}

/* ── Admin Settings Panel ── */
.wl-admin-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-top: 24px;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

.wl-admin-panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--accent), #8b5cf6, var(--accent));
}

.wl-admin-title {
  font-size: 16px;
  font-weight: 800;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-900);
}

.wl-admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.wl-admin-section {
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
  padding: 16px;
}

.wl-admin-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--ink-500);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.wl-admin-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  gap: 12px;
}

.wl-admin-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-700);
}

.wl-admin-input {
  padding: 6px 10px;
  font-size: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  color: var(--ink-900);
  font-family: var(--font-sans);
  width: 120px;
  text-align: center;
}

.wl-admin-input:focus {
  outline: none;
  border-color: var(--accent);
}

/* Toggle Switch */
.wl-toggle {
  position: relative;
  width: 44px;
  height: 24px;
  cursor: pointer;
}

.wl-toggle input { opacity: 0; width: 0; height: 0; }

.wl-toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--ink-300);
  border-radius: var(--radius-full);
  transition: 0.3s;
}

.wl-toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: 0.3s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.wl-toggle input:checked + .wl-toggle-slider {
  background: var(--accent);
}

.wl-toggle input:checked + .wl-toggle-slider::before {
  transform: translateX(20px);
}

/* Days Checkboxes */
.wl-days-grid {
  display: flex;
  gap: 4px;
  margin-top: 8px;
}

.wl-day-check {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.wl-day-check label {
  font-size: 10px;
  font-weight: 700;
  color: var(--ink-500);
  cursor: pointer;
}

.wl-day-check input {
  cursor: pointer;
  accent-color: var(--accent);
}

/* Admin Buttons */
.wl-admin-btn {
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 700;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-sans);
}

.wl-admin-btn.primary {
  background: var(--accent-gradient);
  color: #fff;
}

.wl-admin-btn.primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.wl-admin-btn.secondary {
  background: var(--bg-surface);
  color: var(--ink-700);
  border: 1px solid var(--border);
}

.wl-admin-btn.secondary:hover {
  background: var(--bg-hover);
}

.wl-admin-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

.wl-admin-status {
  font-size: 11px;
  color: var(--ink-500);
  margin-top: 12px;
  padding: 10px;
  background: var(--bg-base);
  border-radius: var(--radius-sm);
  line-height: 1.5;
}

.wl-admin-status .status-ok { color: var(--green); font-weight: 700; }
.wl-admin-status .status-err { color: var(--red); font-weight: 700; }

/* ── Loading / Empty States ── */
.wl-loading {
  text-align: center;
  padding: 60px 20px;
  color: var(--ink-400);
}

.wl-loading .spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: wl-spin 0.8s linear infinite;
  margin: 0 auto 12px;
}

@keyframes wl-spin {
  to { transform: rotate(360deg); }
}

.wl-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--ink-400);
  font-size: 14px;
}

.wl-empty i {
  font-size: 40px;
  margin-bottom: 12px;
  display: block;
  opacity: 0.3;
}

/* ── Toast ── */
.wl-toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  padding: 10px 20px;
  background: var(--ink-900);
  color: #fff;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  z-index: 9999;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s ease;
  max-width: 400px;
  box-shadow: var(--shadow-lg);
}

.wl-toast.show {
  transform: translateY(0);
  opacity: 1;
}

.wl-toast.error {
  background: var(--red);
}

/* ── No-data reason placeholder ── */
.wl-reason-empty {
  color: var(--ink-400);
  font-style: italic;
  font-size: 11.5px;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .wl-topnav .watchlist-container {
    flex-direction: column;
    align-items: flex-start;
  }

  .wl-nav-links { display: none; }

  .wl-timer-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .wl-timer-group {
    flex-direction: column;
    gap: 10px;
  }

  .wl-controls {
    flex-direction: column;
    align-items: flex-start;
  }

  .wl-search-input {
    width: 100%;
  }

  .wl-card-grid {
    grid-template-columns: 1fr;
  }

  .wl-stats-row {
    grid-template-columns: repeat(2, 1fr);
  }

  .wl-admin-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .wl-stats-row {
    grid-template-columns: 1fr;
  }
}

/* ── Dark Theme Overrides ── */
[data-theme="dark"] .wl-table .company-col {
  background: var(--bg-surface);
}

[data-theme="dark"] .wl-table tr:hover .company-col {
  background: var(--bg-elevated);
}

/* ── Reason markdown styles ── */
.wl-table .reason-cell p,
.wl-card-reason p {
  margin: 0 0 4px;
}

.wl-table .reason-cell ul,
.wl-card-reason ul {
  margin: 0;
  padding-left: 16px;
}

.wl-table .reason-cell li,
.wl-card-reason li {
  margin-bottom: 2px;
}

/* ── Scheduler Running Indicator ── */
.wl-scheduler-running {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  padding: 4px 10px;
  background: var(--accent-muted);
  border-radius: var(--radius-full);
}

.wl-scheduler-running .dot {
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 50%;
  animation: pulse-dot 1.5s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.8); }
}

/* ── Health Grid Overrides ── */
.health-grid {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr) !important;
  gap: 14px !important;
  align-items: start !important;
}

@media (max-width: 1024px) {
  .health-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

@media (max-width: 768px) {
  .health-grid {
    grid-template-columns: 1fr !important;
  }
}

/* ── Refreshing Card Highlighting ── */
.health-card.refreshing-card {
  border: 2px solid var(--accent) !important;
  box-shadow: 0 0 25px rgba(99, 102, 241, 0.6) !important;
  animation: wl-card-pulse 2s infinite ease-in-out;
  position: relative;
  z-index: 10;
}

@keyframes wl-card-pulse {
  0%, 100% {
    border-color: var(--accent);
    box-shadow: 0 0 25px rgba(99, 102, 241, 0.8) !important;
    background-color: rgba(99, 102, 241, 0.08) !important;
  }
  50% {
    border-color: rgba(99, 102, 241, 0.3);
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.2) !important;
    background-color: rgba(99, 102, 241, 0.02) !important;
  }
}

.wl-row-refreshing {
  background-color: rgba(99, 102, 241, 0.08) !important;
  animation: wl-row-pulse 2s infinite ease-in-out;
}

@keyframes wl-row-pulse {
  0%, 100% {
    background-color: rgba(99, 102, 241, 0.08);
    box-shadow: inset 0 0 10px rgba(99, 102, 241, 0.15) !important;
  }
  50% {
    background-color: transparent;
    box-shadow: none !important;
  }
}

/* ── Watchlist Status Banner ── */
.wl-status-banner-today {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(16, 185, 129, 0.08);
  color: var(--green);
  border: 1px solid rgba(16, 185, 129, 0.2);
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  margin-top: 10px;
}

.wl-status-banner-past {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-elevated);
  color: var(--muted);
  border: 1px solid var(--border);
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 500;
  margin-top: 10px;
}

.wl-status-pulse {
  display: inline-block;
  width: 8px;
  height: 8px;
  background-color: var(--green);
  border-radius: 50%;
  animation: wl-status-pulse-anim 1.5s infinite;
}

@keyframes wl-status-pulse-anim {
  0% { transform: scale(0.9); opacity: 1; box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1.1); opacity: 0.5; box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.9); opacity: 0; box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* ── Breaking News Bulletin Card ── */
.wl-bulletin-card {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.06) 0%, rgba(99, 102, 241, 0.03) 100%);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-left: 4px solid var(--red);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

[data-theme="dark"] .wl-bulletin-card {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, rgba(99, 102, 241, 0.05) 100%);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.wl-bulletin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.wl-bulletin-live-tag {
  background: var(--red);
  color: white;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 4px;
  letter-spacing: 1px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.wl-bulletin-ping {
  display: inline-block;
  width: 6px;
  height: 6px;
  background-color: white;
  border-radius: 50%;
  animation: wl-ping-anim 1s infinite alternate;
}

@keyframes wl-ping-anim {
  0% { transform: scale(0.8); opacity: 0.5; }
  100% { transform: scale(1.2); opacity: 1; }
}

.wl-bulletin-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
}

.wl-bulletin-nav button {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.wl-bulletin-nav button:hover {
  background: var(--border);
}

.wl-bulletin-body-wrapper {
  position: relative;
  min-height: 48px;
}

.wl-bulletin-body {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
}

.wl-bulletin-body.fade-in {
  animation: wl-fade-in-anim 0.4s ease-out forwards;
}

@keyframes wl-fade-in-anim {
  0% { opacity: 0; transform: translateY(4px); }
  100% { opacity: 1; transform: translateY(0); }
}

.wl-bulletin-badge {
  font-size: 16px;
  font-weight: 800;
  padding: 6px 12px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 100px;
  justify-content: center;
}

.wl-bulletin-badge.pos {
  background: rgba(16, 185, 129, 0.12);
  color: var(--green);
}

.wl-bulletin-badge.neg {
  background: rgba(239, 68, 68, 0.12);
  color: var(--red);
}

.wl-bulletin-info {
  flex-grow: 1;
}

.wl-bulletin-title {
  margin: 0 0 4px 0;
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text);
}

.wl-bulletin-title span {
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
  margin-left: 6px;
}

.wl-bulletin-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.4);
}

.wl-bulletin-reason {
  margin: 0;
  font-size: 14.5px;
  color: var(--muted);
  line-height: 1.55;
  font-weight: 500;
}

/* ── Stock Detail Modal ── */
.wl-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wl-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  animation: wl-fade-in 0.2s ease-out forwards;
}

.wl-modal-container {
  position: relative;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  width: 90%;
  max-width: 600px;
  padding: 24px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  animation: wl-slide-up 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  z-index: 1010;
}

.wl-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 18px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  z-index: 100 !important;
  pointer-events: auto !important;
}

.wl-modal-close:hover {
  color: var(--text);
  background: rgba(128, 128, 128, 0.1);
}

@keyframes wl-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes wl-slide-up {
  from { opacity: 0; transform: translateY(20px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
