.fob-auth-box {
  max-width: 400px;
  margin: 24px auto;
  padding: 32px;
  background: #1a1a2e;
  border-radius: 12px;
  text-align: center;
  color: #e0e0e8;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.fob-auth-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
  color: #fff;
}
.fob-auth-desc {
  font-size: 14px;
  color: #9ca3af;
  margin-bottom: 24px;
}
.fob-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: opacity 0.2s;
  border: none;
}
.fob-btn:hover {
  opacity: 0.9;
}
.fob-btn-primary {
  background: linear-gradient(135deg, #6366f1, #818cf8);
  color: #fff;
}
.fob-btn-secondary {
  background: #2d2d4a;
  color: #e0e0e8;
}
.fob-btn-small {
  padding: 6px 14px;
  font-size: 13px;
}
.fob-status-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 16px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.fob-status-user {
  font-weight: 600;
  font-size: 14px;
}
.fob-error {
  color: #ef4444;
  padding: 12px;
  background: #fef2f2;
  border-radius: 8px;
  font-size: 14px;
}

/* Profile card (Phase 1) */
.fob-profile-card {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  max-width: 480px;
}
.fob-profile-cover-container {
  height: 120px;
  background-color: #f3f4f6;
  overflow: hidden;
}
.fob-profile-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.fob-profile-body {
  padding: 16px;
  position: relative;
}
.fob-profile-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 4px solid #fff;
  margin-top: -56px;
  object-fit: cover;
  display: block;
}
.fob-profile-name {
  margin: 8px 0 0;
  font-size: 1.25rem;
  font-weight: 600;
}
.fob-profile-handle {
  margin: 2px 0 8px;
  color: #6b7280;
  font-size: 0.875rem;
}
.fob-profile-bio {
  margin: 0 0 12px;
  color: #374151;
  font-size: 0.95rem;
  white-space: pre-line;
}
.fob-profile-links {
  list-style: none;
  padding: 0;
  margin: 0;
}
.fob-profile-links li {
  margin: 4px 0;
}
.fob-profile-links a {
  color: #2563eb;
  text-decoration: none;
  font-size: 0.875rem;
}
.fob-profile-links a:hover {
  text-decoration: underline;
}

/* --- On-site profile editor + site-defined custom fields --- */
.fob-profile-edit {
  max-width: 720px;
}
.fob-profile-edit-intro {
  margin-bottom: 20px;
}
.fob-notice {
  padding: 10px 14px;
  border-radius: 6px;
  margin-bottom: 16px;
}
.fob-notice-success {
  background: #e8f5ea;
  border: 1px solid #b6dfc0;
}
.fob-form .fob-field {
  display: block;
  margin-bottom: 18px;
}
.fob-form .fob-field > label {
  display: block;
  font-weight: 600;
  margin-bottom: 4px;
}
.fob-form .fob-field input[type="text"],
.fob-form .fob-field input[type="url"],
.fob-form .fob-field input[type="number"],
.fob-form .fob-field input[type="date"],
.fob-form .fob-field input[type="time"],
.fob-form .fob-field input[type="datetime-local"],
.fob-form .fob-field select,
.fob-form .fob-field textarea {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
.fob-field-help {
  display: block;
  font-size: 12px;
  opacity: 0.7;
  margin-top: 4px;
}
.fob-link-row {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}
.fob-link-row input:first-child {
  flex: 0 0 30%;
}
.fob-link-row input:last-child {
  flex: 1;
}
.fob-section-title {
  margin-top: 28px;
}
.fob-form-actions {
  display: flex;
  gap: 10px;
  margin-top: 24px;
}
.fob-custom-fields {
  margin-top: 18px;
  display: grid;
  gap: 8px;
}
.fob-field-row {
  display: flex;
  gap: 10px;
  align-items: baseline;
}
.fob-field-label {
  font-weight: 600;
  min-width: 140px;
}
.fob-field-image {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}

/* ---------- Organisation page ---------- */
.fob-org-page {
  --fob-org-hero-max: 1200px;
  --fob-org-body-max: 900px;
  --fob-org-side: 300px;
}
.fob-org-hero-wrap {
  max-width: var(--fob-org-hero-max);
  margin: 0 auto;
  padding: 0 16px;
}
.fob-org-hero {
  position: relative;
  aspect-ratio: 6 / 1.9;
  min-height: 160px;
  border-radius: 16px;
  background: #e9e9ef center/cover no-repeat;
}
.fob-org-hero-empty {
  background: linear-gradient(135deg, #dfe3f3, #f2eff7);
}
.fob-org-identity {
  display: flex;
  align-items: flex-end;
  gap: 20px;
  margin-top: -56px;
  padding: 0 8px 0 24px;
}
.fob-org-avatar {
  width: 128px;
  height: 128px;
  border-radius: 50%;
  object-fit: cover;
  background: #fff;
  border: 5px solid #fff;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.14);
  flex: 0 0 auto;
  z-index: 10;
}
.fob-org-avatar-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 34px;
  font-weight: 700;
  color: #4b5563;
}
.fob-org-name {
  margin: 0 0 12px;
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.15;
}
.fob-org-verified {
  color: #2563eb;
  font-size: 0.7em;
  vertical-align: middle;
}

.fob-org-shell {
  max-width: calc(var(--fob-org-body-max) + var(--fob-org-side) + 32px);
  margin: 0 auto;
  padding: 0 16px 48px;
}
.fob-org-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin: 20px 0 28px;
}
.fob-org-links {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 14px;
}
.fob-org-links a {
  font-size: 14px;
}
.fob-follow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.fob-follow-count {
  font-size: 13px;
  opacity: 0.75;
  white-space: nowrap;
}
.fob-follow-btn[disabled] {
  opacity: 0.6;
  cursor: default;
}

.fob-org-layout {
  display: grid;
  grid-template-columns: minmax(0, var(--fob-org-body-max)) var(--fob-org-side);
  gap: 32px;
  align-items: start;
}
.fob-org-main {
  min-width: 0;
}
.fob-org-side {
  position: sticky;
  top: 24px;
}
.fob-org-side:empty {
  display: block;
}
.fob-org-desc {
  line-height: 1.65;
}
.fob-org-contacts {
  margin-top: 24px;
}

@media (max-width: 1080px) {
  .fob-org-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .fob-org-side {
    position: static;
  }
  .fob-org-side:empty {
    display: none;
  }
}
@media (max-width: 640px) {
  .fob-org-hero-wrap {
    padding: 0;
  }
  .fob-org-hero {
    border-radius: 0;
    aspect-ratio: 3 / 1.4;
    min-height: 130px;
  }
  .fob-org-identity {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    margin-top: -44px;
    padding: 0 16px;
  }
  .fob-org-avatar {
    width: 92px;
    height: 92px;
    border-width: 4px;
  }
  .fob-org-name {
    margin-bottom: 0;
  }
  .fob-org-actions {
    margin: 16px 0 22px;
  }
}

/* Contact form confirmation panel */
.fob-contact-done {
  margin-top: 16px;
  max-width: 560px;
  padding: 16px 18px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.03);
}
.fob-contact-done-title {
  margin: 0 0 6px;
  font-size: 1.05rem;
}
.fob-contact-done-text {
  margin: 0;
  opacity: 0.85;
}
.fob-contact-done-actions {
  margin: 12px 0 0;
}

/* Social wall ([fob_account] / [fob_wall]) */
.fob-wall {
  max-width: 680px;
  margin: 1.5em 0;
}
.fob-wall-composer {
  display: flex;
  flex-direction: column;
  gap: 0.5em;
  padding: 1em;
  border: 1px solid #e3d7c3;
  border-radius: 12px;
  background: #fffdf8;
}
.fob-wall-composer input[type="text"],
.fob-wall-composer textarea {
  width: 100%;
  padding: 0.6em;
  border: 1px solid #d9cbb3;
  border-radius: 8px;
  color: #3b2a1a;
  background: #fff;
}
.fob-wall-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5em;
  align-items: center;
}
.fob-wall-row button {
  margin-left: auto;
}
.fob-wall-file {
  cursor: pointer;
  font-size: 0.9em;
  color: #3b2a1a;
}
.fob-wall-file input {
  display: block;
  font-size: 0.85em;
}
.fob-wall-tabs {
  display: flex;
  gap: 1em;
  margin: 1.2em 0 0.6em;
  border-bottom: 1px solid #e3d7c3;
}
.fob-wall-tabs a {
  padding: 0.4em 0;
  text-decoration: none;
  color: #6b5440;
}
.fob-wall-tabs a.is-active {
  color: #3b2a1a;
  font-weight: 600;
  border-bottom: 2px solid #1ead90;
}
.fob-wall-post {
  padding: 1em;
  margin-bottom: 0.8em;
  border: 1px solid #e3d7c3;
  border-radius: 12px;
  background: #fff;
  color: #3b2a1a;
}
.fob-wall-post header {
  display: flex;
  gap: 0.6em;
  align-items: center;
  margin-bottom: 0.4em;
}
.fob-wall-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}
.fob-wall-post img,
.fob-wall-post video {
  max-width: 100%;
  border-radius: 8px;
  margin-top: 0.5em;
}
.fob-wall-post footer {
  margin-top: 0.5em;
  font-size: 0.9em;
}
.fob-notice {
  padding: 0.6em 1em;
  border-radius: 8px;
  margin-bottom: 0.8em;
}
.fob-notice-ok {
  background: #e3f6f1;
  color: #14584a;
}
.fob-notice-err {
  background: #fbe9dc;
  color: #8a3d12;
}

/* Profile posts */
.fob-profile {
  max-width: 640px;
}
.fob-profile .fob-profile-card {
  max-width: none;
}
.fob-profile-posts {
  margin-top: 1.2em;
}
.fob-profile-posts-title {
  margin: 0 0 0.6em;
}

/* Connect (follow / friend) */
.fob-connect {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
}
.fob-connect-form {
  display: inline;
  margin: 0;
}
.fob-connect-menu {
  position: relative;
}
.fob-connect-menu > summary {
  list-style: none;
  cursor: pointer;
}
.fob-connect-menu > summary::-webkit-details-marker {
  display: none;
}
.fob-connect-dialog {
  position: absolute;
  z-index: 20;
  top: calc(100% + 0.4rem);
  left: 0;
  min-width: 18rem;
  max-width: 90vw;
  padding: 1rem;
  display: grid;
  gap: 0.75rem;
  background: #fff;
  color: #3e2c1c;
  border: 1px solid #e3d6c4;
  border-radius: 0.6rem;
  box-shadow: 0 8px 24px rgba(62, 44, 28, 0.15);
}
.fob-connect-option p {
  margin: 0.35rem 0 0;
  font-size: 0.85em;
}
.fob-connect-keep {
  display: flex;
  gap: 0.4rem;
  align-items: center;
  font-size: 0.9em;
}
.fob-connect-count {
  font-size: 0.9em;
  opacity: 0.8;
}

/* Shared button look. Used on <button> and on <summary> (the details
   toggles), so theme button styles must not be able to flatten it. */
.fob-button,
button.fob-button,
summary.fob-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  box-sizing: border-box;
  margin: 0;
  padding: 0.5rem 1.05rem;
  border: 1px solid transparent;
  border-radius: 8px;
  background: #1ead90;
  color: #fff;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}
.fob-button:hover,
.fob-button:focus-visible {
  background: #178f77;
  color: #fff;
}
/* Variants are written as .fob-button.x so they outrank the element-qualified
   base selectors above (button.fob-button, summary.fob-button). */
.fob-button.fob-button-secondary {
  background: #fffaf2;
  border-color: #e3d6c4;
  color: #3b2a1a;
}
.fob-button.fob-button-secondary:hover,
.fob-button.fob-button-secondary:focus-visible {
  background: #f6e7cf;
  color: #3b2a1a;
}
.fob-button.fob-button-danger {
  background: #b5502a;
  border-color: #b5502a;
  color: #fff;
}
.fob-button.fob-button-danger:hover,
.fob-button.fob-button-danger:focus-visible {
  background: #96401f;
  border-color: #96401f;
  color: #fff;
}
/* The current relation (Following, Friends, Request sent) reads as a quiet
   outlined control; the actions inside its dialog stay coloured. */
.fob-button.fob-connect-state,
.fob-button.fob-connect-state:hover,
.fob-button.fob-connect-state:focus-visible {
  background: #fffaf2;
  border-color: #e3d6c4;
  color: #3b2a1a;
}
.fob-button.fob-connect-friends {
  border-color: #76d7c4;
}
/* Also used on its own, on .fob-btn controls outside the connect block. */
.fob-button-danger {
  background: #b5502a;
  color: #fff;
}
.fob-connect-dialog .fob-button {
  width: 100%;
}

/* People: author links, profile preview card, search */
.fob-profile-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: inherit;
  text-decoration: none;
}
a.fob-profile-trigger {
  box-shadow: none;
  -webkit-box-shadow: none;
}
a.fob-profile-trigger:hover {
  box-shadow: none;
  -webkit-box-shadow: none;
}
.fob-profile-trigger:hover .fob-post-author-name,
.fob-profile-trigger:hover strong {
  text-decoration: underline;
}
.fob-profile-card-backdrop {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(40, 28, 18, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.fob-profile-card {
  position: relative;
  width: 100%;
  max-width: 380px;
  background: #fffaf2;
  color: #3b2a1a;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}
.fob-profile-card-cover {
  height: 120px;
  background: linear-gradient(135deg, #fad7a0, #a3e4d7) center/cover no-repeat;
}
/* Round, centred close control. The !important declarations keep a theme's
   own button styles from adding padding (which stretches the circle into an
   oval) or repainting its background grey. */
.fob-profile-card-backdrop .fob-profile-card-close,
.fob-profile-card .fob-profile-card-close {
  position: absolute;
  z-index: 1;
  top: 0.6rem;
  right: 0.6rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box !important;
  width: 2.1rem;
  height: 2.1rem;
  margin: 0;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 50% !important;
  background: #fffaf2 !important;
  color: #3b2a1a !important;
  box-shadow: 0 1px 5px rgba(40, 28, 18, 0.35);
  font-family: inherit;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}
.fob-profile-card-backdrop .fob-profile-card-close:hover,
.fob-profile-card .fob-profile-card-close:hover {
  background: #f6e7cf !important;
  color: #3b2a1a !important;
}
.fob-profile-card-close svg {
  display: block;
  width: 0.72em;
  height: 0.72em;
}
.fob-profile-card-avatar {
  display: block;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid #fffaf2;
  margin: -48px auto 0;
  position: relative;
  background: #fffaf2;
}
.fob-profile-card-body {
  padding: 0.75rem 1.25rem 1.25rem;
  text-align: center;
}
.fob-profile-card-name {
  margin: 0.25rem 0 0;
  font-size: 1.25rem;
}
.fob-profile-card-handle {
  margin: 0 0 0.75rem;
  opacity: 0.75;
}
.fob-profile-card-bio {
  margin: 0 0 1rem;
  text-align: left;
}
.fob-profile-card-visit {
  display: inline-block;
  background: #1ead90;
  color: #fff;
  padding: 0.55rem 1.2rem;
  border-radius: 8px;
  text-decoration: none;
}
.fob-people-search-form {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.fob-people-search-input {
  flex: 1;
  min-width: 0;
}
.fob-people-results {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}
.fob-people-result {
  padding: 0.75rem;
  border: 1px solid rgba(59, 42, 26, 0.15);
  border-radius: 10px;
}
.fob-people-result-bio {
  margin: 0.35rem 0 0;
}
.fob-people-result-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}

/* Profile preview: follow / befriend dialog */
.fob-profile-card-connect{margin:.75rem 0}
.fob-profile-card-connect .fob-connect-dialog{position:static;box-shadow:none}
/* Fediverse "find an account" result */
.fob-fedi-result{display:flex;flex-wrap:wrap;gap:.6rem;align-items:center;margin-top:.75rem;padding:.75rem;border:1px solid currentColor;border-color:rgba(0,0,0,.12);border-radius:8px}
.fob-fedi-result img{border-radius:50%}
/* Single site post (?fob_post=) */
.fob-site-post .fob-post-image{max-width:100%;height:auto;border-radius:6px}
.fob-site-post-delete{display:inline}

/* "Also share on fob.social" switch in the post box */
.fob-wall-syndicate { display: inline-flex; align-items: center; gap: 6px; font-size: 0.9em; cursor: pointer; }
.fob-wall-syndicate input { margin: 0; }

/* Likes and comments on wall posts */
.fob-post-like-btn, .fob-post-reply-btn { background: none; border: 0; padding: 2px 4px; font: inherit; color: inherit; cursor: pointer; border-radius: 4px; }
.fob-post-like-btn:hover, .fob-post-reply-btn:hover { text-decoration: underline; }
.fob-post-like-btn.is-liked { color: #DC7633; font-weight: 600; }
.fob-post-comments { margin-top: 12px; padding-top: 12px; border-top: 1px solid rgba(0,0,0,.08); }
.fob-comment-list { list-style: none; margin: 0 0 10px; padding: 0; }
.fob-comment { display: flex; gap: 8px; margin-bottom: 10px; }
.fob-comment-avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; flex: none; }
.fob-comment-main { flex: 1; min-width: 0; }
.fob-comment-body { margin: 2px 0 0; white-space: pre-wrap; word-wrap: break-word; }
.fob-comment-form { display: flex; gap: 8px; align-items: flex-end; }
.fob-comment-input { flex: 1; width: 100%; }
