:root {
  --ink: #101010;
  --muted: #65666b;
  --line: #e2e3e6;
  --paper: #ffffff;
  --soft: #f5f5f6;
  --red: #bd1230;
  --red-dark: #850d22;
  --gold: #d7a52b;
  --night: #0b0c10;
  --radius: 22px;
  --shadow: 0 22px 70px rgba(17, 17, 17, 0.1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--soft);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
}
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }

.community-shell { width: min(1180px, calc(100% - 36px)); margin-inline: auto; }
.community-header {
  position: sticky;
  z-index: 50;
  top: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(11, 12, 16, 0.94);
  color: #fff;
  backdrop-filter: blur(14px);
}
.community-header-inner {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.community-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}
.community-mark {
  width: 43px;
  height: 43px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.22);
  border-radius: 50%;
  background: var(--red);
  font-weight: 900;
}
.community-mark img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center 22%;
}
.community-brand strong, .community-brand small { display: block; }
.community-brand strong { letter-spacing: 0.01em; }
.community-brand small { color: #aeb0b7; font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; }
.community-header-links { display: flex; align-items: center; gap: 8px; }
.community-header-links a {
  padding: 10px 13px;
  border-radius: 10px;
  color: #d8d9dd;
  font-size: 0.86rem;
  font-weight: 750;
  text-decoration: none;
}
.community-header-links a:hover, .community-header-links a.is-current { background: #202127; color: #fff; }

.community-hero {
  position: relative;
  overflow: hidden;
  padding: 96px 0 84px;
  background:
    radial-gradient(circle at 82% 20%, rgba(189, 18, 48, 0.35), transparent 28%),
    linear-gradient(135deg, #090a0d, #17181e 68%, #290b12);
  color: #fff;
}
.community-hero-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(330px, 0.8fr); gap: 56px; align-items: center; }
.community-eyebrow { margin: 0 0 14px; color: #e13c59; font-size: 0.76rem; font-weight: 900; letter-spacing: 0.18em; text-transform: uppercase; }
.community-hero h1, .community-auth-card h1, .community-page-title h1 {
  margin: 0;
  font-size: clamp(2.5rem, 6vw, 5.3rem);
  line-height: 0.96;
  letter-spacing: -0.065em;
}
.community-hero h1 span { color: #f05b72; }
.community-hero-copy { max-width: 680px; margin: 24px 0 0; color: #c8c9ce; font-size: clamp(1rem, 1.7vw, 1.22rem); }
.community-proof { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.community-proof span { padding: 9px 12px; border: 1px solid #36373e; border-radius: 999px; color: #d9dadf; font-size: 0.8rem; font-weight: 700; }
.community-hero-card { padding: 30px; border: 1px solid #3c2730; border-radius: 26px; background: rgba(14, 15, 19, 0.78); box-shadow: 0 28px 80px rgba(0, 0, 0, 0.35); }
.community-hero-card h2 { margin: 0 0 12px; font-size: 1.55rem; }
.community-feature-list { display: grid; gap: 13px; margin: 24px 0 0; padding: 0; list-style: none; }
.community-feature-list li { display: grid; grid-template-columns: 28px 1fr; gap: 10px; color: #d7d8dc; }
.community-feature-list li::before { content: "✓"; width: 25px; height: 25px; display: grid; place-items: center; border-radius: 50%; background: rgba(189,18,48,.25); color: #ff768c; font-weight: 900; }

.community-section { padding: 80px 0; }
.community-section-title { max-width: 720px; margin-bottom: 32px; }
.community-section-title h2 { margin: 0 0 12px; font-size: clamp(2rem, 4vw, 3.3rem); line-height: 1; letter-spacing: -0.05em; }
.community-section-title p { margin: 0; color: var(--muted); }
.community-benefits { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.community-benefit { padding: 24px; border: 1px solid var(--line); border-radius: 18px; background: var(--paper); }
.community-benefit span { display: inline-grid; place-items: center; width: 38px; height: 38px; margin-bottom: 28px; border-radius: 11px; background: #fff0f3; color: var(--red); font-weight: 900; }
.community-benefit h3 { margin: 0 0 8px; font-size: 1.05rem; }
.community-benefit p { margin: 0; color: var(--muted); font-size: 0.88rem; }

.community-enrol { background: #fff; }
.community-enrol-grid { display: grid; grid-template-columns: minmax(0, .8fr) minmax(380px, 1.2fr); gap: 52px; align-items: start; }
.community-qualifier { padding: 24px; border-radius: 18px; background: var(--night); color: #fff; }
.community-qualifier h3 { margin: 0 0 12px; }
.community-qualifier p { margin: 0; color: #bfc1c7; }
.community-qualifier strong { color: #fff; }

.community-card { padding: 30px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); box-shadow: var(--shadow); }
.community-form { display: grid; gap: 18px; }
.community-field { display: grid; gap: 7px; }
.community-field > span { font-size: 0.79rem; font-weight: 850; }
.community-field input, .community-field select, .community-field textarea {
  width: 100%;
  min-height: 52px;
  padding: 13px 15px;
  border: 1px solid #d4d5d9;
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  outline: none;
}
.community-field textarea { min-height: 116px; resize: vertical; }
.community-field input:focus, .community-field select:focus, .community-field textarea:focus { border-color: #8f9299; box-shadow: 0 0 0 4px rgba(17,17,17,.06); }
.community-plan-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.community-plan { position: relative; }
.community-plan input { position: absolute; opacity: 0; pointer-events: none; }
.community-plan label { display: block; min-height: 132px; padding: 20px; border: 2px solid var(--line); border-radius: 16px; cursor: pointer; }
.community-plan input:checked + label { border-color: var(--red); background: #fff6f7; box-shadow: 0 0 0 4px rgba(189,18,48,.08); }
.community-plan strong, .community-plan span, .community-plan small { display: block; }
.community-plan span { margin: 9px 0 1px; font-size: 1.45rem; font-weight: 900; }
.community-plan small { color: var(--muted); }
.community-save { display: inline-block; margin-top: 8px; color: var(--red); font-weight: 800; font-size: .75rem; }

.community-button { min-height: 50px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 18px; border: 1px solid transparent; border-radius: 11px; cursor: pointer; font-weight: 850; text-decoration: none; }
.community-button:disabled { cursor: wait; opacity: .62; }
.community-button-primary { background: var(--red); color: #fff; box-shadow: 0 12px 32px rgba(189,18,48,.22); }
.community-button-primary:hover { background: var(--red-dark); }
.community-button-dark { background: #111; color: #fff; }
.community-button-light { border-color: var(--line); background: #fff; color: #111; }
.community-message { display: none; padding: 13px 15px; border-radius: 11px; font-size: .86rem; font-weight: 700; }
.community-message.is-visible { display: block; }
.community-message.is-success { background: #eaf7f0; color: #12613e; }
.community-message.is-error { background: #fff0f2; color: #8b1025; }
.community-message.is-info { background: #edf4ff; color: #224e87; }
.community-note { margin: 0; color: var(--muted); font-size: .78rem; }
.community-hidden { display: none !important; }

.community-auth { min-height: calc(100vh - 76px); display: grid; place-items: center; padding: 60px 18px; background: radial-gradient(circle at 20% 10%, #fff1f4, transparent 31%), var(--soft); }
.community-auth-card { width: min(620px, 100%); padding: clamp(28px, 6vw, 50px); border: 1px solid var(--line); border-radius: 26px; background: #fff; box-shadow: var(--shadow); }
.community-auth-card h1 { font-size: clamp(2.4rem, 7vw, 4rem); }
.community-auth-card > p:not(.community-eyebrow) { color: var(--muted); }
.community-auth-card .community-form { margin-top: 30px; }

.community-app { min-height: 100vh; background: #f4f5f7; }
.community-app-header { position: sticky; z-index: 40; top: 0; border-bottom: 1px solid #27282f; background: #0b0c10; color: #fff; }
.community-app-header-inner { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.community-app-nav { display: flex; gap: 5px; overflow-x: auto; }
.community-app-nav button { flex: 0 0 auto; padding: 10px 13px; border: 0; border-radius: 9px; background: transparent; color: #afb1b8; cursor: pointer; font-weight: 800; }
.community-app-nav button:hover, .community-app-nav button.is-active { background: #23242a; color: #fff; }
.community-app-main { padding: 42px 0 80px; }
.community-page-title { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.community-page-title h1 { font-size: clamp(2.2rem, 5vw, 4rem); }
.community-page-title p { max-width: 660px; margin: 10px 0 0; color: var(--muted); }
.community-view { display: none; }
.community-view.is-active { display: block; }
.community-dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(300px, .55fr); gap: 20px; align-items: start; }
.community-panel { padding: 24px; border: 1px solid var(--line); border-radius: 18px; background: #fff; }
.community-panel + .community-panel { margin-top: 16px; }
.community-panel h2, .community-panel h3 { margin-top: 0; }
.community-composer textarea { width: 100%; min-height: 112px; margin-bottom: 12px; padding: 15px; border: 1px solid #d7d8db; border-radius: 12px; resize: vertical; }
.community-post { padding: 24px; border: 1px solid var(--line); border-radius: 18px; background: #fff; }
.community-post + .community-post { margin-top: 14px; }
.community-person { display: flex; align-items: center; gap: 11px; }
.community-avatar { width: 42px; height: 42px; display: grid; place-items: center; overflow: hidden; border-radius: 50%; background: #17181d; color: #fff; font-weight: 900; }
.community-avatar img { width: 100%; height: 100%; object-fit: cover; }
.community-profile-photo-field { display: grid; gap: 9px; padding-bottom: 4px; }
.community-profile-photo-label { font-size: .79rem; font-weight: 850; }
.community-profile-photo-row { display: flex; align-items: center; gap: 18px; }
.community-profile-photo-row > div:last-child { display: grid; gap: 3px; }
.community-profile-photo-row strong { font-size: .9rem; }
.community-profile-photo-control { position: relative; flex: 0 0 auto; }
.community-profile-avatar { width: 112px; height: 112px; border: 4px solid #fff; background: #17181d; font-size: 1.7rem; box-shadow: 0 0 0 1px #d8d9dd, 0 12px 30px rgba(17,17,17,.13); }
.community-profile-photo-plus { position: absolute; right: -2px; bottom: 2px; width: 36px; height: 36px; display: grid; place-items: center; padding: 0; border: 3px solid #fff; border-radius: 50%; background: var(--red); color: #fff; cursor: pointer; font-size: 1.5rem; font-weight: 500; line-height: 1; box-shadow: 0 5px 15px rgba(189,18,48,.3); }
.community-profile-photo-plus:hover { background: var(--red-dark); }
.community-profile-photo-plus:focus-visible { outline: 3px solid rgba(189,18,48,.25); outline-offset: 3px; }
.community-profile-photo-control.is-busy .community-profile-avatar { opacity: .55; }
.community-profile-photo-control.is-busy .community-profile-photo-plus { cursor: wait; opacity: .72; }
.community-profile-photo-menu { position: absolute; z-index: 20; top: calc(100% + 10px); left: 0; width: 245px; overflow: hidden; border: 1px solid #d9dade; border-radius: 14px; background: #fff; box-shadow: 0 18px 45px rgba(17,17,17,.2); }
.community-profile-photo-menu button { width: 100%; min-height: 46px; display: block; padding: 11px 14px; border: 0; background: #fff; color: #171717; cursor: pointer; font-size: .82rem; font-weight: 780; text-align: left; }
.community-profile-photo-menu button + button { border-top: 1px solid #ececef; }
.community-profile-photo-menu button:hover:not(:disabled), .community-profile-photo-menu button:focus-visible { background: #f5f5f6; outline: 0; }
.community-profile-photo-menu button.is-delete { color: #a10f28; }
.community-profile-photo-menu button:disabled { cursor: not-allowed; opacity: .42; }
.community-photo-viewer { position: fixed; z-index: 100; inset: 0; display: grid; place-items: center; padding: 24px; background: rgba(5,6,8,.82); backdrop-filter: blur(8px); }
.community-photo-viewer-dialog { width: min(620px, 100%); overflow: hidden; border-radius: 22px; background: #fff; box-shadow: 0 30px 90px rgba(0,0,0,.45); }
.community-photo-viewer-header { min-height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 14px 10px 20px; }
.community-photo-viewer-header button { width: 38px; height: 38px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%; background: #f0f1f3; color: #111; cursor: pointer; font-size: 1.5rem; line-height: 1; }
.community-photo-viewer img { width: 100%; max-height: min(72vh, 620px); display: block; object-fit: contain; background: #111; }
.community-modal-open { overflow: hidden; }
.community-person strong, .community-person small { display: block; }
.community-person small { color: var(--muted); }
.community-post-body { margin: 18px 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.community-comments { display: grid; gap: 10px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.community-comment { padding: 11px 13px; border-radius: 11px; background: var(--soft); font-size: .88rem; }
.community-comment strong { margin-right: 6px; }
.community-comment-form { display: flex; gap: 8px; }
.community-comment-form input { flex: 1; min-width: 0; min-height: 42px; padding: 9px 12px; border: 1px solid #d6d7da; border-radius: 10px; }
.community-chat-layout { display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 18px; align-items: start; }
.community-chat-room { position: relative; overflow: hidden; min-height: 680px; height: calc(100vh - 190px); display: grid; grid-template-rows: auto minmax(0, 1fr) auto; border: 1px solid var(--line); border-radius: 20px; background: #e9e6e1; box-shadow: var(--shadow); }
.community-chat-room::before { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .17; background-image: radial-gradient(#777 0.65px, transparent 0.65px); background-size: 15px 15px; }
.community-chat-header { position: relative; z-index: 2; min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 18px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.97); }
.community-chat-members-toggle { display: none; min-height: 38px; padding: 8px 11px; }
.community-chat-messages { position: relative; z-index: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 7px; padding: 22px 22px 30px; scroll-behavior: smooth; }
.community-chat-empty { margin: auto; max-width: 420px; padding: 24px; border-radius: 15px; background: rgba(255,255,255,.88); color: var(--muted); text-align: center; box-shadow: 0 8px 30px rgba(0,0,0,.06); }
.community-chat-message { width: min(76%, 640px); align-self: flex-start; padding: 9px 12px 7px; border-radius: 5px 15px 15px 15px; background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.community-chat-message.is-mine { align-self: flex-end; border-radius: 15px 5px 15px 15px; background: #fff0f3; }
.community-chat-message-author { margin-bottom: 2px; color: var(--red); font-size: .76rem; font-weight: 850; }
.community-chat-message.is-mine .community-chat-message-author { color: #5e3841; }
.community-chat-message-body { white-space: pre-wrap; overflow-wrap: anywhere; font-size: .94rem; }
.community-chat-message-time { display: block; margin-top: 3px; color: #85878c; font-size: .65rem; text-align: right; }
.community-chat-date { align-self: center; position: sticky; top: 3px; z-index: 2; margin: 8px 0; padding: 5px 9px; border-radius: 999px; background: rgba(255,255,255,.9); color: #666970; font-size: .68rem; font-weight: 800; box-shadow: 0 2px 8px rgba(0,0,0,.05); }
.community-unread-divider { display: flex; align-items: center; gap: 10px; margin: 13px 0; color: var(--red); font-size: .69rem; font-weight: 900; text-transform: uppercase; }
.community-unread-divider::before, .community-unread-divider::after { content: ""; flex: 1; height: 1px; background: rgba(189,18,48,.35); }
.community-new-messages { position: absolute; z-index: 5; right: 22px; bottom: 82px; padding: 8px 12px; border: 0; border-radius: 999px; background: #111; color: #fff; cursor: pointer; box-shadow: 0 8px 24px rgba(0,0,0,.22); font-size: .75rem; font-weight: 850; }
.community-chat-composer { position: relative; z-index: 3; display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 10px; padding: 13px; border-top: 1px solid var(--line); background: rgba(255,255,255,.98); }
.community-chat-composer textarea { width: 100%; max-height: 130px; min-height: 48px; padding: 12px 14px; border: 1px solid #d2d3d7; border-radius: 13px; outline: 0; resize: none; }
.community-chat-composer textarea:focus { border-color: #8f9299; box-shadow: 0 0 0 4px rgba(17,17,17,.06); }
.community-chat-members { position: sticky; top: 92px; display: grid; gap: 14px; max-height: calc(100vh - 112px); overflow-y: auto; }
.community-chat-members-heading { display: flex; align-items: center; justify-content: space-between; padding: 0 4px; }
.community-chat-members-heading span { min-width: 30px; padding: 4px 7px; border-radius: 999px; background: #e6e7ea; color: #55585f; text-align: center; font-size: .7rem; font-weight: 850; }
.community-chat-member-list { overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: #fff; }
.community-chat-member { display: flex; align-items: center; gap: 10px; padding: 12px 13px; }
.community-chat-member + .community-chat-member { border-top: 1px solid var(--line); }
.community-chat-member .community-avatar { width: 36px; height: 36px; font-size: .75rem; }
.community-chat-member strong, .community-chat-member small { display: block; }
.community-chat-member strong { font-size: .82rem; }
.community-chat-member small { max-width: 185px; overflow: hidden; color: var(--muted); font-size: .69rem; text-overflow: ellipsis; white-space: nowrap; }
.community-list-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.community-item-card { padding: 22px; border: 1px solid var(--line); border-radius: 17px; background: #fff; }
.community-item-card h3 { margin: 10px 0 8px; }
.community-item-card p { color: var(--muted); }
.community-item-card .community-button { margin-top: 8px; }
.community-badge { display: inline-flex; padding: 5px 8px; border-radius: 999px; background: #f0f1f3; color: #53565d; font-size: .7rem; font-weight: 850; text-transform: uppercase; }
.community-badge.is-live, .community-badge.is-approved { background: #e8f7ef; color: #14633f; }
.community-badge.is-pending { background: #fff5dd; color: #865c00; }
.community-empty { padding: 30px; border: 1px dashed #cdd0d5; border-radius: 16px; color: var(--muted); text-align: center; }
.community-profile-summary { padding: 24px; border-radius: 18px; background: #111218; color: #fff; }
.community-profile-summary p { color: #b9bbc2; }
.community-profile-summary strong { display: block; font-size: 1.2rem; }
.community-footer { padding: 36px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: .82rem; }

@media (max-width: 960px) {
  .community-hero-grid, .community-enrol-grid, .community-dashboard-grid { grid-template-columns: 1fr; }
  .community-benefits { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .community-list-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .community-chat-layout { grid-template-columns: 1fr; }
  .community-chat-members { position: static; display: none; max-height: none; }
  .community-chat-members.is-open { display: grid; }
  .community-chat-members-toggle { display: inline-flex; }
}

@media (max-width: 700px) {
  .community-shell { width: min(100% - 24px, 1180px); }
  .community-header-inner, .community-app-header-inner {
    min-height: 0;
    align-items: stretch;
    flex-direction: column;
    gap: 6px;
    padding: 8px 0 6px;
  }
  .community-brand { gap: 9px; align-self: flex-start; }
  .community-mark { width: 34px; height: 34px; border-width: 1px; }
  .community-brand strong { font-size: .82rem; line-height: 1.15; }
  .community-brand small { font-size: .58rem; line-height: 1.2; letter-spacing: .11em; }
  .community-header-links, .community-app-nav {
    width: 100%;
    gap: 2px;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .community-header-links::-webkit-scrollbar, .community-app-nav::-webkit-scrollbar { display: none; }
  .community-header-links a {
    flex: 1 0 auto;
    min-height: 32px;
    padding: 6px 8px;
    font-size: .7rem;
    text-align: center;
    white-space: nowrap;
  }
  .community-hero { padding: 64px 0; }
  .community-benefits, .community-plan-grid, .community-list-grid { grid-template-columns: 1fr; }
  .community-section { padding: 58px 0; }
  .community-card, .community-panel, .community-post { padding: 20px; }
  .community-page-title { align-items: stretch; flex-direction: column; }
  .community-chat-room { min-height: 620px; height: calc(100vh - 170px); border-radius: 14px; }
  .community-chat-messages { padding: 16px 12px 24px; }
  .community-chat-message { width: min(88%, 640px); }
  .community-chat-header { padding: 12px; }
  .community-chat-composer { gap: 7px; padding: 9px; }
  .community-chat-composer .community-button { min-height: 48px; padding-inline: 14px; }
  .community-profile-photo-row { align-items: flex-start; }
  .community-profile-avatar { width: 96px; height: 96px; }
  .community-profile-photo-menu { left: 0; width: min(245px, calc(100vw - 64px)); }
  .community-photo-viewer { padding: 14px; }
}
