/**
 * StockTracker – Shadcn-inspired design system
 * Same layout structure, professional zinc/slate look.
 */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

* {
  box-sizing: border-box;
}

:root,
[data-theme="dark"] {
  /* Dark theme (default) – deep grey/near-black base */
  --background: 240 10% 4%;
  --foreground: 0 0% 98%;
  --card: 240 6% 9%;
  --card-foreground: 0 0% 98%;
  --primary: 240 5% 12%;
  --primary-foreground: 0 0% 98%;
  --secondary: 240 4% 16%;
  --secondary-foreground: 0 0% 98%;
  --muted: 240 4% 14%;
  --muted-foreground: 240 5% 55%;
  --accent: 240 4% 18%;
  --accent-foreground: 0 0% 98%;
  --destructive: 0 84.2% 60.2%;
  --destructive-foreground: 0 0% 98%;
  --border: 240 4% 18%;
  --input: 240 4% 18%;
  --ring: 240 5% 60%;
  --link: 217 91% 65%;
  --radius: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  /* Semantic */
  --positive: 142.1 76.2% 36.3%;
  --positive-muted: 142.1 70.6% 45.3%;
  --negative: 0 84.2% 60.2%;
  --negative-muted: 0 72% 51%;
  --sidebar-bg: 240 6% 8%;
  --sidebar-foreground: 0 0% 98%;
  --sidebar-accent: 240 4% 18%;
  --sidebar-accent-foreground: 0 0% 98%;
}

/* Light theme – white/light grey base */
[data-theme="light"] {
  --background: 0 0% 100%;
  --foreground: 240 10% 4%;
  --card: 0 0% 100%;
  --card-foreground: 240 10% 4%;
  --primary: 240 6% 10%;
  --primary-foreground: 0 0% 98%;
  --secondary: 240 5% 96%;
  --secondary-foreground: 240 6% 10%;
  --muted: 240 5% 96%;
  --muted-foreground: 240 4% 46%;
  --accent: 240 5% 96%;
  --accent-foreground: 240 6% 10%;
  --destructive: 0 84.2% 60.2%;
  --destructive-foreground: 0 0% 98%;
  --border: 240 6% 90%;
  --input: 240 6% 90%;
  --ring: 240 5% 45%;
  --link: 217 91% 45%;
  --sidebar-bg: 240 5% 98%;
  --sidebar-foreground: 240 6% 10%;
  --sidebar-accent: 240 5% 92%;
  --sidebar-accent-foreground: 240 6% 10%;
}

/* Light theme: override hardcoded dark colors */
[data-theme="light"] .sidebar-auth .nav-link,
[data-theme="light"] .account-trigger,
[data-theme="light"] .account-trigger-link {
  background: hsl(240 5% 94%);
  border-color: hsl(240 5% 88%);
  color: hsl(var(--sidebar-foreground));
}
[data-theme="light"] .sidebar-auth .nav-link:hover,
[data-theme="light"] .account-trigger:hover {
  background: hsl(240 5% 90%);
  border-color: hsl(240 5% 82%);
}
[data-theme="light"] .nav-link:hover {
  background: hsl(240 5% 94%);
}
[data-theme="light"] .nav-link.active {
  background: hsl(var(--sidebar-accent));
  color: hsl(var(--sidebar-accent-foreground));
}
[data-theme="light"] .account-avatar,
[data-theme="light"] .account-initial {
  background: hsl(var(--sidebar-accent));
  color: hsl(var(--sidebar-accent-foreground));
}
[data-theme="light"] .account-dropdown {
  background: hsl(var(--sidebar-bg));
  border-color: hsl(var(--border));
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}
[data-theme="light"] .account-dropdown a:hover {
  background: hsl(240 5% 94%);
}
[data-theme="light"] .briefing-switch {
  background: hsl(240 5% 75%);
}
[data-theme="light"] .container {
  box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.08);
}
[data-theme="light"] .mobile-nav {
  background: hsl(var(--sidebar-bg));
  box-shadow: 0 -1px 3px 0 rgb(0 0 0 / 0.08);
}
[data-theme="light"] .mobile-nav-link:hover,
[data-theme="light"] .mobile-nav-link.active {
  background: hsl(240 5% 94%);
}
[data-theme="light"] .account-portal-card-link:hover {
  background: hsl(240 5% 96%);
  border-color: hsl(240 5% 88%);
}
[data-theme="light"] .account-portal-card-active {
  background: hsl(240 5% 96%);
  border-color: hsl(var(--ring));
}

/* Light theme: frontpage (overview) */
[data-theme="light"] .stats-bar {
  background: hsl(var(--secondary));
  color: hsl(var(--foreground));
}
[data-theme="light"] .market-tab {
  color: hsl(var(--foreground));
  background: hsl(var(--secondary));
  border-color: hsl(var(--border));
}
[data-theme="light"] .market-tab:hover {
  background: hsl(240 5% 92%);
  color: hsl(var(--foreground));
  border-color: hsl(var(--border));
}
[data-theme="light"] .market-tab.active {
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  border-color: hsl(var(--primary));
}
[data-theme="light"] .overview-card.sentiment-section,
[data-theme="light"] .overview-card.stocks-section {
  background: hsl(var(--secondary));
  color: hsl(var(--foreground));
  border: 1px solid hsl(var(--border));
}
[data-theme="light"] .overview-card .view-all-link {
  color: hsl(var(--link));
}
[data-theme="light"] .overview-card .view-all-link:hover {
  color: hsl(217 91% 35%);
}
[data-theme="light"] .overview-card .empty-state.dark {
  color: hsl(var(--muted-foreground));
}
[data-theme="light"] .take-my-money-section .section-header.card {
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}
[data-theme="light"] .tmm-card {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  color: hsl(var(--foreground));
}
[data-theme="light"] .subsidies-section .section-header,
[data-theme="light"] .stock-news-section .section-header {
  color: inherit;
}
[data-theme="light"] .subsidy-item,
[data-theme="light"] .stock-news-item {
  color: hsl(var(--foreground));
}
[data-theme="light"] .subsidy-item-title,
[data-theme="light"] .stock-news-title {
  color: hsl(var(--link));
}
[data-theme="light"] .subsidy-sectors-bar,
[data-theme="light"] .subsidy-sector-chip {
  color: hsl(var(--foreground));
}
[data-theme="light"] .empty-state,
[data-theme="light"] .empty-state.dark {
  color: hsl(var(--muted-foreground));
}
[data-theme="light"] .subsidies-section {
  background: hsl(var(--secondary));
  color: hsl(var(--foreground));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-lg);
}
[data-theme="light"] .subsidies-section .view-all-link {
  color: hsl(var(--link));
}
[data-theme="light"] .subsidy-item {
  background: hsl(0 0% 100% / 0.8);
  border: 1px solid hsl(var(--border));
}
[data-theme="light"] .subsidy-item:hover {
  background: hsl(240 5% 98%);
}
[data-theme="light"] .subsidy-source {
  background: hsl(var(--muted));
  color: hsl(var(--muted-foreground));
}
[data-theme="light"] .subsidy-sector-chip {
  background: hsl(var(--muted));
  color: hsl(var(--foreground));
  border-color: hsl(var(--border));
}
[data-theme="light"] .subsidy-sector-chip:hover {
  background: hsl(240 5% 92%);
}
[data-theme="light"] .stock-news-section {
  background: hsl(var(--secondary));
  color: hsl(var(--foreground));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-lg);
}
[data-theme="light"] .stock-news-item {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  margin: 0;
  padding: 0;
  background: hsl(var(--background));
  min-height: 100vh;
  color: hsl(var(--foreground));
}

/* Layout – unchanged structure */
.main-container {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 220px;
  min-width: 220px;
  flex-shrink: 0;
  height: 100vh;
  max-height: 100vh;
  position: sticky;
  top: 0;
  background: hsl(var(--sidebar-bg));
  padding: 20px 15px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar-auth {
  margin-top: auto;
  padding-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar-auth .nav-link {
  background: hsl(240 4% 16%);
  border: 1px solid hsl(240 4% 24%);
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.sidebar-auth .nav-link:hover {
  background: hsl(240 4% 22%);
  border-color: hsl(240 5% 32%);
}

/* Account dropdown (when logged in) */
.account-wrap {
  position: relative;
}
.account-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  cursor: pointer;
  border: none;
  font: inherit;
  font-weight: 500;
  padding: 10px 14px;
  color: hsl(var(--sidebar-foreground));
  background: hsl(240 4% 16%);
  border: 1px solid hsl(240 4% 24%);
  border-radius: var(--radius);
  transition: background 0.2s, border-color 0.2s;
}
.account-trigger:hover {
  background: hsl(240 4% 22%);
  border-color: hsl(240 5% 32%);
}
.account-trigger-link {
  text-decoration: none;
  box-sizing: border-box;
}
.account-trigger-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.account-avatar,
.account-initial {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  font-weight: 600;
  background: hsl(var(--sidebar-accent));
  color: hsl(var(--sidebar-accent-foreground));
}
.account-avatar {
  display: block;
  padding: 0;
  background: transparent;
}
.account-initial {
  font-family: inherit;
}
.account-username {
  font-size: 0.875rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.account-dropdown {
  position: absolute;
  bottom: 100%;
  left: 0;
  margin-bottom: 6px;
  min-width: 100%;
  background: hsl(var(--sidebar-bg));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  padding: 6px 0;
  z-index: 50;
}
.account-dropdown a {
  display: block;
  padding: 10px 14px;
  color: hsl(var(--sidebar-foreground));
  text-decoration: none;
  font-size: 0.875rem;
  white-space: nowrap;
  transition: background 0.2s;
}
.account-dropdown a:hover {
  background: hsl(240 4% 20%);
}

.sidebar-title {
  color: hsl(var(--sidebar-foreground));
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 20px;
  text-align: center;
  letter-spacing: -0.02em;
}

.nav-link {
  display: block;
  padding: 10px 14px;
  color: hsl(var(--sidebar-foreground));
  text-decoration: none;
  border-radius: var(--radius);
  transition: background 0.2s, color 0.2s;
  font-weight: 500;
  font-size: 0.875rem;
  white-space: nowrap;
}

.nav-link:hover {
  background: hsl(240 4% 20%);
}

.nav-link.active {
  background: hsl(var(--sidebar-accent));
  color: hsl(var(--sidebar-accent-foreground));
  font-weight: 600;
}

.content-area {
  flex: 1;
  padding: 16px;
  min-width: 0;
  overflow-x: auto;
  background: hsl(var(--background));
}

.container {
  background: hsl(var(--card));
  border-radius: var(--radius-lg);
  border: 1px solid hsl(var(--border));
  box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.2);
  padding: 24px;
  min-height: calc(100vh - 32px);
  max-width: 100%;
  box-sizing: border-box;
}

/* Typography */
.page-header {
  margin-bottom: 24px;
}

.page-header h1 {
  color: hsl(var(--foreground));
  margin: 0 0 4px 0;
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.025em;
}

.generated-at,
.subtitle {
  color: hsl(var(--muted-foreground));
  font-size: 0.875rem;
  margin-top: 4px;
}

/* Cards & sections */
.card {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.15);
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 10px;
}

.section-title {
  color: hsl(var(--foreground));
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.view-all-link {
  color: hsl(var(--link));
  text-decoration: none;
  font-weight: 500;
  font-size: 0.875rem;
}

.view-all-link:hover {
  text-decoration: underline;
}

/* Buttons – Shadcn style */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: var(--radius);
  transition: background 0.2s, color 0.2s;
  cursor: pointer;
  border: none;
  font-family: inherit;
}

.btn-primary {
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}

.btn-primary:hover {
  background: hsl(240 5% 18%);
}

.btn-secondary {
  background: hsl(var(--secondary));
  color: hsl(var(--secondary-foreground));
  border: 1px solid hsl(var(--border));
}

.btn-secondary:hover {
  background: hsl(240 4% 22%);
}

/* Auth (login / register) */
.auth-box {
  max-width: 400px;
  margin: 0 auto;
  padding: 32px;
  background: hsl(var(--muted));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-lg);
}
.auth-title {
  margin: 0 0 4px 0;
  font-size: 1.5rem;
  font-weight: 700;
  color: hsl(var(--foreground));
}
.auth-subtitle {
  margin: 0 0 24px 0;
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
}
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.auth-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.auth-field label {
  font-size: 0.875rem;
  font-weight: 500;
  color: hsl(var(--foreground));
}
.auth-input {
  width: 100%;
  padding: 10px 14px;
  font-size: 0.9375rem;
  color: hsl(var(--foreground));
  background: hsl(var(--background));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  box-sizing: border-box;
}
.auth-input:focus {
  outline: none;
  border-color: hsl(var(--ring));
  box-shadow: 0 0 0 2px hsl(var(--ring) / 0.2);
}
.auth-input::placeholder {
  color: hsl(var(--muted-foreground));
}
.auth-field-error {
  font-size: 0.8125rem;
  color: hsl(var(--destructive));
}
.auth-help {
  font-size: 0.8125rem;
  color: hsl(var(--muted-foreground));
}
.auth-errors {
  list-style: none;
  margin: 0 0 16px 0;
  padding: 12px;
  background: hsl(var(--destructive) / 0.1);
  border: 1px solid hsl(var(--destructive) / 0.3);
  border-radius: var(--radius);
  font-size: 0.875rem;
  color: hsl(var(--destructive));
}

/* Account portal */
.account-portal {
  max-width: 920px;
}
.account-portal-layout {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  flex-wrap: wrap;
}
.account-portal-sidebar {
  flex-shrink: 0;
  width: 240px;
  padding: 20px;
  background: hsl(var(--muted));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-lg);
}
.account-portal-sidebar-title {
  margin: 0 0 12px 0;
  font-size: 0.875rem;
  font-weight: 600;
  color: hsl(var(--muted-foreground));
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.account-portal-main {
  flex: 1;
  min-width: 0;
}
@media (max-width: 640px) {
  .account-portal-layout {
    flex-direction: column;
  }
  .account-portal-sidebar {
    width: 100%;
    box-sizing: border-box;
  }
}
.account-portal .auth-title { margin-bottom: 4px; }
.account-portal .auth-subtitle { margin-bottom: 24px; }

/* Two-column layout: portal options (left) and settings form (right), same left alignment */
.account-portal-body {
  display: grid;
  grid-template-columns: 240px 1fr;
  column-gap: 32px;
  row-gap: 32px;
  align-items: start;
}
@media (max-width: 720px) {
  .account-portal-body {
    grid-template-columns: 1fr;
  }
}

.account-portal-options {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.account-portal-body .account-portal-options {
  margin-bottom: 0;
}
.account-portal-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 20px;
  background: hsl(var(--muted));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-lg);
  transition: background 0.2s, border-color 0.2s;
}
.account-portal-card-link {
  text-decoration: none;
  color: inherit;
}
.account-portal-card-link:hover {
  background: hsl(240 4% 18%);
  border-color: hsl(240 5% 28%);
}
.account-portal-card-active {
  border-color: hsl(var(--ring));
  background: hsl(240 4% 14%);
}
.account-portal-icon {
  font-size: 1.5rem;
  line-height: 1;
}
.account-portal-card-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: hsl(var(--foreground));
}
.account-portal-card-desc {
  margin: 0;
  font-size: 0.8125rem;
  color: hsl(var(--muted-foreground));
}
.account-portal-form {
  margin-top: 0;
  min-width: 0;
  max-width: 100%;
}
.account-portal-logout {
  margin-top: 32px;
  margin-bottom: 0;
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
}
.account-portal-logout a {
  color: hsl(var(--link));
  text-decoration: none;
}
.account-portal-logout a:hover {
  text-decoration: underline;
}

/* Apple-style switch (briefing email and account) */
.briefing-switch-wrap {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}
.briefing-switch-wrap input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.briefing-switch {
  position: relative;
  width: 51px;
  height: 31px;
  flex-shrink: 0;
  background: hsl(240 4% 28%);
  border-radius: 31px;
  transition: background 0.25s ease;
}
.briefing-switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
  transition: transform 0.25s ease;
}
.briefing-switch-wrap input:checked + .briefing-switch {
  background: #34c759;
}
.briefing-switch-wrap input:checked + .briefing-switch::after {
  transform: translateX(20px);
}
.briefing-switch-wrap input:focus-visible + .briefing-switch {
  outline: 2px solid hsl(var(--ring));
  outline-offset: 2px;
}

/* Theme slider labels (Donker | switch | Licht) */
.theme-label {
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
  user-select: none;
}
.theme-label-left { margin-right: 8px; }
.theme-label-right { margin-left: 8px; }

/* Preferences page: Voorkeuren box */
.preferences-box {
  max-width: 560px;
  padding: 24px;
  background: hsl(var(--muted));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-lg);
}
.preferences-box-title {
  margin: 0 0 20px 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: hsl(var(--foreground));
}
.preferences-options-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.preferences-option {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: center;
  padding: 16px 0;
  border-bottom: 1px solid hsl(var(--border));
}
.preferences-option:last-child {
  border-bottom: none;
  padding-bottom: 0;
}
.preferences-option:first-child {
  padding-top: 0;
}
@media (max-width: 520px) {
  .preferences-option {
    grid-template-columns: 1fr;
    align-items: start;
    gap: 12px;
  }
}
.preferences-option-text {
  min-width: 0;
}
.preferences-option-label {
  display: block;
  font-size: 1rem;
  font-weight: 500;
  color: hsl(var(--foreground));
}
.preferences-option-control {
  flex-shrink: 0;
}
.preferences-option-form {
  display: inline-block;
}
.preferences-option-desc {
  margin: 6px 0 0 0;
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
  line-height: 1.4;
}

.messages-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.messages-list .msg {
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 0.875rem;
  margin-bottom: 8px;
}
.messages-list .msg-success {
  background: hsl(142 76% 36% / 0.15);
  border: 1px solid hsl(142 76% 36% / 0.4);
  color: hsl(142 76% 50%);
}
.messages-list .msg-error {
  background: hsl(var(--destructive) / 0.1);
  border: 1px solid hsl(var(--destructive) / 0.3);
  color: hsl(var(--destructive));
}
.messages-list .msg-info {
  background: hsl(var(--muted));
  border: 1px solid hsl(var(--border));
  color: hsl(var(--foreground));
}
.auth-btn {
  width: 100%;
  margin-top: 8px;
  padding: 10px 16px;
}
.auth-footer {
  margin: 24px 0 0 0;
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
  text-align: center;
}
.auth-footer a {
  color: hsl(var(--link));
  text-decoration: none;
}
.auth-footer a:hover {
  text-decoration: underline;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: 9999px;
  background: hsl(var(--secondary));
  color: hsl(var(--secondary-foreground));
}

.badge-positive {
  background: hsl(var(--positive) / 0.15);
  color: hsl(var(--positive));
}

.badge-negative {
  background: hsl(var(--negative) / 0.15);
  color: hsl(var(--negative));
}

/* Stats bar */
.stats-bar {
  display: flex;
  gap: 20px;
  margin-bottom: 24px;
  padding: 20px 24px;
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  border-radius: var(--radius-lg);
  flex-wrap: wrap;
}

.stat-item {
  text-align: center;
  min-width: 90px;
}

.stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.stat-label {
  font-size: 0.8125rem;
  opacity: 0.9;
}

.stats-bar.success {
  background: hsl(var(--positive));
  color: hsl(0 0% 98%);
}

.breadcrumb {
  margin-bottom: 16px;
  font-size: 0.875rem;
}

.breadcrumb a {
  color: hsl(var(--link));
  text-decoration: none;
}

.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb span { color: hsl(var(--muted-foreground)); }

/* Market selector (overview) */
.market-selector-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.market-label {
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
  font-weight: 500;
}

.market-tab {
  padding: 6px 14px;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  color: hsl(var(--muted-foreground));
  background: hsl(var(--muted));
  border: 1px solid hsl(var(--border));
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.market-tab:hover {
  background: hsl(240 4% 22%);
  color: hsl(var(--accent-foreground));
  border-color: hsl(var(--border));
}

.market-tab.active {
  background: hsl(240 4% 22%);
  color: hsl(var(--primary-foreground));
  border-color: hsl(240 5% 30%);
}

/* Content grid */
.content-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 24px;
}

/* Mobile nav */
.mobile-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: hsl(var(--sidebar-bg));
  padding: 8px 0;
  padding-bottom: calc(8px + env(safe-area-inset-bottom));
  box-shadow: 0 -1px 3px 0 rgb(0 0 0 / 0.1);
  z-index: 1000;
}

.mobile-nav-links {
  display: flex;
  justify-content: space-around;
  align-items: center;
  max-width: 500px;
  margin: 0 auto;
}

.mobile-nav-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 6px 12px;
  color: hsl(var(--sidebar-foreground));
  opacity: 0.8;
  text-decoration: none;
  font-size: 0.7rem;
  font-weight: 500;
  border-radius: var(--radius);
  transition: opacity 0.2s, background 0.2s;
}

.mobile-nav-link:hover,
.mobile-nav-link.active {
  opacity: 1;
  background: hsl(240 4% 20%);
}

.mobile-nav-link .nav-icon {
  font-size: 1.25rem;
  margin-bottom: 2px;
}

/* Utility */
.empty-state {
  text-align: center;
  padding: 24px 16px;
  color: hsl(var(--muted-foreground));
  font-size: 0.875rem;
}

.empty-state.dark {
  color: hsl(0 0% 98% / 0.8);
}

/* ========== Overview / shared sections ========== */
/* Equal-size cards for sentiment and koersen (overview) - dark style for both */
.overview-two-cols {
  align-items: stretch;
}
.overview-card {
  min-height: 400px;
  display: flex;
  flex-direction: column;
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  border: 1px solid hsl(var(--primary));
  border-radius: var(--radius-lg);
  padding: 18px;
}
.overview-card .section-header { margin-bottom: 12px; flex-shrink: 0; }
.overview-card .section-title { font-size: 1.0625rem; color: inherit; }
.overview-card .view-all-link { color: hsl(var(--primary-foreground) / 0.9); }
.overview-card .view-all-link:hover { color: hsl(var(--primary-foreground)); }
.overview-card .stock-link { color: inherit; }
.overview-card .stock-symbol,
.overview-card .stock-name { color: inherit; }
.overview-card .stock-change.positive { color: hsl(var(--positive)); }
.overview-card .stock-change.negative { color: hsl(var(--negative)); }
.overview-card .movers-column h4 { color: inherit; }
.overview-card .empty-state.dark { color: hsl(var(--primary-foreground) / 0.8); }

.sentiment-section,
.news-section {
  background: hsl(var(--muted));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-lg);
  padding: 18px;
  display: flex;
  flex-direction: column;
}

/* Frontpage sentiment box: same dark style as koersen card */
.overview-card.sentiment-section {
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  border-color: hsl(var(--primary));
}

.sentiment-section { min-height: 400px; }

.news-section {
  height: 400px;
}

.news-section .section-header { margin-bottom: 12px; flex-shrink: 0; }
.news-section .section-title { font-size: 1.0625rem; }
.news-list-container { flex: 1; overflow: hidden; }
.news-list { height: 100%; overflow-y: auto; }

.sector-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.sector-tab {
  padding: 6px 12px;
  font-size: 0.8125rem;
  font-weight: 500;
  border-radius: 9999px;
  border: 1px solid hsl(var(--border));
  background: hsl(var(--card));
  color: hsl(var(--foreground));
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.sector-tab:hover {
  background: hsl(var(--accent));
}

.sector-tab.active {
  background: hsl(var(--primary));
  border-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}

.sector-tab .count {
  background: hsl(var(--muted));
  padding: 1px 6px;
  border-radius: 9999px;
  font-size: 0.75rem;
  margin-left: 4px;
}

.sector-tab.active .count {
  background: hsl(var(--primary-foreground) / 0.2);
}

.news-list-container.active { display: block; }
.news-list-container:not(.active) { display: none; }

.news-item {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  padding: 10px 12px;
  margin-bottom: 8px;
  border-left: 3px solid hsl(var(--primary));
  transition: box-shadow 0.2s;
}

.news-item:hover {
  box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.06);
}

.news-item:last-child { margin-bottom: 0; }
.news-item.healthcare { border-left-color: hsl(var(--positive)); }
.news-item.defence { border-left-color: hsl(var(--negative)); }
.news-item.politics { border-left-color: 263 70% 50%; }
.news-item.business { border-left-color: 38 92% 50%; }

.news-item-title {
  color: hsl(var(--foreground));
  text-decoration: none;
  font-weight: 600;
  font-size: 0.875rem;
  line-height: 1.35;
  display: block;
  margin-bottom: 4px;
}

.news-item-title:hover { color: hsl(var(--link)); }

.news-item-meta {
  display: flex;
  gap: 8px;
  font-size: 0.75rem;
  color: hsl(var(--muted-foreground));
  flex-wrap: wrap;
}

.news-item-meta .sector-badge {
  padding: 2px 8px;
  border-radius: 9999px;
  font-size: 0.7rem;
  font-weight: 500;
}

.news-item-meta .sector-badge.healthcare { background: hsl(var(--positive) / 0.15); color: hsl(var(--positive)); }
.news-item-meta .sector-badge.defence { background: hsl(var(--negative) / 0.15); color: hsl(var(--negative)); }
.news-item-meta .sector-badge.politics { background: hsl(263 70% 50% / 0.15); color: hsl(263 70% 40%); }
.news-item-meta .sector-badge.business { background: hsl(38 92% 50% / 0.15); color: hsl(38 92% 40%); }

.stocks-section {
  border-radius: var(--radius-lg);
  padding: 18px;
  min-height: 400px;
  display: flex;
  flex-direction: column;
}

.stocks-section:not(.overview-card) {
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}

.stocks-section .section-header { margin-bottom: 12px; flex-shrink: 0; }
.stocks-section .section-title { font-size: 1.0625rem; }
.stocks-section:not(.overview-card) .section-title { color: inherit; }
.movers-grid {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  overflow: hidden;
}

.movers-column h4 {
  margin: 0 0 12px 0;
  font-size: 1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

.movers-column.gainers h4 { color: hsl(var(--positive-muted)); }
.movers-column.losers h4 { color: hsl(0 84% 65%); }

.stock-item {
  background: hsl(0 0% 100% / 0.08);
  border-radius: var(--radius);
  padding: 10px 12px;
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background 0.2s;
}

.stock-item:hover { background: hsl(0 0% 100% / 0.12); }
.stock-item:last-child { margin-bottom: 0; }

.stock-info { display: flex; flex-direction: column; gap: 2px; }
.stock-symbol { font-weight: 600; color: inherit; font-size: 0.9375rem; }
.stock-name { font-size: 0.8125rem; opacity: 0.75; }

.stock-change {
  font-weight: 600;
  font-size: 0.875rem;
  padding: 4px 10px;
  border-radius: var(--radius);
}

.stock-change.positive {
  background: hsl(var(--positive) / 0.25);
  color: hsl(var(--positive-muted));
}

.stock-change.negative {
  background: hsl(var(--negative) / 0.25);
  color: hsl(0 84% 65%);
}

.stock-link { text-decoration: none; color: inherit; display: block; }

/* Subsidies section */
.subsidies-section {
  background: hsl(var(--primary));
  border-radius: var(--radius-lg);
  padding: 24px;
  color: hsl(var(--primary-foreground));
  margin-bottom: 24px;
}

.subsidies-section .section-title { color: inherit; margin-bottom: 16px; }
.subsidies-section .view-all-link { color: hsl(0 0% 98% / 0.9); }

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

.subsidy-item {
  background: hsl(0 0% 100% / 0.08);
  border-radius: var(--radius);
  padding: 14px;
  transition: background 0.2s;
}

.subsidy-item:hover { background: hsl(0 0% 100% / 0.12); }

.subsidy-item-title {
  color: inherit;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.875rem;
  line-height: 1.4;
  display: block;
  margin-bottom: 6px;
}

.subsidy-item-title:hover { text-decoration: underline; }

.subsidy-item-meta {
  display: flex;
  gap: 10px;
  font-size: 0.75rem;
  opacity: 0.8;
  flex-wrap: wrap;
}

.subsidy-source {
  background: hsl(0 0% 100% / 0.2);
  padding: 2px 8px;
  border-radius: 9999px;
}

.subsidy-sectors-bar {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.subsidy-sector-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background: hsl(0 0% 100% / 0.15);
  color: inherit;
  text-decoration: none;
  border-radius: 9999px;
  font-size: 0.8125rem;
  font-weight: 500;
}

.subsidy-sector-chip:hover { background: hsl(0 0% 100% / 0.25); }
.subsidy-sector-chip .doc-count { opacity: 0.9; }

/* Stock news section */
.stock-news-section {
  background: hsl(var(--muted));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 24px;
}

.stock-news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 12px;
}

.stock-news-item {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  padding: 14px;
  border-left: 4px solid hsl(var(--primary));
  transition: box-shadow 0.2s;
}

.stock-news-item:hover {
  box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.06);
}

.stock-news-symbol {
  display: inline-block;
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  padding: 2px 8px;
  border-radius: var(--radius);
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.stock-news-title {
  color: hsl(var(--foreground));
  text-decoration: none;
  font-weight: 600;
  font-size: 0.875rem;
  display: block;
  margin-bottom: 4px;
}

.stock-news-title:hover { color: hsl(var(--primary)); }
.stock-news-meta { font-size: 0.75rem; color: hsl(var(--muted-foreground)); }

/* Take My Money / accent card */
.take-my-money-section { margin-bottom: 24px; }
.tmm-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.tmm-card {
  background: hsl(var(--primary));
  border-radius: var(--radius-lg);
  padding: 16px;
  color: hsl(var(--primary-foreground));
  border: 1px solid hsl(var(--border));
}

.tmm-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid hsl(0 0% 100% / 0.15);
  font-weight: 600;
  font-size: 0.9375rem;
}

.tmm-card-content {
  font-size: 0.875rem;
  line-height: 1.5;
  opacity: 0.95;
}

.tmm-card a {
  display: inline-block;
  margin-top: 10px;
  color: hsl(45 93% 47%);
  font-size: 0.8125rem;
  text-decoration: none;
}

.tmm-card a:hover { text-decoration: underline; }

/* ========== Movers page ========== */
.page-header-flex {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 15px;
}

.refresh-btn {
  padding: 10px 20px;
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 600;
  font-size: 0.875rem;
  transition: opacity 0.2s;
}

.refresh-btn:hover { opacity: 0.9; }

.view-mode-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.view-mode-tab {
  padding: 8px 16px;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  color: hsl(var(--muted-foreground));
  background: hsl(var(--muted));
  border: 1px solid hsl(var(--border));
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.view-mode-tab:hover {
  background: hsl(var(--accent));
  color: hsl(var(--accent-foreground));
}

.view-mode-tab.active {
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  border-color: hsl(var(--primary));
}

.sentiment-view-note {
  font-size: 0.8rem;
  color: hsl(var(--muted-foreground));
  margin-bottom: 12px;
  line-height: 1.4;
}

.cap-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  border-bottom: 1px solid hsl(var(--border));
  padding-bottom: 0;
}

.cap-tab {
  padding: 10px 20px;
  text-decoration: none;
  color: hsl(var(--muted-foreground));
  font-weight: 600;
  font-size: 0.875rem;
  border-radius: var(--radius) var(--radius) 0 0;
  border: 1px solid transparent;
  border-bottom: none;
  background: hsl(var(--muted));
  transition: background 0.2s, color 0.2s;
  position: relative;
  bottom: -1px;
}

.cap-tab:hover {
  background: hsl(var(--accent));
  color: hsl(var(--foreground));
}

.cap-tab.active {
  background: hsl(var(--card));
  color: hsl(var(--primary));
  border-color: hsl(var(--border));
  border-bottom-color: hsl(var(--card));
}

.cap-tab.active.large { color: hsl(217 91% 60%); }
.cap-tab.active.mid { color: hsl(263 70% 50%); }
.cap-tab.active.small { color: hsl(187 85% 43%); }

.cap-badge {
  background: hsl(var(--secondary));
  padding: 2px 8px;
  border-radius: 9999px;
  font-size: 0.75rem;
  margin-left: 6px;
}

.cap-tab.active .cap-badge { background: hsl(var(--muted)); }

.category-info {
  background: hsl(var(--muted));
  border: 1px solid hsl(var(--border));
  padding: 15px 20px;
  border-radius: var(--radius-lg);
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 15px;
}

.category-title { font-size: 1.25rem; font-weight: 700; color: hsl(var(--foreground)); }
.category-desc { font-size: 0.875rem; color: hsl(var(--muted-foreground)); margin-top: 4px; }
.category-stats { display: flex; gap: 20px; }
.cat-stat { text-align: center; }
.cat-stat-value { font-size: 1.375rem; font-weight: 700; }
.cat-stat-label { font-size: 0.75rem; color: hsl(var(--muted-foreground)); }
.cat-stat-value.positive { color: hsl(var(--positive)); }
.cat-stat-value.negative { color: hsl(var(--negative)); }

.columns-container {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 24px;
}

.column {
  background: hsl(var(--muted));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-lg);
  overflow: hidden;
  min-width: 0;
}

.column-header {
  padding: 14px 20px;
  color: hsl(0 0% 98%);
  font-size: 1.0625rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
}

.column-header.gainers {
  background: hsl(var(--positive));
}

.column-header.losers {
  background: hsl(var(--negative));
}

.column-header .count {
  background: hsl(0 0% 100% / 0.2);
  padding: 3px 10px;
  border-radius: 9999px;
  font-size: 0.75rem;
}

/* Movers tables: readable rows, aligned with header, responsive */
.table-wrap {
  overflow-x: auto;
  min-width: 0;
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
}

.column .movers-table {
  width: 100%;
  border-collapse: collapse;
  background: hsl(var(--card));
  font-size: 0.875rem;
  line-height: 1.4;
  table-layout: fixed;
}

.column .movers-table th,
.column .movers-table td {
  padding: 10px 8px;
  vertical-align: middle;
  border-bottom: 1px solid hsl(var(--border));
}

.column .movers-table th {
  background: hsl(var(--muted));
  color: hsl(var(--foreground));
  font-weight: 600;
  text-align: left;
}

.column .movers-table th.numeric,
.column .movers-table td.numeric {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.column .movers-table td.numeric.positive { color: hsl(var(--positive)); }
.column .movers-table td.numeric.negative { color: hsl(var(--negative)); }

.column .movers-table tbody tr:hover { background: hsl(var(--muted) / 0.5); }

.column .movers-table .stock-info {
  display: block;
  min-width: 0;
}
.column .movers-table .stock-symbol {
  display: block;
  font-weight: 600;
  color: hsl(var(--foreground));
  font-size: 0.875rem;
}
.column .movers-table .stock-name {
  display: block;
  font-size: 0.8125rem;
  color: hsl(var(--muted-foreground));
  margin-top: 2px;
  line-height: 1.3;
}

.column .movers-table td:last-child {
  overflow: visible;
  text-align: right;
}
.column .movers-table .analyze-btn {
  display: inline-block;
  padding: 6px 10px;
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  text-decoration: none;
  border-radius: var(--radius);
  font-size: 0.8125rem;
  font-weight: 500;
  white-space: nowrap;
  min-width: 5.5rem;
  box-sizing: border-box;
}
.column .movers-table .analyze-btn:hover { opacity: 0.9; }

/* Sentiment table: min-width so all 7 columns always get space; scroll when column is narrow */
.column .movers-table.table-sentiment {
  min-width: 36rem;
  table-layout: fixed;
}
/* Nieuws, Koers, Financieel, Totaal: all four exactly equal width (colgroup + th + td) */
.column .movers-table.table-sentiment .sentiment-equal-th,
.column .movers-table.table-sentiment td:nth-child(3),
.column .movers-table.table-sentiment td:nth-child(4),
.column .movers-table.table-sentiment td:nth-child(5),
.column .movers-table.table-sentiment td:nth-child(6) {
  width: 13.25%;
  box-sizing: border-box;
}
.column .movers-table.table-sentiment th:nth-child(1) { width: 5%; }
.column .movers-table.table-sentiment th:nth-child(2) { width: 20%; }
.column .movers-table.table-sentiment th:nth-child(7) { width: 22%; }
.column .movers-table.table-sentiment td:nth-child(7) { min-width: 0; }

/* Column widths: koers (6 cols) – Aandeel narrower so button aligns with # inset from right */
.column .movers-table.table-koers th:nth-child(1) { width: 8%; }
.column .movers-table.table-koers th:nth-child(2) { width: 24%; }
.column .movers-table.table-koers th:nth-child(3) { width: 16%; }
.column .movers-table.table-koers th:nth-child(4) { width: 16%; }
.column .movers-table.table-koers th:nth-child(5) { width: 18%; }
.column .movers-table.table-koers th:nth-child(6) { width: 18%; }

/* Responsive: slightly tighter padding on small screens */
@media (max-width: 900px) {
  .column .movers-table th,
  .column .movers-table td { padding: 8px 6px; font-size: 0.8125rem; }
}

.analyze-btn {
  padding: 6px 10px;
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  text-decoration: none;
  border-radius: var(--radius);
  font-size: 0.8125rem;
  font-weight: 500;
  white-space: nowrap;
}
.analyze-btn:hover { opacity: 0.9; }

.market-cap { white-space: nowrap; }

.no-data {
  text-align: center;
  padding: 48px 20px;
  color: hsl(var(--muted-foreground));
}

.no-data-icon { font-size: 2.5rem; margin-bottom: 12px; }

/* Movers mobile cards */
.stock-card {
  display: flex;
  padding: 12px;
  background: hsl(var(--card));
  border-bottom: 1px solid hsl(var(--border));
  gap: 12px;
  align-items: center;
}

.stock-card:last-child { border-bottom: none; }
.stock-card-rank { font-weight: 600; color: hsl(var(--muted-foreground)); font-size: 0.875rem; min-width: 24px; }
.stock-card-main { flex: 1; min-width: 0; }
.stock-card-symbol { font-weight: 600; color: hsl(var(--primary)); font-size: 0.9375rem; }
.stock-card-name { font-size: 0.75rem; color: hsl(var(--muted-foreground)); margin-top: 2px; }
.stock-card-price { text-align: right; }
.stock-card-current { font-weight: 600; font-size: 0.9375rem; }
.stock-card-change { font-size: 0.8125rem; font-weight: 600; margin-top: 2px; }
.stock-card-change.positive { color: hsl(var(--positive)); }
.stock-card-change.negative { color: hsl(var(--negative)); }
.stock-card-action { margin-left: 8px; }

.desktop-only { display: table; }
.mobile-only { display: none; }

@media (max-width: 1200px) {
  .columns-container { grid-template-columns: 1fr; }
}

/* ========== Exchanges hub ========== */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #667eea;
  text-decoration: none;
  margin-bottom: 16px;
  font-weight: 500;
  font-size: 0.875rem;
}

.back-link:hover { text-decoration: underline; }

.exchanges-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  margin-top: 24px;
}

.exchange-card {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-lg);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.2s, border-color 0.2s;
}

.exchange-card:hover {
  border-color: hsl(var(--primary) / 0.4);
  box-shadow: 0 4px 12px rgb(0 0 0 / 0.06);
}

.exchange-header {
  padding: 24px 20px;
  color: hsl(0 0% 98%);
  text-align: center;
}

.exchange-header.amsterdam {
  background: hsl(24 95% 53%);
}

.exchange-header.frankfurt {
  background: hsl(217 91% 60%);
}

.exchange-header.nyse {
  background: hsl(var(--positive));
}

.exchange-icon { font-size: 2.5rem; margin-bottom: 12px; }
.exchange-name { font-size: 1.25rem; font-weight: 700; margin-bottom: 4px; }
.exchange-subtitle { font-size: 0.875rem; opacity: 0.9; }

.exchange-body { padding: 20px; }
.exchange-stats {
  display: flex;
  justify-content: space-around;
  margin-bottom: 16px;
}

.exchange-stats .stat-box { text-align: center; }
.exchange-stats .stat-value { font-size: 1.25rem; font-weight: 700; color: hsl(var(--foreground)); }
.exchange-stats .stat-label { font-size: 0.75rem; color: hsl(var(--muted-foreground)); margin-top: 4px; }

.exchange-indices {
  background: hsl(var(--muted));
  border-radius: var(--radius);
  padding: 12px;
}

.indices-title {
  font-size: 0.8125rem;
  font-weight: 600;
  color: hsl(var(--muted-foreground));
  margin-bottom: 8px;
}

.indices-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.index-badge {
  background: hsl(var(--card));
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: hsl(var(--foreground));
  border: 1px solid hsl(var(--border));
}

.exchange-cta {
  display: block;
  text-align: center;
  padding: 12px 16px;
  background: hsl(var(--muted));
  color: hsl(var(--foreground));
  font-weight: 600;
  font-size: 0.875rem;
  transition: background 0.2s;
}

.exchange-card:hover .exchange-cta {
  background: hsl(var(--accent));
}

.exchange-cta span { margin-left: 6px; }

.page-header-center {
  margin-bottom: 24px;
  text-align: center;
}

.page-header-center h1 { margin-bottom: 8px; }

/* ========== Subsidy / sector detail pages ========== */
.content-grid-two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
  margin-bottom: 24px;
}

.analysis-column,
.documents-column {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.section-title {
  color: hsl(var(--foreground));
  border-bottom: 2px solid hsl(var(--positive));
  padding-bottom: 8px;
  margin: 0 0 16px 0;
  font-size: 1.125rem;
  font-weight: 600;
}

.ai-analysis-section {
  background: hsl(var(--primary));
  border-radius: var(--radius-lg);
  padding: 24px;
  color: hsl(var(--primary-foreground));
  min-height: 280px;
  border: 1px solid hsl(var(--border));
}

.ai-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid hsl(0 0% 100% / 0.12);
  flex-wrap: wrap;
}

.ai-badge {
  background: hsl(263 70% 55%);
  color: white;
  padding: 6px 14px;
  border-radius: 9999px;
  font-weight: 600;
  font-size: 0.875rem;
}

.ai-meta { font-size: 0.8125rem; opacity: 0.85; }
.ai-content { line-height: 1.7; font-size: 0.9375rem; }
.ai-content p { margin-bottom: 14px; }
.ai-content p > strong:first-child {
  display: block;
  color: hsl(207 90% 72%);
  font-size: 1.05rem;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid hsl(207 90% 72% / 0.3);
  margin-top: 16px;
}
.ai-content p:first-child > strong:first-child { margin-top: 0; }
.ai-content strong { color: hsl(199 80% 80%); }
.ai-content ul, .ai-content ol { margin-left: 20px; margin-bottom: 12px; }
.ai-content li { margin-bottom: 6px; }

/* Take My Money box: medium blue–purple (lighter than AI section, not pastel), white text */
.ai-content .take-my-money-box {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 12px;
  padding: 18px 20px;
  margin-top: 20px;
  color: rgba(255, 255, 255, 0.95);
}
.ai-content .take-my-money-box-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #ffd700;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}
.ai-content .tmm-item {
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  line-height: 1.5;
}
.ai-content .tmm-item:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}
.ai-content .tmm-label {
  display: block;
  font-size: 1.05rem;
  font-weight: 700;
  color: #ffd700;
  margin-bottom: 6px;
  letter-spacing: 0.01em;
}
.ai-content .tmm-text {
  display: block;
  font-size: 0.9rem;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.6;
}

.ai-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 180px;
  opacity: 0.9;
}

.ai-loading .spinner {
  width: 40px;
  height: 40px;
  border: 3px solid hsl(0 0% 100% / 0.2);
  border-top-color: hsl(263 70% 65%);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 12px;
}

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

.article-ref-link {
  color: hsl(207 90% 72%);
  text-decoration: none;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  background: hsl(207 90% 72% / 0.15);
}

.article-ref-link:hover {
  background: hsl(207 90% 72% / 0.25);
  text-decoration: underline;
}

.documents-section {
  background: hsl(var(--muted));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  max-height: 600px;
}

.documents-section h2 { flex-shrink: 0; margin: 0 0 12px 0; }
#documents-container { flex: 1; overflow-y: auto; }

.document-item {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  padding: 12px;
  margin-bottom: 10px;
  border-left: 4px solid hsl(var(--positive));
  display: flex;
  gap: 10px;
  transition: box-shadow 0.2s;
}

.document-item:hover { box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.06); }

.document-ref-num {
  font-weight: 700;
  color: hsl(var(--positive));
  font-size: 0.8125rem;
  min-width: 28px;
}

.document-content { flex: 1; min-width: 0; }
.document-title {
  font-weight: 600;
  color: hsl(var(--foreground));
  margin-bottom: 4px;
  font-size: 0.875rem;
  line-height: 1.35;
}

.document-title a {
  color: hsl(var(--positive));
  text-decoration: none;
}

.document-title a:hover { text-decoration: underline; }
.document-meta {
  display: flex;
  gap: 8px;
  font-size: 0.75rem;
  color: hsl(var(--muted-foreground));
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.document-source {
  background: hsl(var(--positive) / 0.12);
  color: hsl(var(--positive));
  padding: 2px 8px;
  border-radius: 9999px;
  font-size: 0.8rem;
}

.document-type {
  background: hsl(217 91% 60% / 0.12);
  color: hsl(217 91% 50%);
  padding: 2px 8px;
  border-radius: 9999px;
  font-size: 0.8rem;
}

.document-summary {
  font-size: 0.8125rem;
  color: hsl(var(--muted-foreground));
  margin-top: 6px;
  line-height: 1.4;
}

.sector-category {
  display: inline-block;
  background: hsl(var(--positive) / 0.12);
  color: hsl(var(--positive));
  padding: 4px 12px;
  border-radius: 9999px;
  font-size: 0.8125rem;
  font-weight: 500;
  margin-top: 8px;
}

.relevance-badge {
  background: hsl(var(--muted));
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.75rem;
}

.sectors-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.sector-card {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-lg);
  padding: 20px;
  cursor: pointer;
  transition: box-shadow 0.2s, border-color 0.2s;
}

.sector-card:hover {
  border-color: hsl(var(--primary) / 0.4);
  box-shadow: 0 4px 12px rgb(0 0 0 / 0.06);
}

.sector-header { margin-bottom: 12px; }
.sector-card .sector-name { margin: 0 0 6px 0; font-size: 1.125rem; font-weight: 600; }
.sector-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.8125rem;
  color: hsl(var(--muted-foreground));
  margin-bottom: 10px;
}

.trend-up { color: hsl(var(--positive)); }
.trend-down { color: hsl(var(--negative)); }
.sector-summary { font-size: 0.875rem; color: hsl(var(--muted-foreground)); line-height: 1.4; margin-bottom: 12px; }
.view-details-btn {
  display: inline-block;
  color: hsl(var(--primary));
  font-weight: 600;
  font-size: 0.875rem;
  text-decoration: none;
}
.view-details-btn:hover { text-decoration: underline; }

.sector-analyses-container { margin-top: 24px; }
.sector-analysis-card {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-lg);
  margin-bottom: 12px;
  overflow: hidden;
}

.sector-analysis-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  cursor: pointer;
  background: hsl(var(--muted) / 0.5);
  transition: background 0.2s;
}

.sector-analysis-header:hover { background: hsl(var(--muted)); }
.sector-analysis-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sector-analysis-title h3 { margin: 0; font-size: 1.0625rem; font-weight: 600; }
.sector-category-badge, .doc-count-badge {
  padding: 2px 8px;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
}
.sector-category-badge { background: hsl(var(--positive) / 0.12); color: hsl(var(--positive)); }
.doc-count-badge { background: hsl(var(--muted)); color: hsl(var(--muted-foreground)); }
.toggle-icon { font-size: 0.875rem; transition: transform 0.2s; }
.toggle-icon.open { transform: rotate(180deg); }
.sector-analysis-content { padding: 0; }
.sector-analysis-content .ai-analysis-section { border-radius: 0; border: none; margin: 0; }
.sector-analysis-content .ai-analysis-section.sector-ai { padding: 20px; }

.sector-documents { padding: 16px 20px; border-top: 1px solid hsl(var(--border)); background: hsl(var(--muted) / 0.3); }
.sector-docs-title { margin: 0 0 12px 0; font-size: 0.9375rem; font-weight: 600; }
.sector-docs-grid { display: flex; flex-direction: column; gap: 8px; }
.sector-doc-item { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 0.875rem; }
.sector-doc-item .doc-ref { font-weight: 600; color: hsl(var(--positive)); }
.sector-doc-item .doc-link { color: hsl(var(--primary)); text-decoration: none; }
.sector-doc-item .doc-link:hover { text-decoration: underline; }
.sector-doc-item .doc-source { font-size: 0.75rem; color: hsl(var(--muted-foreground)); }
.view-all-docs { display: inline-block; margin-top: 12px; color: hsl(var(--primary)); font-size: 0.875rem; font-weight: 500; text-decoration: none; }
.view-all-docs:hover { text-decoration: underline; }
.sector-link { color: hsl(207 90% 72%); text-decoration: none; }
.sector-link:hover { text-decoration: underline; }
.relevance-score { background: hsl(var(--muted)); padding: 2px 6px; border-radius: 4px; font-size: 0.75rem; }

.source-stats-section {
  margin-top: 24px;
  padding: 20px;
  background: hsl(var(--muted));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-lg);
}

.source-stats-header { margin-bottom: 16px; }
.source-stats-header h2 { margin: 0 0 4px 0; font-size: 1.125rem; }
.source-stats-meta { font-size: 0.8125rem; color: hsl(var(--muted-foreground)); }
.source-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px;
}

.source-item {
  background: hsl(var(--card));
  padding: 12px;
  border-radius: var(--radius);
  text-align: center;
  border: 1px solid hsl(var(--border));
}

.source-count { font-size: 1.25rem; font-weight: 700; color: hsl(var(--foreground)); }
.source-name { font-size: 0.75rem; color: hsl(var(--muted-foreground)); margin-top: 4px; }

/* RVO – Beschikbare Nederlandse subsidies */
.rvo-subsidies-section {
  padding: 20px;
  background: hsl(var(--muted));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-lg);
}
.rvo-filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}
.rvo-filter-label {
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
}
.rvo-filter-btn {
  padding: 6px 14px;
  font-size: 0.875rem;
  border-radius: var(--radius);
  border: 1px solid hsl(var(--border));
  background: hsl(var(--card));
  color: hsl(var(--foreground));
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}
.rvo-filter-btn:hover {
  background: hsl(var(--accent));
  border-color: hsl(var(--ring));
}
.rvo-filter-btn.active {
  background: hsl(var(--primary));
  border-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}
.rvo-no-results {
  margin: 16px 0 0 0;
  padding: 14px;
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  color: hsl(var(--muted-foreground));
  font-size: 0.9375rem;
}
.rvo-subsidies-by-sector {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.rvo-sector-group {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  padding: 16px;
}
.rvo-sector-title {
  margin: 0 0 12px 0;
  font-size: 1rem;
  font-weight: 600;
  color: hsl(var(--foreground));
}
.rvo-status-group {
  margin-top: 14px;
}
.rvo-status-group:first-of-type { margin-top: 0; }
.rvo-status-title {
  margin: 0 0 8px 0;
  font-size: 0.9375rem;
  font-weight: 600;
  color: hsl(var(--muted-foreground));
}
.rvo-subsidy-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.rvo-subsidy-item {
  padding: 8px 0;
  border-bottom: 1px solid hsl(var(--border));
}
.rvo-subsidy-item:last-child { border-bottom: none; }
.rvo-subsidy-item a {
  color: hsl(var(--link));
  text-decoration: none;
  font-weight: 500;
}
.rvo-subsidy-item a:hover { text-decoration: underline; }
.rvo-subsidy-meta {
  font-size: 0.8125rem;
  color: hsl(var(--muted-foreground));
  margin-left: 8px;
}
.rvo-subsidy-short {
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
  margin-top: 4px;
  line-height: 1.35;
}

/* Analysis page: sentiment overview (dark) */
.sentiment-overview {
  background: hsl(var(--muted));
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
  border: 1px solid hsl(var(--border));
  overflow: hidden;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}
/* Two columns: right (Sentiment Opbouw + Kerngetallen) sets row height; left (Gecombineerd) matches that height */
.sentiment-overview-flex {
  display: flex;
  flex-direction: row;
  gap: 25px;
  position: relative;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}
.sentiment-combined-column {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: calc((100% - 25px) / 3);
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}
.sentiment-combined-label {
  margin-bottom: 5px;
  font-size: 0.875em;
  flex-shrink: 0;
}
/* Gecombineerd box: fills column height (same as Sentiment Opbouw + Kerngetallen combined) */
.sentiment-combined-column .sentiment-combined-box {
  flex: 1;
  min-height: 0;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: hsl(var(--card));
  border-radius: 12px;
  padding: clamp(8px, 1.5vw, 16px);
  border: 1px solid hsl(var(--border));
  border-left: 3px solid hsl(var(--muted-foreground));
  overflow: hidden;
  contain: layout;
}
.sentiment-breakdown-column {
  margin-left: calc((100% - 25px) / 3 + 25px);
  flex: 1 1 0;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.sentiment-combined-column .sentiment-combined-box.positive { border-left-color: hsl(var(--positive)); }
.sentiment-combined-column .sentiment-combined-box.negative { border-left-color: hsl(var(--negative)); }
.sentiment-combined-column .sentiment-combined-box.neutral { border-left-color: hsl(var(--muted-foreground)); }
.sentiment-combined-column .sentiment-combined-box .sentiment-combined-value {
  font-size: clamp(1.75em, 4vw, 3.75em);
  font-weight: 700;
  line-height: 1.1;
}
.sentiment-combined-column .sentiment-combined-box .sentiment-verdict {
  font-size: clamp(0.75em, 1.2vw, 1.2em);
  font-weight: 600;
  color: hsl(var(--foreground));
  margin-top: 4px;
  text-align: center;
  word-break: break-word;
}
.sentiment-breakdown-title { margin-bottom: 10px; }
.sentiment-overview .key-metrics-title {
  margin-top: 20px;
  margin-bottom: 10px;
}
.sentiment-three-boxes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.sentiment-overview .sentiment-metric-box {
  background: hsl(var(--card));
  border-radius: 8px;
  padding: clamp(8px, 1.5vw, 12px);
  text-align: center;
  border-left: 4px solid hsl(var(--muted-foreground));
  min-width: 0;
}
.sentiment-overview .sentiment-metric-box.positive { border-left-color: hsl(var(--positive)); }
.sentiment-overview .sentiment-metric-box.negative { border-left-color: hsl(var(--negative)); }
.sentiment-overview .sentiment-metric-box.neutral { border-left-color: hsl(var(--muted-foreground)); }
.sentiment-overview .sentiment-label { font-size: 0.85em; color: hsl(var(--muted-foreground)); text-transform: uppercase; font-weight: 600; margin-bottom: 5px; }
.sentiment-overview .sentiment-value { font-size: clamp(1.1em, 2vw, 1.6em); font-weight: 700; }
.sentiment-overview .sentiment-value.positive { color: hsl(var(--positive)); }
.sentiment-overview .sentiment-value.negative { color: hsl(var(--negative)); }
.sentiment-overview .sentiment-value.neutral { color: hsl(var(--muted-foreground)); }
/* Kerngetallen: one wide box, 2 rows x 3 columns; prevent overflow when resizing */
.key-metrics-one-box {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: auto auto;
  gap: 12px;
  background: hsl(var(--card));
  border-radius: 8px;
  padding: clamp(8px, 1.5vw, 12px);
  border: 1px solid hsl(var(--border));
  min-width: 0;
  overflow: hidden;
}
.sentiment-overview .key-metric-cell {
  text-align: center;
  padding: 6px 0;
  min-width: 0;
  overflow: hidden;
}
.sentiment-overview .key-metric-cell .key-metric-label {
  font-size: clamp(0.75em, 1vw, 1em);
  color: hsl(var(--muted-foreground));
  text-transform: uppercase;
  font-weight: 600;
  margin-right: 0.35em;
  display: inline;
}
.sentiment-overview .key-metric-cell .key-metric-label,
.sentiment-overview .key-metric-cell .sentiment-value {
  word-break: break-word;
  overflow-wrap: break-word;
}
.sentiment-overview .key-metric-cell .sentiment-value { font-size: clamp(0.85em, 1vw, 1em); font-weight: 700; }
.sentiment-overview .key-metrics-box { background: hsl(var(--card)); border-radius: 8px; padding: 12px; font-size: 0.85em; border: 1px solid hsl(var(--border)); }
.sentiment-overview .key-metrics-box .metric-row { display: flex; justify-content: space-between; padding: 4px 0; border-bottom: 1px solid hsl(var(--border)); }
.sentiment-overview .key-metrics-box .metric-row:last-child { border-bottom: none; }
.sentiment-overview .key-metrics-box .metric-label { color: hsl(var(--muted-foreground)); }
.sentiment-overview .key-metrics-box .metric-value { font-weight: 600; color: hsl(var(--foreground)); }
.sentiment-overview .key-metrics-box .metric-value.positive { color: hsl(var(--positive)); }
.sentiment-overview .key-metrics-box .metric-value.negative { color: hsl(var(--negative)); }

/* Sentiment overview: tablet – same fractional layout, smaller gap/font */
@media (max-width: 900px) {
  .sentiment-overview-flex {
    gap: 16px;
  }
  .sentiment-combined-column {
    width: calc((100% - 16px) / 3);
  }
  .sentiment-breakdown-column {
    margin-left: calc((100% - 16px) / 3 + 16px);
  }
  .sentiment-combined-column .sentiment-combined-box .sentiment-combined-value {
    font-size: clamp(1.5em, 3.5vw, 2.5em);
  }
  .sentiment-combined-column .sentiment-combined-box .sentiment-verdict {
    font-size: 0.9em;
  }
}

/* Sentiment overview: phone – stack vertically; tighter spacing and 2-col kerngetallen */
@media (max-width: 640px) {
  .sentiment-overview {
    padding: 14px;
  }
  .sentiment-overview-flex {
    flex-direction: column;
    gap: 20px;
  }
  .sentiment-combined-column {
    position: static;
    width: 100%;
    bottom: auto;
  }
  .sentiment-breakdown-column {
    margin-left: 0;
  }
  .sentiment-combined-column .sentiment-combined-box {
    min-height: 140px;
  }
  .sentiment-combined-column .sentiment-combined-box .sentiment-combined-value {
    font-size: 2.25em;
  }
  .sentiment-combined-column .sentiment-combined-box .sentiment-verdict {
    font-size: 1em;
  }
  .sentiment-breakdown-column {
    min-width: 0;
  }
  .sentiment-three-boxes {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }
  .sentiment-overview .sentiment-metric-box {
    padding: 10px 6px;
  }
  .sentiment-overview .sentiment-value {
    font-size: 1.25em;
  }
  .sentiment-overview .key-metrics-title {
    margin-top: 16px;
    margin-bottom: 8px;
  }
  .key-metrics-one-box {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: auto auto auto;
    gap: 10px;
    padding: 10px;
  }
  /* Phone: col1 = Maandrendement above Kwartaalrendement, col2 = Omzetgroei above Winstgroei, bottom row = P/E + Schuld */
  .sentiment-overview .key-metrics-one-box .key-metric-cell:nth-child(1) { grid-area: 1 / 1; }
  .sentiment-overview .key-metrics-one-box .key-metric-cell:nth-child(2) { grid-area: 1 / 2; }
  .sentiment-overview .key-metrics-one-box .key-metric-cell:nth-child(3) { grid-area: 3 / 1; }
  .sentiment-overview .key-metrics-one-box .key-metric-cell:nth-child(4) { grid-area: 2 / 1; }
  .sentiment-overview .key-metrics-one-box .key-metric-cell:nth-child(5) { grid-area: 2 / 2; }
  .sentiment-overview .key-metrics-one-box .key-metric-cell:nth-child(6) { grid-area: 3 / 2; }
  .sentiment-overview .key-metric-cell {
    padding: 8px 4px;
    font-size: 0.9em;
  }
  .sentiment-overview .key-metric-cell .key-metric-label {
    font-size: 0.7em;
  }
}

/* Very small phones: single column kerngetallen, reset phone grid order */
@media (max-width: 380px) {
  .sentiment-three-boxes {
    grid-template-columns: 1fr;
  }
  .sentiment-overview .sentiment-metric-box {
    padding: 10px;
  }
  .key-metrics-one-box {
    grid-template-columns: 1fr;
  }
  .sentiment-overview .key-metrics-one-box .key-metric-cell:nth-child(n) {
    grid-area: auto;
  }
}

.chart-loading-overlay { background: hsl(var(--card)); color: hsl(var(--foreground)); padding: 10px 20px; border-radius: 8px; border: 1px solid hsl(var(--border)); }

@media (max-width: 1100px) {
  .content-grid-two { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .sidebar { display: none; }
  .mobile-nav { display: block; }
  .main-container { padding-bottom: 70px; }
  .content-area { padding: 12px; }
  .container { padding: 16px; }
  .content-grid { grid-template-columns: 1fr; }
  .content-grid .overview-card,
  .content-grid .stocks-section { min-height: 400px; }
  .stocks-section { height: auto; min-height: 620px; }
  .movers-grid { grid-template-columns: 1fr; overflow: visible; }
  .subsidies-grid,
  .stock-news-grid { grid-template-columns: 1fr; }
  .tmm-grid { grid-template-columns: 1fr; }
  .desktop-only { display: none !important; }
  .mobile-only { display: block !important; }
  .cap-tabs { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; }
  .cap-tab { white-space: nowrap; flex-shrink: 0; }
  .category-info { flex-direction: column; text-align: center; }
}
