/* EO UI — page components on top of eo-shell (no Tailwind) */

/* Material Symbols */
.material-symbols-outlined {
  font-family: "Material Symbols Outlined", sans-serif;
  font-weight: normal;
  font-style: normal;
  font-size: 1.25rem;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  -webkit-font-smoothing: antialiased;
  font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 24;
  vertical-align: middle;
  user-select: none;
  flex-shrink: 0;
}
.material-symbols-outlined.md-sm { font-size: 1.05rem; }
.material-symbols-outlined.md-lg { font-size: 1.5rem; }

.hidden { display: none !important; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Welcome account switch */
.welcome-user { position: relative; display: inline-block; max-width: 100%; }
.welcome-switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #fff;
  font: 700 1.05rem/1.25 var(--serif);
  cursor: pointer;
  text-align: left;
}
.welcome-name {
  text-decoration: underline;
  text-underline-offset: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.welcome-caret { font-size: 0.85rem; opacity: 0.9; }
.welcome-dropdown {
  position: absolute;
  left: 0;
  top: calc(100% + 6px);
  z-index: 30;
  min-width: 12rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 2px;
  box-shadow: 0 8px 20px rgba(6, 55, 85, 0.18);
  padding: 4px 0;
}
.welcome-dropdown a {
  display: block;
  padding: 8px 12px;
  color: var(--ink);
  text-decoration: none;
  font: 600 14px/1.3 var(--sans);
}
.welcome-dropdown a:hover { background: #f3f6f8; }

/* Panel extras */
.panel > h1:first-child { margin-top: 0; }
.panel-flush { padding: 0; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack-sm { display: flex; flex-direction: column; gap: 8px; }
.row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}
.row-between {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.grow { flex: 1 1 auto; min-width: 0; }
.muted { color: #637488; }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.italic { font-style: italic; }
.mt-0 { margin-top: 0; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }

.table-wrap { overflow-x: auto; width: 100%; }
.col-hide-md { }
@media (max-width: 767px) {
  .col-hide-md { display: none !important; }
}
.only-desktop { display: none !important; }
@media (min-width: 640px) {
  .only-mobile { display: none !important; }
  .only-desktop { display: block !important; }
}

/* Admin tabs / panels */
.admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  border-bottom: 1px solid var(--line);
  margin: 0 0 1.25rem;
  overflow-x: auto;
}
.admin-tab-btn {
  appearance: none;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  margin-bottom: -1px;
  padding: 0.65rem 0.9rem;
  font: 500 0.875rem/1.2 var(--sans);
  color: #6b7280;
  cursor: pointer;
  white-space: nowrap;
}
.admin-tab-btn:hover { color: #1f2937; }
.admin-tab-btn.is-active {
  color: var(--eo-navy);
  font-weight: 600;
  border-bottom-color: var(--eo-navy);
}
.admin-tab-panel {
  border: 1px solid var(--line);
  border-radius: 2px;
  background: #fff;
  padding: 1rem 1.15rem;
  margin-bottom: 2rem;
}
.admin-tab-panel[hidden] { display: none !important; }
.admin-election-cards {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.admin-election-card {
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 0.75rem;
  background: #fff;
}
.admin-election-card .eo-link-plain {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
}
.admin-election-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}
.form-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.form-check label { font-size: 0.875rem; font-weight: 600; color: #374151; }
.form-hint { margin: 0.35rem 0 0; font-size: 0.875rem; color: #4b5563; }
.field-label {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #374151;
}
.eo-choices-box {
  border: 1px solid var(--line);
  border-radius: 2px;
  background: #fff;
  overflow: hidden;
}
.electors-box {
  background: #f9fafb;
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 0.75rem;
  max-height: 12rem;
  overflow-y: auto;
}
.elector-preview-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 0.45rem 0.65rem;
  margin-bottom: 0.5rem;
}
.elector-preview-row:last-child { margin-bottom: 0; }
.elector-preview-name {
  min-width: 0;
  font-weight: 600;
  color: #1f2937;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Badges (status) */
.badge-yes { background: #dcfce7; color: #166534; }
.badge-no { background: #fee2e2; color: #991b1b; }
.badge-done { background: #f3f4f6; color: #374151; }
.badge-warn-icon {
  color: #c2410c;
  font-size: 1.05rem !important;
  vertical-align: middle;
}

/* Alerts / flash */
.alert {
  padding: 12px 14px;
  border-radius: 2px;
  border: 1px solid var(--line);
  margin-bottom: 16px;
  font-size: 14px;
}
.alert-ok { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }
.alert-err { background: #fef2f2; border-color: #fecaca; color: #9b1c1c; }
.alert-info { background: #eff6ff; border-color: #bfdbfe; color: #1e3a5f; }
.alert-warn { background: #fffbeb; border-color: #fde68a; color: #92400e; }

.admin-callout {
  margin-top: 1.5rem;
  padding: 14px 16px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 2px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
}
.admin-callout-text { flex: 1 1 16rem; min-width: 0; }
.admin-callout h2 {
  margin: 0 0 6px;
  font: 700 1.05rem/1.3 var(--serif);
  color: #1e3a5f;
}
.admin-callout p { margin: 0; color: var(--eo-ink); }
.admin-callout .eo-btn { flex-shrink: 0; }

/* Home: official forum announcements */
.home-announcements {
  margin-top: 2.5rem;
}
.home-announcements-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  padding-bottom: 12px;
  border-bottom: 3px solid var(--eo-cyan);
}
.home-announcements-head h2 {
  margin: 0;
  color: #333;
  font: 700 1.65rem/1.2 var(--serif);
}
.home-announcements-all {
  gap: 8px;
}
.home-announcements-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
  padding-top: 24px;
}
.home-announcement {
  min-width: 0;
}
.home-announcement-label {
  margin: 0 0 10px;
  color: #444;
  font: 700 0.78rem/1.25 var(--sans);
  letter-spacing: 0.025em;
  text-transform: uppercase;
}
.home-announcement h3 {
  margin: 0;
  font: 400 1rem/1.45 var(--sans);
}
.home-announcement h3 a {
  color: #333;
  text-decoration-line: underline;
  text-decoration-style: dotted;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}
.home-announcement h3 a:hover {
  color: var(--eo-navy-hover);
  text-decoration-style: solid;
}
.home-announcement time {
  display: block;
  margin-top: 8px;
  color: #637488;
  font: 400 0.78rem/1.3 var(--sans);
}
@media (min-width: 640px) {
  .home-announcements-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (min-width: 1024px) {
  .home-announcements-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 28px;
  }
}

/* Forms */
.form-inline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}
.form-inline label { font-size: 0.875rem; font-weight: 600; color: #555; }
.form-grid {
  display: grid;
  gap: 12px;
}
.form-grid .field { margin-bottom: 0; }
@media (min-width: 640px) {
  .form-grid-2 { grid-template-columns: 1fr 1fr; }
  .form-grid-3 { grid-template-columns: 1fr 1fr 1fr; }
}
.field-inline {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 10rem;
}
.field-inline span,
.field-inline label {
  font-size: 12px;
  font-weight: 600;
  color: #555;
}
.input,
.select,
.textarea,
.field input,
.field select,
.field textarea,
.field-inline input,
.field-inline select,
.field-inline textarea {
  border: 1px solid #c5cad3;
  border-radius: 2px;
  padding: 8px 10px;
  font: 400 14px var(--sans);
  background: #fff;
  color: var(--ink);
  box-sizing: border-box;
  max-width: 100%;
}
.input:focus,
.select:focus,
.textarea:focus,
.field input:focus,
.field select:focus,
.field textarea:focus,
.field-inline input:focus,
.field-inline select:focus {
  outline: 2px solid var(--eo-navy);
  outline-offset: 1px;
}
.w-full { width: 100%; }
.w-filter { width: 100%; max-width: 20rem; }

/* Tabs */
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 16px;
}
.tab {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 10px 14px;
  font: 600 14px/1 var(--sans);
  color: #555;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
}
.tab:hover { color: var(--eo-navy); }
.tab.is-active {
  color: var(--eo-navy);
  border-bottom-color: var(--eo-navy);
}
.tab-panel[hidden] { display: none !important; }

/* Pagination */
.pager {
  margin-top: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.pager-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  justify-content: flex-end;
}

/* Meta / details */
.meta-list p { margin: 0 0 6px; }
.meta-grid {
  display: grid;
  gap: 1rem;
}
@media (min-width: 640px) {
  .meta-grid { grid-template-columns: 1fr 1fr; }
}
.section-block { margin-top: 1.25rem; }
.section-block > h2 {
  margin: 0 0 10px;
  font: 700 1.15rem/1.3 var(--serif);
}

/* Compare picker */
.compare-picker {
  margin-bottom: 2rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: #f9fafb;
}
.compare-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.compare-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: #fff;
  font-size: 0.875rem;
  cursor: pointer;
}
.compare-chip.is-on {
  border-color: var(--eo-navy);
  background: rgba(6, 55, 85, 0.08);
}

/* House seat distribution bar */
.seat-bar-card {
  margin-bottom: 1rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: #fff;
}
.seat-bar-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.seat-bar-head strong { font-size: 0.875rem; color: #1f2937; }
.seat-bar-head .muted { font-size: 0.75rem; font-variant-numeric: tabular-nums; }
.seat-bar {
  position: relative;
  display: flex;
  height: 1.75rem;
  overflow: hidden;
  border-radius: 2px;
  background: #f3f4f6;
  border: 1px solid rgba(229, 231, 235, 0.9);
}
@media (min-width: 640px) {
  .seat-bar { height: 2rem; }
}
.seat-bar-seg {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  font-size: 0.65rem;
  font-weight: 600;
  color: rgba(17, 24, 39, 0.8);
}
@media (min-width: 640px) {
  .seat-bar-seg { font-size: 0.75rem; }
}
.result-majority-marker {
  position: absolute;
  top: -3px;
  bottom: -3px;
  z-index: 10;
  width: 3px;
  border-radius: 1px;
  background: #475569;
  box-shadow:
    0 0 0 2px rgba(255, 255, 255, 0.78),
    0 0 0 3px rgba(71, 85, 105, 0.16);
  transform: translateX(-50%);
  pointer-events: none;
}
.seat-bar-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.75rem;
  margin-top: 0.5rem;
  font-size: 0.7rem;
  color: #4b5563;
}
.seat-bar-swatch {
  display: inline-block;
  width: 0.625rem;
  height: 0.625rem;
  border-radius: 2px;
  border: 1px solid #d1d5db;
  flex-shrink: 0;
  vertical-align: middle;
}
.footnote { margin: 1.5rem 0; font-size: 0.75rem; color: #6b7280; line-height: 1.55; }
.input.is-locked,
.textarea.is-locked,
select.is-locked {
  background: #f3f4f6;
  color: #4b5563;
}

/* Empty */
.empty {
  text-align: center;
  padding: 2rem 1rem;
  color: #637488;
}

/* Choice rows (admin/edit) — .eo-choice-grid lays out; row is only a shell */
.eo-choices-head {
  display: none;
  gap: 8px;
  padding: 6px 10px;
  background: #f9fafb;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6b7280;
  border-bottom: 1px solid #e5e7eb;
}
.eo-choice-row {
  border-bottom: 1px solid #f3f4f6;
  padding: 10px;
}
.eo-choice-row:hover { background: rgba(249, 250, 251, 0.7); }
.eo-choice-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}
@media (min-width: 640px) {
  .eo-choice-actions { justify-content: flex-end; }
  .eo-choice-row { padding: 8px 10px; }
}
.eo-choice-input {
  width: 100%;
  border: 1px solid #d1d5db;
  border-radius: 2px;
  padding: 6px 8px;
  font-size: 14px;
  box-sizing: border-box;
}
.eo-choice-input:focus {
  outline: 2px solid var(--eo-navy);
  outline-offset: 1px;
}

/* Admin / edit dense layouts */
.admin-split {
  display: grid;
  gap: 20px;
}
@media (min-width: 960px) {
  .admin-split-2 { grid-template-columns: 1fr 1fr; }
}
.card-soft {
  border: 1px solid var(--line);
  border-radius: 2px;
  background: #f9fafb;
  padding: 14px 16px;
}
.list-plain { list-style: none; margin: 0; padding: 0; }
.list-plain li {
  padding: 8px 0;
  border-bottom: 1px solid #eee;
}
.list-plain li:last-child { border-bottom: 0; }

/* Info / electors (semantic) */
.info-card {
  margin-bottom: 1.25rem;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: #f8fafb;
}
.info-card > h2 {
  margin: 0 0 8px;
  font: 700 1.05rem/1.3 var(--serif);
  color: var(--eo-navy);
}
.info-card-body,
.info-card-preview {
  font-family: var(--serif);
  font-size: 0.95rem;
  line-height: 1.55;
  color: #1f2937;
  overflow-wrap: anywhere;
}
.info-card details summary { cursor: pointer; list-style: none; }
details > summary {
  list-style: none;
  background: transparent;
  border: 0;
}
details > summary::-webkit-details-marker { display: none; }
.elector-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr;
}
@media (min-width: 640px) {
  .elector-grid { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 1024px) {
  .elector-grid { grid-template-columns: 1fr 1fr 1fr; }
}
.elector-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 8px;
  background: #f9fafb;
  border: 1px solid var(--line);
  border-radius: 2px;
  font-size: 0.875rem;
  color: #1f2937;
}
.elector-mark {
  flex-shrink: 0;
  font-size: 1.15rem !important;
  line-height: 1;
}
.elector-mark-yes { color: #16a34a; }
.elector-mark-no { color: #cbd5e1; }
.details-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: 2.75rem;
  margin-bottom: 0.5rem;
  cursor: pointer;
  list-style: none;
  background: transparent;
  border: 0;
}
.details-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  color: #637488;
  font-size: 0.875rem;
}
.details-toggle .material-symbols-outlined { font-size: 1.15rem; }
.details-toggle-open { display: none; }
details[open] > .details-summary .details-toggle-closed { display: none; }
details[open] > .details-summary .details-toggle-open { display: inline-flex; }
.eo-choice-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  align-items: center;
}
@media (min-width: 640px) {
  .eo-choice-grid,
  .eo-choices-head {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, 1.1fr) auto;
    align-items: center;
  }
  .eo-choice-grid.has-color,
  .eo-choices-head.has-color {
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, 1.1fr) 5.5rem auto;
  }
  .eo-choice-field-label { display: none !important; }
}
.eo-choice-field-label {
  display: block;
  font-size: 11px;
  color: #6b7280;
  margin-bottom: 2px;
}

/* Admin overview stats */
.admin-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 1.5rem;
}
@media (min-width: 640px) {
  .admin-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.admin-stat {
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 12px;
  background: #f9fafb;
}
.admin-stat-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6b7280;
}
.admin-stat-value {
  font-size: 1.35rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.3;
}
.admin-stat-links {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  background: #fff;
}

/* Calendar production layout */
.cal-month-wrap {
  margin-bottom: 2rem;
}
.cal-month-layout {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.cal-month-main {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: #f9fafb;
}
.cal-month-aside {
  border: 1px solid var(--line);
  border-radius: 2px;
  background: #f9fafb;
  padding: 1rem;
}
/* Mobile: Legende oben; Desktop: Kalender links (DOM-Reihenfolge), Legende rechts */
@media (max-width: 1023px) {
  .cal-month-aside { order: -1; }
}
@media (min-width: 1024px) {
  .cal-month-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) min(16rem, 100%);
    gap: 1.5rem;
    align-items: start;
  }
  .cal-month-aside { position: sticky; top: 1rem; }
}
.cal-month-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 0.75rem;
}
@media (min-width: 640px) {
  .cal-month-table { font-size: 0.875rem; }
}
.cal-month-table caption {
  border-bottom: 1px solid var(--line);
  background: #fff;
  padding: 0.65rem 0.75rem;
  text-align: left;
}
.cal-month-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.cal-month-nav strong {
  font: 700 1rem/1.2 var(--serif);
  color: var(--eo-ink);
}
.cal-month-table th {
  width: 14.2857%;
  border: 1px solid var(--line);
  padding: 0.35rem;
  text-align: center;
  background: #f3f4f6;
  color: #374151;
  font-weight: 600;
}
.cal-month-cell {
  width: 14.2857%;
  border: 1px solid var(--line);
  vertical-align: top;
  padding: 0.35rem;
  min-height: 5.5rem;
  background: #fff;
  overflow: hidden;
}
@media (min-width: 640px) {
  .cal-month-cell {
    min-height: 6.5rem;
    padding: 0.4rem;
  }
}
.cal-month-cell.is-out {
  background: #f9fafb;
  color: #9ca3af;
}
.cal-month-cell.is-today {
  box-shadow: inset 0 0 0 1px rgba(6, 55, 85, 0.35);
}
.cal-month-daynum {
  display: block;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  margin-bottom: 0.25rem;
}
.cal-month-cell.is-today .cal-month-daynum { color: var(--eo-navy); }
.cal-badge {
  display: block;
  max-width: 100%;
  box-sizing: border-box;
  padding: 0.15rem 0.35rem;
  border-radius: 2px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #fff;
}
@media (min-width: 640px) {
  .cal-badge { font-size: 10px; padding: 0.2rem 0.4rem; }
}
.cal-event-pill {
  position: relative;
  display: block;
  max-width: 100%;
  min-width: 0;
  text-decoration: none;
  color: inherit;
  border-radius: 2px;
  cursor: pointer;
}
a.cal-event-pill:hover .cal-badge {
  filter: brightness(0.94);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.18);
}
.cal-event-pill:focus { outline: none; }
.cal-event-pill:focus-visible {
  outline: 2px solid var(--eo-navy);
  outline-offset: 1px;
}
.cal-event-pill__tip {
  position: absolute;
  left: 0;
  top: calc(100% + 4px);
  z-index: 50;
  width: max-content;
  max-width: min(14rem, 50vw);
  padding: 0.4rem 0.6rem;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--eo-ink);
  background: #fff;
  border: 1px solid #b8c5cf;
  border-radius: 2px;
  box-shadow: 0 6px 16px rgba(6, 55, 85, 0.14);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.15s ease, visibility 0.15s;
  text-align: left;
  overflow-wrap: anywhere;
}
@media (hover: hover) and (pointer: fine) {
  .cal-event-pill:hover .cal-event-pill__tip {
    opacity: 1;
    visibility: visible;
  }
}
.cal-event-pill:focus .cal-event-pill__tip,
.cal-event-pill:focus-within .cal-event-pill__tip {
  opacity: 1;
  visibility: visible;
}
/* Tooltips dürfen aus der Zelle ragen */
.cal-month-cell:hover,
.cal-month-cell:focus-within {
  overflow: visible;
  position: relative;
  z-index: 2;
}
.cal-day-events {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.2rem;
  list-style: none;
  margin: 0;
  padding: 0;
  min-width: 0;
  max-width: 100%;
}
.cal-day-events > li {
  min-width: 0;
  max-width: 100%;
}
.cal-legend-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  font-size: 0.875rem;
}
.cal-legend-list li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.cal-legend-list .cal-badge {
  display: inline-block;
  width: auto;
  flex-shrink: 0;
}
.cal-marker-form {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}
@media (min-width: 640px) {
  .cal-marker-form {
    grid-template-columns: minmax(0, 1.4fr) minmax(9rem, 1fr) minmax(9rem, 1fr) auto;
    align-items: end;
  }
  .cal-marker-form .cal-marker-title { grid-column: 1 / -1; }
  .cal-marker-form .cal-marker-actions {
    display: flex;
    align-items: flex-end;
    padding-bottom: 1px;
  }
}
.cal-marker-field {
  display: grid;
  gap: 0.25rem;
}
.cal-marker-field > span {
  font-size: 12px;
  font-weight: 600;
  color: #555;
}

/* Results tables */
.results-table-wrap {
  overflow-x: auto;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: #fff;
}
.results-table {
  width: 100%;
  border-collapse: collapse;
  font: 400 0.875rem/1.4 var(--serif);
  min-width: 18rem;
}
.results-table thead th {
  background: #f9fafb;
  text-align: left;
  font: 600 0.7rem/1.2 var(--sans);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #6b7280;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--line);
}
.results-table thead th.is-num { text-align: right; }
.results-table td {
  padding: 0.45rem 0.75rem;
  border-bottom: 1px solid #f3f4f6;
  vertical-align: middle;
  color: #111827;
}
.results-table td.is-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.results-table td.is-name { font-weight: 600; }
.results-table tbody tr:last-child td { border-bottom: 0; }
.results-table tfoot td {
  background: #f9fafb;
  border-top: 1px solid var(--line);
  font: 700 0.75rem/1.3 var(--sans);
  text-transform: uppercase;
  color: #374151;
  padding: 0.5rem 0.75rem;
}
.results-table tfoot td.is-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  text-transform: none;
}
.results-table.results-table--dense td,
.results-table.results-table--dense thead th {
  padding: 0.35rem 0.5rem;
}
.compare-results-table {
  border-collapse: collapse;
}
.compare-results-table--party { min-width: 28rem; }
.compare-results-table--affiliation { min-width: 36rem; }
.chg-up { color: #15803d; }
.chg-down { color: #b91c1c; }
.chg-zero { color: #6b7280; }

/* Party / affiliation admin grids */
.eo-dense-grid {
  display: grid;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
}
.eo-dense-grid-head {
  display: none;
  gap: 8px;
  padding: 6px 10px;
  background: #f9fafb;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6b7280;
  border-bottom: 1px solid var(--line);
}
@media (min-width: 640px) {
  .eo-dense-grid-head { display: grid; }
  .eo-dense-grid--party,
  .eo-dense-grid-head--party {
    grid-template-columns: 4rem minmax(0, 1.5fr) 5.75rem 6.25rem auto;
  }
  .eo-dense-grid--aff,
  .eo-dense-grid-head--aff {
    grid-template-columns: 5.5rem minmax(0, 1fr) auto;
  }
}
.eo-dense-grid--party {
  grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid #f3f4f6;
}
.eo-dense-grid--aff {
  grid-template-columns: 6.5rem minmax(0, 1fr);
  border-bottom: 1px solid #f3f4f6;
}
.eo-dense-grid--party:hover,
.eo-dense-grid--aff:hover { background: rgba(249, 250, 251, 0.6); }
.eo-dense-grid--new {
  margin-top: 0;
  border: 0;
  border-top: 1px dashed #d1d5db;
  border-radius: 0;
  background: #f9fafb;
}
.eo-dense-grid .eo-choice-field-label { display: block; }
@media (min-width: 640px) {
  .eo-dense-grid .eo-choice-field-label { display: none !important; }
}
.eo-dense-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  grid-column: 1 / -1;
}
@media (min-width: 640px) {
  .eo-dense-actions {
    grid-column: auto;
    justify-content: flex-end;
  }
}

/* Admin create form */
.admin-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.admin-form-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}
.admin-form-section {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #eef1f4;
}
.admin-form-section:last-of-type { border-bottom: 0; padding-bottom: 0; }
.admin-form-heading {
  margin: 0 0 0.15rem;
  font: 700 1rem/1.3 var(--serif);
  color: var(--eo-navy);
}
.admin-form-actions { margin-top: 0.25rem; }
.field-narrow { max-width: 11rem; }
.field-grow { min-width: 0; }
.form-hint-flush { margin-top: 1.55rem; }
.form-grid-votes {
  display: grid;
  gap: 12px;
  align-items: start;
}
@media (min-width: 640px) {
  .form-grid-votes { grid-template-columns: auto minmax(0, 1fr); }
}
.admin-option-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem 1.25rem;
}
.admin-option-row .form-check { margin-bottom: 0; }
.admin-electors-grid {
  display: grid;
  gap: 0.75rem;
}
@media (min-width: 720px) {
  .admin-electors-grid { grid-template-columns: 1fr 1fr; }
}
.eo-dense-box {
  border: 1px solid var(--line);
  border-radius: 2px;
  background: #fff;
  overflow: hidden;
}
.eo-dense-box--scroll {
  max-height: 28rem;
  overflow-y: auto;
}
.eo-dense-empty {
  margin: 0;
  padding: 0.75rem 0.65rem;
}
.eo-color-swatch-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 2.15rem;
}
.eo-color-swatch {
  display: inline-block;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 2px;
  border: 1px solid var(--line);
  flex-shrink: 0;
}

/* Export copy */
.export-block-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.font-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

/* History timeline */
.eo-history-panel {
  border: 1px solid var(--line);
  border-radius: 2px;
  background: #f8fafb;
  padding: 0.85rem 1rem;
}
.eo-history-toggle {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  font: inherit;
  color: inherit;
  cursor: pointer;
  text-align: left;
}
.eo-timeline {
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0 0 0 0.85rem;
  border-left: 2px solid #c5cad3;
}
.eo-timeline-item {
  position: relative;
  padding: 0 0 0.85rem 0.85rem;
}
.eo-timeline-item:last-child { padding-bottom: 0; }
.eo-timeline-item::before {
  content: "";
  position: absolute;
  left: -0.95rem;
  top: 0.35rem;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--eo-navy);
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px #c5cad3;
}
.eo-timeline-meta {
  font-size: 0.8rem;
  color: #6b7280;
  margin-bottom: 0.15rem;
}
.eo-timeline-action {
  font-size: 0.9rem;
  color: #1f2937;
  font-weight: 600;
}

.archive-filters .input.grow { min-width: 12rem; flex: 1 1 12rem; }
.mb-0 { margin-bottom: 0 !important; }
.mt-6 { margin-top: 1.5rem; }
.row { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
