@import url('../bib/fonts/fonts.css');

:root {
  --panel: #ffffff;
  --ink: #0c3c76;
  --muted: #4c6a8a;
  --brand-blue: #0b4f9c;
  --brand-blue-2: #0d67b2;
  --brand-orange: #ef6c00;
  --brand-green: #3d8f42;
  --line: #d9e4f0;
  --shadow: 0 12px 32px rgba(11, 79, 156, 0.14);
  --radius: 18px;
  --sidebar-w: 360px;
  --sidebar-collapsed: 88px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  background:
    radial-gradient(circle at 82% 5%, #d7ebff 0%, transparent 34%),
    radial-gradient(circle at 10% 0%, #ffe8d5 0%, transparent 28%),
    linear-gradient(135deg, #f6f9fd 0%, #eef4fb 45%, #f4f8fd 100%);
  color: var(--ink);
  min-height: 100vh;
}

.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
  transition: grid-template-columns 0.3s ease;
}

.sidebar {
  background: linear-gradient(180deg, #0b4f9c 0%, #0a427f 52%, #08386b 100%);
  color: #effaf5;
  padding: 18px 14px;
  border-right: 1px solid rgba(255, 255, 255, 0.18);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
}

.sidebar-logo {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 2px 4px 14px;
  padding: 8px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.24);
}

.sidebar-logo-link {
  display: block;
  width: 100%;
}

.sidebar-logo img {
  display: block;
  width: 100%;
  max-width: 540px;
  height: auto;
  object-fit: contain;
}

.sidebar-admin-badge {
  margin: 0 6px 14px;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.35);
  text-align: center;
  font-size: clamp(20px, 2.6vw, 28px);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: 0.02em;
  color: #ffffff;
  text-transform: uppercase;
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
}

.active-commune {
  margin: 0 6px 12px;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.12);
  color: #e9f3ff;
  font-size: 12px;
  line-height: 1.35;
}

.active-commune strong {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #cddff3;
  margin-bottom: 4px;
}

.active-commune span {
  display: block;
  font-size: 13px;
  color: #ffffff;
  font-weight: 600;
}

.active-commune-empty-link {
  display: block;
  text-decoration: none;
}

.active-commune-empty-link:hover {
  background: rgba(255, 255, 255, 0.2);
}

.active-commune-line {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
}

.active-commune-armoiries {
  display: inline-block;
  margin: 0;
  max-width: 44px;
  max-height: 48px;
  width: auto;
  height: auto;
  border-radius: 8px;
  background: #ffffff;
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, 0.35);
}

.active-commune-link {
  color: #ffffff;
  text-decoration: none;
  font-weight: 700;
  font-size: 13px;
  border-bottom: 1px dotted rgba(255, 255, 255, 0.6);
}

.active-commune-link:hover {
  color: #ffe0bf;
  border-bottom-color: #ffe0bf;
}

.hamburger {
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  cursor: pointer;
  display: grid;
  place-items: center;
  margin-bottom: 24px;
  font-size: 20px;
}

.menu-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #d0e0f1;
  margin: 6px 12px 16px;
}

.menu-divider {
  height: 1px;
  margin: 8px 10px 16px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0.14));
}

.menu-user {
  margin: 0 10px 12px;
  padding: 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.62);
  color: #f2f8ff;
}

.menu-user strong {
  display: block;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: #d7e7f9;
  margin-bottom: 4px;
}

.menu-user span {
  font-size: 13px;
  font-weight: 700;
  color: #ffffff;
}

.menu-user-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.menu-user-line span {
  flex: 1;
  min-width: 0;
}

.menu-user-actions {
  margin-top: 0;
  margin-left: auto;
}

.menu-user-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  font-size: 20px;
  font-weight: 700;
  color: #ffffff;
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.95);
  border-radius: 999px;
  background: #ef6c00;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.3);
  position: relative;
}

.menu-user-actions a:hover {
  background: #ff8f26;
  color: #ffffff;
}

.menu-user-actions a::after {
  content: attr(data-label);
  position: absolute;
  right: 42px;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.95);
  color: #0b4f9c;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 8px;
  border: 1px solid #d9e4f0;
  opacity: 0;
  visibility: hidden;
  white-space: nowrap;
  pointer-events: none;
}

.menu-user-actions a:hover::after {
  opacity: 1;
  visibility: visible;
}

.menu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.menu a {
  text-decoration: none;
  color: #ecf7f2;
  padding: 12px;
  border-radius: 12px;
  display: flex;
  gap: 12px;
  align-items: center;
  font-weight: 500;
  white-space: nowrap;
  transition: background 0.2s ease;
}

.menu a:hover,
.menu a.active {
  background: rgba(239, 108, 0, 0.24);
}

.icon {
  width: 22px;
  text-align: center;
  font-size: 14px;
  font-weight: 700;
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: 8px;
  line-height: 1.5;
}

.content {
  padding: 18px 20px 24px;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 16px;
  min-width: 0;
}

.topbar {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 16px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
  position: relative;
  overflow: hidden;
}

.topbar::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--brand-orange), var(--brand-blue), var(--brand-green));
}

.search {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #f8fbff;
  display: flex;
  align-items: center;
  min-height: 56px;
  padding: 0 16px;
  gap: 10px;
}

.search input {
  border: 0;
  outline: none;
  background: transparent;
  height: 52px;
  width: 100%;
  font-family: inherit;
  font-size: 16px;
  color: var(--ink);
}

.feed-search-form input[type="text"],
.feed-search-form input[type="search"],
#inscription_recherche_commune,
#commune_active_recherche,
#user-form-commune-search,
#user-form-type-search {
  min-height: 52px;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 16px;
  border: 1px solid var(--line);
}

.feed-search-submit {
  width: 52px;
  min-width: 52px;
  height: 52px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #f8fbff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.notif {
  border: 0;
  background: linear-gradient(120deg, var(--brand-orange), #ff8f26);
  color: #fff;
  border-radius: 14px;
  height: 44px;
  min-width: 112px;
  padding: 0 14px;
  font-weight: 600;
  cursor: pointer;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  min-height: 0;
}

.feed,
.top10 {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
}

.section-title {
  margin: 0 0 12px;
  font-size: 20px;
  color: var(--ink);
  letter-spacing: 0.01em;
}

.feed-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.feed-head .section-title {
  margin: 0;
}

.feed-count {
  font-size: 13px;
  color: #1f7a33;
  white-space: nowrap;
}

.post {
  border: 1px solid #d6e2ef;
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 12px;
  background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
  box-shadow: 0 6px 16px rgba(13, 103, 178, 0.08);
}

.post.feed-publication-card {
  position: relative;
  background-color: #fff4e8 !important;
  background-image: linear-gradient(180deg, #fff9f2 0%, #ffe9d1 100%) !important;
  border: 3px solid #000000;
  box-shadow: 0 10px 20px rgba(239, 140, 58, 0.18);
}

.post.feed-publication-card > .reaction-bar {
  position: absolute;
  top: 12px;
  right: 12px;
  margin-top: 0;
}

.post.feed-publication-card .publication-title,
.post.feed-publication-card .post-meta {
  padding-right: 195px;
}

.post.feed-publication-card .post-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.post.feed-publication-card .post-meta-main {
  min-width: 0;
}

.post.feed-publication-card .post-meta-type {
  margin-left: auto;
  margin-right: -4px;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.post.feed-publication-card .post-meta-type .tag {
  background: #ff4d4d;
  color: #000000;
  border-color: #a80000;
}

.post.feed-publication-card .post-meta-gps {
  position: absolute;
  top: 52px;
  right: 56px;
  margin: 0;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(233, 243, 255, 0.92);
  border: 1px solid rgba(31, 78, 140, 0.25);
  font-size: 11px;
  color: #1b5e95;
  font-weight: 700;
  line-height: 1.2;
}

.publication-map-btn {
  position: absolute;
  top: 52px;
  right: 12px;
  width: 36px;
  height: 36px;
  border: 2px solid #1f4e8c;
  border-radius: 10px;
  background: #e9f3ff;
  color: #0b4f9c;
  font-size: 18px;
  cursor: pointer;
}

.publication-map-btn.no-reactions {
  top: 12px;
}

.publication-map-btn:hover {
  background: #dcecff;
}

.publication-map-popup {
  position: fixed;
  top: 110px;
  right: 24px;
  width: min(640px, calc(100vw - 24px));
  z-index: 1210;
  background: #ffffff;
  border: 2px solid #000000;
  border-radius: 12px;
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.22);
  overflow: hidden;
}

.publication-map-popup.is-hidden {
  display: none;
}

.publication-map-popup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  background: #0b4f9c;
  color: #ffffff;
  cursor: move;
}

.publication-map-close {
  width: 28px;
  height: 28px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 8px;
  background: transparent;
  color: #ffffff;
  font-weight: 700;
  cursor: pointer;
}

.publication-map-popup-body {
  padding: 12px;
}

.publication-map-view {
  width: 100%;
  min-height: 360px;
  border: 1px solid #d6e2ef;
  border-radius: 10px;
  background: #eef4fb;
}

#publication-map-popup-coords {
  display: block;
  margin-top: 8px;
  color: #1b5e95;
  font-weight: 600;
}

.post.mes-publication-card {
  background-color: #fff4e8 !important;
  background-image: linear-gradient(180deg, #fff9f2 0%, #ffe9d1 100%) !important;
  border: 4px solid #000000 !important;
  box-shadow: 0 10px 20px rgba(239, 140, 58, 0.18) !important;
}

.post:last-child {
  margin-bottom: 0;
}

.post h3 {
  margin: 0 0 6px;
  font-size: 17px;
  color: var(--brand-blue);
}

.publication-title {
  display: inline-block;
  margin-bottom: 10px;
  padding: 6px 10px;
  border-radius: 10px;
  background: #0a427f;
  color: #ffffff !important;
  border: 1px solid #08386b;
}

.post p {
  margin: 0 0 8px;
  color: var(--muted);
  line-height: 1.45;
}

.post-meta {
  margin: 0 0 10px;
  font-size: 12px;
  color: var(--muted);
}

.publication-author-link {
  color: #0b4f9c;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.publication-author-link:hover {
  color: #08386b;
}

.post-photo-wrap {
  margin: 0 0 10px;
}

.post-photo-gallery {
  margin: 0 0 10px;
}

.post-photo-gallery .post-photo-wrap {
  margin: 0 0 8px;
}

.post-photo-thumbs-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.post-photo-nav {
  width: 30px;
  height: 30px;
  border: 1px solid #9db7d3;
  border-radius: 8px;
  background: #f0f6fd;
  color: #0b4f9c;
  cursor: pointer;
  flex: 0 0 auto;
}

.post-photo-thumbs-track {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
  scrollbar-width: thin;
  padding-bottom: 2px;
}

.post-photo-thumb {
  border: 2px solid transparent;
  border-radius: 8px;
  padding: 0;
  background: transparent;
  cursor: pointer;
  line-height: 0;
  flex: 0 0 auto;
}

.post-photo-thumb img {
  display: block;
  width: 62px;
  height: 62px;
  object-fit: cover;
  border-radius: 6px;
}

.post-photo-thumb.is-active {
  border-color: #0b4f9c;
}

.post-photo {
  display: block;
  width: 100%;
  max-width: 560px;
  max-height: 380px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid #d6e2ef;
  background: #f3f8fd;
}

.post-gps {
  margin: 0 0 8px;
  font-size: 12px;
  color: #1b5e95;
  font-weight: 600;
}

.tag {
  display: inline-block;
  background: #fff1e5;
  color: #bb5600;
  border: 1px solid #ffd4b0;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
}

.post-meta .tag {
  vertical-align: middle;
}

.post-comments {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #e3edf7;
}

.post-comments h4 {
  margin: 0 0 10px;
  font-size: 14px;
  color: var(--ink);
}

.post-comments-empty {
  color: var(--muted);
  font-size: 12px;
  display: block;
  margin-bottom: 8px;
}

.comment-item {
  position: relative;
  border: 1px solid #e1eaf5;
  border-radius: 10px;
  padding: 8px 120px 8px 10px;
  margin-bottom: 8px;
  background: #fcfeff;
}

.comment-item > .reaction-bar {
  position: absolute;
  top: 8px;
  right: 10px;
  margin-top: 0;
}

.comment-item p {
  margin: 0;
  color: var(--ink);
  font-size: 14px;
}

.comment-meta {
  margin: 0 0 5px;
  font-size: 12px;
  color: #5f7c9a;
}

.comment-replies {
  margin-top: 8px;
  margin-left: 18px;
  display: grid;
  gap: 6px;
}

.comment-reply-item {
  background: #f6fbff;
  border-color: #d7e7f7;
}

.comment-reply-form {
  margin-top: 8px;
}

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

.reaction-form {
  margin: 0;
}

.reaction-btn {
  height: 32px;
  border: 1px solid #84c79a;
  border-radius: 9px;
  background: #f2fbf4;
  color: #1f7a33;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 0 10px;
  cursor: pointer;
}

.reaction-btn.active {
  background: #dff4e5;
  border-color: #4fa66b;
  color: #155d2a;
}

.reaction-btn.dislike {
  border-color: #e3a1a1;
  background: #fff4f4;
  color: #b42318;
}

.reaction-btn.dislike.active {
  background: #ffdede;
  border-color: #d24b4b;
  color: #8f1f1f;
}

.reaction-bar-readonly .reaction-btn {
  cursor: default;
  opacity: 1;
}

.publication-comment-form {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.publication-comment-form textarea {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  font-family: inherit;
  color: var(--ink);
  background: #fff;
  resize: vertical;
}

.publication-comment-form button {
  height: 40px;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(120deg, var(--brand-blue), var(--brand-blue-2));
  color: #fff;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  width: 140px;
}

.publication-gps-block {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}

.publication-gps-fields {
  flex: 1;
  min-width: 0;
}

.publication-gps-map-btn {
  width: 42px;
  min-width: 42px;
  height: 42px;
  border: 2px solid #1f4e8c;
  border-radius: 10px;
  background: #e9f3ff;
  color: #0b4f9c;
  font-size: 20px;
  cursor: pointer;
  margin-bottom: 2px;
}

.publication-gps-map-btn:hover {
  background: #dcecff;
}

.publication-gps-map-popup {
  position: fixed;
  top: 110px;
  right: 24px;
  width: min(640px, calc(100vw - 24px));
  z-index: 1220;
  background: #ffffff;
  border: 2px solid #000000;
  border-radius: 12px;
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.22);
  overflow: hidden;
}

.publication-gps-map-popup.is-hidden {
  display: none;
}

.publication-gps-map-popup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  background: #0b4f9c;
  color: #ffffff;
  cursor: move;
}

.publication-gps-map-close {
  width: 28px;
  height: 28px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 8px;
  background: transparent;
  color: #ffffff;
  font-weight: 700;
  cursor: pointer;
}

.publication-gps-map-popup-body {
  padding: 12px;
}

.publication-gps-map-view {
  width: 100%;
  min-height: 360px;
  border: 1px solid #d6e2ef;
  border-radius: 10px;
  background: #eef4fb;
}

#publication-gps-map-hint {
  display: block;
  margin-top: 8px;
  color: #1b5e95;
  font-weight: 600;
}

.auteur-profile-popup {
  position: fixed;
  top: 90px;
  right: 24px;
  width: min(420px, calc(100vw - 24px));
  z-index: 1200;
  background: #ffffff;
  border: 2px solid #000000;
  border-radius: 12px;
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.22);
  overflow: hidden;
}

.auteur-profile-popup.is-hidden {
  display: none;
}

.auteur-profile-popup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  background: #0b4f9c;
  color: #ffffff;
  cursor: move;
}

.auteur-profile-close {
  width: 28px;
  height: 28px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 8px;
  background: transparent;
  color: #ffffff;
  font-weight: 700;
  cursor: pointer;
}

.auteur-profile-popup-body {
  padding: 12px;
}

.auteur-profile-popup-body p {
  margin: 0 0 8px;
  color: var(--ink);
}

.auteur-profile-popup-body p:last-child {
  margin-bottom: 0;
}

.follow-author-form {
  padding: 0 12px 12px;
}

.follow-author-form button {
  width: 100%;
  height: 40px;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(120deg, var(--brand-blue), var(--brand-blue-2));
  color: #ffffff;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
}

.publication-edit-form {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed #cfe0f1;
  display: grid;
  gap: 8px;
}

.publication-edit-form label {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}

.publication-edit-form input,
.publication-edit-form select,
.publication-edit-form textarea {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 11px;
  font-family: inherit;
  color: var(--ink);
  background: #fff;
  width: min(100%, 560px);
  box-sizing: border-box;
  justify-self: start;
}

.publication-edit-form textarea {
  resize: vertical;
}

.publication-edit-draft-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
}

.publication-edit-draft-toggle input[type="checkbox"] {
  width: 16px;
  height: 16px;
}

.publication-edit-form button {
  height: 40px;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(120deg, var(--brand-blue), var(--brand-blue-2));
  color: #fff;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  width: 260px;
}

.publication-edit-photo-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
  margin: 6px 0 10px;
}

.publication-edit-photo-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--muted);
}

.publication-edit-photo-item img {
  width: 100%;
  height: 90px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid #d6e2ef;
  background: #f3f8fd;
}

.publication-edit-photo-dropzone {
  margin-top: 6px;
}

.publication-edit-toggle-btn {
  margin-top: 12px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
  color: var(--brand-blue);
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  padding: 0 12px;
}

.publication-edit-toggle-btn:hover {
  background: #f3f8ff;
}

.publication-draft-banner {
  display: inline-block;
  margin-bottom: 8px;
  padding: 3px 10px;
  border: 2px solid #000000;
  border-radius: 8px;
  background: #ffe08a;
  color: #000000;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.publication-edit-panel.is-hidden {
  display: none;
}

.account-edit-toggle-btn {
  margin-bottom: 10px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
  color: var(--brand-blue);
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  padding: 0 12px;
}

.account-edit-panel {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed #cfe0f1;
}

.account-edit-panel.is-hidden {
  display: none;
}

.mes-communes-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.mes-communes-head h3 {
  margin: 0;
}

.mes-communes-line {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  margin-top: 2px;
}

.mes-communes-line .post-meta {
  margin: 0;
}

.mes-communes-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}

.mes-communes-action-form button {
  height: 36px;
  border: 0;
  border-radius: 9px;
  padding: 0 12px;
  background: linear-gradient(120deg, var(--brand-blue), var(--brand-blue-2));
  color: #fff;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
}

.mes-communes-action-form .icon-btn {
  width: 36px;
  min-width: 36px;
  padding: 0;
  font-size: 18px;
  line-height: 1;
}

.mes-communes-action-form button.danger {
  background: linear-gradient(120deg, #b42318, #d92d20);
}

.login-card {
  border: 1px solid #d6e2ef;
  border-radius: 14px;
  padding: 18px;
  background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
  box-shadow: 0 6px 16px rgba(13, 103, 178, 0.08);
  max-width: 520px;
}

.login-form {
  display: grid;
  gap: 10px;
}

.login-form label {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}

.login-form input,
.login-form select {
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 12px;
  font-family: inherit;
  color: var(--ink);
  background: #fff;
}

.login-form textarea {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  font-family: inherit;
  color: var(--ink);
  background: #fff;
  resize: vertical;
}

#publication_photo {
  display: none;
}

.file-dropzone {
  border: 2px dashed #b5cbe3;
  border-radius: 10px;
  padding: 14px 12px;
  background: #f6faff;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.file-dropzone:hover,
.file-dropzone:focus-visible,
.file-dropzone.is-dragover {
  border-color: var(--brand-blue-2);
  background: #e9f3ff;
  color: var(--ink);
  outline: none;
}

.field-error {
  color: #b54708;
  font-size: 12px;
  margin-top: -4px;
  min-height: 16px;
  display: block;
}

.field-success {
  color: #1f7a33;
  font-size: 13px;
  display: block;
  margin-bottom: 10px;
}

.commune-results {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
  display: none;
  max-height: 260px;
  overflow-y: auto;
}

.commune-results.open {
  display: block;
}

.commune-option {
  width: 100%;
  border: 0;
  background: #fff;
  text-align: left;
  padding: 10px 12px;
  cursor: pointer;
  color: var(--ink);
  font-family: inherit;
  border-bottom: 1px solid #eef3f9;
}

.commune-option:last-child {
  border-bottom: 0;
}

.commune-option:hover {
  background: #0b4f9c;
  color: #ffffff;
}

.login-form button {
  margin-top: 6px;
  height: 44px;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(120deg, var(--brand-blue), var(--brand-blue-2));
  color: #fff;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
}

.login-actions {
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
}

.login-actions a {
  color: var(--brand-blue);
  text-decoration: none;
  font-weight: 600;
}

.login-actions a:hover {
  text-decoration: underline;
}

.commune-map-wrapper {
  margin-top: 20px;
  border-top: 1px dashed #cbdced;
  padding-top: 14px;
}

.map-help {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 13px;
}

.commune-map {
  width: 100%;
  min-height: 340px;
  border-radius: 12px;
  border: 1px solid var(--line);
  overflow: hidden;
  background: #eaf2fb;
  box-shadow: inset 0 0 0 1px rgba(11, 79, 156, 0.04);
}

.top10 ol {
  margin: 0;
  padding-left: 20px;
}

.top10 li {
  margin-bottom: 10px;
  color: var(--ink);
  line-height: 1.35;
}

.top10 li::marker {
  color: var(--brand-orange);
  font-weight: 700;
}

.collapsed {
  grid-template-columns: var(--sidebar-collapsed) 1fr;
}

.collapsed .menu-title,
.collapsed .menu span:not(.icon) {
  display: none;
}

.collapsed .menu a {
  justify-content: center;
  padding: 12px;
}

.mount-error {
  background: #fff;
  border: 1px solid #ffd6d6;
  color: #a12424;
  border-radius: 12px;
  padding: 12px;
  font-size: 14px;
}

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

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(92vw, var(--sidebar-w));
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    z-index: 60;
  }

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

  .content {
    padding: 14px;
  }

  .topbar {
    grid-template-columns: 1fr auto;
  }

  .layout {
    grid-template-columns: 1fr;
  }
}
