:root {
  --ink: #121b29;
  --muted: #5d6878;
  --line: #dfe5ee;
  --line-strong: #c6d0de;
  --panel: rgba(255, 255, 255, 0.88);
  --panel-strong: rgba(255, 255, 255, 0.96);
  --paper: #f7f8fb;
  --navy: #163765;
  --navy-dark: #102742;
  --blue: #2d6fb6;
  --red: #b2303d;
  --red-dark: #8e2330;
  --gold: #b98a3b;
  --green: #2f765f;
  --shadow: 0 18px 42px rgba(18, 27, 41, 0.11);
  --shadow-soft: 0 10px 28px rgba(18, 27, 41, 0.08);
  --focus: 0 0 0 4px rgba(45, 111, 182, 0.18);
}

body.admin-mode {
  background: #eef2f7;
}

body.admin-mode .site-header,
body.admin-mode .hero,
body.admin-mode .summary-panel,
body.admin-mode footer {
  display: none;
}

body.admin-mode main,
body.admin-mode .workspace {
  display: block;
  padding: 0;
  max-width: none;
}

#panel-admin > :not(.admin-shell) {
  display: none;
}

body.admin-mode #panel-admin {
  display: block;
  padding: 0;
}

.admin-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  color: #162033;
  background: #eef2f7;
}

.admin-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 20px;
  background: #132b4d;
  color: #fff;
}

.admin-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
}

.admin-brand small {
  display: block;
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.72);
  font-weight: 700;
}

.admin-sidebar nav {
  display: grid;
  gap: 5px;
  overflow: auto;
}

.admin-sidebar nav button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 40px;
  padding: 10px 12px;
  color: rgba(255, 255, 255, 0.82);
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 7px;
}

.admin-sidebar nav button.is-active,
.admin-sidebar nav button:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.16);
}

.admin-sidebar nav span,
.admin-notification-pill {
  min-width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 900;
}

.admin-sidebar #leave-admin {
  margin-top: auto;
  color: #132b4d;
  background: #fff;
}

.admin-workbench {
  min-width: 0;
  padding: 22px clamp(18px, 3vw, 36px) 40px;
}

.admin-topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 480px) auto;
  align-items: center;
  gap: 16px;
  padding: 14px 0 18px;
  background: rgba(238, 242, 247, 0.92);
  backdrop-filter: blur(16px);
}

.admin-topbar h2,
.admin-topbar p,
.admin-metric p,
.admin-panel h3,
.admin-row p,
.activity-row p {
  margin: 0;
}

.admin-topbar h2 {
  font-size: clamp(1.45rem, 2.4vw, 2rem);
}

.admin-topbar p,
.admin-help {
  color: var(--muted);
}

.admin-global-search {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.admin-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 12px;
}

.admin-metric,
.admin-panel,
.admin-row,
.activity-row,
.admin-form,
.admin-filterbar,
.admin-detail {
  background: #fff;
  border: 1px solid #dce3ee;
  border-radius: 8px;
  box-shadow: 0 8px 22px rgba(18, 27, 41, 0.06);
}

.admin-metric {
  min-height: 104px;
  padding: 18px;
  text-align: left;
}

.admin-metric span {
  display: block;
  font-size: 2rem;
  font-weight: 900;
  color: var(--navy);
}

.admin-dashboard-grid,
.admin-search-results {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.admin-panel,
.admin-detail,
.admin-form {
  padding: 16px;
}

.admin-panel h3 {
  margin-bottom: 12px;
}

.admin-panel button,
.admin-list button {
  width: 100%;
  display: grid;
  gap: 4px;
  padding: 12px;
  margin-top: 8px;
  color: inherit;
  text-align: left;
  background: #f7f9fc;
  border: 1px solid #e2e8f1;
  border-radius: 7px;
}

.admin-panel button span,
.admin-list button span,
.admin-list button em,
.admin-row p,
.activity-row span,
.activity-row time {
  color: var(--muted);
  font-size: 0.88rem;
}

.admin-filterbar {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr)) auto;
  gap: 8px;
  padding: 12px;
  margin-bottom: 14px;
}

.admin-split {
  display: grid;
  grid-template-columns: minmax(260px, 360px) minmax(0, 1fr);
  gap: 14px;
}

.admin-list {
  display: grid;
  align-content: start;
  gap: 8px;
}

.admin-list button.is-active {
  background: #eaf1fb;
  border-color: rgba(45, 111, 182, 0.45);
}

.admin-detail-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.admin-history {
  padding: 12px;
  margin: 12px 0;
  background: #f7f9fc;
  border-radius: 7px;
}

.admin-history p,
.admin-comments p {
  margin: 6px 0;
}

.admin-create-panel {
  margin-bottom: 14px;
}

.admin-create-panel summary {
  cursor: pointer;
  font-weight: 900;
}

.admin-comments {
  display: grid;
  gap: 10px;
  padding: 12px;
  margin: 12px 0;
  background: #f7f9fc;
  border-radius: 7px;
}

.admin-comments h4 {
  margin: 0;
}

.admin-comments article {
  padding: 10px;
  background: #fff;
  border: 1px solid #e2e8f1;
  border-radius: 7px;
}

.admin-comments time {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.82rem;
}

.public-content-admin .admin-table h3 {
  margin: 0 0 8px;
}

.admin-config-form textarea {
  min-height: 150px;
}

.parliament-admin {
  display: grid;
  gap: 14px;
}

.parliament-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(260px, 0.8fr);
  gap: 12px;
}

.parliament-create-card,
.parliament-add-column {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(140px, 0.5fr) minmax(140px, 0.5fr) auto;
  gap: 8px;
}

.parliament-add-column {
  grid-template-columns: minmax(180px, 1fr) auto;
}

.parliament-board {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(280px, 320px);
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 10px;
}

.parliament-column {
  display: flex;
  flex-direction: column;
  min-height: 420px;
  max-height: 72vh;
  background: #f7f9fc;
  border: 1px solid #dce3ee;
  border-radius: 8px;
}

.parliament-column header {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
  align-items: center;
  padding: 12px;
  border-bottom: 1px solid #e2e8f1;
}

.parliament-column h3 {
  margin: 0;
  font-size: 1rem;
  text-transform: capitalize;
}

.parliament-column header span {
  min-width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  color: var(--navy);
  background: #fff;
  border: 1px solid #dce3ee;
  border-radius: 999px;
  font-weight: 900;
}

.icon-button {
  width: 28px;
  height: 28px;
  min-height: 28px;
  border: 1px solid #dce3ee;
  border-radius: 6px;
  background: #fff;
}

.parliament-card-list {
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 340px;
  padding: 12px;
  overflow-y: auto;
}

.parliament-card {
  position: relative;
  display: grid;
  gap: 6px;
  width: 100%;
  padding: 12px 12px 12px 16px;
  color: inherit;
  text-align: left;
  background: #fff;
  border: 1px solid #dce3ee;
  border-left: 5px solid var(--blue);
  border-radius: 8px;
  box-shadow: 0 6px 16px rgba(18, 27, 41, 0.06);
}

.parliament-card.is-selected {
  border-color: rgba(45, 111, 182, 0.52);
  box-shadow: var(--focus);
}

.parliament-card span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.parliament-card small {
  color: var(--muted);
}

.parliament-card.type-amendement {
  border-left-color: #2d6fb6;
}

.parliament-card.type-proposition-de-loi {
  border-left-color: #2f765f;
}

.parliament-card.type-question-ecrite,
.parliament-card.type-question-orale {
  border-left-color: #b98a3b;
}

.parliament-card.type-intervention-en-seance {
  border-left-color: #7b61b5;
}

.parliament-card.type-courrier-ministeriel {
  border-left-color: #b2303d;
}

.parliament-detail-panel {
  max-width: 1180px;
}

.parliament-description-field {
  margin-top: 10px;
}

.parliament-description {
  min-height: 280px;
  line-height: 1.55;
}

.parliament-empty-detail {
  max-width: 720px;
}

.status-chip {
  align-self: start;
  padding: 7px 10px;
  color: #fff;
  background: var(--navy);
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 900;
}

.status-chip.urgente,
.danger {
  background: var(--red);
  color: #fff;
}

.contacts-admin {
  display: grid;
  gap: 14px;
}

.contact-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.contact-tabs button {
  min-height: 38px;
  padding: 8px 12px;
  color: var(--navy);
  font-weight: 850;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.contact-tabs button.is-active {
  color: #fff;
  background: var(--navy);
  border-color: var(--navy);
}

.contact-search-panel,
.contact-import-panel {
  display: grid;
  gap: 12px;
  padding: 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 12px 24px rgba(18, 27, 41, 0.06);
}

.contact-search-head {
  display: grid;
  grid-template-columns: minmax(260px, 0.7fr) minmax(260px, 1fr);
  gap: 12px;
  align-items: end;
}

.contact-search-head h3,
.contact-search-head p {
  margin: 0;
}

.contact-search-primary-actions {
  display: grid;
  grid-template-columns: auto auto;
  gap: 8px;
  justify-content: start;
}

.contact-filter-section {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.contact-filter-section summary {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 12px;
  color: var(--navy);
  font-weight: 900;
  cursor: pointer;
  list-style: none;
}

.contact-filter-section summary::-webkit-details-marker {
  display: none;
}

.contact-filter-section summary::after {
  content: "+";
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
}

.contact-filter-section[open] summary {
  border-bottom: 1px solid var(--line);
  background: #f8fafc;
}

.contact-filter-section[open] summary::after {
  content: "-";
}

.contact-filter-section > fieldset,
.contact-filter-section > .contact-filter-grid,
.contact-filter-section > .contact-age-filter,
.contact-filter-section > .contact-pagination-controls,
.contact-filter-section > .data-actions {
  margin: 12px;
}

.contact-age-filter {
  display: grid;
  gap: 10px;
  padding: 12px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.contact-age-filter > div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.contact-age-filter strong {
  color: var(--navy);
}

.contact-age-filter span {
  color: var(--muted);
  font-weight: 850;
}

.contact-age-range {
  position: relative;
  min-height: 34px;
  display: grid;
  align-items: center;
}

.contact-age-range::before {
  content: "";
  position: absolute;
  right: 6px;
  left: 6px;
  height: 6px;
  background: repeating-linear-gradient(90deg, var(--line) 0 2px, transparent 2px calc(100% / 12)), linear-gradient(90deg, #edf2f7, #e8eef7);
  border-radius: 999px;
}

.contact-age-range input[type="range"] {
  position: relative;
  grid-area: 1 / 1;
  width: 100%;
  min-height: 34px;
  padding: 0;
  background: transparent;
  border: 0;
  pointer-events: none;
  appearance: none;
}

.contact-age-range input[type="range"]::-webkit-slider-thumb {
  width: 24px;
  height: 24px;
  background: var(--red);
  border: 3px solid #fff;
  border-radius: 999px;
  box-shadow: 0 4px 10px rgba(18, 27, 41, 0.2);
  pointer-events: auto;
  appearance: none;
}

.contact-age-range input[type="range"]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  background: var(--red);
  border: 3px solid #fff;
  border-radius: 999px;
  box-shadow: 0 4px 10px rgba(18, 27, 41, 0.2);
  pointer-events: auto;
}

.contact-age-scale {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
}

.contact-filter-grid,
.contact-form-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 10px;
}

.contact-filter-grid label,
.contact-form-grid label {
  min-width: 0;
}

.contact-form-grid label:has(textarea) {
  grid-column: span 2;
}

.contact-split {
  margin-top: 14px;
}

.contact-pagination-controls,
.contact-keyword-mode {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.contact-pagination-controls label {
  min-width: 180px;
}

.contact-result-row {
  display: grid;
  gap: 8px;
  align-items: stretch;
}

.contact-result-main {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 8px;
  align-items: stretch;
}

.contact-result-row button {
  width: 100%;
}

.contact-result-row.is-active button {
  border-color: var(--red);
  background: #fff8f8;
}

.contact-inline-detail {
  display: none;
}

.contact-select-line {
  display: grid;
  place-items: center;
  min-height: 68px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.contact-result-list button em {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-style: normal;
}

.contact-detail-form {
  overflow: hidden;
}

.contact-csv-mapping {
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.contact-csv-mapping h4,
.contact-csv-mapping p {
  margin: 0;
}

.contact-csv-map-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 10px;
}

.contact-csv-map-grid small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.keyword-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 8px;
  border-radius: 999px;
  vertical-align: middle;
}

.admin-crud {
  display: grid;
  grid-template-columns: minmax(280px, 380px) minmax(0, 1fr);
  gap: 14px;
}

.admin-table {
  display: grid;
  gap: 10px;
}

.admin-row,
.activity-row {
  padding: 14px;
}

.admin-row {
  display: grid;
  grid-template-columns: minmax(180px, 300px) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.admin-row form,
.admin-user-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(140px, 1fr));
  gap: 10px;
}

.admin-row textarea {
  min-height: 90px;
}

.admin-user-actions {
  grid-template-columns: repeat(3, minmax(140px, 1fr));
}

.activity-row {
  display: grid;
  grid-template-columns: 140px 180px 1fr;
  gap: 10px;
}

.admin-row.is-unread {
  border-color: rgba(178, 48, 61, 0.35);
  background: #fff8f8;
}

@media (max-width: 1080px) {
  .admin-shell,
  .admin-split,
  .admin-crud,
  .admin-row {
    grid-template-columns: 1fr;
  }

  .admin-sidebar {
    position: relative;
    height: auto;
  }

  .admin-sidebar nav,
  .admin-metrics,
  .admin-dashboard-grid,
  .admin-search-results {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-topbar,
  .admin-filterbar,
  .contact-search-head,
  .parliament-toolbar,
  .parliament-create-card,
  .parliament-add-column {
    grid-template-columns: 1fr;
  }

  .contact-filter-grid,
  .contact-form-grid,
  .contact-csv-map-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .admin-sidebar nav,
  .admin-metrics,
  .admin-dashboard-grid,
  .admin-search-results,
  .admin-row form,
  .admin-user-actions,
    .activity-row,
    .contact-filter-grid,
    .contact-form-grid,
    .contact-csv-map-grid {
    grid-template-columns: 1fr;
  }

  .contact-form-grid label:has(textarea) {
    grid-column: auto;
  }
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 14% 8%, rgba(45, 111, 182, 0.1), transparent 30vw),
    linear-gradient(180deg, rgba(247, 248, 251, 0.88), rgba(247, 248, 251, 0.98) 560px);
  background-color: var(--paper);
  min-width: 320px;
  overflow-x: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

a,
button,
input,
select,
textarea {
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease, color 160ms ease, transform 160ms ease;
}

button:hover,
.social-button:hover {
  transform: translateY(-1px);
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.rich-editor:focus-visible {
  border-color: rgba(45, 111, 182, 0.62);
  box-shadow: var(--focus);
  outline: 0;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 12px clamp(18px, 4vw, 54px);
  background: rgba(255, 255, 255, 0.84);
  border-bottom: 1px solid rgba(198, 208, 222, 0.78);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8) inset, 0 10px 30px rgba(18, 27, 41, 0.06);
  backdrop-filter: blur(18px);
}

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

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: #fff;
  font-weight: 800;
  background:
    linear-gradient(90deg, #fff 0 31%, transparent 31% 69%, #d73545 69%),
    linear-gradient(135deg, var(--navy), var(--red));
  border-radius: 8px;
  box-shadow: 0 10px 20px rgba(22, 55, 101, 0.18);
}

.brand h1,
.brand p,
.hero p,
footer p {
  margin: 0;
}

.brand h1 {
  font-size: 1.1rem;
  letter-spacing: 0;
}

.eyebrow {
  color: var(--red);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.main-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  flex: 1;
}

.nav-link,
.menu-toggle,
.primary-action,
.secondary-action,
.import-button {
  border: 0;
  border-radius: 8px;
  min-height: 42px;
}

.nav-link {
  padding: 10px 13px;
  color: var(--navy);
  font-weight: 850;
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid rgba(24, 47, 87, 0.12);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.78) inset;
}

.nav-link:hover {
  color: var(--navy-dark);
  background: #fff;
  border-color: rgba(45, 111, 182, 0.28);
}

.nav-link.is-active {
  color: #fff;
  background: linear-gradient(135deg, var(--navy), var(--navy-dark));
  border-color: var(--navy);
  box-shadow: 0 12px 24px rgba(22, 55, 101, 0.2);
}

.account-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 150px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.menu-toggle {
  display: none;
  width: 44px;
  place-items: center;
  background: #fff;
  border: 1px solid var(--line);
}

.menu-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  margin: 3px auto;
  background: var(--ink);
}

.hero {
  position: relative;
  min-height: 62vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 390px);
  align-items: end;
  gap: clamp(24px, 5vw, 64px);
  padding: clamp(54px, 8vw, 108px) clamp(18px, 4vw, 54px) 46px;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 18px clamp(12px, 2vw, 28px) auto auto;
  width: min(34vw, 420px);
  height: 8px;
  background: linear-gradient(90deg, var(--navy) 0 33%, #fff 33% 66%, var(--red) 66%);
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(18, 27, 41, 0.12);
  opacity: 0.88;
}

.hero::after {
  content: "";
  position: absolute;
  right: max(-12vw, -160px);
  bottom: -140px;
  width: min(48vw, 620px);
  aspect-ratio: 1;
  background: radial-gradient(circle, rgba(45, 111, 182, 0.13), transparent 62%);
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
  min-width: 0;
  max-width: 850px;
}

.hero h2 {
  max-width: 780px;
  margin: 10px 0 18px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.45rem, 5.8vw, 5.25rem);
  line-height: 0.96;
  text-wrap: balance;
  overflow-wrap: break-word;
}

.hero p {
  max-width: 720px;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.7;
}

.hero-search {
  display: grid;
  grid-template-columns: minmax(220px, 520px) auto;
  gap: 10px;
  max-width: 760px;
  margin-top: 24px;
}

.hero-search input {
  min-width: 0;
  min-height: 52px;
  background: rgba(255, 255, 255, 0.96);
  border-color: rgba(198, 208, 222, 0.9);
  box-shadow: var(--shadow-soft);
}

.hero-brief {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 12px;
  max-width: 390px;
  padding: 20px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.93), rgba(255, 255, 255, 0.82)),
    linear-gradient(135deg, rgba(45, 111, 182, 0.08), rgba(178, 48, 61, 0.06));
  border: 1px solid rgba(198, 208, 222, 0.82);
  border-radius: 8px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.hero-brief::after {
  content: "";
  position: absolute;
  right: 18px;
  bottom: 18px;
  width: 54px;
  height: 36px;
  background: linear-gradient(90deg, var(--navy) 0 33%, #fff 33% 66%, var(--red) 66%);
  border: 1px solid rgba(198, 208, 222, 0.75);
  border-radius: 4px;
  box-shadow: 0 10px 20px rgba(18, 27, 41, 0.13);
}

.flag-strip {
  display: grid;
  grid-template-columns: repeat(3, 18px);
  gap: 4px;
  height: 26px;
}

.flag-strip span {
  border-radius: 3px;
}

.flag-strip span:nth-child(1) {
  background: var(--navy);
}

.flag-strip span:nth-child(2) {
  background: #fff;
  border: 1px solid var(--line);
}

.flag-strip span:nth-child(3) {
  background: var(--red);
}

.hero-brief h3 {
  margin: 0;
  color: var(--navy);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.8rem;
  line-height: 1;
}

.hero-brief p {
  margin: 0;
  max-width: 280px;
  color: var(--muted);
  line-height: 1.55;
}

.hero-brief-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-right: 62px;
}

.data-actions,
.filters,
.map-actions,
.social-row,
.footer-social-links,
.share-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.primary-action,
.secondary-action,
.import-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 16px;
  font-weight: 800;
}

.primary-action {
  color: #fff;
  background: linear-gradient(135deg, var(--red), var(--red-dark));
  box-shadow: 0 12px 24px rgba(178, 48, 61, 0.22);
}

.primary-action:hover {
  box-shadow: 0 16px 30px rgba(178, 48, 61, 0.28);
}

.secondary-action,
.import-button {
  color: var(--navy);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.82) inset;
}

.secondary-action:hover,
.import-button:hover {
  border-color: rgba(45, 111, 182, 0.34);
  background: #fff;
}

.compact {
  min-height: 34px;
  padding: 7px 10px;
  font-size: 0.8rem;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(190px, 240px) minmax(0, 1fr);
  gap: 24px;
  padding: 0 clamp(18px, 4vw, 54px) 58px;
}

.summary-panel {
  position: sticky;
  top: 92px;
  align-self: start;
  display: grid;
  gap: 10px;
}

.summary-panel div,
.tab-panel,
.timeline-card,
.law-card,
.month-block,
.admin-form,
.data-panel,
.custom-section {
  background: var(--panel);
  border: 1px solid rgba(198, 208, 222, 0.86);
  border-radius: 8px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.summary-panel div {
  position: relative;
  overflow: hidden;
  padding: 18px;
  background: var(--panel-strong);
}

.summary-panel div::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(180deg, var(--navy), var(--red));
}

.summary-panel div:nth-child(4) {
  border-color: rgba(168, 50, 62, 0.25);
}

.metric {
  display: block;
  color: var(--navy);
  font-size: 2.1rem;
  font-weight: 900;
}

.summary-panel p {
  margin: 4px 0 0;
  color: var(--muted);
}

.tab-panel {
  display: none;
  min-height: 520px;
  padding: clamp(18px, 3vw, 30px);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(255, 255, 255, 0.88)),
    radial-gradient(circle at top right, rgba(45, 111, 182, 0.08), transparent 34%);
}

.tab-panel.is-active {
  display: block;
}

.section-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
}

.section-heading h2 {
  margin: 4px 0 0;
  font-size: clamp(1.45rem, 3vw, 2.3rem);
  line-height: 1.15;
  text-wrap: balance;
}

select,
input,
textarea {
  width: 100%;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: 0;
}

select,
input {
  min-height: 42px;
  padding: 9px 11px;
}

textarea {
  min-height: 190px;
  padding: 12px;
  resize: vertical;
}

.timeline {
  position: relative;
  display: grid;
  gap: 16px;
  padding-left: 28px;
}

.timeline::before {
  content: "";
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 8px;
  width: 2px;
  background: linear-gradient(var(--navy), var(--red));
}

.timeline-card {
  position: relative;
  padding: 18px;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.timeline-card::before {
  content: "";
  position: absolute;
  left: -27px;
  top: 24px;
  width: 14px;
  height: 14px;
  background: linear-gradient(135deg, var(--red), var(--navy));
  border: 4px solid var(--paper);
  border-radius: 50%;
}

.timeline-card:hover,
.law-card:hover,
.search-result:hover,
.month-block:hover,
.request-card:hover {
  transform: translateY(-2px);
  border-color: rgba(45, 111, 182, 0.28);
  box-shadow: 0 22px 48px rgba(18, 27, 41, 0.13);
}

.timeline-card time,
.law-card .meta,
.event-date {
  color: var(--red);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
}

.timeline-card h3,
.law-card h3,
.month-block h3,
.data-panel h3,
.custom-section h3 {
  margin: 8px 0;
}

.timeline-card p,
.law-card p,
.data-panel p,
.custom-section p {
  color: var(--muted);
  line-height: 1.58;
}

.agenda-groups {
  display: grid;
  gap: 18px;
}

.agenda-map-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(260px, 0.55fr);
  gap: 18px;
  margin-bottom: 22px;
}

.map-panel,
.commune-panel {
  padding: 18px;
  background: var(--panel-strong);
  border: 1px solid rgba(217, 222, 231, 0.9);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.map-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.map-heading h3,
.commune-panel h3 {
  margin: 0 0 5px;
}

.map-heading p,
.commune-panel p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.map-actions {
  justify-content: flex-end;
}

.haute-saone-map {
  position: relative;
  overflow: hidden;
  min-height: 420px;
  background:
    linear-gradient(135deg, rgba(45, 111, 182, 0.08), rgba(178, 48, 61, 0.05)),
    #fbfbf8;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: grab;
  touch-action: none;
  user-select: none;
  overscroll-behavior: contain;
}

.haute-saone-map.is-dragging {
  cursor: grabbing;
}

.haute-saone-map svg {
  display: block;
  width: 100%;
  height: auto;
  transform-origin: center center;
  transition: transform 160ms ease;
}

.commune-shape {
  fill: #f2f5f9;
  stroke: rgba(24, 47, 87, 0.18);
  stroke-width: 0.8;
  transition: fill 160ms ease, stroke 160ms ease;
}

.commune-shape.has-posts {
  fill: #dfe9f6;
  cursor: pointer;
}

.commune-shape:hover,
.commune-shape.is-selected {
  fill: #d8e2f1;
  stroke: var(--navy);
  stroke-width: 1.6;
}

.paper-pin {
  cursor: pointer;
  filter: drop-shadow(0 7px 8px rgba(23, 32, 43, 0.24));
}

.paper-pin path {
  fill: var(--red);
  stroke: #fff;
  stroke-width: 3;
}

.paper-pin circle {
  fill: #fff;
}

.paper-pin text {
  fill: var(--navy);
  font-size: 11px;
  font-weight: 950;
  pointer-events: none;
}

.paper-pin.is-selected path {
  fill: var(--navy);
}

.commune-posts {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.commune-posts article {
  padding: 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.commune-posts time {
  display: block;
  color: var(--red);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.commune-posts strong {
  display: block;
  margin: 4px 0;
}

.month-block {
  padding: 18px;
}

.month-timeline {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding-left: 18px;
  border-left: 2px solid var(--line);
}

.event-row {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(217, 222, 231, 0.72);
}

.event-row:last-child {
  border-bottom: 0;
}

.event-row h4 {
  margin: 0 0 4px;
}

.event-row p {
  margin: 0;
  color: var(--muted);
}

.event-row.image-right .article-image {
  float: right;
  margin: 2px 0 10px 14px;
}

.moderation-panel {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 12px;
  margin: 0 0 18px;
  padding: 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.moderation-panel label {
  min-width: 170px;
}

.content-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 14px;
}

.law-card {
  padding: 18px;
}

.search-console {
  display: grid;
  gap: 12px;
  margin-bottom: 18px;
}

.search-console input {
  min-height: 52px;
}

.secondary-action.is-selected {
  color: #fff;
  background: var(--navy);
  border-color: var(--navy);
}

.search-results {
  display: grid;
  gap: 12px;
}

.search-result,
.detail-article,
.legal-grid article,
.vote-board,
.video-rail,
.parliament-metrics article,
.mandate-cards article {
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.search-result {
  padding: 16px;
}

.search-result span,
.detail-article .meta {
  color: var(--red);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.search-result h3 {
  margin: 6px 0;
}

.search-result p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.parliament-overview,
.mandate-dashboard {
  display: grid;
  gap: 18px;
  margin-bottom: 18px;
}

.parliament-metrics,
.mandate-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}

.parliament-metrics article,
.mandate-cards article {
  padding: 16px;
}

.parliament-metrics strong,
.mandate-cards strong {
  display: block;
  color: var(--navy);
  font-size: 2rem;
  font-weight: 950;
}

.parliament-metrics article,
.mandate-cards article,
.stat-card {
  position: relative;
  overflow: hidden;
}

.parliament-metrics article::after,
.mandate-cards article::after,
.stat-card::after {
  content: "";
  position: absolute;
  right: -24px;
  top: -24px;
  width: 82px;
  height: 82px;
  background: radial-gradient(circle, rgba(178, 48, 61, 0.12), transparent 68%);
}

.parliament-metrics span,
.mandate-cards span {
  color: var(--muted);
  font-weight: 850;
}

.vote-board,
.video-rail {
  padding: 18px;
}

.vote-row {
  display: grid;
  grid-template-columns: 120px 1fr auto;
  gap: 14px;
  align-items: start;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.vote-row time {
  color: var(--red);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.vote-row p {
  margin: 4px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.vote-position {
  padding: 6px 10px;
  color: #fff;
  font-weight: 900;
  background: var(--green);
  border-radius: 999px;
}

.video-rail {
  margin-top: 18px;
}

.video-rail > div {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
}

.video-rail article {
  display: grid;
  gap: 8px;
}

.mandate-columns {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(280px, 1.1fr);
  gap: 18px;
}

.compact-list {
  display: grid;
  gap: 8px;
}

.compact-list button {
  display: grid;
  gap: 3px;
  width: 100%;
  padding: 12px;
  text-align: left;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.compact-list span,
.compact-list small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
}

.detail-article {
  padding: clamp(18px, 4vw, 34px);
}

.detail-article h2 {
  max-width: 860px;
  margin: 10px 0 16px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 5vw, 4rem);
  line-height: 1;
}

.detail-body {
  max-width: 850px;
  color: var(--ink);
  font-size: 1.05rem;
  line-height: 1.75;
}

.detail-url {
  padding: 10px 12px;
  color: var(--muted);
  overflow-wrap: anywhere;
  background: #f2f4f7;
  border-radius: 8px;
}

.legal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.legal-grid article {
  padding: 18px;
}

.inline-note {
  margin-bottom: 16px;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
}

.tag {
  padding: 6px 9px;
  color: var(--navy);
  font-size: 0.78rem;
  font-weight: 800;
  background: linear-gradient(180deg, #edf4fb, #e8eef7);
  border: 1px solid rgba(45, 111, 182, 0.1);
  border-radius: 999px;
}

.newsletter-form,
.admin-layout {
  display: grid;
  gap: 18px;
}

.auth-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.8fr) minmax(320px, 1.2fr);
  gap: 18px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

label,
legend {
  color: var(--muted);
  font-weight: 800;
}

label input,
label select,
label textarea {
  margin-top: 6px;
}

fieldset {
  margin: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.48);
}

.check-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.check-grid label,
.consent {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--ink);
  font-weight: 650;
}

.check-grid input,
.consent input,
.check-line input {
  width: auto;
  min-height: auto;
  margin: 0;
}

.check-line {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--ink);
}

.feedback {
  min-height: 24px;
  margin: 0;
  color: var(--green);
  font-weight: 800;
}

.feedback.is-error {
  color: var(--red);
}

.is-hidden {
  display: none !important;
}

.admin-layout {
  grid-template-columns: minmax(280px, 1fr) minmax(280px, 0.9fr);
  align-items: start;
  margin-top: 18px;
}

.admin-form,
.data-panel {
  padding: 18px;
}

.embedded-form {
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.admin-fields {
  margin: 12px 0;
}

.import-button {
  position: relative;
  overflow: hidden;
}

.import-button input {
  position: absolute;
  inset: 0;
  opacity: 0;
}

.custom-sections {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.custom-section {
  padding: 18px;
}

.auth-required {
  padding: 22px;
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.auth-required h3 {
  margin: 0 0 8px;
}

.auth-required p {
  margin: 0 0 14px;
  color: var(--muted);
}

.admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.admin-tab,
.profile-tab {
  min-height: 40px;
  padding: 9px 12px;
  color: var(--navy);
  font-weight: 850;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.admin-tab:hover,
.profile-tab:hover {
  border-color: rgba(45, 111, 182, 0.34);
}

.admin-tab.is-active,
.profile-tab.is-active {
  color: #fff;
  background: linear-gradient(135deg, var(--red), var(--red-dark));
  border-color: var(--red);
}

.profile-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.admin-screen,
.profile-screen {
  display: none;
}

.admin-screen.is-active,
.profile-screen.is-active {
  display: block;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.stat-card {
  padding: 20px;
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.stat-card span {
  display: block;
  color: var(--navy);
  font-size: 2.3rem;
  font-weight: 950;
}

.stat-card p {
  margin: 4px 0 0;
  color: var(--muted);
  font-weight: 800;
}

.bar-chart {
  display: grid;
  gap: 10px;
}

.bar-chart div {
  display: grid;
  grid-template-columns: 90px 1fr;
  align-items: center;
  gap: 10px;
}

.bar-chart span {
  color: var(--muted);
  font-weight: 800;
}

.bar-chart strong {
  display: block;
  min-width: 28px;
  padding: 6px 8px;
  color: #fff;
  background: linear-gradient(90deg, var(--navy), var(--blue));
  border-radius: 6px;
}

.keyword-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.keyword-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  color: var(--navy);
  font-weight: 850;
  background: #edf2f9;
  border-radius: 999px;
}

.keyword-pill button,
.danger-action {
  color: #fff;
  background: var(--red);
  border: 0;
  border-radius: 6px;
}

.keyword-pill button {
  width: 22px;
  height: 22px;
}

.danger-action {
  min-height: 34px;
  margin-top: 12px;
  padding: 7px 10px;
  font-weight: 800;
}

.danger-action.compact {
  min-height: 32px;
  margin-top: 0;
}

.admin-content-actions,
.form-actions,
.request-admin-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: end;
  margin-top: 12px;
}

.video-feature {
  display: block;
  width: 100%;
  margin: 14px 0;
  overflow: hidden;
  background: #101820;
  border: 1px solid var(--line);
  border-radius: 8px;
  aspect-ratio: 16 / 9;
}

.video-feature iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.video-link {
  display: grid;
  place-items: center;
  gap: 4px;
  min-height: 220px;
  color: #fff;
  font-weight: 900;
  text-decoration: none;
}

.video-link small {
  opacity: 0.78;
}

.support-folder {
  display: grid;
  gap: 12px;
}

.support-folder h4 {
  margin: 8px 0 0;
  color: var(--navy);
}

.editor-shell {
  display: grid;
  gap: 8px;
}

.editor-toolbar {
  display: flex;
  gap: 6px;
}

.editor-toolbar button {
  min-height: 34px;
  padding: 6px 10px;
  color: var(--navy);
  font-weight: 900;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.rich-editor {
  min-height: 190px;
  padding: 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  line-height: 1.6;
}

.article-image {
  float: left;
  width: 128px;
  height: 92px;
  object-fit: cover;
  margin: 2px 14px 10px 0;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #edf2f9;
  box-shadow: var(--shadow-soft);
}

.event-row .article-image {
  width: 96px;
  height: 72px;
}

.user-list {
  display: grid;
  gap: 12px;
}

.user-row {
  display: grid;
  grid-template-columns: 1.2fr 180px 220px;
  gap: 12px;
  align-items: end;
  padding: 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.user-row p {
  margin: 5px 0 0;
  color: var(--muted);
}

.request-list {
  display: grid;
  gap: 12px;
}

.request-card {
  display: grid;
  gap: 10px;
  padding: 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.request-card header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
}

.request-card h4 {
  margin: 0 0 4px;
}

.request-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.support-thread {
  display: grid;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.thread-message {
  max-width: 78%;
  padding: 10px 12px;
  background: #edf2f9;
  border-radius: 8px;
}

.thread-message.from-team {
  margin-left: auto;
  color: #fff;
  background: var(--navy);
}

.thread-message span {
  display: block;
  margin-bottom: 4px;
  font-size: 0.74rem;
  font-weight: 900;
  opacity: 0.82;
}

.thread-message p,
.thread-message.from-team p {
  color: inherit;
}

.thread-empty {
  font-size: 0.9rem;
}

.support-reply-form {
  display: grid;
  gap: 8px;
}

.support-reply-form textarea {
  min-height: 90px;
}

.request-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 9px;
  color: var(--navy);
  font-size: 0.78rem;
  font-weight: 900;
  background: #edf2f9;
  border-radius: 999px;
}

.status-pill.status-en-cours {
  color: #fff;
  background: var(--navy);
}

.status-pill.status-cloturee {
  color: #fff;
  background: var(--green);
}

.status-pill.status-refusee {
  color: #fff;
  background: var(--red);
}

input[readonly] {
  color: var(--muted);
  background: #f2f4f7;
}

footer {
  padding: 30px clamp(18px, 4vw, 54px);
  color: var(--muted);
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.66);
}

.footer-link {
  display: inline-flex;
  min-height: 0;
  margin-bottom: 10px;
  padding: 0;
  color: var(--navy);
  font-weight: 850;
  text-decoration: underline;
  background: transparent;
  border: 0;
}

.footer-social-links {
  margin-bottom: 12px;
}

.social-row {
  margin-top: 12px;
}

.social-button {
  display: inline-grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 950;
  text-decoration: none;
  background: linear-gradient(135deg, var(--navy), var(--navy-dark));
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
}

.social-facebook {
  background: #1b5fd6;
}

.social-instagram {
  background: #b83274;
}

.social-linkedin {
  background: #0a66c2;
}

.social-tiktok {
  background: #111;
}

.social-twitter,
.social-threads {
  background: #17202b;
}

.social-assembly {
  background: var(--red);
}

.site-toast {
  position: fixed;
  right: clamp(16px, 4vw, 34px);
  bottom: 22px;
  z-index: 50;
  max-width: min(420px, calc(100vw - 32px));
  padding: 12px 14px;
  color: #fff;
  font-weight: 850;
  line-height: 1.4;
  background: linear-gradient(135deg, var(--navy), var(--navy-dark));
  border-radius: 8px;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.site-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.empty-state {
  padding: 18px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.72);
  border: 1px dashed var(--line);
  border-radius: 8px;
}

/* UI refresh */
:root {
  --surface: rgba(255, 255, 255, 0.94);
  --surface-muted: rgba(247, 249, 252, 0.92);
  --header-height: 74px;
  --shadow: 0 18px 38px rgba(18, 27, 41, 0.1);
  --shadow-soft: 0 8px 22px rgba(18, 27, 41, 0.07);
}

body {
  background:
    radial-gradient(circle at 78% 10%, rgba(178, 48, 61, 0.08), transparent 26vw),
    linear-gradient(180deg, rgba(248, 250, 253, 0.94), rgba(244, 247, 251, 0.99) 620px);
  color: #111827;
  line-height: 1.5;
}

body::selection {
  color: #fff;
  background: var(--navy);
}

button,
input,
select,
textarea,
.rich-editor {
  -webkit-tap-highlight-color: transparent;
}

button {
  touch-action: manipulation;
}

.site-header {
  min-height: var(--header-height);
  padding-block: 10px;
  background: rgba(255, 255, 255, 0.9);
  border-bottom-color: rgba(198, 208, 222, 0.7);
}

.brand-mark {
  flex: 0 0 auto;
}

.main-nav {
  align-items: center;
}

.nav-link {
  min-height: 38px;
  padding: 9px 12px;
  color: #1a3760;
  font-size: 0.9rem;
  white-space: nowrap;
}

.account-bar span {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hero {
  min-height: clamp(540px, 70vh, 760px);
  align-items: center;
  padding-top: clamp(56px, 7vw, 96px);
  padding-bottom: clamp(34px, 5vw, 64px);
}

.hero h2,
.detail-article h2 {
  letter-spacing: 0;
}

.hero p {
  font-size: clamp(1rem, 1.2vw, 1.14rem);
}

.hero-search {
  padding: 6px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(198, 208, 222, 0.72);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(14px);
}

.hero-search input {
  box-shadow: none;
}

.hero-search .primary-action {
  min-width: 132px;
}

.hero-brief,
.summary-panel div,
.tab-panel,
.timeline-card,
.law-card,
.month-block,
.admin-form,
.data-panel,
.custom-section,
.map-panel,
.commune-panel,
.search-result,
.detail-article,
.legal-grid article,
.vote-board,
.video-rail,
.parliament-metrics article,
.mandate-cards article,
.stat-card,
.request-card,
.auth-required {
  background: var(--surface);
}

.workspace {
  align-items: start;
}

.summary-panel {
  gap: 12px;
}

.summary-panel div {
  min-height: 118px;
}

.metric {
  line-height: 1;
}

.tab-panel {
  min-width: 0;
  border-color: rgba(198, 208, 222, 0.72);
}

.section-heading {
  align-items: end;
}

.section-heading > div {
  min-width: 0;
}

.section-heading h2 {
  max-width: 880px;
}

.filters select,
.section-heading select {
  min-width: min(230px, 100%);
}

select,
input,
textarea,
.rich-editor {
  min-width: 0;
  background: #fff;
}

input,
select,
textarea {
  font-size: 1rem;
}

.primary-action,
.secondary-action,
.import-button,
.admin-tab,
.profile-tab,
.contact-tabs button,
.editor-toolbar button,
.icon-button,
.danger-action {
  min-width: 0;
}

.primary-action,
.secondary-action,
.import-button {
  text-align: center;
}

.content-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
}

.timeline-card,
.law-card,
.search-result,
.request-card,
.month-block {
  overflow: hidden;
}

.timeline-card h3,
.law-card h3,
.search-result h3,
.request-card h4 {
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.article-image {
  max-width: 44%;
}

.haute-saone-map {
  min-height: clamp(300px, 48vw, 480px);
}

.map-heading,
.request-card header {
  min-width: 0;
}

.video-rail article,
.commune-posts article,
.compact-list button,
.admin-panel button,
.admin-list button,
.user-row {
  min-width: 0;
}

.thread-message {
  overflow-wrap: anywhere;
}

.admin-shell {
  min-width: 0;
}

.admin-topbar,
.admin-filterbar,
.admin-row,
.activity-row,
.contact-result-row {
  min-width: 0;
}

.site-toast {
  left: auto;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

@media (max-width: 900px) {
  .site-header {
    align-items: center;
    gap: 12px;
    min-height: 66px;
    padding: 10px 16px;
  }

  .menu-toggle {
    display: grid;
    flex: 0 0 44px;
    margin-left: auto;
  }

  .main-nav {
    position: absolute;
    top: calc(100% + 8px);
    right: 12px;
    left: 12px;
    display: none;
    max-height: calc(100vh - 92px);
    padding: 10px;
    overflow-y: auto;
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(198, 208, 222, 0.9);
    border-radius: 8px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
  }

  .main-nav.is-open {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .main-nav .nav-link {
    width: 100%;
    justify-content: center;
    white-space: normal;
  }

  .workspace,
  .hero,
  .admin-layout,
  .auth-layout,
  .agenda-map-layout,
  .mandate-columns {
    grid-template-columns: minmax(0, 1fr);
  }

  .workspace {
    padding-inline: 16px;
  }

  .hero {
    min-height: auto;
    align-items: start;
    gap: 18px;
    padding-inline: 16px;
  }

  .hero-brief {
    max-width: 100%;
  }

  .summary-panel {
    position: static;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .brand {
    min-width: 0;
  }

  .account-bar {
    min-width: 0;
  }

  .admin-topbar {
    position: static;
  }
}

@media (max-width: 640px) {
  :root {
    --header-height: 64px;
  }

  body {
    background-attachment: scroll;
  }

  .hero {
    min-height: auto;
    padding: 36px 16px 32px;
    max-width: 100vw;
  }

  .hero > * {
    width: 100%;
    max-width: 100%;
    justify-self: start;
  }

  .hero h2 {
    max-width: none;
    font-size: clamp(2rem, 10vw, 2.72rem);
    line-height: 0.98;
    text-wrap: auto;
  }

  .hero p {
    line-height: 1.62;
  }

  .hero::before {
    inset-inline: 16px;
    width: auto;
  }

  .site-header {
    gap: 10px;
  }

  .account-bar {
    display: none;
  }

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

  .brand .eyebrow {
    font-size: 0.66rem;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
  }

  .section-heading,
  .event-row,
  .vote-row,
  .hero-search {
    grid-template-columns: 1fr;
    display: grid;
  }

  .hero-search {
    padding: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
  }

  .hero-search .primary-action,
  .primary-action,
  .secondary-action,
  .import-button {
    width: 100%;
    min-height: 46px;
  }

  .event-row.image-right .article-image {
    float: left;
    margin: 2px 14px 10px 0;
  }

  .summary-panel,
  .form-grid,
  .stats-grid,
  .user-row,
  .parliament-metrics,
  .mandate-cards,
  .admin-metrics,
  .admin-dashboard-grid,
  .admin-search-results,
  .admin-row form,
  .admin-user-actions,
  .activity-row,
  .contact-filter-grid,
  .contact-form-grid,
  .contact-csv-map-grid {
    grid-template-columns: 1fr;
  }

  .summary-panel div {
    min-height: auto;
  }

  .workspace {
    gap: 16px;
    padding: 0 12px 38px;
  }

  .tab-panel {
    min-height: 0;
    padding: 16px;
  }

  .section-heading {
    gap: 12px;
    margin-bottom: 18px;
  }

  .section-heading select,
  .filters select {
    min-width: 0;
  }

  .filters {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
  }

  .admin-tabs,
  .profile-tabs,
  .data-actions,
  .map-actions,
  .share-row,
  .form-actions,
  .request-admin-controls,
  .hero-brief-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .hero-brief-actions {
    padding-right: 0;
  }

  .hero-brief::after {
    opacity: 0.35;
  }

  .main-nav.is-open {
    grid-template-columns: 1fr;
  }

  .map-heading,
  .request-card header,
  .admin-detail-head {
    display: grid;
    grid-template-columns: 1fr;
  }

  .month-timeline,
  .timeline {
    padding-left: 0;
    border-left: 0;
  }

  .timeline::before,
  .timeline-card::before {
    display: none;
  }

  .article-image,
  .event-row .article-image,
  .event-row.image-right .article-image {
    float: none;
    width: 100%;
    max-width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    margin: 8px 0 12px;
  }

  .haute-saone-map {
    min-height: 300px;
  }

  .vote-position,
  .status-chip {
    justify-self: start;
  }

  .thread-message {
    max-width: 100%;
  }

  footer {
    padding: 24px 16px;
  }

  .site-toast {
    right: 12px;
    bottom: 14px;
    max-width: calc(100vw - 24px);
  }
}

@media (max-width: 680px) {
  body.admin-mode .admin-workbench {
    padding: 12px 10px 28px;
  }

  body.admin-mode .admin-sidebar {
    padding: 14px;
    gap: 12px;
  }

  .contacts-admin {
    gap: 10px;
  }

  .contact-tabs {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(130px, 1fr);
    gap: 8px;
    margin-inline: -2px;
    padding: 2px 2px 8px;
    overflow-x: auto;
    scroll-snap-type: x proximity;
  }

  .contact-tabs button {
    width: 100%;
    min-height: 42px;
    scroll-snap-align: start;
    white-space: nowrap;
  }

  .contact-search-panel {
    position: sticky;
    top: 0;
    z-index: 4;
    max-height: 58vh;
    overflow-y: auto;
    padding: 12px;
    border-color: rgba(198, 208, 222, 0.9);
    box-shadow: 0 12px 24px rgba(18, 27, 41, 0.12);
  }

  .contact-search-head {
    gap: 10px;
  }

  .contact-search-head h3 {
    font-size: 1rem;
  }

  .contact-search-head p,
  .contact-pagination-controls span {
    font-size: 0.86rem;
  }

  .contact-search-panel fieldset {
    padding: 12px;
  }

  .contact-search-primary-actions {
    grid-template-columns: 1fr 1fr;
  }

  .contact-filter-section summary {
    min-height: 42px;
    padding: 10px;
  }

  .contact-filter-section > fieldset,
  .contact-filter-section > .contact-filter-grid,
  .contact-filter-section > .contact-age-filter,
  .contact-filter-section > .contact-pagination-controls,
  .contact-filter-section > .data-actions {
    margin: 10px;
  }

  .contact-pagination-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .contact-pagination-controls label,
  .contact-pagination-controls span {
    grid-column: 1 / -1;
    min-width: 0;
  }

  .contact-split {
    gap: 10px;
    margin-top: 10px;
  }

  .contact-split > .admin-detail {
    display: none;
  }

  .contact-result-list {
    gap: 10px;
  }

  .contact-result-row {
    padding: 8px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 8px 18px rgba(18, 27, 41, 0.06);
  }

  .contact-result-row.is-active {
    border-color: rgba(178, 48, 61, 0.34);
    background: #fffafa;
  }

  .contact-result-main {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .contact-select-line {
    min-height: 64px;
  }

  .contact-inline-detail {
    display: block;
    padding-top: 8px;
  }

  .contact-inline-detail .admin-form {
    padding: 12px;
    border-color: rgba(198, 208, 222, 0.9);
    box-shadow: none;
  }

  .contact-inline-detail .admin-detail-head {
    gap: 8px;
  }

  .contact-detail-form textarea {
    min-height: 120px;
  }

  .contact-form-grid label:has(textarea) {
    grid-column: auto;
  }

  .admin-crud {
    gap: 10px;
  }

  .admin-crud > .admin-form {
    position: static;
  }

  .admin-table {
    gap: 10px;
  }

  .admin-row {
    padding: 12px;
  }

  .admin-row form {
    gap: 8px;
  }
}
