:root {
  --color-primary: #f47a1f;
  --color-primary-hover: #ff9c3a;
  --color-dark: #1c1a18;
  --color-background: #f5f3ee;
  --color-stone: #d8d3c9;
  --color-card-border: #e7e2d8;
  --color-text: #4b4a46;
  --color-premium: #c8a24d;
  --color-danger: #9a4f3f;
  --color-danger-hover: #b8624f;
}

body {
  font-family: "Avenir Next", "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background-color: var(--color-background);
  color: var(--color-text);
}

a {
  color: var(--color-primary);
  transition: color 0.2s ease;
}

a:hover {
  color: var(--color-primary-hover);
}

.site-header {
  background-color: var(--color-dark);
  color: var(--color-background);
}

.brand-header-link {
  display: inline-flex;
  align-items: center;
}

.brand-header-logo {
  display: block;
  height: 42px;
  width: auto;
}

.notification-trigger {
  position: relative;
  border: 1px solid #3a3531;
  border-radius: 999px;
  width: 2rem;
  height: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #f5f3ee;
  background: #272421;
}

.notification-trigger:hover,
.notification-trigger:focus {
  color: var(--color-primary);
  border-color: var(--color-primary);
}

.notification-trigger__badge {
  position: absolute;
  top: -0.35rem;
  right: -0.25rem;
  min-width: 1.05rem;
  height: 1.05rem;
  border-radius: 999px;
  background: var(--color-primary);
  color: #ffffff;
  font-size: 0.65rem;
  font-weight: 700;
  line-height: 1;
  padding: 0 0.28rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.notification-panel {
  width: min(24rem, 92vw);
  max-height: 70vh;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--color-card-border);
  border-radius: 0.75rem;
  background: #ffffff;
  box-shadow: 0 12px 28px rgba(28, 26, 24, 0.16);
}

.notification-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.75rem 0.85rem;
  border-bottom: 1px solid var(--color-card-border);
}

.notification-panel__title {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--color-dark);
}

.notification-panel__body {
  padding: 0.45rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.notification-item {
  width: 100%;
  text-align: left;
  border: 1px solid #ece7de;
  border-radius: 0.65rem;
  background: #fffdf9;
  padding: 0.55rem 0.65rem;
}

.notification-item:hover {
  border-color: #dec8ad;
  background: #fff6ea;
}

.notification-item--unread {
  border-color: #f1cda5;
  background: #fff3e4;
}

.notification-item__title {
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.3;
  font-weight: 700;
  color: var(--color-dark);
}

.notification-item__body {
  margin: 0.2rem 0 0;
  font-size: 0.76rem;
  color: var(--color-text);
  line-height: 1.3;
}

.notification-item__meta {
  margin: 0.28rem 0 0;
  font-size: 0.68rem;
  color: #7a7368;
}

.notification-panel__footer {
  border-top: 1px solid var(--color-card-border);
  padding: 0.55rem 0.75rem;
}

.notification-row {
  border: 1px solid var(--color-card-border);
  border-radius: 0.75rem;
  padding: 0.75rem;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  background: #fffdf9;
}

.notification-row--unread {
  border-color: #f1cda5;
  background: #fff3e4;
}

.notification-row__main {
  min-width: 0;
}

.notification-row__title-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.notification-row__title {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.3;
  color: var(--color-dark);
  font-weight: 700;
}

.notification-row__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0.1rem 0.45rem;
  background: #f47a1f;
  color: #ffffff;
  font-size: 0.66rem;
  font-weight: 700;
}

.notification-row__body {
  margin: 0.2rem 0 0;
  font-size: 0.84rem;
  color: var(--color-text);
  line-height: 1.35;
}

.notification-row__meta {
  margin: 0.3rem 0 0;
  font-size: 0.72rem;
  color: #7a7368;
}

.notification-row__actions {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.45rem;
}

@media (min-width: 768px) {
  .brand-header-logo {
    height: 48px;
  }
}

.site-footer {
  background-color: var(--color-dark);
  color: #d7d1c6;
  border-top: 1px solid #2f2b28;
}

.site-footer a {
  color: #f0e4cc;
}

.site-footer a:hover {
  color: var(--color-primary);
}

.mobile-pwa-prompt {
  position: sticky;
  top: 0;
  z-index: 35;
  padding: 0.5rem 0.75rem;
  background: rgba(28, 26, 24, 0.96);
  border-bottom: 1px solid #2f2b28;
}

.mobile-pwa-prompt__inner {
  max-width: 76rem;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.mobile-pwa-prompt__copy {
  min-width: 0;
}

.mobile-pwa-prompt__title {
  margin: 0;
  color: #f5f3ee;
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.2;
}

.mobile-pwa-prompt__text {
  margin: 0.12rem 0 0;
  color: #e7e2d8;
  font-size: 0.76rem;
  line-height: 1.25;
}

.mobile-pwa-prompt__hint {
  margin: 0.2rem 0 0;
  color: #ffcf8e;
  font-size: 0.72rem;
  line-height: 1.2;
}

.mobile-pwa-prompt__actions {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
}

@media (max-width: 767px) {
  .mobile-pwa-prompt {
    padding: 0.4rem 0.55rem;
  }

  .mobile-pwa-prompt__inner {
    flex-direction: column;
    align-items: stretch;
    gap: 0.45rem;
  }

  .mobile-pwa-prompt__actions {
    width: 100%;
  }

  .mobile-pwa-prompt__actions .btn {
    flex: 1;
    justify-content: center;
  }
}

.card {
  background-color: #ffffff;
  border: 1px solid var(--color-card-border);
  border-radius: 0.85rem;
  box-shadow: 0 8px 20px rgba(28, 26, 24, 0.08);
}

.card-body {
  padding: 1rem;
}

.label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text);
}

.input,
.textarea {
  width: 100%;
  border: 1px solid var(--color-card-border);
  border-radius: 0.55rem;
  padding: 0.55rem 0.75rem;
  background-color: #ffffff;
  color: var(--color-dark);
}

.input:not(textarea):not([type="color"]):not([type="checkbox"]):not([type="radio"]) {
  min-height: 2.5rem;
}

.file-input,
.input[type="file"] {
  width: 100%;
  border: 1px dashed #d9cab4;
  border-radius: 0.65rem;
  padding: 0.4rem 0.5rem;
  min-height: 2.5rem;
  background: linear-gradient(180deg, #fffdf9 0%, #f7f2e9 100%);
  color: var(--color-text);
  cursor: pointer;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.file-input:hover,
.input[type="file"]:hover {
  border-color: #d2af86;
  background: linear-gradient(180deg, #fffefc 0%, #fbf5ec 100%);
}

.file-input:focus,
.input[type="file"]:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(244, 122, 31, 0.18);
}

.file-input::file-selector-button,
.input[type="file"]::file-selector-button {
  margin-right: 0.65rem;
  border: 1px solid #e6b582;
  border-radius: 999px;
  background-color: #fff5e8;
  color: #7d4818;
  font-weight: 600;
  font-size: 0.8rem;
  padding: 0.28rem 0.7rem;
  cursor: pointer;
  transition: background-color 0.18s ease, border-color 0.18s ease;
}

.file-input::file-selector-button:hover,
.input[type="file"]::file-selector-button:hover {
  background-color: #ffe6cd;
  border-color: #db9c5f;
}

.file-input::-webkit-file-upload-button,
.input[type="file"]::-webkit-file-upload-button {
  margin-right: 0.65rem;
  border: 1px solid #e6b582;
  border-radius: 999px;
  background-color: #fff5e8;
  color: #7d4818;
  font-weight: 600;
  font-size: 0.8rem;
  padding: 0.28rem 0.7rem;
  cursor: pointer;
}

.input select,
select.input {
  -webkit-appearance: none;
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, #6f675c 50%),
    linear-gradient(135deg, #6f675c 50%, transparent 50%);
  background-position:
    calc(100% - 1rem) calc(50% - 2px),
    calc(100% - 0.7rem) calc(50% - 2px);
  background-size: 0.3rem 0.3rem, 0.3rem 0.3rem;
  background-repeat: no-repeat;
  padding-right: 2rem;
}

.textarea {
  resize: vertical;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.5rem;
  border: 1px solid transparent;
  padding: 0.5rem 0.9rem;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

.btn-sm,
.btn-small {
  /* padding: 0.35rem 0.65rem;
  font-size: 0.8rem; */
  padding-top: 0.25rem;
  padding-bottom: 0.25rem;
  line-height: 1rem;
}

.btn-primary {
  background-color: var(--color-primary);
  color: #ffffff;
}

.btn-primary:hover {
  background-color: var(--color-primary-hover);
  color: #ffffff;
}

.btn-secondary {
  background-color: #ffffff;
  color: var(--color-primary);
  border-color: var(--color-primary);
}

.btn-secondary:hover {
  background-color: var(--color-primary);
  color: #ffffff;
}

.btn-danger {
  background-color: var(--color-danger);
  color: #ffffff;
}

.btn-danger:hover {
  background-color: var(--color-danger-hover);
  color: #ffffff;
}

.link-primary {
  color: var(--color-primary);
  text-decoration: none;
}

.link-primary:hover {
  color: var(--color-primary-hover);
  text-decoration: underline;
}

.event-chip,
.event-chip:hover,
.event-chip:focus {
  color: #ffffff !important;
}

.event-chip .text-amber-300,
.event-chip:hover .text-amber-300,
.event-chip:focus .text-amber-300 {
  color: #ffe0a8 !important;
}

.event-chip .text-emerald-300,
.event-chip:hover .text-emerald-300,
.event-chip:focus .text-emerald-300 {
  color: #d4f6dc !important;
}

.bg-white {
  background-color: #ffffff !important;
}

.shadow {
  box-shadow: 0 8px 20px rgba(28, 26, 24, 0.08) !important;
}

.ring-slate-200\/70 {
  --tw-ring-color: rgba(216, 211, 201, 0.7) !important;
}

.border,
.border-slate-200,
.border-slate-300 {
  border-color: var(--color-card-border) !important;
}

.text-slate-900 {
  color: var(--color-dark) !important;
}

.text-slate-600,
.text-slate-500 {
  color: var(--color-text) !important;
}

.bg-slate-100,
.bg-slate-50 {
  background-color: #f0ede6 !important;
}

.bg-slate-800 {
  background-color: #2f2b28 !important;
}

.bg-slate-900,
.bg-emerald-600,
.bg-amber-400 {
  background-color: var(--color-primary) !important;
}

.text-amber-300 {
  color: #ffd89c !important;
}

.text-amber-800 {
  color: #8a6728 !important;
}

.hover\:bg-slate-700:hover,
.hover\:bg-emerald-500:hover,
.hover\:bg-amber-300:hover {
  background-color: var(--color-primary-hover) !important;
}

.bg-rose-600 {
  background-color: var(--color-danger) !important;
}

.hover\:bg-rose-500:hover {
  background-color: var(--color-danger-hover) !important;
}

input:focus,
textarea:focus,
select:focus {
  outline: 2px solid rgba(244, 122, 31, 0.35);
  outline-offset: 1px;
  border-color: var(--color-primary) !important;
}

.ui-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  height: 2.5rem;
  min-height: 2.5rem;
  padding: 0 0.7rem;
  border: 1px solid var(--color-card-border);
  border-radius: 0.5rem;
  background: #fffefa;
  cursor: pointer;
  box-sizing: border-box;
}

.ui-toggle > input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.ui-toggle__switch {
  position: relative;
  width: 2.1rem;
  height: 1.25rem;
  border-radius: 999px;
  background: #d8d3c9;
  transition: background-color 160ms ease;
  flex: 0 0 auto;
}

.ui-toggle__switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
  transition: transform 160ms ease;
}

.ui-toggle__text {
  font-size: 0.86rem;
  color: var(--color-text);
  line-height: 1.2;
}

.ui-toggle > input:checked + .ui-toggle__switch {
  background: var(--color-primary);
}

.ui-toggle > input:checked + .ui-toggle__switch::after {
  transform: translateX(0.85rem);
}

.ui-toggle:focus-within {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(244, 122, 31, 0.14);
}

.ui-page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.ui-page-header__meta {
  min-width: 0;
}

.ui-page-header__actions {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.ui-card-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.ui-card-heading__meta {
  min-width: 0;
}

.ui-card-heading__actions {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.event-card {
  border: 1px solid var(--color-card-border);
  border-radius: 0.7rem;
  background: #fff;
  padding: 0.75rem;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.event-card:hover {
  border-color: #d8cfc1;
  box-shadow: 0 6px 18px rgba(28, 26, 24, 0.07);
}

.event-card__layout {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.event-card__main {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  min-width: 0;
  flex: 1 1 auto;
}

.event-card__media-wrap {
  flex: 0 0 auto;
}

.event-card__media,
.event-card__placeholder {
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 0.45rem;
  border: 1px solid var(--color-card-border);
}

.event-card__media {
  object-fit: cover;
  display: block;
}

.event-card__placeholder {
  background: #e9e4db;
}

.event-card__content {
  min-width: 0;
}

.event-card__title {
  display: block;
  font-size: 1rem;
  font-weight: 650;
  color: var(--color-dark);
  text-decoration: none;
  line-height: 1.28;
}

a.event-card__title:hover {
  color: var(--color-primary);
  text-decoration: underline;
}

.event-card__meta {
  margin-top: 0.12rem;
  font-size: 0.88rem;
  color: var(--color-text);
}

.event-card__submeta,
.event-card__aux {
  margin-top: 0.12rem;
  font-size: 0.76rem;
  color: #6f675c;
}

.event-card__aux {
  color: #8a6728;
}

.event-card__description {
  margin: 0.35rem 0 0 0;
  font-size: 0.82rem;
  line-height: 1.35;
  color: var(--color-text);
}

.event-card__actions {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}

@media (min-width: 640px) {
  .event-card__layout {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }

  .event-card__actions {
    justify-content: flex-end;
    margin-left: 0.75rem;
  }
}

.calendar-cell {
  min-height: 140px;
}

.calendar-cell--large {
  min-height: 170px;
  background-image: linear-gradient(to bottom, rgba(216, 211, 201, 0.24), rgba(255, 255, 255, 0));
}

.game-row {
  transition: background-color 0.2s ease;
}

.game-row:hover {
  background-color: rgba(244, 122, 31, 0.05);
}

.rating-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  padding: 0.3rem 0.55rem;
  line-height: 1rem;
  border-radius: 0.5rem;
  border: 1px solid rgba(28, 26, 24, 0.1);
  font-weight: 700;
  letter-spacing: 0.01em;
  font-size: 0.82rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
  background: #d8d3c9;
  color: #1c1a18;
}

.rating-badge--sm {
  min-width: 2.25rem;
  font-size: 0.78rem;
  padding: 0.25rem 0.5rem;
}

.chat-shell {
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 24rem;
  max-height: calc(100vh - 10rem);
}

.chat-shell__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--color-card-border);
  background: #fff;
}

.chat-shell__messages {
  overflow-y: auto;
  min-height: 8rem;
  max-height: max(8rem, calc(100vh - 22rem));
  padding: 0.65rem 0;
  background: linear-gradient(180deg, #fbfaf7 0%, #f8f6f1 100%);
}

.chat-empty-state {
  padding: 1rem;
}

.chat-message {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 0.35rem;
  padding: 0.2rem 1rem 0.28rem 1rem;
  transition: background-color 0.16s ease;
}

.chat-message:hover {
  background-color: rgba(255, 255, 255, 0.75);
}

.chat-message--grouped {
  padding-top: 0.03rem;
}

.chat-message--grouped .chat-message__avatar {
  visibility: hidden;
}

.chat-message--mine .chat-message__body {
  background-color: #fff4e9;
  border-color: #f5d2b1;
}

.chat-message:not(.chat-message--mine) .chat-message__body {
  background-color: #f2f6fb;
  border-color: #d9e2ee;
}

.chat-message__avatar {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  min-height: 36px;
}

.chat-message__content {
  min-width: 0;
}

.chat-message__meta {
  display: flex;
  align-items: baseline;
  gap: 0.45rem;
}

.chat-message__name {
  color: var(--color-dark);
  font-size: 0.9rem;
  font-weight: 650;
  text-decoration: none;
}

.chat-message__name:hover {
  color: var(--color-primary);
  text-decoration: underline;
}

.chat-message__time {
  font-size: 0.73rem;
  color: #86837d;
}

.chat-message__body {
  margin-top: 0.05rem;
  width: fit-content;
  max-width: min(100%, 56rem);
  padding: 0.25rem 0.45rem;
  border-radius: 0.45rem;
  border: 1px solid transparent;
  color: #2f2b28;
  font-size: 0.92rem;
  line-height: 1.45;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.chat-message__body * {
  color: inherit;
}

.chat-inline-link {
  color: var(--color-primary);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.chat-inline-link:hover {
  color: var(--color-primary-hover);
}

.chat-invite-cards {
  margin-top: 0.35rem;
  display: grid;
  gap: 0.4rem;
}

.chat-invite-card {
  border: 1px solid #ecd9c3;
  background: #fff7ef;
  border-radius: 0.55rem;
  padding: 0.45rem 0.55rem;
}

.chat-invite-card__title {
  font-size: 0.82rem;
  font-weight: 650;
  color: #2f2b28;
}

.chat-invite-card__meta {
  margin-top: 0.15rem;
  font-size: 0.72rem;
  color: #6f6a63;
}

.chat-message--grouped .chat-message__body {
  margin-top: 0;
  border-top-left-radius: 0.3rem;
}

.chat-message--mine.chat-message--grouped .chat-message__body {
  border-top-right-radius: 0.3rem;
}

.chat-shell__composer {
  padding: 0.8rem 1rem;
  border-top: 1px solid var(--color-card-border);
  background: #f8f5ef;
}

.chat-composer-panel {
  border: 1px solid #e2dbcf;
  border-radius: 0.75rem;
  background: #ffffff;
  box-shadow: 0 4px 16px rgba(28, 26, 24, 0.07);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.chat-composer-panel:focus-within {
  border-color: rgba(244, 122, 31, 0.5);
  box-shadow: 0 0 0 3px rgba(244, 122, 31, 0.14);
}

.chat-composer-panel--error {
  border-color: rgba(159, 38, 38, 0.35);
  box-shadow: 0 0 0 2px rgba(159, 38, 38, 0.1);
}

.chat-composer__input {
  width: 100%;
  min-height: 96px;
  border: 0;
  resize: vertical;
  border-radius: 0.75rem 0.75rem 0 0;
  padding: 0.7rem 0.85rem 0.35rem 0.85rem;
  color: #2f2b28;
  background: transparent;
}

.chat-composer__input::placeholder {
  color: #8b857d;
}

.chat-composer__input:focus {
  outline: none;
  border: 0 !important;
}

.chat-composer__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  border-top: 1px solid #eee7dd;
  padding: 0.45rem 0.65rem 0.5rem 0.7rem;
  background: #fcfaf6;
  border-radius: 0 0 0.75rem 0.75rem;
}

.chat-composer__hint {
  font-size: 0.72rem;
  margin: 0;
}

.chat-composer__actions {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  position: relative;
}

.chat-format-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.chat-format-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.6rem;
  height: 1.6rem;
  border: 1px solid #d6d0c7;
  border-radius: 999px;
  background: #fff;
  color: #3a3531;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

.chat-format-icon {
  width: 0.88rem;
  height: 0.88rem;
  stroke: currentColor;
  stroke-width: 1.45;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.chat-format-btn:hover {
  border-color: var(--color-primary);
  background: #fff6eb;
  color: var(--color-primary);
}

.chat-format-btn--underline {
  color: #2f2b28;
}

.chat-format-btn--color {
  color: var(--color-primary);
}

.chat-format-btn--color .chat-format-icon circle {
  fill: currentColor;
  stroke: none;
}

.chat-format-btn--invite {
  color: #8b5d24;
}

.chat-composer__shortcut {
  font-size: 0.72rem;
  color: #87837b;
}

.chat-composer__emoji {
  position: relative;
}

.chat-shell .btn-sm,
.chat-shell .btn-small,
.event-conversation-composer .btn-sm,
.event-conversation-composer .btn-small,
.event-conversation-thread .btn-sm,
.event-conversation-thread .btn-small,
.event-pinned-messages .btn-sm,
.event-pinned-messages .btn-small {
  font-size: 0.66rem;
  border-radius: 999px;
  padding: 0.06rem 0.4rem;
  line-height: 1.2;
  font-weight: 600;
}

.chat-emoji-panel {
  position: absolute;
  right: 0;
  bottom: calc(100% + 0.45rem);
  width: 16rem;
  max-width: 88vw;
  border: 1px solid var(--color-card-border);
  border-radius: 0.7rem;
  background: #fff;
  box-shadow: 0 12px 28px rgba(28, 26, 24, 0.18);
  padding: 0.55rem;
  z-index: 40;
}

.chat-emoji-panel__grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.35rem;
}

.chat-emoji-panel__item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 0.45rem;
  background: #faf8f3;
  font-size: 1.1rem;
  line-height: 1;
  padding: 0.35rem 0.25rem;
  cursor: pointer;
}

.chat-emoji-panel__item:hover {
  border-color: #f0d3b6;
  background: #fff3e8;
}

.event-conversation-connect {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.74rem;
  color: #6d6a63;
  margin-bottom: 0.55rem;
}

.event-conversation-thread {
  min-height: 8rem;
  max-height: max(8rem, calc(100vh - 24rem));
  overflow-y: auto;
  border: 1px solid var(--color-card-border);
  border-radius: 0.75rem;
  background: linear-gradient(180deg, #fbfaf7 0%, #f8f6f1 100%);
  padding: 0.35rem 0;
}

.event-pinned-messages {
  border: 1px solid #f0d3b6;
  background: #fff8f0;
  border-radius: 0.75rem;
  padding: 0.55rem 0.6rem 0.45rem;
}

.event-pinned-messages__header {
  font-size: 0.72rem;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  color: #9a6a2e;
  margin-bottom: 0.35rem;
  font-weight: 650;
}

.event-message-pin-badge {
  display: inline-flex;
  align-items: center;
  border: 1px solid #f0d3b6;
  background: #fff3e3;
  color: #9a6a2e;
  font-size: 0.66rem;
  border-radius: 999px;
  padding: 0.06rem 0.4rem;
  line-height: 1.2;
  font-weight: 600;
}

.markdown-content > :first-child {
  margin-top: 0;
}

.markdown-content > :last-child {
  margin-bottom: 0;
}

.markdown-content p,
.markdown-content ul,
.markdown-content ol,
.markdown-content blockquote,
.markdown-content pre {
  margin: 0.35rem 0;
}

.markdown-content ul,
.markdown-content ol {
  padding-left: 1.25rem;
}

.markdown-content a {
  color: var(--color-primary);
  text-decoration: underline;
}

.markdown-content code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.9em;
  background: #f0ede6;
  border-radius: 0.2rem;
  padding: 0.05rem 0.25rem;
}

.markdown-content h1 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--color-dark);
}

.markdown-content h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
  color: var(--color-dark);
}

.markdown-content p {
  margin-bottom: 0.85rem;
  line-height: 1.6;
  color: var(--color-text);
}

.markdown-content ul {
  list-style: disc;
  margin-left: 1.5rem;
  margin-bottom: 1rem;
}

.markdown-content li {
  margin-bottom: 0.3rem;
}

.markdown-content--hero h1,
.markdown-content--hero h2,
.markdown-content--hero p,
.markdown-content--hero li {
  color: #f5f3ee;
}

.markdown-content--hero,
.markdown-content--hero * {
  color: #f5f3ee;
}

.markdown-content--hero a {
  color: #ffb56a;
}

.markdown-content--hero code {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.sponsorship-card {
  overflow: hidden;
  --sponsor-title-reserve: 2.1rem;
}

.sponsorship-card__content-wrap {
  position: relative;
  min-width: 0;
}

.sponsorship-card__content {
  max-height: max(2.25rem, calc(var(--sponsor-max-height, 8rem) - var(--sponsor-title-reserve)));
  overflow: hidden;
  padding-right: 0.25rem;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.sponsorship-card__content-wrap::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1.35rem;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.96));
  pointer-events: none;
  opacity: 0.95;
  transition: opacity 0.14s ease;
}

.sponsorship-card__content-wrap:hover .sponsorship-card__content {
  overflow-y: auto;
}

.sponsorship-card__content > * {
  max-width: 100%;
}

.sponsorship-card__content pre,
.sponsorship-card__content code,
.sponsorship-card__content blockquote {
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.sponsorship-card__content pre {
  white-space: pre-wrap;
}

.sponsorship-card__content img,
.sponsorship-card__content video,
.sponsorship-card__content iframe {
  max-width: 100%;
  height: auto;
}

.sponsorship-card__content-wrap:hover::after {
  opacity: 0;
}

.field-label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.field-help {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1rem;
  height: 1rem;
  border-radius: 999px;
  border: 1px solid #c8b8a0;
  color: #7b5c35;
  font-size: 0.68rem;
  line-height: 1;
  cursor: help;
  background: #fff7ed;
}

.field-help::before {
  content: "i";
  font-style: normal;
  font-weight: 700;
}

.field-help::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 0.45rem);
  transform: translateX(-50%) translateY(0.2rem);
  min-width: 12rem;
  max-width: 18rem;
  padding: 0.45rem 0.55rem;
  border-radius: 0.45rem;
  border: 1px solid #d8d3c9;
  background: #1c1a18;
  color: #f5f3ee;
  font-size: 0.72rem;
  font-weight: 500;
  line-height: 1.3;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.14s ease, transform 0.14s ease;
  z-index: 50;
  white-space: normal;
}

.field-help:hover::after,
.field-help:focus-visible::after {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 768px) {
  .calendar-cell {
    min-height: 110px;
  }

  .calendar-cell--large {
    min-height: 120px;
  }

  .chat-composer__bar {
    flex-direction: column;
    align-items: stretch;
  }

  .chat-composer__actions {
    justify-content: space-between;
  }
}
