:root,
[data-theme="light"] {
  --bg: #f4efe6;
  --bg-elevated: #fffaf3;
  --surface: #ffffff;
  --text: #1c241e;
  --muted: #5c675f;
  --accent: #c45c12;
  --accent-2: #2f6f4e;
  --line: rgba(28, 36, 30, 0.12);
  --shadow: 0 16px 40px rgba(40, 28, 12, 0.12);
  --header: rgba(244, 239, 230, 0.88);
  --cal-today: rgba(196, 92, 18, 0.12);
}

[data-theme="dark"] {
  --bg: #101612;
  --bg-elevated: #182019;
  --surface: #1d2820;
  --text: #f4f1ea;
  --muted: #b7c0b9;
  --accent: #e0893a;
  --accent-2: #4ade80;
  --line: rgba(244, 241, 234, 0.12);
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
  --header: rgba(16, 22, 18, 0.86);
  --cal-today: rgba(224, 137, 58, 0.18);
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  font-family: "Manrope", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(196, 92, 18, 0.14), transparent 36%),
    radial-gradient(circle at top right, rgba(47, 111, 78, 0.16), transparent 32%),
    var(--bg);
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
.container { width: min(1180px, calc(100% - 2rem)); margin: 0 auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.skip-link { position: absolute; left: -999px; top: 0; background: var(--accent); color: #111; padding: .75rem 1rem; }
.skip-link:focus { left: 1rem; top: 1rem; z-index: 50; }
[x-cloak] { display: none !important; }

.site-header {
  position: sticky; top: 0; z-index: 30;
  backdrop-filter: blur(14px);
  background: var(--header);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex; align-items: center; gap: 1rem; padding: .85rem 0; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: .7rem; min-width: 0; }
.brand img {
  width: auto;
  height: 72px;
  object-fit: contain;
  background: #fff;
  border-radius: 14px;
  padding: .15rem;
}
.brand strong { display: block; font-size: 1.05rem; }
.brand small { color: var(--muted); }
.main-nav { display: flex; gap: .85rem; flex-wrap: wrap; margin-left: auto; }
.main-nav a { font-weight: 600; padding: .35rem 0; border-bottom: 2px solid transparent; }
.main-nav a:hover, .main-nav a.is-active { border-color: var(--accent); }
.header-tools { display: flex; gap: .45rem; align-items: center; }
.icon-btn, .btn, .lang-flag-trigger, .theme-toggle {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  border-radius: 999px;
  padding: .45rem .8rem;
  cursor: pointer;
  font: inherit;
}
.btn-accent { background: var(--accent); color: #fff; border-color: transparent; }
.btn-ghost { background: transparent; }
.lang-flag-trigger, .theme-toggle {
  width: 2.6rem;
  height: 2.6rem;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  box-sizing: border-box;
  flex-shrink: 0;
}
.lang-flag { width: 28px; height: 28px; border-radius: 50%; }
.theme-toggle svg { width: 22px; height: 22px; display: block; }
.language-switcher, .theme-switch { position: relative; }
.menu-toggle {
  display: none;
  width: 2.6rem;
  height: 2.6rem;
  padding: 0;
  align-items: center;
  justify-content: center;
}
.menu-toggle svg { width: 22px; height: 22px; display: block; }

.hero {
  display: grid; grid-template-columns: auto 1.1fr .8fr; gap: 2rem; padding: 3rem 0 2rem; align-items: center;
}
.hero-logo {
  width: min(220px, 42vw);
  background: #fff;
  border-radius: 28px;
  padding: .6rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
}
.hero-logo img { width: 100%; height: auto; }
.hero h1 { font-size: clamp(2rem, 4vw, 3.4rem); line-height: 1.1; margin: 0 0 1rem; }
.hero p { color: var(--muted); font-size: 1.1rem; }
.hero-card { background: var(--surface); border-radius: 24px; padding: 1.2rem; box-shadow: var(--shadow); border: 1px solid var(--line); }
.section { padding: 2rem 0; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-bottom: 1rem; }
.grid-3, .grid-4, .cards { display: grid; gap: 1rem; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px;
  overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column;
}
.card img { aspect-ratio: 16/10; object-fit: cover; width: 100%; }
.card > a { display: block; }
.card-body { padding: 1rem 1.1rem 1.2rem; }
.gallery-card { color: inherit; transition: transform .15s ease, border-color .15s ease; }
.gallery-card:hover { transform: translateY(-2px); border-color: var(--accent); }
.gallery-card-media {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  background: var(--bg-elevated);
  overflow: hidden;
}
.gallery-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  aspect-ratio: auto;
}
.gallery-card h2 {
  margin: 0 0 .35rem;
  font-size: 1.05rem;
  line-height: 1.3;
  min-height: 1.3em;
}
.muted { color: var(--muted); }
.chip { display: inline-flex; padding: .2rem .55rem; border-radius: 999px; background: var(--bg-elevated); border: 1px solid var(--line); font-size: .8rem; margin: 0 .2rem .2rem 0; }
.ad-strip, .ad-slot {
  border: 1px dashed var(--line); border-radius: 16px; padding: .8rem;
  background: var(--bg-elevated); display: flex; gap: .8rem; align-items: center; flex-wrap: wrap;
}
.ad-strip img, .ad-slot img { max-height: 72px; width: auto; border-radius: 10px; }
.site-shell {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr) 180px;
  gap: 1rem;
  align-items: start;
  width: 100%;
  padding: 0 .75rem;
}
.site-rail {
  position: sticky;
  top: 6.5rem;
  display: flex;
  flex-direction: column;
  gap: .75rem;
  min-width: 0;
}
.site-rail .ad-slot {
  flex-direction: column;
  align-items: stretch;
  min-height: 8rem;
}
.site-rail .ad-slot img { max-width: 100%; max-height: none; height: auto; }
.ad-poster {
  display: block;
  border: 0;
  padding: 0;
  background: none;
  line-height: 0;
}
.ad-poster img {
  width: 100%;
  height: auto;
  max-height: none;
  border-radius: 0;
  display: block;
  object-fit: contain;
}
.site-rail .ad-poster img {
  max-height: none;
  height: auto;
  object-fit: contain;
}
[data-theme="dark"] .ad-img-day { display: none; }
html:not([data-theme="dark"]) .ad-img-night { display: none; }
.ad-poster .ad-img-thumb,
.ad-strip .ad-img-thumb { display: none; }
.site-shell-main { min-width: 0; }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 1.5rem; }
.prose { line-height: 1.65; }
.prose img { border-radius: 16px; }
.input, select, textarea {
  width: 100%; padding: .7rem .8rem; border-radius: 12px; border: 1px solid var(--line);
  background: var(--bg-elevated); color: var(--text); font: inherit;
}
label { display: block; font-weight: 600; margin: .8rem 0 .3rem; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; align-items: start; }
.event-canvas { margin: 1rem 0; display: flex; flex-direction: column; gap: .75rem; }
.event-canvas-toolbar { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.event-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 5;
  border: 1px dashed var(--line);
  border-radius: 16px;
  background: var(--bg-elevated);
  overflow: hidden;
}
.event-canvas .event-stage {
  touch-action: none;
}
.event-stage-view {
  touch-action: auto;
}
.event-stage-view .kind-video {
  overflow: visible;
}
.event-stage-view video {
  pointer-events: auto;
  touch-action: manipulation;
}
.event-stage-item {
  position: absolute;
  box-sizing: border-box;
  overflow: hidden;
  border: 1px solid transparent;
  background: rgba(255,255,255,.04);
}
.event-stage-item.is-selected { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.event-stage-text { height: 100%; overflow: auto; padding: .4rem; }
.event-stage-item img,
.event-stage-item video,
.event-stage-item iframe,
.event-stage-crop {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  border: 0;
  display: block;
}
.event-stage-media {
  position: absolute;
  inset: 0;
}
.event-stage-media img,
.event-stage-media video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  cursor: pointer;
}
.event-file-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  pointer-events: none;
}
.event-media-pick {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  font: inherit;
  padding: .4rem .7rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}
.event-media-replace {
  position: absolute;
  inset: 0;
  z-index: 1;
  cursor: pointer;
  display: block;
}
.event-media-replace img,
.event-media-replace video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}
.event-widget-move.lb-glass,
.event-widget-delete.lb-glass {
  position: absolute;
  top: .35rem;
  z-index: 4;
  width: 2rem;
  height: 2rem;
}
.event-widget-move.lb-glass { right: 2.55rem; cursor: move; }
.event-widget-delete.lb-glass { right: .35rem; }
.event-widget-move.lb-glass svg,
.event-widget-delete.lb-glass svg { width: 16px; height: 16px; display: block; }
.event-resize {
  position: absolute;
  width: 12px;
  height: 12px;
  background: var(--accent);
  border-radius: 2px;
  z-index: 3;
}
.event-resize.nw { left: 0; top: 0; cursor: nwse-resize; }
.event-resize.ne { right: 0; top: 0; cursor: nesw-resize; }
.event-resize.sw { left: 0; bottom: 0; cursor: nesw-resize; }
.event-resize.se { right: 0; bottom: 0; cursor: nwse-resize; }
.event-text-tools { display: flex; flex-wrap: wrap; gap: .3rem; margin-bottom: .25rem; }
.event-text-tools button,
.event-text-tools select {
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
  border-radius: 8px; padding: .15rem .45rem; font: inherit; max-width: 7.5rem;
}
.event-editable { min-height: 3rem; height: calc(100% - 2.2rem); overflow: auto; }
.preview-pane {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1rem;
  background: var(--surface);
  position: sticky;
  top: 1rem;
  align-self: start;
  max-height: calc(100vh - 2rem);
  overflow: hidden;
}
.preview-pane .event-stage { max-height: min(70vh, calc(100vh - 10rem)); }
@media (max-width: 900px) {
  .event-submit.split { grid-template-columns: 1fr; }
  .preview-pane { position: static; max-height: none; }
}
.calendar { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: 16px; overflow: hidden; }
.calendar th, .calendar td { border: 1px solid var(--line); vertical-align: top; padding: .5rem; min-height: 6rem; width: 14.2%; }
.calendar td.is-today { background: var(--cal-today); }
.calendar td.is-other { opacity: .45; }
.calendar a { display: block; font-size: .8rem; margin-top: .3rem; color: var(--accent); }
.cal-toolbar { display: flex; flex-wrap: wrap; gap: .75rem 1rem; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.cal-heading { margin: 0; }
.cal-views, .cal-nav { display: flex; flex-wrap: wrap; gap: .4rem; }
.cal-views .btn.is-active { background: var(--accent); color: #fff; border-color: var(--accent); }
.cal-daynum { font-weight: 700; color: inherit; margin-top: 0; }
.cal-year { display: grid; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); gap: 1rem; }
.cal-mini-title { display: block; font-weight: 700; margin-bottom: .4rem; color: inherit; }
.calendar-heat th, .calendar-heat td { min-height: 0; padding: .15rem; font-size: .65rem; text-align: center; }
.calendar-heat td.has-events { font-weight: 700; }
.cal-dot { display: inline-block; width: .35rem; height: .35rem; border-radius: 50%; background: var(--accent); margin-left: .15rem; vertical-align: middle; }
.masonry { columns: 3; gap: 1rem; }
.masonry a { break-inside: avoid; display: block; margin-bottom: 1rem; }
.masonry figure { position: relative; break-inside: avoid; margin: 0 0 1rem; }
.masonry figure a { margin-bottom: 0; }
.masonry img { border-radius: 16px; width: 100%; }
.home-mosaic {
  display: grid;
  gap: .35rem;
  aspect-ratio: 1;
  max-width: min(100%, 36rem);
  overflow: hidden;
  border-radius: 18px;
  background: var(--bg-elevated);
}
.home-mosaic--1 { grid-template-columns: 1fr; }
.home-mosaic--2 { grid-template-columns: 1fr 1fr; }
.home-mosaic--3,
.home-mosaic--4 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
.home-mosaic--3 .home-mosaic-tile:first-child { grid-row: span 2; }
.home-mosaic-tile {
  min-width: 0;
  min-height: 0;
  display: block;
  overflow: hidden;
}
.home-mosaic-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  aspect-ratio: auto;
}
.gallery-cover-btn {
  position: absolute; top: .35rem; right: .35rem; z-index: 2;
  width: 2rem; height: 2rem;
}
.gallery-cover-btn svg { width: 16px; height: 16px; }
.lightbox {
  position: fixed; inset: 0; background: rgba(0,0,0,.82); display: grid; place-items: center; z-index: 50; padding: 2rem;
}
.lightbox img { max-height: 90vh; border-radius: 12px; }
.messages { list-style: none; padding: 0; }
.messages li { background: var(--surface); border-left: 4px solid var(--accent-2); padding: .8rem 1rem; border-radius: 10px; }
.site-footer { border-top: 1px solid var(--line); padding: 2rem 0 3rem; margin-top: 2rem; color: var(--muted); }
.footer-brand img {
  height: 88px;
  width: auto;
  background: #fff;
  border-radius: 16px;
  padding: .2rem;
  margin-bottom: .6rem;
}
.mod-nav {
  display: flex; flex-wrap: wrap; gap: .4rem;
  margin: 0 0 1.2rem;
}
.mod-nav a {
  padding: .35rem .75rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  font-size: .9rem;
  font-weight: 600;
}
.mod-nav a:hover { border-color: rgba(196, 92, 18, 0.35); }
.mod-grid { max-width: 40rem; }
.mod-grid .list-row { text-decoration: none; color: inherit; }
.forum-row, .list-row {
  display: flex; justify-content: space-between; gap: 1rem; align-items: center;
  padding: .85rem 1rem; border: 1px solid var(--line); border-radius: 16px;
  background: var(--surface); margin-bottom: .65rem; box-shadow: var(--shadow);
}
.forum-row:hover { border-color: rgba(196, 92, 18, 0.35); }
.forum-meta { display: flex; flex-direction: column; align-items: flex-end; gap: .15rem; font-size: .85rem; white-space: nowrap; }
.btn-icon {
  width: 2.35rem; height: 2.35rem; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text); cursor: pointer;
  font: inherit; font-weight: 700; flex-shrink: 0;
}
.btn-icon svg { width: 18px; height: 18px; display: block; }
.btn-icon.is-on { background: var(--accent); color: #fff; border-color: transparent; }
.btn-icon.is-static { cursor: default; }
.md-italic { font-style: italic; font-weight: 600; }
.md-toolbar { display: flex; gap: .3rem; margin: 0 0 .45rem; }
.compose-card {
  margin-top: 1.4rem; padding: 1.1rem 1.15rem;
  border: 1px solid var(--line); border-radius: 18px;
  background: var(--surface); box-shadow: var(--shadow);
}
.compose-card h2 { margin: 0 0 .8rem; font-size: 1.15rem; }
.quote-chip {
  display: inline-flex; align-items: center; gap: .4rem;
  margin: 0 0 .7rem; padding: .2rem .3rem .2rem .75rem;
  border-radius: 999px; border: 1px solid var(--line); background: var(--bg);
  font-size: .9rem;
}
.thread-crumb {
  display: flex; flex-wrap: wrap; align-items: center; gap: .35rem;
  margin: 0 0 .65rem; font-size: .9rem; color: var(--muted);
}
.thread-crumb a { color: var(--muted); }
.thread-crumb a:hover { color: var(--accent); }
.thread-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.thread-title-row h1 { margin-top: 0; font-size: 1.7rem; }
.thread-mod, .post-mod { display: inline-flex; gap: .3rem; }
.post-tree { display: flex; flex-direction: column; gap: .85rem; margin-top: 1rem; }
.post { padding: 1rem 0; border-bottom: 1px solid var(--line); }
.post-card {
  padding: 1rem 1.1rem; border: 1px solid var(--line); border-radius: 18px;
  background: var(--surface); box-shadow: var(--shadow); border-bottom: 1px solid var(--line);
}
.post-card.is-root .post-author { font-size: 1rem; }
.post-head { display: flex; align-items: center; gap: .65rem; flex-wrap: wrap; margin-bottom: .55rem; }
.post-author {
  display: inline-flex; align-items: center;
  padding: .15rem .65rem; border-radius: 999px;
  background: var(--bg); border: 1px solid var(--line); font-weight: 700; font-size: .9rem;
}
.post-in-reply { margin: 0 0 .45rem; font-size: .8rem; }
.post-in-reply a { color: var(--muted); text-decoration: none; }
.post-in-reply a:hover { color: var(--accent); }
.post-body { margin: 0 0 .5rem; font-size: 1rem; }
.post-body a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.post-actions { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; margin-top: .65rem; }
.post-votes { display: inline-flex; align-items: center; gap: .2rem; }
.post-votes form { display: inline-flex; align-items: center; gap: .2rem; margin: 0; }
.vote-count { font-size: .8rem; color: var(--muted); min-width: 1rem; }
.report-inline { display: inline-flex; align-items: center; gap: .35rem; margin: 0; }
.report-inline .input { width: 10rem; margin: 0; padding: .4rem .7rem; }
.post-replies {
  position: relative;
  margin-top: .85rem;
  margin-left: .2rem;
  padding-left: 1.15rem;
  border-left: 2px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: .75rem;
}
.post-replies > .post-card { position: relative; }
.post-replies > .post-card::before {
  content: "";
  position: absolute;
  left: -1.15rem;
  top: 1.4rem;
  width: .9rem;
  height: 2px;
  background: var(--line);
}
@media (min-width: 700px) {
  .post-replies { padding-left: 1.35rem; margin-left: .4rem; }
  .post-replies > .post-card::before { left: -1.35rem; width: 1.05rem; }
}
.pager { display: flex; gap: .6rem; margin-top: 1rem; }
.social-login { margin: 1.2rem 0; display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.social-login .muted { width: 100%; margin: 0 0 .2rem; }
.social-btn { min-width: 8rem; text-align: center; }
.social-google { background: #fff; color: #1f1f1f; }
.social-facebook { background: #1877f2; color: #fff; border-color: transparent; }
.social-apple { background: #111; color: #fff; border-color: transparent; }
[data-theme="dark"] .social-google { background: var(--surface); color: var(--text); }

.chat-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 1rem;
  height: calc(100dvh - 12rem);
  min-height: 28rem;
  align-items: stretch;
}
.chat-sidebar, .chat-main {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  min-height: 0;
}
.chat-sidebar {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}
.chat-search { display: block; flex-shrink: 0; }
.chat-search .input { width: 100%; }
.chat-side-heading { font-size: 1rem; margin: 1rem 0 .5rem; flex-shrink: 0; }
.chat-room-list, .chat-member-results { list-style: none; padding: 0; margin: 0; }
.chat-member-results {
  flex-shrink: 0;
  max-height: 10rem;
  overflow: auto;
}
.chat-room-list { overflow: auto; flex: 1; min-height: 0; }
.chat-list-btn {
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: 12px;
  padding: .55rem .6rem;
  color: inherit;
  font: inherit;
  cursor: pointer;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: .7rem;
}
.chat-list-meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: .15rem;
}
.chat-unread-dot {
  width: .5rem;
  height: .5rem;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
  margin-left: auto;
}
.chat-bubble .chat-unread-dot {
  margin-left: .35rem;
}
.avatar, .chat-avatar {
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 50%;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-weight: 700;
  font-size: .8rem;
  letter-spacing: .02em;
  overflow: hidden;
}
.avatar img, .chat-avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar--sm { width: 1.85rem; height: 1.85rem; font-size: .7rem; }
.avatar--lg { width: 6.5rem; height: 6.5rem; font-size: 1.5rem; }
.avatar-nav { padding: 0; overflow: hidden; }
.avatar-nav .avatar { width: 100%; height: 100%; border: 0; }
.avatar-upload { display: flex; align-items: center; gap: 1rem; margin: 0 0 1rem; }
.avatar-upload-frame { cursor: pointer; position: relative; }
.members-grid { display: grid; gap: .7rem; grid-template-columns: repeat(5, minmax(0, 1fr)); }
.member-card { border-radius: 14px; }
.member-card .card-body {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  gap: .25rem; padding: .65rem .5rem .75rem;
}
.member-card h2 { font-size: .92rem; margin: 0; line-height: 1.25; }
.member-card .muted { font-size: .78rem; margin: 0; }
.member-card .chip { font-size: .7rem; margin: 0; }
.member-card .avatar { width: 4.4rem; height: 4.4rem; font-size: 1.05rem; }
.member-card img, .member-card .avatar img {
  aspect-ratio: 1; width: 100%; height: 100%; object-fit: cover;
}
.member-social {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .25rem;
  margin: .1rem 0 0;
}
.member-social-link {
  width: 2rem;
  height: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  color: var(--muted);
}
.member-social-link:hover { color: var(--accent); background: var(--bg-elevated); }
.member-social-link svg { width: 1.05rem; height: 1.05rem; display: block; }
.avatar-zoom {
  border: 0; padding: 0; background: none; cursor: zoom-in;
  border-radius: 50%; line-height: 0;
}
.forum-row-author { display: flex; align-items: center; gap: .4rem; margin: .35rem 0 0; }
.chat-list-btn.is-active, .chat-list-btn:hover { background: var(--bg-elevated); }
.chat-page {
  display: flex;
  flex-direction: column;
  padding-bottom: 1rem;
}
.chat-page > h1,
.chat-page-lead { flex-shrink: 0; }
.chat-main { display: flex; flex-direction: column; min-height: 0; height: 100%; overflow: hidden; }
.chat-thread-bar {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .55rem .75rem;
  border-bottom: 1px solid var(--line);
  min-height: 3.4rem;
}
.chat-back { display: none; }
.chat-thread {
  flex: 1;
  overflow: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.chat-thread-inner {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: .7rem;
}
.chat-bubble {
  max-width: 85%;
  padding: .7rem .9rem;
  border-radius: 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
}
.chat-bubble.is-mine { align-self: flex-end; background: var(--cal-today); }
.chat-bubble.is-deleted p { font-style: italic; color: var(--muted); }
.chat-bubble header { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.chat-delete.lb-glass {
  width: 2rem;
  height: 2rem;
  margin-left: auto;
  color: var(--text);
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.4);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55), 0 4px 14px rgba(0, 0, 0, 0.08);
}
[data-theme="dark"] .chat-delete.lb-glass {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.22);
}
.chat-delete.lb-glass svg { width: 16px; height: 16px; }
.chat-compose {
  display: flex; gap: .5rem; padding: .8rem; flex-wrap: wrap; align-items: flex-end;
  border-top: 1px solid var(--line);
}
.compose-previews {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  width: 100%;
  order: -1;
}
.compose-preview {
  position: relative;
  width: 4.5rem;
  height: 4.5rem;
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  cursor: pointer;
}
.compose-preview.is-cover {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.compose-preview img,
.compose-preview video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.compose-preview-delete.lb-glass {
  position: absolute;
  top: .2rem;
  right: .2rem;
  z-index: 2;
  width: 1.75rem;
  height: 1.75rem;
}
.compose-preview-delete.lb-glass svg { width: 14px; height: 14px; display: block; }
.chat-compose .input { flex: 1; min-width: 8rem; }
.compose-tools { display: flex; gap: .35rem; align-items: center; }
.ads-submit .compose-tools { margin: .4rem 0 1rem; align-items: center; }
.compose-tool {
  width: 2.6rem;
  height: 2.6rem;
  padding: 0;
  margin: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  font-size: 0;
}
.compose-tool svg { width: 22px; height: 22px; display: block; }
.compose-tool.is-disabled { opacity: .4; pointer-events: none; }
.compose-tool input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  opacity: 0;
  font-size: 16px;
  cursor: pointer;
  border: 0;
}
.emoji-panel {
  width: 100%;
  display: flex; flex-wrap: wrap; gap: .2rem;
  padding: 0 .8rem .6rem;
}
.emoji-panel button {
  font-size: 1.25rem; line-height: 1;
  border: 0; background: transparent; cursor: pointer;
  width: 2.2rem; height: 2.2rem; border-radius: 8px;
}
.emoji-panel button:hover { background: var(--bg-elevated); }
.media-thumbs {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .4rem; margin-top: .5rem;
}
.media-thumbs button { padding: 0; border: 0; background: none; cursor: pointer; }
.media-thumbs img {
  width: 100%; aspect-ratio: 1; object-fit: cover;
  border-radius: 18px; display: block;
}
.post-card .media-thumbs,
.prose .classified-gallery {
  display: flex; flex-wrap: wrap; gap: .4rem;
  grid-template-columns: unset;
}
.post-card .media-thumbs img,
.prose .classified-gallery img {
  width: 4.5rem; height: 4.5rem; aspect-ratio: auto; border-radius: 12px;
}
.media-thumbs-video {
  width: 100%; aspect-ratio: 1; border-radius: 18px;
  display: grid; place-items: center;
  background: #1a1a1a; color: #fff;
}
.media-thumbs-video svg { width: 2.2rem; height: 2.2rem; }
.media-thumbs-video.is-strip {
  width: 56px; height: 56px; aspect-ratio: auto; border-radius: 12px;
}
.media-lightbox {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,.88);
  display: grid; grid-template-rows: auto minmax(0, 1fr) auto;
  gap: .65rem;
  padding: 3.25rem .75rem .75rem;
}
.guest-alert {
  position: fixed; inset: 0; z-index: 210;
  background: rgba(0,0,0,.55);
  display: flex; align-items: center; justify-content: center;
  padding: 1.25rem;
}
.guest-alert-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  max-width: 22rem;
  width: 100%;
  padding: 1.2rem 1.25rem 1.3rem;
}
.guest-alert-card h2 { margin: 0 0 .5rem; font-size: 1.15rem; }
.guest-alert-card p { margin: 0 0 1rem; color: var(--muted); }
.media-lightbox-bar {
  display: flex; justify-content: space-between; align-items: center; gap: .6rem;
  width: min(1180px, 100%); margin: 0 auto;
  position: relative; z-index: 1;
}
.media-lightbox-actions { display: flex; gap: .45rem; flex-wrap: wrap; }
.lb-glass {
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  margin: 0;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  cursor: pointer;
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 8px 24px rgba(0, 0, 0, 0.25);
}
.lb-glass:hover,
.lb-glass:focus-visible {
  background: rgba(255, 255, 255, 0.24);
  outline: none;
}
.lb-glass svg { width: 22px; height: 22px; display: block; }
.media-lightbox-stage {
  display: grid; place-items: center; min-height: 0;
  overflow: hidden;
  touch-action: none;
  position: relative;
}
.media-lightbox-stage img {
  position: absolute; inset: 0; margin: auto;
  max-width: 100%; max-height: 100%;
  width: auto; height: auto;
  border-radius: 12px; object-fit: contain;
  transform-origin: center center;
  will-change: transform;
}
.media-lightbox-player {
  position: absolute; inset: 0;
  min-height: 0;
  display: grid; place-items: center;
}
.media-lightbox-stack {
  position: relative;
  max-width: 100%;
  max-height: 100%;
}
.media-lightbox-video {
  display: block;
  width: 100%; height: 100%;
  border-radius: 12px; object-fit: contain;
}
.media-lightbox-scrub {
  position: absolute; left: .5rem; right: .5rem; bottom: .5rem;
  display: flex; align-items: center; gap: .55rem;
  padding: .35rem .45rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
}
.media-lightbox-play.lb-glass {
  width: 2.2rem; height: 2.2rem;
}
.media-lightbox-play .is-pause { display: none; }
.media-lightbox-play.is-playing .is-play { display: none; }
.media-lightbox-play.is-playing .is-pause { display: block; }
.media-lightbox-seek {
  flex: 1;
  min-width: 0;
  accent-color: #fff;
  cursor: pointer;
}
.media-lightbox-nav { display: flex; justify-content: center; gap: .6rem; padding-top: .5rem; }
.media-lightbox-strip {
  display: flex; gap: .4rem; justify-content: center; flex-wrap: wrap;
  padding: .45rem .5rem .2rem;
}
.media-lightbox-strip button {
  padding: 0; border: 2px solid transparent; background: none; cursor: pointer; border-radius: 14px;
}
.media-lightbox-strip button.is-active { border-color: var(--accent); }
.media-lightbox-strip img {
  width: 56px; height: 56px; object-fit: cover; border-radius: 12px; display: block;
}
.ads-filters {
  position: sticky; top: 5.4rem; z-index: 12;
  display: flex; flex-wrap: wrap; gap: .5rem; align-items: center;
  padding: .7rem .8rem; margin-bottom: 1.15rem;
  background: var(--header);
  backdrop-filter: blur(16px);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
}
.ads-filters .input { width: auto; flex: 1 1 200px; min-width: 10rem; margin: 0; }
.ads-kinds { display: flex; flex-wrap: wrap; gap: .35rem; border: 0; margin: 0; padding: 0; min-width: 0; }
.ads-filters .chip {
  cursor: pointer; margin: 0; position: relative;
  display: inline-flex; align-items: center; gap: .25rem;
}
.ads-filters .chip input {
  position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer;
}
.ads-filters .chip:has(input:checked) {
  border-color: var(--accent);
  background: var(--cal-today);
}
.ads-sort { margin: 0; }
.ads-sort .input { flex: 0 0 auto; width: auto; min-width: 8.5rem; }
.ads-count { margin: 0 0 .85rem; }
.ads-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}
.ads-card {
  display: flex; flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--shadow);
  min-width: 0;
  transition: transform .15s ease, border-color .15s ease;
}
.ads-card:hover { transform: translateY(-2px); border-color: var(--accent); }
.ads-card-media {
  position: relative;
  aspect-ratio: 4 / 5;
  background: var(--bg-elevated);
}
.ads-card-media img,
.ads-card-ph { width: 100%; height: 100%; object-fit: cover; display: block; }
.ads-card-ph {
  background:
    radial-gradient(circle at 30% 20%, rgba(196, 92, 18, 0.22), transparent 50%),
    var(--bg-elevated);
}
.ads-card-media .chip { position: absolute; left: .55rem; top: .55rem; margin: 0; }
.ads-card-body {
  padding: .85rem 1rem 1rem;
  display: flex; flex-direction: column; gap: .3rem;
}
.ads-card-body strong { font-size: 1.02rem; line-height: 1.3; }
.ads-card-price { color: var(--accent); font-weight: 700; }
.ads-more { grid-column: 1 / -1; display: flex; justify-content: center; padding: .35rem 0 0; }
.ads-more.htmx-request .btn { opacity: .55; }
.ads-pager { display: flex; gap: .5rem; align-items: center; justify-content: center; margin-top: 1.25rem; flex-wrap: wrap; }
.ads-empty { grid-column: 1 / -1; }

@media (max-width: 900px) {
  .hero, .layout, .split, .form-grid, .grid-3, .grid-4, .chat-layout { grid-template-columns: 1fr; }
  .members-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .site-shell { grid-template-columns: 1fr; }
  .site-shell-main { order: 1; }
  .site-rail { position: static; }
  .site-rail-left { order: 2; }
  .site-rail-right { order: 3; }
  .ad-poster .ad-img-full,
  .ad-strip .ad-img-full { display: none; }
  .ad-poster .ad-img-thumb,
  .ad-strip .ad-img-thumb { display: block; }
  [data-theme="dark"] .ad-img-day.ad-img-thumb { display: none; }
  html:not([data-theme="dark"]) .ad-img-night.ad-img-thumb { display: none; }
  .ad-poster.is-desktop-only,
  .ad-strip.is-desktop-only { display: none; }
  .site-rail .ad-poster img { max-width: 7.5rem; margin: 0 auto; }
  .hero-logo { width: min(180px, 56vw); justify-self: start; }
  .masonry { columns: 2; }
  .menu-toggle { display: inline-flex; }
  .main-nav { display: none; width: 100%; flex-direction: column; }
  .main-nav.is-open { display: flex; }
  .header-inner { justify-content: space-between; }
  .chat-page { padding-top: .75rem; padding-bottom: 1rem; }
  .chat-page > h1, .chat-page-lead { display: none; }
  .chat-layout {
    min-height: calc(100dvh - 5.2rem);
    height: calc(100dvh - 5.2rem);
    gap: 0;
  }
  .chat-sidebar, .chat-main {
    min-height: 0;
    height: 100%;
    border-radius: 14px;
  }
  .chat-layout.is-list .chat-main { display: none; }
  .chat-layout.is-thread .chat-sidebar { display: none; }
  .chat-back { display: inline-flex; }
  .chat-side-heading { display: none; }
  .media-lightbox { padding-top: 2.15rem; gap: .85rem; }
  .media-lightbox-nav { display: none; }
}
@media (max-width: 560px) {
  .masonry { columns: 1; }
  .calendar th, .calendar td { font-size: .75rem; padding: .3rem; }
  .members-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

html.is-busy,
body.is-busy {
  overflow: hidden;
}
body.is-busy > *:not(#club-busy) {
  pointer-events: none;
}
.club-busy {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10000;
  place-items: center;
  background: rgba(16, 22, 18, 0.55);
  pointer-events: auto;
}
html.is-busy .club-busy {
  display: grid;
}
.club-busy-card {
  display: grid;
  gap: .85rem;
  justify-items: center;
  color: #f4f1ea;
  font-weight: 600;
}
.club-busy-spinner {
  width: 2.4rem;
  height: 2.4rem;
  border: 3px solid rgba(244, 241, 234, 0.25);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: club-busy-spin .7s linear infinite;
}
@keyframes club-busy-spin {
  to { transform: rotate(360deg); }
}
