.emm-wrap {
  max-width: 760px;
  margin: 0 auto 30px;
  padding: 16px;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 8px 28px rgba(0,0,0,.08);
  font-family: inherit;
}

.emm-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 16px;
}

.emm-header h2 {
  margin: 0 0 4px;
  font-size: 26px;
}

.emm-header p {
  margin: 0;
  color: #666;
}

.emm-logout {
  display: inline-flex;
  padding: 8px 12px;
  border-radius: 999px;
  background: #f2f2f2;
  color: #333 !important;
  text-decoration: none !important;
  font-weight: 700;
  white-space: nowrap;
}

.emm-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0;
}

.emm-action-card {
  min-height: 92px;
  border: 0;
  border-radius: 18px;
  padding: 18px;
  background: #1d4b02;
  color: #fff;
  font-size: 18px;
  font-weight: 800;
  text-align: center;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(0,0,0,.12);
}

.emm-action-card:nth-child(2) {
  background: #9e0208;
}

.emm-panel {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #eee;
}

.emm-panel h3 {
  margin-top: 0;
  font-size: 22px;
}

.emm-wrap label {
  display: block;
  margin: 0 0 14px;
  font-weight: 700;
}

.emm-wrap input[type="text"],
.emm-wrap input[type="url"],
.emm-wrap input[type="file"],
.emm-wrap textarea {
  width: 100%;
  box-sizing: border-box;
  margin-top: 6px;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 12px;
  font-size: 16px;
  background: #fff;
}

.emm-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0;
}

.emm-toolbar button {
  border: 1px solid #ddd;
  background: #f7f7f7;
  color: #222;
  border-radius: 9px;
  padding: 8px 10px;
  font-weight: 700;
}

.emm-editor {
  min-height: 180px;
  padding: 13px;
  border: 1px solid #ddd;
  border-radius: 12px;
  font-size: 16px;
  line-height: 1.5;
  background: #fff;
  margin-bottom: 14px;
}

.emm-editor:empty:before {
  content: "Rédigez votre article ici…";
  color: #999;
}

.emm-check {
  display: flex !important;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: #f7f7f7;
  border-radius: 12px;
}

.emm-check input {
  width: 20px;
  height: 20px;
}

.emm-submit {
  width: 100%;
  border: 0;
  border-radius: 14px;
  padding: 14px 18px;
  background: #1d4b02;
  color: #fff;
  font-size: 18px;
  font-weight: 800;
  cursor: pointer;
}

.emm-status {
  display: none;
  padding: 12px 14px;
  border-radius: 12px;
  margin: 10px 0;
  font-weight: 700;
}

.emm-status:not(:empty) {
  display: block;
}

.emm-status.is-success {
  background: #e8f7ea;
  color: #176b26;
}

.emm-status.is-error {
  background: #fdeaea;
  color: #9e0208;
}

.emm-status.is-info {
  background: #eef4ff;
  color: #174a8b;
}

.emm-wrap form.is-loading {
  opacity: .7;
}

@media (max-width: 640px) {
  .emm-wrap {
    margin: 0 0 20px;
    border-radius: 14px;
    padding: 14px;
  }

  .emm-header {
    flex-direction: column;
  }

  .emm-actions {
    grid-template-columns: 1fr;
  }

  .emm-action-card {
    min-height: 78px;
  }
}

/* Connexion espace mairie */
.emm-login {
  max-width: 430px;
  margin-top: 12px;
}

.emm-login h2 {
  margin: 0 0 8px;
  text-align: center;
  font-size: 26px;
}

.emm-login-intro {
  margin: 0 0 18px;
  text-align: center;
  color: #666;
  line-height: 1.45;
}

.emm-login form {
  margin: 0;
}

.emm-login .login-username,
.emm-login .login-password,
.emm-login .login-remember,
.emm-login .login-submit {
  margin: 0 0 14px;
}

.emm-login label {
  display: block;
  margin: 0 0 6px;
  font-weight: 800;
  color: #222;
}

.emm-login input[type="text"],
.emm-login input[type="password"] {
  width: 100%;
  box-sizing: border-box;
  padding: 13px 14px;
  border: 1px solid #d8d8d8;
  border-radius: 12px;
  font-size: 16px;
  background: #fff;
}

.emm-login .login-remember label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  color: #444;
}

.emm-login .login-remember input {
  width: 18px;
  height: 18px;
}

.emm-login .login-submit input,
.emm-login #emm_wp_submit {
  width: 100%;
  border: 0;
  border-radius: 14px;
  padding: 14px 18px;
  background: #1d4b02;
  color: #fff;
  font-size: 18px;
  font-weight: 800;
  cursor: pointer;
}

.emm-login .login-submit input:hover,
.emm-login #emm_wp_submit:hover {
  background: #163b01;
}

/* V0.1.2 — éditeur mobile simplifié */
.emm-textarea {
  min-height: 230px;
  resize: vertical;
  font-family: inherit;
  white-space: pre-wrap;
}

.emm-help {
  margin: -6px 0 14px;
  font-size: 13px;
  line-height: 1.45;
  color: #666;
}

.emm-toolbar button[data-emm-format="copy"],
.emm-toolbar button[data-emm-format="paste"] {
  background: #eef4ff;
  border-color: #cfdcf4;
}

.emm-login-form label {
  margin-top: 12px;
}

.emm-login-remember {
  display: flex !important;
  align-items: center;
  gap: 8px;
  margin: 12px 0 16px !important;
  font-weight: 700 !important;
}

.emm-login-help {
  margin: 12px 0 0;
  text-align: center;
}

.emm-login-help a {
  color: #9e0208 !important;
  font-weight: 700;
  text-decoration: none;
}

@media (max-width: 640px) {
  .emm-toolbar {
    position: sticky;
    top: 0;
    z-index: 20;
    background: #fff;
    padding: 8px 0;
  }

  .emm-toolbar button {
    padding: 9px 10px;
    font-size: 14px;
  }
}

/* V0.1.3 — retour visuel plus clair pendant les traitements */
.emm-status.is-visible {
  display: block !important;
  border: 1px solid rgba(0,0,0,.06);
  box-shadow: 0 6px 18px rgba(0,0,0,.07);
}

.emm-busy {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 84px;
  display: none;
  justify-content: center;
  z-index: 2147483646;
  pointer-events: none;
  padding: 0 14px;
}

.emm-busy.is-visible {
  display: flex;
}

.emm-busy-card {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-width: min(92vw, 460px);
  padding: 12px 16px;
  border-radius: 999px;
  background: rgba(0,0,0,.88);
  color: #fff;
  font-weight: 800;
  font-size: 14px;
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
}

.emm-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,.45);
  border-top-color: #fff;
  border-radius: 50%;
  animation: emm-spin .8s linear infinite;
  flex: 0 0 auto;
}

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

.emm-wrap form.is-loading .emm-submit,
.emm-login-form.is-loading .emm-submit {
  opacity: .75;
  cursor: wait;
}

.emm-toolbar button {
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
}

.emm-help {
  margin: -4px 0 14px;
  color: #666;
  font-size: 13px;
  line-height: 1.45;
}

@media (max-width: 640px) {
  .emm-busy {
    bottom: 72px;
  }

  .emm-busy-card {
    border-radius: 16px;
    width: 100%;
    justify-content: center;
  }
}

/* V0.1.4 — barre de mise en forme sous le texte pour éviter le menu Android */
.emm-toolbar-below {
  margin: 14px 0 16px !important;
  padding-top: 4px;
}

.emm-toolbar-below button {
  min-height: 42px;
  padding: 10px 12px;
}

@media (max-width: 640px) {
  .emm-toolbar-below {
    position: static !important;
    top: auto !important;
    z-index: auto !important;
    background: transparent !important;
    margin-top: 16px !important;
    margin-bottom: 18px !important;
  }

  .emm-toolbar-below button {
    min-height: 44px;
    padding: 10px 13px;
    font-size: 15px;
  }
}
