/* ── Commune Tools Shared Header ─────────────────────────────────── */

.commune-header {
  background: #2c3e33;
  padding: 0 24px;
  display: flex;
  align-items: center;
  height: 56px;
  font-family: 'Nunito Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  position: sticky;
  top: 0;
  z-index: 1050;
}

.commune-header .ch-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.commune-header .ch-back {
  color: rgba(244, 240, 227, 0.5);
  text-decoration: none;
  font-size: 1rem;
  display: flex;
  align-items: center;
  transition: color 0.2s;
}

.commune-header .ch-back:hover {
  color: #9aa583;
}

.commune-header .ch-logo {
  height: 24px;
}

.commune-header .ch-title {
  font-family: 'Libre Baskerville', Georgia, serif;
  color: #f4f0e3;
  font-size: 1.05rem;
  font-weight: 400;
  margin: 0;
  white-space: nowrap;
}

.commune-header .ch-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.commune-header .ch-email {
  color: rgba(244, 240, 227, 0.5);
  font-size: 0.78rem;
}

.commune-header .ch-logout {
  font-family: 'Nunito Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.78rem;
  border: 1px solid rgba(244, 240, 227, 0.2);
  color: rgba(244, 240, 227, 0.5);
  background: transparent;
  padding: 4px 12px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
}

.commune-header .ch-logout:hover {
  border-color: #9aa583;
  color: #b5c9b7;
}

/* Link to the tool's guide in the Documentation tool */
.commune-header .ch-docs {
  color: rgba(244, 240, 227, 0.75);
  font-size: 0.78rem;
  text-decoration: none;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.commune-header .ch-docs:hover {
  color: #fff;
  text-decoration: underline;
}

/* ── Nav tabs (for tools with sub-pages like Content Manager) ──── */

.commune-header .ch-tabs {
  display: flex;
  gap: 4px;
  margin-left: 16px;
}

.commune-header .ch-tab {
  font-family: 'Nunito Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.78rem;
  padding: 6px 14px;
  border-radius: 6px;
  border: 1px solid rgba(244, 240, 227, 0.15);
  background: transparent;
  color: rgba(244, 240, 227, 0.5);
  cursor: pointer;
  transition: all 0.2s;
}

.commune-header .ch-tab:hover {
  border-color: rgba(244, 240, 227, 0.3);
  color: rgba(244, 240, 227, 0.7);
}

.commune-header .ch-tab.active {
  background: rgba(244, 240, 227, 0.1);
  border-color: rgba(244, 240, 227, 0.25);
  color: #f4f0e3;
}

/* ── Responsive ────────────────────────────────────────────────── */

@media (max-width: 768px) {
  .commune-header {
    padding: 0 12px;
    height: 48px;
  }

  .commune-header .ch-logo {
    height: 20px;
  }

  .commune-header .ch-title {
    font-size: 0.9rem;
  }

  .commune-header .ch-email {
    display: none;
  }

  .commune-header .ch-tabs {
    margin-left: 8px;
  }

  .commune-header .ch-tab {
    font-size: 0.72rem;
    padding: 4px 10px;
  }
}

/* ── Sign-in modal ───────────────────────────────────────────── */

.ch-signin-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 2100;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
}

.ch-signin-overlay.visible {
  opacity: 1;
}

.ch-signin-modal {
  position: relative;
  background: #f4f0e3;
  border-radius: 16px;
  width: 90%;
  max-width: 380px;
  padding: 28px 28px 24px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.3);
  font-family: 'Nunito Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

.ch-signin-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: none;
  border: none;
  font-size: 1.1rem;
  color: #6b7d8a;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  line-height: 1;
}

.ch-signin-close:hover {
  background: #e8e2d0;
  color: #2c3e33;
}

.ch-signin-title {
  font-family: 'Libre Baskerville', Georgia, serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: #2c3e33;
  margin: 0 0 20px;
  text-align: center;
}

.ch-signin-help {
  font-size: 0.85rem;
  color: #6b7d8a;
  line-height: 1.5;
  margin: 0 0 14px;
}

.ch-signin-note {
  font-size: 0.72rem;
  color: #6b7d8a;
  line-height: 1.4;
  text-align: center;
  margin: 2px 0 10px;
}

.ch-signin-btn {
  display: block;
  width: 100%;
  font-family: 'Nunito Sans', sans-serif;
  font-size: 0.88rem;
  padding: 10px 16px;
  margin-bottom: 8px;
  background: #fff;
  color: #2c3e33;
  border: 1px solid #e8e2d0;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
}

.ch-signin-btn:hover {
  border-color: #9aa583;
  background: #fdfcf8;
}

.ch-signin-btn.primary {
  background: #3d5b47;
  color: #f4f0e3;
  border-color: #3d5b47;
}

.ch-signin-btn.primary:hover {
  background: #2c3e33;
}

.ch-signin-btn:disabled {
  opacity: 0.6;
  cursor: default;
}

.ch-signin-divider {
  position: relative;
  text-align: center;
  margin: 14px 0;
}

.ch-signin-divider::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  border-top: 1px solid #e8e2d0;
}

.ch-signin-divider span {
  position: relative;
  background: #f4f0e3;
  padding: 0 10px;
  font-size: 0.75rem;
  color: #9aa583;
}

.ch-signin-input {
  width: 100%;
  font-family: 'Nunito Sans', sans-serif;
  font-size: 0.9rem;
  padding: 10px 14px;
  margin-bottom: 10px;
  border: 1px solid #e8e2d0;
  border-radius: 10px;
  background: #fff;
  color: #333;
}

.ch-signin-input:focus {
  outline: none;
  border-color: #9aa583;
}

.ch-signin-input::placeholder {
  color: #bbb;
}

.ch-signin-code {
  text-align: center;
  font-size: 1.5rem;
  letter-spacing: 0.4em;
  font-weight: 700;
  padding: 12px;
}

.ch-signin-link {
  display: block;
  width: 100%;
  background: none;
  border: none;
  font-size: 0.8rem;
  color: #6b7d8a;
  cursor: pointer;
  text-decoration: underline;
  padding: 6px 0 0;
}

.ch-signin-link:hover {
  color: #2c3e33;
}

.ch-signin-error {
  font-size: 0.82rem;
  color: #a8452c;
  background: #f8e6e0;
  border-radius: 8px;
  padding: 8px 12px;
  margin: 12px 0 0;
}
