:root {
  --bg: #070b1c;
  --bg-deep: #050816;
  --surface: rgba(17, 22, 45, .78);
  --surface-solid: #11162d;
  --surface-soft: #151a35;
  --line: rgba(151, 121, 255, .22);
  --line-strong: rgba(151, 121, 255, .45);
  --text: #f5f3ff;
  --muted: #b9b6d3;
  --faint: #7b789b;
  --accent: #8d4dff;
  --accent-2: #c35cff;
  --accent-3: #39d5ff;
  --danger: #ff6b93;
  --success: #63f3bd;
  --shadow: 0 18px 60px rgba(0, 0, 0, .35);
  --radius: 8px;
  --font-body: Inter, "Segoe UI", Arial, Helvetica, sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  color-scheme: dark;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 18% 18%, rgba(141, 77, 255, .26), transparent 28rem),
    radial-gradient(circle at 82% 8%, rgba(57, 213, 255, .12), transparent 24rem),
    linear-gradient(180deg, #090d20 0%, var(--bg-deep) 42%, #080b1b 100%);
  font-family: var(--font-body);
  letter-spacing: 0;
  overflow-x: hidden;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  background:
    linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.02) 1px, transparent 1px);
  background-size: 52px 52px;
  mask-image: linear-gradient(180deg, black, transparent 70%);
}

a {
  color: inherit;
  text-decoration: none;
}

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

button,
input,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.site-header,
.detail-header,
.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: min(100% - 48px, 1280px);
  margin: 0 auto;
}

.hero-content,
.feed-column,
.sidebar,
.post-card,
.side-panel,
.meetup-card {
  min-width: 0;
}

.site-header {
  min-height: 88px;
  border-bottom: 1px solid var(--line);
}

.compact-header {
  margin-bottom: 34px;
}

.detail-header {
  padding: 28px 0 10px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: max-content;
}

.brand-mark {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  color: var(--accent);
}

.brand-mark.small {
  width: 34px;
  height: 34px;
}

.brand-mark svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
  filter: drop-shadow(0 0 16px rgba(141,77,255,.45));
}

.brand strong,
.brand small {
  display: block;
  font-weight: 900;
  line-height: 1;
}

.brand strong {
  font-size: 1.55rem;
}

.brand small {
  margin-top: 4px;
  color: #b179ff;
  font-size: .75rem;
  letter-spacing: .22em;
}

.main-nav,
.header-actions,
.detail-actions,
.hero-actions,
.post-filters,
.post-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.header-actions {
  justify-content: flex-end;
  margin-left: auto;
}

.site-header > .profile-link,
.site-header > .auth-control {
  margin-left: auto;
}

.main-nav a {
  position: relative;
  padding: 33px 6px 31px;
  color: var(--muted);
  font-size: .95rem;
  font-weight: 700;
}

.main-nav a:hover,
.main-nav a.is-active {
  color: var(--text);
}

.main-nav a.is-active::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 2px;
  content: "";
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.button,
.ghost-action,
.back-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 22px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  color: var(--text);
  background: rgba(11, 15, 34, .45);
  font-weight: 800;
  text-align: center;
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}

.button:hover,
.ghost-action:hover,
.back-link:hover {
  transform: translateY(-1px);
  border-color: rgba(195, 92, 255, .8);
}

.button-accent {
  border-color: transparent;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 12px 30px rgba(141,77,255,.28);
}

.button-ghost {
  background: rgba(10, 12, 29, .36);
}

.small-button {
  min-height: 42px;
  padding: 0 18px;
  font-size: .92rem;
}

.wide-button {
  width: 100%;
}

.icon-button {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: var(--text);
  border: 0;
  background: transparent;
}

.profile-link {
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: rgba(10, 12, 29, .36);
}

.auth-login {
  min-width: 92px;
}

.icon-button svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

main {
  width: min(100% - 48px, 1280px);
  margin: 0 auto;
}

.connect-hero {
  display: grid;
  grid-template-columns: minmax(390px, .88fr) minmax(500px, 1.25fr);
  min-height: 490px;
  border-bottom: 1px solid var(--line);
}

.hero-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 58px 0 52px;
}

.heart-doodle {
  position: absolute;
  top: 48px;
  right: 38px;
  color: #d15cff;
  font-size: 3rem;
  opacity: .75;
}

.hero-content h1,
.page-head h1,
.event-title-row h1,
.form-title-row h1,
.profile-head h1,
.auth-panel h1,
.post-detail h1 {
  margin: 0;
  font-size: 3.8rem;
  line-height: 1.08;
  font-weight: 900;
}

.hero-content h1 span {
  color: var(--accent-2);
}

.hero-content p {
  max-width: 420px;
  margin: 24px 0 30px;
  color: var(--muted);
  font-size: 1.15rem;
  line-height: 1.55;
}

.hero-stats,
.panel-stats {
  display: flex;
  gap: 34px;
  margin: 34px 0 0;
  padding: 0;
}

.hero-stats div,
.panel-stats div {
  display: grid;
  gap: 4px;
}

.hero-stats dt,
.panel-stats dt {
  color: var(--text);
  font-size: 1.1rem;
  font-weight: 900;
}

.hero-stats dd,
.panel-stats dd {
  margin: 0;
  color: var(--muted);
  font-size: .88rem;
}

.hero-art {
  position: relative;
  min-height: 490px;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(7,11,28,.92), rgba(7,11,28,.38) 28%, rgba(7,11,28,.05)),
    radial-gradient(circle at 54% 78%, rgba(255,125,66,.9), rgba(255,125,66,.08) 12%, transparent 20%),
    radial-gradient(circle at 72% 25%, rgba(195,92,255,.32), transparent 20rem),
    linear-gradient(160deg, #211044, #0b1025 48%, #061126);
}

.forest-layer::before,
.forest-layer::after {
  position: absolute;
  content: "";
  inset: 0;
  background:
    linear-gradient(120deg, transparent 0 8%, rgba(18, 10, 40, .86) 8% 10%, transparent 10% 28%, rgba(18, 10, 40, .86) 28% 31%, transparent 31%),
    repeating-linear-gradient(75deg, transparent 0 42px, rgba(12, 20, 43, .82) 44px 48px);
  opacity: .55;
}

.forest-layer::after {
  background:
    radial-gradient(circle, #ffd078 0 3px, transparent 4px) 20% 18% / 140px 90px,
    radial-gradient(circle, #fff6bb 0 1px, transparent 2px) 10% 12% / 80px 80px;
  opacity: .65;
}

.campfire {
  position: absolute;
  left: 48%;
  bottom: 54px;
  width: 130px;
  height: 130px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 56%, #fff3ad 0 8%, #ff9b39 9% 22%, #ff4c6b 23% 36%, transparent 37%),
    radial-gradient(circle, rgba(255,123,57,.55), transparent 60%);
  transform: translateX(-50%);
  filter: blur(.2px) drop-shadow(0 0 48px rgba(255,122,47,.75));
}

.character {
  position: absolute;
  bottom: 42px;
  width: 138px;
  height: 210px;
  border-radius: 58% 58% 42% 42%;
  background:
    radial-gradient(circle at 36% 18%, #ffd9b9 0 3px, transparent 4px),
    radial-gradient(circle at 62% 18%, #ffd9b9 0 3px, transparent 4px),
    radial-gradient(circle at 50% 36%, rgba(255,255,255,.55), transparent 0 20%, transparent 28%),
    linear-gradient(160deg, #38426b, #171c38);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.08), 0 18px 50px rgba(0,0,0,.38);
}

.character::before,
.character::after {
  position: absolute;
  top: -24px;
  width: 46px;
  height: 58px;
  content: "";
  background: inherit;
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
}

.character::before {
  left: 20px;
  transform: rotate(-16deg);
}

.character::after {
  right: 20px;
  transform: rotate(16deg);
}

.character-one { left: 18%; transform: rotate(-7deg); }
.character-two { left: 38%; width: 126px; height: 190px; background: linear-gradient(160deg, #67517e, #2d2446); }
.character-three { right: 23%; background: linear-gradient(160deg, #4d274e, #15172e); }
.character-four { right: 6%; background: linear-gradient(160deg, #b85f35, #241429); transform: rotate(6deg); }

.section-heading,
.feed-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 38px 0 18px;
}

.section-heading h2,
.side-panel h2,
.profile-events h2,
.gallery-section h2,
.tags-section h2,
.event-info-panel h2 {
  margin: 0;
  font-size: 1.45rem;
  line-height: 1.2;
}

.section-heading a,
.side-link {
  color: #b179ff;
  font-weight: 800;
}

.meetups-row,
.meetups-grid {
  display: grid;
  gap: 20px;
}

.meetups-row {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.meetups-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.meetup-card,
.post-card,
.side-panel,
.auth-panel,
.event-form,
.profile-head,
.profile-events,
.event-info-panel,
.member-card,
.gallery-tile {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(24, 28, 58, .78), rgba(12, 16, 36, .78));
  box-shadow: var(--shadow);
}

.meetup-card {
  overflow: hidden;
}

.meetup-cover,
.mini-thumb,
.faux-image,
.member-avatar {
  background:
    radial-gradient(circle at 70% 18%, rgba(255,255,255,.38), transparent 0 9%, transparent 18%),
    linear-gradient(135deg, #2d205f, #101934);
  background-size: cover;
  background-position: center;
}

.meetup-cover {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
}

.meetup-cover span {
  position: absolute;
  left: 16px;
  bottom: 14px;
  padding: 8px 11px;
  border-radius: 5px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  font-size: .84rem;
  font-weight: 900;
  text-transform: uppercase;
}

.tone-sunset { background-image: radial-gradient(circle at 65% 32%, rgba(255,210,160,.7), transparent 0 11%, transparent 24%), linear-gradient(135deg, #ff7a7a, #7b3dff 52%, #111932); }
.tone-neon { background-image: radial-gradient(circle at 28% 35%, rgba(54,223,255,.75), transparent 0 12%, transparent 24%), linear-gradient(135deg, #101d5c, #8f29ff 58%, #060816); }
.tone-park { background-image: radial-gradient(circle at 45% 28%, rgba(255,255,255,.65), transparent 0 11%, transparent 22%), linear-gradient(135deg, #8ecf7d, #5144c8 52%, #111729); }
.tone-night { background-image: radial-gradient(circle at 68% 26%, rgba(255,75,200,.72), transparent 0 12%, transparent 25%), linear-gradient(135deg, #140c38, #263cf4 48%, #070817); }
.tone-violet { background-image: radial-gradient(circle at 54% 28%, rgba(237,182,255,.65), transparent 0 13%, transparent 25%), linear-gradient(135deg, #302065, #aa42ff 55%, #090d20); }
.tone-blue { background-image: radial-gradient(circle at 72% 32%, rgba(98,216,255,.65), transparent 0 13%, transparent 25%), linear-gradient(135deg, #092f5e, #5b4dff 58%, #090d20); }

.meetup-body {
  padding: 16px;
}

.meetup-body h3 {
  min-height: 48px;
  margin: 0 0 8px;
  font-size: 1.12rem;
  line-height: 1.25;
}

.meetup-body p,
.meetup-body small {
  display: block;
  margin: 0 0 8px;
  color: var(--muted);
}

.avatar-stack {
  display: flex;
  align-items: center;
  gap: 0;
  margin-top: 14px;
  color: var(--muted);
  font-size: .86rem;
}

.avatar-stack i {
  width: 22px;
  height: 22px;
  margin-right: -6px;
  border: 2px solid var(--surface-solid);
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-3));
}

.avatar-stack span {
  margin-left: 12px;
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
  color: var(--muted);
  font-size: .88rem;
}

.community-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 42px;
  align-items: start;
  margin-top: 16px;
}

.post-filters {
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.pill,
.tag {
  min-height: 34px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  background: rgba(13, 18, 40, .75);
}

.pill.is-active,
.tag:hover {
  color: var(--text);
  border-color: rgba(141,77,255,.75);
  background: rgba(141,77,255,.22);
}

.posts-feed {
  display: grid;
  gap: 20px;
}

.standalone-feed {
  max-width: 820px;
}

.post-card {
  padding: 18px;
}

.post-card-large {
  max-width: 860px;
  margin: 32px auto;
}

.post-author {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
}

.avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 28%, #fff 0 5px, transparent 6px), linear-gradient(135deg, #d45cff, #3ad7ff);
}

.post-author strong,
.post-author small {
  display: block;
}

.post-author small,
.post-card p,
.post-actions,
.side-panel p,
.page-head p {
  color: var(--muted);
}

.post-menu {
  color: var(--faint);
  font-size: 1.45rem;
}

.post-category {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  margin-bottom: 12px;
  padding: 0 12px;
  border: 1px solid rgba(141,77,255,.55);
  border-radius: 999px;
  color: #c8a8ff;
  background: rgba(141,77,255,.12);
  font-size: .86rem;
  font-weight: 800;
}

.post-card h3 {
  margin: 0 0 10px;
  font-size: 1.2rem;
}

.post-detail h1 {
  margin-bottom: 16px;
  font-size: 2.4rem;
}

.post-card p {
  margin: 0 0 16px;
  line-height: 1.55;
}

.post-image {
  width: 100%;
  max-height: 380px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.faux-image {
  min-height: 260px;
}

.post-actions {
  justify-content: space-between;
  margin-top: 14px;
}

.post-actions button {
  color: inherit;
  border: 0;
  background: transparent;
}

.sidebar {
  display: grid;
  gap: 16px;
}

.side-panel {
  padding: 20px;
}

.side-panel h2 {
  margin-bottom: 16px;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.mini-events {
  display: grid;
  gap: 14px;
}

.mini-event {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 12px;
  align-items: center;
}

.mini-thumb {
  width: 64px;
  height: 52px;
  border-radius: 6px;
}

.mini-event strong,
.mini-event small {
  display: block;
}

.mini-event small {
  margin-top: 4px;
  color: var(--muted);
  font-size: .82rem;
}

.side-link {
  display: inline-block;
  margin-top: 16px;
}

.panel-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.panel-stats {
  margin: 18px 0;
}

.site-footer {
  margin-top: 52px;
  padding: 26px 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.site-footer nav {
  display: flex;
  gap: 28px;
}

.page-shell,
.auth-layout,
.form-page,
.profile-page {
  padding: 10px 0 48px;
}

.page-head {
  max-width: 760px;
  margin-bottom: 28px;
}

.page-head h1 {
  font-size: 3rem;
}

.page-head p {
  margin: 12px 0 0;
  font-size: 1.1rem;
  line-height: 1.55;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 22px;
}

.filter-button {
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  background: rgba(13, 18, 40, .72);
  font-weight: 800;
}

.filter-button.is-active {
  color: var(--text);
  border-color: rgba(141,77,255,.75);
  background: rgba(141,77,255,.28);
}

.event-page {
  max-width: 1040px;
}

.event-hero {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-solid);
}

.event-hero img {
  width: 100%;
  height: 480px;
  object-fit: cover;
}

.event-date-card {
  position: absolute;
  top: 22px;
  left: 22px;
  display: grid;
  gap: 4px;
  width: 110px;
  padding: 16px 12px;
  border-radius: var(--radius);
  background: rgba(10, 13, 31, .82);
}

.event-date-card strong {
  color: var(--accent-2);
  font-size: 3.2rem;
  line-height: 1;
}

.event-date-card span,
.event-date-card small {
  color: var(--text);
  text-transform: uppercase;
}

.event-title-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 28px;
  align-items: end;
  margin: 28px 0;
}

.event-title-row h1 {
  margin-top: 12px;
  font-size: 3rem;
}

.event-tags-line,
.event-description {
  color: var(--muted);
}

.category-label,
.card-category {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  padding: 0 12px;
  border-radius: 999px;
  color: #d9c5ff;
  background: rgba(141,77,255,.18);
  font-weight: 800;
}

.price-patch {
  min-width: 150px;
  padding: 18px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  font-size: 1.7rem;
  font-weight: 900;
  text-align: center;
}

.counter-row {
  display: grid;
  grid-template-columns: minmax(150px, 190px) repeat(3, minmax(120px, 1fr));
  gap: 10px;
  margin-bottom: 28px;
}

.counter-button,
.counter-box {
  display: grid;
  min-height: 68px;
  place-items: center;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  background: rgba(17,22,45,.72);
}

.counter-button {
  grid-template-columns: auto auto;
  column-gap: 8px;
}

.counter-box small,
.counter-button small {
  color: var(--muted);
  font-size: .78rem;
}

.event-info-panel {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 26px 36px;
  padding: 24px;
}

.info-item {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 12px;
}

.info-about {
  grid-row: span 3;
  grid-template-columns: 1fr;
}

.info-item p {
  margin: 5px 0;
  color: var(--muted);
  line-height: 1.45;
}

.content-block {
  margin: 0 0 18px;
}

.content-layout {
  margin: 0 0 18px;
}

.layout-cell-content {
  min-width: 0;
  color: var(--muted);
  line-height: 1.65;
}

.text-block p,
.media-copy p,
.video-block p,
.media-block figcaption {
  margin: 0 0 12px;
  color: var(--muted);
  line-height: 1.65;
}

.text-block p:last-child,
.media-copy p:last-child,
.video-block p:last-child {
  margin-bottom: 0;
}

.media-block {
  display: grid;
  gap: 16px;
  align-items: start;
}

.media-block figure {
  margin: 0;
}

.media-block img {
  width: 100%;
  object-fit: cover;
  border-radius: var(--radius);
}

.media-full img {
  max-height: 540px;
}

.media-left,
.media-right {
  grid-template-columns: minmax(220px, .9fr) minmax(0, 1fr);
}

.media-right figure {
  order: 2;
}

.media-small figure {
  max-width: 280px;
}

.media-medium figure {
  max-width: 420px;
}

.media-large figure,
.media-full figure {
  max-width: 100%;
}

.video-block iframe {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
  border-radius: var(--radius);
  background: #050816;
}

.info-icon {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--accent-2);
  font-size: .82rem;
  font-weight: 900;
}

.gallery-section,
.tags-section {
  margin-top: 28px;
}

.gallery-strip,
.gallery-masonry {
  display: grid;
  gap: 16px;
}

.gallery-strip {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.gallery-masonry {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.gallery-strip img,
.gallery-tile img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: var(--radius);
}

.gallery-tile {
  position: relative;
  min-height: 240px;
  overflow: hidden;
}

.gallery-tile span {
  position: absolute;
  right: 14px;
  bottom: 14px;
  left: 14px;
  font-weight: 900;
}

.members-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.member-card {
  padding: 22px;
}

.member-avatar {
  width: 82px;
  height: 82px;
  margin-bottom: 18px;
  border: 3px solid rgba(255,255,255,.08);
  border-radius: 50%;
}

.avatar-1 { background-image: linear-gradient(135deg, #d45cff, #39d5ff); }
.avatar-2 { background-image: linear-gradient(135deg, #ff8c5c, #8d4dff); }
.avatar-3 { background-image: linear-gradient(135deg, #63f3bd, #5c73ff); }
.avatar-4 { background-image: linear-gradient(135deg, #ff6b93, #c35cff); }

.member-card h2 {
  margin: 0 0 8px;
  font-size: 1.2rem;
}

.member-card span {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  padding: 0 10px;
  border-radius: 999px;
  color: #d9c5ff;
  background: rgba(141,77,255,.18);
  font-size: .82rem;
  font-weight: 800;
}

.member-card p,
.member-card small {
  color: var(--muted);
  line-height: 1.5;
}

.auth-panel,
.event-form,
.profile-head,
.profile-events {
  padding: 28px;
}

.auth-panel {
  max-width: 520px;
  margin: 0 auto;
}

.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 24px;
}

.tab {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  background: rgba(13,18,40,.72);
  font-weight: 900;
}

.tab.is-active {
  color: var(--text);
  border-color: transparent;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

.form-stack,
.form-grid {
  display: grid;
  gap: 18px;
}

.form-title-row {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 26px;
}

.form-title-row h1,
.auth-panel h1,
.profile-head h1 {
  font-size: 2.6rem;
}

.form-title-row p,
.profile-head p {
  margin: 8px 0 0;
  color: var(--muted);
}

.form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.wide {
  grid-column: 1 / -1;
}

.event-builder {
  display: grid;
  gap: 16px;
}

.builder-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.builder-head h2 {
  margin: 0;
  color: var(--text);
  font-size: 1.35rem;
}

.builder-head p {
  margin: 5px 0 0;
  color: var(--muted);
}

.builder-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.builder-remove {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted);
  background: rgba(13,18,40,.72);
  font-size: 1.3rem;
}

.builder-remove:hover {
  color: var(--danger);
  border-color: rgba(255,107,147,.55);
}

.story-composer {
  position: relative;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 14px;
  padding: 18px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(17,22,45,.84), rgba(7,11,28,.62));
}

.composer-ruler {
  width: 2px;
  min-height: 100%;
  margin: 8px auto;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(57,213,255,.9), rgba(141,77,255,.2));
}

.composer-paper {
  min-height: 520px;
  padding: 10px 0 40px;
  color: var(--text);
  outline: none;
  font-size: 1.04rem;
  line-height: 1.72;
}

.composer-paper h2,
.composer-paper h3 {
  margin: 18px 0 10px;
  color: var(--text);
  line-height: 1.15;
}

.composer-paper h2 {
  font-size: 1.9rem;
}

.composer-paper h3 {
  font-size: 1.35rem;
}

.composer-paper p {
  margin: 0 0 16px;
  color: #dfe3ff;
}

.composer-paper:empty::before {
  content: "Начните писать историю встречи...";
  color: rgba(229,232,255,.42);
}

.composer-layout,
.composer-media,
.composer-video {
  position: relative;
  margin: 22px 0;
}

.composer-layout {
  padding: 14px;
  border: 1px solid rgba(141,77,255,.26);
  border-radius: var(--radius);
  background: rgba(7,11,28,.42);
}

.composer-layout.is-dragging,
.composer-media.is-dragging,
.composer-video.is-dragging {
  opacity: .55;
}

.composer-layout-tools,
.composer-column-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 900;
}

.composer-layout-tools {
  justify-content: space-between;
  margin-bottom: 12px;
}

.composer-layout-tools strong {
  margin-right: auto;
  color: var(--text);
}

.composer-columns {
  display: grid;
  gap: 14px;
}

.composer-layout.layout-1 .composer-columns,
.content-layout.layout-1 {
  grid-template-columns: 1fr;
}

.composer-layout.layout-2 .composer-columns,
.content-layout.layout-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.composer-layout.layout-3 .composer-columns,
.content-layout.layout-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.composer-column {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(13,18,40,.72);
}

.composer-column-tools {
  justify-content: space-between;
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
}

.composer-column-tools button,
.composer-layout-tools button {
  min-height: 30px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(7,11,28,.76);
  font-size: .76rem;
  font-weight: 900;
}

.composer-layout-tools button.is-active {
  color: var(--text);
  border-color: rgba(141,77,255,.75);
  background: rgba(141,77,255,.3);
}

.composer-column-body {
  min-height: 150px;
  padding: 12px;
  outline: none;
}

.composer-column-body:empty::before {
  content: attr(data-placeholder);
  color: rgba(229,232,255,.42);
}

.composer-media {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(13,18,40,.88);
}

.composer-media img,
.editor-photo img,
.layout-cell-content .editor-photo img {
  display: block;
  width: 100%;
  max-height: 540px;
  object-fit: cover;
}

.composer-media figcaption,
.editor-photo figcaption,
.layout-cell-content figcaption {
  padding: 10px 12px;
  color: var(--muted);
  font-size: .9rem;
  line-height: 1.45;
  outline: none;
}

.composer-media [data-remove-media] {
  position: absolute;
  top: 8px;
  right: 8px;
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 50%;
  color: var(--text);
  background: rgba(7,11,28,.78);
}

.composer-video {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(13,18,40,.88);
}

.composer-video-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  color: var(--text);
}

.composer-video iframe {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
  background: #050816;
}

.drag-handle,
.layout-switcher button {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(7,11,28,.64);
  font-size: .78rem;
  font-weight: 900;
}

.drag-handle {
  width: 36px;
  padding: 0;
  cursor: grab;
}

.layout-switcher {
  display: flex;
  gap: 6px;
}

.layout-switcher button.is-active {
  color: var(--text);
  border-color: rgba(141,77,255,.75);
  background: rgba(141,77,255,.3);
}

.content-layout {
  display: grid;
  gap: 14px;
}

.content-layout.layout-1 {
  grid-template-columns: 1fr;
}

.content-layout.layout-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.content-layout.layout-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.layout-cell-content p {
  margin: 0 0 12px;
}

.layout-cell-content p:last-child {
  margin-bottom: 0;
}

.editor-photo {
  position: relative;
  margin: 12px 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(13,18,40,.88);
}

.editor-photo img,
.layout-cell-content .editor-photo img {
  display: block;
  width: 100%;
  max-height: 420px;
  object-fit: cover;
}

.editor-photo figcaption,
.layout-cell-content figcaption {
  padding: 10px 12px;
  color: var(--muted);
  font-size: .9rem;
  line-height: 1.45;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-weight: 800;
}

input,
textarea,
select {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  background: rgba(7, 11, 28, .8);
  outline: none;
}

textarea {
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
  border-color: rgba(195,92,255,.8);
}

.form-message,
.empty-state,
.loading,
.muted,
.auth-note {
  color: var(--muted);
}

.auth-note {
  margin: 18px 0 0;
  font-size: .88rem;
  line-height: 1.45;
}

.form-message.is-error {
  color: var(--danger);
}

.form-link {
  width: max-content;
  color: #b179ff;
  font-weight: 800;
}

.form-link:hover {
  color: var(--accent-2);
}

.profile-events {
  margin-top: 20px;
}

.profile-list {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.profile-event-row {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(7,11,28,.45);
}

.profile-event-row h3 {
  margin: 0;
  font-size: 1.08rem;
}

.profile-event-row p {
  margin: 5px 0 0;
  color: var(--muted);
}

.profile-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.profile-action {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(13,18,40,.72);
  font-size: .78rem;
  font-weight: 900;
}

.profile-action:hover {
  color: var(--text);
  border-color: rgba(141,77,255,.75);
}

.profile-action.danger {
  color: var(--danger);
}

.status-pill {
  align-self: start;
  min-width: 126px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-align: center;
  font-weight: 900;
}

.status-published {
  border-color: transparent;
  background: rgba(99,243,189,.18);
  color: var(--success);
}

.status-rejected {
  color: var(--danger);
}

.status-archived {
  color: var(--faint);
}

@media (max-width: 1100px) {
  .main-nav {
    display: none;
  }

  .connect-hero,
  .community-layout,
  .event-title-row,
  .event-info-panel {
    grid-template-columns: 1fr;
  }

  .hero-art {
    min-height: 380px;
  }

  .meetups-row,
  .meetups-grid,
  .members-grid,
  .gallery-masonry {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sidebar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .site-header,
  .detail-header,
  .site-footer,
  main {
    width: calc(100vw - 28px) !important;
    max-width: calc(100vw - 28px);
    margin-left: 14px !important;
    margin-right: 14px !important;
  }

  .site-header,
  .detail-header,
  .hero-actions,
  .form-title-row,
  .profile-event-row,
  .site-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .site-header {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
    min-height: 0;
    padding: 18px 0;
  }

  .brand {
    justify-content: flex-start;
  }

  .brand-mark {
    width: 40px;
    height: 40px;
  }

  .brand strong {
    font-size: 1.35rem;
  }

  .brand small {
    font-size: .68rem;
  }

  .main-nav {
    display: flex;
    order: 2;
    width: 100%;
    gap: 6px;
    overflow-x: auto;
    padding: 2px 0 8px;
    scrollbar-width: none;
  }

  .main-nav::after {
    flex: 0 0 14px;
    content: "";
  }

  .main-nav::-webkit-scrollbar {
    display: none;
  }

  .main-nav a {
    flex: 0 0 auto;
    min-height: 36px;
    padding: 9px 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(13,18,40,.58);
    font-size: .86rem;
    white-space: nowrap;
  }

  .main-nav a.is-active::after {
    display: none;
  }

  .main-nav a.is-active {
    border-color: rgba(141,77,255,.75);
    background: rgba(141,77,255,.25);
  }

  .header-actions {
    display: grid;
    grid-template-columns: 42px minmax(96px, 1fr);
    gap: 8px;
    width: 100%;
    justify-content: stretch;
    margin-left: 0;
  }

  .header-actions:has(.button) {
    grid-template-columns: minmax(0, 1fr) 42px;
  }

  .header-actions:has(.auth-login) {
    grid-template-columns: minmax(0, 1fr) minmax(92px, 112px);
  }

  .header-actions:has(.icon-button:first-child):has(.auth-login) {
    grid-template-columns: 42px minmax(96px, 1fr);
  }

  .header-actions .button {
    min-height: 42px;
    padding: 0 10px;
    font-size: .84rem;
    white-space: nowrap;
  }

  .header-actions .button-accent {
    grid-column: auto;
  }

  .compact-header .header-actions {
    grid-template-columns: minmax(0, 1fr) 42px;
  }

  .compact-header .header-actions:has(.auth-login) {
    grid-template-columns: minmax(0, 1fr) minmax(92px, 112px);
  }

  .site-header > .profile-link,
  .site-header > .auth-control {
    justify-self: end;
    margin-left: 0;
  }

  .site-header > .auth-login {
    width: 112px;
  }

  .compact-header .main-nav {
    display: flex;
  }

  .icon-button {
    width: 42px;
    height: 42px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(10, 12, 29, .36);
  }

  .connect-hero {
    min-height: 0;
    border-bottom: 0;
  }

  .hero-content {
    padding: 30px 0 24px;
  }

  .heart-doodle {
    display: none;
  }

  .hero-content h1,
  .page-head h1 {
    font-size: 2.55rem;
  }

  .hero-content p,
  .page-head p {
    width: 100%;
    max-width: 100%;
    font-size: 1rem;
    overflow-wrap: anywhere;
  }

  .hero-actions {
    gap: 10px;
  }

  .hero-actions .button {
    width: 100%;
  }

  .hero-art {
    min-height: 255px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
  }

  .character {
    bottom: 34px;
    width: 74px;
    height: 118px;
  }

  .character::before,
  .character::after {
    top: -18px;
    width: 28px;
    height: 40px;
  }

  .character::before {
    left: 12px;
  }

  .character::after {
    right: 12px;
  }

  .character-one { left: 8%; }
  .character-two { left: 33%; width: 70px; height: 112px; }
  .character-three { right: 28%; }
  .character-four { right: 5%; }

  .campfire {
    bottom: 28px;
    width: 92px;
    height: 92px;
  }

  .hero-stats,
  .panel-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    width: 100%;
    margin-top: 22px;
  }

  .hero-stats div:last-child {
    grid-column: 1 / -1;
  }

  .hero-stats dt,
  .panel-stats dt {
    font-size: .98rem;
  }

  .hero-stats dd,
  .panel-stats dd {
    font-size: .75rem;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
    margin: 30px 0 14px;
  }

  .section-heading h2,
  .side-panel h2,
  .profile-events h2 {
    font-size: 1.25rem;
  }

  .meetups-row,
  .meetups-grid,
  .members-grid,
  .gallery-masonry,
  .gallery-strip,
  .sidebar,
  .form-grid,
  .content-layout.layout-2,
  .content-layout.layout-3,
  .media-left,
  .media-right,
  .counter-row {
    grid-template-columns: 1fr;
  }

  .media-right figure {
    order: 0;
  }

  .builder-head {
    display: grid;
  }

  .builder-actions {
    justify-content: flex-start;
  }

  .story-composer {
    grid-template-columns: 1fr;
    padding: 14px;
  }

  .composer-ruler {
    display: none;
  }

  .composer-paper {
    min-height: 420px;
    font-size: 1rem;
  }

  .composer-layout.layout-2 .composer-columns,
  .composer-layout.layout-3 .composer-columns,
  .content-layout.layout-2,
  .content-layout.layout-3 {
    grid-template-columns: 1fr;
  }

  .composer-layout-tools {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .meetups-row {
    gap: 14px;
  }

  .meetup-body h3 {
    min-height: 0;
  }

  .community-layout {
    gap: 22px;
  }

  .feed-heading {
    align-items: stretch;
  }

  .post-filters,
  .filters {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 8px;
    scrollbar-width: none;
  }

  .post-filters::-webkit-scrollbar,
  .filters::-webkit-scrollbar {
    display: none;
  }

  .pill,
  .filter-button,
  .tag {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .post-card,
  .side-panel,
  .member-card {
    padding: 16px;
  }

  .post-author {
    grid-template-columns: auto 1fr auto;
  }

  .post-actions {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 14px;
    justify-content: flex-start;
  }

  .faux-image {
    min-height: 190px;
  }

  .gallery-tile {
    min-height: 190px;
  }

  .event-hero img {
    height: 320px;
  }

  .event-title-row h1,
  .form-title-row h1,
  .auth-panel h1,
  .profile-head h1 {
    font-size: 2.2rem;
  }

  .event-title-row {
    gap: 14px;
    margin: 20px 0;
  }

  .price-patch {
    width: 100%;
    min-width: 0;
    font-size: 1.25rem;
  }

  .event-date-card {
    top: 14px;
    left: 14px;
    width: 88px;
    padding: 12px 10px;
  }

  .event-date-card strong {
    font-size: 2.4rem;
  }

  .info-item,
  .info-about {
    grid-template-columns: 1fr;
  }

  .auth-panel,
  .event-form,
  .profile-head,
  .profile-events,
  .event-info-panel {
    padding: 20px;
  }

  .site-footer nav {
    flex-wrap: wrap;
    gap: 14px;
  }
}

@media (max-width: 520px) {
  .site-header,
  .detail-header,
  .site-footer,
  main {
    width: min(calc(100vw - 28px), 360px) !important;
    max-width: 360px;
    margin-left: 14px !important;
    margin-right: auto !important;
  }
}

@media (max-width: 420px) {
  .site-header,
  .detail-header,
  .site-footer,
  main {
    width: min(calc(100vw - 20px), 360px) !important;
    max-width: 360px;
    margin-left: 10px !important;
    margin-right: auto !important;
  }

  .hero-content h1,
  .page-head h1 {
    font-size: 2.2rem;
  }

  .hero-stats,
  .panel-stats {
    grid-template-columns: 1fr;
  }

  .character-one {
    left: 2%;
  }

  .character-four {
    right: 1%;
  }

  .meetup-cover {
    aspect-ratio: 1.35 / 1;
  }

  .post-card-large,
  .post-card {
    padding: 14px;
  }
}
