:root {
  color-scheme: dark;
  --shell: #0c0c0c;
  --surface: #161616;
  --surface-2: #1e1e1e;
  --line: rgba(255, 255, 255, 0.06);
  --line-strong: rgba(255, 255, 255, 0.12);
  --ink: #e8e8e8;
  --mist: #888888;
  --accent: #a855f7;
  --accent-glow: rgba(168, 85, 247, 0.3);
  --ember: #ff8a3d;
  --up: #20c997;
  --down: #ef4444;
}

[data-theme="light"] {
  color-scheme: light;
  --shell: #fafafa;
  --surface: #ffffff;
  --surface-2: #f5f5f5;
  --line: rgba(0, 0, 0, 0.06);
  --line-strong: rgba(0, 0, 0, 0.12);
  --ink: #18181b;
  --mist: #71717a;
  --accent: #9333ea;
  --accent-glow: rgba(147, 51, 234, 0.3);
  --ember: #ea580c;
  --up: #059669;
  --down: #dc2626;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--shell);
  transition: background 300ms ease, color 300ms ease;
}

html {
  -webkit-text-size-adjust: 100%;
  scrollbar-gutter: stable;
  background: var(--shell, #0c0c0c);
}

body {
  font-family: "Noto Sans TC", sans-serif;
  color: var(--ink);
  overflow-x: hidden;
}

.font-mono, [class*="font-mono"] {
  font-variant-numeric: tabular-nums;
}

/* ========== app shell ========== */
.app-glow {
  display: none;
}

.app-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 248px 1fr;
  min-height: 100vh;
  transition: grid-template-columns 180ms ease;
}

html.sidebar-prefers-collapsed .app-shell,
.app-shell.sidebar-collapsed {
  grid-template-columns: 72px 1fr;
}

@media (max-width: 960px) {
  html.sidebar-prefers-collapsed .app-shell,
  .app-shell,
  .app-shell.sidebar-collapsed {
    grid-template-columns: 1fr;
  }
  .app-sidebar { display: none; }
}

/* ========== sidebar ========== */
.app-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 1.5rem 1.1rem;
  border-right: 1px solid var(--line);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  transition: padding 180ms ease, background 300ms ease;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.06) transparent;
}

.sidebar-brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.35rem 0.2rem 0.9rem;
  border-bottom: 1px solid var(--line);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.brand-copy {
  min-width: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  height: 38px;
  width: 38px;
  border-radius: 11px;
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.35), rgba(168, 85, 247, 0.1));
  border: 1px solid rgba(168, 85, 247, 0.35);
  font-family: "Manrope", sans-serif;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: #e9d5ff;
  font-size: 0.78rem;
  flex: 0 0 auto;
  box-shadow: 0 2px 12px rgba(168, 85, 247, 0.15);
  transition: box-shadow 200ms ease;
}

.sidebar-brand:hover .brand-mark {
  box-shadow: 0 2px 16px rgba(168, 85, 247, 0.25);
}

.brand-mark-img {
  display: block;
  height: 38px;
  width: 38px;
  border-radius: 11px;
  flex: 0 0 auto;
  box-shadow: 0 2px 12px rgba(168, 85, 247, 0.18);
  transition: box-shadow 200ms ease;
}

.sidebar-brand:hover .brand-mark-img {
  box-shadow: 0 2px 18px rgba(168, 85, 247, 0.32);
}

.brand-title {
  margin: 0;
  font-family: "Manrope", sans-serif;
  font-weight: 800;
  letter-spacing: 0.18em;
  font-size: 0.78rem;
  color: #fff;
}

.brand-sub {
  margin: 2px 0 0;
  font-size: 0.7rem;
  color: var(--mist);
  letter-spacing: 0.1em;
}

.sidebar-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: rgba(15, 26, 45, 0.7);
  color: #c3cfdf;
  transition: border-color 150ms ease, background 150ms ease, color 150ms ease, transform 150ms ease;
}

.sidebar-toggle:hover {
  border-color: rgba(168, 85, 247, 0.35);
  background: rgba(168, 85, 247, 0.08);
  color: #fff;
}

.sidebar-toggle-icon {
  display: block;
  width: 14px;
  height: 14px;
  transition: transform 180ms ease;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  flex: 1;
  position: relative;
}

.sidebar-section {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.66rem;
  letter-spacing: 0.22em;
  color: var(--mist);
  padding: 0.2rem 0.55rem;
  margin: 0.4rem 0 0.25rem;
}

.sidebar-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.5rem 0.7rem;
  font-size: 0.88rem;
  color: var(--mist);
  border-radius: 10px;
  transition: background 150ms ease, color 150ms ease, transform 150ms ease;
}

.sidebar-link:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.04);
  transform: translateX(2px);
}

.sidebar-link.is-active {
  color: var(--ink);
  background: rgba(168, 85, 247, 0.08);
  border-left: none;
  padding-left: 0.7rem;
  box-shadow: 0 0 12px rgba(168, 85, 247, 0.08);
}

.sidebar-link.is-active::before {
  content: "";
  position: absolute;
  left: 0;
  width: 3px;
  height: 24px;
  border-radius: 0 3px 3px 0;
  background: var(--accent);
}

.sidebar-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.55;
  transition: opacity 150ms ease;
}

.sidebar-link:hover .sidebar-icon {
  opacity: 0.85;
}

.sidebar-link.is-active .sidebar-icon {
  opacity: 1;
  color: var(--accent);
}

.sidebar-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-badge {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 10px;
  background: rgba(245, 158, 11, 0.8);
  color: #fff;
  font-size: 0.66rem;
  font-weight: 700;
}

.sidebar-foot {
  padding: 0.9rem 0.6rem 0.3rem;
  border-top: 1px solid var(--line);
}

html.sidebar-prefers-collapsed .app-sidebar,
.app-shell.sidebar-collapsed .app-sidebar {
  padding: 1.5rem 0.7rem;
  align-items: center;
}

html.sidebar-prefers-collapsed .sidebar-brand-row,
.app-shell.sidebar-collapsed .sidebar-brand-row {
  width: 100%;
  flex-direction: column;
  gap: 0.65rem;
  padding: 0.35rem 0 0.9rem;
}

html.sidebar-prefers-collapsed .sidebar-brand,
.app-shell.sidebar-collapsed .sidebar-brand {
  justify-content: center;
}

html.sidebar-prefers-collapsed .brand-copy,
.app-shell.sidebar-collapsed .brand-copy,
html.sidebar-prefers-collapsed .sidebar-section,
.app-shell.sidebar-collapsed .sidebar-section,
html.sidebar-prefers-collapsed .sidebar-foot,
.app-shell.sidebar-collapsed .sidebar-foot {
  display: none;
}

html.sidebar-prefers-collapsed .sidebar-toggle-icon,
.app-shell.sidebar-collapsed .sidebar-toggle-icon {
  transform: rotate(180deg);
}

html.sidebar-prefers-collapsed .sidebar-nav,
.app-shell.sidebar-collapsed .sidebar-nav {
  width: 100%;
  align-items: center;
  gap: 0.45rem;
}

html.sidebar-prefers-collapsed .sidebar-link,
.app-shell.sidebar-collapsed .sidebar-link {
  width: 42px;
  height: 42px;
  justify-content: center;
  gap: 0;
  padding: 0;
  border-radius: 12px;
}

html.sidebar-prefers-collapsed .sidebar-label,
.app-shell.sidebar-collapsed .sidebar-label {
  display: none;
}

html.sidebar-prefers-collapsed .sidebar-badge,
.app-shell.sidebar-collapsed .sidebar-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 14px;
  height: 14px;
  font-size: 0.55rem;
  padding: 0 3px;
}

html.sidebar-prefers-collapsed .sidebar-link.is-active::before,
.app-shell.sidebar-collapsed .sidebar-link.is-active::before {
  display: none;
}

html.sidebar-prefers-collapsed .sidebar-icon,
.app-shell.sidebar-collapsed .sidebar-icon {
  width: 20px;
  height: 20px;
}

/* Collapsed sidebar: CSS tooltip on hover */
html.sidebar-prefers-collapsed .sidebar-link[title]::after,
.app-shell.sidebar-collapsed .sidebar-link[title]::after {
  content: attr(title);
  position: absolute;
  left: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%) translateX(-4px);
  white-space: nowrap;
  font-size: 0.78rem;
  font-weight: 600;
  color: #fff;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(148, 163, 184, 0.18);
  padding: 0.35rem 0.7rem;
  border-radius: 8px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 150ms ease, transform 150ms ease;
  z-index: 100;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

html.sidebar-prefers-collapsed .sidebar-link[title]:hover::after,
.app-shell.sidebar-collapsed .sidebar-link[title]:hover::after {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

/* Collapsed sidebar: disable translateX on hover (centered icons) */
html.sidebar-prefers-collapsed .sidebar-link:hover,
.app-shell.sidebar-collapsed .sidebar-link:hover {
  transform: none;
}

@media (max-width: 960px) {
  .app-sidebar {
    display: none;
  }
}

/* ========== topbar ========== */
.app-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.app-topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.8rem 1.4rem;
  border-bottom: 1px solid var(--line);
  background: rgba(12, 12, 12, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: background 300ms ease;
}

.topbar-search {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  max-width: 820px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: 14px;
  padding: 0.4rem 0.5rem 0.4rem 0.9rem;
  transition: border-color 150ms ease;
}

.topbar-search:focus-within {
  border-color: rgba(168, 85, 247, 0.45);
  box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.1);
}

.topbar-search-icon {
  color: var(--mist);
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.topbar-search-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--ink);
  font-size: 0.95rem;
  padding: 0.45rem 0;
}

.topbar-search-input::placeholder { color: #556679; }

input.topbar-search-input {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

.topbar-mode {
  background: rgba(11, 19, 32, 0.8);
  color: #d8e2ec;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.4rem 0.6rem;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.78rem;
}

.topbar-submit {
  background: var(--accent);
  color: #04141a;
  font-weight: 800;
  font-family: "Manrope", sans-serif;
  letter-spacing: 0.1em;
  padding: 0.55rem 1.1rem;
  border-radius: 10px;
  transition: filter 150ms ease, transform 150ms ease;
}

.topbar-submit:hover { filter: brightness(1.1); }

.topbar-meta { display: flex; align-items: center; gap: 0.8rem; }

/* ========== user menu ========== */
.user-menu-wrap {
  position: relative;
}

.user-menu-btn {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.5rem 0.4rem;
  border-radius: 10px;
  background: none;
  border: none;
  color: var(--ink);
  cursor: pointer;
  transition: background 150ms;
}

.user-menu-btn:hover {
  background: rgba(148, 163, 184, 0.1);
}

.user-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), rgba(168, 85, 247, 0.7));
  color: #fff;
  font-weight: 700;
  font-size: 0.82rem;
  font-family: "Manrope", sans-serif;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(168, 85, 247, 0.25);
}

.user-name-col {
  display: flex;
  flex-direction: column;
  text-align: left;
  min-width: 0;
}

.user-display-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role {
  font-size: 0.68rem;
  color: var(--mist);
  letter-spacing: 0.05em;
}

.user-menu-dropdown {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  padding: 0.35rem;
  z-index: 200;
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.5);
  animation: menu-pop 150ms ease;
}

@keyframes menu-pop {
  from {
    opacity: 0;
    transform: translateY(4px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.user-menu-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.5rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 0.3rem;
}

.user-menu-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.6rem;
  border-radius: 8px;
  font-size: 0.82rem;
  color: var(--ink);
  text-decoration: none;
  transition: background 150ms;
  background: none;
  border: none;
  width: 100%;
  cursor: pointer;
  font-family: inherit;
}

.user-menu-item:hover {
  background: rgba(148, 163, 184, 0.1);
}

.user-menu-item-danger {
  color: #ef4444;
}

.user-menu-item-form {
  margin: 0;
}

.user-menu-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  opacity: 0.7;
}

/* topbar user avatar */
.topbar-user-wrap {
  position: relative;
}

.topbar-user-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px;
  display: flex;
  align-items: center;
}

.topbar-user-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), rgba(168, 85, 247, 0.7));
  color: #fff;
  font-weight: 700;
  font-size: 0.82rem;
  font-family: "Manrope", sans-serif;
  transition: box-shadow 150ms;
  box-shadow: 0 2px 8px rgba(168, 85, 247, 0.2);
}

.topbar-user-btn:hover .topbar-user-avatar {
  box-shadow: 0 0 0 2px rgba(168, 85, 247, 0.35);
}

.user-avatar-img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  box-shadow: 0 2px 8px rgba(168, 85, 247, 0.22);
}

.topbar-user-avatar-img {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  box-shadow: 0 2px 8px rgba(168, 85, 247, 0.2);
}

.topbar-user-btn:hover .topbar-user-avatar-img {
  box-shadow: 0 0 0 2px rgba(168, 85, 247, 0.35);
}

.topbar-user-dropdown {
  bottom: auto;
  top: calc(100% + 6px);
  left: auto;
  right: 0;
  min-width: 220px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.5);
  animation: menu-pop-down 150ms ease;
}

@keyframes menu-pop-down {
  from {
    opacity: 0;
    transform: translateY(-4px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.mobile-tabbar {
  display: none;
}

/* ========== content ========== */
.app-content {
  padding: 1.6rem 1.4rem 3rem;
  max-width: 1440px;
  width: 100%;
}

.page-stack {
  display: flex;
  flex-direction: column;
  gap: 1.6rem;
}

.eyebrow {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.66rem;
  letter-spacing: 0.24em;
  color: var(--mist);
  text-transform: uppercase;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 0.5rem;
}

.section-title {
  margin: 0.3rem 0 0;
  font-family: "Manrope", sans-serif;
  font-weight: 800;
  font-size: 1.5rem;
  color: #fff;
  letter-spacing: -0.01em;
}

.section-count {
  display: inline-flex;
  padding: 0.1rem 0.55rem;
  margin-left: 0.55rem;
  background: rgba(168, 85, 247, 0.15);
  color: #d8b4fe;
  border-radius: 999px;
  font-size: 0.85rem;
  font-family: "JetBrains Mono", monospace;
}

.section-lede {
  margin: 0.4rem 0 0;
  max-width: 620px;
  font-size: 0.88rem;
  color: var(--mist);
  line-height: 1.7;
}

.ghost-link {
  font-size: 0.83rem;
  color: var(--mist);
  border-bottom: 1px dashed var(--line-strong);
  padding-bottom: 2px;
}

.ghost-link:hover { color: #fff; border-bottom-color: var(--accent); }

.alert {
  margin-top: 1rem;
  border-radius: 12px;
  padding: 0.7rem 0.9rem;
  font-size: 0.88rem;
}

.alert-error {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.28);
  color: #fecaca;
}

.empty-card {
  border: 1px dashed var(--line-strong);
  border-radius: 16px;
  padding: 2.5rem 2rem;
  text-align: center;
  color: var(--mist);
  background: rgba(11, 19, 32, 0.25);
  font-size: 0.9rem;
  line-height: 1.7;
}

/* ========== panels ========== */
.panel {
  position: relative;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 14px;
  padding: 1.25rem 1.35rem;
  transition: background 300ms ease, border-color 300ms ease;
}

.panel-h {
  margin: 0.4rem 0 0;
  font-family: "Manrope", sans-serif;
  font-weight: 800;
  font-size: 1.2rem;
  color: #fff;
  letter-spacing: -0.005em;
}

.panel-body {
  margin-top: 0.85rem;
  font-size: 0.9rem;
  line-height: 1.8;
  color: #c3cfdf;
}

.chip-row {
  margin-top: 0.9rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid rgba(168, 85, 247, 0.22);
  background: rgba(168, 85, 247, 0.08);
  padding: 0.28rem 0.7rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #d8b4fe;
}

/* ========== unified badge system ========== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.66rem;
  letter-spacing: 0.14em;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: #cbd5e1;
  white-space: nowrap;
  transition: background 150ms ease, border-color 150ms ease;
}

.badge-purple {
  border-color: rgba(168, 85, 247, 0.35);
  background: rgba(168, 85, 247, 0.12);
  color: #e9d5ff;
}
.badge-blue {
  border-color: rgba(59, 130, 246, 0.35);
  background: rgba(59, 130, 246, 0.12);
  color: #bfdbfe;
}
.badge-green {
  border-color: rgba(16, 185, 129, 0.35);
  background: rgba(16, 185, 129, 0.14);
  color: #6ee7b7;
}
.badge-amber {
  border-color: rgba(251, 191, 36, 0.32);
  background: rgba(251, 191, 36, 0.1);
  color: #fde68a;
}
.badge-red {
  border-color: rgba(244, 63, 94, 0.32);
  background: rgba(244, 63, 94, 0.12);
  color: #fda4af;
}
.badge-cyan {
  border-color: rgba(94, 234, 212, 0.28);
  background: rgba(94, 234, 212, 0.08);
  color: #99f6e4;
}

/* Badge with dot indicator */
.badge-dot::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: currentColor;
  flex-shrink: 0;
}

/* Light mode badges */
[data-theme="light"] .badge {
  background: rgba(0, 0, 0, 0.03);
  border-color: var(--line);
  color: var(--mist);
}
[data-theme="light"] .badge-purple {
  border-color: rgba(147, 51, 234, 0.2);
  background: rgba(147, 51, 234, 0.06);
  color: #7c3aed;
}
[data-theme="light"] .badge-blue {
  border-color: rgba(59, 130, 246, 0.2);
  background: rgba(59, 130, 246, 0.06);
  color: #2563eb;
}
[data-theme="light"] .badge-green {
  border-color: rgba(16, 185, 129, 0.2);
  background: rgba(16, 185, 129, 0.06);
  color: #059669;
}
[data-theme="light"] .badge-amber {
  border-color: rgba(245, 158, 11, 0.2);
  background: rgba(245, 158, 11, 0.06);
  color: #d97706;
}
[data-theme="light"] .badge-red {
  border-color: rgba(239, 68, 68, 0.2);
  background: rgba(239, 68, 68, 0.06);
  color: #dc2626;
}
[data-theme="light"] .badge-cyan {
  border-color: rgba(20, 184, 166, 0.2);
  background: rgba(20, 184, 166, 0.06);
  color: #0d9488;
}

.bullet-list {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  font-size: 0.9rem;
  color: #d1dbe8;
  line-height: 1.8;
}

.bullet-row {
  position: relative;
  padding-left: 1.05rem;
}

.bullet-row::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.68rem;
  height: 6px;
  width: 6px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 8px rgba(168, 85, 247, 0.6);
}

.sub-card {
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  padding: 0.85rem 0.95rem;
}

.sub-card-label {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.66rem;
  letter-spacing: 0.2em;
  color: var(--mist);
}

.sub-list {
  margin-top: 0.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.88rem;
}

.sub-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  color: #c3cfdf;
}

.sub-empty {
  margin-top: 0.6rem;
  font-size: 0.84rem;
  color: var(--mist);
}

/* ========== hero ========== */
.hero-card {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(168, 85, 247, 0.18);
  border-radius: 24px;
  padding: 2.2rem 2rem;
  background:
    radial-gradient(ellipse 120% 80% at 10% 0%, rgba(168, 85, 247, 0.14), transparent 50%),
    radial-gradient(ellipse 100% 80% at 90% 100%, rgba(139, 92, 246, 0.08), transparent 50%),
    var(--surface);
  box-shadow: 0 4px 32px rgba(168, 85, 247, 0.06);
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  color: #c4b5fd;
  padding: 0.28rem 0.7rem;
  border-radius: 999px;
  background: rgba(168, 85, 247, 0.1);
  border: 1px solid rgba(168, 85, 247, 0.25);
}

.dot-pulse {
  height: 7px;
  width: 7px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(168, 85, 247, 0.7);
  animation: dot-pulse 1.8s ease-out infinite;
}

@keyframes dot-pulse {
  0% { box-shadow: 0 0 0 0 rgba(168, 85, 247, 0.5); }
  70% { box-shadow: 0 0 0 10px rgba(168, 85, 247, 0); }
  100% { box-shadow: 0 0 0 0 rgba(168, 85, 247, 0); }
}

.hero-title {
  margin: 1rem 0 0;
  font-family: "Manrope", sans-serif;
  font-size: clamp(1.8rem, 3.2vw, 2.7rem);
  font-weight: 800;
  line-height: 1.2;
  color: #fff;
  letter-spacing: -0.015em;
}

.hero-lede {
  margin: 1rem 0 0;
  max-width: 660px;
  color: #b2c0d1;
  font-size: 0.95rem;
  line-height: 1.85;
}

.hero-form { margin-top: 1.6rem; }

.hero-form-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.8rem;
  align-items: end;
}



.hero-input {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.hero-input > span {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  color: var(--mist);
}

.hero-input > input {
  border: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: 12px;
  padding: 0.85rem 1rem;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: 0.05em;
  transition: border-color 150ms ease;
}

.hero-input > input:focus {
  outline: none;
  border-color: rgba(168, 85, 247, 0.5);
  box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.15);
}

.hero-submit {
  background: var(--accent);
  color: #04141a;
  font-family: "Manrope", sans-serif;
  font-weight: 800;
  padding: 0.9rem 1.4rem;
  border-radius: 12px;
  letter-spacing: 0.06em;
  transition: filter 150ms ease, transform 150ms ease;
}

.hero-submit:hover { filter: brightness(1.1); }

.hero-mode-row {
  margin-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
}

.hero-refresh {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.83rem;
  color: #b2c0d1;
  margin-left: auto;
}

.hero-refresh input { accent-color: var(--accent); }

.mode-chip {
  position: relative;
  cursor: pointer;
  display: inline-flex;
}

.mode-chip input {
  position: absolute;
  opacity: 0;
  inset: 0;
}

.mode-chip span {
  display: flex;
  flex-direction: column;
  gap: 2px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(11, 19, 32, 0.6);
  padding: 0.55rem 0.85rem;
  min-width: 160px;
}

.mode-chip strong {
  font-family: "Manrope", sans-serif;
  font-size: 0.85rem;
  color: #fff;
}

.mode-chip small {
  font-size: 0.7rem;
  color: var(--mist);
  font-family: "JetBrains Mono", monospace;
}

.mode-chip input:checked + span {
  border-color: rgba(168, 85, 247, 0.45);
  background: rgba(168, 85, 247, 0.1);
}

/* ========== recent + flow cards ========== */
.recent-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.9rem;
}

.recent-card {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 16px;
  padding: 1rem 1.1rem;
  transition: border-color 200ms ease, transform 200ms ease, box-shadow 200ms ease;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.recent-card:hover {
  border-color: rgba(168, 85, 247, 0.22);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.recent-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.recent-ticker {
  font-family: "Manrope", sans-serif;
  font-weight: 800;
  font-size: 1.1rem;
  color: #fff;
  letter-spacing: 0.05em;
}

.recent-mode {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  color: var(--mist);
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  border: 1px solid var(--line);
}

.recent-name {
  margin: 0;
  font-weight: 600;
  color: #d1dbe8;
  font-size: 0.92rem;
}

.recent-sector {
  margin: 0;
  font-size: 0.76rem;
  color: var(--mist);
}

.recent-footer {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.78rem;
  font-family: "JetBrains Mono", monospace;
  color: var(--mist);
  padding-top: 0.4rem;
  border-top: 1px solid var(--line);
}

.recent-price { color: #fff; font-weight: 600; }
.recent-change.is-up { color: #5eead4; }
.recent-change.is-down { color: #fda4af; }
.recent-time { margin-left: auto; font-size: 0.7rem; }

.flow-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.9rem;
}

.flow-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.15rem 1.2rem;
  background: var(--surface);
  transition: border-color 200ms ease, transform 200ms ease, box-shadow 200ms ease;
  display: block;
}

.flow-card:hover {
  border-color: rgba(168, 85, 247, 0.22);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.flow-index {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.72rem;
  color: var(--accent);
  letter-spacing: 0.2em;
}

.flow-card h3 {
  margin: 0.5rem 0 0.4rem;
  font-family: "Manrope", sans-serif;
  font-weight: 800;
  font-size: 1.1rem;
  color: #fff;
}

.flow-card p { margin: 0; font-size: 0.85rem; line-height: 1.7; color: #b2c0d1; }

.flow-card-icon-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(168, 85, 247, 0.08);
  border: 1px solid rgba(168, 85, 247, 0.15);
  margin: 0.5rem 0 0.3rem;
}

.flow-card-icon {
  width: 20px;
  height: 20px;
  color: var(--accent);
  opacity: 0.8;
}

.flow-card:hover .flow-card-icon {
  opacity: 1;
}

[data-theme="light"] .flow-card-icon-wrap {
  background: rgba(147, 51, 234, 0.06);
  border-color: rgba(147, 51, 234, 0.12);
}

[data-theme="light"] .flow-card-icon {
  color: #7c3aed;
}

/* ========== history page ========== */
.history-tools {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.history-search {
  min-width: 280px;
  background: rgba(11, 19, 32, 0.7);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.55rem 0.9rem;
  color: var(--ink);
  font-size: 0.88rem;
  outline: none;
  transition: border-color 150ms ease;
}

.history-search:focus { border-color: rgba(168, 85, 247, 0.45); }

input.history-search {
  background: rgba(11, 19, 32, 0.7) !important;
  border-color: var(--line) !important;
  color: var(--ink) !important;
  box-shadow: none !important;
}

input.history-search::placeholder {
  color: #64748b;
}

.history-panel {
  padding: 0;
  overflow: hidden;
}

.history-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.history-table thead th {
  text-align: left;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.66rem;
  letter-spacing: 0.2em;
  color: var(--mist);
  padding: 0.9rem 1.1rem;
  border-bottom: 1px solid var(--line);
  background: rgba(5, 8, 14, 0.5);
  text-transform: uppercase;
}

.history-table tbody td {
  padding: 0.85rem 1.1rem;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.history-row { cursor: pointer; transition: background 120ms ease; }
.history-row:hover { background: rgba(168, 85, 247, 0.05); }
.history-row-failed { background: rgba(244, 63, 94, 0.035); }
.history-row-failed:hover { background: rgba(244, 63, 94, 0.08); }

.history-ticker {
  font-family: "Manrope", sans-serif;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.05em;
}

.history-name { color: var(--ink); font-weight: 600; }
.history-model { margin-top: 2px; font-family: "JetBrains Mono", monospace; font-size: 0.7rem; color: var(--mist); }
.history-sector { color: var(--mist); }
.history-error {
  max-width: 420px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #fca5a5;
}
.history-time { color: var(--mist); font-size: 0.8rem; }

/* ========== unified data table ========== */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.data-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  text-align: left;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.66rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--mist);
  padding: 0.9rem 1.1rem;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.data-table tbody td {
  padding: 0.85rem 1.1rem;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.data-table tbody tr {
  transition: background 120ms ease;
}

.data-table tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.015);
}

.data-table tbody tr:hover {
  background: rgba(168, 85, 247, 0.05);
}

/* ========== mode tags ========== */
.mode-tag {
  display: inline-flex;
  align-items: center;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.66rem;
  letter-spacing: 0.18em;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: #c3cfdf;
}

.mode-tag-opus { border-color: rgba(139, 92, 246, 0.35); background: rgba(139, 92, 246, 0.12); color: #ddd6fe; }
.mode-tag-sonnet { border-color: rgba(59, 130, 246, 0.35); background: rgba(59, 130, 246, 0.12); color: #bfdbfe; }
.mode-tag-cached { border-color: rgba(168, 85, 247, 0.4); background: rgba(168, 85, 247, 0.12); color: #e9d5ff; }

/* ========== report page ========== */
.report-masthead {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 1.5rem;
  border: 1px solid rgba(168, 85, 247, 0.18);
  border-radius: 20px;
  padding: 1.8rem 1.9rem;
  background:
    radial-gradient(circle at 0% 0%, rgba(168, 85, 247, 0.12), transparent 45%),
    rgba(15, 26, 45, 0.5);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(168, 85, 247, 0.06);
}

@media (max-width: 960px) {
  .report-masthead { grid-template-columns: 1fr; }
}

.report-masthead-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
}

.report-ticker {
  font-family: "Manrope", sans-serif;
  font-weight: 800;
  font-size: 1.5rem;
  color: #fff;
  letter-spacing: 0.04em;
}

.report-sector {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  color: var(--mist);
  margin-left: 0.3rem;
}

.report-name {
  margin: 0.6rem 0 0;
  font-family: "Manrope", sans-serif;
  font-size: clamp(1.6rem, 2.8vw, 2.2rem);
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.01em;
}

.report-summary {
  margin: 0.8rem 0 0;
  max-width: 720px;
  font-size: 0.92rem;
  line-height: 1.85;
  color: #c3cfdf;
}

.report-masthead-meta {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  border-left: 1px solid var(--line);
  padding-left: 1.25rem;
}

@media (max-width: 960px) {
  .report-masthead-meta { border-left: none; padding-left: 0; }
}

.meta-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  color: var(--mist);
  gap: 0.75rem;
}

.meta-actions {
  margin-top: 0.7rem;
  display: flex;
  gap: 0.5rem;
}

.action-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 10px;
  border: 1px solid rgba(168, 85, 247, 0.3);
  background: rgba(168, 85, 247, 0.1);
  padding: 0.5rem 0.9rem;
  min-height: 40px;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  transition: background 180ms ease, border-color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.action-pill:hover {
  background: rgba(168, 85, 247, 0.18);
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(168, 85, 247, 0.15);
}
.action-pill:active {
  transform: translateY(0);
  box-shadow: none;
}

.action-pill-muted {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.04);
}

/* company intro */
.company-report-form {
  margin-top: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.company-mode-select {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.company-mode-select > span,
.company-refresh {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.7rem;
  color: var(--mist);
}

.company-mode-select > span {
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.company-mode-select .topbar-mode { flex: 1; min-width: 0; }

.company-refresh {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  letter-spacing: 0.04em;
}

.company-refresh input { accent-color: var(--accent); }

.company-generate {
  justify-content: center;
  width: 100%;
  border: none;
  color: #04141a;
  background: var(--accent);
  cursor: pointer;
}

.company-generate:hover {
  color: #04141a;
  filter: brightness(1.08);
}

.company-inline-actions {
  margin-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.7rem;
}

.company-detail-list {
  margin-top: 1rem;
  display: grid;
  gap: 0.65rem;
}

.company-detail-list > div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(5, 8, 14, 0.34);
}

.company-detail-list span {
  color: var(--mist);
  font-size: 0.78rem;
}

.company-detail-list strong {
  color: #fff;
  font-size: 0.86rem;
  font-weight: 700;
  text-align: right;
}

/* metric strip */
.metric-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.7rem;
}

.metric-tile {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.95rem 1.1rem;
  background: var(--surface-2);
  transition: border-color 200ms ease, transform 200ms ease, box-shadow 200ms ease;
}

.metric-tile-label {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.66rem;
  letter-spacing: 0.2em;
  color: var(--mist);
  margin: 0;
}

.metric-tile-value {
  margin: 0.45rem 0 0;
  font-family: "Manrope", sans-serif;
  font-weight: 800;
  font-size: 1.4rem;
  color: #fff;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}

.metric-tile-sub {
  margin: 0.3rem 0 0;
  font-size: 0.78rem;
  color: var(--mist);
}

/* tabs */
.report-tabs {
  display: flex;
  gap: 0.3rem;
  padding: 0.3rem;
  border: 1px solid var(--line);
  background: rgba(11, 19, 32, 0.55);
  border-radius: 14px;
  overflow-x: auto;
  width: fit-content;
  max-width: 100%;
}

.report-tab {
  border: none;
  background: transparent;
  color: var(--mist);
  font-family: "Manrope", sans-serif;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 0.55rem 1rem;
  border-radius: 10px;
  cursor: pointer;
  letter-spacing: 0.02em;
  transition: background 150ms ease, color 150ms ease;
  white-space: nowrap;
}

.report-tab:hover { color: #fff; }

.report-tab.is-active {
  background: rgba(168, 85, 247, 0.12);
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(168, 85, 247, 0.32);
}

.report-panel { display: none; }
.report-panel.is-active { display: block; }

/* chart frame (anti-stretch) */
.chart-card {
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 0.9rem 1rem;
}

.chart-frame {
  position: relative;
  width: 100%;
  border-radius: 8px;
  overflow: hidden;
}

.chart-frame::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 8px;
  background: linear-gradient(
    90deg,
    var(--surface-2) 25%,
    rgba(148, 163, 184, 0.06) 50%,
    var(--surface-2) 75%
  );
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.6s ease-in-out infinite;
  z-index: 1;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.chart-frame.loaded::before {
  opacity: 0;
  pointer-events: none;
}

.chart-frame > canvas {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
}

#valuation-chart.is-pan-enabled {
  cursor: grab;
}

#valuation-chart.is-pan-enabled.is-panning {
  cursor: grabbing;
}

.chart-title {
  margin-bottom: 0.55rem;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  color: var(--mist);
}

/* sources */
.source-card {
  display: block;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(5, 8, 14, 0.5);
  padding: 0.85rem 1rem;
  transition: border-color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.source-card:hover {
  border-color: rgba(168, 85, 247, 0.35);
  transform: translateY(-1px);
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.1);
}

.source-card strong {
  display: block;
  color: #fff;
  font-size: 0.88rem;
  line-height: 1.5;
}

.source-card span {
  display: block;
  margin-top: 0.3rem;
  font-size: 0.76rem;
  color: var(--mist);
  font-family: "JetBrains Mono", monospace;
}

/* filter select (valuation / breadth) */
.filter-card { padding: 0.85rem 1rem; }

.filter-card span {
  display: block;
  margin-bottom: 0.5rem;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  color: var(--mist);
}

.filter-select {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(5, 8, 14, 0.55);
  color: #fff;
  padding: 0.65rem 0.8rem;
  min-height: 40px;
  font-size: 0.88rem;
  transition: border-color 180ms ease, box-shadow 180ms ease;
}
.filter-select:focus {
  border-color: rgba(168, 85, 247, 0.45);
  box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.08);
  outline: none;
}

/* valuation/breadth page tiles */
.mini-stat, .metric-card {
  position: relative;
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  padding: 1rem 1.1rem;
  transition: transform 200ms ease, border-color 200ms ease, box-shadow 200ms ease;
}
.mini-stat:hover, .metric-card:hover {
  transform: translateY(-2px);
  border-color: rgba(168, 85, 247, 0.25);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}
.mini-stat-label, .metric-card-label {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  color: var(--mist);
}
.mini-stat-value, .metric-card-value {
  margin-top: 0.5rem;
  font-family: "Manrope", sans-serif;
  font-size: 1.4rem;
  font-weight: 800;
  color: #fff;
  font-variant-numeric: tabular-nums;
}
.mini-stat-note, .metric-card-sub {
  margin-top: 0.35rem;
  color: var(--mist);
  font-size: 0.82rem;
}
.toggle-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  padding: 0.55rem 0.9rem;
  min-height: 40px;
  color: #dbe7f3;
  font-size: 0.82rem;
  font-weight: 600;
  transition: all 180ms ease;
  cursor: pointer;
}
.toggle-pill:hover {
  border-color: rgba(168, 85, 247, 0.22);
  background: rgba(168, 85, 247, 0.06);
}
.toggle-pill-active {
  background: rgba(168, 85, 247, 0.14);
  border-color: rgba(168, 85, 247, 0.34);
  color: #fff;
  box-shadow: 0 0 12px rgba(168, 85, 247, 0.12);
}
.toggle-pill-active:hover {
  background: rgba(168, 85, 247, 0.2);
}
.jump-card {
  display: flex;
  min-height: 110px;
  flex-direction: column;
  justify-content: space-between;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(11, 19, 32, 0.5);
  padding: 1rem 1.1rem;
  transition: 150ms ease;
}
.jump-card:hover { transform: translateY(-2px); border-color: rgba(168, 85, 247, 0.32); }
.jump-card span {
  font-family: "Manrope", sans-serif;
  font-weight: 800;
  color: #fff;
}
.jump-card small { color: var(--mist); }

/* ========== report: value prop, subline ========== */
.report-subline {
  margin: 0.35rem 0 0;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  color: var(--mist);
  text-transform: uppercase;
}

.value-prop {
  margin-top: 1rem;
  padding: 0.9rem 1.1rem;
  border-left: 3px solid var(--accent);
  background: rgba(168, 85, 247, 0.08);
  border-radius: 0 14px 14px 0;
}

.value-prop-label {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  color: #c4b5fd;
  text-transform: uppercase;
}

.value-prop-body {
  margin: 0.35rem 0 0;
  color: #dbe7f0;
  font-size: 0.95rem;
  line-height: 1.8;
}

/* ========== ETF exposure cards ========== */
.etf-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.8rem;
}

.etf-card {
  padding: 1.1rem 1.2rem;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(15, 26, 45, 0.7), rgba(11, 19, 32, 0.7));
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}
.etf-card:hover {
  transform: translateY(-2px);
  border-color: rgba(148, 163, 184, 0.25);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.etf-card-member {
  border-color: rgba(168, 85, 247, 0.35);
  background:
    radial-gradient(circle at 100% 0%, rgba(168, 85, 247, 0.15), transparent 50%),
    rgba(11, 19, 32, 0.75);
}

.etf-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.6rem;
}

.etf-name {
  font-family: "Manrope", sans-serif;
  font-weight: 800;
  font-size: 1.1rem;
  color: #fff;
  letter-spacing: 0.1em;
}

.etf-chip {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.66rem;
  letter-spacing: 0.18em;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--line);
}

.etf-chip-in { background: rgba(168, 85, 247, 0.15); color: #ddd6fe; border-color: rgba(168, 85, 247, 0.4); }
.etf-chip-out { background: rgba(148, 163, 184, 0.1); color: var(--mist); }

.etf-weight {
  margin: 0.4rem 0 0.3rem;
  font-family: "Manrope", sans-serif;
  font-weight: 800;
  font-size: 2rem;
  color: #fff;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.015em;
}

.etf-card-out .etf-weight { color: var(--mist); }

.etf-date {
  margin: 0;
  font-size: 0.76rem;
  color: var(--mist);
  font-family: "JetBrains Mono", monospace;
}

/* ========== price spotlight + headline stats ========== */
.price-spotlight {
  text-align: right;
  padding: 0.75rem 1rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(11, 19, 32, 0.6);
  min-width: 180px;
}

.price-spotlight-label {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.65rem;
  letter-spacing: 0.22em;
  color: var(--mist);
}

.price-spotlight-value {
  margin-top: 0.2rem;
  font-family: "Manrope", sans-serif;
  font-weight: 800;
  font-size: 1.55rem;
  color: #fff;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

.price-spotlight-change {
  margin-top: 0.1rem;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.85rem;
  font-weight: 600;
}

.price-spotlight-change.is-up { color: #5eead4; }
.price-spotlight-change.is-down { color: #fda4af; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 0.7rem;
}

.stat-tile {
  position: relative;
  padding: 1rem 1.15rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-2);
  overflow: hidden;
  transition: transform 200ms ease, box-shadow 200ms ease, border-color 200ms ease;
}
.stat-tile:hover {
  transform: translateY(-2px);
  border-color: rgba(168, 85, 247, 0.25);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
}

.stat-tile::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: var(--_c, var(--accent));
  opacity: 0.85;
}

.stat-tile-g { --_c: #a855f7; }
.stat-tile-y { --_c: #fbbf24; }
.stat-tile-b { --_c: #60a5fa; }
.stat-tile-r { --_c: #f87171; }
.stat-tile-p { --_c: #a78bfa; }
.stat-tile-o { --_c: #ff8a3d; }

.stat-tile-label {
  margin: 0;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.66rem;
  letter-spacing: 0.2em;
  color: var(--mist);
  text-transform: uppercase;
}

.stat-tile-value {
  margin: 0.55rem 0 0;
  font-family: "Manrope", sans-serif;
  font-weight: 800;
  font-size: 1.75rem;
  color: #fff;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.012em;
  line-height: 1.1;
}

/* ========== overview grid ========== */
.overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 1rem;
}

.company-overview-stack {
  grid-template-columns: 1fr;
}

/* ========== KPI tiles (earnings call) ========== */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.7rem;
}

.kpi-tile {
  position: relative;
  overflow: hidden;
  padding: 1.1rem 1.2rem;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  transition: transform 200ms ease, box-shadow 200ms ease, border-color 200ms ease;
}
.kpi-tile:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
}

.kpi-tile-g { border-color: rgba(168, 85, 247, 0.3); background: var(--surface-2); }
.kpi-tile-b { border-color: rgba(96, 165, 250, 0.3); background: var(--surface-2); }
.kpi-tile-y { border-color: rgba(251, 191, 36, 0.3); background: var(--surface-2); }
.kpi-tile-p { border-color: rgba(167, 139, 250, 0.3); background: var(--surface-2); }

.kpi-label {
  margin: 0;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  color: var(--mist);
  text-transform: uppercase;
}

.kpi-value {
  margin: 0.45rem 0 0.2rem;
  font-family: "Manrope", sans-serif;
  font-weight: 800;
  font-size: 2rem;
  color: #fff;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.015em;
  line-height: 1.1;
}

.kpi-yoy {
  margin: 0;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.82rem;
  color: #5eead4;
  font-weight: 600;
}

/* ========== tables ========== */
.segment-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.segment-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.segment-table thead th {
  text-align: left;
  padding: 0.7rem 0.95rem;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.66rem;
  letter-spacing: 0.18em;
  color: var(--mist);
  text-transform: uppercase;
  background: rgba(5, 8, 14, 0.5);
  border-bottom: 1px solid var(--line);
}

.segment-table tbody td {
  padding: 0.7rem 0.95rem;
  border-bottom: 1px solid var(--line);
}

.segment-table tbody tr:last-child td { border-bottom: none; }

.segment-name { font-weight: 600; color: var(--ink); }

/* ========== mix legend ========== */
.mix-legend {
  margin: 1rem 0 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.45rem;
  font-size: 0.82rem;
  color: #c3cfdf;
}

.mix-legend li {
  display: grid;
  grid-template-columns: 10px 1fr auto;
  align-items: center;
  gap: 0.55rem;
}

.mix-swatch {
  height: 10px;
  width: 10px;
  border-radius: 999px;
  background: var(--accent);
}

/* ========== relationships ========== */
.rel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.55rem;
}

.rel-card {
  border: 1px solid var(--line);
  background: rgba(5, 8, 14, 0.45);
  border-radius: 12px;
  padding: 0.65rem 0.85rem;
}

.rel-top {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  align-items: baseline;
}

.rel-name { font-weight: 700; color: #fff; font-size: 0.92rem; }
.rel-ticker {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.72rem;
  color: #5eead4;
  letter-spacing: 0.08em;
}

.rel-desc {
  margin: 0.35rem 0 0;
  font-size: 0.82rem;
  color: #b2c0d1;
  line-height: 1.7;
}

.rel-list { display: flex; flex-direction: column; gap: 0.55rem; }

.rel-row {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 0.75rem;
  border: 1px solid var(--line);
  background: rgba(5, 8, 14, 0.45);
  border-radius: 12px;
  padding: 0.7rem 0.9rem;
}

.rel-row-body { min-width: 0; }
.rel-row-top { display: flex; align-items: baseline; justify-content: space-between; gap: 0.5rem; }

.rel-type {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  text-align: center;
  padding: 0.28rem 0.4rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(148, 163, 184, 0.08);
  color: var(--mist);
  align-self: start;
  height: fit-content;
}

.rel-type-partner { background: rgba(168, 85, 247, 0.14); color: #ddd6fe; border-color: rgba(168, 85, 247, 0.35); }
.rel-type-supplier { background: rgba(96, 165, 250, 0.14); color: #bfdbfe; border-color: rgba(96, 165, 250, 0.35); }
.rel-type-customer { background: rgba(251, 191, 36, 0.14); color: #fde68a; border-color: rgba(251, 191, 36, 0.35); }
.rel-type-compete { background: rgba(239, 68, 68, 0.14); color: #fecaca; border-color: rgba(239, 68, 68, 0.35); }
.rel-type-proxy { background: rgba(167, 139, 250, 0.14); color: #e9d5ff; border-color: rgba(167, 139, 250, 0.35); }
.rel-type-related { background: rgba(148, 163, 184, 0.12); color: #dbe7f3; border-color: var(--line-strong); }

/* ========== risks / catalysts ========== */
.rc-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.panel-risk {
  border-color: rgba(239, 68, 68, 0.25);
  background: linear-gradient(180deg, rgba(60, 12, 12, 0.55), rgba(11, 19, 32, 0.85));
}
.panel-catalyst {
  border-color: rgba(251, 191, 36, 0.28);
  background: linear-gradient(180deg, rgba(68, 48, 4, 0.5), rgba(11, 19, 32, 0.85));
}
.panel-strategy {
  border-color: rgba(167, 139, 250, 0.3);
  background: linear-gradient(180deg, rgba(45, 26, 72, 0.5), rgba(11, 19, 32, 0.85));
}
.panel-guidance {
  border-color: rgba(168, 85, 247, 0.3);
  background: linear-gradient(180deg, rgba(6, 54, 40, 0.45), rgba(11, 19, 32, 0.85));
}

.rc-icon {
  font-size: 1.3rem;
  margin-bottom: 0.25rem;
  color: #fff;
  opacity: 0.8;
}

.rc-grid .bullet-list {
  gap: 0.9rem;
}

.rc-grid .bullet-row {
  padding: 0.9rem 1rem 0.9rem 1.4rem;
  border: 1px solid rgba(148, 163, 184, 0.1);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.18);
  transition: border-color 150ms ease, background 150ms ease, transform 150ms ease;
}
.rc-grid .bullet-row:hover {
  border-color: rgba(148, 163, 184, 0.2);
  background: rgba(15, 23, 42, 0.3);
  transform: translateX(2px);
}

.rc-grid .bullet-row::before {
  left: 0.65rem;
  top: 1.42rem;
}

.rc-item {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.rc-item-text {
  color: #dbe4f0;
}

.rc-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.rc-meta-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(15, 23, 42, 0.28);
  padding: 0.18rem 0.55rem;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.66rem;
  line-height: 1.2;
  letter-spacing: 0.08em;
  color: #cbd5e1;
}

.rc-meta-pill.rc-level-high {
  border-color: rgba(248, 113, 113, 0.34);
  background: rgba(248, 113, 113, 0.1);
  color: #fecaca;
}

.rc-meta-pill.rc-level-medium {
  border-color: rgba(251, 191, 36, 0.3);
  background: rgba(251, 191, 36, 0.09);
  color: #fde68a;
}

.rc-meta-pill.rc-level-low {
  border-color: rgba(94, 234, 212, 0.28);
  background: rgba(94, 234, 212, 0.08);
  color: #99f6e4;
}

.panel-risk .bullet-row::before {
  background: rgba(248, 113, 113, 0.95);
  box-shadow: 0 0 0 4px rgba(248, 113, 113, 0.14);
}

.panel-catalyst .bullet-row::before {
  background: rgba(245, 158, 11, 0.95);
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.14);
}

.panel-strategy .bullet-row::before {
  background: rgba(96, 165, 250, 0.95);
  box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.14);
}

/* ========== accordion ========== */
.accordion {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.acc-item {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(11, 19, 32, 0.55);
  overflow: hidden;
  transition: border-color 200ms ease, box-shadow 200ms ease;
}

.acc-item:hover { border-color: rgba(148, 163, 184, 0.2); }
.acc-item[open] {
  border-color: rgba(168, 85, 247, 0.3);
  box-shadow: 0 2px 12px rgba(168, 85, 247, 0.06);
}

.acc-summary {
  cursor: pointer;
  padding: 1rem 1.2rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: "Manrope", sans-serif;
  font-weight: 700;
  color: #fff;
  list-style: none;
  transition: background 150ms ease;
}

.acc-summary:hover {
  background: rgba(168, 85, 247, 0.04);
}

.acc-summary::-webkit-details-marker { display: none; }

.acc-index {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.72rem;
  color: var(--accent);
  letter-spacing: 0.15em;
}

.acc-title { flex: 1; font-size: 0.98rem; }

.acc-chevron {
  transition: transform 200ms ease;
  color: var(--mist);
}

.acc-item[open] .acc-chevron { transform: rotate(180deg); color: var(--accent); }

.acc-body {
  padding: 0 1.25rem 1.15rem;
  font-size: 0.9rem;
  line-height: 1.9;
  color: #d1dbe8;
  white-space: normal;
}

.rich-analysis > :first-child { margin-top: 0; }
.rich-analysis > :last-child { margin-bottom: 0; }

.md-h {
  margin: 1.2rem 0 0.5rem;
  font-family: "Manrope", sans-serif;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: #f8fafc;
}

.md-h1 { font-size: 1.18rem; }
.md-h2 { font-size: 1.08rem; }
.md-h3 { font-size: 1rem; }
.md-h4 { font-size: 0.94rem; }

.md-p {
  margin: 0.75rem 0 0;
  color: #d1dbe8;
  line-height: 1.92;
}

.md-list {
  margin: 0.8rem 0 0;
  padding-left: 1.15rem;
  display: grid;
  gap: 0.45rem;
}

.md-li {
  color: #dbe4f0;
  line-height: 1.85;
  padding-left: 0.1rem;
}

.md-li strong,
.md-p strong {
  color: #f8fafc;
  font-weight: 800;
}

.md-table-wrap {
  margin-top: 1rem;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(5, 8, 14, 0.35);
}

.md-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 520px;
  font-size: 0.86rem;
  color: #dbe4f0;
}

.md-table th,
.md-table td {
  padding: 0.72rem 0.9rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.md-table th {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  color: #cbd5e1;
  text-transform: uppercase;
  background: rgba(148, 163, 184, 0.08);
}

.md-table tr:last-child td { border-bottom: none; }

.inline-code {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.85em;
  padding: 0.12rem 0.38rem;
  border-radius: 0.42rem;
  background: rgba(148, 163, 184, 0.14);
  color: #f8fafc;
}

/* ========== masthead meta tweak ========== */
.report-masthead { grid-template-columns: 1fr 300px; }

/* highlight tokens */
.hl {
  display: inline;
  padding: 0;
  margin: 0;
  border-radius: 0;
  font-weight: 700;
  background: transparent;
  color: inherit;
  box-shadow: none;
  box-decoration-break: initial;
  -webkit-box-decoration-break: initial;
}

.hl-g { color: #6ee7b7; }
.hl-y { color: #fbbf24; }
.hl-b { color: #93c5fd; }
.hl-r { color: #fda4af; }
.hl-p { color: #c4b5fd; }
.hl-o { color: #fdba74; }



/* Job queue */
.job-row {
  display: block;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(255, 255, 255, 0.03);
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.job-row:hover { border-color: rgba(148, 163, 184, 0.38); background: rgba(255, 255, 255, 0.06); }
.job-row[data-status="running"] { border-color: rgba(251, 191, 36, 0.45); }
.job-row[data-status="failed"] { border-color: rgba(244, 63, 94, 0.45); }
.job-row[data-status="completed"] { border-color: rgba(16, 185, 129, 0.35); }
.job-row[data-status="cancelled"],
.job-row[data-status="cancelling"] { border-color: rgba(148, 163, 184, 0.35); opacity: 0.78; }
.job-row-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.job-row-bar { margin-top: 10px; height: 4px; border-radius: 999px; background: rgba(148,163,184,0.12); overflow: hidden; }
.job-row-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #34d399, #38bdf8);
  transition: width 0.4s ease;
}
.job-row-foot { margin-top: 6px; }
.job-status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 999px; background: #38bdf8; flex: none; }
.job-status-tag {
  display: inline-flex; align-items: center;
  padding: 2px 10px; border-radius: 999px;
  font-size: 10px; letter-spacing: 0.18em;
  background: rgba(148, 163, 184, 0.12); color: #cbd5e1;
}
.job-row[data-status="running"] .job-status-tag { background: rgba(251, 191, 36, 0.18); color: #fbbf24; }
.job-row[data-status="completed"] .job-status-tag { background: rgba(16, 185, 129, 0.2); color: #6ee7b7; }
.job-row[data-status="failed"] .job-status-tag { background: rgba(244, 63, 94, 0.2); color: #fda4af; }
.job-row[data-status="cancelled"] .job-status-tag,
.job-row[data-status="cancelling"] .job-status-tag { background: rgba(148, 163, 184, 0.16); color: #cbd5e1; }
.job-stop-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  border-radius: 999px;
  border: 1px solid rgba(244, 63, 94, 0.34);
  background: rgba(244, 63, 94, 0.12);
  padding: 0.2rem 0.7rem;
  color: #fecaca;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: background 150ms ease, border-color 150ms ease, color 150ms ease;
}
.job-stop-button:hover {
  border-color: rgba(244, 63, 94, 0.6);
  background: rgba(244, 63, 94, 0.2);
  color: #fff;
}
.job-stop-button:disabled {
  cursor: wait;
  opacity: 0.65;
}

/* Job detail page */
.job-step {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  background: rgba(255, 255, 255, 0.03);
}
.job-step[data-status="running"] { border-color: rgba(251, 191, 36, 0.5); background: rgba(251,191,36,0.06); }
.job-step[data-status="done"] { border-color: rgba(16, 185, 129, 0.45); }
.job-step[data-status="skipped"] { border-color: rgba(148, 163, 184, 0.3); opacity: 0.75; }
.job-step[data-status="failed"] { border-color: rgba(244, 63, 94, 0.5); background: rgba(244,63,94,0.06); }
.job-step[data-status="cancelled"] { border-color: rgba(148, 163, 184, 0.35); background: rgba(148,163,184,0.06); }
.job-step-index {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 999px;
  background: rgba(148, 163, 184, 0.15); color: #cbd5e1;
  font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 11px;
}
.job-step-icon {
  display: inline-block; width: 10px; height: 10px; border-radius: 999px;
  background: rgba(148, 163, 184, 0.45);
}
.job-step[data-status="running"] .job-step-icon { background: #fbbf24; animation: pulseDot 1.2s infinite; }
.job-step[data-status="done"] .job-step-icon { background: #34d399; }
.job-step[data-status="skipped"] .job-step-icon { background: #94a3b8; }
.job-step[data-status="failed"] .job-step-icon { background: #f43f5e; }
.job-step[data-status="cancelled"] .job-step-icon { background: #94a3b8; }
.job-step-status-tag {
  font-size: 10px; letter-spacing: 0.18em;
  padding: 2px 8px; border-radius: 999px;
  background: rgba(148, 163, 184, 0.12); color: #cbd5e1;
}
.job-step[data-status="running"] .job-step-status-tag { background: rgba(251, 191, 36, 0.2); color: #fbbf24; }
.job-step[data-status="done"] .job-step-status-tag { background: rgba(16, 185, 129, 0.18); color: #6ee7b7; }
.job-step[data-status="skipped"] .job-step-status-tag { background: rgba(148,163,184,0.2); color: #cbd5e1; }
.job-step[data-status="failed"] .job-step-status-tag { background: rgba(244, 63, 94, 0.22); color: #fda4af; }
.job-step[data-status="cancelled"] .job-step-status-tag { background: rgba(148,163,184,0.2); color: #cbd5e1; }

@keyframes pulseDot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.35); opacity: 0.5; }
}

/* AI Evaluation panel */
.ai-eval-panel .panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.ai-eval-panel .panel-title {
  margin: 0.35rem 0 0;
  font-family: "Manrope", sans-serif;
  font-size: 1.32rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.01em;
}

.ai-eval-panel .panel-heading p {
  margin: 0.45rem 0 0;
  max-width: 52rem;
  font-size: 0.78rem;
  line-height: 1.7;
  color: var(--mist);
}

.ai-eval-panel {
  position: relative;
  overflow: hidden;
  padding: 1.6rem 1.65rem;
  background:
    radial-gradient(140% 80% at 100% 0%, rgba(168, 85, 247, 0.06), transparent 60%),
    radial-gradient(140% 80% at 0% 100%, rgba(56, 189, 248, 0.04), transparent 55%),
    rgba(255, 255, 255, 0.02);
}
.ai-eval-panel[data-stance="bullish"] { box-shadow: inset 0 0 0 1px rgba(16, 185, 129, 0.35); }
.ai-eval-panel[data-stance="bearish"] { box-shadow: inset 0 0 0 1px rgba(244, 63, 94, 0.35); }
.ai-eval-panel[data-stance="neutral"] { box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.28); }

.ai-eval-header-tags { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ai-eval-stance {
  padding: 4px 12px; border-radius: 999px;
  font-size: 11px; letter-spacing: 0.22em; font-weight: 700;
  background: rgba(148, 163, 184, 0.14); color: #cbd5e1;
  border: 1px solid rgba(148, 163, 184, 0.28);
}
.ai-eval-stance-bullish { background: rgba(16, 185, 129, 0.18); color: #6ee7b7; border-color: rgba(16, 185, 129, 0.45); }
.ai-eval-stance-bearish { background: rgba(244, 63, 94, 0.18); color: #fda4af; border-color: rgba(244, 63, 94, 0.45); }
.ai-eval-stance-neutral { background: rgba(251, 191, 36, 0.16); color: #fbbf24; border-color: rgba(251, 191, 36, 0.38); }
.ai-eval-rating {
  padding: 4px 12px; border-radius: 999px;
  font-size: 12px; font-weight: 600; color: var(--ink);
  background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(148, 163, 184, 0.22);
}

.ai-eval-conviction { margin-top: 22px; }
.ai-eval-conviction-label {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.68rem;
  letter-spacing: 0.15em;
  color: var(--mist);
  text-transform: uppercase;
}
.ai-eval-bar {
  margin-top: 8px; height: 10px; border-radius: 999px;
  background: rgba(148, 163, 184, 0.14); overflow: hidden;
}
.ai-eval-bar-fill {
  height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, #94a3b8, #94a3b8);
  transition: width 0.5s ease;
}
.ai-eval-panel[data-stance="bullish"] .ai-eval-bar-fill { background: linear-gradient(90deg, #34d399, #20c997); }
.ai-eval-panel[data-stance="bearish"] .ai-eval-bar-fill { background: linear-gradient(90deg, #f87171, #ef4444); }
.ai-eval-panel[data-stance="neutral"] .ai-eval-bar-fill { background: linear-gradient(90deg, #fbbf24, #f59e0b); }

.ai-eval-thesis {
  margin-top: 22px;
  font-size: 15px; line-height: 1.9;
  color: var(--ink);
  padding: 18px 22px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.36);
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-left: 3px solid rgba(168, 85, 247, 0.45);
}

.ai-eval-horizon {
  margin-top: 22px;
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.ai-eval-horizon-card {
  padding: 16px 18px; border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  background: rgba(15, 23, 42, 0.26);
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}
.ai-eval-horizon-card:hover {
  transform: translateY(-2px);
  border-color: rgba(168, 85, 247, 0.3);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}
.ai-eval-horizon-body { margin-top: 8px; font-size: 13px; line-height: 1.75; color: #cbd5e1; }

.ai-eval-grid {
  margin-top: 22px;
  display: grid; gap: 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.ai-eval-list { margin-top: 10px; display: flex; flex-direction: column; gap: 10px; }
.ai-eval-list li {
  position: relative; padding: 12px 14px 12px 30px;
  border-radius: 12px; background: rgba(15, 23, 42, 0.24);
  border: 1px solid rgba(148, 163, 184, 0.1);
  font-size: 13.5px; line-height: 1.7; color: #dbe4f0;
  transition: border-color 150ms ease, background 150ms ease;
}
.ai-eval-list li:hover {
  border-color: rgba(148, 163, 184, 0.22);
  background: rgba(15, 23, 42, 0.36);
}
.ai-eval-list li::before {
  content: ""; position: absolute; left: 12px; top: 18px;
  width: 6px; height: 6px; border-radius: 999px; background: rgba(148, 163, 184, 0.85);
}

.ai-eval-scenarios {
  margin-top: 22px;
  display: grid; gap: 14px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.ai-eval-scenario {
  padding: 16px 18px; border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(15, 23, 42, 0.24);
  transition: transform 180ms ease, box-shadow 180ms ease;
}
.ai-eval-scenario:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}
.ai-eval-scenario-head {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 11px; letter-spacing: 0.22em; color: #cbd5e1;
}
.ai-eval-scenario p { margin-top: 10px; font-size: 13px; line-height: 1.72; color: #cbd5e1; }
.ai-eval-scenario-bull { border-color: rgba(16, 185, 129, 0.35); background: rgba(16, 185, 129, 0.06); }
.ai-eval-scenario-bull .ai-eval-scenario-head { color: #6ee7b7; }
.ai-eval-scenario-base { border-color: rgba(251, 191, 36, 0.32); background: rgba(251, 191, 36, 0.05); }
.ai-eval-scenario-base .ai-eval-scenario-head { color: #fbbf24; }
.ai-eval-scenario-bear { border-color: rgba(244, 63, 94, 0.32); background: rgba(244, 63, 94, 0.05); }
.ai-eval-scenario-bear .ai-eval-scenario-head { color: #fda4af; }

.ai-eval-flip {
  margin-top: 22px;
  padding: 16px 18px; border-radius: 14px;
  border: 1px dashed rgba(168, 85, 247, 0.3);
  background: rgba(15, 23, 42, 0.22);
}

.ai-eval-disclaimer {
  margin-top: 22px;
  font-size: 12px; font-style: italic; color: #94a3b8;
}



/* ========== NEXT EARNINGS FORECAST ========== */
.nef-scenarios {
  margin-top: 18px;
  display: grid; gap: 14px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.nef-card {
  padding: 18px 18px 16px; border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(15, 23, 42, 0.24);
  display: flex; flex-direction: column; gap: 10px;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}
.nef-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  border-color: rgba(148, 163, 184, 0.28);
}
.nef-card-head {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; letter-spacing: 0.18em; font-weight: 700;
}
.nef-icon { font-size: 14px; }
.nef-label { flex: 1; }
.nef-prob {
  font-family: ui-monospace, Menlo, monospace;
  font-size: 13px; font-weight: 600;
}
.nef-move {
  font-size: 12px; color: #94a3b8;
  font-family: ui-monospace, Menlo, monospace;
  padding: 4px 10px; border-radius: 8px;
  background: rgba(148,163,184,0.08);
}
.nef-conditions { margin-top: 2px; }
.nef-cond-label {
  font-size: 10px; letter-spacing: 0.16em; color: #64748b;
  text-transform: uppercase; margin-bottom: 6px;
}
.nef-cond-item {
  padding: 8px 10px; border-radius: 10px;
  background: rgba(15, 23, 42, 0.35);
  margin-bottom: 6px;
}
.nef-cond-metric {
  font-size: 11px; font-weight: 600; color: #e2e8f0;
  letter-spacing: 0.06em;
}
.nef-cond-threshold {
  font-size: 13px; font-weight: 700; color: #f8fafc;
  font-family: ui-monospace, Menlo, monospace;
  margin-top: 2px;
}
.nef-cond-rationale {
  font-size: 12px; color: #94a3b8; margin-top: 3px; line-height: 1.6;
}
.nef-hist {
  margin-top: auto; padding-top: 8px;
  border-top: 1px dashed rgba(148,163,184,0.18);
}
.nef-hist-label {
  font-size: 10px; letter-spacing: 0.14em; color: #64748b;
  text-transform: uppercase; margin-bottom: 4px;
}
.nef-hist p { font-size: 12px; color: #cbd5e1; line-height: 1.65; }

/* up (green) */
.nef-card-up { border-color: rgba(16, 185, 129, 0.35); background: rgba(16, 185, 129, 0.06); }
.nef-card-up .nef-card-head { color: #6ee7b7; }
.nef-card-up .nef-prob { color: #34d399; }
.nef-card-up .nef-move { color: #6ee7b7; background: rgba(16,185,129,0.10); }
/* flat (yellow) */
.nef-card-flat { border-color: rgba(251, 191, 36, 0.32); background: rgba(251, 191, 36, 0.05); }
.nef-card-flat .nef-card-head { color: #fbbf24; }
.nef-card-flat .nef-prob { color: #fbbf24; }
.nef-card-flat .nef-move { color: #fbbf24; background: rgba(251,191,36,0.08); }
/* down (red) */
.nef-card-down { border-color: rgba(244, 63, 94, 0.32); background: rgba(244, 63, 94, 0.05); }
.nef-card-down .nef-card-head { color: #fda4af; }
.nef-card-down .nef-prob { color: #fda4af; }
.nef-card-down .nef-move { color: #fda4af; background: rgba(244,63,94,0.08); }

.nef-guidance-panel { margin-top: 14px; }
.nef-watch-panel { margin-top: 14px; }
.nef-disclaimer {
  margin-top: 12px;
  font-size: 12px; font-style: italic; color: #94a3b8;
}



/* ========== RELATIVE VALUATION (v2) ========== */
.rel-val-panel {
  position: relative; overflow: hidden;
  --rv-accent: #94a3b8;
  --rv-accent-soft: rgba(148,163,184,0.14);
}
.rel-val-panel[data-verdict="便宜"]    { --rv-accent: #34d399; --rv-accent-soft: rgba(32,201,151,0.18); }
.rel-val-panel[data-verdict="略便宜"] { --rv-accent: #5eead4; --rv-accent-soft: rgba(94,234,212,0.14); }
.rel-val-panel[data-verdict="接近中位"]{ --rv-accent: #a3b3c7; --rv-accent-soft: rgba(148,163,184,0.14); }
.rel-val-panel[data-verdict="略偏貴"] { --rv-accent: #fbbf24; --rv-accent-soft: rgba(245,158,11,0.16); }
.rel-val-panel[data-verdict="昂貴"]    { --rv-accent: #f87171; --rv-accent-soft: rgba(239,68,68,0.20); }

.rel-val-panel::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(720px 260px at 100% -10%, var(--rv-accent-soft), transparent 55%),
    radial-gradient(500px 220px at 0% 110%, rgba(15,23,42,0.6), transparent 60%);
}
.rel-val-panel > * { position: relative; }

.rel-val-hero {
  margin-top: 0;
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.1fr);
  gap: 1.5rem;
  padding: 1.35rem 1.5rem 1.1rem;
  border: 1px solid rgba(148,163,184,0.18);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(15,23,42,0.8), rgba(2,6,13,0.55));
  box-shadow:
    0 1px 0 rgba(255,255,255,0.03) inset,
    0 18px 40px -20px rgba(0,0,0,0.6);
}

.rel-val-hero-left { display: flex; flex-direction: column; justify-content: space-between; min-width: 0; }
.rel-val-hero-tag {
  display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap;
}
.rel-val-metric-name {
  font-size: 0.7rem; letter-spacing: 0.16em; text-transform: uppercase;
  color: #94a3b8; font-weight: 600;
}
.rel-val-hero-z {
  margin-top: 0.5rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 4rem; font-weight: 800; line-height: 1;
  color: var(--rv-accent);
  letter-spacing: -0.04em;
  text-shadow: 0 0 40px color-mix(in srgb, var(--rv-accent) 35%, transparent);
}
.rel-val-hero-sign { font-size: 2.2rem; vertical-align: 0.6rem; margin-right: 0.1rem; opacity: 0.85; }
.rel-val-hero-unit { font-size: 1.6rem; margin-left: 0.25rem; color: #94a3b8; font-weight: 600; letter-spacing: 0; }
.rel-val-hero-caption { margin-top: 0.35rem; font-size: 0.78rem; color: #64748b; letter-spacing: 0.02em; }

.rel-val-hero-mini {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.65rem;
  padding-top: 0.9rem;
  border-top: 1px dashed rgba(148,163,184,0.18);
}
.rel-val-hero-mini .k { font-size: 0.65rem; letter-spacing: 0.1em; text-transform: uppercase; color: #64748b; }
.rel-val-hero-mini .v { margin-top: 0.15rem; font-family: ui-monospace, Menlo, monospace; font-size: 0.95rem; color: #f1f5f9; font-weight: 600; }

.rel-val-hero-right {
  min-width: 0;
  display: flex; flex-direction: column; justify-content: center;
  padding: 0.25rem 0 0;
}
.rel-val-curve-label {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 0.62rem; letter-spacing: 0.18em; text-transform: uppercase;
  color: #64748b; margin-bottom: 0.35rem; font-weight: 600;
}
.rel-val-curve-sublabel { letter-spacing: 0.06em; text-transform: none; font-weight: 500; color: #94a3b8; }
.rel-val-curve { width: 100%; height: auto; display: block; color: var(--rv-accent); }
.rel-val-curve-needle { stroke: var(--rv-accent); }
.rel-val-curve-dot { fill: var(--rv-accent); filter: drop-shadow(0 0 6px color-mix(in srgb, var(--rv-accent) 60%, transparent)); }
.rel-val-curve-tag { fill: var(--rv-accent); }

.rel-val-summary {
  margin-top: 1rem;
  display: flex; gap: 0.8rem; align-items: flex-start;
  font-size: 0.92rem; line-height: 1.75; color: var(--ink);
  padding: 0.85rem 1.1rem;
  border: 1px solid rgba(148,163,184,0.12);
  border-left: 3px solid var(--rv-accent);
  border-radius: 10px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--rv-accent) 8%, transparent), rgba(15,23,42,0.5) 40%);
}
.rel-val-summary-mark {
  flex: none;
  font-size: 0.62rem; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--rv-accent); font-weight: 700;
  padding: 0.2rem 0.5rem; border: 1px solid currentColor; border-radius: 4px;
  align-self: center;
}

.rel-val-table-wrap { margin-top: 1rem; overflow-x: auto; }
.rel-val-table {
  width: 100%; border-collapse: separate; border-spacing: 0;
  font-size: 0.85rem;
}
.rel-val-table thead th {
  text-align: left; padding: 0.55rem 0.9rem;
  font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: #64748b; border-bottom: 1px solid rgba(148,163,184,0.15);
  font-weight: 500;
}
.rel-val-table tbody td {
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid rgba(148,163,184,0.08);
  color: #cbd5e1;
}
.rel-val-table tbody tr:hover td { background: rgba(148,163,184,0.04); }
.rel-val-table tbody tr.is-primary td { background: rgba(125,211,252,0.06); }
.rel-val-table tbody tr.is-primary td:first-child { border-left: 2px solid rgba(125,211,252,0.55); padding-left: calc(0.9rem - 2px); }
.rel-val-primary-tag {
  display: inline-block; margin-left: 0.3rem;
  font-size: 0.6rem; padding: 0.05rem 0.35rem; border-radius: 4px;
  background: rgba(125,211,252,0.15); color: #7dd3fc; letter-spacing: 0.1em;
}

.rel-val-verdict {
  display: inline-block;
  font-size: 0.7rem; padding: 0.15rem 0.55rem; border-radius: 999px;
  border: 1px solid currentColor; font-weight: 600;
  white-space: nowrap;
}
.rel-val-verdict-便宜 { color: #20c997; background: rgba(32,201,151,0.08); }
.rel-val-verdict-略便宜 { color: #5eead4; background: rgba(94,234,212,0.06); }
.rel-val-verdict-接近中位 { color: #94a3b8; background: rgba(148,163,184,0.06); }
.rel-val-verdict-略偏貴 { color: #f59e0b; background: rgba(245,158,11,0.08); }
.rel-val-verdict-昂貴 { color: #ef4444; background: rgba(239,68,68,0.10); }

@media (max-width: 960px) {
  .rel-val-hero { grid-template-columns: 1fr; padding: 1.1rem 1.15rem; gap: 1.25rem; }
  .rel-val-hero-z { font-size: 3rem; }
  .rel-val-hero-mini { grid-template-columns: repeat(2, 1fr); }
  .rel-val-table { font-size: 0.78rem; }
  .rel-val-table thead th, .rel-val-table tbody td { padding: 0.5rem 0.55rem; }
}

/* ========== mobile refinement ========== */
@media (max-width: 760px) {
  .app-shell {
    min-height: 100svh;
  }

  .app-topbar {
    align-items: stretch;
    gap: 0.65rem;
    padding: 0.7rem 0.85rem;
  }

  .topbar-search {
    width: 100%;
    max-width: none;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 0.45rem 0.55rem;
    align-items: center;
    padding: 0.45rem;
    border-radius: 16px;
  }

  .topbar-search-icon {
    grid-column: 1;
    grid-row: 1;
    padding-left: 0.35rem;
  }

  .topbar-search-input {
    grid-column: 2 / 4;
    grid-row: 1;
    min-width: 0;
    padding: 0.55rem 0.2rem;
    font-size: 0.9rem;
  }

  .topbar-mode {
    grid-column: 1 / 3;
    grid-row: 2;
    width: 100%;
    min-width: 0;
    min-height: 44px;
    padding: 0.55rem 0.65rem;
  }

  .topbar-submit {
    grid-column: 3;
    grid-row: 2;
    min-height: 44px;
    padding: 0.55rem 0.75rem;
    letter-spacing: 0.06em;
    white-space: nowrap;
  }

  .topbar-meta {
    display: none;
  }

  .mobile-tabbar {
    position: fixed;
    left: max(0.75rem, env(safe-area-inset-left));
    right: max(0.75rem, env(safe-area-inset-right));
    bottom: max(0.75rem, env(safe-area-inset-bottom));
    z-index: 50;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.25rem;
    padding: 0.35rem;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 18px;
    background: rgba(5, 8, 14, 0.9);
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(16px);
  }

  .mobile-tab {
    display: flex;
    min-width: 0;
    min-height: 52px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.22rem;
    border-radius: 14px;
    color: #7f93aa;
    font-family: "Manrope", sans-serif;
    font-size: 0.68rem;
    font-weight: 700;
    text-decoration: none;
    transition: background 150ms ease, color 150ms ease;
  }

  .mobile-tab-icon {
    width: 20px;
    height: 20px;
    opacity: 0.55;
    transition: opacity 150ms ease;
  }

  .mobile-tab.is-active {
    background: rgba(168, 85, 247, 0.13);
    color: #fff;
  }

  .mobile-tab.is-active .mobile-tab-icon {
    opacity: 1;
    color: var(--accent);
  }

  .app-content {
    max-width: none;
    padding: 1rem 0.85rem calc(6.2rem + env(safe-area-inset-bottom));
  }

  .page-stack {
    gap: 1.15rem;
  }

  .section-head {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
    padding-top: 0.15rem;
  }

  .section-head > * {
    min-width: 0;
  }

  .section-title {
    font-size: 1.28rem;
    line-height: 1.28;
  }

  .section-count {
    margin-left: 0.35rem;
    vertical-align: middle;
  }

  .section-lede,
  .panel-body,
  .report-summary,
  .value-prop-body {
    font-size: 0.86rem;
    line-height: 1.72;
  }

  .ghost-link,
  .action-pill,
  .hero-submit,
  .topbar-submit,
  .toggle-pill {
    min-height: 44px;
    align-items: center;
    justify-content: center;
  }

  .action-pill {
    padding-inline: 0.85rem;
    text-align: center;
  }

  .hero-card,
  .report-masthead,
  .panel,
  .empty-card {
    border-radius: 16px;
  }

  .panel {
    padding: 1rem;
  }

  .hero-card {
    padding: 1.45rem 1rem;
  }

  .hero-title {
    font-size: 1.55rem;
    line-height: 1.28;
  }

  .hero-lede {
    font-size: 0.88rem;
    line-height: 1.7;
  }

  .hero-mode-row {
    gap: 0.5rem;
  }

  .mode-chip {
    flex: 1 1 100%;
  }

  .mode-chip span {
    width: 100%;
    min-width: 0;
  }

  .hero-refresh {
    width: 100%;
    margin-left: 0;
  }

  .recent-grid,
  .flow-grid,
  .stat-grid,
  .overview-grid,
  .kpi-grid,
  .etf-grid,
  .rel-grid {
    grid-template-columns: 1fr;
  }

  .recent-card,
  .flow-card,
  .stat-tile,
  .kpi-tile,
  .etf-card,
  .source-card {
    border-radius: 14px;
  }

  .report-masthead {
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem;
    padding: 1.1rem;
  }

  .report-masthead-main,
  .report-masthead-meta {
    min-width: 0;
  }

  .report-masthead-meta {
    width: 100%;
  }

  .report-name {
    font-size: 1.42rem;
    line-height: 1.25;
    overflow-wrap: anywhere;
  }

  .report-subline,
  .eyebrow,
  .metric-card-label,
  .stat-tile-label {
    letter-spacing: 0.13em;
  }

  .report-sector {
    width: 100%;
    margin-left: 0;
  }

  .report-masthead-meta {
    gap: 0.45rem;
    padding-top: 0.85rem;
    border-top: 1px solid var(--line);
  }

  .meta-row {
    align-items: flex-start;
  }

  .meta-row > * {
    min-width: 0;
  }

  .meta-actions,
  .company-inline-actions {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .company-mode-select {
    align-items: stretch;
    flex-direction: column;
    gap: 0.45rem;
  }

  .company-refresh {
    align-items: flex-start;
  }

  .company-detail-list > div {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.35rem;
  }

  .company-detail-list strong {
    width: 100%;
    text-align: left;
    overflow-wrap: anywhere;
  }

  .price-spotlight {
    width: 100%;
    min-width: 0;
    text-align: left;
  }

  .price-spotlight-value {
    font-size: 1.38rem;
  }

  .stat-tile-value {
    font-size: 1.45rem;
  }

  .metric-card-value,
  .mini-stat-value {
    font-size: 1.22rem;
  }

  .history-tools,
  .history-search {
    width: 100%;
    min-width: 0;
  }

  .history-panel {
    overflow: visible;
    border: none;
    padding: 0;
    background: transparent;
  }

  .history-table,
  .history-table tbody,
  .history-table tr,
  .history-table td {
    display: block;
    width: 100%;
  }

  .history-table thead {
    display: none;
  }

  .history-table tbody {
    display: grid;
    gap: 0.75rem;
  }

  .history-row {
    padding: 0.95rem 1rem;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(15, 26, 45, 0.62), rgba(11, 19, 32, 0.62));
  }

  .history-table tbody td {
    padding: 0;
    border-bottom: none;
  }

  .history-table tbody td + td {
    margin-top: 0.55rem;
  }

  .history-table tbody td:nth-child(4),
  .history-table tbody td:nth-child(5),
  .history-table tbody td:nth-child(6),
  .history-table tbody td:nth-child(7) {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    font-size: 0.82rem;
  }

  .history-table tbody td:nth-child(4)::before { content: "Price"; }
  .history-table tbody td:nth-child(5)::before { content: "Change"; }
  .history-table tbody td:nth-child(6)::before { content: "Mode"; }
  .history-table tbody td:nth-child(7)::before { content: "Time"; }

  .history-table tbody td:nth-child(4)::before,
  .history-table tbody td:nth-child(5)::before,
  .history-table tbody td:nth-child(6)::before,
  .history-table tbody td:nth-child(7)::before {
    color: var(--mist);
    font-family: "JetBrains Mono", monospace;
    font-size: 0.68rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
  }

  .history-sector {
    font-size: 0.82rem;
    line-height: 1.55;
  }

  .history-error {
    max-width: none;
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
  }

  .segment-table,
  .md-table,
  .rel-val-table {
    min-width: 520px;
  }

  .segment-table,
  .md-table {
    font-size: 0.8rem;
  }

  .segment-table-wrap,
  .md-table-wrap,
  .rel-val-table-wrap {
    margin-inline: -0.1rem;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    contain: paint;
    -webkit-overflow-scrolling: touch;
  }

  .segment-table {
    display: block;
    min-width: 0;
    width: 100%;
  }

  .segment-table thead {
    display: none;
  }

  .segment-table tbody {
    display: grid;
    gap: 0.65rem;
  }

  .segment-table tbody tr {
    display: grid;
    gap: 0.48rem;
    padding: 0.8rem 0.85rem;
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.26);
  }

  .segment-table tbody td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0;
    border-bottom: none;
    text-align: right;
  }

  .segment-table tbody td:first-child {
    display: block;
    padding-bottom: 0.45rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
    color: #fff;
    font-weight: 800;
    text-align: left;
  }

  .segment-table tbody td:not(:first-child)::before {
    color: #64748b;
    font-family: "JetBrains Mono", monospace;
    font-size: 0.64rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
  }

  .segment-table tbody td:nth-child(2)::before { content: "Value"; }
  .segment-table tbody td:nth-child(3)::before { content: "Detail"; }
  .segment-table tbody td:nth-child(4)::before { content: "Note"; }

  .rel-row {
    grid-template-columns: 1fr;
  }

  .rel-type {
    width: fit-content;
    text-align: left;
  }

  .rel-row-top {
    align-items: flex-start;
    flex-direction: column;
  }

  .rc-grid .bullet-row {
    padding: 0.8rem 0.85rem 0.8rem 1.25rem;
  }

  .acc-summary {
    align-items: flex-start;
    padding: 0.85rem 0.95rem;
  }

  .acc-body {
    padding: 0 1rem 1rem;
    font-size: 0.86rem;
    line-height: 1.78;
  }

  .ai-eval-panel .panel-heading { flex-direction: column; }
  .ai-eval-horizon, .ai-eval-scenarios { grid-template-columns: 1fr; }
  .ai-eval-grid { grid-template-columns: 1fr; }
  .nef-scenarios { grid-template-columns: 1fr; }

  .ai-eval-panel {
    padding: 1rem;
  }

  .ai-eval-thesis {
    padding: 0.9rem 1rem;
    font-size: 0.88rem;
  }

  .ai-eval-list li {
    font-size: 0.84rem;
  }

  .rel-val-panel {
    overflow: hidden;
  }

  .rel-val-hero {
    padding: 1rem;
    border-radius: 14px;
  }

  .rel-val-hero-z {
    font-size: 2.45rem;
  }

  .rel-val-hero-sign {
    font-size: 1.5rem;
    vertical-align: 0.45rem;
  }

  .rel-val-hero-unit {
    font-size: 1.1rem;
  }

  .rel-val-hero-mini {
    grid-template-columns: 1fr 1fr;
    gap: 0.55rem;
  }

  .rel-val-curve-label {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.25rem;
  }

  .rel-val-summary {
    flex-direction: column;
    gap: 0.5rem;
  }

  .rel-val-summary-mark {
    align-self: flex-start;
  }

  .rel-val-table {
    display: block;
    min-width: 0;
    width: 100%;
  }

  .rel-val-table thead {
    display: none;
  }

  .rel-val-table tbody {
    display: grid;
    gap: 0.65rem;
  }

  .rel-val-table tbody tr {
    display: grid;
    gap: 0.48rem;
    padding: 0.8rem 0.85rem;
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.28);
  }

  .rel-val-table tbody tr.is-primary {
    border-color: rgba(125, 211, 252, 0.34);
    background: rgba(125, 211, 252, 0.07);
  }

  .rel-val-table tbody tr.is-primary td,
  .rel-val-table tbody tr.is-primary td:first-child {
    border-left: none;
    padding-left: 0;
    background: transparent;
  }

  .rel-val-table tbody td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0;
    border-bottom: none;
    text-align: right;
  }

  .rel-val-table tbody td:first-child {
    display: block;
    padding-bottom: 0.45rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
    color: #fff;
    font-weight: 800;
    text-align: left;
  }

  .rel-val-table tbody td:not(:first-child)::before {
    color: #64748b;
    font-family: "JetBrains Mono", monospace;
    font-size: 0.64rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
  }

  .rel-val-table tbody td:nth-child(2)::before { content: "Value"; }
  .rel-val-table tbody td:nth-child(3)::before { content: "Median"; }
  .rel-val-table tbody td:nth-child(4)::before { content: "Vs Median"; }
  .rel-val-table tbody td:nth-child(5)::before { content: "Z-Score"; }
  .rel-val-table tbody td:nth-child(6)::before { content: "Percentile"; }
  .rel-val-table tbody td:nth-child(7)::before { content: "Verdict"; }

  #valuation-chart {
    min-width: 540px;
    height: 480px !important;
  }

  #valuation-legend {
    justify-content: flex-start;
  }

  #valuation-table a {
    align-items: flex-start;
    gap: 0.75rem;
  }

  #spy-breadth-chart,
  #qqq-breadth-chart,
  #compare-chart,
  #sector-bar-chart {
    height: 300px !important;
  }

  #gauge-chart,
  #histogram-chart {
    height: 240px !important;
  }

  #sector-heatmap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  #sector-small-multiples {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  #sector-small-multiples > * {
    min-width: 0;
    width: 100%;
  }

  .panel:has(#valuation-chart) {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .job-row {
    padding: 0.9rem;
    border-radius: 14px;
  }

  .job-row-head {
    align-items: stretch;
    flex-direction: column;
  }

  .job-row-head > div {
    min-width: 0;
  }

  .job-stop-button {
    min-height: 40px;
    padding-inline: 0.9rem;
  }

  .job-step {
    padding: 0.85rem;
  }

  .job-step > .flex {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .job-step-status-tag {
    margin-left: auto;
  }

  /* Chart frame mobile sizing */
  .chart-frame {
    min-height: 200px;
  }

  .chart-frame[style*="360px"],
  .chart-frame[style*="320px"] {
    height: 260px !important;
  }

  .chart-frame[style*="280px"] {
    height: 220px !important;
  }

  /* Analyst consensus cards mobile */
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Mix legend compact */
  .mix-legend {
    gap: 0.35rem;
    font-size: 0.78rem;
  }

  /* Price range bar mobile */
  .analyst-bar-wrap {
    padding: 0.65rem 0;
  }

  /* Panel body text mobile */
  .panel-body {
    font-size: 0.84rem;
    line-height: 1.72;
  }

  /* Earnings calendar (moved from 768px) */
  .ecal-kpi-row { grid-template-columns: repeat(2, 1fr); }
  .ecal-filters { flex-direction: column; }
  .ecal-select { width: 100%; }

  /* Moved from 640px */
  .hero-form-row { grid-template-columns: 1fr; }
  .app-content { padding: 1.2rem 1rem 2.5rem; }
  .hero-card { padding: 1.6rem 1.3rem; }
  .report-masthead { padding: 1.25rem 1.25rem; }
  .metric-tile-value { font-size: 1.15rem; }
  .toast-container { left: 0.5rem; right: 0.5rem; max-width: none; }
}

@media (max-width: 380px) {
  .topbar-search {
    grid-template-columns: minmax(0, 1fr);
  }

  .topbar-search-icon {
    display: none;
  }

  .topbar-search-input,
  .topbar-mode,
  .topbar-submit {
    grid-column: 1;
    grid-row: auto;
  }

  .mobile-tabbar {
    left: 0.45rem;
    right: 0.45rem;
    bottom: 0.45rem;
  }

  .mobile-tab {
    font-size: 0.62rem;
  }

  .rel-val-hero-mini {
    grid-template-columns: 1fr;
  }
}

/* ── Skeleton / Shimmer Loading ─────────────────────────────── */

@keyframes skeleton-shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.skeleton {
  background: linear-gradient(
    90deg,
    var(--surface-2) 25%,
    rgba(148, 163, 184, 0.08) 50%,
    var(--surface-2) 75%
  );
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.6s ease-in-out infinite;
  border-radius: 6px;
  color: transparent !important;
  pointer-events: none;
  user-select: none;
}

.skeleton * {
  visibility: hidden;
}

.skeleton-line {
  display: block;
  height: 1em;
  margin-bottom: 0.6em;
  border-radius: 4px;
  background: linear-gradient(
    90deg,
    var(--surface-2) 25%,
    rgba(148, 163, 184, 0.08) 50%,
    var(--surface-2) 75%
  );
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.6s ease-in-out infinite;
}

.skeleton-line.short { width: 40%; }
.skeleton-line.medium { width: 65%; }
.skeleton-line.long { width: 90%; }

.skeleton-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(
    90deg,
    var(--surface-2) 25%,
    rgba(148, 163, 184, 0.08) 50%,
    var(--surface-2) 75%
  );
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.6s ease-in-out infinite;
}

.skeleton-card {
  padding: 1.2rem;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
}

/* Panel skeleton: shimmer overlay that fades on load */
.panel-skeleton {
  position: relative;
  overflow: hidden;
}
.panel-skeleton::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    var(--surface-2) 25%,
    rgba(148, 163, 184, 0.08) 50%,
    var(--surface-2) 75%
  );
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.6s ease-in-out infinite;
  z-index: 2;
  transition: opacity 0.4s ease;
  pointer-events: none;
  border-radius: inherit;
}
.panel-skeleton.loaded::before {
  opacity: 0;
}

/* Metric card skeleton placeholder */
.metric-skeleton {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1rem 1.1rem;
}
.metric-skeleton-value {
  height: 1.8rem;
  width: 60%;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--surface-2) 25%, rgba(148,163,184,0.08) 50%, var(--surface-2) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.6s ease-in-out infinite;
}
.metric-skeleton-label {
  height: 0.8rem;
  width: 40%;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--surface-2) 25%, rgba(148,163,184,0.08) 50%, var(--surface-2) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.6s ease-in-out infinite;
}

/* Table row skeleton */
.table-skeleton-row {
  display: flex;
  gap: 1rem;
  padding: 0.85rem 1.1rem;
  border-bottom: 1px solid var(--line);
}
.table-skeleton-cell {
  height: 0.9rem;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--surface-2) 25%, rgba(148,163,184,0.08) 50%, var(--surface-2) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.6s ease-in-out infinite;
  flex: 1;
}
.table-skeleton-cell:first-child { flex: 0.6; }
.table-skeleton-cell:last-child { flex: 0.4; }

.skeleton-card .skeleton-line:last-child { margin-bottom: 0; }

/* ── Toast / Snackbar ───────────────────────────────────────── */

.toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
  max-width: 400px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.75rem 1.1rem;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
  color: var(--ink);
  font-size: 0.875rem;
  pointer-events: auto;
  opacity: 0;
  transform: translateX(100%);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.toast.show {
  opacity: 1;
  transform: translateX(0);
}

.toast.removing {
  opacity: 0;
  transform: translateX(100%);
}

.toast-icon {
  flex-shrink: 0;
  font-size: 1.1rem;
}

.toast-body {
  flex: 1;
  line-height: 1.35;
}

.toast-close {
  flex-shrink: 0;
  background: none;
  border: none;
  color: var(--mist);
  cursor: pointer;
  font-size: 1.1rem;
  padding: 0 0.2rem;
  line-height: 1;
}

.toast-close:hover {
  color: var(--ink);
}

.toast--success { border-left: 3px solid #a855f7; }
.toast--success .toast-icon { color: #a855f7; }

.toast--error { border-left: 3px solid #ef4444; }
.toast--error .toast-icon { color: #ef4444; }

.toast--warning { border-left: 3px solid #f59e0b; }
.toast--warning .toast-icon { color: #f59e0b; }

.toast--info { border-left: 3px solid #5da9ff; }
.toast--info .toast-icon { color: #5da9ff; }



/* ── Animations & Micro-interactions ──────────────────────── */

/* Fade-in + slide-up entrance animation */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-16px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes gentlePulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

@keyframes shimmerGlow {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* Page content entrance */
.page-stack {
  animation: fadeInUp 400ms ease both;
}

/* Staggered card entrances */
.recent-grid > *,
.flow-grid > *,
.stat-grid > *,
.kpi-grid > *,
.etf-grid > *,
.overview-grid > *,
.landing-features-grid > * {
  opacity: 0;
  animation: fadeInUp 450ms ease both;
}

.recent-grid > *:nth-child(1),
.flow-grid > *:nth-child(1),
.landing-features-grid > *:nth-child(1) { animation-delay: 0.08s; }
.recent-grid > *:nth-child(2),
.flow-grid > *:nth-child(2),
.landing-features-grid > *:nth-child(2) { animation-delay: 0.16s; }
.recent-grid > *:nth-child(3),
.flow-grid > *:nth-child(3),
.landing-features-grid > *:nth-child(3) { animation-delay: 0.24s; }
.recent-grid > *:nth-child(4) { animation-delay: 0.32s; }
.recent-grid > *:nth-child(5) { animation-delay: 0.40s; }
.recent-grid > *:nth-child(6) { animation-delay: 0.48s; }

.stat-grid > *:nth-child(1),
.kpi-grid > *:nth-child(1),
.etf-grid > *:nth-child(1) { animation-delay: 0.05s; }
.stat-grid > *:nth-child(2),
.kpi-grid > *:nth-child(2),
.etf-grid > *:nth-child(2) { animation-delay: 0.10s; }
.stat-grid > *:nth-child(3),
.kpi-grid > *:nth-child(3),
.etf-grid > *:nth-child(3) { animation-delay: 0.15s; }
.stat-grid > *:nth-child(4),
.kpi-grid > *:nth-child(4),
.etf-grid > *:nth-child(4) { animation-delay: 0.20s; }
.stat-grid > *:nth-child(5) { animation-delay: 0.25s; }
.stat-grid > *:nth-child(6) { animation-delay: 0.30s; }

/* Hero entrance */
.hero-card,
.report-masthead {
  animation: fadeInUp 500ms ease both;
}

/* Section head entrance */
.section-head {
  animation: fadeIn 400ms ease both;
  animation-delay: 0.1s;
}

/* Panel entrance */
.panel {
  animation: fadeInUp 400ms ease both;
  animation-delay: 0.05s;
}

/* Report page staggered entrance */
.stat-tile,
.kpi-tile,
.etf-card {
  animation: fadeInUp 350ms ease both;
}
.stat-grid > :nth-child(1),
.kpi-grid > :nth-child(1),
.etf-grid > :nth-child(1) { animation-delay: 0.05s; }
.stat-grid > :nth-child(2),
.kpi-grid > :nth-child(2),
.etf-grid > :nth-child(2) { animation-delay: 0.10s; }
.stat-grid > :nth-child(3),
.kpi-grid > :nth-child(3),
.etf-grid > :nth-child(3) { animation-delay: 0.15s; }
.stat-grid > :nth-child(4),
.kpi-grid > :nth-child(4),
.etf-grid > :nth-child(4) { animation-delay: 0.20s; }
.stat-grid > :nth-child(n+5),
.kpi-grid > :nth-child(n+5),
.etf-grid > :nth-child(n+5) { animation-delay: 0.25s; }

.acc-item {
  animation: fadeInUp 350ms ease both;
}
.accordion > :nth-child(1) { animation-delay: 0.05s; }
.accordion > :nth-child(2) { animation-delay: 0.10s; }
.accordion > :nth-child(3) { animation-delay: 0.15s; }
.accordion > :nth-child(4) { animation-delay: 0.20s; }
.accordion > :nth-child(n+5) { animation-delay: 0.25s; }

/* Metric card entrance */
.metric-card,
.mini-stat {
  animation: fadeInUp 350ms ease both;
}

/* Sidebar nav link entrance */
.sidebar-link {
  animation: slideInLeft 300ms ease both;
}

.sidebar-link:nth-child(1) { animation-delay: 0.05s; }
.sidebar-link:nth-child(2) { animation-delay: 0.10s; }
.sidebar-link:nth-child(3) { animation-delay: 0.15s; }
.sidebar-link:nth-child(4) { animation-delay: 0.20s; }

/* ── Hover micro-interactions ──────────────────────────────── */

/* Card hover glow effect */
.recent-card,
.flow-card,
.landing-feature-card,
.jump-card,
.source-card {
  position: relative;
  overflow: hidden;
}

.recent-card::before,
.flow-card::before,
.landing-feature-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  opacity: 0;
  transition: opacity 300ms ease;
  background: radial-gradient(circle at var(--glow-x, 50%) var(--glow-y, 50%), rgba(168, 85, 247, 0.08), transparent 60%);
  pointer-events: none;
  z-index: 1;
}

.recent-card:hover::before,
.flow-card:hover::before,
.landing-feature-card:hover::before {
  opacity: 1;
}

/* Settings and admin card hover glow */
.settings-section,
.admin-stat-card {
  position: relative;
  overflow: hidden;
}

.settings-section::before,
.admin-stat-card::before,
.metric-card::before,
.mini-stat::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  opacity: 0;
  transition: opacity 300ms ease;
  background: radial-gradient(circle at var(--glow-x, 50%) var(--glow-y, 50%), rgba(168, 85, 247, 0.06), transparent 60%);
  pointer-events: none;
  z-index: 0;
}

.settings-section:hover::before,
.admin-stat-card:hover::before,
.metric-card:hover::before,
.mini-stat:hover::before {
  opacity: 1;
}

/* Report page card hover glow */
.stat-tile::after,
.kpi-tile::after,
.etf-card::after,
.acc-item::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  opacity: 0;
  transition: opacity 300ms ease;
  background: radial-gradient(circle at var(--glow-x, 50%) var(--glow-y, 50%), rgba(168, 85, 247, 0.06), transparent 60%);
  pointer-events: none;
  z-index: 0;
}
.stat-tile:hover::after,
.kpi-tile:hover::after,
.etf-card:hover::after,
.acc-item:hover::after {
  opacity: 1;
}

/* Button press effect */
.hero-submit:active,
.topbar-submit:active,
.landing-btn-large:active,
.landing-btn-primary:active,
.company-generate:active {
  transform: translateY(0px) scale(0.98);
}

/* Smooth sidebar link hover */
.sidebar-link {
  transition: color 200ms ease, background 200ms ease;
}

.sidebar-link:hover .sidebar-icon {
  transform: scale(1.1);
  transition: opacity 150ms ease, transform 200ms ease;
}

.sidebar-link.is-active:hover .sidebar-icon {
  transform: none;
}

/* Tab hover interaction */
.report-tab {
  transition: background 200ms ease, color 200ms ease, transform 150ms ease;
}

.report-tab:hover {
  transform: translateY(-1px);
}

/* Metric tile hover */
.metric-tile:hover,
.stat-tile:hover,
.kpi-tile:hover {
  border-color: var(--line-strong);
}

/* Accordion item open glow */
.acc-item[open] {
  box-shadow: 0 4px 16px rgba(168, 85, 247, 0.06);
}

.acc-body {
  animation: none;
}

/* User avatar hover scale */
.user-avatar,
.topbar-user-avatar {
  transition: transform 200ms ease, box-shadow 200ms ease;
}

.user-menu-btn:hover .user-avatar {
  transform: scale(1.05);
}

.topbar-user-btn:hover .topbar-user-avatar {
  transform: scale(1.08);
  box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.2);
}

/* History row hover */
.history-row {
  transition: background 200ms ease, transform 150ms ease;
}

.history-row:hover {
  transform: translateX(2px);
}

/* Job row pulse when running */
.job-row[data-status="running"] {
  animation: gentlePulse 2s ease-in-out infinite;
}

/* Landing hero entrance */
.landing-hero {
  animation: fadeInUp 0.7s ease-out both;
}

.landing-hero-badge {
  animation: fadeIn 0.5s ease-out 0.2s both;
}

.landing-hero h1 {
  animation: fadeInUp 0.6s ease-out 0.3s both;
}

.landing-hero-desc {
  animation: fadeInUp 0.6s ease-out 0.45s both;
}

.landing-hero-cta {
  animation: fadeInUp 0.6s ease-out 0.6s both;
}

/* Landing nav entrance */
.landing-nav {
  animation: fadeIn 0.5s ease-out both;
}

/* Text gradient animation */
.text-gradient {
  background-size: 200% 100%;
  animation: shimmerGlow 4s ease-in-out infinite;
}

/* Hero card subtle border glow */
.hero-card.glow-border {
  position: relative;
}

.hero-card.glow-border::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: linear-gradient(
    135deg,
    rgba(168, 85, 247, 0.3),
    transparent 40%,
    transparent 60%,
    rgba(168, 85, 247, 0.15)
  );
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  padding: 1px;
  pointer-events: none;
  opacity: 0.6;
  transition: opacity 300ms ease;
}

.hero-card.glow-border:hover::after {
  opacity: 1;
}

/* Button active press effect */
.hero-submit,
.topbar-submit,
.action-pill,
.company-generate {
  transition: filter 150ms ease, transform 150ms ease, box-shadow 150ms ease;
}

.hero-submit:active,
.action-pill:active,
.company-generate:active {
  transform: translateY(1px) scale(0.98);
}

/* Brand mark subtle pulse on load */
@keyframes brandPulse {
  0% { box-shadow: 0 2px 12px rgba(168, 85, 247, 0.15); }
  50% { box-shadow: 0 2px 20px rgba(168, 85, 247, 0.3); }
  100% { box-shadow: 0 2px 12px rgba(168, 85, 247, 0.15); }
}

.brand-mark {
  animation: brandPulse 3s ease-in-out 1;
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ── Landing Page ─────────────────────────────────────────── */

.landing-page {
  height: 100vh;
  position: relative;
  overflow-y: auto;
  overflow-x: hidden;
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
}

.landing-glow {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 0;
  background: radial-gradient(ellipse 80% 50% at 50% -20%, rgba(168, 85, 247, 0.12), transparent 60%);
}

[data-theme="light"] .landing-glow {
  background: radial-gradient(ellipse 80% 50% at 50% -20%, rgba(147, 51, 234, 0.06), transparent 60%);
}

.landing-content {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* landing nav */
.landing-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 0;
}

.landing-nav-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.landing-brand-mark {
  display: grid;
  place-items: center;
  height: 42px;
  width: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.3), rgba(168, 85, 247, 0.08));
  border: 1px solid rgba(168, 85, 247, 0.3);
  font-family: "Manrope", sans-serif;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: #e9d5ff;
  font-size: 0.82rem;
}

.landing-brand-logo {
  display: block;
  height: 42px;
  width: 42px;
  border-radius: 12px;
  box-shadow: 0 4px 18px rgba(168, 85, 247, 0.28);
}

.landing-brand-title {
  margin: 0;
  font-family: "Manrope", sans-serif;
  font-weight: 800;
  letter-spacing: 0.18em;
  font-size: 0.85rem;
  color: var(--ink);
}

.landing-brand-sub {
  margin: 2px 0 0;
  font-size: 0.7rem;
  color: var(--mist);
  letter-spacing: 0.1em;
}

.landing-nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.landing-tape {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin: 0.2rem 0 1.6rem;
}

.landing-tape span {
  display: inline-flex;
  align-items: center;
  padding: 0.24rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.71rem;
  color: var(--mist);
  background: rgba(148, 163, 184, 0.04);
}

.landing-btn-ghost {
  padding: 0.6rem 1.2rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  font-family: "Manrope", sans-serif;
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  transition: border-color 200ms ease, background 200ms ease;
}

.landing-btn-ghost:hover {
  border-color: rgba(168, 85, 247, 0.4);
  background: rgba(168, 85, 247, 0.06);
}

.landing-btn-primary {
  padding: 0.6rem 1.4rem;
  border-radius: 10px;
  border: none;
  background: var(--accent);
  color: #fff;
  font-family: "Manrope", sans-serif;
  font-weight: 800;
  font-size: 0.88rem;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: filter 200ms ease, transform 200ms ease, box-shadow 200ms ease;
}

.landing-btn-primary:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(168, 85, 247, 0.3);
}

/* landing hero */
.landing-hero {
  text-align: center;
  padding: 3rem 0 2rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  scroll-snap-align: start;
}

.landing-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  color: var(--accent);
  padding: 0.32rem 0.85rem;
  border-radius: 999px;
  background: rgba(168, 85, 247, 0.08);
  border: 1px solid rgba(168, 85, 247, 0.25);
  margin-bottom: 1.5rem;
}

.landing-hero h1 {
  margin: 0;
  font-family: "Manrope", sans-serif;
  font-size: clamp(2.4rem, 5vw, 4rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--ink);
}

.landing-hero h1 .text-gradient {
  background: linear-gradient(135deg, #a855f7, #6366f1, #8b5cf6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.landing-hero-desc {
  margin: 1.5rem auto 0;
  max-width: 640px;
  font-size: 1.1rem;
  line-height: 1.8;
  color: var(--mist);
}

.landing-hero-cta {
  margin-top: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

.landing-btn-large {
  padding: 0.85rem 2rem;
  border-radius: 14px;
  border: none;
  background: var(--accent);
  color: #fff;
  font-family: "Manrope", sans-serif;
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: filter 200ms ease, transform 200ms ease, box-shadow 200ms ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.landing-btn-large:hover {
  filter: brightness(1.1);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(168, 85, 247, 0.3);
}

.landing-btn-outline {
  padding: 0.85rem 2rem;
  border-radius: 14px;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--ink);
  font-family: "Manrope", sans-serif;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: border-color 200ms ease, background 200ms ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.landing-btn-outline:hover {
  border-color: rgba(168, 85, 247, 0.4);
  background: rgba(168, 85, 247, 0.06);
}

/* landing features */
.landing-features {
  padding: 4rem 0 3rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  scroll-snap-align: start;
}

.landing-features-title {
  text-align: center;
  margin: 0 0 0.6rem;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  color: var(--accent);
  text-transform: uppercase;
}

.landing-features-heading {
  text-align: center;
  margin: 0 0 1.2rem;
  font-family: "Manrope", sans-serif;
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.landing-features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

@media (max-width: 760px) {
  .landing-features-grid { grid-template-columns: 1fr; }
  .landing-hero { padding: 4rem 0 3rem; }
  .landing-hero-cta { flex-direction: column; }
}

.landing-feature-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.2rem 1.4rem;
  background: var(--surface);
  transition: border-color 200ms ease;
}

[data-theme="light"] .landing-feature-card {
  background: var(--surface);
}

.landing-feature-card:hover {
  border-color: rgba(168, 85, 247, 0.3);
}

.landing-feature-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: rgba(168, 85, 247, 0.12);
  border: 1px solid rgba(168, 85, 247, 0.2);
  font-size: 1.3rem;
  margin-bottom: 0.8rem;
}

.landing-feature-card h3 {
  margin: 0 0 0.6rem;
  font-family: "Manrope", sans-serif;
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--ink);
}

.landing-feature-card p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.75;
  color: var(--mist);
}

.landing-feature-tag {
  display: inline-flex;
  margin-top: 1rem;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.66rem;
  letter-spacing: 0.18em;
  padding: 0.22rem 0.65rem;
  border-radius: 999px;
  background: rgba(168, 85, 247, 0.08);
  border: 1px solid rgba(168, 85, 247, 0.2);
  color: var(--accent);
}

/* landing footer */
.landing-footer {
  border-top: 1px solid var(--line);
  padding: 1rem 0;
  text-align: center;
  color: var(--mist);
  font-size: 0.82rem;
  flex-shrink: 0;
}

/* landing theme toggle */
.landing-theme-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--mist);
  cursor: pointer;
  font-size: 1rem;
  transition: border-color 150ms ease, color 150ms ease;
}

.landing-theme-btn:hover {
  border-color: rgba(168, 85, 247, 0.4);
  color: var(--ink);
}

/* ── Particle Canvas ──────────────────────────────────────── */
.landing-particles {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
}

/* ── Scroll Reveal ────────────────────────────────────────── */

/* ── Page Transition ─────────────────────────────────────── */
/* Removed — custom fade-out caused white flash between pages */

/* View Transitions API — disabled to prevent page shrink/flash
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: none; }
::view-transition-new(root) { animation: none; }
*/

/* ── Render Performance ──────────────────────────────────── */
/* content-visibility removed — caused layout shift on navigation */

.reveal-section,
.reveal-item {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.4s ease-out, transform 0.4s ease-out;
}

.reveal-item:nth-child(2) { transition-delay: 0.08s; }
.reveal-item:nth-child(3) { transition-delay: 0.16s; }

.reveal-section.is-revealed,
.reveal-item.is-revealed {
  opacity: 1;
  transform: translateY(0);
}

/* ── Light Mode Refinements ───────────────────────────────── */

[data-theme="light"] .app-sidebar {
  background: var(--surface);
  border-color: var(--line);
}

[data-theme="light"] .app-topbar {
  background: rgba(250, 250, 250, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-color: var(--line);
}

[data-theme="light"] .brand-mark {
  background: rgba(147, 51, 234, 0.1);
  border-color: rgba(147, 51, 234, 0.2);
  color: #7c3aed;
}

[data-theme="light"] .brand-title { color: var(--ink); }

[data-theme="light"] .sidebar-link { color: var(--mist); }
[data-theme="light"] .sidebar-link:hover { color: var(--ink); background: rgba(0, 0, 0, 0.04); }
[data-theme="light"] .sidebar-link.is-active {
  color: var(--ink);
  background: rgba(147, 51, 234, 0.06);
  box-shadow: 0 0 12px rgba(147, 51, 234, 0.06);
}
[data-theme="light"] .sidebar-link.is-active .sidebar-icon {
  color: var(--accent);
}

[data-theme="light"] .topbar-search {
  background: rgba(0, 0, 0, 0.03);
  border-color: var(--line);
}

[data-theme="light"] .topbar-search:focus-within {
  border-color: rgba(147, 51, 234, 0.4);
  box-shadow: 0 0 0 3px rgba(147, 51, 234, 0.08);
}

[data-theme="light"] .topbar-search-input::placeholder { color: #a1a1aa; }

[data-theme="light"] .topbar-submit {
  background: var(--accent);
  color: #fff;
}

[data-theme="light"] .section-title { color: var(--ink); }

[data-theme="light"] .panel {
  background: var(--surface);
  border-color: var(--line);
}

[data-theme="light"] .panel-h { color: var(--ink); }
[data-theme="light"] .panel-body { color: var(--mist); }

[data-theme="light"] .hero-card {
  background:
    radial-gradient(ellipse 120% 80% at 10% 0%, rgba(147, 51, 234, 0.06), transparent 50%),
    radial-gradient(ellipse 100% 80% at 90% 100%, rgba(139, 92, 246, 0.04), transparent 50%),
    var(--surface);
  border-color: rgba(147, 51, 234, 0.12);
  box-shadow: 0 4px 32px rgba(147, 51, 234, 0.04);
}

[data-theme="light"] .hero-title { color: var(--ink); }
[data-theme="light"] .hero-lede { color: var(--mist); }
[data-theme="light"] .hero-input > input {
  background: rgba(0, 0, 0, 0.03);
  color: var(--ink);
  border-color: var(--line);
}
[data-theme="light"] .hero-submit {
  background: var(--accent);
  color: #fff;
}

[data-theme="light"] .recent-card {
  background: var(--surface);
}
[data-theme="light"] .recent-card:hover {
  border-color: var(--line-strong);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}
[data-theme="light"] .recent-ticker { color: var(--ink); }
[data-theme="light"] .recent-name { color: var(--ink); }

[data-theme="light"] .flow-card {
  background: var(--surface);
}
[data-theme="light"] .flow-card:hover {
  border-color: var(--line-strong);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}
[data-theme="light"] .flow-card h3 { color: var(--ink); }
[data-theme="light"] .flow-card p { color: var(--mist); }

[data-theme="light"] .recent-card::before,
[data-theme="light"] .flow-card::before {
  background: radial-gradient(circle at var(--glow-x, 50%) var(--glow-y, 50%), rgba(147, 51, 234, 0.05), transparent 60%);
}

[data-theme="light"] .hero-card.glow-border::after {
  background: linear-gradient(
    135deg,
    rgba(147, 51, 234, 0.2),
    transparent 40%,
    transparent 60%,
    rgba(147, 51, 234, 0.1)
  );
}

[data-theme="light"] .report-masthead {
  background: var(--surface);
  border-color: rgba(147, 51, 234, 0.15);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.04), 0 0 0 1px rgba(147, 51, 234, 0.04);
}
[data-theme="light"] .report-ticker,
[data-theme="light"] .report-name { color: var(--ink); }

[data-theme="light"] .metric-tile {
  background: var(--surface-2);
}
[data-theme="light"] .metric-tile-value { color: var(--ink); }

[data-theme="light"] .stat-tile {
  background: var(--surface-2);
}
[data-theme="light"] .stat-tile-value { color: var(--ink); }

[data-theme="light"] .empty-card {
  background: rgba(0, 0, 0, 0.02);
}

[data-theme="light"] .sub-card {
  background: rgba(0, 0, 0, 0.02);
}

[data-theme="light"] .user-menu-dropdown {
  background: var(--surface);
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .mobile-tabbar {
  background: var(--surface);
  box-shadow: 0 -1px 0 var(--line);
}

[data-theme="light"] .mobile-tab { color: var(--mist); }
[data-theme="light"] .mobile-tab.is-active {
  background: rgba(147, 51, 234, 0.08);
  color: var(--ink);
}
[data-theme="light"] .mobile-tab.is-active .mobile-tab-icon {
  color: #7c3aed;
  opacity: 1;
}

[data-theme="light"] .chip {
  border-color: rgba(147, 51, 234, 0.2);
  background: rgba(147, 51, 234, 0.06);
  color: #7c3aed;
}

[data-theme="light"] .history-row:hover {
  background: rgba(147, 51, 234, 0.03);
}

[data-theme="light"] .report-tab.is-active {
  background: rgba(147, 51, 234, 0.08);
  box-shadow: inset 0 0 0 1px rgba(147, 51, 234, 0.25);
}

[data-theme="light"] .action-pill {
  border-color: rgba(147, 51, 234, 0.25);
  background: rgba(147, 51, 234, 0.06);
}

[data-theme="light"] .toggle-pill-active {
  background: rgba(147, 51, 234, 0.1);
  border-color: rgba(147, 51, 234, 0.3);
}

[data-theme="light"] .section-count {
  background: rgba(147, 51, 234, 0.1);
  color: #7c3aed;
}

[data-theme="light"] .toast {
  background: var(--surface);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .filter-select {
  background: rgba(0, 0, 0, 0.03);
  color: var(--ink);
}

[data-theme="light"] .history-search,
[data-theme="light"] input.history-search {
  background: rgba(0, 0, 0, 0.03) !important;
  border-color: rgba(0, 0, 0, 0.1) !important;
  color: var(--ink) !important;
}
[data-theme="light"] input.history-search::placeholder {
  color: #a1a1aa;
}

[data-theme="light"] .sidebar-toggle {
  background: rgba(0, 0, 0, 0.04);
}

/* Light mode: collapsed sidebar tooltip */
[data-theme="light"] .sidebar-link[title]::after {
  background: #fff;
  color: var(--ink);
  border-color: var(--line);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .topbar-mode {
  background: rgba(0, 0, 0, 0.04);
  color: var(--ink);
}

[data-theme="light"] .metric-card,
[data-theme="light"] .mini-stat {
  background: rgba(0, 0, 0, 0.02);
  border-color: var(--line);
}
[data-theme="light"] .metric-card:hover,
[data-theme="light"] .mini-stat:hover {
  border-color: rgba(147, 51, 234, 0.2);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.06);
}
[data-theme="light"] .metric-card-value,
[data-theme="light"] .mini-stat-value { color: var(--ink); }

/* Light mode: KPI tiles */
[data-theme="light"] .kpi-tile {
  background: var(--surface-2);
}
[data-theme="light"] .kpi-tile:hover {
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.06);
}
[data-theme="light"] .kpi-value { color: var(--ink); }
[data-theme="light"] .kpi-yoy { color: #059669; }

[data-theme="light"] .kpi-tile-g { border-color: rgba(147, 51, 234, 0.2); }
[data-theme="light"] .kpi-tile-b { border-color: rgba(59, 130, 246, 0.2); }
[data-theme="light"] .kpi-tile-y { border-color: rgba(217, 119, 6, 0.2); }
[data-theme="light"] .kpi-tile-p { border-color: rgba(139, 92, 246, 0.2); }

/* Light mode: stat tiles */
[data-theme="light"] .stat-tile:hover {
  border-color: rgba(147, 51, 234, 0.2);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.06);
}

/* Light mode: ETF cards */
[data-theme="light"] .etf-card {
  background: var(--surface);
  border-color: var(--line);
}
[data-theme="light"] .etf-card:hover {
  border-color: rgba(147, 51, 234, 0.2);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}
[data-theme="light"] .etf-card-member {
  border-color: rgba(147, 51, 234, 0.25);
  background: rgba(147, 51, 234, 0.03);
}
[data-theme="light"] .etf-name { color: var(--ink); }
[data-theme="light"] .etf-weight { color: var(--ink); }

/* Light mode: accordion */
[data-theme="light"] .acc-item {
  background: var(--surface);
  border-color: var(--line);
}
[data-theme="light"] .acc-item:hover { border-color: rgba(0, 0, 0, 0.12); }
[data-theme="light"] .acc-item[open] {
  border-color: rgba(147, 51, 234, 0.25);
  box-shadow: 0 2px 12px rgba(147, 51, 234, 0.04);
}
[data-theme="light"] .acc-summary { color: var(--ink); }
[data-theme="light"] .acc-summary:hover { background: rgba(147, 51, 234, 0.03); }
[data-theme="light"] .acc-body { color: #3f3f46; }
[data-theme="light"] .acc-index { color: #7c3aed; }

/* Light mode: AI eval panel */
[data-theme="light"] .ai-eval-panel {
  background:
    radial-gradient(140% 80% at 100% 0%, rgba(147, 51, 234, 0.04), transparent 60%),
    radial-gradient(140% 80% at 0% 100%, rgba(59, 130, 246, 0.03), transparent 55%),
    var(--surface);
}
[data-theme="light"] .ai-eval-panel[data-stance="bullish"] { box-shadow: inset 0 0 0 1px rgba(16, 185, 129, 0.25); }
[data-theme="light"] .ai-eval-panel[data-stance="bearish"] { box-shadow: inset 0 0 0 1px rgba(239, 68, 68, 0.25); }
[data-theme="light"] .ai-eval-panel[data-stance="neutral"] { box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.2); }
[data-theme="light"] .ai-eval-panel .panel-title { color: var(--ink); }

[data-theme="light"] .ai-eval-thesis {
  background: rgba(0, 0, 0, 0.02);
  border-color: rgba(0, 0, 0, 0.06);
  border-left-color: rgba(147, 51, 234, 0.35);
  color: var(--ink);
}

[data-theme="light"] .ai-eval-horizon-card {
  border-color: var(--line);
  background: rgba(0, 0, 0, 0.01);
}
[data-theme="light"] .ai-eval-horizon-card:hover {
  border-color: rgba(147, 51, 234, 0.2);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}
[data-theme="light"] .ai-eval-horizon-body { color: #52525b; }

[data-theme="light"] .ai-eval-list li {
  background: rgba(0, 0, 0, 0.02);
  border-color: rgba(0, 0, 0, 0.06);
  color: #3f3f46;
}
[data-theme="light"] .ai-eval-list li:hover {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .ai-eval-scenario {
  border-color: rgba(0, 0, 0, 0.06);
  background: rgba(0, 0, 0, 0.01);
}
[data-theme="light"] .ai-eval-scenario:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}
[data-theme="light"] .ai-eval-scenario p { color: #52525b; }

[data-theme="light"] .ai-eval-scenario-bull { border-color: rgba(16, 185, 129, 0.25); background: rgba(16, 185, 129, 0.03); }
[data-theme="light"] .ai-eval-scenario-base { border-color: rgba(217, 119, 6, 0.25); background: rgba(217, 119, 6, 0.03); }
[data-theme="light"] .ai-eval-scenario-bear { border-color: rgba(239, 68, 68, 0.25); background: rgba(239, 68, 68, 0.03); }

[data-theme="light"] .ai-eval-flip {
  border-color: rgba(147, 51, 234, 0.2);
  background: rgba(147, 51, 234, 0.02);
}

[data-theme="light"] .ai-eval-bar { background: rgba(0, 0, 0, 0.06); }

/* Light mode: risk/catalyst cards */
[data-theme="light"] .panel-risk {
  border-color: rgba(239, 68, 68, 0.2);
  background: linear-gradient(180deg, rgba(254, 226, 226, 0.4), var(--surface));
}
[data-theme="light"] .panel-catalyst {
  border-color: rgba(217, 119, 6, 0.2);
  background: linear-gradient(180deg, rgba(254, 243, 199, 0.4), var(--surface));
}
[data-theme="light"] .panel-strategy {
  border-color: rgba(139, 92, 246, 0.2);
  background: linear-gradient(180deg, rgba(237, 233, 254, 0.4), var(--surface));
}
[data-theme="light"] .panel-guidance {
  border-color: rgba(147, 51, 234, 0.2);
  background: linear-gradient(180deg, rgba(220, 252, 231, 0.4), var(--surface));
}

[data-theme="light"] .rc-grid .bullet-row {
  background: rgba(0, 0, 0, 0.02);
  border-color: rgba(0, 0, 0, 0.06);
}
[data-theme="light"] .rc-grid .bullet-row:hover {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.1);
}
[data-theme="light"] .rc-item-text { color: #3f3f46; }

/* Light mode: NEF cards */
[data-theme="light"] .nef-card {
  background: rgba(0, 0, 0, 0.01);
  border-color: var(--line);
}
[data-theme="light"] .nef-card:hover {
  border-color: rgba(0, 0, 0, 0.12);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

/* Light mode: price spotlight */
[data-theme="light"] .price-spotlight {
  border-color: var(--line);
}

/* Light mode: md content */
[data-theme="light"] .md-h { color: var(--ink); }
[data-theme="light"] .md-p { color: #3f3f46; }
[data-theme="light"] .md-li { color: #3f3f46; }
[data-theme="light"] .md-li strong,
[data-theme="light"] .md-p strong { color: var(--ink); }
[data-theme="light"] .md-table-wrap {
  border-color: var(--line);
  background: rgba(0, 0, 0, 0.01);
}

/* Light mode: settings sections */
[data-theme="light"] .settings-section {
  background: var(--surface);
  border-color: var(--line);
}

/* Light mode: data tables */
[data-theme="light"] .data-table thead th {
  background: var(--surface);
  color: var(--mist);
}
[data-theme="light"] .data-table tbody tr:nth-child(even) {
  background: rgba(0, 0, 0, 0.015);
}
[data-theme="light"] .data-table tbody tr:hover {
  background: rgba(147, 51, 234, 0.04);
}
[data-theme="light"] .settings-section-danger {
  border-color: rgba(239, 68, 68, 0.15);
}

/* Light mode: filter card */
[data-theme="light"] .filter-select:focus {
  border-color: rgba(147, 51, 234, 0.4);
  box-shadow: 0 0 0 3px rgba(147, 51, 234, 0.06);
}

/* Light mode: glow effects */
[data-theme="light"] .settings-section::before,
[data-theme="light"] .admin-stat-card::before,
[data-theme="light"] .metric-card::before,
[data-theme="light"] .mini-stat::before {
  background: radial-gradient(circle at var(--glow-x, 50%) var(--glow-y, 50%), rgba(147, 51, 234, 0.04), transparent 60%);
}

[data-theme="light"] .stat-tile::after,
[data-theme="light"] .kpi-tile::after,
[data-theme="light"] .etf-card::after,
[data-theme="light"] .acc-item::after {
  background: radial-gradient(circle at var(--glow-x, 50%) var(--glow-y, 50%), rgba(147, 51, 234, 0.04), transparent 60%);
}

/* Light mode: toggle pill */
[data-theme="light"] .toggle-pill {
  color: #52525b;
  border-color: rgba(0, 0, 0, 0.1);
  background: rgba(0, 0, 0, 0.02);
}
[data-theme="light"] .toggle-pill:hover {
  border-color: rgba(147, 51, 234, 0.2);
  background: rgba(147, 51, 234, 0.04);
}
[data-theme="light"] .toggle-pill-active:hover {
  background: rgba(147, 51, 234, 0.14);
}

/* Light mode: action pill */
[data-theme="light"] .action-pill:hover {
  box-shadow: 0 3px 10px rgba(147, 51, 234, 0.1);
}

/* Light mode: admin stat card */
[data-theme="light"] .admin-stat-card {
  background: var(--surface);
}

/* Light mode: source card */
[data-theme="light"] .source-card {
  border-color: var(--line);
}
[data-theme="light"] .source-card:hover {
  border-color: rgba(147, 51, 234, 0.25);
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.04);
}
[data-theme="light"] .source-card strong { color: var(--ink); }

/* Light mode: jump card */
[data-theme="light"] .jump-card {
  background: var(--surface);
  border-color: var(--line);
}
[data-theme="light"] .jump-card:hover {
  border-color: rgba(147, 51, 234, 0.25);
}
[data-theme="light"] .jump-card span { color: var(--ink); }

/* Light mode: chart frame skeleton */
[data-theme="light"] .chart-frame::before {
  background: linear-gradient(
    90deg,
    var(--surface-2) 25%,
    rgba(0, 0, 0, 0.03) 50%,
    var(--surface-2) 75%
  );
  background-size: 200% 100%;
}

/* Light mode: company page elements */
[data-theme="light"] .value-prop {
  background: rgba(147, 51, 234, 0.05);
}
[data-theme="light"] .value-prop-label { color: #7c3aed; }
[data-theme="light"] .value-prop-body { color: #3f3f46; }

[data-theme="light"] .report-summary { color: #52525b; }
[data-theme="light"] .price-spotlight-change.is-up { color: #059669; }
[data-theme="light"] .price-spotlight-change.is-down { color: #dc2626; }

/* ── Light Mode: Landing Page ──────────────────────────────── */

[data-theme="light"] .landing-brand-mark {
  background: linear-gradient(135deg, rgba(147, 51, 234, 0.18), rgba(147, 51, 234, 0.06));
  border-color: rgba(147, 51, 234, 0.3);
  color: #7c3aed;
}

[data-theme="light"] .landing-brand-title { color: #18181b; }
[data-theme="light"] .landing-brand-sub { color: #71717a; }

[data-theme="light"] .landing-btn-ghost {
  border-color: rgba(0, 0, 0, 0.12);
  color: #18181b;
}
[data-theme="light"] .landing-btn-ghost:hover {
  border-color: rgba(147, 51, 234, 0.4);
  background: rgba(147, 51, 234, 0.05);
}

[data-theme="light"] .landing-hero-badge {
  background: rgba(147, 51, 234, 0.08);
  border-color: rgba(147, 51, 234, 0.2);
  color: #7c3aed;
}

[data-theme="light"] .landing-hero h1 { color: #18181b; }
[data-theme="light"] .landing-hero-desc { color: #52525b; }

[data-theme="light"] .landing-btn-outline {
  border-color: rgba(0, 0, 0, 0.12);
  color: #18181b;
}
[data-theme="light"] .landing-btn-outline:hover {
  border-color: rgba(147, 51, 234, 0.4);
  background: rgba(147, 51, 234, 0.05);
}

[data-theme="light"] .landing-features-title { color: #7c3aed; }
[data-theme="light"] .landing-features-heading { color: #18181b; }

[data-theme="light"] .landing-feature-icon {
  background: rgba(147, 51, 234, 0.08);
  border-color: rgba(147, 51, 234, 0.18);
}

[data-theme="light"] .landing-feature-tag {
  background: rgba(147, 51, 234, 0.06);
  border-color: rgba(147, 51, 234, 0.15);
  color: #7c3aed;
}

[data-theme="light"] .landing-footer { color: #a1a1aa; border-color: rgba(0, 0, 0, 0.06); }

[data-theme="light"] .landing-theme-btn {
  color: #52525b;
}

/* ── Light Mode: Auth / Login Page ─────────────────────────── */

[data-theme="light"] body.min-h-screen,
[data-theme="light"] .bg-shell {
  background: var(--shell) !important;
}

[data-theme="light"] .bg-surface {
  background: var(--surface) !important;
  border-color: rgba(0, 0, 0, 0.08) !important;
}

[data-theme="light"] .text-ink { color: var(--ink) !important; }
[data-theme="light"] .text-mist { color: var(--mist) !important; }

[data-theme="light"] .bg-accent\/20 {
  background: rgba(147, 51, 234, 0.12) !important;
}

[data-theme="light"] input[type="text"],
[data-theme="light"] input[type="password"],
[data-theme="light"] input[type="email"] {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.1);
  color: var(--ink);
}

[data-theme="light"] input[type="text"]:focus,
[data-theme="light"] input[type="password"]:focus,
[data-theme="light"] input[type="email"]:focus {
  border-color: rgba(147, 51, 234, 0.4);
  box-shadow: 0 0 0 3px rgba(147, 51, 234, 0.08);
}

[data-theme="light"] input::placeholder {
  color: #a1a1aa;
}

[data-theme="light"] .metric-card-value,
[data-theme="light"] .mini-stat-value {
  color: var(--ink);
}

[data-theme="light"] .chart-frame::before {
  background: linear-gradient(135deg, #f5f5f5 25%, #e5e5e5 50%, #f5f5f5 75%);
}

[data-theme="light"] .eyebrow {
  color: var(--accent);
}

[data-theme="light"] .panel-title {
  color: var(--ink);
}

/* ── Gradient Border Glow ─────────────────────────────────── */
@property --glow-angle {
  syntax: "<angle>";
  initial-value: 0deg;
  inherits: false;
}

@keyframes glow-rotate {
  to { --glow-angle: 360deg; }
}

.glow-border {
  position: relative;
  border: none !important;
  overflow: hidden;
}

.glow-border::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  pointer-events: none;
  background: conic-gradient(
    from var(--glow-angle),
    #a855f7, #6366f1, #ec4899, #f59e0b, #a855f7
  );
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: glow-rotate 4s linear infinite;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.glow-border:hover::before {
  opacity: 1;
}

.landing-feature-card.glow-border::before {
  opacity: 0.5;
}

.landing-feature-card.glow-border:hover::before {
  opacity: 1;
}

/* Hero card always-on subtle glow */
.hero-card.glow-border::before {
  opacity: 0.3;
}
.hero-card.glow-border:hover::before {
  opacity: 0.6;
}

/* ── Film Grain Texture ──────────────────────────────────── */
.film-grain {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 9998;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px 256px;
  mix-blend-mode: overlay;
}

[data-theme="light"] .film-grain {
  opacity: 0.025;
}

/* ── Spotlight Cursor ────────────────────────────────────── */
.spotlight {
  pointer-events: none;
  position: fixed;
  z-index: 1;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(168, 85, 247, 0.06) 0%,
    rgba(168, 85, 247, 0.02) 40%,
    transparent 70%
  );
  opacity: 0;
  transition: opacity 0.5s ease;
  will-change: transform;
}

[data-theme="light"] .spotlight {
  background: radial-gradient(
    circle,
    rgba(147, 51, 234, 0.04) 0%,
    rgba(147, 51, 234, 0.01) 40%,
    transparent 70%
  );
}

/* ── Typewriter Effect ───────────────────────────────────── */
.typewriter-cursor::after {
  content: "▋";
  display: inline-block;
  color: var(--accent);
  animation: blink-cursor 0.8s steps(2) infinite;
  margin-left: 2px;
  font-weight: 400;
}

@keyframes blink-cursor {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* ── Animated Counter ────────────────────────────────────── */
.counter-animate {
  display: inline-block;
  transition: none;
}

/* ── Bento Grid ──────────────────────────────────────────── */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: auto auto;
  gap: 1rem;
  width: 100%;
}

.bento-grid .bento-wide {
  grid-column: span 2;
}

.bento-grid .bento-tall {
  grid-row: span 2;
}

@media (max-width: 760px) {
  .bento-grid {
    grid-template-columns: 1fr;
  }
  .bento-grid .bento-wide {
    grid-column: span 1;
  }
  .bento-grid .bento-tall {
    grid-row: span 1;
  }
}

/* ── Command Palette (Cmd+K) ─────────────────────────────── */
.cmd-palette-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 20vh;
  opacity: 0;
  visibility: hidden;
  transition: opacity 200ms ease, visibility 200ms ease;
}

.cmd-palette-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

[data-theme="light"] .cmd-palette-overlay {
  background: rgba(0, 0, 0, 0.3);
}

.cmd-palette {
  width: 90%;
  max-width: 560px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
  transform: translateY(-12px) scale(0.97);
  transition: transform 200ms ease;
}

.cmd-palette-overlay.is-open .cmd-palette {
  transform: translateY(0) scale(1);
}

[data-theme="light"] .cmd-palette {
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.15);
}

.cmd-palette-input-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1.25rem;
  border-bottom: 1px solid var(--line);
}

.cmd-palette-icon {
  color: var(--mist);
  font-size: 1.1rem;
  flex-shrink: 0;
}

.cmd-palette-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--ink);
  font-size: 0.95rem;
  font-family: inherit;
}

.cmd-palette-input::placeholder {
  color: var(--mist);
}

.cmd-palette-hint {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.65rem;
  color: var(--mist);
  padding: 0.2rem 0.4rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  flex-shrink: 0;
}

.cmd-palette-results {
  max-height: 300px;
  overflow-y: auto;
  padding: 0.5rem;
}

.cmd-palette-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  border-radius: 8px;
  color: var(--ink);
  text-decoration: none;
  font-size: 0.88rem;
  cursor: pointer;
  transition: background 120ms ease;
}

.cmd-palette-item:hover,
.cmd-palette-item.is-selected {
  background: rgba(168, 85, 247, 0.1);
}

.cmd-palette-item-icon {
  width: 20px;
  text-align: center;
  color: var(--mist);
  flex-shrink: 0;
}

.cmd-palette-item-label {
  flex: 1;
}

.cmd-palette-item-shortcut {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.65rem;
  color: var(--mist);
}

.cmd-palette-footer {
  padding: 0.5rem 1rem;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.7rem;
  color: var(--mist);
  font-family: "JetBrains Mono", monospace;
}

.cmd-palette-footer kbd {
  padding: 0.1rem 0.35rem;
  border: 1px solid var(--line);
  border-radius: 3px;
  font-size: 0.65rem;
}

/* ── Scroll indicator ────────────────────────────────────── */
.scroll-indicator {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: var(--mist);
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  font-family: "JetBrains Mono", monospace;
  animation: bounce-down 2s ease-in-out infinite;
}

.scroll-indicator-arrow {
  width: 20px;
  height: 20px;
  border-right: 2px solid var(--mist);
  border-bottom: 2px solid var(--mist);
  transform: rotate(45deg);
  opacity: 0.5;
}

@keyframes bounce-down {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(8px); }
}

/* ========== Print Styles ========== */
/* ── Settings Section Styles ────────────────────────── */
.settings-section {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.5rem;
  transition: border-color 200ms ease, box-shadow 200ms ease;
}

.settings-section:hover {
  border-color: rgba(148, 163, 184, 0.15);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.settings-section-danger {
  border-color: rgba(239, 68, 68, 0.2);
}

.settings-section-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1rem;
}

.settings-section-icon {
  width: 20px;
  height: 20px;
  color: var(--accent);
  flex-shrink: 0;
  opacity: 0.75;
}

.settings-avatar-preview {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 12px rgba(168, 85, 247, 0.2);
}

.settings-avatar-fallback {
  background: linear-gradient(135deg, var(--accent), rgba(168, 85, 247, 0.7));
  color: #fff;
  font-weight: 700;
  font-family: "Manrope", sans-serif;
}

/* ── Admin Stat Cards ──────────────────────────────── */
.admin-toolbar {
  background:
    linear-gradient(90deg, rgba(168, 85, 247, 0.08), transparent 35%),
    linear-gradient(0deg, rgba(148, 163, 184, 0.03), rgba(148, 163, 184, 0.03));
}

.admin-stat-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.1rem 1rem;
  text-align: center;
  position: relative;
  overflow: hidden;
  transition: border-color 150ms ease, transform 200ms ease, box-shadow 200ms ease;
}

.admin-stat-card:hover {
  border-color: rgba(168, 85, 247, 0.22);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}

.admin-stat-card:hover {
  border-color: var(--line-strong);
}

.admin-stat-icon {
  width: 22px;
  height: 22px;
  margin: 0 auto 0.4rem;
  color: var(--mist);
  opacity: 0.5;
}

.admin-stat-label {
  font-size: 0.7rem;
  color: var(--mist);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

[data-theme="light"] .settings-section {
  background: var(--surface);
}

[data-theme="light"] .admin-stat-card {
  background: var(--surface);
}

/* ── Auth Page Styles ───────────────────────────────── */
.auth-body {
  position: relative;
  overflow: hidden;
}

.auth-bg-glow {
  position: fixed;
  top: -30%;
  left: 50%;
  width: 80vw;
  height: 80vw;
  max-width: 700px;
  max-height: 700px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(168, 85, 247, 0.14) 0%, rgba(56, 189, 248, 0.05) 50%, transparent 70%);
  transform: translateX(-50%);
  pointer-events: none;
  z-index: 0;
  animation: authGlowPulse 6s ease-in-out infinite alternate;
}

@keyframes authGlowPulse {
  0% { opacity: 0.8; transform: translateX(-50%) scale(1); }
  100% { opacity: 1; transform: translateX(-50%) scale(1.08); }
}

.auth-card {
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  animation: fadeInUp 500ms ease both;
}

/* Auth form elements */
input.auth-input,
.auth-input {
  width: 100%;
  border-radius: 12px;
  background-color: rgba(255, 255, 255, 0.06) !important;
  border: 1px solid rgba(255, 255, 255, 0.14);
  padding: 0.75rem 1rem;
  color: #f5f5f7 !important;
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  transition: border-color 180ms ease, box-shadow 180ms ease, background-color 180ms ease;
  outline: none;
  -webkit-text-fill-color: #f5f5f7;
  caret-color: #c4b5fd;
}
input.auth-input:hover,
.auth-input:hover {
  background-color: rgba(255, 255, 255, 0.08) !important;
  border-color: rgba(255, 255, 255, 0.2);
}
input.auth-input:focus,
.auth-input:focus {
  background-color: rgba(255, 255, 255, 0.09) !important;
  border-color: rgba(168, 85, 247, 0.6) !important;
  box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.15) !important;
  --tw-ring-color: transparent;
}
.auth-input::placeholder {
  color: rgba(226, 232, 240, 0.42) !important;
  opacity: 1;
  font-weight: 400;
}
/* Override Chrome autofill yellow + dark text */
input.auth-input:-webkit-autofill,
input.auth-input:-webkit-autofill:hover,
input.auth-input:-webkit-autofill:focus {
  -webkit-text-fill-color: #f5f5f7 !important;
  -webkit-box-shadow: 0 0 0 1000px rgba(38, 38, 42, 0.98) inset !important;
  caret-color: #c4b5fd !important;
  transition: background-color 5000s ease-in-out 0s;
}

.auth-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--mist);
  margin-bottom: 0.4rem;
  letter-spacing: 0.02em;
}

.auth-submit {
  width: 100%;
  border-radius: 12px;
  background: var(--accent);
  padding: 0.7rem 1rem;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: background 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}
.auth-submit:hover {
  background: rgba(168, 85, 247, 0.9);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(168, 85, 247, 0.3);
}
.auth-submit:active {
  transform: translateY(0);
  box-shadow: none;
}

.auth-heading {
  font-family: "Manrope", sans-serif;
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--ink);
  margin-bottom: 1.5rem;
  letter-spacing: -0.01em;
}

.auth-branding {
  animation: fadeInUp 400ms ease both;
}

[data-theme="light"] .auth-bg-glow {
  background: radial-gradient(circle, rgba(147, 51, 234, 0.08) 0%, rgba(59, 130, 246, 0.03) 50%, transparent 70%);
}

[data-theme="light"] .auth-card {
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.06);
}

[data-theme="light"] input.auth-input,
[data-theme="light"] .auth-input {
  background-color: rgba(0, 0, 0, 0.03) !important;
  color: #0f172a !important;
  -webkit-text-fill-color: #0f172a;
  caret-color: #0f172a;
}
[data-theme="light"] input.auth-input:-webkit-autofill,
[data-theme="light"] input.auth-input:-webkit-autofill:hover,
[data-theme="light"] input.auth-input:-webkit-autofill:focus {
  -webkit-text-fill-color: #0f172a !important;
  -webkit-box-shadow: 0 0 0 1000px #f5f5f7 inset !important;
}
[data-theme="light"] .auth-input:focus {
  border-color: rgba(147, 51, 234, 0.45);
  box-shadow: 0 0 0 3px rgba(147, 51, 234, 0.06);
}

[data-theme="light"] .auth-submit:hover {
  box-shadow: 0 4px 16px rgba(147, 51, 234, 0.2);
}

/* ── Enhanced cmd-palette-icon for SVG ──────────────── */
svg.cmd-palette-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* ── Auth layout v2 — split showcase + form ────────── */
.auth-shell {
  width: min(1100px, 100%);
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  position: relative;
  z-index: 1;
}
@media (min-width: 960px) {
  .auth-shell {
    grid-template-columns: 1.05fr 1fr;
    gap: 0;
    align-items: stretch;
    background: linear-gradient(180deg, rgba(15,23,42,0.55), rgba(2,6,13,0.65));
    border: 1px solid rgba(168,85,247,0.18);
    border-radius: 28px;
    overflow: hidden;
    box-shadow: 0 30px 80px -30px rgba(0,0,0,0.6), 0 0 0 1px rgba(168,85,247,0.05);
    backdrop-filter: blur(14px);
  }
}
.auth-showcase {
  display: none;
  position: relative;
  padding: 3.2rem 2.8rem;
  overflow: hidden;
  color: var(--ink);
  background:
    radial-gradient(ellipse at 25% 15%, rgba(168,85,247,0.30) 0%, transparent 55%),
    radial-gradient(ellipse at 80% 90%, rgba(56,189,248,0.20) 0%, transparent 55%),
    linear-gradient(135deg, rgba(15,10,35,0.95) 0%, rgba(5,8,20,0.98) 100%);
  border-right: 1px solid rgba(168,85,247,0.15);
}
@media (min-width: 960px) {
  .auth-showcase { display: flex; flex-direction: column; }
}
.auth-showcase::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(168,85,247,0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(168,85,247,0.06) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: radial-gradient(ellipse 60% 50% at 50% 50%, #000 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 60% 50% at 50% 50%, #000 30%, transparent 80%);
  pointer-events: none;
}
.auth-showcase-brand {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 2.2rem;
}
.auth-showcase-brand img {
  width: 48px; height: 48px; border-radius: 14px;
  box-shadow: 0 8px 24px rgba(168,85,247,0.35);
}
.auth-showcase-brand-name {
  font-family: "Manrope", sans-serif;
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: 0.04em;
  color: #fff;
}
.auth-showcase-brand-tag {
  font-size: 0.68rem;
  letter-spacing: 0.32em;
  color: rgba(196, 181, 253, 0.85);
  margin-top: 2px;
}
.auth-showcase-headline {
  position: relative;
  font-family: "Manrope", sans-serif;
  font-weight: 800;
  font-size: clamp(1.6rem, 2.6vw, 2.1rem);
  line-height: 1.2;
  background: linear-gradient(120deg, #ffffff 10%, #c4b5fd 60%, #93c5fd 95%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 1rem;
}
.auth-showcase-lede {
  position: relative;
  color: rgba(226, 232, 240, 0.80);
  font-size: 0.95rem;
  line-height: 1.65;
  margin-bottom: 2rem;
  max-width: 38ch;
}
.auth-feature-list {
  position: relative;
  display: grid;
  gap: 0.85rem;
  margin-top: auto;
}
.auth-feature {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  padding: 0.75rem 0.9rem;
  border-radius: 14px;
  background: rgba(168,85,247,0.06);
  border: 1px solid rgba(168,85,247,0.15);
  transition: transform 180ms ease, background 180ms ease, border-color 180ms ease;
}
.auth-feature:hover {
  transform: translateX(2px);
  background: rgba(168,85,247,0.10);
  border-color: rgba(168,85,247,0.30);
}
.auth-feature-icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, rgba(168,85,247,0.30), rgba(56,189,248,0.18));
  color: #e9d5ff;
  flex: none;
}
.auth-feature-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.auth-feature-title { font-weight: 700; color: #f1f5f9; font-size: 0.92rem; }
.auth-feature-desc  { font-size: 0.78rem; color: rgba(226,232,240,0.68); line-height: 1.45; }
.auth-showcase-footer {
  position: relative;
  margin-top: 1.6rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.72rem;
  color: rgba(148,163,184,0.7);
  letter-spacing: 0.16em;
}
.auth-showcase-footer .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: #20c997;
  box-shadow: 0 0 12px rgba(32,201,151,0.7);
  animation: authPulse 2s ease-in-out infinite;
}
@keyframes authPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.auth-form-pane {
  padding: 2.4rem clamp(1.2rem, 4vw, 2.6rem);
  display: flex;
  flex-direction: column;
  justify-content: center;
}
@media (min-width: 960px) {
  .auth-form-pane { padding: 3.2rem 3rem; }
}

/* Input-with-icon */
.auth-input-wrap {
  position: relative;
}
.auth-input-wrap .auth-input {
  padding-left: 2.6rem;
}
.auth-input-icon {
  position: absolute;
  left: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(148,163,184,0.65);
  pointer-events: none;
  width: 18px; height: 18px;
  transition: color 180ms ease;
}
.auth-input-wrap:focus-within .auth-input-icon { color: rgba(196,181,253,0.95); }
.auth-input-toggle {
  position: absolute;
  right: 0.6rem;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: 0;
  color: rgba(148,163,184,0.65);
  cursor: pointer;
  padding: 0.35rem;
  border-radius: 8px;
  display: grid; place-items: center;
}
.auth-input-toggle:hover { color: var(--ink); background: rgba(255,255,255,0.04); }

.auth-meta-row {
  margin-top: 1.4rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--mist);
  flex-wrap: wrap;
  gap: 0.5rem;
}
.auth-back-link {
  color: var(--mist);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  transition: color 180ms ease;
}
.auth-back-link:hover { color: var(--accent); }

[data-theme="light"] .auth-shell {
  background: rgba(255,255,255,0.65);
  border-color: rgba(147,51,234,0.18);
}
[data-theme="light"] .auth-showcase {
  background:
    radial-gradient(ellipse at 25% 15%, rgba(147,51,234,0.18) 0%, transparent 55%),
    radial-gradient(ellipse at 80% 90%, rgba(59,130,246,0.14) 0%, transparent 55%),
    linear-gradient(135deg, #faf7ff 0%, #eef2ff 100%);
  color: #0f172a;
  border-right-color: rgba(147,51,234,0.12);
}
[data-theme="light"] .auth-showcase-brand-name { color: #0f172a; }
[data-theme="light"] .auth-showcase-headline {
  background: linear-gradient(120deg, #1e1b4b 10%, #7c3aed 55%, #2563eb 95%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
[data-theme="light"] .auth-showcase-lede { color: rgba(15,23,42,0.72); }
[data-theme="light"] .auth-feature { background: rgba(124,58,237,0.05); border-color: rgba(124,58,237,0.15); }
[data-theme="light"] .auth-feature-title { color: #0f172a; }
[data-theme="light"] .auth-feature-desc { color: rgba(15,23,42,0.65); }


svg.topbar-search-icon {
  flex-shrink: 0;
}

/* ── Sidebar position relative for active bar ──────── */
.sidebar-link {
  position: relative;
}

@media print {
  *,
  *::before,
  *::after {
    background: transparent !important;
    color: #000 !important;
    box-shadow: none !important;
    text-shadow: none !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  html, body {
    background: #fff !important;
    font-size: 11pt;
  }

  .app-glow,
  .app-sidebar,
  .app-topbar,
  .mobile-tabbar,
  .toast-container,
  .meta-actions,
  .company-inline-actions,
  .action-pill,
  .toggle-pill,
  .topbar-user-wrap,
  #sidebar-toggle,
  #announcement-banner,
  .report-tab-bar {
    display: none !important;
  }

  .app-shell {
    display: block !important;
    grid-template-columns: 1fr !important;
  }

  .app-content {
    max-width: 100% !important;
    padding: 0 !important;
  }

  .panel,
  .report-masthead,
  .stat-tile,
  .kpi-tile,
  .metric-card,
  .metric-tile {
    border: 1px solid #ddd !important;
    page-break-inside: avoid;
    break-inside: avoid;
  }

  .chart-frame {
    page-break-inside: avoid;
    break-inside: avoid;
  }

  .chart-frame::before {
    display: none !important;
  }

  .section-head {
    page-break-after: avoid;
    break-after: avoid;
  }

  .overview-grid,
  .stat-grid,
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  .report-masthead {
    grid-template-columns: 1fr !important;
  }

  a[href]::after {
    content: none !important;
  }

  .eyebrow {
    color: #666 !important;
  }

  .panel-h,
  .section-title,
  .report-ticker,
  .report-name,
  .stat-tile-value,
  .kpi-value,
  .metric-card-value,
  .metric-tile-value {
    color: #000 !important;
  }

  .panel-body,
  .report-summary {
    color: #333 !important;
  }

  canvas {
    max-width: 100% !important;
  }
}

/* ========== earnings calendar ========== */
.ecal-kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.ecal-filters {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: center;
}

.ecal-select {
  font-family: "Noto Sans TC", sans-serif;
  font-size: 0.82rem;
  padding: 0.45rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  min-width: 140px;
}

.ecal-table .history-row.ecal-imminent {
  background: rgba(245, 158, 11, 0.06);
  border-left: 3px solid #f59e0b;
}
.ecal-table .history-row.ecal-imminent:hover {
  background: rgba(245, 158, 11, 0.12);
}

.ecal-table .history-row.ecal-reported {
  opacity: 0.7;
}

.ecal-today-tag {
  display: inline-block;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.66rem;
  letter-spacing: 0.1em;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  font-weight: 600;
}

.ecal-done-tag {
  display: inline-block;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.66rem;
  letter-spacing: 0.1em;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: rgba(32, 201, 151, 0.15);
  color: #34d399;
}

.ecal-tba {
  display: inline-block;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.66rem;
  letter-spacing: 0.1em;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.14);
  color: #94a3b8;
}

/* ── Chart help tooltip (item #1) ─────────────────────── */
.chart-help {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  margin-left: 0.4rem;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.18);
  color: #94a3b8;
  font-size: 0.7rem;
  font-weight: 700;
  cursor: help;
  user-select: none;
  position: relative;
  vertical-align: middle;
  transition: background 0.15s, color 0.15s;
}
.chart-help:hover { background: rgba(168, 85, 247, 0.2); color: #c4b5fd; }
.chart-help::after {
  content: attr(data-help);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(2, 6, 13, 0.96);
  color: #e5e7eb;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 6px;
  padding: 0.55rem 0.7rem;
  font-size: 0.72rem;
  font-weight: 400;
  white-space: normal;
  width: max-content;
  max-width: 260px;
  text-align: left;
  line-height: 1.5;
  letter-spacing: 0;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s;
  z-index: 50;
}
.chart-help:hover::after { opacity: 1; }

/* ── Loading splash (item #16) ─────────────────────── */
.page-loader {
  position: fixed;
  inset: 0;
  background: rgba(5, 8, 14, 0.85);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.page-loader.is-active { opacity: 1; pointer-events: auto; }
.page-loader-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.5rem 2rem;
  text-align: center;
  min-width: 260px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}
.page-loader-spinner {
  width: 38px;
  height: 38px;
  border: 3px solid rgba(168, 85, 247, 0.2);
  border-top-color: #a855f7;
  border-radius: 50%;
  margin: 0 auto 0.8rem;
  animation: page-spin 0.9s linear infinite;
}
@keyframes page-spin { to { transform: rotate(360deg); } }
.page-loader-label {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  color: var(--mist);
  text-transform: uppercase;
}
.page-loader-ticker {
  font-family: "Manrope", sans-serif;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--ink);
  margin-top: 0.35rem;
}


.ecal-idx {
  display: block;
  font-size: 0.65rem;
  color: var(--mist);
  margin-top: 2px;
}

.ecal-sec-link {
  text-decoration: none;
  font-size: 1.1rem;
  opacity: 0.7;
  transition: opacity 0.15s;
}
.ecal-sec-link:hover {
  opacity: 1;
}

.ecal-gen-time {
  text-align: right;
  font-size: 0.72rem;
  color: var(--mist);
  font-family: "JetBrains Mono", monospace;
  margin-top: 0.5rem;
}

/* ========== macro economy dashboard ========== */
.macro-sentiment-body {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 2rem;
  align-items: start;
  padding: 1rem 0;
}

.macro-gauge-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.macro-factors {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.macro-factor-row {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.macro-factor-head {
  min-width: 160px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.macro-factor-bar-bg {
  flex: 1;
  height: 10px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
}

.macro-factor-bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 600ms ease;
}

.macro-factor-signal {
  min-width: 60px;
  text-align: right;
}

/* ── AI 宏觀展望 ── */
.macro-outlook-panel .macro-outlook-body {
  padding: 1rem 0 0.5rem;
  font-size: 0.9rem;
  line-height: 1.8;
  color: var(--ink);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.2rem;
}

.macro-outlook-body h2,
.macro-outlook-body h3,
.macro-outlook-body h4.md-h {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  margin-top: 0;
  margin-bottom: 0.75rem;
  color: #e2e8f0;
  padding-bottom: 0.5rem;
  border-bottom: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.macro-outlook-body h2::before,
.macro-outlook-body h3::before,
.macro-outlook-body h4.md-h::before {
  content: "";
  display: none;
}

/* 分段卡片 — JS 包裝每個 heading+content */
.macro-outlook-section {
  background: linear-gradient(135deg, rgba(148,163,184,0.05) 0%, rgba(148,163,184,0.02) 100%);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.4rem 1.6rem 1.2rem;
  position: relative;
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.macro-outlook-section:hover {
  border-color: rgba(148,163,184,0.25);
  box-shadow: 0 4px 24px rgba(0,0,0,0.15);
}

/* 每個 section 的頂部裝飾線 */
.macro-outlook-section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  border-radius: 14px 14px 0 0;
}

/* section 圖標 — 由 JS 注入 data-section-icon */
.macro-outlook-section h2::before,
.macro-outlook-section h3::before,
.macro-outlook-section h4.md-h::before {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  font-size: 14px;
  flex-shrink: 0;
}

/* 第 1 區: 市場環境總結 — 全寬 + 藍色調 */
.macro-outlook-section:nth-child(1) {
  grid-column: 1 / -1;
  background: linear-gradient(135deg, rgba(56,189,248,0.06) 0%, rgba(56,189,248,0.01) 100%);
  border-color: rgba(56,189,248,0.15);
}
.macro-outlook-section:nth-child(1)::before {
  background: linear-gradient(90deg, #38bdf8, #0ea5e9);
}
.macro-outlook-section:nth-child(1) h2,
.macro-outlook-section:nth-child(1) h3,
.macro-outlook-section:nth-child(1) h4.md-h {
  color: #7dd3fc;
}
.macro-outlook-section:nth-child(1) h2::before,
.macro-outlook-section:nth-child(1) h3::before,
.macro-outlook-section:nth-child(1) h4.md-h::before {
  content: "\1F30D";
  background: rgba(56,189,248,0.12);
}

/* 第 2 區: 關鍵風險與機會 — 琥珀色調 */
.macro-outlook-section:nth-child(2)::before {
  background: linear-gradient(90deg, #f59e0b, #fbbf24);
}
.macro-outlook-section:nth-child(2) h2,
.macro-outlook-section:nth-child(2) h3,
.macro-outlook-section:nth-child(2) h4.md-h {
  color: #fde68a;
}
.macro-outlook-section:nth-child(2) h2::before,
.macro-outlook-section:nth-child(2) h3::before,
.macro-outlook-section:nth-child(2) h4.md-h::before {
  content: "\26A0\FE0F";
  background: rgba(245,158,11,0.12);
}

/* 第 3 區: 資產類別展望 — 綠色調 */
.macro-outlook-section:nth-child(3)::before {
  background: linear-gradient(90deg, #20c997, #34d399);
}
.macro-outlook-section:nth-child(3) h2,
.macro-outlook-section:nth-child(3) h3,
.macro-outlook-section:nth-child(3) h4.md-h {
  color: #6ee7b7;
}
.macro-outlook-section:nth-child(3) h2::before,
.macro-outlook-section:nth-child(3) h3::before,
.macro-outlook-section:nth-child(3) h4.md-h::before {
  content: "\1F4CA";
  background: rgba(32,201,151,0.12);
}

/* 第 4 區: 投資者關注重點 — 紫色調 */
.macro-outlook-section:nth-child(4)::before {
  background: linear-gradient(90deg, #a855f7, #c084fc);
}
.macro-outlook-section:nth-child(4) h2,
.macro-outlook-section:nth-child(4) h3,
.macro-outlook-section:nth-child(4) h4.md-h {
  color: #d8b4fe;
}
.macro-outlook-section:nth-child(4) h2::before,
.macro-outlook-section:nth-child(4) h3::before,
.macro-outlook-section:nth-child(4) h4.md-h::before {
  content: "\1F3AF";
  background: rgba(168,85,247,0.12);
}

/* 未被 JS 包裝前的 fallback（無 heading 的純文字） */
.macro-outlook-body > p:first-child {
  grid-column: 1 / -1;
}

.macro-outlook-body p {
  margin-bottom: 0.6rem;
  color: var(--mist);
  font-size: 0.875rem;
  line-height: 1.75;
}

.macro-outlook-body strong {
  color: var(--accent);
  font-weight: 600;
}

.macro-outlook-body ul,
.macro-outlook-body ol {
  padding-left: 1.2rem;
  margin-bottom: 0.6rem;
}

.macro-outlook-body li {
  margin-bottom: 0.35rem;
  color: var(--mist);
  font-size: 0.875rem;
  line-height: 1.7;
}

.macro-outlook-body li::marker {
  color: var(--accent);
}

/* ── 市場新聞 ── */
.macro-news-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.macro-news-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.9rem 1rem;
  text-decoration: none;
  border-bottom: 1px solid rgba(148, 163, 184, 0.08);
  transition: background 150ms ease;
}
.macro-news-item:last-child {
  border-bottom: none;
}
.macro-news-item:hover {
  background: rgba(168, 85, 247, 0.05);
}
.macro-news-item:hover .macro-news-arrow {
  opacity: 1;
  transform: translateX(2px);
}
.macro-news-item:hover .macro-news-num {
  background: var(--accent);
  color: #fff;
}

.macro-news-num {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 6px;
  background: rgba(148, 163, 184, 0.08);
  color: var(--mist);
  font-size: 0.72rem;
  font-weight: 700;
  font-family: "JetBrains Mono", monospace;
  transition: background 150ms ease, color 150ms ease;
}

.macro-news-content {
  flex: 1;
  min-width: 0;
}

.macro-news-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.5;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.macro-news-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 4px;
  font-size: 0.72rem;
  color: var(--mist);
  font-family: "JetBrains Mono", monospace;
}
.macro-news-publisher {
  color: var(--accent);
  font-weight: 500;
}
.macro-news-date {
  opacity: 0.7;
}
.macro-news-date::before {
  content: "·";
  margin-right: 0.5rem;
}

.macro-news-arrow {
  flex-shrink: 0;
  color: var(--mist);
  font-size: 1rem;
  opacity: 0;
  transition: opacity 150ms ease, transform 150ms ease;
}

@media (max-width: 768px) {
  .macro-outlook-panel .macro-outlook-body {
    grid-template-columns: 1fr;
  }
  .macro-outlook-section:nth-child(1) {
    grid-column: 1;
  }
  .macro-news-item {
    padding: 0.75rem 0.5rem;
  }
}

@media (max-width: 900px) {
  .macro-sentiment-body {
    grid-template-columns: 1fr;
  }
  .macro-gauge-wrap {
    order: -1;
  }
  .macro-factor-row {
    flex-wrap: wrap;
  }
  .macro-factor-head {
    min-width: 100%;
  }
}



/* ─────────────────────────────────────────────────────────────
   v1.3 GLOBAL "COOL" POLISH LAYER
   Appended at end so it overrides earlier definitions.
   Scope: dark theme primarily; light theme overrides at the bottom.
   ───────────────────────────────────────────────────────────── */

/* ── Page background: subtle aurora + grain ── */
body {
  background:
    radial-gradient(1200px 600px at 12% -10%, rgba(168, 85, 247, 0.10), transparent 60%),
    radial-gradient(900px 500px at 95% 0%, rgba(56, 189, 248, 0.06), transparent 55%),
    radial-gradient(800px 600px at 50% 110%, rgba(236, 72, 153, 0.05), transparent 60%),
    var(--shell);
  background-attachment: fixed;
}

/* ── Headings: accent gradient under hero h1/h2 ── */
.page-title,
h1.page-title,
.section-eyebrow + h1,
.hero-title {
  background: linear-gradient(120deg, #f5f5f7 0%, #e9d5ff 60%, #c4b5fd 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  letter-spacing: -0.01em;
}

/* ── Panels: glass + gradient border + hover lift ── */
.panel {
  position: relative;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.025) 0%, rgba(255,255,255,0.012) 100%),
    rgba(22, 22, 26, 0.72) !important;
  border: 1px solid rgba(255, 255, 255, 0.07) !important;
  backdrop-filter: blur(14px) saturate(1.05);
  -webkit-backdrop-filter: blur(14px) saturate(1.05);
  box-shadow:
    0 1px 0 rgba(255,255,255,0.04) inset,
    0 12px 32px -16px rgba(0,0,0,0.55),
    0 2px 6px -2px rgba(0,0,0,0.35);
  transition: transform 220ms ease, box-shadow 220ms ease, border-color 220ms ease;
}
.panel:hover {
  border-color: rgba(168, 85, 247, 0.18) !important;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.05) inset,
    0 18px 44px -18px rgba(0,0,0,0.6),
    0 0 0 1px rgba(168, 85, 247, 0.06),
    0 0 32px -12px rgba(168, 85, 247, 0.18);
}
.panel-title,
.panel-h {
  font-weight: 700;
  letter-spacing: 0.005em;
}

/* ── Metric cards: top accent bar + hover glow ── */
.metric-card {
  position: relative;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.03) 0%, rgba(255,255,255,0.008) 100%),
    rgba(22,22,26,0.72) !important;
  border: 1px solid rgba(255,255,255,0.06) !important;
  border-radius: 16px;
  overflow: hidden;
  transition: transform 220ms ease, border-color 220ms ease, box-shadow 220ms ease;
}
.metric-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(168, 85, 247, 0.55), transparent);
  opacity: 0.55;
}
.metric-card:hover {
  transform: translateY(-2px);
  border-color: rgba(168, 85, 247, 0.22) !important;
  box-shadow:
    0 18px 40px -20px rgba(0,0,0,0.55),
    0 0 28px -12px rgba(168, 85, 247, 0.22);
}
.metric-card-value {
  font-feature-settings: "tnum" 1, "ss01" 1;
  letter-spacing: -0.015em;
}
.metric-card-label {
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  color: rgba(226, 232, 240, 0.55);
}

/* ── Sidebar: brighter active link, smoother hover ── */
.app-sidebar {
  background:
    linear-gradient(180deg, rgba(168, 85, 247, 0.05) 0%, transparent 30%),
    rgba(10, 10, 12, 0.78) !important;
  border-right: 1px solid rgba(255, 255, 255, 0.05) !important;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.sidebar-link {
  position: relative;
  border-radius: 10px;
  transition: background-color 180ms ease, color 180ms ease, transform 180ms ease;
}
.sidebar-link:hover {
  background: rgba(255, 255, 255, 0.04);
  color: #f5f5f7;
}
.sidebar-link.is-active {
  background: linear-gradient(90deg, rgba(168, 85, 247, 0.18), rgba(168, 85, 247, 0.04)) !important;
  color: #f5f5f7 !important;
  box-shadow: inset 0 0 0 1px rgba(168, 85, 247, 0.22);
}
.sidebar-link.is-active::before {
  content: "";
  position: absolute;
  left: 0; top: 22%; bottom: 22%;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: linear-gradient(180deg, #c084fc, #a855f7);
  box-shadow: 0 0 12px rgba(168, 85, 247, 0.6);
}
.sidebar-section {
  text-transform: uppercase;
  font-size: 0.66rem;
  letter-spacing: 0.22em;
  color: rgba(226, 232, 240, 0.35);
}
.brand-title {
  background: linear-gradient(120deg, #f5f5f7, #e9d5ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ── Buttons: primary purple gradient + glow ── */
button.btn-primary,
.btn-primary,
button[type="submit"]:not(.auth-submit):not(.bg-red-500):not(.bg-rose-500) {
  background: linear-gradient(135deg, #a855f7 0%, #7c3aed 60%, #6d28d9 100%);
  color: #fff;
  border: 0;
  border-radius: 10px;
  padding: 0.55rem 1.1rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.15) inset,
    0 8px 20px -8px rgba(124, 58, 237, 0.55);
  transition: transform 160ms ease, box-shadow 220ms ease, filter 160ms ease;
  cursor: pointer;
}
button.btn-primary:hover,
.btn-primary:hover,
button[type="submit"]:not(.auth-submit):not(.bg-red-500):not(.bg-rose-500):hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
  box-shadow:
    0 1px 0 rgba(255,255,255,0.18) inset,
    0 14px 28px -10px rgba(124, 58, 237, 0.65),
    0 0 22px -6px rgba(168, 85, 247, 0.45);
}
button.btn-primary:active,
.btn-primary:active {
  transform: translateY(0);
  filter: brightness(0.98);
}

/* Secondary / ghost buttons */
.btn-secondary,
button.btn-secondary {
  background: rgba(255,255,255,0.04);
  color: #e2e8f0;
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 10px;
  padding: 0.55rem 1.1rem;
  font-weight: 500;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}
.btn-secondary:hover,
button.btn-secondary:hover {
  background: rgba(255,255,255,0.07);
  border-color: rgba(168, 85, 247, 0.35);
  color: #f5f5f7;
}

/* ── Action pills (small inline buttons) ── */
.action-pill {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 999px;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}
.action-pill:hover {
  background: rgba(168, 85, 247, 0.10);
  border-color: rgba(168, 85, 247, 0.35);
  color: #ede9fe;
}

/* ── Tables: refined header & hover ── */
.data-table thead th {
  background: linear-gradient(180deg, rgba(168, 85, 247, 0.06), rgba(168, 85, 247, 0.02)) !important;
  border-bottom: 1px solid rgba(168, 85, 247, 0.18) !important;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.7rem;
  color: rgba(226, 232, 240, 0.7);
  font-weight: 600;
}
.data-table tbody tr {
  transition: background-color 160ms ease, box-shadow 160ms ease;
}
.data-table tbody tr:hover {
  background: rgba(168, 85, 247, 0.06) !important;
  box-shadow: inset 3px 0 0 rgba(168, 85, 247, 0.55);
}

/* ── Chips / tags ── */
.chip,
.tag {
  background: rgba(168, 85, 247, 0.10);
  border: 1px solid rgba(168, 85, 247, 0.22);
  color: #ede9fe;
  border-radius: 999px;
  padding: 0.18rem 0.65rem;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  font-weight: 500;
}

/* ── Chart-help "?" badge: refined ── */
.chart-help {
  display: inline-grid;
  place-items: center;
  width: 18px; height: 18px;
  margin-left: 0.45rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  background: rgba(168, 85, 247, 0.14);
  color: #c4b5fd;
  border: 1px solid rgba(168, 85, 247, 0.3);
  cursor: help;
  transition: background-color 160ms ease, color 160ms ease, transform 160ms ease;
}
.chart-help:hover {
  background: rgba(168, 85, 247, 0.28);
  color: #fff;
  transform: scale(1.08);
}

/* ── Form inputs: brighter focus everywhere ── */
input:not(.auth-input):not([type="checkbox"]):not([type="radio"]):not([type="range"]):focus,
select:focus,
textarea:focus {
  border-color: rgba(168, 85, 247, 0.55) !important;
  box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.14) !important;
  outline: none !important;
}

/* ── Custom scrollbar (WebKit) ── */
*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
*::-webkit-scrollbar-track {
  background: transparent;
}
*::-webkit-scrollbar-thumb {
  background: rgba(168, 85, 247, 0.18);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
*::-webkit-scrollbar-thumb:hover {
  background: rgba(168, 85, 247, 0.32);
  background-clip: padding-box;
  border: 2px solid transparent;
}

/* ── Selection ── */
::selection {
  background: rgba(168, 85, 247, 0.32);
  color: #fff;
}

/* ── Topbar refinement ── */
.app-topbar {
  background: linear-gradient(180deg, rgba(10,10,12,0.85), rgba(10,10,12,0.6)) !important;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

/* ── Recent reports / list cards generic hover ── */
.recent-report-card,
.history-row,
.report-card {
  transition: transform 200ms ease, border-color 200ms ease, box-shadow 200ms ease, background-color 200ms ease;
}
.recent-report-card:hover,
.report-card:hover {
  transform: translateY(-2px);
  border-color: rgba(168, 85, 247, 0.28) !important;
  box-shadow: 0 14px 32px -16px rgba(0,0,0,0.55), 0 0 22px -10px rgba(168, 85, 247, 0.32);
}

/* ── Light theme overrides for polish layer ── */
[data-theme="light"] body {
  background:
    radial-gradient(1100px 600px at 10% -10%, rgba(168, 85, 247, 0.07), transparent 55%),
    radial-gradient(800px 500px at 95% 5%, rgba(56, 189, 248, 0.05), transparent 55%),
    var(--shell);
  background-attachment: fixed;
}
[data-theme="light"] .panel {
  background: rgba(255,255,255,0.85) !important;
  border: 1px solid rgba(15, 23, 42, 0.06) !important;
  box-shadow: 0 1px 0 rgba(255,255,255,0.6) inset, 0 8px 24px -16px rgba(15,23,42,0.18);
}
[data-theme="light"] .panel:hover {
  border-color: rgba(168, 85, 247, 0.25) !important;
  box-shadow: 0 12px 32px -18px rgba(15,23,42,0.22), 0 0 24px -12px rgba(168, 85, 247, 0.18);
}
[data-theme="light"] .metric-card {
  background: rgba(255,255,255,0.85) !important;
  border: 1px solid rgba(15, 23, 42, 0.06) !important;
}
[data-theme="light"] .data-table thead th {
  color: #4c1d95;
}
[data-theme="light"] .sidebar-link.is-active {
  background: linear-gradient(90deg, rgba(168, 85, 247, 0.14), rgba(168, 85, 247, 0.02)) !important;
  color: #4c1d95 !important;
}
[data-theme="light"] .page-title,
[data-theme="light"] h1.page-title {
  background: linear-gradient(120deg, #18181b 0%, #6d28d9 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
[data-theme="light"] .brand-title {
  background: linear-gradient(120deg, #18181b, #6d28d9);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
[data-theme="light"] *::-webkit-scrollbar-thumb {
  background: rgba(124, 58, 237, 0.22);
  background-clip: padding-box;
  border: 2px solid transparent;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .panel, .metric-card, .sidebar-link, .recent-report-card, .report-card,
  button.btn-primary, .btn-primary, .btn-secondary, .action-pill {
    transition: none !important;
  }
}

/* ─────────────────────────────────────────────────────────────
   v1.3 REPORT / COMPANY HERO POLISH
   ───────────────────────────────────────────────────────────── */

/* ── Hero masthead: dramatic glow + animated shimmer ── */
.report-masthead {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(168, 85, 247, 0.22) !important;
  background:
    radial-gradient(circle at 0% 0%, rgba(168, 85, 247, 0.18), transparent 50%),
    radial-gradient(circle at 100% 100%, rgba(56, 189, 248, 0.08), transparent 55%),
    linear-gradient(180deg, rgba(22,22,26,0.85), rgba(15,15,18,0.78)) !important;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.06) inset,
    0 24px 60px -28px rgba(0,0,0,0.6),
    0 0 40px -16px rgba(168, 85, 247, 0.28) !important;
}
.report-masthead::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(168, 85, 247, 0.7), rgba(56, 189, 248, 0.45), transparent);
}
.report-masthead::after {
  content: "";
  position: absolute;
  top: -50%; right: -20%;
  width: 60%; height: 200%;
  background: radial-gradient(ellipse at center, rgba(168, 85, 247, 0.12), transparent 60%);
  pointer-events: none;
  animation: heroShimmer 12s ease-in-out infinite alternate;
}
@keyframes heroShimmer {
  0%   { transform: translate(0, 0) rotate(0deg); opacity: 0.55; }
  100% { transform: translate(-8%, 6%) rotate(8deg); opacity: 0.85; }
}

/* ── Ticker badge: gradient pill ── */
.report-ticker {
  display: inline-block;
  padding: 0.18rem 0.7rem;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.22), rgba(124, 58, 237, 0.10));
  border: 1px solid rgba(168, 85, 247, 0.35);
  color: #f5f5f7 !important;
  font-family: "JetBrains Mono", monospace !important;
  font-weight: 700 !important;
  letter-spacing: 0.08em !important;
  text-shadow: 0 0 12px rgba(168, 85, 247, 0.45);
}

/* ── Company name: gradient fill ── */
.report-name {
  background: linear-gradient(120deg, #ffffff 0%, #ede9fe 55%, #c4b5fd 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent !important;
  text-shadow: none;
  letter-spacing: -0.015em !important;
}

/* ── Subline: refined ── */
.report-subline {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(196, 181, 253, 0.7);
  margin-top: 0.45rem;
}

/* ── Value-prop callout: stronger frame ── */
.value-prop {
  margin-top: 1.2rem;
  padding: 1rem 1.15rem;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.10), rgba(56, 189, 248, 0.04));
  border: 1px solid rgba(168, 85, 247, 0.22);
  border-left: 3px solid rgba(168, 85, 247, 0.65);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}
.value-prop-label {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.66rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #c4b5fd;
  margin-bottom: 0.35rem;
}
.value-prop-body {
  color: #f1f5f9;
  font-size: 0.95rem;
  line-height: 1.75;
}

/* ── Sticky meta sidebar on desktop ── */
@media (min-width: 1024px) {
  .report-masthead-meta {
    position: sticky;
    top: 84px;
    align-self: start;
    max-height: calc(100vh - 110px);
    overflow-y: auto;
    padding-right: 0.4rem;
  }
  .report-masthead-meta::-webkit-scrollbar { width: 6px; }
}

/* ── Meta-actions: nicer pill grid + hover ── */
.meta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.action-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.9rem;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.10);
  color: #e2e8f0;
  border-radius: 999px;
  text-decoration: none;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}
.action-pill:hover {
  background: rgba(168, 85, 247, 0.14);
  border-color: rgba(168, 85, 247, 0.45);
  color: #f5f5f7;
  transform: translateY(-1px);
}
.action-pill-muted { color: rgba(226, 232, 240, 0.55); }

/* ── meta-row: brighter values, mono numbers ── */
.meta-row {
  align-items: center;
  padding: 0.3rem 0;
  border-bottom: 1px dashed rgba(255,255,255,0.04);
}
.meta-row:last-child { border-bottom: 0; }
.meta-row > span:first-child {
  text-transform: uppercase;
  font-size: 0.66rem;
  letter-spacing: 0.16em;
  color: rgba(226, 232, 240, 0.45);
}
.meta-row > span:last-child,
.meta-row > a:last-child {
  font-weight: 500;
  color: #e2e8f0;
}

/* ── Section heads: eyebrow + gradient title + accent rule ── */
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin: 2rem 0 0.9rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.66rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(196, 181, 253, 0.85);
}
.eyebrow::before {
  content: "";
  width: 14px;
  height: 1px;
  background: linear-gradient(90deg, rgba(168, 85, 247, 0.7), transparent);
}
.section-title {
  font-family: "Manrope", sans-serif;
  font-size: clamp(1.15rem, 1.6vw, 1.45rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-top: 0.2rem;
  background: linear-gradient(120deg, #ffffff 0%, #ede9fe 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.section-lede {
  margin-top: 0.25rem;
  font-size: 0.85rem;
  color: rgba(226, 232, 240, 0.55);
  line-height: 1.6;
}

/* ── Hero submit on company.html ── */
.hero-submit {
  background: linear-gradient(135deg, #a855f7 0%, #7c3aed 60%, #6d28d9 100%) !important;
  color: #fff !important;
  border: 0 !important;
  border-radius: 12px;
  padding: 0.7rem 1.4rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.18) inset,
    0 12px 28px -10px rgba(124, 58, 237, 0.6),
    0 0 24px -8px rgba(168, 85, 247, 0.45);
  transition: transform 160ms ease, filter 160ms ease, box-shadow 220ms ease;
}
.hero-submit:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
  box-shadow:
    0 1px 0 rgba(255,255,255,0.2) inset,
    0 16px 36px -12px rgba(124, 58, 237, 0.7),
    0 0 32px -10px rgba(168, 85, 247, 0.55);
}

/* ── Light theme overrides for hero polish ── */
[data-theme="light"] .report-masthead {
  background:
    radial-gradient(circle at 0% 0%, rgba(168, 85, 247, 0.10), transparent 50%),
    rgba(255,255,255,0.92) !important;
  border-color: rgba(168, 85, 247, 0.22) !important;
  box-shadow: 0 18px 40px -22px rgba(15,23,42,0.18), 0 0 0 1px rgba(168, 85, 247, 0.06) !important;
}
[data-theme="light"] .report-name {
  background: linear-gradient(120deg, #18181b 0%, #6d28d9 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent !important;
}
[data-theme="light"] .section-title {
  background: linear-gradient(120deg, #18181b 0%, #6d28d9 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
[data-theme="light"] .report-ticker {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.18), rgba(124, 58, 237, 0.06));
  color: #4c1d95 !important;
  text-shadow: none;
}

@media (prefers-reduced-motion: reduce) {
  .report-masthead::after { animation: none; }
}
