/*
 * Openbook - foglio di stile principale.
 * Scritto a mano, senza framework CSS esterni e senza dipendenze da CDN,
 * per rispettare i vincoli di installazione su shared hosting e la
 * politica privacy-first del progetto (nessuna risorsa remota obbligatoria).
 */

:root {
  color-scheme: light;

  --ob-color-bg: #f0f2f5;
  --ob-color-surface: #ffffff;
  --ob-color-border: #dde1e6;
  --ob-color-text: #1c1e21;
  --ob-color-text-muted: #5b6270;
  --ob-color-primary: #1877f2;
  --ob-color-primary-dark: #145dbf;
  --ob-color-primary-soft: #e7f0fe;
  --ob-color-primary-contrast: #ffffff;
  --ob-color-danger: #b3261e;
  --ob-color-success: #1e6b3e;
  --ob-radius: 10px;
  --ob-shadow: 0 1px 2px rgba(20, 24, 34, 0.06), 0 1px 8px rgba(20, 24, 34, 0.05);
  --ob-max-width: 680px;
  --ob-max-width-wide: 1600px;
  --ob-font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--ob-font);
  background: var(--ob-color-bg);
  color: var(--ob-color-text);
  line-height: 1.5;
  font-size: 16px;
}

a {
  color: var(--ob-color-primary);
  text-decoration: none;
}

a:hover,
a:focus {
  text-decoration: underline;
}

:focus-visible {
  outline: 3px solid var(--ob-color-primary);
  outline-offset: 2px;
}

img {
  max-width: 100%;
  display: block;
}

h1, h2, h3, h4 {
  line-height: 1.25;
  margin: 0 0 0.5em;
}

p {
  margin: 0 0 1em;
}

.ob-skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--ob-color-primary);
  color: #fff;
  padding: 0.75em 1em;
  z-index: 1000;
  border-radius: 0 0 var(--ob-radius) 0;
}

.ob-skip-link:focus {
  left: 0;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Header */

.ob-header {
  background: var(--ob-color-surface);
  border-bottom: 1px solid var(--ob-color-border);
  position: sticky;
  top: 0;
  z-index: 30;
}

.ob-header__inner {
  max-width: var(--ob-max-width-wide);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.6rem 1.25rem;
  position: relative;
}

.ob-header__start {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.ob-header__center {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.ob-header__center .ob-compose-btn {
  pointer-events: auto;
}

.ob-brand {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--ob-color-primary);
  letter-spacing: -0.02em;
}

.ob-brand:hover,
.ob-brand:focus {
  text-decoration: none;
}

.ob-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.ob-nav--icons {
  gap: 0.4rem;
}

.ob-nav--icons form {
  display: inline-flex;
}

.ob-header__end {
  position: relative;
  display: flex;
  align-items: center;
  margin-left: auto;
}

.ob-compose-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  text-decoration: none;
  opacity: 0;
  visibility: hidden;
  transform: scale(0.92);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease, background-color 0.15s ease, box-shadow 0.15s ease;
  pointer-events: none;
}

.ob-compose-btn.is-visible {
  opacity: 1;
  visibility: visible;
  transform: scale(1);
  pointer-events: auto;
}

.ob-compose-btn .ob-icon {
  width: 22px;
  height: 22px;
}

.ob-compose-btn--header {
  width: 40px;
  height: 40px;
  background: var(--ob-color-primary);
  color: var(--ob-color-primary-contrast);
  box-shadow: 0 2px 8px rgba(24, 119, 242, 0.28);
}

.ob-compose-btn--header:hover,
.ob-compose-btn--header:focus-visible {
  background: var(--ob-color-primary-dark);
  color: var(--ob-color-primary-contrast);
  text-decoration: none;
}

.ob-compose-btn--fab {
  display: none;
  position: fixed;
  right: 1rem;
  bottom: 1.15rem;
  z-index: 28;
  width: 48px;
  height: 48px;
  background: var(--ob-color-surface);
  color: var(--ob-color-primary);
  border: 1px solid var(--ob-color-border);
  box-shadow: 0 4px 14px rgba(28, 30, 33, 0.12);
}

.ob-compose-btn--fab:hover,
.ob-compose-btn--fab:focus-visible {
  background: var(--ob-color-primary);
  color: var(--ob-color-primary-contrast);
  border-color: var(--ob-color-primary);
  text-decoration: none;
  box-shadow: 0 6px 18px rgba(28, 30, 33, 0.16);
}

.ob-compose-btn--fab .ob-icon {
  width: 22px;
  height: 22px;
}

/* Dialog "nuovo post" (pulsante + fuori home) */

html.ob-compose-modal-open {
  overflow: hidden;
}

.ob-compose-modal {
  position: fixed;
  inset: 0;
  z-index: 45;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}

.ob-compose-modal[hidden] {
  display: none;
}

.ob-compose-modal__backdrop {
  position: absolute;
  inset: 0;
  border: none;
  padding: 0;
  margin: 0;
  background: rgba(16, 18, 24, 0.48);
  cursor: pointer;
}

.ob-compose-modal__dialog {
  position: relative;
  z-index: 1;
  width: min(100%, 34rem);
  max-height: min(90vh, 34rem);
  display: flex;
  flex-direction: column;
  background: var(--ob-color-surface);
  border: 1px solid var(--ob-color-border);
  border-radius: calc(var(--ob-radius) + 2px);
  box-shadow: 0 16px 40px rgba(28, 30, 33, 0.18);
  overflow: hidden;
}

.ob-compose-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--ob-color-border);
  flex-shrink: 0;
}

.ob-compose-modal__title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.3;
}

.ob-compose-modal__close {
  flex-shrink: 0;
}

.ob-compose-modal__body {
  padding: 1rem;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.ob-composer--in-modal {
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  box-shadow: none;
}

.ob-composer--in-modal .ob-composer__toolbar {
  position: sticky;
  bottom: 0;
  background: var(--ob-color-surface);
  padding-top: 0.75rem;
}

@media (max-width: 640px) {
  .ob-compose-modal {
    padding: 0.75rem;
    align-items: flex-end;
  }

  .ob-compose-modal__dialog {
    width: 100%;
    max-height: min(92vh, 36rem);
    border-radius: calc(var(--ob-radius) + 4px) calc(var(--ob-radius) + 4px) 0 0;
  }
}

.ob-nav__label {
  display: none;
}

.ob-nav__link {
  padding: 0.5rem 0.9rem;
  border-radius: var(--ob-radius);
  color: var(--ob-color-text);
  font-weight: 500;
}

.ob-nav__link:hover,
.ob-nav__link:focus {
  background: var(--ob-color-bg);
  text-decoration: none;
}

.ob-icon-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: var(--ob-color-bg);
  color: var(--ob-color-text);
  cursor: pointer;
  flex-shrink: 0;
}

.ob-icon-btn:hover,
.ob-icon-btn:focus-visible {
  background: var(--ob-color-primary-soft);
  color: var(--ob-color-primary);
  text-decoration: none;
}

.ob-icon-btn .ob-icon {
  width: 20px;
  height: 20px;
}

.ob-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.ob-sidebar-toggle,
.ob-nav-toggle {
  display: none;
}

.ob-header__avatar-link {
  display: inline-flex;
  border-radius: 50%;
}

.ob-badge-dot {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--ob-color-danger);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--ob-color-surface);
}

/* Header: ricerca inline e dropdown notifiche */

.ob-header-search,
.ob-header-dropdown {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.ob-header-search.is-open .ob-header-search__form {
  display: flex;
}

.ob-header-search__form {
  position: absolute;
  top: calc(100% + 0.45rem);
  right: 0;
  z-index: 40;
  display: none;
  align-items: center;
  gap: 0.4rem;
  min-width: min(22rem, calc(100vw - 2rem));
  padding: 0.55rem;
  background: var(--ob-color-surface);
  border: 1px solid var(--ob-color-border);
  border-radius: var(--ob-radius);
  box-shadow: 0 10px 28px rgba(28, 30, 33, 0.14);
}

.ob-header-search__form[hidden] {
  display: none !important;
}

.ob-header-search__form input[type="search"] {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--ob-color-border);
  border-radius: var(--ob-radius);
  font: inherit;
  background: var(--ob-color-bg);
}

.ob-header-search__form input[type="search"]:focus {
  outline: 2px solid var(--ob-color-primary-soft);
  border-color: var(--ob-color-primary);
}

.ob-header-dropdown__panel {
  position: absolute;
  top: calc(100% + 0.45rem);
  right: 0;
  z-index: 40;
  width: min(22rem, calc(100vw - 2rem));
  max-height: min(28rem, calc(100vh - 5rem));
  overflow: auto;
  padding: 0.35rem 0;
  background: var(--ob-color-surface);
  border: 1px solid var(--ob-color-border);
  border-radius: var(--ob-radius);
  box-shadow: 0 10px 28px rgba(28, 30, 33, 0.14);
}

.ob-header-dropdown__panel[hidden] {
  display: none;
}

.ob-header-dropdown__title {
  padding: 0.55rem 0.9rem 0.35rem;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ob-color-text-muted);
}

.ob-header-dropdown__empty {
  margin: 0;
  padding: 1rem 0.9rem;
  color: var(--ob-color-text-muted);
  font-size: 0.9rem;
}

.ob-header-dropdown__footer {
  display: block;
  padding: 0.7rem 0.9rem;
  border-top: 1px solid var(--ob-color-border);
  text-align: center;
  font-weight: 600;
  font-size: 0.9rem;
}

.ob-header-dropdown__footer:hover {
  background: var(--ob-color-bg);
  text-decoration: none;
}

.ob-header-notification {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  padding: 0.7rem 0.9rem;
  color: inherit;
  text-decoration: none;
}

.ob-header-notification:hover {
  background: var(--ob-color-bg);
  text-decoration: none;
}

.ob-header-notification--unread {
  background: #eef3fd;
}

.ob-header-notification__body {
  min-width: 0;
  font-size: 0.9rem;
  line-height: 1.35;
}

/* Buttons */

.ob-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4em;
  padding: 0.6rem 1.1rem;
  border-radius: var(--ob-radius);
  border: 1px solid transparent;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  background: var(--ob-color-bg);
  color: var(--ob-color-text);
}

.ob-btn:hover {
  text-decoration: none;
  filter: brightness(0.97);
}

.ob-btn--primary {
  background: var(--ob-color-primary);
  color: var(--ob-color-primary-contrast);
}

.ob-btn--primary:hover {
  background: var(--ob-color-primary-dark);
}

.ob-btn--ghost {
  background: transparent;
  border-color: var(--ob-color-border);
}

.ob-btn--block {
  width: 100%;
}

.ob-btn--small {
  padding: 0.4rem 0.7rem;
  font-size: 0.85rem;
}

.ob-btn .ob-icon {
  width: 17px;
  height: 17px;
}

/* Layout */

.ob-shell {
  max-width: var(--ob-max-width);
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
}

.ob-shell--with-sidebars {
  max-width: var(--ob-max-width-wide);
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr) 300px;
  align-items: start;
  gap: 1.5rem;
}

.ob-main {
  min-width: 0;
}

.ob-sidebar {
  position: sticky;
  top: calc(1.5rem + 60px);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 0;
}

.ob-card {
  background: var(--ob-color-surface);
  border: 1px solid var(--ob-color-border);
  border-radius: var(--ob-radius);
  box-shadow: var(--ob-shadow);
  padding: 1.5rem;
}

.ob-card + .ob-card {
  margin-top: 1rem;
}

.ob-sidebar .ob-card + .ob-card {
  margin-top: 0;
}

.ob-narrow {
  max-width: 420px;
  margin: 2rem auto;
}

/* Sidebar sinistra */

.ob-mini-profile {
  padding: 1rem;
}

.ob-mini-profile__link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--ob-color-text);
}

.ob-mini-profile__link:hover {
  text-decoration: none;
}

.ob-mini-profile__name {
  font-weight: 700;
}

.ob-mini-profile__handle {
  color: var(--ob-color-text-muted);
  font-size: 0.85rem;
}

.ob-side-nav {
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.ob-side-nav form {
  display: contents;
}

.ob-side-nav__link {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.65rem 0.75rem;
  border-radius: var(--ob-radius);
  color: var(--ob-color-text);
  font-weight: 600;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  font-family: inherit;
}

.ob-side-nav__link:hover,
.ob-side-nav__link:focus-visible {
  background: var(--ob-color-bg);
  text-decoration: none;
}

.ob-side-nav__link.is-active {
  background: var(--ob-color-primary-soft);
  color: var(--ob-color-primary);
}

.ob-side-nav__link .ob-icon {
  width: 20px;
  height: 20px;
  color: var(--ob-color-primary);
  flex-shrink: 0;
}

.ob-badge-count {
  margin-left: auto;
  background: var(--ob-color-danger);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
}

/* Sidebar destra */

.ob-side-widget__title {
  font-size: 1.05rem;
  margin-bottom: 0.85rem;
}

.ob-side-widget__instance {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  margin-bottom: 0.35rem;
}

.ob-instance-staff {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--ob-color-border);
}

.ob-instance-staff__title {
  font-size: 1rem;
  margin: 0 0 0.75rem;
}

.ob-instance-staff__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.ob-instance-staff__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.55rem 0;
  border-top: 1px solid var(--ob-color-border);
}

.ob-instance-staff__item:first-child {
  border-top: none;
  padding-top: 0;
}

.ob-instance-staff__role {
  flex-shrink: 0;
  color: var(--ob-color-text-muted);
  font-size: 0.85rem;
}

.ob-suggestion {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.6rem 0;
  border-top: 1px solid var(--ob-color-border);
}

.ob-suggestion:first-of-type {
  border-top: none;
  padding-top: 0;
}

.ob-welcome__intro {
  margin-bottom: 0.25rem;
}

.ob-welcome__title {
  margin: 0 0 0.35rem;
  font-size: 1.25rem;
}

.ob-welcome__body {
  margin: 0;
  color: var(--ob-color-text-muted);
}

.ob-welcome__section {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--ob-color-border);
}

.ob-welcome__section-title {
  margin: 0 0 0.65rem;
  font-size: 0.95rem;
}

.ob-welcome__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--ob-color-border);
}

.ob-welcome__actions .ob-field__help {
  margin: 0;
  flex: 1 1 100%;
}

.ob-hashtag-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.ob-hashtag-list li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.5rem 0;
  border-top: 1px solid var(--ob-color-border);
}

.ob-hashtag-list li:first-child {
  border-top: none;
  padding-top: 0;
}

.ob-hashtag-list a {
  font-weight: 600;
}

.ob-hashtag-list--full li {
  padding: 0.75rem 0;
}

.ob-side-widget__more {
  display: inline-block;
  margin-top: 0.75rem;
  font-size: 0.9rem;
  font-weight: 600;
}

.ob-sidebar-footer {
  margin-top: auto;
  padding: 0.5rem 0.25rem 0;
  color: var(--ob-color-text-muted);
  font-size: 0.85rem;
  line-height: 1.4;
}

.ob-sidebar-footer a {
  color: inherit;
  text-decoration: underline;
}

/* Menu mobile */

.ob-sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 24, 34, 0.4);
  z-index: 29;
}

.ob-sidebar-overlay[hidden] {
  display: none;
}

/* Lightbox immagini */

.ob-lightbox {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 12, 18, 0.92);
  z-index: 50;
  padding: 3rem 1rem;
}

.ob-lightbox[hidden] {
  display: none;
}

.ob-lightbox__img {
  max-width: 100%;
  max-height: 100%;
  border-radius: var(--ob-radius);
  object-fit: contain;
}

.ob-lightbox__close,
.ob-lightbox__nav {
  position: fixed;
  background: rgba(28, 30, 33, 0.6);
  color: #fff;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ob-lightbox__close:hover,
.ob-lightbox__nav:hover {
  background: rgba(28, 30, 33, 0.85);
}

.ob-lightbox__close {
  top: 1rem;
  right: 1rem;
  width: 44px;
  height: 44px;
}

.ob-lightbox__close .ob-icon {
  width: 22px;
  height: 22px;
}

.ob-lightbox__nav {
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
  font-size: 2rem;
  line-height: 1;
}

.ob-lightbox__nav--prev {
  left: 1rem;
}

.ob-lightbox__nav--next {
  right: 1rem;
}

.ob-lightbox__nav[hidden] {
  display: none;
}

@media (max-width: 640px) {
  .ob-lightbox {
    padding: 4rem 0.5rem;
  }

  .ob-lightbox__nav {
    width: 44px;
    height: 44px;
    font-size: 1.6rem;
  }
}

/* Forms */

.ob-field {
  margin-bottom: 1.1rem;
}

.ob-field label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.ob-field input[type='text'],
.ob-field input[type='email'],
.ob-field input[type='password'],
.ob-field input[type='url'],
.ob-field textarea,
.ob-field select {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--ob-color-border);
  border-radius: var(--ob-radius);
  font-size: 1rem;
  font-family: inherit;
  background: #fff;
  color: var(--ob-color-text);
}

.ob-field textarea {
  resize: vertical;
  min-height: 5rem;
}

.ob-field input:focus,
.ob-field textarea:focus,
.ob-field select:focus {
  border-color: var(--ob-color-primary);
}

.ob-field__help {
  font-size: 0.85rem;
  color: var(--ob-color-text-muted);
  margin-top: 0.3rem;
}

.ob-field__error {
  font-size: 0.85rem;
  color: var(--ob-color-danger);
  margin-top: 0.3rem;
}

.ob-checkbox {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 400;
}

/* Impostazioni */

.ob-settings-link-row {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.ob-settings-link-row input[type='text'] {
  flex: 0 0 35%;
}

.ob-settings-link-row input[type='url'] {
  flex: 1;
}

.ob-settings-avatar-picker {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.ob-settings-cover-preview {
  width: 100%;
  max-height: 160px;
  object-fit: cover;
  border-radius: var(--ob-radius);
  margin-bottom: 0.5rem;
  display: block;
}

/* Alerts */

.ob-alert {
  padding: 0.85rem 1rem;
  border-radius: var(--ob-radius);
  margin-bottom: 1rem;
  border: 1px solid transparent;
}

.ob-alert--success {
  background: #e9f6ee;
  border-color: #bfe3cb;
  color: var(--ob-color-success);
}

.ob-alert--error {
  background: #fbebe9;
  border-color: #f0c4bf;
  color: var(--ob-color-danger);
}

.ob-alert--info {
  background: var(--ob-color-primary-soft);
  border-color: #cfe0fb;
  color: var(--ob-color-text-muted);
}

.ob-alert ul {
  margin: 0.3em 0 0 1.2em;
  padding: 0;
}

/* Profile */

.ob-profile-cover {
  height: 180px;
  border-radius: var(--ob-radius) var(--ob-radius) 0 0;
  background: linear-gradient(135deg, var(--ob-color-primary), var(--ob-color-primary-dark));
}

.ob-profile-header {
  padding: 0 1.5rem 1.5rem;
  position: relative;
}

.ob-profile-avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  border: 4px solid var(--ob-color-surface);
  background: var(--ob-color-bg);
  margin-top: -48px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 700;
  color: var(--ob-color-primary);
  overflow: hidden;
}

.ob-profile-name {
  margin-top: 0.75rem;
}

.ob-profile-handle {
  color: var(--ob-color-text-muted);
  font-size: 0.95rem;
}

.ob-profile-bio {
  margin: 0.75rem 0 0;
  overflow-wrap: anywhere;
}

.ob-profile-stats {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-top: 0;
}

.ob-profile-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.ob-profile-toolbar__actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}

.ob-profile-toolbar__form {
  display: inline-flex;
  margin: 0;
}

.ob-profile-toolbar__message {
  flex-shrink: 0;
}

.ob-profile-stats strong {
  display: block;
  font-size: 1.1rem;
}

.ob-profile-stats span {
  color: var(--ob-color-text-muted);
  font-size: 0.85rem;
}

.ob-profile-stats a {
  color: var(--ob-color-text);
}

.ob-badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: var(--ob-color-bg);
  border: 1px solid var(--ob-color-border);
  font-size: 0.8rem;
  color: var(--ob-color-text-muted);
}

.ob-empty-state {
  text-align: center;
  color: var(--ob-color-text-muted);
  padding: 2rem 1rem;
}

/* Home hero */

.ob-hero {
  text-align: center;
  padding: 3rem 1rem;
}

.ob-hero h1 {
  font-size: 2rem;
}

.ob-hero p {
  color: var(--ob-color-text-muted);
  max-width: 46ch;
  margin: 0 auto 1.5rem;
}

.ob-hero-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}

.ob-footer {
  text-align: center;
  color: var(--ob-color-text-muted);
  font-size: 0.85rem;
  padding: 2rem 1rem;
}

.ob-footer a {
  color: inherit;
  text-decoration: underline;
}

/* Composer */

#ob-composer,
[data-composer] {
  /* Ancore / scrollIntoView: lascia spazio sotto la sticky header. */
  scroll-margin-top: 5.25rem;
  max-width: 100%;
  min-width: 0;
}

.ob-composer__main {
  display: flex;
  gap: 0.75rem;
  align-items: stretch;
  min-width: 0;
  max-width: 100%;
}

.ob-composer__aside {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  flex: 0 0 auto;
  gap: 0.35rem;
  min-height: 100%;
}

.ob-composer__avatar {
  flex: 0 0 auto;
}

.ob-composer__body-field {
  flex: 1 1 auto;
  margin-bottom: 0;
  min-width: 0;
  max-width: 100%;
}

.ob-composer__label {
  display: block;
  margin: 0 0 0.35rem;
}

.ob-composer__tip {
  position: relative;
  flex: 0 0 auto;
  line-height: 0;
}

.ob-composer__tip-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ob-color-text-muted);
  cursor: pointer;
  list-style: none;
  line-height: 0;
}

.ob-composer__tip-trigger::-webkit-details-marker {
  display: none;
}

.ob-composer__tip-trigger .ob-icon {
  width: 1rem;
  height: 1rem;
}

.ob-composer__tip[open] > .ob-composer__tip-trigger {
  color: var(--ob-color-primary);
  background: transparent;
}

.ob-composer__tip-panel {
  position: absolute;
  left: calc(100% + 0.4rem);
  bottom: 0;
  z-index: 20;
  width: min(18rem, calc(100vw - 4.5rem));
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--ob-color-border);
  border-radius: var(--ob-radius);
  background: var(--ob-color-surface);
  box-shadow: var(--ob-shadow);
  color: var(--ob-color-text-muted);
  font-size: 0.875rem;
  line-height: 1.4;
}

.ob-composer__main textarea {
  border-radius: 1.25rem;
  background: var(--ob-color-bg);
  border-color: transparent;
  resize: none;
  overflow-y: auto;
  max-height: 320px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.ob-composer__main textarea:focus {
  background: var(--ob-color-surface);
  border-color: var(--ob-color-primary);
}

.ob-composer__panels {
  min-width: 0;
}

.ob-composer__panel {
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--ob-color-border);
}

.ob-composer__panel .ob-field {
  margin-bottom: 0.75rem;
}

.ob-composer__panel .ob-field:last-child {
  margin-bottom: 0;
}

.ob-composer__toolbar {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.75rem;
  margin-top: 0.85rem;
  padding-top: 0.6rem;
  border-top: 1px solid var(--ob-color-border);
  min-width: 0;
}

.ob-composer__toggles {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
}

.ob-composer__submit {
  width: 100%;
}

.ob-composer__toggle.is-active,
.ob-composer__toggle.is-filled {
  background: var(--ob-color-primary-soft);
  color: var(--ob-color-primary);
}

.ob-composer__toggle.is-filled:not(.is-active) {
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ob-color-primary) 35%, transparent);
}

.ob-composer--reply {
  margin-top: 0;
  padding: 0.85rem 1rem;
}

@media (max-width: 520px) {
  .ob-composer__main {
    gap: 0.55rem;
  }

  .ob-composer__avatar {
    width: 36px !important;
    height: 36px !important;
    font-size: 0.95rem;
  }

  .ob-composer__tip-panel {
    left: 0;
    bottom: calc(100% + 0.35rem);
    width: min(16rem, calc(100vw - 2rem));
  }
}

.ob-report-preview {
  margin-top: 1rem;
}

.ob-report-preview > .ob-post--embed {
  margin: 0;
  box-shadow: none;
  border: 1px solid var(--ob-color-border);
  background: var(--ob-color-bg);
  padding: 0.85rem 1rem;
}

.ob-stack > .ob-field + .ob-field {
  margin-top: 1rem;
}


.ob-emoji-picker {
  position: fixed;
  z-index: 40;
  display: flex;
  flex-direction: column;
  width: min(320px, calc(100vw - 1rem));
  height: 360px;
  max-height: calc(100vh - 1rem);
  background: var(--ob-color-surface);
  border: 1px solid var(--ob-color-border);
  border-radius: var(--ob-radius);
  box-shadow: 0 12px 32px rgba(28, 30, 33, 0.16);
  overflow: hidden;
}

.ob-emoji-picker[hidden] {
  display: none;
}

.ob-emoji-picker__header {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex: 0 0 auto;
  padding: 0.55rem 0.55rem 0.35rem;
  border-bottom: 1px solid var(--ob-color-border);
}

.ob-emoji-picker__search {
  flex: 1 1 auto;
  min-width: 0;
  height: 36px;
  padding: 0 0.7rem;
  border: 1px solid var(--ob-color-border);
  border-radius: calc(var(--ob-radius) - 2px);
  background: var(--ob-color-bg);
  color: var(--ob-color-text);
  font: inherit;
}

.ob-emoji-picker__search:focus {
  outline: 2px solid var(--ob-color-primary-soft);
  border-color: var(--ob-color-primary);
}

.ob-emoji-picker__close {
  width: 36px;
  height: 36px;
  font-size: 1.25rem;
  line-height: 1;
}

.ob-emoji-picker__tabs {
  display: flex;
  flex: 0 0 auto;
  gap: 0.15rem;
  padding: 0.35rem 0.45rem;
  overflow-x: auto;
  border-bottom: 1px solid var(--ob-color-border);
  scrollbar-width: thin;
}

.ob-emoji-picker__tab {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
}

.ob-emoji-picker__tab:hover,
.ob-emoji-picker__tab:focus-visible {
  background: var(--ob-color-bg);
}

.ob-emoji-picker__tab.is-active {
  background: var(--ob-color-primary-soft);
}

.ob-emoji-picker__grid {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 0.15rem;
  align-content: start;
  padding: 0.45rem;
}

.ob-emoji-picker__emoji {
  width: 100%;
  aspect-ratio: 1;
  border: none;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  font-size: 1.35rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.ob-emoji-picker__emoji:hover,
.ob-emoji-picker__emoji:focus-visible {
  background: var(--ob-color-bg);
}

.ob-emoji-picker__empty {
  grid-column: 1 / -1;
  margin: 1rem 0.5rem;
  color: var(--ob-color-text-muted);
  font-size: 0.9rem;
  text-align: center;
}

@media (max-width: 480px) {
  .ob-emoji-picker__grid {
    grid-template-columns: repeat(7, minmax(0, 1fr));
  }
}

/* Post */

.ob-post {
  padding: 1.25rem 1.5rem;
}

.ob-post__header {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.ob-post__meta {
  flex: 1 1 auto;
  min-width: 0;
}

.ob-post__menu {
  position: relative;
  flex-shrink: 0;
  margin-left: auto;
}

.ob-post__menu > summary {
  list-style: none;
}

.ob-post__menu > summary::-webkit-details-marker {
  display: none;
}

.ob-post__menu-panel {
  position: absolute;
  top: calc(100% + 0.25rem);
  right: 0;
  z-index: 5;
  min-width: 10rem;
  padding: 0.35rem;
  background: var(--ob-color-surface);
  border: 1px solid var(--ob-color-border);
  border-radius: var(--ob-radius);
  box-shadow: 0 8px 24px rgba(28, 30, 33, 0.12);
}

.ob-post__menu-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.55rem 0.7rem;
  border: none;
  border-radius: calc(var(--ob-radius) - 2px);
  background: transparent;
  color: var(--ob-color-text);
  font: inherit;
  font-size: 0.9rem;
  text-align: left;
  cursor: pointer;
}

.ob-post__menu-item:hover,
.ob-post__menu-item:focus-visible {
  background: var(--ob-color-bg);
}

.ob-post__menu form .ob-post__menu-item:hover,
.ob-post__menu form .ob-post__menu-item:focus-visible {
  color: #b42318;
}

.ob-post__menu form {
  display: block;
  margin: 0;
}

.ob-post__share-menu {
  position: relative;
}

.ob-post__share-menu > summary {
  list-style: none;
}

.ob-post__share-menu > summary::-webkit-details-marker {
  display: none;
}

.ob-post__share-menu .ob-post__menu-panel {
  top: auto;
  bottom: calc(100% + 0.35rem);
  left: 0;
  right: auto;
  min-width: 13rem;
}

.ob-post__share-menu .ob-post__menu-item:hover,
.ob-post__share-menu .ob-post__menu-item:focus-visible {
  color: var(--ob-color-text);
}

a.ob-post__menu-item {
  text-decoration: none;
  color: inherit;
  box-sizing: border-box;
}

.ob-post__quote {
  margin-top: 0.85rem;
}

.ob-post__quote > .ob-post--embed,
.ob-composer__quote > .ob-post--embed {
  margin: 0;
  box-shadow: none;
  border: 1px solid var(--ob-color-border);
  background: var(--ob-color-bg);
  padding: 0.85rem 1rem;
}

.ob-composer__quote-banner {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
  color: var(--ob-color-text-muted);
  font-size: 0.9rem;
  font-weight: 600;
}

.ob-composer__quote-banner .ob-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.ob-composer__quote-cancel {
  margin-left: auto;
  font-weight: 500;
  font-size: 0.85rem;
}

.ob-composer__quote {
  margin: 0.75rem 0 0.25rem;
}

.ob-post__shared-by {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--ob-color-text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.ob-post__shared-by .ob-icon {
  width: 14px;
  height: 14px;
}

.ob-post__shared-by a {
  color: inherit;
}

.ob-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--ob-color-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--ob-color-primary);
  overflow: hidden;
  flex-shrink: 0;
}

.ob-avatar img,
.ob-profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ob-post__author {
  font-weight: 600;
  color: var(--ob-color-text);
}

.ob-post__author:hover {
  text-decoration: none;
}

.ob-post__handle,
.ob-post__time {
  color: var(--ob-color-text-muted);
  font-size: 0.85rem;
}

.ob-post__title {
  margin-bottom: 0.4rem;
}

.ob-post__community {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0 0 0.5rem;
  color: var(--ob-color-text-muted);
  font-size: 0.9rem;
}

.ob-post__community .ob-icon {
  width: 1rem;
  height: 1rem;
}

.ob-community-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.ob-community-list__item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 0;
  border-top: 1px solid var(--ob-color-border);
}

.ob-community-list__item:first-child {
  border-top: none;
  padding-top: 0;
}

.ob-community-list__meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.35rem;
  flex-shrink: 0;
}

.ob-community-manage {
  padding: 0;
}

.ob-community-manage__summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1.1rem 1.5rem;
  list-style: none;
  cursor: pointer;
  font-weight: 600;
  user-select: none;
}

.ob-community-manage__summary::-webkit-details-marker {
  display: none;
}

.ob-community-manage__summary .ob-icon {
  width: 1.1rem;
  height: 1.1rem;
  color: var(--ob-color-text-muted);
  transition: transform 0.15s ease;
}

.ob-community-manage[open] > .ob-community-manage__summary .ob-icon {
  transform: rotate(180deg);
}

.ob-community-manage__body {
  padding: 0 1.5rem 1.5rem;
  border-top: 1px solid var(--ob-color-border);
  padding-top: 1rem;
}

.ob-post__body {
  white-space: normal;
  overflow-wrap: anywhere;
}

.ob-post__body > :first-child,
.ob-comment__body > :first-child,
.ob-profile-bio > :first-child {
  margin-top: 0;
}

.ob-post__body > :last-child,
.ob-comment__body > :last-child,
.ob-profile-bio > :last-child {
  margin-bottom: 0;
}

.ob-post__body :is(p, ul, ol, blockquote, pre, table),
.ob-comment__body :is(p, ul, ol, blockquote, pre, table),
.ob-profile-bio :is(p, ul, ol, blockquote, pre, table) {
  margin: 0.65em 0;
}

.ob-post__body :is(h1, h2, h3, h4, h5, h6),
.ob-comment__body :is(h1, h2, h3, h4, h5, h6),
.ob-profile-bio :is(h1, h2, h3, h4, h5, h6) {
  margin: 0.85em 0 0.4em;
  line-height: 1.25;
  font-weight: 700;
}

.ob-post__body h1,
.ob-comment__body h1,
.ob-profile-bio h1 {
  font-size: 1.35rem;
}

.ob-post__body h2,
.ob-comment__body h2,
.ob-profile-bio h2 {
  font-size: 1.2rem;
}

.ob-post__body h3,
.ob-comment__body h3,
.ob-profile-bio h3 {
  font-size: 1.1rem;
}

.ob-post__body :is(h4, h5, h6),
.ob-comment__body :is(h4, h5, h6),
.ob-profile-bio :is(h4, h5, h6) {
  font-size: 1rem;
}

.ob-post__body :is(ul, ol),
.ob-comment__body :is(ul, ol),
.ob-profile-bio :is(ul, ol) {
  padding-left: 1.35rem;
}

.ob-post__body li + li,
.ob-comment__body li + li,
.ob-profile-bio li + li {
  margin-top: 0.2em;
}

.ob-post__body blockquote,
.ob-comment__body blockquote,
.ob-profile-bio blockquote {
  margin-left: 0;
  padding: 0.15rem 0 0.15rem 0.85rem;
  border-left: 3px solid var(--ob-color-border);
  color: var(--ob-color-text-muted);
}

.ob-post__body :is(code, pre),
.ob-comment__body :is(code, pre),
.ob-profile-bio :is(code, pre) {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92em;
}

.ob-post__body code,
.ob-comment__body code,
.ob-profile-bio code {
  padding: 0.1em 0.35em;
  border-radius: 0.25rem;
  background: color-mix(in srgb, var(--ob-color-border) 55%, transparent);
}

.ob-post__body pre,
.ob-comment__body pre,
.ob-profile-bio pre {
  padding: 0.75rem 0.9rem;
  border-radius: var(--ob-radius);
  overflow-x: auto;
  background: color-mix(in srgb, var(--ob-color-border) 45%, transparent);
}

.ob-post__body pre code,
.ob-comment__body pre code,
.ob-profile-bio pre code {
  padding: 0;
  background: transparent;
}

.ob-post__body table,
.ob-comment__body table,
.ob-profile-bio table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95em;
}

.ob-post__body :is(th, td),
.ob-comment__body :is(th, td),
.ob-profile-bio :is(th, td) {
  border: 1px solid var(--ob-color-border);
  padding: 0.35rem 0.55rem;
  text-align: left;
}

.ob-post__excerpt {
  margin: 0;
}

.ob-post__excerpt-summary {
  list-style: none;
  cursor: pointer;
}

.ob-post__excerpt-summary::-webkit-details-marker {
  display: none;
}

.ob-post__excerpt[open] > .ob-post__excerpt-summary {
  display: none;
}

.ob-post__more {
  color: var(--ob-color-primary);
  font-weight: 600;
  text-decoration: underline;
  white-space: nowrap;
}

.ob-post__video {
  position: relative;
  width: 100%;
  margin: 0.85rem 0 0.25rem;
  aspect-ratio: 16 / 9;
  border-radius: var(--ob-radius);
  overflow: hidden;
  background: #0b0d12;
}

.ob-post__video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.ob-post__body .hashtag,
.ob-post__body .mention,
.ob-profile-bio .hashtag,
.ob-profile-bio .mention,
.ob-field__help .hashtag,
.ob-field__help .mention {
  font-weight: 600;
}

.ob-post__cw {
  border: 1px solid var(--ob-color-border);
  border-radius: var(--ob-radius);
  padding: 0.6rem 0.9rem;
  margin-bottom: 0.75rem;
}

.ob-post__cw summary {
  cursor: pointer;
  font-weight: 600;
}

.ob-post__cw[open] summary {
  margin-bottom: 0.6rem;
}

.ob-profile-tabs {
  display: flex;
  justify-content: center;
  align-items: stretch;
  gap: 0.25rem;
  margin-top: 1.25rem;
  margin-left: -1.5rem;
  margin-right: -1.5rem;
  margin-bottom: -1.5rem;
  padding: 0 1.5rem;
  border-top: 1px solid var(--ob-color-border);
}

.ob-profile-tabs__tab {
  flex: 0 1 auto;
  min-width: 7rem;
  padding: 0.85rem 1.25rem;
  margin-bottom: -1px;
  border: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: var(--ob-color-text-muted);
  font: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.ob-profile-tabs__tab:hover,
.ob-profile-tabs__tab:focus {
  color: var(--ob-color-text);
  text-decoration: none;
  background: transparent;
}

.ob-profile-tabs__tab:focus-visible {
  outline-offset: -2px;
}

.ob-profile-tabs__tab.is-active {
  color: var(--ob-color-primary);
  border-bottom-color: var(--ob-color-primary);
}

.ob-photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.4rem;
}

.ob-photo-grid__item {
  position: relative;
  margin: 0;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: var(--ob-radius);
  background: var(--ob-color-bg);
}

.ob-photo-grid__item img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  cursor: zoom-in;
}

.ob-photo-grid__post {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 0.35rem 0.5rem;
  font-size: 0.75rem;
  text-align: center;
  color: #fff;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.65));
  text-decoration: none;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.ob-photo-grid__item:hover .ob-photo-grid__post,
.ob-photo-grid__item:focus-within .ob-photo-grid__post {
  opacity: 1;
}

.ob-post__media {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.5rem;
  margin: 0.75rem 0;
}

.ob-post__media img {
  display: block;
  border-radius: var(--ob-radius);
  width: 100%;
  height: 320px;
  /* "contain" invece di "cover": l'anteprima deve mostrare l'immagine
     per intero (mai ritagliata), riempiendo lo spazio residuo con lo
     sfondo qui sotto quando le proporzioni non coincidono con il
     riquadro. */
  object-fit: contain;
  background: var(--ob-color-bg);
  cursor: zoom-in;
}

.ob-post__media video,
.ob-post__media-video {
  display: block;
  border-radius: var(--ob-radius);
  width: 100%;
  max-height: 480px;
  object-fit: contain;
  background: var(--ob-color-bg);
}

.ob-post__hashtags {
  margin-top: 0.5rem;
  font-size: 0.9rem;
}

.ob-post__deleted {
  color: var(--ob-color-text-muted);
  font-style: italic;
}

.ob-post__actions {
  display: flex;
  gap: 0.25rem;
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--ob-color-border);
  flex-wrap: wrap;
  align-items: center;
}

.ob-post__actions form {
  display: inline-flex;
  margin: 0;
}

.ob-post__action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-width: 2.5rem;
  height: 2.25rem;
  padding: 0 0.55rem;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--ob-color-text-muted);
  font: inherit;
  font-size: 0.85rem;
  line-height: 1;
  cursor: pointer;
  text-decoration: none;
}

.ob-post__action:hover,
.ob-post__action:focus-visible {
  background: var(--ob-color-bg);
  color: var(--ob-color-primary);
  text-decoration: none;
}

.ob-post__action--active {
  background: var(--ob-color-primary-soft);
  color: var(--ob-color-primary);
}

.ob-post__action .ob-icon {
  width: 18px;
  height: 18px;
}

.ob-post__action-count {
  font-variant-numeric: tabular-nums;
  min-width: 0.75rem;
}

/* Comments */

.ob-search-comment {
  padding: 0.9rem 0;
  border-top: 1px solid var(--ob-color-border);
}

.ob-search-comment:first-of-type {
  border-top: none;
  padding-top: 0;
}

.ob-comment__body {
  overflow-wrap: anywhere;
}

.ob-comment__media {
  margin-top: 0.5rem;
}

.ob-comment__media img {
  height: 200px;
}

.ob-comment .ob-post__actions {
  border-top: none;
  padding-top: 0.4rem;
  margin-top: 0.4rem;
  gap: 0.25rem;
}

.ob-comment .ob-post__actions .ob-btn {
  flex: 0 0 auto;
  justify-content: flex-start;
}

.ob-comment__replies {
  margin-left: 1.5rem;
  border-left: 2px solid var(--ob-color-border);
  padding-left: 1rem;
}

.ob-comment__more {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.9rem;
}

/* Notifications */

.ob-notification {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--ob-color-border);
}

.ob-notification:last-child {
  border-bottom: none;
}

.ob-notification--unread {
  background: #eef3fd;
  margin: 0 -1.5rem;
  padding: 0.85rem 1.5rem;
}

.ob-notification__time {
  color: var(--ob-color-text-muted);
  font-size: 0.8rem;
}

.ob-pagination {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1.5rem;
}

.ob-infinite-scroll__sentinel {
  height: 1px;
}

.ob-infinite-scroll__status {
  margin: 1rem 0;
  padding: 0.5rem;
  text-align: center;
  color: var(--ob-color-text-muted);
  font-size: 0.9rem;
}

.ob-infinite-scroll__status[hidden] {
  display: none;
}

@media (max-width: 1023px) {
  .ob-shell--with-sidebars {
    grid-template-columns: 240px minmax(0, 1fr);
  }

  .ob-sidebar--right {
    display: none;
  }
}

@media (max-width: 767px) {
  .ob-sidebar-toggle {
    display: inline-flex;
  }

  .ob-header__center {
    display: none;
  }

  .ob-compose-btn--fab {
    display: inline-flex;
  }

  .ob-shell--with-sidebars {
    display: block;
  }

  .ob-sidebar--left {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 84vw;
    max-width: 320px;
    background: var(--ob-color-bg);
    padding: 1rem;
    overflow-y: auto;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    z-index: 30;
  }

  .ob-sidebar--left.is-open {
    transform: translateX(0);
  }

  .ob-nav-toggle {
    display: inline-flex;
  }

  .ob-nav--icons {
    display: none;
    position: absolute;
    top: calc(100% + 0.6rem);
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0.15rem;
    width: 200px;
    background: var(--ob-color-surface);
    border: 1px solid var(--ob-color-border);
    border-radius: var(--ob-radius);
    box-shadow: var(--ob-shadow);
    padding: 0.5rem;
    z-index: 30;
  }

  .ob-nav--icons.is-open {
    display: flex;
  }

  .ob-nav--icons .ob-icon-btn,
  .ob-nav--icons .ob-header__avatar-link {
    width: 100%;
    height: auto;
    border-radius: 8px;
    justify-content: flex-start;
    gap: 0.75rem;
    padding: 0.6rem 0.7rem;
  }

  .ob-nav--icons form {
    display: block;
  }

  .ob-nav--icons form .ob-icon-btn {
    width: 100%;
  }

  .ob-nav__label {
    display: inline;
    font-size: 0.9rem;
    font-weight: 500;
  }

  .ob-nav--icons .ob-badge-dot {
    position: static;
    margin-left: auto;
    border: none;
  }

  .ob-header-search,
  .ob-header-dropdown {
    display: block;
    width: 100%;
  }

  .ob-header-search__form,
  .ob-header-dropdown__panel {
    position: static;
    width: 100%;
    min-width: 0;
    max-height: none;
    margin-top: 0.35rem;
    box-shadow: none;
  }

  .ob-header-search.is-open .ob-header-search__form {
    flex-direction: column;
    align-items: stretch;
  }
}

@media (max-width: 640px) {
  .ob-hero h1 {
    font-size: 1.5rem;
  }
}

/* Admin panel */

.ob-admin-badge {
  display: inline-flex;
  align-items: center;
  margin-left: 0.5rem;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: var(--ob-color-primary-soft);
  color: var(--ob-color-primary);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.ob-admin-shell {
  max-width: var(--ob-max-width-wide);
  margin: 0 auto;
  padding: 1.25rem;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 1.25rem;
  align-items: start;
}

.ob-admin-nav {
  position: sticky;
  top: 4.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.75rem;
  background: var(--ob-color-surface);
  border: 1px solid var(--ob-color-border);
  border-radius: var(--ob-radius);
}

.ob-admin-main {
  min-width: 0;
}

.ob-admin-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  margin-top: 1.25rem;
}

.ob-admin-stat {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  text-decoration: none;
  color: inherit;
}

.ob-admin-stat strong {
  font-size: 1.75rem;
}

.ob-admin-stat span {
  color: var(--ob-color-text-muted);
  font-size: 0.9rem;
}

.ob-admin-filters,
.ob-admin-actions,
.ob-admin-search,
.ob-scope-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-top: 1rem;
}

.ob-admin-search input[type="search"] {
  flex: 1 1 220px;
  min-width: 0;
  height: 40px;
  padding: 0 0.75rem;
  border: 1px solid var(--ob-color-border);
  border-radius: var(--ob-radius);
  background: var(--ob-color-surface);
}

.ob-admin-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  flex-wrap: wrap;
}

@media (max-width: 900px) {
  .ob-admin-shell {
    grid-template-columns: 1fr;
  }

  .ob-admin-nav {
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
  }
}

/* Pagina di attesa per errori MySQL transienti: sembra un caricamento, non un outage. */
.ob-db-busy {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, var(--ob-color-primary-soft), transparent),
    var(--ob-color-bg);
}

.ob-db-busy__panel {
  width: min(100%, 26rem);
  text-align: center;
  padding: 2rem 1.5rem;
}

.ob-db-busy__spinner {
  width: 2.5rem;
  height: 2.5rem;
  margin: 0 auto 1.25rem;
  border: 3px solid var(--ob-color-primary-soft);
  border-top-color: var(--ob-color-primary);
  border-radius: 50%;
  animation: ob-db-busy-spin 0.75s linear infinite;
}

@keyframes ob-db-busy-spin {
  to {
    transform: rotate(360deg);
  }
}

.ob-db-busy__brand {
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ob-color-primary);
  letter-spacing: 0.01em;
}

.ob-db-busy__title {
  margin: 0 0 0.5rem;
  font-size: 1.35rem;
  font-weight: 700;
}

.ob-db-busy__body,
.ob-db-busy__hint {
  margin: 0;
  color: var(--ob-color-text-muted);
  font-size: 0.95rem;
}

.ob-db-busy__hint {
  margin-top: 0.5rem;
  font-size: 0.875rem;
}

.ob-db-busy__actions {
  margin: 1.5rem 0 0;
}

@media (prefers-reduced-motion: reduce) {
  .ob-db-busy__spinner {
    animation: none;
    border-top-color: var(--ob-color-primary-soft);
    border-right-color: var(--ob-color-primary);
  }
}

/* Autocomplete menzioni (@) nel composer / commenti */
.ob-mention-suggest {
  position: fixed;
  z-index: 80;
  max-height: 16rem;
  overflow: auto;
  margin: 0;
  padding: 0.35rem;
  border: 1px solid var(--ob-color-border);
  border-radius: var(--ob-radius);
  background: var(--ob-color-surface);
  box-shadow: var(--ob-shadow);
}

.ob-mention-suggest[hidden] {
  display: none;
}

.ob-mention-suggest__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.ob-mention-suggest__empty {
  padding: 0.65rem 0.75rem;
  color: var(--ob-color-text-muted);
  font-size: 0.9rem;
}

.ob-mention-suggest__button {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  margin: 0;
  padding: 0.45rem 0.55rem;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
  font: inherit;
}

.ob-mention-suggest__item.is-active .ob-mention-suggest__button,
.ob-mention-suggest__button:hover,
.ob-mention-suggest__button:focus-visible {
  background: var(--ob-color-primary-soft);
  outline: none;
}

.ob-mention-suggest__avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.ob-mention-suggest__avatar--fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--ob-color-primary);
  color: var(--ob-color-primary-contrast);
  font-size: 0.85rem;
  font-weight: 700;
}

.ob-mention-suggest__meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 0.1rem;
}

.ob-mention-suggest__name {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ob-mention-suggest__handle {
  color: var(--ob-color-text-muted);
  font-size: 0.85rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ob-message-row {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--ob-color-border);
  text-decoration: none;
  color: inherit;
}

.ob-message-row:last-child {
  border-bottom: none;
}

.ob-message-row--unread {
  background: color-mix(in srgb, var(--ob-color-accent) 8%, transparent);
  margin: 0 -1rem;
  padding-left: 1rem;
  padding-right: 1rem;
}

.ob-message-row__body {
  flex: 1;
  min-width: 0;
}

.ob-message-row__top {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  align-items: baseline;
}

.ob-message-row__time {
  color: var(--ob-color-text-muted);
  font-size: 0.8rem;
  white-space: nowrap;
}

.ob-message-row__preview {
  color: var(--ob-color-text-muted);
  font-size: 0.9rem;
  margin-top: 0.2rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ob-message-row__you {
  font-weight: 600;
}

.ob-message-thread__header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--ob-color-border);
}

.ob-message-thread__peer {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex: 1;
  min-width: 0;
}

.ob-message-thread__handle {
  color: var(--ob-color-text-muted);
  font-size: 0.85rem;
}

.ob-message-thread__messages {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: min(60vh, 32rem);
  overflow-y: auto;
  padding: 0.25rem 0 1rem;
}

.ob-message-bubble {
  max-width: min(100%, 36rem);
  padding: 0.65rem 0.85rem;
  border-radius: 0.75rem;
  background: var(--ob-color-surface-muted);
}

.ob-message-bubble--mine {
  align-self: flex-end;
  background: color-mix(in srgb, var(--ob-color-accent) 14%, var(--ob-color-surface-muted));
}

.ob-message-bubble--theirs {
  align-self: flex-start;
}

.ob-message-bubble__meta {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.75rem;
  color: var(--ob-color-text-muted);
  margin-bottom: 0.35rem;
}

.ob-message-bubble__body {
  word-break: break-word;
}

.ob-message-composer {
  border-top: 1px solid var(--ob-color-border);
  padding-top: 1rem;
}

.ob-message-composer textarea {
  width: 100%;
  min-height: 5rem;
  resize: vertical;
}

.ob-message-composer__actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 0.75rem;
}

.ob-message-thread__blocked {
  margin-top: 1rem;
}

.ob-message-new {
  margin-bottom: 1rem;
}

.ob-message-new__title {
  margin: 0 0 0.75rem;
  font-size: 1.05rem;
}

.ob-message-new__form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem;
}

.ob-message-new__field {
  flex: 1 1 14rem;
  margin: 0;
  min-width: 0;
}
