:root {
  --es-bg: #05060a;
  --es-bg-elevated: #10121b;
  --es-border: #272a3a;
  --es-text: #f4f4ff;
  --es-muted: #a3a6c0;
  --es-accent: #4f46e5;
  --es-accent-soft: rgba(79, 70, 229, 0.18);
  --es-danger: #ef4444;
  --es-radius: 10px;
  --es-shadow: 0 18px 40px rgba(0, 0, 0, 0.5);
  --es-font: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--es-font);
  background: radial-gradient(circle at top, #141726 0, #05060a 60%);
  color: var(--es-text);
}

.es-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 22px;
  border-bottom: 1px solid var(--es-border);
  background: rgba(5, 6, 10, 0.9);
  backdrop-filter: blur(14px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.es-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.es-logo-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  color: #fdfcff;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.6);
  /* niente padding, così non “si allunga” */
  padding: 0;
  box-sizing: border-box;
}


.es-subtitle {
  margin: 0;
  font-size: 13px;
  color: var(--es-muted);
}

.es-header h1 {
  margin: 0;
  font-size: 19px;
}

.es-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.es-main {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  padding: 18px 18px 28px;
  max-width: 1120px;
  margin: 0 auto;
}

.es-column {
  background: var(--es-bg-elevated);
  border-radius: var(--es-radius);
  border: 1px solid var(--es-border);
  padding: 16px;
  box-shadow: var(--es-shadow);
}

.es-column-left {
  flex: 1 1 320px;
  max-width: 420px;
}

.es-column-right {
  flex: 2 1 420px;
  min-width: 0;
}

h2 {
  margin-top: 0;
  font-size: 18px;
}

.es-form-group {
  margin-bottom: 10px;
}

.es-form-group label {
  display: block;
  font-size: 13px;
  color: var(--es-muted);
  margin-bottom: 4px;
}

input[type="text"],
textarea {
  width: 100%;
  border-radius: 8px;
  border: 1px solid var(--es-border);
  padding: 7px 9px;
  background: #05060b;
  color: var(--es-text);
  font-family: var(--es-font);
  font-size: 14px;
}

textarea {
  resize: vertical;
  min-height: 80px;
}

.es-btn {
  border-radius: 999px;
  border: 1px solid transparent;
  padding: 7px 14px;
  font-size: 14px;
  cursor: pointer;
  font-weight: 500;
}

.es-btn-primary {
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  color: #fdfcff;
  box-shadow: 0 10px 25px rgba(79, 70, 229, 0.55);
}

.es-btn-primary:hover {
  filter: brightness(1.08);
}

.es-help-text {
  font-size: 13px;
  color: var(--es-muted);
  margin-top: 2px;
  margin-bottom: 10px;
}

.es-status {
  font-size: 13px;
  margin-top: 8px;
  min-height: 18px;
}

.es-status--ok {
  color: #4ade80;
}

.es-status--err {
  color: var(--es-danger);
}

.es-divider {
  border: none;
  border-top: 1px solid var(--es-border);
  margin: 16px 0;
}

.es-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.es-chip {
  border-radius: 999px;
  border: 1px solid var(--es-border);
  padding: 3px 9px;
  font-size: 12px;
  cursor: pointer;
  background: #05060b;
  color: var(--es-muted);
}

.es-chip--active {
  background: var(--es-accent-soft);
  border-color: var(--es-accent);
  color: #e5e7ff;
}

.es-feed-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.es-feed-info {
  font-size: 12px;
  color: var(--es-muted);
}

.es-feed {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.es-post {
  border-radius: 10px;
  border: 1px solid var(--es-border);
  padding: 10px 11px;
  background: #070914;
}

.es-post-header {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--es-muted);
  margin-bottom: 4px;
}

.es-post-title {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 4px;
}

.es-post-body {
  font-size: 14px;
  margin-bottom: 4px;
  white-space: pre-wrap;
}

.es-post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 2px;
}

.es-tag-pill {
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid var(--es-border);
  color: var(--es-muted);
}

.es-tag-pill--match {
  border-color: var(--es-accent);
  color: #e5e7ff;
  background: var(--es-accent-soft);
}

.es-footer {
  border-top: 1px solid var(--es-border);
  padding: 10px 16px 18px;
  font-size: 12px;
  color: var(--es-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  background: #05060b;
}

.es-footer a {
  color: #a5b4fc;
  text-decoration: none;
}

.es-footer a:hover {
  text-decoration: underline;
}

@media (max-width: 820px) {
  .es-main {
    padding: 12px 10px 22px;
  }
}

/* ------- Overlay composer + FAB ------- */

.es-hidden {
  display: none !important;
}

/* Overlay full-screen */
.es-composer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
}

/* Finestra del composer */
.es-composer {
  width: 100%;
  max-width: 520px;
  background: var(--es-bg-elevated);
  border-radius: 16px;
  border: 1px solid var(--es-border);
  box-shadow: 0 22px 45px rgba(0, 0, 0, 0.75);
  padding: 16px 18px 14px;
}

.es-composer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.es-composer-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
}

/* Icon button per chiudere */
.es-icon-btn {
  border: none;
  background: transparent;
  color: var(--es-muted);
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 999px;
}
.es-icon-btn:hover {
  background: rgba(255, 255, 255, 0.06);
}

/* FAB per mobile */
.es-fab {
  position: fixed;
  right: 16px;
  bottom: 16px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  font-size: 24px;
  line-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  color: #fdfcff;
  box-shadow: 0 18px 30px rgba(0, 0, 0, 0.7);
  z-index: 40;
}

/* FAB piccolo per refresh */
.es-fab-small {
  width: 40px;
  height: 40px;
  font-size: 20px;
  right: auto;     /* Rimuoviamo l'ancoraggio destro */
  left: 16px;      /* Posizionato a sinistra */
  bottom: 16px;    /* Allineato verticalmente al FAB principale */
}


/* Mostra FAB solo su schermi piccoli */
@media (min-width: 821px) {
  .es-fab {
    display: none;
  }
}

/* Nascondi il bottone New Post dell'header su schermi piccoli */
@media (max-width: 820px) {
  #newPostBtn {
    display: none;
  }
}

