
body {
  font-family: 'Inter', 'Roboto', Helvetica, Arial, sans-serif;
  background-color: var(--primary-bg);
  color: var(--primary-fg);
  line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
}

img {
  max-width: 100%;
  height: auto;
}

.container-fluid {
  padding-left: 1rem;
  padding-right: 1rem;
}

@media (max-width: 768px) {
  .collapse-on-mobile {
    flex-direction: column !important;
  }
}

:root {
  --primary-bg: #ffffff;
  --primary-fg: #0f172a;
  --brand-accent: #2563eb;
  --brand-accent-strong: #1d4ed8;
  --brand-accent-soft: rgba(37, 99, 235, 0.12);
  --accent: #1a73e8;
  --section-bg: #f9fbfd;
  --card-border: #e0e0e0;
}

main {
  color: inherit;
}

.navbar {
  background: rgba(248, 250, 252, 0.9) !important;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.06);
  position: relative;
  z-index: 1100;
  backdrop-filter: blur(14px);
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.navbar.border-bottom {
  border-color: #e5e7eb !important;
}

.navbar .dropdown {
  position: relative;
}

.navbar .dropdown-menu {
  position: absolute;
  right: 0;
  left: auto;
  margin-top: 0.5rem;
  z-index: 2000;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.18);
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 0.75rem;
  overflow: hidden;
  min-width: 12rem;
  background: rgba(255, 255, 255, 0.95);
}

.navbar .dropdown-menu .dropdown-item {
  padding: 0.65rem 1.1rem;
}

.navbar .dropdown-menu .dropdown-item:active {
  background-color: rgba(59, 130, 246, 0.1);
}

@media (max-width: 991.98px) {
  .navbar {
    background: #ffffff !important;
    box-shadow: 0 1px 0 rgba(15, 23, 42, 0.08);
  }

  .navbar .navbar-collapse {
    margin-top: 1rem;
    background: #ffffff;
    border-radius: 16px;
    padding: 1.25rem 1rem;
    box-shadow: 0 18px 46px rgba(15, 23, 42, 0.15);
    border: 1px solid rgba(15, 23, 42, 0.06);
  }

  .navbar .navbar-nav {
    gap: 0.25rem;
  }

  .navbar .navbar-nav .nav-link {
    color: #0f172a !important;
    font-size: 1.05rem;
    padding-inline: 0;
    font-weight: 500;
  }

  .navbar .navbar-nav .nav-link.active,
  .navbar .navbar-nav .nav-link:focus,
  .navbar .navbar-nav .nav-link:hover {
    color: #1d4ed8 !important;
  }

  .navbar .btn,
  .navbar .dropdown {
    width: 100%;
  }

  .navbar .dropdown-menu {
    position: static;
    margin-top: 0.75rem;
    width: 100%;
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 14px;
    box-shadow: 0 18px 46px rgba(15, 23, 42, 0.12);
  }

  .navbar .dropdown-menu .dropdown-item {
    color: #0f172a;
  }

  .navbar .dropdown-menu .dropdown-item:active {
    background-color: rgba(59, 130, 246, 0.12);
  }
}

.text-muted {
  color: #4b5563 !important;
}

.text-secondary {
  color: #475569 !important;
}

label,
.form-label {
  color: inherit;
  font-weight: 500;
}

a {
  color: #1d4ed8;
}

a:hover,
a:focus {
  color: #1e3a8a;
}

.wrapper {
  background-color: var(--primary-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  max-width: 720px;
  margin: 0 auto;
  overflow: hidden;
  padding: 20px;
}

.section-divider {
  border: none;
  border-top: 1px solid #ccc;
  margin: 40px 0;
  opacity: 0.3;
}

.digest-preview .card {
  margin-bottom: 24px;
  padding: 20px;
  border: 1px solid var(--card-border);
  border-radius: 8px;
  background-color: var(--section-bg);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

.digest-preview .card h2,
.digest-preview .card h3 {
  font-size: 20px;
  margin: 0 0 8px;
  font-weight: 600;
}

.digest-preview .card p {
  margin: 0 0 10px;
  font-size: 15px;
  color: var(--primary-fg);
}

.pro-profile-layout .pro-profile-card {
  border-radius: 1.5rem;
}

@media (max-width: 575.98px) {
  .pro-profile-layout .container {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }

  .pro-profile-layout .pro-profile-card {
    margin-left: -0.5rem;
    margin-right: -0.5rem;
    border-radius: 1.5rem;
  }

  .pro-profile-layout .pro-profile-card .card-body {
    padding: 1.75rem 1.5rem;
  }
}

.digest-preview .article-image {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 8px auto;
  border-radius: 4px;
}

.digest-preview .reflection {
  margin: -4px 0 8px;
  font-size: 14px;
  color: #666;
}

.navbar-brand {
  font-weight: 700;
  letter-spacing: -0.01em;
  gap: 0.75rem;
  min-width: 0;
}

.navbar-brand-logo {
  height: 48px;
  width: auto;
  display: block;
}

.navbar-brand-tagline {
  font-size: 0.75rem;
  font-weight: 500;
  color: rgba(15, 23, 42, 0.6);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.navbar .nav-link.active,
.navbar .nav-link:focus,
.navbar .nav-link:hover {
  color: var(--brand-accent-strong) !important;
}

.btn-primary,
.btn-primary:focus {
  background: linear-gradient(135deg, var(--brand-accent), var(--brand-accent-strong));
  border-color: var(--brand-accent-strong);
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.22);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--brand-accent-strong), #1e3a8a);
  border-color: #1e3a8a;
  box-shadow: 0 18px 36px rgba(37, 99, 235, 0.26);
}

.btn-outline-secondary {
  color: var(--brand-accent-strong);
  border-color: rgba(37, 99, 235, 0.5);
}

.btn-outline-secondary:hover,
.btn-outline-secondary:focus {
  background: var(--brand-accent-soft);
  color: var(--brand-accent-strong);
  border-color: var(--brand-accent-strong);
}

.btn-outline-primary {
  color: var(--brand-accent-strong);
  border-color: rgba(37, 99, 235, 0.65);
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
  background: var(--brand-accent);
  color: #ffffff;
  border-color: var(--brand-accent-strong);
}

.btn-accent-soft {
  background: var(--brand-accent-soft);
  color: var(--brand-accent-strong);
  border-color: transparent;
}

.btn-accent-soft:hover,
.btn-accent-soft:focus {
  background: rgba(37, 99, 235, 0.22);
  color: #1d4ed8;
}

.navbar .btn {
  font-weight: 500;
}

.admin-surface {
  background: linear-gradient(180deg, rgba(219, 234, 254, 0.8) 0%, #ffffff 420px);
}

.admin-surface main {
  background: rgba(255, 255, 255, 0.94);
  border-radius: 32px;
  padding: clamp(1.5rem, 3vw, 2.5rem);
  box-shadow: 0 30px 70px rgba(15, 23, 42, 0.08);
  margin-top: 2rem;
}


.admin-panel-card {
  border-radius: 28px;
  border: 1px solid rgba(37, 99, 235, 0.15);
  background: linear-gradient(180deg, #ffffff, rgba(219, 234, 254, 0.85));
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.08);
}

.admin-table-card table {
  border-radius: 24px;
  overflow: hidden;
}

.admin-table-card thead {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.12), rgba(59, 130, 246, 0.2));
  border-bottom: none;
}

.admin-table-card tbody tr {
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
}

.admin-context-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  background: rgba(37, 99, 235, 0.18);
  color: var(--brand-accent-strong);
  border-radius: 999px;
  padding: 0.4rem 0.9rem;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  font-weight: 600;
  text-transform: uppercase;
}

.delete-account-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border-radius: 999px;
  border: 1px solid rgba(220, 38, 38, 0.3);
  background: rgba(248, 113, 113, 0.08);
  color: #b91c1c;
  font-weight: 600;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.delete-account-btn:hover,
.delete-account-btn:focus {
  background: rgba(248, 113, 113, 0.18);
  border-color: rgba(220, 38, 38, 0.45);
  color: #991b1b;
  box-shadow: 0 12px 24px rgba(248, 113, 113, 0.22);
  transform: translateY(-1px);
}

.delete-account-btn svg {
  width: 14px;
  height: 14px;
}

.quick-hits-box {
  background-color: var(--section-bg);
  padding: 20px;
  margin: 0;
  border-radius: 8px;
  border: 1px solid var(--card-border);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.quick-hits-title {
  margin: 0 0 12px;
  font-size: 18px;
  font-weight: 600;
  color: var(--primary-fg);
}

.quick-hits-list {
  margin: 0;
  padding-left: 20px;
}

.quick-hits-list li {
  margin-bottom: 8px;
}

.quick-hits-list a {
  color: var(--accent);
  text-decoration: none;
  font-size: 15px;
}

.quick-hits-list a:hover {
  text-decoration: underline;
}

.digest-preview {
  margin-top: 20px;
  margin-bottom: 20px;
}

.subscription-hero {
  position: relative;
  border-radius: 28px;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.12) 0%, rgba(79, 70, 229, 0.08) 55%, rgba(56, 189, 248, 0.08) 100%);
  border: 1px solid rgba(79, 70, 229, 0.12);
  overflow: hidden;
}

.subscription-hero::before,
.subscription-hero::after {
  content: "";
  position: absolute;
  inset: auto;
  width: 320px;
  height: 320px;
  border-radius: 999px;
  background: radial-gradient(circle at center, rgba(59, 130, 246, 0.18), rgba(59, 130, 246, 0));
  filter: blur(80px);
  pointer-events: none;
  z-index: 0;
}

.subscription-hero::before {
  right: -90px;
  top: -60px;
}

.subscription-hero::after {
  left: -120px;
  bottom: -100px;
  background: radial-gradient(circle at center, rgba(45, 212, 191, 0.16), rgba(45, 212, 191, 0));
}

.subscription-hero .card-body {
  position: relative;
  z-index: 1;
  background: transparent;
}

.hero-header h1 {
  color: #0f172a;
}

.hero-eyebrow {
  letter-spacing: 0.14em;
  color: rgba(15, 23, 42, 0.6);
}

.hero-action {
  padding-inline: 1.75rem;
  background: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 999px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.16);
  transition: transform 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
}

.hero-action:hover,
.hero-action:focus {
  transform: translateY(-2px);
  box-shadow: 0 22px 45px rgba(15, 23, 42, 0.22);
  color: #1d4ed8;
}

.hero-action__support {
  max-width: 17rem;
}

.hero-highlights {
  margin-top: 1.75rem;
}

.hero-highlight {
  height: 100%;
  border-radius: 18px;
  padding: 1.25rem 1.5rem;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(148, 163, 184, 0.25);
  backdrop-filter: blur(12px);
  box-shadow: 0 16px 35px rgba(15, 23, 42, 0.08);
}

.hero-highlight__title {
  font-weight: 600;
  color: #1d4ed8;
  margin-bottom: 0.5rem;
}

.hero-highlight__text {
  color: #475569;
  font-size: 0.95rem;
  line-height: 1.5;
}

.badge-soft-success {
  background-color: rgba(34, 197, 94, 0.16);
  color: #166534;
}

.badge-soft-warning {
  background-color: rgba(250, 204, 21, 0.18);
  color: #92400e;
}

.preference-card {
  position: relative;
  border-radius: 28px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  overflow: hidden;
}

.preference-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.02), rgba(15, 23, 42, 0));
  pointer-events: none;
}

.preference-card__header h2 {
  color: #0f172a;
}

.preference-eyebrow {
  letter-spacing: 0.16em;
  color: rgba(30, 41, 59, 0.7);
}

.preference-card__header span {
  max-width: 16rem;
}

.preference-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.25rem 1.5rem;
  border: 1px solid var(--card-border);
  border-radius: 16px;
  background-color: #ffffff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.preference-option:hover {
  border-color: #94a3b8;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
  transform: translateY(-2px);
}

.preference-option__content {
  flex: 1 1 auto;
}

.preference-option__content .fw-semibold {
  color: #0f172a;
}

.preference-option__content .text-muted {
  color: #64748b !important;
}

.preference-option__controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.preference-option__controls .form-check-input {
  width: 2.5rem;
  height: 1.3rem;
}

.preference-status {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background-color: rgba(148, 163, 184, 0.18);
  color: #475569;
}

.preference-status.is-active {
  background-color: rgba(34, 197, 94, 0.16);
  color: #166534;
}

.preference-option:focus-within {
  border-color: #60a5fa;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.18);
}

@media (max-width: 576px) {
  .d-flex.align-items-center {
    flex-direction: column !important;
    align-items: stretch !important;
  }
  .d-flex.align-items-center .form-select {
    width: 100%;
    margin-bottom: 0.5rem;
  }
  .btn {
    width: 100%;
  }
  .preference-option {
    flex-direction: column;
    align-items: flex-start;
    padding: 1rem 1.25rem;
  }
  .preference-option__controls {
    width: 100%;
    justify-content: space-between;
  }
  .hero-action__support {
    max-width: 100%;
  }
}


.admin-settings-card,
.admin-stats-card {
  border-radius: 1.5rem;
  background: #ffffff;
}

.admin-settings-card .card-body,
.admin-stats-card .card-body {
  position: relative;
}

.settings-section-title {
  font-size: 0.875rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #64748b;
  font-weight: 600;
}

.setting-toggle {
  border-radius: 1rem;
  background: #f8fafc;
}

.shadow-sm-sm {
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.setting-toggle .form-check-input {
  width: 3rem;
  height: 1.5rem;
}

.setting-toggle .form-check-input:focus {
  box-shadow: 0 0 0 0.25rem rgba(59, 130, 246, 0.15);
}

.setting-toggle .form-check-input:checked {
  background-color: #2563eb;
  border-color: #2563eb;
}

.admin-stats-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.admin-stats-list .stat-item {
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.admin-stats-list .stat-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.stat-label {
  display: block;
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #94a3b8;
  font-weight: 600;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 600;
  color: #0f172a;
}

.stat-value a {
  color: inherit;
  text-decoration: none;
}

.stat-value a:hover,
.stat-value a:focus {
  color: #1d4ed8;
}

#digestErrorsCollapse .list-group-item {
  background: transparent;
  border: none;
  padding-left: 0;
  padding-right: 0;
}

#digestErrorsCollapse .list-group-item + .list-group-item {
  border-top: 1px solid rgba(15, 23, 42, 0.08);
  padding-top: 0.75rem;
  margin-top: 0.75rem;
}

.log-panel {
  border-radius: 1rem;
  background: #0f172a;
  color: #f8fafc;
  padding: 1.5rem;
  box-shadow: 0 16px 30px rgba(15, 23, 42, 0.2);
}

.log-panel .badge {
  font-size: 0.75rem;
}

.log-summary-card {
  background: rgba(248, 250, 252, 0.05);
  border: 1px solid rgba(248, 250, 252, 0.08);
  border-radius: 0.85rem;
  padding: 1rem;
  color: #e2e8f0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.log-summary-card .badge {
  font-weight: 600;
}

.log-accordion .accordion-item {
  background: transparent;
  border: 1px solid rgba(248, 250, 252, 0.08);
  border-radius: 0.65rem;
  overflow: hidden;
  color: #e2e8f0;
}

.log-accordion .accordion-item + .accordion-item {
  margin-top: 0.75rem;
}

.log-accordion .accordion-button {
  background: rgba(248, 250, 252, 0.04);
  color: #e2e8f0;
  box-shadow: none;
}

.log-accordion .accordion-button:not(.collapsed) {
  background: rgba(59, 130, 246, 0.15);
  color: #fff;
}

.log-accordion .accordion-button::after {
  filter: invert(1);
}

.log-accordion .accordion-body {
  background: rgba(15, 23, 42, 0.75);
}

.log-output {
  font-family: 'Source Code Pro', 'SFMono-Regular', Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  background: rgba(15, 23, 42, 0.55);
  border-radius: 0.75rem;
  padding: 1rem;
  max-height: 200px;
  overflow-y: auto;
  white-space: pre-wrap;
}

.x-small {
  font-size: 0.75rem;
}

@media (max-width: 767.98px) {
  .admin-settings-card .card-body,
  .admin-stats-card .card-body {
    padding: 1.75rem;
  }

  .stat-value {
    font-size: 1.25rem;
  }
}

.ticker-selector .ticker-input {
  background-color: var(--bs-body-bg);
}

.ticker-selector .ticker-search-input {
  min-width: 160px;
  outline: none;
}

.ticker-selector .ticker-search-input:focus {
  box-shadow: none;
}

.ticker-chip {
  font-size: 0.875rem;
}

.ticker-chip .ticker-chip-name {
  font-size: 0.75rem;
}

.day-toggle-btn {
  min-width: 54px;
  border-width: 1.5px;
}

.day-toggle-btn.btn-primary {
  color: #fff;
}
