@import url('https://fonts.googleapis.com/css2?family=Source+Serif+4:ital,wght@0,400;0,600;0,700;1,400&display=swap');

/* ===== Reset & Base ===== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --eu-blue: #003399;
  --eu-blue-light: #0055cc;
  --eu-gold: #ffcc00;
  --bg: #f0f4f8;
  --surface: #ffffff;
  --text: #1e293b;
  --text-secondary: #64748b;
  --border: #e2e8f0;
  --border-light: #f1f5f9;
  --matrix-header-bg: #f8fafc;

  --status-inforce: #16a34a;
  --status-inprocess: #d97706;
  --status-planned: #2563eb;

  --status-inforce-bg: #f0fdf4;
  --status-inprocess-bg: #fffbeb;
  --status-planned-bg: #eff6ff;

  --drawer-width: 460px;

  --radius: 6px;
  --radius-lg: 10px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);

  --overlay: rgba(0,0,0,0.3);

  --font-display: 'Source Serif 4', Georgia, 'Times New Roman', serif;
}

/* Dark mode */
html[data-theme="dark"] {
  --bg: #0f172a;
  --surface: #1e293b;
  --text: #f1f5f9;
  --text-secondary: #94a3b8;
  --border: #334155;
  --border-light: #475569;
  --matrix-header-bg: #1e293b;

  --status-inforce: #22c55e;
  --status-inprocess: #f59e0b;
  --status-planned: #3b82f6;

  --status-inforce-bg: rgba(34, 197, 94, 0.15);
  --status-inprocess-bg: rgba(245, 158, 11, 0.15);
  --status-planned-bg: rgba(59, 130, 246, 0.15);

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.5);

  --overlay: rgba(0,0,0,0.6);
}

html[data-theme="dark"] .matrix-category-header {
  color: #93c5fd;
}

html[data-theme="dark"] .matrix-category-header:hover {
  color: #bfdbfe;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  scrollbar-gutter: stable;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ===== Animations ===== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes float {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(12px, -12px); }
}

/* ===== Header ===== */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--eu-blue);
  color: #fff;
  padding: 18px 20px 0;
  box-shadow: 0 2px 12px rgba(0,0,0,0.15);
}

/* ===== Header: single-line layout ===== */
.header-line1 {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 48px;
  margin-bottom: 0;
}


.header-line1:last-child {
  padding-bottom: 14px;
}

.header-line1 .category-nav {
  flex: 1;
  min-width: 0;
  padding: 0;
  margin: 0;
  justify-content: center;
  gap: 0;
}

.header-line1 .category-nav .nav-link {
  flex: 1;
  text-align: center;
}

/* ===== Matrix Toolbar (counters + filters, inside main) ===== */
.matrix-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 16px;
  margin-bottom: 12px;
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  flex-wrap: wrap;
  animation: fadeInUp 0.5s ease-out both;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-home {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand-home:hover {
  color: #fff;
}

.brand h1 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

/* Brand mark (inline SVG grid icon) */
.brand-mark {
  flex-shrink: 0;
}

/* Controls */
.controls {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

/* Theme toggle */
.theme-toggle {
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: var(--radius);
  background: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.9);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: background 0.2s, border-color 0.2s;
}

.theme-toggle:hover {
  background: rgba(255,255,255,0.2);
  border-color: rgba(255,255,255,0.4);
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--eu-gold);
  outline-offset: 1px;
}

.theme-icon-sun { display: none; }
.theme-icon-moon { display: inline; }

html[data-theme="dark"] .theme-icon-sun { display: inline; }
html[data-theme="dark"] .theme-icon-moon { display: none; }

/* Account icon inside button */
.account-icon {
  display: block;
  flex-shrink: 0;
}

.account-btn-name {
  white-space: nowrap;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Account button + dropdown */
.account-wrap {
  position: relative;
  min-width: 48px;
}

.account-btn {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: var(--radius);
  background: rgba(255,255,255,0.12);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.account-btn:hover {
  background: rgba(255,255,255,0.2);
  border-color: rgba(255,255,255,0.5);
}

.account-btn:focus-visible {
  outline: 2px solid var(--eu-gold);
  outline-offset: 1px;
}

.account-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 4px;
  min-width: 160px;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  padding: 6px 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 0.2s, visibility 0.2s, transform 0.2s;
  z-index: 150;
}

.account-wrap.open .account-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.account-dropdown-item {
  display: block;
  padding: 10px 16px;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.15s;
}

.account-dropdown-item:hover {
  background: var(--bg);
}

.account-dropdown-item:focus-visible {
  outline: 2px solid var(--eu-blue-light);
  outline-offset: -2px;
}

.search-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 10px;
  width: 16px;
  height: 16px;
  color: var(--text-secondary);
  pointer-events: none;
}

#search {
  padding: 8px 32px 8px 36px;
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: var(--radius);
  background: rgba(255,255,255,0.12);
  color: #fff;
  font-size: 1rem;
  width: 180px;
  outline: none;
  transition: background 0.2s, border-color 0.2s;
}

#search::placeholder {
  color: rgba(255,255,255,0.5);
}

#search:focus {
  background: rgba(255,255,255,0.2);
  border-color: rgba(255,255,255,0.5);
}

#search:focus-visible {
  outline: 2px solid var(--eu-gold);
  outline-offset: 1px;
}

.search-clear {
  position: absolute;
  right: 8px;
  width: 20px;
  height: 20px;
  border: none;
  background: rgba(255,255,255,0.2);
  color: rgba(255,255,255,0.7);
  border-radius: 50%;
  font-size: 0.85rem;
  line-height: 1;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background 0.15s, color 0.15s;
}

.search-clear.visible {
  display: flex;
}

.search-clear:hover {
  background: rgba(255,255,255,0.35);
  color: #fff;
}

.search-clear:focus-visible {
  outline: 2px solid var(--eu-gold);
  outline-offset: 1px;
}

/* Search dropdown */
.search-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 100%;
  width: 420px;
  max-height: 380px;
  overflow-y: auto;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  z-index: 160;
  display: none;
  padding: 4px 0;
}

.search-dropdown.open {
  display: block;
}

.search-dd-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: inherit;
  transition: background 0.15s;
}

.search-dd-item:hover {
  background: var(--bg);
}

.search-dd-item:focus-visible {
  outline: 2px solid var(--eu-blue-light);
  outline-offset: -2px;
}

.search-dd-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.search-dd-dot.inforce  { background: var(--status-inforce); }
.search-dd-dot.inprocess { background: var(--status-inprocess); }
.search-dd-dot.planned   { background: var(--status-planned); }

.search-dd-acronym {
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text);
  flex-shrink: 0;
}

.search-dd-title {
  flex: 1;
  font-size: 0.8rem;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.search-dd-divider {
  height: 1px;
  background: var(--border-light);
  margin: 4px 0;
}

.search-dd-cat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 12px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--eu-blue);
  text-decoration: none;
  transition: background 0.15s;
}

.search-dd-cat:hover {
  background: var(--bg);
}

.search-dd-cat:focus-visible {
  outline: 2px solid var(--eu-blue-light);
  outline-offset: -2px;
}

.search-dd-count {
  font-size: 0.72rem;
  color: var(--text-secondary);
  font-weight: 400;
  background: var(--bg);
  padding: 1px 7px;
  border-radius: 8px;
}

.search-dd-empty {
  padding: 12px;
  font-size: 0.82rem;
  color: var(--text-secondary);
  text-align: center;
}

/* Status toggles */
.status-toggles {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 3px 5px 3px 12px;
}

.toggles-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-right: 2px;
}

.toggle-chip {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 16px;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 500;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  transition: all 0.2s;
  user-select: none;
  position: relative;
  text-decoration: line-through;
  text-decoration-color: var(--border);
}

.toggle-chip .check {
  font-size: 0.7rem;
  opacity: 0;
  width: 0;
  overflow: hidden;
  transition: opacity 0.2s, width 0.2s;
}

.toggle-chip.active .check {
  opacity: 1;
  width: auto;
}

.toggle-chip input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.toggle-chip:has(input:focus-visible) {
  outline: 2px solid var(--eu-gold);
  outline-offset: 1px;
}

.toggle-chip .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.toggle-chip.status-inforce .dot  { background: var(--status-inforce); }
.toggle-chip.status-inprocess .dot { background: var(--status-inprocess); }
.toggle-chip.status-planned .dot   { background: var(--status-planned); }

.toggle-chip.active {
  color: var(--text);
  text-decoration: none;
}

.toggle-chip.status-inforce.active {
  background: var(--status-inforce-bg);
  border-color: var(--status-inforce);
}

.toggle-chip.status-inprocess.active {
  background: var(--status-inprocess-bg);
  border-color: var(--status-inprocess);
}

.toggle-chip.status-planned.active {
  background: var(--status-planned-bg);
  border-color: var(--status-planned);
}

/* ===== Category Nav ===== */
.category-nav-wrap {
  display: flex;
  align-items: stretch;
  gap: 0;
  position: relative;
  min-width: 0;
}


.category-nav {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0;
  overflow-x: auto;
  padding: 0;
  scrollbar-width: none;
  -ms-overflow-style: none;
  flex: 1;
  min-width: 0;
}


.category-nav::-webkit-scrollbar {
  display: none;
}

.category-nav .nav-link {
  flex-shrink: 0;
  padding: 9px 16px;
  border: none;
  background: transparent;
  color: rgba(255,255,255,0.7);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
  white-space: nowrap;
  text-decoration: none;
  display: inline-block;
  line-height: 1.4;
}

/* Category color accent: thin pastel left border */
.category-nav .nav-link.cat-accent {
  border-left: 2px solid var(--cat-color, transparent);
  padding-left: 12px;
  margin-left: 2px;
}

.category-nav .nav-link:hover {
  color: #fff;
  background: rgba(255,255,255,0.08);
}

.category-nav .nav-link.active {
  color: var(--eu-gold);
  border-bottom-color: var(--eu-gold);
}

.category-nav .nav-link:focus-visible {
  outline: 2px solid var(--eu-gold);
  outline-offset: -2px;
}

/* First nav link (Home) */
.category-nav .nav-overview {
  font-weight: 600;
}

/* Counters */
.counters {
  display: flex;
  gap: 14px;
  padding: 0;
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.counters .counter-item {
  display: flex;
  align-items: center;
  gap: 5px;
}

.counters .counter-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.counters .counter-value {
  font-weight: 700;
  color: var(--text);
}

/* ===== Main ===== */
.main {
  flex: 1;
  padding: 16px;
  max-width: 100%;
  overflow-x: hidden;
}

.matrix-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-md);
  max-width: 100%;
  animation: fadeInUp 0.5s ease-out 0.1s both;
}

/* ===== Matrix Grid (Overview page) ===== */
/* Vertical layout: Category (fixed width) | status columns share the rest */
.matrix {
  display: grid;
  grid-template-columns: 220px repeat(3, minmax(0, 1fr)); /* default before JS */
  width: 100%;
  max-width: 100%;
}

/* Category column fixed; only In force / In process / Planned columns resize */
.matrix-wrapper.matrix-cols-3 .matrix {
  grid-template-columns: 220px repeat(3, minmax(0, 1fr));
}

.matrix-wrapper.matrix-cols-2 .matrix {
  grid-template-columns: 220px repeat(2, minmax(0, 1fr));
}

.matrix-wrapper.matrix-cols-1 .matrix {
  grid-template-columns: 220px minmax(0, 1fr);
}

.matrix-wrapper.matrix-cols-0 .matrix {
  grid-template-columns: 220px;
}

.matrix-header-corner {
  position: sticky;
  left: 0;
  top: var(--header-height, 140px);
  z-index: 5;
  background: var(--matrix-header-bg);
  border-bottom: 2px solid var(--border);
  border-right: 2px solid var(--border);
  display: flex;
  align-items: center;
  padding: 14px 16px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.matrix-col-header {
  position: sticky;
  top: var(--header-height, 140px);
  z-index: 4;
  background: var(--matrix-header-bg);
  border-bottom: 2px solid var(--border);
  border-right: 1px solid var(--border-light);
  padding: 14px 12px;
  font-size: 0.9rem;
  font-weight: 600;
  text-align: center;
  line-height: 1.3;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  transition: background 0.2s;
}

.matrix-col-header:last-of-type {
  border-right: none;
}

.matrix-category-header {
  position: sticky;
  left: 0;
  z-index: 2;
  background: var(--surface);
  border-right: 2px solid var(--border);
  border-bottom: 1px solid var(--border-light);
  padding: 14px 16px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--eu-blue);
  text-decoration: none;
  display: flex;
  align-items: center;
  transition: background 0.2s, color 0.2s;
}

/* Category color accent in matrix: thin pastel left border */
.matrix-category-header.cat-accent {
  border-left: 2px solid var(--cat-color, transparent);
  padding-left: 10px;
}

.matrix-category-header:hover {
  background: var(--bg);
  color: var(--eu-blue-light);
}

.matrix-category-header:focus-visible {
  outline: 2px solid var(--eu-blue-light);
  outline-offset: -2px;
}

.matrix-row-header {
  position: sticky;
  left: 0;
  z-index: 2;
  background: var(--surface);
  border-right: 2px solid var(--border);
  border-bottom: 1px solid var(--border-light);
  padding: 10px 12px;
  font-size: 0.78rem;
  font-weight: 600;
  display: flex;
  align-items: flex-start;
  gap: 6px;
  writing-mode: horizontal-tb;
}

/* Status badge — reusable across matrix and category list */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
}

.status-badge.inforce {
  background: var(--status-inforce-bg);
  color: var(--status-inforce);
}

.status-badge.inprocess {
  background: var(--status-inprocess-bg);
  color: var(--status-inprocess);
}

.status-badge.planned {
  background: var(--status-planned-bg);
  color: var(--status-planned);
}

.status-badge .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.matrix-cell {
  border-right: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
  padding: 12px 14px;
  min-height: 80px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: background 0.2s;
  vertical-align: top;
}

/* Last status column: no right border (variable number of columns) */
.matrix-cell-last {
  border-right: none;
}

/* Empty cell placeholder */
.matrix-cell-empty {
  font-size: 0.8rem;
  color: var(--border);
  text-align: center;
  padding-top: 20px;
}

/* ===== Cards (shared) ===== */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 9px 12px;
  cursor: pointer;
  border-left: 3px solid transparent;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s, box-shadow 0.15s, opacity 0.2s;
  position: relative;
}

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

.card:focus-visible {
  outline: 2px solid var(--eu-blue-light);
  outline-offset: 1px;
}

.card.status-inforce  { border-left-color: var(--status-inforce); }
.card.status-inprocess { border-left-color: var(--status-inprocess); }
.card.status-planned   { border-left-color: var(--status-planned); }

.card .card-acronym {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
}

.card .card-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.card.status-inforce .card-dot  { background: var(--status-inforce); }
.card.status-inprocess .card-dot { background: var(--status-inprocess); }
.card.status-planned .card-dot   { background: var(--status-planned); }

.card .card-title {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.35;
  margin-top: 3px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card .card-meta {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-top: 4px;
  opacity: 0.8;
}

.card.search-match {
  box-shadow: 0 0 0 2px var(--eu-blue-light), var(--shadow-md);
}

.card.faded {
  opacity: 0.15;
  pointer-events: none;
}

/* ===== Category Page Header ===== */
#category-page-header {
  margin-bottom: 20px;
  animation: fadeInUp 0.5s ease-out 0.05s both;
}

.category-page-title {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}

.category-page-subtitle {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* Category scope hint: clarifies boundary at a glance */
.category-page-hint {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 6px;
  padding: 8px 12px;
  background: var(--bg);
  border-radius: var(--radius);
  border-left: 2px solid var(--cat-color, var(--border));
  max-width: 42rem;
}

.category-page-title.cat-accent {
  padding-left: 10px;
  border-left: 2px solid var(--cat-color, transparent);
}

/* ===== Category List (Category page) ===== */
.status-section {
  margin-bottom: 24px;
  animation: fadeInUp 0.5s ease-out 0.1s both;
}

.status-section.status-section-hidden {
  opacity: 0.4;
}

.status-section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.status-section-count {
  font-size: 0.78rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.status-section-count::before {
  content: '(';
}

.status-section-count::after {
  content: ')';
}

.status-section-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 8px;
}

.status-section-none {
  font-size: 0.82rem;
  color: var(--text-secondary);
  padding: 12px 0;
  font-style: italic;
}

/* ===== Drawer ===== */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.drawer-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: var(--drawer-width);
  max-width: 100vw;
  height: 100vh;
  background: var(--surface);
  z-index: 210;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: -4px 0 30px rgba(0,0,0,0.15);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.drawer.open {
  transform: translateX(0);
}

.drawer-close {
  position: sticky;
  top: 0;
  margin: 12px 12px 0 0;
  width: 36px;
  height: 36px;
  border: none;
  background: var(--bg);
  color: var(--text-secondary);
  font-size: 1.4rem;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
  transition: background 0.2s;
}

.drawer-close:hover {
  background: var(--border);
  color: var(--text);
}

.drawer-close:focus-visible {
  outline: 2px solid var(--eu-blue-light);
  outline-offset: 2px;
}

.drawer-content {
  padding: 16px 24px 32px;
}

.drawer-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 14px;
  font-size: 0.78rem;
  font-weight: 600;
  margin-bottom: 12px;
}

.drawer-status.inforce  { background: var(--status-inforce-bg); color: var(--status-inforce); }
.drawer-status.inprocess { background: var(--status-inprocess-bg); color: var(--status-inprocess); }
.drawer-status.planned   { background: var(--status-planned-bg); color: var(--status-planned); }

.drawer-status .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.drawer-acronym {
  font-size: 1.15rem;
  color: var(--eu-blue);
  font-weight: 700;
  letter-spacing: 0.03em;
  margin-bottom: 4px;
}
html[data-theme="dark"] .drawer-acronym {
  color: #93c5fd;
}

.drawer-title {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  line-height: 1.4;
  margin-bottom: 6px;
}

.drawer-tags .cat-badge {
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--eu-blue);
  text-decoration: none;
  transition: background 0.2s;
}

.drawer-tags .cat-badge.cat-accent {
  background: color-mix(in srgb, var(--cat-color, var(--eu-blue)) 22%, var(--bg));
  color: var(--cat-color, var(--eu-blue));
}

.drawer-tags .cat-badge:hover {
  background: var(--border);
}

.drawer-tags .cat-badge:focus-visible {
  outline: 2px solid var(--eu-blue-light);
  outline-offset: 1px;
}

.drawer-dates {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 20px;
}

.drawer-date-item {
  background: var(--bg);
  padding: 10px 12px;
  border-radius: var(--radius);
}

.drawer-date-label {
  font-size: 0.68rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
  margin-bottom: 2px;
}

.drawer-date-value {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}

.drawer-section {
  margin-bottom: 18px;
}

.drawer-section-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  margin-bottom: 6px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border-light);
}

.drawer-summary {
  font-size: 0.85rem;
  line-height: 1.65;
  color: var(--text);
}

.drawer-who {
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--text);
}

.drawer-keypoints {
  list-style: none;
  padding: 0;
}

.drawer-keypoints li {
  position: relative;
  padding-left: 16px;
  font-size: 0.83rem;
  line-height: 1.55;
  margin-bottom: 6px;
  color: var(--text);
}

.drawer-keypoints li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 7px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--eu-blue);
}

.drawer-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.drawer-tag {
  background: var(--bg);
  color: var(--text-secondary);
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.72rem;
  font-weight: 500;
}

.drawer-related {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.drawer-related-link {
  background: #ebf2ff;
  color: var(--eu-blue);
  padding: 4px 12px;
  border-radius: var(--radius);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: background 0.2s;
}

.drawer-related-link:hover {
  background: #d6e4ff;
}

.drawer-related-link:focus-visible {
  outline: 2px solid var(--eu-blue-light);
  outline-offset: 1px;
}

.drawer-eurlex {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 20px;
  padding: 10px 18px;
  background: var(--eu-blue);
  color: #fff;
  text-decoration: none;
  border-radius: var(--radius);
  font-size: 0.82rem;
  font-weight: 600;
  transition: background 0.2s;
}

.drawer-eurlex:hover {
  background: var(--eu-blue-light);
}

.drawer-eurlex:focus-visible {
  outline: 2px solid var(--eu-gold);
  outline-offset: 2px;
}

.drawer-eurlex svg {
  width: 14px;
  height: 14px;
}

/* ===== Search Hints (Category page) ===== */
.search-fallback-notice {
  background: var(--status-planned-bg);
  border: 1px solid #bfdbfe;
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 16px;
}

.search-fallback-text {
  font-size: 0.85rem;
  color: var(--text);
  margin-bottom: 8px;
}

.search-fallback-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.search-hint-cat-link {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--eu-blue);
  text-decoration: none;
  transition: background 0.2s, border-color 0.2s;
}

.search-hint-cat-link:hover {
  background: var(--bg);
  border-color: var(--eu-blue-light);
}

.search-hint-cat-link:focus-visible {
  outline: 2px solid var(--eu-blue-light);
  outline-offset: 1px;
}

.search-hint-count {
  color: var(--text-secondary);
  font-weight: 400;
}

.search-fallback-global {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--eu-blue);
  text-decoration: none;
}

.search-fallback-global:hover {
  text-decoration: underline;
}

.search-fallback-global:focus-visible {
  outline: 2px solid var(--eu-blue-light);
  outline-offset: 1px;
}

.search-intent-chip {
  margin-bottom: 12px;
}

.intent-chip-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #fef9c3;
  border: 1px solid #fde68a;
  border-radius: 20px;
  padding: 5px 14px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #92400e;
  text-decoration: none;
  transition: background 0.2s;
}

.intent-chip-link:hover {
  background: #fde68a;
}

.intent-chip-link:focus-visible {
  outline: 2px solid var(--eu-blue-light);
  outline-offset: 1px;
}

/* ===== Auth pages (login, signup) ===== */
.brand-link {
  display: flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand-link:hover {
  color: #fff;
}

.auth-main {
  max-width: 480px;
  width: 100%;
  margin: 0 auto;
  padding: 40px 20px 60px;
}

.auth-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 32px;
  min-height: 420px;
  display: flex;
  flex-direction: column;
}

.auth-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 24px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.auth-field-row {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
}

.auth-field-row--two {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
}

.auth-field-row--two .auth-field {
  min-width: 0;
}

.auth-field-row--two .auth-input {
  min-width: 0;
}

.auth-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}

.auth-input {
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 1rem;
  color: var(--text);
  background: var(--surface);
  transition: border-color 0.2s;
}

.auth-input:focus {
  outline: none;
  border-color: var(--eu-blue-light);
  box-shadow: 0 0 0 2px rgba(0, 85, 204, 0.2);
}

.auth-input::placeholder {
  color: var(--text-secondary);
}

.auth-link {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--eu-blue-light);
  text-decoration: none;
}

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

.auth-submit {
  padding: 12px 24px;
  background: var(--eu-blue);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  margin-top: 8px;
}

.auth-submit:hover {
  background: var(--eu-blue-light);
}

.auth-submit:focus-visible {
  outline: 2px solid var(--eu-gold);
  outline-offset: 2px;
}

.auth-footer {
  margin-top: auto;
  padding-top: 20px;
  border-top: 1px solid var(--border-light);
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.auth-footer .auth-link {
  margin-left: 4px;
}

.auth-field--checkbox {
  flex-direction: row;
  align-items: flex-start;
}

.auth-checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.9rem;
  color: var(--text);
  cursor: pointer;
}

.auth-checkbox {
  margin-top: 3px;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.account-dropdown-current {
  font-weight: 600;
  color: var(--eu-blue);
}

/* Auth form validation errors */
.auth-error {
  font-size: 0.8rem;
  color: #dc2626;
  margin-top: 4px;
}

html[data-theme="dark"] .auth-error {
  color: #f87171;
}

.auth-input.auth-input-error {
  border-color: #dc2626;
}

html[data-theme="dark"] .auth-input.auth-input-error {
  border-color: #f87171;
}

.auth-input.auth-input-error:focus {
  box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.2);
}

/* ===== Footer ===== */
.site-footer {
  margin-top: auto;
  padding: 24px 20px;
  background: var(--eu-blue);
  color: rgba(255,255,255,0.85);
  font-size: 0.85rem;
  text-align: center;
}

.site-footer a {
  color: var(--eu-gold);
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
}

/* ===== No Results ===== */
.no-results {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-secondary);
}

.no-results h2 {
  font-size: 1.1rem;
  margin-bottom: 4px;
  color: var(--text);
}

.no-results p {
  font-size: 0.85rem;
}

/* ===== Page Placeholder (News, My compliance) ===== */
/* ===== Home Page ===== */
.home-main {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 20px 60px;
}

/* Staggered entrance for home sections */
.home-main > * {
  animation: fadeInUp 0.6s ease-out both;
}

.home-main > :nth-child(2) { animation-delay: 0.1s; }
.home-main > :nth-child(3) { animation-delay: 0.2s; }
.home-main > :nth-child(4) { animation-delay: 0.3s; }

/* Hero */
.home-hero {
  text-align: center;
  padding: 56px 0 44px;
}

.home-hero-title {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.35;
  letter-spacing: 0.01em;
}

.home-hero-accent {
  color: var(--eu-blue-light);
  position: relative;
}

html[data-theme="dark"] .home-hero-accent {
  color: var(--eu-gold);
}

.home-hero-subtitle {
  margin-top: 14px;
  font-size: 1.05rem;
  color: var(--text-secondary);
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.6;
}

/* News banner */
.home-news {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border-left: 3px solid var(--eu-gold);
  padding: 16px 20px;
  margin-bottom: 28px;
}

.home-news-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.home-news-badge {
  background: var(--eu-gold);
  color: #1e293b;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 2px 8px;
  border-radius: 10px;
}

.home-news-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}

.home-news-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.home-news-item {
  display: flex;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-light);
  font-size: 0.85rem;
  line-height: 1.5;
}

.home-news-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.home-news-date {
  flex-shrink: 0;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  min-width: 80px;
  padding-top: 1px;
}

.home-news-text {
  color: var(--text);
}

/* Section cards */
.home-section {
  margin-bottom: 20px;
}

.home-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 28px 28px;
  display: flex;
  align-items: center;
  gap: 28px;
  transition: box-shadow 0.2s;
}

.home-card:hover {
  box-shadow: var(--shadow-lg);
}

.home-card-content {
  flex: 1;
  min-width: 0;
}

.home-card-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}

.home-card-text {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 16px;
}

.home-card-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  background: var(--eu-blue);
  color: #fff;
  text-decoration: none;
  border-radius: var(--radius);
  font-size: 0.88rem;
  font-weight: 600;
  transition: background 0.2s;
}

.home-card-cta:hover {
  background: var(--eu-blue-light);
}

.home-card-cta:focus-visible {
  outline: 2px solid var(--eu-gold);
  outline-offset: 2px;
}

.home-card-cta--secondary {
  background: transparent;
  color: var(--eu-blue-light);
  border: 1.5px solid var(--eu-blue-light);
}

.home-card-cta--secondary:hover {
  background: var(--eu-blue);
  color: #fff;
  border-color: var(--eu-blue);
}

html[data-theme="dark"] .home-card-cta--secondary {
  color: var(--eu-gold);
  border-color: var(--eu-gold);
}

html[data-theme="dark"] .home-card-cta--secondary:hover {
  background: var(--eu-gold);
  color: #1e293b;
}

/* Card visuals */
.home-card-visual {
  flex-shrink: 0;
}

.home-mini-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 14px;
  background: var(--bg);
  border-radius: var(--radius);
}

.home-mini-dot {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  opacity: 0.7;
}

.home-compliance-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100px;
  height: 100px;
  background: var(--bg);
  border-radius: var(--radius-lg);
  color: var(--text-secondary);
}

@media (max-width: 640px) {
  .home-hero-title {
    font-size: 1.7rem;
  }

  .home-card {
    flex-direction: column;
    gap: 16px;
    padding: 20px;
  }

  .home-card-visual {
    align-self: center;
  }

  .home-news-item {
    flex-direction: column;
    gap: 2px;
  }
}

.page-placeholder {
  padding: 60px 24px;
  text-align: center;
  color: var(--text-secondary);
}

.page-placeholder h2 {
  font-size: 1.25rem;
  color: var(--text);
  margin-bottom: 8px;
}

.page-placeholder p {
  font-size: 0.95rem;
}

/* ===== Category Row Separation (Overview matrix) ===== */
.matrix-category-header {
  border-top: 1px solid var(--border);
}

/* ===== Per-Category Counters ===== */
.cat-counts {
  display: inline-flex;
  gap: 3px;
  margin-left: 8px;
  vertical-align: middle;
}

.cat-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 9px;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1;
}

.cat-count-inforce  { background: var(--status-inforce-bg); color: var(--status-inforce); }
.cat-count-inprocess { background: var(--status-inprocess-bg); color: var(--status-inprocess); }
.cat-count-planned   { background: var(--status-planned-bg); color: var(--status-planned); }

/* ===== Drawer: Scope ===== */
.drawer-scope {
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--text-secondary);
  margin-bottom: 16px;
  padding: 8px 12px;
  background: var(--bg);
  border-radius: var(--radius);
  border-left: 2px solid var(--eu-blue-light);
}

.drawer-scope-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  margin-bottom: 2px;
}

/* ===== Drawer: Key Dates Timeline ===== */
.drawer-timeline {
  position: relative;
  padding-left: 22px;
}

.drawer-timeline::before {
  content: '';
  position: absolute;
  left: 5px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: var(--border);
  border-radius: 1px;
}

.timeline-item {
  position: relative;
  padding-bottom: 14px;
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-dot {
  position: absolute;
  left: -20px;
  top: 3px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border);
  border: 2px solid var(--surface);
  z-index: 1;
}

.timeline-item--past .timeline-dot {
  background: var(--status-inforce);
}

.timeline-label {
  font-size: 0.72rem;
  color: var(--text-secondary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.timeline-date {
  font-size: 0.85rem;
  color: var(--text);
  font-weight: 600;
  margin-top: 1px;
}

/* ===== Responsive ===== */

/* Overview: no horizontal scroll */
@media (min-width: 768px) {
  body[data-page="overview"] {
    overflow-x: clip;
    max-width: 100%;
  }

  body[data-page="overview"] .main {
    overflow-x: clip;
    max-width: 100%;
  }

  /* Nav stays on one line (Overview + 12 categories), scrolls horizontally if needed */
  .category-nav {
    flex-wrap: nowrap;
    overflow-x: auto;
  }

  .matrix-wrapper {
    overflow-x: clip;
    width: 100%;
    max-width: 100%;
  }
}

@media (max-width: 1200px) {
  :root {
    --drawer-width: 400px;
  }
}

@media (max-width: 768px) {
  :root {
    --drawer-width: 100vw;
  }

  .auth-field-row--two {
    grid-template-columns: 1fr;
  }

  .matrix {
    grid-template-columns: 140px repeat(3, minmax(100px, 1fr));
  }

  .matrix-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .matrix-category-header {
    padding: 11px 13px;
    font-size: 0.9rem;
  }

  .matrix-cell {
    padding: 10px 12px;
    min-height: 72px;
  }

  .header {
    padding: 14px 12px 0;
  }

  .header-line1 {
    height: auto;
    min-height: 48px;
    flex-wrap: wrap;
    gap: 10px;
  }

  .matrix-toolbar {
    gap: 8px;
    padding: 8px 12px;
  }

  .controls {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
  }

  #search {
    width: 100%;
  }

  .search-dropdown {
    width: 100%;
  }

  .status-toggles {
    flex-wrap: wrap;
    padding: 3px 4px 3px 10px;
  }

  .toggle-chip {
    padding: 4px 10px;
    font-size: 0.82rem;
  }

  .counters {
    gap: 10px;
    font-size: 0.82rem;
  }

  .brand h1 {
    font-size: 1.25rem;
  }

  .main {
    padding: 10px;
  }

  .drawer-content {
    padding: 12px 16px 24px;
  }

  .drawer-dates {
    grid-template-columns: 1fr;
  }

  .status-section-cards {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  html {
    font-size: 14px;
  }

  .category-nav .nav-link {
    padding: 7px 11px;
    font-size: 0.82rem;
  }

  .category-nav .nav-overview {
    padding-right: 14px;
    margin-right: 4px;
  }
}

/* ===== Reduced Motion ===== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ===== Auth: Success & Error Messages ===== */
.auth-success {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534;
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 16px;
}

html[data-theme="dark"] .auth-success {
  background: rgba(34, 197, 94, 0.15);
  border-color: rgba(34, 197, 94, 0.3);
  color: #86efac;
}

.auth-general-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 16px;
}

.auth-general-error a {
  color: inherit;
  text-decoration: underline;
}

html[data-theme="dark"] .auth-general-error {
  background: rgba(220, 38, 38, 0.15);
  border-color: rgba(220, 38, 38, 0.3);
  color: #fca5a5;
}

.auth-subtitle {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

/* ===== Account Button: Logged-in State ===== */
.account-btn--logged-in {
  background: rgba(255, 204, 0, 0.2);
  border-color: rgba(255, 204, 0, 0.5);
  color: var(--eu-gold);
  font-weight: 600;
}

.account-btn--logged-in:hover {
  background: rgba(255, 204, 0, 0.3);
  border-color: rgba(255, 204, 0, 0.7);
}

/* ===== Account Dropdown: Danger Item (Logout) ===== */
.account-dropdown-item--danger {
  display: block;
  width: 100%;
  padding: 10px 16px;
  border: none;
  background: none;
  text-align: left;
  font-size: 0.9rem;
  font-weight: 500;
  color: #dc2626;
  cursor: pointer;
  transition: background 0.15s;
  font-family: inherit;
}

.account-dropdown-item--danger:hover {
  background: #fef2f2;
}

html[data-theme="dark"] .account-dropdown-item--danger {
  color: #f87171;
}

html[data-theme="dark"] .account-dropdown-item--danger:hover {
  background: rgba(220, 38, 38, 0.15);
}

/* ===== Drawer: Actions Row + Favorite Button ===== */
.drawer-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.drawer-actions .drawer-status {
  margin-bottom: 0;
}

.drawer-fav-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--bg);
  color: var(--text-secondary);
  cursor: pointer;
  transition: color 0.2s, background 0.2s, border-color 0.2s;
  padding: 0;
}

.drawer-fav-btn:hover {
  color: #f59e0b;
  border-color: #f59e0b;
  background: rgba(245, 158, 11, 0.1);
}

.drawer-fav-btn.active {
  color: #f59e0b;
  border-color: #f59e0b;
  background: rgba(245, 158, 11, 0.15);
}

.drawer-fav-btn:focus-visible {
  outline: 2px solid var(--eu-gold);
  outline-offset: 2px;
}

/* ===== Username Availability Feedback ===== */
.username-status {
  font-size: 0.78rem;
  font-weight: 500;
  min-height: 1.2em;
}

.username-status--checking {
  color: var(--text-secondary);
}

.username-status--ok {
  color: var(--status-inforce);
}

.username-status--error {
  color: #dc2626;
}

html[data-theme="dark"] .username-status--error {
  color: #f87171;
}

/* ===== Auth Submit: Disabled / Loading State ===== */
.auth-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  background: var(--text-secondary);
}

/* ===== Account Page ===== */
.account-page {
  max-width: 640px;
  margin: 0 auto;
  padding: 24px 20px 60px;
}

.account-section {
  margin-bottom: 32px;
}

.account-section-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.account-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 20px 24px;
}

.account-info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-light);
}

.account-info-row:last-child {
  border-bottom: none;
}

.account-info-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.account-info-value {
  font-size: 0.9rem;
  color: var(--text);
  font-weight: 500;
}

/* ===== Account: Favorites List ===== */
.account-favorites-empty {
  font-size: 0.9rem;
  color: var(--text-secondary);
  padding: 20px 0;
}

.account-favorites-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.account-fav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  transition: background 0.15s, box-shadow 0.15s;
}

.account-fav-item:hover {
  background: var(--bg);
  box-shadow: var(--shadow-md);
}

.account-fav-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.account-fav-dot.inforce  { background: var(--status-inforce); }
.account-fav-dot.inprocess { background: var(--status-inprocess); }
.account-fav-dot.planned   { background: var(--status-planned); }

.account-fav-acronym {
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text);
  flex-shrink: 0;
}

.account-fav-title {
  font-size: 0.82rem;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

/* ===== News Page ===== */
.news-page {
  max-width: 740px;
  margin: 0 auto;
  padding: 24px 20px 60px;
}

.news-page-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.news-page-subtitle {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.news-feed {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.news-article {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 20px 24px;
  border-left: 3px solid var(--eu-gold);
}

.news-article-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.news-article-date {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.news-article-body {
  font-size: 0.9rem;
  line-height: 1.65;
  color: var(--text);
  white-space: pre-line;
}

.news-article-source {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  padding: 8px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--eu-blue-light);
  text-decoration: none;
  transition: background 0.2s, border-color 0.2s;
}

.news-article-source:hover {
  background: var(--border);
  border-color: var(--eu-blue-light);
}

.news-article-source:focus-visible {
  outline: 2px solid var(--eu-blue-light);
  outline-offset: 2px;
}

html[data-theme="dark"] .news-article-source {
  color: var(--eu-gold);
}

.news-empty {
  text-align: center;
  padding: 48px 20px;
  font-size: 0.95rem;
  color: var(--text-secondary);
}

/* Home news: view all link */
.home-news-viewall {
  display: inline-block;
  margin-top: 10px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--eu-blue-light);
  text-decoration: none;
}

.home-news-viewall:hover {
  text-decoration: underline;
}

html[data-theme="dark"] .home-news-viewall {
  color: var(--eu-gold);
}

/* ===== Admin News Page ===== */
.admin-page {
  max-width: 740px;
  margin: 0 auto;
  padding: 24px 20px 60px;
}

.admin-page-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 20px;
}

.admin-editor {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 20px 24px;
  margin-bottom: 28px;
}

.admin-editor-heading {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 14px;
}

.admin-input {
  display: block;
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 1rem;
  color: var(--text);
  background: var(--surface);
  margin-bottom: 12px;
  transition: border-color 0.2s;
}

.admin-input:focus {
  outline: none;
  border-color: var(--eu-blue-light);
  box-shadow: 0 0 0 2px rgba(0, 85, 204, 0.2);
}

.admin-textarea {
  display: block;
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-family: inherit;
  color: var(--text);
  background: var(--surface);
  resize: vertical;
  min-height: 120px;
  margin-bottom: 14px;
  transition: border-color 0.2s;
}

.admin-textarea:focus {
  outline: none;
  border-color: var(--eu-blue-light);
  box-shadow: 0 0 0 2px rgba(0, 85, 204, 0.2);
}

.admin-editor-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-btn {
  display: inline-flex;
  align-items: center;
  padding: 9px 18px;
  border: none;
  border-radius: var(--radius);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.admin-btn--draft {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
}

.admin-btn--draft:hover {
  background: var(--border);
}

.admin-btn--publish {
  background: var(--eu-blue);
  color: #fff;
}

.admin-btn--publish:hover {
  background: var(--eu-blue-light);
}

.admin-btn--cancel {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.admin-btn--cancel:hover {
  background: var(--bg);
  color: var(--text);
}

.admin-posts {
  margin-top: 8px;
}

.admin-posts-heading {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.admin-posts-empty {
  font-size: 0.9rem;
  color: var(--text-secondary);
  padding: 20px 0;
}

.admin-post-item {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 16px 20px;
  margin-bottom: 10px;
}

.admin-post-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.admin-post-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.admin-post-title {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-post-date {
  font-size: 0.75rem;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.admin-post-body {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 10px;
}

.admin-post-source {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-post-source svg {
  flex-shrink: 0;
}

.admin-post-actions {
  display: flex;
  gap: 6px;
}

.admin-btn-sm {
  padding: 5px 12px;
  border: none;
  border-radius: var(--radius);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.admin-btn-sm--edit {
  background: var(--status-planned-bg);
  color: var(--status-planned);
}

.admin-btn-sm--edit:hover {
  background: color-mix(in srgb, var(--status-planned) 25%, var(--surface));
}

.admin-btn-sm--delete {
  background: #fef2f2;
  color: #dc2626;
}

.admin-btn-sm--delete:hover {
  background: #fecaca;
}

html[data-theme="dark"] .admin-btn-sm--delete {
  background: rgba(220, 38, 38, 0.15);
  color: #f87171;
}

html[data-theme="dark"] .admin-btn-sm--delete:hover {
  background: rgba(220, 38, 38, 0.25);
}

.admin-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

.admin-badge--published {
  background: var(--status-inforce-bg);
  color: var(--status-inforce);
}

.admin-badge--draft {
  background: var(--status-inprocess-bg);
  color: var(--status-inprocess);
}
